From 2504df11e1275f63f4c53377bf91eee996360cb5 Mon Sep 17 00:00:00 2001 From: obrien Date: Wed, 16 Jun 2004 05:45:41 +0000 Subject: Import of Binutils from the FSF 2.15 branch (just post-.0 release). These bits are taken from the FSF anoncvs repo on 23-May-2004 04:41:00 UTC. --- contrib/binutils/ChangeLog | 1516 +- contrib/binutils/MAINTAINERS | 24 +- contrib/binutils/Makefile.def | 210 + contrib/binutils/Makefile.in | 25283 ++++++++++++++++++-- contrib/binutils/Makefile.tpl | 1435 ++ contrib/binutils/README-maintainer-mode | 2 +- contrib/binutils/bfd/ChangeLog | 5639 +---- contrib/binutils/bfd/ChangeLog-0001 | 16 +- contrib/binutils/bfd/ChangeLog-0203 | 11405 +++++++++ contrib/binutils/bfd/Makefile.am | 257 +- contrib/binutils/bfd/Makefile.in | 282 +- contrib/binutils/bfd/acinclude.m4 | 16 +- contrib/binutils/bfd/aclocal.m4 | 71 +- contrib/binutils/bfd/aout-arm.c | 48 +- contrib/binutils/bfd/aout-encap.c | 7 +- contrib/binutils/bfd/aout-target.h | 38 +- contrib/binutils/bfd/aoutf1.h | 55 +- contrib/binutils/bfd/aoutx.h | 985 +- contrib/binutils/bfd/archive.c | 624 +- contrib/binutils/bfd/archive64.c | 84 +- contrib/binutils/bfd/archures.c | 345 +- contrib/binutils/bfd/bfd-in.h | 603 +- contrib/binutils/bfd/bfd-in2.h | 2134 +- contrib/binutils/bfd/bfd.c | 586 +- contrib/binutils/bfd/bfdio.c | 442 + contrib/binutils/bfd/bfdwin.c | 251 + contrib/binutils/bfd/binary.c | 82 +- contrib/binutils/bfd/bout.c | 1579 ++ contrib/binutils/bfd/cache.c | 78 +- contrib/binutils/bfd/coff-alpha.c | 297 +- contrib/binutils/bfd/coff-arm.c | 427 +- contrib/binutils/bfd/coff-aux.c | 24 +- contrib/binutils/bfd/coff-i386.c | 69 +- contrib/binutils/bfd/coff-ia64.c | 10 +- contrib/binutils/bfd/coff-ppc.c | 874 +- contrib/binutils/bfd/coff-rs6000.c | 1919 +- contrib/binutils/bfd/coff-sparc.c | 54 +- contrib/binutils/bfd/coff64-rs6000.c | 1046 +- contrib/binutils/bfd/coffcode.h | 1091 +- contrib/binutils/bfd/coffgen.c | 164 +- contrib/binutils/bfd/cofflink.c | 985 +- contrib/binutils/bfd/coffswap.h | 85 +- contrib/binutils/bfd/config.bfd | 362 +- contrib/binutils/bfd/config.in | 29 +- contrib/binutils/bfd/configure | 1501 +- contrib/binutils/bfd/configure.host | 42 +- contrib/binutils/bfd/configure.in | 212 +- contrib/binutils/bfd/corefile.c | 59 +- contrib/binutils/bfd/cpu-alpha.c | 12 +- contrib/binutils/bfd/cpu-arc.c | 14 +- contrib/binutils/bfd/cpu-arm.c | 316 +- contrib/binutils/bfd/cpu-i386.c | 10 +- contrib/binutils/bfd/cpu-ia64-opc.c | 25 +- contrib/binutils/bfd/cpu-ia64.c | 6 +- contrib/binutils/bfd/cpu-powerpc.c | 48 +- contrib/binutils/bfd/cpu-rs6000.c | 13 +- contrib/binutils/bfd/cpu-s390.c | 4 +- contrib/binutils/bfd/cpu-sparc.c | 20 +- contrib/binutils/bfd/dep-in.sed | 1 + contrib/binutils/bfd/doc/ChangeLog | 552 +- contrib/binutils/bfd/doc/ChangeLog-9103 | 594 + contrib/binutils/bfd/doc/Makefile.am | 27 +- contrib/binutils/bfd/doc/Makefile.in | 37 +- contrib/binutils/bfd/doc/aoutx.texi | 6 +- contrib/binutils/bfd/doc/archive.texi | 7 +- contrib/binutils/bfd/doc/archures.texi | 184 +- contrib/binutils/bfd/doc/bfd.texinfo | 392 +- contrib/binutils/bfd/doc/bfdint.texi | 44 +- contrib/binutils/bfd/doc/bfdio.texi | 41 + contrib/binutils/bfd/doc/bfdt.texi | 221 +- contrib/binutils/bfd/doc/bfdwin.texi | 2 + contrib/binutils/bfd/doc/cache.texi | 10 +- contrib/binutils/bfd/doc/chew.c | 7 +- contrib/binutils/bfd/doc/coffcode.texi | 51 +- contrib/binutils/bfd/doc/core.texi | 10 +- contrib/binutils/bfd/doc/fdl.texi | 366 + contrib/binutils/bfd/doc/format.texi | 13 +- contrib/binutils/bfd/doc/hash.texi | 12 +- contrib/binutils/bfd/doc/init.texi | 2 +- contrib/binutils/bfd/doc/libbfd.texi | 126 +- contrib/binutils/bfd/doc/linker.texi | 12 +- contrib/binutils/bfd/doc/mmo.texi | 365 + contrib/binutils/bfd/doc/opncls.texi | 188 +- contrib/binutils/bfd/doc/reloc.texi | 443 +- contrib/binutils/bfd/doc/section.texi | 134 +- contrib/binutils/bfd/doc/syms.texi | 85 +- contrib/binutils/bfd/doc/targets.texi | 364 +- contrib/binutils/bfd/dwarf1.c | 78 +- contrib/binutils/bfd/dwarf2.c | 715 +- contrib/binutils/bfd/ecoff.c | 521 +- contrib/binutils/bfd/ecofflink.c | 492 +- contrib/binutils/bfd/ecoffswap.h | 237 +- contrib/binutils/bfd/efi-app-ia32.c | 4 +- contrib/binutils/bfd/efi-app-ia64.c | 4 +- contrib/binutils/bfd/elf-bfd.h | 1374 +- contrib/binutils/bfd/elf-eh-frame.c | 549 +- contrib/binutils/bfd/elf-strtab.c | 279 +- contrib/binutils/bfd/elf.c | 2476 +- contrib/binutils/bfd/elf32-arc.c | 43 +- contrib/binutils/bfd/elf32-arm.h | 1847 +- contrib/binutils/bfd/elf32-gen.c | 25 +- contrib/binutils/bfd/elf32-i386.c | 1290 +- contrib/binutils/bfd/elf32-ppc.c | 6337 +++-- contrib/binutils/bfd/elf32-s390.c | 2138 +- contrib/binutils/bfd/elf32-sparc.c | 2616 +- contrib/binutils/bfd/elf64-alpha.c | 1556 +- contrib/binutils/bfd/elf64-gen.c | 25 +- contrib/binutils/bfd/elf64-ppc.c | 6921 ++++-- contrib/binutils/bfd/elf64-ppc.h | 36 +- contrib/binutils/bfd/elf64-s390.c | 2164 +- contrib/binutils/bfd/elf64-sparc.c | 763 +- contrib/binutils/bfd/elf64-x86-64.c | 1456 +- contrib/binutils/bfd/elfarm-nabi.c | 238 +- contrib/binutils/bfd/elfarm-oabi.c | 126 +- contrib/binutils/bfd/elfcode.h | 810 +- contrib/binutils/bfd/elfcore.h | 148 +- contrib/binutils/bfd/elflink.c | 8740 ++++++- contrib/binutils/bfd/elfxx-ia64.c | 2407 +- contrib/binutils/bfd/elfxx-target.h | 149 +- contrib/binutils/bfd/format.c | 158 +- contrib/binutils/bfd/freebsd.h | 8 +- contrib/binutils/bfd/gen-aout.c | 2 +- contrib/binutils/bfd/genlink.h | 14 +- contrib/binutils/bfd/hash.c | 55 +- contrib/binutils/bfd/i386aout.c | 11 +- contrib/binutils/bfd/i386linux.c | 105 +- contrib/binutils/bfd/ieee.c | 1198 +- contrib/binutils/bfd/ihex.c | 136 +- contrib/binutils/bfd/init.c | 6 +- contrib/binutils/bfd/libaout.h | 211 +- contrib/binutils/bfd/libbfd-in.h | 502 +- contrib/binutils/bfd/libbfd.c | 1153 +- contrib/binutils/bfd/libbfd.h | 773 +- contrib/binutils/bfd/libcoff-in.h | 98 +- contrib/binutils/bfd/libcoff.h | 147 +- contrib/binutils/bfd/libecoff.h | 84 +- contrib/binutils/bfd/libieee.h | 12 +- contrib/binutils/bfd/libpei.h | 52 +- contrib/binutils/bfd/linker.c | 945 +- contrib/binutils/bfd/merge.c | 413 +- contrib/binutils/bfd/netbsd-core.c | 105 +- contrib/binutils/bfd/netbsd.h | 8 +- contrib/binutils/bfd/opncls.c | 742 +- contrib/binutils/bfd/osf-core.c | 64 +- contrib/binutils/bfd/pe-arm.c | 4 +- contrib/binutils/bfd/pe-i386.c | 2 +- contrib/binutils/bfd/peXXigen.c | 249 +- contrib/binutils/bfd/peicode.h | 156 +- contrib/binutils/bfd/po/BLD-POTFILES.in | 1 + contrib/binutils/bfd/po/Make-in | 24 +- contrib/binutils/bfd/po/SRC-POTFILES.in | 101 +- contrib/binutils/bfd/po/bfd.pot | 1726 +- contrib/binutils/bfd/ppcboot.c | 48 +- contrib/binutils/bfd/ptrace-core.c | 78 +- contrib/binutils/bfd/reloc.c | 977 +- contrib/binutils/bfd/reloc16.c | 105 +- contrib/binutils/bfd/rs6000-core.c | 26 +- contrib/binutils/bfd/sco5-core.c | 146 +- contrib/binutils/bfd/section.c | 332 +- contrib/binutils/bfd/simple.c | 257 + contrib/binutils/bfd/sparclinux.c | 448 +- contrib/binutils/bfd/sparcnetbsd.c | 3 +- contrib/binutils/bfd/srec.c | 189 +- contrib/binutils/bfd/stabs.c | 178 +- contrib/binutils/bfd/sunos.c | 372 +- contrib/binutils/bfd/syms.c | 325 +- contrib/binutils/bfd/sysdep.h | 2 +- contrib/binutils/bfd/targets.c | 509 +- contrib/binutils/bfd/tekhex.c | 76 +- contrib/binutils/bfd/trad-core.c | 92 +- contrib/binutils/bfd/version.h | 4 +- contrib/binutils/bfd/xcoff-target.h | 22 +- contrib/binutils/bfd/xcofflink.c | 867 +- contrib/binutils/binutils/ChangeLog | 2934 +-- contrib/binutils/binutils/ChangeLog-0001 | 2060 ++ contrib/binutils/binutils/ChangeLog-0203 | 2181 ++ contrib/binutils/binutils/ChangeLog-9197 | 4 +- contrib/binutils/binutils/ChangeLog-9899 | 2 +- contrib/binutils/binutils/MAINTAINERS | 60 +- contrib/binutils/binutils/Makefile.am | 69 +- contrib/binutils/binutils/Makefile.in | 81 +- contrib/binutils/binutils/NEWS | 51 +- contrib/binutils/binutils/README | 77 +- contrib/binutils/binutils/acinclude.m4 | 2 +- contrib/binutils/binutils/aclocal.m4 | 18 + contrib/binutils/binutils/addr2line.c | 71 +- contrib/binutils/binutils/ar.c | 382 +- contrib/binutils/binutils/arlex.l | 6 +- contrib/binutils/binutils/arparse.y | 10 +- contrib/binutils/binutils/arsup.c | 70 +- contrib/binutils/binutils/arsup.h | 36 +- contrib/binutils/binutils/binemul.c | 79 +- contrib/binutils/binutils/binemul.h | 32 +- contrib/binutils/binutils/bucomm.c | 268 +- contrib/binutils/binutils/bucomm.h | 70 +- contrib/binutils/binutils/budbg.h | 26 +- contrib/binutils/binutils/budemang.c | 6 +- contrib/binutils/binutils/budemang.h | 4 +- contrib/binutils/binutils/coffdump.c | 68 +- contrib/binutils/binutils/coffgrok.c | 81 +- contrib/binutils/binutils/coffgrok.h | 2 +- contrib/binutils/binutils/config.in | 12 +- contrib/binutils/binutils/configure | 993 +- contrib/binutils/binutils/configure.in | 34 +- contrib/binutils/binutils/cxxfilt.c | 291 + contrib/binutils/binutils/debug.c | 907 +- contrib/binutils/binutils/debug.h | 312 +- contrib/binutils/binutils/deflex.l | 36 +- contrib/binutils/binutils/dep-in.sed | 1 + contrib/binutils/binutils/dlltool.c | 833 +- contrib/binutils/binutils/dlltool.h | 32 +- contrib/binutils/binutils/dllwrap.c | 63 +- contrib/binutils/binutils/doc/Makefile.am | 28 +- contrib/binutils/binutils/doc/Makefile.in | 31 +- contrib/binutils/binutils/doc/addr2line.1 | 11 +- contrib/binutils/binutils/doc/ar.1 | 13 +- contrib/binutils/binutils/doc/binutils.texi | 932 +- contrib/binutils/binutils/doc/cxxfilt.man | 53 +- contrib/binutils/binutils/doc/dlltool.1 | 27 +- contrib/binutils/binutils/doc/fdl.texi | 368 + contrib/binutils/binutils/doc/nm.1 | 17 +- contrib/binutils/binutils/doc/objcopy.1 | 161 +- contrib/binutils/binutils/doc/objdump.1 | 127 +- contrib/binutils/binutils/doc/ranlib.1 | 11 +- contrib/binutils/binutils/doc/readelf.1 | 53 +- contrib/binutils/binutils/doc/size.1 | 13 +- contrib/binutils/binutils/doc/strings.1 | 21 +- contrib/binutils/binutils/doc/strip.1 | 114 +- contrib/binutils/binutils/filemode.c | 23 +- contrib/binutils/binutils/ieee.c | 2297 +- contrib/binutils/binutils/nm.c | 347 +- contrib/binutils/binutils/objcopy.c | 1437 +- contrib/binutils/binutils/objdump.c | 2396 +- contrib/binutils/binutils/po/Make-in | 24 +- contrib/binutils/binutils/po/POTFILES.in | 1 + contrib/binutils/binutils/po/binutils.pot | 1583 +- contrib/binutils/binutils/prdbg.c | 1876 +- contrib/binutils/binutils/rclex.c | 351 +- contrib/binutils/binutils/rclex.l | 34 +- contrib/binutils/binutils/rdcoff.c | 226 +- contrib/binutils/binutils/rddbg.c | 134 +- contrib/binutils/binutils/readelf.c | 4594 ++-- contrib/binutils/binutils/rename.c | 35 +- contrib/binutils/binutils/resbin.c | 274 +- contrib/binutils/binutils/rescoff.c | 63 +- contrib/binutils/binutils/resrc.c | 397 +- contrib/binutils/binutils/size.c | 105 +- contrib/binutils/binutils/srconv.c | 286 +- contrib/binutils/binutils/stabs.c | 1694 +- contrib/binutils/binutils/strings.c | 181 +- contrib/binutils/binutils/sysdump.c | 127 +- contrib/binutils/binutils/unwind-ia64.c | 219 +- contrib/binutils/binutils/unwind-ia64.h | 14 +- contrib/binutils/binutils/version.c | 32 +- contrib/binutils/binutils/wrstabs.c | 787 +- contrib/binutils/config-ml.in | 134 +- contrib/binutils/config.guess | 351 +- contrib/binutils/config.if | 86 +- contrib/binutils/config.sub | 218 +- contrib/binutils/configure | 5469 ++++- contrib/binutils/configure.in | 1607 +- contrib/binutils/gas/CONTRIBUTORS | 5 +- contrib/binutils/gas/ChangeLog | 3098 +-- contrib/binutils/gas/ChangeLog-0203 | 7519 ++++++ contrib/binutils/gas/ChangeLog-9295 | 6 +- contrib/binutils/gas/Makefile.am | 351 +- contrib/binutils/gas/Makefile.in | 1200 +- contrib/binutils/gas/NEWS | 490 +- contrib/binutils/gas/README | 43 +- contrib/binutils/gas/acinclude.m4 | 6 +- contrib/binutils/gas/aclocal.m4 | 1142 +- contrib/binutils/gas/app.c | 224 +- contrib/binutils/gas/as.c | 569 +- contrib/binutils/gas/as.h | 140 +- contrib/binutils/gas/atof-generic.c | 20 +- contrib/binutils/gas/bignum-copy.c | 9 +- contrib/binutils/gas/bignum.h | 4 +- contrib/binutils/gas/bit_fix.h | 2 +- contrib/binutils/gas/cgen.c | 87 +- contrib/binutils/gas/cgen.h | 53 +- contrib/binutils/gas/cond.c | 94 +- contrib/binutils/gas/config.in | 15 +- contrib/binutils/gas/config/obj-aout.c | 79 +- contrib/binutils/gas/config/obj-aout.h | 16 +- contrib/binutils/gas/config/obj-coff.c | 33 +- contrib/binutils/gas/config/obj-coff.h | 68 +- contrib/binutils/gas/config/obj-ecoff.c | 82 +- contrib/binutils/gas/config/obj-ecoff.h | 6 +- contrib/binutils/gas/config/obj-elf.c | 765 +- contrib/binutils/gas/config/obj-elf.h | 59 +- contrib/binutils/gas/config/obj-ieee.c | 8 +- contrib/binutils/gas/config/obj-ieee.h | 9 +- contrib/binutils/gas/config/obj-multi.h | 7 +- contrib/binutils/gas/config/tc-alpha.c | 670 +- contrib/binutils/gas/config/tc-alpha.h | 77 +- contrib/binutils/gas/config/tc-arc.c | 80 +- contrib/binutils/gas/config/tc-arc.h | 10 +- contrib/binutils/gas/config/tc-arm.c | 3907 ++- contrib/binutils/gas/config/tc-arm.h | 209 +- contrib/binutils/gas/config/tc-i386.c | 455 +- contrib/binutils/gas/config/tc-i386.h | 207 +- contrib/binutils/gas/config/tc-ia64.c | 1084 +- contrib/binutils/gas/config/tc-ia64.h | 73 +- contrib/binutils/gas/config/tc-ppc.c | 1110 +- contrib/binutils/gas/config/tc-ppc.h | 82 +- contrib/binutils/gas/config/tc-s390.c | 579 +- contrib/binutils/gas/config/tc-s390.h | 61 +- contrib/binutils/gas/config/tc-sparc.c | 275 +- contrib/binutils/gas/config/tc-sparc.h | 97 +- contrib/binutils/gas/config/te-generic.h | 2 +- contrib/binutils/gas/config/te-pe.h | 2 +- contrib/binutils/gas/config/te-ppcnw.h | 2 +- contrib/binutils/gas/configure | 13116 +++++++--- contrib/binutils/gas/configure.in | 817 +- contrib/binutils/gas/dep-in.sed | 4 +- contrib/binutils/gas/depend.c | 21 +- contrib/binutils/gas/doc/Makefile.am | 18 +- contrib/binutils/gas/doc/Makefile.in | 624 +- contrib/binutils/gas/doc/all.texi | 5 +- contrib/binutils/gas/doc/as.1 | 161 +- contrib/binutils/gas/doc/as.texinfo | 935 +- contrib/binutils/gas/doc/c-alpha.texi | 22 +- contrib/binutils/gas/doc/c-arm.texi | 88 +- contrib/binutils/gas/doc/c-i386.texi | 5 + contrib/binutils/gas/doc/c-ia64.texi | 14 +- contrib/binutils/gas/doc/c-ppc.texi | 22 + contrib/binutils/gas/doc/c-sh.texi | 48 +- contrib/binutils/gas/doc/c-sparc.texi | 2 +- contrib/binutils/gas/doc/gasver.texi | 1 + contrib/binutils/gas/doc/h8.texi | 4 +- contrib/binutils/gas/doc/internals.texi | 163 +- contrib/binutils/gas/dw2gencfi.c | 1042 + contrib/binutils/gas/dw2gencfi.h | 52 + contrib/binutils/gas/dwarf2dbg.c | 507 +- contrib/binutils/gas/dwarf2dbg.h | 36 +- contrib/binutils/gas/ecoff.c | 400 +- contrib/binutils/gas/ecoff.h | 64 +- contrib/binutils/gas/ehopt.c | 22 +- contrib/binutils/gas/emul.h | 10 +- contrib/binutils/gas/expr.c | 181 +- contrib/binutils/gas/expr.h | 43 +- contrib/binutils/gas/flonum-copy.c | 4 +- contrib/binutils/gas/flonum-mult.c | 6 +- contrib/binutils/gas/flonum.h | 16 +- contrib/binutils/gas/frags.c | 109 +- contrib/binutils/gas/frags.h | 63 +- contrib/binutils/gas/hash.c | 59 +- contrib/binutils/gas/hash.h | 28 +- contrib/binutils/gas/input-file.c | 74 +- contrib/binutils/gas/input-file.h | 18 +- contrib/binutils/gas/input-scrub.c | 55 +- contrib/binutils/gas/itbl-ops.c | 40 +- contrib/binutils/gas/itbl-ops.h | 33 +- contrib/binutils/gas/listing.c | 280 +- contrib/binutils/gas/listing.h | 30 +- contrib/binutils/gas/macro.c | 176 +- contrib/binutils/gas/macro.h | 50 +- contrib/binutils/gas/messages.c | 126 +- contrib/binutils/gas/obj.h | 77 +- contrib/binutils/gas/output-file.c | 36 +- contrib/binutils/gas/output-file.h | 6 +- contrib/binutils/gas/po/Make-in | 24 +- contrib/binutils/gas/po/POTFILES.in | 18 +- contrib/binutils/gas/po/gas.pot | 6118 ++--- contrib/binutils/gas/read.c | 971 +- contrib/binutils/gas/read.h | 188 +- contrib/binutils/gas/sb.c | 61 +- contrib/binutils/gas/sb.h | 32 +- contrib/binutils/gas/stabs.c | 51 +- contrib/binutils/gas/subsegs.c | 62 +- contrib/binutils/gas/subsegs.h | 6 +- contrib/binutils/gas/symbols.c | 537 +- contrib/binutils/gas/symbols.h | 198 +- contrib/binutils/gas/tc.h | 56 +- contrib/binutils/gas/write.c | 995 +- contrib/binutils/gas/write.h | 50 +- contrib/binutils/include/ChangeLog | 692 +- contrib/binutils/include/ansidecl.h | 41 +- contrib/binutils/include/aout/ChangeLog | 80 +- contrib/binutils/include/aout/aout64.h | 187 +- contrib/binutils/include/aout/stab.def | 29 +- contrib/binutils/include/bfdlink.h | 421 +- contrib/binutils/include/coff/ChangeLog | 1089 +- contrib/binutils/include/coff/arm.h | 2 + contrib/binutils/include/coff/ecoff.h | 67 +- contrib/binutils/include/coff/internal.h | 10 +- contrib/binutils/include/coff/pe.h | 52 +- contrib/binutils/include/coff/sh.h | 4 +- contrib/binutils/include/coff/ti.h | 45 +- contrib/binutils/include/demangle.h | 376 +- contrib/binutils/include/dis-asm.h | 241 +- contrib/binutils/include/elf/ChangeLog | 1557 +- contrib/binutils/include/elf/ChangeLog-9103 | 1914 ++ contrib/binutils/include/elf/arm.h | 4 + contrib/binutils/include/elf/common.h | 418 +- contrib/binutils/include/elf/dwarf2.h | 116 +- contrib/binutils/include/elf/external.h | 15 + contrib/binutils/include/elf/frv.h | 19 +- contrib/binutils/include/elf/h8.h | 6 +- contrib/binutils/include/elf/i370.h | 26 +- contrib/binutils/include/elf/ia64.h | 64 +- contrib/binutils/include/elf/internal.h | 73 +- contrib/binutils/include/elf/ip2k.h | 62 + contrib/binutils/include/elf/iq2000.h | 58 + contrib/binutils/include/elf/m32r.h | 101 +- contrib/binutils/include/elf/m68hc11.h | 55 +- contrib/binutils/include/elf/mips.h | 26 +- contrib/binutils/include/elf/mmix.h | 19 +- contrib/binutils/include/elf/mn10300.h | 17 +- contrib/binutils/include/elf/msp430.h | 56 + contrib/binutils/include/elf/ppc.h | 236 +- contrib/binutils/include/elf/ppc64.h | 156 + contrib/binutils/include/elf/reloc-macros.h | 23 +- contrib/binutils/include/elf/s390.h | 54 +- contrib/binutils/include/elf/sh.h | 146 +- contrib/binutils/include/elf/sparc.h | 31 +- contrib/binutils/include/elf/v850.h | 60 +- contrib/binutils/include/elf/x86-64.h | 24 +- contrib/binutils/include/elf/xstormy16.h | 6 +- contrib/binutils/include/elf/xtensa.h | 88 + contrib/binutils/include/fibheap.h | 5 + contrib/binutils/include/floatformat.h | 22 +- contrib/binutils/include/getopt.h | 144 + contrib/binutils/include/hashtab.h | 31 +- contrib/binutils/include/libiberty.h | 24 +- contrib/binutils/include/obstack.h | 40 +- contrib/binutils/include/opcode/ChangeLog | 2776 +-- contrib/binutils/include/opcode/ChangeLog-9103 | 3102 +++ contrib/binutils/include/opcode/alpha.h | 7 +- contrib/binutils/include/opcode/arc.h | 323 + contrib/binutils/include/opcode/cgen.h | 199 +- contrib/binutils/include/opcode/convex.h | 1707 ++ contrib/binutils/include/opcode/i386.h | 39 +- contrib/binutils/include/opcode/ia64.h | 13 +- contrib/binutils/include/opcode/np1.h | 422 + contrib/binutils/include/opcode/pn.h | 282 + contrib/binutils/include/opcode/ppc.h | 93 +- contrib/binutils/include/opcode/s390.h | 19 +- contrib/binutils/include/opcode/sparc.h | 23 +- contrib/binutils/include/partition.h | 4 + contrib/binutils/include/safe-ctype.h | 18 +- contrib/binutils/include/splay-tree.h | 25 +- contrib/binutils/install-sh | 167 +- contrib/binutils/ld/ChangeLog | 4975 +--- contrib/binutils/ld/ChangeLog-0001 | 3376 +++ contrib/binutils/ld/ChangeLog-0203 | 3580 +++ contrib/binutils/ld/ChangeLog-9197 | 2 +- contrib/binutils/ld/Makefile.am | 542 +- contrib/binutils/ld/Makefile.in | 547 +- contrib/binutils/ld/NEWS | 45 +- contrib/binutils/ld/README | 3 +- contrib/binutils/ld/aclocal.m4 | 18 + contrib/binutils/ld/config.in | 9 +- contrib/binutils/ld/configure | 972 +- contrib/binutils/ld/configure.host | 91 +- contrib/binutils/ld/configure.in | 44 +- contrib/binutils/ld/configure.tgt | 261 +- contrib/binutils/ld/deffile.h | 57 +- contrib/binutils/ld/deffilep.y | 384 +- contrib/binutils/ld/dep-in.sed | 1 + contrib/binutils/ld/emulparams/arcelf.sh | 11 + contrib/binutils/ld/emulparams/armelf.sh | 4 + contrib/binutils/ld/emulparams/armelf_linux.sh | 5 + contrib/binutils/ld/emulparams/armelf_oabi.sh | 3 + contrib/binutils/ld/emulparams/armpe.sh | 4 + contrib/binutils/ld/emulparams/elf32_sparc.sh | 1 + contrib/binutils/ld/emulparams/elf32b4300.sh | 10 + contrib/binutils/ld/emulparams/elf32bmip.sh | 37 + contrib/binutils/ld/emulparams/elf32bmipn32.sh | 22 + contrib/binutils/ld/emulparams/elf32bsmip.sh | 3 + contrib/binutils/ld/emulparams/elf32ebmip.sh | 2 + contrib/binutils/ld/emulparams/elf32elmip.sh | 2 + contrib/binutils/ld/emulparams/elf32l4300.sh | 4 + contrib/binutils/ld/emulparams/elf32lmip.sh | 7 + contrib/binutils/ld/emulparams/elf32lsmip.sh | 2 + contrib/binutils/ld/emulparams/elf32ppc.sh | 29 +- contrib/binutils/ld/emulparams/elf64_ia64.sh | 18 +- contrib/binutils/ld/emulparams/elf64_ia64_fbsd.sh | 2 + contrib/binutils/ld/emulparams/elf64_s390.sh | 35 +- contrib/binutils/ld/emulparams/elf64_sparc.sh | 45 +- contrib/binutils/ld/emulparams/elf64alpha.sh | 53 +- contrib/binutils/ld/emulparams/elf64bmip.sh | 23 + contrib/binutils/ld/emulparams/elf64ppc.sh | 44 +- contrib/binutils/ld/emulparams/elf_i386.sh | 1 + contrib/binutils/ld/emulparams/elf_s390.sh | 2 + contrib/binutils/ld/emulparams/elf_x86_64.sh | 34 +- contrib/binutils/ld/emulparams/sh.sh | 8 + contrib/binutils/ld/emulparams/shl.sh | 2 + contrib/binutils/ld/emulparams/shlelf.sh | 2 + contrib/binutils/ld/emulparams/vanilla.sh | 4 +- contrib/binutils/ld/emulparams/vsta.sh | 8 + contrib/binutils/ld/emultempl/alphaelf.em | 80 + contrib/binutils/ld/emultempl/armcoff.em | 134 +- contrib/binutils/ld/emultempl/armelf.em | 66 +- contrib/binutils/ld/emultempl/armelf_oabi.em | 54 +- contrib/binutils/ld/emultempl/elf32.em | 666 +- contrib/binutils/ld/emultempl/generic.em | 46 +- contrib/binutils/ld/emultempl/ia64elf.em | 62 + contrib/binutils/ld/emultempl/linux.em | 90 +- contrib/binutils/ld/emultempl/needrelax.em | 10 +- contrib/binutils/ld/emultempl/netbsd.em | 13 + contrib/binutils/ld/emultempl/pe.em | 982 +- contrib/binutils/ld/emultempl/ppc64elf.em | 279 +- contrib/binutils/ld/emultempl/sunos.em | 185 +- contrib/binutils/ld/emultempl/ticoff.em | 101 +- contrib/binutils/ld/emultempl/vanilla.em | 19 +- contrib/binutils/ld/fdl.texi | 367 + contrib/binutils/ld/gen-doc.texi | 5 + contrib/binutils/ld/genscripts.sh | 231 +- contrib/binutils/ld/h8-doc.texi | 2 +- contrib/binutils/ld/ld.1 | 367 +- contrib/binutils/ld/ld.h | 103 +- contrib/binutils/ld/ld.texinfo | 1465 +- contrib/binutils/ld/ldcref.c | 152 +- contrib/binutils/ld/ldctor.c | 69 +- contrib/binutils/ld/ldctor.h | 13 +- contrib/binutils/ld/ldemul.c | 136 +- contrib/binutils/ld/ldemul.h | 173 +- contrib/binutils/ld/ldexp.c | 406 +- contrib/binutils/ld/ldexp.h | 89 +- contrib/binutils/ld/ldfile.c | 279 +- contrib/binutils/ld/ldfile.h | 42 +- contrib/binutils/ld/ldgram.y | 168 +- contrib/binutils/ld/ldint.texinfo | 4 +- contrib/binutils/ld/ldlang.c | 2224 +- contrib/binutils/ld/ldlang.h | 405 +- contrib/binutils/ld/ldlex.h | 34 +- contrib/binutils/ld/ldlex.l | 140 +- contrib/binutils/ld/ldmain.c | 781 +- contrib/binutils/ld/ldmain.h | 23 +- contrib/binutils/ld/ldmisc.c | 244 +- contrib/binutils/ld/ldmisc.h | 27 +- contrib/binutils/ld/ldver.c | 4 +- contrib/binutils/ld/ldver.h | 4 +- contrib/binutils/ld/ldver.texi | 1 + contrib/binutils/ld/ldwrite.c | 133 +- contrib/binutils/ld/ldwrite.h | 7 +- contrib/binutils/ld/lexsup.c | 563 +- contrib/binutils/ld/mri.c | 126 +- contrib/binutils/ld/mri.h | 28 +- contrib/binutils/ld/pe-dll.c | 810 +- contrib/binutils/ld/pe-dll.h | 42 +- contrib/binutils/ld/scripttempl/armcoff.sc | 4 +- contrib/binutils/ld/scripttempl/elf.sc | 27 +- contrib/binutils/ld/scripttempl/pe.sc | 15 +- contrib/binutils/ld/sysdep.h | 29 +- contrib/binutils/libiberty/ChangeLog | 965 +- contrib/binutils/libiberty/Makefile.in | 841 +- contrib/binutils/libiberty/README | 5 +- contrib/binutils/libiberty/aclocal.m4 | 122 +- contrib/binutils/libiberty/argv.c | 6 +- contrib/binutils/libiberty/asprintf.c | 4 +- contrib/binutils/libiberty/calloc.c | 3 +- contrib/binutils/libiberty/config.in | 378 +- contrib/binutils/libiberty/config.table | 4 +- contrib/binutils/libiberty/configure | 8099 +++++-- contrib/binutils/libiberty/copysign.c | 8 +- contrib/binutils/libiberty/cp-demangle.c | 6874 +++--- contrib/binutils/libiberty/cp-demangle.h | 139 + contrib/binutils/libiberty/cp-demint.c | 241 + contrib/binutils/libiberty/cplus-dem.c | 480 +- contrib/binutils/libiberty/fibheap.c | 4 +- contrib/binutils/libiberty/floatformat.c | 303 +- contrib/binutils/libiberty/functions.texi | 237 +- contrib/binutils/libiberty/getcwd.c | 2 +- contrib/binutils/libiberty/getopt.c | 1056 + contrib/binutils/libiberty/getopt1.c | 190 + contrib/binutils/libiberty/getpwd.c | 3 + contrib/binutils/libiberty/hashtab.c | 255 +- contrib/binutils/libiberty/hex.c | 21 +- contrib/binutils/libiberty/lbasename.c | 20 +- contrib/binutils/libiberty/libiberty.texi | 4 +- contrib/binutils/libiberty/lrealpath.c | 128 + contrib/binutils/libiberty/maint-tool | 25 +- contrib/binutils/libiberty/make-relative-prefix.c | 396 + contrib/binutils/libiberty/md5.c | 114 +- contrib/binutils/libiberty/memchr.c | 2 +- contrib/binutils/libiberty/memcmp.c | 8 +- contrib/binutils/libiberty/memcpy.c | 9 +- contrib/binutils/libiberty/memmove.c | 4 +- contrib/binutils/libiberty/memset.c | 8 +- contrib/binutils/libiberty/physmem.c | 305 + contrib/binutils/libiberty/regex.c | 118 +- contrib/binutils/libiberty/rename.c | 5 +- contrib/binutils/libiberty/safe-ctype.c | 147 +- contrib/binutils/libiberty/sigsetmask.c | 4 +- contrib/binutils/libiberty/splay-tree.c | 10 +- contrib/binutils/libiberty/strcasecmp.c | 2 +- contrib/binutils/libiberty/strdup.c | 23 +- contrib/binutils/libiberty/strerror.c | 3 +- contrib/binutils/libiberty/strncasecmp.c | 2 +- contrib/binutils/libiberty/strncmp.c | 2 +- contrib/binutils/libiberty/strsignal.c | 2 +- contrib/binutils/libiberty/strstr.c | 4 +- contrib/binutils/libiberty/vasprintf.c | 25 +- contrib/binutils/libiberty/vfprintf.c | 3 +- contrib/binutils/libiberty/vprintf.c | 4 +- contrib/binutils/libiberty/vsprintf.c | 6 +- contrib/binutils/libiberty/xatexit.c | 2 +- contrib/binutils/libiberty/xmalloc.c | 2 +- contrib/binutils/libtool.m4 | 16 +- contrib/binutils/ltcf-c.sh | 2 +- contrib/binutils/ltcf-cxx.sh | 29 +- contrib/binutils/ltcf-gcj.sh | 8 +- contrib/binutils/ltconfig | 28 +- contrib/binutils/missing | 166 +- contrib/binutils/mkinstalldirs | 113 +- contrib/binutils/opcodes/ChangeLog | 3003 +-- contrib/binutils/opcodes/ChangeLog-0001 | 2224 ++ contrib/binutils/opcodes/ChangeLog-0203 | 2110 ++ contrib/binutils/opcodes/Makefile.am | 231 +- contrib/binutils/opcodes/Makefile.in | 239 +- contrib/binutils/opcodes/aclocal.m4 | 18 + contrib/binutils/opcodes/alpha-opc.c | 17 +- contrib/binutils/opcodes/arc-opc.c | 6 +- contrib/binutils/opcodes/arm-dis.c | 469 +- contrib/binutils/opcodes/arm-opc.h | 235 +- contrib/binutils/opcodes/cgen-asm.c | 94 +- contrib/binutils/opcodes/cgen-asm.in | 33 +- contrib/binutils/opcodes/cgen-dis.c | 58 +- contrib/binutils/opcodes/cgen-dis.in | 108 +- contrib/binutils/opcodes/cgen-ibld.in | 136 +- contrib/binutils/opcodes/cgen-opc.c | 129 +- contrib/binutils/opcodes/cgen.sh | 21 +- contrib/binutils/opcodes/config.in | 9 - contrib/binutils/opcodes/configure | 851 +- contrib/binutils/opcodes/configure.in | 7 +- contrib/binutils/opcodes/dep-in.sed | 1 + contrib/binutils/opcodes/dis-buf.c | 11 +- contrib/binutils/opcodes/dis-init.c | 43 + contrib/binutils/opcodes/disassemble.c | 58 +- contrib/binutils/opcodes/i386-dis.c | 736 +- contrib/binutils/opcodes/ia64-asmtab.c | 11789 ++++----- contrib/binutils/opcodes/ia64-dis.c | 4 +- contrib/binutils/opcodes/ia64-gen.c | 1225 +- contrib/binutils/opcodes/ia64-ic.tbl | 28 +- contrib/binutils/opcodes/ia64-opc-a.c | 567 +- contrib/binutils/opcodes/ia64-opc-b.c | 495 +- contrib/binutils/opcodes/ia64-opc-d.c | 42 +- contrib/binutils/opcodes/ia64-opc-f.c | 1062 +- contrib/binutils/opcodes/ia64-opc-i.c | 172 +- contrib/binutils/opcodes/ia64-opc-m.c | 863 +- contrib/binutils/opcodes/ia64-opc-x.c | 90 +- contrib/binutils/opcodes/ia64-opc.c | 88 +- contrib/binutils/opcodes/ia64-opc.h | 1 + contrib/binutils/opcodes/ia64-raw.tbl | 8 + contrib/binutils/opcodes/ia64-waw.tbl | 7 + contrib/binutils/opcodes/po/Make-in | 24 +- contrib/binutils/opcodes/po/POTFILES.in | 31 +- contrib/binutils/opcodes/po/opcodes.pot | 486 +- contrib/binutils/opcodes/ppc-dis.c | 113 +- contrib/binutils/opcodes/ppc-opc.c | 2578 +- contrib/binutils/opcodes/s390-dis.c | 8 +- contrib/binutils/opcodes/s390-mkopc.c | 90 +- contrib/binutils/opcodes/s390-opc.c | 81 +- contrib/binutils/opcodes/s390-opc.txt | 1411 +- contrib/binutils/opcodes/sh-dis.c | 180 +- contrib/binutils/opcodes/sh-opc.h | 615 +- contrib/binutils/opcodes/sparc-dis.c | 104 +- contrib/binutils/opcodes/sparc-opc.c | 14 +- contrib/binutils/symlink-tree | 25 + 661 files changed, 215219 insertions(+), 110845 deletions(-) create mode 100644 contrib/binutils/Makefile.def create mode 100644 contrib/binutils/Makefile.tpl create mode 100644 contrib/binutils/bfd/ChangeLog-0203 create mode 100644 contrib/binutils/bfd/bfdio.c create mode 100644 contrib/binutils/bfd/bfdwin.c create mode 100644 contrib/binutils/bfd/bout.c create mode 100644 contrib/binutils/bfd/doc/ChangeLog-9103 create mode 100644 contrib/binutils/bfd/doc/bfdio.texi create mode 100644 contrib/binutils/bfd/doc/bfdwin.texi create mode 100644 contrib/binutils/bfd/doc/fdl.texi create mode 100644 contrib/binutils/bfd/doc/mmo.texi create mode 100644 contrib/binutils/bfd/simple.c create mode 100644 contrib/binutils/binutils/ChangeLog-0001 create mode 100644 contrib/binutils/binutils/ChangeLog-0203 create mode 100644 contrib/binutils/binutils/cxxfilt.c create mode 100644 contrib/binutils/binutils/doc/fdl.texi create mode 100644 contrib/binutils/gas/ChangeLog-0203 create mode 100644 contrib/binutils/gas/doc/gasver.texi create mode 100644 contrib/binutils/gas/dw2gencfi.c create mode 100644 contrib/binutils/gas/dw2gencfi.h create mode 100644 contrib/binutils/include/elf/ChangeLog-9103 create mode 100644 contrib/binutils/include/elf/ip2k.h create mode 100644 contrib/binutils/include/elf/iq2000.h create mode 100644 contrib/binutils/include/elf/msp430.h create mode 100644 contrib/binutils/include/elf/ppc64.h create mode 100644 contrib/binutils/include/elf/xtensa.h create mode 100644 contrib/binutils/include/getopt.h create mode 100644 contrib/binutils/include/opcode/ChangeLog-9103 create mode 100644 contrib/binutils/include/opcode/arc.h create mode 100644 contrib/binutils/include/opcode/convex.h create mode 100644 contrib/binutils/include/opcode/np1.h create mode 100644 contrib/binutils/include/opcode/pn.h create mode 100644 contrib/binutils/ld/ChangeLog-0001 create mode 100644 contrib/binutils/ld/ChangeLog-0203 create mode 100644 contrib/binutils/ld/emulparams/arcelf.sh create mode 100644 contrib/binutils/ld/emulparams/elf32b4300.sh create mode 100644 contrib/binutils/ld/emulparams/elf32bmip.sh create mode 100755 contrib/binutils/ld/emulparams/elf32bmipn32.sh create mode 100755 contrib/binutils/ld/emulparams/elf32bsmip.sh create mode 100644 contrib/binutils/ld/emulparams/elf32ebmip.sh create mode 100644 contrib/binutils/ld/emulparams/elf32elmip.sh create mode 100644 contrib/binutils/ld/emulparams/elf32l4300.sh create mode 100644 contrib/binutils/ld/emulparams/elf32lmip.sh create mode 100755 contrib/binutils/ld/emulparams/elf32lsmip.sh create mode 100755 contrib/binutils/ld/emulparams/elf64bmip.sh create mode 100644 contrib/binutils/ld/emulparams/sh.sh create mode 100644 contrib/binutils/ld/emulparams/shl.sh create mode 100755 contrib/binutils/ld/emulparams/shlelf.sh create mode 100644 contrib/binutils/ld/emulparams/vsta.sh create mode 100644 contrib/binutils/ld/emultempl/alphaelf.em create mode 100644 contrib/binutils/ld/emultempl/ia64elf.em create mode 100644 contrib/binutils/ld/emultempl/netbsd.em create mode 100644 contrib/binutils/ld/fdl.texi create mode 100644 contrib/binutils/ld/ldver.texi create mode 100644 contrib/binutils/libiberty/cp-demangle.h create mode 100644 contrib/binutils/libiberty/cp-demint.c create mode 100644 contrib/binutils/libiberty/getopt.c create mode 100644 contrib/binutils/libiberty/getopt1.c create mode 100644 contrib/binutils/libiberty/lrealpath.c create mode 100644 contrib/binutils/libiberty/make-relative-prefix.c create mode 100644 contrib/binutils/libiberty/physmem.c create mode 100644 contrib/binutils/opcodes/ChangeLog-0001 create mode 100644 contrib/binutils/opcodes/ChangeLog-0203 create mode 100644 contrib/binutils/opcodes/dis-init.c (limited to 'contrib/binutils') diff --git a/contrib/binutils/ChangeLog b/contrib/binutils/ChangeLog index 9f39349..f054da6 100644 --- a/contrib/binutils/ChangeLog +++ b/contrib/binutils/ChangeLog @@ -1,3 +1,1353 @@ +2004-05-06 Daniel Jacobowitz + + * src-release (do-tar): Add directories to the tar file. + +2004-05-06 Daniel Jacobowitz + + Merge from mainline: + 2004-04-15 James E Wilson + * Makefile.tpl (configure-[+module+], configure-gcc, + configure-stage1-gcc, configure-stage2-gcc, configure-stage3-gcc): + Set and export LDFLAGS. + * Makefile.in: Regenerate. + +2004-04-19 Rainer Orth + + * configure.in (mips*-*-irix5*): Enable ld. + * configure: Regenerate. + +2004-04-09 Daniel Jacobowitz + + Merge from mainline: + 2004-03-25 Stan Shebs + Remove MPW support, no longer used. + * mpw-README, mpw-build.in, mpw-config.in, mpw-configure, + mpw-install: Remove files. + * src-release (DEVO_SUPPORT): Remove names of removed files. + * MAINTAINERS: Likewise. + + 2004-02-28 Andrew Cagney + * src-release (CVS_NAMES): Define. + (do-tar, do-tar): Prune $(CVS_NAMES). + + 2004-02-23 Andrew Cagney + * texinfo/texinfo.tex: Update from version 2003-02-03.16 to + 2004-02-19.09. + + 2004-02-19 Andrew Cagney + * config.guess: Update from version 2003-06-12 to 2004-02-16. + * config.sub: Update from version 2003-06-13 to 2004-02-16. + +2004-02-11 David Edelsohn + + * configure.in (powerpc-*-aix*): Add target-libada to noconfigdirs. + (rs6000-*-aix*): Same. + * configure: Regenerate. + +2004-02-11 Kelley Cook + + * configure.in (host): Add in missing $noconfigdirs to defines. + * configure: Regenerate. + +2004-02-10 Arnaud Charlet , + Nathanael Nerode + + PR ada/6637, PR ada/5911 + Merge with libada-branch: + * configure.in, Makefile.tpl, Makefile.def: Add target-libada, + with appropriate dependencies. Add --enable-libada configure switch. + * configure, Makefile.in: Regenerate. + +2004-02-05 Rainer Orth + + * configure.in: Don't pass --with-stabs on IRIX 5 either. + * configure: Regenerate. + +2004-02-02 Jeff Johnston + + * COPYING.NEWLIB: Update Red Hat license to 2004. + +2004-01-23 DJ Delorie + + * Makefile.def (target_modules) [libiberty]: Don't stage. + * Makefile.in: Rebuilt. + +2004-01-23 Jeff Johnston + + * COPYING.NEWLIB: Update to include copyrights for new + iconv code. + +2004-01-15 Andrew Cagney + + * src-release: Update copyright year. + (do-proto-toplev): Configure using i686-pc-linux-gnu. + (NEWLIB_SUPPORT_DIRS): Delete macro. + (newlib.tar.bz2): Delete rule. + +2004-01-14 Loren J. Rittle + + * Makefile.def (target_modules) [libtermcap, libiberty, zlib]: Stage. + * Makefile.tpl (configure-target-[+module+]): Support stage. + * Makefile.in: Rebuilt. + +2003-01-14 Maciej W. Rozycki + + * gettext.m4: Quote names of macros to be defined by AC_DEFUN + throughout. + +2004-01-04 Nathanael Nerode + + * configure.in: Use ./config.cache, not config.cache. + * configure: Regenerate. + * Makefile.tpl: Special-casing not needed for GCC any more. + * Makefile.in: Regenerate. + + * configure.in: Don't share a cache file for host dirs. + * configure: Regenerate. + + * config-ml.in: Don't mess with the cache file. + +2004-01-03 Nathanael Nerode + + * Makefile.tpl: Make GCC use a separate config.cache. + * Makefile.in: Regenerate. + + PR bootstrap/11932, PR bootstrap/11933 + (I don't know if it will fix either of them, but it relates + to them.) + * configure.in: Don't use shared config.cache for target + directories. + * configure: Regenerate. + +2003-12-31 Roger Sayle + + * configure.in (ia64*-*-hpux*): Disable building java libraries. + * configure: Regenerated. + +2003-12-21 Bernardo Innocenti + + * configure.in (*-*-uclinux): Exclude newlib, libgloss and rda. + * configure: Regenerated. + +2003-12-19 Nathanael Nerode + + Port change over from GCC: + 2003-11-20 Kelley Cook + * Makefile.tpl (BASE_FLAGS_TO_PASS): Pass along CONFIG_SHELL. + (configure-build-[+module+], configure-[+module+]): Likewise. + (configure-target-[+module+], configure-gcc, config.status): Likewise. + * Makefile.in: Regenerate. + +2003-12-08 Thomas Fitzsimmons + + * configure.in (raw_libstdcxx_flags): Remove the leading space. + * configure: Regenerate. + +2003-11-27 Jeff Johnston + + * COPYING.NEWLIB: Add license info for long long routines added to + stdlib. + +2003-11-14 Arnaud Charlet + + * Makefile.tpl (EXTRA_GCC_FLAGS): Pass BOOT_ADAFLAGS. + * Makefile.in: Regenerate. + +2003-10-20 Phil Edwards + + * configure.in (*-*-vxworks): Add target-libiberty to noconfdirs. + * configure: Regenerate. + +2003-10-13 Nathanael Nerode + + * Makefile.tpl: Make GCC_FLAGS_TO_PASS a superset of + HOST_FLAGS_TO_PASS. + * Makefile.in: Regenerate. + +2003-10-05 Mohan Embar + + * configure.in: Allow explicit specification of CFLAGS_FOR_BUILD. + * configure: Rebuilt + * Makefile.tpl: Use CFLAGS_FOR_BUILD computed by configure + * Makefile.in: Rebuilt + +2003-10-03 H.J. Lu + + * ltconfig (sys_lib_search_path_spec): Fix a typo for HPUX. + +2003-10-01 Phil Edwards + + * config-ml.in: Use ac_configure_args directly instead of + ml_arguments. Only set ml_norecursion if --no[-]recursion is + actually seen. + +2003-10-01 Eric Botcazou + + * config-ml.in: Propagate INSTALL variables. + +2003-09-21 Daniel Jacobowitz + + * configure.in: Pass a computed --program-transform-name + to subconfigures. + * configure: Regenerated. + +2003-09-20 Nathanael Nerode + + * Makefile.tpl: Don't pass down obsolete ENQUIRE variable. + * Makefile.in: Regenerate. + + * Makefile.tpl: Don't pass (unused) DLLTOOL or WINDRES to gcc. + * Makefile.in: Regenerate. + +2003-09-17 Daniel Jacobowitz + + * configure.in (TOPLEVEL_CONFIGURE_ARGUMENTS, baseargs): Fix + quoting. + * configure: Regenerated. + +2003-09-12 Michael Chastain + + Fix PR gdb/857. + * src-release (do-proto-topleve): Remove junk files + intl/config.cache, intl/config.status, + intl/config.h, intl/stamp-h. + +2003-09-14 Andrew Cagney + + * src-release (dejagnu.tar): New target. + (dejagnu.tar.bz2): Recursively call "gdb-taz" rule. + (do-djunpack): Use $(PACKAGE) for the package name. + +2003-09-04 DJ Delorie + + * configure: Regenerate. + +2003-09-04 Robert Millan + + * configure.in: Match GNU/KFreeBSD with new kfreebsd*-gnu triplet. + +2003-09-02 Kaveh R. Ghazi + + * configure.in: Ensure arguments to sed are properly spaced. + * configure: Regenerate. + +2003-08-28 Daniel Jacobowitz + + Merge from gcc: + 2003-07-20 Phil Edwards + * install-sh: Update to newer upstream versions (associated with + aclocal 1.7). + * missing: Likewise, plus $1Help2man -> $1 typo fix. + +2003-08-27 Daniel Jacobowitz + + * configure.in: Set RAW_CXX_FOR_TARGET if unset. + * configure: Regenerated. + +2003-08-23 Phil Edwards + + * configure.in: Use newline instead of semicolon when assuming + shell arguments in a for loop. + * configure: Regenerated. + +2003-08-20 Geoffrey Keating + + PR 8180 + * configure.in: When testing with_libs and with_headers, treat + 'no' as unset. Based on a patch by Dan Kegel . + * configure: Regenerate. + + * configure.in (TOPLEVEL_CONFIGURE_ARGUMENTS): Quote properly for + make, shell, etc. + (baseargs): Likewise. + * configure: Regenerate. + +2003-08-19 Geoffrey Keating + + * configure.in: Disable libgcj for darwin not on powerpc. + * configure: Rebuild. + +2003-08-15 Michael Chastain + + * src-release (do-proto-toplev): Remove junk files + dejagnu/example/calc/config.status, + dejagnu/example/calc/config.log. + +2003-08-14 Alexandre Duret-Lutz + + * config-ml.in, symlink-tree: Add license. + +2003-08-01 Nathanael Nerode + + Merge from gcc: + + 2003-08-01 Matt Kraai + * Makefile.tpl (check, check-c++): Express dependencies using + dependencies rather than commands. + * Makefile.in: Regenerate. + + 2003-07-31 Geoffrey Keating + * Makefile.tpl (libsubdir): Use gcc instead of gcc-lib. + * Makefile.in: Update. + +2003-08-01 Andrew Cagney + + * configure.in (noconfigdirs): Do not add GDB when m32r-*-*. + * configure: Ditto. + +2003-07-30 Andreas Tobler + + * configure.in: Enable libgcj for darwin. + * configure: Rebuild. + +2003-07-29 Nathanael Nerode + + * mkinstalldirs: Import autoconf 2.57 / automake 1.7 version. + +2003-07-27 Nathanael Nerode + + * Makefile.tpl: Use 'mkinstalldirs' rather than 'mkdir' when + creating target and build subdirs to build all parent dirs as needed. + * Makefile.in: Rebuild. + * configure.in: Don't build dirs explicitly here. + * configure: Rebuild. + +2003-07-22 Alexandre Oliva + + * Makefile.tpl (all-make): Depend on intl. + * Makefile.in: Rebuilt. + +2003-07-16 Nathanael Nerode + + * config.if: Remove unused libc_interface determination. + +2003-07-14 Nathanael Nerode + + * Makefile.in: Regenerate, correctly this time. + +2003-07-13 Nathanael Nerode + + * Makefile.tpl: Set INSTALL and friends using autoconf. Remove + unused INSTALL_PROGRAM_ARGS. + * configure.in: Use AC_PROG_INSTALL. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2003-07-10 Alexandre Oliva + + * configure: Rebuilt. + 2001-09-26 Alexandre Oliva + * configure.in (noconfigdirs) [am33_2.0-*-linux*]: Don't build + newlib nor libgloss. + Wed May 9 10:07:19 2001 Alexandre Oliva + * configure.in (am33_2.0-*-linux*): Added. + +2003-07-09 Bob Wilson + + * configure.in: Add ${libgcj} to noconfigdirs for xtensa-*-* targets. + * configure: Regenerate. + +2003-07-06 H.J. Lu + + * config-ml.in: Replace PWD with PWD_COMMAND. + * Makefile.tpl: Likewise. + * Makefile.in: Regenerated. + +2003-06-27 Nathanael Nerode + + * configure.in: Clean up config-lang.in handling. Delete + useless assignment to "subdirs". + * configure: Regenerate. + +2003-06-26 Nathanael Nerode + + * configure.in: Rename 'target_libs' to 'target_libraries'. + Remove useless reference to 'target_libs'. + * configure: Regenerate. + +2003-06-23 Keith Seitz + + * Makefile.tpl: Add maybe-configure-itcl to configure-gdb. + * Makefile.in: Regenerate. + +2003-06-23 Nathanael Nerode + + * Makefile.def: Introduce flags_to_pass. + * Makefile.tpl: Generate BASE_FLAGS_TO_PASS using it. + * Makefile.in: Regenerate. + +2003-06-23 Hans-Peter Nilsson + + * configure.in (noconfigdirs) : Disable target-newlib + and target-libgloss. + : Disable gdb. + : Disable libf2c and ${libgcj}. + * configure: Regenerate. + +2003-06-17 Benjamin Kosnik + + * configure.in: Update testsuite_flags to new location. + * configure. Regenerate. + +2003-06-18 Nathanael Nerode + + * Makefile.tpl: Remove BUILD_CC stuff. + * Makefile.in: Regenerate. + +2003-06-14 H.J. Lu + + * config.guess: Update to 2003-06-12 version. + * config.sub: Update to 2003-06-13 version. + +2003-06-12 Thiemo Seufer + + * MAINTAINERS: Add myself as MIPS co-maintainer. + +2003-06-12 H.J. Lu + + * config.guess: Update to 2003-06-06 version. + * config.sub: Update to 2003-06-06 version. + +2003-06-11 Rainer Orth + + * configure.in: Don't pass --with-stabs for mips*-sgi-irix6*o32. + * configure. Regenerate. + +2003-06-10 Nathanael Nerode + + * configure.in: Disable serial configure by default. + * configure: Regenerate. + * Makefile.tpl: Abolish .NOTPARALLEL. + * Makefile.in: Regenerate. + + * Makefile.tpl: Replace {build,host,target}_canonical by + {build,host,target}. + * Makefile.in: Regenerate. + + * Makefile.tpl: Fix stupid pasto. + * Makefile.in: Regenerate. + +2003-06-09 Nathanael Nerode + + * Makefile.tpl: Remove bogus conditional. + * Makefile.in: Regenerate. + +2003-06-03 Nathanael Nerode + + * Makefile.tpl: Make 'recursive targets' using autogen rather + than shell loop. Remove duplicate 'clean' targets and false + comments. + * Makefile.def: Add systematic dependencies to 'recursive' targets. + Add systematic method of specifying missing targets in subdirs. + Add copyright boilerplate. + * Makefile.in: Regenerate. + * configure.in: Add 'recursive targets' to maybe list. + * configure: Regenerate. + + * Makefile.tpl: Rename [+target+] to [+make_target+]. + * Makefile.def: Rename 'target' to 'make_target'. + +2003-05-30 Nick Clifton + + * README-maintainer-mode: Update URL for locating blessed config + tools. + +2003-05-29 Robert Millan + + * ltconfig: Import this patch and modify for use with current + version of ltconfig: + + 2003-05-21 Bruno Haible + + * libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER): Add support for + GNU/FreeBSD. + +2003-05-28 DJ Delorie + + * Makefile.tpl: Make maybe-check-gcc .PHONY. + * Makefile.in: Regenerate. + +2003-05-28 Jeff Johnston + + * COPYING.NEWLIB: Add license info for newlib/libc/sys/linux/stdlib. + +2003-05-21 DJ Delorie + + * Makefile.tpl (configure-target-libiberty): Depend only on gcc, not + newlib or libgloss. + * Makefile.in: Regenerate. + +2003-05-21 DJ Delorie + + * Makefile.tpl: Add missing empty maybe-check-gcc target. + * Makefile.in: Regenerate. + +2003-05-20 Maciej W. Rozycki + + * configure.in: Use curly braces in the definition of tooldir. + * configure: Regenerate. + +2003-05-19 Nathanael Nerode + + * configure.in: Switch more things to use maybe dependencies. + * Makefile.tpl: Switch more things to use maybe dependencies. + Factor out common code from autogen IF statements. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2003-05-14 Kelley Cook + + * configure.in: Accept i[3456789]86 for machine type. + * configure: Regenerate. + +2003-05-18 Nathanael Nerode + + * configure.in: Switch more things to use maybe dependencies. + Rearrange a little. Use GCC_TOPLEV_SUBDIRS. + * configure: Regenerate. + * Makefile.tpl: Switch more things to use maybe dependencies. + * Makefile.in: Regenerate. + +2003-05-16 Andreas Schwab + + * Makefile.tpl (install-opcodes): Define. + * Makefile.in: Rebuild. + +2003-05-13 Andreas Jaeger + + * config.guess: Update to 2003-05-09 version. + * config.sub: Update to 2003-05-09 version. + +2003-05-13 Michael Eager + + * configure.in: Correct sed script so that options in quotes are not + deleted. + * configure: Rebuild. + +2003-05-12 Corinna Vinschen + + * configure.in (FLAGS_FOR_TARGET): Remove $$s/newlib/libc/sys/cygwin + and $$s/newlib/libc/sys/cygwin32 include paths. + * configure: Ditto. + +2003-05-05 H.J. Lu + + * config-ml.in: Restored from gcc repository. + +2003-05-02 Chris Demetriou + + * Makefile.tpl: Require "makeinfo" from texinfo 4.2 or later. + * Makefile.in: Regenerate. + +2003-04-27 Daniel Jacobowitz + + * src-release (DEVO_SUPPORT): Add src-release, Makefile.tpl, + and Makefile.def. + +2003-04-27 Daniel Jacobowitz + + * Makefile.tpl: Clean $(BUILD_SUBDIR). + * Makefile.in: Regenerated. + +2003-04-18 Gerald Pfeifer + + * Makefile.tpl (MAKEINFOFLAGS): Default to --split-size=5000000. + * Makefile.in: Regenerate. + +2003-04-18 Jakub Jelinek + + * configure.in (powerpc64*-*-linux*): Remove. + * configure: Rebuilt. + +2003-04-17 Phil Edwards + + * Makefile.tpl (GCC_STRAP_TARGETS): New variable containing all the + previous bootstrap targets, plus bubblestrap, quickstrap, cleanstrap, + and restrap. + * Makefile.in: Regenerate. + +2003-04-16 Richard Earnshaw + + * configure.in (arm-*-netbsdelf*): Enable building java libraries. + * configure: Regenerated. + +2003-04-11 Alexandre Oliva + + * libtool.m4 (lt_cv_deplibs_check_method): Use pass_all on mips*. + * */configure: Rebuilt. + +2003-03-14 Nathanael Nerode + + * Makefile.tpl: Move .NOEXPORT, MAKEOVERRIDES back down. + * Makefile.in: Regenerate. + +2003-03-14 Michael Chastain + + * Makefile.in: Regenerate with correct Makefile.def. + +2003-03-12 Nathanael Nerode + + * Makefile.tpl: Move .NOEXPORT, MAKEOVERRIDES up. Delete unused + Make macro. + * Makefile.in: Regenerate. + * configure.in: Clean up gxx_include_dir logic. + * configure: Regenerate. + +2003-03-09 Franz Sirl + + * configure.in (gxx_include_dir): Fix typo. + * configure: Regenerated. + +2003-03-06 Andrew Cagney + + * texinfo/texinfo.tex: Import version 2003-02-03.16. + +2003-03-04 Daniel Jacobowitz + + * configure.in: Include $(build_tooldir)/sys-include in + FLAGS_FOR_TARGET. + * configure: Regenerated. + +2003-03-04 Nathanael Nerode + + * Makefile.tpl: Reindent. + * Makefile.in: Regenerate. + * configure.in: Reindent. Don't set unused variables. + * configure: Regenerate. + + * Makefile.tpl: Always pass down RANLIB. + * Makefile.in: Regenerate. + + * Makefile.tpl: Don't set unused enable_shared, enable_threads macros. + * Makefile.in: Regenerate. + * configure.in: Remove unused logic relating to --enable-shared + and --enable-threads. Remove bogus comments. Remove redundant + noconfigdirs. + * configure: Regenerate. + + * configure.in: Replace ${libstdcxx_version} by its value. + Remove reference to mh-dgux. + * configure: Regenerate. + +2003-02-28 Nathanael Nerode + + * Makefile.tpl: Rearrange. + * Makefile.in: Regenerate. + +2003-02-25 Nick Clifton + + * configure: Remove site-file supprot - it is obsolete. + +2003-02-24 Uwe Stieber + + * configure.in: Add support for kaOS as cross build target system. + * configure: Regenerated. + +2003-02-20 Sean McNeil + + * Makefile.tpl: Add definition of CPPFLAGS to pass into + configure-target-* as some target builds may require additional + flags for preprocessor tests. + * Makefile.in: Regenerated. + +2003-02-19 Alexandre Oliva + + * libtool.m4 (LD): Append -melf* option to LD on IRIX with GNU ld. + * ltconfig: Handle it. + * ltcf-cxx.sh: Use with_gnu_ld passed as a shell variable instead of + auto-detecting it. + +2003-02-19 Alexandre Oliva + + * ltcf-cxx.sh: Replace $linker_flags with $compiler_flags wherever + it is used as argument to $CC. + * ltcf-gcj.sh: Likewise. + +2003-02-19 Alexandre Oliva + + * configure.in: Introduce --enable-maintainer-mode. + * configure: Rebuilt. + * Makefile.tpl (Makefile.in, configure): Enable dependencies only + for maintainer mode. + * Makefile.in: Rebuilt. + +2003-02-19 Andrew Cagney + + * configure: Regenerate using autoconf 2.13. + +2003-02-19 Alan Modra + + * config.guess: Import latest version. + * config.sub: Import latest version. + +2003-02-18 Jason Merrill + + * Makefile.tpl (check-c++): Allow parallelism. + +2003-02-17 Andrew Cagney + + * configure: Regenerate using autoconf 000227. + +2003-02-15 Geoffrey Keating + + * configure.in (*-*-darwin*): Rename from powerpc*-*-darwin*, + don't configure target-libobjc. + * configure: Regenerate. + +2003-02-14 Rainer Orth + + * Makefile.tpl (RANLIB): Define. + * Makefile.in: Regenerate. + +2003-02-06 Keith R Seitz + + * Makefile.def: Remove "snavigator", "grep", and "db" modules. + * Makefile.tpl: Remove "all-snavigator" and "all-grep". + * Makefile.in: Regenerated. + * configure.in: Remove all traces of snavigator, db, and grep. + * configure: Regenerated. + +2003-01-31 Frank Ch. Eigler + + * Makefile.tpl (all-sid): Add libiberty/bfd/opcodes dependencies. + * Makefile.in: Regenerated. + +2003-01-30 Alexandre Oliva + + * config.if: Copy from GCC. + +2003-01-27 Phil Edwards + + * configure.in: Revert 24Jan change. + * configure: Regenerate. + +2003-01-23 Nathanael Nerode + + * configure.in: Revert previous change. + * configure: Regenerate. + +2003-01-23 Nathanael Nerode + + * configure.in: Make rda native-only. + * configure: Regenerate. + +2003-01-19 Nathanael Nerode + + * configure.in: Add missing \. + * configure: Rebuilt. + +2003-01-17 Jakub Jelinek + + * configure.in (baseargs): Avoid using \| in sed regular + expressions. + * configure: Rebuilt. + +2003-01-16 Jakub Jelinek + + * configure.in (baseargs): Remove all supported forms of + --cache-file, --srcdir, --host, --build and --target options + from argument lists. + * configure: Rebuilt. + +2003-01-15 Alexandre Oliva + + * configure.in (noconfigdirs): Don't skip gas on IRIX 6. + * configure: Rebuilt. + +2003-01-09 Nathanael Nerode + + * configure.in: Substitute TOPLEVEL_CONFIGURE_ARGUMENTS. + * Makefile.tpl: Pass TOPLEVEL_CONFIGURE_ARGUMENTS to gcc. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2003-01-09 Christian Cornelssen + + * Makefile.tpl (BASE_FLAGS_TO_PASS): Also pass DESTDIR. + (install-info, dir.info): Prepend $(DESTDIR) to $(infodir). + * Makefile.in: Regenerate. + +2003-01-09 Alexandre Oliva + + * configure.in: Remove Makefile in build, host and target modules + unless configure was run with --no-recursion. + * configure: Rebuilt. + +2003-01-08 Chris Demetriou + + * config.guess: Update to 2003-01-03 version. + * config.sub: Update to 2003-01-03 version. + +2003-01-07 Christopher Faylor + + * configure: Regenerate with proper autoconf 2.13. + +2003-01-07 Christopher Faylor + + * configure.in: Add AC_PREREQ for consistency. + * configure: Regenerate. + +2003-01-06 Andrew Cagney + + * configure.in (GDB_TK): Add tcl directories conditional on + gdb/gdbtk directory being present. + * configure: Regenerate. + +2003-01-04 John David Anglin + + * configure.in (LD): Improve test for gcc. Try to set LD to the ld used + by gcc if LD is not defined and we are not doing a Canadian Cross. + * configure: Rebuilt. + +2003-01-01 Daniel Jacobowitz + + * src-release (ETC_SUPPORT): Add fdl.texi and texi2pod.pl. + +2002-12-31 Tom Tromey + + * Makefile.in: Rebuilt. + * Makefile.def (target_modules) [libffi]: Allow installation. + +2002-12-31 Andreas Schwab + + * configure.in: Fix use of $program_transform_name. + * configure: Regenerated. + +2002-12-30 Daniel Jacobowitz + + * configure.in (baseargs): Don't remove first configure argument. + * configure: Regenerated. + +2002-12-29 Alexandre Oliva + + * Makefile.tpl (local-distclean): Don't remove... + (multilib.ts): ... this. Moved into... + (multilib.out): ... this. Don't use sub-make. + ($(BUILD_SUBDIR)/[+module+]/Makefile, [+module+]/Makefile, + $(TARGET_SUBDIR)/[+module+]/Makefile, gcc/Makefile): Moved into... + (configure-build-[+module+], configure-[+module+], + configure-target-[+module+], configure-gcc): ... these. Test + for Makefile existence. Drop config.status from dependencies. + * Makefile.in: Rebuilt. + * configure.in: Move gcc-version-trigger to the end of + ac_configure_args. Add comments to maybedep.tmp and + serdep.tmp. Introduce --disable-serial-configure. Remove + nonopt from baseargs, matching and removing corresponding + whitespace while at it. + * configure: Rebuilt. + +2002-12-28 Alexandre Oliva + + * configure.in (host_configargs): Replace reference to + no-longer-defined buildopts with --build=${build_alias}. + * configure: Rebuilt. + +2002-12-28 Alexandre Oliva + + * Makefile.tpl ($(NOTPARALLEL)): Move to the end. Bring uses of + program_transform_name to standard idiom. + (AUTOGEN, AUTOCONF): Define. + (Makefile.in): Use $(AUTOGEN). + (Makefile): Depend on config.status, and use autoconf-style rule to + build it. Move original commands to... + (config.status): ... this new target. + (configure): Add $(srcdir). Depend on config/acx.m4. Use + $(AUTOCONF). + * Makefile.in: Rebuilt. + +2002-12-28 Nathanael Nerode + + * Makefile.tpl: Fix dramatic bustage due to change in + program_transform_name. + * Makefile.in: Regenerate. + + * configure.in: Remove unnecessary PATH setting. + * configure: Regnerate. + + * configure.in: Don't default to unprefixed tools unless + the native tools will work. + * configure: Regenerate. + + * configure.in: Convert to autoconf script. Blow away lots + of now-redundant Makefile fragments. + * configure: Generate using Autoconf. + * Makefile.tpl: Rewrite to reflect autoconfiscation. + * Makefile.in: Regenerate. + +2002-12-27 Nathanael Nerode + + * configure: Remove unneeded 'export's. Make CC_FOR_TARGET, + CXX_FOR_TARGET, GCJ_FOR_TARGET substituted in configure.in only. + + * ChangeLog: Move a couple of entries from here to winsup/cygwin, + where they belong. + +2002-12-24 Andreas Schwab + + * Makefile.tpl (multilib.out): Fix missing space. + * Makefile.in: Regenerate. + +2002-12-23 Nathanael Nerode + + * Makefile.tpl: Use shared multilib.out. Use move-if-change for it. + Convert (cd foo; make) to (cd foo && make). Clean up multilib.out. + * Makefile.in: Regenerate. + * configure.in: Remove unnecessary leftovers. + +2002-12-21 Geoffrey Keating + + * configure.in (extra_ranlibflags_for_target): New variable. + (*-*-darwin): Add -c to ranlib commands. + * configure (tooldir): Handle extra_ranlibflags_for_target. + +2002-12-20 Jeff Johnston + + * COPYING.NEWLIB: Updated. + * COPYING.LIBGLOSS: Ditto. + +2002-12-19 Nathanael Nerode + + * Makefile.tpl: Revert HJL's change. + * Makefile.in: Regenerated. + * configure.in: Put build_prefix before $(BUILD_SUBDIR) here, and + always. + +2002-12-19 Andreas Schwab + + * Makefile.tpl, configure.in: Substitute libstdcxx_incdir. + * Makefile.in: Regenerate. + +2002-12-18 H.J. Lu + + * Makefile.tpl: Add @build_prefix@ before $(BUILD_SUBDIR). + * Makefile.in: Regenerated. + + * configure.in (build_prefix): New. Substitute. + +2002-12-18 Nathanael Nerode + + * Makefile.tpl: Don't let real targets depend on phony targets. + * Makefile.in: Regenerate. + + * Makefile.tpl (do-info): Depend on maybe-all-texinfo, not all-texinfo. + * Makefile.in: Regenerate. + +2002-12-16 Jason Merrill + + * Makefile.tpl (all-gcc): Use 'make quickstrap' if there was a + previous 'make bootstrap'. + * Makefile.in: Regenerate. + +2002-12-17 Hans-Peter Nilsson + + * configure.in (noconfigdirs) [mmix-*-*]: Disable libgloss and gdb. + +2002-12-13 Jason Merrill + + * Makefile.tpl (check-gcc-c++): Renamed from check-c++. Don't run + library tests. + (check-c++): Just depend on it and check-target-libstdc++-v3. + * Makefile.in: Regenerate. + +2002-12-13 Nathanael Nerode + + * configure.in, Makefile.tpl, Makefile.def: Remove tclX. + * Makefile.in: Regenerate. + +2002-12-12 Jeff Johnston + + * COPYING.NEWLIB: Update list of alternate Regent of California + licenses and discuss official revoking of advertising clause. + * COPYING.LIBGLOSS: Ditto. + +2002-12-12 Alexandre Oliva + + * Makefile.tpl (configure-target-rda): Depend on $(ALL_GCC_C). + * Makefile.in: Rebuilt. + +2002-12-10 Nathanael Nerode + + * configure: Fix bug put in by gremlins. + + * Makefile.tpl: Substitute more autoconfily. + * configure: Substitute more autoconfily. + * Makefile.in: Regenerate. + +2002-12-08 Andrew Cagney + + * Makefile.tpl (all-sim): Depend on maybe-configure-gdb. + * Makefile.in (all-sim): Ditto. + +2002-12-06 DJ Delorie + + * Makefile.tpl: Change configure dependencies to not have real + targets depend on phony targets. + +2002-12-05 Nathanael Nerode + + * configure.in: Revert unintentional change. + + * src-release: Configure host subdirs. + + * Makefile.tpl: Change dependency for */multilib.out so that + it works when gcc isn't in the tree. + + * configure.in: Substitute more. + * configure: Run subconfigures from the Makefile. + * Makefile.tpl: Run subconfigures from the Makefile; add a few + convenience targets. Make sure gcc isn't rebuilt after bootstrap. + +2002-12-03 Nathanael Nerode + + * Makefile.tpl: Add targets for configuring host subdirs in Makefile, + and corresponding dependencies. + * Makefile.in: Regenerate. + + * configure.in (host_tools): Order binutils, gas and ld for + convenience in running the testsuites. + + * Makefile.tpl: Introduce rules to serialize subconfigure runs. + * Makefile.in: Regenerate. + * configure.in: Introduce rules to serialize subconfigure runs. + + * configure.in: Introduce BASE_CC_FOR_TARGET. + * Makefile.tpl: Reorganize and comment. Introduce HOST_CONFIGARGS. + Realize configure-build-* targets. Realize configure-target-* targets. + * Makefile.in: Regenerate. + +2002-12-02 Nathanael Nerode + + * configure: Move gcc_version_trigger stuff from here... + * configure.in: ...to here. + + * configure.in: Separate subconfigure options added by this file from + options given by the user. Add machinery to put args for host + subconfigures into the Makefile. + + * Makefile.tpl: Remove 'vault' targets. + * Makefile.tpl: Reorder and comment dependencies. + * Makefile.in: Regenerate. + +2002-11-28 Geoffrey Keating + + * configure.in: Move host-specific darwin noconfigdirs into + the host-specific section. + +2002-12-02 Nathanael Nerode + + * Makefile.tpl: Restore bkorb's style patch, accidentally lost + during replay. + * Makefile.in: Regenerate. + + (finishing slow-motion replay) + * configure: Remove skip-this-dir support. + * Makefile.tpl: Remove skip-this-dir support. + + * Makefile.tpl: Remove leftover support for non-autoconfiscated + subdirectories. + * Makefile.in: Regenerate. + + * Makefile.tpl: Strip out useless setting of 'dir'. + * Makefile.in: Regenerate. + +2002-12-02 Nathanael Nerode + + (finishing slow-motion replay) + * configure.in: Fix deeply stupid bug. + + * configure.in: Introduce RAW_CXX_FOR_TARGET and simplify embedded + shell code in CXX_FOR_TARGET + * Makefile.def: Introduce raw_cxx. + * Makefile.tpl: Use raw_cxx to select between CXX_FOR_TARGET and + RAW_CXX_FOR_TARGET. + * Makefile.in: Regenerate. + +2002-12-02 Nathanael Nerode + + (finishing slow-motion replay) + * Makefile.tpl: Remove unnecessary ifs. + * Makefile.in: Regenerate. + + * Makefile.tpl: Implement soft dependency machinery. Maybe-ize + dependencies. Maybe-ize build-libiberty. Create dummy install + targets for 'no_install' modules. + * configure: Move GDB_TK substitution to configure.in. Move + build_modules stuff to configure.in. + * configure.in: Implement soft dependency machinery. Maybe-ize + GDB_TK, rearrange slightly. Move build_modules stuff from configure. + * Makefile.in: Regenerate. + +2002-12-01 Nathanael Nerode + + (continuing slow-motion replay) + * Makefile.tpl: Make all-target, install-target behave similarly + to all, install (only hitting configured targets). Eliminate + unused macro defintions. + + * Makefile.tpl: Add all-gcc: all-build-libiberty dependency when + build != host. + + * Makefile.tpl: Add all-gcc: all-libiberty dependency. + + * ltcf-c.sh, ltcf-gcj.sh, Makefile.tpl: Correct BUILD/HOST confusion. + + * configure.in: Produce lists of subdir targets we're actually + configuring. Remove references to "dosrel". + * Makefile.tpl: Let configure set which subdir targets are hit. + Remove install-cross; clean up install; remove ALL. Remove + references to "dosrel". Remove "EXTRA_TARGET_HOST" hackery. + Autogenerate host module targets. Remove empty dependency lines + and redundant dependency; rearrange slightly. + * Makefile.def: Add host-side libtermcap, utils. + + * Makefile.in: Regenerate. + +2002-12-01 Nathanael Nerode + + (Continuing slow-motion replay) + * Makefile.def: Add list of recursive targets to autogenerate. + Add build_modules. + * Makefile.tpl: Autogenerate do-* targets. Autogenerate *-target-* + targets. Autogenerate *-build-* targets. + * Makefile.in: Regenerate. + +2002-11-30 Nathanael Nerode + + (Continuing slow-motion replay) + * configure: More autoconf-style substitutions. + * Makefile.tpl: More autoconf-style substitutions. + * Makefile.in: Regenerate. + +2002-11-30 Nathanael Nerode + + (Continuing slow-motion replay) + * configure: Substitute more variables in a more autoconf-friendly + way. Simplify slightly. + * Makefile.tpl: Make more variables substitutable in an + autoconf-friendly way. + * Makefile.in: Regenerate. + +2002-11-29 Nathanael Nerode + + (Continuing slow-motion replay) + * configure.in (v810*): Remove special setting of tools. + + * configure: Add support for extra required flags for ar or nm. + * configure.in (aix4.3+): Use above support for target-specific + issues, rather than using config/mt-aix43. + +2002-11-29 Nathanael Nerode + + (Starting slow-motion replay merge from gcc 3.4 b-i-b branch) + * configure: Remove 'removing', which doesn't work. Replace $subdir + with . everywhere. Replace $subdirs with ''. Replace $makesrcdir + with $srcdir. Reformat indentation. Substitute some variables + formerly hard-coded in the Makefile for build=host. + * Makefile.tpl: Autogenerate more; make more autoconf-friendly. + * Makefile.def: Autogenerate more. + * Makefile.in: Regenerate. + +2002-11-13 Bruce Korb + + * Makefile.tpl: syntactic cleanup + +2002-11-04 Kevin Buettner + + * Makefile.def (host_modules): Add rda. + * Makefile.in: Regenerate. + * configure.in (target_tool): Add target-rda to list. + +2002-10-25 Phil Edwards + + * Makefile.tpl (bootstrap): Add bubblestrap, quickstrap, cleanstrap, + and restrap targets to this rule. + * Makefile.in: Regenerate. + +2002-10-24 Hans-Peter Nilsson + + * configure.in (i[3456]86-*-linux*): Add check to disable + ${libgcj} for glibc1. + +2002-10-07 Svein E. Seldal + + * configure.in: Add tic4x target. + +2002-10-03 Nathanael Nerode + + * Makefile.tpl: Make SET_LIB_PATH substitution more autoconfy. + * Makefile.tpl: Make RPATH_ENVVAR substitution more autoconfy. + * configure.in: Make SET_LIB_PATH substitution more autoconfy. + * configure.in: Make RPATH_ENVVAR substitution more autoconfy. + * Makefile.in: Regenerate. + +2002-10-02 Nathanael Nerode + + * Makefile.tpl: Eliminate reference to all-gui, all-libproc. + * Makefile.in: Regenerate. + + * Makefile.def: Remove order dependency comments. + * Makefile.tpl: Add explicit install-install dependencies. + * Makefile.in: Regenerate. + + * Makefile.tpl: Remove material now in src-release. (Finally!) + * Makefile.in: Regenerate. + + * configure: Restore my original patch by syncing with gcc version. + + * Bring following over from gcc: + +2002-09-30 Ulrich Weigand + + * configure.in (s390*-*-linux*): Enable libgcj. + +2002-10-02 Nathanael Nerode + + * Makefile.in: Regenerate. This really ought to fix things. :sigh: + +2002-10-02 Alan Modra + + * configure: Move stray lines back to where they belong. + +2002-10-01 Nathanael Nerode + + * Makefile.tpl: Insert configure-target target, for src-release. + + * configure: Finish reverting change which Andrew Cagney started + reverting. Should fix bustage. + + * src-release (BINUTILS_SUPPORT_DIRS): Add cpu directory. + * src-release: New file. Contains material for making net + releases for gdb, binutils, et al., formerly in Makefile.in. + +2002-09-30 Nick Clifton + + * cpu: New top level directory. Intended to hold input files for + CGEN which have FSF copyright assignment. + * Makefile.in (BINUTILS_SUPPORT_DIRS): Add cpu directory. + +2002-09-29 Andrew Cagney + + Revert below (note that src does not contain Makefile.tpl): + * Makefile.tpl: Make subsituted variables more autoconfy. + * Makefile.in: Regenerate. + +2002-09-29 Nathanael Nerode + + * configure: Revert accidentally applied changes. + + * Makefile.tpl: Make more autoconf-friendly. + * Makefile.in: Regenerate. + * configure: Make substitution more autoconf-like. + +2002-09-28 Richard Earnshaw + + * configure.in (arm-*-coff, strongarm-*-coff, xscale-*-coff): Use a + single entry to handle all these. + (arm-*-elf, strongarm-*-elf, xscale-*-elf): Likewise. Also enable + libjava on arm-*-elf. + +2002-09-27 Geoffrey Keating + + * configure.in (powerpc-*-darwin*): Don't configure BFD, TK, or the + things that depend on them. + +2002-09-25 Nathanael Nerode + + * Makefile.tpl: Make subsituted variables more autoconfy. + * Makefile.in: Regenerate. + * configure: Make seds more autoconfy. + +2002-09-25 Nathanael Nerode + + * Makefile.tpl: Rewrite substituted lines to look autoconfy. + * Makefile.in: Regenerate. + * configure.in: Rewrite sed statements to look autoconfy. + + * Makefile.tpl: Autogenerate *-target-* lists, dependencies of + all-target-foo on configure-target-foo. + * Makefile.def: Ditto. + * Makefile.in: Rebuild. + +2002-09-22 Nathanael Nerode + + * Makefile.def: New file. + * Makefile.tpl: New file. + * Makefile.in: Generate from Makefile.tpl with 'autogen Makefile.def'. + + * configure.in: Minor rearrangement. Simplify tests. + +2002-09-23 Jason Thorpe + + * configure.in (with_headers): Skip copy if value is "yes". + (with_libs): Likewise. + +2002-09-20 Nathanael Nerode + + * configure.in (*-*-netbsd*): Use noconfigdirs, not skipdirs. + * configure.in (sh*-*-pe*): Ditto. + * configure.in (mips*-*-pe*): Ditto. + * configure.in (*arm-wince-pe): Ditto. + + * configure.in: Rearrange. + +2002-09-12 Nick Clifton + + * Import these changes from the config master repository: + + 2002-09-05 Svein E. Seldal + + * config.sub: Add tic4x target. + + 2002-09-03 Ben Elliston + + * config.guess: Detect NSR-D machines for nsr-tandem-nsk. + Reported by . + +2002-09-10 Jeff Johnston + + * COPYING.NEWLIB: More updates. + +2002-09-09 Jeff Johnston + + * COPYING.NEWLIB: Update. + +2002-08-23 Andrew Cagney + + * texinfo/texinfo.tex: Import version 2002-06-04.06. + + * config.guess: Import version 2002-08-23. + * config.sub: Import version 2002-08-22. + +2002-08-20 Alexandre Oliva + + * Makefile.in (GCC_FOR_TARGET): Prepend STAGE_CC_WRAPPER. + * configure.in (CC_FOR_TARGET, GCJ_FOR_TARGET, CXX_FOR_TARGET, + CXX_FOR_TARGET_FOR_RECURSIVE_MAKE): Likewise. + +2002-08-06 Federico G. Schwindt + + * configure.in (hppa*-*-openbsd*): Treat like hppa*-*-*elf*. + +2002-08-04 H.J. Lu (hjl@gnu.org) + + * configure.in (mips*-*-linux*): Don't skip target-libffi. + +2002-07-31 Alan Modra + + * configure.in: Move generic linux case to end. Copy generic + linux noconfigdirs to mips*-*-linux* entry and new + powerpc64*-*-linux* entry. Add target-libffi for the latter. + +2002-07-19 Chris Demetriou + + * MAINTAINERS: Clarify on config.guess and config.sub, and add + one instance of them which was missed to the list to update. + +2002-07-16 Chris Demetriou + + * config.guess: Update to 2002-07-09 version. + * config.sub: Update to 2002-07-03 version. + 2002-07-11 Nathanael Nerode * configure.in: Remove two redundant tests. @@ -32,7 +1382,7 @@ 2002-07-03 Nick Clifton * contrib: New directory. Created to contain a copy of the - texi2pod.pl script so that it is in the same place as the version in + texi2pod.pl script so that it is in the same place as the version in the FSF GCC sources. 2002-07-02 Nathanael Nerode @@ -248,7 +1598,7 @@ * configure.in (target_libs): Remove target-libchill. Do not compute CHILL_FOR_TARGET. * libchill: Remove directory. - + 2002-04-15 DJ Delorie * Makefile.in, configure.in, configure: Sync with gcc, entries @@ -611,7 +1961,7 @@ Wed Sep 13 11:11:29 2000 Jeffrey A Law (law@cygnus.com) * configure.in: Re-enable all references to libg++ and librx. 2002-04-09 Loren James Rittle - + * configure.in: Add *-*-freebsd* configurations. 2002-04-07 Andrew Cagney @@ -763,7 +2113,7 @@ Wed Sep 13 11:11:29 2000 Jeffrey A Law (law@cygnus.com) libiberty. Import this patch from gcc: - + 2000-12-09 Laurynas Biveinis * symlink-tree: handle DOS-style absolute paths. @@ -913,7 +2263,7 @@ Wed Sep 13 11:11:29 2000 Jeffrey A Law (law@cygnus.com) Fri Jun 8 11:14:02 2001 Andrew Cagney * Makefile.in (VER): When present, extract the version number from - the file version.in. + the file version.in. 2001-06-08 Alexandre Oliva , Jeff Sturm @@ -1788,8 +3138,6 @@ Fri Apr 2 15:11:32 1999 H.J. Lu (hjl@gnu.org) Thu Mar 18 00:17:50 1999 Mark Elbrecht - * config/mh-go32: Delete. - * config/mh-djgpp: New. Renamed from mh-go32. * configure.in (pc-msdosdjgpp): Set host_makefile_frag to config/mh-djgpp. @@ -1840,7 +3188,6 @@ Wed Mar 10 17:39:09 1999 Drew Moseley 1999-02-24 Stan Shebs * configure.in (*-*-windows*): Remove, no longer used. - * config/mh-windows: Ditto. 1999-02-19 Ben Elliston @@ -1906,7 +3253,6 @@ Wed Mar 10 17:39:09 1999 Drew Moseley * config.guess: Add support for i386-pc-interix. * config.sub: Likewise. * configure.in: Likewise. - * config/mh-interix: New file. 1999-01-18 Christopher Faylor @@ -1919,7 +3265,6 @@ Wed Mar 10 17:39:09 1999 Drew Moseley * configure.in: makefile stub for cygwin target is probably unnecessary. Remove it for now. - * config/mt-cygwin: Remove. 1998-12-30 Christopher Faylor @@ -1927,7 +3272,6 @@ Wed Mar 10 17:39:09 1999 Drew Moseley target as well as the host. * config.guess: Allow mixed case in cygwin uname output. * Makefile.in: Add libtermcap target. - * config/mt-cygwin: New file. libtermcap target info. 1998-12-23 Jeffrey A Law (law@cygnus.com) @@ -2658,11 +4002,6 @@ Fri Feb 6 01:33:52 1998 Manfred Hollstein * configure: Emit a definition for the new macro enable_shared into each Makefile. - * config/mh-sparcpic (PICFLAG): Define to properly according - to current multilib configuration. - * config/mt-sparcpic (PICFLAG_FOR_TARGET): Define to properly - according to current multilib configuration. - Thu Feb 5 17:01:12 1998 Jason Molenda (crash@bugshack.cygnus.com) * configure.in (host_tools, native_only): Add libtool. @@ -2780,7 +4119,6 @@ Sun Jan 4 01:06:55 1998 Mumit Khan * config.sub: Add mingw32 support. * configure.in: Likewise. - * config/mh-mingw32: New file. Sat Jan 3 12:11:05 1998 Franz Sirl @@ -2998,8 +4336,6 @@ Thu Sep 18 15:37:42 1997 Andrew Cagney 1997-09-15 02:37 Ulrich Drepper - * config/mt-linux: Define CXXFLAGS to make sure -fvtable-thunks is - used. * configure.in: Name Linux target fragment. * configure: Rewrite so that project Makefile fragment is inserted @@ -3009,10 +4345,6 @@ Tue Sep 16 09:55:07 1997 Andrew Cagney * Makefile.in (install-itcl): Install tcl first. -Sun Sep 14 20:53:42 1997 Geoffrey Noer - - * config/mh-cygwin32: ok to build split texinfo files - Fri Sep 12 16:19:20 1997 Geoffrey Noer * configure.in: remove bison from noconfigdirs for Cygwin32 host @@ -3745,7 +5077,6 @@ Tue Oct 29 16:41:31 1996 Doug Evans Mon Oct 28 17:32:46 1996 Stu Grossman (grossman@critters.cygnus.com) * configure.in: Exclude mmalloc from i386-windows. - * config/mh-windows: Add rules for building MSVC makefiles. Thu Oct 24 09:22:46 1996 Stu Grossman (grossman@critters.cygnus.com) @@ -3761,8 +5092,6 @@ Thu Oct 24 09:02:07 1996 Stu Grossman (grossman@critters.cygnus.com) * Makefile.in (FLAGS_TO_PASS): Add $(HOST_FLAGS) to allow the host to add it's own flags. - * config/mh-windows (HOST_FLAGS): Set srcroot, which is needed - for MSVC build procedure. Tue Oct 22 15:20:26 1996 Ian Lance Taylor @@ -3813,7 +5142,7 @@ Wed Oct 9 06:06:46 1996 Jeffrey A Law (law@cygnus.com) Tue Oct 8 08:32:48 1996 Stu Grossman (grossman@critters.cygnus.com) - * configure.in config/mh-windows: Add support for windows host + * configure.in: Add support for windows host (that is a build done under the Microsoft build environment). Tue Oct 8 10:39:08 1996 Ian Lance Taylor @@ -3886,26 +5215,10 @@ Mon Sep 16 17:00:52 1996 Ian Lance Taylor * configure.in: Use a single line for host_tools and native_only. -Tue Sep 16 09:55:07 1997 Andrew Cagney - - * Makefile.in (install-itcl): Install tcl first. - -Sun Sep 14 20:53:42 1997 Geoffrey Noer - - * config/mh-cygwin32: ok to build split texinfo files - -Fri Sep 12 16:19:20 1997 Geoffrey Noer - - * configure.in: remove bison from noconfigdirs for Cygwin32 host - Mon Sep 9 12:21:30 1996 Doug Evans * config.sub, configure.in: Add entries for m32r. -Mon Sep 8 20:46:20 1997 Ian Lance Taylor - - * config.guess: Merge with FSF. - Thu Sep 5 13:52:47 1996 Tom Tromey * Makefile.in (inet-install): Don't run install-gzip. @@ -3963,11 +5276,6 @@ Mon Aug 12 13:15:13 1996 Michael Meissner * Makefile.in (CONFIGURE_TARGET_MODULES): If target compiler does not support --print-multi-lib, don't abort. -Sun Aug 11 20:51:50 1996 Stu Grossman (grossman@critters.cygnus.com) - - * config/mh-cygwin32 (CFLAGS): Define _WIN32 to be compatible - with normal Windows compilation environment. - Thu Aug 8 12:18:59 1996 Klaus Kaempf * make-all.com: Run config-a-gas. @@ -4608,12 +5916,6 @@ Mon Dec 4 12:38:15 1995 Ian Lance Taylor * configure: Ignore new autoconf configure options. -Thu Nov 30 14:45:25 1995 J.T. Conklin - - * config/mt-v810 (CC_FOR_TARGET): Add -ansi flag. NEC compiler - defaults to K&R mode, but doesn't have varargs.h, so we have to - compile in ANSI mode. - Thu Nov 30 16:57:33 1995 Per Bothner * config.guess: Recognize Pentium under SCO. @@ -4622,8 +5924,6 @@ Thu Nov 30 16:57:33 1995 Per Bothner Wed Nov 29 13:49:08 1995 J.T. Conklin * configure.in (noconfigdirs): Disable target-libio on v810-*-*. - * config/mt-v810 (CC_FOR_TARGET, AS_FOR_TARGET, AR_FOR_TARGET, - RANLIB_FOR_TARGET): Set as appropriate for NEC v810 toolchain. Wed Nov 29 12:12:01 1995 Ian Lance Taylor @@ -4692,10 +5992,6 @@ Wed Nov 15 11:45:23 1995 Ian Lance Taylor * configure: Handle LD and LD_FOR_TARGET when configuring a Canadian Cross. -Tue Nov 14 15:03:12 1995 Jason Molenda (crash@phydeaux.cygnus.com) - - * config/mh-i386win32: add LD_FOR_TARGET. - Tue Nov 14 14:56:11 1995 Jason Molenda (crash@phydeaux.cygnus.com) * configure.in (target_libs): add target-winsup. @@ -5034,10 +6330,6 @@ Mon Sep 18 23:08:26 1995 J.T. Conklin * configure.in (noconfigdirs): Disable bfd, binutils, gas, gcc, gdb, ld and opcodes on v810-*-*. -Sat Sep 16 18:31:08 PDT 1995 Angela Marie Thomas - - * config/mh-ncrsvr43: Removed AR_FLAGS - Tue Sep 12 18:03:31 1995 Ian Lance Taylor * Makefile.in (DO_X): Change do-realclean to do-maintainer-clean. @@ -5217,8 +6509,6 @@ Mon Jun 5 18:26:36 1995 Jason Merrill (FLAGS_TO_PASS): Pass them. (EXTRA_TARGET_FLAGS): Ditto. - * config/m?-*pic: Define PICFLAG* instead of LIB*FLAGS*. - Wed May 31 22:27:42 1995 Jim Wilson * Makefile.in (all-libg++): Depend on all-libstdc++. @@ -5382,17 +6672,12 @@ Thu Mar 30 13:51:43 1995 Ian Lance Taylor Tue Mar 28 14:47:34 1995 Jason Molenda (crash@phydeaux.cygnus.com) - build-all.mk,config/mh-solaris: revert these two changes: + Revert this change: Tue Mar 30 10:03:09 1993 Ian Lance Taylor (ian@cygnus.com) * build-all.mk: Use CC=cc -Xs on Solaris. - Mon Mar 29 19:59:26 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * config/mh-solaris: SunPRO C needs -Xs to be able to get a - working xmakefile for Emacs. - Tue Mar 21 10:43:32 1995 Jim Kingdon (kingdon@lioth.cygnus.com) * glob/*: Removed. Schauer's 24 Feb 1994 readline change made us @@ -5531,7 +6816,7 @@ Sat Nov 5 18:43:30 1994 Jason Merrill (jason@phydeaux.cygnus.com) (BASE_FLAGS_TO_PASS): Pass them. (EXTRA_TARGET_FLAGS): Ditto. - * configure.in, config/m[th]-*pic: Support --enable-shared. + * configure.in: Support --enable-shared. Sat Nov 5 15:44:00 1994 Per Bothner @@ -5989,7 +7274,6 @@ Fri May 6 14:19:25 1994 Steve Chamberlain (sac@cygnus.com) (HOST_CC, HOST_PREFIX, HOST_PREFIX_1): Undefine, they should be set by incoming names or templates. (INSTALL_LAST): New rule. - * config/mh-go32: New fragment. Thu May 5 17:35:05 1994 Stan Shebs (shebs@andros.cygnus.com) @@ -5997,8 +7281,6 @@ Thu May 5 17:35:05 1994 Stan Shebs (shebs@andros.cygnus.com) Thu May 5 20:06:45 1994 Ken Raeburn (raeburn@cujo.cygnus.com) - * config/mh-lynxrs6k: Renamed from mh-lynxosrs6k, to make it - unique in 8.3 naming schemes. * configure.in (appdirs): New variable. Currently empty, but will be used in gas distribution. If nonempty, lists a set of directories at least one of which must get configured, or top @@ -6230,10 +7512,6 @@ Wed Feb 2 14:53:05 1994 Jim Kingdon (kingdon@lioth.cygnus.com) * Makefile.in, test-build.mk: Remove MUNCH_NM; it was only needed for GDB and GDB has been fixed to not need it. -Mon Jan 31 18:40:55 1994 Stu Grossman (grossman at cygnus.com) - - * config/mh-lynxosrs6k: Account for lack of ranlib! - Sun Jan 30 17:58:06 1994 Ken Raeburn (raeburn@cujo.cygnus.com) * config.guess: Recognize vax hosts. @@ -6319,7 +7597,6 @@ Thu Dec 2 14:35:54 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) libg++ or libio for any Alpha target. * configure.in (mips*-sgi-irix5*): New target; use mh-irix5. - * config/mh-irix5. New file for Irix 5. Wed Dec 1 17:00:33 1993 Jason Merrill (jason@deneb.cygnus.com) @@ -6488,10 +7765,6 @@ Fri Oct 8 14:15:39 1993 Ken Raeburn (raeburn@cygnus.com) * config.sub: Accept linux*coff and linux*elf as operating systems. -Tue Oct 7 14:24:41 1997 Ian Lance Taylor - - * ltmain.sh: Handle symlinks in generated script. - Thu Oct 7 12:57:19 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * config.sub: Recognize mips64, and mips3 as an alias for it. @@ -6516,27 +7789,11 @@ Mon Oct 4 16:15:09 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) --with options (but still pass them down on the command line, if they were explicitly specified). -Wed Oct 1 13:11:27 1997 Ian Lance Taylor - - * configure: Handle autoconf style directory options: --bindir, - --datadir, --includedir, --infodir, --libdir, --libexecdir, - --mandir, --oldincludedir, --sbindir, --sharedstatedir, - --sysconfdir. - * Makefile.in (sbindir, libexecdir, sysconfdir): New variables. - (sharedstatedir, localstatedir, oldincludedir): New variables. - (BASE_FLAGS_TO_PASS): Pass down bindir, datadir, includedir, - infodir, libdir, libexecdir, localstatedir, mandir, oldincludedir, - sbindir, sharedstatedir, and sysconfdir. - Fri Sep 24 19:11:13 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) * configure: substitute SHELL value in Makefile.in with ${CONFIG_SHELL} -Wed Sep 24 15:18:32 1997 Ian Lance Taylor - - * ltmain.sh: Tweak shell pattern to avoid bug in NetBSD /bin/sh. - Thu Sep 23 18:05:13 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * configure.in: Build gas, ld, and binutils for *-*-sysv4* and @@ -7030,8 +8287,6 @@ Sat Apr 17 17:19:50 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * configure.in: rename m88k-motorola-m88kbcs to m88k-motorola-sysv - * config/mh-delta88: remove extraneous GCC references - Tue Apr 13 16:52:16 1993 Brendan Kehoe (brendan@lisa.cygnus.com) * Makefile.in (PRMS): Set back to all-prms. @@ -7107,8 +8362,7 @@ Wed Mar 31 21:20:58 1993 K. Richard Pixley (rich@rtl.cygnus.com) Wed Mar 31 12:31:56 1993 Ian Lance Taylor (ian@cygnus.com) - * build-all.mk, config/mh-irix4: Bump -XNh value to 1500 to match - gcc requirements. + * build-all.mk: Bump -XNh value to 1500 to match gcc requirements. * Makefile.in: Complete overhaul to merge many almost identical targets. @@ -7126,13 +8380,6 @@ Tue Mar 30 10:03:09 1993 Ian Lance Taylor (ian@cygnus.com) * build-all.mk: Use CC=cc -Xs on Solaris. -Mon Mar 29 19:59:26 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * config/mh-sun3: cc needs -J to compile cp-parse.c correctly - - * config/mh-solaris: SunPRO C needs -Xs to be able to get a - working xmakefile for Emacs. - Thu Mar 25 15:14:30 1993 Fred Fish (fnf@cygnus.com) * Makefile.in: Incorporate changes suggested by wilson@cygnus.com @@ -7226,7 +8473,6 @@ Tue Mar 2 21:15:58 1993 Fred Fish (fnf@cygnus.com) (Ultrix 2.2 support from Michael Rendell ) * configure.in (vax-*-ultrix2*): Add Ultrix 2.2 triplet. * config.guess: Change 'VAX*:ULTRIX:*:*' to 'VAX*:ULTRIX*:*:*'. - * config/mh-vaxult2: New file. Tue Mar 2 18:11:03 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) @@ -7396,8 +8642,6 @@ Sat Jan 23 20:32:01 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * Makefile.in: define and pass down X11_LIB - * config/mh-sco: define X11_LIB to the mess that SCO ODT requires - Sat Jan 23 13:49:40 1993 Per Bothner (bothner@cygnus.com) * guess-systype: Renamed to ... @@ -7460,8 +8704,6 @@ Sun Jan 3 15:15:09 1993 Steve Chamberlain (sac@thepub.cygnus.com) Tue Dec 29 15:06:00 1992 Ian Lance Taylor (ian@cygnus.com) - * config/mh-sco: Don't override BISON definition. - * build-all.mk: If canonhost is i386-unknown-sco3.2v4, change it to i386-sco3.2v4. Set TARGETS and CFLAGS for i386-sco3.2v4. (all-cygnus, native, build-cygnus): Make @@ -7526,10 +8768,6 @@ Fri Dec 11 20:18:02 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * Makefile.in: m4 depends on libiberty -Mon Dec 7 06:43:27 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * config/mh-sco: don't default $(CC) to gcc - Thu Dec 3 21:52:11 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * configure.in: add m4, textutils, fileutils, sed, shellutils, @@ -7542,14 +8780,6 @@ Mon Nov 30 14:54:34 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * configure.in: use mh-sun for all *-sun-* hosts - * config/mh-solaris: rework standard X location to use - $OPENWINHOME, if defined. - - * config/mh-sun: handle X11 include locations - - * config/mh-decstation: define NeedFunctionPrototypes to 0, to - work around dain-bramaged DECwindows include files - Fri Nov 27 18:35:54 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * Makefile.in: define flags for X11 include files and library file @@ -7557,9 +8787,6 @@ Fri Nov 27 18:35:54 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * build-all.mk: added a 'native' target, to 3stage the native toolchain - * config/{mh-hpux,mh-solaris}: define the "standard" locations for - the vendor supplied X11 headers and libraries - Sun Nov 22 18:59:13 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * configure.in: start building libg++ for HP-UX targets @@ -7816,11 +9043,6 @@ Tue Aug 4 01:12:43 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) * configure.texi, standards.texi: fix INFO-DIR-ENTRY -Mon Aug 3 15:41:28 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * config/mh-solaris: removed the -xs from CFLAGS (let the people - with Sun's C compiler deal with it themselved) - Mon Aug 3 00:34:17 1992 Fred Fish (fnf@cygnus.com) * config.sub (ncr3000): Change i386 to i486. @@ -7865,11 +9087,6 @@ Thu Jul 16 16:05:28 1992 K. Richard Pixley (rich@rtl.cygnus.com) * .cvsignore: ignore some stuff that comes from test-build.mk. -Wed Jul 8 00:01:30 1992 Stu Grossman (grossman at cygnus.com) - - * config/mh-solaris: Use -xs when compiling so that Sun-C puts - a symbol-table into the executable. - Tue Jul 7 00:24:52 1992 Fred Fish (fnf@cygnus.com) * config.sub: Add es1800 (m68k-ericsson-es1800). @@ -7893,11 +9110,6 @@ Fri Jun 19 15:19:40 1992 Stu Grossman (grossman at cygnus.com) * config.sub: HPPA merge. -Mon Jun 15 12:31:52 1992 Fred Fish (fnf@cygnus.com) - - * config/mh-ncr3000 (INSTALL): Don't use /usr/ucb/install, - it is broken on ncr 3000's. - Sun Jun 14 10:29:19 1992 John Gilmore (gnu at cygnus.com) * Makefile.in: Replace all-bison with all-byacc in all @@ -7907,10 +9119,6 @@ Fri Jun 12 22:21:57 1992 John Gilmore (gnu at cygnus.com) * config.sub: Add sun4sol2 => sparc-sun-solaris2. -Tue Jun 9 17:18:11 1992 Fred Fish (fnf at cygnus.com) - - * config/{mh-ncr3000, mh-sysv4}: Add INSTALL. - Thu Jun 4 12:07:32 1992 Mark Eichin (eichin@cygnus.com) * Makefile.in: make gprof rules similar to byacc rules (instead of @@ -8008,8 +9216,6 @@ Wed Apr 22 18:06:55 1992 K. Richard Pixley (rich@rtl.cygnus.com) Wed Apr 22 14:38:34 1992 Fred Fish (fnf@cygnus.com) - * config/mh-delta88, config/mh-ncr3000: Replace MINUS_G with - CFLAGS per new configuration strategy. * configure: Test for existance of files before trying to mv them, to avoid numerous non-existance messages. @@ -8171,7 +9377,7 @@ Thu Mar 5 21:45:07 1992 K. Richard Pixley (rich@sendai) Thu Mar 5 12:05:58 1992 Stu Grossman (grossman at cygnus.com) - * config.sub configure.in config/mh-irix4 gdb/configure.in + * config.sub configure.in gdb/configure.in gdb/mips-tdep.c gdb/mipsread.c gdb/procfs.c gdb/signame.h gdb/tm-irix3.h gdb/tm-mips.h gdb/xm-irix4.h gdb/config/mt-irix3 gdb/config/mh-irix4 texinfo/configure.in: Port to SGI Irix-4.x. @@ -8232,7 +9438,7 @@ Fri Jan 31 02:27:32 1992 John Gilmore (gnu at cygnus.com) Thu Jan 30 16:17:30 1992 Stu Grossman (grossman at cygnus.com) - * bfd/configure.in, config/mh-sco, gdb/config/mh-i386sco, + * bfd/configure.in, gdb/config/mh-i386sco, gdb/config/mt-i386v32, gdb/configure.in, readline/configure.in: Fix SCO configuration stuff. diff --git a/contrib/binutils/MAINTAINERS b/contrib/binutils/MAINTAINERS index 104b815..7194268 100644 --- a/contrib/binutils/MAINTAINERS +++ b/contrib/binutils/MAINTAINERS @@ -4,12 +4,12 @@ Please do not make ChangeLog entries. COPYING, COPYING.LIB, README http://gnu.org. -Makefile.in; configure; configure.in +Makefile.in; configure; configure.in; src-release Please notify the following of any committed patches. binutils@sources.redhat.com gdb-patches@sources.redhat.com -bfd/; binutils/; gas/; gprof/; ld/; opcodes/; BFD's part of include/ +bfd/; binutils/; gas/; gprof/; ld/; opcodes/; cpu/; BFD's part of include/ binutils: http://sources.redhat.com/binutils/ Patches to binutils@sources.redhat.com. Please notify the following of any interface changes: @@ -21,24 +21,25 @@ cgen/; cgen parts of opcodes/, sim/ & include/ May need separate opcodes/ or sim/ approval for commits of regenerated files there. -config.guess; config.sub; dejagnu/config.guess; +config.guess; config.sub; dejagnu/config.guess; dejagnu/config.sub; readline/support/config.sub; readline/support/config.guess config: http://savannah.gnu.org/projects/config Patches to config-patches@gnu.org. Changes need to be done in tandem with the official CONFIG sources or submitted to the master file maintainer and brought - in via a merge. + in via a merge. When updating any of these files, please be + sure to update all of them. Please notify the following of any committed patches: binutils@sources.redhat.com gdb-patches@sources.redhat.com dejagnu/ - Send all patches to: - http://www.gnu.org/software/dejagnu/ - mail:bug-dejagnu@gnu.org - For changes to the local repostory, send them to - gdb-patches@sources.redhat.com when generic; and sid@, - binutils@, gcc@, etc. for sub-components. + dejagnu: http://www.gnu.org/software/dejagnu/ + Patches to bug-dejagnu@gnu.org + Avoid making changes to the local repository; please send + patches upstream. Important and approved patches can be + checked into the src repository, otheriwse patches will be + imported from the next release. gdb/; mmalloc/; readline/; sim/; GDB's part of include/ & dejagnu/ gdb: http://sources.redhat.com/gdb/ @@ -99,8 +100,7 @@ winsup/ General discussion cygwin@sources.redhat.com. See also winsup/MAINTAINERS. -expect/; config-ml.in; mpw-README; mpw-build.in; mpw-config.in; -mpw-configure; mpw-install; setup.com; missing; makefile.vms; utils/; +expect/; config-ml.in; setup.com; missing; makefile.vms; utils/; config/; config.if; makefile.vms; missing; ylwrap; mkdep; etc/; install-sh; intl/ Ask DJ Delorie after reading the libiberty entry. diff --git a/contrib/binutils/Makefile.def b/contrib/binutils/Makefile.def new file mode 100644 index 0000000..5a68098 --- /dev/null +++ b/contrib/binutils/Makefile.def @@ -0,0 +1,210 @@ +#! /usr/bin/autogen +AutoGen definitions Makefile.tpl; + +// Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'. +// This file was originally written by Nathanael Nerode. +// +// Copyright 2002, 2003 Free Software Foundation +// +// This file is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// 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. + + +// "missing" indicates that that module doesn't supply +// that recursive target in its Makefile. + +build_modules= { module= libiberty; }; + +host_modules= { module= ash; }; +host_modules= { module= autoconf; }; +host_modules= { module= automake; }; +host_modules= { module= bash; }; +host_modules= { module= bfd; }; +host_modules= { module= opcodes; }; +host_modules= { module= binutils; }; +host_modules= { module= bison; no_check_cross= true; }; +host_modules= { module= byacc; no_check_cross= true; }; +host_modules= { module= bzip2; }; +host_modules= { module= dejagnu; }; +host_modules= { module= diff; }; +host_modules= { module= dosutils; no_check= true; }; +host_modules= { module= etc; }; +host_modules= { module= fastjar; no_check_cross= true; }; +host_modules= { module= fileutils; }; +host_modules= { module= findutils; }; +host_modules= { module= find; }; +host_modules= { module= flex; no_check_cross= true; }; +host_modules= { module= gas; }; +host_modules= { module= gawk; }; +host_modules= { module= gettext; }; +host_modules= { module= gnuserv; }; +host_modules= { module= gprof; }; +host_modules= { module= gzip; }; +host_modules= { module= hello; }; +host_modules= { module= indent; }; +host_modules= { module= intl; }; +host_modules= { module= tcl; + missing=mostlyclean; }; +host_modules= { module= itcl; }; +host_modules= { module= ld; }; +host_modules= { module= libgui; }; +host_modules= { module= libiberty; }; +host_modules= { module= libtool; }; +host_modules= { module= m4; }; +host_modules= { module= make; }; +host_modules= { module= mmalloc; no_check=true; }; +host_modules= { module= patch; }; +host_modules= { module= perl; }; +host_modules= { module= prms; }; +host_modules= { module= rcs; }; +host_modules= { module= readline; }; +host_modules= { module= release; no_install= true; no_check= true; }; +host_modules= { module= recode; }; +host_modules= { module= sed; }; +host_modules= { module= send-pr; }; +host_modules= { module= shellutils; }; +host_modules= { module= sid; }; +host_modules= { module= sim; }; +host_modules= { module= tar; }; +host_modules= { module= texinfo; no_install= true; }; +host_modules= { module= textutils; }; +host_modules= { module= time; }; +host_modules= { module= uudecode; }; +host_modules= { module= wdiff; }; +host_modules= { module= zip; no_check_cross=true; }; +host_modules= { module= zlib; no_install=true; no_check=true; }; +host_modules= { module= gdb; with_x=true; }; +host_modules= { module= expect; with_x=true; }; +host_modules= { module= guile; with_x=true; }; +host_modules= { module= tk; with_x=true; }; +host_modules= { module= tix; with_x=true; }; +host_modules= { module= libtermcap; no_check=true; + missing=mostlyclean; + missing=clean; + missing=distclean; + missing=maintainer-clean; }; +host_modules= { module= utils; no_check=true; }; + +target_modules = { module= libstdc++-v3; raw_cxx=true; }; +target_modules = { module= newlib; }; +target_modules = { module= libf2c; }; +target_modules = { module= libobjc; }; +target_modules = { module= libtermcap; no_check=true; stage=true; + missing=mostlyclean; + missing=clean; + missing=distclean; + missing=maintainer-clean; }; +target_modules = { module= winsup; }; +target_modules = { module= libgloss; no_check=true; }; +target_modules = { module= libiberty; }; +target_modules = { module= gperf; }; +target_modules = { module= examples; no_check=true; no_install=true; }; +target_modules = { module= libffi; }; +target_modules = { module= libjava; raw_cxx=true; }; +target_modules = { module= zlib; stage=true; }; +target_modules = { module= boehm-gc; }; +target_modules = { module= qthreads; }; +target_modules = { module= rda; }; +target_modules = { module= libada; }; + +// These are (some of) the make targets to be done in each subdirectory. +// Not all; these are the ones which don't have special options. +// "depend" indicates that a target depends on another target uniformly +// for each subdirectory. There can be several such lines per target. +recursive_targets = { make_target= info; + depend=configure; }; +recursive_targets = { make_target= dvi; + depend=configure; }; +recursive_targets = { make_target= TAGS; + depend=configure; }; +recursive_targets = { make_target= install-info; + depend=configure; + depend=info; }; +recursive_targets = { make_target= installcheck; + depend=configure; }; +recursive_targets = { make_target= mostlyclean; }; +recursive_targets = { make_target= clean; }; +recursive_targets = { make_target= distclean; }; +recursive_targets = { make_target= maintainer-clean; }; + +// Flags which need to be passed down. + +// Directories etc. +flags_to_pass = { flag= DESTDIR ; }; +flags_to_pass = { flag= RPATH_ENVVAR ; }; +flags_to_pass = { flag= TARGET_SUBDIR ; }; +flags_to_pass = { flag= bindir ; }; +flags_to_pass = { flag= datadir ; }; +flags_to_pass = { flag= exec_prefix ; }; +flags_to_pass = { flag= includedir ; }; +flags_to_pass = { flag= infodir ; }; +flags_to_pass = { flag= libdir ; }; +flags_to_pass = { flag= libexecdir ; }; +flags_to_pass = { flag= lispdir ; }; +flags_to_pass = { flag= libstdcxx_incdir ; }; +flags_to_pass = { flag= libsubdir ; }; +flags_to_pass = { flag= localstatedir ; }; +flags_to_pass = { flag= mandir ; }; +flags_to_pass = { flag= oldincludedir ; }; +flags_to_pass = { flag= prefix ; }; +flags_to_pass = { flag= sbindir ; }; +flags_to_pass = { flag= sharedstatedir ; }; +flags_to_pass = { flag= sysconfdir ; }; +flags_to_pass = { flag= tooldir ; }; +flags_to_pass = { flag= build_tooldir ; }; +flags_to_pass = { flag= gxx_include_dir ; }; +flags_to_pass = { flag= gcc_version ; }; +flags_to_pass = { flag= gcc_version_trigger ; }; +flags_to_pass = { flag= target_alias ; }; + +// Build tools +flags_to_pass = { flag= BISON ; }; +flags_to_pass = { flag= CC_FOR_BUILD ; }; +flags_to_pass = { flag= CXX_FOR_BUILD ; }; +flags_to_pass = { flag= EXPECT ; }; +flags_to_pass = { flag= INSTALL ; }; +flags_to_pass = { flag= INSTALL_DATA ; }; +flags_to_pass = { flag= INSTALL_PROGRAM ; }; +flags_to_pass = { flag= INSTALL_SCRIPT ; }; +flags_to_pass = { flag= LEX ; }; +flags_to_pass = { flag= M4 ; }; +flags_to_pass = { flag= MAKE ; }; +flags_to_pass = { flag= RUNTEST ; }; +flags_to_pass = { flag= RUNTESTFLAGS ; }; +flags_to_pass = { flag= SHELL ; }; +flags_to_pass = { flag= YACC ; }; + +// Host tools +flags_to_pass = { flag= AR_FLAGS ; }; +flags_to_pass = { flag= CFLAGS ; }; +flags_to_pass = { flag= CXXFLAGS ; }; +flags_to_pass = { flag= LDFLAGS ; }; +flags_to_pass = { flag= LIBCFLAGS ; }; +flags_to_pass = { flag= LIBCXXFLAGS ; }; + +// Target tools +flags_to_pass = { flag= AR_FOR_TARGET ; }; +flags_to_pass = { flag= AS_FOR_TARGET ; }; +flags_to_pass = { flag= CC_FOR_TARGET ; }; +flags_to_pass = { flag= CFLAGS_FOR_TARGET ; }; +flags_to_pass = { flag= CXX_FOR_TARGET ; }; +flags_to_pass = { flag= CXXFLAGS_FOR_TARGET ; }; +flags_to_pass = { flag= DLLTOOL_FOR_TARGET ; }; +flags_to_pass = { flag= GCJ_FOR_TARGET ; }; +flags_to_pass = { flag= LD_FOR_TARGET ; }; +flags_to_pass = { flag= LIBCFLAGS_FOR_TARGET ; }; +flags_to_pass = { flag= LIBCXXFLAGS_FOR_TARGET ; }; +flags_to_pass = { flag= NM_FOR_TARGET ; }; +flags_to_pass = { flag= RANLIB_FOR_TARGET ; }; +flags_to_pass = { flag= WINDRES_FOR_TARGET ; }; diff --git a/contrib/binutils/Makefile.in b/contrib/binutils/Makefile.in index c3caa1d..2acda01 100644 --- a/contrib/binutils/Makefile.in +++ b/contrib/binutils/Makefile.in @@ -1,7 +1,9 @@ + +# Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'. # # Makefile for directory with subdirs to build. # Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -# 1999, 2000, 2001, 2002 Free Software Foundation +# 1999, 2000, 2001, 2002, 2003 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 @@ -18,36 +20,37 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # -# Tell GNU make 3.79 not to run the top level in parallel. This -# prevents contention for $builddir/$target/config.cache, as well -# as minimizing scatter in file system caches. -NOTPARALLEL = .NOTPARALLEL -$(NOTPARALLEL): - -srcdir = . +# ------------------------------- +# Standard Autoconf-set variables +# ------------------------------- +VPATH=@srcdir@ -prefix = /usr/local -exec_prefix = $(prefix) +build_alias=@build_alias@ +build=@build@ +host_alias=@host_alias@ +host=@host@ +target_alias=@target_alias@ +target=@target@ -bindir=${exec_prefix}/bin -sbindir=${exec_prefix}/sbin -libexecdir=${exec_prefix}/libexec -datadir=${prefix}/share -sysconfdir=${prefix}/etc -sharedstatedir=${prefix}/com -localstatedir=${prefix}/var -libdir=${exec_prefix}/lib -includedir=${prefix}/include -oldincludedir=/usr/include -infodir=${prefix}/info -mandir=${prefix}/man -gxx_include_dir=${includedir}/g++ +program_transform_name = @program_transform_name@ -tooldir = $(exec_prefix)/$(target_alias) -build_tooldir = $(exec_prefix)/$(target_alias) +prefix = @prefix@ +exec_prefix = @exec_prefix@ -program_transform_name = +srcdir = @srcdir@ +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +includedir = @includedir@ +oldincludedir = @oldincludedir@ +infodir = @infodir@ +mandir = @mandir@ man1dir = $(mandir)/man1 man2dir = $(mandir)/man2 man3dir = $(mandir)/man3 @@ -57,88 +60,107 @@ man6dir = $(mandir)/man6 man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 man9dir = $(mandir)/man9 -infodir = $(prefix)/info -includedir = $(prefix)/include -# Directory in which the compiler finds executables, libraries, etc. -libsubdir = $(libdir)/gcc-lib/$(target_alias)/$(gcc_version) -GDB_NLM_DEPS = -SHELL = /bin/sh +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_DATA = @INSTALL_DATA@ -# pwd command to use. Allow user to override default by setting PWDCMD in -# the environment to account for automounters. The make variable must not -# be called PWDCMD, otherwise the value set here is passed to make -# subprocesses and overrides the setting from the user's environment. -PWD = $${PWDCMD-pwd} +# ------------------------------------------------- +# Miscellaneous non-standard autoconf-set variables +# ------------------------------------------------- -# INSTALL_PROGRAM_ARGS is changed by configure.in to use -x for a -# cygwin host. -INSTALL_PROGRAM_ARGS = +links=@configlinks@ +# The file containing GCC's version number. +gcc_version_trigger = @gcc_version_trigger@ +gcc_version = @gcc_version@ -INSTALL = $(SHELL) $$s/install-sh -c -INSTALL_PROGRAM = $(INSTALL) $(INSTALL_PROGRAM_ARGS) -INSTALL_SCRIPT = $(INSTALL) -INSTALL_DATA = $(INSTALL) -m 644 +# The gcc driver likes to know the arguments it was configured with. +TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@ -INSTALL_DOSREL = install-dosrel-fake +gxx_include_dir = @gxx_include_dir@ +libstdcxx_incdir = @libstdcxx_incdir@ -AS = as -AR = ar -AR_FLAGS = rc -CC = cc +tooldir = @tooldir@ +build_tooldir = @build_tooldir@ -# Special variables passed down in EXTRA_GCC_FLAGS. They are defined -# here so that they can be overridden by Makefile fragments. -HOST_CC = $(CC_FOR_BUILD) -BUILD_PREFIX = -BUILD_PREFIX_1 = loser- +# Directory in which the compiler finds executables, libraries, etc. +libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version) +GDB_NLM_DEPS = -# These flag values are normally overridden by the configure script. -CFLAGS = -g -CXXFLAGS = -g -O2 +# This is the name of the environment variable used for the path to +# the libraries. +RPATH_ENVVAR = @RPATH_ENVVAR@ -LDFLAGS = -LIBCFLAGS = $(CFLAGS) -CFLAGS_FOR_BUILD = $(CFLAGS) -# During gcc bootstrap, if we use some random cc for stage1 then -# CFLAGS will be just -g. We want to ensure that TARGET libraries -# (which we know are built with gcc) are built with optimizations so -# prepend -O2 when setting CFLAGS_FOR_TARGET. -CFLAGS_FOR_TARGET = -O2 $(CFLAGS) -LDFLAGS_FOR_TARGET = -LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) -PICFLAG = -PICFLAG_FOR_TARGET = +# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared +# was used. +SET_LIB_PATH = @SET_LIB_PATH@ + +# 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 = \ + $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); -CXX = c++ +# This is the list of directories to be built for the build system. +BUILD_CONFIGDIRS = libiberty +# Build programs are put under this directory. +BUILD_SUBDIR = @build_subdir@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the build system. +BUILD_CONFIGARGS = @build_configargs@ -# Use -O2 to stress test the compiler. -LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates -CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates +# This is the list of directories to built for the host system. +SUBDIRS = @configdirs@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the host system. +HOST_CONFIGARGS = @host_configargs@ -DLLTOOL = dlltool -WINDRES = windres +# This is set by the configure script to the list of directories which +# should be built using the target tools. +TARGET_CONFIGDIRS = @target_configdirs@ +# Target libraries are put under this directory: +TARGET_SUBDIR = @target_subdir@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the target. +TARGET_CONFIGARGS = @target_configargs@ + +# ---------------------------------------------- +# Programs producing files for the BUILD machine +# ---------------------------------------------- -NM = nm +SHELL = @config_shell@ + +# pwd command to use. Allow user to override default by setting PWDCMD in +# the environment to account for automounters. The make variable must not +# be called PWDCMD, otherwise the value set here is passed to make +# subprocesses and overrides the setting from the user's environment. +# Don't use PWD since it is a common shell environment variable and we +# don't want to corrupt it. +PWD_COMMAND = $${PWDCMD-pwd} -LD = ld +# compilers to use to create programs which must be run in the build +# environment. +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ -BZIPPROG = bzip2 -MD5PROG = md5sum +CXX_FOR_BUILD = $(CXX) -# These values are substituted by configure. -DEFAULT_YACC = yacc -DEFAULT_LEX = lex -DEFAULT_M4 = m4 +# Special variables passed down in EXTRA_GCC_FLAGS. They are defined +# here so that they can be overridden by Makefile fragments. +BUILD_PREFIX = @BUILD_PREFIX@ +BUILD_PREFIX_1 = @BUILD_PREFIX_1@ -BISON = `if [ -f $$r/bison/bison ] ; then \ +BISON=@BISON@ +USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \ echo $$r/bison/bison -L $$s/bison/ ; \ else \ echo bison ; \ fi` -YACC = `if [ -f $$r/bison/bison ] ; then \ +DEFAULT_YACC = @DEFAULT_YACC@ +YACC=@YACC@ +USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \ echo $$r/bison/bison -y -L $$s/bison/ ; \ elif [ -f $$r/byacc/byacc ] ; then \ echo $$r/byacc/byacc ; \ @@ -146,26 +168,31 @@ YACC = `if [ -f $$r/bison/bison ] ; then \ echo ${DEFAULT_YACC} ; \ fi` -LEX = `if [ -f $$r/flex/flex ] ; \ +DEFAULT_LEX = @DEFAULT_LEX@ +LEX=@LEX@ +USUAL_LEX = `if [ -f $$r/flex/flex ] ; \ then echo $$r/flex/flex ; \ else echo ${DEFAULT_LEX} ; fi` +DEFAULT_M4 = @DEFAULT_M4@ M4 = `if [ -f $$r/m4/m4 ] ; \ then echo $$r/m4/m4 ; \ else echo ${DEFAULT_M4} ; fi` -# For an installed makeinfo, we require it to be from texinfo 4 or +# For an installed makeinfo, we require it to be from texinfo 4.2 or # higher, else we use the "missing" dummy. -MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \ +MAKEINFO=@MAKEINFO@ +USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \ then echo $$r/texinfo/makeinfo/makeinfo ; \ else if (makeinfo --version \ - | egrep 'texinfo[^0-9]*([1-3][0-9]|[4-9])') >/dev/null 2>&1; \ + | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \ then echo makeinfo; else echo $$s/missing makeinfo; fi; fi` # This just becomes part of the MAKEINFO definition passed down to # sub-makes. It lets flags be given on the command line while still # using the makeinfo from the object tree. -MAKEINFOFLAGS = +# (Default to avoid splitting info files by setting the threshold high.) +MAKEINFOFLAGS = --split-size=5000000 EXPECT = `if [ -f $$r/expect/expect ] ; \ then echo $$r/expect/expect ; \ @@ -175,227 +202,192 @@ RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \ then echo $$s/dejagnu/runtest ; \ else echo runtest ; fi` +# --------------------------------------------- +# Programs producing files for the HOST machine +# --------------------------------------------- -# compilers to use to create programs which must be run in the build -# environment. -CC_FOR_BUILD = $(CC) -CXX_FOR_BUILD = $(CXX) +# 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 -SUBDIRS = "this is set via configure, don't edit this" -OTHERS = +AS = @AS@ -# 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 winsup opcodes libf2c libobjc +AR = @AR@ +AR_FLAGS = rc -# Target libraries are put under this directory: -# Changed by configure to $(target_alias) if cross. -TARGET_SUBDIR = . +CC = @CC@ +CFLAGS = @CFLAGS@ +LIBCFLAGS = $(CFLAGS) -BUILD_CONFIGDIRS = libiberty -BUILD_SUBDIR = . +CXX = @CXX@ +CXXFLAGS = @CXXFLAGS@ +LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates -# This is set by the configure script to the arguments to use when configuring -# directories built for the target. -TARGET_CONFIGARGS = +DLLTOOL = @DLLTOOL@ -# This is set by the configure script to the arguments to use when configuring -# directories built for the build system. -BUILD_CONFIGARGS = +NM = @NM@ -# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared -# was used. -SET_LIB_PATH = +LD = @LD@ +LDFLAGS = -# This is the name of the environment variable used for the path to -# the libraries. This may be changed by configure.in. -RPATH_ENVVAR = LD_LIBRARY_PATH +RANLIB = @RANLIB@ -# 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 +WINDRES = @WINDRES@ + +PICFLAG = + +# ----------------------------------------------- +# Programs producing files for the TARGET machine +# ----------------------------------------------- # 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: -# 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 = \ - $(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 \ - install-gcc \ - $(INSTALL_MODULES) \ - $(INSTALL_TARGET_MODULES) \ - $(INSTALL_X11_MODULES) \ - $(INSTALL_DOSREL) - -INSTALL_TARGET_CROSS = installdirs \ - install-gcc-cross \ - $(INSTALL_MODULES) \ - $(INSTALL_TARGET_MODULES) \ - $(INSTALL_X11_MODULES) \ - $(INSTALL_DOSREL) - -# Should be substed by configure.in -FLAGS_FOR_TARGET = -CC_FOR_TARGET = -CXX_FOR_TARGET = -CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = -GCJ_FOR_TARGET = +FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ -# 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/ $(FLAGS_FOR_TARGET) +AR_FOR_TARGET=@AR_FOR_TARGET@ +USUAL_AR_FOR_TARGET = ` \ + if [ -f $$r/binutils/ar ] ; then \ + echo $$r/binutils/ar ; \ + else \ + if [ '$(host)' = '$(target)' ] ; then \ + echo $(AR); \ + else \ + echo ar | sed '$(program_transform_name)' ; \ + fi; \ + fi` -AS_FOR_TARGET = ` \ +AS_FOR_TARGET=@AS_FOR_TARGET@ +USUAL_AS_FOR_TARGET = ` \ if [ -f $$r/gas/as-new ] ; then \ echo $$r/gas/as-new ; \ elif [ -f $$r/gcc/xgcc ]; then \ $(CC_FOR_TARGET) -print-prog-name=as ; \ else \ - if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + if [ '$(host)' = '$(target)' ] ; then \ echo $(AS); \ else \ - t='$(program_transform_name)'; echo as | sed -e 's/x/x/' $$t ; \ + echo as | sed '$(program_transform_name)' ; \ fi; \ fi` -LD_FOR_TARGET = ` \ - if [ -f $$r/ld/ld-new ] ; then \ - echo $$r/ld/ld-new ; \ - elif [ -f $$r/gcc/xgcc ]; then \ - $(CC_FOR_TARGET) -print-prog-name=ld ; \ - else \ - if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ - echo $(LD); \ - else \ - t='$(program_transform_name)'; echo ld | sed -e 's/x/x/' $$t ; \ - fi; \ - fi` +CC_FOR_TARGET = @CC_FOR_TARGET@ +# During gcc bootstrap, if we use some random cc for stage1 then +# CFLAGS will be just -g. We want to ensure that TARGET libraries +# (which we know are built with gcc) are built with optimizations so +# prepend -O2 when setting CFLAGS_FOR_TARGET. +CFLAGS_FOR_TARGET = -O2 $(CFLAGS) +# 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=@GCC_FOR_TARGET@ +USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET) +LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) + +CXX_FOR_TARGET = @CXX_FOR_TARGET@ +RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@ +CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ +RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ +CXXFLAGS_FOR_TARGET = $(CXXFLAGS) +LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates -DLLTOOL_FOR_TARGET = ` \ +DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@ +USUAL_DLLTOOL_FOR_TARGET = ` \ if [ -f $$r/binutils/dlltool ] ; then \ echo $$r/binutils/dlltool ; \ else \ - if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + if [ '$(host)' = '$(target)' ] ; then \ echo $(DLLTOOL); \ else \ - t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \ + echo dlltool | sed '$(program_transform_name)' ; \ fi; \ fi` -WINDRES_FOR_TARGET = ` \ - if [ -f $$r/binutils/windres ] ; then \ - echo $$r/binutils/windres ; \ +GCJ_FOR_TARGET = @GCJ_FOR_TARGET@ + +LD_FOR_TARGET=@LD_FOR_TARGET@ +USUAL_LD_FOR_TARGET = ` \ + if [ -f $$r/ld/ld-new ] ; then \ + echo $$r/ld/ld-new ; \ + elif [ -f $$r/gcc/xgcc ]; then \ + $(CC_FOR_TARGET) -print-prog-name=ld ; \ else \ - if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ - echo $(WINDRES); \ + if [ '$(host)' = '$(target)' ] ; then \ + echo $(LD); \ else \ - t='$(program_transform_name)'; echo windres | sed -e 's/x/x/' $$t ; \ + echo ld | sed '$(program_transform_name)' ; \ fi; \ fi` -AR_FOR_TARGET = ` \ - if [ -f $$r/binutils/ar ] ; then \ - echo $$r/binutils/ar ; \ +LDFLAGS_FOR_TARGET = + +NM_FOR_TARGET=@NM_FOR_TARGET@ +USUAL_NM_FOR_TARGET = ` \ + if [ -f $$r/binutils/nm-new ] ; then \ + echo $$r/binutils/nm-new ; \ + elif [ -f $$r/gcc/xgcc ]; then \ + $(CC_FOR_TARGET) -print-prog-name=nm ; \ else \ - if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ - echo $(AR); \ + if [ '$(host)' = '$(target)' ] ; then \ + echo $(NM); \ else \ - t='$(program_transform_name)'; echo ar | sed -e 's/x/x/' $$t ; \ + echo nm | sed '$(program_transform_name)' ; \ fi; \ fi` -RANLIB_FOR_TARGET = ` \ +RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ +USUAL_RANLIB_FOR_TARGET = ` \ if [ -f $$r/binutils/ranlib ] ; then \ echo $$r/binutils/ranlib ; \ else \ - if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ + if [ '$(host)' = '$(target)' ] ; then \ if [ x'$(RANLIB)' != x ]; then \ echo $(RANLIB); \ else \ echo ranlib; \ fi; \ else \ - t='$(program_transform_name)'; echo ranlib | sed -e 's/x/x/' $$t ; \ + echo ranlib | sed '$(program_transform_name)' ; \ fi; \ fi` -NM_FOR_TARGET = ` \ - if [ -f $$r/binutils/nm-new ] ; then \ - echo $$r/binutils/nm-new ; \ - elif [ -f $$r/gcc/xgcc ]; then \ - $(CC_FOR_TARGET) -print-prog-name=nm ; \ +WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@ +USUAL_WINDRES_FOR_TARGET = ` \ + if [ -f $$r/binutils/windres ] ; then \ + echo $$r/binutils/windres ; \ else \ - if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ - echo $(NM); \ + if [ '$(host)' = '$(target)' ] ; then \ + echo $(WINDRES); \ else \ - t='$(program_transform_name)'; echo nm | sed -e 's/x/x/' $$t ; \ + echo windres | sed '$(program_transform_name)' ; \ fi; \ fi` +PICFLAG_FOR_TARGET = + +# ------------------------------------ +# Miscellaneous targets and flag lists +# ------------------------------------ + # The first rule in the file had better be this one. Don't put any above it. # This lives here to allow makefile fragments to contain dependencies. all: all.normal .PHONY: all -# These can be overridden by config/mt-*. -# The _TARGET_ is because they're specified in mt-foo. -# The _HOST_ is because they're programs that run on the host. -EXTRA_TARGET_HOST_ALL_MODULES = -EXTRA_TARGET_HOST_INSTALL_MODULES = -EXTRA_TARGET_HOST_CHECK_MODULES = - #### host and target specific makefile fragments come in here. +@target_makefile_frag@ +@alphaieee_frag@ +@ospace_frag@ +@host_makefile_frag@ ### # Flags to pass down to all sub-makes. -# Please keep these in alphabetical order. BASE_FLAGS_TO_PASS = \ - "AR_FLAGS=$(AR_FLAGS)" \ - "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ - "AS_FOR_TARGET=$(AS_FOR_TARGET)" \ - "BISON=$(BISON)" \ - "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ - "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ - "CFLAGS=$(CFLAGS)" \ - "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ - "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \ - "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ - "CXXFLAGS=$(CXXFLAGS)" \ - "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \ - "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \ - "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \ - "INSTALL=$(INSTALL)" \ - "INSTALL_DATA=$(INSTALL_DATA)" \ - "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ - "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ - "LDFLAGS=$(LDFLAGS)" \ - "LEX=$(LEX)" \ - "LD_FOR_TARGET=$(LD_FOR_TARGET)" \ - "LIBCFLAGS=$(LIBCFLAGS)" \ - "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ - "LIBCXXFLAGS=$(LIBCXXFLAGS)" \ - "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \ - "M4=$(M4)" \ - "MAKE=$(MAKE)" \ - "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \ - "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ - "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \ + "DESTDIR=$(DESTDIR)" \ "RPATH_ENVVAR=$(RPATH_ENVVAR)" \ - "SHELL=$(SHELL)" \ - "EXPECT=$(EXPECT)" \ - "RUNTEST=$(RUNTEST)" \ - "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ "TARGET_SUBDIR=$(TARGET_SUBDIR)" \ - "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \ - "YACC=$(YACC)" \ "bindir=$(bindir)" \ "datadir=$(datadir)" \ "exec_prefix=$(exec_prefix)" \ @@ -418,7 +410,44 @@ BASE_FLAGS_TO_PASS = \ "gxx_include_dir=$(gxx_include_dir)" \ "gcc_version=$(gcc_version)" \ "gcc_version_trigger=$(gcc_version_trigger)" \ - "target_alias=$(target_alias)" + "target_alias=$(target_alias)" \ + "BISON=$(BISON)" \ + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ + "CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \ + "EXPECT=$(EXPECT)" \ + "INSTALL=$(INSTALL)" \ + "INSTALL_DATA=$(INSTALL_DATA)" \ + "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ + "INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \ + "LEX=$(LEX)" \ + "M4=$(M4)" \ + "MAKE=$(MAKE)" \ + "RUNTEST=$(RUNTEST)" \ + "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ + "SHELL=$(SHELL)" \ + "YACC=$(YACC)" \ + "AR_FLAGS=$(AR_FLAGS)" \ + "CFLAGS=$(CFLAGS)" \ + "CXXFLAGS=$(CXXFLAGS)" \ + "LDFLAGS=$(LDFLAGS)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "LIBCXXFLAGS=$(LIBCXXFLAGS)" \ + "AR_FOR_TARGET=$(AR_FOR_TARGET)" \ + "AS_FOR_TARGET=$(AS_FOR_TARGET)" \ + "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ + "CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \ + "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \ + "CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \ + "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \ + "GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \ + "LD_FOR_TARGET=$(LD_FOR_TARGET)" \ + "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ + "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \ + "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ + "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \ + "WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \ + "CONFIG_SHELL=$(SHELL)" \ + "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" # For any flags above that may contain shell code that varies from one # target library to another. When doing recursive invocations of the @@ -426,11 +455,11 @@ BASE_FLAGS_TO_PASS = \ # so we pass these variables down unchanged. They must not contain # single nor double quotes. RECURSE_FLAGS = \ - CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' + CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \ + RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \ # Flags to pass down to most sub-makes, in which we're building with # the host environment. -# If any variables are added here, they must be added to do-*, below. EXTRA_HOST_FLAGS = \ 'AR=$(AR)' \ 'AS=$(AS)' \ @@ -439,7 +468,7 @@ EXTRA_HOST_FLAGS = \ 'DLLTOOL=$(DLLTOOL)' \ 'LD=$(LD)' \ 'NM=$(NM)' \ - "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \ + 'RANLIB=$(RANLIB)' \ 'WINDRES=$(WINDRES)' FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) @@ -459,7 +488,6 @@ X11_FLAGS_TO_PASS = \ # Flags to pass down to makes which are built with the target environment. # The double $ decreases the length of the command line; the variables # are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. -# If any variables are added here, they must be added to do-*, below. EXTRA_TARGET_FLAGS = \ 'AR=$$(AR_FOR_TARGET)' \ 'AS=$$(AS_FOR_TARGET)' \ @@ -481,20 +509,11 @@ TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) # unfortunately needs the native compiler and the target ar and # ranlib. # If any variables are added here, they must be added to do-*, below. -# The HOST_* variables are a special case, which are used for the gcc +# The BUILD_* variables are a special case, which are used for the gcc # cross-building scheme. EXTRA_GCC_FLAGS = \ - 'AR=$(AR)' \ - 'AS=$(AS)' \ - 'CC=$(CC)' \ - 'CXX=$(CXX)' \ - 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ - 'HOST_CC=$(CC_FOR_BUILD)' \ 'BUILD_PREFIX=$(BUILD_PREFIX)' \ 'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \ - 'NM=$(NM)' \ - "`echo 'RANLIB=$(RANLIB)' | sed -e s/.*=$$/XFOO=/`" \ - 'WINDRES=$$(WINDRES_FOR_TARGET)' \ "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \ "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \ @@ -503,1032 +522,23160 @@ EXTRA_GCC_FLAGS = \ "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \ - "`echo 'ENQUIRE=$(ENQUIRE)' | sed -e s/.*=$$/XFOO=/`" \ "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ - "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" - -GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) - -# This is a list of the targets for all of the modules which are compiled -# using the build machine's native compiler. Configure edits the second -# macro for build!=host builds. -ALL_BUILD_MODULES_LIST = \ - all-build-libiberty -ALL_BUILD_MODULES = - -# This is a list of the configure targets for all of the modules which -# are compiled using the native tools. -CONFIGURE_BUILD_MODULES = \ - configure-build-libiberty - -# This is a list of the targets for all of the modules which are compiled -# using $(FLAGS_TO_PASS). -ALL_MODULES = \ - all-ash \ - all-autoconf \ - all-automake \ - all-bash \ - all-bfd \ - all-binutils \ - all-bison \ - all-byacc \ - all-bzip2 \ - all-db \ - all-dejagnu \ - all-diff \ - all-dosutils \ - all-etc \ - all-fastjar \ - all-fileutils \ - all-findutils \ - all-find \ - all-flex \ - all-gas \ - all-gawk \ - all-gettext \ - all-gnuserv \ - all-gprof \ - all-grep \ - all-gzip \ - all-hello \ - all-indent \ - all-intl \ - all-itcl \ - all-ld \ - all-libgui \ - all-libiberty \ - all-libtool \ - all-m4 \ - all-make \ - all-mmalloc \ - all-opcodes \ - all-patch \ - all-perl \ - all-prms \ - all-rcs \ - all-readline \ - all-release \ - all-recode \ - all-sed \ - all-send-pr \ - all-shellutils \ - all-sid \ - all-sim \ - all-snavigator \ - all-tar \ - all-tcl \ - all-texinfo \ - all-textutils \ - all-time \ - 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 -# compiled using $(FLAGS_TO_PASS). -# -# The list is in two parts. The first lists those tools which -# are tested as part of the host's native tool-chain, and not -# tested in a cross configuration. -NATIVE_CHECK_MODULES = \ - check-bison \ - check-byacc \ - check-fastjar \ - check-flex \ - check-zip - -CROSS_CHECK_MODULES = \ - check-ash \ - check-autoconf \ - check-automake \ - check-bash \ - check-bfd \ - check-binutils \ - check-bzip2 \ - check-db \ - check-dejagnu \ - check-diff \ - check-etc \ - check-fileutils \ - check-findutils \ - check-find \ - check-gas \ - check-gawk \ - check-gettext \ - check-gnuserv \ - check-gprof \ - check-grep \ - check-gzip \ - check-hello \ - check-indent \ - check-intl \ - check-itcl \ - check-ld \ - check-libgui \ - check-libiberty \ - check-libtool \ - check-m4 \ - check-make \ - check-mmcheckoc \ - check-opcodes \ - check-patch \ - check-perl \ - check-prms \ - check-rcs \ - check-readline \ - check-recode \ - check-sed \ - check-send-pr \ - check-shellutils \ - check-snavigator \ - check-sid \ - check-sim \ - check-tar \ - check-tcl \ - check-texinfo \ - check-textutils \ - check-time \ - check-uudecode \ - check-wdiff \ - $(EXTRA_TARGET_HOST_CHECK_MODULES) - -CHECK_MODULES=$(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES) - -# This is a list of the install targets for all of the modules which are -# compiled using $(FLAGS_TO_PASS). -# We put install-opcodes before install-binutils because the installed -# binutils might be on PATH, and they might need the shared opcodes -# library. -# We put install-tcl before install-itcl because itcl wants to run a -# program on installation which uses the Tcl libraries. -INSTALL_MODULES = \ - install-ash \ - install-autoconf \ - install-automake \ - install-bash \ - install-bfd \ - install-bzip2 \ - install-opcodes \ - install-binutils \ - install-bison \ - install-byacc \ - install-db \ - install-dejagnu \ - install-diff \ - install-dosutils \ - install-etc \ - install-fastjar \ - install-fileutils \ - install-findutils \ - install-find \ - install-flex \ - install-gas \ - install-gawk \ - install-gettext \ - install-gnuserv \ - install-gprof \ - install-grep \ - install-gzip \ - install-hello \ - install-indent \ - install-intl \ - install-tcl \ - install-itcl \ - install-ld \ - install-libgui \ - install-libiberty \ - install-libtool \ - install-m4 \ - install-make \ - install-mmalloc \ - install-patch \ - install-perl \ - install-prms \ - install-rcs \ - install-readline \ - install-recode \ - install-sed \ - install-send-pr \ - install-shellutils \ - install-sid \ - install-sim \ - install-snavigator \ - install-tar \ - install-textutils \ - install-time \ - install-uudecode \ - install-wdiff \ - install-zip \ - $(EXTRA_TARGET_HOST_INSTALL_MODULES) - -# This is a list of the targets for all of the modules which are compiled -# using $(X11_FLAGS_TO_PASS). -ALL_X11_MODULES = \ - all-gdb \ - all-expect \ - all-guile \ - all-tclX \ - all-tk \ - all-tix - -# This is a list of the check targets for all of the modules which are -# compiled using $(X11_FLAGS_TO_PASS). -CHECK_X11_MODULES = \ - check-gdb \ - check-guile \ - check-expect \ - check-tclX \ - check-tk \ - check-tix - -# This is a list of the install targets for all the modules which are -# compiled using $(X11_FLAGS_TO_PASS). -INSTALL_X11_MODULES = \ - install-gdb \ - install-guile \ - install-expect \ - install-tclX \ - install-tk \ - install-tix - -# This is a list of the targets for all of the modules which are compiled -# using $(TARGET_FLAGS_TO_PASS). -ALL_TARGET_MODULES = \ - all-target-libstdc++-v3 \ - all-target-newlib \ - all-target-libf2c \ - all-target-libobjc \ - all-target-libtermcap \ - all-target-winsup \ - all-target-libgloss \ - all-target-libiberty \ - all-target-gperf \ - all-target-examples \ - all-target-libffi \ - all-target-libjava \ - all-target-zlib \ - all-target-boehm-gc \ - all-target-qthreads - -# This is a list of the configure targets for all of the modules which -# are compiled using the target tools. -CONFIGURE_TARGET_MODULES = \ - configure-target-libstdc++-v3 \ - configure-target-newlib \ - configure-target-libf2c \ - configure-target-libobjc \ - configure-target-libtermcap \ - configure-target-winsup \ - configure-target-libgloss \ - configure-target-libiberty \ - configure-target-gperf \ - configure-target-examples \ - configure-target-libffi \ - configure-target-libjava \ - configure-target-zlib \ - configure-target-boehm-gc \ - configure-target-qthreads - -# This is a list of the check targets for all of the modules which are -# compiled using $(TARGET_FLAGS_TO_PASS). -CHECK_TARGET_MODULES = \ - check-target-libstdc++-v3 \ - check-target-newlib \ - check-target-libf2c \ - 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 -# compiled using $(TARGET_FLAGS_TO_PASS). -INSTALL_TARGET_MODULES = \ - install-target-libstdc++-v3 \ - install-target-newlib \ - install-target-libf2c \ - install-target-libobjc \ - install-target-libtermcap \ - install-target-winsup \ - install-target-libgloss \ - install-target-libiberty \ - 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}. -CLEAN_MODULES = \ - clean-ash \ - clean-autoconf \ - clean-automake \ - clean-bash \ - clean-bfd \ - clean-binutils \ - clean-bison \ - clean-byacc \ - clean-bzip2 \ - clean-db \ - clean-dejagnu \ - clean-diff \ - clean-dosutils \ - clean-etc \ - clean-fastjar \ - clean-fileutils \ - clean-findutils \ - clean-find \ - clean-flex \ - clean-gas \ - clean-gawk \ - clean-gettext \ - clean-gnuserv \ - clean-gprof \ - clean-grep \ - clean-gzip \ - clean-hello \ - clean-indent \ - clean-intl \ - clean-itcl \ - clean-ld \ - clean-libgui \ - clean-libiberty \ - clean-libtool \ - clean-m4 \ - clean-make \ - clean-mmalloc \ - clean-opcodes \ - clean-patch \ - clean-perl \ - clean-prms \ - clean-rcs \ - clean-readline \ - clean-release \ - clean-recode \ - clean-sed \ - clean-send-pr \ - clean-shellutils \ - clean-sid \ - clean-sim \ - clean-snavigator \ - clean-tar \ - clean-tcl \ - clean-texinfo \ - clean-textutils \ - clean-time \ - clean-uudecode \ - clean-wdiff \ - clean-zip \ - clean-zlib - -# All of the target modules that can be cleaned -CLEAN_TARGET_MODULES = \ - clean-target-libstdc++-v3 \ - clean-target-newlib \ - clean-target-libf2c \ - clean-target-libobjc \ - clean-target-winsup \ - clean-target-libgloss \ - clean-target-libiberty \ - clean-target-gperf \ - clean-target-examples \ - clean-target-libffi \ - clean-target-libjava \ - clean-target-zlib \ - clean-target-boehm-gc \ - clean-target-qthreads - -# All of the x11 modules that can be cleaned -CLEAN_X11_MODULES = \ - clean-gdb \ - clean-expect \ - clean-guile \ - clean-tclX \ - clean-tk \ - clean-tix + "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ + "`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s/.*=$$/XFOO=/`" + +GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS) + +.PHONY: configure-host +configure-host: maybe-configure-gcc \ + maybe-configure-ash \ + maybe-configure-autoconf \ + maybe-configure-automake \ + maybe-configure-bash \ + maybe-configure-bfd \ + maybe-configure-opcodes \ + maybe-configure-binutils \ + maybe-configure-bison \ + maybe-configure-byacc \ + maybe-configure-bzip2 \ + maybe-configure-dejagnu \ + maybe-configure-diff \ + maybe-configure-dosutils \ + maybe-configure-etc \ + maybe-configure-fastjar \ + maybe-configure-fileutils \ + maybe-configure-findutils \ + maybe-configure-find \ + maybe-configure-flex \ + maybe-configure-gas \ + maybe-configure-gawk \ + maybe-configure-gettext \ + maybe-configure-gnuserv \ + maybe-configure-gprof \ + maybe-configure-gzip \ + maybe-configure-hello \ + maybe-configure-indent \ + maybe-configure-intl \ + maybe-configure-tcl \ + maybe-configure-itcl \ + maybe-configure-ld \ + maybe-configure-libgui \ + maybe-configure-libiberty \ + maybe-configure-libtool \ + maybe-configure-m4 \ + maybe-configure-make \ + maybe-configure-mmalloc \ + maybe-configure-patch \ + maybe-configure-perl \ + maybe-configure-prms \ + maybe-configure-rcs \ + maybe-configure-readline \ + maybe-configure-release \ + maybe-configure-recode \ + maybe-configure-sed \ + maybe-configure-send-pr \ + maybe-configure-shellutils \ + maybe-configure-sid \ + maybe-configure-sim \ + maybe-configure-tar \ + maybe-configure-texinfo \ + maybe-configure-textutils \ + maybe-configure-time \ + maybe-configure-uudecode \ + maybe-configure-wdiff \ + maybe-configure-zip \ + maybe-configure-zlib \ + maybe-configure-gdb \ + maybe-configure-expect \ + maybe-configure-guile \ + maybe-configure-tk \ + maybe-configure-tix \ + maybe-configure-libtermcap \ + maybe-configure-utils +.PHONY: configure-target +configure-target: \ + maybe-configure-target-libstdc++-v3 \ + maybe-configure-target-newlib \ + maybe-configure-target-libf2c \ + maybe-configure-target-libobjc \ + maybe-configure-target-libtermcap \ + maybe-configure-target-winsup \ + maybe-configure-target-libgloss \ + maybe-configure-target-libiberty \ + maybe-configure-target-gperf \ + maybe-configure-target-examples \ + maybe-configure-target-libffi \ + maybe-configure-target-libjava \ + maybe-configure-target-zlib \ + maybe-configure-target-boehm-gc \ + maybe-configure-target-qthreads \ + maybe-configure-target-rda \ + maybe-configure-target-libada # The target built for a native build. .PHONY: all.normal -all.normal: \ - $(ALL_BUILD_MODULES) \ - $(ALL_MODULES) \ - $(ALL_X11_MODULES) \ - $(ALL_TARGET_MODULES) \ - all-gcc +all.normal: @all_build_modules@ all-host all-target + +.PHONY: all-host +all-host: maybe-all-gcc \ + maybe-all-ash \ + maybe-all-autoconf \ + maybe-all-automake \ + maybe-all-bash \ + maybe-all-bfd \ + maybe-all-opcodes \ + maybe-all-binutils \ + maybe-all-bison \ + maybe-all-byacc \ + maybe-all-bzip2 \ + maybe-all-dejagnu \ + maybe-all-diff \ + maybe-all-dosutils \ + maybe-all-etc \ + maybe-all-fastjar \ + maybe-all-fileutils \ + maybe-all-findutils \ + maybe-all-find \ + maybe-all-flex \ + maybe-all-gas \ + maybe-all-gawk \ + maybe-all-gettext \ + maybe-all-gnuserv \ + maybe-all-gprof \ + maybe-all-gzip \ + maybe-all-hello \ + maybe-all-indent \ + maybe-all-intl \ + maybe-all-tcl \ + maybe-all-itcl \ + maybe-all-ld \ + maybe-all-libgui \ + maybe-all-libiberty \ + maybe-all-libtool \ + maybe-all-m4 \ + maybe-all-make \ + maybe-all-mmalloc \ + maybe-all-patch \ + maybe-all-perl \ + maybe-all-prms \ + maybe-all-rcs \ + maybe-all-readline \ + maybe-all-release \ + maybe-all-recode \ + maybe-all-sed \ + maybe-all-send-pr \ + maybe-all-shellutils \ + maybe-all-sid \ + maybe-all-sim \ + maybe-all-tar \ + maybe-all-texinfo \ + maybe-all-textutils \ + maybe-all-time \ + maybe-all-uudecode \ + maybe-all-wdiff \ + maybe-all-zip \ + maybe-all-zlib \ + maybe-all-gdb \ + maybe-all-expect \ + maybe-all-guile \ + maybe-all-tk \ + maybe-all-tix \ + maybe-all-libtermcap \ + maybe-all-utils +.PHONY: all-target +all-target: \ + maybe-all-target-libstdc++-v3 \ + maybe-all-target-newlib \ + maybe-all-target-libf2c \ + maybe-all-target-libobjc \ + maybe-all-target-libtermcap \ + maybe-all-target-winsup \ + maybe-all-target-libgloss \ + maybe-all-target-libiberty \ + maybe-all-target-gperf \ + maybe-all-target-examples \ + maybe-all-target-libffi \ + maybe-all-target-libjava \ + maybe-all-target-zlib \ + maybe-all-target-boehm-gc \ + maybe-all-target-qthreads \ + maybe-all-target-rda \ + maybe-all-target-libada # Do a target for all the subdirectories. A ``make do-X'' will do a # ``make X'' in all subdirectories (because, in general, there is a # dependency (below) of X upon do-X, a ``make X'' will also do this, # but it may do additional work as well). -# This target ensures that $(BASE_FLAGS_TO_PASS) appears only once, -# because it is so large that it can easily overflow the command line -# length limit on some systems. -DO_X = \ - do-clean \ - do-distclean \ - do-dvi \ - do-info \ - do-install-info \ - do-installcheck \ - do-mostlyclean \ - do-maintainer-clean \ - do-TAGS -.PHONY: $(DO_X) -$(DO_X): - @target=`echo $@ | sed -e 's/^do-//'`; \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(SUBDIRS) -dummy-; do \ - if [ -f ./$$i/Makefile ]; then \ - case $$i in \ - gcc) \ - for flag in $(EXTRA_GCC_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - *) \ - for flag in $(EXTRA_HOST_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - ;; \ - esac ; \ - if (cd ./$$i; \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - $${target}); \ - then true; else exit 1; fi; \ - else true; fi; \ - done - @target=`echo $@ | sed -e 's/^do-//'`; \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - for i in $(TARGET_CONFIGDIRS) -dummy-; do \ - if [ -f $(TARGET_SUBDIR)/$$i/Makefile ]; then \ - for flag in $(EXTRA_TARGET_FLAGS); do \ - eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ - done; \ - if (cd $(TARGET_SUBDIR)/$$i; \ - $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ - "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ - "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ - "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ - $${target}); \ - then true; else exit 1; fi; \ - else true; fi; \ - done -# Here are the targets which correspond to the do-X targets. +.PHONY: do-info +do-info: info-host info-target -.PHONY: info installcheck dvi install-info -.PHONY: clean distclean mostlyclean maintainer-clean realclean -.PHONY: local-clean local-distclean local-maintainer-clean -info: do-info -installcheck: do-installcheck -dvi: do-dvi +.PHONY: info-host +info-host: maybe-info-gcc \ + maybe-info-ash \ + maybe-info-autoconf \ + maybe-info-automake \ + maybe-info-bash \ + maybe-info-bfd \ + maybe-info-opcodes \ + maybe-info-binutils \ + maybe-info-bison \ + maybe-info-byacc \ + maybe-info-bzip2 \ + maybe-info-dejagnu \ + maybe-info-diff \ + maybe-info-dosutils \ + maybe-info-etc \ + maybe-info-fastjar \ + maybe-info-fileutils \ + maybe-info-findutils \ + maybe-info-find \ + maybe-info-flex \ + maybe-info-gas \ + maybe-info-gawk \ + maybe-info-gettext \ + maybe-info-gnuserv \ + maybe-info-gprof \ + maybe-info-gzip \ + maybe-info-hello \ + maybe-info-indent \ + maybe-info-intl \ + maybe-info-tcl \ + maybe-info-itcl \ + maybe-info-ld \ + maybe-info-libgui \ + maybe-info-libiberty \ + maybe-info-libtool \ + maybe-info-m4 \ + maybe-info-make \ + maybe-info-mmalloc \ + maybe-info-patch \ + maybe-info-perl \ + maybe-info-prms \ + maybe-info-rcs \ + maybe-info-readline \ + maybe-info-release \ + maybe-info-recode \ + maybe-info-sed \ + maybe-info-send-pr \ + maybe-info-shellutils \ + maybe-info-sid \ + maybe-info-sim \ + maybe-info-tar \ + maybe-info-texinfo \ + maybe-info-textutils \ + maybe-info-time \ + maybe-info-uudecode \ + maybe-info-wdiff \ + maybe-info-zip \ + maybe-info-zlib \ + maybe-info-gdb \ + maybe-info-expect \ + maybe-info-guile \ + maybe-info-tk \ + maybe-info-tix \ + maybe-info-libtermcap \ + maybe-info-utils -# Make sure makeinfo is built before we do a `make info'. -do-info: all-texinfo +.PHONY: info-target +info-target: \ + maybe-info-target-libstdc++-v3 \ + maybe-info-target-newlib \ + maybe-info-target-libf2c \ + maybe-info-target-libobjc \ + maybe-info-target-libtermcap \ + maybe-info-target-winsup \ + maybe-info-target-libgloss \ + maybe-info-target-libiberty \ + maybe-info-target-gperf \ + maybe-info-target-examples \ + maybe-info-target-libffi \ + maybe-info-target-libjava \ + maybe-info-target-zlib \ + maybe-info-target-boehm-gc \ + maybe-info-target-qthreads \ + maybe-info-target-rda \ + maybe-info-target-libada -install-info: do-install-info dir.info - s=`cd $(srcdir); ${PWD}`; export s; \ - if [ -f dir.info ] ; then \ - $(INSTALL_DATA) dir.info $(infodir)/dir.info ; \ - else true ; fi +# GCC, the eternal special case +.PHONY: maybe-info-gcc info-gcc +maybe-info-gcc: +info-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 -local-clean: - -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log +# Host modules. -local-distclean: - -rm -f Makefile config.status config.cache mh-frag mt-frag - -if [ "$(TARGET_SUBDIR)" != "." ]; then \ +.PHONY: maybe-info-ash info-ash +maybe-info-ash: + +info-ash: \ + configure-ash + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-autoconf info-autoconf +maybe-info-autoconf: + +info-autoconf: \ + configure-autoconf + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-automake info-automake +maybe-info-automake: + +info-automake: \ + configure-automake + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-bash info-bash +maybe-info-bash: + +info-bash: \ + configure-bash + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-bfd info-bfd +maybe-info-bfd: + +info-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-opcodes info-opcodes +maybe-info-opcodes: + +info-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-binutils info-binutils +maybe-info-binutils: + +info-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-bison info-bison +maybe-info-bison: + +info-bison: \ + configure-bison + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-byacc info-byacc +maybe-info-byacc: + +info-byacc: \ + configure-byacc + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-bzip2 info-bzip2 +maybe-info-bzip2: + +info-bzip2: \ + configure-bzip2 + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-dejagnu info-dejagnu +maybe-info-dejagnu: + +info-dejagnu: \ + configure-dejagnu + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-diff info-diff +maybe-info-diff: + +info-diff: \ + configure-diff + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-dosutils info-dosutils +maybe-info-dosutils: + +info-dosutils: \ + configure-dosutils + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-etc info-etc +maybe-info-etc: + +info-etc: \ + configure-etc + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-fastjar info-fastjar +maybe-info-fastjar: + +info-fastjar: \ + configure-fastjar + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-fileutils info-fileutils +maybe-info-fileutils: + +info-fileutils: \ + configure-fileutils + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-findutils info-findutils +maybe-info-findutils: + +info-findutils: \ + configure-findutils + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-find info-find +maybe-info-find: + +info-find: \ + configure-find + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-flex info-flex +maybe-info-flex: + +info-flex: \ + configure-flex + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-gas info-gas +maybe-info-gas: + +info-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-gawk info-gawk +maybe-info-gawk: + +info-gawk: \ + configure-gawk + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-gettext info-gettext +maybe-info-gettext: + +info-gettext: \ + configure-gettext + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-gnuserv info-gnuserv +maybe-info-gnuserv: + +info-gnuserv: \ + configure-gnuserv + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-gprof info-gprof +maybe-info-gprof: + +info-gprof: \ + configure-gprof + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-gzip info-gzip +maybe-info-gzip: + +info-gzip: \ + configure-gzip + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-hello info-hello +maybe-info-hello: + +info-hello: \ + configure-hello + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-indent info-indent +maybe-info-indent: + +info-indent: \ + configure-indent + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-intl info-intl +maybe-info-intl: + +info-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-tcl info-tcl +maybe-info-tcl: + +info-tcl: \ + configure-tcl + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-itcl info-itcl +maybe-info-itcl: + +info-itcl: \ + configure-itcl + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-ld info-ld +maybe-info-ld: + +info-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-libgui info-libgui +maybe-info-libgui: + +info-libgui: \ + configure-libgui + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-libiberty info-libiberty +maybe-info-libiberty: + +info-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-libtool info-libtool +maybe-info-libtool: + +info-libtool: \ + configure-libtool + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-m4 info-m4 +maybe-info-m4: + +info-m4: \ + configure-m4 + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-make info-make +maybe-info-make: + +info-make: \ + configure-make + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-mmalloc info-mmalloc +maybe-info-mmalloc: + +info-mmalloc: \ + configure-mmalloc + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-patch info-patch +maybe-info-patch: + +info-patch: \ + configure-patch + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-perl info-perl +maybe-info-perl: + +info-perl: \ + configure-perl + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-prms info-prms +maybe-info-prms: + +info-prms: \ + configure-prms + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-rcs info-rcs +maybe-info-rcs: + +info-rcs: \ + configure-rcs + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-readline info-readline +maybe-info-readline: + +info-readline: \ + configure-readline + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-release info-release +maybe-info-release: + +info-release: \ + configure-release + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-recode info-recode +maybe-info-recode: + +info-recode: \ + configure-recode + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-sed info-sed +maybe-info-sed: + +info-sed: \ + configure-sed + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-send-pr info-send-pr +maybe-info-send-pr: + +info-send-pr: \ + configure-send-pr + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-shellutils info-shellutils +maybe-info-shellutils: + +info-shellutils: \ + configure-shellutils + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-sid info-sid +maybe-info-sid: + +info-sid: \ + configure-sid + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-sim info-sim +maybe-info-sim: + +info-sim: \ + configure-sim + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-tar info-tar +maybe-info-tar: + +info-tar: \ + configure-tar + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-texinfo info-texinfo +maybe-info-texinfo: + +info-texinfo: \ + configure-texinfo + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-textutils info-textutils +maybe-info-textutils: + +info-textutils: \ + configure-textutils + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-time info-time +maybe-info-time: + +info-time: \ + configure-time + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-uudecode info-uudecode +maybe-info-uudecode: + +info-uudecode: \ + configure-uudecode + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-wdiff info-wdiff +maybe-info-wdiff: + +info-wdiff: \ + configure-wdiff + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-zip info-zip +maybe-info-zip: + +info-zip: \ + configure-zip + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-zlib info-zlib +maybe-info-zlib: + +info-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-gdb info-gdb +maybe-info-gdb: + +info-gdb: \ + configure-gdb + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-expect info-expect +maybe-info-expect: + +info-expect: \ + configure-expect + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-guile info-guile +maybe-info-guile: + +info-guile: \ + configure-guile + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-tk info-tk +maybe-info-tk: + +info-tk: \ + configure-tk + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-tix info-tix +maybe-info-tix: + +info-tix: \ + configure-tix + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-libtermcap info-libtermcap +maybe-info-libtermcap: + +info-libtermcap: \ + configure-libtermcap + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in libtermcap" ; \ + (cd libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-utils info-utils +maybe-info-utils: + +info-utils: \ + configure-utils + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing info in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-info-target-libstdc++-v3 info-target-libstdc++-v3 +maybe-info-target-libstdc++-v3: + +info-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-newlib info-target-newlib +maybe-info-target-newlib: + +info-target-newlib: \ + configure-target-newlib + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-libf2c info-target-libf2c +maybe-info-target-libf2c: + +info-target-libf2c: \ + configure-target-libf2c + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-libobjc info-target-libobjc +maybe-info-target-libobjc: + +info-target-libobjc: \ + configure-target-libobjc + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-libtermcap info-target-libtermcap +maybe-info-target-libtermcap: + +info-target-libtermcap: \ + configure-target-libtermcap + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-winsup info-target-winsup +maybe-info-target-winsup: + +info-target-winsup: \ + configure-target-winsup + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-libgloss info-target-libgloss +maybe-info-target-libgloss: + +info-target-libgloss: \ + configure-target-libgloss + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-libiberty info-target-libiberty +maybe-info-target-libiberty: + +info-target-libiberty: \ + configure-target-libiberty + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-gperf info-target-gperf +maybe-info-target-gperf: + +info-target-gperf: \ + configure-target-gperf + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-examples info-target-examples +maybe-info-target-examples: + +info-target-examples: \ + configure-target-examples + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-libffi info-target-libffi +maybe-info-target-libffi: + +info-target-libffi: \ + configure-target-libffi + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-libjava info-target-libjava +maybe-info-target-libjava: + +info-target-libjava: \ + configure-target-libjava + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-zlib info-target-zlib +maybe-info-target-zlib: + +info-target-zlib: \ + configure-target-zlib + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-boehm-gc info-target-boehm-gc +maybe-info-target-boehm-gc: + +info-target-boehm-gc: \ + configure-target-boehm-gc + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-qthreads info-target-qthreads +maybe-info-target-qthreads: + +info-target-qthreads: \ + configure-target-qthreads + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-rda info-target-rda +maybe-info-target-rda: + +info-target-rda: \ + configure-target-rda + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + +.PHONY: maybe-info-target-libada info-target-libada +maybe-info-target-libada: + +info-target-libada: \ + configure-target-libada + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing info in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + info) \ + || exit 1 + + + +.PHONY: do-dvi +do-dvi: dvi-host dvi-target + +.PHONY: dvi-host +dvi-host: maybe-dvi-gcc \ + maybe-dvi-ash \ + maybe-dvi-autoconf \ + maybe-dvi-automake \ + maybe-dvi-bash \ + maybe-dvi-bfd \ + maybe-dvi-opcodes \ + maybe-dvi-binutils \ + maybe-dvi-bison \ + maybe-dvi-byacc \ + maybe-dvi-bzip2 \ + maybe-dvi-dejagnu \ + maybe-dvi-diff \ + maybe-dvi-dosutils \ + maybe-dvi-etc \ + maybe-dvi-fastjar \ + maybe-dvi-fileutils \ + maybe-dvi-findutils \ + maybe-dvi-find \ + maybe-dvi-flex \ + maybe-dvi-gas \ + maybe-dvi-gawk \ + maybe-dvi-gettext \ + maybe-dvi-gnuserv \ + maybe-dvi-gprof \ + maybe-dvi-gzip \ + maybe-dvi-hello \ + maybe-dvi-indent \ + maybe-dvi-intl \ + maybe-dvi-tcl \ + maybe-dvi-itcl \ + maybe-dvi-ld \ + maybe-dvi-libgui \ + maybe-dvi-libiberty \ + maybe-dvi-libtool \ + maybe-dvi-m4 \ + maybe-dvi-make \ + maybe-dvi-mmalloc \ + maybe-dvi-patch \ + maybe-dvi-perl \ + maybe-dvi-prms \ + maybe-dvi-rcs \ + maybe-dvi-readline \ + maybe-dvi-release \ + maybe-dvi-recode \ + maybe-dvi-sed \ + maybe-dvi-send-pr \ + maybe-dvi-shellutils \ + maybe-dvi-sid \ + maybe-dvi-sim \ + maybe-dvi-tar \ + maybe-dvi-texinfo \ + maybe-dvi-textutils \ + maybe-dvi-time \ + maybe-dvi-uudecode \ + maybe-dvi-wdiff \ + maybe-dvi-zip \ + maybe-dvi-zlib \ + maybe-dvi-gdb \ + maybe-dvi-expect \ + maybe-dvi-guile \ + maybe-dvi-tk \ + maybe-dvi-tix \ + maybe-dvi-libtermcap \ + maybe-dvi-utils + +.PHONY: dvi-target +dvi-target: \ + maybe-dvi-target-libstdc++-v3 \ + maybe-dvi-target-newlib \ + maybe-dvi-target-libf2c \ + maybe-dvi-target-libobjc \ + maybe-dvi-target-libtermcap \ + maybe-dvi-target-winsup \ + maybe-dvi-target-libgloss \ + maybe-dvi-target-libiberty \ + maybe-dvi-target-gperf \ + maybe-dvi-target-examples \ + maybe-dvi-target-libffi \ + maybe-dvi-target-libjava \ + maybe-dvi-target-zlib \ + maybe-dvi-target-boehm-gc \ + maybe-dvi-target-qthreads \ + maybe-dvi-target-rda \ + maybe-dvi-target-libada + +# GCC, the eternal special case +.PHONY: maybe-dvi-gcc dvi-gcc +maybe-dvi-gcc: +dvi-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-dvi-ash dvi-ash +maybe-dvi-ash: + +dvi-ash: \ + configure-ash + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-autoconf dvi-autoconf +maybe-dvi-autoconf: + +dvi-autoconf: \ + configure-autoconf + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-automake dvi-automake +maybe-dvi-automake: + +dvi-automake: \ + configure-automake + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-bash dvi-bash +maybe-dvi-bash: + +dvi-bash: \ + configure-bash + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-bfd dvi-bfd +maybe-dvi-bfd: + +dvi-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-opcodes dvi-opcodes +maybe-dvi-opcodes: + +dvi-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-binutils dvi-binutils +maybe-dvi-binutils: + +dvi-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-bison dvi-bison +maybe-dvi-bison: + +dvi-bison: \ + configure-bison + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-byacc dvi-byacc +maybe-dvi-byacc: + +dvi-byacc: \ + configure-byacc + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-bzip2 dvi-bzip2 +maybe-dvi-bzip2: + +dvi-bzip2: \ + configure-bzip2 + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-dejagnu dvi-dejagnu +maybe-dvi-dejagnu: + +dvi-dejagnu: \ + configure-dejagnu + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-diff dvi-diff +maybe-dvi-diff: + +dvi-diff: \ + configure-diff + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-dosutils dvi-dosutils +maybe-dvi-dosutils: + +dvi-dosutils: \ + configure-dosutils + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-etc dvi-etc +maybe-dvi-etc: + +dvi-etc: \ + configure-etc + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-fastjar dvi-fastjar +maybe-dvi-fastjar: + +dvi-fastjar: \ + configure-fastjar + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-fileutils dvi-fileutils +maybe-dvi-fileutils: + +dvi-fileutils: \ + configure-fileutils + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-findutils dvi-findutils +maybe-dvi-findutils: + +dvi-findutils: \ + configure-findutils + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-find dvi-find +maybe-dvi-find: + +dvi-find: \ + configure-find + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-flex dvi-flex +maybe-dvi-flex: + +dvi-flex: \ + configure-flex + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-gas dvi-gas +maybe-dvi-gas: + +dvi-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-gawk dvi-gawk +maybe-dvi-gawk: + +dvi-gawk: \ + configure-gawk + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-gettext dvi-gettext +maybe-dvi-gettext: + +dvi-gettext: \ + configure-gettext + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-gnuserv dvi-gnuserv +maybe-dvi-gnuserv: + +dvi-gnuserv: \ + configure-gnuserv + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-gprof dvi-gprof +maybe-dvi-gprof: + +dvi-gprof: \ + configure-gprof + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-gzip dvi-gzip +maybe-dvi-gzip: + +dvi-gzip: \ + configure-gzip + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-hello dvi-hello +maybe-dvi-hello: + +dvi-hello: \ + configure-hello + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-indent dvi-indent +maybe-dvi-indent: + +dvi-indent: \ + configure-indent + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-intl dvi-intl +maybe-dvi-intl: + +dvi-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-tcl dvi-tcl +maybe-dvi-tcl: + +dvi-tcl: \ + configure-tcl + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-itcl dvi-itcl +maybe-dvi-itcl: + +dvi-itcl: \ + configure-itcl + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-ld dvi-ld +maybe-dvi-ld: + +dvi-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-libgui dvi-libgui +maybe-dvi-libgui: + +dvi-libgui: \ + configure-libgui + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-libiberty dvi-libiberty +maybe-dvi-libiberty: + +dvi-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-libtool dvi-libtool +maybe-dvi-libtool: + +dvi-libtool: \ + configure-libtool + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-m4 dvi-m4 +maybe-dvi-m4: + +dvi-m4: \ + configure-m4 + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-make dvi-make +maybe-dvi-make: + +dvi-make: \ + configure-make + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-mmalloc dvi-mmalloc +maybe-dvi-mmalloc: + +dvi-mmalloc: \ + configure-mmalloc + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-patch dvi-patch +maybe-dvi-patch: + +dvi-patch: \ + configure-patch + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-perl dvi-perl +maybe-dvi-perl: + +dvi-perl: \ + configure-perl + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-prms dvi-prms +maybe-dvi-prms: + +dvi-prms: \ + configure-prms + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-rcs dvi-rcs +maybe-dvi-rcs: + +dvi-rcs: \ + configure-rcs + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-readline dvi-readline +maybe-dvi-readline: + +dvi-readline: \ + configure-readline + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-release dvi-release +maybe-dvi-release: + +dvi-release: \ + configure-release + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-recode dvi-recode +maybe-dvi-recode: + +dvi-recode: \ + configure-recode + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-sed dvi-sed +maybe-dvi-sed: + +dvi-sed: \ + configure-sed + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-send-pr dvi-send-pr +maybe-dvi-send-pr: + +dvi-send-pr: \ + configure-send-pr + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-shellutils dvi-shellutils +maybe-dvi-shellutils: + +dvi-shellutils: \ + configure-shellutils + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-sid dvi-sid +maybe-dvi-sid: + +dvi-sid: \ + configure-sid + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-sim dvi-sim +maybe-dvi-sim: + +dvi-sim: \ + configure-sim + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-tar dvi-tar +maybe-dvi-tar: + +dvi-tar: \ + configure-tar + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-texinfo dvi-texinfo +maybe-dvi-texinfo: + +dvi-texinfo: \ + configure-texinfo + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-textutils dvi-textutils +maybe-dvi-textutils: + +dvi-textutils: \ + configure-textutils + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-time dvi-time +maybe-dvi-time: + +dvi-time: \ + configure-time + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-uudecode dvi-uudecode +maybe-dvi-uudecode: + +dvi-uudecode: \ + configure-uudecode + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-wdiff dvi-wdiff +maybe-dvi-wdiff: + +dvi-wdiff: \ + configure-wdiff + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-zip dvi-zip +maybe-dvi-zip: + +dvi-zip: \ + configure-zip + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-zlib dvi-zlib +maybe-dvi-zlib: + +dvi-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-gdb dvi-gdb +maybe-dvi-gdb: + +dvi-gdb: \ + configure-gdb + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-expect dvi-expect +maybe-dvi-expect: + +dvi-expect: \ + configure-expect + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-guile dvi-guile +maybe-dvi-guile: + +dvi-guile: \ + configure-guile + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-tk dvi-tk +maybe-dvi-tk: + +dvi-tk: \ + configure-tk + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-tix dvi-tix +maybe-dvi-tix: + +dvi-tix: \ + configure-tix + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-libtermcap dvi-libtermcap +maybe-dvi-libtermcap: + +dvi-libtermcap: \ + configure-libtermcap + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in libtermcap" ; \ + (cd libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-utils dvi-utils +maybe-dvi-utils: + +dvi-utils: \ + configure-utils + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing dvi in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-dvi-target-libstdc++-v3 dvi-target-libstdc++-v3 +maybe-dvi-target-libstdc++-v3: + +dvi-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-newlib dvi-target-newlib +maybe-dvi-target-newlib: + +dvi-target-newlib: \ + configure-target-newlib + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-libf2c dvi-target-libf2c +maybe-dvi-target-libf2c: + +dvi-target-libf2c: \ + configure-target-libf2c + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-libobjc dvi-target-libobjc +maybe-dvi-target-libobjc: + +dvi-target-libobjc: \ + configure-target-libobjc + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-libtermcap dvi-target-libtermcap +maybe-dvi-target-libtermcap: + +dvi-target-libtermcap: \ + configure-target-libtermcap + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-winsup dvi-target-winsup +maybe-dvi-target-winsup: + +dvi-target-winsup: \ + configure-target-winsup + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-libgloss dvi-target-libgloss +maybe-dvi-target-libgloss: + +dvi-target-libgloss: \ + configure-target-libgloss + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-libiberty dvi-target-libiberty +maybe-dvi-target-libiberty: + +dvi-target-libiberty: \ + configure-target-libiberty + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-gperf dvi-target-gperf +maybe-dvi-target-gperf: + +dvi-target-gperf: \ + configure-target-gperf + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-examples dvi-target-examples +maybe-dvi-target-examples: + +dvi-target-examples: \ + configure-target-examples + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-libffi dvi-target-libffi +maybe-dvi-target-libffi: + +dvi-target-libffi: \ + configure-target-libffi + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-libjava dvi-target-libjava +maybe-dvi-target-libjava: + +dvi-target-libjava: \ + configure-target-libjava + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-zlib dvi-target-zlib +maybe-dvi-target-zlib: + +dvi-target-zlib: \ + configure-target-zlib + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-boehm-gc dvi-target-boehm-gc +maybe-dvi-target-boehm-gc: + +dvi-target-boehm-gc: \ + configure-target-boehm-gc + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-qthreads dvi-target-qthreads +maybe-dvi-target-qthreads: + +dvi-target-qthreads: \ + configure-target-qthreads + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-rda dvi-target-rda +maybe-dvi-target-rda: + +dvi-target-rda: \ + configure-target-rda + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + +.PHONY: maybe-dvi-target-libada dvi-target-libada +maybe-dvi-target-libada: + +dvi-target-libada: \ + configure-target-libada + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing dvi in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + dvi) \ + || exit 1 + + + +.PHONY: do-TAGS +do-TAGS: TAGS-host TAGS-target + +.PHONY: TAGS-host +TAGS-host: maybe-TAGS-gcc \ + maybe-TAGS-ash \ + maybe-TAGS-autoconf \ + maybe-TAGS-automake \ + maybe-TAGS-bash \ + maybe-TAGS-bfd \ + maybe-TAGS-opcodes \ + maybe-TAGS-binutils \ + maybe-TAGS-bison \ + maybe-TAGS-byacc \ + maybe-TAGS-bzip2 \ + maybe-TAGS-dejagnu \ + maybe-TAGS-diff \ + maybe-TAGS-dosutils \ + maybe-TAGS-etc \ + maybe-TAGS-fastjar \ + maybe-TAGS-fileutils \ + maybe-TAGS-findutils \ + maybe-TAGS-find \ + maybe-TAGS-flex \ + maybe-TAGS-gas \ + maybe-TAGS-gawk \ + maybe-TAGS-gettext \ + maybe-TAGS-gnuserv \ + maybe-TAGS-gprof \ + maybe-TAGS-gzip \ + maybe-TAGS-hello \ + maybe-TAGS-indent \ + maybe-TAGS-intl \ + maybe-TAGS-tcl \ + maybe-TAGS-itcl \ + maybe-TAGS-ld \ + maybe-TAGS-libgui \ + maybe-TAGS-libiberty \ + maybe-TAGS-libtool \ + maybe-TAGS-m4 \ + maybe-TAGS-make \ + maybe-TAGS-mmalloc \ + maybe-TAGS-patch \ + maybe-TAGS-perl \ + maybe-TAGS-prms \ + maybe-TAGS-rcs \ + maybe-TAGS-readline \ + maybe-TAGS-release \ + maybe-TAGS-recode \ + maybe-TAGS-sed \ + maybe-TAGS-send-pr \ + maybe-TAGS-shellutils \ + maybe-TAGS-sid \ + maybe-TAGS-sim \ + maybe-TAGS-tar \ + maybe-TAGS-texinfo \ + maybe-TAGS-textutils \ + maybe-TAGS-time \ + maybe-TAGS-uudecode \ + maybe-TAGS-wdiff \ + maybe-TAGS-zip \ + maybe-TAGS-zlib \ + maybe-TAGS-gdb \ + maybe-TAGS-expect \ + maybe-TAGS-guile \ + maybe-TAGS-tk \ + maybe-TAGS-tix \ + maybe-TAGS-libtermcap \ + maybe-TAGS-utils + +.PHONY: TAGS-target +TAGS-target: \ + maybe-TAGS-target-libstdc++-v3 \ + maybe-TAGS-target-newlib \ + maybe-TAGS-target-libf2c \ + maybe-TAGS-target-libobjc \ + maybe-TAGS-target-libtermcap \ + maybe-TAGS-target-winsup \ + maybe-TAGS-target-libgloss \ + maybe-TAGS-target-libiberty \ + maybe-TAGS-target-gperf \ + maybe-TAGS-target-examples \ + maybe-TAGS-target-libffi \ + maybe-TAGS-target-libjava \ + maybe-TAGS-target-zlib \ + maybe-TAGS-target-boehm-gc \ + maybe-TAGS-target-qthreads \ + maybe-TAGS-target-rda \ + maybe-TAGS-target-libada + +# GCC, the eternal special case +.PHONY: maybe-TAGS-gcc TAGS-gcc +maybe-TAGS-gcc: +TAGS-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-TAGS-ash TAGS-ash +maybe-TAGS-ash: + +TAGS-ash: \ + configure-ash + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-autoconf TAGS-autoconf +maybe-TAGS-autoconf: + +TAGS-autoconf: \ + configure-autoconf + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-automake TAGS-automake +maybe-TAGS-automake: + +TAGS-automake: \ + configure-automake + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-bash TAGS-bash +maybe-TAGS-bash: + +TAGS-bash: \ + configure-bash + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-bfd TAGS-bfd +maybe-TAGS-bfd: + +TAGS-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-opcodes TAGS-opcodes +maybe-TAGS-opcodes: + +TAGS-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-binutils TAGS-binutils +maybe-TAGS-binutils: + +TAGS-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-bison TAGS-bison +maybe-TAGS-bison: + +TAGS-bison: \ + configure-bison + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-byacc TAGS-byacc +maybe-TAGS-byacc: + +TAGS-byacc: \ + configure-byacc + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-bzip2 TAGS-bzip2 +maybe-TAGS-bzip2: + +TAGS-bzip2: \ + configure-bzip2 + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-dejagnu TAGS-dejagnu +maybe-TAGS-dejagnu: + +TAGS-dejagnu: \ + configure-dejagnu + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-diff TAGS-diff +maybe-TAGS-diff: + +TAGS-diff: \ + configure-diff + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-dosutils TAGS-dosutils +maybe-TAGS-dosutils: + +TAGS-dosutils: \ + configure-dosutils + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-etc TAGS-etc +maybe-TAGS-etc: + +TAGS-etc: \ + configure-etc + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-fastjar TAGS-fastjar +maybe-TAGS-fastjar: + +TAGS-fastjar: \ + configure-fastjar + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-fileutils TAGS-fileutils +maybe-TAGS-fileutils: + +TAGS-fileutils: \ + configure-fileutils + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-findutils TAGS-findutils +maybe-TAGS-findutils: + +TAGS-findutils: \ + configure-findutils + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-find TAGS-find +maybe-TAGS-find: + +TAGS-find: \ + configure-find + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-flex TAGS-flex +maybe-TAGS-flex: + +TAGS-flex: \ + configure-flex + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-gas TAGS-gas +maybe-TAGS-gas: + +TAGS-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-gawk TAGS-gawk +maybe-TAGS-gawk: + +TAGS-gawk: \ + configure-gawk + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-gettext TAGS-gettext +maybe-TAGS-gettext: + +TAGS-gettext: \ + configure-gettext + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-gnuserv TAGS-gnuserv +maybe-TAGS-gnuserv: + +TAGS-gnuserv: \ + configure-gnuserv + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-gprof TAGS-gprof +maybe-TAGS-gprof: + +TAGS-gprof: \ + configure-gprof + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-gzip TAGS-gzip +maybe-TAGS-gzip: + +TAGS-gzip: \ + configure-gzip + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-hello TAGS-hello +maybe-TAGS-hello: + +TAGS-hello: \ + configure-hello + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-indent TAGS-indent +maybe-TAGS-indent: + +TAGS-indent: \ + configure-indent + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-intl TAGS-intl +maybe-TAGS-intl: + +TAGS-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-tcl TAGS-tcl +maybe-TAGS-tcl: + +TAGS-tcl: \ + configure-tcl + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-itcl TAGS-itcl +maybe-TAGS-itcl: + +TAGS-itcl: \ + configure-itcl + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-ld TAGS-ld +maybe-TAGS-ld: + +TAGS-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-libgui TAGS-libgui +maybe-TAGS-libgui: + +TAGS-libgui: \ + configure-libgui + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-libiberty TAGS-libiberty +maybe-TAGS-libiberty: + +TAGS-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-libtool TAGS-libtool +maybe-TAGS-libtool: + +TAGS-libtool: \ + configure-libtool + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-m4 TAGS-m4 +maybe-TAGS-m4: + +TAGS-m4: \ + configure-m4 + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-make TAGS-make +maybe-TAGS-make: + +TAGS-make: \ + configure-make + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-mmalloc TAGS-mmalloc +maybe-TAGS-mmalloc: + +TAGS-mmalloc: \ + configure-mmalloc + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-patch TAGS-patch +maybe-TAGS-patch: + +TAGS-patch: \ + configure-patch + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-perl TAGS-perl +maybe-TAGS-perl: + +TAGS-perl: \ + configure-perl + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-prms TAGS-prms +maybe-TAGS-prms: + +TAGS-prms: \ + configure-prms + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-rcs TAGS-rcs +maybe-TAGS-rcs: + +TAGS-rcs: \ + configure-rcs + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-readline TAGS-readline +maybe-TAGS-readline: + +TAGS-readline: \ + configure-readline + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-release TAGS-release +maybe-TAGS-release: + +TAGS-release: \ + configure-release + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-recode TAGS-recode +maybe-TAGS-recode: + +TAGS-recode: \ + configure-recode + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-sed TAGS-sed +maybe-TAGS-sed: + +TAGS-sed: \ + configure-sed + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-send-pr TAGS-send-pr +maybe-TAGS-send-pr: + +TAGS-send-pr: \ + configure-send-pr + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-shellutils TAGS-shellutils +maybe-TAGS-shellutils: + +TAGS-shellutils: \ + configure-shellutils + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-sid TAGS-sid +maybe-TAGS-sid: + +TAGS-sid: \ + configure-sid + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-sim TAGS-sim +maybe-TAGS-sim: + +TAGS-sim: \ + configure-sim + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-tar TAGS-tar +maybe-TAGS-tar: + +TAGS-tar: \ + configure-tar + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-texinfo TAGS-texinfo +maybe-TAGS-texinfo: + +TAGS-texinfo: \ + configure-texinfo + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-textutils TAGS-textutils +maybe-TAGS-textutils: + +TAGS-textutils: \ + configure-textutils + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-time TAGS-time +maybe-TAGS-time: + +TAGS-time: \ + configure-time + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-uudecode TAGS-uudecode +maybe-TAGS-uudecode: + +TAGS-uudecode: \ + configure-uudecode + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-wdiff TAGS-wdiff +maybe-TAGS-wdiff: + +TAGS-wdiff: \ + configure-wdiff + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-zip TAGS-zip +maybe-TAGS-zip: + +TAGS-zip: \ + configure-zip + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-zlib TAGS-zlib +maybe-TAGS-zlib: + +TAGS-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-gdb TAGS-gdb +maybe-TAGS-gdb: + +TAGS-gdb: \ + configure-gdb + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-expect TAGS-expect +maybe-TAGS-expect: + +TAGS-expect: \ + configure-expect + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-guile TAGS-guile +maybe-TAGS-guile: + +TAGS-guile: \ + configure-guile + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-tk TAGS-tk +maybe-TAGS-tk: + +TAGS-tk: \ + configure-tk + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-tix TAGS-tix +maybe-TAGS-tix: + +TAGS-tix: \ + configure-tix + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-libtermcap TAGS-libtermcap +maybe-TAGS-libtermcap: + +TAGS-libtermcap: \ + configure-libtermcap + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in libtermcap" ; \ + (cd libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-utils TAGS-utils +maybe-TAGS-utils: + +TAGS-utils: \ + configure-utils + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing TAGS in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-TAGS-target-libstdc++-v3 TAGS-target-libstdc++-v3 +maybe-TAGS-target-libstdc++-v3: + +TAGS-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-newlib TAGS-target-newlib +maybe-TAGS-target-newlib: + +TAGS-target-newlib: \ + configure-target-newlib + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-libf2c TAGS-target-libf2c +maybe-TAGS-target-libf2c: + +TAGS-target-libf2c: \ + configure-target-libf2c + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-libobjc TAGS-target-libobjc +maybe-TAGS-target-libobjc: + +TAGS-target-libobjc: \ + configure-target-libobjc + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-libtermcap TAGS-target-libtermcap +maybe-TAGS-target-libtermcap: + +TAGS-target-libtermcap: \ + configure-target-libtermcap + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-winsup TAGS-target-winsup +maybe-TAGS-target-winsup: + +TAGS-target-winsup: \ + configure-target-winsup + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-libgloss TAGS-target-libgloss +maybe-TAGS-target-libgloss: + +TAGS-target-libgloss: \ + configure-target-libgloss + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-libiberty TAGS-target-libiberty +maybe-TAGS-target-libiberty: + +TAGS-target-libiberty: \ + configure-target-libiberty + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-gperf TAGS-target-gperf +maybe-TAGS-target-gperf: + +TAGS-target-gperf: \ + configure-target-gperf + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-examples TAGS-target-examples +maybe-TAGS-target-examples: + +TAGS-target-examples: \ + configure-target-examples + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-libffi TAGS-target-libffi +maybe-TAGS-target-libffi: + +TAGS-target-libffi: \ + configure-target-libffi + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-libjava TAGS-target-libjava +maybe-TAGS-target-libjava: + +TAGS-target-libjava: \ + configure-target-libjava + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-zlib TAGS-target-zlib +maybe-TAGS-target-zlib: + +TAGS-target-zlib: \ + configure-target-zlib + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-boehm-gc TAGS-target-boehm-gc +maybe-TAGS-target-boehm-gc: + +TAGS-target-boehm-gc: \ + configure-target-boehm-gc + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-qthreads TAGS-target-qthreads +maybe-TAGS-target-qthreads: + +TAGS-target-qthreads: \ + configure-target-qthreads + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-rda TAGS-target-rda +maybe-TAGS-target-rda: + +TAGS-target-rda: \ + configure-target-rda + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + +.PHONY: maybe-TAGS-target-libada TAGS-target-libada +maybe-TAGS-target-libada: + +TAGS-target-libada: \ + configure-target-libada + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing TAGS in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + TAGS) \ + || exit 1 + + + +.PHONY: do-install-info +do-install-info: install-info-host install-info-target + +.PHONY: install-info-host +install-info-host: maybe-install-info-gcc \ + maybe-install-info-ash \ + maybe-install-info-autoconf \ + maybe-install-info-automake \ + maybe-install-info-bash \ + maybe-install-info-bfd \ + maybe-install-info-opcodes \ + maybe-install-info-binutils \ + maybe-install-info-bison \ + maybe-install-info-byacc \ + maybe-install-info-bzip2 \ + maybe-install-info-dejagnu \ + maybe-install-info-diff \ + maybe-install-info-dosutils \ + maybe-install-info-etc \ + maybe-install-info-fastjar \ + maybe-install-info-fileutils \ + maybe-install-info-findutils \ + maybe-install-info-find \ + maybe-install-info-flex \ + maybe-install-info-gas \ + maybe-install-info-gawk \ + maybe-install-info-gettext \ + maybe-install-info-gnuserv \ + maybe-install-info-gprof \ + maybe-install-info-gzip \ + maybe-install-info-hello \ + maybe-install-info-indent \ + maybe-install-info-intl \ + maybe-install-info-tcl \ + maybe-install-info-itcl \ + maybe-install-info-ld \ + maybe-install-info-libgui \ + maybe-install-info-libiberty \ + maybe-install-info-libtool \ + maybe-install-info-m4 \ + maybe-install-info-make \ + maybe-install-info-mmalloc \ + maybe-install-info-patch \ + maybe-install-info-perl \ + maybe-install-info-prms \ + maybe-install-info-rcs \ + maybe-install-info-readline \ + maybe-install-info-release \ + maybe-install-info-recode \ + maybe-install-info-sed \ + maybe-install-info-send-pr \ + maybe-install-info-shellutils \ + maybe-install-info-sid \ + maybe-install-info-sim \ + maybe-install-info-tar \ + maybe-install-info-texinfo \ + maybe-install-info-textutils \ + maybe-install-info-time \ + maybe-install-info-uudecode \ + maybe-install-info-wdiff \ + maybe-install-info-zip \ + maybe-install-info-zlib \ + maybe-install-info-gdb \ + maybe-install-info-expect \ + maybe-install-info-guile \ + maybe-install-info-tk \ + maybe-install-info-tix \ + maybe-install-info-libtermcap \ + maybe-install-info-utils + +.PHONY: install-info-target +install-info-target: \ + maybe-install-info-target-libstdc++-v3 \ + maybe-install-info-target-newlib \ + maybe-install-info-target-libf2c \ + maybe-install-info-target-libobjc \ + maybe-install-info-target-libtermcap \ + maybe-install-info-target-winsup \ + maybe-install-info-target-libgloss \ + maybe-install-info-target-libiberty \ + maybe-install-info-target-gperf \ + maybe-install-info-target-examples \ + maybe-install-info-target-libffi \ + maybe-install-info-target-libjava \ + maybe-install-info-target-zlib \ + maybe-install-info-target-boehm-gc \ + maybe-install-info-target-qthreads \ + maybe-install-info-target-rda \ + maybe-install-info-target-libada + +# GCC, the eternal special case +.PHONY: maybe-install-info-gcc install-info-gcc +maybe-install-info-gcc: +install-info-gcc: \ + configure-gcc \ + info-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-install-info-ash install-info-ash +maybe-install-info-ash: + +install-info-ash: \ + configure-ash \ + info-ash + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-autoconf install-info-autoconf +maybe-install-info-autoconf: + +install-info-autoconf: \ + configure-autoconf \ + info-autoconf + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-automake install-info-automake +maybe-install-info-automake: + +install-info-automake: \ + configure-automake \ + info-automake + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-bash install-info-bash +maybe-install-info-bash: + +install-info-bash: \ + configure-bash \ + info-bash + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-bfd install-info-bfd +maybe-install-info-bfd: + +install-info-bfd: \ + configure-bfd \ + info-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-opcodes install-info-opcodes +maybe-install-info-opcodes: + +install-info-opcodes: \ + configure-opcodes \ + info-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-binutils install-info-binutils +maybe-install-info-binutils: + +install-info-binutils: \ + configure-binutils \ + info-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-bison install-info-bison +maybe-install-info-bison: + +install-info-bison: \ + configure-bison \ + info-bison + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-byacc install-info-byacc +maybe-install-info-byacc: + +install-info-byacc: \ + configure-byacc \ + info-byacc + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-bzip2 install-info-bzip2 +maybe-install-info-bzip2: + +install-info-bzip2: \ + configure-bzip2 \ + info-bzip2 + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-dejagnu install-info-dejagnu +maybe-install-info-dejagnu: + +install-info-dejagnu: \ + configure-dejagnu \ + info-dejagnu + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-diff install-info-diff +maybe-install-info-diff: + +install-info-diff: \ + configure-diff \ + info-diff + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-dosutils install-info-dosutils +maybe-install-info-dosutils: + +install-info-dosutils: \ + configure-dosutils \ + info-dosutils + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-etc install-info-etc +maybe-install-info-etc: + +install-info-etc: \ + configure-etc \ + info-etc + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-fastjar install-info-fastjar +maybe-install-info-fastjar: + +install-info-fastjar: \ + configure-fastjar \ + info-fastjar + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-fileutils install-info-fileutils +maybe-install-info-fileutils: + +install-info-fileutils: \ + configure-fileutils \ + info-fileutils + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-findutils install-info-findutils +maybe-install-info-findutils: + +install-info-findutils: \ + configure-findutils \ + info-findutils + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-find install-info-find +maybe-install-info-find: + +install-info-find: \ + configure-find \ + info-find + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-flex install-info-flex +maybe-install-info-flex: + +install-info-flex: \ + configure-flex \ + info-flex + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-gas install-info-gas +maybe-install-info-gas: + +install-info-gas: \ + configure-gas \ + info-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-gawk install-info-gawk +maybe-install-info-gawk: + +install-info-gawk: \ + configure-gawk \ + info-gawk + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-gettext install-info-gettext +maybe-install-info-gettext: + +install-info-gettext: \ + configure-gettext \ + info-gettext + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-gnuserv install-info-gnuserv +maybe-install-info-gnuserv: + +install-info-gnuserv: \ + configure-gnuserv \ + info-gnuserv + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-gprof install-info-gprof +maybe-install-info-gprof: + +install-info-gprof: \ + configure-gprof \ + info-gprof + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-gzip install-info-gzip +maybe-install-info-gzip: + +install-info-gzip: \ + configure-gzip \ + info-gzip + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-hello install-info-hello +maybe-install-info-hello: + +install-info-hello: \ + configure-hello \ + info-hello + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-indent install-info-indent +maybe-install-info-indent: + +install-info-indent: \ + configure-indent \ + info-indent + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-intl install-info-intl +maybe-install-info-intl: + +install-info-intl: \ + configure-intl \ + info-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-tcl install-info-tcl +maybe-install-info-tcl: + +install-info-tcl: \ + configure-tcl \ + info-tcl + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-itcl install-info-itcl +maybe-install-info-itcl: + +install-info-itcl: \ + configure-itcl \ + info-itcl + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-ld install-info-ld +maybe-install-info-ld: + +install-info-ld: \ + configure-ld \ + info-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-libgui install-info-libgui +maybe-install-info-libgui: + +install-info-libgui: \ + configure-libgui \ + info-libgui + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-libiberty install-info-libiberty +maybe-install-info-libiberty: + +install-info-libiberty: \ + configure-libiberty \ + info-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-libtool install-info-libtool +maybe-install-info-libtool: + +install-info-libtool: \ + configure-libtool \ + info-libtool + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-m4 install-info-m4 +maybe-install-info-m4: + +install-info-m4: \ + configure-m4 \ + info-m4 + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-make install-info-make +maybe-install-info-make: + +install-info-make: \ + configure-make \ + info-make + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-mmalloc install-info-mmalloc +maybe-install-info-mmalloc: + +install-info-mmalloc: \ + configure-mmalloc \ + info-mmalloc + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-patch install-info-patch +maybe-install-info-patch: + +install-info-patch: \ + configure-patch \ + info-patch + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-perl install-info-perl +maybe-install-info-perl: + +install-info-perl: \ + configure-perl \ + info-perl + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-prms install-info-prms +maybe-install-info-prms: + +install-info-prms: \ + configure-prms \ + info-prms + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-rcs install-info-rcs +maybe-install-info-rcs: + +install-info-rcs: \ + configure-rcs \ + info-rcs + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-readline install-info-readline +maybe-install-info-readline: + +install-info-readline: \ + configure-readline \ + info-readline + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-release install-info-release +maybe-install-info-release: + +install-info-release: \ + configure-release \ + info-release + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-recode install-info-recode +maybe-install-info-recode: + +install-info-recode: \ + configure-recode \ + info-recode + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-sed install-info-sed +maybe-install-info-sed: + +install-info-sed: \ + configure-sed \ + info-sed + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-send-pr install-info-send-pr +maybe-install-info-send-pr: + +install-info-send-pr: \ + configure-send-pr \ + info-send-pr + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-shellutils install-info-shellutils +maybe-install-info-shellutils: + +install-info-shellutils: \ + configure-shellutils \ + info-shellutils + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-sid install-info-sid +maybe-install-info-sid: + +install-info-sid: \ + configure-sid \ + info-sid + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-sim install-info-sim +maybe-install-info-sim: + +install-info-sim: \ + configure-sim \ + info-sim + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-tar install-info-tar +maybe-install-info-tar: + +install-info-tar: \ + configure-tar \ + info-tar + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-texinfo install-info-texinfo +maybe-install-info-texinfo: + +install-info-texinfo: \ + configure-texinfo \ + info-texinfo + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-textutils install-info-textutils +maybe-install-info-textutils: + +install-info-textutils: \ + configure-textutils \ + info-textutils + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-time install-info-time +maybe-install-info-time: + +install-info-time: \ + configure-time \ + info-time + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-uudecode install-info-uudecode +maybe-install-info-uudecode: + +install-info-uudecode: \ + configure-uudecode \ + info-uudecode + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-wdiff install-info-wdiff +maybe-install-info-wdiff: + +install-info-wdiff: \ + configure-wdiff \ + info-wdiff + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-zip install-info-zip +maybe-install-info-zip: + +install-info-zip: \ + configure-zip \ + info-zip + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-zlib install-info-zlib +maybe-install-info-zlib: + +install-info-zlib: \ + configure-zlib \ + info-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-gdb install-info-gdb +maybe-install-info-gdb: + +install-info-gdb: \ + configure-gdb \ + info-gdb + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-expect install-info-expect +maybe-install-info-expect: + +install-info-expect: \ + configure-expect \ + info-expect + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-guile install-info-guile +maybe-install-info-guile: + +install-info-guile: \ + configure-guile \ + info-guile + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-tk install-info-tk +maybe-install-info-tk: + +install-info-tk: \ + configure-tk \ + info-tk + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-tix install-info-tix +maybe-install-info-tix: + +install-info-tix: \ + configure-tix \ + info-tix + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-libtermcap install-info-libtermcap +maybe-install-info-libtermcap: + +install-info-libtermcap: \ + configure-libtermcap \ + info-libtermcap + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in libtermcap" ; \ + (cd libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-utils install-info-utils +maybe-install-info-utils: + +install-info-utils: \ + configure-utils \ + info-utils + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing install-info in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-install-info-target-libstdc++-v3 install-info-target-libstdc++-v3 +maybe-install-info-target-libstdc++-v3: + +install-info-target-libstdc++-v3: \ + configure-target-libstdc++-v3 \ + info-target-libstdc++-v3 + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-newlib install-info-target-newlib +maybe-install-info-target-newlib: + +install-info-target-newlib: \ + configure-target-newlib \ + info-target-newlib + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-libf2c install-info-target-libf2c +maybe-install-info-target-libf2c: + +install-info-target-libf2c: \ + configure-target-libf2c \ + info-target-libf2c + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-libobjc install-info-target-libobjc +maybe-install-info-target-libobjc: + +install-info-target-libobjc: \ + configure-target-libobjc \ + info-target-libobjc + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-libtermcap install-info-target-libtermcap +maybe-install-info-target-libtermcap: + +install-info-target-libtermcap: \ + configure-target-libtermcap \ + info-target-libtermcap + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-winsup install-info-target-winsup +maybe-install-info-target-winsup: + +install-info-target-winsup: \ + configure-target-winsup \ + info-target-winsup + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-libgloss install-info-target-libgloss +maybe-install-info-target-libgloss: + +install-info-target-libgloss: \ + configure-target-libgloss \ + info-target-libgloss + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-libiberty install-info-target-libiberty +maybe-install-info-target-libiberty: + +install-info-target-libiberty: \ + configure-target-libiberty \ + info-target-libiberty + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-gperf install-info-target-gperf +maybe-install-info-target-gperf: + +install-info-target-gperf: \ + configure-target-gperf \ + info-target-gperf + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-examples install-info-target-examples +maybe-install-info-target-examples: + +install-info-target-examples: \ + configure-target-examples \ + info-target-examples + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-libffi install-info-target-libffi +maybe-install-info-target-libffi: + +install-info-target-libffi: \ + configure-target-libffi \ + info-target-libffi + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-libjava install-info-target-libjava +maybe-install-info-target-libjava: + +install-info-target-libjava: \ + configure-target-libjava \ + info-target-libjava + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-zlib install-info-target-zlib +maybe-install-info-target-zlib: + +install-info-target-zlib: \ + configure-target-zlib \ + info-target-zlib + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-boehm-gc install-info-target-boehm-gc +maybe-install-info-target-boehm-gc: + +install-info-target-boehm-gc: \ + configure-target-boehm-gc \ + info-target-boehm-gc + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-qthreads install-info-target-qthreads +maybe-install-info-target-qthreads: + +install-info-target-qthreads: \ + configure-target-qthreads \ + info-target-qthreads + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-rda install-info-target-rda +maybe-install-info-target-rda: + +install-info-target-rda: \ + configure-target-rda \ + info-target-rda + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + +.PHONY: maybe-install-info-target-libada install-info-target-libada +maybe-install-info-target-libada: + +install-info-target-libada: \ + configure-target-libada \ + info-target-libada + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing install-info in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + install-info) \ + || exit 1 + + + +.PHONY: do-installcheck +do-installcheck: installcheck-host installcheck-target + +.PHONY: installcheck-host +installcheck-host: maybe-installcheck-gcc \ + maybe-installcheck-ash \ + maybe-installcheck-autoconf \ + maybe-installcheck-automake \ + maybe-installcheck-bash \ + maybe-installcheck-bfd \ + maybe-installcheck-opcodes \ + maybe-installcheck-binutils \ + maybe-installcheck-bison \ + maybe-installcheck-byacc \ + maybe-installcheck-bzip2 \ + maybe-installcheck-dejagnu \ + maybe-installcheck-diff \ + maybe-installcheck-dosutils \ + maybe-installcheck-etc \ + maybe-installcheck-fastjar \ + maybe-installcheck-fileutils \ + maybe-installcheck-findutils \ + maybe-installcheck-find \ + maybe-installcheck-flex \ + maybe-installcheck-gas \ + maybe-installcheck-gawk \ + maybe-installcheck-gettext \ + maybe-installcheck-gnuserv \ + maybe-installcheck-gprof \ + maybe-installcheck-gzip \ + maybe-installcheck-hello \ + maybe-installcheck-indent \ + maybe-installcheck-intl \ + maybe-installcheck-tcl \ + maybe-installcheck-itcl \ + maybe-installcheck-ld \ + maybe-installcheck-libgui \ + maybe-installcheck-libiberty \ + maybe-installcheck-libtool \ + maybe-installcheck-m4 \ + maybe-installcheck-make \ + maybe-installcheck-mmalloc \ + maybe-installcheck-patch \ + maybe-installcheck-perl \ + maybe-installcheck-prms \ + maybe-installcheck-rcs \ + maybe-installcheck-readline \ + maybe-installcheck-release \ + maybe-installcheck-recode \ + maybe-installcheck-sed \ + maybe-installcheck-send-pr \ + maybe-installcheck-shellutils \ + maybe-installcheck-sid \ + maybe-installcheck-sim \ + maybe-installcheck-tar \ + maybe-installcheck-texinfo \ + maybe-installcheck-textutils \ + maybe-installcheck-time \ + maybe-installcheck-uudecode \ + maybe-installcheck-wdiff \ + maybe-installcheck-zip \ + maybe-installcheck-zlib \ + maybe-installcheck-gdb \ + maybe-installcheck-expect \ + maybe-installcheck-guile \ + maybe-installcheck-tk \ + maybe-installcheck-tix \ + maybe-installcheck-libtermcap \ + maybe-installcheck-utils + +.PHONY: installcheck-target +installcheck-target: \ + maybe-installcheck-target-libstdc++-v3 \ + maybe-installcheck-target-newlib \ + maybe-installcheck-target-libf2c \ + maybe-installcheck-target-libobjc \ + maybe-installcheck-target-libtermcap \ + maybe-installcheck-target-winsup \ + maybe-installcheck-target-libgloss \ + maybe-installcheck-target-libiberty \ + maybe-installcheck-target-gperf \ + maybe-installcheck-target-examples \ + maybe-installcheck-target-libffi \ + maybe-installcheck-target-libjava \ + maybe-installcheck-target-zlib \ + maybe-installcheck-target-boehm-gc \ + maybe-installcheck-target-qthreads \ + maybe-installcheck-target-rda \ + maybe-installcheck-target-libada + +# GCC, the eternal special case +.PHONY: maybe-installcheck-gcc installcheck-gcc +maybe-installcheck-gcc: +installcheck-gcc: \ + configure-gcc + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-installcheck-ash installcheck-ash +maybe-installcheck-ash: + +installcheck-ash: \ + configure-ash + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-autoconf installcheck-autoconf +maybe-installcheck-autoconf: + +installcheck-autoconf: \ + configure-autoconf + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-automake installcheck-automake +maybe-installcheck-automake: + +installcheck-automake: \ + configure-automake + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-bash installcheck-bash +maybe-installcheck-bash: + +installcheck-bash: \ + configure-bash + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-bfd installcheck-bfd +maybe-installcheck-bfd: + +installcheck-bfd: \ + configure-bfd + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-opcodes installcheck-opcodes +maybe-installcheck-opcodes: + +installcheck-opcodes: \ + configure-opcodes + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-binutils installcheck-binutils +maybe-installcheck-binutils: + +installcheck-binutils: \ + configure-binutils + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-bison installcheck-bison +maybe-installcheck-bison: + +installcheck-bison: \ + configure-bison + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-byacc installcheck-byacc +maybe-installcheck-byacc: + +installcheck-byacc: \ + configure-byacc + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-bzip2 installcheck-bzip2 +maybe-installcheck-bzip2: + +installcheck-bzip2: \ + configure-bzip2 + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-dejagnu installcheck-dejagnu +maybe-installcheck-dejagnu: + +installcheck-dejagnu: \ + configure-dejagnu + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-diff installcheck-diff +maybe-installcheck-diff: + +installcheck-diff: \ + configure-diff + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-dosutils installcheck-dosutils +maybe-installcheck-dosutils: + +installcheck-dosutils: \ + configure-dosutils + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-etc installcheck-etc +maybe-installcheck-etc: + +installcheck-etc: \ + configure-etc + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-fastjar installcheck-fastjar +maybe-installcheck-fastjar: + +installcheck-fastjar: \ + configure-fastjar + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-fileutils installcheck-fileutils +maybe-installcheck-fileutils: + +installcheck-fileutils: \ + configure-fileutils + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-findutils installcheck-findutils +maybe-installcheck-findutils: + +installcheck-findutils: \ + configure-findutils + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-find installcheck-find +maybe-installcheck-find: + +installcheck-find: \ + configure-find + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-flex installcheck-flex +maybe-installcheck-flex: + +installcheck-flex: \ + configure-flex + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-gas installcheck-gas +maybe-installcheck-gas: + +installcheck-gas: \ + configure-gas + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-gawk installcheck-gawk +maybe-installcheck-gawk: + +installcheck-gawk: \ + configure-gawk + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-gettext installcheck-gettext +maybe-installcheck-gettext: + +installcheck-gettext: \ + configure-gettext + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-gnuserv installcheck-gnuserv +maybe-installcheck-gnuserv: + +installcheck-gnuserv: \ + configure-gnuserv + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-gprof installcheck-gprof +maybe-installcheck-gprof: + +installcheck-gprof: \ + configure-gprof + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-gzip installcheck-gzip +maybe-installcheck-gzip: + +installcheck-gzip: \ + configure-gzip + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-hello installcheck-hello +maybe-installcheck-hello: + +installcheck-hello: \ + configure-hello + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-indent installcheck-indent +maybe-installcheck-indent: + +installcheck-indent: \ + configure-indent + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-intl installcheck-intl +maybe-installcheck-intl: + +installcheck-intl: \ + configure-intl + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-tcl installcheck-tcl +maybe-installcheck-tcl: + +installcheck-tcl: \ + configure-tcl + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-itcl installcheck-itcl +maybe-installcheck-itcl: + +installcheck-itcl: \ + configure-itcl + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-ld installcheck-ld +maybe-installcheck-ld: + +installcheck-ld: \ + configure-ld + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-libgui installcheck-libgui +maybe-installcheck-libgui: + +installcheck-libgui: \ + configure-libgui + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-libiberty installcheck-libiberty +maybe-installcheck-libiberty: + +installcheck-libiberty: \ + configure-libiberty + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-libtool installcheck-libtool +maybe-installcheck-libtool: + +installcheck-libtool: \ + configure-libtool + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-m4 installcheck-m4 +maybe-installcheck-m4: + +installcheck-m4: \ + configure-m4 + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-make installcheck-make +maybe-installcheck-make: + +installcheck-make: \ + configure-make + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-mmalloc installcheck-mmalloc +maybe-installcheck-mmalloc: + +installcheck-mmalloc: \ + configure-mmalloc + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-patch installcheck-patch +maybe-installcheck-patch: + +installcheck-patch: \ + configure-patch + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-perl installcheck-perl +maybe-installcheck-perl: + +installcheck-perl: \ + configure-perl + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-prms installcheck-prms +maybe-installcheck-prms: + +installcheck-prms: \ + configure-prms + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-rcs installcheck-rcs +maybe-installcheck-rcs: + +installcheck-rcs: \ + configure-rcs + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-readline installcheck-readline +maybe-installcheck-readline: + +installcheck-readline: \ + configure-readline + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-release installcheck-release +maybe-installcheck-release: + +installcheck-release: \ + configure-release + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-recode installcheck-recode +maybe-installcheck-recode: + +installcheck-recode: \ + configure-recode + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-sed installcheck-sed +maybe-installcheck-sed: + +installcheck-sed: \ + configure-sed + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-send-pr installcheck-send-pr +maybe-installcheck-send-pr: + +installcheck-send-pr: \ + configure-send-pr + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-shellutils installcheck-shellutils +maybe-installcheck-shellutils: + +installcheck-shellutils: \ + configure-shellutils + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-sid installcheck-sid +maybe-installcheck-sid: + +installcheck-sid: \ + configure-sid + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-sim installcheck-sim +maybe-installcheck-sim: + +installcheck-sim: \ + configure-sim + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-tar installcheck-tar +maybe-installcheck-tar: + +installcheck-tar: \ + configure-tar + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-texinfo installcheck-texinfo +maybe-installcheck-texinfo: + +installcheck-texinfo: \ + configure-texinfo + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-textutils installcheck-textutils +maybe-installcheck-textutils: + +installcheck-textutils: \ + configure-textutils + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-time installcheck-time +maybe-installcheck-time: + +installcheck-time: \ + configure-time + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-uudecode installcheck-uudecode +maybe-installcheck-uudecode: + +installcheck-uudecode: \ + configure-uudecode + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-wdiff installcheck-wdiff +maybe-installcheck-wdiff: + +installcheck-wdiff: \ + configure-wdiff + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-zip installcheck-zip +maybe-installcheck-zip: + +installcheck-zip: \ + configure-zip + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-zlib installcheck-zlib +maybe-installcheck-zlib: + +installcheck-zlib: \ + configure-zlib + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-gdb installcheck-gdb +maybe-installcheck-gdb: + +installcheck-gdb: \ + configure-gdb + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-expect installcheck-expect +maybe-installcheck-expect: + +installcheck-expect: \ + configure-expect + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-guile installcheck-guile +maybe-installcheck-guile: + +installcheck-guile: \ + configure-guile + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-tk installcheck-tk +maybe-installcheck-tk: + +installcheck-tk: \ + configure-tk + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-tix installcheck-tix +maybe-installcheck-tix: + +installcheck-tix: \ + configure-tix + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-libtermcap installcheck-libtermcap +maybe-installcheck-libtermcap: + +installcheck-libtermcap: \ + configure-libtermcap + @[ -f ./libtermcap/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in libtermcap" ; \ + (cd libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-utils installcheck-utils +maybe-installcheck-utils: + +installcheck-utils: \ + configure-utils + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing installcheck in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-installcheck-target-libstdc++-v3 installcheck-target-libstdc++-v3 +maybe-installcheck-target-libstdc++-v3: + +installcheck-target-libstdc++-v3: \ + configure-target-libstdc++-v3 + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-newlib installcheck-target-newlib +maybe-installcheck-target-newlib: + +installcheck-target-newlib: \ + configure-target-newlib + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-libf2c installcheck-target-libf2c +maybe-installcheck-target-libf2c: + +installcheck-target-libf2c: \ + configure-target-libf2c + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-libobjc installcheck-target-libobjc +maybe-installcheck-target-libobjc: + +installcheck-target-libobjc: \ + configure-target-libobjc + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-libtermcap installcheck-target-libtermcap +maybe-installcheck-target-libtermcap: + +installcheck-target-libtermcap: \ + configure-target-libtermcap + @[ -f $(TARGET_SUBDIR)/libtermcap/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libtermcap" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-winsup installcheck-target-winsup +maybe-installcheck-target-winsup: + +installcheck-target-winsup: \ + configure-target-winsup + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-libgloss installcheck-target-libgloss +maybe-installcheck-target-libgloss: + +installcheck-target-libgloss: \ + configure-target-libgloss + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-libiberty installcheck-target-libiberty +maybe-installcheck-target-libiberty: + +installcheck-target-libiberty: \ + configure-target-libiberty + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-gperf installcheck-target-gperf +maybe-installcheck-target-gperf: + +installcheck-target-gperf: \ + configure-target-gperf + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-examples installcheck-target-examples +maybe-installcheck-target-examples: + +installcheck-target-examples: \ + configure-target-examples + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-libffi installcheck-target-libffi +maybe-installcheck-target-libffi: + +installcheck-target-libffi: \ + configure-target-libffi + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-libjava installcheck-target-libjava +maybe-installcheck-target-libjava: + +installcheck-target-libjava: \ + configure-target-libjava + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-zlib installcheck-target-zlib +maybe-installcheck-target-zlib: + +installcheck-target-zlib: \ + configure-target-zlib + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-boehm-gc installcheck-target-boehm-gc +maybe-installcheck-target-boehm-gc: + +installcheck-target-boehm-gc: \ + configure-target-boehm-gc + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-qthreads installcheck-target-qthreads +maybe-installcheck-target-qthreads: + +installcheck-target-qthreads: \ + configure-target-qthreads + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-rda installcheck-target-rda +maybe-installcheck-target-rda: + +installcheck-target-rda: \ + configure-target-rda + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + +.PHONY: maybe-installcheck-target-libada installcheck-target-libada +maybe-installcheck-target-libada: + +installcheck-target-libada: \ + configure-target-libada + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing installcheck in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + installcheck) \ + || exit 1 + + + +.PHONY: do-mostlyclean +do-mostlyclean: mostlyclean-host mostlyclean-target + +.PHONY: mostlyclean-host +mostlyclean-host: maybe-mostlyclean-gcc \ + maybe-mostlyclean-ash \ + maybe-mostlyclean-autoconf \ + maybe-mostlyclean-automake \ + maybe-mostlyclean-bash \ + maybe-mostlyclean-bfd \ + maybe-mostlyclean-opcodes \ + maybe-mostlyclean-binutils \ + maybe-mostlyclean-bison \ + maybe-mostlyclean-byacc \ + maybe-mostlyclean-bzip2 \ + maybe-mostlyclean-dejagnu \ + maybe-mostlyclean-diff \ + maybe-mostlyclean-dosutils \ + maybe-mostlyclean-etc \ + maybe-mostlyclean-fastjar \ + maybe-mostlyclean-fileutils \ + maybe-mostlyclean-findutils \ + maybe-mostlyclean-find \ + maybe-mostlyclean-flex \ + maybe-mostlyclean-gas \ + maybe-mostlyclean-gawk \ + maybe-mostlyclean-gettext \ + maybe-mostlyclean-gnuserv \ + maybe-mostlyclean-gprof \ + maybe-mostlyclean-gzip \ + maybe-mostlyclean-hello \ + maybe-mostlyclean-indent \ + maybe-mostlyclean-intl \ + maybe-mostlyclean-tcl \ + maybe-mostlyclean-itcl \ + maybe-mostlyclean-ld \ + maybe-mostlyclean-libgui \ + maybe-mostlyclean-libiberty \ + maybe-mostlyclean-libtool \ + maybe-mostlyclean-m4 \ + maybe-mostlyclean-make \ + maybe-mostlyclean-mmalloc \ + maybe-mostlyclean-patch \ + maybe-mostlyclean-perl \ + maybe-mostlyclean-prms \ + maybe-mostlyclean-rcs \ + maybe-mostlyclean-readline \ + maybe-mostlyclean-release \ + maybe-mostlyclean-recode \ + maybe-mostlyclean-sed \ + maybe-mostlyclean-send-pr \ + maybe-mostlyclean-shellutils \ + maybe-mostlyclean-sid \ + maybe-mostlyclean-sim \ + maybe-mostlyclean-tar \ + maybe-mostlyclean-texinfo \ + maybe-mostlyclean-textutils \ + maybe-mostlyclean-time \ + maybe-mostlyclean-uudecode \ + maybe-mostlyclean-wdiff \ + maybe-mostlyclean-zip \ + maybe-mostlyclean-zlib \ + maybe-mostlyclean-gdb \ + maybe-mostlyclean-expect \ + maybe-mostlyclean-guile \ + maybe-mostlyclean-tk \ + maybe-mostlyclean-tix \ + maybe-mostlyclean-libtermcap \ + maybe-mostlyclean-utils + +.PHONY: mostlyclean-target +mostlyclean-target: \ + maybe-mostlyclean-target-libstdc++-v3 \ + maybe-mostlyclean-target-newlib \ + maybe-mostlyclean-target-libf2c \ + maybe-mostlyclean-target-libobjc \ + maybe-mostlyclean-target-libtermcap \ + maybe-mostlyclean-target-winsup \ + maybe-mostlyclean-target-libgloss \ + maybe-mostlyclean-target-libiberty \ + maybe-mostlyclean-target-gperf \ + maybe-mostlyclean-target-examples \ + maybe-mostlyclean-target-libffi \ + maybe-mostlyclean-target-libjava \ + maybe-mostlyclean-target-zlib \ + maybe-mostlyclean-target-boehm-gc \ + maybe-mostlyclean-target-qthreads \ + maybe-mostlyclean-target-rda \ + maybe-mostlyclean-target-libada + +# GCC, the eternal special case +.PHONY: maybe-mostlyclean-gcc mostlyclean-gcc +maybe-mostlyclean-gcc: +mostlyclean-gcc: + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-mostlyclean-ash mostlyclean-ash +maybe-mostlyclean-ash: + +mostlyclean-ash: + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-autoconf mostlyclean-autoconf +maybe-mostlyclean-autoconf: + +mostlyclean-autoconf: + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-automake mostlyclean-automake +maybe-mostlyclean-automake: + +mostlyclean-automake: + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-bash mostlyclean-bash +maybe-mostlyclean-bash: + +mostlyclean-bash: + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-bfd mostlyclean-bfd +maybe-mostlyclean-bfd: + +mostlyclean-bfd: + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-opcodes mostlyclean-opcodes +maybe-mostlyclean-opcodes: + +mostlyclean-opcodes: + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-binutils mostlyclean-binutils +maybe-mostlyclean-binutils: + +mostlyclean-binutils: + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-bison mostlyclean-bison +maybe-mostlyclean-bison: + +mostlyclean-bison: + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-byacc mostlyclean-byacc +maybe-mostlyclean-byacc: + +mostlyclean-byacc: + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-bzip2 mostlyclean-bzip2 +maybe-mostlyclean-bzip2: + +mostlyclean-bzip2: + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-dejagnu mostlyclean-dejagnu +maybe-mostlyclean-dejagnu: + +mostlyclean-dejagnu: + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-diff mostlyclean-diff +maybe-mostlyclean-diff: + +mostlyclean-diff: + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-dosutils mostlyclean-dosutils +maybe-mostlyclean-dosutils: + +mostlyclean-dosutils: + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-etc mostlyclean-etc +maybe-mostlyclean-etc: + +mostlyclean-etc: + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-fastjar mostlyclean-fastjar +maybe-mostlyclean-fastjar: + +mostlyclean-fastjar: + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-fileutils mostlyclean-fileutils +maybe-mostlyclean-fileutils: + +mostlyclean-fileutils: + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-findutils mostlyclean-findutils +maybe-mostlyclean-findutils: + +mostlyclean-findutils: + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-find mostlyclean-find +maybe-mostlyclean-find: + +mostlyclean-find: + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-flex mostlyclean-flex +maybe-mostlyclean-flex: + +mostlyclean-flex: + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-gas mostlyclean-gas +maybe-mostlyclean-gas: + +mostlyclean-gas: + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-gawk mostlyclean-gawk +maybe-mostlyclean-gawk: + +mostlyclean-gawk: + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-gettext mostlyclean-gettext +maybe-mostlyclean-gettext: + +mostlyclean-gettext: + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-gnuserv mostlyclean-gnuserv +maybe-mostlyclean-gnuserv: + +mostlyclean-gnuserv: + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-gprof mostlyclean-gprof +maybe-mostlyclean-gprof: + +mostlyclean-gprof: + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-gzip mostlyclean-gzip +maybe-mostlyclean-gzip: + +mostlyclean-gzip: + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-hello mostlyclean-hello +maybe-mostlyclean-hello: + +mostlyclean-hello: + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-indent mostlyclean-indent +maybe-mostlyclean-indent: + +mostlyclean-indent: + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-intl mostlyclean-intl +maybe-mostlyclean-intl: + +mostlyclean-intl: + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-tcl mostlyclean-tcl +maybe-mostlyclean-tcl: + +# tcl doesn't support mostlyclean. +mostlyclean-tcl: + + +.PHONY: maybe-mostlyclean-itcl mostlyclean-itcl +maybe-mostlyclean-itcl: + +mostlyclean-itcl: + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-ld mostlyclean-ld +maybe-mostlyclean-ld: + +mostlyclean-ld: + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-libgui mostlyclean-libgui +maybe-mostlyclean-libgui: + +mostlyclean-libgui: + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-libiberty mostlyclean-libiberty +maybe-mostlyclean-libiberty: + +mostlyclean-libiberty: + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-libtool mostlyclean-libtool +maybe-mostlyclean-libtool: + +mostlyclean-libtool: + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-m4 mostlyclean-m4 +maybe-mostlyclean-m4: + +mostlyclean-m4: + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-make mostlyclean-make +maybe-mostlyclean-make: + +mostlyclean-make: + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-mmalloc mostlyclean-mmalloc +maybe-mostlyclean-mmalloc: + +mostlyclean-mmalloc: + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-patch mostlyclean-patch +maybe-mostlyclean-patch: + +mostlyclean-patch: + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-perl mostlyclean-perl +maybe-mostlyclean-perl: + +mostlyclean-perl: + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-prms mostlyclean-prms +maybe-mostlyclean-prms: + +mostlyclean-prms: + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-rcs mostlyclean-rcs +maybe-mostlyclean-rcs: + +mostlyclean-rcs: + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-readline mostlyclean-readline +maybe-mostlyclean-readline: + +mostlyclean-readline: + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-release mostlyclean-release +maybe-mostlyclean-release: + +mostlyclean-release: + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-recode mostlyclean-recode +maybe-mostlyclean-recode: + +mostlyclean-recode: + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-sed mostlyclean-sed +maybe-mostlyclean-sed: + +mostlyclean-sed: + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-send-pr mostlyclean-send-pr +maybe-mostlyclean-send-pr: + +mostlyclean-send-pr: + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-shellutils mostlyclean-shellutils +maybe-mostlyclean-shellutils: + +mostlyclean-shellutils: + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-sid mostlyclean-sid +maybe-mostlyclean-sid: + +mostlyclean-sid: + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-sim mostlyclean-sim +maybe-mostlyclean-sim: + +mostlyclean-sim: + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-tar mostlyclean-tar +maybe-mostlyclean-tar: + +mostlyclean-tar: + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-texinfo mostlyclean-texinfo +maybe-mostlyclean-texinfo: + +mostlyclean-texinfo: + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-textutils mostlyclean-textutils +maybe-mostlyclean-textutils: + +mostlyclean-textutils: + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-time mostlyclean-time +maybe-mostlyclean-time: + +mostlyclean-time: + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-uudecode mostlyclean-uudecode +maybe-mostlyclean-uudecode: + +mostlyclean-uudecode: + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-wdiff mostlyclean-wdiff +maybe-mostlyclean-wdiff: + +mostlyclean-wdiff: + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-zip mostlyclean-zip +maybe-mostlyclean-zip: + +mostlyclean-zip: + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-zlib mostlyclean-zlib +maybe-mostlyclean-zlib: + +mostlyclean-zlib: + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-gdb mostlyclean-gdb +maybe-mostlyclean-gdb: + +mostlyclean-gdb: + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-expect mostlyclean-expect +maybe-mostlyclean-expect: + +mostlyclean-expect: + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-guile mostlyclean-guile +maybe-mostlyclean-guile: + +mostlyclean-guile: + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-tk mostlyclean-tk +maybe-mostlyclean-tk: + +mostlyclean-tk: + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-tix mostlyclean-tix +maybe-mostlyclean-tix: + +mostlyclean-tix: + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-libtermcap mostlyclean-libtermcap +maybe-mostlyclean-libtermcap: + +# libtermcap doesn't support mostlyclean. +mostlyclean-libtermcap: + + +.PHONY: maybe-mostlyclean-utils mostlyclean-utils +maybe-mostlyclean-utils: + +mostlyclean-utils: + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing mostlyclean in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-mostlyclean-target-libstdc++-v3 mostlyclean-target-libstdc++-v3 +maybe-mostlyclean-target-libstdc++-v3: + +mostlyclean-target-libstdc++-v3: + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-newlib mostlyclean-target-newlib +maybe-mostlyclean-target-newlib: + +mostlyclean-target-newlib: + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-libf2c mostlyclean-target-libf2c +maybe-mostlyclean-target-libf2c: + +mostlyclean-target-libf2c: + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-libobjc mostlyclean-target-libobjc +maybe-mostlyclean-target-libobjc: + +mostlyclean-target-libobjc: + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-libtermcap mostlyclean-target-libtermcap +maybe-mostlyclean-target-libtermcap: + +# libtermcap doesn't support mostlyclean. +mostlyclean-target-libtermcap: + + +.PHONY: maybe-mostlyclean-target-winsup mostlyclean-target-winsup +maybe-mostlyclean-target-winsup: + +mostlyclean-target-winsup: + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-libgloss mostlyclean-target-libgloss +maybe-mostlyclean-target-libgloss: + +mostlyclean-target-libgloss: + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-libiberty mostlyclean-target-libiberty +maybe-mostlyclean-target-libiberty: + +mostlyclean-target-libiberty: + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-gperf mostlyclean-target-gperf +maybe-mostlyclean-target-gperf: + +mostlyclean-target-gperf: + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-examples mostlyclean-target-examples +maybe-mostlyclean-target-examples: + +mostlyclean-target-examples: + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-libffi mostlyclean-target-libffi +maybe-mostlyclean-target-libffi: + +mostlyclean-target-libffi: + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-libjava mostlyclean-target-libjava +maybe-mostlyclean-target-libjava: + +mostlyclean-target-libjava: + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-zlib mostlyclean-target-zlib +maybe-mostlyclean-target-zlib: + +mostlyclean-target-zlib: + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-boehm-gc mostlyclean-target-boehm-gc +maybe-mostlyclean-target-boehm-gc: + +mostlyclean-target-boehm-gc: + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-qthreads mostlyclean-target-qthreads +maybe-mostlyclean-target-qthreads: + +mostlyclean-target-qthreads: + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-rda mostlyclean-target-rda +maybe-mostlyclean-target-rda: + +mostlyclean-target-rda: + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + +.PHONY: maybe-mostlyclean-target-libada mostlyclean-target-libada +maybe-mostlyclean-target-libada: + +mostlyclean-target-libada: + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing mostlyclean in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + mostlyclean) \ + || exit 1 + + + +.PHONY: do-clean +do-clean: clean-host clean-target + +.PHONY: clean-host +clean-host: maybe-clean-gcc \ + maybe-clean-ash \ + maybe-clean-autoconf \ + maybe-clean-automake \ + maybe-clean-bash \ + maybe-clean-bfd \ + maybe-clean-opcodes \ + maybe-clean-binutils \ + maybe-clean-bison \ + maybe-clean-byacc \ + maybe-clean-bzip2 \ + maybe-clean-dejagnu \ + maybe-clean-diff \ + maybe-clean-dosutils \ + maybe-clean-etc \ + maybe-clean-fastjar \ + maybe-clean-fileutils \ + maybe-clean-findutils \ + maybe-clean-find \ + maybe-clean-flex \ + maybe-clean-gas \ + maybe-clean-gawk \ + maybe-clean-gettext \ + maybe-clean-gnuserv \ + maybe-clean-gprof \ + maybe-clean-gzip \ + maybe-clean-hello \ + maybe-clean-indent \ + maybe-clean-intl \ + maybe-clean-tcl \ + maybe-clean-itcl \ + maybe-clean-ld \ + maybe-clean-libgui \ + maybe-clean-libiberty \ + maybe-clean-libtool \ + maybe-clean-m4 \ + maybe-clean-make \ + maybe-clean-mmalloc \ + maybe-clean-patch \ + maybe-clean-perl \ + maybe-clean-prms \ + maybe-clean-rcs \ + maybe-clean-readline \ + maybe-clean-release \ + maybe-clean-recode \ + maybe-clean-sed \ + maybe-clean-send-pr \ + maybe-clean-shellutils \ + maybe-clean-sid \ + maybe-clean-sim \ + maybe-clean-tar \ + maybe-clean-texinfo \ + maybe-clean-textutils \ + maybe-clean-time \ + maybe-clean-uudecode \ + maybe-clean-wdiff \ + maybe-clean-zip \ + maybe-clean-zlib \ + maybe-clean-gdb \ + maybe-clean-expect \ + maybe-clean-guile \ + maybe-clean-tk \ + maybe-clean-tix \ + maybe-clean-libtermcap \ + maybe-clean-utils + +.PHONY: clean-target +clean-target: \ + maybe-clean-target-libstdc++-v3 \ + maybe-clean-target-newlib \ + maybe-clean-target-libf2c \ + maybe-clean-target-libobjc \ + maybe-clean-target-libtermcap \ + maybe-clean-target-winsup \ + maybe-clean-target-libgloss \ + maybe-clean-target-libiberty \ + maybe-clean-target-gperf \ + maybe-clean-target-examples \ + maybe-clean-target-libffi \ + maybe-clean-target-libjava \ + maybe-clean-target-zlib \ + maybe-clean-target-boehm-gc \ + maybe-clean-target-qthreads \ + maybe-clean-target-rda \ + maybe-clean-target-libada + +# GCC, the eternal special case +.PHONY: maybe-clean-gcc clean-gcc +maybe-clean-gcc: +clean-gcc: + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-clean-ash clean-ash +maybe-clean-ash: + +clean-ash: + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-autoconf clean-autoconf +maybe-clean-autoconf: + +clean-autoconf: + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-automake clean-automake +maybe-clean-automake: + +clean-automake: + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-bash clean-bash +maybe-clean-bash: + +clean-bash: + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-bfd clean-bfd +maybe-clean-bfd: + +clean-bfd: + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-opcodes clean-opcodes +maybe-clean-opcodes: + +clean-opcodes: + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-binutils clean-binutils +maybe-clean-binutils: + +clean-binutils: + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-bison clean-bison +maybe-clean-bison: + +clean-bison: + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-byacc clean-byacc +maybe-clean-byacc: + +clean-byacc: + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-bzip2 clean-bzip2 +maybe-clean-bzip2: + +clean-bzip2: + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-dejagnu clean-dejagnu +maybe-clean-dejagnu: + +clean-dejagnu: + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-diff clean-diff +maybe-clean-diff: + +clean-diff: + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-dosutils clean-dosutils +maybe-clean-dosutils: + +clean-dosutils: + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-etc clean-etc +maybe-clean-etc: + +clean-etc: + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-fastjar clean-fastjar +maybe-clean-fastjar: + +clean-fastjar: + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-fileutils clean-fileutils +maybe-clean-fileutils: + +clean-fileutils: + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-findutils clean-findutils +maybe-clean-findutils: + +clean-findutils: + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-find clean-find +maybe-clean-find: + +clean-find: + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-flex clean-flex +maybe-clean-flex: + +clean-flex: + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-gas clean-gas +maybe-clean-gas: + +clean-gas: + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-gawk clean-gawk +maybe-clean-gawk: + +clean-gawk: + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-gettext clean-gettext +maybe-clean-gettext: + +clean-gettext: + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-gnuserv clean-gnuserv +maybe-clean-gnuserv: + +clean-gnuserv: + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-gprof clean-gprof +maybe-clean-gprof: + +clean-gprof: + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-gzip clean-gzip +maybe-clean-gzip: + +clean-gzip: + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-hello clean-hello +maybe-clean-hello: + +clean-hello: + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-indent clean-indent +maybe-clean-indent: + +clean-indent: + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-intl clean-intl +maybe-clean-intl: + +clean-intl: + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-tcl clean-tcl +maybe-clean-tcl: + +clean-tcl: + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-itcl clean-itcl +maybe-clean-itcl: + +clean-itcl: + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-ld clean-ld +maybe-clean-ld: + +clean-ld: + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-libgui clean-libgui +maybe-clean-libgui: + +clean-libgui: + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-libiberty clean-libiberty +maybe-clean-libiberty: + +clean-libiberty: + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-libtool clean-libtool +maybe-clean-libtool: + +clean-libtool: + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-m4 clean-m4 +maybe-clean-m4: + +clean-m4: + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-make clean-make +maybe-clean-make: + +clean-make: + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-mmalloc clean-mmalloc +maybe-clean-mmalloc: + +clean-mmalloc: + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-patch clean-patch +maybe-clean-patch: + +clean-patch: + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-perl clean-perl +maybe-clean-perl: + +clean-perl: + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-prms clean-prms +maybe-clean-prms: + +clean-prms: + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-rcs clean-rcs +maybe-clean-rcs: + +clean-rcs: + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-readline clean-readline +maybe-clean-readline: + +clean-readline: + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-release clean-release +maybe-clean-release: + +clean-release: + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-recode clean-recode +maybe-clean-recode: + +clean-recode: + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-sed clean-sed +maybe-clean-sed: + +clean-sed: + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-send-pr clean-send-pr +maybe-clean-send-pr: + +clean-send-pr: + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-shellutils clean-shellutils +maybe-clean-shellutils: + +clean-shellutils: + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-sid clean-sid +maybe-clean-sid: + +clean-sid: + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-sim clean-sim +maybe-clean-sim: + +clean-sim: + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-tar clean-tar +maybe-clean-tar: + +clean-tar: + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-texinfo clean-texinfo +maybe-clean-texinfo: + +clean-texinfo: + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-textutils clean-textutils +maybe-clean-textutils: + +clean-textutils: + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-time clean-time +maybe-clean-time: + +clean-time: + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-uudecode clean-uudecode +maybe-clean-uudecode: + +clean-uudecode: + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-wdiff clean-wdiff +maybe-clean-wdiff: + +clean-wdiff: + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-zip clean-zip +maybe-clean-zip: + +clean-zip: + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-zlib clean-zlib +maybe-clean-zlib: + +clean-zlib: + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-gdb clean-gdb +maybe-clean-gdb: + +clean-gdb: + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-expect clean-expect +maybe-clean-expect: + +clean-expect: + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-guile clean-guile +maybe-clean-guile: + +clean-guile: + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-tk clean-tk +maybe-clean-tk: + +clean-tk: + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-tix clean-tix +maybe-clean-tix: + +clean-tix: + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-libtermcap clean-libtermcap +maybe-clean-libtermcap: + +# libtermcap doesn't support clean. +clean-libtermcap: + + +.PHONY: maybe-clean-utils clean-utils +maybe-clean-utils: + +clean-utils: + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing clean in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-clean-target-libstdc++-v3 clean-target-libstdc++-v3 +maybe-clean-target-libstdc++-v3: + +clean-target-libstdc++-v3: + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-newlib clean-target-newlib +maybe-clean-target-newlib: + +clean-target-newlib: + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-libf2c clean-target-libf2c +maybe-clean-target-libf2c: + +clean-target-libf2c: + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-libobjc clean-target-libobjc +maybe-clean-target-libobjc: + +clean-target-libobjc: + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-libtermcap clean-target-libtermcap +maybe-clean-target-libtermcap: + +# libtermcap doesn't support clean. +clean-target-libtermcap: + + +.PHONY: maybe-clean-target-winsup clean-target-winsup +maybe-clean-target-winsup: + +clean-target-winsup: + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-libgloss clean-target-libgloss +maybe-clean-target-libgloss: + +clean-target-libgloss: + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-libiberty clean-target-libiberty +maybe-clean-target-libiberty: + +clean-target-libiberty: + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-gperf clean-target-gperf +maybe-clean-target-gperf: + +clean-target-gperf: + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-examples clean-target-examples +maybe-clean-target-examples: + +clean-target-examples: + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-libffi clean-target-libffi +maybe-clean-target-libffi: + +clean-target-libffi: + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-libjava clean-target-libjava +maybe-clean-target-libjava: + +clean-target-libjava: + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-zlib clean-target-zlib +maybe-clean-target-zlib: + +clean-target-zlib: + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-boehm-gc clean-target-boehm-gc +maybe-clean-target-boehm-gc: + +clean-target-boehm-gc: + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-qthreads clean-target-qthreads +maybe-clean-target-qthreads: + +clean-target-qthreads: + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-rda clean-target-rda +maybe-clean-target-rda: + +clean-target-rda: + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + +.PHONY: maybe-clean-target-libada clean-target-libada +maybe-clean-target-libada: + +clean-target-libada: + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing clean in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + clean) \ + || exit 1 + + + +.PHONY: do-distclean +do-distclean: distclean-host distclean-target + +.PHONY: distclean-host +distclean-host: maybe-distclean-gcc \ + maybe-distclean-ash \ + maybe-distclean-autoconf \ + maybe-distclean-automake \ + maybe-distclean-bash \ + maybe-distclean-bfd \ + maybe-distclean-opcodes \ + maybe-distclean-binutils \ + maybe-distclean-bison \ + maybe-distclean-byacc \ + maybe-distclean-bzip2 \ + maybe-distclean-dejagnu \ + maybe-distclean-diff \ + maybe-distclean-dosutils \ + maybe-distclean-etc \ + maybe-distclean-fastjar \ + maybe-distclean-fileutils \ + maybe-distclean-findutils \ + maybe-distclean-find \ + maybe-distclean-flex \ + maybe-distclean-gas \ + maybe-distclean-gawk \ + maybe-distclean-gettext \ + maybe-distclean-gnuserv \ + maybe-distclean-gprof \ + maybe-distclean-gzip \ + maybe-distclean-hello \ + maybe-distclean-indent \ + maybe-distclean-intl \ + maybe-distclean-tcl \ + maybe-distclean-itcl \ + maybe-distclean-ld \ + maybe-distclean-libgui \ + maybe-distclean-libiberty \ + maybe-distclean-libtool \ + maybe-distclean-m4 \ + maybe-distclean-make \ + maybe-distclean-mmalloc \ + maybe-distclean-patch \ + maybe-distclean-perl \ + maybe-distclean-prms \ + maybe-distclean-rcs \ + maybe-distclean-readline \ + maybe-distclean-release \ + maybe-distclean-recode \ + maybe-distclean-sed \ + maybe-distclean-send-pr \ + maybe-distclean-shellutils \ + maybe-distclean-sid \ + maybe-distclean-sim \ + maybe-distclean-tar \ + maybe-distclean-texinfo \ + maybe-distclean-textutils \ + maybe-distclean-time \ + maybe-distclean-uudecode \ + maybe-distclean-wdiff \ + maybe-distclean-zip \ + maybe-distclean-zlib \ + maybe-distclean-gdb \ + maybe-distclean-expect \ + maybe-distclean-guile \ + maybe-distclean-tk \ + maybe-distclean-tix \ + maybe-distclean-libtermcap \ + maybe-distclean-utils + +.PHONY: distclean-target +distclean-target: \ + maybe-distclean-target-libstdc++-v3 \ + maybe-distclean-target-newlib \ + maybe-distclean-target-libf2c \ + maybe-distclean-target-libobjc \ + maybe-distclean-target-libtermcap \ + maybe-distclean-target-winsup \ + maybe-distclean-target-libgloss \ + maybe-distclean-target-libiberty \ + maybe-distclean-target-gperf \ + maybe-distclean-target-examples \ + maybe-distclean-target-libffi \ + maybe-distclean-target-libjava \ + maybe-distclean-target-zlib \ + maybe-distclean-target-boehm-gc \ + maybe-distclean-target-qthreads \ + maybe-distclean-target-rda \ + maybe-distclean-target-libada + +# GCC, the eternal special case +.PHONY: maybe-distclean-gcc distclean-gcc +maybe-distclean-gcc: +distclean-gcc: + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-distclean-ash distclean-ash +maybe-distclean-ash: + +distclean-ash: + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-autoconf distclean-autoconf +maybe-distclean-autoconf: + +distclean-autoconf: + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-automake distclean-automake +maybe-distclean-automake: + +distclean-automake: + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-bash distclean-bash +maybe-distclean-bash: + +distclean-bash: + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-bfd distclean-bfd +maybe-distclean-bfd: + +distclean-bfd: + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-opcodes distclean-opcodes +maybe-distclean-opcodes: + +distclean-opcodes: + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-binutils distclean-binutils +maybe-distclean-binutils: + +distclean-binutils: + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-bison distclean-bison +maybe-distclean-bison: + +distclean-bison: + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-byacc distclean-byacc +maybe-distclean-byacc: + +distclean-byacc: + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-bzip2 distclean-bzip2 +maybe-distclean-bzip2: + +distclean-bzip2: + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-dejagnu distclean-dejagnu +maybe-distclean-dejagnu: + +distclean-dejagnu: + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-diff distclean-diff +maybe-distclean-diff: + +distclean-diff: + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-dosutils distclean-dosutils +maybe-distclean-dosutils: + +distclean-dosutils: + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-etc distclean-etc +maybe-distclean-etc: + +distclean-etc: + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-fastjar distclean-fastjar +maybe-distclean-fastjar: + +distclean-fastjar: + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-fileutils distclean-fileutils +maybe-distclean-fileutils: + +distclean-fileutils: + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-findutils distclean-findutils +maybe-distclean-findutils: + +distclean-findutils: + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-find distclean-find +maybe-distclean-find: + +distclean-find: + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-flex distclean-flex +maybe-distclean-flex: + +distclean-flex: + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-gas distclean-gas +maybe-distclean-gas: + +distclean-gas: + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-gawk distclean-gawk +maybe-distclean-gawk: + +distclean-gawk: + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-gettext distclean-gettext +maybe-distclean-gettext: + +distclean-gettext: + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-gnuserv distclean-gnuserv +maybe-distclean-gnuserv: + +distclean-gnuserv: + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-gprof distclean-gprof +maybe-distclean-gprof: + +distclean-gprof: + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-gzip distclean-gzip +maybe-distclean-gzip: + +distclean-gzip: + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-hello distclean-hello +maybe-distclean-hello: + +distclean-hello: + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-indent distclean-indent +maybe-distclean-indent: + +distclean-indent: + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-intl distclean-intl +maybe-distclean-intl: + +distclean-intl: + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-tcl distclean-tcl +maybe-distclean-tcl: + +distclean-tcl: + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-itcl distclean-itcl +maybe-distclean-itcl: + +distclean-itcl: + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-ld distclean-ld +maybe-distclean-ld: + +distclean-ld: + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-libgui distclean-libgui +maybe-distclean-libgui: + +distclean-libgui: + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-libiberty distclean-libiberty +maybe-distclean-libiberty: + +distclean-libiberty: + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-libtool distclean-libtool +maybe-distclean-libtool: + +distclean-libtool: + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-m4 distclean-m4 +maybe-distclean-m4: + +distclean-m4: + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-make distclean-make +maybe-distclean-make: + +distclean-make: + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-mmalloc distclean-mmalloc +maybe-distclean-mmalloc: + +distclean-mmalloc: + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-patch distclean-patch +maybe-distclean-patch: + +distclean-patch: + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-perl distclean-perl +maybe-distclean-perl: + +distclean-perl: + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-prms distclean-prms +maybe-distclean-prms: + +distclean-prms: + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-rcs distclean-rcs +maybe-distclean-rcs: + +distclean-rcs: + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-readline distclean-readline +maybe-distclean-readline: + +distclean-readline: + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-release distclean-release +maybe-distclean-release: + +distclean-release: + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-recode distclean-recode +maybe-distclean-recode: + +distclean-recode: + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-sed distclean-sed +maybe-distclean-sed: + +distclean-sed: + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-send-pr distclean-send-pr +maybe-distclean-send-pr: + +distclean-send-pr: + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-shellutils distclean-shellutils +maybe-distclean-shellutils: + +distclean-shellutils: + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-sid distclean-sid +maybe-distclean-sid: + +distclean-sid: + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-sim distclean-sim +maybe-distclean-sim: + +distclean-sim: + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-tar distclean-tar +maybe-distclean-tar: + +distclean-tar: + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-texinfo distclean-texinfo +maybe-distclean-texinfo: + +distclean-texinfo: + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-textutils distclean-textutils +maybe-distclean-textutils: + +distclean-textutils: + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-time distclean-time +maybe-distclean-time: + +distclean-time: + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-uudecode distclean-uudecode +maybe-distclean-uudecode: + +distclean-uudecode: + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-wdiff distclean-wdiff +maybe-distclean-wdiff: + +distclean-wdiff: + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-zip distclean-zip +maybe-distclean-zip: + +distclean-zip: + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-zlib distclean-zlib +maybe-distclean-zlib: + +distclean-zlib: + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-gdb distclean-gdb +maybe-distclean-gdb: + +distclean-gdb: + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-expect distclean-expect +maybe-distclean-expect: + +distclean-expect: + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-guile distclean-guile +maybe-distclean-guile: + +distclean-guile: + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-tk distclean-tk +maybe-distclean-tk: + +distclean-tk: + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-tix distclean-tix +maybe-distclean-tix: + +distclean-tix: + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-libtermcap distclean-libtermcap +maybe-distclean-libtermcap: + +# libtermcap doesn't support distclean. +distclean-libtermcap: + + +.PHONY: maybe-distclean-utils distclean-utils +maybe-distclean-utils: + +distclean-utils: + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing distclean in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-distclean-target-libstdc++-v3 distclean-target-libstdc++-v3 +maybe-distclean-target-libstdc++-v3: + +distclean-target-libstdc++-v3: + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-newlib distclean-target-newlib +maybe-distclean-target-newlib: + +distclean-target-newlib: + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-libf2c distclean-target-libf2c +maybe-distclean-target-libf2c: + +distclean-target-libf2c: + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-libobjc distclean-target-libobjc +maybe-distclean-target-libobjc: + +distclean-target-libobjc: + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-libtermcap distclean-target-libtermcap +maybe-distclean-target-libtermcap: + +# libtermcap doesn't support distclean. +distclean-target-libtermcap: + + +.PHONY: maybe-distclean-target-winsup distclean-target-winsup +maybe-distclean-target-winsup: + +distclean-target-winsup: + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-libgloss distclean-target-libgloss +maybe-distclean-target-libgloss: + +distclean-target-libgloss: + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-libiberty distclean-target-libiberty +maybe-distclean-target-libiberty: + +distclean-target-libiberty: + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-gperf distclean-target-gperf +maybe-distclean-target-gperf: + +distclean-target-gperf: + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-examples distclean-target-examples +maybe-distclean-target-examples: + +distclean-target-examples: + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-libffi distclean-target-libffi +maybe-distclean-target-libffi: + +distclean-target-libffi: + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-libjava distclean-target-libjava +maybe-distclean-target-libjava: + +distclean-target-libjava: + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-zlib distclean-target-zlib +maybe-distclean-target-zlib: + +distclean-target-zlib: + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-boehm-gc distclean-target-boehm-gc +maybe-distclean-target-boehm-gc: + +distclean-target-boehm-gc: + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-qthreads distclean-target-qthreads +maybe-distclean-target-qthreads: + +distclean-target-qthreads: + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-rda distclean-target-rda +maybe-distclean-target-rda: + +distclean-target-rda: + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + +.PHONY: maybe-distclean-target-libada distclean-target-libada +maybe-distclean-target-libada: + +distclean-target-libada: + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing distclean in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + distclean) \ + || exit 1 + + + +.PHONY: do-maintainer-clean +do-maintainer-clean: maintainer-clean-host maintainer-clean-target + +.PHONY: maintainer-clean-host +maintainer-clean-host: maybe-maintainer-clean-gcc \ + maybe-maintainer-clean-ash \ + maybe-maintainer-clean-autoconf \ + maybe-maintainer-clean-automake \ + maybe-maintainer-clean-bash \ + maybe-maintainer-clean-bfd \ + maybe-maintainer-clean-opcodes \ + maybe-maintainer-clean-binutils \ + maybe-maintainer-clean-bison \ + maybe-maintainer-clean-byacc \ + maybe-maintainer-clean-bzip2 \ + maybe-maintainer-clean-dejagnu \ + maybe-maintainer-clean-diff \ + maybe-maintainer-clean-dosutils \ + maybe-maintainer-clean-etc \ + maybe-maintainer-clean-fastjar \ + maybe-maintainer-clean-fileutils \ + maybe-maintainer-clean-findutils \ + maybe-maintainer-clean-find \ + maybe-maintainer-clean-flex \ + maybe-maintainer-clean-gas \ + maybe-maintainer-clean-gawk \ + maybe-maintainer-clean-gettext \ + maybe-maintainer-clean-gnuserv \ + maybe-maintainer-clean-gprof \ + maybe-maintainer-clean-gzip \ + maybe-maintainer-clean-hello \ + maybe-maintainer-clean-indent \ + maybe-maintainer-clean-intl \ + maybe-maintainer-clean-tcl \ + maybe-maintainer-clean-itcl \ + maybe-maintainer-clean-ld \ + maybe-maintainer-clean-libgui \ + maybe-maintainer-clean-libiberty \ + maybe-maintainer-clean-libtool \ + maybe-maintainer-clean-m4 \ + maybe-maintainer-clean-make \ + maybe-maintainer-clean-mmalloc \ + maybe-maintainer-clean-patch \ + maybe-maintainer-clean-perl \ + maybe-maintainer-clean-prms \ + maybe-maintainer-clean-rcs \ + maybe-maintainer-clean-readline \ + maybe-maintainer-clean-release \ + maybe-maintainer-clean-recode \ + maybe-maintainer-clean-sed \ + maybe-maintainer-clean-send-pr \ + maybe-maintainer-clean-shellutils \ + maybe-maintainer-clean-sid \ + maybe-maintainer-clean-sim \ + maybe-maintainer-clean-tar \ + maybe-maintainer-clean-texinfo \ + maybe-maintainer-clean-textutils \ + maybe-maintainer-clean-time \ + maybe-maintainer-clean-uudecode \ + maybe-maintainer-clean-wdiff \ + maybe-maintainer-clean-zip \ + maybe-maintainer-clean-zlib \ + maybe-maintainer-clean-gdb \ + maybe-maintainer-clean-expect \ + maybe-maintainer-clean-guile \ + maybe-maintainer-clean-tk \ + maybe-maintainer-clean-tix \ + maybe-maintainer-clean-libtermcap \ + maybe-maintainer-clean-utils + +.PHONY: maintainer-clean-target +maintainer-clean-target: \ + maybe-maintainer-clean-target-libstdc++-v3 \ + maybe-maintainer-clean-target-newlib \ + maybe-maintainer-clean-target-libf2c \ + maybe-maintainer-clean-target-libobjc \ + maybe-maintainer-clean-target-libtermcap \ + maybe-maintainer-clean-target-winsup \ + maybe-maintainer-clean-target-libgloss \ + maybe-maintainer-clean-target-libiberty \ + maybe-maintainer-clean-target-gperf \ + maybe-maintainer-clean-target-examples \ + maybe-maintainer-clean-target-libffi \ + maybe-maintainer-clean-target-libjava \ + maybe-maintainer-clean-target-zlib \ + maybe-maintainer-clean-target-boehm-gc \ + maybe-maintainer-clean-target-qthreads \ + maybe-maintainer-clean-target-rda \ + maybe-maintainer-clean-target-libada + +# GCC, the eternal special case +.PHONY: maybe-maintainer-clean-gcc maintainer-clean-gcc +maybe-maintainer-clean-gcc: +maintainer-clean-gcc: + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + +# Host modules. + +.PHONY: maybe-maintainer-clean-ash maintainer-clean-ash +maybe-maintainer-clean-ash: + +maintainer-clean-ash: + @[ -f ./ash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in ash" ; \ + (cd ash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-autoconf maintainer-clean-autoconf +maybe-maintainer-clean-autoconf: + +maintainer-clean-autoconf: + @[ -f ./autoconf/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in autoconf" ; \ + (cd autoconf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-automake maintainer-clean-automake +maybe-maintainer-clean-automake: + +maintainer-clean-automake: + @[ -f ./automake/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in automake" ; \ + (cd automake && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-bash maintainer-clean-bash +maybe-maintainer-clean-bash: + +maintainer-clean-bash: + @[ -f ./bash/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in bash" ; \ + (cd bash && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-bfd maintainer-clean-bfd +maybe-maintainer-clean-bfd: + +maintainer-clean-bfd: + @[ -f ./bfd/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in bfd" ; \ + (cd bfd && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-opcodes maintainer-clean-opcodes +maybe-maintainer-clean-opcodes: + +maintainer-clean-opcodes: + @[ -f ./opcodes/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in opcodes" ; \ + (cd opcodes && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-binutils maintainer-clean-binutils +maybe-maintainer-clean-binutils: + +maintainer-clean-binutils: + @[ -f ./binutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in binutils" ; \ + (cd binutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-bison maintainer-clean-bison +maybe-maintainer-clean-bison: + +maintainer-clean-bison: + @[ -f ./bison/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in bison" ; \ + (cd bison && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-byacc maintainer-clean-byacc +maybe-maintainer-clean-byacc: + +maintainer-clean-byacc: + @[ -f ./byacc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in byacc" ; \ + (cd byacc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-bzip2 maintainer-clean-bzip2 +maybe-maintainer-clean-bzip2: + +maintainer-clean-bzip2: + @[ -f ./bzip2/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in bzip2" ; \ + (cd bzip2 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-dejagnu maintainer-clean-dejagnu +maybe-maintainer-clean-dejagnu: + +maintainer-clean-dejagnu: + @[ -f ./dejagnu/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in dejagnu" ; \ + (cd dejagnu && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-diff maintainer-clean-diff +maybe-maintainer-clean-diff: + +maintainer-clean-diff: + @[ -f ./diff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in diff" ; \ + (cd diff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-dosutils maintainer-clean-dosutils +maybe-maintainer-clean-dosutils: + +maintainer-clean-dosutils: + @[ -f ./dosutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in dosutils" ; \ + (cd dosutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-etc maintainer-clean-etc +maybe-maintainer-clean-etc: + +maintainer-clean-etc: + @[ -f ./etc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in etc" ; \ + (cd etc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-fastjar maintainer-clean-fastjar +maybe-maintainer-clean-fastjar: + +maintainer-clean-fastjar: + @[ -f ./fastjar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in fastjar" ; \ + (cd fastjar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-fileutils maintainer-clean-fileutils +maybe-maintainer-clean-fileutils: + +maintainer-clean-fileutils: + @[ -f ./fileutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in fileutils" ; \ + (cd fileutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-findutils maintainer-clean-findutils +maybe-maintainer-clean-findutils: + +maintainer-clean-findutils: + @[ -f ./findutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in findutils" ; \ + (cd findutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-find maintainer-clean-find +maybe-maintainer-clean-find: + +maintainer-clean-find: + @[ -f ./find/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in find" ; \ + (cd find && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-flex maintainer-clean-flex +maybe-maintainer-clean-flex: + +maintainer-clean-flex: + @[ -f ./flex/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in flex" ; \ + (cd flex && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-gas maintainer-clean-gas +maybe-maintainer-clean-gas: + +maintainer-clean-gas: + @[ -f ./gas/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gas" ; \ + (cd gas && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-gawk maintainer-clean-gawk +maybe-maintainer-clean-gawk: + +maintainer-clean-gawk: + @[ -f ./gawk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gawk" ; \ + (cd gawk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-gettext maintainer-clean-gettext +maybe-maintainer-clean-gettext: + +maintainer-clean-gettext: + @[ -f ./gettext/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gettext" ; \ + (cd gettext && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-gnuserv maintainer-clean-gnuserv +maybe-maintainer-clean-gnuserv: + +maintainer-clean-gnuserv: + @[ -f ./gnuserv/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gnuserv" ; \ + (cd gnuserv && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-gprof maintainer-clean-gprof +maybe-maintainer-clean-gprof: + +maintainer-clean-gprof: + @[ -f ./gprof/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gprof" ; \ + (cd gprof && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-gzip maintainer-clean-gzip +maybe-maintainer-clean-gzip: + +maintainer-clean-gzip: + @[ -f ./gzip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gzip" ; \ + (cd gzip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-hello maintainer-clean-hello +maybe-maintainer-clean-hello: + +maintainer-clean-hello: + @[ -f ./hello/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in hello" ; \ + (cd hello && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-indent maintainer-clean-indent +maybe-maintainer-clean-indent: + +maintainer-clean-indent: + @[ -f ./indent/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in indent" ; \ + (cd indent && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-intl maintainer-clean-intl +maybe-maintainer-clean-intl: + +maintainer-clean-intl: + @[ -f ./intl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in intl" ; \ + (cd intl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-tcl maintainer-clean-tcl +maybe-maintainer-clean-tcl: + +maintainer-clean-tcl: + @[ -f ./tcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in tcl" ; \ + (cd tcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-itcl maintainer-clean-itcl +maybe-maintainer-clean-itcl: + +maintainer-clean-itcl: + @[ -f ./itcl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in itcl" ; \ + (cd itcl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-ld maintainer-clean-ld +maybe-maintainer-clean-ld: + +maintainer-clean-ld: + @[ -f ./ld/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in ld" ; \ + (cd ld && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-libgui maintainer-clean-libgui +maybe-maintainer-clean-libgui: + +maintainer-clean-libgui: + @[ -f ./libgui/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in libgui" ; \ + (cd libgui && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-libiberty maintainer-clean-libiberty +maybe-maintainer-clean-libiberty: + +maintainer-clean-libiberty: + @[ -f ./libiberty/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in libiberty" ; \ + (cd libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-libtool maintainer-clean-libtool +maybe-maintainer-clean-libtool: + +maintainer-clean-libtool: + @[ -f ./libtool/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in libtool" ; \ + (cd libtool && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-m4 maintainer-clean-m4 +maybe-maintainer-clean-m4: + +maintainer-clean-m4: + @[ -f ./m4/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in m4" ; \ + (cd m4 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-make maintainer-clean-make +maybe-maintainer-clean-make: + +maintainer-clean-make: + @[ -f ./make/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in make" ; \ + (cd make && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-mmalloc maintainer-clean-mmalloc +maybe-maintainer-clean-mmalloc: + +maintainer-clean-mmalloc: + @[ -f ./mmalloc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in mmalloc" ; \ + (cd mmalloc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-patch maintainer-clean-patch +maybe-maintainer-clean-patch: + +maintainer-clean-patch: + @[ -f ./patch/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in patch" ; \ + (cd patch && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-perl maintainer-clean-perl +maybe-maintainer-clean-perl: + +maintainer-clean-perl: + @[ -f ./perl/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in perl" ; \ + (cd perl && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-prms maintainer-clean-prms +maybe-maintainer-clean-prms: + +maintainer-clean-prms: + @[ -f ./prms/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in prms" ; \ + (cd prms && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-rcs maintainer-clean-rcs +maybe-maintainer-clean-rcs: + +maintainer-clean-rcs: + @[ -f ./rcs/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in rcs" ; \ + (cd rcs && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-readline maintainer-clean-readline +maybe-maintainer-clean-readline: + +maintainer-clean-readline: + @[ -f ./readline/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in readline" ; \ + (cd readline && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-release maintainer-clean-release +maybe-maintainer-clean-release: + +maintainer-clean-release: + @[ -f ./release/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in release" ; \ + (cd release && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-recode maintainer-clean-recode +maybe-maintainer-clean-recode: + +maintainer-clean-recode: + @[ -f ./recode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in recode" ; \ + (cd recode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-sed maintainer-clean-sed +maybe-maintainer-clean-sed: + +maintainer-clean-sed: + @[ -f ./sed/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in sed" ; \ + (cd sed && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-send-pr maintainer-clean-send-pr +maybe-maintainer-clean-send-pr: + +maintainer-clean-send-pr: + @[ -f ./send-pr/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in send-pr" ; \ + (cd send-pr && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-shellutils maintainer-clean-shellutils +maybe-maintainer-clean-shellutils: + +maintainer-clean-shellutils: + @[ -f ./shellutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in shellutils" ; \ + (cd shellutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-sid maintainer-clean-sid +maybe-maintainer-clean-sid: + +maintainer-clean-sid: + @[ -f ./sid/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in sid" ; \ + (cd sid && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-sim maintainer-clean-sim +maybe-maintainer-clean-sim: + +maintainer-clean-sim: + @[ -f ./sim/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in sim" ; \ + (cd sim && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-tar maintainer-clean-tar +maybe-maintainer-clean-tar: + +maintainer-clean-tar: + @[ -f ./tar/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in tar" ; \ + (cd tar && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-texinfo maintainer-clean-texinfo +maybe-maintainer-clean-texinfo: + +maintainer-clean-texinfo: + @[ -f ./texinfo/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in texinfo" ; \ + (cd texinfo && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-textutils maintainer-clean-textutils +maybe-maintainer-clean-textutils: + +maintainer-clean-textutils: + @[ -f ./textutils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in textutils" ; \ + (cd textutils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-time maintainer-clean-time +maybe-maintainer-clean-time: + +maintainer-clean-time: + @[ -f ./time/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in time" ; \ + (cd time && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-uudecode maintainer-clean-uudecode +maybe-maintainer-clean-uudecode: + +maintainer-clean-uudecode: + @[ -f ./uudecode/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in uudecode" ; \ + (cd uudecode && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-wdiff maintainer-clean-wdiff +maybe-maintainer-clean-wdiff: + +maintainer-clean-wdiff: + @[ -f ./wdiff/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in wdiff" ; \ + (cd wdiff && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-zip maintainer-clean-zip +maybe-maintainer-clean-zip: + +maintainer-clean-zip: + @[ -f ./zip/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in zip" ; \ + (cd zip && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-zlib maintainer-clean-zlib +maybe-maintainer-clean-zlib: + +maintainer-clean-zlib: + @[ -f ./zlib/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in zlib" ; \ + (cd zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-gdb maintainer-clean-gdb +maybe-maintainer-clean-gdb: + +maintainer-clean-gdb: + @[ -f ./gdb/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in gdb" ; \ + (cd gdb && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-expect maintainer-clean-expect +maybe-maintainer-clean-expect: + +maintainer-clean-expect: + @[ -f ./expect/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in expect" ; \ + (cd expect && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-guile maintainer-clean-guile +maybe-maintainer-clean-guile: + +maintainer-clean-guile: + @[ -f ./guile/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in guile" ; \ + (cd guile && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-tk maintainer-clean-tk +maybe-maintainer-clean-tk: + +maintainer-clean-tk: + @[ -f ./tk/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in tk" ; \ + (cd tk && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-tix maintainer-clean-tix +maybe-maintainer-clean-tix: + +maintainer-clean-tix: + @[ -f ./tix/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in tix" ; \ + (cd tix && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-libtermcap maintainer-clean-libtermcap +maybe-maintainer-clean-libtermcap: + +# libtermcap doesn't support maintainer-clean. +maintainer-clean-libtermcap: + + +.PHONY: maybe-maintainer-clean-utils maintainer-clean-utils +maybe-maintainer-clean-utils: + +maintainer-clean-utils: + @[ -f ./utils/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing maintainer-clean in utils" ; \ + (cd utils && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + + +# Target modules. + +.PHONY: maybe-maintainer-clean-target-libstdc++-v3 maintainer-clean-target-libstdc++-v3 +maybe-maintainer-clean-target-libstdc++-v3: + +maintainer-clean-target-libstdc++-v3: + @[ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libstdc++-v3" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-newlib maintainer-clean-target-newlib +maybe-maintainer-clean-target-newlib: + +maintainer-clean-target-newlib: + @[ -f $(TARGET_SUBDIR)/newlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/newlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-libf2c maintainer-clean-target-libf2c +maybe-maintainer-clean-target-libf2c: + +maintainer-clean-target-libf2c: + @[ -f $(TARGET_SUBDIR)/libf2c/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libf2c" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-libobjc maintainer-clean-target-libobjc +maybe-maintainer-clean-target-libobjc: + +maintainer-clean-target-libobjc: + @[ -f $(TARGET_SUBDIR)/libobjc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libobjc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-libtermcap maintainer-clean-target-libtermcap +maybe-maintainer-clean-target-libtermcap: + +# libtermcap doesn't support maintainer-clean. +maintainer-clean-target-libtermcap: + + +.PHONY: maybe-maintainer-clean-target-winsup maintainer-clean-target-winsup +maybe-maintainer-clean-target-winsup: + +maintainer-clean-target-winsup: + @[ -f $(TARGET_SUBDIR)/winsup/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/winsup" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-libgloss maintainer-clean-target-libgloss +maybe-maintainer-clean-target-libgloss: + +maintainer-clean-target-libgloss: + @[ -f $(TARGET_SUBDIR)/libgloss/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libgloss" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-libiberty maintainer-clean-target-libiberty +maybe-maintainer-clean-target-libiberty: + +maintainer-clean-target-libiberty: + @[ -f $(TARGET_SUBDIR)/libiberty/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libiberty" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-gperf maintainer-clean-target-gperf +maybe-maintainer-clean-target-gperf: + +maintainer-clean-target-gperf: + @[ -f $(TARGET_SUBDIR)/gperf/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/gperf" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-examples maintainer-clean-target-examples +maybe-maintainer-clean-target-examples: + +maintainer-clean-target-examples: + @[ -f $(TARGET_SUBDIR)/examples/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/examples" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-libffi maintainer-clean-target-libffi +maybe-maintainer-clean-target-libffi: + +maintainer-clean-target-libffi: + @[ -f $(TARGET_SUBDIR)/libffi/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libffi" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-libjava maintainer-clean-target-libjava +maybe-maintainer-clean-target-libjava: + +maintainer-clean-target-libjava: + @[ -f $(TARGET_SUBDIR)/libjava/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libjava" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-zlib maintainer-clean-target-zlib +maybe-maintainer-clean-target-zlib: + +maintainer-clean-target-zlib: + @[ -f $(TARGET_SUBDIR)/zlib/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/zlib" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-boehm-gc maintainer-clean-target-boehm-gc +maybe-maintainer-clean-target-boehm-gc: + +maintainer-clean-target-boehm-gc: + @[ -f $(TARGET_SUBDIR)/boehm-gc/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/boehm-gc" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-qthreads maintainer-clean-target-qthreads +maybe-maintainer-clean-target-qthreads: + +maintainer-clean-target-qthreads: + @[ -f $(TARGET_SUBDIR)/qthreads/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/qthreads" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-rda maintainer-clean-target-rda +maybe-maintainer-clean-target-rda: + +maintainer-clean-target-rda: + @[ -f $(TARGET_SUBDIR)/rda/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/rda" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + +.PHONY: maybe-maintainer-clean-target-libada maintainer-clean-target-libada +maybe-maintainer-clean-target-libada: + +maintainer-clean-target-libada: + @[ -f $(TARGET_SUBDIR)/libada/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing maintainer-clean in $(TARGET_SUBDIR)/libada" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + maintainer-clean) \ + || exit 1 + + + + +# Here are the targets which correspond to the do-X targets. + +.PHONY: info installcheck dvi install-info +.PHONY: clean distclean mostlyclean maintainer-clean realclean +.PHONY: local-clean local-distclean local-maintainer-clean +info: do-info +installcheck: do-installcheck +dvi: do-dvi + +# Make sure makeinfo is built before we do a `make info', if we're +# in fact building texinfo. +do-info: maybe-all-texinfo + +install-info: do-install-info dir.info + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + if [ -f dir.info ] ; then \ + $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \ + else true ; fi + +local-clean: + -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log + +local-distclean: + -rm -f Makefile config.status config.cache mh-frag mt-frag + -rm -f multilib.out multilib.tmp maybedep.tmp serdep.tmp + -if [ "$(TARGET_SUBDIR)" != "." ]; then \ rm -rf $(TARGET_SUBDIR); \ else true; fi + -rm -rf $(BUILD_SUBDIR) -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile -rm -f texinfo/doc/Makefile texinfo/po/POTFILES -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null -local-maintainer-clean: - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." +local-maintainer-clean: + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +clean: do-clean local-clean +mostlyclean: do-mostlyclean local-clean +distclean: do-distclean local-clean local-distclean +maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean +maintainer-clean: local-distclean +realclean: maintainer-clean + +# Extra dependency for clean-target, owing to the mixed nature of gcc +clean-target: 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. + +.PHONY: check do-check +check: do-check + +# Only include modules actually being configured and built. +do-check: maybe-check-gcc \ + maybe-check-ash \ + maybe-check-autoconf \ + maybe-check-automake \ + maybe-check-bash \ + maybe-check-bfd \ + maybe-check-opcodes \ + maybe-check-binutils \ + maybe-check-bison \ + maybe-check-byacc \ + maybe-check-bzip2 \ + maybe-check-dejagnu \ + maybe-check-diff \ + maybe-check-dosutils \ + maybe-check-etc \ + maybe-check-fastjar \ + maybe-check-fileutils \ + maybe-check-findutils \ + maybe-check-find \ + maybe-check-flex \ + maybe-check-gas \ + maybe-check-gawk \ + maybe-check-gettext \ + maybe-check-gnuserv \ + maybe-check-gprof \ + maybe-check-gzip \ + maybe-check-hello \ + maybe-check-indent \ + maybe-check-intl \ + maybe-check-tcl \ + maybe-check-itcl \ + maybe-check-ld \ + maybe-check-libgui \ + maybe-check-libiberty \ + maybe-check-libtool \ + maybe-check-m4 \ + maybe-check-make \ + maybe-check-mmalloc \ + maybe-check-patch \ + maybe-check-perl \ + maybe-check-prms \ + maybe-check-rcs \ + maybe-check-readline \ + maybe-check-release \ + maybe-check-recode \ + maybe-check-sed \ + maybe-check-send-pr \ + maybe-check-shellutils \ + maybe-check-sid \ + maybe-check-sim \ + maybe-check-tar \ + maybe-check-texinfo \ + maybe-check-textutils \ + maybe-check-time \ + maybe-check-uudecode \ + maybe-check-wdiff \ + maybe-check-zip \ + maybe-check-zlib \ + maybe-check-gdb \ + maybe-check-expect \ + maybe-check-guile \ + maybe-check-tk \ + maybe-check-tix \ + maybe-check-libtermcap \ + maybe-check-utils \ + maybe-check-target-libstdc++-v3 \ + maybe-check-target-newlib \ + maybe-check-target-libf2c \ + maybe-check-target-libobjc \ + maybe-check-target-libtermcap \ + maybe-check-target-winsup \ + maybe-check-target-libgloss \ + maybe-check-target-libiberty \ + maybe-check-target-gperf \ + maybe-check-target-examples \ + maybe-check-target-libffi \ + maybe-check-target-libjava \ + maybe-check-target-zlib \ + maybe-check-target-boehm-gc \ + maybe-check-target-qthreads \ + maybe-check-target-rda \ + maybe-check-target-libada + +# Automated reporting of test results. + +warning.log: build.log + $(srcdir)/contrib/warn_summary build.log > $@ + +mail-report.log: + if test x'$(BOOT_CFLAGS)' != x''; then \ + BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ + fi; \ + $(srcdir)/contrib/test_summary -t >$@ + chmod +x $@ + echo If you really want to send e-mail, run ./$@ now + +mail-report-with-warnings.log: warning.log + if test x'$(BOOT_CFLAGS)' != x''; then \ + BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ + fi; \ + $(srcdir)/contrib/test_summary -t -i warning.log >$@ + chmod +x $@ + echo If you really want to send e-mail, run ./$@ now + +# Installation targets. + +.PHONY: install uninstall +install: installdirs install-host install-target + +.PHONY: install-host-nogcc +install-host-nogcc: \ + maybe-install-ash \ + maybe-install-autoconf \ + maybe-install-automake \ + maybe-install-bash \ + maybe-install-bfd \ + maybe-install-opcodes \ + maybe-install-binutils \ + maybe-install-bison \ + maybe-install-byacc \ + maybe-install-bzip2 \ + maybe-install-dejagnu \ + maybe-install-diff \ + maybe-install-dosutils \ + maybe-install-etc \ + maybe-install-fastjar \ + maybe-install-fileutils \ + maybe-install-findutils \ + maybe-install-find \ + maybe-install-flex \ + maybe-install-gas \ + maybe-install-gawk \ + maybe-install-gettext \ + maybe-install-gnuserv \ + maybe-install-gprof \ + maybe-install-gzip \ + maybe-install-hello \ + maybe-install-indent \ + maybe-install-intl \ + maybe-install-tcl \ + maybe-install-itcl \ + maybe-install-ld \ + maybe-install-libgui \ + maybe-install-libiberty \ + maybe-install-libtool \ + maybe-install-m4 \ + maybe-install-make \ + maybe-install-mmalloc \ + maybe-install-patch \ + maybe-install-perl \ + maybe-install-prms \ + maybe-install-rcs \ + maybe-install-readline \ + maybe-install-release \ + maybe-install-recode \ + maybe-install-sed \ + maybe-install-send-pr \ + maybe-install-shellutils \ + maybe-install-sid \ + maybe-install-sim \ + maybe-install-tar \ + maybe-install-texinfo \ + maybe-install-textutils \ + maybe-install-time \ + maybe-install-uudecode \ + maybe-install-wdiff \ + maybe-install-zip \ + maybe-install-zlib \ + maybe-install-gdb \ + maybe-install-expect \ + maybe-install-guile \ + maybe-install-tk \ + maybe-install-tix \ + maybe-install-libtermcap \ + maybe-install-utils + +.PHONY: install-host +install-host: maybe-install-gcc \ + maybe-install-ash \ + maybe-install-autoconf \ + maybe-install-automake \ + maybe-install-bash \ + maybe-install-bfd \ + maybe-install-opcodes \ + maybe-install-binutils \ + maybe-install-bison \ + maybe-install-byacc \ + maybe-install-bzip2 \ + maybe-install-dejagnu \ + maybe-install-diff \ + maybe-install-dosutils \ + maybe-install-etc \ + maybe-install-fastjar \ + maybe-install-fileutils \ + maybe-install-findutils \ + maybe-install-find \ + maybe-install-flex \ + maybe-install-gas \ + maybe-install-gawk \ + maybe-install-gettext \ + maybe-install-gnuserv \ + maybe-install-gprof \ + maybe-install-gzip \ + maybe-install-hello \ + maybe-install-indent \ + maybe-install-intl \ + maybe-install-tcl \ + maybe-install-itcl \ + maybe-install-ld \ + maybe-install-libgui \ + maybe-install-libiberty \ + maybe-install-libtool \ + maybe-install-m4 \ + maybe-install-make \ + maybe-install-mmalloc \ + maybe-install-patch \ + maybe-install-perl \ + maybe-install-prms \ + maybe-install-rcs \ + maybe-install-readline \ + maybe-install-release \ + maybe-install-recode \ + maybe-install-sed \ + maybe-install-send-pr \ + maybe-install-shellutils \ + maybe-install-sid \ + maybe-install-sim \ + maybe-install-tar \ + maybe-install-texinfo \ + maybe-install-textutils \ + maybe-install-time \ + maybe-install-uudecode \ + maybe-install-wdiff \ + maybe-install-zip \ + maybe-install-zlib \ + maybe-install-gdb \ + maybe-install-expect \ + maybe-install-guile \ + maybe-install-tk \ + maybe-install-tix \ + maybe-install-libtermcap \ + maybe-install-utils + +.PHONY: install-target +install-target: \ + maybe-install-target-libstdc++-v3 \ + maybe-install-target-newlib \ + maybe-install-target-libf2c \ + maybe-install-target-libobjc \ + maybe-install-target-libtermcap \ + maybe-install-target-winsup \ + maybe-install-target-libgloss \ + maybe-install-target-libiberty \ + maybe-install-target-gperf \ + maybe-install-target-examples \ + maybe-install-target-libffi \ + maybe-install-target-libjava \ + maybe-install-target-zlib \ + maybe-install-target-boehm-gc \ + maybe-install-target-qthreads \ + maybe-install-target-rda \ + maybe-install-target-libada + +uninstall: + @echo "the uninstall target is not supported in this tree" + +.PHONY: install.all +install.all: install-no-fixedincludes + @if [ -f ./gcc/Makefile ] ; then \ + r=`${PWD_COMMAND}` ; export r ; \ + $(SET_LIB_PATH) \ + (cd ./gcc && \ + $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \ + else \ + true ; \ + fi + +# install-no-fixedincludes is used because Cygnus can not distribute +# the fixed header files. +.PHONY: install-no-fixedincludes +install-no-fixedincludes: installdirs install-host-nogcc \ + install-target gcc-no-fixedincludes + +### other supporting targets + +MAKEDIRS= \ + $(DESTDIR)$(prefix) \ + $(DESTDIR)$(exec_prefix) +.PHONY: installdirs +installdirs: mkinstalldirs + $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS) + +dir.info: do-install-info + if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \ + $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \ + mv -f dir.info.new dir.info ; \ + else true ; \ + fi + +dist: + @echo "Building a full distribution of this tree isn't done" + @echo "via 'make dist'. Check out the etc/ subdirectory" + +etags tags: TAGS + +# Right now this just builds TAGS in each subdirectory. emacs19 has the +# ability to use several tags files at once, so there is probably no need +# to combine them into one big TAGS file (like CVS 1.3 does). We could +# (if we felt like it) have this Makefile write a piece of elisp which +# the user could load to tell emacs19 where all the TAGS files we just +# built are. +TAGS: do-TAGS + +# -------------------------------------- +# Modules which run on the build machine +# -------------------------------------- + +.PHONY: configure-build-libiberty maybe-configure-build-libiberty +maybe-configure-build-libiberty: +configure-build-libiberty: + @test ! -f $(BUILD_SUBDIR)/libiberty/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/libiberty ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + AR="$(AR_FOR_BUILD)"; export AR; \ + AS="$(AS_FOR_BUILD)"; export AS; \ + CC="$(CC_FOR_BUILD)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX_FOR_BUILD)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \ + LD="$(LD_FOR_BUILD)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \ + NM="$(NM_FOR_BUILD)"; export NM; \ + RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \ + echo Configuring in $(BUILD_SUBDIR)/libiberty; \ + cd "$(BUILD_SUBDIR)/libiberty" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(BUILD_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(BUILD_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/libiberty "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ + --with-build-subdir="$(BUILD_SUBDIR)" \ + || exit 1 + +.PHONY: all-build-libiberty maybe-all-build-libiberty +maybe-all-build-libiberty: +all-build-libiberty: configure-build-libiberty + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + (cd $(BUILD_SUBDIR)/libiberty && $(MAKE) all) + + +# -------------------------------------- +# Modules which run on the host machine +# -------------------------------------- + +.PHONY: configure-ash maybe-configure-ash +maybe-configure-ash: +configure-ash: + @test ! -f ash/Makefile || exit 0; \ + [ -d ash ] || mkdir ash; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in ash; \ + cd ash || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/ash"; \ + libsrcdir="$$s/ash";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/ash"; \ + libsrcdir="$$s/ash";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-ash maybe-all-ash +maybe-all-ash: +all-ash: configure-ash + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd ash && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-ash maybe-check-ash +maybe-check-ash: + +check-ash: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd ash && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-ash maybe-install-ash +maybe-install-ash: + +install-ash: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd ash && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-autoconf maybe-configure-autoconf +maybe-configure-autoconf: +configure-autoconf: + @test ! -f autoconf/Makefile || exit 0; \ + [ -d autoconf ] || mkdir autoconf; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in autoconf; \ + cd autoconf || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/autoconf"; \ + libsrcdir="$$s/autoconf";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/autoconf"; \ + libsrcdir="$$s/autoconf";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-autoconf maybe-all-autoconf +maybe-all-autoconf: +all-autoconf: configure-autoconf + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-autoconf maybe-check-autoconf +maybe-check-autoconf: + +check-autoconf: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-autoconf maybe-install-autoconf +maybe-install-autoconf: + +install-autoconf: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd autoconf && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-automake maybe-configure-automake +maybe-configure-automake: +configure-automake: + @test ! -f automake/Makefile || exit 0; \ + [ -d automake ] || mkdir automake; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in automake; \ + cd automake || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/automake"; \ + libsrcdir="$$s/automake";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/automake"; \ + libsrcdir="$$s/automake";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-automake maybe-all-automake +maybe-all-automake: +all-automake: configure-automake + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd automake && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-automake maybe-check-automake +maybe-check-automake: + +check-automake: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd automake && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-automake maybe-install-automake +maybe-install-automake: + +install-automake: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd automake && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-bash maybe-configure-bash +maybe-configure-bash: +configure-bash: + @test ! -f bash/Makefile || exit 0; \ + [ -d bash ] || mkdir bash; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in bash; \ + cd bash || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/bash"; \ + libsrcdir="$$s/bash";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/bash"; \ + libsrcdir="$$s/bash";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-bash maybe-all-bash +maybe-all-bash: +all-bash: configure-bash + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd bash && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-bash maybe-check-bash +maybe-check-bash: + +check-bash: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd bash && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-bash maybe-install-bash +maybe-install-bash: + +install-bash: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd bash && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-bfd maybe-configure-bfd +maybe-configure-bfd: +configure-bfd: + @test ! -f bfd/Makefile || exit 0; \ + [ -d bfd ] || mkdir bfd; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in bfd; \ + cd bfd || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/bfd"; \ + libsrcdir="$$s/bfd";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/bfd"; \ + libsrcdir="$$s/bfd";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-bfd maybe-all-bfd +maybe-all-bfd: +all-bfd: configure-bfd + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd bfd && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-bfd maybe-check-bfd +maybe-check-bfd: + +check-bfd: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd bfd && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-bfd maybe-install-bfd +maybe-install-bfd: + +install-bfd: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd bfd && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-opcodes maybe-configure-opcodes +maybe-configure-opcodes: +configure-opcodes: + @test ! -f opcodes/Makefile || exit 0; \ + [ -d opcodes ] || mkdir opcodes; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in opcodes; \ + cd opcodes || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/opcodes"; \ + libsrcdir="$$s/opcodes";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/opcodes"; \ + libsrcdir="$$s/opcodes";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-opcodes maybe-all-opcodes +maybe-all-opcodes: +all-opcodes: configure-opcodes + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-opcodes maybe-check-opcodes +maybe-check-opcodes: + +check-opcodes: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-opcodes maybe-install-opcodes +maybe-install-opcodes: + +install-opcodes: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd opcodes && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-binutils maybe-configure-binutils +maybe-configure-binutils: +configure-binutils: + @test ! -f binutils/Makefile || exit 0; \ + [ -d binutils ] || mkdir binutils; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in binutils; \ + cd binutils || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/binutils"; \ + libsrcdir="$$s/binutils";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/binutils"; \ + libsrcdir="$$s/binutils";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-binutils maybe-all-binutils +maybe-all-binutils: +all-binutils: configure-binutils + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd binutils && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-binutils maybe-check-binutils +maybe-check-binutils: + +check-binutils: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd binutils && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-binutils maybe-install-binutils +maybe-install-binutils: + +install-binutils: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd binutils && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-bison maybe-configure-bison +maybe-configure-bison: +configure-bison: + @test ! -f bison/Makefile || exit 0; \ + [ -d bison ] || mkdir bison; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in bison; \ + cd bison || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/bison"; \ + libsrcdir="$$s/bison";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/bison"; \ + libsrcdir="$$s/bison";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-bison maybe-all-bison +maybe-all-bison: +all-bison: configure-bison + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd bison && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-bison maybe-check-bison +maybe-check-bison: + +# This module is only tested in a native toolchain. +check-bison: + @if [ '$(host)' = '$(target)' ] ; then \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd bison && $(MAKE) $(FLAGS_TO_PASS) check); \ + fi + + +.PHONY: install-bison maybe-install-bison +maybe-install-bison: + +install-bison: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd bison && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-byacc maybe-configure-byacc +maybe-configure-byacc: +configure-byacc: + @test ! -f byacc/Makefile || exit 0; \ + [ -d byacc ] || mkdir byacc; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in byacc; \ + cd byacc || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/byacc"; \ + libsrcdir="$$s/byacc";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/byacc"; \ + libsrcdir="$$s/byacc";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-byacc maybe-all-byacc +maybe-all-byacc: +all-byacc: configure-byacc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd byacc && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-byacc maybe-check-byacc +maybe-check-byacc: + +# This module is only tested in a native toolchain. +check-byacc: + @if [ '$(host)' = '$(target)' ] ; then \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd byacc && $(MAKE) $(FLAGS_TO_PASS) check); \ + fi + + +.PHONY: install-byacc maybe-install-byacc +maybe-install-byacc: + +install-byacc: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd byacc && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-bzip2 maybe-configure-bzip2 +maybe-configure-bzip2: +configure-bzip2: + @test ! -f bzip2/Makefile || exit 0; \ + [ -d bzip2 ] || mkdir bzip2; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in bzip2; \ + cd bzip2 || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/bzip2"; \ + libsrcdir="$$s/bzip2";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/bzip2"; \ + libsrcdir="$$s/bzip2";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-bzip2 maybe-all-bzip2 +maybe-all-bzip2: +all-bzip2: configure-bzip2 + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-bzip2 maybe-check-bzip2 +maybe-check-bzip2: + +check-bzip2: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-bzip2 maybe-install-bzip2 +maybe-install-bzip2: + +install-bzip2: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd bzip2 && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-dejagnu maybe-configure-dejagnu +maybe-configure-dejagnu: +configure-dejagnu: + @test ! -f dejagnu/Makefile || exit 0; \ + [ -d dejagnu ] || mkdir dejagnu; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in dejagnu; \ + cd dejagnu || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/dejagnu"; \ + libsrcdir="$$s/dejagnu";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/dejagnu"; \ + libsrcdir="$$s/dejagnu";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-dejagnu maybe-all-dejagnu +maybe-all-dejagnu: +all-dejagnu: configure-dejagnu + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-dejagnu maybe-check-dejagnu +maybe-check-dejagnu: + +check-dejagnu: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-dejagnu maybe-install-dejagnu +maybe-install-dejagnu: + +install-dejagnu: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd dejagnu && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-diff maybe-configure-diff +maybe-configure-diff: +configure-diff: + @test ! -f diff/Makefile || exit 0; \ + [ -d diff ] || mkdir diff; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in diff; \ + cd diff || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/diff"; \ + libsrcdir="$$s/diff";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/diff"; \ + libsrcdir="$$s/diff";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-diff maybe-all-diff +maybe-all-diff: +all-diff: configure-diff + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd diff && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-diff maybe-check-diff +maybe-check-diff: + +check-diff: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd diff && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-diff maybe-install-diff +maybe-install-diff: + +install-diff: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd diff && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-dosutils maybe-configure-dosutils +maybe-configure-dosutils: +configure-dosutils: + @test ! -f dosutils/Makefile || exit 0; \ + [ -d dosutils ] || mkdir dosutils; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in dosutils; \ + cd dosutils || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/dosutils"; \ + libsrcdir="$$s/dosutils";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/dosutils"; \ + libsrcdir="$$s/dosutils";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-dosutils maybe-all-dosutils +maybe-all-dosutils: +all-dosutils: configure-dosutils + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd dosutils && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-dosutils maybe-check-dosutils +maybe-check-dosutils: + +check-dosutils: + + +.PHONY: install-dosutils maybe-install-dosutils +maybe-install-dosutils: + +install-dosutils: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd dosutils && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-etc maybe-configure-etc +maybe-configure-etc: +configure-etc: + @test ! -f etc/Makefile || exit 0; \ + [ -d etc ] || mkdir etc; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in etc; \ + cd etc || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/etc"; \ + libsrcdir="$$s/etc";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/etc"; \ + libsrcdir="$$s/etc";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-etc maybe-all-etc +maybe-all-etc: +all-etc: configure-etc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd etc && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-etc maybe-check-etc +maybe-check-etc: + +check-etc: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd etc && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-etc maybe-install-etc +maybe-install-etc: + +install-etc: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd etc && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-fastjar maybe-configure-fastjar +maybe-configure-fastjar: +configure-fastjar: + @test ! -f fastjar/Makefile || exit 0; \ + [ -d fastjar ] || mkdir fastjar; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in fastjar; \ + cd fastjar || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/fastjar"; \ + libsrcdir="$$s/fastjar";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/fastjar"; \ + libsrcdir="$$s/fastjar";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-fastjar maybe-all-fastjar +maybe-all-fastjar: +all-fastjar: configure-fastjar + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-fastjar maybe-check-fastjar +maybe-check-fastjar: + +# This module is only tested in a native toolchain. +check-fastjar: + @if [ '$(host)' = '$(target)' ] ; then \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) check); \ + fi + + +.PHONY: install-fastjar maybe-install-fastjar +maybe-install-fastjar: + +install-fastjar: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd fastjar && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-fileutils maybe-configure-fileutils +maybe-configure-fileutils: +configure-fileutils: + @test ! -f fileutils/Makefile || exit 0; \ + [ -d fileutils ] || mkdir fileutils; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in fileutils; \ + cd fileutils || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/fileutils"; \ + libsrcdir="$$s/fileutils";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/fileutils"; \ + libsrcdir="$$s/fileutils";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-fileutils maybe-all-fileutils +maybe-all-fileutils: +all-fileutils: configure-fileutils + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-fileutils maybe-check-fileutils +maybe-check-fileutils: + +check-fileutils: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-fileutils maybe-install-fileutils +maybe-install-fileutils: + +install-fileutils: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd fileutils && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-findutils maybe-configure-findutils +maybe-configure-findutils: +configure-findutils: + @test ! -f findutils/Makefile || exit 0; \ + [ -d findutils ] || mkdir findutils; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in findutils; \ + cd findutils || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/findutils"; \ + libsrcdir="$$s/findutils";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/findutils"; \ + libsrcdir="$$s/findutils";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-findutils maybe-all-findutils +maybe-all-findutils: +all-findutils: configure-findutils + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd findutils && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-findutils maybe-check-findutils +maybe-check-findutils: + +check-findutils: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd findutils && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-findutils maybe-install-findutils +maybe-install-findutils: + +install-findutils: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd findutils && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-find maybe-configure-find +maybe-configure-find: +configure-find: + @test ! -f find/Makefile || exit 0; \ + [ -d find ] || mkdir find; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in find; \ + cd find || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/find"; \ + libsrcdir="$$s/find";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/find"; \ + libsrcdir="$$s/find";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-find maybe-all-find +maybe-all-find: +all-find: configure-find + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd find && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-find maybe-check-find +maybe-check-find: + +check-find: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd find && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-find maybe-install-find +maybe-install-find: + +install-find: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd find && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-flex maybe-configure-flex +maybe-configure-flex: +configure-flex: + @test ! -f flex/Makefile || exit 0; \ + [ -d flex ] || mkdir flex; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in flex; \ + cd flex || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/flex"; \ + libsrcdir="$$s/flex";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/flex"; \ + libsrcdir="$$s/flex";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-flex maybe-all-flex +maybe-all-flex: +all-flex: configure-flex + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd flex && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-flex maybe-check-flex +maybe-check-flex: + +# This module is only tested in a native toolchain. +check-flex: + @if [ '$(host)' = '$(target)' ] ; then \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd flex && $(MAKE) $(FLAGS_TO_PASS) check); \ + fi + + +.PHONY: install-flex maybe-install-flex +maybe-install-flex: + +install-flex: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd flex && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-gas maybe-configure-gas +maybe-configure-gas: +configure-gas: + @test ! -f gas/Makefile || exit 0; \ + [ -d gas ] || mkdir gas; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in gas; \ + cd gas || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/gas"; \ + libsrcdir="$$s/gas";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/gas"; \ + libsrcdir="$$s/gas";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-gas maybe-all-gas +maybe-all-gas: +all-gas: configure-gas + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gas && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-gas maybe-check-gas +maybe-check-gas: + +check-gas: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gas && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-gas maybe-install-gas +maybe-install-gas: + +install-gas: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gas && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-gawk maybe-configure-gawk +maybe-configure-gawk: +configure-gawk: + @test ! -f gawk/Makefile || exit 0; \ + [ -d gawk ] || mkdir gawk; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in gawk; \ + cd gawk || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/gawk"; \ + libsrcdir="$$s/gawk";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/gawk"; \ + libsrcdir="$$s/gawk";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-gawk maybe-all-gawk +maybe-all-gawk: +all-gawk: configure-gawk + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gawk && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-gawk maybe-check-gawk +maybe-check-gawk: + +check-gawk: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gawk && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-gawk maybe-install-gawk +maybe-install-gawk: + +install-gawk: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gawk && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-gettext maybe-configure-gettext +maybe-configure-gettext: +configure-gettext: + @test ! -f gettext/Makefile || exit 0; \ + [ -d gettext ] || mkdir gettext; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in gettext; \ + cd gettext || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/gettext"; \ + libsrcdir="$$s/gettext";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/gettext"; \ + libsrcdir="$$s/gettext";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-gettext maybe-all-gettext +maybe-all-gettext: +all-gettext: configure-gettext + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gettext && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-gettext maybe-check-gettext +maybe-check-gettext: + +check-gettext: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gettext && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-gettext maybe-install-gettext +maybe-install-gettext: + +install-gettext: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gettext && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-gnuserv maybe-configure-gnuserv +maybe-configure-gnuserv: +configure-gnuserv: + @test ! -f gnuserv/Makefile || exit 0; \ + [ -d gnuserv ] || mkdir gnuserv; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in gnuserv; \ + cd gnuserv || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/gnuserv"; \ + libsrcdir="$$s/gnuserv";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/gnuserv"; \ + libsrcdir="$$s/gnuserv";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-gnuserv maybe-all-gnuserv +maybe-all-gnuserv: +all-gnuserv: configure-gnuserv + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-gnuserv maybe-check-gnuserv +maybe-check-gnuserv: + +check-gnuserv: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-gnuserv maybe-install-gnuserv +maybe-install-gnuserv: + +install-gnuserv: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gnuserv && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-gprof maybe-configure-gprof +maybe-configure-gprof: +configure-gprof: + @test ! -f gprof/Makefile || exit 0; \ + [ -d gprof ] || mkdir gprof; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in gprof; \ + cd gprof || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/gprof"; \ + libsrcdir="$$s/gprof";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/gprof"; \ + libsrcdir="$$s/gprof";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-gprof maybe-all-gprof +maybe-all-gprof: +all-gprof: configure-gprof + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gprof && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-gprof maybe-check-gprof +maybe-check-gprof: + +check-gprof: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gprof && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-gprof maybe-install-gprof +maybe-install-gprof: + +install-gprof: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gprof && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-gzip maybe-configure-gzip +maybe-configure-gzip: +configure-gzip: + @test ! -f gzip/Makefile || exit 0; \ + [ -d gzip ] || mkdir gzip; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in gzip; \ + cd gzip || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/gzip"; \ + libsrcdir="$$s/gzip";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/gzip"; \ + libsrcdir="$$s/gzip";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-gzip maybe-all-gzip +maybe-all-gzip: +all-gzip: configure-gzip + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gzip && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-gzip maybe-check-gzip +maybe-check-gzip: + +check-gzip: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gzip && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-gzip maybe-install-gzip +maybe-install-gzip: + +install-gzip: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gzip && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-hello maybe-configure-hello +maybe-configure-hello: +configure-hello: + @test ! -f hello/Makefile || exit 0; \ + [ -d hello ] || mkdir hello; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in hello; \ + cd hello || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/hello"; \ + libsrcdir="$$s/hello";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/hello"; \ + libsrcdir="$$s/hello";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-hello maybe-all-hello +maybe-all-hello: +all-hello: configure-hello + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd hello && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-hello maybe-check-hello +maybe-check-hello: + +check-hello: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd hello && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-hello maybe-install-hello +maybe-install-hello: + +install-hello: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd hello && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-indent maybe-configure-indent +maybe-configure-indent: +configure-indent: + @test ! -f indent/Makefile || exit 0; \ + [ -d indent ] || mkdir indent; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in indent; \ + cd indent || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/indent"; \ + libsrcdir="$$s/indent";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/indent"; \ + libsrcdir="$$s/indent";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-indent maybe-all-indent +maybe-all-indent: +all-indent: configure-indent + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd indent && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-indent maybe-check-indent +maybe-check-indent: + +check-indent: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd indent && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-indent maybe-install-indent +maybe-install-indent: + +install-indent: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd indent && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-intl maybe-configure-intl +maybe-configure-intl: +configure-intl: + @test ! -f intl/Makefile || exit 0; \ + [ -d intl ] || mkdir intl; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in intl; \ + cd intl || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/intl"; \ + libsrcdir="$$s/intl";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/intl"; \ + libsrcdir="$$s/intl";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-intl maybe-all-intl +maybe-all-intl: +all-intl: configure-intl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd intl && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-intl maybe-check-intl +maybe-check-intl: + +check-intl: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd intl && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-intl maybe-install-intl +maybe-install-intl: + +install-intl: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd intl && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-tcl maybe-configure-tcl +maybe-configure-tcl: +configure-tcl: + @test ! -f tcl/Makefile || exit 0; \ + [ -d tcl ] || mkdir tcl; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in tcl; \ + cd tcl || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/tcl"; \ + libsrcdir="$$s/tcl";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/tcl"; \ + libsrcdir="$$s/tcl";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-tcl maybe-all-tcl +maybe-all-tcl: +all-tcl: configure-tcl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd tcl && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-tcl maybe-check-tcl +maybe-check-tcl: + +check-tcl: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd tcl && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-tcl maybe-install-tcl +maybe-install-tcl: + +install-tcl: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd tcl && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-itcl maybe-configure-itcl +maybe-configure-itcl: +configure-itcl: + @test ! -f itcl/Makefile || exit 0; \ + [ -d itcl ] || mkdir itcl; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in itcl; \ + cd itcl || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/itcl"; \ + libsrcdir="$$s/itcl";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/itcl"; \ + libsrcdir="$$s/itcl";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-itcl maybe-all-itcl +maybe-all-itcl: +all-itcl: configure-itcl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd itcl && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-itcl maybe-check-itcl +maybe-check-itcl: + +check-itcl: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd itcl && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-itcl maybe-install-itcl +maybe-install-itcl: + +install-itcl: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd itcl && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-ld maybe-configure-ld +maybe-configure-ld: +configure-ld: + @test ! -f ld/Makefile || exit 0; \ + [ -d ld ] || mkdir ld; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in ld; \ + cd ld || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/ld"; \ + libsrcdir="$$s/ld";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/ld"; \ + libsrcdir="$$s/ld";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-ld maybe-all-ld +maybe-all-ld: +all-ld: configure-ld + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd ld && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-ld maybe-check-ld +maybe-check-ld: + +check-ld: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd ld && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-ld maybe-install-ld +maybe-install-ld: + +install-ld: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd ld && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-libgui maybe-configure-libgui +maybe-configure-libgui: +configure-libgui: + @test ! -f libgui/Makefile || exit 0; \ + [ -d libgui ] || mkdir libgui; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in libgui; \ + cd libgui || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/libgui"; \ + libsrcdir="$$s/libgui";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/libgui"; \ + libsrcdir="$$s/libgui";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-libgui maybe-all-libgui +maybe-all-libgui: +all-libgui: configure-libgui + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd libgui && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-libgui maybe-check-libgui +maybe-check-libgui: + +check-libgui: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd libgui && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-libgui maybe-install-libgui +maybe-install-libgui: + +install-libgui: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd libgui && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-libiberty maybe-configure-libiberty +maybe-configure-libiberty: +configure-libiberty: + @test ! -f libiberty/Makefile || exit 0; \ + [ -d libiberty ] || mkdir libiberty; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in libiberty; \ + cd libiberty || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/libiberty"; \ + libsrcdir="$$s/libiberty";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/libiberty"; \ + libsrcdir="$$s/libiberty";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-libiberty maybe-all-libiberty +maybe-all-libiberty: +all-libiberty: configure-libiberty + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-libiberty maybe-check-libiberty +maybe-check-libiberty: + +check-libiberty: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-libiberty maybe-install-libiberty +maybe-install-libiberty: + +install-libiberty: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd libiberty && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-libtool maybe-configure-libtool +maybe-configure-libtool: +configure-libtool: + @test ! -f libtool/Makefile || exit 0; \ + [ -d libtool ] || mkdir libtool; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in libtool; \ + cd libtool || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/libtool"; \ + libsrcdir="$$s/libtool";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/libtool"; \ + libsrcdir="$$s/libtool";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-libtool maybe-all-libtool +maybe-all-libtool: +all-libtool: configure-libtool + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd libtool && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-libtool maybe-check-libtool +maybe-check-libtool: + +check-libtool: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd libtool && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-libtool maybe-install-libtool +maybe-install-libtool: + +install-libtool: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd libtool && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-m4 maybe-configure-m4 +maybe-configure-m4: +configure-m4: + @test ! -f m4/Makefile || exit 0; \ + [ -d m4 ] || mkdir m4; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in m4; \ + cd m4 || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/m4"; \ + libsrcdir="$$s/m4";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/m4"; \ + libsrcdir="$$s/m4";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-m4 maybe-all-m4 +maybe-all-m4: +all-m4: configure-m4 + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd m4 && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-m4 maybe-check-m4 +maybe-check-m4: + +check-m4: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd m4 && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-m4 maybe-install-m4 +maybe-install-m4: + +install-m4: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd m4 && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-make maybe-configure-make +maybe-configure-make: +configure-make: + @test ! -f make/Makefile || exit 0; \ + [ -d make ] || mkdir make; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in make; \ + cd make || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/make"; \ + libsrcdir="$$s/make";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/make"; \ + libsrcdir="$$s/make";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-make maybe-all-make +maybe-all-make: +all-make: configure-make + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd make && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-make maybe-check-make +maybe-check-make: + +check-make: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd make && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-make maybe-install-make +maybe-install-make: + +install-make: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd make && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-mmalloc maybe-configure-mmalloc +maybe-configure-mmalloc: +configure-mmalloc: + @test ! -f mmalloc/Makefile || exit 0; \ + [ -d mmalloc ] || mkdir mmalloc; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in mmalloc; \ + cd mmalloc || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/mmalloc"; \ + libsrcdir="$$s/mmalloc";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/mmalloc"; \ + libsrcdir="$$s/mmalloc";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-mmalloc maybe-all-mmalloc +maybe-all-mmalloc: +all-mmalloc: configure-mmalloc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd mmalloc && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-mmalloc maybe-check-mmalloc +maybe-check-mmalloc: + +check-mmalloc: + + +.PHONY: install-mmalloc maybe-install-mmalloc +maybe-install-mmalloc: + +install-mmalloc: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd mmalloc && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-patch maybe-configure-patch +maybe-configure-patch: +configure-patch: + @test ! -f patch/Makefile || exit 0; \ + [ -d patch ] || mkdir patch; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in patch; \ + cd patch || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/patch"; \ + libsrcdir="$$s/patch";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/patch"; \ + libsrcdir="$$s/patch";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-patch maybe-all-patch +maybe-all-patch: +all-patch: configure-patch + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd patch && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-patch maybe-check-patch +maybe-check-patch: + +check-patch: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd patch && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-patch maybe-install-patch +maybe-install-patch: + +install-patch: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd patch && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-perl maybe-configure-perl +maybe-configure-perl: +configure-perl: + @test ! -f perl/Makefile || exit 0; \ + [ -d perl ] || mkdir perl; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in perl; \ + cd perl || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/perl"; \ + libsrcdir="$$s/perl";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/perl"; \ + libsrcdir="$$s/perl";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-perl maybe-all-perl +maybe-all-perl: +all-perl: configure-perl + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd perl && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-perl maybe-check-perl +maybe-check-perl: + +check-perl: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd perl && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-perl maybe-install-perl +maybe-install-perl: + +install-perl: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd perl && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-prms maybe-configure-prms +maybe-configure-prms: +configure-prms: + @test ! -f prms/Makefile || exit 0; \ + [ -d prms ] || mkdir prms; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in prms; \ + cd prms || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/prms"; \ + libsrcdir="$$s/prms";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/prms"; \ + libsrcdir="$$s/prms";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-prms maybe-all-prms +maybe-all-prms: +all-prms: configure-prms + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd prms && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-prms maybe-check-prms +maybe-check-prms: + +check-prms: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd prms && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-prms maybe-install-prms +maybe-install-prms: + +install-prms: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd prms && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-rcs maybe-configure-rcs +maybe-configure-rcs: +configure-rcs: + @test ! -f rcs/Makefile || exit 0; \ + [ -d rcs ] || mkdir rcs; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in rcs; \ + cd rcs || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/rcs"; \ + libsrcdir="$$s/rcs";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/rcs"; \ + libsrcdir="$$s/rcs";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-rcs maybe-all-rcs +maybe-all-rcs: +all-rcs: configure-rcs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd rcs && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-rcs maybe-check-rcs +maybe-check-rcs: + +check-rcs: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd rcs && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-rcs maybe-install-rcs +maybe-install-rcs: + +install-rcs: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd rcs && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-readline maybe-configure-readline +maybe-configure-readline: +configure-readline: + @test ! -f readline/Makefile || exit 0; \ + [ -d readline ] || mkdir readline; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in readline; \ + cd readline || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/readline"; \ + libsrcdir="$$s/readline";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/readline"; \ + libsrcdir="$$s/readline";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-readline maybe-all-readline +maybe-all-readline: +all-readline: configure-readline + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd readline && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-readline maybe-check-readline +maybe-check-readline: + +check-readline: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd readline && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-readline maybe-install-readline +maybe-install-readline: + +install-readline: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd readline && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-release maybe-configure-release +maybe-configure-release: +configure-release: + @test ! -f release/Makefile || exit 0; \ + [ -d release ] || mkdir release; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in release; \ + cd release || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/release"; \ + libsrcdir="$$s/release";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/release"; \ + libsrcdir="$$s/release";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-release maybe-all-release +maybe-all-release: +all-release: configure-release + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd release && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-release maybe-check-release +maybe-check-release: + +check-release: + + +.PHONY: install-release maybe-install-release +maybe-install-release: + +install-release: + + +.PHONY: configure-recode maybe-configure-recode +maybe-configure-recode: +configure-recode: + @test ! -f recode/Makefile || exit 0; \ + [ -d recode ] || mkdir recode; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in recode; \ + cd recode || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/recode"; \ + libsrcdir="$$s/recode";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/recode"; \ + libsrcdir="$$s/recode";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-recode maybe-all-recode +maybe-all-recode: +all-recode: configure-recode + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd recode && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-recode maybe-check-recode +maybe-check-recode: + +check-recode: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd recode && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-recode maybe-install-recode +maybe-install-recode: + +install-recode: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd recode && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-sed maybe-configure-sed +maybe-configure-sed: +configure-sed: + @test ! -f sed/Makefile || exit 0; \ + [ -d sed ] || mkdir sed; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in sed; \ + cd sed || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/sed"; \ + libsrcdir="$$s/sed";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/sed"; \ + libsrcdir="$$s/sed";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-sed maybe-all-sed +maybe-all-sed: +all-sed: configure-sed + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd sed && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-sed maybe-check-sed +maybe-check-sed: + +check-sed: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd sed && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-sed maybe-install-sed +maybe-install-sed: + +install-sed: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd sed && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-send-pr maybe-configure-send-pr +maybe-configure-send-pr: +configure-send-pr: + @test ! -f send-pr/Makefile || exit 0; \ + [ -d send-pr ] || mkdir send-pr; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in send-pr; \ + cd send-pr || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/send-pr"; \ + libsrcdir="$$s/send-pr";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/send-pr"; \ + libsrcdir="$$s/send-pr";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-send-pr maybe-all-send-pr +maybe-all-send-pr: +all-send-pr: configure-send-pr + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-send-pr maybe-check-send-pr +maybe-check-send-pr: + +check-send-pr: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-send-pr maybe-install-send-pr +maybe-install-send-pr: + +install-send-pr: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd send-pr && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-shellutils maybe-configure-shellutils +maybe-configure-shellutils: +configure-shellutils: + @test ! -f shellutils/Makefile || exit 0; \ + [ -d shellutils ] || mkdir shellutils; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in shellutils; \ + cd shellutils || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/shellutils"; \ + libsrcdir="$$s/shellutils";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/shellutils"; \ + libsrcdir="$$s/shellutils";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-shellutils maybe-all-shellutils +maybe-all-shellutils: +all-shellutils: configure-shellutils + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-shellutils maybe-check-shellutils +maybe-check-shellutils: + +check-shellutils: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-shellutils maybe-install-shellutils +maybe-install-shellutils: + +install-shellutils: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd shellutils && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-sid maybe-configure-sid +maybe-configure-sid: +configure-sid: + @test ! -f sid/Makefile || exit 0; \ + [ -d sid ] || mkdir sid; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in sid; \ + cd sid || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/sid"; \ + libsrcdir="$$s/sid";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/sid"; \ + libsrcdir="$$s/sid";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-sid maybe-all-sid +maybe-all-sid: +all-sid: configure-sid + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd sid && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-sid maybe-check-sid +maybe-check-sid: + +check-sid: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd sid && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-sid maybe-install-sid +maybe-install-sid: + +install-sid: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd sid && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-sim maybe-configure-sim +maybe-configure-sim: +configure-sim: + @test ! -f sim/Makefile || exit 0; \ + [ -d sim ] || mkdir sim; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in sim; \ + cd sim || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/sim"; \ + libsrcdir="$$s/sim";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/sim"; \ + libsrcdir="$$s/sim";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-sim maybe-all-sim +maybe-all-sim: +all-sim: configure-sim + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd sim && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-sim maybe-check-sim +maybe-check-sim: + +check-sim: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd sim && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-sim maybe-install-sim +maybe-install-sim: + +install-sim: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd sim && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-tar maybe-configure-tar +maybe-configure-tar: +configure-tar: + @test ! -f tar/Makefile || exit 0; \ + [ -d tar ] || mkdir tar; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in tar; \ + cd tar || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/tar"; \ + libsrcdir="$$s/tar";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/tar"; \ + libsrcdir="$$s/tar";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-tar maybe-all-tar +maybe-all-tar: +all-tar: configure-tar + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd tar && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-tar maybe-check-tar +maybe-check-tar: + +check-tar: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd tar && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-tar maybe-install-tar +maybe-install-tar: + +install-tar: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd tar && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-texinfo maybe-configure-texinfo +maybe-configure-texinfo: +configure-texinfo: + @test ! -f texinfo/Makefile || exit 0; \ + [ -d texinfo ] || mkdir texinfo; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in texinfo; \ + cd texinfo || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/texinfo"; \ + libsrcdir="$$s/texinfo";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/texinfo"; \ + libsrcdir="$$s/texinfo";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-texinfo maybe-all-texinfo +maybe-all-texinfo: +all-texinfo: configure-texinfo + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd texinfo && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-texinfo maybe-check-texinfo +maybe-check-texinfo: + +check-texinfo: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd texinfo && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-texinfo maybe-install-texinfo +maybe-install-texinfo: + +install-texinfo: + + +.PHONY: configure-textutils maybe-configure-textutils +maybe-configure-textutils: +configure-textutils: + @test ! -f textutils/Makefile || exit 0; \ + [ -d textutils ] || mkdir textutils; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in textutils; \ + cd textutils || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/textutils"; \ + libsrcdir="$$s/textutils";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/textutils"; \ + libsrcdir="$$s/textutils";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-textutils maybe-all-textutils +maybe-all-textutils: +all-textutils: configure-textutils + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd textutils && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-textutils maybe-check-textutils +maybe-check-textutils: + +check-textutils: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd textutils && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-textutils maybe-install-textutils +maybe-install-textutils: + +install-textutils: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd textutils && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-time maybe-configure-time +maybe-configure-time: +configure-time: + @test ! -f time/Makefile || exit 0; \ + [ -d time ] || mkdir time; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in time; \ + cd time || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/time"; \ + libsrcdir="$$s/time";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/time"; \ + libsrcdir="$$s/time";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-time maybe-all-time +maybe-all-time: +all-time: configure-time + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd time && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-time maybe-check-time +maybe-check-time: + +check-time: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd time && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-time maybe-install-time +maybe-install-time: + +install-time: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd time && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-uudecode maybe-configure-uudecode +maybe-configure-uudecode: +configure-uudecode: + @test ! -f uudecode/Makefile || exit 0; \ + [ -d uudecode ] || mkdir uudecode; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in uudecode; \ + cd uudecode || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/uudecode"; \ + libsrcdir="$$s/uudecode";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/uudecode"; \ + libsrcdir="$$s/uudecode";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-uudecode maybe-all-uudecode +maybe-all-uudecode: +all-uudecode: configure-uudecode + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-uudecode maybe-check-uudecode +maybe-check-uudecode: + +check-uudecode: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-uudecode maybe-install-uudecode +maybe-install-uudecode: + +install-uudecode: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd uudecode && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-wdiff maybe-configure-wdiff +maybe-configure-wdiff: +configure-wdiff: + @test ! -f wdiff/Makefile || exit 0; \ + [ -d wdiff ] || mkdir wdiff; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in wdiff; \ + cd wdiff || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/wdiff"; \ + libsrcdir="$$s/wdiff";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/wdiff"; \ + libsrcdir="$$s/wdiff";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-wdiff maybe-all-wdiff +maybe-all-wdiff: +all-wdiff: configure-wdiff + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-wdiff maybe-check-wdiff +maybe-check-wdiff: + +check-wdiff: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) check) + + +.PHONY: install-wdiff maybe-install-wdiff +maybe-install-wdiff: + +install-wdiff: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd wdiff && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-zip maybe-configure-zip +maybe-configure-zip: +configure-zip: + @test ! -f zip/Makefile || exit 0; \ + [ -d zip ] || mkdir zip; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in zip; \ + cd zip || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/zip"; \ + libsrcdir="$$s/zip";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/zip"; \ + libsrcdir="$$s/zip";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-zip maybe-all-zip +maybe-all-zip: +all-zip: configure-zip + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd zip && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-zip maybe-check-zip +maybe-check-zip: + +# This module is only tested in a native toolchain. +check-zip: + @if [ '$(host)' = '$(target)' ] ; then \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd zip && $(MAKE) $(FLAGS_TO_PASS) check); \ + fi + + +.PHONY: install-zip maybe-install-zip +maybe-install-zip: + +install-zip: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd zip && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-zlib maybe-configure-zlib +maybe-configure-zlib: +configure-zlib: + @test ! -f zlib/Makefile || exit 0; \ + [ -d zlib ] || mkdir zlib; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in zlib; \ + cd zlib || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/zlib"; \ + libsrcdir="$$s/zlib";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/zlib"; \ + libsrcdir="$$s/zlib";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-zlib maybe-all-zlib +maybe-all-zlib: +all-zlib: configure-zlib + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd zlib && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-zlib maybe-check-zlib +maybe-check-zlib: + +check-zlib: + + +.PHONY: install-zlib maybe-install-zlib +maybe-install-zlib: + +install-zlib: + + +.PHONY: configure-gdb maybe-configure-gdb +maybe-configure-gdb: +configure-gdb: + @test ! -f gdb/Makefile || exit 0; \ + [ -d gdb ] || mkdir gdb; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in gdb; \ + cd gdb || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/gdb"; \ + libsrcdir="$$s/gdb";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/gdb"; \ + libsrcdir="$$s/gdb";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-gdb maybe-all-gdb +maybe-all-gdb: +all-gdb: configure-gdb + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) + +.PHONY: check-gdb maybe-check-gdb +maybe-check-gdb: + +check-gdb: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) + + +.PHONY: install-gdb maybe-install-gdb +maybe-install-gdb: + +install-gdb: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gdb && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) + + +.PHONY: configure-expect maybe-configure-expect +maybe-configure-expect: +configure-expect: + @test ! -f expect/Makefile || exit 0; \ + [ -d expect ] || mkdir expect; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in expect; \ + cd expect || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/expect"; \ + libsrcdir="$$s/expect";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/expect"; \ + libsrcdir="$$s/expect";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-expect maybe-all-expect +maybe-all-expect: +all-expect: configure-expect + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) + +.PHONY: check-expect maybe-check-expect +maybe-check-expect: + +check-expect: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) + + +.PHONY: install-expect maybe-install-expect +maybe-install-expect: + +install-expect: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd expect && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) + + +.PHONY: configure-guile maybe-configure-guile +maybe-configure-guile: +configure-guile: + @test ! -f guile/Makefile || exit 0; \ + [ -d guile ] || mkdir guile; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in guile; \ + cd guile || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/guile"; \ + libsrcdir="$$s/guile";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/guile"; \ + libsrcdir="$$s/guile";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-guile maybe-all-guile +maybe-all-guile: +all-guile: configure-guile + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) + +.PHONY: check-guile maybe-check-guile +maybe-check-guile: + +check-guile: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) + + +.PHONY: install-guile maybe-install-guile +maybe-install-guile: + +install-guile: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd guile && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) + + +.PHONY: configure-tk maybe-configure-tk +maybe-configure-tk: +configure-tk: + @test ! -f tk/Makefile || exit 0; \ + [ -d tk ] || mkdir tk; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in tk; \ + cd tk || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/tk"; \ + libsrcdir="$$s/tk";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/tk"; \ + libsrcdir="$$s/tk";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-tk maybe-all-tk +maybe-all-tk: +all-tk: configure-tk + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) + +.PHONY: check-tk maybe-check-tk +maybe-check-tk: + +check-tk: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) + + +.PHONY: install-tk maybe-install-tk +maybe-install-tk: + +install-tk: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd tk && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) + + +.PHONY: configure-tix maybe-configure-tix +maybe-configure-tix: +configure-tix: + @test ! -f tix/Makefile || exit 0; \ + [ -d tix ] || mkdir tix; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in tix; \ + cd tix || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/tix"; \ + libsrcdir="$$s/tix";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/tix"; \ + libsrcdir="$$s/tix";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-tix maybe-all-tix +maybe-all-tix: +all-tix: configure-tix + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all) + +.PHONY: check-tix maybe-check-tix +maybe-check-tix: + +check-tix: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check) + + +.PHONY: install-tix maybe-install-tix +maybe-install-tix: + +install-tix: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd tix && $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install) + + +.PHONY: configure-libtermcap maybe-configure-libtermcap +maybe-configure-libtermcap: +configure-libtermcap: + @test ! -f libtermcap/Makefile || exit 0; \ + [ -d libtermcap ] || mkdir libtermcap; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in libtermcap; \ + cd libtermcap || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/libtermcap"; \ + libsrcdir="$$s/libtermcap";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/libtermcap"; \ + libsrcdir="$$s/libtermcap";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-libtermcap maybe-all-libtermcap +maybe-all-libtermcap: +all-libtermcap: configure-libtermcap + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd libtermcap && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-libtermcap maybe-check-libtermcap +maybe-check-libtermcap: + +check-libtermcap: + + +.PHONY: install-libtermcap maybe-install-libtermcap +maybe-install-libtermcap: + +install-libtermcap: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd libtermcap && $(MAKE) $(FLAGS_TO_PASS) install) + + +.PHONY: configure-utils maybe-configure-utils +maybe-configure-utils: +configure-utils: + @test ! -f utils/Makefile || exit 0; \ + [ -d utils ] || mkdir utils; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in utils; \ + cd utils || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/utils"; \ + libsrcdir="$$s/utils";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/utils"; \ + libsrcdir="$$s/utils";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-utils maybe-all-utils +maybe-all-utils: +all-utils: configure-utils + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd utils && $(MAKE) $(FLAGS_TO_PASS) all) + +.PHONY: check-utils maybe-check-utils +maybe-check-utils: + +check-utils: + + +.PHONY: install-utils maybe-install-utils +maybe-install-utils: + +install-utils: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd utils && $(MAKE) $(FLAGS_TO_PASS) install) + + + +# --------------------------------------- +# Modules which run on the target machine +# --------------------------------------- + +.PHONY: configure-target-libstdc++-v3 maybe-configure-target-libstdc++-v3 +maybe-configure-target-libstdc++-v3: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/libstdc++-v3/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \ + rm -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/libstdc++-v3/multilib.out + +configure-target-libstdc++-v3: $(TARGET_SUBDIR)/libstdc++-v3/multilib.out + @test ! -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ + CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libstdc++-v3; \ + cd "$(TARGET_SUBDIR)/libstdc++-v3" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libstdc++-v3"; \ + libsrcdir="$$s/libstdc++-v3"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 + +.PHONY: all-target-libstdc++-v3 maybe-all-target-libstdc++-v3 +maybe-all-target-libstdc++-v3: +all-target-libstdc++-v3: configure-target-libstdc++-v3 + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' all) + +.PHONY: check-target-libstdc++-v3 maybe-check-target-libstdc++-v3 +maybe-check-target-libstdc++-v3: + +check-target-libstdc++-v3: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' check) + + +.PHONY: install-target-libstdc++-v3 maybe-install-target-libstdc++-v3 +maybe-install-target-libstdc++-v3: + +install-target-libstdc++-v3: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libstdc++-v3 && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + + +.PHONY: configure-target-newlib maybe-configure-target-newlib +maybe-configure-target-newlib: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/newlib/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/newlib ; \ + rm -f $(TARGET_SUBDIR)/newlib/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/newlib/multilib.out + +configure-target-newlib: $(TARGET_SUBDIR)/newlib/multilib.out + @test ! -f $(TARGET_SUBDIR)/newlib/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/newlib ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/newlib; \ + cd "$(TARGET_SUBDIR)/newlib" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/newlib"; \ + libsrcdir="$$s/newlib"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 + +.PHONY: all-target-newlib maybe-all-target-newlib +maybe-all-target-newlib: +all-target-newlib: configure-target-newlib + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + +.PHONY: check-target-newlib maybe-check-target-newlib +maybe-check-target-newlib: -clean: do-clean local-clean -mostlyclean: do-mostlyclean local-clean -distclean: do-distclean local-clean local-distclean -maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean -maintainer-clean: local-distclean -realclean: maintainer-clean +check-target-newlib: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) -# This rule is used to clean specific modules. -.PHONY: $(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc -$(CLEAN_MODULES) $(CLEAN_X11_MODULES) clean-gcc: - @dir=`echo $@ | sed -e 's/clean-//'`; \ - if [ -f ./$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) clean); \ + +.PHONY: install-target-newlib maybe-install-target-newlib +maybe-install-target-newlib: + +install-target-newlib: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/newlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + + +.PHONY: configure-target-libf2c maybe-configure-target-libf2c +maybe-configure-target-libf2c: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/libf2c/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libf2c ; \ + rm -f $(TARGET_SUBDIR)/libf2c/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/libf2c/multilib.out + +configure-target-libf2c: $(TARGET_SUBDIR)/libf2c/multilib.out + @test ! -f $(TARGET_SUBDIR)/libf2c/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libf2c ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libf2c; \ + cd "$(TARGET_SUBDIR)/libf2c" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libf2c"; \ + libsrcdir="$$s/libf2c"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 + +.PHONY: all-target-libf2c maybe-all-target-libf2c +maybe-all-target-libf2c: +all-target-libf2c: configure-target-libf2c + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + +.PHONY: check-target-libf2c maybe-check-target-libf2c +maybe-check-target-libf2c: + +check-target-libf2c: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + + +.PHONY: install-target-libf2c maybe-install-target-libf2c +maybe-install-target-libf2c: + +install-target-libf2c: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libf2c && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + + +.PHONY: configure-target-libobjc maybe-configure-target-libobjc +maybe-configure-target-libobjc: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/libobjc/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libobjc ; \ + rm -f $(TARGET_SUBDIR)/libobjc/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/libobjc/multilib.out + +configure-target-libobjc: $(TARGET_SUBDIR)/libobjc/multilib.out + @test ! -f $(TARGET_SUBDIR)/libobjc/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libobjc ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libobjc; \ + cd "$(TARGET_SUBDIR)/libobjc" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libobjc"; \ + libsrcdir="$$s/libobjc"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 + +.PHONY: all-target-libobjc maybe-all-target-libobjc +maybe-all-target-libobjc: +all-target-libobjc: configure-target-libobjc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + +.PHONY: check-target-libobjc maybe-check-target-libobjc +maybe-check-target-libobjc: + +check-target-libobjc: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + + +.PHONY: install-target-libobjc maybe-install-target-libobjc +maybe-install-target-libobjc: + +install-target-libobjc: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libobjc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + + +.PHONY: configure-target-libtermcap maybe-configure-target-libtermcap +maybe-configure-target-libtermcap: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/libtermcap/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libtermcap ; \ + rm -f $(TARGET_SUBDIR)/libtermcap/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/libtermcap/multilib.out + +configure-target-libtermcap: $(TARGET_SUBDIR)/libtermcap/multilib.out + @test ! -f $(TARGET_SUBDIR)/libtermcap/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libtermcap ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libtermcap; \ + cd "$(TARGET_SUBDIR)/libtermcap" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/libtermcap "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ else \ - true; \ - fi + srcdiroption="--srcdir=$${topdir}/libtermcap"; \ + libsrcdir="$$s/libtermcap"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 -.PHONY: $(CLEAN_TARGET_MODULES) -$(CLEAN_TARGET_MODULES): - @dir=`echo $@ | sed -e 's/clean-target-//'`; \ - rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \ - if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/$${dir}; $(MAKE) $(TARGET_FLAGS_TO_PASS) clean); \ +.PHONY: all-target-libtermcap maybe-all-target-libtermcap +maybe-all-target-libtermcap: +all-target-libtermcap: configure-target-libtermcap + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + +.PHONY: check-target-libtermcap maybe-check-target-libtermcap +maybe-check-target-libtermcap: + +# Dummy target for uncheckable module. +check-target-libtermcap: + + +.PHONY: install-target-libtermcap maybe-install-target-libtermcap +maybe-install-target-libtermcap: + +install-target-libtermcap: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libtermcap && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + + +.PHONY: configure-target-winsup maybe-configure-target-winsup +maybe-configure-target-winsup: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/winsup/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/winsup ; \ + rm -f $(TARGET_SUBDIR)/winsup/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/winsup/multilib.out + +configure-target-winsup: $(TARGET_SUBDIR)/winsup/multilib.out + @test ! -f $(TARGET_SUBDIR)/winsup/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/winsup ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/winsup; \ + cd "$(TARGET_SUBDIR)/winsup" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/winsup"; \ + libsrcdir="$$s/winsup"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 + +.PHONY: all-target-winsup maybe-all-target-winsup +maybe-all-target-winsup: +all-target-winsup: configure-target-winsup + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + +.PHONY: check-target-winsup maybe-check-target-winsup +maybe-check-target-winsup: + +check-target-winsup: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + + +.PHONY: install-target-winsup maybe-install-target-winsup +maybe-install-target-winsup: + +install-target-winsup: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/winsup && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + + +.PHONY: configure-target-libgloss maybe-configure-target-libgloss +maybe-configure-target-libgloss: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/libgloss/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgloss ; \ + rm -f $(TARGET_SUBDIR)/libgloss/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/libgloss/multilib.out + +configure-target-libgloss: $(TARGET_SUBDIR)/libgloss/multilib.out + @test ! -f $(TARGET_SUBDIR)/libgloss/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgloss ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libgloss; \ + cd "$(TARGET_SUBDIR)/libgloss" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libgloss"; \ + libsrcdir="$$s/libgloss"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 + +.PHONY: all-target-libgloss maybe-all-target-libgloss +maybe-all-target-libgloss: +all-target-libgloss: configure-target-libgloss + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + +.PHONY: check-target-libgloss maybe-check-target-libgloss +maybe-check-target-libgloss: + +# Dummy target for uncheckable module. +check-target-libgloss: + + +.PHONY: install-target-libgloss maybe-install-target-libgloss +maybe-install-target-libgloss: + +install-target-libgloss: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libgloss && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + + +.PHONY: configure-target-libiberty maybe-configure-target-libiberty +maybe-configure-target-libiberty: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/libiberty/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libiberty ; \ + rm -f $(TARGET_SUBDIR)/libiberty/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/libiberty/multilib.out + +configure-target-libiberty: $(TARGET_SUBDIR)/libiberty/multilib.out + @test ! -f $(TARGET_SUBDIR)/libiberty/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libiberty ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libiberty; \ + cd "$(TARGET_SUBDIR)/libiberty" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libiberty"; \ + libsrcdir="$$s/libiberty"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 + +.PHONY: all-target-libiberty maybe-all-target-libiberty +maybe-all-target-libiberty: +all-target-libiberty: configure-target-libiberty + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + +.PHONY: check-target-libiberty maybe-check-target-libiberty +maybe-check-target-libiberty: + +check-target-libiberty: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + + +.PHONY: install-target-libiberty maybe-install-target-libiberty +maybe-install-target-libiberty: + +install-target-libiberty: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libiberty && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + + +.PHONY: configure-target-gperf maybe-configure-target-gperf +maybe-configure-target-gperf: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/gperf/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/gperf ; \ + rm -f $(TARGET_SUBDIR)/gperf/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/gperf/multilib.out + +configure-target-gperf: $(TARGET_SUBDIR)/gperf/multilib.out + @test ! -f $(TARGET_SUBDIR)/gperf/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/gperf ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/gperf; \ + cd "$(TARGET_SUBDIR)/gperf" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/gperf"; \ + libsrcdir="$$s/gperf"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 + +.PHONY: all-target-gperf maybe-all-target-gperf +maybe-all-target-gperf: +all-target-gperf: configure-target-gperf + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + +.PHONY: check-target-gperf maybe-check-target-gperf +maybe-check-target-gperf: + +check-target-gperf: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + + +.PHONY: install-target-gperf maybe-install-target-gperf +maybe-install-target-gperf: + +install-target-gperf: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/gperf && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + + +.PHONY: configure-target-examples maybe-configure-target-examples +maybe-configure-target-examples: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/examples/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/examples ; \ + rm -f $(TARGET_SUBDIR)/examples/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/examples/multilib.out + +configure-target-examples: $(TARGET_SUBDIR)/examples/multilib.out + @test ! -f $(TARGET_SUBDIR)/examples/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/examples ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/examples; \ + cd "$(TARGET_SUBDIR)/examples" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/examples"; \ + libsrcdir="$$s/examples"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 + +.PHONY: all-target-examples maybe-all-target-examples +maybe-all-target-examples: +all-target-examples: configure-target-examples + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/examples && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + +.PHONY: check-target-examples maybe-check-target-examples +maybe-check-target-examples: + +# Dummy target for uncheckable module. +check-target-examples: + + +.PHONY: install-target-examples maybe-install-target-examples +maybe-install-target-examples: + +# Dummy target for uninstallable. +install-target-examples: + + +.PHONY: configure-target-libffi maybe-configure-target-libffi +maybe-configure-target-libffi: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/libffi/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libffi ; \ + rm -f $(TARGET_SUBDIR)/libffi/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/libffi/multilib.out + +configure-target-libffi: $(TARGET_SUBDIR)/libffi/multilib.out + @test ! -f $(TARGET_SUBDIR)/libffi/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libffi ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libffi; \ + cd "$(TARGET_SUBDIR)/libffi" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libffi"; \ + libsrcdir="$$s/libffi"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 + +.PHONY: all-target-libffi maybe-all-target-libffi +maybe-all-target-libffi: +all-target-libffi: configure-target-libffi + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + +.PHONY: check-target-libffi maybe-check-target-libffi +maybe-check-target-libffi: + +check-target-libffi: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + + +.PHONY: install-target-libffi maybe-install-target-libffi +maybe-install-target-libffi: + +install-target-libffi: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libffi && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + + +.PHONY: configure-target-libjava maybe-configure-target-libjava +maybe-configure-target-libjava: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/libjava/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libjava ; \ + rm -f $(TARGET_SUBDIR)/libjava/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/libjava/multilib.out + +configure-target-libjava: $(TARGET_SUBDIR)/libjava/multilib.out + @test ! -f $(TARGET_SUBDIR)/libjava/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libjava ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ + CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libjava; \ + cd "$(TARGET_SUBDIR)/libjava" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libjava"; \ + libsrcdir="$$s/libjava"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 + +.PHONY: all-target-libjava maybe-all-target-libjava +maybe-all-target-libjava: +all-target-libjava: configure-target-libjava + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' all) + +.PHONY: check-target-libjava maybe-check-target-libjava +maybe-check-target-libjava: + +check-target-libjava: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' check) + + +.PHONY: install-target-libjava maybe-install-target-libjava +maybe-install-target-libjava: + +install-target-libjava: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libjava && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + + +.PHONY: configure-target-zlib maybe-configure-target-zlib +maybe-configure-target-zlib: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/zlib/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/zlib ; \ + rm -f $(TARGET_SUBDIR)/zlib/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/zlib/multilib.out + +configure-target-zlib: $(TARGET_SUBDIR)/zlib/multilib.out + @test ! -f $(TARGET_SUBDIR)/zlib/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/zlib ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/zlib; \ + cd "$(TARGET_SUBDIR)/zlib" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/zlib "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ else \ - true; \ - fi + srcdiroption="--srcdir=$${topdir}/zlib"; \ + libsrcdir="$$s/zlib"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 -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 +.PHONY: all-target-zlib maybe-all-target-zlib +maybe-all-target-zlib: +all-target-zlib: configure-target-zlib + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + +.PHONY: check-target-zlib maybe-check-target-zlib +maybe-check-target-zlib: + +check-target-zlib: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + + +.PHONY: install-target-zlib maybe-install-target-zlib +maybe-install-target-zlib: + +install-target-zlib: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/zlib && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + + +.PHONY: configure-target-boehm-gc maybe-configure-target-boehm-gc +maybe-configure-target-boehm-gc: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/boehm-gc/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/boehm-gc ; \ + rm -f $(TARGET_SUBDIR)/boehm-gc/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/boehm-gc/multilib.out + +configure-target-boehm-gc: $(TARGET_SUBDIR)/boehm-gc/multilib.out + @test ! -f $(TARGET_SUBDIR)/boehm-gc/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/boehm-gc ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/boehm-gc; \ + cd "$(TARGET_SUBDIR)/boehm-gc" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/boehm-gc"; \ + libsrcdir="$$s/boehm-gc"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 + +.PHONY: all-target-boehm-gc maybe-all-target-boehm-gc +maybe-all-target-boehm-gc: +all-target-boehm-gc: configure-target-boehm-gc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) + +.PHONY: check-target-boehm-gc maybe-check-target-boehm-gc +maybe-check-target-boehm-gc: + +check-target-boehm-gc: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) + + +.PHONY: install-target-boehm-gc maybe-install-target-boehm-gc +maybe-install-target-boehm-gc: + +install-target-boehm-gc: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/boehm-gc && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) + + +.PHONY: configure-target-qthreads maybe-configure-target-qthreads +maybe-configure-target-qthreads: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/qthreads/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/qthreads ; \ + rm -f $(TARGET_SUBDIR)/qthreads/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/qthreads/multilib.out + +configure-target-qthreads: $(TARGET_SUBDIR)/qthreads/multilib.out + @test ! -f $(TARGET_SUBDIR)/qthreads/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/qthreads ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/qthreads; \ + cd "$(TARGET_SUBDIR)/qthreads" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/qthreads"; \ + libsrcdir="$$s/qthreads"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 + +.PHONY: all-target-qthreads maybe-all-target-qthreads +maybe-all-target-qthreads: +all-target-qthreads: configure-target-qthreads + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) -# Check target. +.PHONY: check-target-qthreads maybe-check-target-qthreads +maybe-check-target-qthreads: -.PHONY: check do-check -check: - $(MAKE) do-check NOTPARALLEL=parallel-ok +check-target-qthreads: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) -do-check: $(CHECK_MODULES) \ - $(CHECK_TARGET_MODULES) \ - $(CHECK_X11_MODULES) \ - check-gcc -# Automated reporting of test results. +.PHONY: install-target-qthreads maybe-install-target-qthreads +maybe-install-target-qthreads: -warning.log: build.log - $(srcdir)/contrib/warn_summary build.log > $@ +install-target-qthreads: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/qthreads && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) -mail-report.log: - if test x'$(BOOT_CFLAGS)' != x''; then \ - BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ - fi; \ - $(srcdir)/contrib/test_summary -t >$@ - chmod +x $@ - echo If you really want to send e-mail, run ./$@ now -mail-report-with-warnings.log: warning.log - if test x'$(BOOT_CFLAGS)' != x''; then \ - BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ - fi; \ - $(srcdir)/contrib/test_summary -t -i warning.log >$@ - chmod +x $@ - echo If you really want to send e-mail, run ./$@ now +.PHONY: configure-target-rda maybe-configure-target-rda +maybe-configure-target-rda: -# Installation targets. +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/rda/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/rda ; \ + rm -f $(TARGET_SUBDIR)/rda/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/rda/multilib.out -.PHONY: install install-cross uninstall source-vault binary-vault vault-install -install: $(INSTALL_TARGET) -install-cross: $(INSTALL_TARGET_CROSS) +configure-target-rda: $(TARGET_SUBDIR)/rda/multilib.out + @test ! -f $(TARGET_SUBDIR)/rda/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/rda ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/rda; \ + cd "$(TARGET_SUBDIR)/rda" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/rda"; \ + libsrcdir="$$s/rda"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 -uninstall: - @echo "the uninstall target is not supported in this tree" +.PHONY: all-target-rda maybe-all-target-rda +maybe-all-target-rda: +all-target-rda: configure-target-rda + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) -source-vault: - $(MAKE) -f ./release/Build-A-Release \ - host=$(host_alias) source-vault +.PHONY: check-target-rda maybe-check-target-rda +maybe-check-target-rda: -binary-vault: - $(MAKE) -f ./release/Build-A-Release \ - host=$(host_alias) target=$(target_alias) +check-target-rda: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) -vault-install: - @if [ -f ./release/vault-install ] ; then \ - ./release/vault-install $(host_alias) $(target_alias) ; \ - else \ - true ; \ - fi -.PHONY: install.all -install.all: install-no-fixedincludes - @if [ -f ./gcc/Makefile ] ; then \ - r=`${PWD}` ; export r ; \ - $(SET_LIB_PATH) \ - (cd ./gcc; \ - $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \ - else \ - true ; \ - fi +.PHONY: install-target-rda maybe-install-target-rda +maybe-install-target-rda: -# install-no-fixedincludes is used because Cygnus can not distribute -# the fixed header files. -.PHONY: install-no-fixedincludes -install-no-fixedincludes: \ - installdirs \ - $(INSTALL_MODULES) \ - $(INSTALL_TARGET_MODULES) \ - $(INSTALL_X11_MODULES) \ - gcc-no-fixedincludes +install-target-rda: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/rda && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) -# Install the gcc headers files, but not the fixed include files, -# which Cygnus is not allowed to distribute. This rule is very -# dependent on the workings of the gcc Makefile.in. -.PHONY: gcc-no-fixedincludes -gcc-no-fixedincludes: - @if [ -f ./gcc/Makefile ]; then \ - rm -rf gcc/tmp-include; \ - mv gcc/include gcc/tmp-include 2>/dev/null; \ - mkdir gcc/include; \ - cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ - touch gcc/stmp-fixinc gcc/include/fixed; \ - rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}` ; export s; \ - $(SET_LIB_PATH) \ - (cd ./gcc; \ - $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ - rm -rf gcc/include; \ - mv gcc/tmp-include gcc/include 2>/dev/null; \ - else true; fi -# This rule is used to build the modules which are built with the -# build machine's native compiler. -.PHONY: $(ALL_BUILD_MODULES) -$(ALL_BUILD_MODULES): - dir=`echo $@ | sed -e 's/all-build-//'`; \ - if [ -f ./$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - (cd $(BUILD_SUBDIR)/$${dir} && $(MAKE) all); \ - else \ - true; \ - fi +.PHONY: configure-target-libada maybe-configure-target-libada +maybe-configure-target-libada: -# This rule is used to configure the modules which are built with the -# native tools. -.PHONY: $(CONFIGURE_BUILD_MODULES) -$(CONFIGURE_BUILD_MODULES): - @dir=`echo $@ | sed -e 's/configure-build-//'`; \ - if [ ! -d $(BUILD_SUBDIR) ]; then \ - true; \ - elif [ -f $(BUILD_SUBDIR)/$${dir}/Makefile ] ; then \ - true; \ - elif echo " $(BUILD_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \ - if [ -d $(srcdir)/$${dir} ]; then \ - [ -d $(BUILD_SUBDIR)/$${dir} ] || mkdir $(BUILD_SUBDIR)/$${dir};\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - AR="$(AR_FOR_BUILD)"; export AR; \ - AS="$(AS_FOR_BUILD)"; export AS; \ - CC="$(CC_FOR_BUILD)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ - CXX="$(CXX_FOR_BUILD)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \ - LD="$(LD_FOR_BUILD)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \ - NM="$(NM_FOR_BUILD)"; export NM; \ - RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \ - echo Configuring in $(BUILD_SUBDIR)/$${dir}; \ - cd "$(BUILD_SUBDIR)/$${dir}" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(BUILD_SUBDIR)" in \ +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/libada/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libada ; \ + rm -f $(TARGET_SUBDIR)/libada/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/libada/multilib.out + +configure-target-libada: $(TARGET_SUBDIR)/libada/multilib.out + @test ! -f $(TARGET_SUBDIR)/libada/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libada ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \ + CXX="$(CXX_FOR_TARGET)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/libada; \ + cd "$(TARGET_SUBDIR)/libada" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ .) topdir="../$(srcdir)" ;; \ *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(BUILD_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ - else \ - srcdiroption="--srcdir=$${topdir}/$${dir}"; \ - libsrcdir="$$s/$${dir}"; \ - fi; \ - if [ -f $${libsrcdir}/configure ] ; then \ - rm -f no-such-file skip-this-dir; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ - --with-build-subdir="$(BUILD_SUBDIR)"; \ - else \ - rm -f no-such-file skip-this-dir; \ - CONFIG_SITE=no-such-file $(SHELL) $$s/configure \ - $(BUILD_CONFIGARGS) $${srcdiroption} \ - --with-build-subdir="$(BUILD_SUBDIR)"; \ - fi || exit 1; \ - if [ -f skip-this-dir ] ; then \ - sh skip-this-dir; \ - rm -f skip-this-dir; \ - cd ..; rmdir $${dir} || true; \ - else \ - true; \ - fi; \ - else \ - true; \ - fi; \ - else \ - true; \ - fi - -# This rule is used to build the modules which use FLAGS_TO_PASS. To -# build a target all-X means to cd to X and make all. -# -# all-gui, and all-libproc are handled specially because -# they are still experimental, and if they fail to build, that -# shouldn't stop "make all". -.PHONY: $(ALL_MODULES) all-gui all-libproc -$(ALL_MODULES) all-gui all-libproc: - @dir=`echo $@ | sed -e 's/all-//'`; \ - if [ -f ./$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) all); \ - else \ - true; \ - fi + esac ;; \ + esac; \ + srcdiroption="--srcdir=$${topdir}/libada"; \ + libsrcdir="$$s/libada"; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 -# These rules are used to check the modules which use FLAGS_TO_PASS. -# To build a target check-X means to cd to X and make check. Some -# modules are only tested in a native toolchain. - -.PHONY: $(CHECK_MODULES) $(NATIVE_CHECK_MODULES) $(CROSS_CHECK_MODULES) -$(NATIVE_CHECK_MODULES): - @if [ '$(host_canonical)' = '$(target_canonical)' ] ; then \ - dir=`echo $@ | sed -e 's/check-//'`; \ - if [ -f ./$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \ - else \ - true; \ - fi; \ - fi +.PHONY: all-target-libada maybe-all-target-libada +maybe-all-target-libada: +all-target-libada: configure-target-libada + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) all) -$(CROSS_CHECK_MODULES): - @dir=`echo $@ | sed -e 's/check-//'`; \ - if [ -f ./$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) check); \ - else \ - true; \ - fi +.PHONY: check-target-libada maybe-check-target-libada +maybe-check-target-libada: -# This rule is used to install the modules which use FLAGS_TO_PASS. -# To build a target install-X means to cd to X and make install. -.PHONY: $(INSTALL_MODULES) -$(INSTALL_MODULES): installdirs - @dir=`echo $@ | sed -e 's/install-//'`; \ - if [ -f ./$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \ - else \ - true; \ - fi +check-target-libada: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) check) -# This rule is used to configure the modules which are built with the -# target tools. -.PHONY: $(CONFIGURE_TARGET_MODULES) -$(CONFIGURE_TARGET_MODULES): - @dir=`echo $@ | sed -e 's/configure-target-//'`; \ - if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \ - r=`${PWD}`; export r; \ - $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \ - if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \ - if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \ - if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \ - rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \ - else \ - echo "Multilibs changed for $${dir}, reconfiguring"; \ - rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \ - mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \ - fi; \ - else \ - mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \ - fi; \ - fi; \ - fi; exit 0 # break command into two pieces - @dir=`echo $@ | sed -e 's/configure-target-//'`; \ - if [ ! -d $(TARGET_SUBDIR) ]; then \ - true; \ - elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ - true; \ - elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \ - if [ -d $(srcdir)/$${dir} ]; then \ - [ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - AR="$(AR_FOR_TARGET)"; export AR; \ - AS="$(AS_FOR_TARGET)"; export AS; \ - CC="$(CC_FOR_TARGET)"; export CC; \ - CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ - CXX="$(CXX_FOR_TARGET)"; export CXX; \ - CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ - GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ - DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ - LD="$(LD_FOR_TARGET)"; export LD; \ - LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ - NM="$(NM_FOR_TARGET)"; export NM; \ - RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ - WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ - echo Configuring in $(TARGET_SUBDIR)/$${dir}; \ - cd "$(TARGET_SUBDIR)/$${dir}" || exit 1; \ - case $(srcdir) in \ - /* | [A-Za-z]:[\\/]*) \ - topdir=$(srcdir) ;; \ - *) \ - case "$(TARGET_SUBDIR)" in \ - .) topdir="../$(srcdir)" ;; \ - *) topdir="../../$(srcdir)" ;; \ - esac ;; \ - esac; \ - if [ "$(srcdir)" = "." ] ; then \ - if [ "$(TARGET_SUBDIR)" != "." ] ; then \ - if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \ - if [ -f Makefile ]; then \ - if $(MAKE) distclean; then \ - true; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - else \ - exit 1; \ - fi; \ - else \ - true; \ - fi; \ - srcdiroption="--srcdir=."; \ - libsrcdir="."; \ - else \ - srcdiroption="--srcdir=$${topdir}/$${dir}"; \ - libsrcdir="$$s/$${dir}"; \ - fi; \ - if [ -f $${libsrcdir}/configure ] ; then \ - rm -f no-such-file skip-this-dir; \ - CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)"; \ - else \ - rm -f no-such-file skip-this-dir; \ - CONFIG_SITE=no-such-file $(SHELL) $$s/configure \ - $(TARGET_CONFIGARGS) $${srcdiroption} \ - --with-target-subdir="$(TARGET_SUBDIR)"; \ - fi || exit 1; \ - if [ -f skip-this-dir ] ; then \ - sh skip-this-dir; \ - rm -f skip-this-dir; \ - cd ..; rmdir $${dir} || true; \ - else \ - true; \ - fi; \ - else \ - true; \ - fi; \ - else \ - true; \ - fi -# This rule is used to build the modules which use TARGET_FLAGS_TO_PASS. -# To build a target all-X means to cd to X and make all. -.PHONY: $(ALL_TARGET_MODULES) -$(ALL_TARGET_MODULES): - @dir=`echo $@ | sed -e 's/all-target-//'`; \ - if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/$${dir}; \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \ - else \ - true; \ - fi +.PHONY: install-target-libada maybe-install-target-libada +maybe-install-target-libada: -# This rule is used to check the modules which use TARGET_FLAGS_TO_PASS. -# To build a target install-X means to cd to X and make install. -.PHONY: $(CHECK_TARGET_MODULES) -$(CHECK_TARGET_MODULES): - @dir=`echo $@ | sed -e 's/check-target-//'`; \ - if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/$${dir}; \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\ - else \ - true; \ - fi +install-target-libada: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/libada && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) -# This rule is used to install the modules which use -# TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X -# and make install. -.PHONY: $(INSTALL_TARGET_MODULES) -$(INSTALL_TARGET_MODULES): installdirs - @dir=`echo $@ | sed -e 's/install-target-//'`; \ - if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $(TARGET_SUBDIR)/$${dir}; \ - $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \ - else \ - true; \ - fi -# This rule is used to build the modules which use X11_FLAGS_TO_PASS. -# To build a target all-X means to cd to X and make all. -.PHONY: $(ALL_X11_MODULES) -$(ALL_X11_MODULES): - @dir=`echo $@ | sed -e 's/all-//'`; \ - if [ -f ./$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $${dir}; \ - $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) all); \ - else \ - true; \ - fi -# This rule is used to check the modules which use X11_FLAGS_TO_PASS. -# To build a target check-X means to cd to X and make all. -.PHONY: $(CHECK_X11_MODULES) -$(CHECK_X11_MODULES): - @dir=`echo $@ | sed -e 's/check-//'`; \ - if [ -f ./$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $${dir}; \ - $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) check); \ - else \ - true; \ - fi +# ---------- +# GCC module +# ---------- -# This rule is used to install the modules which use X11_FLAGS_TO_PASS. -# To build a target install-X means to cd to X and make install. -.PHONY: $(INSTALL_X11_MODULES) -$(INSTALL_X11_MODULES): installdirs - @dir=`echo $@ | sed -e 's/install-//'`; \ - if [ -f ./$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd $${dir}; \ - $(MAKE) $(FLAGS_TO_PASS) $(X11_FLAGS_TO_PASS) install); \ - else \ - true; \ - fi +# Unfortunately, while gcc _should_ be a host module, +# libgcc is a target module, and gen* programs are +# build modules. So GCC is a sort of hybrid. # gcc is the only module which uses GCC_FLAGS_TO_PASS. -.PHONY: all-gcc -all-gcc: - @if [ -f ./gcc/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ +# Don't use shared host config.cache, as it will confuse later +# directories; GCC wants slightly different values for some +# precious variables. *sigh* +.PHONY: configure-gcc maybe-configure-gcc +maybe-configure-gcc: +configure-gcc: + @test ! -f gcc/Makefile || exit 0; \ + [ -d gcc ] || mkdir gcc; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in gcc; \ + cd gcc || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/gcc"; \ + libsrcdir="$$s/gcc";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/gcc"; \ + libsrcdir="$$s/gcc";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +# Don't 'make all' in gcc if it's already been made by 'bootstrap'; that +# causes trouble. This wart will be fixed eventually by moving +# the bootstrap behavior to this file. +.PHONY: all-gcc maybe-all-gcc +maybe-all-gcc: +all-gcc: configure-gcc + @if [ -f gcc/stage_last ] ; then \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(SET_LIB_PATH) \ - (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) all); \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \ else \ - true; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \ fi # Building GCC uses some tools for rebuilding "source" files @@ -1541,543 +23688,293 @@ all-gcc: # In theory, on an SMP all those dependencies can be resolved # 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-bootstrap - @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ +GCC_STRAP_TARGETS = bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap +.PHONY: $(GCC_STRAP_TARGETS) +$(GCC_STRAP_TARGETS): all-bootstrap configure-gcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(SET_LIB_PATH) \ echo "Bootstrapping the compiler"; \ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@ - @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ case "$@" in \ *bootstrap4-lean ) \ - msg="Comparing stage3 and stage4 of the compiler"; \ - compare=compare3-lean ;; \ - *bootstrap4 ) msg="Comparing stage3 and stage4 of the compiler"; \ - compare=compare3 ;; \ - *-lean ) msg="Comparing stage2 and stage3 of the compiler"; \ - compare=compare-lean ;; \ - * ) msg="Comparing stage2 and stage3 of the compiler"; \ - compare=compare ;; \ + msg="Comparing stage3 and stage4 of the compiler"; \ + compare=compare3-lean ;; \ + *bootstrap4 ) \ + msg="Comparing stage3 and stage4 of the compiler"; \ + compare=compare3 ;; \ + *-lean ) \ + msg="Comparing stage2 and stage3 of the compiler"; \ + compare=compare-lean ;; \ + * ) \ + msg="Comparing stage2 and stage3 of the compiler"; \ + compare=compare ;; \ esac; \ $(SET_LIB_PATH) \ echo "$$msg"; \ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare - @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}` ; export s; \ + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ $(SET_LIB_PATH) \ echo "Building runtime libraries"; \ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all +profiledbootstrap: all-bootstrap configure-gcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Bootstrapping the compiler"; \ + cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ + $(SET_LIB_PATH) \ + echo "Building runtime libraries and training compiler"; \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Building feedback based compiler"; \ + cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build + .PHONY: cross cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld - @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(SET_LIB_PATH) \ echo "Building the C and C++ compiler"; \ cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" - @r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}` ; export s; \ + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ $(SET_LIB_PATH) \ echo "Building runtime libraries"; \ $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \ LANGUAGES="c c++" all -.PHONY: check-gcc +.PHONY: check-gcc maybe-check-gcc +maybe-check-gcc: check-gcc: @if [ -f ./gcc/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(SET_LIB_PATH) \ - (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check); \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check); \ else \ true; \ fi -.PHONY: check-c++ -check-c++: +.PHONY: check-gcc-c++ +check-gcc-c++: @if [ -f ./gcc/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(SET_LIB_PATH) \ - (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \ - $(MAKE) check-target-libstdc++-v3; \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \ else \ true; \ - fi + fi + +.PHONY: check-c++ +check-c++: check-target-libstdc++-v3 check-gcc-c++ -.PHONY: install-gcc +.PHONY: install-gcc maybe-install-gcc +maybe-install-gcc: install-gcc: @if [ -f ./gcc/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ $(SET_LIB_PATH) \ - (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ else \ true; \ fi -.PHONY: install-gcc-cross -install-gcc-cross: - @if [ -f ./gcc/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ - $(SET_LIB_PATH) \ - (cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" install); \ - else \ - true; \ - fi -# EXPERIMENTAL STUFF -# This rule is used to install the modules which use FLAGS_TO_PASS. -# To build a target install-X means to cd to X and make install. -.PHONY: install-dosrel -install-dosrel: installdirs info - @dir=`echo $@ | sed -e 's/install-//'`; \ - if [ -f ./$${dir}/Makefile ] ; then \ - r=`${PWD}`; export r; \ - s=`cd $(srcdir); ${PWD}`; export s; \ +# Install the gcc headers files, but not the fixed include files, +# which Cygnus is not allowed to distribute. This rule is very +# dependent on the workings of the gcc Makefile.in. +.PHONY: gcc-no-fixedincludes +gcc-no-fixedincludes: + @if [ -f ./gcc/Makefile ]; then \ + rm -rf gcc/tmp-include; \ + mv gcc/include gcc/tmp-include 2>/dev/null; \ + mkdir gcc/include; \ + cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ + touch gcc/stmp-fixinc gcc/include/fixed; \ + rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ $(SET_LIB_PATH) \ - (cd $${dir}; $(MAKE) $(FLAGS_TO_PASS) install); \ - else \ - true; \ - fi + (cd ./gcc && \ + $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ + rm -rf gcc/include; \ + mv gcc/tmp-include gcc/include 2>/dev/null; \ + else true; fi -install-dosrel-fake: - -ALL_GCC = all-gcc -ALL_GCC_C = $(ALL_GCC) all-target-newlib all-target-libgloss -ALL_GCC_CXX = $(ALL_GCC_C) all-target-libstdc++-v3 - -# This is a list of inter-dependencies among modules. -all-ash: -all-autoconf: all-m4 all-texinfo -all-automake: all-m4 all-texinfo -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-boehm-gc: $(ALL_GCC_C) configure-target-qthreads -all-target-boehm-gc: configure-target-boehm-gc -all-byacc: -all-bzip2: -all-db: -all-dejagnu: all-tcl all-expect all-tk -all-diff: all-libiberty -all-etc: -configure-target-examples: $(ALL_GCC_C) -all-target-examples: configure-target-examples -all-expect: all-tcl all-tk -all-fileutils: all-libiberty -all-findutils: -all-find: -all-flex: all-libiberty all-bison all-byacc -all-gas: all-libiberty all-opcodes all-bfd all-intl -all-gawk: -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_CXX) -all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++-v3 -all-gprof: all-libiberty all-bfd all-opcodes all-intl -all-grep: all-libiberty -all-gui: all-gdb all-libproc -all-guile: -all-gzip: all-libiberty -all-hello: all-libiberty -all-indent: -all-intl: -all-itcl: all-tcl all-tk -all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl -configure-target-libgloss: $(ALL_GCC) -all-target-libgloss: configure-target-libgloss configure-target-newlib -all-libgui: all-tcl all-tk all-itcl -all-libiberty: +# -------------------------------------- +# Dependencies between different modules +# -------------------------------------- -all-build-libiberty: configure-build-libiberty +# There are two types of dependencies here: 'hard' dependencies, where one +# module simply won't build without the other; and 'soft' dependencies, where +# if the depended-on module is missing, the depending module will do without +# or find a substitute somewhere (perhaps installed). Soft dependencies +# are specified by depending on a 'maybe-' target. If you're not sure, +# it's safer to use a soft dependency. -configure-target-libffi: $(ALL_GCC_C) -all-target-libffi: configure-target-libffi -configure-target-libjava: $(ALL_GCC_C) configure-target-zlib configure-target-boehm-gc configure-target-qthreads configure-target-libffi -all-target-libjava: configure-target-libjava all-fastjar all-target-zlib all-target-boehm-gc all-target-qthreads all-target-libffi -configure-target-libstdc++-v3: $(ALL_GCC_C) -all-target-libstdc++-v3: configure-target-libstdc++-v3 all-target-libiberty -all-libtool: +# Host modules specific to gcc. +# GCC needs to identify certain tools. +# GCC also needs the information exported by the intl configure script. +configure-gcc: maybe-configure-intl maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex +all-gcc: maybe-all-libiberty maybe-all-intl maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib +# This is a slightly kludgy method of getting dependencies on +# all-build-libiberty correct; it would be better to build it every time. +all-gcc: maybe-all-build-libiberty +all-bootstrap: maybe-all-libiberty maybe-all-intl maybe-all-texinfo maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib + +# Host modules specific to gdb. +# GDB needs to know that the simulator is being built. +configure-gdb: maybe-configure-itcl maybe-configure-tcl maybe-configure-tk maybe-configure-sim +GDB_TK = @GDB_TK@ +all-gdb: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-mmalloc maybe-all-readline maybe-all-bison maybe-all-byacc maybe-all-sim $(gdbnlmrequirements) $(GDB_TK) +install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui +configure-libgui: maybe-configure-tcl maybe-configure-tk +all-libgui: maybe-all-tcl maybe-all-tk maybe-all-itcl + +# Host modules specific to binutils. +configure-bfd: configure-libiberty +all-bfd: maybe-all-libiberty maybe-all-intl +all-binutils: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-flex maybe-all-bison maybe-all-byacc maybe-all-intl +# We put install-opcodes before install-binutils because the installed +# binutils might be on PATH, and they might need the shared opcodes +# library. +install-binutils: maybe-install-opcodes +# libopcodes depends on libbfd +install-opcodes: maybe-install-bfd +all-gas: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-intl +all-gprof: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-intl +all-ld: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-intl +all-opcodes: maybe-all-bfd maybe-all-libiberty + +# Other host modules in the 'src' repository. +all-dejagnu: maybe-all-tcl maybe-all-expect maybe-all-tk +configure-expect: maybe-configure-tcl maybe-configure-tk +all-expect: maybe-all-tcl maybe-all-tk +configure-itcl: maybe-configure-tcl maybe-configure-tk +all-itcl: maybe-all-tcl maybe-all-tk +# We put install-tcl before install-itcl because itcl wants to run a +# program on installation which uses the Tcl libraries. +install-itcl: maybe-install-tcl +all-sid: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-tcl maybe-all-tk +install-sid: maybe-install-tcl maybe-install-tk +all-sim: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-readline maybe-configure-gdb +configure-tk: maybe-configure-tcl +all-tk: maybe-all-tcl +configure-tix: maybe-configure-tcl maybe-configure-tk +all-tix: maybe-all-tcl maybe-all-tk +all-texinfo: maybe-all-libiberty + +# Other host modules. Warning, these are not well tested. +all-autoconf: maybe-all-m4 maybe-all-texinfo +all-automake: maybe-all-m4 maybe-all-texinfo +all-bison: maybe-all-texinfo +all-diff: maybe-all-libiberty +all-fastjar: maybe-all-zlib maybe-all-libiberty +all-fileutils: maybe-all-libiberty +all-flex: maybe-all-libiberty maybe-all-bison maybe-all-byacc +all-gzip: maybe-all-libiberty +all-hello: maybe-all-libiberty +all-m4: maybe-all-libiberty maybe-all-texinfo +all-make: maybe-all-libiberty maybe-all-intl +all-patch: maybe-all-libiberty +all-prms: maybe-all-libiberty +all-recode: maybe-all-libiberty +all-sed: maybe-all-libiberty +all-send-pr: maybe-all-prms +all-tar: maybe-all-libiberty +all-uudecode: maybe-all-libiberty + +ALL_GCC = maybe-all-gcc +ALL_GCC_C = $(ALL_GCC) maybe-all-target-newlib maybe-all-target-libgloss +ALL_GCC_CXX = $(ALL_GCC_C) maybe-all-target-libstdc++-v3 + +# Target modules specific to gcc. +configure-target-boehm-gc: $(ALL_GCC_C) maybe-configure-target-qthreads +configure-target-fastjar: maybe-configure-target-zlib +all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty configure-target-libf2c: $(ALL_GCC_C) -all-target-libf2c: configure-target-libf2c all-target-libiberty +all-target-libf2c: maybe-all-target-libiberty +configure-target-libffi: $(ALL_GCC_C) +configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi +all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi configure-target-libobjc: $(ALL_GCC_C) -all-target-libobjc: configure-target-libobjc all-target-libiberty -all-m4: all-libiberty all-texinfo -all-make: all-libiberty -all-mmalloc: -configure-target-newlib: $(ALL_GCC) -all-target-newlib: configure-target-newlib +all-target-libobjc: maybe-all-target-libiberty +configure-target-libstdc++-v3: $(ALL_GCC_C) +all-target-libstdc++-v3: maybe-all-target-libiberty +configure-target-zlib: $(ALL_GCC_C) + +# Target modules in the 'src' repository. +configure-target-examples: $(ALL_GCC_C) +configure-target-libgloss: $(ALL_GCC) +all-target-libgloss: maybe-configure-target-newlib +configure-target-libiberty: $(ALL_GCC) configure-target-libtermcap: $(ALL_GCC_C) -all-target-libtermcap: configure-target-libtermcap -all-opcodes: all-bfd all-libiberty -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-sid: all-tcl all-tk -all-sim: all-libiberty all-bfd all-opcodes all-readline -all-snavigator: all-tcl all-tk all-itcl all-tix all-db all-grep all-libgui -all-tar: all-libiberty -all-tcl: -all-tclX: all-tcl all-tk -all-tk: all-tcl -all-texinfo: all-libiberty -all-textutils: -all-time: -all-tix: all-tcl all-tk -all-wdiff: +configure-target-newlib: $(ALL_GCC) +configure-target-rda: $(ALL_GCC_C) configure-target-winsup: $(ALL_GCC_C) -all-target-winsup: all-target-libiberty all-target-libtermcap configure-target-winsup -all-uudecode: all-libiberty -all-zip: -all-zlib: -configure-target-zlib: $(ALL_GCC_C) -all-target-zlib: configure-target-zlib -all-fastjar: all-zlib all-libiberty -configure-target-fastjar: configure-target-zlib -all-target-fastjar: configure-target-fastjar all-target-zlib all-target-libiberty -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 +all-target-winsup: maybe-all-target-libiberty maybe-all-target-libtermcap -MAKEDIRS= \ - $(DESTDIR)$(prefix) \ - $(DESTDIR)$(exec_prefix) -.PHONY: installdirs -installdirs: mkinstalldirs - $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS) +# Other target modules. Warning, these are not well tested. +configure-target-gperf: $(ALL_GCC_CXX) +all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3 +configure-target-qthreads: $(ALL_GCC_C) -dir.info: do-install-info - if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \ - $(srcdir)/texinfo/gen-info-dir $(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \ - mv -f dir.info.new dir.info ; \ - else true ; \ - fi +# Dependencies of maybe-foo on foo. These are used because, for example, +# all-gcc only depends on all-gas if gas is present and being configured. +@maybe_dependencies@ -dist: - @echo "Building a full distribution of this tree isn't done" - @echo "via 'make dist'. Check out the etc/ subdirectory" +# Serialization dependencies. Host configures don't work well in parallel to +# each other, due to contention over config.cache. Target configures and +# build configures are similar. +@serialization_dependencies@ -etags tags: TAGS +# -------------------------------- +# Regenerating top level configury +# -------------------------------- -# Right now this just builds TAGS in each subdirectory. emacs19 has the -# ability to use several tags files at once, so there is probably no need -# to combine them into one big TAGS file (like CVS 1.3 does). We could -# (if we felt like it) have this Makefile write a piece of elisp which -# the user could load to tell emacs19 where all the TAGS files we just -# built are. -TAGS: do-TAGS +# Multilib.out tells target dirs what multilibs they should build. +# There is really only one copy. We use the 'timestamp' method to +# work around various timestamp bugs on some systems. +# We use move-if-change so that it's only considered updated when it +# actually changes, because it has to depend on a phony target. +multilib.out: maybe-all-gcc + @r=`${PWD_COMMAND}`; export r; \ + echo "Checking multilib configuration..."; \ + $(CC_FOR_TARGET) --print-multi-lib > multilib.tmp 2> /dev/null ; \ + $(SHELL) $(srcdir)/move-if-change multilib.tmp multilib.out ; \ -# with the gnu make, this is done automatically. +# Rebuilding Makefile.in, using autogen. +AUTOGEN = autogen +$(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def + cd $(srcdir) && $(AUTOGEN) Makefile.def -Makefile: Makefile.in configure.in $(host_makefile_frag) $(target_makefile_frag) $(gcc_version_trigger) - $(SHELL) ./config.status +# Rebuilding Makefile. +Makefile: $(srcdir)/Makefile.in config.status + CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status -# -# Support for building net releases - -# Files in devo 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). -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 \ - 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.* - - -# 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 - -# NOTE: No double quotes in the below. It is used within shell script -# as VER="$(VER)" -VER = ` if grep 'AM_INIT_AUTOMAKE.*BFD_VERSION' $(TOOL)/configure.in >/dev/null 2>&1; then \ - sed < bfd/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \ - elif grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \ - sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \ - elif test -f $(TOOL)/version.in; then \ - head -1 $(TOOL)/version.in; \ - elif grep VERSION $(TOOL)/Makefile.in > /dev/null 2>&1; then \ - sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \ - else \ - echo VERSION; \ - fi` -PACKAGE = $(TOOL) - -.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 \ - TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ - MD5PROG="$(MD5PROG)" \ - SUPPORT_FILES="$(SUPPORT_FILES)" - $(MAKE) -f Makefile.in do-bz2 \ - TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ - MD5PROG="$(MD5PROG)" \ - SUPPORT_FILES="$(SUPPORT_FILES)" - -.PHONY: gdb-tar -gdb-tar: $(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 \ - TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ - MD5PROG="$(MD5PROG)" \ - SUPPORT_FILES="$(SUPPORT_FILES)" - -.PHONY: gdb-taz -gdb-taz: gdb-tar $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex - $(MAKE) -f Makefile.in gdb-tar \ - TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ - MD5PROG="$(MD5PROG)" \ - SUPPORT_FILES="$(SUPPORT_FILES)" - $(MAKE) -f Makefile.in do-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' \ - tmp - mv -f tmp Makefile.in - # - ./configure sun4 - [ -z "$(CONFIGURE_TARGET_MODULES)" ] \ - || $(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 - set -e ; dirs="$(TOOL) $(DEVO_SUPPORT) $(SUPPORT_FILES)" ; \ - for d in $$dirs ; do \ - if [ -d $$d ]; then \ - if [ ! -f $$d/Makefile ] ; then true ; \ - elif grep '^diststuff:' $$d/Makefile >/dev/null ; then \ - (cd $$d ; $(MAKE) diststuff ) || exit 1 ; \ - elif grep '^info:' $$d/Makefile >/dev/null ; then \ - (cd $$d ; $(MAKE) info ) || exit 1 ; \ - fi ; \ - if [ -d $$d/proto-$$d.dir ]; then \ - ln -s ../$$d/proto-$$d.dir proto-toplev/$$d ; \ - else \ - ln -s ../$$d proto-toplev/$$d ; \ - fi ; \ - else ln -s ../$$d proto-toplev/$$d ; fi ; \ - done - cd etc && $(MAKE) info - $(MAKE) distclean - # - mkdir proto-toplev/etc - (cd proto-toplev/etc; \ - for i in $(ETC_SUPPORT); do \ - ln -s ../../etc/$$i . ; \ - done) - # - # Take out texinfo from configurable dirs - rm proto-toplev/configure.in - sed -e '/^host_tools=/s/texinfo //' \ - proto-toplev/configure.in - # - mkdir proto-toplev/texinfo - ln -s ../../texinfo/texinfo.tex proto-toplev/texinfo/ - if test -r texinfo/util/tex3patch ; then \ - mkdir proto-toplev/texinfo/util && \ - ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \ - else true; fi - chmod -R og=u . || chmod og=u `find . -print` - # - # Create .gmo files from .po files. - for f in `find . -name '*.po' -type f -print`; do \ - msgfmt -o `echo $$f | sed -e 's/\.po$$/.gmo/'` $$f ; \ - done - # - -rm -f $(PACKAGE)-$(VER) - ln -s proto-toplev $(PACKAGE)-$(VER) - -.PHONY: do-tar -do-tar: - echo "==> Making $(PACKAGE)-$(VER).tar" - -rm -f $(PACKAGE)-$(VER).tar - find $(PACKAGE)-$(VER) -follow -name CVS -prune -o -type f -print \ - | tar cTfh - $(PACKAGE)-$(VER).tar - -.PHONY: do-bz2 -do-bz2: - echo "==> Bzipping $(PACKAGE)-$(VER).tar.bz2" - -rm -f $(PACKAGE)-$(VER).tar.bz2 - $(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) - -.PHONY: gas.tar.bz2 -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. -.PHONY: binutils.tar.bz2 -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)" - -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 gdb-taz TOOL=gdb \ - MD5PROG="$(MD5PROG)" \ - SUPPORT_FILES="$(GDB_SUPPORT_DIRS)" -.PHONY: gdb.tar -gdb.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb - $(MAKE) -f Makefile.in gdb-tar TOOL=gdb \ - MD5PROG="$(MD5PROG)" \ - SUPPORT_FILES="$(GDB_SUPPORT_DIRS)" - -DEJAGNU_SUPPORT_DIRS= tcl expect libiberty -.PHONY: dejagnu.tar.bz2 -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 gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \ - MD5PROG="$(MD5PROG)" \ - SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)" -.PHONY: gdb+dejagnu.tar -gdb+dejagnu.tar: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb - $(MAKE) -f Makefile.in gdb-tar 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 gdb-taz TOOL=gdb PACKAGE=insight \ - MD5PROG="$(MD5PROG)" \ - SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)" -.PHONY: insight.tar -insight.tar: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb - $(MAKE) -f Makefile.in gdb-tar 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 gdb-taz TOOL=gdb PACKAGE="insight+dejagnu" \ - MD5PROG="$(MD5PROG)" \ - SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)" -.PHONY: insight+dejagnu.tar -insight+dejagnu.tar: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb - $(MAKE) -f Makefile.in gdb-tar TOOL=gdb PACKAGE="insight+dejagnu" \ - MD5PROG="$(MD5PROG)" \ - SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)" - -.PHONY: newlib.tar.bz2 -NEWLIB_SUPPORT_DIRS=libgloss -# taz configures for the sun4 target which won't configure newlib. -# We need newlib configured so that the .info files are made. -# Unfortunately, it is not enough to just configure newlib separately: -# taz will build the .info files but since SUBDIRS won't contain newlib, -# distclean won't be run (leaving Makefile, config.status, and the tmp files -# used in building the .info files, eg: *.def, *.ref). -# The problem isn't solvable however without a lot of extra work because -# target libraries are built in subdir $(target_alias) which gets nuked during -# the make distclean. For now punt on the issue of shipping newlib info files -# with newlib net releases and wait for a day when some native target (sun4?) -# 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 +config.status: configure $(gcc_version_trigger) + CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck + +# Rebuilding configure. +AUTOCONF = autoconf +$(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4 + cd $(srcdir) && $(AUTOCONF) + +# ------------------------------ +# Special directives to GNU Make +# ------------------------------ +# Don't pass command-line variables to submakes. .NOEXPORT: MAKEOVERRIDES= diff --git a/contrib/binutils/Makefile.tpl b/contrib/binutils/Makefile.tpl new file mode 100644 index 0000000..3a7750c --- /dev/null +++ b/contrib/binutils/Makefile.tpl @@ -0,0 +1,1435 @@ +[+ AutoGen5 template -*- Mode: Makefile -*- +in ++] + +# Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'. +# +# Makefile for directory with subdirs to build. +# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, +# 1999, 2000, 2001, 2002, 2003 Free Software Foundation +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# 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. +# + +# ------------------------------- +# Standard Autoconf-set variables +# ------------------------------- +VPATH=@srcdir@ + +build_alias=@build_alias@ +build=@build@ +host_alias=@host_alias@ +host=@host@ +target_alias=@target_alias@ +target=@target@ + +program_transform_name = @program_transform_name@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +srcdir = @srcdir@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +includedir = @includedir@ +oldincludedir = @oldincludedir@ +infodir = @infodir@ +mandir = @mandir@ +man1dir = $(mandir)/man1 +man2dir = $(mandir)/man2 +man3dir = $(mandir)/man3 +man4dir = $(mandir)/man4 +man5dir = $(mandir)/man5 +man6dir = $(mandir)/man6 +man7dir = $(mandir)/man7 +man8dir = $(mandir)/man8 +man9dir = $(mandir)/man9 + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_DATA = @INSTALL_DATA@ + +# ------------------------------------------------- +# Miscellaneous non-standard autoconf-set variables +# ------------------------------------------------- + +links=@configlinks@ +# The file containing GCC's version number. +gcc_version_trigger = @gcc_version_trigger@ +gcc_version = @gcc_version@ + +# The gcc driver likes to know the arguments it was configured with. +TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@ + +gxx_include_dir = @gxx_include_dir@ +libstdcxx_incdir = @libstdcxx_incdir@ + +tooldir = @tooldir@ +build_tooldir = @build_tooldir@ + +# Directory in which the compiler finds executables, libraries, etc. +libsubdir = $(libdir)/gcc/$(target_alias)/$(gcc_version) +GDB_NLM_DEPS = + +# This is the name of the environment variable used for the path to +# the libraries. +RPATH_ENVVAR = @RPATH_ENVVAR@ + +# This is set by configure to REALLY_SET_LIB_PATH if --enable-shared +# was used. +SET_LIB_PATH = @SET_LIB_PATH@ + +# 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 = \ + $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); + +# This is the list of directories to be built for the build system. +BUILD_CONFIGDIRS = libiberty +# Build programs are put under this directory. +BUILD_SUBDIR = @build_subdir@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the build system. +BUILD_CONFIGARGS = @build_configargs@ + +# This is the list of directories to built for the host system. +SUBDIRS = @configdirs@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the host system. +HOST_CONFIGARGS = @host_configargs@ + +# This is set by the configure script to the list of directories which +# should be built using the target tools. +TARGET_CONFIGDIRS = @target_configdirs@ +# Target libraries are put under this directory: +TARGET_SUBDIR = @target_subdir@ +# This is set by the configure script to the arguments to use when configuring +# directories built for the target. +TARGET_CONFIGARGS = @target_configargs@ + +# ---------------------------------------------- +# Programs producing files for the BUILD machine +# ---------------------------------------------- + +SHELL = @config_shell@ + +# pwd command to use. Allow user to override default by setting PWDCMD in +# the environment to account for automounters. The make variable must not +# be called PWDCMD, otherwise the value set here is passed to make +# subprocesses and overrides the setting from the user's environment. +# Don't use PWD since it is a common shell environment variable and we +# don't want to corrupt it. +PWD_COMMAND = $${PWDCMD-pwd} + +# compilers to use to create programs which must be run in the build +# environment. +CC_FOR_BUILD = @CC_FOR_BUILD@ +CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@ + +CXX_FOR_BUILD = $(CXX) + +# Special variables passed down in EXTRA_GCC_FLAGS. They are defined +# here so that they can be overridden by Makefile fragments. +BUILD_PREFIX = @BUILD_PREFIX@ +BUILD_PREFIX_1 = @BUILD_PREFIX_1@ + +BISON=@BISON@ +USUAL_BISON = `if [ -f $$r/bison/bison ] ; then \ + echo $$r/bison/bison -L $$s/bison/ ; \ + else \ + echo bison ; \ + fi` + +DEFAULT_YACC = @DEFAULT_YACC@ +YACC=@YACC@ +USUAL_YACC = `if [ -f $$r/bison/bison ] ; then \ + echo $$r/bison/bison -y -L $$s/bison/ ; \ + elif [ -f $$r/byacc/byacc ] ; then \ + echo $$r/byacc/byacc ; \ + else \ + echo ${DEFAULT_YACC} ; \ + fi` + +DEFAULT_LEX = @DEFAULT_LEX@ +LEX=@LEX@ +USUAL_LEX = `if [ -f $$r/flex/flex ] ; \ + then echo $$r/flex/flex ; \ + else echo ${DEFAULT_LEX} ; fi` + +DEFAULT_M4 = @DEFAULT_M4@ +M4 = `if [ -f $$r/m4/m4 ] ; \ + then echo $$r/m4/m4 ; \ + else echo ${DEFAULT_M4} ; fi` + +# For an installed makeinfo, we require it to be from texinfo 4.2 or +# higher, else we use the "missing" dummy. +MAKEINFO=@MAKEINFO@ +USUAL_MAKEINFO = `if [ -f $$r/texinfo/makeinfo/makeinfo ] ; \ + then echo $$r/texinfo/makeinfo/makeinfo ; \ + else if (makeinfo --version \ + | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[2-9]|[5-9])') >/dev/null 2>&1; \ + then echo makeinfo; else echo $$s/missing makeinfo; fi; fi` + +# This just becomes part of the MAKEINFO definition passed down to +# sub-makes. It lets flags be given on the command line while still +# using the makeinfo from the object tree. +# (Default to avoid splitting info files by setting the threshold high.) +MAKEINFOFLAGS = --split-size=5000000 + +EXPECT = `if [ -f $$r/expect/expect ] ; \ + then echo $$r/expect/expect ; \ + else echo expect ; fi` + +RUNTEST = `if [ -f $$s/dejagnu/runtest ] ; \ + then echo $$s/dejagnu/runtest ; \ + else echo runtest ; fi` + +# --------------------------------------------- +# Programs producing files for the HOST machine +# --------------------------------------------- + +# 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 + +AS = @AS@ + +AR = @AR@ +AR_FLAGS = rc + +CC = @CC@ +CFLAGS = @CFLAGS@ +LIBCFLAGS = $(CFLAGS) + +CXX = @CXX@ +CXXFLAGS = @CXXFLAGS@ +LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates + +DLLTOOL = @DLLTOOL@ + +NM = @NM@ + +LD = @LD@ +LDFLAGS = + +RANLIB = @RANLIB@ + +WINDRES = @WINDRES@ + +PICFLAG = + +# ----------------------------------------------- +# Programs producing files for the TARGET machine +# ----------------------------------------------- + +# 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: + +FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@ + +AR_FOR_TARGET=@AR_FOR_TARGET@ +USUAL_AR_FOR_TARGET = ` \ + if [ -f $$r/binutils/ar ] ; then \ + echo $$r/binutils/ar ; \ + else \ + if [ '$(host)' = '$(target)' ] ; then \ + echo $(AR); \ + else \ + echo ar | sed '$(program_transform_name)' ; \ + fi; \ + fi` + +AS_FOR_TARGET=@AS_FOR_TARGET@ +USUAL_AS_FOR_TARGET = ` \ + if [ -f $$r/gas/as-new ] ; then \ + echo $$r/gas/as-new ; \ + elif [ -f $$r/gcc/xgcc ]; then \ + $(CC_FOR_TARGET) -print-prog-name=as ; \ + else \ + if [ '$(host)' = '$(target)' ] ; then \ + echo $(AS); \ + else \ + echo as | sed '$(program_transform_name)' ; \ + fi; \ + fi` + +CC_FOR_TARGET = @CC_FOR_TARGET@ +# During gcc bootstrap, if we use some random cc for stage1 then +# CFLAGS will be just -g. We want to ensure that TARGET libraries +# (which we know are built with gcc) are built with optimizations so +# prepend -O2 when setting CFLAGS_FOR_TARGET. +CFLAGS_FOR_TARGET = -O2 $(CFLAGS) +# 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=@GCC_FOR_TARGET@ +USUAL_GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET) +LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET) + +CXX_FOR_TARGET = @CXX_FOR_TARGET@ +RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@ +CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ +RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@ +CXXFLAGS_FOR_TARGET = $(CXXFLAGS) +LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates + +DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@ +USUAL_DLLTOOL_FOR_TARGET = ` \ + if [ -f $$r/binutils/dlltool ] ; then \ + echo $$r/binutils/dlltool ; \ + else \ + if [ '$(host)' = '$(target)' ] ; then \ + echo $(DLLTOOL); \ + else \ + echo dlltool | sed '$(program_transform_name)' ; \ + fi; \ + fi` + +GCJ_FOR_TARGET = @GCJ_FOR_TARGET@ + +LD_FOR_TARGET=@LD_FOR_TARGET@ +USUAL_LD_FOR_TARGET = ` \ + if [ -f $$r/ld/ld-new ] ; then \ + echo $$r/ld/ld-new ; \ + elif [ -f $$r/gcc/xgcc ]; then \ + $(CC_FOR_TARGET) -print-prog-name=ld ; \ + else \ + if [ '$(host)' = '$(target)' ] ; then \ + echo $(LD); \ + else \ + echo ld | sed '$(program_transform_name)' ; \ + fi; \ + fi` + +LDFLAGS_FOR_TARGET = + +NM_FOR_TARGET=@NM_FOR_TARGET@ +USUAL_NM_FOR_TARGET = ` \ + if [ -f $$r/binutils/nm-new ] ; then \ + echo $$r/binutils/nm-new ; \ + elif [ -f $$r/gcc/xgcc ]; then \ + $(CC_FOR_TARGET) -print-prog-name=nm ; \ + else \ + if [ '$(host)' = '$(target)' ] ; then \ + echo $(NM); \ + else \ + echo nm | sed '$(program_transform_name)' ; \ + fi; \ + fi` + +RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@ +USUAL_RANLIB_FOR_TARGET = ` \ + if [ -f $$r/binutils/ranlib ] ; then \ + echo $$r/binutils/ranlib ; \ + else \ + if [ '$(host)' = '$(target)' ] ; then \ + if [ x'$(RANLIB)' != x ]; then \ + echo $(RANLIB); \ + else \ + echo ranlib; \ + fi; \ + else \ + echo ranlib | sed '$(program_transform_name)' ; \ + fi; \ + fi` + +WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@ +USUAL_WINDRES_FOR_TARGET = ` \ + if [ -f $$r/binutils/windres ] ; then \ + echo $$r/binutils/windres ; \ + else \ + if [ '$(host)' = '$(target)' ] ; then \ + echo $(WINDRES); \ + else \ + echo windres | sed '$(program_transform_name)' ; \ + fi; \ + fi` + +PICFLAG_FOR_TARGET = + +# ------------------------------------ +# Miscellaneous targets and flag lists +# ------------------------------------ + +# The first rule in the file had better be this one. Don't put any above it. +# This lives here to allow makefile fragments to contain dependencies. +all: all.normal +.PHONY: all + +#### host and target specific makefile fragments come in here. +@target_makefile_frag@ +@alphaieee_frag@ +@ospace_frag@ +@host_makefile_frag@ +### + +# Flags to pass down to all sub-makes. +BASE_FLAGS_TO_PASS = [+ FOR flags_to_pass +]\ + "[+flag+]=$([+flag+])" [+ ENDFOR flags_to_pass +]\ + "CONFIG_SHELL=$(SHELL)" \ + "MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" + +# For any flags above that may contain shell code that varies from one +# target library to another. When doing recursive invocations of the +# top-level Makefile, we don't want the outer make to evaluate them, +# so we pass these variables down unchanged. They must not contain +# single nor double quotes. +RECURSE_FLAGS = \ + CXX_FOR_TARGET='$(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \ + RAW_CXX_FOR_TARGET='$(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE)' \ + +# Flags to pass down to most sub-makes, in which we're building with +# the host environment. +EXTRA_HOST_FLAGS = \ + 'AR=$(AR)' \ + 'AS=$(AS)' \ + 'CC=$(CC)' \ + 'CXX=$(CXX)' \ + 'DLLTOOL=$(DLLTOOL)' \ + 'LD=$(LD)' \ + 'NM=$(NM)' \ + 'RANLIB=$(RANLIB)' \ + 'WINDRES=$(WINDRES)' + +FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) + +# Flags that are concerned with the location of the X11 include files +# and library files +# +# NOTE: until the top-level is getting the values via autoconf, it only +# causes problems to have this top-level Makefile overriding the autoconf-set +# values in child directories. Only variables that don't conflict with +# autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now. +# +X11_FLAGS_TO_PASS = \ + 'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \ + 'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)' + +# Flags to pass down to makes which are built with the target environment. +# The double $ decreases the length of the command line; the variables +# are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them. +EXTRA_TARGET_FLAGS = \ + 'AR=$$(AR_FOR_TARGET)' \ + 'AS=$$(AS_FOR_TARGET)' \ + 'CC=$$(CC_FOR_TARGET)' \ + 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \ + 'CXX=$$(CXX_FOR_TARGET)' \ + 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \ + 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ + 'LD=$$(LD_FOR_TARGET)' \ + 'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \ + 'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \ + 'NM=$$(NM_FOR_TARGET)' \ + 'RANLIB=$$(RANLIB_FOR_TARGET)' \ + 'WINDRES=$$(WINDRES_FOR_TARGET)' + +TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS) + +# Flags to pass down to gcc. gcc builds a library, libgcc.a, so it +# unfortunately needs the native compiler and the target ar and +# ranlib. +# If any variables are added here, they must be added to do-*, below. +# The BUILD_* variables are a special case, which are used for the gcc +# cross-building scheme. +EXTRA_GCC_FLAGS = \ + 'BUILD_PREFIX=$(BUILD_PREFIX)' \ + 'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \ + "GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \ + "CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \ + "`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s/.*=$$/XFOO=/`" \ + "`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s/.*=$$/XFOO=/`" \ + "`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s/.*=$$/XFOO=/`" \ + "`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ + "`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ + "`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \ + "`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ + "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \ + "`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s/.*=$$/XFOO=/`" + +GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS) + +.PHONY: configure-host +configure-host: maybe-configure-gcc [+ + FOR host_modules +] \ + maybe-configure-[+module+][+ + ENDFOR host_modules +] +.PHONY: configure-target +configure-target: [+ + FOR target_modules +] \ + maybe-configure-target-[+module+][+ + ENDFOR target_modules +] + +# The target built for a native build. +.PHONY: all.normal +all.normal: @all_build_modules@ all-host all-target + +.PHONY: all-host +all-host: maybe-all-gcc [+ + FOR host_modules +] \ + maybe-all-[+module+][+ + ENDFOR host_modules +] +.PHONY: all-target +all-target: [+ + FOR target_modules +] \ + maybe-all-target-[+module+][+ + ENDFOR target_modules +] + +# Do a target for all the subdirectories. A ``make do-X'' will do a +# ``make X'' in all subdirectories (because, in general, there is a +# dependency (below) of X upon do-X, a ``make X'' will also do this, +# but it may do additional work as well). +[+ FOR recursive_targets +] +.PHONY: do-[+make_target+] +do-[+make_target+]: [+make_target+]-host [+make_target+]-target + +.PHONY: [+make_target+]-host +[+make_target+]-host: maybe-[+make_target+]-gcc [+ + FOR host_modules +] \ + maybe-[+make_target+]-[+module+][+ + ENDFOR host_modules +] + +.PHONY: [+make_target+]-target +[+make_target+]-target: [+ + FOR target_modules +] \ + maybe-[+make_target+]-target-[+module+][+ + ENDFOR target_modules +] + +# GCC, the eternal special case +.PHONY: maybe-[+make_target+]-gcc [+make_target+]-gcc +maybe-[+make_target+]-gcc: +[+make_target+]-gcc: [+ + FOR depend +]\ + [+depend+]-gcc [+ + ENDFOR depend +] + @[ -f ./gcc/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_GCC_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing [+make_target+] in gcc" ; \ + (cd gcc && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + [+make_target+]) \ + || exit 1 + +# Host modules. +[+ FOR host_modules +] +.PHONY: maybe-[+make_target+]-[+module+] [+make_target+]-[+module+] +maybe-[+make_target+]-[+module+]: +[+ IF (match-value? = "missing" (get "make_target") ) +] +# [+module+] doesn't support [+make_target+]. +[+make_target+]-[+module+]: +[+ ELSE +] +[+make_target+]-[+module+]: [+ + FOR depend +]\ + [+depend+]-[+module+] [+ + ENDFOR depend +] + @[ -f ./[+module+]/Makefile ] || exit 0; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + for flag in $(EXTRA_HOST_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + echo "Doing [+make_target+] in [+module+]" ; \ + (cd [+module+] && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + [+make_target+]) \ + || exit 1 +[+ ENDIF +] +[+ ENDFOR host_modules +] + +# Target modules. +[+ FOR target_modules +] +.PHONY: maybe-[+make_target+]-target-[+module+] [+make_target+]-target-[+module+] +maybe-[+make_target+]-target-[+module+]: +[+ IF (match-value? = "missing" (get "make_target") ) +] +# [+module+] doesn't support [+make_target+]. +[+make_target+]-target-[+module+]: +[+ ELSE +] +[+make_target+]-target-[+module+]: [+ + FOR depend +]\ + [+depend+]-target-[+module+] [+ + ENDFOR depend +] + @[ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] || exit 0 ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Doing [+make_target+] in $(TARGET_SUBDIR)/[+module+]" ; \ + for flag in $(EXTRA_TARGET_FLAGS); do \ + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \ + done; \ + (cd $(TARGET_SUBDIR)/[+module+] && \ + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \ + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ + "RANLIB=$${RANLIB}" \ + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ + [+make_target+]) \ + || exit 1 +[+ ENDIF +] +[+ ENDFOR target_modules +] +[+ ENDFOR recursive_targets +] + +# Here are the targets which correspond to the do-X targets. + +.PHONY: info installcheck dvi install-info +.PHONY: clean distclean mostlyclean maintainer-clean realclean +.PHONY: local-clean local-distclean local-maintainer-clean +info: do-info +installcheck: do-installcheck +dvi: do-dvi + +# Make sure makeinfo is built before we do a `make info', if we're +# in fact building texinfo. +do-info: maybe-all-texinfo + +install-info: do-install-info dir.info + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + if [ -f dir.info ] ; then \ + $(INSTALL_DATA) dir.info $(DESTDIR)$(infodir)/dir.info ; \ + else true ; fi + +local-clean: + -rm -f *.a TEMP errs core *.o *~ \#* TAGS *.E *.log + +local-distclean: + -rm -f Makefile config.status config.cache mh-frag mt-frag + -rm -f multilib.out multilib.tmp maybedep.tmp serdep.tmp + -if [ "$(TARGET_SUBDIR)" != "." ]; then \ + rm -rf $(TARGET_SUBDIR); \ + else true; fi + -rm -rf $(BUILD_SUBDIR) + -rm -f texinfo/po/Makefile texinfo/po/Makefile.in texinfo/info/Makefile + -rm -f texinfo/doc/Makefile texinfo/po/POTFILES + -rmdir texinfo/doc texinfo/info texinfo/intl texinfo/lib 2>/dev/null + -rmdir texinfo/makeinfo texinfo/po texinfo/util 2>/dev/null + -rmdir fastjar gcc libiberty texinfo zlib 2>/dev/null + +local-maintainer-clean: + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +clean: do-clean local-clean +mostlyclean: do-mostlyclean local-clean +distclean: do-distclean local-clean local-distclean +maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean +maintainer-clean: local-distclean +realclean: maintainer-clean + +# Extra dependency for clean-target, owing to the mixed nature of gcc +clean-target: 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. + +.PHONY: check do-check +check: do-check + +# Only include modules actually being configured and built. +do-check: maybe-check-gcc [+ + FOR host_modules +] \ + maybe-check-[+module+][+ + ENDFOR host_modules +][+ + FOR target_modules +] \ + maybe-check-target-[+module+][+ + ENDFOR target_modules +] + +# Automated reporting of test results. + +warning.log: build.log + $(srcdir)/contrib/warn_summary build.log > $@ + +mail-report.log: + if test x'$(BOOT_CFLAGS)' != x''; then \ + BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ + fi; \ + $(srcdir)/contrib/test_summary -t >$@ + chmod +x $@ + echo If you really want to send e-mail, run ./$@ now + +mail-report-with-warnings.log: warning.log + if test x'$(BOOT_CFLAGS)' != x''; then \ + BOOT_CFLAGS='$(BOOT_CFLAGS)'; export BOOT_CFLAGS; \ + fi; \ + $(srcdir)/contrib/test_summary -t -i warning.log >$@ + chmod +x $@ + echo If you really want to send e-mail, run ./$@ now + +# Installation targets. + +.PHONY: install uninstall +install: installdirs install-host install-target + +.PHONY: install-host-nogcc +install-host-nogcc: [+ + FOR host_modules +] \ + maybe-install-[+module+][+ + ENDFOR host_modules +] + +.PHONY: install-host +install-host: maybe-install-gcc [+ + FOR host_modules +] \ + maybe-install-[+module+][+ + ENDFOR host_modules +] + +.PHONY: install-target +install-target: [+ + FOR target_modules +] \ + maybe-install-target-[+module+][+ + ENDFOR target_modules +] + +uninstall: + @echo "the uninstall target is not supported in this tree" + +.PHONY: install.all +install.all: install-no-fixedincludes + @if [ -f ./gcc/Makefile ] ; then \ + r=`${PWD_COMMAND}` ; export r ; \ + $(SET_LIB_PATH) \ + (cd ./gcc && \ + $(MAKE) $(FLAGS_TO_PASS) install-headers) ; \ + else \ + true ; \ + fi + +# install-no-fixedincludes is used because Cygnus can not distribute +# the fixed header files. +.PHONY: install-no-fixedincludes +install-no-fixedincludes: installdirs install-host-nogcc \ + install-target gcc-no-fixedincludes + +### other supporting targets + +MAKEDIRS= \ + $(DESTDIR)$(prefix) \ + $(DESTDIR)$(exec_prefix) +.PHONY: installdirs +installdirs: mkinstalldirs + $(SHELL) $(srcdir)/mkinstalldirs $(MAKEDIRS) + +dir.info: do-install-info + if [ -f $(srcdir)/texinfo/gen-info-dir ] ; then \ + $(srcdir)/texinfo/gen-info-dir $(DESTDIR)$(infodir) $(srcdir)/texinfo/dir.info-template > dir.info.new ; \ + mv -f dir.info.new dir.info ; \ + else true ; \ + fi + +dist: + @echo "Building a full distribution of this tree isn't done" + @echo "via 'make dist'. Check out the etc/ subdirectory" + +etags tags: TAGS + +# Right now this just builds TAGS in each subdirectory. emacs19 has the +# ability to use several tags files at once, so there is probably no need +# to combine them into one big TAGS file (like CVS 1.3 does). We could +# (if we felt like it) have this Makefile write a piece of elisp which +# the user could load to tell emacs19 where all the TAGS files we just +# built are. +TAGS: do-TAGS + +# -------------------------------------- +# Modules which run on the build machine +# -------------------------------------- +[+ FOR build_modules +] +.PHONY: configure-build-[+module+] maybe-configure-build-[+module+] +maybe-configure-build-[+module+]: +configure-build-[+module+]: + @test ! -f $(BUILD_SUBDIR)/[+module+]/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(BUILD_SUBDIR)/[+module+] ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + AR="$(AR_FOR_BUILD)"; export AR; \ + AS="$(AS_FOR_BUILD)"; export AS; \ + CC="$(CC_FOR_BUILD)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX_FOR_BUILD)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \ + LD="$(LD_FOR_BUILD)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \ + NM="$(NM_FOR_BUILD)"; export NM; \ + RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \ + echo Configuring in $(BUILD_SUBDIR)/[+module+]; \ + cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(BUILD_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \ + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(BUILD_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \ + srcdiroption="--srcdir=$${topdir}/[+module+]"; \ + libsrcdir="$$s/[+module+]"; \ + fi; \ + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(BUILD_CONFIGARGS) $${srcdiroption} \ + --with-build-subdir="$(BUILD_SUBDIR)" \ + || exit 1 + +.PHONY: all-build-[+module+] maybe-all-build-[+module+] +maybe-all-build-[+module+]: +all-build-[+module+]: configure-build-[+module+] + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all) +[+ ENDFOR build_modules +] + +# -------------------------------------- +# Modules which run on the host machine +# -------------------------------------- +[+ FOR host_modules +] +.PHONY: configure-[+module+] maybe-configure-[+module+] +maybe-configure-[+module+]: +configure-[+module+]: + @test ! -f [+module+]/Makefile || exit 0; \ + [ -d [+module+] ] || mkdir [+module+]; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in [+module+]; \ + cd [+module+] || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/[+module+]"; \ + libsrcdir="$$s/[+module+]";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/[+module+]"; \ + libsrcdir="$$s/[+module+]";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +.PHONY: all-[+module+] maybe-all-[+module+] +maybe-all-[+module+]: +all-[+module+]: configure-[+module+] + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ + IF with_x + +] $(X11_FLAGS_TO_PASS)[+ + ENDIF with_x +] all) + +.PHONY: check-[+module+] maybe-check-[+module+] +maybe-check-[+module+]: +[+ IF no_check +] +check-[+module+]: +[+ ELIF no_check_cross +] +# This module is only tested in a native toolchain. +check-[+module+]: + @if [ '$(host)' = '$(target)' ] ; then \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ + IF with_x + +] $(X11_FLAGS_TO_PASS)[+ + ENDIF with_x +] check); \ + fi +[+ ELSE check +] +check-[+module+]: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ + IF with_x + +] $(X11_FLAGS_TO_PASS)[+ + ENDIF with_x +] check) +[+ ENDIF no_check +] + +.PHONY: install-[+module+] maybe-install-[+module+] +maybe-install-[+module+]: +[+ IF no_install +] +install-[+module+]: +[+ ELSE install +] +install-[+module+]: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd [+module+] && $(MAKE) $(FLAGS_TO_PASS)[+ + IF with_x + +] $(X11_FLAGS_TO_PASS)[+ + ENDIF with_x +] install) +[+ ENDIF no_install +] +[+ ENDFOR host_modules +] + +# --------------------------------------- +# Modules which run on the target machine +# --------------------------------------- +[+ FOR target_modules +] +.PHONY: configure-target-[+module+] maybe-configure-target-[+module+] +maybe-configure-target-[+module+]: + +# There's only one multilib.out. Cleverer subdirs shouldn't need it copied. +$(TARGET_SUBDIR)/[+module+]/multilib.out: multilib.out + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \ + rm -f $(TARGET_SUBDIR)/[+module+]/Makefile || : ; \ + cp multilib.out $(TARGET_SUBDIR)/[+module+]/multilib.out + +configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/multilib.out + @test ! -f $(TARGET_SUBDIR)/[+module+]/Makefile || exit 0; \ + $(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/[+module+] ; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + AR="$(AR_FOR_TARGET)"; export AR; \ + AS="$(AS_FOR_TARGET)"; export AS; \ + CC="$(CC_FOR_TARGET)"; export CC; \ + CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \[+ +IF raw_cxx +] + CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \ + CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \[+ +ELSE normal_cxx +] + CXX="$(CXX_FOR_TARGET)"; export CXX; \[+ +ENDIF raw_cxx +] + CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ + GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \ + DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \ + LD="$(LD_FOR_TARGET)"; export LD; \ + LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \ + NM="$(NM_FOR_TARGET)"; export NM; \ + RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ + WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ + echo Configuring in $(TARGET_SUBDIR)/[+module+]; \ + cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \ + case $(srcdir) in \ + /* | [A-Za-z]:[\\/]*) \ + topdir=$(srcdir) ;; \ + *) \ + case "$(TARGET_SUBDIR)" in \ + .) topdir="../$(srcdir)" ;; \ + *) topdir="../../$(srcdir)" ;; \ + esac ;; \ + esac; \[+ IF stage +] + if [ "$(srcdir)" = "." ] ; then \ + if [ "$(TARGET_SUBDIR)" != "." ] ; then \ + if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \ + if [ -f Makefile ]; then \ + if $(MAKE) distclean; then \ + true; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + else \ + exit 1; \ + fi; \ + else \ + true; \ + fi; \ + srcdiroption="--srcdir=."; \ + libsrcdir="."; \ + else \[+ ENDIF stage +] + srcdiroption="--srcdir=$${topdir}/[+module+]"; \ + libsrcdir="$$s/[+module+]"; \[+ IF stage +] + fi; \[+ ENDIF stage +] + rm -f no-such-file || : ; \ + CONFIG_SITE=no-such-file $(SHELL) $${libsrcdir}/configure \ + $(TARGET_CONFIGARGS) $${srcdiroption} \ + --with-target-subdir="$(TARGET_SUBDIR)" \ + || exit 1 + +.PHONY: all-target-[+module+] maybe-all-target-[+module+] +maybe-all-target-[+module+]: +all-target-[+module+]: configure-target-[+module+] + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/[+module+] && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) [+ + IF raw_cxx + +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ + ENDIF raw_cxx + +] all) + +.PHONY: check-target-[+module+] maybe-check-target-[+module+] +maybe-check-target-[+module+]: +[+ IF no_check +] +# Dummy target for uncheckable module. +check-target-[+module+]: +[+ ELSE check +] +check-target-[+module+]: + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/[+module+] && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) [+ + IF raw_cxx + +] 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)' [+ + ENDIF raw_cxx + +] check) +[+ ENDIF no_check +] + +.PHONY: install-target-[+module+] maybe-install-target-[+module+] +maybe-install-target-[+module+]: +[+ IF no_install +] +# Dummy target for uninstallable. +install-target-[+module+]: +[+ ELSE install +] +install-target-[+module+]: installdirs + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd $(TARGET_SUBDIR)/[+module+] && \ + $(MAKE) $(TARGET_FLAGS_TO_PASS) install) +[+ ENDIF no_install +] +[+ ENDFOR target_modules +] + +# ---------- +# GCC module +# ---------- + +# Unfortunately, while gcc _should_ be a host module, +# libgcc is a target module, and gen* programs are +# build modules. So GCC is a sort of hybrid. + +# gcc is the only module which uses GCC_FLAGS_TO_PASS. +# Don't use shared host config.cache, as it will confuse later +# directories; GCC wants slightly different values for some +# precious variables. *sigh* +.PHONY: configure-gcc maybe-configure-gcc +maybe-configure-gcc: +configure-gcc: + @test ! -f gcc/Makefile || exit 0; \ + [ -d gcc ] || mkdir gcc; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + CC="$(CC)"; export CC; \ + CFLAGS="$(CFLAGS)"; export CFLAGS; \ + CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ + CXX="$(CXX)"; export CXX; \ + CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ + TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \ + AR="$(AR)"; export AR; \ + AS="$(AS)"; export AS; \ + CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \ + DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \ + LD="$(LD)"; export LD; \ + LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \ + NM="$(NM)"; export NM; \ + RANLIB="$(RANLIB)"; export RANLIB; \ + WINDRES="$(WINDRES)"; export WINDRES; \ + OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \ + OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \ + echo Configuring in gcc; \ + cd gcc || exit 1; \ + case $(srcdir) in \ + \.) \ + srcdiroption="--srcdir=."; \ + libsrcdir=".";; \ + /* | [A-Za-z]:[\\/]*) \ + srcdiroption="--srcdir=$(srcdir)/gcc"; \ + libsrcdir="$$s/gcc";; \ + *) \ + srcdiroption="--srcdir=../$(srcdir)/gcc"; \ + libsrcdir="$$s/gcc";; \ + esac; \ + $(SHELL) $${libsrcdir}/configure \ + $(HOST_CONFIGARGS) $${srcdiroption} \ + || exit 1 + +# Don't 'make all' in gcc if it's already been made by 'bootstrap'; that +# causes trouble. This wart will be fixed eventually by moving +# the bootstrap behavior to this file. +.PHONY: all-gcc maybe-all-gcc +maybe-all-gcc: +all-gcc: configure-gcc + @if [ -f gcc/stage_last ] ; then \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) quickstrap); \ + else \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) all); \ + fi + +# Building GCC uses some tools for rebuilding "source" files +# like texinfo, bison/byacc, etc. So we must depend on those. +# +# While building GCC, it may be necessary to run various target +# programs like the assembler, linker, etc. So we depend on +# those too. +# +# In theory, on an SMP all those dependencies can be resolved +# in parallel. +# +GCC_STRAP_TARGETS = bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean bubblestrap quickstrap cleanstrap restrap +.PHONY: $(GCC_STRAP_TARGETS) +$(GCC_STRAP_TARGETS): all-bootstrap configure-gcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Bootstrapping the compiler"; \ + cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@ + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + case "$@" in \ + *bootstrap4-lean ) \ + msg="Comparing stage3 and stage4 of the compiler"; \ + compare=compare3-lean ;; \ + *bootstrap4 ) \ + msg="Comparing stage3 and stage4 of the compiler"; \ + compare=compare3 ;; \ + *-lean ) \ + msg="Comparing stage2 and stage3 of the compiler"; \ + compare=compare-lean ;; \ + * ) \ + msg="Comparing stage2 and stage3 of the compiler"; \ + compare=compare ;; \ + esac; \ + $(SET_LIB_PATH) \ + echo "$$msg"; \ + cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ + $(SET_LIB_PATH) \ + echo "Building runtime libraries"; \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all + +profiledbootstrap: all-bootstrap configure-gcc + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Bootstrapping the compiler"; \ + cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stageprofile_build + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ + $(SET_LIB_PATH) \ + echo "Building runtime libraries and training compiler"; \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) all + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Building feedback based compiler"; \ + cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) stagefeedback_build + +.PHONY: cross +cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + echo "Building the C and C++ compiler"; \ + cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" + @r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ + $(SET_LIB_PATH) \ + echo "Building runtime libraries"; \ + $(MAKE) $(BASE_FLAGS_TO_PASS) $(RECURSE_FLAGS) \ + LANGUAGES="c c++" all + +.PHONY: check-gcc maybe-check-gcc +maybe-check-gcc: +check-gcc: + @if [ -f ./gcc/Makefile ] ; then \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check); \ + else \ + true; \ + fi + +.PHONY: check-gcc-c++ +check-gcc-c++: + @if [ -f ./gcc/Makefile ] ; then \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \ + else \ + true; \ + fi + +.PHONY: check-c++ +check-c++: check-target-libstdc++-v3 check-gcc-c++ + +.PHONY: install-gcc maybe-install-gcc +maybe-install-gcc: +install-gcc: + @if [ -f ./gcc/Makefile ] ; then \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \ + $(SET_LIB_PATH) \ + (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ + else \ + true; \ + fi + +# Install the gcc headers files, but not the fixed include files, +# which Cygnus is not allowed to distribute. This rule is very +# dependent on the workings of the gcc Makefile.in. +.PHONY: gcc-no-fixedincludes +gcc-no-fixedincludes: + @if [ -f ./gcc/Makefile ]; then \ + rm -rf gcc/tmp-include; \ + mv gcc/include gcc/tmp-include 2>/dev/null; \ + mkdir gcc/include; \ + cp $(srcdir)/gcc/gsyslimits.h gcc/include/syslimits.h; \ + touch gcc/stmp-fixinc gcc/include/fixed; \ + rm -f gcc/stmp-headers gcc/stmp-int-hdrs; \ + r=`${PWD_COMMAND}`; export r; \ + s=`cd $(srcdir); ${PWD_COMMAND}` ; export s; \ + $(SET_LIB_PATH) \ + (cd ./gcc && \ + $(MAKE) $(GCC_FLAGS_TO_PASS) install); \ + rm -rf gcc/include; \ + mv gcc/tmp-include gcc/include 2>/dev/null; \ + else true; fi + +# -------------------------------------- +# Dependencies between different modules +# -------------------------------------- + +# There are two types of dependencies here: 'hard' dependencies, where one +# module simply won't build without the other; and 'soft' dependencies, where +# if the depended-on module is missing, the depending module will do without +# or find a substitute somewhere (perhaps installed). Soft dependencies +# are specified by depending on a 'maybe-' target. If you're not sure, +# it's safer to use a soft dependency. + +# Host modules specific to gcc. +# GCC needs to identify certain tools. +# GCC also needs the information exported by the intl configure script. +configure-gcc: maybe-configure-intl maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex +all-gcc: maybe-all-libiberty maybe-all-intl maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib +# This is a slightly kludgy method of getting dependencies on +# all-build-libiberty correct; it would be better to build it every time. +all-gcc: maybe-all-build-libiberty +all-bootstrap: maybe-all-libiberty maybe-all-intl maybe-all-texinfo maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib + +# Host modules specific to gdb. +# GDB needs to know that the simulator is being built. +configure-gdb: maybe-configure-itcl maybe-configure-tcl maybe-configure-tk maybe-configure-sim +GDB_TK = @GDB_TK@ +all-gdb: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-mmalloc maybe-all-readline maybe-all-bison maybe-all-byacc maybe-all-sim $(gdbnlmrequirements) $(GDB_TK) +install-gdb: maybe-install-tcl maybe-install-tk maybe-install-itcl maybe-install-tix maybe-install-libgui +configure-libgui: maybe-configure-tcl maybe-configure-tk +all-libgui: maybe-all-tcl maybe-all-tk maybe-all-itcl + +# Host modules specific to binutils. +configure-bfd: configure-libiberty +all-bfd: maybe-all-libiberty maybe-all-intl +all-binutils: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-flex maybe-all-bison maybe-all-byacc maybe-all-intl +# We put install-opcodes before install-binutils because the installed +# binutils might be on PATH, and they might need the shared opcodes +# library. +install-binutils: maybe-install-opcodes +# libopcodes depends on libbfd +install-opcodes: maybe-install-bfd +all-gas: maybe-all-libiberty maybe-all-opcodes maybe-all-bfd maybe-all-intl +all-gprof: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-intl +all-ld: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-bison maybe-all-byacc maybe-all-flex maybe-all-intl +all-opcodes: maybe-all-bfd maybe-all-libiberty + +# Other host modules in the 'src' repository. +all-dejagnu: maybe-all-tcl maybe-all-expect maybe-all-tk +configure-expect: maybe-configure-tcl maybe-configure-tk +all-expect: maybe-all-tcl maybe-all-tk +configure-itcl: maybe-configure-tcl maybe-configure-tk +all-itcl: maybe-all-tcl maybe-all-tk +# We put install-tcl before install-itcl because itcl wants to run a +# program on installation which uses the Tcl libraries. +install-itcl: maybe-install-tcl +all-sid: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-tcl maybe-all-tk +install-sid: maybe-install-tcl maybe-install-tk +all-sim: maybe-all-libiberty maybe-all-bfd maybe-all-opcodes maybe-all-readline maybe-configure-gdb +configure-tk: maybe-configure-tcl +all-tk: maybe-all-tcl +configure-tix: maybe-configure-tcl maybe-configure-tk +all-tix: maybe-all-tcl maybe-all-tk +all-texinfo: maybe-all-libiberty + +# Other host modules. Warning, these are not well tested. +all-autoconf: maybe-all-m4 maybe-all-texinfo +all-automake: maybe-all-m4 maybe-all-texinfo +all-bison: maybe-all-texinfo +all-diff: maybe-all-libiberty +all-fastjar: maybe-all-zlib maybe-all-libiberty +all-fileutils: maybe-all-libiberty +all-flex: maybe-all-libiberty maybe-all-bison maybe-all-byacc +all-gzip: maybe-all-libiberty +all-hello: maybe-all-libiberty +all-m4: maybe-all-libiberty maybe-all-texinfo +all-make: maybe-all-libiberty maybe-all-intl +all-patch: maybe-all-libiberty +all-prms: maybe-all-libiberty +all-recode: maybe-all-libiberty +all-sed: maybe-all-libiberty +all-send-pr: maybe-all-prms +all-tar: maybe-all-libiberty +all-uudecode: maybe-all-libiberty + +ALL_GCC = maybe-all-gcc +ALL_GCC_C = $(ALL_GCC) maybe-all-target-newlib maybe-all-target-libgloss +ALL_GCC_CXX = $(ALL_GCC_C) maybe-all-target-libstdc++-v3 + +# Target modules specific to gcc. +configure-target-boehm-gc: $(ALL_GCC_C) maybe-configure-target-qthreads +configure-target-fastjar: maybe-configure-target-zlib +all-target-fastjar: maybe-all-target-zlib maybe-all-target-libiberty +configure-target-libf2c: $(ALL_GCC_C) +all-target-libf2c: maybe-all-target-libiberty +configure-target-libffi: $(ALL_GCC_C) +configure-target-libjava: $(ALL_GCC_C) maybe-configure-target-zlib maybe-configure-target-boehm-gc maybe-configure-target-qthreads maybe-configure-target-libffi +all-target-libjava: maybe-all-fastjar maybe-all-target-zlib maybe-all-target-boehm-gc maybe-all-target-qthreads maybe-all-target-libffi +configure-target-libobjc: $(ALL_GCC_C) +all-target-libobjc: maybe-all-target-libiberty +configure-target-libstdc++-v3: $(ALL_GCC_C) +all-target-libstdc++-v3: maybe-all-target-libiberty +configure-target-zlib: $(ALL_GCC_C) + +# Target modules in the 'src' repository. +configure-target-examples: $(ALL_GCC_C) +configure-target-libgloss: $(ALL_GCC) +all-target-libgloss: maybe-configure-target-newlib +configure-target-libiberty: $(ALL_GCC) +configure-target-libtermcap: $(ALL_GCC_C) +configure-target-newlib: $(ALL_GCC) +configure-target-rda: $(ALL_GCC_C) +configure-target-winsup: $(ALL_GCC_C) +all-target-winsup: maybe-all-target-libiberty maybe-all-target-libtermcap + +# Other target modules. Warning, these are not well tested. +configure-target-gperf: $(ALL_GCC_CXX) +all-target-gperf: maybe-all-target-libiberty maybe-all-target-libstdc++-v3 +configure-target-qthreads: $(ALL_GCC_C) + +# Dependencies of maybe-foo on foo. These are used because, for example, +# all-gcc only depends on all-gas if gas is present and being configured. +@maybe_dependencies@ + +# Serialization dependencies. Host configures don't work well in parallel to +# each other, due to contention over config.cache. Target configures and +# build configures are similar. +@serialization_dependencies@ + +# -------------------------------- +# Regenerating top level configury +# -------------------------------- + +# Multilib.out tells target dirs what multilibs they should build. +# There is really only one copy. We use the 'timestamp' method to +# work around various timestamp bugs on some systems. +# We use move-if-change so that it's only considered updated when it +# actually changes, because it has to depend on a phony target. +multilib.out: maybe-all-gcc + @r=`${PWD_COMMAND}`; export r; \ + echo "Checking multilib configuration..."; \ + $(CC_FOR_TARGET) --print-multi-lib > multilib.tmp 2> /dev/null ; \ + $(SHELL) $(srcdir)/move-if-change multilib.tmp multilib.out ; \ + +# Rebuilding Makefile.in, using autogen. +AUTOGEN = autogen +$(srcdir)/Makefile.in: @MAINT@ $(srcdir)/Makefile.tpl $(srcdir)/Makefile.def + cd $(srcdir) && $(AUTOGEN) Makefile.def + +# Rebuilding Makefile. +Makefile: $(srcdir)/Makefile.in config.status + CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +config.status: configure $(gcc_version_trigger) + CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck + +# Rebuilding configure. +AUTOCONF = autoconf +$(srcdir)/configure: @MAINT@ $(srcdir)/configure.in $(srcdir)/config/acx.m4 + cd $(srcdir) && $(AUTOCONF) + +# ------------------------------ +# Special directives to GNU Make +# ------------------------------ + +# Don't pass command-line variables to submakes. +.NOEXPORT: +MAKEOVERRIDES= + +# end of Makefile.in diff --git a/contrib/binutils/README-maintainer-mode b/contrib/binutils/README-maintainer-mode index fbe508f..0115a1e 100644 --- a/contrib/binutils/README-maintainer-mode +++ b/contrib/binutils/README-maintainer-mode @@ -3,7 +3,7 @@ Note that if you configure with --enable-maintainer-mode, you will need special versions of automake, autoconf, libtool and gettext. You will -find the sources for these in ftp://sourceware.cygnus.com/pub/binutils. +find the sources for these in ftp://sources.redhat.com/pub/binutils. Note - "make distclean" does not work with maintainer mode enabled. The Makefiles in the some of the po/ subdirectories depend upon the diff --git a/contrib/binutils/bfd/ChangeLog b/contrib/binutils/bfd/ChangeLog index 6c92f76..04a27e1 100644 --- a/contrib/binutils/bfd/ChangeLog +++ b/contrib/binutils/bfd/ChangeLog @@ -1,4632 +1,1233 @@ -2002-11-27 David O'Brien +2004-05-17 Daniel Jacobowitz - * elf.c (_bfd_elf_copy_private_section_data): Don't define bed. - -2002-11-21 Richard Henderson - - * elflink.h (elf_link_add_object_symbols): Don't overwrite the - arch's st_other bits when merging visibilities. - (elf_link_output_extsym): Tidy clearing of visibility field. - -2002-11-14 David O'Brien - - Merge from mainline: - 2002-11-12 Thomas Moestl - * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Correct - references to large plt symbols. - -2002-11-13 Alan Modra - - Merge from mainline. - 2002-11-07 Alan Modra - * elf64-ppc.c: Comment typo fixes. - (ppc64_elf_merge_private_bfd_data): Allow BFD_ENDIAN_UNKNOWN input. - -2002-11-11 Nick Clifton - - Import this patch from mainline: - - 2002-09-19 Nick Clifton - - * elflink.h (elf_fix_symbol_flags): When examining weak symbols, - follow indirect links. - -2002-11-07 Daniel Jacobowitz - - * configure.in: Clear is_release on the branch after release. - -2002-11-07 Daniel Jacobowitz - - * configure.in: Bump version and set is_release. + * configure.in: Mark unreleased for post-2.15 snapshots. * configure: Regenerate. -2002-11-07 Nick Clifton - - * po/da.po: Updated Danish translation. - -2002-11-07 Graeme Peterson - - * Makefile.am: Removed entries for elf32-i386qnx.c and - elf32-i386qnx.lo. - * Makefile.in: Regenerate. - * config.bfd: Changed i[3456]86-*-nto-qnx* targ_defvec from - bfd_elf32_i386qnx_vec to bfd_elf32_i386_vec. - * configure.in: Removed support for bfd_elf32_i386qnx_vec. - * configure: Regenerate. - * elf32-i386qnx.c: Removed. - * elf.c: Removed calls to QNX specific set_nonloadable_filepos, - is_contained_by_filepos, and copy_private_bfd_data_p. - * elf32-i386.c: Removed QNX specific #ifdef ELF32_I386_C_INCLUDED. - * targets.c: Removed bfd_elf32_i386qnx_vec. - * elfxx-target.h: Removed QNX specific elf_backend_set_nonloadable_filepos, - elf_backend_is_contained_by_filepos, and elf_backend_copy_private_bfd_data_p. - * elf-bfd.h: Removed QNX specific set_nonloadable_filepos, - is_contained_by_filepos, and copy_private_bfd_data_p. - -2002-11-06 David O'Brien - Alan Modra - - * elf64-sparc.c (sparc64_elf_relocate_section): Adjust addend of - dynamic relocs against section symbols for the output section vma. - -2002-11-05 Elias Athanasopoulos - - * vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is - non-NULL before dereferencing. - -2002-11-04 Kaz Kojima - - * vms.c (vms_object_p): Restore the start address when returning - NULL. - -2002-10-31 David O'Brien - - * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't mix - signed and unsigned in comparison. - -2002-10-30 Daniel Jacobowitz - - * bfd-in2.h: Regenerated. - * po/SRC-POTFILES.in: Regenerated. - * po/bfd.pot: Regenerated. - -2002-10-30 Daniel Jacobowitz +2004-05-17 Daniel Jacobowitz - * coffcode.h: Remove extraneous '\'. - -2002-10-28 Daniel Jacobowitz - - Merge from mainline: - 2002-10-24 John David Anglin - * aoutx.h (NAME(aout,swap_ext_reloc_in)): Cast bytes->r_index to - unsigned int. Cast RELOC_BASE10, RELOC_BASE13 and RELOC_BASE22 to - unsigned int. - (NAME(aout,final_link)): Cast enum used in assignment. - (aout_link_write_symbols): Cast enums in comparisons, int values to - boolean, enums in assignments to int. - (aout_link_input_section_std): Cast rel->r_index to unsigned int. - (aout_link_input_section_ext): Likewise. Cast enums used in comparisons - with unsigned ints. - (aout_link_reloc_link_order): Cast enum to int in assignment. - * archive.c (_bfd_generic_read_ar_hdr_mag): Cast result of memchr - calls to char *. - * bfd-in.h (bfd_set_section_vma): Cast enum true to unsigned int in - assignment. - * bfd-in2.h (bfd_set_section_vma): Likewise. - * bfd.c (bfd_record_phdr): Cast enums in assignments. - * binary.c (bfd_alloc): Cast enum to long. - * coffgen.c (_bfd_coff_is_local_label_name): Cast return to boolean. - * dwarf2.c (read_abbrevs): Add casts to enum types. - (read_attribute_value): Likewise. - (arange_add): Cast result of bfd_zalloc call. - (comp_unit_contains_address): Return true and false. - (comp_unit_find_nearest_line): Cast return to boolean. - * format.c (bfd_check_format_matches, bfd_set_format): Likewise. - * gen-aout.c: define macro '_' if not defined. - * libbfd.c (bfd_realloc): Cast malloc and realloc to PTR. - (bfd_bwrite): Cast bfd_realloc to bfd_byte *. - (bfd_write_bigendian_4byte_int): Cast return to boolean. - (bfd_seek): Cast bfd_realloc to bfd_byte *. - (bfd_generic_is_local_label_name): Cast return to boolean. - * libcoff.h (_bfd_coff_adjust_symndx): Remove extraneous '\'. - * linker.c (_bfd_link_hash_newfunc): Cast bfd_hash_allocate result to - struct bfd_hash_entry *. - (_bfd_generic_link_hash_newfunc): likewise. - (_bfd_generic_final_link): Cast enum to unsigned int. - * merge.c (sec_merge_emit): Cast return to boolean. - (merge_strings): Add casts to const unsigned char *. - * reloc.c (bfd_get_reloc_code_name): Cast enums in comparison to int. - (bfd_generic_get_relocated_section_content): Cast enum to unsigned int. - * section.c (bfd_section_hash_newfunc): Cast bfd_hash_allocate result to - struct bfd_hash_entry *. - (bfd_set_section_content): Add cast to PTR in comparison. - * srec.c (S3Forced): Initialize to false. - (srec_get_symtab): Cast return value from bfd_alloc to asymbol *. - * stabs.c (_bfd_link_section_stabs): Cast enum to int in comparisons. - (_bfd_discard_section_stabs): Likewise. Also cast return to boolean. - * syms.c (bfd_is_undefined_symclass): Cast return to boolean. - (_bfd_stab_section_find_nearest_line): Cast enum to bfd_byte in - comparisons. - - 2002-10-23 Jakub Jelinek - * elf64-alpha.c (elf64_alpha_check_relocs): Only put maybe_dynamic - relocs into shared lib non-allocated reloc sections. - - 2002-10-23 Nathan Tallent - * dwarf2.c (add_line_info): Ensure that the line_info_table is - sorted even when given an out-of-order line sequence. - (lookup_address_in_line_info_table): When an exact VMA match is - not found, return line information with the closest VMA. - - 2002-10-21 Alan Modra - * targets.c (bfd_target_list): Don't return the default target twice. - - 2002-10-19 H.J. Lu - * elflink.h (elf_link_add_object_symbols): Correctly handle - DT_RPATH and DT_RUNPATH. - - 2002-10-16 Jakub Jelinek - * config.bfd (s390-*-linux*): Add targ64_selvecs. - (s390x-*-linux*): Add targ_selvecs. - - 2002-10-16 Alan Modra - * elflink.h (elf_link_add_object_symbols): Error out on dynamic objects - loaded with --just-symbols. - - * elf32-i386qnx.c (TARGET_LITTLE_NAME): Define. - - 2002-10-14 Kaz Kojima - * config.bfd (sh*eb-*-linux*, sh*-*-linux*): Add the alternative - endian vector to targ_selvecs. - - 2002-10-08 H.J. Lu - * elf32-i386.c (elf_i386_relocate_section): Re-arrange the - IE->LE transition for R_386_TLS_IE. - - 2002-10-07 Mark Elbrecht - * cofflink.c (mark_relocs): Don't mark relocations in excluded - sections. - - 2002-10-05 Alexandre Oliva - * elfxx-mips.c (mips_elf_create_dynamic_relocation): Set the type - of the other two relocations packed with a REL32 to NONE. - - 2002-10-02 Stephen Clarke - * elf32-sh.c (elf_sh_link_hash_entry): Add gotplt_refcount. - (sh_elf_link_hash_newfunc): Initialize it. - (allocate_dynrelocs): Transfer gotplt refs from plt.refcount - to got.refcount for symbols that are forced local or when - we have direct got refs. - (sh_elf_gc_sweep_hook): Adjust gotplt_refcount. Use it - to correctly adjust got.refcount and plt.refcount. - (sh_elf_copy_indirect_symbol): Copy gotplt_refcount across. - (sh_elf_check_relocs): Increment gotplt_refcount. - - 2002-10-01 Jakub Jelinek - * elf32-i386.c (elf_i386_relocate_section): Fix - movl foo@indntpoff, %eax IE->LE transition. - - 2002-09-28 Jason Thorpe - * elf32-vax.c (elf_vax_size_dynamic_section): Don't strip - .got sections. - - 2002-09-27 Matt Thomas - * elf32-vax.c (elf_vax_check_relocs): Remove unused - local_got_refcounts usage. Remove allocation of got slot. - (elf_vax_gc_sweep_hook): Remove unused local_got_refcounts usage. - Remove de-allocation of got slot. - (elf_vax_size_dynamic_section): Fix some indentation. Add hash - traversal for elf_vax_instantiate_got_entries. Allow empty .got - sections to be GC'ed. - (elf_vax_instantiate_got_entries): New function. - (elf_vax_relocate_section): Simplify R_VAX_GOT32 handling. Remove - tests that are now handled by elf_vax_instantiate_got_entries. - Assert GOT entry falls within .got section size. Remove redundant - comparisions. Fix comments. - - 2002-09-24 Jakub Jelinek - * elf32-sparc.c (elf32_sparc_relocate_section): Put R_SPARC_RELATIVE - addend into r_addend, not *r_offset. - (elf32_sparc_finish_dynamic_symbol): Likewise. - * elf64-sparc.c (sparc64_elf_finish_dynamic_symbol): Clear xword at - R_SPARC_RELATIVE's r_offset. - - 2002-08-07 Thiemo Seufer - * elfxx-mips.c (mips_elf_create_dynamic_relocation): Cast signedness - mismatch. - -2002-10-14 Richard Henderson - - * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: Increment - VALUE, not ADDEND. - -2002-10-11 Alan Modra - - * coff-arm.c (record_arm_to_thumb_glue): Avoid type-punned pointers. - (record_thumb_to_arm_glue): Likewise. - * ecoff.c (ecoff_link_add_externals): Likewise. - * elf32-arm.h (record_arm_to_thumb_glue): Likewise. - (record_thumb_to_arm_glue): Likewise. - * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise. - * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise. - * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise. - * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise. - * elf64-ppc.c (func_desc_adjust): Likewise. - * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise. - (sh64_elf64_create_dynamic_sections): Likewise. - * elflink.c (_bfd_elf_create_got_section): Likewise. - (_bfd_elf_create_dynamic_sections): Likewise. - (_bfd_elf_create_linker_section): Likewise. - * elflink.h (elf_add_default_symbol): Likewise. - (elf_link_create_dynamic_sections): Likewise. - (NAME(bfd_elf,size_dynamic_sections)): Likewise. - * elfxx-ia64.c (elfNN_ia64_aix_add_symbol_hook): Likewise. - * elfxx-mips.c (mips_elf_create_got_section): Likewise. - (_bfd_mips_elf_add_symbol_hook): Likewise. - (_bfd_mips_elf_create_dynamic_sections): Likewise. - * linker.c (generic_link_add_symbol_list): Likewise. - * xcofflink.c (xcoff_link_add_symbols): Likewise. - - * elfxx-ia64.c (oor_brl, oor_ip): Conditionally define. - - * elf64-ppc.c (edit_opd): Only zero opd syms when function is - completely removed. Correct local sym adjustment. - -2002-10-08 Alan Modra - - * elf64-ppc.c (edit_opd): Correct test for discarded sections. - -2002-10-07 Alan Modra - - * elflink.h (elf_link_input_bfd): Remove BFD_VERSION_DATE dependent - code. - - * elf64-ppc.c (ppc64_elf_build_stubs): Increment .glink indx. - -2002-09-28 Alan Modra - - * elf.c (map_sections_to_segments): Correct test for start of - writable section in the same page as end of read-only section. - -2002-09-26 Alan Modra - - * elf64-ppc.c (ppc_build_one_stub): Don't build glink stubs here. - (ppc64_elf_build_stubs): Build them here instead. - -2002-09-23 Daniel Jacobowitz - - Merge from mainline: - 2002-09-23 Alan Modra - * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Zero relocs - for discarded FDEs. Remove redundant assignment. - * elflink.h (elf_bfd_discard_info): Save edited relocs. - - 2002-09-23 Nathan Tallent - * dwarf2.c (decode_line_info): Update to correctly decode - the (non-standard DWARF2) out-of-order address sequences - generated by the Intel C++ 6.0 compiler for ia64-Linux. - - 2002-09-22 H.J. Lu - * elf64-alpha.c (elf64_alpha_merge_ind_symbols): Don't merge - the relocation count between different .reloc sections. - - 2002-09-22 Mark Elbrecht - * config.bfd: For DJGPP targets, match with any cpu and any machine. - - 2002-09-21 Alan Modra - * elfcode.h (elf_slurp_reloc_table_from_section): Make "symcount" - unsigned. Move "symcount" assignment out of loop. - - 2002-09-19 Nathan Tallent - * dwarf2.c (_bfd_dwarf2_find_nearest_line): If address length is - zero, set it to 8 for (non-standard) 64-bit DWARF2 formats - (e.g. IRIX64). - - 2002-09-19 Jakub Jelinek - * reloc.c (BFD_RELOC_386_TLS_TPOFF, BFD_RELOC_386_TLS_IE, - BFD_RELOC_386_TLS_GOTIE): Add. - * bfd-in2.h, libbfd.h: Rebuilt. - * elf32-i386.c (elf_howto_table): Add R_386_TLS_TPOFF, R_386_TLS_IE - and R_386_TLS_GOTIE. - (elf_i386_reloc_type_lookup): Handle it. - (struct elf_i386_link_hash_entry): Change tls_type type to unsigned - char instead of enum, change GOT_* into defines. - (GOT_TLS_IE_POS, GOT_TLS_IE_NEG, GOT_TLS_IE_BOTH): Define. - (elf_i386_tls_transition): Handle R_386_TLS_IE and R_386_TLS_GOTIE. - (elf_i386_check_relocs): Likewise. Avoid crash if local symbol is - accessed both as normal and TLS symbol. Move R_386_TLS_LDM and - R_386_PLT32 cases so that R_386_TLS_IE can fall through. - Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs. - (elf_i386_gc_sweep_hook): Handle R_386_TLS_IE and R_386_TLS_GOTIE. - Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs. - (allocate_dynrelocs): Allocate 2 .got and 2 .rel.got entries if - tls_type is GOT_TLS_IE_BOTH. - (elf_i386_size_dynamic_sections): Likewise. - (elf_i386_relocate_section): Handle R_386_TLS_IE and R_386_TLS_GOTIE. - Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs. - (elf_i386_finish_dynamic_symbol): Use tls_type & GOT_TLS_IE to catch - all 4 GOT_TLS_* TLS types. - - 2002-09-18 Daniel Jacobowitz - * elfcode.h (elf_slurp_reloc_table_from_section): Check - correct relocation count. - - 2002-09-17 Daniel Jacobowitz - * bfd-in.h (bfd_get_dynamic_symcount): Define. - * bfd.c (struct _bfd): Add dynsymcount. - * bfd-in2.h: Regenerated. - * elf.c (_bfd_elf_canonicalize_dynamic_symtab): Set - abfd->dynsymcount. - * elfcode.h (elf_slurp_reloc_table_from_section): Check - for overflow. - - 2002-09-17 Alan Modra - * elf64-alpha.c (alpha_elf_size_info): Make static. - - 2002-09-17 Jakub Jelinek - * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Clear .got word - even if generating R_PPC_RELATIVE reloc. - (ppc_elf_relocate_section): Make sure relocation is performed if - skip == -2. Clear memory at r_offset when creating dynamic - relocation. - - 2002-09-16 David O'Brien - * elf32-i386-fbsd.c: Always label using the EI_OSABI method. - It is benign for FreeBSD < 4.1. Minor reformatting. - * elf64-alpha-fbsd.c: Likewise. - - 2002-09-16 Nathan Tallent - * ecoff.c (_bfd_ecoff_slurp_symbolic_info) : Fix error - reading ECOFF information: 'ioptMax' refers to the actual *size* - of the optimization symtab, not the number of entries. - - 2002-09-16 Jakub Jelinek - * elf_i386_relocate_section (R_386_TLS_TPOFF32): Negate addend. - - 2002-09-13 Daniel Jacobowitz - * elf32-arm.h (elf32_arm_adjust_dynamic_symbol): Update - ELF_LINK_HASH_NEEDS_PLT logic. - - 2002-09-11 Nick Clifton - * po/da.po: New Danish translation file. - * configure.in (LINGUAS): Add 'da'. + * configure.in: Bump version to 2.15. Mark as released. * configure: Regenerate. - 2002-09-11 Jakub Jelinek - * elf32-i386.c (dtpoff_base, tpoff): Don't crash if tls_segment is - NULL. - (elf_i386_relocate_section): Return false after printing error about - unresolvable relocation. - - 2002-09-11 Jeffrey Law - * elf32-h8300.c (elf32_h8_relax_section): Fix typo. - - 2002-09-06 Andrew Haley - * elf.c (_bfd_elf_find_nearest_line): Check functionname_ptr and - line_ptr before deciding we've found a symbol. - - 2002-08-29 John David Anglin - * bfd-in.h (align_power): Cast constants to bfd_vma type. - * bfd-in2.h (align_power): Likewise. - - 2002-08-24 Kaz Kojima - * elf32-sh.c (sh_elf_copy_indirect_symbol): New. - (create_got_section, allocate_dynrelocs, readonly_dynrelocs): - Likewise. - (struct elf_sh_pcrel_relocs_copied): Removed. - (struct elf_sh_dyn_relocs): New. - (struct elf_sh_link_hash_entry): Replace pcrel_relocs_copied - field with dyn_relocs. - (struct elf_sh_link_hash_table): Add short-cuts to get dynamic - sections and sym_sec. - (sh_elf_link_hash_newfunc): Clear dyn_relocs. - (sh_elf_link_hash_table_create): Clear shorts-cuts and sym_sec. - (sh_elf_create_dynamic_sections): Use create_got_section instead - of _bfd_elf_create_got_section. - (sh_elf_check_relocs): Likewise. - (sh_elf_create_dynamic_sections): Use short-cuts to the dynamic - sections. - (sh_elf_adjust_dynamic_symbol, sh_elf_size_dynamic_sections, - sh_elf_relocate_section, sh_elf_check_relocs, - sh_elf_finish_dynamic_symbol, sh_elf_finish_dynamic_sections): - Likewise. - (sh_elf_adjust_dynamic_symbol): Handle nocopyreloc. Keep the - dynamic relocations and avoiding the copy relocation when we - didn't find any dynamic relocations in the section which has - contents or is read-only. - (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New. - (sh_elf_size_dynamic_sections): Don't reset the size of - .rela.got section even if dynamic_sections_created flag is off. - Don't use sh_elf_discard_copies. Scan all input bfd and use - allocate_dynrelocs. Call readonly_dynrelocs to determine - whether we need DT_TEXTREL. - (sh_elf_adjust_dynamic_symbol): Use plt.refcount to determine - whether the symbol was never referred to. - (sh_elf_relocate_section): Use WILL_CALL_FINISH_DYNAMIC_SYMBOL. - (sh_elf_gc_sweep_hook): Fill with the real sweep function. - (sh_elf_check_relocs): Call create_got_section if the short-cut - to .got is null. Increment reference counters only instead of - allocating space on dynamic sections here. Don't conditionalize - uninitialized got.offset value when marking the symbol as a - global offset table entry. Keep relocations for symbols satisfied - by a dynamic library to avoid copy relocations for the symbol. - Set dynobj field of an elf hash table if needed. - (sh_elf_finish_dynamic_sections): Handle null section pointer - correctly. - (elf_backend_copy_indirect_symbol): Defined. - (elf_backend_can_refcount): Defined. - - 2002-08-22 Nick Clifton - * po/tr.po: Updated Turkish translation. - - 2002-08-21 Stephen Clarke - * bfd/elf32-sh.c (sh_elf_size_dynamic_sections): Zero - initialize dynamic section. - * bfd/elf64-sh64.c (sh64_elf64_size_dynamic_sections): - Likewise. - - 2002-08-13 H.J. Lu - * elflink.h (NAME(bfd_elf,size_dynamic_sections): Don't count - definitions in shared objects when checking symbol with - undefined version. - - 2002-08-10 H.J. Lu - * elflink.h (elf_add_default_symbol): Preserve section across - elf_merge_symbol. - - 2002-08-09 Nick Clifton - * po/sv.po: Updated Swedish translation. - - 2002-08-08 Alan Modra - * elflink.h (elf_link_output_extsym): Don't output symbols from - SEC_EXCLUDE sections. - - * aoutx.h (aout_link_write_symbols): Correct handling of warning syms. - - 2002-08-08 H.J. Lu - * elflink.h (elf_add_default_symbol): Don't warn a defintion - overrides an indirect versioned symbol. - - 2002-08-07 Alan Modra - * elf64-ppc.c (edit_opd): Arrange to drop symbols for discarded .opd - entries. - - 2002-08-07 Jakub Jelinek - * elf32-i386.c (elf_i386_relocate_section): Fill in proper addend - for R_386_TLS_TPOFF32 relocs against symndx 0. - - 2002-08-07 Thiemo Seufer - * elfxx-mips.c (mips_elf_global_got_index): Avoid segfault if - g->global_gotsym is NULL. - - 2002-08-06 Alan Modra - * xcofflink.c (xcoff_write_global_symbol): Set n_scnum for abs_section. - - 2002-08-06 Alan Modra - * elf64-ppc.c (ppc64_elf_howto_raw): Zero all src_mask entries. - - 2002-08-06 H.J. Lu - * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Check symbol - with undefined version if needed. - (elf_link_assign_sym_version): Match a default symbol with a - version without definition. No need to hide the default - definition separately. - - 2002-08-06 Alan Modra - * coff-rs6000.c: Formatting fixes. - (xcoff_calculate_relocation): Use PARAMS in declaration. - (xcoff_complain_overflow): Likewise. - (xcoff_ppc_relocate_section): Use old-style function pointer call. - (bfd_xcoff_backend_data): Remove useless comments. - (rs6000coff_vec): Likewise. - (bfd_pmac_xcoff_backend_data): Likewise. - (pmac_xcoff_vec): Likewise. - * coff64-rs6000.c: Formatting fixes. - (xcoff64_calculate_relocation): Use PARAMS in declaration. - (xcoff64_ppc_relocate_section): Use old-style function pointer call. - (bfd_xcoff_backend_data): Remove useless comments. - (rs6000coff64_vec): Likewise. - (bfd_xcoff_aix5_backend_data): Likewise. - (aix5coff64_vec): Likewise. - - 2002-08-06 Alan Modra - * coff-rs6000.c: (xcoff_rtype2howto): Don't place reloc address in - addend. - * coff64-rs6000.c: (xcoff64_rtype2howto): Likewise. - - 2002-08-06 Alan Modra - * coff-rs6000.c (xcoff_howto_table): Revert some of last change to - mask entries. Use complain_overflow_dont for R_REF. - (xcoff_reloc_type_ba): Revert last change. - (xcoff_reloc_type_br): Likewise. - (xcoff_reloc_type_crel): Likewise. - (xcoff_ppc_relocate_section): Likewise. - * coff64-rs6000.c (xcoff64_reloc_type_br): Likewise. - (xcoff64_ppc_relocate_section): Likewise. - (xcoff64_howto_table): Revert some of last change to mask entries. - Use complain_overflow_dont for R_REF. - - * coff-rs6000.c (xcoff_howto_table): Fix src_mask entries. Make all - relocs with bitsize == 16 have size = 1. - (xcoff_reloc_type_ba): Correct src_mask and dst_mask adjustment. - (xcoff_reloc_type_br): Likewise. - (xcoff_reloc_type_crel): Likewise. - (xcoff_ppc_relocate_section): Set up src_mask and dst_mask correctly. - * coff64-rs6000.c (xcoff64_reloc_type_br): Correct src_mask and - dst_mask adjustment. - (xcoff64_ppc_relocate_section): Set up src_mask and dst_mask correctly. - (xcoff64_howto_table): Fix src_mask entries. Make all relocs with - bitsize == 16 have size = 1. - - 2002-07-31 Nick Clifton - * bfd.c (bfd_alt_mach_code): Rename parameter 'index' to - 'alternative' in order to avoid shadowing global symbol of the - same name. - * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. - * libcoff.h: Regenerate. - - 2002-07-30 Alan Modra - * aoutx.h (some_aout_object_p): Clean up tdata properly on error. - * archive.c (bfd_generic_archive_p): Likewise. - * coff-rs6000.c (_bfd_xcoff_archive_p): Likewise. - (_bfd_xcoff_archive_p): Use bfd_scan_vma in place of strtol. - * coff64-rs6000.c (xcoff64_slurp_armap): Likewise. - (xcoff64_archive_p): Likewise. - (xcoff64_openr_next_archived_file): Likewise. - (xcoff64_archive_p): Clean up tdata properly on error. - * coffgen.c (coff_real_object_p): Likewise. - (coff_object_p): Release filehdr and opthdr. - * ecoff.c (_bfd_ecoff_archive_p): Clean up tdata properly on error. - * ieee.c (ieee_archive_p): Likewise. - * ihex.c (ihex_object_p): Likewise. - (ihex_mkobject): Always allocate tdata. - * peicode.h (pe_ILF_object_p): Release bfd_alloc'd buffer on error. - * srec.c (srec_mkobject): Always allocate tdata. - (srec_object_p): Clean up tdata properly on error. - (symbolsrec_object_p): Likewise. - * versados.c (versados_object_p): Likewise. - * vms-misc.c (_bfd_vms_get_record): Use bfd_malloc instead of malloc, - and bfd_realloc instead of realloc. - (add_new_contents): Use bfd_alloc instead of bfd_malloc for sections. - * vms.c (vms_initialize): Always allocate tdata. Use bfd_alloc in - place of bfd_malloc, simplifying error freeing. Free hash table too. - (vms_object_p): Clean up tdata on error. - (vms_mkobject): Don't complain on stderr if vms_initialize fails. - (vms_close_and_cleanup): Adjust for bfd_alloc use. - - 2002-07-17 Ian Rickards - * dwarf2.c (concat_filename): If we can't establish the directory - just return the filename. - - 2002-07-16 Alan Modra - * elflink.h: Formatting fixes, tidy prototypes. - (elf_link_assign_sym_version): Move common code out of loop. - - 2002-07-04 Bruno Haible - * elf32-i386.c: Don't defined ELF_ARCH etc. if this file is included - by a target variant implementation. - * elf64-alpha.c: Likewise. - * elf32-i386-fbsd.c: New file. - * elf64-alpha-fbsd.c: New file. - * targets.c: Support bfd_elf32_i386_freebsd_vec and - bfd_elf64_alpha_freebsd_vec. - * configure.in: Accept the vectors bfd_elf32_i386_freebsd_vec, - bfd_elf64_alpha_freebsd_vec. - * Makefile.am (BFD32_BACKENDS): Add elf32-i386-fbsd.lo. - (BFD32_BACKENDS_CFILES): Add elf32-i386-fbsd.c. - (BFD64_BACKENDS): Add elf64-alpha-fbsd.lo. - (BFD64_BACKENDS_CFILES): Add elf64-alpha-fbsd.c. - (elf32-i386-fbsd.lo, elf64-alpha-fbsd.lo): Add dependencies. - * config.bfd: For FreeBSD targets, set targ_defvec to a FreeBSD - specific targets. Define OLD_FREEBSD_ABI_LABEL if appropriate. - -2002-09-21 David O'Brien +2004-05-13 Joel Sherrill - Merge from mainline: - 2002-08-17 Andrew Cagney - * elf.c (bfd_elf_get_elf_syms): Change type of `esym' to - `bfd_byte'. + * config.bfd (or32-*-rtems*): Switch to elf. -2002-08-26 Alan Modra +2004-05-13 Nick Clifton - * coffcode.h (coff_set_arch_mach_hook): Handle W65MAGIC. + * po/fr.po: Updated French translation. -2002-08-22 Alan Modra +2004-05-07 Daniel Jacobowitz - * configure.in: Unset is_release. + * configure.in: Bump version to 2.14.92. * configure: Regenerate. - * elf-bfd.h (struct elf_backend_data): Add struct elf_backend_data - param to elf_backend_copy_indirect_symbol. - (_bfd_elf_link_hash_copy_indirect): Likewise. - * elflink.h (elf_add_default_symbol, elf_fix_symbol_flags): Adjust - calls to copy_indirect_symbol. - * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise. - * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. - * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise. - * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. - * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise. - * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise. - * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise. - * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise. - * elfxx-mips.h (_bfd_mips_elf_copy_indirect_symbol): Likewise. - * elf.c (_bfd_elf_link_hash_copy_indirect): Likewise. Properly - test refcounts for "used" values. - -2002-08-15 Hans-Peter Nilsson - - * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Add - missing check for whether the symbol is referenced by DSO before - unexporting it as an unneeded dynamic symbol. - -2002-08-05 Daniel Jacobowitz - - * configure.in: Bump version, set is_release. - * configure: Regenerated. - -2002-08-01 Daniel Jacobowitz +2004-05-07 Daniel Jacobowitz Merge from mainline: - 2002-07-31 Jakub Jelinek - * elf32-i386.c (elf_i386_copy_indirect_symbol): Swap tls_type - if _bfd_elf_link_hash_copy_indirect will swap got.refcount. - -2002-07-30 Daniel Jacobowitz + 2004-04-16 Alan Modra + * simple.c (bfd_simple_get_relocated_section_contents): Don't + change reloc_done. Set and restore _cooked_size. + (RETURN): Delete. + +2004-05-07 Alexandre Oliva + + * elf32-frv.c (elf32_frvfdpic_modify_segment_map): Return + immediately if there's no link info. + (elf32_frvfdpic_copy_private_bfd_data): New. + (bfd_elf32_bfd_copy_private_bfd_data): Use it for frvfdpic. + +2004-05-06 Zack Weinberg + + * dwarf2.c (add_line_info): Also set info->filename to NULL if + filename argument is null; do not call strlen on a null pointer. + +2004-05-06 Daniel Jacobowitz + + * elf32-arm.h (elf32_arm_relocate_section): Remove R_ARM_PLT32 + special case. + +2004-05-05 Alexandre Oliva + + * configure.in (bfd_elf32_frvfdpic_vec): New. + * configure: Rebuilt. + * targets.c (bfd_elf32_frvfdpic_vec): New. + * config.bfd: Enable it on frv-*-elf and frv-*-*linux*, as default + on the latter. + * elf32-frv.c: Prefix all identifiers added for FDPIC support with + frvfdpic instead of frv. Rearrange elf-target macros such that + the FDPIC-specific ones are only defined for this new target + vector. + (bfd_elf32_frvfdpic_vec): Declare. + (IS_FDPIC): New. + (elf32_frv_relocate_section): Use it to enable segment checking + and to control rofixup emission. Add output section vma to + applied relocation in non-LOAD non-ALLOC sections. Use + _bfd_error_handler for errors. + (_frv_create_got_section): Create .rel.got and .rofixup only in + FDPIC. Create non-dynamic _gp at .got+2048 in non-FDPIC, like the + linker script. + (elf32_frvfdpic_size_dynamic_sections): Assume FDPIC. + (elf32_frvfdpic_modify_segment_map): Likewise. + (elf32_frv_finish_dynamic_sections): New, do-nothing. + (elf32_frvfdpic_finish_dynamic_sections): Assume FDPIC. Improve + error message if we miscompute the rofixup size. + (frvfdpic_elf_use_relative_eh_frame): Assume FDPIC. + (frvfdpic_elf_encode_eh_address): Likewise. + (elf32_frv_check_relocs): Reject FDPIC-only relocs in non-FDPIC. + Record relocs only in FDPIC. Make sure _gp is defined for GPREL + relocs. Reject unknown relocation types. + (elf32_frv_object_p): Make sure target vector matches FDPIC bits. + (frv_elf_merge_private_bfd_data): Likewise. + (ELF_MAXPAGESIZE): Revert to 0x1000 for elf32-frv; keep it as + 0x4000 for newly-added elf32-frvfdpic. + +2004-05-05 Alexandre Oliva Merge from mainline: - 2002-07-30 Nick Clifton - * po/sv.po: Updated Swedish translation. - - 2002-07-30 Jakub Jelinek - * elf.c (elf_fake_sections): Fix up .tbss sh_size and sh_type. - - 2002-07-26 Chris Demetriou - * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Merge ASE - flags into resulting BFD. - - 2002-07-25 Alan Modra - * elf-bfd.h (_bfd_elf32_link_record_local_dynamic_symbol): Define - as elf_link_record_local_dynamic_symbol. - (_bfd_elf64_link_record_local_dynamic_symbol): Likewise. - (elf_link_record_local_dynamic_symbol): Declare. Now returns int. - * elflink.h (elf_link_record_local_dynamic_symbol): Move to.. - * elflink.c: .. here. Use bfd_elf_get_elf_syms. Check whether an - attempt is made to record a symbol in a discarded section, and - return `2' in that case. - -2002-07-26 Alan Modra - - From John Reiser - * elf32-i386.c (elf_i386_link_hash_table_create): Clear - tls_ldm_got.refcount. - -2002-07-25 Nick Clifton - - * po/sv.po: Updated Swedish translation. - * po/es.po: Updated Spanish translation. - * po/fr.po: Updated French translation. - -2002-07-24 Nick Clifton - - * po/sv.po: Updated Swedish translation. - * po/es.po: Updates Spanish translation. - -2002-07-23 Daniel Jacobowitz - - * configure.in: Bump version for snapshot. - * configure: Regenerated. - -2002-07-23 Daniel Jacobowitz - - * po/bfd.pot: Regenerated. - -2002-07-23 Nick Clifton - - * elf-bfd.h (struct elf_backend_data): Add new bitfield - 'want_p_paddr_set_to_zero'. - * elfxx-target.h: Set default value for want_p_paddr_set_to_zero - to false; - * elfxx-ia64.c: Set want_p_paddr_set_zero for HPUX target. - * elf.c (copy_private_bfd_data): Test want_p_paddr_set_zero. - -2002-07-23 Gabor Keresztfalvi - - * nlmcode.h (nlm_swap_auxiliary_headers_out): Swapped the order of - the MeSsAgEs and CoPyRiGhT tags to make >=NW4.x NLM loaders to - show the Copyright string. - -2002-07-23 Nick Clifton - - * po/fr.po: New French translation. - * po/sv.po: New Swedish translation. - -2002-07-23 Alan Modra - - * elflink.h (elf_link_input_bfd): Don't change internal symbols - when outputting relocs. - -2002-07-20 Jason Thorpe - - * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only insert - DT_PLTGOT into the dynamic section if there is a PLT. - -2002-07-19 Alan Modra - - * elfxx-ia64.c: (elfNN_ia64_modify_segment_map): Properly scan - PT_IA_64_UNWIND segments for a given section. - -2002-07-16 Moritz Jodeit - - * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Correct order of memset args. - -2002-07-16 Alan Modra - - * elflink.h (elf_link_input_bfd): Don't call reloc_emitter when - reloc section size is zero. Correct reloc output location. - - Merge from mainline. - 2002-07-14 H.J. Lu - * elflink.h (elf_link_assign_sym_version): Hide the default - definition if there is a hidden versioned definition. - -2002-07-16 John David Anglin - - * elf-hppa.h (elf_hppa_reloc_final_type): Use R_PARISC_PCREL16F as - the final type for the e_fsel selector when generating PA2.0W code. - (elf_hppa_relocate_insn): Provide support for PA2.0W 16-bit format 1 - relocations. - -2002-07-12 Hans-Peter Nilsson - - * elf32-cris.c (cris_elf_relocate_section): Drop nonsensical - dynamic reference test in assertion when initializing GOT with - static contents. Just assert that there are either no dynamic - sections, the symbol is defined in the regular objects or that the - symbol is undef weak. Tweak comment. - (elf_cris_finish_dynamic_symbol): Emit .got reloc for a program - only if the symbol isn't defined in the program and isn't undef - weak. - (elf_cris_adjust_dynamic_symbol): Simplify condition for getting - rid of PLT entry: only do it if the symbol isn't defined in a DSO. - When doing so, clear ELF_LINK_HASH_NEEDS_PLT. Tweak comments. - (elf_cris_discard_excess_program_dynamics): Don't consider - ELF_LINK_HASH_REF_DYNAMIC when omitting .got runtime relocs. - -2002-07-11 Alan Modra - - * elf32-i386.c (elf_i386_relocate_section): Don't complain about - unresolved debugging relocs in dynamic applications. - * elf32-s390.c (elf_s390_relocate_section): Likewise. - * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. - * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. - * elf64-s390.c (elf_s390_relocate_section): Likewise. + 2004-02-27 Alexandre Oliva + * elf-bfd.h (struct elf_backend_data): Added + elf_backend_can_make_relative_eh_frame, + elf_backend_can_make_lsda_relative_eh_frame and + elf_backend_encode_eh_address. + (_bfd_elf_encode_eh_address): Declare. + (_bfd_elf_can_make_relative): Declare. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use new + hooks to decide whether to attempt to make_relative and + make_lsda_relative. + (_bfd_elf_write_section_eh_frame_hdr): Call encode_eh_address. + (_bfd_elf_can_make_relative): New. + (_bfd_elf_encode_eh_address): New. + * elf32-frv.c (frv_elf_use_relative_eh_frame): New. + (frv_elf_encode_eh_address): New. + (elf_backend_can_make_relative_eh_frame): Define. + (elf_backend_can_make_lsda_relative_eh_frame): Define. + (elf_backend_encode_eh_address): Define. + * elfxx-target.h + (elf_backend_can_make_relative_eh_frame): Define. + (elf_backend_can_make_lsda_relative_eh_frame): Define. + (elf_backend_encode_eh_address): Define. + (elfNN_bed): Add them. + +2004-04-27 Bob Wilson + + * elf32-xtensa.c (xtensa_read_table_entries): Use section _cooked_size + if set. Check reloc_done flag before applying relocations. Use + output addresses, both when applying relocations and when comparing + against the specified section. + (elf_xtensa_relocate_section): Use output address to check if dynamic + reloc is in a literal pool. Set section's reloc_done flag. + +2004-04-21 Philip Blundell + + * elf32-arm.h (elf32_arm_check_relocs): Don't output REL32 + relocs for locally defined symbols during -shared final link. + (elf32_arm_final_link_relocate): Likewise. + +2004-04-21 Bob Wilson + + * elf32-xtensa.c (is_same_value): Add final_static_link argument and + require relocations against a weak symbol to reference the same + symbol hash entry if not a final, static link. + (get_cached_value, add_value_map): Add final_static_link argument. + (remove_literals): Pass final_static_link argument as needed. + +2004-04-16 Nick Clifton + + * bfd.c (bfd_archive_filename): Catch NULL bfd pointers. + +2004-04-16 H.J. Lu + + * elflink.c (_bfd_elf_merge_symbol): Treat weak as strong only + when it is a definition. + +2004-04-16 Alan Modra + + * elf32-sparc.c (elf32_sparc_relocate_section): Don't abort + when statically linking PIC code. * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. - * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. - -2002-07-10 Alan Modra - - * elf64-ppc.c (ONES): Define. - (ppc64_elf_howto_table): Use ONES here to avoid warnings. Fill in - missing src_mask fields. Tweak R_PPC64_NONE, R_PPC64_COPY. Fill - in missing dst_mask fields on R_PPC64_PLT32, R_PPC64_PLTREL32. - - * elf64-ppc.c (ppc64_elf_get_symbol_info): Delete. - (ppc64_elf_set_private_flags): Delete. - (ppc64_elf_section_from_shdr): Delete. - (ppc64_elf_merge_private_bfd_data): Remove flag checking/merging code. - (ppc64_elf_fake_sections): Delete. - (bfd_elf64_bfd_set_private_flags): Don't define. - (bfd_elf64_get_symbol_info): Likewise. - (elf_backend_section_from_shdr): Likewise. - (elf_backend_fake_sections): Likewise. - -2002-07-10 Marco Walther - - * elf.c: (assign_section_numbers) Set sh_entsize for .stab only - when not already set. - * elf64-sparc.c: (sparc64_elf_fake_sections): New function. - (elf_backend_fake_sections): Define. - -2002-07-10 Alan Modra - - * merge.c (_bfd_merge_section): Remove redundant output_section check. - Formatting. - (_bfd_merge_sections): Don't set SEC_EXCLUDE on unused sections. - -2002-07-09 Hans-Peter Nilsson - - * elf32-cris.c (cris_elf_relocate_section): Move sanity-check for - NULL sym_hashes to just before use. - : In test for local symbol, accept also - symbol with non-default visibility. - : Ditto. - : - Ditto. - (cris_elf_gc_sweep_hook): Only decrease h->plt.refcount for - symbol with non-default visibility. - (cris_elf_check_relocs): At tests for local symbol before - increasing h->plt.refcount, also check for non-default - visibility. Ditto when checking for local symbol to eliminate - pc-relative runtime relocs. - -2002-07-08 Alan Modra - - * elf.c: Formatting. - (IS_SOLARIS_PT_INTERP): Add p_paddr and p_memsz checks. - (INCLUDE_SECTION_IN_SEGMENT): Remove IS_SOLARIS_PT_INTERP. - (copy_private_bfd_data): Set p_vaddr on broken Solaris PT_INTERP - segments. - -2002-07-07 Mark Mitchell - Alan Modra - - * cofflink.c (_bfd_coff_final_link): On PE COFF systems, take into - account the impact of relocation count overflow when computing - section offsets. - * coffcode.h (coff_write_relocs): Use obj_pe when deciding whether - or not to apply the PE COFF reloc overflow handling. Fix a - fencepost error in deciding whether or not to use that technique. - -2002-07-07 Alan Modra - - * elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx, - change type of locsyms. - (bfd_elf_get_elf_syms): Declare. - * elf.c (bfd_elf_get_elf_syms): New function. - (group_signature): Use bfd_elf_get_elf_syms. - (bfd_section_from_r_symndx): Likewise. - * elfcode.h (elf_slurp_symbol_table): Likewise. - * elflink.h (elf_link_is_defined_archive_symbol): Likewise. - (elf_link_add_object_symbols): Likewise. Reorganise to increase - locality of various data structures. Properly free internal relocs. - (elf_bfd_final_link): Properly free internal relocs. - (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms. - (elf_link_input_bfd): Likewise. - (elf_gc_mark): Likewise. Properly free internal relocs. - (elf_gc_sweep): Properly free internal relocs. - (elf_reloc_symbol_deleted_p): No need to swap syms in. - (elf_bfd_discard_info): Use bfd_elf_get_elf_syms. Properly free - internal relocs. - * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms. - Properly free possibly cached info. - (mn10200_elf_relax_delete_bytes): Remove symbol swapping code. - (mn10200_elf_symbol_address_p): Pass in internal syms. Remove - symbol swapping code. - (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms. - Properly free possibly cached info. - * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c. - (mn10300_elf_relax_delete_bytes): Likewise. - (mn10300_elf_symbol_address_p): Likewise. - (mn10300_elf_get_relocated_section_contents): Likewise. - * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c. - (elf32_h8_relax_delete_bytes): Likewise. - (elf32_h8_symbol_address_p): Likewise. - (elf32_h8_get_relocated_section_contents): Likewise. - * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c. - (m32r_elf_relax_delete_bytes): Likewise. - (m32r_elf_get_relocated_section_contents): Likewise. - * elf32-sh.c (sh_elf_reloc_loop): Free section contents using - elf_section_data to determine whether cached. - (sh_elf_relax_section): As above for elf-m10200.c. - (sh_elf_relax_delete_bytes): Likewise. - (sh_elf_get_relocated_section_contents): Likewise. - * elf32-xstormy16.c (xstormy16_elf_relax_section): As above. - * elf64-alpha.c (elf64_alpha_relax_section): As above. Also delay - reading of local syms. - * elf64-mmix.c (mmix_elf_relax_section): Likewise. - * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above. - * elfxx-ia64.c (elfNN_ia64_relax_section): As above. - * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal - relocs. - * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly - free internal relocs and section contents. Don't read symbols. - * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms. - (elf32_hppa_size_stubs): Don't free local syms. - * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay - reading of local syms. Use bfd_elf_get_elf_syms. Properly free - possibly cached info. - * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. - * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms. - * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and - all_local_syms. - (get_local_syms): Delete function. - (edit_opd): Use bfd_elf_get_elf_syms. Free on error exit. Cache - on exit. - (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms. Free/cache on exit. - -2002-07-05 Jim Wilson - - * syms.c (decode_section_type): New. - (bfd_decode_symclass): Call decode_section_type. - -2002-07-04 Jakub Jelinek - - * merge.c (_bfd_merged_section_offset): Avoid accessing byte before - section content start. - Reported by Michael Schumacher . - -2002-07-04 Alan Modra - - * section.c (_bfd_strip_section_from_output): Remove unnecessary - link order code. Don't actually remove the output section here; - Just set a flag for the linker to do so. - * elflink.c (_bfd_elf_link_renumber_dynsyms): Test for removed - sections when setting up output section dynsyms. - -2002-07-04 Alan Modra - - * elflink.h (elf_link_add_object_symbols): Revert 1999-09-02 hpux - fudge. - * elf.c (bfd_section_from_shdr): Work around broken hpux shared - libs here instead. - -2002-07-02 Martin Schwidefsky - - * elf64-s390.c (create_got_section): Set .got section alignment to - 8 bytes. - (elf_s390_check_relocs): Set .rela.dyn section alignment to 8 bytes. - -2002-07-02 Alan Modra - - * elf.c (_bfd_elf_reloc_type_class): Fix comment grammar. - -2002-07-01 Matt Thomas - - * elf32-vax.c (elf32_vax_print_private_bfd_data): Change EF_* - to EF_VAX_*. - -2002-07-01 Thiemo Seufer - - * elfxx-mips.c (ABI_64_P): Fix comment. - (MIPS_ELF_OPTIONS_SECTION_NAME,MIPS_ELF_STUB_SECTION_NAME): Use the - new section names for N64 ABI. - (mips_elf_output_extsym): No special _gp_disp handling for NewABI. - (mips_elf_calculate_relocation): Code formatting. - (mips_elf_create_dynamic_relocation): Likewise. - (_bfd_mips_elf_fake_sections): IRIX6 needs this hack, too. - (_bfd_mips_elf_size_dynamic_sections): Handle GOT_PAGE for any NewABI. - (_bfd_mips_elf_relocate_section): No special handling for R_MIPS_64 - in any NewABI. - (_bfd_mips_elf_finish_dynamic_symbol): No special _gp_disp handling - for NewABI. - (_bfd_mips_elf_modify_segment_map): Handle any N64 ABI. - (_bfd_mips_elf_gc_sweep_hook): NewABI GOT relocs should be handled - here, too. - -2002-07-01 Andreas Schwab - - * elf64-x86-64.c (elf64_x86_64_relocate_section): Only convert - R_X86_64_64 to R_X86_64_RELATIVE. - -2002-07-01 John David Anglin - - * vaxbsd.c: New BFD backend for VAX BSD and Ultrix. - * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Add new backend. - Run "make dep-am". - * config.bfd (vax-*-bsd* | vax-*-ultrix*): Use vaxbsd_vec instead of - host_aout_vec. - * configure.in (vaxbsd_vec): Add. - * targets.c (vaxbsd_vec): Add. - * Makefile.in: Rebuild. - * configure: Rebuild. - * po/SRC-POTFILES.in: Rebuild. - -2002-07-01 Alan Modra - - * elflink.h (elf_gc_mark): Pass in the section whose relocs we are - examining to gc_mark_hook, rather than the bfd. - (elf_gc_sections): Adjust. - * elf-bfd.h (struct elf_backend_data ): Likewise. - * elf-m10300.c (mn10300_elf_gc_mark_hook): Likewise. - * elf32-arm.h (elf32_arm_gc_mark_hook): Likewise. - * elf32-avr.c (elf32_avr_gc_mark_hook): Likewise. - * elf32-cris.c (cris_elf_gc_mark_hook): Likewise. - * elf32-d10v.c (elf32_d10v_gc_mark_hook): Likewise. - * elf32-fr30.c (fr30_elf_gc_mark_hook): Likewise. - * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise. - * elf32-i386.c (elf_i386_gc_mark_hook): Likewise. - * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise. - * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise. - * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise. - * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Likewise. - * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise. - * elf32-s390.c (elf_s390_gc_mark_hook): Likewise. - * elf32-sh.c (sh_elf_gc_mark_hook): Likewise. - * elf32-sparc.c (elf32_sparc_gc_mark_hook): Likewise. - * elf32-v850.c (v850_elf_gc_mark_hook): Likewise. - * elf32-vax.c (elf_vax_gc_mark_hook): Likewise. - * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Likewise. - * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise. - * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise. - * elf64-s390.c (elf_s390_gc_mark_hook): Likewise. - * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise. - * elfxx-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise. - * elfxx-mips.h (_bfd_mips_elf_gc_mark_hook): Likewise. - * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise. - * elf32-frv.c (elf32_frv_gc_mark_hook): Likewise. Also remove - redundant local sym tests. - * elf64-ppc.c (struct ppc_link_hash_entry): Add is_entry. - (link_hash_newfunc): Init is_entry. - (ppc64_elf_copy_indirect_symbol): Copy is_entry. - (ppc64_elf_link_hash_table_create): Init all_local_syms. - (create_linkage_sections): Use bfd_make_section_anyway rather than - bfd_make_section. - (ppc64_elf_mark_entry_syms): New function. - (ppc64_elf_check_relocs): Don't bother testing elf_bad_symtab. Set - up opd entry to function section map. - (ppc64_elf_gc_mark_hook): Special case opd section relocs, and - relocs that reference the opd section. - (edit_opd): New function. - (ppc64_elf_size_dynamic_sections): Call get_local_syms and edit_opd. - (ppc64_elf_setup_section_lists): Don't calculate htab->bfd_count here. - (get_local_syms): Do so here. Exit if we already have local syms. - Remove bogus comment imported from elf32-hppa.c. Don't attempt to - read local syms on non-ELF input. - (ppc64_elf_size_stubs): Call _bfd_elf64_link_read_relocs rather - than duplicating it's function here. Adjust free of internal - relocs to suit. - (ppc64_elf_relocate_section): Adjust local syms in opd section. - * elf64-ppc.h (ppc64_elf_mark_entry_syms): Declare. - * elf32-hppa.c (elf32_hppa_size_stubs): Call - _bfd_elf32_link_read_relocs rather than duplicating it's function - here. Adjust free of internal relocs to suit. - -2002-07-01 Andreas Jaeger - - * elf64-x86-64.c (elf64_x86_64_check_relocs): Certain relocations - are not allowed in shared libs code, enforce -fPIC. - -2002-06-29 Hans-Peter Nilsson - - * mmo.c (mmo_write_loc_chunk): Don't eliminate leading and - trailing zero-sequences when there's previous left-over data. - -2002-06-27 John David Anglin - - * elf64-hppa.c (elf64_hppa_reloc_type_class): New function. - (elf64_hppa_finish_dynamic_sections): Check other_rel_sec, dlt_rel_sec - and opd_rel_sec in order for starting rela section. Check _raw_size. - (elf_backend_reloc_type_class): Define. - -2002-06-27 Kevin Buettner - - * dwarf2.c (decode_line_info): Handle older, non-standard, 64-bit - DWARF2 formats. - -2002-06-27 Alan Modra - - * cpu-powerpc.c: Comment on ordering of arch_info. - * elf32-ppc.c (ppc_elf_object_p): New function. - (elf_backend_object_p): Define. - * elf64-ppc.c (ppc64_elf_object_p): New function. - (elf_backend_object_p): Define. - -2002-06-26 Jason Thorpe - - * configure.in (vax-*-netbsd*): Set COREFILE to netbsd-core.lo. - * configure: Regenerate. -2002-06-25 Jason Eckhardt - - * dwarf2.c (decode_line_info): Check unit->addr_size - to read in the proper number of prologue bytes. - -2002-06-25 Nick Clifton - - * config.bfd (powerpc-*-aix5*): Only create a selvecs for - aix5coff64_vec if 64-bit bfd support has been enabled. - (powerpc64-*-aix5*): Only define if 64-bit bfd support has - been enabled. - - * targets.c (_bfd_target_vector[]): Only include - aix5coff64_vec if 64-bit bfd support has been enabled. - -2002-06-25 Alan Modra - - * elf64-ppc.c (ppc_add_stub): Replace strcpy/strncpy with memcpy. - * elf32-hppa.c (hppa_add_stub): Likewise. - * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise. - * elflink.h (elf_add_default_symbol): Fix comment typo. - (elf_add_default_symbol): Replace strcpy and strncpy with memcpy. - (elf_link_add_object_symbols): Likewise. - (elf_link_assign_sym_version): Likewise. - * hash.c (bfd_hash_lookup): Likewise. - * linker.c (_bfd_generic_link_add_one_symbol): Likewise. - * section.c (bfd_get_unique_section_name): Likewise. - * syms.c (_bfd_stab_section_find_nearest_line): Likewise. - * elf.c (_bfd_elf_make_section_from_phdr): Likewise. - (assign_section_numbers): Likewise. - (_bfd_elfcore_make_pseudosection): Likewise. - (elfcore_grok_lwpstatus): Likewise. - (elfcore_grok_win32pstatus): Likewise. - (elfcore_write_note): Constify input params. Use PTR instead of - void *. Include terminating NUL in namesz. Correct padding. - Support NULL "name" param. Use memcpy instead of strcpy. - (elfcore_write_prpsinfo): Constify input params. - (elfcore_write_prstatus): Likewise. Use PTR instead of void *. - (elfcore_write_lwpstatus): Likewise. - (elfcore_write_pstatus): Likewise. - (elfcore_write_prfpreg): Likewise. - (elfcore_write_prxfpreg): Likewise. - * elf-bfd.h (elfcore_write_note): Update declaration. - (elfcore_write_prpsinfo): Likewise. - (elfcore_write_prstatus): Likewise. - (elfcore_write_pstatus): Likewise. - (elfcore_write_prfpreg): Likewise. - (elfcore_write_prxfpreg): Likewise. - (elfcore_write_lwpstatus): Likewise. - -2002-06-25 Jason Eckhardt - - * ecoff.c (ecoff_set_symbol_info): Set BSF_FUNCTION for - symbols of type stProc and stStaticProc. - -2002-06-25 Nick Clifton - - * ecoff.c: VArious formatting fixes. - -2002-06-25 Alan Modra - - * coff-rs6000.c (xcoff_generate_rtinit): Fix typo. - -2002-06-25 Alan Modra - - * aout-adobe.c: Don't compare against "true" or "false. - * aout-target.h: Likewise. - * aoutx.h: Likewise. - * archive.c: Likewise. - * bout.c: Likewise. - * cache.c: Likewise. - * coff-a29k.c: Likewise. - * coff-alpha.c: Likewise. - * coff-i386.c: Likewise. - * coff-mips.c: Likewise. - * coff-or32.c: Likewise. - * coff64-rs6000.c: Likewise. - * coffcode.h: Likewise. - * coffgen.c: Likewise. - * cpu-ns32k.c: Likewise. - * ecoff.c: Likewise. - * ecofflink.c: Likewise. - * elf.c: Likewise. - * elf32-arm.h: Likewise. - * elf32-cris.c: Likewise. - * elf32-d30v.c: Likewise. - * elf32-i386.c: Likewise. - * elf32-mcore.c: Likewise. - * elf32-ppc.c: Likewise. - * elf32-sh.c: Likewise. - * elf32-sh64.c: Likewise. - * elf32-v850.c: Likewise. - * elf64-alpha.c: Likewise. - * elf64-sh64.c: Likewise. - * elfcode.h: Likewise. - * elfcore.h: Likewise. - * elflink.h: Likewise. - * elfxx-mips.c: Likewise. - * i386os9k.c: Likewise. - * ieee.c: Likewise. - * libbfd.c: Likewise. - * linker.c: Likewise. - * mmo.c: Likewise. - * nlm32-alpha.c: Likewise. - * nlm32-i386.c: Likewise. - * nlm32-ppc.c: Likewise. - * nlm32-sparc.c: Likewise. - * nlmcode.h: Likewise. - * oasys.c: Likewise. - * pdp11.c: Likewise. - * peicode.h: Likewise. - * reloc.c: Likewise. - * som.c: Likewise. - * srec.c: Likewise. - * tekhex.c: Likewise. - * vms.c: Likewise. - * xcofflink.c: Likewise. - * elf64-sparc.c: Edit comment to not use "== false". - - * aoutf1.h: Don't use "? true : false". - * ecoff.c: Likewise. - * format.c: Likewise. - * ieee.c: Likewise. - * linker.c: Likewise. - * mmo.c: Likewise. - * oasys.c: Likewise. - -2002-06-23 H.J. Lu - - * elflink.h (elf_link_add_archive_symbols): For the default - version, check references with only one `@' first. - -2002-06-23 John David Anglin - - * elf64-hppa.c (elf64_hppa_mark_milli_and_exported_functions): New - function. - (allocate_global_data_dlt): Don't add millicode symbols to dynamic - symbol table. - (allocate_global_data_opd, allocate_dynrel_entries): Likewise. - (elf64_hppa_size_dynamic_sections): Revise to use - elf64_hppa_mark_milli_and_exported_functions. - (elf64_hppa_finish_dynamic_symbol): Remove code to keep millicode - symbols out of dynamic symbol table. - -2002-06-23 Alan Modra +2004-04-11 Thiemo Seufer - * Makefile.in: Regenerate. - * libbfd.h: Regenerate. - * bfd-in2.h: Regenerate. + * config.bfd: Remove mips*-*-mach3* and mips*-dec-mach3* targets. + * configure.in: Remove mips-dec-bsd*, mips-dec-mach3*, mips-*-mach3* + targets amd aout_mips_big_vec, aout_mips_little_vec target vectors. * configure: Regenerate. - * po/SRC-POTFILES.in: Regenerate. - - * elflink.h: Comment typo fixes. - -2002-06-23 H.J. Lu - - * elf-bfd.h (elf_link_loaded_list): New structure. - (elf_link_hash_table): Add "loaded". - * elf.c (_bfd_elf_link_hash_table_init): Initialize "loaded". - * elflink.h (elf_link_check_versioned_symbol): New function. - (elf_link_output_extsym): Call elf_link_check_versioned_symbol. - -2002-06-19 Nick Clifton - - * elflink.h (size_dynamic_sections): If the target does not - support an ELF style hash table, return true, indicating that - nothing needed to be done, rather than false, indicating that the - section's size could not be computed. - -2002-06-18 Dave Brolley - - From Catherine Moore, Michael Meissner, Dave Brolley: - * po/SRC-POTFILES.in: Add cpu-frv.c and elf32-frv.c - * targets.c: Support bfd_elf32_frv_vec. - * reloc.c: Add FRV relocs. - * configure.in: Add support for bfd-elf32-frv-vec. - * config.bfd (targ_cpu): Add support for frv-*-elf. - * archures.c: Add frv arch and machines. - * Makefile.am (ALL_MACHINES): Add cpu-frv.lo. - (ALL_MACHINES_CFILES): Add cpu-frv.c. - (BFD32_BACKENDS): Add elf32-frv.lo. - (BFD32_BACKENDS_CFILES): Add elf32-frv.c - (cpu-frv.lo): New target. - (elf32-frv.lo): New target. - * cpu-frv.c: New file. - * elf32-frv.c: New file. - -2002-06-18 Jakub Jelinek - - * elfcode.h (elf_object_p): Sanity check eh_shoff == 0 implies - e_shnum == 0. - Only read the first section header if e_shoff is non-zero. - Don't consider e_shstrndx if there are no sections. - -2002-06-17 Tom Rix - - * elf32-d10v.c (elf_d10v_howto_table): Change R_D10V_10_PCREL_R, - R_D10V_10_PCREL_L and R_D10V_18_PCREL to use - complain_overflow_bitfield. - -2002-06-17 Alan Modra - - * opncls.c (bfd_openr): Remove redundant bfd_set_error. - (bfd_fdopenr): Likewise. - (bfd_openstreamr): Likewise. - (bfd_openw): Likewise. - - * targets.c: Sort target vecs. - (_bfd_target_vector): Add aix5coff64_vec, bfd_elf32_sh64_vec, - bfd_elf32_sh64l_vec, bfd_elf32_sh64lnbsd_vec, - bfd_elf32_sh64nbsd_vec, bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec, - bfd_elf64_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec. - * configure.in: Sort target vecs. Add m88kmach3_vec. - * configure: Regenerate. - -2002-06-16 Hans-Peter Nilsson - - * elf64-mmix.c (bpo_reloc_request_sort_fn): Use member - bpo_reloc_no to break sort order ties, not address of items. -2002-06-16 John David Anglin +2004-04-09 Daniel Jacobowitz - * elf-hppa.h (elf_hppa_final_link): Fix formatting in comment. - Skip excluded sections in determing __gp value. - (elf_hppa_final_link_relocate): Use the symbol's address in - R_PARISC_FPTR64 relocations that don't need an opd entry. - * elf64-hppa.c (allocate_dynrel_entries): Simplify code. - (elf64_hppa_finalize_dynreloc): Likewise. - (elf64_hppa_size_dynamic_sections): Move comments and fix typo. - (elf64_hppa_finish_dynamic_symbol): Break up assert. + * configure.in: Update version to 2.14.91. + * configure: Likewise. -2002-06-14 Sergey Grigoriev +2004-04-09 Daniel Jacobowitz - * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte - alignment for .bss, .data and .text sections so that sse and sse2 - code will work. - * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. - -2002-06013 J"orn Rennecke - - config.bfd: Add support for sh[1234]l*-*-elf* | sh3el*-*-elf*, - sh[1234]*-elf*. - -2002-06-12 John David Anglin - - * elflink.h (elf_bfd_final_link): Improve error handling for missing - dynamic sections. - - * elf64-hppa.c (allocate_global_data_opd): We don't need an opd entry - for a symbol that has no output section. - (allocate_dynrel_entries): Correct comment. - (elf64_hppa_finalize_dynreloc): Likewise. Don't create an opd entry - unless we want one. - (elf64_hppa_finalize_opd): Prevent segfault if dyn_h is NULL. - (elf64_hppa_finalize_dlt): Likewise. Prevent segfault for symbols - with no section. Remove unnecessary parentheses. - -2002-06-11 Tom Rix - - * coffcode.h (coff_compute_section_file_positions): Add data - section to AIX loader alignment check. - - * coff-rs6000.c (_bfd_xcoff_mkobject): Set default text section - alignment to 4 bytes. - (_bfd_xcoff_copy_private_bfd_data): Use text and data alignment - power accessor macro. - (do_shared_object_padding): Remove invalid assertion. - -2002-06-10 Richard Sandiford - - * section.c (_bfd_strip_section_from_output): Set SEC_EXCLUDE - for removed output sections. - -2002-06-10 Geoffrey Keating - - * merge.c (merge_strings): Use htab_create_alloc with calloc, not - htab_alloc. - * elf-strtab.c (_bfd_elf_strtab_finalize): Likewise. - -2002-06-08 H.J. Lu - - * elf.c (copy_private_bfd_data): Don't cast to bfd_size_type to - work around a long long bug in gcc 2.96 on mips. + Merge from mainline: + 2004-04-06 Daniel Jacobowitz + * elfxx-mips.c (MIPS_ELF_STUB_SECTION_NAME): Always use + ".MIPS.stubs". + + 2004-04-05 H.J. Lu + * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Always + reserve the memory for dynamic linker + + 2004-04-05 Mark Kettenis + * netbsd-core.c (CORE_WCOOKIE_OFFSET): New define. + (netbsd_core_file_p): Create a .wcookie section for OpenBSD/sparc. + + 2004-04-01 Andy Chittenden + * stabs.c (struct stab_link_includes_totals): Add field 'symb' + that keeps the characters in a B_INCL..B_EINCL range. + (_bfd_link_section_stabs): When computing the sum of the + characters in a B_INCL..B_EINCL range also keep a copy of those + characters. Use this information to distinguish between + include sections that have the same sum and the same length + but which are nevertheless unique. + + 2004-03-31 Andy Chittenden + * stabs.c (struct stab_link_includes_totals): Rename field 'total' + to 'sum_chars' and add field 'num_chars'. + (_bfd_link_section_stabs): When computing the sum of the + characters in a B_INCL..B_EINCL range also keep a count of the + number of characters. Use this information to help distinguish + between include sections when have the same sum but which + nevertheless are still unique. + + 2004-03-31 Mattias Engdegård + * stabs.c (_bfd_link_section_stabs): Do not skip N_EXCL stabs. + + 2004-03-19 John David Anglin + * elf32-hppa.c (elf32_hppa_check_relocs): Handle R_PARISC_PCREL32. + (final_link_relocate): Likewise. -2002-06-08 Jason Thorpe + 2004-03-19 John David Anglin + * elf-hppa.h (elf_hppa_reloc_final_type): Handle selectors for + R_PARISC_PCREL32 and R_PARISC_PCREL64 relocations. + + 2004-03-17 Nathan Sidwell + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Correct + logic for null_input_bfd detection. + + 2004-03-12 Nick Clifton + Dave Murphy + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Skip most checks + if the input bfd does not contain any code. + + 2004-03-02 Alexandre Oliva + * elf32-frv.c (struct frv_pic_relocs_info): Added fixups and + dynrelocs. + (_frv_count_got_plt_entries): Initialize them. + (frv_pic_relocs_info_find): Add insert argument. Adjust all + callers. + (frv_pic_relocs_info_for_global): Likewise. + (frv_pic_relocs_info_for_local): Likewise. + (frv_pic_merge_early_relocs_info): New. + (_frv_resolve_final_relocs_info): Use it in case one entry maps to + another. + (_frv_add_dyn_reloc): Add entry argument. Adjust all callers. + Check that we don't exceed the allocated count for entry. + (_frv_add_rofixup): Likewise. + (_frv_emit_got_relocs_plt_entries): Adjust for coding standards. + (elf32_frv_finish_dynamic_sections): Improve error message in case + we emit too few rofixup entries. + + 2004-02-27 Alexandre Oliva + * elf32-frv.c (elf32_frv_howto_table) : Set + complain_on_overflow to signed. + + 2004-02-27 Jakub Jelinek + * elf32-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL + for pc relative relocs. + (elf_s390_relocate_section): Likewise. + * elf64-s390.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL + for pc relative relocs. + (elf_s390_relocate_section): Likewise. - * Makefile.am (BFD32_BACKENDS): Add vax1knetbsd.lo. - (BFD32_BACKENDS_CFILES): Add vax1knetbsd.c. - Regenerate dependency lists. + 2004-02-26 H.J. Lu + * elfxx-ia64.c (elfNN_ia64_check_relocs): Fix call to + count_dyn_reloc. + + 2004-02-25 H.J. Lu + * elfxx-ia64.c (elfNN_ia64_dyn_reloc_entry): Add the reltext. + field to track if a relocation is against readonly section. + (count_dyn_reloc): Take a new argument for rent->reltext. + (elfNN_ia64_check_relocs): Adjust call to count_dyn_reloc. + (get_reloc_section): Don't set ia64_info->reltext here. + (allocate_dynrel_entries): Set ia64_info->reltext here. + + 2004-02-24 Alexandre Oliva + * elf32-frv.c (FRV_SYM_LOCAL): Weak undefined doesn't imply local. + (_frv_emit_got_relocs_plt_entries): Decay relocation to protected + function's descriptor to symbol+offset, and map local undefweak + symbol to NULL function descriptor. + (elf32_frv_relocate_section): Likewise. + + 2004-02-21 Danny Smith + * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Clear + IMAGE_SCN_MEM_WRITE on known sections only. + + 2004-02-19 Jakub Jelinek + * elf32-sparc.c (elf32_sparc_finish_dynamic_sections): Clear + .plt sh_entsize. + +2004-04-08 Richard Sandiford + + * elflink.c: Include libiberty.h. + * Makefile.am (elflink.lo): Depend on libiberty.h. * Makefile.in: Regenerate. - * config.bfd (vax-*-netbsdelf*, vax-*-netbsdaout*): Add - vax1knetbsd_vec to targ_selvecs. - * configure.in: Add vax1knetbsd_vec. - * configure: Regenerate. - * targets.c (_bfd_target_vector): Add vax1knetbsd_vec. - * vax1knetbsd.c: New file. - * vaxnetbsd.c: Update copyright years. - (TARGET_PAGE_SIZE): Set to 0x1000. - (DEFAULT_MID): Set to M_VAX4K_NETBSD. - -2002-06-08 Matt Thomas - - * libaout.h (enum machine_type): Add M_VAX4K_NETBSD. - -2002-06-08 Alan Modra - * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Make static. +2004-04-08 Alan Modra -2002-06-08 Alan Modra + Apply from mainline. + 2004-03-30 Jakub Jelinek + * elf.c (map_sections_to_segments): Fix handling of .tbss. - * Makefile.am: Run "make dep-am". + 2004-03-27 Alan Modra + * Makefile.am: Remove all mention of elflink.h. * Makefile.in: Regenerate. - - * armnetbsd.c: Replace CONST with const. - * corefile.c: Likewise. - * elf32-dlx.c: Likewise. - * elf64-mips.c: Likewise. - * mmo.c: Likewise. - * ns32knetbsd.c: Likewise. - - * elf64-sparc.c (sparc64_elf_add_symbol_hook): Check the hash - table is elf64-sparc. - -2002-06-08 Thiemo Seufer - - * elfxx-mips.c (_bfd_mips_elf_relocate_section): Simplify code. - Fix RELA addends to get not shifted in the result. Don't do special - handling of R_MIPS_64 for NewABI. - -2002-06-07 Alan Modra - - * aoutx.h (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc. - (NAME(aout,slurp_reloc_table)): Likewise. - * coff-mips.c (mips_relax_section): Use bfd_zalloc. - * coff-rs6000.c (xcoff_write_armap_big): Use bfd_zmalloc. - (xcoff_write_archive_contents_big): Likewise. - (xcoff_generate_rtinit): Likewise. - (xcoff_generate_rtinit): Likewise, and check error return. - * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise. - * coffgen.c (coff_section_symbol): Use bfd_zalloc. - (coff_get_normalized_symtab): Likewise. - (coff_make_empty_symbol): Likewise. - (bfd_coff_set_symbol_class): Likewise. - * cofflink.c (coff_link_add_symbols): Likewise. - * ecoff.c (_bfd_ecoff_make_empty_symbol): Likewise. - * ecofflink.c (ecoff_write_shuffle): Use bfd_zmalloc. - (bfd_ecoff_write_accumulated_debug): Likewise. - * elf64-alpha.c (get_got_entry): Use bfd_zalloc. - * i386linux.c (bfd_i386linux_size_dynamic_sections): Likewise. - * i386lynx.c (NAME(lynx,slurp_reloc_table)): Use bfd_zmalloc. - * ieee.c (do_with_relocs): Use bfd_zalloc. - * m68klinux.c (bfd_m68klinux_size_dynamic_sections): Likewise. - * pdp11.c (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc. - (NAME(aout,slurp_reloc_table)): Likewise. - (NAME(aout,squirt_out_relocs)): Don't memset when zalloc'd. - * reloc16.c (bfd_coff_reloc16_relax_section): Use bfd_zmalloc. - * som.c (som_build_and_write_symbol_table): Likewise. - (som_slurp_string_table): Likewise. - (som_slurp_symbol_table): Likewise. - (som_bfd_ar_write_symbol_stuff): Likewise. - * sparclinux.c (bfd_sparclinux_size_dynamic_sections): Use bfd_zalloc. - * sunos.c (bfd_sunos_size_dynamic_sections): Likewise. - * tekhex.c (find_chunk): Likewise. Get rid of unused "sname". - * vms-gsd.c (_bfd_vms_slurp_gsd): Use bfd_zmalloc. - * xcofflink.c (xcoff_link_add_symbols): Use bfd_zalloc/bfd_zmalloc. - -2002-06-07 Alan Modra - - * elf-bfd.h (struct bfd_elf_section_data ): Replace with - "group" union. - (elf_group_name): Update. - (elf_group_id): Define. - (bfd_elf_set_group_contents): Declare. - * elf.c (elf_fake_sections): Qualify use of elf_group_name. - (set_group_contents): Rename to bfd_elf_set_group_contents. Remove - ATTRIBUTE_UNUSED from failedptrarg. If elf_group_id is set, use - that sym for the signature. - (_bfd_elf_compute_section_file_positions): Don't call - set_group_contents for "ld -r" case. - (swap_out_syms): Use bfd_zalloc. - * elflink.h (elf_link_add_archive_symbols): Likewise. - (NAME(bfd_elf,size_dynamic_sections)): Likewise. - (elf_bfd_final_link): Call bfd_elf_set_group_contents. - -2002-06-07 Alan Modra - - * elf64-ppc.c (ppc64_elf_relocate_section): Allow unresolved - relocs in opd for non-shared too. - -2002-06-06 Jeffrey Law - - * merge.c: Include libiberty.h. - * elf-strtab.c: Include libiberty.h. - -2002-06-06 Elias Athanasopoulos - - * peXXigen.c (pe_print_idata): Remove unused variable. - -2002-06-06 David Heine - - * elf.c (assign_file_positions_for_segments): Remove unallocated - sections from the section to segment mapping for PT_LOAD segments. - Update comment about empty loadable segments. - -2002-06-06 Richard Sandiford - - * stabs.c (_bfd_link_section_stabs): Check that the symbol offset - is within the .stabstr section. - -2002-06-06 Alan Modra - - * elf-bfd.h (struct elf_size_info ): Function args - are "const PTR", not "const PTR *". - (bfd_elf32_swap_symbol_in): Likewise. - (bfd_elf64_swap_symbol_in): Likewise. - * elfcode.h (elf_swap_symbol_in): Change input args to const PTR. - (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in. - * elflink.h (elf_link_is_defined_archive_symbol): Likewise. - (elf_link_add_object_symbols): Likewise. - (elf_link_record_local_dynamic_symbol): Likewise. - (elf_link_input_bfd): Likewise. - (elf_gc_mark): Likewise. - (elf_reloc_symbol_deleted_p): Likewise. - * elf-m10200.c (mn10200_elf_relax_section): Likewise. - (mn10200_elf_relax_delete_bytes): Likewise. - (mn10200_elf_symbol_address_p): Likewise. - (mn10200_elf_get_relocated_section_contents): Likewise. - * elf-m10300.c (mn10300_elf_relax_section): Likewise. - (mn10300_elf_relax_section): Likewise. - (mn10300_elf_relax_delete_bytes): Likewise. - (mn10300_elf_symbol_address_p): Likewise. - (mn10300_elf_get_relocated_section_contents): Likewise. - * elf32-h8300.c (elf32_h8_relax_section): Likewise. - (elf32_h8_relax_delete_bytes): Likewise. - (elf32_h8_symbol_address_p): Likewise. - (elf32_h8_get_relocated_section_contents): Likewise. - * elf32-hppa.c (get_local_syms): Likewise. - * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise. - * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. - * elf32-sh.c (sh_elf_relax_section): Likewise. - (sh_elf_relax_delete_bytes): Likewise. - (sh_elf_get_relocated_section_contents): Likewise. - * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise. - * elf64-alpha.c (elf64_alpha_relax_section): Likewise. - * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. - * elf64-mmix.c (mmix_elf_relax_section): Likewise. - * elf64-ppc.c (get_local_syms): Likewise. - * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise. - * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. - -2002-06-05 J"orn Rennecke - - * config.bfd (sh64l*-*-elf*, shl*-*-elf*): New configurations. - -2002-06-05 Alan Modra - - * elf.c (group_signature): Swap in the whole symbol, and handle - extracting section symbol names. - (setup_group): Add comment. - (set_group_contents): When called from objcopy or ld, arrange for - section contents to be written. Write group member output section - indices to allow objcopy to reorganize sections. - (_bfd_elf_copy_private_section_data): Copy group info. - - * elf-bfd.h (struct elf_size_info): Add swap_symbol_in field. - (bfd_elf32_swap_symbol_in): Update prototype. - (bfd_elf64_swap_symbol_in): Likewise. - * elfcode.h (elf_swap_symbol_in): Change input args to const PTR *. - (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in. - * elflink.h (elf_link_is_defined_archive_symbol): Likewise. - (elf_link_add_object_symbols): Likewise. - (elf_link_record_local_dynamic_symbol): Likewise. - (elf_link_input_bfd): Likewise. - (elf_gc_mark): Likewise. - (elf_reloc_symbol_deleted_p): Likewise. - * elf-m10200.c (mn10200_elf_relax_section): Likewise. - (mn10200_elf_relax_delete_bytes): Likewise. - (mn10200_elf_symbol_address_p): Likewise. - (mn10200_elf_get_relocated_section_contents): Likewise. - * elf-m10300.c (mn10300_elf_relax_section): Likewise. - (mn10300_elf_relax_section): Likewise. - (mn10300_elf_relax_delete_bytes): Likewise. - (mn10300_elf_symbol_address_p): Likewise. - (mn10300_elf_get_relocated_section_contents): Likewise. - * elf32-h8300.c (elf32_h8_relax_section): Likewise. - (elf32_h8_relax_delete_bytes): Likewise. - (elf32_h8_symbol_address_p): Likewise. - (elf32_h8_get_relocated_section_contents): Likewise. - * elf32-hppa.c (get_local_syms): Likewise. - * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise. - * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. - * elf32-sh.c (sh_elf_relax_section): Likewise. - (sh_elf_relax_delete_bytes): Likewise. - (sh_elf_get_relocated_section_contents): Likewise. - * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise. - * elf64-alpha.c (elf64_alpha_relax_section): Likewise. - * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. - * elf64-mmix.c (mmix_elf_relax_section): Likewise. - * elf64-ppc.c (get_local_syms): Likewise. - * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise. - * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. - * elfcode.h (NAME(_bfd_elf,size_info)): Update initialiser. - * elf64-alpha.c (alpha_elf_size_info): Likewise. - * elf64-hppa.c (hppa64_elf_size_info): Likewise. - * elf64-mips.c (mips_elf64_size_info): Likewise. - * elf64-s390.c (s390_elf64_size_info): Likewise. - * elf64-sparc.c (sparc64_elf_size_info): Likewise. - -2002-06-05 Maciej W. Rozycki - - * elf32-mips.c (elf32_mips_ignore_discarded_relocs): Move to... - elfxx-mips.c (_bfd_mips_elf_ignore_discarded_relocs): ... here. - elf64-mips.c (elf_backend_ignore_discarded_relocs): Use - _bfd_mips_elf_ignore_discarded_relocs. - elfxx-mips.h (_bfd_mips_elf_ignore_discarded_relocs): Declare. - -2002-06-05 H.J. Lu - - * elfxx-mips.c (mips_elf_calculate_relocation): Call - _bfd_elf_rel_local_sym for STT_SECTION relocations against - the SEC_MERGE section. - -2002-06-05 Alan Modra - - * coff-alpha.c: Update copyright date. - * coff-mips.c: Likewise. - * xcoff-target.h: Likewise. - - * bfd-in.h: Remove "taken from the source" comment. - * libbfd-in.h: Likewise. - * libcoff-in.h: Likewise. - * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. - * libcoff.h: Regenerate. - - * elf.c (bfd_elf_discard_group): Return true. - * elf-bfd.h (bfd_elf_discard_group): Declare. - * bfd-in.h (bfd_elf_discard_group): Don't declare here. - * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. - * bfd.c (bfd_discard_group): Define. - * targets.c (struct bfd_target): Add _bfd_discard_group. - (BFD_JUMP_TABLE_LINK): Here too. - * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. - * aout-adobe.c (aout_32_bfd_discard_group): Define. - * aout-target.h (MY_bfd_discard_group): Define. - * aout-tic30.c (MY_bfd_discard_group): Define. - * binary.c (binary_bfd_discard_group): Define. - * bout.c (b_out_bfd_discard_group): Define. - * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. - * coffcode.h (coff_bfd_discard_group): Define. - * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. - * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. - * i386msdos.c (msdos_bfd_discard_group): Define. - * i386os9k.c (os9k_bfd_discard_group): Define. - * ieee.c (ieee_bfd_discard_group): Define. - * ihex.c (ihex_bfd_discard_group): Define. - * mmo.c (mmo_bfd_discard_group): Define. - * nlm-target.h (nlm_bfd_discard_group): Define. - * oasys.c (oasys_bfd_discard_group): Define. - * ppcboot.c (ppcboot_bfd_discard_group): Define. - * som.c (som_bfd_discard_group): Define. - * srec.c (srec_bfd_discard_group): Define. - * tekhex.c (tekhex_bfd_discard_group): Define. - * versados.c (versados_bfd_discard_group): Define. - * vms.c (vms_bfd_discard_group): Define. - * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. - * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. - (aix5coff64_vec): Likewise. - * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise. - -2002-06-04 Jason Thorpe - - * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-com.lo. - (BFD32_BACKENDS_CFILES): Add elf32-sh64-com.c. - (elf32-sh64-com.lo): New dependency list. - * Makefile.in: Regenerate. - * configure.in (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec) - (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec): Add - elf32-sh64-com.lo. - * configure: Regenerate. - * elf32-sh64.c (sh64_address_in_cranges) - (sh64_get_contents_type, sh64_address_is_shmedia): Move to... - (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb): - (crange_bsearch_cmpl): Prepend _bfd_sh64_ to name and move to... - * elf32-sh64-com.c: ...here. New file. - -2002-06-04 Alan Modra - - * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Remove - ATTRIBUTE_UNUSED on used params. - * elf32-vax.c (elf_vax_gc_mark_hook): Remove unnecessary checks - before calling bfd_section_from_elf_index on local syms. - * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise. - -2002-06-04 Jason Thorpe - - * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-nbsd.lo. - (BFD32_BACKENDS_CFILES): Add elf32-sh64-nbsd.c. - (BFD64_BACKENDS): Add elf64-sh64-nbsd.lo. - (BFD64_BACKENDS_CFILES): Add elf64-sh64-nbsd.c. - (elf32-sh64-nbsd.lo, elf64-sh64-nbsd.lo): New rules. - * Makefile.in: Regenerate. - * config.bfd (sh5le-*-netbsd*, sh5-*-netbsd*, sh64le-*-netbsd*) - (sh64-*-netbsd*): New targets. - * configure.in: Add bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec, - bfd_elf64_sh64nbsd_vec, and bfd_elf64_sh64lnbsd_vec. - * configure: Regenerate. - * elf32-sh64-nbsd.c: New file. - * elf64-sh64-nbsd.c: New file. - * targets.c: Add extern decls for bfd_elf32_sh64nbsd_vec, - bfd_elf32_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec, and - bfd_elf64_sh64lnbsd_vec. - -2002-06-04 Alan Modra - - * elf.c (setup_group): Set SEC_LINK_ONCE on GRP_COMDAT groups. - (bfd_section_from_shdr): Likewise. Set section name of group - sections from signature. - (group_signature): Split out from setup_group. Ensure symbol table - is available. - (bfd_elf_discard_group): New function. - (_bfd_elf_make_section_from_shdr): Don't set SEC_LINK_ONCE on - .gnu.linkonce* sections if they are members of a group. - (set_group_contents): Set GRP_COMDAT flag. - * section.c (bfd_discard_group): New function. - * bfd-in.h (bfd_elf_discard_group): Declare. - * bfd-in2.h: Regenerate. - * elf-bfd.h (struct bfd_elf_section_data): Add linkonce_p field. - (elf_linkonce_p): Define. - -2002-06-04 Alan Modra - - * elf.c (bfd_section_from_shdr): Make "name" const. - * elf-bfd.h (elf_backend_section_from_shdr): Likewise. - * elf32-i370.c (i370_elf_section_from_shdr): Likewise. - * elf32-ppc.c (ppc_elf_section_from_shdr): Likewise. - * elf32-sh64.c (sh64_backend_section_from_shdr): Likewise. - * elf32-v850.c (v850_elf_section_from_shdr): Likewise. - * elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise. - * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise. - * elf64-ppc.c (ppc64_elf_section_from_shdr): Likewise. - * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise. - * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise. - * elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise. - -2002-06-03 Maciej W. Rozycki - - * elfxx-mips.c (ABI_64_P): Use backend's data to determine the - ABI. - -2002-06-02 Kazu Hirata - - * elf32-arc.c: Fix formatting. - * elf32-arm.h: Likewise. - * elf32-cris.c: Likewise. - * elf32-dlx.c: Likewise. - * elf32-hppa.c: Likewise. - * elf32-i386.c: Likewise. - * elf32-i386qnx.c: Likewise. - * elf32-or32.c: Likewise. - * elf32-s390.c: Likewise. - * elf32-sh64.c: Likewise. - * elf32-vax.c: Likewise. - * elf32-xstormy16.c: Likewise. - * elf64-alpha.c: Likewise. - * elf64-mmix.c: Likewise. - * elf64-ppc.c: Likewise. - * elf64-s390.c: Likewise. - * elf64-sh64.c: Likewise. - * elf64-x86-64.c: Likewise. - -2002-06-02 Richard Henderson - - * elf64-alpha.c (elf64_alpha_relocate_section): Don't dereference - null when there are no got entries for a symbol. - (elf64_alpha_relax_find_tls_segment): Rearrange to avoid - uninitialized variable warning. - -2002-06-01 Richard Henderson - - * elf64-alpha.c (elf64_alpha_relax_with_lituse): Don't test for - undefined symbols here. - (elf64_alpha_relax_section): Do it here. Also test for not - defined in the current module. - (elf64_alpha_relocate_section_r): Split out of ... - (elf64_alpha_relocate_section): ... here. Don't dereference - NULL when looking up local got entries. - -2002-06-01 Richard Henderson - - * elf64-alpha.c (elf64_alpha_relax_with_lituse): Reject undefined - symbols from JSR relaxation. - (elf64_alpha_size_plt_section_1): New. - (elf64_alpha_calc_dynrel_sizes): Split out .rela.got bits ... - (elf64_alpha_size_rela_got_1): ... here. - (elf64_alpha_size_dynamic_sections): Split out .rela.got bits ... - (elf64_alpha_size_rela_got_section): ... here. - (elf64_alpha_size_plt_section): New. - (elf64_alpha_relax_section): Call them. - (elf64_alpha_size_got_sections): Remove output_bfd arg. - (elf64_alpha_finish_dynamic_symbol): Check gotent use_count. - -2002-06-01 Richard Henderson - - * elf64-alpha.c (alpha_get_dtprel_base, alpha_get_tprel_base): New. - (elf64_alpha_relocate_section): Use them. Reject LE TLS relocs - in shared libraries. Fix DTPRELHI and TPRELHI value. - (INSN_ADDQ, INSN_RDUNIQ): New. - (struct alpha_relax_info): Add symtab_hdr, tls_segment, first_gotent. - (elf64_alpha_relax_with_lituse): Return boolean. Remove irelend - argument. Reject dynamic symbols. Use LITUSE symbolic constants. - (elf64_alpha_relax_got_load): Rename from relax_without_lituse. - Handle GOTDTPREL and GOTTPREL relocations. - (elf64_alpha_relax_gprelhilo): New. - (elf64_alpha_relax_tls_get_addr): New. - (elf64_alpha_relax_find_tls_segment): New. - (elf64_alpha_relax_section): Handle TLS relocations. - (ALPHA_ELF_LINK_HASH_TLS_IE): New. - (elf64_alpha_check_relocs): Set it. - -2002-06-01 Richard Henderson - - * elf64-alpha.c (elf64_alpha_relax_section): Don't store computed gp. - - * elf64-alpha.c (elf64_alpha_check_relocs): Fix typo on maybe_dynamic - check; don't suppress dynamic relocs for non-allocated sections. - - * elf64-alpha.c: Remove dead code. - -2002-05-31 Alan Modra - + * bfd-in.h (bfd_elf_discard_info): Declare. + (bfd_elf32_discard_info, bfd_elf64_discard_info): Delete. * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. + * elf-bfd.h (bfd_elf32_print_symbol, bfd_elf64_print_symbol, + bfd_elf32_link_record_dynamic_symbol, + bfd_elf64_link_record_dynamic_symbol, + _bfd_elf_link_record_dynamic_symbol, bfd_elf32_bfd_final_link, + bfd_elf64_bfd_final_link, elf_link_record_local_dynamic_symbol, + _bfd_elf32_link_record_local_dynamic_symbol, + _bfd_elf64_link_record_local_dynamic_symbol, + _bfd_elf32_gc_sections, _bfd_elf32_gc_common_finalize_got_offsets, + _bfd_elf32_gc_common_final_link, _bfd_elf64_gc_common_final_link, + _bfd_elf32_gc_record_vtinherit, _bfd_elf32_gc_record_vtentry, + _bfd_elf64_gc_sections, _bfd_elf64_gc_common_finalize_got_offsets, + _bfd_elf64_gc_record_vtinherit, _bfd_elf64_gc_record_vtentry, + _bfd_elf32_reloc_symbol_deleted_p, + _bfd_elf64_reloc_symbol_deleted_p): Delete. + (bfd_elf_link_record_dynamic_symbol, + bfd_elf_link_record_local_dynamic_symbol, + bfd_elf_final_link, bfd_elf_gc_sections, + bfd_elf_gc_record_vtinherit, bfd_elf_gc_record_vtentry, + bfd_elf_gc_common_finalize_got_offsets, bfd_elf_gc_common_final_link, + bfd_elf_reloc_symbol_deleted_p): Declare. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + * elf32-arm.h: Update for changed function names. Remove local + WILL_CALL_FINISH_DYNAMIC_SECTION define. + * elf-hppa.h, elf-m10300.c, elf32-cris.c, elf32-d10v.c, elf32-dlx.c, + * elf32-fr30.c, elf32-frv.c, elf32-h8300.c, elf32-hppa.c, elf32-i386.c, + * elf32-iq2000.c, elf32-m32r.c, elf32-m68hc1x.c, elf32-m68k.c, + * elf32-mcore.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c, + * elf32-sh.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c, + * elf32-xstormy16.c, elf32-xtensa.c, elf64-alpha.c, elf64-hppa.c, + * elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, elf64-sparc.c, + * elf64-x86-64.c, elfxx-ia64.c, elfxx-mips.c, elfxx-target.h: Likewise. + * elfxx-target.h (bfd_elfNN_bfd_final_link): Define. + (bfd_elfNN_print_symbol): Define. + * elfcode.h: Don't include elflink.h. + (elf_bfd_discard_info, elf_reloc_symbol_deleted_p, + elf_link_record_dynamic_symbol, elf_bfd_final_link, elf_gc_sections, + elf_gc_common_finalize_got_offsets, elf_gc_common_final_link, + elf_gc_record_vtinherit, elf_gc_record_vtentry, + elf_link_record_local_dynamic_symbol): Don't define. + * elflink.c: Update for changed function names. Move elflink.h + code here. + * elflink.h: Delete file. * po/SRC-POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. - * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate - space for bss .plt. - -2002-05-31 Graeme Peterson - - * Makefile.am (BFD32_BACKENDS): Add elf32-i386qnx.lo. - (BFD32_BACKENDS_CFILES): Add elf32-i386qnx.c. - Run "make dep-am". - * Makefile.in: Regenerate. - * config.bfd: Add i[3456]86-*-nto-qnx* support. - * configure.in: Add bfd_elf32_i386qnx_vec support. - * configure: Regenerate. - * elf-bfd.h (struct elf_backend_data): Add set_nonloadable_filepos, - is_contained_by_filepos, and copy_private_bfd_data_p. - * elf.c (assign_file_positions_for_segments): Call backend - set_nonloadable_filepos. Fix non-K&R call to _bfd_error_handler. - (IS_CONTAINED_BY_FILEPOS): Define. - (INCLUDE_SECTION_IN_SEGMENT): Also test IS_CONTAINED_BY_FILEPOS. - (copy_private_bfd_data): Use IS_CONTAINED_BY_FILEPOS. Typo fix. - Fix non-K&R call to _bfd_error_handler. - (_bfd_elf_copy_private_section_data): Use backend - copy_private_bfd_data_p. - * elf32-i386.c: Don't include elfxx-target.h when - ELF32_I386_C_INCLUDED is defined. - * elf32-i386qnx.c: New QNX elf backend file. - * elfxx-target.h: Add elf_backend_set_nonloadable_filepos, - elf_backend_is_contained_by_filepos, and - elf_backend_do_copy_private_bfd_data. - * targets.c: Add bfd_target bfd_elf32_i386qnx_vec. - -2002-05-31 Alan Modra - - * elfarm-oabi.c (bfd_elf32_arm_add_glue_sections_to_bfd): Define. - Move other similar defines to start of file. - -2002-05-30 Tom Rix - - * coff-rs6000.c (xcoff_rtype2howto): Handle 16 bit R_RBA. - * coff64-rs6000.c (xcoff64_rtype2howto): Same. - -2002-05-30 Richard Henderson - - * elf64-alpha.c (ALPHA_ELF_LINK_HASH_LU_TLSGD, - ALPHA_ELF_LINK_HASH_LU_TLSLDM, ALPHA_ELF_LINK_HASH_LU_FUNC): New. - (ALPHA_ELF_GOT_ENTRY_RELOCS_DONE): Remove. - (ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Remove. - (struct alpha_elf_got_entry): Add reloc_type, reloc_done, reloc_xlated. - (struct alpha_elf_obj_tdata): Rename total_got_entries and - n_local_got_entries to total_got_size and local_got_size. - (elf64_alpha_howto, elf64_alpha_reloc_map): Update for TLS relocs. - (alpha_got_entry_size): New. - (elf64_alpha_relax_with_lituse): Use it. - (elf64_alpha_relax_without_lituse): Likewise. - (MAX_GOT_SIZE): Rename from MAX_GOT_ENTRIES. - (get_got_entry): New. - (elf64_alpha_check_relocs): Handle TLS relocs. Reorganize. - (elf64_alpha_adjust_dynamic_symbol): Test LU_FUNC as a mask. - (elf64_alpha_merge_ind_symbols): Check gotent->reloc_type. - (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots): Likewise. - (elf64_alpha_calc_got_offsets_for_symbol): Use alpha_got_entry_size. - (elf64_alpha_calc_got_offsets): Likewise. - (alpha_dynamic_entries_for_reloc): New. - (elf64_alpha_calc_dynrel_sizes): Use it. - (elf64_alpha_size_dynamic_sections): Likewise. - (elf64_alpha_relocate_section): Handle TLS relocations. - * reloc.c: Add Alpha TLS relocations. - * bfd-in2.h, libbfd.h: Rebuild. - -2002-05-29 Ralf Habacker - - * peXXigen.c (pe_print_idata): Remove double printed - import table lines; add Bound-To comment. - -2002-05-29 Matt Thomas - - * Makefile.am (BFD32_BACKENDS): Add elf32-vax.lo. - (BFD32_BACKENDS_CFILES): Add elf32-vax.c. - (elf32-vax.lo): New rule. - * Makefile.in: Regenerate. - * configure.in (bfd_elf32_vax_vec) - (vaxnetbsd_vec): New vectors. - * configure: Regenerate. - * config.bfd (vax-*-netbsdelf*) - (vax-*-netbsdaout*) - (vax-*-netbsd*): New targets. - * elf32-vax.c: New file. - * reloc.c: Add VAX relocations. - * bfd-in2.h: Regenerate. - * targets.c (_bfd_target_vector): Add bfd_elf32_vax_vec. - -2002-05-29 Jason Thorpe - - * config.bfd (arm-*-netbsd*): Add bfd_elf32_littlearm_vec - and bfd_elf32_bigarm_vec to targ_selvecs. - -2002-05-29 Ralf Habacker - - * peXXigen.c (pe_print_idata): Fix seg faults on printing import tables - with auto-imported symbols. - -2002-05-29 Adam Nemet - - * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Don't add glue - sections only record bfd. - (bfd_elf32_arm_add_glue_sections_to_bfd): New function. - * bfd-in.h (bfd_elf32_arm_add_glue_sections_to_bfd): Declare it. - * bfd-in2.h: Regenerate. - -2002-05-28 Nick Clifton - - * syms.c (_bfd_stab_section_find_nearest_line): Move - declaration and initialisation of saw_line and saw_func out of - for loop. - -2002-05-29 Alan Modra - - * elf64-ppc.c (ppc64_elf_get_symbol_info): New function. - (bfd_elf64_get_symbol_info): Define. - * elfxx-target.h (bfd_elfNN_get_symbol_info): Only define if undef. - -2002-05-29 Andrey Volkov - - * cpu-h8300.c: Make default h8300 machine first in machine list. - -2002-05-28 Kuang Hwa Lin - - * config.bfd: Added DLX configuraton. - * Makefile.am: Added DLX configuraton. - * configure.in: Added DLX configuraton. - * archures.c: Add DLX architecure. - * reloc.c: Add DLX relocs. - * targets.c: Added DLX target vector. - * configure: Regenerate. - * Makefile.in: Regenreate. - * bfd-in2.h: Regenreate. - * elf32-dlx.c: New file: Support DLX target. - * cpu-dlx.c: New file: Support DLX target. - -2002-05-25 Alan Modra - - * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Formatting. - - * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Revert last change. - (ppc64_elf_check_relocs): Don't set up function descriptor symbol - strings to point inside function code sym string. - (func_desc_adjust): Likewise. - (ppc64_elf_hide_symbol): Rewrite code to look up function code sym. - -2002-05-24 Michal Ludvig - - * elf64-x86-64.c (elf64_x86_64_grok_prstatus): Added. - (elf64_x86_64_grok_psinfo): Added. - -2002-05-24 TAMURA Kent - - * config.bfd: Add a target for i386-netbsdpe. - -2002-05-24 Alan Modra - - * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy is_func - and is_func_descriptor. - (func_desc_adjust): Hide function code sym in shared libs unless - there is a matching exported function descriptor sym. - -2002-05-23 Jakub Jelinek - - * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL - for symbols from SHF_TLS section. - (_bfd_elf_print_private_bfd_data): Add PT_TLS. - (elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections. - (map_sections_to_segments): Build PT_TLS segment if necessary. - (assign_file_positions_for_segments): Likewise. - (get_program_header_size): Account for PT_TLS segment. - (swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from - SEC_THREAD_LOCAL sections to STT_TLS. - * reloc.c: Add 386 and IA-64 TLS relocs. - * section.c (SEC_THREAD_LOCAL): Define. - (SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS): - Remove. - * elflink.h (elf_link_add_object_symbols): Support .tcommon. - (size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS - unconditionally. - (struct elf_final_link_info): Add first_tls_sec. - (elf_bfd_final_link): Set first_tls_sec. - Compute elf_hash_table (info)->tls_segment. - (elf_link_output_extsym): Handle STT_TLS symbols. - (elf_link_input_bfd): Likewise. - * syms.c (BSF_THREAD_LOCAL): Define. - * bfd-in2.h: Rebuilt. - * libbfd.h: Rebuilt. - * elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff, - elf_i386_mkobject, elf_i386_object_p): New functions. - (elf_howto_table): Add TLS relocs. - (elf_i386_reloc_type_lookup): Support TLS relocs. - (elf_i386_info_to_howto_rel): Likewise. - (struct elf_i386_link_hash_entry): Add tls_type. - (struct elf_i386_obj_tdata): New. - (elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type): - New macros. - (struct elf_i386_link_hash_table): Add tls_ldm_got. - (link_hash_newfunc): Clear tls_type. - (elf_i386_check_relocs): Support TLS relocs. - (elf_i386_gc_sweep_hook): Likewise. - (allocate_dynrelocs): Likewise. - (elf_i386_size_dynamic_sections): Likewise. - (elf_i386_relocate_section): Likewise. - (elf_i386_finish_dynamic_symbol): Likewise. - (bfd_elf32_mkobject, elf_backend_object_p): Define. - * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset, - dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done, - want_tprel, want_dtpmod, want_dtprel. - (elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions. - (ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to - R_IA64_LTOFF_TPREL22. - (elf_code_to_howto_index): Add TLS relocs. - (elfNN_ia64_check_relocs): Support TLS relocs. - (allocate_global_data_got): Account for TLS .got data. - (allocate_dynrel_entries): Account for TLS dynamic relocations. - (elfNN_ia64_install_value): Supprt TLS relocs. - (set_got_entry): Support TLS relocs. - (elfNN_ia64_relocate_section): Likewise. - -2002-05-23 Nick Clifton - - * elf32-arm.h (elf32_arm_final_link_relocate): For the Thumb - BLX reloc round the relocation up rather than down. - * coff-arm.c (coff_arm_relocate_section): Likewise. - -2002-05-21 H.J. Lu (hjl@gnu.org) - - * linker.c (_bfd_generic_link_add_one_symbol): Allow multiple - definition. - -2002-05-22 Alan Modra - - * elf64-ppc.c (ppc64_elf_size_stubs): Don't strip .branch_lt. - (ppc64_elf_relocate_section): Handle unresolved relocs in opd. - -2002-05-22 Alan Modra - - * elf64-ppc.c (ppc64_elf_relocate_section): Return false for - unresolved relocs. - (ppc64_elf_size_dynamic_sections): Check for splt NULL. - -2002-05-21 Thiemo Seufer - - * bfd/bfd.c (bfd_get_arch_size): Remove bfd_set_error call for - non-ELF targets. - -2002-05-21 Thiemo Seufer - - * elf-bfd.h (elf_backend_emit_relocs): Change prototype to return - an error value. - * elflink.h (elf_link_output_relocs): Likewise. Improve error message. - return with false on error. - (elf_link_input_bfd): Check reloc_emitter return value. - -2002-05-21 Jason Thorpe - - * config.bfd (armeb-*-netbsdelf*): New target. - -2002-05-20 Alan Modra - - * elf64-ppc.c (ppc_build_one_stub): Point undefined function syms - at the plt call stub. - -2002-05-19 Thiemo Seufer - - * cpu-mips.c (mips_compatible): Don't try to check machine - compatibility. - -2002-05-18 Tom Rix - - * coff64-rs6000.c (_bfd_xcoff64_swap_aux_out): Fix C_FILE auxent. - -2002-05-17 Alan Modra - - * elf64-ppc.c (ppc64_elf_info_to_howto): Formatting. - (ppc64_elf_relocate_section): Don't warn about reloc overflow when - we've already warned about an undefined symbol. Report more - detail on reloc errors. - -2002-05-17 Alan Modra - - * acinclude.m4 (AM_INSTALL_LIBBFD): New. - * configure.in: Invoke AM_INSTALL_LIBBFD. - * Makefile.am (install-data-local): Revert 2002-05-13. Move to.. - (install_libbfd): .. New target. - (uninstall_libbfd): Likewise. - (install-bfdlibLTLIBRARIES): Likewise. - (uninstall-bfdlibLTLIBRARIES): Likewise. - (bfdlibdir): New. - (bfdincludedir): New. - (lib_LTLIBRARIES): Rename to bfdlib_LTLIBRARIES. - * aclocal.m4: Regenerate. - * configure: Regenerate. - * Makefile.in: Regenerate. - -2002-05-17 Stuart Balfour - - * hash.c (bfd_hash_lookup): Remove computation of len from inside - hash loop. - -2002-05-16 Nick Clifton - - * config.bfd: Add targets for sh64-linux (little endian and - big endian). - -2002-05-15 Laurent Pinchart - - * peXXigen.c (pe_print_idata): Do not assume that the first thunk - is located in the same section as the import table. Instead - check, and if necessary load the section containing the thunk. - -2002-05-15 Nick Clifton - - * aix5ppc-core.c (xcoff64_core_p): Replace bfd_read with - bfd_bread. - (xcoff64_core_file_matches_executable_p): Replace bfd_read - with bfd_bread. - -2002-05-15 Alan Modra - - * aix5ppc-core.c: Warning fixes. - * aout-adobe.c (aout_32_bfd_link_just_syms): Define. - * aout-target.h (MY_bfd_link_just_syms): Define. - * aout-tic30.c (MY_bfd_link_just_syms): Define. - * bfd.c (bfd_link_just_syms): Define. - * binary.c (binary_bfd_link_just_syms): Define. - * bout.c (b_out_bfd_link_just_syms): Define. - * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update initializer. - * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise. - * coffcode.h (coff_bfd_link_just_syms): Define. - * elf-bfd.h (enum elf_link_info_type): Add ELF_INFO_TYPE_JUST_SYMS. - (elf_discarded_section): Check for ELF_INFO_TYPE_JUST_SYMS. - (_bfd_elf_link_just_syms): Declare. - * elf.c (_bfd_elf_link_just_syms): New function. - * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Check that - sections haven't already been discarded by the linker. - * elflink.h (elf_link_add_object_symbols): Likewise for stab - sections and SEC_MERGE sections. - (elf_bfd_discard_info): Similarly here. - * elfxx-target.h (bfd_elfNN_bfd_link_just_syms): Define. - * i386msdos.c (msdos_bfd_link_just_syms): Define. - * i386os9k.c (os9k_bfd_link_just_syms): Define. - * ieee.c (ieee_bfd_link_just_syms): Define. - * ihex.c (ihex_bfd_link_just_syms): Define. - * libbfd-in.h (_bfd_nolink_bfd_link_just_syms): Define. - (_bfd_generic_link_just_syms): Declare. - * libecoff.h (_bfd_ecoff_bfd_link_just_syms): Define. - * linker.c (_bfd_generic_link_just_syms): New function. - * mmo.c (mmo_bfd_link_just_syms): Define. - * nlm-target.h (nlm_bfd_link_just_syms): Define. - * oasys.c (oasys_bfd_link_just_syms): Define. - * ppcboot.c (ppcboot_bfd_link_just_syms): Define. - * som.c (som_bfd_link_just_syms): Define. - * srec.c (srec_bfd_link_just_syms): Define. - * targets.c (struct bfd_target): Add _bfd_link_just_syms. - (BFD_JUMP_TABLE_LINK): And here. - * tekhex.c (tekhex_bfd_link_just_syms): Define. - * versados.c (versados_bfd_link_just_syms): Define. - * vms.c (vms_bfd_link_just_syms): Define. - * libbfd.h: Regenerate. - * bfd-in2.h: Regenerate. - -2002-05-15 Thiemo Seufer - - * elf32-mips.c: Remove superfluous definitions copied from - elfxx-mips.c. - (bfd_elf32_bigmips_vec,bfd_elf32_littlemips_vec): Use the - SGIish vectors to check the special case. - (mips_elf_hi16_reloc): Fix comment. - (mips_elf_got16_reloc): Likewise. - (_bfd_mips_elf32_gprel16_reloc): Likewise. - (elf_reloc_map): Code cleanup. - (mips_reloc_map): Add comment. - (bfd_elf23_bfd_reloc_type_lookup): Code cleanup. - (mips_elf32_rtype_to_howto): Likewise. - (mips_elf32_discard_info): Likewise. - (elf32_mips_irix_compat): Invert logic: Only SGIish vectors - lead to IRIX compatibility now. - -2002-05-15 Thiemo Seufer - - * elfxx-mips.c: Call it IRIX, not Irix in comments. - -2002-05-13 Jason Thorpe - - * config.bfd (shle-*-netbsdelf*): Add target which includes - sh64 support. - -2002-05-13 David Edelsohn - - * configure.in: Revert 2002-04-07. Instead, auto-configure - HAVE_ST_C_IMPL. - * configure: Regenerate. - * config.in: Regenerate. - * rs6000-core.c (CNEW_IMPL): Guard use of c_impl with HAVE_ST_C_IMPL - or AIX_5_CORE. - -2002-05-11 Federico G. Schwindt - - * configure.in (sparc*-*-openbsd*): Support sparc64-openbsd - corefiles as well.2 - * configure: Regenerate. - -2002-05-13 Alan Modra - - * Makefile.am (install-data-local): Install headers to - $(exec_prefix)/include. - * Makefile.in: Regenerate. - -2002-05-11 Ralf Corsepius - Daniel Jacobowitz - - * coff-sh.c (sh_reloc_map): Map to R_SH_IMM32 for non-PE. Don't - map BFD_RELOC_RVA. - -2002-05-11 Federico G. Schwindt - - * config.bfd (alpha*-*-openbsd*, sparc64*-*-openbsd*, - hppa*-*-openbsd*): New targets. - * configure.in (alpha*-*-openbsd*): Set COREFILE. - * configure: Regenerate. - -2002-05-10 Tom Rix - - * coff64-rs6000.c (xcoff64_reloc_type_br): New function for - xcoff64_ppc_relocate_section. - * coff-rs6000.c : Extern common xcoff_reloc_type functions. - * libxcoff.h: Common xcoff_reloc_type function declaration. - -2002-05-10 Alan Modra - - * elf32-i386.c (elf_i386_relocate_section): Remove overflow checks - added in 2002-05-09 commit. - - * elf32-hppa.c (elf32_hppa_size_stubs): Revert part of 2002-05-04, - don't look for stubs on all undefined syms. - -2002-05-09 Alan Modra - - * elf64-ppc.c (RA_REGISTER_MASK, RA_REGISTER_SHIFT): Delete. - (ppc64_elf_howto_raw ): Not pc_relative or - pcrel_offset. - - * elf32-i386.c (elf_howto_table): Comments. - (elf_i386_relocate_section): Handle more relocs for relocatable - linking and against SEC_MERGE sections. - -2002-05-08 Alan Modra - - * elf32-ppc.c (ppc_elf_create_got): New function. - (ppc_elf_create_dynamic_sections): Call ppc_elf_create_got before - _bfd_elf_create_dynamic_sections. Correct .plt flags. - (ppc_elf_check_relocs): Use ppc_elf_create_got in place of - _bfd_elf_create_got_section. - -2002-05-07 Alan Modra - - * elf-bfd.h (struct elf_backend_data): Add rela_normal. - * elfxx-target.h (elf_backend_rela_normal): Define. - (elfNN_bed): Init rela_normal. - * elflink.h (elf_link_input_bfd ): Handle adjustment - for section symbols here if rela_normal. Simplify abs section test. - * elf-m10200.c (mn10200_elf_relocate_section): If relocatable, - return immediately. Remove code handling relocatable linking. - * elf-m10300.c (mn10300_elf_relocate_section): Likewise. - * elf32-fr30.c (fr30_elf_relocate_section): Likewise. + 2004-03-27 Alan Modra + * elf64-mmix.c (mmix_elf_relocate_section): Restore code setting + "name" for global syms accidentally removed in 2004-03-20 change. + + 2004-03-27 Alan Modra + * elf-bfd.h (struct elf_reloc_cookie): Add r_sym_shift field. + * elflink.h: Replace all occurrences of sizeof (Elf_External_*) + where Elf_External_* is different for 64 and 32 bit, with + corresponding elf_size_info field. + (struct elf_final_link_info): Use "bfd_byte *" instead + of "Elf_External_Sym *" for external_syms and symbuf. + (elf_link_adjust_relocs): Set up r_type_mask and r_sym_shift local + vars and use instead of ELF_R_INFO and ELF_R_TYPE macros. + (struct elf_link_sort_rela): Add "sym_mask" alias for "offset". + (elf_link_sort_cmp1): Use sym_mask field instead of ELF_R_SYM. + (elf_link_sort_cmp2): Adjust. + (elf_link_sort_relocs): Set up r_sym_mask local var instead of + using ELF_R_SYM macro. Set u.sym_mask. + (elf_bfd_final_link): Call _bfd_elf_stringtab_init instead of macro + version, elf_stringtab_init. Ditto for bfd_section_from_elf_index + vs. section_from_elf_index. Adjust Elf_External_Sym pointer + arithmetic. Pass bed to elf_link_flush_output_syms. Adjust + Elf_External_Dyn pointer arithmentic. Use bed swap_dyn_in and + swap_syn_out functions. Rearrange dyn swap in/out switch. + (elf_link_output_sym): Adjust Elf_External_Sym pointer arithmentic. + Pass bed to elf_link_flush_output_syms. Use bed swap_symbol_out. + (elf_link_flush_output_syms): Add elf_backend_data arg. + (elf_link_check_versioned_symbol): Likewise. + (elf_link_output_extsym): Pass bed to elf_link_check_versioned_symbol. + Adjust Elf_External_Sym pointer arithmetic. Use bed swap_symbol_out. + (elf_link_input_bfd): Use bfd_section_from_elf_index. Set up + r_type_mask and r_sym_shift local vars and use instead of ELF_R_SYM, + ELF_R_TYPE and ELF_R_INFO macros. + (elf_reloc_link_order): Select ELF32_R_INFO or ELF64_R_INFO invocation + based on size rather than using ELF_R_INFO. + (elf_gc_mark): Set up r_sym_shift local var and use instead of + ELF_R_SYM macro. + (struct alloc_got_off_arg): New. + (elf_gc_common_finalize_got_offsets): Use elf_size_info instead of + ARCH_SIZE. Pass get entry size down to elf_gc_allocate_got_offsets. + (elf_gc_allocate_got_offsets): Adjust. + (elf_reloc_symbol_deleted_p): Usee cookie.r_sym_shift instead of + ELF_R_SYM. Use bfd_section_from_elf_index. + (elf_bfd_discard_info): Set cookie.r_sym_shift. + * elfcode.h (elf_stringtab_init, section_from_elf_index): Delete. + (elf_slurp_symbol_table): Use bfd_section_from_elf_index. + + 2004-03-26 Alan Modra + * elf64-ppc.c (elf_backend_add_symbol_hook): Define. + (ppc64_elf_add_symbol_hook): New function. + * elf-bfd.h (struct elf_backend_data ): Remove + const from Elf_Internal_Sym param. + * elflink.c (elf_link_add_object_symbols): Adjust. + * elf-hppa.h (elf_hppa_add_symbol_hook): Adjust. + * elf32-frv.c (elf32_frv_add_symbol_hook): Adjust. + * elf32-i370.c (elf_backend_add_symbol_hook): Adjust. + * elf32-m32r.c (m32r_elf_add_symbol_hook): Adjust. + * elf32-m68hc1x.c (elf32_m68hc11_add_symbol_hook): Adjust. + * elf32-m68hc1x.h (elf32_m68hc11_add_symbol_hook): Adjust. + * elf32-ppc.c (ppc_elf_add_symbol_hook): Adjust. + * elf32-sh64.c (sh64_elf_add_symbol_hook): Adjust. + * elf32-v850.c (v850_elf_add_symbol_hook): Adjust. + * elf64-alpha.c (elf64_alpha_add_symbol_hook): Adjust. + * elf64-mmix.c (mmix_elf_add_symbol_hook): Adjust. + * elf64-sh64.c (sh64_elf64_add_symbol_hook): Adjust. + * elf64-sparc.c (sparc64_elf_add_symbol_hook): Adjust. + * elfxx-ia64.c (elfNN_ia64_add_symbol_hook): Adjust. + * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Adjust. + * elfxx-mips.h (_bfd_mips_elf_add_symbol_hook): Adjust. + + 2004-03-26 Alan Modra + * elfxx-target.h (bfd_elfNN_bfd_link_add_symbols): Define. + * elf-bfd.h (_bfd_elf_link_add_archive_symbols): Delete. + (_bfd_elf_sort_symbol, _bfd_elf_add_dt_needed_tag): Delete. + (_bfd_elf_finalize_dynstr, bfd_elf32_bfd_link_add_symbols): Delete. + (bfd_elf64_bfd_link_add_symbols): Delete. + (bfd_elf_link_add_symbols): Declare. + * elfcode.h (elf_bfd_link_add_symbols): Delete. + * elflink.c: Include safe-ctype.h. + (elf_add_dt_needed_tag): Rename from _bfd_elf_add_dt_needed_tag, + make static. + (elf_sort_symbol): Rename from _bfd_elf_sort_symbol, make static. + (elf_finalize_dynstr): Rename from _bfd_elf_finalize_dynstr, make + static. + (elf_link_add_archive_symbols): Rename from + _bfd_elf_link_add_archive_symbols, make static. + (elf_link_add_object_symbols): New function. Corresponding + elflink.h function converted to use elf_size_info. + (bfd_elf_link_add_symbols): Likewise. + (bfd_elf_size_dynamic_sections): Adjust. + * elflink.h (elf_bfd_link_add_symbols): Delete. + (elf_link_add_object_symbols): Delete. + * elf32-gen.c (elf32_generic_link_add_symbols): Call + bfd_elf_link_add_symbols. + * elf64-gen.c (elf64_generic_link_add_symbols): Likewise. + + 2004-03-25 Alan Modra + * elflink.h (elf_link_add_object_symbols): Add DT_NEEDED for as-needed + and chained shared libs only if dynsym. Clear dynsym on forced-local. + * elf-bfd.h (_bfd_elf_add_dynamic_entry): Declare. + (bfd_elf32_add_dynamic_entry, bfd_elf64_add_dynamic_entry): Delete. + (_bfd_elf_add_dt_needed_tag): Declare. + (_bfd_elf_sort_symbol): Declare. + (_bfd_elf_finalize_dynstr): Declare. + (RELOC_FOR_GLOBAL_SYM): Formatting. + * elfcode.h (elf_add_dynamic_entry): Delete. + * elflink.c (_bfd_elf_add_dynamic_entry): New function. Corresponding + elflink.h function converted to use elf_size_info. + (_bfd_elf_add_dt_needed_tag): Likewise. + (_bfd_elf_sort_symbol): Likewise. + (_bfd_elf_finalize_dynstr): Likewise. + (compute_bucket_count): Likewise. + (bfd_elf_size_dynamic_sections): Likewise. Check result of + _bfd_elf_strtab_add before calling _bfd_elf_strtab_addref. + (elf_adjust_dynstr_offsets, elf_collect_hash_codes): Moved from.. + * elflink.h: ..here. + (sort_symbol, add_dt_needed_tag): Delete. + (elf_add_dynamic_entry, elf_finalize_dynstr): Delete. + (compute_bucket_count, NAME(bfd_elf,size_dynamic_sections)): Delete. + Update all users. + * elf32-arm.h (add_dynamic_entry): Update. Remove casts. + * elf32-cris.c (add_dynamic_entry): Likewise. + * elf32-hppa.c (add_dynamic_entry): Likewise. + * elf32-i370.c (add_dynamic_entry): Likewise. + * elf32-i386.c (add_dynamic_entry): Likewise. + * elf32-m32r.c (add_dynamic_entry): Likewise. + * elf32-m68k.c (add_dynamic_entry): Likewise. + * elf32-ppc.c (add_dynamic_entry): Likewise. + * elf32-s390.c (add_dynamic_entry): Likewise. + * elf32-sh.c (add_dynamic_entry): Likewise. + * elf32-sparc.c (add_dynamic_entry): Likewise. + * elf32-vax.c (add_dynamic_entry): Likewise. + * elf32-xtensa.c (add_dynamic_entry): Likewise. + * elf64-alpha.c (add_dynamic_entry): Likewise. + * elf64-hppa.c (add_dynamic_entry): Likewise. + * elf64-ppc.c (add_dynamic_entry): Likewise. + * elf64-s390.c (add_dynamic_entry): Likewise. + * elf64-sparc.c (add_dynamic_entry): Likewise. + * elf64-x86-64.c (add_dynamic_entry): Likewise. + * elfxx-ia64.c (add_dynamic_entry): Likewise. + * elfxx-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise. + * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Likewise. + * elf32-frv.c (elf32_frv_size_dynamic_sections): Likewise. + * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. + + 2004-03-22 Alan Modra + * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Add input_bfd, input_section + and rel args. Group input and output args. Wrap to 80 columns. + * elf-m10200.c, elf-m10300.c, elf32-arm.h, elf32-avr.c, + elf32-cris.c, elf32-d10v.c, elf32-fr30.c, elf32-h8300.c, + elf32-hppa.c, elf32-i386.c, elf32-i860.c, elf32-ip2k.c, + elf32-iq2000.c, elf32-m68hc1x.c, elf32-m68k.c, elf32-mcore.c, + elf32-msp430.c, elf32-openrisc.c, elf32-ppc.c, elf32-s390.c, + elf32-sparc.c, elf32-v850.c, elf32-vax.c, elf32-xstormy16.c, + elf32-xtensa.c, elf64-alpha.c, elf64-mmix.c, elf64-ppc.c, + elf64-s390.c, elf64-sparc.c, elf64-x86-64.c, elfxx-ia64.c: Update + RELOC_FOR_GLOBAL_SYMBOL invocation. + + 2004-03-20 H.J. Lu + * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): Report error if + unresolved symbols in objects aren't allowed. + * elf-hppa.h (elf_hppa_relocate_section): Properly handle + unresolved symbols. + (elf_hppa_remark_useless_dynamic_symbols): Likewise. + (elf_hppa_unmark_useless_dynamic_symbols): + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_size_stubs): Likewise. + (elf32_hppa_relocate_section): Likewise. * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + * elfxx-mips.c (mips_elf_calculate_relocation): Likewise. + * elf-m10200.c (mn10200_elf_relocate_section): Use + RELOC_FOR_GLOBAL_SYMBOL. + * elf32-avr.c (elf32_avr_relocate_section): Likewise. + * elf32-d10v.c (elf32_d10v_relocate_section): Likewise. + * elf32-fr30.c (fr30_elf_relocate_section): Likewise. + * elf32-h8300.c (elf32_h8_relocate_section): Likewise. * elf32-i860.c (elf32_i860_relocate_section): Likewise. - * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-m68hc1x.c (m68hc11_get_relocation_value): Likewise. * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. - * elf32-ppc.c (ppc_elf_relocate_section): Likewise. - * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section): Likewise. * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. - * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. - * elf64-s390.c (elf_s390_relocate_section): Likewise. - * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. - * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. - * elf32-arm.h (elf32_arm_relocate_section): Likewise #ifndef USE_REL. - * elf32-m32r.c (m32r_elf_relocate_section): Likewise. - * elf-m10200.c (elf_backend_rela_normal): Define. - * elf-m10300.c (elf_backend_rela_normal): Define. - * elf32-fr30.c (elf_backend_rela_normal): Define. - * elf32-i370.c (elf_backend_rela_normal): Define. - * elf32-i860.c (elf_backend_rela_normal): Define. - * elf32-m68k.c (elf_backend_rela_normal): Define. - * elf32-mcore.c (elf_backend_rela_normal): Define. - * elf32-openrisc.c (elf_backend_rela_normal): Define. - * elf32-ppc.c (elf_backend_rela_normal): Define. - * elf32-s390.c (elf_backend_rela_normal): Define. - * elf32-xstormy16.c (elf_backend_rela_normal): Define. - * elf64-ppc.c (elf_backend_rela_normal): Define. - * elf64-s390.c (elf_backend_rela_normal): Define. - * elf64-x86-64.c (elf_backend_rela_normal): Define. - * elfxx-ia64.c (elf_backend_rela_normal): Define. - * elf32-arm.h (elf_backend_rela_normal): Define #ifndef USE_REL. - * elf32-m32r.c (elf_backend_rela_normal): Likewise. - -2002-05-06 Nick Clifton - - * elf32-arm.h (elf32_arm_final_link_relocate): Convert - 'reloc_signed_max' and 'reloc_signed_min' into half-word offsets. - -2002-05-06 Alan Modra - - * elflink.h (elf_link_input_bfd ): Adjust r_offset - when not relocatable. Fix reloc_emitter call for K&R. - -2002-05-04 Alan Modra - - * elf64-ppc.c (ppc64_elf_relocate_section): Reinstate code - reloading local sym addend mistakenly removed in 2002-05-01 change. - - * dwarf2.c (struct line_head): Make prologue_length a bfd_vma. - (read_abbrevs): Change "offset" param to bfd_vma. - (parse_comp_unit): Change "version" and addr_size to unsigned ints. - Change "abbrev_offset" to bfd_vma. - (read_indirect_string): Use correct conversion chars in error - message format string, cast bfd_vma's to unsigned long. - (read_abbrevs): Likewise. - (read_attribute_value): Likewise. - (decode_line_info): Likewise. - (scan_unit_for_functions): Likewise. - (parse_comp_unit): Likewise. - -2002-05-04 Tom Rix - - * coffswap.h (coff_swap_reloc_in): Remove XCOFF support. - (coff_swap_reloc_out): Same. - * coff-rs6000.c: (xcoff_swap_reloc_in): Moved from coffswap.h. - (xcoff_swap_reloc_out): Same. - (xcoff_rtype2howto): Renamed from _bfd_xcoff_rtype2howto. Special - case some 16 bit relocs. Add reloc value to output. - (xcoff_howto_table): Remove 64 bit R_POS, add 16 bit - R_RBR. Improve names. - (_bfd_xcoff_reloc_type_lookup): Adjust for removal of 64 bit R_POS. - (bfd_xcoff_backend_data): Update with new reloc swap names. - (bfd_pmac_xcoff_backend_data) : Same. - * coff64-rs6000.c: (xcoff64_swap_reloc_in): Moved from coffswap.h. - (xcoff64_swap_reloc_out): Same. - (xcoff64_rtype2howto): Special case some 16 bit relocs and 32 bit - R_POS. Add reloc value to output. - (xcoff64_howto_table): Move 64 bit R_POS to first entry. Add 16 - bit R_RBR. Improve names, masks. - (xcoff64_reloc_type_lookup): Adjust for move of 64 bit R_POS. - (bfd_xcoff_backend_data): Update with new reloc swap names. - (bfd_xcoff_aix5_backend_data) : Same. - -2002-05-04 Alan Modra - - * elf32-hppa.c (struct elf32_hppa_link_hash_table): Add - bfd_count top_index, input_list, all_local_syms. - (elf32_hppa_setup_section_lists): New function, split from - elf32_hppa_size_stubs. - (elf32_hppa_next_input_section): Likewise. - (group_sections): Likewise. - (get_local_syms): Likewise. - (elf32_hppa_size_stubs): Adjust for split out functions. Look for - stubs on undefined syms too. - (elf32_hppa_set_gp): Use bfd_link_hash* instead of elf_link_hash*. - Only access htab elf fields when we have an elf hash table. - * elf32-hppa.h (elf32_hppa_setup_section_lists): Declare. - (elf32_hppa_next_input_section): Declare. - -2002-05-04 Bob Byrnes - - * opncls.c (_bfd_new_bfd_contained_in): Check return value of - _bfd_new_bfd. - -2002-05-03 H.J. Lu (hjl@gnu.org) - - * elfxx-mips.c (mips_elf_link_hash_entry): Add forced_local. - (mips_elf_link_hash_newfunc): Initialize forced_local to false. - (mips_elf_record_global_got_symbol): Call _bfd_mips_elf_hide_symbol - to hide a global symbol. - (_bfd_mips_elf_hide_symbol): Return if forced_local is true. Set - forced_local to true. - -2002-05-02 Richard Henderson - - * elf64-alpha.c (elf64_alpha_relocate_section): Force relative relocs - vs SHN_UNDEF to zero. - -2002-05-02 Alan Modra - - * elf64-ppc.c (ppc64_elf_howto_raw ): Change to a - 16 bit reloc. - : Likewise. - (ppc64_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to - SECTOFF reloc. - * elf32-ppc.c (ppc_elf_howto_raw ): Correct. - (ppc_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to - SECTOFF reloc. - - * elf64-ppc.c (ppc64_elf_addr16_ha_reloc): Delete. - (ppc64_elf_ha_reloc): New function. - (ppc64_elf_brtaken_reloc): New function. - (ppc64_elf_sectoff_reloc): New function. - (ppc64_elf_sectoff_ha_reloc): New function. - (ppc64_elf_toc_reloc): New function. - (ppc64_elf_toc_ha_reloc): New function. - (ppc64_elf_toc64_reloc): New function. - (ppc64_elf_unhandled_reloc): New function. - (ppc64_elf_howto_raw): Use the above. - : Mark pc_relative, pcrel_offset. - : Not pc_relative or pcrel_offset. Fix dst_mask. - : Likewise. - (IS_ABSOLUTE_RELOC): Update. - (struct ppc_link_hash_table): Add have_undefweak. - (ppc64_elf_link_hash_table_create): Init. - (func_desc_adjust): Set have_undefweak. - (ppc64_elf_func_desc_adjust): Call func_desc_adjust earlier. Only - add the .sfpr blr when have_undefweak. - (ppc64_elf_setup_section_lists): Check hash table flavour. - (ppc64_elf_next_input_section): Move output_section->owner test to - ppc64elf.em. - (ppc64_elf_set_toc): Rename to ppc64_elf_toc, remove info param - and relocatable test. Return TOCstart and don't set elf_gp. - (ppc64_elf_relocate_section): Correct BRTAKEN/BRNTAKEN branch - offset calculation. Add assert on weak sym branch tweaks. - * elf64-ppc.h (ppc64_elf_set_toc): Delete. - (ppc64_elf_toc): Declare. - (ppc64_elf_next_input_section): Update. - -2002-05-01 Alan Modra - - * syms.c (_bfd_stab_section_find_nearest_line): Don't bomb on NULL - file_name. - -2002-05-01 Alan Modra - - * elf64-ppc.c (CROR_151515, CROR_313131): Define. - (ppc64_elf_relocate_section): Use them. Don't look for plt calls - on R_PPC64_ADDR24 relocs. Require a nop or no link reg on plt - call branches. Correct undefined weak destination. - (ppc64_elf_func_desc_adjust): Always create at least one blr in - .sfpr, and correct case where either only savef* or restf* is - needed. - - Long branch stubs, multiple stub sections. - * elf64-ppc.h (ppc64_elf_setup_section_lists): Declare. - (ppc64_elf_next_input_section): Declare. - * elf64-ppc.c: Move linker-only prototypes. - (STUB_SUFFIX): Define. - (enum ppc_stub_type): New. - (struct ppc_stub_hash_entry): New. - (struct ppc_branch_hash_entry): New. - (struct ppc_link_hash_entry): Add stub_cache, oh. - (struct ppc_link_hash_table): Add stub_hash_table etc. Remove - sstub. Add sbrlt, srelbrlt, has_14bit_branch, stub_iteration. - Rename plt_overflow to stub_error. - (ppc_stub_hash_lookup): Define. - (ppc_branch_hash_lookup): Define. - (stub_hash_newfunc): New function. - (branch_hash_newfunc): New function. - (link_hash_newfunc): Init new fields. - (ppc64_elf_link_hash_table_create): Likewise. - (ppc64_elf_link_hash_table_free): New function. - (ppc_stub_name): New function. - (ppc_get_stub_entry): New function. - (ppc_add_stub): New function. - (create_linkage_sections): Use bfd_make_section_anyway. Create - .branch_lt and .rela.branch_lt sections. Don't create .stub. - (ppc64_elf_check_relocs): Set has_14bit_branch on R_PPC64_REL14*, - and set up for plt call stubs. Link func and func desc syms. - (ppc64_elf_gc_sweep_hook): Handle REL14* as per REL24. - (func_desc_adjust): Avoid hash lookup when func desc sym available - via shortcut, and set links when processing. - (ppc64_elf_hide_symbol): Likewise. - (allocate_dynrelocs): Don't allocate stub section here. - (ppc64_elf_size_dynamic_sections): Handle sbrlt and srelbrlt. - Remove sstub code. - (ppc_type_of_stub): New function. - (build_one_stub): Delete. - (ppc_build_one_stub): New function. - (ppc_size_one_stub): New function. - (ppc64_elf_setup_section_lists): New function. - (ppc64_elf_next_input_section): New function. - (group_sections): New function. - (get_local_syms): New function. - (ppc64_elf_size_stubs): Rewrite. - (ppc64_elf_build_stubs): Rewrite. - (ppc64_elf_relocate_section): Look up stub entry for REL24 - relocs. Don't propagate REL14* to dynamic objects. Look for long - branch stubs if REL14* or REL24 relocs won't reach. - (bfd_elf64_bfd_link_hash_table_free): Define. - -2002-04-30 Mark Mitchell - - * bfd/config.bfd: Add support for powerpc-*-windiss. - -2002-04-30 Tom Rix - - * xcofflink.c (xcoff_link_add_symbols): Always copy undef C_EXT - symbol names into the hash table. - -2002-04-28 Tom Rix - - * coff-rs6000.c (xcoff_calculate_relocation) : Function table for - calulating relocations. - (xcoff_complain_overflow) : Function table for relocation errors. - (xcoff_ppc_relocate_section): Use relocation and complain function - tables. - (xcoff_complain_overflow_unsigned_func): New complain function. - (xcoff_complain_overflow_signed_func): Same. - (xcoff_complain_overflow_bitfield_func): Same. - (xcoff_complain_overflow_dont_func): Same. - (xcoff_reloc_type_crel): New recot function. - (xcoff_reloc_type_br): Same. - (xcoff_reloc_type_ba): Same. - (xcoff_reloc_type_toc): Same. - (xcoff_reloc_type_rel): Same. - (xcoff_reloc_type_neg): Same. - (xcoff_reloc_type_pos): Same. - (xcoff_reloc_type_fail): Same. - (xcoff_reloc_type_noop): Same. - * libxcoff.h : Declare common parts for xcoff64. - * coff64-rs6000.c (xcoff64_ppc_relocate_section): Use relocation - and complain function tables. - -2002-04-28 Alan Modra - - * elf64-x86-64.c (struct elf64_x86_64_dyn_relocs): Comment typo. - * elf32-hppa.c (elf32_hppa_final_link): Formatting. - -2002-04-26 Alan Modra - - * opncls.c (bfd_make_readable): Call bfd_section_list_clear. - * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise. - - * elflink.h (elf_bfd_final_link): Ensure input bfd class is the - same as the output before calling elf_link_input_bfd. - - * coffcode.h (coff_compute_section_file_positions): Set - section_tail after shuffling section list. - -2002-04-24 Christian Groessler - - * coff-z8k.c (extra_case): Fix R_IMM32 relocations: The - addresses are 23bit with a special layout, not plain 32bit - values. Prevent relocation of immediate values. - -2002-04-24 Chris G. Demetriou - - * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): If MDMX or - MIPS-16 ASE flags are set, print something to indicate that. - -2002-04-23 Alan Modra - - * elf32-hppa.c (hppa_type_of_stub): Correct and simplify condition - under which a plt call stub is used. - (final_link_relocate): Similarly. - (allocate_plt_static): Clear h-plabel except when plt entry is - exclusively used for a plabel. - (allocate_dynrelocs): Use the above to simplify plt sizing. - (struct elf32_hppa_link_hash_table): Add has_22bit_branch. - (elf32_hppa_link_hash_table_create): Init. - (BL22_RP): Define. - (hppa_build_one_stub): Use BL22_RP if has_22bit_branch. - (elf32_hppa_check_relocs): Set has_22bit_branch. - - * elf32-hppa.c (elf32_hppa_check_relocs): Remove debug message. - (final_link_relocate): Likewise. - -2002-04-22 Jakub Jelinek - - * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't build - search table if some FDE is DW_EH_PE_aligned encoded either. - (_bfd_elf_write_section_eh_frame): Handle terminating FDE specially. - -2002-04-22 Richard Smith - Jakub Jelinek - - * elf-eh-frame.c (struct eh_cie_fde): Add per_encoding_relative. - (_bfd_elf_discard_section_eh_frame): Set it for CIEs with pcrel - encoded personality. - (_bfd_elf_write_section_eh_frame): Adjust pcrel encoded personality - for CIE/FDE removal. - -2002-04-20 Tom Rix - - * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Fix C_FILE auxent. - -2002-04-20 Alan Modra - - * archures.c (bfd_lookup_arch): Move the list order comment.. - (struct bfd_arch_info): ..to where it belongs. + * elf64-mmix.c (mmix_elf_relocate_section): Likewise. + + 2004-03-19 Alan Modra + H.J. Lu + * elflink.c (_bfd_elf_merge_symbol): Revert last change. Move + type and size change code to where it was previously. Remove + dt_needed param. Treat old weak syms as strong if new sym is + from a shared lib, even when old sym is from another shared + lib. Remove unnecessary tests of oldweak and newweak. Correct + comments. + (_bfd_elf_add_default_symbol): Remove dt_needed param. Update + _bfd_elf_merge_symbol calls. + * elflink.h (elf_link_add_object_symbols): Update calls. Remove + dt_needed local var. Update comments. + * elf-bfd.h (_bfd_elf_merge_symbol): Update prototype. + (_bfd_elf_add_default_symbol): Likewise. + * elflink.c (_bfd_elf_merge_symbol): Reinstate code to handle + strong syms in one shared object overriding weak syms in another. + + 2004-03-18 Alan Modra + * elf-bfd.h (struct elf_obj_tdata): Delete dt_soname field. Add + dyn_lib_class field. Rearrange for better packing. + (elf_dt_soname): Delete. + (elf_dyn_lib_class): Define. + * elf.c (bfd_elf_set_dt_needed_name): Update comment. + (bfd_elf_set_dt_needed_soname): Delete. + (bfd_elf_set_dyn_lib_class): New function. + * elflink.h (add_dt_needed_tag): New function. Split out from.. + (elf_link_add_object_symbols): ..here. Rename "name" to "soname". + Use elf_dyn_lib_class to set dt_needed and add_needed. Move fallback + initialization of soname. + (elf_link_check_versioned_symbol): Test elf_dyn_lib_class instead of + elf_dt_soname. + * bfd-in.h (enum dynamic_lib_link_class): New. + (bfd_elf_set_dt_needed_soname): Delete. + (bfd_elf_set_dyn_lib_class): Declare. * bfd-in2.h: Regenerate. + * elflink.c (_bfd_elf_merge_symbol): Rewrite weak symbol handling. + (_bfd_elf_add_default_symbol): Remove indirect BFD_ASSERTs. + * elflink.h (elf_link_add_object_symbols): Don't clear dt_needed in + symbol loop. Instead use add_needed to flag tag as written. + + 2004-03-03 Alexandre Oliva + * elflink.c (bfd_elf_record_link_assignment): Mark undefweak and + undefined symbols as hash_new. + + 2004-02-28 H.J. Lu + * elf-bfd.h (_bfd_elf_link_add_archive_symbols): New prototype. + * elflink.h (is_global_data_symbol_definition): Moved to + elflink.c. + (elf_link_is_defined_archive_symbol): Likewise. + (elf_link_add_archive_symbols): Likewise. Renamed to + _bfd_elf_link_add_archive_symbols. + * elflink.c (elf_link_is_defined_archive_symbol): Get the size + of ELF symbol table entry from backend. + (_bfd_elf_link_add_archive_symbols): Call bfd_link_add_symbols + instead of elf_link_add_object_symbols. + + 2004-02-27 H.J. Lu + * elflink.h (sort_symbol): New. + (elf_link_add_object_symbols): Use a sorted symbol array for + weakdef. + + 2004-02-23 Jakub Jelinek + * elflink.h (size_dynamic_sections): If not adding DT_FLAGS and + DF_BIND_NOW is set in info->flags, create DT_BIND_NOW dynamic entry. + + 2004-02-21 H.J. Lu + * elflink.c (_bfd_elf_merge_symbol): Properly handle undefined + symbols with non-default visibility. + +2004-03-22 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_check_relocs): Remove code to read + literal tables and check for relocs outside of literal pools. + (elf_xtensa_make_sym_local): Don't clear ELF_LINK_NON_GOT_REF flag. + (elf_xtensa_fix_refcounts): Don't check ELF_LINK_NON_GOT_REF or + set DF_TEXTREL. + (elf_xtensa_size_dynamic_sections): Don't add DT_TEXTREL entry. + (elf_xtensa_relocate_section): Read literal tables and check for + dynamic relocations in read-only sections and not in literal pools. + +2004-03-23 Alan Modra + + PR 51. + * linker.c (bfd_wrapped_link_hash_lookup): Handle info->wrap_char. + +2004-03-22 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) : Also error if there's no PLT for a symbol + not defined by the executable, or defined in a DSO. + : Initialize GOT entry for a + function symbol or ELF_LINK_HASH_NEEDS_PLT statically in an + executable. + (cris_elf_gc_sweep_hook): Improve fallthrough marking. + (elf_cris_try_fold_plt_to_got): Improve head comment. Do not fold + a PLT reloc to GOT for an executable. + (elf_cris_adjust_dynamic_symbol): Only fold a .got.plt entry with + .got for a DSO and explain why. + (elf_cris_discard_excess_program_dynamics): Also lose GOT-relocs + and unreferenced symbols for which a PLT is defined. Adjust + dynamic-symbol pruning correspondingly, to make sure we don't lose + a dynamic symbol also defined by a DSO. + +2004-03-17 Ralf Corsepius + + * config.bfd: Switch sh-*-rtems* to ELF. Add sh-*-rtemscoff*. + +2004-03-16 Alan Modra + + * elflink.c (elf_link_read_relocs_from_section): Don't use + NUM_SHDR_ENTRIES in end of reloc calc. Move NULL shdr check.. + (_bfd_elf_link_read_relocs): ..to here. + * elf32-ppc.c (ppc_elf_relax_section): Formatting. - * archures.c (bfd_lookup_arch): Add comment on list order. - (bfd_default_set_arch_mach): Use bfd_lookup_arch. - * cpu-powerpc.c (bfd_powerpc_archs): Re-order so that the default - is always at head of list. - -2002-04-18 Nick Clifton - - * coff-arm.c (coff_thumb_pcrel_12, coff_thumb_pcrel_9, - insert_thumb_branch, record_thumb_to_arm_glue): Suppress - definition of these functions for ARM_WINCE builds as they are - not used. - (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET): Do not define - for ARM_WINCE builds. - -2002-04-18 Nick Clifton - - * coff-arm.c (bfd_arm_process_before_allocation): - -2002-04-17 J"orn Rennecke - - * cpu-sh.c (scan_mach): Delete. - (arch_info_struct): Replace scan_mach with bfd_default_scan. - (bfd_sh_arch): Likewise. - -2002-04-16 Nick Clifton - - * ihex.c (ihex_write_object_contents): Fix check for records - crossing 64K boundaries. - -2002-04-16 Alan Modra - - * elf32-m32r.c (m32r_elf_add_symbol_hook): Check the hash table - type rather than just assuming entries are ELF. - * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise. - * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise. - * elf64-sparc.c (sparc64_elf_add_symbol_hook): Likewise. - * elf64-mmix.c (mmix_elf_add_symbol_hook): Use bfd_link_hash_entry - rather than elf_link_hash_entry. - -2002-04-15 Richard Henderson - - * elf32-mips.c (mips_elf32_object_p): Revert 0404 fragment: allow - n32 binaries. - -2002-04-15 Michael Snyder - - * opncls.c (bfd_close): Write contents if writeable. - Minor formatting tidy-ups. - -2002-04-15 Alan Modra - - * elf32-ppc.c (ppc_elf_add_symbol_hook): Check the hash table type. - -2002-04-12 Michael Snyder - - * bfd-in.h (bfd_get_section_lma): New access macro. - Minor white-space fix-up. - -2002-04-12 Alan Modra - - * elf.c (prep_headers): Don't zero EI_OSABI, EI_ABIVERSION or - header pad. - -2002-04-09 DJ Delorie - - * elfarm-nabi.c (elf32_arm_howto_table): Fix ABS16 masks. - -2002-04-09 Casper S. Hornstrup - - * coffcode.h (coff_read_word): New. - (coff_compute_checksum): New. - (coff_apply_checksum): New. - (coff_write_object_contents): Call coff_apply_checksum () to - apply checksum to PE image. - -2002-04-08 Randolph Chung - - * elf32-hppa.c (hppa_unwind_entry_compare): Move to elf-hppa.h. - (elf32_hppa_final_link): Split out sorting logic to.. - * elf-hppa.h (elf_hppa_sort_unwind): ..here. - (elf_hppa_final_link): Call elf_hppa_sort_unwind. - -2002-04-07 Andrew Cagney - - * configure.in: Add missing ``|'' to powerpc-*-aix4.[4-9]* - pattern. - * configure: Re-generate. - -2002-04-07 Andrew Cagney - - * configure.in: Only define AIX_CORE_DUMPX_CORE when AIX version - is greater or equal to 4.3.3. + Merge from mainline. + 2004-02-20 Jakub Jelinek + * elf32-ppc.c (allocate_dynrelocs): Create dynsym for undef weak + symbols used in PIE relocs. + +2004-03-16 Alan Modra + + * configure.in (HOST_64BIT_TYPE, HOST_U_64BIT_TYPE): Don't override + values selected in configure.host. Require both to be defined + before setting BFD_HOST_64_BIT_DEFINED. Protect assignment to + corresponding BFD_HOST vars with quotes. + <${host64}-${target64}-${want64} in *true*>: Don't exempt gcc; + Always require BFD_HOST_64_BIT_DEFINED. + : Find off_t size before emitting message. Combine + off_t and ftello64 conditional. * configure: Regenerate. - Fix PR gdb/344. - -2002-04-05 Hans-Peter Nilsson - - * elf32-cris.c (cris_elf_howto_table) : Fix typo in name. - (cris_elf_check_relocs): Always create .rela.got here when - R_CRIS_16_GOTPLT or R_CRIS_32_GOTPLT is seen. - (elf_cris_adjust_gotplt_to_got): Don't create .rela.got here; - assume it's created. - -2002-04-04 Daniel Jacobowitz - - * aout-adobe.c (aout_32_bfd_link_hash_table_free): Define. - * aout-target.h (MY_bfd_link_hash_table_free): Conditionally - define. - * aout-tic30.c (MY_bfd_link_hash_table_free): Likewise. - * bfd.c (bfd_link_hash_table_free): Define. - * binary.c (binary_bfd_link_hash_table_free): Define. - * bout.c (b_out_bfd_link_hash_table_free): Define. - * coff-rs6000.c (rs6000coff_vec): Include - _bfd_generic_link_hash_table_free. - (pmac_xcoff_vec): Likewise. - * coff64-rs6000.c (rs6000coff64_vec): Likewise. - (aix5coff64_vec): Likewise. - * coffcode.h (coff_bfd_link_hash_table_free): Conditionally define. - * elf-m10300.c (elf32_mn10300_link_hash_table_free): New function. - (bfd_elf32_bfd_link_hash_table_free): Define. - * elf32-hppa.c (elf32_hppa_link_hash_table_free): New function. - (bfd_elf32_bfd_link_hash_table_free): Define. - * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Conditionally - define. - * i386msdos.c (msdos_bfd_link_hash_table_free): Define. - * i386os9k.c (os9k_bfd_link_hash_table_free): Define. - * ieee.c (ieee_bfd_link_hash_table_free): Define. - * ihex.c (ihex_bfd_link_hash_table_free): Define. - * libbfd-in.h (_bfd_nolink_bfd_link_hash_table_free): Define. - (_bfd_generic_link_hash_table_free): Add prototype. - * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Add prototype. - * libecoff.h (_bfd_ecoff_bfd_link_hash_table_free): Define. - * linker.c (_bfd_generic_link_hash_table_free): New function. - * mmo.c (mmo_bfd_link_hash_table_free): Define. - * nlm-target.h (nlm_bfd_link_hash_table_free): Define. - * oasys.c (oasys_bfd_link_hash_table_free): Define. - * ppcboot.c (ppcboot_bfd_link_hash_table_free): Define. - * som.c (som_bfd_link_hash_table_free): Define. - * srec.c (srec_bfd_link_hash_table_free): Define. - * tekhex.c (tekhex_bfd_link_hash_table_free): Define. - * versados.c (versados_bfd_link_hash_table_free): Define. - * vms.c (vms_bfd_link_hash_table_free): New function. - * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_free): New function. - - * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_malloc - instead of bfd_alloc. - * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise. - * coff-mcore.c (coff_mcore_link_hash_table_create): Likewise. - * coff-ppc.c (ppc_coff_link_hash_table_create): Likewise. - * cofflink.c (_bfd_coff_link_hash_table_create): Likewise. - * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise. - * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise. - * elf.c (_bfd_elf_link_hash_table_create): Likewise. - * elf32-arm.h (elf32_arm_link_hash_table_create): Likewise. - * elf32-cris.c (elf_cris_link_hash_table_create): Likewise. - * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise. - * elf32-i386.c (elf_i386_link_hash_table_create): Likewise. - * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise. - * elf32-s390.c (elf_s390_link_hash_table_create): Likewise. - * elf32-sh.c (sh_elf_link_hash_table_create): Likewise. - * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create): Likewise. - * elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise. - * elf64-s390.c (elf_s390_link_hash_table_create): Likewise. - * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise. - * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create): Likewise. - * elf64-x86-64.c (elf64_x86_64_link_hash_table_create): Likewise. - * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise. - * linker.c (_bfd_generic_link_hash_table_create): Likewise. - * m68klinux.c (linux_link_hash_table_create): Likewise. - * sparclinux.c (linux_link_hash_table_create): Likewise. - * sunos.c (sunos_link_hash_table_create): Likewise. - * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise. - - * targets.c: Add _bfd_link_hash_table_free to xvec. - - * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. - * libcoff.h: Regenerate. - -2002-04-04 Alan Modra - - * dep-in.sed: Cope with absolute paths. - * Makefile.am (dep.sed): Subst TOPDIR, and not INCDIR. - Run "make dep-am". - * Makefile.in: Regenerate. - * coff-arm.c: Fix copyright date. - * cpu-h8300.c: Likewise. - * cpu-i370.c: Likewise. - * cpu-s390.c: Likewise. - * cpu-mips.c: Likewise. - * po/SRC-POTFILES.in: Regenerate. - -2002-04-04 Thiemo Seufer - * Makefile.am: Add elfxx-mips.c to the known backends. - (elf32-mips.lo): remove dependency to coff/external.h. - * Makefile.in: Regenerate. - * configure.in: Add elfxx-mips.lo to all vectors using elf32-mips.lo - Remove elf32-mips.lo from 64 bit vectors. Update dependencies - accordingly. +2004-03-16 Alan Modra + + * elf32-m32r.c (m32r_elf_create_dynamic_sections): Fix pointer + aliasing warning. Remove trailing whitespace throughout file. + +2004-03-15 John David Anglin + + * elf-hppa.h (elf_hppa_relocate_section): Pass input_bfd instead of + input_section in calls to get_dyn_name. + * elf64-hppa.c (get_dyn_name): Change type of first argument to "bfd *". Use section id of first section in input BFD to build dynamic name for + local symbols. + (elf64_hppa_check_relocs): Pass abfd in call to get_dyn_name. + +2004-03-15 Alan Modra + + * bfd-in.h (bfd_int64_t, bfd_uint64_t): New types. + (BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Don't define here. + (bfd_getb64, bfd_getl64, bfd_get_bits): Return bfd_uint64_t. + (bfd_getb_signed_64, bfd_getl_signed_64): Return bfd_int64_t. + (bfd_putb64, bfd_putl64, bfd_put_bits): Accept bfd_uint64_t. + * configure.in (HOST_U_64BIT_TYPE): Set when sizeof long is 8. + (BFD_HOST_64_BIT_DEFINED, BFD_HOST_64_BIT, BFD_HOST_U_64_BIT): Set + when using long. + * libbfd.c (EIGHT_GAZILLION, COERCE64): Use bfd_int64_t. + (bfd_getb64): Return bfd_uint64_t. Enable when BFD_HOST_64_BIT. + (bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise. + (bfd_putb64): Accept bfd_uint64_t. Enable when BFD_HOST_64_BIT. + (bfd_putl64, bfd_put_bits, bfd_get_bits): Likewise. + * dwarf2.c (struct attribute): Use bfd_int64_t and bfd_uint64_t. + (read_8_bytes, read_indirect_string, read_address): Likewise. + (read_abbrevs, parse_comp_unit): Likewise. + * targets.c (struct bfd_target): Likewise. + * aix386-core.c (NO_GET64, NO_PUT64, NO_GETS64): Define and use. + * hppabsd-core.c: Likewise. Formatting. + * hpux-core.c: Likewise. + * irix-core.c: Likewise. + * netbsd-core.c: Likewise. + * osf-core.c: Likewise. + * ptrace-core.c: Likewise. + * sco5-core.c: Likewise. + * trad-core.c: Likewise. * configure: Regenerate. - * elf-bfd.h: Move all MIPS ELF specific prototypes to elfxx-mips.h. - (irix_compat_t): IRIX compatibility level, moved from elf32-mips.c. - (elf_backend_mips_irix_compat, elf_backend_mips_rtype_to_howto): New - MIPS specific backend functions. - * elf32-mips.c: Moved most code to elfxx-mips.c. - (mips_elf_hi16_reloc): Rename from _bfd_mips_elf_hi16_reloc and make - static. - (mips_elf_lo16_reloc): Likewise, was _bfd_mips_elf_lo16_reloc. - (mips_elf_got16_reloc): Likewise, was _bfd_mips_elf_got16_reloc. - (mips_elf_gprel32_reloc): Likewise, was _bfd_mips_elf_gprel32_reloc. - (mips_elf32_rtype_to_howto): Rename from mips_rtype_to_howto. Changed - interface to allow selection of the right REL or RELA howto table. - (mips_elf32_object_p): Rename from _bfd_mips_elf_object_p and made - static. Let it refuse n32 objects. - (elf32_mips_grok_prstatus): Rename from _bfd_elf32_mips_grok_prstatus. - (elf32_mips_grok_psinfo): Rename from _bfd_elf32_mips_grok_psinfo. - (elf32_mips_discard_info): Rename from _bfd_elf32_mips_discard_info. - (elf32_mips_ignore_discarded_relocs): Rename from - _bfd_elf32_mips_ignore_discarded_relocs. - (elf32_mips_write_section): Rename from _bfd_elf32_mips_write_section. - (elf32_mips_irix_compat): New function, replaces IRIX_COMPAT. - (elf_mips_howto_table_rela): Remove. - * elf64-mips.c: Moved most code to elfxx-mips.c. - (bfd_elf64_bfd_reloc_type_lookup): Make static. - (mips_elf64_rtype_to_howto): New function. - (mips_elf64_object_p): Likewise. - (elf64_mips_irix_compat): Likewise. - * elfxx-mips.c: New file containing common code merged together from - elf32-mips.c and elf64-mips.c. - * elfxx-mips.h: New file containing MIPS specific prototypes from - elf-bfd.h. - * elfxx-target.h: Add handling for elf_backend_mips_irix_compat and - elf_backend_mips_rtype_to_howto. - -2002-04-04 Alan Modra - - * srec.c (MAXCHUNK, Chunk): Revise comments. - (srec_write_record): Correct buffer size. - (srec_write_header): Do without intermediate buffer. - (srec_write_section): Validate Chunk. - (srec_write_terminator): Pass NULL instead of dummy buffer. - (srec_write_symbols): Pass file and symbol names directly to - bfd_bwrite so sprintf won't overflow buffer. - -2002-04-03 Jakub Jelinek - - * elf32-sparc.c (elf32_sparc_relocate_section): Don't emit dynamic - PC relative relocs against hidden symbols. - * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. - -2002-04-03 Alan Modra - - * elf.c (_bfd_elf_make_section_from_shdr): When setting section - LMAs, loop over segments until p_vaddr and p_memsz specify an - extent enclosing the section. - -2002-04-02 Nick Clifton - - * ihex.c (ihex_write_object_contents): Do not allow records to - cross a 64K boundary - wrap if necessary. - -2002-04-01 Nathan Williams - - * elf.c (elfcore_netbsd_get_lwpid): Fix off-by-one error - which caused the returned LWP ID to always be 0. - -2002-04-01 Richard Henderson - - * elf32-sparc.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New. - (elf32_sparc_relocate_section): Use it to figure out when to - initialize .got entries. - * elf64-sparc.c: Similarly. - -2002-03-28 Alan Modra - - * linker.c (link_action): Ignore duplicate warning syms. - (_bfd_generic_link_write_global_symbol): Follow warning symbol link. - * elflink.h (elf_adjust_dynstr_offsets): Likewise. - (elf_adjust_dynamic_symbol): Likewise. - (elf_export_symbol): Likewise. - (elf_link_find_version_dependencies): Likewise. - (elf_link_assign_sym_version): Likewise. - (elf_link_sec_merge_syms): Likewise. - (elf_link_output_extsym): Likewise. - (elf_gc_sweep_symbol): Likewise. - (elf_gc_propagate_vtable_entries_used): Likewise. - (elf_gc_smash_unused_vtentry_relocs): Likewise. - (elf_gc_allocate_got_offsets): Likewise. - (elf_collect_hash_codes): Likewise. - * elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise. - * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise. - (elf_hppa_remark_useless_dynamic_symbols): Likewise. - * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise. - * elf32-arm.h (elf32_arm_discard_copies): Likewise. - * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise. - (elf_cris_discard_excess_dso_dynamics): Likewise. - * elf32-hppa.c (clobber_millicode_symbols): Likewise. - (mark_PIC_calls): Likewise. - (allocate_plt_static): Likewise. - (allocate_dynrelocs): Likewise. - (readonly_dynrelocs): Likewise. - * elf32-i386.c (allocate_dynrelocs): Likewise. - (readonly_dynrelocs): Likewise. - * elf32-i370.c (i370_elf_adjust_dynindx): Likewise. - * elf32-m68k.c (elf_m68k_discard_copies): Likewise. - * elf32-mips.c (mips_elf_output_extsym): Likewise. - (mips_elf_sort_hash_table_f): Likewise. - (mips_elf_check_mips16_stubs): Likewise. - * elf32-s390.c (allocate_dynrelocs): Likewise. - (readonly_dynrelocs): Likewise. - * elf32-sh.c (sh_elf_discard_copies): Likewise. - * elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise. - (xstormy16_relax_plt_realloc): Likewise. - * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise. - (elf64_alpha_output_extsym): Likewise. - * elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise. - * elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise. - (mips_elf64_check_mips16_stubs): Likewise. - (mips_elf64_output_extsym): Likewise. - * elf64-ppc.c (func_desc_adjust): Likewise. - (allocate_dynrelocs): Likewise. - (readonly_dynrelocs): Likewise. - * elf64-s390.c (allocate_dynrelocs): Likewise. - (readonly_dynrelocs): Likewise. - * elf64-sh64.c (sh64_elf64_discard_copies): Likewise. - * elf64-x86-64.c (allocate_dynrelocs): Likewise. - (readonly_dynrelocs): Likewise. - * elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise. - * aoutx.h (aout_link_write_other_symbol): Likewise. - * cofflink.c (_bfd_coff_write_task_globals): Likewise. - (_bfd_coff_write_global_sym): Likewise. - * i386linux.c (linux_tally_symbols): Likewise. - * m68klinux.c (linux_tally_symbols): Likewise. - * sparclinux.c (linux_tally_symbols): Likewise. - * pdp11.c (aout_link_write_other_symbol): Likewise. - * sunos.c (sunos_scan_dynamic_symbol): Likewise. - * xcofflink.c (xcoff_build_ldsyms): Likewise. - (xcoff_write_global_symbol): Likewise. - - * cofflink.c (_bfd_coff_final_link): Formatting. - * cpu-mips.c (mips_compatible): Make static, prototype. - * elf32-i386.c (elf_i386_check_relocs): Formatting. - * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. - * elf64-alpha.c (elf64_alpha_output_extsym): Likewise. - * elf64-mips.c (mips_elf64_sort_hash_table): Likewise. - (mips_elf64_final_link): Likewise. - * elflink.h (elf_link_find_version_dependencies): Remove duplicate - prototype. - -2002-03-27 Nick Clifton - - * coff-arm.c (SWAP_IN_RELOC_OFFSET): Define. - (SWAP_OUT_RELOC_OFFSET): Define. - -2002-03-27 Gregory Steuck - - * elf.c (_bfd_elf_get_symtab_upper_bound): Leave space for - terminating NULL if empty symbol table. - (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise. - -2002-03-26 H.J. Lu (hjl@gnu.org) - - * elflink.h (elf_link_input_bfd): Revert the last change since - the gcc exception handling isn't fixed yet. - -2002-03-26 H.J. Lu (hjl@gnu.org) - - * elflink.h (elf_link_input_bfd): Complain about relocations - against local symbols in discarded sections. - -2002-03-26 Alan Modra - - * elflink.h (elf_gc_mark): Don't recurse into non-ELF sections. - -2002-03-23 Alan Modra - - * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on - section file offset for !SEC_LOAD sections. - -2002-03-21 Richard Earnshaw - - * elf32-arm.h (elf32_arm_final_link_relocate , - ): Handle relocations to Thumb functions. - -2002-03-21 Alan Modra - - * coff64-rs6000.c (_bfd_xcoff64_put_symbol_name): Prototype. - Whitespace changes. - * archive.c: Update copyright date. * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. - * Makefile.am: Run "make dep-am" - * Makefile.in: Regenerate. - * po/SRC-POTFILES.in: Regenerate. - -2002-03-20 Daniel Jacobowitz - - * dwarf2.c (struct funcinfo): Move up. - (lookup_address_in_function_table): New argument function_ptr. - Set it. - (lookup_address_in_line_table): New argument function. If function - is non-NULL, use it to handle ``addr'' before the first line note of - the function. - (comp_unit_find_nearest_line): Update and swap calls to - lookup_address_in_function_table and lookup_address_in_line_table. - * syms.c (_bfd_stab_section_find_nearest_line): Use the first - N_SLINE encountered if we see an N_FUN before any N_SLINE. - -2002-03-20 Tom Rix - - * coff-rs6000.c (_bfd_xcoff_stat_arch_elt): Renamed from - _bfd_xcoff_generic_stat_arch_elt. Fix format check. - * coff64-rs6000.c : Use _bfd_xcoff_stat_arch_elt. - -2002-03-19 Tom Rix - - * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Look through all - dynamic objects in archives. - -2002-03-19 Hans-Peter Nilsson - - * elflink.h (NAME(bfd_elf,record_link_assignment)): Don't set - STT_NOTYPE symbols to STT_OBJECT. - -2002-03-18 Jan Hubicka - - * cpu-i386.c (bfd_x86_64_arch): Rename to "i386:x86-64" - -2002-03-18 Tom Rix - - * aix5ppc.core.c : New file for AIX 5 64 bit core support. - * bfd-in.h : Add bfd_xcoff_ar_archive_set_magic declaration. - * coff-rs6000 (do_pad) : New function for archive padding. - (do_copy) : New function for object file copying in archives. - (do_shared_object_padding) : New function for padding shared - objects to their text section alignment in archives. - (bfd_xcoff_ar_achive_set_magic) : Stub. - (xcoff_write_armap_big) : Use do_copy and do_pad. - (xcoff_write_archive_contents_big) : Use do_shared_object_padding, - do_copy and do_pad. - * coff64-rs6000.c (xcoff64_write_ojbect_contents) : Use - bfd_xcoff_magic_number. - (xcoff64_bad_format_hook) : New function for _bfd_bad_format_hook - fop. - (xcoff_backend_data_r) : Use xcoff64_bad_format_hook. - (bfd_xcoff_aix5_backend_data) : New Aix 5 backend data. - (aix5coff64_vec) : New Aix 5 target aix5coff64-rs6000. - * rs6000-core.c : Update copyright date. - * xcofflink.c (bfd_xcoff_size_dynamic_sections): Check for NULL - csectpp. - * coffcode.h (coff_new_section_hook) : Use new accessor macros. - (coff_set_arch_mach_hook) : Add Aix 5 U64_TOCMAGIC magic #. - (coff_set_flags) : Use bfd_xcoff_magic_number. - * libxcoff.h (bfd_xcoff_is_xcoff64): Add U64_TOCMAGIC. - * configure.in : Add powerpc-*-aix5 and rs6000-*-aix5 support. - * Makefile.am : Same. - * config.bfd : Same. - * targets.c : Same. - * configure : Regnerate. - * Makefile.in : Same. - * bfd-in2.h : Same. - -2002-03-18 Nick Clifton - - * po/fr.po: Updated version. - -2002-03-18 Alan Modra - - * libbfd.c (bfd_write_bigendian_4byte_int): Return true iff success. - * libbfd.h: Regenerate. - * archive.c (coff_write_armap): Pass on failures from - bfd_write_bigendian_4byte_int. - -2002-03-14 H.J. Lu - - * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the BFD - error to bfd_error_nonrepresentable_section for reinit_array - section in DSO. - -2002-03-14 Nick Clifton - - * coffcode.h (coff_slurp_symbol_table): When adding BSF_WEAK flag, - OR it in rather than replacing previously selected flags. - - * elfxx-target.h (TARGET_BIG_SYM): Set ar_max_namelen to 15. - (TARGET_LITTLE_SYM): Set ar_max_namelen to 15. - -2002-03-14 Alan Modra - - * cpu-mips.c (mips_compatible): New. Don't check bits_per_word. - (N): Use the above. - * elflink.h (elf_bfd_final_link): Revert last change. Instead, - ensure reloc size matches before calling elf_link_input_bfd. - Add an assert to check reloc size when counting output relocs. - -2002-03-14 Nick Clifton - - * mmo.c (mmo_get_loc): Return NULL rather than false. - -2002-03-13 Nick Clifton - - * po/fr.po: Updated version. - -2002-03-13 Alan Modra - - * archures.c (bfd_default_compatible): Test bits_per_word. - * cpu-i386.c (i386_compatible): Remove. Replace occurrences with - bfd_default_compatible. - * cpu-i370.c (i370_compatible): Likewise. - * cpu-sparc.c (sparc_compatible): Likewise. - * cpu-h8300.c (compatible): Test in->arch == out->arch. - - * elflink.h: Formatting fixes. - (elf_link_output_extsym): Merge undefined and undef weak cases. - - * elflink.h (elf_bfd_final_link): Only call elf_link_input_bfd - when word size of input matches output word size. - -2002-03-12 Andreas Jaeger - - * cpu-i386.c (i386_compatible): New. Use it instead of - bfd_default_compatible. - -2002-03-07 H.J. Lu (hjl@gnu.org) - - * coff-sh.c (shcoff_reloc_map): Use bfd_reloc_code_real_type - as the type for bfd_reloc_val. - -2002-03-05 John David Anglin - - * elf-hppa.h (elf_hppa_is_dynamic_loader_symbol): New function. - (elf_hppa_relocate_section): Ignore undefined dynamic loader symbols. - (elf_hppa_final_link_relocate): Correct relocations for indirect - references to local data through the DLT. Fix .opd creation for - local symbols using R_PARISC_LTOFF_FPTR32 and R_PARISC_FPTR64 - relocations. Use e_lsel selector for R_PARISC_DLTIND21L, - R_PARISC_LTOFF_FPTR21L and R_PARISC_LTOFF_TP21L as per - "Processor-Specific ELF for PA_RISC, Version 1.43" document. - Similarly, use e_rsel for DLT and LTOFF 'R' relocations. - * elf32-hppa.c (final_link_relocate): Revise relocation selectors - as per "Processor-Specific ELF for PA_RISC, Version 1.43" document. - -2002-03-05 Jakub Jelinek - - * merge.c (_bfd_merge_sections): Don't segfault if there - is nothing to merge due to GC. - -2002-03-05 Alan Modra - * elf32-hppa.c (clobber_millicode_symbols): Remove hack to keep - symbols that have been forced local. - - * elflink.h (elf_bfd_final_link): Call elf_link_output_extsym - to output forced local syms for non-shared link. - (elf_link_output_extsym): Tweak condition for calling backend - adjust_dynamic_symbol so that previous behaviour is kept. - Whitespace changes throughout file. - -2002-03-04 H.J. Lu - - * elf.c (bfd_section_from_shdr): Handle special sections, - .init_array, .fini_array and .preinit_array. - (elf_fake_sections): Likewise. - - * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Create the - DT entry only if the section is in output for .init_array, - .fini_array and .preinit_array. Complain about .preinit_array - section in DSO. - (elf_bfd_final_link): Warn zero size for .init_array, - .fini_array and .preinit_array sections. - - * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Remove - SHT_INIT_ARRAY, SHT_FINI_ARRAY and SHT_PREINIT_ARRAY. - (elfNN_ia64_fake_sections): Remove .init_array, .fini_array and - .preinit_array. - -2002-03-04 Alan Modra - - * configure.in (WIN32LIBADD): Don't eval PICFLAG assignment. - * configure: Regenerate. - -2002-03-02 Tom Rix - - * coff64-rs6000.c (xcoff64_howto_table): Replace howto types with - symbolic equiv. - * coff-rs6000.c (xcoff_howto_table): Same. - -2002-03-01 David Mosberger - - * elflink.h (size_dynamic_sections): If section named - ".preinit_array" exists, create DT_PREINIT_ARRAY and - DT_PREINIT_ARRAYSZ entries in dynamic table. Analogously for - ".init_array" and ".fini_array". - (elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ, - DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and - DT_FINI_ARRAY. - -2002-02-26 Andrew Macleod - - * elflink.h (elf_bfd_final_link): Don't crash on SHN_UNDEF local - dynsyms. - -2002-02-25 Alan Modra - - * elf64-hppa.h: Update copyright date. - - * elf64-ppc.c (ppc64_elf_check_relocs): Warning fix. - (ppc64_elf_relocate_section): Don't generate power4 style branch - hints for *_BRTAKEN and *_BRNTAKEN relocs. - -2002-02-22 Jakub Jelinek - - * elf64-sh64.c (sh_elf64_relocate_section): Fix a typo from my - last patch. - * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. - -2002-02-21 Andreas Jaeger - - * elf64-x86-64.c: Major rework that introduces all recent changes - to the x86-64 backend. Get a closer match to elf32-i386. - (struct elf64_x86_64_dyn_relocs): Rename from - elf64_x86_64_pcrel_relocs_copied, add additional fields. Change - all users. - (struct elf64_x86_64_link_hash_table): Add short cuts to some - sections. - (link_hash_newfunc): Rename from elf64_x86_64_link_hash_newfunc, - remove casts, initialize new hash members. - (create_got_section): New. - (elf64_x86_64_create_dynamic_sections): New. - (elf64_x86_64_copy_indirect_symbol): New. - (elf64_x86_64_check_relocs): Don't allocate space for dynamic - relocs, .got or .relgot here but do it in allocate_dynrelocs. - Reference count possible .plt and .got entries. Don't test input - section SEC_READONLY here to try to avoid copy relocs, and keep - dyn_relocs regardless of ELF_LINK_NON_GOT_REF. Don't set - DF_TEXTREL here. Delay setting of variables until needed. Cache - pointer to "sreloc" section in elf_section_data. Tweak condition - under which .got created. Report files with bad relocation - section names. - (elf64_x86_64_gc_sweep_hook): Sweep dyn_relocs and local_dynrel. - Reference count possible .plt entries. Don't deallocate .got and - .relgot space here. - (elf64_x86_64_adjust_dynamic_symbol): Handle nocopyreloc. Don't - do copy reloc processing for weakdefs. Remove redundant casts and - aborts. Delay setting of vars until needed. Move creation of - dynamic symbols and allocation of .plt and .rela.plt to - allocate_dynrelocs. Replace BFD_ASSERT with abort. - (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New. - (allocate_dynrelocs): New. - (readonly_dynrelocs): New. - (elf64_x86_64_size_dynamic_sections): Call readonly_dynrelocs. - Allocate space for dyn relocs. Replace BFD_ASSERT with abort. - Zero out the dynamic allocated content space. - (elf64_x86_64_discard_copies): Removed. - (elf64_x86_64_relocate_section): Make use of dynamic section - short-cuts. Localise vars, and delay setting. Better error - reporting, replace BFD_ASSERT with abort. Check - ELF_LINK_HASH_DEF_DYNAMIC to see if a symbol is not defined in the - regular object file and tread the weak definition as the normal - one. Don't discard relocs for undefweak or undefined symbols and - check !DEF_REGULAR as well as DEF_DYNAMIC in test for avoided copy - relocs. - (elf64_x86_64_finish_dynamic_symbol): Don't copy relocs for - symbols that have been forced local. Use same test to decide if - we can use a relative reloc for got as relocate_section. Expand - SHN_UNDEF comment. Move expressions out of function calls. - Replace BFD_ASSERT with abort. - (bfd_elf64_bfd_final_link): Removed. - (elf_backend_copy_indirect_symbol): Define. - -2002-02-20 Tom Rix - - * coff-rs6000.c (xcoff_howto_table): Add 16 bit R_BA. - (_bfd_xcoff_reloc_type_lookup): Use it. - * coff64-rs6000.c (xcoff64_howto_table): Same. - (xcoff64_reloc_type_lookup): Same. - -2002-02-20 Peter Schauer - - * osf-core.c (osf_core_vec): OSF/1 (Digital Unix) core files are - little endian. - -2002-02-19 Martin Schwidefsky - - * archures.c (bfd_mach_s390_esa): Rename to bfd_mach_s390_31. - (bfd_mach_s390_esame): Rename to bfd_mach_s390_64. - * bfd-in2.h: Regenerate. - * cpu-s390.c (arch_info_struct): Use renamed architecture defines. - Replace architecture name "s390" with "s390:31-bit" and "s390:esame" - with "s390:64-bit". - * elf32-s390.c (elf_howto_table): Add 32 bit pc relative relocations. - (elf_s390_reloc_type_lookup): Likewise. - (elf_s390_check_relocs): Likewise. - (elf_s390_gc_sweep_hook): Likewise. - (elf_s390_relocate_section): Likewise. - (elf_s390_object_p): Use renamed architecture define. - * elf64-s390.c (elf_s390_object_p): Use renamed architecture define. - -2002-02-19 Frank Ch. Eigler - - * syms.c (stt[]): Sorted. Added .init/.fini -> "t" mapping. - -2002-02-19 Jakub Jelinek - - * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Enable - absptr -> pcrel optimization for shared libs. - Only create minimal .eh_frame_hdr if absptr FDE encoding in shared - library cannot be converted to pcrel. - (_bfd_elf_eh_frame_section_offset): Return -2 if making absptr - relative. - * elf32-i386.c (elf_i386_relocate_section): If - _bfd_elf_section_offset returned -2, skip, but make sure the - relocation is installed. - * elf32-arm.h (elf32_arm_final_link_relocate): Likewise. - * elf32-cris.c (cris_elf_relocate_section): Likewise. - * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. - * elf32-i370.c (i370_elf_relocate_section): Likewise. - * elf32-m68k.c (elf_m68k_relocate_section): Likewise. - * elf32-ppc.c (ppc_elf_relocate_section): Likewise. - * elf32-s390.c (elf_s390_relocate_section): Likewise. - * elf32-sh.c (sh_elf_relocate_section): Likewise. - * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. - * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. - * elf64-s390.c (elf_s390_relocate_section): Likewise. - * elf64-sh64.c (sh_elf64_relocate_section): Likewise. - * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. - * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. - * elf64-alpha.c (elf64_alpha_relocate_section): Handle - _bfd_elf_section_offset returning -2 the same way as -1. - * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Likewise. - * elf32-mips.c (mips_elf_create_dynamic_relocation): Add FIXME - and BFD_ASSERT. - * elf64-mips.c (mips_elf64_create_dynamic_relocation): Likewise. - -2002-02-18 Tom Rix - - * xcofflink.c (bfd_xcoff_link_gernate_rtinit): Add -brtl support. - (bfd_xcoff_size_dynamic_sections): Same. - * bfd-in.h (bfd_xcoff_link_generate_rtinit): Same. - (bfd_xcoff_size_dynamic_sections): Same. - * coff-rs6000.c (xcoff_generate_rtinit): Same. - * coff-rs646000.c (xcoff64_generate_rtinit): Same. - * libxcoff.h (struct xcoff_backend_data_rec): Same. - * xcofflink.c (xcoff_build_ldsyms, xcoff_link_add_symbols): Clean. +2004-03-15 Alan Modra + + * bfd-in.h (bfd_getb64, bfd_getl64): Replace bfd_byte* with void*. + (bfd_getb32, bfd_getl32, bfd_getb16, bfd_getl16): Likewise. + (bfd_getb_signed_64, bfd_getl_signed_64): Likewise. + (bfd_getb_signed_32, bfd_getl_signed_32): Likewise. + (bfd_getb_signed_16, bfd_getl_signed_16): Likewise. + (bfd_putb64, bfd_putl64, bfd_putb32, bfd_putl32): Likewise. + (bfd_putb16, bfd_putl16, bfd_get_bits, bfd_put_bits): Likewise. + * libbfd.c: Likewise in function definitions. + (bfd_put_8): Mask with 0xff rather than casting to char. + (bfd_putb16, bfd_putl16, bfd_putb32, bfd_putl32): Likewise. + (bfd_putb64, bfd_putl64, bfd_put_bits): Likewise. + (H_PUT_64, H_PUT_32, H_PUT_16, H_PUT_8): Remove casts, simplify. + (H_PUT_S64, H_PUT_S32, H_PUT_S16, H_PUT_S8): Likewise. + (H_GET_64, H_GET_32, H_GET_16, H_GET_8): Likewise. + (H_GET_S64, H_GET_S32, H_GET_S16, H_GET_S8): Likewise. + * libaout.h (H_PUT_64 H_PUT_32, H_PUT_16): Remove casts, simplify. + (H_PUT_S64, H_PUT_S32, H_PUT_S16): Likewise. + (H_GET_64, H_GET_32, H_GET_16): Likewise. + (H_GET_S64, H_GET_S32, H_GET_S16): Likewise. + * archive.c (do_slurp_coff_armap): Update swap prototype. + * coff-tic54x.c (tic54x_getl32): Replace bfd_byte* with void*. + (tic54x_getl_signed_32): Likewise. + (tic54x_putl32): Likewise. Mask with 0xff rather than casting to char. + * mach-o.c (bfd_mach_o_read_header): Update get32 prototype. + * pdp11.c (bfd_getp32): Make static, replace bfd_byte* with void*. + (bfd_getp_signed_32, bfd_putp32): Likewise. + * targets.c (struct bfd_target): Use void* in place of bfd_byte* for + bfd_getx64, bfd_getx_signed_64, bfd_putx64, bfd_getx32, + bfd_getx_signed_32, bfd_putx32, bfd_getx16, bfd_getx_signed_16, + bfd_putx16, bfd_h_getx64, bfd_h_getx_signed_64, bfd_h_putx64, + bfd_h_getx32, bfd_h_getx_signed_32, bfd_h_putx32, bfd_h_getx16, + bfd_h_getx_signed_16, bfd_h_putx16. + * aix386-core.c (NO_GET, NO_GETS, NO_PUT): Update prototypes. + * hppabsd-core.c: Similarly. Rename NO_SIGNED_GET to NO_GETS. + * hpux-core.c: Likewise. + * irix-core.c: Likewise. + * netbsd-core.c: Likewise. + * osf-core.c: Likewise. + * ptrace-core.c: Likewise. + * sco5-core.c: Likewise. + * trad-core.c: Likewise. * bfd-in2.h: Regenerate. -2002-02-18 Alan Modra +2004-03-15 Matt Thomas - * elf64-ppc.c (STFD_FR0_0R1, LFD_FR0_0R1, BLR): Define. - (struct ppc_link_hash_table): Add sfpr. - (ppc64_elf_link_hash_table_create): Init it. - (ppc64_elf_create_dynamic_sections): Split creation of .stub and - .glink out to.. - (create_linkage_sections): ..here. Make .sfpr too. - (ppc64_elf_check_relocs): Call create_linkage_sections, and set - dynobj early. - (MIN_SAVE_FPR, MAX_SAVE_FPR): Define. - (ppc64_elf_func_desc_adjust): Look for missing ._savef* and - ._restf* functions, and create as needed. - (func_desc_adjust): Only force_local for shared libs. + * config.bfd: Add x86-64 vector to NetBSD/i386 if 64bit BFD is + selected. -2002-02-18 David O'Brien +2004-03-13 Mark Kettenis - * configure.in: Bump version number post 2.12 branching. + * config.bfd: Add x86_64-*-openbsd*. + * configure.in (x86_64-*-openbsd*): Set COREFILE to + netbsd-core.lo. * configure: Regenerate. -2002-02-17 Hans-Peter Nilsson - - * mmo.c: Correct and improve comments. - (mmo_write_chunk): Store trailing byte in bfd buffer; don't - zero-pad. Use input to fill up non-empty bfd buffer. - (mmo_flush_chunk): New function. - (mmo_write_loc_chunk): Add parameter last_vmap, all callers - changed. Don't emit location specifier if VMA is same as - *LAST_VMAP after omitting leading zero contents. Call - mmo_flush_chunk before emitting location specifier. - (mmo_write_loc_chunk_list): Call mmo_flush_chunk when finished - with mmo_write_loc_chunk calls. - (mmo_internal_write_section): Call mmo_flush_chunk after - mmo_write_chunk. - (mmo_write_symbols_and_terminator): Move :Main to first position - in symbol array. Add faked one if it does not exist if there are - other symbols. Don't add it if there are no symbols at all. Move - out test for value of :Main from symbol loop. Rename table - fakemain to maintable and variable mainsym to fakemain. - -2002-02-15 Richard Henderson +2004-03-09 Steve Ellcey - * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: A target - section with no got matches any got. Simplify error generaion. + * elfxx-ia64.c (plt_full_entry): Change ld8 to ld8.acq. -2002-02-15 Alan Modra +2004-03-05 Nathan Sidwell - Support arbitrary length fill patterns. - * linker.c (bfd_new_link_order): Zero all fields with bfd_zalloc. - (_bfd_default_link_order): Remove bfd_fill_link_order code. - Call default_data_link_order. - (default_fill_link_order): Delete. - (default_data_link_order): New function. - * elf32-mips.c (_bfd_mips_elf_final_link): Replace occurrences - of bfd_fill_link_order with bfd_data_link_order. - * elf64-alpha.c (elf64_alpha_final_link): Likewise. - * elf64-mips.c (mips_elf64_final_link): Likewise. + * elf.c (map_sections_to_segments): Ignore .tbss sections for + layout purposes. - * bfd.c (bfd_scan_vma): Clamp overflows to max bfd_vma value. - Correct value returned in "end" for "0x". - -2002-02-14 Nick Clifton - - * cpu-arm.c (processors): Replace 'arch' field with 'mach'. - (scan): Test against 'mach' field in info structure. - -2002-02-14 Alan Modra - - * elf.c (elf_fake_sections): Use SHT_NOBITS when SEC_NEVER_LOAD. - -2002-02-14 Matt Fredette - - * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Recognize - EF_M68000. - -2002-02-13 Nick Clifton - - * elf.c (_bfd_elf_make_section_from_shdr): Do not insist on - non-zero physical addresses when adjusting the LMAs of new - sections. - -2002-02-12 John David Anglin - - * elf-hppa.h (elf_hppa_reloc_final_type): New function stripped - from _bfd_elf_hppa_gen_reloc_type. - (_bfd_elf_hppa_gen_reloc_type): Remove duplicate prototype. - * elf32-hppa.h (elf32_hppa_reloc_final_type): Add protptype. - * elf32-hppa.c: Include elf32-hppa.h before elf-hppa.h. - * elf64-hppa.h (elf64_hppa_reloc_final_type): Add protptype. - -2002-02-12 Alexandre Oliva - - * elf-m10300.c (mn10300_elf_relax_section): Skip section before - loading its contents if there's nothing to do in it. - -2002-02-12 Alan Modra - - * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for crossing - 64k boundary. - - * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Add dynamic - DT_PPC64_OPD and DT_PPC64_OPDSZ tags. - (ppc64_elf_finish_dynamic_sections): Set values for them. - -2002-02-11 Michael Snyder - - * elf-bfd.h (elfcore_write_lwpstatus): Add prototype. - * elf.c (elfcore_grok_pstatus): Add prototype. - (elfcore_grok_lwpstatus): Add prototype. - (elfcore_write_lwpstatus): New function. - (elfcore_write_pstatus): Fix typo, eliminate unnecessary memcpy. - -2002-02-11 Alexandre Oliva - - * elf32-sh.c: Added missing prototypes. - * elf32-sh64.c: Likewise. - (sh_elf_align_loads): Mark unused args as such. - * elf64-sh64.c: Added missing prototypes. - (struct elf_sh64_link_hash_entry): Fix typo. - (sh_elf64_relocate_section): Fix info argument passed to - _bfd_elf_section_offset. - -2002-02-11 Alan Modra - - * Makefile.am: "make dep-am". - * Makefile.in: Regenerate. - * aclocal.m4: Regenerate. - * config.in: Regenerate. - * configure: Regenerate. - -2002-02-10 Daniel Jacobowitz - - * coff-rs6000.c (xcoff_generate_rtinit): Silence uninitialized - variable warnings. - * elf32-sh.c (sh_elf_relax_section): Silence signed/unsigned - comparison warning. - * trad-core.c (trad_unix_core_file_p): Silence pointer/integer - cast warnings for the common case. - -2002-02-10 Hans-Peter Nilsson - - * config.bfd (sh-*-linux*, sh-*-elf* | sh-*-rtemself*): Add sh64 - vectors. - (sh-*-netbsdelf*): New, to trump sh*-*-netbsdelf* and add sh64 - vectors. - -2002-02-09 Richard Henderson - - * elf64-alpha.c (elf64_alpha_howto): Add R_ALPHA_BRSGP. - (elf64_alpha_reloc_map, elf64_alpha_check_relocs): Likewise. - (elf64_alpha_relocate_section): Likewise. - * reloc.c (BFD_RELOC_ALPHA_BRSGP): New. - * bfd-in2.h, libbfd.h: Rebuild. - -2002-02-09 Hans-Peter Nilsson - - * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs): Check - that base-plus-offset reloc accounting is consistent. - (mmix_elf_relax_section): Keep base-plus-offset reloc accounting - up to date for undefined symbols. - -2002-02-08 Eric Christopher - - From Rainer Orth - - * elf32-mips.c (_bfd_mips_elf_fake_sections): Don't create .rela - sections for the O32 ABI. - -2002-02-08 Chris Demetriou - - * elf32-arm.h: Fix formatting of _("..."). - * elf32-d10v.c: Likewise. - * elf32-m68k.c: Likewise. - * elf32-mips.c: Likewise. - -2002-02-08 Ivan Guzvinec - - * coff-or32.c: Fix compile time warning messages. - -2002-02-08 Alexandre Oliva - - Contribute sh64-elf. - 2002-01-23 Alexandre Oliva - * reloc.c (R_SH_GOTPLT32, R_SH_GOT_LOW16, R_SH_GOT_MEDLOW16, - R_SH_GOT_MEDHI16, R_SH_GOT_HI16, R_SH_GOTPLT_LOW16, - R_SH_GOTPLT_MEDLOW16, R_SH_GOTPLT_MEDHI16, R_SH_GOTPLT_HI16, - R_SH_PLT_LOW16, R_SH_PLT_MEDLOW16, R_SH_PLT_MEDHI16, - R_SH_PLT_HI16, R_SH_GOTOFF_LOW16, R_SH_GOTOFF_MEDLOW16, - R_SH_GOTOFF_MEDHI16, R_SH_GOTOFF_HI16, R_SH_GOTPC_LOW16, - R_SH_GOTPC_MEDLOW16, R_SH_GOTPC_MEDHI16, R_SH_GOTPC_HI16, - R_SH_GOT10BY4, R_SH_GOTPLT10BY4, R_SH_GOT10BY8, R_SH_GOTPLT10BY8, - R_SH_COPY64, R_SH_GLOB_DAT64, R_SH_JMP_SLOT64, R_SH_RELATIVE64): - New relocs. - * libbfd.h, bfd-in2.h: Rebuilt. - * elf32-sh.c (sh_elf_howto_table): Define new relocs. - (sh_reloc_map): Map them. - (PLT_ENTRY_SIZE, 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, elf_sh_plt0_entry, elf_sh_plt_entry, - elf_sh_pic_plt_entry, elf_sh_sizeof_plt, elf_sh_plt_plt0_offset, - elf_sh_plt0_gotplt_offset, elf_sh_plt_temp_offset, - elf_sh_plt_symbol_offset, elf_sh_plt_reloc_offset, - movi_shori_putval) [INCLUDE_SHMEDIA]: New. - (elf_sh_link_hash_entry) [INCLUDE_SHMEDIA]: Add - datalabel_got_offset. - (sh_elf_link_hash_newfunc): Initialize it. - (sh_elf_relocate_section): Augment the scope of - seen_stt_datalabel. Introduce GOTPLT support. Extend GOTPC, PLT, - GOT and GOTOFF handling to new SHmedia relocation types. Support - GOT_BIAS. - (sh_elf_check_relocs): Likewise. - (sh_elf_finish_dynamic_symbol) [TARGET_SHMEDIA]: Set up values in - PLT entries using movi_shori_putval. Support GOT_BIAS. - (sh_elf_finish_dynamic_sections): Likewise. - * elf32-sh64.c (shmedia_prepare_reloc): Do not add addend to - relocation, it's now done by the caller. - (GOT_BIAS): New. - * elf64-sh64.c (GOT_BIAS, PLT_ENTRY_SIZE, elf_sh64_sizeof_plt, - elf_sh64_plt_plt0_offset, elf_sh64_plt0_gotplt_offset, - elf_sh64_plt_temp_offset, elf_sh64_plt_symbol_offset, - elf_sh64_plt_reloc_offset, ELF_DYNAMIC_INTERPRETER, - elf_sh64_pcrel_relocs_copied, elf_sh64_link_hash_entry, - elf_sh64_link_hash_table, sh64_elf64_link_hash_traverse, - sh64_elf64_hash_table): New. - (sh_elf64_howto_table): Introduce new relocs. - (sh_elf64_info_to_howto): Accept new PIC relocs. - (sh_elf64_relocate_section): Augment the scope of - seen_stt_datalabel. Support new PIC relocs. - (sh_elf64_check_relocs): Support new PIC relocs. - (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le, - elf_sh64_plt_entry_be, elf_sh64_plt_entry_le, - elf_sh64_pic_plt_entry_be, elf_sh64_pic_plt_entry_le, - elf_sh64_plt0_entry, elf_sh64_plt_entry, elf_sh64_pic_plt_entry, - sh64_elf64_link_hash_newfunc, sh64_elf64_link_hash_table_create, - movi_shori_putval, movi_3shori_putval, - sh64_elf64_create_dynamic_sections, - sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, - sh64_elf64_size_dynamic_sections, - sh64_elf64_finish_dynamic_symbol, - sh64_elf64_finish_dynamic_sections): New. - (elf_backend_create_dynamic-sections, - bfd_elf64_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. - 2001-05-16 Alexandre Oliva - * elf32-sh.c: Renumbered and renamed some SH5 relocations to - match official numbers and names; moved unmaching ones to the - range 0xf2-0xff. - * elf32-sh64.c, elf64-sh64.c: Likewise. - 2001-03-12 DJ Delorie - * elf32-sh.c (sh_elf_relax_section): Don't relax SHmedia - sections. - 2001-03-12 DJ Delorie - * elf32-sh64.c (shmedia_prepare_reloc): Validate relocs that must - be aligned. - * elf64-sh64.c (sh_elf64_relocate_section): Ditto. - 2001-01-14 Hans-Peter Nilsson - * elf32-sh64.c (bfd_elf32_bfd_copy_private_section_data): Define. - (sh64_elf_fake_sections): Set type to SHT_SH5_CR_SORTED for a - .cranges section with SEC_SORT_ENTRIES set. - (sh64_backend_section_from_shdr): Set SEC_SORT_ENTRIES on an - incoming sorted .cranges section. - (sh64_bfd_elf_copy_private_section_data): New. - (sh64_elf_final_write_processing): Only sort .cranges and modify - start address if called by linker. - 2001-01-08 Ben Elliston - * elf32-sh64.c (sh64_elf_final_write_processing): Activate - Hans-Peter Nilsson's set bit 0 patch from 2001-01-06. - * elf64-sh64.c (sh64_elf64_final_write_processing): Ditto. - 2001-01-06 Hans-Peter Nilsson - * elf64-sh64.c (sh_elf64_howto_table): No open brace at start of - line. Add comments before all entries. - : Correct and clarify describing - comment. - (sh_elf64_reloc): Correct head comment. - (sh_elf64_relocate_section): Correct spacing. - : Do not honour STO_SH5_ISA32; - instead call reloc_dangerous callback. - : New case. - (sh_elf64_gc_mark_hook): Correct spacing. - (sh_elf64_check_relocs): Ditto. - * elf32-sh64.c (shmedia_prepare_reloc) : - New case. - * elf32-sh.c: Correct #endif comments for #ifndef-wrapped - functions. - (sh_elf_howto_table) : Correct, - clarify describing comment. Add comments before all entries. - (sh_elf_relocate_section) : Do not - honour STO_SH5_ISA32; instead call reloc_dangerous callback. - 2001-01-06 Hans-Peter Nilsson - Sort .cranges section in final link. Prepare to set bit 0 on - entry address. - * elf32-sh64.c (struct sh64_find_section_vma_data): New. - (sh64_elf_link_output_symbol_hook): Fix typo in prototype. - (sh64_elf_set_mach_from_flags): Set SEC_DEBUGGING on incoming - .cranges section. - (sh64_backend_section_from_shdr): New, to recognize - SHT_SH5_CR_SORTED on incoming .cranges section. - (elf_backend_section_from_shdr): Define. - (sh64_elf_final_write_processing): Sort outgoing .cranges - section. (New, temporarily disabled:) Set bit 0 on entry address - according to ISA type. - (sh64_find_section_for_address): New. - (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb, - crange_bsearch_cmpl): Move here from opcodes/sh64-dis.c. - (sh64_address_in_cranges): Move here from opcodes/sh64-dis.c. Use - bfd_malloc, not xmalloc. - (sh64_get_contents_type): Move here from opcodes/sh64-dis.c. Make - global. - * elf32-sh64.c (sh64_elf64_final_write_processing): New, (but - temporarily disabled) setting bit 0 on entry address. - (elf_backend_final_write_processing): Define. - 2001-01-05 Hans-Peter Nilsson - * elf32-sh.c (sh_elf_howto_table) : Adjust fields to - be a proper relocation for PTA and PTB rather than a marker. - : - Zero src_mask. - * elf64-sh64.c: Ditto. - (sh_elf64_relocate_section) : New case. - * elf32-sh64.c: Include opcodes/sh64-opc.h - (shmedia_prepare_reloc): Take a bfd_link_info pointer as first - argument. Drop const qualifiers from "bfd *" and "bfd_byte *" - parameters. No unused parameters. Caller changed. - : New case. - * Makefile.am (elf32-sh64.lo): Add dependency on sh64-opc.h. - * Makefile.in: Regenerate. - 2000-12-30 Hans-Peter Nilsson - * elf64-sh64.c (sh64_elf64_fake_sections): Set SHF_SH5_ISA32 for - all code sections. - (sh_elf64_set_mach_from_flags): Change from EF_SH64 to EF_SH5. - (sh64_elf_merge_private_data): Ditto. - * elf32-sh64.c (sh64_elf_fake_sections): Use sh64_elf_section_data - to access stored section flags. - (sh64_elf_final_write_processing): Return immediately unless - called by linker. Use sh64_elf_section_data (cranges) to get size - of linker-generated cranges entries. - (sh64_elf_copy_private_data): Add missing "return true". - (sh64_elf_set_mach_from_flags): Change from EF_SH64 to EF_SH5. - (sh_elf64_merge_private_data): Ditto. - 2000-12-19 Hans-Peter Nilsson - * elf64-sh64.c (sh64_elf64_fake_sections): New, copy of - elf64-sh64.c:sh64_elf_fake_sections. - (elf_backend_fake_sections): Define as sh64_elf64_fake_sections. - 2000-12-18 Hans-Peter Nilsson - * elf32-sh64.c (sh64_elf_copy_private_data_internal): Delete. - (sh64_elf_final_write_processing): New. - (elf_backend_final_write_processing): Define. - (sh64_elf_fake_sections): Get header flags from tdata field. - (sh64_elf_copy_private_data): Do not call - sh64_elf_copy_private_data_internal, just copy e_flags field. - (sh64_elf_merge_private_data): Do not call - sh64_elf_copy_private_data_internal. - 2000-12-12 Hans-Peter Nilsson - Remove EF_SH64_ABI64, let ELF size make difference. - Remove SH64-specific BFD section flag. - * elf32-sh64.c (sh64_elf_fake_sections): Recognize section as - containing SHmedia through elf_section_data (asect)->tdata - non-zero, not using a BFD section flag. - (sh64_elf_set_mach_from_flags): Don't recognize EF_SH64_ABI64. - (sh64_elf_merge_private_data): Similar. - (elf_backend_section_flags): Don't define. - (sh64_elf_backend_section_flags): Delete. - * elf64-sh64.c (sh_elf64_set_mach_from_flags): Recognize EF_SH64, - not EF_SH64_ABI64. - (sh_elf64_merge_private_data): Similar. - * section.c (Section flags definitions): Don't define - SEC_SH_ISA_SHMEDIA. - (bfd-in2.h): Regenerate. - 2000-12-09 Hans-Peter Nilsson - Make DataLabel references work with partial linking. - * elf32-sh64.c: Fix formatting. - (sh64_elf_link_output_symbol_hook): New. - (elf_backend_link_output_symbol_hook): Define to - sh64_elf_link_output_symbol_hook. - (sh64_elf_add_symbol_hook): Make DataLabel symbol just global - undefined if partial linking. Adjust sanity check. - * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): New. - (elf_backend_link_output_symbol_hook): Define to - sh64_elf64_link_output_symbol_hook. - (sh64_elf64_add_symbol_hook): Make DataLabel symbol just global - undefined if partial linking. Adjust sanity check. - 2000-12-07 Hans-Peter Nilsson - Implement semantics for inter-file DataLabel references. - * elf64-sh64.c (DATALABEL_SUFFIX): Define. - (sh64_elf64_add_symbol_hook): New. - (sh_elf64_relocate_section): If passing an indirect symbol with - st_type STT_DATALABEL on the way to a symbol with st_other - STO_SH5_ISA32, do not bitor 1 to the relocation. - (elf_backend_add_symbol_hook): Define to - sh64_elf64_add_symbol_hook. - * elf64-sh32.c: Tweak comments. - (DATALABEL_SUFFIX): Define. - (sh64_elf_add_symbol_hook): New. - (elf_backend_add_symbol_hook): Define to sh64_elf_add_symbol_hook. - * elf32-sh.c (sh_elf_relocate_section): If passing an indirect - symbol with st_type STT_DATALABEL on the way to a symbol with - st_other STO_SH5_ISA32, do not bitor 1 to the relocation. - 2000-12-05 Hans-Peter Nilsson - Pass through STT_DATALABEL. - * elf32-sh64.c (sh64_elf_get_symbol_type): New. - (elf_backend_get_symbol_type): Define. - * elf64-sh64.c (sh64_elf64_get_symbol_type): New. - (elf_backend_get_symbol_type): Define. - 2000-11-30 Hans-Peter Nilsson - * elf32-sh64.c: Tweak comments. - (sh64_elf_copy_private_data_internal): Add prototype. - (bfd_elf32_bfd_set_private_flags): Define. - (sh64_elf_copy_private_data_internal): Compare machine name, not - textual BFD target name, to check whether to copy section flag - SHF_SH5_ISA32. - (sh64_elf_merge_private_data): Validize bfd_get_arch_size. - Tweak section-contents-type-mismatch message. - (shmedia_prepare_reloc): Add ATTRIBUTE_UNUSED markers. - Validize reloc-types. - * elf64-sh64.c: New file. - * targets.c (bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec): Declare. - * Makefile.am (BFD64_BACKENDS): Add elf64-sh64.lo. - (BFD64_BACKENDS_CFILES): Add elf64-sh64.c. - Regenerate dependencies. - * Makefile.in: Regenerate. - * config.bfd (sh64-*-elf*): Add bfd_elf64_sh64_vec and - bfd_elf64_sh64l_vec. - * configure.in: Handle bfd_elf64_sh64_vec and - bfd_elf64_sh64l_vec. - * configure: Regenerate. - * po/POTFILES.in: Regenerate. - * po/bfd.pot: Regenerate. - 2000-11-29 Hans-Peter Nilsson - * elf32-sh64.c (sh64_elf_set_mach_from_flags): Do not recognize - anything else but EF_SH64 and EF_SH64_ABI64. - (sh64_elf_merge_private_data): Emit error for anything else but - EF_SH64 and EF_SH64_ABI64. - * config.bfd: Remove bfd_elf32_shblin_vec and bfd_elf32_shlin_vec - from targ_selvecs. - * configure.in: Add cofflink.lo to bfd_elf32_sh64_vec and - bfd_elf32_sh64l_vec as a temporary measure. - * configure: Regenerate. - 2000-11-27 Hans-Peter Nilsson - * cpu-sh.c (arch_info_struct): Include sh5 item - unconditionalized. - * config.bfd (sh64-*-elf*): Do not set targ_cflags. - Add targ_selvecs bfd_elf32_sh_vec, bfd_elf32_shl_vec, - bfd_elf32_shblin_vec and bfd_elf32_shlin_vec. - * elf32-sh64.c: Tweak comments. - (sh64_elf_set_mach_from_flags): Recognize all machine flags that - are proper subsets of SH64 as bfd_mach_sh5. Add EF_SH64_ABI64. - (sh64_elf_copy_private_data_internal): Wrap long line. - (sh64_elf_merge_private_data): Rewrite to allow objects from - SH64 subsets to be linked together. - (INCLUDE_SHMEDIA): Define. - * elf32-sh.c (sh_elf_relocate_section) : - Parenthesize plus-expression inside or-expression. - : Ditto. - (sh_elf_set_mach_from_flags): Remove code refusing - deleted EF_SH64_32BIT_ABI flag. - 2000-11-26 Hans-Peter Nilsson - * elf32-sh.c (sh_elf_howto_table) : Set pcrel_offset to true. - (sh_elf_relocate_section) : Or 1 in - calculation of relocation if sym->st_other & STO_SH5_ISA32. - : Ditto if h->other & STO_SH5_ISA32. - * elf32-sh64.c (shmedia_prepare_reloc): Add rel->r_addend to - relocation. - 2000-11-24 Hans-Peter Nilsson - * Makefile.am (BFD32_BACKENDS): Add elf32-sh64.lo. - (BFD32_BACKENDS_CFILES): Add elf32-sh64.c. - Regenerate dependencies. - * Makefile.in: Regenerate. - * archures.c: Add bfd_mach_sh5. - * config.bfd: Map targ_cpu sh* to bfd_sh_arch. - Handle sh64-*-elf*. Set targ_cflags to -DINCLUDE_SHMEDIA. - * configure.in: Handle bfd_elf32_sh64_vec and bfd_elf32_sh64l_vec. - * configure: Regenerate. - * reloc.c (BFD_RELOC_SH_SHMEDIA_CODE, BFD_RELOC_SH_IMMU5, - BFD_RELOC_SH_IMMS6, BFD_RELOC_SH_IMMS6BY32, BFD_RELOC_SH_IMMU6, - BFD_RELOC_SH_IMMS10, BFD_RELOC_SH_IMMS10BY2, - BFD_RELOC_SH_IMMS10BY4, BFD_RELOC_SH_IMMS10BY8, - BFD_RELOC_SH_IMMS16, BFD_RELOC_SH_IMMU16, BFD_RELOC_SH_IMM_LOW16, - BFD_RELOC_SH_IMM_LOW16_PCREL, BFD_RELOC_SH_IMM_MEDLOW16, - BFD_RELOC_SH_IMM_MEDLOW16_PCREL, BFD_RELOC_SH_IMM_MEDHI16, - BFD_RELOC_SH_IMM_MEDHI16_PCREL, BFD_RELOC_SH_IMM_HI16, - BFD_RELOC_SH_IMM_HI16_PCREL, BFD_RELOC_SH_PT_16): New relocations. - * cpu-sh.c [INCLUDE_SHMEDIA] (arch_info_struct): Define and link - in item for SH5. - * elf32-sh.c [INCLUDE_SHMEDIA] (sh_elf_howto_table): Add howto items - for SHmedia relocs. - [INCLUDE_SHMEDIA] (sh_rel): Add mappings for SHmedia relocs. - [INCLUDE_SHMEDIA] (sh_elf_relocate_section) [default]: Call - shmedia_prepare_reloc, goto final_link_relocate if it returns - non-zero, else fail as before. - (sh_elf_set_mach_from_flags): Provide function only if not defined - as macro. Do not recognize objects with EF_SH64_32BIT_ABI set. - (sh_elf_set_private_flags): Provide function only if not defined - as a macro. - (sh_elf_copy_private_data): Similar. - (sh_elf_merge_private_data): Similar. - * section.c (SEC_SH_ISA_SHMEDIA): New. - * targets.c (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec): Declare. - * elf32-sh64.c: New file. - * libbfd.h: Regenerate. - * bfd-in2.h: Regenerate. - * po/POTFILES.in: Regenerate. - * po/bfd.pot: Regenerate. - * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. +2004-02-17 Daniel Jacobowitz + Richard Sandiford -2002-02-07 Daniel Jacobowitz + * elfxx-mips.c (mips_elf_calculate_relocation): Use + _bfd_elf_symbol_refs_local_p to decide whether to decay + a GOT_PAGE/GOT_OFST pair to GOT_DISP/addend. + (_bfd_mips_elf_check_relocs): Add a global GOT entry for GOT_PAGE + relocs if the symbol wasn't defined by a regular object file. + Don't check the symbol's dynindx. - * bfd-in.h: Update check to only see if has - been included, not drag it in. - * bfd-in2.h: Regenerate. +2004-02-16 Andrew Cagney -2002-02-06 H.J. Lu (hjl@gnu.org) + * bfd-in.h (file_ptr, ufile_ptr): Configure type using + @bfd_file_ptr@. + * bfd-in2.h: Re-generate. - * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Update - the mach and ISA fields if necessary. +2004-02-14 Andrew Cagney -2002-02-06 Nick Clifton + * configure.host (HDEFINES): When hppa*-*-hpux*, define + _LARGEFILE64_SOURCE. - * coffcode.h (coff_set_arch_mach_hook): Select the highest known - ARM architecture when an F_ARM_5 flag is detected, since we cannot - be sure exactly which architecture this represents. +2004-02-13 Andrew Cagney -2002-02-05 Nick Clifton + * elf.c (vma_page_aligned_bias): New function. + (assign_file_positions_except_relocs) + (assign_file_positions_for_segments): Replace broken modulo + arithmetic with call to vma_page_aligned_bias. - * po/tr.po: Updated translation. +2004-02-11 Andrew Cagney -2002-02-05 Alan Modra + * bfd-in.h: Update copyright. + (bfd_tell): Change return type to file_ptr. + * bfd-in2.h: Re-generate. + * cache.c: Update copyright. + (bfd_cache_lookup_worker): Use real_fseek, do not cast offset + parameter. + (close_one): Use real_ftell. + * bfdio.c: Update copyright. + (real_ftell, real_fseek): New functions. + (bfd_tell): Use real_fseek and real_ftell, change return type to + file_ptr. + (bfd_seek): Use real_ftell and real_fseek, change type of + file_position to a file_ptr. + * libbfd-in.h: Update copyright. + (real_ftell, real_fseek): Declare. + * libbfd.h: Re-generate. - From Jimi X - * archures (bfd_mach_ppc64): Define. - (bfd_powerpc_arch): Rename to bfd_powerpc_archs. - (bfd_powerpc_arch): Define. - * bfd-in2.h: Regenerate. - * cpu-powerpc.c (arch_info_struct): Rename to bfd_powerpc_archs. - (bfd_powerpc_arch): Move to tail of bfd_powerpc_archs. - (bfd_powerpc_archs): Add default powerpc64 arch. - -2002-02-05 Alan Modra - - * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Check for relocs - against section syms in readonly sections. Don't do the global - sym check if we find one. - * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. - * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. - * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise. - * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. - (elf_s390_grok_prstatus): Add missing prototype. - -2002-02-04 Hans-Peter Nilsson - - * elf64-mmix.c (mmix_dump_bpo_gregs): New function. - (mmix_elf_check_common_relocs) : - Call bfd_get_section_by_name only once. Initialize - bpodata->n_bpo_relocs_this_section. - (_bfd_mmix_prepare_linker_allocated_gregs): Remove comment - referring to DSOs. - (bpo_reloc_request_sort_fn): Don't use difference of values as - return-value. - -2002-02-02 David O'Brien - - * configure.in: Tweak the FreeBSD 4.x recognition more. Only treat - version 4.5 and later the same as 5-CURRENT. + * configure.in (AC_CHECK_FUNCS): Check for ftello, ftello64, + fseeko and fseeko64. Determine bfd_file_ptr. * configure: Re-generate. + * config.in: Re-generate. -2002-02-02 Jason Thorpe - - * config.bfd (hppa*-*-netbsd*): New target. - -2002-01-31 Philipp Thomas - - * coff-arm.c (coff_arm_merge_private_bfd_data): Move ERROR - to front of message. Unify messages with elf32-arm.h. Use - commas where neccessary. - * elf32-arm.h (elf32_arm_merge_private_bfd_data): Use all upcase - ERROR in messages. Unify messages with coff-arm.c. Correct - VFP/FPA error message. - (elf32_arm_print_private_bfd_data): Don't mark APCS-26 and - APCS-32 for translation. - -2002-02-01 Hans-Peter Nilsson - - Perform on-demand global register allocation from - R_MMIX_BASE_PLUS_OFFSET relocs. - * elf64-mmix.c (struct bpo_reloc_section_info, struct - bpo_reloc_request, struct bpo_greg_section_info): New. - (mmix_elf_check_common_relocs, mmix_elf_gc_sweep_hook, - bpo_reloc_request_sort_fn, mmix_elf_relax_section, - _bfd_mmix_check_all_relocs, - _bfd_mmix_prepare_linker_allocated_gregs, - _bfd_mmix_finalize_linker_allocated_gregs): New functions. - (elf_mmix_howto_table): Correct src_mask for most relocs. - (mmix_elf_perform_relocation) : New - case. - (mmix_final_link_relocate) : New - case. Fix typo in comment. New label do_mmix_reloc. - (mmix_elf_check_relocs): Abuse bfd_link_info member base_file to - store first object file with a base-plus-offset reloc. Call - mmix_elf_check_common_relocs for the part common with mmo. - (mmix_elf_final_link): Write out linker-allocated register - contents section. - (elf_backend_gc_sweep_hook): Define. - (bfd_elf64_bfd_relax_section): Define. - - * mmo.c: Don't include - (mmo_init): Correct init-once logic. - -2002-02-01 Tom Rix - - * config.bfd: Conditionally support for pre AIX 4.3. - -2002-02-01 Alan Modra - - * Makefile.am: Run "make dep-am" - * Makefile.in: Regenerate. - -2002-01-31 David O'Brien - - * configure.in: Recognize the differences in core files from FreeBSD - 4.{0,1} and later versions of 4.x. This treats 4.2+ the same as - 5-CURRENT. - * configure: Regenerate. - -2002-01-31 Ivan Guzvinec - - * coff-or32.c: New file. - * cpu-or32.c: New file. - * elf32-or32.c: New file. - * archures.c: Add support for or32. - * targets.c: Add support for or32. - * bfd-in2.h: Regenerate. - * coffcode.h (coff_set_arch_mach_hook, coff_set_flags, - coff_write_object_contents): Add support for or32. - * config.bfd: Add target. - * configure.in: Add support for or32. - * configure: Regenerate. - * Makefile.am: Add support for or32. - * Makefile.in: Regenerate. - * po/SRC-POTFILES.in: Add or32 files. - * po/bfd.pot: Regenerate. - -2002-01-31 Nick Clifton - Don Lindsay - - * elf32-mips.c (mips_elf_calculate_relocation): Replace 'return - false' with a return of a bfd_reloc_ error code. - -2002-01-31 Hans-Peter Nilsson - - * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't - unexport unreferenced symbols when --export-dynamic. Call - _bfd_elf_strtab_delref when unexporting. - -2002-01-30 Daniel Jacobowitz - - * bfd-in.h: Include if it is available. - * bfd-in2.h: Regenerated. - -2002-01-31 Alan Modra - - * elf64-ppc.c (func_desc_adjust): STV_PROTECTED functions should - not go via the plt. - -2002-01-30 Nick Clifton - - * archures.c: Tidy up formatting of embedded comments. - * bfd.c: Tidy up formatting of embedded comments. - * bfd-in.h: Fix formatting of comments. - * reloc.c: Tidy up formatting of ordinary & embedded comments. - * section.c: Tidy up formatting of embedded comments. - * syms.c: Tidy up formatting of embedded comments. - * targets.c: Tidy up formatting of embedded comments. - - * bfd-in2.h: Regenerate. - -2002-01-30 Nick Clifton - - * vms-tir.c (cmd_name): New function. - (tir_cmd_name): New function. - (etir_sta, etir_sto, etir_opr, etir_stc): Use cmd_name(). - (tir_opr, tir_ctl, tir_cmd): use tir_cmd_name(). - Fix formatting. - - * peXXigen.c (pe_print_idata): Rearrange message to aid in - translation. - (pe_print_pdata): Rearrange message to aid in translation. - - * libbfd.c (warn_deprecated): Rearrange error message to aid in - translation. - - * ihex.c (ihex_write_object_contents): Fix spelling typo. - - * ieee.c (ieee_slurp_external_symbols): Remove spurious space. - - * elf64-sparc.c (sparc64_elf_add_symbol_hook): Rearrange error - message to aid in translation. - - * elf64-mmix.c (mmix_final_link_relocate): Rearrange error message - to aid in translation. - - * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix typo. - -2002-01-30 Philipp Thomas - - * coff-arm.c, elf32-elf.h: Unify messages. - -2002-01-30 Nick Clifton - - * po/sv.po: Updated translation. - -2002-01-30 Philipp Thomas - - * dwarf2.c (read_abbrev): Use full section name in error message. - (decode_line_info): Likewise. - - * elf.c (_bfd_elf_symbol_from_bfd_symbol): Don't translate debugging - message. - -2002-01-30 Alan Modra - - * elf64-ppc.c (func_desc_adjust): Only provide missing function - descriptor symbols for undefined function code syms. Clear - ELF_LINK_NON_ELF so that they can stay weak. - -2002-01-29 Chris Demetriou - Mitch Lichtenberg - - * bfd-in.h (bfd_mips_elf32_create_embedded_relocs): New prototype. - * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): New function - to handle 32-bit ELF embedded reloc (ld --embedded-relocs) - generation. - * bfd-in2.h: Regenerate. - -2002-01-29 Chris Demetriou - - * elf32-mips.c: Add additional comments about HI16 relocation - processing. - (_bfd_mips_elf_hi16_reloc): Don't subtract address here for - pc-relative relocations. (Reverts change made on 2001-10-31.) - (_bfd_mips_elf_lo16_reloc): Subtract address of LO16 part here - for pc-relative relocations. - (mips_elf_calculate_relocation): Add a comment about a kludge - in the R_MIPS_GNU_REL_HI16 handling. - (_bfd_mips_elf_relocate_section): Implement that kludge; - adjust pc-relative HI16 relocation for difference in HI16 and - LO16 addresses, since it can't easily be done in - mips_elf_calculate_relocation. - -2002-01-29 Martin Schwidefsky - - * elf32-i386 (elf_i386_adjust_dynamic_symbol): Do not replace PLT32 - relocations with PC32 relocations for undefined or weak symbols. - * elf32-s390 (elf_i386_adjust_dynamic_symbol): Likewise. - * elf64-s390x (elf_i386_adjust_dynamic_symbol): Likewise. - -2002-01-28 Jason Thorpe - - * elfcore.h (elf_core_file_p): Improve comment for last change. - -2002-01-27 Daniel Jacobowitz - - * configure: Regenerated. - -2002-01-27 Jason Thorpe - - * elfcore.h (elf_core_file_p): Set the machine architecture - before processing the program headers. - -2002-01-26 Hans-Peter Nilsson - - * configure.in <64-bit configuration>: If using gcc, check and - emit error for egcs-1.1.2. - * configure: Regenerate. - -2002-01-26 Egor Duda - - * elf.c (elfcore_grok_win32pstatus): Copy only as much information - as possible to avoid stack corruption. - -2002-01-26 Richard Henderson - - * elf64-alpha.c (elf64_alpha_check_relocs): Don't set reltext - for non-allocated sections. - -2002-01-25 Mark Kettenis - - * elf.c (elfcore_write_prstatus): Make sure we pass the address of - prstat.pr_reg even if it is a struct. - -2002-01-25 Steve Ellcey - - * bfd/elfxx-ia64.c: Reset AIX vector function overrides for HP-UX. - -2002-01-25 Philipp Thomas - - * coffgen.c (coff_print_symbol): Don't mark info message - for translation. - -2002-01-25 Nick Clifton - - * po/fr.po: Updated translation. - * po/es.po: Updated translation. - -2002-01-25 Philipp Thomas - - * coff-alpha.c (alpha_relocate_section): Unify warning message - for GP relative relocations without GP defined. - * coff-mips.c (mips_relocate_section): Likewise. - -2002-01-25 Alan Modra +2004-02-09 Anil Paranjpe - * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Avoid - unsigned overflow when new_offset < old_offset. + * coff-h8300.c: Added comments about relaxation for ldc.w and stc.w. + * elf32-h8300.c: Likewise. -2002-01-24 Philipp Thomas +2004-02-09 Christian Vogel + Nick Clifton - * bfd.c (_bfd_abort): Fix typo. + * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Catch + GOT entries with no associated GOT subsection. -2002-01-23 Richard Henderson +2004-02-09 Richard Sandiford - * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't suppress - plt entries for undefweak symbols. + * bfd-elf.h (elf_backend_name_local_section_symbols): New hook. + * elf.c (swap_out_syms): Use it to decide whether local section + symbols should be named. + * elfxx-target.h (elf_backend_name_local_section_symbols): New macro. + * elfxx-mips.h (_bfd_mips_elf_name_local_section_symbols): Declare. + (elf_backend_name_local_section_symbols): Define. + * elfxx-mips.c (_bfd_mips_elf_name_local_section_symbols): New. -2002-01-23 Steve Ellcey +2004-01-30 H.J. Lu - * bfd/targets.c (bfd_elf32_ia64_hpux_big_vec): Add to - DEFAULT_VECTOR. - (bfd_elf64_ia64_hpux_big_vec): Ditto. - (bfd_elf32_h8300_vec): Ditto. + * elfxx-ia64.c (elfNN_ia64_relax_brl): New function. + (elfNN_ia64_relax_section): Optimize brl to br during the relax + finalize pass. -2002-01-23 Alan Modra +2004-01-30 Alexandre Oliva - * elf64-ppc.c: Remove stale part of ABI comment. - (NO_OPD_RELOCS): Define. - (ppc64_elf_check_relocs): Use it. - (ppc64_elf_relocate_section): Here too. - (build_one_stub): Don't point function syms at the stub. Instead, - hijack plt.offset. - (ppc64_elf_relocate_section): Check whether REL24 relocs should - really go to the stub. Make all dynamic relocs in opd against - locals. - (ppc64_elf_finish_dynamic_symbol): Allow for non-standard use of - plt.offset. + * elf32-frv.c (elf32_frv_always_size_sections): Initialize pointer + to bfd_link_hash_entry passed by reference to + _bfd_generic_link_add_one_symbol. -2002-01-22 Richard Henderson +2004-01-25 H.J. Lu - * elf64-alpha.c (INSN_UNOP): Encode with RB as $sp. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Disallow imm + relocations against dynamic symbols. -2002-01-22 Alan Modra +2004-01-23 Daniel Jacobowitz - * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Correct sign of - TOC_BASE_OFF adjustment. + * elf32-arm.h (elf32_arm_check_relocs): Revert part of 2004-01-13 + change. - * Makefile.am: Run "make dep-am". - * Makefile.in: Regenerate. - * po/SRC-POTFILES.in: Regenerate. - -2002-01-22 John David Anglin - - * configure.host (hppa*64*-*-hpux*, hppa*64*-*-linux*): Add new - host defines. - -2002-01-21 Hans-Peter Nilsson - - * elf32-cris.c (cris_elf_relocate_section) : - Check for and emit error if sgot is NULL at this point. - -2002-01-21 Jason Thorpe - - * config.bfd (ia64*-*-netbsd*): New target. - -2002-01-21 Thomas Klausner - - * som.c (som_write_space_strings): Comment typo fix. - -2002-01-21 Alan Modra - - * elf64-ppc.c (struct ppc_link_hash_entry): Add is_func and - is_func_descriptor fields. - (link_hash_newfunc): Init them. - (ppc64_elf_check_relocs): Only R_PPC24_REL24 syms starting with a - dot are candidates for plt entries. When processing .opd relocs, - set function descriptor strings to point inside function code - string, and set new ppc_link_hash_entry fields. - (ppc64_elf_gc_sweep_hook): Don't sweep R_PPC64_REL24 relocs. - (ppc64_elf_adjust_dynamic_symbol): Remove most code dealing with - function descriptors. It's now done in.. - (func_desc_adjust): New. - (ppc64_elf_func_desc_adjust): New. - (define elf_backend_always_size_sections): Define. - (ppc64_elf_hide_symbol): New. - (define elf_backend_hide_symbol): Define. - (allocate_dynrelocs): Remove code looking up function descriptors - as that has been done earlier. - (ppc64_elf_size_dynamic_sections): Use htab shortcut to elf hash - table. - (ppc64_elf_finish_dynamic_symbol): Likewise. Remove code looking - up function descriptor. - (build_one_stub): Look up the function code sym. Check for - invalid plt offsets. - (ppc64_elf_relocate_section): Tweak calls to undefined weak syms. - Convert R_PPC64_TOC relocs to R_PPC64_RELATIVE in shared libs. - - * elf-bfd.h (elf_backend_data ): Add - boolean param. - (_bfd_elf_link_hash_hide_symbol): Likewise. - * elflink.h (elf_link_add_object_symbols): Adjust call to - elf_backend_hide_symbol. - (elf_fix_symbol_flags): Likewise. - (elf_link_assign_sym_version): Likewise. Use bfd_malloc rather - than bfd_alloc. - * elf.c (_bfd_elf_link_hash_hide_symbol): Add "force_local" param. - Set ELF_LINK_FORCED_LOCAL and call _bfd_elf_strtab_delref. - * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise. - (clobber_millicode_symbols): Adjust to suit new hide_symbol. - * elf32-cris.c (elf_cris_hide_symbol): Add "force_local" param - and adjust to suit. - * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise, and call - _bfd_elf_link_hash_hide_symbol rather than duplicating code. - * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise. - -2002-01-18 Alan Modra - - * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Test for a - dynamic function descriptor symbol, not the associated function - symbol. - -2002-01-17 Eric Christopher - - * elf32-mips.c (mips_elf_calculate_relocation): Fix typo. - -2002-01-17 Nick Clifton - - * po/bfd.pot: Regenerate. - * po/fr.po: Regenerate. - -2002-01-17 Alan Modra - - * elf-bfd.h (elf_backend_data ): - Remove "Elf_Internal_Shdr *" param. - (_bfd_mips_elf_section_from_bfd_section): Ditto. - * elf32-mips.c (_bfd_mips_elf_section_from_bfd_section): Ditto. - * elf32-m32r.c (_bfd_m32r_elf_section_from_bfd_section): Ditto. - * elf32-v850.c (v850_elf_section_from_bfd_section): Ditto. - * elf64-mmix.c (mmix_elf_section_from_bfd_section): Ditto. - * elfxx-ia64.c (elfNN_hpux_backend_section_from_bfd_section): Ditto. - * elf.c (_bfd_elf_section_from_bfd_section): Allow backend - function to override special sections. Remove hdr arg from - backend call, and don't loop. - -2002-01-16 Eric Christopher - - * elf32-mips.c (mips_elf_calculate_relocation): Set require_jalxp - on R_MIPS_26 and target is 16bit. Add R_MIPS16_GPREL to list of - relocations requiring gp0 and gp. - -2002-01-16 Richard Earnshaw - - * elf32-arm.h (elf32_arm_merge_private_bfd_data): Handle - EF_ARM_VFP_FLOAT. - (elf32_arm_print_private_bfd_data): Likewise. - -2002-01-16 Nick Clifton - - * po/tr.po: Import new version. - -2002-01-16 Alan Modra - - * elf64-ppc.c (ppc64_elf_howto_raw): Remove stale FIXMEs. - (ppc64_elf_reloc_type_lookup): Use proper CTOR reloc. - (ORI_R0_R0_0): Correct. - -2002-01-16 Alan Modra - - * elflink.c (_bfd_elf_create_dynamic_sections): Don't set SEC_CODE - when plt_not_loaded. - * elf64-ppc.c (ppc64_elf_create_dynamic_sections): No need to - clear .plt SEC_CODE here. Create .stub and correct .glink flags. - (PLT_INITIAL_ENTRY_SIZE): Set to 24. - (ppc64_elf_glink_code): Delete. - (PPC64_ELF_GLINK_SIZE): Delete. - (ADDIS_R12_R2, STD_R2_40R1, LD_R11_0R12, LD_R2_0R12, MTCTR_R11, - BCTR, ADDIS_R12_R12_1, LD_R2_40R1, NOP, LI_R0_0, B_DOT, LIS_R0_0, - ORI_R0_R0_0): Define. - (PLT_CALL_STUB_SIZE, GLINK_CALL_STUB_SIZE): Define. - (struct ppc_link_hash_table): Add sstub and plt_overflow. - (ppc64_elf_link_hash_table_create): Init them. - (ppc64_elf_check_relocs ): Refcount .plt entry. - Don't copy to shared lib. - (ppc64_elf_check_relocs): Call bfd_set_error on errors. - (ppc64_elf_gc_sweep_hook ): Sweep plt refcount. - (allocate_dynrelocs ): Don't change function sym here. Make - room for .stub and .glink code. - (ppc64_elf_size_dynamic_sections): Handle .stub. Make entry for - DT_PPC64_GLINK. - (ppc64_elf_final_link): Rename to ppc64_elf_set_toc. Don't call - bfd_elf64_bfd_final_link. - (bfd_elf64_bfd_final_link): Don't define. - (ppc64_elf_size_stubs): New. - (build_plt_stub): New. - (build_one_stub): New. - (ppc64_elf_build_stubs): New. - (ppc64_elf_relocate_section ): Remove assert. - (ppc64_elf_relocate_section): Don't copy R_PPC64_REL24 relocs. - (ppc64_elf_finish_dynamic_symbol): Don't build stubs here. Set - DT_PPC64_GLINK entry. Tweak DT_PLTGOT, DT_JMPREL, DT_PLTRELSZ in - case output sections not separate. Adjust DT_RELASZ to not - include plt relocs. Set reserved got entry. Set got and plt - entry size. - (elf_backend_got_header_size): Set to 8. - * elf64-ppc.h: New file. - -2002-01-16 Alan Modra - - * elf32-arm.h (elf32_arm_size_dynamic_sections): When removing - sections, use bfd_section_list_remove. - * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise. - * elflink.h (elf_link_add_object_symbols): When removing all - sections, use bfd_section_list_clear. - -2002-01-15 Nick Clifton - - * po/sv.po: New file: Swedish translation. - * configure.in (ALL_LINGUAS): Add sv. - * configure: Regenerate. - -2002-01-15 Jakub Jelinek - - * elflink.h (elf_link_input_bfd): Back out 2002-01-07 change. - * elf.c (merge_sections_remove_hook): New function. - (_bfd_elf_merge_sections): Pass it as 3rd argument to - _bfd_merge_sections. - * libbfd-in.h (_bfd_merge_sections): Add 3rd argument. - * libbfd.h: Rebuilt. - * merge.c (_bfd_merge_sections): Add remove_hook argument. - Call remove_hook if a SEC_EXCLUDE section is encountered. - -2002-01-15 Nick Clifton - - * elf32-xstormy16.c (xstormy16_reloc_map): Add new field 'table'. - (xstormy16_reloc_map): Initialise new field with correct howto - table. - (xstormy16_reloc_type_lookup): Use 'table' field to locate correct - howto entry. - -2002-01-10 Michael Snyder - - * elf.c (elfcore_write_prstatus): Use long instead of pid_t; - (elfcore_write_pstatus): Use long instead of pid_t; - * elf-bfd.h: Change prototypes to use long instead of pid_t; - -2002-01-09 Jason Thorpe - - * elf.c: Update copyright years. - (elfcore_grok_netbsd_note): Use NT_NETBSDCORE_PROCINFO - and NT_NETBSDCORE_FIRSTMACH. Improve a comment. - -2002-01-08 Michael Snyder +2004-01-21 Tom Rix - Add capability to write corefile note sections, for gdb. - * elf.c (elfcore_write_note): New function. - (elfcore_write_prpsinfo): New function. - (elfcore_write_prstatus): New function. - (elfcore_write_pstatus): New function. - (elfcore_write_prfpreg): New function. - (elfcore_write_prxfpreg): New function. - * elf-bfd.h: Add prototypes for above functions. + * reloc.c: New 5 bit reloc, BFD_RELOC_M68HC12_5B, for m68hc12 movb/movw. + * bfd-in2.h, libbfd.h: Rebuilt. -2002-01-08 Alexandre Oliva +2004-01-20 Danny Smith - * elf.c (elf_fake_sections): Propagate errors from - elf_backend_fake_section. + * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Don't remove + IMAGE_SCN_MEM_WRITE flag from .text section if WP_TEXT + flag has been cleared. -2002-01-07 Jason Thorpe +2004-01-19 Kazu Hirata - * Makefile.am (BFD32_BACKENDS): Add elf32-sh-nbsd.lo. - (BFD32_BACKENDS_CFILES): Add elf32-sh-nbsd.c. - (elf32-sh-nbsd.lo): New rule. - * Makefile.in: Regenerate. - * config.bfd (sh*le-*-netbsdelf*): New target. - (sh*-*-netbsdelf*): New target. - * configure.in: Include netbsd-core.lo for native sh*-*-netbsd*. - (bfd_elf32_shnbsd_vec): New vector. - (bfd_elf32_shlnbsd_vec): New vector. - * configure: Regenerate. - * elf32-sh-nbsd.c: New file. - * targets.c: Update copyright years. - (_bfd_target_vector): Add bfd_elf32_shlnbsd_vec and - bfd_elf32_shnbsd_vec. + * coff-h8300.c: Add and adjust comments about relaxation. + * elf32-h8300.c: Likewise. -2002-01-07 Aldy Hernandez +2004-01-16 Kazu Hirata - * coff-rs6000.c (READ20): Use bfd_scan_vma. + * coff-h8300.c: Fix comment typos. + * elf32-h8300.c: Likewise. -2002-01-07 Geoffrey Keating +2004-01-16 Kazu Hirata - * elflink.h (elf_link_input_bfd): Don't ask for the merged offset - of a symbol in a section that will be deleted. + * coff-h8300.c: Add comments about relaxation. + * elf32-h8300.c: Likewise. -2002-01-07 Nick Clifton +2004-01-14 Maciej W. Rozycki - * po/es.po: New file: Spanish translation. - * configure.in (ALL_LINGUAS): Add es. + * acinclude.m4: Quote names of macros to be defined by AC_DEFUN + throughout. + * aclocal.m4: Regenerate. * configure: Regenerate. -2002-01-06 Steve Ellcey - - * elfxx-ia64.c (is_unwind_section_name): Add target vector as - argument so we can handle HP-UX specially. - (elfNN_ia64_hpux_vec): New for use in is_unwind_section_name. - (elfNN_hpux_backend_section_from_bfd_section): New for support - of SHN_IA_64_ANSI_COMMON. - (elfNN_ia64_relax_section): Add support for SHN_IA_64_ANSI_COMMON. - (is_unwind_section_name): Add special HP-UX support. - (elfNN_ia64_section_from_shdr): Add support for more sections. - (elfNN_ia64_fake_sections): Modify is_unwind_section_name call and - add support for more sections. - (elfNN_ia64_additional_program_headers): Modify - is_unwind_section_name call. - (elfNN_ia64_modify_segment_map): Remove assumption that there is - only one unwind section in segment. - -2002-01-06 Alan Modra - - * syms.c (_bfd_generic_make_empty_symbol): New function. - * libbfd-in.h (_bfd_nosymbols_make_empty_symbol): Define as - _bfd_generic_make_empty_symbol. - * libbfd.h: Regenerate. - * bfd-in2.h: Regenerate. - * hppabsd-core.c (hppabsd_core_make_empty_symbol): Delete function. - (hppabsd_core_get_symtab_upper_bound): Don't define. - (hppabsd_core_get_symtab): Likewise. - (hppabsd_core_print_symbol): Likewise. - (hppabsd_core_get_symbol_info): Likewise. - (hppabsd_core_bfd_is_local_label_name): Likewise. - (hppabsd_core_get_lineno): Likewise. - (hppabsd_core_find_nearest_line): Likewise. - (hppabsd_core_bfd_make_debug_symbol): Likewise. - (hppabsd_core_read_minisymbols): Likewise. - (hppabsd_core_minisymbol_to_symbol): Likewise. - (hppabsd_core_vec): Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols). - Formatting fixes. - * hpux-core.c: Similarly. - * irix-core.c: Similarly. - * osf-core.c: Similarly. - * sco5-core.c: Similarly. - * binary.c (binary_make_empty_symbol): Remove function, define as - _bfd_generic_make_empty_symbol. - * ihex.c (ihex_make_empty_symbol): Likewise. - * mmo.c (mmo_make_empty_symbol): Likewise. - * ppcboot.c (ppcboot_make_empty_symbol): Likewise. - * srec.c (srec_make_empty_symbol): Likewise. - * versados.c (versados_make_empty_symbol): Likewise. - * vms.c (_bfd_vms_make_empty_symbol): Remove. - (vms_make_empty_symbol): Define as _bfd_generic_make_empty_symbol. - * vms-gsd.c (_bfd_vms_slurp_gsd): Call bfd_make_empty_symbol - rather than _bfd_vms_make_empty_symbol. - * vms-misc.c (new_symbol): Likewise. - -2002-01-05 Alan Modra - - * section.c (bfd_section_init): Remove unnecessary initialisations. - (bfd_section_list_clear): New function. - (bfd_section_list_remove, bfd_section_list_insert): New macros. - (_bfd_strip_section_from_output): Use them. - * coffcode.h (coff_set_alignment_hook): Likewise. - * elf32-mips.c (_bfd_mips_elf_final_link): Likewise. - * elf64-mips.c (mips_elf64_final_link): Likewise. - * elf64-mmix.c (mmix_elf_final_link): Likewise. - * sunos.c (sunos_add_dynamic_symbols): Likewise. - * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise. - * bfd-in2.h: Regenerate. - - * netbsd-core.c (netbsd_core_file_p): Use bfd_make_section_anyway - rather than doing our own section handling. Clean up after errors - with bfd_release and bfd_section_list_clear. Handle unexpected - flags. - * aoutf1.h (sunos4_core_file_p): Likewise. - * aix386-core.c (aix386_core_file_p): Likewise. - * cisco-core.c (cisco_core_file_validate): Likewise. - * ptrace-core.c (ptrace_unix_core_file_p): Likewise. - * trad-core.c (trad_unix_core_file_p): Likewise. +2004-01-13 Ian Lance Taylor - * hppabsd-core.c (hppabsd_core_core_file_p): Clean up after errors - with bfd_release and bfd_section_list_clear. - * hpux-core.c (hpux_core_core_file_p): Likewise. - * irix-core.c (irix_core_core_file_p): Likewise. - * lynx-core.c (lynx_core_file_p): Likewise. - * osf-core.c (osf_core_core_file_p): Likewise. - * rs6000-core.c (rs6000coff_core_p): Likewise. - * sco5-core.c (sco5_core_file_p): Likewise. + * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Call + mips_elf64_rtype_to_howto instead of using howto_table. - * elf32-mips.c (_bfd_mips_elf_lo16_reloc): Simplify, and perform - sign extension adjustments without conditionals. - -2002-01-04 Jakub Jelinek - - * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Don't crash if - CIE at .eh_frame start is removed due to no FDEs referencing it. +2004-01-13 Daniel Jacobowitz + + * elf32-arm.h (elf32_arm_final_link_relocate): Check that we created + the .plt section. + (elf32_arm_check_relocs): Don't increment the PLT refcount for + relocs which would not use the PLT. + +2004-01-13 Alan Modra + + * elf64-ppc.c (ppc64_elf_check_relocs): Ignore !SEC_ALLOC relocs. + (ppc64_elf_gc_sweep_hook): Likewise. + (ppc64_elf_size_dynamic_sections): Test for .plt directly. + +2004-01-12 Anil Paranjpe + + Adds linker relaxation support for bit manipulation insns like + band, bclr, biand, bild, bior, bist, bixor, bld, bnot, bor, bset, + bst, btst, bxor. + * elf32-h8300.c: Opcode for bit manipulation insn is checked in + elf32_h8_relax_section function while relxation for aa:16 and aa:32. + * coff-h8300.c: Opcode for bit manipulation insn is checked in + h8300_reloc16_extra_cases function while relxation for aa:16 and aa:32. + +2004-01-12 Alan Modra + + * dwarf2.c: Convert to C90, remove unneeded casts and prototypes. + +2004-01-11 Kazu Hirata + + * elf32-h8300.c: Fix formatting. + +2004-01-11 Kazu Hirata + + * elf32-cris.c (cris_elf_gc_sweep_hook): Return early if no + dynamic object is present. Declare r_symndx and h in an inner + scope. + * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise. + +2004-01-09 Daniel Jacobowitz + + * elf32-arm.h (struct elf32_arm_relocs_copied): Remove pc_count. + (elf32_arm_copy_indirect_symbol): Don't copy pc_count. + (elf32_arm_final_link_relocate): Handle PLT32 and PC24 relocs + identically. Do not emit PC24 relocations for shared libraries. + (elf32_arm_gc_sweep_hook): Handle PLT32 and PC24 relocs + identically. Don't adjust pc_count. + (elf32_arm_check_relocs): Handle PLT32 and PC24 relocs identically. + Set ELF_LINK_HASH_NEEDS_PLT for both. Don't adjust pc_count; don't + adjust count for branch relocations. + (allocate_dynrelocs): Correct typo in call to + WILL_CALL_FINISH_DYNAMIC_SYMBOL. Never allocate space for + PC24 or PLT32 relocs when linking. + +2004-01-09 Dmitry Semyonov + + * coff-arm.c (aoutarm_std_reloc_howto): [ARM_WINCE] Synchronize ARM_26D + relocation howto with ARM_26 one for consistency. + (coff_arm_relocate_section): Set partial_inplace for ARM_26 relocations + that will be converted to ARM_26D ones, since we always want 'done' + relocations to be reflected in section's data. + (coff_arm_relocate_section): [ARM_WINCE] Quick fix for BL instruction + offset. + (_bfd_final_link_relocate): Do not modify "inplace" data, if not + requested. + +2004-01-08 Dmitry Semyonov + + * coff-arm.c (coff_arm_relocate_section): Do not alter relocs that + are not partial_inplace during a relocatable link. + +2004-01-08 Kazu Hirata + + * elf32-m68k.c (elf_m68k_gc_sweep_hook): Return early + if no dynamic object is present. Declare r_symndx and h in an + inner scope. + +2004-01-07 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Don't install + trampoline if it is known out of range. + +2004-01-06 Alexandre Oliva + + 2003-12-17 Alexandre Oliva + * elf32-frv.c (_frv_osec_readonly_p): New. + (_frv_emit_got_relocs_plt_entries): Don't emit rofixup for + undefweak symbol. + (_frv_count_got_plt_entries): Adjust expected count accordingly. + (elf32_frv_relocate_section): Likewise. Error out if attempting + to emit rofixups or dynamic relocs in read-only segments. Use + _bfd_elf_section_offset to adjust r_offsets in rofixups and + dynamic relocations. + 2003-12-12 Alexandre Oliva + * elf32-frv.c (elf32_frv_relocate_section): Compute dynamic + relocations or fixups involving merged sections correctly. Avoid + crash when undefined symbol is referenced by R_FRV_32 or + R_FRV_FUNCDESC_VALUE. + 2003-12-02 Alexandre Oliva + * elf32-frv.c (elf32_frv_relocate_section): Add output_offset of + input section holding local symbol to addend of R_FRV_32 or + R_FRV_FUNCDESC_VALUE dynamic relocation. + 2003-11-27 Alexandre Oliva + * elf32-frv.c (elf32_frv_modify_segment_map): Add link info arg. + (elf32_frv_always_size_sections): Don't store pointer to + __stacksize symbol in sec_info. + (elf32_frv_modify_segment_map): Look it up here. + 2003-11-26 Alexandre Oliva + * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Emit the address + of the lazy PLT entry, not only its offset, as the low word of a + function descriptor. + 2003-11-10 Alexandre Oliva + * elf32-frv.c (elf32_frv_always_size_sections): Define __stacksize + if a hash table entry already exists but is not a definition. + 2003-11-05 Alexandre Oliva + * elf32-frv.c (frv_elf_link_hash_table_create): Use bfd_zalloc. + (_frv_add_rofixup): Don't inline. + (_frv_emit_got_relocs_plt_entries): Use NULL as funcdesc address + for undefweak symbols. + (elf32_frv_relocate_section): Avoid crash while computing + relocation when linking with shared library. Only emit rofixups + and dynamic relocations for alloc&load sections. Mark binaries + with inter-segment relocations for relocation as a unit. + (_frv_create_got_section): Rename .rofixup.got to .rofixup. + (DEFAULT_STACK_SIZE): New. + (_frv_count_got_plt_entries): Fix thinko in deciding whether to + emit rofixups or dynamic relocs when linking dynamic non-PIE + executables. + (elf32_frv_size_dynamic_sections): Generate rofixup on PIEs and + shared libs too. Reserve the last entry for the GOT pointer. + (elf32_frv_finish_dynamic_sections): Emit it. + (elf32_frv_always_size_sections): New. + (elf32_frv_modify_segment_map): New. + (elf32_frv_check_relocs): Reserve relocs32 space only in ALLOC + sections. + (frv_elf_merge_private_bfd_data): Clear PIC bit if FDPIC is set. + (frv_elf_print_private_bfd_data): Handle FDPIC and LIBPIC. + (elf_backend_always_size_sections): New. + (elf_backend_modify_segment_map): New. + 2003-10-31 Alexandre Oliva + * config.bfd: Added frv-*-*linux*. + * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Use idx 0 for + ABS section, instead of crashing. + (elf32_frv_relocate_section): Don't crash before warning about + different segments in non-PIC relocation. + 2003-10-17 Alexandre Oliva + * elf32-frv.c (elf32_frv_relocate_section): Don't warn on LABEL24 + relocs to undefweak symbols. + (elf32_frv_relocate_section): Ditto for undefined symbols. + 2003-10-06 Alexandre Oliva + * elf32-frv.c (elf32_frv_create_dynamic_sections): Make sure + gotfixup section was created. + 2003-09-30 Alexandre Oliva + * elf32-frv.c (elf32_frv_howto_table): Change GOT12, + FUNCDESC_GOT12, GOTOFF12 and FUNCDESC_GOTOFF12 to + complain_overflow_signed. + * elf32-frv.c (_frv_add_rofixup): Do not error out if contents + have not been allocated. + (_frv_emit_got_relocs_plt_entries): Return non-void. Assert + privfd only if dynamic sections were created. + (elf32_frv_relocate_section): Compute gprel_segment, and use it + for GPREL relocs. When linking relocatable FDPIC executables, + emit warnings for relocations that would be illegal on PIE or + shared libraries. Emit rofixup for R_FRV_32 only if input object + is not FDPIC. + (_frv_create_got_section): Define _gp symbol in the rofixup + section. + (elf32_frv_finish_dynamic_sections): If rofixups needed but + dynamic sections missing, error out requesting -melf32frvfd. + 2003-09-19 Alexandre Oliva + * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Rearrange + computation of addends from section and global or local symbol + value. Change return type to bfd_boolean, and return a failure if + a dynamic FUNCDESC or FUNCDESC_VALUE relocation that requires a + nonzero addend is required. + (elf32_frv_relocate_section): Likewise. Print error for + unsupported nonzero addends. + 2003-09-18 Alexandre Oliva + * elf32-frv.c (FRV_SYM_LOCAL): In the absence of dynamic sections, + force everything local. + (_frv_emit_got_relocs_plt_entries): Cope with NULL sec. + * elf32-frv.c (struct frv_elf_link_hash_table): Added sgotfixup. + (frv_gotfixup_section): New. + (FRV_SYM_LOCAL): Accept undefweak and local common symbols. + (struct frv_pic_relocs_info): Split relocs into relocs32, relocsfd + and relocsfdv. + (_frv_add_rofixup): New. + (_frv_emit_got_relocs_plt_entries): Generate fixups for non-PIE + fdpic executables. Use FRV_SYM_LOCAL more widely to simplify and + improve some ugly conditions. + (elf32_frv_relocate_section): Likewise. Reject inter-segment + relocations in fdpic. + (_frv_create_got_section): Create .rofixup.got section. + (struct _frv_dynamic_got_info): Added fixups. + (_frv_count_got_plt_entries): Account in-GOT relocations into + relocs32, relocsfd and relocsfdv. Account them into relocs or + fixups, as appropriate. + (elf32_frv_size_dynamic_sections): Size rofixup section. Simplify + sizing of gotrel. + (elf32_frv_finish_dynamic_sections): Verify that the right number + of relocations and fixups was generated. + (elf32_frv_check_relocs): Compute relocs32, relocsfd and + relocsfdv. + * elf32-frv.c (FRV_SYM_LOCAL): New macro, used instead of + SYMBOL_CALLS_LOCAL and SYMBOL_REFERENCES_LOCAL. + (FRV_FUNCDESC_LOCAL): New macro, used to decide whether a function + descriptor of a (formerly-)global symbol is local. + (struct frv_pic_relocs_info): Adjust comments. + (_frv_emit_got_relocs_plt_entries): Adjust. + (elf32_frv_relocate_section): Likewise. + (_frv_count_got_plt_entries): Likewise. + * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Don't add global + symbol's value to addend in the common preamble. Decay dynamic + symbols to section+offset if they bind or call locally, for GOT + and FUNCDESC_VALUE, respectively. + (elf32_frv_relocate_section): Likewise. + (elf32_frv_check_relocs): Don't register as dynamic symbols of + internal or hidden visibility. + 2003-09-17 Alexandre Oliva + * elf32-frv.c (_frv_emit_got_relocs_plt_entries): Get addend as + argument, so as to not call _bfd_elf_rel_local_sym to compute it. + (elf32_frv_relocate_section): Pass relocation addend in. Use + original relocation addend to look up the got relocs/plt entries + table. Do not call _bfd_elf_rel_local_sym. Don't error out when + processing relocations that reference .scommon symbols. + 2003-09-15 Alexandre Oliva + Introduce support for dynamic linking. + * elf32-frv.c (R_FRV_FUNCDESC_VALUE): Mark it as 64 bits. + (elf32_frv_rel_32_howto, elf32_frv_rel_funcdesc_howto, + elf32_frv_rel_funcdesc_value_howto): New REL descriptors. + (frv_reloc_type_lookup): Return REL howtos for executables and + dynamic libraries. + (frv_info_to_howto_rel): New. + (struct frv_elf_link_hash_table): New. + (frv_hash_table, frv_got_section, frv_gotrel_section, + frv_plt_section, frv_pltrel_section, frv_relocs_info, + frv_got_initial_offset, frv_plt_initial_offset): New macros. + (frv_elf_link_hash_table_create): New. + (struct frv_pic_relocs_info): New. + (frv_pic_relocs_info_hash, frv_pic_relocs_info_eq): New. + (frv_pic_relocs_info_find): New. + (frv_pic_relocs_info_for_global, frv_pic_relocs_info_for_local): + New. + (FRV_LZPLT_BLOCK_SIZE, FRV_LZPLT_RESOLVE_LOC): New. + (_frv_add_dyn_reloc, _frv_osec_to_segment): New. + (_frv_emit_got_relocs_plt_entries): New. + (elf32_frv_relocate_section): Add support for dynamic linking. + Handle new relocations. + (_frv_create_got_section): New. + (elf32_frv_create_dynamic_sections): New. + (ELF_DYNAMIC_INTERPRETER): New. + (struct _frv_dynamic_got_info): New. + (_frv_count_got_plt_entries): New. + (struct _frv_dynamic_got_plt_info): New. + (_frv_compute_got_alloc_data): New. + (_frv_get_got_entry, _frv_get_fd_entry): New. + (_frv_assign_got_entries, _frv_assign_plt_entries): New. + (_frv_resolve_final_relocs_info): New. + (elf32_frv_size_dynamic_sections): New. + (elf32_frv_finish_dynamic_sections): New. + (elf32_frv_adjust_dynamic_symbol): New. + (elf32_frv_finish_dynamic_symbol): New. + (elf32_frv_check_relocs): Handle new relocs. Explain how the + whole thing works. + (elf_info_to_howto_rel): Define. + (bfd_elf32_bfd_link_hash_table_create): Define. + (elf_backend_create_dynamic_sections): Define. + (elf_backend_adjust_dynamic_symbol): Define. + (elf_backend_size_dynamic_sections): Define. + (elf_backend_finish_dynamic_symbol): Define. + (elf_backend_finish_dynamic_sections): Define. + (elf_backend_want_got_sym): Define. + (elf_backend_got_header_size): Define. + (elf_backend_want_got_plt): Define. + (elf_backend_plt_readonly): Define. + (elf_backend_want_plt_sym): Define. + (elf_backend_plt_header_size): Define. + (elf_backend_may_use_rel_p): Define. + (elf_backend_may_use_rela_p): Define. + (elf_backend_default_use_rela_p): Define. + 2003-08-08 Alexandre Oliva + * elf32-frv.c (R_FRV_FUNCDESC_VALUE, R_FRV_FUNCDESC_GOTOFF12, + R_FRV_FUNCDESC_GOTOFFHI, R_FRV_FUNCDESC_GOTOFFLO, R_FRV_GOTOFF12, + R_FRV_GOTOFFHI, R_FRV_GOTOFFLO): New. + (frv_reloc_map): Map the corresponding BFD relocs to them. + (frv_reloc_type_lookup): ... and back to BFD relocs. + * reloc.c: New relocs. + * bfd-in2.h, libbfd.h: Rebuilt. + 2003-08-04 Alexandre Oliva + * elf32-frv.c (R_FRV_GOT12, R_FRV_GOTHI, R_FRV_GOTLO, + R_FRV_FUNCDESC, R_FRV_FUNCDESC_GOT12, R_FRV_FUNCDESC_GOTHI, + R_FRV_FUNCDESC_GOTLO): New. + (frv_reloc_map): Map the corresponding BFD relocs to them. + (frv_reloc_type_lookup): ... and back to BFD relocs. + * reloc.c: New relocs. + * bfd-in2.h, libbfd.h: Rebuilt. -2002-01-04 Jason Thorpe +2004-01-05 Maciej W. Rozycki - * config.bfd (x86_64-*-netbsd*): New target. - * configure.in (x86_64-*-netbsd*): Set COREFILE - to netbsd-core.lo. - * configure: Regenerated. + * elf32-mips.c (ELF_MAXPAGESIZE): Redefine for traditional + targets to support pages of up to 64kB. + (elf32_bed): Redefine to get a separate backend data structure for + traditional targets. + * elf64-mips.c (ELF_MAXPAGESIZE): Redefine for traditional + targets to support pages of up to 64kB. + (elf64_bed): Redefine to get a separate backend data structure for + traditional targets. + * elfn32-mips.c (ELF_MAXPAGESIZE): Redefine for traditional + targets to support pages of up to 64kB. + (elf32_bed): Redefine to get a separate backend data structure for + traditional targets. -2002-01-03 Tom Rix +2004-01-04 Mark Kettenis - * xcofflink.c (_bfd_xcoff_bfd_final_link): Update .pad section ordering - for recent bfd_make_section_anyway change. + * elf32-sparc.c (elf32_sparc_grok_psinfo): New function. -2002-01-03 Nick Clifton +2004-01-02 Mark Kettenis - * elf32-arm.h (elf32_arm_final_link_relocate): Handle - R_ARM_THM_PC11 reloc. + * elf32-i386.c (elf_i386_grok_prstatus): Add support for FreeBSD. + (elf_i386_grok_psinfo): Likewise. -2002-01-02 Nick Clifton +2004-01-02 Bernardo Innocenti - * configure.in (LINGUAS): Add ja. - * configure: Regenerate. - * po/ja.po: Import from translation project's web site. + * config.bfd: Add m68k-uClinux target. -2002-01-02 Nick Clifton +2004-01-01 Grant Edwards - * elf32-arm.h (elf32_arm_merge_private_bfd_data): Reformat error - messages to ease translation into other languages. + * elflink.h (elf_gc_sections): Warn when gc-sections option is ignored. + * elf32-h8300.c (elf32_h8_gc_mark_hook): New function. + (elf32_h8_gc_sweep_hook): New function. + (elf_backend_gc_mark_hook): Define. + (elf_backend_gc_sweep_hook): Define. + (elf_backend_can_gc_sections): Define. -For older changes see ChangeLog-0001 +For older changes see ChangeLog-0203 Local Variables: mode: change-log diff --git a/contrib/binutils/bfd/ChangeLog-0001 b/contrib/binutils/bfd/ChangeLog-0001 index 3000c03..b5a3475 100644 --- a/contrib/binutils/bfd/ChangeLog-0001 +++ b/contrib/binutils/bfd/ChangeLog-0001 @@ -1514,7 +1514,7 @@ 2001-10-08 Aldy Hernandez - * bfd/config.bfd (targ_cpu): Add arm9e-*-elf. + * config.bfd (targ_cpu): Add arm9e-*-elf. 2001-10-06 Stephane Carrez @@ -2858,13 +2858,13 @@ 2001-08-31 Eric Christopher Jason Eckhardt - * bfd/archures.c: Add mipsisa32 and mipsisa64. Remove mips32, + * archures.c: Add mipsisa32 and mipsisa64. Remove mips32, mips32_4k and mips64. - * bfd/aoutx.h: Remove bfd_mach_mips32, bfd_mach_mips32_4k, + * aoutx.h: Remove bfd_mach_mips32, bfd_mach_mips32_4k, bfd_mach_mips64. Add bfd_mach_mipsisa32, bfd_mach_mipsisa64. - * bfd/cpu-mips.c: Ditto. - * bfd/elf32-mips.c (_bfd_mips_elf_final_write_processing): Ditto. - * bfd/bfd-in2.h: Regenerate. + * cpu-mips.c: Ditto. + * elf32-mips.c (_bfd_mips_elf_final_write_processing): Ditto. + * bfd-in2.h: Regenerate. 2001-08-31 Jakub Jelinek @@ -3726,7 +3726,7 @@ 2001-07-04 H.J. Lu - * bfd/elf32-mips.c (_bfd_mips_elf_final_write_processing): + * elf32-mips.c (_bfd_mips_elf_final_write_processing): Handle bfd_mach_mips4400, bfd_mach_mips4600 and bfd_mach_mips5000. @@ -4529,7 +4529,7 @@ * elf32-openrisc.c (openrisc_elf_howto_table): Do not complain about overflow in R_OPENRISC_LO_16_IN_INSN and - R_OPENRISC_HI_16_IN_INSN.Index: bfd/elf32-openrisc.c + R_OPENRISC_HI_16_IN_INSN. 2001-04-30 H.J. Lu diff --git a/contrib/binutils/bfd/ChangeLog-0203 b/contrib/binutils/bfd/ChangeLog-0203 new file mode 100644 index 0000000..f99029a --- /dev/null +++ b/contrib/binutils/bfd/ChangeLog-0203 @@ -0,0 +1,11405 @@ +2003-12-19 Kazuhiro Inaoka + + Adfd m32r-linux and PIC support. Add new ABI that uses RELA. + * config.bfd (m32r*-*-linux*, m32r*le-*-linux*, m32r*le-*-*): Added. + * configure.in (bfd_elf32_m32rlin_vec, bfd_elf32_m32rlelin_vec, + bfd_elf32_m32rle_vec): Added + * configure: Regenerated. + * elf32-m32r.c (m32r_info_to_howto, m32r_elf_adjust_dynamic_symbol, + m32r_elf_size_dynamic_sections, m32r_elf_create_dynamic_sections, + m32r_elf_finish_dynamic_sections, m32r_elf_finish_dynamic_symbol, + allocate_dynrelocs, readonly_dynrelocs, m32r_elf_reloc_type_class, + m32r_elf_fake_sections): Added. + (m32r_elf_howto_table): Added + R_M32R_16_RELA, R_M32R_32_RELA, R_M32R_24_RELA, + R_M32R_10_PCREL_RELA, R_M32R_18_PCREL_RELA, + R_M32R_26_PCREL_RELA, R_M32R_HI16_ULO_RELA, + R_M32R_HI16_SLO_RELA, R_M32R_LO16_RELA, + R_M32R_SDA16_RELA, R_M32R_RELA_GNU_VTINHERIT, + R_M32R_RELA_GNU_VTENTRY, R_M32R_GOT24, + R_M32R_26_PLTREL, R_M32R_COPY, R_M32R_GLOB_DAT, + R_M32R_JMP_SLOT, R_M32R_RELATIVE, R_M32R_GOTOFF, + R_M32R_GOTPC24, R_M32R_GOT16_HI_ULO, + R_M32R_GOT16_HI_SLO, R_M32R_GOT16_LO, + R_M32R_GOTPC_HI_ULO, R_M32R_GOTPC_HI_SLO, + R_M32R_GOTPC_LO. + (m32r_elf_relocate_section, m32r_elf_check_relocs): Changed for + New ABI. + * reloc.c: Add BFD_RELOC_M32R_GOT24, BFD_RELOC_M32R_26_PLTREL, + BFD_RELOC_M32R_COPY, BFD_RELOC_M32R_GLOB_DAT, + BFD_RELOC_M32R_JMP_SLOT, BFD_RELOC_M32R_RELATIVE, + BFD_RELOC_M32R_GOTOFF, BFD_RELOC_M32R_GOTPC24, + BFD_RELOC_M32R_GOT16_HI_ULO, BFD_RELOC_M32R_GOT16_HI_SLO, + BFD_RELOC_M32R_GOT16_LO, BFD_RELOC_M32R_GOTPC_HI_ULO, + BFD_RELOC_M32R_GOTPC_HI_SLO, BFD_RELOC_M32R_GOTPC_LO. + * targets.c (bfd_elf32_m32rlin_vec, bfd_elf32_m32rlelin_vec, + bfd_elf32_m32rle_vec): Added. + * bfd-in2.h: Regenerated. + * libbfd.h: Regenerated. + +2003-12-19 Danny Smith + + * coffcode.h (styp_to_sec_flags): Don't treat .reloc section + as SEC_DEBUGGING. + +2003-12-18 Richard Sandiford + + * elf32-mips.c (elf_mips_howto_table_rel): Replace all uses of + mips_elf_generic_reloc with _bfd_mips_elf_generic_reloc. Use + _bfd_mips_elf_hi16_reloc for R_MIPS_HI16 and R_MIPS_GNU_REL_HI16, + _bfd_mips_elf_lo16_reloc for R_MIPS_LO16 and R_MIPS_GNU_REL_LO16, + and _bfd_mips_elf_got16_reloc for R_MIPS_GOT16. Change rightshift + to 16 for R_MIPS_HI16 and R_MIPS_GNU_REL_HI16. + (mips_elf_generic_reloc, struct mips_hi16, mips_elf_hi16_reloc) + (mips_elf_lo16_reloc, mips_elf_got16_reloc): Delete. + (_bfd_mips_elf32_gprel16_reloc): Remove special case. + (mips_elf_gprel32_reloc, mips32_64bit_reloc): Likewise. + + * elf64-mips.c (mips_elf64_howto_table_rel): Replace all uses of + mips_elf_generic_reloc with _bfd_mips_elf_generic_reloc. Use + _bfd_mips_elf_hi16_reloc for R_MIPS_HI16, _bfd_mips_elf_lo16_reloc + for R_MIPS_LO16 and _bfd_mips_elf_got16_reloc for R_MIPS_GOT16. + Change R_MIPS_HI16's rightshift to 16. + (mips_elf64_howto_table_rela): Replace all uses of + mips_elf_generic_reloc with _bfd_mips_elf_generic_reloc. + Use _bfd_mips_elf_generic_reloc for R_MIPS_GOT16 as well. + (mips_elf64_hi16_reloc, mips_elf64_got16_reloc): Delete. + (mips_elf64_shift6_reloc): Remove special case. Use + _bfd_mips_elf_generic_reloc instead of returning bfd_reloc_continue. + + * elfn32-mips.c (prev_reloc_section): Delete. + (prev_reloc_address, prev_reloc_addend): Delete. + (elf_mips_howto_table_rel, elf_mips_howto_table_rela): As for + elf64-mips.c + (GET_RELOC_ADDEND, SET_RELOC_ADDEND): Delete. + (mips_elf_generic_reloc, struct mips_hi16, mips_elf_hi16_reloc) + (mips_elf_lo16_reloc, mips_elf_got16_reloc): Delete. + (mips_elf_gprel16_reloc): Delete use of GET_RELOC_ADDEND. + (mips_elf_literal_reloc, mips_elf_gprel32_reloc): Likewise. + (mips16_jump_reloc, mips16_gprel_reloc): Likewise. + (mips_elf_shift6_reloc): Likewise. Delete use of SET_RELOC_ADDEND. + + * elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp): Use + _bfd_relocate_contents to install an in-place addend. + (mips_hi16): New structure. + (mips_hi16_list): Moved from elf32-mips.c. + (_bfd_mips_elf_hi16_reloc, _bfd_mips_elf_got16_reloc): New functions. + (_bfd_mips_elf_lo16_reloc, _bfd_mips_elf_generic_reloc): New functions. + (mips_elf_calculate_relocation): Assume addend is unshifted. + (_bfd_mips_elf_relocate_section): Don't apply the howto rightshift + on top of the usual high-part shift. Don't shift the addend right + before calling mips_elf_calculate_relocation. + + * elfxx-mips.h (_bfd_mips_elf_hi16_reloc): Declare. + (_bfd_mips_elf_got16_reloc, _bfd_mips_elf_lo16_reloc): Declare. + (_bfd_mips_elf_generic_reloc): Declare. + +2003-12-16 Eric Youngdale + Nick Clifton + + * peicode.h (pe_ILF_build_a_bfd): Only skip one instance of each + prefix character, if they are present. + +2003-12-15 Dmitry Semyonov + Nick Clifton + + * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Ensure that correct flags + are set on known section types. + +2003-12-12 Nick Clifton + + * po/ro.po: Updated translation. + +2003-12-12 Alan Modra + + * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Check for + NULL dyn_h. + +2003-12-11 Nick Clifton + + * elf.c (INCLUDE_SECTION_IN_SEGMENT): Skip PT_GNU_STACK segments. + +2003-12-08 Richard Sandiford + + * elfxx-mips.h, elfxx-mips.c, cpu-mips.c: Convert prototypes. + Remove casts that were only needed for K&R compatibility. + +2003-12-08 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Remove "bfd *" and add + "elflink_hash_entry *" param to elf_backend_link_output_symbol_hook. + Add "elflink_hash_entry *" param to elf_backend_output_arch_syms. + * elflink.h (elf_link_output_sym): Add "elflink_hash_entry *" param, + and pass to output_symbol_hook. + (elf_bfd_final_link): Adjust elf_link_output_sym calls. + (elf_link_output_extsym): Likewise. + (elf_link_input_bfd): Likewise. + * elf32-sh64.c (sh64_elf_link_output_symbol_hook): Adjust. + * elf32-v850.c (v850_elf_link_output_symbol_hook): Likewise. + * elf64-mmix.c (mmix_elf_link_output_symbol_hook): Likewise. + * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Likewise. + * elfxx-mips.c (_bfd_mips_elf_link_output_symbol_hook): Likewise. + * elfxx-mips.h (_bfd_mips_elf_link_output_symbol_hook): Likewise. + * elf64-sparc.c (sparc64_elf_output_arch_syms): Likewise. + * elf64-hppa.c (elf64_hppa_link_output_symbol_hook): Likewise. + Validate dynh->h against h. + * elf64-ppc.c (struct ppc_link_hash_entry): Add adjust_done bitfield. + (link_hash_newfunc): Init it. + (adjust_opd_syms): New function. + (ppc64_elf_edit_opd): Set adjust_done when global .opd sym adjusted. + Set opd.adjust for all .opd relocs. Call adjust_opd_syms. + (ppc64_elf_tls_optimize): Adjust possible .opd sym values here. + (ppc64_elf_relocate_section): Also adjust syms not a multiple of 24. + (ppc64_elf_output_symbol_hook): New function. + (elf_backend_link_output_symbol_hook): Define. + +2003-12-07 Richard Sandiford + + * elf32-mips.c, elfn32-mips.c, elf64-mips.c: Convert prototypes. + Remove casts that were only needed for K&R compatibility. + +2003-12-05 Dmitry Semyonov + + * coff-arm.c (aoutarm_std_reloc_howto [ARM_WINCE]): Set + partial_inplace for these relocs to FALSE for comptability with + the MS linker. + Remap ARM_26D relocation from 5 to 0. This fixes "bad fixup" error + generated by MS linker, and brings the relocation in line the MS + PE documentation. + +2003-12-04 H.J. Lu + + * elf32-ppc.c (ppc_elf_relax_section): Don't check relax_finalizing. + +2003-12-04 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Use the + need_relax_finalize field in link_info instead of + relax_finalizing to check if the relax finalize pass is being + done. + +2003-12-04 Dmitry Semyonov + + * coff-arm.c (coff_arm_relocate_section, bfd_arm_process_before_allocation): + Change ARM26* to ARM_26* in comments to match definitions. + (coff_arm_adjust_symndx): Replace hard-coded constants with + appropriate definitions (ARM_26*). + +2003-12-04 Alan Modra + + * coff-i860.c (coff_i860_reloc_nyi): Return bfd_reloc_not_supported. + * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Warning fixes. + (mn10300_elf_relax_section): Likewise. + * nlm32-alpha.c (ONES): Define. + (nlm32_alpha_howto_table): Use it to avoid warnings. + +2003-12-04 Alan Modra + + * elf32-i386.c (elf_i386_object_p): Delete. + (elf_backend_object_p): Don't define. + * elf32-s390.c (elf_s390_object_p): No need to alloc tdata here. + * elf32-sh.c (sh_elf_object_p): Likewise. + * elf32-sparc.c (elf32_sparc_object_p): Likewise. + * elf64-alpha.c (elf64_alpha_object_p): Likewise. + * elf64-s390.c (elf_s390_object_p): Likewise. + * elf64-x86-64.c (elf64_x86_64_elf_object_p): Likewise. + +2003-12-03 Kazuhiro Inaoka + + * archures.c (bfd_mach_m32r2): Add new machine type. + * bfd-in2.h: Regenerate. + * cpu-m32r.c : Add new machine type. + * elf32-m32r.c (m32r_elf_object_p, m32r_elf_final_write_processing, + m32r_elf_merge_private_bfd_data): Add support for new machine + type. + +2003-12-03 Dave Airlie + + * config.bfd: Add vax-linux-gnu target. + * configure.in: Likewise. + * configure: Regenerate. + +2003-12-03 Alan Modra + + * ecoff.c (ecoff_link_add_archive_symbols): Update for renamed + bfd_link_hash_entry field "next" -> "und_next". + * linker.c (_bfd_link_hash_newfunc): Likewise. + (bfd_link_add_undef): Likewise. + (_bfd_generic_link_add_archive_symbols): Likewise. + (_bfd_generic_link_add_one_symbol): Likewise. + * xcofflink.c (xcoff_link_add_symbols): Likewise. + +2003-12-02 Nick Clifton + + * configure.in (ALL_LINGUAS): Add ro. + * po/ro.po: New Romanian translation. + +2003-12-02 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2003-12-01 Dmitry Semyonov + + * coffcode.h (coff_compute_section_file_positions): Set page_size + to 1 instead of 0 in the case file alignment value is zero. + +2003-12-01 Kazu Hirata + + * coff-rs6000.c: Remove ARGSUSED and VARARGS. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * elf32-vax.c: Likewise. + * hash.c: Likewise. + * hppabsd-core.c: Likewise. + * hpux-core.c: Likewise. + * ihex.c: Likewise. + * netbsd-core.c: Likewise. + * osf-core.c: Likewise. + * pdp11.c: Likewise. + * ptrace-core.c: Likewise. + * sco5-core.c: Likewise. + * section.c: Likewise. + * sunos.c: Likewise. + * trad-core.c: Likewise. + +2003-12-01 Alan Modra + + * elf-bfd.h (is_elf_hash_table): Take hash tab rather than info arg. + * elf.c (_bfd_elf_merge_sections): Adjust to suit. + (_bfd_elf_link_just_syms): Likewise. + (bfd_elf_get_needed_list): Likewise. + (bfd_elf_get_runpath_list): Likewise. + (_bfd_elf_link_hash_copy_indirect): Remove unneeded parens. + * elf32-hppa.c (elf32_hppa_setup_section_lists): Don't check hash tab + creator flavour. + (elf32_hppa_set_gp): Look up output sections rather than using htab. + * elf32-i960.c: Comment fix. Formatting. + * elf32-m32r.c (m32r_elf_add_symbol_hook): Use is_elf_hash_table + rather than testing creator flavour. + * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise. + * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise. + * elflink.c (_bfd_elf_link_create_dynamic_sections): Adjust for + is_elf_hash_table change. Remove redundant test. + (bfd_elf_record_link_assignment): Use is_elf_hash_table rather than + testing creator flavour. + (elf_link_record_local_dynamic_symbol): Adjust for is_elf_hash_table. + (_bfd_elf_fix_symbol_flags): Likewise. + (_bfd_elf_adjust_dynamic_symbol): Likewise. + * elflink.h (elf_link_add_object_symbols): Likewise. Remove redundant + checks. Use is_elf_hash_table rather than testing creator flavour. + Use hash_table throughout in place of info->hash. + (elf_add_dynamic_entry): Adjust for is_elf_hash_table change. + (NAME(bfd_elf,size_dynamic_sections)): Likewise. Remove redundant + check. + (elf_bfd_final_link): Adjust for is_elf_hash_table change. + (elf_link_check_versioned_symbol): Use is_elf_hash_table rather than + testing creator flavour. + (elf_gc_sections): Add is_elf_hash_table check. + (elf_gc_common_finalize_got_offsets): Likewise. + (elf_bfd_discard_info): Adjust for is_elf_hash_table change. Remove + redundant check. + * elfxx-ia64.c (elfNN_ia64_relax_section): Use is_elf_hash_table + rather than testing creator flavour. + +2003-11-28 Christian Groessler + + * cpu-z8k.c: Convert to ISO C90. + * coff-z8k.c: Likewise. + +2003-11-27 Alexandre Oliva + + * elf-bfd.h (elf_backend_data::elf_backend_modify_segment_map): + Add link info argument. + * elf32-i370.c (elf_backend_modify_segment_map): Likewise. + * elf32-ppc.c (ppc_elf_modify_segment_map): Likewise. + * elf32-xtensa.c (elf_xtensa_modify_segment_map): Likewise. + * elf64-hppa.c (elf64_hppa_modify_segment_map): Likewise. + * elfxx-ia64.c (elfNN_ia64_modify_segment_map): Likewise. + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Likewise. + * elfxx-mips.h (_bfd_mips_elf_modify_segment_map): Likewise. + * elf.c (assign_file_positions_except_relocs, + assign_file_positions_for_segments): Likewise. Adjust calls. + +2003-11-27 Mark Kettenis + + * elf.c (elfcore_grok_netbsd_procinfo): Make a pseudosection out + of the note. + +2003-11-26 Daniel Jacobowitz + Richard Sandiford + + * elfxx-mips.c (mips_elf_set_global_got_offset): Don't set no_fn_stub. + (mips_elf_set_no_stub): New function. + (mips_elf_multi_got): Call it. + (_bfd_mips_elf_finish_dynamic_symbol): If a relocation is needed for + a secondary GOT entry, create an R_MIPS_32 or R_MIPS_64 relocation and + use mips_elf_create_dynamic_relocation to deal with any compatibility + issues. Store the adjusted addend in the GOT slot. + +2003-11-25 Mattias Engdegård + + * stabs.c (_bfd_link_section_stabs): Skip N_EXCL stabs when + procesing N_BINCL stabs. + +2003-11-25 Alan Modra + + * elf64-ppc.c (ppc_type_of_stub): Disallow stubs other than + ppc_stub_plt_call to symbols defined in shared libs. + +2003-11-22 Jakub Jelinek + + * elf-bfd.h (ELF_LINK_POINTER_EQUALITY_NEEDED): Define new flag. + * elf.c (_bfd_elf_link_hash_copy_indirect): Copy it. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. + (elf_i386_check_relocs): Set it. + (elf_i386_finish_dynamic_symbol): If it is not set, + clear st_value of SHN_UNDEF symbol. + +2003-11-20 Jim Blandy + + * cpu-powerpc.c (powerpc_compatible): Any ISA in the PowerPC + family is a superset of . + +2003-11-20 Martin Schwidefsky + + * elf32-s390.c (elf_s390_relocate_section): Don't recalculate symbol + section for reloc output and subtract the output section's address + from the addend when converting a relocation into one against a + section symbol. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + +2003-11-18 James E Wilson + + * elfxx-ia64.c (get_fptr): For fptr_rel, use dynobj not abfd. + (elfNN_ia64_size_dynamic_sections): When stripping sections, check + for ia64_info->rel_fptr_sec. + +2003-11-18 Alan Modra + + * elf64-ppc.c (toc_adjusting_stub_needed): Exit early if section + size is zero. + +2003-11-17 Daniel Jacobowitz + + * elf.c (_bfd_elf_link_hash_copy_indirect): Copy + ELF_LINK_HASH_NEEDS_PLT. Fix formatting. + * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. + * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Likewise. + * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise. + * elf32-sh.c (sh_elf_copy_indirect_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise. + * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise. + * elf32-xtensa.c (elf_xtensa_copy_indirect_symbol): Remove. + (elf_backend_copy_indirect_symbol): Don't define. + +2003-11-14 Daniel Jacobowitz + + * elfxx-mips.c (mips_elf_merge_gots): Weaken assert for local + GOT entries. + +2003-11-13 Martin Schwidefsky + + * elf32-s390.c (elf_s390_relocate_section): Only convert R_390_32 + to R_390_RELATIVE. Convert the other relocations against local + symbols to relocations against the start of the section. + * elf64-s390.c (elf_s390_relocate_section): Only convert R_390_64 + to R_390_RELATIVE. Convert the other relocations against local + symbols to relocations against the start of the section. + +2003-11-11 Nick Clifton + + * elf-m10300.c (bfd_mn10300_elf_size_dynamic_sections): Use + info->executable not info->shared to decide if a .interp section + should be present. + * elf32-arm.h (elf32_arm_size_dynamic_sections): Likewise. + * elf32-cris.c (elf_cris_size_dynamic_sections): Likewise. + * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. + * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise. + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. + * elf32-vax.c (elf_vax_size_dynamic_sections): Likewise. + * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Likewise. + * elf64-hppa.c (elf64_hppa_size_dynamic_sections): Likewise. + * elfxx-mips.c (_bfd_mips_size_dynamic_sections): Likewise. + * elflink.h (size_dynamic_sections): Likewise. + +2003-11-10 Jonathan Wilson + + * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Swap out tls pointer. + (_bfd_XXi_final_link_postscript): Look for __tks_used symbol. If + found initialise the tls data directory entry. + +2003-11-07 Alan Modra + + * elf32-ppc.c (ppc_elf_install_value): Delete. + (shared_stub_entry, stub_entry): Make them arrays of ints. + Remove initial branch. + (ppc_elf_relax_section): Write one branch around all trampolines + instead. Correct bogus R_PPC_PLTREL24 handling. Correct + branch range check. Only use shared_stub_entry when shared. + Test that branches can reach stubs. Write trampolines out at + end so that just one realloc is used. Handle little-endian + mode. Move relevant code from ppc_elf_install_value to here. + (ppc_elf_relocate_section): Move code handling RELAX32 from + ppc_elf_install_value to here. + +2003-11-06 Alan Modra + + * elf32-ppc.c (ppc_elf_howto_raw); Add entry for R_PPC_RELAX32PC. + (ppc_elf_install_value): Handle R_PPC_RELAX32PC. Merge duplicate + cases. + (shared_stub_entry): Correct opcode. + (ppc_elf_relax_section): Generate R_PPC_RELAX32PC relocs. + (ppc_elf_relocate_section): Handle them. + +2003-11-05 Alan Modra + + * elf.c (_bfd_elf_rela_local_sym): Accept asection **, and return + updated section in case of merged section. + * elf-bfd.h (_bfd_elf_rela_local_sym): Update declaration. + * elf-hppa.h (elf_hppa_relocate_section): Adjust call. + * elf-m10200.c (mn10200_elf_relocate_section): Likewise. + * elf-m10300.c (mn10300_elf_relocate_section): Likewise. + * elf32-arm.h (elf32_arm_relocate_section): Likewise. + * elf32-avr.c (elf32_avr_relocate_section): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-fr30.c (fr30_elf_relocate_section): Likewise. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-h8300.c (elf32_h8_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-msp430.c (elf32_msp430_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section) Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. + * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-mmix.c (mmix_elf_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + + * elf32-cris.c (cris_elf_relocate_section): Don't recalculate symbol + section for reloc output. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + + * elf32-ppc.c (ppc_elf_relocate_section): Don't recalculate everything + for R_PPC_RELAX32 reloc. Don't bother checking ppc_elf_install_value + return value. + * elf64-ppc.c (ppc64_elf_relocate_section ): Sanity check + sec->id. + +2003-11-05 Alan Modra + + * elf32-d10v.c (extract_rel_addend, insert_rel_addend): New functions. + (elf32_d10v_relocate_section): Use them to handle -r reloc + adjustments, and in place of _bfd_elf_rela_local_sym. + + * cpu-iq2000.c (arch_info_struct): Warning fix. + +2003-11-05 Alan Modra + + * elf32-hppa.c (ELIMINATE_COPY_RELOCS): Define. + (elf32_hppa_copy_indirect_symbol): Don't copy NON_GOT_REF on + weakdefs. + (elf32_hppa_check_relocs): Use ELIMINATE_COPY_RELOCS. + (elf32_hppa_adjust_dynamic_symbol): Likewise. Copy weakdef + NON_GOT_REF. + (allocate_dynrelocs): Use ELIMINATE_COPY_RELOCS and + SYMBOL_CALLS_LOCAL. Discard relocs for undef weak syms with + non-default visibility. + (elf32_hppa_relocate_section): Use ELIMINATE_COPY_RELOCS and + SYMBOL_CALLS_LOCAL. + +2003-11-04 Alan Modra + + * aout-target.h, aoutf1.h, bfdio.c, bfdwin.c: Update copyright date. + * coff-apollo.c, coff-sparc.c, coff-w65.c, coff-we32k.c: Ditto. + * coff-z8k.c, coffgen.c, cpu-frv.c, cpu-h8500.c, cpu-hppa.c: Ditto. + * cpu-ia64-opc.c, cpu-m10300.c, cpu-mips.c, cpu-msp430.c: Ditto. + * cpu-rs6000.c, cpu-z8k.c, efi-app-ia32.c, elf32-am33lin.c: Ditto. + * gen-aout.c, hash.c, hp300hpux.c, init.c, mach-o.c: Ditto. + * nlm-target.h, nlm.c, som.h, stabs.c, sysdep.h, xsym.h: Ditto. + + * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Fix + "dereferencing type-punned pointer" warnings. + + * aout-adobe.c (aout_adobe_set_section_contents): Constify location. + * aoutx.h (NAME(aout,set_section_contents)): Ditto. + * bfd-in2.h: Regenerate. + * binary.c (binary_set_section_contents): Ditto. + * bout.c (b_out_set_section_contents): Ditto. + * coff-tic54x.c (tic54x_set_section_contents): Ditto. + * coffcode.h (coff_set_section_contents): Ditto. + * ecoff.c (_bfd_ecoff_set_section_contents): Ditto. + * elf-bfd.h (_bfd_elf_set_section_contents): Ditto. + * elf.c (_bfd_elf_set_section_contents): Ditto. + * elfxx-mips.c (_bfd_mips_elf_set_section_contents): Ditto. + * elfxx-mips.h (_bfd_mips_elf_set_section_contents): Ditto. + * i386msdos.c (msdos_set_section_contents): Ditto. + * ieee.c (ieee_set_section_contents): Ditto. + * ihex.c (ihex_set_section_contents): Ditto. + * libaout.h (NAME(aout,set_section_contents)): Ditto. + * libbfd-in.h (_bfd_nowrite_set_section_contents): Ditto. + (_bfd_generic_set_section_contents): Ditto. + * libbfd.h: Regenerate. + * libbfd.c (_bfd_generic_set_section_contents): Ditto. + * libecoff.h (_bfd_ecoff_set_section_contents): Ditto. + * libnlm.h (nlmNAME(set_section_contents)): Ditto. + (struct nlm_backend_data ): Ditto. + * mmo.c (mmo_set_section_contents): Ditto. + * nlm32-alpha.c (nlm_alpha_mangle_relocs): Ditto. + * nlm32-i386.c (nlm_i386_mangle_relocs): Ditto. + * nlm32-ppc.c (nlm_powerpc_mangle_relocs): Ditto. + * nlm32-sparc.c (nlm_sparc_mangle_relocs): Ditto. + * nlmcode.h (nlm_set_section_contents): Ditto. + * oasys.c (oasys_set_section_contents): Ditto. + * pdp11.c (NAME(aout,set_section_contents)): Ditto. + * ppcboot.c (ppcboot_set_section_contents): Ditto. + * srec.c (srec_set_section_contents): Ditto. + * targets.c (BFD_JUMP_TABLE_WRITE <_bfd_set_section_contents>): Ditto. + * tekhex.c (tekhex_set_section_contents): Ditto. + (move_section_contents): Ditto. + * versados.c (versados_set_section_contents): Ditto. + * vms-misc.c (_bfd_save_vms_section): Ditto. + * vms.c (vms_set_section_contents): Ditto. + * vms.h (_bfd_save_vms_section): Ditto. + +2003-11-04 Alan Modra + + * elf64-ppc.c (ppc_size_one_stub): Size relbrlt. Accept info arg + rather than htab. + (ppc64_elf_size_stubs): Adjust ppc_size_one_stub traversal. Zero + relbrlt size. + (ppc64_elf_build_stubs): Allocate space for relbrlt. + +2003-11-04 Alan Modra + + * bfd-in.h (_bfd_elf_tls_setup): Declare. + * bfd-in2.h: Regenerate. + * elf-bfd.h (struct elf_link_tls_segment): Delete. + (struct elf_link_hash_table): Add tls_sec and tls_size. + * elf.c (_bfd_elf_link_hash_table_init): Init tls_sec and tls_size. + * elflink.c (_bfd_elf_tls_setup): New function. + * elflink.h (struct elf_final_link_info): Remove first_tls_sec. + (elf_bfd_final_link): Don't set first_tls_sec here. Update code + saving tls segment info, round segment size up. + (elf_link_output_extsym): Adjust code using tls segment info. + (elf_link_input_bfd): Likewise. + * elf32-i386.c (dtpoff_base, tpoff): Likewise. + * elf32-s390.c (dtpoff_base, tpoff): Likewise. + * elf32-sh.c (dtpoff_base, tpoff): Likewise. + * elf32-sparc.c (dtpoff_base, tpoff): Likewise. + * elf64-s390.c (dtpoff_base, tpoff): Likewise. + * elf64-x86-64.c (dtpoff_base, tpoff): Likewise. + * elfxx-ia64.c (elfNN_ia64_tprel_base): Likewise. + (elfNN_ia64_dtprel_base): Likewise. + * elf64-alpha.c (alpha_get_dtprel_base): Likewise. + (alpha_get_tprel_base): Likewise. + (struct alpha_relax_info): Remove tls_segment. + (elf64_alpha_relax_got_load): Adjust invocation of + alpha_get_dtprel_base and alpha_get_tprel_base. + (elf64_alpha_relax_tls_get_addr): Likewise. + (elf64_alpha_relax_section): Likewise. + (elf64_alpha_relocate_section): Likewise. + (elf64_alpha_relax_find_tls_segment): Delete. + * elf32-ppc.c (struct ppc_elf_link_hash_table): Remove tls_sec. + (ppc_elf_tls_setup): Call _bfd_elf_tls_setup. Return section. + (ppc_elf_relocate_section): Adjust to use elf.tls_sec. + * elf32-ppc.h (ppc_elf_tls_setup): Update. + * elf64-ppc.c (struct ppc_link_hash_table): Remove tls_sec. + (ppc64_elf_tls_setup): Call _bfd_elf_tls_setup. Return section. + (ppc64_elf_tls_optimize): Adjust to use elf.tls_sec. + (ppc64_elf_relocate_section): Likewise. + * elf64-ppc.h (ppc64_elf_tls_setup): Update. + +2003-11-03 Daniel Jacobowitz + + * elf-bfd.h (struct elf_backend_data): Remove plt_header_size. + * elf-m10300.c (elf_backend_plt_header_size): Don't define. + * elf32-arm.h (elf_backend_plt_header_size): Don't define. + * elf32-cris.c (elf_backend_plt_header_size): Don't define. + * elf32-i386.c (elf_backend_plt_header_size): Don't define. + * elf32-mips.c (elf_backend_plt_header_size): Don't define. + * elf32-ppc.c (elf_backend_plt_header_size): Don't define. + * elf32-s390.c (elf_backend_plt_header_size): Don't define. + * elf32-sh.c (elf_backend_plt_header_size): Don't define. + * elf32-sparc.c (elf_backend_plt_header_size): Don't define. + * elf64-alpha.c (elf_backend_plt_header_size): Don't define. + * elf64-hppa.c (elf_backend_plt_header_size): Don't define. + * elf64-mips.c (elf_backend_plt_header_size): Don't define. + * elf64-ppc.c (elf_backend_plt_header_size): Don't define. + * elf64-s390.c (elf_backend_plt_header_size): Don't define. + * elf64-sh64.c (elf_backend_plt_header_size): Don't define. + * elf64-sparc.c (elf_backend_plt_header_size): Don't define. + * elf64-x86-64.c (elf_backend_plt_header_size): Don't define. + * elfn32-mips.c (elf_backend_plt_header_size): Don't define. + * elfxx-ia64.c (elf_backend_plt_header_size): Don't define. + * elfxx-target.h (elf_backend_plt_header_size): Don't define + or include in target initializer. + +2003-11-03 Andrew Cagney + + * section.c (bfd_set_section_contents): Make the "location" buffer + constant. + * bfd-in2.h: Re-generate. + +2003-10-30 Andrew Cagney + + * syms.c: Replace "struct symbol_cache_entry" with "struct + bfd_symbol". + * vms.h, targets.c, section.c, reloc.c, peicode.h: Ditto. + * mipsbsd.c, elf.c, linker.c, elf-bfd.h, ecoff.c: Ditto. + * cpu-z8k.c, cpu-ns32k.c, cpu-h8500.c, bfd.c, bfd-in.h: Ditto. + * bfd-in2.h: Re-generate. + +2003-10-30 Jakub Jelinek + + * elfxx-ia64.c: Include objalloc.h, hashtab.h. + (struct elfNN_ia64_local_hash_entry): Remove root. Add id and r_sym + fields. + (struct elfNN_ia64_local_hash_table): Remove. + (struct elfNN_ia64_link_hash_table): Change loc_hash_table's type + to htab_t. Add loc_hash_memory field. + (elfNN_ia64_local_hash_table_init, elfNN_ia64_new_loc_hash_entry): + Removed. + (elfNN_ia64_local_htab_hash, elfNN_ia64_local_htab_eq): New + functions. + (elfNN_ia64_hash_table_create): Use hashtab.h hashtable for + loc_hash_table. Initialize loc_hash_memory. + (elfNN_ia64_hash_table_free): New function. + (elfNN_ia64_local_hash_lookup): Remove. + (elfNN_ia64_local_dyn_sym_thunk): Change into htab_traverse + callback. + (elfNN_ia64_dyn_sym_traverse): Use htab_traverse. + (get_local_sym_hash): Use hashtab.h hashtable for loc_hash_table. + (bfd_elfNN_bfd_link_hash_table_free): Define. + +2003-10-30 Alan Modra + + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Modify versioned + symbol string in place. + +2003-10-30 Jim Blandy + + * cpu-rs6000.c (rs6000_compatible): Check the correct arch_info + object's mach field: all PowerPC machines are supersets of the + original rs6000, but not later rs6000 machines. + +2003-10-30 Alan Modra + + * dwarf2.c (struct attribute): Delete "unsnd", "snd" and "addr". + Add "val" and "sval" fields. + (DW_STRING, DW_UNSND, DW_BLOCK, DW_SND, DW_ADDR): Delete. + (read_attribute_value): Expand and adjust DW_* occurrences. + (scan_unit_for_functions, parse_comp_unit): Likewise. + +2003-10-30 Phil Edwards + + * config.bfd (arm-*-vxworks): Remove separate stanza; merge with + other common ELF triples. + (i[3-7]86-*-vxworks): Change to ELF format. + (mips*-*-windiss): New triple, add to common MIPS/ELF stanza. + (sh-*-vxworks): New stanza. + +2003-10-30 Lars Knoll + Michael Matz + Jakub Jelinek + Alan Modra + + * merge.c (struct sec_merge_sec_info): Update comment. + (struct sec_merge_hash_entry): Remove entsize. + (sec_merge_hash_lookup): Only adjust alignment when creating. + (sec_merge_emit): Remove register keyword. + (cmplengthentry, last4_eq, last_eq): Delete. + (strrevcmp, strrevcmp_align, is_suffix): New. + (merge_strings): Use them to implement fast suffix merging. + * elf-strtab.c (struct elf_strtab_hash_entry): Update comments. + Make "len" signed. + (_bfd_elf_strtab_add): Lose on >2G strings. + (_bfd_elf_strtab_emit): Don't emit strings with len < 0. + (cmplengthentry, last4_eq): Delete. + (strrevcmp, is_suffix): New. + (_bfd_elf_strtab_finalize): Rework to implement fast suffix merging. + +2003-10-29 Daniel Jacobowitz + + * elf32-arm.h (elf32_arm_final_link_relocate): Move check for + SEC_ALLOC. + +2003-10-29 Philip Blundell + + * elf32-arm.h (elf32_arm_plt0_entry, elf32_arm_plt_entry): New + code sequence. + (PLT_HEADER_SIZE): New. + (struct elf32_arm_pcrel_relocs_copied): Rename to ... + (struct elf32_arm_relocs_copied): ... this. Count both + pcrel and non-pcrel relocs. All uses updated. + (struct elf32_arm_link_hash_table): Add pointers to dynamic linker + sections and symbol/section mapping cache. + (create_got_section): New. + (elf32_arm_create_dynamic_sections): New. + (elf_backend_create_dynamic_sections): Use it. + (elf32_arm_final_link_relocate): Support garbage collection of relocs. + (elf32_arm_check_relocs): Likewise. + (elf32_arm_adjust_dynamic_symbol): Likewise. + (elf32_arm_copy_indirect_symbol): New. + (elf32_arm_link_hash_table_create): Initialise new fields. + (elf32_arm_gc_sweep_hook): Implement. + (elf32_arm_discard_copies): Delete. + (elf32_arm_finish_dynamic_symbol): Use new PLT code. + (elf32_arm_finish_dynamic_sections): Likewise. + (elf_backend_can_refcount): Define. + (elf_backend_copy_indirect_symbol): Likewise. + (elf_backend_plt_header_size): Set to PLT_HEADER_SIZE. + +2003-10-29 Alan Modra + + * elf64-ppc.c (elf_backend_grok_prstatus): Define. + (elf_backend_grok_psinfo): Define. + (ppc64_elf_grok_prstatus, ppc64_elf_grok_psinfo): New functions. + + * elf.c (_bfd_elfcore_make_pseudosection): Allow multiple + sections with the same name. + (elfcore_grok_lwpstatus): Likewise. + (elfcore_grok_win32pstatus): Likewise. + (elfcore_grok_note): Likewise. + (elfcore_grok_nto_status): Likewise. + (elfcore_grok_nto_gregs): Likewise. + +2003-10-27 Daniel Jacobowitz + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Never skip dynamic + objects. + +2003-10-14 Richard Sandiford + + * elfxx-mips.c (mips_elf_create_got_section): Initialize global_gotno. + +2003-10-24 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Look up + hash table for real symbols. + +2003-10-23 Michael Snyder + + * section.c (asection): Fix typo in comment. + +2003-10-23 Alan Modra + + * elf64-ppc.c (get_tls_mask): Add toc_symndx param, save toc + reloc symbol index to it. Don't allow gd syms in shared libs + to be optimized. + (ppc64_elf_tls_optimize): Adjust get_tls_mask call. + (ppc64_elf_size_stubs): Likewise. + (ppc64_elf_relocate_section): Check that tls relocs are only used + with tls syms, and similarly for non-tls. Correct symbol used + when optimizing toc tls code. + +2003-10-22 Nick Clifton + + * peicode.h (coff_swap_scnhdr_in): Only remove padding when + processing an executable. + +2003-10-22 Jakub Jelinek + + * elflink.c (_bfd_elf_export_symbol): Adjust for globals and locals + field changes. + (_bfd_elf_link_assign_sym_version): Likewise. + * elflink.h (size_dynamic_sections): Likewise. + +2003-10-21 Alexandre Oliva , + Michael Snyder + + * archures.c (bfd_mach_sh4a, bfd_mach_sh4al_dsp, bfd_mach_sh4_nofpu, + bfd_mach_sh4a_nofpu): New machine types. + * bfd-in2.h: Rebuilt. + * cpu-sh.c (compatible): Remove unused function. + (SH4A_NEXT, SH4AL_DSP_NEXT, SH4_NOFPU_NEXT, SH4A_NOFPU_NEXT): New. + (arch_info_struct): Add sh4a, sh4al_dsp, sh4-nofpu and sh4a-nofpu. + * elf32-sh.c (sh_elf_set_mach_from_flags): Handle them. + +2003-10-21 Wouter van Heyst + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Correct text + describing mismatched formats involving the Maverick FP type. + +2003-10-21 Anil Paranjpe + + * binary.c (binary_object_p): Pass machine flag along with + architecture. + +2003-10-21 Thorsten Brehm + + * archures.c (bfd_default_scan): Add support for mcf528x. + * ieee.c (ieee_write_processor): Likewise. + +2003-10-21 Peter Barada + Bernardo Innocenti + + * archures.c: Add MCF528x (MCFv4) support. + * bfd/cpu-m68k.c (arch_info_struct): Likewise. + * bfd-in2.h: Regenerate. + +2003-10-20 Andrew Cagney + + * targets.c: Replace "struct sec" with "struct bfd_section" + * syms.c, sparclynx.c, section.c, opncls.c: Ditto. + * libcoff-in.h, libbfd-in.h, elfxx-target.h: Ditto. + * elf.c, coffgen.c, bfd.c, bfd-in.h, aoutf1.h: Ditto. + * aout-tic30.c, aout-target.h: + * bfd-in2.h, libcoff.h, libbfd.h: Regenerate. + +2003-10-18 Hans-Peter Nilsson + + Support linker relaxation of new R_MMIX_PUSHJ_STUBBABLE relocs. + * elf64-mmix.c (MAX_PUSHJ_STUB_SIZE): New macro. + (struct _mmix_elf_section_data): New member pjs. + (mmix_set_relaxable_size, mmix_elf_get_section_contents): New + functions. + (elf_mmix_howto_table): New entry for R_MMIX_PUSHJ_STUBBABLE. + (mmix_reloc_map): Ditto. + (mmix_elf_relocate_section): Handle R_MMIX_PUSHJ_STUBBABLE. + (mmix_final_link_relocate, mmix_elf_check_common_relocs): Ditto. + (mmix_elf_perform_relocation): Ditto. Don't mark parameter addr + unused. + (mmix_elf_check_relocs): Move early return to after + mmix_elf_check_common_relocs call. + (mmix_elf_symbol_processing): Fix cut-and-pasto in head comment. + (_bfd_mmix_before_linker_allocation): Rename from + _bfd_mmix_prepare_linker_allocated_gregs. All referers changed. + Arrange to set the initial relaxable size of sections. + (_bfd_mmix_after_linker_allocation): Rename from + _bfd_mmix_finalize_linker_allocated_gregs. + (mmix_elf_relax_section): Relax a R_MMIX_PUSHJ_STUBBABLE reloc. + (bfd_elf64_get_section_contents): Define. + * reloc.c: Add ENUMX for BFD_RELOC_MMIX_PUSHJ_STUBBABLE. + * libbfd.h, bfd-in2.h: Regenerate. + + * reloc.c (bfd_generic_relax_section): Default-set + section->_cooked_size here. + (bfd_generic_get_relocated_section_contents): Don't set it here. + Explain why. + +2003-10-17 John David Anglin + + * elf32-hppa.c (elf32_hppa_relocate_section): Skip relocation if + output section has been discarded. + +2003-10-17 Shrinivas Atre + + * coff-h8300.c (funcvec_hash_newfunc): Handle normal mode. + (h8300_reloc16_extra_cases): Likewise. + (h8300_bfd_link_add_symbols): Likewise. + +2003-10-17 Dhananjay Deshpande + + * cpu-h8300.c (h8300sxn_info_struct): Correct address size. + (h8300sn_info_struct): Likewise. + (h8300hn_info_struct): Likewise. + +2003-10-16 Pavel Roskin + + * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Don't calculate image size + for sections which lack size info. + +2003-10-17 Danny Smith + + * configure.host: Add __USE_MINGW_FSEEK to HDEFINES for + mingw32. + +2003-10-16 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Also warn + undefined patterns with '*'. + +2003-10-16 H.J. Lu + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't + use the last CIE from a different section. + (_bfd_elf_write_section_eh_frame): Don't pad beyond the raw + size of the output section. + +2003-10-07 Roland McGrath + + * elf.c (_bfd_elf_make_section_from_phdr): Set alignment_power of + new section from p_align header field. + +2003-10-16 H.J. Lu + + * elf32-xtensa.c (xtensa_read_table_entries): The external size + of entry is 8 bytes. + +2003-10-15 Andrew Cagney + + * targets.c (BFD_JUMP_TABLE_SYMBOLS): Replace NAME##_get_symtab + with NAME##_canonicalize_symtab. + * libcoff-in.h (coff_canonicalize_symtab): Update. + * xsym.h (bfd_sym_canonicalize_symtab): Update. + * elf-bfd.h (_bfd_elf_canonicalize_symtab): Update. + * coffgen.c (coff_canonicalize_symtab): Update. + * libbfd-in.h (_bfd_nosymbols_canonicalize_symtab): Update. + * libnlm.h (nlmNAME(canonicalize_symtab)): Update. + * ieee.c (ieee_vec): Update comment. + * libecoff.h (_bfd_ecoff_canonicalize_symtab): Update. + * mmo.c (mmo_canonicalize_symtab): Update. + * nlm-target.h (nlm_canonicalize_symtab): Update. + * nlmcode.h (nlm_canonicalize_symtab): Update. + * i386msdos.c (msdos_canonicalize_symtab): Update. + * hp300hpux.c (MY (canonicalize_symtab)): Update. + * oasys.c (oasys_canonicalize_symtab): Update. + * som.c (som_canonicalize_symtab): Update. + * pef.c (bfd_pef_canonicalize_symtab): Update. + * nlmcode.h (nlm_canonicalize_symtab): Update. + * xsym.c (bfd_sym_canonicalize_symtab): Update. + * vms.c (vms_canonicalize_symtab): Update. + * versados.c (versados_canonicalize_symtab): Update. + * mach-o.c (bfd_mach_o_canonicalize_symtab): Update. + * ieee.c (ieee_canonicalize_symtab): Update. + * pdp11.c (NAME(aout,canonicalize_symtab)): Update. + * reloc.c: Update comment. + * libaout.h (NAME(aout,canonicalize_symtab)): Update. + * coff64-rs6000.c (aix5coff64_vec): Update. + * coff64-rs6000.c (bfd_xcoff_aix5_backend_data): Update. + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update. + * aoutx.h (NAME(aout,canonicalize_symtab)): Update. + * elfxx-target.h (bfd_elfNN_canonicalize_symtab): Update. + * hp300hpux.c (MY_canonicalize_symtab): Update. + * ecoff.c (_bfd_ecoff_canonicalize_symtab): Update. + * aout-tic30.c (MY_canonicalize_symtab): Update. + * aout-target.h (MY_canonicalize_symtab): Update. + * ppcboot.c (ppcboot_canonicalize_symtab): Update. + * elf.c (_bfd_elf_canonicalize_symtab): Update. + * elfcode.h (elf_canonicalize_symtab): Update. + * ihex.c (ihex_canonicalize_symtab): Update. + * tekhex.c (tekhex_canonicalize_symtab): Update. + * binary.c (binary_canonicalize_symtab): Update. + * srec.c (srec_canonicalize_symtab): Update. + +2003-10-15 Kazu Hirata + + * elf32-h8300.c (elf_reloc_map): Fix a comment typo. + +2003-10-15 Kaz Kojima + + * elf32-sh.c (sh_elf_relocate_section): Handle R_SH_IMM_*_PCREL + relocations. + (sh_elf_check_relocs): Likewise. + + * elf32-sh64.c (elf_backend_merge_symbol_attribute): Define. + (sh64_elf_merge_symbol_attribute): New. + * elf64-sh64.c (elf_backend_merge_symbol_attribute): Define. + (sh64_elf64_merge_symbol_attribute): New. + +2003-10-14 Kaz Kojima + + * elf-bfd.h (struct elf_backend_data): New function pointer member + elf_backend_merge_symbol_attribute. + * elflink.h (elf_link_add_object_symbols): Adjust call to + elf_backend_merge_symbol_attribute if the backend defined it. + * elfxx-target.h (elf_backend_merge_symbol_attribute): New macro. + (elfNN_bed): Add that to the initializer. + +2003-10-14 Bob Wilson + + * elf32-xtensa.c (get_is_linkonce_section): Delete. + (xtensa_is_property_section, xtensa_is_littable_section): Use + XTENSA_INSN_SEC_NAME and XTENSA_LIT_SEC_NAME macros. Do not recognize + linkonce sections containing ".xt.insn" and ".xt.lit" substrings. + (xtensa_get_property_section_name): Check section name instead of + calling get_is_linkonce_section. Remove unused bfd parameter. Use + XTENSA_INSN_SEC_NAME and XTENSA_LIT_SEC_NAME macros. Never generate + linkonce section names by appending ".xt.insn" or ".xt.lit". + (xtensa_read_table_entries): Remove bfd argument in call to + xtensa_get_property_section_name. Free section name when done. + (elf_xtensa_combine_prop_entries): Free leaking table. + +2003-10-13 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Don't add + DT_MIPS_LIBLIST or DT_MIPS_CONFLICT entries. + (_bfd_mips_elf_finish_dynamic_symbol): Don't handle them. Don't + handle DT_MIPS_MSYM. Set DT_RELSZ based on the number of relocations + that were needed. + (_bfd_mips_elf_modify_segment_map): Fix placement of PT_MIPS_OPTIONS. + (_bfd_mips_elf_merge_private_bfd_data): Ignore EF_MIPS_UCODE. + +2003-10-13 H.J. Lu + + * bfd-in.h (bfd_elf32_ia64_after_parse): New prototype. + (bfd_elf64_ia64_after_parse): Likewise. + * bfd-in2.h: Regenerated. + + * elfxx-ia64.c (oor_ip): New. + (oor_branch_size): Likewise. + (bfd_elfNN_ia64_after_parse): Likewise. + (elfNN_ia64_relax_section): Use oor_ip if oor_branch_size + equals sizeof (oor_ip). + +2003-10-12 Kaz Kojima + + * elf64-sh64.c (sh_elf64_relocate_section): Tidy up for the + renumbering of some relocation numbers. + +2003-10-11 Alan Modra + + * coff-sh.c: Move definition of MAP and guard more code with + COFF_IMAGE_WITH_PE. + + * section.c (bfd_get_section_size_before_reloc): Ignore reloc_done. + * bfd-in2.h: Regenerate. + +2003-10-10 H.J. Lu + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * doc/Makefile.in: Likewise. + +2003-10-09 H.J. Lu + + * cofflink.c: Include "safe-ctype.h". + (coff_link_add_symbols): Use ISDIGIT instead of isdigit. + +2003-10-08 Dave Brolley + On behalf of Michael Snyder + + * archures.c: Add FRV fr550 machine. + * cpu-frv.c: Ditto. + * elf32-frv.c: Ditto. + * bfd-in2.h: Regenerate. + +2003-10-08 Thiemo Seufer + + * elfxx-mips.c (STUB_MOVE,STUB_LI16): Fix stub code + for non-SGI N64 ABI. Improve code consitency. + +2003-10-07 Alexandre Oliva + + * elf32-frv.c (elf32_frv_howto_table): Set R_FRV_LABEL16's + rightshift to 2. + +2003-10-07 Nathan Sidwell + + * libbfd-in.h (_bfd_link_section_stabs): Add string offset + parameter. + * cofflink.c (coff_link_add_symbols): Deal with split stab + sections. + * elflink.h (elf_link_add_object_symbols): Deal with split stab + sections. + * stabs.c (_bfd_link_section_stabs): Add string offset parameter. + * libbfd.h: Regenerated. + + * coffcode.h (coff_set_alignment_hook): With PE_COFF reloc + overflow, set reloc start position to after the count + reloc. Subtract one from num relocs. Give error on 0xffff relocs + and no overflow. + * cofflink.c (_bfd_coff_final_link): Deal with PE_COFF reloc + overflow. + * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Do overflow if >= + 0xffff. + +2003-10-06 H.J. Lu + + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Pad the + last CIE/FDE if needed. + +2003-10-06 Nick Clifton + + * targets.c (_bfd_target_vector): Include bfd_elf64_sparc_vec if + BFD64 is enabled. + +2003-10-06 Matt Thomas + + * config.bfd: Move the hppa*-*-netbsd* case to the hppa*-*-linux* case. + +2003-10-06 Robert Millan + + * configure.in: Match GNU/KNetBSD with new knetbsd*-gnu triplet. + * config.bfd: Likewise. + * configure: Regenerate. + +2003-10-04 Christian Groessler + + * coff-z8k.c (extra_case): Fix displacement length check for R_JR + and R_CALLR. + +2003-10-04 Stephane Carrez + + * elf32-m68hc1x.c: Update to ISO C90; replace PTR with void*. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc12.c: Likewise. + * elf32-m68hc1x.h: Likewise. + +2003-10-04 Stephane Carrez + + * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Fix merge + of flags between HC12 and HCS12. + +2003-10-04 Bryce McKinlay + + * merge.c (_bfd_merge_sections): Set SEC_EXCLUDE flag on sections + which become empty after merging. + +2003-09-30 Jakub Jelinek + + * elfxx-ia64.c (ia64_howto_table): Fix size of R_IA64_TPREL64[LM]SB, + R_IA64_DTPREL{32,64}[LM]SB and R_IA64_DTPMOD64[LM]SB. + +2003-09-30 Chris Demetriou + + * archures.c (bfd_mach_mipsisa64r2): New define. + * bfd-in2.h: Regenerate. + * aoutx.h (NAME(aout,machine_type)): Handle bfd_mach_mipsisa64r2. + * cpu-mips.c (I_mipsisa64r2): New enum value. + (arch_info_struct): Add entry for I_mipsisa64r2. + * elfxx-mips.c (_bfd_elf_mips_mach) + (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_64R2. + (mips_set_isa_flags): Add bfd_mach_mipsisa64r2 case. + (mips_mach_extensions): Add entry for bfd_mach_mipsisa64r2. + +2003-09-29 H.J. Lu + + * elfxx-ia64.c (elfNN_hpux_backend_symbol_processing): New. + Handle SHN_IA_64_ANSI_COMMON. + (elf_backend_section_from_bfd_section): Defined. + +2003-09-26 H.J. Lu + + * elflink.c (elf_link_read_relocs_from_section): Add an argument + of a pointer to section. Check bad symbol index. + (_bfd_elf_link_read_relocs): Modify calls to + elf_link_read_relocs_from_section. + +2003-09-23 DJ Delorie + + * elf32-sh.c (sh_elf_howto_table): R_SH_SWITCH8, + R_SH_GNU_VTINHERIT, R_SH_GNU_VTENTRY, + R_SH_LOOP_START,R_SH_LOOP_END moved to "reserved" spaces, + R_SH_DIR16, R_SH_DIR8, R_SH_DIR8UL, R_SH_DIR8UW, R_SH_DIR8U, + R_SH_DIR8SW, R_SH_DIR8S, R_SH_DIR4UL, R_SH_DIR4UW, R_SH_DIR4U, + R_SH_PSHA, R_SH_PSHL added. + (sh_reloc_map): Add R_SH_DIR16 and R_SH_DIR8. + (sh_elf_relocate_section): Support new relocs. + +2003-09-23 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_relocate_section): Fix typo that clobbered + dynamic relocation offsets. + +2003-09-23 Alan Modra + + * simple.c (bfd_simple_get_relocated_section_contents): Free the + hash table using _bfd_generic_link_hash_table_free. + +2003-09-23 Alan Modra + + * elf-bfd.h (struct bfd_elf_special_section): Remove "suffix". Change + type of prefix_length and suffix_length to int. Rename "attributes" + to "attr". Comment. + (_bfd_elf_get_sec_type_attr): Update prototype. + * elf.c (get_special_section): Rewrite. + (_bfd_elf_get_sec_type_attr): Return struct rather than passing in + attr and type pointers. + (_bfd_elf_new_section_hook): Adjust for above. + (special_sections): Merge suffix with prefix. Set + prefix_length for all entries. Set suffix_length appropriately. + * elf32-m32r.c (m32r_elf_special_sections): Likewise. + * elf32-m68hc11.c (elf32_m68hc11_special_sections): Likewise. + * elf32-m68hc12.c (elf32_m68hc12_special_sections): Likewise. + * elf32-mcore.c (mcore_elf_special_sections): Likewise. + * elf32-sh64.c (sh64_elf_special_sections): Likewise. + * elf32-v850.c (v850_elf_special_sections): Likewise. + * elf32-xtensa.c (elf_xtensa_special_sections): Likewise. + * elf64-alpha.c (elf64_alpha_special_sections): Likewise. + * elf64-hppa.c (elf64_hppa_special_sections): Likewise. + * elf64-ppc.c (ppc64_elf_special_sections): Likewise. + * elf64-sh64.c (sh64_elf64_special_sections): Likewise. + * elfxx-ia64.c (elfNN_ia64_special_sections): Likewise. + * elfxx-mips.c (_bfd_mips_elf_special_sections): Likewise. + * elf32-ppc.c (ppc_elf_special_sections): Likewise. Fix .plt flags. + +2003-09-21 Daniel Jacobowitz + + * elf64-alpha.c (elf64_alpha_create_got_section): Initialize + ->got if the section already exists. + +2003-09-19 Nathan Sidwell + + * dwarf2.c (decode_line_info): Cope with an initially empty + filename table. + +2003-09-18 H.J. Lu + + * acinclude.m4: Include ../config/accross.m4. + * aclocal.m4: Regenerated. + + * configure.host (HOST_64BIT_TYPE): Remove if it is set to long + or long long. + (HOST_U_64BIT_TYPE): Remove if it is set to unsigned long long. + (host64): Remove if HOST_64BIT_TYPE is set to long. + + * configure.in (HOST_64BIT_TYPE): Set according to the size of + long and long long. + (HOST_U_64BIT_TYPE): Likewise. + (host64): Likewise. + * configure: Regenerated. + +2003-09-19 Alan Modra + + * elf.c (elfcore_write_note): Don't use sizeof(Elf_External_note) + since some ABIs round up the size of the struct. + +2003-09-18 H.J. Lu + + * elflink.c (_bfd_elf_merge_symbol): Allow type change if + the old symbol is undefined and the new symbol is defined. + +2003-09-18 Andreas Schwab + + * simple.c (bfd_simple_get_relocated_section_contents): Use + _bfd_generic_link_hash_table_create instead of + bfd_link_hash_table_create. + +2003-09-10 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_special_sections): Mark all sections + started with ".sbss" or "".sdata" as SHF_IA_64_SHORT. + +2003-09-10 John David Anglin + Randolph Chung + + * elf32-hppa.c (struct elf32_hppa_link_hash_entry, + hppa_link_hash_newfunc, hppa_build_one_stub, + elf32_hppa_adjust_dynamic_symbol, mark_PIC_calls, allocate_plt_static, + allocate_dynrelocs, elf32_hppa_size_dynamic_sections, + elf32_hppa_finish_dynamic_symbol): Remove pic_call field and all code + for generating import stubs for calls to statically linked PIC + functions. + (hppa_type_of_stub): Don't generate an import stub for calls to + statically linked pic functions. Generate import stubs for calls + in a shared object, to functions not in a regular file, and to + defined weak functions. Add new argument INFO. + (hppa_build_one_stub): Don't undef ADDIL_DP. + (elf32_hppa_check_relocs): Don't set SEC_HAS_GOT_REF flag. + (elf32_hppa_size_stubs): Pass info to hppa_type_of_stub. + (final_link_relocate): Change all DLTIND relocs to DPREL relocs in a + non-shared link. Convert instructions that use the the linkage table + pointer, or a facsimile thereof, to use the global data pointer when + the reloc has been changed. + +2003-09-08 Joel Brobecker + + * archures.c: Add new machine names for hppa. + * bfd-in2.h: Regenerate. + * cpu-hppa.c: Use the new machine names. + +2003-09-06 Stephane Carrez + + * elf32-m68hc1x.h (struct m68hc11_elf_link_hash_table): Remove + all_local_syms member. + * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Use bfd_elf_get_elf_syms + to get the local symbols. + +2003-09-06 Stephane Carrez + + * elf32-m68hc12.c (elf32_m68hc12_special_sections): New for hc11. + (elf_backend_special_sections): Define.a + + PR savannah/4950: + * elf32-m68hc11.c (elf32_m68hc11_special_sections): The .vectors + section is read-only. + +2003-09-04 Nick Clifton + + * archures.c (bfd_mach_v850e1): Define. + * bfd-in2.h: Regenerate. + * cpu-v850.h (scan): Accept bfd_mach_v850e1. + (arch_info_struct): Include an entry for bfd_mach_v850e1. + * elf32-v850.c (v850_elf_object_p): Accept E_V850E1_ARCH flag. + (v850_elf_final_write_processing): Accept bfd_mach_v850e1. + (v850_elf_print_private_bfd_data): Interpret E_V850E1_ARCH flag. + (v850_elf_merge_private_bfd_data): Allow v850e1 binaries to be + linked with v850e binaries. Mark the output as v850e. + +2003-09-03 Nick Clifton + + * cofflink.c (_bfd_coff_link_input_bfd): Do not skip section + symbols that are used in relocs. + +2003-08-30 Robert Millan + + * configure.in: Match GNU/KFreeBSD with new kfreebsd*-gnu triplet. + * config.bfd: Likewise. + * configure: Regenerate. + +2003-08-31 Christian Groessler + + * elf32-i860.c (i860_howto_pc26_reloc): Finish relocation here + instead of returning bfd_reloc_continue. + +2003-08-31 Andreas Jaeger + + * merge.c: Update to ISO C90. + +2003-08-27 Ian Lance Taylor + + * configure.in: Check for strtoull. + * bfd.c (bfd_scan_vma): Use strtoull when available. + * configure, config.in: Regenerate. + + * configure.in: Define and substitute BFD_HOST_LONG_LONG. + * bfd-in.h: Define BFD_HOST_LONG_LONG. Test it rather than + __GNUC__ when deciding whether to use long long for + BFD_HOST_64_BIT. + * configure, Makefile.in, doc/Makefile.in, bfd-in2.h: Regenerate. + +2003-08-27 Christian Groessler + + * elf32-i860.c (i860_howto_pc26_reloc, i860_howto_pc16_reloc, + i860_howto_splitn_reloc, i860_howto_highadj_reloc): New + functions. + (elf32_i860_howto_table): Insert the new functions as + 'special_function's in the proper reloc type entries. + +2003-08-27 Richard Sandiford + + * elf32-frv.c (elf32_frv_relocate_section): Use + _bfd_elf_rela_local_sym. + +2003-08-26 Michael Snyder + + * cpu-frv.c: Remove unused enum. + +2003-08-25 Maciej W. Rozycki + + * reloc.c: Fix documentation for MIPS ELF relocations. + libbfd.h: Regenerate. + bfd-in2.h: Regenerate. + +2003-08-24 Jason Eckhardt + + * coff-i860.c (CALC_ADDEND): Define to be a no-op. + +2003-08-24 Jason Eckhardt + + * elf32-i860.c (elf32_i860_relocate_pc16): Subtract 4 and + shift by 2 before storing the relocated value. + +2003-08-23 Jason Eckhardt + + * coff-i860.c (coff_i860_reloc_nyi): New function. + (howto_table): Add entries for relocations PAIR, HIGHADJ, HIGH, + LOWn, SPLITn, and BRADDR. + (RTYPE2HOWTO): Check that the r_type is within the howto_table + before trying to access the entry. + (coff_i860_rtype_to_howto): Likewise. + (coff_i860_reloc_type_lookup): New function. + (i860_reloc_processing): New function. + (coff_bfd_reloc_type_lookup): Define macro. + (RELOC_PROCESSING): Define macro. + Minor formatting adjustments. + +2003-08-23 Alan Modra + + * elflink.h (elf_link_add_object_symbols): Don't crash on NULL owner. + +2003-08-22 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_create_dynamic_sections): Align the + .got section at 8 bytes. + +2003-08-21 Nick Clifton + + * cofflink.c: Update to ISO C90 and tidy up formatting. + +2003-08-21 Randolph Chung + + * elf32-hppa.c (elf32_hppa_object_p): For elf32-hppa-linux, objects + can have OSABI=Linux or OSABI=SysV. Check for both. + * elf64-hppa.c (elf64_hppa_object_p): Likewise. + +2003-08-21 Nick Clifton + + * po/sv.po: Updated Swedish translation. + +2003-08-20 Richard Sandiford + + * elf64-mips.c (elf_backend_copy_indirect_symbol): Define. + +2003-08-20 Nick Clifton + + * elf-bfd.h (RELOC_FOR_GLOBAL_SYMBOL): New macro used to + replace some duplicated code in most elfxx-xxxx.c files. This + version uses the new fields in bfd_link_info. + + * elf-m10300.c (mn10300_elf_relocate_section): Use new macro. + * elf32-arm.h (elf32_arm_relocate_section): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. + * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + + * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols, + elf_hppa_remark_useless_dynamic_symbols, + elf_hppa_relocate_section): Use the new fields in + bfd_link_info structure. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_check_relocs): Likewise. + * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_check_relocs): Likewise. + * elfxx-mips.c (mips_elf_calculate_relocation): Likewise. + + * elflink.h (elf_link_output_extsym): Fix test for reporting + undefined symbols in shared libraries. Remove redundant test + of shlib_undefined when reporting references to forced local + symbols. + +2003-08-18 Andreas Schwab + + * libpei.h (bfd_pe_executable_p): Also recognize efi-app + executables. + +2003-08-17 Hans-Peter Nilsson + + * simple.c (bfd_simple_get_relocated_section_contents): Move + reloc_done hack to before first bfd_section_size call. Change all + returns to use new wrapper macro RETURN, restoring sec->reloc_done. + +2003-08-16 Alan Modra + + * elf64-ppc.c: Don't include elf/ppc.h. + +2003-08-14 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Fix PT_DYNAMIC + code to work with 64-bit bfds. + +2003-08-14 Alan Modra + + * dep-in.sed: Remove libintl.h. + * Makefile.am (SRC-POTFILES.in, BLD-POTFILES.in): Unset LC_COLLATE. + (POTFILES.in): Remove target. + * Makefile.in: Regenerate. + +2003-08-12 Alan Modra + + * elf64-ppc.c (ppc64_elf_next_input_section): Update comment. + (ppc64_elf_relocate_section): For zero sym R_PPC64_TOC relocs, + use the function sym from the previous reloc. + +2003-08-11 Jakub Jelinek + + * elf32-i386.c (elf_i386_relocate_section): Make undefined symbols + fatal if -pie. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + (ppc_elf_relocate_section) : Issue fatal error + on undefined symbols if -pie. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + +2003-08-11 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Add special case for crt1.o + branch to __libc_start_main. + +2003-08-08 Dmitry Diky + + * archures.c: Add xW42 and xE42 parts. Sort MPU list according to + gcc order. + * cpu-msp430.c: Likewise. + * elf32-msp430.c: Likewise. + * bfd-in2.h: Regenerate. + +2003-08-07 Alan Modra + + * elfxx-target.h: Remove PTR cast. + * targets.c (bfd_target): Make backend_data const void *. + * elf-bfd.h: Constify all occurrences of struct elf_backend_data. + * elf-m10300.c: Likewise. + * elf.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-mips.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfcode.h: Likewise. + * elfcore.h: Likewise. + * elflink.c: Likewise. + * elflink.h: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * elfxx-mips.h: Likewise. + * elf.c (prep_headers): Remove useless check for null backend_data. + * bfd-in2.h: Regenerate. + + * elf-bfd.h: Remove PARAMS macro. Replace PTR with void *. + (NAME): Use ## rather than CONCAT4 macro. + * elfcode.h: Remove one remaining PARAMS macro. + * elf-eh-frame.c: Convert to C90, remove unneeded casts and prototypes. + * elf-strtab.c: Likewise. + * elf-hppa.h: Likewise. + * elf32-hppa.h: Likewise. + * elf32-hppa.c: Likewise. + (elf32_hppa_add_symbol_hook): Delete. + (elf_backend_add_symbol_hook): Don't define. + * libhppa.h: Convert to C90. Replace INLINE with inline. + +2003-08-06 Alan Modra + + * elf64-ppc.c (ppc_stub_name): Tweak names for better readability. + (ppc64_elf_adjust_dynamic_symbol): Allow copy relocs against + function descriptors, but warn. + (ppc_build_one_stub): Remove a couple of vars. Move code creating + stub syms so that we can avoid a stub sym if we already have a + plt sym. Do not redefine an existing symbol. + (ppc64_elf_build_stubs): When --emit-stub-syms, print a symbol for + glink. + +2003-08-06 Nick Clifton + + * po/fr.po: Updated French translation. + +2003-08-06 Alan Modra + + * elflink.c (_bfd_elf_create_dynamic_sections): Mark .dynbss with + SEC_LINKER_CREATED. + +2003-08-05 Daniel Jacobowitz + + * elf32-arm.h (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Use it. + +2003-08-03 Jeff Muizelaar + + * coffcode.h (coff_slurp_line_table): Return with a warning + message if the line number table could not be read. + +2003-08-04 Nick Clifton + + * elflink.h (elf_link_add_object_symbols): Prepend "warning: " + to messages produced for .gnu.warning.SYMBOL sections. + +2003-08-04 Alan Modra + + * elfcode.h: Convert to C90, remove unneeded casts and prototypes. + * elfcore.h: Likewise. + * elflink.c: Likewise. + * elflink.h: Likewise. + * elf.c (sym_is_global): Remove INLINE. + (align_file_position): Replace INLINE with inline. + * elfcode.h (elf_swap_dyn_in, elf_swap_dyn_out): Remove INLINE. + (elf_file_p): Replace INLINE with inline. + +2003-08-02 Kaz Kojima + + * elf32-sh.c (sh_elf_check_relocs): Don't set DF_TEXTREL here. + +2003-08-01 H.J. Lu + + * elfxx-ia64.c (get_got): Align the .got section at 8 bytes. + +2003-08-01 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Use + ElfNN_External_Rela instead of Elf64_External_Rela. + +2003-08-01 Nick Clifton + + * config.bfd: Add code to catch obsolete configurations and warn + about them unless --enable-obsolete is used. Use this to mark + vax-vms port as obsolete. + +2003-07-30 Alan Modra + + * elf32-ppc.c (ppc_elf_install_value): Tidy. + (ppc_elf_relax_section): Remove dead code. Remove unnecessary casts. + Formatting. + * elfxx-target.h: Remove PARAMS macro. Formatting. + +2003-07-30 Alan Modra + + * elf.c (bfd_section_from_r_symndx): Test for SHN_UNDEF. + * elf64-ppc.c (get_fdh): New function, split out from + ppc64_elf_edit_opd. + (ppc64_elf_check_relocs): Use get_fdh. + (func_desc_adjust): Likewise. Tidy. + (ppc64_elf_edit_opd): Tighten reloc checks. Free local_syms on error + exit. Use get_fdh. Account for superfluous dynamic relocs. + (ppc64_elf_relocate_section): Warning fix. + +2003-07-30 Jason Eckhardt + + * coff-i860.c: Convert to ISO C90. Remove superflous prototypes. + +2003-07-30 Jason Eckhardt + + * elf32-i860.c: Convert to ISO C90. Remove superflous prototypes. + +2003-07-30 Randolph Chung + + * elf-hppa.h (elf_hppa_relocate_section): Look up dyn_h for undefweak. + * elf64-hppa.c (elf64_hppa_finalize_dlt): Check h->root.type. + +2003-07-30 Alan Modra + + * elf.c: Convert to C90, remove unnecessary prototypes and casts. + Replace PTR with void *. Formatting. + (_bfd_elf_assign_file_position_for_section): Remove INLINE. + (make_mapping): Likewise. + +2003-07-29 Alan Modra + + * elf64-ppc.c (func_desc_adjust): Give linker created function + descriptor symbols a size and type. + (ppc64_elf_relocate_section): Correct lq insn test. + +2003-07-28 Eric Christopher + + * elf32-ppc.c (R_PPC_RELAX32): New relocation. + (ppc_elf_install_value): New function. + (ppc_elf_sort_rela): Remove. + (ppc_elf_relax_section): Rewrite. Remove old relaxation + and replace with out of range branch stubs. + (ppc_elf_relocate_section): Handle R_PPC_RELAX32. + +2003-07-29 Alexandre Oliva + + * elf-m10300.c (mn10300_elf_relax_section): Take symbol hash table + from input_bfd. + +2003-07-28 Alan Modra + + * elf.c (special_sections): Set attributes for .got and .plt. + +2003-07-27 Alan Modra + + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Ensure no copy relocs + on function descriptors. + (ELIMINATE_COPY_RELOCS): Expand comment. + (ppc64_elf_special_sections): Move. Don't include non-ppc64 sections. + Do include ".toc1". + +2003-07-25 H.J. Lu + + * elf.c (_bfd_elf_new_section_hook): Set the default section + type to SHT_NULL. + (elf_fake_sections): Set the section type based on asect->flags + if it is SHT_NULL. Don't abort on processor specific section + types. + +2003-07-25 H.J. Lu + + * bfd-in2.h: Regenerated. + +2003-07-25 H.J. Lu + + * elf-bfd.h (bfd_elf_special_section): New. + (elf_backend_data): Add special_sections, a pointer to + bfd_elf_special_section. + (elf_section_type). New. + (elf_section_flags): New. + (_bfd_elf_get_sec_type_attr): New. + + * elf.c (_bfd_elf_make_section_from_shdr): Always use the + real section type/flags. + (special_sections): New. + (get_special_section): New. + (_bfd_elf_get_sec_type_attr): New. + (_bfd_elf_new_section_hook): Check special_section to set + elf_section_type and elf_section_flags. + (elf_fake_sections): Don't use section name to set ELF section + data. + + * elf32-m32r.c (m32r_elf_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf32-m68hc11.c (elf32_m68hc11_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf32-mcore.c (mcore_elf_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf32-ppc.c (ppc_elf_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf32-sh64.c (sh64_elf_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf32-v850.c (v850_elf_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf32-xtensa.c (elf_xtensa_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf64-alpha.c (elf64_alpha_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf64-hppa.c (elf64_hppa_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf64-ppc.c (ppc64_elf_special_sections): New. + (elf_backend_special_sections): Defined. + + * elf64-sh64.c (sh64_elf64_special_sections): New. + (elf_backend_special_sections): Defined. + + * elfxx-ia64.c (elfNN_ia64_special_sections): New. + (elf_backend_special_sections): Defined. + + * elfxx-mips.c (_bfd_mips_elf_special_sections): New. + + * elfxx-mips.h (_bfd_mips_elf_special_sections): New. + (elf_backend_special_sections): Defined. + + * elfxx-target.h (elf_backend_special_sections): New. Default + to NULL. + (elfNN_bed): Initialize special_sections. + + * section.c (bfd_abs_section): Remove const. + (bfd_und_section): Likewise. + (bfd_com_section): Likewise. + (bfd_ind_section): Likewise. + +2003-07-24 Nick Clifton + + * coff-arm.c (EXTRA_S_FLAGS): Include SEC_CODE so that code + sections are assigned the LOAD attribute. + +2003-07-25 Kaz Kojima + + * elf32-sh.c: Convert to C90. Replace PTR with void *. + * elf32-sh64-com.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-sh64.h: Likewise. + * elf64-sh64.c: Likewise. + +2003-07-24 Kaz Kojima + + * elf32-sh.c (sh_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL. + (allocate_dynrelocs): Likewise. + (sh_elf_relocate_section): Likewise. Use SYMBOL_REFERENCES_LOCAL. + (sh_elf_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL. + +2003-07-24 Nick Clifton + + * po/fr.po: Updated French translation. + +2003-07-23 Bob Wilson + + * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Make inline and move + near the beginning of the file. Swap order of arguments. Call + _bfd_elf_dynamic_symbol_p with "ignore_protected" set to 0. + (elf_xtensa_fix_refcounts): Adjust xtensa_elf_dynamic_symbol_p call. + (elf_xtensa_relocate_section): Likewise. + (shrink_dynamic_reloc_sections): Likewise. + +2003-07-23 Bob Wilson + + * elf32-xtensa.c (plt_reloc_count): Fix typo in comment. + (elf_xtensa_size_dynamic_sections): Use elf_discarded_section. + (elf_xtensa_combine_prop_entries): Avoid returning non-zero without + first printing an error message. + (elf_xtensa_finish_dynamic_sections): Likewise. + (elf_xtensa_discard_info_for_section): Adjust size of .got.loc when + discarding literal table entries. + (elf_xtensa_merge_private_bfd_data): Remove newline from error message. + (elf_xtensa_do_asm_simplify): Likewise. + +2003-07-23 Stephane Carrez + + * elf32-m68hc1x.c (elf32_m68hc11_size_stubs): Avoid crash when + we have a local symbol in common section. + +2003-07-22 H.J. Lu + + * elflink.c (_bfd_elf_dynamic_symbol_p): Don't return TRUE for + weak symbols. + +2003-07-22 Nick Clifton + + * coffcode.h (coff_slurp_symbol_table): Add C_TCSYM and C_ECOML to + expected RS6000 storage classes. + +2003-07-21 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections): Mark + output_bfd unused to silence gcc. + +2003-07-21 Nick Clifton + + * po/sv.po: Updated Swedish translation. + +2003-07-21 Alan Modra + + * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Use.. + (_bfd_elf_symbol_refs_local_p): ..this. Declare. + * elflink.c (_bfd_elf_symbol_refs_local_p): New function. + * elf32-i386.c (elf_i386_relocate_section): Remove h NULL test + now done in _bfd_elf_symbol_refs_local_p. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + +2003-07-18 H.J. Lu + + * elflink.c (_bfd_elf_dynamic_symbol_p): Undo the last change. + +2003-07-18 H.J. Lu + + * elf-bfd.h (SYMBOL_REFERENCES_LOCAL): Fix a typo. + (SYMBOL_CALLS_LOCAL): Likewise. + + * elflink.c (_bfd_elf_dynamic_symbol_p): Return TRUE + immediately if symbol isn't defined locally. + +2003-07-18 Richard Henderson + + * elflink.c (_bfd_elf_dynamic_symbol_p): New. + * elf-bfd.h (_bfd_elf_dynamic_symbol_p): Declare it. + (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Use it. + * elf32-xtensa.c (xtensa_elf_dynamic_symbol_p): Likewise. + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Likewise. + * elf64-hppa.c (elf64_hppa_dynamic_symbol_p): Likewise. + * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Likewise. + Update all callers to provide the relocation being resolved. + +2003-07-17 Shaun Jackman + + * config.bfd (arm-wince-pe): Add -DARM_COFF_BUGFIX to + targ_cflags. + +2003-07-17 Nick Clifton + + * po/es.po: New Spanish translation. + * po/sv.po: New Swedish translation. + * po/opcodes.pot: Regenerate. + +2003-07-16 Richard Henderson + + * config.bfd, configure.host, configure.in: Remove ia64-aix support. + * elfxx-ia64.c, targets.c: Likewise. + +2003-07-16 Richard Henderson + + * elfxx-ia64.c (elfNN_ia64_dynamic_symbol_p): Properly return false + for symbols defined locally plus -Bsymbolic. Tidy logic. + +2003-07-15 Richard Sandiford + + * archures.c (bfd_mach_mips7000): New. + * bfd-in2.h: Regenerated. + * cpu-mips.c (arch_info_struct): Add an entry for mips:7000. + * elfxx-mips.c (mips_set_isa_flags): Handle bfd_mach_mips7000. + (mips_mach_extensions): Add an entry for it. + +2003-07-14 Nick Clifton + + * po/tr.po: Update with latest version. + * po/SRC-POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + * Makfile.in: Regenerate. + * configure: Regenerate. + +2003-07-12 Jeff Baker + + * bfd/config.bfd (__QNXTARGET__): Define for Neutrino architectures. + * bfd/elf32-arm.h (ELF_MAXPAGESIZE): Set to 4k for Neutrino. + * bfd/elf32-sh.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino. + * bfd/elf32-ppc.c (ELF_MAXPAGESIZE): Set to 4k for Neutrino. + +2003-07-12 Jeff Muizelaar + + * coffcode.h (coff_set_section_contents): Set the + IMAGE_FILE_32BIT_MACHINE flag for PE targets. + +2003-07-11 Richard Sandiford + + * bfd-in.h (bfd_h8300_pad_address): Declare. + * bfd-in2.h: Regenerate. + * cpu-h8300.c (bfd_h8300_pad_address): New function. + * coff-h8300.c (h8300_reloc16_estimate): Use it to canonicalize + addresses before checking whether they can be relaxed. + (h8300_reloc16_extra_cases): Likewise for the R_MOVL2 sanity check. + Don't complain about overflows in general 8-bit relocations. + * elf32-h8300.c (elf32_h8_relax_section): Use bfd_h8300_pad_address. + Fix handling of R_H8_DIR24A8. + +2003-07-11 Richard Sandiford + + * elf32-h8300.c: Convert function prototypes and definitions + to C90 syntax. + * coff-h8300.c: Likewise. + * cpu-h8300.c: Likewise. + +2003-07-11 Alan Modra + + * po/SRC-POTFILES.in: Regenerate. + * po/bfd.pot: Likewise. + +2003-07-10 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_create_dynamic_sections): Create new + .got.loc section. Do not set SEC_ALLOC or SEC_LOAD flags for the + .xt.lit.plt section. + (elf_xtensa_size_dynamic_sections): Set size of the .got.loc section + and allocate memory for it. + (elf_xtensa_combine_prop_entries): Copy contents of .xt.lit output + section to the .got.loc section. + (elf_xtensa_finish_dynamic_sections): Fix up call to + elf_xtensa_combine_prop_entries and set DT_XTENSA_GOT_LOC_OFF to + the address of .got.loc. + (relax_property_section): Shrink .got.loc to match changes in any + literal table section. + (xtensa_is_property_section): Change to match + xtensa_get_property_section_name. + (xtensa_is_littable_section): New. + +2003-07-10 H.J. Lu + + * elfxx-ia64.c (IA64_HOWTO): Set dst_mask to -1 instead of + -1LL. + +2003-07-10 Alan Modra + + * Makefile.am (BFD32_BACKENDS): Add elf32-am33lin.lo. + (BFD32_BACKENDS_CFILES): elf32-am33lin.c not elf32-am33lin.lo. + Run "make dep-am". + * Makefile.in: Regenerate. + +2003-07-10 Alexandre Oliva + + 2001-09-12 Alexandre Oliva + * elf32-am33lin.c (ELF_MACHINE_CODE): Redefine to EM_MN10300. + (ELF_MACHINE_ALT1): Define to EM_CYGNUS_MN10300. + 2001-06-02 Nick Clifton + * elf32-am33lin.c: Rename global functions. + 2001-05-09 Alexandre Oliva + * config.bfd (am33_2.0, am33_2.0-*-linux*): Added. + * configure.in (bfd_elf32_am33lin_vec): Added. + * Makefile.am (BFD32_BACKENDS): Added elf32-am33lin.lo. + (elf32-am33lin.lo): List dependencies. + * aclocal.m4, configure, Makefile.in: Rebuilt. + * elf-m10300.c (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, + ELF_ARCH, ELF_MACHINE_CODE, ELF_MAXPAGESIZE): Define only if + ELF_ARCH was not defined before. + (elf_symbol_leading_char): Define if not defined. + * elf32-am33lin.c: Override the definitions above. + * targets.c (bfd_elf32_am33lin_vec): New. + +2003-07-09 Alexandre Oliva + + 2002-12-12 Alexandre Oliva + * elf-m10300.c (elf32_mn10300_link_hash_newfunc): Initialize + pcrel_relocs_copied. + 2001-12-13 Alexandre Oliva + * elf-m10300.c (ELF_DYNAMIC_INTERPRETER): Renamed from + ld-linux.so.2 to ld.so.1. + 2001-10-10 Alexandre Oliva + * elf-m10300.c (elf_mn10300_sizeof_plt0): New macro. + (_bfd_mn10300_elf_adjust_dynamic_symbol): Use it. + (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. + * elf-m10300.c (_bfd_mn10300_elf_size_dynamic_sections): Allocate + .rela.* section contents with bfd_zalloc. + 2001-09-25 Alexandre Oliva + * elf-m10300.c: Added declarations for functions missing them. + Merge some shared-library changes from the i386 back-end. Use + R_MN10300_RELATIVE instead of R_MN10300_PCREL32 and + R_MN10300_GLOB_DAT instead of R_MN10300_32 where appropriate. + (struct elf32_mn10300_link_hash_entry): Remove duplicates of + members of elf_link_hash_entry. Adjusted references. + (mn10300_elf_final_link_relocate): dynobj was already loaded + into a local variable, use it. + 2001-09-21 Nick Clifton + * elf-m10300.c: Add missing function prototypes. + 2001-08-24 Alexandre Oliva + * elf-m10300.c (mn10300_elf_relocate_section): Don't compute + relocation for dynamic relocations. + 2001-05-16 Alexandre Oliva + * reloc.c (BFD_RELOC_MN10300_GOTOFF24): New. + * elf-m10300.c: Introduce GOTPC16, GOTOFF24, GOTOFF16 and + PLT16, and rename GOTPC to GOTPC32 and GOTOFF to GOTOFF32. + (_bfd_mn10300_elf_create_dynamic_sections): Move creation ot PLT... + (_bfd_mn10300_elf_create_got_section): ... here, so that its + adress is already known at the time we compute relaxations. + (mn10300_elf_relax_section): Relax GOTPC32, GOTOFF32, GOT32 + and PLT32 to narrower relocations. + * libbfd.h, bfd-in2.h: Rebuilt. + 2001-04-12 Alexandre Oliva + * reloc.c (BFD_RELOC_MN10300_GOT32, BFD_RELOC_MN10300_GOT24, + BFD_RELOC_MN10300_GOT16, BFD_RELOC_MN10300_COPY, + BFD_RELOC_MN10300_GLOB_DAT, BFD_RELOC_MN10300_JMP_SLOT, + BFD_RELOC_MN10300_RELATIVE): New relocs. + * libbfd.h, bfd-in2.h: Rebuilt. + * elf-m10300.c (struct elf_mn10300_pcrel_relocs_copied): New. + (struct elf32_mn10300_link_hash_entry): Added DSO-related + fields. + (elf_mn10300_howto): Defined new relocation types. + (mn10300_reloc_map): Map them. + (_bfd_mn10300_elf_create_got_section): New fn. + (mn10300_elf_check_relocs): Handle PIC relocs. + (mn10300_elf_final_link_relocate): Likewise. + (mn10300_elf_relocate_section): Handle DSOs. + (PLT0_ENTRY_SIZE, PLT_ENTRY_SIZE, PIC_PLT_ENTRY_SIZE): New macros. + (elf_mn10300_plt0_entry, elf_mn10300_plt_entry, + elf_mn10300_pic_plt_entry): New. + (elf_mn10300_sizeof_plt, elf_mn10300_plt_plt0_offset, + elf_mn10300_plt0_linker_offset, elf_mn10300_plt0_gotid_offset, + elf_mn10300_plt_temp_offset, elf_mn10300_plt_symbol_offset, + elf_mn10300_plt_reloc_offset: New macros. + (ELF_DYNAMIC_INTERPRETER): Likewise. + (_bfd_mn10300_elf_create_dynamic_sections): New function. + (_bfd_mn10300_elf_adjust_dynamic_symbol): Likewise. + (_bfd_mn10300_elf_discard_copies): Likewise. + (_bfd_mn10300_elf_size_dynamic_sections): Likewise. + (_bfd_mn10300_elf_finish_dynamic_symbol): Likewise. + (_bfd_mn10300_elf_finish_dynamic_sections): Likewise. + (elf_backend_can_gc_sections, + elf_backend_create_dynamic_sections, + elf_backend_adjust_dynamic_sections, + 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): New + macros. + +2003-07-09 Alexandre Oliva + + 2001-05-06 Alexandre Oliva + * elf-m10300.c (compute_function_info): Account for AM33 + registers in `movm' when computing stack space for `call' when + linking for AM33/2.0 link. + 2000-04-01 Alexandre Oliva + * archures.c (bfd_mach_am33_2): Renamed from bfd_mach_am332. + * bfd-in2.h: Rebuilt. + * cpu-m10300.c (bfd_am33_2_arch): Renamed from bfd_am332_arch. + * elf-m10300.c: Updated. + 2000-03-31 Alexandre Oliva + * archures.c (bfd_mach_am332): Defined. + * bfd-in2.h: Rebuilt. + * cpu-m10300.c (bfd_am332_arch): Defined. + (bfd_am33_arch): Chained with am33-2. + * elf-m10300.c (elf_mn10300_mach): Handle am332. + (_bfd_mn10300_elf_final_write_processing): Likewise. + +2003-07-09 H.J. Lu + + * elfxx-ia64.c (IA64_HOWTO): Set dst_mask to -1LL. + +2003-07-10 Alan Modra + + * elf64-ppc.c (bfd_elf64_mkobject): Define. + (struct ppc64_elf_obj_tdata): New. + (ppc64_elf_tdata, ppc64_tlsld_got): Define. + (ppc64_elf_mkobject): New function. + (struct got_entry): Add "owner". Move "tls_type". + (struct ppc_link_hash_table): Delete "relgot", "tlsld_got". + (ppc64_elf_init_stub_bfd): New function. + (create_got_section): Create header .got in dynobj. Create .got + and .rela.got in each bfd. Stash pointers in ppc64_elf_obj_tdata. + (ppc64_elf_create_dynamic_sections): Don't call create_got_section. + Look for dynobj .got, and test it. + (ppc64_elf_copy_indirect_symbol): Adjust for changed got. + (update_local_sym_info): Likewise. + (ppc64_elf_check_relocs): Likewise. + (ppc64_elf_gc_sweep_hook): Likewise. + (ppc64_elf_tls_optimize): Likewise. + (allocate_dynrelocs): Likewise. + (ppc64_elf_size_dynamic_sections): Likewise. + (ppc64_elf_relocate_section): Likewise. + (ppc64_elf_next_toc_section): Update comment. + (toc_adjusting_stub_needed): Remove unneeded cast. + (ppc64_elf_build_stubs): Check for stub sections in stub bfd by + testing section flags. + (ppc64_elf_build_stubs): Likewise. + (ppc64_elf_size_stubs): Likewise. Remove stub_bfd param. + (ppc64_elf_finish_dynamic_sections): Write out got sections. + (func_desc_adjust): Copy over dynamic info for undef weaks. + * elf64-ppc.h (ppc64_elf_init_stub_bfd): Declare. + (ppc64_elf_size_stubs): Update prototype. + * elflink.h (elf_link_sort_relocs): Use link_orders to find reldyn + input sections rather than scanning dynobj. + +2003-07-09 Richard Sandiford + + * elfxx-mips.c (mips_elf_link_hash_entry): Remove min_dyn_reloc_index. + (bfd_mips_elf_swap_msym_in, bfd_mips_elf_swap_msym_out): Delete. + (mips_elf_create_msym_section): Delete. + (mips_elf_create_dynamic_relocation): Don't set min_dyn_reloc_index. + (_bfd_mips_elf_copy_indirect_symbol): Likewise. + (_bfd_mips_elf_create_dynamic_sections): Don't create .msym. + (_bfd_mips_elf_size_dynamic_sections): Don't calculate its size. + (_bfd_mips_elf_size_dynamic_sections): Don't add DT_MIPS_MSYM. + (_bfd_mips_elf_finish_dynamic_symbol): Don't add symbols to .msym. + (_bfd_mips_elf_finish_dynamic_sections): Likewise. + +2003-07-09 Richard Sandiford + + * elfxx-mips.c (mips_elf_irix6_finish_dynamic_symbol): Make the + symbols protected. + +2003-07-09 Richard Sandiford + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Fix handling + of relocations whose offset is -2. + +2003-07-09 Richard Sandiford + + * bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): Treat + forced-local symbols like other locals. Don't create relocations + against STN_UNDEF in irix objects. + +2003-07-09 Richard Sandiford + + * bfd/elfxx-mips.c (mips_elf_create_dynamic_relocation): In SGI- + compatible objects, add the values of defined external symbols + to the addend. + +2003-07-09 Richard Sandiford + + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Always + initialize a GOT entry to the symbol's st_value. + +2003-07-08 Alan Modra + + * elf-bfd.h (struct elf_obj_tdata): Move linker_section_pointers.. + * elf32-ppc.c (struct ppc_elf_obj_tdata): ..to here. New. + (ppc_elf_tdata): Define. + (elf_local_ptr_offsets): Adjust. + (ppc_elf_mkobject): New function. + (bfd_elf32_mkobject): Define. + + * elfcode.h (elf_object_p): Allocate tdata via _bfd_set_format. + * elfcore.h (elf_core_file_p): Likewise. + * section.c (bfd_section_init): Remove prototype. + +2003-07-08 Alan Modra + + * elf-bfd.h (struct elf_link_hash_entry): Remove linker_section_pointer + field. + (enum elf_linker_section_enum): Delete. + (struct elf_linker_section): Delete. + (struct elf_linker_section_pointers): Delete. + (struct elf_obj_tdata): Remove #if 0 chunk. Remove linker_section. + Make linker_section_pointers a void**. + (elf_local_ptr_offsets, elf_linker_section): Don't define. + * elf32-ppc.c (enum elf_linker_section_enum): New, cut-down version + of old item in elf-bfd.h. + (struct elf_linker_section): Likewise. + (struct elf_linker_section_pointers): Likewise. + (elf_local_ptr_offsets): Define. + (struct ppc_elf_link_hash_entry): Add linker_section_pointer. + (ppc_elf_link_hash_newfunc): Init it. + (struct ppc_elf_link_hash_table): Add sbss. + (ppc_elf_link_hash_table_create): zmalloc rather than clearing + individual fields. + (elf_create_linker_section): Fold into.. + (ppc_elf_create_linker_section): ..here. Remove hole_size code. + Make rela section here if shared. + (elf_find_pointer_linker_section): Pass lsect rather than enum. + (elf_create_pointer_linker_section): Adjust. zalloc rather than + clearing in a loop. + (elf_finish_pointer_linker_section): Adjust. Don't make rela + section here. + (ppc_elf_check_relocs): Adjust. + (ppc_elf_add_symbol_hook): Tighten hash creator test. Remove code + creating .sbss by hand. + * elf.c (_bfd_elf_link_hash_newfunc): Adjust. + +2003-07-04 Jakub Jelinek + + * elf32-s390.c (elf_howto_table): Change R_390_GOT12 to + complain_overflow_bitfield. + * elf64-s390.c (elf_howto_table): Change R_390_GOT12 to + complain_overflow_bitfield. + +2003-07-04 Jakub Jelinek + + * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Return + true even if -pie. + +2003-07-04 Jakub Jelinek + + * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add rel_fptr_sec. + (elfNN_ia64_dynamic_symbol_p): Change info->shared into + !info->executable. + (get_fptr): For -pie create .opd as writable section and create + .rela.opd as well. + (elfNN_ia64_check_relocs): Change info->shared into + !info->executable. + (allocate_fptr): Likewise. + (allocate_dynrel_entries): Account for a relative reloc for -pie + @fptr(). Don't account for a relative reloc if -pie want_ltoff_fptr + for undefweak symbol. Account for an IPLT reloc in .rela.opd + section if -pie. + (set_got_entry): Don't create a relative reloc if -pie + want_ltoff_fptr for undefweak symbol. + (set_fptr_entry): Emit an IPLT reloc in .rela.opd for -pie. + (elfNN_ia64_relocate_section): Emit a relative reloc for -pie + @fptr(). + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Issue undefined_symbol + even if -pie. + * elf32-i386.c (elf_i386_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + +2003-07-04 Paul Clarke + + * elf32-h8300.c (R_H8_DIR32A16): Fix name field. + (elf32_h8_relax_section) : Adjust position of relocation. + : Fix type of relocation. + +2003-07-04 Kaz Kojima + + * elf32-sh.c (sh_elf_create_dynamic_sections): Return if dynamic + sections were created already. Remove unnecessary tests of + the previous change. + +2003-07-04 Kaz Kojima + + * elf32-sh.c (sh_elf_create_dynamic_sections): Don't call + bfd_make_section for existing sections. + +2003-07-04 Alan Modra + + * elf32-sparc.c (elf32_sparc_check_relocs): Don't call + create_got_section if we already have done so. + * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise. + (sh_elf_check_relocs): Likewise. + (sh_elf_adjust_dynamic_symbol): Delete "dynobj" var. Use + htab->root.dynobj instead. + (sh_elf_check_relocs): Likewise. + (sh_elf_finish_dynamic_sections): Likewise. + + * section.c (bfd_make_section): Return NULL for existing section. + +2003-07-04 Alan Modra + + * elf32-ppc.c (ppc_elf_create_dynamic_sections): Don't call + ppc_elf_create_got if we've already done so. + + * elf-bfd.h (_bfd_elf_create_linker_section) Don't declare. + (_bfd_elf_find_pointer_linker_section): Likewise. + (bfd_elf32_create_pointer_linker_section): Likewise. + (bfd_elf32_finish_pointer_linker_section): Likewise. + (bfd_elf64_create_pointer_linker_section): Likewise. + (bfd_elf64_finish_pointer_linker_section): Likewise. + (_bfd_elf_make_linker_section_rela): Likewise. + * elfcode.h (elf_create_pointer_linker_section): Don't define. + (elf_finish_pointer_linker_section): Likewise. + * elflink.c (_bfd_elf_make_linker_section_rela): Delete. + (_bfd_elf_create_linker_section): Move this function.. + (_bfd_elf_find_pointer_linker_section): ..and this.. + * elflink.h (elf_create_pointer_linker_section): ..and this.. + (elf_finish_pointer_linker_section): ..and this.. + * elf32-ppc.c: ..to here, renaming to the following, and adjusting + calls. + (elf_create_linker_section): Convert to C90, tidy. + (elf_find_pointer_linker_section): Likewise. + (elf_create_pointer_linker_section): Likewise. + (elf_finish_pointer_linker_section): Likewise. + * elf32-i370.c: Delete #if 0 code. + +2003-07-02 Alan Modra + + * elf64-ppc.c (ppc64_elf_func_desc_adjust): Don't allow _savef* and + _restf* to be satisfied by shared libs, and always force them local. + (toc_adjusting_stub_needed): Avoid scanning linker created sections. + Correct test for "bl". + (ppc64_elf_relocate_section ): Correct test for + primary opcode 31. + +2003-07-01 Martin Schwidefsky + + * elf32-s390.c (s390_elf_ldisp_reloc): New prototype. + (s390_tls_reloc): New function. + (elf_howto_table): Add long displacement relocations R_390_20, + R_390_GOT20, R_390_GOTPLT20 and R_390_TLS_GOTIE20. + (elf_s390_reloc_type_lookup): Likewise. + (elf_s390_check_relocs): Likewise. + (elf_s390_gc_sweep_hook): Likewise. + (elf_s390_relocate_section): Likewise. + * elf64-s390.c: Same changes as for elf32-s390.c. + * reloc.c: Add long displacement relocations BFD_RELOC_390_20, + BFD_RELOC_390_GOT20, BFD_RELOC_390_GOTPLT20 and + BFD_RELOC_390_TLS_GOTIE20. + * bfd-in2.h: Regenerate. + * libbfd.h: Likewise. + +2003-06-30 Alan Modra + + * cpu-ia64-opc.c (ext_imms_scaled): Don't sign extend using shifts. + (ins_imms, ins_immsm1u4): Likewise. Warning fix. + +2003-06-29 Alan Modra + + * archive.c: Convert to C90, remove unnecessary prototypes and casts. + Replace PTR with void *. Formatting. + * archive64.c: Likewise. + * archures.c: Likewise. + * bfd-in.h: Likewise. + * bfd.c: Likewise. + * bfdio.c: Likewise. + * bfdwin.c: Likewise. + * cache.c: Likewise. + * corefile.c: Likewise. + * format.c: Likewise. + * init.c: Likewise. + * libbfd-in.h: Likewise. + * libbfd.c: Likewise. + * linker.c: Likewise. + * opncls.c: Likewise. + * reloc.c: Likewise. + * section.c: Likewise. + * simple.c: Likewise. + * syms.c: Likewise. + * targets.c: Likewise. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + + * ecoff.c (bfd_debug_section): Add missing kept_section initialization. + * libbfd-in.h (_bfd_sh_align_load_span): Don't declare if defined. + * libbfd.c (COERCE32, EIGHT_GAZILLION): Simplify. + (bfd_getb64): Rewrite without parens. + (bfd_getl64, bfd_getb_signed_64, bfd_getl_signed_64): Likewise. + * cache.c (insert, snip): Remove INLINE. + * linker.c (bfd_link_add_undef): Likewise. + +2003-06-29 Andreas Jaeger + + * elf64-x86-64.c: Convert to ISO C90 prototypes, remove + unnecessary prototypes. Replace PTR with void *. + (elf64_x86_64_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL to + trim plt entries. Move undefweak non-default visibility test ... + (allocate_dynrelocs): ... from here. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO. + Change all callers. + (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL. Use + SYMBOL_REFERENCES_LOCAL for dynreloc check. + (elf64_x86_64_relocate_section): Use SYMBOL_CALLS_LOCAL for + dynreloc and .got relocs. + (elf64_x86_64_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL + for .got relocs. + +2003-06-29 Thiemo Seufer + + * elfxx-mips.c: Allow lazy binding for R_MIPS_JALR. + +2003-06-27 Nick Clifton + + * opncls.c (bfd_add_gnu_debuglink_section): Rename to + bfd_add_gnu_debuglink_section and only create the section, do not + fill in its contents. + (bfd_fill_in_gnu_debuglink_section): New function. Fill in the + contents of a .gnu-debuglink section. + * bfd-in2.h: Regenerate. + +2003-06-27 Thiemo Seufer + + * elfxx-mips.c: Revert .got alignment to 2**4. + +2003-06-27 Thiemo Seufer + + * elf32-mips.c: Fix addend for _gp_disp special symbol. + +2003-06-27 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_fake_sections): Remove non-default + relocation header setup. + +2003-06-25 Alan Modra + + * elf32-ppc.c (ppc_elf_howto_table): Remove unnecessary cast. + (ppc_elf_reloc_type_lookup): Modify comment. + (ppc_elf_info_to_howto): Ditto. + (ppc_elf_relocate_section): Ditto. + (ppc_elf_check_relocs): Call ppc_elf_howto_init. + +2003-06-25 Alan Modra + + * aout-ns32k.c: Correct spelling of "relocatable". + * aoutx.h: Likewise. + * bfd-in.h: Likewise. + * bfd.c: Likewise. + * bout.c: Likewise. + * coff-a29k.c: Likewise. + * coff-alpha.c: Likewise. + * coff-arm.c: Likewise. + * coff-i386.c: Likewise. + * coff-i860.c: Likewise. + * coff-i960.c: Likewise. + * coff-m68k.c: Likewise. + * coff-m88k.c: Likewise. + * coff-mcore.c: Likewise. + * coff-mips.c: Likewise. + * coff-or32.c: Likewise. + * coff-ppc.c: Likewise. + * coff-rs6000.c: Likewise. + * coff-sh.c: Likewise. + * coff-tic80.c: Likewise. + * coff64-rs6000.c: Likewise. + * cofflink.c: Likewise. + * cpu-ns32k.c: Likewise. + * ecoff.c: Likewise. + * ecofflink.c: Likewise. + * elf-bfd.h: Likewise. + * elf-eh-frame.c: Likewise. + * elf-hppa.h: Likewise. + * elf-m10200.c: Likewise. + * elf-m10300.c: Likewise. + * elf.c: Likewise. + * elf32-arm.h: Likewise. + * elf32-avr.c: Likewise. + * elf32-cris.c: Likewise. + * elf32-d10v.c: Likewise. + * elf32-dlx.c: Likewise. + * elf32-fr30.c: Likewise. + * elf32-frv.c: Likewise. + * elf32-h8300.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-i860.c: Likewise. + * elf32-i960.c: Likewise. + * elf32-ip2k.c: Likewise. + * elf32-iq2000.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-mips.c: Likewise. + * elf32-msp430.c: Likewise. + * elf32-openrisc.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-vax.c: Likewise. + * elf32-xstormy16.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mips.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-sparc.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfcode.h: Likewise. + * elflink.h: Likewise. + * elfn32-mips.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * i386linux.c: Likewise. + * ieee.c: Likewise. + * libcoff-in.h: Likewise. + * linker.c: Likewise. + * m68klinux.c: Likewise. + * pdp11.c: Likewise. + * pe-mips.c: Likewise. + * peXXigen.c: Likewise. + * reloc.c: Likewise. + * reloc16.c: Likewise. + * sparclinux.c: Likewise. + * sunos.c: Likewise. + * syms.c: Likewise. + * versados.c: Likewise. + * vms.c: Likewise. + * xcofflink.c: Likewise. + * bfd-in2.h: Regenerate. + * libcoff.h: Regenerate. + * libbfd.h: Regenerate. + +2003-06-24 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Report plt reloc against + local sym errors. + + * elf32-i386.c: Convert to C90 function definitions, remove unnecessary + prototypes and casts. Replace PTR with void *. Formatting. + * elf32-ppc.c: Likewise. Break long strings too. + (ppc_elf_relax_section): Use enum elf_ppc_reloc_type for r_type. + (ppc_elf_unhandled_reloc): Internationalize error message. + * elf32-ppc.h: Remove PARAMS. + +2003-06-23 Mark Mitchell + + * elf32-ppc.c (ppc_elf_begin_write_processing): Use bytes to count + APUinfo slots. + (ppc_elf_final_write_processing): Likewise. + +2003-06-23 H.J. Lu + + * elflink.h (elf_link_input_bfd): Check raw size when using + kept_section to preserve debug information discarded by + linkonce. + +2003-06-20 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_table): Add top_id. + (ppc64_elf_setup_section_lists): Set it. + (ppc64_elf_relocate_section): Check sym section id against top_id. + (ppc_build_one_stub): Comment on top_id. + +2003-06-20 Ralf Corsepius + + * config.bfd: Add tic4x-*-rtems*. + +2003-06-20 Alan Modra + + * elf64-ppc.c: Convert to C90 function definitions, remove unnecessary + prototypes and casts. Replace PTR with void *. Format copyright. + Mention ABI links. + (struct ppc_link_hash_table): Rename sgot, srelgot, splt, srelplt, + sdynbss, srelbss, sglink, sbrlt and srelbrlt to got, relgot .. relbrlt. + (ppc_type_of_stub): Make r_type an enum. + (ppc64_elf_size_stubs): Likewise. + * elf64-ppc.h: Remove PARAMS macro. + +2003-06-19 Alan Modra + + * elf64-ppc.c (ppc64_elf_link_hash_table_create): Reinstate init of + elf hash tab fields. + + * elf64-ppc.c (ppc64_elf_reloc_type_lookup): Tidy prototype. + (ppc64_elf_info_to_howto): Likewise. + (ppc64_elf_build_stubs): Add "stats" param, and print statistics. + * elf64-ppc.h (ppc64_elf_build_stubs): Adjust prototype. + +2003-06-19 Alan Modra + + * elf64-sparc.c (sparc64_elf_relocate_section): Ignore R_SPARC_DISP32 + reloc overflow on discarded eh_frame entries. + +2003-06-19 Alan Modra + + * elf64-ppc.c (toc_adjusting_stub_needed): New function. + (ppc64_elf_next_input_section): Use it here to set has_gp_reloc. + Return error condition. + (ppc64_elf_size_stubs): Restrict toc adjusting stubs to sections + that have has_gp_reloc set. + (struct ppc_link_hash_table): Add stub_count. + (ppc_build_one_stub): Increment it. + (ppc64_elf_link_hash_table_create): zmalloc rather than clearing + individual fields. + * elf64-ppc.h (ppc64_elf_next_input_section): Update prototype. + +2003-06-18 Alan Modra + + * elflink.h (elf_gc_record_vtentry): Revert last change. Correct + size calculation from addend. Round size up. + +2003-06-18 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) : When linking a program, don't complain about a + symbol from a normal object or an undefined weak symbol. + +2003-06-18 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Accept a symbol on + R_PPC64_TOC relocs. + +2003-06-17 H.J. Lu + + * section.c (struct sec): Put back kept_section. + (STD_SECTION): Put back kept_section initialization. + * bfd-in2.h: Regenerate. + + * elflink.h (elf_link_input_bfd): Also check discarded linkonce + sections for relocateable output. Use kept_section to preserve + debug information discarded by linkonce. + +2003-06-17 Roland McGrath + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Support + segment-relative relocation between different segments. + +2003-06-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Do unaligned reloc + optimizations earlier. + + * elf64-ppc.c (struct ppc_link_hash_table): Reinstate top_index. + Restore previous input_list type. + (ppc64_elf_link_hash_table_create): Undo last change. + (ppc64_elf_setup_section_lists): Reinstate code setting up input lists + per output section, but don't bother with bfd_abs_section marker. + (ppc64_elf_next_input_section): Adjust for multiple input section + lists. + (group_sections): Likewise. + +2003-06-17 Jakub Jelinek + + * elf64-ppc.c (ppc64_elf_relocation_section): Ensure + *r_offset == r_addend for RELATIVE relocs against .got. + +2003-06-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Optimize unaligned relocs. + +2003-06-17 Nick Clifton + + * elflink.h (elf_gc_record_vtentry): Allocate an extra element + in the vtable_entries_used array to allow for the accessing + the largest element. + +2003-06-17 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_table): Remove top_index. Modify + input_list. + (ppc64_elf_link_hash_table_create): Init input_list here. + (ppc64_elf_setup_section_lists): Remove code setting up input lists + per output section. Set toc_off for abs and other standard sections. + (ppc64_elf_reinit_toc): Don't set elf_gp on input bfds lacking a toc. + (ppc64_elf_next_input_section): Adjust for single input section list. + Don't set toc_curr from input bfds that haven't set elf_gp. + (group_sections): Adjust for single input section list. + + * elf64-ppc.c (ppc64_elf_relocate_section): Correct pcrel section zero. + +2003-06-16 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing toctprel + tls, check that a TOC16_DS or TOC16_LO_DS reloc isn't pointing to a + dtprel entry. Ensure TLS_LD DTPMOD reloc has a zero addend. Write + got section for RELATIVE relocs. Fix wrong comment. Change condition + under which dynamic relocs update the section contents. + +2003-06-13 Robert Millan + + * config.bfd: Add i386-netbsd-gnu target. + +2003-06-12 Nick Clifton + + * opncls.c (calc_crc32): Rename to + bfd_calc_gnu_debuglink_crc32 and export. + (GNU_DEBUGLINK): Define and use to replace occurrences of + hard-coded ".gnu_debuglink" in the code. + (get_debug_link_info): Prevent aborts by replacing call to + xmalloc with a call to malloc. + (find_separate_debug_file): Prevent aborts by replacing calls + to xmalloc and xstrdup with calls to malloc and strdup. + (bfd_add_gnu_debuglink): New function. Add a .gnu_debuglink + section to a bfd. + * bfd-in2.h: Regenerate. + +2003-06-12 Federico G. Schwindt + + * config.bfd (i[3-7]86-*-openbsd[0-2].* | i[3-7]86-*-openbsd3.[0-3]): + New target (was i[3-7]86-*-openbsd* before). + (i[3-7]86-*-openbsd*): Change to use bfd_elf32_i386_vec. + (vax-*-openbsd*): New target. + +2003-06-11 Thiemo Seufer + + * elfxx-mips.c (MIPS_ELF_OPTIONS_SECTION_NAME): Use .MIPS.options + for n32, too. + (MIPS_ELF_STUB_SECTION_NAME): Use .MIPS.stubs for n32, too. + (mips_elf_rel_dyn_section): Use appropriate section alignment. + (mips_elf_create_got_section): Likewise. + (_bfd_mips_elf_create_dynamic_sections): Likewise. + +2003-06-11 Thiemo Seufer + + * elf32-mips.c (mips_elf_generic_reloc): New Function. + (elf_mips_howto_table_rel): Use it. + (gprel32_with_gp): Move prototype. + (mips_elf_hi16_reloc): Check for ! BSF_LOCAL instead of zero addend. + Use mips_elf_generic_reloc. + (mips_elf_got16_reloc): Check for ! BSF_LOCAL instead of zero addend. + Code cleanup. + (_bfd_mips_elf32_gprel16_reloc): Check for ! BSF_LOCAL instead of + zero addend. + (mips_elf_gprel32_reloc): Likewise. Use the same GP assignment logic + as in the other *_gprel*_reloc functions. + (gprel32_with_gp): Handle partial_inplace properly. + (mips32_64bit_reloc): Use mips_elf_generic_reloc. + (mips16_gprel_reloc): Check for ! BSF_LOCAL instead of zero addend. + Do addend handling directly instead of calling + _bfd_mips_elf_gprel16_with_gp. Handle partial_inplace properly. + * elf64-mips.c (mips_elf64_hi16_reloc): Check for ! BSF_LOCAL instead + of zero addend. Handle partial_inplace properly. + (mips_elf64_got16_reloc): Check for ! BSF_LOCAL instead of zero + addend. + (mips_elf64_gprel16_reloc): Likewise. + (mips_elf64_literal_reloc): Likewise. + (mips_elf64_gprel32_reloc): Likewise. Use the same GP assignment + logic as in the other *_gprel*_reloc functions. Handle + partial_inplace properly. + (mips_elf64_shift6_reloc): Check for ! BSF_LOCAL instead of zero + addend. Handle partial_inplace properly. + (mips16_gprel_reloc): Likewise. Do addend handling directly instead + of calling _bfd_mips_elf_gprel16_with_gp. + * elfn32-mips.c (mips_elf_got16_reloc): Check for BSF_LOCAL. + (mips_elf_gprel32_reloc): Check for ! BSF_LOCAL instead + of zero addend. + (mips_elf_shift6_reloc): Handle partial_inplace properly. + (mips16_gprel_reloc): Likewise. Do addend handling directly instead + of calling _bfd_mips_elf_gprel16_with_gp. + * elfxx-mips.c (_bfd_mips_elf_gprel16_with_gp): Handle + partial_inplace properly. Fix wrong addend handling. Fix overflow + check. + (_bfd_mips_elf_sign_extend): Renamed from mips_elf_sign_extend and + exported. + (mips_elf_calculate_relocation): Use _bfd_mips_elf_sign_extend. + (_bfd_mips_elf_relocate_section): Likewise. + (mips_elf_create_dynamic_relocation): Update sec_info_type access. + * elfxx-mips.h (_bfd_mips_relax_section): Fix prototype declaration. + (_bfd_mips_elf_sign_extend): New prototype. + +2003-06-11 Federico G. Schwindt + + * config.bfd (sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1]): + New target (was sparc-*-openbsd* before). + (sparc-*-openbsd*): Change to use bfd_elf32_sparc_vec. + + * configure.in (vax-*-openbsd*): Set COREFILE to netbsd-core.lo. + * configure: Regenerate. + +2003-06-11 H.J. Lu + + * po/Make-in (DESTDIR): New. + (install-data-yes): Support $(DESTDIR). + (uninstall): Likewise. + +2003-06-11 Alan Modra + + * Makefile.am (config.status): Depend on version.h. + Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2003-06-10 Alan Modra + Gary Hade + + * elf64-ppc.c (ppc64_elf_relocate_section <*_DS>): Special case lq. + +2003-06-10 Richard Sandiford + + * archures.c (bfd_mach_h8300sxn): New architecture. + * bfd-in2.h: Regenerate. + * cpu-h8300.c (h8300_scan): Check for 'sxn'. + (h8300sxn_info_struct): New. + (h8300sx_info_struct): Link to it. + * elf32-h8300.c (elf32_h8_mach): Add h8300sxn case. + (elf32_h8_final_write_processing): Likewise. + +2003-06-08 Alan Modra + + * elf64-ppc.c: Move TARGET_LITTLE_SYM and other macros used by + elfxx-target.h so that we can use elf_backend_got_header_size. + (ELF_MACHINE_ALT1, ELF_MACHINE_ALT2): Delete. + (GLINK_CALL_STUB_SIZE): Modify. Define new glink call stub and + associated macros. + (ppc64_elf_howto_raw ): Correct + dst_mask. + (enum ppc_stub_type): Add ppc_stub_long_branch_r2off and + ppc_stub_plt_branch_r2off. + (struct ppc_stub_hash_entry): Reorganize. + (struct ppc_link_hash_table): Add no_multi_toc, multi_toc_needed, + toc_curr, toc_off and emit_stub_syms. + (ppc64_elf_link_hash_table_create): Init them. + (ppc_stub_name): Correct string size. + (ppc64_elf_check_relocs): Set has_gp_reloc on GOT and TOC relocs. + (ppc64_elf_size_dynamic_sections): Set no_multi_toc if GOT entries + used. + (ppc_type_of_stub): Tweak root.type test. + (build_plt_stub): Remove glink code. Adjust for insn macro changes. + (ppc_size_one_stub): Handle ppc_stub_long_branch_r2off and + ppc_stub_plt_branch_r2off. + (ppc_build_one_stub): Likewise. Fix var shadowing. Correct addis,addi + range test. Use toc_off to calculte r2 values. Handle emit_stub_syms. + (ppc64_elf_setup_section_lists): Remove htab creator flavour test. + Initialize elf_gp and toc_curr. + (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): New functions. + (ppc64_elf_next_input_section): Set toc_off. + (group_sections): Ensure groups have the same TOC. + (ppc64_elf_size_stubs): Check whether we need a TOC adjusting stub. + (ppc64_elf_build_stubs): Add emit_stub_syms param, and stash in htab. + Build new glink stub. + (ppc64_elf_relocate_section): Handle multiple TOCs. Fix comments. + (ppc64_elf_finish_dynamic_sections): Adjust DT_PPC64_GLINK. + * elf64-ppc.h (ppc64_elf_build_stubs): Update prototype. + (ppc64_elf_next_toc_section, ppc64_elf_reinit_toc): Declare. + * section.c (struct sec): Rename flag12 to has_gp_reloc. + (STD_SECTION): Update. + * ecoff.c (bfd_debug_section): Update comment. + * bfd-in2.h: Regenerate. + +2003-06-05 Daniel Jacobowitz + + * elfcode.h (elf_slurp_reloc_table_from_section): Don't dereference + NULL function pointers. + +2003-06-05 Daniel Jacobowitz + + * simple.c (bfd_simple_get_relocated_section_contents): Call + _bfd_generic_link_add_symbols instead of bfd_link_add_symbols. + +2003-06-04 Svein E. Seldal + + * coff-tic54x.c: Removed the ticoff0_bad_format_hook() and + ticoff1_bad_format_hook() functions. Removed the coff0 and coff1 + swaptables. + * coff-tic4x.c: Ditto + * coffcode.h: Added extra arguments to CREATE_BIG_COFF_TARGET_VEC + and CREATE_LITTLE_COFF_TARGET_VEC. Created the macro + CREATE_BIGHDR_COFF_TARGET_VEC. Created the ticoff0_bad_format_hook(), + ticoff1_bad_format_hook() functions. Created the coff0 and coff1 + swap tables. + * coff-tic4x.c: Adopted new CREATE_xxx_COFF_TARGET_VEC macros. + * coff-a29k.c: Append COFF_SWAP_TABLE argument + * coff-apollo.c: Ditto + * coff-arm.c: Ditto + * coff-h8300.c: Ditto + * coff-h8500.c: Ditto + * coff-i960.c: Ditto + * coff-m68k.c: Ditto + * coff-m88k.c: Ditto + * coff-mcore.c: Ditto + * coff-sh.c: Ditto + * coff-sparc.c: Ditto + * coff-tic80.c: Ditto + * coff-we32k.c: Ditto + * coff-z8k.c: Ditto + * coff-w65.c: Ditto + +2003-06-04 Svein E. Seldal + + * coff-tic4x.c (ticoff0_swap_table, ticoff1_swap_table): Fixed + initialization bug + +2003-06-03 Jakub Jelinek + + * elf.c (_bfd_elf_print_private_bfd_data): Handle PT_GNU_STACK. + (bfd_section_from_phdr): Likewise. + (map_sections_to_segments): Create PT_GNU_STACK segment header. + (get_program_header_size): Count with PT_GNU_STACK. + * elf-bfd.h (struct elf_obj_tdata): Add stack_flags. + * elflink.h (bfd_elfNN_size_dynamic_sections): Set stack_flags. + +2003-06-03 H.J. Lu + + * elflink.h (elf_link_input_bfd): Call linker error_handler + for discarded definitions. + +2003-06-03 Elias Athanasopoulos + + * syms.c (decode_section_type): Return 'n' if section flags are + SEC_HAS_CONTENTS && SEC_READONLY. + +2003-06-03 Nick Clifton + + * elf32-v850.c (v850_elf_howto_t): Rename R_V850_32to + R_V850_ABS32. Add entry for R_V850_REL32. + (v850_elf_reloc_map): Likewise. + (v850_elf_check_relocs): Likewise. + (v850_elf_perform_relocation): Likewise. + (v850_elf_final_link_relocate): Likewise. Include computation + to make R_V850_REl32 pc-relative. + +2003-06-03 Kaz Kojima + + * elf32-sh.c (sh_elf_size_dynamic_sections): Create .interp section + and DT_DEBUG dynamic tag even for position independent executables. + * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewize. + +2003-06-02 Daniel Jacobowitz + + * config.bfd: Move obsolete entries out of the range of the + targmatch sed script. + +2003-06-02 Daniel Jacobowitz + + * config.bfd (mips*-dec-bsd*, mips*-*-pe*): Mark as obsolete. + +2003-05-31 Jakub Jelinek + + * elf32-ppc.c (allocate_dynrelocs): Use single slot for first 8192 + plt entries, not just 8191. + +2003-05-30 Daniel Jacobowitz + + * elfxx-mips.c (_bfd_mips_elf_discard_info): Correct loop index. + Reported by Ken Faiczak . + +2003-05-30 Ulrich Drepper + Jakub Jelinek + + * elflink.h (elf_link_add_object_symbols): Use !info->executable + instead of info->shared where appropriate. + (bfd_elfNN_size_dynamic_sections, elf_link_output_extsym): Likewise. + * elflink.c (_bfd_elf_create_got_section): Likewise. + (_bfd_elf_link_create_dynamic_sections): Likewise. + (_bfd_elf_link_assign_sym_version): Likewise. + * elf32-i386.c (elf_i386_size_dynamic_sections): Create .interp section + and DT_DEBUG dynamic tag even for position independent executables. + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Likewise. + * elf32-s390.c (elf_s390_size_dynamic_sections: Likewise. + * elf64-ppc.c (ppc64_elf_size_dynamic_sections: Likewise. + * elf64-s390.c (elf_s390_size_dynamic_sections: Likewise. + * elf64-x86-64.c (elf64_x86_64_size_dynamic_sections: Likewise. + * elfxx-ia64.c (elfNN_ia64_size_dynamic_sections: Likewise. + * elf32-sparc.c (elf32_sparc_size_dynamic_sections: Likewise. + * elf64-alpha.c (elf64_alpha_size_dynamic_sections: Likewise. + * elf64-sparc.c (sparc64_elf_size_dynamic_sections: Likewise. + +2003-05-30 Kris Warkentin + + * elf.c (elfcore_grok_nto_status): Only set lwpid for the active or + signalled thread. + (elfcore_grok_nto_gregs): Only make .reg section for the active thread. + +2003-05-29 Nick Clifton + + * pef.c: Include "safe-ctype.h" instead of . + Tidy up formatting. + * Makefile.am: Add dependency on safe-ctype.h. + * Makefile.in: Regenerate. + +2003-05-29 Thiemo Seufer + + * elfxx-mips.c: Don't force symbols local unconditionally. + +2003-05-28 Alan Modra + + * elf32-hppa.c (elf32_hppa_relocate_section): Delete bogus + undefined_symbol call. + +2003-05-27 Richard Sandiford + + * elfxx-mips.c (mips_elf_hash_sort_data): Fix formattting. + (mips_elf_link_hash_table): Likewise. + +2003-05-22 Thiemo Seufer + + * elf64-mips.c (elf_mips_gnu_rel16_s2): Add internally used + R_MIPS_GNU_REL16_S2 support. + (bfd_elf64_bfd_reloc_type_lookup): Use it. + (mips_elf64_rtype_to_howto): Use it. + * elfn32-mips.c (elf_mips_gnu_rel16_s2): Add internally used + R_MIPS_GNU_REL16_S2 support. + (bfd_elf32_bfd_reloc_type_lookup): Use it. + (mips_elf_n32_rtype_to_howto): Use it. + +2003-05-21 Stuart F. Downing + + * som.h: Define PA_2_0 before including a.out.h + +2003-05-07 Eric Christopher + Alexandre Oliva + + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Adjust + pic tests, change to warning. + (_bfd_mips_elf_final_link): Remove EF_MIPS_CPIC flag setting. + +2003-05-21 Marcus Comstedt + + * config.bfd: Check for a target triplet of shl-...-netbsdelf as + well as shle-...-netbsdelf. Remove duplicate entry. + +2003-05-21 Nick Clifton + + * elf32-xstormy16.c (xstormy16_elf_howto_table): Fix dst_mask + for X_STORMY16_REL_12 reloc. + + * elf.c (bfd_elf_get_needed_list): Use is_elf_hash_table to check + the type of the hash table in the bfd_link_info structure. + (bfd_elf_get_runpath_list): Likewise. + +2003-05-19 Roland McGrath + + * elf.c (bfd_elf_bfd_from_remote_memory): New function. + * bfd-in.h: Declare it. + * bfd-in2.h: Regenerated. + * elfcode.h (NAME(_bfd_elf,bfd_from_remote_memory)): New function. + * elf-bfd.h (struct elf_backend_data): New function pointer member + elf_backend_bfd_from_remote_memory. + (_bfd_elf32_bfd_from_remote_memory, _bfd_elf64_bfd_from_remote_memory): + Declare them. + * elfxx-target.h (elf_backend_bfd_from_remote_memory): New macro. + (elfNN_bed): Add that to the initializer. + +2003-05-15 Roland McGrath + + * elf.c (elfcore_grok_note): Grok NT_AUXV note, make ".auxv" section. + +2003-05-20 Jakub Jelinek + + * elflink.h (elf_link_output_extsym): Only issue error about != + STV_DEFAULT symbols if they are bfd_link_hash_undefined. + +2003-05-20 H.J. Lu + + * elflink.c (_bfd_elf_merge_symbol): Check ELF_LINK_DYNAMIC_DEF + when removing the old definition for symbols with non-default + visibility. + +2003-05-18 Jason Eckhardt + + * elf32-i860.c (elf32_i860_relocate_highadj): Simplify calculation. + +2003-05-17 Andreas Schwab + + * elf32-m68k.c (elf_m68k_check_relocs): Cache reloc section in + elf_section_data during processing of pc-relative and absolute + relocations. + (elf_m68k_relocate_section): Use the cached reloc section instead + of computing it again. Fix handling of visibility. Don't modify + addend when copying over a relocation into the output. + +2003-05-17 Alan Modra + + * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL + to trim plt entries. Move undefweak non-default visibility test.. + (allocate_dynrelocs): ..from here. + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't test + dynamic_sections_created here. Update comment. Move undefweak + non-default visibility test.. + (allocate_dynrelocs): ..from here. Fix comment. + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Use SYMBOL_CALLS_LOCAL + to trim plt entries. Move undefweak non-default visibility test.. + (allocate_dynrelocs): ..from here. Fix comment. + * elflink.h (elf_link_output_extsym): Compare ELF_ST_VISIBILITY with + STV_DEFAULT rather than comparing with zero. + * elflink.c (_bfd_elf_merge_symbol): Likewise. + (_bfd_elf_fix_symbol_flags): Likewise. Format comment. + +2003-05-17 Thiemo Seufer + + * bfd.c (_bfd_get_gp_value): Prevent illegal access for abfd null + pointers. + (_bfd_set_gp_value): Likewise. + +2003-05-16 Michael Snyder + From Bernd Schmidt + * archures.c (bfd_mach_h8300sx): New. + * bfd-in2.h: Regenerate. + * cpu-h8300.c (h8300_scan)): Add support for h8300sx. + (h8300sx_info_struct): New. + (h8300s_info_struct): Link to it. + * elf32-h8300.c (elf32_h8_mach): Add support for h8300sx. + (elf32_h8_final_write_processing): Likewise. + (elf32_h8_relax_section): Likewise. + +2003-05-16 Kelley Cook + + * config.bfd: Accept i[3-7]86 variants. + * configure.host: Likewise. + * configure.in: Likewise. + * configure: Regenerate. + +2003-05-15 H.J. Lu + + * elflink.c (_bfd_elf_fix_symbol_flags): Also hide protected + symbol. + +2003-05-15 H.J. Lu + + * elflink.h (elf_link_check_versioned_symbol): Also allow + the base version. + +2003-05-15 Alan Modra + H.J. Lu + + * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_CALLS_LOCAL. + (elf_i386_relocate_section): Likewise. + * elf32-ppc.c (allocate_dynrelocs): Likewise. + (ppc_elf_relocate_section): Likewise. + * elf64-ppc.c (allocate_dynrelocs): Likewise. + (ppc64_elf_relocate_section): Likewise. + +2003-05-15 Thiemo Seufer + + * elf32-mips.c (gprel32_with_gp): Remove useless N64 ABI case. + +2003-05-13 Stephane Carrez + + * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Check for + processor capability, allow merge of HC12 and HCS12 in some cases. + (m68hc11_elf_hash_table_create): Use bfd_malloc instead of bfd_zalloc. + * cpu-m68hc12.c (bfd_m68hc12s_arch): New struct. + (bfd_m68hc12_arch): Link it. + (scan_mach): New function. + +2003-05-13 Andrew Haley + + * elf.c (bfd_elf_hash): Mask lower 32 bits of hash. + +2003-05-13 Alan Modra + H.J. Lu + + * elf-bfd.h (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Move from + elf32-ppc.c. Add ELF_LINK_FORCED_LOCAL check. + * elf32-ppc.c: (SYMBOL_REFERENCES_LOCAL, SYMBOL_CALLS_LOCAL): Delete. + (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for dynreloc check. + (ppc_elf_relocate_section): Likewise. + * elf64-ppc.c (allocate_dynrelocs): Likewise. + (ppc64_elf_relocate_section): Likewise. Use for .got relocs too. + (ppc64_elf_adjust_dynamic_symbol): Don't assume symbols with .plt + relocs need no other types. + * elf32-i386.c (allocate_dynrelocs): Use SYMBOL_REFERENCES_LOCAL for + dynreloc check. + (elf_i386_relocate_section): Likewise. Use for .got relocs too. + (elf_i386_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL for + .got relocs. + +2003-05-13 Kaz Kojima + + * elf32-sh.c (sh_elf_adjust_dynamic_symbol): For weak symbols, + copy ELF_LINK_NON_GOT_REF from weakdef. + (allocate_dynrelocs): For undef weak syms with non-default + visibility, a) don't allocate plt entries, b) don't allocate + .got relocs, c) discard dyn rel space + (sh_elf_relocate_section): d) don't generate .got relocs, e) + don't generate dynamic relocs. + (sh_elf_copy_indirect_symbol): Don't copy ELF_LINK_NON_GOT_REF + for weakdefs when symbol already adjusted. + +2003-05-12 Nick Clifton + + * elf32-xstormy16.c (xstormy16_elf_howto_table): use 'bitfield' + overflow detection for R_XSTORMY16_16 reloc. + +2003-05-12 Paul Clarke + + * elf32-h8300.c: Fix typo in name of R_H8_DIR8 reloc. + +2003-05-11 Jason Eckhardt + + * elf32-i860.c (elf32_i860_relocate_highadj): Properly + adjust upper bits. + (elf32_i860_relocate_splitn): Obtain upper 5 bits from the + proper place. + (elf32_i860_relocate_pc16): Obtain upper 5 bits from the + proper place. + +2003-05-11 Andreas Schwab + + * elf32-m68k.c (elf_m68k_relocate_section): Replace ugly + complicated tests for unresolvable relocs with a simple direct + scheme using "unresolved_reloc" var. Report some detail on + bfd_reloc_outofrange and similar errors. + +2003-05-09 Martin Schwidefsky + + * elf32-s390.c (allocate_dynrelocs, elf_s390_relocate_section): + Fix WILL_CALL_FINISH_DYNAMIC_SYMBOL call. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO. + * elf64-s390.c: Likewise. + +2003-05-09 Martin Schwidefsky + + * elf32-s390.c (ELIMINATE_COPY_RELOCS): Define as one. + (elf_s390_adjust_dynamic_symbol): For weak symbols, copy + ELF_LINK_NON_GOT_REF from weakdef. + (elf_s390_copy_indirect_symbol): Test whether the weakdef sym has + already been adjusted before treating it specially. + * el64-s390.c: Likwise. + +2003-05-09 Martin Schwidefsky + + * elf32-s390.c (allocate_dynrelocs): For undef weak syms with + non-default visibility, a) don't make them dynamic, b) discard + space for dynamic relocs. + (elf_s390_relocate_section): Initialize the GOT entries and skip + R_390_{8,16,32}/R_390_PC{16,16DBL,32DBL,32} for weak undefined + symbols with non-default visibility. + * elf64-s390.c: Likewise. + +2003-05-09 Alan Modra + + * cpu-arm.c (arm_check_note): Warning fix. + * elf32-iq2000.c (iq2000_elf_check_relocs): Warning fixes. Arrange + to keep relocs if edited. + (iq2000_elf_print_private_bfd_data): Return TRUE. + * elfxx-ia64.c (elfNN_ia64_relax_section): Use ELFNN_R_SYM, not + ELF64_R_SYM. + (elfNN_ia64_relax_ldxmov): Warning fix. + * xtensa-isa.c (xtensa_add_isa): Warning fix. + * xtensa-modules.c (get_num_opcodes): Warning fix. + +2003-05-09 Andrey Petrov + + * elf.c (elf_fake_sections): Use correct cast for sh_name. + +2003-05-09 Alan Modra + + * elflink.c (_bfd_elf_link_create_dynamic_sections): Move from + elflink.h. Replace LOG_FILE_ALIGN with bed->s->log_file_align. + (_bfd_elf_create_dynamic_sections): Use bed->s->log_file_align. + (bfd_elf_record_link_assignment): Move from elflink.h. + (_bfd_elf_merge_symbol): Likewise. + (_bfd_elf_add_default_symbol): Likewise. + (_bfd_elf_export_symbol): Likewise. + (_bfd_elf_link_find_version_dependencies): Likewise. + (_bfd_elf_link_assign_sym_version): Likewise. + (_bfd_elf_link_read_relocs): Likewise. + (_bfd_elf_link_size_reloc_section): Likewise. + (_bfd_elf_fix_symbol_flags): Likewise. + (_bfd_elf_adjust_dynamic_symbol): Likewise. + (_bfd_elf_link_sec_merge_syms): Likewise. + (elf_link_read_relocs_from_section): Likewise. Use bed->s->sizeof_rel + and bed->s->sizeof_rela. + (_bfd_elf_link_output_relocs): Likewise. + * elf-bfd.h (struct elf_size_info): Rename file_align to + log_file_align. + (struct elf_info_failed): Move from elflink.h. + (struct elf_assign_sym_version_info): Likewise. + (struct elf_find_verdep_info): Likewise. + (_bfd_elf_create_dynamic_sections): Delete duplicate declaration. + (_bfd_elf_merge_symbol, _bfd_elf_add_default_symbol, + _bfd_elf_export_symbol, _bfd_elf_link_find_version_dependencies, + _bfd_elf_link_assign_sym_version, + _bfd_elf_link_create_dynamic_sections, _bfd_elf_link_read_relocs, + _bfd_elf_link_size_reloc_section, _bfd_elf_link_output_relocs, + _bfd_elf_fix_symbol_flags, _bfd_elf_adjust_dynamic_symbol, + _bfd_elf_link_sec_merge_syms): Declare. + (bfd_elf32_link_create_dynamic_sections): Don't declare. + (_bfd_elf32_link_read_relocs): Likewise. + (bfd_elf64_link_create_dynamic_sections): Likewise. + (_bfd_elf64_link_read_relocs): Likewise. + * elflink.h: Move lots o' stuff elsewhere. + * bfd-in.h (bfd_elf32_record_link_assignment): Don't declare. + (bfd_elf64_record_link_assignment): Likewise. + (bfd_elf_record_link_assignment): Declare. + * bfd-in2.h: Regenerate. + * elfcode.h (elf_link_create_dynamic_sections): Don't declare. + (NAME(_bfd_elf,size_info)): Adjust for log_file_align. + * elf.c (_bfd_elf_init_reloc_shdr): Adjust for bed->s->log_file_align. + (assign_file_positions_for_segments): Likewise. + (assign_file_positions_except_relocs): Likewise. + (swap_out_syms, elfcore_write_note): Likewise. + * elf-m10200.c: Adjust for changed function names. + * elf-m10300.c: Likewise. + * elf32-arm.h: Likewise. + * elf32-h8300.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-ip2k.c: Likewise. + * elf32-m32r.c: Likewise. + * elf32-m68hc11.c: Likewise. + * elf32-m68hc1x.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mips.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-xtensa.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-sh64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + (MIPS_ELF_LOG_FILE_ALIGN): Use log_file_align. + * elf64-alpha.c (alpha_elf_size_info): Adjust for log_file_align. + * elf64-hppa.c (hppa64_elf_size_info): Likewise. + * elf64-mips.c (mips_elf64_size_info): Likewise. + * elf64-s390.c (s390_elf64_size_info): Likewise. + * elf64-sparc.c (sparc64_elf_size_info): Likewise. + +2003-05-08 H.J. Lu + + * elflink.h (elf_add_default_symbol): After skipping the + unversioned symbol, go to non-default one. + +2003-05-07 H.J. Lu + + * elfxx-ia64.c (_bfd_elf_link_hash_hide_symbol): Also clear the + want_plt field. + (elfNN_ia64_relocate_section): Don't do dynamic symbol lookup + for symbols with non-default visibility. + +2003-05-07 H.J. Lu + + * elflink.h (elf_link_check_versioned_symbol): Also handle the + case that a DSO references a hidden symbol which may be + satisfied by a versioned symbol in another DSO. + (elf_link_output_extsym): Check versioned definition for hidden + symbol referenced by a DSO. + +2003-05-07 Nick Clifton + + * elf32-xstormy16.c (xstormy16_elf_howto_table): Reset + R_XSTORMY16_16 reloc to ignore overflows. + +2003-05-06 Alexandre Oliva + + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Improve + error message for mixing different-endian files. Check for ABI + compatibility of input files with the selected emulation. + +2003-05-05 Alan Modra + + * elf32-i386.c (allocate_dynrelocs): For undef weak syms with + non-default visibility, a) don't make them dynamic, b) discard + space for dynamic relocs. + * elf64-x86-64.c (allocate_dynrelocs): Likewise. + + * elf32-ppc.c (allocate_dynrelocs): For undef weak syms with + non-default visibility, a) don't allocate plt entries, b) don't + allocate .got relocs, c) discard dyn rel space, + (ppc_elf_relocate_section): d) don't generate .got relocs, e) + don't generate dynamic relocs. + * elf64-ppc.c (allocate_dynrelocs): As above. + (ppc64_elf_relocate_section): As above. + +2003-05-05 Andreas Jaeger + + * elf64-x86-64.c (allocate_dynrelocs): Don't allocate dynamic + relocation entries for weak undefined symbols with non-default + visibility. + (elf64_x86_64_relocate_section): Initialize the GOT entries and + skip R_386_32/R_386_PC32 for weak undefined symbols with + non-default visibility. + +2003-05-04 H.J. Lu + + * elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic + relocation entries for weak undefined symbols with non-default + visibility. + (elf_i386_relocate_section): Initialize the GOT entries and + skip R_386_32/R_386_PC32 for weak undefined symbols with + non-default visibility. + + * elfxx-ia64.c (allocate_fptr): Don't allocate function + descriptors for weak undefined symbols with non-default + visibility. + (allocate_dynrel_entries): Don't allocate relocation entries + for symbols resolved to 0. + (set_got_entry): Don't install dynamic relocation for weak + undefined symbols with non-default visibility. + (set_pltoff_entry): Likewise. + + * elflink.h (elf_fix_symbol_flags): Hide weak undefined symbols + with non-default visibility. + (elf_link_output_extsym): Don't make weak undefined symbols + with non-default visibility dynamic. + +2003-05-04 H.J. Lu + + * elflink.h (elf_merge_symbol): Correctly handle weak definition. + +2003-05-04 H.J. Lu + + * elflink.h (elf_merge_symbol): Don't record a hidden/internal + symbol dynamic. Check indirection when removing the old + definition for symbols with non-default visibility. + (elf_add_default_symbol): Skip when told by elf_merge_symbol. + +2003-05-02 Nick Clifton + + * elf32-xstormy16.c (xstormy16_elf_howto_table): Make the + R_XSTORMY16_8 and R_XSTORMY16_16 relocs detect and complain about + unsigned overflow. + +2003-05-02 Andreas Jaeger + + * elf64-x86-64.c (elf_x86_64_copy_indirect_symbol): Don't copy + ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted. + (ELIMINATE_COPY_RELOCS): Define as one. Use throughout. + (elf_x86_64_adjust_dynamic_symbol): For weak symbols, copy + ELF_LINK_NON_GOT_REF from weakdef. + +2003-05-02 Charles Lepple + Nick Clifton + + * acinclude.m4: Fix name of --enable-install-libbfd switch. + * aclocal.m4: Regenerate. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2003-05-01 Alan Modra + + * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Test whether the + weakdef sym has already been adjusted before treating it specially. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Don't copy + ELF_LINK_NON_GOT_REF for weakdefs when symbol already adjusted. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + (ppc64_elf_check_relocs): Set ELF_LINK_NON_GOT_REF. + +2003-04-28 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Relax ldxmov during + the relax finalize pass. + + * section.c (struct sec): Add need_finalize_relax and remove + flag11. + (STD_SECTION): Update struct sec initializer. + * bfd-in2.h: Regenerated. + +2003-04-28 H.J. Lu + + * elflink.h (elf_merge_symbol): Call elf_backend_copy_indirect_symbol + to copy any information related to dynamic linking when we flip + the indirection. + +2003-04-27 H.J. Lu + + * elf-bfd.h (ELF_LINK_DYNAMIC_DEF): New. + (ELF_LINK_DYNAMIC_WEAK): New. + + * elflink.h (elf_merge_symbol): Add one argument to indicate if + a symbol should be skipped. Ignore definitions in dynamic + objects for symbols with non-default visibility. + (elf_add_default_symbol): Adjusted. + (elf_link_add_object_symbols): Check if a symbol should be + skipped. Don't merge the visibility field with the one from + a dynamic object. + (elf_link_check_versioned_symbol): Use undef_bfd. + (elf_link_output_extsym): Warn if a forced local symbol is + referenced from dynamic objects. Make non-weak undefined symbol + with non-default visibility a fatal error. + +2003-04-27 Daniel Jacobowitz + + * configure.in: Bump version on HEAD to 2.14.90. + * configure: Regenerated. + +2003-04-26 Stephane Carrez + + PR savannah/3331: + * elf32-m68hc11.c (m68hc11_elf_relax_section): Clear prev_insn_group + when we couldn't relax something. + +2003-04-25 Alan Modra + + * elflink.h (elf_merge_symbol): When we find a regular definition + for an indirect symbol, flip the indirection so that the old + direct symbol now points to the new definition. + +2003-04-24 Roland McGrath + + * elf.c (bfd_section_from_phdr): Map PT_GNU_EH_FRAME to "eh_frame_hdr". + +2003-04-24 Alan Modra + + * elf32-ppc.c: Formatting and comment fixes. + (ELIMINATE_COPY_RELOCS): Move before ppc_elf_copy_indirect_symbol. + (ppc_elf_copy_indirect_symbol): Copy flags here for weakdefs. + +2003-04-24 Dhananjay Deshpande + + * archures.c (bfd_mach_h8300hn, bfd_mach_h8300sn): Added. + * bfd-in2.h: Rebuilt. + * coff-h8300.c (BADMAG): Add check for H8300HNBADMAG & H8300SNBADMAG. + * coffcode.h (coff_set_arch_mach_hook): Add case for H8300HNMAGIC + & H8300SNMAGIC. + (coff_set_flags): Add case for bfd_mach_h8300hn & bfd_mach_h8300sn. + * cpu-h8300.c (h8300_scan): Handle h8300hn, h8300sn. + (h8300sn_info_struct, h8300hn_info_struct): New. + * elf32-h8300.c (elf32_h8_mach): Handle case for h8300hn & h8300sn + (elf32_h8_final_write_processing): Likewise. + +2003-04-23 Kaz Kojima + + * elf32-sh.c (tpoff): New. + (struct elf_sh_dyn_relocs): Remove tls_tpoff32. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO. + (allocate_dynrelocs): Don't make unnecessary dynamic TLS + relocations. Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses. + (sh_elf_relocate_section): Likewise. Remove unnecessary tests. + (dtpoff_base): Fix wrong indentation. + (sh_elf_check_relocs): Don't set DF_STATIC_TLS flag with non-TLS + relocations. Don't set tls_tpoff32 flag. Don't make unnecessary + R_SH_TLS_TPOFF32 relocations. + +2003-04-23 J"orn Rennecke + + * archures.c (enum bfd_architecture): Amend comment to refer to SuperH. + * cpu-sh.c: Likewise. + * elf32-sh.c: Likewise. + * reloc.c (bfd_reloc_code_real): Likewise. + * elf32-sh64-com.c: Change comment to refer to SuperH. + * elf32-sh64.c: Likewise. + * elf64-sh64.c: Likewise. + * bfd-in2.h (enum bfd_architecture): Regenerate. + +2003-04-23 Alan Modra + + From Julien LEMOINE + * elf32-i386.c (elf_i386_info_to_howto): Delete. + (elf_info_to_howto): Define as elf_i386_info_to_howto_rel. + +2003-04-22 Kazuhiro Inaoka + + * archures.c: Replace references to Mitsubishi M32R with references + to Renesas M32R. + * relocs.c: Likewise. + * bfd-in2.h: Regenerate. + +2003-04-21 Richard Henderson + + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Return false for an + executable when a symbol is defined both regular and dynamic. + +2003-04-21 Stephane Carrez + + * Makefile.am (BFD32_BACKENDS): Add elf32-m68hc1x.lo. + (elf32-m68hc1x.lo): Update dependencies + * configure.in: Add elf32-m68hc1x.lo. + * configure: Rebuild. + * Makefile.in: Rebuild. + +2003-04-21 Stephane Carrez + + * elf32-m68hc1x.c: New file (from elf32-m68hc11.c and elf32-m68hc12.c) + (m68hc11_elf_hash_table_create): New function. + (elf32_m68hc11_link_hash_table_free): New function. + (stub_hash_newfunc): New function. + (m68hc11_add_stub): New function. + (elf32_m68hc11_add_symbol_hook): New function. + (elf32_m68hc11_setup_section_lists): New function. + (elf32_m68hc11_next_input_section): New function. + (elf32_m68hc11_size_stubs): New function. + (elf32_m68hc11_build_stubs): New function. + (m68hc11_get_relocation_value): New function. + (elf32_m68hc11_relocate_section): Call the above to redirect + some relocations to the trampoline code. + (m68hc11_elf_export_one_stub): New function. + (m68hc11_elf_set_symbol): New function. + (elf32_m68hc11_build_stubs): Call it via bfd_hash_traverse. + (m68hc11_elf_get_bank_parameters): Get parameters only when the info + is not yet initialized. + + * elf32-m68hc1x.h: New file (from elf32-m68hc11.c and elf32-m68hc12.c) + (elf32_m68hc11_stub_hash_entry): New struct. + (m68hc11_page_info): Add trampoline handler address. + (m68hc11_elf_link_hash_table): Add stubs generation members. + (elf32_m68hc11_add_symbol_hook): Declare. + (elf32_m68hc11_setup_section_lists): Declare. + (elf32_m68hc11_size_stubs): Declare. + (elf32_m68hc11_build_stubs): Declare. + + * elf32-m68hc11.c (m68hc11_elf_ignore_reloc): Move to elf32-m68hc1x.c. + (elf32_m68hc11_gc_mark_hook, elf32_m68hc11_gc_sweep_hook): Likewise. + (elf32_m68hc11_check_relocs, elf32_m68hc11_relocate_section): Ditto. + (_bfd_m68hc11_elf_set_private_flags): Ditto. + (_bfd_m68hc11_elf_merge_private_bfd_data): Ditto. + (_bfd_m68hc11_elf_print_private_bfd_data): Ditto. + (bfd_elf32_bfd_link_hash_table_create): Define. + (elf_backend_add_symbol_hook): Define. + (m68hc11_elf_bfd_link_hash_table_create): New function. + (m68hc11_elf_build_one_stub): New function. + (m68hc11_elf_size_one_stub): New function. + (m68hc11_elf_bfd_link_hash_table_create): Install the above. + (bfd_elf32_bfd_link_hash_table_create): Define. + + * elf32-m68hc12.c (m68hc11_elf_ignore_reloc): Remove. + (m68hc12_addr_is_banked): Remove, use m68hc11_addr_is_banked. + (m68hc12_phys_addr): Ditto. + (m68hc12_phys_page): Ditto. + (m68hc12_elf_special_reloc): Move to elf32-m68hc1x.c. + (elf32_m68hc11_gc_mark_hook): Likewise. + (elf32_m68hc11_gc_sweep_hook): Likewise. + (elf32_m68hc11_check_relocs): Likewise. + (elf32_m68hc11_relocate_section): Likewise. + (_bfd_m68hc12_elf_set_private_flags): Likewise. + (_bfd_m68hc12_elf_merge_private_bfd_data): Likewise. + (_bfd_m68hc12_elf_print_private_bfd_data): Likewise. + (m68hc12_elf_build_one_stub): New function. + (m68hc12_elf_size_one_stub): New function. + (m68hc12_elf_bfd_link_hash_table_create): New function, use the above. + (elf_backend_add_symbol_hook): Define. + (elf_m68hc11_howto_table): Use TRUE for pcrel relocs; fix masks. + +2003-04-18 Nick Clifton + + * format.c (bfd_check_format_matches): Only check associated + vector if the matching_vector has been created. + +2003-04-15 Alexandre Oliva + + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Fix typo in + 2003-04-09's change. + +2003-04-15 Brian Ford + + * peicode.h (coff_swap_scnhdr_in): If a section holds + uninitialized data and is from an object file or from an + executable image that has not initialized the s_size field, or if + the physical size is padded, use the virtual size (stored in + s_paddr) instead. + +2003-04-15 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Properly report + filename for alignment reduction. + +2003-04-15 Rohit Kumar Srivastava + + * archures.c: Replace occurrances of 'Hitachi' with 'Renesas'. + * reloc.c: Likewise. + * coff-h8300.c: Likewise. + * coff-h8500.c: Likewise. + * coff-sh.c: Likewise. + * cpu-h8300.c: Likewise. + * cpu-sh.c: Likewise. + * elf32-h8300.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sh64-com.c: Likewise. + * elf32-sh64.c: Likewise. + * elf64-sh64.c: Likewise. + * bfd-in2.h: Regenerate. + +2003-04-14 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Maintain maximum + alignment for common symbols. Warn reducing alignment for + common symbols. Report old filename when symbol size changes. + +2003-04-12 Alexandre Oliva + + * elfxx-mips.c (mips_elf_calculate_relocation): Adjust two other + occurrences of the same test changed in the previous patch. + Optimize. + +2003-04-11 Alexandre Oliva + + * elfxx-mips.c (mips_elf_get_global_gotsym_index): New. + (mips_elf_calculate_relocation): Decay GOT_PAGE/GOT_OFST to + GOT_DISP/addend only if the symbol got a global GOT entry. + +2003-04-10 Alexandre Oliva + + * elfxx-mips.c (mips_elf_calculate_relocation): Decay + GOT_PAGE/GOT_OFST referencing overridable symbol to + GOT_DISP/addend. + (_bfd_mips_elf_check_relocs): Handle GOT_PAGE referencing + global symbol as GOT_DISP. + +2003-04-10 Bob Wilson + + * elf32-xtensa.c (elf_xtensa_relocate_section): Don't continue to the + next relocation on an undefined symbol. + +2003-04-09 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section) : + Ignore relocations against r_symndx == 0. + +2003-04-09 H.J. Lu + + * elf64-alpha.c (elf64_alpha_relocate_section): Don't return + FALSE for undefined symbols. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + +2003-04-09 Alexandre Oliva + + * dwarf2.c (_bfd_dwarf2_find_nearest_line): Try DWARF3-standard + and IRIX-specific shift-to-64-bit 4-byte lengths before following + addr_size. + +2003-04-08 Alexandre Oliva + + * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): Detect (ctor) + pointer size from ABI, not arch_bits_per_address. + +2003-04-07 Kevin Buettner + + * elfn32-mips.c (elf32_mips_grok_prstatus): Adjust core file related + constants for n32 ABI. + +2003-04-06 Andrew Cagney + + * simple.c (bfd_simple_get_relocated_section_contents): Disable + free that leads to GDB vs BFD memory corruption. + +2003-04-04 Stephane Carrez + + * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Also adjust + symbols that mark the end of the section. + (m68hc11_elf_relax_section): Use R_M68HC11_PCREL_8 relocs when + converting to a relative branch so that the offset is computed after + the relaxation; also relocate a jsr into a bsr if possible but don't + relax them if they are to a far symbol as we need to call the + trampoline code. + (elf_m68hc11_howto_table): Set pcrel_offset to true. + +2003-04-04 Svein E. Seldal + + * archures.c: Namespace cleanup. Rename bfd_mach_c3x to + bfd_mach_tic3x and bfd_mach_c4x to bfd_mach_tic4x + * bfd-in2.h: Regenerate + * coff-tic4x.c: Namespace cleanup. Replace s/c4x/tic4x/ + * cpu-tic4x.c: Ditto + +2003-04-03 Nick Clifton + + * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Compute ps and ss + differently for object files and executables. + * peicode.h (coff_swap_scnhdr_in): Only set the s_size field + for object files or for executables who have not already + initialised the field. + * libpei.h (bfd_pe_executable_p): New macro. Return true if + the PE format bfd is an executable. + +2003-04-03 Alan Modra + + * elf32-ppc.c (ppc_elf_check_relocs): Don't use SYMBOL_REFERENCES_LOCAL + here as it's too early to reliably determine locality. + (ppc_elf_gc_sweep_hook): Likewise. + (SYMBOL_REFERENCES_LOCAL): Expand comment. + +2003-04-02 Bob Wilson + + * xtensa-modules.c: Remove comment indicating that this is a + generated file. + +2003-04-02 Alan Modra + + * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Test for NULL dynobj. + +2003-04-01 Bob Wilson + + * Makefile.am (ALL_MACHINES): Add cpu-xtensa.lo. + (ALL_MACHINES_CFILES): Add cpu-xtensa.c. + (BFD32_BACKENDS): Add elf32-xtensa.lo, xtensa-isa.lo, and + xtensa-modules.lo. + (BFD32_BACKENDS_CFILES): Add elf32-xtensa.c, xtensa-isa.c, and + xtensa-modules.c. + (cpu-xtensa.lo): New target. + (elf32-xtensa.lo): Likewise. + (xtensa-isa.lo): Likewise. + (xtensa-modules.lo): Likewise. + * Makefile.in: Regenerate. + * archures.c (bfd_architecture): Add bfd_{arch,mach}_xtensa. + (bfd_archures_list): Add bfd_xtensa_arch. + * config.bfd: Handle xtensa-*-*. + * configure.in: Handle bfd_elf32_xtensa_{le,be}_vec. + * configure: Regenerate. + * reloc.c: Add BFD_RELOC_XTENSA_{RTLD,GLOB_DAT,JMP_SLOT,RELATIVE, + PLT,OP0,OP1,OP2,ASM_EXPAND,ASM_SIMPLIFY}. + * targets.c (bfd_elf32_xtensa_be_vec): Declare. + (bfd_elf32_xtensa_le_vec): Likewise. + (bfd_target_vector): Add bfd_elf32_xtensa_{be,le}_vec. + * cpu-xtensa.c: New file. + * elf32-xtensa.c: Likewise. + * xtensa-isa.c: Likewise. + * xtensa-modules.c: Likewise. + * libbfd.h: Regenerate. + * bfd-in2.h: Likewise. + +2003-04-01 Nick Clifton + + * archures.c (bfd_mach_arm_unknown): Define. + * bfd-in.h (bfd_arm_merge_machines, bfd_arm+update_notes, + bfd_arm_get_mach_from_notes): Prototype. + * bfd-in2.h: Regenerate. + * coff-arm.c (coff_arm_merge_private_bfd_data): Call + bfd_arm_merge_machines. + (coff_arm_final_link_postscript): Call bfd_arm_update_notes. + * coffcode.h (coff_set_arch_mach_hook): Call + bfd_arm_get_mach_from_notes. + * coffgen.c (coff_real_object_p): Revert previous delta. + * cpu_arm.c (arm_check_note): New function. Examine a note in a + .note section. + (bfd_arm_merge_machines): New function: Handle the merging of ARM + binaries compiled for different architectures.. + (bfd_arm_update_notes): New function: Update an ARM note section. + (bfd_arm_get_mach_from_notes): New function: Extract a bfd machine + number from an ARM note section. + * elf32-arm.h (elf32_arm_object_p): Use + bfd_arm_get_mach_from_notes. + (elf32_arm_merge_private_bfd_data): Use bfd_arm_merge_machines. + (elf32_arm_final_write_processing): Use bfd_arm_update_notes. + +2003-04-01 Ben Elliston + + * dwarf2.c (read_attribute_value): Correct typo in comment. + +2003-04-01 Nick Clifton + + * dwarf2.c (concat_filename): Use bfd_malloc() and strdup() + instead of concat(). + (decode_line_info): Only free filename if it is not NULL. + (add_line_info): Make a copy of the filename when storing it into + the info structure. + +2003-03-31 Andreas Schwab + Daniel Jacobowitz + + * simple.c (bfd_simple_get_relocated_section_contents): Add + parameter symbol_table. Optionally use it instead of the symbol + table from the bfd. Save and restore output offsets and output + sections around bfd_get_relocated_section_contents. Fix a memory + leak. + (simple_save_output_info, simple_restore_output_info): New + functions. + * bfd-in2.h: Regenerate. + * dwarf2.c (read_abbrevs): Use + bfd_simple_get_relocated_section_contents instead of + bfd_get_section_contents. + (decode_line_info): Likewise. + (_bfd_dwarf2_find_nearest_line): Likewise. Don't call + find_rela_addend. + (find_rela_addend): Remove. + * elfxx-ia64.c (elfNN_ia64_reloc): Weaken sanity check for + debugging sections. + (elfNN_ia64_hash_table_create): Create the hash table with malloc, + not bfd_zalloc. + +2003-03-31 David Heine + + * aoutx.h (aout_link_hash_table_create): Use bfd_malloc instead of + bfd_alloc. + * dwarf2.c (concat_filename): Always allocate space for the + returned filename. + (decode_line_info): Free the allocated filename returned by + concat_filename. + * elf-eh-frame.c (bfd_elf_write_section_eh_frame): Fix memory leaks. + * elf.c (copy_private_bfd_data): Likewise. + (_bfd_elf_slurp_version_tables): Fix bug freeing contents pointer. + * elflink.h (elf_link_sort_relocs): Fix memory leak. + * format.c (bfd_check_format_matches): Likewise. + * linker.c (bfd_generic_final_link): Likewise. + * opncls.c (find_separate_debug_info): Likewise. + * simple.c (bfd_simple_get_relocated_section_contents): Likewise. + +2003-03-28 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Correctly combine + visibilities. + +2003-03-27 Jakub Jelinek + + * elfxx-ia64.c (elfNN_ia64_relax_section): Reset self_dtpmod_offset + to -1 before recomputing got offsets. + +2003-03-26 Andreas Schwab + + * elf32-m68k.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (elf_m68k_relocate_section): Use it to correctly handle symbols + forced to be local. + (elf_m68k_finish_dynamic_symbol): Emit RELATIVE reloc for got + entries for symbols that are forced to be local. + +2003-03-25 Alexandre Oliva + + * elfxx-mips.c (_bfd_mips_relax_section): New function. + * elfxx-mips.h (_bfd_mips_relax_section): Declare. + * elfn32-mips.c, elf64-mips.c: Use it. + +2003-03-25 Stan Cox + Nick Clifton + + Contribute support for Intel's iWMMXt chip - an ARM variant: + + * archures.c: Add bfd_mach_arm_iWMMXt. + * reloc.c: Add BFD_RELOC_ARM_CP_OFF_IMM_S2. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * coff-arm.c (coff_arm_merge_private_bfd_data): Allow iWMMXt + object files to be linked with XScale ones. + (coff_arm_final_link_postscript): Update note section. + * coffcode.h (coff_set_arch_mach_hook): Handle note section. + * coffgen.c (coff_real_object_p): Call bfd_coff_set_arch_mach_hook + after identifying a coff binary. + * cpu-arm.c (processors): Add iWMMXt. + (arch_inf): Likewise. + * elf32-arm.h (arm_object_p): Handle note section. + (elf32_arm_merge_private_bfd_data): Allow iWMMXt object files to + be linked with XScale ones. + (elf32_arm_section_flags): New function: Set flags on note section. + (elf32_arm_final_write_processing): Handle note section. + +2003-03-21 DJ Delorie + + * elf32-xstormy16.c (elf32_xstormy16_relocate_section): Call + _bfd_elf_rela_local_sym. + +2003-03-20 H.J. Lu + + * elfxx-ia64.c (elfNN_ia64_relax_section): Don't try relax for + non-ELF outputs. + +2003-03-20 Nick Clifton + + * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Initialise $idata2 and + $idata5 in case bfd_coff_final_link is not called. + +2003-03-19 Jakub Jelinek + + * elf64-sparc.c (struct sparc64_elf_section_data): Add reloc_count + field. + (canon_reloc_count): Define. + (sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table, + sparc64_elf_canonicalize_dynamic_reloc): Use it instead of + reloc_count. + (sparc64_elf_canonicalize_reloc): New routine. + (bfd_elf64_canonicalize_reloc): Define. + +2003-03-18 Jakub Jelinek + + * elfxx-ia64.c (elfNN_ia64_relax_section): Handle relaxation + againt mergeable sections. Take r_addend into account when caching + trampolines. + +2003-03-18 Richard Henderson + + * elfxx-ia64.c (get_dyn_sym_info): Return NULL gracefully for + local symbols that have no dyninfo. + +2003-03-14 Gene Smith + + * ieee.c (ieee_write_expression): Handle the case where symbol is + NULL. + General formatting improvements. + +2003-03-13 Nick Clifton + + * configure.in (LINGUAS): Add zh_CN. + * configure: Regenerate. + * po/zh_CN.po: New file. + +2003-03-13 Elias Athanasopoulos + + * aout-cris.c (BYTES_IN_WORD): Don't define. + aout-encap.c: Likewise. + aout-ns32k.c: Likewise. + aout-tic30.c: Likewise. + hp300bsd.c: Likewise. + i386aout.c: Likewise. + i386dynix.c: Likewise. + i386linux.c: Likewise. + i386lynx.c: Likewise. + i386mach3.c: Likewise. + m68k4knetbsd.c: Likewise. + m68klinux.c: Likewise. + m68klynx.c: Likewise. + m68knetbsd.c: Likewise. + m88kmach3.c: Likewise. + mipsbsd.c: Likewise. + newsos3.c: Likewise. + sparclinux.c: Likewise. + sparclynx.c: Likewise. + sparcnetbsd.c: Likewise. + vaxbsd.c: Likewise. Fix comment formatting. + +2003-03-12 Alexandre Oliva + + * Reverted 2003-03-02's patch. + + * elfxx-target.h (bfd_elfNN_canonicalize_reloc): Make it + overridable. + * elf64-mips.c (mips_elf64_canonicalize_reloc, + mips_elf64_get_dynamic_reloc_upper_bound, + mips_elf64_canonicalize_dynamic_reloc): New, adapted from elf.c. + (bfd_elf64_get_canonicalize_reloc, + bfd_elf64_get_dynamic_reloc_upper_bound, + bfd_elf64_canonicalize_dynamic_reloc): Define. + (mips_elf64_slurp_reloc_table): Support dynamic. + (mips_elf64_slurp_one_reloc_table): Adjust. + +2003-03-12 Nick Clifton + + * xsym.c (bfd_sym_fetch_type_information_table_entry): Change + 'index' to 'offset' in test for zero value. + +2003-03-11 Alexandre Oliva + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Do not create + dynamic relocations pointing to local or section symbols, use the + NULL symbol instead. Document the choice to not emit an + additional R_MIPS_64 relocation. + +2003-03-11 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Subtract tls seg vma from + zero index dynamic tls relocs generated for the GOT. Tidy code. + Set "relocation" to 1 on DTPMOD32 relocs. Optimize HA adjustment. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + +2003-03-07 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Don't look for a nop after + a tls_get_addr call. + + * elf32-ppc.c (ELIMINATE_COPY_RELOCS): Define as one. + (ppc_elf_adjust_dynamic_symbol): For weak symbols, copy + ELF_LINK_NON_GOT_REF from weakdef. + * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define as one. + (ppc64_elf_adjust_dynamic_symbol): For weak symbols, copy + ELF_LINK_NON_GOT_REF from weakdef. + * elf32-i386.c (ELIMINATE_COPY_RELOCS): Define as one. Use throughout. + (elf_i386_adjust_dynamic_symbol): For weak symbols, copy + ELF_LINK_NON_GOT_REF from weakdef. + +2003-03-06 Jakub Jelinek + Andrew Haley + + * elflink.h (elf_bfd_discard_info): Don't process eh frames if + output is relocateable. + +2003-03-06 Steven Konopa + + * som.c (som_fixup_formats): Correct formats for R_AUX_UNWIND and + R_COMMENT. + +2003-03-06 Alan Modra + + * elf32-ppc.c (ppc_elf_create_linker_section): Don't capitalize + error messages. + (ELIMINATE_COPY_RELOCS): Define to zero. + (ppc_elf_relocate_section): Don't deref htab->tls_sec when calculating + TLSLD relocs. Report reloc types on a number of errors. Optimize + LOCAL24PC check for non-local syms. Don't capitalize error messages. + * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define to zero. + (ppc64_elf_relocate_section): Don't deref htab->tls_sec when + calculating TLSLD relocs. Report reloc types on a number of errors. + Don't capitalize error messages. + +2003-03-03 H.J. Lu + + * elfxx-ia64.c (USE_BRL): Removed. + (oor_ip): Removed. + +2003-03-03 J"orn Rennecke + + * elf32-sh.c (sh_elf_howto_tab): Make R_SH_IND12W into an ordinary + relocation (no special function), and make it non-partial_inplace. + (sh_elf_relax_section): When creating a bsr, use a consistent value + no matter if the symbol is extern or not; set addend to -4. + Don't swap load / non-load instructions for SH4. + (sh_elf_relax_delete_bytes): In R_SH_IND12W case, check the offset + rather than if the symbol is external to determine if adjusting the + offset makes sense. Adjust the addend too if appropriate. + (sh_elf_relocate_section): In R_SH_IND12W, don't fiddle with the + relocation. + +2003-03-03 Nick Clifton + + * po/da.po: Installed latest translation. + +2003-03-02 Thiemo Seufer + + * elf32-mips.c (elf_mips_howto_table_rel): Change definition of + R_MIPS_PC16 to rightshift 2. + (elf_reloc_map mips_reloc_map): Map to rightshifted BFD reloc. + (bfd_elf32_bfd_reloc_type_lookup): Support + BFD_RELOC_MIPSEMB_16_PCREL_S2. + * elf64-mips.c (mips_elf64_howto_table_rel): Change definition of + R_MIPS_PC16 to rightshift 2. + (mips_elf64_howto_table_rela): Likewise. + (mips_reloc_map): Map to rightshifted BFD reloc. + * elfn32-mips.c: The same as in elf64-mips.c. + * elfxx-mips.c (mips_elf_got_for_ibfd): Typo in comment. + (mips_elf_calculate_relocation): Handle rightshifted addends for + R_MIPS_PC16. + * reloc.c (BFD_RELOC_MIPSEMB_16_PCREL_S2): New BFD relocation for + MIPS Embedded PIC. Remove superfluous empty COMMENT. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2003-02-28 Richard Henderson + + * elfxx-ia64.c (elfNN_ia64_relax_section): Correct bounds + for ltoff22x relaxation. + +2003-03-01 Alan Modra + + * bfd-in.h (_bfd): Don't define. + * bfd.c: Rename occurrences of "struct _bfd" to "struct bfd". + * syms.c: Likewise. + * bfd-in2.h: Regenerate. + +2003-02-27 Richard Henderson + + * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add want_gotx; + (elfNN_ia64_check_relocs): Set it. + (allocate_global_data_got): Check it. + (allocate_local_got): Likewise. + (allocate_dynrel_entries): Likewise. + (elfNN_ia64_relax_ldxmov): New. + (elfNN_ia64_relax_section): Handle LTOFF22X, LDXMOV. + (elfNN_ia64_choose_gp): Split out from ... + (elfNN_ia64_final_link): ... here. + +2003-02-27 Andrew Cagney + + * bfd.c (struct bfd): Rename "struct _bfd". + * bfd-in.h: Update copyright. + (struct bfd): Rename "struct _bfd". + (_bfd): Define for backward compatibility. + * bfd-in2.h: Regenerate. + +2003-02-25 Alan Modra + + * elflink.h (elf_bfd_final_link): Apportion reloc counts to rel_hdr + and rel_hdr2 when initially counting input relocs rather than after + creating output reloc sections. + (elf_link_read_relocs_from_section): Don't abort with wrong reloc + sizes. + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2003-02-24 Kris Warkentin + + * elf.c (elfcore_read_notes): Add check for QNX style core file. + (elfcore_grog_nto_note): New function. + (elfcore_grog_nto_gregs): New function. + (elfcore_grog_nto_status): New function. + +2003-02-24 Alan Modra + + * elflink.c (_bfd_elf_create_got_section): Check existing .got + section flags before concluding that we've already been called. + Don't use register keyword. + (_bfd_elf_create_dynamic_sections): Don't use register keyword. + (_bfd_elf_create_linker_section): Formatting. + +2003-02-20 jmc + + * coff-h8300.c: Fix typo: intial -> initial. + * coff-ppc.c: Likewise. + +2003-02-20 Alan Modra + + * elf32-ppc.c: Formatting. + (allocate_dynrelocs): LD and GD relocs against the same sym need + separate GOT entries. + (ppc_elf_relocate_section): Correct GOT handling for multiple GOT + entries per symbol. + +2003-02-19 Alan Modra + + * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Simplify dynamic reloc + removal. Localize vars. Remove unnecessary dynobj test. + * elf32-i386 (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead + of INFO. + (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses, + and optimize. + (elf_i386_relocate_section): Likewise. + (elf_i386_gc_sweep_hook): Simplify dyn reloc removal. Localize vars. + * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise. + * elf32-sh.c (sh_elf_gc_sweep_hook): Likewise. + * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise. + * elf64-x86-64.c (elf64_x86_64_gc_sweep_hook): Likewise. + * elf32-sparc.c (elf32_sparc_gc_sweep_hook): Likewise. Remove + local_dynrel for section too. Don't touch HIPLT22, LOPLT10, PCPLT32 + or PCPLT10 relocs. Don't subtract twice on PLT32 relocs. + Formatting. + + * elf64-ppc.c (ELIMINATE_COPY_RELOCS): Define. + (ppc64_elf_check_relocs): Use it. Correct comment. Move SEC_ALLOC + test. + (ppc64_elf_adjust_dynamic_symbol): Use ELIMINATE_COPY_RELOCS. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO. + (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses, + and optimize. Use ELIMINATE_COPY_RELOCS. + (ppc64_elf_relocate_section): Likewise. + + * elf32-ppc.c (struct ppc_elf_dyn_relocs): Add pc_count field. + (ppc_elf_copy_indirect_symbol): Copy pc_count field. + (ELIMINATE_COPY_RELOCS): Define. + (ppc_elf_adjust_dynamic_symbol): Convert copy relocs to dynamic. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Pass SHARED instead of INFO. + (MUST_BE_DYN_RELOC): Define. + (allocate_dynrelocs): Adjust WILL_CALL_FINISH_DYNAMIC_SYMBOL uses, + and optimize. Trim dyn_relocs. + (ppc_elf_check_relocs): Don't generate dyn_relocs when we know they'll + not be used. Do generate dyn_relocs for copy reloc avoidance. Keep + track of pc_rel dyn relocs. + (ppc_elf_relocate_section): Remove "will_become_local". Adjust + WILL_CALL_FINISH_DYNAMIC_SYMBOL use. Trim dyn relocs as per + allocate_dynrelocs. Don't recalculate "sec". + +2003-02-18 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Remove unnecessary test. + * elf64-ppc.c (ppc64_elf_tls_optimize): Decrement tlsld_got.refcount + on invalid LD relocs. + (allocate_dynrelocs): Invalid LD relocs don't use tlsld_got entry. + (ppc64_elf_relocate_section): Unify new handling of LD relocs and + tlsld_got entry. Use IS_PPC64_TLS_RELOC. + + * elf32-ppc.h: New file. + * elf32-ppc.c: Include elf32-ppc.h. + (NOP, CROR_151515, CROR_313131, TP_OFFSET, DTP_OFFSET): Define. + (struct ppc_elf_link_hash_entry): Rename "root" to "elf". Adjust uses. + Add "tls_mask" field. + (TLS_GD, TLS_LD, TLS_TPREL, TLS_DTPREL, TLS_TLS, TLS_TPRELGD): Define. + (struct ppc_elf_link_hash_table): Rename "root" to "elf". Adjust uses. + Add got, relgot, plt, relplt, dynbss, relbss, dynsbss, relsbss, + sdata, sdata2, tls_sec, tls_get_addr, tlsld_got fields. + Make use of htab shortcuts throughout file. + (ppc_elf_link_hash_newfunc): Init tls_mask field. + (ppc_elf_link_hash_table_create): Init new fields. + (ppc_elf_copy_indirect_symbol): Copy tls_mask. + (ppc_elf_howto_raw): Add tls relocs. + (ppc_elf_reloc_type_lookup): Handle them. + (ppc_elf_unhandled_reloc): New function. + (ppc_elf_create_got): Stash got section pointer in hash table, + return status. Make .rela.got too. + (ppc_elf_create_dynamic_sections): Stash section pointers in htab. + (ppc_elf_adjust_dynamic_symbol): Only set up copy relocs when + NON_GOT_REF set. Don't allocate space in .plt here.. + (allocate_dynrelocs): ..do so here instead, properly ref-counting and + not allocating plt entries unnecessarily. Allocate got entries here. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): Define. + (ppc_elf_size_dynamic_sections): Allocate local got entries. Pass + "info" during allocate_dynrelocs hash traversal. Use htab section + shortcuts rather than searching for named sections. Get rid of + "plt" and "strip" booleans. + (update_local_sym_info, bad_shared_reloc): New functions. + (ppc_elf_check_relocs): Handle TLS relocs. Move .rela.got creation to + ppc_elf_create_got. Don't mark got or plt reloc syms dynamic, do so + in allocate_dynreloc. Use update_local_sym_info and bad_shared_reloc. + Disallow R_PPC_EMB_RELSDA, R_PPC_EMB_NADDR32, R_PPC_EMB_NADDR16, + R_PPC_EMB_NADDR16_LO, R_PPC_EMB_NADDR16_HI and R_PPC_EMB_NADDR16_HA + in shared libs. R_PPC_PLTREL32 is a plt reloc too. Refcount all + relocs that might use a plt entry. Set NON_GOT_REF too. + Enumerate all do-nothing relocs. + (ppc_elf_gc_sweep_hook): Simplify removal of dynrelocs. Handle + tls relocs and all plt relocs. + (ppc_elf_tls_setup, ppc_elf_tls_optimize): New functions. + (ppc_elf_finish_dynamic_symbol): Don't build got entries here. + (ppc_elf_finish_dynamic_sections): Rewrite tag code using htab + shortcuts. + (ppc_elf_relocate_section): Tidy. Handle TLS relocs. Use + bfd_elf_local_sym_name. Simplify unresolved reloc code. Build got + entries and got relocs here. Warn on non-zero got reloc addend. + Split out branch taken/not taken reloc code into a separate switch + and correct offset calculation. Allow BRTAKEN/BRNTAKEN dynamic relocs. + Split out HA reloc adjustments to separate switch statement. Don't + warn on reloc overflow if we've already warned about undefined. + Don't rebuild sym name when reporting errors. Report all possible + errors from _bfd_final_link_relocate. + (bfd_elf32_bfd_final_link): Don't define. + +2003-02-18 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Don't init "r". Don't + rebuild sym name when reporting errors. + +2003-02-17 Nick Clifton + + * elflink.h (elf_link_output_extsym): Only check + allow_shlib_undefined for shared libraries. + * elf32-i386.c (elf_i386_relocate_section): Remove bogus check + of allow_shlib_undefined. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Likewise. + * elf64-hppa.c (elf64_hppa_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise. + +2003-02-17 Nick Clifton + + * elf.c (SEGMENT_AFTER_SEGMENT): Add third parameter - the + address field to use in the comparison. + (SEGMENT_OVERLAPS): Check that LMAs overlap as well. + +2003-02-14 Bob Wilson + + * elfcore.h (elf_core_file_p): Compare alternate machine codes for ELF + backends when checking if the generic ELF target should be used. + + * syms.c (_bfd_stab_section_find_nearest_line): For line number stabs + outside of functions, treat values as absolute addresses. + + * bfd.c: Change embedded documentation to use consistent indentation + and to split up long lines. Change informal style of description + for functions lacking real documentation. + * coffcode.h: Break up long lines in embedded documentation. + * format.c: Likewise. + * targets.c: Likewise. + * libcoff.h: Regenerate. + * bfd-in2.h: Regenerate. + +2003-02-14 Alan Modra + + * elf64-ppc.c (ppc64_elf_link_hash_table_create): Init tls_get_addr. + (ppc64_elf_copy_indirect_symbol): Merge tls_mask too. + (ppc64_elf_gc_sweep_hook): Simplify removal of dyn_relocs. + (allocate_dynrelocs): Don't treat undefined and undefweak specially. + (ppc_size_one_stub): Fix warning, and tighten plt entry check. + (group_sections): Don't share a stub section if stubs are for a large + section. Adjust comment. + (ppc64_elf_size_stubs): Roughly double the size left for stubs if + !stubs_always_before_branch. + (ppc64_elf_relocate_section): Initialize tlsld GOT entry once. Don't + treat undefined and undefweak specially when processing dyn relocs. + +2003-02-13 Jakub Jelinek + + * elflink.h (elf_link_add_object_symbols): Handle .symver x, x@FOO. + +2003-02-13 Nick Clifton + + * elf32-arm.h (elf32_thumb_to_arm_stub): Include section VMAs + in computation of offset to insert into BL instruction. + +2003-02-11 Uwe Stieber + + * config.bfd: Add support for kaOS as cross build target system. + +2003-02-11 Alan Modra + + * elf64-ppc.c (ppc64_elf_check_relocs): Match versioned + .__tls_get_addr too. + (ppc64_elf_tls_setup): Ensure cached tls_get_addr is not indirect. + +2003-02-10 Kaz kojima + + * elf32-sh.c (elf_sh_dyn_relocs): Add tls_tpoff32 field. + (elf_sh_link_hash_entry): Remove tls_tpoff32 field. + (sh_elf_link_hash_newfunc): Remove the initialization of + tls_tpoff32 field. + (allocate_dynrelocs): Keep dyn_relocs if it includes the entry + for which tls_tpoff32 flag is set. + (sh_elf_relocate_section): Covert to LE only if the dyn_relocs + of the symbol includes the entry matched with the input_section + and having tls_tpoff32 flag on. When linking statically, set + symbol index of R_SH_TLS_TPOFF32 relocation to zero if the symbol + is defined in this executable. + (sh_elf_check_relocs): Set tls_tpoff32 flag appropriately. + +2003-02-10 Jakub Jelinek + + * elf32-s390.c (elf_s390_size_dynamic_sections): Set relocs to TRUE + even if there is just non-empty .rela.plt. + +2003-02-10 Nick Clifton + + * archures.c (bfd_mach_arm_ep9312): Define. + * bfd-in2.h: Regenerate. + * cpu-arm.c (processors[]): Add ep9312. + (bfd_arm_arch): Add ep9312. + * elf32-arm.h (elf32_arm_merge_private_data): Update error + messages and add test for Maverick floating point support. + (elf32_arm_print_private_bfd_data): Handle + EF_ARM_MAVERICK_FLOAT flag. + (elf32_arm_object_p): New function. + (elf_backend_object_p): Define. + +2003-02-10 Alan Modra + + * elf64-ppc.c: Rename assorted occurrences of tls_type and similar + variables, structure fields or function params to tls_mask or + similar to better reflect usage. + (struct got_entry): Comment. + (struct ppc_link_hash_entry): Expand comment, and renumber TLS_*. + (get_tls_mask): Rename from get_tls_type. + +2003-02-09 Alan Modra + + * elf64-ppc.c (TLS_GD_LD): Don't define.. + (TLS_GD): ..define this instead and update all uses. + (TLS_TPRELGD): Define. + (ppc64_elf_link_hash_table_create): Tweak initialization of + init_refcount and init_offset. + (ppc64_elf_check_relocs): Add one extra element to t_symndx array. + Mark second slot of GD or LD toc entries. + (get_tls_type): Return an int. Distinguish toc GD and LD entries + from other tls types. + (ppc64_elf_tls_setup): New function, split out from.. + (ppc64_elf_tls_optimize): ..here. Don't optimize when symbols are + defined in a dynamic object. Fix LD optimization. Don't set TLS_TPREL + on GD->IE optimization, use TLS_TPRELGD instead. Use get_tls_type + return value to properly decide whether toc GD and LD entries can + optimize away __tls_get_addr call. Check next reloc after DTPMOD64 + to determine GD or LD rather than looking at TLS_LD flag. Don't + attempt to adjust got entry tls_type here.. + (allocate_dynrelocs): ..instead, adjust got entry tls_type here, and + look for possible merges. + (ppc64_elf_size_dynamic_sections): Adjust local got entries for + optimization. + (ppc64_elf_size_stubs): Tweak __tls_get_addr fudge. + (ppc64_elf_relocate_section): Rename some vars to better reflect usage. + Make use of return value from get_tls_type to properly detect GD and + LD optimizations. Split tlsld/gd hi/ha from lo/ds case. Don't + handle tls_get_addr removal when looking at REL24 relocs, do it when + looking at the previous reloc. Check reloc after DTPMOD64 to determine + GD or LD. + * elf64-ppc.h (ppc64_elf_tls_setup): Declare. + +2003-02-08 Alan Modra + + * elf32-hppa.c (group_sections): Don't share a stub section if + stubs are for a large section. + + * elf32-hppa.c (elf32_hppa_size_stubs): Double the size left for + stubs if !stubs_always_before_branch. + +2003-02-07 Nick Clifton + + * elf.c (swap_out_syms): Generate an error message if an + equivalent output section cannot be found for a symbol. + +2003-02-07 Jakub Jelinek + + * elf64-alpha.c (elf64_alpha_relax_section): Don't crash if + local_got_entries is NULL. + +2003-02-06 Andreas Schwab + + * elf-eh-frame.c (get_DW_EH_PE_signed): Define. + (read_value): Add parameter is_signed, use signed extraction if + the value is signed. + (_bfd_elf_write_section_eh_frame): Pass signed flag of the + encoding to read_value. + +2003-02-06 Alan Modra + + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy got and + plt info when called to transfer weak sym info. + +2003-02-05 Alan Modra + + * reloc.c: Add PPC and PPC64 TLS relocs. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * elf64-ppc.c (TP_OFFSET, DTP_OFFSET): Declare. + (ppc64_elf_howto_raw): Add TLS howto's. Adjust R_PPC64_NONE to be + against a 32 bit field. + (ppc64_elf_reloc_type_lookup): Handle TLS relocs. + (_ppc64_elf_section_data): Add t_symndx and comments. + (ppc64_elf_section_data): Use elf_section_data macro. + (ppc64_elf_new_section_hook): American spelling. + (struct got_entry, struct plt_entry): New. + (MUST_BE_DYN_RELOC): Rename from IS_ABSOLUTE_RELOC. + (struct ppc_stub_hash_entry): Add "addend" field. + (struct ppc_link_hash_entry): Add "tls_type". + (TLS_TLS, TLS_GD_LD, TLS_LD, TLS_TPREL, TLS_DTPREL, + TLS_EXPLICIT): Define. + (struct ppc_link_hash_table): Add tls_sec, tls_get_addr, tlsld_got. + (link_hash_newfunc): Init new fields. + (ppc64_elf_link_hash_table_create): Likewise. Set init_refcount and + init_offset to NULL. + (ppc64_elf_copy_indirect_symbol): Copy got and plt info. Don't call + _bfd_elf_link_hash_copy_indirect, rather insert relevant code from + there. + (update_local_sym_info, update_plt_info): New functions. + (ppc64_elf_check_relocs): Use them. Handle TLS relocs. Adjust GOT + handling to use got.glist rather than got.refcount. Likewise for PLT. + (ppc64_elf_gc_sweep_hook): Handle TLS relocs, new GOT and PLT lists. + (func_desc_adjust): Adjust for new PLT list. + (ppc64_elf_adjust_dynamic_symbol): Likewise. + (get_sym_h, get_tls_type): New functions. + (ppc64_elf_edit_opd): Remove unused variable. Use get_sym_h. + (ppc64_elf_tls_optimize): New function. + (allocate_dynrelocs): Adjust for new PLT and GOT lists. Allocate + TLS relocs. + (ppc64_elf_size_dynamic_sections): Likewise. + (ppc_type_of_stub): Adjust for new PLT list. + (ppc_build_one_stub): Likewise. + (ppc64_elf_size_stubs): Likewise. Use get_sym_h. Treat __tls_get_addr + calls specially. + (ppc64_elf_relocate_section): Adjust for new GOT and PLT lists. Handle + TLS relocs. Report local syms using bfd_elf_local_sym_name. Don't + init GOT entries that have a reloc. Generate GOT relocs here.. + (ppc64_elf_finish_dynamic_symbol): ..not here. Adjust for PLT list. + * elf64-ppc.h (ppc64_elf_tls_optimize): Declare. + +2003-02-04 Andreas Schwab + + * elf32-m68k.c (elf_m68k_hash_entry): Define. + (elf_m68k_link_hash_traverse): Remove. + (elf_m68k_link_hash_newfunc): Use struct bfd_hash_entry and + elf_m68k_hash_entry instead of struct elf_m68k_link_hash_entry to + reduce casting. + (elf_m68k_check_relocs): Use elf_m68k_hash_entry instead of + casting. + (elf_m68k_size_dynamic_sections): Use elf_link_hash_traverse + instead of elf_m68k_link_hash_traverse. + (elf_m68k_discard_copies): Change first parameter to pointer to + struct elf_link_hash_entry and use elf_m68k_hash_entry when struct + elf_m68k_link_hash_entry is needed. + +2003-02-04 Alan Modra + + * elf-bfd.h (struct got_entry, struct plt_entry): Forward declare. + (struct elf_link_hash_entry): Add "glist" and "plist" fields to + "got" union, and declare as gotplt_union. Use gotplt_uinion for + "plt" field. + (struct elf_link_hash_table): Make "init_refcount" a gotplt_union. + Add "init_offset" field. + (struct elf_obj_tdata ): Add "struct got_entry **" to union. + (elf_local_got_ents): Declare. + * elf.c (_bfd_elf_link_hash_newfunc): Adjust initialization of "got" + and "plt". + (_bfd_elf_link_hash_hide_symbol): Use "init_offset". + (_bfd_elf_link_hash_table_init): Set "init_offset". + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set init_refcount + from init_offset. + (elf_adjust_dynamic_symbol): Set plt and got offsets using init_offset. + + * elf.c (bfd_elf_local_sym_name): Split out from.. + (group_signature): ..here. + * elf-bfd.h (bfd_elf_local_sym_name): Declare. + +2003-02-04 Alan Modra + + * elf-bfd.h (enum elf_link_info_type): Remove. + (struct bfd_elf_section_data): Move sec_info_type, use_rela_p fields + to struct sec. Remove linkonce_p field. + (elf_linkonce_p): Delete. + (elf_discarded_section): Update for sec_info_type change. + * section.c (struct sec): Add sec_info_type, use_rela_p, has_tls_reloc, + flag11, flag12, flag13, flag14, flag15, flag16, flag20, flag24. + (ELF_INFO_TYPE_NONE): Define. + (ELF_INFO_TYPE_STABS): Define. + (ELF_INFO_TYPE_MERGE): Define. + (ELF_INFO_TYPE_EH_FRAME): Define. + (ELF_INFO_TYPE_JUST_SYMS): Define. + (STD_SECTION): Update struct sec initializer. + * ecoff.c (bfd_debug_section): Likewise. + * elf.c: Likewise. Update occurrences of sec_info_type and use_rela_p. + * elflink.h: Likewise. + * elf-eh-frame.c: Likewise. + * elf64-alpha.c: Likewise. + * elfxx-ia64.c: Likewise. + * elfxx-mips.c: Likewise. + * bfd-in2.h: Regenerate. + + * elf32-sparc.c (sec_do_relax): Use elf_section_data macro rather than + referring to used_by_bfd. + * elf64-sparc.c (sec_do_relax): Likewise. + * elf64-mmix.c (mmix_elf_section_data): Likewise. + * elfxx-mips.c (mips_elf_section_data): Likewise. + * ieee.c (ieee_slurp_section_data): Use ieee_per_section macro. + (ieee_get_section_contents): Likewise. + (ieee_new_section_hook): Formatting. + (ieee_canonicalize_reloc): Remove commented out code. + * mmo.c (mmo_section_data): Define. Use throughout file. + * oasys.c (oasys_get_section_contents): Use oasys_per_section macro. + +2003-01-31 Graydon Hoare + + * Makefile.am (opncls.lo): Add dependency upon libiberty.h. + * Makefile.in: Regenerate. + * opncls.c (calc_crc32, get_debug_link_info, + seperate_debug_file_exists, find_seperate_debug_file): New + internal functions. + (bfd_follow_gnu_debuglink): New function. Follow the pointer + contained inside a .gnu_debuglink section. + * bfd-in2.h: Regenerate. + +2003-01-29 Alexandre Oliva + + * elfxx-mips.c (mips_elf_got_entry_hash): Don't dereference + entry->abfd when it's NULL. + +2003-01-27 Alexandre Oliva + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Handle + _bfd_elf_section_offset returning -2 the same way as -1. + + * elfxx-mips.c (mips_elf_multi_got): New function. + (struct mips_got_entry): Make symndx and gotidx signed. Moved + addend into union along with address and link hash entry. + (struct mips_got_info): Added bfd2got and next. + (struct mips_elf_hash_sort_data): Added max_unref_got_dynindx. + (mips_elf_got_section, mips_elf_create_got_section): Use + SEC_EXCLUDE bit to tell whether we really need the got + section. Take boolean arguments to disregard an excluded + section, or to create it as excluded. Adjust all callers. + Use mips_elf_got_section all over. + (mips_elf_local_got_index, mips_elf_got_page, + mips_elf_got16_entry): Take input bfd as argument, and pass it + on to mips_elf_create_local_got_entry. + (mips_elf_global_got_index, mips_elf_create_local_got_entry): + Take input bfd as argument, and manage entries in the + appropriate GOT. + (mips_elf_got_offset_from_index): Take input bfd as argument, + and use it to adjust the GP offset of the bfd. + (mips_elf_sort_hash_table, mips_elf_sort_hash_table_f): Move + unreferenced GOT entries of global symbols to the end. + (mips_elf_record_global_got_symbol): Take input bfd as + argument. Add entries to the master GOT hash table. + (struct mips_elf_bfd2got_hash): New. + (struct mips_elf_got_per_bfd_arg): New. + (struct mips_elf_set_global_got_offset_arg): New. + (mips_elf_hash_bfd_vma, mips_elf_multi_got_entry_hash, + mips_elf_multi_got_entry_eq, mips_elf_bfd2got_entry_hash, + mips_elf_bfd2got_entry_eq, mips_elf_make_got_per_bfd, + mips_elf_merge_gots, mips_elf_set_global_got_offset, + mips_elf_resolve_final_got_entry, + mips_elf_resolve_final_got_entries, mips_elf_adjust_gp, + mips_elf_got_for_ibfd): New functions. + (ELF_MIPS_GP_OFFSET): Don't depend on SGI_COMPAT. + (MIPS_ELF_GOT_MAX_SIZE): New macro. + (STUB_LW): Generate 64-bit stub regardless of SGI_COMPAT. + (mips_elf_got_entry_hash): Take new fields into account. Use + mips_elf_hash_bfd_vma. + (mips_elf_got_entry_eq): Take new fields into account. + (mips_elf_create_got_section): Initialize new fields. + (mips_elf_calculate_relocation): Pass input_bfd to functions + that now take it. Adjust gp for the input_bfd. + (mips_elf_allocate_dynamic_relocation, + mips_elf_create_dynamic_relocation, + _bfd_mips_elf_create_dynamic_sections): Use... + (mips_elf_rel_dyn_section): New function. Borrow code from... + (_bfd_mips_elf_check_relocs): Pass input_bfd to functions that + now take it. Create the got section if needed, even if + excluded, before recording a global got symbol. Move some + code to... + (mips_elf_record_local_got_symbol): New fn. + (_bfd_mips_elf_size_dynamic_sections): Disable combreloc. + Compute multi-got global entries offsets. Move GOT code to... + (_bfd_mips_elf_always_size_sections): Call mips_elf_multi_got + if the GOT is too big. + (_bfd_mips_elf_finish_dynamic_symbol): Set got entry of + undefweak symbol to zero. Generate dynamic relocations for + non-primary GOT entries for global symbols. + (_bfd_mips_elf_finish_dynamic_sections): Handle multi-got + case. Generate dynamic relocations for local got entries. + Sort dynamic relocations on N64 too, using... + (sort_dynamic_relocs_64): New fns. + (_bfd_mips_elf_hide_symbol): Adjust multi-got counters. + (_bfd_mips_elf_merge_private_bfd_data): Ignore EF_MIPS_XGOT. + +2003-01-27 Alexandre Oliva + + * bfd.c (struct _bfd): Added id field. + * opncls.c (_bfd_id_counter): New static variable. + (_bfd_new_bfd): Use it. + * bfd-in2.h: Rebuilt. + +2003-01-25 Alan Modra + + * elf32-sparc.c (bfd_elf32_new_section_hook): Define. + +2003-01-25 Jakub Jelinek + + * elf32-sparc.c (_bfd_sparc_elf_howto_table): Add TLS relocs. + (elf32_sparc_rev32_howto): New variable. + (sparc_reloc_map): Add TLS relocs. + (elf32_sparc_reloc_type_lookup, elf32_sparc_info_to_howto): + Handle REV32. + (sparc_elf_hix22_reloc, sparc_elf_lox10_reloc, elf32_sparc_mkobject): + New functions. + (struct elf32_sparc_dyn_relocs, struct elf32_sparc_link_hash_entry, + struct elf32_sparc_link_hash_table): + New structures. + (elf32_sparc_tdata, elf32_sparc_local_got_tls_type, + elf32_sparc_hash_table): Define. + (link_hash_newfunc, elf32_sparc_link_hash_table_create, + create_got_section, elf32_sparc_create_dynamic_sections, + elf32_sparc_copy_indirect_symbol, elf32_sparc_tls_transition): New + functions. + (elf32_sparc_check_relocs): Handle TLS relocs. Add dynamic reloc + reference counting. + (elf32_sparc_gc_sweep_hook): Likewise. + (elf32_sparc_adjust_dynamic_symbol): Likewise. + (elf32_sparc_size_dynamic_sections): Likewise. + (elf32_sparc_relocate_section): Likewise. + (allocate_dynrelocs, readonly_dynrelocs, dtpoff_base, tpoff): + New functions. + (elf32_sparc_object_p): Allocate backend private object data. + (bfd_elf32_bfd_link_hash_table_create, + elf_backend_copy_indirect_symbol, bfd_elf32_mkobject, + elf_backend_can_refcount): Define. + (elf_backend_create_dynamic_sections): Define to + elf32_sparc_create_dynamic_sections. + * reloc.c: Add SPARC TLS relocs. + * bfd-in2.h, libbfd.h: Rebuilt. + * elf64-sparc.c (sparc64_elf_howto_table): Add TLS relocs. + (sparc_reloc_map): Likewise. + +2003-01-24 Martin Schwidefsky + + * bfd-in2.h: Regenerate. + * elf32-s390.c (elf_s390_mkobject, elf_s390_tls_transition, + s390_tls_reloc, dtpoff_base, tpoff, invalid_tls_insn): New functions. + (elf_howto_table): Add TLS relocs. + (elf_s390_reloc_type_lookup): Likewise. + (elf_s390_link_hash_entry): Add tls_type. + (elf_s390_hash_entry, elf_s390_obj_tdata, elf_s390_local_got_tls_type): + New macros. + (elf_s390_link_hash_table): Add tls_ldm_got. + (link_hash_newfunc): Initialize tls_type. + (elf_s390_link_hash_table_create): Initialize refcount of tls_ldm_got. + (elf_s390_copy_indirect_symbol): Copy tls_type information. + (elf_s390_check_relocs): Support TLS relocs. + (elf_s390_gc_sweep_hook): Likewise. + (allocate_dynrelocs): Likewise. + (elf_s390_size_dynamic_sections): Likewise. + (elf_s390_relocate_section): Likewise. + (elf_s390_finish_dynamic_symbol): Likewise. + (bfd_elf32_mkobject): Define for TLS. + * elf64-s390.c: Same changes as for elf32-s390.c. + * libbfd.h: Regenerate. + * reloc.c: Add s390 TLS relocations. + +2003-01-24 Charles Lepple + + * aclocal.m4: Fix name of --enable-install-libbfd switch. + +2003-01-23 Nick Clifton + + * Add sh2e support: + 2002-04-02 Elena Zannoni + * archures.c (bfd_mach_sh2e): Added. + * bfd-in2.h: Rebuilt. + * cpu-sh.c (arch_info_struct): Added SH2e. + * elf32-sh.c (sh_elf_set_mach_from_flags): Handle EF_SH2E. + +2003-01-23 Alan Modra + + * elf-bfd.h (struct bfd_elf_section_data): Remove tdata. Change + dynindx to an int. Rearrange for better packing. + * elf.c (_bfd_elf_new_section_hook): Don't alloc if already done. + * elf32-mips.c (bfd_elf32_new_section_hook): Define. + * elf32-sh64.h: New. Split out from include/elf/sh.h. + (struct _sh64_elf_section_data): New struct. + (sh64_elf_section_data): Don't dereference sh64_info (was tdata). + * elf32-sh64-com.c: Include elf32-sh64.h. + * elf32-sh64.c: Likewise. + (sh64_elf_new_section_hook): New function. + (bfd_elf32_new_section_hook): Define. + (sh64_elf_fake_sections): Adjust for sh64_elf_section_data change. + (sh64_bfd_elf_copy_private_section_data): Likewise. + (sh64_elf_final_write_processing): Likewise. + * elf32-sparc.c (struct elf32_sparc_section_data): New. + (elf32_sparc_new_section_hook): New function. + (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete. + (sec_do_relax): Define. + (elf32_sparc_relax_section): Adjust to use sec_do_relax. + (elf32_sparc_relocate_section): Likewise. + * elf64-mips.c (bfd_elf64_new_section_hook): Define. + * elf64-mmix.c (struct _mmix_elf_section_data): New. + (mmix_elf_section_data): Define. Use throughout file. + (mmix_elf_new_section_hook): New function. + (bfd_elf64_new_section_hook): Define. + * elf64-ppc.c (struct _ppc64_elf_section_data): New. + (ppc64_elf_section_data): Define. Use throughout. + (ppc64_elf_new_section_hook): New function. + (bfd_elf64_new_section_hook): Define. + * elf64-sparc.c (struct sparc64_elf_section_data): New. + (sparc64_elf_new_section_hook): New function. + (SET_SEC_DO_RELAX, SEC_DO_RELAX): Delete. + (sec_do_relax): Define. + (sparc64_elf_relax_section): Adjust to use sec_do_relax. + (sparc64_elf_relocate_section): Likewise. + (bfd_elf64_new_section_hook): Define. + * elfn32-mips.c (bfd_elf32_new_section_hook): Define. + * elfxx-mips.c (struct _mips_elf_section_data): New. + (mips_elf_section_data): Define. Use throughout. + (_bfd_mips_elf_new_section_hook): New function. + (mips_elf_create_got_section): Don't alloc used_by_bfd. + * elfxx-mips.h (_bfd_mips_elf_new_section_hook): Declare. + * elfxx-target.h (bfd_elfNN_new_section_hook): Add #ifndef. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2003-01-21 Richard Henderson + + * elf64-alpha.c (ALPHA_ELF_LINK_HASH_PLT_LOC): New. + (struct alpha_elf_link_hash_entry): Add plt_old_section, plt_old_value. + (elf64_alpha_adjust_dynamic_symbol): Set them. + (elf64_alpha_size_plt_section_1): Reset them when plt entry removed. + (elf64_alpha_relax_tls_get_addr): Handle LDM relocs. Frob the + symbol index when relaxing LDM to TPREL. + (elf64_alpha_relax_section): Likewise. Allow relaxation of GD + relocs, even if the target isn't locally defined. + (elf64_alpha_check_relocs): Frob LDM reloc symndx to zero. + (elf64_alpha_relocate_section): Likewise. Force TP-relative + relocs vs symndx 0 to the tp base. + +2003-01-21 Fabio Alemagna + + * config.bfd: Handle i[3456]86-*-aros*. + +2003-01-21 Andreas Schwab + + * elf32-ppc.c (struct ppc_elf_dyn_relocs): Define. + (struct ppc_elf_link_hash_entry): Define. + (ppc_elf_hash_entry): New function. + (struct ppc_elf_link_hash_table): Define. + (ppc_elf_hash_table): New function. + (ppc_elf_link_hash_newfunc): New function. + (ppc_elf_link_hash_table_create): New function. + (ppc_elf_copy_indirect_symbol): New function. + (allocate_dynrelocs): New function. + (readonly_dynrelocs): New function. + (ppc_elf_size_dynamic_sections): Allocate space for dynamic + relocs and determine DT_TEXTREL. + (ppc_elf_check_relocs): Don't do that here, just count the + dynamic relocs. + (ppc_elf_gc_sweep_hook): Discard any dynamic relocs against the + removed section. + (bfd_elf32_bfd_link_hash_table_create): Define. + (elf_backend_copy_indirect_symbol): Define. + +2003-01-21 Richard Henderson + + * elf64-alpha.c (alpha_dynamic_entries_for_reloc): GOTTPREL and + TPREL also get a reloc if shared. Remove SREL support. + (elf64_alpha_emit_dynrel): New. + (elf64_alpha_relocate_section): Use it. Resolve dynamic TPREL + and GOTTPREL relocs to local symbols against the tp base. + (elf64_alpha_finish_dynamic_symbol): Use elf64_alpha_emit_dynrel. + + * elf64-alpha.c (elf64_alpha_relax_got_load): Decrement got + use count before clobbering r_type. + (elf64_alpha_relax_tls_get_addr): Don't use pos[1] if insn + ordering would mean dataflow inspection is necessary. + +2003-01-20 Svein E. Seldal + + * coffcode.h (coff_set_flags): Added get/set arch hooks. + +2003-01-20 Fabio Alemagna + + * elf32-sh.c: Treat elfNN_bed like other macros defined in + elfxx-target.h and #undef it before #define'ing it. + * elf32-i386.c: Likewise. + * elf32-sh64.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-sh64.c: Likewise. + +2003-01-20 Martin Schwidefsky + + * bfd-in2.h: Regenerate. + * elf32-s390.c (elf_s390_adjust_gotplt): New prototype. + (elf_howto_table): Rename R_390_GOTOFF to R_390_GOTOFF32. Add + R_390_GOTOFF16, R_390_GOTOFF64, R_390_GOTPLT12, R_390_GOTPLT16, + R_390_GOTPLT32, R_390_GOTPLT64, R_390_GOTPLTENT, R_390_PLTOFF16, + R_390_PLTOFF32 and R_390_PLTOFF64. + (elf_s390_reloc_type_lookup): Likewise. + (struct elf_s390_link_hash_entry): Add gotplt_refcount to keep track + of GOTPLT references to a function. + (link_hash_newfunc): Initialize gotplt_refcount. + (elf_s390_check_relocs): Move allocation of local_got_refcounts array + and creation of the got section out of the main switch. Add support + for the gotoff, gotplt and pltoff relocations. + (elf_s390_gc_sweep_hook): Add reference counting for gotoff, gotplt + and pltoff. + (elf_s390_adjust_gotplt): New function. + (elf_s390_adjust_dynamic_symbol): Adjust gotplt refcount for removed + plt entries. + (allocate_dynrelocs): Add comment. + (elf_s390_relocate_section): Change r_type to unsigned. Add support + for gotoff, gotplt and pltoff relocations. + * elf64-s390.c: Same changes as for elf32-s390.c. + * libbfd.h: Regenerate. + * reloc.c: Add BFD_RELOC_390_GOTOFF64, BFD_RELOC_390_GOTPLT12, + BFD_RELOC_390_GOTPLT16, BFD_RELOC_390_GOTPLT32, BFD_RELOC_390_GOTPLT64, + BFD_RELOC_390_GOTPLTENT, BFD_RELOC_390_PLTOFF16, BFD_RELOC_390_PLTOFF32 + and BFD_RELOC_390_PLTOFF64. + +2003-01-18 Jakub Jelinek + + * elfxx-ia64.c (elfNN_ia64_relocate_section): Handle + R_IA64_TPREL64[LM]SB against non-global symbol properly. + +2003-01-16 Jakub Jelinek + + * elfxx-ia64.c (struct elfNN_ia64_link_hash_table): Add + self_dtpmod_done and self_dtpmod_offset. + (allocate_global_data_got): Only use one got entry for all + dtpmod relocs against local symbols. + (allocate_dynrel_entries): Only need .rela.got entry for + dtpmod against global symbol. + (elfNN_ia64_size_dynamic_sections): Initialize self_dtpmod_offset. + Reserve space in .rela.got for the local dtpmod entry. + (set_got_entry): Initialize the common local dtpmod .got entry. + (elfNN_ia64_relocate_section): Handle R_IA_64_DTPREL64LSB + and R_IA_64_DTPREL64MSB. + +2003-01-16 Alan Modra + + * elf64-ppc.c: Include elf/ppc64.h rather than elf/ppc.h. + (R_PPC_*): Rename all occurrences to R_PPC64_*. + (R_PPC64_ADDR30): Rename all occurrences to R_PPC64_REL30. + (enum elf_ppc_reloc_type): Ditto to enum elf_ppc64_reloc_type. + (ppc64_elf_gc_sweep_hook): Handle R_PPC64_REL30 along with other + relative relocs, not with absolute ones. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2003-01-15 Andreas Schwab + + * elf32-ppc.c (ppc_elf_check_relocs): Don't set DF_TEXTREL for a + relocation against a non-allocated readonly section. + +2003-01-10 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Adjust addend for GOT16_HA. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. PLTGOT16_HA too. + +2002-01-08 Klee Dienes + + * Makefile.am (ALL_MACHINES): Use cpu-msp430.lo, not cpu-msp430.c. + (BFD32_BACKENDS): Use elf32-msp430.lo, not elf32-msp430.c. + * Makefile.in: Regenerate. + +2003-01-08 Alexandre Oliva + + * elfn32-mips.c (prev_reloc_section): New. + (GET_RELOC_ADDEND): Use it. Parenthesize macro arguments. + (SET_RELOC_ADDEND): Parenthesize macro argument. + +2003-01-07 John David Anglin + + * elf32-hppa.c (final_link_relocate): For all DP relative relocations, + adjust addil instructions if the symbol has no section. + +2003-01-07 DJ Delorie + + * elf32-xstormy16.c (xstormy16_elf_howto_table): Make REL_12 not + partial_inplace. + +2003-01-07 Andreas Schwab + + * elf32-m68k.c (elf_m68k_check_relocs): Don't set DF_TEXTREL for + PC relative relocations. + (elf_m68k_discard_copies): Set it here instead. + +2002-01-02 Ben Elliston + Jeff Johnston + + * Makefile.am (ALL_MACHINES): Add cpu-iq2000.lo. + (ALL_MACHINES_CFILES): Add cpu-iq2000.c. + (BFD32_BACKENDS): Add elf32-iq2000.lo. + (BFD32_BACKENDS_CFILES): Add elf32-iq2000.c. + (cpu-iq2000.lo): New target. + * Makefile.in: Regenerate. + * config.bfd: Handle iq2000-*-elf. + * archures.c (bfd_architecture): Add bfd_{arch,mach}_iq2000. + (bfd_archures_list): Add bfd_iq2000_arch. + * configure.in: Handle bfd_elf32_iq2000_vec. + * configure: Regenerate. + * reloc.c: Add BFD_RELOC_IQ2000_OFFSET_16, BFD_RELOC_IQ2000_OFFSET_21, + and BFD_RELOC_IQ2000_UHI16. + * targets.c (bfd_elf32_iq2000_vec): Declare. + (bfd_target_vector): Add bfd_elf32_iq2000_vec. + * elf.c (prep_headers): Set e_machine to EM_IQ2000. + * cpu-iq2000.c: New file. + * elf32-iq2000.c: Likewise. + * libbfd.h: Regenerate. + * bfd-in2.h: Likewise. + +2003-01-02 Richard Sandiford + + * elfxx-mips.c: Include libiberty.h. + (elf_mips_isa, _bfd_mips_elf_mach_extends_p): Remove. + (mips_set_isa_flags): New function, split out from... + (_bfd_mips_elf_final_write_processing): ...here. Only call + mips_set_isa_flags if the EF_MIPS_MACH bits are clear. + (mips_mach_extensions): New array. + (mips_32bit_flags_p): New function. + (_bfd_mips_elf_merge_private_bfd_data): Rework architecture checks. + Use mips_32bit_flags_p to check if one binary is 32-bit and the + other is 64-bit. When adopting IBFD's architecture, adopt the + bfd_mach as well as the flags. + +2003-01-02 Nick Kelsey + + * elf32-ip2k.c: Re-work of linker relaxation code for the ip2k to + fix internal errors, fix bad code generation, fix incorrect stabs + information, and improve ability to eliminate redundant page + instructions. Added code to ip2k_final_link_relocate to self-verify + the linker relaxation. Fix formatting problems. + +2002-12-30 Chris Demetriou + + * aoutx.h (NAME(aout,machine_type)): Add bfd_mach_mipsisa32r2 case. + * archures.c (bfd_mach_mipsisa32r2): New define. + * bfd-in2.h: Regenerate. + * cpu-mips.c (I_mipsisa32r2): New enum value. + (arch_info_struct): Add entry for I_mipsisa32r2. + * elfxx-mips.c (elf_mips_isa, _bfd_elf_mips_mach) + (_bfd_mips_elf_print_private_bfd_data): Handle E_MIPS_ARCH_32R2. + (_bfd_mips_elf_final_write_processing): Add + bfd_mach_mipsisa32r2 case. + (_bfd_mips_elf_merge_private_bfd_data): Handle merging of + binaries marked as using MIPS32 Release 2. + +2002-12-30 Dmitry Diky + + * Makefile.am: Add msp430 target. + * configure.in: Likewise. + * Makefile.in: Regenerate. + * configure: Regenerate. + * archures.c: Add msp430 architecture vector. + * config.bfd: Likewise. + * reloc.c: Add msp430 relocs. + * targets.c: Add msp320 target. + * cpu-msp430.c: New file: msp430 cpu detection. + * elf32-msp430.c: New file: msp430 reloc processing. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2002-12-28 Jakub Jelinek + + * elf.c (elf_sort_sections): Don't reorder .tbss. + (assign_file_positions_for_segments): Only adjust off/voff + for increased alignment in PT_LOAD or PT_NOTE segment, + but adjust p_filesz for .tbss too. in PT_LOAD consider + .tbss to have zero memory size. + (copy_private_bfd_data) [SECTION_SIZE]: Define. + [IS_CONTAINED_BY_VMA, IS_CONTAINED_BY_LMA]: Use it. + [INCLUDE_SECTION_IN_SEGMENT]: Only put SHF_TLS sections + into PT_TLS segment. Never put SHF_TLS sections in + segments other than PT_TLS or PT_LOAD. + + * elf64-alpha.c (elf64_alpha_finish_dynamic_sections): Clear .plt + sh_entsize. + +2002-12-23 DJ Delorie + + * coff64-rs6000.c (xcoff64_ppc_relocate_section): Fix logic reversal. + +2002-12-23 Alan Modra + + * elflink.h (elf_link_output_extsym): Heed strip_discarded. + +2002-12-23 Nick Clifton + + * archures.c (bfd_arch_get_compatible): Add third parameter + 'accept_unknowns'. Only accept unknown format BFDs if + accept_unknowns is true, or if the format is "binary". + * bfd-in2.h: Regenerate. + +2002-12-21 Nick Clifton + + * coff-arm.c (coff_arm_relocate_section): Disable WINCE workaround + that subtracted 8 from pc relative relocations. + +2002-12-20 Kazu Hirata + + * coff-h8300.c: Fix comment typos. + * coffcode.h: Likewise. + * cpu-cris.c: Likewise. + * elf32-vax.c: Likewise. + * genlink.h: Likewise. + * linker.c: Likewise. + * som.c: Likewise. + * tekhex.c: Likewise. + * vms-misc.c: Likewise. + +2002-12-20 DJ Delorie + + * reloc.c: Add BFD_RELOC_XSTORMY16_12. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_12. + (xstormy16_reloc_map): Add R_XSTORMY16_12. + +2002-12-19 Kazu Hirata + + * doc/bfdint.texi: Fix typos. + +2002-12-20 Paul Eggert + + Port to POSIX 1003.1-2001. + * acinclude.m4 (AM_INSTALL_LIBBFD): Do not rely on "test -o". + * configure.in (build-warnings): Likewise. + (Horrible hacks to build DLLs on Windows): Do not rely on "tail -1". + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * configure: Regenerate. + +2002-12-19 Alan Modra + + * coff-h8300.c: Include libiberty.h. + (h8300_reloc16_extra_cases): Check the hash table creator before + referencing h8300 specific fields. Stash the hash table pointer + in a local var. Comment typo fixes. + (h8300_bfd_link_add_symbols): Likewise. + + * reloc.c (struct reloc_howto_struct): Revise src_mask and + dst_mask comments. + * bfd-in2.h: Regenerate. + +2002-12-18 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Reorganize dynamic reloc + code a little. Comment on dynamic relocs against section symbols. + +2002-12-17 Roger Sayle + + * configure.host (ia64-*-hpux*): Support 64 bit targets using + the HP compiler's "long long". + +2002-12-16 Andrew MacLeod + + * elf32-xstormy16.c (xstormy16_elf_howto): Add R_XSTORMY16_LO16 + and R_XSTORMY16_HI16) howto entries. + (xstormy16_reloc_map): Map R_XSTORMY16_{LO,HI}16 to BFD_RELOC_{LO,HI}16. + (xstormy16_info_to_howto_rela): Use R_XSTORMY16_GNU_VTINHERIT to + determine the start of the second reloc table. + +2002-12-16 Nathan Tallent + + * ecofflink.c: Fix the reading of the debugging information + of Tru64/Alpha binaries that are produced by recent Compaq + compilers. + (mk_fdrtab): Fix error in creating the FDR (file descriptor) + table. + (lookup_line): Because of the strange information sometimes + generated by Compaq's recent compilers, change how the FDR + table is searched so that PDRs (procedure descriptors) are + correctly found. Note that this change is really more of a hack; + however, I have included extensive documentation as to why + this is the best solution short of an extensive rewrite or + another hack. + (fdrtab_lookup): Add comments to explain the algorithm. + +2002-12-12 Alexandre Oliva + + * elf-m10300.c (elf32_mn10300_link_hash_newfunc): Reorder + initializers to match struct declaration. + +2002-12-12 Alan Modra + + * dwarf2.c (comp_unit_contains_address): Comment typo fix. + * elf.c (get_program_header_size): Likewise. + * elf32-m32r.c (m32r_elf_lo16_reloc): Likewise. + (m32r_elf_generic_reloc): Likewise. + * elf32-ppc.c (ppc_elf_howto_init): Likewise. + * elflink.h (elf_bfd_discard_info): Likewise. + +2002-12-12 Alan Modra + + * elf32-i386.c (elf_i386_finish_dynamic_sections): Add output_offset + to DT_JMPREL. Use srelplt input section size for DT_PLTRELSZ and + DT_RELSZ adjustment, not output section. Avoid writing tags when + unchanged. Don't assume linker script is sane, adjust DT_REL too. + * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Just use raw + size of srelplt for DT_PLTRELSZ. Use srelplt input section size for + DT_RELASZ adjustment, not output section. Avoid writing tags when + unchanged. Adjust DT_RELA. + * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Tweaks for better + formatting. Avoid writing tags when unchanged. Adjust DT_RELA. + +2002-12-12 Alexandre Oliva + + * elfxx-mips.c (mips_elf_calculate_relocation): Don't divide + addend by 4. + +2002-12-12 Alexandre Oliva + + * elfxx-mips.c (struct mips_got_entry): New. + (struct mips_got_info): Added got_entries field. + (mips_elf_got_entry_hash, mips_elf_got_entry_eq): New functions. + (mips_elf_local_got_index, mips_elf_got_page, + mips_elf_got16_entry): Re-implement in terms of new... + (mips_elf_create_local_got_entry): Rewrite to use got_entries. + Change return type. + (mips_elf_highest): Warning clean-up. + (mips_elf_create_got_section): Initialize got_entries. + (_bfd_mips_elf_check_relocs): Use got_entries to estimate + local got size. + (_bfd_mips_elf_size_dynamic_sections): Do not account for + GOT_PAGE entries, since we now reuse GOT16 entries. + +2002-12-10 Jason Thorpe + + * aoutx.h (set_section_contents): Allow an otherwise unrepresentable + read-only section that lies after .text and before .data to be + written into the output file and included in a_text. + (translate_to_native_sym_flags): If an otherwise unrepresentable + section was merged with .text, convert its symbols to N_TEXT + symbols. + * libaout.h (aout_section_merge_with_text_p): New macro. + +2002-12-08 Alan Modra + + * bfd-in.h: Comment typo fix. Formatting. + * bfd-in2.h: Regenerate. + * coff64-rs6000.c (xcoff64_openr_next_archived_file): Warning fix. + * elf32-m68hc12.c (m68hc12_elf_set_mach_from_flags): Prototype. + * elf64-mmix.c (mmix_dump_bpo_gregs): Warning fix. + +2002-12-05 Richard Henderson + + * elfxx-ia64.c (elfNN_ia64_relax_section): Handle PCREL21BI. + Only send PCREL21B though the plt. Fix installed reloc type. + (elfNN_ia64_relocate_section): Give error for dynamic reloc + against PCREL22 or PCREL64I; clean up error messages for + branch relocs. + +2002-12-04 Kevin Buettner + + * elf64-mips.c (elf64_mips_grok_prstatus, elf64_mips_grok_psinfo): + New functions. + (elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define. + +2002-12-04 David Mosberger + + * cpu-ia64-opc.c: Add operand constant "ar.csd". + +2002-12-04 H.J. Lu + + * elfxx-ia64.c (get_local_sym_hash): Use section ID instead of + BFD address when constructing local name. + +2002-12-04 Andreas Schwab + + * elf32-m68k.c (struct elf_m68k_link_hash_table): Add sym_sec + member. + (elf_m68k_link_hash_table_create): Initialize it. + (elf_m68k_check_relocs): Handle symbols that are forced to be + local due to visibility changes. + (elf_m68k_adjust_dynamic_symbol): Likewise. + (elf_m68k_size_dynamic_sections): Likewise. + (elf_m68k_discard_copies): Likewise. + (elf_m68k_relocate_section): Likewise. + +2002-12-04 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_opd): Correct typo. + +2002-12-04 Alan Modra + + * srec.c (srec_write_symbols): Restore '$' prefix to address + accidentally removed in 2002-04-04 change. + (srec_get_symtab): Use 0 instead of `(long) FALSE'. + +2002-12-03 Nick Clifton + + * elf32-ppc.c (apuinfo_list_init): New function. + (apuinfo_list_add): New function: Add a value to the list. + (apuinfo_list_length): New function: Return the number of + values on the list. + (apuinfo_list_element): New function: Return a value on the + list. + (apuinfo_list_finish): New function: Free the resources used + by the list. + (ppc_elf_begin_write_processing): New function. Scan the + input bfds for apuinfo sections. + (ppc_elf_write_section): New function: Delay the creation of + the contents of an apuinfo section in an output bfd. + (ppc_elf_final_write_processing): New function. Create the + contents of an apuinfo section in an output bfd. + (elf_backend_begin_write_processing): Define. + (elf_backend_final_write_processing): Define. + (elf_backend_write_section): Define. + +2002-12-03 Richard Henderson + + * cpu-ia64-opc.c (elf64_ia64_operands): Add ldxmov entry. + +2002-12-01 Stephane Carrez + + Fix PR savannah/1417: + * elf32-m68hc11.c (m68hc11_elf_relax_delete_bytes): Don't adjust + branch if it goes to the start of the deleted region. + +2002-12-01 Stephane Carrez + + * bfd-in2.h (bfd_mach_m6812): Rebuild. + * archures.c (bfd_mach_m6812_default, bfd_mach_m6812, + bfd_mach_m6812s): Declare. + + * elf32-m68hc12.c (m68hc12_elf_set_mach_from_flags): New function. + (_bfd_m68hc12_elf_set_private_flags): Call it. + (_bfd_m68hc12_elf_print_private_bfd_data): Report processor version. + (_bfd_m68hc12_elf_merge_private_bfd_data): Merge the flags and + report microcontroller incompatibilities (HC12 vs HCS12). + (elf_backend_object_p): Update. + +2002-11-30 Alan Modra + + * bfd-in.h (TRUE_FALSE_ALREADY_DEFINED, BFD_TRUE_FALSE): Delete. + (enum bfd_boolean, boolean): Delete. + (bfd_boolean): Typedef to an int. + (FALSE, TRUE): Define. + * aix386-core.c, aix5ppc-core.c, aout-adobe.c, aout-arm.c, aout-cris.c, + aout-encap.c, aout-ns32k.c, aout-target.h, aout-tic30.c, aoutf1.h, + aoutx.h, archive.c, archive64.c, archures.c, bfd-in.h, bfd.c, bfdwin.c, + binary.c, bout.c, cache.c, cisco-core.c, coff-a29k.c, coff-alpha.c, + coff-apollo.c, coff-arm.c, coff-aux.c, coff-h8300.c, coff-h8500.c, + coff-i386.c, coff-i860.c, coff-i960.c, coff-ia64.c, coff-m68k.c, + coff-m88k.c, coff-mcore.c, coff-mips.c, coff-or32.c, coff-ppc.c, + coff-rs6000.c, coff-sh.c, coff-sparc.c, coff-stgo32.c, coff-tic30.c, + coff-tic4x.c, coff-tic54x.c, coff-tic80.c, coff-w65.c, coff-we32k.c, + coff-z8k.c, coff64-rs6000.c, coffcode.h, coffgen.c, cofflink.c, + corefile.c, cpu-a29k.c, cpu-alpha.c, cpu-arc.c, cpu-arm.c, cpu-avr.c, + cpu-cris.c, cpu-d10v.c, cpu-d30v.c, cpu-dlx.c, cpu-fr30.c, cpu-frv.c, + cpu-h8300.c, cpu-h8500.c, cpu-hppa.c, cpu-i370.c, cpu-i386.c, + cpu-i860.c, cpu-i960.c, cpu-ia64.c, cpu-ip2k.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, cpu-mips.c, cpu-mmix.c, cpu-ns32k.c, + cpu-openrisc.c, cpu-or32.c, cpu-pdp11.c, cpu-pj.c, cpu-powerpc.c, + cpu-rs6000.c, cpu-s390.c, cpu-sh.c, cpu-sparc.c, cpu-tic30.c, + cpu-tic4x.c, cpu-tic54x.c, cpu-tic80.c, cpu-v850.c, cpu-vax.c, + cpu-w65.c, cpu-we32k.c, cpu-xstormy16.c, cpu-z8k.c, dwarf1.c, + dwarf2.c, ecoff.c, ecofflink.c, efi-app-ia32.c, efi-app-ia64.c, + elf-bfd.h, elf-eh-frame.c, elf-hppa.h, elf-m10200.c, elf-m10300.c, + elf-strtab.c, elf.c, elf32-arc.c, elf32-arm.h, elf32-avr.c, + elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, elf32-fr30.c, + elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, elf32-hppa.h, + elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, + elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c, + elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c, + elf32-pj.c, elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-sh64-com.c, + elf32-sh64.c, elf32-sparc.c, elf32-v850.c, elf32-vax.c, + elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c, + elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-ppc.h, elf64-s390.c, + elf64-sh64.c, elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, + elfarm-oabi.c, elfcode.h, elfcore.h, elflink.c, elflink.h, + elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c, elfxx-mips.h, + elfxx-target.h, format.c, freebsd.h, genlink.h, hash.c, hp300hpux.c, + hppabsd-core.c, hpux-core.c, i386aout.c, i386linux.c, i386lynx.c, + i386mach3.c, i386msdos.c, i386os9k.c, ieee.c, ihex.c, irix-core.c, + libaout.h, libbfd-in.h, libbfd.c, libcoff-in.h, libecoff.h, libieee.h, + libnlm.h, liboasys.h, libpei.h, libxcoff.h, linker.c, lynx-core.c, + m68klinux.c, m68klynx.c, mach-o.c, mach-o.h, merge.c, mipsbsd.c, + mmo.c, netbsd-core.c, netbsd.h, nlm.c, nlm32-alpha.c, nlm32-i386.c, + nlm32-ppc.c, nlm32-sparc.c, nlmcode.h, oasys.c, opncls.c, osf-core.c, + pc532-mach.c, pdp11.c, pe-arm.c, pe-i386.c, pe-mcore.c, pe-mips.c, + pe-sh.c, peXXigen.c, pef.c, pei-arm.c, pei-i386.c, pei-mcore.c, + pei-mips.c, pei-sh.c, peicode.h, ppcboot.c, ptrace-core.c, reloc.c, + reloc16.c, riscix.c, rs6000-core.c, sco5-core.c, section.c, simple.c, + som.c, som.h, sparclinux.c, sparclynx.c, srec.c, stabs.c, sunos.c, + syms.c, targets.c, tekhex.c, ticoff.h, trad-core.c, versados.c, + vms-gsd.c, vms-hdr.c, vms-misc.c, vms-tir.c, vms.c, vms.h, + xcoff-target.h, xcofflink.c, xsym.c, xsym.h: Replace boolean with + bfd_boolean, true with TRUE, false with FALSE. Simplify comparisons + of bfd_boolean vars with TRUE/FALSE. Formatting. + * bfd-in2.h, libbfd.h, libcoff.h: Regenerate + +2002-11-28 Alan Modra + + * elf-bfd.h: Replace occurrences of Elf32_Internal_* and + Elf64_Internal_* with Elf_Internal_*. Replace Elf_Internal_Rel + with Elf_Internal_Rela. + * elf-hppa.h, elf-m10200.c, elf-m10300.c, elf32-arc.c, elf32-arm.h, + elf32-avr.c, elf32-cris.c, elf32-d10v.c, elf32-d30v.c, elf32-dlx.c, + elf32-fr30.c, elf32-frv.c, elf32-gen.c, elf32-h8300.c, elf32-hppa.c, + elf32-i370.c, elf32-i386.c, elf32-i860.c, elf32-i960.c, elf32-ip2k.c, + elf32-m32r.c, elf32-m68hc11.c, elf32-m68hc12.c, elf32-m68k.c, + elf32-mcore.c, elf32-mips.c, elf32-openrisc.c, elf32-or32.c, + elf32-ppc.c, elf32-s390.c, elf32-sh.c, elf32-v850.c, elf32-vax.c, + elf32-xstormy16.c, elf64-alpha.c, elf64-gen.c, elf64-hppa.c, + elf64-mips.c, elf64-mmix.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, + elf64-sparc.c, elf64-x86-64.c, elfarm-nabi.c, elfarm-oabi.c, + elfcode.h, elflink.h, elfn32-mips.c, elfxx-ia64.c, elfxx-mips.c: Ditto. + * elf-hppa.h (elf_hppa_internal_shdr): Delete. Use Elf_Internal_Shdr + throughout instead. + * elf.c (_bfd_elf_no_info_to_howto_rel): Delete. + * elfcode.h (elf_swap_reloca_in): Pass source operand as a bfd_byte *. + Remove INLINE keyword. + (elf_swap_reloc_in): Likewise. Also clear r_addend. + (elf_swap_reloc_out, elf_swap_reloca_out): Pass destination operand + as a bfd_byte *. + (elf_write_relocs): Consolidate REL and RELA code. + (elf_slurp_reloc_table_from_section): Simplify REL code. + (NAME(_bfd_elf,size_info)): Populate reloc swap entries. + * elf-bfd.h (MAX_INT_RELS_PER_EXT_REL): Define. + * elflink.h (elf_link_read_relocs_from_section): Consolidate REL and + RELA code. + (elf_link_adjust_relocs): Likewise. Don't malloc space for temp + reloc array, use a fixed size of MAX_INT_RELS_PER_EXT_REL. + (elf_link_output_relocs): Likewise. + (elf_reloc_link_order): Likewise. + (elf_finish_pointer_linker_section): Likewise. + (struct elf_link_sort_rela): Remove union. + (elf_link_sort_cmp1): Update to suit. + (elf_link_sort_cmp2): Here too. + (elf_link_sort_relocs): Consolidate REL and RELA code. Fix memory + over-allocation for int_rels_per_ext_rel != 1 case. + * elf32-arm.h: Update all bfd_elf32_swap_reloc_out calls. + * elf32-i386.c: Likewise. + * elf32-cris.c: Likewise for bfd_elf32_swap_reloca_out. + * elf32-hppa.c, elf32-i370.c, elf32-m68k.c, elf32-ppc.c, elf32-s390.c, + elf32-sh.c, elf32-vax.c, elfxx-mips.c: Likewise. + * elf64-alpha.c: Likewise for bfd_elf64_swap_reloca_out. + * elf64-hppa.c, elf64-mips.c, elf64-ppc.c, elf64-s390.c, elf64-sh64.c, + elf64-sparc.c, elf64-x86-64.c: Likewise. + * elfxx-ia64.c: Likewise for bfd_elfNN_swap_reloca_out. + * elfxx-mips.c (sort_dynamic_relocs): Likewise for + bfd_elf32_swap_reloc_in. + + * elf32-arm.h: Update elf32_arm_info_to_howto calls. + * elf32-mips.c: Likewise for mips_info_to_howto_rel. + (mips_elf64_swap_reloc_in): Zero r_addend. + (mips_elf64_be_swap_reloc_in): Likewise. + (mips_elf64_slurp_one_reloc_table): Simplify. + + * elf64-alpha.c (alpha_elf_size_info): Populate reloc swap entries. + * elf64-hppa.c (hppa64_elf_size_info): Likewise. + * elf64-sparc.c (sparc64_elf_size_info): Likewise. + +2002-11-28 Kaz Kojima + + * elf32-sh.c (sh_elf_relocate_section): Don't complain about + unresolved debugging relocs in dynamic applications. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + +2002-11-26 Alan Modra + + * elf-eh-frame.c (ENSURE_NO_RELOCS): Disregard R_*_NONE relocs. + (_bfd_elf_discard_section_eh_frame): Don't discard duplicate CIEs + on a relocatable link. Comment typos. + * elf.c (_bfd_elf_link_hash_newfunc): Assign elements of structure + in the order they are declared. Clear elf_hash_value too. + (_bfd_elf_link_hash_table_init): Likewise assign in order. Clear + eh_info and tls_segment. + * elflink.h (elf_link_input_bfd ): Keep reloc offsets + sorted when discarding relocs by turning them into R_*_NONE. + + * libbfd.c (warn_deprecated): Comment spelling. + * po/SRC-POTFILES.in: Regenerate. + +2002-11-21 Richard Henderson + + * elflink.h (elf_link_add_object_symbols): Don't overwrite the + arch's st_other bits when merging visibilities. + (elf_link_output_extsym): Tidy clearing of visibility field. + +2002-11-21 Alan Modra + + * coff-mcore.c (SWAP_IN_RELOC_OFFSET): Define. + (SWAP_OUT_RELOC_OFFSET): Define. + +2002-11-20 Alexandre Oliva + + * elf.c (_bfd_elf_link_hash_table_init): Make sure + can_refcount is properly extended to the type of + init_refcount. + +2002-11-19 Alexandre Oliva + + * elfxx-mips.c (MIPS_RELOC_RELA_P): New macro. + (_bfd_mips_elf_relocate_section): Use it. + + * elfxx-mips.c (MNAME): New macro. + (_bfd_mips_elf_check_relocs): Use it. + (_bfd_mips_elf_discard_info): Likewise. + (_bfd_mips_elf_final_link): Likewise. + +2002-11-19 Alan Modra + + * elf64-ppc.c (ppc64_elf_edit_opd): When deleting relocs, adjust + rel_hdr.sh_size too. + +2002-11-18 Klee Dienes + + * Makefile.am (BFD32_LIBS): Add bfdwin.lo, bfdio.lo. + (BFD32_LIBS_CFILES): Add bfdwin.c, bfdio.c. + (BFD_H_FILES): Add bfdwin.c, bfdio.c. + (LIBBFD_H_FILES): Add bfdwin.c, bfdio.c. + Add dependencies for bfdwin.c, bfdio.c. + * bfd.c: Remove bfd_get_mtime, bfd_get_size. + * libbfd.c: Remove real_read, bfd_bread, _bfd_window_internal, + bfd_init_window, bfd_free_window, bfd_get_file_window, bfd_bwrite, + bfd_tell, bfd_flush, bfd_stat, bfd_seek. + * bfdio.c: New file. Contains real_read, bfd_bread, bfd_write, + bfd_tell, bfd_flush, bfd_stat, bfd_seek, bfd_ge_mtime, + bfd_get_size (moved from libbfd.c and bfd.c). + * bfdwin.c New file. Contains _bfd_window_internal, + bfd_init_window, bfd_free_window, bfd_get_file_window (moved from + libbfd.c and bfd.c). + * po/SRC-POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * aclocal.m4: Regenerate. + * Makefile.in: Regenerate. + * configure: Regenerate. + +2002-11-18 Klee Dienes + + * bfd.c (bfd_preserve_save): Don't zero BFD_IN_MEMORY. + +2002-11-15 Kazu Hirata + + * coff-h8300.c (h8300_reloc16_estimate): Do not optimize away + jsr after a short jump. + * elf32-h8300.c (elf32_h8_relax_section): Likewise. + +2002-11-15 Klee Dienes + + * pef.c (bfd_pef_convert_architecture): Move declaration of + ARCH_POWERPC and ARCH_M68K to the start of the function. + +2002-11-14 Svein E. Seldal + + * coff-tic4x.c (tic4x_howto_table): Formatting fixup + +2002-11-14 Hans-Peter Nilsson + + * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs): + For bpo_gregs_section->contents, allocate _raw_size, not + _cooked_size. + +2002-11-13 Klee Dienes + + * config.bfd: Add entries for powerpc-*-darwin and cousins. + +2002-11-13 H.J. Lu + + * elfcode.h (elf_object_p): Don't restore abfd->arch_info. + +2002-11-13 Klee Dienes + Alan Modra + + * bfd.c (struct bfd_preserve): New. + (bfd_preserve_save): New function. + (bfd_preserve_restore): Ditto. + (bfd_preserve_finish): Ditto. + * bfd-in2.h: Regenerate. + * mach-o.c: Formatting. + (bfd_mach_o_scan_read_symtab_symbol): Make "value" unsigned. + (bfd_mach_o_object_p): Use bfd_preserve_save/restore/finish. + (bfd_mach_o_core_p): Ditto. + (bfd_mach_o_scan): Pass in mdata. + * mach-o.h (bfd_mach_o_scan): Update prototype. + * pef.c: Formatting. + (bfd_pef_object_p): Use bfd_preserve_save/restore/finish. + (bfd_pef_xlib_object_p): Ditto. + (bfd_pef_scan): Pass in mdata. Move version check to bfd_pef_object_p. + * pef.h (bfd_pef_scan): Update prototype. + * xsym.c: Formatting, K&R fixes. + (bfd_sym_object_p): Use bfd_preserve_save/restore/finish. + (bfd_sym_scan): New function split out from bfd_sym_object_p. + * xsym.h (bfd_sym_scan): Declare. + * elfcode.h (elf_object_p): Use bfd_preserve_save/restore/finish. + * elfcore.h (elf_core_file_p): Likewise. + * targets.c (_bfd_target_vector): Revert 2002-11-08 change. + +2002-11-12 Nick Clifton + + * po/da.po: Updated Danish translation. + +2002-11-12 Alan Modra + + * elflink.h (elf_link_add_object_symbols): Optimize stabs for + relocatable link too. + (elf_link_input_bfd): When emitting relocs, adjust offsets for + eh_frame and stab sections. Zap deleted relocs. + (elf_reloc_symbol_deleted_p): Return true for zero r_symndx. + (elf_bfd_discard_info): Run for relocatable link too. + * elf64-ppc.c (ppc64_elf_edit_opd): Rename from edit_opd. Make global. + Handle ld -r case. + (ppc64_elf_size_dynamic_sections): Don't call edit_opd from here. + * elf64-ppc.h (ppc64_elf_edit_opd): Declare. + + * elf-bfd.h (struct cie_header): Move from elf_eh-frame.c. + (struct cie, struct eh_cie_fde, struct eh_frame_sec_info): Likewise. + (struct eh_frame_array_ent, struct eh_frame_hdr_info): Likewise. + (enum elf_link_info_type): Remove ELF_INFO_TYPE_EH_FRAME_HDR. + (struct eh_frame_hdr_info): Add "hdr_sec", remove "split". + (struct elf_link_hash_table): Add eh_info. + (struct elf_obj_tdata): Change eh_frame_hdr to an asection *. + (_bfd_elf_discard_section_eh_frame): Update prototype. + (_bfd_elf_discard_section_eh_frame_hdr): Likewise. + (_bfd_elf_write_section_eh_frame): Likewise. + (_bfd_elf_write_section_eh_frame_hdr): Likewise. + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Remove "ehdrsec" + param. Get "hdr_info" from link hash table. + (_bfd_elf_discard_section_eh_frame_hdr): Remove "sec" param. Get + header section from link hash table. Save header section to elf_tdata. + (_bfd_elf_maybe_strip_eh_frame_hdr): Remove local "sec". Use + header section from link hash table. Don't alloc hdr_info. Clear + hdr_sec instead of setting "strip". + (_bfd_elf_eh_frame_section_offset): Formatting. + (_bfd_elf_write_section_eh_frame): Remove "ehdrsec", add "info" param. + Get header section from link hash table. + (_bfd_elf_write_section_eh_frame_hdr): Remove "sec", add "info" param. + Get header section from link hash table. + * elf.c (map_sections_to_segments): Use cached eh_frame_hdr. + (get_program_header_size): Likewise. + (_bfd_elf_section_offset): Formatting. + * elflink.h (elf_link_create_dynamic_sections): Stash eh frame header + section pointer in link hash table. + (elf_bfd_final_link): Adjust _bfd_elf_write_section_eh_frame_hdr + and _bfd_elf_write_section_eh_frame calls. Update comment about + eh_frame entries. + (elf_bfd_discard_info): Adjust _bfd_elf_discard_section_eh_frame and + _bfd_elf_discard_section_eh_frame_hdr calls. Remove "ehdr". + + * po/SRC-POTFILES.in: Regenerate. + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't zero + relocs for discarded FDEs. Remove dead code. + (_bfd_elf_write_section_eh_frame_hdr): Remove dead code. + * elflink.h (elf_bfd_discard_info): Don't save edited relocs. + Tidy conditions under which stabs are edited. Formatting. + * elf64-sparc.c (sparc64_elf_relocate_section): Ignore overflows + from discarded relocs. + * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Add reloc output + section adjustments after testing magic values. + +2002-11-12 Thomas Moestl + + * elf64-sparc.c (sparc64_elf_adjust_dynamic_symbol): Correct + references to large plt symbols. + +2002-11-12 Klee Dienes + + * mach-o.c (bfd_mach_o_scan_read_thread): Don't re-use 'i' when + looking for an unused section name. + +2002-11-11 Kazu Hirata + + * coff-h8300.c: Fix formatting. + * elf32-h8300.c: Likewise. + * reloc16.c: Likewise. + +2002-11-09 Jeroen Dobbelaere + + * elf32-arm.h (elf32_arm_size_dynamic_sections): Don't strip output + section when dynamic section unused; _bfd_strip_section_from_output + instead. + +2002-11-08 Alan Modra + + * targets.c (_bfd_target_vector): Disable pef_vec, pef_xlib_vec + and sym_vec. + + * dwarf2.c: Revert last change. + +2002-11-07 Michal Ludvig + + * dwarf2.c (read_indirect_string, read_abbrevs, decode_line_info, + _bfd_dwarf2_find_nearest_line): Use + bfd_simple_get_relocated_section_contents() instead of + bfd_get_section_contents(). + * reloc.c (bfd_perform_relocation): Add sanity check. + * simple.c (simple_get_relocated_section_contents): If the section + does not have any relocs associated with it, just return the + unadjusted contents. + +2002-11-07 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) : Correct test for filling in constant .got + contents, enabling for a non-DSO, for symbols defined in the + program with --export-dynamic. + +2002-11-07 Alan Modra + + * elf64-ppc.c: Comment typo fixes. + (ppc64_elf_merge_private_bfd_data): Allow BFD_ENDIAN_UNKNOWN input. + +2002-11-07 Nick Clifton + + * po/da.po: Updated Danish translation. + +2002-11-06 Alexandre Oliva + + * elf64-mips.c (mips_elf64_slurp_one_reloc_table): Generate + exactly three internal relocs per external reloc. Set reloc_count + to the external reloc count. + +2002-11-06 Klee Dienes + + * coff-stgo32.c (stub_bytes): Mark as const. + Fix comment formatting. + +2002-11-06 Klee Dienes + + * Makefile.am (BFD32_BACKENDS): Add mach-o.lo, pef.lo, and + xsym.lo. + (BFD32_BACKENDS_CFILES): Add mach-o.c, pef.c, and xsym.c. + (SOURCE_HFILES): Add mach-o.h, pef.h, pef-traceback.h, xsym.h + * archures.c (enum bfd_architecture): Add bfd_arch_m98k. + * bfd.c (struct bfd): Add private data for mach-o, pef, and sym. + * targets.c (enum bfd_flavour): Add flavours for mach-o, pef, and + sym. + (_bfd_target_vector): Add target vectors for mach-o, pef, and sym. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * xsym.c: New file. Contains support for the Apple/Metrowerks + xSYM debugging format. + * xsym.h: New file. + * pef.c: New file. Contains support for the Apple Code Fragment + Manager Preferred Executable Format + * pef.h: New file. + * pef-traceback.h: New file. Contains support for parsing PowerPC + traceback tables as used by PEF executables (and perhaps other + systems as well). + * mach-o.c: New file. Contains support for the Mach-O object file + format. + * mach-o.h: New file. + * mach-o-target.c: New file. Declares the mach-o targets + themselves. Included three times by mach-o.c; each time with a + different set of macros set. + +2002-11-06 Graeme Peterson + + * Makefile.am: Remove entries for elf32-qnx.[ch]. + * Makefile.in: Regenerate. + * config.bfd: Change arm-nto to use bfd_elf32_{big|little}arm_vec, + ppc-nto to use bfd_elf32_powerpc{le}_vec, sh-nto to use + bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec. + * configure.in: Remove support for bfd_elf32_sh{l}qnx_vec, + bfd_elf32_powerpc{le}qnx_vec, bfd_elf32_{big|little}armqnx_vec, + and bfd_elf32_i386qnx_vec, and removed elf32-qnx.lo from other targets. + bfd_elf32_sh{l}_vec, and i386-nto to use bfd_elf32_i386_vec. + * configure: Regenerate. + * elf32-qnx.c: Remove. + * elf32-qnx.h: Remove. + * elf.c: Remove calls to QNX specific set_nonloadable_filepos, + is_contained_by_filepos, and copy_private_bfd_data_p. + * elf-bfd.h (struct elf_backend_data): Remove set_nonloadable_filepos, + is_contained_by_filepos, and copy_private_bfd_data_p. + * elf32-i386.c: Remove QNX extended bfd support. + * elf32-ppc.c: Remove QNX extended bfd support. + * elf32-sh.c: Remove QNX extended bfd support. + * elfarm-nabi.c: Remove QNX extended bfd support. + * targets.c: Remove qnx vectors. + * elfxx-target.h (elf_backend_set_nonloadable_filepos): Remove + (elf_backend_is_contained_by_filepos): Remove. + (elf_backend_copy_private_bfd_data_p): Remove. + * po/SRC-POTFILES.in: Regenerate. + +2002-11-06 David O'Brien + Alan Modra + + * elf64-sparc.c (sparc64_elf_relocate_section): Adjust addend of + dynamic relocs against section symbols for the output section vma. + +2002-11-05 Alan Modra + + * elf32-arm.h (t2a1_push_insn, t2a2_ldr_insn, t2a3_mov_insn, + t2a4_bx_insn, t2a5_pop_insn, t2a6_bx_insn): Remove. + +2002-11-05 Kaz Kojima + Alan Modra + + * config.bfd (sh-*-linux*): Use bfd_elf*_sh64*lin_vec as sh64 + vectors in target_selvecs. + (shle-*-netbsdelf*): Use bfd_elf*_sh64*nbsd_vec as sh64 vectors + in target_selvecs. + (sh-*-netbsdelf*): Likewise. + * configure.in (assocvecs): New variable. Handle assocvecs like + selvecs. + * configure: Regenerate. + * format.c (bfd_check_format_matches): Store bfd_target pointers + in matching_vector instead of target names. Select first target + from bfd_associated_vector that matches a list of ambiguous targets. + * targets.c (_bfd_associated_vector): New array. + (bfd_associated_vector): New variable. + (_bfd_target_vector): Add bfd_elf*_sh64*lin_vec. + * libbfd-in.h (bfd_associated_vector): Declare. + * libbfd.h: Regenerate. + +2002-11-05 Elias Athanasopoulos + + * vms-gsd.c (_bfd_vms_write_gsd): Check that symbol->udata.p is + non-NULL before dereferencing. + +2002-11-04 Kaz Kojima + + * vms.c (vms_object_p): Restore the start address when returning + NULL. + +2002-11-04 Alan Modra + Hans-Peter Nilsson + + * elflink.h (struct elf_final_link_info): Add shndxbuf_size. + (elf_bfd_final_link): Don't bother zeroing symtab_hdr fields. + Set up a larger symshndxbuf, and write it out. Free it on + exit rather than freeing symbuf twice. Correct section index + on output section symbol loop. + (elf_link_output_sym): Accumulate symbol extension section + indices, reallocating symshndxbuf rather than writing it out. + (elf_link_flush_output_syms): Don't flush symshndxbuf. + * elf.c (assign_section_numbers): Init i_shdrp to all zero. + Use bfd_zalloc to clear i_shdrp[0] too. + +2002-11-03 Stephen Clarke + + * elf32-sh64-com.c (sh64_address_in_cranges): Use + _raw_size of cranges section if _cooked_size not yet set. + +2002-11-03 Hans-Peter Nilsson + + * elf32-v850.c (v850_elf_relax_delete_bytes): Correct parameters + for bfd_elf32_swap_symbol_out. + +2002-10-31 David O'Brien + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't mix + signed and unsigned in comparison. + +2002-10-30 Daniel Jacobowitz + + * coffcode.h: Remove extraneous '\'. + +2002-10-28 H.J. Lu + + * Makefile.am (targets.lo): Depend on Makefile instead of + config.status. + (archures.lo): Likewise. + * Makefile.in: Regenerated. + +2002-10-25 Jason Thorpe + + * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Add + bfd_elf64_bigmips_vec and bfd_elf64_littlemips_vec to + targ_selvecs. + +2002-10-25 Jim Wilson + + * elf64-sh64.c (sh_elf64_relocate_section): Call + _bfd_elf_rela_local_sym. Handle relocs against STT_SECTION symbol + of SHF_MERGE section. + +2002-10-25 Hans-Peter Nilsson + + * simple.c: Correct placement of ATTRIBUTE_UNUSED. + +2002-10-24 John David Anglin + + * aoutx.h (NAME(aout,swap_ext_reloc_in)): Cast bytes->r_index to + unsigned int. Cast RELOC_BASE10, RELOC_BASE13 and RELOC_BASE22 to + unsigned int. + (NAME(aout,final_link)): Cast enum used in assignment. + (aout_link_write_symbols): Cast enums in comparisons, int values to + boolean, enums in assignments to int. + (aout_link_input_section_std): Cast rel->r_index to unsigned int. + (aout_link_input_section_ext): Likewise. Cast enums used in + comparisons with unsigned ints. + (aout_link_reloc_link_order): Cast enum to int in assignment. + * archive.c (_bfd_generic_read_ar_hdr_mag): Cast result of memchr + calls to char *. + * bfd-in.h (bfd_set_section_vma): Cast enum true to unsigned int in + assignment. + * bfd-in2.h (bfd_set_section_vma): Likewise. + * bfd.c (bfd_record_phdr): Cast enums in assignments. + * binary.c (bfd_alloc): Cast enum to long. + * coffgen.c (_bfd_coff_is_local_label_name): Cast return to boolean. + * dwarf2.c (read_abbrevs): Add casts to enum types. + (read_attribute_value): Likewise. + (arange_add): Cast result of bfd_zalloc call. + (comp_unit_contains_address): Return true and false. + (comp_unit_find_nearest_line): Cast return to boolean. + * format.c (bfd_check_format_matches, bfd_set_format): Likewise. + * gen-aout.c: define macro '_' if not defined. + * libbfd.c (bfd_realloc): Cast malloc and realloc to PTR. + (bfd_bwrite): Cast bfd_realloc to bfd_byte *. + (bfd_write_bigendian_4byte_int): Cast return to boolean. + (bfd_seek): Cast bfd_realloc to bfd_byte *. + (bfd_generic_is_local_label_name): Cast return to boolean. + * libcoff.h (_bfd_coff_adjust_symndx): Remove extraneous '\'. + * linker.c (_bfd_link_hash_newfunc): Cast bfd_hash_allocate result to + struct bfd_hash_entry *. + (_bfd_generic_link_hash_newfunc): likewise. + (_bfd_generic_final_link): Cast enum to unsigned int. + * merge.c (sec_merge_emit): Cast return to boolean. + (merge_strings): Add casts to const unsigned char *. + * reloc.c (bfd_get_reloc_code_name): Cast enums in comparison to int. + (bfd_generic_get_relocated_section_content): Cast enum to unsigned int. + * section.c (bfd_section_hash_newfunc): Cast bfd_hash_allocate result + to struct bfd_hash_entry *. + (bfd_set_section_content): Add cast to PTR in comparison. + * simple.c (simple_dummy_warning, simple_dummy_undefined_symbol, + simple_dummy_reloc_overflow, simple_dummy_reloc_dangerous, + simple_dummy_unattached_reloc, + bfd_simple_get_relocated_section_contents): Add K&R declarations and + function definitions. + * srec.c (S3Forced): Initialize to false. + (srec_get_symtab): Cast return value from bfd_alloc to asymbol *. + * stabs.c (_bfd_link_section_stabs): Cast enum to int in comparisons. + (_bfd_discard_section_stabs): Likewise. Also cast return to boolean. + * syms.c (bfd_is_undefined_symclass): Cast return to boolean. + (_bfd_stab_section_find_nearest_line): Cast enum to bfd_byte in + comparisons. + +2002-10-23 Jakub Jelinek + + * elf64-alpha.c (elf64_alpha_check_relocs): Only put maybe_dynamic + relocs into shared lib non-allocated reloc sections. + +2002-10-23 Nathan Tallent + + * dwarf2.c (add_line_info): Ensure that the line_info_table is + sorted even when given an out-of-order line sequence. + (lookup_address_in_line_info_table): When an exact VMA match is + not found, return line information with the closest VMA. + +2002-10-23 Ross Alexander + + * elf64-hppa.c: Force DT_FLAGS to always be set. Required by + HPUX 11.00 patch PHSS_26559. + +2002-10-22 Alexandre Oliva + + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't move + the options section into a separate section unless IRIX 6 + compatibility is enabled. + +2002-10-22 Alexandre Oliva + + * elflink.h (struct elf_link_sort_rela): Turn rel and rela + into arrays. + (elf_link_sort_cmp1, elf_link_sort_cmp2): Adjust. + (elf_link_sort_relocs): Likewise. Take int_rels_per_ext_rel + into account. + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Compose + R_MIPS_REL32 with R_MIPS64 if ABI_64_P. + +2002-10-21 Graeme Peterson + + * targets.c (_bfd_target_vector): Add missing qnx vectors. + +2002-10-21 Alan Modra + + * targets.c (bfd_target_list): Don't return the default target twice. + +2002-10-21 Elias Athanasopoulos + + * archive.c (_bfd_archive_bsd_update_armap_timestamp): Replace + perror with bfd_perror. + +2002-10-19 H.J. Lu + + * elflink.h (elf_link_add_object_symbols): Correctly handle + DT_RPATH and DT_RUNPATH. + +2002-10-19 Mark Kettenis + + * elf.c (elfcore_grok_note): Fix recognition on NT_PRXFPREG notes. + +2002-10-17 Denis Chertykov + + * elf32-ip2k.c (ELF_MACHINE_ALT1): Define alternate machine code + for ip2k port. + +2002-10-17 Alan Modra + + * elfxx-target.h (USE_REL): Don't define as 1. + * elf32-arm.h (USE_REL): Provide a default define of 0. + Use #if rather than #ifdef when testing USE_REL. + * elf32-m32r.c: Likewise. + + * elf32-arc.c (USE_REL): Define as 1. + * elf32-d10v.c (USE_REL): Likewise. + * elf32-m32r.c (USE_REL): Likewise. + * elf32-m68hc11.c (USE_REL): Likewise. + * elf32-m68hc12.c (USE_REL): Likewise. + * elf32-or32.c (USE_REL): Likewise. + * elfarm-nabi.c (USE_REL): Likewise. + +2002-10-16 Jakub Jelinek + + * config.bfd (s390-*-linux*): Add targ64_selvecs. + (s390x-*-linux*): Add targ_selvecs. + +2002-10-16 Alan Modra + + * Makefile.am (BFD32_BACKENDS): Remove elfarmqnx-nabi.lo, + elf32-i386-fbsd.lo, elf32-i386qnx.lo, elf32-ppcqnx.lo, + elf32-sh-lin.lo, elf32-sh64-lin.lo, elf32-sh-nbsd.lo, + elf32-sh64-nbsd.lo, elf32-shqnx.lo. Add elf32-qnx.lo. + (BFD32_BACKENDS_CFILES): Likewise for corresponding C files. + (BFD64_BACKENDS): Remove elf64-sh64-lin.lo, elf64-sh64-nbsd.lo. + (BFD64_BACKENDS_CFILES): Likewise for corresponding C files. + (SOURCE_HFILES): Add elf32-qnx.h. + (BUILD_HFILES): Add bfdver.h. + Run "make dep-am". + * Makefile.in: Regenerate. + * configure.in Update bfd vector dependencies. + * configure: Regenerate. + * elf32-i386-fbsd.c: Delete. Move code to elf32-i386.c. + * elf32-i386qnx.c: Likewise. + * elf32-ppcqnx.c: Delete. Move code to elf32-ppc.c. + * elf32-sh-nbsd.c: Delete. Move code to elf32-sh.c. + * elf32-sh-lin.c: Likewise. + * elf32-shqnx.c: Likewise. + * elf32-sh64-lin.c: Delete. Move code to elf32-sh64.c. + * elf32-sh64-nbsd.c: Likewise. + * elf64-sh64-lin.c: Delete. Move code to elf64-sh64.c. + * elf64-sh64-nbsd.c: Likewise. + * elfarmqnx-nabi.c: Delete. Move code to elfarm-nabi.c. + * elf32-arm.h (ELF_MAXPAGESIZE): Always define. + * elf32-i386.c: Remove ELF_ARCH and ELF32_I386_C_INCLUDED tests. + * elf32-ppc.c: Remove ELF32_PPC_C_INCLUDED tests. + * elf32-qnx.h (elf_backend_set_nonloadable_filepos): Always define. + (elf_backend_is_contained_by_filepos): Likewise. + (elf_backend_copy_private_bfd_data_p): Likewise. + Globalize and move functions to.. + * elf32-qnx.c: ..here. New file. + * elf32-sh.c: Remove ELF_ARCH and ELF32_SH_C_INCLUDED tests. Don't + emit target vectors when INCLUDE_SHMEDIA. + * elf32-sh64.c: Remove ELF_ARCH test. Move TARGET_* etc. defines to + end of file. + * elf64-sh64.c: Remove ELF_ARCH test. + * elfarm-nabi.c: Remove ELFARM_NABI_C_INCLUDED test. + * po/BLD-POTFILES.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2002-10-16 Alan Modra + + * elflink.h (elf_link_add_object_symbols): Error out on dynamic objects + loaded with --just-symbols. + + * elf32-i386qnx.c (TARGET_LITTLE_NAME): Define. + * elf32-ppcqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define. + * elf32-shqnx.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define. + * elfarmqnx-nabi.c (TARGET_LITTLE_NAME, TARGET_BIG_NAME): Define. + +2002-10-15 Richard Henderson + + * Makefile.am (BFD64_BACKENDS): Remove elf64-alpha-fbsd. + (BFD64_BACKENDS_CFILES): Likewise. + * configure.in (bfd_elf64_alpha_freebsd_vec): Use elf64-alpha. + * elf64-alpha-fbsd.c: Remove file, move code ... + * elf64-alpha.c: ... here. + * Makefile.in, configure: Rebuild. + +2002-10-14 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: Increment + VALUE, not ADDEND. + +2002-10-14 Stephen Clarke + + * elf32-sh.c (elf_sh_link_hash_entry): Replace + datalabel_got_offset with union of datalabel_got + offset and refcount. + (sh_elf_link_hash_newfunc): Initialize datalabel_got.refcount. + (allocate_dynrelocs): Delete unnecessary code for + STT_DATALABEL type. Create entry in got for + datalabel version of symbol if datalabel_got.refcount > 0. + (sh_elf_relocate_section): Use datalabel_got union. + (sh_elf_gc_sweep_hook): Pull common code to initialize + h and eh out of switch statement. Declare seen_stt_datalabel. + Initialize it. Decrement datalabel_got.refcount for + got relocs when seen_stt_datalabel is true. + Decrement local_got_refcounts entry for datalabel got relocs + of local symbols. + (sh_elf_copy_indirect_symbol): Copy datalabel_got field over. + (sh_elf_check_relocs): Declare seen_stt_datalabel. + Initialize it. When seen_stt_datalabel is true, increment + datalabel_got refcount rather than got.refcount. + (sh_elf_finish_dynamic_symbol): Create relocs to + initialize got entry for datalabel version of symbol. + +2002-10-14 Alan Modra + + * Makefile.am: Run "make dep-am". + (BFD_H_FILES): Remove version.h. + * bfd-in.h (BFD_VERSION, BFD_VERSION_DATE, BFD_VERSION_STRING): Move.. + * version.h: ..to here. + * configure.in (bfd_version_date): Remove. + (AC_OUTPUT): Make bfdver.h from version.h. + * bfd.c: #include "bfdver.h". + * vms-hdr.c: Likewise. + * Makefile.in: Regenerate. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2002-10-14 Alan Modra + + * archures.c (bfd_mach_i386_i386, bfd_mach_i386_i8086, + bfd_mach_i386_i386_intel_syntax, bfd_mach_x86_64, + bfd_mach_x86_64_intel_syntax bfd_mach_ppc, bfd_mach_ppc64, + bfd_mach_rs6k, bfd_mach_d10v, bfd_mach_sh, bfd_mach_v850, + bfd_mach_arc_5, bfd_mach_arc_6, bfd_mach_arc_7, bfd_mach_arc_8, + bfd_mach_m32r, bfd_mach_frv, bfd_mach_frvsimple, + bfd_mach_ia64_elf64, bfd_mach_ia64_elf32, + bfd_mach_ip2022, bfd_mach_ip2022ext, + bfd_mach_s390_31, bfd_mach_s390_64, bfd_mach_xstormy16): Renumber. + * bfd-in2.h: Regenerate. + +2002-10-14 Kaz Kojima + + * config.bfd (sh*eb-*-linux*, sh*-*-linux*): Add the alternative + endian vector to targ_selvecs. + +2002-10-13 Alexandre Oliva + + * elfxx-mips.c (mips_elf_calculate_relocation): Take + save_addend argument. Don't apply the 32-bit mask to a + GPREL32 value if it's to be used in another relocation. Don't + use forced-check computation of local_p to decide whether to + add gp0 to GPREL16 value. Don't use only the lowest 16 bits + of the addend of a non-in-place GPREL16 relocation. + (_bfd_mips_elf_relocate_section): Pass use_saved_addend_p to + mips_elf_calculate_relocation(). + +2002-10-12 Stephane Carrez + + * elf32-m68hc11.c (m68hc11_elf_relax_section): Don't treat relocs + with symbols in other sections if we relaxed something; the sections + output offsets must be re-computed before. + +2002-10-12 Stephane Carrez + + * elf32-m68hc11.c (m68hc11_elf_relax_section): Update symbols + handling to use Elf_Internal_Sym. + (m68hc11_elf_relax_delete_bytes): Likewise. + +2002-10-11 Kaz Kojima + + * elf32-sh.c (sh_elf_optimized_tls_reloc, sh_elf_mkobject, + sh_elf_object_p, dtpoff_base): New functions. + (sh_elf_howto_table): Add TLS relocs. + (sh_reloc_map): Likewise. + (sh_elf_info_to_howto): Support TLS relocs. + (elf_sh_link_hash_entry): Add tls_type and tls_tpoff32. + (sh_elf_hash_entry, sh_elf_tdata, sh_elf_local_got_tls_type): + New macros. + (sh_elf_obj_tdata): New. + (elf_sh_link_hash_table): Add tls_ldm_got. + (sh_elf_link_hash_table_create): Clear refcount of tls_ldm_got. + (allocate_dynrelocs): Support TLS relocs. + (sh_elf_size_dynamic_sections): Likewise. + (sh_elf_relocate_section): Support TLS relocs. Don't try to find + .rela.got section when found already. Return false after printing + error about unresolvable relocation. + (sh_elf_gc_sweep_hook): Support TLS relocs. + (sh_elf_check_relocs): Likewise. + (sh_elf_finish_dynamic_symbol): Likewise. + (bfd_elf32_mkobject, elf_backend_object_p): Define for TLS case. + * reloc.c: Add SH TLS relocs. + * bfd-in2.h, libbfd.h: Regenerate. + +2002-10-11 Daniel Jacobowitz + + * Makefile.in: Regenerated. + +2002-10-11 Daniel Jacobowitz + + * Makefile.am: Run dep-am. + (BFD_H_DEP): Add simple.c and linker.c. + (BFD32_LIBS): Add simple.lo. + (BFD32_LIBS_CFILES): Add simple.c. + * Makefile.in: Regenerated. + * bfd-in2.h: Regenerated. + * simple.c: New file. + +2002-10-11 Alan Modra + + * coff-arm.c (record_arm_to_thumb_glue): Avoid type-punned pointers. + (record_thumb_to_arm_glue): Likewise. + * ecoff.c (ecoff_link_add_externals): Likewise. + * elf32-arm.h (record_arm_to_thumb_glue): Likewise. + (record_thumb_to_arm_glue): Likewise. + * elf32-m32r.c (m32r_elf_add_symbol_hook): Likewise. + * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise. + * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise. + * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise. + * elf64-ppc.c (func_desc_adjust): Likewise. + * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise. + (sh64_elf64_create_dynamic_sections): Likewise. + * elflink.c (_bfd_elf_create_got_section): Likewise. + (_bfd_elf_create_dynamic_sections): Likewise. + (_bfd_elf_create_linker_section): Likewise. + * elflink.h (elf_add_default_symbol): Likewise. + (elf_link_create_dynamic_sections): Likewise. + (NAME(bfd_elf,size_dynamic_sections)): Likewise. + * elfxx-ia64.c (elfNN_ia64_aix_add_symbol_hook): Likewise. + * elfxx-mips.c (mips_elf_create_got_section): Likewise. + (_bfd_mips_elf_add_symbol_hook): Likewise. + (_bfd_mips_elf_create_dynamic_sections): Likewise. + * linker.c (generic_link_add_symbol_list): Likewise. + * xcofflink.c (xcoff_link_add_symbols): Likewise. + + * elfxx-ia64.c (oor_brl, oor_ip): Conditionally define. + + * elf64-ppc.c (edit_opd): Only zero opd syms when function is + completely removed. Correct local sym adjustment. + +2002-10-10 Stephen Clarke + + * elf32-sh.c (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): + Correct mistake in calculation of address of .got. + * elf64-sh64.c (elf_sh64_pic_plt_entry_be, + elf_sh64_pic_plt_entry_le): Likewise. + +2002-10-09 Richard Shann + Stephen Clarke + + * Makefile.am: Add entries for elf32-sh64-lin.c and + elf64-sh64-lin.c. Regenerate. + * Makefile.in: Regenerate. + * config.bfd: Change sh64eb-*-linux* and sh64-*-linux* + to use sh64 vectors rather than sh vectors. + * configure.in: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec, + bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec. + * configure: Regenerate. + * elf32-sh64-lin.c: New file. + * elf64-sh64-lin.c: New file. + * targets.c: Add bfd_elf32_sh64lin_vec, bfd_elf32_sh64blin_vec, + bfd_elf64_sh64lin_vec, bfd_elf64_sh64blin_vec. + +2002-10-08 H.J. Lu + + * elf32-i386.c (elf_i386_relocate_section): Re-arrange the + IE->LE transition for R_386_TLS_IE. + +2002-10-08 Alan Modra + + * elf64-ppc.c (edit_opd): Correct test for discarded sections. + +2002-10-07 Mark Elbrecht + + * cofflink.c (mark_relocs): Don't mark relocations in excluded + sections. + +2002-10-07 Alan Modra + + * elflink.h (elf_link_input_bfd): Remove BFD_VERSION_DATE dependent + code. + + * elf64-ppc.c (ppc64_elf_build_stubs): Increment .glink indx. + +2002-10-06 Alan Modra + + * opncls.c: Formatting. + (_bfd_new_bfd): Use a smaller section hash table. + +2002-10-05 Alexandre Oliva + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Set the type + of the other two relocations packed with a REL32 to NONE. + +2002-10-02 Stephen Clarke + + * elf32-sh.c (elf_sh_link_hash_entry): Add gotplt_refcount. + (sh_elf_link_hash_newfunc): Initialize it. + (allocate_dynrelocs): Transfer gotplt refs from plt.refcount + to got.refcount for symbols that are forced local or when + we have direct got refs. + (sh_elf_gc_sweep_hook): Adjust gotplt_refcount. Use it + to correctly adjust got.refcount and plt.refcount. + (sh_elf_copy_indirect_symbol): Copy gotplt_refcount across. + (sh_elf_check_relocs): Increment gotplt_refcount. + +2002-10-01 Jakub Jelinek + + * elf32-i386.c (elf_i386_relocate_section): Fix + movl foo@indntpoff, %eax IE->LE transition. + +2002-10-01 Jakub Jelinek + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Change TLSGD + sequence and its transitions. + +2002-10-01 Jakub Jelinek + + * elf32-i386.c (elf_i386_relocate_section): Resolve R_386_TLS_LDO_32 + to st_value + addend in non-code sections. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Resolve + R_X86_64_DTPOFF32 to st_value + addend in non-code sections. + +2002-09-30 Gavin Romig-Koch + Ken Raeburn + Aldy Hernandez + Eric Christopher + Richard Sandiford + + * archures.c (bfd_mach_mips4120, bfd_mach_mips5400): New. + (bfd_mach_mips5500): New. + * cpu-mips.c (I_mips4120, I_mips5400, I_mips5500): New. + (arch_info_struct): Add corresponding entries here. + * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_4120, + E_MIPS_MACH_5400 and E_MIPS_MACH_5500. + (_bfd_mips_elf_final_write_processing): Handle bfd_mach_mips4120, + bfd_mach_mips5400 and bfd_mach_mips5500. + (_bfd_mips_elf_mach_extends_p): New function. + (_bfd_mips_elf_merge_private_bfd_data): Use it to help merge + the EF_MIPS_MACH flags. + * bfd-in2.h: Regenerate. + +2002-09-28 Jason Thorpe + + * elf32-vax.c (elf_vax_size_dynamic_section): Don't strip + .got sections. + +2002-09-28 Alan Modra + + * elf.c (map_sections_to_segments): Correct test for start of + writable section in the same page as end of read-only section. + +2002-09-27 Matt Thomas + + * elf32-vax.c (elf_vax_check_relocs): Remove unused + local_got_refcounts usage. Remove allocation of got slot. + (elf_vax_gc_sweep_hook): Remove unused local_got_refcounts usage. + Remove de-allocation of got slot. + (elf_vax_size_dynamic_section): Fix some indentation. Add hash + traversal for elf_vax_instantiate_got_entries. Allow empty .got + sections to be GC'ed. + (elf_vax_instantiate_got_entries): New function. + (elf_vax_relocate_section): Simplify R_VAX_GOT32 handling. Remove + tests that are now handled by elf_vax_instantiate_got_entries. + Assert GOT entry falls within .got section size. Remove redundant + comparisions. Fix comments. + +2002-09-27 Jakub Jelinek + + * reloc.c: Add x86-64 TLS relocs. + * bfd-in2.h, libbfd.h: Rebuilt. + * elf64-x86-64.c (x86_64_elf_howto): Fix size fields for 32-bit + relocs. Add TLS relocs. + (x86_64_reloc_map): Add TLS relocs. + (elf64_x86_64_info_to_howto): Adjust for added TLS relocs. + (struct elf64_x86_64_link_hash_entry): Add tls_type field. + (GOT_UNKNOWN, GOT_NORMAL, GOT_TLS_GD, GOT_TLS_IE): Define. + (elf64_x86_64_hash_entry): Define. + (struct elf64_x86_64_obj_tdata): New. + (elf64_x86_64_tdata, elf64_x86_64_local_got_tls_type): Define. + (struct elf64_x86_64_link_hash_table): Add tls_ld_got. + (link_hash_newfunc): Initialize tls_type. + (elf64_x86_64_link_hash_table_create): Initialize tls_ld_got. + (elf64_x86_64_copy_indirect_symbol): Swap tls_type if necessary. + (elf64_x86_64_mkobject): New. + (elf64_x86_64_elf_object_p): Allocate struct elf64_x86_64_obj_tdata. + (elf64_x86_64_tls_transition): New. + (elf64_x86_64_check_relocs): Add r_type variable and use it. + Handle TLS relocs. + (elf64_x86_64_gc_sweep_hook): Handle TLS relocs. + (allocate_dynrelocs): Allocate GOT space for TLS relocs. + (elf64_x86_64_size_dynamic_sections): Likewise. + (dtpoff_base, tpoff): New. + (elf64_x86_64_relocate_section): Handle TLS relocs. + (elf64_x86_64_finish_dynamic_symbol): Only handle non-TLS GOT + entries. + (bfd_elf64_mkobject): Define. + + * elf32-i386.c (elf_i386_check_relocs) [R_386_TLS_LE]: Set + DF_STATIC_TLS if shared. + +2002-09-26 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_fake_sections): Don't emit unneeded + empty relocation sections. + +2002-09-26 Alan Modra + + * elf64-ppc.c (ppc_build_one_stub): Don't build glink stubs here. + (ppc64_elf_build_stubs): Build them here instead. + +2002-09-24 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_relocate_section): Put R_SPARC_RELATIVE + addend into r_addend, not *r_offset. + (elf32_sparc_finish_dynamic_symbol): Likewise. + * elf64-sparc.c (sparc64_elf_finish_dynamic_symbol): Clear xword at + R_SPARC_RELATIVE's r_offset. + +2002-09-23 Nathan Tallent + + * dwarf2.c (decode_line_info): Update to correctly decode + the (non-standard DWARF2) out-of-order address sequences + generated by the Intel C++ 6.0 compiler for ia64-Linux. + +2002-09-23 Mark Elbrecht + + * config.bfd: For DJGPP targets, match with any cpu and any machine. + +2002-09-23 Alan Modra + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Zero relocs + for discarded FDEs. Remove redundant assignment. + * elflink.h (elf_bfd_discard_info): Save edited relocs. + +2002-09-22 H.J. Lu + + * elf64-alpha.c (elf64_alpha_merge_ind_symbols): Don't merge + the relocation count between different .reloc sections. + +2002-09-21 Alan Modra + + * elf32-ppc.c (ppc_elf_relocate_section): Allow ".sbss.*" and + ".sdata.*" for R_PPC_SDAREL16, ".sbss2*" and ".sdata2*" for + R_PPC_EMB_SDA2REL. Similarly for R_PPC_EMB_SDA21 and + R_PPC_EMB_RELSDA. + + * elfcode.h (elf_slurp_reloc_table_from_section): Make "symcount" + unsigned. Move "symcount" assignment out of loop. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * configure: Regenerate. + * po/SRC-POTFILES.in: Regnerate. + +2002-09-19 Nathan Tallent + + * dwarf2.c (_bfd_dwarf2_find_nearest_line): If address length is + zero, set it to 8 for (non-standard) 64-bit DWARF2 formats + (e.g. IRIX64). + +2002-09-19 Jakub Jelinek + + * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Clear .got word + even if generating R_PPC_RELATIVE reloc. + (ppc_elf_relocate_section): Make sure relocation is performed + if skip == -2. Clear memory at r_offset when creating dynamic + relocation. + +2002-09-19 Jakub Jelinek + + * reloc.c (BFD_RELOC_386_TLS_TPOFF, BFD_RELOC_386_TLS_IE, + BFD_RELOC_386_TLS_GOTIE): Add. + * bfd-in2.h, libbfd.h: Rebuilt. + * elf32-i386.c (elf_howto_table): Add R_386_TLS_TPOFF, R_386_TLS_IE + and R_386_TLS_GOTIE. + (elf_i386_reloc_type_lookup): Handle it. + (struct elf_i386_link_hash_entry): Change tls_type type to unsigned + char instead of enum, change GOT_* into defines. + (GOT_TLS_IE_POS, GOT_TLS_IE_NEG, GOT_TLS_IE_BOTH): Define. + (elf_i386_tls_transition): Handle R_386_TLS_IE and R_386_TLS_GOTIE. + (elf_i386_check_relocs): Likewise. Avoid crash if local symbol is + accessed both as normal and TLS symbol. Move R_386_TLS_LDM and + R_386_PLT32 cases so that R_386_TLS_IE can fall through. + Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs. + (elf_i386_gc_sweep_hook): Handle R_386_TLS_IE and R_386_TLS_GOTIE. + Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs. + (allocate_dynrelocs): Allocate 2 .got and 2 .rel.got entries if + tls_type is GOT_TLS_IE_BOTH. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Handle R_386_TLS_IE and R_386_TLS_GOTIE. + Handle R_386_TLS_LE_32 and R_386_TLS_LE in shared libs. + (elf_i386_finish_dynamic_symbol): Use tls_type & GOT_TLS_IE to catch + all 4 GOT_TLS_* TLS types. + +2002-09-19 Nick Clifton + + * elflink.h (elf_fix_symbol_flags): When examining weak symbols, + follow indirect links. + +2002-09-19 Nathan Tallent + + * ecoffswap.h (ecoff_swap_pdr_in) : Update to + correctly sign-extend 32-bit ECOFF null values (0xffffffff, -1) + on 64 bit machines. + (ecoff_swap_sym_in) : Likewise. + * ecoff.c (_bfd_ecoff_slurp_symbolic_info): Fix error reading + ECOFF information: 'ioptMax' refers to the actual *size* + of the optimization symtab, not the number of entries. + +2002-09-19 Daniel Jacobowitz + + * elf32-arm.h (elf32_arm_adjust_dynamic_symbol): Update + ELF_LINK_HASH_NEEDS_PLT logic. + +2002-09-18 Daniel Jacobowitz + + * elfcode.h (elf_slurp_reloc_table_from_section): Check + correct relocation count. + +2002-09-17 Daniel Jacobowitz + + * bfd-in.h (bfd_get_dynamic_symcount): Define. + * bfd.c (struct _bfd): Add dynsymcount. + * bfd-in2.h: Regenerated. + * elf.c (_bfd_elf_canonicalize_dynamic_symtab): Set + abfd->dynsymcount. + * elfcode.h (elf_slurp_reloc_table_from_section): Check + for overflow. + +2002-09-17 Stan Cox + + * elf64-mips.c (mips_elf64_be_swap_reloca_out): Handle type2 and type3. + (mips_elf64_final_gp): Don't make up gp value. + * elfn32-mips.c (mips_elf_final_gp): Likewise. + * elfxx-mips.c (_bfd_mips_elf_final_link): Always create + .MIPS.options/.options section. + +2002-09-17 David O'Brien + + * elf32-i386-fbsd.c: Always label using the EI_OSABI method. + It is benign for FreeBSD < 4.1. Minor reformatting. + * elf64-alpha-fbsd.c: Likewise. + +2002-09-17 Jakub Jelinek + + * elf32-i386.c (elf_i386_relocate_section) [R_386_TLS_TPOFF32]: Negate + addend. + +2002-09-17 Alan Modra + + * elf64-alpha.c (alpha_elf_size_info): Make static. + +2002-09-17 Svein E. Seldal + + * coff-tic4x.c: Add function declarations and ATTRIBUTE_UNUSED. + * cpu-tic4x.c: Ditto. + +2002-09-17 Thiemo Seufer + + * elf64-mips.c (define elf_backend_ignore_discarded_relocs): Remove + duplicate define. + +2002-09-16 Bruno Haible + + * elf32-i386.c: Don't defined ELF_ARCH etc. if this file is included + by a target variant implementation. + * elf64-alpha.c: Likewise. + * elf32-i386-fbsd.c: New file. + * elf64-alpha-fbsd.c: New file. + * targets.c: Support bfd_elf32_i386_freebsd_vec and + bfd_elf64_alpha_freebsd_vec. + * configure.in: Accept the vectors bfd_elf32_i386_freebsd_vec, + bfd_elf64_alpha_freebsd_vec. + * Makefile.am (BFD32_BACKENDS): Add elf32-i386-fbsd.lo. + (BFD32_BACKENDS_CFILES): Add elf32-i386-fbsd.c. + (BFD64_BACKENDS): Add elf64-alpha-fbsd.lo. + (BFD64_BACKENDS_CFILES): Add elf64-alpha-fbsd.c. + (elf32-i386-fbsd.lo, elf64-alpha-fbsd.lo): Add dependencies. + * config.bfd: For FreeBSD targets, set targ_defvec to a FreeBSD + specific targets. Define OLD_FREEBSD_ABI_LABEL if appropriate. + +2002-09-12 Jakub Jelinek + + * elf32-i386.c (dtpoff_base, tpoff): Don't crash if tls_segment is + NULL. + (elf_i386_relocate_section): Return false after printing error about + unresolvable relocation. + +2002-09-12 Nick Clifton + + * elf32-arm.h (elf32_arm_final_link_relocate): Fix handling of + R_ARM_THM_PC11. + +2002-09-11 Jeffrey Law + + * elf32-h8300.c (elf32_h8_relax_section): Fix typo. + +2002-09-11 Andrew Haley + + * elf.c (_bfd_elf_find_nearest_line): Check functionname_ptr and + line_ptr before deciding we've found a symbol. + +2002-09-11 Nick Clifton + + * po/da.po: New Danish translation file. + * configure.in (LINGUAS): Add 'da'. + * configure: Regenerate. + +2002-09-10 Michael Snyder + + * irix-core.c (do_sections, do_sections64): New functions. + (irix_core_core_file_p): Call new functions do_sections, + do_sections64, depending on corefile (32-bit or 64-bit). + +2002-09-09 Richard Henderson + + * elfxx-ia64.c (elfNN_ia64_relax_section): Handle PCREL21M + and PCREL21F like PCREL21B. + +2002-09-04 Kevin Buettner + + * config.bfd (mips*-*-irix6*): Add new ABI vectors. Make n32 default + vector. + +2002-09-02 Nick Clifton + + * elf32-v850.c (v850_elf_final_link_relocate): Use helpful + names instead of cryptically overloaded bfd_reloc error + codes. + (v850_elf_relocate_section): Likewise. + (v850_elf_relax_section): Replace caching of external symbols + with caching of internal symbols obtained from calling + bfd_elf_get_elf_syms(). + Fixup problems with freeing cached allocated memory blocks. + +2002-09-02 Alan Modra + + * cpu-pj.c (scan_mach, compatible, arch_info_struct): Remove. + (bfd_pj_arch): Use bfd_default_scan. + * cpu-v850.c (scan): Remove. + (N): Use bfd_default_scan. + * cpu-z8k.c (scan_mach): Remove. + (arch_info_struct, bfd_z8k_arch): Reorganize so that the default is + first. Use bfd_default_scan. + + * ecoff.c (_bfd_ecoff_set_arch_mach_hook): Don't use hard-coded + bfd_mach constants. + (ecoff_get_magic): Likewise. + * elf32-v850.c (v850_elf_object_p): Likewise. + (v850_elf_final_write_processing): Likewise. + * mipsbsd.c (MY(set_arch_mach)): Likewise. + (MY(write_object_contents)): Likewise. + * coff64-rs6000.c (xcoff64_write_object_contents): Likewise. + * coffcode.h (coff_write_object_contents): Likewise. + (coff_set_arch_mach_hook): Add comment describing machine == 0. + Remove unnecessary "machine" assignments. + (coff_write_relocs): Test for the absolute section sym by testing + section and flags. + + * aoutx.h (NAME(aout,machine_type)): Recognize bfd_mach_i386_i386 + and bfd_mach_i386_i386_intel_syntax. + * pdp11.c (NAME(aout,machine_type)): Likewise. + +2002-08-30 John David Anglin + + * bfd-in.h (align_power): Cast constants to bfd_vma type. + * bfd-in2.h (align_power): Likewise. + +2002-08-30 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + + * cpu-avr.c (compatible): Don't use hard-coded mach constants. + * cpu-powerpc.c (powerpc_compatible): Likewise. + * cpu-rs6000.c (rs6000_compatible): Likewise. + +2002-08-28 Catherine Moore + + * elf32-v850.c (v850_elf_reloc_map): Add new relocs. + (v850-elf-reloc): Don't resolve pc relative relocs. + (v850_elf_ignore_reloc): New routine. + (v850_elf_final_link_relocate): Handle new relocs. + (v850_elf_relax_delete_bytes ): New routine. + (v850_elf_relax_section): New routine. + (bfd_elf32_bfd_relax_section): Define. + (HOWTO): New entries for new relocs. + * reloc.c (BFD_RELOC_V850_LONGCALL): New reloc. + (BFD_RELOC_V850_LONGJUMP): New reloc. + (BFD_RELOC_V850_ALIGN): New reloc. + * archures.c: Remove redundant v850ea architecture. + * cpu-v850.c: Remove redundant v850ea support. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerated. + +2002-08-28 Svein E. Seldal + + * config.bfd: Add tic4x-*-*coff* and c4x-*-*coff* target. + * configure.in: Add tic4x_coff vector files. + * configure: Regenerate. + * Makefile.am: Add tic4x target. + * Makefile.in: Regenerate. + +2002-08-27 Michael Hayes + + * archures.c: Add the BFD arch type tic4x. + * bfd-in.h: Add BFD_IN_MEMORY flag. + * coff-tic4x.c: New file. + * coffswap.h (coff_swap_sym_out): Add preadjuster. + * cpu-tic4x.c: New file. + * targets.c: Added tic4x- in list of xvecs. + * ticoff.h: New file. + * bfd-in2.h: Regenerate. + +2002-08-27 Adam Nemet + + * elf32-arm.h (elf32_arm_finish_dynamic_sections): Set the last + bit of DT_INIT and DT_FINI for Thumb functions. + +2002-08-26 Alan Modra + + * coffcode.h (coff_set_arch_mach_hook): Handle W65MAGIC. + +2002-08-26 Alan Modra + + * aoutx.h (NAME(aout,reloc_type_lookup)): Handle BFD_RELOC_8. + +2002-08-24 Kaz Kojima + + * elf32-sh.c (sh_elf_copy_indirect_symbol): New. + (create_got_section, allocate_dynrelocs, readonly_dynrelocs): + Likewise. + (struct elf_sh_pcrel_relocs_copied): Removed. + (struct elf_sh_dyn_relocs): New. + (struct elf_sh_link_hash_entry): Replace pcrel_relocs_copied + field with dyn_relocs. + (struct elf_sh_link_hash_table): Add short-cuts to get dynamic + sections and sym_sec. + (sh_elf_link_hash_newfunc): Clear dyn_relocs. + (sh_elf_link_hash_table_create): Clear shorts-cuts and sym_sec. + (sh_elf_create_dynamic_sections): Use create_got_section instead + of _bfd_elf_create_got_section. + (sh_elf_check_relocs): Likewise. + (sh_elf_create_dynamic_sections): Use short-cuts to the dynamic + sections. + (sh_elf_adjust_dynamic_symbol, sh_elf_size_dynamic_sections, + sh_elf_relocate_section, sh_elf_check_relocs, + sh_elf_finish_dynamic_symbol, sh_elf_finish_dynamic_sections): + Likewise. + (sh_elf_adjust_dynamic_symbol): Handle nocopyreloc. Keep the + dynamic relocations and avoiding the copy relocation when we + didn't find any dynamic relocations in the section which has + contents or is read-only. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New. + (sh_elf_size_dynamic_sections): Don't reset the size of + .rela.got section even if dynamic_sections_created flag is off. + Don't use sh_elf_discard_copies. Scan all input bfd and use + allocate_dynrelocs. Call readonly_dynrelocs to determine + whether we need DT_TEXTREL. + (sh_elf_adjust_dynamic_symbol): Use plt.refcount to determine + whether the symbol was never referred to. + (sh_elf_relocate_section): Use WILL_CALL_FINISH_DYNAMIC_SYMBOL. + (sh_elf_gc_sweep_hook): Fill with the real sweep function. + (sh_elf_check_relocs): Call create_got_section if the short-cut + to .got is null. Increment reference counters only instead of + allocating space on dynamic sections here. Don't conditionalize + uninitialized got.offset value when marking the symbol as a + global offset table entry. Keep relocations for symbols satisfied + by a dynamic library to avoid copy relocations for the symbol. + Set dynobj field of an elf hash table if needed. + (sh_elf_finish_dynamic_sections): Handle null section pointer + correctly. + (elf_backend_copy_indirect_symbol): Defined. + (elf_backend_can_refcount): Defined. + +2002-08-23 Nick Clifton + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Undo + previous change. Add comment explaining why. + +2002-08-23 Stephen Clarke + + * elf32-sh.c (elf_sh_plt0_entry_be, elf_sh_plt0_entry_le): Copy + contents of .got.plt[2] to tr0, not address of .got.plt. + (sh_elf_finish_dynamic_symbol): Do not apply GOT_BIAS when + patching absolute plt entry. For shmedia plt entry, set bottom bit + of branch to plt0 as this is a branch to an shmedia instruction. + * elf64-sh64.c (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le): + Copy contents of .got.plt[2] to tr0, not address of .got.plt. + (elf_sh64_plt_entry_be, elf_sh64_plt_entry_le): Use ptrel to + branch to plt0. + (sh64_elf64_finish_dynamic_symbol): Do not apply GOT_BIAS when + patching absolute plt entry. For shmedia plt entry, branch to + plt0 is now ptrel, so use relative offset. Set bottom bit of + branch target as it is a branch to an shmedia instruction. + +2002-08-23 Stephen Clarke , + Richard Shann + + * elf32-sh.c (sh_elf_finish_dynamic_sections): Set LSB of DT_INIT + value if .init is an SHmedia function. Similarly for DT_FINI. + * elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise. + +2002-08-23 Stephen Clarke + + * elf32-sh.c (sh_elf_size_dynamic_sections): Zero initialize + dynamic section. + * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. + +2002-08-22 Kaz Kojima + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Use a simple + byte read when reading the return address register column. + +2002-08-22 Nick Clifton + + * config.bfd: Add powepc64-*-*bsd* target. + +2002-08-22 Graeme Peterson + + * Makefile.am: Add entries for elf32-shqnx.c + * Makefile.in: Regenerate. + * config.bfd: Add support sh-*-nto* target. + * configure.in: Add support for bfd_elf32_sh{l}qnx_vec. + * configure: Regenerate. + * elf32-qnx.h: Changed typo "elf_i386qnx_*" to "elf_qnx_*" . + * elf32-sh.c: Do not include elf32-target.h if + ELF32_SH_C_INCLUDED is defined. + * elf32-shqnx.c: New file: Support for QNX. + * targets.c: Add bfd_elf32_sh{l}qnx_vec. + +2002-08-22 Nick Clifton + + * po/tr.po: Updated Turkish translation. + + * syms.c (_bfd_generic_read_minisymbols): Set bfd_error if the + symbols are not read. + +2002-08-22 Alan Modra + + * elf32-m68hc11.c: Formatting fixes. + (elf32_m68hc11_gc_mark_hook): Correct params. Remove unnecessary test. + * elf32-m68hc12.c: Formatting fixes. + (elf32_m68hc11_gc_mark_hook): Correct params. Remove unnecessary test. + +2002-08-22 Alan Modra + + * coff-rs6000.c (rs6000coff_vec ): Add SEC_CODE and + SEC_DATA. + (pmac_xcoff_vec): Likewise. + * coff64-rs6000.c (rs6000coff64_vec): Likewise. + (aix5coff64_vec): Likewise. + +2002-08-22 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add struct elf_backend_data + param to elf_backend_copy_indirect_symbol. + (_bfd_elf_link_hash_copy_indirect): Likewise. + * elflink.h (elf_add_default_symbol, elf_fix_symbol_flags): Adjust + calls to copy_indirect_symbol. + * elf32-hppa.c (elf32_hppa_copy_indirect_symbol): Likewise. + * elf32-i386.c (elf_i386_copy_indirect_symbol): Likewise. + * elf32-s390.c (elf_s390_copy_indirect_symbol): Likewise. + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise. + * elf64-s390.c (elf_s390_copy_indirect_symbol): Likewise. + * elf64-x86-64.c (elf64_x86_64_copy_indirect_symbol): Likewise. + * elfxx-ia64.c (elfNN_ia64_hash_copy_indirect): Likewise. + * elfxx-mips.c (_bfd_mips_elf_copy_indirect_symbol): Likewise. + * elfxx-mips.h (_bfd_mips_elf_copy_indirect_symbol): Likewise. + * elf.c (_bfd_elf_link_hash_copy_indirect): Likewise. Properly + test refcounts for "used" values. + +2002-08-21 John David Anglin + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Add PARAMS to + argument declaration. + +2002-08-19 Elena Zannoni + + * archures.c (bfd_mach_ppc_e500): Added. + * bfd-in2.h: Rebuilt. + * cpu-powerpc.c (bfd_powerpc_archs): Added e500. + +2002-08-19 Alan Modra + + * elf32-m68hc12.c (elf_backend_can_gc_sections): False. + +2002-08-17 Andrew Cagney + + * elf.c (bfd_elf_get_elf_syms): Change type of `esym' to + `bfd_byte'. + +2002-08-17 Stan Cox + + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Use the + IRIX 6 segment layout for NEWABI. + +2002-08-16 Stephen Clarke + + * elf32-sh.c (sh_elf_gc_mark_hook): For sh64, skip indirect + symbols when looking for section referred to by a relocation. + * elf64-sh.c (sh_elf64_gc_mark_hook): Likewise. + +2002-08-15 Alan Modra + + * elf32-i370.c: Move reloc enum to include/elf/i370.h. + +2002-08-15 Hans-Peter Nilsson + + * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Add + missing check for whether the symbol is referenced by DSO before + unexporting it as an unneeded dynamic symbol. + +2002-08-14 H.J. Lu + + * libbfd.h: Regenerate. + +2002-08-14 H.J. Lu + + * config.bfd: Always add 64bit vectors to 32bit Linux/mips. + +2002-08-14 Stephane Carrez + + * elf32-m68hc11.c (m68hc11_relax_group): New to relax group of + instructions. + (m68hc11_direct_relax): New to define table of relaxable instructions. + (find_relaxable_insn): New, find a relaxable insn. + (compare_reloc): New to compare two relocs. + (m68hc11_elf_relax_section): New, relax text sections. + (m68hc11_elf_relax_delete_bytes): New, delete bytes and adjust branchs. + (elf32_m68hc11_check_relocs): New function for GC support. + (elf32_m68hc11_relocate_section): New function for GC support. + (bfd_elf32_bfd_relax_section): Define to support linker relaxation. + (elf_backend_check_relocs): Likewise. + (elf_backend_relocate_section): Likewise. + +2002-08-13 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections): Don't count + definitions in shared objects when checking symbol with + undefined version. + +2002-08-13 Stephane Carrez + + * elf32-m68hc11.c (elf32_m68hc11_gc_mark_hook): New for section GC. + (elf32_m68hc11_gc_sweep_hook): Likewise. + (elf_backend_gc_mark_hook): Define for GC section support. + (elf_backend_gc_sweep_hook): Likewise. + (elf_backend_can_gc_sections): Likewise. + + * elf32-m68hc12.c: Likewise. + +2002-08-13 Stephane Carrez + + * elf32-m68hc11.c (_bfd_m68hc11_elf_print_private_bfd_data): New. + (_bfd_m68hc11_elf_merge_private_bfd_data): New function. + (_bfd_m68hc11_elf_set_private_flags): New function. + Use them to set/check/print ELF flags specific to 68HC11. + + * elf32-m68hc12.c (_bfd_m68hc12_elf_print_private_bfd_data): New. + (_bfd_m68hc12_elf_merge_private_bfd_data): New function. + (_bfd_m68hc12_elf_set_private_flags): New function. + Use them to set/check/print ELF flags specific to 68HC12. + +2002-08-13 Stephane Carrez + + * elf32-m68hc11.c (elf_m68hc11_howto_table): Add the new relocs; + fix masks for PC-rel relocs. + (m68hc11_elf_ignore_reloc): New function. + + * elf32-m68hc12.c (m68hc12_elf_special_reloc): New to handle specific + 68HC12 banked addressing relocs. + (m68hc12_phys_addr): New to compute physical address of banked memory. + (m68hc12_phys_page): Likewise for page. + (m68hc12_addr_is_banked): New to see if address is in banked area. + (elf_m68hc12_howto_table): Add new relocs and rename to xx12. + +2002-08-13 Stephane Carrez + + * reloc.c (BFD_RELOC_M68HC11_RL_JUMP, BFD_RELOC_M68HC11_RL_GROUP, + BFD_RELOC_M68HC11_LO16, BFD_RELOC_M68HC11_PAGE, + BFD_RELOC_M68HC11_24): New relocs for 68HC11/68HC12. + * bfd-in2.h: Regenerate. + +2002-08-12 H.J. Lu + + * elflink.h (elf_add_default_symbol): Preserve section across + elf_merge_symbol. + +2002-08-09 Graeme Peterson + + * Makefile.am: Add entries for elf32-ppcqnx.c, and add + elf32-qnx.h dependency to elfarmqnx-nabi.c and elf32-i386qnx.c. + * Makefile.in: Regenerate. + * config.bfd: Add support for powerpc{le}-*-nto targets. + * configure.in: Add support for bfd_elf32_powerpc{le}qnx_vec. + * configure: Regenerate. + * elf32-i386qnx.c: Moved backend functions into a QNX specific + common file "elf32-qnx.h", and now include that file. + * elf32-qnx.h: New file: QNX specific common elf backend. + * elf32-ppc.c: Do not include elf32-target.h if + ELF32_PPC_C_INCLUDED is defined. + * elf32-ppcqnx.c: New file: Support for QNX. + * elfarmqnx-nabi.c: Include elf32-qnx.h for qnx elf backend. + * targets.c: Add bfd_elf32_powerpc{le}qnx_vec. + +2002-08-09 Nick Clifton + + * po/sv.po: Updated Swedish translation. + +2002-08-09 Thiemo Seufer + + * elfxx-mips.c (mips_elf_global_got_index): Avoid segfault if + g->global_gotsym is NULL. + +2002-08-08 H.J. Lu + + * elflink.h (elf_add_default_symbol): Don't warn if a definition + overrides an indirect versioned symbol. + +2002-08-08 Jakub Jelinek + + * elf32-i386.c (elf_i386_relocate_section): Fill in proper addend + for R_386_TLS_TPOFF32 relocs against symndx 0. + +2002-08-07 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Check symbol + with undefined version if needed. + (elf_link_assign_sym_version): Match a default symbol with a + version without definition. No need to hide the default + definition separately. + +2002-08-08 Alan Modra + + * elflink.h (elf_link_output_extsym): Don't output symbols from + SEC_EXCLUDE sections. + + * aoutx.h (aout_link_write_symbols): Correct handling of warning syms. + +2002-08-07 Alan Modra + + * elf64-ppc.c (edit_opd): Arrange to drop symbols for discarded .opd + entries. + +2002-08-07 Thiemo Seufer + + * elfxx-mips.c (mips_elf_create_dynamic_relocation): Cast signedness + mismatch. + +2002-08-07 Thiemo Seufer + + * elfxx-mips.c (ABI_64_P): Remove superfluous check. + +2002-08-07 Thiemo Seufer + + * elf32-mips.c (mips_reloc_map): Fix typo. + +2002-08-06 Alan Modra + + * xcofflink.c (xcoff_write_global_symbol): Set n_scnum for abs_section. + +2002-08-06 Alan Modra + + * elf64-ppc.c (ppc64_elf_howto_raw): Zero all src_mask entries. + +2002-08-06 Alan Modra + + * libxcoff.h: Use PARAMS on function declarations. + * coff-rs6000.c (xcoff_generate_rtinit): Simplify size calc. + * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise. + + * coff-rs6000.c: (xcoff_rtype2howto): Don't place reloc address in + addend. + * coff64-rs6000.c: (xcoff64_rtype2howto): Likewise. + +2002-08-06 Alan Modra + + * coff-rs6000.c: Formatting fixes. + (xcoff_calculate_relocation): Use PARAMS in declaration. + (xcoff_complain_overflow): Likewise. + (xcoff_ppc_relocate_section): Use old-style function pointer call. + (bfd_xcoff_backend_data): Remove useless comments. + (rs6000coff_vec): Likewise. + (bfd_pmac_xcoff_backend_data): Likewise. + (pmac_xcoff_vec): Likewise. + + * coff64-rs6000.c: Formatting fixes. + (xcoff64_calculate_relocation): Use PARAMS in declaration. + (xcoff64_ppc_relocate_section): Use old-style function pointer call. + (bfd_xcoff_backend_data): Remove useless comments. + (rs6000coff64_vec): Likewise. + (bfd_xcoff_aix5_backend_data): Likewise. + (aix5coff64_vec): Likewise. + +2002-08-06 Alan Modra + + * coff-rs6000.c (xcoff_howto_table): Revert some of last change to + mask entries. Use complain_overflow_dont for R_REF. + (xcoff_reloc_type_ba): Revert last change. + (xcoff_reloc_type_br): Likewise. + (xcoff_reloc_type_crel): Likewise. + (xcoff_ppc_relocate_section): Likewise. + * coff64-rs6000.c (xcoff64_reloc_type_br): Likewise. + (xcoff64_ppc_relocate_section): Likewise. + (xcoff64_howto_table): Revert some of last change to mask entries. + Use complain_overflow_dont for R_REF. + + * coff-rs6000.c (xcoff_howto_table): Fix src_mask entries. Make all + relocs with bitsize == 16 have size = 1. + (xcoff_reloc_type_ba): Correct src_mask and dst_mask adjustment. + (xcoff_reloc_type_br): Likewise. + (xcoff_reloc_type_crel): Likewise. + (xcoff_ppc_relocate_section): Set up src_mask and dst_mask correctly. + * coff64-rs6000.c (xcoff64_reloc_type_br): Correct src_mask and + dst_mask adjustment. + (xcoff64_ppc_relocate_section): Set up src_mask and dst_mask correctly. + (xcoff64_howto_table): Fix src_mask entries. Make all relocs with + bitsize == 16 have size = 1. + +2002-08-01 Denis Chertykov + + * elf32-ip2k.c: Processor manufacturer changed to Ubicom. + (struct misc): New field isymbuf. All free_* fields removed. + (symbol_value): Pass in internal syms. No need to swap syms in. + (ip2k_elf_relax_section): Use bfd_elf_get_elf_syms. Properly free + possibly cached info. + (tidyup_after_error): Removed. + (ip2k_elf_relax_section_pass1): Don't use removed fields of struct + misc. Use new field. + (adjust_all_relocations): Use internal syms. No need to swap syms + in and out. + (add_page_insn): Don't use removed fields of struct misc. + +2002-08-01 Nick Clifton + + * elf32-arm.h: Revert previous delta. + +2002-08-01 Nick Clifton + + * configure.in (AM_INIT_AUTOMAKE): Bump version number. + * configure: Regenerate. + +2002-07-31 H.J. Lu + + * config.bfd: Add x86-64 vector to Linux/i386 if 64bit BFD is + selected. + +2002-07-31 H.J. Lu + + * config.bfd: Add n32 vectors to 32bit Linux/mips if 64bit BFD + is selected. + +2002-07-31 Jakub Jelinek + + * elf32-i386.c (elf_i386_copy_indirect_symbol): Swap tls_type + if _bfd_elf_link_hash_copy_indirect will swap got.refcount. + +2002-07-31 Ian Dall + + * cpu-ns32k.c (_bfd_ns32k_put_immdeiate, _bfd_ns32k_get_immediate): + There is no 8 byte relocation type for this architecture. + (do_ns32k_reloc): Use bfd_vma instead of native types. + (bfd_ns32k_put_immediate, _bfd_ns32k_relocate_contents) put_data + returns void. + (_bfd_ns32k_put_displacement): Don't check for overflow. We can + rely on generic code to do that. + * aout-ns32k.c (howto_table): Add appropriate overflow detection + to all table entries. + (_bfd_ns32k_relocate_contents): put_data returns void. + * ns32k.h: (_bfd_ns32k_put_displacement, _bfd_ns32k_put_immediate) + (_bfd_do_ns32k_reloc_contents): Fix prototypes. put data functions + return void. + +2002-07-31 Ian Dall + + * aoutx.h (aout_link_check_ar_symbols): Whether to include an + archive object is target dependant. + +2002-07-31 Adam Nemet + + * elf32-arm.h (ARM_PLT_ENTRY_SIZE): Rename PLT_ENTRY_SIZE. + (THUMB_PLT_ENTRY_SIZE): New macro. + (PLT_ENTRY_SIZE): Return the appropriate *_PLT_ENTRY_SIZE. + (elf32_arm_plt0_entry): Rename PLT_ENTRY_SIZE to + ARM_PLT_ENTRY_SIZE. + (elf32_arm_plt_entry): Likewise. + (elf_backend_plt_header_size): Likewise. + (elf32_thumb_plt0_entry): New global. + (elf32_arm_finish_dynamic_sections): Use it. Put Thumb entries + into .plt.thumb. + (elf32_thumb_plt_entry): New global. + (elf32_arm_finish_dynamic_symbol): Use it. Use .thumb.plt for + Thumb entries. Set the bottom bit of the corresponding GOT entry + for a Thumb PLT entry. + (struct elf32_arm_plt_entry_info): New structure. + (struct elf32_arm_link_hash_entry, plt_info): New member of this + type. + (elf32_arm_link_hash_newfunc): Initialize new member. + (elf32_arm_final_link_relocate, R_ARM_THM_PC22 case): Handle + relocations against the PLT. + (elf32_arm_check_relocs, case R_ARM_PLT32 case): Set + first_rel_type if this is the first time we encounter the symbol. + (elf32_arm_check_relocs, case R_ARM_THM_PC22 case): New case. + Determine if relocation needs a PLT entry. Set first_rel_type if + this is the first time we encounter the symbol + (elf32_arm_adjust_dynamic_symbol): Create PLT entries for Thumb + functions as well. + (elf32_arm_size_dynamic_sections): Handle .plt.thumb like .plt. + (elf32_arm_create_dynamic_sections): New function. Create the + .plt.thumb section. + (elf_backend_create_dynamic_sections): Call it. + +2002-07-31 Nick Clifton + + * bfd.c (bfd_alt_mach_code): Rename parameter 'index' to + 'alternative' in order to avoid shadowing global symbol of the + same name. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2002-07-31 Thiemo Seufer + + * Makefile.am: Add n32 ABI support. + * Makefile.in: Regenerate. + * config.bfd: Add n32 vectors to mips64*-*-linux* targets. Treat 64 + bit vectors for mips*-*-linux targets as optional. + * configure.in: Add n32 ABI vectors. + * configure: Regenerate. + * elf32-mips.c (mips_elf32_object_p): Reject n32 ABI files. + * elfn32-mips.c: New file, n32 ABI support. + * targets.c: Add n32 ABI vectors. + +2002-07-30 Graeme Peterson + + * elfarmqnx-nabi.c: New file: Support for QNX. + * config.bfd: Add support for arm-*-nto target. + * configure.in: Add support for bfd_elf32_{big|little}armqnx_vec. + * configure: Regenerate. + * Makefile.am: Add entries for elfarmqnx-nabi.c. + * Makefile.in: Regenerate. + * elf32-arm.h (ELF_MAXPAGESIZE): Do not define if already defined. + Do not define global function if ELFARM_NABI_C_INCLUDED is defined. + * elfarm-nabi.c: Do not include elf32-arm.h if + ELFARM_NABI_C_INCLUDED is defined. + * targets.c: Add bfd_elf32_{big|little}armqnx_vec. + +2002-07-30 Nick Clifton + + * po/sv.po: Updated Swedish translation. + +2002-07-30 Jakub Jelinek + + * elf.c (elf_fake_sections): Fix up .tbss sh_size and sh_type. + +2002-07-30 Alan Modra + + * aoutx.h (some_aout_object_p): Clean up tdata properly on error. + * archive.c (bfd_generic_archive_p): Likewise. + * coff-rs6000.c (_bfd_xcoff_archive_p): Likewise. + (_bfd_xcoff_archive_p): Use bfd_scan_vma in place of strtol. + * coff64-rs6000.c (xcoff64_slurp_armap): Likewise. + (xcoff64_archive_p): Likewise. + (xcoff64_openr_next_archived_file): Likewise. + (xcoff64_archive_p): Clean up tdata properly on error. + * coffgen.c (coff_real_object_p): Likewise. + (coff_object_p): Release filehdr and opthdr. + * ecoff.c (_bfd_ecoff_archive_p): Clean up tdata properly on error. + * ieee.c (ieee_archive_p): Likewise. + * ihex.c (ihex_object_p): Likewise. + (ihex_mkobject): Always allocate tdata. + * peicode.h (pe_ILF_object_p): Release bfd_alloc'd buffer on error. + * srec.c (srec_mkobject): Always allocate tdata. + (srec_object_p): Clean up tdata properly on error. + (symbolsrec_object_p): Likewise. + * versados.c (versados_object_p): Likewise. + * vms-misc.c (_bfd_vms_get_record): Use bfd_malloc instead of malloc, + and bfd_realloc instead of realloc. + (add_new_contents): Use bfd_alloc instead of bfd_malloc for sections. + * vms.c (vms_initialize): Always allocate tdata. Use bfd_alloc in + place of bfd_malloc, simplifying error freeing. Free hash table too. + (vms_object_p): Clean up tdata on error. + (vms_mkobject): Don't complain on stderr if vms_initialize fails. + (vms_close_and_cleanup): Adjust for bfd_alloc use. + +2002-07-30 Alan Modra + + * elfxx-ia64.c (elfNN_ia64_final_write_processing): Set e_flags. + +2002-07-26 Chris Demetriou + + * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Merge ASE + flags into resulting BFD. + +2002-07-26 Alan Modra + + From John Reiser + * elf32-i386.c (elf_i386_link_hash_table_create): Clear + tls_ldm_got.refcount. + +2002-07-25 Thiemo Seufer + + * elf64-mips.c: Update TODO comment. + (mips_elf64_higher_reloc,mips_elf64_highest_reloc, + mips_elf64_gprel16_reloca): Remove prototypes. + (mips16_jump_reloc,mips16_gprel_reloc): Add functions. + (UNUSED_RELOC): Replace by EMPTY_RELOC. + (mips_elf64_howto_table_rel): Use special R_MIPS_HI16 handling. Remove + wrong comments. Remove disfunctional support of R_MIPS_HIGHER and + R_MIPS_HIGHEST. + (mips_elf64_howto_table_rela): Fix handling of R_MIPS_GPREL16 and + R_MIPS_GOT16. Remove wrong comments. + (elf_mips16_jump_howto,elf_mips16_gprel_howto, + elf_mips_gnu_vtinherit_howto,elf_mips_gnu_vtentry_howto): New, code + from elf32-mips.c. + (mips_elf64_hi16_reloc): Fix formatting. + (mips_elf64_higher_reloc,mips_elf64_highest_reloc): Remove. + (mips_elf64_got16_reloc): Fix formatting. Remove superfluous code. + Better comment. Fall back to R_MIPS_GOT_DISP instead of abort(). + (mips_elf64_gprel16_reloc): Make static. Add check for + partial_inplace. + (mips_elf64_gprel16_reloca): Remove. + (mips_elf64_literal_reloc): New function. + (mips_elf64_gprel32_reloc): Fix formatting. + (mips_elf64_shift6_reloc): Fix comment. Make static. + (mips16_jump_reloc,mips16_gprel_reloc): New functions, code from + elf32-mips.c. + (elf_reloc_map,mips_reloc_map): New mapping table, similiar as in + elf32-mips.c + (bfd_elf64_bfd_reloc_type_lookup): Use the mapping table. Enable GNU + specific relocations. + (mips_elf64_rtype_to_howto): Enable GNU specific relocations. + (mips_elf64_object_p): Invert logic to check for SGI-ish ABI. + (ELF_MAXPAGESIZE): Add comment. + +2002-07-25 Nick Clifton + + * po/sv.po: Updated Swedish translation. + * po/es.po: Updated Spanish translation. + * po/fr.po: Updated French translation. + +2002-07-25 Alan Modra + + * elf-bfd.h (_bfd_elf32_link_record_local_dynamic_symbol): Define + as elf_link_record_local_dynamic_symbol. + (_bfd_elf64_link_record_local_dynamic_symbol): Likewise. + (elf_link_record_local_dynamic_symbol): Declare. Now returns int. + * elflink.h (elf_link_record_local_dynamic_symbol): Move to.. + * elflink.c: .. here. Use bfd_elf_get_elf_syms. Check whether an + attempt is made to record a symbol in a discarded section, and + return `2' in that case. + +2002-07-24 Nick Clifton + + * po/sv.po: Updated Swedish translation. + * po/es.po: Updated Spanish translation. + +2002-07-23 Alan Modra + + * po/SRC-POTFILES.in: Regenerate. + + * elf-hppa.h (elf_hppa_relocate_section): If relocatable, return + immediately. Remove code handling relocatable linking. + * elf32-avr.c (elf32_avr_relocate_section): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-fr30.c (elf32_frv_relocate_section): Likewise. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-h8300.c (elf32_h8_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf32-v850.c (v850_elf_relocate_section): Likewise. + * elf32-vax.c (elf_vax_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf32-avr.c (elf_backend_rela_normal): Define. + * elf32-cris.c: Likewise. + * elf32-fr30.c: Likewise. + * elf32-frv.c: Likewise. + * elf32-h8300.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-ip2k.c: Likewise. + * elf32-sparc.c: Likewise. + * elf32-v850.c: Likewise. + * elf32-vax.c: Likewise. + * elf64-hppa.c: Likewise. + * elf64-sparc.c: Likewise. + * elf32-fr30.c (elf32_frv_relocate_section): Edit comment. + * elf32-frv.c (elf32_frv_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. + * elf-m10200.c (USE_RELA): Don't define. + * elf-m10300.c: Likewise. + * elfarm-oabi.c: Likewise. + * elf32-i370.c: Likewise. + * elf32-ip2k.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-vax.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-x86-64.c: Likewise. + * elfxx-ia64.c: Likewise. + * elf32-avr.c (USE_REL): Don't undef. + * elf32-ip2k.c: Likewise. + +2002-07-23 Nick Clifton + + * elf-bfd.h (struct elf_backend_data): Add new bitfield + 'want_p_paddr_set_to_zero'. + * elfxx-target.h: Set default value for want_p_paddr_set_to_zero + to false; + * elfxx-ia64.c: Set want_p_paddr_set_zero for HPUX target. + * elf.c (copy_private_bfd_data): Test want_p_paddr_set_zero. + +2002-07-23 Gabor Keresztfalvi + + * nlmcode.h (nlm_swap_auxiliary_headers_out): Swapped the order of + the MeSsAgEs and CoPyRiGhT tags to make >=NW4.x NLM loaders to + show the Copyright string. + Minor formatting tidy ups. + +2002-07-23 Nick Clifton + + * po/fr.po: Updated French translation. + * po/sv.po: Updated Swedish translation. + +2002-07-23 Alan Modra + + * elflink.h (elf_link_input_bfd): Don't change internal symbols + when outputting relocs. + +2002-07-20 Jason Thorpe + + * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only insert + DT_PLTGOT into the dynamic section if there is a PLT. + +2002-07-19 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_discard_info): New function, code from + elf32-mips.c. + (_bfd_mips_elf_write_section): Likewise. + * elfxx-mips.h (_bfd_mips_elf_discard_info): New prototype. + (_bfd_mips_elf_write_section): Likewise. + * elf32-mips.c (elf32_mips_discard_info): Move to elfxx-mips.c. + (elf32_mips_write_section): Likewise. + * elf64-mips.c (_bfd_mips_elf_ignore_discarded_relocs): Use it. + (_bfd_mips_elf_write_section): Likewise. + +2002-07-19 Alan Modra + + * elfxx-ia64.c: (elfNN_ia64_modify_segment_map): Properly scan + PT_IA_64_UNWIND segments for a given section. + +2002-07-17 H.J. Lu + + * Makefile.am: Fix a typo. + * Makefile.in: Regenerate. + +2002-07-15 Denis Chertykov + Frank Ch. Eigler + Ben Elliston + Alan Lehotsky + John Healy + Graham Stott + Jeff Johnston + + * Makefile.am: Add support for ip2k. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * archures.c: Add support for ip2k. + * config.bfd: Add support for ip2k. + * configure.in: Add support for ip2k. + * configure: Regenerate. + * reloc.c: Add support for ip2k. + * targets.c: Add support for ip2k. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * cpu-ip2k.c: New file. + * elf32-ip2k.c: New file. + +2002-07-17 Ian Rickards + + * dwarf2.c (concat_filename): If we can't establish the directory + just return the filename. + +2002-07-16 Moritz Jodeit + + * peXXigen.c (_bfd_XXi_swap_aouthdr_out): Correct order of memset args. + +2002-07-16 Alan Modra + + * elflink.h: Formatting fixes, tidy prototypes. + (elf_link_assign_sym_version): Move common code out of loop. + +2002-07-16 Alan Modra + + * elflink.h (elf_link_input_bfd): Don't call reloc_emitter when + reloc section size is zero. Correct reloc output location. + +2002-07-16 John David Anglin + + * elf-hppa.h (elf_hppa_reloc_final_type): Use R_PARISC_PCREL16F as + the final type for the e_fsel selector when generating PA2.0W code. + (elf_hppa_relocate_insn): Provide support for PA2.0W 16-bit format 1 + relocations. + +2002-07-14 H.J. Lu + + * elflink.h (elf_link_assign_sym_version): Hide the default + definition if there is a hidden versioned definition. + +2002-07-12 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section): Drop nonsensical + dynamic reference test in assertion when initializing GOT with + static contents. Just assert that there are either no dynamic + sections, the symbol is defined in the regular objects or that the + symbol is undef weak. Tweak comment. + (elf_cris_finish_dynamic_symbol): Emit .got reloc for a program + only if the symbol isn't defined in the program and isn't undef + weak. + (elf_cris_adjust_dynamic_symbol): Simplify condition for getting + rid of PLT entry: only do it if the symbol isn't defined in a DSO. + When doing so, clear ELF_LINK_HASH_NEEDS_PLT. Tweak comments. + (elf_cris_discard_excess_program_dynamics): Don't consider + ELF_LINK_HASH_REF_DYNAMIC when omitting .got runtime relocs. + +2002-07-11 Alan Modra + + * elf32-i386.c (elf_i386_relocate_section): Don't complain about + unresolved debugging relocs in dynamic applications. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + +2002-07-10 Alan Modra + + * elf64-ppc.c (ONES): Define. + (ppc64_elf_howto_table): Use ONES here to avoid warnings. Fill in + missing src_mask fields. Tweak R_PPC64_NONE, R_PPC64_COPY. Fill + in missing dst_mask fields on R_PPC64_PLT32, R_PPC64_PLTREL32. + + * elf64-ppc.c (ppc64_elf_get_symbol_info): Delete. + (ppc64_elf_set_private_flags): Delete. + (ppc64_elf_section_from_shdr): Delete. + (ppc64_elf_merge_private_bfd_data): Remove flag checking/merging code. + (ppc64_elf_fake_sections): Delete. + (bfd_elf64_bfd_set_private_flags): Don't define. + (bfd_elf64_get_symbol_info): Likewise. + (elf_backend_section_from_shdr): Likewise. + (elf_backend_fake_sections): Likewise. + +2002-07-10 Marco Walther + + * elf.c: (assign_section_numbers) Set sh_entsize for .stab only + when not already set. + * elf64-sparc.c: (sparc64_elf_fake_sections): New function. + (elf_backend_fake_sections): Define. + +2002-07-10 Alan Modra + + * merge.c (_bfd_merge_section): Remove redundant output_section check. + Formatting. + (_bfd_merge_sections): Don't set SEC_EXCLUDE on unused sections. + +2002-07-09 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section): Move sanity-check for + NULL sym_hashes to just before use. + : In test for local symbol, accept also + symbol with non-default visibility. + : Ditto. + : + Ditto. + (cris_elf_gc_sweep_hook): Only decrease h->plt.refcount for + symbol with non-default visibility. + (cris_elf_check_relocs): At tests for local symbol before + increasing h->plt.refcount, also check for non-default + visibility. Ditto when checking for local symbol to eliminate + pc-relative runtime relocs. + +2002-07-08 Alan Modra + + * elf.c: Formatting. + (IS_SOLARIS_PT_INTERP): Add p_paddr and p_memsz checks. + (INCLUDE_SECTION_IN_SEGMENT): Remove IS_SOLARIS_PT_INTERP. + (copy_private_bfd_data): Set p_vaddr on broken Solaris PT_INTERP + segments. + +2002-07-07 Mark Mitchell + Alan Modra + + * cofflink.c (_bfd_coff_final_link): On PE COFF systems, take into + account the impact of relocation count overflow when computing + section offsets. + * coffcode.h (coff_write_relocs): Use obj_pe when deciding whether + or not to apply the PE COFF reloc overflow handling. Fix a + fencepost error in deciding whether or not to use that technique. + +2002-07-07 Alan Modra + + * elf-bfd.h (struct elf_reloc_cookie): Remove locsym_shndx, + change type of locsyms. + (bfd_elf_get_elf_syms): Declare. + * elf.c (bfd_elf_get_elf_syms): New function. + (group_signature): Use bfd_elf_get_elf_syms. + (bfd_section_from_r_symndx): Likewise. + * elfcode.h (elf_slurp_symbol_table): Likewise. + * elflink.h (elf_link_is_defined_archive_symbol): Likewise. + (elf_link_add_object_symbols): Likewise. Reorganise to increase + locality of various data structures. Properly free internal relocs. + (elf_bfd_final_link): Properly free internal relocs. + (elf_link_check_versioned_symbol): Use bfd_elf_get_elf_syms. + (elf_link_input_bfd): Likewise. + (elf_gc_mark): Likewise. Properly free internal relocs. + (elf_gc_sweep): Properly free internal relocs. + (elf_reloc_symbol_deleted_p): No need to swap syms in. + (elf_bfd_discard_info): Use bfd_elf_get_elf_syms. Properly free + internal relocs. + * elf-m10200.c (mn10200_elf_relax_section): Use bfd_elf_get_elf_syms. + Properly free possibly cached info. + (mn10200_elf_relax_delete_bytes): Remove symbol swapping code. + (mn10200_elf_symbol_address_p): Pass in internal syms. Remove + symbol swapping code. + (mn10200_elf_get_relocated_section_contents): Use bfd_elf_get_elf_syms. + Properly free possibly cached info. + * elf-m10300.c (mn10300_elf_relax_section): As above for elf-m10200.c. + (mn10300_elf_relax_delete_bytes): Likewise. + (mn10300_elf_symbol_address_p): Likewise. + (mn10300_elf_get_relocated_section_contents): Likewise. + * elf32-h8300.c (elf32_h8_relax_section): As above for elf-m10200.c. + (elf32_h8_relax_delete_bytes): Likewise. + (elf32_h8_symbol_address_p): Likewise. + (elf32_h8_get_relocated_section_contents): Likewise. + * elf32-m32r.c (m32r_elf_relax_section): As above for elf-m10200.c. + (m32r_elf_relax_delete_bytes): Likewise. + (m32r_elf_get_relocated_section_contents): Likewise. + * elf32-sh.c (sh_elf_reloc_loop): Free section contents using + elf_section_data to determine whether cached. + (sh_elf_relax_section): As above for elf-m10200.c. + (sh_elf_relax_delete_bytes): Likewise. + (sh_elf_get_relocated_section_contents): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relax_section): As above. + * elf64-alpha.c (elf64_alpha_relax_section): As above. Also delay + reading of local syms. + * elf64-mmix.c (mmix_elf_relax_section): Likewise. + * elf64-sh64.c (sh_elf64_get_relocated_section_contents): As above. + * elfxx-ia64.c (elfNN_ia64_relax_section): As above. + * elfxx-mips.c (_bfd_mips_elf_check_relocs): Properly free internal + relocs. + * elf32-arm.h (bfd_elf32_arm_process_before_allocation): Properly + free internal relocs and section contents. Don't read symbols. + * elf32-hppa.c (get_local_syms): Use bfd_elf_get_elf_syms. + (elf32_hppa_size_stubs): Don't free local syms. + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Delay + reading of local syms. Use bfd_elf_get_elf_syms. Properly free + possibly cached info. + * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. + * elf64-hppa.c (elf64_hppa_check_relocs): Use bfd_elf_get_elf_syms. + * elf64-ppc.c (struct ppc_link_hash_table): Delete bfd_count and + all_local_syms. + (get_local_syms): Delete function. + (edit_opd): Use bfd_elf_get_elf_syms. Free on error exit. Cache + on exit. + (ppc64_elf_size_stubs): Use bfd_elf_get_elf_syms. Free/cache on exit. + +2002-07-05 Jim Wilson + + * syms.c (decode_section_type): New. + (bfd_decode_symclass): Call decode_section_type. + +2002-07-04 Jakub Jelinek + + * merge.c (_bfd_merged_section_offset): Avoid accessing byte before + section content start. + Reported by Michael Schumacher . + +2002-07-04 Alan Modra + + * section.c (_bfd_strip_section_from_output): Remove unnecessary + link order code. Don't actually remove the output section here; + Just set a flag for the linker to do so. + * elflink.c (_bfd_elf_link_renumber_dynsyms): Test for removed + sections when setting up output section dynsyms. + +2002-07-04 Alan Modra + + * elflink.h (elf_link_add_object_symbols): Revert 1999-09-02 hpux + fudge. + * elf.c (bfd_section_from_shdr): Work around broken hpux shared + libs here instead. + +2002-07-02 Martin Schwidefsky + + * elf64-s390.c (create_got_section): Set .got section alignment to + 8 bytes. + (elf_s390_check_relocs): Set .rela.dyn section alignment to 8 bytes. + +2002-07-02 Alan Modra + + * elf.c (_bfd_elf_reloc_type_class): Fix comment grammar. + +2002-07-01 Matt Thomas + + * elf32-vax.c (elf32_vax_print_private_bfd_data): Change EF_* + to EF_VAX_*. + +2002-07-01 Thiemo Seufer + + * elfxx-mips.c (ABI_64_P): Fix comment. + (MIPS_ELF_OPTIONS_SECTION_NAME,MIPS_ELF_STUB_SECTION_NAME): Use the + new section names for N64 ABI. + (mips_elf_output_extsym): No special _gp_disp handling for NewABI. + (mips_elf_calculate_relocation): Code formatting. + (mips_elf_create_dynamic_relocation): Likewise. + (_bfd_mips_elf_fake_sections): IRIX6 needs this hack, too. + (_bfd_mips_elf_size_dynamic_sections): Handle GOT_PAGE for any NewABI. + (_bfd_mips_elf_relocate_section): No special handling for R_MIPS_64 + in any NewABI. + (_bfd_mips_elf_finish_dynamic_symbol): No special _gp_disp handling + for NewABI. + (_bfd_mips_elf_modify_segment_map): Handle any N64 ABI. + (_bfd_mips_elf_gc_sweep_hook): NewABI GOT relocs should be handled + here, too. + +2002-07-01 Andreas Schwab + + * elf64-x86-64.c (elf64_x86_64_relocate_section): Only convert + R_X86_64_64 to R_X86_64_RELATIVE. + +2002-07-01 John David Anglin + + * vaxbsd.c: New BFD backend for VAX BSD and Ultrix. + * Makefile.am (BFD32_BACKENDS, BFD32_BACKENDS_CFILES): Add new backend. + Run "make dep-am". + * config.bfd (vax-*-bsd* | vax-*-ultrix*): Use vaxbsd_vec instead of + host_aout_vec. + * configure.in (vaxbsd_vec): Add. + * targets.c (vaxbsd_vec): Add. + * Makefile.in: Rebuild. + * configure: Rebuild. + * po/SRC-POTFILES.in: Rebuild. + +2002-07-01 Alan Modra + + * elflink.h (elf_gc_mark): Pass in the section whose relocs we are + examining to gc_mark_hook, rather than the bfd. + (elf_gc_sections): Adjust. + * elf-bfd.h (struct elf_backend_data ): Likewise. + * elf-m10300.c (mn10300_elf_gc_mark_hook): Likewise. + * elf32-arm.h (elf32_arm_gc_mark_hook): Likewise. + * elf32-avr.c (elf32_avr_gc_mark_hook): Likewise. + * elf32-cris.c (cris_elf_gc_mark_hook): Likewise. + * elf32-d10v.c (elf32_d10v_gc_mark_hook): Likewise. + * elf32-fr30.c (fr30_elf_gc_mark_hook): Likewise. + * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise. + * elf32-i386.c (elf_i386_gc_mark_hook): Likewise. + * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise. + * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise. + * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise. + * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Likewise. + * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise. + * elf32-s390.c (elf_s390_gc_mark_hook): Likewise. + * elf32-sh.c (sh_elf_gc_mark_hook): Likewise. + * elf32-sparc.c (elf32_sparc_gc_mark_hook): Likewise. + * elf32-v850.c (v850_elf_gc_mark_hook): Likewise. + * elf32-vax.c (elf_vax_gc_mark_hook): Likewise. + * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Likewise. + * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise. + * elf64-ppc.c (ppc64_elf_gc_mark_hook): Likewise. + * elf64-s390.c (elf_s390_gc_mark_hook): Likewise. + * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise. + * elfxx-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise. + * elfxx-mips.h (_bfd_mips_elf_gc_mark_hook): Likewise. + * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise. + * elf32-frv.c (elf32_frv_gc_mark_hook): Likewise. Also remove + redundant local sym tests. + * elf64-ppc.c (struct ppc_link_hash_entry): Add is_entry. + (link_hash_newfunc): Init is_entry. + (ppc64_elf_copy_indirect_symbol): Copy is_entry. + (ppc64_elf_link_hash_table_create): Init all_local_syms. + (create_linkage_sections): Use bfd_make_section_anyway rather than + bfd_make_section. + (ppc64_elf_mark_entry_syms): New function. + (ppc64_elf_check_relocs): Don't bother testing elf_bad_symtab. Set + up opd entry to function section map. + (ppc64_elf_gc_mark_hook): Special case opd section relocs, and + relocs that reference the opd section. + (edit_opd): New function. + (ppc64_elf_size_dynamic_sections): Call get_local_syms and edit_opd. + (ppc64_elf_setup_section_lists): Don't calculate htab->bfd_count here. + (get_local_syms): Do so here. Exit if we already have local syms. + Remove bogus comment imported from elf32-hppa.c. Don't attempt to + read local syms on non-ELF input. + (ppc64_elf_size_stubs): Call _bfd_elf64_link_read_relocs rather + than duplicating it's function here. Adjust free of internal + relocs to suit. + (ppc64_elf_relocate_section): Adjust local syms in opd section. + * elf64-ppc.h (ppc64_elf_mark_entry_syms): Declare. + * elf32-hppa.c (elf32_hppa_size_stubs): Call + _bfd_elf32_link_read_relocs rather than duplicating it's function + here. Adjust free of internal relocs to suit. + +2002-07-01 Andreas Jaeger + + * elf64-x86-64.c (elf64_x86_64_check_relocs): Certain relocations + are not allowed in shared libs code, enforce -fPIC. + +2002-06-29 Hans-Peter Nilsson + + * mmo.c (mmo_write_loc_chunk): Don't eliminate leading and + trailing zero-sequences when there's previous left-over data. + +2002-06-27 John David Anglin + + * elf64-hppa.c (elf64_hppa_reloc_type_class): New function. + (elf64_hppa_finish_dynamic_sections): Check other_rel_sec, dlt_rel_sec + and opd_rel_sec in order for starting rela section. Check _raw_size. + (elf_backend_reloc_type_class): Define. + +2002-06-27 Kevin Buettner + + * dwarf2.c (decode_line_info): Handle older, non-standard, 64-bit + DWARF2 formats. + +2002-06-27 Alan Modra + + * cpu-powerpc.c: Comment on ordering of arch_info. + * elf32-ppc.c (ppc_elf_object_p): New function. + (elf_backend_object_p): Define. + * elf64-ppc.c (ppc64_elf_object_p): New function. + (elf_backend_object_p): Define. + +2002-06-26 Jason Thorpe + + * configure.in (vax-*-netbsd*): Set COREFILE to netbsd-core.lo. + * configure: Regenerate. + +2002-06-25 Jason Eckhardt + + * dwarf2.c (decode_line_info): Check unit->addr_size + to read in the proper number of prologue bytes. + +2002-06-25 Nick Clifton + + * config.bfd (powerpc-*-aix5*): Only create a selvecs for + aix5coff64_vec if 64-bit bfd support has been enabled. + (powerpc64-*-aix5*): Only define if 64-bit bfd support has + been enabled. + + * targets.c (_bfd_target_vector[]): Only include + aix5coff64_vec if 64-bit bfd support has been enabled. + +2002-06-25 Alan Modra + + * elf64-ppc.c (ppc_add_stub): Replace strcpy/strncpy with memcpy. + * elf32-hppa.c (hppa_add_stub): Likewise. + * elflink.c (_bfd_elf_link_record_dynamic_symbol): Likewise. + * elflink.h (elf_add_default_symbol): Fix comment typo. + (elf_add_default_symbol): Replace strcpy and strncpy with memcpy. + (elf_link_add_object_symbols): Likewise. + (elf_link_assign_sym_version): Likewise. + * hash.c (bfd_hash_lookup): Likewise. + * linker.c (_bfd_generic_link_add_one_symbol): Likewise. + * section.c (bfd_get_unique_section_name): Likewise. + * syms.c (_bfd_stab_section_find_nearest_line): Likewise. + * elf.c (_bfd_elf_make_section_from_phdr): Likewise. + (assign_section_numbers): Likewise. + (_bfd_elfcore_make_pseudosection): Likewise. + (elfcore_grok_lwpstatus): Likewise. + (elfcore_grok_win32pstatus): Likewise. + (elfcore_write_note): Constify input params. Use PTR instead of + void *. Include terminating NUL in namesz. Correct padding. + Support NULL "name" param. Use memcpy instead of strcpy. + (elfcore_write_prpsinfo): Constify input params. + (elfcore_write_prstatus): Likewise. Use PTR instead of void *. + (elfcore_write_lwpstatus): Likewise. + (elfcore_write_pstatus): Likewise. + (elfcore_write_prfpreg): Likewise. + (elfcore_write_prxfpreg): Likewise. + * elf-bfd.h (elfcore_write_note): Update declaration. + (elfcore_write_prpsinfo): Likewise. + (elfcore_write_prstatus): Likewise. + (elfcore_write_pstatus): Likewise. + (elfcore_write_prfpreg): Likewise. + (elfcore_write_prxfpreg): Likewise. + (elfcore_write_lwpstatus): Likewise. + +2002-06-25 Jason Eckhardt + + * ecoff.c (ecoff_set_symbol_info): Set BSF_FUNCTION for + symbols of type stProc and stStaticProc. + +2002-06-25 Nick Clifton + + * ecoff.c: VArious formatting fixes. + +2002-06-25 Alan Modra + + * coff-rs6000.c (xcoff_generate_rtinit): Fix typo. + +2002-06-25 Alan Modra + + * aout-adobe.c: Don't compare against "true" or "false. + * aout-target.h: Likewise. + * aoutx.h: Likewise. + * archive.c: Likewise. + * bout.c: Likewise. + * cache.c: Likewise. + * coff-a29k.c: Likewise. + * coff-alpha.c: Likewise. + * coff-i386.c: Likewise. + * coff-mips.c: Likewise. + * coff-or32.c: Likewise. + * coff64-rs6000.c: Likewise. + * coffcode.h: Likewise. + * coffgen.c: Likewise. + * cpu-ns32k.c: Likewise. + * ecoff.c: Likewise. + * ecofflink.c: Likewise. + * elf.c: Likewise. + * elf32-arm.h: Likewise. + * elf32-cris.c: Likewise. + * elf32-d30v.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-mcore.c: Likewise. + * elf32-ppc.c: Likewise. + * elf32-sh.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-v850.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-sh64.c: Likewise. + * elfcode.h: Likewise. + * elfcore.h: Likewise. + * elflink.h: Likewise. + * elfxx-mips.c: Likewise. + * i386os9k.c: Likewise. + * ieee.c: Likewise. + * libbfd.c: Likewise. + * linker.c: Likewise. + * mmo.c: Likewise. + * nlm32-alpha.c: Likewise. + * nlm32-i386.c: Likewise. + * nlm32-ppc.c: Likewise. + * nlm32-sparc.c: Likewise. + * nlmcode.h: Likewise. + * oasys.c: Likewise. + * pdp11.c: Likewise. + * peicode.h: Likewise. + * reloc.c: Likewise. + * som.c: Likewise. + * srec.c: Likewise. + * tekhex.c: Likewise. + * vms.c: Likewise. + * xcofflink.c: Likewise. + * elf64-sparc.c: Edit comment to not use "== false". + + * aoutf1.h: Don't use "? true : false". + * ecoff.c: Likewise. + * format.c: Likewise. + * ieee.c: Likewise. + * linker.c: Likewise. + * mmo.c: Likewise. + * oasys.c: Likewise. + +2002-06-23 H.J. Lu + + * elflink.h (elf_link_add_archive_symbols): For the default + version, check references with only one `@' first. + +2002-06-23 John David Anglin + + * elf64-hppa.c (elf64_hppa_mark_milli_and_exported_functions): New + function. + (allocate_global_data_dlt): Don't add millicode symbols to dynamic + symbol table. + (allocate_global_data_opd, allocate_dynrel_entries): Likewise. + (elf64_hppa_size_dynamic_sections): Revise to use + elf64_hppa_mark_milli_and_exported_functions. + (elf64_hppa_finish_dynamic_symbol): Remove code to keep millicode + symbols out of dynamic symbol table. + +2002-06-23 Alan Modra + + * Makefile.in: Regenerate. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + + * elflink.h: Comment typo fixes. + +2002-06-23 H.J. Lu + + * elf-bfd.h (elf_link_loaded_list): New structure. + (elf_link_hash_table): Add "loaded". + * elf.c (_bfd_elf_link_hash_table_init): Initialize "loaded". + * elflink.h (elf_link_check_versioned_symbol): New function. + (elf_link_output_extsym): Call elf_link_check_versioned_symbol. + +2002-06-19 Nick Clifton + + * elflink.h (size_dynamic_sections): If the target does not + support an ELF style hash table, return true, indicating that + nothing needed to be done, rather than false, indicating that the + section's size could not be computed. + +2002-06-18 Dave Brolley + + From Catherine Moore, Michael Meissner, Dave Brolley: + * po/SRC-POTFILES.in: Add cpu-frv.c and elf32-frv.c + * targets.c: Support bfd_elf32_frv_vec. + * reloc.c: Add FRV relocs. + * configure.in: Add support for bfd-elf32-frv-vec. + * config.bfd (targ_cpu): Add support for frv-*-elf. + * archures.c: Add frv arch and machines. + * Makefile.am (ALL_MACHINES): Add cpu-frv.lo. + (ALL_MACHINES_CFILES): Add cpu-frv.c. + (BFD32_BACKENDS): Add elf32-frv.lo. + (BFD32_BACKENDS_CFILES): Add elf32-frv.c + (cpu-frv.lo): New target. + (elf32-frv.lo): New target. + * cpu-frv.c: New file. + * elf32-frv.c: New file. + +2002-06-18 Jakub Jelinek + + * elfcode.h (elf_object_p): Sanity check eh_shoff == 0 implies + e_shnum == 0. + Only read the first section header if e_shoff is non-zero. + Don't consider e_shstrndx if there are no sections. + +2002-06-17 Tom Rix + + * elf32-d10v.c (elf_d10v_howto_table): Change R_D10V_10_PCREL_R, + R_D10V_10_PCREL_L and R_D10V_18_PCREL to use + complain_overflow_bitfield. + +2002-06-17 Alan Modra + + * opncls.c (bfd_openr): Remove redundant bfd_set_error. + (bfd_fdopenr): Likewise. + (bfd_openstreamr): Likewise. + (bfd_openw): Likewise. + + * targets.c: Sort target vecs. + (_bfd_target_vector): Add aix5coff64_vec, bfd_elf32_sh64_vec, + bfd_elf32_sh64l_vec, bfd_elf32_sh64lnbsd_vec, + bfd_elf32_sh64nbsd_vec, bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec, + bfd_elf64_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec. + * configure.in: Sort target vecs. Add m88kmach3_vec. + * configure: Regenerate. + +2002-06-16 Hans-Peter Nilsson + + * elf64-mmix.c (bpo_reloc_request_sort_fn): Use member + bpo_reloc_no to break sort order ties, not address of items. + +2002-06-16 John David Anglin + + * elf-hppa.h (elf_hppa_final_link): Fix formatting in comment. + Skip excluded sections in determing __gp value. + (elf_hppa_final_link_relocate): Use the symbol's address in + R_PARISC_FPTR64 relocations that don't need an opd entry. + * elf64-hppa.c (allocate_dynrel_entries): Simplify code. + (elf64_hppa_finalize_dynreloc): Likewise. + (elf64_hppa_size_dynamic_sections): Move comments and fix typo. + (elf64_hppa_finish_dynamic_symbol): Break up assert. + +2002-06-14 Sergey Grigoriev + + * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte + alignment for .bss, .data and .text sections so that sse and sse2 + code will work. + * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise. + +2002-06013 J"orn Rennecke + + config.bfd: Add support for sh[1234]l*-*-elf* | sh3el*-*-elf*, + sh[1234]*-elf*. + +2002-06-12 John David Anglin + + * elflink.h (elf_bfd_final_link): Improve error handling for missing + dynamic sections. + + * elf64-hppa.c (allocate_global_data_opd): We don't need an opd entry + for a symbol that has no output section. + (allocate_dynrel_entries): Correct comment. + (elf64_hppa_finalize_dynreloc): Likewise. Don't create an opd entry + unless we want one. + (elf64_hppa_finalize_opd): Prevent segfault if dyn_h is NULL. + (elf64_hppa_finalize_dlt): Likewise. Prevent segfault for symbols + with no section. Remove unnecessary parentheses. + +2002-06-11 Tom Rix + + * coffcode.h (coff_compute_section_file_positions): Add data + section to AIX loader alignment check. + + * coff-rs6000.c (_bfd_xcoff_mkobject): Set default text section + alignment to 4 bytes. + (_bfd_xcoff_copy_private_bfd_data): Use text and data alignment + power accessor macro. + (do_shared_object_padding): Remove invalid assertion. + +2002-06-10 Richard Sandiford + + * section.c (_bfd_strip_section_from_output): Set SEC_EXCLUDE + for removed output sections. + +2002-06-10 Geoffrey Keating + + * merge.c (merge_strings): Use htab_create_alloc with calloc, not + htab_alloc. + * elf-strtab.c (_bfd_elf_strtab_finalize): Likewise. + +2002-06-08 H.J. Lu + + * elf.c (copy_private_bfd_data): Don't cast to bfd_size_type to + work around a long long bug in gcc 2.96 on mips. + +2002-06-08 Jason Thorpe + + * Makefile.am (BFD32_BACKENDS): Add vax1knetbsd.lo. + (BFD32_BACKENDS_CFILES): Add vax1knetbsd.c. + Regenerate dependency lists. + * Makefile.in: Regenerate. + * config.bfd (vax-*-netbsdelf*, vax-*-netbsdaout*): Add + vax1knetbsd_vec to targ_selvecs. + * configure.in: Add vax1knetbsd_vec. + * configure: Regenerate. + * targets.c (_bfd_target_vector): Add vax1knetbsd_vec. + * vax1knetbsd.c: New file. + * vaxnetbsd.c: Update copyright years. + (TARGET_PAGE_SIZE): Set to 0x1000. + (DEFAULT_MID): Set to M_VAX4K_NETBSD. + +2002-06-08 Matt Thomas + + * libaout.h (enum machine_type): Add M_VAX4K_NETBSD. + +2002-06-08 Alan Modra + + * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): Make static. + +2002-06-08 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + + * armnetbsd.c: Replace CONST with const. + * corefile.c: Likewise. + * elf32-dlx.c: Likewise. + * elf64-mips.c: Likewise. + * mmo.c: Likewise. + * ns32knetbsd.c: Likewise. + + * elf64-sparc.c (sparc64_elf_add_symbol_hook): Check the hash + table is elf64-sparc. + +2002-06-08 Thiemo Seufer + + * elfxx-mips.c (_bfd_mips_elf_relocate_section): Simplify code. + Fix RELA addends to get not shifted in the result. Don't do special + handling of R_MIPS_64 for NewABI. + +2002-06-07 Alan Modra + + * aoutx.h (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc. + (NAME(aout,slurp_reloc_table)): Likewise. + * coff-mips.c (mips_relax_section): Use bfd_zalloc. + * coff-rs6000.c (xcoff_write_armap_big): Use bfd_zmalloc. + (xcoff_write_archive_contents_big): Likewise. + (xcoff_generate_rtinit): Likewise. + (xcoff_generate_rtinit): Likewise, and check error return. + * coff64-rs6000.c (xcoff64_generate_rtinit): Likewise. + * coffgen.c (coff_section_symbol): Use bfd_zalloc. + (coff_get_normalized_symtab): Likewise. + (coff_make_empty_symbol): Likewise. + (bfd_coff_set_symbol_class): Likewise. + * cofflink.c (coff_link_add_symbols): Likewise. + * ecoff.c (_bfd_ecoff_make_empty_symbol): Likewise. + * ecofflink.c (ecoff_write_shuffle): Use bfd_zmalloc. + (bfd_ecoff_write_accumulated_debug): Likewise. + * elf64-alpha.c (get_got_entry): Use bfd_zalloc. + * i386linux.c (bfd_i386linux_size_dynamic_sections): Likewise. + * i386lynx.c (NAME(lynx,slurp_reloc_table)): Use bfd_zmalloc. + * ieee.c (do_with_relocs): Use bfd_zalloc. + * m68klinux.c (bfd_m68klinux_size_dynamic_sections): Likewise. + * pdp11.c (NAME(aout,slurp_symbol_table)): Use bfd_zmalloc. + (NAME(aout,slurp_reloc_table)): Likewise. + (NAME(aout,squirt_out_relocs)): Don't memset when zalloc'd. + * reloc16.c (bfd_coff_reloc16_relax_section): Use bfd_zmalloc. + * som.c (som_build_and_write_symbol_table): Likewise. + (som_slurp_string_table): Likewise. + (som_slurp_symbol_table): Likewise. + (som_bfd_ar_write_symbol_stuff): Likewise. + * sparclinux.c (bfd_sparclinux_size_dynamic_sections): Use bfd_zalloc. + * sunos.c (bfd_sunos_size_dynamic_sections): Likewise. + * tekhex.c (find_chunk): Likewise. Get rid of unused "sname". + * vms-gsd.c (_bfd_vms_slurp_gsd): Use bfd_zmalloc. + * xcofflink.c (xcoff_link_add_symbols): Use bfd_zalloc/bfd_zmalloc. + +2002-06-07 Alan Modra + + * elf-bfd.h (struct bfd_elf_section_data ): Replace with + "group" union. + (elf_group_name): Update. + (elf_group_id): Define. + (bfd_elf_set_group_contents): Declare. + * elf.c (elf_fake_sections): Qualify use of elf_group_name. + (set_group_contents): Rename to bfd_elf_set_group_contents. Remove + ATTRIBUTE_UNUSED from failedptrarg. If elf_group_id is set, use + that sym for the signature. + (_bfd_elf_compute_section_file_positions): Don't call + set_group_contents for "ld -r" case. + (swap_out_syms): Use bfd_zalloc. + * elflink.h (elf_link_add_archive_symbols): Likewise. + (NAME(bfd_elf,size_dynamic_sections)): Likewise. + (elf_bfd_final_link): Call bfd_elf_set_group_contents. + +2002-06-07 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Allow unresolved + relocs in opd for non-shared too. + +2002-06-06 Jeffrey Law + + * elf32-h8300.c (elf32_h8_relax_section): Ignore uninteresting + relocations. + +2002-06-06 Nick Clifton + + * merge.c: Include libiberty.h. + * elf-strtab.c: Include libiberty.h. + +2002-06-06 Elias Athanasopoulos + + * peXXigen.c (pe_print_idata): Remove unused variable. + +2002-06-06 David Heine + + * elf.c (assign_file_positions_for_segments): Remove unallocated + sections from the section to segment mapping for PT_LOAD segments. + Update comment about empty loadable segments. + +2002-06-06 Richard Sandiford + + * stabs.c (_bfd_link_section_stabs): Check that the symbol offset + is within the .stabstr section. + +2002-06-06 Alan Modra + + * elf-bfd.h (struct elf_size_info ): Function args + are "const PTR", not "const PTR *". + (bfd_elf32_swap_symbol_in): Likewise. + (bfd_elf64_swap_symbol_in): Likewise. + * elfcode.h (elf_swap_symbol_in): Change input args to const PTR. + (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in. + * elflink.h (elf_link_is_defined_archive_symbol): Likewise. + (elf_link_add_object_symbols): Likewise. + (elf_link_record_local_dynamic_symbol): Likewise. + (elf_link_input_bfd): Likewise. + (elf_gc_mark): Likewise. + (elf_reloc_symbol_deleted_p): Likewise. + * elf-m10200.c (mn10200_elf_relax_section): Likewise. + (mn10200_elf_relax_delete_bytes): Likewise. + (mn10200_elf_symbol_address_p): Likewise. + (mn10200_elf_get_relocated_section_contents): Likewise. + * elf-m10300.c (mn10300_elf_relax_section): Likewise. + (mn10300_elf_relax_section): Likewise. + (mn10300_elf_relax_delete_bytes): Likewise. + (mn10300_elf_symbol_address_p): Likewise. + (mn10300_elf_get_relocated_section_contents): Likewise. + * elf32-h8300.c (elf32_h8_relax_section): Likewise. + (elf32_h8_relax_delete_bytes): Likewise. + (elf32_h8_symbol_address_p): Likewise. + (elf32_h8_get_relocated_section_contents): Likewise. + * elf32-hppa.c (get_local_syms): Likewise. + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise. + * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. + * elf32-sh.c (sh_elf_relax_section): Likewise. + (sh_elf_relax_delete_bytes): Likewise. + (sh_elf_get_relocated_section_contents): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise. + * elf64-alpha.c (elf64_alpha_relax_section): Likewise. + * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. + * elf64-mmix.c (mmix_elf_relax_section): Likewise. + * elf64-ppc.c (get_local_syms): Likewise. + * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise. + * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. + +2002-06-05 J"orn Rennecke + + * config.bfd (sh64l*-*-elf*, shl*-*-elf*): New configurations. + +2002-06-05 Alan Modra + + * elf.c (group_signature): Swap in the whole symbol, and handle + extracting section symbol names. + (setup_group): Add comment. + (set_group_contents): When called from objcopy or ld, arrange for + section contents to be written. Write group member output section + indices to allow objcopy to reorganize sections. + (_bfd_elf_copy_private_section_data): Copy group info. + + * elf-bfd.h (struct elf_size_info): Add swap_symbol_in field. + (bfd_elf32_swap_symbol_in): Update prototype. + (bfd_elf64_swap_symbol_in): Likewise. + * elfcode.h (elf_swap_symbol_in): Change input args to const PTR *. + (elf_slurp_symbol_table): Adjust call to elf_swap_symbol_in. + * elflink.h (elf_link_is_defined_archive_symbol): Likewise. + (elf_link_add_object_symbols): Likewise. + (elf_link_record_local_dynamic_symbol): Likewise. + (elf_link_input_bfd): Likewise. + (elf_gc_mark): Likewise. + (elf_reloc_symbol_deleted_p): Likewise. + * elf-m10200.c (mn10200_elf_relax_section): Likewise. + (mn10200_elf_relax_delete_bytes): Likewise. + (mn10200_elf_symbol_address_p): Likewise. + (mn10200_elf_get_relocated_section_contents): Likewise. + * elf-m10300.c (mn10300_elf_relax_section): Likewise. + (mn10300_elf_relax_section): Likewise. + (mn10300_elf_relax_delete_bytes): Likewise. + (mn10300_elf_symbol_address_p): Likewise. + (mn10300_elf_get_relocated_section_contents): Likewise. + * elf32-h8300.c (elf32_h8_relax_section): Likewise. + (elf32_h8_relax_delete_bytes): Likewise. + (elf32_h8_symbol_address_p): Likewise. + (elf32_h8_get_relocated_section_contents): Likewise. + * elf32-hppa.c (get_local_syms): Likewise. + * elf32-m68k.c (bfd_m68k_elf32_create_embedded_relocs): Likewise. + * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): Likewise. + * elf32-sh.c (sh_elf_relax_section): Likewise. + (sh_elf_relax_delete_bytes): Likewise. + (sh_elf_get_relocated_section_contents): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relax_section): Likewise. + * elf64-alpha.c (elf64_alpha_relax_section): Likewise. + * elf64-hppa.c (elf64_hppa_check_relocs): Likewise. + * elf64-mmix.c (mmix_elf_relax_section): Likewise. + * elf64-ppc.c (get_local_syms): Likewise. + * elf64-sh64.c (sh_elf64_get_relocated_section_contents): Likewise. + * elfxx-ia64.c (elfNN_ia64_relax_section): Likewise. + * elfcode.h (NAME(_bfd_elf,size_info)): Update initialiser. + * elf64-alpha.c (alpha_elf_size_info): Likewise. + * elf64-hppa.c (hppa64_elf_size_info): Likewise. + * elf64-mips.c (mips_elf64_size_info): Likewise. + * elf64-s390.c (s390_elf64_size_info): Likewise. + * elf64-sparc.c (sparc64_elf_size_info): Likewise. + +2002-06-05 Maciej W. Rozycki + + * elf32-mips.c (elf32_mips_ignore_discarded_relocs): Move to... + elfxx-mips.c (_bfd_mips_elf_ignore_discarded_relocs): ... here. + elf64-mips.c (elf_backend_ignore_discarded_relocs): Use + _bfd_mips_elf_ignore_discarded_relocs. + elfxx-mips.h (_bfd_mips_elf_ignore_discarded_relocs): Declare. + +2002-06-05 H.J. Lu + + * elfxx-mips.c (mips_elf_calculate_relocation): Call + _bfd_elf_rel_local_sym for STT_SECTION relocations against + the SEC_MERGE section. + +2002-06-05 Alan Modra + + * coff-alpha.c: Update copyright date. + * coff-mips.c: Likewise. + * xcoff-target.h: Likewise. + + * bfd-in.h: Remove "taken from the source" comment. + * libbfd-in.h: Likewise. + * libcoff-in.h: Likewise. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + + * elf.c (bfd_elf_discard_group): Return true. + * elf-bfd.h (bfd_elf_discard_group): Declare. + * bfd-in.h (bfd_elf_discard_group): Don't declare here. + * section.c (bfd_discard_group): Rename to bfd_generic_discard_group. + * bfd.c (bfd_discard_group): Define. + * targets.c (struct bfd_target): Add _bfd_discard_group. + (BFD_JUMP_TABLE_LINK): Here too. + * libbfd-in.h (_bfd_nolink_bfd_discard_group): Define. + * aout-adobe.c (aout_32_bfd_discard_group): Define. + * aout-target.h (MY_bfd_discard_group): Define. + * aout-tic30.c (MY_bfd_discard_group): Define. + * binary.c (binary_bfd_discard_group): Define. + * bout.c (b_out_bfd_discard_group): Define. + * coff-alpha.c (_bfd_ecoff_bfd_discard_group): Define. + * coffcode.h (coff_bfd_discard_group): Define. + * coff-mips.c (_bfd_ecoff_bfd_discard_group): Define. + * elfxx-target.h (bfd_elfNN_bfd_discard_group): Define. + * i386msdos.c (msdos_bfd_discard_group): Define. + * i386os9k.c (os9k_bfd_discard_group): Define. + * ieee.c (ieee_bfd_discard_group): Define. + * ihex.c (ihex_bfd_discard_group): Define. + * mmo.c (mmo_bfd_discard_group): Define. + * nlm-target.h (nlm_bfd_discard_group): Define. + * oasys.c (oasys_bfd_discard_group): Define. + * ppcboot.c (ppcboot_bfd_discard_group): Define. + * som.c (som_bfd_discard_group): Define. + * srec.c (srec_bfd_discard_group): Define. + * tekhex.c (tekhex_bfd_discard_group): Define. + * versados.c (versados_bfd_discard_group): Define. + * vms.c (vms_bfd_discard_group): Define. + * xcoff-target.h (_bfd_xcoff_bfd_discard_group): Define. + * coff64-rs6000.c (rs6000coff64_vec): Update initialiser. + (aix5coff64_vec): Likewise. + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Likewise. + +2002-06-04 Jason Thorpe + + * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-com.lo. + (BFD32_BACKENDS_CFILES): Add elf32-sh64-com.c. + (elf32-sh64-com.lo): New dependency list. + * Makefile.in: Regenerate. + * configure.in (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec) + (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec): Add + elf32-sh64-com.lo. + * configure: Regenerate. + * elf32-sh64.c (sh64_address_in_cranges) + (sh64_get_contents_type, sh64_address_is_shmedia): Move to... + (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb): + (crange_bsearch_cmpl): Prepend _bfd_sh64_ to name and move to... + * elf32-sh64-com.c: ...here. New file. + +2002-06-04 Alan Modra + + * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Remove + ATTRIBUTE_UNUSED on used params. + * elf32-vax.c (elf_vax_gc_mark_hook): Remove unnecessary checks + before calling bfd_section_from_elf_index on local syms. + * elf64-sh64.c (sh_elf64_gc_mark_hook): Likewise. + +2002-06-04 Jason Thorpe + + * Makefile.am (BFD32_BACKENDS): Add elf32-sh64-nbsd.lo. + (BFD32_BACKENDS_CFILES): Add elf32-sh64-nbsd.c. + (BFD64_BACKENDS): Add elf64-sh64-nbsd.lo. + (BFD64_BACKENDS_CFILES): Add elf64-sh64-nbsd.c. + (elf32-sh64-nbsd.lo, elf64-sh64-nbsd.lo): New rules. + * Makefile.in: Regenerate. + * config.bfd (sh5le-*-netbsd*, sh5-*-netbsd*, sh64le-*-netbsd*) + (sh64-*-netbsd*): New targets. + * configure.in: Add bfd_elf32_sh64nbsd_vec, bfd_elf32_sh64lnbsd_vec, + bfd_elf64_sh64nbsd_vec, and bfd_elf64_sh64lnbsd_vec. + * configure: Regenerate. + * elf32-sh64-nbsd.c: New file. + * elf64-sh64-nbsd.c: New file. + * targets.c: Add extern decls for bfd_elf32_sh64nbsd_vec, + bfd_elf32_sh64lnbsd_vec, bfd_elf64_sh64nbsd_vec, and + bfd_elf64_sh64lnbsd_vec. + +2002-06-04 Alan Modra + + * elf.c (setup_group): Set SEC_LINK_ONCE on GRP_COMDAT groups. + (bfd_section_from_shdr): Likewise. Set section name of group + sections from signature. + (group_signature): Split out from setup_group. Ensure symbol table + is available. + (bfd_elf_discard_group): New function. + (_bfd_elf_make_section_from_shdr): Don't set SEC_LINK_ONCE on + .gnu.linkonce* sections if they are members of a group. + (set_group_contents): Set GRP_COMDAT flag. + * section.c (bfd_discard_group): New function. + * bfd-in.h (bfd_elf_discard_group): Declare. + * bfd-in2.h: Regenerate. + * elf-bfd.h (struct bfd_elf_section_data): Add linkonce_p field. + (elf_linkonce_p): Define. + +2002-06-04 Alan Modra + + * elf.c (bfd_section_from_shdr): Make "name" const. + * elf-bfd.h (elf_backend_section_from_shdr): Likewise. + * elf32-i370.c (i370_elf_section_from_shdr): Likewise. + * elf32-ppc.c (ppc_elf_section_from_shdr): Likewise. + * elf32-sh64.c (sh64_backend_section_from_shdr): Likewise. + * elf32-v850.c (v850_elf_section_from_shdr): Likewise. + * elf64-alpha.c (elf64_alpha_section_from_shdr): Likewise. + * elf64-hppa.c (elf64_hppa_section_from_shdr): Likewise. + * elf64-ppc.c (ppc64_elf_section_from_shdr): Likewise. + * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Likewise. + * elfxx-mips.c (_bfd_mips_elf_section_from_shdr): Likewise. + * elfxx-mips.h (_bfd_mips_elf_section_from_shdr): Likewise. + +2002-06-03 Maciej W. Rozycki + + * elfxx-mips.c (ABI_64_P): Use backend's data to determine the + ABI. + +2002-06-02 Kazu Hirata + + * elf32-arc.c: Fix formatting. + * elf32-arm.h: Likewise. + * elf32-cris.c: Likewise. + * elf32-dlx.c: Likewise. + * elf32-hppa.c: Likewise. + * elf32-i386.c: Likewise. + * elf32-i386qnx.c: Likewise. + * elf32-or32.c: Likewise. + * elf32-s390.c: Likewise. + * elf32-sh64.c: Likewise. + * elf32-vax.c: Likewise. + * elf32-xstormy16.c: Likewise. + * elf64-alpha.c: Likewise. + * elf64-mmix.c: Likewise. + * elf64-ppc.c: Likewise. + * elf64-s390.c: Likewise. + * elf64-sh64.c: Likewise. + * elf64-x86-64.c: Likewise. + +2002-06-02 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section): Don't dereference + null when there are no got entries for a symbol. + (elf64_alpha_relax_find_tls_segment): Rearrange to avoid + uninitialized variable warning. + +2002-06-01 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_with_lituse): Don't test for + undefined symbols here. + (elf64_alpha_relax_section): Do it here. Also test for not + defined in the current module. + (elf64_alpha_relocate_section_r): Split out of ... + (elf64_alpha_relocate_section): ... here. Don't dereference + NULL when looking up local got entries. + +2002-06-01 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_with_lituse): Reject undefined + symbols from JSR relaxation. + (elf64_alpha_size_plt_section_1): New. + (elf64_alpha_calc_dynrel_sizes): Split out .rela.got bits ... + (elf64_alpha_size_rela_got_1): ... here. + (elf64_alpha_size_dynamic_sections): Split out .rela.got bits ... + (elf64_alpha_size_rela_got_section): ... here. + (elf64_alpha_size_plt_section): New. + (elf64_alpha_relax_section): Call them. + (elf64_alpha_size_got_sections): Remove output_bfd arg. + (elf64_alpha_finish_dynamic_symbol): Check gotent use_count. + +2002-06-01 Richard Henderson + + * elf64-alpha.c (alpha_get_dtprel_base, alpha_get_tprel_base): New. + (elf64_alpha_relocate_section): Use them. Reject LE TLS relocs + in shared libraries. Fix DTPRELHI and TPRELHI value. + (INSN_ADDQ, INSN_RDUNIQ): New. + (struct alpha_relax_info): Add symtab_hdr, tls_segment, first_gotent. + (elf64_alpha_relax_with_lituse): Return boolean. Remove irelend + argument. Reject dynamic symbols. Use LITUSE symbolic constants. + (elf64_alpha_relax_got_load): Rename from relax_without_lituse. + Handle GOTDTPREL and GOTTPREL relocations. + (elf64_alpha_relax_gprelhilo): New. + (elf64_alpha_relax_tls_get_addr): New. + (elf64_alpha_relax_find_tls_segment): New. + (elf64_alpha_relax_section): Handle TLS relocations. + (ALPHA_ELF_LINK_HASH_TLS_IE): New. + (elf64_alpha_check_relocs): Set it. + +2002-06-01 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_section): Don't store computed gp. + + * elf64-alpha.c (elf64_alpha_check_relocs): Fix typo on maybe_dynamic + check; don't suppress dynamic relocs for non-allocated sections. + + * elf64-alpha.c: Remove dead code. + +2002-05-31 Alan Modra + + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + + * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Don't allocate + space for bss .plt. + +2002-05-31 Graeme Peterson + + * Makefile.am (BFD32_BACKENDS): Add elf32-i386qnx.lo. + (BFD32_BACKENDS_CFILES): Add elf32-i386qnx.c. + Run "make dep-am". + * Makefile.in: Regenerate. + * config.bfd: Add i[3456]86-*-nto-qnx* support. + * configure.in: Add bfd_elf32_i386qnx_vec support. + * configure: Regenerate. + * elf-bfd.h (struct elf_backend_data): Add set_nonloadable_filepos, + is_contained_by_filepos, and copy_private_bfd_data_p. + * elf.c (assign_file_positions_for_segments): Call backend + set_nonloadable_filepos. Fix non-K&R call to _bfd_error_handler. + (IS_CONTAINED_BY_FILEPOS): Define. + (INCLUDE_SECTION_IN_SEGMENT): Also test IS_CONTAINED_BY_FILEPOS. + (copy_private_bfd_data): Use IS_CONTAINED_BY_FILEPOS. Typo fix. + Fix non-K&R call to _bfd_error_handler. + (_bfd_elf_copy_private_section_data): Use backend + copy_private_bfd_data_p. + * elf32-i386.c: Don't include elfxx-target.h when + ELF32_I386_C_INCLUDED is defined. + * elf32-i386qnx.c: New QNX elf backend file. + * elfxx-target.h: Add elf_backend_set_nonloadable_filepos, + elf_backend_is_contained_by_filepos, and + elf_backend_do_copy_private_bfd_data. + * targets.c: Add bfd_target bfd_elf32_i386qnx_vec. + +2002-05-31 Alan Modra + + * elfarm-oabi.c (bfd_elf32_arm_add_glue_sections_to_bfd): Define. + Move other similar defines to start of file. + +2002-05-30 Tom Rix + + * coff-rs6000.c (xcoff_rtype2howto): Handle 16 bit R_RBA. + * coff64-rs6000.c (xcoff64_rtype2howto): Same. + +2002-05-30 Richard Henderson + + * elf64-alpha.c (ALPHA_ELF_LINK_HASH_LU_TLSGD, + ALPHA_ELF_LINK_HASH_LU_TLSLDM, ALPHA_ELF_LINK_HASH_LU_FUNC): New. + (ALPHA_ELF_GOT_ENTRY_RELOCS_DONE): Remove. + (ALPHA_ELF_GOT_ENTRY_RELOCS_XLATED): Remove. + (struct alpha_elf_got_entry): Add reloc_type, reloc_done, reloc_xlated. + (struct alpha_elf_obj_tdata): Rename total_got_entries and + n_local_got_entries to total_got_size and local_got_size. + (elf64_alpha_howto, elf64_alpha_reloc_map): Update for TLS relocs. + (alpha_got_entry_size): New. + (elf64_alpha_relax_with_lituse): Use it. + (elf64_alpha_relax_without_lituse): Likewise. + (MAX_GOT_SIZE): Rename from MAX_GOT_ENTRIES. + (get_got_entry): New. + (elf64_alpha_check_relocs): Handle TLS relocs. Reorganize. + (elf64_alpha_adjust_dynamic_symbol): Test LU_FUNC as a mask. + (elf64_alpha_merge_ind_symbols): Check gotent->reloc_type. + (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots): Likewise. + (elf64_alpha_calc_got_offsets_for_symbol): Use alpha_got_entry_size. + (elf64_alpha_calc_got_offsets): Likewise. + (alpha_dynamic_entries_for_reloc): New. + (elf64_alpha_calc_dynrel_sizes): Use it. + (elf64_alpha_size_dynamic_sections): Likewise. + (elf64_alpha_relocate_section): Handle TLS relocations. + * reloc.c: Add Alpha TLS relocations. + * bfd-in2.h, libbfd.h: Rebuild. + +2002-05-29 Ralf Habacker + + * peXXigen.c (pe_print_idata): Remove double printed + import table lines; add Bound-To comment. + +2002-05-29 Matt Thomas + + * Makefile.am (BFD32_BACKENDS): Add elf32-vax.lo. + (BFD32_BACKENDS_CFILES): Add elf32-vax.c. + (elf32-vax.lo): New rule. + * Makefile.in: Regenerate. + * configure.in (bfd_elf32_vax_vec) + (vaxnetbsd_vec): New vectors. + * configure: Regenerate. + * config.bfd (vax-*-netbsdelf*) + (vax-*-netbsdaout*) + (vax-*-netbsd*): New targets. + * elf32-vax.c: New file. + * reloc.c: Add VAX relocations. + * bfd-in2.h: Regenerate. + * targets.c (_bfd_target_vector): Add bfd_elf32_vax_vec. + +2002-05-29 Jason Thorpe + + * config.bfd (arm-*-netbsd*): Add bfd_elf32_littlearm_vec + and bfd_elf32_bigarm_vec to targ_selvecs. + +2002-05-29 Ralf Habacker + + * peXXigen.c (pe_print_idata): Fix seg faults on printing import tables + with auto-imported symbols. + +2002-05-29 Adam Nemet + + * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Don't add glue + sections only record bfd. + (bfd_elf32_arm_add_glue_sections_to_bfd): New function. + * bfd-in.h (bfd_elf32_arm_add_glue_sections_to_bfd): Declare it. + * bfd-in2.h: Regenerate. + +2002-05-28 Nick Clifton + + * syms.c (_bfd_stab_section_find_nearest_line): Move + declaration and initialisation of saw_line and saw_func out of + for loop. + +2002-05-29 Alan Modra + + * elf64-ppc.c (ppc64_elf_get_symbol_info): New function. + (bfd_elf64_get_symbol_info): Define. + * elfxx-target.h (bfd_elfNN_get_symbol_info): Only define if undef. + +2002-05-29 Andrey Volkov + + * cpu-h8300.c: Make default h8300 machine first in machine list. + +2002-05-28 Kuang Hwa Lin + + * config.bfd: Added DLX configuraton. + * Makefile.am: Added DLX configuraton. + * configure.in: Added DLX configuraton. + * archures.c: Add DLX architecture. + * reloc.c: Add DLX relocs. + * targets.c: Added DLX target vector. + * configure: Regenerate. + * Makefile.in: Regenreate. + * bfd-in2.h: Regenreate. + * elf32-dlx.c: New file: Support DLX target. + * cpu-dlx.c: New file: Support DLX target. + +2002-05-25 Alan Modra + + * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Formatting. + + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Revert last change. + (ppc64_elf_check_relocs): Don't set up function descriptor symbol + strings to point inside function code sym string. + (func_desc_adjust): Likewise. + (ppc64_elf_hide_symbol): Rewrite code to look up function code sym. + +2002-05-24 Michal Ludvig + + * elf64-x86-64.c (elf64_x86_64_grok_prstatus): Added. + (elf64_x86_64_grok_psinfo): Added. + +2002-05-24 TAMURA Kent + + * config.bfd: Add a target for i386-netbsdpe. + +2002-05-24 Alan Modra + + * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Don't copy is_func + and is_func_descriptor. + (func_desc_adjust): Hide function code sym in shared libs unless + there is a matching exported function descriptor sym. + +2002-05-23 Jakub Jelinek + + * elf.c (_bfd_elf_make_section_from_shdr): Set SEC_THREAD_LOCAL + for symbols from SHF_TLS section. + (_bfd_elf_print_private_bfd_data): Add PT_TLS. + (elf_fake_sections): Set SHF_TLS for SEC_THREAD_LOCAL sections. + (map_sections_to_segments): Build PT_TLS segment if necessary. + (assign_file_positions_for_segments): Likewise. + (get_program_header_size): Account for PT_TLS segment. + (swap_out_syms): Set type of BSF_THREAD_LOCAL symbols and symbols from + SEC_THREAD_LOCAL sections to STT_TLS. + * reloc.c: Add 386 and IA-64 TLS relocs. + * section.c (SEC_THREAD_LOCAL): Define. + (SEC_CONSTRUCTOR_TEXT, SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS): + Remove. + * elflink.h (elf_link_add_object_symbols): Support .tcommon. + (size_dynamic_sections): If DF_STATIC_TLS, set DF_FLAGS + unconditionally. + (struct elf_final_link_info): Add first_tls_sec. + (elf_bfd_final_link): Set first_tls_sec. + Compute elf_hash_table (info)->tls_segment. + (elf_link_output_extsym): Handle STT_TLS symbols. + (elf_link_input_bfd): Likewise. + * syms.c (BSF_THREAD_LOCAL): Define. + * bfd-in2.h: Rebuilt. + * libbfd.h: Rebuilt. + * elf32-i386.c (elf_i386_tls_transition, dtpoff_base, tpoff, + elf_i386_mkobject, elf_i386_object_p): New functions. + (elf_howto_table): Add TLS relocs. + (elf_i386_reloc_type_lookup): Support TLS relocs. + (elf_i386_info_to_howto_rel): Likewise. + (struct elf_i386_link_hash_entry): Add tls_type. + (struct elf_i386_obj_tdata): New. + (elf_i386_hash_entry, elf_i386_tdata, elf_i386_local_got_tls_type): + New macros. + (struct elf_i386_link_hash_table): Add tls_ldm_got. + (link_hash_newfunc): Clear tls_type. + (elf_i386_check_relocs): Support TLS relocs. + (elf_i386_gc_sweep_hook): Likewise. + (allocate_dynrelocs): Likewise. + (elf_i386_size_dynamic_sections): Likewise. + (elf_i386_relocate_section): Likewise. + (elf_i386_finish_dynamic_symbol): Likewise. + (bfd_elf32_mkobject, elf_backend_object_p): Define. + * elfxx-ia64.c (struct elfNN_ia64_dyn_sym_info): Add tprel_offset, + dtpmod_offset, dtprel_offset, tprel_done, dtpmod_done, dtprel_done, + want_tprel, want_dtpmod, want_dtprel. + (elfNN_ia64_tprel_base, elfNN_ia64_dtprel_base): New functions. + (ia64_howto_table): Add TLS relocs, rename R_IA64_LTOFF_TP22 to + R_IA64_LTOFF_TPREL22. + (elf_code_to_howto_index): Add TLS relocs. + (elfNN_ia64_check_relocs): Support TLS relocs. + (allocate_global_data_got): Account for TLS .got data. + (allocate_dynrel_entries): Account for TLS dynamic relocations. + (elfNN_ia64_install_value): Supprt TLS relocs. + (set_got_entry): Support TLS relocs. + (elfNN_ia64_relocate_section): Likewise. + +2002-05-23 Nick Clifton + + * elf32-arm.h (elf32_arm_final_link_relocate): For the Thumb + BLX reloc round the relocation up rather than down. + * coff-arm.c (coff_arm_relocate_section): Likewise. + +2002-05-21 H.J. Lu (hjl@gnu.org) + + * linker.c (_bfd_generic_link_add_one_symbol): Allow multiple + definition. + +2002-05-22 Alan Modra + + * elf64-ppc.c (ppc64_elf_size_stubs): Don't strip .branch_lt. + (ppc64_elf_relocate_section): Handle unresolved relocs in opd. + +2002-05-22 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Return false for + unresolved relocs. + (ppc64_elf_size_dynamic_sections): Check for splt NULL. + +2002-05-21 Thiemo Seufer + + * bfd.c (bfd_get_arch_size): Remove bfd_set_error call for + non-ELF targets. + +2002-05-21 Thiemo Seufer + + * elf-bfd.h (elf_backend_emit_relocs): Change prototype to return + an error value. + * elflink.h (elf_link_output_relocs): Likewise. Improve error message. + return with false on error. + (elf_link_input_bfd): Check reloc_emitter return value. + +2002-05-21 Jason Thorpe + + * config.bfd (armeb-*-netbsdelf*): New target. + +2002-05-20 Alan Modra + + * elf64-ppc.c (ppc_build_one_stub): Point undefined function syms + at the plt call stub. + +2002-05-19 Thiemo Seufer + + * cpu-mips.c (mips_compatible): Don't try to check machine + compatibility. + +2002-05-18 Tom Rix + + * coff64-rs6000.c (_bfd_xcoff64_swap_aux_out): Fix C_FILE auxent. + +2002-05-17 Alan Modra + + * elf64-ppc.c (ppc64_elf_info_to_howto): Formatting. + (ppc64_elf_relocate_section): Don't warn about reloc overflow when + we've already warned about an undefined symbol. Report more + detail on reloc errors. + +2002-05-17 Alan Modra + + * acinclude.m4 (AM_INSTALL_LIBBFD): New. + * configure.in: Invoke AM_INSTALL_LIBBFD. + * Makefile.am (install-data-local): Revert 2002-05-13. Move to.. + (install_libbfd): .. New target. + (uninstall_libbfd): Likewise. + (install-bfdlibLTLIBRARIES): Likewise. + (uninstall-bfdlibLTLIBRARIES): Likewise. + (bfdlibdir): New. + (bfdincludedir): New. + (lib_LTLIBRARIES): Rename to bfdlib_LTLIBRARIES. + * aclocal.m4: Regenerate. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2002-05-17 Stuart Balfour + + * hash.c (bfd_hash_lookup): Remove computation of len from inside + hash loop. + +2002-05-16 Nick Clifton + + * config.bfd: Add targets for sh64-linux (little endian and + big endian). + +2002-05-15 Laurent Pinchart + + * peXXigen.c (pe_print_idata): Do not assume that the first thunk + is located in the same section as the import table. Instead + check, and if necessary load the section containing the thunk. + +2002-05-15 Nick Clifton + + * aix5ppc-core.c (xcoff64_core_p): Replace bfd_read with + bfd_bread. + (xcoff64_core_file_matches_executable_p): Replace bfd_read + with bfd_bread. + +2002-05-15 Alan Modra + + * aix5ppc-core.c: Warning fixes. + * aout-adobe.c (aout_32_bfd_link_just_syms): Define. + * aout-target.h (MY_bfd_link_just_syms): Define. + * aout-tic30.c (MY_bfd_link_just_syms): Define. + * bfd.c (bfd_link_just_syms): Define. + * binary.c (binary_bfd_link_just_syms): Define. + * bout.c (b_out_bfd_link_just_syms): Define. + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Update initializer. + * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Likewise. + * coffcode.h (coff_bfd_link_just_syms): Define. + * elf-bfd.h (enum elf_link_info_type): Add ELF_INFO_TYPE_JUST_SYMS. + (elf_discarded_section): Check for ELF_INFO_TYPE_JUST_SYMS. + (_bfd_elf_link_just_syms): Declare. + * elf.c (_bfd_elf_link_just_syms): New function. + * elf-eh-frame.c (_bfd_elf_maybe_strip_eh_frame_hdr): Check that + sections haven't already been discarded by the linker. + * elflink.h (elf_link_add_object_symbols): Likewise for stab + sections and SEC_MERGE sections. + (elf_bfd_discard_info): Similarly here. + * elfxx-target.h (bfd_elfNN_bfd_link_just_syms): Define. + * i386msdos.c (msdos_bfd_link_just_syms): Define. + * i386os9k.c (os9k_bfd_link_just_syms): Define. + * ieee.c (ieee_bfd_link_just_syms): Define. + * ihex.c (ihex_bfd_link_just_syms): Define. + * libbfd-in.h (_bfd_nolink_bfd_link_just_syms): Define. + (_bfd_generic_link_just_syms): Declare. + * libecoff.h (_bfd_ecoff_bfd_link_just_syms): Define. + * linker.c (_bfd_generic_link_just_syms): New function. + * mmo.c (mmo_bfd_link_just_syms): Define. + * nlm-target.h (nlm_bfd_link_just_syms): Define. + * oasys.c (oasys_bfd_link_just_syms): Define. + * ppcboot.c (ppcboot_bfd_link_just_syms): Define. + * som.c (som_bfd_link_just_syms): Define. + * srec.c (srec_bfd_link_just_syms): Define. + * targets.c (struct bfd_target): Add _bfd_link_just_syms. + (BFD_JUMP_TABLE_LINK): And here. + * tekhex.c (tekhex_bfd_link_just_syms): Define. + * versados.c (versados_bfd_link_just_syms): Define. + * vms.c (vms_bfd_link_just_syms): Define. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + +2002-05-15 Thiemo Seufer + + * elf32-mips.c: Remove superfluous definitions copied from + elfxx-mips.c. + (bfd_elf32_bigmips_vec,bfd_elf32_littlemips_vec): Use the + SGIish vectors to check the special case. + (mips_elf_hi16_reloc): Fix comment. + (mips_elf_got16_reloc): Likewise. + (_bfd_mips_elf32_gprel16_reloc): Likewise. + (elf_reloc_map): Code cleanup. + (mips_reloc_map): Add comment. + (bfd_elf23_bfd_reloc_type_lookup): Code cleanup. + (mips_elf32_rtype_to_howto): Likewise. + (mips_elf32_discard_info): Likewise. + (elf32_mips_irix_compat): Invert logic: Only SGIish vectors + lead to IRIX compatibility now. + +2002-05-15 Thiemo Seufer + + * elfxx-mips.c: Call it IRIX, not Irix in comments. + +2002-05-13 Jason Thorpe + + * config.bfd (shle-*-netbsdelf*): Add target which includes + sh64 support. + +2002-05-13 David Edelsohn + + * configure.in: Revert 2002-04-07. Instead, auto-configure + HAVE_ST_C_IMPL. + * configure: Regenerate. + * config.in: Regenerate. + * rs6000-core.c (CNEW_IMPL): Guard use of c_impl with HAVE_ST_C_IMPL + or AIX_5_CORE. + +2002-05-11 Federico G. Schwindt + + * configure.in (sparc*-*-openbsd*): Support sparc64-openbsd + corefiles as well.2 + * configure: Regenerate. + +2002-05-13 Alan Modra + + * Makefile.am (install-data-local): Install headers to + $(exec_prefix)/include. + * Makefile.in: Regenerate. + +2002-05-11 Ralf Corsepius + Daniel Jacobowitz + + * coff-sh.c (sh_reloc_map): Map to R_SH_IMM32 for non-PE. Don't + map BFD_RELOC_RVA. + +2002-05-11 Federico G. Schwindt + + * config.bfd (alpha*-*-openbsd*, sparc64*-*-openbsd*, + hppa*-*-openbsd*): New targets. + * configure.in (alpha*-*-openbsd*): Set COREFILE. + * configure: Regenerate. + +2002-05-10 Tom Rix + + * coff64-rs6000.c (xcoff64_reloc_type_br): New function for + xcoff64_ppc_relocate_section. + * coff-rs6000.c : Extern common xcoff_reloc_type functions. + * libxcoff.h: Common xcoff_reloc_type function declaration. + +2002-05-10 Alan Modra + + * elf32-i386.c (elf_i386_relocate_section): Remove overflow checks + added in 2002-05-09 commit. + + * elf32-hppa.c (elf32_hppa_size_stubs): Revert part of 2002-05-04, + don't look for stubs on all undefined syms. + +2002-05-09 Alan Modra + + * elf64-ppc.c (RA_REGISTER_MASK, RA_REGISTER_SHIFT): Delete. + (ppc64_elf_howto_raw ): Not pc_relative or + pcrel_offset. + + * elf32-i386.c (elf_howto_table): Comments. + (elf_i386_relocate_section): Handle more relocs for relocatable + linking and against SEC_MERGE sections. + +2002-05-08 Alan Modra + + * elf32-ppc.c (ppc_elf_create_got): New function. + (ppc_elf_create_dynamic_sections): Call ppc_elf_create_got before + _bfd_elf_create_dynamic_sections. Correct .plt flags. + (ppc_elf_check_relocs): Use ppc_elf_create_got in place of + _bfd_elf_create_got_section. + +2002-05-07 Alan Modra + + * elf-bfd.h (struct elf_backend_data): Add rela_normal. + * elfxx-target.h (elf_backend_rela_normal): Define. + (elfNN_bed): Init rela_normal. + * elflink.h (elf_link_input_bfd ): Handle adjustment + for section symbols here if rela_normal. Simplify abs section test. + * elf-m10200.c (mn10200_elf_relocate_section): If relocatable, + return immediately. Remove code handling relocatable linking. + * elf-m10300.c (mn10300_elf_relocate_section): Likewise. + * elf32-fr30.c (fr30_elf_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-i860.c (elf32_i860_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mcore.c (mcore_elf_relocate_section): Likewise. + * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise. + * elf32-arm.h (elf32_arm_relocate_section): Likewise #ifndef USE_REL. + * elf32-m32r.c (m32r_elf_relocate_section): Likewise. + * elf-m10200.c (elf_backend_rela_normal): Define. + * elf-m10300.c (elf_backend_rela_normal): Define. + * elf32-fr30.c (elf_backend_rela_normal): Define. + * elf32-i370.c (elf_backend_rela_normal): Define. + * elf32-i860.c (elf_backend_rela_normal): Define. + * elf32-m68k.c (elf_backend_rela_normal): Define. + * elf32-mcore.c (elf_backend_rela_normal): Define. + * elf32-openrisc.c (elf_backend_rela_normal): Define. + * elf32-ppc.c (elf_backend_rela_normal): Define. + * elf32-s390.c (elf_backend_rela_normal): Define. + * elf32-xstormy16.c (elf_backend_rela_normal): Define. + * elf64-ppc.c (elf_backend_rela_normal): Define. + * elf64-s390.c (elf_backend_rela_normal): Define. + * elf64-x86-64.c (elf_backend_rela_normal): Define. + * elfxx-ia64.c (elf_backend_rela_normal): Define. + * elf32-arm.h (elf_backend_rela_normal): Define #ifndef USE_REL. + * elf32-m32r.c (elf_backend_rela_normal): Likewise. + +2002-05-06 Nick Clifton + + * elf32-arm.h (elf32_arm_final_link_relocate): Convert + 'reloc_signed_max' and 'reloc_signed_min' into half-word offsets. + +2002-05-06 Alan Modra + + * elflink.h (elf_link_input_bfd ): Adjust r_offset + when not relocatable. Fix reloc_emitter call for K&R. + +2002-05-04 Alan Modra + + * elf64-ppc.c (ppc64_elf_relocate_section): Reinstate code + reloading local sym addend mistakenly removed in 2002-05-01 change. + + * dwarf2.c (struct line_head): Make prologue_length a bfd_vma. + (read_abbrevs): Change "offset" param to bfd_vma. + (parse_comp_unit): Change "version" and addr_size to unsigned ints. + Change "abbrev_offset" to bfd_vma. + (read_indirect_string): Use correct conversion chars in error + message format string, cast bfd_vma's to unsigned long. + (read_abbrevs): Likewise. + (read_attribute_value): Likewise. + (decode_line_info): Likewise. + (scan_unit_for_functions): Likewise. + (parse_comp_unit): Likewise. + +2002-05-04 Tom Rix + + * coffswap.h (coff_swap_reloc_in): Remove XCOFF support. + (coff_swap_reloc_out): Same. + * coff-rs6000.c: (xcoff_swap_reloc_in): Moved from coffswap.h. + (xcoff_swap_reloc_out): Same. + (xcoff_rtype2howto): Renamed from _bfd_xcoff_rtype2howto. Special + case some 16 bit relocs. Add reloc value to output. + (xcoff_howto_table): Remove 64 bit R_POS, add 16 bit + R_RBR. Improve names. + (_bfd_xcoff_reloc_type_lookup): Adjust for removal of 64 bit R_POS. + (bfd_xcoff_backend_data): Update with new reloc swap names. + (bfd_pmac_xcoff_backend_data) : Same. + * coff64-rs6000.c: (xcoff64_swap_reloc_in): Moved from coffswap.h. + (xcoff64_swap_reloc_out): Same. + (xcoff64_rtype2howto): Special case some 16 bit relocs and 32 bit + R_POS. Add reloc value to output. + (xcoff64_howto_table): Move 64 bit R_POS to first entry. Add 16 + bit R_RBR. Improve names, masks. + (xcoff64_reloc_type_lookup): Adjust for move of 64 bit R_POS. + (bfd_xcoff_backend_data): Update with new reloc swap names. + (bfd_xcoff_aix5_backend_data) : Same. + +2002-05-04 Alan Modra + + * elf32-hppa.c (struct elf32_hppa_link_hash_table): Add + bfd_count top_index, input_list, all_local_syms. + (elf32_hppa_setup_section_lists): New function, split from + elf32_hppa_size_stubs. + (elf32_hppa_next_input_section): Likewise. + (group_sections): Likewise. + (get_local_syms): Likewise. + (elf32_hppa_size_stubs): Adjust for split out functions. Look for + stubs on undefined syms too. + (elf32_hppa_set_gp): Use bfd_link_hash* instead of elf_link_hash*. + Only access htab elf fields when we have an elf hash table. + * elf32-hppa.h (elf32_hppa_setup_section_lists): Declare. + (elf32_hppa_next_input_section): Declare. + +2002-05-04 Bob Byrnes + + * opncls.c (_bfd_new_bfd_contained_in): Check return value of + _bfd_new_bfd. + +2002-05-03 H.J. Lu (hjl@gnu.org) + + * elfxx-mips.c (mips_elf_link_hash_entry): Add forced_local. + (mips_elf_link_hash_newfunc): Initialize forced_local to false. + (mips_elf_record_global_got_symbol): Call _bfd_mips_elf_hide_symbol + to hide a global symbol. + (_bfd_mips_elf_hide_symbol): Return if forced_local is true. Set + forced_local to true. + +2002-05-02 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section): Force relative relocs + vs SHN_UNDEF to zero. + +2002-05-02 Alan Modra + + * elf64-ppc.c (ppc64_elf_howto_raw ): Change to a + 16 bit reloc. + : Likewise. + (ppc64_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to + SECTOFF reloc. + * elf32-ppc.c (ppc_elf_howto_raw ): Correct. + (ppc_elf_reloc_type_lookup): Map from BFD_RELOC_16_BASEREL to + SECTOFF reloc. + + * elf64-ppc.c (ppc64_elf_addr16_ha_reloc): Delete. + (ppc64_elf_ha_reloc): New function. + (ppc64_elf_brtaken_reloc): New function. + (ppc64_elf_sectoff_reloc): New function. + (ppc64_elf_sectoff_ha_reloc): New function. + (ppc64_elf_toc_reloc): New function. + (ppc64_elf_toc_ha_reloc): New function. + (ppc64_elf_toc64_reloc): New function. + (ppc64_elf_unhandled_reloc): New function. + (ppc64_elf_howto_raw): Use the above. + : Mark pc_relative, pcrel_offset. + : Not pc_relative or pcrel_offset. Fix dst_mask. + : Likewise. + (IS_ABSOLUTE_RELOC): Update. + (struct ppc_link_hash_table): Add have_undefweak. + (ppc64_elf_link_hash_table_create): Init. + (func_desc_adjust): Set have_undefweak. + (ppc64_elf_func_desc_adjust): Call func_desc_adjust earlier. Only + add the .sfpr blr when have_undefweak. + (ppc64_elf_setup_section_lists): Check hash table flavour. + (ppc64_elf_next_input_section): Move output_section->owner test to + ppc64elf.em. + (ppc64_elf_set_toc): Rename to ppc64_elf_toc, remove info param + and relocatable test. Return TOCstart and don't set elf_gp. + (ppc64_elf_relocate_section): Correct BRTAKEN/BRNTAKEN branch + offset calculation. Add assert on weak sym branch tweaks. + * elf64-ppc.h (ppc64_elf_set_toc): Delete. + (ppc64_elf_toc): Declare. + (ppc64_elf_next_input_section): Update. + +2002-05-01 Alan Modra + + * syms.c (_bfd_stab_section_find_nearest_line): Don't bomb on NULL + file_name. + +2002-05-01 Alan Modra + + * elf64-ppc.c (CROR_151515, CROR_313131): Define. + (ppc64_elf_relocate_section): Use them. Don't look for plt calls + on R_PPC64_ADDR24 relocs. Require a nop or no link reg on plt + call branches. Correct undefined weak destination. + (ppc64_elf_func_desc_adjust): Always create at least one blr in + .sfpr, and correct case where either only savef* or restf* is + needed. + + Long branch stubs, multiple stub sections. + * elf64-ppc.h (ppc64_elf_setup_section_lists): Declare. + (ppc64_elf_next_input_section): Declare. + * elf64-ppc.c: Move linker-only prototypes. + (STUB_SUFFIX): Define. + (enum ppc_stub_type): New. + (struct ppc_stub_hash_entry): New. + (struct ppc_branch_hash_entry): New. + (struct ppc_link_hash_entry): Add stub_cache, oh. + (struct ppc_link_hash_table): Add stub_hash_table etc. Remove + sstub. Add sbrlt, srelbrlt, has_14bit_branch, stub_iteration. + Rename plt_overflow to stub_error. + (ppc_stub_hash_lookup): Define. + (ppc_branch_hash_lookup): Define. + (stub_hash_newfunc): New function. + (branch_hash_newfunc): New function. + (link_hash_newfunc): Init new fields. + (ppc64_elf_link_hash_table_create): Likewise. + (ppc64_elf_link_hash_table_free): New function. + (ppc_stub_name): New function. + (ppc_get_stub_entry): New function. + (ppc_add_stub): New function. + (create_linkage_sections): Use bfd_make_section_anyway. Create + .branch_lt and .rela.branch_lt sections. Don't create .stub. + (ppc64_elf_check_relocs): Set has_14bit_branch on R_PPC64_REL14*, + and set up for plt call stubs. Link func and func desc syms. + (ppc64_elf_gc_sweep_hook): Handle REL14* as per REL24. + (func_desc_adjust): Avoid hash lookup when func desc sym available + via shortcut, and set links when processing. + (ppc64_elf_hide_symbol): Likewise. + (allocate_dynrelocs): Don't allocate stub section here. + (ppc64_elf_size_dynamic_sections): Handle sbrlt and srelbrlt. + Remove sstub code. + (ppc_type_of_stub): New function. + (build_one_stub): Delete. + (ppc_build_one_stub): New function. + (ppc_size_one_stub): New function. + (ppc64_elf_setup_section_lists): New function. + (ppc64_elf_next_input_section): New function. + (group_sections): New function. + (get_local_syms): New function. + (ppc64_elf_size_stubs): Rewrite. + (ppc64_elf_build_stubs): Rewrite. + (ppc64_elf_relocate_section): Look up stub entry for REL24 + relocs. Don't propagate REL14* to dynamic objects. Look for long + branch stubs if REL14* or REL24 relocs won't reach. + (bfd_elf64_bfd_link_hash_table_free): Define. + +2002-04-30 Mark Mitchell + + * config.bfd: Add support for powerpc-*-windiss. + +2002-04-30 Tom Rix + + * xcofflink.c (xcoff_link_add_symbols): Always copy undef C_EXT + symbol names into the hash table. + +2002-04-28 Tom Rix + + * coff-rs6000.c (xcoff_calculate_relocation) : Function table for + calulating relocations. + (xcoff_complain_overflow) : Function table for relocation errors. + (xcoff_ppc_relocate_section): Use relocation and complain function + tables. + (xcoff_complain_overflow_unsigned_func): New complain function. + (xcoff_complain_overflow_signed_func): Same. + (xcoff_complain_overflow_bitfield_func): Same. + (xcoff_complain_overflow_dont_func): Same. + (xcoff_reloc_type_crel): New recot function. + (xcoff_reloc_type_br): Same. + (xcoff_reloc_type_ba): Same. + (xcoff_reloc_type_toc): Same. + (xcoff_reloc_type_rel): Same. + (xcoff_reloc_type_neg): Same. + (xcoff_reloc_type_pos): Same. + (xcoff_reloc_type_fail): Same. + (xcoff_reloc_type_noop): Same. + * libxcoff.h : Declare common parts for xcoff64. + * coff64-rs6000.c (xcoff64_ppc_relocate_section): Use relocation + and complain function tables. + +2002-04-28 Alan Modra + + * elf64-x86-64.c (struct elf64_x86_64_dyn_relocs): Comment typo. + * elf32-hppa.c (elf32_hppa_final_link): Formatting. + +2002-04-26 Alan Modra + + * opncls.c (bfd_make_readable): Call bfd_section_list_clear. + * xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise. + + * elflink.h (elf_bfd_final_link): Ensure input bfd class is the + same as the output before calling elf_link_input_bfd. + + * coffcode.h (coff_compute_section_file_positions): Set + section_tail after shuffling section list. + +2002-04-24 Christian Groessler + + * coff-z8k.c (extra_case): Fix R_IMM32 relocations: The + addresses are 23bit with a special layout, not plain 32bit + values. Prevent relocation of immediate values. + +2002-04-24 Chris G. Demetriou + + * elfxx-mips.c (_bfd_mips_elf_print_private_bfd_data): If MDMX or + MIPS-16 ASE flags are set, print something to indicate that. + +2002-04-23 Alan Modra + + * elf32-hppa.c (hppa_type_of_stub): Correct and simplify condition + under which a plt call stub is used. + (final_link_relocate): Similarly. + (allocate_plt_static): Clear h-plabel except when plt entry is + exclusively used for a plabel. + (allocate_dynrelocs): Use the above to simplify plt sizing. + (struct elf32_hppa_link_hash_table): Add has_22bit_branch. + (elf32_hppa_link_hash_table_create): Init. + (BL22_RP): Define. + (hppa_build_one_stub): Use BL22_RP if has_22bit_branch. + (elf32_hppa_check_relocs): Set has_22bit_branch. + + * elf32-hppa.c (elf32_hppa_check_relocs): Remove debug message. + (final_link_relocate): Likewise. + +2002-04-22 Jakub Jelinek + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't build + search table if some FDE is DW_EH_PE_aligned encoded either. + (_bfd_elf_write_section_eh_frame): Handle terminating FDE specially. + +2002-04-22 Richard Smith + Jakub Jelinek + + * elf-eh-frame.c (struct eh_cie_fde): Add per_encoding_relative. + (_bfd_elf_discard_section_eh_frame): Set it for CIEs with pcrel + encoded personality. + (_bfd_elf_write_section_eh_frame): Adjust pcrel encoded personality + for CIE/FDE removal. + +2002-04-20 Tom Rix + + * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Fix C_FILE auxent. + +2002-04-20 Alan Modra + + * archures.c (bfd_lookup_arch): Move the list order comment.. + (struct bfd_arch_info): ..to where it belongs. + * bfd-in2.h: Regenerate. + + * archures.c (bfd_lookup_arch): Add comment on list order. + (bfd_default_set_arch_mach): Use bfd_lookup_arch. + * cpu-powerpc.c (bfd_powerpc_archs): Re-order so that the default + is always at head of list. + +2002-04-18 Nick Clifton + + * coff-arm.c (coff_thumb_pcrel_12, coff_thumb_pcrel_9, + insert_thumb_branch, record_thumb_to_arm_glue): Suppress + definition of these functions for ARM_WINCE builds as they are + not used. + (SWAP_IN_RELOC_OFFSET, SWAP_OUT_RELOC_OFFSET): Do not define + for ARM_WINCE builds. + +2002-04-18 Nick Clifton + + * coff-arm.c (bfd_arm_process_before_allocation): + +2002-04-17 J"orn Rennecke + + * cpu-sh.c (scan_mach): Delete. + (arch_info_struct): Replace scan_mach with bfd_default_scan. + (bfd_sh_arch): Likewise. + +2002-04-16 Nick Clifton + + * ihex.c (ihex_write_object_contents): Fix check for records + crossing 64K boundaries. + +2002-04-16 Alan Modra + + * elf32-m32r.c (m32r_elf_add_symbol_hook): Check the hash table + type rather than just assuming entries are ELF. + * elf32-sh64.c (sh64_elf_add_symbol_hook): Likewise. + * elf64-sh64.c (sh64_elf64_add_symbol_hook): Likewise. + * elf64-sparc.c (sparc64_elf_add_symbol_hook): Likewise. + * elf64-mmix.c (mmix_elf_add_symbol_hook): Use bfd_link_hash_entry + rather than elf_link_hash_entry. + +2002-04-15 Richard Henderson + + * elf32-mips.c (mips_elf32_object_p): Revert 0404 fragment: allow + n32 binaries. + +2002-04-15 Michael Snyder + + * opncls.c (bfd_close): Write contents if writeable. + Minor formatting tidy-ups. + +2002-04-15 Alan Modra + + * elf32-ppc.c (ppc_elf_add_symbol_hook): Check the hash table type. + +2002-04-12 Michael Snyder + + * bfd-in.h (bfd_get_section_lma): New access macro. + Minor white-space fix-up. + +2002-04-12 Alan Modra + + * elf.c (prep_headers): Don't zero EI_OSABI, EI_ABIVERSION or + header pad. + +2002-04-09 DJ Delorie + + * elfarm-nabi.c (elf32_arm_howto_table): Fix ABS16 masks. + +2002-04-09 Casper S. Hornstrup + + * coffcode.h (coff_read_word): New. + (coff_compute_checksum): New. + (coff_apply_checksum): New. + (coff_write_object_contents): Call coff_apply_checksum () to + apply checksum to PE image. + +2002-04-08 Randolph Chung + + * elf32-hppa.c (hppa_unwind_entry_compare): Move to elf-hppa.h. + (elf32_hppa_final_link): Split out sorting logic to.. + * elf-hppa.h (elf_hppa_sort_unwind): ..here. + (elf_hppa_final_link): Call elf_hppa_sort_unwind. + +2002-04-07 Andrew Cagney + + * configure.in: Add missing ``|'' to powerpc-*-aix4.[4-9]* + pattern. + * configure: Re-generate. + +2002-04-07 Andrew Cagney + + * configure.in: Only define AIX_CORE_DUMPX_CORE when AIX version + is greater or equal to 4.3.3. + * configure: Regenerate. + Fix PR gdb/344. + +2002-04-05 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_howto_table) : Fix typo in name. + (cris_elf_check_relocs): Always create .rela.got here when + R_CRIS_16_GOTPLT or R_CRIS_32_GOTPLT is seen. + (elf_cris_adjust_gotplt_to_got): Don't create .rela.got here; + assume it's created. + +2002-04-04 Daniel Jacobowitz + + * aout-adobe.c (aout_32_bfd_link_hash_table_free): Define. + * aout-target.h (MY_bfd_link_hash_table_free): Conditionally + define. + * aout-tic30.c (MY_bfd_link_hash_table_free): Likewise. + * bfd.c (bfd_link_hash_table_free): Define. + * binary.c (binary_bfd_link_hash_table_free): Define. + * bout.c (b_out_bfd_link_hash_table_free): Define. + * coff-rs6000.c (rs6000coff_vec): Include + _bfd_generic_link_hash_table_free. + (pmac_xcoff_vec): Likewise. + * coff64-rs6000.c (rs6000coff64_vec): Likewise. + (aix5coff64_vec): Likewise. + * coffcode.h (coff_bfd_link_hash_table_free): Conditionally define. + * elf-m10300.c (elf32_mn10300_link_hash_table_free): New function. + (bfd_elf32_bfd_link_hash_table_free): Define. + * elf32-hppa.c (elf32_hppa_link_hash_table_free): New function. + (bfd_elf32_bfd_link_hash_table_free): Define. + * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Conditionally + define. + * i386msdos.c (msdos_bfd_link_hash_table_free): Define. + * i386os9k.c (os9k_bfd_link_hash_table_free): Define. + * ieee.c (ieee_bfd_link_hash_table_free): Define. + * ihex.c (ihex_bfd_link_hash_table_free): Define. + * libbfd-in.h (_bfd_nolink_bfd_link_hash_table_free): Define. + (_bfd_generic_link_hash_table_free): Add prototype. + * libcoff-in.h (_bfd_xcoff_bfd_link_hash_table_free): Add prototype. + * libecoff.h (_bfd_ecoff_bfd_link_hash_table_free): Define. + * linker.c (_bfd_generic_link_hash_table_free): New function. + * mmo.c (mmo_bfd_link_hash_table_free): Define. + * nlm-target.h (nlm_bfd_link_hash_table_free): Define. + * oasys.c (oasys_bfd_link_hash_table_free): Define. + * ppcboot.c (ppcboot_bfd_link_hash_table_free): Define. + * som.c (som_bfd_link_hash_table_free): Define. + * srec.c (srec_bfd_link_hash_table_free): Define. + * tekhex.c (tekhex_bfd_link_hash_table_free): Define. + * versados.c (versados_bfd_link_hash_table_free): Define. + * vms.c (vms_bfd_link_hash_table_free): New function. + * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_free): New function. + + * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_malloc + instead of bfd_alloc. + * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise. + * coff-mcore.c (coff_mcore_link_hash_table_create): Likewise. + * coff-ppc.c (ppc_coff_link_hash_table_create): Likewise. + * cofflink.c (_bfd_coff_link_hash_table_create): Likewise. + * ecoff.c (_bfd_ecoff_bfd_link_hash_table_create): Likewise. + * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise. + * elf.c (_bfd_elf_link_hash_table_create): Likewise. + * elf32-arm.h (elf32_arm_link_hash_table_create): Likewise. + * elf32-cris.c (elf_cris_link_hash_table_create): Likewise. + * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise. + * elf32-i386.c (elf_i386_link_hash_table_create): Likewise. + * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise. + * elf32-s390.c (elf_s390_link_hash_table_create): Likewise. + * elf32-sh.c (sh_elf_link_hash_table_create): Likewise. + * elf64-alpha.c (elf64_alpha_bfd_link_hash_table_create): Likewise. + * elf64-ppc.c (ppc64_elf_link_hash_table_create): Likewise. + * elf64-s390.c (elf_s390_link_hash_table_create): Likewise. + * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise. + * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create): Likewise. + * elf64-x86-64.c (elf64_x86_64_link_hash_table_create): Likewise. + * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise. + * linker.c (_bfd_generic_link_hash_table_create): Likewise. + * m68klinux.c (linux_link_hash_table_create): Likewise. + * sparclinux.c (linux_link_hash_table_create): Likewise. + * sunos.c (sunos_link_hash_table_create): Likewise. + * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise. + + * targets.c: Add _bfd_link_hash_table_free to xvec. + + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * libcoff.h: Regenerate. + +2002-04-04 Alan Modra + + * dep-in.sed: Cope with absolute paths. + * Makefile.am (dep.sed): Subst TOPDIR, and not INCDIR. + Run "make dep-am". + * Makefile.in: Regenerate. + * coff-arm.c: Fix copyright date. + * cpu-h8300.c: Likewise. + * cpu-i370.c: Likewise. + * cpu-s390.c: Likewise. + * cpu-mips.c: Likewise. + * po/SRC-POTFILES.in: Regenerate. + +2002-04-04 Thiemo Seufer + + * Makefile.am: Add elfxx-mips.c to the known backends. + (elf32-mips.lo): remove dependency to coff/external.h. + * Makefile.in: Regenerate. + * configure.in: Add elfxx-mips.lo to all vectors using elf32-mips.lo + Remove elf32-mips.lo from 64 bit vectors. Update dependencies + accordingly. + * configure: Regenerate. + * elf-bfd.h: Move all MIPS ELF specific prototypes to elfxx-mips.h. + (irix_compat_t): IRIX compatibility level, moved from elf32-mips.c. + (elf_backend_mips_irix_compat, elf_backend_mips_rtype_to_howto): New + MIPS specific backend functions. + * elf32-mips.c: Moved most code to elfxx-mips.c. + (mips_elf_hi16_reloc): Rename from _bfd_mips_elf_hi16_reloc and make + static. + (mips_elf_lo16_reloc): Likewise, was _bfd_mips_elf_lo16_reloc. + (mips_elf_got16_reloc): Likewise, was _bfd_mips_elf_got16_reloc. + (mips_elf_gprel32_reloc): Likewise, was _bfd_mips_elf_gprel32_reloc. + (mips_elf32_rtype_to_howto): Rename from mips_rtype_to_howto. Changed + interface to allow selection of the right REL or RELA howto table. + (mips_elf32_object_p): Rename from _bfd_mips_elf_object_p and made + static. Let it refuse n32 objects. + (elf32_mips_grok_prstatus): Rename from _bfd_elf32_mips_grok_prstatus. + (elf32_mips_grok_psinfo): Rename from _bfd_elf32_mips_grok_psinfo. + (elf32_mips_discard_info): Rename from _bfd_elf32_mips_discard_info. + (elf32_mips_ignore_discarded_relocs): Rename from + _bfd_elf32_mips_ignore_discarded_relocs. + (elf32_mips_write_section): Rename from _bfd_elf32_mips_write_section. + (elf32_mips_irix_compat): New function, replaces IRIX_COMPAT. + (elf_mips_howto_table_rela): Remove. + * elf64-mips.c: Moved most code to elfxx-mips.c. + (bfd_elf64_bfd_reloc_type_lookup): Make static. + (mips_elf64_rtype_to_howto): New function. + (mips_elf64_object_p): Likewise. + (elf64_mips_irix_compat): Likewise. + * elfxx-mips.c: New file containing common code merged together from + elf32-mips.c and elf64-mips.c. + * elfxx-mips.h: New file containing MIPS specific prototypes from + elf-bfd.h. + * elfxx-target.h: Add handling for elf_backend_mips_irix_compat and + elf_backend_mips_rtype_to_howto. + +2002-04-04 Alan Modra + + * srec.c (MAXCHUNK, Chunk): Revise comments. + (srec_write_record): Correct buffer size. + (srec_write_header): Do without intermediate buffer. + (srec_write_section): Validate Chunk. + (srec_write_terminator): Pass NULL instead of dummy buffer. + (srec_write_symbols): Pass file and symbol names directly to + bfd_bwrite so sprintf won't overflow buffer. + +2002-04-03 Jakub Jelinek + + * elf32-sparc.c (elf32_sparc_relocate_section): Don't emit dynamic + PC relative relocs against hidden symbols. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + +2002-04-03 Alan Modra + + * elf.c (_bfd_elf_make_section_from_shdr): When setting section + LMAs, loop over segments until p_vaddr and p_memsz specify an + extent enclosing the section. + +2002-04-02 Nick Clifton + + * ihex.c (ihex_write_object_contents): Do not allow records to + cross a 64K boundary - wrap if necessary. + +2002-04-01 Nathan Williams + + * elf.c (elfcore_netbsd_get_lwpid): Fix off-by-one error + which caused the returned LWP ID to always be 0. + +2002-04-01 Richard Henderson + + * elf32-sparc.c (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New. + (elf32_sparc_relocate_section): Use it to figure out when to + initialize .got entries. + * elf64-sparc.c: Similarly. + +2002-03-28 Alan Modra + + * linker.c (link_action): Ignore duplicate warning syms. + (_bfd_generic_link_write_global_symbol): Follow warning symbol link. + * elflink.h (elf_adjust_dynstr_offsets): Likewise. + (elf_adjust_dynamic_symbol): Likewise. + (elf_export_symbol): Likewise. + (elf_link_find_version_dependencies): Likewise. + (elf_link_assign_sym_version): Likewise. + (elf_link_sec_merge_syms): Likewise. + (elf_link_output_extsym): Likewise. + (elf_gc_sweep_symbol): Likewise. + (elf_gc_propagate_vtable_entries_used): Likewise. + (elf_gc_smash_unused_vtentry_relocs): Likewise. + (elf_gc_allocate_got_offsets): Likewise. + (elf_collect_hash_codes): Likewise. + * elflink.c (elf_link_renumber_hash_table_dynsyms): Likewise. + * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): Likewise. + (elf_hppa_remark_useless_dynamic_symbols): Likewise. + * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise. + * elf32-arm.h (elf32_arm_discard_copies): Likewise. + * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Likewise. + (elf_cris_discard_excess_dso_dynamics): Likewise. + * elf32-hppa.c (clobber_millicode_symbols): Likewise. + (mark_PIC_calls): Likewise. + (allocate_plt_static): Likewise. + (allocate_dynrelocs): Likewise. + (readonly_dynrelocs): Likewise. + * elf32-i386.c (allocate_dynrelocs): Likewise. + (readonly_dynrelocs): Likewise. + * elf32-i370.c (i370_elf_adjust_dynindx): Likewise. + * elf32-m68k.c (elf_m68k_discard_copies): Likewise. + * elf32-mips.c (mips_elf_output_extsym): Likewise. + (mips_elf_sort_hash_table_f): Likewise. + (mips_elf_check_mips16_stubs): Likewise. + * elf32-s390.c (allocate_dynrelocs): Likewise. + (readonly_dynrelocs): Likewise. + * elf32-sh.c (sh_elf_discard_copies): Likewise. + * elf32-xstormy16.c (xstormy16_relax_plt_check): Likewise. + (xstormy16_relax_plt_realloc): Likewise. + * elf64-alpha.c (elf64_alpha_calc_got_offsets_for_symbol): Likewise. + (elf64_alpha_output_extsym): Likewise. + * elf64-hppa.c (elf64_hppa_mark_exported_functions): Likewise. + * elf64-mips.c (mips_elf64_sort_hash_table_f): Likewise. + (mips_elf64_check_mips16_stubs): Likewise. + (mips_elf64_output_extsym): Likewise. + * elf64-ppc.c (func_desc_adjust): Likewise. + (allocate_dynrelocs): Likewise. + (readonly_dynrelocs): Likewise. + * elf64-s390.c (allocate_dynrelocs): Likewise. + (readonly_dynrelocs): Likewise. + * elf64-sh64.c (sh64_elf64_discard_copies): Likewise. + * elf64-x86-64.c (allocate_dynrelocs): Likewise. + (readonly_dynrelocs): Likewise. + * elfxx-ia64.c (elfNN_ia64_global_dyn_sym_thunk): Likewise. + * aoutx.h (aout_link_write_other_symbol): Likewise. + * cofflink.c (_bfd_coff_write_task_globals): Likewise. + (_bfd_coff_write_global_sym): Likewise. + * i386linux.c (linux_tally_symbols): Likewise. + * m68klinux.c (linux_tally_symbols): Likewise. + * sparclinux.c (linux_tally_symbols): Likewise. + * pdp11.c (aout_link_write_other_symbol): Likewise. + * sunos.c (sunos_scan_dynamic_symbol): Likewise. + * xcofflink.c (xcoff_build_ldsyms): Likewise. + (xcoff_write_global_symbol): Likewise. + + * cofflink.c (_bfd_coff_final_link): Formatting. + * cpu-mips.c (mips_compatible): Make static, prototype. + * elf32-i386.c (elf_i386_check_relocs): Formatting. + * elf32-sh.c (sh_elf_size_dynamic_sections): Likewise. + * elf64-alpha.c (elf64_alpha_output_extsym): Likewise. + * elf64-mips.c (mips_elf64_sort_hash_table): Likewise. + (mips_elf64_final_link): Likewise. + * elflink.h (elf_link_find_version_dependencies): Remove duplicate + prototype. + +2002-03-27 Nick Clifton + + * coff-arm.c (SWAP_IN_RELOC_OFFSET): Define. + (SWAP_OUT_RELOC_OFFSET): Define. + +2002-03-27 Gregory Steuck + + * elf.c (_bfd_elf_get_symtab_upper_bound): Leave space for + terminating NULL if empty symbol table. + (_bfd_elf_get_dynamic_symtab_upper_bound): Likewise. + +2002-03-26 H.J. Lu (hjl@gnu.org) + + * elflink.h (elf_link_input_bfd): Revert the last change since + the gcc exception handling isn't fixed yet. + +2002-03-26 H.J. Lu (hjl@gnu.org) + + * elflink.h (elf_link_input_bfd): Complain about relocations + against local symbols in discarded sections. + +2002-03-26 Alan Modra + + * elflink.h (elf_gc_mark): Don't recurse into non-ELF sections. + +2002-03-23 Alan Modra + + * elf.c (_bfd_elf_make_section_from_shdr): Don't set lma based on + section file offset for !SEC_LOAD sections. + +2002-03-21 Richard Earnshaw + + * elf32-arm.h (elf32_arm_final_link_relocate , + ): Handle relocations to Thumb functions. + +2002-03-21 Alan Modra + + * coff64-rs6000.c (_bfd_xcoff64_put_symbol_name): Prototype. + Whitespace changes. + * archive.c: Update copyright date. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2002-03-20 Daniel Jacobowitz + + * dwarf2.c (struct funcinfo): Move up. + (lookup_address_in_function_table): New argument function_ptr. + Set it. + (lookup_address_in_line_table): New argument function. If function + is non-NULL, use it to handle ``addr'' before the first line note of + the function. + (comp_unit_find_nearest_line): Update and swap calls to + lookup_address_in_function_table and lookup_address_in_line_table. + * syms.c (_bfd_stab_section_find_nearest_line): Use the first + N_SLINE encountered if we see an N_FUN before any N_SLINE. + +2002-03-20 Tom Rix + + * coff-rs6000.c (_bfd_xcoff_stat_arch_elt): Renamed from + _bfd_xcoff_generic_stat_arch_elt. Fix format check. + * coff64-rs6000.c : Use _bfd_xcoff_stat_arch_elt. + +2002-03-19 Tom Rix + + * xcofflink.c (_bfd_xcoff_bfd_link_add_symbols): Look through all + dynamic objects in archives. + +2002-03-19 Hans-Peter Nilsson + + * elflink.h (NAME(bfd_elf,record_link_assignment)): Don't set + STT_NOTYPE symbols to STT_OBJECT. + +2002-03-18 Jan Hubicka + + * cpu-i386.c (bfd_x86_64_arch): Rename to "i386:x86-64" + +2002-03-18 Tom Rix + + * aix5ppc.core.c : New file for AIX 5 64 bit core support. + * bfd-in.h : Add bfd_xcoff_ar_archive_set_magic declaration. + * coff-rs6000 (do_pad) : New function for archive padding. + (do_copy) : New function for object file copying in archives. + (do_shared_object_padding) : New function for padding shared + objects to their text section alignment in archives. + (bfd_xcoff_ar_achive_set_magic) : Stub. + (xcoff_write_armap_big) : Use do_copy and do_pad. + (xcoff_write_archive_contents_big) : Use do_shared_object_padding, + do_copy and do_pad. + * coff64-rs6000.c (xcoff64_write_ojbect_contents) : Use + bfd_xcoff_magic_number. + (xcoff64_bad_format_hook) : New function for _bfd_bad_format_hook + fop. + (xcoff_backend_data_r) : Use xcoff64_bad_format_hook. + (bfd_xcoff_aix5_backend_data) : New Aix 5 backend data. + (aix5coff64_vec) : New Aix 5 target aix5coff64-rs6000. + * rs6000-core.c : Update copyright date. + * xcofflink.c (bfd_xcoff_size_dynamic_sections): Check for NULL + csectpp. + * coffcode.h (coff_new_section_hook) : Use new accessor macros. + (coff_set_arch_mach_hook) : Add Aix 5 U64_TOCMAGIC magic #. + (coff_set_flags) : Use bfd_xcoff_magic_number. + * libxcoff.h (bfd_xcoff_is_xcoff64): Add U64_TOCMAGIC. + * configure.in : Add powerpc-*-aix5 and rs6000-*-aix5 support. + * Makefile.am : Same. + * config.bfd : Same. + * targets.c : Same. + * configure : Regnerate. + * Makefile.in : Same. + * bfd-in2.h : Same. + +2002-03-18 Nick Clifton + + * po/fr.po: Updated version. + +2002-03-18 Alan Modra + + * libbfd.c (bfd_write_bigendian_4byte_int): Return true iff success. + * libbfd.h: Regenerate. + * archive.c (coff_write_armap): Pass on failures from + bfd_write_bigendian_4byte_int. + +2002-03-14 H.J. Lu + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Set the BFD + error to bfd_error_nonrepresentable_section for reinit_array + section in DSO. + +2002-03-14 Nick Clifton + + * coffcode.h (coff_slurp_symbol_table): When adding BSF_WEAK flag, + OR it in rather than replacing previously selected flags. + + * elfxx-target.h (TARGET_BIG_SYM): Set ar_max_namelen to 15. + (TARGET_LITTLE_SYM): Set ar_max_namelen to 15. + +2002-03-14 Alan Modra + + * cpu-mips.c (mips_compatible): New. Don't check bits_per_word. + (N): Use the above. + * elflink.h (elf_bfd_final_link): Revert last change. Instead, + ensure reloc size matches before calling elf_link_input_bfd. + Add an assert to check reloc size when counting output relocs. + +2002-03-14 Nick Clifton + + * mmo.c (mmo_get_loc): Return NULL rather than false. + +2002-03-13 Nick Clifton + + * po/fr.po: Updated version. + +2002-03-13 Alan Modra + + * archures.c (bfd_default_compatible): Test bits_per_word. + * cpu-i386.c (i386_compatible): Remove. Replace occurrences with + bfd_default_compatible. + * cpu-i370.c (i370_compatible): Likewise. + * cpu-sparc.c (sparc_compatible): Likewise. + * cpu-h8300.c (compatible): Test in->arch == out->arch. + + * elflink.h: Formatting fixes. + (elf_link_output_extsym): Merge undefined and undef weak cases. + + * elflink.h (elf_bfd_final_link): Only call elf_link_input_bfd + when word size of input matches output word size. + +2002-03-12 Andreas Jaeger + + * cpu-i386.c (i386_compatible): New. Use it instead of + bfd_default_compatible. + +2002-03-07 H.J. Lu (hjl@gnu.org) + + * coff-sh.c (shcoff_reloc_map): Use bfd_reloc_code_real_type + as the type for bfd_reloc_val. + +2002-03-05 John David Anglin + + * elf-hppa.h (elf_hppa_is_dynamic_loader_symbol): New function. + (elf_hppa_relocate_section): Ignore undefined dynamic loader symbols. + (elf_hppa_final_link_relocate): Correct relocations for indirect + references to local data through the DLT. Fix .opd creation for + local symbols using R_PARISC_LTOFF_FPTR32 and R_PARISC_FPTR64 + relocations. Use e_lsel selector for R_PARISC_DLTIND21L, + R_PARISC_LTOFF_FPTR21L and R_PARISC_LTOFF_TP21L as per + "Processor-Specific ELF for PA_RISC, Version 1.43" document. + Similarly, use e_rsel for DLT and LTOFF 'R' relocations. + * elf32-hppa.c (final_link_relocate): Revise relocation selectors + as per "Processor-Specific ELF for PA_RISC, Version 1.43" document. + +2002-03-05 Jakub Jelinek + + * merge.c (_bfd_merge_sections): Don't segfault if there + is nothing to merge due to GC. + +2002-03-05 Alan Modra + + * elf32-hppa.c (clobber_millicode_symbols): Remove hack to keep + symbols that have been forced local. + + * elflink.h (elf_bfd_final_link): Call elf_link_output_extsym + to output forced local syms for non-shared link. + (elf_link_output_extsym): Tweak condition for calling backend + adjust_dynamic_symbol so that previous behaviour is kept. + Whitespace changes throughout file. + +2002-03-04 H.J. Lu + + * elf.c (bfd_section_from_shdr): Handle special sections, + .init_array, .fini_array and .preinit_array. + (elf_fake_sections): Likewise. + + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Create the + DT entry only if the section is in output for .init_array, + .fini_array and .preinit_array. Complain about .preinit_array + section in DSO. + (elf_bfd_final_link): Warn zero size for .init_array, + .fini_array and .preinit_array sections. + + * elfxx-ia64.c (elfNN_ia64_section_from_shdr): Remove + SHT_INIT_ARRAY, SHT_FINI_ARRAY and SHT_PREINIT_ARRAY. + (elfNN_ia64_fake_sections): Remove .init_array, .fini_array and + .preinit_array. + +2002-03-04 Alan Modra + + * configure.in (WIN32LIBADD): Don't eval PICFLAG assignment. + * configure: Regenerate. + +2002-03-02 Tom Rix + + * coff64-rs6000.c (xcoff64_howto_table): Replace howto types with + symbolic equiv. + * coff-rs6000.c (xcoff_howto_table): Same. + +2002-03-01 David Mosberger + + * elflink.h (size_dynamic_sections): If section named + ".preinit_array" exists, create DT_PREINIT_ARRAY and + DT_PREINIT_ARRAYSZ entries in dynamic table. Analogously for + ".init_array" and ".fini_array". + (elf_bfd_final_link): Handle DT_PREINIT_ARRAYSZ, DT_INIT_ARRAYSZ, + DT_FINI_ARRAYSZ, DT_PREINIT_ARRAY, DT_INIT_ARRAY, and + DT_FINI_ARRAY. + +2002-02-26 Andrew Macleod + + * elflink.h (elf_bfd_final_link): Don't crash on SHN_UNDEF local + dynsyms. + +2002-02-25 Alan Modra + + * elf64-hppa.h: Update copyright date. + + * elf64-ppc.c (ppc64_elf_check_relocs): Warning fix. + (ppc64_elf_relocate_section): Don't generate power4 style branch + hints for *_BRTAKEN and *_BRNTAKEN relocs. + +2002-02-22 Jakub Jelinek + + * elf64-sh64.c (sh_elf64_relocate_section): Fix a typo from my + last patch. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + +2002-02-21 Andreas Jaeger + + * elf64-x86-64.c: Major rework that introduces all recent changes + to the x86-64 backend. Get a closer match to elf32-i386. + (struct elf64_x86_64_dyn_relocs): Rename from + elf64_x86_64_pcrel_relocs_copied, add additional fields. Change + all users. + (struct elf64_x86_64_link_hash_table): Add short cuts to some + sections. + (link_hash_newfunc): Rename from elf64_x86_64_link_hash_newfunc, + remove casts, initialize new hash members. + (create_got_section): New. + (elf64_x86_64_create_dynamic_sections): New. + (elf64_x86_64_copy_indirect_symbol): New. + (elf64_x86_64_check_relocs): Don't allocate space for dynamic + relocs, .got or .relgot here but do it in allocate_dynrelocs. + Reference count possible .plt and .got entries. Don't test input + section SEC_READONLY here to try to avoid copy relocs, and keep + dyn_relocs regardless of ELF_LINK_NON_GOT_REF. Don't set + DF_TEXTREL here. Delay setting of variables until needed. Cache + pointer to "sreloc" section in elf_section_data. Tweak condition + under which .got created. Report files with bad relocation + section names. + (elf64_x86_64_gc_sweep_hook): Sweep dyn_relocs and local_dynrel. + Reference count possible .plt entries. Don't deallocate .got and + .relgot space here. + (elf64_x86_64_adjust_dynamic_symbol): Handle nocopyreloc. Don't + do copy reloc processing for weakdefs. Remove redundant casts and + aborts. Delay setting of vars until needed. Move creation of + dynamic symbols and allocation of .plt and .rela.plt to + allocate_dynrelocs. Replace BFD_ASSERT with abort. + (WILL_CALL_FINISH_DYNAMIC_SYMBOL): New. + (allocate_dynrelocs): New. + (readonly_dynrelocs): New. + (elf64_x86_64_size_dynamic_sections): Call readonly_dynrelocs. + Allocate space for dyn relocs. Replace BFD_ASSERT with abort. + Zero out the dynamic allocated content space. + (elf64_x86_64_discard_copies): Removed. + (elf64_x86_64_relocate_section): Make use of dynamic section + short-cuts. Localise vars, and delay setting. Better error + reporting, replace BFD_ASSERT with abort. Check + ELF_LINK_HASH_DEF_DYNAMIC to see if a symbol is not defined in the + regular object file and tread the weak definition as the normal + one. Don't discard relocs for undefweak or undefined symbols and + check !DEF_REGULAR as well as DEF_DYNAMIC in test for avoided copy + relocs. + (elf64_x86_64_finish_dynamic_symbol): Don't copy relocs for + symbols that have been forced local. Use same test to decide if + we can use a relative reloc for got as relocate_section. Expand + SHN_UNDEF comment. Move expressions out of function calls. + Replace BFD_ASSERT with abort. + (bfd_elf64_bfd_final_link): Removed. + (elf_backend_copy_indirect_symbol): Define. + +2002-02-20 Tom Rix + + * coff-rs6000.c (xcoff_howto_table): Add 16 bit R_BA. + (_bfd_xcoff_reloc_type_lookup): Use it. + * coff64-rs6000.c (xcoff64_howto_table): Same. + (xcoff64_reloc_type_lookup): Same. + +2002-02-20 Peter Schauer + + * osf-core.c (osf_core_vec): OSF/1 (Digital Unix) core files are + little endian. + +2002-02-19 Martin Schwidefsky + + * archures.c (bfd_mach_s390_esa): Rename to bfd_mach_s390_31. + (bfd_mach_s390_esame): Rename to bfd_mach_s390_64. + * bfd-in2.h: Regenerate. + * cpu-s390.c (arch_info_struct): Use renamed architecture defines. + Replace architecture name "s390" with "s390:31-bit" and "s390:esame" + with "s390:64-bit". + * elf32-s390.c (elf_howto_table): Add 32 bit pc relative relocations. + (elf_s390_reloc_type_lookup): Likewise. + (elf_s390_check_relocs): Likewise. + (elf_s390_gc_sweep_hook): Likewise. + (elf_s390_relocate_section): Likewise. + (elf_s390_object_p): Use renamed architecture define. + * elf64-s390.c (elf_s390_object_p): Use renamed architecture define. + +2002-02-19 Frank Ch. Eigler + + * syms.c (stt[]): Sorted. Added .init/.fini -> "t" mapping. + +2002-02-19 Jakub Jelinek + + * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Enable + absptr -> pcrel optimization for shared libs. + Only create minimal .eh_frame_hdr if absptr FDE encoding in shared + library cannot be converted to pcrel. + (_bfd_elf_eh_frame_section_offset): Return -2 if making absptr + relative. + * elf32-i386.c (elf_i386_relocate_section): If + _bfd_elf_section_offset returned -2, skip, but make sure the + relocation is installed. + * elf32-arm.h (elf32_arm_final_link_relocate): Likewise. + * elf32-cris.c (cris_elf_relocate_section): Likewise. + * elf32-hppa.c (elf32_hppa_relocate_section): Likewise. + * elf32-i370.c (i370_elf_relocate_section): Likewise. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_relocate_section): Likewise. + * elf32-s390.c (elf_s390_relocate_section): Likewise. + * elf32-sh.c (sh_elf_relocate_section): Likewise. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + * elf64-ppc.c (ppc64_elf_relocate_section): Likewise. + * elf64-s390.c (elf_s390_relocate_section): Likewise. + * elf64-sh64.c (sh_elf64_relocate_section): Likewise. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise. + * elf64-alpha.c (elf64_alpha_relocate_section): Handle + _bfd_elf_section_offset returning -2 the same way as -1. + * elfxx-ia64.c (elfNN_ia64_install_dyn_reloc): Likewise. + * elf32-mips.c (mips_elf_create_dynamic_relocation): Add FIXME + and BFD_ASSERT. + * elf64-mips.c (mips_elf64_create_dynamic_relocation): Likewise. + +2002-02-18 Tom Rix + + * xcofflink.c (bfd_xcoff_link_gernate_rtinit): Add -brtl support. + (bfd_xcoff_size_dynamic_sections): Same. + * bfd-in.h (bfd_xcoff_link_generate_rtinit): Same. + (bfd_xcoff_size_dynamic_sections): Same. + * coff-rs6000.c (xcoff_generate_rtinit): Same. + * coff-rs646000.c (xcoff64_generate_rtinit): Same. + * libxcoff.h (struct xcoff_backend_data_rec): Same. + * xcofflink.c (xcoff_build_ldsyms, xcoff_link_add_symbols): Clean. + * bfd-in2.h: Regenerate. + +2002-02-18 Alan Modra + + * elf64-ppc.c (STFD_FR0_0R1, LFD_FR0_0R1, BLR): Define. + (struct ppc_link_hash_table): Add sfpr. + (ppc64_elf_link_hash_table_create): Init it. + (ppc64_elf_create_dynamic_sections): Split creation of .stub and + .glink out to.. + (create_linkage_sections): ..here. Make .sfpr too. + (ppc64_elf_check_relocs): Call create_linkage_sections, and set + dynobj early. + (MIN_SAVE_FPR, MAX_SAVE_FPR): Define. + (ppc64_elf_func_desc_adjust): Look for missing ._savef* and + ._restf* functions, and create as needed. + (func_desc_adjust): Only force_local for shared libs. + +2002-02-18 David O'Brien + + * configure.in: Bump version number post 2.12 branching. + * configure: Regenerate. + +2002-02-17 Hans-Peter Nilsson + + * mmo.c: Correct and improve comments. + (mmo_write_chunk): Store trailing byte in bfd buffer; don't + zero-pad. Use input to fill up non-empty bfd buffer. + (mmo_flush_chunk): New function. + (mmo_write_loc_chunk): Add parameter last_vmap, all callers + changed. Don't emit location specifier if VMA is same as + *LAST_VMAP after omitting leading zero contents. Call + mmo_flush_chunk before emitting location specifier. + (mmo_write_loc_chunk_list): Call mmo_flush_chunk when finished + with mmo_write_loc_chunk calls. + (mmo_internal_write_section): Call mmo_flush_chunk after + mmo_write_chunk. + (mmo_write_symbols_and_terminator): Move :Main to first position + in symbol array. Add faked one if it does not exist if there are + other symbols. Don't add it if there are no symbols at all. Move + out test for value of :Main from symbol loop. Rename table + fakemain to maintable and variable mainsym to fakemain. + +2002-02-15 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section) [BRSGP]: A target + section with no got matches any got. Simplify error generaion. + +2002-02-15 Alan Modra + + Support arbitrary length fill patterns. + * linker.c (bfd_new_link_order): Zero all fields with bfd_zalloc. + (_bfd_default_link_order): Remove bfd_fill_link_order code. + Call default_data_link_order. + (default_fill_link_order): Delete. + (default_data_link_order): New function. + * elf32-mips.c (_bfd_mips_elf_final_link): Replace occurrences + of bfd_fill_link_order with bfd_data_link_order. + * elf64-alpha.c (elf64_alpha_final_link): Likewise. + * elf64-mips.c (mips_elf64_final_link): Likewise. + + * bfd.c (bfd_scan_vma): Clamp overflows to max bfd_vma value. + Correct value returned in "end" for "0x". + +2002-02-14 Nick Clifton + + * cpu-arm.c (processors): Replace 'arch' field with 'mach'. + (scan): Test against 'mach' field in info structure. + +2002-02-14 Alan Modra + + * elf.c (elf_fake_sections): Use SHT_NOBITS when SEC_NEVER_LOAD. + +2002-02-14 Matt Fredette + + * elf32-m68k.c (elf32_m68k_print_private_bfd_data): Recognize + EF_M68000. + +2002-02-13 Nick Clifton + + * elf.c (_bfd_elf_make_section_from_shdr): Do not insist on + non-zero physical addresses when adjusting the LMAs of new + sections. + +2002-02-12 John David Anglin + + * elf-hppa.h (elf_hppa_reloc_final_type): New function stripped + from _bfd_elf_hppa_gen_reloc_type. + (_bfd_elf_hppa_gen_reloc_type): Remove duplicate prototype. + * elf32-hppa.h (elf32_hppa_reloc_final_type): Add protptype. + * elf32-hppa.c: Include elf32-hppa.h before elf-hppa.h. + * elf64-hppa.h (elf64_hppa_reloc_final_type): Add protptype. + +2002-02-12 Alexandre Oliva + + * elf-m10300.c (mn10300_elf_relax_section): Skip section before + loading its contents if there's nothing to do in it. + +2002-02-12 Alan Modra + + * elf64-ppc.c (ppc64_elf_size_stubs): Correct test for crossing + 64k boundary. + + * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Add dynamic + DT_PPC64_OPD and DT_PPC64_OPDSZ tags. + (ppc64_elf_finish_dynamic_sections): Set values for them. + +2002-02-11 Michael Snyder + + * elf-bfd.h (elfcore_write_lwpstatus): Add prototype. + * elf.c (elfcore_grok_pstatus): Add prototype. + (elfcore_grok_lwpstatus): Add prototype. + (elfcore_write_lwpstatus): New function. + (elfcore_write_pstatus): Fix typo, eliminate unnecessary memcpy. + +2002-02-11 Alexandre Oliva + + * elf32-sh.c: Added missing prototypes. + * elf32-sh64.c: Likewise. + (sh_elf_align_loads): Mark unused args as such. + * elf64-sh64.c: Added missing prototypes. + (struct elf_sh64_link_hash_entry): Fix typo. + (sh_elf64_relocate_section): Fix info argument passed to + _bfd_elf_section_offset. + +2002-02-11 Alan Modra + + * Makefile.am: "make dep-am". + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * configure: Regenerate. + +2002-02-10 Daniel Jacobowitz + + * coff-rs6000.c (xcoff_generate_rtinit): Silence uninitialized + variable warnings. + * elf32-sh.c (sh_elf_relax_section): Silence signed/unsigned + comparison warning. + * trad-core.c (trad_unix_core_file_p): Silence pointer/integer + cast warnings for the common case. + +2002-02-10 Hans-Peter Nilsson + + * config.bfd (sh-*-linux*, sh-*-elf* | sh-*-rtemself*): Add sh64 + vectors. + (sh-*-netbsdelf*): New, to trump sh*-*-netbsdelf* and add sh64 + vectors. + +2002-02-09 Richard Henderson + + * elf64-alpha.c (elf64_alpha_howto): Add R_ALPHA_BRSGP. + (elf64_alpha_reloc_map, elf64_alpha_check_relocs): Likewise. + (elf64_alpha_relocate_section): Likewise. + * reloc.c (BFD_RELOC_ALPHA_BRSGP): New. + * bfd-in2.h, libbfd.h: Rebuild. + +2002-02-09 Hans-Peter Nilsson + + * elf64-mmix.c (_bfd_mmix_finalize_linker_allocated_gregs): Check + that base-plus-offset reloc accounting is consistent. + (mmix_elf_relax_section): Keep base-plus-offset reloc accounting + up to date for undefined symbols. + +2002-02-08 Eric Christopher + + From Rainer Orth + + * elf32-mips.c (_bfd_mips_elf_fake_sections): Don't create .rela + sections for the O32 ABI. + +2002-02-08 Chris Demetriou + + * elf32-arm.h: Fix formatting of _("..."). + * elf32-d10v.c: Likewise. + * elf32-m68k.c: Likewise. + * elf32-mips.c: Likewise. + +2002-02-08 Ivan Guzvinec + + * coff-or32.c: Fix compile time warning messages. + +2002-02-08 Alexandre Oliva + + Contribute sh64-elf. + 2002-01-23 Alexandre Oliva + * reloc.c (R_SH_GOTPLT32, R_SH_GOT_LOW16, R_SH_GOT_MEDLOW16, + R_SH_GOT_MEDHI16, R_SH_GOT_HI16, R_SH_GOTPLT_LOW16, + R_SH_GOTPLT_MEDLOW16, R_SH_GOTPLT_MEDHI16, R_SH_GOTPLT_HI16, + R_SH_PLT_LOW16, R_SH_PLT_MEDLOW16, R_SH_PLT_MEDHI16, + R_SH_PLT_HI16, R_SH_GOTOFF_LOW16, R_SH_GOTOFF_MEDLOW16, + R_SH_GOTOFF_MEDHI16, R_SH_GOTOFF_HI16, R_SH_GOTPC_LOW16, + R_SH_GOTPC_MEDLOW16, R_SH_GOTPC_MEDHI16, R_SH_GOTPC_HI16, + R_SH_GOT10BY4, R_SH_GOTPLT10BY4, R_SH_GOT10BY8, R_SH_GOTPLT10BY8, + R_SH_COPY64, R_SH_GLOB_DAT64, R_SH_JMP_SLOT64, R_SH_RELATIVE64): + New relocs. + * libbfd.h, bfd-in2.h: Rebuilt. + * elf32-sh.c (sh_elf_howto_table): Define new relocs. + (sh_reloc_map): Map them. + (PLT_ENTRY_SIZE, 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, elf_sh_plt0_entry, elf_sh_plt_entry, + elf_sh_pic_plt_entry, elf_sh_sizeof_plt, elf_sh_plt_plt0_offset, + elf_sh_plt0_gotplt_offset, elf_sh_plt_temp_offset, + elf_sh_plt_symbol_offset, elf_sh_plt_reloc_offset, + movi_shori_putval) [INCLUDE_SHMEDIA]: New. + (elf_sh_link_hash_entry) [INCLUDE_SHMEDIA]: Add + datalabel_got_offset. + (sh_elf_link_hash_newfunc): Initialize it. + (sh_elf_relocate_section): Augment the scope of + seen_stt_datalabel. Introduce GOTPLT support. Extend GOTPC, PLT, + GOT and GOTOFF handling to new SHmedia relocation types. Support + GOT_BIAS. + (sh_elf_check_relocs): Likewise. + (sh_elf_finish_dynamic_symbol) [TARGET_SHMEDIA]: Set up values in + PLT entries using movi_shori_putval. Support GOT_BIAS. + (sh_elf_finish_dynamic_sections): Likewise. + * elf32-sh64.c (shmedia_prepare_reloc): Do not add addend to + relocation, it's now done by the caller. + (GOT_BIAS): New. + * elf64-sh64.c (GOT_BIAS, PLT_ENTRY_SIZE, elf_sh64_sizeof_plt, + elf_sh64_plt_plt0_offset, elf_sh64_plt0_gotplt_offset, + elf_sh64_plt_temp_offset, elf_sh64_plt_symbol_offset, + elf_sh64_plt_reloc_offset, ELF_DYNAMIC_INTERPRETER, + elf_sh64_pcrel_relocs_copied, elf_sh64_link_hash_entry, + elf_sh64_link_hash_table, sh64_elf64_link_hash_traverse, + sh64_elf64_hash_table): New. + (sh_elf64_howto_table): Introduce new relocs. + (sh_elf64_info_to_howto): Accept new PIC relocs. + (sh_elf64_relocate_section): Augment the scope of + seen_stt_datalabel. Support new PIC relocs. + (sh_elf64_check_relocs): Support new PIC relocs. + (elf_sh64_plt0_entry_be, elf_sh64_plt0_entry_le, + elf_sh64_plt_entry_be, elf_sh64_plt_entry_le, + elf_sh64_pic_plt_entry_be, elf_sh64_pic_plt_entry_le, + elf_sh64_plt0_entry, elf_sh64_plt_entry, elf_sh64_pic_plt_entry, + sh64_elf64_link_hash_newfunc, sh64_elf64_link_hash_table_create, + movi_shori_putval, movi_3shori_putval, + sh64_elf64_create_dynamic_sections, + sh64_elf64_adjust_dynamic_symbol, sh64_elf64_discard_copies, + sh64_elf64_size_dynamic_sections, + sh64_elf64_finish_dynamic_symbol, + sh64_elf64_finish_dynamic_sections): New. + (elf_backend_create_dynamic-sections, + bfd_elf64_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. + 2001-05-16 Alexandre Oliva + * elf32-sh.c: Renumbered and renamed some SH5 relocations to + match official numbers and names; moved unmaching ones to the + range 0xf2-0xff. + * elf32-sh64.c, elf64-sh64.c: Likewise. + 2001-03-12 DJ Delorie + * elf32-sh.c (sh_elf_relax_section): Don't relax SHmedia + sections. + 2001-03-12 DJ Delorie + * elf32-sh64.c (shmedia_prepare_reloc): Validate relocs that must + be aligned. + * elf64-sh64.c (sh_elf64_relocate_section): Ditto. + 2001-01-14 Hans-Peter Nilsson + * elf32-sh64.c (bfd_elf32_bfd_copy_private_section_data): Define. + (sh64_elf_fake_sections): Set type to SHT_SH5_CR_SORTED for a + .cranges section with SEC_SORT_ENTRIES set. + (sh64_backend_section_from_shdr): Set SEC_SORT_ENTRIES on an + incoming sorted .cranges section. + (sh64_bfd_elf_copy_private_section_data): New. + (sh64_elf_final_write_processing): Only sort .cranges and modify + start address if called by linker. + 2001-01-08 Ben Elliston + * elf32-sh64.c (sh64_elf_final_write_processing): Activate + Hans-Peter Nilsson's set bit 0 patch from 2001-01-06. + * elf64-sh64.c (sh64_elf64_final_write_processing): Ditto. + 2001-01-06 Hans-Peter Nilsson + * elf64-sh64.c (sh_elf64_howto_table): No open brace at start of + line. Add comments before all entries. + : Correct and clarify describing + comment. + (sh_elf64_reloc): Correct head comment. + (sh_elf64_relocate_section): Correct spacing. + : Do not honour STO_SH5_ISA32; + instead call reloc_dangerous callback. + : New case. + (sh_elf64_gc_mark_hook): Correct spacing. + (sh_elf64_check_relocs): Ditto. + * elf32-sh64.c (shmedia_prepare_reloc) : + New case. + * elf32-sh.c: Correct #endif comments for #ifndef-wrapped + functions. + (sh_elf_howto_table) : Correct, + clarify describing comment. Add comments before all entries. + (sh_elf_relocate_section) : Do not + honour STO_SH5_ISA32; instead call reloc_dangerous callback. + 2001-01-06 Hans-Peter Nilsson + Sort .cranges section in final link. Prepare to set bit 0 on + entry address. + * elf32-sh64.c (struct sh64_find_section_vma_data): New. + (sh64_elf_link_output_symbol_hook): Fix typo in prototype. + (sh64_elf_set_mach_from_flags): Set SEC_DEBUGGING on incoming + .cranges section. + (sh64_backend_section_from_shdr): New, to recognize + SHT_SH5_CR_SORTED on incoming .cranges section. + (elf_backend_section_from_shdr): Define. + (sh64_elf_final_write_processing): Sort outgoing .cranges + section. (New, temporarily disabled:) Set bit 0 on entry address + according to ISA type. + (sh64_find_section_for_address): New. + (crange_qsort_cmpb, crange_qsort_cmpl, crange_bsearch_cmpb, + crange_bsearch_cmpl): Move here from opcodes/sh64-dis.c. + (sh64_address_in_cranges): Move here from opcodes/sh64-dis.c. Use + bfd_malloc, not xmalloc. + (sh64_get_contents_type): Move here from opcodes/sh64-dis.c. Make + global. + * elf32-sh64.c (sh64_elf64_final_write_processing): New, (but + temporarily disabled) setting bit 0 on entry address. + (elf_backend_final_write_processing): Define. + 2001-01-05 Hans-Peter Nilsson + * elf32-sh.c (sh_elf_howto_table) : Adjust fields to + be a proper relocation for PTA and PTB rather than a marker. + : + Zero src_mask. + * elf64-sh64.c: Ditto. + (sh_elf64_relocate_section) : New case. + * elf32-sh64.c: Include opcodes/sh64-opc.h + (shmedia_prepare_reloc): Take a bfd_link_info pointer as first + argument. Drop const qualifiers from "bfd *" and "bfd_byte *" + parameters. No unused parameters. Caller changed. + : New case. + * Makefile.am (elf32-sh64.lo): Add dependency on sh64-opc.h. + * Makefile.in: Regenerate. + 2000-12-30 Hans-Peter Nilsson + * elf64-sh64.c (sh64_elf64_fake_sections): Set SHF_SH5_ISA32 for + all code sections. + (sh_elf64_set_mach_from_flags): Change from EF_SH64 to EF_SH5. + (sh64_elf_merge_private_data): Ditto. + * elf32-sh64.c (sh64_elf_fake_sections): Use sh64_elf_section_data + to access stored section flags. + (sh64_elf_final_write_processing): Return immediately unless + called by linker. Use sh64_elf_section_data (cranges) to get size + of linker-generated cranges entries. + (sh64_elf_copy_private_data): Add missing "return true". + (sh64_elf_set_mach_from_flags): Change from EF_SH64 to EF_SH5. + (sh_elf64_merge_private_data): Ditto. + 2000-12-19 Hans-Peter Nilsson + * elf64-sh64.c (sh64_elf64_fake_sections): New, copy of + elf64-sh64.c:sh64_elf_fake_sections. + (elf_backend_fake_sections): Define as sh64_elf64_fake_sections. + 2000-12-18 Hans-Peter Nilsson + * elf32-sh64.c (sh64_elf_copy_private_data_internal): Delete. + (sh64_elf_final_write_processing): New. + (elf_backend_final_write_processing): Define. + (sh64_elf_fake_sections): Get header flags from tdata field. + (sh64_elf_copy_private_data): Do not call + sh64_elf_copy_private_data_internal, just copy e_flags field. + (sh64_elf_merge_private_data): Do not call + sh64_elf_copy_private_data_internal. + 2000-12-12 Hans-Peter Nilsson + Remove EF_SH64_ABI64, let ELF size make difference. + Remove SH64-specific BFD section flag. + * elf32-sh64.c (sh64_elf_fake_sections): Recognize section as + containing SHmedia through elf_section_data (asect)->tdata + non-zero, not using a BFD section flag. + (sh64_elf_set_mach_from_flags): Don't recognize EF_SH64_ABI64. + (sh64_elf_merge_private_data): Similar. + (elf_backend_section_flags): Don't define. + (sh64_elf_backend_section_flags): Delete. + * elf64-sh64.c (sh_elf64_set_mach_from_flags): Recognize EF_SH64, + not EF_SH64_ABI64. + (sh_elf64_merge_private_data): Similar. + * section.c (Section flags definitions): Don't define + SEC_SH_ISA_SHMEDIA. + (bfd-in2.h): Regenerate. + 2000-12-09 Hans-Peter Nilsson + Make DataLabel references work with partial linking. + * elf32-sh64.c: Fix formatting. + (sh64_elf_link_output_symbol_hook): New. + (elf_backend_link_output_symbol_hook): Define to + sh64_elf_link_output_symbol_hook. + (sh64_elf_add_symbol_hook): Make DataLabel symbol just global + undefined if partial linking. Adjust sanity check. + * elf64-sh64.c (sh64_elf64_link_output_symbol_hook): New. + (elf_backend_link_output_symbol_hook): Define to + sh64_elf64_link_output_symbol_hook. + (sh64_elf64_add_symbol_hook): Make DataLabel symbol just global + undefined if partial linking. Adjust sanity check. + 2000-12-07 Hans-Peter Nilsson + Implement semantics for inter-file DataLabel references. + * elf64-sh64.c (DATALABEL_SUFFIX): Define. + (sh64_elf64_add_symbol_hook): New. + (sh_elf64_relocate_section): If passing an indirect symbol with + st_type STT_DATALABEL on the way to a symbol with st_other + STO_SH5_ISA32, do not bitor 1 to the relocation. + (elf_backend_add_symbol_hook): Define to + sh64_elf64_add_symbol_hook. + * elf64-sh32.c: Tweak comments. + (DATALABEL_SUFFIX): Define. + (sh64_elf_add_symbol_hook): New. + (elf_backend_add_symbol_hook): Define to sh64_elf_add_symbol_hook. + * elf32-sh.c (sh_elf_relocate_section): If passing an indirect + symbol with st_type STT_DATALABEL on the way to a symbol with + st_other STO_SH5_ISA32, do not bitor 1 to the relocation. + 2000-12-05 Hans-Peter Nilsson + Pass through STT_DATALABEL. + * elf32-sh64.c (sh64_elf_get_symbol_type): New. + (elf_backend_get_symbol_type): Define. + * elf64-sh64.c (sh64_elf64_get_symbol_type): New. + (elf_backend_get_symbol_type): Define. + 2000-11-30 Hans-Peter Nilsson + * elf32-sh64.c: Tweak comments. + (sh64_elf_copy_private_data_internal): Add prototype. + (bfd_elf32_bfd_set_private_flags): Define. + (sh64_elf_copy_private_data_internal): Compare machine name, not + textual BFD target name, to check whether to copy section flag + SHF_SH5_ISA32. + (sh64_elf_merge_private_data): Validize bfd_get_arch_size. + Tweak section-contents-type-mismatch message. + (shmedia_prepare_reloc): Add ATTRIBUTE_UNUSED markers. + Validize reloc-types. + * elf64-sh64.c: New file. + * targets.c (bfd_elf64_sh64_vec, bfd_elf64_sh64l_vec): Declare. + * Makefile.am (BFD64_BACKENDS): Add elf64-sh64.lo. + (BFD64_BACKENDS_CFILES): Add elf64-sh64.c. + Regenerate dependencies. + * Makefile.in: Regenerate. + * config.bfd (sh64-*-elf*): Add bfd_elf64_sh64_vec and + bfd_elf64_sh64l_vec. + * configure.in: Handle bfd_elf64_sh64_vec and + bfd_elf64_sh64l_vec. + * configure: Regenerate. + * po/POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + 2000-11-29 Hans-Peter Nilsson + * elf32-sh64.c (sh64_elf_set_mach_from_flags): Do not recognize + anything else but EF_SH64 and EF_SH64_ABI64. + (sh64_elf_merge_private_data): Emit error for anything else but + EF_SH64 and EF_SH64_ABI64. + * config.bfd: Remove bfd_elf32_shblin_vec and bfd_elf32_shlin_vec + from targ_selvecs. + * configure.in: Add cofflink.lo to bfd_elf32_sh64_vec and + bfd_elf32_sh64l_vec as a temporary measure. + * configure: Regenerate. + 2000-11-27 Hans-Peter Nilsson + * cpu-sh.c (arch_info_struct): Include sh5 item + unconditionalized. + * config.bfd (sh64-*-elf*): Do not set targ_cflags. + Add targ_selvecs bfd_elf32_sh_vec, bfd_elf32_shl_vec, + bfd_elf32_shblin_vec and bfd_elf32_shlin_vec. + * elf32-sh64.c: Tweak comments. + (sh64_elf_set_mach_from_flags): Recognize all machine flags that + are proper subsets of SH64 as bfd_mach_sh5. Add EF_SH64_ABI64. + (sh64_elf_copy_private_data_internal): Wrap long line. + (sh64_elf_merge_private_data): Rewrite to allow objects from + SH64 subsets to be linked together. + (INCLUDE_SHMEDIA): Define. + * elf32-sh.c (sh_elf_relocate_section) : + Parenthesize plus-expression inside or-expression. + : Ditto. + (sh_elf_set_mach_from_flags): Remove code refusing + deleted EF_SH64_32BIT_ABI flag. + 2000-11-26 Hans-Peter Nilsson + * elf32-sh.c (sh_elf_howto_table) : Set pcrel_offset to true. + (sh_elf_relocate_section) : Or 1 in + calculation of relocation if sym->st_other & STO_SH5_ISA32. + : Ditto if h->other & STO_SH5_ISA32. + * elf32-sh64.c (shmedia_prepare_reloc): Add rel->r_addend to + relocation. + 2000-11-24 Hans-Peter Nilsson + * Makefile.am (BFD32_BACKENDS): Add elf32-sh64.lo. + (BFD32_BACKENDS_CFILES): Add elf32-sh64.c. + Regenerate dependencies. + * Makefile.in: Regenerate. + * archures.c: Add bfd_mach_sh5. + * config.bfd: Map targ_cpu sh* to bfd_sh_arch. + Handle sh64-*-elf*. Set targ_cflags to -DINCLUDE_SHMEDIA. + * configure.in: Handle bfd_elf32_sh64_vec and bfd_elf32_sh64l_vec. + * configure: Regenerate. + * reloc.c (BFD_RELOC_SH_SHMEDIA_CODE, BFD_RELOC_SH_IMMU5, + BFD_RELOC_SH_IMMS6, BFD_RELOC_SH_IMMS6BY32, BFD_RELOC_SH_IMMU6, + BFD_RELOC_SH_IMMS10, BFD_RELOC_SH_IMMS10BY2, + BFD_RELOC_SH_IMMS10BY4, BFD_RELOC_SH_IMMS10BY8, + BFD_RELOC_SH_IMMS16, BFD_RELOC_SH_IMMU16, BFD_RELOC_SH_IMM_LOW16, + BFD_RELOC_SH_IMM_LOW16_PCREL, BFD_RELOC_SH_IMM_MEDLOW16, + BFD_RELOC_SH_IMM_MEDLOW16_PCREL, BFD_RELOC_SH_IMM_MEDHI16, + BFD_RELOC_SH_IMM_MEDHI16_PCREL, BFD_RELOC_SH_IMM_HI16, + BFD_RELOC_SH_IMM_HI16_PCREL, BFD_RELOC_SH_PT_16): New relocations. + * cpu-sh.c [INCLUDE_SHMEDIA] (arch_info_struct): Define and link + in item for SH5. + * elf32-sh.c [INCLUDE_SHMEDIA] (sh_elf_howto_table): Add howto items + for SHmedia relocs. + [INCLUDE_SHMEDIA] (sh_rel): Add mappings for SHmedia relocs. + [INCLUDE_SHMEDIA] (sh_elf_relocate_section) [default]: Call + shmedia_prepare_reloc, goto final_link_relocate if it returns + non-zero, else fail as before. + (sh_elf_set_mach_from_flags): Provide function only if not defined + as macro. Do not recognize objects with EF_SH64_32BIT_ABI set. + (sh_elf_set_private_flags): Provide function only if not defined + as a macro. + (sh_elf_copy_private_data): Similar. + (sh_elf_merge_private_data): Similar. + * section.c (SEC_SH_ISA_SHMEDIA): New. + * targets.c (bfd_elf32_sh64_vec, bfd_elf32_sh64l_vec): Declare. + * elf32-sh64.c: New file. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * po/POTFILES.in: Regenerate. + * po/bfd.pot: Regenerate. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +2002-02-07 Daniel Jacobowitz + + * bfd-in.h: Update check to only see if has + been included, not drag it in. + * bfd-in2.h: Regenerate. + +2002-02-06 H.J. Lu (hjl@gnu.org) + + * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Update + the mach and ISA fields if necessary. + +2002-02-06 Nick Clifton + + * coffcode.h (coff_set_arch_mach_hook): Select the highest known + ARM architecture when an F_ARM_5 flag is detected, since we cannot + be sure exactly which architecture this represents. + +2002-02-05 Nick Clifton + + * po/tr.po: Updated translation. + +2002-02-05 Alan Modra + + From Jimi X + * archures (bfd_mach_ppc64): Define. + (bfd_powerpc_arch): Rename to bfd_powerpc_archs. + (bfd_powerpc_arch): Define. + * bfd-in2.h: Regenerate. + * cpu-powerpc.c (arch_info_struct): Rename to bfd_powerpc_archs. + (bfd_powerpc_arch): Move to tail of bfd_powerpc_archs. + (bfd_powerpc_archs): Add default powerpc64 arch. + +2002-02-05 Alan Modra + + * elf64-ppc.c (ppc64_elf_size_dynamic_sections): Check for relocs + against section syms in readonly sections. Don't do the global + sym check if we find one. + * elf64-s390.c (elf_s390_size_dynamic_sections): Likewise. + * elf32-hppa.c (elf32_hppa_size_dynamic_sections): Likewise. + * elf32-i386.c (elf_i386_size_dynamic_sections): Likewise. + * elf32-s390.c (elf_s390_size_dynamic_sections): Likewise. + (elf_s390_grok_prstatus): Add missing prototype. + +2002-02-04 Hans-Peter Nilsson + + * elf64-mmix.c (mmix_dump_bpo_gregs): New function. + (mmix_elf_check_common_relocs) : + Call bfd_get_section_by_name only once. Initialize + bpodata->n_bpo_relocs_this_section. + (_bfd_mmix_prepare_linker_allocated_gregs): Remove comment + referring to DSOs. + (bpo_reloc_request_sort_fn): Don't use difference of values as + return-value. + +2002-02-02 David O'Brien + + * configure.in: Tweak the FreeBSD 4.x recognition more. Only treat + version 4.5 and later the same as 5-CURRENT. + * configure: Re-generate. + +2002-02-02 Jason Thorpe + + * config.bfd (hppa*-*-netbsd*): New target. + +2002-01-31 Philipp Thomas + + * coff-arm.c (coff_arm_merge_private_bfd_data): Move ERROR + to front of message. Unify messages with elf32-arm.h. Use + commas where neccessary. + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Use all upcase + ERROR in messages. Unify messages with coff-arm.c. Correct + VFP/FPA error message. + (elf32_arm_print_private_bfd_data): Don't mark APCS-26 and + APCS-32 for translation. + +2002-02-01 Hans-Peter Nilsson + + Perform on-demand global register allocation from + R_MMIX_BASE_PLUS_OFFSET relocs. + * elf64-mmix.c (struct bpo_reloc_section_info, struct + bpo_reloc_request, struct bpo_greg_section_info): New. + (mmix_elf_check_common_relocs, mmix_elf_gc_sweep_hook, + bpo_reloc_request_sort_fn, mmix_elf_relax_section, + _bfd_mmix_check_all_relocs, + _bfd_mmix_prepare_linker_allocated_gregs, + _bfd_mmix_finalize_linker_allocated_gregs): New functions. + (elf_mmix_howto_table): Correct src_mask for most relocs. + (mmix_elf_perform_relocation) : New + case. + (mmix_final_link_relocate) : New + case. Fix typo in comment. New label do_mmix_reloc. + (mmix_elf_check_relocs): Abuse bfd_link_info member base_file to + store first object file with a base-plus-offset reloc. Call + mmix_elf_check_common_relocs for the part common with mmo. + (mmix_elf_final_link): Write out linker-allocated register + contents section. + (elf_backend_gc_sweep_hook): Define. + (bfd_elf64_bfd_relax_section): Define. + + * mmo.c: Don't include + (mmo_init): Correct init-once logic. + +2002-02-01 Tom Rix + + * config.bfd: Conditionally support for pre AIX 4.3. + +2002-02-01 Alan Modra + + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + +2002-01-31 David O'Brien + + * configure.in: Recognize the differences in core files from FreeBSD + 4.{0,1} and later versions of 4.x. This treats 4.2+ the same as + 5-CURRENT. + * configure: Regenerate. + +2002-01-31 Ivan Guzvinec + + * coff-or32.c: New file. + * cpu-or32.c: New file. + * elf32-or32.c: New file. + * archures.c: Add support for or32. + * targets.c: Add support for or32. + * bfd-in2.h: Regenerate. + * coffcode.h (coff_set_arch_mach_hook, coff_set_flags, + coff_write_object_contents): Add support for or32. + * config.bfd: Add target. + * configure.in: Add support for or32. + * configure: Regenerate. + * Makefile.am: Add support for or32. + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Add or32 files. + * po/bfd.pot: Regenerate. + +2002-01-31 Nick Clifton + Don Lindsay + + * elf32-mips.c (mips_elf_calculate_relocation): Replace 'return + false' with a return of a bfd_reloc_ error code. + +2002-01-31 Hans-Peter Nilsson + + * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't + unexport unreferenced symbols when --export-dynamic. Call + _bfd_elf_strtab_delref when unexporting. + +2002-01-30 Daniel Jacobowitz + + * bfd-in.h: Include if it is available. + * bfd-in2.h: Regenerated. + +2002-01-31 Alan Modra + + * elf64-ppc.c (func_desc_adjust): STV_PROTECTED functions should + not go via the plt. + +2002-01-30 Nick Clifton + + * archures.c: Tidy up formatting of embedded comments. + * bfd.c: Tidy up formatting of embedded comments. + * bfd-in.h: Fix formatting of comments. + * reloc.c: Tidy up formatting of ordinary & embedded comments. + * section.c: Tidy up formatting of embedded comments. + * syms.c: Tidy up formatting of embedded comments. + * targets.c: Tidy up formatting of embedded comments. + + * bfd-in2.h: Regenerate. + +2002-01-30 Nick Clifton + + * vms-tir.c (cmd_name): New function. + (tir_cmd_name): New function. + (etir_sta, etir_sto, etir_opr, etir_stc): Use cmd_name(). + (tir_opr, tir_ctl, tir_cmd): use tir_cmd_name(). + Fix formatting. + + * peXXigen.c (pe_print_idata): Rearrange message to aid in + translation. + (pe_print_pdata): Rearrange message to aid in translation. + + * libbfd.c (warn_deprecated): Rearrange error message to aid in + translation. + + * ihex.c (ihex_write_object_contents): Fix spelling typo. + + * ieee.c (ieee_slurp_external_symbols): Remove spurious space. + + * elf64-sparc.c (sparc64_elf_add_symbol_hook): Rearrange error + message to aid in translation. + + * elf64-mmix.c (mmix_final_link_relocate): Rearrange error message + to aid in translation. + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Fix typo. + +2002-01-30 Philipp Thomas + + * coff-arm.c, elf32-elf.h: Unify messages. + +2002-01-30 Nick Clifton + + * po/sv.po: Updated translation. + +2002-01-30 Philipp Thomas + + * dwarf2.c (read_abbrev): Use full section name in error message. + (decode_line_info): Likewise. + + * elf.c (_bfd_elf_symbol_from_bfd_symbol): Don't translate debugging + message. + +2002-01-30 Alan Modra + + * elf64-ppc.c (func_desc_adjust): Only provide missing function + descriptor symbols for undefined function code syms. Clear + ELF_LINK_NON_ELF so that they can stay weak. + +2002-01-29 Chris Demetriou + Mitch Lichtenberg + + * bfd-in.h (bfd_mips_elf32_create_embedded_relocs): New prototype. + * elf32-mips.c (bfd_mips_elf32_create_embedded_relocs): New function + to handle 32-bit ELF embedded reloc (ld --embedded-relocs) + generation. + * bfd-in2.h: Regenerate. + +2002-01-29 Chris Demetriou + + * elf32-mips.c: Add additional comments about HI16 relocation + processing. + (_bfd_mips_elf_hi16_reloc): Don't subtract address here for + pc-relative relocations. (Reverts change made on 2001-10-31.) + (_bfd_mips_elf_lo16_reloc): Subtract address of LO16 part here + for pc-relative relocations. + (mips_elf_calculate_relocation): Add a comment about a kludge + in the R_MIPS_GNU_REL_HI16 handling. + (_bfd_mips_elf_relocate_section): Implement that kludge; + adjust pc-relative HI16 relocation for difference in HI16 and + LO16 addresses, since it can't easily be done in + mips_elf_calculate_relocation. + +2002-01-29 Martin Schwidefsky + + * elf32-i386 (elf_i386_adjust_dynamic_symbol): Do not replace PLT32 + relocations with PC32 relocations for undefined or weak symbols. + * elf32-s390 (elf_i386_adjust_dynamic_symbol): Likewise. + * elf64-s390x (elf_i386_adjust_dynamic_symbol): Likewise. + +2002-01-28 Jason Thorpe + + * elfcore.h (elf_core_file_p): Improve comment for last change. + +2002-01-27 Daniel Jacobowitz + + * configure: Regenerated. + +2002-01-27 Jason Thorpe + + * elfcore.h (elf_core_file_p): Set the machine architecture + before processing the program headers. + +2002-01-26 Hans-Peter Nilsson + + * configure.in <64-bit configuration>: If using gcc, check and + emit error for egcs-1.1.2. + * configure: Regenerate. + +2002-01-26 Egor Duda + + * elf.c (elfcore_grok_win32pstatus): Copy only as much information + as possible to avoid stack corruption. + +2002-01-26 Richard Henderson + + * elf64-alpha.c (elf64_alpha_check_relocs): Don't set reltext + for non-allocated sections. + +2002-01-25 Mark Kettenis + + * elf.c (elfcore_write_prstatus): Make sure we pass the address of + prstat.pr_reg even if it is a struct. + +2002-01-25 Steve Ellcey + + * elfxx-ia64.c: Reset AIX vector function overrides for HP-UX. + +2002-01-25 Philipp Thomas + + * coffgen.c (coff_print_symbol): Don't mark info message + for translation. + +2002-01-25 Nick Clifton + + * po/fr.po: Updated translation. + * po/es.po: Updated translation. + +2002-01-25 Philipp Thomas + + * coff-alpha.c (alpha_relocate_section): Unify warning message + for GP relative relocations without GP defined. + * coff-mips.c (mips_relocate_section): Likewise. + +2002-01-25 Alan Modra + + * elf-eh-frame.c (_bfd_elf_eh_frame_section_offset): Avoid + unsigned overflow when new_offset < old_offset. + +2002-01-24 Philipp Thomas + + * bfd.c (_bfd_abort): Fix typo. + +2002-01-23 Richard Henderson + + * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't suppress + plt entries for undefweak symbols. + +2002-01-23 Steve Ellcey + + * targets.c (bfd_elf32_ia64_hpux_big_vec): Add to DEFAULT_VECTOR. + (bfd_elf64_ia64_hpux_big_vec): Ditto. + (bfd_elf32_h8300_vec): Ditto. + +2002-01-23 Alan Modra + + * elf64-ppc.c: Remove stale part of ABI comment. + (NO_OPD_RELOCS): Define. + (ppc64_elf_check_relocs): Use it. + (ppc64_elf_relocate_section): Here too. + (build_one_stub): Don't point function syms at the stub. Instead, + hijack plt.offset. + (ppc64_elf_relocate_section): Check whether REL24 relocs should + really go to the stub. Make all dynamic relocs in opd against + locals. + (ppc64_elf_finish_dynamic_symbol): Allow for non-standard use of + plt.offset. + +2002-01-22 Richard Henderson + + * elf64-alpha.c (INSN_UNOP): Encode with RB as $sp. + +2002-01-22 Alan Modra + + * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Correct sign of + TOC_BASE_OFF adjustment. + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/SRC-POTFILES.in: Regenerate. + +2002-01-22 John David Anglin + + * configure.host (hppa*64*-*-hpux*, hppa*64*-*-linux*): Add new + host defines. + +2002-01-21 Hans-Peter Nilsson + + * elf32-cris.c (cris_elf_relocate_section) : + Check for and emit error if sgot is NULL at this point. + +2002-01-21 Jason Thorpe + + * config.bfd (ia64*-*-netbsd*): New target. + +2002-01-21 Thomas Klausner + + * som.c (som_write_space_strings): Comment typo fix. + +2002-01-21 Alan Modra + + * elf64-ppc.c (struct ppc_link_hash_entry): Add is_func and + is_func_descriptor fields. + (link_hash_newfunc): Init them. + (ppc64_elf_check_relocs): Only R_PPC24_REL24 syms starting with a + dot are candidates for plt entries. When processing .opd relocs, + set function descriptor strings to point inside function code + string, and set new ppc_link_hash_entry fields. + (ppc64_elf_gc_sweep_hook): Don't sweep R_PPC64_REL24 relocs. + (ppc64_elf_adjust_dynamic_symbol): Remove most code dealing with + function descriptors. It's now done in.. + (func_desc_adjust): New. + (ppc64_elf_func_desc_adjust): New. + (define elf_backend_always_size_sections): Define. + (ppc64_elf_hide_symbol): New. + (define elf_backend_hide_symbol): Define. + (allocate_dynrelocs): Remove code looking up function descriptors + as that has been done earlier. + (ppc64_elf_size_dynamic_sections): Use htab shortcut to elf hash + table. + (ppc64_elf_finish_dynamic_symbol): Likewise. Remove code looking + up function descriptor. + (build_one_stub): Look up the function code sym. Check for + invalid plt offsets. + (ppc64_elf_relocate_section): Tweak calls to undefined weak syms. + Convert R_PPC64_TOC relocs to R_PPC64_RELATIVE in shared libs. + + * elf-bfd.h (elf_backend_data ): Add + boolean param. + (_bfd_elf_link_hash_hide_symbol): Likewise. + * elflink.h (elf_link_add_object_symbols): Adjust call to + elf_backend_hide_symbol. + (elf_fix_symbol_flags): Likewise. + (elf_link_assign_sym_version): Likewise. Use bfd_malloc rather + than bfd_alloc. + * elf.c (_bfd_elf_link_hash_hide_symbol): Add "force_local" param. + Set ELF_LINK_FORCED_LOCAL and call _bfd_elf_strtab_delref. + * elf32-hppa.c (elf32_hppa_hide_symbol): Likewise. + (clobber_millicode_symbols): Adjust to suit new hide_symbol. + * elf32-cris.c (elf_cris_hide_symbol): Add "force_local" param + and adjust to suit. + * elf32-mips.c (_bfd_mips_elf_hide_symbol): Likewise, and call + _bfd_elf_link_hash_hide_symbol rather than duplicating code. + * elfxx-ia64.c (elfNN_ia64_hash_hide_symbol): Likewise. + +2002-01-18 Alan Modra + + * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Test for a + dynamic function descriptor symbol, not the associated function + symbol. + +2002-01-17 Eric Christopher + + * elf32-mips.c (mips_elf_calculate_relocation): Fix typo. + +2002-01-17 Nick Clifton + + * po/bfd.pot: Regenerate. + * po/fr.po: Regenerate. + +2002-01-17 Alan Modra + + * elf-bfd.h (elf_backend_data ): + Remove "Elf_Internal_Shdr *" param. + (_bfd_mips_elf_section_from_bfd_section): Ditto. + * elf32-mips.c (_bfd_mips_elf_section_from_bfd_section): Ditto. + * elf32-m32r.c (_bfd_m32r_elf_section_from_bfd_section): Ditto. + * elf32-v850.c (v850_elf_section_from_bfd_section): Ditto. + * elf64-mmix.c (mmix_elf_section_from_bfd_section): Ditto. + * elfxx-ia64.c (elfNN_hpux_backend_section_from_bfd_section): Ditto. + * elf.c (_bfd_elf_section_from_bfd_section): Allow backend + function to override special sections. Remove hdr arg from + backend call, and don't loop. + +2002-01-16 Eric Christopher + + * elf32-mips.c (mips_elf_calculate_relocation): Set require_jalxp + on R_MIPS_26 and target is 16bit. Add R_MIPS16_GPREL to list of + relocations requiring gp0 and gp. + +2002-01-16 Richard Earnshaw + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Handle + EF_ARM_VFP_FLOAT. + (elf32_arm_print_private_bfd_data): Likewise. + +2002-01-16 Nick Clifton + + * po/tr.po: Import new version. + +2002-01-16 Alan Modra + + * elf64-ppc.c (ppc64_elf_howto_raw): Remove stale FIXMEs. + (ppc64_elf_reloc_type_lookup): Use proper CTOR reloc. + (ORI_R0_R0_0): Correct. + +2002-01-16 Alan Modra + + * elflink.c (_bfd_elf_create_dynamic_sections): Don't set SEC_CODE + when plt_not_loaded. + * elf64-ppc.c (ppc64_elf_create_dynamic_sections): No need to + clear .plt SEC_CODE here. Create .stub and correct .glink flags. + (PLT_INITIAL_ENTRY_SIZE): Set to 24. + (ppc64_elf_glink_code): Delete. + (PPC64_ELF_GLINK_SIZE): Delete. + (ADDIS_R12_R2, STD_R2_40R1, LD_R11_0R12, LD_R2_0R12, MTCTR_R11, + BCTR, ADDIS_R12_R12_1, LD_R2_40R1, NOP, LI_R0_0, B_DOT, LIS_R0_0, + ORI_R0_R0_0): Define. + (PLT_CALL_STUB_SIZE, GLINK_CALL_STUB_SIZE): Define. + (struct ppc_link_hash_table): Add sstub and plt_overflow. + (ppc64_elf_link_hash_table_create): Init them. + (ppc64_elf_check_relocs ): Refcount .plt entry. + Don't copy to shared lib. + (ppc64_elf_check_relocs): Call bfd_set_error on errors. + (ppc64_elf_gc_sweep_hook ): Sweep plt refcount. + (allocate_dynrelocs ): Don't change function sym here. Make + room for .stub and .glink code. + (ppc64_elf_size_dynamic_sections): Handle .stub. Make entry for + DT_PPC64_GLINK. + (ppc64_elf_final_link): Rename to ppc64_elf_set_toc. Don't call + bfd_elf64_bfd_final_link. + (bfd_elf64_bfd_final_link): Don't define. + (ppc64_elf_size_stubs): New. + (build_plt_stub): New. + (build_one_stub): New. + (ppc64_elf_build_stubs): New. + (ppc64_elf_relocate_section ): Remove assert. + (ppc64_elf_relocate_section): Don't copy R_PPC64_REL24 relocs. + (ppc64_elf_finish_dynamic_symbol): Don't build stubs here. Set + DT_PPC64_GLINK entry. Tweak DT_PLTGOT, DT_JMPREL, DT_PLTRELSZ in + case output sections not separate. Adjust DT_RELASZ to not + include plt relocs. Set reserved got entry. Set got and plt + entry size. + (elf_backend_got_header_size): Set to 8. + * elf64-ppc.h: New file. + +2002-01-16 Alan Modra + + * elf32-arm.h (elf32_arm_size_dynamic_sections): When removing + sections, use bfd_section_list_remove. + * elf32-i370.c (i370_elf_size_dynamic_sections): Likewise. + * elflink.h (elf_link_add_object_symbols): When removing all + sections, use bfd_section_list_clear. + +2002-01-15 Nick Clifton + + * po/sv.po: New file: Swedish translation. + * configure.in (ALL_LINGUAS): Add sv. + * configure: Regenerate. + +2002-01-15 Jakub Jelinek + + * elflink.h (elf_link_input_bfd): Back out 2002-01-07 change. + * elf.c (merge_sections_remove_hook): New function. + (_bfd_elf_merge_sections): Pass it as 3rd argument to + _bfd_merge_sections. + * libbfd-in.h (_bfd_merge_sections): Add 3rd argument. + * libbfd.h: Rebuilt. + * merge.c (_bfd_merge_sections): Add remove_hook argument. + Call remove_hook if a SEC_EXCLUDE section is encountered. + +2002-01-15 Nick Clifton + + * elf32-xstormy16.c (xstormy16_reloc_map): Add new field 'table'. + (xstormy16_reloc_map): Initialise new field with correct howto + table. + (xstormy16_reloc_type_lookup): Use 'table' field to locate correct + howto entry. + +2002-01-10 Michael Snyder + + * elf.c (elfcore_write_prstatus): Use long instead of pid_t; + (elfcore_write_pstatus): Use long instead of pid_t; + * elf-bfd.h: Change prototypes to use long instead of pid_t; + +2002-01-09 Jason Thorpe + + * elf.c: Update copyright years. + (elfcore_grok_netbsd_note): Use NT_NETBSDCORE_PROCINFO + and NT_NETBSDCORE_FIRSTMACH. Improve a comment. + +2002-01-08 Michael Snyder + + Add capability to write corefile note sections, for gdb. + * elf.c (elfcore_write_note): New function. + (elfcore_write_prpsinfo): New function. + (elfcore_write_prstatus): New function. + (elfcore_write_pstatus): New function. + (elfcore_write_prfpreg): New function. + (elfcore_write_prxfpreg): New function. + * elf-bfd.h: Add prototypes for above functions. + +2002-01-08 Alexandre Oliva + + * elf.c (elf_fake_sections): Propagate errors from + elf_backend_fake_section. + +2002-01-07 Jason Thorpe + + * Makefile.am (BFD32_BACKENDS): Add elf32-sh-nbsd.lo. + (BFD32_BACKENDS_CFILES): Add elf32-sh-nbsd.c. + (elf32-sh-nbsd.lo): New rule. + * Makefile.in: Regenerate. + * config.bfd (sh*le-*-netbsdelf*): New target. + (sh*-*-netbsdelf*): New target. + * configure.in: Include netbsd-core.lo for native sh*-*-netbsd*. + (bfd_elf32_shnbsd_vec): New vector. + (bfd_elf32_shlnbsd_vec): New vector. + * configure: Regenerate. + * elf32-sh-nbsd.c: New file. + * targets.c: Update copyright years. + (_bfd_target_vector): Add bfd_elf32_shlnbsd_vec and + bfd_elf32_shnbsd_vec. + +2002-01-07 Aldy Hernandez + + * coff-rs6000.c (READ20): Use bfd_scan_vma. + +2002-01-07 Geoffrey Keating + + * elflink.h (elf_link_input_bfd): Don't ask for the merged offset + of a symbol in a section that will be deleted. + +2002-01-07 Nick Clifton + + * po/es.po: New file: Spanish translation. + * configure.in (ALL_LINGUAS): Add es. + * configure: Regenerate. + +2002-01-06 Steve Ellcey + + * elfxx-ia64.c (is_unwind_section_name): Add target vector as + argument so we can handle HP-UX specially. + (elfNN_ia64_hpux_vec): New for use in is_unwind_section_name. + (elfNN_hpux_backend_section_from_bfd_section): New for support + of SHN_IA_64_ANSI_COMMON. + (elfNN_ia64_relax_section): Add support for SHN_IA_64_ANSI_COMMON. + (is_unwind_section_name): Add special HP-UX support. + (elfNN_ia64_section_from_shdr): Add support for more sections. + (elfNN_ia64_fake_sections): Modify is_unwind_section_name call and + add support for more sections. + (elfNN_ia64_additional_program_headers): Modify + is_unwind_section_name call. + (elfNN_ia64_modify_segment_map): Remove assumption that there is + only one unwind section in segment. + +2002-01-06 Alan Modra + + * syms.c (_bfd_generic_make_empty_symbol): New function. + * libbfd-in.h (_bfd_nosymbols_make_empty_symbol): Define as + _bfd_generic_make_empty_symbol. + * libbfd.h: Regenerate. + * bfd-in2.h: Regenerate. + * hppabsd-core.c (hppabsd_core_make_empty_symbol): Delete function. + (hppabsd_core_get_symtab_upper_bound): Don't define. + (hppabsd_core_get_symtab): Likewise. + (hppabsd_core_print_symbol): Likewise. + (hppabsd_core_get_symbol_info): Likewise. + (hppabsd_core_bfd_is_local_label_name): Likewise. + (hppabsd_core_get_lineno): Likewise. + (hppabsd_core_find_nearest_line): Likewise. + (hppabsd_core_bfd_make_debug_symbol): Likewise. + (hppabsd_core_read_minisymbols): Likewise. + (hppabsd_core_minisymbol_to_symbol): Likewise. + (hppabsd_core_vec): Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols). + Formatting fixes. + * hpux-core.c: Similarly. + * irix-core.c: Similarly. + * osf-core.c: Similarly. + * sco5-core.c: Similarly. + * binary.c (binary_make_empty_symbol): Remove function, define as + _bfd_generic_make_empty_symbol. + * ihex.c (ihex_make_empty_symbol): Likewise. + * mmo.c (mmo_make_empty_symbol): Likewise. + * ppcboot.c (ppcboot_make_empty_symbol): Likewise. + * srec.c (srec_make_empty_symbol): Likewise. + * versados.c (versados_make_empty_symbol): Likewise. + * vms.c (_bfd_vms_make_empty_symbol): Remove. + (vms_make_empty_symbol): Define as _bfd_generic_make_empty_symbol. + * vms-gsd.c (_bfd_vms_slurp_gsd): Call bfd_make_empty_symbol + rather than _bfd_vms_make_empty_symbol. + * vms-misc.c (new_symbol): Likewise. + +2002-01-05 Alan Modra + + * section.c (bfd_section_init): Remove unnecessary initialisations. + (bfd_section_list_clear): New function. + (bfd_section_list_remove, bfd_section_list_insert): New macros. + (_bfd_strip_section_from_output): Use them. + * coffcode.h (coff_set_alignment_hook): Likewise. + * elf32-mips.c (_bfd_mips_elf_final_link): Likewise. + * elf64-mips.c (mips_elf64_final_link): Likewise. + * elf64-mmix.c (mmix_elf_final_link): Likewise. + * sunos.c (sunos_add_dynamic_symbols): Likewise. + * xcofflink.c (_bfd_xcoff_bfd_final_link): Likewise. + * bfd-in2.h: Regenerate. + + * netbsd-core.c (netbsd_core_file_p): Use bfd_make_section_anyway + rather than doing our own section handling. Clean up after errors + with bfd_release and bfd_section_list_clear. Handle unexpected + flags. + * aoutf1.h (sunos4_core_file_p): Likewise. + * aix386-core.c (aix386_core_file_p): Likewise. + * cisco-core.c (cisco_core_file_validate): Likewise. + * ptrace-core.c (ptrace_unix_core_file_p): Likewise. + * trad-core.c (trad_unix_core_file_p): Likewise. + + * hppabsd-core.c (hppabsd_core_core_file_p): Clean up after errors + with bfd_release and bfd_section_list_clear. + * hpux-core.c (hpux_core_core_file_p): Likewise. + * irix-core.c (irix_core_core_file_p): Likewise. + * lynx-core.c (lynx_core_file_p): Likewise. + * osf-core.c (osf_core_core_file_p): Likewise. + * rs6000-core.c (rs6000coff_core_p): Likewise. + * sco5-core.c (sco5_core_file_p): Likewise. + + * elf32-mips.c (_bfd_mips_elf_lo16_reloc): Simplify, and perform + sign extension adjustments without conditionals. + +2002-01-04 Jakub Jelinek + + * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Don't crash if + CIE at .eh_frame start is removed due to no FDEs referencing it. + +2002-01-04 Jason Thorpe + + * config.bfd (x86_64-*-netbsd*): New target. + * configure.in (x86_64-*-netbsd*): Set COREFILE + to netbsd-core.lo. + * configure: Regenerated. + +2002-01-03 Tom Rix + + * xcofflink.c (_bfd_xcoff_bfd_final_link): Update .pad section ordering + for recent bfd_make_section_anyway change. + +2002-01-03 Nick Clifton + + * elf32-arm.h (elf32_arm_final_link_relocate): Handle + R_ARM_THM_PC11 reloc. + +2002-01-02 Nick Clifton + + * configure.in (LINGUAS): Add ja. + * configure: Regenerate. + * po/ja.po: Import from translation project's web site. + +2002-01-02 Nick Clifton + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Reformat error + messages to ease translation into other languages. + +For older changes see ChangeLog-0001 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/binutils/bfd/Makefile.am b/contrib/binutils/bfd/Makefile.am index 1213897..de811af 100644 --- a/contrib/binutils/bfd/Makefile.am +++ b/contrib/binutils/bfd/Makefile.am @@ -28,20 +28,22 @@ BFD_H = bfd.h # need two copies of the executable, one to download and one for the # debugger). BFD32_LIBS = \ - archive.lo archures.lo bfd.lo cache.lo coffgen.lo corefile.lo \ + archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \ + cache.lo coffgen.lo corefile.lo \ format.lo init.lo libbfd.lo opncls.lo reloc.lo \ section.lo syms.lo targets.lo hash.lo linker.lo \ srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo \ - merge.lo dwarf2.lo + merge.lo dwarf2.lo simple.lo BFD64_LIBS = archive64.lo BFD32_LIBS_CFILES = \ - archive.c archures.c bfd.c cache.c coffgen.c corefile.c \ + archive.c archures.c bfd.c bfdio.c bfdwin.c \ + cache.c coffgen.c corefile.c \ format.c init.c libbfd.c opncls.c reloc.c \ section.c syms.c targets.c hash.c linker.c \ srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \ - merge.c dwarf2.c + merge.c dwarf2.c simple.c BFD64_LIBS_CFILES = archive64.c @@ -67,6 +69,8 @@ ALL_MACHINES = \ cpu-i386.lo \ cpu-i860.lo \ cpu-i960.lo \ + cpu-ip2k.lo \ + cpu-iq2000.lo \ cpu-m32r.lo \ cpu-m68hc11.lo \ cpu-m68hc12.lo \ @@ -77,6 +81,7 @@ ALL_MACHINES = \ cpu-mcore.lo \ cpu-mips.lo \ cpu-mmix.lo \ + cpu-msp430.lo \ cpu-or32.lo \ cpu-ns32k.lo \ cpu-openrisc.lo \ @@ -88,6 +93,7 @@ ALL_MACHINES = \ cpu-sh.lo \ cpu-sparc.lo \ cpu-tic30.lo \ + cpu-tic4x.lo \ cpu-tic54x.lo \ cpu-tic80.lo \ cpu-v850.lo \ @@ -95,6 +101,7 @@ ALL_MACHINES = \ cpu-we32k.lo \ cpu-w65.lo \ cpu-xstormy16.lo \ + cpu-xtensa.lo \ cpu-z8k.lo ALL_MACHINES_CFILES = \ @@ -117,6 +124,8 @@ ALL_MACHINES_CFILES = \ cpu-i386.c \ cpu-i860.c \ cpu-i960.c \ + cpu-ip2k.c \ + cpu-iq2000.c \ cpu-m32r.c \ cpu-m68hc11.c \ cpu-m68hc12.c \ @@ -127,6 +136,7 @@ ALL_MACHINES_CFILES = \ cpu-mcore.c \ cpu-mips.c \ cpu-mmix.c \ + cpu-msp430.c \ cpu-or32.c \ cpu-ns32k.c \ cpu-openrisc.c \ @@ -138,6 +148,7 @@ ALL_MACHINES_CFILES = \ cpu-sh.c \ cpu-sparc.c \ cpu-tic30.c \ + cpu-tic4x.c \ cpu-tic54x.c \ cpu-tic80.c \ cpu-v850.c \ @@ -145,6 +156,7 @@ ALL_MACHINES_CFILES = \ cpu-we32k.c \ cpu-w65.c \ cpu-xstormy16.c \ + cpu-xtensa.c \ cpu-z8k.c # The .o files needed by all of the 32 bit vectors that are configured into @@ -183,6 +195,7 @@ BFD32_BACKENDS = \ coff-stgo32.lo \ coff-svm68k.lo \ coff-tic30.lo \ + coff-tic4x.lo \ coff-tic54x.lo \ coff-tic80.lo \ coff-u68k.lo \ @@ -195,6 +208,7 @@ BFD32_BACKENDS = \ ecofflink.lo \ efi-app-ia32.lo \ elf.lo \ + elf32-am33lin.lo \ elf32-arc.lo \ elfarm-oabi.lo \ elfarm-nabi.lo \ @@ -210,13 +224,15 @@ BFD32_BACKENDS = \ elf32-hppa.lo \ elf32-i370.lo \ elf32-i386.lo \ - elf32-i386-fbsd.lo \ elf32-i860.lo \ elf32-i960.lo \ elf32-ia64.lo \ + elf32-ip2k.lo \ + elf32-iq2000.lo \ elf32-m32r.lo \ elf32-m68hc11.lo \ elf32-m68hc12.lo \ + elf32-m68hc1x.lo \ elf32-m68k.lo \ elf32-m88k.lo \ elf-m10200.lo \ @@ -224,21 +240,20 @@ BFD32_BACKENDS = \ elf32-mcore.lo \ elfxx-mips.lo \ elf32-mips.lo \ + elf32-msp430.lo \ elf32-openrisc.lo \ elf32-or32.lo \ elf32-pj.lo \ elf32-ppc.lo \ elf32-s390.lo \ elf32-sh.lo \ - elf32-sh-lin.lo \ elf32-sh64.lo \ elf32-sh64-com.lo \ - elf32-sh-nbsd.lo \ - elf32-sh64-nbsd.lo \ elf32-sparc.lo \ elf32-v850.lo \ elf32-vax.lo \ elf32-xstormy16.lo \ + elf32-xtensa.lo \ elf32.lo \ elflink.lo \ elf-strtab.lo \ @@ -264,6 +279,7 @@ BFD32_BACKENDS = \ m68klynx.lo \ m68knetbsd.lo \ m88kmach3.lo \ + mach-o.lo \ mipsbsd.lo \ newsos3.lo \ nlm.lo \ @@ -275,6 +291,7 @@ BFD32_BACKENDS = \ oasys.lo \ pc532-mach.lo \ pdp11.lo \ + pef.lo \ pe-arm.lo \ pei-arm.lo \ pe-i386.lo \ @@ -304,7 +321,10 @@ BFD32_BACKENDS = \ vms-hdr.lo \ vms-misc.lo \ vms-tir.lo \ - xcofflink.lo + xcofflink.lo \ + xsym.lo \ + xtensa-isa.lo \ + xtensa-modules.lo BFD32_BACKENDS_CFILES = \ aout-adobe.c \ @@ -340,6 +360,7 @@ BFD32_BACKENDS_CFILES = \ coff-stgo32.c \ coff-svm68k.c \ coff-tic30.c \ + coff-tic4x.c \ coff-tic54x.c \ coff-tic80.c \ coff-u68k.c \ @@ -352,6 +373,7 @@ BFD32_BACKENDS_CFILES = \ ecofflink.c \ efi-app-ia32.c \ elf.c \ + elf32-am33lin.c \ elf32-arc.c \ elfarm-oabi.c \ elfarm-nabi.c \ @@ -367,19 +389,22 @@ BFD32_BACKENDS_CFILES = \ elf32-hppa.c \ elf32-i370.c \ elf32-i386.c \ - elf32-i386-fbsd.c \ elf32-i860.c \ elf32-i960.c \ + elf32-ip2k.c \ + elf32-iq2000.c \ elf32-m32r.c \ elf32-m68k.c \ elf32-m68hc11.c \ elf32-m68hc12.c \ + elf32-m68hc1x.c \ elf32-m88k.c \ elf-m10200.c \ elf-m10300.c \ elf32-mcore.c \ elfxx-mips.c \ elf32-mips.c \ + elf32-msp430.c \ elf32-openrisc.c \ elf32-or32.c \ elf32-pj.c \ @@ -388,13 +413,11 @@ BFD32_BACKENDS_CFILES = \ elf32-sh64-com.c \ elf32-s390.c \ elf32-sh.c \ - elf32-sh-lin.c \ - elf32-sh-nbsd.c \ - elf32-sh64-nbsd.c \ elf32-sparc.c \ elf32-v850.c \ elf32-vax.c \ elf32-xstormy16.c \ + elf32-xtensa.c \ elf32.c \ elflink.c \ elf-strtab.c \ @@ -420,6 +443,7 @@ BFD32_BACKENDS_CFILES = \ m68klynx.c \ m68knetbsd.c \ m88kmach3.c \ + mach-o.c \ mipsbsd.c \ newsos3.c \ nlm.c \ @@ -431,6 +455,7 @@ BFD32_BACKENDS_CFILES = \ oasys.c \ pc532-mach.c \ pdp11.c \ + pef.c \ pe-arm.c \ pei-arm.c \ pe-i386.c \ @@ -459,7 +484,10 @@ BFD32_BACKENDS_CFILES = \ vms-hdr.c \ vms-misc.c \ vms-tir.c \ - xcofflink.c + xcofflink.c \ + xsym.c \ + xtensa-isa.c \ + xtensa-modules.c # The .o files needed by all of the 64 bit vectors that are configured into # target_vector in targets.c if configured with --enable-targets=all @@ -473,14 +501,13 @@ BFD64_BACKENDS = \ efi-app-ia64.lo \ elf64-x86-64.lo \ elf64-alpha.lo \ - elf64-alpha-fbsd.lo \ elf64-hppa.lo \ elf64-ia64.lo \ elf64-gen.lo \ + elfn32-mips.lo \ elf64-mips.lo \ elf64-mmix.lo \ elf64-sh64.lo \ - elf64-sh64-nbsd.lo \ elf64-ppc.lo \ elf64-s390.lo \ elf64-sparc.lo \ @@ -499,15 +526,14 @@ BFD64_BACKENDS_CFILES = \ efi-app-ia64.c \ elf64-x86-64.c \ elf64-alpha.c \ - elf64-alpha-fbsd.c \ elf64-hppa.c \ elf64-gen.c \ + elfn32-mips.c \ elf64-mips.c \ elf64-mmix.c \ elf64-ppc.c \ elf64-s390.c \ elf64-sh64.c \ - elf64-sh64-nbsd.c \ elf64-sparc.c \ elf64.c \ mmo.c \ @@ -561,16 +587,18 @@ CFILES = $(SOURCE_CFILES) $(BUILD_CFILES) ## This is a list of all .h files which are in the source tree. SOURCE_HFILES = \ aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \ - elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf64-hppa.h \ - elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h \ - libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \ - libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \ - nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h libxcoff.h \ - xcoff-target.h version.h + elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h \ + elf64-hppa.h elfcode.h elfcore.h \ + freebsd.h genlink.h go32stub.h \ + libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h \ + libnlm.h liboasys.h libpei.h libxcoff.h mach-o.h \ + netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h \ + pef.h pef-traceback.h peicode.h som.h version.h \ + vms.h xcoff-target.h xsym.h ## ... and all .h files which are in the build tree. BUILD_HFILES = \ - elf32-target.h elf64-target.h targmatch.h + bfdver.h elf32-target.h elf64-target.h targmatch.h HFILES = $(SOURCE_HFILES) $(BUILD_HFILES) @@ -578,23 +606,15 @@ SRC_POTFILES = $(SOURCE_CFILES) $(SOURCE_HFILES) BLD_POTFILES = $(BUILD_CFILES) $(BUILD_HFILES) po/SRC-POTFILES.in: @MAINT@ Makefile $(SRC_POTFILES) - for file in $(SRC_POTFILES); do echo $$file; done | sort > tmp.src \ + for file in $(SRC_POTFILES); do echo $$file; done \ + | LC_COLLATE= sort > tmp.src \ && mv tmp.src $(srcdir)/po/SRC-POTFILES.in po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES) - for file in $(BLD_POTFILES); do echo $$file; done | sort > tmp.bld \ + for file in $(BLD_POTFILES); do echo $$file; done \ + | LC_COLLATE= sort > tmp.bld \ && mv tmp.bld $(srcdir)/po/BLD-POTFILES.in -# The following target is retained for upgrade purposes. -# This target used to exist in older versions of this makefile, and was -# referenced by /po/Makefile (which is created from /po/Make-in) -# So old versions of /po/Makefile will try to regenerate themselves -# when make is next run, but that dependency cannot be completed without a build -# of po/POTFILES.in. Hence the presence of this rule. This rule will be deleted -# once it is no longer needed - probably in the fall of 2001. -po/POTFILES.in: - - diststuff: info # Various kinds of .o files to put in libbfd.a: @@ -653,10 +673,10 @@ targmatch.h: config.bfd targmatch.sed # When compiling archures.c and targets.c, supply the default target # info from configure. -targets.lo: targets.c config.status +targets.lo: targets.c Makefile $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/targets.c -archures.lo: archures.c config.status +archures.lo: archures.c Makefile $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c elf32-target.h : elfxx-target.h @@ -788,9 +808,11 @@ stmp-bfd-h: bfd-in3.h touch stmp-bfd-h BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \ - reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c version.h + reloc.c syms.c bfd.c bfdio.c bfdwin.c \ + archive.c corefile.c targets.c format.c BFD64_H_FILES = archive64.c -LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c cache.c reloc.c archures.c elf.c +LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c bfdio.c bfdwin.c \ + cache.c reloc.c archures.c elf.c LIBCOFF_H_FILES = libcoff-in.h coffcode.h # Could really use a "copy-if-change"... @@ -834,8 +856,9 @@ CLEANFILES = bfd.h dep.sed stmp-bfd-h DEP DEPA DEP1 DEP2 libbfd.a stamp-lib \ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) -# We want to rerun configure if config.bfd or configure.host change. -config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host +# We want to rerun configure if config.bfd, configure.host or version.h change. +config.status: $(srcdir)/configure $(srcdir)/config.bfd \ + $(srcdir)/configure.host $(srcdir)/version.h $(SHELL) ./config.status --recheck # What appears below is generated by a hacked mkdep using gcc -MM. @@ -845,11 +868,13 @@ config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ $(INCDIR)/aout/ranlib.h $(INCDIR)/safe-ctype.h archures.lo: archures.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h -bfd.lo: bfd.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ +bfd.lo: bfd.c bfdver.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/sym.h libcoff.h libecoff.h $(INCDIR)/coff/ecoff.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h +bfdio.lo: bfdio.c $(INCDIR)/filenames.h +bfdwin.lo: bfdwin.c $(INCDIR)/filenames.h cache.lo: cache.c $(INCDIR)/filenames.h coffgen.lo: coffgen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ libcoff.h $(INCDIR)/bfdlink.h @@ -857,7 +882,8 @@ corefile.lo: corefile.c $(INCDIR)/filenames.h format.lo: format.c $(INCDIR)/filenames.h init.lo: init.c $(INCDIR)/filenames.h libbfd.lo: libbfd.c $(INCDIR)/filenames.h -opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h +opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h \ + $(INCDIR)/libiberty.h reloc.lo: reloc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h section.lo: section.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ @@ -882,11 +908,12 @@ merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h +simple.lo: simple.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h archive64.lo: archive64.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h cpu-arc.lo: cpu-arc.c $(INCDIR)/filenames.h -cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h +cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h cpu-d10v.lo: cpu-d10v.c $(INCDIR)/filenames.h @@ -903,6 +930,8 @@ cpu-i370.lo: cpu-i370.c $(INCDIR)/filenames.h cpu-i386.lo: cpu-i386.c $(INCDIR)/filenames.h cpu-i860.lo: cpu-i860.c $(INCDIR)/filenames.h cpu-i960.lo: cpu-i960.c $(INCDIR)/filenames.h +cpu-ip2k.lo: cpu-ip2k.c $(INCDIR)/filenames.h +cpu-iq2000.lo: cpu-iq2000.c $(INCDIR)/filenames.h cpu-m32r.lo: cpu-m32r.c $(INCDIR)/filenames.h cpu-m68hc11.lo: cpu-m68hc11.c $(INCDIR)/filenames.h cpu-m68hc12.lo: cpu-m68hc12.c $(INCDIR)/filenames.h @@ -913,6 +942,7 @@ cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h +cpu-msp430.lo: cpu-msp430.c $(INCDIR)/filenames.h cpu-or32.lo: cpu-or32.c $(INCDIR)/filenames.h cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h ns32k.h cpu-openrisc.lo: cpu-openrisc.c $(INCDIR)/filenames.h @@ -924,6 +954,7 @@ cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h +cpu-tic4x.lo: cpu-tic4x.c $(INCDIR)/filenames.h cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h cpu-tic80.lo: cpu-tic80.c $(INCDIR)/filenames.h cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h @@ -931,6 +962,7 @@ cpu-vax.lo: cpu-vax.c $(INCDIR)/filenames.h cpu-we32k.lo: cpu-we32k.c $(INCDIR)/filenames.h cpu-w65.lo: cpu-w65.c $(INCDIR)/filenames.h cpu-xstormy16.lo: cpu-xstormy16.c $(INCDIR)/filenames.h +cpu-xtensa.lo: cpu-xtensa.c $(INCDIR)/filenames.h cpu-z8k.lo: cpu-z8k.c $(INCDIR)/filenames.h aout-adobe.lo: aout-adobe.c $(INCDIR)/filenames.h $(INCDIR)/aout/adobe.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \ @@ -993,7 +1025,8 @@ coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ coffswap.h coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/libiberty.h \ + coffcode.h coffswap.h coff-h8500.lo: coff-h8500.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ libcoff.h coffcode.h coffswap.h @@ -1042,6 +1075,9 @@ coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/filenames.h \ coff-tic30.lo: coff-tic30.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ libcoff.h coffcode.h coffswap.h +coff-tic4x.lo: coff-tic4x.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h @@ -1061,7 +1097,7 @@ coff-z8k.lo: coff-z8k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ libcoff.h coffcode.h coffswap.h cofflink.lo: cofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/internal.h libcoff.h + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/safe-ctype.h dwarf1.lo: dwarf1.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf.h @@ -1081,6 +1117,10 @@ efi-app-ia32.lo: efi-app-ia32.c $(INCDIR)/filenames.h \ elf.lo: elf.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/libiberty.h +elf32-am33lin.lo: elf32-am33lin.c elf-m10300.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mn10300.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-arc.lo: elf32-arc.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \ @@ -1120,7 +1160,7 @@ elf32-fr30.lo: elf32-fr30.c $(INCDIR)/filenames.h elf-bfd.h \ elf32-frv.lo: elf32-frv.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h \ - elf32-target.h + $(INCDIR)/hashtab.h elf32-target.h elf32-gen.lo: elf32-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf32-target.h @@ -1134,15 +1174,12 @@ elf32-hppa.lo: elf32-hppa.c $(INCDIR)/filenames.h elf-bfd.h \ libhppa.h elf32-hppa.h elf-hppa.h elf32-target.h elf32-i370.lo: elf32-i370.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/i370.h elf32-target.h + $(INCDIR)/elf/external.h $(INCDIR)/elf/i370.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-i386.lo: elf32-i386.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-i386-fbsd.lo: elf32-i386-fbsd.c elf32-i386.c $(INCDIR)/filenames.h \ - $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h \ @@ -1151,6 +1188,14 @@ elf32-i960.lo: elf32-i960.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h +elf32-ip2k.lo: elf32-ip2k.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32-iq2000.lo: elf32-iq2000.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/iq2000.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m32r.lo: elf32-m32r.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h \ @@ -1160,13 +1205,20 @@ elf32-m68k.lo: elf32-m68k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h elf32-m68hc11.lo: elf32-m68hc11.c $(INCDIR)/filenames.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/m68hc11.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-m68hc1x.h \ + $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/m68hc11.h elf32-target.h elf32-m68hc12.lo: elf32-m68hc12.c $(INCDIR)/filenames.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/m68hc11.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-m68hc1x.h \ + $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/m68hc11.h elf32-target.h +elf32-m68hc1x.lo: elf32-m68hc1x.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-m68hc1x.h \ + $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/m68hc11.h elf32-m88k.lo: elf32-m88k.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf32-target.h @@ -1181,17 +1233,23 @@ elf32-mcore.lo: elf32-mcore.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mcore.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h -elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h elfxx-mips.h $(INCDIR)/elf/mips.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h +elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elfxx-mips.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h \ + $(INCDIR)/coff/external.h $(INCDIR)/hashtab.h elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h elfxx-mips.h $(INCDIR)/elf/mips.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h \ $(INCDIR)/coff/external.h ecoffswap.h elf32-target.h +elf32-msp430.lo: elf32-msp430.c $(INCDIR)/filenames.h \ + $(INCDIR)/libiberty.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/msp430.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-openrisc.lo: elf32-openrisc.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/openrisc.h \ @@ -1208,16 +1266,16 @@ elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ - elf32-target.h + elf32-ppc.h elf32-target.h elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \ - elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + elf32-sh64.h elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h $(srcdir)/../opcodes/sh64-opc.h + $(INCDIR)/elf/reloc-macros.h elf32-sh64.h $(srcdir)/../opcodes/sh64-opc.h elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \ @@ -1226,19 +1284,6 @@ elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-sh-lin.lo: elf32-sh-lin.c $(INCDIR)/filenames.h \ - $(INCDIR)/elf/internal.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-sh.c \ - $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-sh-nbsd.lo: elf32-sh-nbsd.c elf32-sh.c $(INCDIR)/filenames.h \ - $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-sh64-nbsd.lo: elf32-sh64-nbsd.c elf32-sh64.c \ - $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(srcdir)/../opcodes/sh64-opc.h elf32-sh.c $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ @@ -1257,13 +1302,18 @@ elf32-xstormy16.lo: elf32-xstormy16.c $(INCDIR)/filenames.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/xstormy16.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ elf32-target.h +elf32-xtensa.lo: elf32-xtensa.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/xtensa.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h elf32-target.h elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \ - elflink.h + $(INCDIR)/safe-ctype.h elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h + $(INCDIR)/elf/external.h $(INCDIR)/libiberty.h elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h @@ -1333,6 +1383,8 @@ m68knetbsd.lo: m68knetbsd.c netbsd.h $(INCDIR)/filenames.h \ m88kmach3.lo: m88kmach3.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +mach-o.lo: mach-o.c mach-o.h $(INCDIR)/filenames.h \ + $(INCDIR)/libiberty.h mach-o-target.c mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h @@ -1364,6 +1416,8 @@ pc532-mach.lo: pc532-mach.c $(INCDIR)/filenames.h libaout.h \ pdp11.lo: pdp11.c $(INCDIR)/filenames.h libaout.h $(INCDIR)/bfdlink.h \ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h $(INCDIR)/safe-ctype.h +pef.lo: pef.c $(INCDIR)/safe-ctype.h pef.h pef-traceback.h \ + $(INCDIR)/filenames.h $(INCDIR)/libiberty.h pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ @@ -1447,8 +1501,8 @@ vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms.h vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms.h -vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h vms.h +vms-hdr.lo: vms-hdr.c bfdver.h $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h vms.h vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms.h vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ @@ -1456,6 +1510,11 @@ vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h libcoff.h \ libxcoff.h +xsym.lo: xsym.c xsym.h $(INCDIR)/filenames.h +xtensa-isa.lo: xtensa-isa.c $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-isa-internal.h +xtensa-modules.lo: xtensa-modules.c $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-isa-internal.h aix5ppc-core.lo: aix5ppc-core.c aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ @@ -1487,13 +1546,6 @@ elf64-alpha.lo: elf64-alpha.c $(INCDIR)/filenames.h \ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ libecoff.h ecoffswap.h elf64-target.h -elf64-alpha-fbsd.lo: elf64-alpha-fbsd.c elf64-alpha.c $(INCDIR)/filenames.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/alpha.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ - libecoff.h ecoffswap.h elf64-target.h elf64-hppa.lo: elf64-hppa.c $(INCDIR)/alloca-conf.h \ $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ @@ -1502,6 +1554,13 @@ elf64-hppa.lo: elf64-hppa.c $(INCDIR)/alloca-conf.h \ elf64-gen.lo: elf64-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf64-target.h +elfn32-mips.lo: elfn32-mips.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \ + ecoffswap.h elf32-target.h elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \ @@ -1515,7 +1574,7 @@ elf64-mmix.lo: elf64-mmix.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/opcode/mmix.h elf64-target.h elf64-ppc.lo: elf64-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/reloc-macros.h \ elf64-ppc.h elf64-target.h elf64-s390.lo: elf64-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ @@ -1525,10 +1584,6 @@ elf64-sh64.lo: elf64-sh64.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ elf64-target.h -elf64-sh64-nbsd.lo: elf64-sh64-nbsd.c elf64-sh64.c \ - $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf64-target.h elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \ @@ -1537,7 +1592,7 @@ elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \ elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \ - elflink.h + $(INCDIR)/safe-ctype.h mmo.lo: mmo.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ @@ -1561,11 +1616,13 @@ cisco-core.lo: cisco-core.c $(INCDIR)/filenames.h elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h $(INCDIR)/hashtab.h \ + elf32-target.h elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/reloc-macros.h elf64-target.h + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h $(INCDIR)/hashtab.h \ + elf64-target.h peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/pe.h \ libcoff.h $(INCDIR)/bfdlink.h libpei.h diff --git a/contrib/binutils/bfd/Makefile.in b/contrib/binutils/bfd/Makefile.in index dd4ff4f..a6685f2 100644 --- a/contrib/binutils/bfd/Makefile.in +++ b/contrib/binutils/bfd/Makefile.in @@ -1,6 +1,6 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -68,6 +68,7 @@ AS = @AS@ BFD_HOST_64BIT_LONG = @BFD_HOST_64BIT_LONG@ BFD_HOST_64_BIT = @BFD_HOST_64_BIT@ BFD_HOST_64_BIT_DEFINED = @BFD_HOST_64_BIT_DEFINED@ +BFD_HOST_LONG_LONG = @BFD_HOST_LONG_LONG@ BFD_HOST_U_64_BIT = @BFD_HOST_U_64_BIT@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ @@ -115,10 +116,11 @@ WIN32LIBADD = @WIN32LIBADD@ all_backends = @all_backends@ bfd_backends = @bfd_backends@ bfd_default_target_size = @bfd_default_target_size@ +bfd_file_ptr = @bfd_file_ptr@ bfd_libs = @bfd_libs@ bfd_machines = @bfd_machines@ +bfd_ufile_ptr = @bfd_ufile_ptr@ bfd_version = @bfd_version@ -bfd_version_date = @bfd_version_date@ bfd_version_string = @bfd_version_string@ l = @l@ tdefaults = @tdefaults@ @@ -152,21 +154,23 @@ BFD_H = bfd.h # need two copies of the executable, one to download and one for the # debugger). BFD32_LIBS = \ - archive.lo archures.lo bfd.lo cache.lo coffgen.lo corefile.lo \ + archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \ + cache.lo coffgen.lo corefile.lo \ format.lo init.lo libbfd.lo opncls.lo reloc.lo \ section.lo syms.lo targets.lo hash.lo linker.lo \ srec.lo binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo \ - merge.lo dwarf2.lo + merge.lo dwarf2.lo simple.lo BFD64_LIBS = archive64.lo BFD32_LIBS_CFILES = \ - archive.c archures.c bfd.c cache.c coffgen.c corefile.c \ + archive.c archures.c bfd.c bfdio.c bfdwin.c \ + cache.c coffgen.c corefile.c \ format.c init.c libbfd.c opncls.c reloc.c \ section.c syms.c targets.c hash.c linker.c \ srec.c binary.c tekhex.c ihex.c stabs.c stab-syms.c \ - merge.c dwarf2.c + merge.c dwarf2.c simple.c BFD64_LIBS_CFILES = archive64.c @@ -193,6 +197,8 @@ ALL_MACHINES = \ cpu-i386.lo \ cpu-i860.lo \ cpu-i960.lo \ + cpu-ip2k.lo \ + cpu-iq2000.lo \ cpu-m32r.lo \ cpu-m68hc11.lo \ cpu-m68hc12.lo \ @@ -203,6 +209,7 @@ ALL_MACHINES = \ cpu-mcore.lo \ cpu-mips.lo \ cpu-mmix.lo \ + cpu-msp430.lo \ cpu-or32.lo \ cpu-ns32k.lo \ cpu-openrisc.lo \ @@ -214,6 +221,7 @@ ALL_MACHINES = \ cpu-sh.lo \ cpu-sparc.lo \ cpu-tic30.lo \ + cpu-tic4x.lo \ cpu-tic54x.lo \ cpu-tic80.lo \ cpu-v850.lo \ @@ -221,6 +229,7 @@ ALL_MACHINES = \ cpu-we32k.lo \ cpu-w65.lo \ cpu-xstormy16.lo \ + cpu-xtensa.lo \ cpu-z8k.lo @@ -244,6 +253,8 @@ ALL_MACHINES_CFILES = \ cpu-i386.c \ cpu-i860.c \ cpu-i960.c \ + cpu-ip2k.c \ + cpu-iq2000.c \ cpu-m32r.c \ cpu-m68hc11.c \ cpu-m68hc12.c \ @@ -254,6 +265,7 @@ ALL_MACHINES_CFILES = \ cpu-mcore.c \ cpu-mips.c \ cpu-mmix.c \ + cpu-msp430.c \ cpu-or32.c \ cpu-ns32k.c \ cpu-openrisc.c \ @@ -265,6 +277,7 @@ ALL_MACHINES_CFILES = \ cpu-sh.c \ cpu-sparc.c \ cpu-tic30.c \ + cpu-tic4x.c \ cpu-tic54x.c \ cpu-tic80.c \ cpu-v850.c \ @@ -272,6 +285,7 @@ ALL_MACHINES_CFILES = \ cpu-we32k.c \ cpu-w65.c \ cpu-xstormy16.c \ + cpu-xtensa.c \ cpu-z8k.c @@ -311,6 +325,7 @@ BFD32_BACKENDS = \ coff-stgo32.lo \ coff-svm68k.lo \ coff-tic30.lo \ + coff-tic4x.lo \ coff-tic54x.lo \ coff-tic80.lo \ coff-u68k.lo \ @@ -323,6 +338,7 @@ BFD32_BACKENDS = \ ecofflink.lo \ efi-app-ia32.lo \ elf.lo \ + elf32-am33lin.lo \ elf32-arc.lo \ elfarm-oabi.lo \ elfarm-nabi.lo \ @@ -338,13 +354,15 @@ BFD32_BACKENDS = \ elf32-hppa.lo \ elf32-i370.lo \ elf32-i386.lo \ - elf32-i386-fbsd.lo \ elf32-i860.lo \ elf32-i960.lo \ elf32-ia64.lo \ + elf32-ip2k.lo \ + elf32-iq2000.lo \ elf32-m32r.lo \ elf32-m68hc11.lo \ elf32-m68hc12.lo \ + elf32-m68hc1x.lo \ elf32-m68k.lo \ elf32-m88k.lo \ elf-m10200.lo \ @@ -352,21 +370,20 @@ BFD32_BACKENDS = \ elf32-mcore.lo \ elfxx-mips.lo \ elf32-mips.lo \ + elf32-msp430.lo \ elf32-openrisc.lo \ elf32-or32.lo \ elf32-pj.lo \ elf32-ppc.lo \ elf32-s390.lo \ elf32-sh.lo \ - elf32-sh-lin.lo \ elf32-sh64.lo \ elf32-sh64-com.lo \ - elf32-sh-nbsd.lo \ - elf32-sh64-nbsd.lo \ elf32-sparc.lo \ elf32-v850.lo \ elf32-vax.lo \ elf32-xstormy16.lo \ + elf32-xtensa.lo \ elf32.lo \ elflink.lo \ elf-strtab.lo \ @@ -392,6 +409,7 @@ BFD32_BACKENDS = \ m68klynx.lo \ m68knetbsd.lo \ m88kmach3.lo \ + mach-o.lo \ mipsbsd.lo \ newsos3.lo \ nlm.lo \ @@ -403,6 +421,7 @@ BFD32_BACKENDS = \ oasys.lo \ pc532-mach.lo \ pdp11.lo \ + pef.lo \ pe-arm.lo \ pei-arm.lo \ pe-i386.lo \ @@ -432,7 +451,10 @@ BFD32_BACKENDS = \ vms-hdr.lo \ vms-misc.lo \ vms-tir.lo \ - xcofflink.lo + xcofflink.lo \ + xsym.lo \ + xtensa-isa.lo \ + xtensa-modules.lo BFD32_BACKENDS_CFILES = \ @@ -469,6 +491,7 @@ BFD32_BACKENDS_CFILES = \ coff-stgo32.c \ coff-svm68k.c \ coff-tic30.c \ + coff-tic4x.c \ coff-tic54x.c \ coff-tic80.c \ coff-u68k.c \ @@ -481,6 +504,7 @@ BFD32_BACKENDS_CFILES = \ ecofflink.c \ efi-app-ia32.c \ elf.c \ + elf32-am33lin.c \ elf32-arc.c \ elfarm-oabi.c \ elfarm-nabi.c \ @@ -496,19 +520,22 @@ BFD32_BACKENDS_CFILES = \ elf32-hppa.c \ elf32-i370.c \ elf32-i386.c \ - elf32-i386-fbsd.c \ elf32-i860.c \ elf32-i960.c \ + elf32-ip2k.c \ + elf32-iq2000.c \ elf32-m32r.c \ elf32-m68k.c \ elf32-m68hc11.c \ elf32-m68hc12.c \ + elf32-m68hc1x.c \ elf32-m88k.c \ elf-m10200.c \ elf-m10300.c \ elf32-mcore.c \ elfxx-mips.c \ elf32-mips.c \ + elf32-msp430.c \ elf32-openrisc.c \ elf32-or32.c \ elf32-pj.c \ @@ -517,13 +544,11 @@ BFD32_BACKENDS_CFILES = \ elf32-sh64-com.c \ elf32-s390.c \ elf32-sh.c \ - elf32-sh-lin.c \ - elf32-sh-nbsd.c \ - elf32-sh64-nbsd.c \ elf32-sparc.c \ elf32-v850.c \ elf32-vax.c \ elf32-xstormy16.c \ + elf32-xtensa.c \ elf32.c \ elflink.c \ elf-strtab.c \ @@ -549,6 +574,7 @@ BFD32_BACKENDS_CFILES = \ m68klynx.c \ m68knetbsd.c \ m88kmach3.c \ + mach-o.c \ mipsbsd.c \ newsos3.c \ nlm.c \ @@ -560,6 +586,7 @@ BFD32_BACKENDS_CFILES = \ oasys.c \ pc532-mach.c \ pdp11.c \ + pef.c \ pe-arm.c \ pei-arm.c \ pe-i386.c \ @@ -588,7 +615,10 @@ BFD32_BACKENDS_CFILES = \ vms-hdr.c \ vms-misc.c \ vms-tir.c \ - xcofflink.c + xcofflink.c \ + xsym.c \ + xtensa-isa.c \ + xtensa-modules.c # The .o files needed by all of the 64 bit vectors that are configured into @@ -603,14 +633,13 @@ BFD64_BACKENDS = \ efi-app-ia64.lo \ elf64-x86-64.lo \ elf64-alpha.lo \ - elf64-alpha-fbsd.lo \ elf64-hppa.lo \ elf64-ia64.lo \ elf64-gen.lo \ + elfn32-mips.lo \ elf64-mips.lo \ elf64-mmix.lo \ elf64-sh64.lo \ - elf64-sh64-nbsd.lo \ elf64-ppc.lo \ elf64-s390.lo \ elf64-sparc.lo \ @@ -630,15 +659,14 @@ BFD64_BACKENDS_CFILES = \ efi-app-ia64.c \ elf64-x86-64.c \ elf64-alpha.c \ - elf64-alpha-fbsd.c \ elf64-hppa.c \ elf64-gen.c \ + elfn32-mips.c \ elf64-mips.c \ elf64-mmix.c \ elf64-ppc.c \ elf64-s390.c \ elf64-sh64.c \ - elf64-sh64-nbsd.c \ elf64-sparc.c \ elf64.c \ mmo.c \ @@ -696,16 +724,18 @@ CFILES = $(SOURCE_CFILES) $(BUILD_CFILES) SOURCE_HFILES = \ aout-target.h aoutf1.h aoutx.h coffcode.h coffswap.h ecoffswap.h \ - elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h elf64-hppa.h \ - elfcode.h elfcore.h elflink.h freebsd.h genlink.h go32stub.h \ - libaout.h libbfd.h libcoff.h libecoff.h libhppa.h \ - libieee.h libnlm.h liboasys.h libpei.h netbsd.h nlm-target.h \ - nlmcode.h nlmswap.h ns32k.h peicode.h som.h vms.h libxcoff.h \ - xcoff-target.h version.h + elf-bfd.h elf-hppa.h elf32-arm.h elf32-hppa.h \ + elf64-hppa.h elfcode.h elfcore.h \ + freebsd.h genlink.h go32stub.h \ + libaout.h libbfd.h libcoff.h libecoff.h libhppa.h libieee.h \ + libnlm.h liboasys.h libpei.h libxcoff.h mach-o.h \ + netbsd.h nlm-target.h nlmcode.h nlmswap.h ns32k.h \ + pef.h pef-traceback.h peicode.h som.h version.h \ + vms.h xcoff-target.h xsym.h BUILD_HFILES = \ - elf32-target.h elf64-target.h targmatch.h + bfdver.h elf32-target.h elf64-target.h targmatch.h HFILES = $(SOURCE_HFILES) $(BUILD_HFILES) @@ -736,10 +766,13 @@ BFD_H_DEPS = $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h LOCAL_H_DEPS = libbfd.h sysdep.h config.h BFD_H_FILES = bfd-in.h init.c opncls.c libbfd.c section.c archures.c \ - reloc.c syms.c bfd.c archive.c corefile.c targets.c format.c version.h + reloc.c syms.c bfd.c bfdio.c bfdwin.c \ + archive.c corefile.c targets.c format.c BFD64_H_FILES = archive64.c -LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c cache.c reloc.c archures.c elf.c +LIBBFD_H_FILES = libbfd-in.h init.c libbfd.c bfdio.c bfdwin.c \ + cache.c reloc.c archures.c elf.c + LIBCOFF_H_FILES = libcoff-in.h coffcode.h MOSTLYCLEANFILES = ofiles stamp-ofiles @@ -752,7 +785,7 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD_HFILES) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = bfd-in3.h +CONFIG_CLEAN_FILES = bfd-in3.h bfdver.h LIBRARIES = $(noinst_LIBRARIES) @@ -764,10 +797,11 @@ libbfd_a_LIBADD = libbfd_a_OBJECTS = LTLIBRARIES = $(bfdlib_LTLIBRARIES) -libbfd_la_OBJECTS = archive.lo archures.lo bfd.lo cache.lo coffgen.lo \ -corefile.lo format.lo init.lo libbfd.lo opncls.lo reloc.lo section.lo \ -syms.lo targets.lo hash.lo linker.lo srec.lo binary.lo tekhex.lo \ -ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo archive64.lo +libbfd_la_OBJECTS = archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo \ +cache.lo coffgen.lo corefile.lo format.lo init.lo libbfd.lo opncls.lo \ +reloc.lo section.lo syms.lo targets.lo hash.lo linker.lo srec.lo \ +binary.lo tekhex.lo ihex.lo stabs.lo stab-syms.lo merge.lo dwarf2.lo \ +simple.lo archive64.lo CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -775,7 +809,7 @@ CCLD = $(CC) LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = README ./stamp-h.in COPYING ChangeLog Makefile.am \ Makefile.in TODO acinclude.m4 aclocal.m4 bfd-in2.h config.in configure \ -configure.in +configure.in version.h DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) @@ -829,6 +863,8 @@ distclean-hdr: maintainer-clean-hdr: bfd-in3.h: $(top_builddir)/config.status bfd-in2.h cd $(top_builddir) && CONFIG_FILES=$@:bfd-in2.h CONFIG_HEADERS= $(SHELL) ./config.status +bfdver.h: $(top_builddir)/config.status version.h + cd $(top_builddir) && CONFIG_FILES=$@:version.h CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-noinstLIBRARIES: @@ -931,7 +967,7 @@ maintainer-clean-recursive: dot_seen=no; \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev="$$subdir $$rev"; \ - test "$$subdir" = "." && dot_seen=yes; \ + test "$$subdir" != "." || dot_seen=yes; \ done; \ test "$$dot_seen" = "no" && rev=". $$rev"; \ target=`echo $@ | sed s/-recursive//`; \ @@ -1144,22 +1180,15 @@ mostlyclean distclean maintainer-clean po/SRC-POTFILES.in: @MAINT@ Makefile $(SRC_POTFILES) - for file in $(SRC_POTFILES); do echo $$file; done | sort > tmp.src \ + for file in $(SRC_POTFILES); do echo $$file; done \ + | LC_COLLATE= sort > tmp.src \ && mv tmp.src $(srcdir)/po/SRC-POTFILES.in po/BLD-POTFILES.in: @MAINT@ Makefile $(BLD_POTFILES) - for file in $(BLD_POTFILES); do echo $$file; done | sort > tmp.bld \ + for file in $(BLD_POTFILES); do echo $$file; done \ + | LC_COLLATE= sort > tmp.bld \ && mv tmp.bld $(srcdir)/po/BLD-POTFILES.in -# The following target is retained for upgrade purposes. -# This target used to exist in older versions of this makefile, and was -# referenced by /po/Makefile (which is created from /po/Make-in) -# So old versions of /po/Makefile will try to regenerate themselves -# when make is next run, but that dependency cannot be completed without a build -# of po/POTFILES.in. Hence the presence of this rule. This rule will be deleted -# once it is no longer needed - probably in the fall of 2001. -po/POTFILES.in: - diststuff: info stamp-ofiles: Makefile @@ -1199,10 +1228,10 @@ targmatch.h: config.bfd targmatch.sed # When compiling archures.c and targets.c, supply the default target # info from configure. -targets.lo: targets.c config.status +targets.lo: targets.c Makefile $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/targets.c -archures.lo: archures.c config.status +archures.lo: archures.c Makefile $(LIBTOOL) --mode=compile $(COMPILE) -c $(TDEFAULTS) $(srcdir)/archures.c elf32-target.h : elfxx-target.h @@ -1364,8 +1393,9 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) $(SHELL) $(srcdir)/../move-if-change libcoff.h-new $(srcdir)/libcoff.h touch stmp-lcoff-h -# We want to rerun configure if config.bfd or configure.host change. -config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host +# We want to rerun configure if config.bfd, configure.host or version.h change. +config.status: $(srcdir)/configure $(srcdir)/config.bfd \ + $(srcdir)/configure.host $(srcdir)/version.h $(SHELL) ./config.status --recheck # What appears below is generated by a hacked mkdep using gcc -MM. @@ -1375,11 +1405,13 @@ config.status: $(srcdir)/configure $(srcdir)/config.bfd $(srcdir)/configure.host archive.lo: archive.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ $(INCDIR)/aout/ranlib.h $(INCDIR)/safe-ctype.h archures.lo: archures.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h -bfd.lo: bfd.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ +bfd.lo: bfd.c bfdver.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/bfdlink.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/sym.h libcoff.h libecoff.h $(INCDIR)/coff/ecoff.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h +bfdio.lo: bfdio.c $(INCDIR)/filenames.h +bfdwin.lo: bfdwin.c $(INCDIR)/filenames.h cache.lo: cache.c $(INCDIR)/filenames.h coffgen.lo: coffgen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ libcoff.h $(INCDIR)/bfdlink.h @@ -1387,7 +1419,8 @@ corefile.lo: corefile.c $(INCDIR)/filenames.h format.lo: format.c $(INCDIR)/filenames.h init.lo: init.c $(INCDIR)/filenames.h libbfd.lo: libbfd.c $(INCDIR)/filenames.h -opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h +opncls.lo: opncls.c $(INCDIR)/filenames.h $(INCDIR)/objalloc.h \ + $(INCDIR)/libiberty.h reloc.lo: reloc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h section.lo: section.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h syms.lo: syms.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ @@ -1412,11 +1445,12 @@ merge.lo: merge.c $(INCDIR)/filenames.h $(INCDIR)/hashtab.h \ dwarf2.lo: dwarf2.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf2.h +simple.lo: simple.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h archive64.lo: archive64.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h cpu-a29k.lo: cpu-a29k.c $(INCDIR)/filenames.h cpu-alpha.lo: cpu-alpha.c $(INCDIR)/filenames.h cpu-arc.lo: cpu-arc.c $(INCDIR)/filenames.h -cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h +cpu-arm.lo: cpu-arm.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h cpu-avr.lo: cpu-avr.c $(INCDIR)/filenames.h cpu-cris.lo: cpu-cris.c $(INCDIR)/filenames.h cpu-d10v.lo: cpu-d10v.c $(INCDIR)/filenames.h @@ -1433,6 +1467,8 @@ cpu-i370.lo: cpu-i370.c $(INCDIR)/filenames.h cpu-i386.lo: cpu-i386.c $(INCDIR)/filenames.h cpu-i860.lo: cpu-i860.c $(INCDIR)/filenames.h cpu-i960.lo: cpu-i960.c $(INCDIR)/filenames.h +cpu-ip2k.lo: cpu-ip2k.c $(INCDIR)/filenames.h +cpu-iq2000.lo: cpu-iq2000.c $(INCDIR)/filenames.h cpu-m32r.lo: cpu-m32r.c $(INCDIR)/filenames.h cpu-m68hc11.lo: cpu-m68hc11.c $(INCDIR)/filenames.h cpu-m68hc12.lo: cpu-m68hc12.c $(INCDIR)/filenames.h @@ -1443,6 +1479,7 @@ cpu-m10300.lo: cpu-m10300.c $(INCDIR)/filenames.h cpu-mcore.lo: cpu-mcore.c $(INCDIR)/filenames.h cpu-mips.lo: cpu-mips.c $(INCDIR)/filenames.h cpu-mmix.lo: cpu-mmix.c $(INCDIR)/filenames.h +cpu-msp430.lo: cpu-msp430.c $(INCDIR)/filenames.h cpu-or32.lo: cpu-or32.c $(INCDIR)/filenames.h cpu-ns32k.lo: cpu-ns32k.c $(INCDIR)/filenames.h ns32k.h cpu-openrisc.lo: cpu-openrisc.c $(INCDIR)/filenames.h @@ -1454,6 +1491,7 @@ cpu-s390.lo: cpu-s390.c $(INCDIR)/filenames.h cpu-sh.lo: cpu-sh.c $(INCDIR)/filenames.h cpu-sparc.lo: cpu-sparc.c $(INCDIR)/filenames.h cpu-tic30.lo: cpu-tic30.c $(INCDIR)/filenames.h +cpu-tic4x.lo: cpu-tic4x.c $(INCDIR)/filenames.h cpu-tic54x.lo: cpu-tic54x.c $(INCDIR)/filenames.h cpu-tic80.lo: cpu-tic80.c $(INCDIR)/filenames.h cpu-v850.lo: cpu-v850.c $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h @@ -1461,6 +1499,7 @@ cpu-vax.lo: cpu-vax.c $(INCDIR)/filenames.h cpu-we32k.lo: cpu-we32k.c $(INCDIR)/filenames.h cpu-w65.lo: cpu-w65.c $(INCDIR)/filenames.h cpu-xstormy16.lo: cpu-xstormy16.c $(INCDIR)/filenames.h +cpu-xtensa.lo: cpu-xtensa.c $(INCDIR)/filenames.h cpu-z8k.lo: cpu-z8k.c $(INCDIR)/filenames.h aout-adobe.lo: aout-adobe.c $(INCDIR)/filenames.h $(INCDIR)/aout/adobe.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def libaout.h \ @@ -1523,7 +1562,8 @@ coff-aux.lo: coff-aux.c $(INCDIR)/filenames.h $(INCDIR)/coff/aux-coff.h \ coffswap.h coff-h8300.lo: coff-h8300.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ genlink.h $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h \ - $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/libiberty.h \ + coffcode.h coffswap.h coff-h8500.lo: coff-h8500.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ libcoff.h coffcode.h coffswap.h @@ -1572,6 +1612,9 @@ coff-svm68k.lo: coff-svm68k.c coff-m68k.c $(INCDIR)/filenames.h \ coff-tic30.lo: coff-tic30.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/tic30.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ libcoff.h coffcode.h coffswap.h +coff-tic4x.lo: coff-tic4x.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h $(INCDIR)/coff/internal.h \ + libcoff.h coffcode.h coffswap.h coff-tic54x.lo: coff-tic54x.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ $(INCDIR)/coff/internal.h libcoff.h coffcode.h coffswap.h @@ -1591,7 +1634,7 @@ coff-z8k.lo: coff-z8k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ libcoff.h coffcode.h coffswap.h cofflink.lo: cofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/coff/internal.h libcoff.h + $(INCDIR)/coff/internal.h libcoff.h $(INCDIR)/safe-ctype.h dwarf1.lo: dwarf1.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/dwarf.h @@ -1611,6 +1654,10 @@ efi-app-ia32.lo: efi-app-ia32.c $(INCDIR)/filenames.h \ elf.lo: elf.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/libiberty.h +elf32-am33lin.lo: elf32-am33lin.c elf-m10300.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/mn10300.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-arc.lo: elf32-arc.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h \ @@ -1650,7 +1697,7 @@ elf32-fr30.lo: elf32-fr30.c $(INCDIR)/filenames.h elf-bfd.h \ elf32-frv.lo: elf32-frv.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h \ - elf32-target.h + $(INCDIR)/elf/dwarf2.h $(INCDIR)/hashtab.h elf32-target.h elf32-gen.lo: elf32-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf32-target.h @@ -1664,15 +1711,12 @@ elf32-hppa.lo: elf32-hppa.c $(INCDIR)/filenames.h elf-bfd.h \ libhppa.h elf32-hppa.h elf-hppa.h elf32-target.h elf32-i370.lo: elf32-i370.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/i370.h elf32-target.h + $(INCDIR)/elf/external.h $(INCDIR)/elf/i370.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-i386.lo: elf32-i386.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-i386-fbsd.lo: elf32-i386-fbsd.c elf32-i386.c $(INCDIR)/filenames.h \ - $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/i386.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-i860.lo: elf32-i860.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/reloc-macros.h \ @@ -1681,6 +1725,14 @@ elf32-i960.lo: elf32-i960.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/i960.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h +elf32-ip2k.lo: elf32-ip2k.c $(INCDIR)/filenames.h elf-bfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h +elf32-iq2000.lo: elf32-iq2000.c $(INCDIR)/filenames.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/iq2000.h \ + $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-m32r.lo: elf32-m32r.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/reloc-macros.h \ @@ -1690,13 +1742,20 @@ elf32-m68k.lo: elf32-m68k.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h elf32-m68hc11.lo: elf32-m68hc11.c $(INCDIR)/filenames.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/m68hc11.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-m68hc1x.h \ + $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/m68hc11.h elf32-target.h elf32-m68hc12.lo: elf32-m68hc12.c $(INCDIR)/filenames.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/m68hc11.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-m68hc1x.h \ + $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/m68hc11.h elf32-target.h +elf32-m68hc1x.lo: elf32-m68hc1x.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elf32-m68hc1x.h \ + $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/m68hc11.h elf32-m88k.lo: elf32-m88k.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf32-target.h @@ -1711,17 +1770,23 @@ elf32-mcore.lo: elf32-mcore.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/mcore.h \ $(INCDIR)/elf/reloc-macros.h elf32-target.h -elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/bfdlink.h elfxx-mips.h $(INCDIR)/elf/mips.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ - $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h +elfxx-mips.lo: elfxx-mips.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ + elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elfxx-mips.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h \ + $(INCDIR)/coff/external.h $(INCDIR)/hashtab.h elf32-mips.lo: elf32-mips.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ genlink.h elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h elfxx-mips.h $(INCDIR)/elf/mips.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h \ $(INCDIR)/coff/external.h ecoffswap.h elf32-target.h +elf32-msp430.lo: elf32-msp430.c $(INCDIR)/filenames.h \ + $(INCDIR)/libiberty.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/elf/msp430.h $(INCDIR)/elf/reloc-macros.h \ + elf32-target.h elf32-openrisc.lo: elf32-openrisc.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/openrisc.h \ @@ -1738,16 +1803,16 @@ elf32-pj.lo: elf32-pj.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf32-ppc.lo: elf32-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ - elf32-target.h + elf32-ppc.h elf32-target.h elf32-sh64.lo: elf32-sh64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(srcdir)/../opcodes/sh64-opc.h \ - elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + elf32-sh64.h elf32-sh.c $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h elf32-sh64-com.lo: elf32-sh64-com.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h $(srcdir)/../opcodes/sh64-opc.h + $(INCDIR)/elf/reloc-macros.h elf32-sh64.h $(srcdir)/../opcodes/sh64-opc.h elf32-s390.lo: elf32-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h \ @@ -1756,19 +1821,6 @@ elf32-sh.lo: elf32-sh.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ elf32-target.h -elf32-sh-lin.lo: elf32-sh-lin.c $(INCDIR)/filenames.h \ - $(INCDIR)/elf/internal.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h elf32-sh.c \ - $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-sh-nbsd.lo: elf32-sh-nbsd.c elf32-sh.c $(INCDIR)/filenames.h \ - $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h -elf32-sh64-nbsd.lo: elf32-sh64-nbsd.c elf32-sh64.c \ - $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ - $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ - $(srcdir)/../opcodes/sh64-opc.h elf32-sh.c $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h elf32-sparc.lo: elf32-sparc.c $(INCDIR)/filenames.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/sparc.h \ @@ -1787,13 +1839,18 @@ elf32-xstormy16.lo: elf32-xstormy16.c $(INCDIR)/filenames.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/xstormy16.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/libiberty.h \ elf32-target.h +elf32-xtensa.lo: elf32-xtensa.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/elf/xtensa.h \ + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-config.h elf32-target.h elf32.lo: elf32.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \ - elflink.h + $(INCDIR)/safe-ctype.h elflink.lo: elflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h + $(INCDIR)/elf/external.h $(INCDIR)/libiberty.h elf-strtab.lo: elf-strtab.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/hashtab.h $(INCDIR)/libiberty.h @@ -1863,6 +1920,8 @@ m68knetbsd.lo: m68knetbsd.c netbsd.h $(INCDIR)/filenames.h \ m88kmach3.lo: m88kmach3.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h +mach-o.lo: mach-o.c mach-o.h $(INCDIR)/filenames.h \ + $(INCDIR)/libiberty.h mach-o-target.c mipsbsd.lo: mipsbsd.c $(INCDIR)/filenames.h libaout.h \ $(INCDIR)/bfdlink.h aout-target.h $(INCDIR)/aout/aout64.h \ $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h @@ -1894,6 +1953,8 @@ pc532-mach.lo: pc532-mach.c $(INCDIR)/filenames.h libaout.h \ pdp11.lo: pdp11.c $(INCDIR)/filenames.h libaout.h $(INCDIR)/bfdlink.h \ aout-target.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/aout/ar.h $(INCDIR)/safe-ctype.h +pef.lo: pef.c $(INCDIR)/safe-ctype.h pef.h pef-traceback.h \ + $(INCDIR)/filenames.h $(INCDIR)/libiberty.h pe-arm.lo: pe-arm.c $(INCDIR)/filenames.h coff-arm.c \ $(INCDIR)/coff/arm.h $(INCDIR)/coff/external.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/pe.h libcoff.h $(INCDIR)/bfdlink.h coffcode.h \ @@ -1977,8 +2038,8 @@ vms.lo: vms.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms.h vms-gsd.lo: vms-gsd.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms.h -vms-hdr.lo: vms-hdr.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ - $(INCDIR)/safe-ctype.h vms.h +vms-hdr.lo: vms-hdr.c bfdver.h $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h vms.h vms-misc.lo: vms-misc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ vms.h vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ @@ -1986,6 +2047,11 @@ vms-tir.lo: vms-tir.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ xcofflink.lo: xcofflink.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ $(INCDIR)/coff/internal.h $(INCDIR)/coff/xcoff.h libcoff.h \ libxcoff.h +xsym.lo: xsym.c xsym.h $(INCDIR)/filenames.h +xtensa-isa.lo: xtensa-isa.c $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-isa-internal.h +xtensa-modules.lo: xtensa-modules.c $(INCDIR)/xtensa-isa.h \ + $(INCDIR)/xtensa-isa-internal.h aix5ppc-core.lo: aix5ppc-core.c aout64.lo: aout64.c aoutx.h $(INCDIR)/filenames.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/bfdlink.h libaout.h $(INCDIR)/aout/aout64.h \ @@ -2017,13 +2083,6 @@ elf64-alpha.lo: elf64-alpha.c $(INCDIR)/filenames.h \ $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ libecoff.h ecoffswap.h elf64-target.h -elf64-alpha-fbsd.lo: elf64-alpha-fbsd.c elf64-alpha.c $(INCDIR)/filenames.h \ - elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/elf/alpha.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sym.h $(INCDIR)/coff/symconst.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/coff/alpha.h $(INCDIR)/aout/ar.h libcoff.h \ - libecoff.h ecoffswap.h elf64-target.h elf64-hppa.lo: elf64-hppa.c $(INCDIR)/alloca-conf.h \ $(INCDIR)/filenames.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ @@ -2032,6 +2091,13 @@ elf64-hppa.lo: elf64-hppa.c $(INCDIR)/alloca-conf.h \ elf64-gen.lo: elf64-gen.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h elf64-target.h +elfn32-mips.lo: elfn32-mips.c $(INCDIR)/filenames.h \ + $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \ + $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/sym.h \ + $(INCDIR)/coff/symconst.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/ecoff.h $(INCDIR)/coff/mips.h $(INCDIR)/coff/external.h \ + ecoffswap.h elf32-target.h elf64-mips.lo: elf64-mips.c $(INCDIR)/filenames.h $(INCDIR)/aout/ar.h \ $(INCDIR)/bfdlink.h genlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfxx-mips.h \ @@ -2045,7 +2111,7 @@ elf64-mmix.lo: elf64-mmix.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/opcode/mmix.h elf64-target.h elf64-ppc.lo: elf64-ppc.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/elf/external.h $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/reloc-macros.h \ elf64-ppc.h elf64-target.h elf64-s390.lo: elf64-s390.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ @@ -2055,10 +2121,6 @@ elf64-sh64.lo: elf64-sh64.c $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ elf64-target.h -elf64-sh64-nbsd.lo: elf64-sh64-nbsd.c elf64-sh64.c \ - $(INCDIR)/filenames.h $(INCDIR)/bfdlink.h elf-bfd.h \ - $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ - $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h elf64-target.h elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \ elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/sparc.h \ @@ -2067,7 +2129,7 @@ elf64-sparc.lo: elf64-sparc.c $(INCDIR)/filenames.h \ elf64.lo: elf64.c elfcode.h $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/bfdlink.h elf-bfd.h $(INCDIR)/elf/common.h \ $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h elfcore.h \ - elflink.h + $(INCDIR)/safe-ctype.h mmo.lo: mmo.c $(INCDIR)/filenames.h $(INCDIR)/libiberty.h \ $(INCDIR)/elf/mmix.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/opcode/mmix.h nlm32-alpha.lo: nlm32-alpha.c $(INCDIR)/filenames.h \ @@ -2091,11 +2153,13 @@ cisco-core.lo: cisco-core.c $(INCDIR)/filenames.h elf32-ia64.lo: elf32-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/reloc-macros.h elf32-target.h + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h $(INCDIR)/hashtab.h \ + elf32-target.h elf64-ia64.lo: elf64-ia64.c $(INCDIR)/filenames.h elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h \ - $(INCDIR)/elf/reloc-macros.h elf64-target.h + $(INCDIR)/elf/reloc-macros.h $(INCDIR)/objalloc.h $(INCDIR)/hashtab.h \ + elf64-target.h peigen.lo: peigen.c $(INCDIR)/filenames.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(INCDIR)/coff/pe.h \ libcoff.h $(INCDIR)/bfdlink.h libpei.h diff --git a/contrib/binutils/bfd/acinclude.m4 b/contrib/binutils/bfd/acinclude.m4 index b3c6ccff..63b4bf9 100644 --- a/contrib/binutils/bfd/acinclude.m4 +++ b/contrib/binutils/bfd/acinclude.m4 @@ -1,5 +1,7 @@ +sinclude(../config/accross.m4) + dnl See whether we need to use fopen-bin.h rather than fopen-same.h. -AC_DEFUN(BFD_BINARY_FOPEN, +AC_DEFUN([BFD_BINARY_FOPEN], [AC_REQUIRE([AC_CANONICAL_SYSTEM]) case "${host}" in changequote(,)dnl @@ -9,7 +11,7 @@ changequote([,])dnl esac])dnl dnl Get a default for CC_FOR_BUILD to put into Makefile. -AC_DEFUN(BFD_CC_FOR_BUILD, +AC_DEFUN([BFD_CC_FOR_BUILD], [# Put a plausible default for CC_FOR_BUILD in Makefile. if test -z "$CC_FOR_BUILD"; then if test "x$cross_compiling" = "xno"; then @@ -42,7 +44,7 @@ fi AC_SUBST(EXEEXT_FOR_BUILD)])dnl dnl See whether we need a declaration for a function. -AC_DEFUN(BFD_NEED_DECLARATION, +AC_DEFUN([BFD_NEED_DECLARATION], [AC_MSG_CHECKING([whether $1 must be declared]) AC_CACHE_VAL(bfd_cv_decl_needed_$1, [AC_TRY_COMPILE([ @@ -71,7 +73,7 @@ fi dnl Check for existence of a type $1 in sys/procfs.h -AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE, +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([ @@ -91,7 +93,7 @@ AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE, dnl Check for existence of member $2 in type $1 in sys/procfs.h -AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER, +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([ @@ -127,9 +129,9 @@ AC_SUBST(INTLLIBS) AC_DEFUN([AM_INSTALL_LIBBFD], [AC_MSG_CHECKING([whether to install libbfd]) AC_ARG_ENABLE(install-libbfd, -[ --install-libbfd controls installation of libbfd and related headers], +[ --enable-install-libbfd controls installation of libbfd and related headers], install_libbfd_p=$enableval, - if test "${host}" = "${target}" -o "$enable_shared" = "yes"; then + if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then install_libbfd_p=yes else install_libbfd_p=no diff --git a/contrib/binutils/bfd/aclocal.m4 b/contrib/binutils/bfd/aclocal.m4 index b6dfcbe..9d27670 100644 --- a/contrib/binutils/bfd/aclocal.m4 +++ b/contrib/binutils/bfd/aclocal.m4 @@ -1,4 +1,4 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p5 +dnl aclocal.m4 generated automatically by aclocal 1.4-p6 dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation @@ -10,6 +10,8 @@ dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A dnl PARTICULAR PURPOSE. +sinclude(../config/accross.m4) + dnl See whether we need to use fopen-bin.h rather than fopen-same.h. AC_DEFUN(BFD_BINARY_FOPEN, [AC_REQUIRE([AC_CANONICAL_SYSTEM]) @@ -139,9 +141,9 @@ AC_SUBST(INTLLIBS) AC_DEFUN([AM_INSTALL_LIBBFD], [AC_MSG_CHECKING([whether to install libbfd]) AC_ARG_ENABLE(install-libbfd, -[ --install-libbfd controls installation of libbfd and related headers], +[ --enable-install-libbfd controls installation of libbfd and related headers], install_libbfd_p=$enableval, - if test "${host}" = "${target}" -o "$enable_shared" = "yes"; then + if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then install_libbfd_p=yes else install_libbfd_p=no @@ -173,6 +175,33 @@ else $1_FALSE= fi]) +# isc-posix.m4 serial 2 (gettext-0.11.2) +dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. +dnl This file is free software, distributed under the terms of the GNU +dnl General Public License. As a special exception to the GNU General +dnl Public License, this file may be distributed as part of a program +dnl that contains a configuration script generated by Autoconf, under +dnl the same distribution terms as the rest of that program. + +# This file is not needed with autoconf-2.53 and newer. Remove it in 2005. + +# 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. @@ -183,7 +212,8 @@ dnl Usage: dnl AM_INIT_AUTOMAKE(package,version, [no-define]) AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AC_PROG_INSTALL]) +[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL]) PACKAGE=[$1] AC_SUBST(PACKAGE) VERSION=[$2] @@ -199,13 +229,42 @@ AC_REQUIRE([AM_SANITY_CHECK]) AC_REQUIRE([AC_ARG_PROGRAM]) dnl FIXME This is truly gross. missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}, $missing_dir) AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}, $missing_dir) AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) AC_REQUIRE([AC_PROG_MAKE_SET])]) +# Copyright 2002 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.4"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.4-p6])]) + # # Check to make sure that the build environment is sane. # diff --git a/contrib/binutils/bfd/aout-arm.c b/contrib/binutils/bfd/aout-arm.c index b87e09c..38ecfab 100644 --- a/contrib/binutils/bfd/aout-arm.c +++ b/contrib/binutils/bfd/aout-arm.c @@ -1,5 +1,5 @@ /* BFD back-end for raw ARM a.out binaries. - Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001 + Copyright 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" -/* Avoid multiple defininitions from aoutx if supporting standarad a.out +/* Avoid multiple definitions from aoutx if supporting standard a.out as well as our own. */ /* Do not "beautify" the CONCAT* macro args. Traditional C will not remove whitespace added here, and thus will fail to concatenate @@ -54,7 +54,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libaout.h" #include "aout/aout64.h" -static boolean MY(write_object_contents) +static bfd_boolean MY(write_object_contents) PARAMS ((bfd *)); static bfd_reloc_status_type MY(fix_pcrel_26_done) PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); @@ -80,28 +80,28 @@ reloc_howto_type MY(howto_table)[] = { /* Type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone. */ - HOWTO (0, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, - 0x000000ff, 0x000000ff, false), - HOWTO (1, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, - 0x0000ffff, 0x0000ffff, false), - HOWTO (2, 0, 2, 32, false, 0, complain_overflow_bitfield, 0, "32", true, - 0xffffffff, 0xffffffff, false), - HOWTO (3, 2, 2, 26, true, 0, complain_overflow_signed, MY(fix_pcrel_26), - "ARM26", true, 0x00ffffff, 0x00ffffff, true), - HOWTO (4, 0, 0, 8, true, 0, complain_overflow_signed, 0, "DISP8", true, - 0x000000ff, 0x000000ff, true), - HOWTO (5, 0, 1, 16, true, 0, complain_overflow_signed, 0, "DISP16", true, - 0x0000ffff, 0x0000ffff, true), - HOWTO (6, 0, 2, 32, true, 0, complain_overflow_signed, 0, "DISP32", true, - 0xffffffff, 0xffffffff, true), - HOWTO (7, 2, 2, 26, false, 0, complain_overflow_signed, - MY(fix_pcrel_26_done), "ARM26D", true, 0x0, 0x0, - false), + HOWTO (0, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, 0, "8", TRUE, + 0x000000ff, 0x000000ff, FALSE), + HOWTO (1, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, 0, "16", TRUE, + 0x0000ffff, 0x0000ffff, FALSE), + HOWTO (2, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "32", TRUE, + 0xffffffff, 0xffffffff, FALSE), + HOWTO (3, 2, 2, 26, TRUE, 0, complain_overflow_signed, MY(fix_pcrel_26), + "ARM26", TRUE, 0x00ffffff, 0x00ffffff, TRUE), + HOWTO (4, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0, "DISP8", TRUE, + 0x000000ff, 0x000000ff, TRUE), + HOWTO (5, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0, "DISP16", TRUE, + 0x0000ffff, 0x0000ffff, TRUE), + HOWTO (6, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0, "DISP32", TRUE, + 0xffffffff, 0xffffffff, TRUE), + HOWTO (7, 2, 2, 26, FALSE, 0, complain_overflow_signed, + MY(fix_pcrel_26_done), "ARM26D", TRUE, 0x0, 0x0, + FALSE), EMPTY_HOWTO (-1), - HOWTO (9, 0, -1, 16, false, 0, complain_overflow_bitfield, 0, "NEG16", true, - 0x0000ffff, 0x0000ffff, false), - HOWTO (10, 0, -2, 32, false, 0, complain_overflow_bitfield, 0, "NEG32", true, - 0xffffffff, 0xffffffff, false) + HOWTO (9, 0, -1, 16, FALSE, 0, complain_overflow_bitfield, 0, "NEG16", TRUE, + 0x0000ffff, 0x0000ffff, FALSE), + HOWTO (10, 0, -2, 32, FALSE, 0, complain_overflow_bitfield, 0, "NEG32", TRUE, + 0xffffffff, 0xffffffff, FALSE) }; #define RELOC_ARM_BITS_NEG_BIG ((unsigned int) 0x08) diff --git a/contrib/binutils/bfd/aout-encap.c b/contrib/binutils/bfd/aout-encap.c index 84c46c6..96c7082 100644 --- a/contrib/binutils/bfd/aout-encap.c +++ b/contrib/binutils/bfd/aout-encap.c @@ -1,5 +1,5 @@ /* BFD back-end for a.out files encapsulated with COFF headers. - Copyright 1990, 1991, 1994, 1995, 2000, 2001 + Copyright 1990, 1991, 1994, 1995, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define TARGET_PAGE_SIZE 4096 #define SEGMENT_SIZE TARGET_PAGE_SIZE #define TEXT_START_ADDR 0 -#define BYTES_IN_WORD 4 #endif #include "bfd.h" @@ -123,7 +122,7 @@ encap_real_callback (abfd) Section contents have already been written. We write the file header, symbols, and relocation. */ -boolean +bfd_boolean encap_write_object_contents (abfd) bfd *abfd; { @@ -230,7 +229,7 @@ encap_write_object_contents (abfd) text_size -= N_TXTOFF (outheader); WRITE_HEADERS(abfd, execp); - return true; + return TRUE; } #define MY_write_object_content encap_write_object_contents diff --git a/contrib/binutils/bfd/aout-target.h b/contrib/binutils/bfd/aout-target.h index b2acc09..d8cad54 100644 --- a/contrib/binutils/bfd/aout-target.h +++ b/contrib/binutils/bfd/aout-target.h @@ -1,6 +1,6 @@ /* Define a target vector and some small routines for a variant of a.out. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -201,21 +201,21 @@ MY(object_p) (abfd) #ifndef MY_mkobject -static boolean MY(mkobject) PARAMS ((bfd *)); +static bfd_boolean MY(mkobject) PARAMS ((bfd *)); -static boolean +static bfd_boolean MY(mkobject) (abfd) bfd *abfd; { if (! NAME(aout,mkobject) (abfd)) - return false; + return FALSE; #if 0 /* Sizes get set in set_sizes callback, later, after we know the architecture and machine. */ adata(abfd).page_size = TARGET_PAGE_SIZE; adata(abfd).segment_size = SEGMENT_SIZE; adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE; #endif - return true; + return TRUE; } #define MY_mkobject MY(mkobject) #endif @@ -228,10 +228,10 @@ MY(mkobject) (abfd) section contents, and copy_private_bfd_data is not called until after the section contents have been set. */ -static boolean MY_bfd_copy_private_section_data +static bfd_boolean MY_bfd_copy_private_section_data PARAMS ((bfd *, asection *, bfd *, asection *)); -static boolean +static bfd_boolean MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec) bfd *ibfd; asection *isec ATTRIBUTE_UNUSED; @@ -241,7 +241,7 @@ MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec) if (bfd_get_flavour (ibfd) == bfd_target_aout_flavour && bfd_get_flavour (obfd) == bfd_target_aout_flavour) obj_aout_subformat (obfd) = obj_aout_subformat (ibfd); - return true; + return TRUE; } #endif @@ -251,9 +251,9 @@ MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec) file header, symbols, and relocation. */ #ifndef MY_write_object_contents -static boolean MY(write_object_contents) PARAMS ((bfd *)); +static bfd_boolean MY(write_object_contents) PARAMS ((bfd *)); -static boolean +static bfd_boolean MY(write_object_contents) (abfd) bfd *abfd; { @@ -264,16 +264,16 @@ MY(write_object_contents) (abfd) WRITE_HEADERS(abfd, execp); - return true; + return TRUE; } #define MY_write_object_contents MY(write_object_contents) #endif #ifndef MY_set_sizes -static boolean MY(set_sizes) PARAMS ((bfd *)); +static bfd_boolean MY(set_sizes) PARAMS ((bfd *)); -static boolean +static bfd_boolean MY(set_sizes) (abfd) bfd *abfd; { @@ -287,7 +287,7 @@ MY(set_sizes) (abfd) #endif adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE; - return true; + return TRUE; } #define MY_set_sizes MY(set_sizes) #endif @@ -375,9 +375,9 @@ MY_final_link_callback (abfd, ptreloff, pdreloff, psymoff) /* Final link routine. We need to use a call back to get the correct offsets in the output file. */ -static boolean MY_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *)); +static bfd_boolean MY_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *)); -static boolean +static bfd_boolean MY_bfd_final_link (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -443,7 +443,7 @@ MY_bfd_final_link (abfd, info) #endif #ifndef MY_bfd_debug_info_accumulate #define MY_bfd_debug_info_accumulate \ - (void (*) PARAMS ((bfd*, struct sec *))) bfd_void + (void (*) PARAMS ((bfd*, struct bfd_section *))) bfd_void #endif #ifndef MY_core_file_failing_command @@ -470,8 +470,8 @@ MY_bfd_final_link (abfd, info) #ifndef MY_get_symtab_upper_bound #define MY_get_symtab_upper_bound NAME(aout,get_symtab_upper_bound) #endif -#ifndef MY_get_symtab -#define MY_get_symtab NAME(aout,get_symtab) +#ifndef MY_canonicalize_symtab +#define MY_canonicalize_symtab NAME(aout,canonicalize_symtab) #endif #ifndef MY_get_reloc_upper_bound #define MY_get_reloc_upper_bound NAME(aout,get_reloc_upper_bound) diff --git a/contrib/binutils/bfd/aoutf1.h b/contrib/binutils/bfd/aoutf1.h index 80d69d9..352dadf 100644 --- a/contrib/binutils/bfd/aoutf1.h +++ b/contrib/binutils/bfd/aoutf1.h @@ -1,6 +1,6 @@ /* A.out "format 1" file handling code for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, - 2001, 2002 + 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. @@ -75,15 +75,24 @@ The name put into the target vector. #define sunos_write_object_contents aout_32_sunos4_write_object_contents #endif -static boolean sunos_merge_private_bfd_data PARAMS ((bfd *, bfd *)); -static void sunos_set_arch_mach PARAMS ((bfd *, enum machine_type)); -static void choose_reloc_size PARAMS ((bfd *)); -static boolean sunos_write_object_contents PARAMS ((bfd *)); -static const bfd_target *sunos4_core_file_p PARAMS ((bfd *)); -static char *sunos4_core_file_failing_command PARAMS ((bfd *)); -static int sunos4_core_file_failing_signal PARAMS ((bfd *)); -static boolean sunos4_core_file_matches_executable_p PARAMS ((bfd *, bfd *)); -static boolean sunos4_set_sizes PARAMS ((bfd *)); +static bfd_boolean sunos_merge_private_bfd_data + PARAMS ((bfd *, bfd *)); +static void sunos_set_arch_mach + PARAMS ((bfd *, enum machine_type)); +static void choose_reloc_size + PARAMS ((bfd *)); +static bfd_boolean sunos_write_object_contents + PARAMS ((bfd *)); +static const bfd_target *sunos4_core_file_p + PARAMS ((bfd *)); +static char *sunos4_core_file_failing_command + PARAMS ((bfd *)); +static int sunos4_core_file_failing_signal + PARAMS ((bfd *)); +static bfd_boolean sunos4_core_file_matches_executable_p + PARAMS ((bfd *, bfd *)); +static bfd_boolean sunos4_set_sizes + PARAMS ((bfd *)); /* Merge backend data into the output file. This is necessary on sparclet-aout where we want the resultant machine @@ -91,13 +100,13 @@ static boolean sunos4_set_sizes PARAMS ((bfd *)); #define MY_bfd_merge_private_bfd_data sunos_merge_private_bfd_data -static boolean +static bfd_boolean sunos_merge_private_bfd_data (ibfd, obfd) bfd *ibfd, *obfd; { if (bfd_get_flavour (ibfd) != bfd_target_aout_flavour || bfd_get_flavour (obfd) != bfd_target_aout_flavour) - return true; + return TRUE; if (bfd_get_arch (obfd) == bfd_arch_sparc) { @@ -105,7 +114,7 @@ sunos_merge_private_bfd_data (ibfd, obfd) bfd_set_arch_mach (obfd, bfd_arch_sparc, bfd_get_mach (ibfd)); } - return true; + return TRUE; } /* This is either sunos_32_set_arch_mach or sunos_64_set_arch_mach, @@ -207,7 +216,7 @@ choose_reloc_size (abfd) aout_64_sunos4_write_object_contents or aout_32_sunos4_write_object_contents, depending upon ARCH_SIZE. */ -static boolean +static bfd_boolean sunos_write_object_contents (abfd) bfd *abfd; { @@ -264,7 +273,7 @@ sunos_write_object_contents (abfd) WRITE_HEADERS (abfd, execp); - return true; + return TRUE; } /* core files */ @@ -731,7 +740,7 @@ sunos4_core_file_failing_signal (abfd) return core_hdr (abfd)->hdr->c_signo; } -static boolean +static bfd_boolean sunos4_core_file_matches_executable_p (core_bfd, exec_bfd) bfd *core_bfd; bfd *exec_bfd; @@ -739,12 +748,12 @@ sunos4_core_file_matches_executable_p (core_bfd, exec_bfd) if (core_bfd->xvec != exec_bfd->xvec) { bfd_set_error (bfd_error_system_call); - return false; + return FALSE; } /* Solaris core files do not include an aouthdr. */ if ((core_hdr (core_bfd)->hdr)->c_len == SOLARIS_BCP_CORE_LEN) - return true; + return TRUE; return (memcmp ((char *) &((core_hdr (core_bfd)->hdr)->c_aouthdr), (char *) exec_hdr (exec_bfd), @@ -752,24 +761,24 @@ sunos4_core_file_matches_executable_p (core_bfd, exec_bfd) } #define MY_set_sizes sunos4_set_sizes -static boolean +static bfd_boolean sunos4_set_sizes (abfd) bfd *abfd; { switch (bfd_get_arch (abfd)) { default: - return false; + return FALSE; case bfd_arch_sparc: adata (abfd).page_size = 0x2000; adata (abfd).segment_size = 0x2000; adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE; - return true; + return TRUE; case bfd_arch_m68k: adata (abfd).page_size = 0x2000; adata (abfd).segment_size = 0x20000; adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE; - return true; + return TRUE; } } @@ -825,7 +834,7 @@ static const struct aout_backend_data sunos4_aout_backend = #define MY_bfd_debug_info_start bfd_void #define MY_bfd_debug_info_end bfd_void #define MY_bfd_debug_info_accumulate \ - (void (*) PARAMS ((bfd *, struct sec *))) bfd_void + (void (*) PARAMS ((bfd *, struct bfd_section *))) bfd_void #define MY_core_file_p sunos4_core_file_p #define MY_write_object_contents NAME(aout,sunos4_write_object_contents) #define MY_backend_data &sunos4_aout_backend diff --git a/contrib/binutils/bfd/aoutx.h b/contrib/binutils/bfd/aoutx.h index 70359d6..3282f87 100644 --- a/contrib/binutils/bfd/aoutx.h +++ b/contrib/binutils/bfd/aoutx.h @@ -1,24 +1,24 @@ /* BFD semi-generic back-end for a.out binaries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, - 2001, 2002 + 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. -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. */ /* SECTION @@ -105,9 +105,7 @@ DESCRIPTION in the @file{config/@var{XXX}.mt} file, and modify @file{configure.in} to use the @file{@var{XXX}.mt} file (by setting "<>") when your - configuration is selected. - -*/ + configuration is selected. */ /* Some assumptions: * Any BFD with D_PAGED set is ZMAGIC, and vice versa. @@ -131,14 +129,18 @@ DESCRIPTION #include "aout/stab_gnu.h" #include "aout/ar.h" -static boolean aout_get_external_symbols PARAMS ((bfd *)); -static boolean translate_from_native_sym_flags +static bfd_boolean aout_get_external_symbols + PARAMS ((bfd *)); +static bfd_boolean translate_from_native_sym_flags PARAMS ((bfd *, aout_symbol_type *)); -static boolean translate_to_native_sym_flags +static bfd_boolean translate_to_native_sym_flags PARAMS ((bfd *, asymbol *, struct external_nlist *)); -static void adjust_o_magic PARAMS ((bfd *, struct internal_exec *)); -static void adjust_z_magic PARAMS ((bfd *, struct internal_exec *)); -static void adjust_n_magic PARAMS ((bfd *, struct internal_exec *)); +static void adjust_o_magic + PARAMS ((bfd *, struct internal_exec *)); +static void adjust_z_magic + PARAMS ((bfd *, struct internal_exec *)); +static void adjust_n_magic + PARAMS ((bfd *, struct internal_exec *)); reloc_howto_type * NAME(aout,reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); @@ -153,9 +155,8 @@ DESCRIPTION The standard records contain only an address, a symbol index, and a type field. The extended records (used on 29ks and sparcs) also have a full integer for an - addend. + addend. */ -*/ #ifndef CTOR_TABLE_RELOC_HOWTO #define CTOR_TABLE_RELOC_IDX 2 #define CTOR_TABLE_RELOC_HOWTO(BFD) \ @@ -193,58 +194,59 @@ DESCRIPTION reloc_howto_type howto_table_ext[] = { - /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */ - HOWTO(RELOC_8, 0, 0, 8, false, 0, complain_overflow_bitfield,0,"8", false, 0,0x000000ff, false), - HOWTO(RELOC_16, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"16", false, 0,0x0000ffff, false), - HOWTO(RELOC_32, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"32", false, 0,0xffffffff, false), - HOWTO(RELOC_DISP8, 0, 0, 8, true, 0, complain_overflow_signed,0,"DISP8", false, 0,0x000000ff, false), - HOWTO(RELOC_DISP16, 0, 1, 16, true, 0, complain_overflow_signed,0,"DISP16", false, 0,0x0000ffff, false), - HOWTO(RELOC_DISP32, 0, 2, 32, true, 0, complain_overflow_signed,0,"DISP32", false, 0,0xffffffff, false), - HOWTO(RELOC_WDISP30,2, 2, 30, true, 0, complain_overflow_signed,0,"WDISP30", false, 0,0x3fffffff, false), - HOWTO(RELOC_WDISP22,2, 2, 22, true, 0, complain_overflow_signed,0,"WDISP22", false, 0,0x003fffff, false), - HOWTO(RELOC_HI22, 10, 2, 22, false, 0, complain_overflow_bitfield,0,"HI22", false, 0,0x003fffff, false), - HOWTO(RELOC_22, 0, 2, 22, false, 0, complain_overflow_bitfield,0,"22", false, 0,0x003fffff, false), - HOWTO(RELOC_13, 0, 2, 13, false, 0, complain_overflow_bitfield,0,"13", false, 0,0x00001fff, false), - HOWTO(RELOC_LO10, 0, 2, 10, false, 0, complain_overflow_dont,0,"LO10", false, 0,0x000003ff, false), - HOWTO(RELOC_SFA_BASE,0, 2, 32, false, 0, complain_overflow_bitfield,0,"SFA_BASE", false, 0,0xffffffff, false), - HOWTO(RELOC_SFA_OFF13,0,2, 32, false, 0, complain_overflow_bitfield,0,"SFA_OFF13",false, 0,0xffffffff, false), - HOWTO(RELOC_BASE10, 0, 2, 10, false, 0, complain_overflow_dont,0,"BASE10", false, 0,0x000003ff, false), - HOWTO(RELOC_BASE13, 0, 2, 13, false, 0, complain_overflow_signed,0,"BASE13", false, 0,0x00001fff, false), - HOWTO(RELOC_BASE22, 10, 2, 22, false, 0, complain_overflow_bitfield,0,"BASE22", false, 0,0x003fffff, false), - HOWTO(RELOC_PC10, 0, 2, 10, true, 0, complain_overflow_dont,0,"PC10", false, 0,0x000003ff, true), - HOWTO(RELOC_PC22, 10, 2, 22, true, 0, complain_overflow_signed,0,"PC22", false, 0,0x003fffff, true), - HOWTO(RELOC_JMP_TBL,2, 2, 30, true, 0, complain_overflow_signed,0,"JMP_TBL", false, 0,0x3fffffff, false), - HOWTO(RELOC_SEGOFF16,0, 2, 0, false, 0, complain_overflow_bitfield,0,"SEGOFF16", false, 0,0x00000000, false), - HOWTO(RELOC_GLOB_DAT,0, 2, 0, false, 0, complain_overflow_bitfield,0,"GLOB_DAT", false, 0,0x00000000, false), - HOWTO(RELOC_JMP_SLOT,0, 2, 0, false, 0, complain_overflow_bitfield,0,"JMP_SLOT", false, 0,0x00000000, false), - HOWTO(RELOC_RELATIVE,0, 2, 0, false, 0, complain_overflow_bitfield,0,"RELATIVE", false, 0,0x00000000, false), - HOWTO(0, 0, 0, 0, false, 0, complain_overflow_dont, 0, "R_SPARC_NONE", false,0,0x00000000,true), - HOWTO(0, 0, 0, 0, false, 0, complain_overflow_dont, 0, "R_SPARC_NONE", false,0,0x00000000,true), + /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone. */ + HOWTO(RELOC_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,0,"8", FALSE, 0,0x000000ff, FALSE), + HOWTO(RELOC_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,0,"16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(RELOC_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"32", FALSE, 0,0xffffffff, FALSE), + HOWTO(RELOC_DISP8, 0, 0, 8, TRUE, 0, complain_overflow_signed,0,"DISP8", FALSE, 0,0x000000ff, FALSE), + HOWTO(RELOC_DISP16, 0, 1, 16, TRUE, 0, complain_overflow_signed,0,"DISP16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(RELOC_DISP32, 0, 2, 32, TRUE, 0, complain_overflow_signed,0,"DISP32", FALSE, 0,0xffffffff, FALSE), + HOWTO(RELOC_WDISP30,2, 2, 30, TRUE, 0, complain_overflow_signed,0,"WDISP30", FALSE, 0,0x3fffffff, FALSE), + HOWTO(RELOC_WDISP22,2, 2, 22, TRUE, 0, complain_overflow_signed,0,"WDISP22", FALSE, 0,0x003fffff, FALSE), + HOWTO(RELOC_HI22, 10, 2, 22, FALSE, 0, complain_overflow_bitfield,0,"HI22", FALSE, 0,0x003fffff, FALSE), + HOWTO(RELOC_22, 0, 2, 22, FALSE, 0, complain_overflow_bitfield,0,"22", FALSE, 0,0x003fffff, FALSE), + HOWTO(RELOC_13, 0, 2, 13, FALSE, 0, complain_overflow_bitfield,0,"13", FALSE, 0,0x00001fff, FALSE), + HOWTO(RELOC_LO10, 0, 2, 10, FALSE, 0, complain_overflow_dont,0,"LO10", FALSE, 0,0x000003ff, FALSE), + HOWTO(RELOC_SFA_BASE,0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"SFA_BASE", FALSE, 0,0xffffffff, FALSE), + HOWTO(RELOC_SFA_OFF13,0,2, 32, FALSE, 0, complain_overflow_bitfield,0,"SFA_OFF13",FALSE, 0,0xffffffff, FALSE), + HOWTO(RELOC_BASE10, 0, 2, 10, FALSE, 0, complain_overflow_dont,0,"BASE10", FALSE, 0,0x000003ff, FALSE), + HOWTO(RELOC_BASE13, 0, 2, 13, FALSE, 0, complain_overflow_signed,0,"BASE13", FALSE, 0,0x00001fff, FALSE), + HOWTO(RELOC_BASE22, 10, 2, 22, FALSE, 0, complain_overflow_bitfield,0,"BASE22", FALSE, 0,0x003fffff, FALSE), + HOWTO(RELOC_PC10, 0, 2, 10, TRUE, 0, complain_overflow_dont,0,"PC10", FALSE, 0,0x000003ff, TRUE), + HOWTO(RELOC_PC22, 10, 2, 22, TRUE, 0, complain_overflow_signed,0,"PC22", FALSE, 0,0x003fffff, TRUE), + HOWTO(RELOC_JMP_TBL,2, 2, 30, TRUE, 0, complain_overflow_signed,0,"JMP_TBL", FALSE, 0,0x3fffffff, FALSE), + HOWTO(RELOC_SEGOFF16,0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"SEGOFF16", FALSE, 0,0x00000000, FALSE), + HOWTO(RELOC_GLOB_DAT,0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"GLOB_DAT", FALSE, 0,0x00000000, FALSE), + HOWTO(RELOC_JMP_SLOT,0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"JMP_SLOT", FALSE, 0,0x00000000, FALSE), + HOWTO(RELOC_RELATIVE,0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"RELATIVE", FALSE, 0,0x00000000, FALSE), + HOWTO(0, 0, 0, 0, FALSE, 0, complain_overflow_dont, 0, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE), + HOWTO(0, 0, 0, 0, FALSE, 0, complain_overflow_dont, 0, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE), #define RELOC_SPARC_REV32 RELOC_WDISP19 - HOWTO(RELOC_SPARC_REV32, 0, 2, 32, false, 0, complain_overflow_dont,0,"R_SPARC_REV32", false, 0,0xffffffff, false), + HOWTO(RELOC_SPARC_REV32, 0, 2, 32, FALSE, 0, complain_overflow_dont,0,"R_SPARC_REV32", FALSE, 0,0xffffffff, FALSE), }; /* Convert standard reloc records to "arelent" format (incl byte swap). */ -reloc_howto_type howto_table_std[] = { - /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone */ -HOWTO ( 0, 0, 0, 8, false, 0, complain_overflow_bitfield,0,"8", true, 0x000000ff,0x000000ff, false), -HOWTO ( 1, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"16", true, 0x0000ffff,0x0000ffff, false), -HOWTO ( 2, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"32", true, 0xffffffff,0xffffffff, false), -HOWTO ( 3, 0, 4, 64, false, 0, complain_overflow_bitfield,0,"64", true, 0xdeaddead,0xdeaddead, false), -HOWTO ( 4, 0, 0, 8, true, 0, complain_overflow_signed, 0,"DISP8", true, 0x000000ff,0x000000ff, false), -HOWTO ( 5, 0, 1, 16, true, 0, complain_overflow_signed, 0,"DISP16", true, 0x0000ffff,0x0000ffff, false), -HOWTO ( 6, 0, 2, 32, true, 0, complain_overflow_signed, 0,"DISP32", true, 0xffffffff,0xffffffff, false), -HOWTO ( 7, 0, 4, 64, true, 0, complain_overflow_signed, 0,"DISP64", true, 0xfeedface,0xfeedface, false), -HOWTO ( 8, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"GOT_REL", false, 0,0x00000000, false), -HOWTO ( 9, 0, 1, 16, false, 0, complain_overflow_bitfield,0,"BASE16", false,0xffffffff,0xffffffff, false), -HOWTO (10, 0, 2, 32, false, 0, complain_overflow_bitfield,0,"BASE32", false,0xffffffff,0xffffffff, false), +reloc_howto_type howto_table_std[] = +{ + /* type rs size bsz pcrel bitpos ovrf sf name part_inpl readmask setmask pcdone. */ +HOWTO ( 0, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,0,"8", TRUE, 0x000000ff,0x000000ff, FALSE), +HOWTO ( 1, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,0,"16", TRUE, 0x0000ffff,0x0000ffff, FALSE), +HOWTO ( 2, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"32", TRUE, 0xffffffff,0xffffffff, FALSE), +HOWTO ( 3, 0, 4, 64, FALSE, 0, complain_overflow_bitfield,0,"64", TRUE, 0xdeaddead,0xdeaddead, FALSE), +HOWTO ( 4, 0, 0, 8, TRUE, 0, complain_overflow_signed, 0,"DISP8", TRUE, 0x000000ff,0x000000ff, FALSE), +HOWTO ( 5, 0, 1, 16, TRUE, 0, complain_overflow_signed, 0,"DISP16", TRUE, 0x0000ffff,0x0000ffff, FALSE), +HOWTO ( 6, 0, 2, 32, TRUE, 0, complain_overflow_signed, 0,"DISP32", TRUE, 0xffffffff,0xffffffff, FALSE), +HOWTO ( 7, 0, 4, 64, TRUE, 0, complain_overflow_signed, 0,"DISP64", TRUE, 0xfeedface,0xfeedface, FALSE), +HOWTO ( 8, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"GOT_REL", FALSE, 0,0x00000000, FALSE), +HOWTO ( 9, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,0,"BASE16", FALSE,0xffffffff,0xffffffff, FALSE), +HOWTO (10, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"BASE32", FALSE,0xffffffff,0xffffffff, FALSE), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), - HOWTO (16, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"JMP_TABLE", false, 0,0x00000000, false), + HOWTO (16, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"JMP_TABLE", FALSE, 0,0x00000000, FALSE), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), @@ -260,7 +262,7 @@ EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), - HOWTO (32, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"RELATIVE", false, 0,0x00000000, false), + HOWTO (32, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"RELATIVE", FALSE, 0,0x00000000, FALSE), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), @@ -268,7 +270,7 @@ EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), - HOWTO (40, 0, 2, 0, false, 0, complain_overflow_bitfield,0,"BASEREL", false, 0,0x00000000, false), + HOWTO (40, 0, 2, 0, FALSE, 0, complain_overflow_bitfield,0,"BASEREL", FALSE, 0,0x00000000, FALSE), }; #define TABLE_SIZE(TABLE) (sizeof (TABLE) / sizeof (TABLE[0])) @@ -281,6 +283,7 @@ NAME(aout,reloc_type_lookup) (abfd,code) #define EXT(i, j) case i: return &howto_table_ext[j] #define STD(i, j) case i: return &howto_table_std[j] int ext = obj_reloc_entry_size (abfd) == RELOC_EXT_SIZE; + if (code == BFD_RELOC_CTOR) switch (bfd_get_arch_info (abfd)->bits_per_address) { @@ -291,6 +294,7 @@ NAME(aout,reloc_type_lookup) (abfd,code) code = BFD_RELOC_64; break; } + if (ext) switch (code) { @@ -313,9 +317,10 @@ NAME(aout,reloc_type_lookup) (abfd,code) default: return (reloc_howto_type *) NULL; } else - /* std relocs */ + /* std relocs. */ switch (code) { + STD (BFD_RELOC_8, 0); STD (BFD_RELOC_16, 1); STD (BFD_RELOC_32, 2); STD (BFD_RELOC_8_PCREL, 4); @@ -416,20 +421,20 @@ NAME(aout,swap_exec_header_out) (abfd, execp, raw_bytes) /* Make all the section for an a.out file. */ -boolean +bfd_boolean NAME(aout,make_sections) (abfd) bfd *abfd; { if (obj_textsec (abfd) == (asection *) NULL && bfd_make_section (abfd, ".text") == (asection *) NULL) - return false; + return FALSE; if (obj_datasec (abfd) == (asection *) NULL && bfd_make_section (abfd, ".data") == (asection *) NULL) - return false; + return FALSE; if (obj_bsssec (abfd) == (asection *) NULL && bfd_make_section (abfd, ".bss") == (asection *) NULL) - return false; - return true; + return FALSE; + return TRUE; } /* @@ -474,14 +479,15 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p) *abfd->tdata.aout_data = *oldrawptr; abfd->tdata.aout_data->a.hdr = &rawptr->e; - *(abfd->tdata.aout_data->a.hdr) = *execp; /* Copy in the internal_exec struct */ + /* Copy in the internal_exec struct. */ + *(abfd->tdata.aout_data->a.hdr) = *execp; execp = abfd->tdata.aout_data->a.hdr; - /* Set the file flags */ + /* Set the file flags. */ abfd->flags = BFD_NO_FLAGS; if (execp->a_drsize || execp->a_trsize) abfd->flags |= HAS_RELOC; - /* Setting of EXEC_P has been deferred to the bottom of this function */ + /* Setting of EXEC_P has been deferred to the bottom of this function. */ if (execp->a_syms) abfd->flags |= HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS; if (N_DYNAMIC (*execp)) @@ -563,18 +569,18 @@ NAME(aout,some_aout_object_p) (abfd, execp, callback_to_real_object_p) obj_textsec (abfd)->size = N_TXTSIZE (*execp); obj_textsec (abfd)->raw_size = N_TXTSIZE (*execp); - /* data and bss are already filled in since they're so standard */ + /* Data and bss are already filled in since they're so standard. */ - /* The virtual memory addresses of the sections */ + /* The virtual memory addresses of the sections. */ obj_textsec (abfd)->vma = N_TXTADDR (*execp); obj_datasec (abfd)->vma = N_DATADDR (*execp); obj_bsssec (abfd)->vma = N_BSSADDR (*execp); - /* The file offsets of the sections */ + /* The file offsets of the sections. */ obj_textsec (abfd)->filepos = N_TXTOFF (*execp); obj_datasec (abfd)->filepos = N_DATOFF (*execp); - /* The file offsets of the relocation info */ + /* The file offsets of the relocation info. */ obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp); obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp); @@ -669,13 +675,13 @@ FUNCTION aout_@var{size}_mkobject SYNOPSIS - boolean aout_@var{size}_mkobject, (bfd *abfd); + bfd_boolean aout_@var{size}_mkobject, (bfd *abfd); DESCRIPTION Initialize BFD @var{abfd} for use with a.out files. */ -boolean +bfd_boolean NAME(aout,mkobject) (abfd) bfd *abfd; { @@ -686,7 +692,7 @@ NAME(aout,mkobject) (abfd) rawptr = (struct aout_data_struct *) bfd_zalloc (abfd, amt); if (rawptr == NULL) - return false; + return FALSE; abfd->tdata.aout_data = rawptr; exec_hdr (abfd) = &(rawptr->e); @@ -695,7 +701,7 @@ NAME(aout,mkobject) (abfd) obj_datasec (abfd) = (asection *) NULL; obj_bsssec (abfd) = (asection *) NULL; - return true; + return TRUE; } /* @@ -721,12 +727,12 @@ enum machine_type NAME(aout,machine_type) (arch, machine, unknown) enum bfd_architecture arch; unsigned long machine; - boolean *unknown; + bfd_boolean *unknown; { enum machine_type arch_flags; arch_flags = M_UNKNOWN; - *unknown = true; + *unknown = TRUE; switch (arch) { @@ -745,7 +751,7 @@ NAME(aout,machine_type) (arch, machine, unknown) switch (machine) { case 0: arch_flags = M_68010; break; - case bfd_mach_m68000: arch_flags = M_UNKNOWN; *unknown = false; break; + case bfd_mach_m68000: arch_flags = M_UNKNOWN; *unknown = FALSE; break; case bfd_mach_m68010: arch_flags = M_68010; break; case bfd_mach_m68020: arch_flags = M_68020; break; default: arch_flags = M_UNKNOWN; break; @@ -753,7 +759,9 @@ NAME(aout,machine_type) (arch, machine, unknown) break; case bfd_arch_i386: - if (machine == 0) + if (machine == 0 + || machine == bfd_mach_i386_i386 + || machine == bfd_mach_i386_i386_intel_syntax) arch_flags = M_386; break; @@ -790,8 +798,10 @@ NAME(aout,machine_type) (arch, machine, unknown) case bfd_mach_mips12000: case bfd_mach_mips16: case bfd_mach_mipsisa32: + case bfd_mach_mipsisa32r2: case bfd_mach_mips5: case bfd_mach_mipsisa64: + case bfd_mach_mipsisa64r2: case bfd_mach_mips_sb1: /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc. */ arch_flags = M_MIPS2; @@ -813,7 +823,7 @@ NAME(aout,machine_type) (arch, machine, unknown) break; case bfd_arch_vax: - *unknown = false; + *unknown = FALSE; break; case bfd_arch_cris: @@ -826,7 +836,7 @@ NAME(aout,machine_type) (arch, machine, unknown) } if (arch_flags != M_UNKNOWN) - *unknown = false; + *unknown = FALSE; return arch_flags; } @@ -836,7 +846,7 @@ FUNCTION aout_@var{size}_set_arch_mach SYNOPSIS - boolean aout_@var{size}_set_arch_mach, + bfd_boolean aout_@var{size}_set_arch_mach, (bfd *, enum bfd_architecture arch, unsigned long machine)); @@ -847,25 +857,25 @@ DESCRIPTION can support the architecture required. */ -boolean +bfd_boolean NAME(aout,set_arch_mach) (abfd, arch, machine) bfd *abfd; enum bfd_architecture arch; unsigned long machine; { if (! bfd_default_set_arch_mach (abfd, arch, machine)) - return false; + return FALSE; if (arch != bfd_arch_unknown) { - boolean unknown; + bfd_boolean unknown; NAME(aout,machine_type) (arch, machine, &unknown); if (unknown) - return false; + return FALSE; } - /* Determine the size of a relocation entry */ + /* Determine the size of a relocation entry. */ switch (arch) { case bfd_arch_sparc: @@ -903,7 +913,7 @@ adjust_o_magic (abfd, execp) /* Data. */ if (!obj_datasec (abfd)->user_set_vma) { -#if 0 /* ?? Does alignment in the file image really matter? */ +#if 0 /* ?? Does alignment in the file image really matter? */ pad = align_power (vma, obj_datasec (abfd)->alignment_power) - vma; #endif obj_textsec (abfd)->_raw_size += pad; @@ -1110,7 +1120,7 @@ adjust_n_magic (abfd, execp) N_SET_MAGIC (*execp, NMAGIC); } -boolean +bfd_boolean NAME(aout,adjust_sizes_and_vmas) (abfd, text_size, text_end) bfd *abfd; bfd_size_type *text_size; @@ -1119,10 +1129,10 @@ NAME(aout,adjust_sizes_and_vmas) (abfd, text_size, text_end) struct internal_exec *execp = exec_hdr (abfd); if (! NAME(aout,make_sections) (abfd)) - return false; + return FALSE; if (adata (abfd).magic != undecided_magic) - return true; + return TRUE; obj_textsec (abfd)->_raw_size = align_power (obj_textsec (abfd)->_raw_size, @@ -1199,7 +1209,7 @@ NAME(aout,adjust_sizes_and_vmas) (abfd, text_size, text_end) obj_bsssec (abfd)->vma, obj_bsssec (abfd)->_raw_size); #endif - return true; + return TRUE; } /* @@ -1207,7 +1217,7 @@ FUNCTION aout_@var{size}_new_section_hook SYNOPSIS - boolean aout_@var{size}_new_section_hook, + bfd_boolean aout_@var{size}_new_section_hook, (bfd *abfd, asection *newsect)); @@ -1215,48 +1225,47 @@ DESCRIPTION Called by the BFD in response to a @code{bfd_make_section} request. */ -boolean +bfd_boolean NAME(aout,new_section_hook) (abfd, newsect) bfd *abfd; asection *newsect; { - /* align to double at least */ + /* Align to double at least. */ newsect->alignment_power = bfd_get_arch_info (abfd)->section_align_power; if (bfd_get_format (abfd) == bfd_object) - { - if (obj_textsec (abfd) == NULL && !strcmp (newsect->name, ".text")) - { - obj_textsec (abfd)= newsect; - newsect->target_index = N_TEXT; - return true; - } - - if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data")) - { - obj_datasec (abfd) = newsect; - newsect->target_index = N_DATA; - return true; - } + { + if (obj_textsec (abfd) == NULL && !strcmp (newsect->name, ".text")) + { + obj_textsec (abfd)= newsect; + newsect->target_index = N_TEXT; + return TRUE; + } - if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss")) - { - obj_bsssec (abfd) = newsect; - newsect->target_index = N_BSS; - return true; - } + if (obj_datasec (abfd) == NULL && !strcmp (newsect->name, ".data")) + { + obj_datasec (abfd) = newsect; + newsect->target_index = N_DATA; + return TRUE; + } - } + if (obj_bsssec (abfd) == NULL && !strcmp (newsect->name, ".bss")) + { + obj_bsssec (abfd) = newsect; + newsect->target_index = N_BSS; + return TRUE; + } + } - /* We allow more than three sections internally */ - return true; + /* We allow more than three sections internally. */ + return TRUE; } -boolean +bfd_boolean NAME(aout,set_section_contents) (abfd, section, location, offset, count) bfd *abfd; sec_ptr section; - PTR location; + const PTR location; file_ptr offset; bfd_size_type count; { @@ -1266,38 +1275,44 @@ NAME(aout,set_section_contents) (abfd, section, location, offset, count) if (! abfd->output_has_begun) { if (! NAME(aout,adjust_sizes_and_vmas) (abfd, &text_size, &text_end)) - return false; + return FALSE; } if (section == obj_bsssec (abfd)) { bfd_set_error (bfd_error_no_contents); - return false; + return FALSE; } if (section != obj_textsec (abfd) && section != obj_datasec (abfd)) { - (*_bfd_error_handler) - (_("%s: can not represent section `%s' in a.out object file format"), - bfd_get_filename (abfd), bfd_get_section_name (abfd, section)); - bfd_set_error (bfd_error_nonrepresentable_section); - return false; + if (aout_section_merge_with_text_p (abfd, section)) + section->filepos = obj_textsec (abfd)->filepos + + (section->vma - obj_textsec (abfd)->vma); + else + { + (*_bfd_error_handler) + (_("%s: can not represent section `%s' in a.out object file format"), + bfd_get_filename (abfd), bfd_get_section_name (abfd, section)); + bfd_set_error (bfd_error_nonrepresentable_section); + return FALSE; + } } if (count != 0) { if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0 || bfd_bwrite (location, count, abfd) != count) - return false; + return FALSE; } - return true; + return TRUE; } /* Read the external symbols from an a.out file. */ -static boolean +static bfd_boolean aout_get_external_symbols (abfd) bfd *abfd; { @@ -1312,8 +1327,8 @@ aout_get_external_symbols (abfd) #ifdef USE_MMAP if (! bfd_get_file_window (abfd, obj_sym_filepos (abfd), exec_hdr (abfd)->a_syms, - &obj_aout_sym_window (abfd), true)) - return false; + &obj_aout_sym_window (abfd), TRUE)) + return FALSE; syms = (struct external_nlist *) obj_aout_sym_window (abfd).data; #else /* We allocate using malloc to make the values easy to free @@ -1322,14 +1337,14 @@ aout_get_external_symbols (abfd) syms = ((struct external_nlist *) bfd_malloc (count * EXTERNAL_NLIST_SIZE)); if (syms == (struct external_nlist *) NULL && count != 0) - return false; + return FALSE; amt = exec_hdr (abfd)->a_syms; if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0 || bfd_bread (syms, amt, abfd) != amt) { free (syms); - return false; + return FALSE; } #endif @@ -1348,18 +1363,18 @@ aout_get_external_symbols (abfd) /* Get the size of the strings. */ if (bfd_seek (abfd, obj_str_filepos (abfd), SEEK_SET) != 0 || bfd_bread ((PTR) string_chars, amt, abfd) != amt) - return false; + return FALSE; stringsize = GET_WORD (abfd, string_chars); #ifdef USE_MMAP if (! bfd_get_file_window (abfd, obj_str_filepos (abfd), stringsize, - &obj_aout_string_window (abfd), true)) - return false; + &obj_aout_string_window (abfd), TRUE)) + return FALSE; strings = (char *) obj_aout_string_window (abfd).data; #else strings = (char *) bfd_malloc (stringsize + 1); if (strings == NULL) - return false; + return FALSE; /* Skip space for the string count in the buffer for convenience when using indexes. */ @@ -1367,7 +1382,7 @@ aout_get_external_symbols (abfd) if (bfd_bread (strings + BYTES_IN_WORD, amt, abfd) != amt) { free (strings); - return false; + return FALSE; } #endif @@ -1380,7 +1395,7 @@ aout_get_external_symbols (abfd) obj_aout_external_string_size (abfd) = stringsize; } - return true; + return TRUE; } /* Translate an a.out symbol into a BFD symbol. The desc, other, type @@ -1388,7 +1403,7 @@ aout_get_external_symbols (abfd) nlist structure. This function is responsible for setting symbol->flags and symbol->section, and adjusting symbol->value. */ -static boolean +static bfd_boolean translate_from_native_sym_flags (abfd, cache_ptr) bfd *abfd; aout_symbol_type *cache_ptr; @@ -1401,7 +1416,6 @@ translate_from_native_sym_flags (abfd, cache_ptr) asection *sec; /* This is a debugging symbol. */ - cache_ptr->symbol.flags = BSF_DEBUGGING; /* Work out the symbol section. */ @@ -1426,7 +1440,7 @@ translate_from_native_sym_flags (abfd, cache_ptr) cache_ptr->symbol.section = sec; cache_ptr->symbol.value -= sec->vma; - return true; + return TRUE; } /* Get the default visibility. This does not apply to all types, so @@ -1515,18 +1529,18 @@ translate_from_native_sym_flags (abfd, cache_ptr) amt = strlen (cache_ptr->symbol.name) + 1; copy = bfd_alloc (abfd, amt); if (copy == NULL) - return false; + return FALSE; strcpy (copy, cache_ptr->symbol.name); section = bfd_make_section (abfd, copy); if (section == NULL) - return false; + return FALSE; } amt = sizeof (arelent_chain); reloc = (arelent_chain *) bfd_alloc (abfd, amt); if (reloc == NULL) - return false; + return FALSE; /* Build a relocation entry for the constructor. */ switch (cache_ptr->type & N_TYPE) @@ -1639,12 +1653,12 @@ translate_from_native_sym_flags (abfd, cache_ptr) break; } - return true; + return TRUE; } /* Set the fields of SYM_POINTER according to CACHE_PTR. */ -static boolean +static bfd_boolean translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer) bfd *abfd; asymbol *cache_ptr; @@ -1670,7 +1684,7 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer) bfd_get_filename (abfd), cache_ptr->name != NULL ? cache_ptr->name : _("*unknown*")); bfd_set_error (bfd_error_nonrepresentable_section); - return false; + return FALSE; } if (sec->output_section != NULL) @@ -1695,14 +1709,19 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer) sym_pointer->e_type[0] = N_UNDF | N_EXT; else { - (*_bfd_error_handler) - (_("%s: can not represent section `%s' in a.out object file format"), - bfd_get_filename (abfd), bfd_get_section_name (abfd, sec)); - bfd_set_error (bfd_error_nonrepresentable_section); - return false; + if (aout_section_merge_with_text_p (abfd, sec)) + sym_pointer->e_type[0] |= N_TEXT; + else + { + (*_bfd_error_handler) + (_("%s: can not represent section `%s' in a.out object file format"), + bfd_get_filename (abfd), bfd_get_section_name (abfd, sec)); + bfd_set_error (bfd_error_nonrepresentable_section); + return FALSE; + } } - /* Turn the symbol from section relative to absolute again */ + /* Turn the symbol from section relative to absolute again. */ value += sec->vma + off; if ((cache_ptr->flags & BSF_WARNING) != 0) @@ -1718,6 +1737,7 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer) if ((cache_ptr->flags & BSF_CONSTRUCTOR) != 0) { int type = ((aout_symbol_type *) cache_ptr)->type; + switch (type) { case N_ABS: type = N_SETA; break; @@ -1746,7 +1766,7 @@ translate_to_native_sym_flags (abfd, cache_ptr, sym_pointer) PUT_WORD (abfd, value, sym_pointer->e_value); - return true; + return TRUE; } /* Native-level interface to symbols. */ @@ -1766,7 +1786,7 @@ NAME(aout,make_empty_symbol) (abfd) /* Translate a set of internal symbols into external symbols. */ -boolean +bfd_boolean NAME(aout,translate_symbol_table) (abfd, in, ext, count, str, strsize, dynamic) bfd *abfd; aout_symbol_type *in; @@ -1774,7 +1794,7 @@ NAME(aout,translate_symbol_table) (abfd, in, ext, count, str, strsize, dynamic) bfd_size_type count; char *str; bfd_size_type strsize; - boolean dynamic; + bfd_boolean dynamic; { struct external_nlist *ext_end; @@ -1796,7 +1816,7 @@ NAME(aout,translate_symbol_table) (abfd, in, ext, count, str, strsize, dynamic) else if (x < strsize) in->symbol.name = str + x; else - return false; + return FALSE; in->symbol.value = GET_SWORD (abfd, ext->e_value); in->desc = H_GET_16 (abfd, ext->e_desc); @@ -1805,20 +1825,20 @@ NAME(aout,translate_symbol_table) (abfd, in, ext, count, str, strsize, dynamic) in->symbol.udata.p = NULL; if (! translate_from_native_sym_flags (abfd, in)) - return false; + return FALSE; if (dynamic) in->symbol.flags |= BSF_DYNAMIC; } - return true; + return TRUE; } /* We read the symbols into a buffer, which is discarded when this function exits. We read the strings into a buffer large enough to hold them all plus all the cached symbol entries. */ -boolean +bfd_boolean NAME(aout,slurp_symbol_table) (abfd) bfd *abfd; { @@ -1826,20 +1846,20 @@ NAME(aout,slurp_symbol_table) (abfd) aout_symbol_type *cached; bfd_size_type cached_size; - /* If there's no work to be done, don't do any */ + /* If there's no work to be done, don't do any. */ if (obj_aout_symbols (abfd) != (aout_symbol_type *) NULL) - return true; + return TRUE; old_external_syms = obj_aout_external_syms (abfd); if (! aout_get_external_symbols (abfd)) - return false; + return FALSE; cached_size = obj_aout_external_sym_count (abfd); cached_size *= sizeof (aout_symbol_type); cached = (aout_symbol_type *) bfd_zmalloc (cached_size); if (cached == NULL && cached_size != 0) - return false; + return FALSE; /* Convert from external symbol information to internal. */ if (! (NAME(aout,translate_symbol_table) @@ -1848,10 +1868,10 @@ NAME(aout,slurp_symbol_table) (abfd) obj_aout_external_sym_count (abfd), obj_aout_external_strings (abfd), obj_aout_external_string_size (abfd), - false))) + FALSE))) { free (cached); - return false; + return FALSE; } bfd_get_symcount (abfd) = obj_aout_external_sym_count (abfd); @@ -1873,7 +1893,7 @@ NAME(aout,slurp_symbol_table) (abfd) obj_aout_external_syms (abfd) = NULL; } - return true; + return TRUE; } /* We use a hash table when writing out symbols so that we only write @@ -1886,8 +1906,9 @@ NAME(aout,slurp_symbol_table) (abfd) if BFD_TRADITIONAL_FORMAT is set. */ static bfd_size_type add_to_stringtab - PARAMS ((bfd *, struct bfd_strtab_hash *, const char *, boolean)); -static boolean emit_stringtab PARAMS ((bfd *, struct bfd_strtab_hash *)); + PARAMS ((bfd *, struct bfd_strtab_hash *, const char *, bfd_boolean)); +static bfd_boolean emit_stringtab + PARAMS ((bfd *, struct bfd_strtab_hash *)); /* Get the index of a string in a strtab, adding it if it is not already present. */ @@ -1897,9 +1918,9 @@ add_to_stringtab (abfd, tab, str, copy) bfd *abfd; struct bfd_strtab_hash *tab; const char *str; - boolean copy; + bfd_boolean copy; { - boolean hash; + bfd_boolean hash; bfd_size_type index; /* An index of 0 always means the empty string. */ @@ -1908,9 +1929,9 @@ add_to_stringtab (abfd, tab, str, copy) /* Don't hash if BFD_TRADITIONAL_FORMAT is set, because SunOS dbx doesn't understand a hashed string table. */ - hash = true; + hash = TRUE; if ((abfd->flags & BFD_TRADITIONAL_FORMAT) != 0) - hash = false; + hash = FALSE; index = _bfd_stringtab_add (tab, str, hash, copy); @@ -1927,7 +1948,7 @@ add_to_stringtab (abfd, tab, str, copy) /* Write out a strtab. ABFD is already at the right location in the file. */ -static boolean +static bfd_boolean emit_stringtab (abfd, tab) register bfd *abfd; struct bfd_strtab_hash *tab; @@ -1938,12 +1959,12 @@ emit_stringtab (abfd, tab) /* The string table starts with the size. */ PUT_WORD (abfd, _bfd_stringtab_size (tab) + BYTES_IN_WORD, buffer); if (bfd_bwrite ((PTR) buffer, amt, abfd) != amt) - return false; + return FALSE; return _bfd_stringtab_emit (abfd, tab); } -boolean +bfd_boolean NAME(aout,write_syms) (abfd) bfd *abfd; { @@ -1953,7 +1974,7 @@ NAME(aout,write_syms) (abfd) strtab = _bfd_stringtab_init (); if (strtab == NULL) - return false; + return FALSE; for (count = 0; count < bfd_get_symcount (abfd); count++) { @@ -1962,7 +1983,7 @@ NAME(aout,write_syms) (abfd) struct external_nlist nsp; bfd_size_type amt; - indx = add_to_stringtab (abfd, strtab, g->name, false); + indx = add_to_stringtab (abfd, strtab, g->name, FALSE); if (indx == (bfd_size_type) -1) goto error_return; PUT_WORD (abfd, indx, (bfd_byte *) nsp.e_strx); @@ -1997,15 +2018,15 @@ NAME(aout,write_syms) (abfd) _bfd_stringtab_free (strtab); - return true; + return TRUE; error_return: _bfd_stringtab_free (strtab); - return false; + return FALSE; } long -NAME(aout,get_symtab) (abfd, location) +NAME(aout,canonicalize_symtab) (abfd, location) bfd *abfd; asymbol **location; { @@ -2023,7 +2044,7 @@ NAME(aout,get_symtab) (abfd, location) return bfd_get_symcount (abfd); } -/* Standard reloc stuff */ +/* Standard reloc stuff. */ /* Output standard relocation information to a file in target byte order. */ extern void NAME(aout,swap_std_reloc_out) @@ -2045,8 +2066,8 @@ NAME(aout,swap_std_reloc_out) (abfd, g, natptr) PUT_WORD (abfd, g->address, natptr->r_address); - r_length = g->howto->size ; /* Size as a power of two */ - r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */ + r_length = g->howto->size ; /* Size as a power of two. */ + r_pcrel = (int) g->howto->pc_relative; /* Relative to PC? */ /* XXX This relies on relocs coming from a.out files. */ r_baserel = (g->howto->type & 8) != 0; r_jmptable = (g->howto->type & 16) != 0; @@ -2057,43 +2078,41 @@ NAME(aout,swap_std_reloc_out) (abfd, g, natptr) r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma; #endif - /* name was clobbered by aout_write_syms to be symbol index */ + /* Name was clobbered by aout_write_syms to be symbol index. */ /* 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 - */ + check for that here. */ if (bfd_is_com_section (output_section) || bfd_is_abs_section (output_section) || bfd_is_und_section (output_section)) { if (bfd_abs_section_ptr->symbol == sym) - { - /* Whoops, looked like an abs symbol, but is really an offset - from the abs section */ - r_index = N_ABS; - r_extern = 0; - } + { + /* Whoops, looked like an abs symbol, but is + really an offset from the abs section. */ + r_index = N_ABS; + r_extern = 0; + } else - { - /* Fill in symbol */ - r_extern = 1; - r_index = (*(g->sym_ptr_ptr))->KEEPIT; - - } + { + /* Fill in symbol. */ + r_extern = 1; + r_index = (*(g->sym_ptr_ptr))->KEEPIT; + } } else { - /* Just an ordinary section */ + /* Just an ordinary section. */ r_extern = 0; r_index = output_section->target_index; } - /* now the fun stuff */ + /* Now the fun stuff. */ if (bfd_header_big_endian (abfd)) { natptr->r_index[0] = r_index >> 16; @@ -2120,7 +2139,7 @@ NAME(aout,swap_std_reloc_out) (abfd, g, natptr) } } -/* Extended stuff */ +/* Extended stuff. */ /* Output extended relocation information to a file in target byte order. */ extern void NAME(aout,swap_ext_reloc_out) @@ -2153,7 +2172,6 @@ NAME(aout,swap_ext_reloc_out) (abfd, g, natptr) 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; @@ -2170,12 +2188,12 @@ NAME(aout,swap_ext_reloc_out) (abfd, g, natptr) } else { - /* Just an ordinary section */ + /* Just an ordinary section. */ r_extern = 0; r_index = output_section->target_index; } - /* now the fun stuff */ + /* Now the fun stuff. */ if (bfd_header_big_endian (abfd)) { natptr->r_index[0] = r_index >> 16; @@ -2256,7 +2274,7 @@ NAME(aout,swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount) cache_ptr->address = (GET_SWORD (abfd, bytes->r_address)); - /* now the fun stuff */ + /* Now the fun stuff. */ if (bfd_header_big_endian (abfd)) { r_index = (((unsigned int) bytes->r_index[0] << 16) @@ -2315,7 +2333,7 @@ NAME(aout,swap_std_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount) cache_ptr->address = H_GET_32 (abfd, bytes->r_address); - /* now the fun stuff */ + /* Now the fun stuff. */ if (bfd_header_big_endian (abfd)) { r_index = (((unsigned int) bytes->r_index[0] << 16) @@ -2368,7 +2386,7 @@ NAME(aout,swap_std_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount) /* Read and swap the relocs for a section. */ -boolean +bfd_boolean NAME(aout,slurp_reloc_table) (abfd, asect, symbols) bfd *abfd; sec_ptr asect; @@ -2384,10 +2402,10 @@ NAME(aout,slurp_reloc_table) (abfd, asect, symbols) bfd_size_type amt; if (asect->relocation) - return true; + return TRUE; if (asect->flags & SEC_CONSTRUCTOR) - return true; + return TRUE; if (asect == obj_datasec (abfd)) reloc_size = exec_hdr (abfd)->a_drsize; @@ -2398,11 +2416,11 @@ NAME(aout,slurp_reloc_table) (abfd, asect, symbols) else { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } if (bfd_seek (abfd, asect->rel_filepos, SEEK_SET) != 0) - return false; + return FALSE; each_size = obj_reloc_entry_size (abfd); @@ -2411,20 +2429,20 @@ NAME(aout,slurp_reloc_table) (abfd, asect, symbols) amt = count * sizeof (arelent); reloc_cache = (arelent *) bfd_zmalloc (amt); if (reloc_cache == NULL && count != 0) - return false; + return FALSE; relocs = bfd_malloc (reloc_size); if (relocs == NULL && reloc_size != 0) { free (reloc_cache); - return false; + return FALSE; } if (bfd_bread (relocs, reloc_size, abfd) != reloc_size) { free (relocs); free (reloc_cache); - return false; + return FALSE; } cache_ptr = reloc_cache; @@ -2450,12 +2468,12 @@ NAME(aout,slurp_reloc_table) (abfd, asect, symbols) asect->relocation = reloc_cache; asect->reloc_count = cache_ptr - reloc_cache; - return true; + return TRUE; } /* Write out a relocation section into an object file. */ -boolean +bfd_boolean NAME(aout,squirt_out_relocs) (abfd, section) bfd *abfd; asection *section; @@ -2468,13 +2486,13 @@ NAME(aout,squirt_out_relocs) (abfd, section) bfd_size_type natsize; if (count == 0 || section->orelocation == NULL) - return true; + return TRUE; each_size = obj_reloc_entry_size (abfd); natsize = (bfd_size_type) each_size * count; native = (unsigned char *) bfd_zalloc (abfd, natsize); if (!native) - return false; + return FALSE; generic = section->orelocation; @@ -2498,14 +2516,15 @@ NAME(aout,squirt_out_relocs) (abfd, section) if (bfd_bwrite ((PTR) native, natsize, abfd) != natsize) { bfd_release (abfd, native); - return false; + return FALSE; } bfd_release (abfd, native); - return true; + return TRUE; } -/* This is stupid. This function should be a boolean predicate */ +/* This is stupid. This function should be a boolean predicate. */ + long NAME(aout,canonicalize_reloc) (abfd, section, relptr, symbols) bfd *abfd; @@ -2558,10 +2577,9 @@ NAME(aout,get_reloc_upper_bound) (abfd, asect) bfd_set_error (bfd_error_invalid_operation); return -1; } + if (asect->flags & SEC_CONSTRUCTOR) - { - return (sizeof (arelent *) * (asect->reloc_count+1)); - } + return (sizeof (arelent *) * (asect->reloc_count+1)); if (asect == obj_datasec (abfd)) return (sizeof (arelent *) @@ -2679,7 +2697,7 @@ NAME(aout,print_symbol) (abfd, afile, symbol, how) long NAME(aout,read_minisymbols) (abfd, dynamic, minisymsp, sizep) bfd *abfd; - boolean dynamic; + bfd_boolean dynamic; PTR *minisymsp; unsigned int *sizep; { @@ -2715,7 +2733,7 @@ NAME(aout,read_minisymbols) (abfd, dynamic, minisymsp, sizep) asymbol * NAME(aout,minisymbol_to_symbol) (abfd, dynamic, minisym, sym) bfd *abfd; - boolean dynamic; + bfd_boolean dynamic; const PTR minisym; asymbol *sym; { @@ -2733,19 +2751,17 @@ NAME(aout,minisymbol_to_symbol) (abfd, dynamic, minisym, sym) (bfd_size_type) 1, obj_aout_external_strings (abfd), obj_aout_external_string_size (abfd), - false))) + FALSE))) return NULL; return sym; } -/* - 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. -*/ +/* 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. */ -boolean +bfd_boolean NAME(aout,find_nearest_line) (abfd, section, symbols, offset, filename_ptr, functionname_ptr, line_ptr) bfd *abfd; @@ -2756,7 +2772,7 @@ NAME(aout,find_nearest_line) const char **functionname_ptr; unsigned int *line_ptr; { - /* Run down the file looking for the filename, function and linenumber */ + /* Run down the file looking for the filename, function and linenumber. */ asymbol **p; const char *directory_name = NULL; const char *main_file_name = NULL; @@ -2772,6 +2788,7 @@ NAME(aout,find_nearest_line) *filename_ptr = abfd->filename; *functionname_ptr = 0; *line_ptr = 0; + if (symbols != (asymbol **)NULL) { for (p = symbols; *p; p++) @@ -2859,12 +2876,13 @@ NAME(aout,find_nearest_line) break; case N_FUN: { - /* We'll keep this if it is nearer than the one we have already */ + /* We'll keep this if it is nearer than the one we have already. */ if (q->symbol.value >= low_func_vma && - q->symbol.value <= offset) { - low_func_vma = q->symbol.value; - func = (asymbol *)q; - } + q->symbol.value <= offset) + { + low_func_vma = q->symbol.value; + func = (asymbol *)q; + } else if (q->symbol.value > offset) goto done; } @@ -2886,6 +2904,7 @@ NAME(aout,find_nearest_line) filelen = 0; else filelen = strlen (directory_name) + strlen (main_file_name); + if (func == NULL) funclen = 0; else @@ -2893,6 +2912,7 @@ NAME(aout,find_nearest_line) if (adata (abfd).line_buf != NULL) free (adata (abfd).line_buf); + if (filelen + funclen == 0) adata (abfd).line_buf = buf = NULL; else @@ -2900,7 +2920,7 @@ NAME(aout,find_nearest_line) buf = (char *) bfd_malloc (filelen + funclen + 3); adata (abfd).line_buf = buf; if (buf == NULL) - return false; + return FALSE; } if (main_file_name != NULL) @@ -2930,20 +2950,20 @@ NAME(aout,find_nearest_line) buf[0] = bfd_get_symbol_leading_char (abfd); strcpy (buf + 1, function); } - /* Have to remove : stuff */ + /* Have to remove : stuff. */ colon = strchr (buf, ':'); if (colon != NULL) *colon = '\0'; *functionname_ptr = buf; } - return true; + return TRUE; } int NAME(aout,sizeof_headers) (abfd, execable) bfd *abfd; - boolean execable ATTRIBUTE_UNUSED; + bfd_boolean execable ATTRIBUTE_UNUSED; { return adata (abfd).exec_bytes_size; } @@ -2951,7 +2971,7 @@ NAME(aout,sizeof_headers) (abfd, execable) /* Free all information we have cached for this BFD. We can always read it again later if we need it. */ -boolean +bfd_boolean NAME(aout,bfd_free_cached_info) (abfd) bfd *abfd; { @@ -2959,7 +2979,7 @@ NAME(aout,bfd_free_cached_info) (abfd) if (bfd_get_format (abfd) != bfd_object || abfd->tdata.aout_data == NULL) - return true; + return TRUE; #define BFCI_FREE(x) if (x != NULL) { free (x); x = NULL; } BFCI_FREE (obj_aout_symbols (abfd)); @@ -2976,19 +2996,20 @@ NAME(aout,bfd_free_cached_info) (abfd) BFCI_FREE (o->relocation); #undef BFCI_FREE - return true; + return TRUE; } /* a.out link code. */ -static boolean aout_link_add_object_symbols +static bfd_boolean aout_link_add_object_symbols PARAMS ((bfd *, struct bfd_link_info *)); -static boolean aout_link_check_archive_element - PARAMS ((bfd *, struct bfd_link_info *, boolean *)); -static boolean aout_link_free_symbols PARAMS ((bfd *)); -static boolean aout_link_check_ar_symbols - PARAMS ((bfd *, struct bfd_link_info *, boolean *pneeded)); -static boolean aout_link_add_symbols +static bfd_boolean aout_link_check_archive_element + PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *)); +static bfd_boolean aout_link_free_symbols + PARAMS ((bfd *)); +static bfd_boolean aout_link_check_ar_symbols + PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *pneeded)); +static bfd_boolean aout_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); /* Routine to create an entry in an a.out link hash table. */ @@ -3016,7 +3037,7 @@ NAME(aout,link_hash_newfunc) (entry, table, string) if (ret) { /* Set local fields. */ - ret->written = false; + ret->written = FALSE; ret->indx = -1; } @@ -3025,13 +3046,13 @@ NAME(aout,link_hash_newfunc) (entry, table, string) /* Initialize an a.out link hash table. */ -boolean +bfd_boolean NAME(aout,link_hash_table_init) (table, abfd, newfunc) struct aout_link_hash_table *table; bfd *abfd; - struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *)); + struct bfd_hash_entry *(*newfunc) + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, + const char *)); { return _bfd_link_hash_table_init (&table->root, abfd, newfunc); } @@ -3045,9 +3066,10 @@ NAME(aout,link_hash_table_create) (abfd) struct aout_link_hash_table *ret; bfd_size_type amt = sizeof (struct aout_link_hash_table); - ret = (struct aout_link_hash_table *) bfd_alloc (abfd, amt); + ret = (struct aout_link_hash_table *) bfd_malloc (amt); if (ret == NULL) return (struct bfd_link_hash_table *) NULL; + if (! NAME(aout,link_hash_table_init) (ret, abfd, NAME(aout,link_hash_newfunc))) { @@ -3060,7 +3082,7 @@ NAME(aout,link_hash_table_create) (abfd) /* Given an a.out BFD, add symbols to the global hash table as appropriate. */ -boolean +bfd_boolean NAME(aout,link_add_symbols) (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -3074,27 +3096,27 @@ NAME(aout,link_add_symbols) (abfd, info) (abfd, info, aout_link_check_archive_element); default: bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; } } /* Add symbols from an a.out object file. */ -static boolean +static bfd_boolean aout_link_add_object_symbols (abfd, info) bfd *abfd; struct bfd_link_info *info; { if (! aout_get_external_symbols (abfd)) - return false; + return FALSE; if (! aout_link_add_symbols (abfd, info)) - return false; + return FALSE; if (! info->keep_memory) { if (! aout_link_free_symbols (abfd)) - return false; + return FALSE; } - return true; + return TRUE; } /* Check a single archive element to see if we need to include it in @@ -3102,36 +3124,36 @@ aout_link_add_object_symbols (abfd, info) needed in the link or not. This is called from _bfd_generic_link_add_archive_symbols. */ -static boolean +static bfd_boolean aout_link_check_archive_element (abfd, info, pneeded) bfd *abfd; struct bfd_link_info *info; - boolean *pneeded; + bfd_boolean *pneeded; { if (! aout_get_external_symbols (abfd)) - return false; + return FALSE; if (! aout_link_check_ar_symbols (abfd, info, pneeded)) - return false; + return FALSE; if (*pneeded) { if (! aout_link_add_symbols (abfd, info)) - return false; + return FALSE; } if (! info->keep_memory || ! *pneeded) { if (! aout_link_free_symbols (abfd)) - return false; + return FALSE; } - return true; + return TRUE; } /* Free up the internal symbols read from an a.out file. */ -static boolean +static bfd_boolean aout_link_free_symbols (abfd) bfd *abfd; { @@ -3153,7 +3175,7 @@ aout_link_free_symbols (abfd) #endif obj_aout_external_strings (abfd) = (char *) NULL; } - return true; + return TRUE; } /* Look through the internal symbols to see if this object file should @@ -3163,17 +3185,17 @@ aout_link_free_symbols (abfd) known symbol but we do not include the object file in the link (unless there is some other reason to include it). */ -static boolean +static bfd_boolean aout_link_check_ar_symbols (abfd, info, pneeded) bfd *abfd; struct bfd_link_info *info; - boolean *pneeded; + bfd_boolean *pneeded; { register struct external_nlist *p; struct external_nlist *pend; char *strings; - *pneeded = false; + *pneeded = FALSE; /* Look through all the symbols. */ p = obj_aout_external_syms (abfd); @@ -3203,7 +3225,7 @@ aout_link_check_ar_symbols (abfd, info, pneeded) } name = strings + GET_WORD (abfd, p->e_strx); - h = bfd_link_hash_lookup (info->hash, name, false, false, true); + h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE); /* We are only interested in symbols that are currently undefined or common. */ @@ -3224,23 +3246,47 @@ aout_link_check_ar_symbols (abfd, info, pneeded) { /* This object file defines this symbol. We must link it in. This is true regardless of whether the current - definition of the symbol is undefined or common. If the - current definition is common, we have a case in which we - have already seen an object file including + definition of the symbol is undefined or common. + + If the current definition is common, we have a case in + which we have already seen an object file including: int a; - and this object file from the archive includes + and this object file from the archive includes: int a = 5; - In such a case we must include this object file. + In such a case, whether to include this object is target + dependant for backward compatibility. FIXME: The SunOS 4.1.3 linker will pull in the archive element if the symbol is defined in the .data section, but not if it is defined in the .text section. That - seems a bit crazy to me, and I haven't implemented it. - However, it might be correct. */ + seems a bit crazy to me, and it has not been implemented + yet. However, it might be correct. */ + if (h->type == bfd_link_hash_common) + { + int skip = 0; + + switch (info->common_skip_ar_aymbols) + { + case bfd_link_common_skip_text: + skip = (type == (N_TEXT | N_EXT)); + break; + case bfd_link_common_skip_data: + skip = (type == (N_DATA | N_EXT)); + break; + default: + case bfd_link_common_skip_all: + skip = 1; + break; + } + + if (skip) + continue; + } + if (! (*info->callbacks->add_archive_element) (info, abfd, name)) - return false; - *pneeded = true; - return true; + return FALSE; + *pneeded = TRUE; + return TRUE; } if (type == (N_UNDF | N_EXT)) @@ -3267,9 +3313,9 @@ aout_link_check_ar_symbols (abfd, info, pneeded) if (! (*info->callbacks->add_archive_element) (info, abfd, name)) - return false; - *pneeded = true; - return true; + return FALSE; + *pneeded = TRUE; + return TRUE; } /* Turn the current link symbol into a common symbol. It is already on the undefs list. */ @@ -3278,7 +3324,7 @@ aout_link_check_ar_symbols (abfd, info, pneeded) bfd_hash_allocate (&info->hash->table, sizeof (struct bfd_link_hash_common_entry))); if (h->u.c.p == NULL) - return false; + return FALSE; h->u.c.size = value; @@ -3315,33 +3361,32 @@ aout_link_check_ar_symbols (abfd, info, pneeded) if (h->type == bfd_link_hash_undefined) { if (! (*info->callbacks->add_archive_element) (info, abfd, name)) - return false; - *pneeded = true; - return true; + return FALSE; + *pneeded = TRUE; + return TRUE; } } } /* We do not need this object file. */ - return true; + return TRUE; } /* Add all symbols from an object file to the hash table. */ -static boolean +static bfd_boolean aout_link_add_symbols (abfd, info) bfd *abfd; struct bfd_link_info *info; { - boolean (*add_one_symbol) PARAMS ((struct bfd_link_info *, bfd *, - const char *, flagword, asection *, - bfd_vma, const char *, boolean, - boolean, - struct bfd_link_hash_entry **)); + bfd_boolean (*add_one_symbol) + PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, asection *, + bfd_vma, const char *, bfd_boolean, bfd_boolean, + struct bfd_link_hash_entry **)); struct external_nlist *syms; bfd_size_type sym_count; char *strings; - boolean copy; + bfd_boolean copy; struct aout_link_hash_entry **sym_hash; register struct external_nlist *p; struct external_nlist *pend; @@ -3351,15 +3396,15 @@ aout_link_add_symbols (abfd, info) sym_count = obj_aout_external_sym_count (abfd); strings = obj_aout_external_strings (abfd); if (info->keep_memory) - copy = false; + copy = FALSE; else - copy = true; + copy = TRUE; if (aout_backend_info (abfd)->add_dynamic_symbols != NULL) { if (! ((*aout_backend_info (abfd)->add_dynamic_symbols) (abfd, info, &syms, &sym_count, &strings))) - return false; + return FALSE; } /* We keep a list of the linker hash table entries that correspond @@ -3369,7 +3414,7 @@ aout_link_add_symbols (abfd, info) amt = sym_count * sizeof (struct aout_link_hash_entry *); sym_hash = (struct aout_link_hash_entry **) bfd_alloc (abfd, amt); if (sym_hash == NULL && sym_count != 0) - return false; + return FALSE; obj_aout_sym_hashes (abfd) = sym_hash; add_one_symbol = aout_backend_info (abfd)->add_one_symbol; @@ -3515,9 +3560,9 @@ aout_link_add_symbols (abfd, info) } if (! ((*add_one_symbol) - (info, abfd, name, flags, section, value, string, copy, false, + (info, abfd, name, flags, section, value, string, copy, FALSE, (struct bfd_link_hash_entry **) sym_hash))) - return false; + return FALSE; /* Restrict the maximum alignment of a common symbol based on the architecture, since a.out has no way to represent @@ -3543,7 +3588,7 @@ aout_link_add_symbols (abfd, info) ++sym_hash; } - return true; + return TRUE; } /* A hash table used for header files with N_BINCL entries. */ @@ -3606,27 +3651,27 @@ struct aout_final_link_info static struct bfd_hash_entry *aout_link_includes_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static boolean aout_link_input_bfd +static bfd_boolean aout_link_input_bfd PARAMS ((struct aout_final_link_info *, bfd *input_bfd)); -static boolean aout_link_write_symbols +static bfd_boolean aout_link_write_symbols PARAMS ((struct aout_final_link_info *, bfd *input_bfd)); -static boolean aout_link_write_other_symbol +static bfd_boolean aout_link_write_other_symbol PARAMS ((struct aout_link_hash_entry *, PTR)); -static boolean aout_link_input_section +static bfd_boolean aout_link_input_section PARAMS ((struct aout_final_link_info *, bfd *input_bfd, asection *input_section, file_ptr *reloff_ptr, bfd_size_type rel_size)); -static boolean aout_link_input_section_std +static bfd_boolean aout_link_input_section_std PARAMS ((struct aout_final_link_info *, bfd *input_bfd, asection *input_section, struct reloc_std_external *, bfd_size_type rel_size, bfd_byte *contents)); -static boolean aout_link_input_section_ext +static bfd_boolean aout_link_input_section_ext PARAMS ((struct aout_final_link_info *, bfd *input_bfd, asection *input_section, struct reloc_ext_external *, bfd_size_type rel_size, bfd_byte *contents)); static INLINE asection *aout_reloc_index_to_section PARAMS ((bfd *, int)); -static boolean aout_link_reloc_link_order +static bfd_boolean aout_link_reloc_link_order PARAMS ((struct aout_final_link_info *, asection *, struct bfd_link_order *)); @@ -3669,14 +3714,14 @@ aout_link_includes_newfunc (entry, table, string) of bfd_link_order structures which list all the input sections for the output section. */ -boolean +bfd_boolean NAME(aout,final_link) (abfd, info, callback) bfd *abfd; struct bfd_link_info *info; void (*callback) PARAMS ((bfd *, file_ptr *, file_ptr *, file_ptr *)); { struct aout_final_link_info aout_info; - boolean includes_hash_initialized = false; + bfd_boolean includes_hash_initialized = FALSE; register bfd *sub; bfd_size_type trsize, drsize; bfd_size_type max_contents_size; @@ -3686,7 +3731,7 @@ NAME(aout,final_link) (abfd, info, callback) file_ptr text_end; register struct bfd_link_order *p; asection *o; - boolean have_link_order_relocs; + bfd_boolean have_link_order_relocs; if (info->shared) abfd->flags |= DYNAMIC; @@ -3702,10 +3747,10 @@ NAME(aout,final_link) (abfd, info, callback) aout_link_includes_newfunc, 251)) goto error_return; - includes_hash_initialized = true; + includes_hash_initialized = TRUE; /* Figure out the largest section size. Also, if generating - relocateable output, count the relocs. */ + relocatable output, count the relocs. */ trsize = 0; drsize = 0; max_contents_size = 0; @@ -3715,7 +3760,7 @@ NAME(aout,final_link) (abfd, info, callback) { bfd_size_type sz; - if (info->relocateable) + if (info->relocatable) { if (bfd_get_flavour (sub) == bfd_target_aout_flavour) { @@ -3729,7 +3774,7 @@ NAME(aout,final_link) (abfd, info, callback) work out the number of relocs needed, and then multiply by the reloc size. */ (*_bfd_error_handler) - (_("%s: relocateable link from %s to %s not supported"), + (_("%s: relocatable link from %s to %s not supported"), bfd_get_filename (abfd), sub->xvec->name, abfd->xvec->name); bfd_set_error (bfd_error_invalid_operation); @@ -3759,7 +3804,7 @@ NAME(aout,final_link) (abfd, info, callback) } } - if (info->relocateable) + if (info->relocatable) { if (obj_textsec (abfd) != (asection *) NULL) trsize += (_bfd_count_link_order_relocs (obj_textsec (abfd) @@ -3825,7 +3870,7 @@ NAME(aout,final_link) (abfd, info, callback) struct aout_link_hash_entry *h; h = aout_link_hash_lookup (aout_hash_table (info), "__DYNAMIC", - false, false, false); + FALSE, FALSE, FALSE); if (h != NULL) aout_link_write_other_symbol (h, &aout_info); } @@ -3852,7 +3897,7 @@ NAME(aout,final_link) (abfd, info, callback) We use the output_has_begun field of the input BFDs to see whether we have already handled it. */ for (sub = info->input_bfds; sub != (bfd *) NULL; sub = sub->link_next) - sub->output_has_begun = false; + sub->output_has_begun = FALSE; /* Mark all sections which are to be included in the link. This will normally be every section. We need to do this so that we @@ -3861,13 +3906,11 @@ NAME(aout,final_link) (abfd, info, callback) for (o = abfd->sections; o != NULL; o = o->next) { for (p = o->link_order_head; p != NULL; p = p->next) - { - if (p->type == bfd_indirect_link_order) - p->u.indirect.section->linker_mark = (unsigned int) true; - } + if (p->type == bfd_indirect_link_order) + p->u.indirect.section->linker_mark = TRUE; } - have_link_order_relocs = false; + have_link_order_relocs = FALSE; for (o = abfd->sections; o != (asection *) NULL; o = o->next) { for (p = o->link_order_head; @@ -3885,14 +3928,14 @@ NAME(aout,final_link) (abfd, info, callback) { if (! aout_link_input_bfd (&aout_info, input_bfd)) goto error_return; - input_bfd->output_has_begun = true; + input_bfd->output_has_begun = TRUE; } } else if (p->type == bfd_section_reloc_link_order || p->type == bfd_symbol_reloc_link_order) { /* These are handled below. */ - have_link_order_relocs = true; + have_link_order_relocs = TRUE; } else { @@ -3952,7 +3995,7 @@ NAME(aout,final_link) (abfd, info, callback) if (includes_hash_initialized) { bfd_hash_table_free (&aout_info.includes.root); - includes_hash_initialized = false; + includes_hash_initialized = FALSE; } /* Finish up any dynamic linking we may be doing. */ @@ -3991,7 +4034,7 @@ NAME(aout,final_link) (abfd, info, callback) goto error_return; } - return true; + return TRUE; error_return: if (aout_info.contents != NULL) @@ -4004,12 +4047,12 @@ NAME(aout,final_link) (abfd, info, callback) free (aout_info.output_syms); if (includes_hash_initialized) bfd_hash_table_free (&aout_info.includes.root); - return false; + return FALSE; } /* Link an a.out input BFD into the output file. */ -static boolean +static bfd_boolean aout_link_input_bfd (finfo, input_bfd) struct aout_final_link_info *finfo; bfd *input_bfd; @@ -4027,16 +4070,16 @@ aout_link_input_bfd (finfo, input_bfd) } /* Get the symbols. We probably have them already, unless - finfo->info->keep_memory is false. */ + finfo->info->keep_memory is FALSE. */ if (! aout_get_external_symbols (input_bfd)) - return false; + return FALSE; sym_count = obj_aout_external_sym_count (input_bfd); /* Write out the symbols and get a map of the new indices. The map is placed into finfo->symbol_map. */ if (! aout_link_write_symbols (finfo, input_bfd)) - return false; + return FALSE; /* Relocate and write out the sections. These functions use the symbol map created by aout_link_write_symbols. The linker_mark @@ -4048,7 +4091,7 @@ aout_link_input_bfd (finfo, input_bfd) obj_textsec (input_bfd), &finfo->treloff, exec_hdr (input_bfd)->a_trsize)) - return false; + return FALSE; } if (obj_datasec (input_bfd)->linker_mark) { @@ -4056,7 +4099,7 @@ aout_link_input_bfd (finfo, input_bfd) obj_datasec (input_bfd), &finfo->dreloff, exec_hdr (input_bfd)->a_drsize)) - return false; + return FALSE; } /* If we are not keeping memory, we don't need the symbols any @@ -4065,16 +4108,16 @@ aout_link_input_bfd (finfo, input_bfd) if (! finfo->info->keep_memory) { if (! aout_link_free_symbols (input_bfd)) - return false; + return FALSE; } - return true; + return TRUE; } /* Adjust and write out the symbols for an a.out file. Set the new symbol indices into a symbol_map. */ -static boolean +static bfd_boolean aout_link_write_symbols (finfo, input_bfd) struct aout_final_link_info *finfo; bfd *input_bfd; @@ -4090,8 +4133,8 @@ aout_link_write_symbols (finfo, input_bfd) struct external_nlist *sym_end; struct aout_link_hash_entry **sym_hash; int *symbol_map; - boolean pass; - boolean skip_next; + bfd_boolean pass; + bfd_boolean skip_next; output_bfd = finfo->output_bfd; sym_count = obj_aout_external_sym_count (input_bfd); @@ -4105,16 +4148,16 @@ aout_link_write_symbols (finfo, input_bfd) if (strip != strip_all && (strip != strip_some || bfd_hash_lookup (finfo->info->keep_hash, input_bfd->filename, - false, false) != NULL) + FALSE, FALSE) != NULL) && discard != discard_all) { H_PUT_8 (output_bfd, N_TEXT, outsym->e_type); H_PUT_8 (output_bfd, 0, outsym->e_other); H_PUT_16 (output_bfd, 0, outsym->e_desc); strtab_index = add_to_stringtab (output_bfd, finfo->strtab, - input_bfd->filename, false); + input_bfd->filename, FALSE); if (strtab_index == (bfd_size_type) -1) - return false; + return FALSE; PUT_WORD (output_bfd, strtab_index, outsym->e_strx); PUT_WORD (output_bfd, (bfd_get_section_vma (output_bfd, @@ -4125,8 +4168,8 @@ aout_link_write_symbols (finfo, input_bfd) ++outsym; } - pass = false; - skip_next = false; + pass = FALSE; + skip_next = FALSE; sym = obj_aout_external_syms (input_bfd); sym_end = sym + sym_count; sym_hash = obj_aout_sym_hashes (input_bfd); @@ -4137,10 +4180,10 @@ aout_link_write_symbols (finfo, input_bfd) const char *name; int type; struct aout_link_hash_entry *h; - boolean skip; + bfd_boolean skip; asection *symsec; bfd_vma val = 0; - boolean copy; + bfd_boolean copy; /* We set *symbol_map to 0 above for all symbols. If it has already been set to -1 for this symbol, it means that we are @@ -4164,14 +4207,14 @@ aout_link_write_symbols (finfo, input_bfd) /* Pass this symbol through. It is the target of an indirect or warning symbol. */ val = GET_WORD (input_bfd, sym->e_value); - pass = false; + pass = FALSE; } else if (skip_next) { /* Skip this symbol, which is the target of an indirect symbol that we have changed to no longer be an indirect symbol. */ - skip_next = false; + skip_next = FALSE; continue; } else @@ -4213,34 +4256,34 @@ aout_link_write_symbols (finfo, input_bfd) { if ((type & N_TYPE) == N_INDR || type == N_WARNING) - skip_next = true; + skip_next = TRUE; *symbol_map = h->indx; continue; } /* See if we are stripping this symbol. */ - skip = false; + skip = FALSE; switch (strip) { case strip_none: break; case strip_debugger: if ((type & N_STAB) != 0) - skip = true; + skip = TRUE; break; case strip_some: - if (bfd_hash_lookup (finfo->info->keep_hash, name, false, false) + if (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE, FALSE) == NULL) - skip = true; + skip = TRUE; break; case strip_all: - skip = true; + skip = TRUE; break; } if (skip) { if (h != (struct aout_link_hash_entry *) NULL) - h->written = true; + h->written = TRUE; continue; } @@ -4269,7 +4312,7 @@ aout_link_write_symbols (finfo, input_bfd) the indirect symbol was defined, we output it with the correct definition so the debugger will understand it. */ - pass = true; + pass = TRUE; val = GET_WORD (input_bfd, sym->e_value); symsec = NULL; } @@ -4285,7 +4328,7 @@ aout_link_write_symbols (finfo, input_bfd) a case we do not want to output the next symbol, which is the target of the indirection. */ if ((type & N_TYPE) == N_INDR) - skip_next = true; + skip_next = TRUE; symsec = NULL; @@ -4377,7 +4420,7 @@ aout_link_write_symbols (finfo, input_bfd) it is a local symbol see if we should discard it. */ if (h != (struct aout_link_hash_entry *) NULL) { - h->written = true; + h->written = TRUE; h->indx = obj_aout_external_sym_count (output_bfd); } else if ((type & N_TYPE) != N_SETT @@ -4393,15 +4436,15 @@ aout_link_write_symbols (finfo, input_bfd) case discard_l: if ((type & N_STAB) == 0 && bfd_is_local_label_name (input_bfd, name)) - skip = true; + skip = TRUE; break; case discard_all: - skip = true; + skip = TRUE; break; } if (skip) { - pass = false; + pass = FALSE; continue; } } @@ -4457,11 +4500,11 @@ aout_link_write_symbols (finfo, input_bfd) /* If we have already included a header file with the same value, then replace this one with an N_EXCL symbol. */ - copy = (boolean) (! finfo->info->keep_memory); + copy = (bfd_boolean) (! finfo->info->keep_memory); incl_entry = aout_link_includes_lookup (&finfo->includes, - name, true, copy); + name, TRUE, copy); if (incl_entry == NULL) - return false; + return FALSE; for (t = incl_entry->totals; t != NULL; t = t->next) if (t->total == val) break; @@ -4473,7 +4516,7 @@ aout_link_write_symbols (finfo, input_bfd) bfd_hash_allocate (&finfo->includes.root, sizeof *t)); if (t == NULL) - return false; + return FALSE; t->total = val; t->next = incl_entry->totals; incl_entry->totals = t; @@ -4518,7 +4561,7 @@ aout_link_write_symbols (finfo, input_bfd) H_PUT_8 (output_bfd, type, outsym->e_type); H_PUT_8 (output_bfd, H_GET_8 (input_bfd, sym->e_other), outsym->e_other); H_PUT_16 (output_bfd, H_GET_16 (input_bfd, sym->e_desc), outsym->e_desc); - copy = false; + copy = FALSE; if (! finfo->info->keep_memory) { /* name points into a string table which we are going to @@ -4527,12 +4570,12 @@ aout_link_write_symbols (finfo, input_bfd) if (h != (struct aout_link_hash_entry *) NULL) name = h->root.root.string; else - copy = true; + copy = TRUE; } strtab_index = add_to_stringtab (output_bfd, finfo->strtab, name, copy); if (strtab_index == (bfd_size_type) -1) - return false; + return FALSE; PUT_WORD (output_bfd, strtab_index, outsym->e_strx); PUT_WORD (output_bfd, val, outsym->e_value); *symbol_map = obj_aout_external_sym_count (output_bfd); @@ -4546,22 +4589,22 @@ aout_link_write_symbols (finfo, input_bfd) bfd_size_type outsym_size; if (bfd_seek (output_bfd, finfo->symoff, SEEK_SET) != 0) - return false; + return FALSE; outsym_size = outsym - finfo->output_syms; outsym_size *= EXTERNAL_NLIST_SIZE; if (bfd_bwrite ((PTR) finfo->output_syms, outsym_size, output_bfd) != outsym_size) - return false; + return FALSE; finfo->symoff += outsym_size; } - return true; + return TRUE; } /* Write out a symbol that was not associated with an a.out input object. */ -static boolean +static bfd_boolean aout_link_write_other_symbol (h, data) struct aout_link_hash_entry *h; PTR data; @@ -4578,7 +4621,7 @@ aout_link_write_other_symbol (h, data) { h = (struct aout_link_hash_entry *) h->root.u.i.link; if (h->root.type == bfd_link_hash_new) - return true; + return TRUE; } output_bfd = finfo->output_bfd; @@ -4594,17 +4637,17 @@ aout_link_write_other_symbol (h, data) } if (h->written) - return true; + return TRUE; - h->written = true; + h->written = TRUE; /* An indx of -2 means the symbol must be written. */ if (h->indx != -2 && (finfo->info->strip == strip_all || (finfo->info->strip == strip_some && bfd_hash_lookup (finfo->info->keep_hash, h->root.root.string, - false, false) == NULL))) - return true; + FALSE, FALSE) == NULL))) + return TRUE; switch (h->root.type) { @@ -4612,11 +4655,11 @@ aout_link_write_other_symbol (h, data) case bfd_link_hash_warning: abort (); /* Avoid variable not initialized warnings. */ - return true; + return TRUE; case bfd_link_hash_new: /* This can happen for set symbols when sets are not being built. */ - return true; + return TRUE; case bfd_link_hash_undefined: type = N_UNDF | N_EXT; val = 0; @@ -4653,14 +4696,14 @@ aout_link_write_other_symbol (h, data) case bfd_link_hash_indirect: /* We ignore these symbols, since the indirected symbol is already in the hash table. */ - return true; + return TRUE; } H_PUT_8 (output_bfd, type, outsym.e_type); H_PUT_8 (output_bfd, 0, outsym.e_other); H_PUT_16 (output_bfd, 0, outsym.e_desc); indx = add_to_stringtab (output_bfd, finfo->strtab, h->root.root.string, - false); + FALSE); if (indx == - (bfd_size_type) 1) { /* FIXME: No way to handle errors. */ @@ -4681,12 +4724,12 @@ aout_link_write_other_symbol (h, data) h->indx = obj_aout_external_sym_count (output_bfd); ++obj_aout_external_sym_count (output_bfd); - return true; + return TRUE; } /* Link an a.out section into the output file. */ -static boolean +static bfd_boolean aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr, rel_size) struct aout_final_link_info *finfo; @@ -4703,7 +4746,7 @@ aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr, if (! bfd_get_section_contents (input_bfd, input_section, (PTR) finfo->contents, (file_ptr) 0, input_size)) - return false; + return FALSE; /* Read in the relocs if we haven't already done it. */ if (aout_section_data (input_section) != NULL @@ -4716,7 +4759,7 @@ aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr, { if (bfd_seek (input_bfd, input_section->rel_filepos, SEEK_SET) != 0 || bfd_bread (relocs, rel_size, input_bfd) != rel_size) - return false; + return FALSE; } } @@ -4726,14 +4769,14 @@ aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr, if (! aout_link_input_section_std (finfo, input_bfd, input_section, (struct reloc_std_external *) relocs, rel_size, finfo->contents)) - return false; + return FALSE; } else { if (! aout_link_input_section_ext (finfo, input_bfd, input_section, (struct reloc_ext_external *) relocs, rel_size, finfo->contents)) - return false; + return FALSE; } /* Write out the section contents. */ @@ -4742,16 +4785,16 @@ aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr, (PTR) finfo->contents, (file_ptr) input_section->output_offset, input_size)) - return false; + return FALSE; - /* If we are producing relocateable output, the relocs were + /* If we are producing relocatable output, the relocs were modified, and we now write them out. */ - if (finfo->info->relocateable && rel_size > 0) + if (finfo->info->relocatable && rel_size > 0) { if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0) - return false; + return FALSE; if (bfd_bwrite (relocs, rel_size, finfo->output_bfd) != rel_size) - return false; + return FALSE; *reloff_ptr += rel_size; /* Assert that the relocs have not run into the symbols, and @@ -4763,7 +4806,7 @@ aout_link_input_section (finfo, input_bfd, input_section, reloff_ptr, <= obj_datasec (finfo->output_bfd)->rel_filepos))); } - return true; + return TRUE; } /* Get the section corresponding to a reloc index. */ @@ -4793,7 +4836,7 @@ aout_reloc_index_to_section (abfd, indx) /* Relocate an a.out section using standard a.out relocs. */ -static boolean +static bfd_boolean aout_link_input_section_std (finfo, input_bfd, input_section, relocs, rel_size, contents) struct aout_final_link_info *finfo; @@ -4803,13 +4846,12 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs, bfd_size_type rel_size; bfd_byte *contents; { - boolean (*check_dynamic_reloc) PARAMS ((struct bfd_link_info *, - bfd *, asection *, - struct aout_link_hash_entry *, - PTR, bfd_byte *, boolean *, - bfd_vma *)); + bfd_boolean (*check_dynamic_reloc) + PARAMS ((struct bfd_link_info *, bfd *, asection *, + struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *, + bfd_vma *)); bfd *output_bfd; - boolean relocateable; + bfd_boolean relocatable; struct external_nlist *syms; char *strings; struct aout_link_hash_entry **sym_hashes; @@ -4825,7 +4867,7 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs, BFD_ASSERT (input_bfd->xvec->header_byteorder == output_bfd->xvec->header_byteorder); - relocateable = finfo->info->relocateable; + relocatable = finfo->info->relocatable; syms = obj_aout_external_syms (input_bfd); strings = obj_aout_external_strings (input_bfd); sym_hashes = obj_aout_sym_hashes (input_bfd); @@ -4894,9 +4936,9 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs, } #endif - if (relocateable) + if (relocatable) { - /* We are generating a relocateable output file, and must + /* We are generating a relocatable output file, and must modify the reloc accordingly. */ if (r_extern) { @@ -4951,10 +4993,10 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs, if (h->indx < 0) { h->indx = -2; - h->written = false; + h->written = FALSE; if (! aout_link_write_other_symbol (h, (PTR) finfo)) - return false; + return FALSE; } r_index = h->indx; } @@ -4967,7 +5009,7 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs, if (! ((*finfo->info->callbacks->unattached_reloc) (finfo->info, name, input_bfd, input_section, r_addr))) - return false; + return FALSE; r_index = 0; } } @@ -5027,11 +5069,11 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs, } else { - boolean hundef; + bfd_boolean hundef; /* We are generating an executable, and must do a full relocation. */ - hundef = false; + hundef = FALSE; if (r_extern) { @@ -5050,7 +5092,7 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs, relocation = 0; else { - hundef = true; + hundef = TRUE; relocation = 0; } } @@ -5068,12 +5110,12 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs, if (check_dynamic_reloc != NULL) { - boolean skip; + bfd_boolean skip; if (! ((*check_dynamic_reloc) (finfo->info, input_bfd, input_section, h, (PTR) rel, contents, &skip, &relocation))) - return false; + return FALSE; if (skip) continue; } @@ -5091,8 +5133,8 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs, name = strings + GET_WORD (input_bfd, syms[r_index].e_strx); if (! ((*finfo->info->callbacks->undefined_symbol) (finfo->info, name, input_bfd, input_section, - r_addr, true))) - return false; + r_addr, TRUE))) + return FALSE; } r = MY_final_link_relocate (howto, @@ -5127,19 +5169,19 @@ aout_link_input_section_std (finfo, input_bfd, input_section, relocs, if (! ((*finfo->info->callbacks->reloc_overflow) (finfo->info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, r_addr))) - return false; + return FALSE; } break; } } } - return true; + return TRUE; } /* Relocate an a.out section using extended a.out relocs. */ -static boolean +static bfd_boolean aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, rel_size, contents) struct aout_final_link_info *finfo; @@ -5149,13 +5191,12 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, bfd_size_type rel_size; bfd_byte *contents; { - boolean (*check_dynamic_reloc) PARAMS ((struct bfd_link_info *, - bfd *, asection *, - struct aout_link_hash_entry *, - PTR, bfd_byte *, boolean *, - bfd_vma *)); + bfd_boolean (*check_dynamic_reloc) + PARAMS ((struct bfd_link_info *, bfd *, asection *, + struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *, + bfd_vma *)); bfd *output_bfd; - boolean relocateable; + bfd_boolean relocatable; struct external_nlist *syms; char *strings; struct aout_link_hash_entry **sym_hashes; @@ -5171,7 +5212,7 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, BFD_ASSERT (input_bfd->xvec->header_byteorder == output_bfd->xvec->header_byteorder); - relocateable = finfo->info->relocateable; + relocatable = finfo->info->relocatable; syms = obj_aout_external_syms (input_bfd); strings = obj_aout_external_strings (input_bfd); sym_hashes = obj_aout_sym_hashes (input_bfd); @@ -5216,9 +5257,9 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, BFD_ASSERT (r_type < TABLE_SIZE (howto_table_ext)); - if (relocateable) + if (relocatable) { - /* We are generating a relocateable output file, and must + /* We are generating a relocatable output file, and must modify the reloc accordingly. */ if (r_extern || r_type == (unsigned int) RELOC_BASE10 @@ -5289,10 +5330,10 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, if (h->indx < 0) { h->indx = -2; - h->written = false; + h->written = FALSE; if (! aout_link_write_other_symbol (h, (PTR) finfo)) - return false; + return FALSE; } r_index = h->indx; } @@ -5305,7 +5346,7 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, if (! ((*finfo->info->callbacks->unattached_reloc) (finfo->info, name, input_bfd, input_section, r_addr))) - return false; + return FALSE; r_index = 0; } } @@ -5370,12 +5411,12 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, } else { - boolean hundef; + bfd_boolean hundef; bfd_reloc_status_type r; /* We are generating an executable, and must do a full relocation. */ - hundef = false; + hundef = FALSE; if (r_extern) { @@ -5394,7 +5435,7 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, relocation = 0; else { - hundef = true; + hundef = TRUE; relocation = 0; } } @@ -5467,12 +5508,12 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, if (check_dynamic_reloc != NULL) { - boolean skip; + bfd_boolean skip; if (! ((*check_dynamic_reloc) (finfo->info, input_bfd, input_section, h, (PTR) rel, contents, &skip, &relocation))) - return false; + return FALSE; if (skip) continue; } @@ -5494,8 +5535,8 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, name = strings + GET_WORD (input_bfd, syms[r_index].e_strx); if (! ((*finfo->info->callbacks->undefined_symbol) (finfo->info, name, input_bfd, input_section, - r_addr, true))) - return false; + r_addr, TRUE))) + return FALSE; } if (r_type != (unsigned int) RELOC_SPARC_REV32) @@ -5542,7 +5583,7 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, if (! ((*finfo->info->callbacks->reloc_overflow) (finfo->info, name, howto_table_ext[r_type].name, r_addend, input_bfd, input_section, r_addr))) - return false; + return FALSE; } break; } @@ -5550,12 +5591,12 @@ aout_link_input_section_ext (finfo, input_bfd, input_section, relocs, } } - return true; + return TRUE; } /* Handle a link order which is supposed to generate a reloc. */ -static boolean +static bfd_boolean aout_link_reloc_link_order (finfo, o, p) struct aout_final_link_info *finfo; asection *o; @@ -5592,7 +5633,7 @@ aout_link_reloc_link_order (finfo, o, p) r_extern = 1; h = ((struct aout_link_hash_entry *) bfd_wrapped_link_hash_lookup (finfo->output_bfd, finfo->info, - pr->u.name, false, false, true)); + pr->u.name, FALSE, FALSE, TRUE)); if (h != (struct aout_link_hash_entry *) NULL && h->indx >= 0) r_index = h->indx; @@ -5603,9 +5644,9 @@ aout_link_reloc_link_order (finfo, o, p) here. I don't think that will ever matter for a global symbol. */ h->indx = -2; - h->written = false; + h->written = FALSE; if (! aout_link_write_other_symbol (h, (PTR) finfo)) - return false; + return FALSE; r_index = h->indx; } else @@ -5613,7 +5654,7 @@ aout_link_reloc_link_order (finfo, o, p) if (! ((*finfo->info->callbacks->unattached_reloc) (finfo->info, pr->u.name, (bfd *) NULL, (asection *) NULL, (bfd_vma) 0))) - return false; + return FALSE; r_index = 0; } } @@ -5622,7 +5663,7 @@ aout_link_reloc_link_order (finfo, o, p) if (howto == 0) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } if (o == obj_textsec (finfo->output_bfd)) @@ -5692,12 +5733,12 @@ aout_link_reloc_link_order (finfo, o, p) bfd_size_type size; bfd_reloc_status_type r; bfd_byte *buf; - boolean ok; + bfd_boolean ok; size = bfd_get_reloc_size (howto); buf = (bfd_byte *) bfd_zmalloc (size); if (buf == (bfd_byte *) NULL) - return false; + return FALSE; r = MY_relocate_contents (howto, finfo->output_bfd, (bfd_vma) pr->addend, buf); switch (r) @@ -5718,7 +5759,7 @@ aout_link_reloc_link_order (finfo, o, p) (asection *) NULL, (bfd_vma) 0))) { free (buf); - return false; + return FALSE; } break; } @@ -5726,7 +5767,7 @@ aout_link_reloc_link_order (finfo, o, p) (file_ptr) p->offset, size); free (buf); if (! ok) - return false; + return FALSE; } } else @@ -5765,7 +5806,7 @@ aout_link_reloc_link_order (finfo, o, p) amt = obj_reloc_entry_size (finfo->output_bfd); if (bfd_seek (finfo->output_bfd, *reloff_ptr, SEEK_SET) != 0 || bfd_bwrite (rel_ptr, amt, finfo->output_bfd) != amt) - return false; + return FALSE; *reloff_ptr += obj_reloc_entry_size (finfo->output_bfd); @@ -5776,5 +5817,5 @@ aout_link_reloc_link_order (finfo, o, p) || (*reloff_ptr <= obj_datasec (finfo->output_bfd)->rel_filepos))); - return true; + return TRUE; } diff --git a/contrib/binutils/bfd/archive.c b/contrib/binutils/bfd/archive.c index b051e2a..ba6e684 100644 --- a/contrib/binutils/bfd/archive.c +++ b/contrib/binutils/bfd/archive.c @@ -1,6 +1,6 @@ /* BFD back-end for archive files (libraries). Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. Mostly Gumby Henkel-Wallace's fault. @@ -158,27 +158,17 @@ struct ar_cache { #define ar_maxnamelen(abfd) ((abfd)->xvec->ar_max_namelen) #define arch_eltdata(bfd) ((struct areltdata *) ((bfd)->arelt_data)) -#define arch_hdr(bfd) ((struct ar_hdr *)arch_eltdata(bfd)->arch_header) - -static char *get_extended_arelt_filename PARAMS ((bfd *arch, - const char *name)); -static boolean do_slurp_bsd_armap PARAMS ((bfd *abfd)); -static boolean do_slurp_coff_armap PARAMS ((bfd *abfd)); -boolean bfd_elf64_archive_slurp_armap PARAMS ((bfd *abfd)); -static const char *normalize PARAMS ((bfd *, const char *file)); -static struct areltdata *bfd_ar_hdr_from_filesystem PARAMS ((bfd *abfd, - const char *, - bfd *member)); +#define arch_hdr(bfd) ((struct ar_hdr *) arch_eltdata(bfd)->arch_header) + -boolean -_bfd_generic_mkarchive (abfd) - bfd *abfd; +bfd_boolean +_bfd_generic_mkarchive (bfd *abfd) { bfd_size_type amt = sizeof (struct artdata); - abfd->tdata.aout_ar_data = (struct artdata *) bfd_zalloc (abfd, amt); + abfd->tdata.aout_ar_data = bfd_zalloc (abfd, amt); if (bfd_ardata (abfd) == NULL) - return false; + return FALSE; bfd_ardata (abfd)->cache = NULL; bfd_ardata (abfd)->archive_head = NULL; @@ -186,7 +176,7 @@ _bfd_generic_mkarchive (abfd) bfd_ardata (abfd)->extended_names = NULL; bfd_ardata (abfd)->tdata = NULL; - return true; + return TRUE; } /* @@ -194,7 +184,8 @@ FUNCTION bfd_get_next_mapent SYNOPSIS - symindex bfd_get_next_mapent(bfd *abfd, symindex previous, carsym **sym); + symindex bfd_get_next_mapent + (bfd *abfd, symindex previous, carsym **sym); DESCRIPTION Step through archive @var{abfd}'s symbol table (if it @@ -211,10 +202,7 @@ DESCRIPTION */ symindex -bfd_get_next_mapent (abfd, prev, entry) - bfd *abfd; - symindex prev; - carsym **entry; +bfd_get_next_mapent (bfd *abfd, symindex prev, carsym **entry) { if (!bfd_has_map (abfd)) { @@ -236,8 +224,7 @@ bfd_get_next_mapent (abfd, prev, entry) /* To be called by backends only */ bfd * -_bfd_create_empty_archive_element_shell (obfd) - bfd *obfd; +_bfd_create_empty_archive_element_shell (bfd *obfd) { return _bfd_new_bfd_contained_in (obfd); } @@ -247,27 +234,22 @@ FUNCTION bfd_set_archive_head SYNOPSIS - boolean bfd_set_archive_head(bfd *output, bfd *new_head); + bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head); DESCRIPTION Set the head of the chain of BFDs contained in the archive @var{output} to @var{new_head}. */ -boolean -bfd_set_archive_head (output_archive, new_head) - bfd *output_archive; - bfd *new_head; +bfd_boolean +bfd_set_archive_head (bfd *output_archive, bfd *new_head) { - output_archive->archive_head = new_head; - return true; + return TRUE; } bfd * -_bfd_look_for_bfd_in_cache (arch_bfd, filepos) - bfd *arch_bfd; - file_ptr filepos; +_bfd_look_for_bfd_in_cache (bfd *arch_bfd, file_ptr filepos) { struct ar_cache *current; @@ -280,20 +262,18 @@ _bfd_look_for_bfd_in_cache (arch_bfd, filepos) } /* Kind of stupid to call cons for each one, but we don't do too many */ -boolean -_bfd_add_bfd_to_archive_cache (arch_bfd, filepos, new_elt) - bfd *arch_bfd, *new_elt; - file_ptr filepos; +bfd_boolean +_bfd_add_bfd_to_archive_cache (bfd *arch_bfd, file_ptr filepos, bfd *new_elt) { bfd_size_type amt = sizeof (struct ar_cache); - struct ar_cache *new_cache = (struct ar_cache *) bfd_zalloc (arch_bfd, amt); + struct ar_cache *new_cache = bfd_zalloc (arch_bfd, amt); if (new_cache == NULL) - return false; + return FALSE; new_cache->ptr = filepos; new_cache->arelt = new_elt; - new_cache->next = (struct ar_cache *) NULL; + new_cache->next = NULL; if (bfd_ardata (arch_bfd)->cache == NULL) bfd_ardata (arch_bfd)->cache = new_cache; else @@ -305,16 +285,14 @@ _bfd_add_bfd_to_archive_cache (arch_bfd, filepos, new_elt) current->next = new_cache; } - return true; + return TRUE; } /* The name begins with space. Hence the rest of the name is an index into the string table. */ static char * -get_extended_arelt_filename (arch, name) - bfd *arch; - const char *name; +get_extended_arelt_filename (bfd *arch, const char *name) { unsigned long index = 0; @@ -341,20 +319,17 @@ get_extended_arelt_filename (arch, name) could have been moved arbitrarily. */ -PTR -_bfd_generic_read_ar_hdr (abfd) - bfd *abfd; +void * +_bfd_generic_read_ar_hdr (bfd *abfd) { - return _bfd_generic_read_ar_hdr_mag (abfd, (const char *) NULL); + return _bfd_generic_read_ar_hdr_mag (abfd, NULL); } /* Alpha ECOFF uses an optional different ARFMAG value, so we have a variant of _bfd_generic_read_ar_hdr which accepts a magic string. */ -PTR -_bfd_generic_read_ar_hdr_mag (abfd, mag) - bfd *abfd; - const char *mag; +void * +_bfd_generic_read_ar_hdr_mag (bfd *abfd, const char *mag) { struct ar_hdr hdr; char *hdrp = (char *) &hdr; @@ -365,8 +340,7 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag) bfd_size_type allocsize = sizeof (struct areltdata) + sizeof (struct ar_hdr); char *allocptr = 0; - if (bfd_bread ((PTR) hdrp, (bfd_size_type) sizeof (struct ar_hdr), abfd) - != sizeof (struct ar_hdr)) + if (bfd_bread (hdrp, sizeof (struct ar_hdr), abfd) != sizeof (struct ar_hdr)) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_no_more_archived_files); @@ -436,12 +410,12 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag) spaces, so only look for ' ' if we don't find '/'. */ char *e; - e = (char *) memchr (hdr.ar_name, '\0', ar_maxnamelen (abfd)); + e = memchr (hdr.ar_name, '\0', ar_maxnamelen (abfd)); if (e == NULL) { - e = (char *) memchr (hdr.ar_name, '/', ar_maxnamelen (abfd)); + e = memchr (hdr.ar_name, '/', ar_maxnamelen (abfd)); if (e == NULL) - e = (char *) memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd)); + e = memchr (hdr.ar_name, ' ', ar_maxnamelen (abfd)); } if (e != NULL) @@ -466,7 +440,7 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag) ared = (struct areltdata *) allocptr; ared->arch_header = allocptr + sizeof (struct areltdata); - memcpy ((char *) ared->arch_header, (char *) &hdr, sizeof (struct ar_hdr)); + memcpy (ared->arch_header, &hdr, sizeof (struct ar_hdr)); ared->parsed_size = parsed_size; if (filename != NULL) @@ -476,11 +450,11 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag) ared->filename = allocptr + (sizeof (struct areltdata) + sizeof (struct ar_hdr)); if (namelen) - memcpy (ared->filename, hdr.ar_name, (size_t) namelen); + memcpy (ared->filename, hdr.ar_name, namelen); ared->filename[namelen] = '\0'; } - return (PTR) ared; + return ared; } /* This is an internal function; it's mainly used when indexing @@ -488,9 +462,7 @@ _bfd_generic_read_ar_hdr_mag (abfd, mag) element, since it handles the bookkeeping so nicely for us. */ bfd * -_bfd_get_elt_at_filepos (archive, filepos) - bfd *archive; - file_ptr filepos; +_bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos) { struct areltdata *new_areldata; bfd *n_nfd; @@ -502,26 +474,26 @@ _bfd_get_elt_at_filepos (archive, filepos) if (0 > bfd_seek (archive, filepos, SEEK_SET)) return NULL; - if ((new_areldata = (struct areltdata *) _bfd_read_ar_hdr (archive)) == NULL) + if ((new_areldata = _bfd_read_ar_hdr (archive)) == NULL) return NULL; n_nfd = _bfd_create_empty_archive_element_shell (archive); if (n_nfd == NULL) { - bfd_release (archive, (PTR) new_areldata); + bfd_release (archive, new_areldata); return NULL; } n_nfd->origin = bfd_tell (archive); - n_nfd->arelt_data = (PTR) new_areldata; + n_nfd->arelt_data = new_areldata; n_nfd->filename = new_areldata->filename; if (_bfd_add_bfd_to_archive_cache (archive, filepos, n_nfd)) return n_nfd; /* Huh? */ - bfd_release (archive, (PTR) n_nfd); - bfd_release (archive, (PTR) new_areldata); + bfd_release (archive, n_nfd); + bfd_release (archive, new_areldata); return NULL; } @@ -529,9 +501,7 @@ _bfd_get_elt_at_filepos (archive, filepos) INDEX. INDEX should have been returned by bfd_get_next_mapent. */ bfd * -_bfd_generic_get_elt_at_index (abfd, index) - bfd *abfd; - symindex index; +_bfd_generic_get_elt_at_index (bfd *abfd, symindex index) { carsym *entry; @@ -544,7 +514,7 @@ FUNCTION bfd_openr_next_archived_file SYNOPSIS - bfd *bfd_openr_next_archived_file(bfd *archive, bfd *previous); + bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous); DESCRIPTION Provided a BFD, @var{archive}, containing an archive and NULL, open @@ -556,9 +526,7 @@ DESCRIPTION */ bfd * -bfd_openr_next_archived_file (archive, last_file) - bfd *archive; - bfd *last_file; +bfd_openr_next_archived_file (bfd *archive, bfd *last_file) { if ((bfd_get_format (archive) != bfd_archive) || (archive->direction == write_direction)) @@ -568,15 +536,11 @@ bfd_openr_next_archived_file (archive, last_file) } return BFD_SEND (archive, - openr_next_archived_file, - (archive, - last_file)); + openr_next_archived_file, (archive, last_file)); } bfd * -bfd_generic_openr_next_archived_file (archive, last_file) - bfd *archive; - bfd *last_file; +bfd_generic_openr_next_archived_file (bfd *archive, bfd *last_file) { file_ptr filestart; @@ -596,14 +560,13 @@ bfd_generic_openr_next_archived_file (archive, last_file) } const bfd_target * -bfd_generic_archive_p (abfd) - bfd *abfd; +bfd_generic_archive_p (bfd *abfd) { struct artdata *tdata_hold; char armag[SARMAG + 1]; bfd_size_type amt; - if (bfd_bread ((PTR) armag, (bfd_size_type) SARMAG, abfd) != SARMAG) + if (bfd_bread (armag, SARMAG, abfd) != SARMAG) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); @@ -622,7 +585,7 @@ bfd_generic_archive_p (abfd) tdata_hold = bfd_ardata (abfd); amt = sizeof (struct artdata); - bfd_ardata (abfd) = (struct artdata *) bfd_zalloc (abfd, amt); + bfd_ardata (abfd) = bfd_zalloc (abfd, amt); if (bfd_ardata (abfd) == NULL) { bfd_ardata (abfd) = tdata_hold; @@ -661,13 +624,13 @@ bfd_generic_archive_p (abfd) normal archive, regardless of the format of the object files. We do accept an empty archive. */ - first = bfd_openr_next_archived_file (abfd, (bfd *) NULL); + first = bfd_openr_next_archived_file (abfd, NULL); if (first != NULL) { - boolean fail; + bfd_boolean fail; - first->target_defaulted = false; - fail = false; + first->target_defaulted = FALSE; + fail = FALSE; if (bfd_check_format (first, bfd_object) && first->xvec != abfd->xvec) { @@ -676,7 +639,7 @@ bfd_generic_archive_p (abfd) we have no way to remove it from the archive cache. It's close to impossible to figure out when we can release bfd_ardata. FIXME. */ - (void) bfd_close (first); + bfd_close (first); bfd_release (abfd, bfd_ardata (abfd)); #endif bfd_set_error (bfd_error_wrong_object_format); @@ -707,11 +670,10 @@ bfd_generic_archive_p (abfd) /* The size of the string count. */ #define BSD_STRING_COUNT_SIZE 4 -/* Returns false on error, true otherwise */ +/* Returns FALSE on error, TRUE otherwise */ -static boolean -do_slurp_bsd_armap (abfd) - bfd *abfd; +static bfd_boolean +do_slurp_bsd_armap (bfd *abfd) { struct areltdata *mapdata; unsigned int counter; @@ -721,23 +683,23 @@ do_slurp_bsd_armap (abfd) bfd_size_type parsed_size, amt; carsym *set; - mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd); + mapdata = _bfd_read_ar_hdr (abfd); if (mapdata == NULL) - return false; + return FALSE; parsed_size = mapdata->parsed_size; - bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */ + bfd_release (abfd, mapdata); /* Don't need it any more. */ - raw_armap = (bfd_byte *) bfd_zalloc (abfd, parsed_size); - if (raw_armap == (bfd_byte *) NULL) - return false; + raw_armap = bfd_zalloc (abfd, parsed_size); + if (raw_armap == NULL) + return FALSE; - if (bfd_bread ((PTR) raw_armap, parsed_size, abfd) != parsed_size) + if (bfd_bread (raw_armap, parsed_size, abfd) != parsed_size) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_malformed_archive); byebye: - bfd_release (abfd, (PTR) raw_armap); - return false; + bfd_release (abfd, raw_armap); + return FALSE; } ardata->symdef_count = H_GET_32 (abfd, raw_armap) / BSD_SYMDEF_SIZE; @@ -755,10 +717,10 @@ do_slurp_bsd_armap (abfd) stringbase = ((char *) rbase + ardata->symdef_count * BSD_SYMDEF_SIZE + BSD_STRING_COUNT_SIZE); - amt = (bfd_size_type) ardata->symdef_count * sizeof (carsym); - ardata->symdefs = (carsym *) bfd_alloc (abfd, amt); + amt = ardata->symdef_count * sizeof (carsym); + ardata->symdefs = bfd_alloc (abfd, amt); if (!ardata->symdefs) - return false; + return FALSE; for (counter = 0, set = ardata->symdefs; counter < ardata->symdef_count; @@ -774,15 +736,14 @@ do_slurp_bsd_armap (abfd) /* FIXME, we should provide some way to free raw_ardata when we are done using the strings from it. For now, it seems to be allocated on an objalloc anyway... */ - bfd_has_map (abfd) = true; - return true; + bfd_has_map (abfd) = TRUE; + return TRUE; } -/* Returns false on error, true otherwise. */ +/* Returns FALSE on error, TRUE otherwise. */ -static boolean -do_slurp_coff_armap (abfd) - bfd *abfd; +static bfd_boolean +do_slurp_coff_armap (bfd *abfd) { struct areltdata *mapdata; int *raw_armap, *rawptr; @@ -792,27 +753,27 @@ do_slurp_coff_armap (abfd) unsigned int parsed_size; carsym *carsyms; bfd_size_type nsymz; /* Number of symbols in armap. */ - bfd_vma (*swap) PARAMS ((const bfd_byte *)); + bfd_vma (*swap) (const void *); char int_buf[sizeof (long)]; bfd_size_type carsym_size, ptrsize; unsigned int i; - mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd); + mapdata = _bfd_read_ar_hdr (abfd); if (mapdata == NULL) - return false; + return FALSE; parsed_size = mapdata->parsed_size; - bfd_release (abfd, (PTR) mapdata); /* Don't need it any more. */ + bfd_release (abfd, mapdata); /* Don't need it any more. */ - if (bfd_bread ((PTR) int_buf, (bfd_size_type) 4, abfd) != 4) + if (bfd_bread (int_buf, 4, abfd) != 4) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_malformed_archive); - return false; + return FALSE; } /* It seems that all numeric information in a coff archive is always in big endian format, nomatter the host or target. */ swap = bfd_getb32; - nsymz = bfd_getb32 ((PTR) int_buf); + nsymz = bfd_getb32 (int_buf); stringsize = parsed_size - (4 * nsymz) - 4; #if 1 @@ -826,7 +787,7 @@ do_slurp_coff_armap (abfd) && bfd_get_flavour (abfd) == bfd_target_coff_flavour) { /* This looks dangerous, let's do it the other way around. */ - nsymz = bfd_getl32 ((PTR) int_buf); + nsymz = bfd_getl32 (int_buf); stringsize = parsed_size - (4 * nsymz) - 4; swap = bfd_getl32; } @@ -838,18 +799,18 @@ do_slurp_coff_armap (abfd) carsym_size = (nsymz * sizeof (carsym)); ptrsize = (4 * nsymz); - ardata->symdefs = (carsym *) bfd_zalloc (abfd, carsym_size + stringsize + 1); + ardata->symdefs = bfd_zalloc (abfd, carsym_size + stringsize + 1); if (ardata->symdefs == NULL) - return false; + return FALSE; carsyms = ardata->symdefs; stringbase = ((char *) ardata->symdefs) + carsym_size; /* Allocate and read in the raw offsets. */ - raw_armap = (int *) bfd_alloc (abfd, ptrsize); + raw_armap = bfd_alloc (abfd, ptrsize); if (raw_armap == NULL) goto release_symdefs; - if (bfd_bread ((PTR) raw_armap, ptrsize, abfd) != ptrsize - || (bfd_bread ((PTR) stringbase, stringsize, abfd) != stringsize)) + if (bfd_bread (raw_armap, ptrsize, abfd) != ptrsize + || (bfd_bread (stringbase, stringsize, abfd) != stringsize)) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_malformed_archive); @@ -860,7 +821,7 @@ do_slurp_coff_armap (abfd) for (i = 0; i < nsymz; i++) { rawptr = raw_armap + i; - carsyms->file_offset = swap ((PTR) rawptr); + carsyms->file_offset = swap ((bfd_byte *) rawptr); carsyms->name = stringbase; stringbase += strlen (stringbase) + 1; carsyms++; @@ -872,15 +833,15 @@ do_slurp_coff_armap (abfd) /* Pad to an even boundary if you have to. */ ardata->first_file_filepos += (ardata->first_file_filepos) % 2; - bfd_has_map (abfd) = true; - bfd_release (abfd, (PTR) raw_armap); + bfd_has_map (abfd) = TRUE; + bfd_release (abfd, raw_armap); /* Check for a second archive header (as used by PE). */ { struct areltdata *tmp; bfd_seek (abfd, ardata->first_file_filepos, SEEK_SET); - tmp = (struct areltdata *) _bfd_read_ar_hdr (abfd); + tmp = _bfd_read_ar_hdr (abfd); if (tmp != NULL) { if (tmp->arch_header[0] == '/' @@ -893,32 +854,31 @@ do_slurp_coff_armap (abfd) } } - return true; + return TRUE; release_raw_armap: - bfd_release (abfd, (PTR) raw_armap); + bfd_release (abfd, raw_armap); release_symdefs: - bfd_release (abfd, (PTR) (ardata)->symdefs); - return false; + bfd_release (abfd, (ardata)->symdefs); + return FALSE; } /* This routine can handle either coff-style or bsd-style armaps. - Returns false on error, true otherwise */ + Returns FALSE on error, TRUE otherwise */ -boolean -bfd_slurp_armap (abfd) - bfd *abfd; +bfd_boolean +bfd_slurp_armap (bfd *abfd) { char nextname[17]; - int i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd); + int i = bfd_bread (nextname, 16, abfd); if (i == 0) - return true; + return TRUE; if (i != 16) - return false; + return FALSE; if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) - return false; + return FALSE; if (!strncmp (nextname, "__.SYMDEF ", 16) || !strncmp (nextname, "__.SYMDEF/ ", 16)) /* old Linux archives */ @@ -929,27 +889,27 @@ bfd_slurp_armap (abfd) { /* 64bit ELF (Irix 6) archive. */ #ifdef BFD64 + extern bfd_boolean bfd_elf64_archive_slurp_armap (bfd *); return bfd_elf64_archive_slurp_armap (abfd); #else bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; #endif } - bfd_has_map (abfd) = false; - return true; + bfd_has_map (abfd) = FALSE; + return TRUE; } -/* Returns false on error, true otherwise */ +/* Returns FALSE on error, TRUE otherwise */ /* flavor 2 of a bsd armap, similar to bfd_slurp_bsd_armap except the header is in a slightly different order and the map name is '/'. This flavour is used by hp300hpux. */ #define HPUX_SYMDEF_COUNT_SIZE 2 -boolean -bfd_slurp_bsd_armap_f2 (abfd) - bfd *abfd; +bfd_boolean +bfd_slurp_bsd_armap_f2 (bfd *abfd) { struct areltdata *mapdata; char nextname[17]; @@ -960,16 +920,16 @@ bfd_slurp_bsd_armap_f2 (abfd) unsigned int stringsize; bfd_size_type amt; carsym *set; - int i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd); + int i = bfd_bread (nextname, 16, abfd); if (i == 0) - return true; + return TRUE; if (i != 16) - return false; + return FALSE; /* The archive has at least 16 bytes in it. */ if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) - return false; + return FALSE; if (!strncmp (nextname, "__.SYMDEF ", 16) || !strncmp (nextname, "__.SYMDEF/ ", 16)) /* old Linux archives */ @@ -977,33 +937,33 @@ bfd_slurp_bsd_armap_f2 (abfd) if (strncmp (nextname, "/ ", 16)) { - bfd_has_map (abfd) = false; - return true; + bfd_has_map (abfd) = FALSE; + return TRUE; } - mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd); + mapdata = _bfd_read_ar_hdr (abfd); if (mapdata == NULL) - return false; + return FALSE; amt = mapdata->parsed_size; - raw_armap = (bfd_byte *) bfd_zalloc (abfd, amt); + raw_armap = bfd_zalloc (abfd, amt); if (raw_armap == NULL) { byebye: - bfd_release (abfd, (PTR) mapdata); - return false; + bfd_release (abfd, mapdata); + return FALSE; } - if (bfd_bread ((PTR) raw_armap, amt, abfd) != amt) + if (bfd_bread (raw_armap, amt, abfd) != amt) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_malformed_archive); byebyebye: - bfd_release (abfd, (PTR) raw_armap); + bfd_release (abfd, raw_armap); goto byebye; } - ardata->symdef_count = H_GET_16 (abfd, (PTR) raw_armap); + ardata->symdef_count = H_GET_16 (abfd, raw_armap); if (ardata->symdef_count * BSD_SYMDEF_SIZE > mapdata->parsed_size - HPUX_SYMDEF_COUNT_SIZE) @@ -1021,10 +981,10 @@ bfd_slurp_bsd_armap_f2 (abfd) + HPUX_SYMDEF_COUNT_SIZE + BSD_STRING_COUNT_SIZE); rbase = (bfd_byte *) stringbase + stringsize; - amt = (bfd_size_type) ardata->symdef_count * BSD_SYMDEF_SIZE; - ardata->symdefs = (carsym *) bfd_alloc (abfd, amt); + amt = ardata->symdef_count * BSD_SYMDEF_SIZE; + ardata->symdefs = bfd_alloc (abfd, amt); if (!ardata->symdefs) - return false; + return FALSE; for (counter = 0, set = ardata->symdefs; counter < ardata->symdef_count; @@ -1040,8 +1000,8 @@ bfd_slurp_bsd_armap_f2 (abfd) /* FIXME, we should provide some way to free raw_ardata when we are done using the strings from it. For now, it seems to be allocated on an objalloc anyway... */ - bfd_has_map (abfd) = true; - return true; + bfd_has_map (abfd) = TRUE; + return TRUE; } /** Extended name table. @@ -1054,49 +1014,48 @@ bfd_slurp_bsd_armap_f2 (abfd) element>. Index is the P.R. of an int (decimal). Data General have extended the format by using the prefix // for the special element. */ -/* Returns false on error, true otherwise. */ +/* Returns FALSE on error, TRUE otherwise. */ -boolean -_bfd_slurp_extended_name_table (abfd) - bfd *abfd; +bfd_boolean +_bfd_slurp_extended_name_table (bfd *abfd) { char nextname[17]; struct areltdata *namedata; bfd_size_type amt; /* FIXME: Formatting sucks here, and in case of failure of BFD_READ, - we probably don't want to return true. */ + we probably don't want to return TRUE. */ bfd_seek (abfd, bfd_ardata (abfd)->first_file_filepos, SEEK_SET); - if (bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd) == 16) + if (bfd_bread (nextname, 16, abfd) == 16) { if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) - return false; + return FALSE; if (strncmp (nextname, "ARFILENAMES/ ", 16) != 0 && strncmp (nextname, "// ", 16) != 0) { bfd_ardata (abfd)->extended_names = NULL; - return true; + return TRUE; } - namedata = (struct areltdata *) _bfd_read_ar_hdr (abfd); + namedata = _bfd_read_ar_hdr (abfd); if (namedata == NULL) - return false; + return FALSE; amt = namedata->parsed_size; bfd_ardata (abfd)->extended_names = bfd_zalloc (abfd, amt); if (bfd_ardata (abfd)->extended_names == NULL) { byebye: - bfd_release (abfd, (PTR) namedata); - return false; + bfd_release (abfd, namedata); + return FALSE; } - if (bfd_bread ((PTR) bfd_ardata (abfd)->extended_names, amt, abfd) != amt) + if (bfd_bread (bfd_ardata (abfd)->extended_names, amt, abfd) != amt) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_malformed_archive); - bfd_release (abfd, (PTR) (bfd_ardata (abfd)->extended_names)); + bfd_release (abfd, (bfd_ardata (abfd)->extended_names)); bfd_ardata (abfd)->extended_names = NULL; goto byebye; } @@ -1129,7 +1088,7 @@ _bfd_slurp_extended_name_table (abfd) bfd_release (abfd, namedata); #endif } - return true; + return TRUE; } #ifdef VMS @@ -1138,9 +1097,7 @@ _bfd_slurp_extended_name_table (abfd) semicolon. */ static const char * -normalize (abfd, file) - bfd *abfd; - const char *file; +normalize (bfd *abfd, const char *file) { const char *first; const char *last; @@ -1161,7 +1118,7 @@ normalize (abfd, file) first--; } - copy = (char *) bfd_alloc (abfd, (bfd_size_type) (last - first + 1)); + copy = bfd_alloc (abfd, last - first + 1); if (copy == NULL) return NULL; @@ -1173,9 +1130,7 @@ normalize (abfd, file) #else static const char * -normalize (abfd, file) - bfd *abfd ATTRIBUTE_UNUSED; - const char *file; +normalize (bfd *abfd ATTRIBUTE_UNUSED, const char *file) { const char *filename = strrchr (file, '/'); @@ -1189,7 +1144,7 @@ normalize (abfd, file) filename = file + 1; } #endif - if (filename != (char *) NULL) + if (filename != NULL) filename++; else filename = file; @@ -1199,44 +1154,41 @@ normalize (abfd, file) /* Build a BFD style extended name table. */ -boolean -_bfd_archive_bsd_construct_extended_name_table (abfd, tabloc, tablen, name) - bfd *abfd; - char **tabloc; - bfd_size_type *tablen; - const char **name; +bfd_boolean +_bfd_archive_bsd_construct_extended_name_table (bfd *abfd, + char **tabloc, + bfd_size_type *tablen, + const char **name) { *name = "ARFILENAMES/"; - return _bfd_construct_extended_name_table (abfd, false, tabloc, tablen); + return _bfd_construct_extended_name_table (abfd, FALSE, tabloc, tablen); } /* Build an SVR4 style extended name table. */ -boolean -_bfd_archive_coff_construct_extended_name_table (abfd, tabloc, tablen, name) - bfd *abfd; - char **tabloc; - bfd_size_type *tablen; - const char **name; +bfd_boolean +_bfd_archive_coff_construct_extended_name_table (bfd *abfd, + char **tabloc, + bfd_size_type *tablen, + const char **name) { *name = "//"; - return _bfd_construct_extended_name_table (abfd, true, tabloc, tablen); + return _bfd_construct_extended_name_table (abfd, TRUE, tabloc, tablen); } /* Follows archive_head and produces an extended name table if necessary. Returns (in tabloc) a pointer to an extended name table, and in tablen the length of the table. If it makes an entry it clobbers the filename so that the element may be written without - further massage. Returns true if it ran successfully, false if + further massage. Returns TRUE if it ran successfully, FALSE if something went wrong. A successful return may still involve a zero-length tablen! */ -boolean -_bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen) - bfd *abfd; - boolean trailing_slash; - char **tabloc; - bfd_size_type *tablen; +bfd_boolean +_bfd_construct_extended_name_table (bfd *abfd, + bfd_boolean trailing_slash, + char **tabloc, + bfd_size_type *tablen) { unsigned int maxname = abfd->xvec->ar_max_namelen; bfd_size_type total_namelen = 0; @@ -1253,7 +1205,7 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen) normal = normalize (current, current->filename); if (normal == NULL) - return false; + return FALSE; thislen = strlen (normal); @@ -1289,11 +1241,11 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen) } if (total_namelen == 0) - return true; + return TRUE; *tabloc = bfd_zalloc (abfd, total_namelen); if (*tabloc == NULL) - return false; + return FALSE; *tablen = total_namelen; strptr = *tabloc; @@ -1306,7 +1258,7 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen) normal = normalize (current, current->filename); if (normal == NULL) - return false; + return FALSE; thislen = strlen (normal); if (thislen > maxname) @@ -1341,7 +1293,7 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen) } } - return true; + return TRUE; } /** A couple of functions for creating ar_hdrs */ @@ -1350,9 +1302,7 @@ _bfd_construct_extended_name_table (abfd, trailing_slash, tabloc, tablen) /* Function to encode large UID/GID values according to HP. */ static void -hpux_uid_gid_encode (str, id) - char str[6]; - long int id; +hpux_uid_gid_encode (char str[6], long int id) { int cnt; @@ -1378,10 +1328,7 @@ hpux_uid_gid_encode (str, id) is set, and it's an in-memory bfd, we fake it. */ static struct areltdata * -bfd_ar_hdr_from_filesystem (abfd, filename, member) - bfd *abfd; - const char *filename; - bfd *member; +bfd_ar_hdr_from_filesystem (bfd *abfd, const char *filename, bfd *member) { struct stat status; struct areltdata *ared; @@ -1392,7 +1339,7 @@ bfd_ar_hdr_from_filesystem (abfd, filename, member) if (member && (member->flags & BFD_IN_MEMORY) != 0) { /* Assume we just "made" the member, and fake it. */ - struct bfd_in_memory *bim = (struct bfd_in_memory *) member->iostream; + struct bfd_in_memory *bim = member->iostream; time (&status.st_mtime); status.st_uid = getuid (); status.st_gid = getgid (); @@ -1406,13 +1353,13 @@ bfd_ar_hdr_from_filesystem (abfd, filename, member) } amt = sizeof (struct ar_hdr) + sizeof (struct areltdata); - ared = (struct areltdata *) bfd_zalloc (abfd, amt); + ared = bfd_zalloc (abfd, amt); if (ared == NULL) return NULL; hdr = (struct ar_hdr *) (((char *) ared) + sizeof (struct areltdata)); /* ar headers are space padded, not null padded! */ - memset ((PTR) hdr, ' ', sizeof (struct ar_hdr)); + memset (hdr, ' ', sizeof (struct ar_hdr)); strncpy (hdr->ar_fmag, ARFMAG, 2); @@ -1458,12 +1405,10 @@ bfd_ar_hdr_from_filesystem (abfd, filename, member) a strong stomach to write this, and it does, but it takes even a stronger stomach to try to code around such a thing! */ -struct ar_hdr *bfd_special_undocumented_glue PARAMS ((bfd *, const char *)); +struct ar_hdr *bfd_special_undocumented_glue (bfd *, const char *); struct ar_hdr * -bfd_special_undocumented_glue (abfd, filename) - bfd *abfd; - const char *filename; +bfd_special_undocumented_glue (bfd *abfd, const char *filename) { struct areltdata *ar_elt = bfd_ar_hdr_from_filesystem (abfd, filename, 0); if (ar_elt == NULL) @@ -1474,9 +1419,7 @@ bfd_special_undocumented_glue (abfd, filename) /* Analogous to stat call. */ int -bfd_generic_stat_arch_elt (abfd, buf) - bfd *abfd; - struct stat *buf; +bfd_generic_stat_arch_elt (bfd *abfd, struct stat *buf) { struct ar_hdr *hdr; char *aloser; @@ -1531,10 +1474,7 @@ bfd_generic_stat_arch_elt (abfd, buf) } void -bfd_dont_truncate_arname (abfd, pathname, arhdr) - bfd *abfd; - const char *pathname; - char *arhdr; +bfd_dont_truncate_arname (bfd *abfd, const char *pathname, char *arhdr) { /* FIXME: This interacts unpleasantly with ar's quick-append option. Fortunately ic960 users will never use that option. Fixing this @@ -1571,10 +1511,7 @@ bfd_dont_truncate_arname (abfd, pathname, arhdr) } void -bfd_bsd_truncate_arname (abfd, pathname, arhdr) - bfd *abfd; - const char *pathname; - char *arhdr; +bfd_bsd_truncate_arname (bfd *abfd, const char *pathname, char *arhdr) { struct ar_hdr *hdr = (struct ar_hdr *) arhdr; size_t length; @@ -1622,10 +1559,7 @@ bfd_bsd_truncate_arname (abfd, pathname, arhdr) bsd ar. */ void -bfd_gnu_truncate_arname (abfd, pathname, arhdr) - bfd *abfd; - const char *pathname; - char *arhdr; +bfd_gnu_truncate_arname (bfd *abfd, const char *pathname, char *arhdr) { struct ar_hdr *hdr = (struct ar_hdr *) arhdr; size_t length; @@ -1669,16 +1603,16 @@ bfd_gnu_truncate_arname (abfd, pathname, arhdr) /* The BFD is open for write and has its format set to bfd_archive. */ -boolean -_bfd_write_archive_contents (arch) - bfd *arch; +bfd_boolean +_bfd_write_archive_contents (bfd *arch) { bfd *current; char *etable = NULL; bfd_size_type elength = 0; const char *ename = NULL; - boolean makemap = bfd_has_map (arch); - boolean hasobjects = false; /* If no .o's, don't bother to make a map. */ + bfd_boolean makemap = bfd_has_map (arch); + /* If no .o's, don't bother to make a map. */ + bfd_boolean hasobjects = FALSE; bfd_size_type wrote; unsigned int i; int tries; @@ -1696,19 +1630,18 @@ _bfd_write_archive_contents (arch) if (bfd_write_p (current)) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } if (!current->arelt_data) { current->arelt_data = - (PTR) bfd_ar_hdr_from_filesystem (arch, current->filename, current); + bfd_ar_hdr_from_filesystem (arch, current->filename, current); if (!current->arelt_data) - return false; + return FALSE; /* Put in the file name. */ - BFD_SEND (arch, _bfd_truncate_arname, (arch, - current->filename, - (char *) arch_hdr (current))); + BFD_SEND (arch, _bfd_truncate_arname, + (arch, current->filename, (char *) arch_hdr (current))); } if (makemap && ! hasobjects) @@ -1718,35 +1651,35 @@ _bfd_write_archive_contents (arch) && ((bfd_get_file_flags (current) & HAS_SYMS)) #endif ) - hasobjects = true; + hasobjects = TRUE; } } if (!BFD_SEND (arch, _bfd_construct_extended_name_table, (arch, &etable, &elength, &ename))) - return false; + return FALSE; if (bfd_seek (arch, (file_ptr) 0, SEEK_SET) != 0) - return false; + return FALSE; #ifdef GNU960 - wrote = bfd_bwrite (BFD_GNU960_ARMAG (arch), (bfd_size_type) SARMAG, arch); + wrote = bfd_bwrite (BFD_GNU960_ARMAG (arch), SARMAG, arch); #else - wrote = bfd_bwrite (ARMAG, (bfd_size_type) SARMAG, arch); + wrote = bfd_bwrite (ARMAG, SARMAG, arch); #endif if (wrote != SARMAG) - return false; + return FALSE; if (makemap && hasobjects) { if (! _bfd_compute_and_write_armap (arch, (unsigned int) elength)) - return false; + return FALSE; } if (elength != 0) { struct ar_hdr hdr; - memset ((char *) (&hdr), 0, sizeof (struct ar_hdr)); + memset (&hdr, 0, sizeof (struct ar_hdr)); strcpy (hdr.ar_name, ename); /* Round size up to even number in archive header. */ sprintf (&(hdr.ar_size[0]), "%-10d", @@ -1755,14 +1688,14 @@ _bfd_write_archive_contents (arch) for (i = 0; i < sizeof (struct ar_hdr); i++) if (((char *) (&hdr))[i] == '\0') (((char *) (&hdr))[i]) = ' '; - if ((bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch) + if ((bfd_bwrite (&hdr, sizeof (struct ar_hdr), arch) != sizeof (struct ar_hdr)) || bfd_bwrite (etable, elength, arch) != elength) - return false; + return FALSE; if ((elength % 2) == 1) { - if (bfd_bwrite ("\012", (bfd_size_type) 1, arch) != 1) - return false; + if (bfd_bwrite ("\012", 1, arch) != 1) + return FALSE; } } @@ -1773,31 +1706,31 @@ _bfd_write_archive_contents (arch) struct ar_hdr *hdr = arch_hdr (current); /* Write ar header. */ - if (bfd_bwrite ((PTR) hdr, (bfd_size_type) sizeof (*hdr), arch) + if (bfd_bwrite (hdr, sizeof (*hdr), arch) != sizeof (*hdr)) - return false; + return FALSE; if (bfd_seek (current, (file_ptr) 0, SEEK_SET) != 0) - return false; + return FALSE; while (remaining) { unsigned int amt = DEFAULT_BUFFERSIZE; if (amt > remaining) amt = remaining; errno = 0; - if (bfd_bread (buffer, (bfd_size_type) amt, current) != amt) + if (bfd_bread (buffer, amt, current) != amt) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_malformed_archive); - return false; + return FALSE; } - if (bfd_bwrite (buffer, (bfd_size_type) amt, arch) != amt) - return false; + if (bfd_bwrite (buffer, amt, arch) != amt) + return FALSE; remaining -= amt; } if ((arelt_size (current) % 2) == 1) { - if (bfd_bwrite ("\012", (bfd_size_type) 1, arch) != 1) - return false; + if (bfd_bwrite ("\012", 1, arch) != 1) + return FALSE; } } @@ -1820,15 +1753,13 @@ _bfd_write_archive_contents (arch) while (++tries < 6); } - return true; + return TRUE; } /* Note that the namidx for the first symbol is 0. */ -boolean -_bfd_compute_and_write_armap (arch, elength) - bfd *arch; - unsigned int elength; +bfd_boolean +_bfd_compute_and_write_armap (bfd *arch, unsigned int elength) { char *first_name = NULL; bfd *current; @@ -1839,7 +1770,7 @@ _bfd_compute_and_write_armap (arch, elength) int stridx = 0; /* string index */ asymbol **syms = NULL; long syms_max = 0; - boolean ret; + bfd_boolean ret; bfd_size_type amt; /* Dunno if this is the best place for this info... */ @@ -1847,14 +1778,14 @@ _bfd_compute_and_write_armap (arch, elength) elength += sizeof (struct ar_hdr); elength += elength % 2; - amt = (bfd_size_type) orl_max * sizeof (struct orl); - map = (struct orl *) bfd_malloc (amt); + amt = orl_max * sizeof (struct orl); + map = bfd_malloc (amt); if (map == NULL) goto error_return; /* We put the symbol names on the arch objalloc, and then discard them when done. */ - first_name = bfd_alloc (arch, (bfd_size_type) 1); + first_name = bfd_alloc (arch, 1); if (first_name == NULL) goto error_return; @@ -1865,7 +1796,7 @@ _bfd_compute_and_write_armap (arch, elength) /* Map over each element. */ for (current = arch->archive_head; - current != (bfd *) NULL; + current != NULL; current = current->next, elt_no++) { if (bfd_check_format (current, bfd_object) @@ -1886,7 +1817,7 @@ _bfd_compute_and_write_armap (arch, elength) if (syms_max > 0) free (syms); syms_max = storage; - syms = (asymbol **) bfd_malloc ((bfd_size_type) syms_max); + syms = bfd_malloc (syms_max); if (syms == NULL) goto error_return; } @@ -1914,9 +1845,9 @@ _bfd_compute_and_write_armap (arch, elength) if (orl_count == orl_max) { orl_max *= 2; - amt = (bfd_size_type) orl_max * sizeof (struct orl); - new_map = (struct orl *) bfd_realloc (map, amt); - if (new_map == (struct orl *) NULL) + amt = orl_max * sizeof (struct orl); + new_map = bfd_realloc (map, amt); + if (new_map == NULL) goto error_return; map = new_map; @@ -1924,7 +1855,7 @@ _bfd_compute_and_write_armap (arch, elength) namelen = strlen (syms[src_count]->name); amt = sizeof (char *); - map[orl_count].name = (char **) bfd_alloc (arch, amt); + map[orl_count].name = bfd_alloc (arch, amt); if (map[orl_count].name == NULL) goto error_return; *(map[orl_count].name) = bfd_alloc (arch, namelen + 1); @@ -1968,16 +1899,15 @@ _bfd_compute_and_write_armap (arch, elength) if (first_name != NULL) bfd_release (arch, first_name); - return false; + return FALSE; } -boolean -bsd_write_armap (arch, elength, map, orl_count, stridx) - bfd *arch; - unsigned int elength; - struct orl *map; - unsigned int orl_count; - int stridx; +bfd_boolean +bsd_write_armap (bfd *arch, + unsigned int elength, + struct orl *map, + unsigned int orl_count, + int stridx) { int padit = stridx & 1; unsigned int ranlibsize = orl_count * BSD_SYMDEF_SIZE; @@ -1996,7 +1926,7 @@ bsd_write_armap (arch, elength, map, orl_count, stridx) firstreal = mapsize + elength + sizeof (struct ar_hdr) + SARMAG; stat (arch->filename, &statbuf); - memset ((char *) (&hdr), 0, sizeof (struct ar_hdr)); + memset (&hdr, 0, sizeof (struct ar_hdr)); sprintf (hdr.ar_name, RANLIBMAG); /* Remember the timestamp, to keep it holy. But fudge it a little. */ bfd_ardata (arch)->armap_timestamp = statbuf.st_mtime + ARMAP_TIME_OFFSET; @@ -2010,12 +1940,12 @@ bsd_write_armap (arch, elength, map, orl_count, stridx) for (i = 0; i < sizeof (struct ar_hdr); i++) if (((char *) (&hdr))[i] == '\0') (((char *) (&hdr))[i]) = ' '; - if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch) + if (bfd_bwrite (&hdr, sizeof (struct ar_hdr), arch) != sizeof (struct ar_hdr)) - return false; + return FALSE; H_PUT_32 (arch, ranlibsize, temp); - if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), arch) != sizeof (temp)) - return false; + if (bfd_bwrite (temp, sizeof (temp), arch) != sizeof (temp)) + return FALSE; for (count = 0; count < orl_count; count++) { @@ -2035,43 +1965,42 @@ bsd_write_armap (arch, elength, map, orl_count, stridx) last_elt = current; H_PUT_32 (arch, map[count].namidx, buf); H_PUT_32 (arch, firstreal, buf + BSD_SYMDEF_OFFSET_SIZE); - if (bfd_bwrite (buf, (bfd_size_type) BSD_SYMDEF_SIZE, arch) + if (bfd_bwrite (buf, BSD_SYMDEF_SIZE, arch) != BSD_SYMDEF_SIZE) - return false; + return FALSE; } /* Now write the strings themselves. */ H_PUT_32 (arch, stringsize, temp); - if (bfd_bwrite (temp, (bfd_size_type) sizeof (temp), arch) != sizeof (temp)) - return false; + if (bfd_bwrite (temp, sizeof (temp), arch) != sizeof (temp)) + return FALSE; for (count = 0; count < orl_count; count++) { size_t len = strlen (*map[count].name) + 1; - if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len) - return false; + if (bfd_bwrite (*map[count].name, len, arch) != len) + return FALSE; } /* The spec sez this should be a newline. But in order to be bug-compatible for sun's ar we use a null. */ if (padit) { - if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1) - return false; + if (bfd_bwrite ("", 1, arch) != 1) + return FALSE; } - return true; + return TRUE; } /* At the end of archive file handling, update the timestamp in the file, so the linker will accept it. - Return true if the timestamp was OK, or an unusual problem happened. - Return false if we updated the timestamp. */ + Return TRUE if the timestamp was OK, or an unusual problem happened. + Return FALSE if we updated the timestamp. */ -boolean -_bfd_archive_bsd_update_armap_timestamp (arch) - bfd *arch; +bfd_boolean +_bfd_archive_bsd_update_armap_timestamp (bfd *arch) { struct stat archstat; struct ar_hdr hdr; @@ -2082,14 +2011,14 @@ _bfd_archive_bsd_update_armap_timestamp (arch) bfd_flush (arch); if (bfd_stat (arch, &archstat) == -1) { - perror (_("Reading archive file mod timestamp")); + bfd_perror (_("Reading archive file mod timestamp")); /* Can't read mod time for some reason. */ - return true; + return TRUE; } if (archstat.st_mtime <= bfd_ardata (arch)->armap_timestamp) /* OK by the linker's rules. */ - return true; + return TRUE; /* Update the timestamp. */ bfd_ardata (arch)->armap_timestamp = archstat.st_mtime + ARMAP_TIME_OFFSET; @@ -2105,18 +2034,17 @@ _bfd_archive_bsd_update_armap_timestamp (arch) bfd_ardata (arch)->armap_datepos = (SARMAG + offsetof (struct ar_hdr, ar_date[0])); if (bfd_seek (arch, bfd_ardata (arch)->armap_datepos, SEEK_SET) != 0 - || (bfd_bwrite (hdr.ar_date, (bfd_size_type) sizeof (hdr.ar_date), arch) + || (bfd_bwrite (hdr.ar_date, sizeof (hdr.ar_date), arch) != sizeof (hdr.ar_date))) { - /* FIXME: bfd can't call perror. */ - perror (_("Writing updated armap timestamp")); + bfd_perror (_("Writing updated armap timestamp")); /* Some error while writing. */ - return true; + return TRUE; } /* We updated the timestamp successfully. */ - return false; + return FALSE; } /* A coff armap looks like : @@ -2133,13 +2061,12 @@ _bfd_archive_bsd_update_armap_timestamp (arch) symbol name n-1 */ -boolean -coff_write_armap (arch, elength, map, symbol_count, stridx) - bfd *arch; - unsigned int elength; - struct orl *map; - unsigned int symbol_count; - int stridx; +bfd_boolean +coff_write_armap (bfd *arch, + unsigned int elength, + struct orl *map, + unsigned int symbol_count, + int stridx) { /* The size of the ranlib is the number of exported symbols in the archive * the number of bytes in an int, + an int for the count. */ @@ -2162,7 +2089,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) + sizeof (struct ar_hdr) + SARMAG); - memset ((char *) (&hdr), 0, sizeof (struct ar_hdr)); + memset (&hdr, 0, sizeof (struct ar_hdr)); hdr.ar_name[0] = '/'; sprintf (hdr.ar_size, "%-10d", (int) mapsize); sprintf (hdr.ar_date, "%ld", (long) time (NULL)); @@ -2178,12 +2105,12 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) /* Write the ar header for this item and the number of symbols. */ - if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch) + if (bfd_bwrite (&hdr, sizeof (struct ar_hdr), arch) != sizeof (struct ar_hdr)) - return false; + return FALSE; if (!bfd_write_bigendian_4byte_int (arch, symbol_count)) - return false; + return FALSE; /* Two passes, first write the file offsets for each symbol - remembering that each offset is on a two byte boundary. */ @@ -2193,7 +2120,7 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) current = arch->archive_head; count = 0; - while (current != (bfd *) NULL && count < symbol_count) + while (current != NULL && count < symbol_count) { /* For each symbol which is used defined in this object, write out the object file's address in the archive. */ @@ -2201,12 +2128,11 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) while (count < symbol_count && map[count].u.abfd == current) { if (!bfd_write_bigendian_4byte_int (arch, archive_member_file_ptr)) - return false; + return FALSE; count++; } /* Add size of this archive entry. */ - archive_member_file_ptr += (arelt_size (current) - + sizeof (struct ar_hdr)); + archive_member_file_ptr += arelt_size (current) + sizeof (struct ar_hdr); /* Remember aboout the even alignment. */ archive_member_file_ptr += archive_member_file_ptr % 2; current = current->next; @@ -2217,17 +2143,17 @@ coff_write_armap (arch, elength, map, symbol_count, stridx) { size_t len = strlen (*map[count].name) + 1; - if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len) - return false; + if (bfd_bwrite (*map[count].name, len, arch) != len) + return FALSE; } /* The spec sez this should be a newline. But in order to be bug-compatible for arc960 we use a null. */ if (padit) { - if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1) - return false; + if (bfd_bwrite ("", 1, arch) != 1) + return FALSE; } - return true; + return TRUE; } diff --git a/contrib/binutils/bfd/archive64.c b/contrib/binutils/bfd/archive64.c index ea94c6a..1b9f5f3 100644 --- a/contrib/binutils/bfd/archive64.c +++ b/contrib/binutils/bfd/archive64.c @@ -1,5 +1,5 @@ /* MIPS-specific support for 64-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Ian Lance Taylor, Cygnus Support Linker support added by Mark Mitchell, CodeSourcery, LLC. @@ -31,15 +31,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Irix 6 defines a 64bit archive map format, so that they can have archives more than 4 GB in size. */ -boolean bfd_elf64_archive_slurp_armap PARAMS ((bfd *)); -boolean bfd_elf64_archive_write_armap - PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); +bfd_boolean bfd_elf64_archive_slurp_armap (bfd *); +bfd_boolean bfd_elf64_archive_write_armap + (bfd *, unsigned int, struct orl *, unsigned int, int); /* Read an Irix 6 armap. */ -boolean -bfd_elf64_archive_slurp_armap (abfd) - bfd *abfd; +bfd_boolean +bfd_elf64_archive_slurp_armap (bfd *abfd) { struct artdata *ardata = bfd_ardata (abfd); char nextname[17]; @@ -56,14 +55,14 @@ bfd_elf64_archive_slurp_armap (abfd) /* Get the name of the first element. */ arhdrpos = bfd_tell (abfd); - i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd); + i = bfd_bread (nextname, 16, abfd); if (i == 0) - return true; + return TRUE; if (i != 16) - return false; + return FALSE; if (bfd_seek (abfd, (file_ptr) - 16, SEEK_CUR) != 0) - return false; + return FALSE; /* Archives with traditional armaps are still permitted. */ if (strncmp (nextname, "/ ", 16) == 0) @@ -71,21 +70,21 @@ bfd_elf64_archive_slurp_armap (abfd) if (strncmp (nextname, "/SYM64/ ", 16) != 0) { - bfd_has_map (abfd) = false; - return true; + bfd_has_map (abfd) = FALSE; + return TRUE; } mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd); if (mapdata == NULL) - return false; + return FALSE; parsed_size = mapdata->parsed_size; - bfd_release (abfd, (PTR) mapdata); + bfd_release (abfd, mapdata); - if (bfd_bread (int_buf, (bfd_size_type) 8, abfd) != 8) + if (bfd_bread (int_buf, 8, abfd) != 8) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_malformed_archive); - return false; + return FALSE; } nsymz = bfd_getb64 (int_buf); @@ -95,13 +94,13 @@ bfd_elf64_archive_slurp_armap (abfd) ptrsize = 8 * nsymz; amt = carsym_size + stringsize + 1; - ardata->symdefs = (carsym *) bfd_zalloc (abfd, amt); + ardata->symdefs = bfd_zalloc (abfd, amt); if (ardata->symdefs == NULL) - return false; + return FALSE; carsyms = ardata->symdefs; stringbase = ((char *) ardata->symdefs) + carsym_size; - raw_armap = (bfd_byte *) bfd_alloc (abfd, ptrsize); + raw_armap = bfd_alloc (abfd, ptrsize); if (raw_armap == NULL) goto release_symdefs; @@ -127,29 +126,28 @@ bfd_elf64_archive_slurp_armap (abfd) /* Pad to an even boundary if you have to. */ ardata->first_file_filepos += (ardata->first_file_filepos) % 2; - bfd_has_map (abfd) = true; + bfd_has_map (abfd) = TRUE; bfd_release (abfd, raw_armap); - return true; + return TRUE; release_raw_armap: bfd_release (abfd, raw_armap); release_symdefs: bfd_release (abfd, ardata->symdefs); - return false; + return FALSE; } /* Write out an Irix 6 armap. The Irix 6 tools are supposed to be able to handle ordinary ELF armaps, but at least on Irix 6.2 the linker crashes. */ -boolean -bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx) - bfd *arch; - unsigned int elength; - struct orl *map; - unsigned int symbol_count; - int stridx; +bfd_boolean +bfd_elf64_archive_write_armap (bfd *arch, + unsigned int elength, + struct orl *map, + unsigned int symbol_count, + int stridx) { unsigned int ranlibsize = (symbol_count * 8) + 8; unsigned int stringsize = stridx; @@ -171,7 +169,7 @@ bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx) + sizeof (struct ar_hdr) + SARMAG); - memset ((char *) (&hdr), 0, sizeof (struct ar_hdr)); + memset (&hdr, 0, sizeof (struct ar_hdr)); strcpy (hdr.ar_name, "/SYM64/"); sprintf (hdr.ar_size, "%-10d", (int) mapsize); sprintf (hdr.ar_date, "%ld", (long) time (NULL)); @@ -187,13 +185,13 @@ bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx) /* Write the ar header for this item and the number of symbols */ - if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), arch) + if (bfd_bwrite (&hdr, sizeof (struct ar_hdr), arch) != sizeof (struct ar_hdr)) - return false; + return FALSE; bfd_putb64 ((bfd_vma) symbol_count, buf); - if (bfd_bwrite (buf, (bfd_size_type) 8, arch) != 8) - return false; + if (bfd_bwrite (buf, 8, arch) != 8) + return FALSE; /* Two passes, first write the file offsets for each symbol - remembering that each offset is on a two byte boundary. */ @@ -203,7 +201,7 @@ bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx) current = arch->archive_head; count = 0; - while (current != (bfd *) NULL && count < symbol_count) + while (current != NULL && count < symbol_count) { /* For each symbol which is used defined in this object, write out the object file's address in the archive */ @@ -211,8 +209,8 @@ bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx) while (map[count].u.abfd == current) { bfd_putb64 ((bfd_vma) archive_member_file_ptr, buf); - if (bfd_bwrite (buf, (bfd_size_type) 8, arch) != 8) - return false; + if (bfd_bwrite (buf, 8, arch) != 8) + return FALSE; count++; } /* Add size of this archive entry */ @@ -228,18 +226,18 @@ bfd_elf64_archive_write_armap (arch, elength, map, symbol_count, stridx) { size_t len = strlen (*map[count].name) + 1; - if (bfd_bwrite (*map[count].name, (bfd_size_type) len, arch) != len) - return false; + if (bfd_bwrite (*map[count].name, len, arch) != len) + return FALSE; } /* The spec says that this should be padded to an 8 byte boundary. However, the Irix 6.2 tools do not appear to do this. */ while (padding != 0) { - if (bfd_bwrite ("", (bfd_size_type) 1, arch) != 1) - return false; + if (bfd_bwrite ("", 1, arch) != 1) + return FALSE; --padding; } - return true; + return TRUE; } diff --git a/contrib/binutils/bfd/archures.c b/contrib/binutils/bfd/archures.c index 063e4fb..f8aeeef 100644 --- a/contrib/binutils/bfd/archures.c +++ b/contrib/binutils/bfd/archures.c @@ -1,24 +1,24 @@ /* BFD library support routines for architectures. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Hacked by John Gilmore and Steve Chamberlain of Cygnus Support. -This file is part of BFD, the Binary File Descriptor library. + 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" @@ -84,6 +84,7 @@ DESCRIPTION .#define bfd_mach_mcf5206e 10 .#define bfd_mach_mcf5307 11 .#define bfd_mach_mcf5407 12 +.#define bfd_mach_mcf528x 13 . bfd_arch_vax, {* DEC Vax *} . bfd_arch_i960, {* Intel 960 *} . {* The order of the following is important. @@ -129,12 +130,16 @@ DESCRIPTION .#define bfd_mach_mips4010 4010 .#define bfd_mach_mips4100 4100 .#define bfd_mach_mips4111 4111 +.#define bfd_mach_mips4120 4120 .#define bfd_mach_mips4300 4300 .#define bfd_mach_mips4400 4400 .#define bfd_mach_mips4600 4600 .#define bfd_mach_mips4650 4650 .#define bfd_mach_mips5000 5000 +.#define bfd_mach_mips5400 5400 +.#define bfd_mach_mips5500 5500 .#define bfd_mach_mips6000 6000 +.#define bfd_mach_mips7000 7000 .#define bfd_mach_mips8000 8000 .#define bfd_mach_mips10000 10000 .#define bfd_mach_mips12000 12000 @@ -142,13 +147,15 @@ DESCRIPTION .#define bfd_mach_mips5 5 .#define bfd_mach_mips_sb1 12310201 {* octal 'SB', 01 *} .#define bfd_mach_mipsisa32 32 +.#define bfd_mach_mipsisa32r2 33 .#define bfd_mach_mipsisa64 64 +.#define bfd_mach_mipsisa64r2 65 . 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 +.#define bfd_mach_i386_i386 1 +.#define bfd_mach_i386_i8086 2 +.#define bfd_mach_i386_i386_intel_syntax 3 +.#define bfd_mach_x86_64 64 +.#define bfd_mach_x86_64_intel_syntax 65 . bfd_arch_we32k, {* AT&T WE32xxx *} . bfd_arch_tahoe, {* CCI/Harris Tahoe *} . bfd_arch_i860, {* Intel 860 *} @@ -157,15 +164,20 @@ DESCRIPTION . bfd_arch_alliant, {* Alliant *} . bfd_arch_convex, {* Convex *} . bfd_arch_m88k, {* Motorola 88xxx *} +. bfd_arch_m98k, {* Motorola 98xxx *} . 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_h8300, {* Renesas H8/300 (formerly Hitachi H8/300) *} +.#define bfd_mach_h8300 1 +.#define bfd_mach_h8300h 2 +.#define bfd_mach_h8300s 3 +.#define bfd_mach_h8300hn 4 +.#define bfd_mach_h8300sn 5 +.#define bfd_mach_h8300sx 6 +.#define bfd_mach_h8300sxn 7 . bfd_arch_pdp11, {* DEC PDP-11 *} . bfd_arch_powerpc, {* PowerPC *} -.#define bfd_mach_ppc 0 -.#define bfd_mach_ppc64 1 +.#define bfd_mach_ppc 32 +.#define bfd_mach_ppc64 64 .#define bfd_mach_ppc_403 403 .#define bfd_mach_ppc_403gc 4030 .#define bfd_mach_ppc_505 505 @@ -182,38 +194,52 @@ DESCRIPTION .#define bfd_mach_ppc_rs64ii 642 .#define bfd_mach_ppc_rs64iii 643 .#define bfd_mach_ppc_7400 7400 +.#define bfd_mach_ppc_e500 500 . bfd_arch_rs6000, {* IBM RS/6000 *} -.#define bfd_mach_rs6k 0 +.#define bfd_mach_rs6k 6000 .#define bfd_mach_rs6k_rs1 6001 .#define bfd_mach_rs6k_rsc 6003 .#define bfd_mach_rs6k_rs2 6002 . bfd_arch_hppa, {* HP PA RISC *} +.#define bfd_mach_hppa10 10 +.#define bfd_mach_hppa11 11 +.#define bfd_mach_hppa20 20 +.#define bfd_mach_hppa20w 25 . bfd_arch_d10v, {* Mitsubishi D10V *} -.#define bfd_mach_d10v 0 +.#define bfd_mach_d10v 1 .#define bfd_mach_d10v_ts2 2 .#define bfd_mach_d10v_ts3 3 . bfd_arch_d30v, {* Mitsubishi D30V *} . bfd_arch_dlx, {* DLX *} . bfd_arch_m68hc11, {* Motorola 68HC11 *} . bfd_arch_m68hc12, {* Motorola 68HC12 *} +.#define bfd_mach_m6812_default 0 +.#define bfd_mach_m6812 1 +.#define bfd_mach_m6812s 2 . 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 *} -.#define bfd_mach_sh 0 +. bfd_arch_h8500, {* Renesas H8/500 (formerly Hitachi H8/500) *} +. bfd_arch_sh, {* Renesas / SuperH SH (formerly Hitachi SH) *} +.#define bfd_mach_sh 1 .#define bfd_mach_sh2 0x20 .#define bfd_mach_sh_dsp 0x2d +.#define bfd_mach_sh2e 0x2e .#define bfd_mach_sh3 0x30 .#define bfd_mach_sh3_dsp 0x3d .#define bfd_mach_sh3e 0x3e .#define bfd_mach_sh4 0x40 +.#define bfd_mach_sh4_nofpu 0x41 +.#define bfd_mach_sh4a 0x4a +.#define bfd_mach_sh4a_nofpu 0x4b +.#define bfd_mach_sh4al_dsp 0x4d .#define bfd_mach_sh5 0x50 . 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. *} +.#define bfd_mach_arm_unknown 0 .#define bfd_mach_arm_2 1 .#define bfd_mach_arm_2a 2 .#define bfd_mach_arm_3 3 @@ -224,40 +250,54 @@ DESCRIPTION .#define bfd_mach_arm_5T 8 .#define bfd_mach_arm_5TE 9 .#define bfd_mach_arm_XScale 10 +.#define bfd_mach_arm_ep9312 11 +.#define bfd_mach_arm_iWMMXt 12 . bfd_arch_ns32k, {* National Semiconductors ns32000 *} . bfd_arch_w65, {* WDC 65816 *} . bfd_arch_tic30, {* Texas Instruments TMS320C30 *} +. bfd_arch_tic4x, {* Texas Instruments TMS320C3X/4X *} +.#define bfd_mach_tic3x 30 +.#define bfd_mach_tic4x 40 . 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_v850 1 .#define bfd_mach_v850e 'E' -.#define bfd_mach_v850ea 'A' +.#define bfd_mach_v850e1 '1' . 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 {* For backwards compatibility. *} +.#define bfd_mach_arc_5 5 +.#define bfd_mach_arc_6 6 +.#define bfd_mach_arc_7 7 +.#define bfd_mach_arc_8 8 +. bfd_arch_m32r, {* Renesas M32R (formerly Mitsubishi M32R/D) *} +.#define bfd_mach_m32r 1 {* For backwards compatibility. *} .#define bfd_mach_m32rx 'x' +.#define bfd_mach_m32r2 '2' . bfd_arch_mn10200, {* Matsushita MN10200 *} . bfd_arch_mn10300, {* Matsushita MN10300 *} .#define bfd_mach_mn10300 300 .#define bfd_mach_am33 330 +.#define bfd_mach_am33_2 332 . bfd_arch_fr30, .#define bfd_mach_fr30 0x46523330 . bfd_arch_frv, -.#define bfd_mach_frv 0 -.#define bfd_mach_frvsimple 1 +.#define bfd_mach_frv 1 +.#define bfd_mach_frvsimple 2 .#define bfd_mach_fr300 300 .#define bfd_mach_fr400 400 .#define bfd_mach_frvtomcat 499 {* fr500 prototype *} .#define bfd_mach_fr500 500 +.#define bfd_mach_fr550 550 . bfd_arch_mcore, . bfd_arch_ia64, {* HP/Intel ia64 *} -.#define bfd_mach_ia64_elf64 0 -.#define bfd_mach_ia64_elf32 1 +.#define bfd_mach_ia64_elf64 64 +.#define bfd_mach_ia64_elf32 32 +. bfd_arch_ip2k, {* Ubicom IP2K microcontrollers. *} +.#define bfd_mach_ip2022 1 +.#define bfd_mach_ip2022ext 2 +. bfd_arch_iq2000, {* Vitesse IQ2000. *} +.#define bfd_mach_iq2000 1 +.#define bfd_mach_iq10 2 . bfd_arch_pj, . bfd_arch_avr, {* Atmel AVR microcontrollers. *} .#define bfd_mach_avr1 1 @@ -267,12 +307,29 @@ DESCRIPTION .#define bfd_mach_avr5 5 . bfd_arch_cris, {* Axis CRIS *} . bfd_arch_s390, {* IBM s390 *} -.#define bfd_mach_s390_31 0 -.#define bfd_mach_s390_64 1 +.#define bfd_mach_s390_31 31 +.#define bfd_mach_s390_64 64 . bfd_arch_openrisc, {* OpenRISC *} . bfd_arch_mmix, {* Donald Knuth's educational processor. *} . bfd_arch_xstormy16, -.#define bfd_mach_xstormy16 0 +.#define bfd_mach_xstormy16 1 +. bfd_arch_msp430, {* Texas Instruments MSP430 architecture. *} +.#define bfd_mach_msp11 11 +.#define bfd_mach_msp110 110 +.#define bfd_mach_msp12 12 +.#define bfd_mach_msp13 13 +.#define bfd_mach_msp14 14 +.#define bfd_mach_msp15 15 +.#define bfd_mach_msp16 16 +.#define bfd_mach_msp31 31 +.#define bfd_mach_msp32 32 +.#define bfd_mach_msp33 33 +.#define bfd_mach_msp41 41 +.#define bfd_mach_msp42 42 +.#define bfd_mach_msp43 43 +.#define bfd_mach_msp44 44 +. bfd_arch_xtensa, {* Tensilica's Xtensa cores. *} +.#define bfd_mach_xtensa 1 . bfd_arch_last . }; */ @@ -296,15 +353,14 @@ DESCRIPTION . 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. . The default arch should be the first entry for an arch so that . all the entries for that arch can be accessed via <>. *} -. boolean the_default; +. bfd_boolean the_default; . const struct bfd_arch_info * (*compatible) -. PARAMS ((const struct bfd_arch_info *a, -. const struct bfd_arch_info *b)); +. (const struct bfd_arch_info *a, const struct bfd_arch_info *b); . -. boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *)); +. bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); . . const struct bfd_arch_info *next; .} @@ -331,6 +387,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_ia64_arch; +extern const bfd_arch_info_type bfd_ip2k_arch; +extern const bfd_arch_info_type bfd_iq2000_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; @@ -341,6 +399,7 @@ extern const bfd_arch_info_type bfd_mips_arch; extern const bfd_arch_info_type bfd_mmix_arch; extern const bfd_arch_info_type bfd_mn10200_arch; extern const bfd_arch_info_type bfd_mn10300_arch; +extern const bfd_arch_info_type bfd_msp430_arch; extern const bfd_arch_info_type bfd_ns32k_arch; extern const bfd_arch_info_type bfd_openrisc_arch; extern const bfd_arch_info_type bfd_or32_arch; @@ -353,6 +412,7 @@ extern const bfd_arch_info_type bfd_s390_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_tic4x_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_v850_arch; @@ -360,6 +420,7 @@ extern const bfd_arch_info_type bfd_vax_arch; extern const bfd_arch_info_type bfd_we32k_arch; extern const bfd_arch_info_type bfd_w65_arch; extern const bfd_arch_info_type bfd_xstormy16_arch; +extern const bfd_arch_info_type bfd_xtensa_arch; extern const bfd_arch_info_type bfd_z8k_arch; static const bfd_arch_info_type * const bfd_archures_list[] = @@ -386,6 +447,8 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_i860_arch, &bfd_i960_arch, &bfd_ia64_arch, + &bfd_ip2k_arch, + &bfd_iq2000_arch, &bfd_m32r_arch, &bfd_m68hc11_arch, &bfd_m68hc12_arch, @@ -396,6 +459,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_mmix_arch, &bfd_mn10200_arch, &bfd_mn10300_arch, + &bfd_msp430_arch, &bfd_ns32k_arch, &bfd_openrisc_arch, &bfd_or32_arch, @@ -406,6 +470,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_sh_arch, &bfd_sparc_arch, &bfd_tic30_arch, + &bfd_tic4x_arch, &bfd_tic54x_arch, &bfd_tic80_arch, &bfd_v850_arch, @@ -413,6 +478,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_w65_arch, &bfd_we32k_arch, &bfd_xstormy16_arch, + &bfd_xtensa_arch, &bfd_z8k_arch, #endif 0 @@ -423,7 +489,7 @@ FUNCTION bfd_printable_name SYNOPSIS - const char *bfd_printable_name(bfd *abfd); + const char *bfd_printable_name (bfd *abfd); DESCRIPTION Return a printable string representing the architecture and machine @@ -432,8 +498,7 @@ DESCRIPTION */ const char * -bfd_printable_name (abfd) - bfd *abfd; +bfd_printable_name (bfd *abfd) { return abfd->arch_info->printable_name; } @@ -443,7 +508,7 @@ FUNCTION bfd_scan_arch SYNOPSIS - const bfd_arch_info_type *bfd_scan_arch(const char *string); + const bfd_arch_info_type *bfd_scan_arch (const char *string); DESCRIPTION Figure out if BFD supports any cpu which could be described with @@ -452,8 +517,7 @@ DESCRIPTION */ const bfd_arch_info_type * -bfd_scan_arch (string) - const char *string; +bfd_scan_arch (const char *string) { const bfd_arch_info_type * const *app, *ap; @@ -475,7 +539,7 @@ FUNCTION bfd_arch_list SYNOPSIS - const char **bfd_arch_list(void); + const char **bfd_arch_list (void); DESCRIPTION Return a freshly malloced NULL-terminated vector of the names @@ -483,7 +547,7 @@ DESCRIPTION */ const char ** -bfd_arch_list () +bfd_arch_list (void) { int vec_length = 0; const char **name_ptr; @@ -503,7 +567,7 @@ bfd_arch_list () } amt = (vec_length + 1) * sizeof (char **); - name_list = (const char **) bfd_malloc (amt); + name_list = bfd_malloc (amt); if (name_list == NULL) return NULL; @@ -528,29 +592,38 @@ FUNCTION bfd_arch_get_compatible SYNOPSIS - const bfd_arch_info_type *bfd_arch_get_compatible( - const bfd *abfd, - const bfd *bbfd); + const bfd_arch_info_type *bfd_arch_get_compatible + (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns); DESCRIPTION - Determine whether two BFDs' - architectures and machine types are compatible. Calculates - the lowest common denominator between the two architectures - and machine types implied by the BFDs and returns a pointer to - an <> structure describing the compatible machine. + Determine whether two BFDs' architectures and machine types + are compatible. Calculates the lowest common denominator + between the two architectures and machine types implied by + the BFDs and returns a pointer to an <> structure + describing the compatible machine. */ const bfd_arch_info_type * -bfd_arch_get_compatible (abfd, bbfd) - const bfd *abfd; - const bfd *bbfd; +bfd_arch_get_compatible (const bfd *abfd, + const bfd *bbfd, + bfd_boolean accept_unknowns) { - /* 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; - if (bbfd->arch_info->arch == bfd_arch_unknown) - return abfd->arch_info; + const bfd * ubfd = NULL; + + /* Look for an unknown architecture. */ + if (((ubfd = abfd) && ubfd->arch_info->arch == bfd_arch_unknown) + || ((ubfd = bbfd) && ubfd->arch_info->arch == bfd_arch_unknown)) + { + /* We can allow an unknown architecture if accept_unknowns + is true, or if the target is the "binary" format, which + has an unknown architecture. Since the binary format can + only be set by explicit request from the user, it is safe + to assume that they know what they are doing. */ + if (accept_unknowns + || strcmp (bfd_get_target (ubfd), "binary") == 0) + return ubfd->arch_info; + return NULL; + } /* Otherwise architecture-specific code has to decide. */ return abfd->arch_info->compatible (abfd->arch_info, bbfd->arch_info); @@ -571,7 +644,7 @@ DESCRIPTION */ const bfd_arch_info_type bfd_default_arch_struct = { - 32, 32, 8, bfd_arch_unknown, 0, "unknown", "unknown", 2, true, + 32, 32, 8, bfd_arch_unknown, 0, "unknown", "unknown", 2, TRUE, bfd_default_compatible, bfd_default_scan, 0, @@ -582,16 +655,14 @@ FUNCTION bfd_set_arch_info SYNOPSIS - void bfd_set_arch_info(bfd *abfd, const bfd_arch_info_type *arg); + void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); DESCRIPTION Set the architecture info of @var{abfd} to @var{arg}. */ void -bfd_set_arch_info (abfd, arg) - bfd *abfd; - const bfd_arch_info_type *arg; +bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg) { abfd->arch_info = arg; } @@ -601,9 +672,8 @@ INTERNAL_FUNCTION bfd_default_set_arch_mach SYNOPSIS - boolean bfd_default_set_arch_mach(bfd *abfd, - enum bfd_architecture arch, - unsigned long mach); + bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); DESCRIPTION Set the architecture and machine type in BFD @var{abfd} @@ -612,19 +682,18 @@ DESCRIPTION pointer. */ -boolean -bfd_default_set_arch_mach (abfd, arch, mach) - bfd *abfd; - enum bfd_architecture arch; - unsigned long mach; +bfd_boolean +bfd_default_set_arch_mach (bfd *abfd, + enum bfd_architecture arch, + unsigned long mach) { abfd->arch_info = bfd_lookup_arch (arch, mach); if (abfd->arch_info != NULL) - return true; + return TRUE; abfd->arch_info = &bfd_default_arch_struct; bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } /* @@ -632,7 +701,7 @@ FUNCTION bfd_get_arch SYNOPSIS - enum bfd_architecture bfd_get_arch(bfd *abfd); + enum bfd_architecture bfd_get_arch (bfd *abfd); DESCRIPTION Return the enumerated type which describes the BFD @var{abfd}'s @@ -640,8 +709,7 @@ DESCRIPTION */ enum bfd_architecture -bfd_get_arch (abfd) - bfd *abfd; +bfd_get_arch (bfd *abfd) { return abfd->arch_info->arch; } @@ -651,7 +719,7 @@ FUNCTION bfd_get_mach SYNOPSIS - unsigned long bfd_get_mach(bfd *abfd); + unsigned long bfd_get_mach (bfd *abfd); DESCRIPTION Return the long type which describes the BFD @var{abfd}'s @@ -659,8 +727,7 @@ DESCRIPTION */ unsigned long -bfd_get_mach (abfd) - bfd *abfd; +bfd_get_mach (bfd *abfd) { return abfd->arch_info->mach; } @@ -670,7 +737,7 @@ FUNCTION bfd_arch_bits_per_byte SYNOPSIS - unsigned int bfd_arch_bits_per_byte(bfd *abfd); + unsigned int bfd_arch_bits_per_byte (bfd *abfd); DESCRIPTION Return the number of bits in one of the BFD @var{abfd}'s @@ -678,8 +745,7 @@ DESCRIPTION */ unsigned int -bfd_arch_bits_per_byte (abfd) - bfd *abfd; +bfd_arch_bits_per_byte (bfd *abfd) { return abfd->arch_info->bits_per_byte; } @@ -689,7 +755,7 @@ FUNCTION bfd_arch_bits_per_address SYNOPSIS - unsigned int bfd_arch_bits_per_address(bfd *abfd); + unsigned int bfd_arch_bits_per_address (bfd *abfd); DESCRIPTION Return the number of bits in one of the BFD @var{abfd}'s @@ -697,8 +763,7 @@ DESCRIPTION */ unsigned int -bfd_arch_bits_per_address (abfd) - bfd *abfd; +bfd_arch_bits_per_address (bfd *abfd) { return abfd->arch_info->bits_per_address; } @@ -709,17 +774,15 @@ INTERNAL_FUNCTION SYNOPSIS const bfd_arch_info_type *bfd_default_compatible - (const bfd_arch_info_type *a, - const bfd_arch_info_type *b); + (const bfd_arch_info_type *a, const bfd_arch_info_type *b); DESCRIPTION The default function for testing for compatibility. */ const bfd_arch_info_type * -bfd_default_compatible (a, b) - const bfd_arch_info_type *a; - const bfd_arch_info_type *b; +bfd_default_compatible (const bfd_arch_info_type *a, + const bfd_arch_info_type *b) { if (a->arch != b->arch) return NULL; @@ -741,17 +804,16 @@ INTERNAL_FUNCTION bfd_default_scan SYNOPSIS - boolean bfd_default_scan(const struct bfd_arch_info *info, const char *string); + bfd_boolean bfd_default_scan + (const struct bfd_arch_info *info, const char *string); DESCRIPTION The default function for working out whether this is an architecture hit and a machine hit. */ -boolean -bfd_default_scan (info, string) - const bfd_arch_info_type *info; - const char *string; +bfd_boolean +bfd_default_scan (const bfd_arch_info_type *info, const char *string) { const char *ptr_src; const char *ptr_tst; @@ -763,11 +825,11 @@ bfd_default_scan (info, string) default architecture? */ if (strcasecmp (string, info->arch_name) == 0 && info->the_default) - return true; + return TRUE; /* Exact match of the machine name (PRINTABLE_NAME)? */ if (strcasecmp (string, info->printable_name) == 0) - return true; + return TRUE; /* Given that printable_name contains no colon, attempt to match: ARCH_NAME [ ":" ] PRINTABLE_NAME? */ @@ -781,13 +843,13 @@ bfd_default_scan (info, string) { if (strcasecmp (string + strlen_arch_name + 1, info->printable_name) == 0) - return true; + return TRUE; } else { if (strcasecmp (string + strlen_arch_name, info->printable_name) == 0) - return true; + return TRUE; } } } @@ -800,11 +862,11 @@ bfd_default_scan (info, string) if (strncasecmp (string, info->printable_name, colon_index) == 0 && strcasecmp (string + colon_index, info->printable_name + colon_index + 1) == 0) - return true; + return TRUE; } /* Given that PRINTABLE_NAME has the form: ":" ; Do not - attempt to match just , it could be ambigious. This test + attempt to match just , it could be ambiguous. This test is left until later. */ /* NOTE: The below is retained for compatibility only. Please do @@ -903,6 +965,10 @@ bfd_default_scan (info, string) arch = bfd_arch_m68k; number = bfd_mach_mcf5407; break; + case 5282: + arch = bfd_arch_m68k; + number = bfd_mach_mcf528x; + break; case 32000: arch = bfd_arch_we32k; @@ -943,16 +1009,16 @@ bfd_default_scan (info, string) break; default: - return false; + return FALSE; } if (arch != info->arch) - return false; + return FALSE; if (number != info->mach) - return false; + return FALSE; - return true; + return TRUE; } /* @@ -960,15 +1026,14 @@ FUNCTION bfd_get_arch_info SYNOPSIS - const bfd_arch_info_type * bfd_get_arch_info(bfd *abfd); + const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); DESCRIPTION Return the architecture info struct in @var{abfd}. */ const bfd_arch_info_type * -bfd_get_arch_info (abfd) - bfd *abfd; +bfd_get_arch_info (bfd *abfd) { return abfd->arch_info; } @@ -979,21 +1044,17 @@ FUNCTION SYNOPSIS const bfd_arch_info_type *bfd_lookup_arch - (enum bfd_architecture - arch, - unsigned long machine); + (enum bfd_architecture arch, unsigned long machine); DESCRIPTION - Look for the architecure info structure which matches the + Look for the architecture info structure which matches the arguments @var{arch} and @var{machine}. A machine of 0 matches the machine/architecture structure which marks itself as the default. */ const bfd_arch_info_type * -bfd_lookup_arch (arch, machine) - enum bfd_architecture arch; - unsigned long machine; +bfd_lookup_arch (enum bfd_architecture arch, unsigned long machine) { const bfd_arch_info_type * const *app, *ap; @@ -1017,7 +1078,7 @@ FUNCTION SYNOPSIS const char *bfd_printable_arch_mach - (enum bfd_architecture arch, unsigned long machine); + (enum bfd_architecture arch, unsigned long machine); DESCRIPTION Return a printable string representing the architecture and @@ -1027,9 +1088,7 @@ DESCRIPTION */ const char * -bfd_printable_arch_mach (arch, machine) - enum bfd_architecture arch; - unsigned long machine; +bfd_printable_arch_mach (enum bfd_architecture arch, unsigned long machine) { const bfd_arch_info_type *ap = bfd_lookup_arch (arch, machine); @@ -1043,7 +1102,7 @@ FUNCTION bfd_octets_per_byte SYNOPSIS - unsigned int bfd_octets_per_byte(bfd *abfd); + unsigned int bfd_octets_per_byte (bfd *abfd); DESCRIPTION Return the number of octets (8-bit quantities) per target byte @@ -1052,8 +1111,7 @@ DESCRIPTION */ unsigned int -bfd_octets_per_byte (abfd) - bfd *abfd; +bfd_octets_per_byte (bfd *abfd) { return bfd_arch_mach_octets_per_byte (bfd_get_arch (abfd), bfd_get_mach (abfd)); @@ -1064,8 +1122,8 @@ FUNCTION bfd_arch_mach_octets_per_byte SYNOPSIS - unsigned int bfd_arch_mach_octets_per_byte(enum bfd_architecture arch, - unsigned long machine); + unsigned int bfd_arch_mach_octets_per_byte + (enum bfd_architecture arch, unsigned long machine); DESCRIPTION See bfd_octets_per_byte. @@ -1075,9 +1133,8 @@ DESCRIPTION */ unsigned int -bfd_arch_mach_octets_per_byte (arch, mach) - enum bfd_architecture arch; - unsigned long mach; +bfd_arch_mach_octets_per_byte (enum bfd_architecture arch, + unsigned long mach) { const bfd_arch_info_type *ap = bfd_lookup_arch (arch, mach); diff --git a/contrib/binutils/bfd/bfd-in.h b/contrib/binutils/bfd/bfd-in.h index f0f8cfd..1a5d1ea 100644 --- a/contrib/binutils/bfd/bfd-in.h +++ b/contrib/binutils/bfd/bfd-in.h @@ -1,7 +1,8 @@ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 - Free Software Foundation, Inc. + + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Contributed by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -41,10 +42,6 @@ extern "C" { #endif #endif -#define BFD_VERSION @bfd_version@ -#define BFD_VERSION_DATE @bfd_version_date@ -#define BFD_VERSION_STRING @bfd_version_string@ - /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have been selected with --enable-targets, or if --enable-64-bit-bfd. */ @@ -54,9 +51,12 @@ extern "C" { #define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@ #define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@ +#define BFD_HOST_LONG_LONG @BFD_HOST_LONG_LONG@ #if @BFD_HOST_64_BIT_DEFINED@ #define BFD_HOST_64_BIT @BFD_HOST_64_BIT@ #define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@ +typedef BFD_HOST_64_BIT bfd_int64_t; +typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif #if BFD_ARCH_SIZE >= 64 @@ -72,66 +72,31 @@ extern "C" { #endif /* Forward declaration. */ -typedef struct _bfd bfd; - -/* To squelch erroneous compiler warnings ("illegal pointer - combination") from the SVR3 compiler, we would like to typedef - boolean to int (it doesn't like functions which return boolean. - Making sure they are never implicitly declared to return int - doesn't seem to help). But this file is not configured based on - the host. */ -/* General rules: functions which are boolean return true on success - and false on failure (unless they're a predicate). -- bfd.doc */ -/* I'm sure this is going to break something and someone is going to - force me to change it. */ -/* typedef enum boolean {false, true} boolean; */ -/* Yup, SVR4 has a "typedef enum boolean" in -fnf */ -/* It gets worse if the host also defines a true/false enum... -sts */ -/* And even worse if your compiler has built-in boolean types... -law */ -/* And even worse if your compiler provides a stdbool.h that conflicts - with these definitions... gcc 2.95 and later do. If so, it must - be included first. -drow */ -#if defined (__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)) -#define TRUE_FALSE_ALREADY_DEFINED -#else -#if defined (__bool_true_false_are_defined) -/* We have . */ -#define TRUE_FALSE_ALREADY_DEFINED -#endif -#endif -#ifdef MPW -/* Pre-emptive strike - get the file with the enum. */ -#include -#define TRUE_FALSE_ALREADY_DEFINED -#endif /* MPW */ -#ifndef TRUE_FALSE_ALREADY_DEFINED -typedef enum bfd_boolean {false, true} boolean; -#define BFD_TRUE_FALSE -#else -/* Use enum names that will appear nowhere else. */ -typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean; +typedef struct bfd bfd; + +/* Boolean type used in bfd. Too many systems define their own + versions of "boolean" for us to safely typedef a "boolean" of + our own. Using an enum for "bfd_boolean" has its own set of + problems, with strange looking casts required to avoid warnings + on some older compilers. Thus we just use an int. + + General rule: Functions which are bfd_boolean return TRUE on + success and FALSE on failure (unless they're a predicate). */ + +typedef int bfd_boolean; +#undef FALSE +#undef TRUE +#define FALSE 0 +#define TRUE 1 + +#if 0 +/* Poison. */ +#undef false +#undef true +#define false dont_use_false_in_bfd +#define true dont_use_true_in_bfd #endif -/* Support for different sizes of target format ints and addresses. - If the type `long' is at least 64 bits, BFD_HOST_64BIT_LONG will be - set to 1 above. Otherwise, if gcc is being used, this code will - use gcc's "long long" type. Otherwise, BFD_HOST_64_BIT must be - defined above. */ - -#ifndef BFD_HOST_64_BIT -# if BFD_HOST_64BIT_LONG -# define BFD_HOST_64_BIT long -# define BFD_HOST_U_64_BIT unsigned long -# else -# ifdef __GNUC__ -# if __GNUC__ >= 2 -# define BFD_HOST_64_BIT long long -# define BFD_HOST_U_64_BIT unsigned long long -# endif /* __GNUC__ >= 2 */ -# endif /* ! defined (__GNUC__) */ -# endif /* ! BFD_HOST_64BIT_LONG */ -#endif /* ! defined (BFD_HOST_64_BIT) */ - #ifdef BFD64 #ifndef BFD_HOST_64_BIT @@ -179,19 +144,22 @@ typedef unsigned long bfd_size_type; #endif /* not BFD64 */ -/* A pointer to a position in a file. */ -/* FIXME: This should be using off_t from . - For now, try to avoid breaking stuff by not including here. - This will break on systems with 64-bit file offsets (e.g. 4.4BSD). - Probably the best long-term answer is to avoid using file_ptr AND off_t - in this header file, and to handle this in the BFD implementation - rather than in its interface. */ -/* typedef off_t file_ptr; */ -typedef bfd_signed_vma file_ptr; -typedef bfd_vma ufile_ptr; +#ifndef BFD_HOST_64_BIT +/* Fall back on a 32 bit type. The idea is to make these types always + available for function return types, but in the case that + BFD_HOST_64_BIT is undefined such a function should abort or + otherwise signal an error. */ +typedef bfd_signed_vma bfd_int64_t; +typedef bfd_vma bfd_uint64_t; +#endif + +/* An offset into a file. BFD always uses the largest possible offset + based on the build time availability of fseek, fseeko, or fseeko64. */ +typedef @bfd_file_ptr@ file_ptr; +typedef unsigned @bfd_file_ptr@ ufile_ptr; -extern void bfd_sprintf_vma PARAMS ((bfd *, char *, bfd_vma)); -extern void bfd_fprintf_vma PARAMS ((bfd *, PTR, bfd_vma)); +extern void bfd_sprintf_vma (bfd *, char *, bfd_vma); +extern void bfd_fprintf_vma (bfd *, void *, bfd_vma); #define printf_vma(x) fprintf_vma(stdout,x) #define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x) @@ -204,7 +172,7 @@ typedef unsigned char bfd_byte; typedef enum bfd_format { bfd_unknown = 0, /* File format is unknown. */ - bfd_object, /* Linker/assember/compiler output. */ + bfd_object, /* Linker/assembler/compiler output. */ bfd_archive, /* Object archive file. */ bfd_core, /* Core dump. */ bfd_type_end /* Marks the end; don't use it! */ @@ -267,6 +235,9 @@ bfd_format; /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ #define BFD_IN_MEMORY 0x800 + +/* The sections in this BFD specify a memory page. */ +#define HAS_LOAD_PAGE 0x1000 /* Symbols and relocation. */ @@ -319,7 +290,7 @@ typedef struct lineno_cache_entry unsigned int line_number; /* Linenumber from start of function. */ union { - struct symbol_cache_entry *sym; /* Function name. */ + struct bfd_symbol *sym; /* Function name. */ bfd_vma offset; /* Offset into section. */ } u; } @@ -330,7 +301,7 @@ alent; #define align_power(addr, align) \ (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) -typedef struct sec *sec_ptr; +typedef struct bfd_section *sec_ptr; #define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0) #define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0) @@ -346,9 +317,9 @@ typedef struct sec *sec_ptr; #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = (unsigned int)true), true) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true) +#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) +#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) +#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) typedef struct stat stat_type; @@ -374,7 +345,7 @@ typedef struct _symbol_info /* Get the name of a stabs type code. */ -extern const char *bfd_get_stab_name PARAMS ((int)); +extern const char *bfd_get_stab_name (int); /* Hash table routines. There is no way to free up a hash table. */ @@ -407,75 +378,74 @@ struct bfd_hash_table built each of which calls the function in the superclass. Thus each function should be written to allocate a new block of memory only if the argument is NULL. */ - struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *)); + struct bfd_hash_entry *(*newfunc) + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); /* An objalloc for this hash table. This is a struct objalloc *, - but we use PTR to avoid requiring the inclusion of objalloc.h. */ - PTR memory; + but we use void * to avoid requiring the inclusion of objalloc.h. */ + void *memory; }; /* Initialize a hash table. */ -extern boolean bfd_hash_table_init - PARAMS ((struct bfd_hash_table *, - struct bfd_hash_entry *(*) (struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *))); +extern bfd_boolean bfd_hash_table_init + (struct bfd_hash_table *, + struct bfd_hash_entry *(*) (struct bfd_hash_entry *, + struct bfd_hash_table *, + const char *)); /* Initialize a hash table specifying a size. */ -extern boolean bfd_hash_table_init_n - PARAMS ((struct bfd_hash_table *, - struct bfd_hash_entry *(*) (struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *), - unsigned int size)); +extern bfd_boolean bfd_hash_table_init_n + (struct bfd_hash_table *, + struct bfd_hash_entry *(*) (struct bfd_hash_entry *, + struct bfd_hash_table *, + const char *), + unsigned int size); /* Free up a hash table. */ -extern void bfd_hash_table_free PARAMS ((struct bfd_hash_table *)); +extern void bfd_hash_table_free + (struct bfd_hash_table *); -/* Look up a string in a hash table. If CREATE is true, a new entry +/* Look up a string in a hash table. If CREATE is TRUE, a new entry will be created for this string if one does not already exist. The - COPY argument must be true if this routine should copy the string + COPY argument must be TRUE if this routine should copy the string into newly allocated memory when adding an entry. */ extern struct bfd_hash_entry *bfd_hash_lookup - PARAMS ((struct bfd_hash_table *, const char *, boolean create, - boolean copy)); + (struct bfd_hash_table *, const char *, bfd_boolean create, + bfd_boolean copy); /* Replace an entry in a hash table. */ extern void bfd_hash_replace - PARAMS ((struct bfd_hash_table *, struct bfd_hash_entry *old, - struct bfd_hash_entry *nw)); + (struct bfd_hash_table *, struct bfd_hash_entry *old, + struct bfd_hash_entry *nw); /* Base method for creating a hash table entry. */ extern struct bfd_hash_entry *bfd_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, - const char *)); + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); /* Grab some space for a hash table entry. */ -extern PTR bfd_hash_allocate PARAMS ((struct bfd_hash_table *, - unsigned int)); +extern void *bfd_hash_allocate + (struct bfd_hash_table *, unsigned int); /* Traverse a hash table in a random order, calling a function on each - element. If the function returns false, the traversal stops. The + element. If the function returns FALSE, the traversal stops. The INFO argument is passed to the function. */ -extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *, - boolean (*) (struct bfd_hash_entry *, - PTR), - PTR info)); +extern void bfd_hash_traverse + (struct bfd_hash_table *, + bfd_boolean (*) (struct bfd_hash_entry *, void *), + void *info); -#define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table +#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table /* User program access to BFD facilities. */ /* Direct I/O routines, for programs which know more about the object file than BFD does. Use higher level routines if possible. */ -extern bfd_size_type bfd_bread PARAMS ((PTR, bfd_size_type, bfd *)); -extern bfd_size_type bfd_bwrite PARAMS ((const PTR, bfd_size_type, bfd *)); -extern int bfd_seek PARAMS ((bfd *, file_ptr, int)); -extern ufile_ptr bfd_tell PARAMS ((bfd *)); -extern int bfd_flush PARAMS ((bfd *)); -extern int bfd_stat PARAMS ((bfd *, struct stat *)); +extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *); +extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *); +extern int bfd_seek (bfd *, file_ptr, int); +extern file_ptr bfd_tell (bfd *); +extern int bfd_flush (bfd *); +extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ @@ -493,8 +463,7 @@ extern int bfd_stat PARAMS ((bfd *, struct stat *)); (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated - PARAMS ((const char *, const char *, int, const char *)); +extern void warn_deprecated (const char *, const char *, int, const char *); /* Cast from const char * to char * so that caller can assign to a char * without a warning. */ @@ -530,40 +499,41 @@ extern void warn_deprecated #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true) +#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) -extern boolean bfd_cache_close PARAMS ((bfd *abfd)); +extern bfd_boolean bfd_cache_close + (bfd *abfd); /* NB: This declaration should match the autogenerated one in libbfd.h. */ -extern boolean bfd_record_phdr - PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma, - boolean, boolean, unsigned int, struct sec **)); +extern bfd_boolean bfd_record_phdr + (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma, + bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **); /* Byte swapping routines. */ -bfd_vma bfd_getb64 PARAMS ((const unsigned char *)); -bfd_vma bfd_getl64 PARAMS ((const unsigned char *)); -bfd_signed_vma bfd_getb_signed_64 PARAMS ((const unsigned char *)); -bfd_signed_vma bfd_getl_signed_64 PARAMS ((const unsigned char *)); -bfd_vma bfd_getb32 PARAMS ((const unsigned char *)); -bfd_vma bfd_getl32 PARAMS ((const unsigned char *)); -bfd_signed_vma bfd_getb_signed_32 PARAMS ((const unsigned char *)); -bfd_signed_vma bfd_getl_signed_32 PARAMS ((const unsigned char *)); -bfd_vma bfd_getb16 PARAMS ((const unsigned char *)); -bfd_vma bfd_getl16 PARAMS ((const unsigned char *)); -bfd_signed_vma bfd_getb_signed_16 PARAMS ((const unsigned char *)); -bfd_signed_vma bfd_getl_signed_16 PARAMS ((const unsigned char *)); -void bfd_putb64 PARAMS ((bfd_vma, unsigned char *)); -void bfd_putl64 PARAMS ((bfd_vma, unsigned char *)); -void bfd_putb32 PARAMS ((bfd_vma, unsigned char *)); -void bfd_putl32 PARAMS ((bfd_vma, unsigned char *)); -void bfd_putb16 PARAMS ((bfd_vma, unsigned char *)); -void bfd_putl16 PARAMS ((bfd_vma, unsigned char *)); +bfd_uint64_t bfd_getb64 (const void *); +bfd_uint64_t bfd_getl64 (const void *); +bfd_int64_t bfd_getb_signed_64 (const void *); +bfd_int64_t bfd_getl_signed_64 (const void *); +bfd_vma bfd_getb32 (const void *); +bfd_vma bfd_getl32 (const void *); +bfd_signed_vma bfd_getb_signed_32 (const void *); +bfd_signed_vma bfd_getl_signed_32 (const void *); +bfd_vma bfd_getb16 (const void *); +bfd_vma bfd_getl16 (const void *); +bfd_signed_vma bfd_getb_signed_16 (const void *); +bfd_signed_vma bfd_getl_signed_16 (const void *); +void bfd_putb64 (bfd_uint64_t, void *); +void bfd_putl64 (bfd_uint64_t, void *); +void bfd_putb32 (bfd_vma, void *); +void bfd_putl32 (bfd_vma, void *); +void bfd_putb16 (bfd_vma, void *); +void bfd_putl16 (bfd_vma, void *); /* Byte swapping routines which take size and endiannes as arguments. */ -bfd_vma bfd_get_bits PARAMS ((bfd_byte *, int, boolean)); -void bfd_put_bits PARAMS ((bfd_vma, bfd_byte *, int, boolean)); +bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); +void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); /* Externally visible ECOFF routines. */ @@ -571,59 +541,54 @@ void bfd_put_bits PARAMS ((bfd_vma, bfd_byte *, int, boolean)); struct ecoff_debug_info; struct ecoff_debug_swap; struct ecoff_extr; -struct symbol_cache_entry; +struct bfd_symbol; struct bfd_link_info; struct bfd_link_hash_entry; struct bfd_elf_version_tree; #endif -extern bfd_vma bfd_ecoff_get_gp_value PARAMS ((bfd * abfd)); -extern boolean bfd_ecoff_set_gp_value PARAMS ((bfd *abfd, bfd_vma gp_value)); -extern boolean bfd_ecoff_set_regmasks - PARAMS ((bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask)); -extern PTR bfd_ecoff_debug_init - PARAMS ((bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, - struct bfd_link_info *)); +extern bfd_vma bfd_ecoff_get_gp_value + (bfd * abfd); +extern bfd_boolean bfd_ecoff_set_gp_value + (bfd *abfd, bfd_vma gp_value); +extern bfd_boolean bfd_ecoff_set_regmasks + (bfd *abfd, unsigned long gprmask, unsigned long fprmask, + unsigned long *cprmask); +extern void *bfd_ecoff_debug_init + (bfd *output_bfd, struct ecoff_debug_info *output_debug, + const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); extern void bfd_ecoff_debug_free - PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, - struct bfd_link_info *)); -extern boolean bfd_ecoff_debug_accumulate - PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, - bfd *input_bfd, struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, - struct bfd_link_info *)); -extern boolean bfd_ecoff_debug_accumulate_other - PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *)); -extern boolean bfd_ecoff_debug_externals - PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - boolean relocateable, - boolean (*get_extr) (struct symbol_cache_entry *, - struct ecoff_extr *), - void (*set_index) (struct symbol_cache_entry *, - bfd_size_type))); -extern boolean bfd_ecoff_debug_one_external - PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - const char *name, struct ecoff_extr *esym)); + (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, + const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); +extern bfd_boolean bfd_ecoff_debug_accumulate + (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, + const struct ecoff_debug_swap *output_swap, bfd *input_bfd, + struct ecoff_debug_info *input_debug, + const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); +extern bfd_boolean bfd_ecoff_debug_accumulate_other + (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, + const struct ecoff_debug_swap *output_swap, bfd *input_bfd, + struct bfd_link_info *); +extern bfd_boolean bfd_ecoff_debug_externals + (bfd *abfd, struct ecoff_debug_info *debug, + const struct ecoff_debug_swap *swap, bfd_boolean relocatable, + bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), + void (*set_index) (struct bfd_symbol *, bfd_size_type)); +extern bfd_boolean bfd_ecoff_debug_one_external + (bfd *abfd, struct ecoff_debug_info *debug, + const struct ecoff_debug_swap *swap, const char *name, + struct ecoff_extr *esym); extern bfd_size_type bfd_ecoff_debug_size - PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap)); -extern boolean bfd_ecoff_write_debug - PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where)); -extern boolean bfd_ecoff_write_accumulated_debug - PARAMS ((PTR handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where)); -extern boolean bfd_mips_ecoff_create_embedded_relocs - PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, - char **)); + (bfd *abfd, struct ecoff_debug_info *debug, + const struct ecoff_debug_swap *swap); +extern bfd_boolean bfd_ecoff_write_debug + (bfd *abfd, struct ecoff_debug_info *debug, + const struct ecoff_debug_swap *swap, file_ptr where); +extern bfd_boolean bfd_ecoff_write_accumulated_debug + (void *handle, bfd *abfd, struct ecoff_debug_info *debug, + const struct ecoff_debug_swap *swap, + struct bfd_link_info *info, file_ptr where); +extern bfd_boolean bfd_mips_ecoff_create_embedded_relocs + (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); /* Externally visible ELF routines. */ @@ -634,36 +599,37 @@ struct bfd_link_needed_list const char *name; }; -extern boolean bfd_elf32_record_link_assignment - PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean)); -extern boolean bfd_elf64_record_link_assignment - PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean)); +enum dynamic_lib_link_class { + DYN_NORMAL = 0, + DYN_AS_NEEDED = 1, + DYN_DT_NEEDED = 2 +}; + +extern bfd_boolean bfd_elf_record_link_assignment + (bfd *, struct bfd_link_info *, const char *, bfd_boolean); extern struct bfd_link_needed_list *bfd_elf_get_needed_list - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean bfd_elf_get_bfd_needed_list - PARAMS ((bfd *, struct bfd_link_needed_list **)); -extern boolean bfd_elf32_size_dynamic_sections - PARAMS ((bfd *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct sec **, - struct bfd_elf_version_tree *)); -extern boolean bfd_elf64_size_dynamic_sections - PARAMS ((bfd *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct sec **, - struct bfd_elf_version_tree *)); -extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *)); -extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *)); -extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *)); + (bfd *, struct bfd_link_info *); +extern bfd_boolean bfd_elf_get_bfd_needed_list + (bfd *, struct bfd_link_needed_list **); +extern bfd_boolean bfd_elf_size_dynamic_sections + (bfd *, const char *, const char *, const char *, const char * const *, + struct bfd_link_info *, struct bfd_section **, struct bfd_elf_version_tree *); +extern void bfd_elf_set_dt_needed_name + (bfd *, const char *); +extern const char *bfd_elf_get_dt_soname + (bfd *); +extern void bfd_elf_set_dyn_lib_class + (bfd *, int); extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean bfd_elf32_discard_info - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean bfd_elf64_discard_info - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); +extern bfd_boolean bfd_elf_discard_info + (bfd *, struct bfd_link_info *); /* Return an upper bound on the number of bytes required to store a copy of ABFD's program header table entries. Return -1 if an error occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd)); +extern long bfd_get_elf_phdr_upper_bound + (bfd *abfd); /* Copy ABFD's program header table entries to *PHDRS. The entries will be stored as an array of Elf_Internal_Phdr structures, as @@ -672,39 +638,58 @@ extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd)); Return the number of program header table entries read, or -1 if an error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs)); +extern int bfd_get_elf_phdrs + (bfd *abfd, void *phdrs); + +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote memory + based on the ELF file header at EHDR_VMA and the ELF program headers it + points to. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs the + file headers (and hence BFD's idea of each section's VMA) put them at. + + The function TARGET_READ_MEMORY is called to copy LEN bytes from the + remote memory at target address VMA into the local buffer at MYADDR; it + should return zero on success or an `errno' code on failure. TEMPL must + be a BFD for an ELF target with the word size and byte order found in + the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, char *myaddr, int len)); /* Return the arch_size field of an elf bfd, or -1 if not elf. */ -extern int bfd_get_arch_size PARAMS ((bfd *)); +extern int bfd_get_arch_size + (bfd *); + +/* Return TRUE if address "naturally" sign extends, or -1 if not elf. */ +extern int bfd_get_sign_extend_vma + (bfd *); -/* Return true if address "naturally" sign extends, or -1 if not elf. */ -extern int bfd_get_sign_extend_vma PARAMS ((bfd *)); +extern struct bfd_section *_bfd_elf_tls_setup + (bfd *, struct bfd_link_info *); -extern boolean bfd_m68k_elf32_create_embedded_relocs - PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, - char **)); -extern boolean bfd_mips_elf32_create_embedded_relocs - PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, - char **)); +extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs + (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); +extern bfd_boolean bfd_mips_elf32_create_embedded_relocs + (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); /* SunOS shared library support routines for the linker. */ extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean bfd_sunos_record_link_assignment - PARAMS ((bfd *, struct bfd_link_info *, const char *)); -extern boolean bfd_sunos_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *, struct sec **, struct sec **, - struct sec **)); + (bfd *, struct bfd_link_info *); +extern bfd_boolean bfd_sunos_record_link_assignment + (bfd *, struct bfd_link_info *, const char *); +extern bfd_boolean bfd_sunos_size_dynamic_sections + (bfd *, struct bfd_link_info *, struct bfd_section **, struct bfd_section **, struct bfd_section **); /* Linux shared library support routines for the linker. */ -extern boolean bfd_i386linux_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean bfd_m68klinux_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean bfd_sparclinux_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean bfd_i386linux_size_dynamic_sections + (bfd *, struct bfd_link_info *); +extern bfd_boolean bfd_m68klinux_size_dynamic_sections + (bfd *, struct bfd_link_info *); +extern bfd_boolean bfd_sparclinux_size_dynamic_sections + (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -714,7 +699,7 @@ typedef struct _bfd_window_internal bfd_window_internal; typedef struct _bfd_window { /* What the user asked for. */ - PTR data; + void *data; bfd_size_type size; /* The actual window used by BFD. Small user-requested read-only regions sharing a page may share a single window into the object @@ -726,34 +711,36 @@ typedef struct _bfd_window } bfd_window; -extern void bfd_init_window PARAMS ((bfd_window *)); -extern void bfd_free_window PARAMS ((bfd_window *)); -extern boolean bfd_get_file_window - PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, boolean)); +extern void bfd_init_window + (bfd_window *); +extern void bfd_free_window + (bfd_window *); +extern bfd_boolean bfd_get_file_window + (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); /* XCOFF support routines for the linker. */ -extern boolean bfd_xcoff_link_record_set - PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, - bfd_size_type)); -extern boolean bfd_xcoff_import_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, - bfd_vma, const char *, const char *, const char *, unsigned int)); -extern boolean bfd_xcoff_export_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *)); -extern boolean bfd_xcoff_link_count_reloc - PARAMS ((bfd *, struct bfd_link_info *, const char *)); -extern boolean bfd_xcoff_record_link_assignment - PARAMS ((bfd *, struct bfd_link_info *, const char *)); -extern boolean bfd_xcoff_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, boolean, - int, boolean, boolean, struct sec **, boolean)); -extern boolean bfd_xcoff_link_generate_rtinit - PARAMS ((bfd *, const char *, const char *, boolean)); +extern bfd_boolean bfd_xcoff_link_record_set + (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); +extern bfd_boolean bfd_xcoff_import_symbol + (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, + const char *, const char *, const char *, unsigned int); +extern bfd_boolean bfd_xcoff_export_symbol + (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); +extern bfd_boolean bfd_xcoff_link_count_reloc + (bfd *, struct bfd_link_info *, const char *); +extern bfd_boolean bfd_xcoff_record_link_assignment + (bfd *, struct bfd_link_info *, const char *); +extern bfd_boolean bfd_xcoff_size_dynamic_sections + (bfd *, struct bfd_link_info *, const char *, const char *, + unsigned long, unsigned long, unsigned long, bfd_boolean, + int, bfd_boolean, bfd_boolean, struct bfd_section **, bfd_boolean); +extern bfd_boolean bfd_xcoff_link_generate_rtinit + (bfd *, const char *, const char *, bfd_boolean); /* XCOFF support routines for ar. */ -extern boolean bfd_xcoff_ar_archive_set_magic PARAMS ((bfd *, char *)); +extern bfd_boolean bfd_xcoff_ar_archive_set_magic + (bfd *, char *); /* Externally visible COFF routines. */ @@ -762,56 +749,76 @@ struct internal_syment; union internal_auxent; #endif -extern boolean bfd_coff_get_syment - PARAMS ((bfd *, struct symbol_cache_entry *, struct internal_syment *)); +extern bfd_boolean bfd_coff_get_syment + (bfd *, struct bfd_symbol *, struct internal_syment *); -extern boolean bfd_coff_get_auxent - PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *)); +extern bfd_boolean bfd_coff_get_auxent + (bfd *, struct bfd_symbol *, int, union internal_auxent *); -extern boolean bfd_coff_set_symbol_class - PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int)); +extern bfd_boolean bfd_coff_set_symbol_class + (bfd *, struct bfd_symbol *, unsigned int); -extern boolean bfd_m68k_coff_create_embedded_relocs - PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, - char **)); +extern bfd_boolean bfd_m68k_coff_create_embedded_relocs + (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); /* ARM Interworking support. Called from linker. */ -extern boolean bfd_arm_allocate_interworking_sections - PARAMS ((struct bfd_link_info *)); +extern bfd_boolean bfd_arm_allocate_interworking_sections + (struct bfd_link_info *); -extern boolean bfd_arm_process_before_allocation - PARAMS ((bfd *, struct bfd_link_info *, int)); +extern bfd_boolean bfd_arm_process_before_allocation + (bfd *, struct bfd_link_info *, int); -extern boolean bfd_arm_get_bfd_for_interworking - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean bfd_arm_get_bfd_for_interworking + (bfd *, struct bfd_link_info *); /* PE ARM Interworking support. Called from linker. */ -extern boolean bfd_arm_pe_allocate_interworking_sections - PARAMS ((struct bfd_link_info *)); +extern bfd_boolean bfd_arm_pe_allocate_interworking_sections + (struct bfd_link_info *); -extern boolean bfd_arm_pe_process_before_allocation - PARAMS ((bfd *, struct bfd_link_info *, int)); +extern bfd_boolean bfd_arm_pe_process_before_allocation + (bfd *, struct bfd_link_info *, int); -extern boolean bfd_arm_pe_get_bfd_for_interworking - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking + (bfd *, struct bfd_link_info *); /* ELF ARM Interworking support. Called from linker. */ -extern boolean bfd_elf32_arm_allocate_interworking_sections - PARAMS ((struct bfd_link_info *)); +extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections + (struct bfd_link_info *); -extern boolean bfd_elf32_arm_process_before_allocation - PARAMS ((bfd *, struct bfd_link_info *, int)); +extern bfd_boolean bfd_elf32_arm_process_before_allocation + (bfd *, struct bfd_link_info *, int); -extern boolean bfd_elf32_arm_get_bfd_for_interworking - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking + (bfd *, struct bfd_link_info *); -extern boolean bfd_elf32_arm_add_glue_sections_to_bfd - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd + (bfd *, struct bfd_link_info *); + +/* ARM Note section processing. */ +extern bfd_boolean bfd_arm_merge_machines + (bfd *, bfd *); + +extern bfd_boolean bfd_arm_update_notes + (bfd *, const char *); + +extern unsigned int bfd_arm_get_mach_from_notes + (bfd *, const char *); /* TI COFF load page support. */ extern void bfd_ticoff_set_section_load_page - PARAMS ((struct sec *, int)); + (struct bfd_section *, int); extern int bfd_ticoff_get_section_load_page - PARAMS ((struct sec *)); + (struct bfd_section *); + +/* H8/300 functions. */ +extern bfd_vma bfd_h8300_pad_address + (bfd *, bfd_vma); + +/* IA64 Itanium code generation. Called from linker. */ +extern void bfd_elf32_ia64_after_parse + (int); + +extern void bfd_elf64_ia64_after_parse + (int); diff --git a/contrib/binutils/bfd/bfd-in2.h b/contrib/binutils/bfd/bfd-in2.h index 13aa0f9..2464d27 100644 --- a/contrib/binutils/bfd/bfd-in2.h +++ b/contrib/binutils/bfd/bfd-in2.h @@ -1,13 +1,15 @@ /* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically generated from "bfd-in.h", "init.c", "opncls.c", "libbfd.c", - "section.c", "archures.c", "reloc.c", "syms.c", "bfd.c", "archive.c", - "corefile.c", "targets.c" and "format.c". + "bfdio.c", "bfdwin.c", "section.c", "archures.c", "reloc.c", + "syms.c", "bfd.c", "archive.c", "corefile.c", "targets.c", "format.c", + "linker.c" and "simple.c". Run "make headers" in your build bfd/ to regenerate. */ /* Main header file for the bfd library -- portable access to object files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 - Free Software Foundation, Inc. + + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Contributed by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -47,10 +49,6 @@ extern "C" { #endif #endif -#define BFD_VERSION @bfd_version@ -#define BFD_VERSION_DATE @bfd_version_date@ -#define BFD_VERSION_STRING @bfd_version_string@ - /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have been selected with --enable-targets, or if --enable-64-bit-bfd. */ @@ -60,9 +58,12 @@ extern "C" { #define BFD_DEFAULT_TARGET_SIZE @bfd_default_target_size@ #define BFD_HOST_64BIT_LONG @BFD_HOST_64BIT_LONG@ +#define BFD_HOST_LONG_LONG @BFD_HOST_LONG_LONG@ #if @BFD_HOST_64_BIT_DEFINED@ #define BFD_HOST_64_BIT @BFD_HOST_64_BIT@ #define BFD_HOST_U_64_BIT @BFD_HOST_U_64_BIT@ +typedef BFD_HOST_64_BIT bfd_int64_t; +typedef BFD_HOST_U_64_BIT bfd_uint64_t; #endif #if BFD_ARCH_SIZE >= 64 @@ -78,66 +79,31 @@ extern "C" { #endif /* Forward declaration. */ -typedef struct _bfd bfd; - -/* To squelch erroneous compiler warnings ("illegal pointer - combination") from the SVR3 compiler, we would like to typedef - boolean to int (it doesn't like functions which return boolean. - Making sure they are never implicitly declared to return int - doesn't seem to help). But this file is not configured based on - the host. */ -/* General rules: functions which are boolean return true on success - and false on failure (unless they're a predicate). -- bfd.doc */ -/* I'm sure this is going to break something and someone is going to - force me to change it. */ -/* typedef enum boolean {false, true} boolean; */ -/* Yup, SVR4 has a "typedef enum boolean" in -fnf */ -/* It gets worse if the host also defines a true/false enum... -sts */ -/* And even worse if your compiler has built-in boolean types... -law */ -/* And even worse if your compiler provides a stdbool.h that conflicts - with these definitions... gcc 2.95 and later do. If so, it must - be included first. -drow */ -#if defined (__GNUG__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)) -#define TRUE_FALSE_ALREADY_DEFINED -#else -#if defined (__bool_true_false_are_defined) -/* We have . */ -#define TRUE_FALSE_ALREADY_DEFINED -#endif -#endif -#ifdef MPW -/* Pre-emptive strike - get the file with the enum. */ -#include -#define TRUE_FALSE_ALREADY_DEFINED -#endif /* MPW */ -#ifndef TRUE_FALSE_ALREADY_DEFINED -typedef enum bfd_boolean {false, true} boolean; -#define BFD_TRUE_FALSE -#else -/* Use enum names that will appear nowhere else. */ -typedef enum bfd_boolean {bfd_fffalse, bfd_tttrue} boolean; +typedef struct bfd bfd; + +/* Boolean type used in bfd. Too many systems define their own + versions of "boolean" for us to safely typedef a "boolean" of + our own. Using an enum for "bfd_boolean" has its own set of + problems, with strange looking casts required to avoid warnings + on some older compilers. Thus we just use an int. + + General rule: Functions which are bfd_boolean return TRUE on + success and FALSE on failure (unless they're a predicate). */ + +typedef int bfd_boolean; +#undef FALSE +#undef TRUE +#define FALSE 0 +#define TRUE 1 + +#if 0 +/* Poison. */ +#undef false +#undef true +#define false dont_use_false_in_bfd +#define true dont_use_true_in_bfd #endif -/* Support for different sizes of target format ints and addresses. - If the type `long' is at least 64 bits, BFD_HOST_64BIT_LONG will be - set to 1 above. Otherwise, if gcc is being used, this code will - use gcc's "long long" type. Otherwise, BFD_HOST_64_BIT must be - defined above. */ - -#ifndef BFD_HOST_64_BIT -# if BFD_HOST_64BIT_LONG -# define BFD_HOST_64_BIT long -# define BFD_HOST_U_64_BIT unsigned long -# else -# ifdef __GNUC__ -# if __GNUC__ >= 2 -# define BFD_HOST_64_BIT long long -# define BFD_HOST_U_64_BIT unsigned long long -# endif /* __GNUC__ >= 2 */ -# endif /* ! defined (__GNUC__) */ -# endif /* ! BFD_HOST_64BIT_LONG */ -#endif /* ! defined (BFD_HOST_64_BIT) */ - #ifdef BFD64 #ifndef BFD_HOST_64_BIT @@ -185,19 +151,22 @@ typedef unsigned long bfd_size_type; #endif /* not BFD64 */ -/* A pointer to a position in a file. */ -/* FIXME: This should be using off_t from . - For now, try to avoid breaking stuff by not including here. - This will break on systems with 64-bit file offsets (e.g. 4.4BSD). - Probably the best long-term answer is to avoid using file_ptr AND off_t - in this header file, and to handle this in the BFD implementation - rather than in its interface. */ -/* typedef off_t file_ptr; */ -typedef bfd_signed_vma file_ptr; -typedef bfd_vma ufile_ptr; +#ifndef BFD_HOST_64_BIT +/* Fall back on a 32 bit type. The idea is to make these types always + available for function return types, but in the case that + BFD_HOST_64_BIT is undefined such a function should abort or + otherwise signal an error. */ +typedef bfd_signed_vma bfd_int64_t; +typedef bfd_vma bfd_uint64_t; +#endif + +/* An offset into a file. BFD always uses the largest possible offset + based on the build time availability of fseek, fseeko, or fseeko64. */ +typedef @bfd_file_ptr@ file_ptr; +typedef unsigned @bfd_file_ptr@ ufile_ptr; -extern void bfd_sprintf_vma PARAMS ((bfd *, char *, bfd_vma)); -extern void bfd_fprintf_vma PARAMS ((bfd *, PTR, bfd_vma)); +extern void bfd_sprintf_vma (bfd *, char *, bfd_vma); +extern void bfd_fprintf_vma (bfd *, void *, bfd_vma); #define printf_vma(x) fprintf_vma(stdout,x) #define bfd_printf_vma(abfd,x) bfd_fprintf_vma (abfd,stdout,x) @@ -210,7 +179,7 @@ typedef unsigned char bfd_byte; typedef enum bfd_format { bfd_unknown = 0, /* File format is unknown. */ - bfd_object, /* Linker/assember/compiler output. */ + bfd_object, /* Linker/assembler/compiler output. */ bfd_archive, /* Object archive file. */ bfd_core, /* Core dump. */ bfd_type_end /* Marks the end; don't use it! */ @@ -273,6 +242,9 @@ bfd_format; /* This flag indicates that the BFD contents are actually cached in memory. If this is set, iostream points to a bfd_in_memory struct. */ #define BFD_IN_MEMORY 0x800 + +/* The sections in this BFD specify a memory page. */ +#define HAS_LOAD_PAGE 0x1000 /* Symbols and relocation. */ @@ -325,7 +297,7 @@ typedef struct lineno_cache_entry unsigned int line_number; /* Linenumber from start of function. */ union { - struct symbol_cache_entry *sym; /* Function name. */ + struct bfd_symbol *sym; /* Function name. */ bfd_vma offset; /* Offset into section. */ } u; } @@ -336,7 +308,7 @@ alent; #define align_power(addr, align) \ (((addr) + ((bfd_vma) 1 << (align)) - 1) & ((bfd_vma) -1 << (align))) -typedef struct sec *sec_ptr; +typedef struct bfd_section *sec_ptr; #define bfd_get_section_name(bfd, ptr) ((ptr)->name + 0) #define bfd_get_section_vma(bfd, ptr) ((ptr)->vma + 0) @@ -352,9 +324,9 @@ typedef struct sec *sec_ptr; #define bfd_is_com_section(ptr) (((ptr)->flags & SEC_IS_COMMON) != 0) -#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = (unsigned int)true), true) -#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),true) -#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),true) +#define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE) +#define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE) +#define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE) typedef struct stat stat_type; @@ -380,7 +352,7 @@ typedef struct _symbol_info /* Get the name of a stabs type code. */ -extern const char *bfd_get_stab_name PARAMS ((int)); +extern const char *bfd_get_stab_name (int); /* Hash table routines. There is no way to free up a hash table. */ @@ -413,75 +385,74 @@ struct bfd_hash_table built each of which calls the function in the superclass. Thus each function should be written to allocate a new block of memory only if the argument is NULL. */ - struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *)); + struct bfd_hash_entry *(*newfunc) + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); /* An objalloc for this hash table. This is a struct objalloc *, - but we use PTR to avoid requiring the inclusion of objalloc.h. */ - PTR memory; + but we use void * to avoid requiring the inclusion of objalloc.h. */ + void *memory; }; /* Initialize a hash table. */ -extern boolean bfd_hash_table_init - PARAMS ((struct bfd_hash_table *, - struct bfd_hash_entry *(*) (struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *))); +extern bfd_boolean bfd_hash_table_init + (struct bfd_hash_table *, + struct bfd_hash_entry *(*) (struct bfd_hash_entry *, + struct bfd_hash_table *, + const char *)); /* Initialize a hash table specifying a size. */ -extern boolean bfd_hash_table_init_n - PARAMS ((struct bfd_hash_table *, - struct bfd_hash_entry *(*) (struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *), - unsigned int size)); +extern bfd_boolean bfd_hash_table_init_n + (struct bfd_hash_table *, + struct bfd_hash_entry *(*) (struct bfd_hash_entry *, + struct bfd_hash_table *, + const char *), + unsigned int size); /* Free up a hash table. */ -extern void bfd_hash_table_free PARAMS ((struct bfd_hash_table *)); +extern void bfd_hash_table_free + (struct bfd_hash_table *); -/* Look up a string in a hash table. If CREATE is true, a new entry +/* Look up a string in a hash table. If CREATE is TRUE, a new entry will be created for this string if one does not already exist. The - COPY argument must be true if this routine should copy the string + COPY argument must be TRUE if this routine should copy the string into newly allocated memory when adding an entry. */ extern struct bfd_hash_entry *bfd_hash_lookup - PARAMS ((struct bfd_hash_table *, const char *, boolean create, - boolean copy)); + (struct bfd_hash_table *, const char *, bfd_boolean create, + bfd_boolean copy); /* Replace an entry in a hash table. */ extern void bfd_hash_replace - PARAMS ((struct bfd_hash_table *, struct bfd_hash_entry *old, - struct bfd_hash_entry *nw)); + (struct bfd_hash_table *, struct bfd_hash_entry *old, + struct bfd_hash_entry *nw); /* Base method for creating a hash table entry. */ extern struct bfd_hash_entry *bfd_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, - const char *)); + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); /* Grab some space for a hash table entry. */ -extern PTR bfd_hash_allocate PARAMS ((struct bfd_hash_table *, - unsigned int)); +extern void *bfd_hash_allocate + (struct bfd_hash_table *, unsigned int); /* Traverse a hash table in a random order, calling a function on each - element. If the function returns false, the traversal stops. The + element. If the function returns FALSE, the traversal stops. The INFO argument is passed to the function. */ -extern void bfd_hash_traverse PARAMS ((struct bfd_hash_table *, - boolean (*) (struct bfd_hash_entry *, - PTR), - PTR info)); +extern void bfd_hash_traverse + (struct bfd_hash_table *, + bfd_boolean (*) (struct bfd_hash_entry *, void *), + void *info); -#define COFF_SWAP_TABLE (PTR) &bfd_coff_std_swap_table +#define COFF_SWAP_TABLE (void *) &bfd_coff_std_swap_table /* User program access to BFD facilities. */ /* Direct I/O routines, for programs which know more about the object file than BFD does. Use higher level routines if possible. */ -extern bfd_size_type bfd_bread PARAMS ((PTR, bfd_size_type, bfd *)); -extern bfd_size_type bfd_bwrite PARAMS ((const PTR, bfd_size_type, bfd *)); -extern int bfd_seek PARAMS ((bfd *, file_ptr, int)); -extern ufile_ptr bfd_tell PARAMS ((bfd *)); -extern int bfd_flush PARAMS ((bfd *)); -extern int bfd_stat PARAMS ((bfd *, struct stat *)); +extern bfd_size_type bfd_bread (void *, bfd_size_type, bfd *); +extern bfd_size_type bfd_bwrite (const void *, bfd_size_type, bfd *); +extern int bfd_seek (bfd *, file_ptr, int); +extern file_ptr bfd_tell (bfd *); +extern int bfd_flush (bfd *); +extern int bfd_stat (bfd *, struct stat *); /* Deprecated old routines. */ #if __GNUC__ @@ -499,8 +470,7 @@ extern int bfd_stat PARAMS ((bfd *, struct stat *)); (warn_deprecated ("bfd_write", (const char *) 0, 0, (const char *) 0),\ bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))) #endif -extern void warn_deprecated - PARAMS ((const char *, const char *, int, const char *)); +extern void warn_deprecated (const char *, const char *, int, const char *); /* Cast from const char * to char * so that caller can assign to a char * without a warning. */ @@ -536,40 +506,41 @@ extern void warn_deprecated #define bfd_get_symbol_leading_char(abfd) ((abfd)->xvec->symbol_leading_char) -#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = (boolean) (bool)), true) +#define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE) -extern boolean bfd_cache_close PARAMS ((bfd *abfd)); +extern bfd_boolean bfd_cache_close + (bfd *abfd); /* NB: This declaration should match the autogenerated one in libbfd.h. */ -extern boolean bfd_record_phdr - PARAMS ((bfd *, unsigned long, boolean, flagword, boolean, bfd_vma, - boolean, boolean, unsigned int, struct sec **)); +extern bfd_boolean bfd_record_phdr + (bfd *, unsigned long, bfd_boolean, flagword, bfd_boolean, bfd_vma, + bfd_boolean, bfd_boolean, unsigned int, struct bfd_section **); /* Byte swapping routines. */ -bfd_vma bfd_getb64 PARAMS ((const unsigned char *)); -bfd_vma bfd_getl64 PARAMS ((const unsigned char *)); -bfd_signed_vma bfd_getb_signed_64 PARAMS ((const unsigned char *)); -bfd_signed_vma bfd_getl_signed_64 PARAMS ((const unsigned char *)); -bfd_vma bfd_getb32 PARAMS ((const unsigned char *)); -bfd_vma bfd_getl32 PARAMS ((const unsigned char *)); -bfd_signed_vma bfd_getb_signed_32 PARAMS ((const unsigned char *)); -bfd_signed_vma bfd_getl_signed_32 PARAMS ((const unsigned char *)); -bfd_vma bfd_getb16 PARAMS ((const unsigned char *)); -bfd_vma bfd_getl16 PARAMS ((const unsigned char *)); -bfd_signed_vma bfd_getb_signed_16 PARAMS ((const unsigned char *)); -bfd_signed_vma bfd_getl_signed_16 PARAMS ((const unsigned char *)); -void bfd_putb64 PARAMS ((bfd_vma, unsigned char *)); -void bfd_putl64 PARAMS ((bfd_vma, unsigned char *)); -void bfd_putb32 PARAMS ((bfd_vma, unsigned char *)); -void bfd_putl32 PARAMS ((bfd_vma, unsigned char *)); -void bfd_putb16 PARAMS ((bfd_vma, unsigned char *)); -void bfd_putl16 PARAMS ((bfd_vma, unsigned char *)); +bfd_uint64_t bfd_getb64 (const void *); +bfd_uint64_t bfd_getl64 (const void *); +bfd_int64_t bfd_getb_signed_64 (const void *); +bfd_int64_t bfd_getl_signed_64 (const void *); +bfd_vma bfd_getb32 (const void *); +bfd_vma bfd_getl32 (const void *); +bfd_signed_vma bfd_getb_signed_32 (const void *); +bfd_signed_vma bfd_getl_signed_32 (const void *); +bfd_vma bfd_getb16 (const void *); +bfd_vma bfd_getl16 (const void *); +bfd_signed_vma bfd_getb_signed_16 (const void *); +bfd_signed_vma bfd_getl_signed_16 (const void *); +void bfd_putb64 (bfd_uint64_t, void *); +void bfd_putl64 (bfd_uint64_t, void *); +void bfd_putb32 (bfd_vma, void *); +void bfd_putl32 (bfd_vma, void *); +void bfd_putb16 (bfd_vma, void *); +void bfd_putl16 (bfd_vma, void *); /* Byte swapping routines which take size and endiannes as arguments. */ -bfd_vma bfd_get_bits PARAMS ((bfd_byte *, int, boolean)); -void bfd_put_bits PARAMS ((bfd_vma, bfd_byte *, int, boolean)); +bfd_uint64_t bfd_get_bits (const void *, int, bfd_boolean); +void bfd_put_bits (bfd_uint64_t, void *, int, bfd_boolean); /* Externally visible ECOFF routines. */ @@ -577,59 +548,54 @@ void bfd_put_bits PARAMS ((bfd_vma, bfd_byte *, int, boolean)); struct ecoff_debug_info; struct ecoff_debug_swap; struct ecoff_extr; -struct symbol_cache_entry; +struct bfd_symbol; struct bfd_link_info; struct bfd_link_hash_entry; struct bfd_elf_version_tree; #endif -extern bfd_vma bfd_ecoff_get_gp_value PARAMS ((bfd * abfd)); -extern boolean bfd_ecoff_set_gp_value PARAMS ((bfd *abfd, bfd_vma gp_value)); -extern boolean bfd_ecoff_set_regmasks - PARAMS ((bfd *abfd, unsigned long gprmask, unsigned long fprmask, - unsigned long *cprmask)); -extern PTR bfd_ecoff_debug_init - PARAMS ((bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, - struct bfd_link_info *)); +extern bfd_vma bfd_ecoff_get_gp_value + (bfd * abfd); +extern bfd_boolean bfd_ecoff_set_gp_value + (bfd *abfd, bfd_vma gp_value); +extern bfd_boolean bfd_ecoff_set_regmasks + (bfd *abfd, unsigned long gprmask, unsigned long fprmask, + unsigned long *cprmask); +extern void *bfd_ecoff_debug_init + (bfd *output_bfd, struct ecoff_debug_info *output_debug, + const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); extern void bfd_ecoff_debug_free - PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, - struct bfd_link_info *)); -extern boolean bfd_ecoff_debug_accumulate - PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, - bfd *input_bfd, struct ecoff_debug_info *input_debug, - const struct ecoff_debug_swap *input_swap, - struct bfd_link_info *)); -extern boolean bfd_ecoff_debug_accumulate_other - PARAMS ((PTR handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, - const struct ecoff_debug_swap *output_swap, bfd *input_bfd, - struct bfd_link_info *)); -extern boolean bfd_ecoff_debug_externals - PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - boolean relocateable, - boolean (*get_extr) (struct symbol_cache_entry *, - struct ecoff_extr *), - void (*set_index) (struct symbol_cache_entry *, - bfd_size_type))); -extern boolean bfd_ecoff_debug_one_external - PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - const char *name, struct ecoff_extr *esym)); + (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, + const struct ecoff_debug_swap *output_swap, struct bfd_link_info *); +extern bfd_boolean bfd_ecoff_debug_accumulate + (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, + const struct ecoff_debug_swap *output_swap, bfd *input_bfd, + struct ecoff_debug_info *input_debug, + const struct ecoff_debug_swap *input_swap, struct bfd_link_info *); +extern bfd_boolean bfd_ecoff_debug_accumulate_other + (void *handle, bfd *output_bfd, struct ecoff_debug_info *output_debug, + const struct ecoff_debug_swap *output_swap, bfd *input_bfd, + struct bfd_link_info *); +extern bfd_boolean bfd_ecoff_debug_externals + (bfd *abfd, struct ecoff_debug_info *debug, + const struct ecoff_debug_swap *swap, bfd_boolean relocatable, + bfd_boolean (*get_extr) (struct bfd_symbol *, struct ecoff_extr *), + void (*set_index) (struct bfd_symbol *, bfd_size_type)); +extern bfd_boolean bfd_ecoff_debug_one_external + (bfd *abfd, struct ecoff_debug_info *debug, + const struct ecoff_debug_swap *swap, const char *name, + struct ecoff_extr *esym); extern bfd_size_type bfd_ecoff_debug_size - PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap)); -extern boolean bfd_ecoff_write_debug - PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, file_ptr where)); -extern boolean bfd_ecoff_write_accumulated_debug - PARAMS ((PTR handle, bfd *abfd, struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap, - struct bfd_link_info *info, file_ptr where)); -extern boolean bfd_mips_ecoff_create_embedded_relocs - PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, - char **)); + (bfd *abfd, struct ecoff_debug_info *debug, + const struct ecoff_debug_swap *swap); +extern bfd_boolean bfd_ecoff_write_debug + (bfd *abfd, struct ecoff_debug_info *debug, + const struct ecoff_debug_swap *swap, file_ptr where); +extern bfd_boolean bfd_ecoff_write_accumulated_debug + (void *handle, bfd *abfd, struct ecoff_debug_info *debug, + const struct ecoff_debug_swap *swap, + struct bfd_link_info *info, file_ptr where); +extern bfd_boolean bfd_mips_ecoff_create_embedded_relocs + (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); /* Externally visible ELF routines. */ @@ -640,36 +606,37 @@ struct bfd_link_needed_list const char *name; }; -extern boolean bfd_elf32_record_link_assignment - PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean)); -extern boolean bfd_elf64_record_link_assignment - PARAMS ((bfd *, struct bfd_link_info *, const char *, boolean)); +enum dynamic_lib_link_class { + DYN_NORMAL = 0, + DYN_AS_NEEDED = 1, + DYN_DT_NEEDED = 2 +}; + +extern bfd_boolean bfd_elf_record_link_assignment + (bfd *, struct bfd_link_info *, const char *, bfd_boolean); extern struct bfd_link_needed_list *bfd_elf_get_needed_list - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean bfd_elf_get_bfd_needed_list - PARAMS ((bfd *, struct bfd_link_needed_list **)); -extern boolean bfd_elf32_size_dynamic_sections - PARAMS ((bfd *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct sec **, - struct bfd_elf_version_tree *)); -extern boolean bfd_elf64_size_dynamic_sections - PARAMS ((bfd *, const char *, const char *, const char *, - const char * const *, struct bfd_link_info *, struct sec **, - struct bfd_elf_version_tree *)); -extern void bfd_elf_set_dt_needed_name PARAMS ((bfd *, const char *)); -extern void bfd_elf_set_dt_needed_soname PARAMS ((bfd *, const char *)); -extern const char *bfd_elf_get_dt_soname PARAMS ((bfd *)); + (bfd *, struct bfd_link_info *); +extern bfd_boolean bfd_elf_get_bfd_needed_list + (bfd *, struct bfd_link_needed_list **); +extern bfd_boolean bfd_elf_size_dynamic_sections + (bfd *, const char *, const char *, const char *, const char * const *, + struct bfd_link_info *, struct bfd_section **, struct bfd_elf_version_tree *); +extern void bfd_elf_set_dt_needed_name + (bfd *, const char *); +extern const char *bfd_elf_get_dt_soname + (bfd *); +extern void bfd_elf_set_dyn_lib_class + (bfd *, int); extern struct bfd_link_needed_list *bfd_elf_get_runpath_list - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean bfd_elf32_discard_info - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean bfd_elf64_discard_info - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); +extern bfd_boolean bfd_elf_discard_info + (bfd *, struct bfd_link_info *); /* Return an upper bound on the number of bytes required to store a copy of ABFD's program header table entries. Return -1 if an error occurs; bfd_get_error will return an appropriate code. */ -extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd)); +extern long bfd_get_elf_phdr_upper_bound + (bfd *abfd); /* Copy ABFD's program header table entries to *PHDRS. The entries will be stored as an array of Elf_Internal_Phdr structures, as @@ -678,39 +645,58 @@ extern long bfd_get_elf_phdr_upper_bound PARAMS ((bfd *abfd)); Return the number of program header table entries read, or -1 if an error occurs; bfd_get_error will return an appropriate code. */ -extern int bfd_get_elf_phdrs PARAMS ((bfd *abfd, void *phdrs)); +extern int bfd_get_elf_phdrs + (bfd *abfd, void *phdrs); + +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote memory + based on the ELF file header at EHDR_VMA and the ELF program headers it + points to. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs the + file headers (and hence BFD's idea of each section's VMA) put them at. + + The function TARGET_READ_MEMORY is called to copy LEN bytes from the + remote memory at target address VMA into the local buffer at MYADDR; it + should return zero on success or an `errno' code on failure. TEMPL must + be a BFD for an ELF target with the word size and byte order found in + the remote memory. */ +extern bfd *bfd_elf_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, char *myaddr, int len)); /* Return the arch_size field of an elf bfd, or -1 if not elf. */ -extern int bfd_get_arch_size PARAMS ((bfd *)); +extern int bfd_get_arch_size + (bfd *); -/* Return true if address "naturally" sign extends, or -1 if not elf. */ -extern int bfd_get_sign_extend_vma PARAMS ((bfd *)); +/* Return TRUE if address "naturally" sign extends, or -1 if not elf. */ +extern int bfd_get_sign_extend_vma + (bfd *); -extern boolean bfd_m68k_elf32_create_embedded_relocs - PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, - char **)); -extern boolean bfd_mips_elf32_create_embedded_relocs - PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, - char **)); +extern struct bfd_section *_bfd_elf_tls_setup + (bfd *, struct bfd_link_info *); + +extern bfd_boolean bfd_m68k_elf32_create_embedded_relocs + (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); +extern bfd_boolean bfd_mips_elf32_create_embedded_relocs + (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); /* SunOS shared library support routines for the linker. */ extern struct bfd_link_needed_list *bfd_sunos_get_needed_list - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean bfd_sunos_record_link_assignment - PARAMS ((bfd *, struct bfd_link_info *, const char *)); -extern boolean bfd_sunos_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *, struct sec **, struct sec **, - struct sec **)); + (bfd *, struct bfd_link_info *); +extern bfd_boolean bfd_sunos_record_link_assignment + (bfd *, struct bfd_link_info *, const char *); +extern bfd_boolean bfd_sunos_size_dynamic_sections + (bfd *, struct bfd_link_info *, struct bfd_section **, struct bfd_section **, struct bfd_section **); /* Linux shared library support routines for the linker. */ -extern boolean bfd_i386linux_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean bfd_m68klinux_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean bfd_sparclinux_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean bfd_i386linux_size_dynamic_sections + (bfd *, struct bfd_link_info *); +extern bfd_boolean bfd_m68klinux_size_dynamic_sections + (bfd *, struct bfd_link_info *); +extern bfd_boolean bfd_sparclinux_size_dynamic_sections + (bfd *, struct bfd_link_info *); /* mmap hacks */ @@ -720,7 +706,7 @@ typedef struct _bfd_window_internal bfd_window_internal; typedef struct _bfd_window { /* What the user asked for. */ - PTR data; + void *data; bfd_size_type size; /* The actual window used by BFD. Small user-requested read-only regions sharing a page may share a single window into the object @@ -732,34 +718,36 @@ typedef struct _bfd_window } bfd_window; -extern void bfd_init_window PARAMS ((bfd_window *)); -extern void bfd_free_window PARAMS ((bfd_window *)); -extern boolean bfd_get_file_window - PARAMS ((bfd *, file_ptr, bfd_size_type, bfd_window *, boolean)); +extern void bfd_init_window + (bfd_window *); +extern void bfd_free_window + (bfd_window *); +extern bfd_boolean bfd_get_file_window + (bfd *, file_ptr, bfd_size_type, bfd_window *, bfd_boolean); /* XCOFF support routines for the linker. */ -extern boolean bfd_xcoff_link_record_set - PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, - bfd_size_type)); -extern boolean bfd_xcoff_import_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, - bfd_vma, const char *, const char *, const char *, unsigned int)); -extern boolean bfd_xcoff_export_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *)); -extern boolean bfd_xcoff_link_count_reloc - PARAMS ((bfd *, struct bfd_link_info *, const char *)); -extern boolean bfd_xcoff_record_link_assignment - PARAMS ((bfd *, struct bfd_link_info *, const char *)); -extern boolean bfd_xcoff_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *, const char *, const char *, - unsigned long, unsigned long, unsigned long, boolean, - int, boolean, boolean, struct sec **, boolean)); -extern boolean bfd_xcoff_link_generate_rtinit - PARAMS ((bfd *, const char *, const char *, boolean)); +extern bfd_boolean bfd_xcoff_link_record_set + (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_size_type); +extern bfd_boolean bfd_xcoff_import_symbol + (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *, bfd_vma, + const char *, const char *, const char *, unsigned int); +extern bfd_boolean bfd_xcoff_export_symbol + (bfd *, struct bfd_link_info *, struct bfd_link_hash_entry *); +extern bfd_boolean bfd_xcoff_link_count_reloc + (bfd *, struct bfd_link_info *, const char *); +extern bfd_boolean bfd_xcoff_record_link_assignment + (bfd *, struct bfd_link_info *, const char *); +extern bfd_boolean bfd_xcoff_size_dynamic_sections + (bfd *, struct bfd_link_info *, const char *, const char *, + unsigned long, unsigned long, unsigned long, bfd_boolean, + int, bfd_boolean, bfd_boolean, struct bfd_section **, bfd_boolean); +extern bfd_boolean bfd_xcoff_link_generate_rtinit + (bfd *, const char *, const char *, bfd_boolean); /* XCOFF support routines for ar. */ -extern boolean bfd_xcoff_ar_archive_set_magic PARAMS ((bfd *, char *)); +extern bfd_boolean bfd_xcoff_ar_archive_set_magic + (bfd *, char *); /* Externally visible COFF routines. */ @@ -768,144 +756,165 @@ struct internal_syment; union internal_auxent; #endif -extern boolean bfd_coff_get_syment - PARAMS ((bfd *, struct symbol_cache_entry *, struct internal_syment *)); +extern bfd_boolean bfd_coff_get_syment + (bfd *, struct bfd_symbol *, struct internal_syment *); -extern boolean bfd_coff_get_auxent - PARAMS ((bfd *, struct symbol_cache_entry *, int, union internal_auxent *)); +extern bfd_boolean bfd_coff_get_auxent + (bfd *, struct bfd_symbol *, int, union internal_auxent *); -extern boolean bfd_coff_set_symbol_class - PARAMS ((bfd *, struct symbol_cache_entry *, unsigned int)); +extern bfd_boolean bfd_coff_set_symbol_class + (bfd *, struct bfd_symbol *, unsigned int); -extern boolean bfd_m68k_coff_create_embedded_relocs - PARAMS ((bfd *, struct bfd_link_info *, struct sec *, struct sec *, - char **)); +extern bfd_boolean bfd_m68k_coff_create_embedded_relocs + (bfd *, struct bfd_link_info *, struct bfd_section *, struct bfd_section *, char **); /* ARM Interworking support. Called from linker. */ -extern boolean bfd_arm_allocate_interworking_sections - PARAMS ((struct bfd_link_info *)); +extern bfd_boolean bfd_arm_allocate_interworking_sections + (struct bfd_link_info *); -extern boolean bfd_arm_process_before_allocation - PARAMS ((bfd *, struct bfd_link_info *, int)); +extern bfd_boolean bfd_arm_process_before_allocation + (bfd *, struct bfd_link_info *, int); -extern boolean bfd_arm_get_bfd_for_interworking - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean bfd_arm_get_bfd_for_interworking + (bfd *, struct bfd_link_info *); /* PE ARM Interworking support. Called from linker. */ -extern boolean bfd_arm_pe_allocate_interworking_sections - PARAMS ((struct bfd_link_info *)); +extern bfd_boolean bfd_arm_pe_allocate_interworking_sections + (struct bfd_link_info *); -extern boolean bfd_arm_pe_process_before_allocation - PARAMS ((bfd *, struct bfd_link_info *, int)); +extern bfd_boolean bfd_arm_pe_process_before_allocation + (bfd *, struct bfd_link_info *, int); -extern boolean bfd_arm_pe_get_bfd_for_interworking - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean bfd_arm_pe_get_bfd_for_interworking + (bfd *, struct bfd_link_info *); /* ELF ARM Interworking support. Called from linker. */ -extern boolean bfd_elf32_arm_allocate_interworking_sections - PARAMS ((struct bfd_link_info *)); +extern bfd_boolean bfd_elf32_arm_allocate_interworking_sections + (struct bfd_link_info *); + +extern bfd_boolean bfd_elf32_arm_process_before_allocation + (bfd *, struct bfd_link_info *, int); + +extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking + (bfd *, struct bfd_link_info *); -extern boolean bfd_elf32_arm_process_before_allocation - PARAMS ((bfd *, struct bfd_link_info *, int)); +extern bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd + (bfd *, struct bfd_link_info *); -extern boolean bfd_elf32_arm_get_bfd_for_interworking - PARAMS ((bfd *, struct bfd_link_info *)); +/* ARM Note section processing. */ +extern bfd_boolean bfd_arm_merge_machines + (bfd *, bfd *); -extern boolean bfd_elf32_arm_add_glue_sections_to_bfd - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean bfd_arm_update_notes + (bfd *, const char *); + +extern unsigned int bfd_arm_get_mach_from_notes + (bfd *, const char *); /* TI COFF load page support. */ extern void bfd_ticoff_set_section_load_page - PARAMS ((struct sec *, int)); + (struct bfd_section *, int); extern int bfd_ticoff_get_section_load_page - PARAMS ((struct sec *)); + (struct bfd_section *); + +/* H8/300 functions. */ +extern bfd_vma bfd_h8300_pad_address + (bfd *, bfd_vma); + +/* IA64 Itanium code generation. Called from linker. */ +extern void bfd_elf32_ia64_after_parse + (int); + +extern void bfd_elf64_ia64_after_parse + (int); /* Extracted from init.c. */ -void -bfd_init PARAMS ((void)); +void bfd_init (void); /* Extracted from opncls.c. */ -bfd * -bfd_openr PARAMS ((const char *filename, const char *target)); +bfd *bfd_openr (const char *filename, const char *target); + +bfd *bfd_fdopenr (const char *filename, const char *target, int fd); + +bfd *bfd_openstreamr (const char *, const char *, void *); -bfd * -bfd_fdopenr PARAMS ((const char *filename, const char *target, int fd)); +bfd *bfd_openw (const char *filename, const char *target); -bfd * -bfd_openstreamr PARAMS ((const char *, const char *, PTR)); +bfd_boolean bfd_close (bfd *abfd); -bfd * -bfd_openw PARAMS ((const char *filename, const char *target)); +bfd_boolean bfd_close_all_done (bfd *); -boolean -bfd_close PARAMS ((bfd *abfd)); +bfd *bfd_create (const char *filename, bfd *templ); -boolean -bfd_close_all_done PARAMS ((bfd *)); +bfd_boolean bfd_make_writable (bfd *abfd); -bfd * -bfd_create PARAMS ((const char *filename, bfd *templ)); +bfd_boolean bfd_make_readable (bfd *abfd); -boolean -bfd_make_writable PARAMS ((bfd *abfd)); +unsigned long bfd_calc_gnu_debuglink_crc32 + (unsigned long crc, const unsigned char *buf, bfd_size_type len); -boolean -bfd_make_readable PARAMS ((bfd *abfd)); +char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); + +struct bfd_section *bfd_create_gnu_debuglink_section + (bfd *abfd, const char *filename); + +bfd_boolean bfd_fill_in_gnu_debuglink_section + (bfd *abfd, struct bfd_section *sect, const char *filename); /* Extracted from libbfd.c. */ /* 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)) = (val) & 0xff)) #define bfd_put_signed_8 \ - bfd_put_8 + bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(unsigned char *) (ptr) & 0xff) + (*(unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ - BFD_SEND(abfd, bfd_putx16, ((val),(ptr))) + BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) #define bfd_put_signed_16 \ - bfd_put_16 + bfd_put_16 #define bfd_get_16(abfd, ptr) \ - BFD_SEND(abfd, bfd_getx16, (ptr)) + BFD_SEND (abfd, bfd_getx16, (ptr)) #define bfd_get_signed_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) + BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) #define bfd_put_32(abfd, val, ptr) \ - BFD_SEND(abfd, bfd_putx32, ((val),(ptr))) + BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ - bfd_put_32 + bfd_put_32 #define bfd_get_32(abfd, ptr) \ - BFD_SEND(abfd, bfd_getx32, (ptr)) + BFD_SEND (abfd, bfd_getx32, (ptr)) #define bfd_get_signed_32(abfd, ptr) \ - BFD_SEND(abfd, bfd_getx_signed_32, (ptr)) + BFD_SEND (abfd, bfd_getx_signed_32, (ptr)) #define bfd_put_64(abfd, val, ptr) \ - BFD_SEND(abfd, bfd_putx64, ((val), (ptr))) + BFD_SEND (abfd, bfd_putx64, ((val), (ptr))) #define bfd_put_signed_64 \ - bfd_put_64 + bfd_put_64 #define bfd_get_64(abfd, ptr) \ - BFD_SEND(abfd, bfd_getx64, (ptr)) + BFD_SEND (abfd, bfd_getx64, (ptr)) #define bfd_get_signed_64(abfd, ptr) \ - BFD_SEND(abfd, bfd_getx_signed_64, (ptr)) + BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) -#define bfd_get(bits, abfd, ptr) \ - ( (bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ - : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ - : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ - : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ - : (abort (), (bfd_vma) - 1)) +#define bfd_get(bits, abfd, ptr) \ + ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ + : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ + : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ + : (abort (), (bfd_vma) - 1)) -#define bfd_put(bits, abfd, val, ptr) \ - ( (bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ - : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ - : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ - : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ - : (abort (), (void) 0)) +#define bfd_put(bits, abfd, val, ptr) \ + ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ + : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ + : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ + : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ + : (abort (), (void) 0)) /* Byte swapping macros for file header data. */ @@ -946,54 +955,32 @@ bfd_make_readable PARAMS ((bfd *abfd)); #define bfd_h_get_signed_64(abfd, ptr) \ BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) -/* Refinements on the above, which should eventually go away. Save - cluttering the source with (bfd_vma) and (bfd_byte *) casts. */ - -#define H_PUT_64(abfd, val, where) \ - bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_32(abfd, val, where) \ - bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_16(abfd, val, where) \ - bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_8 bfd_h_put_8 - -#define H_PUT_S64(abfd, val, where) \ - bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_S32(abfd, val, where) \ - bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_S16(abfd, val, where) \ - bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_S8 bfd_h_put_signed_8 - -#define H_GET_64(abfd, where) \ - bfd_h_get_64 ((abfd), (bfd_byte *) (where)) - -#define H_GET_32(abfd, where) \ - bfd_h_get_32 ((abfd), (bfd_byte *) (where)) - -#define H_GET_16(abfd, where) \ - bfd_h_get_16 ((abfd), (bfd_byte *) (where)) +/* Aliases for the above, which should eventually go away. */ -#define H_GET_8 bfd_h_get_8 +#define H_PUT_64 bfd_h_put_64 +#define H_PUT_32 bfd_h_put_32 +#define H_PUT_16 bfd_h_put_16 +#define H_PUT_8 bfd_h_put_8 +#define H_PUT_S64 bfd_h_put_signed_64 +#define H_PUT_S32 bfd_h_put_signed_32 +#define H_PUT_S16 bfd_h_put_signed_16 +#define H_PUT_S8 bfd_h_put_signed_8 +#define H_GET_64 bfd_h_get_64 +#define H_GET_32 bfd_h_get_32 +#define H_GET_16 bfd_h_get_16 +#define H_GET_8 bfd_h_get_8 +#define H_GET_S64 bfd_h_get_signed_64 +#define H_GET_S32 bfd_h_get_signed_32 +#define H_GET_S16 bfd_h_get_signed_16 +#define H_GET_S8 bfd_h_get_signed_8 -#define H_GET_S64(abfd, where) \ - bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where)) -#define H_GET_S32(abfd, where) \ - bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where)) - -#define H_GET_S16(abfd, where) \ - bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where)) - -#define H_GET_S8 bfd_h_get_signed_8 +/* Extracted from bfdio.c. */ +long bfd_get_mtime (bfd *abfd); +long bfd_get_size (bfd *abfd); +/* Extracted from bfdwin.c. */ /* Extracted from section.c. */ /* This structure is used for a comdat section, as in PE. A comdat section is associated with a particular symbol. When the linker @@ -1012,7 +999,7 @@ struct bfd_comdat_info long symbol; }; -typedef struct sec +typedef struct bfd_section { /* The name of the section; the name isn't a copy, the pointer is the same as that passed to bfd_make_section. */ @@ -1025,7 +1012,7 @@ typedef struct sec int index; /* The next section in the list belonging to the BFD, or NULL. */ - struct sec *next; + struct bfd_section *next; /* The field flags contains attributes of the section. Some flags are read in from the object file, and some are @@ -1223,10 +1210,39 @@ typedef struct sec /* A mark flag used by some linker backends for garbage collection. */ unsigned int gc_mark : 1; - /* Used by the ELF code to mark sections which have been allocated - to segments. */ + /* The following flags are used by the ELF linker. */ + + /* Mark sections which have been allocated to segments. */ unsigned int segment_mark : 1; + /* Type of sec_info information. */ + unsigned int sec_info_type:3; +#define ELF_INFO_TYPE_NONE 0 +#define ELF_INFO_TYPE_STABS 1 +#define ELF_INFO_TYPE_MERGE 2 +#define ELF_INFO_TYPE_EH_FRAME 3 +#define ELF_INFO_TYPE_JUST_SYMS 4 + + /* Nonzero if this section uses RELA relocations, rather than REL. */ + unsigned int use_rela_p:1; + + /* Bits used by various backends. */ + unsigned int has_tls_reloc:1; + + /* Nonzero if this section needs the relax finalize pass. */ + unsigned int need_finalize_relax:1; + + /* Nonzero if this section has a gp reloc. */ + unsigned int has_gp_reloc:1; + + /* Unused bits. */ + unsigned int flag13:1; + unsigned int flag14:1; + unsigned int flag15:1; + unsigned int flag16:4; + unsigned int flag20:4; + unsigned int flag24:8; + /* End of internal packed boolean fields. */ /* The virtual memory address of the section - where it will be @@ -1262,7 +1278,7 @@ typedef struct sec bfd_vma output_offset; /* The output section through which to map on output. */ - struct sec *output_section; + struct bfd_section *output_section; /* The alignment requirement of the section, as an exponent of 2 - e.g., 3 aligns to 2^3 (or 8). */ @@ -1292,7 +1308,7 @@ typedef struct sec file_ptr line_filepos; /* Pointer to data for applications. */ - PTR userdata; + void *userdata; /* If the SEC_IN_MEMORY flag is set, this points to the actual contents. */ @@ -1310,6 +1326,10 @@ typedef struct sec /* Optional information about a COMDAT entry; NULL if not COMDAT. */ struct bfd_comdat_info *comdat; + /* Points to the kept section if this section is a link-once section, + and is discarded. */ + struct bfd_section *kept_section; + /* When a section is being output, this value changes as more linenumbers are written out. */ file_ptr moving_line_filepos; @@ -1317,7 +1337,7 @@ typedef struct sec /* What the section number is in the target world. */ int target_index; - PTR used_by_bfd; + void *used_by_bfd; /* If this is a constructor section then here is a list of the relocations created to relocate items within it. */ @@ -1327,8 +1347,8 @@ typedef struct sec bfd *owner; /* A symbol which points at this section only. */ - struct symbol_cache_entry *symbol; - struct symbol_cache_entry **symbol_ptr_ptr; + struct bfd_symbol *symbol; + struct bfd_symbol **symbol_ptr_ptr; struct bfd_link_order *link_order_head; struct bfd_link_order *link_order_tail; @@ -1345,18 +1365,18 @@ typedef struct sec #define BFD_IND_SECTION_NAME "*IND*" /* The absolute section. */ -extern const asection bfd_abs_section; +extern 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. */ -extern const asection bfd_und_section; +extern 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. */ -extern const asection bfd_com_section; +extern asection bfd_com_section; #define bfd_com_section_ptr ((asection *) &bfd_com_section) /* Pointer to the indirect section. */ -extern const asection bfd_ind_section; +extern asection bfd_ind_section; #define bfd_ind_section_ptr ((asection *) &bfd_ind_section) #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) @@ -1366,13 +1386,12 @@ extern const asection bfd_ind_section; || ((SEC) == bfd_com_section_ptr) \ || ((SEC) == bfd_ind_section_ptr)) -extern const struct symbol_cache_entry * const bfd_abs_symbol; -extern const struct symbol_cache_entry * const bfd_com_symbol; -extern const struct symbol_cache_entry * const bfd_und_symbol; -extern const struct symbol_cache_entry * const bfd_ind_symbol; +extern const struct bfd_symbol * const bfd_abs_symbol; +extern const struct bfd_symbol * const bfd_com_symbol; +extern const struct bfd_symbol * const bfd_und_symbol; +extern const struct bfd_symbol * const bfd_ind_symbol; #define bfd_get_section_size_before_reloc(section) \ - ((section)->reloc_done ? (abort (), (bfd_size_type) 1) \ - : (section)->_raw_size) + ((section)->_raw_size) #define bfd_get_section_size_after_reloc(section) \ ((section)->reloc_done ? (section)->_cooked_size \ : (abort (), (bfd_size_type) 1)) @@ -1402,61 +1421,48 @@ extern const struct symbol_cache_entry * const bfd_ind_symbol; } \ while (0) -void -bfd_section_list_clear PARAMS ((bfd *)); +void bfd_section_list_clear (bfd *); -asection * -bfd_get_section_by_name PARAMS ((bfd *abfd, const char *name)); +asection *bfd_get_section_by_name (bfd *abfd, const char *name); -char * -bfd_get_unique_section_name PARAMS ((bfd *abfd, - const char *templat, - int *count)); +char *bfd_get_unique_section_name + (bfd *abfd, const char *templat, int *count); -asection * -bfd_make_section_old_way PARAMS ((bfd *abfd, const char *name)); +asection *bfd_make_section_old_way (bfd *abfd, const char *name); -asection * -bfd_make_section_anyway PARAMS ((bfd *abfd, const char *name)); +asection *bfd_make_section_anyway (bfd *abfd, const char *name); -asection * -bfd_make_section PARAMS ((bfd *, const char *name)); +asection *bfd_make_section (bfd *, const char *name); -boolean -bfd_set_section_flags PARAMS ((bfd *abfd, asection *sec, flagword flags)); +bfd_boolean bfd_set_section_flags + (bfd *abfd, asection *sec, flagword flags); -void -bfd_map_over_sections PARAMS ((bfd *abfd, - void (*func) (bfd *abfd, - asection *sect, - PTR obj), - PTR obj)); +void bfd_map_over_sections + (bfd *abfd, + void (*func) (bfd *abfd, asection *sect, void *obj), + void *obj); -boolean -bfd_set_section_size PARAMS ((bfd *abfd, asection *sec, bfd_size_type val)); +bfd_boolean bfd_set_section_size + (bfd *abfd, asection *sec, bfd_size_type val); -boolean -bfd_set_section_contents PARAMS ((bfd *abfd, asection *section, - PTR data, file_ptr offset, - bfd_size_type count)); +bfd_boolean bfd_set_section_contents + (bfd *abfd, asection *section, const void *data, + file_ptr offset, bfd_size_type count); -boolean -bfd_get_section_contents PARAMS ((bfd *abfd, asection *section, - PTR location, file_ptr offset, - bfd_size_type count)); +bfd_boolean bfd_get_section_contents + (bfd *abfd, asection *section, void *location, file_ptr offset, + bfd_size_type count); -boolean -bfd_copy_private_section_data PARAMS ((bfd *ibfd, asection *isec, - bfd *obfd, asection *osec)); +bfd_boolean bfd_copy_private_section_data + (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); #define bfd_copy_private_section_data(ibfd, isection, obfd, osection) \ BFD_SEND (obfd, _bfd_copy_private_section_data, \ (ibfd, isection, obfd, osection)) -void -_bfd_strip_section_from_output PARAMS ((struct bfd_link_info *info, asection *section)); +void _bfd_strip_section_from_output + (struct bfd_link_info *info, asection *section); -boolean -bfd_generic_discard_group PARAMS ((bfd *abfd, asection *group)); +bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); /* Extracted from archures.c. */ enum bfd_architecture @@ -1476,6 +1482,7 @@ enum bfd_architecture #define bfd_mach_mcf5206e 10 #define bfd_mach_mcf5307 11 #define bfd_mach_mcf5407 12 +#define bfd_mach_mcf528x 13 bfd_arch_vax, /* DEC Vax */ bfd_arch_i960, /* Intel 960 */ /* The order of the following is important. @@ -1521,12 +1528,16 @@ enum bfd_architecture #define bfd_mach_mips4010 4010 #define bfd_mach_mips4100 4100 #define bfd_mach_mips4111 4111 +#define bfd_mach_mips4120 4120 #define bfd_mach_mips4300 4300 #define bfd_mach_mips4400 4400 #define bfd_mach_mips4600 4600 #define bfd_mach_mips4650 4650 #define bfd_mach_mips5000 5000 +#define bfd_mach_mips5400 5400 +#define bfd_mach_mips5500 5500 #define bfd_mach_mips6000 6000 +#define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 #define bfd_mach_mips10000 10000 #define bfd_mach_mips12000 12000 @@ -1534,13 +1545,15 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ #define bfd_mach_mipsisa32 32 +#define bfd_mach_mipsisa32r2 33 #define bfd_mach_mipsisa64 64 +#define bfd_mach_mipsisa64r2 65 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 +#define bfd_mach_i386_i386 1 +#define bfd_mach_i386_i8086 2 +#define bfd_mach_i386_i386_intel_syntax 3 +#define bfd_mach_x86_64 64 +#define bfd_mach_x86_64_intel_syntax 65 bfd_arch_we32k, /* AT&T WE32xxx */ bfd_arch_tahoe, /* CCI/Harris Tahoe */ bfd_arch_i860, /* Intel 860 */ @@ -1549,15 +1562,20 @@ enum bfd_architecture bfd_arch_alliant, /* Alliant */ bfd_arch_convex, /* Convex */ bfd_arch_m88k, /* Motorola 88xxx */ + bfd_arch_m98k, /* Motorola 98xxx */ 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_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 bfd_arch_pdp11, /* DEC PDP-11 */ bfd_arch_powerpc, /* PowerPC */ -#define bfd_mach_ppc 0 -#define bfd_mach_ppc64 1 +#define bfd_mach_ppc 32 +#define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 #define bfd_mach_ppc_403gc 4030 #define bfd_mach_ppc_505 505 @@ -1574,38 +1592,52 @@ enum bfd_architecture #define bfd_mach_ppc_rs64ii 642 #define bfd_mach_ppc_rs64iii 643 #define bfd_mach_ppc_7400 7400 +#define bfd_mach_ppc_e500 500 bfd_arch_rs6000, /* IBM RS/6000 */ -#define bfd_mach_rs6k 0 +#define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 bfd_arch_hppa, /* HP PA RISC */ +#define bfd_mach_hppa10 10 +#define bfd_mach_hppa11 11 +#define bfd_mach_hppa20 20 +#define bfd_mach_hppa20w 25 bfd_arch_d10v, /* Mitsubishi D10V */ -#define bfd_mach_d10v 0 +#define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 bfd_arch_d30v, /* Mitsubishi D30V */ bfd_arch_dlx, /* DLX */ bfd_arch_m68hc11, /* Motorola 68HC11 */ bfd_arch_m68hc12, /* Motorola 68HC12 */ +#define bfd_mach_m6812_default 0 +#define bfd_mach_m6812 1 +#define bfd_mach_m6812s 2 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 */ -#define bfd_mach_sh 0 + bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ +#define bfd_mach_sh 1 #define bfd_mach_sh2 0x20 #define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2e 0x2e #define bfd_mach_sh3 0x30 #define bfd_mach_sh3_dsp 0x3d #define bfd_mach_sh3e 0x3e #define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d #define bfd_mach_sh5 0x50 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. */ +#define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 #define bfd_mach_arm_2a 2 #define bfd_mach_arm_3 3 @@ -1616,40 +1648,54 @@ enum bfd_architecture #define bfd_mach_arm_5T 8 #define bfd_mach_arm_5TE 9 #define bfd_mach_arm_XScale 10 +#define bfd_mach_arm_ep9312 11 +#define bfd_mach_arm_iWMMXt 12 bfd_arch_ns32k, /* National Semiconductors ns32000 */ bfd_arch_w65, /* WDC 65816 */ bfd_arch_tic30, /* Texas Instruments TMS320C30 */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_tic3x 30 +#define bfd_mach_tic4x 40 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_v850 1 #define bfd_mach_v850e 'E' -#define bfd_mach_v850ea 'A' +#define bfd_mach_v850e1 '1' 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 /* For backwards compatibility. */ +#define bfd_mach_arc_5 5 +#define bfd_mach_arc_6 6 +#define bfd_mach_arc_7 7 +#define bfd_mach_arc_8 8 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' +#define bfd_mach_m32r2 '2' bfd_arch_mn10200, /* Matsushita MN10200 */ bfd_arch_mn10300, /* Matsushita MN10300 */ #define bfd_mach_mn10300 300 #define bfd_mach_am33 330 +#define bfd_mach_am33_2 332 bfd_arch_fr30, #define bfd_mach_fr30 0x46523330 bfd_arch_frv, -#define bfd_mach_frv 0 -#define bfd_mach_frvsimple 1 +#define bfd_mach_frv 1 +#define bfd_mach_frvsimple 2 #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_frvtomcat 499 /* fr500 prototype */ #define bfd_mach_fr500 500 +#define bfd_mach_fr550 550 bfd_arch_mcore, bfd_arch_ia64, /* HP/Intel ia64 */ -#define bfd_mach_ia64_elf64 0 -#define bfd_mach_ia64_elf32 1 +#define bfd_mach_ia64_elf64 64 +#define bfd_mach_ia64_elf32 32 + bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ +#define bfd_mach_ip2022 1 +#define bfd_mach_ip2022ext 2 + bfd_arch_iq2000, /* Vitesse IQ2000. */ +#define bfd_mach_iq2000 1 +#define bfd_mach_iq10 2 bfd_arch_pj, bfd_arch_avr, /* Atmel AVR microcontrollers. */ #define bfd_mach_avr1 1 @@ -1659,12 +1705,29 @@ enum bfd_architecture #define bfd_mach_avr5 5 bfd_arch_cris, /* Axis CRIS */ bfd_arch_s390, /* IBM s390 */ -#define bfd_mach_s390_31 0 -#define bfd_mach_s390_64 1 +#define bfd_mach_s390_31 31 +#define bfd_mach_s390_64 64 bfd_arch_openrisc, /* OpenRISC */ bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, -#define bfd_mach_xstormy16 0 +#define bfd_mach_xstormy16 1 + bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 + bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ +#define bfd_mach_xtensa 1 bfd_arch_last }; @@ -1678,66 +1741,50 @@ 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. + /* TRUE if this is the default machine for the architecture. The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via <>. */ - boolean the_default; + bfd_boolean the_default; const struct bfd_arch_info * (*compatible) - PARAMS ((const struct bfd_arch_info *a, - const struct bfd_arch_info *b)); + (const struct bfd_arch_info *a, const struct bfd_arch_info *b); - boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *)); + bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); const struct bfd_arch_info *next; } bfd_arch_info_type; -const char * -bfd_printable_name PARAMS ((bfd *abfd)); +const char *bfd_printable_name (bfd *abfd); -const bfd_arch_info_type * -bfd_scan_arch PARAMS ((const char *string)); +const bfd_arch_info_type *bfd_scan_arch (const char *string); -const char ** -bfd_arch_list PARAMS ((void)); +const char **bfd_arch_list (void); -const bfd_arch_info_type * -bfd_arch_get_compatible PARAMS (( - const bfd *abfd, - const bfd *bbfd)); +const bfd_arch_info_type *bfd_arch_get_compatible + (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns); -void -bfd_set_arch_info PARAMS ((bfd *abfd, const bfd_arch_info_type *arg)); +void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); -enum bfd_architecture -bfd_get_arch PARAMS ((bfd *abfd)); +enum bfd_architecture bfd_get_arch (bfd *abfd); -unsigned long -bfd_get_mach PARAMS ((bfd *abfd)); +unsigned long bfd_get_mach (bfd *abfd); -unsigned int -bfd_arch_bits_per_byte PARAMS ((bfd *abfd)); +unsigned int bfd_arch_bits_per_byte (bfd *abfd); -unsigned int -bfd_arch_bits_per_address PARAMS ((bfd *abfd)); +unsigned int bfd_arch_bits_per_address (bfd *abfd); -const bfd_arch_info_type * -bfd_get_arch_info PARAMS ((bfd *abfd)); +const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); -const bfd_arch_info_type * -bfd_lookup_arch PARAMS ((enum bfd_architecture - arch, - unsigned long machine)); +const bfd_arch_info_type *bfd_lookup_arch + (enum bfd_architecture arch, unsigned long machine); -const char * -bfd_printable_arch_mach PARAMS ((enum bfd_architecture arch, unsigned long machine)); +const char *bfd_printable_arch_mach + (enum bfd_architecture arch, unsigned long machine); -unsigned int -bfd_octets_per_byte PARAMS ((bfd *abfd)); +unsigned int bfd_octets_per_byte (bfd *abfd); -unsigned int -bfd_arch_mach_octets_per_byte PARAMS ((enum bfd_architecture arch, - unsigned long machine)); +unsigned int bfd_arch_mach_octets_per_byte + (enum bfd_architecture arch, unsigned long machine); /* Extracted from reloc.c. */ typedef enum bfd_reloc_status @@ -1775,7 +1822,7 @@ typedef enum bfd_reloc_status typedef struct reloc_cache_entry { /* A pointer into the canonical table of pointers. */ - struct symbol_cache_entry **sym_ptr_ptr; + struct bfd_symbol **sym_ptr_ptr; /* offset in section. */ bfd_size_type address; @@ -1834,7 +1881,7 @@ struct reloc_howto_struct data section of the addend. The relocation function will subtract from the relocation value the address of the location being relocated. */ - boolean pc_relative; + bfd_boolean pc_relative; /* The bit position of the reloc value in the destination. The relocated value is left shifted by this amount. */ @@ -1846,11 +1893,11 @@ struct reloc_howto_struct /* If this field is non null, then the supplied function is called rather than the normal function. This allows really - strange relocation methods to be accomodated (e.g., i960 callj + strange relocation methods to be accommodated (e.g., i960 callj instructions). */ bfd_reloc_status_type (*special_function) - PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *, - bfd *, char **)); + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); /* The textual name of the relocation type. */ char *name; @@ -1870,21 +1917,20 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - boolean partial_inplace; - - /* The src_mask selects which parts of the read in data - are to be used in the relocation sum. E.g., if this was an 8 bit - byte of data which we read and relocated, this would be - 0x000000ff. When we have relocs which have an addend, such as - sun4 extended relocs, the value in the offset part of a - relocating field is garbage so we never use it. In this case - the mask would be 0x00000000. */ + bfd_boolean partial_inplace; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should be zero. Non-zero values for ELF USE_RELA targets are + bogus as in those cases the value in the dst_mask part of the + section contents should be treated as garbage. */ bfd_vma src_mask; - /* The dst_mask selects which parts of the instruction are replaced - into the instruction. In most cases src_mask == dst_mask, - except in the above special case, where dst_mask would be - 0x000000ff, and src_mask would be 0x00000000. */ + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ bfd_vma dst_mask; /* When some formats create PC relative instructions, they leave @@ -1893,22 +1939,22 @@ struct reloc_howto_struct be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction empty (e.g., m88k bcs); this flag signals the fact. */ - boolean pcrel_offset; + bfd_boolean pcrel_offset; }; #define HOWTO(C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC) \ { (unsigned) C, R, S, B, P, BI, O, SF, NAME, INPLACE, MASKSRC, MASKDST, PC } #define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, false, 0, 0, IN) + NAME, FALSE, 0, 0, IN) #define EMPTY_HOWTO(C) \ - HOWTO ((C), 0, 0, 0, false, 0, complain_overflow_dont, NULL, \ - NULL, false, 0, 0, false) + HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ + NULL, FALSE, 0, 0, FALSE) #define HOWTO_PREPARE(relocation, symbol) \ { \ - if (symbol != (asymbol *) NULL) \ + if (symbol != NULL) \ { \ if (bfd_is_com_section (symbol->section)) \ { \ @@ -1921,8 +1967,7 @@ struct reloc_howto_struct } \ } -unsigned int -bfd_get_reloc_size PARAMS ((reloc_howto_type *)); +unsigned int bfd_get_reloc_size (reloc_howto_type *); typedef struct relent_chain { @@ -1931,27 +1976,27 @@ typedef struct relent_chain } arelent_chain; -bfd_reloc_status_type -bfd_check_overflow PARAMS ((enum complain_overflow how, +bfd_reloc_status_type bfd_check_overflow + (enum complain_overflow how, unsigned int bitsize, unsigned int rightshift, unsigned int addrsize, - bfd_vma relocation)); + bfd_vma relocation); -bfd_reloc_status_type -bfd_perform_relocation PARAMS ((bfd *abfd, +bfd_reloc_status_type bfd_perform_relocation + (bfd *abfd, arelent *reloc_entry, - PTR data, + void *data, asection *input_section, bfd *output_bfd, - char **error_message)); + char **error_message); -bfd_reloc_status_type -bfd_install_relocation PARAMS ((bfd *abfd, +bfd_reloc_status_type bfd_install_relocation + (bfd *abfd, arelent *reloc_entry, - PTR data, bfd_vma data_start, + void *data, bfd_vma data_start, asection *input_section, - char **error_message)); + char **error_message); enum bfd_reloc_code_real { _dummy_first_bfd_reloc_code_real, @@ -2096,6 +2141,32 @@ relocation types already defined. */ /* SPARC little endian relocation */ BFD_RELOC_SPARC_REV32, +/* SPARC TLS relocations */ + BFD_RELOC_SPARC_TLS_GD_HI22, + BFD_RELOC_SPARC_TLS_GD_LO10, + BFD_RELOC_SPARC_TLS_GD_ADD, + BFD_RELOC_SPARC_TLS_GD_CALL, + BFD_RELOC_SPARC_TLS_LDM_HI22, + BFD_RELOC_SPARC_TLS_LDM_LO10, + BFD_RELOC_SPARC_TLS_LDM_ADD, + BFD_RELOC_SPARC_TLS_LDM_CALL, + BFD_RELOC_SPARC_TLS_LDO_HIX22, + BFD_RELOC_SPARC_TLS_LDO_LOX10, + BFD_RELOC_SPARC_TLS_LDO_ADD, + BFD_RELOC_SPARC_TLS_IE_HI22, + BFD_RELOC_SPARC_TLS_IE_LO10, + BFD_RELOC_SPARC_TLS_IE_LD, + BFD_RELOC_SPARC_TLS_IE_LDX, + BFD_RELOC_SPARC_TLS_IE_ADD, + BFD_RELOC_SPARC_TLS_LE_HIX22, + BFD_RELOC_SPARC_TLS_LE_LOX10, + BFD_RELOC_SPARC_TLS_DTPMOD32, + BFD_RELOC_SPARC_TLS_DTPMOD64, + BFD_RELOC_SPARC_TLS_DTPOFF32, + BFD_RELOC_SPARC_TLS_DTPOFF64, + BFD_RELOC_SPARC_TLS_TPOFF32, + BFD_RELOC_SPARC_TLS_TPOFF64, + /* Alpha ECOFF and ELF relocations. Some of these treat the symbol or "addend" in some special way. For GPDISP_HI16 ("gpdisp") relocations, the symbol is ignored when @@ -2161,7 +2232,7 @@ GP register. */ BFD_RELOC_ALPHA_GPREL_LO16, /* Like BFD_RELOC_23_PCREL_S2, except that the source and target must -share a common GP, and the target address is adjusted for +share a common GP, and the target address is adjusted for STO_ALPHA_STD_GPLOAD. */ BFD_RELOC_ALPHA_BRSGP, @@ -2234,6 +2305,7 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_MIPS_RELGOT, BFD_RELOC_MIPS_JALR, + /* Fujitsu Frv Relocations. */ BFD_RELOC_FRV_LABEL16, BFD_RELOC_FRV_LABEL24, @@ -2244,6 +2316,48 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_FRV_GPREL32, BFD_RELOC_FRV_GPRELHI, BFD_RELOC_FRV_GPRELLO, + BFD_RELOC_FRV_GOT12, + BFD_RELOC_FRV_GOTHI, + BFD_RELOC_FRV_GOTLO, + BFD_RELOC_FRV_FUNCDESC, + BFD_RELOC_FRV_FUNCDESC_GOT12, + BFD_RELOC_FRV_FUNCDESC_GOTHI, + BFD_RELOC_FRV_FUNCDESC_GOTLO, + BFD_RELOC_FRV_FUNCDESC_VALUE, + BFD_RELOC_FRV_FUNCDESC_GOTOFF12, + BFD_RELOC_FRV_FUNCDESC_GOTOFFHI, + BFD_RELOC_FRV_FUNCDESC_GOTOFFLO, + BFD_RELOC_FRV_GOTOFF12, + BFD_RELOC_FRV_GOTOFFHI, + BFD_RELOC_FRV_GOTOFFLO, + + +/* This is a 24bit GOT-relative reloc for the mn10300. */ + BFD_RELOC_MN10300_GOTOFF24, + +/* This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes +in the instruction. */ + BFD_RELOC_MN10300_GOT32, + +/* This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes +in the instruction. */ + BFD_RELOC_MN10300_GOT24, + +/* This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes +in the instruction. */ + BFD_RELOC_MN10300_GOT16, + +/* Copy symbol at runtime. */ + BFD_RELOC_MN10300_COPY, + +/* Create GOT entry. */ + BFD_RELOC_MN10300_GLOB_DAT, + +/* Create PLT entry. */ + BFD_RELOC_MN10300_JMP_SLOT, + +/* Adjust by program base. */ + BFD_RELOC_MN10300_RELATIVE, /* i386/elf relocations */ @@ -2277,6 +2391,14 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_X86_64_RELATIVE, BFD_RELOC_X86_64_GOTPCREL, BFD_RELOC_X86_64_32S, + BFD_RELOC_X86_64_DTPMOD64, + BFD_RELOC_X86_64_DTPOFF64, + BFD_RELOC_X86_64_TPOFF64, + BFD_RELOC_X86_64_TLSGD, + BFD_RELOC_X86_64_TLSLD, + BFD_RELOC_X86_64_DTPOFF32, + BFD_RELOC_X86_64_GOTTPOFF, + BFD_RELOC_X86_64_TPOFF32, /* ns32k relocations */ BFD_RELOC_NS32K_IMM_8, @@ -2359,10 +2481,52 @@ to compensate for the borrow when the low bits are added. */ BFD_RELOC_PPC64_PLTGOT16_DS, BFD_RELOC_PPC64_PLTGOT16_LO_DS, +/* PowerPC and PowerPC64 thread-local storage relocations. */ + BFD_RELOC_PPC_TLS, + BFD_RELOC_PPC_DTPMOD, + BFD_RELOC_PPC_TPREL16, + BFD_RELOC_PPC_TPREL16_LO, + BFD_RELOC_PPC_TPREL16_HI, + BFD_RELOC_PPC_TPREL16_HA, + BFD_RELOC_PPC_TPREL, + BFD_RELOC_PPC_DTPREL16, + BFD_RELOC_PPC_DTPREL16_LO, + BFD_RELOC_PPC_DTPREL16_HI, + BFD_RELOC_PPC_DTPREL16_HA, + BFD_RELOC_PPC_DTPREL, + BFD_RELOC_PPC_GOT_TLSGD16, + BFD_RELOC_PPC_GOT_TLSGD16_LO, + BFD_RELOC_PPC_GOT_TLSGD16_HI, + BFD_RELOC_PPC_GOT_TLSGD16_HA, + BFD_RELOC_PPC_GOT_TLSLD16, + BFD_RELOC_PPC_GOT_TLSLD16_LO, + BFD_RELOC_PPC_GOT_TLSLD16_HI, + BFD_RELOC_PPC_GOT_TLSLD16_HA, + BFD_RELOC_PPC_GOT_TPREL16, + BFD_RELOC_PPC_GOT_TPREL16_LO, + BFD_RELOC_PPC_GOT_TPREL16_HI, + BFD_RELOC_PPC_GOT_TPREL16_HA, + BFD_RELOC_PPC_GOT_DTPREL16, + BFD_RELOC_PPC_GOT_DTPREL16_LO, + BFD_RELOC_PPC_GOT_DTPREL16_HI, + BFD_RELOC_PPC_GOT_DTPREL16_HA, + BFD_RELOC_PPC64_TPREL16_DS, + BFD_RELOC_PPC64_TPREL16_LO_DS, + BFD_RELOC_PPC64_TPREL16_HIGHER, + BFD_RELOC_PPC64_TPREL16_HIGHERA, + BFD_RELOC_PPC64_TPREL16_HIGHEST, + BFD_RELOC_PPC64_TPREL16_HIGHESTA, + BFD_RELOC_PPC64_DTPREL16_DS, + BFD_RELOC_PPC64_DTPREL16_LO_DS, + BFD_RELOC_PPC64_DTPREL16_HIGHER, + BFD_RELOC_PPC64_DTPREL16_HIGHERA, + BFD_RELOC_PPC64_DTPREL16_HIGHEST, + BFD_RELOC_PPC64_DTPREL16_HIGHESTA, + /* IBM 370/390 relocations */ BFD_RELOC_I370_D12, -/* The type of reloc used to build a contructor table - at the moment +/* The type of reloc used to build a constructor table - at the moment probably a 32 bit wide absolute relocation, but the target can choose. It generally does map to one of the other relocation types. */ BFD_RELOC_CTOR, @@ -2390,6 +2554,7 @@ field in the instruction. */ BFD_RELOC_ARM_SWI, BFD_RELOC_ARM_MULTI, BFD_RELOC_ARM_CP_OFF_IMM, + BFD_RELOC_ARM_CP_OFF_IMM_S2, BFD_RELOC_ARM_ADR_IMM, BFD_RELOC_ARM_LDR_IMM, BFD_RELOC_ARM_LITERAL, @@ -2410,7 +2575,7 @@ field in the instruction. */ BFD_RELOC_ARM_GOTOFF, BFD_RELOC_ARM_GOTPC, -/* Hitachi SH relocs. Not all of these appear in object files. */ +/* Renesas / SuperH SH relocs. Not all of these appear in object files. */ BFD_RELOC_SH_PCDISP8BY2, BFD_RELOC_SH_PCDISP12BY2, BFD_RELOC_SH_IMM4, @@ -2485,6 +2650,14 @@ field in the instruction. */ BFD_RELOC_SH_IMM_HI16, BFD_RELOC_SH_IMM_HI16_PCREL, BFD_RELOC_SH_PT_16, + BFD_RELOC_SH_TLS_GD_32, + BFD_RELOC_SH_TLS_LD_32, + BFD_RELOC_SH_TLS_LDO_32, + BFD_RELOC_SH_TLS_IE_32, + BFD_RELOC_SH_TLS_LE_32, + BFD_RELOC_SH_TLS_DTPMOD32, + BFD_RELOC_SH_TLS_DTPOFF32, + BFD_RELOC_SH_TLS_TPOFF32, /* Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. */ @@ -2580,7 +2753,7 @@ of the container. */ /* DLX relocs */ BFD_RELOC_DLX_JMP26, -/* Mitsubishi M32R relocs. +/* Renesas M32R (formerly Mitsubishi M32R) relocs. This is a 24 bit absolute address. */ BFD_RELOC_M32R_24, @@ -2608,6 +2781,22 @@ used when the lower 16 bits are treated as signed. */ add3, load, and store instructions. */ BFD_RELOC_M32R_SDA16, +/* For PIC. */ + BFD_RELOC_M32R_GOT24, + BFD_RELOC_M32R_26_PLTREL, + BFD_RELOC_M32R_COPY, + BFD_RELOC_M32R_GLOB_DAT, + BFD_RELOC_M32R_JMP_SLOT, + BFD_RELOC_M32R_RELATIVE, + BFD_RELOC_M32R_GOTOFF, + BFD_RELOC_M32R_GOTPC24, + BFD_RELOC_M32R_GOT16_HI_ULO, + BFD_RELOC_M32R_GOT16_HI_SLO, + BFD_RELOC_M32R_GOT16_LO, + BFD_RELOC_M32R_GOTPC_HI_ULO, + BFD_RELOC_M32R_GOTPC_HI_SLO, + BFD_RELOC_M32R_GOTPC_LO, + /* This is a 9-bit reloc */ BFD_RELOC_V850_9_PCREL, @@ -2650,11 +2839,11 @@ data area pointer. */ BFD_RELOC_V850_TDA_4_4_OFFSET, /* This is a 16 bit offset from the short data area pointer, with the -bits placed non-contigously in the instruction. */ +bits placed non-contiguously in the instruction. */ BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET, /* This is a 16 bit offset from the zero data area pointer, with the -bits placed non-contigously in the instruction. */ +bits placed non-contiguously in the instruction. */ BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET, /* This is a 6 bit offset from the call table base pointer. */ @@ -2663,6 +2852,14 @@ bits placed non-contigously in the instruction. */ /* This is a 16 bit offset from the call table base pointer. */ BFD_RELOC_V850_CALLT_16_16_OFFSET, +/* Used for relaxing indirect function calls. */ + BFD_RELOC_V850_LONGCALL, + +/* Used for relaxing indirect jumps. */ + BFD_RELOC_V850_LONGJUMP, + +/* Used to maintain alignment whilst relaxing. */ + BFD_RELOC_V850_ALIGN, /* This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the instruction. */ @@ -2757,6 +2954,7 @@ short offset into 11 bits. */ BFD_RELOC_MMIX_PUSHJ_1, BFD_RELOC_MMIX_PUSHJ_2, BFD_RELOC_MMIX_PUSHJ_3, + BFD_RELOC_MMIX_PUSHJ_STUBBABLE, /* These are relocations for the JMP instruction. */ BFD_RELOC_MMIX_JMP, @@ -2906,6 +3104,95 @@ into 22 bits. */ /* 32 bit rel. offset to GOT entry. */ BFD_RELOC_390_GOTENT, +/* 64 bit offset to GOT. */ + BFD_RELOC_390_GOTOFF64, + +/* 12-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_390_GOTPLT12, + +/* 16-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_390_GOTPLT16, + +/* 32-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_390_GOTPLT32, + +/* 64-bit offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_390_GOTPLT64, + +/* 32-bit rel. offset to symbol-entry within GOT, with PLT handling. */ + BFD_RELOC_390_GOTPLTENT, + +/* 16-bit rel. offset from the GOT to a PLT entry. */ + BFD_RELOC_390_PLTOFF16, + +/* 32-bit rel. offset from the GOT to a PLT entry. */ + BFD_RELOC_390_PLTOFF32, + +/* 64-bit rel. offset from the GOT to a PLT entry. */ + BFD_RELOC_390_PLTOFF64, + +/* s390 tls relocations. */ + BFD_RELOC_390_TLS_LOAD, + BFD_RELOC_390_TLS_GDCALL, + BFD_RELOC_390_TLS_LDCALL, + BFD_RELOC_390_TLS_GD32, + BFD_RELOC_390_TLS_GD64, + BFD_RELOC_390_TLS_GOTIE12, + BFD_RELOC_390_TLS_GOTIE32, + BFD_RELOC_390_TLS_GOTIE64, + BFD_RELOC_390_TLS_LDM32, + BFD_RELOC_390_TLS_LDM64, + BFD_RELOC_390_TLS_IE32, + BFD_RELOC_390_TLS_IE64, + BFD_RELOC_390_TLS_IEENT, + BFD_RELOC_390_TLS_LE32, + BFD_RELOC_390_TLS_LE64, + BFD_RELOC_390_TLS_LDO32, + BFD_RELOC_390_TLS_LDO64, + BFD_RELOC_390_TLS_DTPMOD, + BFD_RELOC_390_TLS_DTPOFF, + BFD_RELOC_390_TLS_TPOFF, + +/* Long displacement extension. */ + BFD_RELOC_390_20, + BFD_RELOC_390_GOT20, + BFD_RELOC_390_GOTPLT20, + BFD_RELOC_390_TLS_GOTIE20, + +/* Scenix IP2K - 9-bit register number / data address */ + BFD_RELOC_IP2K_FR9, + +/* Scenix IP2K - 4-bit register/data bank number */ + BFD_RELOC_IP2K_BANK, + +/* Scenix IP2K - low 13 bits of instruction word address */ + BFD_RELOC_IP2K_ADDR16CJP, + +/* Scenix IP2K - high 3 bits of instruction word address */ + BFD_RELOC_IP2K_PAGE3, + +/* Scenix IP2K - ext/low/high 8 bits of data address */ + BFD_RELOC_IP2K_LO8DATA, + BFD_RELOC_IP2K_HI8DATA, + BFD_RELOC_IP2K_EX8DATA, + +/* Scenix IP2K - low/high 8 bits of instruction word address */ + BFD_RELOC_IP2K_LO8INSN, + BFD_RELOC_IP2K_HI8INSN, + +/* Scenix IP2K - even/odd PC modifier to modify snb pcl.0 */ + BFD_RELOC_IP2K_PC_SKIP, + +/* Scenix IP2K - 16 bit word address in text section. */ + BFD_RELOC_IP2K_TEXT, + +/* Scenix IP2K - 7-bit sp or dp offset */ + BFD_RELOC_IP2K_FR_OFFSET, + +/* Scenix VPE4K coprocessor - data/insn-space addressing */ + BFD_RELOC_VPE4KMATH_DATA, + BFD_RELOC_VPE4KMATH_INSN, + /* These two relocations are used by the linker to determine which of the entries in a C++ virtual function table are actually used. When the --gc-sections option is given, the linker will zero out the entries @@ -2913,7 +3200,7 @@ that are not used, so that the code for those functions need not be included in the output. VTABLE_INHERIT is a zero-space relocation used to describe to the -linker the inheritence tree of a C++ virtual function table. The +linker the inheritance tree of a C++ virtual function table. The relocation's symbol should be the parent class' vtable, and the relocation should be located at the child vtable. @@ -3008,17 +3295,52 @@ this offset in the reloc's section offset. */ BFD_RELOC_IA64_LTOFF_DTPREL22, /* Motorola 68HC11 reloc. -This is the 8 bits high part of an absolute address. */ +This is the 8 bit high part of an absolute address. */ BFD_RELOC_M68HC11_HI8, /* Motorola 68HC11 reloc. -This is the 8 bits low part of an absolute address. */ +This is the 8 bit low part of an absolute address. */ BFD_RELOC_M68HC11_LO8, /* Motorola 68HC11 reloc. -This is the 3 bits of a value. */ +This is the 3 bit of a value. */ BFD_RELOC_M68HC11_3B, +/* Motorola 68HC11 reloc. +This reloc marks the beginning of a jump/call instruction. +It is used for linker relaxation to correctly identify beginning +of instruction and change some branches to use PC-relative +addressing mode. */ + BFD_RELOC_M68HC11_RL_JUMP, + +/* Motorola 68HC11 reloc. +This reloc marks a group of several instructions that gcc generates +and for which the linker relaxation pass can modify and/or remove +some of them. */ + BFD_RELOC_M68HC11_RL_GROUP, + +/* Motorola 68HC11 reloc. +This is the 16-bit lower part of an address. It is used for 'call' +instruction to specify the symbol address without any special +transformation (due to memory bank window). */ + BFD_RELOC_M68HC11_LO16, + +/* Motorola 68HC11 reloc. +This is a 8-bit reloc that specifies the page number of an address. +It is used by 'call' instruction to specify the page number of +the symbol. */ + BFD_RELOC_M68HC11_PAGE, + +/* Motorola 68HC11 reloc. +This is a 24-bit reloc that represents the address with a 16-bit +value and a 8-bit page number. The symbol address is transformed +to follow the 16K memory bank of 68HC12 (seen as mapped in the window). */ + BFD_RELOC_M68HC11_24, + +/* Motorola 68HC12 reloc. +This is the 5 bits of a value. */ + BFD_RELOC_M68HC12_5B, + /* These relocs are only used within the CRIS assembler. They are not (at present) written to any object files. */ BFD_RELOC_CRIS_BDISP8, @@ -3101,6 +3423,7 @@ This is the 3 bits of a value. */ /* Sony Xstormy16 Relocations. */ BFD_RELOC_XSTORMY16_REL_12, + BFD_RELOC_XSTORMY16_12, BFD_RELOC_XSTORMY16_24, BFD_RELOC_XSTORMY16_FPTR16, @@ -3108,17 +3431,60 @@ This is the 3 bits of a value. */ BFD_RELOC_VAX_GLOB_DAT, BFD_RELOC_VAX_JMP_SLOT, BFD_RELOC_VAX_RELATIVE, + +/* msp430 specific relocation codes */ + BFD_RELOC_MSP430_10_PCREL, + BFD_RELOC_MSP430_16_PCREL, + BFD_RELOC_MSP430_16, + BFD_RELOC_MSP430_16_PCREL_BYTE, + BFD_RELOC_MSP430_16_BYTE, + +/* IQ2000 Relocations. */ + BFD_RELOC_IQ2000_OFFSET_16, + BFD_RELOC_IQ2000_OFFSET_21, + BFD_RELOC_IQ2000_UHI16, + +/* Special Xtensa relocation used only by PLT entries in ELF shared +objects to indicate that the runtime linker should set the value +to one of its own internal functions or data structures. */ + BFD_RELOC_XTENSA_RTLD, + +/* Xtensa relocations for ELF shared objects. */ + BFD_RELOC_XTENSA_GLOB_DAT, + BFD_RELOC_XTENSA_JMP_SLOT, + BFD_RELOC_XTENSA_RELATIVE, + +/* Xtensa relocation used in ELF object files for symbols that may require +PLT entries. Otherwise, this is just a generic 32-bit relocation. */ + BFD_RELOC_XTENSA_PLT, + +/* Generic Xtensa relocations. Only the operand number is encoded +in the relocation. The details are determined by extracting the +instruction opcode. */ + BFD_RELOC_XTENSA_OP0, + BFD_RELOC_XTENSA_OP1, + BFD_RELOC_XTENSA_OP2, + +/* Xtensa relocation to mark that the assembler expanded the +instructions from an original target. The expansion size is +encoded in the reloc size. */ + BFD_RELOC_XTENSA_ASM_EXPAND, + +/* Xtensa relocation to mark that the linker should simplify +assembler-expanded instructions. This is commonly used +internally by the linker after analysis of a +BFD_RELOC_XTENSA_ASM_EXPAND. */ + BFD_RELOC_XTENSA_ASM_SIMPLIFY, BFD_RELOC_UNUSED }; typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; -reloc_howto_type * -bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); +reloc_howto_type *bfd_reloc_type_lookup + (bfd *abfd, bfd_reloc_code_real_type code); -const char * -bfd_get_reloc_code_name PARAMS ((bfd_reloc_code_real_type code)); +const char *bfd_get_reloc_code_name (bfd_reloc_code_real_type code); /* Extracted from syms.c. */ -typedef struct symbol_cache_entry +typedef struct bfd_symbol { /* A pointer to the BFD which owns the symbol. This information is necessary so that a back end can work out what additional @@ -3129,7 +3495,7 @@ typedef struct symbol_cache_entry instead, except that some symbols point to the global sections bfd_{abs,com,und}_section. This could be fixed by making these globals be per-bfd (or per-target-flavor). FIXME. */ - struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ + struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ /* The text of the symbol. The name is left alone, and not copied; the application may not alter it. */ @@ -3159,7 +3525,7 @@ typedef struct symbol_cache_entry <>, <>, <> or <>. */ - /* The symbol is a debugging record. The value has an arbitary + /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ #define BSF_DEBUGGING 0x08 @@ -3230,12 +3596,12 @@ typedef struct symbol_cache_entry /* A pointer to the section to which this symbol is relative. This will always be non NULL, there are special sections for undefined and absolute symbols. */ - struct sec *section; + struct bfd_section *section; /* Back end special data. */ union { - PTR p; + void *p; bfd_vma i; } udata; @@ -3245,53 +3611,48 @@ asymbol; #define bfd_get_symtab_upper_bound(abfd) \ BFD_SEND (abfd, _bfd_get_symtab_upper_bound, (abfd)) -boolean -bfd_is_local_label PARAMS ((bfd *abfd, asymbol *sym)); +bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); -boolean -bfd_is_local_label_name PARAMS ((bfd *abfd, const char *name)); +bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab,\ - (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) -boolean -bfd_set_symtab PARAMS ((bfd *abfd, asymbol **location, unsigned int count)); +bfd_boolean bfd_set_symtab + (bfd *abfd, asymbol **location, unsigned int count); -void -bfd_print_symbol_vandf PARAMS ((bfd *abfd, PTR file, asymbol *symbol)); +void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) -asymbol * -_bfd_generic_make_empty_symbol PARAMS ((bfd *)); +asymbol *_bfd_generic_make_empty_symbol (bfd *); #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) -int -bfd_decode_symclass PARAMS ((asymbol *symbol)); +int bfd_decode_symclass (asymbol *symbol); -boolean -bfd_is_undefined_symclass PARAMS ((int symclass)); +bfd_boolean bfd_is_undefined_symclass (int symclass); -void -bfd_symbol_info PARAMS ((asymbol *symbol, symbol_info *ret)); +void bfd_symbol_info (asymbol *symbol, symbol_info *ret); -boolean -bfd_copy_private_symbol_data PARAMS ((bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym)); +bfd_boolean bfd_copy_private_symbol_data + (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) /* Extracted from bfd.c. */ -struct _bfd +struct bfd { + /* A unique identifier of the BFD */ + unsigned int id; + /* The filename the application opened the BFD with. */ const char *filename; @@ -3305,33 +3666,33 @@ struct _bfd is the result of an fopen on the filename. However, if the BFD_IN_MEMORY flag is set, then iostream is actually a pointer to a bfd_in_memory struct. */ - PTR iostream; + void *iostream; /* Is the file descriptor being cached? That is, can it be closed as needed, and re-opened when accessed later? */ - boolean cacheable; + bfd_boolean cacheable; /* Marks whether there was a default target specified when the BFD was opened. This is used to select which matching algorithm to use to choose the back end. */ - boolean target_defaulted; + bfd_boolean target_defaulted; /* The caching routines use these to maintain a least-recently-used list of BFDs. */ - struct _bfd *lru_prev, *lru_next; + struct bfd *lru_prev, *lru_next; /* When a file is closed by the caching routines, BFD retains state information on the file here... */ ufile_ptr where; /* ... and here: (``once'' means at least once). */ - boolean opened_once; + bfd_boolean opened_once; /* Set if we have a locally maintained mtime value, rather than getting it from the file each time. */ - boolean mtime_set; + bfd_boolean mtime_set; - /* File modified time, if mtime_set is true. */ + /* File modified time, if mtime_set is TRUE. */ long mtime; /* Reserved for an unimplemented file locking extension. */ @@ -3360,16 +3721,16 @@ struct _bfd /* Remember when output has begun, to stop strange things from happening. */ - boolean output_has_begun; + bfd_boolean output_has_begun; /* A hash table for section names. */ struct bfd_hash_table section_htab; /* Pointer to linked list of sections. */ - struct sec *sections; + struct bfd_section *sections; /* The place where we add to the section list. */ - struct sec **section_tail; + struct bfd_section **section_tail; /* The number of sections. */ unsigned int section_count; @@ -3382,7 +3743,7 @@ struct _bfd unsigned int symcount; /* Symbol table for output BFD (with symcount entries). */ - struct symbol_cache_entry **outsymbols; + struct bfd_symbol **outsymbols; /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -3391,14 +3752,14 @@ struct _bfd const struct bfd_arch_info *arch_info; /* Stuff only useful for archives. */ - PTR arelt_data; - struct _bfd *my_archive; /* The containing archive BFD. */ - struct _bfd *next; /* The next BFD in the archive. */ - struct _bfd *archive_head; /* The first BFD in the archive. */ - boolean has_armap; + void *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. */ + bfd_boolean has_armap; /* A chain of BFD structures involved in a link. */ - struct _bfd *link_next; + struct bfd *link_next; /* A field used by _bfd_generic_link_add_archive_symbols. This will be used only for archive elements. */ @@ -3436,17 +3797,22 @@ struct _bfd struct cisco_core_struct *cisco_core_data; struct versados_data_struct *versados_data; struct netbsd_core_struct *netbsd_core_data; - PTR any; + struct mach_o_data_struct *mach_o_data; + struct mach_o_fat_data_struct *mach_o_fat_data; + struct bfd_pef_data_struct *pef_data; + struct bfd_pef_xlib_data_struct *pef_xlib_data; + struct bfd_sym_data_struct *sym_data; + void *any; } tdata; /* Used by the application to hold private data. */ - PTR usrdata; + void *usrdata; /* Where all the allocated stuff under this BFD goes. This is a - struct objalloc *, but we use PTR to avoid requiring the inclusion of - objalloc.h. */ - PTR memory; + struct objalloc *, but we use void * to avoid requiring the inclusion + of objalloc.h. */ + void *memory; }; typedef enum bfd_error @@ -3474,114 +3840,84 @@ typedef enum bfd_error } bfd_error_type; -bfd_error_type -bfd_get_error PARAMS ((void)); - -void -bfd_set_error PARAMS ((bfd_error_type error_tag)); - -const char * -bfd_errmsg PARAMS ((bfd_error_type error_tag)); +bfd_error_type bfd_get_error (void); -void -bfd_perror PARAMS ((const char *message)); +void bfd_set_error (bfd_error_type error_tag); -typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...)); +const char *bfd_errmsg (bfd_error_type error_tag); -bfd_error_handler_type -bfd_set_error_handler PARAMS ((bfd_error_handler_type)); +void bfd_perror (const char *message); -void -bfd_set_error_program_name PARAMS ((const char *)); +typedef void (*bfd_error_handler_type) (const char *, ...); -bfd_error_handler_type -bfd_get_error_handler PARAMS ((void)); +bfd_error_handler_type bfd_set_error_handler (bfd_error_handler_type); -const char * -bfd_archive_filename PARAMS ((bfd *)); +void bfd_set_error_program_name (const char *); -long -bfd_get_reloc_upper_bound PARAMS ((bfd *abfd, asection *sect)); +bfd_error_handler_type bfd_get_error_handler (void); -long -bfd_canonicalize_reloc PARAMS ((bfd *abfd, - asection *sec, - arelent **loc, - asymbol **syms)); +const char *bfd_archive_filename (bfd *); -void -bfd_set_reloc PARAMS ((bfd *abfd, asection *sec, arelent **rel, unsigned int count)); +long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); -boolean -bfd_set_file_flags PARAMS ((bfd *abfd, flagword flags)); +long bfd_canonicalize_reloc + (bfd *abfd, asection *sec, arelent **loc, asymbol **syms); -int -bfd_get_arch_size PARAMS ((bfd *abfd)); +void bfd_set_reloc + (bfd *abfd, asection *sec, arelent **rel, unsigned int count); -int -bfd_get_sign_extend_vma PARAMS ((bfd *abfd)); +bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); -boolean -bfd_set_start_address PARAMS ((bfd *abfd, bfd_vma vma)); +int bfd_get_arch_size (bfd *abfd); -long -bfd_get_mtime PARAMS ((bfd *abfd)); +int bfd_get_sign_extend_vma (bfd *abfd); -long -bfd_get_size PARAMS ((bfd *abfd)); +bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma); -unsigned int -bfd_get_gp_size PARAMS ((bfd *abfd)); +unsigned int bfd_get_gp_size (bfd *abfd); -void -bfd_set_gp_size PARAMS ((bfd *abfd, unsigned int i)); +void bfd_set_gp_size (bfd *abfd, unsigned int i); -bfd_vma -bfd_scan_vma PARAMS ((const char *string, const char **end, int base)); +bfd_vma bfd_scan_vma (const char *string, const char **end, int base); -boolean -bfd_copy_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd)); +bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_copy_private_bfd_data(ibfd, obfd) \ BFD_SEND (obfd, _bfd_copy_private_bfd_data, \ (ibfd, obfd)) -boolean -bfd_merge_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd)); +bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); #define bfd_merge_private_bfd_data(ibfd, obfd) \ BFD_SEND (obfd, _bfd_merge_private_bfd_data, \ (ibfd, obfd)) -boolean -bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags)); +bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, \ - (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) #define bfd_sizeof_headers(abfd, reloc) \ - BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) + BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ - BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line)) + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, sec, syms, off, file, func, line)) - /* Do these three do anything useful at all, for any back end? */ #define bfd_debug_info_start(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) + BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) #define bfd_debug_info_end(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) + BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) #define bfd_debug_info_accumulate(abfd, section) \ - BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) - + BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) #define bfd_stat_arch_elt(abfd, stat) \ - BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) + BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) #define bfd_update_armap_timestamp(abfd) \ - BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) + BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) #define bfd_set_arch_mach(abfd, arch, mach)\ - BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) + BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) #define bfd_relax_section(abfd, section, link_info, again) \ BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again)) @@ -3629,36 +3965,48 @@ bfd_set_private_flags PARAMS ((bfd *abfd, flagword flags)); BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms)) extern bfd_byte *bfd_get_relocated_section_contents - PARAMS ((bfd *, struct bfd_link_info *, - struct bfd_link_order *, bfd_byte *, - boolean, asymbol **)); + (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, + bfd_boolean, asymbol **); + +bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); + +struct bfd_preserve +{ + void *marker; + void *tdata; + flagword flags; + const struct bfd_arch_info *arch_info; + struct bfd_section *sections; + struct bfd_section **section_tail; + unsigned int section_count; + struct bfd_hash_table section_htab; +}; + +bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); -boolean -bfd_alt_mach_code PARAMS ((bfd *abfd, int alternative)); +void bfd_preserve_restore (bfd *, struct bfd_preserve *); + +void bfd_preserve_finish (bfd *, struct bfd_preserve *); /* Extracted from archive.c. */ -symindex -bfd_get_next_mapent PARAMS ((bfd *abfd, symindex previous, carsym **sym)); +symindex bfd_get_next_mapent + (bfd *abfd, symindex previous, carsym **sym); -boolean -bfd_set_archive_head PARAMS ((bfd *output, bfd *new_head)); +bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head); -bfd * -bfd_openr_next_archived_file PARAMS ((bfd *archive, bfd *previous)); +bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous); /* Extracted from corefile.c. */ -const char * -bfd_core_file_failing_command PARAMS ((bfd *abfd)); +const char *bfd_core_file_failing_command (bfd *abfd); -int -bfd_core_file_failing_signal PARAMS ((bfd *abfd)); +int bfd_core_file_failing_signal (bfd *abfd); -boolean -core_file_matches_executable_p PARAMS ((bfd *core_bfd, bfd *exec_bfd)); +bfd_boolean core_file_matches_executable_p + (bfd *core_bfd, bfd *exec_bfd); /* Extracted from targets.c. */ #define BFD_SEND(bfd, message, arglist) \ - ((*((bfd)->xvec->message)) arglist) + ((*((bfd)->xvec->message)) arglist) #ifdef DEBUG_BFD_SEND #undef BFD_SEND @@ -3668,7 +4016,7 @@ core_file_matches_executable_p PARAMS ((bfd *core_bfd, bfd *exec_bfd)); (bfd_assert (__FILE__,__LINE__), NULL)) #endif #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 @@ -3698,7 +4046,11 @@ enum bfd_flavour bfd_target_msdos_flavour, bfd_target_ovax_flavour, bfd_target_evax_flavour, - bfd_target_mmo_flavour + bfd_target_mmo_flavour, + bfd_target_mach_o_flavour, + bfd_target_pef_flavour, + bfd_target_pef_xlib_flavour, + bfd_target_sym_flavour }; enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; @@ -3742,291 +4094,303 @@ typedef struct bfd_target /* Entries for byte swapping for data. These are different from the other entry points, since they don't take a BFD asthe first argument. Certain other handlers could do the same. */ - bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *)); - void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *)); - void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *)); - void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); + bfd_uint64_t (*bfd_getx64) (const void *); + bfd_int64_t (*bfd_getx_signed_64) (const void *); + void (*bfd_putx64) (bfd_uint64_t, void *); + bfd_vma (*bfd_getx32) (const void *); + bfd_signed_vma (*bfd_getx_signed_32) (const void *); + void (*bfd_putx32) (bfd_vma, void *); + bfd_vma (*bfd_getx16) (const void *); + bfd_signed_vma (*bfd_getx_signed_16) (const void *); + void (*bfd_putx16) (bfd_vma, void *); /* Byte swapping for the headers. */ - bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *)); - void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *)); - void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *)); - void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); + bfd_uint64_t (*bfd_h_getx64) (const void *); + bfd_int64_t (*bfd_h_getx_signed_64) (const void *); + void (*bfd_h_putx64) (bfd_uint64_t, void *); + bfd_vma (*bfd_h_getx32) (const void *); + bfd_signed_vma (*bfd_h_getx_signed_32) (const void *); + void (*bfd_h_putx32) (bfd_vma, void *); + bfd_vma (*bfd_h_getx16) (const void *); + bfd_signed_vma (*bfd_h_getx_signed_16) (const void *); + void (*bfd_h_putx16) (bfd_vma, void *); /* 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 <> or zero. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); + const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ - boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); + bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); /* Write cached information into a file being written, at <>. */ - boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); + bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *); /* Generic entry points. */ #define BFD_JUMP_TABLE_GENERIC(NAME) \ -CONCAT2 (NAME,_close_and_cleanup), \ -CONCAT2 (NAME,_bfd_free_cached_info), \ -CONCAT2 (NAME,_new_section_hook), \ -CONCAT2 (NAME,_get_section_contents), \ -CONCAT2 (NAME,_get_section_contents_in_window) + NAME##_close_and_cleanup, \ + NAME##_bfd_free_cached_info, \ + NAME##_new_section_hook, \ + NAME##_get_section_contents, \ + NAME##_get_section_contents_in_window /* Called when the BFD is being closed to do any necessary cleanup. */ - boolean (*_close_and_cleanup) PARAMS ((bfd *)); + bfd_boolean (*_close_and_cleanup) (bfd *); /* Ask the BFD to free all cached information. */ - boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); + bfd_boolean (*_bfd_free_cached_info) (bfd *); /* Called when a new section is created. */ - boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); + bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, - file_ptr, bfd_size_type)); - boolean (*_bfd_get_section_contents_in_window) - PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type)); + bfd_boolean (*_bfd_get_section_contents) + (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) + (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ -CONCAT2 (NAME,_bfd_copy_private_bfd_data), \ -CONCAT2 (NAME,_bfd_merge_private_bfd_data), \ -CONCAT2 (NAME,_bfd_copy_private_section_data), \ -CONCAT2 (NAME,_bfd_copy_private_symbol_data), \ -CONCAT2 (NAME,_bfd_set_private_flags), \ -CONCAT2 (NAME,_bfd_print_private_bfd_data) \ + NAME##_bfd_copy_private_bfd_data, \ + NAME##_bfd_merge_private_bfd_data, \ + NAME##_bfd_copy_private_section_data, \ + NAME##_bfd_copy_private_symbol_data, \ + NAME##_bfd_set_private_flags, \ + NAME##_bfd_print_private_bfd_data + /* Called to copy BFD general private data from one object file to another. */ - boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); + bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *)); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); /* Called to copy BFD private section data from one object file to another. */ - boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr, - bfd *, sec_ptr)); + bfd_boolean (*_bfd_copy_private_section_data) + (bfd *, sec_ptr, bfd *, sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *, - bfd *, asymbol *)); + bfd_boolean (*_bfd_copy_private_symbol_data) + (bfd *, asymbol *, bfd *, asymbol *); /* Called to set private backend flags. */ - boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword)); + bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); /* Called to print private BFD data. */ - boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); + bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *); /* Core file entry points. */ #define BFD_JUMP_TABLE_CORE(NAME) \ -CONCAT2 (NAME,_core_file_failing_command), \ -CONCAT2 (NAME,_core_file_failing_signal), \ -CONCAT2 (NAME,_core_file_matches_executable_p) - char * (*_core_file_failing_command) PARAMS ((bfd *)); - int (*_core_file_failing_signal) PARAMS ((bfd *)); - boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); + NAME##_core_file_failing_command, \ + NAME##_core_file_failing_signal, \ + NAME##_core_file_matches_executable_p + + char * (*_core_file_failing_command) (bfd *); + int (*_core_file_failing_signal) (bfd *); + bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *); /* Archive entry points. */ #define BFD_JUMP_TABLE_ARCHIVE(NAME) \ -CONCAT2 (NAME,_slurp_armap), \ -CONCAT2 (NAME,_slurp_extended_name_table), \ -CONCAT2 (NAME,_construct_extended_name_table), \ -CONCAT2 (NAME,_truncate_arname), \ -CONCAT2 (NAME,_write_armap), \ -CONCAT2 (NAME,_read_ar_hdr), \ -CONCAT2 (NAME,_openr_next_archived_file), \ -CONCAT2 (NAME,_get_elt_at_index), \ -CONCAT2 (NAME,_generic_stat_arch_elt), \ -CONCAT2 (NAME,_update_armap_timestamp) - boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); - boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); - boolean (*_bfd_construct_extended_name_table) - PARAMS ((bfd *, char **, bfd_size_type *, const char **)); - void (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *)); - boolean (*write_armap) - PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); - PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); - bfd * (*openr_next_archived_file) PARAMS ((bfd *, bfd *)); -#define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i)) - bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex)); - int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); - boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); + NAME##_slurp_armap, \ + NAME##_slurp_extended_name_table, \ + NAME##_construct_extended_name_table, \ + NAME##_truncate_arname, \ + NAME##_write_armap, \ + NAME##_read_ar_hdr, \ + NAME##_openr_next_archived_file, \ + NAME##_get_elt_at_index, \ + NAME##_generic_stat_arch_elt, \ + NAME##_update_armap_timestamp + + bfd_boolean (*_bfd_slurp_armap) (bfd *); + bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); + bfd_boolean (*_bfd_construct_extended_name_table) + (bfd *, char **, bfd_size_type *, const char **); + void (*_bfd_truncate_arname) (bfd *, const char *, char *); + bfd_boolean (*write_armap) + (bfd *, unsigned int, struct orl *, unsigned int, int); + void * (*_bfd_read_ar_hdr_fn) (bfd *); + bfd * (*openr_next_archived_file) (bfd *, bfd *); +#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) + bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); + int (*_bfd_stat_arch_elt) (bfd *, struct stat *); + bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); /* Entry points used for symbols. */ #define BFD_JUMP_TABLE_SYMBOLS(NAME) \ -CONCAT2 (NAME,_get_symtab_upper_bound), \ -CONCAT2 (NAME,_get_symtab), \ -CONCAT2 (NAME,_make_empty_symbol), \ -CONCAT2 (NAME,_print_symbol), \ -CONCAT2 (NAME,_get_symbol_info), \ -CONCAT2 (NAME,_bfd_is_local_label_name), \ -CONCAT2 (NAME,_get_lineno), \ -CONCAT2 (NAME,_find_nearest_line), \ -CONCAT2 (NAME,_bfd_make_debug_symbol), \ -CONCAT2 (NAME,_read_minisymbols), \ -CONCAT2 (NAME,_minisymbol_to_symbol) - long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); - long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, - struct symbol_cache_entry **)); - struct symbol_cache_entry * - (*_bfd_make_empty_symbol) PARAMS ((bfd *)); - void (*_bfd_print_symbol) PARAMS ((bfd *, PTR, - struct symbol_cache_entry *, - bfd_print_symbol_type)); -#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) PARAMS ((bfd *, - struct symbol_cache_entry *, - symbol_info *)); -#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e)) - boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); - - alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); - boolean (*_bfd_find_nearest_line) - PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma, - const char **, const char **, unsigned int *)); + NAME##_get_symtab_upper_bound, \ + NAME##_canonicalize_symtab, \ + NAME##_make_empty_symbol, \ + NAME##_print_symbol, \ + NAME##_get_symbol_info, \ + NAME##_bfd_is_local_label_name, \ + NAME##_get_lineno, \ + NAME##_find_nearest_line, \ + NAME##_bfd_make_debug_symbol, \ + NAME##_read_minisymbols, \ + NAME##_minisymbol_to_symbol + + long (*_bfd_get_symtab_upper_bound) (bfd *); + long (*_bfd_canonicalize_symtab) + (bfd *, struct bfd_symbol **); + struct bfd_symbol * + (*_bfd_make_empty_symbol) (bfd *); + void (*_bfd_print_symbol) + (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) + (bfd *, struct bfd_symbol *, symbol_info *); +#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); + + alent * (*_get_lineno) (bfd *, struct bfd_symbol *); + bfd_boolean (*_bfd_find_nearest_line) + (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, + const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol *(*_bfd_make_debug_symbol) PARAMS ((bfd *, void *, - unsigned long size)); + asymbol * (*_bfd_make_debug_symbol) + (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *, - unsigned int *)); + long (*_read_minisymbols) + (bfd *, bfd_boolean, void **, unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR, - asymbol *)); + asymbol * (*_minisymbol_to_symbol) + (bfd *, bfd_boolean, const void *, asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ -CONCAT2 (NAME,_get_reloc_upper_bound), \ -CONCAT2 (NAME,_canonicalize_reloc), \ -CONCAT2 (NAME,_bfd_reloc_type_lookup) - long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); - long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, - struct symbol_cache_entry **)); + NAME##_get_reloc_upper_bound, \ + NAME##_canonicalize_reloc, \ + NAME##_bfd_reloc_type_lookup + + long (*_get_reloc_upper_bound) (bfd *, sec_ptr); + long (*_bfd_canonicalize_reloc) + (bfd *, sec_ptr, arelent **, struct bfd_symbol **); /* See documentation on reloc types. */ reloc_howto_type * - (*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); + (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ -CONCAT2 (NAME,_set_arch_mach), \ -CONCAT2 (NAME,_set_section_contents) - boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture, - unsigned long)); - boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, - file_ptr, bfd_size_type)); + NAME##_set_arch_mach, \ + NAME##_set_section_contents + + bfd_boolean (*_bfd_set_arch_mach) + (bfd *, enum bfd_architecture, unsigned long); + bfd_boolean (*_bfd_set_section_contents) + (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ -CONCAT2 (NAME,_sizeof_headers), \ -CONCAT2 (NAME,_bfd_get_relocated_section_contents), \ -CONCAT2 (NAME,_bfd_relax_section), \ -CONCAT2 (NAME,_bfd_link_hash_table_create), \ -CONCAT2 (NAME,_bfd_link_hash_table_free), \ -CONCAT2 (NAME,_bfd_link_add_symbols), \ -CONCAT2 (NAME,_bfd_link_just_syms), \ -CONCAT2 (NAME,_bfd_final_link), \ -CONCAT2 (NAME,_bfd_link_split_section), \ -CONCAT2 (NAME,_bfd_gc_sections), \ -CONCAT2 (NAME,_bfd_merge_sections), \ -CONCAT2 (NAME,_bfd_discard_group) - int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); - bfd_byte *(*_bfd_get_relocated_section_contents) - PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, boolean, struct symbol_cache_entry **)); - - boolean (*_bfd_relax_section) - PARAMS ((bfd *, struct sec *, struct bfd_link_info *, boolean *)); + NAME##_sizeof_headers, \ + NAME##_bfd_get_relocated_section_contents, \ + NAME##_bfd_relax_section, \ + NAME##_bfd_link_hash_table_create, \ + NAME##_bfd_link_hash_table_free, \ + NAME##_bfd_link_add_symbols, \ + NAME##_bfd_link_just_syms, \ + NAME##_bfd_final_link, \ + NAME##_bfd_link_split_section, \ + NAME##_bfd_gc_sections, \ + NAME##_bfd_merge_sections, \ + NAME##_bfd_discard_group + + int (*_bfd_sizeof_headers) (bfd *, bfd_boolean); + bfd_byte * (*_bfd_get_relocated_section_contents) + (bfd *, struct bfd_link_info *, struct bfd_link_order *, + bfd_byte *, bfd_boolean, struct bfd_symbol **); + + bfd_boolean (*_bfd_relax_section) + (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ - struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *)); + struct bfd_link_hash_table * + (*_bfd_link_hash_table_create) (bfd *); /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) PARAMS ((struct bfd_link_hash_table *)); + void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); /* Add symbols from this object file into the hash table. */ - boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); + bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ - void (*_bfd_link_just_syms) PARAMS ((asection *, struct bfd_link_info *)); + void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); /* Do a link based on the link_order structures attached to each section of the BFD. */ - boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); + bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *); /* Should this section be split up into smaller pieces during linking. */ - boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); + bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); /* Remove sections that are not referenced from the output. */ - boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); + bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Attempt to merge SEC_MERGE sections. */ - boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *)); + bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); /* Discard members of a group. */ - boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *)); + bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ -CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \ -CONCAT2 (NAME,_canonicalize_dynamic_symtab), \ -CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \ -CONCAT2 (NAME,_canonicalize_dynamic_reloc) + NAME##_get_dynamic_symtab_upper_bound, \ + NAME##_canonicalize_dynamic_symtab, \ + NAME##_get_dynamic_reloc_upper_bound, \ + NAME##_canonicalize_dynamic_reloc + /* Get the amount of memory required to hold the dynamic symbols. */ - long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); + long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - PARAMS ((bfd *, struct symbol_cache_entry **)); + long (*_bfd_canonicalize_dynamic_symtab) + (bfd *, struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ - long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); + long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); + long (*_bfd_canonicalize_dynamic_reloc) + (bfd *, arelent **, struct bfd_symbol **); /* 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. */ - PTR backend_data; + const void *backend_data; } bfd_target; -boolean -bfd_set_default_target PARAMS ((const char *name)); +bfd_boolean bfd_set_default_target (const char *name); -const bfd_target * -bfd_find_target PARAMS ((const char *target_name, bfd *abfd)); +const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); -const char ** -bfd_target_list PARAMS ((void)); +const char ** bfd_target_list (void); -const bfd_target * -bfd_search_for_target PARAMS ((int (* search_func) (const bfd_target *, void *), void *)); +const bfd_target *bfd_search_for_target + (int (*search_func) (const bfd_target *, void *), + void *); /* Extracted from format.c. */ -boolean -bfd_check_format PARAMS ((bfd *abfd, bfd_format format)); +bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); + +bfd_boolean bfd_check_format_matches + (bfd *abfd, bfd_format format, char ***matching); + +bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); + +const char *bfd_format_string (bfd_format format); -boolean -bfd_check_format_matches PARAMS ((bfd *abfd, bfd_format format, char ***matching)); +/* Extracted from linker.c. */ +bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); -boolean -bfd_set_format PARAMS ((bfd *abfd, bfd_format format)); +#define bfd_link_split_section(abfd, sec) \ + BFD_SEND (abfd, _bfd_link_split_section, (abfd, sec)) -const char * -bfd_format_string PARAMS ((bfd_format format)); +/* Extracted from simple.c. */ +bfd_byte *bfd_simple_get_relocated_section_contents + (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); #ifdef __cplusplus } diff --git a/contrib/binutils/bfd/bfd.c b/contrib/binutils/bfd/bfd.c index 8037b12..59e22aa 100644 --- a/contrib/binutils/bfd/bfd.c +++ b/contrib/binutils/bfd/bfd.c @@ -1,24 +1,24 @@ /* Generic BFD library interface and support routines. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. -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. */ /* SECTION @@ -34,8 +34,11 @@ SECTION CODE_FRAGMENT . -.struct _bfd +.struct bfd .{ +. {* A unique identifier of the BFD *} +. unsigned int id; +. . {* The filename the application opened the BFD with. *} . const char *filename; . @@ -49,33 +52,33 @@ CODE_FRAGMENT . is the result of an fopen on the filename. However, if the . BFD_IN_MEMORY flag is set, then iostream is actually a pointer . to a bfd_in_memory struct. *} -. PTR iostream; +. void *iostream; . . {* Is the file descriptor being cached? That is, can it be closed as . needed, and re-opened when accessed later? *} -. boolean cacheable; +. bfd_boolean cacheable; . . {* Marks whether there was a default target specified when the . BFD was opened. This is used to select which matching algorithm . to use to choose the back end. *} -. boolean target_defaulted; +. bfd_boolean target_defaulted; . . {* The caching routines use these to maintain a . least-recently-used list of BFDs. *} -. struct _bfd *lru_prev, *lru_next; +. struct bfd *lru_prev, *lru_next; . . {* When a file is closed by the caching routines, BFD retains . state information on the file here... *} . ufile_ptr where; . . {* ... and here: (``once'' means at least once). *} -. boolean opened_once; +. bfd_boolean opened_once; . . {* Set if we have a locally maintained mtime value, rather than . getting it from the file each time. *} -. boolean mtime_set; +. bfd_boolean mtime_set; . -. {* File modified time, if mtime_set is true. *} +. {* File modified time, if mtime_set is TRUE. *} . long mtime; . . {* Reserved for an unimplemented file locking extension. *} @@ -104,16 +107,16 @@ CODE_FRAGMENT . . {* Remember when output has begun, to stop strange things . from happening. *} -. boolean output_has_begun; +. bfd_boolean output_has_begun; . . {* A hash table for section names. *} . struct bfd_hash_table section_htab; . . {* Pointer to linked list of sections. *} -. struct sec *sections; +. struct bfd_section *sections; . . {* The place where we add to the section list. *} -. struct sec **section_tail; +. struct bfd_section **section_tail; . . {* The number of sections. *} . unsigned int section_count; @@ -126,7 +129,7 @@ CODE_FRAGMENT . unsigned int symcount; . . {* Symbol table for output BFD (with symcount entries). *} -. struct symbol_cache_entry **outsymbols; +. struct bfd_symbol **outsymbols; . . {* Used for slurped dynamic symbol tables. *} . unsigned int dynsymcount; @@ -135,14 +138,14 @@ CODE_FRAGMENT . const struct bfd_arch_info *arch_info; . . {* Stuff only useful for archives. *} -. PTR arelt_data; -. struct _bfd *my_archive; {* The containing archive BFD. *} -. struct _bfd *next; {* The next BFD in the archive. *} -. struct _bfd *archive_head; {* The first BFD in the archive. *} -. boolean has_armap; +. void *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. *} +. bfd_boolean has_armap; . . {* A chain of BFD structures involved in a link. *} -. struct _bfd *link_next; +. struct bfd *link_next; . . {* A field used by _bfd_generic_link_add_archive_symbols. This will . be used only for archive elements. *} @@ -180,30 +183,30 @@ CODE_FRAGMENT . struct cisco_core_struct *cisco_core_data; . struct versados_data_struct *versados_data; . struct netbsd_core_struct *netbsd_core_data; -. PTR any; +. struct mach_o_data_struct *mach_o_data; +. struct mach_o_fat_data_struct *mach_o_fat_data; +. struct bfd_pef_data_struct *pef_data; +. struct bfd_pef_xlib_data_struct *pef_xlib_data; +. struct bfd_sym_data_struct *sym_data; +. void *any; . } . tdata; . . {* Used by the application to hold private data. *} -. PTR usrdata; +. void *usrdata; . . {* Where all the allocated stuff under this BFD goes. This is a -. struct objalloc *, but we use PTR to avoid requiring the inclusion of -. objalloc.h. *} -. PTR memory; +. struct objalloc *, but we use void * to avoid requiring the inclusion +. of objalloc.h. *} +. void *memory; .}; . */ #include "bfd.h" +#include "bfdver.h" #include "sysdep.h" - -#ifdef ANSI_PROTOTYPES #include -#else -#include -#endif - #include "libiberty.h" #include "safe-ctype.h" #include "bfdlink.h" @@ -308,7 +311,7 @@ DESCRIPTION */ bfd_error_type -bfd_get_error () +bfd_get_error (void) { return bfd_error; } @@ -325,8 +328,7 @@ DESCRIPTION */ void -bfd_set_error (error_tag) - bfd_error_type error_tag; +bfd_set_error (bfd_error_type error_tag) { bfd_error = error_tag; } @@ -344,8 +346,7 @@ DESCRIPTION */ const char * -bfd_errmsg (error_tag) - bfd_error_type error_tag; +bfd_errmsg (bfd_error_type error_tag) { #ifndef errno extern int errno; @@ -353,11 +354,10 @@ bfd_errmsg (error_tag) if (error_tag == bfd_error_system_call) return xstrerror (errno); - if ((((int) error_tag < (int) bfd_error_no_error) || - ((int) error_tag > (int) bfd_error_invalid_error_code))) - error_tag = bfd_error_invalid_error_code;/* sanity check */ + if (error_tag > bfd_error_invalid_error_code) + error_tag = bfd_error_invalid_error_code; /* sanity check */ - return _(bfd_errmsgs [(int)error_tag]); + return _(bfd_errmsgs [error_tag]); } /* @@ -376,12 +376,11 @@ DESCRIPTION */ void -bfd_perror (message) - const char *message; +bfd_perror (const char *message) { if (bfd_get_error () == bfd_error_system_call) /* Must be a system error then. */ - perror ((char *)message); + perror ((char *) message); else { if (message == NULL || *message == '\0') @@ -397,13 +396,13 @@ SUBSECTION Some BFD functions want to print messages describing the problem. They call a BFD error handler function. This - function may be overriden by the program. + function may be overridden by the program. The BFD error handler acts like printf. CODE_FRAGMENT . -.typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...)); +.typedef void (*bfd_error_handler_type) (const char *, ...); . */ @@ -413,20 +412,19 @@ static const char *_bfd_error_program_name; /* This is the default routine to handle BFD error messages. */ -static void _bfd_default_error_handler PARAMS ((const char *s, ...)); - static void -_bfd_default_error_handler VPARAMS ((const char *s, ...)) +_bfd_default_error_handler (const char *s, ...) { + va_list p; + if (_bfd_error_program_name != NULL) fprintf (stderr, "%s: ", _bfd_error_program_name); else fprintf (stderr, "BFD: "); - VA_OPEN (p, s); - VA_FIXEDARG (p, const char *, s); + va_start (p, s); vfprintf (stderr, s, p); - VA_CLOSE (p); + va_end (p); fprintf (stderr, "\n"); } @@ -452,8 +450,7 @@ DESCRIPTION */ bfd_error_handler_type -bfd_set_error_handler (pnew) - bfd_error_handler_type pnew; +bfd_set_error_handler (bfd_error_handler_type pnew) { bfd_error_handler_type pold; @@ -477,8 +474,7 @@ DESCRIPTION */ void -bfd_set_error_program_name (name) - const char *name; +bfd_set_error_program_name (const char *name) { _bfd_error_program_name = name; } @@ -495,7 +491,7 @@ DESCRIPTION */ bfd_error_handler_type -bfd_get_error_handler () +bfd_get_error_handler (void) { return _bfd_error_handler; } @@ -514,9 +510,11 @@ DESCRIPTION */ const char * -bfd_archive_filename (abfd) - bfd *abfd; +bfd_archive_filename (bfd *abfd) { + if (abfd == NULL) + return _(""); + if (abfd->my_archive) { static size_t curr = 0; @@ -530,7 +528,7 @@ bfd_archive_filename (abfd) if (curr) free (buf); curr = needed + (needed >> 1); - buf = bfd_malloc ((bfd_size_type) curr); + buf = bfd_malloc (curr); /* If we can't malloc, fail safe by returning just the file name. This function is only used when building error messages. */ @@ -558,7 +556,7 @@ FUNCTION bfd_get_reloc_upper_bound SYNOPSIS - long bfd_get_reloc_upper_bound(bfd *abfd, asection *sect); + long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); DESCRIPTION Return the number of bytes required to store the @@ -568,9 +566,7 @@ DESCRIPTION */ long -bfd_get_reloc_upper_bound (abfd, asect) - bfd *abfd; - sec_ptr asect; +bfd_get_reloc_upper_bound (bfd *abfd, sec_ptr asect) { if (abfd->format != bfd_object) { @@ -587,10 +583,7 @@ FUNCTION SYNOPSIS long bfd_canonicalize_reloc - (bfd *abfd, - asection *sec, - arelent **loc, - asymbol **syms); + (bfd *abfd, asection *sec, arelent **loc, asymbol **syms); DESCRIPTION Call the back end associated with the open BFD @@ -606,11 +599,10 @@ DESCRIPTION */ long -bfd_canonicalize_reloc (abfd, asect, location, symbols) - bfd *abfd; - sec_ptr asect; - arelent **location; - asymbol **symbols; +bfd_canonicalize_reloc (bfd *abfd, + sec_ptr asect, + arelent **location, + asymbol **symbols) { if (abfd->format != bfd_object) { @@ -638,11 +630,10 @@ DESCRIPTION */ void -bfd_set_reloc (ignore_abfd, asect, location, count) - bfd *ignore_abfd ATTRIBUTE_UNUSED; - sec_ptr asect; - arelent **location; - unsigned int count; +bfd_set_reloc (bfd *ignore_abfd ATTRIBUTE_UNUSED, + sec_ptr asect, + arelent **location, + unsigned int count) { asect->orelocation = location; asect->reloc_count = count; @@ -653,7 +644,7 @@ FUNCTION bfd_set_file_flags SYNOPSIS - boolean bfd_set_file_flags(bfd *abfd, flagword flags); + bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); DESCRIPTION Set the flag word in the BFD @var{abfd} to the value @var{flags}. @@ -668,37 +659,33 @@ DESCRIPTION */ -boolean -bfd_set_file_flags (abfd, flags) - bfd *abfd; - flagword flags; +bfd_boolean +bfd_set_file_flags (bfd *abfd, flagword flags) { if (abfd->format != bfd_object) { bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; } if (bfd_read_p (abfd)) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } bfd_get_file_flags (abfd) = flags; if ((flags & bfd_applicable_file_flags (abfd)) != flags) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } - return true; + return TRUE; } void -bfd_assert (file, line) - const char *file; - int line; +bfd_assert (const char *file, int line) { (*_bfd_error_handler) (_("BFD %s assertion fail %s:%d"), BFD_VERSION_STRING, file, line); @@ -712,10 +699,7 @@ bfd_assert (file, line) #endif void -_bfd_abort (file, line, fn) - const char *file; - int line; - const char *fn; +_bfd_abort (const char *file, int line, const char *fn) { if (fn != NULL) (*_bfd_error_handler) @@ -746,11 +730,10 @@ RETURNS */ int -bfd_get_arch_size (abfd) - bfd *abfd; +bfd_get_arch_size (bfd *abfd) { if (abfd->xvec->flavour == bfd_target_elf_flavour) - return (get_elf_backend_data (abfd))->s->arch_size; + return get_elf_backend_data (abfd)->s->arch_size; return -1; } @@ -777,13 +760,12 @@ RETURNS */ int -bfd_get_sign_extend_vma (abfd) - bfd *abfd; +bfd_get_sign_extend_vma (bfd *abfd) { char *name; if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) - return (get_elf_backend_data (abfd)->sign_extend_vma); + return get_elf_backend_data (abfd)->sign_extend_vma; name = bfd_get_target (abfd); @@ -804,103 +786,20 @@ FUNCTION bfd_set_start_address SYNOPSIS - boolean bfd_set_start_address(bfd *abfd, bfd_vma vma); + bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma); DESCRIPTION Make @var{vma} the entry point of output BFD @var{abfd}. RETURNS - Returns <> on success, <> otherwise. + Returns <> on success, <> otherwise. */ -boolean -bfd_set_start_address (abfd, vma) - bfd *abfd; - bfd_vma vma; +bfd_boolean +bfd_set_start_address (bfd *abfd, bfd_vma vma) { abfd->start_address = vma; - return true; -} - -/* -FUNCTION - bfd_get_mtime - -SYNOPSIS - long bfd_get_mtime(bfd *abfd); - -DESCRIPTION - Return the file modification time (as read from the file system, or - from the archive header for archive members). - -*/ - -long -bfd_get_mtime (abfd) - bfd *abfd; -{ - FILE *fp; - struct stat buf; - - if (abfd->mtime_set) - return abfd->mtime; - - fp = bfd_cache_lookup (abfd); - if (0 != fstat (fileno (fp), &buf)) - return 0; - - abfd->mtime = buf.st_mtime; /* Save value in case anyone wants it */ - return buf.st_mtime; -} - -/* -FUNCTION - bfd_get_size - -SYNOPSIS - long bfd_get_size(bfd *abfd); - -DESCRIPTION - Return the file size (as read from file system) for the file - associated with BFD @var{abfd}. - - The initial motivation for, and use of, this routine is not - so we can get the exact size of the object the BFD applies to, since - that might not be generally possible (archive members for example). - It would be ideal if someone could eventually modify - it so that such results were guaranteed. - - Instead, we want to ask questions like "is this NNN byte sized - object I'm about to try read from file offset YYY reasonable?" - As as example of where we might do this, some object formats - use string tables for which the first <> bytes of the - table contain the size of the table itself, including the size bytes. - If an application tries to read what it thinks is one of these - string tables, without some way to validate the size, and for - some reason the size is wrong (byte swapping error, wrong location - for the string table, etc.), the only clue is likely to be a read - error when it tries to read the table, or a "virtual memory - exhausted" error when it tries to allocate 15 bazillon bytes - of space for the 15 bazillon byte table it is about to read. - This function at least allows us to answer the quesion, "is the - size reasonable?". -*/ - -long -bfd_get_size (abfd) - bfd *abfd; -{ - FILE *fp; - struct stat buf; - - if ((abfd->flags & BFD_IN_MEMORY) != 0) - return ((struct bfd_in_memory *) abfd->iostream)->size; - - fp = bfd_cache_lookup (abfd); - if (0 != fstat (fileno (fp), & buf)) - return 0; - - return buf.st_size; + return TRUE; } /* @@ -908,7 +807,7 @@ FUNCTION bfd_get_gp_size SYNOPSIS - unsigned int bfd_get_gp_size(bfd *abfd); + unsigned int bfd_get_gp_size (bfd *abfd); DESCRIPTION Return the maximum size of objects to be optimized using the GP @@ -917,8 +816,7 @@ DESCRIPTION */ unsigned int -bfd_get_gp_size (abfd) - bfd *abfd; +bfd_get_gp_size (bfd *abfd) { if (abfd->format == bfd_object) { @@ -935,7 +833,7 @@ FUNCTION bfd_set_gp_size SYNOPSIS - void bfd_set_gp_size(bfd *abfd, unsigned int i); + void bfd_set_gp_size (bfd *abfd, unsigned int i); DESCRIPTION Set the maximum size of objects to be optimized using the GP @@ -944,9 +842,7 @@ DESCRIPTION */ void -bfd_set_gp_size (abfd, i) - bfd *abfd; - unsigned int i; +bfd_set_gp_size (bfd *abfd, unsigned int i) { /* Don't try to set GP size on an archive or core file! */ if (abfd->format != bfd_object) @@ -963,9 +859,10 @@ bfd_set_gp_size (abfd, i) register. */ bfd_vma -_bfd_get_gp_value (abfd) - bfd *abfd; +_bfd_get_gp_value (bfd *abfd) { + if (! abfd) + return 0; if (abfd->format != bfd_object) return 0; @@ -980,10 +877,10 @@ _bfd_get_gp_value (abfd) /* Set the GP value. */ void -_bfd_set_gp_value (abfd, v) - bfd *abfd; - bfd_vma v; +_bfd_set_gp_value (bfd *abfd, bfd_vma v) { + if (! abfd) + BFD_FAIL (); if (abfd->format != bfd_object) return; @@ -998,7 +895,7 @@ FUNCTION bfd_scan_vma SYNOPSIS - bfd_vma bfd_scan_vma(const char *string, const char **end, int base); + bfd_vma bfd_scan_vma (const char *string, const char **end, int base); DESCRIPTION Convert, like <>, a numerical expression @@ -1015,10 +912,7 @@ DESCRIPTION */ bfd_vma -bfd_scan_vma (string, end, base) - const char *string; - const char **end; - int base; +bfd_scan_vma (const char *string, const char **end, int base) { bfd_vma value; bfd_vma cutoff; @@ -1027,7 +921,12 @@ bfd_scan_vma (string, end, base) /* Let the host do it if possible. */ if (sizeof (bfd_vma) <= sizeof (unsigned long)) - return (bfd_vma) strtoul (string, (char **) end, base); + return strtoul (string, (char **) end, base); + +#ifdef HAVE_STRTOULL + if (sizeof (bfd_vma) <= sizeof (unsigned long long)) + return strtoull (string, (char **) end, base); +#endif if (base == 0) { @@ -1088,11 +987,11 @@ FUNCTION bfd_copy_private_bfd_data SYNOPSIS - boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd); + bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); DESCRIPTION Copy private BFD information from the BFD @var{ibfd} to the - the BFD @var{obfd}. Return <> on success, <> on error. + the BFD @var{obfd}. Return <> on success, <> on error. Possible error returns are: o <> - @@ -1109,12 +1008,12 @@ FUNCTION bfd_merge_private_bfd_data SYNOPSIS - boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd); + bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); DESCRIPTION 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: + the output file BFD @var{obfd} when linking. Return <> + on success, <> on error. Possible error returns are: o <> - Not enough memory exists to create private data for @var{obfd}. @@ -1130,54 +1029,52 @@ FUNCTION bfd_set_private_flags SYNOPSIS - boolean bfd_set_private_flags(bfd *abfd, flagword flags); + bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); DESCRIPTION Set private BFD flag information in the BFD @var{abfd}. - Return <> on success, <> on error. Possible error + Return <> on success, <> on error. Possible error returns are: o <> - Not enough memory exists to create private data for @var{obfd}. .#define bfd_set_private_flags(abfd, flags) \ -. BFD_SEND (abfd, _bfd_set_private_flags, \ -. (abfd, flags)) +. BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) */ /* FUNCTION - stuff + Other functions DESCRIPTION - Stuff which should be documented: + The following functions exist but have not yet been documented. .#define bfd_sizeof_headers(abfd, reloc) \ -. BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) +. BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) . .#define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ -. BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line)) +. BFD_SEND (abfd, _bfd_find_nearest_line, \ +. (abfd, sec, syms, off, file, func, line)) . -. {* Do these three do anything useful at all, for any back end? *} .#define bfd_debug_info_start(abfd) \ -. BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) +. BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) . .#define bfd_debug_info_end(abfd) \ -. BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) +. BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) . .#define bfd_debug_info_accumulate(abfd, section) \ -. BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) -. +. BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) . .#define bfd_stat_arch_elt(abfd, stat) \ -. BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) +. BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) . .#define bfd_update_armap_timestamp(abfd) \ -. BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) +. BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) . .#define bfd_set_arch_mach(abfd, arch, mach)\ -. BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) +. BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) . .#define bfd_relax_section(abfd, section, link_info, again) \ . BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again)) @@ -1225,27 +1122,23 @@ DESCRIPTION . BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms)) . .extern bfd_byte *bfd_get_relocated_section_contents -. PARAMS ((bfd *, struct bfd_link_info *, -. struct bfd_link_order *, bfd_byte *, -. boolean, asymbol **)); +. (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, +. bfd_boolean, asymbol **); . */ bfd_byte * -bfd_get_relocated_section_contents (abfd, link_info, link_order, data, - relocateable, symbols) - bfd *abfd; - struct bfd_link_info *link_info; - struct bfd_link_order *link_order; - bfd_byte *data; - boolean relocateable; - asymbol **symbols; +bfd_get_relocated_section_contents (bfd *abfd, + struct bfd_link_info *link_info, + struct bfd_link_order *link_order, + bfd_byte *data, + bfd_boolean relocatable, + asymbol **symbols) { bfd *abfd2; - bfd_byte *(*fn) PARAMS ((bfd *, struct bfd_link_info *, - struct bfd_link_order *, bfd_byte *, boolean, - asymbol **)); + bfd_byte *(*fn) (bfd *, struct bfd_link_info *, struct bfd_link_order *, + bfd_byte *, bfd_boolean, asymbol **); if (link_order->type == bfd_indirect_link_order) { @@ -1258,45 +1151,43 @@ bfd_get_relocated_section_contents (abfd, link_info, link_order, data, fn = abfd2->xvec->_bfd_get_relocated_section_contents; - return (*fn) (abfd, link_info, link_order, data, relocateable, symbols); + return (*fn) (abfd, link_info, link_order, data, relocatable, symbols); } /* Record information about an ELF program header. */ -boolean -bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at, - includes_filehdr, includes_phdrs, count, secs) - bfd *abfd; - unsigned long type; - boolean flags_valid; - flagword flags; - boolean at_valid; - bfd_vma at; - boolean includes_filehdr; - boolean includes_phdrs; - unsigned int count; - asection **secs; +bfd_boolean +bfd_record_phdr (bfd *abfd, + unsigned long type, + bfd_boolean flags_valid, + flagword flags, + bfd_boolean at_valid, + bfd_vma at, + bfd_boolean includes_filehdr, + bfd_boolean includes_phdrs, + unsigned int count, + asection **secs) { struct elf_segment_map *m, **pm; bfd_size_type amt; if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) - return true; + return TRUE; amt = sizeof (struct elf_segment_map); amt += ((bfd_size_type) count - 1) * sizeof (asection *); - m = (struct elf_segment_map *) bfd_alloc (abfd, amt); + m = bfd_alloc (abfd, amt); if (m == NULL) - return false; + return FALSE; m->next = NULL; m->p_type = type; m->p_flags = flags; m->p_paddr = at; - m->p_flags_valid = (unsigned int) flags_valid; - m->p_paddr_valid = (unsigned int) at_valid; - m->includes_filehdr = (unsigned int) includes_filehdr; - m->includes_phdrs = (unsigned int) includes_phdrs; + m->p_flags_valid = flags_valid; + m->p_paddr_valid = at_valid; + m->includes_filehdr = includes_filehdr; + m->includes_phdrs = includes_phdrs; m->count = count; if (count > 0) memcpy (m->sections, secs, count * sizeof (asection *)); @@ -1305,14 +1196,11 @@ bfd_record_phdr (abfd, type, flags_valid, flags, at_valid, at, ; *pm = m; - return true; + return TRUE; } void -bfd_sprintf_vma (abfd, buf, value) - bfd *abfd; - char *buf; - bfd_vma value; +bfd_sprintf_vma (bfd *abfd, char *buf, bfd_vma value) { if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) get_elf_backend_data (abfd)->elf_backend_sprintf_vma (abfd, buf, value); @@ -1321,10 +1209,7 @@ bfd_sprintf_vma (abfd, buf, value) } void -bfd_fprintf_vma (abfd, stream, value) - bfd *abfd; - PTR stream; - bfd_vma value; +bfd_fprintf_vma (bfd *abfd, void *stream, bfd_vma value) { if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) get_elf_backend_data (abfd)->elf_backend_fprintf_vma (abfd, stream, value); @@ -1337,7 +1222,7 @@ FUNCTION bfd_alt_mach_code SYNOPSIS - boolean bfd_alt_mach_code(bfd *abfd, int alternative); + bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); DESCRIPTION @@ -1348,10 +1233,8 @@ DESCRIPTION machine codes. */ -boolean -bfd_alt_mach_code (abfd, alternative) - bfd *abfd; - int alternative; +bfd_boolean +bfd_alt_mach_code (bfd *abfd, int alternative) { if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) { @@ -1366,23 +1249,144 @@ bfd_alt_mach_code (abfd, alternative) case 1: code = get_elf_backend_data (abfd)->elf_machine_alt1; if (code == 0) - return false; + return FALSE; break; case 2: code = get_elf_backend_data (abfd)->elf_machine_alt2; if (code == 0) - return false; + return FALSE; break; default: - return false; + return FALSE; } elf_elfheader (abfd)->e_machine = code; - return true; + return TRUE; } - return false; + return FALSE; +} + +/* +CODE_FRAGMENT + +.struct bfd_preserve +.{ +. void *marker; +. void *tdata; +. flagword flags; +. const struct bfd_arch_info *arch_info; +. struct bfd_section *sections; +. struct bfd_section **section_tail; +. unsigned int section_count; +. struct bfd_hash_table section_htab; +.}; +. +*/ + +/* +FUNCTION + bfd_preserve_save + +SYNOPSIS + bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); + +DESCRIPTION + When testing an object for compatibility with a particular + target back-end, the back-end object_p function needs to set + up certain fields in the bfd on successfully recognizing the + object. This typically happens in a piecemeal fashion, with + failures possible at many points. On failure, the bfd is + supposed to be restored to its initial state, which is + virtually impossible. However, restoring a subset of the bfd + state works in practice. This function stores the subset and + reinitializes the bfd. + +*/ + +bfd_boolean +bfd_preserve_save (bfd *abfd, struct bfd_preserve *preserve) +{ + preserve->tdata = abfd->tdata.any; + preserve->arch_info = abfd->arch_info; + preserve->flags = abfd->flags; + preserve->sections = abfd->sections; + preserve->section_tail = abfd->section_tail; + preserve->section_count = abfd->section_count; + preserve->section_htab = abfd->section_htab; + + if (! bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc)) + return FALSE; + + abfd->tdata.any = NULL; + abfd->arch_info = &bfd_default_arch_struct; + abfd->flags &= BFD_IN_MEMORY; + abfd->sections = NULL; + abfd->section_tail = &abfd->sections; + abfd->section_count = 0; + + return TRUE; +} + +/* +FUNCTION + bfd_preserve_restore + +SYNOPSIS + void bfd_preserve_restore (bfd *, struct bfd_preserve *); + +DESCRIPTION + This function restores bfd state saved by bfd_preserve_save. + If MARKER is non-NULL in struct bfd_preserve then that block + and all subsequently bfd_alloc'd memory is freed. + +*/ + +void +bfd_preserve_restore (bfd *abfd, struct bfd_preserve *preserve) +{ + bfd_hash_table_free (&abfd->section_htab); + + abfd->tdata.any = preserve->tdata; + abfd->arch_info = preserve->arch_info; + abfd->flags = preserve->flags; + abfd->section_htab = preserve->section_htab; + abfd->sections = preserve->sections; + abfd->section_tail = preserve->section_tail; + abfd->section_count = preserve->section_count; + + /* bfd_release frees all memory more recently bfd_alloc'd than + its arg, as well as its arg. */ + if (preserve->marker != NULL) + { + bfd_release (abfd, preserve->marker); + preserve->marker = NULL; + } +} + +/* +FUNCTION + bfd_preserve_finish + +SYNOPSIS + void bfd_preserve_finish (bfd *, struct bfd_preserve *); + +DESCRIPTION + This function should be called when the bfd state saved by + bfd_preserve_save is no longer needed. ie. when the back-end + object_p function returns with success. + +*/ + +void +bfd_preserve_finish (bfd *abfd ATTRIBUTE_UNUSED, struct bfd_preserve *preserve) +{ + /* It would be nice to be able to free more memory here, eg. old + tdata, but that's not possible since these blocks are sitting + inside bfd_alloc'd memory. The section hash is on a separate + objalloc. */ + bfd_hash_table_free (&preserve->section_htab); } diff --git a/contrib/binutils/bfd/bfdio.c b/contrib/binutils/bfd/bfdio.c new file mode 100644 index 0000000..a90cb33 --- /dev/null +++ b/contrib/binutils/bfd/bfdio.c @@ -0,0 +1,442 @@ +/* Low-level I/O routines for BFDs. + + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + + Written by Cygnus Support. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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 "sysdep.h" + +#include "bfd.h" +#include "libbfd.h" + +#include + +#ifndef S_IXUSR +#define S_IXUSR 0100 /* Execute by owner. */ +#endif +#ifndef S_IXGRP +#define S_IXGRP 0010 /* Execute by group. */ +#endif +#ifndef S_IXOTH +#define S_IXOTH 0001 /* Execute by others. */ +#endif + +file_ptr +real_ftell (FILE *file) +{ +#if defined (HAVE_FTELLO64) + return ftello64 (file); +#elif defined (HAVE_FTELLO) + return ftello (file); +#else + return ftell (file); +#endif +} + +int +real_fseek (FILE *file, file_ptr offset, int whence) +{ +#if defined (HAVE_FSEEKO64) + return fseeko64 (file, offset, whence); +#elif defined (HAVE_FSEEKO) + return fseeko (file, offset, whence); +#else + return fseek (file, offset, whence); +#endif +} + +/* Note that archive entries don't have streams; they share their parent's. + This allows someone to play with the iostream behind BFD's back. + + Also, note that the origin pointer points to the beginning of a file's + contents (0 for non-archive elements). For archive entries this is the + first octet in the file, NOT the beginning of the archive header. */ + +static size_t +real_read (void *where, size_t a, size_t b, FILE *file) +{ + /* FIXME - this looks like an optimization, but it's really to cover + up for a feature of some OSs (not solaris - sigh) that + ld/pe-dll.c takes advantage of (apparently) when it creates BFDs + internally and tries to link against them. BFD seems to be smart + enough to realize there are no symbol records in the "file" that + doesn't exist but attempts to read them anyway. On Solaris, + attempting to read zero bytes from a NULL file results in a core + dump, but on other platforms it just returns zero bytes read. + This makes it to something reasonable. - DJ */ + if (a == 0 || b == 0) + return 0; + + +#if defined (__VAX) && defined (VMS) + /* Apparently fread on Vax VMS does not keep the record length + information. */ + return read (fileno (file), where, a * b); +#else + return fread (where, a, b, file); +#endif +} + +/* Return value is amount read. */ + +bfd_size_type +bfd_bread (void *ptr, bfd_size_type size, bfd *abfd) +{ + size_t nread; + + if ((abfd->flags & BFD_IN_MEMORY) != 0) + { + struct bfd_in_memory *bim; + bfd_size_type get; + + bim = abfd->iostream; + get = size; + if (abfd->where + get > bim->size) + { + if (bim->size < (bfd_size_type) abfd->where) + get = 0; + else + get = bim->size - abfd->where; + bfd_set_error (bfd_error_file_truncated); + } + memcpy (ptr, bim->buffer + abfd->where, (size_t) get); + abfd->where += get; + return get; + } + + nread = real_read (ptr, 1, (size_t) size, bfd_cache_lookup (abfd)); + if (nread != (size_t) -1) + abfd->where += nread; + + /* Set bfd_error if we did not read as much data as we expected. + + If the read failed due to an error set the bfd_error_system_call, + else set bfd_error_file_truncated. + + A BFD backend may wish to override bfd_error_file_truncated to + provide something more useful (eg. no_symbols or wrong_format). */ + if (nread != size) + { + if (ferror (bfd_cache_lookup (abfd))) + bfd_set_error (bfd_error_system_call); + else + bfd_set_error (bfd_error_file_truncated); + } + + return nread; +} + +bfd_size_type +bfd_bwrite (const void *ptr, bfd_size_type size, bfd *abfd) +{ + size_t nwrote; + + if ((abfd->flags & BFD_IN_MEMORY) != 0) + { + struct bfd_in_memory *bim = abfd->iostream; + size = (size_t) size; + if (abfd->where + size > bim->size) + { + bfd_size_type newsize, oldsize; + + oldsize = (bim->size + 127) & ~(bfd_size_type) 127; + bim->size = abfd->where + size; + /* Round up to cut down on memory fragmentation */ + newsize = (bim->size + 127) & ~(bfd_size_type) 127; + if (newsize > oldsize) + { + bim->buffer = bfd_realloc (bim->buffer, newsize); + if (bim->buffer == 0) + { + bim->size = 0; + return 0; + } + } + } + memcpy (bim->buffer + abfd->where, ptr, (size_t) size); + abfd->where += size; + return size; + } + + nwrote = fwrite (ptr, 1, (size_t) size, bfd_cache_lookup (abfd)); + if (nwrote != (size_t) -1) + abfd->where += nwrote; + if (nwrote != size) + { +#ifdef ENOSPC + errno = ENOSPC; +#endif + bfd_set_error (bfd_error_system_call); + } + return nwrote; +} + +file_ptr +bfd_tell (bfd *abfd) +{ + file_ptr ptr; + + if ((abfd->flags & BFD_IN_MEMORY) != 0) + return abfd->where; + + ptr = real_ftell (bfd_cache_lookup (abfd)); + + if (abfd->my_archive) + ptr -= abfd->origin; + abfd->where = ptr; + return ptr; +} + +int +bfd_flush (bfd *abfd) +{ + if ((abfd->flags & BFD_IN_MEMORY) != 0) + return 0; + return fflush (bfd_cache_lookup(abfd)); +} + +/* Returns 0 for success, negative value for failure (in which case + bfd_get_error can retrieve the error code). */ +int +bfd_stat (bfd *abfd, struct stat *statbuf) +{ + FILE *f; + int result; + + if ((abfd->flags & BFD_IN_MEMORY) != 0) + abort (); + + f = bfd_cache_lookup (abfd); + if (f == NULL) + { + bfd_set_error (bfd_error_system_call); + return -1; + } + result = fstat (fileno (f), statbuf); + if (result < 0) + bfd_set_error (bfd_error_system_call); + return result; +} + +/* Returns 0 for success, nonzero for failure (in which case bfd_get_error + can retrieve the error code). */ + +int +bfd_seek (bfd *abfd, file_ptr position, int direction) +{ + int result; + FILE *f; + file_ptr file_position; + /* For the time being, a BFD may not seek to it's end. The problem + is that we don't easily have a way to recognize the end of an + element in an archive. */ + + BFD_ASSERT (direction == SEEK_SET || direction == SEEK_CUR); + + if (direction == SEEK_CUR && position == 0) + return 0; + + if ((abfd->flags & BFD_IN_MEMORY) != 0) + { + struct bfd_in_memory *bim; + + bim = abfd->iostream; + + if (direction == SEEK_SET) + abfd->where = position; + else + abfd->where += position; + + if (abfd->where > bim->size) + { + if ((abfd->direction == write_direction) || + (abfd->direction == both_direction)) + { + bfd_size_type newsize, oldsize; + oldsize = (bim->size + 127) & ~(bfd_size_type) 127; + bim->size = abfd->where; + /* Round up to cut down on memory fragmentation */ + newsize = (bim->size + 127) & ~(bfd_size_type) 127; + if (newsize > oldsize) + { + bim->buffer = bfd_realloc (bim->buffer, newsize); + if (bim->buffer == 0) + { + bim->size = 0; + return -1; + } + } + } + else + { + abfd->where = bim->size; + bfd_set_error (bfd_error_file_truncated); + return -1; + } + } + return 0; + } + + if (abfd->format != bfd_archive && abfd->my_archive == 0) + { +#if 0 + /* Explanation for this code: I'm only about 95+% sure that the above + conditions are sufficient and that all i/o calls are properly + adjusting the `where' field. So this is sort of an `assert' + that the `where' field is correct. If we can go a while without + tripping the abort, we can probably safely disable this code, + so that the real optimizations happen. */ + file_ptr where_am_i_now; + where_am_i_now = real_ftell (bfd_cache_lookup (abfd)); + if (abfd->my_archive) + where_am_i_now -= abfd->origin; + if (where_am_i_now != abfd->where) + abort (); +#endif + if (direction == SEEK_SET && (bfd_vma) position == abfd->where) + return 0; + } + else + { + /* We need something smarter to optimize access to archives. + Currently, anything inside an archive is read via the file + handle for the archive. Which means that a bfd_seek on one + component affects the `current position' in the archive, as + well as in any other component. + + It might be sufficient to put a spike through the cache + abstraction, and look to the archive for the file position, + but I think we should try for something cleaner. + + In the meantime, no optimization for archives. */ + } + + f = bfd_cache_lookup (abfd); + file_position = position; + if (direction == SEEK_SET && abfd->my_archive != NULL) + file_position += abfd->origin; + + result = real_fseek (f, file_position, direction); + if (result != 0) + { + int hold_errno = errno; + + /* Force redetermination of `where' field. */ + bfd_tell (abfd); + + /* An EINVAL error probably means that the file offset was + absurd. */ + if (hold_errno == EINVAL) + bfd_set_error (bfd_error_file_truncated); + else + { + bfd_set_error (bfd_error_system_call); + errno = hold_errno; + } + } + else + { + /* Adjust `where' field. */ + if (direction == SEEK_SET) + abfd->where = position; + else + abfd->where += position; + } + return result; +} + +/* +FUNCTION + bfd_get_mtime + +SYNOPSIS + long bfd_get_mtime (bfd *abfd); + +DESCRIPTION + Return the file modification time (as read from the file system, or + from the archive header for archive members). + +*/ + +long +bfd_get_mtime (bfd *abfd) +{ + FILE *fp; + struct stat buf; + + if (abfd->mtime_set) + return abfd->mtime; + + fp = bfd_cache_lookup (abfd); + if (0 != fstat (fileno (fp), &buf)) + return 0; + + abfd->mtime = buf.st_mtime; /* Save value in case anyone wants it */ + return buf.st_mtime; +} + +/* +FUNCTION + bfd_get_size + +SYNOPSIS + long bfd_get_size (bfd *abfd); + +DESCRIPTION + Return the file size (as read from file system) for the file + associated with BFD @var{abfd}. + + The initial motivation for, and use of, this routine is not + so we can get the exact size of the object the BFD applies to, since + that might not be generally possible (archive members for example). + It would be ideal if someone could eventually modify + it so that such results were guaranteed. + + Instead, we want to ask questions like "is this NNN byte sized + object I'm about to try read from file offset YYY reasonable?" + As as example of where we might do this, some object formats + use string tables for which the first <> bytes of the + table contain the size of the table itself, including the size bytes. + If an application tries to read what it thinks is one of these + string tables, without some way to validate the size, and for + some reason the size is wrong (byte swapping error, wrong location + for the string table, etc.), the only clue is likely to be a read + error when it tries to read the table, or a "virtual memory + exhausted" error when it tries to allocate 15 bazillon bytes + of space for the 15 bazillon byte table it is about to read. + This function at least allows us to answer the question, "is the + size reasonable?". +*/ + +long +bfd_get_size (bfd *abfd) +{ + FILE *fp; + struct stat buf; + + if ((abfd->flags & BFD_IN_MEMORY) != 0) + return ((struct bfd_in_memory *) abfd->iostream)->size; + + fp = bfd_cache_lookup (abfd); + if (0 != fstat (fileno (fp), & buf)) + return 0; + + return buf.st_size; +} diff --git a/contrib/binutils/bfd/bfdwin.c b/contrib/binutils/bfd/bfdwin.c new file mode 100644 index 0000000..fb7c967 --- /dev/null +++ b/contrib/binutils/bfd/bfdwin.c @@ -0,0 +1,251 @@ +/* Support for memory-mapped windows into a BFD. + Copyright 1995, 1996, 2001, 2002, 2003 Free Software Foundation, Inc. + Written by Cygnus Support. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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 "sysdep.h" + +#include "bfd.h" +#include "libbfd.h" + +/* Currently, if USE_MMAP is undefined, none if the window stuff is + used. Okay, so it's mis-named. At least the command-line option + "--without-mmap" is more obvious than "--without-windows" or some + such. */ + +#ifdef USE_MMAP + +#undef HAVE_MPROTECT /* code's not tested yet */ + +#if HAVE_MMAP || HAVE_MPROTECT || HAVE_MADVISE +#include +#endif + +#ifndef MAP_FILE +#define MAP_FILE 0 +#endif + +static int debug_windows; + +/* The idea behind the next and refcount fields is that one mapped + region can suffice for multiple read-only windows or multiple + non-overlapping read-write windows. It's not implemented yet + though. */ + +/* +INTERNAL_DEFINITION + +.struct _bfd_window_internal { +. struct _bfd_window_internal *next; +. void *data; +. bfd_size_type size; +. int refcount : 31; {* should be enough... *} +. unsigned mapped : 1; {* 1 = mmap, 0 = malloc *} +.}; +*/ + +void +bfd_init_window (bfd_window *windowp) +{ + windowp->data = 0; + windowp->i = 0; + windowp->size = 0; +} + +void +bfd_free_window (bfd_window *windowp) +{ + bfd_window_internal *i = windowp->i; + windowp->i = 0; + windowp->data = 0; + if (i == 0) + return; + i->refcount--; + if (debug_windows) + fprintf (stderr, "freeing window @%p<%p,%lx,%p>\n", + windowp, windowp->data, windowp->size, windowp->i); + if (i->refcount != 0) + return; + + if (i->mapped) + { +#ifdef HAVE_MMAP + munmap (i->data, i->size); + goto no_free; +#else + abort (); +#endif + } +#ifdef HAVE_MPROTECT + mprotect (i->data, i->size, PROT_READ | PROT_WRITE); +#endif + free (i->data); +#ifdef HAVE_MMAP + no_free: +#endif + i->data = 0; + /* There should be no more references to i at this point. */ + free (i); +} + +static int ok_to_map = 1; + +bfd_boolean +bfd_get_file_window (bfd *abfd, + file_ptr offset, + bfd_size_type size, + bfd_window *windowp, + bfd_boolean writable) +{ + static size_t pagesize; + bfd_window_internal *i = windowp->i; + bfd_size_type size_to_alloc = size; + + if (debug_windows) + fprintf (stderr, "bfd_get_file_window (%p, %6ld, %6ld, %p<%p,%lx,%p>, %d)", + abfd, (long) offset, (long) size, + windowp, windowp->data, (unsigned long) windowp->size, + windowp->i, writable); + + /* Make sure we know the page size, so we can be friendly to mmap. */ + if (pagesize == 0) + pagesize = getpagesize (); + if (pagesize == 0) + abort (); + + if (i == 0) + { + i = bfd_zmalloc (sizeof (bfd_window_internal)); + windowp->i = i; + if (i == 0) + return FALSE; + i->data = 0; + } +#ifdef HAVE_MMAP + if (ok_to_map + && (i->data == 0 || i->mapped == 1) + && (abfd->flags & BFD_IN_MEMORY) == 0) + { + file_ptr file_offset, offset2; + size_t real_size; + int fd; + FILE *f; + + /* Find the real file and the real offset into it. */ + while (abfd->my_archive != NULL) + { + offset += abfd->origin; + abfd = abfd->my_archive; + } + f = bfd_cache_lookup (abfd); + fd = fileno (f); + + /* Compute offsets and size for mmap and for the user's data. */ + offset2 = offset % pagesize; + if (offset2 < 0) + abort (); + file_offset = offset - offset2; + real_size = offset + size - file_offset; + real_size = real_size + pagesize - 1; + real_size -= real_size % pagesize; + + /* If we're re-using a memory region, make sure it's big enough. */ + if (i->data && i->size < size) + { + munmap (i->data, i->size); + i->data = 0; + } + i->data = mmap (i->data, real_size, + writable ? PROT_WRITE | PROT_READ : PROT_READ, + (writable + ? MAP_FILE | MAP_PRIVATE + : MAP_FILE | MAP_SHARED), + fd, file_offset); + if (i->data == (void *) -1) + { + /* An error happened. Report it, or try using malloc, or + something. */ + bfd_set_error (bfd_error_system_call); + i->data = 0; + windowp->data = 0; + if (debug_windows) + fprintf (stderr, "\t\tmmap failed!\n"); + return FALSE; + } + if (debug_windows) + fprintf (stderr, "\n\tmapped %ld at %p, offset is %ld\n", + (long) real_size, i->data, (long) offset2); + i->size = real_size; + windowp->data = (bfd_byte *) i->data + offset2; + windowp->size = size; + i->mapped = 1; + return TRUE; + } + else if (debug_windows) + { + if (ok_to_map) + fprintf (stderr, _("not mapping: data=%lx mapped=%d\n"), + (unsigned long) i->data, (int) i->mapped); + else + fprintf (stderr, _("not mapping: env var not set\n")); + } +#else + ok_to_map = 0; +#endif + +#ifdef HAVE_MPROTECT + if (!writable) + { + size_to_alloc += pagesize - 1; + size_to_alloc -= size_to_alloc % pagesize; + } +#endif + if (debug_windows) + fprintf (stderr, "\n\t%s(%6ld)", + i->data ? "realloc" : " malloc", (long) size_to_alloc); + i->data = bfd_realloc (i->data, size_to_alloc); + if (debug_windows) + fprintf (stderr, "\t-> %p\n", i->data); + i->refcount = 1; + if (i->data == NULL) + { + if (size_to_alloc == 0) + return TRUE; + return FALSE; + } + if (bfd_seek (abfd, offset, SEEK_SET) != 0) + return FALSE; + i->size = bfd_bread (i->data, size, abfd); + if (i->size != size) + return FALSE; + i->mapped = 0; +#ifdef HAVE_MPROTECT + if (!writable) + { + if (debug_windows) + fprintf (stderr, "\tmprotect (%p, %ld, PROT_READ)\n", i->data, + (long) i->size); + mprotect (i->data, i->size, PROT_READ); + } +#endif + windowp->data = i->data; + windowp->size = i->size; + return TRUE; +} + +#endif /* USE_MMAP */ diff --git a/contrib/binutils/bfd/binary.c b/contrib/binutils/bfd/binary.c index 7bddabf..65f46af 100644 --- a/contrib/binutils/bfd/binary.c +++ b/contrib/binutils/bfd/binary.c @@ -1,23 +1,23 @@ /* BFD back-end for binary objects. - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, -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. */ /* This is a BFD backend which may be used to write binary objects. It may only be used for output, not input. The intention is that @@ -41,29 +41,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ a start symbol, an end symbol, and an absolute length symbol. */ #define BIN_SYMS 3 -static boolean binary_mkobject PARAMS ((bfd *)); +static bfd_boolean binary_mkobject PARAMS ((bfd *)); static const bfd_target *binary_object_p PARAMS ((bfd *)); -static boolean binary_get_section_contents +static bfd_boolean binary_get_section_contents PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); static long binary_get_symtab_upper_bound PARAMS ((bfd *)); static char *mangle_name PARAMS ((bfd *, char *)); -static long binary_get_symtab PARAMS ((bfd *, asymbol **)); +static long binary_canonicalize_symtab PARAMS ((bfd *, asymbol **)); static void binary_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); -static boolean binary_set_section_contents - PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); -static int binary_sizeof_headers PARAMS ((bfd *, boolean)); +static bfd_boolean binary_set_section_contents + PARAMS ((bfd *, asection *, const PTR, file_ptr, bfd_size_type)); +static int binary_sizeof_headers PARAMS ((bfd *, bfd_boolean)); -/* Set by external programs - specifies the BFD architecture - to use when creating binary BFDs. */ -enum bfd_architecture bfd_external_binary_architecture = bfd_arch_unknown; +/* Set by external programs - specifies the BFD architecture and + machine number to be uses when creating binary BFDs. */ +enum bfd_architecture bfd_external_binary_architecture = bfd_arch_unknown; +unsigned long bfd_external_machine = 0; /* Create a binary object. Invoked via bfd_set_format. */ -static boolean +static bfd_boolean binary_mkobject (abfd) bfd *abfd ATTRIBUTE_UNUSED; { - return true; + return TRUE; } /* Any file may be considered to be a binary file, provided the target @@ -107,7 +108,8 @@ binary_object_p (abfd) { if ((bfd_get_arch_info (abfd)->arch == bfd_arch_unknown) && (bfd_external_binary_architecture != bfd_arch_unknown)) - bfd_set_arch_info (abfd, bfd_lookup_arch (bfd_external_binary_architecture, 0)); + bfd_set_arch_info (abfd, bfd_lookup_arch + (bfd_external_binary_architecture, bfd_external_machine)); } return abfd->xvec; @@ -119,7 +121,7 @@ binary_object_p (abfd) /* Get contents of the only section. */ -static boolean +static bfd_boolean binary_get_section_contents (abfd, section, location, offset, count) bfd *abfd; asection *section ATTRIBUTE_UNUSED; @@ -129,8 +131,8 @@ binary_get_section_contents (abfd, section, location, offset, count) { if (bfd_seek (abfd, offset, SEEK_SET) != 0 || bfd_bread (location, count, abfd) != count) - return false; - return true; + return FALSE; + return TRUE; } /* Return the amount of memory needed to read the symbol table. */ @@ -174,7 +176,7 @@ mangle_name (abfd, suffix) /* Return the symbol table. */ static long -binary_get_symtab (abfd, alocation) +binary_canonicalize_symtab (abfd, alocation) bfd *abfd; asymbol **alocation; { @@ -185,7 +187,7 @@ binary_get_symtab (abfd, alocation) syms = (asymbol *) bfd_alloc (abfd, amt); if (syms == NULL) - return (long) false; + return 0; /* Start symbol. */ syms[0].the_bfd = abfd; @@ -250,27 +252,27 @@ binary_get_symbol_info (ignore_abfd, symbol, ret) /* Write section contents of a binary file. */ -static boolean +static bfd_boolean binary_set_section_contents (abfd, sec, data, offset, size) bfd *abfd; asection *sec; - PTR data; + const PTR data; file_ptr offset; bfd_size_type size; { if (size == 0) - return true; + return TRUE; if (! abfd->output_has_begun) { - boolean found_low; + bfd_boolean found_low; bfd_vma low; asection *s; /* The lowest section LMA sets the virtual address of the start of the file. We use this to set the file position of all the sections. */ - found_low = false; + found_low = FALSE; low = 0; for (s = abfd->sections; s != NULL; s = s->next) if (((s->flags @@ -280,7 +282,7 @@ binary_set_section_contents (abfd, sec, data, offset, size) && (! found_low || s->lma < low)) { low = s->lma; - found_low = true; + found_low = TRUE; } for (s = abfd->sections; s != NULL; s = s->next) @@ -308,16 +310,16 @@ binary_set_section_contents (abfd, sec, data, offset, size) (unsigned long) s->filepos); } - abfd->output_has_begun = true; + abfd->output_has_begun = TRUE; } /* We don't want to output anything for a section that is neither loaded nor allocated. The contents of such a section are not meaningful in the binary format. */ if ((sec->flags & (SEC_LOAD | SEC_ALLOC)) == 0) - return true; + return TRUE; if ((sec->flags & SEC_NEVER_LOAD) != 0) - return true; + return TRUE; return _bfd_generic_set_section_contents (abfd, sec, data, offset, size); } @@ -327,7 +329,7 @@ binary_set_section_contents (abfd, sec, data, offset, size) static int binary_sizeof_headers (abfd, exec) bfd *abfd ATTRIBUTE_UNUSED; - boolean exec ATTRIBUTE_UNUSED; + bfd_boolean exec ATTRIBUTE_UNUSED; { return 0; } diff --git a/contrib/binutils/bfd/bout.c b/contrib/binutils/bfd/bout.c new file mode 100644 index 0000000..a39a9a3 --- /dev/null +++ b/contrib/binutils/bfd/bout.c @@ -0,0 +1,1579 @@ +/* BFD back-end for Intel 960 b.out binaries. + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, + 2000, 2001, 2002, 2003 + Free Software Foundation, Inc. + Written by Cygnus Support. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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 "genlink.h" +#include "bout.h" + +#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, asection *input_section, + bfd_vma value)); +static bfd_boolean b_out_squirt_out_relocs + PARAMS ((bfd *abfd, asection *section)); +static const bfd_target *b_out_callback + PARAMS ((bfd *)); +static bfd_reloc_status_type calljx_callback + PARAMS ((bfd *, struct bfd_link_info *, arelent *, PTR src, PTR dst, + asection *)); +static bfd_reloc_status_type callj_callback + PARAMS ((bfd *, struct bfd_link_info *, arelent *, PTR data, + unsigned int srcidx, unsigned int dstidx, asection *, bfd_boolean)); +static bfd_vma get_value + PARAMS ((arelent *, struct bfd_link_info *, asection *)); +static int abs32code + PARAMS ((bfd *, asection *, arelent *, unsigned int, + struct bfd_link_info *)); +static bfd_boolean b_out_bfd_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *)); +static bfd_byte *b_out_bfd_get_relocated_section_contents + PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, + bfd_boolean, asymbol **)); +static int b_out_sizeof_headers + PARAMS ((bfd *, bfd_boolean)); +static bfd_boolean b_out_set_arch_mach + PARAMS ((bfd *, enum bfd_architecture, unsigned long)); +static bfd_boolean b_out_set_section_contents + PARAMS ((bfd *, asection *, const PTR, file_ptr, bfd_size_type)); +static long b_out_get_reloc_upper_bound + PARAMS ((bfd *, sec_ptr)); +static long b_out_canonicalize_reloc + PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); +static bfd_boolean b_out_slurp_reloc_table + PARAMS ((bfd *, sec_ptr, asymbol **)); +static reloc_howto_type *b_out_bfd_reloc_type_lookup + PARAMS ((bfd *, bfd_reloc_code_real_type)); +static bfd_boolean b_out_write_object_contents + PARAMS ((bfd *)); +static int b_out_symbol_cmp + PARAMS ((const void *, const void *)); +static bfd_boolean b_out_mkobject + PARAMS ((bfd *)); +static const bfd_target *b_out_object_p + PARAMS ((bfd *)); + +void bout_swap_exec_header_in + PARAMS ((bfd *, struct external_exec *, struct internal_exec *)); +void bout_swap_exec_header_out + PARAMS ((bfd *, struct internal_exec *, struct external_exec *)); + +/* Swaps the information in an executable header taken from a raw byte + stream memory image, into the internal exec_header structure. */ + +void +bout_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; + + /* Now fill in fields in the execp, from the bytes in the raw data. */ + execp->a_info = H_GET_32 (abfd, bytes->e_info); + execp->a_text = GET_WORD (abfd, bytes->e_text); + execp->a_data = GET_WORD (abfd, bytes->e_data); + execp->a_bss = GET_WORD (abfd, bytes->e_bss); + execp->a_syms = GET_WORD (abfd, bytes->e_syms); + execp->a_entry = GET_WORD (abfd, bytes->e_entry); + execp->a_trsize = GET_WORD (abfd, bytes->e_trsize); + execp->a_drsize = GET_WORD (abfd, bytes->e_drsize); + execp->a_tload = GET_WORD (abfd, bytes->e_tload); + execp->a_dload = GET_WORD (abfd, bytes->e_dload); + execp->a_talign = bytes->e_talign[0]; + execp->a_dalign = bytes->e_dalign[0]; + execp->a_balign = bytes->e_balign[0]; + execp->a_relaxable = bytes->e_relaxable[0]; +} + +/* Swaps the information in an internal exec header structure into the + supplied buffer ready for writing to disk. */ + +void +bout_swap_exec_header_out (abfd, execp, raw_bytes) + bfd *abfd; + struct internal_exec *execp; + 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. */ + H_PUT_32 (abfd, execp->a_info , bytes->e_info); + PUT_WORD (abfd, execp->a_text , bytes->e_text); + PUT_WORD (abfd, execp->a_data , bytes->e_data); + PUT_WORD (abfd, execp->a_bss , bytes->e_bss); + PUT_WORD (abfd, execp->a_syms , bytes->e_syms); + PUT_WORD (abfd, execp->a_entry , bytes->e_entry); + PUT_WORD (abfd, execp->a_trsize, bytes->e_trsize); + PUT_WORD (abfd, execp->a_drsize, bytes->e_drsize); + PUT_WORD (abfd, execp->a_tload , bytes->e_tload); + PUT_WORD (abfd, execp->a_dload , bytes->e_dload); + bytes->e_talign[0] = execp->a_talign; + bytes->e_dalign[0] = execp->a_dalign; + bytes->e_balign[0] = execp->a_balign; + bytes->e_relaxable[0] = execp->a_relaxable; +} + +static const bfd_target * +b_out_object_p (abfd) + bfd *abfd; +{ + struct internal_exec anexec; + struct external_exec exec_bytes; + bfd_size_type amt = EXEC_BYTES_SIZE; + + if (bfd_bread ((PTR) &exec_bytes, amt, abfd) != amt) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return 0; + } + + anexec.a_info = H_GET_32 (abfd, exec_bytes.e_info); + + if (N_BADMAG (anexec)) + { + bfd_set_error (bfd_error_wrong_format); + return 0; + } + + bout_swap_exec_header_in (abfd, &exec_bytes, &anexec); + 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. */ + +static const bfd_target * +b_out_callback (abfd) + bfd *abfd; +{ + struct internal_exec *execp = exec_hdr (abfd); + unsigned long bss_start; + + /* Architecture and machine type. */ + bfd_set_arch_mach(abfd, + bfd_arch_i960, /* B.out only used on i960 */ + bfd_mach_i960_core /* Default */ + ); + + /* The positions of the string table and symbol table. */ + obj_str_filepos (abfd) = N_STROFF (*execp); + obj_sym_filepos (abfd) = N_SYMOFF (*execp); + + /* The alignments of the sections. */ + obj_textsec (abfd)->alignment_power = execp->a_talign; + obj_datasec (abfd)->alignment_power = execp->a_dalign; + obj_bsssec (abfd)->alignment_power = execp->a_balign; + + /* The starting addresses of the sections. */ + obj_textsec (abfd)->vma = execp->a_tload; + obj_datasec (abfd)->vma = execp->a_dload; + + obj_textsec (abfd)->lma = obj_textsec (abfd)->vma; + obj_datasec (abfd)->lma = obj_datasec (abfd)->vma; + + /* And reload the sizes, since the aout module zaps them. */ + obj_textsec (abfd)->_raw_size = execp->a_text; + + bss_start = execp->a_dload + execp->a_data; /* BSS = end of data section */ + obj_bsssec (abfd)->vma = align_power (bss_start, execp->a_balign); + + obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma; + + /* The file positions of the sections. */ + obj_textsec (abfd)->filepos = N_TXTOFF(*execp); + obj_datasec (abfd)->filepos = N_DATOFF(*execp); + + /* The file positions of the relocation info. */ + 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).exec_bytes_size = EXEC_BYTES_SIZE; + + if (execp->a_relaxable) + abfd->flags |= BFD_IS_RELAXABLE; + return abfd->xvec; +} + +struct bout_data_struct + { + struct aoutdata a; + struct internal_exec e; + }; + +static bfd_boolean +b_out_mkobject (abfd) + bfd *abfd; +{ + struct bout_data_struct *rawptr; + bfd_size_type amt = sizeof (struct bout_data_struct); + + rawptr = (struct bout_data_struct *) bfd_zalloc (abfd, amt); + if (rawptr == NULL) + return FALSE; + + abfd->tdata.bout_data = rawptr; + exec_hdr (abfd) = &rawptr->e; + + obj_textsec (abfd) = (asection *) NULL; + obj_datasec (abfd) = (asection *) NULL; + obj_bsssec (abfd) = (asection *) NULL; + + return TRUE; +} + +static int +b_out_symbol_cmp (a_ptr, b_ptr) + const void * a_ptr; + const void * b_ptr; +{ + struct aout_symbol ** a = (struct aout_symbol **) a_ptr; + struct aout_symbol ** b = (struct aout_symbol **) b_ptr; + asection *sec; + bfd_vma av, bv; + + /* Primary key is address. */ + sec = bfd_get_section (&(*a)->symbol); + av = sec->output_section->vma + sec->output_offset + (*a)->symbol.value; + sec = bfd_get_section (&(*b)->symbol); + bv = sec->output_section->vma + sec->output_offset + (*b)->symbol.value; + + if (av < bv) + return -1; + if (av > bv) + return 1; + + /* Secondary key puts CALLNAME syms last and BALNAME syms first, so + that they have the best chance of being contiguous. */ + if (IS_BALNAME ((*a)->other) || IS_CALLNAME ((*b)->other)) + return -1; + if (IS_CALLNAME ((*a)->other) || IS_BALNAME ((*b)->other)) + return 1; + + return 0; +} + +static bfd_boolean +b_out_write_object_contents (abfd) + bfd *abfd; +{ + struct external_exec swapped_hdr; + bfd_size_type amt; + + if (! aout_32_make_sections (abfd)) + return FALSE; + + exec_hdr (abfd)->a_info = BMAGIC; + + exec_hdr (abfd)->a_text = obj_textsec (abfd)->_raw_size; + exec_hdr (abfd)->a_data = obj_datasec (abfd)->_raw_size; + exec_hdr (abfd)->a_bss = obj_bsssec (abfd)->_raw_size; + exec_hdr (abfd)->a_syms = bfd_get_symcount (abfd) * sizeof (struct nlist); + exec_hdr (abfd)->a_entry = bfd_get_start_address (abfd); + exec_hdr (abfd)->a_trsize = ((obj_textsec (abfd)->reloc_count) * + sizeof (struct relocation_info)); + exec_hdr (abfd)->a_drsize = ((obj_datasec (abfd)->reloc_count) * + sizeof (struct relocation_info)); + + exec_hdr (abfd)->a_talign = obj_textsec (abfd)->alignment_power; + exec_hdr (abfd)->a_dalign = obj_datasec (abfd)->alignment_power; + exec_hdr (abfd)->a_balign = obj_bsssec (abfd)->alignment_power; + + exec_hdr (abfd)->a_tload = obj_textsec (abfd)->vma; + exec_hdr (abfd)->a_dload = obj_datasec (abfd)->vma; + + bout_swap_exec_header_out (abfd, exec_hdr (abfd), &swapped_hdr); + + amt = EXEC_BYTES_SIZE; + if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 + || bfd_bwrite ((PTR) &swapped_hdr, amt, abfd) != amt) + return FALSE; + + /* Now write out reloc info, followed by syms and strings */ + if (bfd_get_symcount (abfd) != 0) + { + /* Make sure {CALL,BAL}NAME symbols remain adjacent on output + by sorting. This is complicated by the fact that stabs are + also ordered. Solve this by shifting all stabs to the end + in order, then sorting the rest. */ + + asymbol **outsyms, **p, **q; + + outsyms = bfd_get_outsymbols (abfd); + p = outsyms + bfd_get_symcount (abfd); + + for (q = p--; p >= outsyms; p--) + { + if ((*p)->flags & BSF_DEBUGGING) + { + asymbol *t = *--q; + *q = *p; + *p = t; + } + } + + if (q > outsyms) + qsort (outsyms, (size_t) (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) + != 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) + 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) + != 0) + return FALSE; + + if (!b_out_squirt_out_relocs (abfd, obj_datasec (abfd))) + return FALSE; + } + return TRUE; +} + +/* Some reloc hackery. */ + +#define CALLS 0x66003800 /* Template for 'calls' instruction */ +#define BAL 0x0b000000 /* Template for 'bal' instruction */ +#define BAL_MASK 0x00ffffff +#define BALX 0x85f00000 /* Template for 'balx' instruction */ +#define BALX_MASK 0x0007ffff +#define CALL 0x09000000 +#define PCREL13_MASK 0x1fff + +#define output_addr(sec) ((sec)->output_offset+(sec)->output_section->vma) + +/* Magic to turn callx into calljx. */ + +static bfd_reloc_status_type +calljx_callback (abfd, link_info, reloc_entry, src, dst, input_section) + bfd *abfd; + struct bfd_link_info *link_info; + arelent *reloc_entry; + PTR src; + PTR dst; + asection *input_section; +{ + int word = bfd_get_32 (abfd, src); + asymbol *symbol_in = *(reloc_entry->sym_ptr_ptr); + aout_symbol_type *symbol = aout_symbol (symbol_in); + bfd_vma value; + + value = get_value (reloc_entry, link_info, input_section); + + if (IS_CALLNAME (symbol->other)) + { + aout_symbol_type *balsym = symbol+1; + int inst = bfd_get_32 (abfd, (bfd_byte *) src-4); + /* The next symbol should be an N_BALNAME. */ + BFD_ASSERT (IS_BALNAME (balsym->other)); + inst &= BALX_MASK; + inst |= BALX; + bfd_put_32 (abfd, (bfd_vma) inst, (bfd_byte *) dst-4); + symbol = balsym; + value = (symbol->symbol.value + + output_addr (symbol->symbol.section)); + } + + word += value + reloc_entry->addend; + + bfd_put_32 (abfd, (bfd_vma) 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, + input_section, shrinking) + bfd *abfd; + struct bfd_link_info *link_info; + arelent *reloc_entry; + PTR data; + unsigned int srcidx; + unsigned int dstidx; + asection *input_section; + bfd_boolean shrinking; +{ + int word = bfd_get_32 (abfd, (bfd_byte *) data + srcidx); + asymbol *symbol_in = *(reloc_entry->sym_ptr_ptr); + aout_symbol_type *symbol = aout_symbol (symbol_in); + bfd_vma value; + + value = get_value (reloc_entry, link_info, input_section); + + if (IS_OTHER(symbol->other)) + { + /* Call to a system procedure - replace code with system + procedure number. */ + word = CALLS | (symbol->other - 1); + } + else if (IS_CALLNAME(symbol->other)) + { + aout_symbol_type *balsym = symbol+1; + + /* 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 + + output_addr (balsym->symbol.section) + + balsym->symbol.value + reloc_entry->addend + - dstidx + - output_addr (input_section)) + & BAL_MASK); + } + else if ((symbol->symbol.flags & BSF_SECTION_SYM) != 0) + { + /* A callj against a symbol in the same section is a fully + resolved relative call. We don't need to do anything here. + If the symbol is not in the same section, I'm not sure what + to do; fortunately, this case will probably never arise. */ + BFD_ASSERT (! shrinking); + BFD_ASSERT (symbol->symbol.section == input_section); + } + else + { + word = CALL | (((word & BAL_MASK) + + value + + reloc_entry->addend + - (shrinking ? dstidx : 0) + - output_addr (input_section)) + & BAL_MASK); + } + bfd_put_32 (abfd, (bfd_vma) word, (bfd_byte *) data + dstidx); + return bfd_reloc_ok; +} + +/* type rshift size bitsize pcrel bitpos absolute overflow check*/ + +#define ABS32CODE 0 +#define ABS32CODE_SHRUNK 1 +#define PCREL24 2 +#define CALLJ 3 +#define ABS32 4 +#define PCREL13 5 +#define ABS32_MAYBE_RELAXABLE 1 +#define ABS32_WAS_RELAXABLE 2 + +#define ALIGNER 10 +#define ALIGNDONE 11 +static reloc_howto_type howto_reloc_callj = +HOWTO(CALLJ, 0, 2, 24, TRUE, 0, complain_overflow_signed, 0,"callj", TRUE, 0x00ffffff, 0x00ffffff,FALSE); +static reloc_howto_type howto_reloc_abs32 = +HOWTO(ABS32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"abs32", TRUE, 0xffffffff,0xffffffff,FALSE); +static reloc_howto_type howto_reloc_pcrel24 = +HOWTO(PCREL24, 0, 2, 24, TRUE, 0, complain_overflow_signed,0,"pcrel24", TRUE, 0x00ffffff,0x00ffffff,FALSE); + +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); + +static reloc_howto_type howto_reloc_abs32code = +HOWTO(ABS32CODE, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,0,"callx", TRUE, 0xffffffff,0xffffffff,FALSE); + +static reloc_howto_type howto_align_table[] = { + HOWTO (ALIGNER, 0, 0x1, 0, FALSE, 0, complain_overflow_dont, 0, "align16", FALSE, 0, 0, FALSE), + HOWTO (ALIGNER, 0, 0x3, 0, FALSE, 0, complain_overflow_dont, 0, "align32", FALSE, 0, 0, FALSE), + HOWTO (ALIGNER, 0, 0x7, 0, FALSE, 0, complain_overflow_dont, 0, "align64", FALSE, 0, 0, FALSE), + HOWTO (ALIGNER, 0, 0xf, 0, FALSE, 0, complain_overflow_dont, 0, "align128", FALSE, 0, 0, FALSE), +}; + +static reloc_howto_type howto_done_align_table[] = { + HOWTO (ALIGNDONE, 0x1, 0x1, 0, FALSE, 0, complain_overflow_dont, 0, "donealign16", FALSE, 0, 0, FALSE), + HOWTO (ALIGNDONE, 0x3, 0x3, 0, FALSE, 0, complain_overflow_dont, 0, "donealign32", FALSE, 0, 0, FALSE), + HOWTO (ALIGNDONE, 0x7, 0x7, 0, FALSE, 0, complain_overflow_dont, 0, "donealign64", FALSE, 0, 0, FALSE), + HOWTO (ALIGNDONE, 0xf, 0xf, 0, FALSE, 0, complain_overflow_dont, 0, "donealign128", FALSE, 0, 0, FALSE), +}; + +static reloc_howto_type * +b_out_bfd_reloc_type_lookup (abfd, code) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_reloc_code_real_type code; +{ + switch (code) + { + default: + return 0; + case BFD_RELOC_I960_CALLJ: + return &howto_reloc_callj; + case BFD_RELOC_32: + case BFD_RELOC_CTOR: + return &howto_reloc_abs32; + case BFD_RELOC_24_PCREL: + return &howto_reloc_pcrel24; + } +} + +/* Allocate enough room for all the reloc entries, plus pointers to them all. */ + +static bfd_boolean +b_out_slurp_reloc_table (abfd, asect, symbols) + bfd *abfd; + sec_ptr asect; + asymbol **symbols; +{ + register struct relocation_info *rptr; + unsigned int counter; + arelent *cache_ptr; + int extern_mask, pcrel_mask, callj_mask, length_shift; + int incode_mask; + int size_mask; + bfd_vma prev_addr = 0; + unsigned int count; + bfd_size_type reloc_size, amt; + struct relocation_info *relocs; + arelent *reloc_cache; + + if (asect->relocation) + return TRUE; + + if (!aout_32_slurp_symbol_table (abfd)) + return FALSE; + + if (asect == obj_datasec (abfd)) + { + reloc_size = exec_hdr(abfd)->a_drsize; + goto doit; + } + + if (asect == obj_textsec (abfd)) + { + reloc_size = exec_hdr(abfd)->a_trsize; + goto doit; + } + + if (asect == obj_bsssec (abfd)) + { + reloc_size = 0; + goto doit; + } + + bfd_set_error (bfd_error_invalid_operation); + return FALSE; + + doit: + if (bfd_seek (abfd, asect->rel_filepos, SEEK_SET) != 0) + return FALSE; + count = reloc_size / sizeof (struct relocation_info); + + relocs = (struct relocation_info *) bfd_malloc (reloc_size); + if (!relocs && reloc_size != 0) + return FALSE; + + amt = ((bfd_size_type) count + 1) * sizeof (arelent); + reloc_cache = (arelent *) bfd_malloc (amt); + if (!reloc_cache) + { + if (relocs != NULL) + free (relocs); + return FALSE; + } + + if (bfd_bread ((PTR) relocs, reloc_size, abfd) != reloc_size) + { + free (reloc_cache); + if (relocs != NULL) + free (relocs); + return FALSE; + } + + if (bfd_header_big_endian (abfd)) + { + /* Big-endian bit field allocation order. */ + pcrel_mask = 0x80; + extern_mask = 0x10; + incode_mask = 0x08; + callj_mask = 0x02; + size_mask = 0x20; + length_shift = 5; + } + else + { + /* Little-endian bit field allocation order. */ + pcrel_mask = 0x01; + extern_mask = 0x08; + incode_mask = 0x10; + callj_mask = 0x40; + size_mask = 0x02; + length_shift = 1; + } + + for (rptr = relocs, cache_ptr = reloc_cache, counter = 0; + counter < count; + counter++, rptr++, cache_ptr++) + { + unsigned char *raw = (unsigned char *)rptr; + unsigned int symnum; + + cache_ptr->address = H_GET_32 (abfd, raw + 0); + cache_ptr->howto = 0; + + if (bfd_header_big_endian (abfd)) + symnum = (raw[4] << 16) | (raw[5] << 8) | raw[6]; + else + symnum = (raw[6] << 16) | (raw[5] << 8) | raw[4]; + + if (raw[7] & extern_mask) + { + /* If this is set then the r_index is an index into the symbol table; + if the bit is not set then r_index contains a section map. + We either fill in the sym entry with a pointer to the symbol, + or point to the correct section. */ + cache_ptr->sym_ptr_ptr = symbols + symnum; + cache_ptr->addend = 0; + } + else + { + /* In a.out symbols are relative to the beginning of the + file rather than sections ? + (look in translate_from_native_sym_flags) + The reloc entry addend has added to it the offset into the + file of the data, so subtract the base to make the reloc + section relative. */ + int s; + + /* Sign-extend symnum from 24 bits to whatever host uses. */ + s = symnum; + if (s & (1 << 23)) + s |= (~0) << 24; + + cache_ptr->sym_ptr_ptr = (asymbol **)NULL; + switch (s) + { + case N_TEXT: + case N_TEXT | N_EXT: + cache_ptr->sym_ptr_ptr = obj_textsec (abfd)->symbol_ptr_ptr; + cache_ptr->addend = - obj_textsec (abfd)->vma; + break; + case N_DATA: + case N_DATA | N_EXT: + cache_ptr->sym_ptr_ptr = obj_datasec (abfd)->symbol_ptr_ptr; + cache_ptr->addend = - obj_datasec (abfd)->vma; + break; + case N_BSS: + case N_BSS | N_EXT: + cache_ptr->sym_ptr_ptr = obj_bsssec (abfd)->symbol_ptr_ptr; + cache_ptr->addend = - obj_bsssec (abfd)->vma; + break; + case N_ABS: + case N_ABS | N_EXT: + cache_ptr->sym_ptr_ptr = obj_bsssec (abfd)->symbol_ptr_ptr; + cache_ptr->addend = 0; + break; + case -2: /* .align */ + if (raw[7] & pcrel_mask) + { + cache_ptr->howto = &howto_align_table[(raw[7] >> length_shift) & 3]; + cache_ptr->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; + } + else + { + /* .org? */ + abort (); + } + cache_ptr->addend = 0; + break; + default: + BFD_ASSERT(0); + break; + } + } + + /* The i960 only has a few relocation types: + abs 32-bit and pcrel 24bit. except for callj's! */ + if (cache_ptr->howto != 0) + ; + else if (raw[7] & callj_mask) + { + cache_ptr->howto = &howto_reloc_callj; + } + else if ( raw[7] & pcrel_mask) + { + if (raw[7] & size_mask) + cache_ptr->howto = &howto_reloc_pcrel13; + else + cache_ptr->howto = &howto_reloc_pcrel24; + } + else + { + if (raw[7] & incode_mask) + cache_ptr->howto = &howto_reloc_abs32code; + else + cache_ptr->howto = &howto_reloc_abs32; + } + + if (cache_ptr->address < prev_addr) + { + /* Ouch! this reloc is out of order, insert into the right place. */ + arelent tmp; + arelent *cursor = cache_ptr-1; + bfd_vma stop = cache_ptr->address; + + tmp = *cache_ptr; + while (cursor->address > stop && cursor >= reloc_cache) + { + cursor[1] = cursor[0]; + cursor--; + } + + cursor[1] = tmp; + } + else + { + prev_addr = cache_ptr->address; + } + } + + if (relocs != NULL) + free (relocs); + asect->relocation = reloc_cache; + asect->reloc_count = count; + + return TRUE; +} + +static bfd_boolean +b_out_squirt_out_relocs (abfd, section) + bfd *abfd; + asection *section; +{ + arelent **generic; + int r_extern = 0; + int r_idx; + int incode_mask; + int len_1; + unsigned int count = section->reloc_count; + struct relocation_info *native, *natptr; + bfd_size_type natsize; + int extern_mask, pcrel_mask, len_2, callj_mask; + + if (count == 0) + return TRUE; + + generic = section->orelocation; + natsize = (bfd_size_type) count * sizeof (struct relocation_info); + native = ((struct relocation_info *) bfd_malloc (natsize)); + if (!native && natsize != 0) + return FALSE; + + if (bfd_header_big_endian (abfd)) + { + /* Big-endian bit field allocation order. */ + pcrel_mask = 0x80; + extern_mask = 0x10; + len_2 = 0x40; + len_1 = 0x20; + callj_mask = 0x02; + incode_mask = 0x08; + } + else + { + /* Little-endian bit field allocation order. */ + pcrel_mask = 0x01; + extern_mask = 0x08; + len_2 = 0x04; + len_1 = 0x02; + callj_mask = 0x40; + incode_mask = 0x10; + } + + for (natptr = native; count > 0; --count, ++natptr, ++generic) + { + arelent *g = *generic; + unsigned char *raw = (unsigned char *)natptr; + asymbol *sym = *(g->sym_ptr_ptr); + asection *output_section = sym->section->output_section; + + H_PUT_32 (abfd, g->address, raw); + /* Find a type in the output format which matches the input howto - + at the moment we assume input format == output format FIXME!! */ + r_idx = 0; + /* FIXME: Need callj stuff here, and to check the howto entries to + be sure they are real for this architecture. */ + if (g->howto== &howto_reloc_callj) + raw[7] = callj_mask + pcrel_mask + len_2; + else if (g->howto == &howto_reloc_pcrel24) + raw[7] = pcrel_mask + len_2; + else if (g->howto == &howto_reloc_pcrel13) + raw[7] = pcrel_mask + len_1; + else if (g->howto == &howto_reloc_abs32code) + raw[7] = len_2 + incode_mask; + else if (g->howto >= howto_align_table + && g->howto <= (howto_align_table + + sizeof (howto_align_table) / sizeof (howto_align_table[0]) + - 1)) + { + /* symnum == -2; extern_mask not set, pcrel_mask set. */ + r_idx = -2; + r_extern = 0; + raw[7] = (pcrel_mask + | ((g->howto - howto_align_table) << 1)); + } + else + raw[7] = len_2; + + if (r_idx != 0) + /* Already mucked with r_extern, r_idx. */; + else if (bfd_is_com_section (output_section) + || bfd_is_abs_section (output_section) + || bfd_is_und_section (output_section)) + { + if (bfd_abs_section_ptr->symbol == sym) + { + /* Whoops, looked like an abs symbol, but is really an offset + from the abs section. */ + r_idx = 0; + r_extern = 0; + } + else + { + /* Fill in symbol. */ + r_extern = 1; + r_idx = (*g->sym_ptr_ptr)->udata.i; + } + } + else + { + /* Just an ordinary section. */ + r_extern = 0; + r_idx = output_section->target_index; + } + + if (bfd_header_big_endian (abfd)) + { + raw[4] = (unsigned char) (r_idx >> 16); + raw[5] = (unsigned char) (r_idx >> 8); + raw[6] = (unsigned char) (r_idx ); + } + else + { + raw[6] = (unsigned char) (r_idx >> 16); + raw[5] = (unsigned char) (r_idx>> 8); + raw[4] = (unsigned char) (r_idx ); + } + + if (r_extern) + raw[7] |= extern_mask; + } + + if (bfd_bwrite ((PTR) native, natsize, abfd) != natsize) + { + free ((PTR)native); + return FALSE; + } + + free ((PTR)native); + + return TRUE; +} + +/* This is stupid. This function should be a boolean predicate. */ + +static long +b_out_canonicalize_reloc (abfd, section, relptr, symbols) + bfd *abfd; + sec_ptr section; + arelent **relptr; + asymbol **symbols; +{ + arelent *tblptr; + unsigned int count; + + if ((section->flags & SEC_CONSTRUCTOR) != 0) + { + arelent_chain *chain = section->constructor_chain; + + for (count = 0; count < section->reloc_count; count++) + { + *relptr++ = &chain->relent; + chain = chain->next; + } + } + else + { + if (section->relocation == NULL + && ! b_out_slurp_reloc_table (abfd, section, symbols)) + return -1; + + tblptr = section->relocation; + for (count = 0; count++ < section->reloc_count;) + *relptr++ = tblptr++; + } + + *relptr = NULL; + + return section->reloc_count; +} + +static long +b_out_get_reloc_upper_bound (abfd, asect) + bfd *abfd; + sec_ptr asect; +{ + if (bfd_get_format (abfd) != bfd_object) + { + bfd_set_error (bfd_error_invalid_operation); + return -1; + } + + if (asect->flags & SEC_CONSTRUCTOR) + return sizeof (arelent *) * (asect->reloc_count + 1); + + if (asect == obj_datasec (abfd)) + return (sizeof (arelent *) * + ((exec_hdr(abfd)->a_drsize / sizeof (struct relocation_info)) + +1)); + + if (asect == obj_textsec (abfd)) + return (sizeof (arelent *) * + ((exec_hdr(abfd)->a_trsize / sizeof (struct relocation_info)) + +1)); + + if (asect == obj_bsssec (abfd)) + return 0; + + bfd_set_error (bfd_error_invalid_operation); + return -1; +} + + +static bfd_boolean +b_out_set_section_contents (abfd, section, location, offset, count) + bfd *abfd; + asection *section; + const PTR location; + file_ptr offset; + bfd_size_type count; +{ + if (! abfd->output_has_begun) + { + /* Set by bfd.c handler. */ + if (! aout_32_make_sections (abfd)) + return FALSE; + + obj_textsec (abfd)->filepos = sizeof (struct internal_exec); + obj_datasec(abfd)->filepos = obj_textsec(abfd)->filepos + + obj_textsec (abfd)->_raw_size; + } + + /* 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 TRUE; + + return bfd_bwrite ((PTR) location, count, abfd) == count; +} + +static bfd_boolean +b_out_set_arch_mach (abfd, arch, machine) + bfd *abfd; + enum bfd_architecture arch; + unsigned long machine; +{ + bfd_default_set_arch_mach(abfd, arch, machine); + + if (arch == bfd_arch_unknown) /* Unknown machine arch is OK. */ + return TRUE; + + if (arch == bfd_arch_i960) /* i960 default is OK. */ + switch (machine) + { + case bfd_mach_i960_core: + case bfd_mach_i960_kb_sb: + case bfd_mach_i960_mc: + case bfd_mach_i960_xa: + case bfd_mach_i960_ca: + case bfd_mach_i960_ka_sa: + case bfd_mach_i960_jx: + case bfd_mach_i960_hx: + case 0: + return TRUE; + default: + return FALSE; + } + + return FALSE; +} + +static int +b_out_sizeof_headers (ignore_abfd, ignore) + bfd *ignore_abfd ATTRIBUTE_UNUSED; + bfd_boolean ignore ATTRIBUTE_UNUSED; +{ + return sizeof (struct internal_exec); +} + + +static bfd_vma +get_value (reloc, link_info, input_section) + arelent *reloc; + struct bfd_link_info *link_info; + asection *input_section; +{ + bfd_vma value; + 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. */ + if (bfd_is_und_section (symbol->section)) + { + struct bfd_link_hash_entry *h; + + /* The symbol is undefined in this BFD. Look it up in the + global linker hash table. FIXME: This should be changed when + we convert b.out to use a specific final_link function and + change the interface to bfd_relax_section to not require the + generic symbols. */ + h = bfd_wrapped_link_hash_lookup (input_section->owner, link_info, + bfd_asymbol_name (symbol), + FALSE, FALSE, TRUE); + if (h != (struct bfd_link_hash_entry *) NULL + && (h->type == bfd_link_hash_defined + || h->type == bfd_link_hash_defweak)) + value = h->u.def.value + output_addr (h->u.def.section); + else if (h != (struct bfd_link_hash_entry *) NULL + && h->type == bfd_link_hash_common) + 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))) + abort (); + value = 0; + } + } + else + { + value = symbol->value + output_addr (symbol->section); + } + + /* Add the value contained in the relocation. */ + value += reloc->addend; + + return value; +} + +static void +perform_slip (abfd, slip, input_section, value) + bfd *abfd; + unsigned int slip; + asection *input_section; + bfd_vma value; +{ + asymbol **s; + + s = _bfd_generic_link_get_symbols (abfd); + BFD_ASSERT (s != (asymbol **) NULL); + + /* Find all symbols past this point, and make them know + what's happened. */ + while (*s) + { + asymbol *p = *s; + + if (p->section == input_section) + { + /* This was pointing into this section, so mangle it. */ + if (p->value > value) + { + p->value -=slip; + + if (p->udata.p != NULL) + { + struct generic_link_hash_entry *h; + + h = (struct generic_link_hash_entry *) p->udata.p; + BFD_ASSERT (h->root.type == bfd_link_hash_defined); + h->root.u.def.value -= slip; + BFD_ASSERT (h->root.u.def.value == p->value); + } + } + } + s++; + } +} + +/* This routine works out if the thing we want to get to can be + reached with a 24bit offset instead of a 32 bit one. + If it can, then it changes the amode. */ + +static int +abs32code (abfd, input_section, r, shrink, link_info) + bfd *abfd; + asection *input_section; + arelent *r; + unsigned int shrink; + struct bfd_link_info *link_info; +{ + bfd_vma value = get_value (r, link_info, input_section); + bfd_vma dot = output_addr (input_section) + r->address; + bfd_vma gap; + + /* See if the address we're looking at within 2^23 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 (-1 << 23 < (long)gap && (long)gap < 1 << 23) + { + /* Change the reloc type from 32bitcode possible 24, to 24bit + possible 32. */ + r->howto = &howto_reloc_abs32codeshrunk; + /* The place to relc moves back by four bytes. */ + r->address -=4; + + /* This will be four bytes smaller in the long run. */ + shrink += 4 ; + perform_slip (abfd, 4, input_section, r->address-shrink + 4); + } + + return shrink; +} + +static int +aligncode (abfd, input_section, r, shrink) + bfd *abfd; + asection *input_section; + arelent *r; + unsigned int shrink; +{ + bfd_vma dot = output_addr (input_section) + r->address; + bfd_vma gap; + bfd_vma old_end; + bfd_vma new_end; + unsigned int shrink_delta; + int size = r->howto->size; + + /* Reduce the size of the alignment so that it's still aligned but + smaller - the current size is already the same size as or bigger + than the alignment required. */ + + /* Calculate the first byte following the padding before we optimize. */ + old_end = ((dot + size ) & ~size) + size+1; + /* Work out where the new end will be - remember that we're smaller + than we used to be. */ + new_end = ((dot - shrink + size) & ~size); + + /* This is the new end. */ + gap = old_end - ((dot + size) & ~size); + + shrink_delta = (old_end - new_end) - shrink; + + if (shrink_delta) + { + /* Change the reloc so that it knows how far to align to. */ + r->howto = howto_done_align_table + (r->howto - howto_align_table); + + /* Encode the stuff into the addend - for future use we need to + know how big the reloc used to be. */ + r->addend = old_end - dot + r->address; + + /* This will be N bytes smaller in the long run, adjust all the symbols. */ + perform_slip (abfd, shrink_delta, input_section, r->address - shrink); + shrink += shrink_delta; + } + + return shrink; +} + +static bfd_boolean +b_out_bfd_relax_section (abfd, i, link_info, again) + bfd *abfd; + asection *i; + struct bfd_link_info *link_info; + bfd_boolean *again; +{ + /* Get enough memory to hold the stuff. */ + bfd *input_bfd = i->owner; + asection *input_section = i; + unsigned int shrink = 0 ; + arelent **reloc_vector = NULL; + long reloc_size = bfd_get_reloc_upper_bound (input_bfd, + input_section); + + if (reloc_size < 0) + return FALSE; + + /* We only run this relaxation once. It might work to run it + multiple times, but it hasn't been tested. */ + *again = FALSE; + + if (reloc_size) + { + long reloc_count; + + reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); + if (reloc_vector == NULL && reloc_size != 0) + goto error_return; + + /* 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)); + if (reloc_count < 0) + goto error_return; + if (reloc_count > 0) + { + arelent **parent; + + for (parent = reloc_vector; *parent; parent++) + { + arelent *r = *parent; + + switch (r->howto->type) + { + case ALIGNER: + /* An alignment reloc. */ + shrink = aligncode (abfd, input_section, r, shrink); + break; + case ABS32CODE: + /* A 32bit reloc in an addressing mode. */ + shrink = abs32code (input_bfd, input_section, r, shrink, + link_info); + break; + case ABS32CODE_SHRUNK: + shrink += 4; + break; + } + } + } + } + input_section->_cooked_size = input_section->_raw_size - shrink; + + if (reloc_vector != NULL) + free (reloc_vector); + return TRUE; + error_return: + if (reloc_vector != NULL) + free (reloc_vector); + return FALSE; +} + +static bfd_byte * +b_out_bfd_get_relocated_section_contents (output_bfd, link_info, link_order, + data, relocatable, symbols) + bfd *output_bfd; + struct bfd_link_info *link_info; + struct bfd_link_order *link_order; + bfd_byte *data; + bfd_boolean relocatable; + asymbol **symbols; +{ + /* 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); + arelent **reloc_vector = NULL; + long reloc_count; + + if (reloc_size < 0) + goto error_return; + + /* If producing relocatable output, don't bother to relax. */ + if (relocatable) + return bfd_generic_get_relocated_section_contents (output_bfd, link_info, + link_order, + data, relocatable, + symbols); + + reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); + if (reloc_vector == NULL && reloc_size != 0) + goto error_return; + + input_section->reloc_done = 1; + + /* Read in the section. */ + BFD_ASSERT (bfd_get_section_contents (input_bfd, + input_section, + data, + (bfd_vma) 0, + input_section->_raw_size)); + + reloc_count = bfd_canonicalize_reloc (input_bfd, + input_section, + reloc_vector, + symbols); + if (reloc_count < 0) + goto error_return; + if (reloc_count > 0) + { + arelent **parent = reloc_vector; + 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) + { + reloc = *parent; + 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. */ + BFD_ASSERT (reloc->address >= src_address); + run = reloc->address - src_address; + parent++; + } + else + { + run = link_order->size - dst_address; + } + + /* Copy the bytes. */ + for (idx = 0; idx < run; idx++) + data[dst_address++] = data[src_address++]; + + /* Now do the relocation. */ + if (reloc) + { + switch (reloc->howto->type) + { + case ABS32CODE: + calljx_callback (input_bfd, link_info, reloc, + src_address + data, dst_address + data, + input_section); + src_address += 4; + dst_address += 4; + break; + case ABS32: + bfd_put_32 (input_bfd, + (bfd_get_32 (input_bfd, data + src_address) + + get_value (reloc, link_info, input_section)), + data + dst_address); + src_address += 4; + dst_address += 4; + break; + case CALLJ: + callj_callback (input_bfd, link_info, reloc, data, + src_address, dst_address, input_section, + FALSE); + src_address += 4; + dst_address += 4; + break; + case ALIGNDONE: + BFD_ASSERT (reloc->addend >= src_address); + BFD_ASSERT ((bfd_vma) reloc->addend + <= input_section->_raw_size); + src_address = reloc->addend; + dst_address = ((dst_address + reloc->howto->size) + & ~reloc->howto->size); + break; + case ABS32CODE_SHRUNK: + /* This used to be a callx, but we've found out that a + callj will reach, so do the right thing. */ + callj_callback (input_bfd, link_info, reloc, data, + src_address + 4, dst_address, input_section, + TRUE); + dst_address += 4; + src_address += 8; + break; + case PCREL24: + { + long int word = bfd_get_32 (input_bfd, + data + src_address); + bfd_vma value; + + value = get_value (reloc, link_info, input_section); + word = ((word & ~BAL_MASK) + | (((word & BAL_MASK) + + value + - output_addr (input_section) + + reloc->addend) + & BAL_MASK)); + + bfd_put_32 (input_bfd, (bfd_vma) word, data + dst_address); + dst_address += 4; + src_address += 4; + + } + break; + case PCREL13: + { + long int word = bfd_get_32 (input_bfd, + data + src_address); + bfd_vma value; + + value = get_value (reloc, link_info, input_section); + word = ((word & ~PCREL13_MASK) + | (((word & PCREL13_MASK) + + value + + reloc->addend + - output_addr (input_section)) + & PCREL13_MASK)); + + bfd_put_32 (input_bfd, (bfd_vma) word, data + dst_address); + dst_address += 4; + src_address += 4; + } + break; + + default: + abort (); + } + } + } + } + if (reloc_vector != NULL) + free (reloc_vector); + return data; + error_return: + if (reloc_vector != NULL) + free (reloc_vector); + return NULL; +} + + +/* Build the transfer vectors for Big and Little-Endian B.OUT files. */ + +#define aout_32_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol +#define aout_32_close_and_cleanup aout_32_bfd_free_cached_info + +#define b_out_bfd_link_hash_table_create _bfd_generic_link_hash_table_create +#define b_out_bfd_link_hash_table_free _bfd_generic_link_hash_table_free +#define b_out_bfd_link_add_symbols _bfd_generic_link_add_symbols +#define b_out_bfd_link_just_syms _bfd_generic_link_just_syms +#define b_out_bfd_final_link _bfd_generic_final_link +#define b_out_bfd_link_split_section _bfd_generic_link_split_section +#define b_out_bfd_gc_sections bfd_generic_gc_sections +#define b_out_bfd_merge_sections bfd_generic_merge_sections +#define b_out_bfd_discard_group bfd_generic_discard_group + +#define aout_32_get_section_contents_in_window \ + _bfd_generic_get_section_contents_in_window + +extern const bfd_target b_out_vec_little_host; + +const bfd_target b_out_vec_big_host = +{ + "b.out.big", /* name */ + bfd_target_aout_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_BIG, /* hdr byte order is big */ + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT | BFD_IS_RELAXABLE ), + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), + '_', /* symbol leading char */ + ' ', /* ar_pad_char */ + 16, /* 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_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, b_out_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, b_out_mkobject, /* bfd_set_format */ + _bfd_generic_mkarchive, bfd_false}, + {bfd_false, b_out_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 (b_out), + BFD_JUMP_TABLE_WRITE (b_out), + BFD_JUMP_TABLE_LINK (b_out), + 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 */ + bfd_target_aout_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 | BFD_IS_RELAXABLE ), + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA), + '_', /* symbol leading char */ + ' ', /* ar_pad_char */ + 16, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ + + {_bfd_dummy_target, b_out_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, b_out_mkobject, /* bfd_set_format */ + _bfd_generic_mkarchive, bfd_false}, + {bfd_false, b_out_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 (b_out), + BFD_JUMP_TABLE_WRITE (b_out), + BFD_JUMP_TABLE_LINK (b_out), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + & b_out_vec_big_host, + + (PTR) 0 +}; diff --git a/contrib/binutils/bfd/cache.c b/contrib/binutils/bfd/cache.c index df01a1f..7d056ea 100644 --- a/contrib/binutils/bfd/cache.c +++ b/contrib/binutils/bfd/cache.c @@ -1,6 +1,8 @@ /* BFD library -- caching of file descriptors. - Copyright 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001, 2002 - Free Software Foundation, Inc. + + Copyright 1990, 1991, 1992, 1993, 1994, 1996, 2000, 2001, 2002, + 2003, 2004 Free Software Foundation, Inc. + Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -40,10 +42,7 @@ SECTION #include "sysdep.h" #include "libbfd.h" -static void insert PARAMS ((bfd *)); -static void snip PARAMS ((bfd *)); -static boolean close_one PARAMS ((void)); -static boolean bfd_cache_delete PARAMS ((bfd *)); +static bfd_boolean bfd_cache_delete (bfd *); /* INTERNAL_FUNCTION @@ -95,9 +94,8 @@ bfd *bfd_last_cache; /* Insert a BFD into the cache. */ -static INLINE void -insert (abfd) - bfd *abfd; +static void +insert (bfd *abfd) { if (bfd_last_cache == NULL) { @@ -116,9 +114,8 @@ insert (abfd) /* Remove a BFD from the cache. */ -static INLINE void -snip (abfd) - bfd *abfd; +static void +snip (bfd *abfd) { abfd->lru_prev->lru_next = abfd->lru_next; abfd->lru_next->lru_prev = abfd->lru_prev; @@ -133,8 +130,8 @@ snip (abfd) /* We need to open a new file, and the cache is full. Find the least recently used cacheable BFD and close it. */ -static boolean -close_one () +static bfd_boolean +close_one (void) { register bfd *kill; @@ -157,27 +154,26 @@ close_one () if (kill == NULL) { /* There are no open cacheable BFD's. */ - return true; + return TRUE; } - kill->where = ftell ((FILE *) kill->iostream); + kill->where = real_ftell ((FILE *) kill->iostream); return bfd_cache_delete (kill); } /* Close a BFD and remove it from the cache. */ -static boolean -bfd_cache_delete (abfd) - bfd *abfd; +static bfd_boolean +bfd_cache_delete (bfd *abfd) { - boolean ret; + bfd_boolean ret; if (fclose ((FILE *) abfd->iostream) == 0) - ret = true; + ret = TRUE; else { - ret = false; + ret = FALSE; bfd_set_error (bfd_error_system_call); } @@ -194,25 +190,24 @@ INTERNAL_FUNCTION bfd_cache_init SYNOPSIS - boolean bfd_cache_init (bfd *abfd); + bfd_boolean bfd_cache_init (bfd *abfd); DESCRIPTION Add a newly opened BFD to the cache. */ -boolean -bfd_cache_init (abfd) - bfd *abfd; +bfd_boolean +bfd_cache_init (bfd *abfd) { BFD_ASSERT (abfd->iostream != NULL); if (open_files >= BFD_CACHE_MAX_OPEN) { if (! close_one ()) - return false; + return FALSE; } insert (abfd); ++open_files; - return true; + return TRUE; } /* @@ -220,24 +215,23 @@ INTERNAL_FUNCTION bfd_cache_close SYNOPSIS - boolean bfd_cache_close (bfd *abfd); + bfd_boolean bfd_cache_close (bfd *abfd); DESCRIPTION Remove the BFD @var{abfd} from the cache. If the attached file is open, then close it too. RETURNS - <> is returned if closing the file fails, <> is + <> is returned if closing the file fails, <> is returned if all is well. */ -boolean -bfd_cache_close (abfd) - bfd *abfd; +bfd_boolean +bfd_cache_close (bfd *abfd) { if (abfd->iostream == NULL || (abfd->flags & BFD_IN_MEMORY) != 0) - return true; + return TRUE; return bfd_cache_delete (abfd); } @@ -247,7 +241,7 @@ INTERNAL_FUNCTION bfd_open_file SYNOPSIS - FILE* bfd_open_file(bfd *abfd); + FILE* bfd_open_file (bfd *abfd); DESCRIPTION Call the OS to open a file for @var{abfd}. Return the <> @@ -258,10 +252,9 @@ DESCRIPTION */ FILE * -bfd_open_file (abfd) - bfd *abfd; +bfd_open_file (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 +305,7 @@ bfd_open_file (abfd) unlink (abfd->filename); #endif abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WUB); - abfd->opened_once = true; + abfd->opened_once = TRUE; } break; } @@ -331,7 +324,7 @@ INTERNAL_FUNCTION bfd_cache_lookup_worker SYNOPSIS - FILE *bfd_cache_lookup_worker(bfd *abfd); + FILE *bfd_cache_lookup_worker (bfd *abfd); DESCRIPTION Called when the macro <> fails to find a @@ -342,8 +335,7 @@ DESCRIPTION */ FILE * -bfd_cache_lookup_worker (abfd) - bfd *abfd; +bfd_cache_lookup_worker (bfd *abfd) { if ((abfd->flags & BFD_IN_MEMORY) != 0) abort (); @@ -366,7 +358,7 @@ bfd_cache_lookup_worker (abfd) return NULL; if (abfd->where != (unsigned long) abfd->where) return NULL; - if (fseek ((FILE *) abfd->iostream, (long) abfd->where, SEEK_SET) != 0) + if (real_fseek ((FILE *) abfd->iostream, abfd->where, SEEK_SET) != 0) return NULL; } diff --git a/contrib/binutils/bfd/coff-alpha.c b/contrib/binutils/bfd/coff-alpha.c index 6d5ac17..e9dd416 100644 --- a/contrib/binutils/bfd/coff-alpha.c +++ b/contrib/binutils/bfd/coff-alpha.c @@ -1,5 +1,5 @@ /* BFD back-end for ALPHA Extended-Coff files. - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Modified from coff-mips.c by Steve Chamberlain and Ian Lance Taylor . @@ -35,36 +35,40 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Prototypes for static functions. */ -static const bfd_target *alpha_ecoff_object_p PARAMS ((bfd *)); -static boolean alpha_ecoff_bad_format_hook PARAMS ((bfd *abfd, PTR filehdr)); -static PTR alpha_ecoff_mkobject_hook PARAMS ((bfd *, PTR filehdr, PTR aouthdr)); -static void alpha_ecoff_swap_reloc_in PARAMS ((bfd *, PTR, - struct internal_reloc *)); -static void alpha_ecoff_swap_reloc_out PARAMS ((bfd *, - const struct internal_reloc *, - PTR)); -static void alpha_adjust_reloc_in PARAMS ((bfd *, - const struct internal_reloc *, - arelent *)); -static void alpha_adjust_reloc_out PARAMS ((bfd *, const arelent *, - struct internal_reloc *)); +static const bfd_target *alpha_ecoff_object_p + PARAMS ((bfd *)); +static bfd_boolean alpha_ecoff_bad_format_hook + PARAMS ((bfd *abfd, PTR filehdr)); +static PTR alpha_ecoff_mkobject_hook + PARAMS ((bfd *, PTR filehdr, PTR aouthdr)); +static void alpha_ecoff_swap_reloc_in + PARAMS ((bfd *, PTR, struct internal_reloc *)); +static void alpha_ecoff_swap_reloc_out + PARAMS ((bfd *, const struct internal_reloc *, PTR)); +static void alpha_adjust_reloc_in + PARAMS ((bfd *, const struct internal_reloc *, arelent *)); +static void alpha_adjust_reloc_out + PARAMS ((bfd *, const arelent *, struct internal_reloc *)); static reloc_howto_type *alpha_bfd_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); + PARAMS ((bfd *, bfd_reloc_code_real_type)); static bfd_byte *alpha_ecoff_get_relocated_section_contents PARAMS ((bfd *abfd, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *data, boolean relocateable, asymbol **symbols)); + bfd_byte *data, bfd_boolean relocatable, asymbol **symbols)); static bfd_vma alpha_convert_external_reloc PARAMS ((bfd *, struct bfd_link_info *, bfd *, struct external_reloc *, struct ecoff_link_hash_entry *)); -static boolean alpha_relocate_section PARAMS ((bfd *, struct bfd_link_info *, - bfd *, asection *, - bfd_byte *, PTR)); -static boolean alpha_adjust_headers +static bfd_boolean alpha_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, PTR)); +static bfd_boolean alpha_adjust_headers PARAMS ((bfd *, struct internal_filehdr *, struct internal_aouthdr *)); -static PTR alpha_ecoff_read_ar_hdr PARAMS ((bfd *)); -static bfd *alpha_ecoff_get_elt_at_filepos PARAMS ((bfd *, file_ptr)); -static bfd *alpha_ecoff_openr_next_archived_file PARAMS ((bfd *, bfd *)); -static bfd *alpha_ecoff_get_elt_at_index PARAMS ((bfd *, symindex)); +static PTR alpha_ecoff_read_ar_hdr + PARAMS ((bfd *)); +static bfd *alpha_ecoff_get_elt_at_filepos + PARAMS ((bfd *, file_ptr)); +static bfd *alpha_ecoff_openr_next_archived_file + PARAMS ((bfd *, bfd *)); +static bfd *alpha_ecoff_get_elt_at_index + PARAMS ((bfd *, symindex)); /* ECOFF has COFF sections, but the debugging information is stored in a completely different format. ECOFF targets use some of the @@ -122,9 +126,8 @@ static bfd *alpha_ecoff_get_elt_at_index PARAMS ((bfd *, symindex)); /* How to process the various reloc types. */ -static bfd_reloc_status_type -reloc_nil PARAMS ((bfd *, arelent *, asymbol *, PTR, - asection *, bfd *, char **)); +static bfd_reloc_status_type reloc_nil + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type reloc_nil (abfd, reloc, sym, data, sec, output_bfd, error_message) @@ -152,45 +155,45 @@ static reloc_howto_type alpha_howto_table[] = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ reloc_nil, /* special_function */ "IGNORE", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* A 32 bit reference to a symbol. */ HOWTO (ALPHA_R_REFLONG, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "REFLONG", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A 64 bit reference to a symbol. */ HOWTO (ALPHA_R_REFQUAD, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "REFQUAD", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ MINUS_ONE, /* src_mask */ MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A 32 bit GP relative offset. This is just like REFLONG except that when the value is used the value of the gp register will be @@ -199,15 +202,15 @@ static reloc_howto_type alpha_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "GPREL32", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Used for an instruction that refers to memory off the GP register. The offset is 16 bits of the 32 bit instruction. This @@ -216,15 +219,15 @@ static reloc_howto_type alpha_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "LITERAL", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* This reloc only appears immediately following a LITERAL reloc. It identifies a use of the literal. It seems that the linker can @@ -239,15 +242,15 @@ static reloc_howto_type alpha_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ reloc_nil, /* special_function */ "LITUSE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Load the gp register. This is always used for a ldah instruction which loads the upper 16 bits of the gp register. The next reloc @@ -264,15 +267,15 @@ static reloc_howto_type alpha_howto_table[] = 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ reloc_nil, /* special_function */ "GPDISP", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* A 21 bit branch. The native assembler generates these for branches within the text segment, and also fills in the PC @@ -281,90 +284,90 @@ static reloc_howto_type alpha_howto_table[] = 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "BRADDR", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A hint for a jump to a register. */ HOWTO (ALPHA_R_HINT, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 14, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ 0, /* special_function */ "HINT", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0x3fff, /* src_mask */ 0x3fff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 16 bit PC relative offset. */ HOWTO (ALPHA_R_SREL16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "SREL16", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 32 bit PC relative offset. */ HOWTO (ALPHA_R_SREL32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "SREL32", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A 64 bit PC relative offset. */ HOWTO (ALPHA_R_SREL64, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "SREL64", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ MINUS_ONE, /* src_mask */ MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Push a value on the reloc evaluation stack. */ HOWTO (ALPHA_R_OP_PUSH, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ 0, /* special_function */ "OP_PUSH", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Store the value from the stack at the given address. Store it in a bitfield of size r_size starting at bit position r_offset. */ @@ -372,15 +375,15 @@ static reloc_howto_type alpha_howto_table[] = 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ 0, /* special_function */ "OP_STORE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Subtract the reloc address from the value on the top of the relocation stack. */ @@ -388,15 +391,15 @@ static reloc_howto_type alpha_howto_table[] = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ 0, /* special_function */ "OP_PSUB", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Shift the value on the top of the relocation stack right by the given value. */ @@ -404,30 +407,30 @@ static reloc_howto_type alpha_howto_table[] = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ 0, /* special_function */ "OP_PRSHIFT", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Adjust the GP value for a new range in the object file. */ HOWTO (ALPHA_R_GPVALUE, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ 0, /* special_function */ "GPVALUE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false) /* pcrel_offset */ + FALSE) /* pcrel_offset */ }; /* Recognize an Alpha ECOFF file. */ @@ -471,7 +474,7 @@ alpha_ecoff_object_p (abfd) /* See whether the magic number matches. */ -static boolean +static bfd_boolean alpha_ecoff_bad_format_hook (abfd, filehdr) bfd *abfd ATTRIBUTE_UNUSED; PTR filehdr; @@ -479,9 +482,9 @@ alpha_ecoff_bad_format_hook (abfd, filehdr) struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; if (ALPHA_ECOFF_BADMAG (*internal_f)) - return false; + return FALSE; - return true; + return TRUE; } /* This is a hook called by coff_real_object_p to create any backend @@ -750,12 +753,12 @@ alpha_adjust_reloc_out (abfd, rel, intern) static bfd_byte * alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, - data, relocateable, symbols) + data, relocatable, symbols) bfd *abfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; bfd_byte *data; - boolean relocateable; + bfd_boolean relocatable; asymbol **symbols; { bfd *input_bfd = link_order->u.indirect.section->owner; @@ -763,9 +766,9 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section); arelent **reloc_vector = NULL; long reloc_count; - bfd *output_bfd = relocateable ? abfd : (bfd *) NULL; + bfd *output_bfd = relocatable ? abfd : (bfd *) NULL; bfd_vma gp; - boolean gp_undefined; + bfd_boolean gp_undefined; bfd_vma stack[RELOC_STACKSIZE]; int tos = 0; @@ -781,7 +784,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, /* The section size is not going to change. */ input_section->_cooked_size = input_section->_raw_size; - input_section->reloc_done = true; + input_section->reloc_done = TRUE; reloc_count = bfd_canonicalize_reloc (input_bfd, input_section, reloc_vector, symbols); @@ -791,11 +794,11 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, goto successful_return; /* Get the GP value for the output BFD. */ - gp_undefined = false; + gp_undefined = FALSE; gp = _bfd_get_gp_value (abfd); if (gp == 0) { - if (relocateable) + if (relocatable) { asection *sec; bfd_vma lo; @@ -819,11 +822,11 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, { struct bfd_link_hash_entry *h; - h = bfd_link_hash_lookup (link_info->hash, "_gp", false, false, - true); + h = bfd_link_hash_lookup (link_info->hash, "_gp", FALSE, FALSE, + TRUE); if (h == (struct bfd_link_hash_entry *) NULL || h->type != bfd_link_hash_defined) - gp_undefined = true; + gp_undefined = TRUE; else { gp = (h->u.def.value @@ -855,7 +858,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, case ALPHA_R_SREL16: case ALPHA_R_SREL32: case ALPHA_R_SREL64: - if (relocateable + if (relocatable && ((*rel->sym_ptr_ptr)->flags & BSF_SECTION_SYM) == 0) { rel->address += input_section->output_offset; @@ -988,7 +991,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, asymbol *symbol; bfd_vma relocation; - if (relocateable) + if (relocatable) { rel->address += input_section->output_offset; break; @@ -1021,7 +1024,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, bfd_vma val; int offset, size; - if (relocateable) + if (relocatable) { rel->address += input_section->output_offset; break; @@ -1048,7 +1051,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, asymbol *symbol; bfd_vma relocation; - if (relocateable) + if (relocatable) { rel->address += input_section->output_offset; break; @@ -1081,7 +1084,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, asymbol *symbol; bfd_vma relocation; - if (relocateable) + if (relocatable) { rel->address += input_section->output_offset; break; @@ -1111,14 +1114,14 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, case ALPHA_R_GPVALUE: /* I really don't know if this does the right thing. */ gp = rel->addend; - gp_undefined = false; + gp_undefined = FALSE; break; default: abort (); } - if (relocateable) + if (relocatable) { asection *os = input_section->output_section; @@ -1134,7 +1137,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, case bfd_reloc_undefined: if (! ((*link_info->callbacks->undefined_symbol) (link_info, bfd_asymbol_name (*rel->sym_ptr_ptr), - input_bfd, input_section, rel->address, true))) + input_bfd, input_section, rel->address, TRUE))) goto error_return; break; case bfd_reloc_dangerous: @@ -1245,7 +1248,7 @@ alpha_bfd_reloc_type_lookup (abfd, code) } /* A helper routine for alpha_relocate_section which converts an - external reloc when generating relocateable output. Returns the + external reloc when generating relocatable output. Returns the relocation amount. */ static bfd_vma @@ -1259,7 +1262,7 @@ alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h) unsigned long r_symndx; bfd_vma relocation; - BFD_ASSERT (info->relocateable); + BFD_ASSERT (info->relocatable); if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) @@ -1365,7 +1368,7 @@ alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h) quite similar to get_relocated_section_contents. Perhaps they could be combined somehow. */ -static boolean +static bfd_boolean alpha_relocate_section (output_bfd, info, input_bfd, input_section, contents, external_relocs) bfd *output_bfd; @@ -1378,7 +1381,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, asection **symndx_to_section, *lita_sec; struct ecoff_link_hash_entry **sym_hashes; bfd_vma gp; - boolean gp_undefined; + bfd_boolean gp_undefined; bfd_vma stack[RELOC_STACKSIZE]; int tos = 0; struct external_reloc *ext_rel; @@ -1394,7 +1397,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, amt = NUM_RELOC_SECTIONS * sizeof (asection *); symndx_to_section = (asection **) bfd_alloc (input_bfd, amt); if (!symndx_to_section) - return false; + return FALSE; symndx_to_section[RELOC_SECTION_NONE] = NULL; symndx_to_section[RELOC_SECTION_TEXT] = @@ -1440,7 +1443,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, lita_sec = symndx_to_section[RELOC_SECTION_LITA]; gp = _bfd_get_gp_value (output_bfd); - if (! info->relocateable && lita_sec != NULL) + if (! info->relocatable && lita_sec != NULL) { struct ecoff_section_tdata *lita_sec_data; @@ -1485,7 +1488,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, _("using multiple gp values"), (char *) NULL, output_bfd, (asection *) NULL, (bfd_vma) 0); - ecoff_data (output_bfd)->issued_multiple_gp_warning = true; + ecoff_data (output_bfd)->issued_multiple_gp_warning = TRUE; } if (lita_vma < gp - 0x8000) gp = lita_vma + lita_size - 0x8000; @@ -1515,9 +1518,9 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, int r_extern; int r_offset; int r_size; - boolean relocatep; - boolean adjust_addrp; - boolean gp_usedp; + bfd_boolean relocatep; + bfd_boolean adjust_addrp; + bfd_boolean gp_usedp; bfd_vma addend; r_vaddr = H_GET_64 (input_bfd, ext_rel->r_vaddr); @@ -1532,9 +1535,9 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, r_size = ((ext_rel->r_bits[3] & RELOC_BITS3_SIZE_LITTLE) >> RELOC_BITS3_SIZE_SH_LITTLE); - relocatep = false; - adjust_addrp = true; - gp_usedp = false; + relocatep = FALSE; + adjust_addrp = TRUE; + gp_usedp = FALSE; addend = 0; switch (r_type) @@ -1549,16 +1552,16 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, not otherwise used for anything. For some reason, the address of the relocation does not appear to include the section VMA, unlike the other relocation types. */ - if (info->relocateable) + if (info->relocatable) H_PUT_64 (input_bfd, input_section->output_offset + r_vaddr, ext_rel->r_vaddr); - adjust_addrp = false; + adjust_addrp = FALSE; break; case ALPHA_R_REFLONG: case ALPHA_R_REFQUAD: case ALPHA_R_HINT: - relocatep = true; + relocatep = TRUE; break; case ALPHA_R_BRADDR: @@ -1567,7 +1570,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, case ALPHA_R_SREL64: if (r_extern) addend += - (r_vaddr + 4); - relocatep = true; + relocatep = TRUE; break; case ALPHA_R_GPREL32: @@ -1575,9 +1578,9 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, bit offset from the current GP value. We must adjust it by the different between the original GP value and the current GP value. */ - relocatep = true; + relocatep = TRUE; addend = ecoff_data (input_bfd)->gp - gp; - gp_usedp = true; + gp_usedp = TRUE; break; case ALPHA_R_LITERAL: @@ -1608,9 +1611,9 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, || ((insn >> 26) & 0x3f) == 0x28); } - relocatep = true; + relocatep = TRUE; addend = ecoff_data (input_bfd)->gp - gp; - gp_usedp = true; + gp_usedp = TRUE; break; case ALPHA_R_LITUSE: @@ -1674,7 +1677,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, bfd_put_32 (input_bfd, (bfd_vma) insn2, contents + r_vaddr - input_section->vma + r_symndx); - gp_usedp = true; + gp_usedp = TRUE; } break; @@ -1702,7 +1705,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, if (h == (struct ecoff_link_hash_entry *) NULL) abort (); - if (! info->relocateable) + if (! info->relocatable) { if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) @@ -1717,8 +1720,8 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, relocated. */ if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, - input_section, (bfd_vma) 0, true))) - return false; + input_section, (bfd_vma) 0, TRUE))) + return FALSE; addend = 0; } } @@ -1734,7 +1737,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, if (! ((*info->callbacks->unattached_reloc) (info, h->root.root.string, input_bfd, input_section, (bfd_vma) 0))) - return false; + return FALSE; } addend = alpha_convert_external_reloc (output_bfd, info, @@ -1745,7 +1748,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, addend += r_vaddr; - if (info->relocateable) + if (info->relocatable) { /* Adjust r_vaddr by the addend. */ H_PUT_64 (input_bfd, addend, ext_rel->r_vaddr); @@ -1774,14 +1777,14 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, } } - adjust_addrp = false; + adjust_addrp = FALSE; break; case ALPHA_R_OP_STORE: /* Store a value from the reloc stack into a bitfield. If - we are generating relocateable output, all we do is + we are generating relocatable output, all we do is adjust the address of the reloc. */ - if (! info->relocateable) + if (! info->relocatable) { bfd_vma mask; bfd_vma val; @@ -1811,7 +1814,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, case ALPHA_R_GPVALUE: /* I really don't know if this does the right thing. */ gp = ecoff_data (input_bfd)->gp + r_symndx; - gp_undefined = false; + gp_undefined = FALSE; break; } @@ -1847,9 +1850,9 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, abort (); } - if (info->relocateable) + if (info->relocatable) { - /* We are generating relocateable output, and must + /* We are generating relocatable output, and must convert the existing reloc. */ if (r_extern) { @@ -1861,7 +1864,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, if (! ((*info->callbacks->unattached_reloc) (info, h->root.root.string, input_bfd, input_section, r_vaddr - input_section->vma))) - return false; + return FALSE; } relocation = alpha_convert_external_reloc (output_bfd, @@ -1918,8 +1921,8 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, - r_vaddr - input_section->vma, true))) - return false; + r_vaddr - input_section->vma, TRUE))) + return FALSE; relocation = 0; } } @@ -1965,14 +1968,14 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, (info, name, alpha_howto_table[r_type].name, (bfd_vma) 0, input_bfd, input_section, r_vaddr - input_section->vma))) - return false; + return FALSE; } break; } } } - if (info->relocateable && adjust_addrp) + if (info->relocatable && adjust_addrp) { /* Change the address of the relocation. */ H_PUT_64 (input_bfd, @@ -1988,24 +1991,24 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, if (! ((*info->callbacks->reloc_dangerous) (info, _("GP relative relocation used when GP not defined"), input_bfd, input_section, r_vaddr - input_section->vma))) - return false; + return FALSE; /* Only give the error once per link. */ gp = 4; _bfd_set_gp_value (output_bfd, gp); - gp_undefined = false; + gp_undefined = FALSE; } } if (tos != 0) abort (); - return true; + return TRUE; } /* Do final adjustments to the filehdr and the aouthdr. This routine sets the dynamic bits in the file header. */ -static boolean +static bfd_boolean alpha_adjust_headers (abfd, fhdr, ahdr) bfd *abfd; struct internal_filehdr *fhdr; @@ -2015,7 +2018,7 @@ alpha_adjust_headers (abfd, fhdr, ahdr) fhdr->f_flags |= F_ALPHA_CALL_SHARED; else if ((abfd->flags & DYNAMIC) != 0) fhdr->f_flags |= F_ALPHA_SHARABLE; - return true; + return TRUE; } /* Archive handling. In OSF/1 (or Digital Unix) v3.2, Digital @@ -2185,7 +2188,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos) bim->size = size; bim->buffer = buf; - nbfd->mtime_set = true; + nbfd->mtime_set = TRUE; nbfd->mtime = strtol (hdr->ar_date, (char **) NULL, 10); nbfd->flags |= BFD_IN_MEMORY; @@ -2262,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, false, 2, + 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, @@ -2278,10 +2281,10 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data = /* The page boundary used to align sections in a demand-paged executable file. E.g., 0x1000. */ 0x2000, - /* True if the .rdata section is part of the text segment, as on the - Alpha. False if .rdata is part of the data segment, as on the + /* TRUE if the .rdata section is part of the text segment, as on the + Alpha. FALSE if .rdata is part of the data segment, as on the MIPS. */ - true, + TRUE, /* Bitsize of constructor entries. */ 64, /* Reloc to use for constructor entries. */ diff --git a/contrib/binutils/bfd/coff-arm.c b/contrib/binutils/bfd/coff-arm.c index 25256a8..e51d07d 100644 --- a/contrib/binutils/bfd/coff-arm.c +++ b/contrib/binutils/bfd/coff-arm.c @@ -1,24 +1,24 @@ /* BFD back-end for ARM COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. -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" @@ -80,7 +80,7 @@ typedef unsigned long int insn32; typedef unsigned short int insn16; /* Forward declarations for stupid compilers. */ -static boolean coff_arm_relocate_section +static bfd_boolean coff_arm_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **)); static bfd_reloc_status_type aoutarm_fix_pcrel_26_done @@ -99,9 +99,9 @@ static bfd_reloc_status_type coff_thumb_pcrel_12 PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type coff_arm_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static boolean coff_arm_adjust_symndx +static bfd_boolean coff_arm_adjust_symndx PARAMS ((bfd *, struct bfd_link_info *, bfd *, - asection *, struct internal_reloc *, boolean *)); + asection *, struct internal_reloc *, bfd_boolean *)); static reloc_howto_type * coff_arm_rtype_to_howto PARAMS ((bfd *, asection *, struct internal_reloc *, struct coff_link_hash_entry *, struct internal_syment *, @@ -125,19 +125,19 @@ static void record_thumb_to_arm_glue PARAMS ((struct bfd_link_info *, struct coff_link_hash_entry *)); #endif #endif -static boolean coff_arm_merge_private_bfd_data +static bfd_boolean coff_arm_merge_private_bfd_data PARAMS ((bfd *, bfd *)); -static boolean coff_arm_print_private_bfd_data +static bfd_boolean coff_arm_print_private_bfd_data PARAMS ((bfd *, PTR)); -static boolean _bfd_coff_arm_set_private_flags +static bfd_boolean _bfd_coff_arm_set_private_flags PARAMS ((bfd *, flagword)); -static boolean coff_arm_copy_private_bfd_data +static bfd_boolean coff_arm_copy_private_bfd_data PARAMS ((bfd *, bfd *)); -static boolean coff_arm_is_local_label_name +static bfd_boolean coff_arm_is_local_label_name PARAMS ((bfd *, const char *)); -static boolean coff_arm_link_output_has_begun +static bfd_boolean coff_arm_link_output_has_begun PARAMS ((bfd *, struct coff_final_link_info *)); -static boolean coff_arm_final_link_postscript +static bfd_boolean coff_arm_final_link_postscript PARAMS ((bfd *, struct coff_final_link_info *)); static void arm_emit_base_file_entry PARAMS ((struct bfd_link_info *, bfd *, asection *, bfd_vma)); @@ -224,7 +224,7 @@ coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, #endif #ifndef PCRELOFFSET -#define PCRELOFFSET true +#define PCRELOFFSET TRUE #endif /* These most certainly belong somewhere else. Just had to get rid of @@ -252,11 +252,11 @@ coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, #undef ARM_THUMB12 #undef ARM_26D +#define ARM_26D 0 #define ARM_32 1 #define ARM_RVA32 2 #define ARM_26 3 #define ARM_THUMB12 4 -#define ARM_26D 5 #define ARM_SECTION 14 #define ARM_SECREL 15 #endif @@ -264,17 +264,29 @@ coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, static reloc_howto_type aoutarm_std_reloc_howto[] = { #ifdef ARM_WINCE - EMPTY_HOWTO (-1), + HOWTO (ARM_26D, + 2, + 2, + 24, + TRUE, + 0, + complain_overflow_dont, + aoutarm_fix_pcrel_26_done, + "ARM_26D", + FALSE, + 0x00ffffff, + 0x0, + PCRELOFFSET), HOWTO (ARM_32, 0, 2, 32, - false, + FALSE, 0, complain_overflow_bitfield, coff_arm_reloc, "ARM_32", - true, + FALSE, 0xffffffff, 0xffffffff, PCRELOFFSET), @@ -282,12 +294,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 0, 2, 32, - false, + FALSE, 0, complain_overflow_bitfield, coff_arm_reloc, "ARM_RVA32", - true, + FALSE, 0xffffffff, 0xffffffff, PCRELOFFSET), @@ -295,12 +307,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 2, 2, 24, - true, + TRUE, 0, complain_overflow_signed, aoutarm_fix_pcrel_26 , "ARM_26", - false, + FALSE, 0x00ffffff, 0x00ffffff, PCRELOFFSET), @@ -308,28 +320,16 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 1, 1, 11, - true, + TRUE, 0, complain_overflow_signed, coff_thumb_pcrel_12 , "ARM_THUMB12", - false, + FALSE, 0x000007ff, 0x000007ff, PCRELOFFSET), - HOWTO (ARM_26D, - 2, - 2, - 24, - false, - 0, - complain_overflow_dont, - aoutarm_fix_pcrel_26_done, - "ARM_26D", - true, - 0x00ffffff, - 0x0, - false), + EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), @@ -342,12 +342,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 0, 1, 16, - false, + FALSE, 0, complain_overflow_bitfield, coff_arm_reloc, - "ARM_16", - true, + "ARM_SECTION", + FALSE, 0x0000ffff, 0x0000ffff, PCRELOFFSET), @@ -355,26 +355,26 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 0, 2, 32, - false, + FALSE, 0, complain_overflow_bitfield, coff_arm_reloc, - "ARM_32", - true, + "ARM_SECREL", + FALSE, 0xffffffff, 0xffffffff, PCRELOFFSET), #else /* not ARM_WINCE */ - HOWTO (ARM_8, /* type */ + HOWTO (ARM_8, /* type */ 0, /* rightshift */ 0, /* size */ 8, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - coff_arm_reloc, /* special_function */ + coff_arm_reloc, /* special_function */ "ARM_8", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0x000000ff, /* src_mask */ 0x000000ff, /* dst_mask */ PCRELOFFSET /* pcrel_offset */), @@ -382,12 +382,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 0, 1, 16, - false, + FALSE, 0, complain_overflow_bitfield, coff_arm_reloc, "ARM_16", - true, + TRUE, 0x0000ffff, 0x0000ffff, PCRELOFFSET), @@ -395,12 +395,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 0, 2, 32, - false, + FALSE, 0, complain_overflow_bitfield, coff_arm_reloc, "ARM_32", - true, + TRUE, 0xffffffff, 0xffffffff, PCRELOFFSET), @@ -408,12 +408,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 2, 2, 24, - true, + TRUE, 0, complain_overflow_signed, aoutarm_fix_pcrel_26 , "ARM_26", - false, + FALSE, 0x00ffffff, 0x00ffffff, PCRELOFFSET), @@ -421,92 +421,92 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 0, 0, 8, - true, + TRUE, 0, complain_overflow_signed, coff_arm_reloc, "ARM_DISP8", - true, + TRUE, 0x000000ff, 0x000000ff, - true), + TRUE), HOWTO (ARM_DISP16, 0, 1, 16, - true, + TRUE, 0, complain_overflow_signed, coff_arm_reloc, "ARM_DISP16", - true, + TRUE, 0x0000ffff, 0x0000ffff, - true), + TRUE), HOWTO (ARM_DISP32, 0, 2, 32, - true, + TRUE, 0, complain_overflow_signed, coff_arm_reloc, "ARM_DISP32", - true, + TRUE, 0xffffffff, 0xffffffff, - true), + TRUE), HOWTO (ARM_26D, 2, 2, 24, - false, + FALSE, 0, complain_overflow_dont, aoutarm_fix_pcrel_26_done, "ARM_26D", - true, + TRUE, 0x00ffffff, 0x0, - false), + FALSE), /* 8 is unused */ EMPTY_HOWTO (-1), HOWTO (ARM_NEG16, 0, -1, 16, - false, + FALSE, 0, complain_overflow_bitfield, coff_arm_reloc, "ARM_NEG16", - true, + TRUE, 0x0000ffff, 0x0000ffff, - false), + FALSE), HOWTO (ARM_NEG32, 0, -2, 32, - false, + FALSE, 0, complain_overflow_bitfield, coff_arm_reloc, "ARM_NEG32", - true, + TRUE, 0xffffffff, 0xffffffff, - false), + FALSE), HOWTO (ARM_RVA32, 0, 2, 32, - false, + FALSE, 0, complain_overflow_bitfield, coff_arm_reloc, "ARM_RVA32", - true, + TRUE, 0xffffffff, 0xffffffff, PCRELOFFSET), @@ -514,12 +514,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 1, 1, 8, - true, + TRUE, 0, complain_overflow_signed, coff_thumb_pcrel_9 , "ARM_THUMB9", - false, + FALSE, 0x000000ff, 0x000000ff, PCRELOFFSET), @@ -527,12 +527,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 1, 1, 11, - true, + TRUE, 0, complain_overflow_signed, coff_thumb_pcrel_12 , "ARM_THUMB12", - false, + FALSE, 0x000007ff, 0x000007ff, PCRELOFFSET), @@ -540,12 +540,12 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 1, 2, 22, - true, + TRUE, 0, complain_overflow_signed, coff_thumb_pcrel_23 , "ARM_THUMB23", - false, + FALSE, 0x07ff07ff, 0x07ff07ff, PCRELOFFSET) @@ -555,11 +555,11 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = #define NUM_RELOCS NUM_ELEM (aoutarm_std_reloc_howto) #ifdef COFF_WITH_PE -static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); -/* Return true if this relocation should +static bfd_boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); +/* Return TRUE if this relocation should appear in the output .reloc section. */ -static boolean +static bfd_boolean in_reloc_p (abfd, howto) bfd * abfd ATTRIBUTE_UNUSED; reloc_howto_type * howto; @@ -921,13 +921,13 @@ 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. */ + /* The size in bytes of the section containing the Thumb-to-ARM glue. */ bfd_size_type thumb_glue_size; - /* The size in bytes of the section containg the ARM-to-Thumb glue. */ + /* The size in bytes of the section containing the ARM-to-Thumb glue. */ bfd_size_type arm_glue_size; - /* An arbitary input BFD chosen to hold the glue sections. */ + /* An arbitrary input BFD chosen to hold the glue sections. */ bfd * bfd_of_glue_owner; /* Support interworking with old, non-interworking aware ARM code. */ @@ -991,7 +991,7 @@ arm_emit_base_file_entry (info, output_bfd, input_section, reloc_offset) instruction. 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 + 11 bits to invest. The upper 11 bits are stored in one (identified by H-0.. see below), the lower 11 bits are stored in the other (identified by H-1). @@ -1059,7 +1059,7 @@ find_thumb_glue (info, name, input_bfd) sprintf (tmp_name, THUMB2ARM_GLUE_ENTRY_NAME, name); myh = coff_link_hash_lookup - (coff_hash_table (info), tmp_name, false, false, true); + (coff_hash_table (info), tmp_name, FALSE, FALSE, TRUE); if (myh == NULL) /* xgettext:c-format */ @@ -1089,7 +1089,7 @@ find_arm_glue (info, name, input_bfd) sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name); myh = coff_link_hash_lookup - (coff_hash_table (info), tmp_name, false, false, true); + (coff_hash_table (info), tmp_name, FALSE, FALSE, TRUE); if (myh == NULL) /* xgettext:c-format */ @@ -1188,7 +1188,7 @@ static const insn32 t2a6_bx_insn = 0xe12fff1e; ARM/Thumb builds. It is only the code marked THUMBEXTENSION that is different from the original. */ -static boolean +static bfd_boolean coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, syms, sections) bfd *output_bfd; @@ -1244,16 +1244,17 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, howto = coff_rtype_to_howto (input_bfd, input_section, rel, h, sym, &addend); if (howto == NULL) - return false; + return FALSE; /* The relocation_section function will skip pcrel_offset relocs - when doing a relocateable link. However, we want to convert - ARM26 to ARM26D relocs if possible. We return a fake howto in + when doing a relocatable link. However, we want to convert + ARM_26 to ARM_26D relocs if possible. We return a fake howto in this case without pcrel_offset set, and adjust the addend to - compensate. */ + compensate. 'partial_inplace' is also set, since we want 'done' + relocations to be reflected in section's data. */ if (rel->r_type == ARM_26 && h != NULL - && info->relocateable + && info->relocatable && (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) && (h->root.u.def.section->output_section @@ -1264,39 +1265,47 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, 2, 2, 24, - true, + TRUE, 0, complain_overflow_signed, aoutarm_fix_pcrel_26 , "ARM_26", - false, + TRUE, 0x00ffffff, 0x00ffffff, - false); + FALSE); addend -= rel->r_vaddr - input_section->vma; +#ifdef ARM_WINCE + /* FIXME: I don't know why, but the hack is necessary for correct + generation of bl's instruction offset. */ + addend -= 8; +#endif howto = &fake_arm26_reloc; } #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. */ - if (howto->pc_relative && !info->relocateable) +#if 0 /* This appears to have been true for WINCE 2.0, but it is not + true for WINCE 3.0. */ + if (howto->pc_relative && !info->relocatable) addend -= 8; #endif +#endif - /* If we are doing a relocateable link, then we can just ignore + /* If we are doing a relocatable 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, + have the correct value. If this is not a relocatable link, then we should ignore the symbol value. */ if (howto->pc_relative && howto->pcrel_offset) { - if (info->relocateable) + if (info->relocatable) continue; /* FIXME - it is not clear which targets need this next test and which do not. It is known that it is needed for the VxWorks and EPOC-PE targets, but it is also known that it - was supressed for other ARM targets. This ought to be + was suppressed for other ARM targets. This ought to be sorted out one day. */ #ifdef ARM_COFF_BUGFIX /* We must not ignore the symbol value. If the symbol is @@ -1338,7 +1347,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, 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... */ - if (! info->relocateable + if (! info->relocatable && ( h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak)) { @@ -1365,7 +1374,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, myh = find_arm_glue (info, name, input_bfd); if (myh == NULL) - return false; + return FALSE; globals = coff_arm_hash_table (info); @@ -1458,7 +1467,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, myh = find_thumb_glue (info, name, input_bfd); if (myh == NULL) - return false; + return FALSE; globals = coff_arm_hash_table (info); @@ -1592,12 +1601,12 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, + sec->output_offset); } - else if (! info->relocateable) + else if (! info->relocatable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, - rel->r_vaddr - input_section->vma, true))) - return false; + rel->r_vaddr - input_section->vma, TRUE))) + return FALSE; } } @@ -1614,7 +1623,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, rstat = bfd_reloc_ok; #ifndef ARM_WINCE /* Only perform this fix during the final link, not a relocatable link. nickc@cygnus.com */ - else if (! info->relocateable + else if (! info->relocatable && howto->type == ARM_THUMB23) { /* This is pretty much a copy of what the default @@ -1631,18 +1640,18 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, rstat = bfd_reloc_outofrange; else { - bfd_vma relocation = val + addend; - int size = bfd_get_reloc_size (howto); - boolean overflow = false; - bfd_byte * location = contents + address; - bfd_vma x = bfd_get_32 (input_bfd, location); - bfd_vma src_mask = 0x007FFFFE; - bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1; - bfd_signed_vma reloc_signed_min = ~reloc_signed_max; - bfd_vma check; - bfd_signed_vma signed_check; - bfd_vma add; - bfd_signed_vma signed_add; + bfd_vma relocation = val + addend; + int size = bfd_get_reloc_size (howto); + bfd_boolean overflow = FALSE; + bfd_byte *location = contents + address; + bfd_vma x = bfd_get_32 (input_bfd, location); + bfd_vma src_mask = 0x007FFFFE; + bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1; + bfd_signed_vma reloc_signed_min = ~reloc_signed_max; + bfd_vma check; + bfd_signed_vma signed_check; + bfd_vma add; + bfd_signed_vma signed_add; BFD_ASSERT (size == 4); @@ -1699,7 +1708,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, /* Assumes two's complement. */ if ( signed_check > reloc_signed_max || signed_check < reloc_signed_min) - overflow = true; + overflow = TRUE; /* Put the relocation into the correct bits. For a BLX instruction, make sure that the relocation is rounded up @@ -1731,28 +1740,31 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, #endif else #endif /* THUMBEXTENSION */ - rstat = _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, - rel->r_vaddr - input_section->vma, - val, addend); + if (info->relocatable && ! howto->partial_inplace) + rstat = bfd_reloc_ok; + else + rstat = _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, + rel->r_vaddr - input_section->vma, + val, addend); #if 1 /* THUMBEXTENSION */ /* 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 */ - if (! info->relocateable + if (! info->relocatable && (rel->r_type == ARM_32 || rel->r_type == ARM_RVA32)) { /* Determine if we need to set the bottom bit of a relocated address because the address is the address of a Thumb code symbol. */ - int patchit = false; + int patchit = FALSE; if (h != NULL && ( h->class == C_THUMBSTATFUNC || h->class == C_THUMBEXTFUNC)) { - patchit = true; + patchit = TRUE; } else if (sym != NULL && sym->n_scnum > N_UNDEF) @@ -1761,7 +1773,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, if ( sym->n_sclass == C_THUMBSTATFUNC || sym->n_sclass == C_THUMBEXTFUNC) - patchit = true; + patchit = TRUE; } if (patchit) @@ -1786,7 +1798,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, bfd_archive_filename (input_bfd), (unsigned long) rel->r_vaddr, bfd_get_section_name (input_bfd, input_section)); - return false; + return FALSE; case bfd_reloc_overflow: { const char *name; @@ -1800,23 +1812,23 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, { name = _bfd_coff_internal_syment_name (input_bfd, sym, buf); if (name == NULL) - return false; + return FALSE; } if (! ((*info->callbacks->reloc_overflow) (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_vaddr - input_section->vma))) - return false; + return FALSE; } } } - return true; + return TRUE; } #ifndef COFF_IMAGE_WITH_PE -boolean +bfd_boolean bfd_arm_allocate_interworking_sections (info) struct bfd_link_info * info; { @@ -1869,7 +1881,7 @@ bfd_arm_allocate_interworking_sections (info) s->contents = foo; } - return true; + return TRUE; } static void @@ -1904,7 +1916,7 @@ record_arm_to_thumb_glue (info, h) sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name); myh = coff_link_hash_lookup - (coff_hash_table (info), tmp_name, false, false, true); + (coff_hash_table (info), tmp_name, FALSE, FALSE, TRUE); if (myh != NULL) { @@ -1919,7 +1931,7 @@ record_arm_to_thumb_glue (info, h) bh = NULL; val = globals->arm_glue_size + 1; bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name, - BSF_GLOBAL, s, val, NULL, true, false, &bh); + BSF_GLOBAL, s, val, NULL, TRUE, FALSE, &bh); free (tmp_name); @@ -1961,7 +1973,7 @@ record_thumb_to_arm_glue (info, h) sprintf (tmp_name, THUMB2ARM_GLUE_ENTRY_NAME, name); myh = coff_link_hash_lookup - (coff_hash_table (info), tmp_name, false, false, true); + (coff_hash_table (info), tmp_name, FALSE, FALSE, TRUE); if (myh != NULL) { @@ -1972,7 +1984,7 @@ record_thumb_to_arm_glue (info, h) bh = NULL; val = globals->thumb_glue_size + 1; bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name, - BSF_GLOBAL, s, val, NULL, true, false, &bh); + BSF_GLOBAL, s, val, NULL, TRUE, FALSE, &bh); /* If we mark it 'thumb', the disassembler will do a better job. */ myh = (struct coff_link_hash_entry *) bh; @@ -1995,7 +2007,7 @@ record_thumb_to_arm_glue (info, h) bh = NULL; val = globals->thumb_glue_size + (globals->support_old_code ? 8 : 4); bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name, - BSF_LOCAL, s, val, NULL, true, false, &bh); + BSF_LOCAL, s, val, NULL, TRUE, FALSE, &bh); free (tmp_name); @@ -2009,7 +2021,7 @@ record_thumb_to_arm_glue (info, h) This function is called from the linker scripts in ld/emultempl/ {armcoff/pe}.em */ -boolean +bfd_boolean bfd_arm_get_bfd_for_interworking (abfd, info) bfd * abfd; struct bfd_link_info * info; @@ -2020,15 +2032,15 @@ bfd_arm_get_bfd_for_interworking (abfd, info) /* If we are only performing a partial link do not bother getting a bfd to hold the glue. */ - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; globals = coff_arm_hash_table (info); BFD_ASSERT (globals != NULL); if (globals->bfd_of_glue_owner != NULL) - return true; + return TRUE; sec = bfd_get_section_by_name (abfd, ARM2THUMB_GLUE_SECTION_NAME); @@ -2041,7 +2053,7 @@ bfd_arm_get_bfd_for_interworking (abfd, info) if (sec == NULL || ! bfd_set_section_flags (abfd, sec, flags) || ! bfd_set_section_alignment (abfd, sec, 2)) - return false; + return FALSE; } sec = bfd_get_section_by_name (abfd, THUMB2ARM_GLUE_SECTION_NAME); @@ -2055,16 +2067,16 @@ bfd_arm_get_bfd_for_interworking (abfd, info) if (sec == NULL || ! bfd_set_section_flags (abfd, sec, flags) || ! bfd_set_section_alignment (abfd, sec, 2)) - return false; + return FALSE; } /* Save the bfd for later use. */ globals->bfd_of_glue_owner = abfd; - return true; + return TRUE; } -boolean +bfd_boolean bfd_arm_process_before_allocation (abfd, info, support_old_code) bfd * abfd; struct bfd_link_info * info; @@ -2075,8 +2087,8 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) /* If we are only performing a partial link do not bother to construct any glue. */ - if (info->relocateable) - return true; + if (info->relocatable) + 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. */ @@ -2094,7 +2106,7 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) sec = abfd->sections; if (sec == NULL) - return true; + return TRUE; for (; sec != NULL; sec = sec->next) { @@ -2178,7 +2190,7 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) } } - return true; + return TRUE; } #endif /* ! defined (COFF_IMAGE_WITH_PE) */ @@ -2195,19 +2207,19 @@ 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. */ +/* When doing a relocatable link, we want to convert ARM_26 relocs + into ARM_26D relocs. */ -static boolean +static bfd_boolean coff_arm_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp) bfd *obfd ATTRIBUTE_UNUSED; struct bfd_link_info *info ATTRIBUTE_UNUSED; bfd *ibfd; asection *sec; struct internal_reloc *irel; - boolean *adjustedp; + bfd_boolean *adjustedp; { - if (irel->r_type == 3) + if (irel->r_type == ARM_26) { struct coff_link_hash_entry *h; @@ -2216,18 +2228,18 @@ coff_arm_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp) && (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) && h->root.u.def.section->output_section == sec->output_section) - irel->r_type = 7; + irel->r_type = ARM_26D; } - *adjustedp = false; - return true; + *adjustedp = FALSE; + return TRUE; } /* Called when merging the private data areas of two BFDs. This is important as it allows us to detect if we are attempting to merge binaries compiled for different ARM - targets, eg different CPUs or differents APCS's. */ + targets, eg different CPUs or different APCS's. */ -static boolean +static bfd_boolean coff_arm_merge_private_bfd_data (ibfd, obfd) bfd * ibfd; bfd * obfd; @@ -2235,16 +2247,21 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) BFD_ASSERT (ibfd != NULL && obfd != NULL); if (ibfd == obfd) - return true; + return TRUE; /* If the two formats are different we cannot merge anything. This is not an error, since it is permissable to change the input and output formats. */ if ( ibfd->xvec->flavour != bfd_target_coff_flavour || obfd->xvec->flavour != bfd_target_coff_flavour) - return true; + return TRUE; + + /* Determine what should happen if the input ARM architecture + does not match the output ARM architecture. */ + if (! bfd_arm_merge_machines (ibfd, obfd)) + return FALSE; - /* Verify that the APCS is the same for the two BFDs */ + /* Verify that the APCS is the same for the two BFDs. */ if (APCS_SET (ibfd)) { if (APCS_SET (obfd)) @@ -2260,7 +2277,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) ); bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; } if (APCS_FLOAT_FLAG (obfd) != APCS_FLOAT_FLAG (ibfd)) @@ -2278,7 +2295,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) bfd_get_filename (obfd)); bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; } if (PIC_FLAG (obfd) != PIC_FLAG (ibfd)) @@ -2295,7 +2312,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) bfd_get_filename (obfd)); bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; } } else @@ -2334,12 +2351,12 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) } } - return true; + return TRUE; } /* Display the flags field. */ -static boolean +static bfd_boolean coff_arm_print_private_bfd_data (abfd, ptr) bfd * abfd; PTR ptr; @@ -2353,7 +2370,7 @@ coff_arm_print_private_bfd_data (abfd, ptr) if (APCS_SET (abfd)) { - /* xgettext: APCS is ARM Prodecure Call Standard, it should not be translated. */ + /* xgettext: APCS is ARM Procedure Call Standard, it should not be translated. */ fprintf (file, " [APCS-%d]", APCS_26_FLAG (abfd) ? 26 : 32); if (APCS_FLOAT_FLAG (abfd)) @@ -2376,7 +2393,7 @@ coff_arm_print_private_bfd_data (abfd, ptr) fputc ('\n', file); - return true; + return TRUE; } /* Copies the given flags into the coff_tdata.flags field. @@ -2386,7 +2403,7 @@ coff_arm_print_private_bfd_data (abfd, ptr) Note: Although this function is static, it is explicitly called from both coffcode.h and peicode.h. */ -static boolean +static bfd_boolean _bfd_coff_arm_set_private_flags (abfd, flags) bfd * abfd; flagword flags; @@ -2404,7 +2421,7 @@ _bfd_coff_arm_set_private_flags (abfd, flags) || (APCS_FLOAT_FLAG (abfd) != (flags & F_APCS_FLOAT)) || (PIC_FLAG (abfd) != (flags & F_PIC)) )) - return false; + return FALSE; flag |= (flags & (F_APCS_FLOAT | F_PIC)); @@ -2431,13 +2448,13 @@ _bfd_coff_arm_set_private_flags (abfd, flags) SET_INTERWORK_FLAG (abfd, flag); - return true; + return TRUE; } /* Copy the important parts of the target specific data from one instance of a BFD to another. */ -static boolean +static bfd_boolean coff_arm_copy_private_bfd_data (src, dest) bfd * src; bfd * dest; @@ -2445,12 +2462,12 @@ coff_arm_copy_private_bfd_data (src, dest) BFD_ASSERT (src != NULL && dest != NULL); if (src == dest) - return true; + return TRUE; /* If the destination is not in the same format as the source, do not do the copy. */ if (src->xvec != dest->xvec) - return true; + return TRUE; /* copy the flags field */ if (APCS_SET (src)) @@ -2459,13 +2476,13 @@ 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; + return FALSE; if (APCS_FLOAT_FLAG (dest) != APCS_FLOAT_FLAG (src)) - return false; + return FALSE; if (PIC_FLAG (dest) != PIC_FLAG (src)) - return false; + return FALSE; } else SET_APCS_FLAGS (dest, APCS_26_FLAG (src) | APCS_FLOAT_FLAG (src) @@ -2498,7 +2515,7 @@ Warning: Clearing the interworking flag of %s because non-interworking code in % } } - return true; + return TRUE; } /* Note: the definitions here of LOCAL_LABEL_PREFIX and USER_LABEL_PREIFX @@ -2513,7 +2530,7 @@ Warning: Clearing the interworking flag of %s because non-interworking code in % non-local. b) Allow other prefixes than ".", e.g. an empty prefix would cause all labels of the form Lxxx to be stripped. */ -static boolean +static bfd_boolean coff_arm_is_local_label_name (abfd, name) bfd * abfd ATTRIBUTE_UNUSED; const char * name; @@ -2522,7 +2539,7 @@ coff_arm_is_local_label_name (abfd, name) if (USER_LABEL_PREFIX[0] != 0) { if (strncmp (name, USER_LABEL_PREFIX, strlen (USER_LABEL_PREFIX)) == 0) - return false; + return FALSE; } #endif @@ -2535,7 +2552,7 @@ coff_arm_is_local_label_name (abfd, name) size_t len = strlen (LOCAL_LABEL_PREFIX); if (strncmp (name, LOCAL_LABEL_PREFIX, len) != 0) - return false; + return FALSE; /* Perform the checks below for the rest of the name. */ name += len; @@ -2553,7 +2570,7 @@ coff_arm_is_local_label_name (abfd, name) krk@cygnus.com */ -static boolean +static bfd_boolean coff_arm_link_output_has_begun (sub, info) bfd * sub; struct coff_final_link_info * info; @@ -2562,7 +2579,7 @@ coff_arm_link_output_has_begun (sub, info) || sub == coff_arm_hash_table (info->info)->bfd_of_glue_owner); } -static boolean +static bfd_boolean coff_arm_final_link_postscript (abfd, pfinfo) bfd * abfd ATTRIBUTE_UNUSED; struct coff_final_link_info * pfinfo; @@ -2576,12 +2593,12 @@ coff_arm_final_link_postscript (abfd, pfinfo) if (globals->bfd_of_glue_owner != NULL) { if (! _bfd_coff_link_input_bfd (pfinfo, globals->bfd_of_glue_owner)) - return false; + return FALSE; - globals->bfd_of_glue_owner->output_has_begun = true; + globals->bfd_of_glue_owner->output_has_begun = TRUE; } - return true; + return bfd_arm_update_notes (abfd, ARM_NOTE_SECTION); } #include "coffcode.h" @@ -2605,9 +2622,9 @@ coff_arm_final_link_postscript (abfd, pfinfo) #ifndef EXTRA_S_FLAGS #ifdef COFF_WITH_PE -#define EXTRA_S_FLAGS (SEC_LINK_ONCE | SEC_LINK_DUPLICATES) +#define EXTRA_S_FLAGS (SEC_CODE | SEC_LINK_ONCE | SEC_LINK_DUPLICATES) #else -#define EXTRA_S_FLAGS 0 +#define EXTRA_S_FLAGS SEC_CODE #endif #endif @@ -2615,5 +2632,5 @@ coff_arm_final_link_postscript (abfd, pfinfo) 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) +CREATE_LITTLE_COFF_TARGET_VEC (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_BIG_SYM, COFF_SWAP_TABLE) +CREATE_BIG_COFF_TARGET_VEC (TARGET_BIG_SYM, TARGET_BIG_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_LITTLE_SYM, COFF_SWAP_TABLE) diff --git a/contrib/binutils/bfd/coff-aux.c b/contrib/binutils/bfd/coff-aux.c index 53822f0..4d7cde5 100644 --- a/contrib/binutils/bfd/coff-aux.c +++ b/contrib/binutils/bfd/coff-aux.c @@ -1,5 +1,5 @@ /* BFD back-end for Apple M68K COFF A/UX 3.x files. - Copyright 1996, 1997, 2000 Free Software Foundation, Inc. + Copyright 1996, 1997, 2000, 2002 Free Software Foundation, Inc. Written by Richard Henderson . This file is part of BFD, the Binary File Descriptor library. @@ -40,9 +40,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" -static boolean coff_m68k_aux_link_add_one_symbol +static bfd_boolean coff_m68k_aux_link_add_one_symbol PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, - asection *, bfd_vma, const char *, boolean, boolean, + asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, struct bfd_link_hash_entry **)); #define coff_link_add_one_symbol coff_m68k_aux_link_add_one_symbol @@ -56,7 +56,7 @@ static boolean coff_m68k_aux_link_add_one_symbol shared libraries work here, but can work if you are careful with what you include in the shared object. */ -static boolean +static bfd_boolean coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value, string, copy, collect, hashp) struct bfd_link_info *info; @@ -66,8 +66,8 @@ coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value, asection *section; bfd_vma value; const char *string; - boolean copy; - boolean collect; + bfd_boolean copy; + bfd_boolean collect; struct bfd_link_hash_entry **hashp; { struct bfd_link_hash_entry *h; @@ -86,21 +86,21 @@ coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value, } else { - h = bfd_link_hash_lookup (info->hash, name, true, copy, false); + h = bfd_link_hash_lookup (info->hash, name, TRUE, copy, FALSE); if (h == NULL) { if (hashp != NULL) *hashp = NULL; - return false; + return FALSE; } } if (info->notice_hash != (struct bfd_hash_table *) NULL - && (bfd_hash_lookup (info->notice_hash, name, false, false) + && (bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) != (struct bfd_hash_entry *) NULL)) { if (! (*info->callbacks->notice) (info, name, abfd, section, value)) - return false; + return FALSE; } if (hashp != (struct bfd_link_hash_entry **) NULL) @@ -121,10 +121,10 @@ coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value, { h->u.def.section = section; h->u.def.value = value; - return true; + return TRUE; } else if (bfd_is_abs_section (section) && !bfd_is_abs_section (msec)) - return true; + return TRUE; } } diff --git a/contrib/binutils/bfd/coff-i386.c b/contrib/binutils/bfd/coff-i386.c index dbeaef1..a24344a 100644 --- a/contrib/binutils/bfd/coff-i386.c +++ b/contrib/binutils/bfd/coff-i386.c @@ -1,6 +1,6 @@ /* BFD back-end for Intel 386 COFF files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. @@ -56,7 +56,7 @@ static reloc_howto_type *coff_i386_reloc_type_lookup section for a reference to a common symbol is the value itself plus any desired offset. Ian Taylor, Cygnus Support. */ -/* If we are producing relocateable output, we need to do some +/* If we are producing relocatable output, we need to do some adjustments to the object file that are not done by the bfd_perform_relocation function. This function is called by every reloc type to make any required adjustments. */ @@ -103,7 +103,7 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, { /* For some reason bfd_perform_relocation always effectively ignores the addend for a COFF target when producing - relocateable output. This seems to be always wrong for 386 + relocatable output. This seems to be always wrong for 386 COFF, so we handle the addend here instead. */ #ifdef COFF_WITH_PE if (output_bfd == (bfd *) NULL) @@ -179,12 +179,12 @@ 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 +/* Return TRUE if this relocation should appear in the output .reloc section. */ -static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); +static bfd_boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); -static boolean in_reloc_p (abfd, howto) +static bfd_boolean in_reloc_p (abfd, howto) bfd * abfd ATTRIBUTE_UNUSED; reloc_howto_type *howto; { @@ -193,7 +193,7 @@ static boolean in_reloc_p (abfd, howto) #endif /* COFF_WITH_PE */ #ifndef PCRELOFFSET -#define PCRELOFFSET false +#define PCRELOFFSET FALSE #endif static reloc_howto_type howto_table[] = @@ -208,29 +208,29 @@ static reloc_howto_type howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ coff_i386_reloc, /* special_function */ "dir32", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* PE IMAGE_REL_I386_DIR32NB relocation (7). */ HOWTO (R_IMAGEBASE, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ coff_i386_reloc, /* special_function */ "rva32", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ EMPTY_HOWTO (010), EMPTY_HOWTO (011), EMPTY_HOWTO (012), @@ -243,12 +243,12 @@ static reloc_howto_type howto_table[] = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ coff_i386_reloc, /* special_function */ "8", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0x000000ff, /* src_mask */ 0x000000ff, /* dst_mask */ PCRELOFFSET), /* pcrel_offset */ @@ -257,12 +257,12 @@ static reloc_howto_type howto_table[] = 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ coff_i386_reloc, /* special_function */ "16", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ PCRELOFFSET), /* pcrel_offset */ @@ -271,12 +271,12 @@ static reloc_howto_type howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ coff_i386_reloc, /* special_function */ "32", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ PCRELOFFSET), /* pcrel_offset */ @@ -285,12 +285,12 @@ static reloc_howto_type howto_table[] = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ coff_i386_reloc, /* special_function */ "DISP8", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0x000000ff, /* src_mask */ 0x000000ff, /* dst_mask */ PCRELOFFSET), /* pcrel_offset */ @@ -299,12 +299,12 @@ static reloc_howto_type howto_table[] = 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ coff_i386_reloc, /* special_function */ "DISP16", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ PCRELOFFSET), /* pcrel_offset */ @@ -313,12 +313,12 @@ static reloc_howto_type howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ coff_i386_reloc, /* special_function */ "DISP32", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ PCRELOFFSET) /* pcrel_offset */ @@ -386,13 +386,13 @@ static reloc_howto_type howto_table[] = /* The PE relocate section routine. The only difference between this and the regular routine is that we don't want to do anything for a - relocateable link. */ + relocatable link. */ -static boolean coff_pe_i386_relocate_section +static bfd_boolean coff_pe_i386_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **)); -static boolean +static bfd_boolean coff_pe_i386_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, syms, sections) @@ -405,8 +405,8 @@ coff_pe_i386_relocate_section (output_bfd, info, input_bfd, struct internal_syment *syms; asection **sections; { - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; return _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, input_section, contents, @@ -470,7 +470,7 @@ coff_i386_rtype_to_howto (abfd, sec, rel, h, sym, addendp) #ifndef COFF_WITH_PE /* If the output symbol is common (in which case this must be a - relocateable link), we need to add in the final size of the + relocatable link), we need to add in the final size of the common symbol. */ if (h != NULL && h->root.type == bfd_link_hash_common) *addendp += h->root.u.c.size; @@ -539,15 +539,16 @@ coff_i386_reloc_type_lookup (abfd, code) a leading dot for local labels, so if TARGET_UNDERSCORE is defined we treat all symbols starting with L as local. */ -static boolean coff_i386_is_local_label_name PARAMS ((bfd *, const char *)); +static bfd_boolean coff_i386_is_local_label_name + PARAMS ((bfd *, const char *)); -static boolean +static bfd_boolean coff_i386_is_local_label_name (abfd, name) bfd *abfd; const char *name; { if (name[0] == 'L') - return true; + return TRUE; return _bfd_coff_is_local_label_name (abfd, name); } diff --git a/contrib/binutils/bfd/coff-ia64.c b/contrib/binutils/bfd/coff-ia64.c index 76d1bf6..2b5b557 100644 --- a/contrib/binutils/bfd/coff-ia64.c +++ b/contrib/binutils/bfd/coff-ia64.c @@ -1,5 +1,5 @@ /* BFD back-end for HP/Intel IA-64 COFF files. - Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by David Mosberger This file is part of BFD, the Binary File Descriptor library. @@ -49,17 +49,17 @@ static reloc_howto_type howto_table[] = (cache_ptr)->howto = howto_table + (dst)->r_type; #ifdef COFF_WITH_PE -/* Return true if this relocation should +/* Return TRUE if this relocation should appear in the output .reloc section. */ -static boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); +static bfd_boolean in_reloc_p PARAMS ((bfd *, reloc_howto_type *)); -static boolean +static bfd_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... */ + return FALSE; /* We don't do relocs for now... */ } #endif diff --git a/contrib/binutils/bfd/coff-ppc.c b/contrib/binutils/bfd/coff-ppc.c index 4f8b15e..c1c2c32 100644 --- a/contrib/binutils/bfd/coff-ppc.c +++ b/contrib/binutils/bfd/coff-ppc.c @@ -1,6 +1,6 @@ /* BFD back-end for PowerPC Microsoft Portable Executable files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Original version pieced together by Kim Knuttila (krk@cygnus.com) @@ -9,30 +9,29 @@ 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. + 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, 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, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ /* Current State: - 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 - not produce the right glue code for dll function calls. -*/ + not produce the right glue code for dll function calls. */ #include "bfd.h" #include "sysdep.h" @@ -54,19 +53,19 @@ Boston, MA 02111-1307, USA. */ /* This file is compiled more than once, but we only compile the final_link routine once. */ -extern boolean ppc_bfd_coff_final_link +extern bfd_boolean ppc_bfd_coff_final_link PARAMS ((bfd *, struct bfd_link_info *)); extern void dump_toc PARAMS ((PTR)); -/* The toc is a set of bfd_vma fields. We use the fact that valid */ -/* addresses are even (i.e. the bit representing "1" is off) to allow */ -/* us to encode a little extra information in the field */ -/* - Unallocated addresses are intialized to 1. */ -/* - Allocated addresses are even numbers. */ -/* The first time we actually write a reference to the toc in the bfd, */ -/* we want to record that fact in a fixup file (if it is asked for), so */ -/* we keep track of whether or not an address has been written by marking */ -/* the low order bit with a "1" upon writing */ +/* The toc is a set of bfd_vma fields. We use the fact that valid + addresses are even (i.e. the bit representing "1" is off) to allow + us to encode a little extra information in the field + - Unallocated addresses are initialized to 1. + - Allocated addresses are even numbers. + The first time we actually write a reference to the toc in the bfd, + we want to record that fact in a fixup file (if it is asked for), so + we keep track of whether or not an address has been written by marking + the low order bit with a "1" upon writing. */ #define SET_UNALLOCATED(x) ((x) = 1) #define IS_UNALLOCATED(x) ((x) == 1) @@ -75,10 +74,10 @@ 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 */ +/* Turn on this check if you suspect something amiss in the hash tables. */ #ifdef DEBUG_HASH -/* Need a 7 char string for an eye catcher */ +/* Need a 7 char string for an eye catcher. */ #define EYE "krkjunk" #define HASH_CHECK_DCL char eye_catcher[8]; @@ -101,17 +100,17 @@ extern void dump_toc PARAMS ((PTR)); #endif /* 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 */ + linker, we define our own hash table, derived from the coff one. */ /* PE linker hash table entries. */ struct ppc_coff_link_hash_entry { - struct coff_link_hash_entry root; /* First entry, as required */ + struct coff_link_hash_entry root; /* First entry, as required. */ /* As we wonder around the relocs, we'll keep the assigned toc_offset - here */ - bfd_vma toc_offset; /* Our addition, as required */ + here. */ + bfd_vma toc_offset; /* Our addition, as required. */ int symbol_is_glue; unsigned long int glue_insn; @@ -122,20 +121,20 @@ struct ppc_coff_link_hash_entry struct ppc_coff_link_hash_table { - struct coff_link_hash_table root; /* First entry, as required */ + struct coff_link_hash_table root; /* First entry, as required. */ }; static struct bfd_hash_entry *ppc_coff_link_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static boolean ppc_coff_link_hash_table_init +static bfd_boolean ppc_coff_link_hash_table_init PARAMS ((struct ppc_coff_link_hash_table *, bfd *, struct bfd_hash_entry *(*) (struct bfd_hash_entry *, struct bfd_hash_table *, const char *))); static struct bfd_link_hash_table *ppc_coff_link_hash_table_create PARAMS ((bfd *)); -static boolean coff_ppc_relocate_section +static bfd_boolean coff_ppc_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **)); static reloc_howto_type *coff_ppc_rtype_to_howto @@ -172,11 +171,11 @@ ppc_coff_link_hash_newfunc (entry, table, string) if (ret) { /* Initialize the local fields. */ - SET_UNALLOCATED(ret->toc_offset); + SET_UNALLOCATED (ret->toc_offset); ret->symbol_is_glue = 0; ret->glue_insn = 0; - HASH_CHECK_INIT(ret); + HASH_CHECK_INIT (ret); } return (struct bfd_hash_entry *) ret; @@ -184,7 +183,7 @@ ppc_coff_link_hash_newfunc (entry, table, string) /* Initialize a PE linker hash table. */ -static boolean +static bfd_boolean ppc_coff_link_hash_table_init (table, abfd, newfunc) struct ppc_coff_link_hash_table *table; bfd *abfd; @@ -216,13 +215,13 @@ ppc_coff_link_hash_table_create (abfd) return &ret->root.root; } -/* Now, tailor coffcode.h to use our hash stuff */ +/* 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 */ -/* for this when we fix up loads displaced off the toc reg. */ +/* 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 + for this when we fix up loads displaced off the toc reg. */ #define TOC_LOAD_ADJUSTMENT (-32768) #define TOC_SECTION_NAME ".private.toc" @@ -234,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 @@ -284,31 +283,31 @@ ppc_coff_link_hash_table_create (abfd) /* va of containing section (limited to 16 bits) */ #define IMAGE_REL_PPC_SECREL16 0x000F -/* stuff to handle immediate data when the number of bits in the */ -/* data is greater than the number of bits in the immediate field */ -/* We need to do (usually) 32 bit arithmetic on 16 bit chunks */ +/* Stuff to handle immediate data when the number of bits in the + data is greater than the number of bits in the immediate field + We need to do (usually) 32 bit arithmetic on 16 bit chunks. */ #define IMAGE_REL_PPC_REFHI 0x0010 #define IMAGE_REL_PPC_REFLO 0x0011 #define IMAGE_REL_PPC_PAIR 0x0012 -/* This is essentially the same as tocrel16, with TOCDEFN assumed */ +/* This is essentially the same as tocrel16, with TOCDEFN assumed. */ #define IMAGE_REL_PPC_TOCREL16_DEFN 0x0013 -/* Flag bits in IMAGE_RELOCATION.TYPE */ +/* Flag bits in IMAGE_RELOCATION.TYPE. */ -/* subtract reloc value rather than adding it */ +/* Subtract reloc value rather than adding it. */ #define IMAGE_REL_PPC_NEG 0x0100 -/* fix branch prediction bit to predict branch taken */ +/* Fix branch prediction bit to predict branch taken. */ #define IMAGE_REL_PPC_BRTAKEN 0x0200 -/* fix branch prediction bit to predict branch not taken */ +/* Fix branch prediction bit to predict branch not taken. */ #define IMAGE_REL_PPC_BRNTAKEN 0x0400 -/* toc slot defined in file (or, data in toc) */ +/* TOC slot defined in file (or, data in toc). */ #define IMAGE_REL_PPC_TOCDEFN 0x0800 -/* masks to isolate above values in IMAGE_RELOCATION.Type */ +/* Masks to isolate above values in IMAGE_RELOCATION.Type. */ #define IMAGE_REL_PPC_TYPEMASK 0x00FF #define IMAGE_REL_PPC_FLAGMASK 0x0F00 @@ -317,7 +316,7 @@ ppc_coff_link_hash_table_create (abfd) #define EXTRACT_JUNK(x) \ ((x) & ~(IMAGE_REL_PPC_TYPEMASK | IMAGE_REL_PPC_FLAGMASK)) -/* static helper functions to make relocation work */ +/* Static helper functions to make relocation work. */ /* (Work In Progress) */ static bfd_reloc_status_type ppc_refhi_reloc PARAMS ((bfd *abfd, @@ -385,45 +384,40 @@ 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)); +static bfd_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 - completely unverified or have a specific unknown marked in the comment */ - -/*---------------------------------------------------------------------------*/ -/* */ -/* Relocation entries for Windows/NT on PowerPC. */ -/* */ -/* From the document "" we find the following listed as used relocs: */ -/* */ -/* ABSOLUTE : The noop */ -/* ADDR[64|32|16] : fields that hold addresses in data fields or the */ -/* 16 bit displacement field on a load/store. */ -/* ADDR[24|14] : fields that hold addresses in branch and cond */ -/* branches. These represent [26|16] bit addresses. */ -/* The low order 2 bits are preserved. */ -/* REL[24|14] : branches relative to the Instruction Address */ -/* register. These represent [26|16] bit addresses, */ -/* as before. The instruction field will be zero, and */ -/* 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. */ -/* 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) */ -/* SECREL : The value is relative to the start of the section */ -/* containing the symbol. */ -/* SECTION : access to the header containing the item. Supports the */ -/* codeview debugger. */ -/* */ -/* In particular, note that the document does not indicate that the */ -/* relocations listed in the header file are used. */ -/* */ -/* */ -/* */ -/*---------------------------------------------------------------------------*/ + completely unverified or have a specific unknown marked in the comment. */ + +/* Relocation entries for Windows/NT on PowerPC. + + From the document "" we find the following listed as used relocs: + + ABSOLUTE : The noop + ADDR[64|32|16] : fields that hold addresses in data fields or the + 16 bit displacement field on a load/store. + ADDR[24|14] : fields that hold addresses in branch and cond + branches. These represent [26|16] bit addresses. + The low order 2 bits are preserved. + REL[24|14] : branches relative to the Instruction Address + register. These represent [26|16] bit addresses, + as before. The instruction field will be zero, and + 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. + 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) + SECREL : The value is relative to the start of the section + containing the symbol. + SECTION : access to the header containing the item. Supports the + codeview debugger. + + In particular, note that the document does not indicate that the + relocations listed in the header file are used. */ + static reloc_howto_type ppc_coff_howto_table[] = { @@ -433,15 +427,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* dont complain_on_overflow */ 0, /* special_function */ "ABSOLUTE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x00, /* src_mask */ 0x00, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* IMAGE_REL_PPC_ADDR64 0x0001 64-bit address */ /* Unused: */ @@ -449,15 +443,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 3, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "ADDR64", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ MINUS_ONE, /* src_mask */ MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* IMAGE_REL_PPC_ADDR32 0x0002 32-bit address */ /* Used: */ @@ -465,15 +459,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "ADDR32", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + 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 */ @@ -484,15 +478,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "ADDR24", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0x07fffffc, /* src_mask */ 0x07fffffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* IMAGE_REL_PPC_ADDR16 0x0004 16-bit address */ /* Used: */ @@ -500,15 +494,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "ADDR16", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* IMAGE_REL_PPC_ADDR14 0x0005 */ /* 16-bit address, shifted left 2 (load doubleword) */ @@ -518,15 +512,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "ADDR16", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* IMAGE_REL_PPC_REL24 0x0006 */ /* 26-bit PC-relative offset, shifted left 2 (branch relative) */ @@ -535,15 +529,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "REL24", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0x3fffffc, /* src_mask */ 0x3fffffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* IMAGE_REL_PPC_REL14 0x0007 */ /* 16-bit PC-relative offset, shifted left 2 (br cond relative) */ @@ -554,15 +548,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "ADDR16", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* IMAGE_REL_PPC_TOCREL16 0x0008 */ /* 16-bit offset from TOC base */ @@ -571,15 +565,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc_toc16_reloc, /* special_function */ "TOCREL16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* IMAGE_REL_PPC_TOCREL14 0x0009 */ /* 16-bit offset from TOC base, shifted left 2 (load doubleword) */ @@ -588,15 +582,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "TOCREL14", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* IMAGE_REL_PPC_ADDR32NB 0x000A */ /* 32-bit addr w/ image base */ @@ -605,15 +599,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "ADDR32NB", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* IMAGE_REL_PPC_SECREL 0x000B */ /* va of containing section (as in an image sectionhdr) */ @@ -622,15 +616,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ ppc_secrel_reloc, /* special_function */ "SECREL", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* IMAGE_REL_PPC_SECTION 0x000C */ /* sectionheader number */ @@ -639,15 +633,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ ppc_section_reloc, /* special_function */ "SECTION", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* IMAGE_REL_PPC_IFGLUE 0x000D */ /* substitute TOC restore instruction iff symbol is glue code */ @@ -656,15 +650,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "IFGLUE", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* IMAGE_REL_PPC_IMGLUE 0x000E */ /* symbol is glue code; virtual address is TOC restore instruction */ @@ -673,15 +667,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc_imglue_reloc, /* special_function */ "IMGLUE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* IMAGE_REL_PPC_SECREL16 0x000F */ /* va of containing section (limited to 16 bits) */ @@ -690,15 +684,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "SECREL16", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* IMAGE_REL_PPC_REFHI 0x0010 */ /* Unused: */ @@ -706,15 +700,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ ppc_refhi_reloc, /* special_function */ "REFHI", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* IMAGE_REL_PPC_REFLO 0x0011 */ /* Unused: */ @@ -722,15 +716,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ ppc_refhi_reloc, /* special_function */ "REFLO", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* IMAGE_REL_PPC_PAIR 0x0012 */ /* Unused: */ @@ -738,15 +732,15 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ ppc_pair_reloc, /* special_function */ "PAIR", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* IMAGE_REL_PPC_TOCREL16_DEFN 0x0013 */ /* 16-bit offset from TOC base, without causing a definition */ @@ -755,19 +749,19 @@ static reloc_howto_type ppc_coff_howto_table[] = 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ 0, /* special_function */ "TOCREL16, TOCDEFN", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ }; -/* Some really cheezy macros that can be turned on to test stderr :-) */ +/* Some really cheezy macros that can be turned on to test stderr :-) */ #ifdef DEBUG_RELOC #define UN_IMPL(x) \ @@ -792,16 +786,14 @@ static reloc_howto_type ppc_coff_howto_table[] = #define n_name _n._n_name #define n_zeroes _n._n_n._n_zeroes -#define n_offset _n._n_n._n_offset - -*/ +#define n_offset _n._n_n._n_offset */ -#define DUMP_RELOC2(n,r) \ -{ \ - fprintf (stderr,"%s sym %d, r_vaddr %d %s\n", \ - n, r->r_symndx, r->r_vaddr,\ +#define DUMP_RELOC2(n,r) \ +{ \ + 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" ); \ + ?" ":" TOCDEFN" ); \ } #else @@ -810,14 +802,13 @@ static reloc_howto_type ppc_coff_howto_table[] = #define DUMP_RELOC2(n,r) #endif -/* toc construction and management routines */ +/* TOC construction and management routines. */ /* This file is compiled twice, and these variables are defined in one of the compilations. FIXME: This is confusing and weird. Also, BFD should not use global variables. */ -extern bfd* bfd_of_toc_owner; +extern bfd * bfd_of_toc_owner; extern long int global_toc_size; - extern long int import_table_size; extern long int first_thunk_address; extern long int thunk_size; @@ -858,7 +849,7 @@ record_toc (toc_section, our_toc_offset, cat, name) enum ref_category cat; const char *name; { - /* add this entry to our toc addr-offset-name list */ + /* Add this entry to our toc addr-offset-name list. */ bfd_size_type amt = sizeof (struct list_ele); struct list_ele *t = (struct list_ele *) bfd_malloc (amt); @@ -884,13 +875,13 @@ record_toc (toc_section, our_toc_offset, cat, name) #ifdef COFF_IMAGE_WITH_PE -static boolean ppc_record_toc_entry +static bfd_boolean ppc_record_toc_entry PARAMS ((bfd *, struct bfd_link_info *, asection *, int, enum toc_type)); static void ppc_mark_symbol_as_glue PARAMS ((bfd *, int, struct internal_reloc *)); -/* record a toc offset against a symbol */ -static boolean +/* Record a toc offset against a symbol. */ +static bfd_boolean ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) bfd *abfd; struct bfd_link_info *info ATTRIBUTE_UNUSED; @@ -914,16 +905,19 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) if (h == 0) { local_syms = obj_coff_local_toc_table(abfd); + if (local_syms == 0) { unsigned int i; bfd_size_type amt; + /* allocate a table */ amt = (bfd_size_type) obj_raw_syment_count (abfd) * sizeof (int); local_syms = (int *) bfd_zalloc (abfd, amt); if (local_syms == 0) - return false; + return FALSE; obj_coff_local_toc_table (abfd) = local_syms; + for (i = 0; i < obj_raw_syment_count (abfd); ++i) { SET_UNALLOCATED (local_syms[i]); @@ -935,12 +929,12 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) local_syms[sym] = global_toc_size; global_toc_size += 4; - /* The size must fit in a 16bit displacment */ + /* The size must fit in a 16-bit displacement. */ if (global_toc_size > 65535) { (*_bfd_error_handler) (_("TOC overflow")); bfd_set_error (bfd_error_file_too_big); - return false; + return FALSE; } } } @@ -948,27 +942,27 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) { name = h->root.root.root.string; - /* check to see if there's a toc slot allocated. If not, do it - here. It will be used in relocate_section */ + /* Check to see if there's a toc slot allocated. If not, do it + here. It will be used in relocate_section. */ if (IS_UNALLOCATED(h->toc_offset)) { h->toc_offset = global_toc_size; global_toc_size += 4; - /* The size must fit in a 16bit displacment */ + /* The size must fit in a 16-bit displacement. */ if (global_toc_size >= 65535) { (*_bfd_error_handler) (_("TOC overflow")); bfd_set_error (bfd_error_file_too_big); - return false; + return FALSE; } } } - return true; + return TRUE; } -/* record a toc offset against a symbol */ +/* Record a toc offset against a symbol. */ static void ppc_mark_symbol_as_glue(abfd, sym, rel) bfd *abfd; @@ -989,10 +983,10 @@ ppc_mark_symbol_as_glue(abfd, sym, rel) #endif /* COFF_IMAGE_WITH_PE */ -/* Return true if this relocation should +/* Return TRUE if this relocation should appear in the output .reloc section. */ -static boolean in_reloc_p(abfd, howto) +static bfd_boolean in_reloc_p(abfd, howto) bfd * abfd ATTRIBUTE_UNUSED; reloc_howto_type *howto; { @@ -1013,9 +1007,9 @@ static boolean in_reloc_p(abfd, howto) #if 0 -/* this function is in charge of performing all the ppc PE relocations */ -/* Don't yet know if we want to do this this particular way ... (krk) */ -/* FIXME: (it is not yet enabled) */ +/* This function is in charge of performing all the ppc PE relocations + Don't yet know if we want to do this this particular way ... (krk). */ +/* FIXME: (it is not yet enabled). */ static bfd_reloc_status_type pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, @@ -1028,9 +1022,9 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, bfd *output_bfd; char **error_message; { - /* the consth relocation comes in two parts, we have to remember - the state between calls, in these variables */ - static boolean part1_consth_active = false; + /* The consth relocation comes in two parts, we have to remember + the state between calls, in these variables. */ + static bfd_boolean part1_consth_active = FALSE; static unsigned long part1_consth_value; unsigned long sym_value; @@ -1041,7 +1035,7 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, if (output_bfd) { - /* Partial linking - do nothing */ + /* Partial linking - do nothing. */ reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; } @@ -1049,10 +1043,10 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, if (symbol_in != NULL && bfd_is_und_section (symbol_in->section)) { - /* Keep the state machine happy in case we're called again */ + /* Keep the state machine happy in case we're called again. */ if (r_type == IMAGE_REL_PPC_REFHI) { - part1_consth_active = true; + part1_consth_active = TRUE; part1_consth_value = 0; } return(bfd_reloc_undefined); @@ -1060,7 +1054,7 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, if ((part1_consth_active) && (r_type != IMAGE_REL_PPC_PAIR)) { - part1_consth_active = false; + part1_consth_active = FALSE; *error_message = (char *) _("Missing PAIR"); return(bfd_reloc_dangerous); } @@ -1074,7 +1068,7 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, /* The reloc processing routine for the optimized COFF linker. */ -static boolean +static bfd_boolean coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, syms, sections) bfd *output_bfd; @@ -1088,19 +1082,19 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, { struct internal_reloc *rel; struct internal_reloc *relend; - boolean hihalf; + bfd_boolean hihalf; bfd_vma hihalf_val; 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 + /* If we are performing a relocatable 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; + if (info->relocatable) + return TRUE; - hihalf = false; + hihalf = FALSE; hihalf_val = 0; rel = relocs; @@ -1151,7 +1145,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, sec = NULL; val = 0; - /* FIXME: PAIR unsupported in the following code */ + /* FIXME: PAIR unsupported in the following code. */ if (h == NULL) { if (symndx == -1) @@ -1182,14 +1176,14 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.root.string, input_bfd, input_section, - rel->r_vaddr - input_section->vma, true))) - return false; + rel->r_vaddr - input_section->vma, TRUE))) + return FALSE; } } rstat = bfd_reloc_ok; - /* Each case must do its own relocation, setting rstat appropriately */ + /* Each case must do its own relocation, setting rstat appropriately. */ switch (r_type) { default: @@ -1197,7 +1191,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, (_("%s: unsupported relocation type 0x%02x"), bfd_archive_filename (input_bfd), r_type); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; case IMAGE_REL_PPC_TOCREL16: { bfd_signed_vma our_toc_offset; @@ -1217,16 +1211,15 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } } - /* - * 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 - * the 1 bit to tell us if we've written this particular toc - * entry out. - */ - fixit = false; + /* 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 + the 1 bit to tell us if we've written this particular toc + entry out. */ + fixit = FALSE; if (h == 0) - { /* it is a file local symbol */ + { + /* It is a file local symbol. */ int *local_toc_table; const char *name; @@ -1238,15 +1231,14 @@ 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. - */ + again. */ MAKE_ADDR_AGAIN(our_toc_offset); } else { - /* write out the toc entry */ + /* Write out the toc entry. */ record_toc (toc_section, our_toc_offset, priv, strdup (name)); @@ -1254,7 +1246,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, toc_section->contents + our_toc_offset); MARK_AS_WRITTEN(local_toc_table[symndx]); - fixit = true; + fixit = TRUE; } } else @@ -1277,13 +1269,12 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, 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 - the IAT to be part of the toc, thus saving a load. - */ + the IAT to be part of the toc, thus saving a load. */ our_toc_offset = val - (toc_section->output_section->vma + toc_section->output_offset); - /* The size must still fit in a 16bit displacment */ + /* The size must still fit in a 16-bit displacement. */ if ((bfd_vma) our_toc_offset >= 65535) { (*_bfd_error_handler) @@ -1291,18 +1282,17 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, bfd_archive_filename (input_bfd), name, (unsigned long) our_toc_offset); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } record_toc (toc_section, our_toc_offset, pub, strdup (name)); } - else if (IS_WRITTEN(our_toc_offset)) + 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. - */ + again. */ MAKE_ADDR_AGAIN(our_toc_offset); } else @@ -1310,36 +1300,35 @@ 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 */ + /* Write out the toc entry. */ bfd_put_32 (output_bfd, val, toc_section->contents + our_toc_offset); MARK_AS_WRITTEN(h->toc_offset); - /* The tricky part is that this is the address that */ - /* needs a .reloc entry for it */ - fixit = true; + /* The tricky part is that this is the address that + needs a .reloc entry for it. */ + fixit = TRUE; } } 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 */ + to a section or a common symbol, then it needs a reloc. */ - /* relocation to a symbol in a section which + /* Relocation to a symbol in a section which isn't absolute - we output the address here - to a file */ - + to a file. */ bfd_vma addr = (toc_section->output_section->vma + toc_section->output_offset + our_toc_offset); - if (coff_data(output_bfd)->pe) + 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 */ + /* FIXME: this test is conservative. */ if ((r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN && (bfd_vma) our_toc_offset > toc_section->_raw_size) { @@ -1348,24 +1337,24 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, bfd_archive_filename (input_bfd), (unsigned long) toc_section->_raw_size); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } - /* Now we know the relocation for this toc reference */ + /* Now we know the relocation for this toc reference. */ relocation = our_toc_offset + TOC_LOAD_ADJUSTMENT; rstat = _bfd_relocate_contents (howto, input_bfd, relocation, loc); } 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. */ - /* A glue function must announce itself via a IMGLUE reloc, and */ - /* the reloc contains the required toc restore instruction */ - + /* To solve this, we need to know whether or not the symbol + 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); + + DUMP_RELOC2 (howto->name, rel); if (h != 0) { @@ -1379,25 +1368,24 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } break; case IMAGE_REL_PPC_SECREL: - /* Unimplemented: codeview debugging information */ + /* Unimplemented: codeview debugging information. */ /* For fast access to the header of the section containing the item. */ break; case IMAGE_REL_PPC_SECTION: - /* Unimplemented: codeview debugging information */ + /* Unimplemented: codeview debugging information. */ /* Is used to indicate that the value should be relative to the beginning of the section that contains the - symbol */ + symbol. */ break; case IMAGE_REL_PPC_ABSOLUTE: { const char *my_name; + if (h == 0) - my_name = (syms+symndx)->_n._n_name; + my_name = (syms+symndx)->_n._n_name; else - { - my_name = h->root.root.root.string; - } + my_name = h->root.root.root.string; fprintf (stderr, _("Warning: unsupported reloc %s \n"), @@ -1413,8 +1401,9 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, case IMAGE_REL_PPC_IMGLUE: { /* There is nothing to do now. This reloc was noted in the first - pass over the relocs, and the glue instruction extracted */ + pass over the relocs, and the glue instruction extracted. */ const char *my_name; + if (h->symbol_is_glue == 1) break; my_name = h->root.root.root.string; @@ -1423,22 +1412,24 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, (_("%s: Out of order IMGLUE reloc for %s"), bfd_archive_filename (input_bfd), my_name); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } case IMAGE_REL_PPC_ADDR32NB: { const char *name = 0; - DUMP_RELOC2(howto->name, rel); + + DUMP_RELOC2 (howto->name, rel); if (strncmp(".idata$2",input_section->name,8) == 0 && first_thunk_address == 0) { - /* set magic values */ + /* Set magic values. */ int idata5offset; struct coff_link_hash_entry *myh; + myh = coff_link_hash_lookup (coff_hash_table (info), "__idata5_magic__", - false, false, true); + FALSE, FALSE, TRUE); first_thunk_address = myh->root.u.def.value + sec->output_section->vma + sec->output_offset - @@ -1447,17 +1438,18 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, idata5offset = myh->root.u.def.value; myh = coff_link_hash_lookup (coff_hash_table (info), "__idata6_magic__", - false, false, true); + FALSE, FALSE, TRUE); thunk_size = myh->root.u.def.value - idata5offset; myh = coff_link_hash_lookup (coff_hash_table (info), "__idata4_magic__", - false, false, true); + FALSE, FALSE, TRUE); import_table_size = myh->root.u.def.value; } if (h == 0) - { /* it is a file local symbol */ + { + /* It is a file local symbol. */ sym = syms + symndx; name = sym->_n._n_name; } @@ -1466,11 +1458,11 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, char *target = 0; name = h->root.root.root.string; - if (strcmp(".idata$2", name) == 0) + if (strcmp (".idata$2", name) == 0) target = "__idata2_magic__"; - else if (strcmp(".idata$4", name) == 0) + else if (strcmp (".idata$4", name) == 0) target = "__idata4_magic__"; - else if (strcmp(".idata$5", name) == 0) + else if (strcmp (".idata$5", name) == 0) target = "__idata5_magic__"; if (target != 0) @@ -1479,7 +1471,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, myh = coff_link_hash_lookup (coff_hash_table (info), target, - false, false, true); + FALSE, FALSE, TRUE); if (myh == 0) { /* Missing magic cookies. Something is very wrong. */ @@ -1493,7 +1485,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, int idata5offset; myh = coff_link_hash_lookup (coff_hash_table (info), "__idata5_magic__", - false, false, true); + FALSE, FALSE, TRUE); first_thunk_address = myh->root.u.def.value + sec->output_section->vma + sec->output_offset - @@ -1502,22 +1494,22 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, idata5offset = myh->root.u.def.value; myh = coff_link_hash_lookup (coff_hash_table (info), "__idata6_magic__", - false, false, true); + FALSE, FALSE, TRUE); thunk_size = myh->root.u.def.value - idata5offset; myh = coff_link_hash_lookup (coff_hash_table (info), "__idata4_magic__", - false, false, true); + FALSE, FALSE, TRUE); import_table_size = myh->root.u.def.value; } } } rstat = _bfd_relocate_contents (howto, - input_bfd, - val - - pe_data(output_bfd)->pe_opthdr.ImageBase, - loc); + input_bfd, + val - + pe_data (output_bfd)->pe_opthdr.ImageBase, + loc); } break; @@ -1542,24 +1534,23 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, break; } - if ( info->base_file ) + if (info->base_file) { /* So if this is non pcrelative, and is referenced - to a section or a common symbol, then it needs a reloc */ - if (sym && pe_data(output_bfd)->in_reloc_p(output_bfd, howto)) + to a section or a common symbol, then it needs a reloc. */ + if (sym && pe_data(output_bfd)->in_reloc_p (output_bfd, howto)) { - /* relocation to a symbol in a section which + /* Relocation to a symbol in a section which isn't absolute - we output the address here - to a file */ + to a file. */ bfd_vma addr = rel->r_vaddr - input_section->vma + input_section->output_offset + input_section->output_section->vma; - if (coff_data(output_bfd)->pe) - { - addr -= pe_data(output_bfd)->pe_opthdr.ImageBase; - } + if (coff_data (output_bfd)->pe) + addr -= pe_data (output_bfd)->pe_opthdr.ImageBase; + fwrite (&addr, 1,4, (FILE *) info->base_file); } } @@ -1595,15 +1586,12 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_vaddr - input_section->vma))) - { - return false; - } + return FALSE; } } - } - return true; + return TRUE; } #ifdef COFF_IMAGE_WITH_PE @@ -1677,7 +1665,7 @@ dump_toc (vfile) fprintf (file, "\n"); } -boolean +bfd_boolean ppc_allocate_toc_section (info) struct bfd_link_info *info ATTRIBUTE_UNUSED; { @@ -1686,21 +1674,17 @@ ppc_allocate_toc_section (info) bfd_size_type amt; static char test_char = '1'; - if ( global_toc_size == 0 ) /* FIXME: does this get me in trouble? */ - return true; + if ( global_toc_size == 0 ) /* FIXME: does this get me in trouble? */ + return TRUE; 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) - { - /* No toc section? Something is very wrong. */ - abort (); - } + /* No toc section? Something is very wrong. */ + abort (); amt = global_toc_size; foo = (bfd_byte *) bfd_alloc (bfd_of_toc_owner, amt); @@ -1709,10 +1693,10 @@ ppc_allocate_toc_section (info) s->_raw_size = s->_cooked_size = global_toc_size; s->contents = foo; - return true; + return TRUE; } -boolean +bfd_boolean ppc_process_before_allocation (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -1720,72 +1704,64 @@ ppc_process_before_allocation (abfd, info) asection *sec; struct internal_reloc *i, *rel; - /* here we have a bfd that is to be included on the link. We have a hook + /* 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); - _bfd_coff_get_external_symbols(abfd); - - /* rummage around all the relocs and map the toc */ + /* Rummage around all the relocs and map the toc. */ sec = abfd->sections; if (sec == 0) - { - return true; - } + return TRUE; for (; sec != 0; sec = sec->next) - { - if (sec->reloc_count == 0) - continue; + { + 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); + /* 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 (); + 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); - boolean ok = true; + for (rel = i; rel < i + sec->reloc_count; ++rel) + { + unsigned short r_type = EXTRACT_TYPE (rel->r_type); + unsigned short r_flags = EXTRACT_FLAGS (rel->r_type); + bfd_boolean ok = TRUE; - DUMP_RELOC2(ppc_coff_howto_table[r_type].name, rel); + DUMP_RELOC2 (ppc_coff_howto_table[r_type].name, rel); - 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, - rel->r_symndx, default_toc); - if (!ok) - return false; - break; - case IMAGE_REL_PPC_IMGLUE: - ppc_mark_symbol_as_glue(abfd, rel->r_symndx, rel); - break; - default: - break; - } - } - } + 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, + rel->r_symndx, default_toc); + if (!ok) + return FALSE; + break; + case IMAGE_REL_PPC_IMGLUE: + ppc_mark_symbol_as_glue (abfd, rel->r_symndx, rel); + break; + default: + break; + } + } + } - return true; + return TRUE; } #endif static bfd_reloc_status_type -ppc_refhi_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_refhi_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry ATTRIBUTE_UNUSED; asymbol *symbol ATTRIBUTE_UNUSED; @@ -1806,13 +1782,8 @@ ppc_refhi_reloc (abfd, #if 0 static bfd_reloc_status_type -ppc_reflo_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_reflo_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd; arelent *reloc_entry; asymbol *symbol; @@ -1833,13 +1804,8 @@ ppc_reflo_reloc (abfd, #endif static bfd_reloc_status_type -ppc_pair_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_pair_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry ATTRIBUTE_UNUSED; asymbol *symbol ATTRIBUTE_UNUSED; @@ -1858,13 +1824,8 @@ ppc_pair_reloc (abfd, } static bfd_reloc_status_type -ppc_toc16_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_toc16_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry ATTRIBUTE_UNUSED; asymbol *symbol ATTRIBUTE_UNUSED; @@ -1873,33 +1834,24 @@ ppc_toc16_reloc (abfd, bfd *output_bfd; char **error_message ATTRIBUTE_UNUSED; { - UN_IMPL("TOCREL16"); - DUMP_RELOC("TOCREL16",reloc_entry); + UN_IMPL ("TOCREL16"); + DUMP_RELOC ("TOCREL16",reloc_entry); if (output_bfd == (bfd *) NULL) - { - return bfd_reloc_continue; - } + return bfd_reloc_continue; return bfd_reloc_ok; } #if 0 -/* 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) */ -/* */ -/* */ +/* 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). */ static bfd_reloc_status_type -ppc_addr32nb_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_addr32nb_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd; arelent *reloc_entry; asymbol *symbol; @@ -1917,13 +1869,8 @@ ppc_addr32nb_reloc (abfd, #endif static bfd_reloc_status_type -ppc_secrel_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_secrel_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry ATTRIBUTE_UNUSED; asymbol *symbol ATTRIBUTE_UNUSED; @@ -1942,13 +1889,8 @@ ppc_secrel_reloc (abfd, } static bfd_reloc_status_type -ppc_section_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_section_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry ATTRIBUTE_UNUSED; asymbol *symbol ATTRIBUTE_UNUSED; @@ -1967,13 +1909,8 @@ ppc_section_reloc (abfd, } static bfd_reloc_status_type -ppc_imglue_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) +ppc_imglue_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message) bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry ATTRIBUTE_UNUSED; asymbol *symbol ATTRIBUTE_UNUSED; @@ -1994,19 +1931,16 @@ ppc_imglue_reloc (abfd, #define MAX_RELOC_INDEX \ (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, +/* FIXME: There is a possibility that when we read in a reloc from a file, 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, - struct internal_reloc *internal)); + type field. Not yet implemented. */ +static void ppc_coff_rtype2howto PARAMS ((arelent *, struct internal_reloc *)); 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: 1. IMAGE_REL_PPC_NEG - indicates the value field is a subtraction @@ -2015,19 +1949,18 @@ ppc_coff_rtype2howto (relent, internal) the branch is expected to be taken or not. 3. IMAGE_REL_PPC_TOCDEFN - toc slot definition in the file For now, we just strip this stuff to find the type, and ignore it other - than that. - */ + than that. */ reloc_howto_type *howto; unsigned short r_type = EXTRACT_TYPE (internal->r_type); 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. */ + /* 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 ) + /* Check for absolute crap. */ + if (junk != 0) abort (); switch(r_type) @@ -2040,15 +1973,15 @@ ppc_coff_rtype2howto (relent, internal) case IMAGE_REL_PPC_ADDR32NB: case IMAGE_REL_PPC_SECTION: case IMAGE_REL_PPC_SECREL: - DUMP_RELOC2(ppc_coff_howto_table[r_type].name, internal); + DUMP_RELOC2 (ppc_coff_howto_table[r_type].name, internal); howto = ppc_coff_howto_table + r_type; break; case IMAGE_REL_PPC_IMGLUE: - DUMP_RELOC2(ppc_coff_howto_table[r_type].name, internal); + DUMP_RELOC2 (ppc_coff_howto_table[r_type].name, internal); howto = ppc_coff_howto_table + r_type; break; case IMAGE_REL_PPC_TOCREL16: - DUMP_RELOC2(ppc_coff_howto_table[r_type].name, internal); + DUMP_RELOC2 (ppc_coff_howto_table[r_type].name, internal); if (r_flags & IMAGE_REL_PPC_TOCDEFN) howto = ppc_coff_howto_table + IMAGE_REL_PPC_TOCREL16_DEFN; else @@ -2064,7 +1997,6 @@ ppc_coff_rtype2howto (relent, internal) } relent->howto = howto; - } static reloc_howto_type * @@ -2086,19 +2018,18 @@ coff_ppc_rtype_to_howto (abfd, sec, rel, h, sym, addendp) the branch is expected to be taken or not. 3. IMAGE_REL_PPC_TOCDEFN - toc slot definition in the file For now, we just strip this stuff to find the type, and ignore it other - than that. - */ + than that. */ - unsigned short r_type = EXTRACT_TYPE (rel->r_type); - unsigned short r_flags = EXTRACT_FLAGS(rel->r_type); - unsigned short junk = EXTRACT_JUNK (rel->r_type); + unsigned short r_type = EXTRACT_TYPE (rel->r_type); + 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 ) + /* 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 ) + /* Check for absolute crap. */ + if (junk != 0) abort (); switch(r_type) @@ -2141,7 +2072,7 @@ coff_ppc_rtype_to_howto (abfd, sec, rel, h, sym, addendp) return howto; } -/* 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,ppc_rtype) \ case bfd_rtype: return &ppc_coff_howto_table[ppc_rtype] @@ -2167,7 +2098,6 @@ ppc_coff_reloc_type_lookup (abfd, code) default: return NULL; } - /*NOTREACHED*/ } #undef HOW2MAP @@ -2229,8 +2159,7 @@ ppc_coff_reloc_type_lookup (abfd, code) 2. It's not clear to me that being the last bfd read necessarily means that you are the last bfd closed. 3. Doing it on a "swap in" hook depends on when the "swap in" is called, - and how often, etc. It's not clear to me that there isn't a hole here. -*/ + and how often, etc. It's not clear to me that there isn't a hole here. */ static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR)); static void @@ -2239,21 +2168,19 @@ ppc_coff_swap_sym_in_hook (abfd, ext1, in1) PTR ext1 ATTRIBUTE_UNUSED; PTR in1; { - struct internal_syment *in = (struct internal_syment *)in1; + struct internal_syment * in = (struct internal_syment *)in1; - if (bfd_of_toc_owner != 0) /* we already have a toc, so go home */ + if (bfd_of_toc_owner != 0) /* We already have a toc, so go home. */ return; - if (strcmp(in->_n._n_name, ".toc") == 0) + if (strcmp (in->_n._n_name, ".toc") == 0) { flagword flags; register asection *s; - s = bfd_get_section_by_name ( abfd , TOC_SECTION_NAME); + s = bfd_get_section_by_name (abfd, TOC_SECTION_NAME); if (s != NULL) - { - return; - } + return; flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY ; @@ -2262,12 +2189,10 @@ ppc_coff_swap_sym_in_hook (abfd, ext1, in1) if (s == NULL || !bfd_set_section_flags (abfd, s, flags) || !bfd_set_section_alignment (abfd, s, 2)) - { - /* FIXME: set appropriate bfd error */ - abort (); - } + /* FIXME: set appropriate bfd error. */ + abort (); - /* save the bfd for later allocation */ + /* Save the bfd for later allocation. */ bfd_of_toc_owner = abfd; } @@ -2278,17 +2203,17 @@ ppc_coff_swap_sym_in_hook (abfd, ext1, in1) #ifndef COFF_IMAGE_WITH_PE -static boolean ppc_do_last PARAMS ((bfd *)); +static bfd_boolean ppc_do_last PARAMS ((bfd *)); static bfd *ppc_get_last PARAMS ((void)); -static boolean +static bfd_boolean ppc_do_last (abfd) bfd *abfd; { if (abfd == bfd_of_toc_owner) - return true; + return TRUE; else - return false; + return FALSE; } static bfd * @@ -2297,7 +2222,7 @@ ppc_get_last() return bfd_of_toc_owner; } -/* this piece of machinery exists only to guarantee that the bfd that holds +/* This piece of machinery exists only to guarantee that the bfd that holds the toc section is written last. This does depend on bfd_make_section attaching a new section to the @@ -2306,19 +2231,18 @@ ppc_get_last() 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 -*/ + precise form of comment. krk@cygnus.com */ /* Do the final link step. */ -boolean +bfd_boolean ppc_bfd_coff_final_link (abfd, info) bfd *abfd; struct bfd_link_info *info; { bfd_size_type symesz; struct coff_final_link_info finfo; - boolean debug_merge_allocated; + bfd_boolean debug_merge_allocated; asection *o; struct bfd_link_order *p; bfd_size_type max_sym_count; @@ -2351,7 +2275,7 @@ ppc_bfd_coff_final_link (abfd, info) finfo.contents = NULL; finfo.external_relocs = NULL; finfo.internal_relocs = NULL; - debug_merge_allocated = false; + debug_merge_allocated = FALSE; coff_data (abfd)->link_info = info; @@ -2361,13 +2285,13 @@ ppc_bfd_coff_final_link (abfd, info) if (! coff_debug_merge_hash_table_init (&finfo.debug_merge)) goto error_return; - debug_merge_allocated = true; + debug_merge_allocated = TRUE; /* Compute the file positions for all the sections. */ if (! abfd->output_has_begun) { if (! bfd_coff_compute_section_file_positions (abfd)) - return false; + return FALSE; } /* Count the line numbers and relocation entries required for the @@ -2382,9 +2306,9 @@ ppc_bfd_coff_final_link (abfd, info) { o->reloc_count = 0; o->lineno_count = 0; + for (p = o->link_order_head; p != NULL; p = p->next) { - if (p->type == bfd_indirect_link_order) { asection *sec; @@ -2395,13 +2319,13 @@ ppc_bfd_coff_final_link (abfd, info) link. This will normally be every section. We need to do this so that we can identify any sections which the linker has decided to not include. */ - sec->linker_mark = true; + sec->linker_mark = TRUE; if (info->strip == strip_none || info->strip == strip_some) o->lineno_count += sec->lineno_count; - if (info->relocateable) + if (info->relocatable) o->reloc_count += sec->reloc_count; if (sec->_raw_size > max_contents_size) @@ -2411,7 +2335,7 @@ ppc_bfd_coff_final_link (abfd, info) if (sec->reloc_count > max_reloc_count) max_reloc_count = sec->reloc_count; } - else if (info->relocateable + else if (info->relocatable && (p->type == bfd_section_reloc_link_order || p->type == bfd_symbol_reloc_link_order)) ++o->reloc_count; @@ -2426,9 +2350,9 @@ ppc_bfd_coff_final_link (abfd, info) } } - /* If doing a relocateable link, allocate space for the pointers we + /* If doing a relocatable link, allocate space for the pointers we need to keep. */ - if (info->relocateable) + if (info->relocatable) { unsigned int i; @@ -2437,8 +2361,10 @@ ppc_bfd_coff_final_link (abfd, info) amt = abfd->section_count + 1; amt *= sizeof (struct coff_link_section_info); finfo.section_info = (struct coff_link_section_info *) bfd_malloc (amt); + if (finfo.section_info == NULL) goto error_return; + for (i = 0; i <= abfd->section_count; i++) { finfo.section_info[i].relocs = NULL; @@ -2451,6 +2377,7 @@ ppc_bfd_coff_final_link (abfd, info) line_filepos = rel_filepos; linesz = bfd_coff_linesz (abfd); max_output_reloc_count = 0; + for (o = abfd->sections; o != NULL; o = o->next) { if (o->lineno_count == 0) @@ -2474,9 +2401,9 @@ ppc_bfd_coff_final_link (abfd, info) Because of this problem, we also keep the relocs in memory until the end of the link. This wastes memory, - but only when doing a relocateable link, which is not the + but only when doing a relocatable link, which is not the common case. */ - BFD_ASSERT (info->relocateable); + BFD_ASSERT (info->relocatable); amt = o->reloc_count; amt *= sizeof (struct internal_reloc); finfo.section_info[o->target_index].relocs = @@ -2509,7 +2436,7 @@ ppc_bfd_coff_final_link (abfd, info) { bfd_size_type sz; - sub->output_has_begun = false; + sub->output_has_begun = FALSE; sz = obj_raw_syment_count (sub); if (sz > max_sym_count) max_sym_count = sz; @@ -2528,7 +2455,7 @@ ppc_bfd_coff_final_link (abfd, info) finfo.linenos = (bfd_byte *) bfd_malloc (amt); finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size); finfo.external_relocs = (bfd_byte *) bfd_malloc (max_reloc_count * relsz); - if (! info->relocateable) + if (! info->relocatable) { amt = max_reloc_count * sizeof (struct internal_reloc); finfo.internal_relocs = (struct internal_reloc *) bfd_malloc (amt); @@ -2540,7 +2467,7 @@ ppc_bfd_coff_final_link (abfd, info) || (finfo.linenos == NULL && max_lineno_count > 0) || (finfo.contents == NULL && max_contents_size > 0) || (finfo.external_relocs == NULL && max_reloc_count > 0) - || (! info->relocateable + || (! info->relocatable && finfo.internal_relocs == NULL && max_reloc_count > 0)) goto error_return; @@ -2575,7 +2502,7 @@ ppc_bfd_coff_final_link (abfd, info) { if (! _bfd_coff_link_input_bfd (&finfo, sub)) goto error_return; - sub->output_has_begun = true; + sub->output_has_begun = TRUE; } } else if (p->type == bfd_section_reloc_link_order @@ -2600,14 +2527,13 @@ ppc_bfd_coff_final_link (abfd, info) if (! _bfd_coff_link_input_bfd (&finfo, last_one)) goto error_return; } - last_one->output_has_begun = true; + last_one->output_has_begun = TRUE; } #endif /* Free up the buffers used by _bfd_coff_link_input_bfd. */ - coff_debug_merge_hash_table_free (&finfo.debug_merge); - debug_merge_allocated = false; + debug_merge_allocated = FALSE; if (finfo.internal_syms != NULL) { @@ -2659,11 +2585,11 @@ ppc_bfd_coff_final_link (abfd, info) pos = obj_sym_filepos (abfd) + finfo.last_file_index * symesz; if (bfd_seek (abfd, pos, SEEK_SET) != 0 || bfd_bwrite (finfo.outsyms, symesz, abfd) != symesz) - return false; + return FALSE; } /* Write out the global symbols. */ - finfo.failed = false; + finfo.failed = FALSE; coff_link_hash_traverse (coff_hash_table (info), _bfd_coff_write_global_sym, (PTR) &finfo); if (finfo.failed) @@ -2676,7 +2602,7 @@ ppc_bfd_coff_final_link (abfd, info) finfo.outsyms = NULL; } - if (info->relocateable) + if (info->relocatable) { /* Now that we have written out all the global symbols, we know the symbol indices to use for relocs against them, and we can @@ -2740,7 +2666,7 @@ ppc_bfd_coff_final_link (abfd, info) if (coff_hash_table (info)->stab_info != NULL) { if (! _bfd_write_stab_strings (abfd, &coff_hash_table (info)->stab_info)) - return false; + return FALSE; } /* Write out the string table. */ @@ -2750,7 +2676,7 @@ ppc_bfd_coff_final_link (abfd, info) pos = obj_sym_filepos (abfd) + obj_raw_syment_count (abfd) * symesz; if (bfd_seek (abfd, pos, SEEK_SET) != 0) - return false; + return FALSE; #if STRING_SIZE_SIZE == 4 H_PUT_32 (abfd, @@ -2762,10 +2688,10 @@ ppc_bfd_coff_final_link (abfd, info) if (bfd_bwrite (strbuf, (bfd_size_type) STRING_SIZE_SIZE, abfd) != STRING_SIZE_SIZE) - return false; + return FALSE; if (! _bfd_stringtab_emit (abfd, finfo.strtab)) - return false; + return FALSE; } _bfd_stringtab_free (finfo.strtab); @@ -2774,7 +2700,7 @@ ppc_bfd_coff_final_link (abfd, info) not try to write out the symbols. */ bfd_get_symcount (abfd) = 0; - return true; + return TRUE; error_return: if (debug_merge_allocated) @@ -2812,7 +2738,7 @@ ppc_bfd_coff_final_link (abfd, info) free (finfo.internal_relocs); if (external_relocs != NULL) free (external_relocs); - return false; + return FALSE; } #endif diff --git a/contrib/binutils/bfd/coff-rs6000.c b/contrib/binutils/bfd/coff-rs6000.c index 5a0b8aa..56e34e2 100644 --- a/contrib/binutils/bfd/coff-rs6000.c +++ b/contrib/binutils/bfd/coff-rs6000.c @@ -1,5 +1,5 @@ /* BFD back-end for IBM RS/6000 "XCOFF" files. - Copyright 1990-1999, 2000, 2001, 2002 + Copyright 1990-1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. FIXME: Can someone provide a transliteration of this name into ASCII? Using the following chars caused a compiler warning on HIUX (so I replaced @@ -36,29 +36,46 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libcoff.h" #include "libxcoff.h" -extern boolean _bfd_xcoff_mkobject PARAMS ((bfd *)); -extern boolean _bfd_xcoff_copy_private_bfd_data PARAMS ((bfd *, bfd *)); -extern boolean _bfd_xcoff_is_local_label_name PARAMS ((bfd *, const char *)); +extern bfd_boolean _bfd_xcoff_mkobject + PARAMS ((bfd *)); +extern bfd_boolean _bfd_xcoff_copy_private_bfd_data + PARAMS ((bfd *, bfd *)); +extern bfd_boolean _bfd_xcoff_is_local_label_name + PARAMS ((bfd *, const char *)); extern reloc_howto_type *_bfd_xcoff_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); -extern boolean _bfd_xcoff_slurp_armap PARAMS ((bfd *)); -extern const bfd_target *_bfd_xcoff_archive_p PARAMS ((bfd *)); -extern PTR _bfd_xcoff_read_ar_hdr PARAMS ((bfd *)); -extern bfd *_bfd_xcoff_openr_next_archived_file PARAMS ((bfd *, bfd *)); -extern int _bfd_xcoff_stat_arch_elt PARAMS ((bfd *, struct stat *)); -extern boolean _bfd_xcoff_write_armap +extern bfd_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_stat_arch_elt + PARAMS ((bfd *, struct stat *)); +extern bfd_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)); -static void xcoff_swap_reloc_in PARAMS ((bfd *, PTR, PTR)); -static unsigned int xcoff_swap_reloc_out PARAMS ((bfd *, PTR, PTR)); +extern bfd_boolean _bfd_xcoff_write_archive_contents + PARAMS ((bfd *)); +extern int _bfd_xcoff_sizeof_headers + PARAMS ((bfd *, 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)); +static void xcoff_swap_reloc_in + PARAMS ((bfd *, PTR, PTR)); +static unsigned int xcoff_swap_reloc_out + PARAMS ((bfd *, PTR, PTR)); /* Forward declare xcoff_rtype2howto for coffcode.h macro. */ -void xcoff_rtype2howto PARAMS ((arelent *, struct internal_reloc *)); +void xcoff_rtype2howto + PARAMS ((arelent *, struct internal_reloc *)); /* coffcode.h needs these to be defined. */ #define RS6000COFF_C 1 @@ -82,11 +99,14 @@ void xcoff_rtype2howto PARAMS ((arelent *, struct internal_reloc *)); #define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name #define coff_bfd_reloc_type_lookup _bfd_xcoff_reloc_type_lookup #ifdef AIX_CORE -extern const bfd_target * rs6000coff_core_p PARAMS ((bfd *abfd)); -extern boolean rs6000coff_core_file_matches_executable_p +extern const bfd_target * rs6000coff_core_p + PARAMS ((bfd *abfd)); +extern bfd_boolean rs6000coff_core_file_matches_executable_p PARAMS ((bfd *cbfd, bfd *ebfd)); -extern char *rs6000coff_core_file_failing_command PARAMS ((bfd *abfd)); -extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd)); +extern char *rs6000coff_core_file_failing_command + PARAMS ((bfd *abfd)); +extern int rs6000coff_core_file_failing_signal + PARAMS ((bfd *abfd)); #define CORE_FILE_P rs6000coff_core_p #define coff_core_file_failing_command \ rs6000coff_core_file_failing_command @@ -115,13 +135,16 @@ extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd)); /* The main body of code is in coffcode.h. */ -static const char *normalize_filename PARAMS ((bfd *)); -static boolean xcoff_write_armap_old +static const char *normalize_filename + PARAMS ((bfd *)); +static bfd_boolean xcoff_write_armap_old PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); -static boolean xcoff_write_armap_big +static bfd_boolean xcoff_write_armap_big PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); -static boolean xcoff_write_archive_contents_old PARAMS ((bfd *)); -static boolean xcoff_write_archive_contents_big PARAMS ((bfd *)); +static bfd_boolean xcoff_write_archive_contents_old + PARAMS ((bfd *)); +static bfd_boolean xcoff_write_archive_contents_big + PARAMS ((bfd *)); static void xcoff_swap_ldhdr_in PARAMS ((bfd *, const PTR, struct internal_ldhdr *)); static void xcoff_swap_ldhdr_out @@ -134,72 +157,78 @@ static void xcoff_swap_ldrel_in PARAMS ((bfd *, const PTR, struct internal_ldrel *)); static void xcoff_swap_ldrel_out PARAMS ((bfd *, const struct internal_ldrel *, PTR)); -static boolean xcoff_ppc_relocate_section +static bfd_boolean xcoff_ppc_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **)); -static boolean _bfd_xcoff_put_ldsymbol_name +static bfd_boolean _bfd_xcoff_put_ldsymbol_name PARAMS ((bfd *, struct xcoff_loader_info *, struct internal_ldsym *, const char *)); static asection *xcoff_create_csect_from_smclas PARAMS ((bfd *, union internal_auxent *, const char *)); -static boolean xcoff_is_lineno_count_overflow PARAMS ((bfd *, bfd_vma)); -static boolean xcoff_is_reloc_count_overflow PARAMS ((bfd *, bfd_vma)); +static bfd_boolean xcoff_is_lineno_count_overflow + PARAMS ((bfd *, bfd_vma)); +static bfd_boolean xcoff_is_reloc_count_overflow + PARAMS ((bfd *, bfd_vma)); static bfd_vma xcoff_loader_symbol_offset PARAMS ((bfd *, struct internal_ldhdr *)); static bfd_vma xcoff_loader_reloc_offset PARAMS ((bfd *, struct internal_ldhdr *)); -static boolean xcoff_generate_rtinit - PARAMS((bfd *, const char *, const char *, boolean)); -static boolean do_pad PARAMS((bfd *, unsigned int)); -static boolean do_copy PARAMS((bfd *, bfd *)); -static boolean do_shared_object_padding PARAMS ((bfd *, bfd *, ufile_ptr *, int)); +static bfd_boolean xcoff_generate_rtinit + PARAMS ((bfd *, const char *, const char *, bfd_boolean)); +static bfd_boolean do_pad + PARAMS ((bfd *, unsigned int)); +static bfd_boolean do_copy + PARAMS ((bfd *, bfd *)); +static bfd_boolean do_shared_object_padding + PARAMS ((bfd *, bfd *, ufile_ptr *, int)); /* Relocation functions */ -static boolean xcoff_reloc_type_br PARAMS ((XCOFF_RELOC_FUNCTION_ARGS)); +static bfd_boolean xcoff_reloc_type_br + PARAMS ((XCOFF_RELOC_FUNCTION_ARGS)); -static boolean xcoff_complain_overflow_dont_func +static bfd_boolean xcoff_complain_overflow_dont_func PARAMS ((XCOFF_COMPLAIN_FUNCTION_ARGS)); -static boolean xcoff_complain_overflow_bitfield_func +static bfd_boolean xcoff_complain_overflow_bitfield_func PARAMS ((XCOFF_COMPLAIN_FUNCTION_ARGS)); -static boolean xcoff_complain_overflow_signed_func +static bfd_boolean xcoff_complain_overflow_signed_func PARAMS ((XCOFF_COMPLAIN_FUNCTION_ARGS)); -static boolean xcoff_complain_overflow_unsigned_func +static bfd_boolean xcoff_complain_overflow_unsigned_func PARAMS ((XCOFF_COMPLAIN_FUNCTION_ARGS)); -boolean (*xcoff_calculate_relocation[XCOFF_MAX_CALCULATE_RELOCATION]) +bfd_boolean (*xcoff_calculate_relocation[XCOFF_MAX_CALCULATE_RELOCATION]) PARAMS ((XCOFF_RELOC_FUNCTION_ARGS)) = { - xcoff_reloc_type_pos, /* R_POS (0x00) */ - xcoff_reloc_type_neg, /* R_NEG (0x01) */ - xcoff_reloc_type_rel, /* R_REL (0x02) */ - xcoff_reloc_type_toc, /* R_TOC (0x03) */ + xcoff_reloc_type_pos, /* R_POS (0x00) */ + xcoff_reloc_type_neg, /* R_NEG (0x01) */ + xcoff_reloc_type_rel, /* R_REL (0x02) */ + xcoff_reloc_type_toc, /* R_TOC (0x03) */ xcoff_reloc_type_fail, /* R_RTB (0x04) */ - xcoff_reloc_type_toc, /* R_GL (0x05) */ - xcoff_reloc_type_toc, /* R_TCL (0x06) */ - xcoff_reloc_type_fail, /* (0x07) */ - xcoff_reloc_type_ba, /* R_BA (0x08) */ - xcoff_reloc_type_fail, /* (0x09) */ - xcoff_reloc_type_br, /* R_BR (0x0a) */ - xcoff_reloc_type_fail, /* (0x0b) */ - xcoff_reloc_type_pos, /* R_RL (0x0c) */ - xcoff_reloc_type_pos, /* R_RLA (0x0d) */ - xcoff_reloc_type_fail, /* (0x0e) */ + xcoff_reloc_type_toc, /* R_GL (0x05) */ + xcoff_reloc_type_toc, /* R_TCL (0x06) */ + xcoff_reloc_type_fail, /* (0x07) */ + xcoff_reloc_type_ba, /* R_BA (0x08) */ + xcoff_reloc_type_fail, /* (0x09) */ + xcoff_reloc_type_br, /* R_BR (0x0a) */ + xcoff_reloc_type_fail, /* (0x0b) */ + xcoff_reloc_type_pos, /* R_RL (0x0c) */ + xcoff_reloc_type_pos, /* R_RLA (0x0d) */ + xcoff_reloc_type_fail, /* (0x0e) */ xcoff_reloc_type_noop, /* R_REF (0x0f) */ - xcoff_reloc_type_fail, /* (0x10) */ - xcoff_reloc_type_fail, /* (0x11) */ - xcoff_reloc_type_toc, /* R_TRL (0x12) */ - xcoff_reloc_type_toc, /* R_TRLA (0x13) */ + xcoff_reloc_type_fail, /* (0x10) */ + xcoff_reloc_type_fail, /* (0x11) */ + xcoff_reloc_type_toc, /* R_TRL (0x12) */ + xcoff_reloc_type_toc, /* R_TRLA (0x13) */ xcoff_reloc_type_fail, /* R_RRTBI (0x14) */ xcoff_reloc_type_fail, /* R_RRTBA (0x15) */ - xcoff_reloc_type_ba, /* R_CAI (0x16) */ + xcoff_reloc_type_ba, /* R_CAI (0x16) */ xcoff_reloc_type_crel, /* R_CREL (0x17) */ - xcoff_reloc_type_ba, /* R_RBA (0x18) */ - xcoff_reloc_type_ba, /* R_RBAC (0x19) */ - xcoff_reloc_type_br, /* R_RBR (0x1a) */ - xcoff_reloc_type_ba, /* R_RBRC (0x1b) */ + xcoff_reloc_type_ba, /* R_RBA (0x18) */ + xcoff_reloc_type_ba, /* R_RBAC (0x19) */ + xcoff_reloc_type_br, /* R_RBR (0x1a) */ + xcoff_reloc_type_ba, /* R_RBRC (0x1b) */ }; -boolean (*xcoff_complain_overflow[XCOFF_MAX_COMPLAIN_OVERFLOW]) +bfd_boolean (*xcoff_complain_overflow[XCOFF_MAX_COMPLAIN_OVERFLOW]) PARAMS ((XCOFF_COMPLAIN_FUNCTION_ARGS)) = { xcoff_complain_overflow_dont_func, @@ -211,7 +240,7 @@ boolean (*xcoff_complain_overflow[XCOFF_MAX_COMPLAIN_OVERFLOW]) /* We use our own tdata type. Its first field is the COFF tdata type, so the COFF routines are compatible. */ -boolean +bfd_boolean _bfd_xcoff_mkobject (abfd) bfd *abfd; { @@ -220,7 +249,7 @@ _bfd_xcoff_mkobject (abfd) abfd->tdata.xcoff_obj_data = (struct xcoff_tdata *) bfd_zalloc (abfd, amt); if (abfd->tdata.xcoff_obj_data == NULL) - return false; + return FALSE; coff = coff_data (abfd); coff->symbols = (coff_symbol_type *) NULL; coff->conversion_table = (unsigned int *) NULL; @@ -239,12 +268,12 @@ _bfd_xcoff_mkobject (abfd) /* text section alignment is different than the default */ bfd_xcoff_text_align_power (abfd) = 2; - return true; + return TRUE; } /* Copy XCOFF data from one BFD to another. */ -boolean +bfd_boolean _bfd_xcoff_copy_private_bfd_data (ibfd, obfd) bfd *ibfd; bfd *obfd; @@ -253,7 +282,7 @@ _bfd_xcoff_copy_private_bfd_data (ibfd, obfd) asection *sec; if (ibfd->xvec != obfd->xvec) - return true; + return TRUE; ix = xcoff_data (ibfd); ox = xcoff_data (obfd); ox->full_aouthdr = ix->full_aouthdr; @@ -284,7 +313,7 @@ _bfd_xcoff_copy_private_bfd_data (ibfd, obfd) ox->cputype = ix->cputype; ox->maxdata = ix->maxdata; ox->maxstack = ix->maxstack; - return true; + return TRUE; } /* I don't think XCOFF really has a notion of local labels based on @@ -292,17 +321,17 @@ _bfd_xcoff_copy_private_bfd_data (ibfd, obfd) The AIX native linker does not have a -X option, and it ignores the -x option. */ -boolean +bfd_boolean _bfd_xcoff_is_local_label_name (abfd, name) bfd *abfd ATTRIBUTE_UNUSED; const char *name ATTRIBUTE_UNUSED; { - return false; + return FALSE; } void _bfd_xcoff_swap_sym_in (abfd, ext1, in1) - bfd *abfd; + bfd *abfd; PTR ext1; PTR in1; { @@ -311,7 +340,7 @@ _bfd_xcoff_swap_sym_in (abfd, ext1, in1) if (ext->e.e_name[0] != 0) { - memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN); + memcpy (in->_n._n_name, ext->e.e_name, SYMNMLEN); } else { @@ -328,16 +357,16 @@ _bfd_xcoff_swap_sym_in (abfd, ext1, in1) unsigned int _bfd_xcoff_swap_sym_out (abfd, inp, extp) - bfd *abfd; - PTR inp; - PTR extp; + bfd *abfd; + PTR inp; + PTR extp; { struct internal_syment *in = (struct internal_syment *)inp; SYMENT *ext =(SYMENT *)extp; if (in->_n._n_name[0] != 0) { - memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN); + memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN); } else { @@ -355,13 +384,13 @@ _bfd_xcoff_swap_sym_out (abfd, inp, extp) 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; + 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; @@ -418,7 +447,7 @@ _bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) in->x_scn.x_nreloc = H_GET_16 (abfd, ext->x_scn.x_nreloc); in->x_scn.x_nlinno = H_GET_16 (abfd, ext->x_scn.x_nlinno); /* PE defines some extra fields; we zero them out for - safety. */ + safety. */ in->x_scn.x_checksum = 0; in->x_scn.x_associated = 0; in->x_scn.x_comdat = 0; @@ -468,7 +497,8 @@ _bfd_xcoff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) } -unsigned int _bfd_xcoff_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR)); +unsigned int _bfd_xcoff_swap_aux_out + PARAMS ((bfd *, PTR, int, int, int, int, PTR)); unsigned int _bfd_xcoff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) @@ -483,7 +513,7 @@ _bfd_xcoff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) union internal_auxent *in = (union internal_auxent *)inp; AUXENT *ext = (AUXENT *)extp; - memset((PTR)ext, 0, bfd_coff_auxesz (abfd)); + memset ((PTR)ext, 0, bfd_coff_auxesz (abfd)); switch (class) { case C_FILE: @@ -578,390 +608,390 @@ end: reloc_howto_type xcoff_howto_table[] = { /* Standard 32 bit relocation. */ - HOWTO (R_POS, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_POS, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_POS", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + 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 (R_NEG, /* type */ - 0, /* rightshift */ - -2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_NEG, /* 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 */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_NEG", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* 32 bit PC relative relocation. */ - HOWTO (R_REL, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_REL, /* 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 */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_REL", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* 16 bit TOC relative relocation. */ - HOWTO (R_TOC, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_TOC, /* 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 */ - false), /* pcrel_offset */ + 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 (R_RTB, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RTB, /* 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 */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RTB", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* External TOC relative symbol. */ - HOWTO (R_GL, /* type */ - 0, /* rightshift */ + HOWTO (R_GL, /* type */ + 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + 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 */ - false), /* pcrel_offset */ - - /* Local TOC relative symbol. */ - HOWTO (R_TCL, /* type */ - 0, /* rightshift */ + 0, /* special_function */ + "R_GL", /* name */ + TRUE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Local TOC relative symbol. */ + HOWTO (R_TCL, /* type */ + 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + 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 */ - false), /* pcrel_offset */ + 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 (R_BA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_BA, /* 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_26", /* name */ - true, /* partial_inplace */ + 0, /* special_function */ + "R_BA_26", /* name */ + TRUE, /* partial_inplace */ 0x03fffffc, /* src_mask */ 0x03fffffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ EMPTY_HOWTO (9), /* Non modifiable relative branch. */ - HOWTO (R_BR, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_BR, /* 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 */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_BR", /* name */ + TRUE, /* partial_inplace */ + 0x03fffffc, /* src_mask */ + 0x03fffffc, /* dst_mask */ + FALSE), /* pcrel_offset */ EMPTY_HOWTO (0xb), /* Indirect load. */ - HOWTO (R_RL, /* type */ - 0, /* rightshift */ + HOWTO (R_RL, /* type */ + 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + 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 */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RL", /* name */ + TRUE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Load address. */ - HOWTO (R_RLA, /* type */ - 0, /* rightshift */ + HOWTO (R_RLA, /* type */ + 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + 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 */ - false), /* pcrel_offset */ + 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 (R_REF, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_REF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - 0, /* special_function */ - "R_REF", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ + 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 (R_TRL, /* type */ - 0, /* rightshift */ + HOWTO (R_TRL, /* type */ + 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + 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 */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_TRL", /* name */ + TRUE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* TOC relative load address. */ - HOWTO (R_TRLA, /* type */ - 0, /* rightshift */ + HOWTO (R_TRLA, /* type */ + 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + 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 */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_TRLA", /* name */ + TRUE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Modifiable relative branch. */ - HOWTO (R_RRTBI, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RRTBI, /* 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 */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RRTBI", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Modifiable absolute branch. */ - HOWTO (R_RRTBA, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RRTBA, /* 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 */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RRTBA", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Modifiable call absolute indirect. */ - HOWTO (R_CAI, /* type */ - 0, /* rightshift */ + HOWTO (R_CAI, /* type */ + 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + 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 */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_CAI", /* name */ + TRUE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Modifiable call relative. */ - HOWTO (R_CREL, /* type */ - 0, /* rightshift */ + HOWTO (R_CREL, /* type */ + 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + 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 */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_CREL", /* name */ + TRUE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Modifiable branch absolute. */ - HOWTO (R_RBA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RBA, /* 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 */ + 0, /* special_function */ + "R_RBA", /* name */ + TRUE, /* partial_inplace */ 0x03fffffc, /* src_mask */ 0x03fffffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Modifiable branch absolute. */ - HOWTO (R_RBAC, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RBAC, /* 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 */ + 0, /* special_function */ + "R_RBAC", /* name */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Modifiable branch relative. */ - HOWTO (R_RBR, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RBR, /* 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_26", /* name */ - true, /* partial_inplace */ + 0, /* special_function */ + "R_RBR_26", /* name */ + TRUE, /* partial_inplace */ 0x03fffffc, /* src_mask */ 0x03fffffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Modifiable branch absolute. */ - HOWTO (R_RBRC, /* type */ - 0, /* rightshift */ + HOWTO (R_RBRC, /* type */ + 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + 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 */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RBRC", /* name */ + TRUE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* 16 bit Non modifiable absolute branch. */ - HOWTO (R_BA, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_BA, /* 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_BA_16", /* name */ - true, /* partial_inplace */ - 0xfffc, /* src_mask */ - 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_BA_16", /* name */ + TRUE, /* partial_inplace */ + 0xfffc, /* src_mask */ + 0xfffc, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Modifiable branch relative. */ - HOWTO (R_RBR, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RBR, /* 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_RBR_16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RBR_16", /* name */ + TRUE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Modifiable branch relative. */ - HOWTO (R_RBA, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RBA, /* 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_RBA_16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RBA_16", /* name */ + TRUE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ }; @@ -975,18 +1005,18 @@ xcoff_rtype2howto (relent, internal) /* Default howto layout works most of the time */ relent->howto = &xcoff_howto_table[internal->r_type]; - - /* Special case some 16 bit reoloc */ + + /* Special case some 16 bit reloc */ if (15 == (internal->r_size & 0x1f)) { - if (R_BA == internal->r_type) + if (R_BA == internal->r_type) relent->howto = &xcoff_howto_table[0x1c]; - else if (R_RBR == internal->r_type) + else if (R_RBR == internal->r_type) relent->howto = &xcoff_howto_table[0x1d]; - else if (R_RBA == internal->r_type) + else if (R_RBA == internal->r_type) relent->howto = &xcoff_howto_table[0x1e]; } - + /* 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 @@ -1069,19 +1099,19 @@ _bfd_xcoff_reloc_type_lookup (abfd, code) /* Set the magic for archive. */ -boolean +bfd_boolean bfd_xcoff_ar_archive_set_magic (abfd, magic) bfd *abfd ATTRIBUTE_UNUSED; char *magic ATTRIBUTE_UNUSED; { /* Not supported yet. */ - return false; + return FALSE; /* bfd_xcoff_archive_set_magic (abfd, magic); */ } /* Read in the armap of an XCOFF archive. */ -boolean +bfd_boolean _bfd_xcoff_slurp_armap (abfd) bfd *abfd; { @@ -1095,8 +1125,8 @@ _bfd_xcoff_slurp_armap (abfd) if (xcoff_ardata (abfd) == NULL) { - bfd_has_map (abfd) = false; - return true; + bfd_has_map (abfd) = FALSE; + return TRUE; } if (! xcoff_big_format_p (abfd)) @@ -1107,32 +1137,32 @@ _bfd_xcoff_slurp_armap (abfd) off = strtol (xcoff_ardata (abfd)->symoff, (char **) NULL, 10); if (off == 0) { - bfd_has_map (abfd) = false; - return true; + bfd_has_map (abfd) = FALSE; + return TRUE; } if (bfd_seek (abfd, off, SEEK_SET) != 0) - return false; + return FALSE; /* The symbol table starts with a normal archive header. */ if (bfd_bread ((PTR) &hdr, (bfd_size_type) SIZEOF_AR_HDR, abfd) != SIZEOF_AR_HDR) - return false; + return FALSE; /* Skip the name (normally empty). */ namlen = strtol (hdr.namlen, (char **) NULL, 10); off = ((namlen + 1) & ~ (size_t) 1) + SXCOFFARFMAG; if (bfd_seek (abfd, off, SEEK_CUR) != 0) - return false; + 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; + return FALSE; if (bfd_bread ((PTR) contents, sz, abfd) != sz) - return false; + return FALSE; /* The symbol table starts with a four byte count. */ c = H_GET_32 (abfd, contents); @@ -1140,13 +1170,13 @@ _bfd_xcoff_slurp_armap (abfd) if (c * 4 >= sz) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } bfd_ardata (abfd)->symdefs = ((carsym *) bfd_alloc (abfd, c * sizeof (carsym))); if (bfd_ardata (abfd)->symdefs == NULL) - return false; + return FALSE; /* After the count comes a list of four byte file offsets. */ for (i = 0, arsym = bfd_ardata (abfd)->symdefs, p = contents + 4; @@ -1162,23 +1192,23 @@ _bfd_xcoff_slurp_armap (abfd) off = strtol (xcoff_ardata_big (abfd)->symoff, (char **) NULL, 10); if (off == 0) { - bfd_has_map (abfd) = false; - return true; + bfd_has_map (abfd) = FALSE; + return TRUE; } if (bfd_seek (abfd, off, SEEK_SET) != 0) - return false; + return FALSE; /* The symbol table starts with a normal archive header. */ if (bfd_bread ((PTR) &hdr, (bfd_size_type) SIZEOF_AR_HDR_BIG, abfd) != SIZEOF_AR_HDR_BIG) - return false; + return FALSE; /* Skip the name (normally empty). */ namlen = strtol (hdr.namlen, (char **) NULL, 10); off = ((namlen + 1) & ~ (size_t) 1) + SXCOFFARFMAG; if (bfd_seek (abfd, off, SEEK_CUR) != 0) - return false; + return FALSE; /* XXX This actually has to be a call to strtoll (at least on 32-bit machines) since the field width is 20 and there numbers with more @@ -1188,9 +1218,9 @@ _bfd_xcoff_slurp_armap (abfd) /* Read in the entire symbol table. */ contents = (bfd_byte *) bfd_alloc (abfd, sz); if (contents == NULL) - return false; + return FALSE; if (bfd_bread ((PTR) contents, sz, abfd) != sz) - return false; + return FALSE; /* The symbol table starts with an eight byte count. */ c = H_GET_64 (abfd, contents); @@ -1198,13 +1228,13 @@ _bfd_xcoff_slurp_armap (abfd) if (c * 8 >= sz) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } bfd_ardata (abfd)->symdefs = ((carsym *) bfd_alloc (abfd, c * sizeof (carsym))); if (bfd_ardata (abfd)->symdefs == NULL) - return false; + return FALSE; /* After the count comes a list of eight byte file offsets. */ for (i = 0, arsym = bfd_ardata (abfd)->symdefs, p = contents + 8; @@ -1222,15 +1252,15 @@ _bfd_xcoff_slurp_armap (abfd) if (p >= cend) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } arsym->name = (char *) p; } bfd_ardata (abfd)->symdef_count = c; - bfd_has_map (abfd) = true; + bfd_has_map (abfd) = TRUE; - return true; + return TRUE; } /* See if this is an XCOFF archive. */ @@ -1545,8 +1575,7 @@ normalize_filename (abfd) /* Write out an XCOFF armap. */ -/*ARGSUSED*/ -static boolean +static bfd_boolean xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) bfd *abfd; unsigned int elength ATTRIBUTE_UNUSED; @@ -1580,11 +1609,11 @@ xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) != SIZEOF_AR_HDR || (bfd_bwrite (XCOFFARFMAG, (bfd_size_type) SXCOFFARFMAG, abfd) != SXCOFFARFMAG)) - return false; + return FALSE; H_PUT_32 (abfd, orl_count, buf); if (bfd_bwrite (buf, (bfd_size_type) 4, abfd) != 4) - return false; + return FALSE; sub = abfd->archive_head; fileoff = SIZEOF_AR_FILE_HDR; @@ -1597,7 +1626,7 @@ xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) { H_PUT_32 (abfd, fileoff, buf); if (bfd_bwrite (buf, (bfd_size_type) 4, abfd) != 4) - return false; + return FALSE; ++i; } namlen = strlen (normalize_filename (sub)); @@ -1618,7 +1647,7 @@ xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) name = *map[i].name; namlen = strlen (name); if (bfd_bwrite (name, (bfd_size_type) (namlen + 1), abfd) != namlen + 1) - return false; + return FALSE; } if ((stridx & 1) != 0) @@ -1627,10 +1656,10 @@ xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) b = '\0'; if (bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1) - return false; + return FALSE; } - return true; + return TRUE; } static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1]; @@ -1644,7 +1673,7 @@ static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1]; #define PRINT12(d, v) \ sprintf (buff20, FMT12, (int)(v)), \ - memcpy ((void *) (d), buff20, 12) + memcpy ((void *) (d), buff20, 12) #define PRINT12_OCTAL(d, v) \ sprintf (buff20, FMT12_OCTAL, (unsigned int)(v)), \ @@ -1652,14 +1681,14 @@ static char buff20[XCOFFARMAGBIG_ELEMENT_SIZE + 1]; #define PRINT4(d, v) \ sprintf (buff20, FMT4, (int)(v)), \ - memcpy ((void *) (d), buff20, 4) + memcpy ((void *) (d), buff20, 4) #define READ20(d, v) \ buff20[20] = 0, \ memcpy (buff20, (d), 20), \ (v) = bfd_scan_vma (buff20, (const char **) NULL, 10) -static boolean +static bfd_boolean do_pad (abfd, number) bfd *abfd; unsigned int number; @@ -1668,16 +1697,16 @@ do_pad (abfd, number) /* Limit pad to <= 4096. */ if (number > 4096) - return false; + return FALSE; while (number--) if (bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1) - return false; + return FALSE; - return true; + return TRUE; } -static boolean +static bfd_boolean do_copy (out_bfd, in_bfd) bfd *out_bfd; bfd *in_bfd; @@ -1686,7 +1715,7 @@ do_copy (out_bfd, in_bfd) bfd_byte buffer[DEFAULT_BUFFERSIZE]; if (bfd_seek (in_bfd, (file_ptr) 0, SEEK_SET) != 0) - return false; + return FALSE; remaining = arelt_size (in_bfd); @@ -1694,22 +1723,22 @@ do_copy (out_bfd, in_bfd) { if (bfd_bread (buffer, DEFAULT_BUFFERSIZE, in_bfd) != DEFAULT_BUFFERSIZE || bfd_bwrite (buffer, DEFAULT_BUFFERSIZE, out_bfd) != DEFAULT_BUFFERSIZE) - return false; + return FALSE; remaining -= DEFAULT_BUFFERSIZE; } if (remaining) { - if (bfd_bread (buffer, remaining, in_bfd) != remaining + if (bfd_bread (buffer, remaining, in_bfd) != remaining || bfd_bwrite (buffer, remaining, out_bfd) != remaining) - return false; + return FALSE; } - return true; + return TRUE; } -static boolean +static bfd_boolean do_shared_object_padding (out_bfd, in_bfd, offset, ar_header_size) bfd *out_bfd; bfd *in_bfd; @@ -1729,15 +1758,15 @@ do_shared_object_padding (out_bfd, in_bfd, offset, ar_header_size) pad -= (*offset + ar_header_size) & (pad - 1); if (! do_pad (out_bfd, pad)) - return false; + return FALSE; *offset += pad; } - return true; + return TRUE; } -static boolean +static bfd_boolean xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) bfd *abfd; unsigned int elength ATTRIBUTE_UNUSED; @@ -1751,7 +1780,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) bfd *current_bfd; size_t string_length; ufile_ptr nextoff, prevoff; - + /* First, we look through the symbols and work out which are from 32-bit objects and which from 64-bit ones. */ sym_32 = sym_64 = str_32 = str_64 = 0; @@ -1796,50 +1825,50 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) BFD_ASSERT (nextoff == bfd_tell (abfd)); - /* Write out the symbol table. - Layout : - + /* Write out the symbol table. + Layout : + standard big archive header - 0x0000 ar_size [0x14] - 0x0014 ar_nxtmem [0x14] - 0x0028 ar_prvmem [0x14] - 0x003C ar_date [0x0C] - 0x0048 ar_uid [0x0C] - 0x0054 ar_gid [0x0C] - 0x0060 ar_mod [0x0C] - 0x006C ar_namelen[0x04] - 0x0070 ar_fmag [SXCOFFARFMAG] - - Symbol table - 0x0072 num_syms [0x08], binary - 0x0078 offsets [0x08 * num_syms], binary - 0x0086 + 0x08 * num_syms names [??] - ?? pad to even bytes. + 0x0000 ar_size [0x14] + 0x0014 ar_nxtmem [0x14] + 0x0028 ar_prvmem [0x14] + 0x003C ar_date [0x0C] + 0x0048 ar_uid [0x0C] + 0x0054 ar_gid [0x0C] + 0x0060 ar_mod [0x0C] + 0x006C ar_namelen[0x04] + 0x0070 ar_fmag [SXCOFFARFMAG] + + Symbol table + 0x0072 num_syms [0x08], binary + 0x0078 offsets [0x08 * num_syms], binary + 0x0086 + 0x08 * num_syms names [??] + ?? pad to even bytes. */ - if (sym_32) + if (sym_32) { struct xcoff_ar_hdr_big *hdr; bfd_byte *symbol_table; bfd_byte *st; file_ptr fileoff; - bfd_vma symbol_table_size = + bfd_vma symbol_table_size = SIZEOF_AR_HDR_BIG + SXCOFFARFMAG - + 8 - + 8 * sym_32 + + 8 + + 8 * sym_32 + str_32 + (str_32 & 1); symbol_table = NULL; symbol_table = (bfd_byte *) bfd_zmalloc (symbol_table_size); if (symbol_table == NULL) - return false; + return FALSE; hdr = (struct xcoff_ar_hdr_big *) symbol_table; - + PRINT20 (hdr->size, 8 + 8 * sym_32 + str_32 + (str_32 & 1)); - + if (sym_64) PRINT20 (hdr->nextoff, nextoff + symbol_table_size); else @@ -1858,7 +1887,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) bfd_h_put_64 (abfd, sym_32, st); st += 8; - + /* loop over the 32 bit offsets */ current_bfd = abfd->archive_head; if (current_bfd != NULL) @@ -1917,27 +1946,27 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) prevoff = nextoff; nextoff = nextoff + symbol_table_size; } - else + else PRINT20 (fhdr->symoff, 0); - - if (sym_64) + + if (sym_64) { struct xcoff_ar_hdr_big *hdr; bfd_byte *symbol_table; bfd_byte *st; file_ptr fileoff; - bfd_vma symbol_table_size = + bfd_vma symbol_table_size = SIZEOF_AR_HDR_BIG + SXCOFFARFMAG - + 8 - + 8 * sym_64 + + 8 + + 8 * sym_64 + str_64 + (str_64 & 1); symbol_table = NULL; symbol_table = (bfd_byte *) bfd_zmalloc (symbol_table_size); if (symbol_table == NULL) - return false; + return FALSE; hdr = (struct xcoff_ar_hdr_big *) symbol_table; @@ -1956,7 +1985,7 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) bfd_h_put_64 (abfd, sym_64, st); st += 8; - + /* loop over the 64 bit offsets */ current_bfd = abfd->archive_head; if (current_bfd != NULL) @@ -2014,13 +2043,13 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) PRINT20 (fhdr->symoff64, nextoff); } - else + else PRINT20 (fhdr->symoff64, 0); - - return true; + + return TRUE; } -boolean +bfd_boolean _bfd_xcoff_write_armap (abfd, elength, map, orl_count, stridx) bfd *abfd; unsigned int elength ATTRIBUTE_UNUSED; @@ -2037,7 +2066,7 @@ _bfd_xcoff_write_armap (abfd, elength, map, orl_count, stridx) /* Write out an XCOFF archive. We always write an entire archive, rather than fussing with the freelist and so forth. */ -static boolean +static bfd_boolean xcoff_write_archive_contents_old (abfd) bfd *abfd; { @@ -2045,8 +2074,8 @@ xcoff_write_archive_contents_old (abfd) bfd_size_type count; bfd_size_type total_namlen; file_ptr *offsets; - boolean makemap; - boolean hasobjects; + bfd_boolean makemap; + bfd_boolean hasobjects; ufile_ptr prevoff, nextoff; bfd *sub; size_t i; @@ -2069,13 +2098,13 @@ xcoff_write_archive_contents_old (abfd) } offsets = (file_ptr *) bfd_alloc (abfd, count * sizeof (file_ptr)); if (offsets == NULL) - return false; + return FALSE; if (bfd_seek (abfd, (file_ptr) SIZEOF_AR_FILE_HDR, SEEK_SET) != 0) - return false; + return FALSE; makemap = bfd_has_map (abfd); - hasobjects = false; + hasobjects = FALSE; prevoff = 0; nextoff = SIZEOF_AR_FILE_HDR; for (sub = abfd->archive_head, i = 0; sub != NULL; sub = sub->next, i++) @@ -2088,7 +2117,7 @@ xcoff_write_archive_contents_old (abfd) if (makemap && ! hasobjects) { if (bfd_check_format (sub, bfd_object)) - hasobjects = true; + hasobjects = TRUE; } name = normalize_filename (sub); @@ -2108,7 +2137,7 @@ xcoff_write_archive_contents_old (abfd) if (stat (bfd_get_filename (sub), &s) != 0) { bfd_set_error (bfd_error_system_call); - return false; + return FALSE; } sprintf (ahdrp->size, "%ld", (long) s.st_size); @@ -2122,7 +2151,7 @@ xcoff_write_archive_contents_old (abfd) size = sizeof (struct areltdata); sub->arelt_data = bfd_alloc (sub, size); if (sub->arelt_data == NULL) - return false; + return FALSE; } arch_eltdata (sub)->parsed_size = s.st_size; @@ -2132,7 +2161,7 @@ xcoff_write_archive_contents_old (abfd) sprintf (ahdrp->namlen, "%ld", (long) namlen); /* If the length of the name is odd, we write out the null byte - after the name as well. */ + after the name as well. */ namlen = (namlen + 1) &~ (bfd_size_type) 1; remaining = arelt_size (sub); @@ -2157,19 +2186,19 @@ xcoff_write_archive_contents_old (abfd) if ((bfd_bwrite ((PTR) ahdrp, (bfd_size_type) SIZEOF_AR_HDR, abfd) != SIZEOF_AR_HDR) - || (bfd_bwrite ((PTR) name, namlen, abfd) != namlen) - || (bfd_bwrite ((PTR) XCOFFARFMAG, (bfd_size_type) SXCOFFARFMAG, abfd) - != SXCOFFARFMAG)) - return false; + || bfd_bwrite ((PTR) name, namlen, abfd) != namlen + || bfd_bwrite ((PTR) XCOFFARFMAG, (bfd_size_type) SXCOFFARFMAG, + abfd) != SXCOFFARFMAG) + return FALSE; if (bfd_seek (sub, (file_ptr) 0, SEEK_SET) != 0) - return false; + return FALSE; if (! do_copy (abfd, sub)) - return false; - + return FALSE; + if (! do_pad (abfd, size & 1)) - return false; + return FALSE; } sprintf (fhdr.lastmemoff, "%ld", (long) prevoff); @@ -2213,18 +2242,18 @@ xcoff_write_archive_contents_old (abfd) != SIZEOF_AR_HDR) || (bfd_bwrite ((PTR) XCOFFARFMAG, (bfd_size_type) SXCOFFARFMAG, abfd) != SXCOFFARFMAG)) - return false; + return FALSE; sprintf (decbuf, "%-12ld", (long) count); if (bfd_bwrite ((PTR) decbuf, (bfd_size_type) XCOFFARMAG_ELEMENT_SIZE, abfd) != XCOFFARMAG_ELEMENT_SIZE) - return false; + return FALSE; for (i = 0; i < (size_t) count; i++) { sprintf (decbuf, "%-12ld", (long) offsets[i]); - if (bfd_bwrite ((PTR) decbuf, (bfd_size_type) XCOFFARMAG_ELEMENT_SIZE, + if (bfd_bwrite ((PTR) decbuf, (bfd_size_type) XCOFFARMAG_ELEMENT_SIZE, abfd) != XCOFFARMAG_ELEMENT_SIZE) - return false; + return FALSE; } for (sub = abfd->archive_head; sub != NULL; sub = sub->next) { @@ -2234,11 +2263,11 @@ xcoff_write_archive_contents_old (abfd) name = normalize_filename (sub); namlen = strlen (name); if (bfd_bwrite ((PTR) name, namlen + 1, abfd) != namlen + 1) - return false; + return FALSE; } if (! do_pad (abfd, size & 1)) - return false; + return FALSE; /* Write out the armap, if appropriate. */ if (! makemap || ! hasobjects) @@ -2249,7 +2278,7 @@ xcoff_write_archive_contents_old (abfd) sprintf (fhdr.symoff, "%ld", (long) nextoff); bfd_ardata (abfd)->tdata = (PTR) &fhdr; if (! _bfd_compute_and_write_armap (abfd, 0)) - return false; + return FALSE; } /* Write out the archive file header. */ @@ -2262,12 +2291,12 @@ xcoff_write_archive_contents_old (abfd) if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 || (bfd_bwrite ((PTR) &fhdr, (bfd_size_type) SIZEOF_AR_FILE_HDR, abfd) != SIZEOF_AR_FILE_HDR)) - return false; + return FALSE; - return true; + return TRUE; } -static boolean +static bfd_boolean xcoff_write_archive_contents_big (abfd) bfd *abfd; { @@ -2275,8 +2304,8 @@ xcoff_write_archive_contents_big (abfd) bfd_size_type count; bfd_size_type total_namlen; file_ptr *offsets; - boolean makemap; - boolean hasobjects; + bfd_boolean makemap; + bfd_boolean hasobjects; ufile_ptr prevoff, nextoff; bfd *current_bfd; size_t i; @@ -2289,13 +2318,13 @@ xcoff_write_archive_contents_big (abfd) memcpy (fhdr.magic, XCOFFARMAGBIG, SXCOFFARMAG); if (bfd_seek (abfd, (file_ptr) SIZEOF_AR_FILE_HDR_BIG, SEEK_SET) != 0) - return false; - + return FALSE; + /* Calculate count and total_namlen. */ makemap = bfd_has_map (abfd); - hasobjects = false; - for (current_bfd = abfd->archive_head, count = 0, total_namlen = 0; - current_bfd != NULL; + hasobjects = FALSE; + for (current_bfd = abfd->archive_head, count = 0, total_namlen = 0; + current_bfd != NULL; current_bfd = current_bfd->next, count++) { total_namlen += strlen (normalize_filename (current_bfd)) + 1; @@ -2303,7 +2332,7 @@ xcoff_write_archive_contents_big (abfd) if (makemap && ! hasobjects && bfd_check_format (current_bfd, bfd_object)) - hasobjects = true; + hasobjects = TRUE; } offsets = NULL; @@ -2311,13 +2340,13 @@ xcoff_write_archive_contents_big (abfd) { offsets = (file_ptr *) bfd_malloc (count * sizeof (file_ptr)); if (offsets == NULL) - return false; + return FALSE; } prevoff = 0; nextoff = SIZEOF_AR_FILE_HDR_BIG; - for (current_bfd = abfd->archive_head, i = 0; - current_bfd != NULL; + for (current_bfd = abfd->archive_head, i = 0; + current_bfd != NULL; current_bfd = current_bfd->next, i++) { const char *name; @@ -2339,12 +2368,12 @@ xcoff_write_archive_contents_big (abfd) ahdrp = &ahdr; /* XXX This should actually be a call to stat64 (at least on - 32-bit machines). + 32-bit machines). XXX This call will fail if the original object is not found. */ if (stat (bfd_get_filename (current_bfd), &s) != 0) { bfd_set_error (bfd_error_system_call); - return false; + return FALSE; } PRINT20 (ahdrp->size, s.st_size); @@ -2358,7 +2387,7 @@ xcoff_write_archive_contents_big (abfd) size = sizeof (struct areltdata); current_bfd->arelt_data = bfd_alloc (current_bfd, size); if (current_bfd->arelt_data == NULL) - return false; + return FALSE; } arch_eltdata (current_bfd)->parsed_size = s.st_size; @@ -2368,7 +2397,7 @@ xcoff_write_archive_contents_big (abfd) PRINT4 (ahdrp->namlen, namlen); /* If the length of the name is odd, we write out the null byte - after the name as well. */ + after the name as well. */ namlen = (namlen + 1) &~ (bfd_size_type) 1; remaining = arelt_size (current_bfd); @@ -2383,9 +2412,9 @@ xcoff_write_archive_contents_big (abfd) Their text section needs to be aligned wrt the archive file position. This requires extra padding before the archive header. */ if (! do_shared_object_padding (abfd, current_bfd, & nextoff, - SIZEOF_AR_HDR_BIG + namlen + SIZEOF_AR_HDR_BIG + namlen + SXCOFFARFMAG)) - return false; + return FALSE; offsets[i] = nextoff; @@ -2397,18 +2426,18 @@ xcoff_write_archive_contents_big (abfd) if ((bfd_bwrite ((PTR) ahdrp, (bfd_size_type) SIZEOF_AR_HDR_BIG, abfd) != SIZEOF_AR_HDR_BIG) || bfd_bwrite ((PTR) name, (bfd_size_type) namlen, abfd) != namlen - || (bfd_bwrite ((PTR) XCOFFARFMAG, (bfd_size_type) SXCOFFARFMAG, + || (bfd_bwrite ((PTR) XCOFFARFMAG, (bfd_size_type) SXCOFFARFMAG, abfd) != SXCOFFARFMAG)) - return false; + return FALSE; if (bfd_seek (current_bfd, (file_ptr) 0, SEEK_SET) != 0) - return false; + return FALSE; if (! do_copy (abfd, current_bfd)) - return false; - + return FALSE; + if (! do_pad (abfd, size & 1)) - return false; + return FALSE; } if (count) @@ -2417,25 +2446,25 @@ xcoff_write_archive_contents_big (abfd) PRINT20 (fhdr.lastmemoff, prevoff); } - /* Write out the member table. - Layout : + /* Write out the member table. + Layout : standard big archive header - 0x0000 ar_size [0x14] - 0x0014 ar_nxtmem [0x14] - 0x0028 ar_prvmem [0x14] - 0x003C ar_date [0x0C] - 0x0048 ar_uid [0x0C] - 0x0054 ar_gid [0x0C] - 0x0060 ar_mod [0x0C] - 0x006C ar_namelen[0x04] - 0x0070 ar_fmag [0x02] - - Member table - 0x0072 count [0x14] - 0x0086 offsets [0x14 * counts] - 0x0086 + 0x14 * counts names [??] - ?? pad to even bytes. + 0x0000 ar_size [0x14] + 0x0014 ar_nxtmem [0x14] + 0x0028 ar_prvmem [0x14] + 0x003C ar_date [0x0C] + 0x0048 ar_uid [0x0C] + 0x0054 ar_gid [0x0C] + 0x0060 ar_mod [0x0C] + 0x006C ar_namelen[0x04] + 0x0070 ar_fmag [0x02] + + Member table + 0x0072 count [0x14] + 0x0086 offsets [0x14 * counts] + 0x0086 + 0x14 * counts names [??] + ?? pad to even bytes. */ BFD_ASSERT (nextoff == bfd_tell (abfd)); @@ -2450,14 +2479,14 @@ xcoff_write_archive_contents_big (abfd) member_table = NULL; member_table = (bfd_byte *) bfd_zmalloc (member_table_size); if (member_table == NULL) - return false; + return FALSE; hdr = (struct xcoff_ar_hdr_big *) member_table; PRINT20 (hdr->size, (XCOFFARMAGBIG_ELEMENT_SIZE + count * XCOFFARMAGBIG_ELEMENT_SIZE + total_namlen + (total_namlen & 1))); - if (makemap && hasobjects) + if (makemap && hasobjects) PRINT20 (hdr->nextoff, nextoff + member_table_size); else PRINT20 (hdr->nextoff, 0); @@ -2467,7 +2496,7 @@ xcoff_write_archive_contents_big (abfd) PRINT12 (hdr->gid, 0); PRINT12 (hdr->mode, 0); PRINT4 (hdr->namlen, 0); - + mt = member_table + SIZEOF_AR_HDR_BIG; memcpy (mt, XCOFFARFMAG, SXCOFFARFMAG); mt += SXCOFFARFMAG; @@ -2480,25 +2509,25 @@ xcoff_write_archive_contents_big (abfd) mt += XCOFFARMAGBIG_ELEMENT_SIZE; } - if (count) + if (count) { free (offsets); offsets = NULL; } - for (current_bfd = abfd->archive_head; current_bfd != NULL; + for (current_bfd = abfd->archive_head; current_bfd != NULL; current_bfd = current_bfd->next) { const char *name; size_t namlen; name = normalize_filename (current_bfd); - namlen = sprintf(mt, "%s", name); + namlen = sprintf (mt, "%s", name); mt += namlen + 1; } - + if (bfd_bwrite (member_table, member_table_size, abfd) != member_table_size) - return false; + return FALSE; free (member_table); member_table = NULL; @@ -2510,7 +2539,7 @@ xcoff_write_archive_contents_big (abfd) /* Write out the armap, if appropriate. */ - if (! makemap || ! hasobjects) + if (! makemap || ! hasobjects) PRINT20 (fhdr.symoff, 0); else { @@ -2518,23 +2547,23 @@ xcoff_write_archive_contents_big (abfd) /* Save nextoff in fhdr.symoff so the armap routine can use it. */ PRINT20 (fhdr.symoff, nextoff); - + bfd_ardata (abfd)->tdata = (PTR) &fhdr; if (! _bfd_compute_and_write_armap (abfd, 0)) - return false; + return FALSE; } /* Write out the archive file header. */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 - || (bfd_bwrite ((PTR) &fhdr, (bfd_size_type) SIZEOF_AR_FILE_HDR_BIG, + || (bfd_bwrite ((PTR) &fhdr, (bfd_size_type) SIZEOF_AR_FILE_HDR_BIG, abfd) != SIZEOF_AR_FILE_HDR_BIG)) - return false; - - return true; + return FALSE; + + return TRUE; } -boolean +bfd_boolean _bfd_xcoff_write_archive_contents (abfd) bfd *abfd; { @@ -2550,7 +2579,7 @@ _bfd_xcoff_write_archive_contents (abfd) int _bfd_xcoff_sizeof_headers (abfd, reloc) bfd *abfd; - boolean reloc ATTRIBUTE_UNUSED; + bfd_boolean reloc ATTRIBUTE_UNUSED; { int size; @@ -2725,8 +2754,8 @@ xcoff_swap_ldrel_out (abfd, src, d) } -boolean -xcoff_reloc_type_noop (input_bfd, input_section, output_bfd, rel, sym, howto, +bfd_boolean +xcoff_reloc_type_noop (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd ATTRIBUTE_UNUSED; asection *input_section ATTRIBUTE_UNUSED; @@ -2739,11 +2768,11 @@ xcoff_reloc_type_noop (input_bfd, input_section, output_bfd, rel, sym, howto, bfd_vma *relocation ATTRIBUTE_UNUSED; bfd_byte *contents ATTRIBUTE_UNUSED; { - return true; + return TRUE; } -boolean -xcoff_reloc_type_fail (input_bfd, input_section, output_bfd, rel, sym, howto, +bfd_boolean +xcoff_reloc_type_fail (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd; asection *input_section ATTRIBUTE_UNUSED; @@ -2760,11 +2789,11 @@ xcoff_reloc_type_fail (input_bfd, input_section, output_bfd, rel, sym, howto, (_("%s: unsupported relocation type 0x%02x"), bfd_get_filename (input_bfd), (unsigned int) rel->r_type); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } -boolean -xcoff_reloc_type_pos (input_bfd, input_section, output_bfd, rel, sym, howto, +bfd_boolean +xcoff_reloc_type_pos (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd ATTRIBUTE_UNUSED; asection *input_section ATTRIBUTE_UNUSED; @@ -2778,11 +2807,11 @@ xcoff_reloc_type_pos (input_bfd, input_section, output_bfd, rel, sym, howto, bfd_byte *contents ATTRIBUTE_UNUSED; { *relocation = val + addend; - return true; + return TRUE; } -boolean -xcoff_reloc_type_neg (input_bfd, input_section, output_bfd, rel, sym, howto, +bfd_boolean +xcoff_reloc_type_neg (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd ATTRIBUTE_UNUSED; asection *input_section ATTRIBUTE_UNUSED; @@ -2796,11 +2825,11 @@ xcoff_reloc_type_neg (input_bfd, input_section, output_bfd, rel, sym, howto, bfd_byte *contents ATTRIBUTE_UNUSED; { *relocation = addend - val; - return true; + return TRUE; } -boolean -xcoff_reloc_type_rel (input_bfd, input_section, output_bfd, rel, sym, howto, +bfd_boolean +xcoff_reloc_type_rel (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd ATTRIBUTE_UNUSED; asection *input_section; @@ -2813,7 +2842,7 @@ xcoff_reloc_type_rel (input_bfd, input_section, output_bfd, rel, sym, howto, bfd_vma *relocation; bfd_byte *contents ATTRIBUTE_UNUSED; { - howto->pc_relative = true; + howto->pc_relative = TRUE; /* A PC relative reloc includes the section address. */ addend += input_section->vma; @@ -2821,11 +2850,11 @@ xcoff_reloc_type_rel (input_bfd, input_section, output_bfd, rel, sym, howto, *relocation = val + addend; *relocation -= (input_section->output_section->vma + input_section->output_offset); - return true; + return TRUE; } -boolean -xcoff_reloc_type_toc (input_bfd, input_section, output_bfd, rel, sym, howto, +bfd_boolean +xcoff_reloc_type_toc (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd; asection *input_section ATTRIBUTE_UNUSED; @@ -2840,8 +2869,8 @@ xcoff_reloc_type_toc (input_bfd, input_section, output_bfd, rel, sym, howto, { struct xcoff_link_hash_entry *h; - if (0 > rel->r_symndx) - return false; + if (0 > rel->r_symndx) + return FALSE; h = obj_xcoff_sym_hashes (input_bfd)[rel->r_symndx]; @@ -2854,21 +2883,21 @@ xcoff_reloc_type_toc (input_bfd, input_section, output_bfd, rel, sym, howto, bfd_get_filename (input_bfd), rel->r_vaddr, h->root.root.string); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } - + BFD_ASSERT ((h->flags & XCOFF_SET_TOC) == 0); val = (h->toc_section->output_section->vma + h->toc_section->output_offset); } - + *relocation = ((val - xcoff_data (output_bfd)->toc) - (sym->n_value - xcoff_data (input_bfd)->toc)); - return true; + return TRUE; } -boolean -xcoff_reloc_type_ba (input_bfd, input_section, output_bfd, rel, sym, howto, +bfd_boolean +xcoff_reloc_type_ba (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd ATTRIBUTE_UNUSED; asection *input_section ATTRIBUTE_UNUSED; @@ -2886,11 +2915,11 @@ xcoff_reloc_type_ba (input_bfd, input_section, output_bfd, rel, sym, howto, *relocation = val + addend; - return true; + return TRUE; } -static boolean -xcoff_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, +static bfd_boolean +xcoff_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd; asection *input_section; @@ -2905,8 +2934,8 @@ xcoff_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, { struct xcoff_link_hash_entry *h; - if (0 > rel->r_symndx) - return false; + if (0 > rel->r_symndx) + return FALSE; h = obj_xcoff_sym_hashes (input_bfd)[rel->r_symndx]; @@ -2917,60 +2946,60 @@ xcoff_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, call is followed by a lwz r2,20(r1), but the call is not going to global linkage code, we can replace the load with a cror. */ - if (NULL != h - && bfd_link_hash_defined == h->root.type + if (NULL != h + && bfd_link_hash_defined == h->root.type && (rel->r_vaddr - input_section->vma + 8 <= input_section->_cooked_size)) { bfd_byte *pnext; unsigned long next; - + pnext = contents + (rel->r_vaddr - input_section->vma) + 4; next = bfd_get_32 (input_bfd, pnext); - + /* The _ptrgl function is magic. It is used by the AIX compiler to call a function through a pointer. */ if (h->smclas == XMC_GL || strcmp (h->root.root.string, "._ptrgl") == 0) { - if (next == 0x4def7b82 /* cror 15,15,15 */ - || next == 0x4ffffb82 /* cror 31,31,31 */ - || next == 0x60000000) /* ori r0,r0,0 */ - bfd_put_32 (input_bfd, 0x80410014, pnext); /* lwz r1,20(r1) */ - + if (next == 0x4def7b82 /* cror 15,15,15 */ + || 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, 0x60000000, pnext); /* ori r0,r0,0 */ - } - } - else if (NULL != h && bfd_link_hash_undefined == h->root.type) + { + if (next == 0x80410014) /* lwz r1,20(r1) */ + bfd_put_32 (input_bfd, 0x60000000, pnext); /* ori r0,r0,0 */ + } + } + else if (NULL != h && bfd_link_hash_undefined == h->root.type) { /* Normally, this relocation is against a defined symbol. In the case where this is a partial link and the output section offset - is greater than 2^25, the linker will return an invalid error + is greater than 2^25, the linker will return an invalid error message that the relocation has been truncated. Yes it has been - truncated but no it not important. For this case, disable the + truncated but no it not important. For this case, disable the overflow checking. */ - + howto->complain_on_overflow = complain_overflow_dont; } - - howto->pc_relative = true; + + howto->pc_relative = TRUE; howto->src_mask &= ~3; howto->dst_mask = howto->src_mask; /* A PC relative reloc includes the section address. */ addend += input_section->vma; - + *relocation = val + addend; *relocation -= (input_section->output_section->vma + input_section->output_offset); - return true; + return TRUE; } -boolean -xcoff_reloc_type_crel (input_bfd, input_section, output_bfd, rel, sym, howto, +bfd_boolean +xcoff_reloc_type_crel (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd ATTRIBUTE_UNUSED; asection *input_section; @@ -2983,7 +3012,7 @@ xcoff_reloc_type_crel (input_bfd, input_section, output_bfd, rel, sym, howto, bfd_vma *relocation; bfd_byte *contents ATTRIBUTE_UNUSED; { - howto->pc_relative = true; + howto->pc_relative = TRUE; howto->src_mask &= ~3; howto->dst_mask = howto->src_mask; @@ -2993,29 +3022,29 @@ xcoff_reloc_type_crel (input_bfd, input_section, output_bfd, rel, sym, howto, *relocation = val + addend; *relocation -= (input_section->output_section->vma + input_section->output_offset); - return true; + return TRUE; } -static boolean -xcoff_complain_overflow_dont_func (input_bfd, val, relocation, howto) +static bfd_boolean +xcoff_complain_overflow_dont_func (input_bfd, val, relocation, howto) bfd *input_bfd ATTRIBUTE_UNUSED; bfd_vma val ATTRIBUTE_UNUSED; bfd_vma relocation ATTRIBUTE_UNUSED; struct reloc_howto_struct *howto ATTRIBUTE_UNUSED; { - return false; + return FALSE; } -static boolean -xcoff_complain_overflow_bitfield_func (input_bfd, val, relocation, howto) +static bfd_boolean +xcoff_complain_overflow_bitfield_func (input_bfd, val, relocation, howto) bfd *input_bfd; bfd_vma val; bfd_vma relocation; - struct reloc_howto_struct *howto; + struct reloc_howto_struct *howto; { bfd_vma addrmask, fieldmask, signmask, ss; bfd_vma a, b, sum; - + /* Get the values to be added together. For signed and unsigned relocations, we assume that all values should be truncated to the size of an address. For bitfields, all the bits matter. @@ -3031,7 +3060,7 @@ xcoff_complain_overflow_bitfield_func (input_bfd, val, relocation, howto) operand. */ a >>= howto->rightshift; b >>= howto->bitpos; - + /* Bitfields are sometimes used for signed numbers; for example, a 13-bit field sometimes represents values in 0..8191 and sometimes represents values in -4096..4095. @@ -3043,7 +3072,7 @@ xcoff_complain_overflow_bitfield_func (input_bfd, val, relocation, howto) assumed that it was fully sign extended, and we will keep that assumption. */ signmask = (fieldmask >> 1) + 1; - + if ((a & ~ fieldmask) != 0) { /* Some bits out of the field are set. This might not @@ -3054,12 +3083,12 @@ xcoff_complain_overflow_bitfield_func (input_bfd, val, relocation, howto) ones, we are OK, assuming a signed bitfield. */ ss = (signmask << howto->rightshift) - 1; if ((ss | relocation) != ~ (bfd_vma) 0) - return true; + return TRUE; a &= fieldmask; } - + /* We just assume (b & ~ fieldmask) == 0. */ - + /* We explicitly permit wrap around if this relocation covers the high bit of an address. The Linux kernel relies on it, and it is the only way to write assembler @@ -3067,8 +3096,8 @@ xcoff_complain_overflow_bitfield_func (input_bfd, val, relocation, howto) away from the location at which it is linked. */ if (howto->bitsize + howto->rightshift == bfd_arch_bits_per_address (input_bfd)) - return false; - + return FALSE; + sum = a + b; if (sum < a || (sum & ~ fieldmask) != 0) { @@ -3076,14 +3105,14 @@ xcoff_complain_overflow_bitfield_func (input_bfd, val, relocation, howto) for signed operands again. Here is the overflow test is as for complain_overflow_signed. */ if (((~ (a ^ b)) & (a ^ sum)) & signmask) - return true; + return TRUE; } - - return false; + + return FALSE; } -static boolean -xcoff_complain_overflow_signed_func (input_bfd, val, relocation, howto) +static bfd_boolean +xcoff_complain_overflow_signed_func (input_bfd, val, relocation, howto) bfd *input_bfd; bfd_vma val; bfd_vma relocation; @@ -3091,7 +3120,7 @@ xcoff_complain_overflow_signed_func (input_bfd, val, relocation, howto) { bfd_vma addrmask, fieldmask, signmask, ss; bfd_vma a, b, sum; - + /* Get the values to be added together. For signed and unsigned relocations, we assume that all values should be truncated to the size of an address. For bitfields, all the bits matter. @@ -3102,15 +3131,15 @@ xcoff_complain_overflow_signed_func (input_bfd, val, relocation, howto) b = val & howto->src_mask; a = (a & addrmask) >> howto->rightshift; - + /* If any sign bits are set, all sign bits must be set. That is, A must be a valid negative address after shifting. */ signmask = ~ (fieldmask >> 1); ss = a & signmask; if (ss != 0 && ss != ((addrmask >> howto->rightshift) & signmask)) - return true; - + return TRUE; + /* We only need this next bit of code if the sign bit of B is below the sign bit of A. This would only happen if SRC_MASK had fewer bits than BITSIZE. Note that if @@ -3123,12 +3152,12 @@ xcoff_complain_overflow_signed_func (input_bfd, val, relocation, howto) /* Set all the bits above the sign bit. */ b -= signmask <<= 1; } - + b = (b & addrmask) >> howto->bitpos; - + /* Now we can do the addition. */ sum = a + b; - + /* See if the result has the correct sign. Bits above the sign bit are junk now; ignore them. If the sum is positive, make sure we did not have all negative inputs; @@ -3139,21 +3168,21 @@ xcoff_complain_overflow_signed_func (input_bfd, val, relocation, howto) */ signmask = (fieldmask >> 1) + 1; if (((~ (a ^ b)) & (a ^ sum)) & signmask) - return true; - - return false; + return TRUE; + + return FALSE; } -static boolean -xcoff_complain_overflow_unsigned_func (input_bfd, val, relocation, howto) +static bfd_boolean +xcoff_complain_overflow_unsigned_func (input_bfd, val, relocation, howto) bfd *input_bfd; bfd_vma val; bfd_vma relocation; - struct reloc_howto_struct *howto; + struct reloc_howto_struct *howto; { bfd_vma addrmask, fieldmask; bfd_vma a, b, sum; - + /* Get the values to be added together. For signed and unsigned relocations, we assume that all values should be truncated to the size of an address. For bitfields, all the bits matter. @@ -3178,32 +3207,32 @@ xcoff_complain_overflow_unsigned_func (input_bfd, val, relocation, howto) b = (b & addrmask) >> howto->bitpos; sum = (a + b) & addrmask; if ((a | b | sum) & ~ fieldmask) - return true; - - return false; + return TRUE; + + return FALSE; } /* This is the relocation function for the RS/6000/POWER/PowerPC. This is currently the only processor which uses XCOFF; I hope that - will never change. + will never change. I took the relocation type definitions from two documents: the PowerPC AIX Version 4 Application Binary Interface, First Edition (April 1992), and the PowerOpen ABI, Big-Endian 32-Bit Hardware Implementation (June 30, 1994). Differences - between the documents are noted below. + between the documents are noted below. - Unsupported r_type's + Unsupported r_type's R_RTB: R_RRTBI: R_RRTBA: - + These relocs are defined by the PowerPC ABI to be relative branches which use half of the difference between the symbol and the program counter. I can't quite figure out when this is useful. These relocs are - not defined by the PowerOpen ABI. + not defined by the PowerOpen ABI. Supported r_type's @@ -3211,7 +3240,7 @@ xcoff_complain_overflow_unsigned_func (input_bfd, val, relocation, howto) Simple positive relocation. R_NEG: - Simple negative relocation. + Simple negative relocation. R_REL: Simple PC relative relocation. @@ -3229,16 +3258,16 @@ xcoff_complain_overflow_unsigned_func (input_bfd, val, relocation, howto) R_GL: GL linkage relocation. The value of this relocation - is the address of the entry in the TOC section. + is the address of the entry in the TOC section. R_TCL: Local object TOC address. I can't figure out the - difference between this and case R_GL. + difference between this and case R_GL. R_TRL: TOC relative relocation. A TOC relative load instruction which may be changed to a load address instruction. - FIXME: We don't currently implement this optimization. + FIXME: We don't currently implement this optimization. R_TRLA: TOC relative relocation. This is a TOC relative load @@ -3248,55 +3277,55 @@ xcoff_complain_overflow_unsigned_func (input_bfd, val, relocation, howto) R_BA: Absolute branch. We don't want to mess with the lower - two bits of the instruction. + two bits of the instruction. R_CAI: The PowerPC ABI defines this as an absolute call which may be modified to become a relative call. The PowerOpen - ABI does not define this relocation type. - + ABI does not define this relocation type. + R_RBA: Absolute branch which may be modified to become a - relative branch. + relative branch. R_RBAC: The PowerPC ABI defines this as an absolute branch to a fixed address which may be modified to an absolute branch to a symbol. The PowerOpen ABI does not define this - relocation type. + relocation type. R_RBRC: The PowerPC ABI defines this as an absolute branch to a fixed address which may be modified to a relative branch. - The PowerOpen ABI does not define this relocation type. + The PowerOpen ABI does not define this relocation type. R_BR: Relative branch. We don't want to mess with the lower - two bits of the instruction. + two bits of the instruction. R_CREL: The PowerPC ABI defines this as a relative call which may be modified to become an absolute call. The PowerOpen - ABI does not define this relocation type. + ABI does not define this relocation type. R_RBR: A relative branch which may be modified to become an absolute branch. FIXME: We don't implement this, although we should for symbols of storage mapping class - XMC_XO. + XMC_XO. R_RL: The PowerPC AIX ABI describes this as a load which may be changed to a load address. The PowerOpen ABI says this - is the same as case R_POS. + is the same as case R_POS. R_RLA: The PowerPC AIX ABI describes this as a load address which may be changed to a load. The PowerOpen ABI says - this is the same as R_POS. + this is the same as R_POS. */ -boolean +bfd_boolean xcoff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, syms, sections) @@ -3328,8 +3357,8 @@ xcoff_ppc_relocate_section (output_bfd, info, input_bfd, bfd_byte *location; /* Relocation type R_REF is a special relocation type which is - merely used to prevent garbage collection from occurring for - the csect including the symbol which it references. */ + merely used to prevent garbage collection from occurring for + the csect including the symbol which it references. */ if (rel->r_type == R_REF) continue; @@ -3338,33 +3367,33 @@ xcoff_ppc_relocate_section (output_bfd, info, input_bfd, howto.rightshift = 0; howto.bitsize = (rel->r_size & 0x1f) + 1; howto.size = howto.bitsize > 16 ? 2 : 1; - howto.pc_relative = false; + howto.pc_relative = FALSE; howto.bitpos = 0; howto.complain_on_overflow = (rel->r_size & 0x80 ? complain_overflow_signed : complain_overflow_bitfield); howto.special_function = NULL; howto.name = "internal"; - howto.partial_inplace = true; - howto.src_mask = howto.dst_mask = N_ONES(howto.bitsize); - howto.pcrel_offset = false; + howto.partial_inplace = TRUE; + howto.src_mask = howto.dst_mask = N_ONES (howto.bitsize); + howto.pcrel_offset = FALSE; /* symbol */ val = 0; addend = 0; h = NULL; sym = NULL; - symndx = rel->r_symndx; + symndx = rel->r_symndx; - if (-1 != symndx) + if (-1 != symndx) { asection *sec; - + h = obj_xcoff_sym_hashes (input_bfd)[symndx]; sym = syms + symndx; addend = - sym->n_value; - - if (NULL == h) + + if (NULL == h) { sec = sections[symndx]; /* Hack to make sure we use the right TOC anchor value @@ -3377,32 +3406,32 @@ xcoff_ppc_relocate_section (output_bfd, info, input_bfd, + sec->output_offset + sym->n_value - sec->vma); - } - else + } + else { - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) { sec = h->root.u.def.section; val = (h->root.u.def.value + sec->output_section->vma + sec->output_offset); - } - else if (h->root.type == bfd_link_hash_common) + } + else if (h->root.type == bfd_link_hash_common) { sec = h->root.u.c.p->section; val = (sec->output_section->vma + sec->output_offset); - - } - else if ((0 == (h->flags & (XCOFF_DEF_DYNAMIC | XCOFF_IMPORT))) - && ! info->relocateable) + + } + else if ((0 == (h->flags & (XCOFF_DEF_DYNAMIC | XCOFF_IMPORT))) + && ! info->relocatable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, - rel->r_vaddr - input_section->vma, true))) - return false; - + rel->r_vaddr - input_section->vma, TRUE))) + return FALSE; + /* Don't try to process the reloc. It can't help, and it may generate another error. */ continue; @@ -3410,81 +3439,81 @@ xcoff_ppc_relocate_section (output_bfd, info, input_bfd, } } - if (rel->r_type >= XCOFF_MAX_CALCULATE_RELOCATION + if (rel->r_type >= XCOFF_MAX_CALCULATE_RELOCATION || !((*xcoff_calculate_relocation[rel->r_type]) - (input_bfd, input_section, output_bfd, rel, sym, &howto, val, - addend, &relocation, contents))) - return false; - + (input_bfd, input_section, output_bfd, rel, sym, &howto, val, + addend, &relocation, contents))) + return FALSE; + /* address */ address = rel->r_vaddr - input_section->vma; location = contents + address; - + if (address > input_section->_raw_size) - abort(); + abort (); /* Get the value we are going to relocate. */ if (1 == howto.size) value_to_relocate = bfd_get_16 (input_bfd, location); - else + else value_to_relocate = bfd_get_32 (input_bfd, location); - - /* overflow. - + + /* overflow. + FIXME: We may drop bits during the addition which we don't check for. We must either check at every single operation, which would be tedious, or we must do the computations in a type larger than bfd_vma, which would be inefficient. */ - + if ((unsigned int) howto.complain_on_overflow >= XCOFF_MAX_COMPLAIN_OVERFLOW) - abort(); + abort (); if (((*xcoff_complain_overflow[howto.complain_on_overflow]) - (input_bfd, value_to_relocate, relocation, &howto))) + (input_bfd, value_to_relocate, relocation, &howto))) { const char *name; char buf[SYMNMLEN + 1]; char reloc_type_name[10]; - - if (symndx == -1) + + if (symndx == -1) { name = "*ABS*"; - } - else if (h != NULL) + } + else if (h != NULL) { name = h->root.root.string; - } - else + } + else { name = _bfd_coff_internal_syment_name (input_bfd, sym, buf); if (name == NULL) name = "UNKNOWN"; } sprintf (reloc_type_name, "0x%02x", rel->r_type); - + if (! ((*info->callbacks->reloc_overflow) (info, name, reloc_type_name, (bfd_vma) 0, input_bfd, input_section, rel->r_vaddr - input_section->vma))) - return false; + return FALSE; } - + /* Add RELOCATION to the right bits of VALUE_TO_RELOCATE. */ value_to_relocate = ((value_to_relocate & ~howto.dst_mask) | (((value_to_relocate & howto.src_mask) + relocation) & howto.dst_mask)); - + /* Put the value back in the object file. */ if (1 == howto.size) bfd_put_16 (input_bfd, value_to_relocate, location); - else + else bfd_put_32 (input_bfd, value_to_relocate, location); } - return true; + return TRUE; } -static boolean +static bfd_boolean _bfd_xcoff_put_ldsymbol_name (abfd, ldinfo, ldsym, name) bfd *abfd ATTRIBUTE_UNUSED; struct xcoff_loader_info *ldinfo; @@ -3513,8 +3542,8 @@ _bfd_xcoff_put_ldsymbol_name (abfd, ldinfo, ldsym, name) bfd_realloc ((PTR) ldinfo->strings, newalc)); if (newstrings == NULL) { - ldinfo->failed = true; - return false; + ldinfo->failed = TRUE; + return FALSE; } ldinfo->string_alc = newalc; ldinfo->strings = newstrings; @@ -3528,10 +3557,10 @@ _bfd_xcoff_put_ldsymbol_name (abfd, ldinfo, ldsym, name) ldinfo->string_size += len + 3; } - return true; + return TRUE; } -static boolean +static bfd_boolean _bfd_xcoff_put_symbol_name (bfd *abfd, struct bfd_strtab_hash *strtab, struct internal_syment *sym, const char *name) @@ -3542,19 +3571,19 @@ _bfd_xcoff_put_symbol_name (bfd *abfd, struct bfd_strtab_hash *strtab, } else { - boolean hash; + bfd_boolean hash; bfd_size_type indx; - hash = true; + hash = TRUE; if ((abfd->flags & BFD_TRADITIONAL_FORMAT) != 0) - hash = false; - indx = _bfd_stringtab_add (strtab, name, hash, false); + hash = FALSE; + indx = _bfd_stringtab_add (strtab, name, hash, FALSE); if (indx == (bfd_size_type) -1) - return false; + return FALSE; sym->_n._n_n._n_zeroes = 0; sym->_n._n_n._n_offset = STRING_SIZE_SIZE + indx; } - return true; + return TRUE; } static asection * @@ -3591,26 +3620,26 @@ xcoff_create_csect_from_smclas (abfd, aux, symbol_name) return return_value; } -static boolean +static bfd_boolean xcoff_is_lineno_count_overflow (abfd, value) bfd *abfd ATTRIBUTE_UNUSED; bfd_vma value; { if (0xffff <= value) - return true; + return TRUE; - return false; + return FALSE; } -static boolean +static bfd_boolean xcoff_is_reloc_count_overflow (abfd, value) bfd *abfd ATTRIBUTE_UNUSED; bfd_vma value; { if (0xffff <= value) - return true; + return TRUE; - return false; + return FALSE; } static bfd_vma @@ -3618,7 +3647,7 @@ xcoff_loader_symbol_offset (abfd, ldhdr) bfd *abfd; struct internal_ldhdr *ldhdr ATTRIBUTE_UNUSED; { - return bfd_xcoff_ldhdrsz(abfd); + return bfd_xcoff_ldhdrsz (abfd); } static bfd_vma @@ -3629,12 +3658,12 @@ xcoff_loader_reloc_offset (abfd, ldhdr) return bfd_xcoff_ldhdrsz (abfd) + ldhdr->l_nsyms * bfd_xcoff_ldsymsz (abfd); } -static boolean +static bfd_boolean xcoff_generate_rtinit (abfd, init, fini, rtld) bfd *abfd; const char *init; const char *fini; - boolean rtld; + bfd_boolean rtld; { bfd_byte filehdr_ext[FILHSZ]; bfd_byte scnhdr_ext[SCNHSZ]; @@ -3651,13 +3680,13 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) struct internal_syment syment; union internal_auxent auxent; struct internal_reloc reloc; - + char *data_name = ".data"; char *rtinit_name = "__rtinit"; char *rtld_name = "__rtld"; - + if (! bfd_xcoff_rtinit_size (abfd)) - return false; + return FALSE; initsz = (init == NULL ? 0 : 1 + strlen (init)); finisz = (fini == NULL ? 0 : 1 + strlen (fini)); @@ -3666,7 +3695,7 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) memset (filehdr_ext, 0, FILHSZ); memset (&filehdr, 0, sizeof (struct internal_filehdr)); filehdr.f_magic = bfd_xcoff_magic_number (abfd); - filehdr.f_nscns = 1; + filehdr.f_nscns = 1; filehdr.f_timdat = 0; filehdr.f_nsyms = 0; /* at least 6, no more than 10 */ filehdr.f_symptr = 0; /* set below */ @@ -3687,34 +3716,34 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) scnhdr.s_nlnno = 0; scnhdr.s_flags = STYP_DATA; - /* .data - 0x0000 0x00000000 : rtl - 0x0004 0x00000010 : offset to init, or 0 - 0x0008 0x00000028 : offset to fini, or 0 - 0x000C 0x0000000C : size of descriptor - 0x0010 0x00000000 : init, needs a reloc - 0x0014 0x00000040 : offset to init name - 0x0018 0x00000000 : flags, padded to a word - 0x001C 0x00000000 : empty init - 0x0020 0x00000000 : - 0x0024 0x00000000 : - 0x0028 0x00000000 : fini, needs a reloc - 0x002C 0x00000??? : offset to fini name - 0x0030 0x00000000 : flags, padded to a word - 0x0034 0x00000000 : empty fini - 0x0038 0x00000000 : - 0x003C 0x00000000 : - 0x0040 init name + /* .data + 0x0000 0x00000000 : rtl + 0x0004 0x00000010 : offset to init, or 0 + 0x0008 0x00000028 : offset to fini, or 0 + 0x000C 0x0000000C : size of descriptor + 0x0010 0x00000000 : init, needs a reloc + 0x0014 0x00000040 : offset to init name + 0x0018 0x00000000 : flags, padded to a word + 0x001C 0x00000000 : empty init + 0x0020 0x00000000 : + 0x0024 0x00000000 : + 0x0028 0x00000000 : fini, needs a reloc + 0x002C 0x00000??? : offset to fini name + 0x0030 0x00000000 : flags, padded to a word + 0x0034 0x00000000 : empty fini + 0x0038 0x00000000 : + 0x003C 0x00000000 : + 0x0040 init name 0x0040 + initsz fini name */ data_buffer_size = 0x0040 + initsz + finisz; - data_buffer_size += (data_buffer_size & 7) ? 8 - (data_buffer_size & 7) : 0; + data_buffer_size = (data_buffer_size + 7) &~ (bfd_size_type) 7; data_buffer = NULL; data_buffer = (bfd_byte *) bfd_zmalloc (data_buffer_size); if (data_buffer == NULL) - return false; + return FALSE; - if (initsz) + if (initsz) { val = 0x10; bfd_h_put_32 (abfd, val, &data_buffer[0x04]); @@ -3723,7 +3752,7 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) memcpy (&data_buffer[val], init, initsz); } - if (finisz) + if (finisz) { val = 0x28; bfd_h_put_32 (abfd, val, &data_buffer[0x08]); @@ -3739,7 +3768,7 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) /* string table */ string_table_size = 0; - if (initsz > 9) + if (initsz > 9) string_table_size += initsz; if (finisz > 9) string_table_size += finisz; @@ -3748,18 +3777,18 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) string_table_size += 4; string_table = (bfd_byte *) bfd_zmalloc (string_table_size); if (string_table == NULL) - return false; + return FALSE; val = string_table_size; bfd_h_put_32 (abfd, val, &string_table[0]); st_tmp = string_table + 4; } - - /* symbols + + /* symbols 0. .data csect 2. __rtinit - 4. init function - 6. fini function + 4. init function + 6. fini function 8. __rtld */ memset (syment_ext, 0, 10 * SYMESZ); memset (reloc_ext, 0, 3 * RELSZ); @@ -3774,10 +3803,10 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) auxent.x_csect.x_scnlen.l = data_buffer_size; auxent.x_csect.x_smtyp = 3 << 3 | XTY_SD; auxent.x_csect.x_smclas = XMC_RW; - bfd_coff_swap_sym_out (abfd, &syment, + bfd_coff_swap_sym_out (abfd, &syment, &syment_ext[filehdr.f_nsyms * SYMESZ]); - bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, - syment.n_numaux, + bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, + syment.n_numaux, &syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]); filehdr.f_nsyms += 2; @@ -3790,20 +3819,20 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) syment.n_numaux = 1; auxent.x_csect.x_smtyp = XTY_LD; auxent.x_csect.x_smclas = XMC_RW; - bfd_coff_swap_sym_out (abfd, &syment, + bfd_coff_swap_sym_out (abfd, &syment, &syment_ext[filehdr.f_nsyms * SYMESZ]); - bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, - syment.n_numaux, + bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, + syment.n_numaux, &syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]); filehdr.f_nsyms += 2; /* init */ - if (initsz) + if (initsz) { memset (&syment, 0, sizeof (struct internal_syment)); memset (&auxent, 0, sizeof (union internal_auxent)); - if (initsz > 9) + if (initsz > 9) { syment._n._n_n._n_offset = st_tmp - string_table; memcpy (st_tmp, init, initsz); @@ -3814,10 +3843,10 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) syment.n_sclass = C_EXT; syment.n_numaux = 1; - bfd_coff_swap_sym_out (abfd, &syment, + bfd_coff_swap_sym_out (abfd, &syment, &syment_ext[filehdr.f_nsyms * SYMESZ]); - bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, - syment.n_numaux, + bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, + syment.n_numaux, &syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]); /* reloc */ @@ -3831,14 +3860,14 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) filehdr.f_nsyms += 2; scnhdr.s_nreloc += 1; } - + /* fini */ - if (finisz) + if (finisz) { memset (&syment, 0, sizeof (struct internal_syment)); memset (&auxent, 0, sizeof (union internal_auxent)); - if (finisz > 9) + if (finisz > 9) { syment._n._n_n._n_offset = st_tmp - string_table; memcpy (st_tmp, fini, finisz); @@ -3849,10 +3878,10 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) syment.n_sclass = C_EXT; syment.n_numaux = 1; - bfd_coff_swap_sym_out (abfd, &syment, + bfd_coff_swap_sym_out (abfd, &syment, &syment_ext[filehdr.f_nsyms * SYMESZ]); - bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, - syment.n_numaux, + bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, + syment.n_numaux, &syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]); /* reloc */ @@ -3861,7 +3890,7 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) reloc.r_symndx = filehdr.f_nsyms; reloc.r_type = R_POS; reloc.r_size = 31; - bfd_coff_swap_reloc_out (abfd, &reloc, + bfd_coff_swap_reloc_out (abfd, &reloc, &reloc_ext[scnhdr.s_nreloc * RELSZ]); filehdr.f_nsyms += 2; @@ -3875,10 +3904,10 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) memcpy (syment._n._n_name, rtld_name, strlen (rtld_name)); syment.n_sclass = C_EXT; syment.n_numaux = 1; - bfd_coff_swap_sym_out (abfd, &syment, + bfd_coff_swap_sym_out (abfd, &syment, &syment_ext[filehdr.f_nsyms * SYMESZ]); - bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, - syment.n_numaux, + bfd_coff_swap_aux_out (abfd, &auxent, syment.n_type, syment.n_sclass, 0, + syment.n_numaux, &syment_ext[(filehdr.f_nsyms + 1) * SYMESZ]); /* reloc */ @@ -3887,7 +3916,7 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) reloc.r_symndx = filehdr.f_nsyms; reloc.r_type = R_POS; reloc.r_size = 31; - bfd_coff_swap_reloc_out (abfd, &reloc, + bfd_coff_swap_reloc_out (abfd, &reloc, &reloc_ext[scnhdr.s_nreloc * RELSZ]); filehdr.f_nsyms += 2; @@ -3909,24 +3938,24 @@ xcoff_generate_rtinit (abfd, init, fini, rtld) free (data_buffer); data_buffer = NULL; - return true; + return TRUE; } static reloc_howto_type xcoff_dynamic_reloc = -HOWTO (0, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ +HOWTO (0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_POS", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false); /* pcrel_offset */ + 0, /* special_function */ + "R_POS", /* name */ + TRUE, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE); /* pcrel_offset */ /* glink @@ -3968,11 +3997,11 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = RELSZ, LINESZ, FILNMLEN, - true, /* _bfd_coff_long_filenames */ - false, /* _bfd_coff_long_section_names */ + TRUE, /* _bfd_coff_long_filenames */ + FALSE, /* _bfd_coff_long_section_names */ 3, /* _bfd_coff_default_section_alignment_power */ - false, /* _bfd_coff_force_symnames_in_strings */ - 2, /* _bfd_coff_debug_string_prefix_length */ + FALSE, /* _bfd_coff_force_symnames_in_strings */ + 2, /* _bfd_coff_debug_string_prefix_length */ coff_swap_filehdr_in, coff_swap_aouthdr_in, coff_swap_scnhdr_in, @@ -3988,9 +4017,9 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = coff_print_aux, dummy_reloc16_extra_cases, dummy_reloc16_estimate, - NULL, /* bfd_coff_sym_is_global */ + NULL, /* bfd_coff_sym_is_global */ coff_compute_section_file_positions, - NULL, /* _bfd_coff_start_final_link */ + NULL, /* _bfd_coff_start_final_link */ xcoff_ppc_relocate_section, coff_rtype_to_howto, NULL, /* _bfd_coff_adjust_symndx */ @@ -3999,7 +4028,7 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = coff_final_link_postscript }, - 0x01DF, /* magic number */ + 0x01DF, /* magic number */ bfd_arch_rs6000, bfd_mach_rs6k, @@ -4015,11 +4044,11 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = LDHDRSZ, LDSYMSZ, LDRELSZ, - 12, /* _xcoff_function_descriptor_size */ + 12, /* _xcoff_function_descriptor_size */ SMALL_AOUTSZ, - /* Versions. */ - 1, /* _xcoff_ldhdr_version */ + /* Versions. */ + 1, /* _xcoff_ldhdr_version */ _bfd_xcoff_put_symbol_name, _bfd_xcoff_put_ldsymbol_name, @@ -4034,31 +4063,31 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = xcoff_loader_reloc_offset, /* glink. */ - & xcoff_glink_code[0], + &xcoff_glink_code[0], 36, /* _xcoff_glink_size */ /* rtinit */ - 64, /* _xcoff_rtinit_size */ + 64, /* _xcoff_rtinit_size */ xcoff_generate_rtinit, -}; + }; /* The transfer vector that leads the outside world to all of the above. */ const bfd_target rs6000coff_vec = -{ - "aixcoff-rs6000", - bfd_target_xcoff_flavour, - BFD_ENDIAN_BIG, /* data byte order is big */ - BFD_ENDIAN_BIG, /* header byte order is big */ + { + "aixcoff-rs6000", + bfd_target_xcoff_flavour, + BFD_ENDIAN_BIG, /* data byte order is big */ + BFD_ENDIAN_BIG, /* header byte order is big */ (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | DYNAMIC | HAS_SYMS | HAS_LOCALS | WP_TEXT), - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), - 0, /* leading char */ - '/', /* ar_pad_char */ + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA, + 0, /* leading char */ + '/', /* ar_pad_char */ 15, /* ar_max_namelen */ - /* data */ + /* data */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, @@ -4069,7 +4098,7 @@ const bfd_target rs6000coff_vec = bfd_getb_signed_16, bfd_putb16, - /* hdrs */ + /* hdrs */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, @@ -4080,51 +4109,51 @@ const bfd_target rs6000coff_vec = bfd_getb_signed_16, bfd_putb16, - { /* bfd_check_format */ - _bfd_dummy_target, - coff_object_p, - _bfd_xcoff_archive_p, - CORE_FILE_P - }, + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + _bfd_xcoff_archive_p, + CORE_FILE_P + }, - { /* bfd_set_format */ - bfd_false, - coff_mkobject, - _bfd_generic_mkarchive, - bfd_false - }, + { /* bfd_set_format */ + bfd_false, + coff_mkobject, + _bfd_generic_mkarchive, + bfd_false + }, - {/* bfd_write_contents */ - bfd_false, - coff_write_object_contents, - _bfd_xcoff_write_archive_contents, - bfd_false - }, + {/* bfd_write_contents */ + bfd_false, + coff_write_object_contents, + _bfd_xcoff_write_archive_contents, + bfd_false + }, - /* Generic */ + /* Generic */ bfd_true, bfd_true, coff_new_section_hook, _bfd_generic_get_section_contents, - _bfd_generic_get_section_contents_in_window, + _bfd_generic_get_section_contents_in_window, - /* Copy */ + /* Copy */ _bfd_xcoff_copy_private_bfd_data, - ((boolean (*) (bfd *, bfd *)) bfd_true), - ((boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), - ((boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), - ((boolean (*) (bfd *, flagword)) bfd_true), - ((boolean (*) (bfd *, void * )) bfd_true), + ((bfd_boolean (*) (bfd *, bfd *)) bfd_true), + ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), + ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), + ((bfd_boolean (*) (bfd *, flagword)) bfd_true), + ((bfd_boolean (*) (bfd *, void * )) bfd_true), - /* Core */ + /* Core */ coff_core_file_failing_command, coff_core_file_failing_signal, - coff_core_file_matches_executable_p, + coff_core_file_matches_executable_p, - /* Archive */ + /* Archive */ _bfd_xcoff_slurp_armap, bfd_false, - ((boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), + ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), bfd_dont_truncate_arname, _bfd_xcoff_write_armap, _bfd_xcoff_read_ar_hdr, @@ -4133,9 +4162,9 @@ const bfd_target rs6000coff_vec = _bfd_xcoff_stat_arch_elt, bfd_true, - /* Symbols */ + /* Symbols */ coff_get_symtab_upper_bound, - coff_get_symtab, + coff_canonicalize_symtab, coff_make_empty_symbol, coff_print_symbol, coff_get_symbol_info, @@ -4146,18 +4175,18 @@ const bfd_target rs6000coff_vec = _bfd_generic_read_minisymbols, _bfd_generic_minisymbol_to_symbol, - /* Reloc */ + /* Reloc */ coff_get_reloc_upper_bound, coff_canonicalize_reloc, _bfd_xcoff_reloc_type_lookup, - /* Write */ + /* Write */ coff_set_arch_mach, coff_set_section_contents, - /* Link */ + /* Link */ _bfd_xcoff_sizeof_headers, - bfd_generic_get_relocated_section_contents, + bfd_generic_get_relocated_section_contents, bfd_generic_relax_section, _bfd_xcoff_bfd_link_hash_table_create, _bfd_generic_link_hash_table_free, @@ -4169,17 +4198,17 @@ const bfd_target rs6000coff_vec = bfd_generic_merge_sections, bfd_generic_discard_group, - /* Dynamic */ - _bfd_xcoff_get_dynamic_symtab_upper_bound, + /* Dynamic */ + _bfd_xcoff_get_dynamic_symtab_upper_bound, _bfd_xcoff_canonicalize_dynamic_symtab, _bfd_xcoff_get_dynamic_reloc_upper_bound, _bfd_xcoff_canonicalize_dynamic_reloc, - /* Opposite endian version, none exists */ - NULL, + /* Opposite endian version, none exists */ + NULL, - (void *) &bfd_xcoff_backend_data, -}; + (void *) &bfd_xcoff_backend_data, + }; /* xcoff-powermac target Old target. @@ -4190,7 +4219,7 @@ const bfd_target rs6000coff_vec = (because that's how they were bootstrapped originally), but they are always PowerPC architecture. */ static const struct xcoff_backend_data_rec bfd_pmac_xcoff_backend_data = -{ + { { /* COFF backend, defined in libcoff.h. */ _bfd_xcoff_swap_aux_in, _bfd_xcoff_swap_sym_in, @@ -4210,11 +4239,11 @@ static const struct xcoff_backend_data_rec bfd_pmac_xcoff_backend_data = RELSZ, LINESZ, FILNMLEN, - true, /* _bfd_coff_long_filenames */ - false, /* _bfd_coff_long_section_names */ + TRUE, /* _bfd_coff_long_filenames */ + FALSE, /* _bfd_coff_long_section_names */ 3, /* _bfd_coff_default_section_alignment_power */ - false, /* _bfd_coff_force_symnames_in_strings */ - 2, /* _bfd_coff_debug_string_prefix_length */ + FALSE, /* _bfd_coff_force_symnames_in_strings */ + 2, /* _bfd_coff_debug_string_prefix_length */ coff_swap_filehdr_in, coff_swap_aouthdr_in, coff_swap_scnhdr_in, @@ -4230,18 +4259,18 @@ static const struct xcoff_backend_data_rec bfd_pmac_xcoff_backend_data = coff_print_aux, dummy_reloc16_extra_cases, dummy_reloc16_estimate, - NULL, /* bfd_coff_sym_is_global */ - coff_compute_section_file_positions, - NULL, /* _bfd_coff_start_final_link */ + NULL, /* bfd_coff_sym_is_global */ + coff_compute_section_file_positions, + NULL, /* _bfd_coff_start_final_link */ xcoff_ppc_relocate_section, coff_rtype_to_howto, NULL, /* _bfd_coff_adjust_symndx */ _bfd_generic_link_add_one_symbol, coff_link_output_has_begun, coff_final_link_postscript - }, + }, - 0x01DF, /* magic number */ + 0x01DF, /* magic number */ bfd_arch_powerpc, bfd_mach_ppc, @@ -4257,11 +4286,11 @@ static const struct xcoff_backend_data_rec bfd_pmac_xcoff_backend_data = LDHDRSZ, LDSYMSZ, LDRELSZ, - 12, /* _xcoff_function_descriptor_size */ + 12, /* _xcoff_function_descriptor_size */ SMALL_AOUTSZ, /* Versions. */ - 1, /* _xcoff_ldhdr_version */ + 1, /* _xcoff_ldhdr_version */ _bfd_xcoff_put_symbol_name, _bfd_xcoff_put_ldsymbol_name, @@ -4269,38 +4298,38 @@ static const struct xcoff_backend_data_rec bfd_pmac_xcoff_backend_data = xcoff_create_csect_from_smclas, /* Lineno and reloc count overflow. */ - xcoff_is_lineno_count_overflow, - xcoff_is_reloc_count_overflow, + xcoff_is_lineno_count_overflow, + xcoff_is_reloc_count_overflow, - xcoff_loader_symbol_offset, - xcoff_loader_reloc_offset, + xcoff_loader_symbol_offset, + xcoff_loader_reloc_offset, /* glink. */ - &xcoff_glink_code[0], + &xcoff_glink_code[0], 36, /* _xcoff_glink_size */ - /* rtinit */ - 0, /* _xcoff_rtinit_size */ + /* rtinit */ + 0, /* _xcoff_rtinit_size */ xcoff_generate_rtinit, -}; + }; -/* The transfer vector that leads the outside world to all of the above. */ +/* The transfer vector that leads the outside world to all of the above. */ const bfd_target pmac_xcoff_vec = -{ - "xcoff-powermac", - bfd_target_xcoff_flavour, - BFD_ENDIAN_BIG, /* data byte order is big */ - BFD_ENDIAN_BIG, /* header byte order is big */ + { + "xcoff-powermac", + bfd_target_xcoff_flavour, + BFD_ENDIAN_BIG, /* data byte order is big */ + BFD_ENDIAN_BIG, /* header byte order is big */ (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | DYNAMIC | HAS_SYMS | HAS_LOCALS | WP_TEXT), - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), - 0, /* leading char */ - '/', /* ar_pad_char */ + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA, + 0, /* leading char */ + '/', /* ar_pad_char */ 15, /* ar_max_namelen */ - /* data */ + /* data */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, @@ -4311,7 +4340,7 @@ const bfd_target pmac_xcoff_vec = bfd_getb_signed_16, bfd_putb16, - /* hdrs */ + /* hdrs */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, @@ -4322,51 +4351,51 @@ const bfd_target pmac_xcoff_vec = bfd_getb_signed_16, bfd_putb16, - { /* bfd_check_format */ - _bfd_dummy_target, - coff_object_p, - _bfd_xcoff_archive_p, - CORE_FILE_P - }, + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + _bfd_xcoff_archive_p, + CORE_FILE_P + }, - { /* bfd_set_format */ - bfd_false, - coff_mkobject, - _bfd_generic_mkarchive, - bfd_false - }, + { /* bfd_set_format */ + bfd_false, + coff_mkobject, + _bfd_generic_mkarchive, + bfd_false + }, - {/* bfd_write_contents */ - bfd_false, - coff_write_object_contents, - _bfd_xcoff_write_archive_contents, - bfd_false - }, + {/* bfd_write_contents */ + bfd_false, + coff_write_object_contents, + _bfd_xcoff_write_archive_contents, + bfd_false + }, - /* Generic */ + /* Generic */ bfd_true, bfd_true, coff_new_section_hook, _bfd_generic_get_section_contents, - _bfd_generic_get_section_contents_in_window, + _bfd_generic_get_section_contents_in_window, - /* Copy */ + /* Copy */ _bfd_xcoff_copy_private_bfd_data, - ((boolean (*) (bfd *, bfd *)) bfd_true), - ((boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), - ((boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), - ((boolean (*) (bfd *, flagword)) bfd_true), - ((boolean (*) (bfd *, void * )) bfd_true), + ((bfd_boolean (*) (bfd *, bfd *)) bfd_true), + ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), + ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), + ((bfd_boolean (*) (bfd *, flagword)) bfd_true), + ((bfd_boolean (*) (bfd *, void * )) bfd_true), - /* Core */ + /* Core */ coff_core_file_failing_command, coff_core_file_failing_signal, - coff_core_file_matches_executable_p, + coff_core_file_matches_executable_p, - /* Archive */ + /* Archive */ _bfd_xcoff_slurp_armap, bfd_false, - ((boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), + ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), bfd_dont_truncate_arname, _bfd_xcoff_write_armap, _bfd_xcoff_read_ar_hdr, @@ -4375,9 +4404,9 @@ const bfd_target pmac_xcoff_vec = _bfd_xcoff_stat_arch_elt, bfd_true, - /* Symbols */ + /* Symbols */ coff_get_symtab_upper_bound, - coff_get_symtab, + coff_canonicalize_symtab, coff_make_empty_symbol, coff_print_symbol, coff_get_symbol_info, @@ -4388,18 +4417,18 @@ const bfd_target pmac_xcoff_vec = _bfd_generic_read_minisymbols, _bfd_generic_minisymbol_to_symbol, - /* Reloc */ + /* Reloc */ coff_get_reloc_upper_bound, coff_canonicalize_reloc, _bfd_xcoff_reloc_type_lookup, - /* Write */ + /* Write */ coff_set_arch_mach, coff_set_section_contents, - /* Link */ + /* Link */ _bfd_xcoff_sizeof_headers, - bfd_generic_get_relocated_section_contents, + bfd_generic_get_relocated_section_contents, bfd_generic_relax_section, _bfd_xcoff_bfd_link_hash_table_create, _bfd_generic_link_hash_table_free, @@ -4411,14 +4440,14 @@ const bfd_target pmac_xcoff_vec = bfd_generic_merge_sections, bfd_generic_discard_group, - /* Dynamic */ - _bfd_xcoff_get_dynamic_symtab_upper_bound, + /* Dynamic */ + _bfd_xcoff_get_dynamic_symtab_upper_bound, _bfd_xcoff_canonicalize_dynamic_symtab, _bfd_xcoff_get_dynamic_reloc_upper_bound, _bfd_xcoff_canonicalize_dynamic_reloc, - /* Opposite endian version, none exists */ - NULL, + /* Opposite endian version, none exists */ + NULL, - (void *) &bfd_pmac_xcoff_backend_data, -}; + (void *) &bfd_pmac_xcoff_backend_data, + }; diff --git a/contrib/binutils/bfd/coff-sparc.c b/contrib/binutils/bfd/coff-sparc.c index 35c23df..372b1a7 100644 --- a/contrib/binutils/bfd/coff-sparc.c +++ b/contrib/binutils/bfd/coff-sparc.c @@ -1,6 +1,6 @@ /* BFD back-end for Sparc COFF files. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001 - Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001, + 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -103,30 +103,30 @@ bfd_coff_generic_reloc (abfd, reloc_entry, symbol, data, input_section, 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), - HOWTO(R_SPARC_16, 0,1,16,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_16", false,0,0x0000ffff,true), - HOWTO(R_SPARC_32, 0,2,32,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_32", false,0,0xffffffff,true), - HOWTO(R_SPARC_DISP8, 0,0, 8,true, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP8", false,0,0x000000ff,true), - HOWTO(R_SPARC_DISP16, 0,1,16,true, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP16", false,0,0x0000ffff,true), - HOWTO(R_SPARC_DISP32, 0,2,32,true, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP32", false,0,0x00ffffff,true), - HOWTO(R_SPARC_WDISP30, 2,2,30,true, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_WDISP30", false,0,0x3fffffff,true), - HOWTO(R_SPARC_WDISP22, 2,2,22,true, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_WDISP22", false,0,0x003fffff,true), - HOWTO(R_SPARC_HI22, 10,2,22,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_HI22", false,0,0x003fffff,true), - HOWTO(R_SPARC_22, 0,2,22,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_22", false,0,0x003fffff,true), - HOWTO(R_SPARC_13, 0,2,13,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_13", false,0,0x00001fff,true), - HOWTO(R_SPARC_LO10, 0,2,10,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_LO10", false,0,0x000003ff,true), - HOWTO(R_SPARC_GOT10, 0,2,10,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT10", false,0,0x000003ff,true), - HOWTO(R_SPARC_GOT13, 0,2,13,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT13", false,0,0x00001fff,true), - HOWTO(R_SPARC_GOT22, 10,2,22,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT22", false,0,0x003fffff,true), - HOWTO(R_SPARC_PC10, 0,2,10,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_PC10", false,0,0x000003ff,true), - HOWTO(R_SPARC_PC22, 0,2,22,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_PC22", false,0,0x003fffff,true), - HOWTO(R_SPARC_WPLT30, 0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_WPLT30", false,0,0x00000000,true), - HOWTO(R_SPARC_COPY, 0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_COPY", false,0,0x00000000,true), - HOWTO(R_SPARC_GLOB_DAT,0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_GLOB_DAT",false,0,0x00000000,true), - HOWTO(R_SPARC_JMP_SLOT,0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_JMP_SLOT",false,0,0x00000000,true), - HOWTO(R_SPARC_RELATIVE,0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_RELATIVE",false,0,0x00000000,true), - HOWTO(R_SPARC_UA32, 0,0,00,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_UA32", false,0,0x00000000,true), + 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), + HOWTO(R_SPARC_16, 0,1,16,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_16", FALSE,0,0x0000ffff,TRUE), + HOWTO(R_SPARC_32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_32", FALSE,0,0xffffffff,TRUE), + HOWTO(R_SPARC_DISP8, 0,0, 8,TRUE, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP8", FALSE,0,0x000000ff,TRUE), + HOWTO(R_SPARC_DISP16, 0,1,16,TRUE, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP16", FALSE,0,0x0000ffff,TRUE), + HOWTO(R_SPARC_DISP32, 0,2,32,TRUE, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_DISP32", FALSE,0,0x00ffffff,TRUE), + HOWTO(R_SPARC_WDISP30, 2,2,30,TRUE, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_WDISP30", FALSE,0,0x3fffffff,TRUE), + HOWTO(R_SPARC_WDISP22, 2,2,22,TRUE, 0,complain_overflow_signed, bfd_coff_generic_reloc,"R_SPARC_WDISP22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_HI22, 10,2,22,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_HI22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_22, 0,2,22,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_13, 0,2,13,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_13", FALSE,0,0x00001fff,TRUE), + HOWTO(R_SPARC_LO10, 0,2,10,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_LO10", FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_GOT10, 0,2,10,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT10", FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_GOT13, 0,2,13,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT13", FALSE,0,0x00001fff,TRUE), + HOWTO(R_SPARC_GOT22, 10,2,22,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_GOT22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_PC10, 0,2,10,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_PC10", FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_PC22, 0,2,22,FALSE,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_PC22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_WPLT30, 0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_WPLT30", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_COPY, 0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_COPY", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_GLOB_DAT,0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_GLOB_DAT",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_JMP_SLOT,0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_JMP_SLOT",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_RELATIVE,0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_RELATIVE",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_UA32, 0,0,00,FALSE,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_UA32", FALSE,0,0x00000000,TRUE), }; struct coff_reloc_map { @@ -216,4 +216,4 @@ rtype2howto (cache_ptr, dst) #define TARGET_NAME "coff-sparc" #endif -CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, '_', NULL) +CREATE_BIG_COFF_TARGET_VEC (TARGET_SYM, TARGET_NAME, D_PAGED, 0, '_', NULL, COFF_SWAP_TABLE) diff --git a/contrib/binutils/bfd/coff64-rs6000.c b/contrib/binutils/bfd/coff64-rs6000.c index 9372f6b..ec9c695 100644 --- a/contrib/binutils/bfd/coff64-rs6000.c +++ b/contrib/binutils/bfd/coff64-rs6000.c @@ -1,5 +1,5 @@ /* BFD back-end for IBM RS/6000 "XCOFF64" files. - Copyright 2000, 2001, 2002 + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written Clinton Popetz. Contributed by Cygnus Support. @@ -82,39 +82,56 @@ #define coff_SWAP_lineno_in _bfd_xcoff64_swap_lineno_in #define coff_SWAP_lineno_out _bfd_xcoff64_swap_lineno_out -static void _bfd_xcoff64_swap_lineno_in PARAMS ((bfd *, PTR, PTR)); -static unsigned int _bfd_xcoff64_swap_lineno_out PARAMS ((bfd *, PTR, PTR)); -static boolean _bfd_xcoff64_put_symbol_name +static void _bfd_xcoff64_swap_lineno_in + PARAMS ((bfd *, PTR, PTR)); +static unsigned int _bfd_xcoff64_swap_lineno_out + PARAMS ((bfd *, PTR, PTR)); +static bfd_boolean _bfd_xcoff64_put_symbol_name PARAMS ((bfd *, struct bfd_strtab_hash *, struct internal_syment *, const char *)); -static boolean _bfd_xcoff64_put_ldsymbol_name +static bfd_boolean _bfd_xcoff64_put_ldsymbol_name PARAMS ((bfd *, struct xcoff_loader_info *, struct internal_ldsym *, const char *)); -static void _bfd_xcoff64_swap_sym_in PARAMS ((bfd *, PTR, PTR)); -static unsigned int _bfd_xcoff64_swap_sym_out PARAMS ((bfd *, PTR, PTR)); +static void _bfd_xcoff64_swap_sym_in + PARAMS ((bfd *, PTR, PTR)); +static unsigned int _bfd_xcoff64_swap_sym_out + PARAMS ((bfd *, PTR, PTR)); static void _bfd_xcoff64_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR)); static unsigned int _bfd_xcoff64_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR)); -static void xcoff64_swap_reloc_in PARAMS ((bfd *, PTR, PTR)); -static unsigned int xcoff64_swap_reloc_out PARAMS ((bfd *, PTR, PTR)); -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 *)); +static void xcoff64_swap_reloc_in + PARAMS ((bfd *, PTR, PTR)); +static unsigned int xcoff64_swap_reloc_out + PARAMS ((bfd *, PTR, PTR)); +extern bfd_boolean _bfd_xcoff_mkobject + PARAMS ((bfd *)); +extern bfd_boolean _bfd_xcoff_copy_private_bfd_data + PARAMS ((bfd *, bfd *)); +extern bfd_boolean _bfd_xcoff_is_local_label_name + PARAMS ((bfd *, const char *)); extern void xcoff64_rtype2howto PARAMS ((arelent *, struct internal_reloc *)); extern reloc_howto_type * xcoff64_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); -extern boolean _bfd_xcoff_slurp_armap 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_stat_arch_elt PARAMS ((bfd *, struct stat *)); -extern boolean _bfd_xcoff_write_armap +extern bfd_boolean _bfd_xcoff_slurp_armap + 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_stat_arch_elt + PARAMS ((bfd *, struct stat *)); +extern bfd_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 bfd_boolean _bfd_xcoff_write_archive_contents + PARAMS ((bfd *)); +extern int _bfd_xcoff_sizeof_headers + PARAMS ((bfd *, 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 @@ -131,61 +148,70 @@ static void xcoff64_swap_ldrel_in PARAMS ((bfd *, const PTR, struct internal_ldrel *)); static void xcoff64_swap_ldrel_out PARAMS ((bfd *, const struct internal_ldrel *, PTR d)); -static boolean xcoff64_write_object_contents PARAMS ((bfd *)); -static boolean xcoff64_ppc_relocate_section +static bfd_boolean xcoff64_write_object_contents + PARAMS ((bfd *)); +static bfd_boolean xcoff64_ppc_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **)); -static boolean xcoff64_slurp_armap PARAMS ((bfd *)); -static const bfd_target *xcoff64_archive_p PARAMS ((bfd *)); -static bfd *xcoff64_openr_next_archived_file PARAMS ((bfd *, bfd *)); -static int xcoff64_sizeof_headers PARAMS ((bfd *, boolean)); +static bfd_boolean xcoff64_slurp_armap + PARAMS ((bfd *)); +static const bfd_target *xcoff64_archive_p + PARAMS ((bfd *)); +static bfd *xcoff64_openr_next_archived_file + PARAMS ((bfd *, bfd *)); +static int xcoff64_sizeof_headers + PARAMS ((bfd *, bfd_boolean)); static asection *xcoff64_create_csect_from_smclas PARAMS ((bfd *, union internal_auxent *, const char *)); -static boolean xcoff64_is_lineno_count_overflow PARAMS ((bfd *, bfd_vma)); -static boolean xcoff64_is_reloc_count_overflow PARAMS ((bfd *, bfd_vma)); +static bfd_boolean xcoff64_is_lineno_count_overflow + PARAMS ((bfd *, bfd_vma)); +static bfd_boolean xcoff64_is_reloc_count_overflow + PARAMS ((bfd *, bfd_vma)); static bfd_vma xcoff64_loader_symbol_offset PARAMS ((bfd *, struct internal_ldhdr *)); static bfd_vma xcoff64_loader_reloc_offset PARAMS ((bfd *, struct internal_ldhdr *)); -static boolean xcoff64_generate_rtinit - PARAMS ((bfd *, const char *, const char *, boolean)); -static boolean xcoff64_bad_format_hook PARAMS ((bfd *, PTR )); +static bfd_boolean xcoff64_generate_rtinit + PARAMS ((bfd *, const char *, const char *, bfd_boolean)); +static bfd_boolean xcoff64_bad_format_hook + PARAMS ((bfd *, PTR )); /* Relocation functions */ -static boolean xcoff64_reloc_type_br PARAMS ((XCOFF_RELOC_FUNCTION_ARGS)); +static bfd_boolean xcoff64_reloc_type_br + PARAMS ((XCOFF_RELOC_FUNCTION_ARGS)); -boolean (*xcoff64_calculate_relocation[XCOFF_MAX_CALCULATE_RELOCATION]) +bfd_boolean (*xcoff64_calculate_relocation[XCOFF_MAX_CALCULATE_RELOCATION]) PARAMS ((XCOFF_RELOC_FUNCTION_ARGS)) = { - xcoff_reloc_type_pos, /* R_POS (0x00) */ - xcoff_reloc_type_neg, /* R_NEG (0x01) */ - xcoff_reloc_type_rel, /* R_REL (0x02) */ - xcoff_reloc_type_toc, /* R_TOC (0x03) */ + xcoff_reloc_type_pos, /* R_POS (0x00) */ + xcoff_reloc_type_neg, /* R_NEG (0x01) */ + xcoff_reloc_type_rel, /* R_REL (0x02) */ + xcoff_reloc_type_toc, /* R_TOC (0x03) */ xcoff_reloc_type_fail, /* R_RTB (0x04) */ - xcoff_reloc_type_toc, /* R_GL (0x05) */ - xcoff_reloc_type_toc, /* R_TCL (0x06) */ - xcoff_reloc_type_fail, /* (0x07) */ - xcoff_reloc_type_ba, /* R_BA (0x08) */ - xcoff_reloc_type_fail, /* (0x09) */ + xcoff_reloc_type_toc, /* R_GL (0x05) */ + xcoff_reloc_type_toc, /* R_TCL (0x06) */ + xcoff_reloc_type_fail, /* (0x07) */ + xcoff_reloc_type_ba, /* R_BA (0x08) */ + xcoff_reloc_type_fail, /* (0x09) */ xcoff64_reloc_type_br, /* R_BR (0x0a) */ - xcoff_reloc_type_fail, /* (0x0b) */ - xcoff_reloc_type_pos, /* R_RL (0x0c) */ - xcoff_reloc_type_pos, /* R_RLA (0x0d) */ - xcoff_reloc_type_fail, /* (0x0e) */ + xcoff_reloc_type_fail, /* (0x0b) */ + xcoff_reloc_type_pos, /* R_RL (0x0c) */ + xcoff_reloc_type_pos, /* R_RLA (0x0d) */ + xcoff_reloc_type_fail, /* (0x0e) */ xcoff_reloc_type_noop, /* R_REF (0x0f) */ - xcoff_reloc_type_fail, /* (0x10) */ - xcoff_reloc_type_fail, /* (0x11) */ - xcoff_reloc_type_toc, /* R_TRL (0x12) */ - xcoff_reloc_type_toc, /* R_TRLA (0x13) */ + xcoff_reloc_type_fail, /* (0x10) */ + xcoff_reloc_type_fail, /* (0x11) */ + xcoff_reloc_type_toc, /* R_TRL (0x12) */ + xcoff_reloc_type_toc, /* R_TRLA (0x13) */ xcoff_reloc_type_fail, /* R_RRTBI (0x14) */ xcoff_reloc_type_fail, /* R_RRTBA (0x15) */ - xcoff_reloc_type_ba, /* R_CAI (0x16) */ + xcoff_reloc_type_ba, /* R_CAI (0x16) */ xcoff_reloc_type_crel, /* R_CREL (0x17) */ - xcoff_reloc_type_ba, /* R_RBA (0x18) */ - xcoff_reloc_type_ba, /* R_RBAC (0x19) */ + xcoff_reloc_type_ba, /* R_RBA (0x18) */ + xcoff_reloc_type_ba, /* R_RBAC (0x19) */ xcoff64_reloc_type_br, /* R_RBR (0x1a) */ - xcoff_reloc_type_ba, /* R_RBRC (0x1b) */ + xcoff_reloc_type_ba, /* R_RBRC (0x1b) */ }; /* coffcode.h needs these to be defined. */ @@ -212,11 +238,14 @@ boolean (*xcoff64_calculate_relocation[XCOFF_MAX_CALCULATE_RELOCATION]) #define coff_bfd_is_local_label_name _bfd_xcoff_is_local_label_name #define coff_bfd_reloc_type_lookup xcoff64_reloc_type_lookup #ifdef AIX_CORE -extern const bfd_target * rs6000coff_core_p PARAMS ((bfd *abfd)); -extern boolean rs6000coff_core_file_matches_executable_p - PARAMS((bfd *cbfd, bfd *ebfd)); -extern char *rs6000coff_core_file_failing_command PARAMS ((bfd *abfd)); -extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd)); +extern const bfd_target * rs6000coff_core_p + PARAMS ((bfd *abfd)); +extern bfd_boolean rs6000coff_core_file_matches_executable_p + PARAMS ((bfd *cbfd, bfd *ebfd)); +extern char *rs6000coff_core_file_failing_command + PARAMS ((bfd *abfd)); +extern int rs6000coff_core_file_failing_signal + PARAMS ((bfd *abfd)); #define CORE_FILE_P rs6000coff_core_p #define coff_core_file_failing_command \ rs6000coff_core_file_failing_command @@ -496,33 +525,33 @@ _bfd_xcoff64_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) return bfd_coff_auxesz (abfd); } -static boolean +static bfd_boolean _bfd_xcoff64_put_symbol_name (abfd, strtab, sym, name) bfd *abfd; struct bfd_strtab_hash *strtab; struct internal_syment *sym; const char *name; { - boolean hash; + bfd_boolean hash; bfd_size_type indx; - hash = true; + hash = TRUE; if ((abfd->flags & BFD_TRADITIONAL_FORMAT) != 0) - hash = false; + hash = FALSE; - indx = _bfd_stringtab_add (strtab, name, hash, false); + indx = _bfd_stringtab_add (strtab, name, hash, FALSE); if (indx == (bfd_size_type) -1) - return false; + return FALSE; sym->_n._n_n._n_zeroes = 0; sym->_n._n_n._n_offset = STRING_SIZE_SIZE + indx; - return true; + return TRUE; } -static boolean +static bfd_boolean _bfd_xcoff64_put_ldsymbol_name (abfd, ldinfo, ldsym, name) bfd *abfd ATTRIBUTE_UNUSED; struct xcoff_loader_info *ldinfo; @@ -547,8 +576,8 @@ _bfd_xcoff64_put_ldsymbol_name (abfd, ldinfo, ldsym, name) bfd_realloc ((PTR) ldinfo->strings, newalc)); if (newstrings == NULL) { - ldinfo->failed = true; - return false; + ldinfo->failed = TRUE; + return FALSE; } ldinfo->string_alc = newalc; ldinfo->strings = newstrings; @@ -561,7 +590,7 @@ _bfd_xcoff64_put_ldsymbol_name (abfd, ldinfo, ldsym, name) ldsym->_l._l_l._l_offset = ldinfo->string_size + 2; ldinfo->string_size += len + 3; - return true; + return TRUE; } /* Routines to swap information in the XCOFF .loader section. If we @@ -720,20 +749,20 @@ xcoff64_swap_ldrel_out (abfd, src, d) bfd_put_32 (abfd, src->l_symndx, dst->l_symndx); } -static boolean +static bfd_boolean xcoff64_write_object_contents (abfd) - bfd * abfd; + bfd *abfd; { asection *current; - boolean hasrelocs = false; - boolean haslinno = false; + bfd_boolean hasrelocs = FALSE; + bfd_boolean haslinno = FALSE; file_ptr scn_base; file_ptr reloc_base; file_ptr lineno_base; file_ptr sym_base; unsigned long reloc_size = 0; unsigned long lnno_size = 0; - boolean long_section_names; + bfd_boolean long_section_names; asection *text_sec = ((void *) 0); asection *data_sec = ((void *) 0); asection *bss_sec = ((void *) 0); @@ -745,7 +774,7 @@ xcoff64_write_object_contents (abfd) if (! abfd->output_has_begun) { if (! bfd_coff_compute_section_file_positions (abfd)) - return false; + return FALSE; } /* Work out the size of the reloc and linno areas. */ @@ -801,9 +830,9 @@ xcoff64_write_object_contents (abfd) internal_f.f_nscns = 0; if (bfd_seek (abfd, scn_base, SEEK_SET) != 0) - return false; + return FALSE; - long_section_names = false; + long_section_names = FALSE; for (current = abfd->sections; current != NULL; current = current->next) { struct internal_scnhdr section; @@ -836,9 +865,9 @@ xcoff64_write_object_contents (abfd) section.s_nlnno = current->lineno_count; if (current->reloc_count != 0) - hasrelocs = true; + hasrelocs = TRUE; if (current->lineno_count != 0) - haslinno = true; + haslinno = TRUE; section.s_flags = sec_to_styp_flags (current->name, current->flags); @@ -858,7 +887,7 @@ xcoff64_write_object_contents (abfd) amount = bfd_coff_scnhsz (abfd); if (bfd_coff_swap_scnhdr_out (abfd, §ion, &buff) == 0 || bfd_bwrite ((PTR) (&buff), amount, abfd) != amount) - return false; + return FALSE; } internal_f.f_timdat = 0; @@ -909,14 +938,14 @@ xcoff64_write_object_contents (abfd) int firstundef; if (!coff_renumber_symbols (abfd, &firstundef)) - return false; + return FALSE; coff_mangle_symbols (abfd); if (! coff_write_symbols (abfd)) - return false; + return FALSE; if (! coff_write_linenumbers (abfd)) - return false; + return FALSE; if (! coff_write_relocs (abfd, firstundef)) - return false; + return FALSE; internal_f.f_symptr = sym_base; internal_f.f_nsyms = bfd_get_symcount (abfd); @@ -1014,7 +1043,7 @@ xcoff64_write_object_contents (abfd) internal_a.o_cputype = 4; break; case bfd_arch_powerpc: - if (bfd_get_mach (abfd) == 0) + if (bfd_get_mach (abfd) == bfd_mach_ppc) internal_a.o_cputype = 3; else internal_a.o_cputype = 1; @@ -1028,7 +1057,7 @@ xcoff64_write_object_contents (abfd) } if (bfd_seek (abfd, (file_ptr) 0, 0) != 0) - return false; + return FALSE; { char * buff; @@ -1036,7 +1065,7 @@ xcoff64_write_object_contents (abfd) buff = bfd_malloc (amount); if (buff == NULL) - return false; + return FALSE; bfd_coff_swap_filehdr_out (abfd, (PTR) &internal_f, (PTR) buff); amount = bfd_bwrite ((PTR) buff, amount, abfd); @@ -1044,7 +1073,7 @@ xcoff64_write_object_contents (abfd) free (buff); if (amount != bfd_coff_filhsz (abfd)) - return false; + return FALSE; } if (abfd->flags & EXEC_P) @@ -1054,22 +1083,22 @@ xcoff64_write_object_contents (abfd) buff = bfd_malloc (amount); if (buff == NULL) - return false; + return FALSE; - bfd_coff_swap_aouthdr_out (abfd, (PTR) & internal_a, (PTR) buff); + bfd_coff_swap_aouthdr_out (abfd, (PTR) &internal_a, (PTR) buff); amount = bfd_bwrite ((PTR) buff, amount, abfd); free (buff); if (amount != bfd_coff_aoutsz (abfd)) - return false; + return FALSE; } - return true; + return TRUE; } -static boolean -xcoff64_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, +static bfd_boolean +xcoff64_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, val, addend, relocation, contents) bfd *input_bfd; asection *input_section; @@ -1084,8 +1113,8 @@ xcoff64_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, { struct xcoff_link_hash_entry *h; - if (0 > rel->r_symndx) - return false; + if (0 > rel->r_symndx) + return FALSE; h = obj_xcoff_sym_hashes (input_bfd)[rel->r_symndx]; @@ -1096,60 +1125,60 @@ xcoff64_reloc_type_br (input_bfd, input_section, output_bfd, rel, sym, howto, call is followed by a ld r2,40(r1), but the call is not going to global linkage code, we can replace the load with a cror. */ - if (NULL != h - && bfd_link_hash_defined == h->root.type + if (NULL != h + && bfd_link_hash_defined == h->root.type && (rel->r_vaddr - input_section->vma + 8 <= input_section->_cooked_size)) { bfd_byte *pnext; unsigned long next; - + pnext = contents + (rel->r_vaddr - input_section->vma) + 4; next = bfd_get_32 (input_bfd, pnext); - - /* The _ptrgl function is magic. It is used by the AIX compiler to call + + /* The _ptrgl function is magic. It is used by the AIX compiler to call a function through a pointer. */ - if (h->smclas == XMC_GL || strcmp (h->root.root.string, "._ptrgl") == 0) + if (h->smclas == XMC_GL || strcmp (h->root.root.string, "._ptrgl") == 0) { - if (next == 0x4def7b82 /* cror 15,15,15 */ - || next == 0x4ffffb82 /* cror 31,31,31 */ - || next == 0x60000000) /* ori r0,r0,0 */ - bfd_put_32 (input_bfd, 0xe8410028, pnext); /* ld r2,40(r1) */ - } - else + if (next == 0x4def7b82 /* cror 15,15,15 */ + || next == 0x4ffffb82 /* cror 31,31,31 */ + || next == 0x60000000) /* ori r0,r0,0 */ + bfd_put_32 (input_bfd, 0xe8410028, pnext); /* ld r2,40(r1) */ + } + else { - if (next == 0xe8410028) /* ld r2,40(r1) */ - bfd_put_32 (input_bfd, 0x60000000, pnext); /* ori r0,r0,0 */ + if (next == 0xe8410028) /* ld r2,40(r1) */ + bfd_put_32 (input_bfd, 0x60000000, pnext); /* ori r0,r0,0 */ } - } - else if (NULL != h && bfd_link_hash_undefined == h->root.type) + } + else if (NULL != h && bfd_link_hash_undefined == h->root.type) { /* Normally, this relocation is against a defined symbol. In the case where this is a partial link and the output section offset - is greater than 2^25, the linker will return an invalid error + is greater than 2^25, the linker will return an invalid error message that the relocation has been truncated. Yes it has been - truncated but no it not important. For this case, disable the + truncated but no it not important. For this case, disable the overflow checking. */ howto->complain_on_overflow = complain_overflow_dont; } - - howto->pc_relative = true; + + howto->pc_relative = TRUE; howto->src_mask &= ~3; howto->dst_mask = howto->src_mask; - + /* A PC relative reloc includes the section address. */ addend += input_section->vma; - + *relocation = val + addend; *relocation -= (input_section->output_section->vma + input_section->output_offset); - return true; + return TRUE; } /* This is the relocation function for the PowerPC64. See xcoff_ppc_relocation_section for more information. */ -boolean +bfd_boolean xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, syms, sections) @@ -1181,8 +1210,8 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, bfd_byte *location; /* Relocation type R_REF is a special relocation type which is - merely used to prevent garbage collection from occurring for - the csect including the symbol which it references. */ + merely used to prevent garbage collection from occurring for + the csect including the symbol which it references. */ if (rel->r_type == R_REF) continue; @@ -1191,33 +1220,33 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, howto.rightshift = 0; howto.bitsize = (rel->r_size & 0x3f) + 1; howto.size = howto.bitsize > 16 ? (howto.bitsize > 32 ? 4 : 2) : 1; - howto.pc_relative = false; + howto.pc_relative = FALSE; howto.bitpos = 0; howto.complain_on_overflow = (rel->r_size & 0x80 ? complain_overflow_signed : complain_overflow_bitfield); howto.special_function = NULL; howto.name = "internal"; - howto.partial_inplace = true; - howto.src_mask = howto.dst_mask = N_ONES(howto.bitsize); - howto.pcrel_offset = false; + howto.partial_inplace = TRUE; + howto.src_mask = howto.dst_mask = N_ONES (howto.bitsize); + howto.pcrel_offset = FALSE; /* symbol */ val = 0; addend = 0; h = NULL; sym = NULL; - symndx = rel->r_symndx; + symndx = rel->r_symndx; - if (-1 != symndx) + if (-1 != symndx) { asection *sec; - + h = obj_xcoff_sym_hashes (input_bfd)[symndx]; sym = syms + symndx; addend = - sym->n_value; - - if (NULL == h) + + if (NULL == h) { sec = sections[symndx]; /* Hack to make sure we use the right TOC anchor value @@ -1230,104 +1259,104 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, + sec->output_offset + sym->n_value - sec->vma); - } - else + } + else { - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) { sec = h->root.u.def.section; val = (h->root.u.def.value + sec->output_section->vma + sec->output_offset); - } - else if (h->root.type == bfd_link_hash_common) + } + else if (h->root.type == bfd_link_hash_common) { sec = h->root.u.c.p->section; val = (sec->output_section->vma + sec->output_offset); - } - else if ((0 == (h->flags & (XCOFF_DEF_DYNAMIC | XCOFF_IMPORT))) - && ! info->relocateable) + } + else if ((0 == (h->flags & (XCOFF_DEF_DYNAMIC | XCOFF_IMPORT))) + && ! info->relocatable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, - rel->r_vaddr - input_section->vma, true))) - return false; - + rel->r_vaddr - input_section->vma, TRUE))) + return FALSE; + /* Don't try to process the reloc. It can't help, and it may generate another error. */ continue; } } } - - if (rel->r_type >= XCOFF_MAX_CALCULATE_RELOCATION - || ((*xcoff64_calculate_relocation[rel->r_type]) - (input_bfd, input_section, output_bfd, rel, sym, &howto, val, - addend, &relocation, contents))) - return false; - + + if (rel->r_type >= XCOFF_MAX_CALCULATE_RELOCATION + || !((*xcoff64_calculate_relocation[rel->r_type]) + (input_bfd, input_section, output_bfd, rel, sym, &howto, val, + addend, &relocation, contents))) + return FALSE; + /* address */ address = rel->r_vaddr - input_section->vma; location = contents + address; - + if (address > input_section->_raw_size) - abort(); - + abort (); + /* Get the value we are going to relocate. */ if (1 == howto.size) value_to_relocate = bfd_get_16 (input_bfd, location); else if (2 == howto.size) value_to_relocate = bfd_get_32 (input_bfd, location); - else + else value_to_relocate = bfd_get_64 (input_bfd, location); - - /* overflow. - + + /* overflow. + FIXME: We may drop bits during the addition which we don't check for. We must either check at every single operation, which would be tedious, or we must do the computations in a type larger than bfd_vma, which would be inefficient. */ - + if ((unsigned int) howto.complain_on_overflow >= XCOFF_MAX_COMPLAIN_OVERFLOW) - abort(); - + abort (); + if (((*xcoff_complain_overflow[howto.complain_on_overflow]) - (input_bfd, value_to_relocate, relocation, &howto))) + (input_bfd, value_to_relocate, relocation, &howto))) { const char *name; char buf[SYMNMLEN + 1]; char reloc_type_name[10]; - - if (symndx == -1) + + if (symndx == -1) { name = "*ABS*"; - } - else if (h != NULL) + } + else if (h != NULL) { name = h->root.root.string; - } - else + } + else { name = _bfd_coff_internal_syment_name (input_bfd, sym, buf); if (name == NULL) name = "UNKNOWN"; } sprintf (reloc_type_name, "0x%02x", rel->r_type); - + if (! ((*info->callbacks->reloc_overflow) (info, name, reloc_type_name, (bfd_vma) 0, input_bfd, input_section, rel->r_vaddr - input_section->vma))) - return false; + return FALSE; } /* Add RELOCATION to the right bits of VALUE_TO_RELOCATE. */ value_to_relocate = ((value_to_relocate & ~howto.dst_mask) | (((value_to_relocate & howto.src_mask) + relocation) & howto.dst_mask)); - + /* Put the value back in the object file. */ if (1 == howto.size) bfd_put_16 (input_bfd, value_to_relocate, location); @@ -1335,9 +1364,9 @@ xcoff64_ppc_relocate_section (output_bfd, info, input_bfd, bfd_put_32 (input_bfd, value_to_relocate, location); else bfd_put_64 (input_bfd, value_to_relocate, location); - + } - return true; + return TRUE; } @@ -1354,105 +1383,105 @@ reloc_howto_type xcoff64_howto_table[] = 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_POS_64", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ MINUS_ONE, /* src_mask */ MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 64 bit relocation, but store negative value. */ HOWTO (R_NEG, /* type */ 0, /* rightshift */ -4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_NEG", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ MINUS_ONE, /* src_mask */ MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 32 bit PC relative relocation. */ HOWTO (R_REL, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "R_REL", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 16 bit TOC relative relocation. */ HOWTO (R_TOC, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_TOC", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* I don't really know what this is. */ + /* I don't really know what this is. */ HOWTO (R_RTB, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_RTB", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* External TOC relative symbol. */ HOWTO (R_GL, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_GL", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Local TOC relative symbol. */ HOWTO (R_TCL, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_TCL", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ EMPTY_HOWTO (7), @@ -1461,15 +1490,15 @@ reloc_howto_type xcoff64_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_BA_26", /* name */ - true, /* partial_inplace */ - 0x3fffffc, /* src_mask */ - 0x3fffffc, /* dst_mask */ - false), /* pcrel_offset */ + TRUE, /* partial_inplace */ + 0x03fffffc, /* src_mask */ + 0x03fffffc, /* dst_mask */ + FALSE), /* pcrel_offset */ EMPTY_HOWTO (9), @@ -1478,15 +1507,15 @@ reloc_howto_type xcoff64_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - true, /* pc_relative */ + 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 */ - false), /* pcrel_offset */ + TRUE, /* partial_inplace */ + 0x03fffffc, /* src_mask */ + 0x03fffffc, /* dst_mask */ + FALSE), /* pcrel_offset */ EMPTY_HOWTO (0xb), @@ -1495,47 +1524,47 @@ reloc_howto_type xcoff64_howto_table[] = 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_RL", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Load address. */ HOWTO (R_RLA, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_RLA", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ EMPTY_HOWTO (0xe), - /* Non-relocating reference. */ + /* Non-relocating reference. */ HOWTO (R_REF, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ 0, /* special_function */ "R_REF", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ EMPTY_HOWTO (0x10), EMPTY_HOWTO (0x11), @@ -1545,209 +1574,209 @@ reloc_howto_type xcoff64_howto_table[] = 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_TRL", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* TOC relative load address. */ HOWTO (R_TRLA, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_TRLA", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Modifiable relative branch. */ HOWTO (R_RRTBI, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_RRTBI", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Modifiable absolute branch. */ HOWTO (R_RRTBA, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_RRTBA", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Modifiable call absolute indirect. */ HOWTO (R_CAI, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_CAI", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* Modifiable call relative. */ + /* Modifiable call relative. */ HOWTO (R_CREL, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_CREL", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Modifiable branch absolute. */ HOWTO (R_RBA, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_RBA", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0x03fffffc, /* src_mask */ 0x03fffffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Modifiable branch absolute. */ HOWTO (R_RBAC, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_RBAC", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Modifiable branch relative. */ HOWTO (R_RBR, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "R_RBR_26", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0x03fffffc, /* src_mask */ 0x03fffffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Modifiable branch absolute. */ HOWTO (R_RBRC, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_RBRC", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_POS, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_POS_32", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 16 bit Non modifiable absolute branch. */ HOWTO (R_BA, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_BA_16", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xfffc, /* src_mask */ 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Modifiable branch relative. */ - HOWTO (R_RBR, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RBR, /* 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_RBR_16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 0, /* special_function */ + "R_RBR_16", /* name */ + TRUE, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ /* Modifiable branch absolute. */ HOWTO (R_RBA, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_RBA_16", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ }; @@ -1761,24 +1790,24 @@ xcoff64_rtype2howto (relent, internal) /* Default howto layout works most of the time */ relent->howto = &xcoff64_howto_table[internal->r_type]; - - /* Special case some 16 bit reoloc */ + + /* Special case some 16 bit reloc */ if (15 == (internal->r_size & 0x3f)) { - if (R_BA == internal->r_type) + if (R_BA == internal->r_type) relent->howto = &xcoff64_howto_table[0x1d]; - else if (R_RBR == internal->r_type) + else if (R_RBR == internal->r_type) relent->howto = &xcoff64_howto_table[0x1e]; - else if (R_RBA == internal->r_type) + else if (R_RBA == internal->r_type) relent->howto = &xcoff64_howto_table[0x1f]; } /* Special case 32 bit */ else if (31 == (internal->r_size & 0x3f)) { - if (R_POS == internal->r_type) + if (R_POS == internal->r_type) relent->howto = &xcoff64_howto_table[0x1c]; } - + /* 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 @@ -1817,7 +1846,7 @@ xcoff64_reloc_type_lookup (abfd, code) /* Read in the armap of an XCOFF archive. */ -static boolean +static bfd_boolean xcoff64_slurp_armap (abfd) bfd *abfd; { @@ -1835,40 +1864,40 @@ xcoff64_slurp_armap (abfd) if (xcoff_ardata (abfd) == NULL) { - bfd_has_map (abfd) = false; - return true; + bfd_has_map (abfd) = FALSE; + return TRUE; } off = bfd_scan_vma (xcoff_ardata_big (abfd)->symoff64, (const char **) NULL, 10); if (off == 0) { - bfd_has_map (abfd) = false; - return true; + bfd_has_map (abfd) = FALSE; + return TRUE; } if (bfd_seek (abfd, off, SEEK_SET) != 0) - return false; + return FALSE; /* The symbol table starts with a normal archive header. */ if (bfd_bread ((PTR) &hdr, (bfd_size_type) SIZEOF_AR_HDR_BIG, abfd) != SIZEOF_AR_HDR_BIG) - return false; + return FALSE; /* Skip the name (normally empty). */ namlen = strtol (hdr.namlen, (char **) NULL, 10); pos = ((namlen + 1) & ~(size_t) 1) + SXCOFFARFMAG; if (bfd_seek (abfd, pos, SEEK_CUR) != 0) - return false; + return FALSE; sz = bfd_scan_vma (hdr.size, (const char **) NULL, 10); /* Read in the entire symbol table. */ contents = (bfd_byte *) bfd_alloc (abfd, sz); if (contents == NULL) - return false; + return FALSE; if (bfd_bread ((PTR) contents, sz, abfd) != sz) - return false; + return FALSE; /* The symbol table starts with an eight byte count. */ c = H_GET_64 (abfd, contents); @@ -1876,13 +1905,13 @@ xcoff64_slurp_armap (abfd) if (c * 8 >= sz) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } amt = c; amt *= sizeof (carsym); bfd_ardata (abfd)->symdefs = (carsym *) bfd_alloc (abfd, amt); if (bfd_ardata (abfd)->symdefs == NULL) - return false; + return FALSE; /* After the count comes a list of eight byte file offsets. */ for (i = 0, arsym = bfd_ardata (abfd)->symdefs, p = contents + 8; @@ -1899,15 +1928,15 @@ xcoff64_slurp_armap (abfd) if (p >= cend) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } arsym->name = (char *) p; } bfd_ardata (abfd)->symdef_count = c; - bfd_has_map (abfd) = true; + bfd_has_map (abfd) = TRUE; - return true; + return TRUE; } @@ -1990,7 +2019,7 @@ xcoff64_openr_next_archived_file (archive, last_file) bfd *archive; bfd *last_file; { - file_ptr filestart; + bfd_vma filestart; if ((xcoff_ardata (archive) == NULL) || ! xcoff_big_format_p (archive)) @@ -2019,17 +2048,16 @@ xcoff64_openr_next_archived_file (archive, last_file) return NULL; } - return _bfd_get_elt_at_filepos (archive, filestart); + return _bfd_get_elt_at_filepos (archive, (file_ptr) filestart); } /* We can't use the usual coff_sizeof_headers routine, because AIX always uses an a.out header. */ -/*ARGSUSED*/ static int xcoff64_sizeof_headers (abfd, reloc) bfd *abfd; - boolean reloc ATTRIBUTE_UNUSED; + bfd_boolean reloc ATTRIBUTE_UNUSED; { int size; @@ -2085,20 +2113,20 @@ xcoff64_create_csect_from_smclas (abfd, aux, symbol_name) return return_value; } -static boolean +static bfd_boolean xcoff64_is_lineno_count_overflow (abfd, value) bfd *abfd ATTRIBUTE_UNUSED; bfd_vma value ATTRIBUTE_UNUSED; { - return false; + return FALSE; } -static boolean +static bfd_boolean xcoff64_is_reloc_count_overflow (abfd, value) bfd *abfd ATTRIBUTE_UNUSED; bfd_vma value ATTRIBUTE_UNUSED; { - return false; + return FALSE; } static bfd_vma @@ -2117,7 +2145,7 @@ xcoff64_loader_reloc_offset (abfd, ldhdr) return (ldhdr->l_rldoff); } -static boolean +static bfd_boolean xcoff64_bad_format_hook (abfd, filehdr) bfd * abfd; PTR filehdr; @@ -2126,20 +2154,20 @@ xcoff64_bad_format_hook (abfd, filehdr) /* Check flavor first. */ if (bfd_get_flavour (abfd) != bfd_target_xcoff_flavour) - return false; + return FALSE; if (bfd_xcoff_magic_number (abfd) != internal_f->f_magic) - return false; + return FALSE; - return true; + return TRUE; } -static boolean +static bfd_boolean xcoff64_generate_rtinit (abfd, init, fini, rtld) bfd *abfd; const char *init; const char *fini; - boolean rtld; + bfd_boolean rtld; { bfd_byte filehdr_ext[FILHSZ]; bfd_byte scnhdr_ext[SCNHSZ * 3]; @@ -2166,7 +2194,7 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld) char *rtld_name = "__rtld"; if (! bfd_xcoff_rtinit_size (abfd)) - return false; + return FALSE; initsz = (init == NULL ? 0 : 1 + strlen (init)); finisz = (fini == NULL ? 0 : 1 + strlen (fini)); @@ -2225,37 +2253,37 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld) bss_scnhdr.s_flags = STYP_BSS; /* .data - 0x0000 0x00000000 : rtl - 0x0004 0x00000000 : - 0x0008 0x00000018 : offset to init, or 0 - 0x000C 0x00000038 : offset to fini, or 0 - 0x0010 0x00000010 : size of descriptor - 0x0014 0x00000000 : pad - 0x0018 0x00000000 : init, needs a reloc - 0x001C 0x00000000 : - 0x0020 0x00000058 : offset to init name - 0x0024 0x00000000 : flags, padded to a word - 0x0028 0x00000000 : empty init - 0x002C 0x00000000 : - 0x0030 0x00000000 : - 0x0034 0x00000000 : - 0x0038 0x00000000 : fini, needs a reloc - 0x003C 0x00000000 : - 0x0040 0x00000??? : offset to fini name - 0x0044 0x00000000 : flags, padded to a word - 0x0048 0x00000000 : empty fini - 0x004C 0x00000000 : - 0x0050 0x00000000 : - 0x0054 0x00000000 : - 0x0058 init name + 0x0000 0x00000000 : rtl + 0x0004 0x00000000 : + 0x0008 0x00000018 : offset to init, or 0 + 0x000C 0x00000038 : offset to fini, or 0 + 0x0010 0x00000010 : size of descriptor + 0x0014 0x00000000 : pad + 0x0018 0x00000000 : init, needs a reloc + 0x001C 0x00000000 : + 0x0020 0x00000058 : offset to init name + 0x0024 0x00000000 : flags, padded to a word + 0x0028 0x00000000 : empty init + 0x002C 0x00000000 : + 0x0030 0x00000000 : + 0x0034 0x00000000 : + 0x0038 0x00000000 : fini, needs a reloc + 0x003C 0x00000000 : + 0x0040 0x00000??? : offset to fini name + 0x0044 0x00000000 : flags, padded to a word + 0x0048 0x00000000 : empty fini + 0x004C 0x00000000 : + 0x0050 0x00000000 : + 0x0054 0x00000000 : + 0x0058 init name 0x0058 + initsz fini name */ data_buffer_size = 0x0058 + initsz + finisz; - data_buffer_size += (data_buffer_size & 7) ? 8 - (data_buffer_size & 7) : 0; + data_buffer_size = (data_buffer_size + 7) &~ (bfd_size_type) 7; data_buffer = NULL; data_buffer = (bfd_byte *) bfd_zmalloc (data_buffer_size); if (data_buffer == NULL) - return false; + return FALSE; if (initsz) { @@ -2291,7 +2319,7 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld) string_table = (bfd_byte *) bfd_zmalloc (string_table_size); if (string_table == NULL) - return false; + return FALSE; val = string_table_size; bfd_put_32 (abfd, val, &string_table[0]); @@ -2455,7 +2483,7 @@ xcoff64_generate_rtinit (abfd, init, fini, rtld) free (data_buffer); data_buffer = NULL; - return true; + return TRUE; } /* The typical dynamic reloc. */ @@ -2465,15 +2493,15 @@ HOWTO (0, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "R_POS", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ MINUS_ONE, /* src_mask */ MINUS_ONE, /* dst_mask */ - false); /* pcrel_offset */ + FALSE); /* pcrel_offset */ static unsigned long xcoff64_glink_code[10] = { @@ -2490,8 +2518,8 @@ static unsigned long xcoff64_glink_code[10] = }; static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = -{ - { /* COFF backend, defined in libcoff.h. */ + { + { /* COFF backend, defined in libcoff.h. */ _bfd_xcoff64_swap_aux_in, _bfd_xcoff64_swap_sym_in, _bfd_xcoff64_swap_lineno_in, @@ -2510,11 +2538,11 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = RELSZ, LINESZ, FILNMLEN, - true, /* _bfd_coff_long_filenames */ - false, /* _bfd_coff_long_section_names */ + TRUE, /* _bfd_coff_long_filenames */ + FALSE, /* _bfd_coff_long_section_names */ 3, /* _bfd_coff_default_section_alignment_power */ - true, /* _bfd_coff_force_symnames_in_strings */ - 4, /* _bfd_coff_debug_string_prefix_length */ + TRUE, /* _bfd_coff_force_symnames_in_strings */ + 4, /* _bfd_coff_debug_string_prefix_length */ coff_swap_filehdr_in, coff_swap_aouthdr_in, coff_swap_scnhdr_in, @@ -2530,22 +2558,22 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = coff_print_aux, dummy_reloc16_extra_cases, dummy_reloc16_estimate, - NULL, /* bfd_coff_sym_is_global */ - coff_compute_section_file_positions, - NULL , /* _bfd_coff_start_final_link */ + NULL, /* bfd_coff_sym_is_global */ + coff_compute_section_file_positions, + NULL, /* _bfd_coff_start_final_link */ xcoff64_ppc_relocate_section, coff_rtype_to_howto, NULL, /* _bfd_coff_adjust_symndx */ _bfd_generic_link_add_one_symbol, coff_link_output_has_begun, coff_final_link_postscript - }, + }, - 0x01EF, /* magic number */ + 0x01EF, /* magic number */ bfd_arch_powerpc, bfd_mach_ppc_620, - /* Function pointers to xcoff specific swap routines. */ + /* Function pointers to xcoff specific swap routines. */ xcoff64_swap_ldhdr_in, xcoff64_swap_ldhdr_out, xcoff64_swap_ldsym_in, @@ -2553,54 +2581,54 @@ static const struct xcoff_backend_data_rec bfd_xcoff_backend_data = xcoff64_swap_ldrel_in, xcoff64_swap_ldrel_out, - /* Sizes. */ + /* Sizes. */ LDHDRSZ, LDSYMSZ, LDRELSZ, - 24, /* _xcoff_function_descriptor_size */ - 0, /* _xcoff_small_aout_header_size */ + 24, /* _xcoff_function_descriptor_size */ + 0, /* _xcoff_small_aout_header_size */ - /* Versions. */ - 2, /* _xcoff_ldhdr_version */ + /* Versions. */ + 2, /* _xcoff_ldhdr_version */ _bfd_xcoff64_put_symbol_name, _bfd_xcoff64_put_ldsymbol_name, - &xcoff64_dynamic_reloc, - xcoff64_create_csect_from_smclas, + &xcoff64_dynamic_reloc, + xcoff64_create_csect_from_smclas, - /* Lineno and reloc count overflow. */ - xcoff64_is_lineno_count_overflow, - xcoff64_is_reloc_count_overflow, + /* Lineno and reloc count overflow. */ + xcoff64_is_lineno_count_overflow, + xcoff64_is_reloc_count_overflow, - xcoff64_loader_symbol_offset, - xcoff64_loader_reloc_offset, + xcoff64_loader_symbol_offset, + xcoff64_loader_reloc_offset, - /* glink. */ - &xcoff64_glink_code[0], - 40, /* _xcoff_glink_size */ + /* glink. */ + &xcoff64_glink_code[0], + 40, /* _xcoff_glink_size */ - /* rtinit. */ - 88, /* _xcoff_rtinit_size */ + /* rtinit. */ + 88, /* _xcoff_rtinit_size */ xcoff64_generate_rtinit, -}; + }; /* The transfer vector that leads the outside world to all of the above. */ const bfd_target rs6000coff64_vec = -{ - "aixcoff64-rs6000", - bfd_target_xcoff_flavour, - BFD_ENDIAN_BIG, /* data byte order is big */ - BFD_ENDIAN_BIG, /* header byte order is big */ + { + "aixcoff64-rs6000", + bfd_target_xcoff_flavour, + BFD_ENDIAN_BIG, /* data byte order is big */ + BFD_ENDIAN_BIG, /* header byte order is big */ (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | DYNAMIC | HAS_SYMS | HAS_LOCALS | WP_TEXT), - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), - 0, /* leading char */ - '/', /* ar_pad_char */ + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA, + 0, /* leading char */ + '/', /* ar_pad_char */ 15, /* ar_max_namelen */ - /* data */ + /* data */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, @@ -2611,7 +2639,7 @@ const bfd_target rs6000coff64_vec = bfd_getb_signed_16, bfd_putb16, - /* hdrs */ + /* hdrs */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, @@ -2622,51 +2650,51 @@ const bfd_target rs6000coff64_vec = bfd_getb_signed_16, bfd_putb16, - { /* bfd_check_format */ - _bfd_dummy_target, - coff_object_p, - xcoff64_archive_p, - CORE_FILE_P - }, - - { /* bfd_set_format */ - bfd_false, - coff_mkobject, - _bfd_generic_mkarchive, - bfd_false - }, - - {/* bfd_write_contents */ - bfd_false, - xcoff64_write_object_contents, - _bfd_xcoff_write_archive_contents, - bfd_false - }, - - /* Generic */ + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + xcoff64_archive_p, + CORE_FILE_P + }, + + { /* bfd_set_format */ + bfd_false, + coff_mkobject, + _bfd_generic_mkarchive, + bfd_false + }, + + {/* bfd_write_contents */ + bfd_false, + xcoff64_write_object_contents, + _bfd_xcoff_write_archive_contents, + bfd_false + }, + + /* Generic */ bfd_true, bfd_true, coff_new_section_hook, _bfd_generic_get_section_contents, - _bfd_generic_get_section_contents_in_window, + _bfd_generic_get_section_contents_in_window, - /* Copy */ + /* Copy */ _bfd_xcoff_copy_private_bfd_data, - ((boolean (*) (bfd *, bfd *)) bfd_true), - ((boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), - ((boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), - ((boolean (*) (bfd *, flagword)) bfd_true), - ((boolean (*) (bfd *, void * )) bfd_true), + ((bfd_boolean (*) (bfd *, bfd *)) bfd_true), + ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), + ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), + ((bfd_boolean (*) (bfd *, flagword)) bfd_true), + ((bfd_boolean (*) (bfd *, void * )) bfd_true), - /* Core */ + /* Core */ coff_core_file_failing_command, coff_core_file_failing_signal, coff_core_file_matches_executable_p, - /* Archive */ + /* Archive */ xcoff64_slurp_armap, bfd_false, - ((boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), + ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), bfd_dont_truncate_arname, _bfd_xcoff_write_armap, _bfd_xcoff_read_ar_hdr, @@ -2675,9 +2703,9 @@ const bfd_target rs6000coff64_vec = _bfd_xcoff_stat_arch_elt, bfd_true, - /* Symbols */ + /* Symbols */ coff_get_symtab_upper_bound, - coff_get_symtab, + coff_canonicalize_symtab, coff_make_empty_symbol, coff_print_symbol, coff_get_symbol_info, @@ -2688,18 +2716,18 @@ const bfd_target rs6000coff64_vec = _bfd_generic_read_minisymbols, _bfd_generic_minisymbol_to_symbol, - /* Reloc */ + /* Reloc */ coff_get_reloc_upper_bound, coff_canonicalize_reloc, xcoff64_reloc_type_lookup, - /* Write */ + /* Write */ coff_set_arch_mach, coff_set_section_contents, - /* Link */ + /* Link */ xcoff64_sizeof_headers, - bfd_generic_get_relocated_section_contents, + bfd_generic_get_relocated_section_contents, bfd_generic_relax_section, _bfd_xcoff_bfd_link_hash_table_create, _bfd_generic_link_hash_table_free, @@ -2711,27 +2739,31 @@ const bfd_target rs6000coff64_vec = bfd_generic_merge_sections, bfd_generic_discard_group, - /* Dynamic */ - _bfd_xcoff_get_dynamic_symtab_upper_bound, + /* Dynamic */ + _bfd_xcoff_get_dynamic_symtab_upper_bound, _bfd_xcoff_canonicalize_dynamic_symtab, _bfd_xcoff_get_dynamic_reloc_upper_bound, _bfd_xcoff_canonicalize_dynamic_reloc, - /* Opposite endian version, none exists */ - NULL, + /* Opposite endian version, none exists */ + NULL, - (void *) &bfd_xcoff_backend_data, -}; + (void *) &bfd_xcoff_backend_data, + }; -extern const bfd_target *xcoff64_core_p PARAMS ((bfd *)); -extern boolean xcoff64_core_file_matches_executable_p PARAMS((bfd *, bfd *)); -extern char *xcoff64_core_file_failing_command PARAMS ((bfd *)); -extern int xcoff64_core_file_failing_signal PARAMS ((bfd *)); +extern const bfd_target *xcoff64_core_p + PARAMS ((bfd *)); +extern bfd_boolean xcoff64_core_file_matches_executable_p + PARAMS ((bfd *, bfd *)); +extern char *xcoff64_core_file_failing_command + PARAMS ((bfd *)); +extern int xcoff64_core_file_failing_signal + PARAMS ((bfd *)); /* AIX 5 */ static const struct xcoff_backend_data_rec bfd_xcoff_aix5_backend_data = -{ - { /* COFF backend, defined in libcoff.h. */ + { + { /* COFF backend, defined in libcoff.h. */ _bfd_xcoff64_swap_aux_in, _bfd_xcoff64_swap_sym_in, _bfd_xcoff64_swap_lineno_in, @@ -2750,11 +2782,11 @@ static const struct xcoff_backend_data_rec bfd_xcoff_aix5_backend_data = RELSZ, LINESZ, FILNMLEN, - true, /* _bfd_coff_long_filenames */ - false, /* _bfd_coff_long_section_names */ + TRUE, /* _bfd_coff_long_filenames */ + FALSE, /* _bfd_coff_long_section_names */ 3, /* _bfd_coff_default_section_alignment_power */ - true, /* _bfd_coff_force_symnames_in_strings */ - 4, /* _bfd_coff_debug_string_prefix_length */ + TRUE, /* _bfd_coff_force_symnames_in_strings */ + 4, /* _bfd_coff_debug_string_prefix_length */ coff_swap_filehdr_in, coff_swap_aouthdr_in, coff_swap_scnhdr_in, @@ -2770,22 +2802,22 @@ static const struct xcoff_backend_data_rec bfd_xcoff_aix5_backend_data = coff_print_aux, dummy_reloc16_extra_cases, dummy_reloc16_estimate, - NULL, /* bfd_coff_sym_is_global */ - coff_compute_section_file_positions, - NULL , /* _bfd_coff_start_final_link */ + NULL, /* bfd_coff_sym_is_global */ + coff_compute_section_file_positions, + NULL, /* _bfd_coff_start_final_link */ xcoff64_ppc_relocate_section, coff_rtype_to_howto, NULL, /* _bfd_coff_adjust_symndx */ _bfd_generic_link_add_one_symbol, coff_link_output_has_begun, coff_final_link_postscript - }, + }, - U64_TOCMAGIC, /* magic number */ + U64_TOCMAGIC, /* magic number */ bfd_arch_powerpc, bfd_mach_ppc_620, - /* Function pointers to xcoff specific swap routines. */ + /* Function pointers to xcoff specific swap routines. */ xcoff64_swap_ldhdr_in, xcoff64_swap_ldhdr_out, xcoff64_swap_ldsym_in, @@ -2793,53 +2825,53 @@ static const struct xcoff_backend_data_rec bfd_xcoff_aix5_backend_data = xcoff64_swap_ldrel_in, xcoff64_swap_ldrel_out, - /* Sizes. */ + /* Sizes. */ LDHDRSZ, LDSYMSZ, LDRELSZ, - 24, /* _xcoff_function_descriptor_size */ - 0, /* _xcoff_small_aout_header_size */ - /* Versions. */ - 2, /* _xcoff_ldhdr_version */ + 24, /* _xcoff_function_descriptor_size */ + 0, /* _xcoff_small_aout_header_size */ + /* Versions. */ + 2, /* _xcoff_ldhdr_version */ _bfd_xcoff64_put_symbol_name, _bfd_xcoff64_put_ldsymbol_name, - &xcoff64_dynamic_reloc, - xcoff64_create_csect_from_smclas, + &xcoff64_dynamic_reloc, + xcoff64_create_csect_from_smclas, - /* Lineno and reloc count overflow. */ - xcoff64_is_lineno_count_overflow, - xcoff64_is_reloc_count_overflow, + /* Lineno and reloc count overflow. */ + xcoff64_is_lineno_count_overflow, + xcoff64_is_reloc_count_overflow, - xcoff64_loader_symbol_offset, - xcoff64_loader_reloc_offset, + xcoff64_loader_symbol_offset, + xcoff64_loader_reloc_offset, - /* glink. */ - &xcoff64_glink_code[0], - 40, /* _xcoff_glink_size */ + /* glink. */ + &xcoff64_glink_code[0], + 40, /* _xcoff_glink_size */ - /* rtinit. */ - 88, /* _xcoff_rtinit_size */ + /* rtinit. */ + 88, /* _xcoff_rtinit_size */ xcoff64_generate_rtinit, -}; + }; /* The transfer vector that leads the outside world to all of the above. */ const bfd_target aix5coff64_vec = -{ - "aix5coff64-rs6000", - bfd_target_xcoff_flavour, - BFD_ENDIAN_BIG, /* data byte order is big */ - BFD_ENDIAN_BIG, /* header byte order is big */ + { + "aix5coff64-rs6000", + bfd_target_xcoff_flavour, + BFD_ENDIAN_BIG, /* data byte order is big */ + BFD_ENDIAN_BIG, /* header byte order is big */ (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | DYNAMIC | HAS_SYMS | HAS_LOCALS | WP_TEXT), - (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), - 0, /* leading char */ - '/', /* ar_pad_char */ + SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_CODE | SEC_DATA, + 0, /* leading char */ + '/', /* ar_pad_char */ 15, /* ar_max_namelen */ - /* data */ + /* data */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, @@ -2850,7 +2882,7 @@ const bfd_target aix5coff64_vec = bfd_getb_signed_16, bfd_putb16, - /* hdrs */ + /* hdrs */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, @@ -2861,51 +2893,51 @@ const bfd_target aix5coff64_vec = bfd_getb_signed_16, bfd_putb16, - { /* bfd_check_format */ - _bfd_dummy_target, - coff_object_p, - xcoff64_archive_p, - xcoff64_core_p - }, - - { /* bfd_set_format */ - bfd_false, - coff_mkobject, - _bfd_generic_mkarchive, - bfd_false - }, - - {/* bfd_write_contents */ - bfd_false, - xcoff64_write_object_contents, - _bfd_xcoff_write_archive_contents, - bfd_false - }, - - /* Generic */ + { /* bfd_check_format */ + _bfd_dummy_target, + coff_object_p, + xcoff64_archive_p, + xcoff64_core_p + }, + + { /* bfd_set_format */ + bfd_false, + coff_mkobject, + _bfd_generic_mkarchive, + bfd_false + }, + + {/* bfd_write_contents */ + bfd_false, + xcoff64_write_object_contents, + _bfd_xcoff_write_archive_contents, + bfd_false + }, + + /* Generic */ bfd_true, bfd_true, coff_new_section_hook, _bfd_generic_get_section_contents, - _bfd_generic_get_section_contents_in_window, + _bfd_generic_get_section_contents_in_window, - /* Copy */ + /* Copy */ _bfd_xcoff_copy_private_bfd_data, - ((boolean (*) (bfd *, bfd *)) bfd_true), - ((boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), - ((boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), - ((boolean (*) (bfd *, flagword)) bfd_true), - ((boolean (*) (bfd *, void * )) bfd_true), + ((bfd_boolean (*) (bfd *, bfd *)) bfd_true), + ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true), + ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true), + ((bfd_boolean (*) (bfd *, flagword)) bfd_true), + ((bfd_boolean (*) (bfd *, void * )) bfd_true), - /* Core */ + /* Core */ xcoff64_core_file_failing_command, xcoff64_core_file_failing_signal, xcoff64_core_file_matches_executable_p, - /* Archive */ + /* Archive */ xcoff64_slurp_armap, bfd_false, - ((boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), + ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) bfd_false), bfd_dont_truncate_arname, _bfd_xcoff_write_armap, _bfd_xcoff_read_ar_hdr, @@ -2914,9 +2946,9 @@ const bfd_target aix5coff64_vec = _bfd_xcoff_stat_arch_elt, bfd_true, - /* Symbols */ + /* Symbols */ coff_get_symtab_upper_bound, - coff_get_symtab, + coff_canonicalize_symtab, coff_make_empty_symbol, coff_print_symbol, coff_get_symbol_info, @@ -2927,18 +2959,18 @@ const bfd_target aix5coff64_vec = _bfd_generic_read_minisymbols, _bfd_generic_minisymbol_to_symbol, - /* Reloc */ + /* Reloc */ coff_get_reloc_upper_bound, coff_canonicalize_reloc, xcoff64_reloc_type_lookup, - /* Write */ + /* Write */ coff_set_arch_mach, coff_set_section_contents, - /* Link */ + /* Link */ xcoff64_sizeof_headers, - bfd_generic_get_relocated_section_contents, + bfd_generic_get_relocated_section_contents, bfd_generic_relax_section, _bfd_xcoff_bfd_link_hash_table_create, _bfd_generic_link_hash_table_free, @@ -2950,14 +2982,14 @@ const bfd_target aix5coff64_vec = bfd_generic_merge_sections, bfd_generic_discard_group, - /* Dynamic */ - _bfd_xcoff_get_dynamic_symtab_upper_bound, + /* Dynamic */ + _bfd_xcoff_get_dynamic_symtab_upper_bound, _bfd_xcoff_canonicalize_dynamic_symtab, _bfd_xcoff_get_dynamic_reloc_upper_bound, _bfd_xcoff_canonicalize_dynamic_reloc, - /* Opposite endian version, none exists. */ - NULL, + /* Opposite endian version, none exists. */ + NULL, - (void *) & bfd_xcoff_aix5_backend_data, -}; + (void *) & bfd_xcoff_aix5_backend_data, + }; diff --git a/contrib/binutils/bfd/coffcode.h b/contrib/binutils/bfd/coffcode.h index 1c02dcb..15d9709 100644 --- a/contrib/binutils/bfd/coffcode.h +++ b/contrib/binutils/bfd/coffcode.h @@ -1,24 +1,24 @@ /* Support for the generic parts of most COFF variants, for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. -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. */ /* Most of this hacked by Steve Chamberlain, @@ -225,7 +225,7 @@ SUBSUBSECTION This routine runs though the provided symbol table and uses the offsets generated by the previous pass and the pointers generated when the symbol table was read in to create the - structured hierachy required by coff. It changes each pointer + structured hierarchy required by coff. It changes each pointer to a symbol into the index into the symbol table of the asymbol. o <> @@ -296,7 +296,7 @@ CODE_FRAGMENT . struct lineno_cache_entry *lineno; . . {* Have the line numbers been relocated yet ? *} -. boolean done_lineno; +. bfd_boolean done_lineno; .} coff_symbol_type; */ @@ -309,42 +309,64 @@ CODE_FRAGMENT #define STRING_SIZE_SIZE (4) -static long sec_to_styp_flags PARAMS ((const char *, flagword)); -static boolean styp_to_sec_flags +static long sec_to_styp_flags + PARAMS ((const char *, flagword)); +static bfd_boolean styp_to_sec_flags PARAMS ((bfd *, PTR, const char *, asection *, flagword *)); -static boolean coff_bad_format_hook PARAMS ((bfd *, PTR)); +static bfd_boolean coff_bad_format_hook + PARAMS ((bfd *, PTR)); static void coff_set_custom_section_alignment PARAMS ((bfd *, asection *, const struct coff_section_alignment_entry *, const unsigned int)); -static boolean coff_new_section_hook PARAMS ((bfd *, asection *)); -static boolean coff_set_arch_mach_hook PARAMS ((bfd *, PTR)); -static boolean coff_write_relocs PARAMS ((bfd *, int)); -static boolean coff_set_flags +static bfd_boolean coff_new_section_hook + PARAMS ((bfd *, asection *)); +static bfd_boolean coff_set_arch_mach_hook + PARAMS ((bfd *, PTR)); +static bfd_boolean coff_write_relocs + PARAMS ((bfd *, int)); +static bfd_boolean coff_set_flags PARAMS ((bfd *, unsigned int *, unsigned short *)); -static boolean coff_set_arch_mach +static bfd_boolean coff_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, unsigned long)) ATTRIBUTE_UNUSED; -static boolean coff_compute_section_file_positions PARAMS ((bfd *)); -static boolean coff_write_object_contents PARAMS ((bfd *)) ATTRIBUTE_UNUSED; -static boolean coff_set_section_contents - PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); -static PTR buy_and_read PARAMS ((bfd *, file_ptr, bfd_size_type)); -static boolean coff_slurp_line_table PARAMS ((bfd *, asection *)); -static boolean coff_slurp_symbol_table PARAMS ((bfd *)); +static bfd_boolean coff_compute_section_file_positions + PARAMS ((bfd *)); +static bfd_boolean coff_write_object_contents + PARAMS ((bfd *)) ATTRIBUTE_UNUSED; +static bfd_boolean coff_set_section_contents + PARAMS ((bfd *, asection *, const PTR, file_ptr, bfd_size_type)); +static PTR buy_and_read + PARAMS ((bfd *, file_ptr, bfd_size_type)); +static bfd_boolean coff_slurp_line_table + PARAMS ((bfd *, asection *)); +static bfd_boolean coff_slurp_symbol_table + PARAMS ((bfd *)); static enum coff_symbol_classification coff_classify_symbol PARAMS ((bfd *, struct internal_syment *)); -static boolean coff_slurp_reloc_table PARAMS ((bfd *, asection *, asymbol **)); +static bfd_boolean coff_slurp_reloc_table + PARAMS ((bfd *, asection *, asymbol **)); static long coff_canonicalize_reloc PARAMS ((bfd *, asection *, arelent **, asymbol **)); #ifndef coff_mkobject_hook -static PTR coff_mkobject_hook PARAMS ((bfd *, PTR, PTR)); +static PTR coff_mkobject_hook + PARAMS ((bfd *, PTR, PTR)); #endif #ifdef COFF_WITH_PE -static flagword handle_COMDAT PARAMS ((bfd *, flagword, PTR, const char *, asection *)); +static flagword handle_COMDAT + PARAMS ((bfd *, flagword, PTR, const char *, asection *)); #endif #ifdef COFF_IMAGE_WITH_PE -static boolean coff_read_word PARAMS ((bfd *, unsigned int *)); -static unsigned int coff_compute_checksum PARAMS ((bfd *)); -static boolean coff_apply_checksum PARAMS ((bfd *)); +static bfd_boolean coff_read_word + PARAMS ((bfd *, unsigned int *)); +static unsigned int coff_compute_checksum + PARAMS ((bfd *)); +static bfd_boolean coff_apply_checksum + PARAMS ((bfd *)); +#endif +#ifdef TICOFF +static bfd_boolean ticoff0_bad_format_hook + PARAMS ((bfd *, PTR )); +static bfd_boolean ticoff1_bad_format_hook + PARAMS ((bfd *, PTR )); #endif /* void warning(); */ @@ -542,15 +564,15 @@ sec_to_styp_flags (sec_name, sec_flags) /* For now, the read/write bits are mapped onto SEC_READONLY, even though the semantics don't quite match. The bits from the input - are retained in pei_section_data(abfd, section)->pe_flags */ + are retained in pei_section_data(abfd, section)->pe_flags. */ - styp_flags |= IMAGE_SCN_MEM_READ; /* always readable. */ + styp_flags |= IMAGE_SCN_MEM_READ; /* Always readable. */ if ((sec_flags & SEC_READONLY) == 0) - styp_flags |= IMAGE_SCN_MEM_WRITE; /* Invert READONLY for write */ + styp_flags |= IMAGE_SCN_MEM_WRITE; /* Invert READONLY for write. */ if (sec_flags & SEC_CODE) - styp_flags |= IMAGE_SCN_MEM_EXECUTE; /* CODE->EXECUTE */ + styp_flags |= IMAGE_SCN_MEM_EXECUTE; /* CODE->EXECUTE. */ if (sec_flags & SEC_SHARED) - styp_flags |= IMAGE_SCN_MEM_SHARED; /* Shared remains meaningful */ + styp_flags |= IMAGE_SCN_MEM_SHARED; /* Shared remains meaningful. */ return styp_flags; } @@ -564,7 +586,7 @@ sec_to_styp_flags (sec_name, sec_flags) #ifndef COFF_WITH_PE -static boolean +static bfd_boolean styp_to_sec_flags (abfd, hdr, name, section, flags_ptr) bfd *abfd ATTRIBUTE_UNUSED; PTR hdr; @@ -677,12 +699,12 @@ styp_to_sec_flags (abfd, hdr, name, section, flags_ptr) else sec_flags |= SEC_ALLOC | SEC_LOAD; -#ifdef STYP_LIT /* A29k readonly text/data section type */ +#ifdef STYP_LIT /* A29k readonly text/data section type. */ if ((styp_flags & STYP_LIT) == STYP_LIT) sec_flags = (SEC_LOAD | SEC_ALLOC | SEC_READONLY); #endif /* STYP_LIT */ -#ifdef STYP_OTHER_LOAD /* Other loaded sections */ +#ifdef STYP_OTHER_LOAD /* Other loaded sections. */ if (styp_flags & STYP_OTHER_LOAD) sec_flags = (SEC_LOAD | SEC_ALLOC); #endif /* STYP_SDATA */ @@ -699,10 +721,10 @@ styp_to_sec_flags (abfd, hdr, name, section, flags_ptr) #endif if (flags_ptr == NULL) - return false; + return FALSE; * flags_ptr = sec_flags; - return true; + return TRUE; } #else /* COFF_WITH_PE */ @@ -786,7 +808,7 @@ handle_COMDAT (abfd, sec_flags, hdr, name, section) gas-generated, and look for (whatever follows the $) as the comdat symbol. */ - /* All 3 branches use this */ + /* All 3 branches use this. */ symname = _bfd_coff_internal_syment_name (abfd, &isym, buf); if (symname == NULL) @@ -914,7 +936,7 @@ handle_COMDAT (abfd, sec_flags, hdr, name, section) #ifndef TARGET_UNDERSCORE #define TARGET_UNDERSCORE 0 #endif - /* Is this the name we're looking for? */ + /* Is this the name we're looking for ? */ if (strcmp (target_name, symname + (TARGET_UNDERSCORE ? 1 : 0)) != 0) { @@ -973,7 +995,7 @@ handle_COMDAT (abfd, sec_flags, hdr, name, section) required information. FIXME: Is the COMDAT symbol index used for any purpose other than objdump? */ -static boolean +static bfd_boolean styp_to_sec_flags (abfd, hdr, name, section, flags_ptr) bfd *abfd; PTR hdr; @@ -984,7 +1006,7 @@ styp_to_sec_flags (abfd, hdr, name, section, flags_ptr) struct internal_scnhdr *internal_s = (struct internal_scnhdr *) hdr; long styp_flags = internal_s->s_flags; flagword sec_flags; - boolean result = true; + bfd_boolean result = TRUE; /* Assume read only unless IMAGE_SCN_MEM_WRITE is specified. */ sec_flags = SEC_READONLY; @@ -1042,7 +1064,11 @@ styp_to_sec_flags (abfd, hdr, name, section, flags_ptr) sec_flags &= ~ SEC_READONLY; break; case IMAGE_SCN_MEM_DISCARDABLE: - sec_flags |= SEC_DEBUGGING; + /* The MS PE spec sets the DISCARDABLE flag on .reloc sections + but we do not want them to be labelled as debug section, since + then strip would remove them. */ + if (strncmp (name, ".reloc", sizeof ".reloc" - 1) != 0) + sec_flags |= SEC_DEBUGGING; break; case IMAGE_SCN_MEM_SHARED: sec_flags |= SEC_SHARED; @@ -1085,7 +1111,7 @@ styp_to_sec_flags (abfd, hdr, name, section, flags_ptr) (*_bfd_error_handler) (_("%s (%s): Section flag %s (0x%x) ignored"), bfd_archive_filename (abfd), name, unhandled, flag); - result = false; + result = FALSE; } } @@ -1173,10 +1199,10 @@ Special entry points for gdb to swap in coff symbol table parts: . unsigned int _bfd_relsz; . unsigned int _bfd_linesz; . unsigned int _bfd_filnmlen; -. boolean _bfd_coff_long_filenames; -. boolean _bfd_coff_long_section_names; +. bfd_boolean _bfd_coff_long_filenames; +. bfd_boolean _bfd_coff_long_section_names; . unsigned int _bfd_coff_default_section_alignment_power; -. boolean _bfd_coff_force_symnames_in_strings; +. bfd_boolean _bfd_coff_force_symnames_in_strings; . unsigned int _bfd_coff_debug_string_prefix_length; . . void (*_bfd_coff_swap_filehdr_in) @@ -1191,32 +1217,32 @@ Special entry points for gdb to swap in coff symbol table parts: . void (*_bfd_coff_swap_reloc_in) . PARAMS ((bfd *abfd, PTR, PTR)); . -. boolean (*_bfd_coff_bad_format_hook) +. bfd_boolean (*_bfd_coff_bad_format_hook) . PARAMS ((bfd *, PTR)); . -. boolean (*_bfd_coff_set_arch_mach_hook) +. bfd_boolean (*_bfd_coff_set_arch_mach_hook) . PARAMS ((bfd *, PTR)); . . PTR (*_bfd_coff_mkobject_hook) . PARAMS ((bfd *, PTR, PTR)); . -. boolean (*_bfd_styp_to_sec_flags_hook) +. bfd_boolean (*_bfd_styp_to_sec_flags_hook) . PARAMS ((bfd *, PTR, const char *, asection *, flagword *)); . . void (*_bfd_set_alignment_hook) . PARAMS ((bfd *, asection *, PTR)); . -. boolean (*_bfd_coff_slurp_symbol_table) +. bfd_boolean (*_bfd_coff_slurp_symbol_table) . PARAMS ((bfd *)); . -. boolean (*_bfd_coff_symname_in_debug) +. bfd_boolean (*_bfd_coff_symname_in_debug) . PARAMS ((bfd *, struct internal_syment *)); . -. boolean (*_bfd_coff_pointerize_aux_hook) +. bfd_boolean (*_bfd_coff_pointerize_aux_hook) . PARAMS ((bfd *, combined_entry_type *, combined_entry_type *, . unsigned int, combined_entry_type *)); . -. boolean (*_bfd_coff_print_aux) +. bfd_boolean (*_bfd_coff_print_aux) . PARAMS ((bfd *, FILE *, combined_entry_type *, combined_entry_type *, . combined_entry_type *, unsigned int)); . @@ -1231,13 +1257,13 @@ Special entry points for gdb to swap in coff symbol table parts: . enum coff_symbol_classification (*_bfd_coff_classify_symbol) . PARAMS ((bfd *, struct internal_syment *)); . -. boolean (*_bfd_coff_compute_section_file_positions) +. bfd_boolean (*_bfd_coff_compute_section_file_positions) . PARAMS ((bfd *)); . -. boolean (*_bfd_coff_start_final_link) +. bfd_boolean (*_bfd_coff_start_final_link) . PARAMS ((bfd *, struct bfd_link_info *)); . -. boolean (*_bfd_coff_relocate_section) +. bfd_boolean (*_bfd_coff_relocate_section) . PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, . struct internal_reloc *, struct internal_syment *, asection **)); . @@ -1246,19 +1272,19 @@ Special entry points for gdb to swap in coff symbol table parts: . struct coff_link_hash_entry *, struct internal_syment *, . bfd_vma *)); . -. boolean (*_bfd_coff_adjust_symndx) +. bfd_boolean (*_bfd_coff_adjust_symndx) . PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, -. struct internal_reloc *, boolean *)); +. struct internal_reloc *, bfd_boolean *)); . -. boolean (*_bfd_coff_link_add_one_symbol) +. bfd_boolean (*_bfd_coff_link_add_one_symbol) . PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, -. asection *, bfd_vma, const char *, boolean, boolean, +. asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, . struct bfd_link_hash_entry **)); . -. boolean (*_bfd_coff_link_output_has_begun) +. bfd_boolean (*_bfd_coff_link_output_has_begun) . PARAMS ((bfd *, struct coff_final_link_info *)); . -. boolean (*_bfd_coff_final_link_postscript) +. bfd_boolean (*_bfd_coff_final_link_postscript) . PARAMS ((bfd *, struct coff_final_link_info *)); . .} bfd_coff_backend_data; @@ -1328,7 +1354,8 @@ Special entry points for gdb to swap in coff symbol table parts: .#define bfd_coff_set_arch_mach_hook(abfd, filehdr)\ . ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) .#define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\ -. ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr)) +. ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\ +. (abfd, filehdr, aouthdr)) . .#define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\ . ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ @@ -1353,7 +1380,8 @@ Special entry points for gdb to swap in coff symbol table parts: . ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ . (abfd, file, base, symbol, aux, indaux)) . -.#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)\ +.#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\ +. reloc, data, src_ptr, dst_ptr)\ . ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ . (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) . @@ -1381,7 +1409,8 @@ Special entry points for gdb to swap in coff symbol table parts: .#define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\ . ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ . (obfd, info, ibfd, sec, rel, adjustedp)) -.#define bfd_coff_link_add_one_symbol(info,abfd,name,flags,section,value,string,cp,coll,hashp)\ +.#define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\ +. value, string, cp, coll, hashp)\ . ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ . (info, abfd, name, flags, section, value, string, cp, coll, hashp)) . @@ -1394,7 +1423,7 @@ Special entry points for gdb to swap in coff symbol table parts: /* See whether the magic number matches. */ -static boolean +static bfd_boolean coff_bad_format_hook (abfd, filehdr) bfd * abfd ATTRIBUTE_UNUSED; PTR filehdr; @@ -1402,24 +1431,53 @@ coff_bad_format_hook (abfd, filehdr) struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; if (BADMAG (*internal_f)) - return false; + return FALSE; - /* if the optional header is NULL or not the correct size then + /* If the optional header is NULL or not the correct size then quit; the only difference I can see between m88k dgux headers (MC88DMAGIC) and Intel 960 readwrite headers (I960WRMAGIC) is that the optional header is of a different size. But the mips keeps extra stuff in it's opthdr, so dont check - when doing that - */ + when doing that. */ #if defined(M88) || defined(I960) if (internal_f->f_opthdr != 0 && bfd_coff_aoutsz (abfd) != internal_f->f_opthdr) - return false; + return FALSE; +#endif + + return TRUE; +} + +#ifdef TICOFF +static bfd_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; +} #endif - return true; +#ifdef TICOFF +static bfd_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; } +#endif /* Check whether this section uses an alignment other than the default. */ @@ -1437,6 +1495,7 @@ coff_set_custom_section_alignment (abfd, section, alignment_table, table_size) for (i = 0; i < table_size; ++i) { const char *secname = bfd_get_section_name (abfd, section); + if (alignment_table[i].comparison_length == (unsigned int) -1 ? strcmp (alignment_table[i].name, secname) == 0 : strncmp (alignment_table[i].name, secname, @@ -1487,7 +1546,7 @@ static const unsigned int coff_section_alignment_table_size = /* Initialize a section structure with information peculiar to this particular implementation of COFF. */ -static boolean +static bfd_boolean coff_new_section_hook (abfd, section) bfd * abfd; asection * section; @@ -1514,10 +1573,10 @@ coff_new_section_hook (abfd, section) amt = sizeof (combined_entry_type) * 10; native = (combined_entry_type *) bfd_zalloc (abfd, amt); if (native == NULL) - return false; + return FALSE; /* We don't need to set up n_name, n_value, or n_scnum in the native - symbol information, since they'll be overriden by the BFD symbol + symbol information, since they'll be overridden by the BFD symbol anyhow. However, we do need to set the type and storage class, in case this symbol winds up getting written out. The value 0 for n_numaux is already correct. */ @@ -1531,7 +1590,7 @@ coff_new_section_hook (abfd, section) coff_section_alignment_table, coff_section_alignment_table_size); - return true; + return TRUE; } #ifdef COFF_ALIGN_IN_SECTION_HEADER @@ -1550,13 +1609,13 @@ coff_set_alignment_hook (abfd, section, scnhdr) unsigned int i; #ifdef I960 - /* Extract ALIGN from 2**ALIGN stored in section header */ + /* Extract ALIGN from 2**ALIGN stored in section header. */ for (i = 0; i < 32; i++) if ((1 << i) >= hdr->s_align) break; #endif #ifdef TIC80COFF - /* TI tools puts the alignment power in bits 8-11 */ + /* TI tools puts the alignment power in bits 8-11. */ i = (hdr->s_flags >> 8) & 0xF ; #endif #ifdef COFF_DECODE_ALIGNMENT @@ -1572,7 +1631,7 @@ coff_set_alignment_hook (abfd, section, scnhdr) #else /* ! COFF_ALIGN_IN_SECTION_HEADER */ #ifdef COFF_WITH_PE -/* a couple of macros to help setting the alignment power field */ +/* A couple of macros to help setting the alignment power field. */ #define ALIGN_SET(field,x,y) \ if (((field) & IMAGE_SCN_ALIGN_64BYTES) == x )\ {\ @@ -1633,21 +1692,27 @@ coff_set_alignment_hook (abfd, section, scnhdr) section->lma = hdr->s_vaddr; - /* check for extended relocs */ + /* Check for extended relocs. */ if (hdr->s_flags & IMAGE_SCN_LNK_NRELOC_OVFL) { struct external_reloc dst; struct internal_reloc n; file_ptr oldpos = bfd_tell (abfd); + bfd_size_type relsz = bfd_coff_relsz (abfd); + bfd_seek (abfd, (file_ptr) hdr->s_relptr, 0); - if (bfd_bread ((PTR) &dst, (bfd_size_type) bfd_coff_relsz (abfd), abfd) - != bfd_coff_relsz (abfd)) + if (bfd_bread ((PTR) &dst, relsz, abfd) != relsz) return; coff_swap_reloc_in (abfd, &dst, &n); bfd_seek (abfd, oldpos, 0); - section->reloc_count = hdr->s_nreloc = n.r_vaddr; + section->reloc_count = hdr->s_nreloc = n.r_vaddr - 1; + section->rel_filepos += relsz; } + else if (hdr->s_nreloc == 0xffff) + (*_bfd_error_handler) + ("%s: warning: claims to have 0xffff relocs, without overflow", + bfd_get_filename (abfd)); } #undef ALIGN_SET #undef ELIFALIGN_SET @@ -1703,9 +1768,9 @@ coff_set_alignment_hook (abfd, section, scnhdr) #ifndef coff_mkobject -static boolean coff_mkobject PARAMS ((bfd *)); +static bfd_boolean coff_mkobject PARAMS ((bfd *)); -static boolean +static bfd_boolean coff_mkobject (abfd) bfd * abfd; { @@ -1714,7 +1779,7 @@ coff_mkobject (abfd) abfd->tdata.coff_obj_data = (struct coff_tdata *) bfd_zalloc (abfd, amt); if (abfd->tdata.coff_obj_data == 0) - return false; + return FALSE; coff = coff_data (abfd); coff->symbols = (coff_symbol_type *) NULL; coff->conversion_table = (unsigned int *) NULL; @@ -1724,11 +1789,12 @@ coff_mkobject (abfd) /* make_abs_section(abfd);*/ - return true; + return TRUE; } #endif /* Create the COFF backend specific information. */ + #ifndef coff_mkobject_hook static PTR coff_mkobject_hook (abfd, filehdr, aouthdr) @@ -1778,7 +1844,7 @@ coff_mkobject_hook (abfd, filehdr, aouthdr) # else xcoff->xcoff64 = 0; # endif - xcoff->full_aouthdr = true; + xcoff->full_aouthdr = TRUE; xcoff->toc = internal_a->o_toc; xcoff->sntoc = internal_a->o_sntoc; xcoff->snentry = internal_a->o_snentry; @@ -1815,7 +1881,7 @@ coff_mkobject_hook (abfd, filehdr, aouthdr) would be target independent and would also be much more successful at linking together COFF files for different architectures. */ -static boolean +static bfd_boolean coff_set_arch_mach_hook (abfd, filehdr) bfd *abfd; PTR filehdr; @@ -1824,6 +1890,7 @@ coff_set_arch_mach_hook (abfd, filehdr) enum bfd_architecture arch; struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; + /* Zero selects the default machine for an arch. */ machine = 0; switch (internal_f->f_magic) { @@ -1831,13 +1898,11 @@ coff_set_arch_mach_hook (abfd, filehdr) case OR32_MAGIC_BIG: case OR32_MAGIC_LITTLE: arch = bfd_arch_or32; - machine = 0; break; #endif #ifdef PPCMAGIC case PPCMAGIC: arch = bfd_arch_powerpc; - machine = 0; /* what does this mean? (krk) */ break; #endif #ifdef I386MAGIC @@ -1846,20 +1911,17 @@ coff_set_arch_mach_hook (abfd, filehdr) case I386AIXMAGIC: /* Danbury PS/2 AIX C Compiler */ case LYNXCOFFMAGIC: /* shadows the m68k Lynx number below, sigh */ arch = bfd_arch_i386; - machine = 0; break; #endif #ifdef IA64MAGIC case IA64MAGIC: arch = bfd_arch_ia64; - machine = 0; break; #endif #ifdef A29K_MAGIC_BIG case A29K_MAGIC_BIG: case A29K_MAGIC_LITTLE: arch = bfd_arch_a29k; - machine = 0; break; #endif #ifdef ARMMAGIC @@ -1867,21 +1929,25 @@ coff_set_arch_mach_hook (abfd, filehdr) case ARMPEMAGIC: case THUMBPEMAGIC: arch = bfd_arch_arm; - switch (internal_f->f_flags & F_ARM_ARCHITECTURE_MASK) + machine = bfd_arm_get_mach_from_notes (abfd, ARM_NOTE_SECTION); + if (machine == bfd_mach_arm_unknown) { - case F_ARM_2: machine = bfd_mach_arm_2; break; - case F_ARM_2a: machine = bfd_mach_arm_2a; break; - case F_ARM_3: machine = bfd_mach_arm_3; break; - default: - case F_ARM_3M: machine = bfd_mach_arm_3M; break; - case F_ARM_4: machine = bfd_mach_arm_4; break; - case F_ARM_4T: machine = bfd_mach_arm_4T; break; - /* The COFF header does not have enough bits available - to cover all the different ARM architectures. So - we interpret F_ARM_5, the highest flag value to mean - "the highest ARM architecture known to BFD" which is - currently the XScale. */ - case F_ARM_5: machine = bfd_mach_arm_XScale; break; + switch (internal_f->f_flags & F_ARM_ARCHITECTURE_MASK) + { + case F_ARM_2: machine = bfd_mach_arm_2; break; + case F_ARM_2a: machine = bfd_mach_arm_2a; break; + case F_ARM_3: machine = bfd_mach_arm_3; break; + default: + case F_ARM_3M: machine = bfd_mach_arm_3M; break; + case F_ARM_4: machine = bfd_mach_arm_4; break; + case F_ARM_4T: machine = bfd_mach_arm_4T; break; + /* The COFF header does not have enough bits available + to cover all the different ARM architectures. So + we interpret F_ARM_5, the highest flag value to mean + "the highest ARM architecture known to BFD" which is + currently the XScale. */ + case F_ARM_5: machine = bfd_mach_arm_XScale; break; + } } break; #endif @@ -1921,7 +1987,7 @@ coff_set_arch_mach_hook (abfd, filehdr) machine = bfd_mach_z8002; break; default: - return false; + return FALSE; } break; #endif @@ -2000,7 +2066,7 @@ coff_set_arch_mach_hook (abfd, filehdr) || bfd_bread (buf, amt, abfd) != amt) { free (buf); - return false; + return FALSE; } bfd_coff_swap_sym_in (abfd, (PTR) buf, (PTR) &sym); if (sym.n_sclass == C_FILE) @@ -2044,7 +2110,6 @@ coff_set_arch_mach_hook (abfd, filehdr) #ifdef WE32KMAGIC case WE32KMAGIC: arch = bfd_arch_we32k; - machine = 0; break; #endif @@ -2052,7 +2117,7 @@ coff_set_arch_mach_hook (abfd, filehdr) case H8300MAGIC: arch = bfd_arch_h8300; machine = bfd_mach_h8300; - /* !! FIXME this probably isn't the right place for this */ + /* !! FIXME this probably isn't the right place for this. */ abfd->flags |= BFD_IS_RELAXABLE; break; #endif @@ -2061,7 +2126,7 @@ coff_set_arch_mach_hook (abfd, filehdr) case H8300HMAGIC: arch = bfd_arch_h8300; machine = bfd_mach_h8300h; - /* !! FIXME this probably isn't the right place for this */ + /* !! FIXME this probably isn't the right place for this. */ abfd->flags |= BFD_IS_RELAXABLE; break; #endif @@ -2070,7 +2135,25 @@ coff_set_arch_mach_hook (abfd, filehdr) case H8300SMAGIC: arch = bfd_arch_h8300; machine = bfd_mach_h8300s; - /* !! FIXME this probably isn't the right place for this */ + /* !! FIXME this probably isn't the right place for this. */ + abfd->flags |= BFD_IS_RELAXABLE; + break; +#endif + +#ifdef H8300HNMAGIC + case H8300HNMAGIC: + arch = bfd_arch_h8300; + machine = bfd_mach_h8300hn; + /* !! FIXME this probably isn't the right place for this. */ + abfd->flags |= BFD_IS_RELAXABLE; + break; +#endif + +#ifdef H8300SNMAGIC + case H8300SNMAGIC: + arch = bfd_arch_h8300; + machine = bfd_mach_h8300sn; + /* !! FIXME this probably isn't the right place for this. */ abfd->flags |= BFD_IS_RELAXABLE; break; #endif @@ -2082,21 +2165,18 @@ coff_set_arch_mach_hook (abfd, filehdr) case SH_ARCH_MAGIC_WINCE: #endif arch = bfd_arch_sh; - machine = 0; break; #endif #ifdef MIPS_ARCH_MAGIC_WINCE case MIPS_ARCH_MAGIC_WINCE: arch = bfd_arch_mips; - machine = 0; break; #endif #ifdef H8500MAGIC case H8500MAGIC: arch = bfd_arch_h8500; - machine = 0; break; #endif @@ -2106,7 +2186,6 @@ coff_set_arch_mach_hook (abfd, filehdr) case LYNXCOFFMAGIC: #endif arch = bfd_arch_sparc; - machine = 0; break; #endif @@ -2118,16 +2197,17 @@ coff_set_arch_mach_hook (abfd, filehdr) #ifdef TICOFF0MAGIC #ifdef TICOFF_TARGET_ARCH - /* this TI COFF section should be used by all new TI COFF v0 targets */ + /* This TI COFF section should be used by all new TI COFF v0 targets. */ case TICOFF0MAGIC: arch = TICOFF_TARGET_ARCH; + machine = TICOFF_TARGET_MACHINE_GET (internal_f->f_flags); break; #endif #endif #ifdef TICOFF1MAGIC - /* this TI COFF section should be used by all new TI COFF v1/2 targets */ - /* TI COFF1 and COFF2 use the target_id field to specify which arch */ + /* This TI COFF section should be used by all new TI COFF v1/2 targets. */ + /* TI COFF1 and COFF2 use the target_id field to specify which arch. */ case TICOFF1MAGIC: case TICOFF2MAGIC: switch (internal_f->f_target_id) @@ -2135,6 +2215,7 @@ coff_set_arch_mach_hook (abfd, filehdr) #ifdef TI_TARGET_ID case TI_TARGET_ID: arch = TICOFF_TARGET_ARCH; + machine = TICOFF_TARGET_MACHINE_GET (internal_f->f_flags); break; #endif default: @@ -2165,21 +2246,21 @@ coff_set_arch_mach_hook (abfd, filehdr) break; #endif - default: /* Unreadable input file type */ + default: /* Unreadable input file type. */ arch = bfd_arch_obscure; break; } bfd_default_set_arch_mach (abfd, arch, machine); - return true; + return TRUE; } #ifdef SYMNAME_IN_DEBUG -static boolean symname_in_debug_hook +static bfd_boolean symname_in_debug_hook PARAMS ((bfd *, struct internal_syment *)); -static boolean +static bfd_boolean symname_in_debug_hook (abfd, sym) bfd * abfd ATTRIBUTE_UNUSED; struct internal_syment *sym; @@ -2190,7 +2271,7 @@ symname_in_debug_hook (abfd, sym) #else #define symname_in_debug_hook \ - (boolean (*) PARAMS ((bfd *, struct internal_syment *))) bfd_false + (bfd_boolean (*) PARAMS ((bfd *, struct internal_syment *))) bfd_false #endif @@ -2202,12 +2283,11 @@ symname_in_debug_hook (abfd, sym) /* Handle the csect auxent of a C_EXT or C_HIDEXT symbol. */ -static boolean coff_pointerize_aux_hook +static bfd_boolean coff_pointerize_aux_hook PARAMS ((bfd *, combined_entry_type *, combined_entry_type *, unsigned int, combined_entry_type *)); -/*ARGSUSED*/ -static boolean +static bfd_boolean coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux) bfd *abfd ATTRIBUTE_UNUSED; combined_entry_type *table_base; @@ -2227,14 +2307,14 @@ coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux) aux->fix_scnlen = 1; } - /* Return true to indicate that the caller should not do any + /* Return TRUE to indicate that the caller should not do any further work on this auxent. */ - return true; + return TRUE; } - /* Return false to indicate that this auxent should be handled by + /* Return FALSE to indicate that this auxent should be handled by the caller. */ - return false; + return FALSE; } #else @@ -2242,12 +2322,11 @@ coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux) /* We don't want to pointerize bal entries. */ -static boolean coff_pointerize_aux_hook +static bfd_boolean coff_pointerize_aux_hook PARAMS ((bfd *, combined_entry_type *, combined_entry_type *, unsigned int, combined_entry_type *)); -/*ARGSUSED*/ -static boolean +static bfd_boolean coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux) bfd *abfd ATTRIBUTE_UNUSED; combined_entry_type *table_base ATTRIBUTE_UNUSED; @@ -2255,7 +2334,7 @@ coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux) unsigned int indaux; combined_entry_type *aux ATTRIBUTE_UNUSED; { - /* Return true if we don't want to pointerize this aux entry, which + /* Return TRUE if we don't want to pointerize this aux entry, which is the case for the lastfirst aux entry for a C_LEAFPROC symbol. */ return (indaux == 1 && (symbol->u.syment.n_sclass == C_LEAFPROC @@ -2270,13 +2349,13 @@ coff_pointerize_aux_hook (abfd, table_base, symbol, indaux, aux) #endif /* ! I960 */ #endif /* ! RS6000COFF_C */ -/* Print an aux entry. This returns true if it has printed it. */ +/* Print an aux entry. This returns TRUE if it has printed it. */ -static boolean coff_print_aux +static bfd_boolean coff_print_aux PARAMS ((bfd *, FILE *, combined_entry_type *, combined_entry_type *, combined_entry_type *, unsigned int)); -static boolean +static bfd_boolean coff_print_aux (abfd, file, table_base, symbol, aux, indaux) bfd *abfd ATTRIBUTE_UNUSED; FILE *file ATTRIBUTE_UNUSED; @@ -2323,12 +2402,12 @@ coff_print_aux (abfd, file, table_base, symbol, aux, indaux) (unsigned int) aux->u.auxent.x_csect.x_smclas, aux->u.auxent.x_csect.x_stab, (unsigned int) aux->u.auxent.x_csect.x_snstab); - return true; + return TRUE; } #endif - /* Return false to indicate that no special action was taken. */ - return false; + /* Return FALSE to indicate that no special action was taken. */ + return FALSE; } /* @@ -2351,7 +2430,7 @@ SUBSUBSECTION static int compare_arelent_ptr PARAMS ((const PTR, const PTR)); -/* AUX's ld wants relocations to be sorted */ +/* AUX's ld wants relocations to be sorted. */ static int compare_arelent_ptr (x, y) const PTR x; @@ -2367,7 +2446,7 @@ compare_arelent_ptr (x, y) #endif /* TARG_AUX */ -static boolean +static bfd_boolean coff_write_relocs (abfd, first_undef) bfd * abfd; int first_undef; @@ -2384,34 +2463,35 @@ coff_write_relocs (abfd, first_undef) p = s->orelocation; #else { - /* sort relocations before we write them out */ + /* Sort relocations before we write them out. */ bfd_size_type amt; amt = s->reloc_count; amt *= sizeof (arelent *); p = (arelent **) bfd_malloc (amt); if (p == NULL && s->reloc_count > 0) - return false; + return FALSE; memcpy (p, s->orelocation, (size_t) amt); qsort (p, s->reloc_count, sizeof (arelent *), compare_arelent_ptr); } #endif if (bfd_seek (abfd, s->rel_filepos, SEEK_SET) != 0) - return false; + return FALSE; #ifdef COFF_WITH_PE if (obj_pe (abfd) && s->reloc_count >= 0xffff) { - /* encode real count here as first reloc */ + /* Encode real count here as first reloc. */ struct internal_reloc n; + memset ((PTR) & n, 0, sizeof (n)); - /* add one to count *this* reloc (grr) */ + /* Add one to count *this* reloc (grr). */ n.r_vaddr = s->reloc_count + 1; coff_swap_reloc_out (abfd, &n, &dst); if (bfd_bwrite ((PTR) & dst, (bfd_size_type) bfd_coff_relsz (abfd), abfd) != bfd_coff_relsz (abfd)) - return false; + return FALSE; } #endif @@ -2419,6 +2499,7 @@ coff_write_relocs (abfd, first_undef) { struct internal_reloc n; arelent *q = p[i]; + memset ((PTR) & n, 0, sizeof (n)); /* Now we've renumbered the symbols we know where the @@ -2436,11 +2517,13 @@ coff_write_relocs (abfd, first_undef) int j; const char *sname = q->sym_ptr_ptr[0]->name; asymbol **outsyms = abfd->outsymbols; + for (j = first_undef; outsyms[j]; j++) { const char *intable = outsyms[j]->name; + if (strcmp (intable, sname) == 0) { - /* got a hit, so repoint the reloc */ + /* Got a hit, so repoint the reloc. */ q->sym_ptr_ptr = outsyms + j; break; } @@ -2462,7 +2545,8 @@ coff_write_relocs (abfd, first_undef) #ifdef SECTION_RELATIVE_ABSOLUTE_SYMBOL_P if (SECTION_RELATIVE_ABSOLUTE_SYMBOL_P (q,s)) #else - if (q->sym_ptr_ptr == bfd_abs_section_ptr->symbol_ptr_ptr) + if ((*q->sym_ptr_ptr)->section == bfd_abs_section_ptr + && ((*q->sym_ptr_ptr)->flags & BSF_SECTION_SYM) != 0) #endif /* This is a relocation relative to the absolute symbol. */ n.r_symndx = -1; @@ -2482,15 +2566,16 @@ coff_write_relocs (abfd, first_undef) #endif #ifdef SELECT_RELOC - /* Work out reloc type from what is required */ + /* Work out reloc type from what is required. */ SELECT_RELOC (n, q->howto); #else n.r_type = q->howto->type; #endif coff_swap_reloc_out (abfd, &n, &dst); + if (bfd_bwrite ((PTR) & dst, (bfd_size_type) bfd_coff_relsz (abfd), abfd) != bfd_coff_relsz (abfd)) - return false; + return FALSE; } #ifdef TARG_AUX @@ -2499,13 +2584,13 @@ coff_write_relocs (abfd, first_undef) #endif } - return true; + return TRUE; } /* Set flags and magic number of a coff file from architecture and machine - type. Result is true if we can represent the arch&type, false if not. */ + type. Result is TRUE if we can represent the arch&type, FALSE if not. */ -static boolean +static bfd_boolean coff_set_flags (abfd, magicp, flagsp) bfd * abfd; unsigned int *magicp ATTRIBUTE_UNUSED; @@ -2525,9 +2610,9 @@ coff_set_flags (abfd, magicp, flagsp) *flagsp = F_Z8002; break; default: - return false; + return FALSE; } - return true; + return TRUE; #endif #ifdef I960ROMAGIC @@ -2567,10 +2652,10 @@ coff_set_flags (abfd, magicp, flagsp) flags = F_I960HX; break; default: - return false; + return FALSE; } *flagsp = flags; - return true; + return TRUE; } break; #endif @@ -2578,17 +2663,17 @@ coff_set_flags (abfd, magicp, flagsp) #ifdef TIC30MAGIC case bfd_arch_tic30: *magicp = TIC30MAGIC; - return true; + return TRUE; #endif #ifdef TICOFF_DEFAULT_MAGIC case TICOFF_TARGET_ARCH: - /* if there's no indication of which version we want, use the default */ + /* If there's no indication of which version we want, use the default. */ if (!abfd->xvec ) *magicp = TICOFF_DEFAULT_MAGIC; else { - /* we may want to output in a different COFF version */ + /* We may want to output in a different COFF version. */ switch (abfd->xvec->name[4]) { case '0': @@ -2601,16 +2686,17 @@ coff_set_flags (abfd, magicp, flagsp) *magicp = TICOFF2MAGIC; break; default: - return false; + return FALSE; } } - return true; + TICOFF_TARGET_MACHINE_SET (flagsp, bfd_get_mach (abfd)); + return TRUE; #endif #ifdef TIC80_ARCH_MAGIC case bfd_arch_tic80: *magicp = TIC80_ARCH_MAGIC; - return true; + return TRUE; #endif #ifdef ARMMAGIC case bfd_arch_arm: @@ -2648,12 +2734,12 @@ coff_set_flags (abfd, magicp, flagsp) case bfd_mach_arm_5TE: * flagsp |= F_ARM_5; break; case bfd_mach_arm_XScale: * flagsp |= F_ARM_5; break; } - return true; + return TRUE; #endif #ifdef PPCMAGIC case bfd_arch_powerpc: *magicp = PPCMAGIC; - return true; + return TRUE; break; #endif #ifdef I386MAGIC @@ -2663,19 +2749,19 @@ coff_set_flags (abfd, magicp, flagsp) /* Just overwrite the usual value if we're doing Lynx. */ *magicp = LYNXCOFFMAGIC; #endif - return true; + return TRUE; break; #endif #ifdef I860MAGIC case bfd_arch_i860: *magicp = I860MAGIC; - return true; + return TRUE; break; #endif #ifdef IA64MAGIC case bfd_arch_ia64: *magicp = IA64MAGIC; - return true; + return TRUE; break; #endif #ifdef MC68MAGIC @@ -2694,14 +2780,14 @@ coff_set_flags (abfd, magicp, flagsp) /* Just overwrite the usual value if we're doing Lynx. */ *magicp = LYNXCOFFMAGIC; #endif - return true; + return TRUE; break; #endif #ifdef MC88MAGIC case bfd_arch_m88k: *magicp = MC88OMAGIC; - return true; + return TRUE; break; #endif #ifdef H8300MAGIC @@ -2710,13 +2796,19 @@ coff_set_flags (abfd, magicp, flagsp) { case bfd_mach_h8300: *magicp = H8300MAGIC; - return true; + return TRUE; case bfd_mach_h8300h: *magicp = H8300HMAGIC; - return true; + return TRUE; case bfd_mach_h8300s: *magicp = H8300SMAGIC; - return true; + return TRUE; + case bfd_mach_h8300hn: + *magicp = H8300HNMAGIC; + return TRUE; + case bfd_mach_h8300sn: + *magicp = H8300SNMAGIC; + return TRUE; } break; #endif @@ -2731,14 +2823,14 @@ coff_set_flags (abfd, magicp, flagsp) else *magicp = SH_ARCH_MAGIC_LITTLE; #endif - return true; + return TRUE; break; #endif #ifdef MIPS_ARCH_MAGIC_WINCE case bfd_arch_mips: *magicp = MIPS_ARCH_MAGIC_WINCE; - return true; + return TRUE; break; #endif @@ -2749,14 +2841,14 @@ coff_set_flags (abfd, magicp, flagsp) /* Just overwrite the usual value if we're doing Lynx. */ *magicp = LYNXCOFFMAGIC; #endif - return true; + return TRUE; break; #endif #ifdef H8500MAGIC case bfd_arch_h8500: *magicp = H8500MAGIC; - return true; + return TRUE; break; #endif #ifdef A29K_MAGIC_BIG @@ -2765,14 +2857,14 @@ coff_set_flags (abfd, magicp, flagsp) *magicp = A29K_MAGIC_BIG; else *magicp = A29K_MAGIC_LITTLE; - return true; + return TRUE; break; #endif #ifdef WE32KMAGIC case bfd_arch_we32k: *magicp = WE32KMAGIC; - return true; + return TRUE; break; #endif @@ -2783,20 +2875,20 @@ coff_set_flags (abfd, magicp, flagsp) #endif BFD_ASSERT (bfd_get_flavour (abfd) == bfd_target_xcoff_flavour); *magicp = bfd_xcoff_magic_number (abfd); - return true; + return TRUE; break; #endif #ifdef MCOREMAGIC case bfd_arch_mcore: * magicp = MCOREMAGIC; - return true; + return TRUE; #endif #ifdef W65MAGIC case bfd_arch_w65: *magicp = W65MAGIC; - return true; + return TRUE; #endif #ifdef OR32_MAGIC_BIG @@ -2805,19 +2897,19 @@ coff_set_flags (abfd, magicp, flagsp) * magicp = OR32_MAGIC_BIG; else * magicp = OR32_MAGIC_LITTLE; - return true; + return TRUE; #endif default: /* Unknown architecture. */ - /* Fall through to "return false" below, to avoid + /* Fall through to "return FALSE" below, to avoid "statement never reached" errors on the one below. */ break; } - return false; + return FALSE; } -static boolean +static bfd_boolean coff_set_arch_mach (abfd, arch, machine) bfd * abfd; enum bfd_architecture arch; @@ -2827,13 +2919,13 @@ coff_set_arch_mach (abfd, arch, machine) unsigned short dummy2; if (! bfd_default_set_arch_mach (abfd, arch, machine)) - return false; + return FALSE; if (arch != bfd_arch_unknown && ! coff_set_flags (abfd, &dummy1, &dummy2)) - return false; /* We can't represent this type */ + return FALSE; /* We can't represent this type */ - return true; /* We're easy ... */ + return TRUE; /* We're easy ... */ } #ifdef COFF_IMAGE_WITH_PE @@ -2870,14 +2962,14 @@ sort_by_secaddr (arg1, arg2) #undef ALIGN_SECTIONS_IN_FILE #endif -static boolean +static bfd_boolean coff_compute_section_file_positions (abfd) bfd * abfd; { asection *current; asection *previous = (asection *) NULL; file_ptr sofar = bfd_coff_filhsz (abfd); - boolean align_adjust; + bfd_boolean align_adjust; #ifdef ALIGN_SECTIONS_IN_FILE file_ptr old_sofar; #endif @@ -2926,6 +3018,11 @@ coff_compute_section_file_positions (abfd) if (coff_data (abfd)->link_info) { page_size = pe_data (abfd)->pe_opthdr.FileAlignment; + + /* If no file alignment has been set, default to one. + This repairs 'ld -r' for arm-wince-pe target. */ + if (page_size == 0) + page_size = 1; } else page_size = PE_DEF_FILE_ALIGNMENT; @@ -2983,7 +3080,7 @@ coff_compute_section_file_positions (abfd) amt = sizeof (struct asection *) * (count + 1); section_list = bfd_malloc (amt); if (section_list == NULL) - return false; + return FALSE; i = 0; for (current = abfd->sections; current != NULL; current = current->next) @@ -3036,7 +3133,7 @@ coff_compute_section_file_positions (abfd) } #endif /* ! COFF_IMAGE_WITH_PE */ - align_adjust = false; + align_adjust = FALSE; for (current = abfd->sections; current != (asection *) NULL; current = current->next) @@ -3049,7 +3146,7 @@ coff_compute_section_file_positions (abfd) bfd_size_type amt = sizeof (struct coff_section_tdata); current->used_by_bfd = (PTR) bfd_zalloc (abfd, amt); if (current->used_by_bfd == NULL) - return false; + return FALSE; } if (pei_section_data (abfd, current) == NULL) { @@ -3057,7 +3154,7 @@ coff_compute_section_file_positions (abfd) coff_section_data (abfd, current)->tdata = (PTR) bfd_zalloc (abfd, amt); if (coff_section_data (abfd, current)->tdata == NULL) - return false; + return FALSE; } if (pei_section_data (abfd, current)->virt_size == 0) pei_section_data (abfd, current)->virt_size = current->_raw_size; @@ -3080,21 +3177,21 @@ coff_compute_section_file_positions (abfd) #ifdef ALIGN_SECTIONS_IN_FILE if ((abfd->flags & EXEC_P) != 0) { - /* make sure this section is aligned on the right boundary - by - padding the previous section up if necessary */ + /* Make sure this section is aligned on the right boundary - by + padding the previous section up if necessary. */ old_sofar = sofar; #ifdef RS6000COFF_C /* AIX loader checks the text section alignment of (vma - filepos) So even though the filepos may be aligned wrt the o_algntext, for - AIX executables, this check fails. This shows up when an native + AIX executables, this check fails. This shows up when a native AIX executable is stripped with gnu strip because the default vma of native is 0x10000150 but default for gnu is 0x10000140. Gnu - stripped gnu excutable passes this check because the filepos is + stripped gnu excutable passes this check because the filepos is 0x0140. This problem also show up with 64 bit shared objects. The data section must also be aligned. */ - if (!strcmp (current->name, _TEXT) - || !strcmp (current->name, _DATA)) + if (!strcmp (current->name, _TEXT) + || !strcmp (current->name, _DATA)) { bfd_vma pad; bfd_vma align; @@ -3103,8 +3200,8 @@ coff_compute_section_file_positions (abfd) align = 1 << current->alignment_power; pad = abs (current->vma - sofar) % align; - - if (pad) + + if (pad) { pad = align - pad; sofar += pad; @@ -3117,9 +3214,7 @@ coff_compute_section_file_positions (abfd) } #endif if (previous != (asection *) NULL) - { - previous->_raw_size += sofar - old_sofar; - } + previous->_raw_size += sofar - old_sofar; } #endif @@ -3141,7 +3236,7 @@ coff_compute_section_file_positions (abfd) sofar += current->_raw_size; #ifdef ALIGN_SECTIONS_IN_FILE - /* make sure that this section is of the right size too */ + /* Make sure that this section is of the right size too. */ if ((abfd->flags & EXEC_P) == 0) { bfd_size_type old_size; @@ -3166,7 +3261,7 @@ coff_compute_section_file_positions (abfd) _raw_size, in case the caller only writes out data to the unaligned _raw_size. */ if (pei_section_data (abfd, current)->virt_size < current->_raw_size) - align_adjust = true; + align_adjust = TRUE; #endif #ifdef _LIB @@ -3192,7 +3287,7 @@ coff_compute_section_file_positions (abfd) b = 0; if (bfd_seek (abfd, sofar - 1, SEEK_SET) != 0 || bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1) - return false; + return FALSE; } /* Make sure the relocations are aligned. We don't need to make @@ -3201,9 +3296,9 @@ coff_compute_section_file_positions (abfd) sofar = BFD_ALIGN (sofar, 1 << COFF_DEFAULT_SECTION_ALIGNMENT_POWER); obj_relocbase (abfd) = sofar; - abfd->output_has_begun = true; + abfd->output_has_begun = TRUE; - return true; + return TRUE; } #if 0 @@ -3215,7 +3310,7 @@ coff_compute_section_file_positions (abfd) /* If .file, .text, .data, .bss symbols are missing, add them. */ /* @@ Should we only be adding missing symbols, or overriding the aux values for existing section symbols? */ -static boolean +static bfd_boolean coff_add_missing_symbols (abfd) bfd *abfd; { @@ -3230,10 +3325,11 @@ coff_add_missing_symbols (abfd) { coff_symbol_type *csym = coff_symbol_from (abfd, sympp[i]); const char *name; + if (csym) { - /* only do this if there is a coff representation of the input - symbol */ + /* Only do this if there is a coff representation of the input + symbol. */ if (csym->native && csym->native->u.syment.n_sclass == C_FILE) { need_file = 0; @@ -3259,19 +3355,19 @@ coff_add_missing_symbols (abfd) need_file = 0; if (!need_text && !need_data && !need_bss && !need_file) - return true; + return TRUE; nsyms += need_text + need_data + need_bss + need_file; amt = nsyms; amt *= sizeof (asymbol *); sympp2 = (asymbol **) bfd_alloc (abfd, amt); if (!sympp2) - return false; + return FALSE; memcpy (sympp2, sympp, i * sizeof (asymbol *)); + if (need_file) - { - /* @@ Generate fake .file symbol, in sympp2[i], and increment i. */ - abort (); - } + /* @@ Generate fake .file symbol, in sympp2[i], and increment i. */ + abort (); + if (need_text) sympp2[i++] = coff_section_symbol (abfd, _TEXT); if (need_data) @@ -3280,7 +3376,7 @@ coff_add_missing_symbols (abfd) sympp2[i++] = coff_section_symbol (abfd, _BSS); BFD_ASSERT (i == nsyms); bfd_set_symtab (abfd, sympp2, nsyms); - return true; + return TRUE; } #endif /* 0 */ @@ -3290,7 +3386,7 @@ coff_add_missing_symbols (abfd) static unsigned int pelength; static unsigned int peheader; -static boolean +static bfd_boolean coff_read_word (abfd, value) bfd *abfd; unsigned int *value; @@ -3302,7 +3398,7 @@ coff_read_word (abfd, value) if (status < 1) { *value = 0; - return false; + return FALSE; } if (status == 1) @@ -3312,14 +3408,14 @@ coff_read_word (abfd, value) pelength += (unsigned int) status; - return true; + return TRUE; } static unsigned int coff_compute_checksum (abfd) bfd *abfd; { - boolean more_data; + bfd_boolean more_data; file_ptr filepos; unsigned int value; unsigned int total; @@ -3343,7 +3439,7 @@ coff_compute_checksum (abfd) return (0xffff & (total + (total >> 0x10))); } -static boolean +static bfd_boolean coff_apply_checksum (abfd) bfd *abfd; { @@ -3351,51 +3447,51 @@ coff_apply_checksum (abfd) unsigned int checksum = 0; if (bfd_seek (abfd, 0x3c, SEEK_SET) != 0) - return false; + return FALSE; if (!coff_read_word (abfd, &peheader)) - return false; + return FALSE; if (bfd_seek (abfd, peheader + 0x58, SEEK_SET) != 0) - return false; + return FALSE; checksum = 0; bfd_bwrite (&checksum, (bfd_size_type) 4, abfd); if (bfd_seek (abfd, peheader, SEEK_SET) != 0) - return false; + return FALSE; computed = coff_compute_checksum (abfd); checksum = computed + pelength; if (bfd_seek (abfd, peheader + 0x58, SEEK_SET) != 0) - return false; + return FALSE; bfd_bwrite (&checksum, (bfd_size_type) 4, abfd); - return true; + return TRUE; } #endif /* COFF_IMAGE_WITH_PE */ /* SUPPRESS 558 */ /* SUPPRESS 529 */ -static boolean +static bfd_boolean coff_write_object_contents (abfd) bfd * abfd; { asection *current; - boolean hasrelocs = false; - boolean haslinno = false; - boolean hasdebug = false; + bfd_boolean hasrelocs = FALSE; + bfd_boolean haslinno = FALSE; + bfd_boolean hasdebug = FALSE; file_ptr scn_base; file_ptr reloc_base; file_ptr lineno_base; file_ptr sym_base; unsigned long reloc_size = 0, reloc_count = 0; unsigned long lnno_size = 0; - boolean long_section_names; + bfd_boolean long_section_names; asection *text_sec = NULL; asection *data_sec = NULL; asection *bss_sec = NULL; @@ -3408,25 +3504,25 @@ coff_write_object_contents (abfd) bfd_set_error (bfd_error_system_call); /* Make a pass through the symbol table to count line number entries and - put them into the correct asections */ + put them into the correct asections. */ lnno_size = coff_count_linenumbers (abfd) * bfd_coff_linesz (abfd); if (! abfd->output_has_begun) { if (! coff_compute_section_file_positions (abfd)) - return false; + return FALSE; } reloc_base = obj_relocbase (abfd); - /* Work out the size of the reloc and linno areas */ + /* Work out the size of the reloc and linno areas. */ for (current = abfd->sections; current != NULL; current = current->next) { #ifdef COFF_WITH_PE - /* we store the actual reloc count in the first reloc's addr */ + /* We store the actual reloc count in the first reloc's addr. */ if (obj_pe (abfd) && current->reloc_count >= 0xffff) reloc_count ++; #endif @@ -3438,7 +3534,7 @@ coff_write_object_contents (abfd) lineno_base = reloc_base + reloc_size; sym_base = lineno_base + lnno_size; - /* Indicate in each section->line_filepos its actual file address */ + /* Indicate in each section->line_filepos its actual file address. */ for (current = abfd->sections; current != NULL; current = current->next) { @@ -3457,7 +3553,7 @@ coff_write_object_contents (abfd) current->rel_filepos = reloc_base; reloc_base += current->reloc_count * bfd_coff_relsz (abfd); #ifdef COFF_WITH_PE - /* extra reloc to hold real count */ + /* Extra reloc to hold real count. */ if (obj_pe (abfd) && current->reloc_count >= 0xffff) reloc_base += bfd_coff_relsz (abfd); #endif @@ -3487,21 +3583,21 @@ coff_write_object_contents (abfd) } if (bfd_seek (abfd, scn_base, SEEK_SET) != 0) - return false; + return FALSE; - long_section_names = false; + long_section_names = FALSE; for (current = abfd->sections; current != NULL; current = current->next) { struct internal_scnhdr section; - boolean is_reloc_section = false; + bfd_boolean is_reloc_section = FALSE; #ifdef COFF_IMAGE_WITH_PE if (strcmp (current->name, ".reloc") == 0) { - is_reloc_section = true; - hasrelocs = true; + is_reloc_section = TRUE; + hasrelocs = TRUE; pe_data (abfd)->has_reloc_section = 1; } #endif @@ -3522,7 +3618,7 @@ coff_write_object_contents (abfd) memset (section.s_name, 0, SCNNMLEN); sprintf (section.s_name, "/%lu", (unsigned long) string_size); string_size += len + 1; - long_section_names = true; + long_section_names = TRUE; } } #endif @@ -3553,19 +3649,14 @@ coff_write_object_contents (abfd) section.s_paddr = 0; #endif - /* - If this section has no size or is unloadable then the scnptr - will be 0 too - */ + /* If this section has no size or is unloadable then the scnptr + will be 0 too. */ if (current->_raw_size == 0 || (current->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0) - { - section.s_scnptr = 0; - } + section.s_scnptr = 0; else - { - section.s_scnptr = current->filepos; - } + section.s_scnptr = current->filepos; + section.s_relptr = current->rel_filepos; section.s_lnnoptr = current->line_filepos; section.s_nreloc = current->reloc_count; @@ -3573,13 +3664,13 @@ coff_write_object_contents (abfd) #ifndef COFF_IMAGE_WITH_PE /* In PEI, relocs come in the .reloc section. */ if (current->reloc_count != 0) - hasrelocs = true; + hasrelocs = TRUE; #endif if (current->lineno_count != 0) - haslinno = true; + haslinno = TRUE; if ((current->flags & SEC_DEBUGGING) != 0 && ! is_reloc_section) - hasdebug = true; + hasdebug = TRUE; #ifdef RS6000COFF_C #ifndef XCOFF64 @@ -3595,17 +3686,11 @@ coff_write_object_contents (abfd) section.s_flags = sec_to_styp_flags (current->name, current->flags); if (!strcmp (current->name, _TEXT)) - { - text_sec = current; - } + text_sec = current; else if (!strcmp (current->name, _DATA)) - { - data_sec = current; - } + data_sec = current; else if (!strcmp (current->name, _BSS)) - { - bss_sec = current; - } + bss_sec = current; #ifdef I960 section.s_align = (current->alignment_power @@ -3613,7 +3698,7 @@ coff_write_object_contents (abfd) : 0); #endif #ifdef TIC80COFF - /* TI COFF puts the alignment power in bits 8-11 of the flags */ + /* TI COFF puts the alignment power in bits 8-11 of the flags. */ section.s_flags |= (current->alignment_power & 0xF) << 8; #endif #ifdef COFF_ENCODE_ALIGNMENT @@ -3636,7 +3721,7 @@ coff_write_object_contents (abfd) if (coff_swap_scnhdr_out (abfd, §ion, &buff) == 0 || bfd_bwrite ((PTR) &buff, amt, abfd) != amt) - return false; + return FALSE; } #ifdef COFF_WITH_PE @@ -3760,7 +3845,7 @@ coff_write_object_contents (abfd) amt = bfd_coff_scnhsz (abfd); if (coff_swap_scnhdr_out (abfd, &scnhdr, &buff) == 0 || bfd_bwrite ((PTR) &buff, amt, abfd) != amt) - return false; + return FALSE; } } #endif @@ -3770,14 +3855,11 @@ coff_write_object_contents (abfd) /* Don't include the internal abs section in the section count */ - /* - We will NOT put a fucking timestamp in the header here. Every time you + /* We will NOT put a fucking timestamp in the header here. Every time you put it back, I will come in and take it out again. I'm sorry. This field does not belong here. We fill it with a 0 so it compares the - same but is not a reasonable time. -- gnu@cygnus.com - */ + same but is not a reasonable time. -- gnu@cygnus.com */ internal_f.f_timdat = 0; - internal_f.f_flags = 0; if (abfd->flags & EXEC_P) @@ -3806,7 +3888,9 @@ coff_write_object_contents (abfd) internal_f.f_flags |= IMAGE_FILE_DEBUG_STRIPPED; #endif -#ifndef COFF_WITH_PE +#ifdef COFF_WITH_PE + internal_f.f_flags |= IMAGE_FILE_32BIT_MACHINE; +#else if (bfd_little_endian (abfd)) internal_f.f_flags |= F_AR32WR; else @@ -3814,18 +3898,16 @@ coff_write_object_contents (abfd) #endif #ifdef TI_TARGET_ID - /* target id is used in TI COFF v1 and later; COFF0 won't use this field, - but it doesn't hurt to set it internally */ + /* Target id is used in TI COFF v1 and later; COFF0 won't use this field, + but it doesn't hurt to set it internally. */ internal_f.f_target_id = TI_TARGET_ID; #endif #ifdef TIC80_TARGET_ID internal_f.f_target_id = TIC80_TARGET_ID; #endif - /* - FIXME, should do something about the other byte orders and - architectures. - */ + /* FIXME, should do something about the other byte orders and + architectures. */ #ifdef RS6000COFF_C if ((abfd->flags & DYNAMIC) != 0) @@ -3836,11 +3918,11 @@ coff_write_object_contents (abfd) memset (&internal_a, 0, sizeof internal_a); - /* Set up architecture-dependent stuff */ - + /* Set up architecture-dependent stuff. */ { unsigned int magic = 0; unsigned short flags = 0; + coff_set_flags (abfd, &magic, &flags); internal_f.f_magic = magic; internal_f.f_flags |= flags; @@ -3849,14 +3931,13 @@ coff_write_object_contents (abfd) #ifdef A29K #ifdef ULTRA3 /* NYU's machine */ /* FIXME: This is a bogus check. I really want to see if there - * is a .shbss or a .shdata section, if so then set the magic - * number to indicate a shared data executable. - */ + is a .shbss or a .shdata section, if so then set the magic + number to indicate a shared data executable. */ if (internal_f.f_nscns >= 7) - internal_a.magic = SHMAGIC; /* Shared magic */ + internal_a.magic = SHMAGIC; /* Shared magic. */ else #endif /* ULTRA3 */ - internal_a.magic = NMAGIC; /* Assume separate i/d */ + internal_a.magic = NMAGIC; /* Assume separate i/d. */ #define __A_MAGIC_SET__ #endif /* A29K */ #ifdef TICOFF_AOUT_MAGIC @@ -3971,7 +4052,7 @@ coff_write_object_contents (abfd) /* FIXME: Does anybody ever set this to another value? */ internal_a.vstamp = 0; - /* Now should write relocs, strings, syms */ + /* Now should write relocs, strings, syms. */ obj_sym_filepos (abfd) = sym_base; if (bfd_get_symcount (abfd) != 0) @@ -3979,17 +4060,17 @@ coff_write_object_contents (abfd) int firstundef; #if 0 if (!coff_add_missing_symbols (abfd)) - return false; + return FALSE; #endif if (!coff_renumber_symbols (abfd, &firstundef)) - return false; + return FALSE; coff_mangle_symbols (abfd); if (! coff_write_symbols (abfd)) - return false; + return FALSE; if (! coff_write_linenumbers (abfd)) - return false; + return FALSE; if (! coff_write_relocs (abfd, firstundef)) - return false; + return FALSE; } #ifdef COFF_LONG_SECTION_NAMES else if (long_section_names && ! obj_coff_strings_written (abfd)) @@ -3997,7 +4078,7 @@ coff_write_object_contents (abfd) /* If we have long section names we have to write out the string table even if there are no symbols. */ if (! coff_write_symbols (abfd)) - return false; + return FALSE; } #endif #ifdef COFF_IMAGE_WITH_PE @@ -4013,7 +4094,7 @@ coff_write_object_contents (abfd) (file_ptr) BFD_ALIGN (sym_base, COFF_PAGE_SIZE) - 1, SEEK_SET) != 0 || bfd_bwrite (&b, (bfd_size_type) 1, abfd) != 1) - return false; + return FALSE; } #endif #endif @@ -4116,7 +4197,7 @@ coff_write_object_contents (abfd) internal_a.o_cputype = 4; break; case bfd_arch_powerpc: - if (bfd_get_mach (abfd) == 0) + if (bfd_get_mach (abfd) == bfd_mach_ppc) internal_a.o_cputype = 3; else internal_a.o_cputype = 1; @@ -4132,7 +4213,7 @@ coff_write_object_contents (abfd) /* now write them */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) - return false; + return FALSE; { char * buff; @@ -4140,7 +4221,7 @@ coff_write_object_contents (abfd) buff = bfd_malloc (amount); if (buff == NULL) - return false; + return FALSE; bfd_coff_swap_filehdr_out (abfd, (PTR) &internal_f, (PTR) buff); amount = bfd_bwrite ((PTR) buff, amount, abfd); @@ -4148,19 +4229,19 @@ coff_write_object_contents (abfd) free (buff); if (amount != bfd_coff_filhsz (abfd)) - return false; + return FALSE; } if (abfd->flags & EXEC_P) { /* Note that peicode.h fills in a PEAOUTHDR, not an AOUTHDR. - include/coff/pe.h sets AOUTSZ == sizeof (PEAOUTHDR)) */ + include/coff/pe.h sets AOUTSZ == sizeof (PEAOUTHDR)). */ char * buff; bfd_size_type amount = bfd_coff_aoutsz (abfd); buff = bfd_malloc (amount); if (buff == NULL) - return false; + return FALSE; coff_swap_aouthdr_out (abfd, (PTR) &internal_a, (PTR) buff); amount = bfd_bwrite ((PTR) buff, amount, abfd); @@ -4168,11 +4249,11 @@ coff_write_object_contents (abfd) free (buff); if (amount != bfd_coff_aoutsz (abfd)) - return false; + return FALSE; #ifdef COFF_IMAGE_WITH_PE if (! coff_apply_checksum (abfd)) - return false; + return FALSE; #endif } #ifdef RS6000COFF_C @@ -4188,25 +4269,25 @@ coff_write_object_contents (abfd) else size = SMALL_AOUTSZ; if (bfd_bwrite ((PTR) &buff, (bfd_size_type) size, abfd) != size) - return false; + return FALSE; } #endif - return true; + return TRUE; } -static boolean +static bfd_boolean coff_set_section_contents (abfd, section, location, offset, count) bfd * abfd; sec_ptr section; - PTR location; + const PTR location; file_ptr offset; bfd_size_type count; { - if (! abfd->output_has_begun) /* set by bfd.c handler */ + if (! abfd->output_has_begun) /* Set by bfd.c handler. */ { if (! coff_compute_section_file_positions (abfd)) - return false; + return FALSE; } #if defined(_LIB) && !defined(TARG_AUX) @@ -4230,7 +4311,7 @@ coff_set_section_contents (abfd, section, location, offset, count) code has been tested on ISC 4.1 by me, and on SCO by Robert Lipe (Thanks!). - Gvran Uddeborg */ + Gvran Uddeborg . */ if (strcmp (section->name, _LIB) == 0) { @@ -4252,18 +4333,18 @@ coff_set_section_contents (abfd, section, location, offset, count) /* Don't write out bss sections - one way to do this is to see if the filepos has not been set. */ if (section->filepos == 0) - return true; + return TRUE; if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0) - return false; + return FALSE; if (count == 0) - return true; + return TRUE; return bfd_bwrite (location, count, abfd) == count; } #if 0 -static boolean +static bfd_boolean coff_close_and_cleanup (abfd) bfd *abfd; { @@ -4272,19 +4353,19 @@ coff_close_and_cleanup (abfd) { case bfd_archive: if (!_bfd_write_archive_contents (abfd)) - return false; + return FALSE; break; case bfd_object: if (!coff_write_object_contents (abfd)) - return false; + return FALSE; break; default: bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } /* We depend on bfd_close to free all the memory on the objalloc. */ - return true; + return TRUE; } #endif @@ -4328,7 +4409,7 @@ SUBSUBSECTION */ -static boolean +static bfd_boolean coff_slurp_line_table (abfd, asect) bfd *abfd; asection *asect; @@ -4341,10 +4422,17 @@ coff_slurp_line_table (abfd, asect) amt = (bfd_size_type) bfd_coff_linesz (abfd) * asect->lineno_count; native_lineno = (LINENO *) buy_and_read (abfd, asect->line_filepos, amt); + if (native_lineno == NULL) + { + (*_bfd_error_handler) + (_("%s: warning: line number table read failed"), + bfd_archive_filename (abfd)); + return FALSE; + } amt = ((bfd_size_type) asect->lineno_count + 1) * sizeof (alent); lineno_cache = (alent *) bfd_alloc (abfd, amt); if (lineno_cache == NULL) - return false; + return FALSE; else { unsigned int counter = 0; @@ -4354,16 +4442,17 @@ coff_slurp_line_table (abfd, asect) while (counter < asect->lineno_count) { struct internal_lineno dst; + bfd_coff_swap_lineno_in (abfd, src, &dst); cache_ptr->line_number = dst.l_lnno; if (cache_ptr->line_number == 0) { - boolean warned; + bfd_boolean warned; bfd_signed_vma symndx; coff_symbol_type *sym; - warned = false; + warned = FALSE; symndx = dst.l_addr.l_symndx; if (symndx < 0 || (bfd_vma) symndx >= obj_raw_syment_count (abfd)) @@ -4372,7 +4461,7 @@ coff_slurp_line_table (abfd, asect) (_("%s: warning: illegal symbol index %ld in line numbers"), bfd_archive_filename (abfd), dst.l_addr.l_symndx); symndx = 0; - warned = true; + warned = TRUE; } /* FIXME: We should not be casting between ints and pointers like this. */ @@ -4404,14 +4493,14 @@ coff_slurp_line_table (abfd, asect) } asect->lineno = lineno_cache; /* FIXME, free native_lineno here, or use alloca or something. */ - return true; + return TRUE; } /* Slurp in the symbol table, converting it to generic form. Note that if coff_relocate_section is defined, the linker will read symbols via coff_link_add_symbols, rather than via this routine. */ -static boolean +static bfd_boolean coff_slurp_symbol_table (abfd) bfd * abfd; { @@ -4419,36 +4508,34 @@ coff_slurp_symbol_table (abfd) coff_symbol_type *cached_area; unsigned int *table_ptr; bfd_size_type amt; - unsigned int number_of_symbols = 0; if (obj_symbols (abfd)) - return true; + return TRUE; - /* Read in the symbol table */ + /* Read in the symbol table. */ if ((native_symbols = coff_get_normalized_symtab (abfd)) == NULL) - { - return (false); - } /* on error */ + return FALSE; - /* Allocate enough room for all the symbols in cached form */ + /* Allocate enough room for all the symbols in cached form. */ amt = obj_raw_syment_count (abfd); amt *= sizeof (coff_symbol_type); cached_area = (coff_symbol_type *) bfd_alloc (abfd, amt); if (cached_area == NULL) - return false; + return FALSE; amt = obj_raw_syment_count (abfd); amt *= sizeof (unsigned int); table_ptr = (unsigned int *) bfd_alloc (abfd, amt); if (table_ptr == NULL) - return false; + return FALSE; else { coff_symbol_type *dst = cached_area; unsigned int last_native_index = obj_raw_syment_count (abfd); unsigned int this_index = 0; + while (this_index < last_native_index) { combined_entry_type *src = native_symbols + this_index; @@ -4461,7 +4548,7 @@ coff_slurp_symbol_table (abfd) dst->symbol.section = coff_section_from_bfd_index (abfd, src->u.syment.n_scnum); dst->symbol.flags = 0; - dst->done_lineno = false; + dst->done_lineno = FALSE; switch (src->u.syment.n_sclass) { @@ -4472,8 +4559,7 @@ coff_slurp_symbol_table (abfd) dst->symbol.flags = BSF_EXPORT | BSF_GLOBAL; dst->symbol.flags |= BSF_NOT_AT_END | BSF_FUNCTION; #endif - /* Fall through to next case */ - + /* Fall through to next case. */ #endif case C_EXT: @@ -4486,10 +4572,10 @@ coff_slurp_symbol_table (abfd) case C_HIDEXT: #endif #ifdef C_SYSTEM - case C_SYSTEM: /* System Wide variable */ + case C_SYSTEM: /* System Wide variable. */ #endif #ifdef COFF_WITH_PE - /* In PE, 0x68 (104) denotes a section symbol */ + /* In PE, 0x68 (104) denotes a section symbol. */ case C_SECTION: /* In PE, 0x69 (105) denotes a weak external symbol. */ case C_NT_WEAK: @@ -4563,16 +4649,16 @@ coff_slurp_symbol_table (abfd) break; - case C_STAT: /* static */ + case C_STAT: /* Static. */ #ifdef I960 - case C_LEAFSTAT: /* static leaf procedure */ + case C_LEAFSTAT: /* Static leaf procedure. */ #endif #if defined ARM - case C_THUMBSTAT: /* Thumb static */ - case C_THUMBLABEL: /* Thumb label */ - case C_THUMBSTATFUNC:/* Thumb static function */ + case C_THUMBSTAT: /* Thumb static. */ + case C_THUMBLABEL: /* Thumb label. */ + case C_THUMBSTATFUNC:/* Thumb static function. */ #endif - case C_LABEL: /* label */ + case C_LABEL: /* Label. */ if (src->u.syment.n_scnum == N_DEBUG) dst->symbol.flags = BSF_DEBUGGING; else @@ -4595,35 +4681,35 @@ coff_slurp_symbol_table (abfd) dst->symbol.value = src->u.syment.n_value; break; - case C_MOS: /* member of structure */ - case C_EOS: /* end of structure */ -#ifdef NOTDEF /* C_AUTOARG has the same value */ + case C_MOS: /* Member of structure. */ + case C_EOS: /* End of structure. */ +#ifdef NOTDEF /* C_AUTOARG has the same value. */ #ifdef C_GLBLREG - case C_GLBLREG: /* A29k-specific storage class */ + case C_GLBLREG: /* A29k-specific storage class. */ #endif #endif - case C_REGPARM: /* register parameter */ - case C_REG: /* register variable */ - /* C_AUTOARG conflictes with TI COFF C_UEXT */ + case C_REGPARM: /* Register parameter. */ + case C_REG: /* register variable. */ + /* C_AUTOARG conflicts with TI COFF C_UEXT. */ #if !defined (TIC80COFF) && !defined (TICOFF) #ifdef C_AUTOARG - case C_AUTOARG: /* 960-specific storage class */ + case C_AUTOARG: /* 960-specific storage class. */ #endif #endif - case C_TPDEF: /* type definition */ + case C_TPDEF: /* Type definition. */ case C_ARG: - case C_AUTO: /* automatic variable */ - case C_FIELD: /* bit field */ - case C_ENTAG: /* enumeration tag */ - case C_MOE: /* member of enumeration */ - case C_MOU: /* member of union */ - case C_UNTAG: /* union tag */ + case C_AUTO: /* Automatic variable. */ + case C_FIELD: /* Bit field. */ + case C_ENTAG: /* Enumeration tag. */ + case C_MOE: /* Member of enumeration. */ + case C_MOU: /* Member of union. */ + case C_UNTAG: /* Union tag. */ dst->symbol.flags = BSF_DEBUGGING; dst->symbol.value = (src->u.syment.n_value); break; - case C_FILE: /* file name */ - case C_STRTAG: /* structure tag */ + case C_FILE: /* File name. */ + case C_STRTAG: /* Structure tag. */ #ifdef RS6000COFF_C case C_GSYM: case C_LSYM: @@ -4631,7 +4717,9 @@ coff_slurp_symbol_table (abfd) case C_RSYM: case C_RPSYM: case C_STSYM: + case C_TCSYM: case C_BCOMM: + case C_ECOML: case C_ECOMM: case C_DECL: case C_ENTRY: @@ -4643,8 +4731,8 @@ coff_slurp_symbol_table (abfd) break; #ifdef RS6000COFF_C - case C_BINCL: /* beginning of include file */ - case C_EINCL: /* ending of include file */ + case C_BINCL: /* Beginning of include file. */ + case C_EINCL: /* Ending of include file. */ /* The value is actually a pointer into the line numbers of the file. We locate the line number entry, and set the section to the section which contains it, and @@ -4685,9 +4773,9 @@ coff_slurp_symbol_table (abfd) break; #endif - case C_BLOCK: /* ".bb" or ".eb" */ - case C_FCN: /* ".bf" or ".ef" (or PE ".lf") */ - case C_EFCN: /* physical end of function */ + case C_BLOCK: /* ".bb" or ".eb". */ + case C_FCN: /* ".bf" or ".ef" (or PE ".lf"). */ + case C_EFCN: /* Physical end of function. */ #if defined COFF_WITH_PE /* PE sets the symbol to a value relative to the start of the section. */ @@ -4709,7 +4797,7 @@ coff_slurp_symbol_table (abfd) #endif break; - case C_STATLAB: /* Static load time label */ + case C_STATLAB: /* Static load time label. */ dst->symbol.value = src->u.syment.n_value; dst->symbol.flags = BSF_GLOBAL; break; @@ -4722,22 +4810,22 @@ coff_slurp_symbol_table (abfd) && src->u.syment.n_scnum == 0) break; /* Fall through. */ - case C_EXTDEF: /* external definition */ - case C_ULABEL: /* undefined label */ - case C_USTATIC: /* undefined static */ + case C_EXTDEF: /* External definition. */ + case C_ULABEL: /* Undefined label. */ + case C_USTATIC: /* Undefined static. */ #ifndef COFF_WITH_PE /* C_LINE in regular coff is 0x68. NT has taken over this storage - class to represent a section symbol */ - case C_LINE: /* line # reformatted as symbol table entry */ + class to represent a section symbol. */ + case C_LINE: /* line # reformatted as symbol table entry. */ /* NT uses 0x67 for a weak symbol, not C_ALIAS. */ - case C_ALIAS: /* duplicate tag */ + case C_ALIAS: /* Duplicate tag. */ #endif - /* New storage classes for TI COFF */ + /* New storage classes for TI COFF. */ #if defined(TIC80COFF) || defined(TICOFF) - case C_UEXT: /* Tentative external definition */ + case C_UEXT: /* Tentative external definition. */ #endif - case C_EXTLAB: /* External load time label */ - case C_HIDDEN: /* ext symbol in dmert public lib */ + case C_EXTLAB: /* External load time label. */ + case C_HIDDEN: /* Ext symbol in dmert public lib. */ default: (*_bfd_error_handler) (_("%s: Unrecognized storage class %d for %s symbol `%s'"), @@ -4757,17 +4845,18 @@ coff_slurp_symbol_table (abfd) this_index += (src->u.syment.n_numaux) + 1; dst++; number_of_symbols++; - } /* walk the native symtab */ - } /* bfdize the native symtab */ + } + } obj_symbols (abfd) = cached_area; obj_raw_syments (abfd) = native_symbols; bfd_get_symcount (abfd) = number_of_symbols; obj_convert (abfd) = table_ptr; - /* Slurp the line tables for each section too */ + /* Slurp the line tables for each section too. */ { asection *p; + p = abfd->sections; while (p) { @@ -4775,7 +4864,8 @@ coff_slurp_symbol_table (abfd) p = p->next; } } - return true; + + return TRUE; } /* coff_slurp_symbol_table() */ /* Classify a COFF symbol. A couple of targets have globally visible @@ -4927,7 +5017,7 @@ SUBSUBSECTION } #endif -static boolean +static bfd_boolean coff_slurp_reloc_table (abfd, asect, symbols) bfd * abfd; sec_ptr asect; @@ -4940,20 +5030,20 @@ coff_slurp_reloc_table (abfd, asect, symbols) bfd_size_type amt; if (asect->relocation) - return true; + return TRUE; if (asect->reloc_count == 0) - return true; + return TRUE; if (asect->flags & SEC_CONSTRUCTOR) - return true; + return TRUE; if (!coff_slurp_symbol_table (abfd)) - return false; + return FALSE; amt = (bfd_size_type) bfd_coff_relsz (abfd) * asect->reloc_count; native_relocs = (RELOC *) buy_and_read (abfd, asect->rel_filepos, amt); amt = (bfd_size_type) asect->reloc_count * sizeof (arelent); reloc_cache = (arelent *) bfd_alloc (abfd, amt); if (reloc_cache == NULL) - return false; + return FALSE; for (idx = 0; idx < asect->reloc_count; idx++) { @@ -5001,15 +5091,15 @@ coff_slurp_reloc_table (abfd, asect, symbols) 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 */ + Note that symbols which used to be common must be left alone. */ - /* Calculate any reloc addend by looking at the symbol */ + /* Calculate any reloc addend by looking at the symbol. */ CALC_ADDEND (abfd, ptr, dst, cache_ptr); cache_ptr->address -= asect->vma; /* !! cache_ptr->section = (asection *) NULL;*/ - /* Fill in the cache_ptr->howto field from dst.r_type */ + /* Fill in the cache_ptr->howto field from dst.r_type. */ RTYPE2HOWTO (cache_ptr, &dst); #endif /* RELOC_PROCESSING */ @@ -5019,12 +5109,12 @@ coff_slurp_reloc_table (abfd, asect, symbols) (_("%s: illegal relocation type %d at address 0x%lx"), bfd_archive_filename (abfd), dst.r_type, (long) dst.r_vaddr); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } } asect->relocation = reloc_cache; - return true; + return TRUE; } #ifndef coff_rtype_to_howto @@ -5041,7 +5131,6 @@ static reloc_howto_type *coff_rtype_to_howto struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *)); -/*ARGSUSED*/ static reloc_howto_type * coff_rtype_to_howto (abfd, sec, rel, h, sym, addendp) bfd *abfd ATTRIBUTE_UNUSED; @@ -5077,16 +5166,16 @@ coff_canonicalize_reloc (abfd, section, relptr, symbols) if (section->flags & SEC_CONSTRUCTOR) { - /* this section has relocs made up by us, they are not in the - file, so take them out of their chain and place them into - the data area provided */ + /* This section has relocs made up by us, they are not in the + file, so take them out of their chain and place them into + the data area provided. */ arelent_chain *chain = section->constructor_chain; + for (count = 0; count < section->reloc_count; count++) { *relptr++ = &chain->relent; chain = chain->next; } - } else { @@ -5201,10 +5290,10 @@ dummy_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, #ifndef coff_link_output_has_begun -static boolean coff_link_output_has_begun +static bfd_boolean coff_link_output_has_begun PARAMS ((bfd *, struct coff_final_link_info *)); -static boolean +static bfd_boolean coff_link_output_has_begun (abfd, info) bfd * abfd; struct coff_final_link_info * info ATTRIBUTE_UNUSED; @@ -5215,15 +5304,15 @@ coff_link_output_has_begun (abfd, info) #ifndef coff_final_link_postscript -static boolean coff_final_link_postscript +static bfd_boolean coff_final_link_postscript PARAMS ((bfd *, struct coff_final_link_info *)); -static boolean +static bfd_boolean coff_final_link_postscript (abfd, pfinfo) bfd * abfd ATTRIBUTE_UNUSED; struct coff_final_link_info * pfinfo ATTRIBUTE_UNUSED; { - return true; + return TRUE; } #endif @@ -5279,20 +5368,20 @@ static const bfd_coff_backend_data bfd_coff_std_swap_table = coff_SWAP_scnhdr_out, FILHSZ, AOUTSZ, SCNHSZ, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN, #ifdef COFF_LONG_FILENAMES - true, + TRUE, #else - false, + FALSE, #endif #ifdef COFF_LONG_SECTION_NAMES - true, + TRUE, #else - false, + FALSE, #endif COFF_DEFAULT_SECTION_ALIGNMENT_POWER, #ifdef COFF_FORCE_SYMBOLS_IN_STRINGS - true, + TRUE, #else - false, + FALSE, #endif #ifdef COFF_DEBUG_STRING_WIDE_PREFIX 4, @@ -5310,6 +5399,92 @@ static const bfd_coff_backend_data bfd_coff_std_swap_table = coff_link_output_has_begun, coff_final_link_postscript }; +#ifdef TICOFF +/* 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 + 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, 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 +}; +#endif + +#ifdef TICOFF +/* 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 +}; +#endif + #ifndef coff_close_and_cleanup #define coff_close_and_cleanup _bfd_generic_close_and_cleanup #endif @@ -5385,7 +5560,7 @@ static const bfd_coff_backend_data bfd_coff_std_swap_table = #define coff_bfd_discard_group bfd_generic_discard_group #endif -#define CREATE_BIG_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE) \ +#define CREATE_BIG_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE, SWAP_TABLE) \ const bfd_target VAR = \ { \ NAME , \ @@ -5432,10 +5607,60 @@ const bfd_target VAR = \ \ ALTERNATIVE, \ \ - COFF_SWAP_TABLE \ + SWAP_TABLE \ +}; + +#define CREATE_BIGHDR_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE, SWAP_TABLE) \ +const bfd_target VAR = \ +{ \ + NAME , \ + bfd_target_coff_flavour, \ + BFD_ENDIAN_LITTLE, /* data byte order is little */ \ + BFD_ENDIAN_BIG, /* header byte order is big */ \ + /* object flags */ \ + (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | \ + HAS_SYMS | HAS_LOCALS | WP_TEXT | EXTRA_O_FLAGS), \ + /* section flags */ \ + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | EXTRA_S_FLAGS),\ + UNDER, /* leading symbol underscore */ \ + '/', /* ar_pad_char */ \ + 15, /* ar_max_namelen */ \ + \ + /* Data conversion functions. */ \ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, \ + bfd_getb32, bfd_getb_signed_32, bfd_putb32, \ + bfd_getb16, bfd_getb_signed_16, bfd_putb16, \ + \ + /* Header conversion functions. */ \ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, \ + bfd_getb32, bfd_getb_signed_32, bfd_putb32, \ + bfd_getb16, bfd_getb_signed_16, bfd_putb16, \ + \ + /* bfd_check_format */ \ + { _bfd_dummy_target, coff_object_p, bfd_generic_archive_p, \ + _bfd_dummy_target }, \ + /* bfd_set_format */ \ + { bfd_false, coff_mkobject, _bfd_generic_mkarchive, bfd_false }, \ + /* bfd_write_contents */ \ + { bfd_false, coff_write_object_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), \ + \ + ALTERNATIVE, \ + \ + SWAP_TABLE \ }; -#define CREATE_LITTLE_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE) \ +#define CREATE_LITTLE_COFF_TARGET_VEC(VAR, NAME, EXTRA_O_FLAGS, EXTRA_S_FLAGS, UNDER, ALTERNATIVE, SWAP_TABLE) \ const bfd_target VAR = \ { \ NAME , \ @@ -5480,5 +5705,5 @@ const bfd_target VAR = \ \ ALTERNATIVE, \ \ - COFF_SWAP_TABLE \ + SWAP_TABLE \ }; diff --git a/contrib/binutils/bfd/coffgen.c b/contrib/binutils/bfd/coffgen.c index 21589c6..a712b4b 100644 --- a/contrib/binutils/bfd/coffgen.c +++ b/contrib/binutils/bfd/coffgen.c @@ -1,6 +1,6 @@ /* Support for the generic parts of COFF, for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. @@ -46,19 +46,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ static void coff_fix_symbol_name PARAMS ((bfd *, asymbol *, combined_entry_type *, bfd_size_type *, asection **, bfd_size_type *)); -static boolean coff_write_symbol +static bfd_boolean coff_write_symbol PARAMS ((bfd *, asymbol *, combined_entry_type *, bfd_vma *, bfd_size_type *, asection **, bfd_size_type *)); -static boolean coff_write_alien_symbol +static bfd_boolean coff_write_alien_symbol PARAMS ((bfd *, asymbol *, bfd_vma *, bfd_size_type *, asection **, bfd_size_type *)); -static boolean coff_write_native_symbol +static bfd_boolean coff_write_native_symbol PARAMS ((bfd *, coff_symbol_type *, bfd_vma *, bfd_size_type *, asection **, bfd_size_type *)); static void coff_pointerize_aux PARAMS ((bfd *, combined_entry_type *, combined_entry_type *, unsigned int, combined_entry_type *)); -static boolean make_a_section_from_file +static bfd_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 *, @@ -74,7 +74,7 @@ static char *copy_name /* Take a section header read from a coff file (in HOST byte order), and make a BFD "section" out of it. This is used by ECOFF. */ -static boolean +static bfd_boolean make_a_section_from_file (abfd, hdr, target_index) bfd *abfd; struct internal_scnhdr *hdr; @@ -82,7 +82,7 @@ make_a_section_from_file (abfd, hdr, target_index) { asection *return_section; char *name; - boolean result = true; + bfd_boolean result = TRUE; flagword flags; name = NULL; @@ -103,14 +103,14 @@ make_a_section_from_file (abfd, hdr, target_index) { strings = _bfd_coff_read_string_table (abfd); if (strings == NULL) - return false; + return FALSE; /* FIXME: For extra safety, we should make sure that strindex does not run us past the end, but right now we don't know the length of the string table. */ strings += strindex; name = bfd_alloc (abfd, (bfd_size_type) strlen (strings) + 1); if (name == NULL) - return false; + return FALSE; strcpy (name, strings); } } @@ -120,14 +120,14 @@ make_a_section_from_file (abfd, hdr, target_index) /* Assorted wastage to null-terminate the name, thanks AT&T! */ name = bfd_alloc (abfd, (bfd_size_type) sizeof (hdr->s_name) + 1); if (name == NULL) - return false; + return FALSE; strncpy (name, (char *) &hdr->s_name[0], sizeof (hdr->s_name)); name[sizeof (hdr->s_name)] = 0; } return_section = bfd_make_section_anyway (abfd, name); if (return_section == NULL) - return false; + return FALSE; return_section->vma = hdr->s_vaddr; return_section->lma = hdr->s_paddr; @@ -147,7 +147,7 @@ make_a_section_from_file (abfd, hdr, target_index) if (! bfd_coff_styp_to_sec_flags_hook (abfd, hdr, name, return_section, & flags)) - result = false; + result = FALSE; return_section->flags = flags; @@ -226,7 +226,7 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a) if (! bfd_coff_set_arch_mach_hook (abfd, (PTR) internal_f)) goto fail; - /* Now copy data as required; construct all asections etc */ + /* Now copy data as required; construct all asections etc. */ if (nscns != 0) { unsigned int i; @@ -241,8 +241,6 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a) } } - /* make_abs_section (abfd); */ - return abfd->xvec; fail: @@ -331,7 +329,7 @@ coff_section_from_bfd_index (abfd, index) bfd *abfd; int index; { - struct sec *answer = abfd->sections; + struct bfd_section *answer = abfd->sections; if (index == N_ABS) return bfd_abs_section_ptr; @@ -367,7 +365,7 @@ coff_get_symtab_upper_bound (abfd) /* Canonicalize a COFF symbol table. */ long -coff_get_symtab (abfd, alocation) +coff_canonicalize_symtab (abfd, alocation) bfd *abfd; asymbol **alocation; { @@ -423,12 +421,12 @@ _bfd_coff_internal_syment_name (abfd, sym, buf) } /* Read in and swap the relocs. This returns a buffer holding the - relocs for section SEC in file ABFD. If CACHE is true and + relocs for section SEC in file ABFD. If CACHE is TRUE and INTERNAL_RELOCS is NULL, the relocs read in will be saved in case the function is called again. If EXTERNAL_RELOCS is not NULL, it is a buffer large enough to hold the unswapped relocs. If INTERNAL_RELOCS is not NULL, it is a buffer large enough to hold - the swapped relocs. If REQUIRE_INTERNAL is true, then the return + the swapped relocs. If REQUIRE_INTERNAL is TRUE, then the return value must be INTERNAL_RELOCS. The function returns NULL on error. */ struct internal_reloc * @@ -436,9 +434,9 @@ _bfd_coff_read_internal_relocs (abfd, sec, cache, external_relocs, require_internal, internal_relocs) bfd *abfd; asection *sec; - boolean cache; + bfd_boolean cache; bfd_byte *external_relocs; - boolean require_internal; + bfd_boolean require_internal; struct internal_reloc *internal_relocs; { bfd_size_type relsz; @@ -565,7 +563,7 @@ coff_count_linenumbers (abfd) do { asection * sec = q->symbol.section->output_section; - + /* Do not try to update fields in read-only sections. */ if (! bfd_is_const_section (sec)) sec->lineno_count ++; @@ -656,7 +654,7 @@ fixup_symbol_value (abfd, coff_symbol_ptr, syment) chain, and that the last one points to the first external symbol. We do that here too. */ -boolean +bfd_boolean coff_renumber_symbols (bfd_ptr, first_undef) bfd *bfd_ptr; int *first_undef; @@ -685,7 +683,7 @@ coff_renumber_symbols (bfd_ptr, first_undef) amt = sizeof (asymbol *) * ((bfd_size_type) symbol_count + 1); newsyms = (asymbol **) bfd_alloc (bfd_ptr, amt); if (!newsyms) - return false; + return FALSE; bfd_ptr->outsymbols = newsyms; for (i = 0; i < symbol_count; i++) if ((symbol_ptr_ptr[i]->flags & BSF_NOT_AT_END) != 0 @@ -748,7 +746,7 @@ coff_renumber_symbols (bfd_ptr, first_undef) } obj_conv_table_size (bfd_ptr) = native_index; - return true; + return TRUE; } /* Run thorough the symbol table again, and fix it so that all @@ -943,7 +941,7 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, /* Write a symbol out to a COFF file. */ -static boolean +static bfd_boolean coff_write_symbol (abfd, symbol, native, written, string_size_p, debug_string_section_p, debug_string_size_p) bfd *abfd; @@ -988,10 +986,10 @@ coff_write_symbol (abfd, symbol, native, written, string_size_p, symesz = bfd_coff_symesz (abfd); buf = bfd_alloc (abfd, symesz); if (!buf) - return false; + return FALSE; bfd_coff_swap_sym_out (abfd, &native->u.syment, buf); if (bfd_bwrite (buf, symesz, abfd) != symesz) - return false; + return FALSE; bfd_release (abfd, buf); if (native->u.syment.n_numaux > 0) @@ -1002,7 +1000,7 @@ coff_write_symbol (abfd, symbol, native, written, string_size_p, auxesz = bfd_coff_auxesz (abfd); buf = bfd_alloc (abfd, auxesz); if (!buf) - return false; + return FALSE; for (j = 0; j < native->u.syment.n_numaux; j++) { bfd_coff_swap_aux_out (abfd, @@ -1013,7 +1011,7 @@ coff_write_symbol (abfd, symbol, native, written, string_size_p, native->u.syment.n_numaux, buf); if (bfd_bwrite (buf, auxesz, abfd) != auxesz) - return false; + return FALSE; } bfd_release (abfd, buf); } @@ -1022,14 +1020,14 @@ coff_write_symbol (abfd, symbol, native, written, string_size_p, set_index (symbol, *written); *written += numaux + 1; - return true; + return TRUE; } /* Write out a symbol to a COFF file that does not come from a COFF file originally. This symbol may have been created by the linker, or we may be linking a non COFF file to a COFF file. */ -static boolean +static bfd_boolean coff_write_alien_symbol (abfd, symbol, written, string_size_p, debug_string_section_p, debug_string_size_p) bfd *abfd; @@ -1062,7 +1060,7 @@ coff_write_alien_symbol (abfd, symbol, written, string_size_p, format. So, we just ignore them. We must clobber the symbol name to keep it from being put in the string table. */ symbol->name = ""; - return true; + return TRUE; } else { @@ -1097,7 +1095,7 @@ coff_write_alien_symbol (abfd, symbol, written, string_size_p, /* Write a native symbol to a COFF file. */ -static boolean +static bfd_boolean coff_write_native_symbol (abfd, symbol, written, string_size_p, debug_string_section_p, debug_string_size_p) bfd *abfd; @@ -1153,7 +1151,7 @@ coff_write_native_symbol (abfd, symbol, written, string_size_p, #endif count++; } - symbol->done_lineno = true; + symbol->done_lineno = TRUE; if (! bfd_is_const_section (symbol->symbol.section->output_section)) symbol->symbol.section->output_section->moving_line_filepos += @@ -1167,7 +1165,7 @@ coff_write_native_symbol (abfd, symbol, written, string_size_p, /* Write out the COFF symbols. */ -boolean +bfd_boolean coff_write_symbols (abfd) bfd *abfd; { @@ -1203,7 +1201,7 @@ coff_write_symbols (abfd) /* Seek to the right place */ if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0) - return false; + return FALSE; /* Output all the symbols we have */ @@ -1219,14 +1217,14 @@ coff_write_symbols (abfd) if (!coff_write_alien_symbol (abfd, symbol, &written, &string_size, &debug_string_section, &debug_string_size)) - return false; + return FALSE; } else { if (!coff_write_native_symbol (abfd, c_symbol, &written, &string_size, &debug_string_section, &debug_string_size)) - return false; + return FALSE; } } @@ -1246,7 +1244,7 @@ coff_write_symbols (abfd) #endif if (bfd_bwrite ((PTR) buffer, (bfd_size_type) sizeof (buffer), abfd) != sizeof (buffer)) - return false; + return FALSE; /* Handle long section names. This code must handle section names just as they are handled in coff_write_object_contents. */ @@ -1263,7 +1261,7 @@ coff_write_symbols (abfd) { if (bfd_bwrite (o->name, (bfd_size_type) (len + 1), abfd) != len + 1) - return false; + return FALSE; } } } @@ -1304,7 +1302,7 @@ coff_write_symbols (abfd) if (bfd_coff_force_symnames_in_strings (abfd)) { if (bfd_bwrite (".file", (bfd_size_type) 6, abfd) != 6) - return false; + return FALSE; } maxlen = bfd_coff_filnmlen (abfd); } @@ -1315,7 +1313,7 @@ coff_write_symbols (abfd) { if (bfd_bwrite ((PTR) (q->name), (bfd_size_type) name_length + 1, abfd) != name_length + 1) - return false; + return FALSE; } } } @@ -1334,7 +1332,7 @@ coff_write_symbols (abfd) #endif if (bfd_bwrite ((PTR) buffer, (bfd_size_type) STRING_SIZE_SIZE, abfd) != STRING_SIZE_SIZE) - return false; + return FALSE; } /* Make sure the .debug section was created to be the correct size. @@ -1348,10 +1346,10 @@ coff_write_symbols (abfd) 1 << debug_string_section->alignment_power) == bfd_section_size (abfd, debug_string_section)))); - return true; + return TRUE; } -boolean +bfd_boolean coff_write_linenumbers (abfd) bfd *abfd; { @@ -1362,14 +1360,14 @@ coff_write_linenumbers (abfd) linesz = bfd_coff_linesz (abfd); buff = bfd_alloc (abfd, linesz); if (!buff) - return false; + return FALSE; for (s = abfd->sections; s != (asection *) NULL; s = s->next) { if (s->lineno_count) { asymbol **q = abfd->outsymbols; if (bfd_seek (abfd, s->line_filepos, SEEK_SET) != 0) - return false; + return FALSE; /* Find all the linenumbers in this section */ while (*q) { @@ -1389,7 +1387,7 @@ coff_write_linenumbers (abfd) bfd_coff_swap_lineno_out (abfd, &out, buff); if (bfd_bwrite (buff, (bfd_size_type) linesz, abfd) != linesz) - return false; + return FALSE; l++; while (l->line_number) { @@ -1398,7 +1396,7 @@ coff_write_linenumbers (abfd) bfd_coff_swap_lineno_out (abfd, &out, buff); if (bfd_bwrite (buff, (bfd_size_type) linesz, abfd) != linesz) - return false; + return FALSE; l++; } } @@ -1408,7 +1406,7 @@ coff_write_linenumbers (abfd) } } bfd_release (abfd, buff); - return true; + return TRUE; } alent * @@ -1585,7 +1583,7 @@ copy_name (abfd, name, maxlen) /* Read in the external symbols. */ -boolean +bfd_boolean _bfd_coff_get_external_symbols (abfd) bfd *abfd; { @@ -1594,7 +1592,7 @@ _bfd_coff_get_external_symbols (abfd) PTR syms; if (obj_coff_external_syms (abfd) != NULL) - return true; + return TRUE; symesz = bfd_coff_symesz (abfd); @@ -1602,19 +1600,19 @@ _bfd_coff_get_external_symbols (abfd) syms = (PTR) bfd_malloc (size); if (syms == NULL && size != 0) - return false; + return FALSE; if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) != 0 || bfd_bread (syms, size, abfd) != size) { if (syms != NULL) free (syms); - return false; + return FALSE; } obj_coff_external_syms (abfd) = syms; - return true; + return TRUE; } /* Read in the external strings. The strings are not loaded until @@ -1689,7 +1687,7 @@ _bfd_coff_read_string_table (abfd) /* Free up the external symbols and strings read from a COFF file. */ -boolean +bfd_boolean _bfd_coff_free_symbols (abfd) bfd *abfd; { @@ -1705,7 +1703,7 @@ _bfd_coff_free_symbols (abfd) free (obj_coff_strings (abfd)); obj_coff_strings (abfd) = NULL; } - return true; + return TRUE; } /* Read a symbol table into freshly bfd_allocated memory, swap it, and @@ -1777,7 +1775,7 @@ coff_get_normalized_symtab (abfd) } /* Free the raw symbols, but not the strings (if we have them). */ - obj_coff_keep_strings (abfd) = true; + obj_coff_keep_strings (abfd) = TRUE; if (! _bfd_coff_free_symbols (abfd)) return NULL; @@ -1909,7 +1907,7 @@ coff_make_empty_symbol (abfd) new->symbol.section = 0; new->native = 0; new->lineno = (alent *) NULL; - new->done_lineno = false; + new->done_lineno = FALSE; new->symbol.the_bfd = abfd; return &new->symbol; } @@ -1935,7 +1933,7 @@ coff_bfd_make_debug_symbol (abfd, ptr, sz) new->symbol.section = bfd_abs_section_ptr; new->symbol.flags = BSF_DEBUGGING; new->lineno = (alent *) NULL; - new->done_lineno = false; + new->done_lineno = FALSE; new->symbol.the_bfd = abfd; return &new->symbol; } @@ -1957,7 +1955,7 @@ coff_get_symbol_info (abfd, symbol, ret) /* Return the COFF syment for a symbol. */ -boolean +bfd_boolean bfd_coff_get_syment (abfd, symbol, psyment) bfd *abfd; asymbol *symbol; @@ -1969,7 +1967,7 @@ bfd_coff_get_syment (abfd, symbol, psyment) if (csym == NULL || csym->native == NULL) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } *psyment = csym->native->u.syment; @@ -1980,12 +1978,12 @@ bfd_coff_get_syment (abfd, symbol, psyment) /* FIXME: We should handle fix_line here. */ - return true; + return TRUE; } /* Return the COFF auxent for a symbol. */ -boolean +bfd_boolean bfd_coff_get_auxent (abfd, symbol, indx, pauxent) bfd *abfd; asymbol *symbol; @@ -2002,7 +2000,7 @@ bfd_coff_get_auxent (abfd, symbol, indx, pauxent) || indx >= csym->native->u.syment.n_numaux) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } ent = csym->native + indx + 1; @@ -2024,7 +2022,7 @@ bfd_coff_get_auxent (abfd, symbol, indx, pauxent) ((combined_entry_type *) pauxent->x_csect.x_scnlen.p - obj_raw_syments (abfd)); - return true; + return TRUE; } /* Print out information about COFF symbol. */ @@ -2191,19 +2189,19 @@ coff_print_symbol (abfd, filep, symbol, how) function for the is_local_label_name entry point, but some may override it. */ -boolean +bfd_boolean _bfd_coff_is_local_label_name (abfd, name) bfd *abfd ATTRIBUTE_UNUSED; const char *name; { - return (boolean) (name[0] == '.' && name[1] == 'L'); + return name[0] == '.' && name[1] == 'L'; } /* 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. */ -boolean +bfd_boolean coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr, functionname_ptr, line_ptr) bfd *abfd; @@ -2214,7 +2212,7 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr, const char **functionname_ptr; unsigned int *line_ptr; { - boolean found; + bfd_boolean found; unsigned int i; unsigned int line_base; coff_data_type *cof = coff_data (abfd); @@ -2231,17 +2229,17 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr, &found, filename_ptr, functionname_ptr, line_ptr, &coff_data(abfd)->line_info)) - return false; + return FALSE; if (found) - return true; + 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; + return TRUE; *filename_ptr = 0; *functionname_ptr = 0; @@ -2249,15 +2247,15 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr, /* Don't try and find line numbers in a non coff file */ if (!bfd_family_coff (abfd)) - return false; + return FALSE; if (cof == NULL) - return false; + return FALSE; /* Find the first C_FILE symbol. */ p = cof->raw_syments; if (!p) - return false; + return FALSE; pend = p + cof->raw_syment_count; while (p < pend) @@ -2410,13 +2408,13 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr, sec_data->line_base = line_base; } - return true; + return TRUE; } int coff_sizeof_headers (abfd, reloc) bfd *abfd; - boolean reloc; + bfd_boolean reloc; { size_t size; @@ -2434,7 +2432,7 @@ coff_sizeof_headers (abfd, reloc) } /* Change the class of a coff symbol held by BFD. */ -boolean +bfd_boolean bfd_coff_set_symbol_class (abfd, symbol, class) bfd * abfd; asymbol * symbol; @@ -2446,7 +2444,7 @@ bfd_coff_set_symbol_class (abfd, symbol, class) if (csym == NULL) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } else if (csym->native == NULL) { @@ -2460,7 +2458,7 @@ bfd_coff_set_symbol_class (abfd, symbol, class) native = (combined_entry_type *) bfd_zalloc (abfd, amt); if (native == NULL) - return false; + return FALSE; native->u.syment.n_type = T_NULL; native->u.syment.n_sclass = class; @@ -2496,5 +2494,5 @@ bfd_coff_set_symbol_class (abfd, symbol, class) csym->native->u.syment.n_sclass = class; } - return true; + return TRUE; } diff --git a/contrib/binutils/bfd/cofflink.c b/contrib/binutils/bfd/cofflink.c index c1302ee..4ad566c 100644 --- a/contrib/binutils/bfd/cofflink.c +++ b/contrib/binutils/bfd/cofflink.c @@ -1,23 +1,23 @@ /* COFF specific linker code. - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. -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. */ /* This file contains the COFF backend linker code. */ @@ -27,26 +27,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libbfd.h" #include "coff/internal.h" #include "libcoff.h" +#include "safe-ctype.h" -static boolean coff_link_add_object_symbols - PARAMS ((bfd *, struct bfd_link_info *)); -static boolean coff_link_check_archive_element - PARAMS ((bfd *, struct bfd_link_info *, boolean *)); -static boolean coff_link_check_ar_symbols - PARAMS ((bfd *, struct bfd_link_info *, boolean *)); -static boolean coff_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); -static char *dores_com PARAMS ((char *, bfd *, int)); -static char *get_name PARAMS ((char *, char **)); -static int process_embedded_commands - PARAMS ((bfd *, struct bfd_link_info *, bfd *)); -static void mark_relocs PARAMS ((struct coff_final_link_info *, bfd *)); - -/* Return true if SYM is a weak, external symbol. */ +static bfd_boolean coff_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info); +static bfd_boolean coff_link_check_archive_element (bfd *abfd, struct bfd_link_info *info, bfd_boolean *pneeded); +static bfd_boolean coff_link_add_symbols (bfd *abfd, struct bfd_link_info *info); + +/* 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. */ +/* Return TRUE if SYM is an external symbol. */ #define IS_EXTERNAL(abfd, sym) \ ((sym).n_sclass == C_EXT || IS_WEAK_EXTERNAL (abfd, sym)) @@ -63,10 +55,9 @@ static void mark_relocs PARAMS ((struct coff_final_link_info *, bfd *)); /* Create an entry in a COFF linker hash table. */ struct bfd_hash_entry * -_bfd_coff_link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +_bfd_coff_link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { struct coff_link_hash_entry *ret = (struct coff_link_hash_entry *) entry; @@ -98,13 +89,12 @@ _bfd_coff_link_hash_newfunc (entry, table, string) /* Initialize a COFF linker hash table. */ -boolean -_bfd_coff_link_hash_table_init (table, abfd, newfunc) - struct coff_link_hash_table *table; - bfd *abfd; - struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *)); +bfd_boolean +_bfd_coff_link_hash_table_init (struct coff_link_hash_table *table, + bfd *abfd, + struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, + struct bfd_hash_table *, + const char *)) { table->stab_info = NULL; return _bfd_link_hash_table_init (&table->root, abfd, newfunc); @@ -113,15 +103,15 @@ _bfd_coff_link_hash_table_init (table, abfd, newfunc) /* Create a COFF linker hash table. */ struct bfd_link_hash_table * -_bfd_coff_link_hash_table_create (abfd) - bfd *abfd; +_bfd_coff_link_hash_table_create (bfd *abfd) { struct coff_link_hash_table *ret; bfd_size_type amt = sizeof (struct coff_link_hash_table); - ret = (struct coff_link_hash_table *) bfd_malloc (amt); + ret = bfd_malloc (amt); if (ret == NULL) return NULL; + if (! _bfd_coff_link_hash_table_init (ret, abfd, _bfd_coff_link_hash_newfunc)) { @@ -134,10 +124,9 @@ _bfd_coff_link_hash_table_create (abfd) /* Create an entry in a COFF debug merge hash table. */ struct bfd_hash_entry * -_bfd_coff_debug_merge_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +_bfd_coff_debug_merge_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { struct coff_debug_merge_hash_entry *ret = (struct coff_debug_merge_hash_entry *) entry; @@ -166,90 +155,52 @@ _bfd_coff_debug_merge_hash_newfunc (entry, table, string) /* Given a COFF BFD, add symbols to the global hash table as appropriate. */ -boolean -_bfd_coff_link_add_symbols (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +bfd_boolean +_bfd_coff_link_add_symbols (bfd *abfd, struct bfd_link_info *info) { switch (bfd_get_format (abfd)) { case bfd_object: return coff_link_add_object_symbols (abfd, info); case bfd_archive: - return (_bfd_generic_link_add_archive_symbols - (abfd, info, coff_link_check_archive_element)); + return _bfd_generic_link_add_archive_symbols + (abfd, info, coff_link_check_archive_element); default: bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; } } /* Add symbols from a COFF object file. */ -static boolean -coff_link_add_object_symbols (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +static bfd_boolean +coff_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) { if (! _bfd_coff_get_external_symbols (abfd)) - return false; + return FALSE; if (! coff_link_add_symbols (abfd, info)) - return false; - - if (! info->keep_memory) - { - if (! _bfd_coff_free_symbols (abfd)) - return false; - } - return true; -} - -/* Check a single archive element to see if we need to include it in - the link. *PNEEDED is set according to whether this element is - needed in the link or not. This is called via - _bfd_generic_link_add_archive_symbols. */ - -static boolean -coff_link_check_archive_element (abfd, info, pneeded) - bfd *abfd; - struct bfd_link_info *info; - boolean *pneeded; -{ - if (! _bfd_coff_get_external_symbols (abfd)) - return false; + return FALSE; - if (! coff_link_check_ar_symbols (abfd, info, pneeded)) - return false; - - if (*pneeded) - { - if (! coff_link_add_symbols (abfd, info)) - return false; - } - - if (! info->keep_memory || ! *pneeded) - { - if (! _bfd_coff_free_symbols (abfd)) - return false; - } + if (! info->keep_memory + && ! _bfd_coff_free_symbols (abfd)) + return FALSE; - return true; + return TRUE; } /* Look through the symbols to see if this object file should be included in the link. */ -static boolean -coff_link_check_ar_symbols (abfd, info, pneeded) - bfd *abfd; - struct bfd_link_info *info; - boolean *pneeded; +static bfd_boolean +coff_link_check_ar_symbols (bfd *abfd, + struct bfd_link_info *info, + bfd_boolean *pneeded) { bfd_size_type symesz; bfd_byte *esym; bfd_byte *esym_end; - *pneeded = false; + *pneeded = FALSE; symesz = bfd_coff_symesz (abfd); esym = (bfd_byte *) obj_coff_external_syms (abfd); @@ -259,7 +210,7 @@ coff_link_check_ar_symbols (abfd, info, pneeded) struct internal_syment sym; enum coff_symbol_classification classification; - bfd_coff_swap_sym_in (abfd, (PTR) esym, (PTR) &sym); + bfd_coff_swap_sym_in (abfd, esym, &sym); classification = bfd_coff_classify_symbol (abfd, &sym); if (classification == COFF_SYMBOL_GLOBAL @@ -271,22 +222,17 @@ coff_link_check_ar_symbols (abfd, info, pneeded) /* This symbol is externally visible, and is defined by this object file. */ - name = _bfd_coff_internal_syment_name (abfd, &sym, buf); if (name == NULL) - return false; - h = bfd_link_hash_lookup (info->hash, name, false, false, true); + return FALSE; + h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE); + + /* Auto import. */ + if (!h + && info->pei386_auto_import + && !strncmp (name,"__imp_", 6)) + h = bfd_link_hash_lookup (info->hash, name + 6, FALSE, FALSE, TRUE); - /* auto import */ - if (!h && info->pei386_auto_import) - { - if (!strncmp (name,"__imp_", 6)) - { - h = - bfd_link_hash_lookup (info->hash, name + 6, false, false, - true); - } - } /* We are only interested in symbols that are currently undefined. If a symbol is currently known to be common, COFF linkers do not bring in an object file which defines @@ -295,9 +241,9 @@ coff_link_check_ar_symbols (abfd, info, pneeded) && h->type == bfd_link_hash_undefined) { if (! (*info->callbacks->add_archive_element) (info, abfd, name)) - return false; - *pneeded = true; - return true; + return FALSE; + *pneeded = TRUE; + return TRUE; } } @@ -305,21 +251,47 @@ coff_link_check_ar_symbols (abfd, info, pneeded) } /* We do not need this object file. */ - return true; + return TRUE; +} + +/* Check a single archive element to see if we need to include it in + the link. *PNEEDED is set according to whether this element is + needed in the link or not. This is called via + _bfd_generic_link_add_archive_symbols. */ + +static bfd_boolean +coff_link_check_archive_element (bfd *abfd, + struct bfd_link_info *info, + bfd_boolean *pneeded) +{ + if (! _bfd_coff_get_external_symbols (abfd)) + return FALSE; + + if (! coff_link_check_ar_symbols (abfd, info, pneeded)) + return FALSE; + + if (*pneeded + && ! coff_link_add_symbols (abfd, info)) + return FALSE; + + if ((! info->keep_memory || ! *pneeded) + && ! _bfd_coff_free_symbols (abfd)) + return FALSE; + + return TRUE; } /* Add all the symbols from an object file to the hash table. */ -static boolean -coff_link_add_symbols (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +static bfd_boolean +coff_link_add_symbols (bfd *abfd, + struct bfd_link_info *info) { unsigned int n_tmask = coff_data (abfd)->local_n_tmask; unsigned int n_btshft = coff_data (abfd)->local_n_btshft; unsigned int n_btmask = coff_data (abfd)->local_n_btmask; - boolean keep_syms; - boolean default_copy; + bfd_boolean keep_syms; + bfd_boolean default_copy; bfd_size_type symcount; struct coff_link_hash_entry **sym_hash; bfd_size_type symesz; @@ -330,19 +302,19 @@ coff_link_add_symbols (abfd, info) /* Keep the symbols during this function, in case the linker needs to read the generic symbols in order to report an error message. */ keep_syms = obj_coff_keep_syms (abfd); - obj_coff_keep_syms (abfd) = true; + obj_coff_keep_syms (abfd) = TRUE; if (info->keep_memory) - default_copy = false; + default_copy = FALSE; else - default_copy = true; + default_copy = TRUE; symcount = obj_raw_syment_count (abfd); /* We keep a list of the linker hash table entries that correspond to particular symbols. */ amt = symcount * sizeof (struct coff_link_hash_entry *); - sym_hash = (struct coff_link_hash_entry **) bfd_zalloc (abfd, amt); + sym_hash = bfd_zalloc (abfd, amt); if (sym_hash == NULL && symcount != 0) goto error_return; obj_coff_sym_hashes (abfd) = sym_hash; @@ -355,9 +327,9 @@ coff_link_add_symbols (abfd, info) { struct internal_syment sym; enum coff_symbol_classification classification; - boolean copy; + bfd_boolean copy; - bfd_coff_swap_sym_in (abfd, (PTR) esym, (PTR) &sym); + bfd_coff_swap_sym_in (abfd, esym, &sym); classification = bfd_coff_classify_symbol (abfd, &sym); if (classification != COFF_SYMBOL_LOCAL) @@ -367,7 +339,7 @@ coff_link_add_symbols (abfd, info) flagword flags; asection *section; bfd_vma value; - boolean addit; + bfd_boolean addit; /* This symbol is externally visible. */ @@ -380,7 +352,7 @@ coff_link_add_symbols (abfd, info) copy = default_copy; if (sym._n._n_n._n_zeroes != 0 || sym._n._n_n._n_offset == 0) - copy = true; + copy = TRUE; value = sym.n_value; @@ -415,7 +387,7 @@ coff_link_add_symbols (abfd, info) if (IS_WEAK_EXTERNAL (abfd, sym)) flags = BSF_WEAK; - addit = true; + addit = TRUE; /* In the PE format, section symbols actually refer to the start of the output section. We handle them specially @@ -423,7 +395,7 @@ coff_link_add_symbols (abfd, info) if (obj_pe (abfd) && (flags & BSF_SECTION_SYM) != 0) { *sym_hash = coff_link_hash_lookup (coff_hash_table (info), - name, false, copy, false); + name, FALSE, copy, FALSE); if (*sym_hash != NULL) { if (((*sym_hash)->coff_link_hash_flags @@ -434,7 +406,7 @@ coff_link_add_symbols (abfd, info) ("Warning: symbol `%s' is both section and non-section", name); - addit = false; + addit = FALSE; } } @@ -469,20 +441,20 @@ coff_link_add_symbols (abfd, info) { if (*sym_hash == NULL) *sym_hash = coff_link_hash_lookup (coff_hash_table (info), - name, false, copy, false); + name, FALSE, copy, FALSE); if (*sym_hash != NULL && (*sym_hash)->root.type == bfd_link_hash_defined && (*sym_hash)->root.u.def.section->comdat != NULL && strcmp ((*sym_hash)->root.u.def.section->comdat->name, section->comdat->name) == 0) - addit = false; + addit = FALSE; } if (addit) { if (! (bfd_coff_link_add_one_symbol (info, abfd, name, flags, section, value, - (const char *) NULL, copy, false, + (const char *) NULL, copy, FALSE, (struct bfd_link_hash_entry **) sym_hash))) goto error_return; } @@ -560,9 +532,9 @@ coff_link_add_symbols (abfd, info) for (i = 0, eaux = esym + symesz, iaux = alloc; i < sym.n_numaux; i++, eaux += symesz, iaux++) - bfd_coff_swap_aux_in (abfd, (PTR) eaux, sym.n_type, + bfd_coff_swap_aux_in (abfd, eaux, sym.n_type, sym.n_sclass, (int) i, - sym.n_numaux, (PTR) iaux); + sym.n_numaux, iaux); (*sym_hash)->aux = alloc; } } @@ -578,7 +550,6 @@ coff_link_add_symbols (abfd, info) FIXME: This is not at all the right place to do this. For example, it won't help objdump. This needs to be done when we swap in the section header. */ - BFD_ASSERT ((*sym_hash)->numaux == 1); if (section->_raw_size == 0) section->_raw_size = (*sym_hash)->aux[0].x_scn.x_scnlen; @@ -593,30 +564,35 @@ coff_link_add_symbols (abfd, info) sym_hash += sym.n_numaux + 1; } - /* If this is a non-traditional, non-relocateable link, try to + /* If this is a non-traditional, non-relocatable link, try to optimize the handling of any .stab/.stabstr sections. */ - if (! info->relocateable + if (! info->relocatable && ! info->traditional_format && info->hash->creator->flavour == bfd_get_flavour (abfd) && (info->strip != strip_all && info->strip != strip_debugger)) { - asection *stab, *stabstr; + asection *stabstr; - stab = bfd_get_section_by_name (abfd, ".stab"); - if (stab != NULL) - { - stabstr = bfd_get_section_by_name (abfd, ".stabstr"); + stabstr = bfd_get_section_by_name (abfd, ".stabstr"); - if (stabstr != NULL) + if (stabstr != NULL) + { + bfd_size_type string_offset = 0; + asection *stab; + + for (stab = abfd->sections; stab; stab = stab->next) + if (strncmp (".stab", stab->name, 5) == 0 + && (!stab->name[5] + || (stab->name[5] == '.' && ISDIGIT (stab->name[6])))) { struct coff_link_hash_table *table; - struct coff_section_tdata *secdata; - - secdata = coff_section_data (abfd, stab); + struct coff_section_tdata *secdata + = coff_section_data (abfd, stab); + if (secdata == NULL) { amt = sizeof (struct coff_section_tdata); - stab->used_by_bfd = (PTR) bfd_zalloc (abfd, amt); + stab->used_by_bfd = bfd_zalloc (abfd, amt); if (stab->used_by_bfd == NULL) goto error_return; secdata = coff_section_data (abfd, stab); @@ -626,7 +602,8 @@ coff_link_add_symbols (abfd, info) if (! _bfd_link_section_stabs (abfd, &table->stab_info, stab, stabstr, - &secdata->stab_info)) + &secdata->stab_info, + &string_offset)) goto error_return; } } @@ -634,24 +611,23 @@ coff_link_add_symbols (abfd, info) obj_coff_keep_syms (abfd) = keep_syms; - return true; + return TRUE; error_return: obj_coff_keep_syms (abfd) = keep_syms; - return false; + return FALSE; } /* Do the final link step. */ -boolean -_bfd_coff_final_link (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +bfd_boolean +_bfd_coff_final_link (bfd *abfd, + struct bfd_link_info *info) { bfd_size_type symesz; struct coff_final_link_info finfo; - boolean debug_merge_allocated; - boolean long_section_names; + bfd_boolean debug_merge_allocated; + bfd_boolean long_section_names; asection *o; struct bfd_link_order *p; bfd_size_type max_sym_count; @@ -684,8 +660,8 @@ _bfd_coff_final_link (abfd, info) finfo.contents = NULL; finfo.external_relocs = NULL; finfo.internal_relocs = NULL; - finfo.global_to_static = false; - debug_merge_allocated = false; + finfo.global_to_static = FALSE; + debug_merge_allocated = FALSE; coff_data (abfd)->link_info = info; @@ -695,7 +671,7 @@ _bfd_coff_final_link (abfd, info) if (! coff_debug_merge_hash_table_init (&finfo.debug_merge)) goto error_return; - debug_merge_allocated = true; + debug_merge_allocated = TRUE; /* Compute the file positions for all the sections. */ if (! abfd->output_has_begun) @@ -712,7 +688,7 @@ _bfd_coff_final_link (abfd, info) max_lineno_count = 0; max_reloc_count = 0; - long_section_names = false; + long_section_names = FALSE; for (o = abfd->sections; o != NULL; o = o->next) { o->reloc_count = 0; @@ -729,13 +705,13 @@ _bfd_coff_final_link (abfd, info) link. This will normally be every section. We need to do this so that we can identify any sections which the linker has decided to not include. */ - sec->linker_mark = true; + sec->linker_mark = TRUE; if (info->strip == strip_none || info->strip == strip_some) o->lineno_count += sec->lineno_count; - if (info->relocateable) + if (info->relocatable) o->reloc_count += sec->reloc_count; if (sec->_raw_size > max_contents_size) @@ -745,7 +721,7 @@ _bfd_coff_final_link (abfd, info) if (sec->reloc_count > max_reloc_count) max_reloc_count = sec->reloc_count; } - else if (info->relocateable + else if (info->relocatable && (p->type == bfd_section_reloc_link_order || p->type == bfd_symbol_reloc_link_order)) ++o->reloc_count; @@ -770,17 +746,17 @@ _bfd_coff_final_link (abfd, info) table. This must correspond to the code in coff_write_object_contents which puts the string index into the s_name field of the section header. That is why - we pass hash as false. */ - if (_bfd_stringtab_add (finfo.strtab, o->name, false, false) + we pass hash as FALSE. */ + if (_bfd_stringtab_add (finfo.strtab, o->name, FALSE, FALSE) == (bfd_size_type) -1) goto error_return; - long_section_names = true; + long_section_names = TRUE; } } - /* If doing a relocateable link, allocate space for the pointers we + /* If doing a relocatable link, allocate space for the pointers we need to keep. */ - if (info->relocateable) + if (info->relocatable) { unsigned int i; @@ -788,7 +764,7 @@ _bfd_coff_final_link (abfd, info) the target_index fields are 1 based. */ amt = abfd->section_count + 1; amt *= sizeof (struct coff_link_section_info); - finfo.section_info = (struct coff_link_section_info *) bfd_malloc (amt); + finfo.section_info = bfd_malloc (amt); if (finfo.section_info == NULL) goto error_return; for (i = 0; i <= abfd->section_count; i++) @@ -826,17 +802,15 @@ _bfd_coff_final_link (abfd, info) Because of this problem, we also keep the relocs in memory until the end of the link. This wastes memory, - but only when doing a relocateable link, which is not the + but only when doing a relocatable link, which is not the common case. */ - BFD_ASSERT (info->relocateable); + BFD_ASSERT (info->relocatable); amt = o->reloc_count; amt *= sizeof (struct internal_reloc); - finfo.section_info[o->target_index].relocs = - (struct internal_reloc *) bfd_malloc (amt); + finfo.section_info[o->target_index].relocs = bfd_malloc (amt); amt = o->reloc_count; amt *= sizeof (struct coff_link_hash_entry *); - finfo.section_info[o->target_index].rel_hashes = - (struct coff_link_hash_entry **) bfd_malloc (amt); + finfo.section_info[o->target_index].rel_hashes = bfd_malloc (amt); if (finfo.section_info[o->target_index].relocs == NULL || finfo.section_info[o->target_index].rel_hashes == NULL) goto error_return; @@ -861,7 +835,7 @@ _bfd_coff_final_link (abfd, info) { size_t sz; - sub->output_has_begun = false; + sub->output_has_begun = FALSE; sz = obj_raw_syment_count (sub); if (sz > max_sym_count) max_sym_count = sz; @@ -869,21 +843,21 @@ _bfd_coff_final_link (abfd, info) /* Allocate some buffers used while linking. */ amt = max_sym_count * sizeof (struct internal_syment); - finfo.internal_syms = (struct internal_syment *) bfd_malloc (amt); + finfo.internal_syms = bfd_malloc (amt); amt = max_sym_count * sizeof (asection *); - finfo.sec_ptrs = (asection **) bfd_malloc (amt); + finfo.sec_ptrs = bfd_malloc (amt); amt = max_sym_count * sizeof (long); - finfo.sym_indices = (long *) bfd_malloc (amt); - finfo.outsyms = (bfd_byte *) bfd_malloc ((max_sym_count + 1) * symesz); + finfo.sym_indices = bfd_malloc (amt); + finfo.outsyms = bfd_malloc ((max_sym_count + 1) * symesz); amt = max_lineno_count * bfd_coff_linesz (abfd); - finfo.linenos = (bfd_byte *) bfd_malloc (amt); - finfo.contents = (bfd_byte *) bfd_malloc (max_contents_size); + finfo.linenos = bfd_malloc (amt); + finfo.contents = bfd_malloc (max_contents_size); amt = max_reloc_count * relsz; - finfo.external_relocs = (bfd_byte *) bfd_malloc (amt); - if (! info->relocateable) + finfo.external_relocs = bfd_malloc (amt); + if (! info->relocatable) { amt = max_reloc_count * sizeof (struct internal_reloc); - finfo.internal_relocs = (struct internal_reloc *) bfd_malloc (amt); + finfo.internal_relocs = bfd_malloc (amt); } if ((finfo.internal_syms == NULL && max_sym_count > 0) || (finfo.sec_ptrs == NULL && max_sym_count > 0) @@ -892,7 +866,7 @@ _bfd_coff_final_link (abfd, info) || (finfo.linenos == NULL && max_lineno_count > 0) || (finfo.contents == NULL && max_contents_size > 0) || (finfo.external_relocs == NULL && max_reloc_count > 0) - || (! info->relocateable + || (! info->relocatable && finfo.internal_relocs == NULL && max_reloc_count > 0)) goto error_return; @@ -922,7 +896,7 @@ _bfd_coff_final_link (abfd, info) { if (! _bfd_coff_link_input_bfd (&finfo, sub)) goto error_return; - sub->output_has_begun = true; + sub->output_has_begun = TRUE; } } else if (p->type == bfd_section_reloc_link_order @@ -945,7 +919,7 @@ _bfd_coff_final_link (abfd, info) /* Free up the buffers used by _bfd_coff_link_input_bfd. */ coff_debug_merge_hash_table_free (&finfo.debug_merge); - debug_merge_allocated = false; + debug_merge_allocated = FALSE; if (finfo.internal_syms != NULL) { @@ -992,13 +966,13 @@ _bfd_coff_final_link (abfd, info) file_ptr pos; finfo.last_file.n_value = obj_raw_syment_count (abfd); - bfd_coff_swap_sym_out (abfd, (PTR) &finfo.last_file, - (PTR) finfo.outsyms); + bfd_coff_swap_sym_out (abfd, &finfo.last_file, + finfo.outsyms); pos = obj_sym_filepos (abfd) + finfo.last_file_index * symesz; if (bfd_seek (abfd, pos, SEEK_SET) != 0 || bfd_bwrite (finfo.outsyms, symesz, abfd) != symesz) - return false; + return FALSE; } /* If doing task linking (ld --task-link) then make a pass through the @@ -1006,19 +980,17 @@ _bfd_coff_final_link (abfd, info) static. */ if (info->task_link) { - finfo.failed = false; + finfo.failed = FALSE; coff_link_hash_traverse (coff_hash_table (info), - _bfd_coff_write_task_globals, - (PTR) &finfo); + _bfd_coff_write_task_globals, &finfo); if (finfo.failed) goto error_return; } /* Write out the global symbols. */ - finfo.failed = false; + finfo.failed = FALSE; coff_link_hash_traverse (coff_hash_table (info), - _bfd_coff_write_global_sym, - (PTR) &finfo); + _bfd_coff_write_global_sym, &finfo); if (finfo.failed) goto error_return; @@ -1029,13 +1001,13 @@ _bfd_coff_final_link (abfd, info) finfo.outsyms = NULL; } - if (info->relocateable && max_output_reloc_count > 0) + if (info->relocatable && max_output_reloc_count > 0) { /* Now that we have written out all the global symbols, we know the symbol indices to use for relocs against them, and we can finally write out the relocs. */ amt = max_output_reloc_count * relsz; - external_relocs = (bfd_byte *) bfd_malloc (amt); + external_relocs = bfd_malloc (amt); if (external_relocs == NULL) goto error_return; @@ -1060,13 +1032,30 @@ _bfd_coff_final_link (abfd, info) BFD_ASSERT ((*rel_hash)->indx >= 0); irel->r_symndx = (*rel_hash)->indx; } - bfd_coff_swap_reloc_out (abfd, (PTR) irel, (PTR) erel); + bfd_coff_swap_reloc_out (abfd, irel, erel); } - if (bfd_seek (abfd, o->rel_filepos, SEEK_SET) != 0 - || (bfd_bwrite ((PTR) external_relocs, - (bfd_size_type) relsz * o->reloc_count, abfd) - != (bfd_size_type) relsz * o->reloc_count)) + if (bfd_seek (abfd, o->rel_filepos, SEEK_SET) != 0) + goto error_return; + if (obj_pe (abfd) && o->reloc_count >= 0xffff) + { + /* In PE COFF, write the count of relocs as the first + reloc. The header overflow bit will be set + elsewhere. */ + struct internal_reloc incount; + bfd_byte *excount = (bfd_byte *)bfd_malloc (relsz); + + memset (&incount, 0, sizeof (incount)); + incount.r_vaddr = o->reloc_count + 1; + bfd_coff_swap_reloc_out (abfd, (PTR) &incount, (PTR) excount); + if (bfd_bwrite (excount, relsz, abfd) != relsz) + /* We'll leak, but it's an error anyway. */ + goto error_return; + free (excount); + } + if (bfd_bwrite (external_relocs, + (bfd_size_type) relsz * o->reloc_count, abfd) + != (bfd_size_type) relsz * o->reloc_count) goto error_return; } @@ -1094,7 +1083,7 @@ _bfd_coff_final_link (abfd, info) if (coff_hash_table (info)->stab_info != NULL) { if (! _bfd_write_stab_strings (abfd, &coff_hash_table (info)->stab_info)) - return false; + return FALSE; } /* Write out the string table. */ @@ -1104,7 +1093,7 @@ _bfd_coff_final_link (abfd, info) pos = obj_sym_filepos (abfd) + obj_raw_syment_count (abfd) * symesz; if (bfd_seek (abfd, pos, SEEK_SET) != 0) - return false; + return FALSE; #if STRING_SIZE_SIZE == 4 H_PUT_32 (abfd, @@ -1116,12 +1105,12 @@ _bfd_coff_final_link (abfd, info) if (bfd_bwrite (strbuf, (bfd_size_type) STRING_SIZE_SIZE, abfd) != STRING_SIZE_SIZE) - return false; + return FALSE; if (! _bfd_stringtab_emit (abfd, finfo.strtab)) - return false; + return FALSE; - obj_coff_strings_written (abfd) = true; + obj_coff_strings_written (abfd) = TRUE; } _bfd_stringtab_free (finfo.strtab); @@ -1130,7 +1119,7 @@ _bfd_coff_final_link (abfd, info) not try to write out the symbols. */ bfd_get_symcount (abfd) = 0; - return true; + return TRUE; error_return: if (debug_merge_allocated) @@ -1168,20 +1157,18 @@ _bfd_coff_final_link (abfd, info) free (finfo.internal_relocs); if (external_relocs != NULL) free (external_relocs); - return false; + return FALSE; } -/* parse out a -heap , line */ +/* Parse out a -heap , line. */ static char * -dores_com (ptr, output_bfd, heap) - char *ptr; - bfd *output_bfd; - int heap; +dores_com (char *ptr, bfd *output_bfd, int heap) { if (coff_data(output_bfd)->pe) { int val = strtoul (ptr, &ptr, 0); + if (heap) pe_data(output_bfd)->pe_opthdr.SizeOfHeapReserve = val; else @@ -1199,9 +1186,8 @@ dores_com (ptr, output_bfd, heap) return ptr; } -static char *get_name(ptr, dst) -char *ptr; -char **dst; +static char * +get_name (char *ptr, char **dst) { while (*ptr == ' ') ptr++; @@ -1212,85 +1198,89 @@ char **dst; return ptr+1; } -/* Process any magic embedded commands in a section called .drectve */ +/* Process any magic embedded commands in a section called .drectve. */ static int -process_embedded_commands (output_bfd, info, abfd) - bfd *output_bfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - bfd *abfd; +process_embedded_commands (bfd *output_bfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + bfd *abfd) { asection *sec = bfd_get_section_by_name (abfd, ".drectve"); char *s; char *e; char *copy; + if (!sec) return 1; copy = bfd_malloc (sec->_raw_size); if (!copy) return 0; - if (! bfd_get_section_contents(abfd, sec, copy, (bfd_vma) 0, sec->_raw_size)) + + if (! bfd_get_section_contents (abfd, sec, copy, (bfd_vma) 0, sec->_raw_size)) { free (copy); return 0; } e = copy + sec->_raw_size; + for (s = copy; s < e ; ) { - if (s[0]!= '-') { - s++; - continue; - } + if (s[0]!= '-') + { + s++; + continue; + } if (strncmp (s,"-attr", 5) == 0) { char *name; char *attribs; asection *asec; - int loop = 1; int had_write = 0; int had_read = 0; int had_exec= 0; int had_shared= 0; + s += 5; - s = get_name(s, &name); - s = get_name(s, &attribs); - while (loop) { - switch (*attribs++) - { - case 'W': - had_write = 1; - break; - case 'R': - had_read = 1; - break; - case 'S': - had_shared = 1; - break; - case 'X': - had_exec = 1; - break; - default: - loop = 0; - } - } + s = get_name (s, &name); + s = get_name (s, &attribs); + + while (loop) + { + switch (*attribs++) + { + case 'W': + had_write = 1; + break; + case 'R': + had_read = 1; + break; + case 'S': + had_shared = 1; + break; + case 'X': + had_exec = 1; + break; + default: + loop = 0; + } + } asec = bfd_get_section_by_name (abfd, name); - if (asec) { - if (had_exec) - asec->flags |= SEC_CODE; - if (!had_write) - asec->flags |= SEC_READONLY; - } + if (asec) + { + if (had_exec) + asec->flags |= SEC_CODE; + if (!had_write) + asec->flags |= SEC_READONLY; + } } else if (strncmp (s,"-heap", 5) == 0) - { - s = dores_com (s+5, output_bfd, 1); - } + s = dores_com (s+5, output_bfd, 1); + else if (strncmp (s,"-stack", 6) == 0) - { - s = dores_com (s+6, output_bfd, 0); - } + s = dores_com (s+6, output_bfd, 0); + else s++; } @@ -1301,13 +1291,10 @@ 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 -mark_relocs (finfo, input_bfd) - struct coff_final_link_info * finfo; - bfd * input_bfd; +mark_relocs (struct coff_final_link_info *finfo, bfd *input_bfd) { asection * a; @@ -1328,10 +1315,10 @@ mark_relocs (finfo, input_bfd) /* Read in the relocs. */ internal_relocs = _bfd_coff_read_internal_relocs - (input_bfd, a, false, + (input_bfd, a, FALSE, finfo->external_relocs, - finfo->info->relocateable, - (finfo->info->relocateable + finfo->info->relocatable, + (finfo->info->relocatable ? (finfo->section_info[ a->output_section->target_index ].relocs + a->output_section->reloc_count) : finfo->internal_relocs) ); @@ -1345,35 +1332,30 @@ mark_relocs (finfo, input_bfd) /* Place a mark in the sym_indices array (whose entries have been initialised to 0) for all of the symbols that are used in the relocation table. This will then be picked up in the - skip/don't pass */ - + skip/don't-skip pass. */ for (; irel < irelend; irel++) - { - finfo->sym_indices[ irel->r_symndx ] = -1; - } + finfo->sym_indices[ irel->r_symndx ] = -1; } } /* Link an input file into the linker output file. This function handles all the sections and relocations of the input file at once. */ -boolean -_bfd_coff_link_input_bfd (finfo, input_bfd) - struct coff_final_link_info *finfo; - bfd *input_bfd; +bfd_boolean +_bfd_coff_link_input_bfd (struct coff_final_link_info *finfo, bfd *input_bfd) { unsigned int n_tmask = coff_data (input_bfd)->local_n_tmask; unsigned int n_btshft = coff_data (input_bfd)->local_n_btshft; #if 0 unsigned int n_btmask = coff_data (input_bfd)->local_n_btmask; #endif - boolean (*adjust_symndx) PARAMS ((bfd *, struct bfd_link_info *, bfd *, - asection *, struct internal_reloc *, - boolean *)); + bfd_boolean (*adjust_symndx) + (bfd *, struct bfd_link_info *, bfd *, asection *, + struct internal_reloc *, bfd_boolean *); bfd *output_bfd; const char *strings; bfd_size_type syment_base; - boolean copy, hash; + bfd_boolean copy, hash; bfd_size_type isymesz; bfd_size_type osymesz; bfd_size_type linesz; @@ -1397,15 +1379,15 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) linesz = bfd_coff_linesz (input_bfd); BFD_ASSERT (linesz == bfd_coff_linesz (output_bfd)); - copy = false; + copy = FALSE; if (! finfo->info->keep_memory) - copy = true; - hash = true; + copy = TRUE; + hash = TRUE; if ((output_bfd->flags & BFD_TRADITIONAL_FORMAT) != 0) - hash = false; + hash = FALSE; if (! _bfd_coff_get_external_symbols (input_bfd)) - return false; + return FALSE; esym = (bfd_byte *) obj_coff_external_syms (input_bfd); esym_end = esym + obj_raw_syment_count (input_bfd) * isymesz; @@ -1415,20 +1397,18 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) output_index = syment_base; outsym = finfo->outsyms; - if (coff_data (output_bfd)->pe) - { - if (! process_embedded_commands (output_bfd, finfo->info, input_bfd)) - return false; - } + if (coff_data (output_bfd)->pe + && ! process_embedded_commands (output_bfd, finfo->info, input_bfd)) + return FALSE; - /* If we are going to perform relocations and also strip/discard some symbols - then we must make sure that we do not strip/discard those symbols that are - going to be involved in the relocations */ + /* If we are going to perform relocations and also strip/discard some + symbols then we must make sure that we do not strip/discard those + symbols that are going to be involved in the relocations. */ if (( finfo->info->strip != strip_none || finfo->info->discard != discard_none) - && finfo->info->relocateable) + && finfo->info->relocatable) { - /* mark the symbol array as 'not-used' */ + /* Mark the symbol array as 'not-used'. */ memset (indexp, 0, obj_raw_syment_count (input_bfd) * sizeof * indexp); mark_relocs (finfo, input_bfd); @@ -1438,12 +1418,12 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) { struct internal_syment isym; enum coff_symbol_classification classification; - boolean skip; - boolean global; - boolean dont_skip_symbol; + bfd_boolean skip; + bfd_boolean global; + bfd_boolean dont_skip_symbol; int add; - bfd_coff_swap_sym_in (input_bfd, (PTR) esym, (PTR) isymp); + bfd_coff_swap_sym_in (input_bfd, esym, isymp); /* Make a copy of *isymp so that the relocate_section function always sees the original values. This is more reliable than @@ -1473,20 +1453,20 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) relocation. */ if ((finfo->info->strip != strip_none || finfo->info->discard != discard_none) - && finfo->info->relocateable) + && finfo->info->relocatable) dont_skip_symbol = *indexp; else - dont_skip_symbol = false; + dont_skip_symbol = FALSE; *indexp = -1; - skip = false; - global = false; + skip = FALSE; + global = FALSE; add = 1 + isym.n_numaux; /* If we are stripping all symbols, we want to skip this one. */ if (finfo->info->strip == strip_all && ! dont_skip_symbol) - skip = true; + skip = TRUE; if (! skip) { @@ -1501,22 +1481,22 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) end of the symbol table, so skip them for now. Locally defined function symbols, however, are an exception, and are not moved to the end. */ - global = true; + global = TRUE; if (! ISFCN (isym.n_type)) - skip = true; + skip = TRUE; break; case COFF_SYMBOL_UNDEFINED: /* Undefined symbols are left for the end. */ - global = true; - skip = true; + global = TRUE; + skip = TRUE; break; case COFF_SYMBOL_LOCAL: /* This is a local symbol. Skip it if we are discarding local symbols. */ if (finfo->info->discard == discard_all && ! dont_skip_symbol) - skip = true; + skip = TRUE; break; } } @@ -1525,13 +1505,12 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) /* Skip section symbols for sections which are not going to be emitted. */ if (!skip + && dont_skip_symbol == 0 && isym.n_sclass == C_STAT && isym.n_type == T_NULL - && isym.n_numaux > 0) - { - if ((*secpp)->output_section == bfd_abs_section_ptr) - skip = true; - } + && isym.n_numaux > 0 + && (*secpp)->output_section == bfd_abs_section_ptr) + skip = TRUE; #endif /* If we stripping debugging symbols, and this is a debugging @@ -1552,7 +1531,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) || isym.n_sclass == C_REGPARM || isym.n_sclass == C_FIELD || isym.n_sclass == C_EOS)))) - skip = true; + skip = TRUE; /* If some symbols are stripped based on the name, work out the name and decide whether to skip this symbol. */ @@ -1565,16 +1544,16 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) name = _bfd_coff_internal_syment_name (input_bfd, &isym, buf); if (name == NULL) - return false; + return FALSE; if (! dont_skip_symbol && ((finfo->info->strip == strip_some - && (bfd_hash_lookup (finfo->info->keep_hash, name, false, - false) == NULL)) + && (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE, + FALSE) == NULL)) || (! global && finfo->info->discard == discard_l && bfd_is_local_label_name (input_bfd, name)))) - skip = true; + skip = TRUE; } /* If this is an enum, struct, or union tag, see if we have @@ -1598,7 +1577,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) name = _bfd_coff_internal_syment_name (input_bfd, &isym, buf); if (name == NULL) - return false; + return FALSE; /* Ignore fake names invented by compiler; treat them all as the same name. */ @@ -1608,24 +1587,24 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) name = ""; mh = coff_debug_merge_hash_lookup (&finfo->debug_merge, name, - true, true); + TRUE, TRUE); if (mh == NULL) - return false; + return FALSE; /* Allocate memory to hold type information. If this turns out to be a duplicate, we pass this address to bfd_release. */ amt = sizeof (struct coff_debug_merge_type); - mt = (struct coff_debug_merge_type *) bfd_alloc (input_bfd, amt); + mt = bfd_alloc (input_bfd, amt); if (mt == NULL) - return false; + return FALSE; mt->class = isym.n_sclass; /* Pick up the aux entry, which points to the end of the tag entries. */ - bfd_coff_swap_aux_in (input_bfd, (PTR) (esym + isymesz), + bfd_coff_swap_aux_in (input_bfd, (esym + isymesz), isym.n_type, isym.n_sclass, 0, isym.n_numaux, - (PTR) &aux); + &aux); /* Gather the elements. */ epp = &mt->elements; @@ -1640,23 +1619,22 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) char elebuf[SYMNMLEN + 1]; char *name_copy; - bfd_coff_swap_sym_in (input_bfd, (PTR) esl, (PTR) islp); + bfd_coff_swap_sym_in (input_bfd, esl, islp); amt = sizeof (struct coff_debug_merge_element); - *epp = ((struct coff_debug_merge_element *) - bfd_alloc (input_bfd, amt)); + *epp = bfd_alloc (input_bfd, amt); if (*epp == NULL) - return false; + return FALSE; elename = _bfd_coff_internal_syment_name (input_bfd, islp, elebuf); if (elename == NULL) - return false; + return FALSE; amt = strlen (elename) + 1; - name_copy = (char *) bfd_alloc (input_bfd, amt); + name_copy = bfd_alloc (input_bfd, amt); if (name_copy == NULL) - return false; + return FALSE; strcpy (name_copy, elename); (*epp)->name = name_copy; @@ -1669,16 +1647,15 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) union internal_auxent eleaux; long indx; - bfd_coff_swap_aux_in (input_bfd, (PTR) (esl + isymesz), + bfd_coff_swap_aux_in (input_bfd, (esl + isymesz), islp->n_type, islp->n_sclass, 0, - islp->n_numaux, (PTR) &eleaux); + islp->n_numaux, &eleaux); indx = eleaux.x_sym.x_tagndx.l; /* FIXME: If this tagndx entry refers to a symbol defined later in this file, we just ignore it. Handling this correctly would be tedious, and may not be required. */ - if (indx > 0 && (indx < ((esym - @@ -1701,7 +1678,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) type. We always output the type if it has no elements, for simplicity. */ if (mt->elements == NULL) - bfd_release (input_bfd, (PTR) mt); + bfd_release (input_bfd, mt); else { struct coff_debug_merge_type *mtl; @@ -1737,10 +1714,10 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) else { /* This is a redefinition which can be merged. */ - bfd_release (input_bfd, (PTR) mt); + bfd_release (input_bfd, mt); *indexp = mtl->indx; add = (eslend - esym) / isymesz; - skip = true; + skip = TRUE; } } } @@ -1761,13 +1738,12 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) bfd_coff_symname_in_debug. That is only true for XCOFF, and XCOFF requires different linking code anyhow. */ - name = _bfd_coff_internal_syment_name (input_bfd, &isym, - (char *) NULL); + name = _bfd_coff_internal_syment_name (input_bfd, &isym, NULL); if (name == NULL) - return false; + return FALSE; indx = _bfd_stringtab_add (finfo->strtab, name, hash, copy); if (indx == (bfd_size_type) -1) - return false; + return FALSE; isym._n._n_n._n_offset = STRING_SIZE_SIZE + indx; } @@ -1835,7 +1811,6 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) it). We try to get this right, below, just before we write the symbols out, but in the general case we may have to write the symbol out twice. */ - if (finfo->last_file_index != -1 && finfo->last_file.n_value != (bfd_vma) output_index) { @@ -1846,11 +1821,11 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) { /* The last C_FILE symbol is in this input file. */ bfd_coff_swap_sym_out (output_bfd, - (PTR) &finfo->last_file, - (PTR) (finfo->outsyms - + ((finfo->last_file_index - - syment_base) - * osymesz))); + &finfo->last_file, + (finfo->outsyms + + ((finfo->last_file_index + - syment_base) + * osymesz))); } else { @@ -1860,13 +1835,12 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) symbol. We need to write it out again. We borrow *outsym temporarily. */ bfd_coff_swap_sym_out (output_bfd, - (PTR) &finfo->last_file, - (PTR) outsym); + &finfo->last_file, outsym); pos = obj_sym_filepos (output_bfd); pos += finfo->last_file_index * osymesz; if (bfd_seek (output_bfd, pos, SEEK_SET) != 0 || bfd_bwrite (outsym, osymesz, output_bfd) != osymesz) - return false; + return FALSE; } } @@ -1881,8 +1855,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) isym.n_sclass = C_STAT; /* Output the symbol. */ - - bfd_coff_swap_sym_out (output_bfd, (PTR) &isym, (PTR) outsym); + bfd_coff_swap_sym_out (output_bfd, &isym, outsym); *indexp = output_index; @@ -1899,7 +1872,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) /* This can happen if there were errors earlier in the link. */ bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } h->indx = output_index; } @@ -1922,13 +1895,13 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) /* Fix up the aux entries. This must be done in a separate pass, because we don't know the correct symbol indices until we have already decided which symbols we are going to keep. */ - esym = (bfd_byte *) obj_coff_external_syms (input_bfd); esym_end = esym + obj_raw_syment_count (input_bfd) * isymesz; isymp = finfo->internal_syms; indexp = finfo->sym_indices; sym_hash = obj_coff_sym_hashes (input_bfd); outsym = finfo->outsyms; + while (esym < esym_end) { int add; @@ -1973,9 +1946,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) auxp = h->aux + i; else { - bfd_coff_swap_aux_in (input_bfd, (PTR) esym, isymp->n_type, - isymp->n_sclass, i, isymp->n_numaux, - (PTR) &aux); + bfd_coff_swap_aux_in (input_bfd, esym, isymp->n_type, + isymp->n_sclass, i, isymp->n_numaux, &aux); auxp = &aux; } @@ -1995,13 +1967,13 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) { strings = _bfd_coff_read_string_table (input_bfd); if (strings == NULL) - return false; + return FALSE; } filename = strings + auxp->x_file.x_n.x_offset; indx = _bfd_stringtab_add (finfo->strtab, filename, hash, copy); if (indx == (bfd_size_type) -1) - return false; + return FALSE; auxp->x_file.x_n.x_offset = STRING_SIZE_SIZE + indx; } } @@ -2068,18 +2040,19 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) if ((bfd_size_type) finfo->last_bf_index >= syment_base) { - PTR auxout; + void *auxout; /* The last .bf symbol is in this input file. This will only happen if the assembler did not set up the .bf endndx symbols correctly. */ - auxout = (PTR) (finfo->outsyms - + ((finfo->last_bf_index - - syment_base) - * osymesz)); + auxout = (finfo->outsyms + + ((finfo->last_bf_index + - syment_base) + * osymesz)); + bfd_coff_swap_aux_out (output_bfd, - (PTR) &finfo->last_bf, + &finfo->last_bf, isymp->n_type, isymp->n_sclass, 0, isymp->n_numaux, @@ -2095,17 +2068,17 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) temporarily. FIXME: This case should be made faster. */ bfd_coff_swap_aux_out (output_bfd, - (PTR) &finfo->last_bf, + &finfo->last_bf, isymp->n_type, isymp->n_sclass, 0, isymp->n_numaux, - (PTR) outsym); + outsym); pos = obj_sym_filepos (output_bfd); pos += finfo->last_bf_index * osymesz; if (bfd_seek (output_bfd, pos, SEEK_SET) != 0 || (bfd_bwrite (outsym, osymesz, output_bfd) != osymesz)) - return false; + return FALSE; } } @@ -2126,9 +2099,9 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) if (h == NULL) { - bfd_coff_swap_aux_out (output_bfd, (PTR) auxp, isymp->n_type, + bfd_coff_swap_aux_out (output_bfd, auxp, isymp->n_type, isymp->n_sclass, i, isymp->n_numaux, - (PTR) outsym); + outsym); outsym += osymesz; } @@ -2151,7 +2124,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) bfd_byte *eline; bfd_byte *elineend; bfd_byte *oeline; - boolean skipping; + bfd_boolean skipping; file_ptr pos; bfd_size_type amt; @@ -2171,18 +2144,18 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) if (bfd_seek (input_bfd, o->line_filepos, SEEK_SET) != 0 || bfd_bread (finfo->linenos, linesz * o->lineno_count, input_bfd) != linesz * o->lineno_count) - return false; + return FALSE; offset = o->output_section->vma + o->output_offset - o->vma; eline = finfo->linenos; oeline = finfo->linenos; elineend = eline + linesz * o->lineno_count; - skipping = false; + skipping = FALSE; for (; eline < elineend; eline += linesz) { struct internal_lineno iline; - bfd_coff_swap_lineno_in (input_bfd, (PTR) eline, (PTR) &iline); + bfd_coff_swap_lineno_in (input_bfd, eline, &iline); if (iline.l_lnno != 0) iline.l_addr.l_paddr += offset; @@ -2203,7 +2176,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) with symbol #0) will fail. We can't regain the space in the output file, but at least they're dense. */ - skipping = true; + skipping = TRUE; } else { @@ -2218,32 +2191,31 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) of the line numbers rather than an absolute file index. */ bfd_coff_swap_sym_in (output_bfd, - (PTR) (finfo->outsyms - + ((indx - syment_base) - * osymesz)), - (PTR) &is); + (finfo->outsyms + + ((indx - syment_base) + * osymesz)), &is); if ((ISFCN (is.n_type) || is.n_sclass == C_BLOCK) && is.n_numaux >= 1) { - PTR auxptr; + void *auxptr; - auxptr = (PTR) (finfo->outsyms - + ((indx - syment_base + 1) - * osymesz)); + auxptr = (finfo->outsyms + + ((indx - syment_base + 1) + * osymesz)); bfd_coff_swap_aux_in (output_bfd, auxptr, is.n_type, is.n_sclass, - 0, is.n_numaux, (PTR) &ia); + 0, is.n_numaux, &ia); ia.x_sym.x_fcnary.x_fcn.x_lnnoptr = (o->output_section->line_filepos + o->output_section->lineno_count * linesz + eline - finfo->linenos); - bfd_coff_swap_aux_out (output_bfd, (PTR) &ia, + bfd_coff_swap_aux_out (output_bfd, &ia, is.n_type, is.n_sclass, 0, is.n_numaux, auxptr); } - skipping = false; + skipping = FALSE; } iline.l_addr.l_symndx = indx; @@ -2251,8 +2223,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) if (!skipping) { - bfd_coff_swap_lineno_out (output_bfd, (PTR) &iline, - (PTR) oeline); + bfd_coff_swap_lineno_out (output_bfd, &iline, oeline); oeline += linesz; } } @@ -2262,7 +2233,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) amt = oeline - finfo->linenos; if (bfd_seek (output_bfd, pos, SEEK_SET) != 0 || bfd_bwrite (finfo->linenos, amt, output_bfd) != amt) - return false; + return FALSE; o->output_section->lineno_count += amt / linesz; } @@ -2276,10 +2247,10 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) && (bfd_size_type) finfo->last_file_index >= syment_base) { finfo->last_file.n_value = output_index; - bfd_coff_swap_sym_out (output_bfd, (PTR) &finfo->last_file, - (PTR) (finfo->outsyms - + ((finfo->last_file_index - syment_base) - * osymesz))); + bfd_coff_swap_sym_out (output_bfd, &finfo->last_file, + (finfo->outsyms + + ((finfo->last_file_index - syment_base) + * osymesz))); } /* Write the modified symbols to the output file. */ @@ -2292,7 +2263,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) amt = outsym - finfo->outsyms; if (bfd_seek (output_bfd, pos, SEEK_SET) != 0 || bfd_bwrite (finfo->outsyms, amt, output_bfd) != amt) - return false; + return FALSE; BFD_ASSERT ((obj_raw_syment_count (output_bfd) + (outsym - finfo->outsyms) / osymesz) @@ -2309,10 +2280,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) struct coff_section_tdata *secdata; if (! o->linker_mark) - { - /* This section was omitted from the link. */ - continue; - } + /* This section was omitted from the link. */ + continue; if ((o->flags & SEC_HAS_CONTENTS) == 0 || (o->_raw_size == 0 && (o->flags & SEC_RELOC) == 0)) @@ -2325,7 +2294,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) bfd_archive_filename (input_bfd), bfd_get_section_name (input_bfd, o))); bfd_set_error (bfd_error_no_contents); - return false; + return FALSE; } continue; @@ -2338,7 +2307,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) { if (! bfd_get_section_contents (input_bfd, o, finfo->contents, (file_ptr) 0, o->_raw_size)) - return false; + return FALSE; contents = finfo->contents; } @@ -2351,14 +2320,14 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) /* Read in the relocs. */ target_index = o->output_section->target_index; internal_relocs = (_bfd_coff_read_internal_relocs - (input_bfd, o, false, finfo->external_relocs, - finfo->info->relocateable, - (finfo->info->relocateable + (input_bfd, o, FALSE, finfo->external_relocs, + finfo->info->relocatable, + (finfo->info->relocatable ? (finfo->section_info[target_index].relocs + o->output_section->reloc_count) : finfo->internal_relocs))); if (internal_relocs == NULL) - return false; + return FALSE; /* Call processor specific code to relocate the section contents. */ @@ -2368,9 +2337,9 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) internal_relocs, finfo->internal_syms, finfo->sec_ptrs)) - return false; + return FALSE; - if (finfo->info->relocateable) + if (finfo->info->relocatable) { bfd_vma offset; struct internal_reloc *irelend; @@ -2384,12 +2353,11 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) for (; irel < irelend; irel++, rel_hash++) { struct coff_link_hash_entry *h; - boolean adjusted; + bfd_boolean adjusted; *rel_hash = NULL; /* Adjust the reloc address and symbol index. */ - irel->r_vaddr += offset; if (irel->r_symndx == -1) @@ -2400,7 +2368,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) if (! (*adjust_symndx) (output_bfd, finfo->info, input_bfd, o, irel, &adjusted)) - return false; + return FALSE; if (adjusted) continue; } @@ -2440,18 +2408,17 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) stripping. This should have been handled by the 'dont_skip_symbol' code in the while loop at the top of this function. */ - is = finfo->internal_syms + irel->r_symndx; name = (_bfd_coff_internal_syment_name (input_bfd, is, buf)); if (name == NULL) - return false; + return FALSE; if (! ((*finfo->info->callbacks->unattached_reloc) (finfo->info, name, input_bfd, o, irel->r_vaddr))) - return false; + return FALSE; } } } @@ -2468,32 +2435,28 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) ? o->_cooked_size : o->_raw_size); if (! bfd_set_section_contents (output_bfd, o->output_section, contents, loc, amt)) - return false; + return FALSE; } else { if (! (_bfd_write_section_stabs (output_bfd, &coff_hash_table (finfo->info)->stab_info, o, &secdata->stab_info, contents))) - return false; + return FALSE; } } - if (! finfo->info->keep_memory) - { - if (! _bfd_coff_free_symbols (input_bfd)) - return false; - } + if (! finfo->info->keep_memory + && ! _bfd_coff_free_symbols (input_bfd)) + return FALSE; - return true; + return TRUE; } /* Write out a global symbol. Called via coff_link_hash_traverse. */ -boolean -_bfd_coff_write_global_sym (h, data) - struct coff_link_hash_entry *h; - PTR data; +bfd_boolean +_bfd_coff_write_global_sym (struct coff_link_hash_entry *h, void *data) { struct coff_final_link_info *finfo = (struct coff_final_link_info *) data; bfd *output_bfd; @@ -2508,19 +2471,19 @@ _bfd_coff_write_global_sym (h, data) { h = (struct coff_link_hash_entry *) h->root.u.i.link; if (h->root.type == bfd_link_hash_new) - return true; + return TRUE; } if (h->indx >= 0) - return true; + return TRUE; if (h->indx != -2 && (finfo->info->strip == strip_all || (finfo->info->strip == strip_some && (bfd_hash_lookup (finfo->info->keep_hash, - h->root.root.string, false, false) + h->root.root.string, FALSE, FALSE) == NULL)))) - return true; + return TRUE; switch (h->root.type) { @@ -2528,7 +2491,7 @@ _bfd_coff_write_global_sym (h, data) case bfd_link_hash_new: case bfd_link_hash_warning: abort (); - return false; + return FALSE; case bfd_link_hash_undefined: case bfd_link_hash_undefweak: @@ -2560,25 +2523,25 @@ _bfd_coff_write_global_sym (h, data) case bfd_link_hash_indirect: /* Just ignore these. They can't be handled anyhow. */ - return true; + return TRUE; } if (strlen (h->root.root.string) <= SYMNMLEN) strncpy (isym._n._n_name, h->root.root.string, SYMNMLEN); else { - boolean hash; + bfd_boolean hash; bfd_size_type indx; - hash = true; + hash = TRUE; if ((output_bfd->flags & BFD_TRADITIONAL_FORMAT) != 0) - hash = false; + hash = FALSE; indx = _bfd_stringtab_add (finfo->strtab, h->root.root.string, hash, - false); + FALSE); if (indx == (bfd_size_type) -1) { - finfo->failed = true; - return false; + finfo->failed = TRUE; + return FALSE; } isym._n._n_n._n_zeroes = 0; isym._n._n_n._n_offset = STRING_SIZE_SIZE + indx; @@ -2597,22 +2560,22 @@ _bfd_coff_write_global_sym (h, data) if (finfo->global_to_static) { if (! IS_EXTERNAL (output_bfd, isym)) - return true; + return TRUE; isym.n_sclass = C_STAT; } - /* When a weak symbol is not overriden by a strong one, + /* When a weak symbol is not overridden by a strong one, turn it into an external symbol when not building a - shared or relocateable object. */ + shared or relocatable object. */ if (! finfo->info->shared - && ! finfo->info->relocateable + && ! finfo->info->relocatable && 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); + bfd_coff_swap_sym_out (output_bfd, &isym, finfo->outsyms); symesz = bfd_coff_symesz (output_bfd); @@ -2621,8 +2584,8 @@ _bfd_coff_write_global_sym (h, data) if (bfd_seek (output_bfd, pos, SEEK_SET) != 0 || bfd_bwrite (finfo->outsyms, symesz, output_bfd) != symesz) { - finfo->failed = true; - return false; + finfo->failed = TRUE; + return FALSE; } h->indx = obj_raw_syment_count (output_bfd); @@ -2659,10 +2622,9 @@ _bfd_coff_write_global_sym (h, data) /* For PE, an overflow on the final link reportedly does not matter. FIXME: Why not? */ - if (sec->reloc_count > 0xffff && (! obj_pe (output_bfd) - || finfo->info->relocateable)) + || finfo->info->relocatable)) (*_bfd_error_handler) (_("%s: %s: reloc overflow: 0x%lx > 0xffff"), bfd_get_filename (output_bfd), @@ -2671,7 +2633,7 @@ _bfd_coff_write_global_sym (h, data) if (sec->lineno_count > 0xffff && (! obj_pe (output_bfd) - || finfo->info->relocateable)) + || finfo->info->relocatable)) (*_bfd_error_handler) (_("%s: warning: %s: line number overflow: 0x%lx > 0xffff"), bfd_get_filename (output_bfd), @@ -2686,32 +2648,30 @@ _bfd_coff_write_global_sym (h, data) } } - bfd_coff_swap_aux_out (output_bfd, (PTR) auxp, isym.n_type, + bfd_coff_swap_aux_out (output_bfd, auxp, isym.n_type, isym.n_sclass, (int) i, isym.n_numaux, - (PTR) finfo->outsyms); + finfo->outsyms); if (bfd_bwrite (finfo->outsyms, symesz, output_bfd) != symesz) { - finfo->failed = true; - return false; + finfo->failed = TRUE; + return FALSE; } ++obj_raw_syment_count (output_bfd); } - return true; + return TRUE; } /* Write out task global symbols, converting them to statics. Called via coff_link_hash_traverse. Calls bfd_coff_write_global_sym to do the dirty work, if the symbol we are processing needs conversion. */ -boolean -_bfd_coff_write_task_globals (h, data) - struct coff_link_hash_entry *h; - PTR data; +bfd_boolean +_bfd_coff_write_task_globals (struct coff_link_hash_entry *h, void *data) { struct coff_final_link_info *finfo = (struct coff_final_link_info *) data; - boolean rtnval = true; - boolean save_global_to_static; + bfd_boolean rtnval = TRUE; + bfd_boolean save_global_to_static; if (h->root.type == bfd_link_hash_warning) h = (struct coff_link_hash_entry *) h->root.u.i.link; @@ -2723,7 +2683,7 @@ _bfd_coff_write_task_globals (h, data) case bfd_link_hash_defined: case bfd_link_hash_defweak: save_global_to_static = finfo->global_to_static; - finfo->global_to_static = true; + finfo->global_to_static = TRUE; rtnval = _bfd_coff_write_global_sym (h, data); finfo->global_to_static = save_global_to_static; break; @@ -2736,12 +2696,11 @@ _bfd_coff_write_task_globals (h, data) /* Handle a link order which is supposed to generate a reloc. */ -boolean -_bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order) - bfd *output_bfd; - struct coff_final_link_info *finfo; - asection *output_section; - struct bfd_link_order *link_order; +bfd_boolean +_bfd_coff_reloc_link_order (bfd *output_bfd, + struct coff_final_link_info *finfo, + asection *output_section, + struct bfd_link_order *link_order) { reloc_howto_type *howto; struct internal_reloc *irel; @@ -2751,7 +2710,7 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order) if (howto == NULL) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } if (link_order->u.reloc.p->addend != 0) @@ -2759,13 +2718,13 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order) bfd_size_type size; bfd_byte *buf; bfd_reloc_status_type rstat; - boolean ok; + bfd_boolean ok; file_ptr loc; size = bfd_get_reloc_size (howto); - buf = (bfd_byte *) bfd_zmalloc (size); + buf = bfd_zmalloc (size); if (buf == NULL) - return false; + return FALSE; rstat = _bfd_relocate_contents (howto, output_bfd, (bfd_vma) link_order->u.reloc.p->addend,\ @@ -2788,21 +2747,20 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order) (bfd *) NULL, (asection *) NULL, (bfd_vma) 0))) { free (buf); - return false; + return FALSE; } break; } loc = link_order->offset * bfd_octets_per_byte (output_bfd); - ok = bfd_set_section_contents (output_bfd, output_section, (PTR) buf, + ok = bfd_set_section_contents (output_bfd, output_section, buf, loc, size); free (buf); if (! ok) - return false; + return FALSE; } /* Store the reloc information in the right place. It will get swapped and written out at the end of the final_link routine. */ - irel = (finfo->section_info[output_section->target_index].relocs + output_section->reloc_count); rel_hash_ptr = (finfo->section_info[output_section->target_index].rel_hashes @@ -2830,7 +2788,7 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order) h = ((struct coff_link_hash_entry *) bfd_wrapped_link_hash_lookup (output_bfd, finfo->info, link_order->u.reloc.p->u.name, - false, false, true)); + FALSE, FALSE, TRUE)); if (h != NULL) { if (h->indx >= 0) @@ -2849,7 +2807,7 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order) if (! ((*finfo->info->callbacks->unattached_reloc) (finfo->info, link_order->u.reloc.p->u.name, (bfd *) NULL, (asection *) NULL, (bfd_vma) 0))) - return false; + return FALSE; irel->r_symndx = 0; } } @@ -2861,27 +2819,23 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order) routines anyhow. r_extern is only used for ECOFF. */ /* FIXME: What is the right value for r_offset? Is zero OK? */ - ++output_section->reloc_count; - return true; + return TRUE; } /* A basic reloc handling routine which may be used by processors with simple relocs. */ -boolean -_bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, - input_section, contents, relocs, syms, - sections) - bfd *output_bfd; - struct bfd_link_info *info; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - struct internal_reloc *relocs; - struct internal_syment *syms; - asection **sections; +bfd_boolean +_bfd_coff_generic_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + struct internal_reloc *relocs, + struct internal_syment *syms, + asection **sections) { struct internal_reloc *rel; struct internal_reloc *relend; @@ -2911,7 +2865,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, (*_bfd_error_handler) ("%s: illegal symbol index %ld in relocs", bfd_archive_filename (input_bfd), symndx); - return false; + return FALSE; } else { @@ -2923,7 +2877,6 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, size of the symbol is included in the section contents, or it is not. We assume that the size is not included, and force the rtype_to_howto function to adjust the addend as needed. */ - if (sym != NULL && sym->n_scnum != 0) addend = - sym->n_value; else @@ -2932,15 +2885,15 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h, sym, &addend); if (howto == NULL) - return false; + return FALSE; - /* If we are doing a relocateable link, then we can just ignore + /* If we are doing a relocatable 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, + have the correct value. If this is not a relocatable link, then we should ignore the symbol value. */ if (howto->pc_relative && howto->pcrel_offset) { - if (info->relocateable) + if (info->relocatable) continue; if (sym != NULL && sym->n_scnum != 0) addend += sym->n_value; @@ -2983,12 +2936,12 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, else if (h->root.type == bfd_link_hash_undefweak) val = 0; - else if (! info->relocateable) + else if (! info->relocatable) { if (! ((*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, - rel->r_vaddr - input_section->vma, true))) - return false; + rel->r_vaddr - input_section->vma, TRUE))) + return FALSE; } } @@ -3013,7 +2966,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, != sizeof (long)) { bfd_set_error (bfd_error_system_call); - return false; + return FALSE; } } } @@ -3035,7 +2988,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, bfd_archive_filename (input_bfd), (unsigned long) rel->r_vaddr, bfd_get_section_name (input_bfd, input_section)); - return false; + return FALSE; case bfd_reloc_overflow: { const char *name; @@ -3049,15 +3002,15 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, { name = _bfd_coff_internal_syment_name (input_bfd, sym, buf); if (name == NULL) - return false; + return FALSE; } if (! ((*info->callbacks->reloc_overflow) (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_vaddr - input_section->vma))) - return false; + return FALSE; } } } - return true; + return TRUE; } diff --git a/contrib/binutils/bfd/coffswap.h b/contrib/binutils/bfd/coffswap.h index cd147c5..5f23ecc 100644 --- a/contrib/binutils/bfd/coffswap.h +++ b/contrib/binutils/bfd/coffswap.h @@ -1,24 +1,24 @@ /* Generic COFF swapping routines, for BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1999, 2000, - 2001 + 2001, 2002 Free Software Foundation, Inc. Written by Cygnus Support. -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. */ /* This file contains routines used to swap COFF data. It is a header file because the details of swapping depend on the details of the @@ -381,7 +381,12 @@ coff_swap_sym_out (abfd, inp, extp) { struct internal_syment *in = (struct internal_syment *) inp; SYMENT *ext =(SYMENT *) extp; - if(in->_n._n_name[0] == 0) + +#ifdef COFF_ADJUST_SYM_OUT_PRE + COFF_ADJUST_SYM_OUT_PRE (abfd, inp, extp); +#endif + + if (in->_n._n_name[0] == 0) { H_PUT_32 (abfd, 0, ext->e.e.e_zeroes); H_PUT_32 (abfd, in->_n._n_n._n_offset, ext->e.e.e_offset); @@ -391,11 +396,13 @@ coff_swap_sym_out (abfd, inp, extp) #if SYMNMLEN != E_SYMNMLEN -> Error, we need to cope with truncating or extending SYMNMLEN!; #else - memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN); + memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN); #endif } + H_PUT_32 (abfd, in->n_value, ext->e_value); H_PUT_16 (abfd, in->n_scnum, ext->e_scnum); + if (sizeof (ext->e_type) == 2) { H_PUT_16 (abfd, in->n_type, ext->e_type); @@ -404,11 +411,14 @@ coff_swap_sym_out (abfd, inp, extp) { H_PUT_32 (abfd, in->n_type, ext->e_type); } + H_PUT_8 (abfd, in->n_sclass, ext->e_sclass); H_PUT_8 (abfd, in->n_numaux, ext->e_numaux); + #ifdef COFF_ADJUST_SYM_OUT_POST COFF_ADJUST_SYM_OUT_POST (abfd, inp, extp); #endif + return SYMESZ; } @@ -428,6 +438,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) #ifdef COFF_ADJUST_AUX_IN_PRE COFF_ADJUST_AUX_IN_PRE (abfd, ext1, type, class, indx, numaux, in1); #endif + switch (class) { case C_FILE: @@ -448,9 +459,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) numaux * sizeof (AUXENT)); } else - { - memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); - } + memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); #endif } goto end; @@ -502,7 +511,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) H_GET_16 (abfd, ext->x_sym.x_fcnary.x_ary.x_dimen[3]); } - if (ISFCN(type)) + if (ISFCN (type)) { in->x_sym.x_misc.x_fsize = H_GET_32 (abfd, ext->x_sym.x_misc.x_fsize); } @@ -535,7 +544,9 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) #ifdef COFF_ADJUST_AUX_OUT_PRE COFF_ADJUST_AUX_OUT_PRE (abfd, inp, type, class, indx, numaux, extp); #endif - memset((PTR)ext, 0, AUXESZ); + + memset ((PTR)ext, 0, AUXESZ); + switch (class) { case C_FILE: @@ -681,29 +692,29 @@ coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) #else aouthdr_int->o_toc = H_GET_32 (abfd, aouthdr_ext->o_toc); #endif - aouthdr_int->o_snentry = H_GET_16 (abfd, aouthdr_ext->o_snentry); - aouthdr_int->o_sntext = H_GET_16 (abfd, aouthdr_ext->o_sntext); - aouthdr_int->o_sndata = H_GET_16 (abfd, aouthdr_ext->o_sndata); - aouthdr_int->o_sntoc = H_GET_16 (abfd, aouthdr_ext->o_sntoc); + aouthdr_int->o_snentry = H_GET_16 (abfd, aouthdr_ext->o_snentry); + aouthdr_int->o_sntext = H_GET_16 (abfd, aouthdr_ext->o_sntext); + aouthdr_int->o_sndata = H_GET_16 (abfd, aouthdr_ext->o_sndata); + aouthdr_int->o_sntoc = H_GET_16 (abfd, aouthdr_ext->o_sntoc); aouthdr_int->o_snloader = H_GET_16 (abfd, aouthdr_ext->o_snloader); - aouthdr_int->o_snbss = H_GET_16 (abfd, aouthdr_ext->o_snbss); + aouthdr_int->o_snbss = H_GET_16 (abfd, aouthdr_ext->o_snbss); aouthdr_int->o_algntext = H_GET_16 (abfd, aouthdr_ext->o_algntext); aouthdr_int->o_algndata = H_GET_16 (abfd, aouthdr_ext->o_algndata); - aouthdr_int->o_modtype = H_GET_16 (abfd, aouthdr_ext->o_modtype); - aouthdr_int->o_cputype = H_GET_16 (abfd, aouthdr_ext->o_cputype); + aouthdr_int->o_modtype = H_GET_16 (abfd, aouthdr_ext->o_modtype); + aouthdr_int->o_cputype = H_GET_16 (abfd, aouthdr_ext->o_cputype); #ifdef XCOFF64 aouthdr_int->o_maxstack = H_GET_64 (abfd, aouthdr_ext->o_maxstack); - aouthdr_int->o_maxdata = H_GET_64 (abfd, aouthdr_ext->o_maxdata); + aouthdr_int->o_maxdata = H_GET_64 (abfd, aouthdr_ext->o_maxdata); #else aouthdr_int->o_maxstack = H_GET_32 (abfd, aouthdr_ext->o_maxstack); - aouthdr_int->o_maxdata = H_GET_32 (abfd, aouthdr_ext->o_maxdata); + aouthdr_int->o_maxdata = H_GET_32 (abfd, aouthdr_ext->o_maxdata); #endif #endif #ifdef MIPSECOFF - aouthdr_int->bss_start = H_GET_32 (abfd, aouthdr_ext->bss_start); - aouthdr_int->gp_value = H_GET_32 (abfd, aouthdr_ext->gp_value); - aouthdr_int->gprmask = H_GET_32 (abfd, aouthdr_ext->gprmask); + aouthdr_int->bss_start = H_GET_32 (abfd, aouthdr_ext->bss_start); + aouthdr_int->gp_value = H_GET_32 (abfd, aouthdr_ext->gp_value); + aouthdr_int->gprmask = H_GET_32 (abfd, aouthdr_ext->gprmask); aouthdr_int->cprmask[0] = H_GET_32 (abfd, aouthdr_ext->cprmask[0]); aouthdr_int->cprmask[1] = H_GET_32 (abfd, aouthdr_ext->cprmask[1]); aouthdr_int->cprmask[2] = H_GET_32 (abfd, aouthdr_ext->cprmask[2]); @@ -712,9 +723,9 @@ coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) #ifdef ALPHAECOFF aouthdr_int->bss_start = H_GET_64 (abfd, aouthdr_ext->bss_start); - aouthdr_int->gp_value = H_GET_64 (abfd, aouthdr_ext->gp_value); - aouthdr_int->gprmask = H_GET_32 (abfd, aouthdr_ext->gprmask); - aouthdr_int->fprmask = H_GET_32 (abfd, aouthdr_ext->fprmask); + aouthdr_int->gp_value = H_GET_64 (abfd, aouthdr_ext->gp_value); + aouthdr_int->gprmask = H_GET_32 (abfd, aouthdr_ext->gprmask); + aouthdr_int->fprmask = H_GET_32 (abfd, aouthdr_ext->fprmask); #endif } @@ -807,7 +818,8 @@ 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, scnhdr_ext->s_vaddr); scnhdr_int->s_paddr = GET_SCNHDR_PADDR (abfd, scnhdr_ext->s_paddr); scnhdr_int->s_size = GET_SCNHDR_SIZE (abfd, scnhdr_ext->s_size); @@ -866,6 +878,7 @@ coff_swap_scnhdr_out (abfd, in, out) buf, scnhdr_int->s_nlnno); PUT_SCNHDR_NLNNO (abfd, 0xffff, scnhdr_ext->s_nlnno); } + if (scnhdr_int->s_nreloc <= MAX_SCNHDR_NRELOC) PUT_SCNHDR_NRELOC (abfd, scnhdr_int->s_nreloc, scnhdr_ext->s_nreloc); else diff --git a/contrib/binutils/bfd/config.bfd b/contrib/binutils/bfd/config.bfd index 2e9d7fa..1428831 100755 --- a/contrib/binutils/bfd/config.bfd +++ b/contrib/binutils/bfd/config.bfd @@ -29,15 +29,30 @@ targ64_selvecs= targ_cflags= targ_underscore=no +# Catch obsolete configurations. +case $targ in + vax-*-vms* \ + ) + if test "x$enable_obsolete" != xyes; then + echo "*** Configuration $targ is obsolete." >&2 + echo "*** Specify --enable-obsolete to build it anyway." >&2 + echo "*** Support will be REMOVED in the next major release of BINUTILS," >&2 + echo "*** unless a maintainer comes forward." >&2 + exit 1 + fi;; +esac + + targ_cpu=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` case "${targ_cpu}" in alpha*) targ_archs=bfd_alpha_arch ;; arm*) targ_archs=bfd_arm_arch ;; c30*) targ_archs=bfd_tic30_arch ;; +c4x*) targ_archs=bfd_tic4x_arch ;; c54x*) targ_archs=bfd_tic54x_arch ;; dlx*) targ_archs=bfd_dlx_arch ;; hppa*) targ_archs=bfd_hppa_arch ;; -i[3456]86) targ_archs=bfd_i386_arch ;; +i[3-7]86) targ_archs=bfd_i386_arch ;; i370) targ_archs=bfd_i370_arch ;; m6811*|m68hc11*) targ_archs="bfd_m68hc11_arch bfd_m68hc12_arch" ;; m6812*|m68hc12*) targ_archs="bfd_m68hc12_arch bfd_m68hc11_arch" ;; @@ -57,7 +72,9 @@ thumb*) targ_archs=bfd_arm_arch ;; v850*) targ_archs=bfd_v850_arch ;; x86_64) targ_archs=bfd_i386_arch ;; xscale*) targ_archs=bfd_arm_arch ;; +xtensa*) targ_archs=bfd_xtensa_arch ;; z8k*) targ_archs=bfd_z8k_arch ;; +am33_2.0) targ_archs=bfd_mn10300_arch ;; *) targ_archs=bfd_${targ_cpu}_arch ;; esac @@ -66,11 +83,29 @@ esac # Make sure that the left side always has two dashes. Otherwise you # can get spurious matches. Even for unambiguous cases, do this as a # convention, else the table becomes a real mess to understand and maintain. +# +# Keep obsolete entries above the START comment, to keep them out of +# targmatch.h. case "${targ}" in + mips*-dec-bsd*) + echo "This target is obsolete and has been removed." + exit 1 + ;; + + mips*-*-mach3*) + echo "This target is obsolete and has been removed." + exit 1 + ;; + + mips*-*-pe*) + echo "This target is obsolete and has been removed." + exit 1 + ;; + # START OF targmatch.h #ifdef BFD64 - alpha*-*-freebsd*) + alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) targ_defvec=bfd_elf64_alpha_freebsd_vec targ_selvecs=ecoffalpha_little_vec # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling. @@ -101,11 +136,7 @@ case "${targ}" in alpha*-*-*) targ_defvec=ecoffalpha_little_vec ;; - ia64*-*-aix*) - targ_defvec=bfd_elf64_ia64_aix_little_vec - targ_selvecs="bfd_elf64_ia64_aix_big_vec bfd_efi_app_ia64_vec" - ;; - ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf*) + ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu) targ_defvec=bfd_elf64_ia64_little_vec targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec" ;; @@ -113,12 +144,15 @@ case "${targ}" in targ_defvec=bfd_elf32_ia64_hpux_big_vec targ_selvecs="bfd_elf64_ia64_hpux_big_vec" ;; - sparc64-*-freebsd* | sparc64-*-netbsd* | sparc64-*-openbsd*) + sparc64-*-freebsd* | sparc64-*-netbsd* | sparc64-*-openbsd* | sparc64-*-kfreebsd*-gnu) targ_defvec=bfd_elf64_sparc_vec targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec" ;; #endif /* BFD64 */ + am33_2.0-*-linux*) + targ_defvec=bfd_elf32_am33lin_vec + ;; arc-*-elf*) targ_defvec=bfd_elf32_littlearc_vec targ_selvecs=bfd_elf32_bigarc_vec @@ -136,6 +170,11 @@ case "${targ}" in targ_defvec=armnetbsd_vec targ_selvecs="bfd_elf32_littlearm_vec bfd_elf32_bigarm_vec" targ_underscore=yes + targ_cflags=-D__QNXTARGET__ + ;; + arm-*-nto* | nto*arm*) + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec ;; arm-*-riscix*) targ_defvec=riscix_vec @@ -150,7 +189,7 @@ case "${targ}" in targ_defvec=armpe_little_vec targ_selvecs="armpe_little_vec armpe_big_vec armpei_little_vec armpei_big_vec" targ_underscore=no - targ_cflags=-DARM_WINCE + targ_cflags="-DARM_WINCE -DARM_COFF_BUGFIX" ;; arm-*-pe*) targ_defvec=armpe_little_vec @@ -165,12 +204,6 @@ case "${targ}" in targ_defvec=aout_arm_big_vec targ_selvecs=aout_arm_little_vec ;; - arm-*-vxworks*) - targ_defvec=armcoff_little_vec - targ_selvecs=armcoff_big_vec - targ_underscore=yes - targ_cflags=-DARM_COFF_BUGFIX - ;; arm-*-coff) targ_defvec=armcoff_little_vec targ_selvecs=armcoff_big_vec @@ -184,7 +217,12 @@ case "${targ}" in targ_defvec=bfd_elf32_bigarm_vec targ_selvecs=bfd_elf32_littlearm_vec ;; - arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | arm*-*-uclinux*) + arm-*-kaos* | strongarm-*-kaos*) + targ_defvec=bfd_elf32_littlearm_vec + targ_selvecs=bfd_elf32_bigarm_vec + ;; + arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \ + arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks) targ_defvec=bfd_elf32_littlearm_vec targ_selvecs=bfd_elf32_bigarm_vec ;; @@ -261,6 +299,12 @@ case "${targ}" in targ_defvec=tic30_coff_vec ;; + c4x-*-*coff* | tic4x-*-*coff* | tic4x-*-rtems*) + targ_defvec=tic4x_coff1_vec + targ_selvecs="tic4x_coff1_beh_vec tic4x_coff2_vec tic4x_coff2_beh_vec tic4x_coff0_vec tic4x_coff0_beh_vec" + targ_underscore=yes + ;; + c54x*-*-*coff* | tic54x-*-*coff*) targ_defvec=tic54x_coff1_vec targ_selvecs="tic54x_coff1_beh_vec tic54x_coff2_vec tic54x_coff2_beh_vec tic54x_coff0_vec tic54x_coff0_beh_vec" @@ -292,8 +336,13 @@ case "${targ}" in frv-*-elf) targ_defvec=bfd_elf32_frv_vec + targ_selvecs=bfd_elf32_frvfdpic_vec ;; + frv-*-*linux*) + targ_defvec=bfd_elf32_frvfdpic_vec + targ_selvecs=bfd_elf32_frv_vec + ;; h8300*-*-elf) targ_defvec=bfd_elf32_h8300_vec @@ -322,11 +371,11 @@ case "${targ}" in ;; #endif - hppa*-*-linux-gnu*) + hppa*-*-linux-gnu* | hppa*-*-netbsd*) targ_defvec=bfd_elf32_hppa_linux_vec targ_selvecs=bfd_elf32_hppa_vec ;; - hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-netbsd* | hppa*-*-sysv4* | hppa*-*-rtems* | hppa*-*-openbsd*) + hppa*-*-*elf* | hppa*-*-lites* | hppa*-*-sysv4* | hppa*-*-rtems* | hppa*-*-openbsd*) targ_defvec=bfd_elf32_hppa_vec targ_selvecs=bfd_elf32_hppa_linux_vec ;; @@ -349,94 +398,113 @@ case "${targ}" in targ_defvec=bfd_elf32_i370_vec targ_selvecs="bfd_elf32_i370_vec" ;; - i[3456]86-*-sco3.2v5*coff) + i[3-7]86-*-sco3.2v5*coff) targ_defvec=i386coff_vec targ_selvecs=bfd_elf32_i386_vec ;; - i[3456]86-*-sysv4* | i[3456]86-*-unixware* | i[3456]86-*-solaris2* | \ - i[3456]86-*-elf | i[3456]86-*-sco3.2v5* | \ - i[3456]86-*-dgux* | i[3456]86-*-sysv5*) + i[3-7]86-*-sysv4* | i[3-7]86-*-unixware* | i[3-7]86-*-solaris2* | \ + i[3-7]86-*-elf | i[3-7]86-*-sco3.2v5* | \ + i[3-7]86-*-dgux* | i[3-7]86-*-sysv5*) targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386coff_vec ;; - i[3456]86-*-nto*) + i[3-7]86-*-kaos*) + targ_defvec=bfd_elf32_i386_vec + targ_selvecs=bfd_elf32_i386_vec + ;; + i[3-7]86-*-nto*) targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386coff_vec ;; - i[3456]86-*-chorus*) + i[3-7]86-*-aros*) + targ_defvec=bfd_elf32_i386_vec + ;; + i[3-7]86-*-chorus*) targ_defvec=bfd_elf32_i386_vec ;; *-*-msdosdjgpp* | *-*-go32* | *-go32-rtems* ) targ_defvec=go32coff_vec targ_selvecs="go32stubbedcoff_vec i386aout_vec" ;; - i[3456]86-*-sysv* | i[3456]86-*-isc* | i[3456]86-*-sco* | i[3456]86-*-coff | \ - i[3456]86-*-aix*) + i[3-7]86-*-sysv* | i[3-7]86-*-isc* | i[3-7]86-*-sco* | i[3-7]86-*-coff | \ + i[3-7]86-*-aix*) targ_defvec=i386coff_vec ;; - i[3456]86*-*-rtemscoff*) + i[3-7]86*-*-rtemscoff*) targ_defvec=i386coff_vec targ_selvecs="bfd_elf32_i386_vec i386aout_vec" ;; - i[3456]86-*-rtemself* | i[3456]86-*-rtems*) + i[3-7]86-*-rtemself* | i[3-7]86-*-rtems*) targ_defvec=bfd_elf32_i386_vec targ_selvecs="i386coff_vec i386aout_vec" ;; - i[3456]86-sequent-bsd*) + i[3-7]86-*-darwin* | i[3-7]86-*-macos10* | i[3-7]86-*-rhapsody*) + targ_defvec=mach_o_le_vec + targ_selvecs="mach_o_le_vec mach_o_be_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec" + targ_archs="bfd_i386_arch bfd_powerpc_arch bfd_rs6000_arch" + ;; + i[3-7]86-sequent-bsd*) targ_defvec=i386dynix_vec targ_underscore=yes ;; - i[3456]86-*-bsd*) + i[3-7]86-*-bsd*) targ_defvec=i386bsd_vec targ_underscore=yes ;; - i[3456]86-*-freebsdaout* | i[3456]86-*-freebsd[12].* | \ - i[3456]86-*-freebsd[12]) + i[3-7]86-*-freebsdaout* | i[3-7]86-*-freebsd[12].* | \ + i[3-7]86-*-freebsd[12]) targ_defvec=i386freebsd_vec targ_selvecs=i386bsd_vec targ_underscore=yes ;; - i[3456]86-*-freebsd*) + i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu) targ_defvec=bfd_elf32_i386_freebsd_vec targ_selvecs=i386coff_vec # FreeBSD <= 4.0 supports only the old nonstandard way of ABI labelling. case "${targ}" in - i[3456]86-*-freebsd3* | i[3456]86-*-freebsd4 | i[3456]86-*-freebsd4.0*) + i[3-7]86-*-freebsd3* | i[3-7]86-*-freebsd4 | i[3-7]86-*-freebsd4.0*) targ_cflags=-DOLD_FREEBSD_ABI_LABEL ;; esac ;; - i[3456]86-*-netbsdelf*) + i[3-7]86-*-netbsdelf* | i[3-7]86-*-netbsd*-gnu* | i[3-7]86-*-knetbsd*-gnu) targ_defvec=bfd_elf32_i386_vec targ_selvecs=i386netbsd_vec + targ64_selvecs=bfd_elf64_x86_64_vec ;; - i[3456]86-*-netbsdpe*) + i[3-7]86-*-netbsdpe*) targ_defvec=i386pe_vec targ_selvecs="i386pe_vec i386pei_vec bfd_elf32_i386_vec" ;; - i[3456]86-*-netbsdaout* | i[3456]86-*-netbsd* | i[3456]86-*-openbsd*) + i[3-7]86-*-netbsdaout* | i[3-7]86-*-netbsd* | \ + i[3-7]86-*-openbsd[0-2].* | i[3-7]86-*-openbsd3.[0-3]) targ_defvec=i386netbsd_vec targ_selvecs="bfd_elf32_i386_vec i386bsd_vec" targ_underscore=yes ;; - i[3456]86-*-netware*) + i[3-7]86-*-openbsd*) + targ_defvec=bfd_elf32_i386_vec + targ_selvecs=i386netbsd_vec + ;; + i[3-7]86-*-netware*) targ_defvec=bfd_elf32_i386_vec targ_selvecs="nlm32_i386_vec i386coff_vec i386aout_vec" ;; - i[3456]86-*-linux*aout*) + i[3-7]86-*-linux*aout*) targ_defvec=i386linux_vec targ_selvecs=bfd_elf32_i386_vec targ_underscore=yes ;; - i[3456]86-*-linux-gnu*) + i[3-7]86-*-linux-gnu*) targ_defvec=bfd_elf32_i386_vec targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec" + targ64_selvecs=bfd_elf64_x86_64_vec ;; #ifdef BFD64 - x86_64-*-freebsd*) + x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu) targ_defvec=bfd_elf64_x86_64_vec targ_selvecs="bfd_elf32_i386_vec i386coff_vec bfd_efi_app_ia32_vec" ;; - x86_64-*-netbsd*) + x86_64-*-netbsd* | x86_64-*-openbsd*) targ_defvec=bfd_elf64_x86_64_vec targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec" ;; @@ -445,58 +513,58 @@ case "${targ}" in targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec" ;; #endif - i[3456]86-*-lynxos*) + i[3-7]86-*-lynxos*) targ_defvec=i386lynx_coff_vec targ_selvecs=i386lynx_aout_vec ;; - i[3456]86-*-gnu*) + i[3-7]86-*-gnu*) targ_defvec=bfd_elf32_i386_vec ;; - i[3456]86-*-mach* | i[3456]86-*-osf1mk*) + i[3-7]86-*-mach* | i[3-7]86-*-osf1mk*) targ_defvec=i386mach3_vec targ_cflags=-DSTAT_FOR_EXEC targ_underscore=yes ;; - i[3456]86-*-os9k) + i[3-7]86-*-os9k) targ_defvec=i386os9k_vec ;; - i[3456]86-*-msdos*) + i[3-7]86-*-msdos*) targ_defvec=i386aout_vec targ_selvecs=i386msdos_vec ;; - i[3456]86-*-moss*) + i[3-7]86-*-moss*) targ_defvec=bfd_elf32_i386_vec targ_selvecs="i386msdos_vec i386aout_vec" ;; - i[3456]86-*-beospe*) + i[3-7]86-*-beospe*) targ_defvec=i386pe_vec targ_selvecs="i386pe_vec i386pei_vec" ;; - i[3456]86-*-beoself* | i[3456]86-*-beos*) + i[3-7]86-*-beoself* | i[3-7]86-*-beos*) targ_defvec=bfd_elf32_i386_vec targ_selvecs="i386pe_vec i386pei_vec" ;; - i[3456]86-*-interix*) + i[3-7]86-*-interix*) targ_defvec=i386pei_vec targ_selvecs="i386pe_vec" # FIXME: This should eventually be checked at runtime. targ_cflags=-DSTRICT_PE_FORMAT ;; - i[3456]86-*-mingw32* | i[3456]86-*-cygwin* | i[3456]86-*-winnt | i[3456]86-*-pe) + i[3-7]86-*-mingw32* | i[3-7]86-*-cygwin* | i[3-7]86-*-winnt | i[3-7]86-*-pe) targ_defvec=i386pe_vec targ_selvecs="i386pe_vec i386pei_vec bfd_elf32_i386_vec" ;; - i[3456]86-none-*) + i[3-7]86-none-*) targ_defvec=i386coff_vec ;; - i[3456]86-*-aout* | i[3456]86*-*-vsta*) + i[3-7]86-*-aout* | i[3-7]86*-*-vsta*) targ_defvec=i386aout_vec ;; - i[3456]86-*-vxworks*) - targ_defvec=i386aout_vec + i[3-7]86-*-vxworks) + targ_defvec=bfd_elf32_i386_vec targ_underscore=yes ;; - i[3456]86-*-chaos) + i[3-7]86-*-chaos) targ_defvec=bfd_elf32_i386_vec targ_selfvecs=i386chaos_vec ;; @@ -532,6 +600,29 @@ case "${targ}" in targ_selvecs="icoff_little_vec icoff_big_vec" ;; + ip2k-*-elf) + targ_defvec=bfd_elf32_ip2k_vec + ;; + + iq2000-*-elf) + targ_defvec=bfd_elf32_iq2000_vec + ;; + + m32r*le-*-linux*) + targ_defvec=bfd_elf32_m32rlelin_vec + targ_selvecs="bfd_elf32_m32rlin_vec bfd_elf32_m32rlelin_vec" + ;; + + m32r*-*-linux*) + targ_defvec=bfd_elf32_m32rlin_vec + targ_selvecs="bfd_elf32_m32rlin_vec bfd_elf32_m32rlelin_vec" + ;; + + m32r*le-*-*) + targ_defvec=bfd_elf32_m32rle_vec + targ_selvecs="bfd_elf32_m32r_vec bfd_elf32_m32rle_vec" + ;; + m32r-*-*) targ_defvec=bfd_elf32_m32r_vec ;; @@ -571,7 +662,7 @@ case "${targ}" in targ_defvec=m68kcoff_vec targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec" ;; - m68*-*-elf* | m68*-*-sysv4*) + m68*-*-elf* | m68*-*-sysv4* | m68*-*-uclinux*) targ_defvec=bfd_elf32_m68k_vec targ_selvecs="m68kcoff_vec ieee_vec" ;; @@ -675,19 +766,11 @@ case "${targ}" in ;; mips*el-*-netbsd*) targ_defvec=bfd_elf32_littlemips_vec - targ_selvecs="bfd_elf32_bigmips_vec ecoff_little_vec ecoff_big_vec" + targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_little_vec ecoff_big_vec" ;; mips*-*-netbsd*) targ_defvec=bfd_elf32_bigmips_vec - targ_selvecs="bfd_elf32_littlemips_vec ecoff_big_vec ecoff_little_vec" - ;; - mips*-dec-bsd*) - targ_defvec=aout_mips_little_vec - targ_underscore=yes - ;; - mips*-dec-mach3*) - targ_defvec=aout_mips_little_vec - targ_cflags=-DSTAT_FOR_EXEC + targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec ecoff_big_vec ecoff_little_vec" ;; mips*-dec-* | mips*el-*-ecoff*) targ_defvec=ecoff_little_vec @@ -699,8 +782,8 @@ case "${targ}" in ;; #ifdef BFD64 mips*-*-irix6*) - targ_defvec=bfd_elf32_bigmips_vec - targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" + targ_defvec=bfd_elf32_nbigmips_vec + targ_selvecs="bfd_elf32_nlittlemips_vec bfd_elf32_bigmips_vec bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" ;; #endif mips*-*-irix5*) @@ -715,15 +798,6 @@ case "${targ}" in targ_defvec=ecoff_biglittle_vec targ_selvecs="ecoff_little_vec ecoff_big_vec" ;; - mips*-*-mach3*) - targ_defvec=aout_mips_little_vec - targ_cflags=-DSTAT_FOR_EXEC - ;; - mips*-*-pe*) - targ_defvec=mipslpe_vec - targ_selvecs="mipslpei_vec mipslpei_vec ecoff_little_vec ecoff_big_vec" - targ_underscore=yes - ;; mips*-*-sysv4*) targ_defvec=bfd_elf32_tradbigmips_vec targ_selvecs="bfd_elf32_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" @@ -736,7 +810,7 @@ case "${targ}" in targ_defvec=bfd_elf32_littlemips_vec targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" ;; - mips*-*-elf* | mips*-*-rtems* | mips*-*-vxworks*) + mips*-*-elf* | mips*-*-rtems* | mips*-*-vxworks | mips*-*-windiss) targ_defvec=bfd_elf32_bigmips_vec targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec" ;; @@ -754,21 +828,23 @@ case "${targ}" in ;; #ifdef BFD64 mips64*el-*-linux*) - targ_defvec=bfd_elf32_tradlittlemips_vec - targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec" + targ_defvec=bfd_elf32_ntradlittlemips_vec + targ_selvecs="bfd_elf32_ntradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec" ;; mips64*-*-linux*) - targ_defvec=bfd_elf32_tradbigmips_vec - targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec" + targ_defvec=bfd_elf32_ntradbigmips_vec + targ_selvecs="bfd_elf32_ntradlittlemips_vec bfd_elf32_tradbigmips_vec bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec" ;; #endif mips*el-*-linux*) targ_defvec=bfd_elf32_tradlittlemips_vec - targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf64_tradlittlemips_vec bfd_elf64_tradbigmips_vec ecoff_little_vec ecoff_big_vec" + targ_selvecs="bfd_elf32_tradbigmips_vec ecoff_little_vec ecoff_big_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec" + want64=true ;; mips*-*-linux*) targ_defvec=bfd_elf32_tradbigmips_vec - targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec ecoff_big_vec ecoff_little_vec" + targ_selvecs="bfd_elf32_tradlittlemips_vec ecoff_big_vec ecoff_little_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec" + want64=true ;; #ifdef BFD64 mmix-*-*) @@ -782,6 +858,11 @@ case "${targ}" in mn10300-*-*) targ_defvec=bfd_elf32_mn10300_vec + targ_underscore=yes + ;; + + msp430-*-*) + targ_defvec=bfd_elf32_msp430_vec ;; ns32k-pc532-mach* | ns32k-pc532-ux*) @@ -797,12 +878,12 @@ case "${targ}" in targ_defvec=bfd_elf32_openrisc_vec ;; - or32-*-coff | or32-*-rtems*) + or32-*-coff) targ_defvec=or32coff_big_vec targ_underscore=yes ;; - or32-*-elf) + or32-*-elf | or32-*-rtems*) targ_defvec=bfd_elf32_or32_big_vec ;; @@ -821,13 +902,27 @@ case "${targ}" in targ_selvecs="bfd_elf32_pjl_vec bfd_elf32_pj_vec bfd_elf32_i386_vec" ;; + powerpc-*-aix5.[01]) + targ_defvec=rs6000coff_vec + targ_selvecs="aix5coff64_vec" + want64=true + ;; +#ifdef BFD64 + powerpc64-*-aix5.[01]) + targ_defvec=aix5coff64_vec + targ_selvecs="rs6000coff_vec" + want64=true + ;; +#endif powerpc-*-aix5*) + targ_cflags=-DAIX_WEAK_SUPPORT targ_defvec=rs6000coff_vec targ_selvecs="aix5coff64_vec" want64=true ;; #ifdef BFD64 powerpc64-*-aix5*) + targ_cflags=-DAIX_WEAK_SUPPORT targ_defvec=aix5coff64_vec targ_selvecs="rs6000coff_vec" want64=true @@ -840,7 +935,6 @@ case "${targ}" in case "${targ}" in *-*-aix4.[3456789]* | *-*-aix[56789]*) want64=true;; - *) targ_cflags=-DSMALL_ARCHIVE;; esac @@ -850,7 +944,8 @@ case "${targ}" in targ_defvec=rs6000coff64_vec targ_selvecs=rs6000coff_vec ;; - powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux*) + powerpc64-*-elf* | powerpc-*-elf64* | powerpc64-*-linux* | \ + powerpc64-*-*bsd*) targ_defvec=bfd_elf64_powerpc_vec targ_selvecs="bfd_elf64_powerpcle_vec bfd_elf32_powerpc_vec bfd_elf32_powerpcle_vec rs6000coff_vec rs6000coff64_vec" ;; @@ -866,6 +961,16 @@ case "${targ}" in targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" ;; + powerpc-*-kaos*) + targ_defvec=bfd_elf32_powerpc_vec + targ_selvecs="bfd_elf32_powerpcle_vec ppcboot_vec" + targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" + ;; + powerpc-*-darwin* | powerpc-*-macos10* | powerpc-*-rhapsody*) + targ_defvec=mach_o_be_vec + targ_selvecs="mach_o_be_vec mach_o_le_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec" + targ_archs="bfd_powerpc_arch bfd_rs6000_arch bfd_i386_arch" + ;; powerpc-*-macos* | powerpc-*-mpw*) targ_defvec=pmac_xcoff_vec ;; @@ -873,6 +978,14 @@ case "${targ}" in targ_defvec=bfd_elf32_powerpc_vec targ_selvecs="nlm32_powerpc_vec rs6000coff_vec" ;; + powerpc-*-nto*) + targ_defvec=bfd_elf32_powerpc_vec + targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec" + ;; + powerpcle-*-nto*) + targ_defvec=bfd_elf32_powerpcle_vec + targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" + ;; powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\ powerpcle-*-rtems*) @@ -880,7 +993,6 @@ case "${targ}" in targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec" targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec" ;; - powerpcle-*-pe | powerpcle-*-winnt* | powerpcle-*-cygwin*) targ_defvec=bfd_powerpcle_pe_vec targ_selvecs="bfd_powerpcle_pei_vec bfd_powerpc_pei_vec bfd_powerpcle_pe_vec bfd_powerpc_pe_vec" @@ -909,12 +1021,12 @@ case "${targ}" in targ_underscore=yes ;; sh64eb-*-linux*) - targ_defvec=bfd_elf32_shblin_vec - targ_selvecs="bfd_elf32_shblin_vec bfd_elf32_sh64_vec bfd_elf64_sh64_vec bfd_elf32_sh_vec" + targ_defvec=bfd_elf32_sh64blin_vec + targ_selvecs="bfd_elf32_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf32_shblin_vec bfd_elf32_shlin_vec" ;; sh64-*-linux*) - targ_defvec=bfd_elf32_shlin_vec - targ_selvecs="bfd_elf32_shlin_vec bfd_elf32_sh64l_vec bfd_elf64_sh64l_vec bfd_elf32_shl_vec" + targ_defvec=bfd_elf32_sh64lin_vec + targ_selvecs="bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec bfd_elf32_shlin_vec bfd_elf32_shblin_vec" ;; #endif /* BFD64 */ @@ -922,7 +1034,7 @@ case "${targ}" in targ_defvec=bfd_elf32_shblin_vec targ_selvecs=bfd_elf32_shlin_vec #ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" + targ_selvecs="${targ_selvecs} bfd_elf32_sh64lin_vec bfd_elf32_sh64blin_vec bfd_elf64_sh64lin_vec bfd_elf64_sh64blin_vec" #endif ;; sh*eb-*-linux*) @@ -954,30 +1066,25 @@ case "${targ}" in ;; #endif - shle-*-netbsdelf*) + sh*l*-*-netbsdelf*) targ_defvec=bfd_elf32_shlnbsd_vec targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec" #ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" + targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" #endif ;; - sh*le-*-netbsdelf*) - targ_defvec=bfd_elf32_shlnbsd_vec - targ_selvecs="bfd_elf32_shnbsd_vec shcoff_vec shlcoff_vec" - ;; sh-*-netbsdelf*) targ_defvec=bfd_elf32_shnbsd_vec targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec" #ifdef BFD64 - targ_selvecs="${targ_selvecs} bfd_elf32_sh64_vec bfd_elf32_sh64l_vec bfd_elf64_sh64_vec bfd_elf64_sh64l_vec" + targ_selvecs="${targ_selvecs} bfd_elf32_sh64lnbsd_vec bfd_elf32_sh64nbsd_vec bfd_elf64_sh64lnbsd_vec bfd_elf64_sh64nbsd_vec" #endif ;; sh*-*-netbsdelf*) targ_defvec=bfd_elf32_shnbsd_vec targ_selvecs="bfd_elf32_shlnbsd_vec shcoff_vec shlcoff_vec" ;; - - shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf*) + shl*-*-elf* | sh[1234]l*-*-elf* | sh3el*-*-elf* | shl*-*-kaos*) targ_defvec=bfd_elf32_shl_vec targ_selvecs="bfd_elf32_sh_vec shlcoff_vec shcoff_vec shlcoff_small_vec shcoff_small_vec" #ifdef BFD64 @@ -985,7 +1092,12 @@ case "${targ}" in #endif targ_underscore=yes ;; - sh-*-elf* | sh[1234]*-elf* | sh-*-rtemself*) + sh-*-rtemscoff*) + targ_defvec=shcoff_vec + targ_selvecs="shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" + targ_underscore=yes + ;; + sh-*-elf* | sh[1234]*-elf* | sh-*-rtems* | sh-*-kaos*) targ_defvec=bfd_elf32_sh_vec targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" #ifdef BFD64 @@ -993,12 +1105,25 @@ case "${targ}" in #endif targ_underscore=yes ;; + sh-*-nto*) + targ_defvec=bfd_elf32_sh_vec + targ_selvecs="bfd_elf32_shl_vec shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" + targ_underscore=yes + ;; sh-*-pe) targ_defvec=shlpe_vec targ_selvecs="shlpe_vec shlpei_vec" targ_underscore=yes ;; - sh-*-* | sh-*-rtems*) + sh-*-vxworks) + targ_defvec=bfd_elf32_sh_vec + targ_selvecs="bfd_elf32_shl_vec" + # FIXME None of the following are actually used on this target, but + # they're necessary for coff-sh.c (which is unconditionally used) to be + # compiled correctly. + targ_selvecs="$targ_selvecs shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" + ;; + sh-*-*) targ_defvec=shcoff_vec targ_selvecs="shcoff_vec shlcoff_vec shcoff_small_vec shlcoff_small_vec" targ_underscore=yes @@ -1041,10 +1166,14 @@ case "${targ}" in targ_selvecs=bfd_elf32_sparc_vec targ_underscore=yes ;; - sparc-*-openbsd*) + sparc-*-openbsd[0-2].* | sparc-*-openbsd3.[0-1]) targ_defvec=sparcnetbsd_vec targ_underscore=yes ;; + sparc-*-openbsd*) + targ_defvec=bfd_elf32_sparc_vec + targ_selvecs=sparcnetbsd_vec + ;; sparc-*-elf* | sparc-*-solaris2.[0-6] | sparc-*-solaris2.[0-6].*) targ_defvec=bfd_elf32_sparc_vec targ_selvecs=sunos_big_vec @@ -1105,7 +1234,6 @@ case "${targ}" in targ_underscore=yes ;; - v850-*-*) targ_defvec=bfd_elf32_v850_vec ;; @@ -1132,6 +1260,15 @@ case "${targ}" in targ_underscore=yes ;; + vax-*-openbsd*) + targ_defvec=vaxnetbsd_vec + targ_underscore=yes + ;; + + vax-*-linux-gnu*) + targ_defvec=bfd_elf32_vax_vec + ;; + vax*-*-*vms*) targ_defvec=vms_vax_vec ;; @@ -1148,6 +1285,11 @@ case "${targ}" in targ_defvec=bfd_elf32_xstormy16_vec ;; + xtensa-*-*) + targ_defvec=bfd_elf32_xtensa_le_vec + targ_selvecs=bfd_elf32_xtensa_be_vec + ;; + z8k*-*-*) targ_defvec=z8kcoff_vec targ_underscore=yes @@ -1190,7 +1332,7 @@ esac # to be used on an arbitrary ELF file for anything other than # relocation information. case "${targ_defvec} ${targ_selvecs}" in - *bfd_elf64*) + *bfd_elf64* | *bfd_elf32_n*mips*) targ_selvecs="${targ_selvecs} bfd_elf64_little_generic_vec bfd_elf64_big_generic_vec bfd_elf32_little_generic_vec bfd_elf32_big_generic_vec" ;; *bfd_elf32*) diff --git a/contrib/binutils/bfd/config.in b/contrib/binutils/bfd/config.in index d13d196..ef9eca4 100644 --- a/contrib/binutils/bfd/config.in +++ b/contrib/binutils/bfd/config.in @@ -1,4 +1,4 @@ -/* config.in. Generated automatically from configure.in by autoheader 2.13. */ +/* config.in. Generated automatically from configure.in by autoheader. */ /* Define if using alloca.c. */ #undef C_ALLOCA @@ -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 @@ -64,6 +61,18 @@ /* Define if you have the fdopen function. */ #undef HAVE_FDOPEN +/* Define if you have the fseeko function. */ +#undef HAVE_FSEEKO + +/* Define if you have the fseeko64 function. */ +#undef HAVE_FSEEKO64 + +/* Define if you have the ftello function. */ +#undef HAVE_FTELLO + +/* Define if you have the ftello64 function. */ +#undef HAVE_FTELLO64 + /* Define if you have the getcwd function. */ #undef HAVE_GETCWD @@ -106,6 +115,9 @@ /* Define if you have the strchr function. */ #undef HAVE_STRCHR +/* Define if you have the strtoull function. */ +#undef HAVE_STRTOULL + /* Define if you have the sysconf function. */ #undef HAVE_SYSCONF @@ -190,6 +202,12 @@ /* Define as 1 if you have gettext and don't want to use GNU gettext. */ #undef HAVE_GETTEXT +/* The number of bytes in type long long */ +#undef SIZEOF_LONG_LONG + +/* The number of bytes in type long */ +#undef SIZEOF_LONG + /* Use b modifier when opening binary files? */ #undef USE_BINARY_FOPEN @@ -262,6 +280,9 @@ /* Name of host specific header file to include in trad-core.c. */ #undef TRAD_HEADER +/* The number of bytes in type off_t */ +#undef SIZEOF_OFF_T + /* Use mmap if it's available? */ #undef USE_MMAP diff --git a/contrib/binutils/bfd/configure b/contrib/binutils/bfd/configure index 2eca955..49516021 100755 --- a/contrib/binutils/bfd/configure +++ b/contrib/binutils/bfd/configure @@ -37,7 +37,7 @@ ac_help="$ac_help --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer" ac_help="$ac_help - --install-libbfd controls installation of libbfd and related headers" + --enable-install-libbfd controls installation of libbfd and related headers" ac_help="$ac_help --disable-nls do not use Native Language Support" ac_help="$ac_help @@ -723,250 +723,51 @@ 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:730: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:760: 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:811: 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:729: checking for strerror in -lcposix" >&5 +ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } -fi - -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:843: 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 854 "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:748: \"$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:885: 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:890: 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:918: 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:950: 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 + + +am__api_version="1.4" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -979,7 +780,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:983: checking for a BSD compatible install" >&5 +echo "configure:784: 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 @@ -1032,7 +833,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:1036: checking whether build environment is sane" >&5 +echo "configure:837: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -1089,7 +890,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:1093: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:894: 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 @@ -1118,7 +919,7 @@ fi PACKAGE=bfd -VERSION=2.13.1 +VERSION=2.15 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; } @@ -1134,21 +935,21 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` -echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:1139: checking for working aclocal" >&5 +echo $ac_n "checking for working aclocal-${am__api_version}""... $ac_c" 1>&6 +echo "configure:940: checking for working aclocal-${am__api_version}" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal +if (aclocal-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal-${am__api_version} echo "$ac_t""found" 1>&6 else - ACLOCAL="$missing_dir/missing aclocal" + ACLOCAL="$missing_dir/missing aclocal-${am__api_version}" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1152: checking for working autoconf" >&5 +echo "configure:953: 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. @@ -1160,21 +961,21 @@ else echo "$ac_t""missing" 1>&6 fi -echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1165: checking for working automake" >&5 +echo $ac_n "checking for working automake-${am__api_version}""... $ac_c" 1>&6 +echo "configure:966: checking for working automake-${am__api_version}" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. -if (automake --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake +if (automake-${am__api_version} --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake-${am__api_version} echo "$ac_t""found" 1>&6 else - AUTOMAKE="$missing_dir/missing automake" + AUTOMAKE="$missing_dir/missing automake-${am__api_version}" echo "$ac_t""missing" 1>&6 fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1178: checking for working autoheader" >&5 +echo "configure:979: 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. @@ -1187,7 +988,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1191: checking for working makeinfo" >&5 +echo "configure:992: 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. @@ -1201,19 +1002,18 @@ fi # Uncomment the next line to remove the date from the reported bfd version -# is_release=y +#is_release=y bfd_version=`echo "${VERSION}" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$/\1\2\3\4\5/'` bfd_version_string="\"${VERSION}\"" -bfd_version_date=`sed -e 's/.*DATE //' < ${srcdir}/version.h` if test x${is_release} = x; then + bfd_version_date=`sed -n -e 's/.*DATE //p' < ${srcdir}/version.h` bfd_version_string="\"${VERSION} ${bfd_version_date}\"" fi - if test $host != $build; then ac_tool_prefix=${host_alias}- else @@ -1223,7 +1023,7 @@ fi # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1227: checking for $ac_word" >&5 +echo "configure:1027: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1255,7 +1055,7 @@ fi # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1259: checking for $ac_word" >&5 +echo "configure:1059: 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 @@ -1287,7 +1087,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1291: checking for $ac_word" >&5 +echo "configure:1091: 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 @@ -1390,6 +1190,228 @@ else enable_fast_install=yes fi +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1197: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1227: 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:1278: 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:1310: 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 1321 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:1326: \"$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:1352: 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:1357: 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:1385: 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" @@ -1402,7 +1424,7 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1406: checking for ld used by GCC" >&5 +echo "configure:1428: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1432,10 +1454,10 @@ echo "configure:1406: 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:1436: checking for GNU ld" >&5 +echo "configure:1458: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1439: checking for non-GNU ld" >&5 +echo "configure:1461: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1470,7 +1492,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:1474: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1496: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1487,7 +1509,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1491: checking for $LD option to reload object files" >&5 +echo "configure:1513: 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 @@ -1499,7 +1521,7 @@ 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:1503: checking for BSD-compatible nm" >&5 +echo "configure:1525: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1537,7 +1559,7 @@ NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1541: checking whether ln -s works" >&5 +echo "configure:1563: 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 @@ -1558,7 +1580,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1562: checking how to recognise dependant libraries" >&5 +echo "configure:1584: 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 @@ -1668,7 +1690,7 @@ irix5* | irix6*) # This must be Linux ELF. linux-gnu*) case $host_cpu in - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) + alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM @@ -1731,13 +1753,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1735: checking for object suffix" >&5 +echo "configure:1757: 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:1741: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1763: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1757,7 +1779,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1761: checking for executable suffix" >&5 +echo "configure:1783: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1767,10 +1789,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1771: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.$ac_ext | *.c | *.o | *.obj) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -1794,7 +1816,7 @@ 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:1798: checking for ${ac_tool_prefix}file" >&5 +echo "configure:1820: 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 @@ -1856,7 +1878,7 @@ 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:1860: checking for file" >&5 +echo "configure:1882: 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 @@ -1927,7 +1949,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1931: checking for $ac_word" >&5 +echo "configure:1953: 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 @@ -1959,7 +1981,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1963: checking for $ac_word" >&5 +echo "configure:1985: 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 @@ -1994,7 +2016,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1998: checking for $ac_word" >&5 +echo "configure:2020: 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 @@ -2026,7 +2048,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2030: checking for $ac_word" >&5 +echo "configure:2052: 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 @@ -2093,8 +2115,21 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 2097 "configure"' > conftest.$ac_ext - if { (eval echo configure:2098: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 2119 "configure"' > conftest.$ac_ext + if { (eval echo configure:2120: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" @@ -2106,6 +2141,7 @@ case $host in LD="${LD-ld} -64" ;; esac + fi fi rm -rf conftest* ;; @@ -2113,7 +2149,7 @@ case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo configure:2117: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:2153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *ELF-32*) HPUX_IA64_MODE="32" @@ -2131,7 +2167,7 @@ ia64-*-hpux*) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2135: checking whether the C compiler needs -belf" >&5 +echo "configure:2171: 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 @@ -2144,14 +2180,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2191: \"$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 @@ -2327,7 +2363,7 @@ if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then fi fi WARN_CFLAGS="" -if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then +if test "x${build_warnings}" != x && test "x$GCC" = xyes ; then WARN_CFLAGS="${build_warnings}" fi @@ -2341,7 +2377,7 @@ if test -z "$target" ; then fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:2345: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:2381: 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" @@ -2364,13 +2400,13 @@ fi echo $ac_n "checking whether to install libbfd""... $ac_c" 1>&6 -echo "configure:2368: checking whether to install libbfd" >&5 +echo "configure:2404: checking whether to install libbfd" >&5 # Check whether --enable-install-libbfd or --disable-install-libbfd was given. if test "${enable_install_libbfd+set}" = set; then enableval="$enable_install_libbfd" install_libbfd_p=$enableval else - if test "${host}" = "${target}" -o "$enable_shared" = "yes"; then + if test "${host}" = "${target}" || test "$enable_shared" = "yes"; then install_libbfd_p=yes else install_libbfd_p=no @@ -2401,7 +2437,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:2405: checking for executable suffix" >&5 +echo "configure:2441: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2411,10 +2447,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:2415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:2451: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.$ac_ext | *.c | *.o | *.obj) ;; + *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -2441,7 +2477,7 @@ bfd_default_target_size=32 # 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:2445: checking for $ac_word" >&5 +echo "configure:2481: 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 @@ -2471,7 +2507,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:2475: checking for $ac_word" >&5 +echo "configure:2511: 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 @@ -2522,7 +2558,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:2526: checking for $ac_word" >&5 +echo "configure:2562: 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 @@ -2554,7 +2590,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2558: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2594: 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. @@ -2565,12 +2601,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2569 "configure" +#line 2605 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2574: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2610: \"$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 @@ -2596,12 +2632,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:2600: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2636: 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:2605: checking whether we are using GNU C" >&5 +echo "configure:2641: 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 @@ -2610,7 +2646,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2614: \"$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:2650: \"$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 @@ -2629,7 +2665,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:2633: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2669: 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 @@ -2661,9 +2697,9 @@ else fi -ALL_LINGUAS="fr tr ja es sv da" +ALL_LINGUAS="fr tr ja es sv da zh_CN ro" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2667: checking how to run the C preprocessor" >&5 +echo "configure:2703: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2678,13 +2714,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:2688: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2724: \"$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 : @@ -2695,13 +2731,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:2705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2741: \"$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 : @@ -2712,13 +2748,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:2722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2758: \"$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 : @@ -2745,7 +2781,7 @@ echo "$ac_t""$CPP" 1>&6 # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2749: checking for $ac_word" >&5 +echo "configure:2785: 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 @@ -2773,12 +2809,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2777: checking for ANSI C header files" >&5 +echo "configure:2813: 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 @@ -2786,7 +2822,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2790: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2826: \"$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* @@ -2803,7 +2839,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 @@ -2821,7 +2857,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 @@ -2842,7 +2878,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2853,7 +2889,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2877,12 +2913,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2881: checking for working const" >&5 +echo "configure:2917: 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:2971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2952,21 +2988,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2956: checking for inline" >&5 +echo "configure:2992: 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:3006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2992,12 +3028,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2996: checking for off_t" >&5 +echo "configure:3032: 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 @@ -3025,12 +3061,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3029: checking for size_t" >&5 +echo "configure:3065: 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 @@ -3060,19 +3096,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:3064: checking for working alloca.h" >&5 +echo "configure:3100: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3112: \"$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 @@ -3093,12 +3129,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3097: checking for alloca" >&5 +echo "configure:3133: 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:3166: \"$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 @@ -3158,12 +3194,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3162: checking whether alloca needs Cray hooks" >&5 +echo "configure:3198: 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:3192: checking for $ac_func" >&5 +echo "configure:3228: 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:3256: \"$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 @@ -3243,7 +3279,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3247: checking stack direction for C alloca" >&5 +echo "configure:3283: 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 @@ -3251,7 +3287,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:3310: \"$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 @@ -3291,21 +3327,21 @@ EOF fi -for ac_hdr in unistd.h +for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3299: checking for $ac_hdr" >&5 +echo "configure:3335: 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:3309: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3345: \"$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* @@ -3334,12 +3370,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3338: checking for $ac_func" >&5 +echo "configure:3374: 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:3402: \"$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 @@ -3387,7 +3423,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3391: checking for working mmap" >&5 +echo "configure:3427: 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 @@ -3395,7 +3431,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext < #include +#if HAVE_SYS_TYPES_H +# include +#endif + +#if HAVE_STDLIB_H +# include +#endif + +#if HAVE_SYS_STAT_H +# include +#endif + +#if HAVE_UNISTD_H +# include +#endif + /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -3535,7 +3584,7 @@ main() } EOF -if { (eval echo configure:3539: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3588: \"$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 @@ -3563,17 +3612,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:3567: checking for $ac_hdr" >&5 +echo "configure:3616: 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:3577: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3626: \"$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* @@ -3603,12 +3652,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3607: checking for $ac_func" >&5 +echo "configure:3656: 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:3684: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3660,12 +3709,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3664: checking for $ac_func" >&5 +echo "configure:3713: 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:3741: \"$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 @@ -3722,19 +3771,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3726: checking for LC_MESSAGES" >&5 +echo "configure:3775: 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:3738: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3787: \"$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 @@ -3755,7 +3804,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3759: checking whether NLS is requested" >&5 +echo "configure:3808: 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" @@ -3775,7 +3824,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3779: checking whether included gettext is requested" >&5 +echo "configure:3828: 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" @@ -3794,17 +3843,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3798: checking for libintl.h" >&5 +echo "configure:3847: 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:3808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3857: \"$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* @@ -3821,19 +3870,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:3825: checking for gettext in libc" >&5 +echo "configure:3874: 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:3837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* gt_cv_func_gettext_libc=yes else @@ -3849,7 +3898,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:3853: checking for bindtextdomain in -lintl" >&5 +echo "configure:3902: 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 @@ -3857,7 +3906,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:3921: \"$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 @@ -3884,19 +3933,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:3888: checking for gettext in libintl" >&5 +echo "configure:3937: 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:3949: \"$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 @@ -3924,7 +3973,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:3928: checking for $ac_word" >&5 +echo "configure:3977: 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 @@ -3958,12 +4007,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3962: checking for $ac_func" >&5 +echo "configure:4011: 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:4039: \"$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 @@ -4013,7 +4062,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:4017: checking for $ac_word" >&5 +echo "configure:4066: 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 @@ -4049,7 +4098,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:4053: checking for $ac_word" >&5 +echo "configure:4102: 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 @@ -4081,7 +4130,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4121,7 +4170,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:4125: checking for $ac_word" >&5 +echo "configure:4174: 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 @@ -4155,7 +4204,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:4159: checking for $ac_word" >&5 +echo "configure:4208: 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 @@ -4191,7 +4240,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:4195: checking for $ac_word" >&5 +echo "configure:4244: 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 @@ -4281,7 +4330,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4285: checking for catalogs to be installed" >&5 +echo "configure:4334: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4309,17 +4358,17 @@ echo "configure:4285: 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:4313: checking for linux/version.h" >&5 +echo "configure:4362: 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:4323: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4372: \"$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* @@ -4397,7 +4446,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:4401: checking for a BSD compatible install" >&5 +echo "configure:4450: 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 @@ -4451,21 +4500,141 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' BFD_HOST_64BIT_LONG=0 +BFD_HOST_LONG_LONG=0 BFD_HOST_64_BIT_DEFINED=0 BFD_HOST_64_BIT= BFD_HOST_U_64_BIT= -if test "x${HOST_64BIT_TYPE}" = "xlong"; then + +echo $ac_n "checking for long long""... $ac_c" 1>&6 +echo "configure:4510: checking for long long" >&5 +if eval "test \"`echo '$''{'bfd_cv_has_long_long'+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* + bfd_cv_has_long_long=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + bfd_cv_has_long_long=no +fi +rm -f conftest* +fi + +echo "$ac_t""$bfd_cv_has_long_long" 1>&6 +if test $bfd_cv_has_long_long = yes; then + BFD_HOST_LONG_LONG=1 + echo $ac_n "checking size of long long""... $ac_c" 1>&6 +echo "configure:4538: checking size of long long" >&5 +if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < + + +int main() { +switch (0) case 0: case (sizeof (long long) == $ac_size):; +; return 0; } +EOF +if { (eval echo configure:4554: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_long_long=$ac_size +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + if test x$ac_cv_sizeof_long_long != x ; then break; fi +done + +fi + +if test x$ac_cv_sizeof_long_long = x ; then + { echo "configure: error: cannot determine a size for long long" 1>&2; exit 1; } +fi +echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6 +cat >> confdefs.h <&6 +echo "configure:4579: checking size of long" >&5 +if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < + + +int main() { +switch (0) case 0: case (sizeof (long) == $ac_size):; +; return 0; } +EOF +if { (eval echo configure:4595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_long=$ac_size +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + if test x$ac_cv_sizeof_long != x ; then break; fi +done + +fi + +if test x$ac_cv_sizeof_long = x ; then + { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; } +fi +echo "$ac_t""$ac_cv_sizeof_long" 1>&6 +cat >> confdefs.h <&6 -echo "configure:4484: checking for build system executable suffix" >&5 +echo "configure:4653: 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 @@ -4508,17 +4677,17 @@ for ac_hdr in stddef.h string.h strings.h stdlib.h time.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4512: checking for $ac_hdr" >&5 +echo "configure:4681: 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:4522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4691: \"$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* @@ -4548,17 +4717,17 @@ for ac_hdr in fcntl.h sys/file.h sys/time.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4552: checking for $ac_hdr" >&5 +echo "configure:4721: 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:4562: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4731: \"$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* @@ -4585,12 +4754,12 @@ fi done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:4589: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:4758: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -4599,7 +4768,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:4603: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -4624,12 +4793,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:4628: checking for $ac_hdr that defines DIR" >&5 +echo "configure:4797: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include <$ac_hdr> @@ -4637,7 +4806,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:4641: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -4662,7 +4831,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:4666: checking for opendir in -ldir" >&5 +echo "configure:4835: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4670,7 +4839,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4854: \"$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 @@ -4703,7 +4872,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:4707: checking for opendir in -lx" >&5 +echo "configure:4876: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4711,7 +4880,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4895: \"$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 @@ -4747,12 +4916,67 @@ fi for ac_func in fcntl getpagesize setitimer sysconf fdopen getuid getgid do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4751: checking for $ac_func" >&5 +echo "configure:4920: 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 < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:4948: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +for ac_func in strtoull +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:4975: 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:5003: \"$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 @@ -4810,12 +5034,12 @@ EOF esac echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4814: checking whether strstr must be declared" >&5 +echo "configure:5038: 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 < @@ -4836,7 +5060,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4840: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5064: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4857,12 +5081,12 @@ EOF fi echo $ac_n "checking whether malloc must be declared""... $ac_c" 1>&6 -echo "configure:4861: checking whether malloc must be declared" >&5 +echo "configure:5085: checking whether malloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_malloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4883,7 +5107,7 @@ int main() { char *(*pfn) = (char *(*)) malloc ; return 0; } EOF -if { (eval echo configure:4887: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5111: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_malloc=no else @@ -4904,12 +5128,12 @@ EOF fi echo $ac_n "checking whether realloc must be declared""... $ac_c" 1>&6 -echo "configure:4908: checking whether realloc must be declared" >&5 +echo "configure:5132: checking whether realloc must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_realloc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4930,7 +5154,7 @@ int main() { char *(*pfn) = (char *(*)) realloc ; return 0; } EOF -if { (eval echo configure:4934: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_realloc=no else @@ -4951,12 +5175,12 @@ EOF fi echo $ac_n "checking whether free must be declared""... $ac_c" 1>&6 -echo "configure:4955: checking whether free must be declared" >&5 +echo "configure:5179: checking whether free must be declared" >&5 if eval "test \"`echo '$''{'bfd_cv_decl_needed_free'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -4977,7 +5201,7 @@ int main() { char *(*pfn) = (char *(*)) free ; return 0; } EOF -if { (eval echo configure:4981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5205: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_free=no else @@ -4998,12 +5222,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:5002: checking whether getenv must be declared" >&5 +echo "configure:5226: 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 < @@ -5024,7 +5248,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:5028: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5252: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -5051,7 +5275,7 @@ COREFLAG= TRAD_HEADER= if test "${target}" = "${host}"; then case "${host}" in - alpha*-*-freebsd*) + alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) COREFILE='' ;; alpha*-*-linux-gnu*) @@ -5062,7 +5286,8 @@ if test "${target}" = "${host}"; then COREFILE=netbsd-core.lo ;; alpha*-*-*) COREFILE=osf-core.lo ;; - arm-*-freebsd*) COREFILE='' ;; + arm-*-freebsd* | arm-*-kfreebsd*-gnu) + COREFILE='' ;; arm-*-netbsd*) COREFILE=netbsd-core.lo ;; arm-*-riscix) COREFILE=trad-core.lo ;; hppa*-*-hpux*) COREFILE=hpux-core.lo ;; @@ -5075,62 +5300,54 @@ if test "${target}" = "${host}"; then TRAD_HEADER='"hosts/i370linux.h"' ;; - i[3456]86-sequent-bsd*) + i[3-7]86-sequent-bsd*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/symmetry.h"' ;; - i[3456]86-sequent-sysv4*) ;; - i[3456]86-sequent-sysv*) + i[3-7]86-sequent-sysv4*) ;; + i[3-7]86-sequent-sysv*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/symmetry.h"' ;; - i[3456]86-*-bsdi) + i[3-7]86-*-bsdi) COREFILE= ;; - i[3456]86-*-bsd* | i[34567]86-*-freebsd[123] | i[34567]86-*-freebsd[123]\.* | i[34567]86-*-freebsd4\.[01234]* | i[34567]86-*-freebsd*aout*) + i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[123] | i[3-7]86-*-freebsd[123]\.* | i[3-7]86-*-freebsd4\.[01234]* | i[3-7]86-*-freebsd*aout*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386bsd.h"' ;; - i[3456]86-*-freebsd*) + i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu) COREFILE='' TRAD_HEADER='"hosts/i386bsd.h"' ;; - i[3456]86-*-netbsd* | i[3456]86-*-openbsd*) + i[3-7]86-*-netbsd* | i[3-7]86-*-knetbsd*-gnu | i[3-7]86-*-openbsd*) COREFILE=netbsd-core.lo ;; - i[3456]86-esix-sysv3*) + i[3-7]86-esix-sysv3*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/esix.h"' ;; - i[3456]86-*-sco3.2v5*) + i[3-7]86-*-sco3.2v5*) COREFILE=sco5-core.lo ;; - i[3456]86-*-sco* | i[3456]86-*-isc*) + i[3-7]86-*-sco* | i[3-7]86-*-isc*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386sco.h"' ;; - i[3456]86-*-mach3*) + i[3-7]86-*-mach3*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386mach3.h"' ;; - i[3456]86-*-linux-gnu*) + i[3-7]86-*-linux-gnu*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386linux.h"' ;; - i[3456]86-*-isc*) COREFILE=trad-core.lo ;; - i[3456]86-*-aix*) COREFILE=aix386-core.lo ;; + i[3-7]86-*-isc*) COREFILE=trad-core.lo ;; + i[3-7]86-*-aix*) COREFILE=aix386-core.lo ;; i860-*-mach3* | i860-*-osf1*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i860mach3.h"' ;; - mips-dec-bsd*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/mipsbsd.h"' - ;; - mips-dec-mach3*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/mipsmach3.h"' - ;; mips-*-netbsd* | mips*-*-openbsd*) COREFILE=netbsd-core.lo ;; @@ -5141,10 +5358,6 @@ if test "${target}" = "${host}"; then mips-sgi-irix4*) COREFILE=irix-core.lo ;; mips-sgi-irix5*) COREFILE=irix-core.lo ;; mips-sgi-irix6*) COREFILE=irix-core.lo ;; - mips-*-mach3*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/mipsmach3.h"' - ;; mips-*-sysv4*) ;; mips-*-sysv* | mips-*-riscos*) COREFILE=trad-core.lo @@ -5211,16 +5424,16 @@ if test "${target}" = "${host}"; then # Not all versions of AIX with -DAIX_CORE_DUMPX_CORE # have c_impl as a member of struct core_dumpx echo $ac_n "checking for c_impl in struct core_dumpx""... $ac_c" 1>&6 -echo "configure:5215: checking for c_impl in struct core_dumpx" >&5 +echo "configure:5428: checking for c_impl in struct core_dumpx" >&5 cat > conftest.$ac_ext < int main() { struct core_dumpx c; c.c_impl = 0; ; return 0; } EOF -if { (eval echo configure:5224: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5437: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_ST_C_IMPL 1 @@ -5240,7 +5453,8 @@ rm -f conftest* powerpc-*-aix4*) COREFILE=rs6000-core.lo ;; powerpc-*-aix*) COREFILE=rs6000-core.lo ;; powerpc-*-beos*) ;; - powerpc-*-freebsd*) COREFILE='' ;; + powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu) + COREFILE='' ;; powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;; powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;; s390*-*-*) COREFILE=trad-core.lo ;; @@ -5252,7 +5466,9 @@ rm -f conftest* COREFILE=trad-core.lo TRAD_HEADER='"hosts/tahoe.h"' ;; - vax-*-netbsd*) COREFILE=netbsd-core.lo ;; + vax-*-netbsd* | vax-*-openbsd*) + COREFILE=netbsd-core.lo + ;; vax-*-ultrix2*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxult2.h"' @@ -5261,11 +5477,17 @@ rm -f conftest* COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxult2.h"' ;; + vax-*-linux-gnu*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/vaxlinux.h"' + ;; vax-*-*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxbsd.h"' ;; - x86_64-*-netbsd*) COREFILE=netbsd-core.lo ;; + x86_64-*-netbsd* | x86_64-*-openbsd*) + COREFILE=netbsd-core.lo + ;; esac case "$COREFILE" in @@ -5288,17 +5510,17 @@ rm -f conftest* do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5292: checking for $ac_hdr" >&5 +echo "configure:5514: 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:5302: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:5524: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -5326,12 +5548,12 @@ done if test "$ac_cv_header_sys_procfs_h" = yes; then echo $ac_n "checking for prstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5330: checking for prstatus_t in sys/procfs.h" >&5 +echo "configure:5552: checking for prstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus_t=yes else @@ -5362,12 +5584,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus_t" 1>&6 echo $ac_n "checking for prstatus32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5366: checking for prstatus32_t in sys/procfs.h" >&5 +echo "configure:5588: checking for prstatus32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prstatus32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5602: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prstatus32_t=yes else @@ -5398,12 +5620,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prstatus32_t" 1>&6 echo $ac_n "checking for prstatus_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5402: checking for prstatus_t.pr_who in sys/procfs.h" >&5 +echo "configure:5624: checking for prstatus_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5638: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who=yes else @@ -5434,12 +5656,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus_t_pr_who" 1>&6 echo $ac_n "checking for prstatus32_t.pr_who in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5438: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 +echo "configure:5660: checking for prstatus32_t.pr_who in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who=yes else @@ -5470,12 +5692,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_prstatus32_t_pr_who" 1>&6 echo $ac_n "checking for pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5474: checking for pstatus_t in sys/procfs.h" >&5 +echo "configure:5696: checking for pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5710: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus_t=yes else @@ -5506,12 +5728,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus_t" 1>&6 echo $ac_n "checking for pxstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5510: checking for pxstatus_t in sys/procfs.h" >&5 +echo "configure:5732: checking for pxstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pxstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5746: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pxstatus_t=yes else @@ -5542,12 +5764,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pxstatus_t" 1>&6 echo $ac_n "checking for pstatus32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5546: checking for pstatus32_t in sys/procfs.h" >&5 +echo "configure:5768: checking for pstatus32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_pstatus32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_pstatus32_t=yes else @@ -5578,12 +5800,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_pstatus32_t" 1>&6 echo $ac_n "checking for prpsinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5582: checking for prpsinfo_t in sys/procfs.h" >&5 +echo "configure:5804: checking for prpsinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5818: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo_t=yes else @@ -5614,12 +5836,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo_t" 1>&6 echo $ac_n "checking for prpsinfo32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5618: checking for prpsinfo32_t in sys/procfs.h" >&5 +echo "configure:5840: checking for prpsinfo32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_prpsinfo32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5854: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_prpsinfo32_t=yes else @@ -5650,12 +5872,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_prpsinfo32_t" 1>&6 echo $ac_n "checking for psinfo_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5654: checking for psinfo_t in sys/procfs.h" >&5 +echo "configure:5876: checking for psinfo_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo_t=yes else @@ -5686,12 +5908,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo_t" 1>&6 echo $ac_n "checking for psinfo32_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5690: checking for psinfo32_t in sys/procfs.h" >&5 +echo "configure:5912: checking for psinfo32_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_psinfo32_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5926: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_psinfo32_t=yes else @@ -5722,12 +5944,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_psinfo32_t" 1>&6 echo $ac_n "checking for lwpstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5726: checking for lwpstatus_t in sys/procfs.h" >&5 +echo "configure:5948: checking for lwpstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5962: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpstatus_t=yes else @@ -5758,12 +5980,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpstatus_t" 1>&6 echo $ac_n "checking for lwpxstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5762: checking for lwpxstatus_t in sys/procfs.h" >&5 +echo "configure:5984: checking for lwpxstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_lwpxstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5998: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_lwpxstatus_t=yes else @@ -5794,12 +6016,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_lwpxstatus_t" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_context in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5798: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 +echo "configure:6020: checking for lwpstatus_t.pr_context in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6034: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context=yes else @@ -5830,12 +6052,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_context" 1>&6 echo $ac_n "checking for lwpstatus_t.pr_reg in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5834: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 +echo "configure:6056: checking for lwpstatus_t.pr_reg in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6070: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg=yes else @@ -5866,12 +6088,12 @@ EOF echo "$ac_t""$bfd_cv_have_sys_procfs_type_member_lwpstatus_t_pr_reg" 1>&6 echo $ac_n "checking for win32_pstatus_t in sys/procfs.h""... $ac_c" 1>&6 -echo "configure:5870: checking for win32_pstatus_t in sys/procfs.h" >&5 +echo "configure:6092: checking for win32_pstatus_t in sys/procfs.h" >&5 if eval "test \"`echo '$''{'bfd_cv_have_sys_procfs_type_win32_pstatus_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:6106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_have_sys_procfs_type_win32_pstatus_t=yes else @@ -5933,7 +6155,7 @@ case "${host}" in fi ;; *) - x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | tail -1` + x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` if test -n "$x"; then WIN32LIBADD="-L../libiberty/pic -liberty" fi @@ -5963,12 +6185,14 @@ fi all_targets=false defvec= selvecs= +assocvecs= selarchs= TDEFINES= for targ in $target $canon_targets do if test "x$targ" = "xall"; then all_targets=true + assocvecs="$assocvecs $targ_defvec $targ_selvecs" else . $srcdir/config.bfd if test "x$targ" = "x$target"; then @@ -5999,6 +6223,17 @@ done selvecs="$f" +# uniq the associated vectors in all the configured targets. +f="" +for i in $assocvecs ; do + case " $f " in + *" $i "*) ;; + *) f="$f $i" ;; + esac +done +assocvecs="$f" + + # uniq the architectures in all the configured targets. f="" for i in $selarchs ; do @@ -6027,8 +6262,6 @@ do aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;; aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;; aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;; - aout_mips_big_vec) tb="$tb mipsbsd.lo aout32.lo" ;; - aout_mips_little_vec) tb="$tb mipsbsd.lo aout32.lo" ;; apollocoff_vec) tb="$tb coff-apollo.lo" ;; arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; @@ -6045,6 +6278,7 @@ do b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;; + bfd_elf32_am33lin_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;; bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; @@ -6057,31 +6291,42 @@ do bfd_elf32_dlx_big_vec) tb="$tb elf32-dlx.lo elf32.lo $elf" ;; bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;; bfd_elf32_frv_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;; + bfd_elf32_frvfdpic_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;; bfd_elf32_h8300_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;; bfd_elf32_hppa_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; - bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386-fbsd.lo elf32.lo $elf" ;; + bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;; bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;; bfd_elf32_ia64_hpux_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf";; + bfd_elf32_ip2k_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;; + bfd_elf32_iq2000_vec) tb="$tb elf32-iq2000.lo elf32.lo $elf" ;; bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; - bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;; - bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32.lo $elf" ;; + bfd_elf32_m32rle_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; + bfd_elf32_m32rlin_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; + bfd_elf32_m32rlelin_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; + bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;; + bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;; bfd_elf32_m68k_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;; bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;; bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;; + bfd_elf32_msp430_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;; + bfd_elf32_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf32_nlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf32_ntradbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf32_ntradlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf32_openrisc_vec) tb="$tb elf32-openrisc.lo elf32.lo $elf" ;; bfd_elf32_or32_big_vec) tb="$tb elf32-or32.lo elf32.lo $elf" ;; bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; @@ -6094,14 +6339,16 @@ do # which needs it but does not list it. Should be fixed in right place. bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; - bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; + bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; + bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shblin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shlin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; @@ -6109,14 +6356,14 @@ do bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;; bfd_elf32_vax_vec) tb="$tb elf32-vax.lo elf32.lo $elf" ;; bfd_elf32_xstormy16_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;; - bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha-fbsd.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf32_xtensa_le_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;; + bfd_elf32_xtensa_be_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;; + bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf64_hppa_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_hppa_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; - bfd_elf64_ia64_aix_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; - bfd_elf64_ia64_aix_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; @@ -6128,8 +6375,10 @@ do bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; - bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;; - bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_sh64lin_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_sh64blin_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; @@ -6181,6 +6430,9 @@ do m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;; m88kbcs_vec) tb="$tb coff-m88k.lo" ;; m88kmach3_vec) tb="$tb m88kmach3.lo aout32.lo" ;; + mach_o_be_vec) tb="$tb mach-o.lo" ;; + mach_o_le_vec) tb="$tb mach-o.lo" ;; + mach_o_fat_vec) tb="$tb mach-o.lo" ;; mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; @@ -6195,6 +6447,8 @@ do or32coff_big_vec) tb="$tb coff-or32.lo cofflink.lo" ;; pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;; pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;; + pef_vec) tb="$tb pef.lo" ;; + pef_xlib_vec) tb="$tb pef.lo" ;; pdp11_aout_vec) tb="$tb pdp11.lo" ;; pmac_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;; ppcboot_vec) tb="$tb ppcboot.lo" ;; @@ -6215,8 +6469,15 @@ do sparclynx_coff_vec) tb="$tb cf-sparclynx.lo lynx-core.lo" ;; sparcnetbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;; sunos_big_vec) tb="$tb sunos.lo aout32.lo" ;; + sym_vec) tb="$tb xsym.lo" ;; tic30_aout_vec) tb="$tb aout-tic30.lo" ;; tic30_coff_vec) tb="$tb coff-tic30.lo" ;; + tic4x_coff0_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff0_beh_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff1_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff1_beh_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff2_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff2_beh_vec) tb="$tb coff-tic4x.lo" ;; tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;; @@ -6286,9 +6547,12 @@ if test x${all_targets} = xtrue ; then selvecs= havevecs= selarchs= + test -n "$assocvecs" && + assocvecs=`echo $assocvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'` else # all_targets is true # Only set these if they will be nonempty, for the clever echo. havevecs= + assocvecs= test -n "$selvecs" && havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'` test -n "$selvecs" && @@ -6302,17 +6566,17 @@ case ${host64}-${target64}-${want64} in wordsize=64 bfd_libs='$(BFD64_LIBS) $(BFD32_LIBS)' all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' - if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then + if test $BFD_HOST_64_BIT_DEFINED = 0; then echo "configure: warning: You have requested a 64 bit BFD configuration, but" 1>&2 echo "configure: warning: your compiler may not have a 64 bit integral type" 1>&2 fi if test -n "$GCC" ; then bad_64bit_gcc=no; echo $ac_n "checking for gcc version with buggy 64-bit support""... $ac_c" 1>&6 -echo "configure:6313: checking for gcc version with buggy 64-bit support" >&5 +echo "configure:6577: checking for gcc version with buggy 64-bit support" >&5 # Add more tests for gcc versions with non-working 64-bit support here. cat > conftest.$ac_ext <&6 +echo "configure:6622: 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 < +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:6650: \"$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 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +if test x"$ac_cv_func_ftello" = xyes -a x"$ac_cv_func_fseeko" = xyes; then + echo $ac_n "checking size of off_t""... $ac_c" 1>&6 +echo "configure:6676: checking size of off_t" >&5 +if eval "test \"`echo '$''{'ac_cv_sizeof_off_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < + + +int main() { +switch (0) case 0: case (sizeof (off_t) == $ac_size):; +; return 0; } +EOF +if { (eval echo configure:6692: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_off_t=$ac_size +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + if test x$ac_cv_sizeof_off_t != x ; then break; fi +done + +fi + +if test x$ac_cv_sizeof_off_t = x ; then + { echo "configure: error: cannot determine a size for off_t" 1>&2; exit 1; } +fi +echo "$ac_t""$ac_cv_sizeof_off_t" 1>&6 +cat >> confdefs.h <&6 +echo "configure:6716: checking file_ptr type" >&5 +bfd_file_ptr="long" +bfd_ufile_ptr="unsigned long" +if test x"$ac_cv_func_ftello64" = xyes -a x"$ac_cv_func_fseeko64" = xyes \ + -o x"${ac_cv_sizeof_off_t}" = x8; then + bfd_file_ptr=BFD_HOST_64_BIT + bfd_ufile_ptr=BFD_HOST_U_64_BIT +fi +echo "$ac_t""$bfd_file_ptr" 1>&6 + + + + tdefaults="" test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}" test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'" +test -n "${assocvecs}" && tdefaults="${tdefaults} -DASSOCIATED_VECS='${assocvecs}'" test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'" test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}" -for ac_hdr in unistd.h +for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:6361: checking for $ac_hdr" >&5 +echo "configure:6741: 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:6371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:6751: \"$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* @@ -6396,12 +6776,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6400: checking for $ac_func" >&5 +echo "configure:6780: 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:6808: \"$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 @@ -6449,7 +6829,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:6453: checking for working mmap" >&5 +echo "configure:6833: 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 @@ -6457,7 +6837,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext < #include +#if HAVE_SYS_TYPES_H +# include +#endif + +#if HAVE_STDLIB_H +# include +#endif + +#if HAVE_SYS_STAT_H +# include +#endif + +#if HAVE_UNISTD_H +# include +#endif + /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -6597,7 +6990,7 @@ main() } EOF -if { (eval echo configure:6601: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:6994: \"$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 @@ -6622,12 +7015,12 @@ fi for ac_func in madvise mprotect do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:6626: checking for $ac_func" >&5 +echo "configure:7019: 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:7047: \"$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 @@ -6783,7 +7176,7 @@ done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "Makefile doc/Makefile bfd-in3.h:bfd-in2.h bfdver.h:version.h po/Makefile.in:po/Make-in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then diff --git a/contrib/binutils/bfd/configure.host b/contrib/binutils/bfd/configure.host index 207e4c0..024ed62 100644 --- a/contrib/binutils/bfd/configure.host +++ b/contrib/binutils/bfd/configure.host @@ -19,51 +19,39 @@ HOST_U_64BIT_TYPE= case "${host}" in -alpha*-*-*) host64=true; HOST_64BIT_TYPE=long ;; - -hppa*64*-*-hpux*) HDEFINES=-DHOST_HPPAHPUX; - host64=true; HOST_64BIT_TYPE=long ;; -hppa*-*-hpux*) HDEFINES=-DHOST_HPPAHPUX ;; +hppa*-*-hpux*) # HP/UX's ftello64 et.al. declarations are only + # visible when _LARGEFILE64_SOURCE is defined. + # Without those declarations, real_ftell et.al. + # get mis-compiled. + HDEFINES="-DHOST_HPPAHPUX -D_LARGEFILE64_SOURCE" ;; hppa*-*-hiux*) HDEFINES=-DHOST_HPPAHPUX ;; -hppa*64*-*-linux*) host64=true; HOST_64BIT_TYPE=long ;; hppa*-*-mpeix*) HDEFINES=-DHOST_HPPAMPEIX ;; hppa*-*-bsd*) HDEFINES=-DHOST_HPPABSD ;; hppa*-*-osf*) HDEFINES=-DHOST_HPPAOSF ;; -ia64-*-linux*) host64=true; HOST_64BIT_TYPE=long ;; -ia64-*-aix*) host64=true; HOST_64BIT_TYPE=long ;; +ia64-*-*) host64=true;; + +# Workaround for limitations on win9x where file contents are +# not zero'd out if you seek past the end and then write. +i[3-7]86-*-mingw32*) HDEFINES=-D__USE_MINGW_FSEEK;; -i[3456]86-sequent-bsd*) HDEFINES=-Dshared=genshared ;; -i[3456]86-sequent-sysv4*) ;; -i[3456]86-sequent-sysv*) HDEFINES=-Dshared=genshared ;; +i[3-7]86-sequent-bsd*) HDEFINES=-Dshared=genshared ;; +i[3-7]86-sequent-sysv4*) ;; +i[3-7]86-sequent-sysv*) HDEFINES=-Dshared=genshared ;; mips*-*-netbsd*) ;; mips*-*-openbsd*) ;; mips*-dec-*) HDEFINES="-G 4" ;; mips*-sgi-irix3*) HDEFINES="-G 4" ;; mips*-sgi-irix4*) HDEFINES="-G 4" ;; -mips*-sgi-irix6*) host64=true - HOST_64BIT_TYPE="long long"; - HOST_U_64BIT_TYPE="unsigned long long"; - ;; -mips64*-*-linux*) host64=true - HOST_64BIT_TYPE="long long"; - HOST_U_64BIT_TYPE="unsigned long long"; - ;; +mips*-sgi-irix6*) host64=true;; +mips64*-*-linux*) host64=true;; mips*-*-sysv4*) ;; mips*-*-sysv*) HDEFINES="-G 4" ;; mips*-*-riscos*) HDEFINES="-G 4" ;; m68*-hp-hpux*) HDEFINES=-DHOST_HP300HPUX ;; -*-*-aix*) HOST_64BIT_TYPE="long long" - HOST_U_64BIT_TYPE="unsigned long long" - ;; - -*-*-solaris*) HOST_64BIT_TYPE="long long" - HOST_U_64BIT_TYPE="unsigned long long" - ;; - *-*-windows*) HOST_64BIT_TYPE=__int64 HOST_U_64BIT_TYPE="unsigned __int64" diff --git a/contrib/binutils/bfd/configure.in b/contrib/binutils/bfd/configure.in index 4db2520..837b753 100644 --- a/contrib/binutils/bfd/configure.in +++ b/contrib/binutils/bfd/configure.in @@ -7,26 +7,20 @@ AC_INIT(libbfd.c) AC_CANONICAL_SYSTEM AC_ISC_POSIX -AM_INIT_AUTOMAKE(bfd, 2.13.1) +AM_INIT_AUTOMAKE(bfd, 2.15) # Uncomment the next line to remove the date from the reported bfd version -# is_release=y +#is_release=y changequote(,)dnl bfd_version=`echo "${VERSION}" | sed -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$/\1\2\3\4\5/'` changequote([,])dnl bfd_version_string="\"${VERSION}\"" -bfd_version_date=`sed -e 's/.*DATE //' < ${srcdir}/version.h` if test x${is_release} = x; then -dnl Sad, but we can't use XSTRING here to pick up the date from version.h -dnl because traditional C doesn't allow it. + bfd_version_date=`sed -n -e 's/.*DATE //p' < ${srcdir}/version.h` bfd_version_string="\"${VERSION} ${bfd_version_date}\"" fi -dnl Since we need to edit bfd-in3.h to get the date for bfd_version_string, -dnl we may as well substitute for bfd_version_date too. That way we don't -dnl need to #include version.h AC_SUBST(bfd_version) -AC_SUBST(bfd_version_date) AC_SUBST(bfd_version_string) dnl These must be called before AM_PROG_LIBTOOL, because it may want @@ -86,7 +80,7 @@ if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then echo "Setting warning flags = $build_warnings" 6>&1 fi])dnl WARN_CFLAGS="" -if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then +if test "x${build_warnings}" != x && test "x$GCC" = xyes ; then WARN_CFLAGS="${build_warnings}" fi AC_SUBST(WARN_CFLAGS) @@ -109,7 +103,7 @@ bfd_default_target_size=32 AC_PROG_CC -ALL_LINGUAS="fr tr ja es sv da" +ALL_LINGUAS="fr tr ja es sv da zh_CN ro" CY_GNU_GETTEXT # Permit host specific settings. @@ -119,17 +113,41 @@ AC_SUBST(HDEFINES) AC_PROG_INSTALL BFD_HOST_64BIT_LONG=0 +BFD_HOST_LONG_LONG=0 BFD_HOST_64_BIT_DEFINED=0 BFD_HOST_64_BIT= BFD_HOST_U_64_BIT= -if test "x${HOST_64BIT_TYPE}" = "xlong"; then + +AC_MSG_CHECKING([for long long]) +AC_CACHE_VAL(bfd_cv_has_long_long, +[AC_TRY_COMPILE(, +[unsigned long long ll = 18446744073709551615ULL;], +bfd_cv_has_long_long=yes, bfd_cv_has_long_long=no)]) +AC_MSG_RESULT($bfd_cv_has_long_long) +if test $bfd_cv_has_long_long = yes; then + BFD_HOST_LONG_LONG=1 + AC_COMPILE_CHECK_SIZEOF(long long) +fi + +AC_COMPILE_CHECK_SIZEOF(long) +if test "x${ac_cv_sizeof_long}" = "x8"; then + host64=true BFD_HOST_64BIT_LONG=1 -elif test "x${HOST_64BIT_TYPE}" != "x"; then + test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long" + test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long" +elif test "x${ac_cv_sizeof_long_long}" = "x8"; then + test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long long" + test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long long" +fi + +if test -n "${HOST_64BIT_TYPE}" -a -n "${HOST_U_64BIT_TYPE}"; then BFD_HOST_64_BIT_DEFINED=1 - BFD_HOST_64_BIT=${HOST_64BIT_TYPE} - BFD_HOST_U_64_BIT=${HOST_U_64BIT_TYPE} + BFD_HOST_64_BIT="${HOST_64BIT_TYPE}" + BFD_HOST_U_64_BIT="${HOST_U_64BIT_TYPE}" fi + AC_SUBST(BFD_HOST_64BIT_LONG) +AC_SUBST(BFD_HOST_LONG_LONG) AC_SUBST(BFD_HOST_64_BIT_DEFINED) AC_SUBST(BFD_HOST_64_BIT) AC_SUBST(BFD_HOST_U_64_BIT) @@ -141,6 +159,7 @@ AC_CHECK_HEADERS(fcntl.h sys/file.h sys/time.h) AC_HEADER_TIME AC_HEADER_DIRENT AC_CHECK_FUNCS(fcntl getpagesize setitimer sysconf fdopen getuid getgid) +AC_CHECK_FUNCS(strtoull) BFD_BINARY_FOPEN @@ -156,7 +175,7 @@ COREFLAG= TRAD_HEADER= if test "${target}" = "${host}"; then case "${host}" in - alpha*-*-freebsd*) + alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) COREFILE='' ;; alpha*-*-linux-gnu*) @@ -167,7 +186,8 @@ if test "${target}" = "${host}"; then COREFILE=netbsd-core.lo ;; alpha*-*-*) COREFILE=osf-core.lo ;; - arm-*-freebsd*) COREFILE='' ;; + arm-*-freebsd* | arm-*-kfreebsd*-gnu) + COREFILE='' ;; arm-*-netbsd*) COREFILE=netbsd-core.lo ;; arm-*-riscix) COREFILE=trad-core.lo ;; hppa*-*-hpux*) COREFILE=hpux-core.lo ;; @@ -181,85 +201,77 @@ if test "${target}" = "${host}"; then ;; changequote(,)dnl - i[3456]86-sequent-bsd*) + i[3-7]86-sequent-bsd*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/symmetry.h"' ;; changequote(,)dnl - i[3456]86-sequent-sysv4*) ;; - i[3456]86-sequent-sysv*) + i[3-7]86-sequent-sysv4*) ;; + i[3-7]86-sequent-sysv*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/symmetry.h"' ;; changequote(,)dnl - i[3456]86-*-bsdi) + i[3-7]86-*-bsdi) changequote([,])dnl COREFILE= ;; changequote(,)dnl - i[3456]86-*-bsd* | i[34567]86-*-freebsd[123] | i[34567]86-*-freebsd[123]\.* | i[34567]86-*-freebsd4\.[01234]* | i[34567]86-*-freebsd*aout*) + i[3-7]86-*-bsd* | i[3-7]86-*-freebsd[123] | i[3-7]86-*-freebsd[123]\.* | i[3-7]86-*-freebsd4\.[01234]* | i[3-7]86-*-freebsd*aout*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386bsd.h"' ;; changequote(,)dnl - i[3456]86-*-freebsd*) + i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu) changequote([,])dnl COREFILE='' TRAD_HEADER='"hosts/i386bsd.h"' ;; changequote(,)dnl - i[3456]86-*-netbsd* | i[3456]86-*-openbsd*) + i[3-7]86-*-netbsd* | i[3-7]86-*-knetbsd*-gnu | i[3-7]86-*-openbsd*) changequote([,])dnl COREFILE=netbsd-core.lo ;; changequote(,)dnl - i[3456]86-esix-sysv3*) + i[3-7]86-esix-sysv3*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/esix.h"' ;; changequote(,)dnl - i[3456]86-*-sco3.2v5*) + i[3-7]86-*-sco3.2v5*) changequote([,])dnl COREFILE=sco5-core.lo ;; changequote(,)dnl - i[3456]86-*-sco* | i[3456]86-*-isc*) + i[3-7]86-*-sco* | i[3-7]86-*-isc*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386sco.h"' ;; changequote(,)dnl - i[3456]86-*-mach3*) + i[3-7]86-*-mach3*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386mach3.h"' ;; changequote(,)dnl - i[3456]86-*-linux-gnu*) + i[3-7]86-*-linux-gnu*) changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/i386linux.h"' ;; changequote(,)dnl - i[3456]86-*-isc*) COREFILE=trad-core.lo ;; - i[3456]86-*-aix*) COREFILE=aix386-core.lo ;; + i[3-7]86-*-isc*) COREFILE=trad-core.lo ;; + i[3-7]86-*-aix*) COREFILE=aix386-core.lo ;; changequote([,])dnl i860-*-mach3* | i860-*-osf1*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/i860mach3.h"' ;; - mips-dec-bsd*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/mipsbsd.h"' - ;; - mips-dec-mach3*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/mipsmach3.h"' - ;; mips-*-netbsd* | mips*-*-openbsd*) COREFILE=netbsd-core.lo ;; @@ -270,10 +282,6 @@ changequote([,])dnl mips-sgi-irix4*) COREFILE=irix-core.lo ;; mips-sgi-irix5*) COREFILE=irix-core.lo ;; mips-sgi-irix6*) COREFILE=irix-core.lo ;; - mips-*-mach3*) - COREFILE=trad-core.lo - TRAD_HEADER='"hosts/mipsmach3.h"' - ;; mips-*-sysv4*) ;; mips-*-sysv* | mips-*-riscos*) COREFILE=trad-core.lo @@ -353,7 +361,8 @@ changequote([,])dnl powerpc-*-aix4*) COREFILE=rs6000-core.lo ;; powerpc-*-aix*) COREFILE=rs6000-core.lo ;; powerpc-*-beos*) ;; - powerpc-*-freebsd*) COREFILE='' ;; + powerpc-*-freebsd* | powerpc-*-kfreebsd*-gnu) + COREFILE='' ;; powerpc-*-netbsd*) COREFILE=netbsd-core.lo ;; powerpc-*-*bsd*) COREFILE=netbsd-core.lo ;; s390*-*-*) COREFILE=trad-core.lo ;; @@ -365,7 +374,9 @@ changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/tahoe.h"' ;; - vax-*-netbsd*) COREFILE=netbsd-core.lo ;; + vax-*-netbsd* | vax-*-openbsd*) + COREFILE=netbsd-core.lo + ;; vax-*-ultrix2*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxult2.h"' @@ -374,11 +385,17 @@ changequote([,])dnl COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxult2.h"' ;; + vax-*-linux-gnu*) + COREFILE=trad-core.lo + TRAD_HEADER='"hosts/vaxlinux.h"' + ;; vax-*-*) COREFILE=trad-core.lo TRAD_HEADER='"hosts/vaxbsd.h"' ;; - x86_64-*-netbsd*) COREFILE=netbsd-core.lo ;; + x86_64-*-netbsd* | x86_64-*-openbsd*) + COREFILE=netbsd-core.lo + ;; esac case "$COREFILE" in @@ -446,7 +463,7 @@ case "${host}" in ;; *) changequote(,)dnl - x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | tail -1` + x=`sed -n -e 's/^[ ]*PICFLAG[ ]*=[ ]*//p' < ../libiberty/Makefile | sed -n '$p'` changequote([,])dnl if test -n "$x"; then WIN32LIBADD="-L../libiberty/pic -liberty" @@ -477,12 +494,14 @@ fi all_targets=false defvec= selvecs= +assocvecs= selarchs= TDEFINES= for targ in $target $canon_targets do if test "x$targ" = "xall"; then all_targets=true + assocvecs="$assocvecs $targ_defvec $targ_selvecs" else . $srcdir/config.bfd if test "x$targ" = "x$target"; then @@ -513,6 +532,17 @@ done selvecs="$f" +# uniq the associated vectors in all the configured targets. +f="" +for i in $assocvecs ; do + case " $f " in + *" $i "*) ;; + *) f="$f $i" ;; + esac +done +assocvecs="$f" + + # uniq the architectures in all the configured targets. f="" for i in $selarchs ; do @@ -541,8 +571,6 @@ do aout0_big_vec) tb="$tb aout0.lo aout32.lo" ;; aout_arm_big_vec) tb="$tb aout-arm.lo aout32.lo" ;; aout_arm_little_vec) tb="$tb aout-arm.lo aout32.lo" ;; - aout_mips_big_vec) tb="$tb mipsbsd.lo aout32.lo" ;; - aout_mips_little_vec) tb="$tb mipsbsd.lo aout32.lo" ;; apollocoff_vec) tb="$tb coff-apollo.lo" ;; arm_epoc_pe_big_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; arm_epoc_pe_little_vec) tb="$tb epoc-pe-arm.lo peigen.lo cofflink.lo " ;; @@ -559,6 +587,7 @@ do b_out_vec_little_host) tb="$tb bout.lo aout32.lo" ;; bfd_efi_app_ia32_vec) tb="$tb efi-app-ia32.lo peigen.lo cofflink.lo" ;; bfd_efi_app_ia64_vec) tb="$tb efi-app-ia64.lo pepigen.lo cofflink.lo"; target_size=64 ;; + bfd_elf32_am33lin_vec) tb="$tb elf32-am33lin.lo elf32.lo $elf" ;; bfd_elf32_avr_vec) tb="$tb elf32-avr.lo elf32.lo $elf" ;; bfd_elf32_big_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_bigarc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; @@ -571,31 +600,42 @@ do bfd_elf32_dlx_big_vec) tb="$tb elf32-dlx.lo elf32.lo $elf" ;; bfd_elf32_fr30_vec) tb="$tb elf32-fr30.lo elf32.lo $elf" ;; bfd_elf32_frv_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;; + bfd_elf32_frvfdpic_vec) tb="$tb elf32-frv.lo elf32.lo $elf" ;; bfd_elf32_h8300_vec) tb="$tb elf32-h8300.lo elf32.lo $elf" ;; bfd_elf32_hppa_linux_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; bfd_elf32_hppa_vec) tb="$tb elf32-hppa.lo elf32.lo $elf" ;; bfd_elf32_i370_vec) tb="$tb elf32-i370.lo elf32.lo $elf" ;; - bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386-fbsd.lo elf32.lo $elf" ;; + bfd_elf32_i386_freebsd_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; bfd_elf32_i386_vec) tb="$tb elf32-i386.lo elf32.lo $elf" ;; bfd_elf32_i860_little_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i860_vec) tb="$tb elf32-i860.lo elf32.lo $elf" ;; bfd_elf32_i960_vec) tb="$tb elf32-i960.lo elf32.lo $elf" ;; bfd_elf32_ia64_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf" ;; bfd_elf32_ia64_hpux_big_vec) tb="$tb elf32-ia64.lo elf32.lo $elf";; + bfd_elf32_ip2k_vec) tb="$tb elf32-ip2k.lo elf32.lo $elf" ;; + bfd_elf32_iq2000_vec) tb="$tb elf32-iq2000.lo elf32.lo $elf" ;; bfd_elf32_little_generic_vec) tb="$tb elf32-gen.lo elf32.lo $elf" ;; bfd_elf32_littlearc_vec) tb="$tb elf32-arc.lo elf32.lo $elf" ;; bfd_elf32_littlearm_oabi_vec) tb="$tb elfarm-oabi.lo elf32.lo $elf" ;; bfd_elf32_littlearm_vec) tb="$tb elfarm-nabi.lo elf32.lo $elf" ;; bfd_elf32_littlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_m32r_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; - bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32.lo $elf" ;; - bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32.lo $elf" ;; + bfd_elf32_m32rle_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; + bfd_elf32_m32rlin_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; + bfd_elf32_m32rlelin_vec) tb="$tb elf32-m32r.lo elf32.lo $elf" ;; + bfd_elf32_m68hc11_vec) tb="$tb elf32-m68hc11.lo elf32-m68hc1x.lo elf32.lo $elf" ;; + bfd_elf32_m68hc12_vec) tb="$tb elf32-m68hc12.lo elf32-m68hc1x.lo elf32.lo $elf" ;; bfd_elf32_m68k_vec) tb="$tb elf32-m68k.lo elf32.lo $elf" ;; bfd_elf32_m88k_vec) tb="$tb elf32-m88k.lo elf32.lo $elf" ;; bfd_elf32_mcore_big_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mcore_little_vec) tb="$tb elf32-mcore.lo elf32.lo $elf" ;; bfd_elf32_mn10200_vec) tb="$tb elf-m10200.lo elf32.lo $elf" ;; bfd_elf32_mn10300_vec) tb="$tb elf-m10300.lo elf32.lo $elf" ;; + bfd_elf32_msp430_vec) tb="$tb elf32-msp430.lo elf32.lo $elf" ;; + bfd_elf32_nbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf32_nlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf32_ntradbigmips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; + bfd_elf32_ntradlittlemips_vec) tb="$tb elfn32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf32_openrisc_vec) tb="$tb elf32-openrisc.lo elf32.lo $elf" ;; bfd_elf32_or32_big_vec) tb="$tb elf32-or32.lo elf32.lo $elf" ;; bfd_elf32_pj_vec) tb="$tb elf32-pj.lo elf32.lo $elf";; @@ -608,14 +648,16 @@ do # which needs it but does not list it. Should be fixed in right place. bfd_elf32_sh64_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; bfd_elf32_sh64l_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; - bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; - bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64-nbsd.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; + bfd_elf32_sh64lin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64blin_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" target_size=64 ;; + bfd_elf32_sh64lnbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; + bfd_elf32_sh64nbsd_vec) tb="$tb elf32-sh64.lo elf32-sh64-com.lo elf32.lo $elf cofflink.lo" ;; bfd_elf32_sh_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shblin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shblin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_shl_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo" ;; - bfd_elf32_shlin_vec) tb="$tb elf32-sh-lin.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; - bfd_elf32_shnbsd_vec) tb="$tb elf32-sh-nbsd.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlin_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shlnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; + bfd_elf32_shnbsd_vec) tb="$tb elf32-sh.lo elf32.lo $elf coff-sh.lo cofflink.lo" ;; bfd_elf32_sparc_vec) tb="$tb elf32-sparc.lo elf32.lo $elf" ;; bfd_elf32_tradbigmips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; bfd_elf32_tradlittlemips_vec) tb="$tb elf32-mips.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo" ;; @@ -623,14 +665,14 @@ do bfd_elf32_v850_vec) tb="$tb elf32-v850.lo elf32.lo $elf" ;; bfd_elf32_vax_vec) tb="$tb elf32-vax.lo elf32.lo $elf" ;; bfd_elf32_xstormy16_vec) tb="$tb elf32-xstormy16.lo elf32.lo $elf" ;; - bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha-fbsd.lo elf64.lo $elf"; target_size=64 ;; + bfd_elf32_xtensa_le_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;; + bfd_elf32_xtensa_be_vec) tb="$tb xtensa-isa.lo xtensa-modules.lo elf32-xtensa.lo elf32.lo $elf" ;; + bfd_elf64_alpha_freebsd_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_alpha_vec) tb="$tb elf64-alpha.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_big_generic_vec) tb="$tb elf64-gen.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_bigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf64_hppa_linux_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_hppa_vec) tb="$tb elf64-hppa.lo elf64.lo $elf"; target_size=64 ;; - bfd_elf64_ia64_aix_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; - bfd_elf64_ia64_aix_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_ia64_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_ia64_hpux_big_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_ia64_little_vec) tb="$tb elf64-ia64.lo elf64.lo $elf"; target_size=64 ;; @@ -642,8 +684,10 @@ do bfd_elf64_s390_vec) tb="$tb elf64-s390.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_sh64_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_sh64l_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; - bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;; - bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64-nbsd.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_sh64lin_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_sh64blin_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_sh64lnbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; + bfd_elf64_sh64nbsd_vec) tb="$tb elf64-sh64.lo elf64.lo $elf" target_size=64 ;; bfd_elf64_sparc_vec) tb="$tb elf64-sparc.lo elf64.lo $elf"; target_size=64 ;; bfd_elf64_tradbigmips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; bfd_elf64_tradlittlemips_vec) tb="$tb elf64-mips.lo elf64.lo elfxx-mips.lo elf32.lo $elf ecofflink.lo"; target_size=64 ;; @@ -695,6 +739,9 @@ do m68ksysvcoff_vec) tb="$tb coff-svm68k.lo cofflink.lo" ;; m88kbcs_vec) tb="$tb coff-m88k.lo" ;; m88kmach3_vec) tb="$tb m88kmach3.lo aout32.lo" ;; + mach_o_be_vec) tb="$tb mach-o.lo" ;; + mach_o_le_vec) tb="$tb mach-o.lo" ;; + mach_o_fat_vec) tb="$tb mach-o.lo" ;; mcore_pe_big_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pe_little_vec) tb="$tb pe-mcore.lo peigen.lo cofflink.lo" ;; mcore_pei_big_vec) tb="$tb pei-mcore.lo peigen.lo cofflink.lo" ;; @@ -709,6 +756,8 @@ do or32coff_big_vec) tb="$tb coff-or32.lo cofflink.lo" ;; pc532machaout_vec) tb="$tb pc532-mach.lo aout-ns32k.lo" ;; pc532netbsd_vec) tb="$tb ns32knetbsd.lo aout-ns32k.lo" ;; + pef_vec) tb="$tb pef.lo" ;; + pef_xlib_vec) tb="$tb pef.lo" ;; pdp11_aout_vec) tb="$tb pdp11.lo" ;; pmac_xcoff_vec) tb="$tb coff-rs6000.lo xcofflink.lo" ;; ppcboot_vec) tb="$tb ppcboot.lo" ;; @@ -729,8 +778,15 @@ do sparclynx_coff_vec) tb="$tb cf-sparclynx.lo lynx-core.lo" ;; sparcnetbsd_vec) tb="$tb sparcnetbsd.lo aout32.lo" ;; sunos_big_vec) tb="$tb sunos.lo aout32.lo" ;; + sym_vec) tb="$tb xsym.lo" ;; tic30_aout_vec) tb="$tb aout-tic30.lo" ;; tic30_coff_vec) tb="$tb coff-tic30.lo" ;; + tic4x_coff0_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff0_beh_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff1_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff1_beh_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff2_vec) tb="$tb coff-tic4x.lo" ;; + tic4x_coff2_beh_vec) tb="$tb coff-tic4x.lo" ;; tic54x_coff0_beh_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff0_vec) tb="$tb coff-tic54x.lo" ;; tic54x_coff1_beh_vec) tb="$tb coff-tic54x.lo" ;; @@ -800,9 +856,12 @@ if test x${all_targets} = xtrue ; then selvecs= havevecs= selarchs= + test -n "$assocvecs" && + assocvecs=`echo $assocvecs | sed -e 's/^/\&/' -e 's/ \(.\)/,\&\1/g'` else # all_targets is true # Only set these if they will be nonempty, for the clever echo. havevecs= + assocvecs= test -n "$selvecs" && havevecs=`echo $selvecs | sed -e 's/^/-DHAVE_/' -e 's/ \(.\)/ -DHAVE_\1/g'` test -n "$selvecs" && @@ -816,7 +875,7 @@ case ${host64}-${target64}-${want64} in wordsize=64 bfd_libs='$(BFD64_LIBS) $(BFD32_LIBS)' all_backends='$(BFD64_BACKENDS) $(BFD32_BACKENDS)' - if test -z "$GCC" && test "$BFD_HOST_64BIT_LONG" = "0" && test "$BFD_HOST_64_BIT_DEFINED" = "0"; then + if test $BFD_HOST_64_BIT_DEFINED = 0; then AC_MSG_WARN([You have requested a 64 bit BFD configuration, but]) AC_MSG_WARN([your compiler may not have a 64 bit integral type]) fi @@ -847,9 +906,32 @@ AC_SUBST(bfd_backends) AC_SUBST(bfd_machines) AC_SUBST(bfd_default_target_size) +# Determine the host dependant file_ptr a.k.a. off_t type. In order +# prefer: off64_t - if ftello64 and fseeko64, off_t - if ftello and +# fseeko, long. This assumes that sizeof off_t is .ge. sizeof long. +# Hopefully a reasonable assumption since fseeko et.al. should be +# upward compatible. +AC_CHECK_FUNCS(ftello ftello64 fseeko fseeko64) +if test x"$ac_cv_func_ftello" = xyes -a x"$ac_cv_func_fseeko" = xyes; then + AC_COMPILE_CHECK_SIZEOF(off_t) +fi +AC_MSG_CHECKING([file_ptr type]) +bfd_file_ptr="long" +bfd_ufile_ptr="unsigned long" +if test x"$ac_cv_func_ftello64" = xyes -a x"$ac_cv_func_fseeko64" = xyes \ + -o x"${ac_cv_sizeof_off_t}" = x8; then + bfd_file_ptr=BFD_HOST_64_BIT + bfd_ufile_ptr=BFD_HOST_U_64_BIT +fi +AC_MSG_RESULT($bfd_file_ptr) +AC_SUBST(bfd_file_ptr) +AC_SUBST(bfd_ufile_ptr) + + tdefaults="" test -n "${defvec}" && tdefaults="${tdefaults} -DDEFAULT_VECTOR=${defvec}" test -n "${selvecs}" && tdefaults="${tdefaults} -DSELECT_VECS='${selvecs}'" +test -n "${assocvecs}" && tdefaults="${tdefaults} -DASSOCIATED_VECS='${assocvecs}'" test -n "${selarchs}" && tdefaults="${tdefaults} -DSELECT_ARCHITECTURES='${selarchs}'" test -n "${havevecs}" && tdefaults="${tdefaults} ${havevecs}" AC_SUBST(tdefaults) @@ -862,6 +944,6 @@ case ${want_mmap}+${ac_cv_func_mmap_fixed_mapped} in esac rm -f doc/config.status -AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h po/Makefile.in:po/Make-in, +AC_OUTPUT(Makefile doc/Makefile bfd-in3.h:bfd-in2.h bfdver.h:version.h po/Makefile.in:po/Make-in, [sed -e '/SRC-POTFILES =/r po/SRC-POTFILES' -e '/BLD-POTFILES =/r po/BLD-POTFILES' po/Makefile.in > po/Makefile]) diff --git a/contrib/binutils/bfd/corefile.c b/contrib/binutils/bfd/corefile.c index 2414225..8af4f45 100644 --- a/contrib/binutils/bfd/corefile.c +++ b/contrib/binutils/bfd/corefile.c @@ -1,5 +1,5 @@ /* Core file generic interface routines for BFD. - Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2002 + Copyright 1990, 1991, 1992, 1993, 1994, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. @@ -36,7 +36,7 @@ FUNCTION bfd_core_file_failing_command SYNOPSIS - const char *bfd_core_file_failing_command(bfd *abfd); + const char *bfd_core_file_failing_command (bfd *abfd); DESCRIPTION Return a read-only string explaining which program was running @@ -45,13 +45,13 @@ DESCRIPTION */ const char * -bfd_core_file_failing_command (abfd) - bfd *abfd; +bfd_core_file_failing_command (bfd *abfd) { - if (abfd->format != bfd_core) { - bfd_set_error (bfd_error_invalid_operation); - return NULL; - } + if (abfd->format != bfd_core) + { + bfd_set_error (bfd_error_invalid_operation); + return NULL; + } return BFD_SEND (abfd, _core_file_failing_command, (abfd)); } @@ -60,7 +60,7 @@ FUNCTION bfd_core_file_failing_signal SYNOPSIS - int bfd_core_file_failing_signal(bfd *abfd); + int bfd_core_file_failing_signal (bfd *abfd); DESCRIPTION Returns the signal number which caused the core dump which @@ -68,13 +68,13 @@ DESCRIPTION */ int -bfd_core_file_failing_signal (abfd) - bfd *abfd; +bfd_core_file_failing_signal (bfd *abfd) { - if (abfd->format != bfd_core) { - bfd_set_error (bfd_error_invalid_operation); - return 0; - } + if (abfd->format != bfd_core) + { + bfd_set_error (bfd_error_invalid_operation); + return 0; + } return BFD_SEND (abfd, _core_file_failing_signal, (abfd)); } @@ -83,23 +83,24 @@ FUNCTION core_file_matches_executable_p SYNOPSIS - boolean core_file_matches_executable_p - (bfd *core_bfd, bfd *exec_bfd); + bfd_boolean core_file_matches_executable_p + (bfd *core_bfd, bfd *exec_bfd); DESCRIPTION - Return <> if the core file attached to @var{core_bfd} + Return <> if the core file attached to @var{core_bfd} was generated by a run of the executable file attached to - @var{exec_bfd}, <> otherwise. + @var{exec_bfd}, <> otherwise. */ -boolean -core_file_matches_executable_p (core_bfd, exec_bfd) - bfd *core_bfd, *exec_bfd; -{ - if ((core_bfd->format != bfd_core) || (exec_bfd->format != bfd_object)) { - bfd_set_error (bfd_error_wrong_format); - return false; - } - return BFD_SEND (core_bfd, _core_file_matches_executable_p, - (core_bfd, exec_bfd)); +bfd_boolean +core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd) +{ + if (core_bfd->format != bfd_core || exec_bfd->format != bfd_object) + { + bfd_set_error (bfd_error_wrong_format); + return FALSE; + } + + return BFD_SEND (core_bfd, _core_file_matches_executable_p, + (core_bfd, exec_bfd)); } diff --git a/contrib/binutils/bfd/cpu-alpha.c b/contrib/binutils/bfd/cpu-alpha.c index 93fc69c..c593fc3 100644 --- a/contrib/binutils/bfd/cpu-alpha.c +++ b/contrib/binutils/bfd/cpu-alpha.c @@ -1,5 +1,5 @@ /* BFD support for the Alpha architecture. - Copyright 1992, 1993, 1998, 2000 Free Software Foundation, Inc. + Copyright 1992, 1993, 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -39,13 +39,13 @@ 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. */ +/* These exist only so that we can reasonably disassemble PALcode. */ 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)), - N (64, 64, bfd_mach_alpha_ev6, "alpha:ev6", false, 0), + N (64, 64, bfd_mach_alpha_ev4, "alpha:ev4", FALSE, NN(1)), + N (64, 64, bfd_mach_alpha_ev5, "alpha:ev5", FALSE, NN(2)), + N (64, 64, bfd_mach_alpha_ev6, "alpha:ev6", FALSE, 0), }; const bfd_arch_info_type bfd_alpha_arch = - N (64, 64, 0, "alpha", true, NN(0)); + N (64, 64, 0, "alpha", TRUE, NN(0)); diff --git a/contrib/binutils/bfd/cpu-arc.c b/contrib/binutils/bfd/cpu-arc.c index 204eb48..c69df0e 100644 --- a/contrib/binutils/bfd/cpu-arc.c +++ b/contrib/binutils/bfd/cpu-arc.c @@ -1,5 +1,5 @@ /* BFD support for the ARC processor - Copyright 1994, 1995, 1997, 2001 Free Software Foundation, Inc. + Copyright 1994, 1995, 1997, 2001, 2002 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -40,15 +40,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ static const bfd_arch_info_type arch_info_struct[] = { - ARC ( bfd_mach_arc_5, "arc5", false, &arch_info_struct[1] ), - ARC ( bfd_mach_arc_5, "base", false, &arch_info_struct[2] ), - ARC ( bfd_mach_arc_6, "arc6", false, &arch_info_struct[3] ), - ARC ( bfd_mach_arc_7, "arc7", false, &arch_info_struct[4] ), - ARC ( bfd_mach_arc_8, "arc8", false, NULL ), + ARC ( bfd_mach_arc_5, "arc5", FALSE, &arch_info_struct[1] ), + ARC ( bfd_mach_arc_5, "base", FALSE, &arch_info_struct[2] ), + ARC ( bfd_mach_arc_6, "arc6", FALSE, &arch_info_struct[3] ), + ARC ( bfd_mach_arc_7, "arc7", FALSE, &arch_info_struct[4] ), + ARC ( bfd_mach_arc_8, "arc8", FALSE, NULL ), }; const bfd_arch_info_type bfd_arc_arch = - ARC ( bfd_mach_arc_6, "arc", true, &arch_info_struct[0] ); + ARC ( bfd_mach_arc_6, "arc", TRUE, &arch_info_struct[0] ); /* Utility routines. */ diff --git a/contrib/binutils/bfd/cpu-arm.c b/contrib/binutils/bfd/cpu-arm.c index 9faf648..17889f3 100644 --- a/contrib/binutils/bfd/cpu-arm.c +++ b/contrib/binutils/bfd/cpu-arm.c @@ -1,5 +1,5 @@ /* BFD support for the ARM processor - Copyright 1994, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. + Copyright 1994, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) This file is part of BFD, the Binary File Descriptor library. @@ -21,11 +21,14 @@ #include "bfd.h" #include "sysdep.h" #include "libbfd.h" +#include "libiberty.h" static const bfd_arch_info_type * compatible PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *)); -static boolean scan +static bfd_boolean scan PARAMS ((const struct bfd_arch_info *, const char *)); +static bfd_boolean arm_check_note + PARAMS ((bfd *, char *, bfd_size_type, const char *, char **)); /* This routine is provided two arch_infos and works out which ARM machine which would be compatible with both and returns a pointer @@ -95,10 +98,12 @@ processors[] = { bfd_mach_arm_4, "strongarm"}, { bfd_mach_arm_4, "strongarm110" }, { bfd_mach_arm_4, "strongarm1100" }, - { bfd_mach_arm_XScale, "xscale" } + { bfd_mach_arm_XScale, "xscale" }, + { bfd_mach_arm_ep9312, "ep9312" }, + { bfd_mach_arm_iWMMXt, "iwmmxt" } }; -static boolean +static bfd_boolean scan (info, string) const struct bfd_arch_info * info; const char * string; @@ -107,7 +112,7 @@ scan (info, string) /* First test for an exact match. */ if (strcasecmp (string, info->printable_name) == 0) - return true; + return TRUE; /* Next check for a processor name instead of an Architecture name. */ for (i = sizeof (processors) / sizeof (processors[0]); i--;) @@ -117,13 +122,13 @@ scan (info, string) } if (i != -1 && info->mach == processors [i].mach) - return true; + return TRUE; /* Finally check for the default architecture. */ if (strcasecmp (string, "arm") == 0) return info->the_default; - return false; + return FALSE; } #define N(number, print, default, next) \ @@ -131,17 +136,292 @@ scan (info, string) 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]), - N (bfd_mach_arm_3M, "armv3m", false, & arch_info_struct[4]), - 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, & arch_info_struct[8]), - N (bfd_mach_arm_5TE, "armv5te", false, & arch_info_struct[9]), - N (bfd_mach_arm_XScale, "xscale", false, NULL) + 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]), + N (bfd_mach_arm_3M, "armv3m", FALSE, & arch_info_struct[4]), + 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, & arch_info_struct[8]), + N (bfd_mach_arm_5TE, "armv5te", FALSE, & arch_info_struct[9]), + N (bfd_mach_arm_XScale, "xscale", FALSE, & arch_info_struct[10]), + N (bfd_mach_arm_ep9312, "ep9312", FALSE, & arch_info_struct[11]), + N (bfd_mach_arm_iWMMXt,"iwmmxt", FALSE, NULL) }; const bfd_arch_info_type bfd_arm_arch = - N (0, "arm", true, & arch_info_struct[0]); + N (0, "arm", TRUE, & arch_info_struct[0]); + +/* Support functions used by both the COFF and ELF versions of the ARM port. */ + +/* Handle the merging of the 'machine' settings of input file IBFD + and an output file OBFD. These values actually represent the + different possible ARM architecture variants. + Returns TRUE if they were merged successfully or FALSE otherwise. */ + +bfd_boolean +bfd_arm_merge_machines (ibfd, obfd) + bfd * ibfd; + bfd * obfd; +{ + unsigned int in = bfd_get_mach (ibfd); + unsigned int out = bfd_get_mach (obfd); + + /* If the output architecture is unknown, we now have a value to set. */ + if (out == bfd_mach_arm_unknown) + bfd_set_arch_mach (obfd, bfd_arch_arm, in); + + /* If the input architecture is unknown, + then so must be the output architecture. */ + else if (in == bfd_mach_arm_unknown) + /* FIXME: We ought to have some way to + override this on the command line. */ + bfd_set_arch_mach (obfd, bfd_arch_arm, bfd_mach_arm_unknown); + + /* If they are the same then nothing needs to be done. */ + else if (out == in) + ; + + /* Otherwise the general principle that a earlier architecture can be + linked with a later architecture to produce a binary that will execute + on the later architecture. + + We fail however if we attempt to link a Cirrus EP9312 binary with an + Intel XScale binary, since these architecture have co-processors which + will not both be present on the same physical hardware. */ + else if (in == bfd_mach_arm_ep9312 + && (out == bfd_mach_arm_XScale || out == bfd_mach_arm_iWMMXt)) + { + _bfd_error_handler (_("\ +ERROR: %s is compiled for the EP9312, whereas %s is compiled for XScale"), + bfd_archive_filename (ibfd), + bfd_get_filename (obfd)); + bfd_set_error (bfd_error_wrong_format); + return FALSE; + } + else if (out == bfd_mach_arm_ep9312 + && (in == bfd_mach_arm_XScale || in == bfd_mach_arm_iWMMXt)) + { + _bfd_error_handler (_("\ +ERROR: %s is compiled for the EP9312, whereas %s is compiled for XScale"), + bfd_archive_filename (obfd), + bfd_get_filename (ibfd)); + bfd_set_error (bfd_error_wrong_format); + return FALSE; + } + else if (in > out) + bfd_set_arch_mach (obfd, bfd_arch_arm, in); + /* else + Nothing to do. */ + + return TRUE; +} + +typedef struct +{ + unsigned char namesz[4]; /* Size of entry's owner string. */ + unsigned char descsz[4]; /* Size of the note descriptor. */ + unsigned char type[4]; /* Interpretation of the descriptor. */ + char name[1]; /* Start of the name+desc data. */ +} arm_Note; + +static bfd_boolean +arm_check_note (abfd, buffer, buffer_size, expected_name, description_return) + bfd * abfd; + char * buffer; + bfd_size_type buffer_size; + const char * expected_name; + char ** description_return; +{ + unsigned long namesz; + unsigned long descsz; + unsigned long type; + char * descr; + + if (buffer_size < offsetof (arm_Note, name)) + return FALSE; + + /* We have to extract the values this way to allow for a + host whose endian-ness is different from the target. */ + namesz = bfd_get_32 (abfd, buffer); + descsz = bfd_get_32 (abfd, buffer + offsetof (arm_Note, descsz)); + type = bfd_get_32 (abfd, buffer + offsetof (arm_Note, type)); + descr = buffer + offsetof (arm_Note, name); + + /* Check for buffer overflow. */ + if (namesz + descsz + offsetof (arm_Note, name) > buffer_size) + return FALSE; + + if (expected_name == NULL) + { + if (namesz != 0) + return FALSE; + } + else + { + if (namesz != ((strlen (expected_name) + 1 + 3) & ~3)) + return FALSE; + + if (strcmp (descr, expected_name) != 0) + return FALSE; + + descr += (namesz + 3) & ~3; + } + + /* FIXME: We should probably check the type as well. */ + + if (description_return != NULL) + * description_return = descr; + + return TRUE; +} + +#define NOTE_ARCH_STRING "arch: " + +bfd_boolean +bfd_arm_update_notes (abfd, note_section) + bfd * abfd; + const char * note_section; +{ + asection * arm_arch_section; + bfd_size_type buffer_size; + char * buffer; + char * arch_string; + char * expected; + + /* Look for a note section. If one is present check the architecture + string encoded in it, and set it to the current architecture if it is + different. */ + arm_arch_section = bfd_get_section_by_name (abfd, note_section); + + if (arm_arch_section == NULL) + return TRUE; + + buffer_size = arm_arch_section->_raw_size; + if (buffer_size == 0) + return FALSE; + + buffer = bfd_malloc (buffer_size); + if (buffer == NULL) + return FALSE; + + if (! bfd_get_section_contents (abfd, arm_arch_section, buffer, + (file_ptr) 0, buffer_size)) + goto FAIL; + + /* Parse the note. */ + if (! arm_check_note (abfd, buffer, buffer_size, NOTE_ARCH_STRING, & arch_string)) + goto FAIL; + + /* Check the architecture in the note against the architecture of the bfd. */ + switch (bfd_get_mach (abfd)) + { + default: + case bfd_mach_arm_unknown: expected = "unknown"; break; + case bfd_mach_arm_2: expected = "armv2"; break; + case bfd_mach_arm_2a: expected = "armv2a"; break; + case bfd_mach_arm_3: expected = "armv3"; break; + case bfd_mach_arm_3M: expected = "armv3M"; break; + case bfd_mach_arm_4: expected = "armv4"; break; + case bfd_mach_arm_4T: expected = "armv4t"; break; + case bfd_mach_arm_5: expected = "armv5"; break; + case bfd_mach_arm_5T: expected = "armv5t"; break; + case bfd_mach_arm_5TE: expected = "armv5te"; break; + case bfd_mach_arm_XScale: expected = "XScale"; break; + case bfd_mach_arm_ep9312: expected = "ep9312"; break; + case bfd_mach_arm_iWMMXt: expected = "iWMMXt"; break; + } + + if (strcmp (arch_string, expected) != 0) + { + strcpy (buffer + offsetof (arm_Note, name) + ((strlen (NOTE_ARCH_STRING) + 3) & ~3), expected); + + if (! bfd_set_section_contents (abfd, arm_arch_section, buffer, + (file_ptr) 0, buffer_size)) + { + (*_bfd_error_handler) + (_("warning: unable to update contents of %s section in %s"), + note_section, bfd_get_filename (abfd)); + goto FAIL; + } + } + + free (buffer); + return TRUE; + + FAIL: + free (buffer); + return FALSE; +} + + +static struct +{ + const char * string; + unsigned int mach; +} +architectures[] = +{ + { "armv2", bfd_mach_arm_2 }, + { "armv2a", bfd_mach_arm_2a }, + { "armv3", bfd_mach_arm_3 }, + { "armv3M", bfd_mach_arm_3M }, + { "armv4", bfd_mach_arm_4 }, + { "armv4t", bfd_mach_arm_4T }, + { "armv5", bfd_mach_arm_5 }, + { "armv5t", bfd_mach_arm_5T }, + { "armv5te", bfd_mach_arm_5TE }, + { "XScale", bfd_mach_arm_XScale }, + { "ep9312", bfd_mach_arm_ep9312 }, + { "iWMMXt", bfd_mach_arm_iWMMXt } +}; + +/* Extract the machine number stored in a note section. */ +unsigned int +bfd_arm_get_mach_from_notes (abfd, note_section) + bfd * abfd; + const char * note_section; +{ + asection * arm_arch_section; + bfd_size_type buffer_size; + char * buffer; + char * arch_string; + int i; + + /* Look for a note section. If one is present check the architecture + string encoded in it, and set it to the current architecture if it is + different. */ + arm_arch_section = bfd_get_section_by_name (abfd, note_section); + + if (arm_arch_section == NULL) + return bfd_mach_arm_unknown; + + buffer_size = arm_arch_section->_raw_size; + if (buffer_size == 0) + return bfd_mach_arm_unknown; + + buffer = bfd_malloc (buffer_size); + if (buffer == NULL) + return bfd_mach_arm_unknown; + + if (! bfd_get_section_contents (abfd, arm_arch_section, buffer, + (file_ptr) 0, buffer_size)) + goto FAIL; + + /* Parse the note. */ + if (! arm_check_note (abfd, buffer, buffer_size, NOTE_ARCH_STRING, & arch_string)) + goto FAIL; + + /* Interpret the architecture string. */ + for (i = ARRAY_SIZE (architectures); i--;) + if (strcmp (arch_string, architectures[i].string) == 0) + { + free (buffer); + return architectures[i].mach; + } + + FAIL: + free (buffer); + return bfd_mach_arm_unknown; +} diff --git a/contrib/binutils/bfd/cpu-i386.c b/contrib/binutils/bfd/cpu-i386.c index f492827..272c719 100644 --- a/contrib/binutils/bfd/cpu-i386.c +++ b/contrib/binutils/bfd/cpu-i386.c @@ -32,7 +32,7 @@ const bfd_arch_info_type bfd_i386_arch_intel_syntax = "i386:intel", "i386:intel", 3, - true, + TRUE, bfd_default_compatible, bfd_default_scan , 0, @@ -47,7 +47,7 @@ const bfd_arch_info_type bfd_x86_64_arch_intel_syntax = "i386:intel", "i386:x86-64:intel", 3, - true, + TRUE, bfd_default_compatible, bfd_default_scan , &bfd_i386_arch_intel_syntax, @@ -62,7 +62,7 @@ static const bfd_arch_info_type i8086_arch = "i8086", "i8086", 3, - false, + FALSE, bfd_default_compatible, bfd_default_scan , &bfd_x86_64_arch_intel_syntax, @@ -78,7 +78,7 @@ const bfd_arch_info_type bfd_x86_64_arch = "i386", "i386:x86-64", 3, - true, + TRUE, bfd_default_compatible, bfd_default_scan , &i8086_arch, @@ -94,7 +94,7 @@ const bfd_arch_info_type bfd_i386_arch = "i386", "i386", 3, - true, + TRUE, bfd_default_compatible, bfd_default_scan , &bfd_x86_64_arch diff --git a/contrib/binutils/bfd/cpu-ia64-opc.c b/contrib/binutils/bfd/cpu-ia64-opc.c index a228b1c..740c2ee 100644 --- a/contrib/binutils/bfd/cpu-ia64-opc.c +++ b/contrib/binutils/bfd/cpu-ia64-opc.c @@ -1,4 +1,5 @@ -/* Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +/* Copyright 1998, 1999, 2000, 2001, 2002, 2003 + Free Software Foundation, Inc. Contributed by David Mosberger-Tang This file is part of BFD, the Binary File Descriptor library. @@ -161,8 +162,8 @@ 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; + int i, bits = 0, total = 0; + BFD_HOST_64_BIT val = 0, sign; for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) { @@ -172,8 +173,8 @@ ext_imms_scaled (const struct ia64_operand *self, ia64_insn code, total += bits; } /* sign extend: */ - shift = 8*sizeof (val) - total; - val = (val << shift) >> shift; + sign = (BFD_HOST_64_BIT) 1 << (total - 1); + val = (val ^ sign) - sign; *valuep = (val << scale); return 0; @@ -188,10 +189,7 @@ ins_imms (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) 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); + value = ((value & 0xffffffff) ^ 0x80000000) - 0x80000000; return ins_imms_scaled (self, value, code, 0); } @@ -213,10 +211,7 @@ 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 = ((value & 0xffffffff) ^ 0x80000000) - 0x80000000; --value; return ins_imms_scaled (self, value, code, 0); @@ -418,6 +413,7 @@ 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.csd", {{ 0, 0}}, 0, "ar.csd" }, { 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" }, @@ -586,4 +582,7 @@ const struct ia64_operand elf64_ia64_operands[IA64_OPND_COUNT] = "a branch target" }, { REL, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* TGT64 */ "a branch target" }, + + { ABS, ins_const, ext_const, 0, {{0, 0}}, 0, /* LDXMOV */ + "ldxmov target" }, }; diff --git a/contrib/binutils/bfd/cpu-ia64.c b/contrib/binutils/bfd/cpu-ia64.c index 1f36568..2185241 100644 --- a/contrib/binutils/bfd/cpu-ia64.c +++ b/contrib/binutils/bfd/cpu-ia64.c @@ -1,5 +1,5 @@ /* BFD support for the ia64 architecture. - Copyright 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2002 Free Software Foundation, Inc. Contributed by David Mosberger-Tang This file is part of BFD, the Binary File Descriptor library. @@ -32,7 +32,7 @@ const bfd_arch_info_type bfd_ia64_elf32_arch = "ia64", "ia64-elf32", 3, /* log2 of section alignment */ - true, /* the one and only */ + TRUE, /* the one and only */ bfd_default_compatible, bfd_default_scan , 0, @@ -48,7 +48,7 @@ const bfd_arch_info_type bfd_ia64_arch = "ia64", "ia64-elf64", 3, /* log2 of section alignment */ - true, /* the one and only */ + TRUE, /* the one and only */ bfd_default_compatible, bfd_default_scan , &bfd_ia64_elf32_arch, diff --git a/contrib/binutils/bfd/cpu-powerpc.c b/contrib/binutils/bfd/cpu-powerpc.c index 5523669..a4e72d5 100644 --- a/contrib/binutils/bfd/cpu-powerpc.c +++ b/contrib/binutils/bfd/cpu-powerpc.c @@ -41,7 +41,7 @@ powerpc_compatible (a,b) case bfd_arch_powerpc: return bfd_default_compatible (a, b); case bfd_arch_rs6000: - if (a->mach == 0) + if (b->mach == bfd_mach_rs6k) return a; return NULL; } @@ -61,7 +61,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:common64", 3, - true, /* default for 64 bit target */ + TRUE, /* default for 64 bit target */ powerpc_compatible, bfd_default_scan, &bfd_powerpc_archs[1] @@ -77,7 +77,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:common", 3, - false, + FALSE, powerpc_compatible, bfd_default_scan, &bfd_powerpc_archs[2], @@ -93,7 +93,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:common", 3, - true, /* default for 32 bit target */ + TRUE, /* default for 32 bit target */ powerpc_compatible, bfd_default_scan, &bfd_powerpc_archs[1], @@ -109,7 +109,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:common64", 3, - false, + FALSE, powerpc_compatible, bfd_default_scan, &bfd_powerpc_archs[2] @@ -124,7 +124,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:603", 3, - false, /* not the default */ + FALSE, /* not the default */ powerpc_compatible, bfd_default_scan, &bfd_powerpc_archs[3] @@ -138,7 +138,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:EC603e", 3, - false, /* not the default */ + FALSE, /* not the default */ powerpc_compatible, bfd_default_scan, &bfd_powerpc_archs[4] @@ -152,7 +152,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:604", 3, - false, /* not the default */ + FALSE, /* not the default */ powerpc_compatible, bfd_default_scan, &bfd_powerpc_archs[5] @@ -166,7 +166,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:403", 3, - false, /* not the default */ + FALSE, /* not the default */ powerpc_compatible, bfd_default_scan, &bfd_powerpc_archs[6] @@ -180,7 +180,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:601", 3, - false, /* not the default */ + FALSE, /* not the default */ powerpc_compatible, bfd_default_scan, &bfd_powerpc_archs[7] @@ -194,7 +194,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:620", 3, - false, /* not the default */ + FALSE, /* not the default */ powerpc_compatible, bfd_default_scan, &bfd_powerpc_archs[8] @@ -208,7 +208,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:630", 3, - false, /* not the default */ + FALSE, /* not the default */ powerpc_compatible, bfd_default_scan, &bfd_powerpc_archs[9] @@ -222,7 +222,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:a35", 3, - false, /* not the default */ + FALSE, /* not the default */ powerpc_compatible, bfd_default_scan, &bfd_powerpc_archs[10] @@ -236,7 +236,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:rs64ii", 3, - false, /* not the default */ + FALSE, /* not the default */ powerpc_compatible, bfd_default_scan, &bfd_powerpc_archs[11] @@ -250,7 +250,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:rs64iii", 3, - false, /* not the default */ + FALSE, /* not the default */ powerpc_compatible, bfd_default_scan, &bfd_powerpc_archs[12] @@ -264,12 +264,26 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:7400", 3, - false, /* not the default */ + FALSE, /* not the default */ powerpc_compatible, bfd_default_scan, &bfd_powerpc_archs[13] }, { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_e500, + "powerpc", + "powerpc:e500", + 3, + FALSE, + powerpc_compatible, + bfd_default_scan, + &bfd_powerpc_archs[14] + }, + { 32, /* 32 bits in a word */ 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ @@ -278,7 +292,7 @@ const bfd_arch_info_type bfd_powerpc_archs[] = "powerpc", "powerpc:MPC8XX", 3, - false, /* not the default */ + FALSE, /* not the default */ powerpc_compatible, bfd_default_scan, 0 diff --git a/contrib/binutils/bfd/cpu-rs6000.c b/contrib/binutils/bfd/cpu-rs6000.c index 89b9230..d94921f 100644 --- a/contrib/binutils/bfd/cpu-rs6000.c +++ b/contrib/binutils/bfd/cpu-rs6000.c @@ -1,5 +1,6 @@ /* BFD back-end for rs6000 support - Copyright 1990, 1991, 1993, 1995, 2000 Free Software Foundation, Inc. + Copyright 1990, 1991, 1993, 1995, 2000, 2002, 2003 + Free Software Foundation, Inc. FIXME: Can someone provide a transliteration of this name into ASCII? 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 @@ -46,7 +47,7 @@ rs6000_compatible (a,b) case bfd_arch_rs6000: return bfd_default_compatible (a, b); case bfd_arch_powerpc: - if (b->mach == 0) + if (a->mach == bfd_mach_rs6k) return b; return NULL; } @@ -64,7 +65,7 @@ static const bfd_arch_info_type arch_info_struct[] = "rs6000", "rs6000:rs1", 3, - false, /* not the default */ + FALSE, /* not the default */ rs6000_compatible, bfd_default_scan, &arch_info_struct[1] @@ -78,7 +79,7 @@ static const bfd_arch_info_type arch_info_struct[] = "rs6000", "rs6000:rsc", 3, - false, /* not the default */ + FALSE, /* not the default */ rs6000_compatible, bfd_default_scan, &arch_info_struct[2] @@ -92,7 +93,7 @@ static const bfd_arch_info_type arch_info_struct[] = "rs6000", "rs6000:rs2", 3, - false, /* not the default */ + FALSE, /* not the default */ rs6000_compatible, bfd_default_scan, 0 @@ -109,7 +110,7 @@ const bfd_arch_info_type bfd_rs6000_arch = "rs6000", "rs6000:6000", 3, - true, /* the default */ + TRUE, /* the default */ rs6000_compatible, bfd_default_scan, &arch_info_struct[0] diff --git a/contrib/binutils/bfd/cpu-s390.c b/contrib/binutils/bfd/cpu-s390.c index ac0d45e..66fd246 100644 --- a/contrib/binutils/bfd/cpu-s390.c +++ b/contrib/binutils/bfd/cpu-s390.c @@ -33,7 +33,7 @@ const bfd_arch_info_type bfd_s390_64_arch = "s390", "s390:64-bit", 3, /* section alignment power */ - true, /* the default */ + TRUE, /* the default */ bfd_default_compatible, bfd_default_scan, NULL @@ -49,7 +49,7 @@ const bfd_arch_info_type bfd_s390_arch = "s390", "s390:31-bit", 3, /* section alignment power */ - true, /* the default */ + TRUE, /* the default */ bfd_default_compatible, bfd_default_scan, &bfd_s390_64_arch diff --git a/contrib/binutils/bfd/cpu-sparc.c b/contrib/binutils/bfd/cpu-sparc.c index e3b8ecb..3c0eae5 100644 --- a/contrib/binutils/bfd/cpu-sparc.c +++ b/contrib/binutils/bfd/cpu-sparc.c @@ -33,7 +33,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc", "sparc:sparclet", 3, - false, + FALSE, bfd_default_compatible, bfd_default_scan, &arch_info_struct[1], @@ -47,7 +47,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc", "sparc:sparclite", 3, - false, + FALSE, bfd_default_compatible, bfd_default_scan, &arch_info_struct[2], @@ -61,7 +61,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc", "sparc:v8plus", 3, - false, + FALSE, bfd_default_compatible, bfd_default_scan, &arch_info_struct[3], @@ -75,7 +75,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc", "sparc:v8plusa", 3, - false, + FALSE, bfd_default_compatible, bfd_default_scan, &arch_info_struct[4], @@ -89,7 +89,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc", "sparc:sparclite_le", 3, - false, + FALSE, bfd_default_compatible, bfd_default_scan, &arch_info_struct[5], @@ -103,7 +103,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc", "sparc:v9", 3, - false, + FALSE, bfd_default_compatible, bfd_default_scan, &arch_info_struct[6], @@ -117,7 +117,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc", "sparc:v9a", 3, - false, + FALSE, bfd_default_compatible, bfd_default_scan, &arch_info_struct[7], @@ -131,7 +131,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc", "sparc:v8plusb", 3, - false, + FALSE, bfd_default_compatible, bfd_default_scan, &arch_info_struct[8], @@ -145,7 +145,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc", "sparc:v9b", 3, - false, + FALSE, bfd_default_compatible, bfd_default_scan, 0, @@ -162,7 +162,7 @@ const bfd_arch_info_type bfd_sparc_arch = "sparc", "sparc", 3, - true, /* the default */ + TRUE, /* the default */ bfd_default_compatible, bfd_default_scan, &arch_info_struct[0], diff --git a/contrib/binutils/bfd/dep-in.sed b/contrib/binutils/bfd/dep-in.sed index ce8b79b..90a2e6a 100644 --- a/contrib/binutils/bfd/dep-in.sed +++ b/contrib/binutils/bfd/dep-in.sed @@ -18,6 +18,7 @@ s! config.h!!g s! \$(INCDIR)/fopen-[^ ]*\.h!!g s! \$(INCDIR)/ansidecl\.h!!g s! \$(INCDIR)/symcat\.h!!g +s! \.\./intl/libintl\.h!!g s/\\\n */ /g diff --git a/contrib/binutils/bfd/doc/ChangeLog b/contrib/binutils/bfd/doc/ChangeLog index 3d1e30a..fc06933 100644 --- a/contrib/binutils/bfd/doc/ChangeLog +++ b/contrib/binutils/bfd/doc/ChangeLog @@ -1,550 +1,14 @@ -2002-09-23 Daniel Jacobowitz +2004-04-08 Alan Modra - Merge from mainline: - 2002-08-28 John David Anglin - * chew.c (paramstuff, outputdots, perform, bang and usage): Remove - void from function definitions. - -2002-08-13 Alan Modra - - * header.sed: Strip tabs. - -2002-06-08 Alan Modra - - * Makefile.am: Fix quote style in last change. - * Makefile.in: Regenerate. - -2002-06-07 Alan Modra - - * Makefile.am (libbfd.h): Don't use "echo -n". - (libcoff.h, bfd.h): Likewise. - * Makefile.in: Regenerate. - -2002-06-06 Lars Brinkhoff - - * bfdint.texi: Change registry@sco.com to registry@caldera.com. - -2002-06-05 Alan Modra - - * Makefile.am (libbfd.h): Add "Extracted from.." comment. - (libcoff.h, bfd.h): Likewise. - * Makefile.in: Regenerate. - -2002-05-25 Alan Modra - - * chew.c: Use #include "" instead of <> for local header files. - -2002-04-20 Alan Modra - - * Makefile.in: Regenerate. - -2002-02-11 Alan Modra - - * Makefile.in: Regenerate. - -2002-02-01 Alan Modra - - * chew.c (WORD): Eliminate. - -2002-01-31 Ivan Guzvinec - - * Makefile.in: Regenerate. - -2002-01-31 Alan Modra - - * chew.c (courierize): Don't modify @command params. - -2002-01-30 Nick Clifton - - * proto.str (ENUMDOC): Place two spaces between the end of - the text and the closing comment marker. - -2001-10-30 Hans-Peter Nilsson - - * bfdint.texi (BFD target vector miscellaneous): Add - bfd_target_mmo_flavour. - * bfd.texinfo (BFD back ends): Add entry for mmo. - * Makefile.am (DOCFILES): Add mmo.texi. - (SRCDOC): Add mmo.c. - (s-mmo, mmo.texi): New rules. - -2001-10-29 Kazu Hirata - - * bfdsumm.texi: Fix a typo. - -2001-10-26 Nick Clifton - - * bfd.texinfo: Change footer to refer to FSF. Change subtitle - to refer to original creation date. - -2002-01-26 Hans-Peter Nilsson - - * Makefile.am (install): Depend on install-info. - * Makefile.in: Regenerate. - -2001-10-03 Alan Modra - - * Makefile.am (BFD_H_DEP): Add ../version.h. - * Makefile.in: Regenerate. - -2001-10-02 Alan Modra - - * Makefile.in: Regenerate. - -2001-10-01 Alan Modra - - * header.sed: New file, adds header to generated files. - * Makefile.am: Rewrite rules generating libbfd.h, libcoff.h and - bfd.h, using above. Add missing elf.c dependecy for libbfd.h. - * Makefile.in: Regenerate. - -2001-09-21 Alan Modra - - * Makefile.in: Regenerate. - -2001-09-18 Alan Modra - - * bfdint.texi: Replace reference to bfd_read with bfd_bread. - Likewise for bfd_write. - -2001-07-24 Alan Modra - - * Makefile.in: Regenerate. - -2001-06-21 Hans-Peter Nilsson - - * bfdint.texi (BFD relocation functions) : - Mention that the GNU linker is aware of input-output format - restrictions when generating relocatable output. Make new - paragraph for final-link case. - (BFD target vector swap): Fix typo. - -2001-01-25 Kazu Hirata - - * 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. - -2000-04-17 Ben Elliston - - * 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. - -Thu Jul 23 09:36:44 1998 Nick Clifton - - * bfdint.texi (BFD ELF processor required): Add paragraph - describing the necessity to create "include/elf/CPU.h". - -Thu May 7 14:45:43 1998 Ian Lance Taylor - - * Makefile.am (chew.o): Add -I options for intl srcdir and - objdir. - * Makefile.in: Rebuild. - -Mon Apr 27 20:19:24 1998 Ian Lance Taylor - - * bfdint.texi: New file. - * Makefile.am (noinst_TEXINFOS): New variable. - * Makefile.in: Rebuild. - -Mon Apr 13 16:48:56 1998 Ian Lance Taylor - - * Makefile.in: Rebuild. - -Mon Apr 6 14:06:55 1998 Ian Lance Taylor - - * Makefile.am (STAGESTUFF): Remove variable. - (CLEANFILES): Don't remove $(STAGESTUFF). - (DISTCLEANFILES, MAINTAINERCLEANFILES): New variables. - * Makefile.in: Rebuild. - -Fri Mar 27 16:25:25 1998 Ian Lance Taylor - - * chew.c (skip_white_and_starts): Remove unused declaration. - (skip_white_and_stars): Add casts to avoid warnings. - (skip_trailing_newlines, paramstuff, courierize): Likewise. - (bulletize, do_fancy_stuff, iscommand): Likewise. - (kill_bogus_lines, nextword, main): Likewise. - (manglecomments): Comment out. - (outputdots, kill_bogus_lines): Remove unused local variables. - (perform, compile): Likewise. - (courierize): Fully parenthesize expression. - (copy_past_newline): Declare return value. - (print): Change printf format string. - (main): Call usage for an unrecognized option. - -Fri Feb 13 14:37:14 1998 Ian Lance Taylor - - * Makefile.am (AUTOMAKE_OPTIONS): Define. - * Makefile.in: Rebuild. - -Mon Jan 26 15:38:36 1998 Andreas Schwab - - * doc.str (bodytext): Don't output @* at the end. - * chew.c (kill_bogus_lines): Make sure that a period at the - beginning is recognized. - (indent): Don't put indentation at the end. - (copy_past_newline): Expand tabs. - * Makefile.am (s-reloc, s-syms): Depend on doc.str. - * Makefile.in: Rebuild. - -Wed Oct 1 14:41:28 1997 Ian Lance Taylor - - * Makefile.am (libbfd.h): Don't use cpu-h8300.c, cpu-i960.c, or - elfcode.h as input files; they don't contribute anything. - * Makefile.in: Rebuild. - -Fri Aug 15 04:55:15 1997 Doug Evans - - * Makefile.am (libbfd.h, libcoff.h): Invoke $(MKDOC) as ./$(MKDOC). - * Makefile.in: Rebuild. - -Fri Aug 1 12:59:58 1997 Ian Lance Taylor - - * Makefile.am (CC_FOR_BUILD): Don't set explicitly. - * Makefile.in: Rebuild. - -Thu Jul 31 20:00:12 1997 Ian Lance Taylor - - * Makefile.am: New file, based on old Makefile.in. - * Makefile.in: Now built with automake. - -Tue Jul 22 14:44:00 1997 Robert Hoehne - - * Makefile.in: Change stamp-* files to s-* files. Use bfdt.texi - rather than bfd.texi. - (DOCFILES): Change bfd.texi to bfdt.texi. - * bfd.texinfo: Include bfdt.texi, not bfd.texi. - -Mon Jun 16 15:33:15 1997 Ian Lance Taylor - - * Makefile.in (CC, CFLAGS): Substitute from configure script. - From Jeff Makey . - -Tue Apr 15 12:37:41 1997 Ian Lance Taylor - - * Makefile.in (install-info): Use mkinstalldirs to build - $(infodir). - -Tue Apr 8 12:49:46 1997 Ian Lance Taylor - - * Makefile.in (install-info): Permit info files to be in srcdir. - (stamp-*): Add a stamp-X target for each X.texi target. - (*.texi): Just depend upon stamp-X. - (clean): Remove stamp-*. - (distclean): Depend upon mostlyclean. Remove stamp-*. Don't - remove $(DOCFILES). - -Mon Apr 7 15:23:26 1997 Ian Lance Taylor - - * Makefile.in (distclean): Don't remove *.info files. - -Thu Feb 13 20:50:02 1997 Klaus Kaempf (kkaempf@progis.de) - - * makefile.vms: New file. - -Tue Jun 18 18:32:28 1996 Ian Lance Taylor - - * chew.c (kill_bogus_lines): Reset sl when not at the start of a - line. From Uwe Ohse . - -Tue Jan 30 14:10:46 1996 Ian Lance Taylor - - From Ronald F. Guilmette : - * Makefile.in (libbfd.h): Depend upon proto.str. - (libcoff.h, bfd.h): Likewise. - -Fri Nov 3 14:46:48 1995 Fred Fish - - * Makefile.in (SRCDOC, SRCPROT, core.texi, bfd.h): Use corefile.c, - renamed from core.c. - -Wed Nov 1 14:28:23 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 - - * chew.c: Include . - -Fri Oct 6 16:23:34 1995 Ken Raeburn - - Mon Sep 25 22:49:32 1995 Andreas Schwab - - * Makefile.in (Makefile): Only remake this Makefile. - -Wed Oct 4 15:51:05 1995 Ken Raeburn - - * chew.c: Include . - -Tue Sep 12 18:14:50 1995 Ian Lance Taylor - - * Makefile.in (maintainer-clean): New target. - -Thu Aug 31 12:18:43 1995 Ian Lance Taylor - - * Makefile.in (bfd.h): Add additional #endif at end of bfd.h if - __cplusplus is defined. - -Tue Nov 29 16:13:34 1994 Doug Evans - - * chew.c (write_buffer): New argument `f', all callers changed. - (stdout, stderr, print, drop, idrop): New forth words. - * proto.str (COMMENT): New command. - * doc.str (COMMENT): Likewise. - -Mon Sep 12 11:44:17 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * Makefile.in (DOCFILES): Remove ctor.texi. - (IPROTOS): Remove ctor.ip. - (SRCIPROT): Remove $(srcdir)/../ctor.c. - (ctor.texi): Remove target. - (libbfd.h): Remove dependency on $(srcdir)/../ctor.c. Remove - $(MKDOC) run on $(srcdir)/../ctor.c. - * bfd.texinfo (Constructors): Remove section. - -Fri Sep 2 13:33:44 1994 Ken Raeburn (raeburn@cujo.cygnus.com) - - * chew.c: Include assert.h. Added prototypes for most functions. - Changed most uses of int to long. Do bounds checking on the - stacks. Added comment at the beginning documenting most of the - intrinsics. Lots of whitespace changes. Re-ordered some - functions. - (die, check_range, icheck_range): New functions. - (strip_trailing_newlines, print_stack_level): New functions. - (translatecomments): Don't insert tab before "/*". - (iscommand): Minimum command length is now 4. - (nextword): Handle some \-sequences. - (push_addr): Deleted. - (main): Add new intrinsics strip_trailing_newlines and - print_stack_level. Complain at end if stack contains more than - one element, or less. - (remchar): Make sure the string is not empty before chopping off a - character. - - * doc.str, proto.str: Handle new commands SENUM, ENUM, ENUMX, - ENUMEQ, ENUMEQX, ENUMDOC. - -Wed Jan 12 18:37:12 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * bfd.texinfo: Added Linker Functions node. - * Makefile.in (DOCFILES): Added linker.texi. - (SRCDOC): Added linker.c. - (linker.texi): New target. - -Tue Jan 4 10:52:56 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * chew.c: Don't rely on a correct declaration of exit. - (chew_exit): New function which just calls exit. - (main): Use it. - -Mon Jan 3 11:40:40 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * bfd.texinfo: Added Hash Tables node. - * Makefile.in (DOCFILES): Added hash.texi. - (SRCDOC): Added hash.c. - (hash.texi): New target. - -Thu Dec 30 16:57:04 1993 Ken Raeburn (raeburn@cujo.cygnus.com) - - * Makefile.in: Delete all references to seclet.c, since it's just - been deleted. Don't mention hash.c, linker.c, or genlink.h yet, - since they don't contain documentation yet (hint, hint!). - -Fri Nov 5 10:58:53 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * bfd.texinfo: Small cleanups. - -Fri Nov 19 03:46:11 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * Makefile.in (archures.texi): Depends on $(MKDOC). - -Tue Aug 10 14:22:39 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * bfd.texinfo (BFD back end): Don't include elfcode.texi, since - it's empty now and that triggers a makeinfo bug. - -Mon Aug 9 16:27:30 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * bfd.texinfo (BFD back end): New section on ELF, includes - elf.texi and elfcode.texi. - * Makefile.in (DOCFILES): Include elf.texi, elfcode.texi. - (SRCDOC): Include elfcode.h, elf.c. - (elf.texi, elfcode.texi): New intermediate targets. - -Thu Jun 24 13:48:13 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * Makefile.in (.c.o, chew.o): Put CFLAGS last. - * bfdsumm.texi: New file, broken out of bfd.texinfo, to share - with ld.texinfo. - -Mon Jun 14 12:07:07 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com) - - * Makefile.in (install-info): remove parentdir cruft, - -Wed Jun 9 16:00:32 1993 Jim Kingdon (kingdon@cygnus.com) - - * Makefile.in (mostlyclean): Remove chew.o. - -Tue May 25 14:46:58 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * Makefile.in (libbfd.h): Use elfcode.h, not elf32.c. - -Mon May 24 15:50:07 1993 Ken Raeburn (raeburn@cygnus.com) - - * chew.c (compile): Add a couple of missing casts. - -Wed May 12 14:45:14 1993 Ian Lance Taylor (ian@cygnus.com) - - * Makefile.in (CC_FOR_BUILD): New variable, define to be $(CC). - (chew.o, $(MKDOC)): Build using CC_FOR_BUILD rather than CC, since - it must run on the build machine. - -Tue Apr 6 22:38:10 1993 John Gilmore (gnu@cygnus.com) - - * Makefile.in (chew): Don't compile from .c to executable in a - single step; it puts a temporary .o filename into the executable, - which makes multi-stage comparisons fail. Compile chew.c to - chew.o, and link that, which makes identical executables every time. - -Wed Mar 24 17:26:29 1993 david d `zoo' zuhn (zoo at poseidon.cygnus.com) - - * Makefile.in: fix typo (bfd.texinfo not bfd.texino) - -Fri Mar 19 01:13:00 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com) - - * bfd.texinfo: Since BFD version number has been bumped, do same - to "version number" on title page, and elsewhere. Should be - fixed to extract real version number. - -Tue Mar 16 12:15:13 1993 Per Bothner (bothner@rtl.cygnus.com) - - * Makefile.in: Add *clean rules. - -Mon Jan 11 18:43:56 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * Makefile.in (libbfd.h): Removed duplicate init.c and libbfd.c. - Added seclet.c. - (bfd.h): Added dependency on bfd.c and seclet.c. Added seclet.c - to build. - -Thu Dec 17 19:35:43 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * Makefile.in: added dvi target, define and use $(TEXI2DVI) - -Thu Dec 3 17:42:48 1992 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * Makefile.in (TEXIDIR): New variable. - (bfd.dvi): Look for bfd.texinfo in $(srcdir). Generate index. - - * bfd.texinfo: Minor doc fixes. - -Thu Nov 5 03:13:55 1992 John Gilmore (gnu@cygnus.com) - - Cleanup: Replace all uses of EXFUN in the BFD sources, with PARAMS. - - * chew.c (exfunstuff): Eliminate. - (paramstuff): Replace exfunstuff with function to generate PARAMS. - * proto.str: Use paramstuff rather than exfunstuff. - -Mon Aug 17 12:40:32 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * chew.c: various patches provided by Howard Chu. - -Fri Jun 19 18:59:54 1992 John Gilmore (gnu at cygnus.com) - - * Makefile.in (libbfd.h): Add elf.c as a source of prototypes. - -Mon May 11 18:55:59 1992 John Gilmore (gnu at cygnus.com) - - * chew.c: exit() should be declared by config files, not by - portable source code. Its type could be int or void function. - -Mon May 4 13:45:57 1992 K. Richard Pixley (rich@rtl.cygnus.com) - - * Makefile.in: another CFLAGS correction. - -Tue Apr 28 10:21:32 1992 K. Richard Pixley (rich@rtl.cygnus.com) - - * Makefile.in: Do the CFLAGS thing. - -Fri Apr 10 22:34:52 1992 Fred Fish (fnf@cygnus.com) - - * Makefile.in (MINUS_G): Add macro and default to -g. - -Fri Mar 6 18:53:18 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * chew.c: now has -w switch turn on warnings - -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. - -Tue Dec 10 22:11:05 1991 K. Richard Pixley (rich at rtl.cygnus.com) - - * Makefile.in: build chew into the current directory. Complete - the MKDOC macro transition. - -Tue Dec 10 08:26:28 1991 Steve Chamberlain (sac at rtl.cygnus.com) - - * chew.c: don't core dump when can't open file - * Makefile.in: get proto.str from the right place when built in - odd directories - -Tue Dec 10 04:07:25 1991 K. Richard Pixley (rich at rtl.cygnus.com) - - * Makefile.in: infodir belongs in datadir. - -Sat Dec 7 17:01:23 1991 Steve Chamberlain (sac at rtl.cygnus.com) - - * chew.c: Much modified - * proto.str, doc.str: New files for extracting to product - prototypes and documents respectively. - - -Fri Dec 6 22:57:12 1991 K. Richard Pixley (rich at rtl.cygnus.com) - - * Makefile.in: added standards.text support, host/site/target - inclusion hooks, install using INSTALL_DATA rather than cp, - don't echo on install. - -Thu Dec 5 22:46:17 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. + Apply from mainline. + 2004-03-27 Alan Modra + * bfdint.texi: Remove all mention of elflink.h. +For older changes see ChangeLog-9103 Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 version-control: never End: diff --git a/contrib/binutils/bfd/doc/ChangeLog-9103 b/contrib/binutils/bfd/doc/ChangeLog-9103 new file mode 100644 index 0000000..3636ed8 --- /dev/null +++ b/contrib/binutils/bfd/doc/ChangeLog-9103 @@ -0,0 +1,594 @@ +2003-10-15 Andrew Cagney + + * bfdint.texi (BFD target vector symbols): Rename _get_symtab to + _canonicalize_symtab. + +2003-10-08 David Taylor + + * bfd.texinfo: Remove spurious backslash. + +2003-07-04 Josh Baratz + + * Makefile.am (MKDOC rule): Add $(CFLAGS) in case it contains + CC_FOR_BUILD specific switches. + * Makefile.in: Regenerate. + +2003-06-29 Alan Modra + + * chew.c (paramstuff): Don't emit PARAMS. + +2003-02-12 Bob Wilson + + * bfd.texinfo: Fix quotes for texinfo. Make section title + capitalization more consistent. Use @example instead of @lisp. + Replace FDL appendix with include of fdl.texi. + * fdl.texi: New file. + +2002-11-18 Klee Dienes + + * Makefile.am (DOCFILES): Add bfdwin.texi, bfdio.texi. + (PROTOS): Add bfdio.p, bfdwin.p. + (SRCDOC): Add bfdio.c, bfdwin.c. + (SRCPROT): Add bfdio.c, bfdwin.c. + (SRCIPROT): Add bfdio.c, bfdwin.c. + (LIBBFD_H_DEP): Add bfdio.c, bfdwin.c. + (BFD_H_DEP): Add bfdio.c, bfdwin.c. + Add rules for bfdio.texi, bfdwin.text. + * bfd.texinfo: Include bfdio.texi. + +2002-10-14 Alan Modra + + * Makefile.in: Regenerate. + +2002-10-11 Daniel Jacobowitz + + * Makefile.in: Regenerated. + +2002-08-29 John David Anglin + + * chew.c (paramstuff, outputdots, perform, bang and usage): Remove + void from function definitions. + +2002-08-13 Alan Modra + + * header.sed: Strip tabs. + +2002-06-08 Alan Modra + + * Makefile.am: Fix quote style in last change. + * Makefile.in: Regenerate. + +2002-06-07 Alan Modra + + * Makefile.am (libbfd.h): Don't use "echo -n". + (libcoff.h, bfd.h): Likewise. + * Makefile.in: Regenerate. + +2002-06-06 Lars Brinkhoff + + * bfdint.texi: Change registry@sco.com to registry@caldera.com. + +2002-06-05 Alan Modra + + * Makefile.am (libbfd.h): Add "Extracted from.." comment. + (libcoff.h, bfd.h): Likewise. + * Makefile.in: Regenerate. + +2002-05-25 Alan Modra + + * chew.c: Use #include "" instead of <> for local header files. + +2002-04-20 Alan Modra + + * Makefile.in: Regenerate. + +2002-02-11 Alan Modra + + * Makefile.in: Regenerate. + +2002-02-01 Alan Modra + + * chew.c (WORD): Eliminate. + +2002-01-31 Ivan Guzvinec + + * Makefile.in: Regenerate. + +2002-01-31 Alan Modra + + * chew.c (courierize): Don't modify @command params. + +2002-01-30 Nick Clifton + + * proto.str (ENUMDOC): Place two spaces between the end of + the text and the closing comment marker. + +2001-10-30 Hans-Peter Nilsson + + * bfdint.texi (BFD target vector miscellaneous): Add + bfd_target_mmo_flavour. + * bfd.texinfo (BFD back ends): Add entry for mmo. + * Makefile.am (DOCFILES): Add mmo.texi. + (SRCDOC): Add mmo.c. + (s-mmo, mmo.texi): New rules. + +2001-10-29 Kazu Hirata + + * bfdsumm.texi: Fix a typo. + +2001-10-26 Nick Clifton + + * bfd.texinfo: Change footer to refer to FSF. Change subtitle + to refer to original creation date. + +2002-01-26 Hans-Peter Nilsson + + * Makefile.am (install): Depend on install-info. + * Makefile.in: Regenerate. + +2001-10-03 Alan Modra + + * Makefile.am (BFD_H_DEP): Add ../version.h. + * Makefile.in: Regenerate. + +2001-10-02 Alan Modra + + * Makefile.in: Regenerate. + +2001-10-01 Alan Modra + + * header.sed: New file, adds header to generated files. + * Makefile.am: Rewrite rules generating libbfd.h, libcoff.h and + bfd.h, using above. Add missing elf.c dependecy for libbfd.h. + * Makefile.in: Regenerate. + +2001-09-21 Alan Modra + + * Makefile.in: Regenerate. + +2001-09-18 Alan Modra + + * bfdint.texi: Replace reference to bfd_read with bfd_bread. + Likewise for bfd_write. + +2001-07-24 Alan Modra + + * Makefile.in: Regenerate. + +2001-06-21 Hans-Peter Nilsson + + * bfdint.texi (BFD relocation functions) : + Mention that the GNU linker is aware of input-output format + restrictions when generating relocatable output. Make new + paragraph for final-link case. + (BFD target vector swap): Fix typo. + +2001-01-25 Kazu Hirata + + * 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. + +2000-04-17 Ben Elliston + + * bfdint.texi (BFD_JUMP_TABLE macros): Fix typo. + +2000-04-07 Andrew Cagney + + * Makefile.in: Rebuild with current autoconf/automake. + +1999-02-04 Ian Lance Taylor + + * Makefile.in: Rebuild with current autoconf/automake. + +1998-07-23 Nick Clifton + + * bfdint.texi (BFD ELF processor required): Add paragraph + describing the necessity to create "include/elf/CPU.h". + +1998-05-07 Ian Lance Taylor + + * Makefile.am (chew.o): Add -I options for intl srcdir and + objdir. + * Makefile.in: Rebuild. + +1998-04-27 Ian Lance Taylor + + * bfdint.texi: New file. + * Makefile.am (noinst_TEXINFOS): New variable. + * Makefile.in: Rebuild. + +1998-04-13 Ian Lance Taylor + + * Makefile.in: Rebuild. + +1998-04-06 Ian Lance Taylor + + * Makefile.am (STAGESTUFF): Remove variable. + (CLEANFILES): Don't remove $(STAGESTUFF). + (DISTCLEANFILES, MAINTAINERCLEANFILES): New variables. + * Makefile.in: Rebuild. + +1998-03-27 Ian Lance Taylor + + * chew.c (skip_white_and_starts): Remove unused declaration. + (skip_white_and_stars): Add casts to avoid warnings. + (skip_trailing_newlines, paramstuff, courierize): Likewise. + (bulletize, do_fancy_stuff, iscommand): Likewise. + (kill_bogus_lines, nextword, main): Likewise. + (manglecomments): Comment out. + (outputdots, kill_bogus_lines): Remove unused local variables. + (perform, compile): Likewise. + (courierize): Fully parenthesize expression. + (copy_past_newline): Declare return value. + (print): Change printf format string. + (main): Call usage for an unrecognized option. + +1998-02-13 Ian Lance Taylor + + * Makefile.am (AUTOMAKE_OPTIONS): Define. + * Makefile.in: Rebuild. + +1998-01-26 Andreas Schwab + + * doc.str (bodytext): Don't output @* at the end. + * chew.c (kill_bogus_lines): Make sure that a period at the + beginning is recognized. + (indent): Don't put indentation at the end. + (copy_past_newline): Expand tabs. + * Makefile.am (s-reloc, s-syms): Depend on doc.str. + * Makefile.in: Rebuild. + +1997-10-01 Ian Lance Taylor + + * Makefile.am (libbfd.h): Don't use cpu-h8300.c, cpu-i960.c, or + elfcode.h as input files; they don't contribute anything. + * Makefile.in: Rebuild. + +1997-08-15 Doug Evans + + * Makefile.am (libbfd.h, libcoff.h): Invoke $(MKDOC) as ./$(MKDOC). + * Makefile.in: Rebuild. + +1997-08-01 Ian Lance Taylor + + * Makefile.am (CC_FOR_BUILD): Don't set explicitly. + * Makefile.in: Rebuild. + +1997-07-31 Ian Lance Taylor + + * Makefile.am: New file, based on old Makefile.in. + * Makefile.in: Now built with automake. + +1997-07-22 Robert Hoehne + + * Makefile.in: Change stamp-* files to s-* files. Use bfdt.texi + rather than bfd.texi. + (DOCFILES): Change bfd.texi to bfdt.texi. + * bfd.texinfo: Include bfdt.texi, not bfd.texi. + +1997-06-16 Ian Lance Taylor + + * Makefile.in (CC, CFLAGS): Substitute from configure script. + From Jeff Makey . + +1997-04-15 Ian Lance Taylor + + * Makefile.in (install-info): Use mkinstalldirs to build + $(infodir). + +1997-04-08 Ian Lance Taylor + + * Makefile.in (install-info): Permit info files to be in srcdir. + (stamp-*): Add a stamp-X target for each X.texi target. + (*.texi): Just depend upon stamp-X. + (clean): Remove stamp-*. + (distclean): Depend upon mostlyclean. Remove stamp-*. Don't + remove $(DOCFILES). + +1997-04-07 Ian Lance Taylor + + * Makefile.in (distclean): Don't remove *.info files. + +1997-02-13 Klaus Kaempf (kkaempf@progis.de) + + * makefile.vms: New file. + +1996-06-18 Ian Lance Taylor + + * chew.c (kill_bogus_lines): Reset sl when not at the start of a + line. From Uwe Ohse . + +1996-01-30 Ian Lance Taylor + + From Ronald F. Guilmette : + * Makefile.in (libbfd.h): Depend upon proto.str. + (libcoff.h, bfd.h): Likewise. + +1995-11-03 Fred Fish + + * Makefile.in (SRCDOC, SRCPROT, core.texi, bfd.h): Use corefile.c, + renamed from core.c. + +1995-11-01 Manfred Hollstein KS/EF4A 60/1F/110 #40283 + + * chew.c: Include . + +1995-10-06 Ken Raeburn + + Mon Sep 25 22:49:32 1995 Andreas Schwab + + * Makefile.in (Makefile): Only remake this Makefile. + +1995-10-04 Ken Raeburn + + * chew.c: Include . + +1995-09-12 Ian Lance Taylor + + * Makefile.in (maintainer-clean): New target. + +1995-08-31 Ian Lance Taylor + + * Makefile.in (bfd.h): Add additional #endif at end of bfd.h if + __cplusplus is defined. + +1994-11-29 Doug Evans + + * chew.c (write_buffer): New argument `f', all callers changed. + (stdout, stderr, print, drop, idrop): New forth words. + * proto.str (COMMENT): New command. + * doc.str (COMMENT): Likewise. + +1994-09-12 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * Makefile.in (DOCFILES): Remove ctor.texi. + (IPROTOS): Remove ctor.ip. + (SRCIPROT): Remove $(srcdir)/../ctor.c. + (ctor.texi): Remove target. + (libbfd.h): Remove dependency on $(srcdir)/../ctor.c. Remove + $(MKDOC) run on $(srcdir)/../ctor.c. + * bfd.texinfo (Constructors): Remove section. + +1994-09-02 Ken Raeburn (raeburn@cujo.cygnus.com) + + * chew.c: Include assert.h. Added prototypes for most functions. + Changed most uses of int to long. Do bounds checking on the + stacks. Added comment at the beginning documenting most of the + intrinsics. Lots of whitespace changes. Re-ordered some + functions. + (die, check_range, icheck_range): New functions. + (strip_trailing_newlines, print_stack_level): New functions. + (translatecomments): Don't insert tab before "/*". + (iscommand): Minimum command length is now 4. + (nextword): Handle some \-sequences. + (push_addr): Deleted. + (main): Add new intrinsics strip_trailing_newlines and + print_stack_level. Complain at end if stack contains more than + one element, or less. + (remchar): Make sure the string is not empty before chopping off a + character. + + * doc.str, proto.str: Handle new commands SENUM, ENUM, ENUMX, + ENUMEQ, ENUMEQX, ENUMDOC. + +1994-01-12 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * bfd.texinfo: Added Linker Functions node. + * Makefile.in (DOCFILES): Added linker.texi. + (SRCDOC): Added linker.c. + (linker.texi): New target. + +1994-01-04 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * chew.c: Don't rely on a correct declaration of exit. + (chew_exit): New function which just calls exit. + (main): Use it. + +1994-01-03 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * bfd.texinfo: Added Hash Tables node. + * Makefile.in (DOCFILES): Added hash.texi. + (SRCDOC): Added hash.c. + (hash.texi): New target. + +1993-12-30 Ken Raeburn (raeburn@cujo.cygnus.com) + + * Makefile.in: Delete all references to seclet.c, since it's just + been deleted. Don't mention hash.c, linker.c, or genlink.h yet, + since they don't contain documentation yet (hint, hint!). + +1993-11-05 David J. Mackenzie (djm@thepub.cygnus.com) + + * bfd.texinfo: Small cleanups. + +1993-11-19 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * Makefile.in (archures.texi): Depends on $(MKDOC). + +1993-08-10 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * bfd.texinfo (BFD back end): Don't include elfcode.texi, since + it's empty now and that triggers a makeinfo bug. + +1993-08-09 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * bfd.texinfo (BFD back end): New section on ELF, includes + elf.texi and elfcode.texi. + * Makefile.in (DOCFILES): Include elf.texi, elfcode.texi. + (SRCDOC): Include elfcode.h, elf.c. + (elf.texi, elfcode.texi): New intermediate targets. + +1993-06-24 David J. Mackenzie (djm@thepub.cygnus.com) + + * Makefile.in (.c.o, chew.o): Put CFLAGS last. + * bfdsumm.texi: New file, broken out of bfd.texinfo, to share + with ld.texinfo. + +1993-06-14 david d `zoo' zuhn (zoo at rtl.cygnus.com) + + * Makefile.in (install-info): remove parentdir cruft, + +1993-06-09 Jim Kingdon (kingdon@cygnus.com) + + * Makefile.in (mostlyclean): Remove chew.o. + +1993-05-25 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * Makefile.in (libbfd.h): Use elfcode.h, not elf32.c. + +1993-05-24 Ken Raeburn (raeburn@cygnus.com) + + * chew.c (compile): Add a couple of missing casts. + +1993-05-12 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (CC_FOR_BUILD): New variable, define to be $(CC). + (chew.o, $(MKDOC)): Build using CC_FOR_BUILD rather than CC, since + it must run on the build machine. + +1993-04-07 John Gilmore (gnu@cygnus.com) + + * Makefile.in (chew): Don't compile from .c to executable in a + single step; it puts a temporary .o filename into the executable, + which makes multi-stage comparisons fail. Compile chew.c to + chew.o, and link that, which makes identical executables every time. + +1993-03-24 david d `zoo' zuhn (zoo at poseidon.cygnus.com) + + * Makefile.in: fix typo (bfd.texinfo not bfd.texino) + +1993-03-19 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * bfd.texinfo: Since BFD version number has been bumped, do same + to "version number" on title page, and elsewhere. Should be + fixed to extract real version number. + +1993-03-16 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in: Add *clean rules. + +1993-01-11 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * Makefile.in (libbfd.h): Removed duplicate init.c and libbfd.c. + Added seclet.c. + (bfd.h): Added dependency on bfd.c and seclet.c. Added seclet.c + to build. + +1992-12-17 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: added dvi target, define and use $(TEXI2DVI) + +1992-12-03 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * Makefile.in (TEXIDIR): New variable. + (bfd.dvi): Look for bfd.texinfo in $(srcdir). Generate index. + + * bfd.texinfo: Minor doc fixes. + +1992-11-05 John Gilmore (gnu@cygnus.com) + + Cleanup: Replace all uses of EXFUN in the BFD sources, with PARAMS. + + * chew.c (exfunstuff): Eliminate. + (paramstuff): Replace exfunstuff with function to generate PARAMS. + * proto.str: Use paramstuff rather than exfunstuff. + +1992-08-17 Steve Chamberlain (sac@thepub.cygnus.com) + + * chew.c: various patches provided by Howard Chu. + +1992-06-19 John Gilmore (gnu at cygnus.com) + + * Makefile.in (libbfd.h): Add elf.c as a source of prototypes. + +1992-05-11 John Gilmore (gnu at cygnus.com) + + * chew.c: exit() should be declared by config files, not by + portable source code. Its type could be int or void function. + +1992-05-04 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: another CFLAGS correction. + +1992-04-28 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: Do the CFLAGS thing. + +1992-04-11 Fred Fish (fnf@cygnus.com) + + * Makefile.in (MINUS_G): Add macro and default to -g. + +1992-03-06 Steve Chamberlain (sac@thepub.cygnus.com) + + * chew.c: now has -w switch turn on warnings + +1992-02-26 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. + +1991-12-10 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: build chew into the current directory. Complete + the MKDOC macro transition. + +1991-12-10 Steve Chamberlain (sac at rtl.cygnus.com) + + * chew.c: don't core dump when can't open file + * Makefile.in: get proto.str from the right place when built in + odd directories + +1991-12-10 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: infodir belongs in datadir. + +1991-12-07 Steve Chamberlain (sac at rtl.cygnus.com) + + * chew.c: Much modified + * proto.str, doc.str: New files for extracting to product + prototypes and documents respectively. + + +1991-12-06 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: added standards.text support, host/site/target + inclusion hooks, install using INSTALL_DATA rather than cp, + don't echo on install. + +1991-12-05 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. + + +Local Variables: +version-control: never +End: diff --git a/contrib/binutils/bfd/doc/Makefile.am b/contrib/binutils/bfd/doc/Makefile.am index 0787143..4aaa341 100644 --- a/contrib/binutils/bfd/doc/Makefile.am +++ b/contrib/binutils/bfd/doc/Makefile.am @@ -4,13 +4,15 @@ AUTOMAKE_OPTIONS = cygnus DOCFILES = aoutx.texi archive.texi archures.texi \ bfdt.texi cache.texi coffcode.texi \ - core.texi elf.texi elfcode.texi format.texi libbfd.texi \ + core.texi elf.texi elfcode.texi format.texi \ + libbfd.texi bfdwin.texi bfdio.texi \ opncls.texi reloc.texi section.texi \ syms.texi targets.texi init.texi hash.texi linker.texi \ mmo.texi PROTOS = archive.p archures.p bfd.p \ core.p format.p \ + bfdio.p bfdwin.p \ libbfd.p opncls.p reloc.p \ section.p syms.p targets.p \ format.p core.p init.p @@ -22,6 +24,7 @@ IPROTOS = cache.ip libbfd.ip reloc.ip init.ip archures.ip coffcode.ip # you don't need these three: SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \ $(srcdir)/../archures.c $(srcdir)/../bfd.c \ + $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ $(srcdir)/../cache.c $(srcdir)/../coffcode.h \ $(srcdir)/../corefile.c $(srcdir)/../elf.c \ $(srcdir)/../elfcode.h $(srcdir)/../format.c \ @@ -34,11 +37,13 @@ SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \ SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \ $(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \ $(srcdir)/../format.c $(srcdir)/../libbfd.c \ + $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ $(srcdir)/../opncls.c $(srcdir)/../reloc.c \ $(srcdir)/../section.c $(srcdir)/../syms.c \ $(srcdir)/../targets.c $(srcdir)/../init.c SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \ + $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ $(srcdir)/../reloc.c $(srcdir)/../cpu-h8300.c \ $(srcdir)/../cpu-i960.c $(srcdir)/../archures.c \ $(srcdir)/../init.c @@ -50,7 +55,7 @@ info_TEXINFOS = bfd.texinfo MKDOC = chew$(EXEEXT_FOR_BUILD) $(MKDOC): chew.o - $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(LOADLIBES) $(LDFLAGS) + $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS) chew.o: chew.c $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c @@ -143,6 +148,18 @@ s-libbfd: $(MKDOC) $(srcdir)/../libbfd.c $(srcdir)/doc.str touch s-libbfd libbfd.texi: s-libbfd +s-bfdio: $(MKDOC) $(srcdir)/../bfdio.c $(srcdir)/doc.str + ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdio.c >bfdio.tmp + $(srcdir)/../../move-if-change bfdio.tmp bfdio.texi + touch s-bfdio +bfdio.texi: s-bfdio + +s-bfdwin: $(MKDOC) $(srcdir)/../bfdwin.c $(srcdir)/doc.str + ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdwin.c >bfdwin.tmp + $(srcdir)/../../move-if-change bfdwin.tmp bfdwin.texi + touch s-bfdwin +bfdwin.texi: s-bfdwin + s-opncls: $(MKDOC) $(srcdir)/../opncls.c $(srcdir)/doc.str ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../opncls.c >opncls.tmp $(srcdir)/../../move-if-change opncls.tmp opncls.texi @@ -195,6 +212,8 @@ LIBBFD_H_DEP = \ $(srcdir)/../libbfd-in.h \ $(srcdir)/../init.c \ $(srcdir)/../libbfd.c \ + $(srcdir)/../bfdio.c \ + $(srcdir)/../bfdwin.c \ $(srcdir)/../cache.c \ $(srcdir)/../reloc.c \ $(srcdir)/../archures.c \ @@ -239,6 +258,8 @@ BFD_H_DEP = \ $(srcdir)/../init.c \ $(srcdir)/../opncls.c \ $(srcdir)/../libbfd.c \ + $(srcdir)/../bfdio.c \ + $(srcdir)/../bfdwin.c \ $(srcdir)/../section.c \ $(srcdir)/../archures.c \ $(srcdir)/../reloc.c \ @@ -248,6 +269,8 @@ BFD_H_DEP = \ $(srcdir)/../corefile.c \ $(srcdir)/../targets.c \ $(srcdir)/../format.c \ + $(srcdir)/../linker.c \ + $(srcdir)/../simple.c \ $(srcdir)/header.sed \ $(srcdir)/proto.str \ $(srcdir)/../version.h \ diff --git a/contrib/binutils/bfd/doc/Makefile.in b/contrib/binutils/bfd/doc/Makefile.in index f35cc9a..85d6427 100644 --- a/contrib/binutils/bfd/doc/Makefile.in +++ b/contrib/binutils/bfd/doc/Makefile.in @@ -1,6 +1,6 @@ -# Makefile.in generated automatically by automake 1.4 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am -# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -68,6 +68,7 @@ AS = @AS@ BFD_HOST_64BIT_LONG = @BFD_HOST_64BIT_LONG@ BFD_HOST_64_BIT = @BFD_HOST_64_BIT@ BFD_HOST_64_BIT_DEFINED = @BFD_HOST_64_BIT_DEFINED@ +BFD_HOST_LONG_LONG = @BFD_HOST_LONG_LONG@ BFD_HOST_U_64_BIT = @BFD_HOST_U_64_BIT@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ @@ -116,10 +117,11 @@ WIN32LIBADD = @WIN32LIBADD@ all_backends = @all_backends@ bfd_backends = @bfd_backends@ bfd_default_target_size = @bfd_default_target_size@ +bfd_file_ptr = @bfd_file_ptr@ bfd_libs = @bfd_libs@ bfd_machines = @bfd_machines@ +bfd_ufile_ptr = @bfd_ufile_ptr@ bfd_version = @bfd_version@ -bfd_version_date = @bfd_version_date@ bfd_version_string = @bfd_version_string@ bfdincludedir = @bfdincludedir@ bfdlibdir = @bfdlibdir@ @@ -131,7 +133,8 @@ AUTOMAKE_OPTIONS = cygnus DOCFILES = aoutx.texi archive.texi archures.texi \ bfdt.texi cache.texi coffcode.texi \ - core.texi elf.texi elfcode.texi format.texi libbfd.texi \ + core.texi elf.texi elfcode.texi format.texi \ + libbfd.texi bfdwin.texi bfdio.texi \ opncls.texi reloc.texi section.texi \ syms.texi targets.texi init.texi hash.texi linker.texi \ mmo.texi @@ -139,6 +142,7 @@ DOCFILES = aoutx.texi archive.texi archures.texi \ PROTOS = archive.p archures.p bfd.p \ core.p format.p \ + bfdio.p bfdwin.p \ libbfd.p opncls.p reloc.p \ section.p syms.p targets.p \ format.p core.p init.p @@ -151,6 +155,7 @@ IPROTOS = cache.ip libbfd.ip reloc.ip init.ip archures.ip coffcode.ip # you don't need these three: SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \ $(srcdir)/../archures.c $(srcdir)/../bfd.c \ + $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ $(srcdir)/../cache.c $(srcdir)/../coffcode.h \ $(srcdir)/../corefile.c $(srcdir)/../elf.c \ $(srcdir)/../elfcode.h $(srcdir)/../format.c \ @@ -164,12 +169,14 @@ SRCDOC = $(srcdir)/../aoutx.h $(srcdir)/../archive.c \ SRCPROT = $(srcdir)/../archive.c $(srcdir)/../archures.c \ $(srcdir)/../bfd.c $(srcdir)/../coffcode.h $(srcdir)/../corefile.c \ $(srcdir)/../format.c $(srcdir)/../libbfd.c \ + $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ $(srcdir)/../opncls.c $(srcdir)/../reloc.c \ $(srcdir)/../section.c $(srcdir)/../syms.c \ $(srcdir)/../targets.c $(srcdir)/../init.c SRCIPROT = $(srcdir)/../cache.c $(srcdir)/../libbfd.c \ + $(srcdir)/../bfdio.c $(srcdir)/../bfdwin.c \ $(srcdir)/../reloc.c $(srcdir)/../cpu-h8300.c \ $(srcdir)/../cpu-i960.c $(srcdir)/../archures.c \ $(srcdir)/../init.c @@ -185,6 +192,8 @@ LIBBFD_H_DEP = \ $(srcdir)/../libbfd-in.h \ $(srcdir)/../init.c \ $(srcdir)/../libbfd.c \ + $(srcdir)/../bfdio.c \ + $(srcdir)/../bfdwin.c \ $(srcdir)/../cache.c \ $(srcdir)/../reloc.c \ $(srcdir)/../archures.c \ @@ -207,6 +216,8 @@ BFD_H_DEP = \ $(srcdir)/../init.c \ $(srcdir)/../opncls.c \ $(srcdir)/../libbfd.c \ + $(srcdir)/../bfdio.c \ + $(srcdir)/../bfdwin.c \ $(srcdir)/../section.c \ $(srcdir)/../archures.c \ $(srcdir)/../reloc.c \ @@ -216,6 +227,8 @@ BFD_H_DEP = \ $(srcdir)/../corefile.c \ $(srcdir)/../targets.c \ $(srcdir)/../format.c \ + $(srcdir)/../linker.c \ + $(srcdir)/../simple.c \ $(srcdir)/header.sed \ $(srcdir)/proto.str \ $(srcdir)/../version.h \ @@ -330,7 +343,7 @@ uninstall-info: else ii=; fi; \ list='$(INFO_DEPS)'; \ for file in $$list; do \ - test -z "$ii" \ + test -z "$$ii" \ || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ done @$(NORMAL_UNINSTALL) @@ -459,7 +472,7 @@ mostlyclean distclean maintainer-clean $(MKDOC): chew.o - $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(LOADLIBES) $(LDFLAGS) + $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS) chew.o: chew.c $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c @@ -552,6 +565,18 @@ s-libbfd: $(MKDOC) $(srcdir)/../libbfd.c $(srcdir)/doc.str touch s-libbfd libbfd.texi: s-libbfd +s-bfdio: $(MKDOC) $(srcdir)/../bfdio.c $(srcdir)/doc.str + ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdio.c >bfdio.tmp + $(srcdir)/../../move-if-change bfdio.tmp bfdio.texi + touch s-bfdio +bfdio.texi: s-bfdio + +s-bfdwin: $(MKDOC) $(srcdir)/../bfdwin.c $(srcdir)/doc.str + ./$(MKDOC) -f $(srcdir)/doc.str < $(srcdir)/../bfdwin.c >bfdwin.tmp + $(srcdir)/../../move-if-change bfdwin.tmp bfdwin.texi + touch s-bfdwin +bfdwin.texi: s-bfdwin + s-opncls: $(MKDOC) $(srcdir)/../opncls.c $(srcdir)/doc.str ./$(MKDOC) -f $(srcdir)/doc.str <$(srcdir)/../opncls.c >opncls.tmp $(srcdir)/../../move-if-change opncls.tmp opncls.texi diff --git a/contrib/binutils/bfd/doc/aoutx.texi b/contrib/binutils/bfd/doc/aoutx.texi index d99fd05..0c4167b 100644 --- a/contrib/binutils/bfd/doc/aoutx.texi +++ b/contrib/binutils/bfd/doc/aoutx.texi @@ -161,7 +161,7 @@ handle any last-minute setup. @subsubsection @code{aout_@var{size}_mkobject} @strong{Synopsis} @example -boolean aout_@var{size}_mkobject, (bfd *abfd); +bfd_boolean aout_@var{size}_mkobject, (bfd *abfd); @end example @strong{Description}@* Initialize BFD @var{abfd} for use with a.out files. @@ -187,7 +187,7 @@ is always understood. @subsubsection @code{aout_@var{size}_set_arch_mach} @strong{Synopsis} @example -boolean aout_@var{size}_set_arch_mach, +bfd_boolean aout_@var{size}_set_arch_mach, (bfd *, enum bfd_architecture arch, unsigned long machine)); @@ -201,7 +201,7 @@ can support the architecture required. @subsubsection @code{aout_@var{size}_new_section_hook} @strong{Synopsis} @example -boolean aout_@var{size}_new_section_hook, +bfd_boolean aout_@var{size}_new_section_hook, (bfd *abfd, asection *newsect)); @end example diff --git a/contrib/binutils/bfd/doc/archive.texi b/contrib/binutils/bfd/doc/archive.texi index 7e91a16..e20906a 100644 --- a/contrib/binutils/bfd/doc/archive.texi +++ b/contrib/binutils/bfd/doc/archive.texi @@ -54,7 +54,8 @@ Archives are supported in BFD in @code{archive.c}. @subsubsection @code{bfd_get_next_mapent} @strong{Synopsis} @example -symindex bfd_get_next_mapent(bfd *abfd, symindex previous, carsym **sym); +symindex bfd_get_next_mapent + (bfd *abfd, symindex previous, carsym **sym); @end example @strong{Description}@* Step through archive @var{abfd}'s symbol table (if it @@ -73,7 +74,7 @@ user-visible element is its name, a null-terminated string. @subsubsection @code{bfd_set_archive_head} @strong{Synopsis} @example -boolean bfd_set_archive_head(bfd *output, bfd *new_head); +bfd_boolean bfd_set_archive_head (bfd *output, bfd *new_head); @end example @strong{Description}@* Set the head of the chain of @@ -83,7 +84,7 @@ BFDs contained in the archive @var{output} to @var{new_head}. @subsubsection @code{bfd_openr_next_archived_file} @strong{Synopsis} @example -bfd *bfd_openr_next_archived_file(bfd *archive, bfd *previous); +bfd *bfd_openr_next_archived_file (bfd *archive, bfd *previous); @end example @strong{Description}@* Provided a BFD, @var{archive}, containing an archive and NULL, open diff --git a/contrib/binutils/bfd/doc/archures.texi b/contrib/binutils/bfd/doc/archures.texi index 0faf97d..06ee6d3 100644 --- a/contrib/binutils/bfd/doc/archures.texi +++ b/contrib/binutils/bfd/doc/archures.texi @@ -50,6 +50,7 @@ enum bfd_architecture #define bfd_mach_mcf5206e 10 #define bfd_mach_mcf5307 11 #define bfd_mach_mcf5407 12 +#define bfd_mach_mcf528x 13 bfd_arch_vax, /* DEC Vax */ bfd_arch_i960, /* Intel 960 */ /* The order of the following is important. @@ -95,12 +96,16 @@ enum bfd_architecture #define bfd_mach_mips4010 4010 #define bfd_mach_mips4100 4100 #define bfd_mach_mips4111 4111 +#define bfd_mach_mips4120 4120 #define bfd_mach_mips4300 4300 #define bfd_mach_mips4400 4400 #define bfd_mach_mips4600 4600 #define bfd_mach_mips4650 4650 #define bfd_mach_mips5000 5000 +#define bfd_mach_mips5400 5400 +#define bfd_mach_mips5500 5500 #define bfd_mach_mips6000 6000 +#define bfd_mach_mips7000 7000 #define bfd_mach_mips8000 8000 #define bfd_mach_mips10000 10000 #define bfd_mach_mips12000 12000 @@ -108,13 +113,15 @@ enum bfd_architecture #define bfd_mach_mips5 5 #define bfd_mach_mips_sb1 12310201 /* octal 'SB', 01 */ #define bfd_mach_mipsisa32 32 +#define bfd_mach_mipsisa32r2 33 #define bfd_mach_mipsisa64 64 +#define bfd_mach_mipsisa64r2 65 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 +#define bfd_mach_i386_i386 1 +#define bfd_mach_i386_i8086 2 +#define bfd_mach_i386_i386_intel_syntax 3 +#define bfd_mach_x86_64 64 +#define bfd_mach_x86_64_intel_syntax 65 bfd_arch_we32k, /* AT&T WE32xxx */ bfd_arch_tahoe, /* CCI/Harris Tahoe */ bfd_arch_i860, /* Intel 860 */ @@ -123,15 +130,20 @@ enum bfd_architecture bfd_arch_alliant, /* Alliant */ bfd_arch_convex, /* Convex */ bfd_arch_m88k, /* Motorola 88xxx */ + bfd_arch_m98k, /* Motorola 98xxx */ 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_h8300, /* Renesas H8/300 (formerly Hitachi H8/300) */ +#define bfd_mach_h8300 1 +#define bfd_mach_h8300h 2 +#define bfd_mach_h8300s 3 +#define bfd_mach_h8300hn 4 +#define bfd_mach_h8300sn 5 +#define bfd_mach_h8300sx 6 +#define bfd_mach_h8300sxn 7 bfd_arch_pdp11, /* DEC PDP-11 */ bfd_arch_powerpc, /* PowerPC */ -#define bfd_mach_ppc 0 -#define bfd_mach_ppc64 1 +#define bfd_mach_ppc 32 +#define bfd_mach_ppc64 64 #define bfd_mach_ppc_403 403 #define bfd_mach_ppc_403gc 4030 #define bfd_mach_ppc_505 505 @@ -148,38 +160,52 @@ enum bfd_architecture #define bfd_mach_ppc_rs64ii 642 #define bfd_mach_ppc_rs64iii 643 #define bfd_mach_ppc_7400 7400 +#define bfd_mach_ppc_e500 500 bfd_arch_rs6000, /* IBM RS/6000 */ -#define bfd_mach_rs6k 0 +#define bfd_mach_rs6k 6000 #define bfd_mach_rs6k_rs1 6001 #define bfd_mach_rs6k_rsc 6003 #define bfd_mach_rs6k_rs2 6002 bfd_arch_hppa, /* HP PA RISC */ +#define bfd_mach_hppa10 10 +#define bfd_mach_hppa11 11 +#define bfd_mach_hppa20 20 +#define bfd_mach_hppa20w 25 bfd_arch_d10v, /* Mitsubishi D10V */ -#define bfd_mach_d10v 0 +#define bfd_mach_d10v 1 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 bfd_arch_d30v, /* Mitsubishi D30V */ bfd_arch_dlx, /* DLX */ bfd_arch_m68hc11, /* Motorola 68HC11 */ bfd_arch_m68hc12, /* Motorola 68HC12 */ +#define bfd_mach_m6812_default 0 +#define bfd_mach_m6812 1 +#define bfd_mach_m6812s 2 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 */ -#define bfd_mach_sh 0 + bfd_arch_h8500, /* Renesas H8/500 (formerly Hitachi H8/500) */ + bfd_arch_sh, /* Renesas / SuperH SH (formerly Hitachi SH) */ +#define bfd_mach_sh 1 #define bfd_mach_sh2 0x20 #define bfd_mach_sh_dsp 0x2d +#define bfd_mach_sh2e 0x2e #define bfd_mach_sh3 0x30 #define bfd_mach_sh3_dsp 0x3d #define bfd_mach_sh3e 0x3e #define bfd_mach_sh4 0x40 +#define bfd_mach_sh4_nofpu 0x41 +#define bfd_mach_sh4a 0x4a +#define bfd_mach_sh4a_nofpu 0x4b +#define bfd_mach_sh4al_dsp 0x4d #define bfd_mach_sh5 0x50 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. */ +#define bfd_mach_arm_unknown 0 #define bfd_mach_arm_2 1 #define bfd_mach_arm_2a 2 #define bfd_mach_arm_3 3 @@ -190,40 +216,54 @@ enum bfd_architecture #define bfd_mach_arm_5T 8 #define bfd_mach_arm_5TE 9 #define bfd_mach_arm_XScale 10 +#define bfd_mach_arm_ep9312 11 +#define bfd_mach_arm_iWMMXt 12 bfd_arch_ns32k, /* National Semiconductors ns32000 */ bfd_arch_w65, /* WDC 65816 */ bfd_arch_tic30, /* Texas Instruments TMS320C30 */ + bfd_arch_tic4x, /* Texas Instruments TMS320C3X/4X */ +#define bfd_mach_tic3x 30 +#define bfd_mach_tic4x 40 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_v850 1 #define bfd_mach_v850e 'E' -#define bfd_mach_v850ea 'A' +#define bfd_mach_v850e1 '1' 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 /* For backwards compatibility. */ +#define bfd_mach_arc_5 5 +#define bfd_mach_arc_6 6 +#define bfd_mach_arc_7 7 +#define bfd_mach_arc_8 8 + bfd_arch_m32r, /* Renesas M32R (formerly Mitsubishi M32R/D) */ +#define bfd_mach_m32r 1 /* For backwards compatibility. */ #define bfd_mach_m32rx 'x' +#define bfd_mach_m32r2 '2' bfd_arch_mn10200, /* Matsushita MN10200 */ bfd_arch_mn10300, /* Matsushita MN10300 */ #define bfd_mach_mn10300 300 #define bfd_mach_am33 330 +#define bfd_mach_am33_2 332 bfd_arch_fr30, #define bfd_mach_fr30 0x46523330 bfd_arch_frv, -#define bfd_mach_frv 0 -#define bfd_mach_frvsimple 1 +#define bfd_mach_frv 1 +#define bfd_mach_frvsimple 2 #define bfd_mach_fr300 300 #define bfd_mach_fr400 400 #define bfd_mach_frvtomcat 499 /* fr500 prototype */ #define bfd_mach_fr500 500 +#define bfd_mach_fr550 550 bfd_arch_mcore, bfd_arch_ia64, /* HP/Intel ia64 */ -#define bfd_mach_ia64_elf64 0 -#define bfd_mach_ia64_elf32 1 +#define bfd_mach_ia64_elf64 64 +#define bfd_mach_ia64_elf32 32 + bfd_arch_ip2k, /* Ubicom IP2K microcontrollers. */ +#define bfd_mach_ip2022 1 +#define bfd_mach_ip2022ext 2 + bfd_arch_iq2000, /* Vitesse IQ2000. */ +#define bfd_mach_iq2000 1 +#define bfd_mach_iq10 2 bfd_arch_pj, bfd_arch_avr, /* Atmel AVR microcontrollers. */ #define bfd_mach_avr1 1 @@ -233,12 +273,29 @@ enum bfd_architecture #define bfd_mach_avr5 5 bfd_arch_cris, /* Axis CRIS */ bfd_arch_s390, /* IBM s390 */ -#define bfd_mach_s390_31 0 -#define bfd_mach_s390_64 1 +#define bfd_mach_s390_31 31 +#define bfd_mach_s390_64 64 bfd_arch_openrisc, /* OpenRISC */ bfd_arch_mmix, /* Donald Knuth's educational processor. */ bfd_arch_xstormy16, -#define bfd_mach_xstormy16 0 +#define bfd_mach_xstormy16 1 + bfd_arch_msp430, /* Texas Instruments MSP430 architecture. */ +#define bfd_mach_msp11 11 +#define bfd_mach_msp110 110 +#define bfd_mach_msp12 12 +#define bfd_mach_msp13 13 +#define bfd_mach_msp14 14 +#define bfd_mach_msp15 15 +#define bfd_mach_msp16 16 +#define bfd_mach_msp31 31 +#define bfd_mach_msp32 32 +#define bfd_mach_msp33 33 +#define bfd_mach_msp41 41 +#define bfd_mach_msp42 42 +#define bfd_mach_msp43 43 +#define bfd_mach_msp44 44 + bfd_arch_xtensa, /* Tensilica's Xtensa cores. */ +#define bfd_mach_xtensa 1 bfd_arch_last @}; @end example @@ -261,15 +318,14 @@ 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. + /* TRUE if this is the default machine for the architecture. The default arch should be the first entry for an arch so that all the entries for that arch can be accessed via @code{next}. */ - boolean the_default; + bfd_boolean the_default; const struct bfd_arch_info * (*compatible) - PARAMS ((const struct bfd_arch_info *a, - const struct bfd_arch_info *b)); + (const struct bfd_arch_info *a, const struct bfd_arch_info *b); - boolean (*scan) PARAMS ((const struct bfd_arch_info *, const char *)); + bfd_boolean (*scan) (const struct bfd_arch_info *, const char *); const struct bfd_arch_info *next; @} @@ -281,7 +337,7 @@ bfd_arch_info_type; @subsubsection @code{bfd_printable_name} @strong{Synopsis} @example -const char *bfd_printable_name(bfd *abfd); +const char *bfd_printable_name (bfd *abfd); @end example @strong{Description}@* Return a printable string representing the architecture and machine @@ -291,7 +347,7 @@ from the pointer to the architecture info structure. @subsubsection @code{bfd_scan_arch} @strong{Synopsis} @example -const bfd_arch_info_type *bfd_scan_arch(const char *string); +const bfd_arch_info_type *bfd_scan_arch (const char *string); @end example @strong{Description}@* Figure out if BFD supports any cpu which could be described with @@ -302,7 +358,7 @@ structure if a machine is found, otherwise NULL. @subsubsection @code{bfd_arch_list} @strong{Synopsis} @example -const char **bfd_arch_list(void); +const char **bfd_arch_list (void); @end example @strong{Description}@* Return a freshly malloced NULL-terminated vector of the names @@ -312,16 +368,15 @@ of all the valid BFD architectures. Do not modify the names. @subsubsection @code{bfd_arch_get_compatible} @strong{Synopsis} @example -const bfd_arch_info_type *bfd_arch_get_compatible( - const bfd *abfd, - const bfd *bbfd); +const bfd_arch_info_type *bfd_arch_get_compatible + (const bfd *abfd, const bfd *bbfd, bfd_boolean accept_unknowns); @end example @strong{Description}@* -Determine whether two BFDs' -architectures and machine types are compatible. Calculates -the lowest common denominator between the two architectures -and machine types implied by the BFDs and returns a pointer to -an @code{arch_info} structure describing the compatible machine. +Determine whether two BFDs' architectures and machine types +are compatible. Calculates the lowest common denominator +between the two architectures and machine types implied by +the BFDs and returns a pointer to an @code{arch_info} structure +describing the compatible machine. @findex bfd_default_arch_struct @subsubsection @code{bfd_default_arch_struct} @@ -339,7 +394,7 @@ extern const bfd_arch_info_type bfd_default_arch_struct; @subsubsection @code{bfd_set_arch_info} @strong{Synopsis} @example -void bfd_set_arch_info(bfd *abfd, const bfd_arch_info_type *arg); +void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg); @end example @strong{Description}@* Set the architecture info of @var{abfd} to @var{arg}. @@ -348,9 +403,8 @@ Set the architecture info of @var{abfd} to @var{arg}. @subsubsection @code{bfd_default_set_arch_mach} @strong{Synopsis} @example -boolean bfd_default_set_arch_mach(bfd *abfd, - enum bfd_architecture arch, - unsigned long mach); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); @end example @strong{Description}@* Set the architecture and machine type in BFD @var{abfd} @@ -362,7 +416,7 @@ pointer. @subsubsection @code{bfd_get_arch} @strong{Synopsis} @example -enum bfd_architecture bfd_get_arch(bfd *abfd); +enum bfd_architecture bfd_get_arch (bfd *abfd); @end example @strong{Description}@* Return the enumerated type which describes the BFD @var{abfd}'s @@ -372,7 +426,7 @@ architecture. @subsubsection @code{bfd_get_mach} @strong{Synopsis} @example -unsigned long bfd_get_mach(bfd *abfd); +unsigned long bfd_get_mach (bfd *abfd); @end example @strong{Description}@* Return the long type which describes the BFD @var{abfd}'s @@ -382,7 +436,7 @@ machine. @subsubsection @code{bfd_arch_bits_per_byte} @strong{Synopsis} @example -unsigned int bfd_arch_bits_per_byte(bfd *abfd); +unsigned int bfd_arch_bits_per_byte (bfd *abfd); @end example @strong{Description}@* Return the number of bits in one of the BFD @var{abfd}'s @@ -392,7 +446,7 @@ architecture's bytes. @subsubsection @code{bfd_arch_bits_per_address} @strong{Synopsis} @example -unsigned int bfd_arch_bits_per_address(bfd *abfd); +unsigned int bfd_arch_bits_per_address (bfd *abfd); @end example @strong{Description}@* Return the number of bits in one of the BFD @var{abfd}'s @@ -403,8 +457,7 @@ architecture's addresses. @strong{Synopsis} @example const bfd_arch_info_type *bfd_default_compatible - (const bfd_arch_info_type *a, - const bfd_arch_info_type *b); + (const bfd_arch_info_type *a, const bfd_arch_info_type *b); @end example @strong{Description}@* The default function for testing for compatibility. @@ -413,7 +466,8 @@ The default function for testing for compatibility. @subsubsection @code{bfd_default_scan} @strong{Synopsis} @example -boolean bfd_default_scan(const struct bfd_arch_info *info, const char *string); +bfd_boolean bfd_default_scan + (const struct bfd_arch_info *info, const char *string); @end example @strong{Description}@* The default function for working out whether this is an @@ -423,7 +477,7 @@ architecture hit and a machine hit. @subsubsection @code{bfd_get_arch_info} @strong{Synopsis} @example -const bfd_arch_info_type * bfd_get_arch_info(bfd *abfd); +const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd); @end example @strong{Description}@* Return the architecture info struct in @var{abfd}. @@ -433,12 +487,10 @@ Return the architecture info struct in @var{abfd}. @strong{Synopsis} @example const bfd_arch_info_type *bfd_lookup_arch - (enum bfd_architecture - arch, - unsigned long machine); + (enum bfd_architecture arch, unsigned long machine); @end example @strong{Description}@* -Look for the architecure info structure which matches the +Look for the architecture info structure which matches the arguments @var{arch} and @var{machine}. A machine of 0 matches the machine/architecture structure which marks itself as the default. @@ -460,7 +512,7 @@ This routine is depreciated. @subsubsection @code{bfd_octets_per_byte} @strong{Synopsis} @example -unsigned int bfd_octets_per_byte(bfd *abfd); +unsigned int bfd_octets_per_byte (bfd *abfd); @end example @strong{Description}@* Return the number of octets (8-bit quantities) per target byte @@ -471,8 +523,8 @@ DSP targets have 16, 32, or even 48 bits per byte. @subsubsection @code{bfd_arch_mach_octets_per_byte} @strong{Synopsis} @example -unsigned int bfd_arch_mach_octets_per_byte(enum bfd_architecture arch, - unsigned long machine); +unsigned int bfd_arch_mach_octets_per_byte + (enum bfd_architecture arch, unsigned long machine); @end example @strong{Description}@* See bfd_octets_per_byte. diff --git a/contrib/binutils/bfd/doc/bfd.texinfo b/contrib/binutils/bfd/doc/bfd.texinfo index 380501e..3ed4194 100644 --- a/contrib/binutils/bfd/doc/bfd.texinfo +++ b/contrib/binutils/bfd/doc/bfd.texinfo @@ -1,6 +1,6 @@ \input texinfo.tex @setfilename bfd.info -@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 2000 +@c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1997, 2000, 2003 @c Free Software Foundation, Inc. @c @tex @@ -30,14 +30,14 @@ END-INFO-DIR-ENTRY @ifinfo This file documents the BFD library. -Copyright (C) 1991, 2000, 2001 Free Software Foundation, Inc. +Copyright (C) 1991, 2000, 2001, 2003 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the - section entitled "GNU Free Documentation License". + section entitled ``GNU Free Documentation License''. @ignore Permission is granted to process this file through Tex and print the @@ -64,7 +64,7 @@ notice identical to this one except for the removal of this paragraph @tex \def\$#1${{#1}} % Kluge: collect RCS revision info without $...$ -\xdef\manvers{\$Revision: 1.5 $} % For use in headers, footers too +\xdef\manvers{1.5} % For use in headers, footers too {\parskip=0pt \hfill Free Software Foundation\par \hfill sac\@www.gnu.org\par @@ -75,14 +75,14 @@ notice identical to this one except for the removal of this paragraph @end tex @vskip 0pt plus 1filll -Copyright @copyright{} 1991, 2001 Free Software Foundation, Inc. +Copyright @copyright{} 1991, 2001, 2003 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the - section entitled "GNU Free Documentation License". + section entitled ``GNU Free Documentation License''. @end titlepage @end iftex @@ -170,17 +170,17 @@ For example, this sequence does what you would probably expect: return the number of sections in an object file attached to a BFD @code{abfd}. -@lisp +@example @c @cartouche #include "bfd.h" -unsigned int number_of_sections(abfd) +unsigned int number_of_sections (abfd) bfd *abfd; @{ - return bfd_count_sections(abfd); + return bfd_count_sections (abfd); @} @c @end cartouche -@end lisp +@end example The abstraction used within BFD is that an object file has: @@ -205,8 +205,9 @@ IEEE-695. @include bfdsumm.texi @node BFD front end, BFD back ends, Overview, Top -@chapter BFD front end +@chapter BFD Front End @include bfdt.texi +@include bfdio.texi @menu * Memory Usage:: @@ -227,7 +228,7 @@ IEEE-695. @end menu @node Memory Usage, Initialization, BFD front end, BFD front end -@section Memory usage +@section Memory Usage BFD keeps all of its internal structures in obstacks. There is one obstack per open BFD file, into which the current state is stored. When a BFD is closed, the obstack is deleted, and so everything which has been @@ -323,370 +324,9 @@ All of BFD lives in one directory. @include mmo.texi @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 +@include fdl.texi + +@node Index, , GNU Free Documentation License, Top @unnumbered Index @printindex cp diff --git a/contrib/binutils/bfd/doc/bfdint.texi b/contrib/binutils/bfd/doc/bfdint.texi index d2996dc..95c0096 100644 --- a/contrib/binutils/bfd/doc/bfdint.texi +++ b/contrib/binutils/bfd/doc/bfdint.texi @@ -1,6 +1,6 @@ \input texinfo @c Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, -@c 2000, 2001 +@c 2000, 2001, 2002, 2003 @c Free Software Foundation, Inc. @setfilename bfdint.info @@ -694,7 +694,7 @@ information in BFD private data. This is called via @samp{bfd_get_symtab_upper_bound}. The corresponding field in the target vector is named @samp{_bfd_get_symtab_upper_bound}. -@item _get_symtab +@item _canonicalize_symtab Read in the symbol table. This is called via @samp{bfd_canonicalize_symtab}. The corresponding field in the target vector is named @samp{_bfd_canonicalize_symtab}. @@ -835,7 +835,7 @@ corresponding field in the target vector is named @item _bfd_get_relocated_section_contents Read the contents of a section and apply the relocation information. -This handles both a final link and a relocateable link; in the latter +This handles both a final link and a relocatable link; in the latter case, it adjust the relocation information as well. This is called via @samp{bfd_get_relocated_section_contents}. Most targets implement it by calling @samp{bfd_generic_get_relocated_section_contents}. @@ -1073,11 +1073,6 @@ sizes. Like @file{elfcode.h}, but for functions that are specific to ELF core files. This is included only by @file{elfcode.h}. -@item elflink.h -@cindex @file{elflink.h} -Like @file{elfcode.h}, but for functions used by the ELF linker. This -is included only by @file{elfcode.h}. - @item elfxx-target.h @cindex @file{elfxx-target.h} This file is the source for the generated files @file{elf32-target.h} @@ -1169,7 +1164,7 @@ allocate space in a different section and use the offset within that section as the value to store. In the IEEE object file format, relocations may involve arbitrary expressions. -When doing a relocateable link, the linker may or may not have to do +When doing a relocatable link, the linker may or may not have to do anything with a relocation, depending upon the definition of the relocation. Simple relocations generally do not require any special action. @@ -1240,9 +1235,9 @@ existing target, you need to do the following: @itemize @bullet @item Make sure you clearly understand what the contents of the section should -look like after assembly, after a relocateable link, and after a final +look like after assembly, after a relocatable link, and after a final link. Make sure you clearly understand the operations the linker must -perform during a relocateable link and during a final link. +perform during a relocatable link and during a final link. @item Write a howto structure for the relocation. The howto structure is @@ -1257,7 +1252,7 @@ call @samp{bfd_install_relocation}, so your howto structure has to be able to handle that. You may need to set the @samp{special_function} field to handle assembly correctly. Be careful to ensure that any code you write to handle the assembler will also work correctly when doing a -relocateable link. For example, see @samp{bfd_elf_generic_reloc}. +relocatable link. For example, see @samp{bfd_elf_generic_reloc}. @item Test the assembler. Consider the cases of relocation against an @@ -1271,14 +1266,14 @@ If your target uses the new linker, which is recommended, add any required handling to the target specific relocation function. In simple cases this will just involve a call to @samp{_bfd_final_link_relocate} or @samp{_bfd_relocate_contents}, depending upon the definition of the -relocation and whether the link is relocateable or not. +relocation and whether the link is relocatable or not. @item Test the linker. Test the case of a final link. If the relocation can overflow, use a linker script to force an overflow and make sure the -error is reported correctly. Test a relocateable link, whether the -symbol is defined or undefined in the relocateable output. For both the -final and relocateable link, test the case when the symbol is a common +error is reported correctly. Test a relocatable link, whether the +symbol is defined or undefined in the relocatable output. For both the +final and relocatable link, test the case when the symbol is a common symbol, when the symbol looked like a common symbol but became a defined symbol, when the symbol is defined in a different object file, and when the symbol is defined in the same object file. @@ -1291,7 +1286,7 @@ thing for the relocation. You may need to set the doing a link in which the output object file format is S-records. @item -Using the linker to generate relocateable output in a different object +Using the linker to generate relocatable output in a different object file format is impossible in the general case, so you generally don't have to worry about that. The GNU linker makes sure to stop that from happening when an input file in a different format has relocations. @@ -1350,7 +1345,7 @@ howto structure. Some mechanism would be used to determine which type of howto structure was being used by a particular format. The new howto structure would clearly define the relocation behaviour in -the case of an assembly, a relocateable link, and a final link. At +the case of an assembly, a relocatable link, and a final link. At least one special function would be defined as an escape, and it might make sense to define more. @@ -1482,8 +1477,7 @@ external data. @file{elfcode.h} is compiled twice, once via @file{elfcode.h} includes functions to swap the ELF structures in and out of external form, as well as a few more complex functions. -Linker support is found in @file{elflink.c} and @file{elflink.h}. The -latter file is compiled twice, for both 32 and 64 bit support. The +Linker support is found in @file{elflink.c}. The linker support is only used if the processor specific file defines @samp{elf_backend_relocate_section}, which is required to relocate the section contents. If that macro is not defined, the generic linker code @@ -1566,7 +1560,7 @@ relocations. @samp{Rela} relocations will require more space in object files (but not in executables, except when using dynamic linking). However, this is outweighed by the simplicity of addend handling when using @samp{Rela} relocations. With @samp{Rel} relocations, the addend -must be stored in the section contents, which makes relocateable links +must be stored in the section contents, which makes relocatable links more complex. For example, consider C code like @code{i = a[1000];} where @samp{a} is @@ -1578,7 +1572,7 @@ relocations, that addend must be stored in the instructions themselves. If you are adding support for a RISC chip which uses two or more instructions to load an address, then the addend may not fit in a single instruction, and will have to be somehow split among the instructions. -This makes linking awkward, particularly when doing a relocateable link +This makes linking awkward, particularly when doing a relocatable link in which the addend may have to be updated. It can be done---the MIPS ELF support does it---but it should be avoided when possible. @@ -1611,7 +1605,7 @@ called @file{@var{cpu}.h}. This file should define any target specific information which may be needed outside of the BFD code. In particular it should use the @samp{START_RELOC_NUMBERS}, @samp{RELOC_NUMBER}, @samp{FAKE_RELOC}, @samp{EMPTY_RELOC} and @samp{END_RELOC_NUMBERS} -macros to create a table mapping the number used to indentify a +macros to create a table mapping the number used to identify a relocation to a name describing that relocation. While not a BFD component, you probably also want to make the binutils @@ -1645,7 +1639,7 @@ information, and modify the section contents according to the relocation information. In simple cases, this is little more than a loop over the relocations which computes the value of each relocation and calls @samp{_bfd_final_link_relocate}. The function must check for a -relocateable link, and in that case normally needs to do nothing other +relocatable link, and in that case normally needs to do nothing other than adjust the addend for relocations against a section symbol. The complex cases generally have to do with dynamic linker support. GOT @@ -1788,7 +1782,7 @@ The implementation within BFD of a particular object file format. The set of functions which appear in a particular target vector. @item BFD -The BFD library itself. Also, each object file, archive, or exectable +The BFD library itself. Also, each object file, archive, or executable opened by the BFD library has the type @samp{bfd *}, and is sometimes referred to as a bfd. diff --git a/contrib/binutils/bfd/doc/bfdio.texi b/contrib/binutils/bfd/doc/bfdio.texi new file mode 100644 index 0000000..b8c79d3 --- /dev/null +++ b/contrib/binutils/bfd/doc/bfdio.texi @@ -0,0 +1,41 @@ +@findex bfd_get_mtime +@subsubsection @code{bfd_get_mtime} +@strong{Synopsis} +@example +long bfd_get_mtime (bfd *abfd); +@end example +@strong{Description}@* +Return the file modification time (as read from the file system, or +from the archive header for archive members). + +@findex bfd_get_size +@subsubsection @code{bfd_get_size} +@strong{Synopsis} +@example +long bfd_get_size (bfd *abfd); +@end example +@strong{Description}@* +Return the file size (as read from file system) for the file +associated with BFD @var{abfd}. + +The initial motivation for, and use of, this routine is not +so we can get the exact size of the object the BFD applies to, since +that might not be generally possible (archive members for example). +It would be ideal if someone could eventually modify +it so that such results were guaranteed. + +Instead, we want to ask questions like "is this NNN byte sized +object I'm about to try read from file offset YYY reasonable?" +As as example of where we might do this, some object formats +use string tables for which the first @code{sizeof (long)} bytes of the +table contain the size of the table itself, including the size bytes. +If an application tries to read what it thinks is one of these +string tables, without some way to validate the size, and for +some reason the size is wrong (byte swapping error, wrong location +for the string table, etc.), the only clue is likely to be a read +error when it tries to read the table, or a "virtual memory +exhausted" error when it tries to allocate 15 bazillon bytes +of space for the 15 bazillon byte table it is about to read. +This function at least allows us to answer the question, "is the +size reasonable?". + diff --git a/contrib/binutils/bfd/doc/bfdt.texi b/contrib/binutils/bfd/doc/bfdt.texi index 46bb61a..74cace4 100644 --- a/contrib/binutils/bfd/doc/bfdt.texi +++ b/contrib/binutils/bfd/doc/bfdt.texi @@ -10,8 +10,11 @@ to the rest of the data. @example -struct _bfd +struct bfd @{ + /* A unique identifier of the BFD */ + unsigned int id; + /* The filename the application opened the BFD with. */ const char *filename; @@ -25,33 +28,33 @@ struct _bfd is the result of an fopen on the filename. However, if the BFD_IN_MEMORY flag is set, then iostream is actually a pointer to a bfd_in_memory struct. */ - PTR iostream; + void *iostream; /* Is the file descriptor being cached? That is, can it be closed as needed, and re-opened when accessed later? */ - boolean cacheable; + bfd_boolean cacheable; /* Marks whether there was a default target specified when the BFD was opened. This is used to select which matching algorithm to use to choose the back end. */ - boolean target_defaulted; + bfd_boolean target_defaulted; /* The caching routines use these to maintain a least-recently-used list of BFDs. */ - struct _bfd *lru_prev, *lru_next; + struct bfd *lru_prev, *lru_next; /* When a file is closed by the caching routines, BFD retains state information on the file here... */ ufile_ptr where; /* ... and here: (``once'' means at least once). */ - boolean opened_once; + bfd_boolean opened_once; /* Set if we have a locally maintained mtime value, rather than getting it from the file each time. */ - boolean mtime_set; + bfd_boolean mtime_set; - /* File modified time, if mtime_set is true. */ + /* File modified time, if mtime_set is TRUE. */ long mtime; /* Reserved for an unimplemented file locking extension. */ @@ -80,16 +83,16 @@ struct _bfd /* Remember when output has begun, to stop strange things from happening. */ - boolean output_has_begun; + bfd_boolean output_has_begun; /* A hash table for section names. */ struct bfd_hash_table section_htab; /* Pointer to linked list of sections. */ - struct sec *sections; + struct bfd_section *sections; /* The place where we add to the section list. */ - struct sec **section_tail; + struct bfd_section **section_tail; /* The number of sections. */ unsigned int section_count; @@ -102,7 +105,7 @@ struct _bfd unsigned int symcount; /* Symbol table for output BFD (with symcount entries). */ - struct symbol_cache_entry **outsymbols; + struct bfd_symbol **outsymbols; /* Used for slurped dynamic symbol tables. */ unsigned int dynsymcount; @@ -111,14 +114,14 @@ struct _bfd const struct bfd_arch_info *arch_info; /* Stuff only useful for archives. */ - PTR arelt_data; - struct _bfd *my_archive; /* The containing archive BFD. */ - struct _bfd *next; /* The next BFD in the archive. */ - struct _bfd *archive_head; /* The first BFD in the archive. */ - boolean has_armap; + void *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. */ + bfd_boolean has_armap; /* A chain of BFD structures involved in a link. */ - struct _bfd *link_next; + struct bfd *link_next; /* A field used by _bfd_generic_link_add_archive_symbols. This will be used only for archive elements. */ @@ -156,17 +159,22 @@ struct _bfd struct cisco_core_struct *cisco_core_data; struct versados_data_struct *versados_data; struct netbsd_core_struct *netbsd_core_data; - PTR any; + struct mach_o_data_struct *mach_o_data; + struct mach_o_fat_data_struct *mach_o_fat_data; + struct bfd_pef_data_struct *pef_data; + struct bfd_pef_xlib_data_struct *pef_xlib_data; + struct bfd_sym_data_struct *sym_data; + void *any; @} tdata; /* Used by the application to hold private data. */ - PTR usrdata; + void *usrdata; /* Where all the allocated stuff under this BFD goes. This is a - struct objalloc *, but we use PTR to avoid requiring the inclusion of - objalloc.h. */ - PTR memory; + struct objalloc *, but we use void * to avoid requiring the inclusion + of objalloc.h. */ + void *memory; @}; @end example @@ -258,14 +266,14 @@ by @var{message}, a colon, and a space. It is followed by a newline. @subsection BFD error handler Some BFD functions want to print messages describing the problem. They call a BFD error handler function. This -function may be overriden by the program. +function may be overridden by the program. The BFD error handler acts like printf. @example -typedef void (*bfd_error_handler_type) PARAMS ((const char *, ...)); +typedef void (*bfd_error_handler_type) (const char *, ...); @end example @findex bfd_set_error_handler @@ -317,7 +325,7 @@ returns the file name. @subsubsection @code{bfd_get_reloc_upper_bound} @strong{Synopsis} @example -long bfd_get_reloc_upper_bound(bfd *abfd, asection *sect); +long bfd_get_reloc_upper_bound (bfd *abfd, asection *sect); @end example @strong{Description}@* Return the number of bytes required to store the @@ -329,10 +337,7 @@ attached to bfd @var{abfd}. If an error occurs, return -1. @strong{Synopsis} @example long bfd_canonicalize_reloc - (bfd *abfd, - asection *sec, - arelent **loc, - asymbol **syms); + (bfd *abfd, asection *sec, arelent **loc, asymbol **syms); @end example @strong{Description}@* Call the back end associated with the open BFD @@ -362,7 +367,7 @@ The argument @var{abfd} is ignored. @subsubsection @code{bfd_set_file_flags} @strong{Synopsis} @example -boolean bfd_set_file_flags(bfd *abfd, flagword flags); +bfd_boolean bfd_set_file_flags (bfd *abfd, flagword flags); @end example @strong{Description}@* Set the flag word in the BFD @var{abfd} to the value @var{flags}. @@ -418,60 +423,19 @@ not sign extend addresses, and @code{-1} otherwise. @subsubsection @code{bfd_set_start_address} @strong{Synopsis} @example -boolean bfd_set_start_address(bfd *abfd, bfd_vma vma); +bfd_boolean bfd_set_start_address (bfd *abfd, bfd_vma vma); @end example @strong{Description}@* Make @var{vma} the entry point of output BFD @var{abfd}. @strong{Returns}@* -Returns @code{true} on success, @code{false} otherwise. - -@findex bfd_get_mtime -@subsubsection @code{bfd_get_mtime} -@strong{Synopsis} -@example -long bfd_get_mtime(bfd *abfd); -@end example -@strong{Description}@* -Return the file modification time (as read from the file system, or -from the archive header for archive members). - -@findex bfd_get_size -@subsubsection @code{bfd_get_size} -@strong{Synopsis} -@example -long bfd_get_size(bfd *abfd); -@end example -@strong{Description}@* -Return the file size (as read from file system) for the file -associated with BFD @var{abfd}. - -The initial motivation for, and use of, this routine is not -so we can get the exact size of the object the BFD applies to, since -that might not be generally possible (archive members for example). -It would be ideal if someone could eventually modify -it so that such results were guaranteed. - -Instead, we want to ask questions like "is this NNN byte sized -object I'm about to try read from file offset YYY reasonable?" -As as example of where we might do this, some object formats -use string tables for which the first @code{sizeof (long)} bytes of the -table contain the size of the table itself, including the size bytes. -If an application tries to read what it thinks is one of these -string tables, without some way to validate the size, and for -some reason the size is wrong (byte swapping error, wrong location -for the string table, etc.), the only clue is likely to be a read -error when it tries to read the table, or a "virtual memory -exhausted" error when it tries to allocate 15 bazillon bytes -of space for the 15 bazillon byte table it is about to read. -This function at least allows us to answer the quesion, "is the -size reasonable?". +Returns @code{TRUE} on success, @code{FALSE} otherwise. @findex bfd_get_gp_size @subsubsection @code{bfd_get_gp_size} @strong{Synopsis} @example -unsigned int bfd_get_gp_size(bfd *abfd); +unsigned int bfd_get_gp_size (bfd *abfd); @end example @strong{Description}@* Return the maximum size of objects to be optimized using the GP @@ -482,7 +446,7 @@ argument to the compiler, assembler or linker. @subsubsection @code{bfd_set_gp_size} @strong{Synopsis} @example -void bfd_set_gp_size(bfd *abfd, unsigned int i); +void bfd_set_gp_size (bfd *abfd, unsigned int i); @end example @strong{Description}@* Set the maximum size of objects to be optimized using the GP @@ -493,7 +457,7 @@ the @code{-G} argument to the compiler, assembler or linker. @subsubsection @code{bfd_scan_vma} @strong{Synopsis} @example -bfd_vma bfd_scan_vma(const char *string, const char **end, int base); +bfd_vma bfd_scan_vma (const char *string, const char **end, int base); @end example @strong{Description}@* Convert, like @code{strtoul}, a numerical expression @@ -512,11 +476,11 @@ returned. @subsubsection @code{bfd_copy_private_bfd_data} @strong{Synopsis} @example -boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd); +bfd_boolean bfd_copy_private_bfd_data (bfd *ibfd, bfd *obfd); @end example @strong{Description}@* Copy private BFD information from the BFD @var{ibfd} to the -the BFD @var{obfd}. Return @code{true} on success, @code{false} on error. +the BFD @var{obfd}. Return @code{TRUE} on success, @code{FALSE} on error. Possible error returns are: @itemize @bullet @@ -535,12 +499,12 @@ Not enough memory exists to create private data for @var{obfd}. @subsubsection @code{bfd_merge_private_bfd_data} @strong{Synopsis} @example -boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd); +bfd_boolean bfd_merge_private_bfd_data (bfd *ibfd, bfd *obfd); @end example @strong{Description}@* Merge private BFD information from the BFD @var{ibfd} to the -the output file BFD @var{obfd} when linking. Return @code{true} -on success, @code{false} on error. Possible error returns are: +the output file BFD @var{obfd} when linking. Return @code{TRUE} +on success, @code{FALSE} on error. Possible error returns are: @itemize @bullet @@ -558,11 +522,11 @@ Not enough memory exists to create private data for @var{obfd}. @subsubsection @code{bfd_set_private_flags} @strong{Synopsis} @example -boolean bfd_set_private_flags(bfd *abfd, flagword flags); +bfd_boolean bfd_set_private_flags (bfd *abfd, flagword flags); @end example @strong{Description}@* Set private BFD flag information in the BFD @var{abfd}. -Return @code{true} on success, @code{false} on error. Possible error +Return @code{TRUE} on success, @code{FALSE} on error. Possible error returns are: @itemize @bullet @@ -573,40 +537,38 @@ Not enough memory exists to create private data for @var{obfd}. @end itemize @example #define bfd_set_private_flags(abfd, flags) \ - BFD_SEND (abfd, _bfd_set_private_flags, \ - (abfd, flags)) + BFD_SEND (abfd, _bfd_set_private_flags, (abfd, flags)) @end example -@findex stuff -@subsubsection @code{stuff} +@findex Other functions +@subsubsection @code{Other functions} @strong{Description}@* -Stuff which should be documented: +The following functions exist but have not yet been documented. @example #define bfd_sizeof_headers(abfd, reloc) \ - BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) + BFD_SEND (abfd, _bfd_sizeof_headers, (abfd, reloc)) #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ - BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line)) + BFD_SEND (abfd, _bfd_find_nearest_line, \ + (abfd, sec, syms, off, file, func, line)) - /* Do these three do anything useful at all, for any back end? */ #define bfd_debug_info_start(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) + BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) #define bfd_debug_info_end(abfd) \ - BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) + BFD_SEND (abfd, _bfd_debug_info_end, (abfd)) #define bfd_debug_info_accumulate(abfd, section) \ - BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) - + BFD_SEND (abfd, _bfd_debug_info_accumulate, (abfd, section)) #define bfd_stat_arch_elt(abfd, stat) \ - BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) + BFD_SEND (abfd, _bfd_stat_arch_elt,(abfd, stat)) #define bfd_update_armap_timestamp(abfd) \ - BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) + BFD_SEND (abfd, _bfd_update_armap_timestamp, (abfd)) #define bfd_set_arch_mach(abfd, arch, mach)\ - BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) + BFD_SEND ( abfd, _bfd_set_arch_mach, (abfd, arch, mach)) #define bfd_relax_section(abfd, section, link_info, again) \ BFD_SEND (abfd, _bfd_relax_section, (abfd, section, link_info, again)) @@ -654,9 +616,8 @@ Stuff which should be documented: BFD_SEND (abfd, _bfd_canonicalize_dynamic_reloc, (abfd, arels, asyms)) extern bfd_byte *bfd_get_relocated_section_contents - PARAMS ((bfd *, struct bfd_link_info *, - struct bfd_link_order *, bfd_byte *, - boolean, asymbol **)); + (bfd *, struct bfd_link_info *, struct bfd_link_order *, bfd_byte *, + bfd_boolean, asymbol **); @end example @@ -664,7 +625,7 @@ extern bfd_byte *bfd_get_relocated_section_contents @subsubsection @code{bfd_alt_mach_code} @strong{Synopsis} @example -boolean bfd_alt_mach_code(bfd *abfd, int alternative); +bfd_boolean bfd_alt_mach_code (bfd *abfd, int alternative); @end example @strong{Description}@* When more than one machine code number is available for the @@ -673,3 +634,57 @@ the preferred one (alternative == 0) and any others. Currently, only ELF supports this feature, with up to two alternate machine codes. + +@example +struct bfd_preserve +@{ + void *marker; + void *tdata; + flagword flags; + const struct bfd_arch_info *arch_info; + struct bfd_section *sections; + struct bfd_section **section_tail; + unsigned int section_count; + struct bfd_hash_table section_htab; +@}; + +@end example +@findex bfd_preserve_save +@subsubsection @code{bfd_preserve_save} +@strong{Synopsis} +@example +bfd_boolean bfd_preserve_save (bfd *, struct bfd_preserve *); +@end example +@strong{Description}@* +When testing an object for compatibility with a particular +target back-end, the back-end object_p function needs to set +up certain fields in the bfd on successfully recognizing the +object. This typically happens in a piecemeal fashion, with +failures possible at many points. On failure, the bfd is +supposed to be restored to its initial state, which is +virtually impossible. However, restoring a subset of the bfd +state works in practice. This function stores the subset and +reinitializes the bfd. + +@findex bfd_preserve_restore +@subsubsection @code{bfd_preserve_restore} +@strong{Synopsis} +@example +void bfd_preserve_restore (bfd *, struct bfd_preserve *); +@end example +@strong{Description}@* +This function restores bfd state saved by bfd_preserve_save. +If MARKER is non-NULL in struct bfd_preserve then that block +and all subsequently bfd_alloc'd memory is freed. + +@findex bfd_preserve_finish +@subsubsection @code{bfd_preserve_finish} +@strong{Synopsis} +@example +void bfd_preserve_finish (bfd *, struct bfd_preserve *); +@end example +@strong{Description}@* +This function should be called when the bfd state saved by +bfd_preserve_save is no longer needed. ie. when the back-end +object_p function returns with success. + diff --git a/contrib/binutils/bfd/doc/bfdwin.texi b/contrib/binutils/bfd/doc/bfdwin.texi new file mode 100644 index 0000000..b1fd7d5 --- /dev/null +++ b/contrib/binutils/bfd/doc/bfdwin.texi @@ -0,0 +1,2 @@ +@findex +@subsubsection @code{} diff --git a/contrib/binutils/bfd/doc/cache.texi b/contrib/binutils/bfd/doc/cache.texi index 56d1f18..2bc3696 100644 --- a/contrib/binutils/bfd/doc/cache.texi +++ b/contrib/binutils/bfd/doc/cache.texi @@ -48,7 +48,7 @@ otherwise, it has to perform the complicated lookup function. @subsubsection @code{bfd_cache_init} @strong{Synopsis} @example -boolean bfd_cache_init (bfd *abfd); +bfd_boolean bfd_cache_init (bfd *abfd); @end example @strong{Description}@* Add a newly opened BFD to the cache. @@ -57,21 +57,21 @@ Add a newly opened BFD to the cache. @subsubsection @code{bfd_cache_close} @strong{Synopsis} @example -boolean bfd_cache_close (bfd *abfd); +bfd_boolean bfd_cache_close (bfd *abfd); @end example @strong{Description}@* Remove the BFD @var{abfd} from the cache. If the attached file is open, then close it too. @strong{Returns}@* -@code{false} is returned if closing the file fails, @code{true} is +@code{FALSE} is returned if closing the file fails, @code{TRUE} is returned if all is well. @findex bfd_open_file @subsubsection @code{bfd_open_file} @strong{Synopsis} @example -FILE* bfd_open_file(bfd *abfd); +FILE* bfd_open_file (bfd *abfd); @end example @strong{Description}@* Call the OS to open a file for @var{abfd}. Return the @code{FILE *} @@ -84,7 +84,7 @@ cache, so it won't have to be removed from it. @subsubsection @code{bfd_cache_lookup_worker} @strong{Synopsis} @example -FILE *bfd_cache_lookup_worker(bfd *abfd); +FILE *bfd_cache_lookup_worker (bfd *abfd); @end example @strong{Description}@* Called when the macro @code{bfd_cache_lookup} fails to find a diff --git a/contrib/binutils/bfd/doc/chew.c b/contrib/binutils/bfd/doc/chew.c index bdf76e4..7c060da 100644 --- a/contrib/binutils/bfd/doc/chew.c +++ b/contrib/binutils/bfd/doc/chew.c @@ -1,6 +1,6 @@ /* chew Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, - 2002 + 2002, 2003 Free Software Foundation, Inc. Contributed by steve chamberlain @cygnus @@ -494,8 +494,11 @@ paramstuff () string_type out; init_string (&out); +#define NO_PARAMS 1 + /* Make sure that it's not already param'd or proto'd. */ - if (find (tos, "PARAMS") || find (tos, "PROTO") || !find (tos, "(")) + if (NO_PARAMS + || find (tos, "PARAMS") || find (tos, "PROTO") || !find (tos, "(")) { catstr (&out, tos); } diff --git a/contrib/binutils/bfd/doc/coffcode.texi b/contrib/binutils/bfd/doc/coffcode.texi index 473747e..f9e15a6 100644 --- a/contrib/binutils/bfd/doc/coffcode.texi +++ b/contrib/binutils/bfd/doc/coffcode.texi @@ -188,7 +188,7 @@ section. This transformation uses the This routine runs though the provided symbol table and uses the offsets generated by the previous pass and the pointers generated when the symbol table was read in to create the -structured hierachy required by coff. It changes each pointer +structured hierarchy required by coff. It changes each pointer to a symbol into the index into the symbol table of the asymbol. @itemize @bullet @@ -259,7 +259,7 @@ typedef struct coff_symbol_struct struct lineno_cache_entry *lineno; /* Have the line numbers been relocated yet ? */ - boolean done_lineno; + bfd_boolean done_lineno; @} coff_symbol_type; @end example @findex bfd_coff_backend_data @@ -325,10 +325,10 @@ typedef struct unsigned int _bfd_relsz; unsigned int _bfd_linesz; unsigned int _bfd_filnmlen; - boolean _bfd_coff_long_filenames; - boolean _bfd_coff_long_section_names; + bfd_boolean _bfd_coff_long_filenames; + bfd_boolean _bfd_coff_long_section_names; unsigned int _bfd_coff_default_section_alignment_power; - boolean _bfd_coff_force_symnames_in_strings; + bfd_boolean _bfd_coff_force_symnames_in_strings; unsigned int _bfd_coff_debug_string_prefix_length; void (*_bfd_coff_swap_filehdr_in) @@ -343,32 +343,32 @@ typedef struct void (*_bfd_coff_swap_reloc_in) PARAMS ((bfd *abfd, PTR, PTR)); - boolean (*_bfd_coff_bad_format_hook) + bfd_boolean (*_bfd_coff_bad_format_hook) PARAMS ((bfd *, PTR)); - boolean (*_bfd_coff_set_arch_mach_hook) + bfd_boolean (*_bfd_coff_set_arch_mach_hook) PARAMS ((bfd *, PTR)); PTR (*_bfd_coff_mkobject_hook) PARAMS ((bfd *, PTR, PTR)); - boolean (*_bfd_styp_to_sec_flags_hook) + bfd_boolean (*_bfd_styp_to_sec_flags_hook) PARAMS ((bfd *, PTR, const char *, asection *, flagword *)); void (*_bfd_set_alignment_hook) PARAMS ((bfd *, asection *, PTR)); - boolean (*_bfd_coff_slurp_symbol_table) + bfd_boolean (*_bfd_coff_slurp_symbol_table) PARAMS ((bfd *)); - boolean (*_bfd_coff_symname_in_debug) + bfd_boolean (*_bfd_coff_symname_in_debug) PARAMS ((bfd *, struct internal_syment *)); - boolean (*_bfd_coff_pointerize_aux_hook) + bfd_boolean (*_bfd_coff_pointerize_aux_hook) PARAMS ((bfd *, combined_entry_type *, combined_entry_type *, unsigned int, combined_entry_type *)); - boolean (*_bfd_coff_print_aux) + bfd_boolean (*_bfd_coff_print_aux) PARAMS ((bfd *, FILE *, combined_entry_type *, combined_entry_type *, combined_entry_type *, unsigned int)); @@ -383,13 +383,13 @@ typedef struct enum coff_symbol_classification (*_bfd_coff_classify_symbol) PARAMS ((bfd *, struct internal_syment *)); - boolean (*_bfd_coff_compute_section_file_positions) + bfd_boolean (*_bfd_coff_compute_section_file_positions) PARAMS ((bfd *)); - boolean (*_bfd_coff_start_final_link) + bfd_boolean (*_bfd_coff_start_final_link) PARAMS ((bfd *, struct bfd_link_info *)); - boolean (*_bfd_coff_relocate_section) + bfd_boolean (*_bfd_coff_relocate_section) PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **)); @@ -398,19 +398,19 @@ typedef struct struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *)); - boolean (*_bfd_coff_adjust_symndx) + bfd_boolean (*_bfd_coff_adjust_symndx) PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, - struct internal_reloc *, boolean *)); + struct internal_reloc *, bfd_boolean *)); - boolean (*_bfd_coff_link_add_one_symbol) + bfd_boolean (*_bfd_coff_link_add_one_symbol) PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, - asection *, bfd_vma, const char *, boolean, boolean, + asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, struct bfd_link_hash_entry **)); - boolean (*_bfd_coff_link_output_has_begun) + bfd_boolean (*_bfd_coff_link_output_has_begun) PARAMS ((bfd *, struct coff_final_link_info *)); - boolean (*_bfd_coff_final_link_postscript) + bfd_boolean (*_bfd_coff_final_link_postscript) PARAMS ((bfd *, struct coff_final_link_info *)); @} bfd_coff_backend_data; @@ -480,7 +480,8 @@ typedef struct #define bfd_coff_set_arch_mach_hook(abfd, filehdr)\ ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) #define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\ - ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr)) + ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\ + (abfd, filehdr, aouthdr)) #define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\ ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ @@ -505,7 +506,8 @@ typedef struct ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ (abfd, file, base, symbol, aux, indaux)) -#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)\ +#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\ + reloc, data, src_ptr, dst_ptr)\ ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) @@ -533,7 +535,8 @@ typedef struct #define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\ ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ (obfd, info, ibfd, sec, rel, adjustedp)) -#define bfd_coff_link_add_one_symbol(info,abfd,name,flags,section,value,string,cp,coll,hashp)\ +#define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\ + value, string, cp, coll, hashp)\ ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ (info, abfd, name, flags, section, value, string, cp, coll, hashp)) diff --git a/contrib/binutils/bfd/doc/core.texi b/contrib/binutils/bfd/doc/core.texi index 08a8c25..e45759c 100644 --- a/contrib/binutils/bfd/doc/core.texi +++ b/contrib/binutils/bfd/doc/core.texi @@ -8,7 +8,7 @@ These are functions pertaining to core files. @subsubsection @code{bfd_core_file_failing_command} @strong{Synopsis} @example -const char *bfd_core_file_failing_command(bfd *abfd); +const char *bfd_core_file_failing_command (bfd *abfd); @end example @strong{Description}@* Return a read-only string explaining which program was running @@ -18,7 +18,7 @@ when it failed and produced the core file @var{abfd}. @subsubsection @code{bfd_core_file_failing_signal} @strong{Synopsis} @example -int bfd_core_file_failing_signal(bfd *abfd); +int bfd_core_file_failing_signal (bfd *abfd); @end example @strong{Description}@* Returns the signal number which caused the core dump which @@ -28,11 +28,11 @@ generated the file the BFD @var{abfd} is attached to. @subsubsection @code{core_file_matches_executable_p} @strong{Synopsis} @example -boolean core_file_matches_executable_p +bfd_boolean core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd); @end example @strong{Description}@* -Return @code{true} if the core file attached to @var{core_bfd} +Return @code{TRUE} if the core file attached to @var{core_bfd} was generated by a run of the executable file attached to -@var{exec_bfd}, @code{false} otherwise. +@var{exec_bfd}, @code{FALSE} otherwise. diff --git a/contrib/binutils/bfd/doc/fdl.texi b/contrib/binutils/bfd/doc/fdl.texi new file mode 100644 index 0000000..176233c --- /dev/null +++ b/contrib/binutils/bfd/doc/fdl.texi @@ -0,0 +1,366 @@ +@c -*-texinfo-*- +@appendix GNU Free Documentation License +@center Version 1.1, March 2000 + +@display +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. +@end display +@sp 1 +@enumerate 0 +@item +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. + +@sp 1 +@item +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. +@sp 1 +@item +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. +@sp 1 +@item +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. +@sp 1 +@item +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.@* +@sp 1 +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. +@sp 1 +@item +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.'' +@sp 1 +@item +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. +@sp 1 +@item +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. +@sp 1 +@item +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. +@sp 1 +@item +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. +@sp 1 +@item +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. + +@end enumerate + +@unnumberedsec 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 +@group +Copyright (C) @var{year} @var{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 @var{list their titles}, with the +Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}. +A copy of the license is included in the section entitled "GNU +Free Documentation License." +@end group +@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 @var{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/contrib/binutils/bfd/doc/format.texi b/contrib/binutils/bfd/doc/format.texi index d64bba1..32a1d75 100644 --- a/contrib/binutils/bfd/doc/format.texi +++ b/contrib/binutils/bfd/doc/format.texi @@ -27,7 +27,7 @@ The BFD contains the result of an executable core dump. @subsubsection @code{bfd_check_format} @strong{Synopsis} @example -boolean bfd_check_format(bfd *abfd, bfd_format format); +bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); @end example @strong{Description}@* Verify if the file attached to the BFD @var{abfd} is compatible @@ -42,7 +42,7 @@ interrogated to determine a match. If the default target 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} +The function returns @code{TRUE} on success, otherwise @code{FALSE} with one of the following error codes: @itemize @bullet @@ -70,10 +70,11 @@ more than one backend recognised the file format. @subsubsection @code{bfd_check_format_matches} @strong{Synopsis} @example -boolean bfd_check_format_matches(bfd *abfd, bfd_format format, char ***matching); +bfd_boolean bfd_check_format_matches + (bfd *abfd, bfd_format format, char ***matching); @end example @strong{Description}@* -Like @code{bfd_check_format}, except when it returns false with +Like @code{bfd_check_format}, except when it returns FALSE with @code{bfd_errno} set to @code{bfd_error_file_ambiguously_recognized}. In that case, if @var{matching} is not NULL, it will be filled in with a NULL-terminated list of the names of the formats that matched, @@ -87,7 +88,7 @@ should free it. @subsubsection @code{bfd_set_format} @strong{Synopsis} @example -boolean bfd_set_format(bfd *abfd, bfd_format format); +bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); @end example @strong{Description}@* This function sets the file format of the BFD @var{abfd} to the @@ -99,7 +100,7 @@ is not open for writing, then an error occurs. @subsubsection @code{bfd_format_string} @strong{Synopsis} @example -const char *bfd_format_string(bfd_format format); +const char *bfd_format_string (bfd_format format); @end example @strong{Description}@* Return a pointer to a const string diff --git a/contrib/binutils/bfd/doc/hash.texi b/contrib/binutils/bfd/doc/hash.texi index eb87273..3e7372c 100644 --- a/contrib/binutils/bfd/doc/hash.texi +++ b/contrib/binutils/bfd/doc/hash.texi @@ -35,7 +35,7 @@ bfd_hash_table} (defined in @code{bfd.h}) and call @code{bfd_hash_table_init} (if you know approximately how many entries you will need, the function @code{bfd_hash_table_init_n}, which takes a @var{size} argument, may be used). -@code{bfd_hash_table_init} returns @code{false} if some sort of +@code{bfd_hash_table_init} returns @code{FALSE} if some sort of error occurs. @findex bfd_hash_newfunc @@ -61,24 +61,24 @@ been allocated for a hash table. This will not free up the The function @code{bfd_hash_lookup} is used both to look up a string in the hash table and to create a new entry. -If the @var{create} argument is @code{false}, @code{bfd_hash_lookup} +If the @var{create} argument is @code{FALSE}, @code{bfd_hash_lookup} will look up a string. If the string is found, it will returns a pointer to a @code{struct bfd_hash_entry}. If the string is not found in the table @code{bfd_hash_lookup} will return @code{NULL}. You should not modify any of the fields in the returns @code{struct bfd_hash_entry}. -If the @var{create} argument is @code{true}, the string will be +If the @var{create} argument is @code{TRUE}, the string will be entered into the hash table if it is not already there. Either way a pointer to a @code{struct bfd_hash_entry} will be returned, either to the existing structure or to a newly created one. In this case, a @code{NULL} return means that an error occurred. -If the @var{create} argument is @code{true}, and a new entry is +If the @var{create} argument is @code{TRUE}, and a new entry is created, the @var{copy} argument is used to decide whether to copy the string onto the hash table objalloc or not. If -@var{copy} is passed as @code{false}, you must be careful not to +@var{copy} is passed as @code{FALSE}, you must be careful not to deallocate or modify the string as long as the hash table exists. @@ -95,7 +95,7 @@ hash table entry (a @code{struct bfd_hash_entry *}) and the generic pointer passed to @code{bfd_hash_traverse}. The function must return a @code{boolean} value, which indicates whether to continue traversing the hash table. If the function returns -@code{false}, @code{bfd_hash_traverse} will stop the traversal and +@code{FALSE}, @code{bfd_hash_traverse} will stop the traversal and return immediately. @node Deriving a New Hash Table Type, , Traversing a Hash Table, Hash Tables diff --git a/contrib/binutils/bfd/doc/init.texi b/contrib/binutils/bfd/doc/init.texi index e561a77..0905f6b 100644 --- a/contrib/binutils/bfd/doc/init.texi +++ b/contrib/binutils/bfd/doc/init.texi @@ -5,7 +5,7 @@ These are the functions that handle initializing a BFD. @subsubsection @code{bfd_init} @strong{Synopsis} @example -void bfd_init(void); +void bfd_init (void); @end example @strong{Description}@* This routine must be called before any other BFD function to diff --git a/contrib/binutils/bfd/doc/libbfd.texi b/contrib/binutils/bfd/doc/libbfd.texi index b28650f..5c9ced0 100644 --- a/contrib/binutils/bfd/doc/libbfd.texi +++ b/contrib/binutils/bfd/doc/libbfd.texi @@ -10,7 +10,7 @@ completeness. @subsubsection @code{bfd_write_bigendian_4byte_int} @strong{Synopsis} @example -boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int); +bfd_boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int); @end example @strong{Description}@* Write a 4 byte integer @var{i} to the output BFD @var{abfd}, in big @@ -43,54 +43,54 @@ To detect calling these with less than a @code{bfd_vma}, use /* 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)) = (val) & 0xff)) #define bfd_put_signed_8 \ - bfd_put_8 + bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(unsigned char *) (ptr) & 0xff) + (*(unsigned char *) (ptr) & 0xff) #define bfd_get_signed_8(abfd, ptr) \ - (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) + (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ - BFD_SEND(abfd, bfd_putx16, ((val),(ptr))) + BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) #define bfd_put_signed_16 \ - bfd_put_16 + bfd_put_16 #define bfd_get_16(abfd, ptr) \ - BFD_SEND(abfd, bfd_getx16, (ptr)) + BFD_SEND (abfd, bfd_getx16, (ptr)) #define bfd_get_signed_16(abfd, ptr) \ - BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) + BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) #define bfd_put_32(abfd, val, ptr) \ - BFD_SEND(abfd, bfd_putx32, ((val),(ptr))) + BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) #define bfd_put_signed_32 \ - bfd_put_32 + bfd_put_32 #define bfd_get_32(abfd, ptr) \ - BFD_SEND(abfd, bfd_getx32, (ptr)) + BFD_SEND (abfd, bfd_getx32, (ptr)) #define bfd_get_signed_32(abfd, ptr) \ - BFD_SEND(abfd, bfd_getx_signed_32, (ptr)) + BFD_SEND (abfd, bfd_getx_signed_32, (ptr)) #define bfd_put_64(abfd, val, ptr) \ - BFD_SEND(abfd, bfd_putx64, ((val), (ptr))) + BFD_SEND (abfd, bfd_putx64, ((val), (ptr))) #define bfd_put_signed_64 \ - bfd_put_64 + bfd_put_64 #define bfd_get_64(abfd, ptr) \ - BFD_SEND(abfd, bfd_getx64, (ptr)) + BFD_SEND (abfd, bfd_getx64, (ptr)) #define bfd_get_signed_64(abfd, ptr) \ - BFD_SEND(abfd, bfd_getx_signed_64, (ptr)) - -#define bfd_get(bits, abfd, ptr) \ - ( (bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ - : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ - : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ - : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ - : (abort (), (bfd_vma) - 1)) - -#define bfd_put(bits, abfd, val, ptr) \ - ( (bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ - : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ - : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ - : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ - : (abort (), (void) 0)) + BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) + +#define bfd_get(bits, abfd, ptr) \ + ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ + : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ + : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ + : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ + : (abort (), (bfd_vma) - 1)) + +#define bfd_put(bits, abfd, val, ptr) \ + ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ + : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ + : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ + : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ + : (abort (), (void) 0)) @end example @@ -142,52 +142,24 @@ order and their data in little endian order. #define bfd_h_get_signed_64(abfd, ptr) \ BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) -/* Refinements on the above, which should eventually go away. Save - cluttering the source with (bfd_vma) and (bfd_byte *) casts. */ - -#define H_PUT_64(abfd, val, where) \ - bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_32(abfd, val, where) \ - bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_16(abfd, val, where) \ - bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_8 bfd_h_put_8 - -#define H_PUT_S64(abfd, val, where) \ - bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_S32(abfd, val, where) \ - bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_S16(abfd, val, where) \ - bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_S8 bfd_h_put_signed_8 - -#define H_GET_64(abfd, where) \ - bfd_h_get_64 ((abfd), (bfd_byte *) (where)) - -#define H_GET_32(abfd, where) \ - bfd_h_get_32 ((abfd), (bfd_byte *) (where)) - -#define H_GET_16(abfd, where) \ - bfd_h_get_16 ((abfd), (bfd_byte *) (where)) - -#define H_GET_8 bfd_h_get_8 - -#define H_GET_S64(abfd, where) \ - bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where)) - -#define H_GET_S32(abfd, where) \ - bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where)) - -#define H_GET_S16(abfd, where) \ - bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where)) - -#define H_GET_S8 bfd_h_get_signed_8 +/* Aliases for the above, which should eventually go away. */ + +#define H_PUT_64 bfd_h_put_64 +#define H_PUT_32 bfd_h_put_32 +#define H_PUT_16 bfd_h_put_16 +#define H_PUT_8 bfd_h_put_8 +#define H_PUT_S64 bfd_h_put_signed_64 +#define H_PUT_S32 bfd_h_put_signed_32 +#define H_PUT_S16 bfd_h_put_signed_16 +#define H_PUT_S8 bfd_h_put_signed_8 +#define H_GET_64 bfd_h_get_64 +#define H_GET_32 bfd_h_get_32 +#define H_GET_16 bfd_h_get_16 +#define H_GET_8 bfd_h_get_8 +#define H_GET_S64 bfd_h_get_signed_64 +#define H_GET_S32 bfd_h_get_signed_32 +#define H_GET_S16 bfd_h_get_signed_16 +#define H_GET_S8 bfd_h_get_signed_8 @end example diff --git a/contrib/binutils/bfd/doc/linker.texi b/contrib/binutils/bfd/doc/linker.texi index 5105cc7..f2e2bc1 100644 --- a/contrib/binutils/bfd/doc/linker.texi +++ b/contrib/binutils/bfd/doc/linker.texi @@ -55,7 +55,7 @@ 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 +(this index number is used so that when doing a relocatable 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 @@ -158,7 +158,7 @@ If the @code{_bfd_final_link} routine is also going to need to read the symbol information, the @code{_bfd_link_add_symbols} routine should save it somewhere attached to the object file BFD. However, the information should only be saved if the -@code{keep_memory} field of the @code{info} argument is true, so +@code{keep_memory} field of the @code{info} argument is TRUE, so that the @code{-no-keep-memory} linker switch is effective. The a.out function which adds symbols from an object file is @@ -229,7 +229,7 @@ which has several aspects. It must relocate the contents of the input sections and copy the data into the output sections. It must build an output symbol table including any local symbols from the input files and the global symbols from the -hash table. When producing relocateable output, it must +hash table. When producing relocatable output, it must modify the input relocs and write them into the output file. There may also be object format dependent work to be done. @@ -266,7 +266,7 @@ various input sections, fill constants, and, eventually, other types of information. They also describe relocs that must be created by the BFD backend, but do not correspond to any input file; this is used to support -Ur, which builds constructors -while generating a relocateable object file. +while generating a relocatable object file. @node Relocating the section contents, Writing the symbol table, Information provided by the linker, Performing the Final Link @subsubsection Relocating the section contents @@ -285,7 +285,7 @@ output section in terms of a section belonging to one of the input files. The @code{_bfd_final_link} function should read the contents of the section and any associated relocs, apply the relocs to the section contents, and write out the modified -section contents. If performing a relocateable link, the +section contents. If performing a relocatable link, the relocs themselves must also be modified and written out. @findex _bfd_relocate_contents @@ -352,7 +352,7 @@ file at the end of @code{NAME(aout,final_link)}. @subsubsection @code{bfd_link_split_section} @strong{Synopsis} @example -boolean bfd_link_split_section(bfd *abfd, asection *sec); +bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); @end example @strong{Description}@* Return nonzero if @var{sec} should be split during a diff --git a/contrib/binutils/bfd/doc/mmo.texi b/contrib/binutils/bfd/doc/mmo.texi new file mode 100644 index 0000000..c308952 --- /dev/null +++ b/contrib/binutils/bfd/doc/mmo.texi @@ -0,0 +1,365 @@ +@section mmo backend +The mmo object format is used exclusively together with Professor +Donald E.@: Knuth's educational 64-bit processor MMIX. The simulator +@command{mmix} which is available at +@url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz} +understands this format. That package also includes a combined +assembler and linker called @command{mmixal}. The mmo format has +no advantages feature-wise compared to e.g. ELF. It is a simple +non-relocatable object format with no support for archives or +debugging information, except for symbol value information and +line numbers (which is not yet implemented in BFD). See +@url{http://www-cs-faculty.stanford.edu/~knuth/mmix.html} for more +information about MMIX. The ELF format is used for intermediate +object files in the BFD implementation. + +@c We want to xref the symbol table node. A feature in "chew" +@c requires that "commands" do not contain spaces in the +@c arguments. Hence the hyphen in "Symbol-table". +@menu +* File layout:: +* Symbol-table:: +* mmo section mapping:: +@end menu + +@node File layout, Symbol-table, mmo, mmo +@subsection File layout +The mmo file contents is not partitioned into named sections as +with e.g.@: ELF. Memory areas is formed by specifying the +location of the data that follows. Only the memory area +@samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} is executable, so +it is used for code (and constants) and the area +@samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} is used for +writable data. @xref{mmo section mapping}. + +Contents is entered as 32-bit words, xor:ed over previous +contents, always zero-initialized. A word that starts with the +byte @samp{0x98} forms a command called a @samp{lopcode}, where +the next byte distinguished between the thirteen lopcodes. The +two remaining bytes, called the @samp{Y} and @samp{Z} fields, or +the @samp{YZ} field (a 16-bit big-endian number), are used for +various purposes different for each lopcode. As documented in +@url{http://www-cs-faculty.stanford.edu/~knuth/mmixal-intro.ps.gz}, +the lopcodes are: + +There is provision for specifying ``special data'' of 65536 +different types. We use type 80 (decimal), arbitrarily chosen the +same as the ELF @code{e_machine} number for MMIX, filling it with +section information normally found in ELF objects. @xref{mmo +section mapping}. + +@table @code +@item lop_quote +0x98000001. The next word is contents, regardless of whether it +starts with 0x98 or not. + +@item lop_loc +0x9801YYZZ, where @samp{Z} is 1 or 2. This is a location +directive, setting the location for the next data to the next +32-bit word (for @math{Z = 1}) or 64-bit word (for @math{Z = 2}), +plus @math{Y * 2^56}. Normally @samp{Y} is 0 for the text segment +and 2 for the data segment. + +@item lop_skip +0x9802YYZZ. Increase the current location by @samp{YZ} bytes. + +@item lop_fixo +0x9803YYZZ, where @samp{Z} is 1 or 2. Store the current location +as 64 bits into the location pointed to by the next 32-bit +(@math{Z = 1}) or 64-bit (@math{Z = 2}) word, plus @math{Y * +2^56}. + +@item lop_fixr +0x9804YYZZ. @samp{YZ} is stored into the current location plus +@math{2 - 4 * YZ}. + +@item lop_fixrx +0x980500ZZ. @samp{Z} is 16 or 24. A value @samp{L} derived from +the following 32-bit word are used in a manner similar to +@samp{YZ} in lop_fixr: it is xor:ed into the current location +minus @math{4 * L}. The first byte of the word is 0 or 1. If it +is 1, then @math{L = (@var{lowest 24 bits of word}) - 2^Z}, if 0, +then @math{L = (@var{lowest 24 bits of word})}. + +@item lop_file +0x9806YYZZ. @samp{Y} is the file number, @samp{Z} is count of +32-bit words. Set the file number to @samp{Y} and the line +counter to 0. The next @math{Z * 4} bytes contain the file name, +padded with zeros if the count is not a multiple of four. The +same @samp{Y} may occur multiple times, but @samp{Z} must be 0 for +all but the first occurrence. + +@item lop_line +0x9807YYZZ. @samp{YZ} is the line number. Together with +lop_file, it forms the source location for the next 32-bit word. +Note that for each non-lopcode 32-bit word, line numbers are +assumed incremented by one. + +@item lop_spec +0x9808YYZZ. @samp{YZ} is the type number. Data until the next +lopcode other than lop_quote forms special data of type @samp{YZ}. +@xref{mmo section mapping}. + +Other types than 80, (or type 80 with a content that does not +parse) is stored in sections named @code{.MMIX.spec_data.@var{n}} +where @var{n} is the @samp{YZ}-type. The flags for such a +sections say not to allocate or load the data. The vma is 0. +Contents of multiple occurrences of special data @var{n} is +concatenated to the data of the previous lop_spec @var{n}s. The +location in data or code at which the lop_spec occurred is lost. + +@item lop_pre +0x980901ZZ. The first lopcode in a file. The @samp{Z} field forms the +length of header information in 32-bit words, where the first word +tells the time in seconds since @samp{00:00:00 GMT Jan 1 1970}. + +@item lop_post +0x980a00ZZ. @math{Z > 32}. This lopcode follows after all +content-generating lopcodes in a program. The @samp{Z} field +denotes the value of @samp{rG} at the beginning of the program. +The following @math{256 - Z} big-endian 64-bit words are loaded +into global registers @samp{$G} @dots{} @samp{$255}. + +@item lop_stab +0x980b0000. The next-to-last lopcode in a program. Must follow +immediately after the lop_post lopcode and its data. After this +lopcode follows all symbols in a compressed format +(@pxref{Symbol-table}). + +@item lop_end +0x980cYYZZ. The last lopcode in a program. It must follow the +lop_stab lopcode and its data. The @samp{YZ} field contains the +number of 32-bit words of symbol table information after the +preceding lop_stab lopcode. +@end table + +Note that the lopcode "fixups"; @code{lop_fixr}, @code{lop_fixrx} and +@code{lop_fixo} are not generated by BFD, but are handled. They are +generated by @code{mmixal}. + +This trivial one-label, one-instruction file: + +@example + :Main TRAP 1,2,3 +@end example + +can be represented this way in mmo: + +@example + 0x98090101 - lop_pre, one 32-bit word with timestamp. + + 0x98010002 - lop_loc, text segment, using a 64-bit address. + Note that mmixal does not emit this for the file above. + 0x00000000 - Address, high 32 bits. + 0x00000000 - Address, low 32 bits. + 0x98060002 - lop_file, 2 32-bit words for file-name. + 0x74657374 - "test" + 0x2e730000 - ".s\0\0" + 0x98070001 - lop_line, line 1. + 0x00010203 - TRAP 1,2,3 + 0x980a00ff - lop_post, setting $255 to 0. + 0x00000000 + 0x00000000 + 0x980b0000 - lop_stab for ":Main" = 0, serial 1. + 0x203a4040 @xref{Symbol-table}. + 0x10404020 + 0x4d206120 + 0x69016e00 + 0x81000000 + 0x980c0005 - lop_end; symbol table contained five 32-bit words. +@end example +@node Symbol-table, mmo section mapping, File layout, mmo +@subsection Symbol table format +From mmixal.w (or really, the generated mmixal.tex) in +@url{http://www-cs-faculty.stanford.edu/~knuth/programs/mmix.tar.gz}): +``Symbols are stored and retrieved by means of a @samp{ternary +search trie}, following ideas of Bentley and Sedgewick. (See +ACM--SIAM Symp.@: on Discrete Algorithms @samp{8} (1997), 360--369; +R.@:Sedgewick, @samp{Algorithms in C} (Reading, Mass.@: +Addison--Wesley, 1998), @samp{15.4}.) Each trie node stores a +character, and there are branches to subtries for the cases where +a given character is less than, equal to, or greater than the +character in the trie. There also is a pointer to a symbol table +entry if a symbol ends at the current node.'' + +So it's a tree encoded as a stream of bytes. The stream of bytes +acts on a single virtual global symbol, adding and removing +characters and signalling complete symbol points. Here, we read +the stream and create symbols at the completion points. + +First, there's a control byte @code{m}. If any of the listed bits +in @code{m} is nonzero, we execute what stands at the right, in +the listed order: + +@example + (MMO3_LEFT) + 0x40 - Traverse left trie. + (Read a new command byte and recurse.) + + (MMO3_SYMBITS) + 0x2f - Read the next byte as a character and store it in the + current character position; increment character position. + Test the bits of @code{m}: + + (MMO3_WCHAR) + 0x80 - The character is 16-bit (so read another byte, + merge into current character. + + (MMO3_TYPEBITS) + 0xf - We have a complete symbol; parse the type, value + and serial number and do what should be done + with a symbol. The type and length information + is in j = (m & 0xf). + + (MMO3_REGQUAL_BITS) + j == 0xf: A register variable. The following + byte tells which register. + j <= 8: An absolute symbol. Read j bytes as the + big-endian number the symbol equals. + A j = 2 with two zero bytes denotes an + unknown symbol. + j > 8: As with j <= 8, but add (0x20 << 56) + to the value in the following j - 8 + bytes. + + Then comes the serial number, as a variant of + uleb128, but better named ubeb128: + Read bytes and shift the previous value left 7 + (multiply by 128). Add in the new byte, repeat + until a byte has bit 7 set. The serial number + is the computed value minus 128. + + (MMO3_MIDDLE) + 0x20 - Traverse middle trie. (Read a new command byte + and recurse.) Decrement character position. + + (MMO3_RIGHT) + 0x10 - Traverse right trie. (Read a new command byte and + recurse.) +@end example + +Let's look again at the @code{lop_stab} for the trivial file +(@pxref{File layout}). + +@example + 0x980b0000 - lop_stab for ":Main" = 0, serial 1. + 0x203a4040 + 0x10404020 + 0x4d206120 + 0x69016e00 + 0x81000000 +@end example + +This forms the trivial trie (note that the path between ``:'' and +``M'' is redundant): + +@example + 203a ":" + 40 / + 40 / + 10 \ + 40 / + 40 / + 204d "M" + 2061 "a" + 2069 "i" + 016e "n" is the last character in a full symbol, and + with a value represented in one byte. + 00 The value is 0. + 81 The serial number is 1. +@end example + +@node mmo section mapping, , Symbol-table, mmo +@subsection mmo section mapping +The implementation in BFD uses special data type 80 (decimal) to +encapsulate and describe named sections, containing e.g.@: debug +information. If needed, any datum in the encapsulation will be +quoted using lop_quote. First comes a 32-bit word holding the +number of 32-bit words containing the zero-terminated zero-padded +segment name. After the name there's a 32-bit word holding flags +describing the section type. Then comes a 64-bit big-endian word +with the section length (in bytes), then another with the section +start address. Depending on the type of section, the contents +might follow, zero-padded to 32-bit boundary. For a loadable +section (such as data or code), the contents might follow at some +later point, not necessarily immediately, as a lop_loc with the +same start address as in the section description, followed by the +contents. This in effect forms a descriptor that must be emitted +before the actual contents. Sections described this way must not +overlap. + +For areas that don't have such descriptors, synthetic sections are +formed by BFD. Consecutive contents in the two memory areas +@samp{0x0000@dots{}00} to @samp{0x01ff@dots{}ff} and +@samp{0x2000@dots{}00} to @samp{0x20ff@dots{}ff} are entered in +sections named @code{.text} and @code{.data} respectively. If an area +is not otherwise described, but would together with a neighboring +lower area be less than @samp{0x40000000} bytes long, it is joined +with the lower area and the gap is zero-filled. For other cases, +a new section is formed, named @code{.MMIX.sec.@var{n}}. Here, +@var{n} is a number, a running count through the mmo file, +starting at 0. + +A loadable section specified as: + +@example + .section secname,"ax" + TETRA 1,2,3,4,-1,-2009 + BYTE 80 +@end example + +and linked to address @samp{0x4}, is represented by the sequence: + +@example + 0x98080050 - lop_spec 80 + 0x00000002 - two 32-bit words for the section name + 0x7365636e - "secn" + 0x616d6500 - "ame\0" + 0x00000033 - flags CODE, READONLY, LOAD, ALLOC + 0x00000000 - high 32 bits of section length + 0x0000001c - section length is 28 bytes; 6 * 4 + 1 + alignment to 32 bits + 0x00000000 - high 32 bits of section address + 0x00000004 - section address is 4 + 0x98010002 - 64 bits with address of following data + 0x00000000 - high 32 bits of address + 0x00000004 - low 32 bits: data starts at address 4 + 0x00000001 - 1 + 0x00000002 - 2 + 0x00000003 - 3 + 0x00000004 - 4 + 0xffffffff - -1 + 0xfffff827 - -2009 + 0x50000000 - 80 as a byte, padded with zeros. +@end example + +Note that the lop_spec wrapping does not include the section +contents. Compare this to a non-loaded section specified as: + +@example + .section thirdsec + TETRA 200001,100002 + BYTE 38,40 +@end example + +This, when linked to address @samp{0x200000000000001c}, is +represented by: + +@example + 0x98080050 - lop_spec 80 + 0x00000002 - two 32-bit words for the section name + 0x7365636e - "thir" + 0x616d6500 - "dsec" + 0x00000010 - flag READONLY + 0x00000000 - high 32 bits of section length + 0x0000000c - section length is 12 bytes; 2 * 4 + 2 + alignment to 32 bits + 0x20000000 - high 32 bits of address + 0x0000001c - low 32 bits of address 0x200000000000001c + 0x00030d41 - 200001 + 0x000186a2 - 100002 + 0x26280000 - 38, 40 as bytes, padded with zeros +@end example + +For the latter example, the section contents must not be +loaded in memory, and is therefore specified as part of the +special data. The address is usually unimportant but might +provide information for e.g.@: the DWARF 2 debugging format. diff --git a/contrib/binutils/bfd/doc/opncls.texi b/contrib/binutils/bfd/doc/opncls.texi index 6c778f9..8cd2ab9 100644 --- a/contrib/binutils/bfd/doc/opncls.texi +++ b/contrib/binutils/bfd/doc/opncls.texi @@ -5,7 +5,7 @@ @subsubsection @code{bfd_openr} @strong{Synopsis} @example -bfd *bfd_openr(const char *filename, const char *target); +bfd *bfd_openr (const char *filename, const char *target); @end example @strong{Description}@* Open the file @var{filename} (using @code{fopen}) with the target @@ -15,37 +15,38 @@ Calls @code{bfd_find_target}, so @var{target} is interpreted as by that function. If @code{NULL} is returned then an error has occured. Possible errors -are @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} or @code{system_call} error. +are @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} or +@code{system_call} error. @findex bfd_fdopenr @subsubsection @code{bfd_fdopenr} @strong{Synopsis} @example -bfd *bfd_fdopenr(const char *filename, const char *target, int fd); +bfd *bfd_fdopenr (const char *filename, const char *target, int fd); @end example @strong{Description}@* -@code{bfd_fdopenr} is to @code{bfd_fopenr} much like @code{fdopen} is to @code{fopen}. -It opens a BFD on a file already described by the @var{fd} -supplied. +@code{bfd_fdopenr} is to @code{bfd_fopenr} much like @code{fdopen} is to +@code{fopen}. It opens a BFD on a file already described by the +@var{fd} supplied. -When the file is later @code{bfd_close}d, the file descriptor will be closed. +When the file is later @code{bfd_close}d, the file descriptor will +be closed. If the caller desires that this file descriptor be +cached by BFD (opened as needed, closed as needed to free +descriptors for other opens), with the supplied @var{fd} used as +an initial file descriptor (but subject to closure at any time), +call bfd_set_cacheable(bfd, 1) on the returned BFD. The default +is to assume no caching; the file descriptor will remain open +until @code{bfd_close}, and will not be affected by BFD operations +on other files. -If the caller desires that this file descriptor be cached by BFD -(opened as needed, closed as needed to free descriptors for -other opens), with the supplied @var{fd} used as an initial -file descriptor (but subject to closure at any time), call -bfd_set_cacheable(bfd, 1) on the returned BFD. The default is to -assume no cacheing; the file descriptor will remain open until -@code{bfd_close}, and will not be affected by BFD operations on other -files. - -Possible errors are @code{bfd_error_no_memory}, @code{bfd_error_invalid_target} and @code{bfd_error_system_call}. +Possible errors are @code{bfd_error_no_memory}, +@code{bfd_error_invalid_target} and @code{bfd_error_system_call}. @findex bfd_openstreamr @subsubsection @code{bfd_openstreamr} @strong{Synopsis} @example -bfd *bfd_openstreamr(const char *, const char *, PTR); +bfd *bfd_openstreamr (const char *, const char *, void *); @end example @strong{Description}@* Open a BFD for read access on an existing stdio stream. When @@ -55,7 +56,7 @@ the BFD is passed to @code{bfd_close}, the stream will be closed. @subsubsection @code{bfd_openw} @strong{Synopsis} @example -bfd *bfd_openw(const char *filename, const char *target); +bfd *bfd_openw (const char *filename, const char *target); @end example @strong{Description}@* Create a BFD, associated with file @var{filename}, using the @@ -68,13 +69,13 @@ Possible errors are @code{bfd_error_system_call}, @code{bfd_error_no_memory}, @subsubsection @code{bfd_close} @strong{Synopsis} @example -boolean bfd_close(bfd *abfd); +bfd_boolean bfd_close (bfd *abfd); @end example @strong{Description}@* -Close a BFD. If the BFD was open for writing, -then pending operations are completed and the file written out -and closed. If the created file is executable, then -@code{chmod} is called to mark it as such. +Close a BFD. If the BFD was open for writing, then pending +operations are completed and the file written out and closed. +If the created file is executable, then @code{chmod} is called +to mark it as such. All memory attached to the BFD is released. @@ -82,19 +83,19 @@ The file descriptor associated with the BFD is closed (even if it was passed in to BFD by @code{bfd_fdopenr}). @strong{Returns}@* -@code{true} is returned if all is ok, otherwise @code{false}. +@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. @findex bfd_close_all_done @subsubsection @code{bfd_close_all_done} @strong{Synopsis} @example -boolean bfd_close_all_done(bfd *); +bfd_boolean bfd_close_all_done (bfd *); @end example @strong{Description}@* -Close a BFD. Differs from @code{bfd_close} -since it does not complete any pending operations. This -routine would be used if the application had just used BFD for -swapping and didn't want to use any of the writing code. +Close a BFD. Differs from @code{bfd_close} since it does not +complete any pending operations. This routine would be used +if the application had just used BFD for swapping and didn't +want to use any of the writing code. If the created file is executable, then @code{chmod} is called to mark it as such. @@ -102,25 +103,24 @@ to mark it as such. All memory attached to the BFD is released. @strong{Returns}@* -@code{true} is returned if all is ok, otherwise @code{false}. +@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. @findex bfd_create @subsubsection @code{bfd_create} @strong{Synopsis} @example -bfd *bfd_create(const char *filename, bfd *templ); +bfd *bfd_create (const char *filename, bfd *templ); @end example @strong{Description}@* -Create a new BFD in the manner of -@code{bfd_openw}, but without opening a file. The new BFD -takes the target from the target used by @var{template}. The -format is always set to @code{bfd_object}. +Create a new BFD in the manner of @code{bfd_openw}, but without +opening a file. The new BFD takes the target from the target +used by @var{template}. The format is always set to @code{bfd_object}. @findex bfd_make_writable @subsubsection @code{bfd_make_writable} @strong{Synopsis} @example -boolean bfd_make_writable(bfd *abfd); +bfd_boolean bfd_make_writable (bfd *abfd); @end example @strong{Description}@* Takes a BFD as created by @code{bfd_create} and converts it @@ -129,13 +129,13 @@ by converting the BFD to BFD_IN_MEMORY. It's assumed that you will call @code{bfd_make_readable} on this bfd later. @strong{Returns}@* -@code{true} is returned if all is ok, otherwise @code{false}. +@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. @findex bfd_make_readable @subsubsection @code{bfd_make_readable} @strong{Synopsis} @example -boolean bfd_make_readable(bfd *abfd); +bfd_boolean bfd_make_readable (bfd *abfd); @end example @strong{Description}@* Takes a BFD as created by @code{bfd_create} and @@ -145,15 +145,121 @@ contents out to the memory buffer, then reversing the direction. @strong{Returns}@* -@code{true} is returned if all is ok, otherwise @code{false}. +@code{TRUE} is returned if all is ok, otherwise @code{FALSE}. @findex bfd_alloc @subsubsection @code{bfd_alloc} @strong{Synopsis} @example -PTR bfd_alloc (bfd *abfd, size_t wanted); +void *bfd_alloc (bfd *abfd, size_t wanted); @end example @strong{Description}@* Allocate a block of @var{wanted} bytes of memory attached to @code{abfd} and return a pointer to it. +@findex bfd_calc_gnu_debuglink_crc32 +@subsubsection @code{bfd_calc_gnu_debuglink_crc32} +@strong{Synopsis} +@example +unsigned long bfd_calc_gnu_debuglink_crc32 + (unsigned long crc, const unsigned char *buf, bfd_size_type len); +@end example +@strong{Description}@* +Computes a CRC value as used in the .gnu_debuglink section. +Advances the previously computed @var{crc} value by computing +and adding in the crc32 for @var{len} bytes of @var{buf}. + +@strong{Returns}@* +Return the updated CRC32 value. + +@findex get_debug_link_info +@subsubsection @code{get_debug_link_info} +@strong{Synopsis} +@example +char *get_debug_link_info (bfd *abfd, unsigned long *crc32_out); +@end example +@strong{Description}@* +fetch the filename and CRC32 value for any separate debuginfo +associated with @var{abfd}. Return NULL if no such info found, +otherwise return filename and update @var{crc32_out}. + +@findex separate_debug_file_exists +@subsubsection @code{separate_debug_file_exists} +@strong{Synopsis} +@example +bfd_boolean separate_debug_file_exists + (char *name, unsigned long crc32); +@end example +@strong{Description}@* +Checks to see if @var{name} is a file and if its contents +match @var{crc32}. + +@findex find_separate_debug_file +@subsubsection @code{find_separate_debug_file} +@strong{Synopsis} +@example +char *find_separate_debug_file (bfd *abfd); +@end example +@strong{Description}@* +Searches @var{abfd} for a reference to separate debugging +information, scans various locations in the filesystem, including +the file tree rooted at @var{debug_file_directory}, and returns a +filename of such debugging information if the file is found and has +matching CRC32. Returns NULL if no reference to debugging file +exists, or file cannot be found. + +@findex bfd_follow_gnu_debuglink +@subsubsection @code{bfd_follow_gnu_debuglink} +@strong{Synopsis} +@example +char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); +@end example +@strong{Description}@* +Takes a BFD and searches it for a .gnu_debuglink section. If this +section is found, it examines the section for the name and checksum +of a '.debug' file containing auxiliary debugging information. It +then searches the filesystem for this .debug file in some standard +locations, including the directory tree rooted at @var{dir}, and if +found returns the full filename. + +If @var{dir} is NULL, it will search a default path configured into +libbfd at build time. [XXX this feature is not currently +implemented]. + +@strong{Returns}@* +@code{NULL} on any errors or failure to locate the .debug file, +otherwise a pointer to a heap-allocated string containing the +filename. The caller is responsible for freeing this string. + +@findex bfd_create_gnu_debuglink_section +@subsubsection @code{bfd_create_gnu_debuglink_section} +@strong{Synopsis} +@example +struct bfd_section *bfd_create_gnu_debuglink_section + (bfd *abfd, const char *filename); +@end example +@strong{Description}@* +Takes a @var{BFD} and adds a .gnu_debuglink section to it. The section is sized +to be big enough to contain a link to the specified @var{filename}. + +@strong{Returns}@* +A pointer to the new section is returned if all is ok. Otherwise @code{NULL} is +returned and bfd_error is set. + +@findex bfd_fill_in_gnu_debuglink_section +@subsubsection @code{bfd_fill_in_gnu_debuglink_section} +@strong{Synopsis} +@example +bfd_boolean bfd_fill_in_gnu_debuglink_section + (bfd *abfd, struct bfd_section *sect, const char *filename); +@end example +@strong{Description}@* +Takes a @var{BFD} and containing a .gnu_debuglink section @var{SECT} +and fills in the contents of the section to contain a link to the +specified @var{filename}. The filename should be relative to the +current directory. + +@strong{Returns}@* +@code{TRUE} is returned if all is ok. Otherwise @code{FALSE} is returned +and bfd_error is set. + diff --git a/contrib/binutils/bfd/doc/reloc.texi b/contrib/binutils/bfd/doc/reloc.texi index 1ebd430..9253a33 100644 --- a/contrib/binutils/bfd/doc/reloc.texi +++ b/contrib/binutils/bfd/doc/reloc.texi @@ -60,7 +60,7 @@ typedef enum bfd_reloc_status typedef struct reloc_cache_entry @{ /* A pointer into the canonical table of pointers. */ - struct symbol_cache_entry **sym_ptr_ptr; + struct bfd_symbol **sym_ptr_ptr; /* offset in section. */ bfd_size_type address; @@ -84,15 +84,16 @@ Here is a description of each of the fields within an @code{arelent}: @code{sym_ptr_ptr} @end itemize The symbol table pointer points to a pointer to the symbol -associated with the relocation request. It is -the pointer into the table returned by the back end's -@code{get_symtab} action. @xref{Symbols}. The symbol is referenced -through a pointer to a pointer so that tools like the linker -can fix up all the symbols of the same name by modifying only -one pointer. The relocation routine looks in the symbol and -uses the base of the section the symbol is attached to and the -value of the symbol as the initial relocation offset. If the -symbol pointer is zero, then the section provided is looked up. +associated with the relocation request. It is the pointer +into the table returned by the back end's +@code{canonicalize_symtab} action. @xref{Symbols}. The symbol is +referenced through a pointer to a pointer so that tools like +the linker can fix up all the symbols of the same name by +modifying only one pointer. The relocation routine looks in +the symbol and uses the base of the section the symbol is +attached to and the value of the symbol as the initial +relocation offset. If the symbol pointer is zero, then the +section provided is looked up. @itemize @bullet @@ -254,7 +255,7 @@ information that libbfd needs to know to tie up a back end's data. @example -struct symbol_cache_entry; /* Forward declaration. */ +struct bfd_symbol; /* Forward declaration. */ struct reloc_howto_struct @{ @@ -283,7 +284,7 @@ struct reloc_howto_struct data section of the addend. The relocation function will subtract from the relocation value the address of the location being relocated. */ - boolean pc_relative; + bfd_boolean pc_relative; /* The bit position of the reloc value in the destination. The relocated value is left shifted by this amount. */ @@ -295,11 +296,11 @@ struct reloc_howto_struct /* If this field is non null, then the supplied function is called rather than the normal function. This allows really - strange relocation methods to be accomodated (e.g., i960 callj + strange relocation methods to be accommodated (e.g., i960 callj instructions). */ bfd_reloc_status_type (*special_function) - PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *, - bfd *, char **)); + (bfd *, arelent *, struct bfd_symbol *, void *, asection *, + bfd *, char **); /* The textual name of the relocation type. */ char *name; @@ -319,21 +320,20 @@ struct reloc_howto_struct USE_REL targets set this field to TRUE. Why this is so is peculiar to each particular target. For relocs that aren't used in partial links (e.g. GOT stuff) it doesn't matter what this is set to. */ - boolean partial_inplace; - - /* The src_mask selects which parts of the read in data - are to be used in the relocation sum. E.g., if this was an 8 bit - byte of data which we read and relocated, this would be - 0x000000ff. When we have relocs which have an addend, such as - sun4 extended relocs, the value in the offset part of a - relocating field is garbage so we never use it. In this case - the mask would be 0x00000000. */ + bfd_boolean partial_inplace; + + /* src_mask selects the part of the instruction (or data) to be used + in the relocation sum. If the target relocations don't have an + addend in the reloc, eg. ELF USE_REL, src_mask will normally equal + dst_mask to extract the addend from the section contents. If + relocations do have an addend in the reloc, eg. ELF USE_RELA, this + field should be zero. Non-zero values for ELF USE_RELA targets are + bogus as in those cases the value in the dst_mask part of the + section contents should be treated as garbage. */ bfd_vma src_mask; - /* The dst_mask selects which parts of the instruction are replaced - into the instruction. In most cases src_mask == dst_mask, - except in the above special case, where dst_mask would be - 0x000000ff, and src_mask would be 0x00000000. */ + /* dst_mask selects which parts of the instruction (or data) are + replaced with a relocated value. */ bfd_vma dst_mask; /* When some formats create PC relative instructions, they leave @@ -342,7 +342,7 @@ struct reloc_howto_struct be made just by adding in an ordinary offset (e.g., sun3 a.out). Some formats leave the displacement part of an instruction empty (e.g., m88k bcs); this flag signals the fact. */ - boolean pcrel_offset; + bfd_boolean pcrel_offset; @}; @end example @@ -361,7 +361,7 @@ moment, we are compatible, so do it this way. @example #define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ - NAME, false, 0, 0, IN) + NAME, FALSE, 0, 0, IN) @end example @@ -369,8 +369,8 @@ moment, we are compatible, so do it this way. This is used to fill in an empty howto entry in an array. @example #define EMPTY_HOWTO(C) \ - HOWTO ((C), 0, 0, 0, false, 0, complain_overflow_dont, NULL, \ - NULL, false, 0, 0, false) + HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ + NULL, FALSE, 0, 0, FALSE) @end example @@ -379,7 +379,7 @@ Helper routine to turn a symbol into a relocation value. @example #define HOWTO_PREPARE(relocation, symbol) \ @{ \ - if (symbol != (asymbol *) NULL) \ + if (symbol != NULL) \ @{ \ if (bfd_is_com_section (symbol->section)) \ @{ \ @@ -422,8 +422,7 @@ arelent_chain; @subsubsection @code{bfd_check_overflow} @strong{Synopsis} @example -bfd_reloc_status_type -bfd_check_overflow +bfd_reloc_status_type bfd_check_overflow (enum complain_overflow how, unsigned int bitsize, unsigned int rightshift, @@ -441,11 +440,10 @@ Perform overflow checking on @var{relocation} which has @subsubsection @code{bfd_perform_relocation} @strong{Synopsis} @example -bfd_reloc_status_type -bfd_perform_relocation +bfd_reloc_status_type bfd_perform_relocation (bfd *abfd, arelent *reloc_entry, - PTR data, + void *data, asection *input_section, bfd *output_bfd, char **error_message); @@ -470,11 +468,10 @@ this return @code{bfd_reloc_dangerous}. @subsubsection @code{bfd_install_relocation} @strong{Synopsis} @example -bfd_reloc_status_type -bfd_install_relocation +bfd_reloc_status_type bfd_install_relocation (bfd *abfd, arelent *reloc_entry, - PTR data, bfd_vma data_start, + void *data, bfd_vma data_start, asection *input_section, char **error_message); @end example @@ -647,6 +644,32 @@ SPARC64 relocations @deffn {} BFD_RELOC_SPARC_REV32 SPARC little endian relocation @end deffn +@deffn {} BFD_RELOC_SPARC_TLS_GD_HI22 +@deffnx {} BFD_RELOC_SPARC_TLS_GD_LO10 +@deffnx {} BFD_RELOC_SPARC_TLS_GD_ADD +@deffnx {} BFD_RELOC_SPARC_TLS_GD_CALL +@deffnx {} BFD_RELOC_SPARC_TLS_LDM_HI22 +@deffnx {} BFD_RELOC_SPARC_TLS_LDM_LO10 +@deffnx {} BFD_RELOC_SPARC_TLS_LDM_ADD +@deffnx {} BFD_RELOC_SPARC_TLS_LDM_CALL +@deffnx {} BFD_RELOC_SPARC_TLS_LDO_HIX22 +@deffnx {} BFD_RELOC_SPARC_TLS_LDO_LOX10 +@deffnx {} BFD_RELOC_SPARC_TLS_LDO_ADD +@deffnx {} BFD_RELOC_SPARC_TLS_IE_HI22 +@deffnx {} BFD_RELOC_SPARC_TLS_IE_LO10 +@deffnx {} BFD_RELOC_SPARC_TLS_IE_LD +@deffnx {} BFD_RELOC_SPARC_TLS_IE_LDX +@deffnx {} BFD_RELOC_SPARC_TLS_IE_ADD +@deffnx {} BFD_RELOC_SPARC_TLS_LE_HIX22 +@deffnx {} BFD_RELOC_SPARC_TLS_LE_LOX10 +@deffnx {} BFD_RELOC_SPARC_TLS_DTPMOD32 +@deffnx {} BFD_RELOC_SPARC_TLS_DTPMOD64 +@deffnx {} BFD_RELOC_SPARC_TLS_DTPOFF32 +@deffnx {} BFD_RELOC_SPARC_TLS_DTPOFF64 +@deffnx {} BFD_RELOC_SPARC_TLS_TPOFF32 +@deffnx {} BFD_RELOC_SPARC_TLS_TPOFF64 +SPARC TLS relocations +@end deffn @deffn {} BFD_RELOC_ALPHA_GPDISP_HI16 Alpha ECOFF and ELF relocations. Some of these treat the symbol or "addend" in some special way. @@ -713,7 +736,7 @@ GP register. @end deffn @deffn {} BFD_RELOC_ALPHA_BRSGP Like BFD_RELOC_23_PCREL_S2, except that the source and target must -share a common GP, and the target address is adjusted for +share a common GP, and the target address is adjusted for STO_ALPHA_STD_GPLOAD. @end deffn @deffn {} BFD_RELOC_ALPHA_TLSGD @@ -783,6 +806,8 @@ Relocation against a MIPS literal section. @deffnx {} BFD_RELOC_MIPS_REL16 @deffnx {} BFD_RELOC_MIPS_RELGOT @deffnx {} BFD_RELOC_MIPS_JALR +MIPS ELF relocations. +@end deffn @deffn {} BFD_RELOC_FRV_LABEL16 @deffnx {} BFD_RELOC_FRV_LABEL24 @deffnx {} BFD_RELOC_FRV_LO16 @@ -792,9 +817,48 @@ Relocation against a MIPS literal section. @deffnx {} BFD_RELOC_FRV_GPREL32 @deffnx {} BFD_RELOC_FRV_GPRELHI @deffnx {} BFD_RELOC_FRV_GPRELLO +@deffnx {} BFD_RELOC_FRV_GOT12 +@deffnx {} BFD_RELOC_FRV_GOTHI +@deffnx {} BFD_RELOC_FRV_GOTLO +@deffnx {} BFD_RELOC_FRV_FUNCDESC +@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOT12 +@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTHI +@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTLO +@deffnx {} BFD_RELOC_FRV_FUNCDESC_VALUE +@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTOFF12 +@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTOFFHI +@deffnx {} BFD_RELOC_FRV_FUNCDESC_GOTOFFLO +@deffnx {} BFD_RELOC_FRV_GOTOFF12 +@deffnx {} BFD_RELOC_FRV_GOTOFFHI +@deffnx {} BFD_RELOC_FRV_GOTOFFLO Fujitsu Frv Relocations. @end deffn -MIPS ELF relocations. +@deffn {} BFD_RELOC_MN10300_GOTOFF24 +This is a 24bit GOT-relative reloc for the mn10300. +@end deffn +@deffn {} BFD_RELOC_MN10300_GOT32 +This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes +in the instruction. +@end deffn +@deffn {} BFD_RELOC_MN10300_GOT24 +This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes +in the instruction. +@end deffn +@deffn {} BFD_RELOC_MN10300_GOT16 +This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes +in the instruction. +@end deffn +@deffn {} BFD_RELOC_MN10300_COPY +Copy symbol at runtime. +@end deffn +@deffn {} BFD_RELOC_MN10300_GLOB_DAT +Create GOT entry. +@end deffn +@deffn {} BFD_RELOC_MN10300_JMP_SLOT +Create PLT entry. +@end deffn +@deffn {} BFD_RELOC_MN10300_RELATIVE +Adjust by program base. @end deffn @deffn {} BFD_RELOC_386_GOT32 @deffnx {} BFD_RELOC_386_PLT32 @@ -826,6 +890,14 @@ i386/elf relocations @deffnx {} BFD_RELOC_X86_64_RELATIVE @deffnx {} BFD_RELOC_X86_64_GOTPCREL @deffnx {} BFD_RELOC_X86_64_32S +@deffnx {} BFD_RELOC_X86_64_DTPMOD64 +@deffnx {} BFD_RELOC_X86_64_DTPOFF64 +@deffnx {} BFD_RELOC_X86_64_TPOFF64 +@deffnx {} BFD_RELOC_X86_64_TLSGD +@deffnx {} BFD_RELOC_X86_64_TLSLD +@deffnx {} BFD_RELOC_X86_64_DTPOFF32 +@deffnx {} BFD_RELOC_X86_64_GOTTPOFF +@deffnx {} BFD_RELOC_X86_64_TPOFF32 x86-64/elf relocations @end deffn @deffn {} BFD_RELOC_NS32K_IMM_8 @@ -909,11 +981,53 @@ Picojava relocs. Not all of these appear in object files. @deffnx {} BFD_RELOC_PPC64_PLTGOT16_LO_DS Power(rs6000) and PowerPC relocations. @end deffn +@deffn {} BFD_RELOC_PPC_TLS +@deffnx {} BFD_RELOC_PPC_DTPMOD +@deffnx {} BFD_RELOC_PPC_TPREL16 +@deffnx {} BFD_RELOC_PPC_TPREL16_LO +@deffnx {} BFD_RELOC_PPC_TPREL16_HI +@deffnx {} BFD_RELOC_PPC_TPREL16_HA +@deffnx {} BFD_RELOC_PPC_TPREL +@deffnx {} BFD_RELOC_PPC_DTPREL16 +@deffnx {} BFD_RELOC_PPC_DTPREL16_LO +@deffnx {} BFD_RELOC_PPC_DTPREL16_HI +@deffnx {} BFD_RELOC_PPC_DTPREL16_HA +@deffnx {} BFD_RELOC_PPC_DTPREL +@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16 +@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16_LO +@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16_HI +@deffnx {} BFD_RELOC_PPC_GOT_TLSGD16_HA +@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16 +@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16_LO +@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16_HI +@deffnx {} BFD_RELOC_PPC_GOT_TLSLD16_HA +@deffnx {} BFD_RELOC_PPC_GOT_TPREL16 +@deffnx {} BFD_RELOC_PPC_GOT_TPREL16_LO +@deffnx {} BFD_RELOC_PPC_GOT_TPREL16_HI +@deffnx {} BFD_RELOC_PPC_GOT_TPREL16_HA +@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16 +@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16_LO +@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16_HI +@deffnx {} BFD_RELOC_PPC_GOT_DTPREL16_HA +@deffnx {} BFD_RELOC_PPC64_TPREL16_DS +@deffnx {} BFD_RELOC_PPC64_TPREL16_LO_DS +@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHER +@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHERA +@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHEST +@deffnx {} BFD_RELOC_PPC64_TPREL16_HIGHESTA +@deffnx {} BFD_RELOC_PPC64_DTPREL16_DS +@deffnx {} BFD_RELOC_PPC64_DTPREL16_LO_DS +@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHER +@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHERA +@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHEST +@deffnx {} BFD_RELOC_PPC64_DTPREL16_HIGHESTA +PowerPC and PowerPC64 thread-local storage relocations. +@end deffn @deffn {} BFD_RELOC_I370_D12 IBM 370/390 relocations @end deffn @deffn {} BFD_RELOC_CTOR -The type of reloc used to build a contructor table - at the moment +The type of reloc used to build a constructor table - at the moment probably a 32 bit wide absolute relocation, but the target can choose. It generally does map to one of the other relocation types. @end deffn @@ -938,6 +1052,7 @@ field in the instruction. @deffnx {} BFD_RELOC_ARM_SWI @deffnx {} BFD_RELOC_ARM_MULTI @deffnx {} BFD_RELOC_ARM_CP_OFF_IMM +@deffnx {} BFD_RELOC_ARM_CP_OFF_IMM_S2 @deffnx {} BFD_RELOC_ARM_ADR_IMM @deffnx {} BFD_RELOC_ARM_LDR_IMM @deffnx {} BFD_RELOC_ARM_LITERAL @@ -1034,7 +1149,15 @@ These relocs are only used within the ARM assembler. They are not @deffnx {} BFD_RELOC_SH_IMM_HI16 @deffnx {} BFD_RELOC_SH_IMM_HI16_PCREL @deffnx {} BFD_RELOC_SH_PT_16 -Hitachi SH relocs. Not all of these appear in object files. +@deffnx {} BFD_RELOC_SH_TLS_GD_32 +@deffnx {} BFD_RELOC_SH_TLS_LD_32 +@deffnx {} BFD_RELOC_SH_TLS_LDO_32 +@deffnx {} BFD_RELOC_SH_TLS_IE_32 +@deffnx {} BFD_RELOC_SH_TLS_LE_32 +@deffnx {} BFD_RELOC_SH_TLS_DTPMOD32 +@deffnx {} BFD_RELOC_SH_TLS_DTPOFF32 +@deffnx {} BFD_RELOC_SH_TLS_TPOFF32 +Renesas / SuperH SH relocs. Not all of these appear in object files. @end deffn @deffn {} BFD_RELOC_THUMB_PCREL_BRANCH9 @deffnx {} BFD_RELOC_THUMB_PCREL_BRANCH12 @@ -1131,7 +1254,7 @@ DLX relocs DLX relocs @end deffn @deffn {} BFD_RELOC_M32R_24 -Mitsubishi M32R relocs. +Renesas M32R (formerly Mitsubishi M32R) relocs. This is a 24 bit absolute address. @end deffn @deffn {} BFD_RELOC_M32R_10_PCREL @@ -1158,6 +1281,22 @@ This is a 16-bit reloc containing the lower 16 bits of an address. This is a 16-bit reloc containing the small data area offset for use in add3, load, and store instructions. @end deffn +@deffn {} BFD_RELOC_M32R_GOT24 +@deffnx {} BFD_RELOC_M32R_26_PLTREL +@deffnx {} BFD_RELOC_M32R_COPY +@deffnx {} BFD_RELOC_M32R_GLOB_DAT +@deffnx {} BFD_RELOC_M32R_JMP_SLOT +@deffnx {} BFD_RELOC_M32R_RELATIVE +@deffnx {} BFD_RELOC_M32R_GOTOFF +@deffnx {} BFD_RELOC_M32R_GOTPC24 +@deffnx {} BFD_RELOC_M32R_GOT16_HI_ULO +@deffnx {} BFD_RELOC_M32R_GOT16_HI_SLO +@deffnx {} BFD_RELOC_M32R_GOT16_LO +@deffnx {} BFD_RELOC_M32R_GOTPC_HI_ULO +@deffnx {} BFD_RELOC_M32R_GOTPC_HI_SLO +@deffnx {} BFD_RELOC_M32R_GOTPC_LO +For PIC. +@end deffn @deffn {} BFD_RELOC_V850_9_PCREL This is a 9-bit reloc @end deffn @@ -1201,11 +1340,11 @@ This is a 4 bit offset from the tiny data area pointer. @end deffn @deffn {} BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET This is a 16 bit offset from the short data area pointer, with the -bits placed non-contigously in the instruction. +bits placed non-contiguously in the instruction. @end deffn @deffn {} BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET This is a 16 bit offset from the zero data area pointer, with the -bits placed non-contigously in the instruction. +bits placed non-contiguously in the instruction. @end deffn @deffn {} BFD_RELOC_V850_CALLT_6_7_OFFSET This is a 6 bit offset from the call table base pointer. @@ -1213,6 +1352,15 @@ This is a 6 bit offset from the call table base pointer. @deffn {} BFD_RELOC_V850_CALLT_16_16_OFFSET This is a 16 bit offset from the call table base pointer. @end deffn +@deffn {} BFD_RELOC_V850_LONGCALL +Used for relaxing indirect function calls. +@end deffn +@deffn {} BFD_RELOC_V850_LONGJUMP +Used for relaxing indirect jumps. +@end deffn +@deffn {} BFD_RELOC_V850_ALIGN +Used to maintain alignment whilst relaxing. +@end deffn @deffn {} BFD_RELOC_MN10300_32_PCREL This is a 32bit pcrel reloc for the mn10300, offset by two bytes in the instruction. @@ -1305,6 +1453,7 @@ These are relocations for a conditional branch instruction. @deffnx {} BFD_RELOC_MMIX_PUSHJ_1 @deffnx {} BFD_RELOC_MMIX_PUSHJ_2 @deffnx {} BFD_RELOC_MMIX_PUSHJ_3 +@deffnx {} BFD_RELOC_MMIX_PUSHJ_STUBBABLE These are relocations for the PUSHJ instruction. @end deffn @deffn {} BFD_RELOC_MMIX_JMP @@ -1455,6 +1604,95 @@ PC relative 32 bit shifted by 1. @deffn {} BFD_RELOC_390_GOTENT 32 bit rel. offset to GOT entry. @end deffn +@deffn {} BFD_RELOC_390_GOTOFF64 +64 bit offset to GOT. +@end deffn +@deffn {} BFD_RELOC_390_GOTPLT12 +12-bit offset to symbol-entry within GOT, with PLT handling. +@end deffn +@deffn {} BFD_RELOC_390_GOTPLT16 +16-bit offset to symbol-entry within GOT, with PLT handling. +@end deffn +@deffn {} BFD_RELOC_390_GOTPLT32 +32-bit offset to symbol-entry within GOT, with PLT handling. +@end deffn +@deffn {} BFD_RELOC_390_GOTPLT64 +64-bit offset to symbol-entry within GOT, with PLT handling. +@end deffn +@deffn {} BFD_RELOC_390_GOTPLTENT +32-bit rel. offset to symbol-entry within GOT, with PLT handling. +@end deffn +@deffn {} BFD_RELOC_390_PLTOFF16 +16-bit rel. offset from the GOT to a PLT entry. +@end deffn +@deffn {} BFD_RELOC_390_PLTOFF32 +32-bit rel. offset from the GOT to a PLT entry. +@end deffn +@deffn {} BFD_RELOC_390_PLTOFF64 +64-bit rel. offset from the GOT to a PLT entry. +@end deffn +@deffn {} BFD_RELOC_390_TLS_LOAD +@deffnx {} BFD_RELOC_390_TLS_GDCALL +@deffnx {} BFD_RELOC_390_TLS_LDCALL +@deffnx {} BFD_RELOC_390_TLS_GD32 +@deffnx {} BFD_RELOC_390_TLS_GD64 +@deffnx {} BFD_RELOC_390_TLS_GOTIE12 +@deffnx {} BFD_RELOC_390_TLS_GOTIE32 +@deffnx {} BFD_RELOC_390_TLS_GOTIE64 +@deffnx {} BFD_RELOC_390_TLS_LDM32 +@deffnx {} BFD_RELOC_390_TLS_LDM64 +@deffnx {} BFD_RELOC_390_TLS_IE32 +@deffnx {} BFD_RELOC_390_TLS_IE64 +@deffnx {} BFD_RELOC_390_TLS_IEENT +@deffnx {} BFD_RELOC_390_TLS_LE32 +@deffnx {} BFD_RELOC_390_TLS_LE64 +@deffnx {} BFD_RELOC_390_TLS_LDO32 +@deffnx {} BFD_RELOC_390_TLS_LDO64 +@deffnx {} BFD_RELOC_390_TLS_DTPMOD +@deffnx {} BFD_RELOC_390_TLS_DTPOFF +@deffnx {} BFD_RELOC_390_TLS_TPOFF +s390 tls relocations. +@end deffn +@deffn {} BFD_RELOC_390_20 +@deffnx {} BFD_RELOC_390_GOT20 +@deffnx {} BFD_RELOC_390_GOTPLT20 +@deffnx {} BFD_RELOC_390_TLS_GOTIE20 +Long displacement extension. +@end deffn +@deffn {} BFD_RELOC_IP2K_FR9 +Scenix IP2K - 9-bit register number / data address +@end deffn +@deffn {} BFD_RELOC_IP2K_BANK +Scenix IP2K - 4-bit register/data bank number +@end deffn +@deffn {} BFD_RELOC_IP2K_ADDR16CJP +Scenix IP2K - low 13 bits of instruction word address +@end deffn +@deffn {} BFD_RELOC_IP2K_PAGE3 +Scenix IP2K - high 3 bits of instruction word address +@end deffn +@deffn {} BFD_RELOC_IP2K_LO8DATA +@deffnx {} BFD_RELOC_IP2K_HI8DATA +@deffnx {} BFD_RELOC_IP2K_EX8DATA +Scenix IP2K - ext/low/high 8 bits of data address +@end deffn +@deffn {} BFD_RELOC_IP2K_LO8INSN +@deffnx {} BFD_RELOC_IP2K_HI8INSN +Scenix IP2K - low/high 8 bits of instruction word address +@end deffn +@deffn {} BFD_RELOC_IP2K_PC_SKIP +Scenix IP2K - even/odd PC modifier to modify snb pcl.0 +@end deffn +@deffn {} BFD_RELOC_IP2K_TEXT +Scenix IP2K - 16 bit word address in text section. +@end deffn +@deffn {} BFD_RELOC_IP2K_FR_OFFSET +Scenix IP2K - 7-bit sp or dp offset +@end deffn +@deffn {} BFD_RELOC_VPE4KMATH_DATA +@deffnx {} BFD_RELOC_VPE4KMATH_INSN +Scenix VPE4K coprocessor - data/insn-space addressing +@end deffn @deffn {} BFD_RELOC_VTABLE_INHERIT @deffnx {} BFD_RELOC_VTABLE_ENTRY These two relocations are used by the linker to determine which of @@ -1464,7 +1702,7 @@ that are not used, so that the code for those functions need not be included in the output. VTABLE_INHERIT is a zero-space relocation used to describe to the -linker the inheritence tree of a C++ virtual function table. The +linker the inheritance tree of a C++ virtual function table. The relocation's symbol should be the parent class' vtable, and the relocation should be located at the child vtable. @@ -1558,15 +1796,50 @@ Intel IA64 Relocations. @end deffn @deffn {} BFD_RELOC_M68HC11_HI8 Motorola 68HC11 reloc. -This is the 8 bits high part of an absolute address. +This is the 8 bit 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. +This is the 8 bit low part of an absolute address. @end deffn @deffn {} BFD_RELOC_M68HC11_3B Motorola 68HC11 reloc. -This is the 3 bits of a value. +This is the 3 bit of a value. +@end deffn +@deffn {} BFD_RELOC_M68HC11_RL_JUMP +Motorola 68HC11 reloc. +This reloc marks the beginning of a jump/call instruction. +It is used for linker relaxation to correctly identify beginning +of instruction and change some branches to use PC-relative +addressing mode. +@end deffn +@deffn {} BFD_RELOC_M68HC11_RL_GROUP +Motorola 68HC11 reloc. +This reloc marks a group of several instructions that gcc generates +and for which the linker relaxation pass can modify and/or remove +some of them. +@end deffn +@deffn {} BFD_RELOC_M68HC11_LO16 +Motorola 68HC11 reloc. +This is the 16-bit lower part of an address. It is used for 'call' +instruction to specify the symbol address without any special +transformation (due to memory bank window). +@end deffn +@deffn {} BFD_RELOC_M68HC11_PAGE +Motorola 68HC11 reloc. +This is a 8-bit reloc that specifies the page number of an address. +It is used by 'call' instruction to specify the page number of +the symbol. +@end deffn +@deffn {} BFD_RELOC_M68HC11_24 +Motorola 68HC11 reloc. +This is a 24-bit reloc that represents the address with a 16-bit +value and a 8-bit page number. The symbol address is transformed +to follow the 16K memory bank of 68HC12 (seen as mapped in the window). +@end deffn +@deffn {} BFD_RELOC_M68HC12_5B +Motorola 68HC12 reloc. +This is the 5 bits of a value. @end deffn @deffn {} BFD_RELOC_CRIS_BDISP8 @deffnx {} BFD_RELOC_CRIS_UNSIGNED_5 @@ -1649,6 +1922,7 @@ OpenRISC Relocations. H8 elf Relocations. @end deffn @deffn {} BFD_RELOC_XSTORMY16_REL_12 +@deffnx {} BFD_RELOC_XSTORMY16_12 @deffnx {} BFD_RELOC_XSTORMY16_24 @deffnx {} BFD_RELOC_XSTORMY16_FPTR16 Sony Xstormy16 Relocations. @@ -1658,6 +1932,50 @@ Sony Xstormy16 Relocations. @deffnx {} BFD_RELOC_VAX_RELATIVE Relocations used by VAX ELF. @end deffn +@deffn {} BFD_RELOC_MSP430_10_PCREL +@deffnx {} BFD_RELOC_MSP430_16_PCREL +@deffnx {} BFD_RELOC_MSP430_16 +@deffnx {} BFD_RELOC_MSP430_16_PCREL_BYTE +@deffnx {} BFD_RELOC_MSP430_16_BYTE +msp430 specific relocation codes +@end deffn +@deffn {} BFD_RELOC_IQ2000_OFFSET_16 +@deffnx {} BFD_RELOC_IQ2000_OFFSET_21 +@deffnx {} BFD_RELOC_IQ2000_UHI16 +IQ2000 Relocations. +@end deffn +@deffn {} BFD_RELOC_XTENSA_RTLD +Special Xtensa relocation used only by PLT entries in ELF shared +objects to indicate that the runtime linker should set the value +to one of its own internal functions or data structures. +@end deffn +@deffn {} BFD_RELOC_XTENSA_GLOB_DAT +@deffnx {} BFD_RELOC_XTENSA_JMP_SLOT +@deffnx {} BFD_RELOC_XTENSA_RELATIVE +Xtensa relocations for ELF shared objects. +@end deffn +@deffn {} BFD_RELOC_XTENSA_PLT +Xtensa relocation used in ELF object files for symbols that may require +PLT entries. Otherwise, this is just a generic 32-bit relocation. +@end deffn +@deffn {} BFD_RELOC_XTENSA_OP0 +@deffnx {} BFD_RELOC_XTENSA_OP1 +@deffnx {} BFD_RELOC_XTENSA_OP2 +Generic Xtensa relocations. Only the operand number is encoded +in the relocation. The details are determined by extracting the +instruction opcode. +@end deffn +@deffn {} BFD_RELOC_XTENSA_ASM_EXPAND +Xtensa relocation to mark that the assembler expanded the +instructions from an original target. The expansion size is +encoded in the reloc size. +@end deffn +@deffn {} BFD_RELOC_XTENSA_ASM_SIMPLIFY +Xtensa relocation to mark that the linker should simplify +assembler-expanded instructions. This is commonly used +internally by the linker after analysis of a +BFD_RELOC_XTENSA_ASM_EXPAND. +@end deffn @example @@ -1667,8 +1985,8 @@ typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; @subsubsection @code{bfd_reloc_type_lookup} @strong{Synopsis} @example -reloc_howto_type * -bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); +reloc_howto_type *bfd_reloc_type_lookup + (bfd *abfd, bfd_reloc_code_real_type code); @end example @strong{Description}@* Return a pointer to a howto structure which, when @@ -1699,21 +2017,22 @@ Useful mainly for printing error messages. @subsubsection @code{bfd_generic_relax_section} @strong{Synopsis} @example -boolean bfd_generic_relax_section +bfd_boolean bfd_generic_relax_section (bfd *abfd, asection *section, struct bfd_link_info *, - boolean *); + bfd_boolean *); @end example @strong{Description}@* Provides default handling for relaxing for back ends which -don't do relaxing -- i.e., does nothing. +don't do relaxing -- i.e., does nothing except make sure that the +final size of the section is set. @findex bfd_generic_gc_sections @subsubsection @code{bfd_generic_gc_sections} @strong{Synopsis} @example -boolean bfd_generic_gc_sections +bfd_boolean bfd_generic_gc_sections (bfd *, struct bfd_link_info *); @end example @strong{Description}@* @@ -1724,7 +2043,7 @@ don't do section gc -- i.e., does nothing. @subsubsection @code{bfd_generic_merge_sections} @strong{Synopsis} @example -boolean bfd_generic_merge_sections +bfd_boolean bfd_generic_merge_sections (bfd *, struct bfd_link_info *); @end example @strong{Description}@* @@ -1735,12 +2054,12 @@ which don't have SEC_MERGE support -- i.e., does nothing. @subsubsection @code{bfd_generic_get_relocated_section_contents} @strong{Synopsis} @example -bfd_byte * -bfd_generic_get_relocated_section_contents (bfd *abfd, +bfd_byte *bfd_generic_get_relocated_section_contents + (bfd *abfd, struct bfd_link_info *link_info, struct bfd_link_order *link_order, bfd_byte *data, - boolean relocateable, + bfd_boolean relocatable, asymbol **symbols); @end example @strong{Description}@* diff --git a/contrib/binutils/bfd/doc/section.texi b/contrib/binutils/bfd/doc/section.texi index 971fd04..b1501f9 100644 --- a/contrib/binutils/bfd/doc/section.texi +++ b/contrib/binutils/bfd/doc/section.texi @@ -124,7 +124,7 @@ struct bfd_comdat_info long symbol; @}; -typedef struct sec +typedef struct bfd_section @{ /* The name of the section; the name isn't a copy, the pointer is the same as that passed to bfd_make_section. */ @@ -137,7 +137,7 @@ typedef struct sec int index; /* The next section in the list belonging to the BFD, or NULL. */ - struct sec *next; + struct bfd_section *next; /* The field flags contains attributes of the section. Some flags are read in from the object file, and some are @@ -335,10 +335,39 @@ typedef struct sec /* A mark flag used by some linker backends for garbage collection. */ unsigned int gc_mark : 1; - /* Used by the ELF code to mark sections which have been allocated - to segments. */ + /* The following flags are used by the ELF linker. */ + + /* Mark sections which have been allocated to segments. */ unsigned int segment_mark : 1; + /* Type of sec_info information. */ + unsigned int sec_info_type:3; +#define ELF_INFO_TYPE_NONE 0 +#define ELF_INFO_TYPE_STABS 1 +#define ELF_INFO_TYPE_MERGE 2 +#define ELF_INFO_TYPE_EH_FRAME 3 +#define ELF_INFO_TYPE_JUST_SYMS 4 + + /* Nonzero if this section uses RELA relocations, rather than REL. */ + unsigned int use_rela_p:1; + + /* Bits used by various backends. */ + unsigned int has_tls_reloc:1; + + /* Nonzero if this section needs the relax finalize pass. */ + unsigned int need_finalize_relax:1; + + /* Nonzero if this section has a gp reloc. */ + unsigned int has_gp_reloc:1; + + /* Unused bits. */ + unsigned int flag13:1; + unsigned int flag14:1; + unsigned int flag15:1; + unsigned int flag16:4; + unsigned int flag20:4; + unsigned int flag24:8; + /* End of internal packed boolean fields. */ /* The virtual memory address of the section - where it will be @@ -374,7 +403,7 @@ typedef struct sec bfd_vma output_offset; /* The output section through which to map on output. */ - struct sec *output_section; + struct bfd_section *output_section; /* The alignment requirement of the section, as an exponent of 2 - e.g., 3 aligns to 2^3 (or 8). */ @@ -404,7 +433,7 @@ typedef struct sec file_ptr line_filepos; /* Pointer to data for applications. */ - PTR userdata; + void *userdata; /* If the SEC_IN_MEMORY flag is set, this points to the actual contents. */ @@ -422,6 +451,10 @@ typedef struct sec /* Optional information about a COMDAT entry; NULL if not COMDAT. */ struct bfd_comdat_info *comdat; + /* Points to the kept section if this section is a link-once section, + and is discarded. */ + struct bfd_section *kept_section; + /* When a section is being output, this value changes as more linenumbers are written out. */ file_ptr moving_line_filepos; @@ -429,7 +462,7 @@ typedef struct sec /* What the section number is in the target world. */ int target_index; - PTR used_by_bfd; + void *used_by_bfd; /* If this is a constructor section then here is a list of the relocations created to relocate items within it. */ @@ -439,8 +472,8 @@ typedef struct sec bfd *owner; /* A symbol which points at this section only. */ - struct symbol_cache_entry *symbol; - struct symbol_cache_entry **symbol_ptr_ptr; + struct bfd_symbol *symbol; + struct bfd_symbol **symbol_ptr_ptr; struct bfd_link_order *link_order_head; struct bfd_link_order *link_order_tail; @@ -457,18 +490,18 @@ typedef struct sec #define BFD_IND_SECTION_NAME "*IND*" /* The absolute section. */ -extern const asection bfd_abs_section; +extern 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. */ -extern const asection bfd_und_section; +extern 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. */ -extern const asection bfd_com_section; +extern asection bfd_com_section; #define bfd_com_section_ptr ((asection *) &bfd_com_section) /* Pointer to the indirect section. */ -extern const asection bfd_ind_section; +extern asection bfd_ind_section; #define bfd_ind_section_ptr ((asection *) &bfd_ind_section) #define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) @@ -478,13 +511,12 @@ extern const asection bfd_ind_section; || ((SEC) == bfd_com_section_ptr) \ || ((SEC) == bfd_ind_section_ptr)) -extern const struct symbol_cache_entry * const bfd_abs_symbol; -extern const struct symbol_cache_entry * const bfd_com_symbol; -extern const struct symbol_cache_entry * const bfd_und_symbol; -extern const struct symbol_cache_entry * const bfd_ind_symbol; +extern const struct bfd_symbol * const bfd_abs_symbol; +extern const struct bfd_symbol * const bfd_com_symbol; +extern const struct bfd_symbol * const bfd_und_symbol; +extern const struct bfd_symbol * const bfd_ind_symbol; #define bfd_get_section_size_before_reloc(section) \ - ((section)->reloc_done ? (abort (), (bfd_size_type) 1) \ - : (section)->_raw_size) + ((section)->_raw_size) #define bfd_get_section_size_after_reloc(section) \ ((section)->reloc_done ? (section)->_cooked_size \ : (abort (), (bfd_size_type) 1)) @@ -534,7 +566,7 @@ hash table entries. @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 @@ -550,9 +582,8 @@ or something else) for each section. @subsubsection @code{bfd_get_unique_section_name} @strong{Synopsis} @example -char *bfd_get_unique_section_name(bfd *abfd, - const char *templat, - int *count); +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 @@ -565,7 +596,7 @@ pointed to by @var{count} will be incremented in this case. @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} @@ -592,7 +623,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 @@ -612,7 +643,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 @@ -624,12 +655,13 @@ section named @var{name}. If there is an error, return @code{NULL} and set @subsubsection @code{bfd_set_section_flags} @strong{Synopsis} @example -boolean bfd_set_section_flags(bfd *abfd, asection *sec, flagword flags); +bfd_boolean bfd_set_section_flags + (bfd *abfd, asection *sec, flagword flags); @end example @strong{Description}@* Set the attributes of the section @var{sec} in the BFD -@var{abfd} to the value @var{flags}. Return @code{true} on success, -@code{false} on error. Possible error returns are: +@var{abfd} to the value @var{flags}. Return @code{TRUE} on success, +@code{FALSE} on error. Possible error returns are: @itemize @bullet @@ -644,11 +676,10 @@ have the @code{SEC_HAS_CONTENTS} field set. @subsubsection @code{bfd_map_over_sections} @strong{Synopsis} @example -void bfd_map_over_sections(bfd *abfd, - void (*func) (bfd *abfd, - asection *sect, - PTR obj), - PTR obj); +void bfd_map_over_sections + (bfd *abfd, + void (*func) (bfd *abfd, asection *sect, void *obj), + void *obj); @end example @strong{Description}@* Call the provided function @var{func} for each section @@ -656,27 +687,28 @@ attached to the BFD @var{abfd}, passing @var{obj} as an argument. The function will be called as if by @example - func(abfd, the_section, obj); + func (abfd, the_section, obj); @end example -This is the prefered method for iterating over sections; an +This is the preferred method for iterating over sections; an alternative would be to use a loop: @example section *p; for (p = abfd->sections; p != NULL; p = p->next) - func(abfd, p, ...) + func (abfd, p, ...) @end example @findex bfd_set_section_size @subsubsection @code{bfd_set_section_size} @strong{Synopsis} @example -boolean bfd_set_section_size(bfd *abfd, asection *sec, bfd_size_type val); +bfd_boolean bfd_set_section_size + (bfd *abfd, asection *sec, bfd_size_type val); @end example @strong{Description}@* Set @var{sec} to the size @var{val}. If the operation is -ok, then @code{true} is returned, else @code{false}. +ok, then @code{TRUE} is returned, else @code{FALSE}. Possible error returns: @itemize @bullet @@ -690,9 +722,9 @@ Writing has started to the BFD, so setting the size is invalid. @subsubsection @code{bfd_set_section_contents} @strong{Synopsis} @example -boolean bfd_set_section_contents (bfd *abfd, asection *section, - PTR data, file_ptr offset, - bfd_size_type count); +bfd_boolean bfd_set_section_contents + (bfd *abfd, asection *section, const void *data, + file_ptr offset, bfd_size_type count); @end example @strong{Description}@* Sets the contents of the section @var{section} in BFD @@ -700,7 +732,7 @@ Sets the contents of the section @var{section} in BFD data is written to the output section starting at offset @var{offset} for @var{count} octets. -Normally @code{true} is returned, else @code{false}. Possible error +Normally @code{TRUE} is returned, else @code{FALSE}. Possible error returns are: @itemize @bullet @@ -718,8 +750,8 @@ This routine is front end to the back end function @subsubsection @code{bfd_get_section_contents} @strong{Synopsis} @example -boolean bfd_get_section_contents (bfd *abfd, asection *section, - PTR location, file_ptr offset, +bfd_boolean bfd_get_section_contents + (bfd *abfd, asection *section, void *location, file_ptr offset, bfd_size_type count); @end example @strong{Description}@* @@ -731,20 +763,20 @@ and is read for @var{count} bytes. If the contents of a constructor with the @code{SEC_CONSTRUCTOR} flag set are requested or if the section does not have the @code{SEC_HAS_CONTENTS} flag set, then the @var{location} is filled -with zeroes. If no errors occur, @code{true} is returned, else -@code{false}. +with zeroes. If no errors occur, @code{TRUE} is returned, else +@code{FALSE}. @findex bfd_copy_private_section_data @subsubsection @code{bfd_copy_private_section_data} @strong{Synopsis} @example -boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, - bfd *obfd, asection *osec); +bfd_boolean bfd_copy_private_section_data + (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); @end example @strong{Description}@* Copy private section information from @var{isec} in the BFD @var{ibfd} to the section @var{osec} in the BFD @var{obfd}. -Return @code{true} on success, @code{false} on error. Possible error +Return @code{TRUE} on success, @code{FALSE} on error. Possible error returns are: @itemize @bullet @@ -778,7 +810,7 @@ to remove sections. @subsubsection @code{bfd_generic_discard_group} @strong{Synopsis} @example -boolean bfd_generic_discard_group (bfd *abfd, asection *group); +bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); @end example @strong{Description}@* Remove all members of @var{group} from the output. diff --git a/contrib/binutils/bfd/doc/syms.texi b/contrib/binutils/bfd/doc/syms.texi index cb29e7d..415d156 100644 --- a/contrib/binutils/bfd/doc/syms.texi +++ b/contrib/binutils/bfd/doc/syms.texi @@ -47,10 +47,10 @@ excerpt from an application which reads the symbol table: if (storage_needed < 0) FAIL - if (storage_needed == 0) @{ - return ; - @} - symbol_table = (asymbol **) xmalloc (storage_needed); + if (storage_needed == 0) + return; + + symbol_table = xmalloc (storage_needed); ... number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table); @@ -58,9 +58,8 @@ excerpt from an application which reads the symbol table: if (number_of_symbols < 0) FAIL - for (i = 0; i < number_of_symbols; i++) @{ - process_symbol (symbol_table[i]); - @} + for (i = 0; i < number_of_symbols; i++) + process_symbol (symbol_table[i]); @end example All storage for the symbols themselves is in an objalloc @@ -80,25 +79,26 @@ example showing the creation of a symbol table with only one element: @example #include "bfd.h" - main() + int main (void) @{ bfd *abfd; asymbol *ptrs[2]; asymbol *new; - abfd = bfd_openw("foo","a.out-sunos-big"); - bfd_set_format(abfd, bfd_object); - new = bfd_make_empty_symbol(abfd); + abfd = bfd_openw ("foo","a.out-sunos-big"); + bfd_set_format (abfd, bfd_object); + new = bfd_make_empty_symbol (abfd); new->name = "dummy_symbol"; - new->section = bfd_make_section_old_way(abfd, ".text"); + new->section = bfd_make_section_old_way (abfd, ".text"); new->flags = BSF_GLOBAL; new->value = 0x12345; ptrs[0] = new; - ptrs[1] = (asymbol *)0; + ptrs[1] = 0; - bfd_set_symtab(abfd, ptrs, 1); - bfd_close(abfd); + bfd_set_symtab (abfd, ptrs, 1); + bfd_close (abfd); + return 0; @} ./makesym @@ -106,9 +106,9 @@ example showing the creation of a symbol table with only one element: 00012345 A dummy_symbol @end example -Many formats cannot represent arbitary symbol information; for +Many formats cannot represent arbitrary symbol information; for instance, the @code{a.out} object format does not allow an -arbitary number of sections. A symbol pointing to a section +arbitrary number of sections. A symbol pointing to a section which is not one of @code{.text}, @code{.data} or @code{.bss} cannot be described. @@ -139,7 +139,7 @@ An @code{asymbol} has the form: @example -typedef struct symbol_cache_entry +typedef struct bfd_symbol @{ /* A pointer to the BFD which owns the symbol. This information is necessary so that a back end can work out what additional @@ -150,7 +150,7 @@ typedef struct symbol_cache_entry instead, except that some symbols point to the global sections bfd_@{abs,com,und@}_section. This could be fixed by making these globals be per-bfd (or per-target-flavor). FIXME. */ - struct _bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ + struct bfd *the_bfd; /* Use bfd_asymbol_bfd(sym) to access this field. */ /* The text of the symbol. The name is left alone, and not copied; the application may not alter it. */ @@ -180,7 +180,7 @@ typedef struct symbol_cache_entry @code{BSF_LOCAL}, @code{BSF_FORT_COMM}, @code{BSF_UNDEFINED} or @code{BSF_GLOBAL}. */ - /* The symbol is a debugging record. The value has an arbitary + /* The symbol is a debugging record. The value has an arbitrary meaning, unless BSF_DEBUGGING_RELOC is also set. */ #define BSF_DEBUGGING 0x08 @@ -251,12 +251,12 @@ typedef struct symbol_cache_entry /* A pointer to the section to which this symbol is relative. This will always be non NULL, there are special sections for undefined and absolute symbols. */ - struct sec *section; + struct bfd_section *section; /* Back end special data. */ union @{ - PTR p; + void *p; bfd_vma i; @} udata; @@ -286,26 +286,26 @@ the BFD, then return 0. If an error occurs, return -1. @subsubsection @code{bfd_is_local_label} @strong{Synopsis} @example -boolean bfd_is_local_label(bfd *abfd, asymbol *sym); +bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); @end example @strong{Description}@* -Return true if the given symbol @var{sym} in the BFD @var{abfd} is -a compiler generated local label, else return false. +Return TRUE if the given symbol @var{sym} in the BFD @var{abfd} is +a compiler generated local label, else return FALSE. @findex bfd_is_local_label_name @subsubsection @code{bfd_is_local_label_name} @strong{Synopsis} @example -boolean bfd_is_local_label_name(bfd *abfd, const char *name); +bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); @end example @strong{Description}@* -Return true if a symbol with the name @var{name} in the BFD +Return TRUE if a symbol with the name @var{name} in the BFD @var{abfd} is a compiler generated local label, else return -false. This just checks whether the name has the form of a +FALSE. This just checks whether the name has the form of a local label. @example #define bfd_is_local_label_name(abfd, name) \ - BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) + BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) @end example @@ -319,8 +319,7 @@ Return the actual number of symbol pointers, not including the NULL. @example #define bfd_canonicalize_symtab(abfd, location) \ - BFD_SEND (abfd, _bfd_canonicalize_symtab,\ - (abfd, location)) + BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) @end example @@ -328,7 +327,8 @@ including the NULL. @subsubsection @code{bfd_set_symtab} @strong{Synopsis} @example -boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); +bfd_boolean bfd_set_symtab + (bfd *abfd, asymbol **location, unsigned int count); @end example @strong{Description}@* Arrange that when the output BFD @var{abfd} is closed, @@ -339,7 +339,7 @@ will be written. @subsubsection @code{bfd_print_symbol_vandf} @strong{Synopsis} @example -void bfd_print_symbol_vandf(bfd *abfd, PTR file, asymbol *symbol); +void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); @end example @strong{Description}@* Print the value and flags of the @var{symbol} supplied to the @@ -357,7 +357,7 @@ information surrounding the @code{asymbol}. Building your own information, and will cause problems later on. @example #define bfd_make_empty_symbol(abfd) \ - BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) + BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) @end example @@ -381,7 +381,7 @@ to be used as a debugging symbol. Further details of its use have yet to be worked out. @example #define bfd_make_debug_symbol(abfd,ptr,size) \ - BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) + BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) @end example @@ -393,7 +393,7 @@ class of @var{symbol}, or '?' for an unknown class. @strong{Synopsis} @example -int bfd_decode_symclass(asymbol *symbol); +int bfd_decode_symclass (asymbol *symbol); @end example @findex bfd_is_undefined_symclass @subsubsection @code{bfd_is_undefined_symclass} @@ -404,7 +404,7 @@ Returns zero otherwise. @strong{Synopsis} @example -boolean bfd_is_undefined_symclass (int symclass); +bfd_boolean bfd_is_undefined_symclass (int symclass); @end example @findex bfd_symbol_info @subsubsection @code{bfd_symbol_info} @@ -415,18 +415,19 @@ calling this function. @strong{Synopsis} @example -void bfd_symbol_info(asymbol *symbol, symbol_info *ret); +void bfd_symbol_info (asymbol *symbol, symbol_info *ret); @end example @findex bfd_copy_private_symbol_data @subsubsection @code{bfd_copy_private_symbol_data} @strong{Synopsis} @example -boolean bfd_copy_private_symbol_data(bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); +bfd_boolean bfd_copy_private_symbol_data + (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); @end example @strong{Description}@* Copy private symbol information from @var{isym} in the BFD @var{ibfd} to the symbol @var{osym} in the BFD @var{obfd}. -Return @code{true} on success, @code{false} on error. Possible error +Return @code{TRUE} on success, @code{FALSE} on error. Possible error returns are: @itemize @bullet @@ -437,8 +438,8 @@ Not enough memory exists to create private data for @var{osec}. @end itemize @example #define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ - BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ - (ibfd, isymbol, obfd, osymbol)) + BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ + (ibfd, isymbol, obfd, osymbol)) @end example diff --git a/contrib/binutils/bfd/doc/targets.texi b/contrib/binutils/bfd/doc/targets.texi index 5b8d2b8..9b499cf 100644 --- a/contrib/binutils/bfd/doc/targets.texi +++ b/contrib/binutils/bfd/doc/targets.texi @@ -2,7 +2,7 @@ @strong{Description}@* -Each port of BFD to a different machine requries the creation +Each port of BFD to a different machine requires the creation 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 @@ -50,7 +50,7 @@ format may be determined. This is done by calling @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. +@code{bfd_check_format} returns @code{TRUE} when the caller guesses right. @menu * bfd_target:: @end menu @@ -79,7 +79,7 @@ They make the documentation (more) unpleasant to read, so if someone wants to fix this and not break the above, please do. @example #define BFD_SEND(bfd, message, arglist) \ - ((*((bfd)->xvec->message)) arglist) + ((*((bfd)->xvec->message)) arglist) #ifdef DEBUG_BFD_SEND #undef BFD_SEND @@ -92,7 +92,7 @@ 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 @@ -132,7 +132,11 @@ enum bfd_flavour bfd_target_msdos_flavour, bfd_target_ovax_flavour, bfd_target_evax_flavour, - bfd_target_mmo_flavour + bfd_target_mmo_flavour, + bfd_target_mach_o_flavour, + bfd_target_pef_flavour, + bfd_target_pef_xlib_flavour, + bfd_target_sym_flavour @}; enum bfd_endian @{ BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN @}; @@ -176,38 +180,38 @@ typedef struct bfd_target /* Entries for byte swapping for data. These are different from the other entry points, since they don't take a BFD asthe first argument. Certain other handlers could do the same. */ - bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *)); - void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *)); - void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *)); - void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); + bfd_uint64_t (*bfd_getx64) (const void *); + bfd_int64_t (*bfd_getx_signed_64) (const void *); + void (*bfd_putx64) (bfd_uint64_t, void *); + bfd_vma (*bfd_getx32) (const void *); + bfd_signed_vma (*bfd_getx_signed_32) (const void *); + void (*bfd_putx32) (bfd_vma, void *); + bfd_vma (*bfd_getx16) (const void *); + bfd_signed_vma (*bfd_getx_signed_16) (const void *); + void (*bfd_putx16) (bfd_vma, void *); /* Byte swapping for the headers. */ - bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *)); - void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *)); - void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *)); - bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *)); - bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *)); - void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); + bfd_uint64_t (*bfd_h_getx64) (const void *); + bfd_int64_t (*bfd_h_getx_signed_64) (const void *); + void (*bfd_h_putx64) (bfd_uint64_t, void *); + bfd_vma (*bfd_h_getx32) (const void *); + bfd_signed_vma (*bfd_h_getx_signed_32) (const void *); + void (*bfd_h_putx32) (bfd_vma, void *); + bfd_vma (*bfd_h_getx16) (const void *); + bfd_signed_vma (*bfd_h_getx_signed_16) (const void *); + void (*bfd_h_putx16) (bfd_vma, void *); /* 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. */ - const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); + const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); /* Set the format of a file being written. */ - boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); + bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); /* Write cached information into a file being written, at @code{bfd_close}. */ - boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); + bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *); @end example The general target vector. These vectors are initialized using the @@ -215,227 +219,229 @@ BFD_JUMP_TABLE macros. @example /* Generic entry points. */ -@end example -Do not "beautify" the CONCAT* macro args. Traditional C will not -remove whitespace added here, and thus will fail to concatenate -the tokens. -@example #define BFD_JUMP_TABLE_GENERIC(NAME) \ -CONCAT2 (NAME,_close_and_cleanup), \ -CONCAT2 (NAME,_bfd_free_cached_info), \ -CONCAT2 (NAME,_new_section_hook), \ -CONCAT2 (NAME,_get_section_contents), \ -CONCAT2 (NAME,_get_section_contents_in_window) + NAME##_close_and_cleanup, \ + NAME##_bfd_free_cached_info, \ + NAME##_new_section_hook, \ + NAME##_get_section_contents, \ + NAME##_get_section_contents_in_window /* Called when the BFD is being closed to do any necessary cleanup. */ - boolean (*_close_and_cleanup) PARAMS ((bfd *)); + bfd_boolean (*_close_and_cleanup) (bfd *); /* Ask the BFD to free all cached information. */ - boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); + bfd_boolean (*_bfd_free_cached_info) (bfd *); /* Called when a new section is created. */ - boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); + bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); /* Read the contents of a section. */ - boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, - file_ptr, bfd_size_type)); - boolean (*_bfd_get_section_contents_in_window) - PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type)); + bfd_boolean (*_bfd_get_section_contents) + (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); + bfd_boolean (*_bfd_get_section_contents_in_window) + (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); /* Entry points to copy private data. */ #define BFD_JUMP_TABLE_COPY(NAME) \ -CONCAT2 (NAME,_bfd_copy_private_bfd_data), \ -CONCAT2 (NAME,_bfd_merge_private_bfd_data), \ -CONCAT2 (NAME,_bfd_copy_private_section_data), \ -CONCAT2 (NAME,_bfd_copy_private_symbol_data), \ -CONCAT2 (NAME,_bfd_set_private_flags), \ -CONCAT2 (NAME,_bfd_print_private_bfd_data) \ + NAME##_bfd_copy_private_bfd_data, \ + NAME##_bfd_merge_private_bfd_data, \ + NAME##_bfd_copy_private_section_data, \ + NAME##_bfd_copy_private_symbol_data, \ + NAME##_bfd_set_private_flags, \ + NAME##_bfd_print_private_bfd_data + /* Called to copy BFD general private data from one object file to another. */ - boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); + bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); /* Called to merge BFD general private data from one object file to a common output file when linking. */ - boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *)); + bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); /* Called to copy BFD private section data from one object file to another. */ - boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr, - bfd *, sec_ptr)); + bfd_boolean (*_bfd_copy_private_section_data) + (bfd *, sec_ptr, bfd *, sec_ptr); /* Called to copy BFD private symbol data from one symbol to another. */ - boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *, - bfd *, asymbol *)); + bfd_boolean (*_bfd_copy_private_symbol_data) + (bfd *, asymbol *, bfd *, asymbol *); /* Called to set private backend flags. */ - boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword)); + bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); /* Called to print private BFD data. */ - boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); + bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *); /* Core file entry points. */ #define BFD_JUMP_TABLE_CORE(NAME) \ -CONCAT2 (NAME,_core_file_failing_command), \ -CONCAT2 (NAME,_core_file_failing_signal), \ -CONCAT2 (NAME,_core_file_matches_executable_p) - char * (*_core_file_failing_command) PARAMS ((bfd *)); - int (*_core_file_failing_signal) PARAMS ((bfd *)); - boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); + NAME##_core_file_failing_command, \ + NAME##_core_file_failing_signal, \ + NAME##_core_file_matches_executable_p + + char * (*_core_file_failing_command) (bfd *); + int (*_core_file_failing_signal) (bfd *); + bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *); /* Archive entry points. */ #define BFD_JUMP_TABLE_ARCHIVE(NAME) \ -CONCAT2 (NAME,_slurp_armap), \ -CONCAT2 (NAME,_slurp_extended_name_table), \ -CONCAT2 (NAME,_construct_extended_name_table), \ -CONCAT2 (NAME,_truncate_arname), \ -CONCAT2 (NAME,_write_armap), \ -CONCAT2 (NAME,_read_ar_hdr), \ -CONCAT2 (NAME,_openr_next_archived_file), \ -CONCAT2 (NAME,_get_elt_at_index), \ -CONCAT2 (NAME,_generic_stat_arch_elt), \ -CONCAT2 (NAME,_update_armap_timestamp) - boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); - boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); - boolean (*_bfd_construct_extended_name_table) - PARAMS ((bfd *, char **, bfd_size_type *, const char **)); - void (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *)); - boolean (*write_armap) - PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); - PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); - bfd * (*openr_next_archived_file) PARAMS ((bfd *, bfd *)); -#define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i)) - bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex)); - int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); - boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); + NAME##_slurp_armap, \ + NAME##_slurp_extended_name_table, \ + NAME##_construct_extended_name_table, \ + NAME##_truncate_arname, \ + NAME##_write_armap, \ + NAME##_read_ar_hdr, \ + NAME##_openr_next_archived_file, \ + NAME##_get_elt_at_index, \ + NAME##_generic_stat_arch_elt, \ + NAME##_update_armap_timestamp + + bfd_boolean (*_bfd_slurp_armap) (bfd *); + bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); + bfd_boolean (*_bfd_construct_extended_name_table) + (bfd *, char **, bfd_size_type *, const char **); + void (*_bfd_truncate_arname) (bfd *, const char *, char *); + bfd_boolean (*write_armap) + (bfd *, unsigned int, struct orl *, unsigned int, int); + void * (*_bfd_read_ar_hdr_fn) (bfd *); + bfd * (*openr_next_archived_file) (bfd *, bfd *); +#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) + bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); + int (*_bfd_stat_arch_elt) (bfd *, struct stat *); + bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); /* Entry points used for symbols. */ #define BFD_JUMP_TABLE_SYMBOLS(NAME) \ -CONCAT2 (NAME,_get_symtab_upper_bound), \ -CONCAT2 (NAME,_get_symtab), \ -CONCAT2 (NAME,_make_empty_symbol), \ -CONCAT2 (NAME,_print_symbol), \ -CONCAT2 (NAME,_get_symbol_info), \ -CONCAT2 (NAME,_bfd_is_local_label_name), \ -CONCAT2 (NAME,_get_lineno), \ -CONCAT2 (NAME,_find_nearest_line), \ -CONCAT2 (NAME,_bfd_make_debug_symbol), \ -CONCAT2 (NAME,_read_minisymbols), \ -CONCAT2 (NAME,_minisymbol_to_symbol) - long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); - long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, - struct symbol_cache_entry **)); - struct symbol_cache_entry * - (*_bfd_make_empty_symbol) PARAMS ((bfd *)); - void (*_bfd_print_symbol) PARAMS ((bfd *, PTR, - struct symbol_cache_entry *, - bfd_print_symbol_type)); -#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e)) - void (*_bfd_get_symbol_info) PARAMS ((bfd *, - struct symbol_cache_entry *, - symbol_info *)); -#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e)) - boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); - - alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); - boolean (*_bfd_find_nearest_line) - PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma, - const char **, const char **, unsigned int *)); + NAME##_get_symtab_upper_bound, \ + NAME##_canonicalize_symtab, \ + NAME##_make_empty_symbol, \ + NAME##_print_symbol, \ + NAME##_get_symbol_info, \ + NAME##_bfd_is_local_label_name, \ + NAME##_get_lineno, \ + NAME##_find_nearest_line, \ + NAME##_bfd_make_debug_symbol, \ + NAME##_read_minisymbols, \ + NAME##_minisymbol_to_symbol + + long (*_bfd_get_symtab_upper_bound) (bfd *); + long (*_bfd_canonicalize_symtab) + (bfd *, struct bfd_symbol **); + struct bfd_symbol * + (*_bfd_make_empty_symbol) (bfd *); + void (*_bfd_print_symbol) + (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); +#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) + void (*_bfd_get_symbol_info) + (bfd *, struct bfd_symbol *, symbol_info *); +#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) + bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); + + alent * (*_get_lineno) (bfd *, struct bfd_symbol *); + bfd_boolean (*_bfd_find_nearest_line) + (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, + const char **, const char **, unsigned int *); /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ - asymbol *(*_bfd_make_debug_symbol) PARAMS ((bfd *, void *, - unsigned long size)); + asymbol * (*_bfd_make_debug_symbol) + (bfd *, void *, unsigned long size); #define bfd_read_minisymbols(b, d, m, s) \ BFD_SEND (b, _read_minisymbols, (b, d, m, s)) - long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *, - unsigned int *)); + long (*_read_minisymbols) + (bfd *, bfd_boolean, void **, unsigned int *); #define bfd_minisymbol_to_symbol(b, d, m, f) \ BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) - asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR, - asymbol *)); + asymbol * (*_minisymbol_to_symbol) + (bfd *, bfd_boolean, const void *, asymbol *); /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME) \ -CONCAT2 (NAME,_get_reloc_upper_bound), \ -CONCAT2 (NAME,_canonicalize_reloc), \ -CONCAT2 (NAME,_bfd_reloc_type_lookup) - long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); - long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, - struct symbol_cache_entry **)); + NAME##_get_reloc_upper_bound, \ + NAME##_canonicalize_reloc, \ + NAME##_bfd_reloc_type_lookup + + long (*_get_reloc_upper_bound) (bfd *, sec_ptr); + long (*_bfd_canonicalize_reloc) + (bfd *, sec_ptr, arelent **, struct bfd_symbol **); /* See documentation on reloc types. */ reloc_howto_type * - (*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); + (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME) \ -CONCAT2 (NAME,_set_arch_mach), \ -CONCAT2 (NAME,_set_section_contents) - boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture, - unsigned long)); - boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, - file_ptr, bfd_size_type)); + NAME##_set_arch_mach, \ + NAME##_set_section_contents + + bfd_boolean (*_bfd_set_arch_mach) + (bfd *, enum bfd_architecture, unsigned long); + bfd_boolean (*_bfd_set_section_contents) + (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME) \ -CONCAT2 (NAME,_sizeof_headers), \ -CONCAT2 (NAME,_bfd_get_relocated_section_contents), \ -CONCAT2 (NAME,_bfd_relax_section), \ -CONCAT2 (NAME,_bfd_link_hash_table_create), \ -CONCAT2 (NAME,_bfd_link_hash_table_free), \ -CONCAT2 (NAME,_bfd_link_add_symbols), \ -CONCAT2 (NAME,_bfd_link_just_syms), \ -CONCAT2 (NAME,_bfd_final_link), \ -CONCAT2 (NAME,_bfd_link_split_section), \ -CONCAT2 (NAME,_bfd_gc_sections), \ -CONCAT2 (NAME,_bfd_merge_sections), \ -CONCAT2 (NAME,_bfd_discard_group) - int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); - bfd_byte *(*_bfd_get_relocated_section_contents) - PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, boolean, struct symbol_cache_entry **)); - - boolean (*_bfd_relax_section) - PARAMS ((bfd *, struct sec *, struct bfd_link_info *, boolean *)); + NAME##_sizeof_headers, \ + NAME##_bfd_get_relocated_section_contents, \ + NAME##_bfd_relax_section, \ + NAME##_bfd_link_hash_table_create, \ + NAME##_bfd_link_hash_table_free, \ + NAME##_bfd_link_add_symbols, \ + NAME##_bfd_link_just_syms, \ + NAME##_bfd_final_link, \ + NAME##_bfd_link_split_section, \ + NAME##_bfd_gc_sections, \ + NAME##_bfd_merge_sections, \ + NAME##_bfd_discard_group + + int (*_bfd_sizeof_headers) (bfd *, bfd_boolean); + bfd_byte * (*_bfd_get_relocated_section_contents) + (bfd *, struct bfd_link_info *, struct bfd_link_order *, + bfd_byte *, bfd_boolean, struct bfd_symbol **); + + bfd_boolean (*_bfd_relax_section) + (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); /* Create a hash table for the linker. Different backends store different information in this table. */ - struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *)); + struct bfd_link_hash_table * + (*_bfd_link_hash_table_create) (bfd *); /* Release the memory associated with the linker hash table. */ - void (*_bfd_link_hash_table_free) PARAMS ((struct bfd_link_hash_table *)); + void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); /* Add symbols from this object file into the hash table. */ - boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); + bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); /* Indicate that we are only retrieving symbol values from this section. */ - void (*_bfd_link_just_syms) PARAMS ((asection *, struct bfd_link_info *)); + void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); /* Do a link based on the link_order structures attached to each section of the BFD. */ - boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); + bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *); /* Should this section be split up into smaller pieces during linking. */ - boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); + bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); /* Remove sections that are not referenced from the output. */ - boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); + bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); /* Attempt to merge SEC_MERGE sections. */ - boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *)); + bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); /* Discard members of a group. */ - boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *)); + bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); /* Routines to handle dynamic symbols and relocs. */ #define BFD_JUMP_TABLE_DYNAMIC(NAME) \ -CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \ -CONCAT2 (NAME,_canonicalize_dynamic_symtab), \ -CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \ -CONCAT2 (NAME,_canonicalize_dynamic_reloc) + NAME##_get_dynamic_symtab_upper_bound, \ + NAME##_canonicalize_dynamic_symtab, \ + NAME##_get_dynamic_reloc_upper_bound, \ + NAME##_canonicalize_dynamic_reloc + /* Get the amount of memory required to hold the dynamic symbols. */ - long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); + long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); /* Read in the dynamic symbols. */ - long (*_bfd_canonicalize_dynamic_symtab) - PARAMS ((bfd *, struct symbol_cache_entry **)); + long (*_bfd_canonicalize_dynamic_symtab) + (bfd *, struct bfd_symbol **); /* Get the amount of memory required to hold the dynamic relocs. */ - long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); + long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); /* Read in the dynamic relocs. */ - long (*_bfd_canonicalize_dynamic_reloc) - PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); + long (*_bfd_canonicalize_dynamic_reloc) + (bfd *, arelent **, struct bfd_symbol **); @end example A pointer to an alternative bfd_target in case the current one is not @@ -449,7 +455,7 @@ to find an alternative output format that is suitable. /* Data for use by back-end routines, which isn't generic enough to belong in this structure. */ - PTR backend_data; + const void *backend_data; @} bfd_target; @@ -459,7 +465,7 @@ to find an alternative output format that is suitable. @subsubsection @code{bfd_set_default_target} @strong{Synopsis} @example -boolean bfd_set_default_target (const char *name); +bfd_boolean bfd_set_default_target (const char *name); @end example @strong{Description}@* Set the default target vector to use when recognizing a BFD. @@ -470,7 +476,7 @@ name or a configuration triplet. @subsubsection @code{bfd_find_target} @strong{Synopsis} @example -const bfd_target *bfd_find_target(const char *target_name, bfd *abfd); +const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); @end example @strong{Description}@* Return a pointer to the transfer vector for the object target @@ -487,7 +493,7 @@ targets to find the one that matches the file being read. @subsubsection @code{bfd_target_list} @strong{Synopsis} @example -const char **bfd_target_list(void); +const char ** bfd_target_list (void); @end example @strong{Description}@* Return a freshly malloced NULL-terminated @@ -498,7 +504,9 @@ 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/contrib/binutils/bfd/dwarf1.c b/contrib/binutils/bfd/dwarf1.c index 6531986..1047ebf 100644 --- a/contrib/binutils/bfd/dwarf1.c +++ b/contrib/binutils/bfd/dwarf1.c @@ -1,5 +1,5 @@ /* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line). - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com). @@ -126,15 +126,17 @@ struct linenumber { /* Find the form of an attr, from the attr field. */ #define FORM_FROM_ATTR(attr) ((attr) & 0xF) /* Implicitly specified */ -static struct dwarf1_unit *alloc_dwarf1_unit PARAMS ((struct dwarf1_debug *)); +static struct dwarf1_unit *alloc_dwarf1_unit + PARAMS ((struct dwarf1_debug *)); static struct dwarf1_func *alloc_dwarf1_func PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *)); -static boolean parse_die PARAMS ((bfd *, struct die_info *, char *, char *)); -static boolean parse_line_table +static bfd_boolean parse_die + PARAMS ((bfd *, struct die_info *, char *, char *)); +static bfd_boolean parse_line_table PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *)); -static boolean parse_functions_in_unit +static bfd_boolean parse_functions_in_unit PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *)); -static boolean dwarf1_unit_find_nearest_line +static bfd_boolean dwarf1_unit_find_nearest_line PARAMS ((struct dwarf1_debug *, struct dwarf1_unit *, unsigned long, const char **, const char **, unsigned int *)); @@ -176,9 +178,9 @@ alloc_dwarf1_func (stash, aUnit) 'abfd' must be the bfd from which the section that 'aDiePtr' 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 +static bfd_boolean parse_die (abfd, aDieInfo, aDiePtr, aDiePtrEnd) bfd* abfd; struct die_info* aDieInfo; @@ -195,12 +197,12 @@ parse_die (abfd, aDieInfo, aDiePtr, aDiePtrEnd) xptr += 4; if (aDieInfo->length == 0 || (this_die + aDieInfo->length) >= aDiePtrEnd) - return false; + return FALSE; if (aDieInfo->length < 6) { /* Just padding bytes. */ aDieInfo->tag = TAG_padding; - return true; + return TRUE; } /* Then the tag. */ @@ -259,14 +261,14 @@ parse_die (abfd, aDieInfo, aDiePtr, aDiePtrEnd) } } - return true; + return TRUE; } /* 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 +static bfd_boolean parse_line_table (stash, aUnit) struct dwarf1_debug* stash; struct dwarf1_unit* aUnit; @@ -281,19 +283,19 @@ parse_line_table (stash, aUnit) msec = bfd_get_section_by_name (stash->abfd, ".line"); if (! msec) - return false; + return FALSE; size = bfd_get_section_size_before_reloc (msec); stash->line_section = (char *) bfd_alloc (stash->abfd, size); if (! stash->line_section) - return false; + return FALSE; if (! bfd_get_section_contents (stash->abfd, msec, stash->line_section, (bfd_vma) 0, size)) { stash->line_section = 0; - return false; + return FALSE; } stash->line_section_end = stash->line_section + size; @@ -341,15 +343,15 @@ parse_line_table (stash, aUnit) } } - return true; + return TRUE; } /* 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 +static bfd_boolean parse_functions_in_unit (stash, aUnit) struct dwarf1_debug* stash; struct dwarf1_unit* aUnit; @@ -365,7 +367,7 @@ parse_functions_in_unit (stash, aUnit) if (! parse_die (stash->abfd, &eachDieInfo, eachDie, stash->debug_section_end)) - return false; + return FALSE; if (eachDieInfo.tag == TAG_global_subroutine || eachDieInfo.tag == TAG_subroutine @@ -386,13 +388,13 @@ parse_functions_in_unit (stash, aUnit) break; } - return true; + return TRUE; } /* Find the nearest line to 'addr' in 'aUnit'. Return whether we found the line (or a function) without error. */ -static boolean +static bfd_boolean dwarf1_unit_find_nearest_line (stash, aUnit, addr, filename_ptr, functionname_ptr, linenumber_ptr) @@ -403,8 +405,8 @@ dwarf1_unit_find_nearest_line (stash, aUnit, addr, const char **functionname_ptr; unsigned int *linenumber_ptr; { - int line_p = false; - int func_p = false; + int line_p = FALSE; + int func_p = FALSE; if (aUnit->low_pc <= addr && addr < aUnit->high_pc) { @@ -416,13 +418,13 @@ dwarf1_unit_find_nearest_line (stash, aUnit, addr, if (! aUnit->linenumber_table) { if (! parse_line_table (stash, aUnit)) - return false; + return FALSE; } if (! aUnit->func_list) { if (! parse_functions_in_unit (stash, aUnit)) - return false; + return FALSE; } for (i = 0; i < aUnit->line_count; i++) @@ -432,7 +434,7 @@ dwarf1_unit_find_nearest_line (stash, aUnit, addr, { *filename_ptr = aUnit->name; *linenumber_ptr = aUnit->linenumber_table[i].linenumber; - line_p = true; + line_p = TRUE; break; } } @@ -445,7 +447,7 @@ dwarf1_unit_find_nearest_line (stash, aUnit, addr, && addr < eachFunc->high_pc) { *functionname_ptr = eachFunc->name; - func_p = true; + func_p = TRUE; break; } } @@ -456,9 +458,9 @@ dwarf1_unit_find_nearest_line (stash, aUnit, addr, } /* 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_boolean _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, filename_ptr, functionname_ptr, linenumber_ptr) bfd *abfd; @@ -489,7 +491,7 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, = (struct dwarf1_debug *) bfd_zalloc (abfd, size); if (! stash) - return false; + return FALSE; msec = bfd_get_section_by_name (abfd, ".debug"); if (! msec) @@ -497,20 +499,20 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, /* 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. */ - return false; + return FALSE; } size = bfd_get_section_size_before_reloc (msec); stash->debug_section = (char *) bfd_alloc (abfd, size); if (! stash->debug_section) - return false; + return FALSE; if (! bfd_get_section_contents (abfd, msec, stash->debug_section, (bfd_vma) 0, size)) { stash->debug_section = 0; - return false; + return FALSE; } stash->debug_section_end = stash->debug_section + size; @@ -522,7 +524,7 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, or that an error occured while setting up the stash. */ if (! stash->debug_section) - return false; + return FALSE; /* Look at the previously parsed units to see if any contain the addr. */ @@ -541,7 +543,7 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, if (! parse_die (stash->abfd, &aDieInfo, stash->currentDie, stash->debug_section_end)) - return false; + return FALSE; if (aDieInfo.tag == TAG_compile_unit) { @@ -578,7 +580,7 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, stash->currentDie += aDieInfo.length; } - return false; + return FALSE; } /* EOF */ diff --git a/contrib/binutils/bfd/dwarf2.c b/contrib/binutils/bfd/dwarf2.c index 0639826..6182ea9 100644 --- a/contrib/binutils/bfd/dwarf2.c +++ b/contrib/binutils/bfd/dwarf2.c @@ -1,6 +1,6 @@ /* DWARF 2 support. - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2004 Free Software Foundation, Inc. Adapted from gdb/dwarf2read.c by Gavin Koch of Cygnus Solutions (gavin@cygnus.com). @@ -61,21 +61,12 @@ struct attribute { char *str; struct dwarf_block *blk; - unsigned int unsnd; - int snd; - bfd_vma addr; + bfd_uint64_t val; + bfd_int64_t sval; } u; }; -/* Get at parts of an attribute structure. */ - -#define DW_STRING(attr) ((attr)->u.str) -#define DW_UNSND(attr) ((attr)->u.unsnd) -#define DW_BLOCK(attr) ((attr)->u.blk) -#define DW_SND(attr) ((attr)->u.snd) -#define DW_ADDR(attr) ((attr)->u.addr) - /* Blocks are a bunch of untyped bytes. */ struct dwarf_block { @@ -157,7 +148,7 @@ struct comp_unit /* 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. */ @@ -209,53 +200,6 @@ struct attr_abbrev #define ATTR_ALLOC_CHUNK 4 #endif -static unsigned int read_1_byte PARAMS ((bfd *, char *)); -static int read_1_signed_byte PARAMS ((bfd *, char *)); -static unsigned int read_2_bytes PARAMS ((bfd *, char *)); -static unsigned int read_4_bytes PARAMS ((bfd *, char *)); -static bfd_vma read_8_bytes PARAMS ((bfd *, char *)); -static char *read_n_bytes PARAMS ((bfd *, char *, unsigned int)); -static char *read_string PARAMS ((bfd *, char *, unsigned int *)); -static char *read_indirect_string PARAMS ((struct comp_unit *, char *, unsigned int *)); -static unsigned int read_unsigned_leb128 - PARAMS ((bfd *, char *, unsigned int *)); -static int read_signed_leb128 - PARAMS ((bfd *, char *, unsigned int *)); -static bfd_vma read_address PARAMS ((struct comp_unit *, char *)); -static struct abbrev_info *lookup_abbrev - PARAMS ((unsigned int, struct abbrev_info **)); -static struct abbrev_info **read_abbrevs - PARAMS ((bfd *, bfd_vma, struct dwarf2_debug *)); -static char *read_attribute - PARAMS ((struct attribute *, struct attr_abbrev *, - struct comp_unit *, char *)); -static char *read_attribute_value - PARAMS ((struct attribute *, unsigned, - struct comp_unit *, char *)); -static void add_line_info - PARAMS ((struct line_info_table *, bfd_vma, char *, - unsigned int, unsigned int, int)); -static char *concat_filename PARAMS ((struct line_info_table *, unsigned int)); -static void arange_add PARAMS ((struct comp_unit *, bfd_vma, bfd_vma)); -static struct line_info_table *decode_line_info - PARAMS ((struct comp_unit *, struct dwarf2_debug *)); -static boolean lookup_address_in_line_info_table - PARAMS ((struct line_info_table *, bfd_vma, struct funcinfo *, - const char **, unsigned int *)); -static boolean lookup_address_in_function_table - PARAMS ((struct funcinfo *, bfd_vma, struct funcinfo **, const char **)); -static boolean scan_unit_for_functions PARAMS ((struct comp_unit *)); -static bfd_vma find_rela_addend - PARAMS ((bfd *, asection *, bfd_size_type, asymbol**)); -static struct comp_unit *parse_comp_unit - PARAMS ((bfd *, struct dwarf2_debug *, bfd_vma, unsigned int)); -static boolean comp_unit_contains_address - PARAMS ((struct comp_unit *, bfd_vma)); -static boolean comp_unit_find_nearest_line - PARAMS ((struct comp_unit *, bfd_vma, const char **, const char **, - unsigned int *, struct dwarf2_debug *)); -static asection *find_debug_info PARAMS ((bfd *, asection *)); - /* VERBATIM The following function up to the END VERBATIM mark are copied directly from dwarf2read.c. */ @@ -263,74 +207,39 @@ static asection *find_debug_info PARAMS ((bfd *, asection *)); /* Read dwarf information from a buffer. */ static unsigned int -read_1_byte (abfd, buf) - bfd *abfd ATTRIBUTE_UNUSED; - char *buf; +read_1_byte (bfd *abfd ATTRIBUTE_UNUSED, char *buf) { - return bfd_get_8 (abfd, (bfd_byte *) buf); + return bfd_get_8 (abfd, buf); } static int -read_1_signed_byte (abfd, buf) - bfd *abfd ATTRIBUTE_UNUSED; - char *buf; +read_1_signed_byte (bfd *abfd ATTRIBUTE_UNUSED, char *buf) { - return bfd_get_signed_8 (abfd, (bfd_byte *) buf); + return bfd_get_signed_8 (abfd, buf); } static unsigned int -read_2_bytes (abfd, buf) - bfd *abfd; - char *buf; +read_2_bytes (bfd *abfd, char *buf) { - return bfd_get_16 (abfd, (bfd_byte *) buf); + return bfd_get_16 (abfd, buf); } -#if 0 /* This is not used. */ - -static int -read_2_signed_bytes (abfd, buf) - bfd *abfd; - char *buf; -{ - return bfd_get_signed_16 (abfd, (bfd_byte *) buf); -} - -#endif - static unsigned int -read_4_bytes (abfd, buf) - bfd *abfd; - char *buf; -{ - return bfd_get_32 (abfd, (bfd_byte *) buf); -} - -#if 0 /* This is not used. */ - -static int -read_4_signed_bytes (abfd, buf) - bfd *abfd; - char *buf; +read_4_bytes (bfd *abfd, char *buf) { - return bfd_get_signed_32 (abfd, (bfd_byte *) buf); + return bfd_get_32 (abfd, buf); } -#endif - -static bfd_vma -read_8_bytes (abfd, buf) - bfd *abfd; - char *buf; +static bfd_uint64_t +read_8_bytes (bfd *abfd, char *buf) { - return bfd_get_64 (abfd, (bfd_byte *) buf); + return bfd_get_64 (abfd, buf); } static char * -read_n_bytes (abfd, buf, size) - bfd *abfd ATTRIBUTE_UNUSED; - char *buf; - unsigned int size ATTRIBUTE_UNUSED; +read_n_bytes (bfd *abfd ATTRIBUTE_UNUSED, + char *buf, + unsigned int size ATTRIBUTE_UNUSED) { /* If the size of a host char is 8 bits, we can return a pointer to the buffer, otherwise we have to copy the data to a buffer @@ -339,10 +248,9 @@ read_n_bytes (abfd, buf, size) } static char * -read_string (abfd, buf, bytes_read_ptr) - bfd *abfd ATTRIBUTE_UNUSED; - char *buf; - unsigned int *bytes_read_ptr; +read_string (bfd *abfd ATTRIBUTE_UNUSED, + char *buf, + unsigned int *bytes_read_ptr) { /* Return a pointer to the embedded string. */ if (*buf == '\0') @@ -356,12 +264,11 @@ read_string (abfd, buf, bytes_read_ptr) } static char * -read_indirect_string (unit, buf, bytes_read_ptr) - struct comp_unit* unit; - char *buf; - unsigned int *bytes_read_ptr; +read_indirect_string (struct comp_unit* unit, + char *buf, + unsigned int *bytes_read_ptr) { - bfd_vma offset; + bfd_uint64_t offset; struct dwarf2_debug *stash = unit->stash; if (unit->offset_size == 4) @@ -385,12 +292,12 @@ read_indirect_string (unit, buf, bytes_read_ptr) } stash->dwarf_str_size = msec->_raw_size; - stash->dwarf_str_buffer = (char*) bfd_alloc (abfd, msec->_raw_size); + stash->dwarf_str_buffer = bfd_alloc (abfd, msec->_raw_size); if (! stash->dwarf_abbrev_buffer) return NULL; if (! bfd_get_section_contents (abfd, msec, stash->dwarf_str_buffer, - (bfd_vma) 0, msec->_raw_size)) + 0, msec->_raw_size)) return NULL; } @@ -409,10 +316,9 @@ read_indirect_string (unit, buf, bytes_read_ptr) } static unsigned int -read_unsigned_leb128 (abfd, buf, bytes_read_ptr) - bfd *abfd ATTRIBUTE_UNUSED; - char *buf; - unsigned int *bytes_read_ptr; +read_unsigned_leb128 (bfd *abfd ATTRIBUTE_UNUSED, + char *buf, + unsigned int *bytes_read_ptr) { unsigned int result; unsigned int num_read; @@ -425,7 +331,7 @@ read_unsigned_leb128 (abfd, buf, bytes_read_ptr) do { - byte = bfd_get_8 (abfd, (bfd_byte *) buf); + byte = bfd_get_8 (abfd, buf); buf ++; num_read ++; result |= ((byte & 0x7f) << shift); @@ -439,10 +345,9 @@ read_unsigned_leb128 (abfd, buf, bytes_read_ptr) } static int -read_signed_leb128 (abfd, buf, bytes_read_ptr) - bfd *abfd ATTRIBUTE_UNUSED; - char *buf; - unsigned int * bytes_read_ptr; +read_signed_leb128 (bfd *abfd ATTRIBUTE_UNUSED, + char *buf, + unsigned int * bytes_read_ptr) { int result; int shift; @@ -455,7 +360,7 @@ read_signed_leb128 (abfd, buf, bytes_read_ptr) do { - byte = bfd_get_8 (abfd, (bfd_byte *) buf); + byte = bfd_get_8 (abfd, buf); buf ++; num_read ++; result |= ((byte & 0x7f) << shift); @@ -473,19 +378,17 @@ read_signed_leb128 (abfd, buf, bytes_read_ptr) /* END VERBATIM */ -static bfd_vma -read_address (unit, buf) - struct comp_unit* unit; - char *buf; +static bfd_uint64_t +read_address (struct comp_unit *unit, char *buf) { switch (unit->addr_size) { case 8: - return bfd_get_64 (unit->abfd, (bfd_byte *) buf); + return bfd_get_64 (unit->abfd, buf); case 4: - return bfd_get_32 (unit->abfd, (bfd_byte *) buf); + return bfd_get_32 (unit->abfd, buf); case 2: - return bfd_get_16 (unit->abfd, (bfd_byte *) buf); + return bfd_get_16 (unit->abfd, buf); default: abort (); } @@ -494,9 +397,7 @@ read_address (unit, buf) /* Lookup an abbrev_info structure in the abbrev hash table. */ static struct abbrev_info * -lookup_abbrev (number,abbrevs) - unsigned int number; - struct abbrev_info **abbrevs; +lookup_abbrev (unsigned int number, struct abbrev_info **abbrevs) { unsigned int hash_number; struct abbrev_info *abbrev; @@ -521,10 +422,7 @@ lookup_abbrev (number,abbrevs) in a hash table. */ static struct abbrev_info** -read_abbrevs (abfd, offset, stash) - bfd * abfd; - bfd_vma offset; - struct dwarf2_debug *stash; +read_abbrevs (bfd *abfd, bfd_uint64_t offset, struct dwarf2_debug *stash) { struct abbrev_info **abbrevs; char *abbrev_ptr; @@ -546,13 +444,11 @@ read_abbrevs (abfd, offset, stash) } stash->dwarf_abbrev_size = msec->_raw_size; - stash->dwarf_abbrev_buffer = (char*) bfd_alloc (abfd, msec->_raw_size); + stash->dwarf_abbrev_buffer + = bfd_simple_get_relocated_section_contents (abfd, msec, NULL, + stash->syms); if (! stash->dwarf_abbrev_buffer) return 0; - - if (! bfd_get_section_contents (abfd, msec, stash->dwarf_abbrev_buffer, - (bfd_vma) 0, msec->_raw_size)) - return 0; } if (offset >= stash->dwarf_abbrev_size) @@ -564,7 +460,7 @@ read_abbrevs (abfd, offset, stash) } amt = sizeof (struct abbrev_info*) * ABBREV_HASH_SIZE; - abbrevs = (struct abbrev_info**) bfd_zalloc (abfd, amt); + abbrevs = bfd_zalloc (abfd, amt); abbrev_ptr = stash->dwarf_abbrev_buffer + offset; abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); @@ -574,7 +470,7 @@ read_abbrevs (abfd, offset, stash) while (abbrev_number) { amt = sizeof (struct abbrev_info); - cur_abbrev = (struct abbrev_info *) bfd_zalloc (abfd, amt); + cur_abbrev = bfd_zalloc (abfd, amt); /* Read in abbrev header. */ cur_abbrev->number = abbrev_number; @@ -596,8 +492,7 @@ read_abbrevs (abfd, offset, stash) { amt = cur_abbrev->num_attrs + ATTR_ALLOC_CHUNK; amt *= sizeof (struct attr_abbrev); - cur_abbrev->attrs = ((struct attr_abbrev *) - bfd_realloc (cur_abbrev->attrs, amt)); + cur_abbrev->attrs = bfd_realloc (cur_abbrev->attrs, amt); if (! cur_abbrev->attrs) return 0; } @@ -638,11 +533,10 @@ read_abbrevs (abfd, offset, stash) /* Read an attribute value described by an attribute form. */ static char * -read_attribute_value (attr, form, unit, info_ptr) - struct attribute *attr; - unsigned form; - struct comp_unit *unit; - char *info_ptr; +read_attribute_value (struct attribute *attr, + unsigned form, + struct comp_unit *unit, + char *info_ptr) { bfd *abfd = unit->abfd; unsigned int bytes_read; @@ -654,101 +548,101 @@ read_attribute_value (attr, form, unit, info_ptr) switch (form) { case DW_FORM_addr: - /* FIXME: DWARF3 draft sais DW_FORM_ref_addr is offset_size. */ + /* FIXME: DWARF3 draft says DW_FORM_ref_addr is offset_size. */ case DW_FORM_ref_addr: - DW_ADDR (attr) = read_address (unit, info_ptr); + attr->u.val = read_address (unit, info_ptr); info_ptr += unit->addr_size; break; case DW_FORM_block2: amt = sizeof (struct dwarf_block); - blk = (struct dwarf_block *) bfd_alloc (abfd, amt); + blk = bfd_alloc (abfd, amt); blk->size = read_2_bytes (abfd, info_ptr); info_ptr += 2; blk->data = read_n_bytes (abfd, info_ptr, blk->size); info_ptr += blk->size; - DW_BLOCK (attr) = blk; + attr->u.blk = blk; break; case DW_FORM_block4: amt = sizeof (struct dwarf_block); - blk = (struct dwarf_block *) bfd_alloc (abfd, amt); + blk = bfd_alloc (abfd, amt); blk->size = read_4_bytes (abfd, info_ptr); info_ptr += 4; blk->data = read_n_bytes (abfd, info_ptr, blk->size); info_ptr += blk->size; - DW_BLOCK (attr) = blk; + attr->u.blk = blk; break; case DW_FORM_data2: - DW_UNSND (attr) = read_2_bytes (abfd, info_ptr); + attr->u.val = read_2_bytes (abfd, info_ptr); info_ptr += 2; break; case DW_FORM_data4: - DW_UNSND (attr) = read_4_bytes (abfd, info_ptr); + attr->u.val = read_4_bytes (abfd, info_ptr); info_ptr += 4; break; case DW_FORM_data8: - DW_UNSND (attr) = read_8_bytes (abfd, info_ptr); + attr->u.val = read_8_bytes (abfd, info_ptr); info_ptr += 8; break; case DW_FORM_string: - DW_STRING (attr) = read_string (abfd, info_ptr, &bytes_read); + attr->u.str = read_string (abfd, info_ptr, &bytes_read); info_ptr += bytes_read; break; case DW_FORM_strp: - DW_STRING (attr) = read_indirect_string (unit, info_ptr, &bytes_read); + attr->u.str = read_indirect_string (unit, info_ptr, &bytes_read); info_ptr += bytes_read; break; case DW_FORM_block: amt = sizeof (struct dwarf_block); - blk = (struct dwarf_block *) bfd_alloc (abfd, amt); + blk = bfd_alloc (abfd, amt); blk->size = read_unsigned_leb128 (abfd, info_ptr, &bytes_read); info_ptr += bytes_read; blk->data = read_n_bytes (abfd, info_ptr, blk->size); info_ptr += blk->size; - DW_BLOCK (attr) = blk; + attr->u.blk = blk; break; case DW_FORM_block1: amt = sizeof (struct dwarf_block); - blk = (struct dwarf_block *) bfd_alloc (abfd, amt); + blk = bfd_alloc (abfd, amt); blk->size = read_1_byte (abfd, info_ptr); info_ptr += 1; blk->data = read_n_bytes (abfd, info_ptr, blk->size); info_ptr += blk->size; - DW_BLOCK (attr) = blk; + attr->u.blk = blk; break; case DW_FORM_data1: - DW_UNSND (attr) = read_1_byte (abfd, info_ptr); + attr->u.val = read_1_byte (abfd, info_ptr); info_ptr += 1; break; case DW_FORM_flag: - DW_UNSND (attr) = read_1_byte (abfd, info_ptr); + attr->u.val = read_1_byte (abfd, info_ptr); info_ptr += 1; break; case DW_FORM_sdata: - DW_SND (attr) = read_signed_leb128 (abfd, info_ptr, &bytes_read); + attr->u.sval = read_signed_leb128 (abfd, info_ptr, &bytes_read); info_ptr += bytes_read; break; case DW_FORM_udata: - DW_UNSND (attr) = read_unsigned_leb128 (abfd, info_ptr, &bytes_read); + attr->u.val = read_unsigned_leb128 (abfd, info_ptr, &bytes_read); info_ptr += bytes_read; break; case DW_FORM_ref1: - DW_UNSND (attr) = read_1_byte (abfd, info_ptr); + attr->u.val = read_1_byte (abfd, info_ptr); info_ptr += 1; break; case DW_FORM_ref2: - DW_UNSND (attr) = read_2_bytes (abfd, info_ptr); + attr->u.val = read_2_bytes (abfd, info_ptr); info_ptr += 2; break; case DW_FORM_ref4: - DW_UNSND (attr) = read_4_bytes (abfd, info_ptr); + attr->u.val = read_4_bytes (abfd, info_ptr); info_ptr += 4; break; case DW_FORM_ref8: - DW_UNSND (attr) = read_8_bytes (abfd, info_ptr); + attr->u.val = read_8_bytes (abfd, info_ptr); info_ptr += 8; break; case DW_FORM_ref_udata: - DW_UNSND (attr) = read_unsigned_leb128 (abfd, info_ptr, &bytes_read); + attr->u.val = read_unsigned_leb128 (abfd, info_ptr, &bytes_read); info_ptr += bytes_read; break; case DW_FORM_indirect: @@ -767,11 +661,10 @@ read_attribute_value (attr, form, unit, info_ptr) /* Read an attribute described by an abbreviated attribute. */ static char * -read_attribute (attr, abbrev, unit, info_ptr) - struct attribute *attr; - struct attr_abbrev *abbrev; - struct comp_unit *unit; - char *info_ptr; +read_attribute (struct attribute *attr, + struct attr_abbrev *abbrev, + struct comp_unit *unit, + char *info_ptr) { attr->name = abbrev->name; info_ptr = read_attribute_value (attr, abbrev->form, unit, info_ptr); @@ -821,22 +714,21 @@ struct funcinfo bfd_vma high; }; -/* add_line_info: adds a new entry to the line_info list in the - line_info_table, ensuring that the list is sorted. Note that the - line_info list is sorted from highest to lowest VMA (with possible - duplicates); that is, line_info->prev_line always accesses an equal - or smaller VMA. */ +/* Adds a new entry to the line_info list in the line_info_table, ensuring + that the list is sorted. Note that the line_info list is sorted from + highest to lowest VMA (with possible duplicates); that is, + line_info->prev_line always accesses an equal or smaller VMA. */ + static void -add_line_info (table, address, filename, line, column, end_sequence) - struct line_info_table* table; - bfd_vma address; - char* filename; - unsigned int line; - unsigned int column; - int end_sequence; +add_line_info (struct line_info_table *table, + bfd_vma address, + char *filename, + unsigned int line, + unsigned int column, + int end_sequence) { bfd_size_type amt = sizeof (struct line_info); - struct line_info* info = (struct line_info*) bfd_alloc (table->abfd, amt); + struct line_info* info = bfd_alloc (table->abfd, amt); /* Find the correct location for 'info'. Normally we will receive new line_info data 1) in order and 2) with increasing VMAs. @@ -905,16 +797,26 @@ add_line_info (table, address, filename, line, column, end_sequence) /* Set member data of 'info'. */ info->address = address; - info->filename = filename; info->line = line; info->column = column; info->end_sequence = end_sequence; + + if (filename && filename[0]) + { + info->filename = bfd_alloc (table->abfd, strlen (filename) + 1); + if (info->filename) + strcpy (info->filename, filename); + } + else + info->filename = NULL; } +/* Extract a fully qualified filename from a line info table. + The returned string has been malloc'ed and it is the caller's + responsibility to free it. */ + static char * -concat_filename (table, file) - struct line_info_table* table; - unsigned int file; +concat_filename (struct line_info_table *table, unsigned int file) { char* filename; @@ -922,32 +824,36 @@ concat_filename (table, file) { (*_bfd_error_handler) (_("Dwarf Error: mangled line number section (bad file number).")); - return ""; + return strdup (""); } filename = table->files[file - 1].name; - if (IS_ABSOLUTE_PATH(filename)) - return filename; - else + + if (! IS_ABSOLUTE_PATH (filename)) { char* dirname = (table->files[file - 1].dir ? table->dirs[table->files[file - 1].dir - 1] : table->comp_dir); - /* Not all tools set DW_AT_comp_dir, so dirname may be unknown. The - best we can do is return the filename part. */ - if (dirname == NULL) - return filename; - else - return (char*) concat (dirname, "/", filename, NULL); + /* Not all tools set DW_AT_comp_dir, so dirname may be unknown. + The best we can do is return the filename part. */ + if (dirname != NULL) + { + unsigned int len = strlen (dirname) + strlen (filename) + 2; + char * name; + + name = bfd_malloc (len); + if (name) + sprintf (name, "%s/%s", dirname, filename); + return name; + } } + + return strdup (filename); } static void -arange_add (unit, low_pc, high_pc) - struct comp_unit *unit; - bfd_vma low_pc; - bfd_vma high_pc; +arange_add (struct comp_unit *unit, bfd_vma low_pc, bfd_vma high_pc) { struct arange *arange; @@ -980,8 +886,7 @@ arange_add (unit, low_pc, high_pc) } /* Need to allocate a new arange and insert it into the arange list. */ - arange = (struct arange *) - bfd_zalloc (unit->abfd, (bfd_size_type) sizeof (*arange)); + arange = bfd_zalloc (unit->abfd, sizeof (*arange)); arange->low = low_pc; arange->high = high_pc; @@ -992,9 +897,7 @@ arange_add (unit, low_pc, high_pc) /* Decode the line number information for UNIT. */ static struct line_info_table* -decode_line_info (unit, stash) - struct comp_unit *unit; - struct dwarf2_debug *stash; +decode_line_info (struct comp_unit *unit, struct dwarf2_debug *stash) { bfd *abfd = unit->abfd; struct line_info_table* table; @@ -1019,21 +922,15 @@ decode_line_info (unit, stash) } stash->dwarf_line_size = msec->_raw_size; - stash->dwarf_line_buffer = (char *) bfd_alloc (abfd, msec->_raw_size); + stash->dwarf_line_buffer + = bfd_simple_get_relocated_section_contents (abfd, msec, NULL, + stash->syms); if (! stash->dwarf_line_buffer) return 0; - - if (! bfd_get_section_contents (abfd, msec, stash->dwarf_line_buffer, - (bfd_vma) 0, msec->_raw_size)) - return 0; - - /* FIXME: We ought to apply the relocs against this section before - we process it... */ } - /* 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. */ + /* 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 (%lu) greater than or equal to .debug_line size (%lu)."), @@ -1043,7 +940,7 @@ decode_line_info (unit, stash) } amt = sizeof (struct line_info_table); - table = (struct line_info_table*) bfd_alloc (abfd, amt); + table = bfd_alloc (abfd, amt); table->abfd = abfd; table->comp_dir = unit->comp_dir; @@ -1095,7 +992,7 @@ decode_line_info (unit, stash) lh.opcode_base = read_1_byte (abfd, line_ptr); line_ptr += 1; amt = lh.opcode_base * sizeof (unsigned char); - lh.standard_opcode_lengths = (unsigned char *) bfd_alloc (abfd, amt); + lh.standard_opcode_lengths = bfd_alloc (abfd, amt); lh.standard_opcode_lengths[0] = 1; @@ -1114,7 +1011,7 @@ decode_line_info (unit, stash) { amt = table->num_dirs + DIR_ALLOC_CHUNK; amt *= sizeof (char *); - table->dirs = (char **) bfd_realloc (table->dirs, amt); + table->dirs = bfd_realloc (table->dirs, amt); if (! table->dirs) return 0; } @@ -1133,7 +1030,7 @@ decode_line_info (unit, stash) { amt = table->num_files + FILE_ALLOC_CHUNK; amt *= sizeof (struct fileinfo); - table->files = (struct fileinfo *) bfd_realloc (table->files, amt); + table->files = bfd_realloc (table->files, amt); if (! table->files) return 0; } @@ -1158,7 +1055,7 @@ decode_line_info (unit, stash) { /* State machine registers. */ bfd_vma address = 0; - char * filename = concat_filename (table, 1); + char * filename = table->num_files ? concat_filename (table, 1) : NULL; unsigned int line = 1; unsigned int column = 0; int is_stmt = lh.default_is_stmt; @@ -1224,8 +1121,7 @@ decode_line_info (unit, stash) { amt = table->num_files + FILE_ALLOC_CHUNK; amt *= sizeof (struct fileinfo); - table->files = - (struct fileinfo *) bfd_realloc (table->files, amt); + table->files = bfd_realloc (table->files, amt); if (! table->files) return 0; } @@ -1272,6 +1168,8 @@ decode_line_info (unit, stash) based, the references are 1 based. */ file = read_unsigned_leb128 (abfd, line_ptr, &bytes_read); line_ptr += bytes_read; + if (filename) + free (filename); filename = concat_filename (table, file); break; } @@ -1296,6 +1194,7 @@ decode_line_info (unit, stash) default: { int i; + /* Unknown standard opcode, ignore it. */ for (i = 0; i < lh.standard_opcode_lengths[op_code]; i++) { @@ -1305,23 +1204,24 @@ decode_line_info (unit, stash) } } } + + if (filename) + free (filename); } return table; } -/* If ADDR is within TABLE set the output parameters and return true, - otherwise return false. The output parameters, FILENAME_PTR and +/* If ADDR is within TABLE set the output parameters and return TRUE, + otherwise return FALSE. The output parameters, FILENAME_PTR and LINENUMBER_PTR, are pointers to the objects to be filled in. */ -static boolean -lookup_address_in_line_info_table (table, addr, function, filename_ptr, - linenumber_ptr) - struct line_info_table* table; - bfd_vma addr; - struct funcinfo *function; - const char **filename_ptr; - unsigned int *linenumber_ptr; +static bfd_boolean +lookup_address_in_line_info_table (struct line_info_table *table, + bfd_vma addr, + struct funcinfo *function, + const char **filename_ptr, + unsigned int *linenumber_ptr) { /* Note: table->last_line should be a descendingly sorted list. */ struct line_info* next_line = table->last_line; @@ -1329,7 +1229,7 @@ lookup_address_in_line_info_table (table, addr, function, filename_ptr, *filename_ptr = NULL; if (!next_line) - return false; + return FALSE; each_line = next_line->prev_line; @@ -1343,10 +1243,10 @@ lookup_address_in_line_info_table (table, addr, function, filename_ptr, /* If we have an address match, save this info. This allows us to return as good as results as possible for strange debugging info. */ - boolean addr_match = false; + bfd_boolean addr_match = FALSE; if (each_line->address <= addr && addr <= next_line->address) { - addr_match = true; + addr_match = TRUE; /* If this line appears to span functions, and addr is in the later function, return the first line of that function instead @@ -1367,7 +1267,7 @@ lookup_address_in_line_info_table (table, addr, function, filename_ptr, } if (addr_match && !each_line->end_sequence) - return true; /* we have definitely found what we want */ + return TRUE; /* we have definitely found what we want */ next_line = each_line; each_line = each_line->prev_line; @@ -1383,23 +1283,21 @@ lookup_address_in_line_info_table (table, addr, function, filename_ptr, { *filename_ptr = next_line->filename; *linenumber_ptr = next_line->line; - return true; + return TRUE; } - return false; + return FALSE; } /* Function table functions. */ -/* 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, addr, function_ptr, - functionname_ptr) - struct funcinfo* table; - bfd_vma addr; - struct funcinfo** function_ptr; - const char **functionname_ptr; +static bfd_boolean +lookup_address_in_function_table (struct funcinfo *table, + bfd_vma addr, + struct funcinfo **function_ptr, + const char **functionname_ptr) { struct funcinfo* each_func; @@ -1411,11 +1309,11 @@ lookup_address_in_function_table (table, addr, function_ptr, { *functionname_ptr = each_func->name; *function_ptr = each_func; - return true; + return TRUE; } } - return false; + return FALSE; } /* DWARF2 Compilation unit functions. */ @@ -1423,9 +1321,8 @@ lookup_address_in_function_table (table, addr, function_ptr, /* Scan over each die in a comp. unit looking for functions to add to the function table. */ -static boolean -scan_unit_for_functions (unit) - struct comp_unit *unit; +static bfd_boolean +scan_unit_for_functions (struct comp_unit *unit) { bfd *abfd = unit->abfd; char *info_ptr = unit->first_child_die_ptr; @@ -1454,13 +1351,13 @@ scan_unit_for_functions (unit) (*_bfd_error_handler) (_("Dwarf Error: Could not find abbrev number %u."), abbrev_number); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } if (abbrev->tag == DW_TAG_subprogram) { bfd_size_type amt = sizeof (struct funcinfo); - func = (struct funcinfo *) bfd_zalloc (abfd, amt); + func = bfd_zalloc (abfd, amt); func->prev_func = unit->function_table; unit->function_table = func; } @@ -1477,23 +1374,23 @@ scan_unit_for_functions (unit) { case DW_AT_name: - name = DW_STRING (&attr); + name = attr.u.str; /* Prefer DW_AT_MIPS_linkage_name over DW_AT_name. */ if (func->name == NULL) - func->name = DW_STRING (&attr); + func->name = attr.u.str; break; case DW_AT_MIPS_linkage_name: - func->name = DW_STRING (&attr); + func->name = attr.u.str; break; case DW_AT_low_pc: - func->low = DW_ADDR (&attr); + func->low = attr.u.val; break; case DW_AT_high_pc: - func->high = DW_ADDR (&attr); + func->high = attr.u.val; break; default: @@ -1505,7 +1402,7 @@ scan_unit_for_functions (unit) switch (attr.name) { case DW_AT_name: - name = DW_STRING (&attr); + name = attr.u.str; break; default: @@ -1518,66 +1415,12 @@ scan_unit_for_functions (unit) nesting_level++; } - return true; -} - -/* Look for a RELA relocation to be applied on OFFSET of section SEC, - and return the addend if such a relocation is found. Since this is - only used to find relocations referring to the .debug_abbrev - section, we make sure the relocation refers to this section, but - this is not strictly necessary, and it can probably be safely - removed if needed. However, it is important to note that this - function only returns the addend, it doesn't serve the purpose of - applying a generic relocation. - - If no suitable relocation is found, or if it is not a real RELA - relocation, this function returns 0. */ - -static bfd_vma -find_rela_addend (abfd, sec, offset, syms) - bfd* abfd; - asection* sec; - bfd_size_type offset; - asymbol** syms; -{ - long reloc_size = bfd_get_reloc_upper_bound (abfd, sec); - arelent **relocs = NULL; - long reloc_count, relc; - - if (reloc_size <= 0) - return 0; - - relocs = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); - if (relocs == NULL) - return 0; - - reloc_count = bfd_canonicalize_reloc (abfd, sec, relocs, syms); - - if (reloc_count <= 0) - { - free (relocs); - return 0; - } - - for (relc = 0; relc < reloc_count; relc++) - if (relocs[relc]->address == offset - && (*relocs[relc]->sym_ptr_ptr)->flags & BSF_SECTION_SYM - && strcmp ((*relocs[relc]->sym_ptr_ptr)->name, - ".debug_abbrev") == 0) - { - bfd_vma addend = (relocs[relc]->howto->partial_inplace - ? 0 : relocs[relc]->addend); - free (relocs); - return addend; - } - - free (relocs); - return 0; + 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 + does not include the length field that precedes each compilation unit header. END_PTR points one past the end of this comp unit. OFFSET_SIZE is the size of DWARF2 offsets (either 4 or 8 bytes). @@ -1585,15 +1428,14 @@ find_rela_addend (abfd, sec, offset, syms) to get to the line number information for the compilation unit. */ static struct comp_unit * -parse_comp_unit (abfd, stash, unit_length, offset_size) - bfd* abfd; - struct dwarf2_debug *stash; - bfd_vma unit_length; - unsigned int offset_size; +parse_comp_unit (bfd *abfd, + struct dwarf2_debug *stash, + bfd_vma unit_length, + unsigned int offset_size) { struct comp_unit* unit; unsigned int version; - bfd_vma abbrev_offset = 0; + bfd_uint64_t abbrev_offset = 0; unsigned int addr_size; struct abbrev_info** abbrevs; unsigned int abbrev_number, bytes_read, i; @@ -1602,7 +1444,6 @@ parse_comp_unit (abfd, stash, unit_length, offset_size) char *info_ptr = stash->info_ptr; char *end_ptr = info_ptr + unit_length; bfd_size_type amt; - bfd_size_type off; version = read_2_bytes (abfd, info_ptr); info_ptr += 2; @@ -1611,12 +1452,6 @@ parse_comp_unit (abfd, stash, unit_length, offset_size) abbrev_offset = read_4_bytes (abfd, info_ptr); else abbrev_offset = read_8_bytes (abfd, info_ptr); - /* The abbrev offset is generally a relocation pointing to - .debug_abbrev+offset. On RELA targets, we have to find the - relocation and extract the addend to obtain the actual - abbrev_offset, so do it here. */ - off = info_ptr - stash->sec_info_ptr; - abbrev_offset += find_rela_addend (abfd, stash->sec, off, stash->syms); info_ptr += offset_size; addr_size = read_1_byte (abfd, info_ptr); info_ptr += 1; @@ -1669,7 +1504,7 @@ parse_comp_unit (abfd, stash, unit_length, offset_size) } amt = sizeof (struct comp_unit); - unit = (struct comp_unit*) bfd_zalloc (abfd, amt); + unit = bfd_zalloc (abfd, amt); unit->abfd = abfd; unit->addr_size = addr_size; unit->offset_size = offset_size; @@ -1687,29 +1522,29 @@ parse_comp_unit (abfd, stash, unit_length, offset_size) { case DW_AT_stmt_list: unit->stmtlist = 1; - unit->line_offset = DW_UNSND (&attr); + unit->line_offset = attr.u.val; break; case DW_AT_name: - unit->name = DW_STRING (&attr); + unit->name = attr.u.str; break; case DW_AT_low_pc: - unit->arange.low = DW_ADDR (&attr); + unit->arange.low = attr.u.val; break; case DW_AT_high_pc: - unit->arange.high = DW_ADDR (&attr); + unit->arange.high = attr.u.val; break; case DW_AT_comp_dir: { - char* comp_dir = DW_STRING (&attr); + char* comp_dir = attr.u.str; if (comp_dir) { /* Irix 6.2 native cc prepends .: to the compilation directory, get rid of it. */ - char *cp = (char*) strchr (comp_dir, ':'); + char *cp = strchr (comp_dir, ':'); if (cp && cp != comp_dir && cp[-1] == '.' && cp[1] == '/') comp_dir = cp + 1; @@ -1727,28 +1562,26 @@ parse_comp_unit (abfd, stash, unit_length, offset_size) 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) - struct comp_unit* unit; - bfd_vma addr; +static bfd_boolean +comp_unit_contains_address (struct comp_unit *unit, bfd_vma addr) { struct arange *arange; if (unit->error) - return false; + return FALSE; arange = &unit->arange; do { if (addr >= arange->low && addr < arange->high) - return true; + return TRUE; arange = arange->next; } while (arange); - return false; + return FALSE; } /* If UNIT contains ADDR, set the output parameters to the values for @@ -1756,32 +1589,30 @@ comp_unit_contains_address (unit, addr) FUNCTIONNAME_PTR, and LINENUMBER_PTR, are pointers to the objects to be filled in. - Return true of UNIT contains ADDR, and no errors were encountered; - false otherwise. */ - -static boolean -comp_unit_find_nearest_line (unit, addr, filename_ptr, functionname_ptr, - linenumber_ptr, stash) - struct comp_unit* unit; - bfd_vma addr; - const char **filename_ptr; - const char **functionname_ptr; - unsigned int *linenumber_ptr; - struct dwarf2_debug *stash; + Return TRUE if UNIT contains ADDR, and no errors were encountered; + FALSE otherwise. */ + +static bfd_boolean +comp_unit_find_nearest_line (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; + bfd_boolean line_p; + bfd_boolean func_p; struct funcinfo *function; if (unit->error) - return false; + return FALSE; if (! unit->line_table) { if (! unit->stmtlist) { unit->error = 1; - return false; + return FALSE; } unit->line_table = decode_line_info (unit, stash); @@ -1789,14 +1620,14 @@ comp_unit_find_nearest_line (unit, addr, filename_ptr, functionname_ptr, if (! unit->line_table) { unit->error = 1; - return false; + return FALSE; } if (unit->first_child_die_ptr < unit->end_ptr && ! scan_unit_for_functions (unit)) { unit->error = 1; - return false; + return FALSE; } } @@ -1806,7 +1637,7 @@ comp_unit_find_nearest_line (unit, addr, filename_ptr, functionname_ptr, line_p = lookup_address_in_line_info_table (unit->line_table, addr, function, filename_ptr, linenumber_ptr); - return (boolean) (line_p || func_p); + return line_p || func_p; } /* Locate a section in a BFD containing debugging info. The search starts @@ -1822,9 +1653,7 @@ comp_unit_find_nearest_line (unit, addr, filename_ptr, functionname_ptr, #define GNU_LINKONCE_INFO ".gnu.linkonce.wi." static asection * -find_debug_info (abfd, after_sec) - bfd * abfd; - asection * after_sec; +find_debug_info (bfd *abfd, asection *after_sec) { asection * msec; @@ -1847,25 +1676,22 @@ find_debug_info (abfd, after_sec) return NULL; } -/* The DWARF2 version of find_nearest line. Return true if the line +/* 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. You may use zero to indicate that the default value should be used. */ -boolean -_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, - filename_ptr, functionname_ptr, - linenumber_ptr, addr_size, pinfo) - bfd *abfd; - asection *section; - asymbol **symbols; - bfd_vma offset; - const char **filename_ptr; - const char **functionname_ptr; - unsigned int *linenumber_ptr; - unsigned int addr_size; - PTR *pinfo; +bfd_boolean +_bfd_dwarf2_find_nearest_line (bfd *abfd, + asection *section, + asymbol **symbols, + bfd_vma offset, + const char **filename_ptr, + const char **functionname_ptr, + unsigned int *linenumber_ptr, + unsigned int addr_size, + void **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, @@ -1875,7 +1701,7 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, We keep a list of all the previously read compilation units, and a pointer to the next un-read compilation unit. Check the previously read units before reading more. */ - struct dwarf2_debug *stash = (struct dwarf2_debug *) *pinfo; + struct dwarf2_debug *stash = *pinfo; /* What address are we looking for? */ bfd_vma addr = offset + section->vma; @@ -1899,18 +1725,18 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, asection *msec; bfd_size_type amt = sizeof (struct dwarf2_debug); - stash = (struct dwarf2_debug*) bfd_zalloc (abfd, amt); + stash = bfd_zalloc (abfd, amt); if (! stash) - return false; + return FALSE; - *pinfo = (PTR) stash; + *pinfo = 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; + return FALSE; /* 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 @@ -1920,9 +1746,9 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, 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); + stash->info_ptr = bfd_alloc (abfd, total_size); if (stash->info_ptr == NULL) - return false; + return FALSE; stash->info_ptr_end = stash->info_ptr; @@ -1939,8 +1765,8 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, start = stash->info_ptr_end - stash->info_ptr; - if (! bfd_get_section_contents (abfd, msec, stash->info_ptr + start, - (bfd_vma) 0, size)) + if ((bfd_simple_get_relocated_section_contents + (abfd, msec, stash->info_ptr + start, symbols)) == NULL) continue; stash->info_ptr_end = stash->info_ptr + start + size; @@ -1953,25 +1779,10 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, stash->syms = symbols; } - /* 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; + return FALSE; /* Check the previously read comp. units first. */ for (each = stash->all_comp_units; each; each = each->next_unit) @@ -1984,29 +1795,37 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, while (stash->info_ptr < stash->info_ptr_end) { bfd_vma length; - boolean found; + bfd_boolean found; unsigned int offset_size = addr_size; - if (addr_size == 4) + length = read_4_bytes (abfd, stash->info_ptr); + /* A 0xffffff length is the DWARF3 way of indicating we use + 64-bit offsets, instead of 32-bit offsets. */ + if (length == 0xffffffff) { - length = read_4_bytes (abfd, stash->info_ptr); - if (length == 0xffffffff) - { - offset_size = 8; - length = read_8_bytes (abfd, stash->info_ptr + 4); - stash->info_ptr += 8; - } - else if (length == 0) - { - /* Handle (non-standard) 64-bit DWARF2 formats. */ - offset_size = 8; - length = read_4_bytes (abfd, stash->info_ptr + 4); - stash->info_ptr += 4; - } + offset_size = 8; + length = read_8_bytes (abfd, stash->info_ptr + 4); + stash->info_ptr += 12; + } + /* A zero length is the IRIX way of indicating 64-bit offsets, + mostly because the 64-bit length will generally fit in 32 + bits, and the endianness helps. */ + else if (length == 0) + { + offset_size = 8; + length = read_4_bytes (abfd, stash->info_ptr + 4); + stash->info_ptr += 8; + } + /* In the absence of the hints above, we assume addr_size-sized + offsets, for backward-compatibility with pre-DWARF3 64-bit + platforms. */ + else if (addr_size == 8) + { + length = read_8_bytes (abfd, stash->info_ptr); + stash->info_ptr += 8; } else - length = read_8_bytes (abfd, stash->info_ptr); - stash->info_ptr += addr_size; + stash->info_ptr += 4; if (length > 0) { @@ -2034,10 +1853,10 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, { if (comp_unit_contains_address (each, addr)) return comp_unit_find_nearest_line (each, addr, - filename_ptr, - functionname_ptr, - linenumber_ptr, - stash); + filename_ptr, + functionname_ptr, + linenumber_ptr, + stash); } else { @@ -2047,11 +1866,11 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, linenumber_ptr, stash); if (found) - return true; + return TRUE; } } } } - return false; + return FALSE; } diff --git a/contrib/binutils/bfd/ecoff.c b/contrib/binutils/bfd/ecoff.c index ed10850..cfc5ae1 100644 --- a/contrib/binutils/bfd/ecoff.c +++ b/contrib/binutils/bfd/ecoff.c @@ -1,6 +1,6 @@ /* Generic ECOFF (Extended-COFF) routines. - Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1990, 1991, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, + 2002, 2003 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -46,19 +46,32 @@ /* Prototypes for static functions. */ -static int ecoff_get_magic PARAMS ((bfd *)); -static long ecoff_sec_to_styp_flags PARAMS ((const char *, flagword)); -static boolean ecoff_slurp_symbolic_header PARAMS ((bfd *)); -static boolean ecoff_set_symbol_info PARAMS ((bfd *, SYMR *, asymbol *, int, int)); -static void ecoff_emit_aggregate PARAMS ((bfd *, FDR *, char *, RNDXR *, long, const char *)); -static char *ecoff_type_to_string PARAMS ((bfd *, FDR *, unsigned int)); -static boolean ecoff_slurp_reloc_table PARAMS ((bfd *, asection *, asymbol **)); -static int ecoff_sort_hdrs PARAMS ((const PTR, const PTR)); -static boolean ecoff_compute_section_file_positions PARAMS ((bfd *)); -static bfd_size_type ecoff_compute_reloc_file_positions PARAMS ((bfd *)); -static boolean ecoff_get_extr PARAMS ((asymbol *, EXTR *)); -static void ecoff_set_index PARAMS ((asymbol *, bfd_size_type)); -static unsigned int ecoff_armap_hash PARAMS ((const char *, unsigned int *, unsigned int, unsigned int)); +static int ecoff_get_magic + PARAMS ((bfd *)); +static long ecoff_sec_to_styp_flags + PARAMS ((const char *, flagword)); +static bfd_boolean ecoff_slurp_symbolic_header + PARAMS ((bfd *)); +static bfd_boolean ecoff_set_symbol_info + PARAMS ((bfd *, SYMR *, asymbol *, int, int)); +static void ecoff_emit_aggregate + PARAMS ((bfd *, FDR *, char *, RNDXR *, long, const char *)); +static char *ecoff_type_to_string + PARAMS ((bfd *, FDR *, unsigned int)); +static bfd_boolean ecoff_slurp_reloc_table + PARAMS ((bfd *, asection *, asymbol **)); +static int ecoff_sort_hdrs + PARAMS ((const PTR, const PTR)); +static bfd_boolean ecoff_compute_section_file_positions + PARAMS ((bfd *)); +static bfd_size_type ecoff_compute_reloc_file_positions + PARAMS ((bfd *)); +static bfd_boolean ecoff_get_extr + PARAMS ((asymbol *, EXTR *)); +static void ecoff_set_index + PARAMS ((asymbol *, bfd_size_type)); +static unsigned int ecoff_armap_hash + PARAMS ((const char *, unsigned int *, unsigned int, unsigned int)); /* This stuff is somewhat copied from coffcode.h. */ @@ -68,6 +81,12 @@ static asection bfd_debug_section = "*DEBUG*", 0, 0, NULL, 0, 0, 0, /* linker_mark, linker_has_input, gc_mark, segment_mark, */ 0, 0, 0, 0, + /* sec_info_type, use_rela_p, has_tls_reloc, */ + 0, 0, 0, + /* need_finalize_relax, has_gp_reloc, */ + 0, 0, + /* flag13, flag14, flag15, flag16, flag20, flag24, */ + 0, 0, 0, 0, 0, 0, /* vma, lma, _cooked_size, _raw_size, */ 0, 0, 0, 0, /* output_offset, output_section, alignment_power, */ @@ -76,21 +95,21 @@ static asection bfd_debug_section = NULL, NULL, 0, 0, 0, /* line_filepos, userdata, contents, lineno, lineno_count, */ 0, NULL, NULL, NULL, 0, - /* entsize, comdat, moving_line_filepos, */ - 0, NULL, 0, + /* entsize, comdat, kept_section, moving_line_filepos, */ + 0, NULL, NULL, 0, /* target_index, used_by_bfd, constructor_chain, owner, */ 0, NULL, NULL, NULL, /* symbol, */ - (struct symbol_cache_entry *) NULL, + (struct bfd_symbol *) NULL, /* symbol_ptr_ptr, */ - (struct symbol_cache_entry **) NULL, + (struct bfd_symbol **) NULL, /* link_order_head, link_order_tail */ NULL, NULL }; /* Create an ECOFF object. */ -boolean +bfd_boolean _bfd_ecoff_mkobject (abfd) bfd *abfd; { @@ -98,9 +117,9 @@ _bfd_ecoff_mkobject (abfd) abfd->tdata.ecoff_obj_data = (struct ecoff_tdata *) bfd_zalloc (abfd, amt); if (abfd->tdata.ecoff_obj_data == NULL) - return false; + return FALSE; - return true; + return TRUE; } /* This is a hook called by coff_real_object_p to create any backend @@ -151,7 +170,7 @@ _bfd_ecoff_mkobject_hook (abfd, filehdr, aouthdr) /* Initialize a new section. */ -boolean +bfd_boolean _bfd_ecoff_new_section_hook (abfd, section) bfd *abfd ATTRIBUTE_UNUSED; asection *section; @@ -182,7 +201,7 @@ _bfd_ecoff_new_section_hook (abfd, section) uncertain about .init on some systems and I don't know how shared libraries work. */ - return true; + return TRUE; } /* Determine the machine architecture and type. This is called from @@ -190,7 +209,7 @@ _bfd_ecoff_new_section_hook (abfd, section) below. This could be an ECOFF backend routine, with one version for each target, but there aren't all that many ECOFF targets. */ -boolean +bfd_boolean _bfd_ecoff_set_arch_mach_hook (abfd, filehdr) bfd *abfd; PTR filehdr; @@ -205,21 +224,21 @@ _bfd_ecoff_set_arch_mach_hook (abfd, filehdr) case MIPS_MAGIC_LITTLE: case MIPS_MAGIC_BIG: arch = bfd_arch_mips; - mach = 3000; + mach = bfd_mach_mips3000; break; case MIPS_MAGIC_LITTLE2: case MIPS_MAGIC_BIG2: /* MIPS ISA level 2: the r6000. */ arch = bfd_arch_mips; - mach = 6000; + mach = bfd_mach_mips6000; break; case MIPS_MAGIC_LITTLE3: case MIPS_MAGIC_BIG3: /* MIPS ISA level 3: the r4000. */ arch = bfd_arch_mips; - mach = 4000; + mach = bfd_mach_mips4000; break; case ALPHA_MAGIC: @@ -252,17 +271,17 @@ ecoff_get_magic (abfd) { default: case 0: - case 3000: + case bfd_mach_mips3000: big = MIPS_MAGIC_BIG; little = MIPS_MAGIC_LITTLE; break; - case 6000: + case bfd_mach_mips6000: big = MIPS_MAGIC_BIG2; little = MIPS_MAGIC_LITTLE2; break; - case 4000: + case bfd_mach_mips4000: big = MIPS_MAGIC_BIG3; little = MIPS_MAGIC_LITTLE3; break; @@ -360,7 +379,7 @@ ecoff_sec_to_styp_flags (name, flags) /* Get the BFD flags to use for a section. */ -boolean +bfd_boolean _bfd_ecoff_styp_to_sec_flags (abfd, hdr, name, section, flags_ptr) bfd *abfd ATTRIBUTE_UNUSED; PTR hdr; @@ -425,12 +444,12 @@ _bfd_ecoff_styp_to_sec_flags (abfd, hdr, name, section, flags_ptr) sec_flags |= SEC_ALLOC | SEC_LOAD; * flags_ptr = sec_flags; - return true; + return TRUE; } /* Read in the symbolic header for an ECOFF object file. */ -static boolean +static bfd_boolean ecoff_slurp_symbolic_header (abfd) bfd *abfd; { @@ -442,13 +461,13 @@ ecoff_slurp_symbolic_header (abfd) /* See if we've already read it in. */ if (ecoff_data (abfd)->debug_info.symbolic_header.magic == backend->debug_swap.sym_magic) - return true; + return TRUE; /* See whether there is a symbolic header. */ if (ecoff_data (abfd)->sym_filepos == 0) { bfd_get_symcount (abfd) = 0; - return true; + return TRUE; } /* At this point bfd_get_symcount (abfd) holds the number of symbols @@ -459,7 +478,7 @@ ecoff_slurp_symbolic_header (abfd) if (bfd_get_symcount (abfd) != external_hdr_size) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } /* Read the symbolic information header. */ @@ -485,18 +504,18 @@ ecoff_slurp_symbolic_header (abfd) if (raw != NULL) free (raw); - return true; + return TRUE; error_return: if (raw != NULL) free (raw); - return false; + return FALSE; } /* Read in and swap the important symbolic information for an ECOFF object file. This is called by gdb via the read_debug_info entry point in the backend structure. */ -boolean +bfd_boolean _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug) bfd *abfd; asection *ignore ATTRIBUTE_UNUSED; @@ -521,15 +540,15 @@ _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug) /* Check whether we've already gotten it, and whether there's any to get. */ if (ecoff_data (abfd)->raw_syments != (PTR) NULL) - return true; + return TRUE; if (ecoff_data (abfd)->sym_filepos == 0) { bfd_get_symcount (abfd) = 0; - return true; + return TRUE; } if (! ecoff_slurp_symbolic_header (abfd)) - return false; + return FALSE; internal_symhdr = &debug->symbolic_header; @@ -569,11 +588,11 @@ _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug) if (raw_size == 0) { ecoff_data (abfd)->sym_filepos = 0; - return true; + return TRUE; } raw = (PTR) bfd_alloc (abfd, raw_size); if (raw == NULL) - return false; + return FALSE; pos = ecoff_data (abfd)->sym_filepos; pos += backend->debug_swap.external_hdr_size; @@ -581,7 +600,7 @@ _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug) || bfd_bread (raw, raw_size, abfd) != raw_size) { bfd_release (abfd, raw); - return false; + return FALSE; } ecoff_data (abfd)->raw_syments = raw; @@ -620,7 +639,7 @@ _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug) amt *= sizeof (struct fdr); debug->fdr = (struct fdr *) bfd_alloc (abfd, amt); if (debug->fdr == NULL) - return false; + return FALSE; external_fdr_size = backend->debug_swap.external_fdr_size; fdr_ptr = debug->fdr; fraw_src = (char *) debug->external_fdr; @@ -628,7 +647,7 @@ _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug) for (; fraw_src < fraw_end; fraw_src += external_fdr_size, fdr_ptr++) (*backend->debug_swap.swap_fdr_in) (abfd, (PTR) fraw_src, fdr_ptr); - return true; + return TRUE; } /* ECOFF symbol table routines. The ECOFF symbol table is described @@ -657,7 +676,7 @@ _bfd_ecoff_make_empty_symbol (abfd) return (asymbol *) NULL; new->symbol.section = (asection *) NULL; new->fdr = (FDR *) NULL; - new->local = false; + new->local = FALSE; new->native = NULL; new->symbol.the_bfd = abfd; return &new->symbol; @@ -665,7 +684,7 @@ _bfd_ecoff_make_empty_symbol (abfd) /* Set the BFD flags and section for an ECOFF symbol. */ -static boolean +static bfd_boolean ecoff_set_symbol_info (abfd, ecoff_sym, asym, ext, weak) bfd *abfd; SYMR *ecoff_sym; @@ -691,12 +710,12 @@ ecoff_set_symbol_info (abfd, ecoff_sym, asym, ext, weak) if (ECOFF_IS_STAB (ecoff_sym)) { asym->flags = BSF_DEBUGGING; - return true; + return TRUE; } break; default: asym->flags = BSF_DEBUGGING; - return true; + return TRUE; } if (weak) @@ -877,7 +896,7 @@ ecoff_set_symbol_info (abfd, ecoff_sym, asym, ext, weak) amt = strlen (name) + 1; copy = (char *) bfd_alloc (abfd, amt); if (!copy) - return false; + return FALSE; strcpy (copy, name); section = bfd_make_section (abfd, copy); } @@ -886,7 +905,7 @@ ecoff_set_symbol_info (abfd, ecoff_sym, asym, ext, weak) amt = sizeof (arelent_chain); reloc_chain = (arelent_chain *) bfd_alloc (abfd, amt); if (!reloc_chain) - return false; + return FALSE; reloc_chain->relent.sym_ptr_ptr = bfd_get_section (asym)->symbol_ptr_ptr; reloc_chain->relent.address = section->_raw_size; @@ -919,12 +938,12 @@ ecoff_set_symbol_info (abfd, ecoff_sym, asym, ext, weak) break; } } - return true; + return TRUE; } /* Read an ECOFF symbol table. */ -boolean +bfd_boolean _bfd_ecoff_slurp_symbol_table (abfd) bfd *abfd; { @@ -947,20 +966,20 @@ _bfd_ecoff_slurp_symbol_table (abfd) /* If we've already read in the symbol table, do nothing. */ if (ecoff_data (abfd)->canonical_symbols != NULL) - return true; + return TRUE; /* Get the symbolic information. */ if (! _bfd_ecoff_slurp_symbolic_info (abfd, (asection *) NULL, &ecoff_data (abfd)->debug_info)) - return false; + return FALSE; if (bfd_get_symcount (abfd) == 0) - return true; + return TRUE; internal_size = bfd_get_symcount (abfd); internal_size *= sizeof (ecoff_symbol_type); internal = (ecoff_symbol_type *) bfd_alloc (abfd, internal_size); if (internal == NULL) - return false; + return FALSE; internal_ptr = internal; eraw_src = (char *) ecoff_data (abfd)->debug_info.external_ext; @@ -977,14 +996,14 @@ _bfd_ecoff_slurp_symbol_table (abfd) if (!ecoff_set_symbol_info (abfd, &internal_esym.asym, &internal_ptr->symbol, 1, internal_esym.weakext)) - return false; + return FALSE; /* The alpha uses a negative ifd field for section symbols. */ if (internal_esym.ifd >= 0) internal_ptr->fdr = (ecoff_data (abfd)->debug_info.fdr + internal_esym.ifd); else internal_ptr->fdr = NULL; - internal_ptr->local = false; + internal_ptr->local = FALSE; internal_ptr->native = (PTR) eraw_src; } @@ -1012,16 +1031,16 @@ _bfd_ecoff_slurp_symbol_table (abfd) + internal_sym.iss); if (!ecoff_set_symbol_info (abfd, &internal_sym, &internal_ptr->symbol, 0, 0)) - return false; + return FALSE; internal_ptr->fdr = fdr_ptr; - internal_ptr->local = true; + internal_ptr->local = TRUE; internal_ptr->native = (PTR) lraw_src; } } ecoff_data (abfd)->canonical_symbols = internal; - return true; + return TRUE; } /* Return the amount of space needed for the canonical symbols. */ @@ -1043,7 +1062,7 @@ _bfd_ecoff_get_symtab_upper_bound (abfd) /* Get the canonical symbols. */ long -_bfd_ecoff_get_symtab (abfd, alocation) +_bfd_ecoff_canonicalize_symtab (abfd, alocation) bfd *abfd; asymbol **alocation; { @@ -1443,7 +1462,7 @@ _bfd_ecoff_get_symbol_info (abfd, symbol, ret) /* Return whether this is a local label. */ -boolean +bfd_boolean _bfd_ecoff_bfd_is_local_label_name (abfd, name) bfd *abfd ATTRIBUTE_UNUSED; const char *name; @@ -1642,7 +1661,7 @@ _bfd_ecoff_print_symbol (abfd, filep, symbol, how) /* Read in the relocs for a section. */ -static boolean +static bfd_boolean ecoff_slurp_reloc_table (abfd, section, symbols) bfd *abfd; asection *section; @@ -1659,10 +1678,10 @@ ecoff_slurp_reloc_table (abfd, section, symbols) if (section->relocation != (arelent *) NULL || section->reloc_count == 0 || (section->flags & SEC_CONSTRUCTOR) != 0) - return true; + return TRUE; if (! _bfd_ecoff_slurp_symbol_table (abfd)) - return false; + return FALSE; amt = section->reloc_count; amt *= sizeof (arelent); @@ -1673,11 +1692,11 @@ ecoff_slurp_reloc_table (abfd, section, symbols) external_relocs = (char *) bfd_alloc (abfd, amt); if (internal_relocs == (arelent *) NULL || external_relocs == (char *) NULL) - return false; + return FALSE; if (bfd_seek (abfd, section->rel_filepos, SEEK_SET) != 0) - return false; + return FALSE; if (bfd_bread (external_relocs, amt, abfd) != amt) - return false; + return FALSE; for (i = 0, rptr = internal_relocs; i < section->reloc_count; i++, rptr++) { @@ -1747,7 +1766,7 @@ ecoff_slurp_reloc_table (abfd, section, symbols) section->relocation = internal_relocs; - return true; + return TRUE; } /* Get a canonical list of relocs. */ @@ -1795,7 +1814,7 @@ _bfd_ecoff_canonicalize_reloc (abfd, section, relptr, symbols) and return the name of the source file and the line nearest to the wanted location. */ -boolean +bfd_boolean _bfd_ecoff_find_nearest_line (abfd, section, ignore_symbols, offset, filename_ptr, functionname_ptr, retline_ptr) bfd *abfd; @@ -1814,7 +1833,7 @@ _bfd_ecoff_find_nearest_line (abfd, section, ignore_symbols, offset, /* Make sure we have the FDR's. */ if (! _bfd_ecoff_slurp_symbolic_info (abfd, (asection *) NULL, debug_info) || bfd_get_symcount (abfd) == 0) - return false; + return FALSE; if (ecoff_data (abfd)->find_line_info == NULL) { @@ -1822,7 +1841,7 @@ _bfd_ecoff_find_nearest_line (abfd, section, ignore_symbols, offset, ecoff_data (abfd)->find_line_info = (struct ecoff_find_line *) bfd_zalloc (abfd, amt); if (ecoff_data (abfd)->find_line_info == NULL) - return false; + return FALSE; } line_info = ecoff_data (abfd)->find_line_info; @@ -1844,7 +1863,7 @@ _bfd_ecoff_find_nearest_line (abfd, section, ignore_symbols, offset, the symbol table, so this function only handles the other debugging information. */ -boolean +bfd_boolean _bfd_ecoff_bfd_copy_private_bfd_data (ibfd, obfd) bfd *ibfd; bfd *obfd; @@ -1854,13 +1873,13 @@ _bfd_ecoff_bfd_copy_private_bfd_data (ibfd, obfd) register int i; asymbol **sym_ptr_ptr; size_t c; - boolean local; + bfd_boolean local; /* We only want to copy information over if both BFD's use ECOFF format. */ if (bfd_get_flavour (ibfd) != bfd_target_ecoff_flavour || bfd_get_flavour (obfd) != bfd_target_ecoff_flavour) - return true; + return TRUE; /* Copy the GP value and the register masks. */ ecoff_data (obfd)->gp = ecoff_data (ibfd)->gp; @@ -1876,15 +1895,15 @@ _bfd_ecoff_bfd_copy_private_bfd_data (ibfd, obfd) c = bfd_get_symcount (obfd); sym_ptr_ptr = bfd_get_outsymbols (obfd); if (c == 0 || sym_ptr_ptr == (asymbol **) NULL) - return true; + return TRUE; /* See if there are any local symbols. */ - local = false; + local = FALSE; for (; c > 0; c--, sym_ptr_ptr++) { if (ecoffsymbol (*sym_ptr_ptr)->local) { - local = true; + local = TRUE; break; } } @@ -1947,14 +1966,14 @@ _bfd_ecoff_bfd_copy_private_bfd_data (ibfd, obfd) } } - return true; + return TRUE; } /* Set the architecture. The supported architecture is stored in the backend pointer. We always set the architecture anyhow, since many callers ignore the return value. */ -boolean +bfd_boolean _bfd_ecoff_set_arch_mach (abfd, arch, machine) bfd *abfd; enum bfd_architecture arch; @@ -1969,7 +1988,7 @@ _bfd_ecoff_set_arch_mach (abfd, arch, machine) int _bfd_ecoff_sizeof_headers (abfd, reloc) bfd *abfd; - boolean reloc ATTRIBUTE_UNUSED; + bfd_boolean reloc ATTRIBUTE_UNUSED; { asection *current; int c; @@ -1989,7 +2008,7 @@ _bfd_ecoff_sizeof_headers (abfd, reloc) /* Get the contents of a section. */ -boolean +bfd_boolean _bfd_ecoff_get_section_contents (abfd, section, location, offset, count) bfd *abfd; asection *section; @@ -2033,7 +2052,7 @@ ecoff_sort_hdrs (arg1, arg2) /* Calculate the file position for each section, and set reloc_filepos. */ -static boolean +static bfd_boolean ecoff_compute_section_file_positions (abfd) bfd *abfd; { @@ -2042,12 +2061,12 @@ ecoff_compute_section_file_positions (abfd) asection *current; unsigned int i; file_ptr old_sofar; - boolean rdata_in_text; - boolean first_data, first_nonalloc; + bfd_boolean rdata_in_text; + bfd_boolean first_data, first_nonalloc; const bfd_vma round = ecoff_backend (abfd)->round; bfd_size_type amt; - sofar = _bfd_ecoff_sizeof_headers (abfd, false); + sofar = _bfd_ecoff_sizeof_headers (abfd, FALSE); file_sofar = sofar; /* Sort the sections by VMA. */ @@ -2055,7 +2074,7 @@ ecoff_compute_section_file_positions (abfd) amt *= sizeof (asection *); sorted_hdrs = (asection **) bfd_malloc (amt); if (sorted_hdrs == NULL) - return false; + return FALSE; for (current = abfd->sections, i = 0; current != NULL; current = current->next, i++) @@ -2079,15 +2098,15 @@ ecoff_compute_section_file_positions (abfd) && strcmp (current->name, _PDATA) != 0 && strcmp (current->name, _RCONST) != 0) { - rdata_in_text = false; + rdata_in_text = FALSE; break; } } } ecoff_data (abfd)->rdata_in_text = rdata_in_text; - first_data = true; - first_nonalloc = true; + first_data = TRUE; + first_nonalloc = TRUE; for (i = 0; i < abfd->section_count; i++) { unsigned int alignment_power; @@ -2120,7 +2139,7 @@ ecoff_compute_section_file_positions (abfd) { sofar = (sofar + round - 1) &~ (round - 1); file_sofar = (file_sofar + round - 1) &~ (round - 1); - first_data = false; + first_data = FALSE; } else if (strcmp (current->name, _LIB) == 0) { @@ -2138,7 +2157,7 @@ ecoff_compute_section_file_positions (abfd) /* Skip up to the next page for an unallocated section, such as the .comment section on the Alpha. This leaves room for the .bss section. */ - first_nonalloc = false; + first_nonalloc = FALSE; sofar = (sofar + round - 1) &~ (round - 1); file_sofar = (file_sofar + round - 1) &~ (round - 1); } @@ -2177,7 +2196,7 @@ ecoff_compute_section_file_positions (abfd) ecoff_data (abfd)->reloc_filepos = file_sofar; - return true; + return TRUE; } /* Determine the location of the relocs for all the sections in the @@ -2199,7 +2218,7 @@ ecoff_compute_reloc_file_positions (abfd) { if (! ecoff_compute_section_file_positions (abfd)) abort (); - abfd->output_has_begun = true; + abfd->output_has_begun = TRUE; } reloc_base = ecoff_data (abfd)->reloc_filepos; @@ -2239,22 +2258,22 @@ ecoff_compute_reloc_file_positions (abfd) /* Set the contents of a section. */ -boolean +bfd_boolean _bfd_ecoff_set_section_contents (abfd, section, location, offset, count) bfd *abfd; asection *section; - PTR location; + const PTR location; file_ptr offset; bfd_size_type count; { file_ptr pos; /* This must be done first, because bfd_set_section_contents is - going to set output_has_begun to true. */ + going to set output_has_begun to TRUE. */ if (! abfd->output_has_begun) { if (! ecoff_compute_section_file_positions (abfd)) - return false; + return FALSE; } /* Handle the .lib section specially so that Irix 4 shared libraries @@ -2275,14 +2294,14 @@ _bfd_ecoff_set_section_contents (abfd, section, location, offset, count) } if (count == 0) - return true; + return TRUE; pos = section->filepos + offset; if (bfd_seek (abfd, pos, SEEK_SET) != 0 || bfd_bwrite (location, count, abfd) != count) - return false; + return FALSE; - return true; + return TRUE; } /* Get the GP value for an ECOFF file. This is a hook used by @@ -2305,7 +2324,7 @@ bfd_ecoff_get_gp_value (abfd) /* Set the GP value for an ECOFF file. This is a hook used by the assembler. */ -boolean +bfd_boolean bfd_ecoff_set_gp_value (abfd, gp_value) bfd *abfd; bfd_vma gp_value; @@ -2314,18 +2333,18 @@ bfd_ecoff_set_gp_value (abfd, gp_value) || bfd_get_format (abfd) != bfd_object) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } ecoff_data (abfd)->gp = gp_value; - return true; + return TRUE; } /* Set the register masks for an ECOFF file. This is a hook used by the assembler. */ -boolean +bfd_boolean bfd_ecoff_set_regmasks (abfd, gprmask, fprmask, cprmask) bfd *abfd; unsigned long gprmask; @@ -2338,7 +2357,7 @@ bfd_ecoff_set_regmasks (abfd, gprmask, fprmask, cprmask) || bfd_get_format (abfd) != bfd_object) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } tdata = ecoff_data (abfd); @@ -2352,13 +2371,13 @@ bfd_ecoff_set_regmasks (abfd, gprmask, fprmask, cprmask) tdata->cprmask[i] = cprmask[i]; } - return true; + return TRUE; } /* Get ECOFF EXTR information for an external symbol. This function is passed to bfd_ecoff_debug_externals. */ -static boolean +static bfd_boolean ecoff_get_extr (sym, esym) asymbol *sym; EXTR *esym; @@ -2373,7 +2392,7 @@ ecoff_get_extr (sym, esym) if ((sym->flags & BSF_DEBUGGING) != 0 || (sym->flags & BSF_LOCAL) != 0 || (sym->flags & BSF_SECTION_SYM) != 0) - return false; + return FALSE; esym->jmptbl = 0; esym->cobol_main = 0; @@ -2385,13 +2404,13 @@ ecoff_get_extr (sym, esym) esym->asym.sc = scAbs; esym->asym.reserved = 0; esym->asym.index = indexNil; - return true; + return TRUE; } ecoff_sym_ptr = ecoffsymbol (sym); if (ecoff_sym_ptr->local) - return false; + return FALSE; input_bfd = bfd_asymbol_bfd (sym); (*(ecoff_backend (input_bfd)->debug_swap.swap_ext_in)) @@ -2417,7 +2436,7 @@ ecoff_get_extr (sym, esym) esym->ifd = input_debug->ifdmap[esym->ifd]; } - return true; + return TRUE; } /* Set the external symbol index. This routine is passed to @@ -2433,7 +2452,7 @@ ecoff_set_index (sym, indx) /* Write out an ECOFF file. */ -boolean +bfd_boolean _bfd_ecoff_write_object_contents (abfd) bfd *abfd; { @@ -2445,13 +2464,11 @@ _bfd_ecoff_write_object_contents (abfd) const bfd_size_type external_hdr_size = backend->debug_swap.external_hdr_size; const bfd_size_type external_reloc_size = backend->external_reloc_size; - void (* const adjust_reloc_out) PARAMS ((bfd *, - const arelent *, - struct internal_reloc *)) + void (* const adjust_reloc_out) + PARAMS ((bfd *, const arelent *, struct internal_reloc *)) = backend->adjust_reloc_out; - void (* const swap_reloc_out) PARAMS ((bfd *, - const struct internal_reloc *, - PTR)) + void (* const swap_reloc_out) + PARAMS ((bfd *, const struct internal_reloc *, PTR)) = backend->swap_reloc_out; struct ecoff_debug_info * const debug = &ecoff_data (abfd)->debug_info; HDRR * const symhdr = &debug->symbolic_header; @@ -2460,10 +2477,10 @@ _bfd_ecoff_write_object_contents (abfd) bfd_size_type reloc_size; bfd_size_type text_size; bfd_vma text_start; - boolean set_text_start; + bfd_boolean set_text_start; bfd_size_type data_size; bfd_vma data_start; - boolean set_data_start; + bfd_boolean set_data_start; bfd_size_type bss_size; PTR buff = NULL; PTR reloc_buff = NULL; @@ -2485,14 +2502,14 @@ _bfd_ecoff_write_object_contents (abfd) } if ((abfd->flags & D_PAGED) != 0) - text_size = _bfd_ecoff_sizeof_headers (abfd, false); + text_size = _bfd_ecoff_sizeof_headers (abfd, FALSE); else text_size = 0; text_start = 0; - set_text_start = false; + set_text_start = FALSE; data_size = 0; data_start = 0; - set_data_start = false; + set_data_start = FALSE; bss_size = 0; /* Write section headers to the file. */ @@ -2588,7 +2605,7 @@ _bfd_ecoff_write_object_contents (abfd) if (! set_text_start || text_start > vma) { text_start = vma; - set_text_start = true; + set_text_start = TRUE; } } else if ((section.s_flags & STYP_RDATA) != 0 @@ -2604,7 +2621,7 @@ _bfd_ecoff_write_object_contents (abfd) if (! set_data_start || data_start > vma) { data_start = vma; - set_data_start = true; + set_data_start = TRUE; } } else if ((section.s_flags & STYP_BSS) != 0 @@ -2870,13 +2887,13 @@ _bfd_ecoff_write_object_contents (abfd) bfd_release (abfd, reloc_buff); if (buff != NULL) free (buff); - return true; + return TRUE; error_return: if (reloc_buff != NULL) bfd_release (abfd, reloc_buff); if (buff != NULL) free (buff); - return false; + return FALSE; } /* Archive handling. ECOFF uses what appears to be a unique type of @@ -2949,7 +2966,7 @@ ecoff_armap_hash (s, rehash, size, hlog) /* Read in the armap. */ -boolean +bfd_boolean _bfd_ecoff_slurp_armap (abfd) bfd *abfd; { @@ -2968,12 +2985,12 @@ _bfd_ecoff_slurp_armap (abfd) /* Get the name of the first element. */ i = bfd_bread ((PTR) nextname, (bfd_size_type) 16, abfd); if (i == 0) - return true; + return TRUE; if (i != 16) - return false; + return FALSE; if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0) - return false; + return FALSE; /* Irix 4.0.5F apparently can use either an ECOFF armap or a standard COFF armap. We could move the ECOFF armap stuff into @@ -2995,8 +3012,8 @@ _bfd_ecoff_slurp_armap (abfd) || strncmp (nextname + ARMAP_END_INDEX, ARMAP_END, sizeof ARMAP_END - 1) != 0) { - bfd_has_map (abfd) = false; - return true; + bfd_has_map (abfd) = FALSE; + return TRUE; } /* Make sure we have the right byte ordering. */ @@ -3006,27 +3023,27 @@ _bfd_ecoff_slurp_armap (abfd) ^ (bfd_big_endian (abfd)))) { bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; } /* Read in the armap. */ ardata = bfd_ardata (abfd); mapdata = (struct areltdata *) _bfd_read_ar_hdr (abfd); if (mapdata == (struct areltdata *) NULL) - return false; + 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; + return FALSE; if (bfd_bread ((PTR) raw_armap, parsed_size, abfd) != parsed_size) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_malformed_archive); bfd_release (abfd, (PTR) raw_armap); - return false; + return FALSE; } ardata->tdata = (PTR) raw_armap; @@ -3086,7 +3103,7 @@ _bfd_ecoff_slurp_armap (abfd) amt *= sizeof (struct symdef); symdef_ptr = (struct symdef *) bfd_alloc (abfd, amt); if (!symdef_ptr) - return false; + return FALSE; ardata->symdefs = (carsym *) symdef_ptr; @@ -3108,14 +3125,14 @@ _bfd_ecoff_slurp_armap (abfd) /* Pad to an even boundary. */ ardata->first_file_filepos += ardata->first_file_filepos % 2; - bfd_has_map (abfd) = true; + bfd_has_map (abfd) = TRUE; - return true; + return TRUE; } /* Write out an armap. */ -boolean +bfd_boolean _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) bfd *abfd; unsigned int elength; @@ -3199,15 +3216,15 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) if (bfd_bwrite ((PTR) &hdr, (bfd_size_type) sizeof (struct ar_hdr), abfd) != sizeof (struct ar_hdr)) - return false; + return FALSE; H_PUT_32 (abfd, hashsize, temp); if (bfd_bwrite ((PTR) temp, (bfd_size_type) 4, abfd) != 4) - return false; + return FALSE; hashtable = (bfd_byte *) bfd_zalloc (abfd, symdefsize); if (!hashtable) - return false; + return FALSE; current = abfd->archive_head; last_elt = current; @@ -3252,21 +3269,21 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) } if (bfd_bwrite ((PTR) hashtable, symdefsize, abfd) != symdefsize) - return false; + return FALSE; bfd_release (abfd, hashtable); /* Now write the strings. */ H_PUT_32 (abfd, stringsize, temp); if (bfd_bwrite ((PTR) temp, (bfd_size_type) 4, abfd) != 4) - return false; + return FALSE; for (i = 0; i < orl_count; i++) { bfd_size_type len; len = strlen (*map[i].name) + 1; if (bfd_bwrite ((PTR) (*map[i].name), len, abfd) != len) - return false; + return FALSE; } /* The spec sez this should be a newline. But in order to be @@ -3274,10 +3291,10 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) if (padit) { if (bfd_bwrite ("", (bfd_size_type) 1, abfd) != 1) - return false; + return FALSE; } - return true; + return TRUE; } /* See whether this BFD is an archive. If it is, read in the armap @@ -3343,7 +3360,7 @@ _bfd_ecoff_archive_p (abfd) first = bfd_openr_next_archived_file (abfd, (bfd *) NULL); if (first != NULL) { - first->target_defaulted = false; + first->target_defaulted = FALSE; if (bfd_check_format (first, bfd_object) && first->xvec != abfd->xvec) { @@ -3372,13 +3389,13 @@ static struct bfd_hash_entry *ecoff_link_hash_newfunc PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table, const char *string)); -static boolean ecoff_link_add_archive_symbols +static bfd_boolean ecoff_link_add_archive_symbols PARAMS ((bfd *, struct bfd_link_info *)); -static boolean ecoff_link_check_archive_element - PARAMS ((bfd *, struct bfd_link_info *, boolean *pneeded)); -static boolean ecoff_link_add_object_symbols +static bfd_boolean ecoff_link_check_archive_element + PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *pneeded)); +static bfd_boolean ecoff_link_add_object_symbols PARAMS ((bfd *, struct bfd_link_info *)); -static boolean ecoff_link_add_externals +static bfd_boolean ecoff_link_add_externals PARAMS ((bfd *, struct bfd_link_info *, PTR, char *)); /* Routine to create an entry in an ECOFF link hash table. */ @@ -3449,7 +3466,7 @@ _bfd_ecoff_bfd_link_hash_table_create (abfd) #define ecoff_link_hash_traverse(table, func, info) \ (bfd_link_hash_traverse \ (&(table)->root, \ - (boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \ (info))) /* Get the ECOFF link hash table from the info structure. This is @@ -3460,7 +3477,7 @@ _bfd_ecoff_bfd_link_hash_table_create (abfd) /* Given an ECOFF BFD, add symbols to the global hash table as appropriate. */ -boolean +bfd_boolean _bfd_ecoff_bfd_link_add_symbols (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -3473,7 +3490,7 @@ _bfd_ecoff_bfd_link_add_symbols (abfd, info) return ecoff_link_add_archive_symbols (abfd, info); default: bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; } } @@ -3484,7 +3501,7 @@ _bfd_ecoff_bfd_link_add_symbols (abfd, info) already have a hash table, so there is no reason to construct another one. */ -static boolean +static bfd_boolean ecoff_link_add_archive_symbols (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -3502,9 +3519,9 @@ ecoff_link_add_archive_symbols (abfd, info) { /* An empty archive is a special case. */ if (bfd_openr_next_archived_file (abfd, (bfd *) NULL) == NULL) - return true; + return TRUE; bfd_set_error (bfd_error_no_armap); - return false; + return FALSE; } /* If we don't have any raw data for this archive, as can happen on @@ -3549,9 +3566,9 @@ ecoff_link_add_archive_symbols (abfd, info) entry if it is the tail, because that would lose any entries we add to the list later on. */ if (*pundef != info->hash->undefs_tail) - *pundef = (*pundef)->next; + *pundef = (*pundef)->und_next; else - pundef = &(*pundef)->next; + pundef = &(*pundef)->und_next; continue; } @@ -3561,7 +3578,7 @@ ecoff_link_add_archive_symbols (abfd, info) other object format. */ if (h->type != bfd_link_hash_undefined) { - pundef = &(*pundef)->next; + pundef = &(*pundef)->und_next; continue; } @@ -3573,7 +3590,7 @@ ecoff_link_add_archive_symbols (abfd, info) if (file_offset == 0) { /* Nothing in this slot. */ - pundef = &(*pundef)->next; + pundef = &(*pundef)->und_next; continue; } @@ -3582,10 +3599,10 @@ ecoff_link_add_archive_symbols (abfd, info) || strcmp (name, h->root.string) != 0) { unsigned int srch; - boolean found; + bfd_boolean found; /* That was the wrong symbol. Try rehashing. */ - found = false; + found = FALSE; for (srch = (hash + rehash) & (armap_count - 1); srch != hash; srch = (srch + rehash) & (armap_count - 1)) @@ -3597,14 +3614,14 @@ ecoff_link_add_archive_symbols (abfd, info) if (name[0] == h->root.string[0] && strcmp (name, h->root.string) == 0) { - found = true; + found = TRUE; break; } } if (! found) { - pundef = &(*pundef)->next; + pundef = &(*pundef)->und_next; continue; } @@ -3613,33 +3630,33 @@ ecoff_link_add_archive_symbols (abfd, info) element = (*backend->get_elt_at_filepos) (abfd, (file_ptr) file_offset); if (element == (bfd *) NULL) - return false; + return FALSE; if (! bfd_check_format (element, bfd_object)) - return false; + return FALSE; /* Unlike the generic linker, we know that this element provides a definition for an undefined symbol and we know that we want to include it. We don't need to check anything. */ if (! (*info->callbacks->add_archive_element) (info, element, name)) - return false; + return FALSE; if (! ecoff_link_add_object_symbols (element, info)) - return false; + return FALSE; - pundef = &(*pundef)->next; + pundef = &(*pundef)->und_next; } - return true; + return TRUE; } /* This is called if we used _bfd_generic_link_add_archive_symbols because we were not dealing with an ECOFF archive. */ -static boolean +static bfd_boolean ecoff_link_check_archive_element (abfd, info, pneeded) bfd *abfd; struct bfd_link_info *info; - boolean *pneeded; + bfd_boolean *pneeded; { const struct ecoff_backend_data * const backend = ecoff_backend (abfd); void (* const swap_ext_in) PARAMS ((bfd *, PTR, EXTR *)) @@ -3652,7 +3669,7 @@ ecoff_link_check_archive_element (abfd, info, pneeded) char *ext_ptr; char *ext_end; - *pneeded = false; + *pneeded = FALSE; if (! ecoff_slurp_symbolic_header (abfd)) goto error_return; @@ -3690,7 +3707,7 @@ ecoff_link_check_archive_element (abfd, info, pneeded) for (; ext_ptr < ext_end; ext_ptr += external_ext_size) { EXTR esym; - boolean def; + bfd_boolean def; const char *name; struct bfd_link_hash_entry *h; @@ -3716,10 +3733,10 @@ ecoff_link_check_archive_element (abfd, info, pneeded) case scInit: case scFini: case scRConst: - def = true; + def = TRUE; break; default: - def = false; + def = FALSE; break; } @@ -3727,7 +3744,7 @@ ecoff_link_check_archive_element (abfd, info, pneeded) continue; name = ssext + esym.asym.iss; - h = bfd_link_hash_lookup (info->hash, name, false, false, true); + h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE); /* Unlike the generic linker, we do not pull in elements because of common symbols. */ @@ -3741,7 +3758,7 @@ ecoff_link_check_archive_element (abfd, info, pneeded) if (! ecoff_link_add_externals (abfd, info, external_ext, ssext)) goto error_return; - *pneeded = true; + *pneeded = TRUE; goto successful_return; } @@ -3750,19 +3767,19 @@ ecoff_link_check_archive_element (abfd, info, pneeded) free (external_ext); if (ssext != NULL) free (ssext); - return true; + return TRUE; error_return: if (external_ext != NULL) free (external_ext); if (ssext != NULL) free (ssext); - return false; + return FALSE; } /* Add symbols from an ECOFF object file to the global linker hash table. */ -static boolean +static bfd_boolean ecoff_link_add_object_symbols (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -3772,14 +3789,14 @@ ecoff_link_add_object_symbols (abfd, info) PTR external_ext = NULL; bfd_size_type esize; char *ssext = NULL; - boolean result; + bfd_boolean result; if (! ecoff_slurp_symbolic_header (abfd)) - return false; + return FALSE; /* If there are no symbols, we don't want it. */ if (bfd_get_symcount (abfd) == 0) - return true; + return TRUE; symhdr = &ecoff_data (abfd)->debug_info.symbolic_header; @@ -3816,7 +3833,7 @@ ecoff_link_add_object_symbols (abfd, info) free (ssext); if (external_ext != NULL) free (external_ext); - return false; + return FALSE; } /* Add the external symbols of an object file to the global linker @@ -3825,7 +3842,7 @@ ecoff_link_add_object_symbols (abfd, info) explicitly save any information we may need later on in the link. We do not want to read the external symbol information again. */ -static boolean +static bfd_boolean ecoff_link_add_externals (abfd, info, external_ext, ssext) bfd *abfd; struct bfd_link_info *info; @@ -3848,7 +3865,7 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext) amt *= sizeof (struct bfd_link_hash_entry *); sym_hash = (struct bfd_link_hash_entry **) bfd_alloc (abfd, amt); if (!sym_hash) - return false; + return FALSE; ecoff_data (abfd)->sym_hashes = (struct ecoff_link_hash_entry **) sym_hash; ext_ptr = (char *) external_ext; @@ -3856,7 +3873,7 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext) for (; ext_ptr < ext_end; ext_ptr += external_ext_size, sym_hash++) { EXTR esym; - boolean skip; + bfd_boolean skip; bfd_vma value; asection *section; const char *name; @@ -3867,7 +3884,7 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext) (*swap_ext_in) (abfd, (PTR) ext_ptr, &esym); /* Skip debugging symbols. */ - skip = false; + skip = FALSE; switch (esym.asym.st) { case stGlobal: @@ -3877,7 +3894,7 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext) case stStaticProc: break; default: - skip = true; + skip = TRUE; break; } @@ -3983,8 +4000,8 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext) if (! (_bfd_generic_link_add_one_symbol (info, abfd, name, (flagword) (esym.weakext ? BSF_WEAK : BSF_GLOBAL), - section, value, (const char *) NULL, true, true, sym_hash))) - return false; + section, value, (const char *) NULL, TRUE, TRUE, sym_hash))) + return FALSE; h = (struct ecoff_link_hash_entry *) *sym_hash; @@ -4024,20 +4041,20 @@ ecoff_link_add_externals (abfd, info, external_ext, ssext) } } - return true; + return TRUE; } /* ECOFF final link routines. */ -static boolean ecoff_final_link_debug_accumulate +static bfd_boolean ecoff_final_link_debug_accumulate PARAMS ((bfd *output_bfd, bfd *input_bfd, struct bfd_link_info *, PTR handle)); -static boolean ecoff_link_write_external +static bfd_boolean ecoff_link_write_external PARAMS ((struct ecoff_link_hash_entry *, PTR)); -static boolean ecoff_indirect_link_order +static bfd_boolean ecoff_indirect_link_order PARAMS ((bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *)); -static boolean ecoff_reloc_link_order +static bfd_boolean ecoff_reloc_link_order PARAMS ((bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *)); @@ -4054,7 +4071,7 @@ struct extsym_info processes all the link order information. This may cause it to close and reopen some input BFDs; I'll see how bad this is. */ -boolean +bfd_boolean _bfd_ecoff_bfd_final_link (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -4101,18 +4118,18 @@ _bfd_ecoff_bfd_final_link (abfd, info) handle = bfd_ecoff_debug_init (abfd, debug, &backend->debug_swap, info); if (handle == (PTR) NULL) - return false; + return FALSE; /* Accumulate the debugging symbols from each input BFD. */ for (input_bfd = info->input_bfds; input_bfd != (bfd *) NULL; input_bfd = input_bfd->link_next) { - boolean ret; + bfd_boolean ret; if (bfd_get_flavour (input_bfd) == bfd_target_ecoff_flavour) { - /* Abitrarily set the symbolic header vstamp to the vstamp + /* Arbitrarily set the symbolic header vstamp to the vstamp of the first object file in the link. */ if (symhdr->vstamp == 0) symhdr->vstamp @@ -4125,7 +4142,7 @@ _bfd_ecoff_bfd_final_link (abfd, info) debug, &backend->debug_swap, input_bfd, info); if (! ret) - return false; + return FALSE; /* Combine the register masks. */ ecoff_data (abfd)->gprmask |= ecoff_data (input_bfd)->gprmask; @@ -4143,7 +4160,7 @@ _bfd_ecoff_bfd_final_link (abfd, info) ecoff_link_write_external, (PTR) &einfo); - if (info->relocateable) + if (info->relocatable) { /* We need to make a pass over the link_orders to count up the number of relocations we will need to output, so that we know @@ -4169,11 +4186,11 @@ _bfd_ecoff_bfd_final_link (abfd, info) if (! bfd_ecoff_write_accumulated_debug (handle, abfd, debug, &backend->debug_swap, info, ecoff_data (abfd)->sym_filepos)) - return false; + return FALSE; bfd_ecoff_debug_free (handle, abfd, debug, &backend->debug_swap, info); - if (info->relocateable) + if (info->relocatable) { /* Now reset the reloc_count field of the sections in the output BFD to 0, so that we can use them to keep track of how many @@ -4187,13 +4204,13 @@ _bfd_ecoff_bfd_final_link (abfd, info) { struct bfd_link_hash_entry *h; - h = bfd_link_hash_lookup (info->hash, "_gp", false, false, true); + h = bfd_link_hash_lookup (info->hash, "_gp", FALSE, FALSE, TRUE); if (h != (struct bfd_link_hash_entry *) NULL && h->type == bfd_link_hash_defined) ecoff_data (abfd)->gp = (h->u.def.value + h->u.def.section->output_section->vma + h->u.def.section->output_offset); - else if (info->relocateable) + else if (info->relocatable) { bfd_vma lo; @@ -4230,34 +4247,34 @@ _bfd_ecoff_bfd_final_link (abfd, info) == bfd_target_ecoff_flavour)) { if (! ecoff_indirect_link_order (abfd, info, o, p)) - return false; + return FALSE; } else if (p->type == bfd_section_reloc_link_order || p->type == bfd_symbol_reloc_link_order) { if (! ecoff_reloc_link_order (abfd, info, o, p)) - return false; + return FALSE; } else { if (! _bfd_default_link_order (abfd, info, o, p)) - return false; + return FALSE; } } } bfd_get_symcount (abfd) = symhdr->iextMax + symhdr->isymMax; - ecoff_data (abfd)->linker = true; + ecoff_data (abfd)->linker = TRUE; - return true; + return TRUE; } /* Accumulate the debugging information for an input BFD into the output BFD. This must read in the symbolic information of the input BFD. */ -static boolean +static bfd_boolean ecoff_final_link_debug_accumulate (output_bfd, input_bfd, info, handle) bfd *output_bfd; bfd *input_bfd; @@ -4268,7 +4285,7 @@ ecoff_final_link_debug_accumulate (output_bfd, input_bfd, info, handle) const struct ecoff_debug_swap * const swap = &ecoff_backend (input_bfd)->debug_swap; HDRR *symhdr = &debug->symbolic_header; - boolean ret; + bfd_boolean ret; #define READ(ptr, offset, count, size, type) \ if (symhdr->count == 0) \ @@ -4279,13 +4296,13 @@ ecoff_final_link_debug_accumulate (output_bfd, input_bfd, info, handle) debug->ptr = (type) bfd_malloc (amt); \ if (debug->ptr == NULL) \ { \ - ret = false; \ + ret = FALSE; \ goto return_something; \ } \ if (bfd_seek (input_bfd, (file_ptr) symhdr->offset, SEEK_SET) != 0 \ || bfd_bread (debug->ptr, amt, input_bfd) != amt) \ { \ - ret = false; \ + ret = FALSE; \ goto return_something; \ } \ } @@ -4356,37 +4373,37 @@ ecoff_final_link_debug_accumulate (output_bfd, input_bfd, info, handle) /* Put out information for an external symbol. These come only from the hash table. */ -static boolean +static bfd_boolean ecoff_link_write_external (h, data) struct ecoff_link_hash_entry *h; PTR data; { struct extsym_info *einfo = (struct extsym_info *) data; bfd *output_bfd = einfo->abfd; - boolean strip; + bfd_boolean strip; if (h->root.type == bfd_link_hash_warning) { h = (struct ecoff_link_hash_entry *) h->root.u.i.link; if (h->root.type == bfd_link_hash_new) - return true; + return TRUE; } /* 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; + strip = FALSE; else if (einfo->info->strip == strip_all || (einfo->info->strip == strip_some && bfd_hash_lookup (einfo->info->keep_hash, h->root.root.string, - false, false) == NULL)) - strip = true; + FALSE, FALSE) == NULL)) + strip = TRUE; else - strip = false; + strip = FALSE; if (strip || h->written) - return true; + return TRUE; if (h->abfd == (bfd *) NULL) { @@ -4484,7 +4501,7 @@ ecoff_link_write_external (h, data) case bfd_link_hash_indirect: /* We ignore these symbols, since the indirected symbol is already in the hash table. */ - return true; + return TRUE; } /* bfd_ecoff_debug_one_external uses iextMax to keep track of the @@ -4500,7 +4517,7 @@ ecoff_link_write_external (h, data) /* Relocate and write an ECOFF section into an ECOFF output file. */ -static boolean +static bfd_boolean ecoff_indirect_link_order (output_bfd, info, output_section, link_order) bfd *output_bfd; struct bfd_link_info *info; @@ -4521,7 +4538,7 @@ ecoff_indirect_link_order (output_bfd, info, output_section, link_order) BFD_ASSERT ((output_section->flags & SEC_HAS_CONTENTS) != 0); if (link_order->size == 0) - return true; + return TRUE; input_section = link_order->u.indirect.section; input_bfd = input_section->owner; @@ -4591,11 +4608,11 @@ ecoff_indirect_link_order (output_bfd, info, output_section, link_order) cooked_size)) goto error_return; - /* If we are producing relocateable output, the relocs were + /* If we are producing relocatable output, the relocs were modified, and we write them out now. We use the reloc_count field of output_section to keep track of the number of relocs we have output so far. */ - if (info->relocateable) + if (info->relocatable) { file_ptr pos = (output_section->rel_filepos + output_section->reloc_count * external_reloc_size); @@ -4610,14 +4627,14 @@ ecoff_indirect_link_order (output_bfd, info, output_section, link_order) free (contents); if (external_relocs != NULL && section_tdata == NULL) free (external_relocs); - return true; + return TRUE; error_return: if (contents != NULL) free (contents); if (external_relocs != NULL && section_tdata == NULL) free (external_relocs); - return false; + return FALSE; } /* Generate a reloc when linking an ECOFF file. This is a reloc @@ -4625,7 +4642,7 @@ ecoff_indirect_link_order (output_bfd, info, output_section, link_order) is used to build constructor and destructor tables when linking with -Ur. */ -static boolean +static bfd_boolean ecoff_reloc_link_order (output_bfd, info, output_section, link_order) bfd *output_bfd; struct bfd_link_info *info; @@ -4639,7 +4656,7 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order) struct internal_reloc in; bfd_size_type external_reloc_size; bfd_byte *rbuf; - boolean ok; + bfd_boolean ok; file_ptr pos; type = link_order->type; @@ -4654,7 +4671,7 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order) if (rel.howto == 0) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } if (type == bfd_section_reloc_link_order) @@ -4670,7 +4687,7 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order) actually against the section. */ h = bfd_wrapped_link_hash_lookup (output_bfd, info, link_order->u.reloc.p->u.name, - false, false, false); + FALSE, FALSE, FALSE); if (h != NULL && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak)) @@ -4704,7 +4721,7 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order) size = bfd_get_reloc_size (rel.howto); buf = (bfd_byte *) bfd_zmalloc (size); if (buf == (bfd_byte *) NULL) - return false; + return FALSE; rstat = _bfd_relocate_contents (rel.howto, output_bfd, (bfd_vma) addend, buf); switch (rstat) @@ -4724,7 +4741,7 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order) (asection *) NULL, (bfd_vma) 0))) { free (buf); - return false; + return FALSE; } break; } @@ -4732,7 +4749,7 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order) (file_ptr) link_order->offset, size); free (buf); if (! ok) - return false; + return FALSE; } rel.addend = 0; @@ -4749,7 +4766,7 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order) h = ((struct ecoff_link_hash_entry *) bfd_wrapped_link_hash_lookup (output_bfd, info, link_order->u.reloc.p->u.name, - false, false, true)); + FALSE, FALSE, TRUE)); if (h != (struct ecoff_link_hash_entry *) NULL && h->indx != -1) in.r_symndx = h->indx; @@ -4758,7 +4775,7 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order) if (! ((*info->callbacks->unattached_reloc) (info, link_order->u.reloc.p->u.name, (bfd *) NULL, (asection *) NULL, (bfd_vma) 0))) - return false; + return FALSE; in.r_symndx = 0; } in.r_extern = 1; @@ -4810,7 +4827,7 @@ ecoff_reloc_link_order (output_bfd, info, output_section, link_order) external_reloc_size = ecoff_backend (output_bfd)->external_reloc_size; rbuf = (bfd_byte *) bfd_malloc (external_reloc_size); if (rbuf == (bfd_byte *) NULL) - return false; + return FALSE; (*ecoff_backend (output_bfd)->swap_reloc_out) (output_bfd, &in, (PTR) rbuf); diff --git a/contrib/binutils/bfd/ecofflink.c b/contrib/binutils/bfd/ecofflink.c index 5b854af..9e23848 100644 --- a/contrib/binutils/bfd/ecofflink.c +++ b/contrib/binutils/bfd/ecofflink.c @@ -1,23 +1,23 @@ /* Routines to link ECOFF debugging information. - Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002 + Copyright 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support, . -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" @@ -32,24 +32,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libcoff.h" #include "libecoff.h" -static boolean ecoff_add_bytes PARAMS ((char **buf, char **bufend, - size_t need)); +static bfd_boolean ecoff_add_bytes + PARAMS ((char **buf, char **bufend, size_t need)); static struct bfd_hash_entry *string_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static void ecoff_align_debug PARAMS ((bfd *abfd, - struct ecoff_debug_info *debug, - const struct ecoff_debug_swap *swap)); -static boolean ecoff_write_symhdr PARAMS ((bfd *, struct ecoff_debug_info *, - const struct ecoff_debug_swap *, - file_ptr where)); -static int cmp_fdrtab_entry PARAMS ((const PTR, const PTR)); -static boolean mk_fdrtab PARAMS ((bfd *, - struct ecoff_debug_info * const, - const struct ecoff_debug_swap * const, - struct ecoff_find_line *)); -static long fdrtab_lookup PARAMS ((struct ecoff_find_line *, bfd_vma)); -static boolean lookup_line +static void ecoff_align_debug + PARAMS ((bfd *abfd, struct ecoff_debug_info *debug, + const struct ecoff_debug_swap *swap)); +static bfd_boolean ecoff_write_symhdr + PARAMS ((bfd *, struct ecoff_debug_info *, const struct ecoff_debug_swap *, + file_ptr where)); +static int cmp_fdrtab_entry + PARAMS ((const PTR, const PTR)); +static bfd_boolean mk_fdrtab + PARAMS ((bfd *, struct ecoff_debug_info * const, + const struct ecoff_debug_swap * const, struct ecoff_find_line *)); +static long fdrtab_lookup + PARAMS ((struct ecoff_find_line *, bfd_vma)); +static bfd_boolean lookup_line PARAMS ((bfd *, struct ecoff_debug_info * const, const struct ecoff_debug_swap * const, struct ecoff_find_line *)); @@ -253,7 +254,7 @@ _bfd_ecoff_swap_rndx_out (bigend, intern_copy, ext) /* Add bytes to a buffer. Return success. */ -static boolean +static bfd_boolean ecoff_add_bytes (buf, bufend, need) char **buf; char **bufend; @@ -274,10 +275,10 @@ ecoff_add_bytes (buf, bufend, need) } newbuf = (char *) bfd_realloc (*buf, (bfd_size_type) have + want); if (newbuf == NULL) - return false; + return FALSE; *buf = newbuf; *bufend = *buf + have + want; - return true; + return TRUE; } /* We keep a hash table which maps strings to numbers. We use it to @@ -347,7 +348,7 @@ struct shuffle /* The length of the information. */ unsigned long size; /* Whether this information comes from a file or not. */ - boolean filep; + bfd_boolean filep; union { struct @@ -400,12 +401,11 @@ struct accumulate /* Add a file entry to a shuffle list. */ -static boolean add_file_shuffle PARAMS ((struct accumulate *, - struct shuffle **, - struct shuffle **, bfd *, file_ptr, - unsigned long)); +static bfd_boolean add_file_shuffle + PARAMS ((struct accumulate *, struct shuffle **, struct shuffle **, + bfd *, file_ptr, unsigned long)); -static boolean +static bfd_boolean add_file_shuffle (ainfo, head, tail, input_bfd, offset, size) struct accumulate *ainfo; struct shuffle **head; @@ -425,7 +425,7 @@ add_file_shuffle (ainfo, head, tail, input_bfd, offset, size) (*tail)->size += size; if ((*tail)->size > ainfo->largest_file_shuffle) ainfo->largest_file_shuffle = (*tail)->size; - return true; + return TRUE; } n = (struct shuffle *) objalloc_alloc (ainfo->memory, @@ -433,11 +433,11 @@ add_file_shuffle (ainfo, head, tail, input_bfd, offset, size) if (!n) { bfd_set_error (bfd_error_no_memory); - return false; + return FALSE; } n->next = NULL; n->size = size; - n->filep = true; + n->filep = TRUE; n->u.file.input_bfd = input_bfd; n->u.file.offset = offset; if (*head == (struct shuffle *) NULL) @@ -447,17 +447,16 @@ add_file_shuffle (ainfo, head, tail, input_bfd, offset, size) *tail = n; if (size > ainfo->largest_file_shuffle) ainfo->largest_file_shuffle = size; - return true; + return TRUE; } /* Add a memory entry to a shuffle list. */ -static boolean add_memory_shuffle PARAMS ((struct accumulate *, - struct shuffle **head, - struct shuffle **tail, - bfd_byte *data, unsigned long size)); +static bfd_boolean add_memory_shuffle + PARAMS ((struct accumulate *, struct shuffle **head, struct shuffle **tail, + bfd_byte *data, unsigned long size)); -static boolean +static bfd_boolean add_memory_shuffle (ainfo, head, tail, data, size) struct accumulate *ainfo; struct shuffle **head; @@ -472,18 +471,18 @@ add_memory_shuffle (ainfo, head, tail, data, size) if (!n) { bfd_set_error (bfd_error_no_memory); - return false; + return FALSE; } n->next = NULL; n->size = size; - n->filep = false; + n->filep = FALSE; n->u.memory = (PTR) data; if (*head == (struct shuffle *) NULL) *head = n; if (*tail != (struct shuffle *) NULL) (*tail)->next = n; *tail = n; - return true; + return TRUE; } /* Initialize the FDR hash table. This returns a handle which is then @@ -527,7 +526,7 @@ bfd_ecoff_debug_init (output_bfd, output_debug, output_swap, info) ainfo->largest_file_shuffle = 0; - if (! info->relocateable) + if (! info->relocatable) { if (! bfd_hash_table_init (&ainfo->str_hash.table, string_hash_newfunc)) return NULL; @@ -560,7 +559,7 @@ bfd_ecoff_debug_free (handle, output_bfd, output_debug, output_swap, info) bfd_hash_table_free (&ainfo->fdr_hash.table); - if (! info->relocateable) + if (! info->relocatable) bfd_hash_table_free (&ainfo->str_hash.table); objalloc_free (ainfo->memory); @@ -576,7 +575,7 @@ bfd_ecoff_debug_free (handle, output_bfd, output_debug, output_swap, info) linker information structure. HANDLE is returned by bfd_ecoff_debug_init. */ -boolean +bfd_boolean bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, input_bfd, input_debug, input_swap, info) @@ -672,10 +671,10 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, if (!input_debug->ifdmap || !rfd_out) { bfd_set_error (bfd_error_no_memory); - return false; + return FALSE; } if (!add_memory_shuffle (ainfo, &ainfo->rfd, &ainfo->rfd_end, rfd_out, sz)) - return false; + return FALSE; copied = 0; @@ -716,13 +715,13 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, lookup = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 20); if (lookup == NULL) - return false; + return FALSE; sprintf (lookup, "%s %lx %lx", name, fdr.csym, fdr.caux); - fh = string_hash_lookup (&ainfo->fdr_hash, lookup, true, true); + fh = string_hash_lookup (&ainfo->fdr_hash, lookup, TRUE, TRUE); free (lookup); if (fh == (struct string_hash_entry *) NULL) - return false; + return FALSE; if (fh->val != -1) { @@ -773,10 +772,10 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, if (!fdr_out) { bfd_set_error (bfd_error_no_memory); - return false; + return FALSE; } if (!add_memory_shuffle (ainfo, &ainfo->fdr, &ainfo->fdr_end, fdr_out, sz)) - return false; + return FALSE; for (fdr_ptr = fdr_start, i = 0; fdr_ptr < fdr_end; fdr_ptr += fdr_add, i++) @@ -786,7 +785,7 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, bfd_byte *sym_out; bfd_byte *lraw_src; bfd_byte *lraw_end; - boolean fgotfilename; + bfd_boolean fgotfilename; if (input_debug->ifdmap[i] < output_symhdr->ifdMax) { @@ -822,17 +821,17 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, /* Swap in the local symbols, adjust their values, and swap them out again. */ - fgotfilename = false; + fgotfilename = FALSE; sz = fdr.csym * external_sym_size; sym_out = (bfd_byte *) objalloc_alloc (ainfo->memory, sz); if (!sym_out) { bfd_set_error (bfd_error_no_memory); - return false; + return FALSE; } if (!add_memory_shuffle (ainfo, &ainfo->sym, &ainfo->sym_end, sym_out, sz)) - return false; + return FALSE; lraw_src = ((bfd_byte *) input_debug->external_sym + fdr.isymBase * input_swap->external_sym_size); lraw_end = lraw_src + fdr.csym * input_swap->external_sym_size; @@ -880,17 +879,17 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, /* If we are doing a final link, we hash all the strings in the local symbol table together. This reduces the amount of space required by debugging information. We don't do - this when performing a relocateable link because it would + this when performing a relocatable link because it would prevent us from easily merging different FDR's. */ - if (! info->relocateable) + if (! info->relocatable) { - boolean ffilename; + bfd_boolean ffilename; const char *name; if (! fgotfilename && internal_sym.iss == fdr.rss) - ffilename = true; + ffilename = TRUE; else - ffilename = false; + ffilename = FALSE; /* Hash the name into the string table. */ name = input_debug->ss + fdr.issBase + internal_sym.iss; @@ -900,9 +899,9 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, { struct string_hash_entry *sh; - sh = string_hash_lookup (&ainfo->str_hash, name, true, true); + sh = string_hash_lookup (&ainfo->str_hash, name, TRUE, TRUE); if (sh == (struct string_hash_entry *) NULL) - return false; + return FALSE; if (sh->val == -1) { sh->val = output_symhdr->issMax; @@ -920,7 +919,7 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, if (ffilename) { fdr.rss = internal_sym.iss; - fgotfilename = true; + fgotfilename = TRUE; } } @@ -942,7 +941,7 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, file_ptr pos = input_symhdr->cbLineOffset + fdr.cbLineOffset; if (!add_file_shuffle (ainfo, &ainfo->line, &ainfo->line_end, input_bfd, pos, (unsigned long) fdr.cbLine)) - return false; + return FALSE; fdr.ilineBase = output_symhdr->ilineMax; fdr.cbLineOffset = output_symhdr->cbLine; output_symhdr->ilineMax += fdr.cline; @@ -955,11 +954,11 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, if (!add_file_shuffle (ainfo, &ainfo->aux, &ainfo->aux_end, input_bfd, pos, fdr.caux * sizeof (union aux_ext))) - return false; + return FALSE; fdr.iauxBase = output_symhdr->iauxMax; output_symhdr->iauxMax += fdr.caux; } - if (! info->relocateable) + if (! info->relocatable) { /* When are are hashing strings, we lie about the number of @@ -974,7 +973,7 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, file_ptr pos = input_symhdr->cbSsOffset + fdr.issBase; if (!add_file_shuffle (ainfo, &ainfo->ss, &ainfo->ss_end, input_bfd, pos, (unsigned long) fdr.cbSs)) - return false; + return FALSE; fdr.issBase = output_symhdr->issMax; output_symhdr->issMax += fdr.cbSs; } @@ -994,7 +993,7 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, unsigned long size = fdr.cpd * external_pdr_size; if (!add_file_shuffle (ainfo, &ainfo->pdr, &ainfo->pdr_end, input_bfd, pos, size)) - return false; + return FALSE; } BFD_ASSERT (external_opt_size == input_swap->external_opt_size); if (fdr.copt > 0) @@ -1004,7 +1003,7 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, unsigned long size = fdr.copt * external_opt_size; if (!add_file_shuffle (ainfo, &ainfo->opt, &ainfo->opt_end, input_bfd, pos, size)) - return false; + return FALSE; } } else @@ -1027,11 +1026,11 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, if (!out) { bfd_set_error (bfd_error_no_memory); - return false; + return FALSE; } if (!add_memory_shuffle (ainfo, &ainfo->pdr, &ainfo->pdr_end, out, sz)) - return false; + return FALSE; for (; in < end; in += insz, out += outsz) { PDR pdr; @@ -1068,11 +1067,11 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, if (!out) { bfd_set_error (bfd_error_no_memory); - return false; + return FALSE; } if (!add_memory_shuffle (ainfo, &ainfo->opt, &ainfo->opt_end, out, sz)) - return false; + return FALSE; for (; in < end; in += insz, out += outsz) { OPTR opt; @@ -1104,16 +1103,15 @@ bfd_ecoff_debug_accumulate (handle, output_bfd, output_debug, output_swap, ++output_symhdr->ifdMax; } - return true; + return TRUE; } /* Add a string to the debugging information we are accumulating. Return the offset from the fdr string base. */ -static long ecoff_add_string PARAMS ((struct accumulate *, - struct bfd_link_info *, - struct ecoff_debug_info *, - FDR *fdr, const char *string)); +static long ecoff_add_string + PARAMS ((struct accumulate *, struct bfd_link_info *, + struct ecoff_debug_info *, FDR *fdr, const char *string)); static long ecoff_add_string (ainfo, info, debug, fdr, string) @@ -1129,7 +1127,7 @@ ecoff_add_string (ainfo, info, debug, fdr, string) symhdr = &debug->symbolic_header; len = strlen (string); - if (info->relocateable) + if (info->relocatable) { if (!add_memory_shuffle (ainfo, &ainfo->ss, &ainfo->ss_end, (PTR) string, len + 1)) @@ -1142,7 +1140,7 @@ ecoff_add_string (ainfo, info, debug, fdr, string) { struct string_hash_entry *sh; - sh = string_hash_lookup (&ainfo->str_hash, string, true, true); + sh = string_hash_lookup (&ainfo->str_hash, string, TRUE, TRUE); if (sh == (struct string_hash_entry *) NULL) return -1; if (sh->val == -1) @@ -1164,7 +1162,7 @@ ecoff_add_string (ainfo, info, debug, fdr, string) /* Add debugging information from a non-ECOFF file. */ -boolean +bfd_boolean bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug, output_swap, input_bfd, info) PTR handle; @@ -1203,19 +1201,19 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug, fdr.rss = ecoff_add_string (ainfo, info, output_debug, &fdr, bfd_archive_filename (input_bfd)); if (fdr.rss == -1) - return false; + return FALSE; fdr.isymBase = output_symhdr->isymMax; /* Get the local symbols from the input BFD. */ symsize = bfd_get_symtab_upper_bound (input_bfd); if (symsize < 0) - return false; + return FALSE; symbols = (asymbol **) bfd_alloc (output_bfd, (bfd_size_type) symsize); if (symbols == (asymbol **) NULL) - return false; + return FALSE; symcount = bfd_canonicalize_symtab (input_bfd, symbols); if (symcount < 0) - return false; + return FALSE; sym_end = symbols + symcount; /* Handle the local symbols. Any external symbols are handled @@ -1233,7 +1231,7 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug, (*sym_ptr)->name); if (internal_sym.iss == -1) - return false; + return FALSE; if (bfd_is_com_section ((*sym_ptr)->section) || bfd_is_und_section ((*sym_ptr)->section)) internal_sym.value = (*sym_ptr)->value; @@ -1250,7 +1248,7 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug, if (!external_sym) { bfd_set_error (bfd_error_no_memory); - return false; + return FALSE; } (*swap_sym_out) (output_bfd, &internal_sym, external_sym); add_memory_shuffle (ainfo, &ainfo->sym, &ainfo->sym_end, @@ -1271,7 +1269,7 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug, if (!external_fdr) { bfd_set_error (bfd_error_no_memory); - return false; + return FALSE; } (*output_swap->swap_fdr_out) (output_bfd, &fdr, external_fdr); add_memory_shuffle (ainfo, &ainfo->fdr, &ainfo->fdr_end, @@ -1280,7 +1278,7 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug, ++output_symhdr->ifdMax; - return true; + return TRUE; } /* Set up ECOFF debugging information for the external symbols. @@ -1288,14 +1286,14 @@ bfd_ecoff_debug_accumulate_other (handle, output_bfd, output_debug, probably be changed to use a shuffle structure. The assembler uses this interface, so that must be changed to do something else. */ -boolean -bfd_ecoff_debug_externals (abfd, debug, swap, relocateable, get_extr, +bfd_boolean +bfd_ecoff_debug_externals (abfd, debug, swap, relocatable, get_extr, set_index) bfd *abfd; struct ecoff_debug_info *debug; const struct ecoff_debug_swap *swap; - boolean relocateable; - boolean (*get_extr) PARAMS ((asymbol *, EXTR *)); + bfd_boolean relocatable; + bfd_boolean (*get_extr) PARAMS ((asymbol *, EXTR *)); void (*set_index) PARAMS ((asymbol *, bfd_size_type)); { HDRR * const symhdr = &debug->symbolic_header; @@ -1304,7 +1302,7 @@ bfd_ecoff_debug_externals (abfd, debug, swap, relocateable, get_extr, sym_ptr_ptr = bfd_get_outsymbols (abfd); if (sym_ptr_ptr == NULL) - return true; + return TRUE; for (c = bfd_get_symcount (abfd); c > 0; c--, sym_ptr_ptr++) { @@ -1319,7 +1317,7 @@ bfd_ecoff_debug_externals (abfd, debug, swap, relocateable, get_extr, /* If we're producing an executable, move common symbols into bss. */ - if (! relocateable) + if (! relocatable) { if (esym.asym.sc == scCommon) esym.asym.sc = scBss; @@ -1349,15 +1347,15 @@ bfd_ecoff_debug_externals (abfd, debug, swap, relocateable, get_extr, if (! bfd_ecoff_debug_one_external (abfd, debug, swap, sym_ptr->name, &esym)) - return false; + return FALSE; } - return true; + return TRUE; } /* Add a single external symbol to the debugging information. */ -boolean +bfd_boolean bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym) bfd *abfd; struct ecoff_debug_info *debug; @@ -1379,7 +1377,7 @@ bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym) if (! ecoff_add_bytes ((char **) &debug->ssext, (char **) &debug->ssext_end, symhdr->issExtMax + namelen + 1)) - return false; + return FALSE; } if ((size_t) ((char *) debug->external_ext_end - (char *) debug->external_ext) @@ -1388,7 +1386,7 @@ bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym) if (! ecoff_add_bytes ((char **) &debug->external_ext, (char **) &debug->external_ext_end, (symhdr->iextMax + 1) * (size_t) external_ext_size)) - return false; + return FALSE; } esym->asym.iss = symhdr->issExtMax; @@ -1402,7 +1400,7 @@ bfd_ecoff_debug_one_external (abfd, debug, swap, name, esym) strcpy (debug->ssext + symhdr->issExtMax, name); symhdr->issExtMax += namelen + 1; - return true; + return TRUE; } /* Align the ECOFF debugging information. */ @@ -1503,7 +1501,7 @@ bfd_ecoff_debug_size (abfd, debug, swap) going to be placed at. This assumes that the counts are set correctly. */ -static boolean +static bfd_boolean ecoff_write_symhdr (abfd, debug, swap, where) bfd *abfd; struct ecoff_debug_info *debug; @@ -1517,7 +1515,7 @@ ecoff_write_symhdr (abfd, debug, swap, where) /* Go to the right location in the file. */ if (bfd_seek (abfd, where, SEEK_SET) != 0) - return false; + return FALSE; where += swap->external_hdr_size; @@ -1557,11 +1555,11 @@ ecoff_write_symhdr (abfd, debug, swap, where) if (buff != NULL) free (buff); - return true; + return TRUE; error_return: if (buff != NULL) free (buff); - return false; + return FALSE; } /* Write out the ECOFF debugging information. This function assumes @@ -1570,7 +1568,7 @@ ecoff_write_symhdr (abfd, debug, swap, where) information to. This function fills in the file offsets in the symbolic header. */ -boolean +bfd_boolean bfd_ecoff_write_debug (abfd, debug, swap, where) bfd *abfd; struct ecoff_debug_info *debug; @@ -1580,14 +1578,14 @@ bfd_ecoff_write_debug (abfd, debug, swap, where) HDRR * const symhdr = &debug->symbolic_header; if (! ecoff_write_symhdr (abfd, debug, swap, where)) - return false; + return FALSE; #define WRITE(ptr, count, size, offset) \ BFD_ASSERT (symhdr->offset == 0 \ || (bfd_vma) bfd_tell (abfd) == symhdr->offset); \ if (bfd_bwrite ((PTR) debug->ptr, (bfd_size_type) size * symhdr->count, abfd)\ != size * symhdr->count) \ - return false; + return FALSE; WRITE (line, cbLine, sizeof (unsigned char), cbLineOffset); WRITE (external_dnr, idnMax, swap->external_dnr_size, cbDnOffset); @@ -1603,16 +1601,16 @@ bfd_ecoff_write_debug (abfd, debug, swap, where) WRITE (external_ext, iextMax, swap->external_ext_size, cbExtOffset); #undef WRITE - return true; + return TRUE; } /* Write out a shuffle list. */ -static boolean ecoff_write_shuffle PARAMS ((bfd *, - const struct ecoff_debug_swap *, - struct shuffle *, PTR space)); +static bfd_boolean ecoff_write_shuffle + PARAMS ((bfd *, const struct ecoff_debug_swap *, struct shuffle *, + PTR space)); -static boolean +static bfd_boolean ecoff_write_shuffle (abfd, swap, shuffle, space) bfd *abfd; const struct ecoff_debug_swap *swap; @@ -1629,7 +1627,7 @@ ecoff_write_shuffle (abfd, swap, shuffle, space) { if (bfd_bwrite (l->u.memory, (bfd_size_type) l->size, abfd) != l->size) - return false; + return FALSE; } else { @@ -1637,7 +1635,7 @@ ecoff_write_shuffle (abfd, swap, shuffle, space) || bfd_bread (space, (bfd_size_type) l->size, l->u.file.input_bfd) != l->size || bfd_bwrite (space, (bfd_size_type) l->size, abfd) != l->size) - return false; + return FALSE; } total += l->size; } @@ -1650,23 +1648,23 @@ ecoff_write_shuffle (abfd, swap, shuffle, space) i = swap->debug_align - (total & (swap->debug_align - 1)); s = (bfd_byte *) bfd_zmalloc ((bfd_size_type) i); if (s == NULL && i != 0) - return false; + return FALSE; if (bfd_bwrite ((PTR) s, (bfd_size_type) i, abfd) != i) { free (s); - return false; + return FALSE; } free (s); } - return true; + return TRUE; } /* Write out debugging information using accumulated linker information. */ -boolean +bfd_boolean bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where) PTR handle; bfd *abfd; @@ -1696,7 +1694,7 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where) /* The string table is written out from the hash table if this is a final link. */ - if (info->relocateable) + if (info->relocatable) { BFD_ASSERT (ainfo->ss_hash == (struct string_hash_entry *) NULL); if (! ecoff_write_shuffle (abfd, swap, ainfo->ss, space)) @@ -1784,12 +1782,12 @@ bfd_ecoff_write_accumulated_debug (handle, abfd, debug, swap, info, where) if (space != NULL) free (space); - return true; + return TRUE; error_return: if (space != NULL) free (space); - return false; + return FALSE; } /* Handle the find_nearest_line function for both ECOFF and MIPS ELF @@ -1820,7 +1818,7 @@ cmp_fdrtab_entry (leftp, rightp) table will be sorted by address so we can look it up via binary search. */ -static boolean +static bfd_boolean mk_fdrtab (abfd, debug_info, debug_swap, line_info) bfd *abfd; struct ecoff_debug_info * const debug_info; @@ -1831,27 +1829,26 @@ mk_fdrtab (abfd, debug_info, debug_swap, line_info) FDR *fdr_ptr; FDR *fdr_start; FDR *fdr_end; - boolean stabs; + bfd_boolean stabs; long len; bfd_size_type amt; fdr_start = debug_info->fdr; fdr_end = fdr_start + debug_info->symbolic_header.ifdMax; - /* First, let's see how long the table needs to be: */ + /* First, let's see how long the table needs to be. */ for (len = 0, fdr_ptr = fdr_start; fdr_ptr < fdr_end; fdr_ptr++) { - if (fdr_ptr->cpd == 0) /* skip FDRs that have no PDRs */ + if (fdr_ptr->cpd == 0) /* Skip FDRs that have no PDRs. */ continue; ++len; } - /* Now, create and fill in the table: */ - + /* Now, create and fill in the table. */ amt = (bfd_size_type) len * sizeof (struct ecoff_fdrtab_entry); line_info->fdrtab = (struct ecoff_fdrtab_entry*) bfd_zalloc (abfd, amt); if (line_info->fdrtab == NULL) - return false; + return FALSE; line_info->fdrtab_len = len; tab = line_info->fdrtab; @@ -1863,39 +1860,53 @@ mk_fdrtab (abfd, debug_info, debug_swap, line_info) /* Check whether this file has stabs debugging information. In a file with stabs debugging information, the second local symbol is named @stabs. */ - stabs = false; + stabs = FALSE; if (fdr_ptr->csym >= 2) { char *sym_ptr; SYMR sym; sym_ptr = ((char *) debug_info->external_sym - + (fdr_ptr->isymBase + 1)*debug_swap->external_sym_size); + + (fdr_ptr->isymBase + 1) * debug_swap->external_sym_size); (*debug_swap->swap_sym_in) (abfd, sym_ptr, &sym); if (strcmp (debug_info->ss + fdr_ptr->issBase + sym.iss, STABS_SYMBOL) == 0) - stabs = true; + stabs = TRUE; } if (!stabs) { - bfd_size_type external_pdr_size; - char *pdr_ptr; - PDR pdr; - - external_pdr_size = debug_swap->external_pdr_size; - - pdr_ptr = ((char *) debug_info->external_pdr - + fdr_ptr->ipdFirst * external_pdr_size); - (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr); + /* eraxxon: There are at least two problems with this computation: + 1) PDRs do *not* contain offsets but full vma's; and typically the + address of the first PDR is the address of the FDR, which will + make (most) of the results of the original computation 0! + 2) Once in a wacky while, the Compaq compiler generated PDR + addresses do not equal the FDR vma, but they (the PDR address) + are still vma's and not offsets. Cf. comments in + 'lookup_line'. */ +#if 0 + bfd_size_type external_pdr_size; + char *pdr_ptr; + PDR pdr; + + external_pdr_size = debug_swap->external_pdr_size; + + pdr_ptr = ((char *) debug_info->external_pdr + + fdr_ptr->ipdFirst * external_pdr_size); + (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr); + /* The address of the first PDR is the offset of that + procedure relative to the beginning of file FDR. */ + tab->base_addr = fdr_ptr->adr - pdr.adr; +#else /* The address of the first PDR is the offset of that procedure relative to the beginning of file FDR. */ - tab->base_addr = fdr_ptr->adr - pdr.adr; + tab->base_addr = fdr_ptr->adr; +#endif } else { /* XXX I don't know about stabs, so this is a guess - (davidm@cs.arizona.edu): */ + (davidm@cs.arizona.edu). */ tab->base_addr = fdr_ptr->adr; } tab->fdr = fdr_ptr; @@ -1909,7 +1920,7 @@ mk_fdrtab (abfd, debug_info, debug_swap, line_info) qsort ((PTR) line_info->fdrtab, (size_t) len, sizeof (struct ecoff_fdrtab_entry), cmp_fdrtab_entry); - return true; + return TRUE; } /* Return index of first FDR that covers to OFFSET. */ @@ -1939,14 +1950,22 @@ fdrtab_lookup (line_info, offset) else low = mid + 1; } + + /* eraxxon: at this point 'offset' is either lower than the lowest entry or + higher than the highest entry. In the former case high = low = mid = 0; + we want to return -1. In the latter case, low = high and mid = low - 1; + we want to return the index of the highest entry. Only in former case + will the following 'catch-all' test be true. */ ++mid; - /* last entry is catch-all for all higher addresses: */ + /* Last entry is catch-all for all higher addresses. */ if (offset < tab[mid].base_addr) return -1; find_min: + /* eraxxon: There may be multiple FDRs in the table with the + same base_addr; make sure that we are at the first one. */ while (mid > 0 && tab[mid - 1].base_addr == tab[mid].base_addr) --mid; @@ -1956,7 +1975,7 @@ fdrtab_lookup (line_info, offset) /* Look up a line given an address, storing the information in LINE_INFO->cache. */ -static boolean +static bfd_boolean lookup_line (abfd, debug_info, debug_swap, line_info) bfd *abfd; struct ecoff_debug_info * const debug_info; @@ -1965,30 +1984,101 @@ lookup_line (abfd, debug_info, debug_swap, line_info) { struct ecoff_fdrtab_entry *tab; bfd_vma offset; - boolean stabs; + bfd_boolean stabs; FDR *fdr_ptr; int i; + /* eraxxon: note that 'offset' is the full vma, not a section offset. */ offset = line_info->cache.start; /* Build FDR table (sorted by object file's base-address) if we don't have it already. */ if (line_info->fdrtab == NULL && !mk_fdrtab (abfd, debug_info, debug_swap, line_info)) - return false; + return FALSE; tab = line_info->fdrtab; - /* find first FDR for address OFFSET */ + /* Find first FDR for address OFFSET. */ i = fdrtab_lookup (line_info, offset); if (i < 0) - return false; /* no FDR, no fun... */ + return FALSE; /* no FDR, no fun... */ + + /* eraxxon: 'fdrtab_lookup' doesn't give what we want, at least for Compaq's + C++ compiler 6.2. Consider three FDRs with starting addresses of x, y, + and z, respectively, such that x < y < z. Assume further that + y < 'offset' < z. It is possible at times that the PDR for 'offset' is + associated with FDR x and *not* with FDR y. Erg!! + + From a binary dump of my C++ test case 'moo' using Compaq's coffobjanl + (output format has been edited for our purposes): + + FDR [2]: (main.C): First instruction: 0x12000207c + PDR [5] for File [2]: LoopTest__Xv <0x1200020a0> (a) + PDR [7] for File [2]: foo__Xv <0x120002168> + FDR [1]: (-1): First instruction: 0x1200020e8 + PDR [3] for File [1]: <0x120001ad0> (b) + FDR [6]: (-1): First instruction: 0x1200026f0 + + (a) In the case of PDR5, the vma is such that the first few instructions + of the procedure can be found. But since the size of this procedure is + 160b, the vma will soon cross into the 'address space' of FDR1 and no + debugging info will be found. How repugnant! + + (b) It is also possible for a PDR to have a *lower* vma than its associated + FDR; see FDR1 and PDR3. Gross! + + Since the FDRs that are causing so much havok (in this case) 1) do not + describe actual files (fdr.rss == -1), and 2) contain only compiler + generated routines, I thought a simple fix would be to exclude them from + the FDR table in 'mk_fdrtab'. But, besides not knowing for certain + whether this would be correct, it creates an additional problem. If we + happen to ask for source file info on a compiler generated (procedure) + symbol -- which is still in the symbol table -- the result can be + information from a real procedure! This is because compiler generated + procedures with vma's higher than the last FDR in the fdr table will be + associated with a PDR from this FDR, specifically the PDR with the + highest vma. This wasn't a problem before, because each procedure had a + PDR. (Yes, this problem could be eliminated if we kept the size of the + last PDR around, but things are already getting ugly). + + Probably, a better solution would be to have a sorted PDR table. Each + PDR would have a pointer to its FDR so file information could still be + obtained. A FDR table could still be constructed if necessary -- since + it only contains pointers, not much extra memory would be used -- but + the PDR table would be searched to locate debugging info. + + There is still at least one remaining issue. Sometimes a FDR can have a + bogus name, but contain PDRs that should belong to another FDR with a + real name. E.g: + + FDR [3]: 0000000120001b50 (/home/.../Array.H~alt~deccxx_5E5A62AD) + PDR [a] for File [3]: 0000000120001b50 + PDR [b] for File [3]: 0000000120001cf0 + PDR [c] for File [3]: 0000000120001dc8 + PDR [d] for File [3]: 0000000120001e40 + PDR [e] for File [3]: 0000000120001eb8 + PDR [f] for File [3]: 0000000120001f4c + FDR [4]: 0000000120001b50 (/home/.../Array.H) + + Here, FDR4 has the correct name, but should (seemingly) contain PDRa-f. + The symbol table for PDR4 does contain symbols for PDRa-f, but so does + the symbol table for FDR3. However the former is different; perhaps this + can be detected easily. (I'm not sure at this point.) This problem only + seems to be associated with files with templates. I am assuming the idea + is that there is a 'fake' FDR (with PDRs) for each differently typed set + of templates that must be generated. Currently, FDR4 is completely + excluded from the FDR table in 'mk_fdrtab' because it contains no PDRs. + + Since I don't have time to prepare a real fix for this right now, be + prepared for 'A Horrible Hack' to force the inspection of all non-stabs + FDRs. It's coming... */ fdr_ptr = tab[i].fdr; /* Check whether this file has stabs debugging information. In a file with stabs debugging information, the second local symbol is named @stabs. */ - stabs = false; + stabs = FALSE; if (fdr_ptr->csym >= 2) { char *sym_ptr; @@ -1999,7 +2089,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info) (*debug_swap->swap_sym_in) (abfd, sym_ptr, &sym); if (strcmp (debug_info->ss + fdr_ptr->issBase + sym.iss, STABS_SYMBOL) == 0) - stabs = true; + stabs = TRUE; } if (!stabs) @@ -2008,7 +2098,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info) char *pdr_ptr; char *best_pdr = NULL; FDR *best_fdr; - bfd_vma best_dist = ~(bfd_vma) 0; + bfd_signed_vma best_dist = -1; PDR pdr; unsigned char *line_ptr; unsigned char *line_end; @@ -2070,14 +2160,29 @@ lookup_line (abfd, debug_info, debug_swap, line_info) considerably, which is undesirable. */ external_pdr_size = debug_swap->external_pdr_size; - /* Make offset relative to object file's start-address: */ +#if 0 /* eraxxon: PDR addresses (pdr.adr) are not relative to FDRs! + Leave 'offset' alone. */ + /* Make offset relative to object file's start-address. */ offset -= tab[i].base_addr; +#endif + /* eraxxon: The Horrible Hack: Because of the problems above, set 'i' + to 0 so we look through all FDRs. + + Because FDR's without any symbols are assumed to be non-stabs, + searching through all FDRs may cause the following code to try to + read stabs FDRs as ECOFF ones. However, I don't think this will + harm anything. */ + i = 0; + /* Search FDR list starting at tab[i] for the PDR that best matches OFFSET. Normally, the FDR list is only one entry long. */ best_fdr = NULL; do { - bfd_vma dist, min_dist = 0; + /* eraxxon: 'dist' and 'min_dist' can be negative now + because we iterate over every FDR rather than just ones + with a base address less than or equal to 'offset'. */ + bfd_signed_vma dist = -1, min_dist = -1; char *pdr_hold; char *pdr_end; @@ -2100,7 +2205,10 @@ lookup_line (abfd, debug_info, debug_swap, line_info) if (offset >= (pdr.adr - 0x10 * pdr.prof)) { dist = offset - (pdr.adr - 0x10 * pdr.prof); - if (!pdr_hold || dist < min_dist) + + /* eraxxon: 'dist' can be negative now. Note that + 'min_dist' can be negative if 'pdr_hold' below is NULL. */ + if (!pdr_hold || (dist >= 0 && dist < min_dist)) { min_dist = dist; pdr_hold = pdr_ptr; @@ -2108,21 +2216,22 @@ lookup_line (abfd, debug_info, debug_swap, line_info) } } - if (!best_pdr || min_dist < best_dist) + if (!best_pdr || (min_dist >= 0 && min_dist < best_dist)) { - best_dist = min_dist; + best_dist = (bfd_vma) min_dist; best_fdr = fdr_ptr; best_pdr = pdr_hold; } - /* continue looping until base_addr of next entry is different: */ + /* Continue looping until base_addr of next entry is different. */ } - while (++i < line_info->fdrtab_len - && tab[i].base_addr == tab[i - 1].base_addr); + /* eraxxon: We want to iterate over all FDRs. + See previous comment about 'fdrtab_lookup'. */ + while (++i < line_info->fdrtab_len); if (!best_fdr || !best_pdr) - return false; /* shouldn't happen... */ + return FALSE; /* Shouldn't happen... */ - /* phew, finally we got something that we can hold onto: */ + /* Phew, finally we got something that we can hold onto. */ fdr_ptr = best_fdr; pdr_ptr = best_pdr; (*debug_swap->swap_pdr_in) (abfd, (PTR) pdr_ptr, &pdr); @@ -2132,7 +2241,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info) number entries. */ line_end = debug_info->line + fdr_ptr->cbLineOffset + fdr_ptr->cbLine; - /* Make offset relative to procedure entry: */ + /* Make offset relative to procedure entry. */ offset -= pdr.adr - 0x10 * pdr.prof; lineno = pdr.lnLow; line_ptr = debug_info->line + fdr_ptr->cbLineOffset + pdr.cbLineOffset; @@ -2213,8 +2322,8 @@ lookup_line (abfd, debug_info, debug_swap, line_info) const char *line_file_name; bfd_vma low_func_vma; bfd_vma low_line_vma; - boolean past_line; - boolean past_fn; + bfd_boolean past_line; + bfd_boolean past_fn; char *sym_ptr, *sym_ptr_end; size_t len, funclen; char *buffer = NULL; @@ -2240,8 +2349,8 @@ lookup_line (abfd, debug_info, debug_swap, line_info) line_file_name = NULL; low_func_vma = 0; low_line_vma = 0; - past_line = false; - past_fn = false; + past_line = FALSE; + past_fn = FALSE; external_sym_size = debug_swap->external_sym_size; @@ -2291,7 +2400,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info) case N_FUN: if (sym.value > offset) - past_fn = true; + past_fn = TRUE; else if (sym.value >= low_func_vma) { low_func_vma = sym.value; @@ -2304,7 +2413,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info) else if (sym.st == stLabel && sym.index != indexNil) { if (sym.value > offset) - past_line = true; + past_line = TRUE; else if (sym.value >= low_line_vma) { low_line_vma = sym.value; @@ -2336,7 +2445,7 @@ lookup_line (abfd, debug_info, debug_swap, line_info) free (line_info->find_buffer); buffer = (char *) bfd_malloc ((bfd_size_type) len); if (buffer == NULL) - return false; + return FALSE; line_info->find_buffer = buffer; } @@ -2364,12 +2473,12 @@ lookup_line (abfd, debug_info, debug_swap, line_info) } } - return true; + return TRUE; } /* Do the work of find_nearest_line. */ -boolean +bfd_boolean _bfd_ecoff_locate_line (abfd, section, offset, debug_info, debug_swap, line_info, filename_ptr, functionname_ptr, retline_ptr) bfd *abfd; @@ -2395,7 +2504,7 @@ _bfd_ecoff_locate_line (abfd, section, offset, debug_info, debug_swap, if (! lookup_line (abfd, debug_info, debug_swap, line_info)) { line_info->cache.sect = NULL; - return false; + return FALSE; } } @@ -2403,7 +2512,7 @@ _bfd_ecoff_locate_line (abfd, section, offset, debug_info, debug_swap, *functionname_ptr = line_info->cache.functionname; *retline_ptr = line_info->cache.line_num; - return true; + return TRUE; } /* These routines copy symbolic information into a memory buffer. @@ -2416,9 +2525,10 @@ _bfd_ecoff_locate_line (abfd, section, offset, debug_info, debug_swap, /* Collect a shuffle into a memory buffer. */ -static boolean ecoff_collect_shuffle PARAMS ((struct shuffle *, bfd_byte *)); +static bfd_boolean ecoff_collect_shuffle + PARAMS ((struct shuffle *, bfd_byte *)); -static boolean +static bfd_boolean ecoff_collect_shuffle (l, buff) struct shuffle *l; bfd_byte *buff; @@ -2435,18 +2545,18 @@ ecoff_collect_shuffle (l, buff) if (bfd_seek (l->u.file.input_bfd, l->u.file.offset, SEEK_SET) != 0 || (bfd_bread (buff, (bfd_size_type) l->size, l->u.file.input_bfd) != l->size)) - return false; + return FALSE; } total += l->size; buff += l->size; } - return true; + return TRUE; } /* Copy PDR information into a memory buffer. */ -boolean +bfd_boolean _bfd_ecoff_get_accumulated_pdr (handle, buff) PTR handle; bfd_byte *buff; @@ -2458,7 +2568,7 @@ _bfd_ecoff_get_accumulated_pdr (handle, buff) /* Copy symbol information into a memory buffer. */ -boolean +bfd_boolean _bfd_ecoff_get_accumulated_sym (handle, buff) PTR handle; bfd_byte *buff; @@ -2470,7 +2580,7 @@ _bfd_ecoff_get_accumulated_sym (handle, buff) /* Copy the string table into a memory buffer. */ -boolean +bfd_boolean _bfd_ecoff_get_accumulated_ss (handle, buff) PTR handle; bfd_byte *buff; @@ -2497,5 +2607,5 @@ _bfd_ecoff_get_accumulated_ss (handle, buff) buff += len + 1; } - return true; + return TRUE; } diff --git a/contrib/binutils/bfd/ecoffswap.h b/contrib/binutils/bfd/ecoffswap.h index 24627d0..7ea0394 100644 --- a/contrib/binutils/bfd/ecoffswap.h +++ b/contrib/binutils/bfd/ecoffswap.h @@ -1,23 +1,23 @@ /* Generic ECOFF swapping routines, for BFD. - Copyright 1992, 1993, 1994, 1995, 1996, 2000, 2001 + Copyright 1992, 1993, 1994, 1995, 1996, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Cygnus Support. -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. */ /* NOTE: This is a header file, but it contains executable routines. This is done this way because these routines are substantially @@ -220,7 +220,7 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern) intern->rfdBase = H_GET_32 (abfd, ext->f_rfdBase); intern->crfd = H_GET_32 (abfd, 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) @@ -263,7 +263,8 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr) struct fdr_ext *ext = (struct fdr_ext *) ext_ptr; FDR intern[1]; - *intern = *intern_copy; /* Make it reasonable to do in-place. */ + /* Make it reasonable to do in-place. */ + *intern = *intern_copy; ECOFF_PUT_OFF (abfd, intern->adr, ext->f_adr); H_PUT_32 (abfd, intern->rss, ext->f_rss); @@ -288,7 +289,7 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr) H_PUT_32 (abfd, intern->rfdBase, ext->f_rfdBase); H_PUT_32 (abfd, intern->crfd, 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) @@ -355,6 +356,11 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern) intern->cbLineOffset = ECOFF_GET_OFF (abfd, ext->p_cbLineOffset); #if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) + if (intern->isym == (signed long) 0xffffffff) + intern->isym = -1; + if (intern->iline == (signed long) 0xffffffff) + intern->iline = -1; + intern->gp_prologue = H_GET_8 (abfd, ext->p_gp_prologue); if (bfd_header_big_endian (abfd)) { @@ -396,7 +402,8 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) struct pdr_ext *ext = (struct pdr_ext *) ext_ptr; PDR intern[1]; - *intern = *intern_copy; /* Make it reasonable to do in-place. */ + /* Make it reasonable to do in-place. */ + *intern = *intern_copy; ECOFF_PUT_OFF (abfd, intern->adr, ext->p_adr); H_PUT_32 (abfd, intern->isym, ext->p_isym); @@ -494,7 +501,8 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) struct pdr_ext *ext = (struct pdr_ext *) ext_ptr; PDR intern[1]; - *intern = *intern_copy; /* Make it reasonable to do in-place. */ + /* Make it reasonable to do in-place. */ + *intern = *intern_copy; ECOFF_PUT_OFF (abfd, intern->adr, ext->p_adr); H_PUT_32 (abfd, intern->isym, ext->p_isym); @@ -533,33 +541,41 @@ ecoff_swap_sym_in (abfd, ext_copy, intern) intern->iss = H_GET_32 (abfd, ext->s_iss); intern->value = ECOFF_GET_OFF (abfd, ext->s_value); - /* now the fun stuff... */ - if (bfd_header_big_endian (abfd)) { - intern->st = (ext->s_bits1[0] & SYM_BITS1_ST_BIG) - >> SYM_BITS1_ST_SH_BIG; - intern->sc = ((ext->s_bits1[0] & SYM_BITS1_SC_BIG) - << SYM_BITS1_SC_SH_LEFT_BIG) - | ((ext->s_bits2[0] & SYM_BITS2_SC_BIG) - >> SYM_BITS2_SC_SH_BIG); - intern->reserved = 0 != (ext->s_bits2[0] & SYM_BITS2_RESERVED_BIG); - intern->index = ((ext->s_bits2[0] & SYM_BITS2_INDEX_BIG) - << SYM_BITS2_INDEX_SH_LEFT_BIG) - | (ext->s_bits3[0] << SYM_BITS3_INDEX_SH_LEFT_BIG) - | (ext->s_bits4[0] << SYM_BITS4_INDEX_SH_LEFT_BIG); - } else { - intern->st = (ext->s_bits1[0] & SYM_BITS1_ST_LITTLE) - >> SYM_BITS1_ST_SH_LITTLE; - intern->sc = ((ext->s_bits1[0] & SYM_BITS1_SC_LITTLE) - >> SYM_BITS1_SC_SH_LITTLE) - | ((ext->s_bits2[0] & SYM_BITS2_SC_LITTLE) - << SYM_BITS2_SC_SH_LEFT_LITTLE); - intern->reserved = 0 != (ext->s_bits2[0] & SYM_BITS2_RESERVED_LITTLE); - intern->index = ((ext->s_bits2[0] & SYM_BITS2_INDEX_LITTLE) - >> SYM_BITS2_INDEX_SH_LITTLE) - | (ext->s_bits3[0] << SYM_BITS3_INDEX_SH_LEFT_LITTLE) - | ((unsigned int) ext->s_bits4[0] - << SYM_BITS4_INDEX_SH_LEFT_LITTLE); - } +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) + if (intern->iss == (signed long) 0xffffffff) + intern->iss = -1; +#endif + + /* 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; + intern->sc = ((ext->s_bits1[0] & SYM_BITS1_SC_BIG) + << SYM_BITS1_SC_SH_LEFT_BIG) + | ((ext->s_bits2[0] & SYM_BITS2_SC_BIG) + >> SYM_BITS2_SC_SH_BIG); + intern->reserved = 0 != (ext->s_bits2[0] & SYM_BITS2_RESERVED_BIG); + intern->index = ((ext->s_bits2[0] & SYM_BITS2_INDEX_BIG) + << SYM_BITS2_INDEX_SH_LEFT_BIG) + | (ext->s_bits3[0] << SYM_BITS3_INDEX_SH_LEFT_BIG) + | (ext->s_bits4[0] << SYM_BITS4_INDEX_SH_LEFT_BIG); + } + else + { + intern->st = (ext->s_bits1[0] & SYM_BITS1_ST_LITTLE) + >> SYM_BITS1_ST_SH_LITTLE; + intern->sc = ((ext->s_bits1[0] & SYM_BITS1_SC_LITTLE) + >> SYM_BITS1_SC_SH_LITTLE) + | ((ext->s_bits2[0] & SYM_BITS2_SC_LITTLE) + << SYM_BITS2_SC_SH_LEFT_LITTLE); + intern->reserved = 0 != (ext->s_bits2[0] & SYM_BITS2_RESERVED_LITTLE); + intern->index = ((ext->s_bits2[0] & SYM_BITS2_INDEX_LITTLE) + >> SYM_BITS2_INDEX_SH_LITTLE) + | (ext->s_bits3[0] << SYM_BITS3_INDEX_SH_LEFT_LITTLE) + | ((unsigned int) ext->s_bits4[0] + << SYM_BITS4_INDEX_SH_LEFT_LITTLE); + } #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) @@ -578,37 +594,41 @@ ecoff_swap_sym_out (abfd, intern_copy, ext_ptr) struct sym_ext *ext = (struct sym_ext *) ext_ptr; SYMR intern[1]; - *intern = *intern_copy; /* Make it reasonable to do in-place. */ + /* Make it reasonable to do in-place. */ + *intern = *intern_copy; H_PUT_32 (abfd, intern->iss, ext->s_iss); ECOFF_PUT_OFF (abfd, intern->value, ext->s_value); - /* now the fun stuff... */ - if (bfd_header_big_endian (abfd)) { - ext->s_bits1[0] = (((intern->st << SYM_BITS1_ST_SH_BIG) - & SYM_BITS1_ST_BIG) - | ((intern->sc >> SYM_BITS1_SC_SH_LEFT_BIG) - & SYM_BITS1_SC_BIG)); - ext->s_bits2[0] = (((intern->sc << SYM_BITS2_SC_SH_BIG) - & SYM_BITS2_SC_BIG) - | (intern->reserved ? SYM_BITS2_RESERVED_BIG : 0) - | ((intern->index >> SYM_BITS2_INDEX_SH_LEFT_BIG) - & SYM_BITS2_INDEX_BIG)); - ext->s_bits3[0] = (intern->index >> SYM_BITS3_INDEX_SH_LEFT_BIG) & 0xff; - ext->s_bits4[0] = (intern->index >> SYM_BITS4_INDEX_SH_LEFT_BIG) & 0xff; - } else { - ext->s_bits1[0] = (((intern->st << SYM_BITS1_ST_SH_LITTLE) - & SYM_BITS1_ST_LITTLE) - | ((intern->sc << SYM_BITS1_SC_SH_LITTLE) - & SYM_BITS1_SC_LITTLE)); - ext->s_bits2[0] = (((intern->sc >> SYM_BITS2_SC_SH_LEFT_LITTLE) - & SYM_BITS2_SC_LITTLE) - | (intern->reserved ? SYM_BITS2_RESERVED_LITTLE : 0) - | ((intern->index << SYM_BITS2_INDEX_SH_LITTLE) - & SYM_BITS2_INDEX_LITTLE)); - ext->s_bits3[0] = (intern->index >> SYM_BITS3_INDEX_SH_LEFT_LITTLE) & 0xff; - ext->s_bits4[0] = (intern->index >> SYM_BITS4_INDEX_SH_LEFT_LITTLE) & 0xff; - } + /* 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) + | ((intern->sc >> SYM_BITS1_SC_SH_LEFT_BIG) + & SYM_BITS1_SC_BIG)); + ext->s_bits2[0] = (((intern->sc << SYM_BITS2_SC_SH_BIG) + & SYM_BITS2_SC_BIG) + | (intern->reserved ? SYM_BITS2_RESERVED_BIG : 0) + | ((intern->index >> SYM_BITS2_INDEX_SH_LEFT_BIG) + & SYM_BITS2_INDEX_BIG)); + ext->s_bits3[0] = (intern->index >> SYM_BITS3_INDEX_SH_LEFT_BIG) & 0xff; + ext->s_bits4[0] = (intern->index >> SYM_BITS4_INDEX_SH_LEFT_BIG) & 0xff; + } + else + { + ext->s_bits1[0] = (((intern->st << SYM_BITS1_ST_SH_LITTLE) + & SYM_BITS1_ST_LITTLE) + | ((intern->sc << SYM_BITS1_SC_SH_LITTLE) + & SYM_BITS1_SC_LITTLE)); + ext->s_bits2[0] = (((intern->sc >> SYM_BITS2_SC_SH_LEFT_LITTLE) + & SYM_BITS2_SC_LITTLE) + | (intern->reserved ? SYM_BITS2_RESERVED_LITTLE : 0) + | ((intern->index << SYM_BITS2_INDEX_SH_LITTLE) + & SYM_BITS2_INDEX_LITTLE)); + ext->s_bits3[0] = (intern->index >> SYM_BITS3_INDEX_SH_LEFT_LITTLE) & 0xff; + ext->s_bits4[0] = (intern->index >> SYM_BITS4_INDEX_SH_LEFT_LITTLE) & 0xff; + } #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) @@ -628,23 +648,26 @@ ecoff_swap_ext_in (abfd, ext_copy, intern) *ext = *(struct ext_ext *) ext_copy; - /* 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); - intern->weakext = 0 != (ext->es_bits1[0] & EXT_BITS1_WEAKEXT_BIG); - } else { - intern->jmptbl = 0 != (ext->es_bits1[0] & EXT_BITS1_JMPTBL_LITTLE); - intern->cobol_main = 0 != (ext->es_bits1[0] & EXT_BITS1_COBOL_MAIN_LITTLE); - intern->weakext = 0 != (ext->es_bits1[0] & EXT_BITS1_WEAKEXT_LITTLE); - } + /* 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); + intern->weakext = 0 != (ext->es_bits1[0] & EXT_BITS1_WEAKEXT_BIG); + } + else + { + intern->jmptbl = 0 != (ext->es_bits1[0] & EXT_BITS1_JMPTBL_LITTLE); + intern->cobol_main = 0 != (ext->es_bits1[0] & EXT_BITS1_COBOL_MAIN_LITTLE); + intern->weakext = 0 != (ext->es_bits1[0] & EXT_BITS1_WEAKEXT_LITTLE); + } intern->reserved = 0; #if defined (ECOFF_32) || defined (ECOFF_SIGNED_32) - intern->ifd = H_GET_S16 (abfd, ext->es_ifd); + intern->ifd = H_GET_S16 (abfd, ext->es_ifd); #endif #if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) - intern->ifd = H_GET_S32 (abfd, ext->es_ifd); + intern->ifd = H_GET_S32 (abfd, ext->es_ifd); #endif ecoff_swap_sym_in (abfd, &ext->es_asym, &intern->asym); @@ -666,28 +689,32 @@ ecoff_swap_ext_out (abfd, intern_copy, ext_ptr) struct ext_ext *ext = (struct ext_ext *) ext_ptr; EXTR intern[1]; - *intern = *intern_copy; /* Make it reasonable to do in-place. */ + /* Make it reasonable to do in-place. */ + *intern = *intern_copy; - /* 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; + /* 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; #if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) - ext->es_bits2[1] = 0; - ext->es_bits2[2] = 0; -#endif - } else { - ext->es_bits1[0] = ((intern->jmptbl ? EXT_BITS1_JMPTBL_LITTLE : 0) - | (intern->cobol_main ? EXT_BITS1_COBOL_MAIN_LITTLE : 0) - | (intern->weakext ? EXT_BITS1_WEAKEXT_LITTLE : 0)); - ext->es_bits2[0] = 0; + ext->es_bits2[1] = 0; + ext->es_bits2[2] = 0; +#endif + } + else + { + ext->es_bits1[0] = ((intern->jmptbl ? EXT_BITS1_JMPTBL_LITTLE : 0) + | (intern->cobol_main ? EXT_BITS1_COBOL_MAIN_LITTLE : 0) + | (intern->weakext ? EXT_BITS1_WEAKEXT_LITTLE : 0)); + ext->es_bits2[0] = 0; #if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) - ext->es_bits2[1] = 0; - ext->es_bits2[2] = 0; + ext->es_bits2[1] = 0; + ext->es_bits2[2] = 0; #endif - } + } #if defined (ECOFF_32) || defined (ECOFF_SIGNED_32) H_PUT_S16 (abfd, intern->ifd, ext->es_ifd); @@ -792,7 +819,8 @@ ecoff_swap_opt_out (abfd, intern_copy, ext_ptr) struct opt_ext *ext = (struct opt_ext *) ext_ptr; OPTR intern[1]; - *intern = *intern_copy; /* Make it reasonable to do in-place. */ + /* Make it reasonable to do in-place. */ + *intern = *intern_copy; if (bfd_header_big_endian (abfd)) { @@ -852,7 +880,8 @@ ecoff_swap_dnr_out (abfd, intern_copy, ext_ptr) struct dnr_ext *ext = (struct dnr_ext *) ext_ptr; DNR intern[1]; - *intern = *intern_copy; /* Make it reasonable to do in-place. */ + /* Make it reasonable to do in-place. */ + *intern = *intern_copy; H_PUT_32 (abfd, intern->rfd, ext->d_rfd); H_PUT_32 (abfd, intern->index, ext->d_index); diff --git a/contrib/binutils/bfd/efi-app-ia32.c b/contrib/binutils/bfd/efi-app-ia32.c index 8519f99..92a17ef 100644 --- a/contrib/binutils/bfd/efi-app-ia32.c +++ b/contrib/binutils/bfd/efi-app-ia32.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel IA-32 EFI application files. - Copyright 1999, 2000 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by David Mosberger This file is part of BFD, the Binary File Descriptor library. @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define TARGET_NAME "efi-app-ia32" #define COFF_IMAGE_WITH_PE #define COFF_WITH_PE -#define PCRELOFFSET true +#define PCRELOFFSET TRUE #define TARGET_UNDERSCORE '_' #define COFF_LONG_SECTION_NAMES #define PEI_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_APPLICATION diff --git a/contrib/binutils/bfd/efi-app-ia64.c b/contrib/binutils/bfd/efi-app-ia64.c index 6104568..c7e9bcf 100644 --- a/contrib/binutils/bfd/efi-app-ia64.c +++ b/contrib/binutils/bfd/efi-app-ia64.c @@ -1,5 +1,5 @@ /* BFD back-end for HP/Intel IA-64 EFI application files. - Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by David Mosberger This file is part of BFD, the Binary File Descriptor library. @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define COFF_IMAGE_WITH_PE #define COFF_WITH_PE #define COFF_WITH_pep -#define PCRELOFFSET true +#define PCRELOFFSET TRUE #define TARGET_UNDERSCORE '_' #define COFF_LONG_SECTION_NAMES #define PEI_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_APPLICATION diff --git a/contrib/binutils/bfd/elf-bfd.h b/contrib/binutils/bfd/elf-bfd.h index 9417623..110dd69 100644 --- a/contrib/binutils/bfd/elf-bfd.h +++ b/contrib/binutils/bfd/elf-bfd.h @@ -1,23 +1,23 @@ /* BFD back-end data structures for ELF files. Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002 Free Software Foundation, Inc. + 2002, 2003, 2004 Free Software Foundation, Inc. Written by Cygnus Support. -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. */ #ifndef _LIBELF_H_ #define _LIBELF_H_ 1 @@ -33,20 +33,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define NUM_SHDR_ENTRIES(shdr) ((shdr)->sh_size / (shdr)->sh_entsize) /* If size isn't specified as 64 or 32, NAME macro should fail. */ -/* Do not "beautify" the CONCAT* macro args. Traditional C will not - remove whitespace added here, and thus will fail to concatenate - the tokens. */ #ifndef NAME -#if ARCH_SIZE==64 -#define NAME(x,y) CONCAT4 (x,64,_,y) +#if ARCH_SIZE == 64 +#define NAME(x, y) x ## 64 ## _ ## y #endif -#if ARCH_SIZE==32 -#define NAME(x,y) CONCAT4 (x,32,_,y) +#if ARCH_SIZE == 32 +#define NAME(x, y) x ## 32 ## _ ## y #endif #endif #ifndef NAME -#define NAME(x,y) CONCAT4 (x,NOSIZE,_,y) +#define NAME(x, y) x ## NOSIZE ## _ ## y #endif #define ElfNAME(X) NAME(Elf,X) @@ -67,8 +64,8 @@ typedef struct union { unsigned int hppa_arg_reloc; - PTR mips_extr; - PTR any; + void *mips_extr; + void *any; } tc_data; @@ -80,6 +77,8 @@ typedef struct } elf_symbol_type; struct elf_strtab_hash; +struct got_entry; +struct plt_entry; /* ELF linker hash table entries. */ @@ -116,11 +115,6 @@ struct elf_link_hash_entry one. Otherwise it is NULL. */ struct elf_link_hash_entry *weakdef; - /* If this symbol is used in the linker created sections, the processor - specific backend uses this field to map the field into the offset - from the beginning of the section. */ - struct elf_linker_section_pointers *linker_section_pointer; - /* Version information. */ union { @@ -139,30 +133,30 @@ struct elf_link_hash_entry and track a size while the symbol is still undefined. It is indexed via offset/sizeof(target_void_pointer). */ size_t vtable_entries_size; - boolean *vtable_entries_used; + bfd_boolean *vtable_entries_used; /* Virtual table derivation info. */ struct elf_link_hash_entry *vtable_parent; /* If this symbol requires an entry in the global offset table, the processor specific backend uses this field to track usage and - final offset. We use a union and two names primarily to document - the intent of any particular piece of code. The field should be - used as a count until size_dynamic_sections, at which point the - contents of the .got is fixed. Afterward, if this field is -1, - then the symbol does not require a global offset table entry. */ - union + final offset. Two schemes are supported: The first assumes that + a symbol may only have one GOT entry, and uses REFCOUNT until + size_dynamic_sections, at which point the contents of the .got is + fixed. Afterward, if OFFSET is -1, then the symbol does not + require a global offset table entry. The second scheme allows + multiple GOT entries per symbol, managed via a linked list + pointed to by GLIST. */ + union gotplt_union { bfd_signed_vma refcount; bfd_vma offset; + struct got_entry *glist; + struct plt_entry *plist; } got; /* Same, but tracks a procedure linkage table entry. */ - union - { - bfd_signed_vma refcount; - bfd_vma offset; - } plt; + union gotplt_union plt; /* Symbol size. */ bfd_size_type size; @@ -202,8 +196,28 @@ struct elf_link_hash_entry /* Symbol is referenced by a non-GOT/non-PLT relocation. This is not currently set by all the backends. */ #define ELF_LINK_NON_GOT_REF 010000 + /* Symbol has a definition in a shared object. */ +#define ELF_LINK_DYNAMIC_DEF 020000 + /* Symbol is weak in all shared objects. */ +#define ELF_LINK_DYNAMIC_WEAK 040000 + /* Symbol is referenced with a relocation where C/C++ pointer equality + matters. */ +#define ELF_LINK_POINTER_EQUALITY_NEEDED 0100000 }; +/* Will references to this symbol always reference the symbol + in this object? STV_PROTECTED is excluded from the visibility test + here so that function pointer comparisons work properly. Since + function symbols not defined in an app are set to their .plt entry, + it's necessary for shared libs to also reference the .plt even + though the symbol is really local to the shared lib. */ +#define SYMBOL_REFERENCES_LOCAL(INFO, H) \ + _bfd_elf_symbol_refs_local_p (H, INFO, 0) + +/* Will _calls_ to this symbol always call the version in this object? */ +#define SYMBOL_CALLS_LOCAL(INFO, H) \ + _bfd_elf_symbol_refs_local_p (H, INFO, 1) + /* Records local symbols to be emitted in the dynamic symbol table. */ struct elf_link_local_dynamic_entry @@ -229,23 +243,73 @@ struct elf_link_loaded_list bfd *abfd; }; -enum elf_link_info_type +/* Structures used by the eh_frame optimization code. */ +struct cie_header { - ELF_INFO_TYPE_NONE, - ELF_INFO_TYPE_STABS, - ELF_INFO_TYPE_MERGE, - ELF_INFO_TYPE_EH_FRAME, - ELF_INFO_TYPE_EH_FRAME_HDR, - ELF_INFO_TYPE_JUST_SYMS, - ELF_INFO_TYPE_LAST + unsigned int length; + unsigned int id; }; -/* Cached start, size and alignment of PT_TLS segment. */ -struct elf_link_tls_segment +struct cie { - bfd_vma start; - bfd_size_type size; - unsigned int align; + struct cie_header hdr; + unsigned char version; + unsigned char augmentation[20]; + unsigned int code_align; + int data_align; + unsigned int ra_column; + unsigned int augmentation_size; + struct elf_link_hash_entry *personality; + unsigned char per_encoding; + unsigned char lsda_encoding; + unsigned char fde_encoding; + unsigned char initial_insn_length; + unsigned char make_relative; + unsigned char make_lsda_relative; + unsigned char initial_instructions[50]; +}; + +struct eh_cie_fde +{ + unsigned int offset; + unsigned int size; + asection *sec; + unsigned int new_offset; + unsigned char fde_encoding; + unsigned char lsda_encoding; + unsigned char lsda_offset; + unsigned char cie : 1; + unsigned char removed : 1; + unsigned char make_relative : 1; + unsigned char make_lsda_relative : 1; + unsigned char per_encoding_relative : 1; +}; + +struct eh_frame_sec_info +{ + unsigned int count; + unsigned int alloced; + struct eh_cie_fde entry[1]; +}; + +struct eh_frame_array_ent +{ + bfd_vma initial_loc; + bfd_vma fde; +}; + +struct eh_frame_hdr_info +{ + struct cie last_cie; + asection *last_cie_sec; + asection *hdr_sec; + unsigned int last_cie_offset; + unsigned int fde_count, array_count; + struct eh_frame_array_ent *array; + /* TRUE if .eh_frame_hdr should contain the sorted search table. + We build it if we successfully read all .eh_frame input sections + and recognize them. */ + bfd_boolean table; }; /* ELF linker hash table. */ @@ -256,7 +320,7 @@ struct elf_link_hash_table /* Whether we have created the special dynamic sections required when linking against or generating a shared object. */ - boolean dynamic_sections_created; + bfd_boolean dynamic_sections_created; /* The BFD used to hold special sections created by the linker. This will be the first BFD found which requires these sections to @@ -265,9 +329,13 @@ struct elf_link_hash_table /* The value to use when initialising got.refcount/offset and plt.refcount/offset in an elf_link_hash_entry. Set to zero when - the values are refcounts. Set to -1 in size_dynamic_sections - when the values may be offsets. */ - bfd_signed_vma init_refcount; + the values are refcounts. Set to init_offset in + size_dynamic_sections when the values may be offsets. */ + union gotplt_union init_refcount; + + /* The value to use for got.refcount/offset and plt.refcount/offset + when the values may be offsets. Normally (bfd_vma) -1. */ + union gotplt_union init_offset; /* The number of symbols found in the link which must be put into the .dynsym section. */ @@ -289,10 +357,13 @@ struct elf_link_hash_table struct elf_link_hash_entry *hgot; /* A pointer to information used to link stabs in sections. */ - PTR stab_info; + void *stab_info; /* A pointer to information used to merge SEC_MERGE sections. */ - PTR merge_info; + void *merge_info; + + /* Used by eh_frame code when editing .eh_frame. */ + struct eh_frame_hdr_info eh_info; /* A linked list of local symbols to be added to .dynsym. */ struct elf_link_local_dynamic_entry *dynlocal; @@ -301,8 +372,9 @@ struct elf_link_hash_table objects included in the link. */ struct bfd_link_needed_list *runpath; - /* Cached start, size and alignment of PT_TLS segment. */ - struct elf_link_tls_segment *tls_segment; + /* Cached first output tls section and size of PT_TLS segment. */ + asection *tls_sec; + bfd_size_type tls_size; /* A linked list of BFD's loaded in the link. */ struct elf_link_loaded_list *loaded; @@ -320,16 +392,16 @@ struct elf_link_hash_table #define elf_link_hash_traverse(table, func, info) \ (bfd_link_hash_traverse \ (&(table)->root, \ - (boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) (struct bfd_link_hash_entry *, void *)) (func), \ (info))) /* Get the ELF linker hash table from a link_info structure. */ #define elf_hash_table(p) ((struct elf_link_hash_table *) ((p)->hash)) -/* Returns true if the hash table is a struct elf_link_hash_table. */ -#define is_elf_hash_table(p) \ - ((p)->hash->type == bfd_link_elf_hash_table) +/* Returns TRUE if the hash table is a struct elf_link_hash_table. */ +#define is_elf_hash_table(htab) \ + (((struct bfd_link_hash_table *) (htab))->type == bfd_link_elf_hash_table) /* Used by bfd_section_from_r_symndx to cache a small number of local symbol to section mappings. */ @@ -353,52 +425,50 @@ struct elf_size_info { /* The number of internal relocations to allocate per external relocation entry. */ unsigned char int_rels_per_ext_rel; + /* We use some fixed size arrays. This should be large enough to + handle all back-ends. */ +#define MAX_INT_RELS_PER_EXT_REL 3 - unsigned char arch_size, file_align; + unsigned char arch_size, log_file_align; unsigned char elfclass, ev_current; int (*write_out_phdrs) - PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int)); - boolean (*write_shdrs_and_ehdr) - PARAMS ((bfd *)); + (bfd *, const Elf_Internal_Phdr *, unsigned int); + bfd_boolean + (*write_shdrs_and_ehdr) (bfd *); void (*write_relocs) - PARAMS ((bfd *, asection *, PTR)); + (bfd *, asection *, void *); void (*swap_symbol_in) - PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *)); + (bfd *, const void *, const void *, Elf_Internal_Sym *); void (*swap_symbol_out) - PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); - boolean (*slurp_reloc_table) - PARAMS ((bfd *, asection *, asymbol **, boolean)); + (bfd *, const Elf_Internal_Sym *, void *, void *); + bfd_boolean (*slurp_reloc_table) + (bfd *, asection *, asymbol **, bfd_boolean); long (*slurp_symbol_table) - PARAMS ((bfd *, asymbol **, boolean)); + (bfd *, asymbol **, bfd_boolean); void (*swap_dyn_in) - PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *)); + (bfd *, const void *, Elf_Internal_Dyn *); void (*swap_dyn_out) - PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR)); + (bfd *, const Elf_Internal_Dyn *, void *); - /* This function, if defined, is called to swap in a REL - relocation. If an external relocation corresponds to more than - one internal relocation, then all relocations are swapped in at - once. */ + /* This function is called to swap in a REL relocation. If an + external relocation corresponds to more than one internal + relocation, then all relocations are swapped in at once. */ void (*swap_reloc_in) - PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rel *)); + (bfd *, const bfd_byte *, Elf_Internal_Rela *); - /* This function, if defined, is called to swap out a REL - relocation. */ + /* This function is called to swap out a REL relocation. */ void (*swap_reloc_out) - PARAMS ((bfd *, const Elf_Internal_Rel *, bfd_byte *)); + (bfd *, const Elf_Internal_Rela *, bfd_byte *); - /* This function, if defined, is called to swap in a RELA - relocation. If an external relocation corresponds to more than - one internal relocation, then all relocations are swapped in at - once. */ + /* This function is called to swap in a RELA relocation. If an + external relocation corresponds to more than one internal + relocation, then all relocations are swapped in at once. */ void (*swap_reloca_in) - PARAMS ((bfd *, const bfd_byte *, Elf_Internal_Rela *)); + (bfd *, const bfd_byte *, Elf_Internal_Rela *); - /* This function, if defined, is called to swap out a RELA - relocation. */ + /* This function is called to swap out a RELA relocation. */ void (*swap_reloca_out) - PARAMS ((bfd *, const Elf_Internal_Rela *, bfd_byte *)); - + (bfd *, const Elf_Internal_Rela *, bfd_byte *); }; #define elf_symbol_from(ABFD,S) \ @@ -422,7 +492,8 @@ struct elf_reloc_cookie size_t locsymcount; size_t extsymoff; struct elf_link_hash_entry **sym_hashes; - boolean bad_symtab; + int r_sym_shift; + bfd_boolean bad_symtab; }; /* The level of IRIX compatibility we're striving for. */ @@ -433,6 +504,22 @@ typedef enum { ict_irix6 } irix_compat_t; +/* Mapping of ELF section names and types. */ +struct bfd_elf_special_section +{ + const char *prefix; + int prefix_length; + /* 0 means name must match PREFIX exactly. + -1 means name must start with PREFIX followed by an arbitrary string. + -2 means name must match PREFIX exactly or consist of PREFIX followed + by a dot then anything. + > 0 means name must start with the first PREFIX_LENGTH chars of + PREFIX and finish with the last SUFFIX_LENGTH chars of PREFIX. */ + int suffix_length; + int type; + int attr; +}; + struct elf_backend_data { /* The architecture for this backend. */ @@ -447,20 +534,20 @@ struct elf_backend_data /* A function to translate an ELF RELA relocation to a BFD arelent structure. */ void (*elf_info_to_howto) - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); + (bfd *, arelent *, Elf_Internal_Rela *); /* A function to translate an ELF REL relocation to a BFD arelent structure. */ void (*elf_info_to_howto_rel) - PARAMS ((bfd *, arelent *, Elf_Internal_Rel *)); + (bfd *, arelent *, Elf_Internal_Rela *); /* A function to determine whether a symbol is global when partitioning the symbol table into local and global symbols. This should be NULL for most targets, in which case the correct thing will be done. MIPS ELF, at least on the Irix 5, has special requirements. */ - boolean (*elf_backend_sym_is_global) - PARAMS ((bfd *, asymbol *)); + bfd_boolean (*elf_backend_sym_is_global) + (bfd *, asymbol *); /* The remaining functions are hooks which are called only if they are not NULL. */ @@ -469,61 +556,66 @@ struct elf_backend_data particular BFD format is relevant for an object file, and to permit the backend to set any global information it wishes. When this is called elf_elfheader is set, but anything else should be - used with caution. If this returns false, the check_format + used with caution. If this returns FALSE, the check_format routine will return a bfd_error_wrong_format error. */ - boolean (*elf_backend_object_p) - PARAMS ((bfd *)); + bfd_boolean (*elf_backend_object_p) + (bfd *); /* A function to do additional symbol processing when reading the ELF symbol table. This is where any processor-specific special section indices are handled. */ void (*elf_backend_symbol_processing) - PARAMS ((bfd *, asymbol *)); + (bfd *, asymbol *); /* A function to do additional symbol processing after reading the entire ELF symbol table. */ - boolean (*elf_backend_symbol_table_processing) - PARAMS ((bfd *, elf_symbol_type *, unsigned int)); + bfd_boolean (*elf_backend_symbol_table_processing) + (bfd *, elf_symbol_type *, unsigned int); /* A function to set the type of the info field. Processor-specific types should be handled here. */ int (*elf_backend_get_symbol_type) - PARAMS (( Elf_Internal_Sym *, int)); + (Elf_Internal_Sym *, int); + + /* Return true if local section symbols should have a non-null st_name. + NULL implies false. */ + bfd_boolean (*elf_backend_name_local_section_symbols) + (bfd *); /* A function to do additional processing on the ELF section header just before writing it out. This is used to set the flags and type fields for some sections, or to actually write out data for unusual sections. */ - boolean (*elf_backend_section_processing) - PARAMS ((bfd *, Elf32_Internal_Shdr *)); + bfd_boolean (*elf_backend_section_processing) + (bfd *, Elf_Internal_Shdr *); /* A function to handle unusual section types when creating BFD sections from ELF sections. */ - boolean (*elf_backend_section_from_shdr) - PARAMS ((bfd *, Elf32_Internal_Shdr *, const char *)); + bfd_boolean (*elf_backend_section_from_shdr) + (bfd *, Elf_Internal_Shdr *, const 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 *)); + bfd_boolean (*elf_backend_section_flags) + (flagword *, Elf_Internal_Shdr *); /* A function to handle unusual program segment types when creating BFD sections from ELF program segments. */ - boolean (*elf_backend_section_from_phdr) - PARAMS ((bfd *, Elf32_Internal_Phdr *, int)); + bfd_boolean (*elf_backend_section_from_phdr) + (bfd *, Elf_Internal_Phdr *, int); /* A function to set up the ELF section header for a BFD section in preparation for writing it out. This is where the flags and type fields are set for unusual sections. */ - boolean (*elf_backend_fake_sections) - PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); + bfd_boolean (*elf_backend_fake_sections) + (bfd *, Elf_Internal_Shdr *, asection *); /* A function to get the ELF section index for a BFD section. If - this returns true, the section was found. If it is a normal ELF + this returns TRUE, the section was found. If it is a normal ELF section, *RETVAL should be left unchanged. If it is not a normal ELF section *RETVAL should be set to the SHN_xxxx index. */ - boolean (*elf_backend_section_from_bfd_section) - PARAMS ((bfd *, asection *, int *retval)); + bfd_boolean (*elf_backend_section_from_bfd_section) + (bfd *, asection *, int *retval); /* If this field is not NULL, it is called by the add_symbols phase of a link just before adding a symbol to the global linker hash @@ -533,16 +625,15 @@ struct elf_backend_data handling all processor dependent symbol bindings and section indices, and must set at least *FLAGS and *SEC for each processor dependent case; failure to do so will cause a link error. */ - boolean (*elf_add_symbol_hook) - PARAMS ((bfd *abfd, struct bfd_link_info *info, - const Elf_Internal_Sym *, const char **name, - flagword *flags, asection **sec, bfd_vma *value)); + bfd_boolean (*elf_add_symbol_hook) + (bfd *abfd, struct bfd_link_info *info, Elf_Internal_Sym *, + const char **name, flagword *flags, asection **sec, bfd_vma *value); /* If this field is not NULL, it is called by the elf_link_output_sym phase of a link for each symbol which will appear in the object file. */ - boolean (*elf_backend_link_output_symbol_hook) - PARAMS ((bfd *, struct bfd_link_info *info, const char *, - Elf_Internal_Sym *, asection *)); + bfd_boolean (*elf_backend_link_output_symbol_hook) + (struct bfd_link_info *info, const char *, Elf_Internal_Sym *, + asection *, struct elf_link_hash_entry *); /* The CREATE_DYNAMIC_SECTIONS function is called by the ELF backend linker the first time it encounters a dynamic object in the link. @@ -552,8 +643,8 @@ struct elf_backend_data created, and this function may modify the section flags if desired. This function will normally create the .got and .plt sections, but different backends have different requirements. */ - boolean (*elf_backend_create_dynamic_sections) - PARAMS ((bfd *abfd, struct bfd_link_info *info)); + bfd_boolean (*elf_backend_create_dynamic_sections) + (bfd *abfd, struct bfd_link_info *info); /* The CHECK_RELOCS function is called by the add_symbols phase of the ELF backend linker. It is called once for each section with @@ -565,9 +656,9 @@ struct elf_backend_data relocs are always passed as Rela structures; if the section actually uses Rel structures, the r_addend field will always be zero. */ - boolean (*check_relocs) - PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o, - const Elf_Internal_Rela *relocs)); + bfd_boolean (*check_relocs) + (bfd *abfd, struct bfd_link_info *info, asection *o, + const Elf_Internal_Rela *relocs); /* The ADJUST_DYNAMIC_SYMBOL function is called by the ELF backend linker for every symbol which is defined by a dynamic object and @@ -581,15 +672,15 @@ struct elf_backend_data the link can deal with. This will normally involve adding an entry to the .plt or .got or some such section, and setting the symbol to point to that. */ - boolean (*elf_backend_adjust_dynamic_symbol) - PARAMS ((struct bfd_link_info *info, struct elf_link_hash_entry *h)); + bfd_boolean (*elf_backend_adjust_dynamic_symbol) + (struct bfd_link_info *info, struct elf_link_hash_entry *h); /* The ALWAYS_SIZE_SECTIONS function is called by the backend linker after all the linker input files have been seen but before the section sizes have been set. This is called after ADJUST_DYNAMIC_SYMBOL, but before SIZE_DYNAMIC_SECTIONS. */ - boolean (*elf_backend_always_size_sections) - PARAMS ((bfd *output_bfd, struct bfd_link_info *info)); + bfd_boolean (*elf_backend_always_size_sections) + (bfd *output_bfd, struct bfd_link_info *info); /* The SIZE_DYNAMIC_SECTIONS function is called by the ELF backend linker after all the linker input files have been seen but before @@ -601,8 +692,8 @@ struct elf_backend_data .dynstr and .hash sections. This function must handle the .interp section and any sections created by the CREATE_DYNAMIC_SECTIONS entry point. */ - boolean (*elf_backend_size_dynamic_sections) - PARAMS ((bfd *output_bfd, struct bfd_link_info *info)); + bfd_boolean (*elf_backend_size_dynamic_sections) + (bfd *output_bfd, struct bfd_link_info *info); /* The RELOCATE_SECTION function is called by the ELF backend linker to handle the relocations for a section. @@ -613,7 +704,7 @@ struct elf_backend_data This function is responsible for adjust the section contents as necessary, and (if using Rela relocs and generating a - relocateable output file) adjusting the reloc addend as + relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -627,16 +718,15 @@ struct elf_backend_data 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 + When generating relocatable 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. */ - boolean (*elf_backend_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)); + bfd_boolean (*elf_backend_relocate_section) + (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); /* The FINISH_DYNAMIC_SYMBOL function is called by the ELF backend linker just before it writes a symbol out to the .dynsym section. @@ -645,71 +735,72 @@ struct elf_backend_data dynamic sections. Note that FINISH_DYNAMIC_SYMBOL is called on all .dynsym symbols, while ADJUST_DYNAMIC_SYMBOL is only called on those symbols which are defined by a dynamic object. */ - boolean (*elf_backend_finish_dynamic_symbol) - PARAMS ((bfd *output_bfd, struct bfd_link_info *info, - struct elf_link_hash_entry *h, Elf_Internal_Sym *sym)); + bfd_boolean (*elf_backend_finish_dynamic_symbol) + (bfd *output_bfd, struct bfd_link_info *info, + struct elf_link_hash_entry *h, Elf_Internal_Sym *sym); /* The FINISH_DYNAMIC_SECTIONS function is called by the ELF backend linker just before it writes all the dynamic sections out to the output file. The FINISH_DYNAMIC_SYMBOL will have been called on all dynamic symbols. */ - boolean (*elf_backend_finish_dynamic_sections) - PARAMS ((bfd *output_bfd, struct bfd_link_info *info)); + bfd_boolean (*elf_backend_finish_dynamic_sections) + (bfd *output_bfd, struct bfd_link_info *info); /* A function to do any beginning processing needed for the ELF file before building the ELF headers and computing file positions. */ void (*elf_backend_begin_write_processing) - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); /* A function to do any final processing needed for the ELF file - before writing it out. The LINKER argument is true if this BFD + before writing it out. The LINKER argument is TRUE if this BFD was created by the ELF backend linker. */ void (*elf_backend_final_write_processing) - PARAMS ((bfd *, boolean linker)); + (bfd *, bfd_boolean linker); /* This function is called by get_program_header_size. It should return the number of additional program segments which this BFD will need. It should return -1 on error. */ int (*elf_backend_additional_program_headers) - PARAMS ((bfd *)); + (bfd *); /* This function is called to modify an existing segment map in a backend specific fashion. */ - boolean (*elf_backend_modify_segment_map) - PARAMS ((bfd *)); + bfd_boolean (*elf_backend_modify_segment_map) + (bfd *, struct bfd_link_info *); /* This function is called during section gc to discover the section a particular relocation refers to. */ asection * (*gc_mark_hook) - PARAMS ((asection *sec, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *h, Elf_Internal_Sym *)); + (asection *sec, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *h, Elf_Internal_Sym *); /* This function, if defined, is called during the sweep phase of gc in order that a backend might update any data structures it might be maintaining. */ - boolean (*gc_sweep_hook) - PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *o, - const Elf_Internal_Rela *relocs)); + bfd_boolean (*gc_sweep_hook) + (bfd *abfd, struct bfd_link_info *info, asection *o, + const Elf_Internal_Rela *relocs); /* This function, if defined, is called after the ELF headers have been created. This allows for things like the OS and ABI versions to be changed. */ void (*elf_backend_post_process_headers) - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); /* This function, if defined, prints a symbol to file and returns the name of the symbol to be printed. It should return NULL to fall back to default symbol printing. */ const char *(*elf_backend_print_symbol_all) - PARAMS ((bfd *, PTR, asymbol *)); + (bfd *, void *, asymbol *); /* This function, if defined, is called after all local symbols and - global symbols converted to locals are emited into the symtab + global symbols converted to locals are emitted into the symtab section. It allows the backend to emit special global symbols not handled in the hash table. */ - boolean (*elf_backend_output_arch_syms) - PARAMS ((bfd *, struct bfd_link_info *, PTR, - boolean (*) (PTR, const char *, Elf_Internal_Sym *, asection *))); + bfd_boolean (*elf_backend_output_arch_syms) + (bfd *, struct bfd_link_info *, void *, + bfd_boolean (*) (void *, const char *, Elf_Internal_Sym *, asection *, + struct elf_link_hash_entry *)); /* Copy any information related to dynamic linking from a pre-existing symbol to a newly created symbol. Also called to copy flags and @@ -717,94 +808,125 @@ struct elf_backend_data newly created and plt/got refcounts and dynamic indices should not be copied. */ void (*elf_backend_copy_indirect_symbol) - PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, - struct elf_link_hash_entry *)); + (const struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *); /* Modify any information related to dynamic linking such that the symbol is not exported. */ void (*elf_backend_hide_symbol) - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); + (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean); + + /* Merge the backend specific symbol attribute. */ + void (*elf_backend_merge_symbol_attribute) + (struct elf_link_hash_entry *, const Elf_Internal_Sym *, bfd_boolean, + bfd_boolean); /* Emit relocations. Overrides default routine for emitting relocs, except during a relocatable link, or if all relocs are being emitted. */ - boolean (*elf_backend_emit_relocs) - PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *)); + bfd_boolean (*elf_backend_emit_relocs) + (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *); /* Count relocations. Not called for relocatable links or if all relocs are being preserved in the output. */ unsigned int (*elf_backend_count_relocs) - PARAMS ((asection *, Elf_Internal_Rela *)); + (asection *, Elf_Internal_Rela *); /* This function, if defined, is called when an NT_PRSTATUS note is found in a core file. */ - boolean (*elf_backend_grok_prstatus) - PARAMS ((bfd *, Elf_Internal_Note *)); + bfd_boolean (*elf_backend_grok_prstatus) + (bfd *, Elf_Internal_Note *); /* This function, if defined, is called when an NT_PSINFO or NT_PRPSINFO note is found in a core file. */ - boolean (*elf_backend_grok_psinfo) - PARAMS ((bfd *, Elf_Internal_Note *)); + bfd_boolean (*elf_backend_grok_psinfo) + (bfd *, Elf_Internal_Note *); /* Functions to print VMAs. Special code to handle 64 bit ELF files. */ void (* elf_backend_sprintf_vma) - PARAMS ((bfd *, char *, bfd_vma)); + (bfd *, char *, bfd_vma); void (* elf_backend_fprintf_vma) - PARAMS ((bfd *, PTR, bfd_vma)); + (bfd *, void *, bfd_vma); /* This function returns class of a reloc type. */ enum elf_reloc_type_class (*elf_backend_reloc_type_class) - PARAMS ((const Elf_Internal_Rela *)); + (const Elf_Internal_Rela *); /* This function, if defined, removes information about discarded functions from other sections which mention them. */ - boolean (*elf_backend_discard_info) - PARAMS ((bfd *, struct elf_reloc_cookie *, struct bfd_link_info *)); + bfd_boolean (*elf_backend_discard_info) + (bfd *, struct elf_reloc_cookie *, struct bfd_link_info *); /* This function, if defined, signals that the function above has removed the discarded relocations for this section. */ - boolean (*elf_backend_ignore_discarded_relocs) - PARAMS ((asection *)); + bfd_boolean (*elf_backend_ignore_discarded_relocs) + (asection *); + + /* These functions tell elf-eh-frame whether to attempt to turn + absolute or lsda encodings into pc-relative ones. The default + definition enables these transformations. */ + bfd_boolean (*elf_backend_can_make_relative_eh_frame) + (bfd *, struct bfd_link_info *, asection *); + bfd_boolean (*elf_backend_can_make_lsda_relative_eh_frame) + (bfd *, struct bfd_link_info *, asection *); + + /* This function returns an encoding after computing the encoded + value (and storing it in ENCODED) for the given OFFSET into OSEC, + to be stored in at LOC_OFFSET into the LOC_SEC input section. + The default definition chooses a 32-bit PC-relative encoding. */ + bfd_byte (*elf_backend_encode_eh_address) + (bfd *abfd, struct bfd_link_info *info, + asection *osec, bfd_vma offset, + asection *loc_sec, bfd_vma loc_offset, + bfd_vma *encoded); /* This function, if defined, may write out the given section. - Returns true if it did so and false if the caller should. */ - boolean (*elf_backend_write_section) - PARAMS ((bfd *, asection *, bfd_byte *)); + Returns TRUE if it did so and FALSE if the caller should. */ + bfd_boolean (*elf_backend_write_section) + (bfd *, asection *, bfd_byte *); /* The level of IRIX compatibility we're striving for. MIPS ELF specific function. */ irix_compat_t (*elf_backend_mips_irix_compat) - PARAMS ((bfd *)); + (bfd *); reloc_howto_type *(*elf_backend_mips_rtype_to_howto) - PARAMS ((unsigned int, boolean)); + (unsigned int, bfd_boolean); /* The swapping table to use when dealing with ECOFF information. Used for the MIPS ELF .mdebug section. */ const struct ecoff_debug_swap *elf_backend_ecoff_debug_swap; + /* This function implements `bfd_elf_bfd_from_remote_memory'; + see elf.c, elfcode.h. */ + bfd *(*elf_backend_bfd_from_remote_memory) + (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma vma, char *myaddr, int len)); + /* Alternate EM_xxxx machine codes for this backend. */ int elf_machine_alt1; int elf_machine_alt2; const struct elf_size_info *s; + /* An array of target specific special section map. */ + const struct bfd_elf_special_section *special_sections; + /* offset of the _GLOBAL_OFFSET_TABLE_ symbol from the start of the .got section */ bfd_vma got_symbol_offset; - /* The size in bytes of the headers for the GOT and PLT. This includes - the so-called reserved entries on some systems. */ + /* The size in bytes of the header for the GOT. This includes the + so-called reserved entries on some systems. */ bfd_vma got_header_size; - bfd_vma plt_header_size; - /* This is true if the linker should act like collect and gather - global constructors and destructors by name. This is true for + /* This is TRUE if the linker should act like collect and gather + global constructors and destructors by name. This is TRUE for MIPS ELF because the Irix 5 tools can not handle the .init section. */ unsigned collect : 1; - /* This is true if the linker should ignore changes to the type of a - symbol. This is true for MIPS ELF because some Irix 5 objects + /* This is TRUE if the linker should ignore changes to the type of a + symbol. This is TRUE for MIPS ELF because some Irix 5 objects record undefined functions as STT_OBJECT although the definitions are STT_FUNC. */ unsigned type_change_ok : 1; @@ -831,7 +953,7 @@ struct elf_backend_data backend relocate_section routine for relocatable linking. */ unsigned rela_normal : 1; - /* True if addresses "naturally" sign extend. This is used when + /* TRUE if addresses "naturally" sign extend. This is used when swapping in from Elf32 when BFD64. */ unsigned sign_extend_vma : 1; @@ -872,13 +994,6 @@ struct bfd_elf_section_data /* The number of relocations currently assigned to REL_HDR2. */ unsigned int rel_count2; - /* A pointer to a linked list tracking dynamic relocs copied for - local symbols. */ - PTR local_dynrel; - - /* A pointer to the bfd section used for dynamic relocs. */ - asection *sreloc; - /* The ELF section number of this section. Only used for an output file. */ int this_idx; @@ -891,6 +1006,12 @@ struct bfd_elf_section_data REL_HDR2 if any. Only used for an output file. */ int rel_idx2; + /* Used by the backend linker when generating a shared library to + record the dynamic symbol index for a section symbol + corresponding to this section. A value of 0 means that there is + no dynamic symbol for this section. */ + int dynindx; + /* Used by the backend linker to store the symbol hash table entries associated with relocs against global symbols. */ struct elf_link_hash_entry **rel_hashes; @@ -900,101 +1021,85 @@ struct bfd_elf_section_data pointer may be NULL. It is used by the backend linker. */ Elf_Internal_Rela *relocs; - /* Used by the backend linker when generating a shared library to - record the dynamic symbol index for a section symbol - corresponding to this section. A value of 0 means that there is - no dynamic symbol for this section. */ - long dynindx; - - /* A pointer used for various section optimizations. */ - PTR sec_info; + /* A pointer to a linked list tracking dynamic relocs copied for + local symbols. */ + void *local_dynrel; - /* Type of that information. */ - enum elf_link_info_type sec_info_type; + /* A pointer to the bfd section used for dynamic relocs. */ + asection *sreloc; union { /* Group name, if this section is a member of a group. */ const char *name; /* Group signature sym, if this is the SHT_GROUP section. */ - struct symbol_cache_entry *id; + struct bfd_symbol *id; } group; /* A linked list of sections in the group. Circular when used by the linker. */ asection *next_in_group; - /* A pointer available for the processor specific ELF backend. */ - PTR tdata; - - /* Nonzero if this section uses RELA relocations, rather than REL. */ - unsigned int use_rela_p:1; - - /* Nonzero when a group is COMDAT. */ - unsigned int linkonce_p:1; + /* A pointer used for various section optimizations. */ + void *sec_info; }; #define elf_section_data(sec) ((struct bfd_elf_section_data*)sec->used_by_bfd) +#define elf_section_type(sec) (elf_section_data(sec)->this_hdr.sh_type) +#define elf_section_flags(sec) (elf_section_data(sec)->this_hdr.sh_flags) #define elf_group_name(sec) (elf_section_data(sec)->group.name) #define elf_group_id(sec) (elf_section_data(sec)->group.id) #define elf_next_in_group(sec) (elf_section_data(sec)->next_in_group) -#define elf_linkonce_p(sec) (elf_section_data(sec)->linkonce_p) -/* Return true if section has been discarded. */ -#define elf_discarded_section(sec) \ - (!bfd_is_abs_section(sec) \ - && bfd_is_abs_section((sec)->output_section) \ - && elf_section_data (sec)->sec_info_type != ELF_INFO_TYPE_MERGE \ - && elf_section_data (sec)->sec_info_type != ELF_INFO_TYPE_JUST_SYMS) +/* Return TRUE if section has been discarded. */ +#define elf_discarded_section(sec) \ + (!bfd_is_abs_section (sec) \ + && bfd_is_abs_section ((sec)->output_section) \ + && sec->sec_info_type != ELF_INFO_TYPE_MERGE \ + && sec->sec_info_type != ELF_INFO_TYPE_JUST_SYMS) #define get_elf_backend_data(abfd) \ - ((struct elf_backend_data *) (abfd)->xvec->backend_data) + ((const struct elf_backend_data *) (abfd)->xvec->backend_data) -/* Enumeration to specify the special section. */ -typedef enum elf_linker_section_enum +/* This struct is used to pass information to routines called via + elf_link_hash_traverse which must return failure. */ + +struct elf_info_failed { - LINKER_SECTION_UNKNOWN, /* not used */ - LINKER_SECTION_GOT, /* .got section for global offset pointers */ - LINKER_SECTION_PLT, /* .plt section for generated procedure stubs */ - LINKER_SECTION_SDATA, /* .sdata/.sbss section for PowerPC */ - LINKER_SECTION_SDATA2, /* .sdata2/.sbss2 section for PowerPC */ - LINKER_SECTION_MAX /* # of linker sections */ -} elf_linker_section_enum_t; + bfd_boolean failed; + struct bfd_link_info *info; + struct bfd_elf_version_tree *verdefs; +}; -/* Sections created by the linker. */ +/* This structure is used to pass information to + _bfd_elf_link_assign_sym_version. */ -typedef struct elf_linker_section +struct elf_assign_sym_version_info { - char *name; /* name of the section */ - char *rel_name; /* name of the associated .rel{,a}. section */ - char *bss_name; /* name of a related .bss section */ - char *sym_name; /* name of symbol to reference this section */ - asection *section; /* pointer to the section */ - asection *bss_section; /* pointer to the bss section associated with this */ - asection *rel_section; /* pointer to the relocations needed for this section */ - struct elf_link_hash_entry *sym_hash; /* pointer to the created symbol hash value */ - bfd_vma initial_size; /* initial size before any linker generated allocations */ - bfd_vma sym_offset; /* offset of symbol from beginning of section */ - bfd_vma hole_size; /* size of reserved address hole in allocation */ - bfd_vma hole_offset; /* current offset for the hole */ - bfd_vma max_hole_offset; /* maximum offset for the hole */ - elf_linker_section_enum_t which; /* which section this is */ - boolean hole_written_p; /* whether the hole has been initialized */ - unsigned int alignment; /* alignment for the section */ - flagword flags; /* flags to use to create the section */ -} elf_linker_section_t; - -/* Linked list of allocated pointer entries. This hangs off of the symbol lists, and - provides allows us to return different pointers, based on different addend's. */ - -typedef struct elf_linker_section_pointers + /* Output BFD. */ + bfd *output_bfd; + /* General link information. */ + struct bfd_link_info *info; + /* Version tree. */ + struct bfd_elf_version_tree *verdefs; + /* Whether we had a failure. */ + bfd_boolean failed; +}; + +/* This structure is used to pass information to + _bfd_elf_link_find_version_dependencies. */ + +struct elf_find_verdep_info { - struct elf_linker_section_pointers *next; /* next allocated pointer for this symbol */ - bfd_vma offset; /* offset of pointer from beginning of section */ - bfd_vma addend; /* addend used */ - elf_linker_section_enum_t which; /* which linker section this is */ - boolean written_address_p; /* whether address was written yet */ -} elf_linker_section_pointers_t; + /* Output BFD. */ + bfd *output_bfd; + /* General link information. */ + struct bfd_link_info *info; + /* The number of dependencies. */ + unsigned int vers; + /* Whether we had a failure. */ + bfd_boolean failed; +}; /* Some private data is stashed away for future use using the tdata pointer in the bfd structure. */ @@ -1025,18 +1130,9 @@ struct elf_obj_tdata unsigned int symtab_shndx_section; unsigned int dynversym_section, dynverdef_section, dynverref_section; file_ptr next_file_pos; -#if 0 - /* we don't need these inside bfd anymore, and I think - 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 */ unsigned int gp_size; /* The gp size */ - Elf_Internal_Shdr **group_sect_ptr; - int num_group; - /* Information grabbed from an elf core file. */ int core_signal; int core_pid; @@ -1044,32 +1140,21 @@ struct elf_obj_tdata char* core_program; char* core_command; - /* This is set to true if the object was created by the backend - linker. */ - boolean linker; - /* A mapping from external symbols to entries in the linker hash table, used when linking. This is indexed by the symbol index minus the sh_info field of the symbol table header. */ struct elf_link_hash_entry **sym_hashes; - /* A mapping from local symbols to offsets into the global offset - table, used when linking. This is indexed by the symbol index. - Like for the globals, we use a union and two names primarily to - document the intent of any particular piece of code. The field - should be used as a count until size_dynamic_sections, at which - point the contents of the .got is fixed. Afterward, if an entry - is -1, then the symbol does not require a global offset table entry. */ + /* Track usage and final offsets of GOT entries for local symbols. + This array is indexed by symbol index. Elements are used + identically to "got" in struct elf_link_hash_entry. */ union { bfd_signed_vma *refcounts; bfd_vma *offsets; + struct got_entry **ents; } local_got; - /* A mapping from local symbols to offsets into the various linker - sections added. This is index by the symbol index. */ - elf_linker_section_pointers_t **linker_section_pointers; - /* The linker ELF emulation code needs to let the backend ELF linker know what filename should be used for a dynamic object if the dynamic object is found using a search. The emulation code then @@ -1080,26 +1165,11 @@ 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 - sh_info field in the symbol table header, and always read all the - symbols. */ - boolean bad_symtab; - /* Records the result of `get_program_header_size'. */ bfd_size_type program_header_size; /* Used by find_nearest_line entry point. */ - PTR line_info; + void *line_info; /* Used by MIPS ELF find_nearest_line entry point. The structure could be included directly in this one, but there's no point to @@ -1111,19 +1181,19 @@ struct elf_obj_tdata struct dwarf1_debug *dwarf1_find_line_info; /* A place to stash dwarf2 info for this bfd. */ - PTR dwarf2_find_line_info; + void *dwarf2_find_line_info; /* An array of stub sections indexed by symbol number, used by the MIPS ELF linker. FIXME: We should figure out some way to only include this field for a MIPS ELF target. */ asection **local_stubs; - /* Used to determine if the e_flags field has been initialized */ - boolean flags_init; - /* Used to determine if PT_GNU_EH_FRAME segment header should be created. */ - boolean eh_frame_hdr; + asection *eh_frame_hdr; + + Elf_Internal_Shdr **group_sect_ptr; + int num_group; /* Number of symbol version definitions we are about to emit. */ unsigned int cverdefs; @@ -1131,21 +1201,40 @@ struct elf_obj_tdata /* Number of symbol version references we are about to emit. */ unsigned int cverrefs; + /* Segment flags for the PT_GNU_STACK segment. */ + unsigned int stack_flags; + /* Symbol version definitions in external objects. */ Elf_Internal_Verdef *verdef; /* Symbol version references to external objects. */ Elf_Internal_Verneed *verref; - /* 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; + + /* Whether a dyanmic object was specified normally on the linker + command line, or was specified when --as-needed was in effect, + or was found via a DT_NEEDED entry. */ + enum dynamic_lib_link_class dyn_lib_class; + + /* This is set to TRUE if the object was created by the backend + linker. */ + bfd_boolean linker; + + /* 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 + sh_info field in the symbol table header, and always read all the + symbols. */ + bfd_boolean bad_symtab; + + /* Used to determine if the e_flags field has been initialized */ + bfd_boolean flags_init; }; #define elf_tdata(bfd) ((bfd) -> tdata.elf_obj_data) @@ -1170,439 +1259,504 @@ struct elf_obj_tdata #define elf_sym_hashes(bfd) (elf_tdata(bfd) -> sym_hashes) #define elf_local_got_refcounts(bfd) (elf_tdata(bfd) -> local_got.refcounts) #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_local_got_ents(bfd) (elf_tdata(bfd) -> local_got.ents) #define elf_dt_name(bfd) (elf_tdata(bfd) -> dt_name) -#define elf_dt_soname(bfd) (elf_tdata(bfd) -> dt_soname) +#define elf_dyn_lib_class(bfd) (elf_tdata(bfd) -> dyn_lib_class) #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]) extern void _bfd_elf_swap_verdef_in - PARAMS ((bfd *, const Elf_External_Verdef *, Elf_Internal_Verdef *)); + (bfd *, const Elf_External_Verdef *, Elf_Internal_Verdef *); extern void _bfd_elf_swap_verdef_out - PARAMS ((bfd *, const Elf_Internal_Verdef *, Elf_External_Verdef *)); + (bfd *, const Elf_Internal_Verdef *, Elf_External_Verdef *); extern void _bfd_elf_swap_verdaux_in - PARAMS ((bfd *, const Elf_External_Verdaux *, Elf_Internal_Verdaux *)); + (bfd *, const Elf_External_Verdaux *, Elf_Internal_Verdaux *); extern void _bfd_elf_swap_verdaux_out - PARAMS ((bfd *, const Elf_Internal_Verdaux *, Elf_External_Verdaux *)); + (bfd *, const Elf_Internal_Verdaux *, Elf_External_Verdaux *); extern void _bfd_elf_swap_verneed_in - PARAMS ((bfd *, const Elf_External_Verneed *, Elf_Internal_Verneed *)); + (bfd *, const Elf_External_Verneed *, Elf_Internal_Verneed *); extern void _bfd_elf_swap_verneed_out - PARAMS ((bfd *, const Elf_Internal_Verneed *, Elf_External_Verneed *)); + (bfd *, const Elf_Internal_Verneed *, Elf_External_Verneed *); extern void _bfd_elf_swap_vernaux_in - PARAMS ((bfd *, const Elf_External_Vernaux *, Elf_Internal_Vernaux *)); + (bfd *, const Elf_External_Vernaux *, Elf_Internal_Vernaux *); extern void _bfd_elf_swap_vernaux_out - PARAMS ((bfd *, const Elf_Internal_Vernaux *, Elf_External_Vernaux *)); + (bfd *, const Elf_Internal_Vernaux *, Elf_External_Vernaux *); extern void _bfd_elf_swap_versym_in - PARAMS ((bfd *, const Elf_External_Versym *, Elf_Internal_Versym *)); + (bfd *, const Elf_External_Versym *, Elf_Internal_Versym *); extern void _bfd_elf_swap_versym_out - PARAMS ((bfd *, const Elf_Internal_Versym *, Elf_External_Versym *)); + (bfd *, const Elf_Internal_Versym *, Elf_External_Versym *); extern int _bfd_elf_section_from_bfd_section - PARAMS ((bfd *, asection *)); + (bfd *, asection *); extern char *bfd_elf_string_from_elf_section - PARAMS ((bfd *, unsigned, unsigned)); + (bfd *, unsigned, unsigned); extern char *bfd_elf_get_str_section - PARAMS ((bfd *, unsigned)); + (bfd *, unsigned); extern Elf_Internal_Sym *bfd_elf_get_elf_syms - PARAMS ((bfd *, Elf_Internal_Shdr *, size_t, size_t, - Elf_Internal_Sym *, PTR, Elf_External_Sym_Shndx *)); - -extern boolean _bfd_elf_copy_private_bfd_data - PARAMS ((bfd *, bfd *)); -extern boolean _bfd_elf_print_private_bfd_data - PARAMS ((bfd *, PTR)); + (bfd *, Elf_Internal_Shdr *, size_t, size_t, Elf_Internal_Sym *, void *, + Elf_External_Sym_Shndx *); +extern const char *bfd_elf_local_sym_name + (bfd *, Elf_Internal_Sym *); + +extern bfd_boolean _bfd_elf_copy_private_bfd_data + (bfd *, bfd *); +extern bfd_boolean _bfd_elf_print_private_bfd_data + (bfd *, void *); extern void bfd_elf_print_symbol - PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); + (bfd *, void *, asymbol *, bfd_print_symbol_type); #define elf_string_from_elf_strtab(abfd, strindex) \ - bfd_elf_string_from_elf_section(abfd, elf_elfheader(abfd)->e_shstrndx, \ - strindex) - -#define bfd_elf32_print_symbol bfd_elf_print_symbol -#define bfd_elf64_print_symbol bfd_elf_print_symbol + bfd_elf_string_from_elf_section (abfd, elf_elfheader(abfd)->e_shstrndx, \ + strindex) extern void _bfd_elf_sprintf_vma - PARAMS ((bfd *, char *, bfd_vma)); + (bfd *, char *, bfd_vma); extern void _bfd_elf_fprintf_vma - PARAMS ((bfd *, PTR, bfd_vma)); + (bfd *, void *, bfd_vma); + +extern bfd_byte _bfd_elf_encode_eh_address + (bfd *abfd, struct bfd_link_info *info, asection *osec, bfd_vma offset, + asection *loc_sec, bfd_vma loc_offset, bfd_vma *encoded); +extern bfd_boolean _bfd_elf_can_make_relative + (bfd *input_bfd, struct bfd_link_info *info, asection *eh_frame_section); extern enum elf_reloc_type_class _bfd_elf_reloc_type_class - PARAMS ((const Elf_Internal_Rela *)); + (const Elf_Internal_Rela *); extern bfd_vma _bfd_elf_rela_local_sym - PARAMS ((bfd *, Elf_Internal_Sym *, asection *, Elf_Internal_Rela *)); + (bfd *, Elf_Internal_Sym *, asection **, Elf_Internal_Rela *); extern bfd_vma _bfd_elf_rel_local_sym - PARAMS ((bfd *, Elf_Internal_Sym *, asection **, bfd_vma)); + (bfd *, Elf_Internal_Sym *, asection **, bfd_vma); extern bfd_vma _bfd_elf_section_offset - PARAMS ((bfd *, struct bfd_link_info *, asection *, bfd_vma)); + (bfd *, struct bfd_link_info *, asection *, bfd_vma); extern unsigned long bfd_elf_hash - PARAMS ((const char *)); + (const char *); extern bfd_reloc_status_type bfd_elf_generic_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -extern boolean bfd_elf_mkobject - PARAMS ((bfd *)); -extern boolean bfd_elf_mkcorefile - PARAMS ((bfd *)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); +extern bfd_boolean bfd_elf_mkobject + (bfd *); +extern bfd_boolean bfd_elf_mkcorefile + (bfd *); extern Elf_Internal_Shdr *bfd_elf_find_section - PARAMS ((bfd *, char *)); -extern boolean _bfd_elf_make_section_from_shdr - PARAMS ((bfd *, Elf_Internal_Shdr *, const char *)); -extern boolean _bfd_elf_make_section_from_phdr - PARAMS ((bfd *, Elf_Internal_Phdr *, int, const char *)); + (bfd *, char *); +extern bfd_boolean _bfd_elf_make_section_from_shdr + (bfd *, Elf_Internal_Shdr *, const char *); +extern bfd_boolean _bfd_elf_make_section_from_phdr + (bfd *, Elf_Internal_Phdr *, int, const char *); extern struct bfd_hash_entry *_bfd_elf_link_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); extern struct bfd_link_hash_table *_bfd_elf_link_hash_table_create - PARAMS ((bfd *)); + (bfd *); extern void _bfd_elf_link_hash_copy_indirect - PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, - struct elf_link_hash_entry *)); + (const struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *); extern void _bfd_elf_link_hash_hide_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); -extern boolean _bfd_elf_link_hash_table_init - PARAMS ((struct elf_link_hash_table *, bfd *, - struct bfd_hash_entry *(*) (struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *))); -extern boolean _bfd_elf_slurp_version_tables - PARAMS ((bfd *)); -extern boolean _bfd_elf_merge_sections - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean bfd_elf_discard_group - PARAMS ((bfd *, struct sec *)); + (struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean); +extern bfd_boolean _bfd_elf_link_hash_table_init + (struct elf_link_hash_table *, bfd *, + struct bfd_hash_entry *(*) + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); +extern bfd_boolean _bfd_elf_slurp_version_tables + (bfd *); +extern bfd_boolean _bfd_elf_merge_sections + (bfd *, struct bfd_link_info *); +extern bfd_boolean bfd_elf_discard_group + (bfd *, struct bfd_section *); extern void bfd_elf_set_group_contents - PARAMS ((bfd *, asection *, PTR)); + (bfd *, asection *, void *); extern void _bfd_elf_link_just_syms - PARAMS ((asection *, struct bfd_link_info *)); -extern boolean _bfd_elf_copy_private_symbol_data - PARAMS ((bfd *, asymbol *, bfd *, asymbol *)); -extern boolean _bfd_elf_copy_private_section_data - PARAMS ((bfd *, asection *, bfd *, asection *)); -extern boolean _bfd_elf_write_object_contents - PARAMS ((bfd *)); -extern boolean _bfd_elf_write_corefile_contents - PARAMS ((bfd *)); -extern boolean _bfd_elf_set_section_contents - PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); + (asection *, struct bfd_link_info *); +extern bfd_boolean _bfd_elf_copy_private_symbol_data + (bfd *, asymbol *, bfd *, asymbol *); +extern bfd_boolean _bfd_elf_copy_private_section_data + (bfd *, asection *, bfd *, asection *); +extern bfd_boolean _bfd_elf_write_object_contents + (bfd *); +extern bfd_boolean _bfd_elf_write_corefile_contents + (bfd *); +extern bfd_boolean _bfd_elf_set_section_contents + (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); extern long _bfd_elf_get_symtab_upper_bound - PARAMS ((bfd *)); -extern long _bfd_elf_get_symtab - PARAMS ((bfd *, asymbol **)); + (bfd *); +extern long _bfd_elf_canonicalize_symtab + (bfd *, asymbol **); extern long _bfd_elf_get_dynamic_symtab_upper_bound - PARAMS ((bfd *)); + (bfd *); extern long _bfd_elf_canonicalize_dynamic_symtab - PARAMS ((bfd *, asymbol **)); + (bfd *, asymbol **); extern long _bfd_elf_get_reloc_upper_bound - PARAMS ((bfd *, sec_ptr)); + (bfd *, sec_ptr); extern long _bfd_elf_canonicalize_reloc - PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); + (bfd *, sec_ptr, arelent **, asymbol **); extern long _bfd_elf_get_dynamic_reloc_upper_bound - PARAMS ((bfd *)); + (bfd *); extern long _bfd_elf_canonicalize_dynamic_reloc - PARAMS ((bfd *, arelent **, asymbol **)); + (bfd *, arelent **, asymbol **); extern asymbol *_bfd_elf_make_empty_symbol - PARAMS ((bfd *)); + (bfd *); extern void _bfd_elf_get_symbol_info - PARAMS ((bfd *, asymbol *, symbol_info *)); -extern boolean _bfd_elf_is_local_label_name - PARAMS ((bfd *, const char *)); + (bfd *, asymbol *, symbol_info *); +extern bfd_boolean _bfd_elf_is_local_label_name + (bfd *, const char *); extern alent *_bfd_elf_get_lineno - PARAMS ((bfd *, asymbol *)); -extern boolean _bfd_elf_set_arch_mach - PARAMS ((bfd *, enum bfd_architecture, unsigned long)); -extern boolean _bfd_elf_find_nearest_line - PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *)); + (bfd *, asymbol *); +extern bfd_boolean _bfd_elf_set_arch_mach + (bfd *, enum bfd_architecture, unsigned long); +extern bfd_boolean _bfd_elf_find_nearest_line + (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, + unsigned int *); #define _bfd_elf_read_minisymbols _bfd_generic_read_minisymbols #define _bfd_elf_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol extern int _bfd_elf_sizeof_headers - PARAMS ((bfd *, boolean)); -extern boolean _bfd_elf_new_section_hook - PARAMS ((bfd *, asection *)); -extern boolean _bfd_elf_init_reloc_shdr - PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, boolean)); + (bfd *, bfd_boolean); +extern bfd_boolean _bfd_elf_new_section_hook + (bfd *, asection *); +extern bfd_boolean _bfd_elf_init_reloc_shdr + (bfd *, Elf_Internal_Shdr *, asection *, bfd_boolean); +extern const struct bfd_elf_special_section *_bfd_elf_get_sec_type_attr + (bfd *, const char *); /* If the target doesn't have reloc handling written yet: */ extern void _bfd_elf_no_info_to_howto - PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); + (bfd *, arelent *, Elf_Internal_Rela *); -extern boolean bfd_section_from_shdr - PARAMS ((bfd *, unsigned int shindex)); -extern boolean bfd_section_from_phdr - PARAMS ((bfd *, Elf_Internal_Phdr *, int)); +extern bfd_boolean bfd_section_from_shdr + (bfd *, unsigned int shindex); +extern bfd_boolean bfd_section_from_phdr + (bfd *, Elf_Internal_Phdr *, int); extern int _bfd_elf_symbol_from_bfd_symbol - PARAMS ((bfd *, asymbol **)); + (bfd *, asymbol **); extern asection *bfd_section_from_r_symndx - PARAMS ((bfd *, struct sym_sec_cache *, asection *, unsigned long)); + (bfd *, struct sym_sec_cache *, asection *, unsigned long); extern asection *bfd_section_from_elf_index - PARAMS ((bfd *, unsigned int)); -extern boolean _bfd_elf_create_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, unsigned int); extern struct bfd_strtab_hash *_bfd_elf_stringtab_init - PARAMS ((void)); + (void); extern struct elf_strtab_hash * _bfd_elf_strtab_init - PARAMS ((void)); + (void); extern void _bfd_elf_strtab_free - PARAMS ((struct elf_strtab_hash *)); + (struct elf_strtab_hash *); extern bfd_size_type _bfd_elf_strtab_add - PARAMS ((struct elf_strtab_hash *, const char *, boolean)); + (struct elf_strtab_hash *, const char *, bfd_boolean); extern void _bfd_elf_strtab_addref - PARAMS ((struct elf_strtab_hash *, bfd_size_type)); + (struct elf_strtab_hash *, bfd_size_type); extern void _bfd_elf_strtab_delref - PARAMS ((struct elf_strtab_hash *, bfd_size_type)); + (struct elf_strtab_hash *, bfd_size_type); extern void _bfd_elf_strtab_clear_all_refs - PARAMS ((struct elf_strtab_hash *)); + (struct elf_strtab_hash *); extern bfd_size_type _bfd_elf_strtab_size - PARAMS ((struct elf_strtab_hash *)); + (struct elf_strtab_hash *); extern bfd_size_type _bfd_elf_strtab_offset - PARAMS ((struct elf_strtab_hash *, bfd_size_type)); -extern boolean _bfd_elf_strtab_emit - PARAMS ((bfd *, struct elf_strtab_hash *)); + (struct elf_strtab_hash *, bfd_size_type); +extern bfd_boolean _bfd_elf_strtab_emit + (bfd *, struct elf_strtab_hash *); extern void _bfd_elf_strtab_finalize - PARAMS ((struct elf_strtab_hash *)); + (struct elf_strtab_hash *); -extern boolean _bfd_elf_discard_section_eh_frame - PARAMS ((bfd *, struct bfd_link_info *, asection *, asection *, - boolean (*) (bfd_vma, PTR), struct elf_reloc_cookie *)); -extern boolean _bfd_elf_discard_section_eh_frame_hdr - PARAMS ((bfd *, struct bfd_link_info *, asection *)); +extern bfd_boolean _bfd_elf_discard_section_eh_frame + (bfd *, struct bfd_link_info *, asection *, + bfd_boolean (*) (bfd_vma, void *), struct elf_reloc_cookie *); +extern bfd_boolean _bfd_elf_discard_section_eh_frame_hdr + (bfd *, struct bfd_link_info *); extern bfd_vma _bfd_elf_eh_frame_section_offset - PARAMS ((bfd *, asection *, bfd_vma)); -extern boolean _bfd_elf_write_section_eh_frame - PARAMS ((bfd *, asection *, asection *, bfd_byte *)); -extern boolean _bfd_elf_write_section_eh_frame_hdr - PARAMS ((bfd *, asection *)); -extern boolean _bfd_elf_maybe_strip_eh_frame_hdr - PARAMS ((struct bfd_link_info *)); - -extern boolean _bfd_elf_link_record_dynamic_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); + (bfd *, asection *, bfd_vma); +extern bfd_boolean _bfd_elf_write_section_eh_frame + (bfd *, struct bfd_link_info *, asection *, bfd_byte *); +extern bfd_boolean _bfd_elf_write_section_eh_frame_hdr + (bfd *, struct bfd_link_info *); +extern bfd_boolean _bfd_elf_maybe_strip_eh_frame_hdr + (struct bfd_link_info *); + +extern bfd_boolean _bfd_elf_merge_symbol + (bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *, + asection **, bfd_vma *, struct elf_link_hash_entry **, bfd_boolean *, + bfd_boolean *, bfd_boolean *, bfd_boolean *); + +extern bfd_boolean _bfd_elf_add_default_symbol + (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + const char *, Elf_Internal_Sym *, asection **, bfd_vma *, + bfd_boolean *, bfd_boolean); + +extern bfd_boolean _bfd_elf_export_symbol + (struct elf_link_hash_entry *, void *); + +extern bfd_boolean _bfd_elf_link_find_version_dependencies + (struct elf_link_hash_entry *, void *); + +extern bfd_boolean _bfd_elf_link_assign_sym_version + (struct elf_link_hash_entry *, void *); + extern long _bfd_elf_link_lookup_local_dynindx - PARAMS ((struct bfd_link_info *, bfd *, long)); -extern boolean _bfd_elf_compute_section_file_positions - PARAMS ((bfd *, struct bfd_link_info *)); + (struct bfd_link_info *, bfd *, long); +extern bfd_boolean _bfd_elf_compute_section_file_positions + (bfd *, struct bfd_link_info *); extern void _bfd_elf_assign_file_positions_for_relocs - PARAMS ((bfd *)); + (bfd *); extern file_ptr _bfd_elf_assign_file_position_for_section - PARAMS ((Elf_Internal_Shdr *, file_ptr, boolean)); + (Elf_Internal_Shdr *, file_ptr, bfd_boolean); -extern boolean _bfd_elf_validate_reloc - PARAMS ((bfd *, arelent *)); +extern bfd_boolean _bfd_elf_validate_reloc + (bfd *, arelent *); -extern boolean _bfd_elf_create_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean _bfd_elf_create_got_section - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean _bfd_elf_link_create_dynamic_sections + (bfd *, struct bfd_link_info *); +extern bfd_boolean _bfd_elf_create_dynamic_sections + (bfd *, struct bfd_link_info *); +extern bfd_boolean _bfd_elf_create_got_section + (bfd *, struct bfd_link_info *); extern unsigned long _bfd_elf_link_renumber_dynsyms - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); -extern boolean _bfd_elfcore_make_pseudosection - PARAMS ((bfd *, char *, size_t, ufile_ptr)); +extern bfd_boolean _bfd_elfcore_make_pseudosection + (bfd *, char *, size_t, ufile_ptr); extern char *_bfd_elfcore_strndup - PARAMS ((bfd *, char *, size_t)); + (bfd *, char *, size_t); -extern elf_linker_section_t *_bfd_elf_create_linker_section - PARAMS ((bfd *, struct bfd_link_info *, enum elf_linker_section_enum, - elf_linker_section_t *)); +extern Elf_Internal_Rela *_bfd_elf_link_read_relocs + (bfd *, asection *, void *, Elf_Internal_Rela *, bfd_boolean); -extern elf_linker_section_pointers_t *_bfd_elf_find_pointer_linker_section - PARAMS ((elf_linker_section_pointers_t *, bfd_vma, - elf_linker_section_enum_t)); +extern bfd_boolean _bfd_elf_link_size_reloc_section + (bfd *, Elf_Internal_Shdr *, asection *); -extern boolean bfd_elf32_create_pointer_linker_section - PARAMS ((bfd *, struct bfd_link_info *, elf_linker_section_t *, - struct elf_link_hash_entry *, const Elf32_Internal_Rela *)); +extern bfd_boolean _bfd_elf_link_output_relocs + (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *); -extern bfd_vma bfd_elf32_finish_pointer_linker_section - PARAMS ((bfd *, bfd *, struct bfd_link_info *, elf_linker_section_t *, - struct elf_link_hash_entry *, bfd_vma, - const Elf32_Internal_Rela *, int)); +extern bfd_boolean _bfd_elf_fix_symbol_flags + (struct elf_link_hash_entry *, struct elf_info_failed *); -extern boolean bfd_elf64_create_pointer_linker_section - PARAMS ((bfd *, struct bfd_link_info *, elf_linker_section_t *, - struct elf_link_hash_entry *, const Elf64_Internal_Rela *)); +extern bfd_boolean _bfd_elf_adjust_dynamic_symbol + (struct elf_link_hash_entry *, void *); -extern bfd_vma bfd_elf64_finish_pointer_linker_section - PARAMS ((bfd *, bfd *, struct bfd_link_info *, elf_linker_section_t *, - struct elf_link_hash_entry *, bfd_vma, - const Elf64_Internal_Rela *, int)); +extern bfd_boolean _bfd_elf_link_sec_merge_syms + (struct elf_link_hash_entry *, void *); -extern boolean _bfd_elf_make_linker_section_rela - PARAMS ((bfd *, elf_linker_section_t *, int)); +extern bfd_boolean _bfd_elf_dynamic_symbol_p + (struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean); + +extern bfd_boolean _bfd_elf_symbol_refs_local_p + (struct elf_link_hash_entry *, struct bfd_link_info *, bfd_boolean); extern const bfd_target *bfd_elf32_object_p - PARAMS ((bfd *)); + (bfd *); extern const bfd_target *bfd_elf32_core_file_p - PARAMS ((bfd *)); + (bfd *); extern char *bfd_elf32_core_file_failing_command - PARAMS ((bfd *)); + (bfd *); extern int bfd_elf32_core_file_failing_signal - PARAMS ((bfd *)); -extern boolean bfd_elf32_core_file_matches_executable_p - PARAMS ((bfd *, bfd *)); - -extern boolean bfd_elf32_bfd_link_add_symbols - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean bfd_elf32_bfd_final_link - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *); +extern bfd_boolean bfd_elf32_core_file_matches_executable_p + (bfd *, bfd *); extern void bfd_elf32_swap_symbol_in - PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *)); + (bfd *, const void *, const void *, Elf_Internal_Sym *); extern void bfd_elf32_swap_symbol_out - PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); + (bfd *, const Elf_Internal_Sym *, void *, void *); extern void bfd_elf32_swap_reloc_in - PARAMS ((bfd *, const Elf32_External_Rel *, Elf_Internal_Rel *)); + (bfd *, const bfd_byte *, Elf_Internal_Rela *); extern void bfd_elf32_swap_reloc_out - PARAMS ((bfd *, const Elf_Internal_Rel *, Elf32_External_Rel *)); + (bfd *, const Elf_Internal_Rela *, bfd_byte *); extern void bfd_elf32_swap_reloca_in - PARAMS ((bfd *, const Elf32_External_Rela *, Elf_Internal_Rela *)); + (bfd *, const bfd_byte *, Elf_Internal_Rela *); extern void bfd_elf32_swap_reloca_out - PARAMS ((bfd *, const Elf_Internal_Rela *, Elf32_External_Rela *)); + (bfd *, const Elf_Internal_Rela *, bfd_byte *); extern void bfd_elf32_swap_phdr_in - PARAMS ((bfd *, const Elf32_External_Phdr *, Elf_Internal_Phdr *)); + (bfd *, const Elf32_External_Phdr *, Elf_Internal_Phdr *); extern void bfd_elf32_swap_phdr_out - PARAMS ((bfd *, const Elf_Internal_Phdr *, Elf32_External_Phdr *)); + (bfd *, const Elf_Internal_Phdr *, Elf32_External_Phdr *); extern void bfd_elf32_swap_dyn_in - PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *)); + (bfd *, const void *, Elf_Internal_Dyn *); extern void bfd_elf32_swap_dyn_out - PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR)); + (bfd *, const Elf_Internal_Dyn *, void *); extern long bfd_elf32_slurp_symbol_table - PARAMS ((bfd *, asymbol **, boolean)); -extern boolean bfd_elf32_write_shdrs_and_ehdr - PARAMS ((bfd *)); + (bfd *, asymbol **, bfd_boolean); +extern bfd_boolean bfd_elf32_write_shdrs_and_ehdr + (bfd *); extern int bfd_elf32_write_out_phdrs - PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int)); + (bfd *, const Elf_Internal_Phdr *, unsigned 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 - PARAMS ((bfd *, struct bfd_link_info *)); -extern Elf_Internal_Rela *_bfd_elf32_link_read_relocs - PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, boolean)); + (bfd *, asection *, void *); +extern bfd_boolean bfd_elf32_slurp_reloc_table + (bfd *, asection *, asymbol **, bfd_boolean); extern const bfd_target *bfd_elf64_object_p - PARAMS ((bfd *)); + (bfd *); extern const bfd_target *bfd_elf64_core_file_p - PARAMS ((bfd *)); + (bfd *); extern char *bfd_elf64_core_file_failing_command - PARAMS ((bfd *)); + (bfd *); extern int bfd_elf64_core_file_failing_signal - PARAMS ((bfd *)); -extern boolean bfd_elf64_core_file_matches_executable_p - PARAMS ((bfd *, bfd *)); -extern boolean bfd_elf64_bfd_link_add_symbols - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean bfd_elf64_bfd_final_link - PARAMS ((bfd *, struct bfd_link_info *)); + (bfd *); +extern bfd_boolean bfd_elf64_core_file_matches_executable_p + (bfd *, bfd *); extern void bfd_elf64_swap_symbol_in - PARAMS ((bfd *, const PTR, const PTR, Elf_Internal_Sym *)); + (bfd *, const void *, const void *, Elf_Internal_Sym *); extern void bfd_elf64_swap_symbol_out - PARAMS ((bfd *, const Elf_Internal_Sym *, PTR, PTR)); + (bfd *, const Elf_Internal_Sym *, void *, void *); extern void bfd_elf64_swap_reloc_in - PARAMS ((bfd *, const Elf64_External_Rel *, Elf_Internal_Rel *)); + (bfd *, const bfd_byte *, Elf_Internal_Rela *); extern void bfd_elf64_swap_reloc_out - PARAMS ((bfd *, const Elf_Internal_Rel *, Elf64_External_Rel *)); + (bfd *, const Elf_Internal_Rela *, bfd_byte *); extern void bfd_elf64_swap_reloca_in - PARAMS ((bfd *, const Elf64_External_Rela *, Elf_Internal_Rela *)); + (bfd *, const bfd_byte *, Elf_Internal_Rela *); extern void bfd_elf64_swap_reloca_out - PARAMS ((bfd *, const Elf_Internal_Rela *, Elf64_External_Rela *)); + (bfd *, const Elf_Internal_Rela *, bfd_byte *); extern void bfd_elf64_swap_phdr_in - PARAMS ((bfd *, const Elf64_External_Phdr *, Elf_Internal_Phdr *)); + (bfd *, const Elf64_External_Phdr *, Elf_Internal_Phdr *); extern void bfd_elf64_swap_phdr_out - PARAMS ((bfd *, const Elf_Internal_Phdr *, Elf64_External_Phdr *)); + (bfd *, const Elf_Internal_Phdr *, Elf64_External_Phdr *); extern void bfd_elf64_swap_dyn_in - PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *)); + (bfd *, const void *, Elf_Internal_Dyn *); extern void bfd_elf64_swap_dyn_out - PARAMS ((bfd *, const Elf_Internal_Dyn *, PTR)); + (bfd *, const Elf_Internal_Dyn *, void *); extern long bfd_elf64_slurp_symbol_table - PARAMS ((bfd *, asymbol **, boolean)); -extern boolean bfd_elf64_write_shdrs_and_ehdr - PARAMS ((bfd *)); + (bfd *, asymbol **, bfd_boolean); +extern bfd_boolean bfd_elf64_write_shdrs_and_ehdr + (bfd *); extern int bfd_elf64_write_out_phdrs - PARAMS ((bfd *, const Elf_Internal_Phdr *, unsigned int)); + (bfd *, const Elf_Internal_Phdr *, unsigned 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 - PARAMS ((bfd *, struct bfd_link_info *)); -extern Elf_Internal_Rela *_bfd_elf64_link_read_relocs - PARAMS ((bfd *, asection *, PTR, Elf_Internal_Rela *, boolean)); - -#define bfd_elf32_link_record_dynamic_symbol \ - _bfd_elf_link_record_dynamic_symbol -#define bfd_elf64_link_record_dynamic_symbol \ - _bfd_elf_link_record_dynamic_symbol - -extern int elf_link_record_local_dynamic_symbol - PARAMS ((struct bfd_link_info *, bfd *, long)); -#define _bfd_elf32_link_record_local_dynamic_symbol \ - elf_link_record_local_dynamic_symbol -#define _bfd_elf64_link_record_local_dynamic_symbol \ - elf_link_record_local_dynamic_symbol - -extern boolean _bfd_elf_close_and_cleanup - PARAMS ((bfd *)); + (bfd *, asection *, void *); +extern bfd_boolean bfd_elf64_slurp_reloc_table + (bfd *, asection *, asymbol **, bfd_boolean); + +extern bfd_boolean bfd_elf_link_add_symbols + (bfd *, struct bfd_link_info *); +extern bfd_boolean _bfd_elf_add_dynamic_entry + (struct bfd_link_info *, bfd_vma, bfd_vma); + +extern bfd_boolean bfd_elf_link_record_dynamic_symbol + (struct bfd_link_info *, struct elf_link_hash_entry *); + +extern int bfd_elf_link_record_local_dynamic_symbol + (struct bfd_link_info *, bfd *, long); + +extern bfd_boolean _bfd_elf_close_and_cleanup + (bfd *); extern bfd_reloc_status_type _bfd_elf_rel_vtable_reloc_fn - PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, - asection *, bfd *, char **)); - -extern boolean _bfd_elf32_gc_sections - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean _bfd_elf32_gc_common_finalize_got_offsets - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean _bfd_elf32_gc_common_final_link - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean _bfd_elf32_gc_record_vtinherit - PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); -extern boolean _bfd_elf32_gc_record_vtentry - PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); - -extern boolean _bfd_elf64_gc_sections - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean _bfd_elf64_gc_common_finalize_got_offsets - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean _bfd_elf64_gc_common_final_link - PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean _bfd_elf64_gc_record_vtinherit - PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); -extern boolean _bfd_elf64_gc_record_vtentry - PARAMS ((bfd *, asection *, struct elf_link_hash_entry *, bfd_vma)); - -extern boolean _bfd_elf32_reloc_symbol_deleted_p - PARAMS ((bfd_vma, PTR)); -extern boolean _bfd_elf64_reloc_symbol_deleted_p - PARAMS ((bfd_vma, PTR)); + (bfd *, arelent *, struct bfd_symbol *, void *, + asection *, bfd *, char **); + +extern bfd_boolean bfd_elf_final_link + (bfd *, struct bfd_link_info *); + +extern bfd_boolean bfd_elf_gc_sections + (bfd *, struct bfd_link_info *); + +extern bfd_boolean bfd_elf_gc_record_vtinherit + (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma); + +extern bfd_boolean bfd_elf_gc_record_vtentry + (bfd *, asection *, struct elf_link_hash_entry *, bfd_vma); + +extern bfd_boolean bfd_elf_gc_common_finalize_got_offsets + (bfd *, struct bfd_link_info *); + +extern bfd_boolean bfd_elf_gc_common_final_link + (bfd *, struct bfd_link_info *); + +extern bfd_boolean bfd_elf_reloc_symbol_deleted_p + (bfd_vma, void *); /* Exported interface for writing elf corefile notes. */ extern char *elfcore_write_note - PARAMS ((bfd *, char *, int *, const char *, int, const PTR, int)); + (bfd *, char *, int *, const char *, int, const void *, int); extern char *elfcore_write_prpsinfo - PARAMS ((bfd *, char *, int *, const char *, const char *)); + (bfd *, char *, int *, const char *, const char *); extern char *elfcore_write_prstatus - PARAMS ((bfd *, char *, int *, long, int, const PTR)); + (bfd *, char *, int *, long, int, const void *); extern char * elfcore_write_pstatus - PARAMS ((bfd *, char *, int *, long, int, const PTR)); + (bfd *, char *, int *, long, int, const void *); extern char *elfcore_write_prfpreg - PARAMS ((bfd *, char *, int *, const PTR, int)); + (bfd *, char *, int *, const void *, int); extern char *elfcore_write_prxfpreg - PARAMS ((bfd *, char *, int *, const PTR, int)); + (bfd *, char *, int *, const void *, int); extern char *elfcore_write_lwpstatus - PARAMS ((bfd *, char *, int *, long, int, const PTR)); + (bfd *, char *, int *, long, int, const void *); + +extern bfd *_bfd_elf32_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma, char *, int)); +extern bfd *_bfd_elf64_bfd_from_remote_memory + (bfd *templ, bfd_vma ehdr_vma, bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma, char *, int)); /* SH ELF specific routine. */ -extern boolean _sh_elf_set_mach_from_flags - PARAMS ((bfd *)); +extern bfd_boolean _sh_elf_set_mach_from_flags + (bfd *); + +/* This is the condition under which finish_dynamic_symbol will be called. + If our finish_dynamic_symbol isn't called, we'll need to do something + about initializing any .plt and .got entries in relocate_section. */ +#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, SHARED, H) \ + ((DYN) \ + && ((SHARED) \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ + && ((H)->dynindx != -1 \ + || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) + +/* This macro is to avoid lots of duplicated code in the body + of xxx_relocate_section() in the various elfxx-xxxx.c files. */ +#define RELOC_FOR_GLOBAL_SYMBOL(info, input_bfd, input_section, rel, \ + r_symndx, symtab_hdr, sym_hashes, \ + h, sec, relocation, \ + unresolved_reloc, warned) \ + do \ + { \ + /* 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; \ + \ + 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; \ + \ + warned = FALSE; \ + unresolved_reloc = FALSE; \ + relocation = 0; \ + if (h->root.type == bfd_link_hash_defined \ + || h->root.type == bfd_link_hash_defweak) \ + { \ + sec = h->root.u.def.section; \ + if (sec == NULL \ + || sec->output_section == NULL) \ + /* Set a flag that will be cleared later if we find a \ + relocation value for this symbol. output_section \ + is typically NULL for symbols satisfied by a shared \ + library. */ \ + unresolved_reloc = TRUE; \ + else \ + relocation = (h->root.u.def.value \ + + sec->output_section->vma \ + + sec->output_offset); \ + } \ + else if (h->root.type == bfd_link_hash_undefweak) \ + ; \ + else if (info->unresolved_syms_in_objects == RM_IGNORE \ + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) \ + ; \ + else \ + { \ + bfd_boolean err; \ + err = (info->unresolved_syms_in_objects == RM_GENERATE_ERROR \ + || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT); \ + if (!info->callbacks->undefined_symbol (info, \ + h->root.root.string, \ + input_bfd, \ + input_section, \ + rel->r_offset, err)) \ + return FALSE; \ + warned = TRUE; \ + } \ + } \ + while (0) #endif /* _LIBELF_H_ */ diff --git a/contrib/binutils/bfd/elf-eh-frame.c b/contrib/binutils/bfd/elf-eh-frame.c index 62226c5..d3777b4 100644 --- a/contrib/binutils/bfd/elf-eh-frame.c +++ b/contrib/binutils/bfd/elf-eh-frame.c @@ -1,22 +1,22 @@ /* .eh_frame section optimization. - Copyright 2001, 2002 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003 Free Software Foundation, Inc. Written by Jakub Jelinek . -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" @@ -26,129 +26,44 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define EH_FRAME_HDR_SIZE 8 -struct cie_header -{ - unsigned int length; - unsigned int id; -}; - -struct cie -{ - struct cie_header hdr; - unsigned char version; - unsigned char augmentation[20]; - unsigned int code_align; - int data_align; - unsigned int ra_column; - unsigned int augmentation_size; - struct elf_link_hash_entry *personality; - unsigned char per_encoding; - unsigned char lsda_encoding; - unsigned char fde_encoding; - unsigned char initial_insn_length; - unsigned char make_relative; - unsigned char make_lsda_relative; - unsigned char initial_instructions[50]; -}; - -struct eh_cie_fde -{ - unsigned int offset; - unsigned int size; - asection *sec; - unsigned int new_offset; - unsigned char fde_encoding; - unsigned char lsda_encoding; - unsigned char lsda_offset; - unsigned char cie : 1; - unsigned char removed : 1; - unsigned char make_relative : 1; - unsigned char make_lsda_relative : 1; - unsigned char per_encoding_relative : 1; -}; - -struct eh_frame_sec_info -{ - unsigned int count; - unsigned int alloced; - struct eh_cie_fde entry[1]; -}; - -struct eh_frame_array_ent -{ - bfd_vma initial_loc; - bfd_vma fde; -}; - -struct eh_frame_hdr_info -{ - struct cie last_cie; - asection *last_cie_sec; - unsigned int last_cie_offset; - unsigned int fde_count, array_count; - struct eh_frame_array_ent *array; - /* TRUE if .eh_frame_hdr should contain the sorted search table. - We build it if we successfully read all .eh_frame input sections - and recognize them. */ - boolean table; - boolean strip; -}; - -static bfd_vma read_unsigned_leb128 - PARAMS ((bfd *, char *, unsigned int *)); -static bfd_signed_vma read_signed_leb128 - PARAMS ((bfd *, char *, unsigned int *)); -static int get_DW_EH_PE_width - PARAMS ((int, int)); -static bfd_vma read_value - PARAMS ((bfd *, bfd_byte *, int)); -static void write_value - PARAMS ((bfd *, bfd_byte *, bfd_vma, int)); -static int cie_compare - PARAMS ((struct cie *, struct cie *)); -static int vma_compare - PARAMS ((const PTR a, const PTR b)); - /* Helper function for reading uleb128 encoded data. */ static bfd_vma -read_unsigned_leb128 (abfd, buf, bytes_read_ptr) - bfd *abfd ATTRIBUTE_UNUSED; - char *buf; - unsigned int *bytes_read_ptr; +read_unsigned_leb128 (bfd *abfd ATTRIBUTE_UNUSED, + char *buf, + unsigned int *bytes_read_ptr) { - bfd_vma result; - unsigned int num_read; - int shift; + bfd_vma result; + unsigned int num_read; + int shift; unsigned char byte; - result = 0; - shift = 0; + result = 0; + shift = 0; num_read = 0; do { byte = bfd_get_8 (abfd, (bfd_byte *) buf); - buf ++; - num_read ++; + buf++; + num_read++; result |= (((bfd_vma) byte & 0x7f) << shift); shift += 7; } while (byte & 0x80); - * bytes_read_ptr = num_read; + *bytes_read_ptr = num_read; return result; } /* Helper function for reading sleb128 encoded data. */ static bfd_signed_vma -read_signed_leb128 (abfd, buf, bytes_read_ptr) - bfd *abfd ATTRIBUTE_UNUSED; - char *buf; - unsigned int * bytes_read_ptr; +read_signed_leb128 (bfd *abfd ATTRIBUTE_UNUSED, + char *buf, + unsigned int * bytes_read_ptr) { - bfd_vma result; - int shift; - int num_read; + bfd_vma result; + int shift; + int num_read; unsigned char byte; result = 0; @@ -165,7 +80,7 @@ read_signed_leb128 (abfd, buf, bytes_read_ptr) while (byte & 0x80); if (byte & 0x40) result |= (((bfd_vma) -1) << (shift - 7)) << 7; - * bytes_read_ptr = num_read; + *bytes_read_ptr = num_read; return result; } @@ -188,8 +103,7 @@ while (0) /* Return 0 if either encoding is variable width, or not yet known to bfd. */ static -int get_DW_EH_PE_width (encoding, ptr_size) - int encoding, ptr_size; +int get_DW_EH_PE_width (int encoding, int ptr_size) { /* DW_EH_PE_ values of 0x60 and 0x70 weren't defined at the time .eh_frame was added to bfd. */ @@ -209,35 +123,47 @@ int get_DW_EH_PE_width (encoding, ptr_size) return 0; } +#define get_DW_EH_PE_signed(encoding) (((encoding) & DW_EH_PE_signed) != 0) + /* Read a width sized value from memory. */ static bfd_vma -read_value (abfd, buf, width) - bfd *abfd; - bfd_byte *buf; - int width; +read_value (bfd *abfd, bfd_byte *buf, int width, int is_signed) { bfd_vma value; switch (width) { - case 2: value = bfd_get_16 (abfd, buf); break; - case 4: value = bfd_get_32 (abfd, buf); break; - case 8: value = bfd_get_64 (abfd, buf); break; - default: BFD_FAIL (); return 0; + case 2: + if (is_signed) + value = bfd_get_signed_16 (abfd, buf); + else + value = bfd_get_16 (abfd, buf); + break; + case 4: + if (is_signed) + value = bfd_get_signed_32 (abfd, buf); + else + value = bfd_get_32 (abfd, buf); + break; + case 8: + if (is_signed) + value = bfd_get_signed_64 (abfd, buf); + else + value = bfd_get_64 (abfd, buf); + break; + default: + BFD_FAIL (); + return 0; } return value; } - + /* Store a width sized value to memory. */ static void -write_value (abfd, buf, value, width) - bfd *abfd; - bfd_byte *buf; - bfd_vma value; - int width; +write_value (bfd *abfd, bfd_byte *buf, bfd_vma value, int width) { switch (width) { @@ -251,8 +177,7 @@ write_value (abfd, buf, value, width) /* Return zero if C1 and C2 CIEs can be merged. */ static -int cie_compare (c1, c2) - struct cie *c1, *c2; +int cie_compare (struct cie *c1, struct cie *c2) { if (c1->hdr.length == c2->hdr.length && c1->version == c2->version @@ -266,8 +191,7 @@ int cie_compare (c1, c2) && c1->per_encoding == c2->per_encoding && c1->lsda_encoding == c2->lsda_encoding && c1->fde_encoding == c2->fde_encoding - && (c1->initial_insn_length - == c2->initial_insn_length) + && c1->initial_insn_length == c2->initial_insn_length && memcmp (c1->initial_instructions, c2->initial_instructions, c1->initial_insn_length) == 0) @@ -278,35 +202,32 @@ int cie_compare (c1, c2) /* This function is called for each input file before the .eh_frame section is relocated. It discards duplicate CIEs and FDEs for discarded - functions. The function returns true iff any entries have been + functions. The function returns TRUE iff any entries have been deleted. */ -boolean -_bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, - reloc_symbol_deleted_p, cookie) - bfd *abfd; - struct bfd_link_info *info; - asection *sec, *ehdrsec; - boolean (*reloc_symbol_deleted_p) (bfd_vma, PTR); - struct elf_reloc_cookie *cookie; +bfd_boolean +_bfd_elf_discard_section_eh_frame + (bfd *abfd, struct bfd_link_info *info, asection *sec, + bfd_boolean (*reloc_symbol_deleted_p) (bfd_vma, void *), + struct elf_reloc_cookie *cookie) { bfd_byte *ehbuf = NULL, *buf; bfd_byte *last_cie, *last_fde; struct cie_header hdr; struct cie cie; + struct elf_link_hash_table *htab; struct eh_frame_hdr_info *hdr_info; struct eh_frame_sec_info *sec_info = NULL; unsigned int leb128_tmp; unsigned int cie_usage_count, last_cie_ndx, i, offset; unsigned int make_relative, make_lsda_relative; - Elf_Internal_Rela *rel; bfd_size_type new_size; unsigned int ptr_size; if (sec->_raw_size == 0) { /* This file does not contain .eh_frame information. */ - return false; + return FALSE; } if ((sec->output_section != NULL @@ -314,22 +235,19 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, { /* At least one of the sections is being discarded from the link, so we should just ignore them. */ - return false; + return FALSE; } - BFD_ASSERT (elf_section_data (ehdrsec)->sec_info_type - == ELF_INFO_TYPE_EH_FRAME_HDR); - hdr_info = (struct eh_frame_hdr_info *) - elf_section_data (ehdrsec)->sec_info; + htab = elf_hash_table (info); + hdr_info = &htab->eh_info; /* Read the frame unwind information from abfd. */ - ehbuf = (bfd_byte *) bfd_malloc (sec->_raw_size); + ehbuf = bfd_malloc (sec->_raw_size); if (ehbuf == NULL) goto free_no_table; - if (! bfd_get_section_contents (abfd, sec, ehbuf, (bfd_vma) 0, - sec->_raw_size)) + if (! bfd_get_section_contents (abfd, sec, ehbuf, 0, sec->_raw_size)) goto free_no_table; if (sec->_raw_size >= 4 @@ -338,7 +256,7 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, { /* Empty .eh_frame section. */ free (ehbuf); - return false; + return FALSE; } /* If .eh_frame section size doesn't fit into int, we cannot handle @@ -365,7 +283,8 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, #define ENSURE_NO_RELOCS(buf) \ if (cookie->rel < cookie->relend \ && (cookie->rel->r_offset \ - < (bfd_size_type) ((buf) - ehbuf))) \ + < (bfd_size_type) ((buf) - ehbuf)) \ + && cookie->rel->r_info != 0) \ goto free_no_table #define SKIP_RELOCS(buf) \ @@ -448,11 +367,15 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, /* CIE */ if (last_cie != NULL) { - /* Now check if this CIE is identical to last CIE, in which case - we can remove it, provided we adjust all FDEs. - Also, it can be removed if we have removed all FDEs using - that. */ - if (cie_compare (&cie, &hdr_info->last_cie) == 0 + /* Now check if this CIE is identical to the last CIE, + in which case we can remove it provided we adjust + all FDEs. Also, it can be removed if we have removed + all FDEs using it. */ + if ((!info->relocatable + && hdr_info->last_cie_sec + && (sec->output_section + == hdr_info->last_cie_sec->output_section) + && cie_compare (&cie, &hdr_info->last_cie) == 0) || cie_usage_count == 0) { new_size -= cie.hdr.length + 4; @@ -506,6 +429,11 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, } read_uleb128 (cie.code_align, buf); read_sleb128 (cie.data_align, buf); + /* Note - in DWARF2 the return address column is an unsigned byte. + In DWARF3 it is a ULEB128. We are following DWARF3. For most + ports this will not matter as the value will be less than 128. + For the others (eg FRV, SH, MMIX, IA64) they need a fixed GCC + which conforms to the DWARF3 standard. */ read_uleb128 (cie.ra_column, buf); ENSURE_NO_RELOCS (buf); cie.lsda_encoding = DW_EH_PE_omit; @@ -550,10 +478,9 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, + ((buf - ehbuf + per_width - 1) & ~((bfd_size_type) per_width - 1))); ENSURE_NO_RELOCS (buf); - rel = GET_RELOC (buf); /* Ensure we have a reloc here, against a global symbol. */ - if (rel != NULL) + if (GET_RELOC (buf) != NULL) { unsigned long r_symndx; @@ -591,10 +518,16 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, /* For shared libraries, try to get rid of as many RELATIVE relocs as possible. */ if (info->shared + && (get_elf_backend_data (abfd) + ->elf_backend_can_make_relative_eh_frame + (abfd, info, sec)) && (cie.fde_encoding & 0xf0) == DW_EH_PE_absptr) cie.make_relative = 1; if (info->shared + && (get_elf_backend_data (abfd) + ->elf_backend_can_make_lsda_relative_eh_frame + (abfd, info, sec)) && (cie.lsda_encoding & 0xf0) == DW_EH_PE_absptr) cie.make_lsda_relative = 1; @@ -621,17 +554,15 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, goto free_no_table; ENSURE_NO_RELOCS (buf); - rel = GET_RELOC (buf); - if (rel == NULL) + if (GET_RELOC (buf) == NULL) /* This should not happen. */ goto free_no_table; if ((*reloc_symbol_deleted_p) (buf - ehbuf, cookie)) { - /* This is a FDE against discarded section, it should + /* This is a FDE against a discarded section. It should be deleted. */ new_size -= hdr.length + 4; sec_info->entry[sec_info->count].removed = 1; - memset (rel, 0, sizeof (*rel)); } else { @@ -640,16 +571,15 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, && cie.make_relative == 0) || (cie.fde_encoding & 0xf0) == DW_EH_PE_aligned)) { - /* If shared library uses absolute pointers + /* If a shared library uses absolute pointers which we cannot turn into PC relative, don't create the binary search table, since it is affected by runtime relocations. */ - hdr_info->table = false; + hdr_info->table = FALSE; } cie_usage_count++; hdr_info->fde_count++; } - cookie->rel = rel; if (cie.lsda_encoding != DW_EH_PE_omit) { unsigned int dummy; @@ -672,7 +602,7 @@ _bfd_elf_discard_section_eh_frame (abfd, info, sec, ehdrsec, } elf_section_data (sec)->sec_info = sec_info; - elf_section_data (sec)->sec_info_type = ELF_INFO_TYPE_EH_FRAME; + sec->sec_info_type = ELF_INFO_TYPE_EH_FRAME; /* Ok, now we can assign new offsets. */ offset = 0; @@ -730,47 +660,36 @@ free_no_table: free (ehbuf); if (sec_info) free (sec_info); - hdr_info->table = false; + hdr_info->table = FALSE; hdr_info->last_cie.hdr.length = 0; - return false; + return FALSE; } /* This function is called for .eh_frame_hdr section after _bfd_elf_discard_section_eh_frame has been called on all .eh_frame input sections. It finalizes the size of .eh_frame_hdr section. */ -boolean -_bfd_elf_discard_section_eh_frame_hdr (abfd, info, sec) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; +bfd_boolean +_bfd_elf_discard_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info) { + struct elf_link_hash_table *htab; struct eh_frame_hdr_info *hdr_info; - unsigned int ptr_size; - - ptr_size = (elf_elfheader (abfd)->e_ident[EI_CLASS] - == ELFCLASS64) ? 8 : 4; + asection *sec; - if ((elf_section_data (sec)->sec_info_type - != ELF_INFO_TYPE_EH_FRAME_HDR) - || ! info->eh_frame_hdr) - { - _bfd_strip_section_from_output (info, sec); - return false; - } + htab = elf_hash_table (info); + hdr_info = &htab->eh_info; + sec = hdr_info->hdr_sec; + if (sec == NULL) + return FALSE; - hdr_info = (struct eh_frame_hdr_info *) - elf_section_data (sec)->sec_info; - if (hdr_info->strip) - return false; sec->_cooked_size = EH_FRAME_HDR_SIZE; if (hdr_info->table) sec->_cooked_size += 4 + hdr_info->fde_count * 8; /* Request program headers to be recalculated. */ elf_tdata (abfd)->program_header_size = 0; - elf_tdata (abfd)->eh_frame_hdr = true; - return true; + elf_tdata (abfd)->eh_frame_hdr = sec; + return TRUE; } /* This function is called from size_dynamic_sections. @@ -778,25 +697,24 @@ _bfd_elf_discard_section_eh_frame_hdr (abfd, info, sec) because later on it is too late for calling _bfd_strip_section_from_output, since dynamic symbol table has been sized. */ -boolean -_bfd_elf_maybe_strip_eh_frame_hdr (info) - struct bfd_link_info *info; +bfd_boolean +_bfd_elf_maybe_strip_eh_frame_hdr (struct bfd_link_info *info) { - asection *sec, *o; + asection *o; bfd *abfd; + struct elf_link_hash_table *htab; struct eh_frame_hdr_info *hdr_info; - sec = bfd_get_section_by_name (elf_hash_table (info)->dynobj, ".eh_frame_hdr"); - if (sec == NULL || bfd_is_abs_section (sec->output_section)) - return true; - - hdr_info - = bfd_zmalloc (sizeof (struct eh_frame_hdr_info)); - if (hdr_info == NULL) - return false; + htab = elf_hash_table (info); + hdr_info = &htab->eh_info; + if (hdr_info->hdr_sec == NULL) + return TRUE; - elf_section_data (sec)->sec_info = hdr_info; - elf_section_data (sec)->sec_info_type = ELF_INFO_TYPE_EH_FRAME_HDR; + if (bfd_is_abs_section (hdr_info->hdr_sec->output_section)) + { + hdr_info->hdr_sec = NULL; + return TRUE; + } abfd = NULL; if (info->eh_frame_hdr) @@ -811,12 +729,13 @@ _bfd_elf_maybe_strip_eh_frame_hdr (info) if (abfd == NULL) { - _bfd_strip_section_from_output (info, sec); - hdr_info->strip = true; + _bfd_strip_section_from_output (info, hdr_info->hdr_sec); + hdr_info->hdr_sec = NULL; + return TRUE; } - else - hdr_info->table = true; - return true; + + hdr_info->table = TRUE; + return TRUE; } /* Adjust an address in the .eh_frame section. Given OFFSET within @@ -825,18 +744,16 @@ _bfd_elf_maybe_strip_eh_frame_hdr (info) or to offset with dynamic relocation which is no longer needed. */ bfd_vma -_bfd_elf_eh_frame_section_offset (output_bfd, sec, offset) - bfd *output_bfd ATTRIBUTE_UNUSED; - asection *sec; - bfd_vma offset; +_bfd_elf_eh_frame_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED, + asection *sec, + bfd_vma offset) { struct eh_frame_sec_info *sec_info; unsigned int lo, hi, mid; - if (elf_section_data (sec)->sec_info_type != ELF_INFO_TYPE_EH_FRAME) + if (sec->sec_info_type != ELF_INFO_TYPE_EH_FRAME) return offset; - sec_info = (struct eh_frame_sec_info *) - elf_section_data (sec)->sec_info; + sec_info = elf_section_data (sec)->sec_info; if (offset >= sec->_raw_size) return offset - (sec->_cooked_size - sec->_raw_size); @@ -873,9 +790,8 @@ _bfd_elf_eh_frame_section_offset (output_bfd, sec, offset) for run-time relocation against LSDA field. */ if (sec_info->entry[mid].make_lsda_relative && ! sec_info->entry[mid].cie - && (offset - == (sec_info->entry[mid].offset + 8 - + sec_info->entry[mid].lsda_offset))) + && (offset == (sec_info->entry[mid].offset + 8 + + sec_info->entry[mid].lsda_offset))) return (bfd_vma) -2; return (offset + sec_info->entry[mid].new_offset @@ -885,13 +801,14 @@ _bfd_elf_eh_frame_section_offset (output_bfd, sec, offset) /* Write out .eh_frame section. This is called with the relocated contents. */ -boolean -_bfd_elf_write_section_eh_frame (abfd, sec, ehdrsec, contents) - bfd *abfd; - asection *sec, *ehdrsec; - bfd_byte *contents; +bfd_boolean +_bfd_elf_write_section_eh_frame (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + bfd_byte *contents) { struct eh_frame_sec_info *sec_info; + struct elf_link_hash_table *htab; struct eh_frame_hdr_info *hdr_info; unsigned int i; bfd_byte *p, *buf; @@ -902,26 +819,17 @@ _bfd_elf_write_section_eh_frame (abfd, sec, ehdrsec, contents) ptr_size = (elf_elfheader (sec->owner)->e_ident[EI_CLASS] == ELFCLASS64) ? 8 : 4; - if (elf_section_data (sec)->sec_info_type != ELF_INFO_TYPE_EH_FRAME) - return bfd_set_section_contents (abfd, sec->output_section, - contents, - (file_ptr) sec->output_offset, - sec->_raw_size); - sec_info = (struct eh_frame_sec_info *) - elf_section_data (sec)->sec_info; - hdr_info = NULL; - if (ehdrsec - && (elf_section_data (ehdrsec)->sec_info_type - == ELF_INFO_TYPE_EH_FRAME_HDR)) - { - hdr_info = (struct eh_frame_hdr_info *) - elf_section_data (ehdrsec)->sec_info; - if (hdr_info->table && hdr_info->array == NULL) - hdr_info->array - = bfd_malloc (hdr_info->fde_count * sizeof(*hdr_info->array)); - if (hdr_info->array == NULL) - hdr_info = NULL; - } + if (sec->sec_info_type != ELF_INFO_TYPE_EH_FRAME) + return bfd_set_section_contents (abfd, sec->output_section, contents, + sec->output_offset, sec->_raw_size); + sec_info = elf_section_data (sec)->sec_info; + htab = elf_hash_table (info); + hdr_info = &htab->eh_info; + if (hdr_info->table && hdr_info->array == NULL) + hdr_info->array + = bfd_malloc (hdr_info->fde_count * sizeof(*hdr_info->array)); + if (hdr_info->array == NULL) + hdr_info = NULL; p = contents; for (i = 0; i < sec_info->count; ++i) @@ -1005,7 +913,9 @@ _bfd_elf_write_section_eh_frame (abfd, sec, ehdrsec, contents) { bfd_vma value; - value = read_value (abfd, buf, per_width); + value = read_value (abfd, buf, per_width, + get_DW_EH_PE_signed + (per_encoding)); value += (sec_info->entry[i].offset - sec_info->entry[i].new_offset); write_value (abfd, buf, value, per_width); @@ -1034,14 +944,16 @@ _bfd_elf_write_section_eh_frame (abfd, sec, ehdrsec, contents) unsigned int width; buf = contents + sec_info->entry[i].offset; - /* Skip length. */ + /* Skip length. */ buf += 4; bfd_put_32 (abfd, sec_info->entry[i].new_offset + 4 - cie_offset, buf); buf += 4; width = get_DW_EH_PE_width (sec_info->entry[i].fde_encoding, ptr_size); - address = value = read_value (abfd, buf, width); + address = value = read_value (abfd, buf, width, + get_DW_EH_PE_signed + (sec_info->entry[i].fde_encoding)); if (value) { switch (sec_info->entry[i].fde_encoding & 0xf0) @@ -1085,7 +997,9 @@ _bfd_elf_write_section_eh_frame (abfd, sec, ehdrsec, contents) buf += sec_info->entry[i].lsda_offset; width = get_DW_EH_PE_width (sec_info->entry[i].lsda_encoding, ptr_size); - value = read_value (abfd, buf, width); + value = read_value (abfd, buf, width, + get_DW_EH_PE_signed + (sec_info->entry[i].lsda_encoding)); if (value) { if ((sec_info->entry[i].lsda_encoding & 0xf0) @@ -1121,6 +1035,42 @@ _bfd_elf_write_section_eh_frame (abfd, sec, ehdrsec, contents) and 3xDW_CFA_nop as pad */ p += 16; } + else + { + unsigned int alignment = 1 << sec->alignment_power; + unsigned int pad = sec->_cooked_size % alignment; + + /* Don't pad beyond the raw size of the output section. It + can happen at the last input section. */ + if (pad + && ((sec->output_offset + sec->_cooked_size + pad) + <= sec->output_section->_raw_size)) + { + /* Find the last CIE/FDE. */ + for (i = sec_info->count - 1; i > 0; i--) + if (! sec_info->entry[i].removed) + break; + + /* The size of the last CIE/FDE must be at least 4. */ + if (sec_info->entry[i].removed + || sec_info->entry[i].size < 4) + abort (); + + pad = alignment - pad; + + buf = contents + sec_info->entry[i].new_offset; + + /* Update length. */ + sec_info->entry[i].size += pad; + bfd_put_32 (abfd, sec_info->entry[i].size - 4, buf); + + /* Pad it with DW_CFA_nop */ + memset (p, 0, pad); + p += pad; + + sec->_cooked_size += pad; + } + } BFD_ASSERT ((bfd_size_type) (p - contents) == sec->_cooked_size); @@ -1133,12 +1083,10 @@ _bfd_elf_write_section_eh_frame (abfd, sec, ehdrsec, contents) VMA of FDE initial location. */ static int -vma_compare (a, b) - const PTR a; - const PTR b; +vma_compare (const void *a, const void *b) { - struct eh_frame_array_ent *p = (struct eh_frame_array_ent *) a; - struct eh_frame_array_ent *q = (struct eh_frame_array_ent *) b; + const struct eh_frame_array_ent *p = a; + const struct eh_frame_array_ent *q = b; if (p->initial_loc > q->initial_loc) return 1; if (p->initial_loc < q->initial_loc) @@ -1166,55 +1114,58 @@ vma_compare (a, b) fde_count x [encoded] initial_loc, fde (array of encoded pairs containing FDE initial_location field and FDE address, - sorted by increasing initial_loc) */ + sorted by increasing initial_loc). */ -boolean -_bfd_elf_write_section_eh_frame_hdr (abfd, sec) - bfd *abfd; - asection *sec; +bfd_boolean +_bfd_elf_write_section_eh_frame_hdr (bfd *abfd, struct bfd_link_info *info) { + struct elf_link_hash_table *htab; struct eh_frame_hdr_info *hdr_info; - unsigned int ptr_size; + asection *sec; bfd_byte *contents; asection *eh_frame_sec; bfd_size_type size; + bfd_boolean retval; + bfd_vma encoded_eh_frame; - ptr_size = (elf_elfheader (sec->owner)->e_ident[EI_CLASS] - == ELFCLASS64) ? 8 : 4; - - BFD_ASSERT (elf_section_data (sec)->sec_info_type - == ELF_INFO_TYPE_EH_FRAME_HDR); - hdr_info = (struct eh_frame_hdr_info *) - elf_section_data (sec)->sec_info; - if (hdr_info->strip) - return true; + htab = elf_hash_table (info); + hdr_info = &htab->eh_info; + sec = hdr_info->hdr_sec; + if (sec == NULL) + return TRUE; size = EH_FRAME_HDR_SIZE; if (hdr_info->array && hdr_info->array_count == hdr_info->fde_count) size += 4 + hdr_info->fde_count * 8; contents = bfd_malloc (size); if (contents == NULL) - return false; + return FALSE; eh_frame_sec = bfd_get_section_by_name (abfd, ".eh_frame"); if (eh_frame_sec == NULL) - return false; + { + free (contents); + return FALSE; + } memset (contents, 0, EH_FRAME_HDR_SIZE); - contents[0] = 1; /* Version */ - contents[1] = DW_EH_PE_pcrel | DW_EH_PE_sdata4; /* .eh_frame offset */ + contents[0] = 1; /* Version. */ + contents[1] = get_elf_backend_data (abfd)->elf_backend_encode_eh_address + (abfd, info, eh_frame_sec, 0, sec, 4, + &encoded_eh_frame); /* .eh_frame offset. */ + if (hdr_info->array && hdr_info->array_count == hdr_info->fde_count) { - contents[2] = DW_EH_PE_udata4; /* FDE count encoding */ - contents[3] = DW_EH_PE_datarel | DW_EH_PE_sdata4; /* search table enc */ + contents[2] = DW_EH_PE_udata4; /* FDE count encoding. */ + contents[3] = DW_EH_PE_datarel | DW_EH_PE_sdata4; /* Search table enc. */ } else { contents[2] = DW_EH_PE_omit; contents[3] = DW_EH_PE_omit; } - bfd_put_32 (abfd, eh_frame_sec->vma - sec->output_section->vma - 4, - contents + 4); + bfd_put_32 (abfd, encoded_eh_frame, contents + 4); + if (contents[2] != DW_EH_PE_omit) { unsigned int i; @@ -1234,7 +1185,35 @@ _bfd_elf_write_section_eh_frame_hdr (abfd, sec) } } - return bfd_set_section_contents (abfd, sec->output_section, - contents, (file_ptr) sec->output_offset, - sec->_cooked_size); + retval = bfd_set_section_contents (abfd, sec->output_section, + contents, (file_ptr) sec->output_offset, + sec->_cooked_size); + free (contents); + return retval; +} + +/* Decide whether we can use a PC-relative encoding within the given + EH frame section. This is the default implementation. */ + +bfd_boolean +_bfd_elf_can_make_relative (bfd *input_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + asection *eh_frame_section ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +/* Select an encoding for the given address. Preference is given to + PC-relative addressing modes. */ + +bfd_byte +_bfd_elf_encode_eh_address (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + asection *osec, bfd_vma offset, + asection *loc_sec, bfd_vma loc_offset, + bfd_vma *encoded) +{ + *encoded = osec->vma + offset - + (loc_sec->output_section->vma + loc_sec->output_offset + loc_offset); + return DW_EH_PE_pcrel | DW_EH_PE_sdata4; } diff --git a/contrib/binutils/bfd/elf-strtab.c b/contrib/binutils/bfd/elf-strtab.c index 7a993c2..673b9d7 100644 --- a/contrib/binutils/bfd/elf-strtab.c +++ b/contrib/binutils/bfd/elf-strtab.c @@ -1,5 +1,5 @@ /* ELF strtab with GC and suffix merging support. - Copyright 2001, 2002 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003 Free Software Foundation, Inc. Written by Jakub Jelinek . This file is part of BFD, the Binary File Descriptor library. @@ -30,15 +30,14 @@ struct elf_strtab_hash_entry { struct bfd_hash_entry root; - /* Length of this entry. */ - unsigned int len; + /* Length of this entry. This includes the zero terminator. */ + int len; unsigned int refcount; union { /* Index within the merged section. */ bfd_size_type index; - /* Entry this is a suffix of (if len is 0). */ + /* Entry this is a suffix of (if len < 0). */ struct elf_strtab_hash_entry *suffix; - struct elf_strtab_hash_entry *next; } u; }; @@ -57,53 +56,46 @@ struct elf_strtab_hash struct elf_strtab_hash_entry **array; }; -static struct bfd_hash_entry *elf_strtab_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static int cmplengthentry PARAMS ((const PTR, const PTR)); -static int last4_eq PARAMS ((const PTR, const PTR)); - /* Routine to create an entry in a section merge hashtab. */ static struct bfd_hash_entry * -elf_strtab_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +elf_strtab_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { - struct elf_strtab_hash_entry *ret = (struct elf_strtab_hash_entry *) entry; - /* Allocate the structure if it has not already been allocated by a subclass. */ - if (ret == (struct elf_strtab_hash_entry *) NULL) - ret = ((struct elf_strtab_hash_entry *) - bfd_hash_allocate (table, sizeof (struct elf_strtab_hash_entry))); - if (ret == (struct elf_strtab_hash_entry *) NULL) + if (entry == NULL) + entry = bfd_hash_allocate (table, sizeof (struct elf_strtab_hash_entry)); + if (entry == NULL) return NULL; /* Call the allocation method of the superclass. */ - ret = ((struct elf_strtab_hash_entry *) - bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); + entry = bfd_hash_newfunc (entry, table, string); - if (ret) + if (entry) { /* Initialize the local fields. */ + struct elf_strtab_hash_entry *ret; + + ret = (struct elf_strtab_hash_entry *) entry; ret->u.index = -1; ret->refcount = 0; ret->len = 0; } - return (struct bfd_hash_entry *)ret; + return entry; } /* Create a new hash table. */ struct elf_strtab_hash * -_bfd_elf_strtab_init () +_bfd_elf_strtab_init (void) { struct elf_strtab_hash *table; bfd_size_type amt = sizeof (struct elf_strtab_hash); - table = (struct elf_strtab_hash *) bfd_malloc (amt); + table = bfd_malloc (amt); if (table == NULL) return NULL; @@ -117,8 +109,7 @@ _bfd_elf_strtab_init () table->size = 1; table->alloced = 64; amt = sizeof (struct elf_strtab_hasn_entry *); - table->array = (struct elf_strtab_hash_entry **) - bfd_malloc (table->alloced * amt); + table->array = bfd_malloc (table->alloced * amt); if (table->array == NULL) { free (table); @@ -133,8 +124,7 @@ _bfd_elf_strtab_init () /* Free a strtab. */ void -_bfd_elf_strtab_free (tab) - struct elf_strtab_hash *tab; +_bfd_elf_strtab_free (struct elf_strtab_hash *tab) { bfd_hash_table_free (&tab->table); free (tab->array); @@ -145,10 +135,9 @@ _bfd_elf_strtab_free (tab) already present. */ bfd_size_type -_bfd_elf_strtab_add (tab, str, copy) - struct elf_strtab_hash *tab; - const char *str; - boolean copy; +_bfd_elf_strtab_add (struct elf_strtab_hash *tab, + const char *str, + bfd_boolean copy) { register struct elf_strtab_hash_entry *entry; @@ -159,7 +148,7 @@ _bfd_elf_strtab_add (tab, str, copy) BFD_ASSERT (tab->sec_size == 0); entry = (struct elf_strtab_hash_entry *) - bfd_hash_lookup (&tab->table, str, true, copy); + bfd_hash_lookup (&tab->table, str, TRUE, copy); if (entry == NULL) return (bfd_size_type) -1; @@ -168,12 +157,13 @@ _bfd_elf_strtab_add (tab, str, copy) if (entry->len == 0) { entry->len = strlen (str) + 1; + /* 2G strings lose. */ + BFD_ASSERT (entry->len > 0); if (tab->size == tab->alloced) { bfd_size_type amt = sizeof (struct elf_strtab_hash_entry *); tab->alloced *= 2; - tab->array = (struct elf_strtab_hash_entry **) - bfd_realloc (tab->array, tab->alloced * amt); + tab->array = bfd_realloc (tab->array, tab->alloced * amt); if (tab->array == NULL) return (bfd_size_type) -1; } @@ -185,9 +175,7 @@ _bfd_elf_strtab_add (tab, str, copy) } void -_bfd_elf_strtab_addref (tab, idx) - struct elf_strtab_hash *tab; - bfd_size_type idx; +_bfd_elf_strtab_addref (struct elf_strtab_hash *tab, bfd_size_type idx) { if (idx == 0 || idx == (bfd_size_type) -1) return; @@ -197,9 +185,7 @@ _bfd_elf_strtab_addref (tab, idx) } void -_bfd_elf_strtab_delref (tab, idx) - struct elf_strtab_hash *tab; - bfd_size_type idx; +_bfd_elf_strtab_delref (struct elf_strtab_hash *tab, bfd_size_type idx) { if (idx == 0 || idx == (bfd_size_type) -1) return; @@ -210,8 +196,7 @@ _bfd_elf_strtab_delref (tab, idx) } void -_bfd_elf_strtab_clear_all_refs (tab) - struct elf_strtab_hash *tab; +_bfd_elf_strtab_clear_all_refs (struct elf_strtab_hash *tab) { bfd_size_type idx; @@ -220,16 +205,13 @@ _bfd_elf_strtab_clear_all_refs (tab) } bfd_size_type -_bfd_elf_strtab_size (tab) - struct elf_strtab_hash *tab; +_bfd_elf_strtab_size (struct elf_strtab_hash *tab) { return tab->sec_size ? tab->sec_size : tab->size; } bfd_size_type -_bfd_elf_strtab_offset (tab, idx) - struct elf_strtab_hash *tab; - bfd_size_type idx; +_bfd_elf_strtab_offset (struct elf_strtab_hash *tab, bfd_size_type idx) { struct elf_strtab_hash_entry *entry; @@ -243,88 +225,80 @@ _bfd_elf_strtab_offset (tab, idx) return tab->array[idx]->u.index; } -boolean -_bfd_elf_strtab_emit (abfd, tab) - register bfd *abfd; - struct elf_strtab_hash *tab; +bfd_boolean +_bfd_elf_strtab_emit (register bfd *abfd, struct elf_strtab_hash *tab) { bfd_size_type off = 1, i; if (bfd_bwrite ("", 1, abfd) != 1) - return false; + return FALSE; for (i = 1; i < tab->size; ++i) { register const char *str; - register size_t len; + register unsigned int len; - str = tab->array[i]->root.string; - len = tab->array[i]->len; BFD_ASSERT (tab->array[i]->refcount == 0); - if (len == 0) + len = tab->array[i]->len; + if ((int) len < 0) continue; - if (bfd_bwrite ((PTR) str, (bfd_size_type) len, abfd) != len) - return false; + str = tab->array[i]->root.string; + if (bfd_bwrite (str, len, abfd) != len) + return FALSE; off += len; } BFD_ASSERT (off == tab->sec_size); - return true; + return TRUE; } -/* Compare two elf_strtab_hash_entry structures. This is called via qsort. */ +/* Compare two elf_strtab_hash_entry structures. Called via qsort. */ static int -cmplengthentry (a, b) - const PTR a; - const PTR b; +strrevcmp (const void *a, const void *b) { - struct elf_strtab_hash_entry * A = *(struct elf_strtab_hash_entry **) a; - struct elf_strtab_hash_entry * B = *(struct elf_strtab_hash_entry **) b; - - if (A->len < B->len) - return 1; - else if (A->len > B->len) - return -1; - - return memcmp (A->root.string, B->root.string, A->len); + struct elf_strtab_hash_entry *A = *(struct elf_strtab_hash_entry **) a; + struct elf_strtab_hash_entry *B = *(struct elf_strtab_hash_entry **) b; + unsigned int lenA = A->len; + unsigned int lenB = B->len; + const unsigned char *s = A->root.string + lenA - 1; + const unsigned char *t = B->root.string + lenB - 1; + int l = lenA < lenB ? lenA : lenB; + + while (l) + { + if (*s != *t) + return (int) *s - (int) *t; + s--; + t--; + l--; + } + return lenA - lenB; } -static int -last4_eq (a, b) - const PTR a; - const PTR b; +static inline int +is_suffix (const struct elf_strtab_hash_entry *A, + const struct elf_strtab_hash_entry *B) { - struct elf_strtab_hash_entry * A = (struct elf_strtab_hash_entry *) a; - struct elf_strtab_hash_entry * B = (struct elf_strtab_hash_entry *) b; - - if (memcmp (A->root.string + A->len - 5, B->root.string + B->len - 5, 4) - != 0) - /* This was a hashtable collision. */ - return 0; - if (A->len <= B->len) /* B cannot be a suffix of A unless A is equal to B, which is guaranteed not to be equal by the hash table. */ return 0; return memcmp (A->root.string + (A->len - B->len), - B->root.string, B->len - 5) == 0; + B->root.string, B->len - 1) == 0; } /* This function assigns final string table offsets for used strings, merging strings matching suffixes of longer strings if possible. */ void -_bfd_elf_strtab_finalize (tab) - struct elf_strtab_hash *tab; +_bfd_elf_strtab_finalize (struct elf_strtab_hash *tab) { - struct elf_strtab_hash_entry **array, **a, **end, *e; - htab_t last4tab = NULL; + struct elf_strtab_hash_entry **array, **a, *e; bfd_size_type size, amt; - struct elf_strtab_hash_entry *last[256], **last_ptr[256]; /* GCC 2.91.66 (egcs-1.1.2) on i386 miscompiles this function when i is a 64-bit bfd_size_type: a 64-bit target or --enable-64-bit-bfd. @@ -332,105 +306,71 @@ _bfd_elf_strtab_finalize (tab) cycles. */ size_t i; - /* Now sort the strings by length, longest first. */ - array = NULL; + /* Sort the strings by suffix and length. */ amt = tab->size * sizeof (struct elf_strtab_hash_entry *); - array = (struct elf_strtab_hash_entry **) bfd_malloc (amt); + array = bfd_malloc (amt); if (array == NULL) goto alloc_failure; - memset (last, 0, sizeof (last)); - for (i = 0; i < 256; ++i) - last_ptr[i] = &last[i]; for (i = 1, a = array; i < tab->size; ++i) - if (tab->array[i]->refcount) - *a++ = tab->array[i]; - else - tab->array[i]->len = 0; + { + e = tab->array[i]; + if (e->refcount) + { + *a++ = e; + /* Adjust the length to not include the zero terminator. */ + e->len -= 1; + } + else + e->len = 0; + } size = a - array; + if (size != 0) + { + qsort (array, size, sizeof (struct elf_strtab_hash_entry *), strrevcmp); - qsort (array, size, sizeof (struct elf_strtab_hash_entry *), cmplengthentry); + /* Loop over the sorted array and merge suffixes. Start from the + end because we want eg. - last4tab = htab_create_alloc (size * 4, NULL, last4_eq, NULL, calloc, free); - if (last4tab == NULL) - goto alloc_failure; + s1 -> "d" + s2 -> "bcd" + s3 -> "abcd" - /* Now insert the strings into hash tables (strings with last 4 characters - and strings with last character equal), look for longer strings which - we're suffix of. */ - for (a = array, end = array + size; a < end; a++) - { - register hashval_t hash; - unsigned int c; - unsigned int j; - const unsigned char *s; - PTR *p; - - e = *a; - if (e->len > 4) - { - s = e->root.string + e->len - 1; - hash = 0; - for (j = 0; j < 4; j++) - { - c = *--s; - hash += c + (c << 17); - hash ^= hash >> 2; - } - p = htab_find_slot_with_hash (last4tab, e, hash, INSERT); - if (p == NULL) - goto alloc_failure; - if (*p) - { - struct elf_strtab_hash_entry *ent; + to end up as - ent = (struct elf_strtab_hash_entry *) *p; - e->u.suffix = ent; - e->len = 0; - continue; - } - else - *p = (PTR) e; - } - else - { - struct elf_strtab_hash_entry *tem; + s3 -> "abcd" + s2 _____^ + s1 _______^ - c = e->root.string[e->len - 2] & 0xff; + ie. we don't want s1 pointing into the old s2. */ + e = *--a; + e->len += 1; + while (--a >= array) + { + struct elf_strtab_hash_entry *cmp = *a; - for (tem = last[c]; tem; tem = tem->u.next) - if (tem->len > e->len - && memcmp (tem->root.string + (tem->len - e->len), - e->root.string, e->len - 1) == 0) - break; - if (tem) + cmp->len += 1; + if (is_suffix (e, cmp)) { - e->u.suffix = tem; - e->len = 0; - continue; + cmp->u.suffix = e; + cmp->len = -cmp->len; } + else + e = cmp; } - - c = e->root.string[e->len - 2] & 0xff; - /* Put longest strings first. */ - *last_ptr[c] = e; - last_ptr[c] = &e->u.next; - e->u.next = NULL; } alloc_failure: if (array) free (array); - if (last4tab) - htab_delete (last4tab); - /* Now assign positions to the strings we want to keep. */ + /* Assign positions to the strings we want to keep. */ size = 1; for (i = 1; i < tab->size; ++i) { e = tab->array[i]; - if (e->refcount && e->len) + if (e->refcount && e->len > 0) { e->u.index = size; size += e->len; @@ -439,12 +379,11 @@ alloc_failure: tab->sec_size = size; - /* And now adjust the rest. */ + /* Adjust the rest. */ for (i = 1; i < tab->size; ++i) { e = tab->array[i]; - if (e->refcount && ! e->len) - e->u.index = e->u.suffix->u.index - + (e->u.suffix->len - strlen (e->root.string) - 1); + if (e->refcount && e->len < 0) + e->u.index = e->u.suffix->u.index + (e->u.suffix->len + e->len); } } diff --git a/contrib/binutils/bfd/elf.c b/contrib/binutils/bfd/elf.c index 6a3a78e..a14fd35 100644 --- a/contrib/binutils/bfd/elf.c +++ b/contrib/binutils/bfd/elf.c @@ -1,22 +1,23 @@ /* ELF executable support for BFD. - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. -This file is part of BFD, the Binary File Descriptor library. + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, + 2002, 2003, 2004 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This file is part of BFD, the Binary File Descriptor library. -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 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. -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 program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* SECTION @@ -40,40 +41,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf-bfd.h" #include "libiberty.h" -static INLINE struct elf_segment_map *make_mapping - PARAMS ((bfd *, asection **, unsigned int, unsigned int, boolean)); -static boolean map_sections_to_segments PARAMS ((bfd *)); -static int elf_sort_sections PARAMS ((const PTR, const PTR)); -static boolean assign_file_positions_for_segments PARAMS ((bfd *)); -static boolean assign_file_positions_except_relocs PARAMS ((bfd *)); -static boolean prep_headers PARAMS ((bfd *)); -static boolean swap_out_syms PARAMS ((bfd *, struct bfd_strtab_hash **, int)); -static boolean copy_private_bfd_data PARAMS ((bfd *, bfd *)); -static char *elf_read PARAMS ((bfd *, file_ptr, bfd_size_type)); -static const char *group_signature PARAMS ((bfd *, Elf_Internal_Shdr *)); -static boolean setup_group PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); -static void merge_sections_remove_hook PARAMS ((bfd *, asection *)); -static void elf_fake_sections PARAMS ((bfd *, asection *, PTR)); -static boolean assign_section_numbers PARAMS ((bfd *)); -static INLINE int sym_is_global PARAMS ((bfd *, asymbol *)); -static boolean elf_map_symbols PARAMS ((bfd *)); -static bfd_size_type get_program_header_size PARAMS ((bfd *)); -static boolean elfcore_read_notes PARAMS ((bfd *, file_ptr, bfd_size_type)); -static boolean elf_find_function PARAMS ((bfd *, asection *, asymbol **, - bfd_vma, const char **, - const char **)); -static int elfcore_make_pid PARAMS ((bfd *)); -static boolean elfcore_maybe_make_sect PARAMS ((bfd *, char *, asection *)); -static boolean elfcore_make_note_pseudosection PARAMS ((bfd *, char *, - Elf_Internal_Note *)); -static boolean elfcore_grok_prfpreg PARAMS ((bfd *, Elf_Internal_Note *)); -static boolean elfcore_grok_prxfpreg PARAMS ((bfd *, Elf_Internal_Note *)); -static boolean elfcore_grok_note PARAMS ((bfd *, Elf_Internal_Note *)); - -static boolean elfcore_netbsd_get_lwpid PARAMS ((Elf_Internal_Note *, int *)); -static boolean elfcore_grok_netbsd_procinfo PARAMS ((bfd *, - Elf_Internal_Note *)); -static boolean elfcore_grok_netbsd_note PARAMS ((bfd *, Elf_Internal_Note *)); +static int elf_sort_sections (const void *, const void *); +static bfd_boolean assign_file_positions_except_relocs (bfd *, struct bfd_link_info *); +static bfd_boolean prep_headers (bfd *); +static bfd_boolean swap_out_syms (bfd *, struct bfd_strtab_hash **, int) ; +static bfd_boolean elfcore_read_notes (bfd *, file_ptr, bfd_size_type) ; /* Swap version information in and out. The version information is currently size independent. If that ever changes, this code will @@ -82,10 +54,9 @@ static boolean elfcore_grok_netbsd_note PARAMS ((bfd *, Elf_Internal_Note *)); /* Swap in a Verdef structure. */ void -_bfd_elf_swap_verdef_in (abfd, src, dst) - bfd *abfd; - const Elf_External_Verdef *src; - Elf_Internal_Verdef *dst; +_bfd_elf_swap_verdef_in (bfd *abfd, + const Elf_External_Verdef *src, + Elf_Internal_Verdef *dst) { dst->vd_version = H_GET_16 (abfd, src->vd_version); dst->vd_flags = H_GET_16 (abfd, src->vd_flags); @@ -99,10 +70,9 @@ _bfd_elf_swap_verdef_in (abfd, src, dst) /* Swap out a Verdef structure. */ void -_bfd_elf_swap_verdef_out (abfd, src, dst) - bfd *abfd; - const Elf_Internal_Verdef *src; - Elf_External_Verdef *dst; +_bfd_elf_swap_verdef_out (bfd *abfd, + const Elf_Internal_Verdef *src, + Elf_External_Verdef *dst) { H_PUT_16 (abfd, src->vd_version, dst->vd_version); H_PUT_16 (abfd, src->vd_flags, dst->vd_flags); @@ -116,10 +86,9 @@ _bfd_elf_swap_verdef_out (abfd, src, dst) /* Swap in a Verdaux structure. */ void -_bfd_elf_swap_verdaux_in (abfd, src, dst) - bfd *abfd; - const Elf_External_Verdaux *src; - Elf_Internal_Verdaux *dst; +_bfd_elf_swap_verdaux_in (bfd *abfd, + const Elf_External_Verdaux *src, + Elf_Internal_Verdaux *dst) { dst->vda_name = H_GET_32 (abfd, src->vda_name); dst->vda_next = H_GET_32 (abfd, src->vda_next); @@ -128,10 +97,9 @@ _bfd_elf_swap_verdaux_in (abfd, src, dst) /* Swap out a Verdaux structure. */ void -_bfd_elf_swap_verdaux_out (abfd, src, dst) - bfd *abfd; - const Elf_Internal_Verdaux *src; - Elf_External_Verdaux *dst; +_bfd_elf_swap_verdaux_out (bfd *abfd, + const Elf_Internal_Verdaux *src, + Elf_External_Verdaux *dst) { H_PUT_32 (abfd, src->vda_name, dst->vda_name); H_PUT_32 (abfd, src->vda_next, dst->vda_next); @@ -140,10 +108,9 @@ _bfd_elf_swap_verdaux_out (abfd, src, dst) /* Swap in a Verneed structure. */ void -_bfd_elf_swap_verneed_in (abfd, src, dst) - bfd *abfd; - const Elf_External_Verneed *src; - Elf_Internal_Verneed *dst; +_bfd_elf_swap_verneed_in (bfd *abfd, + const Elf_External_Verneed *src, + Elf_Internal_Verneed *dst) { dst->vn_version = H_GET_16 (abfd, src->vn_version); dst->vn_cnt = H_GET_16 (abfd, src->vn_cnt); @@ -155,10 +122,9 @@ _bfd_elf_swap_verneed_in (abfd, src, dst) /* Swap out a Verneed structure. */ void -_bfd_elf_swap_verneed_out (abfd, src, dst) - bfd *abfd; - const Elf_Internal_Verneed *src; - Elf_External_Verneed *dst; +_bfd_elf_swap_verneed_out (bfd *abfd, + const Elf_Internal_Verneed *src, + Elf_External_Verneed *dst) { H_PUT_16 (abfd, src->vn_version, dst->vn_version); H_PUT_16 (abfd, src->vn_cnt, dst->vn_cnt); @@ -170,10 +136,9 @@ _bfd_elf_swap_verneed_out (abfd, src, dst) /* Swap in a Vernaux structure. */ void -_bfd_elf_swap_vernaux_in (abfd, src, dst) - bfd *abfd; - const Elf_External_Vernaux *src; - Elf_Internal_Vernaux *dst; +_bfd_elf_swap_vernaux_in (bfd *abfd, + const Elf_External_Vernaux *src, + Elf_Internal_Vernaux *dst) { dst->vna_hash = H_GET_32 (abfd, src->vna_hash); dst->vna_flags = H_GET_16 (abfd, src->vna_flags); @@ -185,10 +150,9 @@ _bfd_elf_swap_vernaux_in (abfd, src, dst) /* Swap out a Vernaux structure. */ void -_bfd_elf_swap_vernaux_out (abfd, src, dst) - bfd *abfd; - const Elf_Internal_Vernaux *src; - Elf_External_Vernaux *dst; +_bfd_elf_swap_vernaux_out (bfd *abfd, + const Elf_Internal_Vernaux *src, + Elf_External_Vernaux *dst) { H_PUT_32 (abfd, src->vna_hash, dst->vna_hash); H_PUT_16 (abfd, src->vna_flags, dst->vna_flags); @@ -200,10 +164,9 @@ _bfd_elf_swap_vernaux_out (abfd, src, dst) /* Swap in a Versym structure. */ void -_bfd_elf_swap_versym_in (abfd, src, dst) - bfd *abfd; - const Elf_External_Versym *src; - Elf_Internal_Versym *dst; +_bfd_elf_swap_versym_in (bfd *abfd, + const Elf_External_Versym *src, + Elf_Internal_Versym *dst) { dst->vs_vers = H_GET_16 (abfd, src->vs_vers); } @@ -211,10 +174,9 @@ _bfd_elf_swap_versym_in (abfd, src, dst) /* Swap out a Versym structure. */ void -_bfd_elf_swap_versym_out (abfd, src, dst) - bfd *abfd; - const Elf_Internal_Versym *src; - Elf_External_Versym *dst; +_bfd_elf_swap_versym_out (bfd *abfd, + const Elf_Internal_Versym *src, + Elf_External_Versym *dst) { H_PUT_16 (abfd, src->vs_vers, dst->vs_vers); } @@ -223,8 +185,7 @@ _bfd_elf_swap_versym_out (abfd, src, dst) cause invalid hash tables to be generated. */ unsigned long -bfd_elf_hash (namearg) - const char *namearg; +bfd_elf_hash (const char *namearg) { const unsigned char *name = (const unsigned char *) namearg; unsigned long h = 0; @@ -242,7 +203,7 @@ bfd_elf_hash (namearg) h ^= g; } } - return h; + return h & 0xffffffff; } /* Read a specified number of bytes at a specified offset in an ELF @@ -250,10 +211,7 @@ bfd_elf_hash (namearg) buffer. */ static char * -elf_read (abfd, offset, size) - bfd *abfd; - file_ptr offset; - bfd_size_type size; +elf_read (bfd *abfd, file_ptr offset, bfd_size_type size) { char *buf; @@ -261,7 +219,7 @@ elf_read (abfd, offset, size) return NULL; if (bfd_seek (abfd, offset, SEEK_SET) != 0) return NULL; - if (bfd_bread ((PTR) buf, size, abfd) != size) + if (bfd_bread (buf, size, abfd) != size) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_file_truncated); @@ -270,34 +228,29 @@ elf_read (abfd, offset, size) return buf; } -boolean -bfd_elf_mkobject (abfd) - bfd *abfd; +bfd_boolean +bfd_elf_mkobject (bfd *abfd) { /* This just does initialization. */ /* coff_mkobject zalloc's space for tdata.coff_obj_data ... */ - bfd_size_type amt = sizeof (struct elf_obj_tdata); - elf_tdata (abfd) = (struct elf_obj_tdata *) bfd_zalloc (abfd, amt); + elf_tdata (abfd) = bfd_zalloc (abfd, sizeof (struct elf_obj_tdata)); if (elf_tdata (abfd) == 0) - return false; + return FALSE; /* Since everything is done at close time, do we need any initialization? */ - return true; + return TRUE; } -boolean -bfd_elf_mkcorefile (abfd) - bfd *abfd; +bfd_boolean +bfd_elf_mkcorefile (bfd *abfd) { /* I think this can be done just like an object file. */ return bfd_elf_mkobject (abfd); } char * -bfd_elf_get_str_section (abfd, shindex) - bfd *abfd; - unsigned int shindex; +bfd_elf_get_str_section (bfd *abfd, unsigned int shindex) { Elf_Internal_Shdr **i_shdrp; char *shstrtab = NULL; @@ -315,16 +268,15 @@ bfd_elf_get_str_section (abfd, shindex) offset = i_shdrp[shindex]->sh_offset; shstrtabsize = i_shdrp[shindex]->sh_size; shstrtab = elf_read (abfd, offset, shstrtabsize); - i_shdrp[shindex]->contents = (PTR) shstrtab; + i_shdrp[shindex]->contents = shstrtab; } return shstrtab; } char * -bfd_elf_string_from_elf_section (abfd, shindex, strindex) - bfd *abfd; - unsigned int shindex; - unsigned int strindex; +bfd_elf_string_from_elf_section (bfd *abfd, + unsigned int shindex, + unsigned int strindex) { Elf_Internal_Shdr *hdr; @@ -359,24 +311,22 @@ bfd_elf_string_from_elf_section (abfd, shindex, strindex) symbols, and symbol section index extensions, respectively. */ Elf_Internal_Sym * -bfd_elf_get_elf_syms (ibfd, symtab_hdr, symcount, symoffset, - intsym_buf, extsym_buf, extshndx_buf) - bfd *ibfd; - Elf_Internal_Shdr *symtab_hdr; - size_t symcount; - size_t symoffset; - Elf_Internal_Sym *intsym_buf; - PTR extsym_buf; - Elf_External_Sym_Shndx *extshndx_buf; +bfd_elf_get_elf_syms (bfd *ibfd, + Elf_Internal_Shdr *symtab_hdr, + size_t symcount, + size_t symoffset, + Elf_Internal_Sym *intsym_buf, + void *extsym_buf, + Elf_External_Sym_Shndx *extshndx_buf) { Elf_Internal_Shdr *shndx_hdr; - PTR alloc_ext; + void *alloc_ext; const bfd_byte *esym; Elf_External_Sym_Shndx *alloc_extshndx; Elf_External_Sym_Shndx *shndx; Elf_Internal_Sym *isym; Elf_Internal_Sym *isymend; - struct elf_backend_data *bed; + const struct elf_backend_data *bed; size_t extsym_size; bfd_size_type amt; file_ptr pos; @@ -417,7 +367,7 @@ bfd_elf_get_elf_syms (ibfd, symtab_hdr, symcount, symoffset, pos = shndx_hdr->sh_offset + symoffset * sizeof (Elf_External_Sym_Shndx); if (extshndx_buf == NULL) { - alloc_extshndx = (Elf_External_Sym_Shndx *) bfd_malloc (amt); + alloc_extshndx = bfd_malloc (amt); extshndx_buf = alloc_extshndx; } if (extshndx_buf == NULL @@ -432,7 +382,7 @@ bfd_elf_get_elf_syms (ibfd, symtab_hdr, symcount, symoffset, if (intsym_buf == NULL) { bfd_size_type amt = symcount * sizeof (Elf_Internal_Sym); - intsym_buf = (Elf_Internal_Sym *) bfd_malloc (amt); + intsym_buf = bfd_malloc (amt); if (intsym_buf == NULL) goto out; } @@ -442,7 +392,7 @@ bfd_elf_get_elf_syms (ibfd, symtab_hdr, symcount, symoffset, for (esym = extsym_buf, isym = intsym_buf, shndx = extshndx_buf; isym < isymend; esym += extsym_size, isym++, shndx = shndx != NULL ? shndx + 1 : NULL) - (*bed->s->swap_symbol_in) (ibfd, esym, (const PTR) shndx, isym); + (*bed->s->swap_symbol_in) (ibfd, esym, shndx, isym); out: if (alloc_ext != NULL) @@ -453,6 +403,21 @@ bfd_elf_get_elf_syms (ibfd, symtab_hdr, symcount, symoffset, return intsym_buf; } +/* Look up a symbol name. */ +const char * +bfd_elf_local_sym_name (bfd *abfd, Elf_Internal_Sym *isym) +{ + unsigned int iname = isym->st_name; + unsigned int shindex = elf_tdata (abfd)->symtab_hdr.sh_link; + if (iname == 0 && ELF_ST_TYPE (isym->st_info) == STT_SECTION) + { + iname = elf_elfsections (abfd)[isym->st_shndx]->sh_name; + shindex = elf_elfheader (abfd)->e_shstrndx; + } + + return bfd_elf_string_from_elf_section (abfd, shindex, iname); +} + /* Elf_Internal_Shdr->contents is an array of these for SHT_GROUP sections. The first element is the flags, the rest are section pointers. */ @@ -466,16 +431,12 @@ typedef union elf_internal_group { signature just a string? */ static const char * -group_signature (abfd, ghdr) - bfd *abfd; - Elf_Internal_Shdr *ghdr; +group_signature (bfd *abfd, Elf_Internal_Shdr *ghdr) { Elf_Internal_Shdr *hdr; unsigned char esym[sizeof (Elf64_External_Sym)]; Elf_External_Sym_Shndx eshndx; Elf_Internal_Sym isym; - unsigned int iname; - unsigned int shindex; /* First we need to ensure the symbol table is available. */ if (! bfd_section_from_shdr (abfd, ghdr->sh_link)) @@ -487,25 +448,13 @@ group_signature (abfd, ghdr) &isym, esym, &eshndx) == NULL) return NULL; - /* Look up the symbol name. */ - iname = isym.st_name; - shindex = hdr->sh_link; - if (iname == 0 && ELF_ST_TYPE (isym.st_info) == STT_SECTION) - { - iname = elf_elfsections (abfd)[isym.st_shndx]->sh_name; - shindex = elf_elfheader (abfd)->e_shstrndx; - } - - return bfd_elf_string_from_elf_section (abfd, shindex, iname); + return bfd_elf_local_sym_name (abfd, &isym); } /* Set next_in_group list pointer, and group name for NEWSECT. */ -static boolean -setup_group (abfd, hdr, newsect) - bfd *abfd; - Elf_Internal_Shdr *hdr; - asection *newsect; +static bfd_boolean +setup_group (bfd *abfd, Elf_Internal_Shdr *hdr, asection *newsect) { unsigned int num_group = elf_tdata (abfd)->num_group; @@ -537,7 +486,7 @@ setup_group (abfd, hdr, newsect) bfd_size_type amt = num_group * sizeof (Elf_Internal_Shdr *); elf_tdata (abfd)->group_sect_ptr = bfd_alloc (abfd, amt); if (elf_tdata (abfd)->group_sect_ptr == NULL) - return false; + return FALSE; num_group = 0; for (i = 0; i < shnum; i++) @@ -560,7 +509,7 @@ setup_group (abfd, hdr, newsect) || bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0 || (bfd_bread (shdr->contents, shdr->sh_size, abfd) != shdr->sh_size)) - return false; + return FALSE; /* Translate raw contents, a flag word followed by an array of elf section indices all in target byte order, @@ -637,7 +586,7 @@ setup_group (abfd, hdr, newsect) gname = group_signature (abfd, shdr); if (gname == NULL) - return false; + return FALSE; elf_group_name (newsect) = gname; /* Start a circular list with one element. */ @@ -660,13 +609,11 @@ setup_group (abfd, hdr, newsect) (*_bfd_error_handler) (_("%s: no group info for section %s"), bfd_archive_filename (abfd), newsect->name); } - return true; + return TRUE; } -boolean -bfd_elf_discard_group (abfd, group) - bfd *abfd ATTRIBUTE_UNUSED; - asection *group; +bfd_boolean +bfd_elf_discard_group (bfd *abfd ATTRIBUTE_UNUSED, asection *group) { asection *first = elf_next_in_group (group); asection *s = first; @@ -679,32 +626,35 @@ bfd_elf_discard_group (abfd, group) if (s == first) break; } - return true; + return TRUE; } /* Make a BFD section from an ELF section. We store a pointer to the BFD section in the bfd_section field of the header. */ -boolean -_bfd_elf_make_section_from_shdr (abfd, hdr, name) - bfd *abfd; - Elf_Internal_Shdr *hdr; - const char *name; +bfd_boolean +_bfd_elf_make_section_from_shdr (bfd *abfd, + Elf_Internal_Shdr *hdr, + const char *name) { asection *newsect; flagword flags; - struct elf_backend_data *bed; + const struct elf_backend_data *bed; if (hdr->bfd_section != NULL) { BFD_ASSERT (strcmp (name, bfd_get_section_name (abfd, hdr->bfd_section)) == 0); - return true; + return TRUE; } newsect = bfd_make_section_anyway (abfd, name); if (newsect == NULL) - return false; + return FALSE; + + /* Always use the real type/flags. */ + elf_section_type (newsect) = hdr->sh_type; + elf_section_flags (newsect) = hdr->sh_flags; newsect->filepos = hdr->sh_offset; @@ -712,7 +662,7 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name) || ! bfd_set_section_size (abfd, newsect, hdr->sh_size) || ! bfd_set_section_alignment (abfd, newsect, bfd_log2 ((bfd_vma) hdr->sh_addralign))) - return false; + return FALSE; flags = SEC_NO_FLAGS; if (hdr->sh_type != SHT_NOBITS) @@ -740,7 +690,7 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name) } if (hdr->sh_flags & SHF_GROUP) if (!setup_group (abfd, hdr, newsect)) - return false; + return FALSE; if ((hdr->sh_flags & SHF_TLS) != 0) flags |= SEC_THREAD_LOCAL; @@ -777,10 +727,10 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name) bed = get_elf_backend_data (abfd); if (bed->elf_backend_section_flags) if (! bed->elf_backend_section_flags (&flags, hdr)) - return false; + return FALSE; if (! bfd_set_section_flags (abfd, newsect, flags)) - return false; + return FALSE; if ((flags & SEC_ALLOC) != 0) { @@ -851,7 +801,7 @@ _bfd_elf_make_section_from_shdr (abfd, hdr, name) hdr->bfd_section = newsect; elf_section_data (newsect)->this_hdr = *hdr; - return true; + return TRUE; } /* @@ -870,9 +820,7 @@ DESCRIPTION */ struct elf_internal_shdr * -bfd_elf_find_section (abfd, name) - bfd *abfd; - char *name; +bfd_elf_find_section (bfd *abfd, char *name) { Elf_Internal_Shdr **i_shdrp; char *shstrtab; @@ -901,7 +849,7 @@ const char *const bfd_elf_section_type_names[] = { "SHT_NOBITS", "SHT_REL", "SHT_SHLIB", "SHT_DYNSYM", }; -/* ELF relocs are against symbols. If we are producing relocateable +/* ELF relocs are against symbols. If we are producing relocatable output, and the reloc is against an external symbol, and nothing has given us any additional addend, the resulting reloc will also be against the same symbol. In such a case, we don't want to @@ -909,25 +857,18 @@ const char *const bfd_elf_section_type_names[] = { all be done at final link time. Rather than put special case code into bfd_perform_relocation, all the reloc types use this howto function. It just short circuits the reloc if producing - relocateable output against an external symbol. */ + relocatable output against an external symbol. */ bfd_reloc_status_type -bfd_elf_generic_reloc (abfd, - reloc_entry, - symbol, - data, - input_section, - output_bfd, - error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; -{ - if (output_bfd != (bfd *) NULL +bfd_elf_generic_reloc (bfd *abfd ATTRIBUTE_UNUSED, + arelent *reloc_entry, + asymbol *symbol, + void *data ATTRIBUTE_UNUSED, + asection *input_section, + bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) +{ + if (output_bfd != NULL && (symbol->flags & BSF_SECTION_SYM) == 0 && (! reloc_entry->howto->partial_inplace || reloc_entry->addend == 0)) @@ -942,56 +883,46 @@ bfd_elf_generic_reloc (abfd, /* Make sure sec_info_type is cleared if sec_info is cleared too. */ static void -merge_sections_remove_hook (abfd, sec) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec; +merge_sections_remove_hook (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec) { - struct bfd_elf_section_data *sec_data; - - sec_data = elf_section_data (sec); - BFD_ASSERT (sec_data->sec_info_type == ELF_INFO_TYPE_MERGE); - sec_data->sec_info_type = ELF_INFO_TYPE_NONE; + BFD_ASSERT (sec->sec_info_type == ELF_INFO_TYPE_MERGE); + sec->sec_info_type = ELF_INFO_TYPE_NONE; } /* Finish SHF_MERGE section merging. */ -boolean -_bfd_elf_merge_sections (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +bfd_boolean +_bfd_elf_merge_sections (bfd *abfd, struct bfd_link_info *info) { - if (!is_elf_hash_table (info)) - return false; + if (!is_elf_hash_table (info->hash)) + return FALSE; if (elf_hash_table (info)->merge_info) _bfd_merge_sections (abfd, elf_hash_table (info)->merge_info, merge_sections_remove_hook); - return true; + return TRUE; } void -_bfd_elf_link_just_syms (sec, info) - asection *sec; - struct bfd_link_info *info; +_bfd_elf_link_just_syms (asection *sec, struct bfd_link_info *info) { sec->output_section = bfd_abs_section_ptr; sec->output_offset = sec->vma; - if (!is_elf_hash_table (info)) + if (!is_elf_hash_table (info->hash)) return; - elf_section_data (sec)->sec_info_type = ELF_INFO_TYPE_JUST_SYMS; + sec->sec_info_type = ELF_INFO_TYPE_JUST_SYMS; } /* Copy the program header and other data from one object module to another. */ -boolean -_bfd_elf_copy_private_bfd_data (ibfd, obfd) - bfd *ibfd; - bfd *obfd; +bfd_boolean +_bfd_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd) { if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) - return true; + return TRUE; BFD_ASSERT (!elf_flags_init (obfd) || (elf_elfheader (obfd)->e_flags @@ -999,18 +930,16 @@ _bfd_elf_copy_private_bfd_data (ibfd, obfd) elf_gp (obfd) = elf_gp (ibfd); elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags; - elf_flags_init (obfd) = true; - return true; + elf_flags_init (obfd) = TRUE; + return TRUE; } /* Print out the program headers. */ -boolean -_bfd_elf_print_private_bfd_data (abfd, farg) - bfd *abfd; - PTR farg; +bfd_boolean +_bfd_elf_print_private_bfd_data (bfd *abfd, void *farg) { - FILE *f = (FILE *) farg; + FILE *f = farg; Elf_Internal_Phdr *p; asection *s; bfd_byte *dynbuf = NULL; @@ -1038,6 +967,7 @@ _bfd_elf_print_private_bfd_data (abfd, farg) case PT_PHDR: pt = "PHDR"; break; case PT_TLS: pt = "TLS"; break; case PT_GNU_EH_FRAME: pt = "EH_FRAME"; break; + case PT_GNU_STACK: pt = "STACK"; break; default: sprintf (buf, "0x%lx", p->p_type); pt = buf; break; } fprintf (f, "%8s off 0x", pt); @@ -1068,15 +998,14 @@ _bfd_elf_print_private_bfd_data (abfd, farg) unsigned long shlink; bfd_byte *extdyn, *extdynend; size_t extdynsize; - void (*swap_dyn_in) PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *)); + void (*swap_dyn_in) (bfd *, const void *, Elf_Internal_Dyn *); fprintf (f, _("\nDynamic Section:\n")); - dynbuf = (bfd_byte *) bfd_malloc (s->_raw_size); + dynbuf = bfd_malloc (s->_raw_size); if (dynbuf == NULL) goto error_return; - if (! bfd_get_section_contents (abfd, s, (PTR) dynbuf, (file_ptr) 0, - s->_raw_size)) + if (! bfd_get_section_contents (abfd, s, dynbuf, 0, s->_raw_size)) goto error_return; elfsec = _bfd_elf_section_from_bfd_section (abfd, s); @@ -1094,14 +1023,14 @@ _bfd_elf_print_private_bfd_data (abfd, farg) Elf_Internal_Dyn dyn; const char *name; char ab[20]; - boolean stringp; + bfd_boolean stringp; - (*swap_dyn_in) (abfd, (PTR) extdyn, &dyn); + (*swap_dyn_in) (abfd, extdyn, &dyn); if (dyn.d_tag == DT_NULL) break; - stringp = false; + stringp = FALSE; switch (dyn.d_tag) { default: @@ -1109,7 +1038,7 @@ _bfd_elf_print_private_bfd_data (abfd, farg) name = ab; break; - case DT_NEEDED: name = "NEEDED"; stringp = true; break; + case DT_NEEDED: name = "NEEDED"; stringp = TRUE; break; case DT_PLTRELSZ: name = "PLTRELSZ"; break; case DT_PLTGOT: name = "PLTGOT"; break; case DT_HASH: name = "HASH"; break; @@ -1122,8 +1051,8 @@ _bfd_elf_print_private_bfd_data (abfd, farg) case DT_SYMENT: name = "SYMENT"; break; case DT_INIT: name = "INIT"; break; case DT_FINI: name = "FINI"; break; - case DT_SONAME: name = "SONAME"; stringp = true; break; - case DT_RPATH: name = "RPATH"; stringp = true; break; + case DT_SONAME: name = "SONAME"; stringp = TRUE; break; + case DT_RPATH: name = "RPATH"; stringp = TRUE; break; case DT_SYMBOLIC: name = "SYMBOLIC"; break; case DT_REL: name = "REL"; break; case DT_RELSZ: name = "RELSZ"; break; @@ -1137,7 +1066,7 @@ _bfd_elf_print_private_bfd_data (abfd, farg) case DT_FINI_ARRAY: name = "FINI_ARRAY"; break; case DT_INIT_ARRAYSZ: name = "INIT_ARRAYSZ"; break; case DT_FINI_ARRAYSZ: name = "FINI_ARRAYSZ"; break; - case DT_RUNPATH: name = "RUNPATH"; stringp = true; break; + case DT_RUNPATH: name = "RUNPATH"; stringp = TRUE; break; case DT_FLAGS: name = "FLAGS"; break; case DT_PREINIT_ARRAY: name = "PREINIT_ARRAY"; break; case DT_PREINIT_ARRAYSZ: name = "PREINIT_ARRAYSZ"; break; @@ -1149,9 +1078,9 @@ _bfd_elf_print_private_bfd_data (abfd, farg) case DT_POSFLAG_1: name = "POSFLAG_1"; break; case DT_SYMINSZ: name = "SYMINSZ"; break; case DT_SYMINENT: name = "SYMINENT"; break; - case DT_CONFIG: name = "CONFIG"; stringp = true; break; - case DT_DEPAUDIT: name = "DEPAUDIT"; stringp = true; break; - case DT_AUDIT: name = "AUDIT"; stringp = true; break; + case DT_CONFIG: name = "CONFIG"; stringp = TRUE; break; + case DT_DEPAUDIT: name = "DEPAUDIT"; stringp = TRUE; break; + case DT_AUDIT: name = "AUDIT"; stringp = TRUE; break; case DT_PLTPAD: name = "PLTPAD"; break; case DT_MOVETAB: name = "MOVETAB"; break; case DT_SYMINFO: name = "SYMINFO"; break; @@ -1163,9 +1092,9 @@ _bfd_elf_print_private_bfd_data (abfd, farg) case DT_VERDEFNUM: name = "VERDEFNUM"; break; case DT_VERNEED: name = "VERNEED"; break; case DT_VERNEEDNUM: name = "VERNEEDNUM"; break; - case DT_AUXILIARY: name = "AUXILIARY"; stringp = true; break; + case DT_AUXILIARY: name = "AUXILIARY"; stringp = TRUE; break; case DT_USED: name = "USED"; break; - case DT_FILTER: name = "FILTER"; stringp = true; break; + case DT_FILTER: name = "FILTER"; stringp = TRUE; break; } fprintf (f, " %-11s ", name); @@ -1192,7 +1121,7 @@ _bfd_elf_print_private_bfd_data (abfd, farg) || (elf_dynverref (abfd) != 0 && elf_tdata (abfd)->verref == NULL)) { if (! _bfd_elf_slurp_version_tables (abfd)) - return false; + return FALSE; } if (elf_dynverdef (abfd) != 0) @@ -1234,24 +1163,23 @@ _bfd_elf_print_private_bfd_data (abfd, farg) } } - return true; + return TRUE; error_return: if (dynbuf != NULL) free (dynbuf); - return false; + return FALSE; } /* Display ELF-specific fields of a symbol. */ void -bfd_elf_print_symbol (abfd, filep, symbol, how) - bfd *abfd; - PTR filep; - asymbol *symbol; - bfd_print_symbol_type how; +bfd_elf_print_symbol (bfd *abfd, + void *filep, + asymbol *symbol, + bfd_print_symbol_type how) { - FILE *file = (FILE *) filep; + FILE *file = filep; switch (how) { case bfd_print_symbol_name: @@ -1266,7 +1194,7 @@ bfd_elf_print_symbol (abfd, filep, symbol, how) { const char *section_name; const char *name = NULL; - struct elf_backend_data *bed; + const struct elf_backend_data *bed; unsigned char st_other; bfd_vma val; @@ -1279,7 +1207,7 @@ bfd_elf_print_symbol (abfd, filep, symbol, how) if (name == NULL) { name = symbol->name; - bfd_print_symbol_vandf (abfd, (PTR) file, symbol); + bfd_print_symbol_vandf (abfd, file, symbol); } fprintf (file, " %s\t", section_name); @@ -1368,10 +1296,9 @@ bfd_elf_print_symbol (abfd, filep, symbol, how) /* Create an entry in an ELF linker hash table. */ struct bfd_hash_entry * -_bfd_elf_link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +_bfd_elf_link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ @@ -1391,17 +1318,17 @@ _bfd_elf_link_hash_newfunc (entry, table, string) /* Set local fields. */ ret->indx = -1; - ret->size = 0; ret->dynindx = -1; ret->dynstr_index = 0; + ret->elf_hash_value = 0; ret->weakdef = NULL; - ret->got.refcount = htab->init_refcount; - ret->plt.refcount = htab->init_refcount; - ret->linker_section_pointer = NULL; ret->verinfo.verdef = NULL; - ret->vtable_entries_used = NULL; ret->vtable_entries_size = 0; + ret->vtable_entries_used = NULL; ret->vtable_parent = NULL; + ret->got = htab->init_refcount; + ret->plt = htab->init_refcount; + ret->size = 0; ret->type = STT_NOTYPE; ret->other = 0; /* Assume that we have been called by a non-ELF symbol reader. @@ -1418,9 +1345,9 @@ _bfd_elf_link_hash_newfunc (entry, table, string) old indirect symbol. Also used for copying flags to a weakdef. */ void -_bfd_elf_link_hash_copy_indirect (bed, dir, ind) - struct elf_backend_data *bed; - struct elf_link_hash_entry *dir, *ind; +_bfd_elf_link_hash_copy_indirect (const struct elf_backend_data *bed, + struct elf_link_hash_entry *dir, + struct elf_link_hash_entry *ind) { bfd_signed_vma tmp; bfd_signed_vma lowest_valid = bed->can_refcount; @@ -1428,12 +1355,13 @@ _bfd_elf_link_hash_copy_indirect (bed, dir, ind) /* Copy down any references that we may have already seen to the symbol which just became indirect. */ - dir->elf_link_hash_flags |= - (ind->elf_link_hash_flags - & (ELF_LINK_HASH_REF_DYNAMIC - | ELF_LINK_HASH_REF_REGULAR - | ELF_LINK_HASH_REF_REGULAR_NONWEAK - | ELF_LINK_NON_GOT_REF)); + dir->elf_link_hash_flags + |= ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK + | ELF_LINK_NON_GOT_REF + | ELF_LINK_HASH_NEEDS_PLT + | ELF_LINK_POINTER_EQUALITY_NEEDED); if (ind->root.type != bfd_link_hash_indirect) return; @@ -1470,12 +1398,11 @@ _bfd_elf_link_hash_copy_indirect (bed, dir, ind) } void -_bfd_elf_link_hash_hide_symbol (info, h, force_local) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; - boolean force_local; +_bfd_elf_link_hash_hide_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h, + bfd_boolean force_local) { - h->plt.offset = (bfd_vma) -1; + h->plt = elf_hash_table (info)->init_offset; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; if (force_local) { @@ -1491,31 +1418,39 @@ _bfd_elf_link_hash_hide_symbol (info, h, force_local) /* Initialize an ELF linker hash table. */ -boolean -_bfd_elf_link_hash_table_init (table, abfd, newfunc) - struct elf_link_hash_table *table; - bfd *abfd; - struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *)); +bfd_boolean +_bfd_elf_link_hash_table_init + (struct elf_link_hash_table *table, + bfd *abfd, + struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, + struct bfd_hash_table *, + const char *)) { - boolean ret; + bfd_boolean ret; - table->dynamic_sections_created = false; + table->dynamic_sections_created = FALSE; table->dynobj = NULL; - table->init_refcount = get_elf_backend_data (abfd)->can_refcount - 1; + /* Make sure can_refcount is extended to the width and signedness of + init_refcount before we subtract one from it. */ + table->init_refcount.refcount = get_elf_backend_data (abfd)->can_refcount; + table->init_refcount.refcount -= 1; + table->init_offset.offset = -(bfd_vma) 1; /* The first dynamic symbol is a dummy. */ table->dynsymcount = 1; table->dynstr = NULL; table->bucketcount = 0; table->needed = NULL; - table->runpath = NULL; - table->loaded = NULL; table->hgot = NULL; table->stab_info = NULL; table->merge_info = NULL; + memset (&table->eh_info, 0, sizeof (table->eh_info)); table->dynlocal = NULL; - ret = _bfd_link_hash_table_init (& table->root, abfd, newfunc); + table->runpath = NULL; + table->tls_sec = NULL; + table->tls_size = 0; + table->loaded = NULL; + + ret = _bfd_link_hash_table_init (&table->root, abfd, newfunc); table->root.type = bfd_link_elf_hash_table; return ret; @@ -1524,14 +1459,13 @@ _bfd_elf_link_hash_table_init (table, abfd, newfunc) /* Create an ELF linker hash table. */ struct bfd_link_hash_table * -_bfd_elf_link_hash_table_create (abfd) - bfd *abfd; +_bfd_elf_link_hash_table_create (bfd *abfd) { struct elf_link_hash_table *ret; bfd_size_type amt = sizeof (struct elf_link_hash_table); - ret = (struct elf_link_hash_table *) bfd_malloc (amt); - if (ret == (struct elf_link_hash_table *) NULL) + ret = bfd_malloc (amt); + if (ret == NULL) return NULL; if (! _bfd_elf_link_hash_table_init (ret, abfd, _bfd_elf_link_hash_newfunc)) @@ -1545,13 +1479,10 @@ _bfd_elf_link_hash_table_create (abfd) /* This is a hook for the ELF emulation code in the generic linker to tell the backend linker what file name to use for the DT_NEEDED - entry for a dynamic object. The generic linker passes name as an - empty string to indicate that no DT_NEEDED entry should be made. */ + entry for a dynamic object. */ void -bfd_elf_set_dt_needed_name (abfd, name) - bfd *abfd; - const char *name; +bfd_elf_set_dt_needed_name (bfd *abfd, const char *name) { if (bfd_get_flavour (abfd) == bfd_target_elf_flavour && bfd_get_format (abfd) == bfd_object) @@ -1559,24 +1490,21 @@ bfd_elf_set_dt_needed_name (abfd, name) } void -bfd_elf_set_dt_needed_soname (abfd, name) - bfd *abfd; - const char *name; +bfd_elf_set_dyn_lib_class (bfd *abfd, int lib_class) { if (bfd_get_flavour (abfd) == bfd_target_elf_flavour && bfd_get_format (abfd) == bfd_object) - elf_dt_soname (abfd) = name; + elf_dyn_lib_class (abfd) = lib_class; } /* Get the list of DT_NEEDED entries for a link. This is a hook for the linker ELF emulation code. */ struct bfd_link_needed_list * -bfd_elf_get_needed_list (abfd, info) - bfd *abfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; +bfd_elf_get_needed_list (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) { - if (info->hash->creator->flavour != bfd_target_elf_flavour) + if (! is_elf_hash_table (info->hash)) return NULL; return elf_hash_table (info)->needed; } @@ -1585,11 +1513,10 @@ bfd_elf_get_needed_list (abfd, info) hook for the linker ELF emulation code. */ struct bfd_link_needed_list * -bfd_elf_get_runpath_list (abfd, info) - bfd *abfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; +bfd_elf_get_runpath_list (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) { - if (info->hash->creator->flavour != bfd_target_elf_flavour) + if (! is_elf_hash_table (info->hash)) return NULL; return elf_hash_table (info)->runpath; } @@ -1599,8 +1526,7 @@ bfd_elf_get_runpath_list (abfd, info) passed to bfd_elf_set_dt_needed_name, or it is the filename. */ const char * -bfd_elf_get_dt_soname (abfd) - bfd *abfd; +bfd_elf_get_dt_soname (bfd *abfd) { if (bfd_get_flavour (abfd) == bfd_target_elf_flavour && bfd_get_format (abfd) == bfd_object) @@ -1611,10 +1537,9 @@ bfd_elf_get_dt_soname (abfd) /* Get the list of DT_NEEDED entries from a BFD. This is a hook for the ELF linker emulation code. */ -boolean -bfd_elf_get_bfd_needed_list (abfd, pneeded) - bfd *abfd; - struct bfd_link_needed_list **pneeded; +bfd_boolean +bfd_elf_get_bfd_needed_list (bfd *abfd, + struct bfd_link_needed_list **pneeded) { asection *s; bfd_byte *dynbuf = NULL; @@ -1622,24 +1547,23 @@ bfd_elf_get_bfd_needed_list (abfd, pneeded) unsigned long shlink; bfd_byte *extdyn, *extdynend; size_t extdynsize; - void (*swap_dyn_in) PARAMS ((bfd *, const PTR, Elf_Internal_Dyn *)); + void (*swap_dyn_in) (bfd *, const void *, Elf_Internal_Dyn *); *pneeded = NULL; if (bfd_get_flavour (abfd) != bfd_target_elf_flavour || bfd_get_format (abfd) != bfd_object) - return true; + return TRUE; s = bfd_get_section_by_name (abfd, ".dynamic"); if (s == NULL || s->_raw_size == 0) - return true; + return TRUE; - dynbuf = (bfd_byte *) bfd_malloc (s->_raw_size); + dynbuf = bfd_malloc (s->_raw_size); if (dynbuf == NULL) goto error_return; - if (! bfd_get_section_contents (abfd, s, (PTR) dynbuf, (file_ptr) 0, - s->_raw_size)) + if (! bfd_get_section_contents (abfd, s, dynbuf, 0, s->_raw_size)) goto error_return; elfsec = _bfd_elf_section_from_bfd_section (abfd, s); @@ -1657,7 +1581,7 @@ bfd_elf_get_bfd_needed_list (abfd, pneeded) { Elf_Internal_Dyn dyn; - (*swap_dyn_in) (abfd, (PTR) extdyn, &dyn); + (*swap_dyn_in) (abfd, extdyn, &dyn); if (dyn.d_tag == DT_NULL) break; @@ -1674,7 +1598,7 @@ bfd_elf_get_bfd_needed_list (abfd, pneeded) goto error_return; amt = sizeof *l; - l = (struct bfd_link_needed_list *) bfd_alloc (abfd, amt); + l = bfd_alloc (abfd, amt); if (l == NULL) goto error_return; @@ -1687,18 +1611,18 @@ bfd_elf_get_bfd_needed_list (abfd, pneeded) free (dynbuf); - return true; + return TRUE; error_return: if (dynbuf != NULL) free (dynbuf); - return false; + return FALSE; } /* Allocate an ELF string table--force the first byte to be zero. */ struct bfd_strtab_hash * -_bfd_elf_stringtab_init () +_bfd_elf_stringtab_init (void) { struct bfd_strtab_hash *ret; @@ -1707,7 +1631,7 @@ _bfd_elf_stringtab_init () { bfd_size_type loc; - loc = _bfd_stringtab_add (ret, "", true, false); + loc = _bfd_stringtab_add (ret, "", TRUE, FALSE); BFD_ASSERT (loc == 0 || loc == (bfd_size_type) -1); if (loc == (bfd_size_type) -1) { @@ -1722,14 +1646,12 @@ _bfd_elf_stringtab_init () /* Create a new bfd section from an ELF section header. */ -boolean -bfd_section_from_shdr (abfd, shindex) - bfd *abfd; - unsigned int shindex; +bfd_boolean +bfd_section_from_shdr (bfd *abfd, unsigned int shindex) { Elf_Internal_Shdr *hdr = elf_elfsections (abfd)[shindex]; Elf_Internal_Ehdr *ehdr = elf_elfheader (abfd); - struct elf_backend_data *bed = get_elf_backend_data (abfd); + const struct elf_backend_data *bed = get_elf_backend_data (abfd); const char *name; name = elf_string_from_elf_strtab (abfd, hdr->sh_name); @@ -1738,7 +1660,7 @@ bfd_section_from_shdr (abfd, shindex) { case SHT_NULL: /* Inactive section. Throw it away. */ - return true; + return TRUE; case SHT_PROGBITS: /* Normal section with contents. */ case SHT_NOBITS: /* .bss section. */ @@ -1751,7 +1673,7 @@ bfd_section_from_shdr (abfd, shindex) case SHT_DYNAMIC: /* Dynamic linking information. */ if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) - return false; + return FALSE; if (elf_elfsections (abfd)[hdr->sh_link]->sh_type != SHT_STRTAB) { Elf_Internal_Shdr *dynsymhdr; @@ -1784,7 +1706,7 @@ bfd_section_from_shdr (abfd, shindex) case SHT_SYMTAB: /* A symbol table */ if (elf_onesymtab (abfd) == shindex) - return true; + return TRUE; BFD_ASSERT (hdr->sh_entsize == bed->s->sizeof_sym); BFD_ASSERT (elf_onesymtab (abfd) == 0); @@ -1797,18 +1719,18 @@ bfd_section_from_shdr (abfd, shindex) SHF_ALLOC is set, and this is a shared object, then we also treat this section as a BFD section. We can not base the decision purely on SHF_ALLOC, because that flag is sometimes - set in a relocateable object file, which would confuse the + set in a relocatable object file, which would confuse the linker. */ if ((hdr->sh_flags & SHF_ALLOC) != 0 && (abfd->flags & DYNAMIC) != 0 && ! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) - return false; + return FALSE; - return true; + return TRUE; case SHT_DYNSYM: /* A dynamic symbol table */ if (elf_dynsymtab (abfd) == shindex) - return true; + return TRUE; BFD_ASSERT (hdr->sh_entsize == bed->s->sizeof_sym); BFD_ASSERT (elf_dynsymtab (abfd) == 0); @@ -1823,26 +1745,26 @@ bfd_section_from_shdr (abfd, shindex) case SHT_SYMTAB_SHNDX: /* Symbol section indices when >64k sections */ if (elf_symtab_shndx (abfd) == shindex) - return true; + return TRUE; /* Get the associated symbol table. */ if (! bfd_section_from_shdr (abfd, hdr->sh_link) || hdr->sh_link != elf_onesymtab (abfd)) - return false; + return FALSE; elf_symtab_shndx (abfd) = shindex; elf_tdata (abfd)->symtab_shndx_hdr = *hdr; elf_elfsections (abfd)[shindex] = &elf_tdata (abfd)->symtab_shndx_hdr; - return true; + return TRUE; case SHT_STRTAB: /* A string table */ if (hdr->bfd_section != NULL) - return true; + return TRUE; if (ehdr->e_shstrndx == shindex) { elf_tdata (abfd)->shstrtab_hdr = *hdr; elf_elfsections (abfd)[shindex] = &elf_tdata (abfd)->shstrtab_hdr; - return true; + return TRUE; } { unsigned int i, num_sec; @@ -1854,13 +1776,13 @@ bfd_section_from_shdr (abfd, shindex) if (hdr2->sh_link == shindex) { if (! bfd_section_from_shdr (abfd, i)) - return false; + return FALSE; if (elf_onesymtab (abfd) == i) { elf_tdata (abfd)->strtab_hdr = *hdr; elf_elfsections (abfd)[shindex] = &elf_tdata (abfd)->strtab_hdr; - return true; + return TRUE; } if (elf_dynsymtab (abfd) == i) { @@ -1940,7 +1862,7 @@ bfd_section_from_shdr (abfd, shindex) /* Get the symbol table. */ if (elf_elfsections (abfd)[hdr->sh_link]->sh_type == SHT_SYMTAB && ! bfd_section_from_shdr (abfd, hdr->sh_link)) - return false; + return FALSE; /* If this reloc section does not use the main symbol table we don't treat it as a reloc section. BFD can't adequately @@ -1952,10 +1874,10 @@ bfd_section_from_shdr (abfd, shindex) return _bfd_elf_make_section_from_shdr (abfd, hdr, name); if (! bfd_section_from_shdr (abfd, hdr->sh_info)) - return false; + return FALSE; target_sect = bfd_section_from_elf_index (abfd, hdr->sh_info); if (target_sect == NULL) - return false; + return FALSE; if ((target_sect->flags & SEC_RELOC) == 0 || target_sect->reloc_count == 0) @@ -1965,7 +1887,7 @@ bfd_section_from_shdr (abfd, shindex) bfd_size_type amt; BFD_ASSERT (elf_section_data (target_sect)->rel_hdr2 == NULL); amt = sizeof (*hdr2); - hdr2 = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt); + hdr2 = bfd_alloc (abfd, amt); elf_section_data (target_sect)->rel_hdr2 = hdr2; } *hdr2 = *hdr; @@ -1977,10 +1899,9 @@ bfd_section_from_shdr (abfd, shindex) /* In the section to which the relocations apply, mark whether its relocations are of the REL or RELA variety. */ if (hdr->sh_size != 0) - elf_section_data (target_sect)->use_rela_p - = (hdr->sh_type == SHT_RELA); + target_sect->use_rela_p = hdr->sh_type == SHT_RELA; abfd->flags |= HAS_RELOC; - return true; + return TRUE; } break; @@ -2003,7 +1924,7 @@ bfd_section_from_shdr (abfd, shindex) break; case SHT_SHLIB: - return true; + return TRUE; case SHT_GROUP: /* We need a BFD section for objcopy and relocatable linking, @@ -2011,9 +1932,9 @@ bfd_section_from_shdr (abfd, shindex) name. */ name = group_signature (abfd, hdr); if (name == NULL) - return false; + return FALSE; if (!_bfd_elf_make_section_from_shdr (abfd, hdr, name)) - return false; + return FALSE; if (hdr->contents != NULL) { Elf_Internal_Group *idx = (Elf_Internal_Group *) hdr->contents; @@ -2043,18 +1964,17 @@ bfd_section_from_shdr (abfd, shindex) break; } - return true; + return TRUE; } /* Return the section for the local symbol specified by ABFD, R_SYMNDX. Return SEC for sections that have no elf section, and NULL on error. */ asection * -bfd_section_from_r_symndx (abfd, cache, sec, r_symndx) - bfd *abfd; - struct sym_sec_cache *cache; - asection *sec; - unsigned long r_symndx; +bfd_section_from_r_symndx (bfd *abfd, + struct sym_sec_cache *cache, + asection *sec, + unsigned long r_symndx) { Elf_Internal_Shdr *symtab_hdr; unsigned char esym[sizeof (Elf64_External_Sym)]; @@ -2077,7 +1997,8 @@ bfd_section_from_r_symndx (abfd, cache, sec, r_symndx) } cache->indx[ent] = r_symndx; cache->sec[ent] = sec; - if (isym.st_shndx < SHN_LORESERVE || isym.st_shndx > SHN_HIRESERVE) + if ((isym.st_shndx != SHN_UNDEF && isym.st_shndx < SHN_LORESERVE) + || isym.st_shndx > SHN_HIRESERVE) { asection *s; s = bfd_section_from_elf_index (abfd, isym.st_shndx); @@ -2091,33 +2012,149 @@ bfd_section_from_r_symndx (abfd, cache, sec, r_symndx) section. */ asection * -bfd_section_from_elf_index (abfd, index) - bfd *abfd; - unsigned int index; +bfd_section_from_elf_index (bfd *abfd, unsigned int index) { if (index >= elf_numsections (abfd)) return NULL; return elf_elfsections (abfd)[index]->bfd_section; } -boolean -_bfd_elf_new_section_hook (abfd, sec) - bfd *abfd; - asection *sec; +static struct bfd_elf_special_section const special_sections[] = +{ + { ".bss", 4, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { ".comment", 8, 0, SHT_PROGBITS, 0 }, + { ".data", 5, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { ".data1", 6, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { ".debug", 6, 0, SHT_PROGBITS, 0 }, + { ".fini", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { ".init", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { ".line", 5, 0, SHT_PROGBITS, 0 }, + { ".rodata", 7, -2, SHT_PROGBITS, SHF_ALLOC }, + { ".rodata1", 8, 0, SHT_PROGBITS, SHF_ALLOC }, + { ".tbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS }, + { ".tdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS }, + { ".text", 5, -2, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { ".init_array", 11, 0, SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE }, + { ".fini_array", 11, 0, SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE }, + { ".preinit_array", 14, 0, SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE }, + { ".debug_line", 11, 0, SHT_PROGBITS, 0 }, + { ".debug_info", 11, 0, SHT_PROGBITS, 0 }, + { ".debug_abbrev", 13, 0, SHT_PROGBITS, 0 }, + { ".debug_aranges", 14, 0, SHT_PROGBITS, 0 }, + { ".dynamic", 8, 0, SHT_DYNAMIC, SHF_ALLOC }, + { ".dynstr", 7, 0, SHT_STRTAB, SHF_ALLOC }, + { ".dynsym", 7, 0, SHT_DYNSYM, SHF_ALLOC }, + { ".got", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { ".hash", 5, 0, SHT_HASH, SHF_ALLOC }, + { ".interp", 7, 0, SHT_PROGBITS, 0 }, + { ".plt", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, + { ".shstrtab", 9, 0, SHT_STRTAB, 0 }, + { ".strtab", 7, 0, SHT_STRTAB, 0 }, + { ".symtab", 7, 0, SHT_SYMTAB, 0 }, + { ".gnu.version", 12, 0, SHT_GNU_versym, 0 }, + { ".gnu.version_d", 14, 0, SHT_GNU_verdef, 0 }, + { ".gnu.version_r", 14, 0, SHT_GNU_verneed, 0 }, + { ".note", 5, -1, SHT_NOTE, 0 }, + { ".rela", 5, -1, SHT_RELA, 0 }, + { ".rel", 4, -1, SHT_REL, 0 }, + { ".stabstr", 5, 3, SHT_STRTAB, 0 }, + { NULL, 0, 0, 0, 0 } +}; + +static const struct bfd_elf_special_section * +get_special_section (const char *name, + const struct bfd_elf_special_section *special_sections, + unsigned int rela) +{ + int i; + int len = strlen (name); + + for (i = 0; special_sections[i].prefix != NULL; i++) + { + int suffix_len; + int prefix_len = special_sections[i].prefix_length; + + if (len < prefix_len) + continue; + if (memcmp (name, special_sections[i].prefix, prefix_len) != 0) + continue; + + suffix_len = special_sections[i].suffix_length; + if (suffix_len <= 0) + { + if (name[prefix_len] != 0) + { + if (suffix_len == 0) + continue; + if (name[prefix_len] != '.' + && (suffix_len == -2 + || (rela && special_sections[i].type == SHT_REL))) + continue; + } + } + else + { + if (len < prefix_len + suffix_len) + continue; + if (memcmp (name + len - suffix_len, + special_sections[i].prefix + prefix_len, + suffix_len) != 0) + continue; + } + return &special_sections[i]; + } + + return NULL; +} + +const struct bfd_elf_special_section * +_bfd_elf_get_sec_type_attr (bfd *abfd, const char *name) +{ + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + const struct bfd_elf_special_section *ssect = NULL; + + /* See if this is one of the special sections. */ + if (name) + { + unsigned int rela = bed->default_use_rela_p; + + if (bed->special_sections) + ssect = get_special_section (name, bed->special_sections, rela); + + if (! ssect) + ssect = get_special_section (name, special_sections, rela); + } + + return ssect; +} + +bfd_boolean +_bfd_elf_new_section_hook (bfd *abfd, asection *sec) { struct bfd_elf_section_data *sdata; - bfd_size_type amt = sizeof (*sdata); + const struct bfd_elf_special_section *ssect; - sdata = (struct bfd_elf_section_data *) bfd_zalloc (abfd, amt); - if (!sdata) - return false; - sec->used_by_bfd = (PTR) sdata; + sdata = (struct bfd_elf_section_data *) sec->used_by_bfd; + if (sdata == NULL) + { + sdata = bfd_zalloc (abfd, sizeof (*sdata)); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + } + + elf_section_type (sec) = SHT_NULL; + ssect = _bfd_elf_get_sec_type_attr (abfd, sec->name); + if (ssect != NULL) + { + elf_section_type (sec) = ssect->type; + elf_section_flags (sec) = ssect->attr; + } /* Indicate whether or not this section should use RELA relocations. */ - sdata->use_rela_p - = get_elf_backend_data (abfd)->default_use_rela_p; + sec->use_rela_p = get_elf_backend_data (abfd)->default_use_rela_p; - return true; + return TRUE; } /* Create a new bfd section from an ELF program header. @@ -2142,12 +2179,11 @@ _bfd_elf_new_section_hook (abfd, sec) */ -boolean -_bfd_elf_make_section_from_phdr (abfd, hdr, index, typename) - bfd *abfd; - Elf_Internal_Phdr *hdr; - int index; - const char *typename; +bfd_boolean +_bfd_elf_make_section_from_phdr (bfd *abfd, + Elf_Internal_Phdr *hdr, + int index, + const char *typename) { asection *newsect; char *name; @@ -2160,18 +2196,19 @@ _bfd_elf_make_section_from_phdr (abfd, hdr, index, typename) && (hdr->p_memsz > hdr->p_filesz)); sprintf (namebuf, "%s%d%s", typename, index, split ? "a" : ""); len = strlen (namebuf) + 1; - name = bfd_alloc (abfd, (bfd_size_type) len); + name = bfd_alloc (abfd, len); if (!name) - return false; + return FALSE; memcpy (name, namebuf, len); newsect = bfd_make_section (abfd, name); if (newsect == NULL) - return false; + return FALSE; newsect->vma = hdr->p_vaddr; newsect->lma = hdr->p_paddr; newsect->_raw_size = hdr->p_filesz; newsect->filepos = hdr->p_offset; newsect->flags |= SEC_HAS_CONTENTS; + newsect->alignment_power = bfd_log2 (hdr->p_align); if (hdr->p_type == PT_LOAD) { newsect->flags |= SEC_ALLOC; @@ -2192,13 +2229,13 @@ _bfd_elf_make_section_from_phdr (abfd, hdr, index, typename) { sprintf (namebuf, "%s%db", typename, index); len = strlen (namebuf) + 1; - name = bfd_alloc (abfd, (bfd_size_type) len); + name = bfd_alloc (abfd, len); if (!name) - return false; + return FALSE; memcpy (name, namebuf, len); newsect = bfd_make_section (abfd, name); if (newsect == NULL) - return false; + return FALSE; newsect->vma = hdr->p_vaddr + hdr->p_filesz; newsect->lma = hdr->p_paddr + hdr->p_filesz; newsect->_raw_size = hdr->p_memsz - hdr->p_filesz; @@ -2212,16 +2249,13 @@ _bfd_elf_make_section_from_phdr (abfd, hdr, index, typename) newsect->flags |= SEC_READONLY; } - return true; + return TRUE; } -boolean -bfd_section_from_phdr (abfd, hdr, index) - bfd *abfd; - Elf_Internal_Phdr *hdr; - int index; +bfd_boolean +bfd_section_from_phdr (bfd *abfd, Elf_Internal_Phdr *hdr, int index) { - struct elf_backend_data *bed; + const struct elf_backend_data *bed; switch (hdr->p_type) { @@ -2239,10 +2273,10 @@ bfd_section_from_phdr (abfd, hdr, index) case PT_NOTE: if (! _bfd_elf_make_section_from_phdr (abfd, hdr, index, "note")) - return false; - if (! elfcore_read_notes (abfd, (file_ptr) hdr->p_offset, hdr->p_filesz)) - return false; - return true; + return FALSE; + if (! elfcore_read_notes (abfd, hdr->p_offset, hdr->p_filesz)) + return FALSE; + return TRUE; case PT_SHLIB: return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "shlib"); @@ -2250,6 +2284,13 @@ bfd_section_from_phdr (abfd, hdr, index) case PT_PHDR: return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "phdr"); + case PT_GNU_EH_FRAME: + return _bfd_elf_make_section_from_phdr (abfd, hdr, index, + "eh_frame_hdr"); + + case PT_GNU_STACK: + return _bfd_elf_make_section_from_phdr (abfd, hdr, index, "stack"); + default: /* Check for any processor-specific program segment types. If no handler for them, default to making "segment" sections. */ @@ -2262,52 +2303,48 @@ bfd_section_from_phdr (abfd, hdr, index) } /* Initialize REL_HDR, the section-header for new section, containing - relocations against ASECT. If USE_RELA_P is true, we use RELA + relocations against ASECT. If USE_RELA_P is TRUE, we use RELA relocations; otherwise, we use REL relocations. */ -boolean -_bfd_elf_init_reloc_shdr (abfd, rel_hdr, asect, use_rela_p) - bfd *abfd; - Elf_Internal_Shdr *rel_hdr; - asection *asect; - boolean use_rela_p; +bfd_boolean +_bfd_elf_init_reloc_shdr (bfd *abfd, + Elf_Internal_Shdr *rel_hdr, + asection *asect, + bfd_boolean use_rela_p) { char *name; - struct elf_backend_data *bed = get_elf_backend_data (abfd); + const struct elf_backend_data *bed = get_elf_backend_data (abfd); bfd_size_type amt = sizeof ".rela" + strlen (asect->name); name = bfd_alloc (abfd, amt); if (name == NULL) - return false; + return FALSE; sprintf (name, "%s%s", use_rela_p ? ".rela" : ".rel", asect->name); rel_hdr->sh_name = (unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd), name, - false); + FALSE); if (rel_hdr->sh_name == (unsigned int) -1) - return false; + return FALSE; rel_hdr->sh_type = use_rela_p ? SHT_RELA : SHT_REL; rel_hdr->sh_entsize = (use_rela_p ? bed->s->sizeof_rela : bed->s->sizeof_rel); - rel_hdr->sh_addralign = bed->s->file_align; + rel_hdr->sh_addralign = 1 << bed->s->log_file_align; rel_hdr->sh_flags = 0; rel_hdr->sh_addr = 0; rel_hdr->sh_size = 0; rel_hdr->sh_offset = 0; - return true; + return TRUE; } /* Set up an ELF internal section header for a section. */ static void -elf_fake_sections (abfd, asect, failedptrarg) - bfd *abfd; - asection *asect; - PTR failedptrarg; +elf_fake_sections (bfd *abfd, asection *asect, void *failedptrarg) { - struct elf_backend_data *bed = get_elf_backend_data (abfd); - boolean *failedptr = (boolean *) failedptrarg; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + bfd_boolean *failedptr = failedptrarg; Elf_Internal_Shdr *this_hdr; if (*failedptr) @@ -2319,11 +2356,11 @@ elf_fake_sections (abfd, asect, failedptrarg) this_hdr = &elf_section_data (asect)->this_hdr; - this_hdr->sh_name = (unsigned long) _bfd_elf_strtab_add (elf_shstrtab (abfd), - asect->name, false); - if (this_hdr->sh_name == (unsigned long) -1) + this_hdr->sh_name = (unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd), + asect->name, FALSE); + if (this_hdr->sh_name == (unsigned int) -1) { - *failedptr = true; + *failedptr = TRUE; return; } @@ -2345,55 +2382,59 @@ elf_fake_sections (abfd, asect, failedptrarg) this_hdr->bfd_section = asect; this_hdr->contents = NULL; - /* FIXME: This should not be based on section names. */ - if (strcmp (asect->name, ".dynstr") == 0) - this_hdr->sh_type = SHT_STRTAB; - else if (strcmp (asect->name, ".hash") == 0) + /* If the section type is unspecified, we set it based on + asect->flags. */ + if (this_hdr->sh_type == SHT_NULL) { - this_hdr->sh_type = SHT_HASH; - this_hdr->sh_entsize = bed->s->sizeof_hash_entry; + if ((asect->flags & SEC_ALLOC) != 0 + && (((asect->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0) + || (asect->flags & SEC_NEVER_LOAD) != 0)) + this_hdr->sh_type = SHT_NOBITS; + else + this_hdr->sh_type = SHT_PROGBITS; } - else if (strcmp (asect->name, ".dynsym") == 0) + + switch (this_hdr->sh_type) { - this_hdr->sh_type = SHT_DYNSYM; + default: + break; + + case SHT_STRTAB: + case SHT_INIT_ARRAY: + case SHT_FINI_ARRAY: + case SHT_PREINIT_ARRAY: + case SHT_NOTE: + case SHT_NOBITS: + case SHT_PROGBITS: + break; + + case SHT_HASH: + this_hdr->sh_entsize = bed->s->sizeof_hash_entry; + break; + + case SHT_DYNSYM: this_hdr->sh_entsize = bed->s->sizeof_sym; - } - else if (strcmp (asect->name, ".dynamic") == 0) - { - this_hdr->sh_type = SHT_DYNAMIC; + break; + + case SHT_DYNAMIC: this_hdr->sh_entsize = bed->s->sizeof_dyn; - } - else if (strncmp (asect->name, ".rela", 5) == 0 - && get_elf_backend_data (abfd)->may_use_rela_p) - { - this_hdr->sh_type = SHT_RELA; - this_hdr->sh_entsize = bed->s->sizeof_rela; - } - else if (strncmp (asect->name, ".rel", 4) == 0 - && get_elf_backend_data (abfd)->may_use_rel_p) - { - this_hdr->sh_type = SHT_REL; - this_hdr->sh_entsize = bed->s->sizeof_rel; - } - else if (strcmp (asect->name, ".init_array") == 0) - this_hdr->sh_type = SHT_INIT_ARRAY; - else if (strcmp (asect->name, ".fini_array") == 0) - this_hdr->sh_type = SHT_FINI_ARRAY; - else if (strcmp (asect->name, ".preinit_array") == 0) - this_hdr->sh_type = SHT_PREINIT_ARRAY; - else if (strncmp (asect->name, ".note", 5) == 0) - this_hdr->sh_type = SHT_NOTE; - else if (strncmp (asect->name, ".stab", 5) == 0 - && strcmp (asect->name + strlen (asect->name) - 3, "str") == 0) - this_hdr->sh_type = SHT_STRTAB; - else if (strcmp (asect->name, ".gnu.version") == 0) - { - this_hdr->sh_type = SHT_GNU_versym; + break; + + case SHT_RELA: + if (get_elf_backend_data (abfd)->may_use_rela_p) + this_hdr->sh_entsize = bed->s->sizeof_rela; + break; + + case SHT_REL: + if (get_elf_backend_data (abfd)->may_use_rel_p) + this_hdr->sh_entsize = bed->s->sizeof_rel; + break; + + case SHT_GNU_versym: this_hdr->sh_entsize = sizeof (Elf_External_Versym); - } - else if (strcmp (asect->name, ".gnu.version_d") == 0) - { - this_hdr->sh_type = SHT_GNU_verdef; + break; + + case SHT_GNU_verdef: this_hdr->sh_entsize = 0; /* objcopy or strip will copy over sh_info, but may not set cverdefs. The linker will set cverdefs, but sh_info will be @@ -2403,10 +2444,9 @@ elf_fake_sections (abfd, asect, failedptrarg) else BFD_ASSERT (elf_tdata (abfd)->cverdefs == 0 || this_hdr->sh_info == elf_tdata (abfd)->cverdefs); - } - else if (strcmp (asect->name, ".gnu.version_r") == 0) - { - this_hdr->sh_type = SHT_GNU_verneed; + break; + + case SHT_GNU_verneed: this_hdr->sh_entsize = 0; /* objcopy or strip will copy over sh_info, but may not set cverrefs. The linker will set cverrefs, but sh_info will be @@ -2416,18 +2456,12 @@ elf_fake_sections (abfd, asect, failedptrarg) else BFD_ASSERT (elf_tdata (abfd)->cverrefs == 0 || this_hdr->sh_info == elf_tdata (abfd)->cverrefs); - } - else if ((asect->flags & SEC_GROUP) != 0) - { - this_hdr->sh_type = SHT_GROUP; + break; + + case SHT_GROUP: this_hdr->sh_entsize = 4; + break; } - else if ((asect->flags & SEC_ALLOC) != 0 - && (((asect->flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0) - || (asect->flags & SEC_NEVER_LOAD) != 0)) - this_hdr->sh_type = SHT_NOBITS; - else - this_hdr->sh_type = SHT_PROGBITS; if ((asect->flags & SEC_ALLOC) != 0) this_hdr->sh_flags |= SHF_ALLOC; @@ -2450,7 +2484,7 @@ elf_fake_sections (abfd, asect, failedptrarg) if (asect->_raw_size == 0 && (asect->flags & SEC_HAS_CONTENTS) == 0) { struct bfd_link_order *o; - + this_hdr->sh_size = 0; for (o = asect->link_order_head; o != NULL; o = o->next) if (this_hdr->sh_size < o->offset + o->size) @@ -2463,7 +2497,7 @@ elf_fake_sections (abfd, asect, failedptrarg) /* Check for processor-specific section types. */ if (bed->elf_backend_fake_sections && !(*bed->elf_backend_fake_sections) (abfd, this_hdr, asect)) - *failedptr = true; + *failedptr = TRUE; /* If the section has relocs, set up a section header for the SHT_REL[A] section. If two relocation sections are required for @@ -2473,24 +2507,21 @@ elf_fake_sections (abfd, asect, failedptrarg) && !_bfd_elf_init_reloc_shdr (abfd, &elf_section_data (asect)->rel_hdr, asect, - elf_section_data (asect)->use_rela_p)) - *failedptr = true; + asect->use_rela_p)) + *failedptr = TRUE; } /* Fill in the contents of a SHT_GROUP section. */ void -bfd_elf_set_group_contents (abfd, sec, failedptrarg) - bfd *abfd; - asection *sec; - PTR failedptrarg; +bfd_elf_set_group_contents (bfd *abfd, asection *sec, void *failedptrarg) { - boolean *failedptr = (boolean *) failedptrarg; + bfd_boolean *failedptr = failedptrarg; unsigned long symindx; asection *elt, *first; unsigned char *loc; struct bfd_link_order *l; - boolean gas; + bfd_boolean gas; if (elf_section_data (sec)->this_hdr.sh_type != SHT_GROUP || *failedptr) @@ -2512,17 +2543,17 @@ bfd_elf_set_group_contents (abfd, sec, failedptrarg) elf_section_data (sec)->this_hdr.sh_info = symindx; /* The contents won't be allocated for "ld -r" or objcopy. */ - gas = true; + gas = TRUE; if (sec->contents == NULL) { - gas = false; + gas = FALSE; sec->contents = bfd_alloc (abfd, sec->_raw_size); /* Arrange for the section to be written out. */ elf_section_data (sec)->this_hdr.contents = sec->contents; if (sec->contents == NULL) { - *failedptr = true; + *failedptr = TRUE; return; } } @@ -2588,9 +2619,8 @@ bfd_elf_set_group_contents (abfd, sec, failedptrarg) too. The link/info pointers for the standard section types are filled in here too, while we're at it. */ -static boolean -assign_section_numbers (abfd) - bfd *abfd; +static bfd_boolean +assign_section_numbers (bfd *abfd) { struct elf_obj_tdata *t = elf_tdata (abfd); asection *sec; @@ -2650,9 +2680,9 @@ assign_section_numbers (abfd) t->symtab_shndx_section = section_number++; t->symtab_shndx_hdr.sh_name = (unsigned int) _bfd_elf_strtab_add (elf_shstrtab (abfd), - ".symtab_shndx", false); + ".symtab_shndx", FALSE); if (t->symtab_shndx_hdr.sh_name == (unsigned int) -1) - return false; + return FALSE; } if (section_number == SHN_LORESERVE) section_number += SHN_HIRESERVE + 1 - SHN_LORESERVE; @@ -2671,18 +2701,17 @@ assign_section_numbers (abfd) /* Set up the list of section header pointers, in agreement with the indices. */ amt = section_number * sizeof (Elf_Internal_Shdr *); - i_shdrp = (Elf_Internal_Shdr **) bfd_alloc (abfd, amt); + i_shdrp = bfd_zalloc (abfd, amt); if (i_shdrp == NULL) - return false; + return FALSE; amt = sizeof (Elf_Internal_Shdr); - i_shdrp[0] = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt); + i_shdrp[0] = bfd_zalloc (abfd, amt); if (i_shdrp[0] == NULL) { bfd_release (abfd, i_shdrp); - return false; + return FALSE; } - memset (i_shdrp[0], 0, sizeof (Elf_Internal_Shdr)); elf_elfsections (abfd) = i_shdrp; @@ -2763,9 +2792,9 @@ assign_section_numbers (abfd) char *alc; len = strlen (sec->name); - alc = (char *) bfd_malloc ((bfd_size_type) (len - 2)); + alc = bfd_malloc (len - 2); if (alc == NULL) - return false; + return FALSE; memcpy (alc, sec->name, len - 3); alc[len - 3] = '\0'; s = bfd_get_section_by_name (abfd, alc); @@ -2814,30 +2843,27 @@ assign_section_numbers (abfd) else i_shdrp[secn]->sh_name = _bfd_elf_strtab_offset (elf_shstrtab (abfd), i_shdrp[secn]->sh_name); - return true; + return TRUE; } /* Map symbol from it's internal number to the external number, moving all local symbols to be at the head of the list. */ -static INLINE int -sym_is_global (abfd, sym) - bfd *abfd; - asymbol *sym; +static int +sym_is_global (bfd *abfd, asymbol *sym) { /* If the backend has a special mapping, use it. */ - if (get_elf_backend_data (abfd)->elf_backend_sym_is_global) - return ((*get_elf_backend_data (abfd)->elf_backend_sym_is_global) - (abfd, sym)); + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + if (bed->elf_backend_sym_is_global) + return (*bed->elf_backend_sym_is_global) (abfd, sym); return ((sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0 || bfd_is_und_section (bfd_get_section (sym)) || bfd_is_com_section (bfd_get_section (sym))); } -static boolean -elf_map_symbols (abfd) - bfd *abfd; +static bfd_boolean +elf_map_symbols (bfd *abfd) { unsigned int symcount = bfd_get_symcount (abfd); asymbol **syms = bfd_get_outsymbols (abfd); @@ -2865,9 +2891,9 @@ elf_map_symbols (abfd) max_index++; amt = max_index * sizeof (asymbol *); - sect_syms = (asymbol **) bfd_zalloc (abfd, amt); + sect_syms = bfd_zalloc (abfd, amt); if (sect_syms == NULL) - return false; + return FALSE; elf_section_syms (abfd) = sect_syms; elf_num_section_syms (abfd) = max_index; @@ -2939,10 +2965,10 @@ elf_map_symbols (abfd) /* Now sort the symbols so the local symbols are first. */ amt = (num_locals + num_globals) * sizeof (asymbol *); - new_syms = (asymbol **) bfd_alloc (abfd, amt); + new_syms = bfd_alloc (abfd, amt); if (new_syms == NULL) - return false; + return FALSE; for (idx = 0; idx < symcount; idx++) { @@ -2977,17 +3003,14 @@ elf_map_symbols (abfd) elf_num_locals (abfd) = num_locals; elf_num_globals (abfd) = num_globals; - return true; + return TRUE; } /* Align to the maximum file alignment that could be required for any ELF data structure. */ -static INLINE file_ptr align_file_position PARAMS ((file_ptr, int)); -static INLINE file_ptr -align_file_position (off, align) - file_ptr off; - int align; +static inline file_ptr +align_file_position (file_ptr off, int align) { return (off + align - 1) & ~(align - 1); } @@ -2995,11 +3018,10 @@ align_file_position (off, align) /* Assign a file position to a section, optionally aligning to the required section alignment. */ -INLINE file_ptr -_bfd_elf_assign_file_position_for_section (i_shdrp, offset, align) - Elf_Internal_Shdr *i_shdrp; - file_ptr offset; - boolean align; +file_ptr +_bfd_elf_assign_file_position_for_section (Elf_Internal_Shdr *i_shdrp, + file_ptr offset, + bfd_boolean align) { if (align) { @@ -3021,37 +3043,36 @@ _bfd_elf_assign_file_position_for_section (i_shdrp, offset, align) otherwise prepare to begin writing out the ELF file. If LINK_INFO is not NULL, this is being called by the ELF backend linker. */ -boolean -_bfd_elf_compute_section_file_positions (abfd, link_info) - bfd *abfd; - struct bfd_link_info *link_info; +bfd_boolean +_bfd_elf_compute_section_file_positions (bfd *abfd, + struct bfd_link_info *link_info) { - struct elf_backend_data *bed = get_elf_backend_data (abfd); - boolean failed; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + bfd_boolean failed; struct bfd_strtab_hash *strtab; Elf_Internal_Shdr *shstrtab_hdr; if (abfd->output_has_begun) - return true; + return TRUE; /* Do any elf backend specific processing first. */ if (bed->elf_backend_begin_write_processing) (*bed->elf_backend_begin_write_processing) (abfd, link_info); if (! prep_headers (abfd)) - return false; + return FALSE; /* Post process the headers if necessary. */ if (bed->elf_backend_post_process_headers) (*bed->elf_backend_post_process_headers) (abfd, link_info); - failed = false; + failed = FALSE; bfd_map_over_sections (abfd, elf_fake_sections, &failed); if (failed) - return false; + return FALSE; if (!assign_section_numbers (abfd)) - return false; + return FALSE; /* The backend linker builds symbol table information itself. */ if (link_info == NULL && bfd_get_symcount (abfd) > 0) @@ -3060,14 +3081,14 @@ _bfd_elf_compute_section_file_positions (abfd, link_info) int relocatable_p = ! (abfd->flags & (EXEC_P | DYNAMIC)); if (! swap_out_syms (abfd, &strtab, relocatable_p)) - return false; + return FALSE; } if (link_info == NULL) { bfd_map_over_sections (abfd, bfd_elf_set_group_contents, &failed); if (failed) - return false; + return FALSE; } shstrtab_hdr = &elf_tdata (abfd)->shstrtab_hdr; @@ -3082,8 +3103,8 @@ _bfd_elf_compute_section_file_positions (abfd, link_info) /* sh_offset is set in assign_file_positions_except_relocs. */ shstrtab_hdr->sh_addralign = 1; - if (!assign_file_positions_except_relocs (abfd)) - return false; + if (!assign_file_positions_except_relocs (abfd, link_info)) + return FALSE; if (link_info == NULL && bfd_get_symcount (abfd) > 0) { @@ -3093,14 +3114,14 @@ _bfd_elf_compute_section_file_positions (abfd, link_info) off = elf_tdata (abfd)->next_file_pos; hdr = &elf_tdata (abfd)->symtab_hdr; - off = _bfd_elf_assign_file_position_for_section (hdr, off, true); + off = _bfd_elf_assign_file_position_for_section (hdr, off, TRUE); hdr = &elf_tdata (abfd)->symtab_shndx_hdr; if (hdr->sh_size != 0) - off = _bfd_elf_assign_file_position_for_section (hdr, off, true); + off = _bfd_elf_assign_file_position_for_section (hdr, off, TRUE); hdr = &elf_tdata (abfd)->strtab_hdr; - off = _bfd_elf_assign_file_position_for_section (hdr, off, true); + off = _bfd_elf_assign_file_position_for_section (hdr, off, TRUE); elf_tdata (abfd)->next_file_pos = off; @@ -3108,24 +3129,23 @@ _bfd_elf_compute_section_file_positions (abfd, link_info) out. */ if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0 || ! _bfd_stringtab_emit (abfd, strtab)) - return false; + return FALSE; _bfd_stringtab_free (strtab); } - abfd->output_has_begun = true; + abfd->output_has_begun = TRUE; - return true; + return TRUE; } /* Create a mapping from a set of sections to a program segment. */ -static INLINE struct elf_segment_map * -make_mapping (abfd, sections, from, to, phdr) - bfd *abfd; - asection **sections; - unsigned int from; - unsigned int to; - boolean phdr; +static struct elf_segment_map * +make_mapping (bfd *abfd, + asection **sections, + unsigned int from, + unsigned int to, + bfd_boolean phdr) { struct elf_segment_map *m; unsigned int i; @@ -3134,7 +3154,7 @@ make_mapping (abfd, sections, from, to, phdr) amt = sizeof (struct elf_segment_map); amt += (to - from - 1) * sizeof (asection *); - m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); + m = bfd_zalloc (abfd, amt); if (m == NULL) return NULL; m->next = NULL; @@ -3155,9 +3175,8 @@ make_mapping (abfd, sections, from, to, phdr) /* Set up a mapping from BFD sections to program segments. */ -static boolean -map_sections_to_segments (abfd) - bfd *abfd; +static bfd_boolean +map_sections_to_segments (bfd *abfd) { asection **sections = NULL; asection *s; @@ -3167,26 +3186,27 @@ map_sections_to_segments (abfd) struct elf_segment_map **pm; struct elf_segment_map *m; asection *last_hdr; + bfd_vma last_size; unsigned int phdr_index; bfd_vma maxpagesize; asection **hdrpp; - boolean phdr_in_segment = true; - boolean writable; + bfd_boolean phdr_in_segment = TRUE; + bfd_boolean writable; int tls_count = 0; asection *first_tls = NULL; asection *dynsec, *eh_frame_hdr; bfd_size_type amt; if (elf_tdata (abfd)->segment_map != NULL) - return true; + return TRUE; if (bfd_count_sections (abfd) == 0) - return true; + return TRUE; /* Select the allocated sections, and sort them. */ amt = bfd_count_sections (abfd) * sizeof (asection *); - sections = (asection **) bfd_malloc (amt); + sections = bfd_malloc (amt); if (sections == NULL) goto error_return; @@ -3216,7 +3236,7 @@ map_sections_to_segments (abfd) if (s != NULL && (s->flags & SEC_LOAD) != 0) { amt = sizeof (struct elf_segment_map); - m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); + m = bfd_zalloc (abfd, amt); if (m == NULL) goto error_return; m->next = NULL; @@ -3230,7 +3250,7 @@ map_sections_to_segments (abfd) pm = &m->next; amt = sizeof (struct elf_segment_map); - m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); + m = bfd_zalloc (abfd, amt); if (m == NULL) goto error_return; m->next = NULL; @@ -3246,9 +3266,10 @@ map_sections_to_segments (abfd) segment when the start of the second section can be placed within a few bytes of the end of the first section. */ last_hdr = NULL; + last_size = 0; phdr_index = 0; maxpagesize = get_elf_backend_data (abfd)->maxpagesize; - writable = false; + writable = FALSE; dynsec = bfd_get_section_by_name (abfd, ".dynamic"); if (dynsec != NULL && (dynsec->flags & SEC_LOAD) == 0) @@ -3268,13 +3289,13 @@ map_sections_to_segments (abfd) if ((abfd->flags & D_PAGED) == 0 || sections[0]->lma < phdr_size || sections[0]->lma % maxpagesize < phdr_size % maxpagesize) - phdr_in_segment = false; + phdr_in_segment = FALSE; } for (i = 0, hdrpp = sections; i < count; i++, hdrpp++) { asection *hdr; - boolean new_segment; + bfd_boolean new_segment; hdr = *hdrpp; @@ -3285,39 +3306,40 @@ map_sections_to_segments (abfd) { /* If we don't have a segment yet, then we don't need a new one (we build the last one after this loop). */ - new_segment = false; + new_segment = FALSE; } else if (last_hdr->lma - last_hdr->vma != hdr->lma - hdr->vma) { /* If this section has a different relation between the virtual address and the load address, then we need a new segment. */ - new_segment = true; + new_segment = TRUE; } - else if (BFD_ALIGN (last_hdr->lma + last_hdr->_raw_size, maxpagesize) + else if (BFD_ALIGN (last_hdr->lma + last_size, maxpagesize) < BFD_ALIGN (hdr->lma, maxpagesize)) { /* If putting this section in this segment would force us to skip a page in the segment, then we need a new segment. */ - new_segment = true; + new_segment = TRUE; } - else if ((last_hdr->flags & SEC_LOAD) == 0 - && (hdr->flags & SEC_LOAD) != 0) + else if ((last_hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) == 0 + && (hdr->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) != 0) { /* We don't want to put a loadable section after a - nonloadable section in the same segment. */ - new_segment = true; + nonloadable section in the same segment. + Consider .tbss sections as loadable for this purpose. */ + new_segment = TRUE; } else if ((abfd->flags & D_PAGED) == 0) { /* If the file is not demand paged, which means that we don't require the sections to be correctly aligned in the file, then there is no other reason for a new segment. */ - new_segment = false; + new_segment = FALSE; } else if (! writable && (hdr->flags & SEC_READONLY) == 0 - && (((last_hdr->lma + last_hdr->_raw_size - 1) + && (((last_hdr->lma + last_size - 1) & ~(maxpagesize - 1)) != (hdr->lma & ~(maxpagesize - 1)))) { @@ -3328,19 +3350,24 @@ map_sections_to_segments (abfd) only case in which the new section is not on the same page as the previous section is when the previous section ends precisely on a page boundary. */ - new_segment = true; + new_segment = TRUE; } else { /* Otherwise, we can use the same segment. */ - new_segment = false; + new_segment = FALSE; } if (! new_segment) { if ((hdr->flags & SEC_READONLY) == 0) - writable = true; + writable = TRUE; last_hdr = hdr; + /* .tbss sections effectively have zero size. */ + if ((hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) != SEC_THREAD_LOCAL) + last_size = hdr->_raw_size; + else + last_size = 0; continue; } @@ -3355,13 +3382,18 @@ map_sections_to_segments (abfd) pm = &m->next; if ((hdr->flags & SEC_READONLY) == 0) - writable = true; + writable = TRUE; else - writable = false; + writable = FALSE; last_hdr = hdr; + /* .tbss sections effectively have zero size. */ + if ((hdr->flags & (SEC_THREAD_LOCAL | SEC_LOAD)) != SEC_THREAD_LOCAL) + last_size = hdr->_raw_size; + else + last_size = 0; phdr_index = i; - phdr_in_segment = false; + phdr_in_segment = FALSE; } /* Create a final PT_LOAD program segment. */ @@ -3379,7 +3411,7 @@ map_sections_to_segments (abfd) if (dynsec != NULL) { amt = sizeof (struct elf_segment_map); - m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); + m = bfd_zalloc (abfd, amt); if (m == NULL) goto error_return; m->next = NULL; @@ -3402,7 +3434,7 @@ map_sections_to_segments (abfd) && strncmp (s->name, ".note", 5) == 0) { amt = sizeof (struct elf_segment_map); - m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); + m = bfd_zalloc (abfd, amt); if (m == NULL) goto error_return; m->next = NULL; @@ -3428,7 +3460,7 @@ map_sections_to_segments (abfd) amt = sizeof (struct elf_segment_map); amt += (tls_count - 1) * sizeof (asection *); - m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); + m = bfd_zalloc (abfd, amt); if (m == NULL) goto error_return; m->next = NULL; @@ -3450,19 +3482,33 @@ map_sections_to_segments (abfd) /* If there is a .eh_frame_hdr section, throw in a PT_GNU_EH_FRAME segment. */ - eh_frame_hdr = NULL; - if (elf_tdata (abfd)->eh_frame_hdr) - eh_frame_hdr = bfd_get_section_by_name (abfd, ".eh_frame_hdr"); - if (eh_frame_hdr != NULL && (eh_frame_hdr->flags & SEC_LOAD)) + eh_frame_hdr = elf_tdata (abfd)->eh_frame_hdr; + if (eh_frame_hdr != NULL + && (eh_frame_hdr->output_section->flags & SEC_LOAD) != 0) { amt = sizeof (struct elf_segment_map); - m = (struct elf_segment_map *) bfd_zalloc (abfd, amt); + m = bfd_zalloc (abfd, amt); if (m == NULL) goto error_return; m->next = NULL; m->p_type = PT_GNU_EH_FRAME; m->count = 1; - m->sections[0] = eh_frame_hdr; + m->sections[0] = eh_frame_hdr->output_section; + + *pm = m; + pm = &m->next; + } + + if (elf_tdata (abfd)->stack_flags) + { + amt = sizeof (struct elf_segment_map); + m = bfd_zalloc (abfd, amt); + if (m == NULL) + goto error_return; + m->next = NULL; + m->p_type = PT_GNU_STACK; + m->p_flags = elf_tdata (abfd)->stack_flags; + m->p_flags_valid = 1; *pm = m; pm = &m->next; @@ -3472,23 +3518,22 @@ map_sections_to_segments (abfd) sections = NULL; elf_tdata (abfd)->segment_map = mfirst; - return true; + return TRUE; error_return: if (sections != NULL) free (sections); - return false; + return FALSE; } /* Sort sections by address. */ static int -elf_sort_sections (arg1, arg2) - const PTR arg1; - const PTR arg2; +elf_sort_sections (const void *arg1, const void *arg2) { const asection *sec1 = *(const asection **) arg1; const asection *sec2 = *(const asection **) arg2; + bfd_size_type size1, size2; /* Sort by LMA first, since this is the address used to place the section into a segment. */ @@ -3506,7 +3551,7 @@ elf_sort_sections (arg1, arg2) /* Put !SEC_LOAD sections after SEC_LOAD ones. */ -#define TOEND(x) (((x)->flags & SEC_LOAD) == 0) +#define TOEND(x) (((x)->flags & (SEC_LOAD | SEC_THREAD_LOCAL)) == 0) if (TOEND (sec1)) { @@ -3528,21 +3573,52 @@ elf_sort_sections (arg1, arg2) /* Sort by size, to put zero sized sections before others at the same address. */ - if (sec1->_raw_size < sec2->_raw_size) + size1 = (sec1->flags & SEC_LOAD) ? sec1->_raw_size : 0; + size2 = (sec2->flags & SEC_LOAD) ? sec2->_raw_size : 0; + + if (size1 < size2) return -1; - if (sec1->_raw_size > sec2->_raw_size) + if (size1 > size2) return 1; return sec1->target_index - sec2->target_index; } +/* Ian Lance Taylor writes: + + We shouldn't be using % with a negative signed number. That's just + not good. We have to make sure either that the number is not + negative, or that the number has an unsigned type. When the types + are all the same size they wind up as unsigned. When file_ptr is a + larger signed type, the arithmetic winds up as signed long long, + which is wrong. + + What we're trying to say here is something like ``increase OFF by + the least amount that will cause it to be equal to the VMA modulo + the page size.'' */ +/* In other words, something like: + + vma_offset = m->sections[0]->vma % bed->maxpagesize; + off_offset = off % bed->maxpagesize; + if (vma_offset < off_offset) + adjustment = vma_offset + bed->maxpagesize - off_offset; + else + adjustment = vma_offset - off_offset; + + which can can be collapsed into the expression below. */ + +static file_ptr +vma_page_aligned_bias (bfd_vma vma, ufile_ptr off, bfd_vma maxpagesize) +{ + return ((vma - off) % maxpagesize); +} + /* Assign file positions to the sections based on the mapping from sections to segments. This function also sets up some fields in the file header, and writes out the program headers. */ -static boolean -assign_file_positions_for_segments (abfd) - bfd *abfd; +static bfd_boolean +assign_file_positions_for_segments (bfd *abfd, struct bfd_link_info *link_info) { const struct elf_backend_data *bed = get_elf_backend_data (abfd); unsigned int count; @@ -3558,7 +3634,7 @@ assign_file_positions_for_segments (abfd) if (elf_tdata (abfd)->segment_map == NULL) { if (! map_sections_to_segments (abfd)) - return false; + return FALSE; } else { @@ -3594,8 +3670,8 @@ assign_file_positions_for_segments (abfd) if (bed->elf_backend_modify_segment_map) { - if (! (*bed->elf_backend_modify_segment_map) (abfd)) - return false; + if (! (*bed->elf_backend_modify_segment_map) (abfd, link_info)) + return FALSE; } count = 0; @@ -3607,7 +3683,7 @@ assign_file_positions_for_segments (abfd) elf_elfheader (abfd)->e_phnum = count; if (count == 0) - return true; + return TRUE; /* If we already counted the number of program segments, make sure that we allocated enough space. This happens when SIZEOF_HEADERS @@ -3619,16 +3695,16 @@ assign_file_positions_for_segments (abfd) (_("%s: Not enough room for program headers (allocated %u, need %u)"), bfd_get_filename (abfd), alloc, count)); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } if (alloc == 0) alloc = count; amt = alloc * sizeof (Elf_Internal_Phdr); - phdrs = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt); + phdrs = bfd_alloc (abfd, amt); if (phdrs == NULL) - return false; + return FALSE; off = bed->s->sizeof_ehdr; off += alloc * bed->s->sizeof_phdr; @@ -3664,7 +3740,8 @@ assign_file_positions_for_segments (abfd) && (m->sections[0]->flags & SEC_ALLOC) != 0) { if ((abfd->flags & D_PAGED) != 0) - off += (m->sections[0]->vma - off) % bed->maxpagesize; + off += vma_page_aligned_bias (m->sections[0]->vma, off, + bed->maxpagesize); else { bfd_size_type align; @@ -3679,7 +3756,8 @@ assign_file_positions_for_segments (abfd) align = secalign; } - off += (m->sections[0]->vma - off) % (1 << align); + off += vma_page_aligned_bias (m->sections[0]->vma, off, + 1 << align); } } @@ -3699,7 +3777,7 @@ assign_file_positions_for_segments (abfd) && (abfd->flags & D_PAGED) != 0) p->p_align = bed->maxpagesize; else if (m->count == 0) - p->p_align = bed->s->file_align; + p->p_align = 1 << bed->s->log_file_align; else p->p_align = 0; @@ -3724,7 +3802,7 @@ assign_file_positions_for_segments (abfd) (_("%s: Not enough room for program headers, try linking with -N"), bfd_get_filename (abfd)); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } p->p_vaddr -= off; @@ -3811,9 +3889,15 @@ assign_file_positions_for_segments (abfd) bfd_vma adjust = sec->lma - (p->p_paddr + p->p_memsz); p->p_memsz += adjust; - off += adjust; - voff += adjust; - if ((flags & SEC_LOAD) != 0) + if (p->p_type == PT_LOAD + || (p->p_type == PT_NOTE + && bfd_get_format (abfd) == bfd_core)) + { + off += adjust; + voff += adjust; + } + if ((flags & SEC_LOAD) != 0 + || (flags & SEC_THREAD_LOCAL) != 0) p->p_filesz += adjust; } @@ -3835,9 +3919,11 @@ assign_file_positions_for_segments (abfd) not have the SEC_LOAD case just above, and then this was necessary, but now I'm not sure. */ if ((abfd->flags & D_PAGED) != 0) - adjust = (sec->vma - voff) % bed->maxpagesize; + adjust = vma_page_aligned_bias (sec->vma, voff, + bed->maxpagesize); else - adjust = (sec->vma - voff) % align; + adjust = vma_page_aligned_bias (sec->vma, voff, + align); } else adjust = 0; @@ -3851,7 +3937,7 @@ Error: First section in segment (%s) starts at 0x%x whereas the segment starts a bfd_section_name (abfd, sec), sec->lma, p->p_paddr); - return false; + return FALSE; } p->p_memsz += adjust; off += adjust; @@ -3870,7 +3956,9 @@ Error: First section in segment (%s) starts at 0x%x whereas the segment starts a || (flags & SEC_HAS_CONTENTS) != 0) off += sec->_raw_size; - if ((flags & SEC_ALLOC) != 0) + if ((flags & SEC_ALLOC) != 0 + && ((flags & SEC_LOAD) != 0 + || (flags & SEC_THREAD_LOCAL) == 0)) voff += sec->_raw_size; } @@ -3897,6 +3985,9 @@ Error: First section in segment (%s) starts at 0x%x whereas the segment starts a } else { + if ((sec->flags & SEC_LOAD) != 0 + || (sec->flags & SEC_THREAD_LOCAL) == 0 + || p->p_type == PT_TLS) p->p_memsz += sec->_raw_size; if ((flags & SEC_LOAD) != 0) @@ -3974,9 +4065,9 @@ Error: First section in segment (%s) starts at 0x%x whereas the segment starts a /* Write out the program headers. */ if (bfd_seek (abfd, (bfd_signed_vma) bed->s->sizeof_ehdr, SEEK_SET) != 0 || bed->s->write_out_phdrs (abfd, phdrs, alloc) != 0) - return false; + return FALSE; - return true; + return TRUE; } /* Get the size of the program header. @@ -3991,12 +4082,11 @@ Error: First section in segment (%s) starts at 0x%x whereas the segment starts a will be two segments. */ static bfd_size_type -get_program_header_size (abfd) - bfd *abfd; +get_program_header_size (bfd *abfd) { size_t segs; asection *s; - struct elf_backend_data *bed = get_elf_backend_data (abfd); + const struct elf_backend_data *bed = get_elf_backend_data (abfd); /* We can't return a different result each time we're called. */ if (elf_tdata (abfd)->program_header_size != 0) @@ -4033,13 +4123,18 @@ get_program_header_size (abfd) ++segs; } - if (elf_tdata (abfd)->eh_frame_hdr - && bfd_get_section_by_name (abfd, ".eh_frame_hdr") != NULL) + if (elf_tdata (abfd)->eh_frame_hdr) { /* We need a PT_GNU_EH_FRAME segment. */ ++segs; } + if (elf_tdata (abfd)->stack_flags) + { + /* We need a PT_GNU_STACK segment. */ + ++segs; + } + for (s = abfd->sections; s != NULL; s = s->next) { if ((s->flags & SEC_LOAD) != 0 @@ -4086,16 +4181,16 @@ get_program_header_size (abfd) We also don't set the positions of the .symtab and .strtab here. */ -static boolean -assign_file_positions_except_relocs (abfd) - bfd *abfd; +static bfd_boolean +assign_file_positions_except_relocs (bfd *abfd, + struct bfd_link_info *link_info) { struct elf_obj_tdata * const tdata = elf_tdata (abfd); Elf_Internal_Ehdr * const i_ehdrp = elf_elfheader (abfd); Elf_Internal_Shdr ** const i_shdrpp = elf_elfsections (abfd); unsigned int num_sec = elf_numsections (abfd); file_ptr off; - struct elf_backend_data *bed = get_elf_backend_data (abfd); + const struct elf_backend_data *bed = get_elf_backend_data (abfd); if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0 && bfd_get_format (abfd) != bfd_core) @@ -4123,7 +4218,7 @@ assign_file_positions_except_relocs (abfd) hdr->sh_offset = -1; } else - off = _bfd_elf_assign_file_position_for_section (hdr, off, true); + off = _bfd_elf_assign_file_position_for_section (hdr, off, TRUE); if (i == SHN_LORESERVE - 1) { @@ -4139,8 +4234,8 @@ assign_file_positions_except_relocs (abfd) /* Assign file positions for the loaded sections based on the assignment of sections to segments. */ - if (! assign_file_positions_for_segments (abfd)) - return false; + if (! assign_file_positions_for_segments (abfd, link_info)) + return FALSE; /* Assign file positions for the other sections. */ @@ -4162,20 +4257,20 @@ assign_file_positions_except_relocs (abfd) ? "*unknown*" : hdr->bfd_section->name))); if ((abfd->flags & D_PAGED) != 0) - off += (hdr->sh_addr - off) % bed->maxpagesize; + off += vma_page_aligned_bias (hdr->sh_addr, off, + bed->maxpagesize); else - off += (hdr->sh_addr - off) % hdr->sh_addralign; + off += vma_page_aligned_bias (hdr->sh_addr, off, + hdr->sh_addralign); off = _bfd_elf_assign_file_position_for_section (hdr, off, - false); + FALSE); } - else if (hdr->sh_type == SHT_REL - || hdr->sh_type == SHT_RELA - || hdr == i_shdrpp[tdata->symtab_section] + else if (hdr == i_shdrpp[tdata->symtab_section] || hdr == i_shdrpp[tdata->symtab_shndx_section] || hdr == i_shdrpp[tdata->strtab_section]) hdr->sh_offset = -1; else - off = _bfd_elf_assign_file_position_for_section (hdr, off, true); + off = _bfd_elf_assign_file_position_for_section (hdr, off, TRUE); if (i == SHN_LORESERVE - 1) { @@ -4186,31 +4281,30 @@ assign_file_positions_except_relocs (abfd) } /* Place the section headers. */ - off = align_file_position (off, bed->s->file_align); + off = align_file_position (off, 1 << bed->s->log_file_align); i_ehdrp->e_shoff = off; off += i_ehdrp->e_shnum * i_ehdrp->e_shentsize; elf_tdata (abfd)->next_file_pos = off; - return true; + return TRUE; } -static boolean -prep_headers (abfd) - bfd *abfd; +static bfd_boolean +prep_headers (bfd *abfd) { Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */ Elf_Internal_Phdr *i_phdrp = 0; /* Program header table, internal form */ Elf_Internal_Shdr **i_shdrp; /* Section header table, internal form */ struct elf_strtab_hash *shstrtab; - struct elf_backend_data *bed = get_elf_backend_data (abfd); + const struct elf_backend_data *bed = get_elf_backend_data (abfd); i_ehdrp = elf_elfheader (abfd); i_shdrp = elf_elfsections (abfd); shstrtab = _bfd_elf_strtab_init (); if (shstrtab == NULL) - return false; + return FALSE; elf_shstrtab (abfd) = shstrtab; @@ -4248,11 +4342,8 @@ prep_headers (abfd) Such need can generally be supplied by replacing the tests for e_machine with the conditions used to determine it. */ default: - if (get_elf_backend_data (abfd) != NULL) - i_ehdrp->e_machine = get_elf_backend_data (abfd)->elf_machine_code; - else - i_ehdrp->e_machine = EM_NONE; - } + i_ehdrp->e_machine = bed->elf_machine_code; + } i_ehdrp->e_version = bed->s->ev_current; i_ehdrp->e_ehsize = bed->s->sizeof_ehdr; @@ -4288,25 +4379,24 @@ prep_headers (abfd) } elf_tdata (abfd)->symtab_hdr.sh_name = - (unsigned int) _bfd_elf_strtab_add (shstrtab, ".symtab", false); + (unsigned int) _bfd_elf_strtab_add (shstrtab, ".symtab", FALSE); elf_tdata (abfd)->strtab_hdr.sh_name = - (unsigned int) _bfd_elf_strtab_add (shstrtab, ".strtab", false); + (unsigned int) _bfd_elf_strtab_add (shstrtab, ".strtab", FALSE); elf_tdata (abfd)->shstrtab_hdr.sh_name = - (unsigned int) _bfd_elf_strtab_add (shstrtab, ".shstrtab", false); + (unsigned int) _bfd_elf_strtab_add (shstrtab, ".shstrtab", FALSE); if (elf_tdata (abfd)->symtab_hdr.sh_name == (unsigned int) -1 || elf_tdata (abfd)->symtab_hdr.sh_name == (unsigned int) -1 || elf_tdata (abfd)->shstrtab_hdr.sh_name == (unsigned int) -1) - return false; + return FALSE; - return true; + return TRUE; } /* Assign file positions for all the reloc sections which are not part of the loadable file image. */ void -_bfd_elf_assign_file_positions_for_relocs (abfd) - bfd *abfd; +_bfd_elf_assign_file_positions_for_relocs (bfd *abfd) { file_ptr off; unsigned int i, num_sec; @@ -4322,34 +4412,32 @@ _bfd_elf_assign_file_positions_for_relocs (abfd) shdrp = *shdrpp; if ((shdrp->sh_type == SHT_REL || shdrp->sh_type == SHT_RELA) && shdrp->sh_offset == -1) - off = _bfd_elf_assign_file_position_for_section (shdrp, off, true); + off = _bfd_elf_assign_file_position_for_section (shdrp, off, TRUE); } elf_tdata (abfd)->next_file_pos = off; } -boolean -_bfd_elf_write_object_contents (abfd) - bfd *abfd; +bfd_boolean +_bfd_elf_write_object_contents (bfd *abfd) { - struct elf_backend_data *bed = get_elf_backend_data (abfd); + const struct elf_backend_data *bed = get_elf_backend_data (abfd); Elf_Internal_Ehdr *i_ehdrp; Elf_Internal_Shdr **i_shdrp; - boolean failed; + bfd_boolean failed; unsigned int count, num_sec; if (! abfd->output_has_begun - && ! _bfd_elf_compute_section_file_positions - (abfd, (struct bfd_link_info *) NULL)) - return false; + && ! _bfd_elf_compute_section_file_positions (abfd, NULL)) + return FALSE; i_shdrp = elf_elfsections (abfd); i_ehdrp = elf_elfheader (abfd); - failed = false; + failed = FALSE; bfd_map_over_sections (abfd, bed->s->write_relocs, &failed); if (failed) - return false; + return FALSE; _bfd_elf_assign_file_positions_for_relocs (abfd); @@ -4365,7 +4453,7 @@ _bfd_elf_write_object_contents (abfd) if (bfd_seek (abfd, i_shdrp[count]->sh_offset, SEEK_SET) != 0 || bfd_bwrite (i_shdrp[count]->contents, amt, abfd) != amt) - return false; + return FALSE; } if (count == SHN_LORESERVE - 1) count += SHN_HIRESERVE + 1 - SHN_LORESERVE; @@ -4374,7 +4462,7 @@ _bfd_elf_write_object_contents (abfd) /* Write out the section header names. */ if (bfd_seek (abfd, elf_tdata (abfd)->shstrtab_hdr.sh_offset, SEEK_SET) != 0 || ! _bfd_elf_strtab_emit (abfd, elf_shstrtab (abfd))) - return false; + return FALSE; if (bed->elf_backend_final_write_processing) (*bed->elf_backend_final_write_processing) (abfd, @@ -4383,9 +4471,8 @@ _bfd_elf_write_object_contents (abfd) return bed->s->write_shdrs_and_ehdr (abfd); } -boolean -_bfd_elf_write_corefile_contents (abfd) - bfd *abfd; +bfd_boolean +_bfd_elf_write_corefile_contents (bfd *abfd) { /* Hopefully this can be done just like an object file. */ return _bfd_elf_write_object_contents (abfd); @@ -4394,11 +4481,9 @@ _bfd_elf_write_corefile_contents (abfd) /* Given a section, search the header to find them. */ int -_bfd_elf_section_from_bfd_section (abfd, asect) - bfd *abfd; - struct sec *asect; +_bfd_elf_section_from_bfd_section (bfd *abfd, struct bfd_section *asect) { - struct elf_backend_data *bed; + const struct elf_backend_data *bed; int index; if (elf_section_data (asect) != NULL @@ -4445,9 +4530,7 @@ _bfd_elf_section_from_bfd_section (abfd, asect) on error. */ int -_bfd_elf_symbol_from_bfd_symbol (abfd, asym_ptr_ptr) - bfd *abfd; - asymbol **asym_ptr_ptr; +_bfd_elf_symbol_from_bfd_symbol (bfd *abfd, asymbol **asym_ptr_ptr) { asymbol *asym_ptr = *asym_ptr_ptr; int idx; @@ -4501,31 +4584,29 @@ _bfd_elf_symbol_from_bfd_symbol (abfd, asym_ptr_ptr) /* Copy private BFD data. This copies any program header information. */ -static boolean -copy_private_bfd_data (ibfd, obfd) - bfd *ibfd; - bfd *obfd; -{ - Elf_Internal_Ehdr * iehdr; - struct elf_segment_map * map; - struct elf_segment_map * map_first; - struct elf_segment_map ** pointer_to_map; - Elf_Internal_Phdr * segment; - asection * section; - unsigned int i; - unsigned int num_segments; - boolean phdr_included = false; - bfd_vma maxpagesize; - struct elf_segment_map * phdr_adjust_seg = NULL; - unsigned int phdr_adjust_num = 0; - struct elf_backend_data * bed; +static bfd_boolean +copy_private_bfd_data (bfd *ibfd, bfd *obfd) +{ + Elf_Internal_Ehdr *iehdr; + struct elf_segment_map *map; + struct elf_segment_map *map_first; + struct elf_segment_map **pointer_to_map; + Elf_Internal_Phdr *segment; + asection *section; + unsigned int i; + unsigned int num_segments; + bfd_boolean phdr_included = FALSE; + bfd_vma maxpagesize; + struct elf_segment_map *phdr_adjust_seg = NULL; + unsigned int phdr_adjust_num = 0; + const struct elf_backend_data *bed; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) - return true; + return TRUE; if (elf_tdata (ibfd)->phdr == NULL) - return true; + return TRUE; bed = get_elf_backend_data (ibfd); iehdr = elf_elfheader (ibfd); @@ -4541,18 +4622,23 @@ copy_private_bfd_data (ibfd, obfd) (start + (segment->p_memsz > segment->p_filesz \ ? segment->p_memsz : segment->p_filesz)) - /* Returns true if the given section is contained within +#define SECTION_SIZE(section, segment) \ + (((section->flags & (SEC_HAS_CONTENTS | SEC_THREAD_LOCAL)) \ + != SEC_THREAD_LOCAL || segment->p_type == PT_TLS) \ + ? section->_raw_size : 0) + + /* Returns TRUE if the given section is contained within the given segment. VMA addresses are compared. */ #define IS_CONTAINED_BY_VMA(section, segment) \ (section->vma >= segment->p_vaddr \ - && (section->vma + section->_raw_size \ + && (section->vma + SECTION_SIZE (section, segment) \ <= (SEGMENT_END (segment, segment->p_vaddr)))) - /* Returns true if the given section is contained within + /* Returns TRUE if the given section is contained within the given segment. LMA addresses are compared. */ #define IS_CONTAINED_BY_LMA(section, segment, base) \ (section->lma >= base \ - && (section->lma + section->_raw_size \ + && (section->lma + SECTION_SIZE (section, segment) \ <= SEGMENT_END (segment, base))) /* Special case: corefile "NOTE" section containing regs, prpsinfo etc. */ @@ -4584,7 +4670,10 @@ copy_private_bfd_data (ibfd, obfd) if that is set for the segment and the VMA otherwise, 2. It is an allocated segment, 3. There is an output section associated with it, - 4. The section has not already been allocated to a previous segment. */ + 4. The section has not already been allocated to a previous segment. + 5. PT_GNU_STACK segments do not include any sections. + 6. PT_TLS segment includes only SHF_TLS sections. + 7. SHF_TLS sections are only in PT_TLS or PT_LOAD segments. */ #define INCLUDE_SECTION_IN_SEGMENT(section, segment, bed) \ ((((segment->p_paddr \ ? IS_CONTAINED_BY_LMA (section, segment, segment->p_paddr) \ @@ -4592,20 +4681,33 @@ copy_private_bfd_data (ibfd, obfd) && (section->flags & SEC_ALLOC) != 0) \ || IS_COREFILE_NOTE (segment, section)) \ && section->output_section != NULL \ + && segment->p_type != PT_GNU_STACK \ + && (segment->p_type != PT_TLS \ + || (section->flags & SEC_THREAD_LOCAL)) \ + && (segment->p_type == PT_LOAD \ + || segment->p_type == PT_TLS \ + || (section->flags & SEC_THREAD_LOCAL) == 0) \ && ! section->segment_mark) - /* Returns true iff seg1 starts after the end of seg2. */ -#define SEGMENT_AFTER_SEGMENT(seg1, seg2) \ - (seg1->p_vaddr >= SEGMENT_END (seg2, seg2->p_vaddr)) + /* Returns TRUE iff seg1 starts after the end of seg2. */ +#define SEGMENT_AFTER_SEGMENT(seg1, seg2, field) \ + (seg1->field >= SEGMENT_END (seg2, seg2->field)) - /* Returns true iff seg1 and seg2 overlap. */ + /* Returns TRUE iff seg1 and seg2 overlap. Segments overlap iff both + their VMA address ranges and their LMA address ranges overlap. + It is possible to have overlapping VMA ranges without overlapping LMA + ranges. RedBoot images for example can have both .data and .bss mapped + to the same VMA range, but with the .data section mapped to a different + LMA. */ #define SEGMENT_OVERLAPS(seg1, seg2) \ - (!(SEGMENT_AFTER_SEGMENT (seg1, seg2) \ - || SEGMENT_AFTER_SEGMENT (seg2, seg1))) + ( !(SEGMENT_AFTER_SEGMENT (seg1, seg2, p_vaddr) \ + || SEGMENT_AFTER_SEGMENT (seg2, seg1, p_vaddr)) \ + && !(SEGMENT_AFTER_SEGMENT (seg1, seg2, p_paddr) \ + || SEGMENT_AFTER_SEGMENT (seg2, seg1, p_paddr))) /* Initialise the segment mark field. */ for (section = ibfd->sections; section != NULL; section = section->next) - section->segment_mark = false; + section->segment_mark = FALSE; /* Scan through the segments specified in the program header of the input BFD. For this first scan we look for overlaps @@ -4623,7 +4725,7 @@ copy_private_bfd_data (ibfd, obfd) if (IS_SOLARIS_PT_INTERP (segment, section)) { /* Mininal change so that the normal section to segment - assigment code will work. */ + assignment code will work. */ segment->p_vaddr = section->vma; break; } @@ -4699,18 +4801,19 @@ copy_private_bfd_data (ibfd, obfd) continue; /* Compute how many sections might be placed into this segment. */ - section_count = 0; - for (section = ibfd->sections; section != NULL; section = section->next) + for (section = ibfd->sections, section_count = 0; + section != NULL; + section = section->next) if (INCLUDE_SECTION_IN_SEGMENT (section, segment, bed)) ++section_count; - /* Allocate a segment map big enough to contain all of the - sections we have selected. */ + /* Allocate a segment map big enough to contain + all of the sections we have selected. */ amt = sizeof (struct elf_segment_map); amt += ((bfd_size_type) section_count - 1) * sizeof (asection *); - map = (struct elf_segment_map *) bfd_alloc (obfd, amt); + map = bfd_alloc (obfd, amt); if (map == NULL) - return false; + return FALSE; /* Initialise the fields of the segment map. Default to using the physical address of the segment in the input BFD. */ @@ -4737,7 +4840,7 @@ copy_private_bfd_data (ibfd, obfd) + iehdr->e_phnum * iehdr->e_phentsize))); if (segment->p_type == PT_LOAD && map->includes_phdrs) - phdr_included = true; + phdr_included = TRUE; } if (section_count == 0) @@ -4777,7 +4880,7 @@ copy_private_bfd_data (ibfd, obfd) and possibly its LMA changed, and a new segment or segments will have to be created to contain the other sections. - 4. The sections have been moved, but not be the same amount. + 4. The sections have been moved, but not by the same amount. In this case we can change the segment's LMA to match the LMA of the first section and we will have to create a new segment or segments to contain the other sections. @@ -4789,9 +4892,9 @@ copy_private_bfd_data (ibfd, obfd) /* Gcc 2.96 miscompiles this code on mips. Don't do casting here to work around this long long bug. */ amt = section_count * sizeof (asection *); - sections = (asection **) bfd_malloc (amt); + sections = bfd_malloc (amt); if (sections == NULL) - return false; + return FALSE; /* Step One: Scan for segment vs section LMA conflicts. Also add the sections to the section array allocated above. @@ -4972,7 +5075,7 @@ copy_private_bfd_data (ibfd, obfd) map->sections[map->count++] = output_section; ++isec; sections[j] = NULL; - section->segment_mark = true; + section->segment_mark = TRUE; } else if (suggested_lma == 0) suggested_lma = output_section->lma; @@ -4991,9 +5094,12 @@ copy_private_bfd_data (ibfd, obfd) and carry on looping. */ amt = sizeof (struct elf_segment_map); amt += ((bfd_size_type) section_count - 1) * sizeof (asection *); - map = (struct elf_segment_map *) bfd_alloc (obfd, amt); + map = bfd_alloc (obfd, amt); if (map == NULL) - return false; + { + free (sections); + return FALSE; + } /* Initialise the fields of the segment map. Set the physical physical address to the LMA of the first section that has @@ -5021,10 +5127,8 @@ copy_private_bfd_data (ibfd, obfd) if (map->p_paddr != 0) break; if (map == NULL) - { - for (map = map_first; map != NULL; map = map->next) - map->p_paddr_valid = 0; - } + for (map = map_first; map != NULL; map = map->next) + map->p_paddr_valid = 0; elf_tdata (obfd)->segment_map = map_first; @@ -5069,6 +5173,7 @@ copy_private_bfd_data (ibfd, obfd) #endif #undef SEGMENT_END +#undef SECTION_SIZE #undef IS_CONTAINED_BY_VMA #undef IS_CONTAINED_BY_LMA #undef IS_COREFILE_NOTE @@ -5076,24 +5181,23 @@ copy_private_bfd_data (ibfd, obfd) #undef INCLUDE_SECTION_IN_SEGMENT #undef SEGMENT_AFTER_SEGMENT #undef SEGMENT_OVERLAPS - return true; + return TRUE; } /* Copy private section information. This copies over the entsize field, and sometimes the info field. */ -boolean -_bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec) - bfd *ibfd; - asection *isec; - bfd *obfd; - asection *osec; +bfd_boolean +_bfd_elf_copy_private_section_data (bfd *ibfd, + asection *isec, + bfd *obfd, + asection *osec) { Elf_Internal_Shdr *ihdr, *ohdr; if (ibfd->xvec->flavour != bfd_target_elf_flavour || obfd->xvec->flavour != bfd_target_elf_flavour) - return true; + return TRUE; if (elf_tdata (obfd)->segment_map == NULL && elf_tdata (ibfd)->phdr != NULL) { @@ -5109,7 +5213,7 @@ _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec) if (s == NULL) { if (! copy_private_bfd_data (ibfd, obfd)) - return false; + return FALSE; } } @@ -5130,10 +5234,9 @@ _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec) elf_next_in_group (osec) = elf_next_in_group (isec); elf_group_name (osec) = elf_group_name (isec); - elf_section_data (osec)->use_rela_p - = elf_section_data (isec)->use_rela_p; + osec->use_rela_p = isec->use_rela_p; - return true; + return TRUE; } /* Copy private symbol information. If this symbol is in a section @@ -5148,18 +5251,17 @@ _bfd_elf_copy_private_section_data (ibfd, isec, obfd, osec) #define MAP_SHSTRTAB (SHN_HIOS + 4) #define MAP_SYM_SHNDX (SHN_HIOS + 5) -boolean -_bfd_elf_copy_private_symbol_data (ibfd, isymarg, obfd, osymarg) - bfd *ibfd; - asymbol *isymarg; - bfd *obfd; - asymbol *osymarg; +bfd_boolean +_bfd_elf_copy_private_symbol_data (bfd *ibfd, + asymbol *isymarg, + bfd *obfd, + asymbol *osymarg) { elf_symbol_type *isym, *osym; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) - return true; + return TRUE; isym = elf_symbol_from (ibfd, isymarg); osym = elf_symbol_from (obfd, osymarg); @@ -5184,18 +5286,17 @@ _bfd_elf_copy_private_symbol_data (ibfd, isymarg, obfd, osymarg) osym->internal_elf_sym.st_shndx = shndx; } - return true; + return TRUE; } /* Swap out the symbols. */ -static boolean -swap_out_syms (abfd, sttp, relocatable_p) - bfd *abfd; - struct bfd_strtab_hash **sttp; - int relocatable_p; +static bfd_boolean +swap_out_syms (bfd *abfd, + struct bfd_strtab_hash **sttp, + int relocatable_p) { - struct elf_backend_data *bed; + const struct elf_backend_data *bed; int symcount; asymbol **syms; struct bfd_strtab_hash *stt; @@ -5206,14 +5307,15 @@ swap_out_syms (abfd, sttp, relocatable_p) char *outbound_shndx; int idx; bfd_size_type amt; + bfd_boolean name_local_sections; if (!elf_map_symbols (abfd)) - return false; + return FALSE; /* Dump out the symtabs. */ stt = _bfd_elf_stringtab_init (); if (stt == NULL) - return false; + return FALSE; bed = get_elf_backend_data (abfd); symcount = bfd_get_symcount (abfd); @@ -5222,7 +5324,7 @@ swap_out_syms (abfd, sttp, relocatable_p) symtab_hdr->sh_entsize = bed->s->sizeof_sym; symtab_hdr->sh_size = symtab_hdr->sh_entsize * (symcount + 1); symtab_hdr->sh_info = elf_num_locals (abfd) + 1; - symtab_hdr->sh_addralign = bed->s->file_align; + symtab_hdr->sh_addralign = 1 << bed->s->log_file_align; symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr; symstrtab_hdr->sh_type = SHT_STRTAB; @@ -5230,8 +5332,11 @@ swap_out_syms (abfd, sttp, relocatable_p) amt = (bfd_size_type) (1 + symcount) * bed->s->sizeof_sym; outbound_syms = bfd_alloc (abfd, amt); if (outbound_syms == NULL) - return false; - symtab_hdr->contents = (PTR) outbound_syms; + { + _bfd_stringtab_free (stt); + return FALSE; + } + symtab_hdr->contents = outbound_syms; outbound_shndx = NULL; symtab_shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; @@ -5240,7 +5345,11 @@ swap_out_syms (abfd, sttp, relocatable_p) amt = (bfd_size_type) (1 + symcount) * sizeof (Elf_External_Sym_Shndx); outbound_shndx = bfd_zalloc (abfd, amt); if (outbound_shndx == NULL) - return false; + { + _bfd_stringtab_free (stt); + return FALSE; + } + symtab_shndx_hdr->contents = outbound_shndx; symtab_shndx_hdr->sh_type = SHT_SYMTAB_SHNDX; symtab_shndx_hdr->sh_size = amt; @@ -5248,7 +5357,7 @@ swap_out_syms (abfd, sttp, relocatable_p) symtab_shndx_hdr->sh_entsize = sizeof (Elf_External_Sym_Shndx); } - /* now generate the data (for "contents") */ + /* Now generate the data (for "contents"). */ { /* Fill in zeroth symbol and swap it out. */ Elf_Internal_Sym sym; @@ -5264,6 +5373,10 @@ swap_out_syms (abfd, sttp, relocatable_p) outbound_shndx += sizeof (Elf_External_Sym_Shndx); } + name_local_sections + = (bed->elf_backend_name_local_section_symbols + && bed->elf_backend_name_local_section_symbols (abfd)); + syms = bfd_get_outsymbols (abfd); for (idx = 0; idx < symcount; idx++) { @@ -5273,7 +5386,8 @@ swap_out_syms (abfd, sttp, relocatable_p) flagword flags = syms[idx]->flags; int type; - if ((flags & (BSF_SECTION_SYM | BSF_GLOBAL)) == BSF_SECTION_SYM) + if (!name_local_sections + && (flags & (BSF_SECTION_SYM | BSF_GLOBAL)) == BSF_SECTION_SYM) { /* Local section symbols have no name. */ sym.st_name = 0; @@ -5282,9 +5396,12 @@ swap_out_syms (abfd, sttp, relocatable_p) { sym.st_name = (unsigned long) _bfd_stringtab_add (stt, syms[idx]->name, - true, false); + TRUE, FALSE); if (sym.st_name == (unsigned long) -1) - return false; + { + _bfd_stringtab_free (stt); + return FALSE; + } } type_ptr = elf_symbol_from (abfd, syms[idx]); @@ -5314,6 +5431,7 @@ swap_out_syms (abfd, sttp, relocatable_p) value += sec->output_offset; sec = sec->output_section; } + /* Don't add in the section vma for relocatable output. */ if (! relocatable_p) value += sec->vma; @@ -5365,7 +5483,17 @@ swap_out_syms (abfd, sttp, relocatable_p) section of a symbol to be a section that is actually in the output file. */ sec2 = bfd_get_section_by_name (abfd, sec->name); - BFD_ASSERT (sec2 != 0); + if (sec2 == NULL) + { + _bfd_error_handler (_("\ +Unable to find equivalent output section for symbol '%s' from section '%s'"), + syms[idx]->name ? syms[idx]->name : "", + sec->name); + bfd_set_error (bfd_error_invalid_operation); + _bfd_stringtab_free (stt); + return FALSE; + } + shndx = _bfd_elf_section_from_bfd_section (abfd, sec2); BFD_ASSERT (shndx != -1); } @@ -5386,7 +5514,7 @@ swap_out_syms (abfd, sttp, relocatable_p) if (syms[idx]->section->flags & SEC_THREAD_LOCAL) type = STT_TLS; - /* Processor-specific types */ + /* Processor-specific types. */ if (type_ptr != NULL && bed->elf_backend_get_symbol_type) type = ((*bed->elf_backend_get_symbol_type) @@ -5444,7 +5572,7 @@ swap_out_syms (abfd, sttp, relocatable_p) symstrtab_hdr->sh_info = 0; symstrtab_hdr->sh_addralign = 1; - return true; + return TRUE; } /* Return the number of bytes required to hold the symtab vector. @@ -5454,8 +5582,7 @@ swap_out_syms (abfd, sttp, relocatable_p) always has a dummy entry as symbol #0, so it ends up even. */ long -_bfd_elf_get_symtab_upper_bound (abfd) - bfd *abfd; +_bfd_elf_get_symtab_upper_bound (bfd *abfd) { long symcount; long symtab_size; @@ -5470,8 +5597,7 @@ _bfd_elf_get_symtab_upper_bound (abfd) } long -_bfd_elf_get_dynamic_symtab_upper_bound (abfd) - bfd *abfd; +_bfd_elf_get_dynamic_symtab_upper_bound (bfd *abfd) { long symcount; long symtab_size; @@ -5492,9 +5618,8 @@ _bfd_elf_get_dynamic_symtab_upper_bound (abfd) } long -_bfd_elf_get_reloc_upper_bound (abfd, asect) - bfd *abfd ATTRIBUTE_UNUSED; - sec_ptr asect; +_bfd_elf_get_reloc_upper_bound (bfd *abfd ATTRIBUTE_UNUSED, + sec_ptr asect) { return (asect->reloc_count + 1) * sizeof (arelent *); } @@ -5502,17 +5627,16 @@ _bfd_elf_get_reloc_upper_bound (abfd, asect) /* Canonicalize the relocs. */ long -_bfd_elf_canonicalize_reloc (abfd, section, relptr, symbols) - bfd *abfd; - sec_ptr section; - arelent **relptr; - asymbol **symbols; +_bfd_elf_canonicalize_reloc (bfd *abfd, + sec_ptr section, + arelent **relptr, + asymbol **symbols) { arelent *tblptr; unsigned int i; - struct elf_backend_data *bed = get_elf_backend_data (abfd); + const struct elf_backend_data *bed = get_elf_backend_data (abfd); - if (! bed->s->slurp_reloc_table (abfd, section, symbols, false)) + if (! bed->s->slurp_reloc_table (abfd, section, symbols, FALSE)) return -1; tblptr = section->relocation; @@ -5525,12 +5649,10 @@ _bfd_elf_canonicalize_reloc (abfd, section, relptr, symbols) } long -_bfd_elf_get_symtab (abfd, alocation) - bfd *abfd; - asymbol **alocation; +_bfd_elf_canonicalize_symtab (bfd *abfd, asymbol **allocation) { - struct elf_backend_data *bed = get_elf_backend_data (abfd); - long symcount = bed->s->slurp_symbol_table (abfd, alocation, false); + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + long symcount = bed->s->slurp_symbol_table (abfd, allocation, FALSE); if (symcount >= 0) bfd_get_symcount (abfd) = symcount; @@ -5538,12 +5660,11 @@ _bfd_elf_get_symtab (abfd, alocation) } long -_bfd_elf_canonicalize_dynamic_symtab (abfd, alocation) - bfd *abfd; - asymbol **alocation; +_bfd_elf_canonicalize_dynamic_symtab (bfd *abfd, + asymbol **allocation) { - struct elf_backend_data *bed = get_elf_backend_data (abfd); - long symcount = bed->s->slurp_symbol_table (abfd, alocation, true); + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + long symcount = bed->s->slurp_symbol_table (abfd, allocation, TRUE); if (symcount >= 0) bfd_get_dynamic_symcount (abfd) = symcount; @@ -5556,8 +5677,7 @@ _bfd_elf_canonicalize_dynamic_symtab (abfd, alocation) considered to be a dynamic reloc section. */ long -_bfd_elf_get_dynamic_reloc_upper_bound (abfd) - bfd *abfd; +_bfd_elf_get_dynamic_reloc_upper_bound (bfd *abfd) { long ret; asection *s; @@ -5589,12 +5709,11 @@ _bfd_elf_get_dynamic_reloc_upper_bound (abfd) section. */ long -_bfd_elf_canonicalize_dynamic_reloc (abfd, storage, syms) - bfd *abfd; - arelent **storage; - asymbol **syms; +_bfd_elf_canonicalize_dynamic_reloc (bfd *abfd, + arelent **storage, + asymbol **syms) { - boolean (*slurp_relocs) PARAMS ((bfd *, asection *, asymbol **, boolean)); + bfd_boolean (*slurp_relocs) (bfd *, asection *, asymbol **, bfd_boolean); asection *s; long ret; @@ -5615,7 +5734,7 @@ _bfd_elf_canonicalize_dynamic_reloc (abfd, storage, syms) arelent *p; long count, i; - if (! (*slurp_relocs) (abfd, s, syms, true)) + if (! (*slurp_relocs) (abfd, s, syms, TRUE)) return -1; count = s->_raw_size / elf_section_data (s)->this_hdr.sh_entsize; p = s->relocation; @@ -5632,9 +5751,8 @@ _bfd_elf_canonicalize_dynamic_reloc (abfd, storage, syms) /* Read in the version information. */ -boolean -_bfd_elf_slurp_version_tables (abfd) - bfd *abfd; +bfd_boolean +_bfd_elf_slurp_version_tables (bfd *abfd) { bfd_byte *contents = NULL; bfd_size_type amt; @@ -5651,11 +5769,11 @@ _bfd_elf_slurp_version_tables (abfd) hdr = &elf_tdata (abfd)->dynverdef_hdr; - contents = (bfd_byte *) bfd_malloc (hdr->sh_size); + contents = bfd_malloc (hdr->sh_size); if (contents == NULL) goto error_return; if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) contents, hdr->sh_size, abfd) != hdr->sh_size) + || bfd_bread (contents, hdr->sh_size, abfd) != hdr->sh_size) goto error_return; /* We know the number of entries in the section but not the maximum @@ -5675,7 +5793,7 @@ _bfd_elf_slurp_version_tables (abfd) } amt = (bfd_size_type) maxidx * sizeof (Elf_Internal_Verdef); - elf_tdata (abfd)->verdef = (Elf_Internal_Verdef *) bfd_zalloc (abfd, amt); + elf_tdata (abfd)->verdef = bfd_zalloc (abfd, amt); if (elf_tdata (abfd)->verdef == NULL) goto error_return; @@ -5697,7 +5815,7 @@ _bfd_elf_slurp_version_tables (abfd) iverdef->vd_bfd = abfd; amt = (bfd_size_type) iverdef->vd_cnt * sizeof (Elf_Internal_Verdaux); - iverdef->vd_auxptr = (Elf_Internal_Verdaux *) bfd_alloc (abfd, amt); + iverdef->vd_auxptr = bfd_alloc (abfd, amt); if (iverdef->vd_auxptr == NULL) goto error_return; @@ -5748,18 +5866,17 @@ _bfd_elf_slurp_version_tables (abfd) hdr = &elf_tdata (abfd)->dynverref_hdr; amt = (bfd_size_type) hdr->sh_info * sizeof (Elf_Internal_Verneed); - elf_tdata (abfd)->verref = - (Elf_Internal_Verneed *) bfd_zalloc (abfd, amt); + elf_tdata (abfd)->verref = bfd_zalloc (abfd, amt); if (elf_tdata (abfd)->verref == NULL) goto error_return; elf_tdata (abfd)->cverrefs = hdr->sh_info; - contents = (bfd_byte *) bfd_malloc (hdr->sh_size); + contents = bfd_malloc (hdr->sh_size); if (contents == NULL) goto error_return; if (bfd_seek (abfd, hdr->sh_offset, SEEK_SET) != 0 - || bfd_bread ((PTR) contents, hdr->sh_size, abfd) != hdr->sh_size) + || bfd_bread (contents, hdr->sh_size, abfd) != hdr->sh_size) goto error_return; everneed = (Elf_External_Verneed *) contents; @@ -5782,7 +5899,7 @@ _bfd_elf_slurp_version_tables (abfd) amt = iverneed->vn_cnt; amt *= sizeof (Elf_Internal_Vernaux); - iverneed->vn_auxptr = (Elf_Internal_Vernaux *) bfd_alloc (abfd, amt); + iverneed->vn_auxptr = bfd_alloc (abfd, amt); evernaux = ((Elf_External_Vernaux *) ((bfd_byte *) everneed + iverneed->vn_aux)); @@ -5819,22 +5936,21 @@ _bfd_elf_slurp_version_tables (abfd) contents = NULL; } - return true; + return TRUE; error_return: - if (contents == NULL) + if (contents != NULL) free (contents); - return false; + return FALSE; } asymbol * -_bfd_elf_make_empty_symbol (abfd) - bfd *abfd; +_bfd_elf_make_empty_symbol (bfd *abfd) { elf_symbol_type *newsym; bfd_size_type amt = sizeof (elf_symbol_type); - newsym = (elf_symbol_type *) bfd_zalloc (abfd, amt); + newsym = bfd_zalloc (abfd, amt); if (!newsym) return NULL; else @@ -5845,10 +5961,9 @@ _bfd_elf_make_empty_symbol (abfd) } void -_bfd_elf_get_symbol_info (ignore_abfd, symbol, ret) - bfd *ignore_abfd ATTRIBUTE_UNUSED; - asymbol *symbol; - symbol_info *ret; +_bfd_elf_get_symbol_info (bfd *abfd ATTRIBUTE_UNUSED, + asymbol *symbol, + symbol_info *ret) { bfd_symbol_info (symbol, ret); } @@ -5857,19 +5972,18 @@ _bfd_elf_get_symbol_info (ignore_abfd, symbol, ret) use this function for the is_local_label_name entry point, but some override it. */ -boolean -_bfd_elf_is_local_label_name (abfd, name) - bfd *abfd ATTRIBUTE_UNUSED; - const char *name; +bfd_boolean +_bfd_elf_is_local_label_name (bfd *abfd ATTRIBUTE_UNUSED, + const char *name) { /* Normal local symbols start with ``.L''. */ if (name[0] == '.' && name[1] == 'L') - return true; + return TRUE; /* At least some SVR4 compilers (e.g., UnixWare 2.1 cc) generate DWARF debugging symbols starting with ``..''. */ if (name[0] == '.' && name[1] == '.') - return true; + return TRUE; /* gcc will sometimes generate symbols beginning with ``_.L_'' when emitting DWARF debugging output. I suspect this is actually a @@ -5878,32 +5992,30 @@ _bfd_elf_is_local_label_name (abfd, name) underscore to be emitted on some ELF targets). For ease of use, we treat such symbols as local. */ if (name[0] == '_' && name[1] == '.' && name[2] == 'L' && name[3] == '_') - return true; + return TRUE; - return false; + return FALSE; } alent * -_bfd_elf_get_lineno (ignore_abfd, symbol) - bfd *ignore_abfd ATTRIBUTE_UNUSED; - asymbol *symbol ATTRIBUTE_UNUSED; +_bfd_elf_get_lineno (bfd *abfd ATTRIBUTE_UNUSED, + asymbol *symbol ATTRIBUTE_UNUSED) { abort (); return NULL; } -boolean -_bfd_elf_set_arch_mach (abfd, arch, machine) - bfd *abfd; - enum bfd_architecture arch; - unsigned long machine; +bfd_boolean +_bfd_elf_set_arch_mach (bfd *abfd, + enum bfd_architecture arch, + unsigned long machine) { /* If this isn't the right architecture for this backend, and this isn't the generic backend, fail. */ if (arch != get_elf_backend_data (abfd)->arch && arch != bfd_arch_unknown && get_elf_backend_data (abfd)->arch != bfd_arch_unknown) - return false; + return FALSE; return bfd_default_set_arch_mach (abfd, arch, machine); } @@ -5911,15 +6023,13 @@ _bfd_elf_set_arch_mach (abfd, arch, machine) /* Find the function to a particular section and offset, for error reporting. */ -static boolean -elf_find_function (abfd, section, symbols, offset, - filename_ptr, functionname_ptr) - bfd *abfd ATTRIBUTE_UNUSED; - asection *section; - asymbol **symbols; - bfd_vma offset; - const char **filename_ptr; - const char **functionname_ptr; +static bfd_boolean +elf_find_function (bfd *abfd ATTRIBUTE_UNUSED, + asection *section, + asymbol **symbols, + bfd_vma offset, + const char **filename_ptr, + const char **functionname_ptr) { const char *filename; asymbol *func; @@ -5960,31 +6070,29 @@ elf_find_function (abfd, section, symbols, offset, } if (func == NULL) - return false; + return FALSE; if (filename_ptr) *filename_ptr = filename; if (functionname_ptr) *functionname_ptr = bfd_asymbol_name (func); - return true; + return TRUE; } /* Find the nearest line to a particular section and offset, for error reporting. */ -boolean -_bfd_elf_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; +bfd_boolean +_bfd_elf_find_nearest_line (bfd *abfd, + asection *section, + asymbol **symbols, + bfd_vma offset, + const char **filename_ptr, + const char **functionname_ptr, + unsigned int *line_ptr) { - boolean found; + bfd_boolean found; if (_bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, filename_ptr, functionname_ptr, @@ -5995,7 +6103,7 @@ _bfd_elf_find_nearest_line (abfd, section, symbols, offset, *filename_ptr ? NULL : filename_ptr, functionname_ptr); - return true; + return TRUE; } if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, @@ -6008,32 +6116,30 @@ _bfd_elf_find_nearest_line (abfd, section, symbols, offset, *filename_ptr ? NULL : filename_ptr, functionname_ptr); - return true; + return TRUE; } if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, &found, filename_ptr, functionname_ptr, line_ptr, &elf_tdata (abfd)->line_info)) - return false; + return FALSE; if (found && (*functionname_ptr || *line_ptr)) - return true; + return TRUE; if (symbols == NULL) - return false; + return FALSE; if (! elf_find_function (abfd, section, symbols, offset, filename_ptr, functionname_ptr)) - return false; + return FALSE; *line_ptr = 0; - return true; + return TRUE; } int -_bfd_elf_sizeof_headers (abfd, reloc) - bfd *abfd; - boolean reloc; +_bfd_elf_sizeof_headers (bfd *abfd, bfd_boolean reloc) { int ret; @@ -6043,57 +6149,41 @@ _bfd_elf_sizeof_headers (abfd, reloc) return ret; } -boolean -_bfd_elf_set_section_contents (abfd, section, location, offset, count) - bfd *abfd; - sec_ptr section; - PTR location; - file_ptr offset; - bfd_size_type count; +bfd_boolean +_bfd_elf_set_section_contents (bfd *abfd, + sec_ptr section, + const void *location, + file_ptr offset, + bfd_size_type count) { Elf_Internal_Shdr *hdr; bfd_signed_vma pos; if (! abfd->output_has_begun - && ! (_bfd_elf_compute_section_file_positions - (abfd, (struct bfd_link_info *) NULL))) - return false; + && ! _bfd_elf_compute_section_file_positions (abfd, NULL)) + return FALSE; hdr = &elf_section_data (section)->this_hdr; pos = hdr->sh_offset + offset; if (bfd_seek (abfd, pos, SEEK_SET) != 0 || bfd_bwrite (location, count, abfd) != count) - return false; + return FALSE; - return true; -} - -void -_bfd_elf_no_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr ATTRIBUTE_UNUSED; - Elf_Internal_Rela *dst ATTRIBUTE_UNUSED; -{ - abort (); + return TRUE; } -#if 0 void -_bfd_elf_no_info_to_howto_rel (abfd, cache_ptr, dst) - bfd *abfd; - arelent *cache_ptr; - Elf_Internal_Rel *dst; +_bfd_elf_no_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, + arelent *cache_ptr ATTRIBUTE_UNUSED, + Elf_Internal_Rela *dst ATTRIBUTE_UNUSED) { abort (); } -#endif /* Try to convert a non-ELF reloc into an ELF one. */ -boolean -_bfd_elf_validate_reloc (abfd, areloc) - bfd *abfd; - arelent *areloc; +bfd_boolean +_bfd_elf_validate_reloc (bfd *abfd, arelent *areloc) { /* Check whether we really have an ELF howto. */ @@ -6176,19 +6266,18 @@ _bfd_elf_validate_reloc (abfd, areloc) goto fail; } - return true; + return TRUE; fail: (*_bfd_error_handler) (_("%s: unsupported relocation type %s"), bfd_archive_filename (abfd), areloc->howto->name); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } -boolean -_bfd_elf_close_and_cleanup (abfd) - bfd *abfd; +bfd_boolean +_bfd_elf_close_and_cleanup (bfd *abfd) { if (bfd_get_format (abfd) == bfd_object) { @@ -6205,14 +6294,11 @@ _bfd_elf_close_and_cleanup (abfd) this reloc. */ bfd_reloc_status_type -_bfd_elf_rel_vtable_reloc_fn (abfd, re, symbol, data, is, obfd, errmsg) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *re ATTRIBUTE_UNUSED; - struct symbol_cache_entry *symbol ATTRIBUTE_UNUSED; - PTR data ATTRIBUTE_UNUSED; - asection *is ATTRIBUTE_UNUSED; - bfd *obfd ATTRIBUTE_UNUSED; - char **errmsg ATTRIBUTE_UNUSED; +_bfd_elf_rel_vtable_reloc_fn + (bfd *abfd ATTRIBUTE_UNUSED, arelent *re ATTRIBUTE_UNUSED, + struct bfd_symbol *symbol ATTRIBUTE_UNUSED, + void *data ATTRIBUTE_UNUSED, asection *is ATTRIBUTE_UNUSED, + bfd *obfd ATTRIBUTE_UNUSED, char **errmsg ATTRIBUTE_UNUSED) { return bfd_reloc_ok; } @@ -6229,8 +6315,7 @@ _bfd_elf_rel_vtable_reloc_fn (abfd, re, symbol, data, is, obfd, errmsg) /* FIXME: this is kinda wrong, but it's what gdb wants. */ static int -elfcore_make_pid (abfd) - bfd *abfd; +elfcore_make_pid (bfd *abfd) { return ((elf_tdata (abfd)->core_lwpid << 16) + (elf_tdata (abfd)->core_pid)); @@ -6241,26 +6326,23 @@ elfcore_make_pid (abfd) reference to NAME, so you shouldn't deallocate or overwrite it. */ -static boolean -elfcore_maybe_make_sect (abfd, name, sect) - bfd *abfd; - char *name; - asection *sect; +static bfd_boolean +elfcore_maybe_make_sect (bfd *abfd, char *name, asection *sect) { asection *sect2; if (bfd_get_section_by_name (abfd, name) != NULL) - return true; + return TRUE; sect2 = bfd_make_section (abfd, name); if (sect2 == NULL) - return false; + return FALSE; sect2->_raw_size = sect->_raw_size; sect2->filepos = sect->filepos; sect2->flags = sect->flags; sect2->alignment_power = sect->alignment_power; - return true; + return TRUE; } /* Create a pseudosection containing SIZE bytes at FILEPOS. This @@ -6270,12 +6352,11 @@ elfcore_maybe_make_sect (abfd, name, sect) - For the multi-threaded case, a section named "NAME/PID", where PID is elfcore_make_pid (abfd). Both pseudosections have identical contents. */ -boolean -_bfd_elfcore_make_pseudosection (abfd, name, size, filepos) - bfd *abfd; - char *name; - size_t size; - ufile_ptr filepos; +bfd_boolean +_bfd_elfcore_make_pseudosection (bfd *abfd, + char *name, + size_t size, + ufile_ptr filepos) { char buf[100]; char *threaded_name; @@ -6286,14 +6367,14 @@ _bfd_elfcore_make_pseudosection (abfd, name, size, filepos) sprintf (buf, "%s/%d", name, elfcore_make_pid (abfd)); len = strlen (buf) + 1; - threaded_name = bfd_alloc (abfd, (bfd_size_type) len); + threaded_name = bfd_alloc (abfd, len); if (threaded_name == NULL) - return false; + return FALSE; memcpy (threaded_name, buf, len); - sect = bfd_make_section (abfd, threaded_name); + sect = bfd_make_section_anyway (abfd, threaded_name); if (sect == NULL) - return false; + return FALSE; sect->_raw_size = size; sect->filepos = filepos; sect->flags = SEC_HAS_CONTENTS; @@ -6309,12 +6390,9 @@ _bfd_elfcore_make_pseudosection (abfd, name, size, filepos) */ #if defined (HAVE_PRSTATUS_T) -static boolean elfcore_grok_prstatus PARAMS ((bfd *, Elf_Internal_Note *)); -static boolean -elfcore_grok_prstatus (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +static bfd_boolean +elfcore_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) { size_t raw_size; int offset; @@ -6374,7 +6452,7 @@ elfcore_grok_prstatus (abfd, note) { /* Fail - we don't know how to handle any other note size (ie. data object type). */ - return true; + return TRUE; } /* Make a ".reg/999" section and a ".reg" section. */ @@ -6384,11 +6462,10 @@ elfcore_grok_prstatus (abfd, note) #endif /* defined (HAVE_PRSTATUS_T) */ /* Create a pseudosection containing the exact contents of NOTE. */ -static boolean -elfcore_make_note_pseudosection (abfd, name, note) - bfd *abfd; - char *name; - Elf_Internal_Note *note; +static bfd_boolean +elfcore_make_note_pseudosection (bfd *abfd, + char *name, + Elf_Internal_Note *note) { return _bfd_elfcore_make_pseudosection (abfd, name, note->descsz, note->descpos); @@ -6398,10 +6475,8 @@ elfcore_make_note_pseudosection (abfd, name, note) but it doesn't matter, because we don't have to pick this data structure apart. */ -static boolean -elfcore_grok_prfpreg (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +static bfd_boolean +elfcore_grok_prfpreg (bfd *abfd, Elf_Internal_Note *note) { return elfcore_make_note_pseudosection (abfd, ".reg2", note); } @@ -6410,10 +6485,8 @@ elfcore_grok_prfpreg (abfd, note) type of 5 (NT_PRXFPREG). Just include the whole note's contents literally. */ -static boolean -elfcore_grok_prxfpreg (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +static bfd_boolean +elfcore_grok_prxfpreg (bfd *abfd, Elf_Internal_Note *note) { return elfcore_make_note_pseudosection (abfd, ".reg-xfp", note); } @@ -6437,10 +6510,7 @@ typedef psinfo32_t elfcore_psinfo32_t; the copy will always have a terminating '\0'. */ char * -_bfd_elfcore_strndup (abfd, start, max) - bfd *abfd; - char *start; - size_t max; +_bfd_elfcore_strndup (bfd *abfd, char *start, size_t max) { char *dups; char *end = memchr (start, '\0', max); @@ -6451,7 +6521,7 @@ _bfd_elfcore_strndup (abfd, start, max) else len = end - start; - dups = bfd_alloc (abfd, (bfd_size_type) len + 1); + dups = bfd_alloc (abfd, len + 1); if (dups == NULL) return NULL; @@ -6462,12 +6532,8 @@ _bfd_elfcore_strndup (abfd, start, max) } #if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) -static boolean elfcore_grok_psinfo PARAMS ((bfd *, Elf_Internal_Note *)); - -static boolean -elfcore_grok_psinfo (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +static bfd_boolean +elfcore_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) { if (note->descsz == sizeof (elfcore_psinfo_t)) { @@ -6505,7 +6571,7 @@ elfcore_grok_psinfo (abfd, note) { /* Fail - we don't know how to handle any other note size (ie. data object type). */ - return true; + return TRUE; } /* Note that for some reason, a spurious space is tacked @@ -6520,17 +6586,13 @@ elfcore_grok_psinfo (abfd, note) command[n - 1] = '\0'; } - return true; + return TRUE; } #endif /* defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) */ #if defined (HAVE_PSTATUS_T) -static boolean elfcore_grok_pstatus PARAMS ((bfd *, Elf_Internal_Note *)); - -static boolean -elfcore_grok_pstatus (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +static bfd_boolean +elfcore_grok_pstatus (bfd *abfd, Elf_Internal_Note *note) { if (note->descsz == sizeof (pstatus_t) #if defined (HAVE_PXSTATUS_T) @@ -6559,17 +6621,13 @@ elfcore_grok_pstatus (abfd, note) lwpstatus_t in pstat.pr_lwp, but we'll catch it all in an NT_LWPSTATUS note, presumably. */ - return true; + return TRUE; } #endif /* defined (HAVE_PSTATUS_T) */ #if defined (HAVE_LWPSTATUS_T) -static boolean elfcore_grok_lwpstatus PARAMS ((bfd *, Elf_Internal_Note *)); - -static boolean -elfcore_grok_lwpstatus (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +static bfd_boolean +elfcore_grok_lwpstatus (bfd *abfd, Elf_Internal_Note *note) { lwpstatus_t lwpstat; char buf[100]; @@ -6582,7 +6640,7 @@ elfcore_grok_lwpstatus (abfd, note) && note->descsz != sizeof (lwpxstatus_t) #endif ) - return true; + return TRUE; memcpy (&lwpstat, note->descdata, sizeof (lwpstat)); @@ -6593,14 +6651,14 @@ elfcore_grok_lwpstatus (abfd, note) sprintf (buf, ".reg/%d", elfcore_make_pid (abfd)); len = strlen (buf) + 1; - name = bfd_alloc (abfd, (bfd_size_type) len); + name = bfd_alloc (abfd, len); if (name == NULL) - return false; + return FALSE; memcpy (name, buf, len); - sect = bfd_make_section (abfd, name); + sect = bfd_make_section_anyway (abfd, name); if (sect == NULL) - return false; + return FALSE; #if defined (HAVE_LWPSTATUS_T_PR_CONTEXT) sect->_raw_size = sizeof (lwpstat.pr_context.uc_mcontext.gregs); @@ -6617,20 +6675,20 @@ elfcore_grok_lwpstatus (abfd, note) sect->alignment_power = 2; if (!elfcore_maybe_make_sect (abfd, ".reg", sect)) - return false; + return FALSE; /* Make a ".reg2/999" section */ sprintf (buf, ".reg2/%d", elfcore_make_pid (abfd)); len = strlen (buf) + 1; - name = bfd_alloc (abfd, (bfd_size_type) len); + name = bfd_alloc (abfd, len); if (name == NULL) - return false; + return FALSE; memcpy (name, buf, len); - sect = bfd_make_section (abfd, name); + sect = bfd_make_section_anyway (abfd, name); if (sect == NULL) - return false; + return FALSE; #if defined (HAVE_LWPSTATUS_T_PR_CONTEXT) sect->_raw_size = sizeof (lwpstat.pr_context.uc_mcontext.fpregs); @@ -6651,10 +6709,8 @@ elfcore_grok_lwpstatus (abfd, note) #endif /* defined (HAVE_LWPSTATUS_T) */ #if defined (HAVE_WIN32_PSTATUS_T) -static boolean -elfcore_grok_win32pstatus (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +static bfd_boolean +elfcore_grok_win32pstatus (bfd *abfd, Elf_Internal_Note *note) { char buf[30]; char *name; @@ -6663,7 +6719,7 @@ elfcore_grok_win32pstatus (abfd, note) win32_pstatus_t pstatus; if (note->descsz < sizeof (pstatus)) - return true; + return TRUE; memcpy (&pstatus, note->descdata, sizeof (pstatus)); @@ -6680,15 +6736,15 @@ elfcore_grok_win32pstatus (abfd, note) sprintf (buf, ".reg/%d", pstatus.data.thread_info.tid); len = strlen (buf) + 1; - name = bfd_alloc (abfd, (bfd_size_type) len); + name = bfd_alloc (abfd, len); if (name == NULL) - return false; + return FALSE; memcpy (name, buf, len); - sect = bfd_make_section (abfd, name); + sect = bfd_make_section_anyway (abfd, name); if (sect == NULL) - return false; + return FALSE; sect->_raw_size = sizeof (pstatus.data.thread_info.thread_context); sect->filepos = (note->descpos @@ -6699,7 +6755,7 @@ elfcore_grok_win32pstatus (abfd, note) if (pstatus.data.thread_info.is_active_thread) if (! elfcore_maybe_make_sect (abfd, ".reg", sect)) - return false; + return FALSE; break; case NOTE_INFO_MODULE: @@ -6707,16 +6763,16 @@ elfcore_grok_win32pstatus (abfd, note) sprintf (buf, ".module/%08x", pstatus.data.module_info.base_address); len = strlen (buf) + 1; - name = bfd_alloc (abfd, (bfd_size_type) len); + name = bfd_alloc (abfd, len); if (name == NULL) - return false; + return FALSE; memcpy (name, buf, len); - sect = bfd_make_section (abfd, name); + sect = bfd_make_section_anyway (abfd, name); if (sect == NULL) - return false; + return FALSE; sect->_raw_size = note->descsz; sect->filepos = note->descpos; @@ -6725,33 +6781,31 @@ elfcore_grok_win32pstatus (abfd, note) break; default: - return true; + return TRUE; } - return true; + return TRUE; } #endif /* HAVE_WIN32_PSTATUS_T */ -static boolean -elfcore_grok_note (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +static bfd_boolean +elfcore_grok_note (bfd *abfd, Elf_Internal_Note *note) { - struct elf_backend_data *bed = get_elf_backend_data (abfd); + const struct elf_backend_data *bed = get_elf_backend_data (abfd); switch (note->type) { default: - return true; + return TRUE; case NT_PRSTATUS: if (bed->elf_backend_grok_prstatus) if ((*bed->elf_backend_grok_prstatus) (abfd, note)) - return true; + return TRUE; #if defined (HAVE_PRSTATUS_T) return elfcore_grok_prstatus (abfd, note); #else - return true; + return TRUE; #endif #if defined (HAVE_PSTATUS_T) @@ -6773,29 +6827,41 @@ elfcore_grok_note (abfd, note) #endif case NT_PRXFPREG: /* Linux SSE extension */ - if (note->namesz == 5 - && ! strcmp (note->namedata, "LINUX")) + if (note->namesz == 6 + && strcmp (note->namedata, "LINUX") == 0) return elfcore_grok_prxfpreg (abfd, note); else - return true; + return TRUE; case NT_PRPSINFO: case NT_PSINFO: if (bed->elf_backend_grok_psinfo) if ((*bed->elf_backend_grok_psinfo) (abfd, note)) - return true; + return TRUE; #if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) return elfcore_grok_psinfo (abfd, note); #else - return true; + return TRUE; #endif + + case NT_AUXV: + { + asection *sect = bfd_make_section_anyway (abfd, ".auxv"); + + if (sect == NULL) + return FALSE; + sect->_raw_size = note->descsz; + sect->filepos = note->descpos; + sect->flags = SEC_HAS_CONTENTS; + sect->alignment_power = 1 + bfd_get_arch_size (abfd) / 32; + + return TRUE; + } } } -static boolean -elfcore_netbsd_get_lwpid (note, lwpidp) - Elf_Internal_Note *note; - int *lwpidp; +static bfd_boolean +elfcore_netbsd_get_lwpid (Elf_Internal_Note *note, int *lwpidp) { char *cp; @@ -6803,15 +6869,13 @@ elfcore_netbsd_get_lwpid (note, lwpidp) if (cp != NULL) { *lwpidp = atoi(cp + 1); - return true; + return TRUE; } - return false; + return FALSE; } -static boolean -elfcore_grok_netbsd_procinfo (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +static bfd_boolean +elfcore_grok_netbsd_procinfo (bfd *abfd, Elf_Internal_Note *note) { /* Signal number at offset 0x08. */ @@ -6826,13 +6890,12 @@ elfcore_grok_netbsd_procinfo (abfd, note) elf_tdata (abfd)->core_command = _bfd_elfcore_strndup (abfd, note->descdata + 0x7c, 31); - return true; + return elfcore_make_note_pseudosection (abfd, ".note.netbsdcore.procinfo", + note); } -static boolean -elfcore_grok_netbsd_note (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +static bfd_boolean +elfcore_grok_netbsd_note (bfd *abfd, Elf_Internal_Note *note) { int lwp; @@ -6855,7 +6918,7 @@ elfcore_grok_netbsd_note (abfd, note) understand it. */ if (note->type < NT_NETBSDCORE_FIRSTMACH) - return true; + return TRUE; switch (bfd_get_arch (abfd)) @@ -6874,7 +6937,7 @@ elfcore_grok_netbsd_note (abfd, note) return elfcore_make_note_pseudosection (abfd, ".reg2", note); default: - return true; + return TRUE; } /* On all other arch's, PT_GETREGS == mach+1 and @@ -6890,12 +6953,118 @@ elfcore_grok_netbsd_note (abfd, note) return elfcore_make_note_pseudosection (abfd, ".reg2", note); default: - return true; + return TRUE; } } /* NOTREACHED */ } +static bfd_boolean +elfcore_grok_nto_status (bfd *abfd, Elf_Internal_Note *note, pid_t *tid) +{ + void *ddata = note->descdata; + char buf[100]; + char *name; + asection *sect; + short sig; + unsigned flags; + + /* nto_procfs_status 'pid' field is at offset 0. */ + elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, (bfd_byte *) ddata); + + /* nto_procfs_status 'tid' field is at offset 4. Pass it back. */ + *tid = bfd_get_32 (abfd, (bfd_byte *) ddata + 4); + + /* nto_procfs_status 'flags' field is at offset 8. */ + flags = bfd_get_32 (abfd, (bfd_byte *) ddata + 8); + + /* nto_procfs_status 'what' field is at offset 14. */ + if ((sig = bfd_get_16 (abfd, (bfd_byte *) ddata + 14)) > 0) + { + elf_tdata (abfd)->core_signal = sig; + elf_tdata (abfd)->core_lwpid = *tid; + } + + /* _DEBUG_FLAG_CURTID (current thread) is 0x80. Some cores + do not come from signals so we make sure we set the current + thread just in case. */ + if (flags & 0x00000080) + elf_tdata (abfd)->core_lwpid = *tid; + + /* Make a ".qnx_core_status/%d" section. */ + sprintf (buf, ".qnx_core_status/%d", *tid); + + name = bfd_alloc (abfd, strlen (buf) + 1); + if (name == NULL) + return FALSE; + strcpy (name, buf); + + sect = bfd_make_section_anyway (abfd, name); + if (sect == NULL) + return FALSE; + + sect->_raw_size = note->descsz; + sect->filepos = note->descpos; + sect->flags = SEC_HAS_CONTENTS; + sect->alignment_power = 2; + + return (elfcore_maybe_make_sect (abfd, ".qnx_core_status", sect)); +} + +static bfd_boolean +elfcore_grok_nto_gregs (bfd *abfd, Elf_Internal_Note *note, pid_t tid) +{ + char buf[100]; + char *name; + asection *sect; + + /* Make a ".reg/%d" section. */ + sprintf (buf, ".reg/%d", tid); + + name = bfd_alloc (abfd, strlen (buf) + 1); + if (name == NULL) + return FALSE; + strcpy (name, buf); + + sect = bfd_make_section_anyway (abfd, name); + if (sect == NULL) + return FALSE; + + sect->_raw_size = note->descsz; + sect->filepos = note->descpos; + sect->flags = SEC_HAS_CONTENTS; + sect->alignment_power = 2; + + /* This is the current thread. */ + if (elf_tdata (abfd)->core_lwpid == tid) + return elfcore_maybe_make_sect (abfd, ".reg", sect); + + return TRUE; +} + +#define BFD_QNT_CORE_INFO 7 +#define BFD_QNT_CORE_STATUS 8 +#define BFD_QNT_CORE_GREG 9 +#define BFD_QNT_CORE_FPREG 10 + +static bfd_boolean +elfcore_grok_nto_note (bfd *abfd, Elf_Internal_Note *note) +{ + /* Every GREG section has a STATUS section before it. Store the + tid from the previous call to pass down to the next gregs + function. */ + static pid_t tid = 1; + + switch (note->type) + { + case BFD_QNT_CORE_INFO: return elfcore_make_note_pseudosection (abfd, ".qnx_core_info", note); + case BFD_QNT_CORE_STATUS: return elfcore_grok_nto_status (abfd, note, &tid); + case BFD_QNT_CORE_GREG: return elfcore_grok_nto_gregs (abfd, note, tid); + case BFD_QNT_CORE_FPREG: return elfcore_grok_prfpreg (abfd, note); + default: return TRUE; + } +} + /* Function: elfcore_write_note Inputs: @@ -6909,14 +7078,13 @@ elfcore_grok_netbsd_note (abfd, note) End of buffer containing note. */ char * -elfcore_write_note (abfd, buf, bufsiz, name, type, input, size) - bfd *abfd; - char *buf; - int *bufsiz; - const char *name; - int type; - const PTR input; - int size; +elfcore_write_note (bfd *abfd, + char *buf, + int *bufsiz, + const char *name, + int type, + const void *input, + int size) { Elf_External_Note *xnp; size_t namesz; @@ -6928,14 +7096,14 @@ elfcore_write_note (abfd, buf, bufsiz, name, type, input, size) pad = 0; if (name != NULL) { - struct elf_backend_data *bed; + const struct elf_backend_data *bed; namesz = strlen (name) + 1; bed = get_elf_backend_data (abfd); - pad = -namesz & (bed->s->file_align - 1); + pad = -namesz & ((1 << bed->s->log_file_align) - 1); } - newspace = sizeof (Elf_External_Note) - 1 + namesz + pad + size; + newspace = 12 + namesz + pad + size; p = realloc (buf, *bufsiz + newspace); dest = p + *bufsiz; @@ -6961,12 +7129,11 @@ elfcore_write_note (abfd, buf, bufsiz, name, type, input, size) #if defined (HAVE_PRPSINFO_T) || defined (HAVE_PSINFO_T) char * -elfcore_write_prpsinfo (abfd, buf, bufsiz, fname, psargs) - bfd *abfd; - char *buf; - int *bufsiz; - const char *fname; - const char *psargs; +elfcore_write_prpsinfo (bfd *abfd, + char *buf, + int *bufsiz, + const char *fname, + const char *psargs) { int note_type; char *note_name = "CORE"; @@ -6989,13 +7156,12 @@ elfcore_write_prpsinfo (abfd, buf, bufsiz, fname, psargs) #if defined (HAVE_PRSTATUS_T) char * -elfcore_write_prstatus (abfd, buf, bufsiz, pid, cursig, gregs) - bfd *abfd; - char *buf; - int *bufsiz; - long pid; - int cursig; - const PTR gregs; +elfcore_write_prstatus (bfd *abfd, + char *buf, + int *bufsiz, + long pid, + int cursig, + const void *gregs) { prstatus_t prstat; char *note_name = "CORE"; @@ -7011,13 +7177,12 @@ elfcore_write_prstatus (abfd, buf, bufsiz, pid, cursig, gregs) #if defined (HAVE_LWPSTATUS_T) char * -elfcore_write_lwpstatus (abfd, buf, bufsiz, pid, cursig, gregs) - bfd *abfd; - char *buf; - int *bufsiz; - long pid; - int cursig; - const PTR gregs; +elfcore_write_lwpstatus (bfd *abfd, + char *buf, + int *bufsiz, + long pid, + int cursig, + const void *gregs) { lwpstatus_t lwpstat; char *note_name = "CORE"; @@ -7043,13 +7208,12 @@ elfcore_write_lwpstatus (abfd, buf, bufsiz, pid, cursig, gregs) #if defined (HAVE_PSTATUS_T) char * -elfcore_write_pstatus (abfd, buf, bufsiz, pid, cursig, gregs) - bfd *abfd; - char *buf; - int *bufsiz; - long pid; - int cursig; - const PTR gregs; +elfcore_write_pstatus (bfd *abfd, + char *buf, + int *bufsiz, + long pid, + int cursig, + const void *gregs) { pstatus_t pstat; char *note_name = "CORE"; @@ -7063,12 +7227,11 @@ elfcore_write_pstatus (abfd, buf, bufsiz, pid, cursig, gregs) #endif /* HAVE_PSTATUS_T */ char * -elfcore_write_prfpreg (abfd, buf, bufsiz, fpregs, size) - bfd *abfd; - char *buf; - int *bufsiz; - const PTR fpregs; - int size; +elfcore_write_prfpreg (bfd *abfd, + char *buf, + int *bufsiz, + const void *fpregs, + int size) { char *note_name = "CORE"; return elfcore_write_note (abfd, buf, bufsiz, @@ -7076,42 +7239,38 @@ elfcore_write_prfpreg (abfd, buf, bufsiz, fpregs, size) } char * -elfcore_write_prxfpreg (abfd, buf, bufsiz, xfpregs, size) - bfd *abfd; - char *buf; - int *bufsiz; - const PTR xfpregs; - int size; +elfcore_write_prxfpreg (bfd *abfd, + char *buf, + int *bufsiz, + const void *xfpregs, + int size) { char *note_name = "LINUX"; return elfcore_write_note (abfd, buf, bufsiz, note_name, NT_PRXFPREG, xfpregs, size); } -static boolean -elfcore_read_notes (abfd, offset, size) - bfd *abfd; - file_ptr offset; - bfd_size_type size; +static bfd_boolean +elfcore_read_notes (bfd *abfd, file_ptr offset, bfd_size_type size) { char *buf; char *p; if (size <= 0) - return true; + return TRUE; if (bfd_seek (abfd, offset, SEEK_SET) != 0) - return false; + return FALSE; buf = bfd_malloc (size); if (buf == NULL) - return false; + return FALSE; if (bfd_bread (buf, size, abfd) != size) { error: free (buf); - return false; + return FALSE; } p = buf; @@ -7135,6 +7294,11 @@ elfcore_read_notes (abfd, offset, size) if (! elfcore_grok_netbsd_note (abfd, &in)) goto error; } + else if (strncmp (in.namedata, "QNX", 3) == 0) + { + if (! elfcore_grok_nto_note (abfd, &in)) + goto error; + } else { if (! elfcore_grok_note (abfd, &in)) @@ -7145,7 +7309,7 @@ elfcore_read_notes (abfd, offset, size) } free (buf); - return true; + return TRUE; } /* Providing external access to the ELF program header table. */ @@ -7155,8 +7319,7 @@ elfcore_read_notes (abfd, offset, size) occurs; bfd_get_error will return an appropriate code. */ long -bfd_get_elf_phdr_upper_bound (abfd) - bfd *abfd; +bfd_get_elf_phdr_upper_bound (bfd *abfd) { if (abfd->xvec->flavour != bfd_target_elf_flavour) { @@ -7176,9 +7339,7 @@ bfd_get_elf_phdr_upper_bound (abfd) error occurs; bfd_get_error will return an appropriate code. */ int -bfd_get_elf_phdrs (abfd, phdrs) - bfd *abfd; - void *phdrs; +bfd_get_elf_phdrs (bfd *abfd, void *phdrs) { int num_phdrs; @@ -7196,10 +7357,7 @@ bfd_get_elf_phdrs (abfd, phdrs) } void -_bfd_elf_sprintf_vma (abfd, buf, value) - bfd *abfd ATTRIBUTE_UNUSED; - char *buf; - bfd_vma value; +_bfd_elf_sprintf_vma (bfd *abfd ATTRIBUTE_UNUSED, char *buf, bfd_vma value) { #ifdef BFD64 Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */ @@ -7227,10 +7385,7 @@ _bfd_elf_sprintf_vma (abfd, buf, value) } void -_bfd_elf_fprintf_vma (abfd, stream, value) - bfd *abfd ATTRIBUTE_UNUSED; - PTR stream; - bfd_vma value; +_bfd_elf_fprintf_vma (bfd *abfd ATTRIBUTE_UNUSED, void *stream, bfd_vma value) { #ifdef BFD64 Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */ @@ -7259,8 +7414,7 @@ _bfd_elf_fprintf_vma (abfd, stream, value) } enum elf_reloc_type_class -_bfd_elf_reloc_type_class (rela) - const Elf_Internal_Rela *rela ATTRIBUTE_UNUSED; +_bfd_elf_reloc_type_class (const Elf_Internal_Rela *rela ATTRIBUTE_UNUSED) { return reloc_class_normal; } @@ -7269,12 +7423,12 @@ _bfd_elf_reloc_type_class (rela) relocation against a local symbol. */ bfd_vma -_bfd_elf_rela_local_sym (abfd, sym, sec, rel) - bfd *abfd; - Elf_Internal_Sym *sym; - asection *sec; - Elf_Internal_Rela *rel; +_bfd_elf_rela_local_sym (bfd *abfd, + Elf_Internal_Sym *sym, + asection **psec, + Elf_Internal_Rela *rel) { + asection *sec = *psec; bfd_vma relocation; relocation = (sec->output_section->vma @@ -7282,58 +7436,78 @@ _bfd_elf_rela_local_sym (abfd, sym, sec, rel) + sym->st_value); if ((sec->flags & SEC_MERGE) && ELF_ST_TYPE (sym->st_info) == STT_SECTION - && elf_section_data (sec)->sec_info_type == ELF_INFO_TYPE_MERGE) + && sec->sec_info_type == ELF_INFO_TYPE_MERGE) { - asection *msec; - - msec = sec; rel->r_addend = - _bfd_merged_section_offset (abfd, &msec, + _bfd_merged_section_offset (abfd, psec, elf_section_data (sec)->sec_info, sym->st_value + rel->r_addend, - (bfd_vma) 0) - - relocation; - rel->r_addend += msec->output_section->vma + msec->output_offset; + 0); + sec = *psec; + rel->r_addend -= relocation; + rel->r_addend += sec->output_section->vma + sec->output_offset; } return relocation; } bfd_vma -_bfd_elf_rel_local_sym (abfd, sym, psec, addend) - bfd *abfd; - Elf_Internal_Sym *sym; - asection **psec; - bfd_vma addend; +_bfd_elf_rel_local_sym (bfd *abfd, + Elf_Internal_Sym *sym, + asection **psec, + bfd_vma addend) { asection *sec = *psec; - if (elf_section_data (sec)->sec_info_type != ELF_INFO_TYPE_MERGE) + if (sec->sec_info_type != ELF_INFO_TYPE_MERGE) return sym->st_value + addend; return _bfd_merged_section_offset (abfd, psec, elf_section_data (sec)->sec_info, - sym->st_value + addend, (bfd_vma) 0); + sym->st_value + addend, 0); } bfd_vma -_bfd_elf_section_offset (abfd, info, sec, offset) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - bfd_vma offset; +_bfd_elf_section_offset (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + bfd_vma offset) { struct bfd_elf_section_data *sec_data; sec_data = elf_section_data (sec); - switch (sec_data->sec_info_type) + switch (sec->sec_info_type) { case ELF_INFO_TYPE_STABS: - return _bfd_stab_section_offset - (abfd, &elf_hash_table (info)->merge_info, sec, &sec_data->sec_info, - offset); + return _bfd_stab_section_offset (abfd, + &elf_hash_table (info)->merge_info, + sec, &sec_data->sec_info, offset); case ELF_INFO_TYPE_EH_FRAME: return _bfd_elf_eh_frame_section_offset (abfd, sec, offset); default: return offset; } } + +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote memory + based on the ELF file header at EHDR_VMA and the ELF program headers it + points to. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs the + file headers (and hence BFD's idea of each section's VMA) put them at. + + The function TARGET_READ_MEMORY is called to copy LEN bytes from the + remote memory at target address VMA into the local buffer at MYADDR; it + should return zero on success or an `errno' code on failure. TEMPL must + be a BFD for an ELF target with the word size and byte order found in + the remote memory. */ + +bfd * +bfd_elf_bfd_from_remote_memory + (bfd *templ, + bfd_vma ehdr_vma, + bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma, char *, int)) +{ + return (*get_elf_backend_data (templ)->elf_backend_bfd_from_remote_memory) + (templ, ehdr_vma, loadbasep, target_read_memory); +} diff --git a/contrib/binutils/bfd/elf32-arc.c b/contrib/binutils/bfd/elf32-arc.c index ff5c5f4..27c1639 100644 --- a/contrib/binutils/bfd/elf32-arc.c +++ b/contrib/binutils/bfd/elf32-arc.c @@ -1,5 +1,6 @@ /* ARC-specific support for 32-bit ELF - Copyright 1994, 1995, 1997, 1999, 2001 Free Software Foundation, Inc. + Copyright 1994, 1995, 1997, 1999, 2001, 2002 + Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -28,18 +29,18 @@ static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); static void arc_info_to_howto_rel - PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); -static boolean arc_elf_object_p + PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); +static bfd_boolean arc_elf_object_p PARAMS ((bfd *)); static void arc_elf_final_write_processing - PARAMS ((bfd *, boolean)); + PARAMS ((bfd *, bfd_boolean)); static bfd_reloc_status_type arc_elf_b22_pcrel PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); /* Try to minimize the amount of space occupied by relocation tables on the ROM (not that the ROM won't be swamped by other ELF overhead). */ -#define USE_REL +#define USE_REL 1 static reloc_howto_type elf_arc_howto_table[] = { @@ -48,60 +49,60 @@ static reloc_howto_type elf_arc_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARC_NONE", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + 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 */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARC_32", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + 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 */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARC_B26", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0x00ffffff, /* src_mask */ 0x00ffffff, /* dst_mask */ - false), /* pcrel_offset */ + 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 */ + TRUE, /* pc_relative */ 7, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ arc_elf_b22_pcrel, /* special_function */ "R_ARC_B22_PCREL", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0x07ffff80, /* src_mask */ 0x07ffff80, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ }; /* Map BFD reloc types to ARC ELF reloc types. */ @@ -141,7 +142,7 @@ static void arc_info_to_howto_rel (abfd, cache_ptr, dst) bfd *abfd ATTRIBUTE_UNUSED; arelent *cache_ptr; - Elf32_Internal_Rel *dst; + Elf_Internal_Rela *dst; { unsigned int r_type; @@ -152,7 +153,7 @@ arc_info_to_howto_rel (abfd, cache_ptr, dst) /* Set the right machine number for an ARC ELF file. */ -static boolean +static bfd_boolean arc_elf_object_p (abfd) bfd *abfd; { @@ -188,7 +189,7 @@ arc_elf_object_p (abfd) static void arc_elf_final_write_processing (abfd, linker) bfd *abfd; - boolean linker ATTRIBUTE_UNUSED; + bfd_boolean linker ATTRIBUTE_UNUSED; { unsigned long val; @@ -225,7 +226,7 @@ arc_elf_b22_pcrel (abfd, reloc_entry, symbol, data, input_section, { /* If linking, back up the final symbol address by the address of the reloc. This cannot be accomplished by setting the pcrel_offset - field to true, as bfd_install_relocation will detect this and refuse + field to TRUE, as bfd_install_relocation will detect this and refuse to install the offset in the first place, but bfd_perform_relocation will still insist on removing it. */ if (output_bfd == (bfd *) NULL) diff --git a/contrib/binutils/bfd/elf32-arm.h b/contrib/binutils/bfd/elf32-arm.h index bb193ab..8c1acc0 100644 --- a/contrib/binutils/bfd/elf32-arm.h +++ b/contrib/binutils/bfd/elf32-arm.h @@ -1,5 +1,6 @@ /* 32-bit ELF support for ARM - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,16 +18,20 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef USE_REL +#define USE_REL 0 +#endif + typedef unsigned long int insn32; typedef unsigned short int insn16; -static boolean elf32_arm_set_private_flags +static bfd_boolean elf32_arm_set_private_flags PARAMS ((bfd *, flagword)); -static boolean elf32_arm_copy_private_bfd_data +static bfd_boolean elf32_arm_copy_private_bfd_data PARAMS ((bfd *, bfd *)); -static boolean elf32_arm_merge_private_bfd_data +static bfd_boolean elf32_arm_merge_private_bfd_data PARAMS ((bfd *, bfd *)); -static boolean elf32_arm_print_private_bfd_data +static bfd_boolean elf32_arm_print_private_bfd_data PARAMS ((bfd *, PTR)); static int elf32_arm_get_symbol_type PARAMS (( Elf_Internal_Sym *, int)); @@ -42,10 +47,6 @@ static struct elf_link_hash_entry *find_thumb_glue PARAMS ((struct bfd_link_info *, const char *, bfd *)); static struct elf_link_hash_entry *find_arm_glue PARAMS ((struct bfd_link_info *, const char *, bfd *)); -static void record_arm_to_thumb_glue - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); -static void record_thumb_to_arm_glue - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static void elf32_arm_post_process_headers PARAMS ((bfd *, struct bfd_link_info *)); static int elf32_arm_to_thumb_stub @@ -54,45 +55,60 @@ static int elf32_arm_to_thumb_stub static int elf32_thumb_to_arm_stub PARAMS ((struct bfd_link_info *, const char *, bfd *, bfd *, asection *, bfd_byte *, asection *, bfd_vma, bfd_signed_vma, bfd_vma)); -static boolean elf32_arm_relocate_section +static bfd_boolean elf32_arm_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); static asection * elf32_arm_gc_mark_hook PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static boolean elf32_arm_gc_sweep_hook +static bfd_boolean elf32_arm_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); -static boolean elf32_arm_check_relocs +static bfd_boolean elf32_arm_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); -static boolean elf32_arm_find_nearest_line +static bfd_boolean elf32_arm_find_nearest_line PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *)); -static boolean elf32_arm_adjust_dynamic_symbol +static bfd_boolean elf32_arm_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); -static boolean elf32_arm_size_dynamic_sections +static bfd_boolean elf32_arm_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static boolean elf32_arm_finish_dynamic_symbol +static bfd_boolean elf32_arm_finish_dynamic_symbol PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static boolean elf32_arm_finish_dynamic_sections +static bfd_boolean elf32_arm_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static struct bfd_hash_entry * elf32_arm_link_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -#ifdef USE_REL +#if USE_REL static void arm_add_to_rel PARAMS ((bfd *, bfd_byte *, reloc_howto_type *, bfd_signed_vma)); #endif +static bfd_boolean allocate_dynrelocs + PARAMS ((struct elf_link_hash_entry *h, PTR inf)); +static bfd_boolean create_got_section + PARAMS ((bfd * dynobj, struct bfd_link_info * info)); +static bfd_boolean elf32_arm_create_dynamic_sections + PARAMS ((bfd * dynobj, struct bfd_link_info * info)); +static enum elf_reloc_type_class elf32_arm_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); +static bfd_boolean elf32_arm_object_p + PARAMS ((bfd *)); -boolean bfd_elf32_arm_allocate_interworking_sections +#ifndef ELFARM_NABI_C_INCLUDED +static void record_arm_to_thumb_glue + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +static void record_thumb_to_arm_glue + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +bfd_boolean bfd_elf32_arm_allocate_interworking_sections PARAMS ((struct bfd_link_info *)); -boolean bfd_elf32_arm_get_bfd_for_interworking +bfd_boolean bfd_elf32_arm_get_bfd_for_interworking PARAMS ((bfd *, struct bfd_link_info *)); -boolean bfd_elf32_arm_process_before_allocation +bfd_boolean bfd_elf32_arm_process_before_allocation PARAMS ((bfd *, struct bfd_link_info *, int)); -static enum elf_reloc_type_class elf32_arm_reloc_type_class - PARAMS ((const Elf_Internal_Rela *)); +#endif + #define INTERWORK_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_ARM_INTERWORK) @@ -110,6 +126,12 @@ static enum elf_reloc_type_class elf32_arm_reloc_type_class section. */ #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" +#ifdef FOUR_WORD_PLT + +/* The size in bytes of the special first entry in the procedure + linkage table. */ +#define PLT_HEADER_SIZE 16 + /* The size in bytes of an entry in the procedure linkage table. */ #define PLT_ENTRY_SIZE 16 @@ -117,23 +139,56 @@ static enum elf_reloc_type_class elf32_arm_reloc_type_class this. It is set up so that any shared library function that is called before the relocation has been set up calls the dynamic linker first. */ -static const bfd_vma elf32_arm_plt0_entry [PLT_ENTRY_SIZE / 4] = +static const bfd_vma elf32_arm_plt0_entry [PLT_HEADER_SIZE / 4] = + { + 0xe52de004, /* str lr, [sp, #-4]! */ + 0xe59fe010, /* ldr lr, [pc, #16] */ + 0xe08fe00e, /* add lr, pc, lr */ + 0xe5bef008, /* ldr pc, [lr, #8]! */ + }; + +/* Subsequent entries in a procedure linkage table look like + this. */ +static const bfd_vma elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] = + { + 0xe28fc600, /* add ip, pc, #NN */ + 0xe28cca00, /* add ip, ip, #NN */ + 0xe5bcf000, /* ldr pc, [ip, #NN]! */ + 0x00000000, /* unused */ + }; + +#else + +/* The size in bytes of the special first entry in the procedure + linkage table. */ +#define PLT_HEADER_SIZE 20 + +/* The size in bytes of an entry in the procedure linkage table. */ +#define PLT_ENTRY_SIZE 12 + +/* 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. */ +static const bfd_vma elf32_arm_plt0_entry [PLT_HEADER_SIZE / 4] = { - 0xe52de004, /* str lr, [sp, #-4]! */ - 0xe59fe010, /* ldr lr, [pc, #16] */ - 0xe08fe00e, /* add lr, pc, lr */ - 0xe5bef008 /* ldr pc, [lr, #8]! */ + 0xe52de004, /* str lr, [sp, #-4]! */ + 0xe59fe004, /* ldr lr, [pc, #4] */ + 0xe08fe00e, /* add lr, pc, lr */ + 0xe5bef008, /* ldr pc, [lr, #8]! */ + 0x00000000, /* &GOT[0] - . */ }; /* Subsequent entries in a procedure linkage table look like this. */ static const bfd_vma elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] = - { - 0xe59fc004, /* ldr ip, [pc, #4] */ - 0xe08fc00c, /* add ip, pc, ip */ - 0xe59cf000, /* ldr pc, [ip] */ - 0x00000000 /* offset to symbol in got */ - }; + { + 0xe28fc600, /* add ip, pc, #0xNN00000 */ + 0xe28cca00, /* add ip, ip, #0xNN000 */ + 0xe5bcf000, /* ldr pc, [ip, #0xNNN]! */ + }; + +#endif /* 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 @@ -143,10 +198,10 @@ static const bfd_vma elf32_arm_plt_entry [PLT_ENTRY_SIZE / 4] = /* This structure keeps track of the number of PC relative relocs we have copied for a given symbol. */ -struct elf32_arm_pcrel_relocs_copied +struct elf32_arm_relocs_copied { /* Next section. */ - struct elf32_arm_pcrel_relocs_copied * next; + struct elf32_arm_relocs_copied * next; /* A section in dynobj. */ asection * section; /* Number of relocs copied in this section. */ @@ -159,18 +214,14 @@ struct elf32_arm_link_hash_entry struct elf_link_hash_entry root; /* Number of PC relative relocs copied for this symbol. */ - struct elf32_arm_pcrel_relocs_copied * pcrel_relocs_copied; + struct elf32_arm_relocs_copied * relocs_copied; }; -/* 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, \ - (boolean (*) PARAMS ((struct elf_link_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) PARAMS ((struct elf_link_hash_entry *, PTR))) (func), \ (info))) /* Get the ARM elf linker hash table from a link_info structure. */ @@ -183,18 +234,30 @@ struct elf32_arm_link_hash_table /* The main hash table. */ struct elf_link_hash_table root; - /* The size in bytes of the section containg the Thumb-to-ARM glue. */ + /* The size in bytes of the section containing the Thumb-to-ARM glue. */ bfd_size_type thumb_glue_size; - /* The size in bytes of the section containg the ARM-to-Thumb glue. */ + /* The size in bytes of the section containing the ARM-to-Thumb glue. */ bfd_size_type arm_glue_size; - /* An arbitary input BFD chosen to hold the glue sections. */ + /* An arbitrary 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; + + /* Short-cuts to get to dynamic linker sections. */ + asection *sgot; + asection *sgotplt; + asection *srelgot; + asection *splt; + asection *srelplt; + asection *sdynbss; + asection *srelbss; + + /* Small local sym to section mapping cache. */ + struct sym_sec_cache sym_sec; }; /* Create an entry in an ARM ELF linker hash table. */ @@ -222,11 +285,120 @@ elf32_arm_link_hash_newfunc (entry, table, string) _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); if (ret != (struct elf32_arm_link_hash_entry *) NULL) - ret->pcrel_relocs_copied = NULL; + ret->relocs_copied = NULL; return (struct bfd_hash_entry *) ret; } +/* Create .got, .gotplt, and .rel.got sections in DYNOBJ, and set up + shortcuts to them in our hash table. */ + +static bfd_boolean +create_got_section (dynobj, info) + bfd *dynobj; + struct bfd_link_info *info; +{ + struct elf32_arm_link_hash_table *htab; + + if (! _bfd_elf_create_got_section (dynobj, info)) + return FALSE; + + htab = elf32_arm_hash_table (info); + htab->sgot = bfd_get_section_by_name (dynobj, ".got"); + htab->sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); + if (!htab->sgot || !htab->sgotplt) + abort (); + + htab->srelgot = bfd_make_section (dynobj, ".rel.got"); + if (htab->srelgot == NULL + || ! bfd_set_section_flags (dynobj, htab->srelgot, + (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED + | SEC_READONLY)) + || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2)) + return FALSE; + return TRUE; +} + +/* Create .plt, .rel.plt, .got, .got.plt, .rel.got, .dynbss, and + .rel.bss sections in DYNOBJ, and set up shortcuts to them in our + hash table. */ + +static bfd_boolean +elf32_arm_create_dynamic_sections (dynobj, info) + bfd *dynobj; + struct bfd_link_info *info; +{ + struct elf32_arm_link_hash_table *htab; + + htab = elf32_arm_hash_table (info); + if (!htab->sgot && !create_got_section (dynobj, info)) + return FALSE; + + if (!_bfd_elf_create_dynamic_sections (dynobj, info)) + return FALSE; + + htab->splt = bfd_get_section_by_name (dynobj, ".plt"); + htab->srelplt = bfd_get_section_by_name (dynobj, ".rel.plt"); + htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss"); + if (!info->shared) + htab->srelbss = bfd_get_section_by_name (dynobj, ".rel.bss"); + + if (!htab->splt || !htab->srelplt || !htab->sdynbss + || (!info->shared && !htab->srelbss)) + abort (); + + return TRUE; +} + +/* Copy the extra info we tack onto an elf_link_hash_entry. */ + +static void +elf32_arm_copy_indirect_symbol (const struct elf_backend_data *bed, + struct elf_link_hash_entry *dir, + struct elf_link_hash_entry *ind) +{ + struct elf32_arm_link_hash_entry *edir, *eind; + + edir = (struct elf32_arm_link_hash_entry *) dir; + eind = (struct elf32_arm_link_hash_entry *) ind; + + if (eind->relocs_copied != NULL) + { + if (edir->relocs_copied != NULL) + { + struct elf32_arm_relocs_copied **pp; + struct elf32_arm_relocs_copied *p; + + if (ind->root.type == bfd_link_hash_indirect) + abort (); + + /* Add reloc counts against the weak sym to the strong sym + list. Merge any entries against the same section. */ + for (pp = &eind->relocs_copied; (p = *pp) != NULL; ) + { + struct elf32_arm_relocs_copied *q; + + for (q = edir->relocs_copied; q != NULL; q = q->next) + if (q->section == p->section) + { + q->count += p->count; + *pp = p->next; + break; + } + if (q == NULL) + pp = &p->next; + } + *pp = edir->relocs_copied; + } + + edir->relocs_copied = eind->relocs_copied; + eind->relocs_copied = NULL; + } + + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); +} + /* Create an ARM elf linker hash table. */ static struct bfd_link_hash_table * @@ -247,10 +419,18 @@ elf32_arm_link_hash_table_create (abfd) return NULL; } + ret->sgot = NULL; + ret->sgotplt = NULL; + ret->srelgot = NULL; + ret->splt = NULL; + ret->srelplt = NULL; + ret->sdynbss = NULL; + ret->srelbss = NULL; ret->thumb_glue_size = 0; ret->arm_glue_size = 0; ret->bfd_of_glue_owner = NULL; ret->no_pipeline_knowledge = 0; + ret->sym_sec.abfd = NULL; return &ret->root.root; } @@ -278,7 +458,7 @@ find_thumb_glue (link_info, name, input_bfd) sprintf (tmp_name, THUMB2ARM_GLUE_ENTRY_NAME, name); hash = elf_link_hash_lookup - (&(hash_table)->root, tmp_name, false, false, true); + (&(hash_table)->root, tmp_name, FALSE, FALSE, TRUE); if (hash == NULL) /* xgettext:c-format */ @@ -313,7 +493,7 @@ find_arm_glue (link_info, name, input_bfd) sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name); myh = elf_link_hash_lookup - (&(hash_table)->root, tmp_name, false, false, true); + (&(hash_table)->root, tmp_name, FALSE, FALSE, TRUE); if (myh == NULL) /* xgettext:c-format */ @@ -360,14 +540,8 @@ static const insn16 t2a1_bx_pc_insn = 0x4778; static const insn16 t2a2_noop_insn = 0x46c0; static const insn32 t2a3_b_insn = 0xea000000; -static const insn16 t2a1_push_insn = 0xb540; -static const insn16 t2a2_ldr_insn = 0x4e03; -static const insn16 t2a3_mov_insn = 0x46fe; -static const insn16 t2a4_bx_insn = 0x4730; -static const insn32 t2a5_pop_insn = 0xe8bd4040; -static const insn32 t2a6_bx_insn = 0xe12fff1e; - -boolean +#ifndef ELFARM_NABI_C_INCLUDED +bfd_boolean bfd_elf32_arm_allocate_interworking_sections (info) struct bfd_link_info * info; { @@ -411,7 +585,7 @@ bfd_elf32_arm_allocate_interworking_sections (info) s->contents = foo; } - return true; + return TRUE; } static void @@ -445,7 +619,7 @@ record_arm_to_thumb_glue (link_info, h) sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name); myh = elf_link_hash_lookup - (&(globals)->root, tmp_name, false, false, true); + (&(globals)->root, tmp_name, FALSE, FALSE, TRUE); if (myh != NULL) { @@ -461,7 +635,7 @@ record_arm_to_thumb_glue (link_info, h) val = globals->arm_glue_size + 1; _bfd_generic_link_add_one_symbol (link_info, globals->bfd_of_glue_owner, tmp_name, BSF_GLOBAL, s, val, - NULL, true, false, &bh); + NULL, TRUE, FALSE, &bh); free (tmp_name); @@ -502,7 +676,7 @@ record_thumb_to_arm_glue (link_info, h) sprintf (tmp_name, THUMB2ARM_GLUE_ENTRY_NAME, name); myh = elf_link_hash_lookup - (&(hash_table)->root, tmp_name, false, false, true); + (&(hash_table)->root, tmp_name, FALSE, FALSE, TRUE); if (myh != NULL) { @@ -515,7 +689,7 @@ record_thumb_to_arm_glue (link_info, h) val = hash_table->thumb_glue_size + 1; _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner, tmp_name, BSF_GLOBAL, s, val, - NULL, true, false, &bh); + NULL, TRUE, FALSE, &bh); /* If we mark it 'Thumb', the disassembler will do a better job. */ myh = (struct elf_link_hash_entry *) bh; @@ -539,7 +713,7 @@ record_thumb_to_arm_glue (link_info, h) val = hash_table->thumb_glue_size + 4, _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner, tmp_name, BSF_LOCAL, s, val, - NULL, true, false, &bh); + NULL, TRUE, FALSE, &bh); free (tmp_name); @@ -551,7 +725,7 @@ record_thumb_to_arm_glue (link_info, h) /* Add the glue sections to ABFD. This function is called from the linker scripts in ld/emultempl/{armelf}.em. */ -boolean +bfd_boolean bfd_elf32_arm_add_glue_sections_to_bfd (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -561,8 +735,8 @@ bfd_elf32_arm_add_glue_sections_to_bfd (abfd, info) /* If we are only performing a partial link do not bother adding the glue. */ - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; sec = bfd_get_section_by_name (abfd, ARM2THUMB_GLUE_SECTION_NAME); @@ -578,7 +752,7 @@ bfd_elf32_arm_add_glue_sections_to_bfd (abfd, info) if (sec == NULL || !bfd_set_section_flags (abfd, sec, flags) || !bfd_set_section_alignment (abfd, sec, 2)) - return false; + 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. */ @@ -596,19 +770,19 @@ bfd_elf32_arm_add_glue_sections_to_bfd (abfd, info) if (sec == NULL || !bfd_set_section_flags (abfd, sec, flags) || !bfd_set_section_alignment (abfd, sec, 2)) - return false; + return FALSE; sec->gc_mark = 1; } - return true; + return TRUE; } /* 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_boolean bfd_elf32_arm_get_bfd_for_interworking (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -617,23 +791,23 @@ bfd_elf32_arm_get_bfd_for_interworking (abfd, info) /* If we are only performing a partial link do not bother getting a bfd to hold the glue. */ - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; globals = elf32_arm_hash_table (info); BFD_ASSERT (globals != NULL); if (globals->bfd_of_glue_owner != NULL) - return true; + return TRUE; /* Save the bfd for later use. */ globals->bfd_of_glue_owner = abfd; - return true; + return TRUE; } -boolean +bfd_boolean bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) bfd *abfd; struct bfd_link_info *link_info; @@ -649,8 +823,8 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) /* If we are only performing a partial link do not bother to construct any glue. */ - if (link_info->relocateable) - return true; + if (link_info->relocatable) + 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. */ @@ -665,7 +839,7 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) sec = abfd->sections; if (sec == NULL) - return true; + return TRUE; for (; sec != NULL; sec = sec->next) { @@ -676,8 +850,8 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) /* Load the relocs. */ internal_relocs - = _bfd_elf32_link_read_relocs (abfd, sec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, false); + = _bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, + (Elf_Internal_Rela *) NULL, FALSE); if (internal_relocs == NULL) goto error_return; @@ -768,7 +942,7 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) internal_relocs = NULL; } - return true; + return TRUE; error_return: if (contents != NULL @@ -778,8 +952,9 @@ error_return: && elf_section_data (sec)->relocs != internal_relocs) free (internal_relocs); - return false; + return FALSE; } +#endif /* 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 @@ -788,7 +963,7 @@ error_return: instruction. 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 + 11 bits to invest. The upper 11 bits are stored in one (identified by H-0.. see below), the lower 11 bits are stored in the other (identified by H-1). @@ -862,7 +1037,7 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, myh = find_thumb_glue (info, name, input_bfd); if (myh == NULL) - return false; + return FALSE; globals = elf32_arm_hash_table (info); @@ -891,7 +1066,7 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, (_(" first occurrence: %s: thumb call to arm"), bfd_archive_filename (input_bfd)); - return false; + return FALSE; } --my_offset; @@ -925,13 +1100,16 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, BFD_ASSERT (my_offset <= globals->thumb_glue_size); - /* Now go back and fix up the original BL insn to point - to here. */ - ret_offset = (s->output_offset - + my_offset - - (input_section->output_offset - + offset + addend) - - 8); + /* Now go back and fix up the original BL insn to point to here. */ + ret_offset = + /* Address of where the stub is located. */ + (s->output_section->vma + s->output_offset + my_offset) + /* Address of where the BL is located. */ + - (input_section->output_section->vma + input_section->output_offset + offset) + /* Addend in the relocation. */ + - addend + /* Biassing for PC-relative addressing. */ + - 8; tmp = bfd_get_32 (input_bfd, hit_data - input_section->vma); @@ -940,7 +1118,7 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, (bfd_vma) insert_thumb_branch (tmp, ret_offset), hit_data - input_section->vma); - return true; + return TRUE; } /* Arm code calling a Thumb function. */ @@ -968,7 +1146,7 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section, myh = find_arm_glue (info, name, input_bfd); if (myh == NULL) - return false; + return FALSE; globals = elf32_arm_hash_table (info); @@ -1028,7 +1206,7 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section, bfd_put_32 (output_bfd, (bfd_vma) tmp, hit_data - input_section->vma); - return true; + return TRUE; } /* Perform a relocation as part of a final link. */ @@ -1089,7 +1267,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, local_got_offsets = elf_local_got_offsets (input_bfd); r_symndx = ELF32_R_SYM (rel->r_info); -#ifdef USE_REL +#if USE_REL addend = bfd_get_32 (input_bfd, hit_data) & howto->src_mask; if (addend & ((howto->src_mask + 1) >> 1)) @@ -1115,19 +1293,50 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, #ifndef OLD_ARM_ABI case R_ARM_XPC25: #endif + case R_ARM_PLT32: + /* r_symndx will be zero only for relocs against symbols + from removed linkonce sections, or sections discarded by + a linker script. */ + if (r_symndx == 0) + return bfd_reloc_ok; + + /* Handle relocations which should use the PLT entry. ABS32/REL32 + will use the symbol's value, which may point to a PLT entry, but we + don't need to handle that here. If we created a PLT entry, all + branches in this object should go to it. */ + if ((r_type != R_ARM_ABS32 && r_type != R_ARM_REL32) + && h != NULL + && splt != NULL + && h->plt.offset != (bfd_vma) -1) + { + /* If we've created a .plt section, and assigned a PLT entry to + this function, it should not be known to bind locally. If + it were, we would have cleared the PLT entry. */ + BFD_ASSERT (!SYMBOL_CALLS_LOCAL (info, h)); + + value = (splt->output_section->vma + + splt->output_offset + + h->plt.offset); + return _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, value, + (bfd_vma) 0); + } + /* When generating a shared object, these relocations are copied into the output file to be resolved at run time. */ if (info->shared - && r_symndx != 0 - && (r_type != R_ARM_PC24 - || (h != NULL - && h->dynindx != -1 - && (! info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + && (input_section->flags & SEC_ALLOC) + && (r_type != R_ARM_REL32 + || !SYMBOL_CALLS_LOCAL (info, h)) + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && r_type != R_ARM_PC24 + && r_type != R_ARM_PLT32) { - Elf_Internal_Rel outrel; - boolean skip, relocate; + Elf_Internal_Rela outrel; + bfd_byte *loc; + bfd_boolean skip, relocate; if (sreloc == NULL) { @@ -1149,52 +1358,38 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, BFD_ASSERT (sreloc != NULL); } - skip = false; - relocate = false; + skip = FALSE; + relocate = FALSE; outrel.r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, rel->r_offset); if (outrel.r_offset == (bfd_vma) -1) - skip = true; + skip = TRUE; else if (outrel.r_offset == (bfd_vma) -2) - skip = true, relocate = true; + skip = TRUE, relocate = TRUE; outrel.r_offset += (input_section->output_section->vma + input_section->output_offset); if (skip) memset (&outrel, 0, sizeof outrel); - else if (r_type == R_ARM_PC24) - { - BFD_ASSERT (h != NULL && h->dynindx != -1); - if ((input_section->flags & SEC_ALLOC) == 0) - relocate = true; - outrel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_PC24); - } + else if (h != NULL + && h->dynindx != -1 + && (!info->shared + || !info->symbolic + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)) + outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); else { - if (h == NULL - || ((info->symbolic || h->dynindx == -1) - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) != 0)) - { - relocate = true; - outrel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE); - } - else - { - BFD_ASSERT (h->dynindx != -1); - if ((input_section->flags & SEC_ALLOC) == 0) - relocate = true; - outrel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_ABS32); - } + /* This symbol is local, or marked to become local. */ + relocate = TRUE; + outrel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE); } - bfd_elf32_swap_reloc_out (output_bfd, &outrel, - (((Elf32_External_Rel *) - sreloc->contents) - + sreloc->reloc_count)); - ++sreloc->reloc_count; + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rel); + bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); /* If this reloc is against an external symbol, we do not want to fiddle with the addend. Otherwise, we need to include the symbol @@ -1212,6 +1407,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, case R_ARM_XPC25: /* Arm BLX instruction. */ #endif case R_ARM_PC24: /* Arm B/BL instruction */ + case R_ARM_PLT32: #ifndef OLD_ARM_ABI if (r_type == R_ARM_XPC25) { @@ -1365,7 +1561,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, case R_ARM_THM_ABS5: /* Support ldr and str instructions for the thumb. */ -#ifdef USE_REL +#if USE_REL /* Need to refetch addend. */ addend = bfd_get_16 (input_bfd, hit_data) & howto->src_mask; /* ??? Need to determine shift amount from operand size. */ @@ -1388,16 +1584,16 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, case R_ARM_THM_PC22: /* Thumb BL (branch long instruction). */ { - bfd_vma relocation; - boolean overflow = false; - bfd_vma upper_insn = bfd_get_16 (input_bfd, hit_data); - bfd_vma lower_insn = bfd_get_16 (input_bfd, hit_data + 2); + bfd_vma relocation; + bfd_boolean overflow = FALSE; + bfd_vma upper_insn = bfd_get_16 (input_bfd, hit_data); + bfd_vma lower_insn = bfd_get_16 (input_bfd, hit_data + 2); bfd_signed_vma reloc_signed_max = ((1 << (howto->bitsize - 1)) - 1) >> howto->rightshift; bfd_signed_vma reloc_signed_min = ~ reloc_signed_max; - bfd_vma check; + bfd_vma check; bfd_signed_vma signed_check; -#ifdef USE_REL +#if USE_REL /* Need to refetch the addend and squish the two 11 bit pieces together. */ { @@ -1471,7 +1667,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, /* Assumes two's complement. */ if (signed_check > reloc_signed_max || signed_check < reloc_signed_min) - overflow = true; + overflow = TRUE; #ifndef OLD_ARM_ABI if (r_type == R_ARM_THM_XPC22 @@ -1497,33 +1693,36 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, case R_ARM_THM_PC11: /* Thumb B (branch) instruction). */ { - bfd_vma relocation; + bfd_signed_vma relocation; bfd_signed_vma reloc_signed_max = (1 << (howto->bitsize - 1)) - 1; bfd_signed_vma reloc_signed_min = ~ reloc_signed_max; - bfd_vma check; bfd_signed_vma signed_check; -#ifdef USE_REL +#if USE_REL /* Need to refetch addend. */ addend = bfd_get_16 (input_bfd, hit_data) & howto->src_mask; - /* ??? Need to determine shift amount from operand size. */ - addend >>= howto->rightshift; + if (addend & ((howto->src_mask + 1) >> 1)) + { + signed_addend = -1; + signed_addend &= ~ howto->src_mask; + signed_addend |= addend; + } + else + signed_addend = addend; + /* The value in the insn has been right shifted. We need to + undo this, so that we can perform the address calculation + in terms of bytes. */ + signed_addend <<= howto->rightshift; #endif - relocation = value + addend; + relocation = value + signed_addend; relocation -= (input_section->output_section->vma + input_section->output_offset + rel->r_offset); - check = relocation >> howto->rightshift; - - /* If this is a signed value, the rightshift just - dropped leading 1 bits (assuming twos complement). */ - if ((bfd_signed_vma) relocation >= 0) - signed_check = check; - else - signed_check = check | ~((bfd_vma) -1 >> howto->rightshift); - + relocation >>= howto->rightshift; + signed_check = relocation; + relocation &= howto->dst_mask; relocation |= (bfd_get_16 (input_bfd, hit_data) & (~ howto->dst_mask)); bfd_put_16 (input_bfd, relocation, hit_data); @@ -1596,13 +1795,17 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, if (h != NULL) { bfd_vma off; + bfd_boolean dyn; off = h->got.offset; BFD_ASSERT (off != (bfd_vma) -1); + dyn = globals->root.dynamic_sections_created; - if (!elf_hash_table (info)->dynamic_sections_created || - (info->shared && (info->symbolic || h->dynindx == -1) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) + || (info->shared + && SYMBOL_REFERENCES_LOCAL (info, h)) + || (ELF_ST_VISIBILITY (h->other) + && h->root.type == bfd_link_hash_undefweak)) { /* This is actually a static link, or it is a -Bsymbolic link and the symbol is defined locally. We must initialize this @@ -1652,7 +1855,8 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, if (info->shared) { asection * srelgot; - Elf_Internal_Rel outrel; + Elf_Internal_Rela outrel; + bfd_byte *loc; srelgot = bfd_get_section_by_name (dynobj, ".rel.got"); BFD_ASSERT (srelgot != NULL); @@ -1661,11 +1865,9 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, + sgot->output_offset + off); outrel.r_info = ELF32_R_INFO (0, R_ARM_RELATIVE); - bfd_elf32_swap_reloc_out (output_bfd, &outrel, - (((Elf32_External_Rel *) - srelgot->contents) - + srelgot->reloc_count)); - ++srelgot->reloc_count; + loc = srelgot->contents; + loc += srelgot->reloc_count++ * sizeof (Elf32_External_Rel); + bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); } local_got_offsets[r_symndx] |= 1; @@ -1678,36 +1880,6 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, contents, rel->r_offset, value, (bfd_vma) 0); - case R_ARM_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) - return _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, value, - (bfd_vma) 0); - - if (h->plt.offset == (bfd_vma) -1) - /* We didn't make a PLT entry for this symbol. This - happens when statically linking PIC code, or when - using -Bsymbolic. */ - return _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, value, - (bfd_vma) 0); - - BFD_ASSERT(splt != NULL); - if (splt == NULL) - return bfd_reloc_notsupported; - - value = (splt->output_section->vma - + splt->output_offset - + h->plt.offset); - return _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, value, - (bfd_vma) 0); - case R_ARM_SBREL32: return bfd_reloc_notsupported; @@ -1737,7 +1909,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, } } -#ifdef USE_REL +#if USE_REL /* Add INCREMENT to the reloc (of type HOWTO) at ADDRESS. */ static void arm_add_to_rel (abfd, address, howto, increment) @@ -1811,27 +1983,27 @@ arm_add_to_rel (abfd, address, howto, increment) #endif /* USE_REL */ /* Relocate an ARM ELF section. */ -static boolean +static bfd_boolean elf32_arm_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 *output_bfd; + struct bfd_link_info *info; + bfd *input_bfd; + asection *input_section; + bfd_byte *contents; + Elf_Internal_Rela *relocs; + Elf_Internal_Sym *local_syms; + asection **local_sections; { - Elf_Internal_Shdr * symtab_hdr; - struct elf_link_hash_entry ** sym_hashes; - Elf_Internal_Rela * rel; - Elf_Internal_Rela * relend; - const char * name; - -#ifndef USE_REL - if (info->relocateable) - return true; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + const char *name; + +#if !USE_REL + if (info->relocatable) + return TRUE; #endif symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; @@ -1858,18 +2030,13 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_ARM_GNU_VTINHERIT) continue; -#ifdef USE_REL - elf32_arm_info_to_howto (input_bfd, & bfd_reloc, - (Elf_Internal_Rel *) rel); -#else elf32_arm_info_to_howto (input_bfd, & bfd_reloc, rel); -#endif howto = bfd_reloc.howto; -#ifdef USE_REL - if (info->relocateable) +#if USE_REL + if (info->relocatable) { - /* This is a relocateable link. We don't have to change + /* This is a relocatable link. We don't have to change anything, unless the reloc is against a section symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ @@ -1899,7 +2066,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, { sym = local_syms + r_symndx; sec = local_sections[r_symndx]; -#ifdef USE_REL +#if USE_REL relocation = (sec->output_section->vma + sec->output_offset + sym->st_value); @@ -1916,7 +2083,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, bfd_archive_filename (input_bfd), bfd_get_section_name (input_bfd, input_section), (long) rel->r_offset, howto->name); - return false; + return FALSE; } value = bfd_get_32 (input_bfd, contents + rel->r_offset); @@ -1940,24 +2107,21 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, bfd_put_32 (input_bfd, value, contents + rel->r_offset); } #else - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); #endif } else { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - - while ( h->root.type == bfd_link_hash_indirect - || h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - - if ( h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) + bfd_boolean warned; + bfd_boolean unresolved_reloc; + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); + + if (unresolved_reloc || relocation != 0) { - int relocation_needed = 1; - - sec = h->root.u.def.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. */ @@ -1966,11 +2130,14 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, case R_ARM_PC24: case R_ARM_ABS32: case R_ARM_THM_PC22: + case R_ARM_PLT32: + if (info->shared && ( - (!info->symbolic && h->dynindx != -1) + (!info->symbolic && h->dynindx != -1) || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 ) + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT && ((input_section->flags & SEC_ALLOC) != 0 /* DWARF will emit R_ARM_ABS32 relocations in its sections against symbols defined externally @@ -1980,63 +2147,34 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) ) - relocation_needed = 0; + relocation = 0; break; case R_ARM_GOTPC: - relocation_needed = 0; + relocation = 0; break; case R_ARM_GOT32: - if (elf_hash_table(info)->dynamic_sections_created - && (!info->shared + if ((WILL_CALL_FINISH_DYNAMIC_SYMBOL + (elf_hash_table (info)->dynamic_sections_created, + info->shared, h)) + && (!info->shared || (!info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 - ) - ) - relocation_needed = 0; - break; - - case R_ARM_PLT32: - if (h->plt.offset != (bfd_vma)-1) - relocation_needed = 0; + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)) + relocation = 0; break; default: - if (sec->output_section == NULL) - { - (*_bfd_error_handler) - (_("%s: warning: unresolvable relocation %d against symbol `%s' from %s section"), - bfd_archive_filename (input_bfd), - r_type, - h->root.root.string, - bfd_get_section_name (input_bfd, input_section)); - relocation_needed = 0; - } + if (unresolved_reloc) + _bfd_error_handler + (_("%s: warning: unresolvable relocation %d against symbol `%s' from %s section"), + bfd_archive_filename (input_bfd), + r_type, + h->root.root.string, + bfd_get_section_name (input_bfd, input_section)); + break; } - - if (relocation_needed) - relocation = h->root.u.def.value - + sec->output_section->vma - + sec->output_offset; - else - relocation = 0; - } - else if (h->root.type == bfd_link_hash_undefweak) - relocation = 0; - 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, rel->r_offset, - (!info->shared || info->no_undefined - || ELF_ST_VISIBILITY (h->other))))) - return false; - relocation = 0; } } @@ -2071,14 +2209,14 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, && (!((*info->callbacks->reloc_overflow) (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset)))) - return false; + return FALSE; break; case bfd_reloc_undefined: if (!((*info->callbacks->undefined_symbol) (info, name, input_bfd, input_section, - rel->r_offset, true))) - return false; + rel->r_offset, TRUE))) + return FALSE; break; case bfd_reloc_outofrange: @@ -2101,17 +2239,39 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, if (!((*info->callbacks->warning) (info, msg, name, input_bfd, input_section, rel->r_offset))) - return false; + return FALSE; break; } } } - return true; + return TRUE; +} + +/* Set the right machine number. */ + +static bfd_boolean +elf32_arm_object_p (abfd) + bfd *abfd; +{ + unsigned int mach; + + mach = bfd_arm_get_mach_from_notes (abfd, ARM_NOTE_SECTION); + + if (mach != bfd_mach_arm_unknown) + bfd_default_set_arch_mach (abfd, bfd_arch_arm, mach); + + else if (elf_elfheader (abfd)->e_flags & EF_ARM_MAVERICK_FLOAT) + bfd_default_set_arch_mach (abfd, bfd_arch_arm, bfd_mach_arm_ep9312); + + else + bfd_default_set_arch_mach (abfd, bfd_arch_arm, mach); + + return TRUE; } /* Function to keep ARM specific flags in the ELF header. */ -static boolean +static bfd_boolean elf32_arm_set_private_flags (abfd, flags) bfd *abfd; flagword flags; @@ -2134,15 +2294,15 @@ Warning: Clearing the interworking flag of %s due to outside request"), else { elf_elfheader (abfd)->e_flags = flags; - elf_flags_init (abfd) = true; + elf_flags_init (abfd) = TRUE; } - return true; + return TRUE; } /* Copy backend specific data from one object module to another. */ -static boolean +static bfd_boolean elf32_arm_copy_private_bfd_data (ibfd, obfd) bfd *ibfd; bfd *obfd; @@ -2152,7 +2312,7 @@ elf32_arm_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; + return TRUE; in_flags = elf_elfheader (ibfd)->e_flags; out_flags = elf_elfheader (obfd)->e_flags; @@ -2163,11 +2323,11 @@ elf32_arm_copy_private_bfd_data (ibfd, obfd) { /* Cannot mix APCS26 and APCS32 code. */ if ((in_flags & EF_ARM_APCS_26) != (out_flags & EF_ARM_APCS_26)) - return false; + return FALSE; /* Cannot mix float APCS and non-float APCS code. */ if ((in_flags & EF_ARM_APCS_FLOAT) != (out_flags & EF_ARM_APCS_FLOAT)) - return false; + return FALSE; /* If the src and dest have different interworking flags then turn off the interworking bit. */ @@ -2188,32 +2348,31 @@ Warning: Clearing the interworking flag of %s because non-interworking code in % } elf_elfheader (obfd)->e_flags = in_flags; - elf_flags_init (obfd) = true; + elf_flags_init (obfd) = TRUE; - return true; + return TRUE; } /* Merge backend specific data from an object file to the output object file when linking. */ -static boolean +static bfd_boolean elf32_arm_merge_private_bfd_data (ibfd, obfd) bfd * ibfd; bfd * obfd; { flagword out_flags; flagword in_flags; - boolean flags_compatible = true; - boolean null_input_bfd = true; + bfd_boolean flags_compatible = TRUE; asection *sec; /* Check if we have the same endianess. */ if (! _bfd_generic_verify_endian_match (ibfd, obfd)) - return false; + return FALSE; if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) - return true; + return TRUE; /* The input BFD must have had its flags initialised. */ /* The following seems bogus to me -- The flags are initialized in @@ -2234,37 +2393,61 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) to the default values. */ if (bfd_get_arch_info (ibfd)->the_default && elf_elfheader (ibfd)->e_flags == 0) - return true; + return TRUE; - elf_flags_init (obfd) = true; + elf_flags_init (obfd) = TRUE; elf_elfheader (obfd)->e_flags = in_flags; if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) && bfd_get_arch_info (obfd)->the_default) return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd)); - return true; + return TRUE; } + /* Determine what should happen if the input ARM architecture + does not match the output ARM architecture. */ + if (! bfd_arm_merge_machines (ibfd, obfd)) + return FALSE; + /* Identical flags must be compatible. */ if (in_flags == out_flags) - return true; - - /* Check to see if the input BFD actually contains any sections. - If not, its flags may not have been initialised either, but it cannot - actually cause any incompatibility. */ - for (sec = ibfd->sections; sec != NULL; sec = sec->next) + return TRUE; + + /* Check to see if the input BFD actually contains any sections. If + not, its flags may not have been initialised either, but it + cannot actually cause any incompatibility. Do not short-circuit + dynamic objects; their section list may be emptied by + elf_link_add_object_symbols. + + Also check to see if there are no code sections in the input. + In this case there is no need to check for code specific flags. + XXX - do we need to worry about floating-point format compatability + in data sections ? */ + if (!(ibfd->flags & DYNAMIC)) { - /* Ignore synthetic glue sections. */ - if (strcmp (sec->name, ".glue_7") - && strcmp (sec->name, ".glue_7t")) + bfd_boolean null_input_bfd = TRUE; + bfd_boolean only_data_sections = TRUE; + + for (sec = ibfd->sections; sec != NULL; sec = sec->next) { - null_input_bfd = false; - break; + /* Ignore synthetic glue sections. */ + if (strcmp (sec->name, ".glue_7") + && strcmp (sec->name, ".glue_7t")) + { + if ((bfd_get_section_flags (ibfd, sec) + & (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS)) + == (SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS)) + only_data_sections = FALSE; + + null_input_bfd = FALSE; + break; + } } + + if (null_input_bfd || only_data_sections) + return TRUE; } - if (null_input_bfd) - return true; /* Complain about various flag mismatches. */ if (EF_ARM_EABI_VERSION (in_flags) != EF_ARM_EABI_VERSION (out_flags)) @@ -2275,7 +2458,7 @@ ERROR: %s is compiled for EABI version %d, whereas %s is compiled for version %d (in_flags & EF_ARM_EABIMASK) >> 24, bfd_get_filename (obfd), (out_flags & EF_ARM_EABIMASK) >> 24); - return false; + return FALSE; } /* Not sure what needs to be checked for EABI versions >= 1. */ @@ -2289,7 +2472,7 @@ ERROR: %s is compiled for APCS-%d, whereas target %s uses APCS-%d"), in_flags & EF_ARM_APCS_26 ? 26 : 32, bfd_get_filename (obfd), out_flags & EF_ARM_APCS_26 ? 26 : 32); - flags_compatible = false; + flags_compatible = FALSE; } if ((in_flags & EF_ARM_APCS_FLOAT) != (out_flags & EF_ARM_APCS_FLOAT)) @@ -2305,23 +2488,39 @@ ERROR: %s passes floats in integer registers, whereas %s passes them in float re bfd_archive_filename (ibfd), bfd_get_filename (obfd)); - flags_compatible = false; + flags_compatible = FALSE; } if ((in_flags & EF_ARM_VFP_FLOAT) != (out_flags & EF_ARM_VFP_FLOAT)) { if (in_flags & EF_ARM_VFP_FLOAT) _bfd_error_handler (_("\ -ERROR: %s uses VFP instructions, whereas %s uses FPA instructions"), +ERROR: %s uses VFP instructions, whereas %s does not"), + bfd_archive_filename (ibfd), + bfd_get_filename (obfd)); + else + _bfd_error_handler (_("\ +ERROR: %s uses FPA instructions, whereas %s does not"), + bfd_archive_filename (ibfd), + bfd_get_filename (obfd)); + + flags_compatible = FALSE; + } + + if ((in_flags & EF_ARM_MAVERICK_FLOAT) != (out_flags & EF_ARM_MAVERICK_FLOAT)) + { + if (in_flags & EF_ARM_MAVERICK_FLOAT) + _bfd_error_handler (_("\ +ERROR: %s uses Maverick instructions, whereas %s does not"), bfd_archive_filename (ibfd), bfd_get_filename (obfd)); else _bfd_error_handler (_("\ -ERROR: %s uses FPA instructions, whereas %s uses VFP instructions"), +ERROR: %s does not use Maverick instructions, whereas %s does"), bfd_archive_filename (ibfd), bfd_get_filename (obfd)); - flags_compatible = false; + flags_compatible = FALSE; } #ifdef EF_ARM_SOFT_FLOAT @@ -2346,7 +2545,7 @@ ERROR: %s uses hardware FP, whereas %s uses software FP"), bfd_archive_filename (ibfd), bfd_get_filename (obfd)); - flags_compatible = false; + flags_compatible = FALSE; } } #endif @@ -2376,7 +2575,7 @@ Warning: %s does not support interworking, whereas %s does"), /* Display the flags field. */ -static boolean +static bfd_boolean elf32_arm_print_private_bfd_data (abfd, ptr) bfd *abfd; PTR ptr; @@ -2399,7 +2598,7 @@ elf32_arm_print_private_bfd_data (abfd, ptr) switch (EF_ARM_EABI_VERSION (flags)) { case EF_ARM_EABI_UNKNOWN: - /* The following flag bits are GNU extenstions and not part of the + /* The following flag bits are GNU extensions 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_ARM_INTERWORK) @@ -2412,6 +2611,8 @@ elf32_arm_print_private_bfd_data (abfd, ptr) if (flags & EF_ARM_VFP_FLOAT) fprintf (file, _(" [VFP float format]")); + else if (flags & EF_ARM_MAVERICK_FLOAT) + fprintf (file, _(" [Maverick float format]")); else fprintf (file, _(" [FPA float format]")); @@ -2432,7 +2633,8 @@ elf32_arm_print_private_bfd_data (abfd, ptr) flags &= ~(EF_ARM_INTERWORK | EF_ARM_APCS_26 | EF_ARM_APCS_FLOAT | EF_ARM_PIC | EF_ARM_NEW_ABI | EF_ARM_OLD_ABI - | EF_ARM_SOFT_FLOAT | EF_ARM_VFP_FLOAT); + | EF_ARM_SOFT_FLOAT | EF_ARM_VFP_FLOAT + | EF_ARM_MAVERICK_FLOAT); break; case EF_ARM_EABI_VER1: @@ -2484,7 +2686,7 @@ elf32_arm_print_private_bfd_data (abfd, ptr) fputc ('\n', file); - return true; + return TRUE; } static int @@ -2552,39 +2754,110 @@ elf32_arm_gc_mark_hook (sec, info, rel, h, sym) /* Update the got entry reference counts for the section being removed. */ -static boolean +static bfd_boolean elf32_arm_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; { - /* We don't support garbage collection of GOT and PLT relocs yet. */ - return true; + 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; + + elf_section_data (sec)->local_dynrel = NULL; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); + + relend = relocs + sec->reloc_count; + for (rel = relocs; rel < relend; rel++) + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_ARM_GOT32: + 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; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx] -= 1; + } + break; + + case R_ARM_ABS32: + case R_ARM_REL32: + case R_ARM_PC24: + case R_ARM_PLT32: + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf32_arm_link_hash_entry *eh; + struct elf32_arm_relocs_copied **pp; + struct elf32_arm_relocs_copied *p; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + + if (ELF32_R_TYPE (rel->r_info) == R_ARM_ABS32 + || ELF32_R_TYPE (rel->r_info) == R_ARM_REL32) + { + eh = (struct elf32_arm_link_hash_entry *) h; + + for (pp = &eh->relocs_copied; (p = *pp) != NULL; + pp = &p->next) + if (p->section == sec) + { + p->count -= 1; + if (p->count == 0) + *pp = p->next; + break; + } + } + } + break; + + default: + break; + } + + return TRUE; } /* Look through the relocs for a section during the first phase. */ -static boolean +static bfd_boolean elf32_arm_check_relocs (abfd, info, sec, relocs) - bfd * abfd; - struct bfd_link_info * info; - asection * sec; - const Elf_Internal_Rela * 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; - struct elf_link_hash_entry ** sym_hashes_end; - const Elf_Internal_Rela * rel; - const Elf_Internal_Rela * rel_end; - bfd * dynobj; - asection * sgot, *srelgot, *sreloc; - bfd_vma * local_got_offsets; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + struct elf_link_hash_entry **sym_hashes_end; + const Elf_Internal_Rela *rel; + const Elf_Internal_Rela *rel_end; + bfd *dynobj; + asection *sreloc; + bfd_vma *local_got_offsets; + struct elf32_arm_link_hash_table *htab; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; - sgot = srelgot = sreloc = NULL; + htab = elf32_arm_hash_table (info); + sreloc = NULL; dynobj = elf_hash_table (info)->dynobj; local_got_offsets = elf_local_got_offsets (abfd); @@ -2609,126 +2882,75 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - /* Some relocs require a global offset table. */ - if (dynobj == NULL) - { - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_ARM_GOT32: - case R_ARM_GOTOFF: - case R_ARM_GOTPC: - elf_hash_table (info)->dynobj = dynobj = abfd; - if (! _bfd_elf_create_got_section (dynobj, info)) - return false; - break; - - default: - break; - } - } - switch (ELF32_R_TYPE (rel->r_info)) { case R_ARM_GOT32: /* This symbol requires a global offset table entry. */ - if (sgot == NULL) - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - } - - /* Get the got relocation section if necessary. */ - if (srelgot == NULL - && (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) - { - srelgot = bfd_make_section (dynobj, ".rel.got"); - if (srelgot == NULL - || ! bfd_set_section_flags (dynobj, srelgot, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, srelgot, 2)) - return false; - } - } - if (h != NULL) { - if (h->got.offset != (bfd_vma) -1) - /* We have already allocated space in the .got. */ - break; - - h->got.offset = sgot->_raw_size; - - /* 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); + h->got.refcount++; } else { - /* This is a global offset table entry for a local - symbol. */ - if (local_got_offsets == NULL) + bfd_signed_vma *local_got_refcounts; + + /* This is a global offset table entry for a local symbol. */ + local_got_refcounts = elf_local_got_refcounts (abfd); + if (local_got_refcounts == NULL) { bfd_size_type size; - unsigned int i; size = symtab_hdr->sh_info; - size *= sizeof (bfd_vma); - local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size); - if (local_got_offsets == NULL) - return false; - elf_local_got_offsets (abfd) = local_got_offsets; - for (i = 0; i < symtab_hdr->sh_info; i++) - local_got_offsets[i] = (bfd_vma) -1; + size *= (sizeof (bfd_signed_vma) + sizeof(char)); + local_got_refcounts = ((bfd_signed_vma *) + bfd_zalloc (abfd, size)); + if (local_got_refcounts == NULL) + return FALSE; + elf_local_got_refcounts (abfd) = local_got_refcounts; } - - if (local_got_offsets[r_symndx] != (bfd_vma) -1) - /* We have already allocated space in the .got. */ - break; - - local_got_offsets[r_symndx] = sgot->_raw_size; - - if (info->shared) - /* If we are generating a shared object, we need to - output a R_ARM_RELATIVE reloc so that the dynamic - linker can adjust this GOT entry. */ - srelgot->_raw_size += sizeof (Elf32_External_Rel); + local_got_refcounts[r_symndx] += 1; } - - sgot->_raw_size += 4; break; - case R_ARM_PLT32: - /* This symbol requires a procedure linkage table entry. We - actually build the entry in adjust_dynamic_symbol, - because this might be a case of linking PIC code which is - 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; - - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + case R_ARM_GOTOFF: + case R_ARM_GOTPC: + if (htab->sgot == NULL) + { + if (htab->root.dynobj == NULL) + htab->root.dynobj = abfd; + if (!create_got_section (htab->root.dynobj, info)) + return FALSE; + } break; case R_ARM_ABS32: case R_ARM_REL32: case R_ARM_PC24: + case R_ARM_PLT32: + if (h != NULL) + { + /* If this reloc is in a read-only section, we might + need a copy reloc. We can't check reliably at this + stage whether the section is read-only, as input + sections have not yet been mapped to output sections. + Tentatively set the flag for now, and correct in + adjust_dynamic_symbol. */ + if (!info->shared) + h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; + + /* We may need a .plt entry if the function this reloc + refers to is in a different object. We can't tell for + sure yet, because something later might force the + symbol local. */ + if (ELF32_R_TYPE (rel->r_info) == R_ARM_PC24 + || ELF32_R_TYPE (rel->r_info) == R_ARM_PLT32) + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + + /* If we create a PLT entry, this relocation will reference + it, even if it's an ABS32 relocation. */ + h->plt.refcount += 1; + } + /* If we are creating a shared library, and this is a reloc against a global symbol, or a non PC relative reloc against a local symbol, then we need to copy the reloc @@ -2740,14 +2962,19 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) 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. */ + relocs_copied field of the hash table entry. */ if (info->shared - && (ELF32_R_TYPE (rel->r_info) != R_ARM_PC24 - || (h != NULL - && (! info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + && (sec->flags & SEC_ALLOC) != 0 + && ((ELF32_R_TYPE (rel->r_info) != R_ARM_PC24 + && ELF32_R_TYPE (rel->r_info) != R_ARM_PLT32 + && ELF32_R_TYPE (rel->r_info) != R_ARM_REL32) + || (h != NULL + && (! info->symbolic + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)))) { + struct elf32_arm_relocs_copied *p, **head; + /* 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. */ @@ -2760,7 +2987,7 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) elf_elfheader (abfd)->e_shstrndx, elf_section_data (sec)->rel_hdr.sh_name)); if (name == NULL) - return false; + return FALSE; BFD_ASSERT (strncmp (name, ".rel", 4) == 0 && strcmp (bfd_get_section_name (abfd, sec), @@ -2779,107 +3006,110 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) if (sreloc == NULL || ! bfd_set_section_flags (dynobj, sreloc, flags) || ! bfd_set_section_alignment (dynobj, sreloc, 2)) - return false; + return FALSE; } - if (sec->flags & SEC_READONLY) - info->flags |= DF_TEXTREL; + + elf_section_data (sec)->sreloc = sreloc; } - 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 - && ELF32_R_TYPE (rel->r_info) == R_ARM_PC24) + /* If this is a global symbol, we count the number of + relocations we need for this symbol. */ + if (h != NULL) { - struct elf32_arm_link_hash_entry * eh; - struct elf32_arm_pcrel_relocs_copied * p; - - eh = (struct elf32_arm_link_hash_entry *) h; - - for (p = eh->pcrel_relocs_copied; p != NULL; p = p->next) - if (p->section == sreloc) - break; - + head = &((struct elf32_arm_link_hash_entry *) h)->relocs_copied; + } + else + { + /* Track dynamic relocs needed for local syms too. + We really need local syms available to do this + easily. Oh well. */ + + asection *s; + s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, + sec, r_symndx); + if (s == NULL) + return FALSE; + + head = ((struct elf32_arm_relocs_copied **) + &elf_section_data (s)->local_dynrel); + } + + p = *head; + if (p == NULL || p->section != sec) + { + bfd_size_type amt = sizeof *p; + p = bfd_alloc (htab->root.dynobj, amt); if (p == NULL) - { - p = ((struct elf32_arm_pcrel_relocs_copied *) - bfd_alloc (dynobj, (bfd_size_type) sizeof * p)); - if (p == NULL) - return false; - p->next = eh->pcrel_relocs_copied; - eh->pcrel_relocs_copied = p; - p->section = sreloc; - p->count = 0; - } - - ++p->count; + return FALSE; + p->next = *head; + *head = p; + p->section = sec; + p->count = 0; } + + if (ELF32_R_TYPE (rel->r_info) == R_ARM_ABS32 + || ELF32_R_TYPE (rel->r_info) == R_ARM_REL32) + p->count += 1; } break; /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ case R_ARM_GNU_VTINHERIT: - if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) - return false; + if (!bfd_elf_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: - if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_offset)) - return false; + if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset)) + return FALSE; break; } } - return true; + 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. */ -static boolean +static bfd_boolean elf32_arm_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; + bfd *abfd; + asection *section; + asymbol **symbols; + bfd_vma offset; + const char **filename_ptr; + const char **functionname_ptr; + unsigned int *line_ptr; { - boolean found; - const char * filename; - asymbol * func; - bfd_vma low_func; - asymbol ** p; + bfd_boolean found; + const char *filename; + asymbol *func; + bfd_vma low_func; + asymbol **p; if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, filename_ptr, functionname_ptr, line_ptr, 0, &elf_tdata (abfd)->dwarf2_find_line_info)) - return true; + return TRUE; if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, &found, filename_ptr, functionname_ptr, line_ptr, &elf_tdata (abfd)->line_info)) - return false; + return FALSE; if (found) - return true; + return TRUE; if (symbols == NULL) - return false; + return FALSE; filename = NULL; func = NULL; @@ -2916,13 +3146,13 @@ elf32_arm_find_nearest_line } if (func == NULL) - return false; + return FALSE; *filename_ptr = filename; *functionname_ptr = bfd_asymbol_name (func); *line_ptr = 0; - return true; + return TRUE; } /* Adjust a symbol defined by a dynamic object and referenced by a @@ -2931,7 +3161,7 @@ elf32_arm_find_nearest_line change the definition to something the rest of the link can understand. */ -static boolean +static bfd_boolean elf32_arm_adjust_dynamic_symbol (info, h) struct bfd_link_info * info; struct elf_link_hash_entry * h; @@ -2959,71 +3189,29 @@ elf32_arm_adjust_dynamic_symbol (info, h) if (h->type == STT_FUNC || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { - /* If we link a program (not a DSO), we'll get rid of unnecessary - PLT entries; we point to the actual symbols -- even for pic - relocs, because a program built with -fpic should have the same - result as one built without -fpic, specifically considering weak - symbols. - FIXME: m68k and i386 differ here, for unclear reasons. */ - if (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0) + if (h->plt.refcount <= 0 + || SYMBOL_CALLS_LOCAL (info, h) + || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak)) { /* This case can occur if we saw a PLT32 reloc in an input - file, but the symbol was not defined 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 PC24 reloc instead. */ + h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - return true; - } - - /* Make sure this symbol is output as a dynamic symbol. */ - if (h->dynindx == -1) - { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - } - - s = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (s != NULL); - - /* If this is the first .plt entry, make room for the special - first entry. */ - if (s->_raw_size == 0) - s->_raw_size += PLT_ENTRY_SIZE; - - /* If this symbol is not defined in a regular file, and we are - not generating a shared library, then set the symbol to this - location in the .plt. This is required to make function - pointers compare as equal between the normal executable and - the shared library. */ - if (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - { - h->root.u.def.section = s; - h->root.u.def.value = s->_raw_size; } - h->plt.offset = s->_raw_size; - - /* Make room for this entry. */ - s->_raw_size += PLT_ENTRY_SIZE; - - /* We also need to make an entry in the .got.plt section, which - will be placed in the .got section by the linker script. */ - s = bfd_get_section_by_name (dynobj, ".got.plt"); - BFD_ASSERT (s != NULL); - s->_raw_size += 4; - - /* We also need to make an entry in the .rel.plt section. */ - - s = bfd_get_section_by_name (dynobj, ".rel.plt"); - BFD_ASSERT (s != NULL); - s->_raw_size += sizeof (Elf32_External_Rel); - - return true; + return TRUE; } + else + /* It's possible that we incorrectly decided a .plt reloc was + needed for an R_ARM_PC24 reloc to a non-function sym in + check_relocs. We can't decide accurately between function and + non-function syms in check-relocs; Objects loaded later in + the link may change h->type. So fix it now. */ + h->plt.offset = (bfd_vma) -1; /* If this is a weak symbol, and there is a real definition, the processor independent code will have arranged for us to see the @@ -3034,7 +3222,7 @@ elf32_arm_adjust_dynamic_symbol (info, h) || 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; + return TRUE; } /* This is a reference to a symbol defined by a dynamic object which @@ -3045,7 +3233,7 @@ elf32_arm_adjust_dynamic_symbol (info, h) For such cases we need not do anything here; the relocations will be handled correctly by relocate_section. */ if (info->shared) - return true; + 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 @@ -3085,7 +3273,7 @@ elf32_arm_adjust_dynamic_symbol (info, h) if (power_of_two > bfd_get_section_alignment (dynobj, s)) { if (! bfd_set_section_alignment (dynobj, s, power_of_two)) - return false; + return FALSE; } /* Define the symbol as being at this point in the section. */ @@ -3095,28 +3283,202 @@ elf32_arm_adjust_dynamic_symbol (info, h) /* Increment the section size to make room for the symbol. */ s->_raw_size += h->size; - return true; + return TRUE; +} + +/* Allocate space in .plt, .got and associated reloc sections for + dynamic relocs. */ + +static bfd_boolean +allocate_dynrelocs (h, inf) + struct elf_link_hash_entry *h; + PTR inf; +{ + struct bfd_link_info *info; + struct elf32_arm_link_hash_table *htab; + struct elf32_arm_link_hash_entry *eh; + struct elf32_arm_relocs_copied *p; + + if (h->root.type == bfd_link_hash_indirect) + return TRUE; + + if (h->root.type == bfd_link_hash_warning) + /* When warning symbols are created, they **replace** the "real" + entry in the hash table, thus we never get to see the real + symbol in a hash traversal. So look at it now. */ + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + info = (struct bfd_link_info *) inf; + htab = elf32_arm_hash_table (info); + + if (htab->root.dynamic_sections_created + && h->plt.refcount > 0) + { + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + if (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) + { + asection *s = htab->splt; + + /* If this is the first .plt entry, make room for the special + first entry. */ + if (s->_raw_size == 0) + s->_raw_size += PLT_HEADER_SIZE; + + h->plt.offset = s->_raw_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 = h->plt.offset; + } + + /* Make room for this entry. */ + s->_raw_size += PLT_ENTRY_SIZE; + + /* We also need to make an entry in the .got.plt section, which + will be placed in the .got section by the linker script. */ + htab->sgotplt->_raw_size += 4; + + /* We also need to make an entry in the .rel.plt section. */ + htab->srelplt->_raw_size += sizeof (Elf32_External_Rel); + } + else + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + } + else + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + + if (h->got.refcount > 0) + { + asection *s; + bfd_boolean dyn; + + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + s = htab->sgot; + h->got.offset = s->_raw_size; + s->_raw_size += 4; + dyn = htab->root.dynamic_sections_created; + if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))) + htab->srelgot->_raw_size += sizeof (Elf32_External_Rel); + } + else + h->got.offset = (bfd_vma) -1; + + eh = (struct elf32_arm_link_hash_entry *) h; + if (eh->relocs_copied == NULL) + return TRUE; + + /* In the shared -Bsymbolic case, discard space allocated for + dynamic pc-relative relocs against symbols which turn out to be + defined in regular objects. For the normal shared case, discard + space for pc-relative relocs that have become local due to symbol + visibility changes. */ + + if (info->shared) + { + /* Discard relocs on undefined weak syms with non-default + visibility. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + eh->relocs_copied = NULL; + } + else + { + /* For the non-shared case, discard space for relocs against + symbols which turn out to need copy relocs or are not + dynamic. */ + + if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 + && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + || (htab->root.dynamic_sections_created + && (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined)))) + { + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + /* If that succeeded, we know we'll be keeping all the + relocs. */ + if (h->dynindx != -1) + goto keep; + } + + eh->relocs_copied = NULL; + + keep: ; + } + + /* Finally, allocate space. */ + for (p = eh->relocs_copied; p != NULL; p = p->next) + { + asection *sreloc = elf_section_data (p->section)->sreloc; + sreloc->_raw_size += p->count * sizeof (Elf32_External_Rel); + } + + return TRUE; } /* Set the sizes of the dynamic sections. */ -static boolean +static bfd_boolean elf32_arm_size_dynamic_sections (output_bfd, info) bfd * output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info * info; { bfd * dynobj; asection * s; - boolean plt; - boolean relocs; + bfd_boolean plt; + bfd_boolean relocs; + bfd *ibfd; + struct elf32_arm_link_hash_table *htab; + htab = elf32_arm_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) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); @@ -3124,36 +3486,84 @@ elf32_arm_size_dynamic_sections (output_bfd, info) s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; } } - else + + /* Set up .got offsets for local syms, and space for local dynamic + relocs. */ + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) { - /* We may have created entries in the .rel.got section. - However, if we are not creating the dynamic sections, we will - not actually use these entries. Reset the size of .rel.got, - which will cause it to get stripped from the output file - below. */ - s = bfd_get_section_by_name (dynobj, ".rel.got"); - if (s != NULL) - s->_raw_size = 0; + bfd_signed_vma *local_got; + bfd_signed_vma *end_local_got; + char *local_tls_type; + bfd_size_type locsymcount; + Elf_Internal_Shdr *symtab_hdr; + asection *srel; + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) + continue; + + for (s = ibfd->sections; s != NULL; s = s->next) + { + struct elf32_arm_relocs_copied *p; + + for (p = *((struct elf32_arm_relocs_copied **) + &elf_section_data (s)->local_dynrel); + p != NULL; + p = p->next) + { + if (!bfd_is_abs_section (p->section) + && bfd_is_abs_section (p->section->output_section)) + { + /* Input section has been discarded, either because + it is a copy of a linkonce section or due to + linker script /DISCARD/, so we'll be discarding + the relocs too. */ + } + else if (p->count != 0) + { + srel = elf_section_data (p->section)->sreloc; + srel->_raw_size += p->count * sizeof (Elf32_External_Rel); + if ((p->section->output_section->flags & SEC_READONLY) != 0) + info->flags |= DF_TEXTREL; + } + } + } + + local_got = elf_local_got_refcounts (ibfd); + if (!local_got) + continue; + + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + locsymcount = symtab_hdr->sh_info; + end_local_got = local_got + locsymcount; + s = htab->sgot; + srel = htab->srelgot; + for (; local_got < end_local_got; ++local_got, ++local_tls_type) + { + if (*local_got > 0) + { + *local_got = s->_raw_size; + s->_raw_size += 4; + if (info->shared) + srel->_raw_size += sizeof (Elf32_External_Rel); + } + else + *local_got = (bfd_vma) -1; + } } - /* 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 && info->symbolic) - elf32_arm_link_hash_traverse (elf32_arm_hash_table (info), - elf32_arm_discard_copies, - (PTR) NULL); + /* Allocate global sym .plt and .got entries, and space for global + sym dynamic relocs. */ + elf_link_hash_traverse (&htab->root, allocate_dynrelocs, (PTR) info); /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ - plt = false; - relocs = false; + plt = FALSE; + relocs = FALSE; for (s = dynobj->sections; s != NULL; s = s->next) { const char * name; - boolean strip; + bfd_boolean strip; if ((s->flags & SEC_LINKER_CREATED) == 0) continue; @@ -3162,7 +3572,7 @@ elf32_arm_size_dynamic_sections (output_bfd, info) of the dynobj section names depend upon the input files. */ name = bfd_get_section_name (dynobj, s); - strip = false; + strip = FALSE; if (strcmp (name, ".plt") == 0) { @@ -3170,12 +3580,12 @@ elf32_arm_size_dynamic_sections (output_bfd, info) { /* Strip this section if we don't need it; see the comment below. */ - strip = true; + strip = TRUE; } else { /* Remember whether there is a PLT. */ - plt = true; + plt = TRUE; } } else if (strncmp (name, ".rel", 4) == 0) @@ -3191,14 +3601,14 @@ elf32_arm_size_dynamic_sections (output_bfd, info) adjust_dynamic_symbol is called, and it is that function which decides whether anything needs to go into these sections. */ - strip = true; + strip = TRUE; } else { /* Remember whether there are any reloc sections other than .rel.plt. */ if (strcmp (name, ".rel.plt") != 0) - relocs = true; + relocs = TRUE; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -3213,26 +3623,14 @@ elf32_arm_size_dynamic_sections (output_bfd, info) if (strip) { - asection ** spp; - - for (spp = &s->output_section->owner->sections; - *spp != NULL; - spp = &(*spp)->next) - { - if (*spp == s->output_section) - { - bfd_section_list_remove (s->output_section->owner, spp); - --s->output_section->owner->section_count; - break; - } - } + _bfd_strip_section_from_output (info, s); continue; } /* Allocate memory for the section contents. */ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) - return false; + return FALSE; } if (elf_hash_table (info)->dynamic_sections_created) @@ -3243,12 +3641,12 @@ elf32_arm_size_dynamic_sections (output_bfd, info) the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ #define add_dynamic_entry(TAG, VAL) \ - bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + _bfd_elf_add_dynamic_entry (info, TAG, VAL) if (!info->shared) { if (!add_dynamic_entry (DT_DEBUG, 0)) - return false; + return FALSE; } if (plt) @@ -3257,7 +3655,7 @@ elf32_arm_size_dynamic_sections (output_bfd, info) || !add_dynamic_entry (DT_PLTRELSZ, 0) || !add_dynamic_entry (DT_PLTREL, DT_REL) || !add_dynamic_entry (DT_JMPREL, 0)) - return false; + return FALSE; } if (relocs) @@ -3265,52 +3663,25 @@ elf32_arm_size_dynamic_sections (output_bfd, info) if ( !add_dynamic_entry (DT_REL, 0) || !add_dynamic_entry (DT_RELSZ, 0) || !add_dynamic_entry (DT_RELENT, sizeof (Elf32_External_Rel))) - return false; + return FALSE; } if ((info->flags & DF_TEXTREL) != 0) { if (!add_dynamic_entry (DT_TEXTREL, 0)) - return false; + return FALSE; info->flags |= DF_TEXTREL; } } #undef add_synamic_entry - return true; -} - -/* This function is called via elf32_arm_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 - check_relocs routine, but we won't fill them in in the - relocate_section routine. */ - -static boolean -elf32_arm_discard_copies (h, ignore) - struct elf32_arm_link_hash_entry * h; - PTR ignore ATTRIBUTE_UNUSED; -{ - struct elf32_arm_pcrel_relocs_copied * s; - - if (h->root.root.type == bfd_link_hash_warning) - h = (struct elf32_arm_link_hash_entry *) h->root.root.u.i.link; - - /* 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); - - return true; + return TRUE; } /* Finish up dynamic symbol handling. We set the contents of various dynamic sections here. */ -static boolean +static bfd_boolean elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym) bfd * output_bfd; struct bfd_link_info * info; @@ -3328,7 +3699,9 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym) asection * srel; bfd_vma plt_index; bfd_vma got_offset; - Elf_Internal_Rel rel; + Elf_Internal_Rela rel; + bfd_byte *loc; + bfd_vma got_displacement; /* This symbol has an entry in the procedure linkage table. Set it up. */ @@ -3344,43 +3717,50 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym) corresponds to this symbol. This is the index of this symbol in all the symbols for which we are making plt entries. The first entry in the procedure linkage table is reserved. */ - plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1; + plt_index = (h->plt.offset - PLT_HEADER_SIZE) / PLT_ENTRY_SIZE; /* Get the offset into the .got table of the entry that corresponds to this function. Each .got entry is 4 bytes. The first three are reserved. */ got_offset = (plt_index + 3) * 4; + /* Calculate the displacement between the PLT slot and the + entry in the GOT. */ + got_displacement = (sgot->output_section->vma + + sgot->output_offset + + got_offset + - splt->output_section->vma + - splt->output_offset + - h->plt.offset + - 8); + + BFD_ASSERT ((got_displacement & 0xf0000000) == 0); + /* Fill in the entry in the procedure linkage table. */ - bfd_put_32 (output_bfd, elf32_arm_plt_entry[0], + bfd_put_32 (output_bfd, elf32_arm_plt_entry[0] | ((got_displacement & 0x0ff00000) >> 20), splt->contents + h->plt.offset + 0); - bfd_put_32 (output_bfd, elf32_arm_plt_entry[1], + bfd_put_32 (output_bfd, elf32_arm_plt_entry[1] | ((got_displacement & 0x000ff000) >> 12), splt->contents + h->plt.offset + 4); - bfd_put_32 (output_bfd, elf32_arm_plt_entry[2], + bfd_put_32 (output_bfd, elf32_arm_plt_entry[2] | (got_displacement & 0x00000fff), splt->contents + h->plt.offset + 8); - bfd_put_32 (output_bfd, - (sgot->output_section->vma - + sgot->output_offset - + got_offset - - splt->output_section->vma - - splt->output_offset - - h->plt.offset - 12), - splt->contents + h->plt.offset + 12); +#ifdef FOUR_WORD_PLT + bfd_put_32 (output_bfd, elf32_arm_plt_entry[3], + splt->contents + h->plt.offset + 12); +#endif /* Fill in the entry in the global offset table. */ bfd_put_32 (output_bfd, (splt->output_section->vma + splt->output_offset), sgot->contents + got_offset); - + /* Fill in the entry in the .rel.plt section. */ rel.r_offset = (sgot->output_section->vma + sgot->output_offset + got_offset); rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_JUMP_SLOT); - bfd_elf32_swap_reloc_out (output_bfd, &rel, - ((Elf32_External_Rel *) srel->contents - + plt_index)); + loc = srel->contents + plt_index * sizeof (Elf32_External_Rel); + bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { @@ -3401,7 +3781,8 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym) { asection * sgot; asection * srel; - Elf_Internal_Rel rel; + Elf_Internal_Rela rel; + bfd_byte *loc; /* This symbol has an entry in the global offset table. Set it up. */ @@ -3413,30 +3794,33 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym) + sgot->output_offset + (h->got.offset &~ (bfd_vma) 1)); - /* If this is a -Bsymbolic link, and the symbol is defined - locally, we just want to emit a RELATIVE reloc. The entry in - the global offset table will already have been initialized in - the relocate_section function. */ + /* 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_ARM_RELATIVE); + && SYMBOL_REFERENCES_LOCAL (info, h)) + { + BFD_ASSERT((h->got.offset & 1) != 0); + rel.r_info = ELF32_R_INFO (0, R_ARM_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_ARM_GLOB_DAT); } - bfd_elf32_swap_reloc_out (output_bfd, &rel, - ((Elf32_External_Rel *) srel->contents - + srel->reloc_count)); - ++srel->reloc_count; + loc = srel->contents + srel->reloc_count++ * sizeof (Elf32_External_Rel); + bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); } if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) { asection * s; - Elf_Internal_Rel rel; + Elf_Internal_Rela rel; + bfd_byte *loc; /* This symbol needs a copy reloc. Set it up. */ BFD_ASSERT (h->dynindx != -1 @@ -3451,10 +3835,8 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym) + h->root.u.def.section->output_section->vma + h->root.u.def.section->output_offset); rel.r_info = ELF32_R_INFO (h->dynindx, R_ARM_COPY); - bfd_elf32_swap_reloc_out (output_bfd, &rel, - ((Elf32_External_Rel *) s->contents - + s->reloc_count)); - ++s->reloc_count; + loc = s->contents + s->reloc_count++ * sizeof (Elf32_External_Rel); + bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); } /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ @@ -3462,12 +3844,12 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym) || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) sym->st_shndx = SHN_ABS; - return true; + return TRUE; } /* Finish up the dynamic sections. */ -static boolean +static bfd_boolean elf32_arm_finish_dynamic_sections (output_bfd, info) bfd * output_bfd; struct bfd_link_info * info; @@ -3548,16 +3930,57 @@ elf32_arm_finish_dynamic_sections (output_bfd, info) } bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); break; + + /* Set the bottom bit of DT_INIT/FINI if the + corresponding function is Thumb. */ + case DT_INIT: + name = info->init_function; + goto get_sym; + case DT_FINI: + name = info->fini_function; + get_sym: + /* If it wasn't set by elf_bfd_final_link + then there is nothing to adjust. */ + if (dyn.d_un.d_val != 0) + { + struct elf_link_hash_entry * eh; + + eh = elf_link_hash_lookup (elf_hash_table (info), name, + FALSE, FALSE, TRUE); + if (eh != (struct elf_link_hash_entry *) NULL + && ELF_ST_TYPE (eh->type) == STT_ARM_TFUNC) + { + dyn.d_un.d_val |= 1; + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + } + } + break; } } /* Fill in the first entry in the procedure linkage table. */ if (splt->_raw_size > 0) { + bfd_vma got_displacement; + + /* Calculate the displacement between the PLT slot and &GOT[0]. */ + got_displacement = (sgot->output_section->vma + + sgot->output_offset + - splt->output_section->vma + - splt->output_offset + - 16); + bfd_put_32 (output_bfd, elf32_arm_plt0_entry[0], splt->contents + 0); bfd_put_32 (output_bfd, elf32_arm_plt0_entry[1], splt->contents + 4); bfd_put_32 (output_bfd, elf32_arm_plt0_entry[2], splt->contents + 8); bfd_put_32 (output_bfd, elf32_arm_plt0_entry[3], splt->contents + 12); +#ifdef FOUR_WORD_PLT + /* The displacement value goes in the otherwise-unused last word of + the second entry. */ + bfd_put_32 (output_bfd, got_displacement, splt->contents + 28); +#else + bfd_put_32 (output_bfd, got_displacement, splt->contents + 16); +#endif } /* UnixWare sets the entsize of .plt to 4, although that doesn't @@ -3580,7 +4003,7 @@ elf32_arm_finish_dynamic_sections (output_bfd, info) elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4; - return true; + return TRUE; } static void @@ -3613,10 +4036,37 @@ elf32_arm_reloc_type_class (rela) } } +static bfd_boolean elf32_arm_section_flags PARAMS ((flagword *, Elf_Internal_Shdr *)); +static void elf32_arm_final_write_processing PARAMS ((bfd *, bfd_boolean)); + +/* Set the right machine number for an Arm ELF file. */ + +static bfd_boolean +elf32_arm_section_flags (flags, hdr) + flagword *flags; + Elf_Internal_Shdr *hdr; +{ + if (hdr->sh_type == SHT_NOTE) + *flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_SAME_CONTENTS; + + return TRUE; +} + +void +elf32_arm_final_write_processing (abfd, linker) + bfd *abfd; + bfd_boolean linker ATTRIBUTE_UNUSED; +{ + bfd_arm_update_notes (abfd, ARM_NOTE_SECTION); +} #define ELF_ARCH bfd_arch_arm #define ELF_MACHINE_CODE EM_ARM +#ifdef __QNXTARGET__ +#define ELF_MAXPAGESIZE 0x1000 +#else #define ELF_MAXPAGESIZE 0x8000 +#endif #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 @@ -3632,22 +4082,27 @@ elf32_arm_reloc_type_class (rela) #define elf_backend_check_relocs elf32_arm_check_relocs #define elf_backend_relocate_section elf32_arm_relocate_section #define elf_backend_adjust_dynamic_symbol elf32_arm_adjust_dynamic_symbol -#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections +#define elf_backend_create_dynamic_sections elf32_arm_create_dynamic_sections #define elf_backend_finish_dynamic_symbol elf32_arm_finish_dynamic_symbol #define elf_backend_finish_dynamic_sections elf32_arm_finish_dynamic_sections #define elf_backend_size_dynamic_sections elf32_arm_size_dynamic_sections #define elf_backend_post_process_headers elf32_arm_post_process_headers #define elf_backend_reloc_type_class elf32_arm_reloc_type_class +#define elf_backend_object_p elf32_arm_object_p +#define elf_backend_section_flags elf32_arm_section_flags +#define elf_backend_final_write_processing elf32_arm_final_write_processing +#define elf_backend_copy_indirect_symbol elf32_arm_copy_indirect_symbol +#define elf_backend_can_refcount 1 #define elf_backend_can_gc_sections 1 #define elf_backend_plt_readonly 1 #define elf_backend_want_got_plt 1 #define elf_backend_want_plt_sym 0 -#ifndef USE_REL +#if !USE_REL #define elf_backend_rela_normal 1 #endif #define elf_backend_got_header_size 12 -#define elf_backend_plt_header_size PLT_ENTRY_SIZE #include "elf32-target.h" + diff --git a/contrib/binutils/bfd/elf32-gen.c b/contrib/binutils/bfd/elf32-gen.c index 58b5fc6..f2edf69 100644 --- a/contrib/binutils/bfd/elf32-gen.c +++ b/contrib/binutils/bfd/elf32-gen.c @@ -1,5 +1,6 @@ /* Generic support for 32-bit ELF - Copyright 1993, 1995, 1998, 1999, 2001 Free Software Foundation, Inc. + Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -30,28 +31,28 @@ static reloc_howto_type dummy = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ NULL, /* special_function */ "UNKNOWN", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false); /* pcrel_offset */ + FALSE); /* pcrel_offset */ static void elf_generic_info_to_howto - PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); + PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); static void elf_generic_info_to_howto_rel - PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); -static boolean elf32_generic_link_add_symbols + PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); +static bfd_boolean elf32_generic_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); static void elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc) bfd *abfd ATTRIBUTE_UNUSED; arelent *bfd_reloc; - Elf32_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED; + Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED; { bfd_reloc->howto = &dummy; } @@ -60,12 +61,12 @@ static void elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) bfd *abfd ATTRIBUTE_UNUSED; arelent *bfd_reloc; - Elf32_Internal_Rel *elf_reloc ATTRIBUTE_UNUSED; + Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED; { bfd_reloc->howto = &dummy; } -static boolean +static bfd_boolean elf32_generic_link_add_symbols (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -84,10 +85,10 @@ elf32_generic_link_add_symbols (abfd, info) ehdrp->e_machine); bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; } - return bfd_elf32_bfd_link_add_symbols (abfd, info); + return bfd_elf_link_add_symbols (abfd, info); } #define TARGET_LITTLE_SYM bfd_elf32_little_generic_vec diff --git a/contrib/binutils/bfd/elf32-i386.c b/contrib/binutils/bfd/elf32-i386.c index 51765ab..7b173e4 100644 --- a/contrib/binutils/bfd/elf32-i386.c +++ b/contrib/binutils/bfd/elf32-i386.c @@ -1,22 +1,22 @@ /* Intel 80386/80486-specific support for 32-bit ELF - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, + 2003, 2004 Free Software Foundation, Inc. -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" @@ -24,345 +24,280 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libbfd.h" #include "elf-bfd.h" -static reloc_howto_type *elf_i386_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); -static void elf_i386_info_to_howto - PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); -static void elf_i386_info_to_howto_rel - PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); -static boolean elf_i386_is_local_label_name - PARAMS ((bfd *, const char *)); -static boolean elf_i386_grok_prstatus - PARAMS ((bfd *abfd, Elf_Internal_Note *note)); -static boolean elf_i386_grok_psinfo - PARAMS ((bfd *abfd, Elf_Internal_Note *note)); -static struct bfd_hash_entry *link_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static struct bfd_link_hash_table *elf_i386_link_hash_table_create - PARAMS ((bfd *)); -static boolean create_got_section - PARAMS((bfd *, struct bfd_link_info *)); -static boolean elf_i386_create_dynamic_sections - PARAMS((bfd *, struct bfd_link_info *)); -static void elf_i386_copy_indirect_symbol - PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, - struct elf_link_hash_entry *)); -static int elf_i386_tls_transition - PARAMS ((struct bfd_link_info *, int, int)); - -static boolean elf_i386_mkobject - PARAMS((bfd *)); -static boolean elf_i386_object_p - PARAMS((bfd *)); -static boolean elf_i386_check_relocs - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); -static asection *elf_i386_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static boolean elf_i386_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); -static boolean elf_i386_adjust_dynamic_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); -static boolean allocate_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); -static boolean readonly_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); -static boolean elf_i386_fake_sections - PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); -static boolean elf_i386_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static bfd_vma dtpoff_base - PARAMS ((struct bfd_link_info *)); -static bfd_vma tpoff - PARAMS ((struct bfd_link_info *, bfd_vma)); -static boolean elf_i386_relocate_section - PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static boolean elf_i386_finish_dynamic_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, - Elf_Internal_Sym *)); -static enum elf_reloc_type_class elf_i386_reloc_type_class - PARAMS ((const Elf_Internal_Rela *)); -static boolean elf_i386_finish_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); - -#define USE_REL 1 /* 386 uses REL relocations instead of RELA */ +/* 386 uses REL relocations instead of RELA. */ +#define USE_REL 1 #include "elf/i386.h" static reloc_howto_type elf_howto_table[]= { - HOWTO(R_386_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, + 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, + 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, + 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, + 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, + 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, + 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, + 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, + 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, + 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, + 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, + 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), + 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_TLS_TPOFF - R_386_standard) +#define R_386_standard (R_386_GOTPC + 1) +#define R_386_ext_offset (R_386_TLS_TPOFF - R_386_standard) /* These relocs are a GNU extension. */ - HOWTO(R_386_TLS_TPOFF, 0, 2, 32, false, 0, complain_overflow_bitfield, + HOWTO(R_386_TLS_TPOFF, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_386_TLS_TPOFF", - true, 0xffffffff, 0xffffffff, false), - HOWTO(R_386_TLS_IE, 0, 2, 32, false, 0, complain_overflow_bitfield, + TRUE, 0xffffffff, 0xffffffff, FALSE), + HOWTO(R_386_TLS_IE, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_386_TLS_IE", - true, 0xffffffff, 0xffffffff, false), - HOWTO(R_386_TLS_GOTIE, 0, 2, 32, false, 0, complain_overflow_bitfield, + TRUE, 0xffffffff, 0xffffffff, FALSE), + HOWTO(R_386_TLS_GOTIE, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_386_TLS_GOTIE", - true, 0xffffffff, 0xffffffff, false), - HOWTO(R_386_TLS_LE, 0, 2, 32, false, 0, complain_overflow_bitfield, + TRUE, 0xffffffff, 0xffffffff, FALSE), + HOWTO(R_386_TLS_LE, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_386_TLS_LE", - true, 0xffffffff, 0xffffffff, false), - HOWTO(R_386_TLS_GD, 0, 2, 32, false, 0, complain_overflow_bitfield, + TRUE, 0xffffffff, 0xffffffff, FALSE), + HOWTO(R_386_TLS_GD, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_386_TLS_GD", - true, 0xffffffff, 0xffffffff, false), - HOWTO(R_386_TLS_LDM, 0, 2, 32, false, 0, complain_overflow_bitfield, + TRUE, 0xffffffff, 0xffffffff, FALSE), + HOWTO(R_386_TLS_LDM, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_386_TLS_LDM", - true, 0xffffffff, 0xffffffff, false), - HOWTO(R_386_16, 0, 1, 16, false, 0, complain_overflow_bitfield, + TRUE, 0xffffffff, 0xffffffff, FALSE), + 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, + 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, + 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, + 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), + TRUE, 0xff, 0xff, TRUE), -#define R_386_ext ((unsigned int) R_386_PC8 + 1 - R_386_ext_offset) -#define R_386_tls_offset ((unsigned int) R_386_TLS_LDO_32 - R_386_ext) +#define R_386_ext (R_386_PC8 + 1 - R_386_ext_offset) +#define R_386_tls_offset (R_386_TLS_LDO_32 - R_386_ext) /* These are common with Solaris TLS implementation. */ - HOWTO(R_386_TLS_LDO_32, 0, 2, 32, false, 0, complain_overflow_bitfield, + HOWTO(R_386_TLS_LDO_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_386_TLS_LDO_32", - true, 0xffffffff, 0xffffffff, false), - HOWTO(R_386_TLS_IE_32, 0, 2, 32, false, 0, complain_overflow_bitfield, + TRUE, 0xffffffff, 0xffffffff, FALSE), + HOWTO(R_386_TLS_IE_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_386_TLS_IE_32", - true, 0xffffffff, 0xffffffff, false), - HOWTO(R_386_TLS_LE_32, 0, 2, 32, false, 0, complain_overflow_bitfield, + TRUE, 0xffffffff, 0xffffffff, FALSE), + HOWTO(R_386_TLS_LE_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_386_TLS_LE_32", - true, 0xffffffff, 0xffffffff, false), - HOWTO(R_386_TLS_DTPMOD32, 0, 2, 32, false, 0, complain_overflow_bitfield, + TRUE, 0xffffffff, 0xffffffff, FALSE), + HOWTO(R_386_TLS_DTPMOD32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_386_TLS_DTPMOD32", - true, 0xffffffff, 0xffffffff, false), - HOWTO(R_386_TLS_DTPOFF32, 0, 2, 32, false, 0, complain_overflow_bitfield, + TRUE, 0xffffffff, 0xffffffff, FALSE), + HOWTO(R_386_TLS_DTPOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_386_TLS_DTPOFF32", - true, 0xffffffff, 0xffffffff, false), - HOWTO(R_386_TLS_TPOFF32, 0, 2, 32, false, 0, complain_overflow_bitfield, + TRUE, 0xffffffff, 0xffffffff, FALSE), + HOWTO(R_386_TLS_TPOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_386_TLS_TPOFF32", - true, 0xffffffff, 0xffffffff, false), + TRUE, 0xffffffff, 0xffffffff, FALSE), /* Another gap. */ -#define R_386_tls ((unsigned int) R_386_TLS_TPOFF32 + 1 - R_386_tls_offset) -#define R_386_vt_offset ((unsigned int) R_386_GNU_VTINHERIT - R_386_tls) +#define R_386_tls (R_386_TLS_TPOFF32 + 1 - R_386_tls_offset) +#define R_386_vt_offset (R_386_GNU_VTINHERIT - R_386_tls) /* GNU extension to record C++ vtable hierarchy. */ HOWTO (R_386_GNU_VTINHERIT, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ NULL, /* special_function */ "R_386_GNU_VTINHERIT", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* GNU extension to record C++ vtable member usage. */ HOWTO (R_386_GNU_VTENTRY, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ _bfd_elf_rel_vtable_reloc_fn, /* special_function */ "R_386_GNU_VTENTRY", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false) /* pcrel_offset */ + FALSE) /* pcrel_offset */ -#define R_386_vt ((unsigned int) R_386_GNU_VTENTRY + 1 - R_386_vt_offset) +#define R_386_vt (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) +#define TRACE(str) \ + fprintf (stderr, "i386 bfd reloc lookup %d (%s)\n", code, str) #else #define TRACE(str) #endif static reloc_howto_type * -elf_i386_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; +elf_i386_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) { switch (code) { case BFD_RELOC_NONE: TRACE ("BFD_RELOC_NONE"); - return &elf_howto_table[(unsigned int) R_386_NONE ]; + return &elf_howto_table[R_386_NONE]; case BFD_RELOC_32: TRACE ("BFD_RELOC_32"); - return &elf_howto_table[(unsigned int) R_386_32 ]; + return &elf_howto_table[R_386_32]; case BFD_RELOC_CTOR: TRACE ("BFD_RELOC_CTOR"); - return &elf_howto_table[(unsigned int) R_386_32 ]; + return &elf_howto_table[R_386_32]; case BFD_RELOC_32_PCREL: TRACE ("BFD_RELOC_PC32"); - return &elf_howto_table[(unsigned int) R_386_PC32 ]; + return &elf_howto_table[R_386_PC32]; case BFD_RELOC_386_GOT32: TRACE ("BFD_RELOC_386_GOT32"); - return &elf_howto_table[(unsigned int) R_386_GOT32 ]; + return &elf_howto_table[R_386_GOT32]; case BFD_RELOC_386_PLT32: TRACE ("BFD_RELOC_386_PLT32"); - return &elf_howto_table[(unsigned int) R_386_PLT32 ]; + return &elf_howto_table[R_386_PLT32]; case BFD_RELOC_386_COPY: TRACE ("BFD_RELOC_386_COPY"); - return &elf_howto_table[(unsigned int) R_386_COPY ]; + return &elf_howto_table[R_386_COPY]; case BFD_RELOC_386_GLOB_DAT: TRACE ("BFD_RELOC_386_GLOB_DAT"); - return &elf_howto_table[(unsigned int) R_386_GLOB_DAT ]; + return &elf_howto_table[R_386_GLOB_DAT]; case BFD_RELOC_386_JUMP_SLOT: TRACE ("BFD_RELOC_386_JUMP_SLOT"); - return &elf_howto_table[(unsigned int) R_386_JUMP_SLOT ]; + return &elf_howto_table[R_386_JUMP_SLOT]; case BFD_RELOC_386_RELATIVE: TRACE ("BFD_RELOC_386_RELATIVE"); - return &elf_howto_table[(unsigned int) R_386_RELATIVE ]; + return &elf_howto_table[R_386_RELATIVE]; case BFD_RELOC_386_GOTOFF: TRACE ("BFD_RELOC_386_GOTOFF"); - return &elf_howto_table[(unsigned int) R_386_GOTOFF ]; + return &elf_howto_table[R_386_GOTOFF]; case BFD_RELOC_386_GOTPC: TRACE ("BFD_RELOC_386_GOTPC"); - return &elf_howto_table[(unsigned int) R_386_GOTPC ]; + return &elf_howto_table[R_386_GOTPC]; /* These relocs are a GNU extension. */ case BFD_RELOC_386_TLS_TPOFF: TRACE ("BFD_RELOC_386_TLS_TPOFF"); - return &elf_howto_table[(unsigned int) R_386_TLS_TPOFF - R_386_ext_offset]; + return &elf_howto_table[R_386_TLS_TPOFF - R_386_ext_offset]; case BFD_RELOC_386_TLS_IE: TRACE ("BFD_RELOC_386_TLS_IE"); - return &elf_howto_table[(unsigned int) R_386_TLS_IE - R_386_ext_offset]; + return &elf_howto_table[R_386_TLS_IE - R_386_ext_offset]; case BFD_RELOC_386_TLS_GOTIE: TRACE ("BFD_RELOC_386_TLS_GOTIE"); - return &elf_howto_table[(unsigned int) R_386_TLS_GOTIE - R_386_ext_offset]; + return &elf_howto_table[R_386_TLS_GOTIE - R_386_ext_offset]; case BFD_RELOC_386_TLS_LE: TRACE ("BFD_RELOC_386_TLS_LE"); - return &elf_howto_table[(unsigned int) R_386_TLS_LE - R_386_ext_offset]; + return &elf_howto_table[R_386_TLS_LE - R_386_ext_offset]; case BFD_RELOC_386_TLS_GD: TRACE ("BFD_RELOC_386_TLS_GD"); - return &elf_howto_table[(unsigned int) R_386_TLS_GD - R_386_ext_offset]; + return &elf_howto_table[R_386_TLS_GD - R_386_ext_offset]; case BFD_RELOC_386_TLS_LDM: TRACE ("BFD_RELOC_386_TLS_LDM"); - return &elf_howto_table[(unsigned int) R_386_TLS_LDM - R_386_ext_offset]; + return &elf_howto_table[R_386_TLS_LDM - R_386_ext_offset]; case BFD_RELOC_16: TRACE ("BFD_RELOC_16"); - return &elf_howto_table[(unsigned int) R_386_16 - R_386_ext_offset]; + return &elf_howto_table[R_386_16 - R_386_ext_offset]; case BFD_RELOC_16_PCREL: TRACE ("BFD_RELOC_16_PCREL"); - return &elf_howto_table[(unsigned int) R_386_PC16 - R_386_ext_offset]; + return &elf_howto_table[R_386_PC16 - R_386_ext_offset]; case BFD_RELOC_8: TRACE ("BFD_RELOC_8"); - return &elf_howto_table[(unsigned int) R_386_8 - R_386_ext_offset]; + return &elf_howto_table[R_386_8 - R_386_ext_offset]; case BFD_RELOC_8_PCREL: TRACE ("BFD_RELOC_8_PCREL"); - return &elf_howto_table[(unsigned int) R_386_PC8 - R_386_ext_offset]; + return &elf_howto_table[R_386_PC8 - R_386_ext_offset]; /* Common with Sun TLS implementation. */ case BFD_RELOC_386_TLS_LDO_32: TRACE ("BFD_RELOC_386_TLS_LDO_32"); - return &elf_howto_table[(unsigned int) R_386_TLS_LDO_32 - R_386_tls_offset]; + return &elf_howto_table[R_386_TLS_LDO_32 - R_386_tls_offset]; case BFD_RELOC_386_TLS_IE_32: TRACE ("BFD_RELOC_386_TLS_IE_32"); - return &elf_howto_table[(unsigned int) R_386_TLS_IE_32 - R_386_tls_offset]; + return &elf_howto_table[R_386_TLS_IE_32 - R_386_tls_offset]; case BFD_RELOC_386_TLS_LE_32: TRACE ("BFD_RELOC_386_TLS_LE_32"); - return &elf_howto_table[(unsigned int) R_386_TLS_LE_32 - R_386_tls_offset]; + return &elf_howto_table[R_386_TLS_LE_32 - R_386_tls_offset]; case BFD_RELOC_386_TLS_DTPMOD32: TRACE ("BFD_RELOC_386_TLS_DTPMOD32"); - return &elf_howto_table[(unsigned int) R_386_TLS_DTPMOD32 - R_386_tls_offset]; + return &elf_howto_table[R_386_TLS_DTPMOD32 - R_386_tls_offset]; case BFD_RELOC_386_TLS_DTPOFF32: TRACE ("BFD_RELOC_386_TLS_DTPOFF32"); - return &elf_howto_table[(unsigned int) R_386_TLS_DTPOFF32 - R_386_tls_offset]; + return &elf_howto_table[R_386_TLS_DTPOFF32 - R_386_tls_offset]; case BFD_RELOC_386_TLS_TPOFF32: TRACE ("BFD_RELOC_386_TLS_TPOFF32"); - return &elf_howto_table[(unsigned int) R_386_TLS_TPOFF32 - R_386_tls_offset]; + return &elf_howto_table[R_386_TLS_TPOFF32 - R_386_tls_offset]; case BFD_RELOC_VTABLE_INHERIT: TRACE ("BFD_RELOC_VTABLE_INHERIT"); - return &elf_howto_table[(unsigned int) R_386_GNU_VTINHERIT - - R_386_vt_offset]; + return &elf_howto_table[R_386_GNU_VTINHERIT - R_386_vt_offset]; case BFD_RELOC_VTABLE_ENTRY: TRACE ("BFD_RELOC_VTABLE_ENTRY"); - return &elf_howto_table[(unsigned int) R_386_GNU_VTENTRY - - R_386_vt_offset]; + return &elf_howto_table[R_386_GNU_VTENTRY - R_386_vt_offset]; default: break; @@ -373,19 +308,9 @@ elf_i386_reloc_type_lookup (abfd, code) } static void -elf_i386_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr ATTRIBUTE_UNUSED; - Elf32_Internal_Rela *dst ATTRIBUTE_UNUSED; -{ - abort (); -} - -static void -elf_i386_info_to_howto_rel (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr; - Elf32_Internal_Rel *dst; +elf_i386_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED, + arelent *cache_ptr, + Elf_Internal_Rela *dst) { unsigned int r_type = ELF32_R_TYPE (dst->r_info); unsigned int indx; @@ -400,7 +325,7 @@ elf_i386_info_to_howto_rel (abfd, cache_ptr, dst) { (*_bfd_error_handler) (_("%s: invalid relocation type %d"), bfd_archive_filename (abfd), (int) r_type); - indx = (unsigned int) R_386_NONE; + indx = R_386_NONE; } cache_ptr->howto = &elf_howto_table[indx]; } @@ -411,43 +336,60 @@ elf_i386_info_to_howto_rel (abfd, cache_ptr, dst) If so, we should move the .X recognition into _bfd_elf_is_local_label_name. */ -static boolean -elf_i386_is_local_label_name (abfd, name) - bfd *abfd; - const char *name; +static bfd_boolean +elf_i386_is_local_label_name (bfd *abfd, const char *name) { if (name[0] == '.' && name[1] == 'X') - return true; + return TRUE; return _bfd_elf_is_local_label_name (abfd, name); } /* Support for core dump NOTE sections. */ -static boolean -elf_i386_grok_prstatus (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; + +static bfd_boolean +elf_i386_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) { int offset; size_t raw_size; - switch (note->descsz) + if (note->namesz == 8 && strcmp (note->namedata, "FreeBSD") == 0) { - default: - return false; + int pr_version = bfd_get_32 (abfd, note->descdata); - case 144: /* Linux/i386 */ - /* pr_cursig */ - elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); + if (pr_version != 1) + return FALSE; - /* pr_pid */ - elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24); + /* pr_cursig */ + elf_tdata (abfd)->core_signal = bfd_get_32 (abfd, note->descdata + 20); - /* pr_reg */ - offset = 72; - raw_size = 68; + /* pr_pid */ + elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24); - break; + /* pr_reg */ + offset = 28; + raw_size = bfd_get_32 (abfd, note->descdata + 8); + } + else + { + switch (note->descsz) + { + default: + return FALSE; + + case 144: /* Linux/i386 */ + /* pr_cursig */ + elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); + + /* pr_pid */ + elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24); + + /* pr_reg */ + offset = 72; + raw_size = 68; + + break; + } } /* Make a ".reg/999" section. */ @@ -455,27 +397,39 @@ elf_i386_grok_prstatus (abfd, note) raw_size, note->descpos + offset); } -static boolean -elf_i386_grok_psinfo (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +static bfd_boolean +elf_i386_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) { - switch (note->descsz) + if (note->namesz == 8 && strcmp (note->namedata, "FreeBSD") == 0) + { + int pr_version = bfd_get_32 (abfd, note->descdata); + + if (pr_version != 1) + return FALSE; + + elf_tdata (abfd)->core_program + = _bfd_elfcore_strndup (abfd, note->descdata + 8, 17); + elf_tdata (abfd)->core_command + = _bfd_elfcore_strndup (abfd, note->descdata + 25, 81); + } + else { - default: - return false; - - case 124: /* Linux/i386 elf_prpsinfo */ - elf_tdata (abfd)->core_program - = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16); - elf_tdata (abfd)->core_command - = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80); + switch (note->descsz) + { + default: + return FALSE; + + case 124: /* Linux/i386 elf_prpsinfo. */ + elf_tdata (abfd)->core_program + = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16); + elf_tdata (abfd)->core_command + = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80); + } } /* Note that for some reason, a spurious space is tacked onto the end of the args in some (at least one anyway) implementations, so strip it off if it exists. */ - { char *command = elf_tdata (abfd)->core_command; int n = strlen (command); @@ -484,7 +438,7 @@ elf_i386_grok_psinfo (abfd, note) command[n - 1] = '\0'; } - return true; + return TRUE; } /* Functions for the i386 ELF linker. @@ -506,6 +460,12 @@ elf_i386_grok_psinfo (abfd, note) #define ELF_DYNAMIC_INTERPRETER "/usr/lib/libc.so.1" +/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid + copying dynamic variables from a shared lib into an app's dynbss + section, and instead use a dynamic relocation to point into the + shared lib. */ +#define ELIMINATE_COPY_RELOCS 1 + /* The size in bytes of an entry in the procedure linkage table. */ #define PLT_ENTRY_SIZE 16 @@ -611,30 +571,14 @@ struct elf_i386_obj_tdata #define elf_i386_local_got_tls_type(abfd) \ (elf_i386_tdata (abfd)->local_got_tls_type) -static boolean -elf_i386_mkobject (abfd) - bfd *abfd; +static bfd_boolean +elf_i386_mkobject (bfd *abfd) { bfd_size_type amt = sizeof (struct elf_i386_obj_tdata); abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return false; - return true; -} - -static boolean -elf_i386_object_p (abfd) - bfd *abfd; -{ - /* Allocate our special target data. */ - struct elf_i386_obj_tdata *new_tdata; - bfd_size_type amt = sizeof (struct elf_i386_obj_tdata); - new_tdata = bfd_zalloc (abfd, amt); - if (new_tdata == NULL) - return false; - new_tdata->root = *abfd->tdata.elf_obj_data; - abfd->tdata.any = new_tdata; - return true; + return FALSE; + return TRUE; } /* i386 ELF linker hash table. */ @@ -669,10 +613,9 @@ struct elf_i386_link_hash_table /* Create an entry in an i386 ELF linker hash table. */ static struct bfd_hash_entry * -link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ @@ -701,13 +644,12 @@ link_hash_newfunc (entry, table, string) /* Create an i386 ELF linker hash table. */ static struct bfd_link_hash_table * -elf_i386_link_hash_table_create (abfd) - bfd *abfd; +elf_i386_link_hash_table_create (bfd *abfd) { struct elf_i386_link_hash_table *ret; bfd_size_type amt = sizeof (struct elf_i386_link_hash_table); - ret = (struct elf_i386_link_hash_table *) bfd_malloc (amt); + ret = bfd_malloc (amt); if (ret == NULL) return NULL; @@ -733,15 +675,13 @@ elf_i386_link_hash_table_create (abfd) /* Create .got, .gotplt, and .rel.got sections in DYNOBJ, and set up shortcuts to them in our hash table. */ -static boolean -create_got_section (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; +static bfd_boolean +create_got_section (bfd *dynobj, struct bfd_link_info *info) { struct elf_i386_link_hash_table *htab; if (! _bfd_elf_create_got_section (dynobj, info)) - return false; + return FALSE; htab = elf_i386_hash_table (info); htab->sgot = bfd_get_section_by_name (dynobj, ".got"); @@ -756,27 +696,25 @@ create_got_section (dynobj, info) | SEC_IN_MEMORY | SEC_LINKER_CREATED | SEC_READONLY)) || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2)) - return false; - return true; + return FALSE; + return TRUE; } /* Create .plt, .rel.plt, .got, .got.plt, .rel.got, .dynbss, and .rel.bss sections in DYNOBJ, and set up shortcuts to them in our hash table. */ -static boolean -elf_i386_create_dynamic_sections (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; +static bfd_boolean +elf_i386_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) { struct elf_i386_link_hash_table *htab; htab = elf_i386_hash_table (info); if (!htab->sgot && !create_got_section (dynobj, info)) - return false; + return FALSE; if (!_bfd_elf_create_dynamic_sections (dynobj, info)) - return false; + return FALSE; htab->splt = bfd_get_section_by_name (dynobj, ".plt"); htab->srelplt = bfd_get_section_by_name (dynobj, ".rel.plt"); @@ -788,15 +726,15 @@ elf_i386_create_dynamic_sections (dynobj, info) || (!info->shared && !htab->srelbss)) abort (); - return true; + return TRUE; } /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf_i386_copy_indirect_symbol (bed, dir, ind) - struct elf_backend_data *bed; - struct elf_link_hash_entry *dir, *ind; +elf_i386_copy_indirect_symbol (const struct elf_backend_data *bed, + struct elf_link_hash_entry *dir, + struct elf_link_hash_entry *ind) { struct elf_i386_link_hash_entry *edir, *eind; @@ -843,14 +781,25 @@ elf_i386_copy_indirect_symbol (bed, dir, ind) edir->tls_type = eind->tls_type; eind->tls_type = GOT_UNKNOWN; } - _bfd_elf_link_hash_copy_indirect (bed, dir, ind); + + if (ELIMINATE_COPY_RELOCS + && ind->root.type != bfd_link_hash_indirect + && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) + /* If called to transfer flags for a weakdef during processing + of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF. + We clear it ourselves for ELIMINATE_COPY_RELOCS. */ + dir->elf_link_hash_flags |= + (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK + | ELF_LINK_HASH_NEEDS_PLT + | ELF_LINK_POINTER_EQUALITY_NEEDED)); + else + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); } static int -elf_i386_tls_transition (info, r_type, is_local) - struct bfd_link_info *info; - int r_type; - int is_local; +elf_i386_tls_transition (struct bfd_link_info *info, int r_type, int is_local) { if (info->shared) return r_type; @@ -878,12 +827,11 @@ elf_i386_tls_transition (info, r_type, is_local) calculate needed space in the global offset table, procedure linkage table, and dynamic reloc sections. */ -static boolean -elf_i386_check_relocs (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +static bfd_boolean +elf_i386_check_relocs (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) { struct elf_i386_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; @@ -892,8 +840,8 @@ elf_i386_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel_end; asection *sreloc; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; htab = elf_i386_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -916,7 +864,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) (*_bfd_error_handler) (_("%s: bad symbol index: %d"), bfd_archive_filename (abfd), r_symndx); - return false; + return FALSE; } if (r_symndx < symtab_hdr->sh_info) @@ -997,10 +945,9 @@ elf_i386_check_relocs (abfd, info, sec, relocs) size = symtab_hdr->sh_info; size *= (sizeof (bfd_signed_vma) + sizeof(char)); - local_got_refcounts = ((bfd_signed_vma *) - bfd_zalloc (abfd, size)); + local_got_refcounts = bfd_zalloc (abfd, size); if (local_got_refcounts == NULL) - return false; + return FALSE; elf_local_got_refcounts (abfd) = local_got_refcounts; elf_i386_local_got_tls_type (abfd) = (char *) (local_got_refcounts + symtab_hdr->sh_info); @@ -1022,10 +969,11 @@ elf_i386_check_relocs (abfd, info, sec, relocs) else { (*_bfd_error_handler) - (_("%s: `%s' accessed both as normal and thread local symbol"), + (_("%s: `%s' accessed both as normal and " + "thread local symbol"), bfd_archive_filename (abfd), h ? h->root.root.string : ""); - return false; + return FALSE; } } @@ -1047,7 +995,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) if (htab->elf.dynobj == NULL) htab->elf.dynobj = abfd; if (!create_got_section (htab->elf.dynobj, info)) - return false; + return FALSE; } if (r_type != R_386_TLS_IE) break; @@ -1057,7 +1005,8 @@ elf_i386_check_relocs (abfd, info, sec, relocs) case R_386_TLS_LE: if (!info->shared) break; - /* Fall through */ + info->flags |= DF_STATIC_TLS; + /* Fall through */ case R_386_32: case R_386_PC32: @@ -1074,6 +1023,8 @@ elf_i386_check_relocs (abfd, info, sec, relocs) /* We may need a .plt entry if the function this reloc refers to is in a shared lib. */ h->plt.refcount += 1; + if (r_type != R_386_PC32) + h->elf_link_hash_flags |= ELF_LINK_POINTER_EQUALITY_NEEDED; } /* If we are creating a shared library, and this is a reloc @@ -1105,7 +1056,8 @@ elf_i386_check_relocs (abfd, info, sec, relocs) || h->root.type == bfd_link_hash_defweak || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared + || (ELIMINATE_COPY_RELOCS + && !info->shared && (sec->flags & SEC_ALLOC) != 0 && h != NULL && (h->root.type == bfd_link_hash_defweak @@ -1127,7 +1079,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) name = bfd_elf_string_from_elf_section (abfd, strndx, shnam); if (name == NULL) - return false; + return FALSE; if (strncmp (name, ".rel", 4) != 0 || strcmp (bfd_get_section_name (abfd, sec), @@ -1155,7 +1107,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) if (sreloc == NULL || ! bfd_set_section_flags (dynobj, sreloc, flags) || ! bfd_set_section_alignment (dynobj, sreloc, 2)) - return false; + return FALSE; } elf_section_data (sec)->sreloc = sreloc; } @@ -1176,7 +1128,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, sec, r_symndx); if (s == NULL) - return false; + return FALSE; head = ((struct elf_i386_dyn_relocs **) &elf_section_data (s)->local_dynrel); @@ -1186,10 +1138,9 @@ elf_i386_check_relocs (abfd, info, sec, relocs) if (p == NULL || p->sec != sec) { bfd_size_type amt = sizeof *p; - p = ((struct elf_i386_dyn_relocs *) - bfd_alloc (htab->elf.dynobj, amt)); + p = bfd_alloc (htab->elf.dynobj, amt); if (p == NULL) - return false; + return FALSE; p->next = *head; *head = p; p->sec = sec; @@ -1206,15 +1157,15 @@ elf_i386_check_relocs (abfd, info, sec, relocs) /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ case R_386_GNU_VTINHERIT: - if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) - return false; + if (!bfd_elf_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_386_GNU_VTENTRY: - if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_offset)) - return false; + if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_offset)) + return FALSE; break; default: @@ -1222,19 +1173,18 @@ elf_i386_check_relocs (abfd, info, sec, relocs) } } - return true; + return TRUE; } /* Return the section that should be marked against GC for a given relocation. */ static asection * -elf_i386_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf_i386_gc_mark_hook (asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) { @@ -1267,20 +1217,16 @@ elf_i386_gc_mark_hook (sec, info, rel, h, sym) /* Update the got entry reference counts for the section being removed. */ -static boolean -elf_i386_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +static bfd_boolean +elf_i386_gc_sweep_hook (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; bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; - unsigned long r_symndx; - int r_type; - struct elf_link_hash_entry *h; elf_section_data (sec)->local_dynrel = NULL; @@ -1290,87 +1236,76 @@ elf_i386_gc_sweep_hook (abfd, info, sec, relocs) relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) - switch ((r_type = elf_i386_tls_transition (info, - ELF32_R_TYPE (rel->r_info), - ELF32_R_SYM (rel->r_info) - >= symtab_hdr->sh_info))) - { - case R_386_TLS_LDM: - if (elf_i386_hash_table (info)->tls_ldm_got.refcount > 0) - elf_i386_hash_table (info)->tls_ldm_got.refcount -= 1; - break; - - case R_386_TLS_GD: - case R_386_TLS_IE_32: - case R_386_TLS_IE: - case R_386_TLS_GOTIE: - case R_386_GOT32: - 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; - } - else if (local_got_refcounts != NULL) - { - if (local_got_refcounts[r_symndx] > 0) - local_got_refcounts[r_symndx] -= 1; - } - if (r_type != R_386_TLS_IE) - break; - /* Fall through */ + { + unsigned long r_symndx; + unsigned int r_type; + struct elf_link_hash_entry *h = NULL; - case R_386_TLS_LE_32: - case R_386_TLS_LE: - if (!info->shared) - break; - /* Fall through */ + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf_i386_link_hash_entry *eh; + struct elf_i386_dyn_relocs **pp; + struct elf_i386_dyn_relocs *p; - case R_386_32: - case R_386_PC32: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - struct elf_i386_link_hash_entry *eh; - struct elf_i386_dyn_relocs **pp; - struct elf_i386_dyn_relocs *p; + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct elf_i386_link_hash_entry *) h; - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } + } - if (!info->shared && h->plt.refcount > 0) - h->plt.refcount -= 1; + r_type = ELF32_R_TYPE (rel->r_info); + r_type = elf_i386_tls_transition (info, r_type, h != NULL); + switch (r_type) + { + case R_386_TLS_LDM: + if (elf_i386_hash_table (info)->tls_ldm_got.refcount > 0) + elf_i386_hash_table (info)->tls_ldm_got.refcount -= 1; + break; - eh = (struct elf_i386_link_hash_entry *) h; + case R_386_TLS_GD: + case R_386_TLS_IE_32: + case R_386_TLS_IE: + case R_386_TLS_GOTIE: + case R_386_GOT32: + if (h != NULL) + { + if (h->got.refcount > 0) + h->got.refcount -= 1; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx] -= 1; + } + break; - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { - if (ELF32_R_TYPE (rel->r_info) == R_386_PC32) - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } - } - break; + case R_386_32: + case R_386_PC32: + if (info->shared) + break; + /* Fall through */ - 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; + case R_386_PLT32: + if (h != NULL) + { + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; - default: - break; - } + default: + break; + } + } - return true; + return TRUE; } /* Adjust a symbol defined by a dynamic object and referenced by a @@ -1379,14 +1314,11 @@ elf_i386_gc_sweep_hook (abfd, info, sec, relocs) change the definition to something the rest of the link can understand. */ -static boolean -elf_i386_adjust_dynamic_symbol (info, h) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; +static bfd_boolean +elf_i386_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) { struct elf_i386_link_hash_table *htab; - struct elf_i386_link_hash_entry * eh; - struct elf_i386_dyn_relocs *p; asection *s; unsigned int power_of_two; @@ -1397,11 +1329,9 @@ elf_i386_adjust_dynamic_symbol (info, h) || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { if (h->plt.refcount <= 0 - || (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0 - && h->root.type != bfd_link_hash_undefweak - && h->root.type != bfd_link_hash_undefined)) + || SYMBOL_CALLS_LOCAL (info, h) + || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak)) { /* This case can occur if we saw a PLT32 reloc in an input file, but the symbol was never referred to by a dynamic @@ -1412,7 +1342,7 @@ elf_i386_adjust_dynamic_symbol (info, h) h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; } - return true; + return TRUE; } else /* It's possible that we incorrectly decided a .plt reloc was @@ -1431,7 +1361,11 @@ elf_i386_adjust_dynamic_symbol (info, h) || 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 (ELIMINATE_COPY_RELOCS || info->nocopyreloc) + h->elf_link_hash_flags + = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF) + | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF)); + return TRUE; } /* This is a reference to a symbol defined by a dynamic object which @@ -1442,34 +1376,40 @@ elf_i386_adjust_dynamic_symbol (info, h) For such cases we need not do anything here; the relocations will be handled correctly by relocate_section. */ if (info->shared) - return true; + 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; + return TRUE; /* If -z nocopyreloc was given, we won't generate them either. */ if (info->nocopyreloc) { h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - return true; + return TRUE; } - eh = (struct elf_i386_link_hash_entry *) h; - for (p = eh->dyn_relocs; p != NULL; p = p->next) + if (ELIMINATE_COPY_RELOCS) { - s = p->sec->output_section; - if (s != NULL && (s->flags & SEC_READONLY) != 0) - break; - } + struct elf_i386_link_hash_entry * eh; + struct elf_i386_dyn_relocs *p; - /* If we didn't find any dynamic relocs in read-only sections, then - we'll be keeping the dynamic relocs and avoiding the copy reloc. */ - if (p == NULL) - { - h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - return true; + eh = (struct elf_i386_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + break; + } + + /* If we didn't find any dynamic relocs in read-only sections, then + we'll be keeping the dynamic relocs and avoiding the copy reloc. */ + if (p == NULL) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return TRUE; + } } /* We must allocate the symbol in our .dynbss section, which will @@ -1505,7 +1445,7 @@ elf_i386_adjust_dynamic_symbol (info, h) if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) { if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return false; + return FALSE; } /* Define the symbol as being at this point in the section. */ @@ -1515,27 +1455,14 @@ elf_i386_adjust_dynamic_symbol (info, h) /* Increment the section size to make room for the symbol. */ s->_raw_size += h->size; - return true; + return TRUE; } -/* This is the condition under which elf_i386_finish_dynamic_symbol - will be called from elflink.h. If elflink.h doesn't call our - finish_dynamic_symbol routine, we'll need to do something about - initializing any .plt and .got entries in elf_i386_relocate_section. */ -#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ - ((DYN) \ - && ((INFO)->shared \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ - && ((H)->dynindx != -1 \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) - /* Allocate space in .plt, .got and associated reloc sections for dynamic relocs. */ -static boolean -allocate_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +static bfd_boolean +allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct bfd_link_info *info; struct elf_i386_link_hash_table *htab; @@ -1543,7 +1470,7 @@ allocate_dynrelocs (h, inf) struct elf_i386_dyn_relocs *p; if (h->root.type == bfd_link_hash_indirect) - return true; + return TRUE; if (h->root.type == bfd_link_hash_warning) /* When warning symbols are created, they **replace** the "real" @@ -1562,11 +1489,12 @@ allocate_dynrelocs (h, inf) 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; + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) + if (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) { asection *s = htab->splt; @@ -1621,7 +1549,7 @@ allocate_dynrelocs (h, inf) else if (h->got.refcount > 0) { asection *s; - boolean dyn; + bfd_boolean dyn; int tls_type = elf_i386_hash_entry(h)->tls_type; /* Make sure this symbol is output as a dynamic symbol. @@ -1629,8 +1557,8 @@ allocate_dynrelocs (h, inf) 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; + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } s = htab->sgot; @@ -1652,7 +1580,10 @@ allocate_dynrelocs (h, inf) htab->srelgot->_raw_size += sizeof (Elf32_External_Rel); else if (tls_type == GOT_TLS_GD) htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rel); - else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) + else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))) htab->srelgot->_raw_size += sizeof (Elf32_External_Rel); } else @@ -1660,7 +1591,7 @@ allocate_dynrelocs (h, inf) eh = (struct elf_i386_link_hash_entry *) h; if (eh->dyn_relocs == NULL) - return true; + return TRUE; /* In the shared -Bsymbolic case, discard space allocated for dynamic pc-relative relocs against symbols which turn out to be @@ -1670,9 +1601,13 @@ allocate_dynrelocs (h, inf) if (info->shared) { - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 - && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 - || info->symbolic)) + /* The only reloc that uses pc_count is R_386_PC32, which will + appear on a call or on something like ".long foo - .". We + want calls to protected symbols to resolve directly to the + function rather than going via the plt. If people want + function pointer comparisons to work as expected then they + should avoid writing assembly like ".long foo - .". */ + if (SYMBOL_CALLS_LOCAL (info, h)) { struct elf_i386_dyn_relocs **pp; @@ -1686,8 +1621,14 @@ allocate_dynrelocs (h, inf) pp = &p->next; } } + + /* Also discard relocs on undefined weak syms with non-default + visibility. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + eh->dyn_relocs = NULL; } - else + else if (ELIMINATE_COPY_RELOCS) { /* For the non-shared case, discard space for relocs against symbols which turn out to need copy relocs or are not @@ -1705,8 +1646,8 @@ allocate_dynrelocs (h, inf) 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; + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } /* If that succeeded, we know we'll be keeping all the @@ -1727,15 +1668,13 @@ allocate_dynrelocs (h, inf) sreloc->_raw_size += p->count * sizeof (Elf32_External_Rel); } - return true; + return TRUE; } /* Find any dynamic relocs that apply to read-only sections. */ -static boolean -readonly_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +static bfd_boolean +readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct elf_i386_link_hash_entry *eh; struct elf_i386_dyn_relocs *p; @@ -1755,23 +1694,22 @@ readonly_dynrelocs (h, inf) info->flags |= DF_TEXTREL; /* Not an error, just cut short the traversal. */ - return false; + return FALSE; } } - return true; + return TRUE; } /* Set the sizes of the dynamic sections. */ -static boolean -elf_i386_size_dynamic_sections (output_bfd, info) - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; +static bfd_boolean +elf_i386_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) { struct elf_i386_link_hash_table *htab; bfd *dynobj; asection *s; - boolean relocs; + bfd_boolean relocs; bfd *ibfd; htab = elf_i386_hash_table (info); @@ -1782,7 +1720,7 @@ elf_i386_size_dynamic_sections (output_bfd, info) if (htab->elf.dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); if (s == NULL) @@ -1884,7 +1822,7 @@ elf_i386_size_dynamic_sections (output_bfd, info) /* We now have determined the sizes of the various dynamic sections. Allocate memory for them. */ - relocs = false; + relocs = FALSE; for (s = dynobj->sections; s != NULL; s = s->next) { if ((s->flags & SEC_LINKER_CREATED) == 0) @@ -1900,7 +1838,7 @@ elf_i386_size_dynamic_sections (output_bfd, info) else if (strncmp (bfd_get_section_name (dynobj, s), ".rel", 4) == 0) { if (s->_raw_size != 0 && s != htab->srelplt) - relocs = true; + relocs = TRUE; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -1933,9 +1871,9 @@ elf_i386_size_dynamic_sections (output_bfd, info) 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); + s->contents = bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL) - return false; + return FALSE; } if (htab->elf.dynamic_sections_created) @@ -1946,12 +1884,12 @@ elf_i386_size_dynamic_sections (output_bfd, info) the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ #define add_dynamic_entry(TAG, VAL) \ - bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + _bfd_elf_add_dynamic_entry (info, TAG, VAL) - if (! info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) - return false; + return FALSE; } if (htab->splt->_raw_size != 0) @@ -1960,7 +1898,7 @@ elf_i386_size_dynamic_sections (output_bfd, info) || !add_dynamic_entry (DT_PLTRELSZ, 0) || !add_dynamic_entry (DT_PLTREL, DT_REL) || !add_dynamic_entry (DT_JMPREL, 0)) - return false; + return FALSE; } if (relocs) @@ -1968,7 +1906,7 @@ elf_i386_size_dynamic_sections (output_bfd, info) if (!add_dynamic_entry (DT_REL, 0) || !add_dynamic_entry (DT_RELSZ, 0) || !add_dynamic_entry (DT_RELENT, sizeof (Elf32_External_Rel))) - return false; + return FALSE; /* If any dynamic relocs apply to a read-only section, then we need a DT_TEXTREL entry. */ @@ -1979,23 +1917,22 @@ elf_i386_size_dynamic_sections (output_bfd, info) if ((info->flags & DF_TEXTREL) != 0) { if (!add_dynamic_entry (DT_TEXTREL, 0)) - return false; + return FALSE; } } } #undef add_dynamic_entry - return true; + return TRUE; } /* Set the correct type for an x86 ELF section. We do this by the section name, which is a hack, but ought to work. */ -static boolean -elf_i386_fake_sections (abfd, hdr, sec) - bfd *abfd ATTRIBUTE_UNUSED; - Elf32_Internal_Shdr *hdr; - asection *sec; +static bfd_boolean +elf_i386_fake_sections (bfd *abfd ATTRIBUTE_UNUSED, + Elf_Internal_Shdr *hdr, + asection *sec) { register const char *name; @@ -2020,7 +1957,7 @@ elf_i386_fake_sections (abfd, hdr, sec) if (strcmp (name, ".reloc") == 0) hdr->sh_type = SHT_PROGBITS; - return true; + return TRUE; } /* Return the base VMA address which should be subtracted from real addresses @@ -2028,46 +1965,39 @@ elf_i386_fake_sections (abfd, hdr, sec) This is PT_TLS segment p_vaddr. */ static bfd_vma -dtpoff_base (info) - struct bfd_link_info *info; +dtpoff_base (struct bfd_link_info *info) { - /* If tls_segment is NULL, we should have signalled an error already. */ - if (elf_hash_table (info)->tls_segment == NULL) + /* If tls_sec is NULL, we should have signalled an error already. */ + if (elf_hash_table (info)->tls_sec == NULL) return 0; - return elf_hash_table (info)->tls_segment->start; + return elf_hash_table (info)->tls_sec->vma; } /* Return the relocation value for @tpoff relocation if STT_TLS virtual address is ADDRESS. */ static bfd_vma -tpoff (info, address) - struct bfd_link_info *info; - bfd_vma address; +tpoff (struct bfd_link_info *info, bfd_vma address) { - struct elf_link_tls_segment *tls_segment - = elf_hash_table (info)->tls_segment; + struct elf_link_hash_table *htab = elf_hash_table (info); - /* If tls_segment is NULL, we should have signalled an error already. */ - if (tls_segment == NULL) + /* If tls_sec is NULL, we should have signalled an error already. */ + if (htab->tls_sec == NULL) return 0; - return (align_power (tls_segment->size, tls_segment->align) - + tls_segment->start - address); + return htab->tls_size + htab->tls_sec->vma - address; } /* Relocate an i386 ELF section. */ -static boolean -elf_i386_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; +static bfd_boolean +elf_i386_relocate_section (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 elf_i386_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; @@ -2093,30 +2023,30 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, asection *sec; bfd_vma off; bfd_vma relocation; - boolean unresolved_reloc; + bfd_boolean unresolved_reloc; bfd_reloc_status_type r; unsigned int indx; int tls_type; r_type = ELF32_R_TYPE (rel->r_info); - if (r_type == (int) R_386_GNU_VTINHERIT - || r_type == (int) R_386_GNU_VTENTRY) + if (r_type == R_386_GNU_VTINHERIT + || r_type == R_386_GNU_VTENTRY) continue; - if ((indx = (unsigned) r_type) >= R_386_standard + 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_tls_offset) - R_386_ext >= R_386_tls - R_386_ext)) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } howto = elf_howto_table + indx; r_symndx = ELF32_R_SYM (rel->r_info); - if (info->relocateable) + if (info->relocatable) { bfd_vma val; bfd_byte *where; @@ -2163,7 +2093,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, h = NULL; sym = NULL; sec = NULL; - unresolved_reloc = false; + unresolved_reloc = FALSE; if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; @@ -2236,43 +2166,12 @@ elf_i386_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; + bfd_boolean warned; - relocation = 0; - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - sec = h->root.u.def.section; - if (sec->output_section == NULL) - /* Set a flag that will be cleared later if we find a - relocation value for this symbol. output_section - is typically NULL for symbols satisfied by a shared - library. */ - unresolved_reloc = true; - else - relocation = (h->root.u.def.value - + sec->output_section->vma - + sec->output_offset); - } - else if (h->root.type == bfd_link_hash_undefweak) - ; - else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) - && !info->no_undefined - && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - ; - else - { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.string, input_bfd, - input_section, rel->r_offset, - (!info->shared || info->no_undefined - || ELF_ST_VISIBILITY (h->other))))) - return false; - } + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); } switch (r_type) @@ -2285,16 +2184,15 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if (h != NULL) { - boolean dyn; + bfd_boolean dyn; off = h->got.offset; dyn = htab->elf.dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) || (info->shared - && (info->symbolic - || h->dynindx == -1 - || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + && SYMBOL_REFERENCES_LOCAL (info, h)) + || (ELF_ST_VISIBILITY (h->other) + && h->root.type == bfd_link_hash_undefweak)) { /* This is actually a static link, or it is a -Bsymbolic link and the symbol is defined @@ -2318,7 +2216,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, } } else - unresolved_reloc = false; + unresolved_reloc = FALSE; } else { @@ -2339,20 +2237,20 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if (info->shared) { - asection *srelgot; - Elf_Internal_Rel outrel; - Elf32_External_Rel *loc; + asection *s; + Elf_Internal_Rela outrel; + bfd_byte *loc; - srelgot = htab->srelgot; - if (srelgot == NULL) + s = htab->srelgot; + if (s == NULL) abort (); outrel.r_offset = (htab->sgot->output_section->vma + htab->sgot->output_offset + off); outrel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); - loc = (Elf32_External_Rel *) srelgot->contents; - loc += srelgot->reloc_count++; + loc = s->contents; + loc += s->reloc_count++ * sizeof (Elf32_External_Rel); bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); } @@ -2381,7 +2279,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, case R_386_GOTPC: /* Use global offset table as symbol value. */ relocation = htab->sgot->output_section->vma; - unresolved_reloc = false; + unresolved_reloc = FALSE; break; case R_386_PLT32: @@ -2405,7 +2303,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (htab->splt->output_section->vma + htab->splt->output_offset + h->plt.offset); - unresolved_reloc = false; + unresolved_reloc = FALSE; break; case R_386_32: @@ -2418,13 +2316,13 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, break; if ((info->shared + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) && (r_type != R_386_PC32 - || (h != NULL - && h->dynindx != -1 - && (! info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared + || !SYMBOL_CALLS_LOCAL (info, h))) + || (ELIMINATE_COPY_RELOCS + && !info->shared && h != NULL && h->dynindx != -1 && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 @@ -2435,25 +2333,25 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, || h->root.type == bfd_link_hash_undefweak || h->root.type == bfd_link_hash_undefined))) { - Elf_Internal_Rel outrel; - boolean skip, relocate; + Elf_Internal_Rela outrel; + bfd_byte *loc; + bfd_boolean skip, relocate; asection *sreloc; - Elf32_External_Rel *loc; /* When generating a shared object, these relocations are copied into the output file to be resolved at run time. */ - skip = false; - relocate = false; + skip = FALSE; + relocate = FALSE; outrel.r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, rel->r_offset); if (outrel.r_offset == (bfd_vma) -1) - skip = true; + skip = TRUE; else if (outrel.r_offset == (bfd_vma) -2) - skip = true, relocate = true; + skip = TRUE, relocate = TRUE; outrel.r_offset += (input_section->output_section->vma + input_section->output_offset); @@ -2470,7 +2368,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, else { /* This symbol is local, or marked to become local. */ - relocate = true; + relocate = TRUE; outrel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); } @@ -2478,8 +2376,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if (sreloc == NULL) abort (); - loc = (Elf32_External_Rel *) sreloc->contents; - loc += sreloc->reloc_count++; + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rel); bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); /* If this reloc is against an external symbol, we do @@ -2494,9 +2392,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, case R_386_TLS_IE: if (info->shared) { - Elf_Internal_Rel outrel; + Elf_Internal_Rela outrel; + bfd_byte *loc; asection *sreloc; - Elf32_External_Rel *loc; outrel.r_offset = rel->r_offset + input_section->output_section->vma @@ -2505,8 +2403,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, sreloc = elf_section_data (input_section)->sreloc; if (sreloc == NULL) abort (); - loc = (Elf32_External_Rel *) sreloc->contents; - loc += sreloc->reloc_count++; + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rel); bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); } /* Fall through */ @@ -2619,14 +2517,16 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if (val == 0xa1) { /* movl foo, %eax. */ - bfd_put_8 (output_bfd, 0xb8, contents + rel->r_offset - 1); + bfd_put_8 (output_bfd, 0xb8, + contents + rel->r_offset - 1); } else { BFD_ASSERT (rel->r_offset >= 2); - type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2); + type = bfd_get_8 (input_bfd, + contents + rel->r_offset - 2); switch (type) - { + { case 0x8b: /* movl */ BFD_ASSERT ((val & 0xc7) == 0x05); @@ -2648,7 +2548,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, default: BFD_FAIL (); break; - } + } } bfd_put_32 (output_bfd, -tpoff (info, relocation), contents + rel->r_offset); @@ -2723,10 +2623,10 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if ((off & 1) != 0) off &= ~1; - else + else { - Elf_Internal_Rel outrel; - Elf32_External_Rel *loc; + Elf_Internal_Rela outrel; + bfd_byte *loc; int dr_type, indx; if (htab->srelgot == NULL) @@ -2752,8 +2652,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, bfd_put_32 (output_bfd, 0, htab->sgot->contents + off); outrel.r_info = ELF32_R_INFO (indx, dr_type); - loc = (Elf32_External_Rel *) htab->srelgot->contents; - loc += htab->srelgot->reloc_count++; + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ * sizeof (Elf32_External_Rel); bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); if (r_type == R_386_TLS_GD) @@ -2773,9 +2673,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, R_386_TLS_DTPOFF32); outrel.r_offset += 4; htab->srelgot->reloc_count++; - loc++; - bfd_elf32_swap_reloc_out (output_bfd, &outrel, - loc); + loc += sizeof (Elf32_External_Rel); + bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); } } else if (tls_type == GOT_TLS_IE_BOTH) @@ -2786,7 +2685,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, outrel.r_info = ELF32_R_INFO (indx, R_386_TLS_TPOFF); outrel.r_offset += 4; htab->srelgot->reloc_count++; - loc++; + loc += sizeof (Elf32_External_Rel); bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); } @@ -2806,7 +2705,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, relocation += 4; if (r_type == R_386_TLS_IE) relocation += htab->sgot->output_section->vma; - unresolved_reloc = false; + unresolved_reloc = FALSE; } else { @@ -2905,8 +2804,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, off &= ~1; else { - Elf_Internal_Rel outrel; - Elf32_External_Rel *loc; + Elf_Internal_Rela outrel; + bfd_byte *loc; if (htab->srelgot == NULL) abort (); @@ -2919,17 +2818,17 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, bfd_put_32 (output_bfd, 0, htab->sgot->contents + off + 4); outrel.r_info = ELF32_R_INFO (0, R_386_TLS_DTPMOD32); - loc = (Elf32_External_Rel *) htab->srelgot->contents; - loc += htab->srelgot->reloc_count++; + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ * sizeof (Elf32_External_Rel); bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); htab->tls_ldm_got.offset |= 1; } relocation = htab->sgot->output_offset + off; - unresolved_reloc = false; + unresolved_reloc = FALSE; break; case R_386_TLS_LDO_32: - if (info->shared) + if (info->shared || (input_section->flags & SEC_CODE) == 0) relocation -= dtpoff_base (info); else /* When converting LDO to LE, we must negate. */ @@ -2940,9 +2839,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, case R_386_TLS_LE: if (info->shared) { - Elf_Internal_Rel outrel; + Elf_Internal_Rela outrel; asection *sreloc; - Elf32_External_Rel *loc; + bfd_byte *loc; int indx; outrel.r_offset = rel->r_offset @@ -2959,8 +2858,8 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, sreloc = elf_section_data (input_section)->sreloc; if (sreloc == NULL) abort (); - loc = (Elf32_External_Rel *) sreloc->contents; - loc += sreloc->reloc_count++; + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rel); bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); if (indx) continue; @@ -2992,12 +2891,12 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, bfd_get_section_name (input_bfd, input_section), (long) rel->r_offset, h->root.root.string); - return false; + return FALSE; } r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, - relocation, (bfd_vma) 0); + relocation, 0); if (r != bfd_reloc_ok) { @@ -3011,7 +2910,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, symtab_hdr->sh_link, sym->st_name); if (name == NULL) - return false; + return FALSE; if (*name == '\0') name = bfd_section_name (input_bfd, sec); } @@ -3019,9 +2918,9 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if (r == bfd_reloc_overflow) { if (! ((*info->callbacks->reloc_overflow) - (info, name, howto->name, (bfd_vma) 0, + (info, name, howto->name, 0, input_bfd, input_section, rel->r_offset))) - return false; + return FALSE; } else { @@ -3030,23 +2929,22 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, bfd_archive_filename (input_bfd), bfd_get_section_name (input_bfd, input_section), (long) rel->r_offset, name, (int) r); - return false; + return FALSE; } } } - return true; + return TRUE; } /* Finish up dynamic symbol handling. We set the contents of various dynamic sections here. */ -static boolean -elf_i386_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; +static bfd_boolean +elf_i386_finish_dynamic_symbol (bfd *output_bfd, + struct bfd_link_info *info, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { struct elf_i386_link_hash_table *htab; @@ -3056,8 +2954,8 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) { bfd_vma plt_index; bfd_vma got_offset; - Elf_Internal_Rel rel; - Elf32_External_Rel *loc; + Elf_Internal_Rela rel; + bfd_byte *loc; /* This symbol has an entry in the procedure linkage table. Set it up. */ @@ -3116,17 +3014,22 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) + htab->sgotplt->output_offset + got_offset); rel.r_info = ELF32_R_INFO (h->dynindx, R_386_JUMP_SLOT); - loc = (Elf32_External_Rel *) htab->srelplt->contents + plt_index; + loc = htab->srelplt->contents + plt_index * sizeof (Elf32_External_Rel); bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { /* Mark the symbol as undefined, rather than as defined in - the .plt section. Leave the value alone. This is a clue + the .plt section. Leave the value if there were any + relocations where pointer equality matters (this is a clue for the dynamic linker, to make function pointer comparisons work between an application and shared - library. */ + library), otherwise set it to zero. If a function is only + called from a binary, there is no need to slow down + shared libraries because of that. */ sym->st_shndx = SHN_UNDEF; + if ((h->elf_link_hash_flags & ELF_LINK_POINTER_EQUALITY_NEEDED) == 0) + sym->st_value = 0; } } @@ -3134,8 +3037,8 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) && elf_i386_hash_entry(h)->tls_type != GOT_TLS_GD && (elf_i386_hash_entry(h)->tls_type & GOT_TLS_IE) == 0) { - Elf_Internal_Rel rel; - Elf32_External_Rel *loc; + Elf_Internal_Rela rel; + bfd_byte *loc; /* This symbol has an entry in the global offset table. Set it up. */ @@ -3153,10 +3056,7 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) The entry in the global offset table will already have been initialized in the relocate_section function. */ if (info->shared - && (info->symbolic - || h->dynindx == -1 - || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) + && SYMBOL_REFERENCES_LOCAL (info, h)) { BFD_ASSERT((h->got.offset & 1) != 0); rel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); @@ -3169,15 +3069,15 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) rel.r_info = ELF32_R_INFO (h->dynindx, R_386_GLOB_DAT); } - loc = (Elf32_External_Rel *) htab->srelgot->contents; - loc += htab->srelgot->reloc_count++; + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ * sizeof (Elf32_External_Rel); bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); } if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) { - Elf_Internal_Rel rel; - Elf32_External_Rel *loc; + Elf_Internal_Rela rel; + bfd_byte *loc; /* This symbol needs a copy reloc. Set it up. */ @@ -3191,8 +3091,8 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) + h->root.u.def.section->output_section->vma + h->root.u.def.section->output_offset); rel.r_info = ELF32_R_INFO (h->dynindx, R_386_COPY); - loc = (Elf32_External_Rel *) htab->srelbss->contents; - loc += htab->srelbss->reloc_count++; + loc = htab->srelbss->contents; + loc += htab->srelbss->reloc_count++ * sizeof (Elf32_External_Rel); bfd_elf32_swap_reloc_out (output_bfd, &rel, loc); } @@ -3201,17 +3101,16 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) sym->st_shndx = SHN_ABS; - return true; + return TRUE; } /* Used to decide how to sort relocs in an optimal manner for the dynamic linker, before writing them out. */ static enum elf_reloc_type_class -elf_i386_reloc_type_class (rela) - const Elf_Internal_Rela *rela; +elf_i386_reloc_type_class (const Elf_Internal_Rela *rela) { - switch ((int) ELF32_R_TYPE (rela->r_info)) + switch (ELF32_R_TYPE (rela->r_info)) { case R_386_RELATIVE: return reloc_class_relative; @@ -3226,10 +3125,9 @@ elf_i386_reloc_type_class (rela) /* Finish up the dynamic sections. */ -static boolean -elf_i386_finish_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +static bfd_boolean +elf_i386_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info) { struct elf_i386_link_hash_table *htab; bfd *dynobj; @@ -3265,15 +3163,13 @@ elf_i386_finish_dynamic_sections (output_bfd, info) break; case DT_JMPREL: - dyn.d_un.d_ptr = htab->srelplt->output_section->vma; + s = htab->srelplt; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; break; case DT_PLTRELSZ: - s = htab->srelplt->output_section; - if (s->_cooked_size != 0) - dyn.d_un.d_val = s->_cooked_size; - else - dyn.d_un.d_val = s->_raw_size; + s = htab->srelplt; + dyn.d_un.d_val = s->_raw_size; break; case DT_RELSZ: @@ -3282,18 +3178,23 @@ elf_i386_finish_dynamic_sections (output_bfd, info) included in the overall relocs (DT_REL). This is what Solaris does. However, UnixWare can not handle that case. Therefore, we override the DT_RELSZ entry - here to make it not include the JMPREL relocs. Since - the linker script arranges for .rel.plt to follow all - other relocation sections, we don't have to worry - about changing the DT_REL entry. */ - if (htab->srelplt != NULL) - { - s = htab->srelplt->output_section; - if (s->_cooked_size != 0) - dyn.d_un.d_val -= s->_cooked_size; - else - dyn.d_un.d_val -= s->_raw_size; - } + here to make it not include the JMPREL relocs. */ + s = htab->srelplt; + if (s == NULL) + continue; + dyn.d_un.d_val -= s->_raw_size; + break; + + case DT_REL: + /* We may not be using the standard ELF linker script. + If .rel.plt is the first .rel section, we adjust + DT_REL to not include it. */ + s = htab->srelplt; + if (s == NULL) + continue; + if (dyn.d_un.d_ptr != s->output_section->vma + s->output_offset) + continue; + dyn.d_un.d_ptr += s->_raw_size; break; } @@ -3335,25 +3236,23 @@ elf_i386_finish_dynamic_sections (output_bfd, info) if (htab->sgotplt->_raw_size > 0) { bfd_put_32 (output_bfd, - (sdyn == NULL ? (bfd_vma) 0 + (sdyn == NULL ? 0 : sdyn->output_section->vma + sdyn->output_offset), htab->sgotplt->contents); - bfd_put_32 (output_bfd, (bfd_vma) 0, htab->sgotplt->contents + 4); - bfd_put_32 (output_bfd, (bfd_vma) 0, htab->sgotplt->contents + 8); + bfd_put_32 (output_bfd, 0, htab->sgotplt->contents + 4); + bfd_put_32 (output_bfd, 0, htab->sgotplt->contents + 8); } elf_section_data (htab->sgotplt->output_section)->this_hdr.sh_entsize = 4; } - return true; + return TRUE; } -#ifndef ELF_ARCH #define TARGET_LITTLE_SYM bfd_elf32_i386_vec #define TARGET_LITTLE_NAME "elf32-i386" #define ELF_ARCH bfd_arch_i386 #define ELF_MACHINE_CODE EM_386 #define ELF_MAXPAGESIZE 0x1000 -#endif /* ELF_ARCH */ #define elf_backend_can_gc_sections 1 #define elf_backend_can_refcount 1 @@ -3361,13 +3260,12 @@ elf_i386_finish_dynamic_sections (output_bfd, info) #define elf_backend_plt_readonly 1 #define elf_backend_want_plt_sym 0 #define elf_backend_got_header_size 12 -#define elf_backend_plt_header_size PLT_ENTRY_SIZE -#define elf_info_to_howto elf_i386_info_to_howto +/* Support RELA for objdump of prelink objects. */ +#define elf_info_to_howto elf_i386_info_to_howto_rel #define elf_info_to_howto_rel elf_i386_info_to_howto_rel #define bfd_elf32_mkobject elf_i386_mkobject -#define elf_backend_object_p elf_i386_object_p #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 @@ -3389,3 +3287,37 @@ elf_i386_finish_dynamic_sections (output_bfd, info) #define elf_backend_size_dynamic_sections elf_i386_size_dynamic_sections #include "elf32-target.h" + +/* FreeBSD support. */ + +#undef TARGET_LITTLE_SYM +#define TARGET_LITTLE_SYM bfd_elf32_i386_freebsd_vec +#undef TARGET_LITTLE_NAME +#define TARGET_LITTLE_NAME "elf32-i386-freebsd" + +/* The kernel recognizes executables as valid only if they carry a + "FreeBSD" label in the ELF header. So we put this label on all + executables and (for simplicity) also all other object files. */ + +static void +elf_i386_post_process_headers (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED) +{ + Elf_Internal_Ehdr *i_ehdrp; + + i_ehdrp = elf_elfheader (abfd); + + /* Put an ABI label supported by FreeBSD >= 4.1. */ + i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; +#ifdef OLD_FREEBSD_ABI_LABEL + /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */ + memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8); +#endif +} + +#undef elf_backend_post_process_headers +#define elf_backend_post_process_headers elf_i386_post_process_headers +#undef elf32_bed +#define elf32_bed elf32_i386_fbsd_bed + +#include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf32-ppc.c b/contrib/binutils/bfd/elf32-ppc.c index 9abdf61..4eb08ad 100644 --- a/contrib/binutils/bfd/elf32-ppc.c +++ b/contrib/binutils/bfd/elf32-ppc.c @@ -1,23 +1,24 @@ /* PowerPC-specific support for 32-bit ELF - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2004 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. -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. */ /* This file is based on a preliminary PowerPC ELF ABI. The information may not match the final PowerPC ELF ABI. It includes @@ -30,100 +31,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libbfd.h" #include "elf-bfd.h" #include "elf/ppc.h" +#include "elf32-ppc.h" -#define USE_RELA /* we want RELA relocations, not REL */ +/* RELA relocations are used here. */ -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 - PARAMS ((bfd *abfd, arelent *cache_ptr, Elf32_Internal_Rela *dst)); -static void ppc_elf_howto_init PARAMS ((void)); -static int ppc_elf_sort_rela PARAMS ((const PTR, const PTR)); -static boolean ppc_elf_relax_section - PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); static bfd_reloc_status_type ppc_elf_addr16_ha_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static boolean ppc_elf_object_p PARAMS ((bfd *)); -static boolean ppc_elf_set_private_flags PARAMS ((bfd *, flagword)); -static boolean ppc_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); - -static int ppc_elf_additional_program_headers PARAMS ((bfd *)); -static boolean ppc_elf_modify_segment_map PARAMS ((bfd *)); - -static asection *ppc_elf_create_got - PARAMS ((bfd *, struct bfd_link_info *)); -static boolean ppc_elf_create_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); - -static boolean ppc_elf_section_from_shdr PARAMS ((bfd *, - Elf32_Internal_Shdr *, - const char *)); -static boolean ppc_elf_fake_sections - PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); - -static elf_linker_section_t *ppc_elf_create_linker_section - PARAMS ((bfd *abfd, - struct bfd_link_info *info, - enum elf_linker_section_enum)); - -static boolean ppc_elf_check_relocs PARAMS ((bfd *, - struct bfd_link_info *, - asection *, - const Elf_Internal_Rela *)); - -static asection * ppc_elf_gc_mark_hook PARAMS ((asection *sec, - struct bfd_link_info *info, - Elf_Internal_Rela *rel, - struct elf_link_hash_entry *h, - Elf_Internal_Sym *sym)); - -static boolean ppc_elf_gc_sweep_hook PARAMS ((bfd *abfd, - struct bfd_link_info *info, - asection *sec, - const Elf_Internal_Rela *relocs)); - -static boolean ppc_elf_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, - struct elf_link_hash_entry *)); - -static boolean ppc_elf_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); - -static boolean ppc_elf_relocate_section PARAMS ((bfd *, - struct bfd_link_info *info, - bfd *, - asection *, - bfd_byte *, - Elf_Internal_Rela *relocs, - Elf_Internal_Sym *local_syms, - asection **)); - -static boolean ppc_elf_add_symbol_hook PARAMS ((bfd *, - struct bfd_link_info *, - const Elf_Internal_Sym *, - const char **, - flagword *, - asection **, - bfd_vma *)); - -static boolean ppc_elf_finish_dynamic_symbol PARAMS ((bfd *, - struct bfd_link_info *, - struct elf_link_hash_entry *, - Elf_Internal_Sym *)); - -static boolean ppc_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static enum elf_reloc_type_class ppc_elf_reloc_type_class - PARAMS ((const Elf_Internal_Rela *)); -static boolean ppc_elf_grok_prstatus - PARAMS ((bfd *abfd, Elf_Internal_Note *note)); -static boolean ppc_elf_grok_psinfo - PARAMS ((bfd *abfd, Elf_Internal_Note *note)); - -#define BRANCH_PREDICT_BIT 0x200000 /* branch prediction bit for branch taken relocs */ -#define RA_REGISTER_MASK 0x001f0000 /* mask to set RA in memory instructions */ -#define RA_REGISTER_SHIFT 16 /* value to shift register by to insert RA */ + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); +static bfd_reloc_status_type ppc_elf_unhandled_reloc + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); + +/* Branch prediction bit for branch taken relocs. */ +#define BRANCH_PREDICT_BIT 0x200000 +/* Mask to set RA in memory instructions. */ +#define RA_REGISTER_MASK 0x001f0000 +/* Value to shift register by to insert RA. */ +#define RA_REGISTER_SHIFT 16 /* The name of the dynamic interpreter. This is put in the .interp section. */ - #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" /* The size in bytes of an entry in the procedure linkage table. */ @@ -135,25 +60,289 @@ static boolean ppc_elf_grok_psinfo /* The number of single-slot PLT entries (the rest use two slots). */ #define PLT_NUM_SINGLE_ENTRIES 8192 -/* 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) - -/* 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) +/* Some nop instructions. */ +#define NOP 0x60000000 +#define CROR_151515 0x4def7b82 +#define CROR_313131 0x4ffffb82 + +/* Offset of tp and dtp pointers from start of TLS block. */ +#define TP_OFFSET 0x7000 +#define DTP_OFFSET 0x8000 + + +/* Enumeration to specify the special section. */ +enum elf_linker_section_enum +{ + LINKER_SECTION_SDATA, + LINKER_SECTION_SDATA2 +}; + +/* Sections created by the linker. */ + +typedef struct elf_linker_section +{ + /* pointer to the section */ + asection *section; + /* pointer to the relocations needed for this section */ + asection *rel_section; + /* pointer to the created symbol hash value */ + struct elf_link_hash_entry *sym_hash; + /* offset of symbol from beginning of section */ + bfd_vma sym_offset; +} elf_linker_section_t; + +/* Linked list of allocated pointer entries. This hangs off of the + symbol lists, and provides allows us to return different pointers, + based on different addend's. */ + +typedef struct elf_linker_section_pointers +{ + /* next allocated pointer for this symbol */ + struct elf_linker_section_pointers *next; + /* offset of pointer from beginning of section */ + bfd_vma offset; + /* addend used */ + bfd_vma addend; + /* which linker section this is */ + elf_linker_section_t *lsect; + /* whether address was written yet */ + bfd_boolean written_address_p; +} elf_linker_section_pointers_t; + +struct ppc_elf_obj_tdata +{ + struct elf_obj_tdata elf; + + /* A mapping from local symbols to offsets into the various linker + sections added. This is index by the symbol index. */ + elf_linker_section_pointers_t **linker_section_pointers; +}; + +#define ppc_elf_tdata(bfd) \ + ((struct ppc_elf_obj_tdata *) (bfd)->tdata.any) + +#define elf_local_ptr_offsets(bfd) \ + (ppc_elf_tdata (bfd)->linker_section_pointers) + +/* Override the generic function because we store some extras. */ + +static bfd_boolean +ppc_elf_mkobject (bfd *abfd) +{ + bfd_size_type amt = sizeof (struct ppc_elf_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + return TRUE; +} + +/* The PPC linker needs to keep track of the number of relocs that it + decides to copy as dynamic relocs in check_relocs for each symbol. + This is so that it can later discard them if they are found to be + unnecessary. We store the information in a field extending the + regular ELF linker hash table. */ + +struct ppc_elf_dyn_relocs +{ + struct ppc_elf_dyn_relocs *next; + + /* The input section of the reloc. */ + asection *sec; + + /* Total number of relocs copied for the input section. */ + bfd_size_type count; + + /* Number of pc-relative relocs copied for the input section. */ + bfd_size_type pc_count; +}; + +/* PPC ELF linker hash entry. */ + +struct ppc_elf_link_hash_entry +{ + struct elf_link_hash_entry elf; + + /* If this symbol is used in the linker created sections, the processor + specific backend uses this field to map the field into the offset + from the beginning of the section. */ + elf_linker_section_pointers_t *linker_section_pointer; + + /* Track dynamic relocs copied for this symbol. */ + struct ppc_elf_dyn_relocs *dyn_relocs; + + /* Contexts in which symbol is used in the GOT (or TOC). + TLS_GD .. TLS_TLS bits are or'd into the mask as the + corresponding relocs are encountered during check_relocs. + tls_optimize clears TLS_GD .. TLS_TPREL when optimizing to + indicate the corresponding GOT entry type is not needed. */ +#define TLS_GD 1 /* GD reloc. */ +#define TLS_LD 2 /* LD reloc. */ +#define TLS_TPREL 4 /* TPREL reloc, => IE. */ +#define TLS_DTPREL 8 /* DTPREL reloc, => LD. */ +#define TLS_TLS 16 /* Any TLS reloc. */ +#define TLS_TPRELGD 32 /* TPREL reloc resulting from GD->IE. */ + char tls_mask; +}; + +#define ppc_elf_hash_entry(ent) ((struct ppc_elf_link_hash_entry *) (ent)) + +/* PPC ELF linker hash table. */ + +struct ppc_elf_link_hash_table +{ + struct elf_link_hash_table elf; + + /* Short-cuts to get to dynamic linker sections. */ + asection *got; + asection *relgot; + asection *plt; + asection *relplt; + asection *dynbss; + asection *relbss; + asection *dynsbss; + asection *relsbss; + elf_linker_section_t *sdata; + elf_linker_section_t *sdata2; + asection *sbss; + + /* Shortcut to .__tls_get_addr. */ + struct elf_link_hash_entry *tls_get_addr; + + /* TLS local dynamic got entry handling. */ + union { + bfd_signed_vma refcount; + bfd_vma offset; + } tlsld_got; + + /* Small local sym to section mapping cache. */ + struct sym_sec_cache sym_sec; +}; + +/* Get the PPC ELF linker hash table from a link_info structure. */ + +#define ppc_elf_hash_table(p) \ + ((struct ppc_elf_link_hash_table *) (p)->hash) + +/* Create an entry in a PPC ELF linker hash table. */ + +static struct bfd_hash_entry * +ppc_elf_link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) +{ + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (entry == NULL) + { + entry = bfd_hash_allocate (table, + sizeof (struct ppc_elf_link_hash_entry)); + if (entry == NULL) + return entry; + } + + /* Call the allocation method of the superclass. */ + entry = _bfd_elf_link_hash_newfunc (entry, table, string); + if (entry != NULL) + { + ppc_elf_hash_entry (entry)->linker_section_pointer = NULL; + ppc_elf_hash_entry (entry)->dyn_relocs = NULL; + ppc_elf_hash_entry (entry)->tls_mask = 0; + } + + return entry; +} + +/* Create a PPC ELF linker hash table. */ + +static struct bfd_link_hash_table * +ppc_elf_link_hash_table_create (bfd *abfd) +{ + struct ppc_elf_link_hash_table *ret; + + ret = bfd_zmalloc (sizeof (struct ppc_elf_link_hash_table)); + if (ret == NULL) + return NULL; + + if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd, + ppc_elf_link_hash_newfunc)) + { + free (ret); + return NULL; + } + + return &ret->elf.root; +} + +/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid + copying dynamic variables from a shared lib into an app's dynbss + section, and instead use a dynamic relocation to point into the + shared lib. */ +#define ELIMINATE_COPY_RELOCS 1 + +/* Copy the extra info we tack onto an elf_link_hash_entry. */ + +static void +ppc_elf_copy_indirect_symbol (const struct elf_backend_data *bed, + struct elf_link_hash_entry *dir, + struct elf_link_hash_entry *ind) +{ + struct ppc_elf_link_hash_entry *edir, *eind; + + edir = (struct ppc_elf_link_hash_entry *) dir; + eind = (struct ppc_elf_link_hash_entry *) ind; + + if (eind->dyn_relocs != NULL) + { + if (edir->dyn_relocs != NULL) + { + struct ppc_elf_dyn_relocs **pp; + struct ppc_elf_dyn_relocs *p; + + if (ind->root.type == bfd_link_hash_indirect) + abort (); + + /* Add reloc counts against the weak sym to the strong sym + list. Merge any entries against the same section. */ + for (pp = &eind->dyn_relocs; (p = *pp) != NULL; ) + { + struct ppc_elf_dyn_relocs *q; + + for (q = edir->dyn_relocs; q != NULL; q = q->next) + if (q->sec == p->sec) + { + q->pc_count += p->pc_count; + q->count += p->count; + *pp = p->next; + break; + } + if (q == NULL) + pp = &p->next; + } + *pp = edir->dyn_relocs; + } + + edir->dyn_relocs = eind->dyn_relocs; + eind->dyn_relocs = NULL; + } + + edir->tls_mask |= eind->tls_mask; + + if (ELIMINATE_COPY_RELOCS + && ind->root.type != bfd_link_hash_indirect + && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) + /* If called to transfer flags for a weakdef during processing + of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF. + We clear it ourselves for ELIMINATE_COPY_RELOCS. */ + dir->elf_link_hash_flags |= + (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK + | ELF_LINK_HASH_NEEDS_PLT)); + else + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); +} -static reloc_howto_type *ppc_elf_howto_table[(int) R_PPC_max]; +static reloc_howto_type *ppc_elf_howto_table[R_PPC_max]; static reloc_howto_type ppc_elf_howto_raw[] = { /* This reloc does nothing. */ @@ -161,30 +350,30 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_NONE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A standard 32 bit relocation. */ HOWTO (R_PPC_ADDR32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_ADDR32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* An absolute 26 bit branch; the lower two bits must be zero. FIXME: we don't check that, we just clear them. */ @@ -192,60 +381,60 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_ADDR24", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0x3fffffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A standard 16 bit relocation. */ HOWTO (R_PPC_ADDR16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_ADDR16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A 16 bit relocation without overflow. */ HOWTO (R_PPC_ADDR16_LO, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_ADDR16_LO", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* The high order 16 bits of an address. */ HOWTO (R_PPC_ADDR16_HI, /* type */ 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_ADDR16_HI", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + 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. */ @@ -253,15 +442,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc_elf_addr16_ha_reloc, /* special_function */ "R_PPC_ADDR16_HA", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* An absolute 16 bit branch; the lower two bits must be zero. FIXME: we don't check that, we just clear them. */ @@ -269,15 +458,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_ADDR14", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* An absolute 16 bit branch, for which bit 10 should be set to indicate that the branch is expected to be taken. The lower two @@ -286,15 +475,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_ADDR14_BRTAKEN",/* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* An absolute 16 bit branch, for which bit 10 should be set to indicate that the branch is not expected to be taken. The lower @@ -303,45 +492,45 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_ADDR14_BRNTAKEN",/* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 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) */ 26, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_REL24", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0x3fffffc, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* 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) */ 16, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_REL14", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* A relative 16 bit branch. Bit 10 should be set to indicate that the branch is expected to be taken. The lower two bits must be @@ -350,15 +539,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_REL14_BRTAKEN", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* A relative 16 bit branch. Bit 10 should be set to indicate that the branch is not expected to be taken. The lower two bits must @@ -367,15 +556,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_REL14_BRNTAKEN",/* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* Like R_PPC_ADDR16, but referring to the GOT table entry for the symbol. */ @@ -383,15 +572,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_GOT16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC_ADDR16_LO, but referring to the GOT table entry for the symbol. */ @@ -399,15 +588,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_GOT16_LO", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC_ADDR16_HI, but referring to the GOT table entry for the symbol. */ @@ -415,15 +604,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_GOT16_HI", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC_ADDR16_HA, but referring to the GOT table entry for the symbol. */ @@ -431,15 +620,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ ppc_elf_addr16_ha_reloc, /* special_function */ "R_PPC_GOT16_HA", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC_REL24, but referring to the procedure linkage table entry for the symbol. */ @@ -447,15 +636,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_PLTREL24", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0x3fffffc, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* This is used only by the dynamic linker. The symbol should exist both in the object being run and in some shared library. The @@ -466,15 +655,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_COPY", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC_ADDR32, but used when setting global offset table entries. */ @@ -482,30 +671,30 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_GLOB_DAT", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Marks a procedure linkage table entry for a symbol. */ HOWTO (R_PPC_JMP_SLOT, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_JMP_SLOT", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Used only by the dynamic linker. When the object is run, this longword is set to the load address of the object, plus the @@ -514,15 +703,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_RELATIVE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC_REL24, but uses the value of the symbol within the object rather than the final value. Normally used for @@ -531,60 +720,60 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_LOCAL24PC", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0x3fffffc, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* Like R_PPC_ADDR32, but may be unaligned. */ HOWTO (R_PPC_UADDR32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_UADDR32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC_ADDR16, but may be unaligned. */ HOWTO (R_PPC_UADDR16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_UADDR16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 32-bit PC relative */ HOWTO (R_PPC_REL32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_REL32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* 32-bit relocation to the symbol's procedure linkage table. FIXME: not supported. */ @@ -592,15 +781,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_PLT32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 32-bit PC relative relocation to the symbol's procedure linkage table. FIXME: not supported. */ @@ -608,15 +797,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_PLTREL32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* Like R_PPC_ADDR16_LO, but referring to the PLT table entry for the symbol. */ @@ -624,15 +813,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_PLT16_LO", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC_ADDR16_HI, but referring to the PLT table entry for the symbol. */ @@ -640,15 +829,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_PLT16_HI", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC_ADDR16_HA, but referring to the PLT table entry for the symbol. */ @@ -656,15 +845,15 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ ppc_elf_addr16_ha_reloc, /* special_function */ "R_PPC_PLT16_HA", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A sign-extended 16 bit value relative to _SDA_BASE_, for use with small data items. */ @@ -672,671 +861,1255 @@ static reloc_howto_type ppc_elf_howto_raw[] = { 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_SDAREL16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 16-bit section relative relocation. */ HOWTO (R_PPC_SECTOFF, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_SECTOFF", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 16-bit lower half section relative relocation. */ HOWTO (R_PPC_SECTOFF_LO, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_SECTOFF_LO", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 16-bit upper half section relative relocation. */ HOWTO (R_PPC_SECTOFF_HI, /* type */ 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC_SECTOFF_HI", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 16-bit upper half adjusted section relative relocation. */ HOWTO (R_PPC_SECTOFF_HA, /* type */ 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ ppc_elf_addr16_ha_reloc, /* special_function */ "R_PPC_SECTOFF_HA", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* The remaining relocs are from the Embedded ELF ABI, and are not - in the SVR4 ELF ABI. */ - - /* 32 bit value resulting from the addend minus the symbol */ - HOWTO (R_PPC_EMB_NADDR32, /* type */ + /* Marker reloc for TLS. */ + HOWTO (R_PPC_TLS, 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ + complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_PPC_EMB_NADDR32", /* name */ - false, /* partial_inplace */ + "R_PPC_TLS", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Computes the load module index of the load module that contains the + definition of its TLS sym. */ + HOWTO (R_PPC_DTPMOD32, + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_DTPMOD32", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* 16 bit value resulting from the addend minus the symbol */ - HOWTO (R_PPC_EMB_NADDR16, /* type */ + /* Computes a dtv-relative displacement, the difference between the value + of sym+add and the base address of the thread-local storage block that + contains the definition of sym, minus 0x8000. */ + HOWTO (R_PPC_DTPREL32, + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_DTPREL32", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 16 bit dtprel reloc. */ + HOWTO (R_PPC_DTPREL16, 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_PPC_EMB_NADDR16", /* name */ - false, /* partial_inplace */ + complain_overflow_signed, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_DTPREL16", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* 16 bit value resulting from the addend minus the symbol */ - HOWTO (R_PPC_EMB_NADDR16_LO, /* type */ + /* Like DTPREL16, but no overflow. */ + HOWTO (R_PPC_DTPREL16_LO, 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_dont,/* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_PPC_EMB_ADDR16_LO", /* name */ - false, /* partial_inplace */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_DTPREL16_LO", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* The high order 16 bits of the addend minus the symbol */ - HOWTO (R_PPC_EMB_NADDR16_HI, /* type */ + /* Like DTPREL16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC_DTPREL16_HI, 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_PPC_EMB_NADDR16_HI", /* name */ - false, /* partial_inplace */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_DTPREL16_HI", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* The high order 16 bits of the result of the addend minus the address, - plus 1 if the contents of the low 16 bits, treated as a signed number, - is negative. */ - HOWTO (R_PPC_EMB_NADDR16_HA, /* type */ + /* Like DTPREL16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC_DTPREL16_HA, 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - ppc_elf_addr16_ha_reloc, /* special_function */ - "R_PPC_EMB_NADDR16_HA", /* name */ - false, /* partial_inplace */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_DTPREL16_HA", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* 16 bit value resulting from allocating a 4 byte word to hold an - address in the .sdata section, and returning the offset from - _SDA_BASE_ for that relocation */ - HOWTO (R_PPC_EMB_SDAI16, /* type */ + /* Computes a tp-relative displacement, the difference between the value of + sym+add and the value of the thread pointer (r13). */ + HOWTO (R_PPC_TPREL32, + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_TPREL32", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 16 bit tprel reloc. */ + HOWTO (R_PPC_TPREL16, 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_PPC_EMB_SDAI16", /* name */ - false, /* partial_inplace */ + complain_overflow_signed, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_TPREL16", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* 16 bit value resulting from allocating a 4 byte word to hold an - address in the .sdata2 section, and returning the offset from - _SDA2_BASE_ for that relocation */ - HOWTO (R_PPC_EMB_SDA2I16, /* type */ + /* Like TPREL16, but no overflow. */ + HOWTO (R_PPC_TPREL16_LO, 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_PPC_EMB_SDA2I16", /* name */ - false, /* partial_inplace */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_TPREL16_LO", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* A sign-extended 16 bit value relative to _SDA2_BASE_, for use with - small data items. */ - HOWTO (R_PPC_EMB_SDA2REL, /* type */ + /* Like TPREL16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC_TPREL16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_TPREL16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like TPREL16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC_TPREL16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_TPREL16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Allocates two contiguous entries in the GOT to hold a tls_index structure, + with values (sym+add)@dtpmod and (sym+add)@dtprel, and computes the offset + to the first entry. */ + HOWTO (R_PPC_GOT_TLSGD16, 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_PPC_EMB_SDA2REL", /* name */ - false, /* partial_inplace */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSGD16", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* Relocate against either _SDA_BASE_ or _SDA2_BASE_, filling in the 16 bit - signed offset from the appropriate base, and filling in the register - field with the appropriate register (0, 2, or 13). */ - HOWTO (R_PPC_EMB_SDA21, /* type */ + /* Like GOT_TLSGD16, but no overflow. */ + HOWTO (R_PPC_GOT_TLSGD16_LO, 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_PPC_EMB_SDA21", /* name */ - false, /* partial_inplace */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSGD16_LO", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* Relocation not handled: R_PPC_EMB_MRKREF */ - /* Relocation not handled: R_PPC_EMB_RELSEC16 */ - /* Relocation not handled: R_PPC_EMB_RELST_LO */ - /* Relocation not handled: R_PPC_EMB_RELST_HI */ - /* Relocation not handled: R_PPC_EMB_RELST_HA */ - /* Relocation not handled: R_PPC_EMB_BIT_FLD */ + /* Like GOT_TLSGD16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC_GOT_TLSGD16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSGD16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ - /* PC relative relocation against either _SDA_BASE_ or _SDA2_BASE_, filling - in the 16 bit signed offset from the appropriate base, and filling in the - register field with the appropriate register (0, 2, or 13). */ - HOWTO (R_PPC_EMB_RELSDA, /* type */ + /* Like GOT_TLSGD16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC_GOT_TLSGD16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSGD16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Allocates two contiguous entries in the GOT to hold a tls_index structure, + with values (sym+add)@dtpmod and zero, and computes the offset to the + first entry. */ + HOWTO (R_PPC_GOT_TLSLD16, 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - true, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_PPC_EMB_RELSDA", /* name */ - false, /* partial_inplace */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSLD16", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* GNU extension to record C++ vtable hierarchy */ - HOWTO (R_PPC_GNU_VTINHERIT, /* type */ + /* Like GOT_TLSLD16, but no overflow. */ + HOWTO (R_PPC_GOT_TLSLD16_LO, 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - NULL, /* special_function */ - "R_PPC_GNU_VTINHERIT", /* name */ - false, /* partial_inplace */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSLD16_LO", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ - /* GNU extension to record C++ vtable member usage */ - HOWTO (R_PPC_GNU_VTENTRY, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ + /* Like GOT_TLSLD16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC_GOT_TLSLD16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - NULL, /* special_function */ - "R_PPC_GNU_VTENTRY", /* name */ - false, /* partial_inplace */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSLD16_HI", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ - /* Phony reloc to handle AIX style TOC entries */ - HOWTO (R_PPC_TOC16, /* type */ + /* Like GOT_TLSLD16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC_GOT_TLSLD16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TLSLD16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Allocates an entry in the GOT with value (sym+add)@dtprel, and computes + the offset to the entry. */ + HOWTO (R_PPC_GOT_DTPREL16, 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_PPC_TOC16", /* name */ - false, /* partial_inplace */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_DTPREL16", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ -}; - -/* Initialize the ppc_elf_howto_table, so that linear accesses can be done. */ + FALSE), /* pcrel_offset */ -static void -ppc_elf_howto_init () -{ - unsigned int i, type; + /* Like GOT_DTPREL16, but no overflow. */ + HOWTO (R_PPC_GOT_DTPREL16_LO, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_DTPREL16_LO", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ - 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])); - ppc_elf_howto_table[type] = &ppc_elf_howto_raw[i]; - } -} - -/* This function handles relaxing for the PPC with option --mpc860c0[=]. - - The MPC860, revision C0 or earlier contains a bug in the die. - If all of the following conditions are true, the next instruction - to be executed *may* be treated as a no-op. - 1/ A forward branch is executed. - 2/ The branch is predicted as not taken. - 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, - there is no problem and no action is required. - 2/ Conditional backward branches - No problem, no action required. - 3/ Conditional forward branches - Ensure that the "inverse prediction - bit" is set (ensure it is predicted taken). - 4/ Conditional register branches - Ensure that the "y bit" is set - (ensure it is predicted taken). -*/ - -/* Sort sections by address. */ + /* Like GOT_DTPREL16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC_GOT_DTPREL16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_DTPREL16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ -static int -ppc_elf_sort_rela (arg1, arg2) - const PTR arg1; - const PTR arg2; + /* Like GOT_DTPREL16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC_GOT_DTPREL16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_DTPREL16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Allocates an entry in the GOT with value (sym+add)@tprel, and computes the + offset to the entry. */ + HOWTO (R_PPC_GOT_TPREL16, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TPREL16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TPREL16, but no overflow. */ + HOWTO (R_PPC_GOT_TPREL16_LO, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TPREL16_LO", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TPREL16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC_GOT_TPREL16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TPREL16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TPREL16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC_GOT_TPREL16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_unhandled_reloc, /* special_function */ + "R_PPC_GOT_TPREL16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* The remaining relocs are from the Embedded ELF ABI, and are not + in the SVR4 ELF ABI. */ + + /* 32 bit value resulting from the addend minus the symbol. */ + HOWTO (R_PPC_EMB_NADDR32, /* 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_PPC_EMB_NADDR32", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffffffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 16 bit value resulting from the addend minus the symbol. */ + HOWTO (R_PPC_EMB_NADDR16, /* 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_PPC_EMB_NADDR16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 16 bit value resulting from the addend minus the symbol. */ + HOWTO (R_PPC_EMB_NADDR16_LO, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont,/* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC_EMB_ADDR16_LO", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* The high order 16 bits of the addend minus the symbol. */ + HOWTO (R_PPC_EMB_NADDR16_HI, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC_EMB_NADDR16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* The high order 16 bits of the result of the addend minus the address, + plus 1 if the contents of the low 16 bits, treated as a signed number, + is negative. */ + HOWTO (R_PPC_EMB_NADDR16_HA, /* type */ + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc_elf_addr16_ha_reloc, /* special_function */ + "R_PPC_EMB_NADDR16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 16 bit value resulting from allocating a 4 byte word to hold an + address in the .sdata section, and returning the offset from + _SDA_BASE_ for that relocation. */ + HOWTO (R_PPC_EMB_SDAI16, /* 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_PPC_EMB_SDAI16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* 16 bit value resulting from allocating a 4 byte word to hold an + address in the .sdata2 section, and returning the offset from + _SDA2_BASE_ for that relocation. */ + HOWTO (R_PPC_EMB_SDA2I16, /* 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_PPC_EMB_SDA2I16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A sign-extended 16 bit value relative to _SDA2_BASE_, for use with + small data items. */ + HOWTO (R_PPC_EMB_SDA2REL, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC_EMB_SDA2REL", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relocate against either _SDA_BASE_ or _SDA2_BASE_, filling in the 16 bit + signed offset from the appropriate base, and filling in the register + field with the appropriate register (0, 2, or 13). */ + HOWTO (R_PPC_EMB_SDA21, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC_EMB_SDA21", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Relocation not handled: R_PPC_EMB_MRKREF */ + /* Relocation not handled: R_PPC_EMB_RELSEC16 */ + /* Relocation not handled: R_PPC_EMB_RELST_LO */ + /* Relocation not handled: R_PPC_EMB_RELST_HI */ + /* Relocation not handled: R_PPC_EMB_RELST_HA */ + /* Relocation not handled: R_PPC_EMB_BIT_FLD */ + + /* PC relative relocation against either _SDA_BASE_ or _SDA2_BASE_, filling + in the 16 bit signed offset from the appropriate base, and filling in the + register field with the appropriate register (0, 2, or 13). */ + HOWTO (R_PPC_EMB_RELSDA, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + TRUE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC_EMB_RELSDA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Phony relocs to handle branch stubs. */ + HOWTO (R_PPC_RELAX32, /* type */ + 0, /* rightshift */ + 0, /* size */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC_RELAX32", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + HOWTO (R_PPC_RELAX32PC, /* type */ + 0, /* rightshift */ + 0, /* size */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC_RELAX32PC", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy. */ + HOWTO (R_PPC_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_PPC_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_PPC_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_PPC_GNU_VTENTRY", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Phony reloc to handle AIX style TOC entries. */ + HOWTO (R_PPC_TOC16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC_TOC16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ +}; + +/* Initialize the ppc_elf_howto_table, so that linear accesses can be done. */ + +static void +ppc_elf_howto_init (void) { - const Elf_Internal_Rela **rela1 = (const Elf_Internal_Rela**) arg1; - const Elf_Internal_Rela **rela2 = (const Elf_Internal_Rela**) arg2; + unsigned int i, type; - /* Sort by offset. */ - return ((*rela1)->r_offset - (*rela2)->r_offset); + for (i = 0; + i < sizeof (ppc_elf_howto_raw) / sizeof (ppc_elf_howto_raw[0]); + i++) + { + type = ppc_elf_howto_raw[i].type; + if (type >= (sizeof (ppc_elf_howto_table) + / sizeof (ppc_elf_howto_table[0]))) + abort (); + ppc_elf_howto_table[type] = &ppc_elf_howto_raw[i]; + } } + +#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) -static boolean -ppc_elf_relax_section (abfd, isec, link_info, again) - bfd *abfd; - asection *isec; - struct bfd_link_info *link_info; - boolean *again; +static const int shared_stub_entry[] = + { + 0x7c0802a6, /* mflr 0 */ + 0x429f0005, /* bcl 20, 31, .Lxxx */ + 0x7d6802a6, /* mflr 11 */ + 0x3d6b0000, /* addis 11, 11, (xxx-.Lxxx)@ha */ + 0x396b0018, /* addi 11, 11, (xxx-.Lxxx)@l */ + 0x7c0803a6, /* mtlr 0 */ + 0x7d6903a6, /* mtctr 11 */ + 0x4e800420, /* bctr */ + }; + +static const int stub_entry[] = + { + 0x3d600000, /* lis 11,xxx@ha */ + 0x396b0000, /* addi 11,11,xxx@l */ + 0x7d6903a6, /* mtctr 11 */ + 0x4e800420, /* bctr */ + }; + + +static bfd_boolean +ppc_elf_relax_section (bfd *abfd, + asection *isec, + struct bfd_link_info *link_info, + bfd_boolean *again) { -#define PAGESIZE 0x1000 + struct one_fixup + { + struct one_fixup *next; + asection *tsec; + bfd_vma toff; + bfd_vma trampoff; + }; + Elf_Internal_Shdr *symtab_hdr; bfd_byte *contents = NULL; - bfd_byte *free_contents = NULL; + Elf_Internal_Sym *isymbuf = NULL; Elf_Internal_Rela *internal_relocs = NULL; - Elf_Internal_Rela *free_relocs = NULL; - Elf_Internal_Rela **rela_comb = NULL; - int comb_curr, comb_count; + Elf_Internal_Rela *irel, *irelend; + struct one_fixup *fixups = NULL; + bfd_boolean changed; + struct ppc_elf_link_hash_table *ppc_info; + bfd_size_type trampoff; + + *again = FALSE; - /* We never have to do this more than once per input section. */ - *again = false; + /* Nothing to do if there are no relocations. */ + if ((isec->flags & SEC_RELOC) == 0 || isec->reloc_count == 0) + return TRUE; /* If needed, initialize this section's cooked size. */ if (isec->_cooked_size == 0) - isec->_cooked_size = isec->_raw_size; + isec->_cooked_size = isec->_raw_size; + + trampoff = (isec->_cooked_size + 3) & (bfd_vma) -4; + /* Space for a branch around any trampolines. */ + trampoff += 4; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - /* We're only interested in text sections which overlap the - troublesome area at the end of a page. */ - if (link_info->mpc860c0 && (isec->flags & SEC_CODE) && isec->_cooked_size) + /* Get a copy of the native relocations. */ + internal_relocs = _bfd_elf_link_read_relocs (abfd, isec, NULL, NULL, + link_info->keep_memory); + if (internal_relocs == NULL) + goto error_return; + + ppc_info = ppc_elf_hash_table (link_info); + irelend = internal_relocs + isec->reloc_count; + + /* 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; + else { - bfd_vma dot, end_page, end_section; - boolean section_modified; + /* Go get them off disk. */ + contents = bfd_malloc (isec->_raw_size); + if (contents == NULL) + goto error_return; - /* 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; + if (!bfd_get_section_contents (abfd, isec, contents, 0, isec->_raw_size)) + goto error_return; + } + + for (irel = internal_relocs; irel < irelend; irel++) + { + unsigned long r_type = ELF32_R_TYPE (irel->r_info); + bfd_vma symaddr, reladdr, toff, roff; + asection *tsec; + struct one_fixup *f; + size_t insn_offset = 0; + bfd_vma max_branch_offset, val; + bfd_byte *hit_addr; + unsigned long t0; + + switch (r_type) + { + case R_PPC_REL24: + case R_PPC_LOCAL24PC: + case R_PPC_PLTREL24: + max_branch_offset = 1 << 25; + break; + + case R_PPC_REL14: + case R_PPC_REL14_BRTAKEN: + case R_PPC_REL14_BRNTAKEN: + max_branch_offset = 1 << 15; + break; + + default: + continue; + } + + /* Get the value of the symbol referred to by the reloc. */ + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + /* A local symbol. */ + Elf_Internal_Sym *isym; + + /* Read this BFD's local symbols. */ + if (isymbuf == NULL) + { + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL) + isymbuf = bfd_elf_get_elf_syms (abfd, symtab_hdr, + symtab_hdr->sh_info, 0, + NULL, NULL, NULL); + if (isymbuf == 0) + goto error_return; + } + isym = isymbuf + ELF32_R_SYM (irel->r_info); + if (isym->st_shndx == SHN_UNDEF) + continue; /* We can't do anything 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 + tsec = bfd_section_from_elf_index (abfd, isym->st_shndx); + + toff = isym->st_value; + } else { - /* Go get them off disk. */ - contents = (bfd_byte *) bfd_malloc (isec->_raw_size); - if (contents == NULL) - goto error_return; - free_contents = contents; - - if (! bfd_get_section_contents (abfd, isec, contents, - (file_ptr) 0, isec->_raw_size)) - goto error_return; - } - - comb_curr = 0; - comb_count = 0; - if (isec->reloc_count) - { - unsigned n; - bfd_size_type amt; - - /* Get a copy of the native relocations. */ - internal_relocs = _bfd_elf32_link_read_relocs ( - 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. */ - amt = isec->reloc_count; - amt *= sizeof (Elf_Internal_Rela*); - rela_comb = (Elf_Internal_Rela**) bfd_malloc (amt); - if (rela_comb == NULL) - goto error_return; - for (n = 0; n < isec->reloc_count; ++n) - { - long r_type; - - r_type = ELF32_R_TYPE (internal_relocs[n].r_info); - 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 - can also be identified by their relocations. However, not all - 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. */ - switch (r_type) - { - case R_PPC_ADDR14_BRNTAKEN: /* absolute, predicted not taken */ - case R_PPC_REL14: /* relative cond. br. */ - case R_PPC_REL14_BRNTAKEN: /* rel. cond. br., predicted not taken */ - /* We should check the instruction. */ - break; - default: - /* 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); - } - - /* 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. */ - for (; - dot < end_section; - dot += PAGESIZE, end_page += PAGESIZE) - { - - /* Check each word in this EOP region. */ - for (; dot < end_page; dot += 4) - { - bfd_vma isec_offset; - unsigned long insn; - 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. */ - skip = false; - isec_offset = dot - isec->vma; - for (; comb_currr_offset; - if (r_offset >= isec_offset) - { - if (r_offset == isec_offset) skip = true; - break; - } - } - if (skip) continue; - - /* Check the current word for a problematic conditional branch. */ -#define BO0(insn) ((insn) & 0x02000000) -#define BO2(insn) ((insn) & 0x00800000) -#define BO4(insn) ((insn) & 0x00200000) - insn = (unsigned long) bfd_get_32 (abfd, contents + isec_offset); - modified = false; - if ((insn & 0xFc000000) == 0x40000000) - { - /* Instruction is BCx */ - if ((!BO0(insn) || !BO2(insn)) && !BO4(insn)) - { - bfd_vma target; - /* This branch is predicted as "normal". - If this is a forward branch, it is problematic. */ - - target = insn & 0x0000Fffc; /*extract*/ - target = (target ^ 0x8000) - 0x8000; /*sign extend*/ - if ((insn & 0x00000002) == 0) - target += dot; /*convert to abs*/ - if (target > dot) - { - insn |= 0x00200000; /* set the prediction bit */ - modified = true; - } - } - } - else if ((insn & 0xFc00Fffe) == 0x4c000420) - { - /* Instruction is BCCTRx */ - if ((!BO0(insn) || !BO2(insn)) && !BO4(insn)) - { - /* This branch is predicted as not-taken. - If this is a forward branch, it is problematic. - Since we can't tell statically if it will branch forward, - always set the prediction bit. */ - insn |= 0x00200000; /* set the prediction bit */ - modified = true; - } - } - else if ((insn & 0xFc00Fffe) == 0x4c000020) - { - /* Instruction is BCLRx */ - if ((!BO0(insn) || !BO2(insn)) && !BO4(insn)) - { - /* This branch is predicted as not-taken. - If this is a forward branch, it is problematic. - Since we can't tell statically if it will branch forward, - always set the prediction bit. */ - insn |= 0x00200000; /* set the prediction bit */ - modified = true; - } - } -#undef BO0 -#undef BO2 -#undef BO4 - if (modified) - { - bfd_put_32 (abfd, (bfd_vma) insn, contents + isec_offset); - section_modified = true; - } - } - } - if (section_modified) + /* Global symbol handling. */ + unsigned long indx; + struct elf_link_hash_entry *h; + + indx = ELF32_R_SYM (irel->r_info) - 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; + + if (r_type == R_PPC_PLTREL24 + && ppc_info->plt != NULL + && h->plt.offset != (bfd_vma) -1) + { + tsec = ppc_info->plt; + toff = h->plt.offset; + } + else if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + tsec = h->root.u.def.section; + toff = h->root.u.def.value; + } + else + continue; + } + + /* If the branch and target are in the same section, you have + no hope of adding stubs. We'll error out later should the + branch overflow. */ + if (tsec == isec) + continue; + + toff += irel->r_addend; + if (tsec->sec_info_type == ELF_INFO_TYPE_MERGE) + toff = _bfd_merged_section_offset (abfd, &tsec, + elf_section_data (tsec)->sec_info, + toff, 0); + + symaddr = tsec->output_section->vma + tsec->output_offset + toff; + + roff = irel->r_offset; + reladdr = isec->output_section->vma + isec->output_offset + roff; + + /* If the branch is in range, no need to do anything. */ + if (symaddr - reladdr + max_branch_offset < 2 * max_branch_offset) + 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) { - elf_section_data (isec)->this_hdr.contents = contents; - free_contents = NULL; + size_t size; + unsigned long stub_rtype; + + val = trampoff - roff; + if (val >= max_branch_offset) + /* Oh dear, we can't reach a trampoline. Don't try to add + one. We'll report an error later. */ + continue; + + if (link_info->shared) + { + size = 4 * ARRAY_SIZE (shared_stub_entry); + insn_offset = 12; + stub_rtype = R_PPC_RELAX32PC; + } + else + { + size = 4 * ARRAY_SIZE (stub_entry); + insn_offset = 0; + stub_rtype = R_PPC_RELAX32; + } + + /* Hijack the old relocation. Since we need two + relocations for this use a "composite" reloc. */ + irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info), + stub_rtype); + irel->r_offset = trampoff + insn_offset; + + /* Record the fixup so we don't do it again this section. */ + f = bfd_malloc (sizeof (*f)); + f->next = fixups; + f->tsec = tsec; + f->toff = toff; + f->trampoff = trampoff; + fixups = f; + + trampoff += size; + } + else + { + val = f->trampoff - roff; + if (val >= max_branch_offset) + continue; + + /* Nop out the reloc, since we're finalizing things here. */ + irel->r_info = ELF32_R_INFO (0, R_PPC_NONE); + } + + /* Fix up the existing branch to hit the trampoline. */ + hit_addr = contents + roff; + switch (r_type) + { + case R_PPC_REL24: + case R_PPC_LOCAL24PC: + case R_PPC_PLTREL24: + t0 = bfd_get_32 (abfd, hit_addr); + t0 &= ~0x3fffffc; + t0 |= val & 0x3fffffc; + bfd_put_32 (abfd, t0, hit_addr); + break; + + case R_PPC_REL14: + case R_PPC_REL14_BRTAKEN: + case R_PPC_REL14_BRNTAKEN: + t0 = bfd_get_32 (abfd, hit_addr); + t0 &= ~0xfffc; + t0 |= val & 0xfffc; + bfd_put_32 (abfd, t0, hit_addr); + break; } } - if (rela_comb != NULL) + /* Write out the trampolines. */ + changed = fixups != NULL; + if (fixups != NULL) { - free (rela_comb); - rela_comb = NULL; + const int *stub; + bfd_byte *dest; + bfd_vma val; + int i, size; + + do + { + struct one_fixup *f = fixups; + fixups = fixups->next; + free (f); + } + while (fixups); + + contents = bfd_realloc (contents, trampoff); + if (contents == NULL) + goto error_return; + + isec->_cooked_size = (isec->_cooked_size + 3) & (bfd_vma) -4; + /* Branch around the trampolines. */ + val = trampoff - isec->_cooked_size + 0x48000000; + dest = contents + isec->_cooked_size; + isec->_cooked_size = trampoff; + bfd_put_32 (abfd, val, dest); + dest += 4; + + if (link_info->shared) + { + stub = shared_stub_entry; + size = ARRAY_SIZE (shared_stub_entry); + } + else + { + stub = stub_entry; + size = ARRAY_SIZE (stub_entry); + } + + i = 0; + while (dest < contents + trampoff) + { + bfd_put_32 (abfd, stub[i], dest); + i++; + if (i == size) + i = 0; + dest += 4; + } + BFD_ASSERT (i == 0); } - if (free_relocs != NULL) + if (isymbuf != NULL + && symtab_hdr->contents != (unsigned char *) isymbuf) { - free (free_relocs); - free_relocs = NULL; + if (! link_info->keep_memory) + free (isymbuf); + else + { + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = (unsigned char *) isymbuf; + } } - if (free_contents != NULL) + if (contents != NULL + && elf_section_data (isec)->this_hdr.contents != contents) { - if (! link_info->keep_memory) - free (free_contents); + if (!changed && !link_info->keep_memory) + free (contents); else { /* Cache the section contents for elf_link_input_bfd. */ elf_section_data (isec)->this_hdr.contents = contents; } - free_contents = NULL; } - return true; + if (elf_section_data (isec)->relocs != internal_relocs) + { + if (!changed) + free (internal_relocs); + else + elf_section_data (isec)->relocs = internal_relocs; + } -error_return: - if (rela_comb != NULL) - free (rela_comb); - if (free_relocs != NULL) - free (free_relocs); - if (free_contents != NULL) - free (free_contents); - return false; + *again = changed; + return TRUE; + + error_return: + if (isymbuf != NULL && (unsigned char *) isymbuf != symtab_hdr->contents) + free (isymbuf); + if (contents != NULL + && elf_section_data (isec)->this_hdr.contents != contents) + free (contents); + if (internal_relocs != NULL + && elf_section_data (isec)->relocs != internal_relocs) + free (internal_relocs); + return FALSE; } static reloc_howto_type * -ppc_elf_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; +ppc_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) { - enum elf_ppc_reloc_type ppc_reloc = R_PPC_NONE; + enum elf_ppc_reloc_type r; + /* Initialize howto table if not already done. */ if (!ppc_elf_howto_table[R_PPC_ADDR32]) - /* Initialize howto table if needed. */ ppc_elf_howto_init (); - switch ((int) code) + switch (code) { default: - return (reloc_howto_type *) NULL; - - case BFD_RELOC_NONE: ppc_reloc = R_PPC_NONE; break; - case BFD_RELOC_32: ppc_reloc = R_PPC_ADDR32; break; - case BFD_RELOC_PPC_BA26: ppc_reloc = R_PPC_ADDR24; break; - case BFD_RELOC_16: ppc_reloc = R_PPC_ADDR16; break; - case BFD_RELOC_LO16: ppc_reloc = R_PPC_ADDR16_LO; break; - case BFD_RELOC_HI16: ppc_reloc = R_PPC_ADDR16_HI; break; - case BFD_RELOC_HI16_S: ppc_reloc = R_PPC_ADDR16_HA; break; - case BFD_RELOC_PPC_BA16: ppc_reloc = R_PPC_ADDR14; break; - case BFD_RELOC_PPC_BA16_BRTAKEN: ppc_reloc = R_PPC_ADDR14_BRTAKEN; break; - case BFD_RELOC_PPC_BA16_BRNTAKEN: ppc_reloc = R_PPC_ADDR14_BRNTAKEN; break; - case BFD_RELOC_PPC_B26: ppc_reloc = R_PPC_REL24; break; - case BFD_RELOC_PPC_B16: ppc_reloc = R_PPC_REL14; break; - case BFD_RELOC_PPC_B16_BRTAKEN: ppc_reloc = R_PPC_REL14_BRTAKEN; break; - case BFD_RELOC_PPC_B16_BRNTAKEN: ppc_reloc = R_PPC_REL14_BRNTAKEN; break; - case BFD_RELOC_16_GOTOFF: ppc_reloc = R_PPC_GOT16; break; - case BFD_RELOC_LO16_GOTOFF: ppc_reloc = R_PPC_GOT16_LO; break; - case BFD_RELOC_HI16_GOTOFF: ppc_reloc = R_PPC_GOT16_HI; break; - case BFD_RELOC_HI16_S_GOTOFF: ppc_reloc = R_PPC_GOT16_HA; break; - case BFD_RELOC_24_PLT_PCREL: ppc_reloc = R_PPC_PLTREL24; break; - case BFD_RELOC_PPC_COPY: ppc_reloc = R_PPC_COPY; break; - case BFD_RELOC_PPC_GLOB_DAT: ppc_reloc = R_PPC_GLOB_DAT; break; - case BFD_RELOC_PPC_LOCAL24PC: ppc_reloc = R_PPC_LOCAL24PC; break; - case BFD_RELOC_32_PCREL: ppc_reloc = R_PPC_REL32; break; - case BFD_RELOC_32_PLTOFF: ppc_reloc = R_PPC_PLT32; break; - case BFD_RELOC_32_PLT_PCREL: ppc_reloc = R_PPC_PLTREL32; break; - case BFD_RELOC_LO16_PLTOFF: ppc_reloc = R_PPC_PLT16_LO; break; - case BFD_RELOC_HI16_PLTOFF: ppc_reloc = R_PPC_PLT16_HI; break; - case BFD_RELOC_HI16_S_PLTOFF: ppc_reloc = R_PPC_PLT16_HA; break; - case BFD_RELOC_GPREL16: ppc_reloc = R_PPC_SDAREL16; break; - case BFD_RELOC_16_BASEREL: ppc_reloc = R_PPC_SECTOFF; break; - case BFD_RELOC_LO16_BASEREL: ppc_reloc = R_PPC_SECTOFF_LO; break; - case BFD_RELOC_HI16_BASEREL: ppc_reloc = R_PPC_SECTOFF_HI; break; - case BFD_RELOC_HI16_S_BASEREL: ppc_reloc = R_PPC_SECTOFF_HA; break; - case BFD_RELOC_CTOR: ppc_reloc = R_PPC_ADDR32; break; - case BFD_RELOC_PPC_TOC16: ppc_reloc = R_PPC_TOC16; break; - case BFD_RELOC_PPC_EMB_NADDR32: ppc_reloc = R_PPC_EMB_NADDR32; break; - case BFD_RELOC_PPC_EMB_NADDR16: ppc_reloc = R_PPC_EMB_NADDR16; break; - case BFD_RELOC_PPC_EMB_NADDR16_LO: ppc_reloc = R_PPC_EMB_NADDR16_LO; break; - case BFD_RELOC_PPC_EMB_NADDR16_HI: ppc_reloc = R_PPC_EMB_NADDR16_HI; break; - case BFD_RELOC_PPC_EMB_NADDR16_HA: ppc_reloc = R_PPC_EMB_NADDR16_HA; break; - case BFD_RELOC_PPC_EMB_SDAI16: ppc_reloc = R_PPC_EMB_SDAI16; break; - case BFD_RELOC_PPC_EMB_SDA2I16: ppc_reloc = R_PPC_EMB_SDA2I16; break; - case BFD_RELOC_PPC_EMB_SDA2REL: ppc_reloc = R_PPC_EMB_SDA2REL; break; - case BFD_RELOC_PPC_EMB_SDA21: ppc_reloc = R_PPC_EMB_SDA21; break; - case BFD_RELOC_PPC_EMB_MRKREF: ppc_reloc = R_PPC_EMB_MRKREF; break; - case BFD_RELOC_PPC_EMB_RELSEC16: ppc_reloc = R_PPC_EMB_RELSEC16; break; - case BFD_RELOC_PPC_EMB_RELST_LO: ppc_reloc = R_PPC_EMB_RELST_LO; break; - case BFD_RELOC_PPC_EMB_RELST_HI: ppc_reloc = R_PPC_EMB_RELST_HI; break; - case BFD_RELOC_PPC_EMB_RELST_HA: ppc_reloc = R_PPC_EMB_RELST_HA; break; - case BFD_RELOC_PPC_EMB_BIT_FLD: ppc_reloc = R_PPC_EMB_BIT_FLD; break; - case BFD_RELOC_PPC_EMB_RELSDA: ppc_reloc = R_PPC_EMB_RELSDA; break; - case BFD_RELOC_VTABLE_INHERIT: ppc_reloc = R_PPC_GNU_VTINHERIT; break; - case BFD_RELOC_VTABLE_ENTRY: ppc_reloc = R_PPC_GNU_VTENTRY; break; - } - - return ppc_elf_howto_table[(int) ppc_reloc]; + return NULL; + + case BFD_RELOC_NONE: r = R_PPC_NONE; break; + case BFD_RELOC_32: r = R_PPC_ADDR32; break; + case BFD_RELOC_PPC_BA26: r = R_PPC_ADDR24; break; + case BFD_RELOC_16: r = R_PPC_ADDR16; break; + case BFD_RELOC_LO16: r = R_PPC_ADDR16_LO; break; + case BFD_RELOC_HI16: r = R_PPC_ADDR16_HI; break; + case BFD_RELOC_HI16_S: r = R_PPC_ADDR16_HA; break; + case BFD_RELOC_PPC_BA16: r = R_PPC_ADDR14; break; + case BFD_RELOC_PPC_BA16_BRTAKEN: r = R_PPC_ADDR14_BRTAKEN; break; + case BFD_RELOC_PPC_BA16_BRNTAKEN: r = R_PPC_ADDR14_BRNTAKEN; break; + case BFD_RELOC_PPC_B26: r = R_PPC_REL24; break; + case BFD_RELOC_PPC_B16: r = R_PPC_REL14; break; + case BFD_RELOC_PPC_B16_BRTAKEN: r = R_PPC_REL14_BRTAKEN; break; + case BFD_RELOC_PPC_B16_BRNTAKEN: r = R_PPC_REL14_BRNTAKEN; break; + case BFD_RELOC_16_GOTOFF: r = R_PPC_GOT16; break; + case BFD_RELOC_LO16_GOTOFF: r = R_PPC_GOT16_LO; break; + case BFD_RELOC_HI16_GOTOFF: r = R_PPC_GOT16_HI; break; + case BFD_RELOC_HI16_S_GOTOFF: r = R_PPC_GOT16_HA; break; + case BFD_RELOC_24_PLT_PCREL: r = R_PPC_PLTREL24; break; + case BFD_RELOC_PPC_COPY: r = R_PPC_COPY; break; + case BFD_RELOC_PPC_GLOB_DAT: r = R_PPC_GLOB_DAT; break; + case BFD_RELOC_PPC_LOCAL24PC: r = R_PPC_LOCAL24PC; break; + case BFD_RELOC_32_PCREL: r = R_PPC_REL32; break; + case BFD_RELOC_32_PLTOFF: r = R_PPC_PLT32; break; + case BFD_RELOC_32_PLT_PCREL: r = R_PPC_PLTREL32; break; + case BFD_RELOC_LO16_PLTOFF: r = R_PPC_PLT16_LO; break; + case BFD_RELOC_HI16_PLTOFF: r = R_PPC_PLT16_HI; break; + case BFD_RELOC_HI16_S_PLTOFF: r = R_PPC_PLT16_HA; break; + case BFD_RELOC_GPREL16: r = R_PPC_SDAREL16; break; + case BFD_RELOC_16_BASEREL: r = R_PPC_SECTOFF; break; + case BFD_RELOC_LO16_BASEREL: r = R_PPC_SECTOFF_LO; break; + case BFD_RELOC_HI16_BASEREL: r = R_PPC_SECTOFF_HI; break; + case BFD_RELOC_HI16_S_BASEREL: r = R_PPC_SECTOFF_HA; break; + case BFD_RELOC_CTOR: r = R_PPC_ADDR32; break; + case BFD_RELOC_PPC_TOC16: r = R_PPC_TOC16; break; + case BFD_RELOC_PPC_TLS: r = R_PPC_TLS; break; + case BFD_RELOC_PPC_DTPMOD: r = R_PPC_DTPMOD32; break; + case BFD_RELOC_PPC_TPREL16: r = R_PPC_TPREL16; break; + case BFD_RELOC_PPC_TPREL16_LO: r = R_PPC_TPREL16_LO; break; + case BFD_RELOC_PPC_TPREL16_HI: r = R_PPC_TPREL16_HI; break; + case BFD_RELOC_PPC_TPREL16_HA: r = R_PPC_TPREL16_HA; break; + case BFD_RELOC_PPC_TPREL: r = R_PPC_TPREL32; break; + case BFD_RELOC_PPC_DTPREL16: r = R_PPC_DTPREL16; break; + case BFD_RELOC_PPC_DTPREL16_LO: r = R_PPC_DTPREL16_LO; break; + case BFD_RELOC_PPC_DTPREL16_HI: r = R_PPC_DTPREL16_HI; break; + case BFD_RELOC_PPC_DTPREL16_HA: r = R_PPC_DTPREL16_HA; break; + case BFD_RELOC_PPC_DTPREL: r = R_PPC_DTPREL32; break; + case BFD_RELOC_PPC_GOT_TLSGD16: r = R_PPC_GOT_TLSGD16; break; + case BFD_RELOC_PPC_GOT_TLSGD16_LO: r = R_PPC_GOT_TLSGD16_LO; break; + case BFD_RELOC_PPC_GOT_TLSGD16_HI: r = R_PPC_GOT_TLSGD16_HI; break; + case BFD_RELOC_PPC_GOT_TLSGD16_HA: r = R_PPC_GOT_TLSGD16_HA; break; + case BFD_RELOC_PPC_GOT_TLSLD16: r = R_PPC_GOT_TLSLD16; break; + case BFD_RELOC_PPC_GOT_TLSLD16_LO: r = R_PPC_GOT_TLSLD16_LO; break; + case BFD_RELOC_PPC_GOT_TLSLD16_HI: r = R_PPC_GOT_TLSLD16_HI; break; + case BFD_RELOC_PPC_GOT_TLSLD16_HA: r = R_PPC_GOT_TLSLD16_HA; break; + case BFD_RELOC_PPC_GOT_TPREL16: r = R_PPC_GOT_TPREL16; break; + case BFD_RELOC_PPC_GOT_TPREL16_LO: r = R_PPC_GOT_TPREL16_LO; break; + case BFD_RELOC_PPC_GOT_TPREL16_HI: r = R_PPC_GOT_TPREL16_HI; break; + case BFD_RELOC_PPC_GOT_TPREL16_HA: r = R_PPC_GOT_TPREL16_HA; break; + case BFD_RELOC_PPC_GOT_DTPREL16: r = R_PPC_GOT_DTPREL16; break; + case BFD_RELOC_PPC_GOT_DTPREL16_LO: r = R_PPC_GOT_DTPREL16_LO; break; + case BFD_RELOC_PPC_GOT_DTPREL16_HI: r = R_PPC_GOT_DTPREL16_HI; break; + case BFD_RELOC_PPC_GOT_DTPREL16_HA: r = R_PPC_GOT_DTPREL16_HA; break; + case BFD_RELOC_PPC_EMB_NADDR32: r = R_PPC_EMB_NADDR32; break; + case BFD_RELOC_PPC_EMB_NADDR16: r = R_PPC_EMB_NADDR16; break; + case BFD_RELOC_PPC_EMB_NADDR16_LO: r = R_PPC_EMB_NADDR16_LO; break; + case BFD_RELOC_PPC_EMB_NADDR16_HI: r = R_PPC_EMB_NADDR16_HI; break; + case BFD_RELOC_PPC_EMB_NADDR16_HA: r = R_PPC_EMB_NADDR16_HA; break; + case BFD_RELOC_PPC_EMB_SDAI16: r = R_PPC_EMB_SDAI16; break; + case BFD_RELOC_PPC_EMB_SDA2I16: r = R_PPC_EMB_SDA2I16; break; + case BFD_RELOC_PPC_EMB_SDA2REL: r = R_PPC_EMB_SDA2REL; break; + case BFD_RELOC_PPC_EMB_SDA21: r = R_PPC_EMB_SDA21; break; + case BFD_RELOC_PPC_EMB_MRKREF: r = R_PPC_EMB_MRKREF; break; + case BFD_RELOC_PPC_EMB_RELSEC16: r = R_PPC_EMB_RELSEC16; break; + case BFD_RELOC_PPC_EMB_RELST_LO: r = R_PPC_EMB_RELST_LO; break; + case BFD_RELOC_PPC_EMB_RELST_HI: r = R_PPC_EMB_RELST_HI; break; + case BFD_RELOC_PPC_EMB_RELST_HA: r = R_PPC_EMB_RELST_HA; break; + case BFD_RELOC_PPC_EMB_BIT_FLD: r = R_PPC_EMB_BIT_FLD; break; + case BFD_RELOC_PPC_EMB_RELSDA: r = R_PPC_EMB_RELSDA; break; + case BFD_RELOC_VTABLE_INHERIT: r = R_PPC_GNU_VTINHERIT; break; + case BFD_RELOC_VTABLE_ENTRY: r = R_PPC_GNU_VTENTRY; break; + } + + return ppc_elf_howto_table[r]; }; /* Set the howto pointer for a PowerPC ELF reloc. */ static void -ppc_elf_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr; - Elf32_Internal_Rela *dst; +ppc_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, + arelent *cache_ptr, + Elf_Internal_Rela *dst) { + /* Initialize howto table if not already done. */ if (!ppc_elf_howto_table[R_PPC_ADDR32]) - /* Initialize howto table if needed. */ ppc_elf_howto_init (); BFD_ASSERT (ELF32_R_TYPE (dst->r_info) < (unsigned int) R_PPC_max); @@ -1346,15 +2119,13 @@ ppc_elf_info_to_howto (abfd, cache_ptr, dst) /* Handle the R_PPC_ADDR16_HA reloc. */ static bfd_reloc_status_type -ppc_elf_addr16_ha_reloc (abfd, reloc_entry, symbol, data, input_section, - output_bfd, error_message) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *reloc_entry; - asymbol *symbol; - PTR data ATTRIBUTE_UNUSED; - asection *input_section; - bfd *output_bfd; - char **error_message ATTRIBUTE_UNUSED; +ppc_elf_addr16_ha_reloc (bfd *abfd ATTRIBUTE_UNUSED, + arelent *reloc_entry, + asymbol *symbol, + void *data ATTRIBUTE_UNUSED, + asection *input_section, + bfd *output_bfd, + char **error_message ATTRIBUTE_UNUSED) { bfd_vma relocation; @@ -1381,12 +2152,37 @@ ppc_elf_addr16_ha_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_continue; } +static bfd_reloc_status_type +ppc_elf_unhandled_reloc (bfd *abfd, + arelent *reloc_entry, + asymbol *symbol, + void *data, + asection *input_section, + bfd *output_bfd, + char **error_message) +{ + /* If this is a relocatable link (output_bfd test tells us), just + call the generic function. Any adjustment will be done at final + link time. */ + if (output_bfd != NULL) + return bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, + input_section, output_bfd, error_message); + + if (error_message != NULL) + { + static char buf[60]; + sprintf (buf, _("generic linker can't handle %s"), + reloc_entry->howto->name); + *error_message = buf; + } + return bfd_reloc_dangerous; +} + /* Fix bad default arch selected for a 32 bit input bfd when the default is 64 bit. */ -static boolean -ppc_elf_object_p (abfd) - bfd *abfd; +static bfd_boolean +ppc_elf_object_p (bfd *abfd) { if (abfd->arch_info->the_default && abfd->arch_info->bits_per_word == 64) { @@ -1399,73 +2195,75 @@ ppc_elf_object_p (abfd) BFD_ASSERT (abfd->arch_info->bits_per_word == 32); } } - return true; + return TRUE; } /* Function to set whether a module needs the -mrelocatable bit set. */ -static boolean -ppc_elf_set_private_flags (abfd, flags) - bfd *abfd; - flagword flags; +static bfd_boolean +ppc_elf_set_private_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; + elf_flags_init (abfd) = TRUE; + return TRUE; } /* Merge backend specific data from an object file to the output - object file when linking */ -static boolean -ppc_elf_merge_private_bfd_data (ibfd, obfd) - bfd *ibfd; - bfd *obfd; + object file when linking. */ + +static bfd_boolean +ppc_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) { flagword old_flags; flagword new_flags; - boolean error; + bfd_boolean error; - /* Check if we have the same endianess */ + /* Check if we have the same endianess. */ if (! _bfd_generic_verify_endian_match (ibfd, obfd)) - return false; + return FALSE; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) - return true; + return TRUE; new_flags = elf_elfheader (ibfd)->e_flags; old_flags = elf_elfheader (obfd)->e_flags; - if (!elf_flags_init (obfd)) /* First call, no flags set */ + if (!elf_flags_init (obfd)) { - elf_flags_init (obfd) = true; + /* First call, no flags set. */ + elf_flags_init (obfd) = TRUE; elf_elfheader (obfd)->e_flags = new_flags; } - else if (new_flags == old_flags) /* Compatible flags are ok */ + /* Compatible flags are ok. */ + else if (new_flags == old_flags) ; - else /* Incompatible flags */ + /* Incompatible flags. */ + else { - /* Warn about -mrelocatable mismatch. Allow -mrelocatable-lib to be linked - with either. */ - error = false; + /* Warn about -mrelocatable mismatch. Allow -mrelocatable-lib + to be linked with either. */ + error = FALSE; if ((new_flags & EF_PPC_RELOCATABLE) != 0 && (old_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0) { - error = true; + error = TRUE; (*_bfd_error_handler) - (_("%s: compiled with -mrelocatable and linked with modules compiled normally"), + (_("%s: compiled with -mrelocatable and linked with " + "modules compiled normally"), bfd_archive_filename (ibfd)); } else if ((new_flags & (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB)) == 0 && (old_flags & EF_PPC_RELOCATABLE) != 0) { - error = true; + error = TRUE; (*_bfd_error_handler) - (_("%s: compiled normally and linked with modules compiled with -mrelocatable"), + (_("%s: compiled normally and linked with " + "modules compiled with -mrelocatable"), bfd_archive_filename (ibfd)); } @@ -1474,147 +2272,433 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) elf_elfheader (obfd)->e_flags &= ~EF_PPC_RELOCATABLE_LIB; /* The output is -mrelocatable iff it can't be -mrelocatable-lib, - but each input file is either -mrelocatable or -mrelocatable-lib. */ + but each input file is either -mrelocatable or -mrelocatable-lib. */ if (! (elf_elfheader (obfd)->e_flags & EF_PPC_RELOCATABLE_LIB) && (new_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE)) && (old_flags & (EF_PPC_RELOCATABLE_LIB | EF_PPC_RELOCATABLE))) elf_elfheader (obfd)->e_flags |= EF_PPC_RELOCATABLE; - /* Do not warn about eabi vs. V.4 mismatch, just or in the bit if any module uses it */ - elf_elfheader (obfd)->e_flags |= (new_flags & EF_PPC_EMB); + /* Do not warn about eabi vs. V.4 mismatch, just or in the bit if + any module uses it. */ + elf_elfheader (obfd)->e_flags |= (new_flags & EF_PPC_EMB); + + new_flags &= ~(EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB); + old_flags &= ~(EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB); + + /* Warn about any other mismatches. */ + if (new_flags != old_flags) + { + error = TRUE; + (*_bfd_error_handler) + (_("%s: uses different e_flags (0x%lx) fields " + "than previous modules (0x%lx)"), + bfd_archive_filename (ibfd), (long) new_flags, (long) old_flags); + } + + if (error) + { + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + } + + return TRUE; +} + +/* Handle a PowerPC specific section when reading an object file. This + is called when elfcode.h finds a section with an unknown type. */ + +static bfd_boolean +ppc_elf_section_from_shdr (bfd *abfd, Elf_Internal_Shdr *hdr, const char *name) +{ + asection *newsect; + flagword flags; + + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) + return FALSE; + + newsect = hdr->bfd_section; + flags = bfd_get_section_flags (abfd, newsect); + if (hdr->sh_flags & SHF_EXCLUDE) + flags |= SEC_EXCLUDE; + + if (hdr->sh_type == SHT_ORDERED) + flags |= SEC_SORT_ENTRIES; + + bfd_set_section_flags (abfd, newsect, flags); + return TRUE; +} + +/* Set up any other section flags and such that may be necessary. */ + +static bfd_boolean +ppc_elf_fake_sections (bfd *abfd ATTRIBUTE_UNUSED, + Elf_Internal_Shdr *shdr, + asection *asect) +{ + if ((asect->flags & SEC_EXCLUDE) != 0) + shdr->sh_flags |= SHF_EXCLUDE; + + if ((asect->flags & SEC_SORT_ENTRIES) != 0) + shdr->sh_type = SHT_ORDERED; + + return TRUE; +} + +/* Find a linker generated pointer with a given addend and type. */ + +static elf_linker_section_pointers_t * +elf_find_pointer_linker_section + (elf_linker_section_pointers_t *linker_pointers, + bfd_vma addend, + elf_linker_section_t *lsect) +{ + for ( ; linker_pointers != NULL; linker_pointers = linker_pointers->next) + if (lsect == linker_pointers->lsect && addend == linker_pointers->addend) + return linker_pointers; + + return NULL; +} + +/* Allocate a pointer to live in a linker created section. */ + +static bfd_boolean +elf_create_pointer_linker_section (bfd *abfd, + struct bfd_link_info *info, + elf_linker_section_t *lsect, + struct elf_link_hash_entry *h, + const Elf_Internal_Rela *rel) +{ + elf_linker_section_pointers_t **ptr_linker_section_ptr = NULL; + elf_linker_section_pointers_t *linker_section_ptr; + unsigned long r_symndx = ELF32_R_SYM (rel->r_info); + bfd_size_type amt; + + BFD_ASSERT (lsect != NULL); + + /* Is this a global symbol? */ + if (h != NULL) + { + struct ppc_elf_link_hash_entry *eh; + + /* Has this symbol already been allocated? If so, our work is done. */ + eh = (struct ppc_elf_link_hash_entry *) h; + if (elf_find_pointer_linker_section (eh->linker_section_pointer, + rel->r_addend, + lsect)) + return TRUE; + + ptr_linker_section_ptr = &eh->linker_section_pointer; + /* Make sure this symbol is output as a dynamic symbol. */ + if (h->dynindx == -1) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + if (lsect->rel_section) + lsect->rel_section->_raw_size += sizeof (Elf32_External_Rela); + } + else + { + /* Allocation of a pointer to a local symbol. */ + elf_linker_section_pointers_t **ptr = elf_local_ptr_offsets (abfd); + + /* Allocate a table to hold the local symbols if first time. */ + if (!ptr) + { + unsigned int num_symbols = elf_tdata (abfd)->symtab_hdr.sh_info; + + amt = num_symbols; + amt *= sizeof (elf_linker_section_pointers_t *); + ptr = bfd_zalloc (abfd, amt); + + if (!ptr) + return FALSE; + + elf_local_ptr_offsets (abfd) = ptr; + } + + /* Has this symbol already been allocated? If so, our work is done. */ + if (elf_find_pointer_linker_section (ptr[r_symndx], + rel->r_addend, + lsect)) + return TRUE; + + ptr_linker_section_ptr = &ptr[r_symndx]; + + if (info->shared) + { + /* If we are generating a shared object, we need to + output a R__RELATIVE reloc so that the + dynamic linker can adjust this GOT entry. */ + BFD_ASSERT (lsect->rel_section != NULL); + lsect->rel_section->_raw_size += sizeof (Elf32_External_Rela); + } + } + + /* Allocate space for a pointer in the linker section, and allocate + a new pointer record from internal memory. */ + BFD_ASSERT (ptr_linker_section_ptr != NULL); + amt = sizeof (elf_linker_section_pointers_t); + linker_section_ptr = bfd_alloc (abfd, amt); + + if (!linker_section_ptr) + return FALSE; + + linker_section_ptr->next = *ptr_linker_section_ptr; + linker_section_ptr->addend = rel->r_addend; + linker_section_ptr->lsect = lsect; + linker_section_ptr->written_address_p = FALSE; + *ptr_linker_section_ptr = linker_section_ptr; + + linker_section_ptr->offset = lsect->section->_raw_size; + lsect->section->_raw_size += 4; + +#ifdef DEBUG + fprintf (stderr, + "Create pointer in linker section %s, offset = %ld, section size = %ld\n", + lsect->name, (long) linker_section_ptr->offset, + (long) lsect->section->_raw_size); +#endif + + return TRUE; +} + +#define bfd_put_ptr(BFD, VAL, ADDR) bfd_put_32 (BFD, VAL, ADDR) + +/* Fill in the address for a pointer generated in a linker section. */ + +static bfd_vma +elf_finish_pointer_linker_section (bfd *output_bfd, + bfd *input_bfd, + struct bfd_link_info *info, + elf_linker_section_t *lsect, + struct elf_link_hash_entry *h, + bfd_vma relocation, + const Elf_Internal_Rela *rel, + int relative_reloc) +{ + elf_linker_section_pointers_t *linker_section_ptr; + + BFD_ASSERT (lsect != NULL); - new_flags &= ~ (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB); - old_flags &= ~ (EF_PPC_RELOCATABLE | EF_PPC_RELOCATABLE_LIB | EF_PPC_EMB); + if (h != NULL) + { + /* Handle global symbol. */ + struct ppc_elf_link_hash_entry *eh; - /* Warn about any other mismatches */ - if (new_flags != old_flags) - { - error = true; - (*_bfd_error_handler) - (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), - bfd_archive_filename (ibfd), (long) new_flags, (long) old_flags); - } + eh = (struct ppc_elf_link_hash_entry *) h; + linker_section_ptr + = elf_find_pointer_linker_section (eh->linker_section_pointer, + rel->r_addend, + lsect); - if (error) + BFD_ASSERT (linker_section_ptr != NULL); + + if (! elf_hash_table (info)->dynamic_sections_created + || (info->shared + && info->symbolic + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) { - bfd_set_error (bfd_error_bad_value); - return false; + /* This is actually a static link, or it is a + -Bsymbolic link and the symbol is defined + locally. We must initialize this entry in the + global section. + + When doing a dynamic link, we create a .rela. + relocation entry to initialize the value. This + is done in the finish_dynamic_symbol routine. */ + if (!linker_section_ptr->written_address_p) + { + linker_section_ptr->written_address_p = TRUE; + bfd_put_ptr (output_bfd, + relocation + linker_section_ptr->addend, + (lsect->section->contents + + linker_section_ptr->offset)); + } } } + else + { + /* Handle local symbol. */ + unsigned long r_symndx = ELF32_R_SYM (rel->r_info); + BFD_ASSERT (elf_local_ptr_offsets (input_bfd) != NULL); + BFD_ASSERT (elf_local_ptr_offsets (input_bfd)[r_symndx] != NULL); + linker_section_ptr = (elf_find_pointer_linker_section + (elf_local_ptr_offsets (input_bfd)[r_symndx], + rel->r_addend, + lsect)); + + BFD_ASSERT (linker_section_ptr != NULL); + + /* Write out pointer if it hasn't been rewritten out before. */ + if (!linker_section_ptr->written_address_p) + { + linker_section_ptr->written_address_p = TRUE; + bfd_put_ptr (output_bfd, relocation + linker_section_ptr->addend, + lsect->section->contents + linker_section_ptr->offset); - return true; -} - -/* Handle a PowerPC specific section when reading an object file. This - is called when elfcode.h finds a section with an unknown type. */ - -static boolean -ppc_elf_section_from_shdr (abfd, hdr, name) - bfd *abfd; - Elf32_Internal_Shdr *hdr; - const char *name; -{ - asection *newsect; - flagword flags; - - if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) - return false; + if (info->shared) + { + /* We need to generate a relative reloc for the dynamic + linker. */ - newsect = hdr->bfd_section; - flags = bfd_get_section_flags (abfd, newsect); - if (hdr->sh_flags & SHF_EXCLUDE) - flags |= SEC_EXCLUDE; + asection *srel = lsect->rel_section; + Elf_Internal_Rela outrel[MAX_INT_RELS_PER_EXT_REL]; + bfd_byte *erel; + const struct elf_backend_data *bed; + unsigned int i; - if (hdr->sh_type == SHT_ORDERED) - flags |= SEC_SORT_ENTRIES; + BFD_ASSERT (srel != NULL); - bfd_set_section_flags (abfd, newsect, flags); - return true; -} - -/* Set up any other section flags and such that may be necessary. */ + bed = get_elf_backend_data (output_bfd); + for (i = 0; i < bed->s->int_rels_per_ext_rel; i++) + { + outrel[i].r_offset = (lsect->section->output_section->vma + + lsect->section->output_offset + + linker_section_ptr->offset); + outrel[i].r_info = 0; + outrel[i].r_addend = 0; + } + outrel[0].r_info = ELF32_R_INFO (0, relative_reloc); + erel = lsect->section->contents; + erel += (elf_section_data (lsect->section)->rel_count++ + * sizeof (Elf32_External_Rela)); + bfd_elf32_swap_reloca_out (output_bfd, outrel, erel); + } + } + } -static boolean -ppc_elf_fake_sections (abfd, shdr, asect) - bfd *abfd ATTRIBUTE_UNUSED; - Elf32_Internal_Shdr *shdr; - asection *asect; -{ - if ((asect->flags & SEC_EXCLUDE) != 0) - shdr->sh_flags |= SHF_EXCLUDE; + relocation = (lsect->section->output_offset + + linker_section_ptr->offset + - lsect->sym_offset); - if ((asect->flags & SEC_SORT_ENTRIES) != 0) - shdr->sh_type = SHT_ORDERED; +#ifdef DEBUG + fprintf (stderr, + "Finish pointer in linker section %s, offset = %ld (0x%lx)\n", + lsect->name, (long) relocation, (long) relocation); +#endif - return true; + /* Subtract out the addend, because it will get added back in by the normal + processing. */ + return relocation - linker_section_ptr->addend; } /* Create a special linker section */ static elf_linker_section_t * -ppc_elf_create_linker_section (abfd, info, which) - bfd *abfd; - struct bfd_link_info *info; - enum elf_linker_section_enum which; +ppc_elf_create_linker_section (bfd *abfd, + struct bfd_link_info *info, + enum elf_linker_section_enum which) { - bfd *dynobj = elf_hash_table (info)->dynobj; elf_linker_section_t *lsect; + struct ppc_elf_link_hash_table *htab = ppc_elf_hash_table (info); + asection *s; + bfd_size_type amt; + flagword flags; + const char *name; + const char *rel_name; + const char *sym_name; + bfd_vma sym_offset; + + /* Both of these sections are (technically) created by the user + putting data in them, so they shouldn't be marked + SEC_LINKER_CREATED. + + The linker creates them so it has somewhere to attach their + respective symbols. In fact, if they were empty it would + be OK to leave the symbol set to 0 (or any random number), because + the appropriate register should never be used. */ + flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY; + sym_offset = 32768; + + switch (which) + { + default: + abort (); + return NULL; + + case LINKER_SECTION_SDATA: /* .sdata/.sbss section */ + name = ".sdata"; + rel_name = ".rela.sdata"; + sym_name = "_SDA_BASE_"; + break; + + case LINKER_SECTION_SDATA2: /* .sdata2/.sbss2 section */ + name = ".sdata2"; + rel_name = ".rela.sdata2"; + sym_name = "_SDA2_BASE_"; + flags |= SEC_READONLY; + break; + } - /* Record the first bfd section that needs the special section */ - if (!dynobj) - dynobj = elf_hash_table (info)->dynobj = abfd; + /* Record the first bfd that needs the special sections. */ + if (!htab->elf.dynobj) + htab->elf.dynobj = abfd; - /* If this is the first time, create the section */ - lsect = elf_linker_section (dynobj, which); - if (!lsect) + amt = sizeof (elf_linker_section_t); + lsect = bfd_zalloc (htab->elf.dynobj, amt); + + lsect->sym_offset = sym_offset; + + /* See if the sections already exist. */ + s = bfd_get_section_by_name (htab->elf.dynobj, name); + if (s == NULL || (s->flags & flags) != flags) { - elf_linker_section_t defaults; - static elf_linker_section_t zero_section; + s = bfd_make_section_anyway (htab->elf.dynobj, name); + if (s == NULL + || !bfd_set_section_flags (htab->elf.dynobj, s, flags)) + return NULL; + } + lsect->section = s; - defaults = zero_section; - defaults.which = which; - defaults.hole_written_p = false; - defaults.alignment = 2; + if (bfd_get_section_alignment (htab->elf.dynobj, s) < 2 + && !bfd_set_section_alignment (htab->elf.dynobj, s, 2)) + return NULL; - /* Both of these sections are (technically) created by the user - putting data in them, so they shouldn't be marked - SEC_LINKER_CREATED. + s->_raw_size = align_power (s->_raw_size, 2); - The linker creates them so it has somewhere to attach their - respective symbols. In fact, if they were empty it would - be OK to leave the symbol set to 0 (or any random number), because - the appropriate register should never be used. */ - defaults.flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS - | SEC_IN_MEMORY); +#ifdef DEBUG + fprintf (stderr, "Creating section %s, current size = %ld\n", + name, (long) s->_raw_size); +#endif - switch (which) - { - default: - (*_bfd_error_handler) (_("%s: Unknown special linker type %d"), - bfd_get_filename (abfd), - (int) which); + if (sym_name) + { + struct elf_link_hash_entry *h; + struct bfd_link_hash_entry *bh; - bfd_set_error (bfd_error_bad_value); - return (elf_linker_section_t *) 0; - - case LINKER_SECTION_SDATA: /* .sdata/.sbss section */ - defaults.name = ".sdata"; - defaults.rel_name = ".rela.sdata"; - defaults.bss_name = ".sbss"; - defaults.sym_name = "_SDA_BASE_"; - defaults.sym_offset = 32768; - break; +#ifdef DEBUG + fprintf (stderr, "Adding %s to section %s\n", sym_name, name); +#endif + bh = bfd_link_hash_lookup (info->hash, sym_name, + FALSE, FALSE, FALSE); - case LINKER_SECTION_SDATA2: /* .sdata2/.sbss2 section */ - defaults.name = ".sdata2"; - defaults.rel_name = ".rela.sdata2"; - defaults.bss_name = ".sbss2"; - defaults.sym_name = "_SDA2_BASE_"; - defaults.sym_offset = 32768; - defaults.flags |= SEC_READONLY; - break; - } + if ((bh == NULL || bh->type == bfd_link_hash_undefined) + && !(_bfd_generic_link_add_one_symbol + (info, abfd, sym_name, BSF_GLOBAL, s, sym_offset, NULL, + FALSE, get_elf_backend_data (abfd)->collect, &bh))) + return NULL; + h = (struct elf_link_hash_entry *) bh; + + h->type = STT_OBJECT; + lsect->sym_hash = h; + + if (info->shared + && ! bfd_elf_link_record_dynamic_symbol (info, h)) + return NULL; + } - lsect = _bfd_elf_create_linker_section (abfd, info, which, &defaults); + if (info->shared) + { + s = bfd_make_section_anyway (htab->elf.dynobj, rel_name); + lsect->rel_section = s; + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_LINKER_CREATED | SEC_READONLY); + if (s == NULL + || ! bfd_set_section_flags (htab->elf.dynobj, s, flags) + || ! bfd_set_section_alignment (htab->elf.dynobj, s, 2)) + return NULL; } return lsect; @@ -1624,8 +2708,7 @@ ppc_elf_create_linker_section (abfd, info, which) need to bump up the number of section headers. */ static int -ppc_elf_additional_program_headers (abfd) - bfd *abfd; +ppc_elf_additional_program_headers (bfd *abfd) { asection *s; int ret; @@ -1649,73 +2732,88 @@ ppc_elf_additional_program_headers (abfd) /* Modify the segment map if needed. */ -static boolean -ppc_elf_modify_segment_map (abfd) - bfd *abfd ATTRIBUTE_UNUSED; +static bfd_boolean +ppc_elf_modify_segment_map (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { - return true; + return TRUE; } /* The powerpc .got has a blrl instruction in it. Mark it executable. */ -static asection * -ppc_elf_create_got (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +static bfd_boolean +ppc_elf_create_got (bfd *abfd, struct bfd_link_info *info) { - register asection *s; + struct ppc_elf_link_hash_table *htab; + asection *s; flagword flags; if (!_bfd_elf_create_got_section (abfd, info)) - return NULL; + return FALSE; - s = bfd_get_section_by_name (abfd, ".got"); + htab = ppc_elf_hash_table (info); + htab->got = s = bfd_get_section_by_name (abfd, ".got"); if (s == NULL) abort (); flags = (SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); if (!bfd_set_section_flags (abfd, s, flags)) - return NULL; - return s; + return FALSE; + + htab->relgot = bfd_make_section (abfd, ".rela.got"); + if (!htab->relgot + || ! bfd_set_section_flags (abfd, htab->relgot, + (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED + | SEC_READONLY)) + || ! bfd_set_section_alignment (abfd, htab->relgot, 2)) + return FALSE; + + return TRUE; } /* We have to create .dynsbss and .rela.sbss here so that they get mapped to output sections (just like _bfd_elf_create_dynamic_sections has to create .dynbss and .rela.bss). */ -static boolean -ppc_elf_create_dynamic_sections (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +static bfd_boolean +ppc_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) { - register asection *s; + struct ppc_elf_link_hash_table *htab; + asection *s; flagword flags; - if (!ppc_elf_create_got (abfd, info)) - return false; + htab = ppc_elf_hash_table (info); + + if (htab->got == NULL + && !ppc_elf_create_got (abfd, info)) + return FALSE; if (!_bfd_elf_create_dynamic_sections (abfd, info)) - return false; + return FALSE; flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - s = bfd_make_section (abfd, ".dynsbss"); + htab->dynbss = bfd_get_section_by_name (abfd, ".dynbss"); + htab->dynsbss = s = bfd_make_section (abfd, ".dynsbss"); if (s == NULL || ! bfd_set_section_flags (abfd, s, SEC_ALLOC)) - return false; + return FALSE; if (! info->shared) { - s = bfd_make_section (abfd, ".rela.sbss"); + htab->relbss = bfd_get_section_by_name (abfd, ".rela.bss"); + htab->relsbss = s = bfd_make_section (abfd, ".rela.sbss"); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) - return false; + return FALSE; } - s = bfd_get_section_by_name (abfd, ".plt"); + htab->relplt = bfd_get_section_by_name (abfd, ".rela.plt"); + htab->plt = s = bfd_get_section_by_name (abfd, ".plt"); if (s == NULL) abort (); @@ -1729,22 +2827,22 @@ ppc_elf_create_dynamic_sections (abfd, info) change the definition to something the rest of the link can understand. */ -static boolean -ppc_elf_adjust_dynamic_symbol (info, h) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; +static bfd_boolean +ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) { - bfd *dynobj = elf_hash_table (info)->dynobj; + struct ppc_elf_link_hash_table *htab; asection *s; unsigned int power_of_two; - bfd_vma plt_offset; #ifdef DEBUG - fprintf (stderr, "ppc_elf_adjust_dynamic_symbol called for %s\n", h->root.root.string); + fprintf (stderr, "ppc_elf_adjust_dynamic_symbol called for %s\n", + h->root.root.string); #endif /* Make sure we know what is going on here. */ - BFD_ASSERT (dynobj != NULL + htab = ppc_elf_hash_table (info); + BFD_ASSERT (htab->elf.dynobj != NULL && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) || h->weakdef != NULL || ((h->elf_link_hash_flags @@ -1754,86 +2852,31 @@ 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. */ + /* Deal with function syms. */ if (h->type == STT_FUNC || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { - if (! elf_hash_table (info)->dynamic_sections_created - || SYMBOL_CALLS_LOCAL (info, h) - || (info->shared && h->plt.refcount <= 0)) + /* Clear procedure linkage table information for any symbol that + won't need a .plt entry. */ + if (h->plt.refcount <= 0 + || SYMBOL_CALLS_LOCAL (info, h) + || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak)) { /* A PLT entry is not required/allowed when: 1. We are not using ld.so; because then the PLT entry - can't be set up, so we can't use one. + can't be set up, so we can't use one. In this case, + ppc_elf_adjust_dynamic_symbol won't even be called. - 2. We know for certain that a call to this symbol - will go to this object. + 2. GC has rendered the entry unused. - 3. GC has rendered the entry unused. - Note, however, that in an executable all references to the - symbol go to the PLT, so we can't turn it off in that case. - ??? The correct thing to do here is to reference count - all uses of the symbol, not just those to the GOT or PLT. */ + 3. We know for certain that a call to this symbol + will go to this object, or will remain undefined. */ h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - return true; - } - - /* Make sure this symbol is output as a dynamic symbol. */ - if (h->dynindx == -1) - { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; - } - BFD_ASSERT (h->dynindx != -1); - - 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_INITIAL_ENTRY_SIZE; - - /* The PowerPC PLT is actually composed of two parts, the first part - is 2 words (for a load and a jump), and then there is a remaining - word available at the end. */ - plt_offset = (PLT_INITIAL_ENTRY_SIZE - + (PLT_SLOT_SIZE - * ((s->_raw_size - PLT_INITIAL_ENTRY_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 = plt_offset; } - - h->plt.offset = plt_offset; - - /* Make room for this entry. After the 8192nd entry, room - for two entries is allocated. */ - if ((s->_raw_size - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE - >= PLT_NUM_SINGLE_ENTRIES) - s->_raw_size += 2 * PLT_ENTRY_SIZE; - else - s->_raw_size += PLT_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 (Elf32_External_Rela); - - return true; + return TRUE; } else h->plt.offset = (bfd_vma) -1; @@ -1847,7 +2890,11 @@ ppc_elf_adjust_dynamic_symbol (info, h) || 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 (ELIMINATE_COPY_RELOCS) + h->elf_link_hash_flags + = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF) + | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF)); + return TRUE; } /* This is a reference to a symbol defined by a dynamic object which @@ -1858,7 +2905,31 @@ ppc_elf_adjust_dynamic_symbol (info, h) For such cases we need not do anything here; the relocations will be handled correctly by relocate_section. */ if (info->shared) - return true; + 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; + + if (ELIMINATE_COPY_RELOCS) + { + struct ppc_elf_dyn_relocs *p; + for (p = ppc_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + break; + } + + /* If we didn't find any dynamic relocs in read-only sections, then + we'll be keeping the dynamic relocs and avoiding the copy reloc. */ + if (p == NULL) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return TRUE; + } + } /* We must allocate the symbol in our .dynbss section, which will become part of the .bss section of the executable. There will be @@ -1874,10 +2945,10 @@ ppc_elf_adjust_dynamic_symbol (info, h) allocate it in .sbss. FIXME: It would be better to do this if and only if there were actually SDAREL relocs for that symbol. */ - if (h->size <= elf_gp_size (dynobj)) - s = bfd_get_section_by_name (dynobj, ".dynsbss"); + if (h->size <= elf_gp_size (htab->elf.dynobj)) + s = htab->dynsbss; else - s = bfd_get_section_by_name (dynobj, ".dynbss"); + s = htab->dynbss; BFD_ASSERT (s != NULL); /* We must generate a R_PPC_COPY reloc to tell the dynamic linker to @@ -1888,10 +2959,10 @@ ppc_elf_adjust_dynamic_symbol (info, h) { asection *srel; - if (h->size <= elf_gp_size (dynobj)) - srel = bfd_get_section_by_name (dynobj, ".rela.sbss"); + if (h->size <= elf_gp_size (htab->elf.dynobj)) + srel = htab->relsbss; else - srel = bfd_get_section_by_name (dynobj, ".rela.bss"); + srel = htab->relbss; BFD_ASSERT (srel != NULL); srel->_raw_size += sizeof (Elf32_External_Rela); h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY; @@ -1906,10 +2977,10 @@ ppc_elf_adjust_dynamic_symbol (info, h) /* 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 (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) { - if (! bfd_set_section_alignment (dynobj, s, power_of_two)) - return false; + if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) + return FALSE; } /* Define the symbol as being at this point in the section. */ @@ -1919,93 +2990,426 @@ ppc_elf_adjust_dynamic_symbol (info, h) /* Increment the section size to make room for the symbol. */ s->_raw_size += h->size; - return true; + return TRUE; } +/* Of those relocs that might be copied as dynamic relocs, this macro + selects those that must be copied when linking a shared library, + even when the symbol is local. */ + +#define MUST_BE_DYN_RELOC(RTYPE) \ + ((RTYPE) != R_PPC_REL24 \ + && (RTYPE) != R_PPC_REL14 \ + && (RTYPE) != R_PPC_REL14_BRTAKEN \ + && (RTYPE) != R_PPC_REL14_BRNTAKEN \ + && (RTYPE) != R_PPC_REL32) + +/* Allocate space in associated reloc sections for dynamic relocs. */ + +static bfd_boolean +allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) +{ + struct bfd_link_info *info = inf; + struct ppc_elf_link_hash_entry *eh; + struct ppc_elf_link_hash_table *htab; + struct ppc_elf_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_indirect) + return TRUE; + + if (h->root.type == bfd_link_hash_warning) + /* When warning symbols are created, they **replace** the "real" + entry in the hash table, thus we never get to see the real + symbol in a hash traversal. So look at it now. */ + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + htab = ppc_elf_hash_table (info); + if (htab->elf.dynamic_sections_created + && h->plt.refcount > 0) + { + /* 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_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + if (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) + { + asection *s = htab->plt; + + /* If this is the first .plt entry, make room for the special + first entry. */ + if (s->_raw_size == 0) + s->_raw_size += PLT_INITIAL_ENTRY_SIZE; + + /* The PowerPC PLT is actually composed of two parts, the + first part is 2 words (for a load and a jump), and then + there is a remaining word available at the end. */ + h->plt.offset = (PLT_INITIAL_ENTRY_SIZE + + (PLT_SLOT_SIZE + * ((s->_raw_size - PLT_INITIAL_ENTRY_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 = h->plt.offset; + } + + /* Make room for this entry. After the 8192nd entry, room + for two entries is allocated. */ + s->_raw_size += PLT_ENTRY_SIZE; + if ((s->_raw_size - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE + > PLT_NUM_SINGLE_ENTRIES) + s->_raw_size += PLT_ENTRY_SIZE; + + /* We also need to make an entry in the .rela.plt section. */ + htab->relplt->_raw_size += sizeof (Elf32_External_Rela); + } + else + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + } + else + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + + eh = (struct ppc_elf_link_hash_entry *) h; + if (eh->elf.got.refcount > 0) + { + /* Make sure this symbol is output as a dynamic symbol. */ + if (eh->elf.dynindx == -1 + && (eh->elf.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (!bfd_elf_link_record_dynamic_symbol (info, &eh->elf)) + return FALSE; + } + + if (eh->tls_mask == (TLS_TLS | TLS_LD) + && !(eh->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)) + /* If just an LD reloc, we'll just use htab->tlsld_got.offset. */ + eh->elf.got.offset = (bfd_vma) -1; + else + { + bfd_boolean dyn; + eh->elf.got.offset = htab->got->_raw_size; + if ((eh->tls_mask & TLS_TLS) != 0) + { + if ((eh->tls_mask & TLS_LD) != 0) + htab->got->_raw_size += 8; + if ((eh->tls_mask & TLS_GD) != 0) + htab->got->_raw_size += 8; + if ((eh->tls_mask & (TLS_TPREL | TLS_TPRELGD)) != 0) + htab->got->_raw_size += 4; + if ((eh->tls_mask & TLS_DTPREL) != 0) + htab->got->_raw_size += 4; + } + else + htab->got->_raw_size += 4; + dyn = htab->elf.dynamic_sections_created; + if ((info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, &eh->elf)) + && (ELF_ST_VISIBILITY (eh->elf.other) == STV_DEFAULT + || eh->elf.root.type != bfd_link_hash_undefweak)) + { + /* All the entries we allocated need relocs. */ + htab->relgot->_raw_size + += ((htab->got->_raw_size - eh->elf.got.offset) / 4 + * sizeof (Elf32_External_Rela)); + /* Except LD only needs one. */ + if ((eh->tls_mask & TLS_LD) != 0) + htab->relgot->_raw_size -= sizeof (Elf32_External_Rela); + } + } + } + else + eh->elf.got.offset = (bfd_vma) -1; + + if (eh->dyn_relocs == NULL) + return TRUE; + + /* In the shared -Bsymbolic case, discard space allocated for + dynamic pc-relative relocs against symbols which turn out to be + defined in regular objects. For the normal shared case, discard + space for relocs that have become local due to symbol visibility + changes. */ + + if (info->shared) + { + /* Relocs that use pc_count are those that appear on a call insn, + or certain REL relocs (see MUST_BE_DYN_RELOC) that can be + generated via assembly. We want calls to protected symbols to + resolve directly to the function rather than going via the plt. + If people want function pointer comparisons to work as expected + then they should avoid writing weird assembly. */ + if (SYMBOL_CALLS_LOCAL (info, h)) + { + struct ppc_elf_dyn_relocs **pp; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; ) + { + p->count -= p->pc_count; + p->pc_count = 0; + if (p->count == 0) + *pp = p->next; + else + pp = &p->next; + } + } + + /* Also discard relocs on undefined weak syms with non-default + visibility. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + eh->dyn_relocs = NULL; + + /* Make sure undefined weak symbols are output as a dynamic symbol + in PIEs. */ + if (info->pie + && eh->dyn_relocs != NULL + && h->dynindx == -1 + && h->root.type == bfd_link_hash_undefweak + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + } + else if (ELIMINATE_COPY_RELOCS) + { + /* For the non-shared case, discard space for relocs against + symbols which turn out to need copy relocs or are not + dynamic. */ + + if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + { + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + /* If that succeeded, we know we'll be keeping all the + relocs. */ + if (h->dynindx != -1) + goto keep; + } + + eh->dyn_relocs = NULL; + + keep: ; + } + + /* Finally, allocate space. */ + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + asection *sreloc = elf_section_data (p->sec)->sreloc; + sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela); + } + + return TRUE; +} + +/* Find any dynamic relocs that apply to read-only sections. */ + +static bfd_boolean +readonly_dynrelocs (struct elf_link_hash_entry *h, void *info) +{ + struct ppc_elf_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_indirect) + return TRUE; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + for (p = ppc_elf_hash_entry (h)->dyn_relocs; p != NULL; p = p->next) + { + asection *s = p->sec->output_section; + + if (s != NULL + && ((s->flags & (SEC_READONLY | SEC_ALLOC)) + == (SEC_READONLY | SEC_ALLOC))) + { + ((struct bfd_link_info *) info)->flags |= DF_TEXTREL; + + /* Not an error, just cut short the traversal. */ + return FALSE; + } + } + return TRUE; +} + /* Set the sizes of the dynamic sections. */ -static boolean -ppc_elf_size_dynamic_sections (output_bfd, info) - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; +static bfd_boolean +ppc_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) { - bfd *dynobj; + struct ppc_elf_link_hash_table *htab; asection *s; - boolean plt; - boolean relocs; + bfd_boolean relocs; + bfd *ibfd; #ifdef DEBUG fprintf (stderr, "ppc_elf_size_dynamic_sections called\n"); #endif - dynobj = elf_hash_table (info)->dynobj; - BFD_ASSERT (dynobj != NULL); + htab = ppc_elf_hash_table (info); + BFD_ASSERT (htab->elf.dynobj != NULL); if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { - s = bfd_get_section_by_name (dynobj, ".interp"); + s = bfd_get_section_by_name (htab->elf.dynobj, ".interp"); BFD_ASSERT (s != NULL); s->_raw_size = sizeof ELF_DYNAMIC_INTERPRETER; s->contents = (unsigned char *) ELF_DYNAMIC_INTERPRETER; } } + + if (htab->tlsld_got.refcount > 0) + { + htab->tlsld_got.offset = htab->got->_raw_size; + htab->got->_raw_size += 8; + if (info->shared) + htab->relgot->_raw_size += sizeof (Elf32_External_Rela); + } else + htab->tlsld_got.offset = (bfd_vma) -1; + + /* Set up .got offsets for local syms, and space for local dynamic + relocs. */ + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) { - /* We may have created entries in the .rela.got, .rela.sdata, and - .rela.sdata2 sections. However, if we are not creating the - dynamic sections, we will not actually use these entries. Reset - the size of .rela.got, et al, which will cause it to get - stripped from the output file below. */ - static char *rela_sections[] = { ".rela.got", ".rela.sdata", - ".rela.sdata2", ".rela.sbss", - (char *) 0 }; - char **p; + bfd_signed_vma *local_got; + bfd_signed_vma *end_local_got; + char *lgot_masks; + bfd_size_type locsymcount; + Elf_Internal_Shdr *symtab_hdr; + asection *srel; + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) + continue; - for (p = rela_sections; *p != (char *) 0; p++) + for (s = ibfd->sections; s != NULL; s = s->next) { - s = bfd_get_section_by_name (dynobj, *p); - if (s != NULL) - s->_raw_size = 0; + struct ppc_elf_dyn_relocs *p; + + for (p = ((struct ppc_elf_dyn_relocs *) + elf_section_data (s)->local_dynrel); + p != NULL; + p = p->next) + { + if (!bfd_is_abs_section (p->sec) + && bfd_is_abs_section (p->sec->output_section)) + { + /* Input section has been discarded, either because + it is a copy of a linkonce section or due to + linker script /DISCARD/, so we'll be discarding + the relocs too. */ + } + else if (p->count != 0) + { + elf_section_data (p->sec)->sreloc->_raw_size + += p->count * sizeof (Elf32_External_Rela); + if ((p->sec->output_section->flags + & (SEC_READONLY | SEC_ALLOC)) + == (SEC_READONLY | SEC_ALLOC)) + info->flags |= DF_TEXTREL; + } + } } + + local_got = elf_local_got_refcounts (ibfd); + if (!local_got) + continue; + + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + locsymcount = symtab_hdr->sh_info; + end_local_got = local_got + locsymcount; + lgot_masks = (char *) end_local_got; + s = htab->got; + srel = htab->relgot; + for (; local_got < end_local_got; ++local_got, ++lgot_masks) + if (*local_got > 0) + { + if (*lgot_masks == (TLS_TLS | TLS_LD)) + { + /* If just an LD reloc, we'll just use + htab->tlsld_got.offset. */ + if (htab->tlsld_got.offset == (bfd_vma) -1) + { + htab->tlsld_got.offset = s->_raw_size; + s->_raw_size += 8; + if (info->shared) + srel->_raw_size += sizeof (Elf32_External_Rela); + } + *local_got = (bfd_vma) -1; + } + else + { + *local_got = s->_raw_size; + if ((*lgot_masks & TLS_TLS) != 0) + { + if ((*lgot_masks & TLS_GD) != 0) + s->_raw_size += 8; + if ((*lgot_masks & (TLS_TPREL | TLS_TPRELGD)) != 0) + s->_raw_size += 4; + if ((*lgot_masks & TLS_DTPREL) != 0) + s->_raw_size += 4; + } + else + s->_raw_size += 4; + if (info->shared) + srel->_raw_size += ((s->_raw_size - *local_got) / 4 + * sizeof (Elf32_External_Rela)); + } + } + else + *local_got = (bfd_vma) -1; } - /* The check_relocs and adjust_dynamic_symbol entry points have - determined the sizes of the various dynamic sections. Allocate - memory for them. */ - plt = false; - relocs = false; - for (s = dynobj->sections; s != NULL; s = s->next) - { - const char *name; - boolean strip; + /* Allocate space for global sym dynamic relocs. */ + elf_link_hash_traverse (elf_hash_table (info), allocate_dynrelocs, info); + /* We've now determined the sizes of the various dynamic sections. + Allocate memory for them. */ + relocs = FALSE; + for (s = htab->elf.dynobj->sections; s != NULL; s = s->next) + { 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 == htab->plt + || s == htab->got + || (htab->sdata != NULL && s == htab->sdata->section) + || (htab->sdata2 != NULL && s == htab->sdata2->section)) { - 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; - } + /* Strip this section if we don't need it; see the + comment below. */ } - else if (strncmp (name, ".rela", 5) == 0) + else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) { if (s->_raw_size == 0) { @@ -2018,39 +3422,36 @@ ppc_elf_size_dynamic_sections (output_bfd, info) adjust_dynamic_symbol is called, and it is that function which decides whether anything needs to go into these sections. */ - strip = true; } else { /* Remember whether there are any relocation sections. */ - relocs = true; + relocs = TRUE; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ s->reloc_count = 0; } } - else if (strcmp (name, ".got") != 0 - && strcmp (name, ".sdata") != 0 - && strcmp (name, ".sdata2") != 0) + else { /* It's not one of our sections, so don't allocate space. */ continue; } - if (strip) + if (s->_raw_size == 0) { _bfd_strip_section_from_output (info, s); continue; } /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); - if (s->contents == NULL && s->_raw_size != 0) - return false; + s->contents = bfd_zalloc (htab->elf.dynobj, s->_raw_size); + if (s->contents == NULL) + return FALSE; } - if (elf_hash_table (info)->dynamic_sections_created) + if (htab->elf.dynamic_sections_created) { /* Add some entries to the .dynamic section. We fill in the values later, in ppc_elf_finish_dynamic_sections, but we @@ -2058,21 +3459,21 @@ ppc_elf_size_dynamic_sections (output_bfd, info) the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ #define add_dynamic_entry(TAG, VAL) \ - bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + _bfd_elf_add_dynamic_entry (info, TAG, VAL) - if (!info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) - return false; + return FALSE; } - if (plt) + if (htab->plt != NULL && htab->plt->_raw_size != 0) { if (!add_dynamic_entry (DT_PLTGOT, 0) || !add_dynamic_entry (DT_PLTRELSZ, 0) || !add_dynamic_entry (DT_PLTREL, DT_RELA) || !add_dynamic_entry (DT_JMPREL, 0)) - return false; + return FALSE; } if (relocs) @@ -2080,46 +3481,81 @@ ppc_elf_size_dynamic_sections (output_bfd, info) if (!add_dynamic_entry (DT_RELA, 0) || !add_dynamic_entry (DT_RELASZ, 0) || !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela))) - return false; + return FALSE; } + /* If any dynamic relocs apply to a read-only section, then we + need a DT_TEXTREL entry. */ + if ((info->flags & DF_TEXTREL) == 0) + elf_link_hash_traverse (elf_hash_table (info), readonly_dynrelocs, + info); + if ((info->flags & DF_TEXTREL) != 0) { if (!add_dynamic_entry (DT_TEXTREL, 0)) - return false; - info->flags |= DF_TEXTREL; + return FALSE; } } #undef add_dynamic_entry - return true; + return TRUE; } +static bfd_boolean +update_local_sym_info (bfd *abfd, + Elf_Internal_Shdr *symtab_hdr, + unsigned long r_symndx, + int tls_type) +{ + bfd_signed_vma *local_got_refcounts = elf_local_got_refcounts (abfd); + char *local_got_tls_masks; + + if (local_got_refcounts == NULL) + { + bfd_size_type size = symtab_hdr->sh_info; + + size *= sizeof (*local_got_refcounts) + sizeof (*local_got_tls_masks); + local_got_refcounts = bfd_zalloc (abfd, size); + if (local_got_refcounts == NULL) + return FALSE; + elf_local_got_refcounts (abfd) = local_got_refcounts; + } + + local_got_refcounts[r_symndx] += 1; + local_got_tls_masks = (char *) (local_got_refcounts + symtab_hdr->sh_info); + local_got_tls_masks[r_symndx] |= tls_type; + return TRUE; +} + +static void +bad_shared_reloc (bfd *abfd, enum elf_ppc_reloc_type r_type) +{ + (*_bfd_error_handler) + (_("%s: relocation %s cannot be used when making a shared object"), + bfd_archive_filename (abfd), + ppc_elf_howto_table[r_type]->name); + bfd_set_error (bfd_error_bad_value); +} + /* 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 -ppc_elf_check_relocs (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +static bfd_boolean +ppc_elf_check_relocs (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) { - bfd *dynobj; + struct ppc_elf_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; - struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; + struct elf_link_hash_entry **sym_hashes; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - bfd_signed_vma *local_got_refcounts; - elf_linker_section_t *sdata; - elf_linker_section_t *sdata2; asection *sreloc; - asection *sgot = NULL; - asection *srelgot = NULL; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; #ifdef DEBUG fprintf (stderr, "ppc_elf_check_relocs called for section %s in %s\n", @@ -2127,39 +3563,40 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) bfd_archive_filename (abfd)); #endif + /* Initialize howto table if not already done. */ + if (!ppc_elf_howto_table[R_PPC_ADDR32]) + ppc_elf_howto_init (); + /* Create the linker generated sections all the time so that the special symbols are created. */ - - if ((sdata = elf_linker_section (abfd, LINKER_SECTION_SDATA)) == NULL) + htab = ppc_elf_hash_table (info); + if (htab->sdata == NULL) { - sdata = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_SDATA); - if (!sdata) - return false; + htab->sdata = ppc_elf_create_linker_section (abfd, info, + LINKER_SECTION_SDATA); + if (htab->sdata == NULL) + return FALSE; } - if ((sdata2 = elf_linker_section (abfd, LINKER_SECTION_SDATA2)) == NULL) + if (htab->sdata2 == NULL) { - sdata2 = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_SDATA2); - if (!sdata2) - return false; + htab->sdata2 = ppc_elf_create_linker_section (abfd, info, + LINKER_SECTION_SDATA2); + if (htab->sdata2 == NULL) + return FALSE; } - dynobj = elf_hash_table (info)->dynobj; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - 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); - if (!elf_bad_symtab (abfd)) - sym_hashes_end -= symtab_hdr->sh_info; - sreloc = NULL; rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { unsigned long r_symndx; + enum elf_ppc_reloc_type r_type; struct elf_link_hash_entry *h; + int tls_type = 0; r_symndx = ELF32_R_SYM (rel->r_info); if (r_symndx < symtab_hdr->sh_info) @@ -2172,182 +3609,118 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) startup code. */ if (h && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) { - if (sgot == NULL) + if (htab->got == NULL) { - if (dynobj == NULL) - elf_hash_table (info)->dynobj = dynobj = abfd; - sgot = ppc_elf_create_got (dynobj, info); - if (sgot == NULL) - return false; + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + if (!ppc_elf_create_got (htab->elf.dynobj, info)) + return FALSE; } } - switch (ELF32_R_TYPE (rel->r_info)) + r_type = ELF32_R_TYPE (rel->r_info); + switch (r_type) { - /* GOT16 relocations */ + case R_PPC_GOT_TLSLD16: + case R_PPC_GOT_TLSLD16_LO: + case R_PPC_GOT_TLSLD16_HI: + case R_PPC_GOT_TLSLD16_HA: + htab->tlsld_got.refcount += 1; + tls_type = TLS_TLS | TLS_LD; + goto dogottls; + + case R_PPC_GOT_TLSGD16: + case R_PPC_GOT_TLSGD16_LO: + case R_PPC_GOT_TLSGD16_HI: + case R_PPC_GOT_TLSGD16_HA: + tls_type = TLS_TLS | TLS_GD; + goto dogottls; + + case R_PPC_GOT_TPREL16: + case R_PPC_GOT_TPREL16_LO: + case R_PPC_GOT_TPREL16_HI: + case R_PPC_GOT_TPREL16_HA: + if (info->shared) + info->flags |= DF_STATIC_TLS; + tls_type = TLS_TLS | TLS_TPREL; + goto dogottls; + + case R_PPC_GOT_DTPREL16: + case R_PPC_GOT_DTPREL16_LO: + case R_PPC_GOT_DTPREL16_HI: + case R_PPC_GOT_DTPREL16_HA: + tls_type = TLS_TLS | TLS_DTPREL; + dogottls: + sec->has_tls_reloc = 1; + /* Fall thru */ + + /* GOT16 relocations */ case R_PPC_GOT16: case R_PPC_GOT16_LO: case R_PPC_GOT16_HI: case R_PPC_GOT16_HA: /* This symbol requires a global offset table entry. */ - - if (sgot == NULL) - { - if (dynobj == NULL) - elf_hash_table (info)->dynobj = dynobj = abfd; - sgot = ppc_elf_create_got (dynobj, info); - if (sgot == NULL) - return false; - } - - if (srelgot == NULL - && (h != NULL || info->shared)) + if (htab->got == NULL) { - 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, 2)) - return false; - } + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + if (!ppc_elf_create_got (htab->elf.dynobj, info)) + return FALSE; } - if (h != NULL) { - if (h->got.refcount == 0) - { - /* 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; - - /* Allocate space in the .got. */ - sgot->_raw_size += 4; - /* Allocate relocation space. */ - srelgot->_raw_size += sizeof (Elf32_External_Rela); - } - h->got.refcount++; + h->got.refcount += 1; + ppc_elf_hash_entry (h)->tls_mask |= tls_type; } else - { - /* This is a global offset table entry for a local symbol. */ - if (local_got_refcounts == NULL) - { - bfd_size_type size; - - size = symtab_hdr->sh_info; - size *= sizeof (bfd_signed_vma); - local_got_refcounts - = (bfd_signed_vma *) bfd_zalloc (abfd, size); - if (local_got_refcounts == NULL) - return false; - elf_local_got_refcounts (abfd) = local_got_refcounts; - } - if (local_got_refcounts[r_symndx] == 0) - { - sgot->_raw_size += 4; - - /* If we are generating a shared object, we need to - output a R_PPC_RELATIVE reloc so that the - dynamic linker can adjust this GOT entry. */ - if (info->shared) - srelgot->_raw_size += sizeof (Elf32_External_Rela); - } - local_got_refcounts[r_symndx]++; - } + /* This is a global offset table entry for a local symbol. */ + if (!update_local_sym_info (abfd, symtab_hdr, r_symndx, tls_type)) + return FALSE; break; - /* Indirect .sdata relocation */ + /* Indirect .sdata relocation. */ case R_PPC_EMB_SDAI16: if (info->shared) { - ((*_bfd_error_handler) - (_("%s: relocation %s cannot be used when making a shared object"), - bfd_archive_filename (abfd), "R_PPC_EMB_SDAI16")); - return false; - } - - 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, 2)) - return false; - } + bad_shared_reloc (abfd, r_type); + return FALSE; } - - if (!bfd_elf32_create_pointer_linker_section (abfd, info, sdata, h, rel)) - return false; - + if (!elf_create_pointer_linker_section (abfd, info, + htab->sdata, h, rel)) + return FALSE; break; - /* Indirect .sdata2 relocation */ + /* Indirect .sdata2 relocation. */ case R_PPC_EMB_SDA2I16: if (info->shared) { - ((*_bfd_error_handler) - (_("%s: relocation %s cannot be used when making a shared object"), - bfd_archive_filename (abfd), "R_PPC_EMB_SDA2I16")); - return false; - } - - 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, 2)) - return false; - } + bad_shared_reloc (abfd, r_type); + return FALSE; } - - if (!bfd_elf32_create_pointer_linker_section (abfd, info, sdata2, h, rel)) - return false; - + if (!elf_create_pointer_linker_section (abfd, info, + htab->sdata2, h, rel)) + return FALSE; break; case R_PPC_SDAREL16: case R_PPC_EMB_SDA2REL: case R_PPC_EMB_SDA21: + case R_PPC_EMB_RELSDA: + case R_PPC_EMB_NADDR32: + case R_PPC_EMB_NADDR16: + case R_PPC_EMB_NADDR16_LO: + case R_PPC_EMB_NADDR16_HI: + case R_PPC_EMB_NADDR16_HA: if (info->shared) { - ((*_bfd_error_handler) - (_("%s: relocation %s cannot be used when making a shared object"), - bfd_archive_filename (abfd), - ppc_elf_howto_table[(int) ELF32_R_TYPE (rel->r_info)]->name)); - return false; + bad_shared_reloc (abfd, r_type); + return FALSE; } break; case R_PPC_PLT32: case R_PPC_PLTREL24: + case R_PPC_PLTREL32: case R_PPC_PLT16_LO: case R_PPC_PLT16_HI: case R_PPC_PLT16_HA: @@ -2355,25 +3728,25 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) fprintf (stderr, "Reloc requires a PLT entry\n"); #endif /* This symbol requires a procedure linkage table entry. We - actually build the entry in adjust_dynamic_symbol, - because this might be a case of linking PIC code without - linking in any dynamic objects, in which case we don't - need to generate a procedure linkage table after all. */ + actually build the entry in finish_dynamic_symbol, + because this might be a case of linking PIC code without + linking in any dynamic objects, in which case we don't + need to generate a procedure linkage table after all. */ if (h == NULL) { /* It does not make sense to have a procedure linkage - table entry for a local symbol. */ + table entry for a local symbol. */ + (*_bfd_error_handler) (_("%s(%s+0x%lx): %s reloc against " + "local symbol"), + bfd_archive_filename (abfd), + sec->name, + (long) rel->r_offset, + ppc_elf_howto_table[r_type]->name); bfd_set_error (bfd_error_bad_value); - return false; + 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; - } h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; h->plt.refcount++; break; @@ -2385,26 +3758,73 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) case R_PPC_SECTOFF_LO: case R_PPC_SECTOFF_HI: case R_PPC_SECTOFF_HA: + case R_PPC_DTPREL16: + case R_PPC_DTPREL16_LO: + case R_PPC_DTPREL16_HI: + case R_PPC_DTPREL16_HA: + case R_PPC_TOC16: + break; + + /* This are just markers. */ + case R_PPC_TLS: + case R_PPC_EMB_MRKREF: + case R_PPC_NONE: + case R_PPC_max: + break; + + /* These should only appear in dynamic objects. */ + case R_PPC_COPY: + case R_PPC_GLOB_DAT: + case R_PPC_JMP_SLOT: + case R_PPC_RELATIVE: + break; + + /* These aren't handled yet. We'll report an error later. */ + case R_PPC_ADDR30: + case R_PPC_EMB_RELSEC16: + case R_PPC_EMB_RELST_LO: + case R_PPC_EMB_RELST_HI: + case R_PPC_EMB_RELST_HA: + case R_PPC_EMB_BIT_FLD: break; - /* This refers only to functions defined in the shared library */ + /* This refers only to functions defined in the shared library. */ case R_PPC_LOCAL24PC: break; /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ case R_PPC_GNU_VTINHERIT: - if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) - return false; + if (!bfd_elf_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_PPC_GNU_VTENTRY: - if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend)) - return false; + if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return FALSE; break; + /* We shouldn't really be seeing these. */ + case R_PPC_TPREL32: + if (info->shared) + info->flags |= DF_STATIC_TLS; + goto dodyn; + + /* Nor these. */ + case R_PPC_DTPMOD32: + case R_PPC_DTPREL32: + goto dodyn; + + case R_PPC_TPREL16: + case R_PPC_TPREL16_LO: + case R_PPC_TPREL16_HI: + case R_PPC_TPREL16_HA: + if (info->shared) + info->flags |= DF_STATIC_TLS; + goto dodyn; + /* 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. */ @@ -2414,17 +3834,77 @@ 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 - || SYMBOL_REFERENCES_LOCAL (info, h)) + || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) break; /* fall through */ - default: - if (info->shared) + case R_PPC_ADDR32: + case R_PPC_ADDR24: + case R_PPC_ADDR16: + case R_PPC_ADDR16_LO: + case R_PPC_ADDR16_HI: + case R_PPC_ADDR16_HA: + case R_PPC_ADDR14: + case R_PPC_ADDR14_BRTAKEN: + case R_PPC_ADDR14_BRNTAKEN: + case R_PPC_UADDR32: + case R_PPC_UADDR16: + if (h != NULL && !info->shared) { + /* We may need a plt entry if the symbol turns out to be + a function defined in a dynamic object. */ + h->plt.refcount++; + + /* We may need a copy reloc too. */ + h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; + } + + dodyn: + /* If we are creating a shared library, and this is a reloc + against a global symbol, or a non PC relative reloc + against a local symbol, then we need to copy the reloc + into the shared library. However, if we are linking with + -Bsymbolic, we do not need to copy a reloc against a + global symbol which is defined in an object we are + including in the link (i.e., DEF_REGULAR is set). At + this point we have not seen all the input files, so it is + possible that DEF_REGULAR is not set now but will be set + later (it is never cleared). In case of a weak definition, + DEF_REGULAR may be cleared later by a strong definition in + a shared library. We account for that possibility below by + storing information in the dyn_relocs field of the hash + table entry. A similar situation occurs when creating + shared libraries and symbol visibility changes render the + symbol local. + + If on the other hand, we are creating an executable, we + may need to keep relocations for symbols satisfied by a + dynamic library if we manage to avoid copy relocs for the + symbol. */ + if ((info->shared + && (MUST_BE_DYN_RELOC (r_type) + || (h != NULL + && (! info->symbolic + || h->root.type == bfd_link_hash_defweak + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + || (ELIMINATE_COPY_RELOCS + && !info->shared + && (sec->flags & SEC_ALLOC) != 0 + && h != NULL + && (h->root.type == bfd_link_hash_defweak + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0))) + { + struct ppc_elf_dyn_relocs *p; + struct ppc_elf_dyn_relocs **head; + #ifdef DEBUG - fprintf (stderr, "ppc_elf_check_relocs need to create relocation for %s\n", - (h && h->root.root.string) ? h->root.root.string : ""); + fprintf (stderr, + "ppc_elf_check_relocs needs to " + "create relocation for %s\n", + (h && h->root.root.string + ? h->root.root.string : "")); #endif if (sreloc == NULL) { @@ -2435,58 +3915,88 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) elf_elfheader (abfd)->e_shstrndx, elf_section_data (sec)->rel_hdr.sh_name)); if (name == NULL) - return false; + 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); + sreloc = bfd_get_section_by_name (htab->elf.dynobj, name); if (sreloc == NULL) { flagword flags; - sreloc = bfd_make_section (dynobj, name); + sreloc = bfd_make_section (htab->elf.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; + || ! bfd_set_section_flags (htab->elf.dynobj, + sreloc, flags) + || ! bfd_set_section_alignment (htab->elf.dynobj, + sreloc, 2)) + return FALSE; } - if (sec->flags & SEC_READONLY) - info->flags |= DF_TEXTREL; + elf_section_data (sec)->sreloc = sreloc; + } + + /* If this is a global symbol, we count the number of + relocations we need for this symbol. */ + if (h != NULL) + { + head = &ppc_elf_hash_entry (h)->dyn_relocs; + } + else + { + /* Track dynamic relocs needed for local syms too. + We really need local syms available to do this + easily. Oh well. */ + + asection *s; + s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, + sec, r_symndx); + if (s == NULL) + return FALSE; + + head = ((struct ppc_elf_dyn_relocs **) + &elf_section_data (s)->local_dynrel); } - sreloc->_raw_size += sizeof (Elf32_External_Rela); + p = *head; + if (p == NULL || p->sec != sec) + { + p = bfd_alloc (htab->elf.dynobj, sizeof *p); + if (p == NULL) + return FALSE; + p->next = *head; + *head = p; + p->sec = sec; + p->count = 0; + p->pc_count = 0; + } - /* FIXME: We should here do what the m68k and i386 - backends do: if the reloc is pc-relative, record it - in case it turns out that the reloc is unnecessary - because the symbol is forced local by versioning or - we are linking with -Bdynamic. Fortunately this - case is not frequent. */ + p->count += 1; + if (!MUST_BE_DYN_RELOC (r_type)) + p->pc_count += 1; } break; } } - return true; + return TRUE; } /* Return the section that should be marked against GC for a given relocation. */ static asection * -ppc_elf_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +ppc_elf_gc_mark_hook (asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) { @@ -2517,153 +4027,401 @@ ppc_elf_gc_mark_hook (sec, info, rel, h, sym) return NULL; } -/* Update the got entry reference counts for the section being removed. */ +/* Update the got, plt and dynamic reloc reference counts for the + section being removed. */ -static boolean -ppc_elf_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - asection *sec; - const Elf_Internal_Rela *relocs; +static bfd_boolean +ppc_elf_gc_sweep_hook (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + const Elf_Internal_Rela *relocs) { + struct ppc_elf_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; - unsigned long r_symndx; - struct elf_link_hash_entry *h; + elf_section_data (sec)->local_dynrel = NULL; + + htab = ppc_elf_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); local_got_refcounts = elf_local_got_refcounts (abfd); relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_PPC_GOT16: - case R_PPC_GOT16_LO: - case R_PPC_GOT16_HI: - case R_PPC_GOT16_HA: - 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--; - } - else if (local_got_refcounts != NULL) - { - if (local_got_refcounts[r_symndx] > 0) - local_got_refcounts[r_symndx]--; - } - break; - - case R_PPC_PLT32: - case R_PPC_PLTREL24: - case R_PPC_PLT16_LO: - case R_PPC_PLT16_HI: - case R_PPC_PLT16_HA: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) + { + unsigned long r_symndx; + enum elf_ppc_reloc_type r_type; + struct elf_link_hash_entry *h = NULL; + + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct ppc_elf_dyn_relocs **pp, *p; + struct ppc_elf_link_hash_entry *eh; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct ppc_elf_link_hash_entry *) h; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } + } + + r_type = ELF32_R_TYPE (rel->r_info); + switch (r_type) + { + case R_PPC_GOT_TLSLD16: + case R_PPC_GOT_TLSLD16_LO: + case R_PPC_GOT_TLSLD16_HI: + case R_PPC_GOT_TLSLD16_HA: + htab->tlsld_got.refcount -= 1; + /* Fall thru */ + + case R_PPC_GOT_TLSGD16: + case R_PPC_GOT_TLSGD16_LO: + case R_PPC_GOT_TLSGD16_HI: + case R_PPC_GOT_TLSGD16_HA: + case R_PPC_GOT_TPREL16: + case R_PPC_GOT_TPREL16_LO: + case R_PPC_GOT_TPREL16_HI: + case R_PPC_GOT_TPREL16_HA: + case R_PPC_GOT_DTPREL16: + case R_PPC_GOT_DTPREL16_LO: + case R_PPC_GOT_DTPREL16_HI: + case R_PPC_GOT_DTPREL16_HA: + case R_PPC_GOT16: + case R_PPC_GOT16_LO: + case R_PPC_GOT16_HI: + case R_PPC_GOT16_HA: + if (h != NULL) + { + if (h->got.refcount > 0) + h->got.refcount--; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx]--; + } + break; + + case R_PPC_REL24: + case R_PPC_REL14: + case R_PPC_REL14_BRTAKEN: + case R_PPC_REL14_BRNTAKEN: + case R_PPC_REL32: + if (h == NULL + || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) + break; + /* Fall thru */ + + case R_PPC_ADDR32: + case R_PPC_ADDR24: + case R_PPC_ADDR16: + case R_PPC_ADDR16_LO: + case R_PPC_ADDR16_HI: + case R_PPC_ADDR16_HA: + case R_PPC_ADDR14: + case R_PPC_ADDR14_BRTAKEN: + case R_PPC_ADDR14_BRNTAKEN: + case R_PPC_UADDR32: + case R_PPC_UADDR16: + case R_PPC_PLT32: + case R_PPC_PLTREL24: + case R_PPC_PLT16_LO: + case R_PPC_PLT16_HI: + case R_PPC_PLT16_HA: + if (h != NULL) + { + if (h->plt.refcount > 0) + h->plt.refcount--; + } + break; + + default: + break; + } + } + return TRUE; +} + +/* Set htab->tls_get_addr and call the generic ELF tls_setup function. */ + +asection * +ppc_elf_tls_setup (bfd *obfd, struct bfd_link_info *info) +{ + struct ppc_elf_link_hash_table *htab; + + htab = ppc_elf_hash_table (info); + htab->tls_get_addr = elf_link_hash_lookup (&htab->elf, "__tls_get_addr", + FALSE, FALSE, TRUE); + + return _bfd_elf_tls_setup (obfd, info); +} + +/* Run through all the TLS relocs looking for optimization + opportunities. */ + +bfd_boolean +ppc_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) +{ + bfd *ibfd; + asection *sec; + struct ppc_elf_link_hash_table *htab; + + if (info->relocatable || info->shared) + return TRUE; + + htab = ppc_elf_hash_table (info); + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + Elf_Internal_Sym *locsyms = NULL; + Elf_Internal_Shdr *symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + if (sec->has_tls_reloc && !bfd_is_abs_section (sec->output_section)) { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (h->plt.refcount > 0) - h->plt.refcount--; - } - break; + Elf_Internal_Rela *relstart, *rel, *relend; + int expecting_tls_get_addr; + + /* Read the relocations. */ + relstart = _bfd_elf_link_read_relocs (ibfd, sec, NULL, NULL, + info->keep_memory); + if (relstart == NULL) + return FALSE; + + expecting_tls_get_addr = 0; + relend = relstart + sec->reloc_count; + for (rel = relstart; rel < relend; rel++) + { + enum elf_ppc_reloc_type r_type; + unsigned long r_symndx; + struct elf_link_hash_entry *h = NULL; + char *tls_mask; + char tls_set, tls_clear; + bfd_boolean is_local; + + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf_link_hash_entry **sym_hashes; + + sym_hashes = elf_sym_hashes (ibfd); + 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; + } + + is_local = FALSE; + if (h == NULL + || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)) + is_local = TRUE; + + r_type = ELF32_R_TYPE (rel->r_info); + switch (r_type) + { + case R_PPC_GOT_TLSLD16: + case R_PPC_GOT_TLSLD16_LO: + case R_PPC_GOT_TLSLD16_HI: + case R_PPC_GOT_TLSLD16_HA: + /* These relocs should never be against a symbol + defined in a shared lib. Leave them alone if + that turns out to be the case. */ + expecting_tls_get_addr = 0; + htab->tlsld_got.refcount -= 1; + if (!is_local) + continue; + + /* LD -> LE */ + tls_set = 0; + tls_clear = TLS_LD; + expecting_tls_get_addr = 1; + break; + + case R_PPC_GOT_TLSGD16: + case R_PPC_GOT_TLSGD16_LO: + case R_PPC_GOT_TLSGD16_HI: + case R_PPC_GOT_TLSGD16_HA: + if (is_local) + /* GD -> LE */ + tls_set = 0; + else + /* GD -> IE */ + tls_set = TLS_TLS | TLS_TPRELGD; + tls_clear = TLS_GD; + expecting_tls_get_addr = 1; + break; + + case R_PPC_GOT_TPREL16: + case R_PPC_GOT_TPREL16_LO: + case R_PPC_GOT_TPREL16_HI: + case R_PPC_GOT_TPREL16_HA: + expecting_tls_get_addr = 0; + if (is_local) + { + /* IE -> LE */ + tls_set = 0; + tls_clear = TLS_TPREL; + break; + } + else + continue; + + case R_PPC_REL14: + case R_PPC_REL14_BRTAKEN: + case R_PPC_REL14_BRNTAKEN: + case R_PPC_REL24: + if (expecting_tls_get_addr + && h != NULL + && h == htab->tls_get_addr) + { + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + expecting_tls_get_addr = 0; + continue; + + default: + expecting_tls_get_addr = 0; + continue; + } + + if (h != NULL) + { + if (tls_set == 0) + { + /* We managed to get rid of a got entry. */ + if (h->got.refcount > 0) + h->got.refcount -= 1; + } + tls_mask = &ppc_elf_hash_entry (h)->tls_mask; + } + else + { + Elf_Internal_Sym *sym; + bfd_signed_vma *lgot_refs; + char *lgot_masks; + + if (locsyms == NULL) + { + locsyms = (Elf_Internal_Sym *) symtab_hdr->contents; + if (locsyms == NULL) + locsyms = bfd_elf_get_elf_syms (ibfd, symtab_hdr, + symtab_hdr->sh_info, + 0, NULL, NULL, NULL); + if (locsyms == NULL) + { + if (elf_section_data (sec)->relocs != relstart) + free (relstart); + return FALSE; + } + } + sym = locsyms + r_symndx; + lgot_refs = elf_local_got_refcounts (ibfd); + if (lgot_refs == NULL) + abort (); + if (tls_set == 0) + { + /* We managed to get rid of a got entry. */ + if (lgot_refs[r_symndx] > 0) + lgot_refs[r_symndx] -= 1; + } + lgot_masks = (char *) (lgot_refs + symtab_hdr->sh_info); + tls_mask = &lgot_masks[r_symndx]; + } + + *tls_mask |= tls_set; + *tls_mask &= ~tls_clear; + } - default: - break; - } + if (elf_section_data (sec)->relocs != relstart) + free (relstart); + } - return true; + if (locsyms != NULL + && (symtab_hdr->contents != (unsigned char *) locsyms)) + { + if (!info->keep_memory) + free (locsyms); + else + symtab_hdr->contents = (unsigned char *) locsyms; + } + } + return TRUE; } /* 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 -ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) - bfd *abfd; - struct bfd_link_info *info; - const Elf_Internal_Sym *sym; - const char **namep ATTRIBUTE_UNUSED; - flagword *flagsp ATTRIBUTE_UNUSED; - asection **secp; - bfd_vma *valp; +static bfd_boolean +ppc_elf_add_symbol_hook (bfd *abfd, + struct bfd_link_info *info, + 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 + && !info->relocatable && sym->st_size <= elf_gp_size (abfd) - && info->hash->creator->flavour == bfd_target_elf_flavour) + && (info->hash->creator == abfd->xvec + || info->hash->creator == abfd->xvec->alternative_target)) { /* Common symbols less than or equal to -G nn bytes are automatically - put into .sdata. */ - elf_linker_section_t *sdata - = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_SDATA); - - if (!sdata->bss_section) - { - bfd_size_type amt; - - /* We don't go through bfd_make_section, because we don't - want to attach this common section to DYNOBJ. The linker - will move the symbols to the appropriate output section - when it defines common symbols. */ - amt = sizeof (asection); - sdata->bss_section = (asection *) bfd_zalloc (abfd, amt); - if (sdata->bss_section == NULL) - return false; - sdata->bss_section->name = sdata->bss_name; - sdata->bss_section->flags = SEC_IS_COMMON; - sdata->bss_section->output_section = sdata->bss_section; - amt = sizeof (asymbol); - sdata->bss_section->symbol = (asymbol *) bfd_zalloc (abfd, amt); - amt = sizeof (asymbol *); - sdata->bss_section->symbol_ptr_ptr = - (asymbol **) bfd_zalloc (abfd, amt); - if (sdata->bss_section->symbol == NULL - || sdata->bss_section->symbol_ptr_ptr == NULL) - return false; - sdata->bss_section->symbol->name = sdata->bss_name; - sdata->bss_section->symbol->flags = BSF_SECTION_SYM; - sdata->bss_section->symbol->section = sdata->bss_section; - *sdata->bss_section->symbol_ptr_ptr = sdata->bss_section->symbol; - } - - *secp = sdata->bss_section; + put into .sbss. */ + struct ppc_elf_link_hash_table *htab; + + htab = ppc_elf_hash_table (info); + if (htab->sbss == NULL) + { + flagword flags = SEC_IS_COMMON; + + htab->sbss = bfd_make_section_anyway (abfd, ".sbss"); + if (htab->sbss == NULL + || ! bfd_set_section_flags (abfd, htab->sbss, flags)) + return FALSE; + } + + *secp = htab->sbss; *valp = sym->st_size; } - return true; + return TRUE; } /* Finish up dynamic symbol handling. We set the contents of various dynamic sections here. */ -static boolean -ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) - bfd *output_bfd; - struct bfd_link_info *info; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +static bfd_boolean +ppc_elf_finish_dynamic_symbol (bfd *output_bfd, + struct bfd_link_info *info, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { - bfd *dynobj; + struct ppc_elf_link_hash_table *htab; #ifdef DEBUG fprintf (stderr, "ppc_elf_finish_dynamic_symbol called for %s", h->root.root.string); #endif - dynobj = elf_hash_table (info)->dynobj; - BFD_ASSERT (dynobj != NULL); + htab = ppc_elf_hash_table (info); + BFD_ASSERT (htab->elf.dynobj != NULL); if (h->plt.offset != (bfd_vma) -1) { - asection *splt; - asection *srela; Elf_Internal_Rela rela; + bfd_byte *loc; bfd_vma reloc_index; #ifdef DEBUG @@ -2671,20 +4429,17 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) #endif /* This symbol has an entry in the procedure linkage table. Set - it up. */ + it up. */ BFD_ASSERT (h->dynindx != -1); - - splt = bfd_get_section_by_name (dynobj, ".plt"); - srela = bfd_get_section_by_name (dynobj, ".rela.plt"); - BFD_ASSERT (splt != NULL && srela != NULL); + BFD_ASSERT (htab->plt != NULL && htab->relplt != NULL); /* We don't need to fill in the .plt. The ppc dynamic linker will fill it in. */ /* Fill in the entry in the .rela.plt section. */ - rela.r_offset = (splt->output_section->vma - + splt->output_offset + rela.r_offset = (htab->plt->output_section->vma + + htab->plt->output_offset + h->plt.offset); rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_JMP_SLOT); rela.r_addend = 0; @@ -2692,9 +4447,9 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) reloc_index = (h->plt.offset - PLT_INITIAL_ENTRY_SIZE) / PLT_SLOT_SIZE; if (reloc_index > PLT_NUM_SINGLE_ENTRIES) reloc_index -= (reloc_index - PLT_NUM_SINGLE_ENTRIES) / 2; - bfd_elf32_swap_reloca_out (output_bfd, &rela, - ((Elf32_External_Rela *) srela->contents - + reloc_index)); + loc = (htab->relplt->contents + + reloc_index * sizeof (Elf32_External_Rela)); + bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { @@ -2711,53 +4466,11 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) } } - if (h->got.offset != (bfd_vma) -1) - { - asection *sgot; - asection *srela; - Elf_Internal_Rela rela; - - /* This symbol has an entry in the global offset table. Set it - up. */ - - sgot = bfd_get_section_by_name (dynobj, ".got"); - srela = bfd_get_section_by_name (dynobj, ".rela.got"); - BFD_ASSERT (sgot != NULL && srela != NULL); - - rela.r_offset = (sgot->output_section->vma - + sgot->output_offset - + (h->got.offset &~ (bfd_vma) 1)); - - /* If this is a -Bsymbolic link, and the symbol is defined - locally, we just want to emit a RELATIVE reloc. The entry in - the global offset table will already have been initialized in - the relocate_section function. */ - if (info->shared - && SYMBOL_REFERENCES_LOCAL (info, h)) - { - rela.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE); - rela.r_addend = (h->root.u.def.value - + h->root.u.def.section->output_section->vma - + h->root.u.def.section->output_offset); - } - else - { - BFD_ASSERT ((h->got.offset & 1) == 0); - rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_GLOB_DAT); - rela.r_addend = 0; - } - - bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset); - bfd_elf32_swap_reloca_out (output_bfd, &rela, - ((Elf32_External_Rela *) srela->contents - + srela->reloc_count)); - ++srela->reloc_count; - } - if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) { asection *s; Elf_Internal_Rela rela; + bfd_byte *loc; /* This symbols needs a copy reloc. Set it up. */ @@ -2767,12 +4480,10 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) BFD_ASSERT (h->dynindx != -1); - if (h->size <= elf_gp_size (dynobj)) - s = bfd_get_section_by_name (h->root.u.def.section->owner, - ".rela.sbss"); + if (h->size <= elf_gp_size (htab->elf.dynobj)) + s = htab->relsbss; else - s = bfd_get_section_by_name (h->root.u.def.section->owner, - ".rela.bss"); + s = htab->relbss; BFD_ASSERT (s != NULL); rela.r_offset = (h->root.u.def.value @@ -2780,10 +4491,8 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) + h->root.u.def.section->output_offset); rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_COPY); rela.r_addend = 0; - bfd_elf32_swap_reloca_out (output_bfd, &rela, - ((Elf32_External_Rela *) s->contents - + s->reloc_count)); - ++s->reloc_count; + loc = s->contents + s->reloc_count++ * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); } #ifdef DEBUG @@ -2796,94 +4505,82 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0) sym->st_shndx = SHN_ABS; - return true; + return TRUE; } /* Finish up the dynamic sections. */ -static boolean -ppc_elf_finish_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +static bfd_boolean +ppc_elf_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info) { asection *sdyn; - bfd *dynobj = elf_hash_table (info)->dynobj; - asection *sgot = bfd_get_section_by_name (dynobj, ".got"); + struct ppc_elf_link_hash_table *htab; #ifdef DEBUG fprintf (stderr, "ppc_elf_finish_dynamic_sections called\n"); #endif - sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + htab = ppc_elf_hash_table (info); + sdyn = bfd_get_section_by_name (htab->elf.dynobj, ".dynamic"); - if (elf_hash_table (info)->dynamic_sections_created) + if (htab->elf.dynamic_sections_created) { - asection *splt; Elf32_External_Dyn *dyncon, *dynconend; - splt = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (splt != NULL && sdyn != NULL); + BFD_ASSERT (htab->plt != NULL && 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; - const char *name; - boolean size; + asection *s; - bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); + bfd_elf32_swap_dyn_in (htab->elf.dynobj, dyncon, &dyn); switch (dyn.d_tag) { - case DT_PLTGOT: name = ".plt"; size = false; break; - case DT_PLTRELSZ: name = ".rela.plt"; size = true; break; - case DT_JMPREL: name = ".rela.plt"; size = false; break; - default: name = NULL; size = false; break; - } + case DT_PLTGOT: + s = htab->plt; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + break; - if (name != NULL) - { - asection *s; + case DT_PLTRELSZ: + dyn.d_un.d_val = htab->relplt->_raw_size; + break; - s = bfd_get_section_by_name (output_bfd, name); - if (s == NULL) - dyn.d_un.d_val = 0; - else - { - if (! size) - dyn.d_un.d_ptr = s->vma; - else - { - 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); + case DT_JMPREL: + s = htab->relplt; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + break; + + default: + continue; } + + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); } } /* Add a blrl instruction at _GLOBAL_OFFSET_TABLE_-4 so that a function can easily find the address of the _GLOBAL_OFFSET_TABLE_. */ - if (sgot) + if (htab->got) { - unsigned char *contents = sgot->contents; - bfd_put_32 (output_bfd, (bfd_vma) 0x4e800021 /* blrl */, contents); + unsigned char *contents = htab->got->contents; + bfd_put_32 (output_bfd, 0x4e800021 /* blrl */, contents); if (sdyn == NULL) - bfd_put_32 (output_bfd, (bfd_vma) 0, contents+4); + bfd_put_32 (output_bfd, 0, contents + 4); else bfd_put_32 (output_bfd, sdyn->output_section->vma + sdyn->output_offset, - contents+4); + contents + 4); - elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4; + elf_section_data (htab->got->output_section)->this_hdr.sh_entsize = 4; } - return true; + return TRUE; } /* The RELOCATE_SECTION function is called by the ELF backend linker @@ -2895,7 +4592,7 @@ ppc_elf_finish_dynamic_sections (output_bfd, info) This function is responsible for adjust the section contents as necessary, and (if using Rela relocs and generating a - relocateable output file) adjusting the reloc addend as + relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -2909,289 +4606,711 @@ ppc_elf_finish_dynamic_sections (output_bfd, info) 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 + When generating relocatable 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 -ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, - contents, relocs, local_syms, local_sections) - bfd *output_bfd; - struct bfd_link_info *info; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - Elf_Internal_Rela *relocs; - Elf_Internal_Sym *local_syms; - asection **local_sections; +static bfd_boolean +ppc_elf_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) { - Elf_Internal_Shdr *symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; - struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd); - bfd *dynobj = elf_hash_table (info)->dynobj; - elf_linker_section_t *sdata = (dynobj) ? elf_linker_section (dynobj, LINKER_SECTION_SDATA) : NULL; - elf_linker_section_t *sdata2 = (dynobj) ? elf_linker_section (dynobj, LINKER_SECTION_SDATA2) : NULL; - Elf_Internal_Rela *rel = relocs; - Elf_Internal_Rela *relend = relocs + input_section->reloc_count; - asection *sreloc = NULL; - asection *splt; - asection *sgot; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + struct ppc_elf_link_hash_table *htab; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + Elf_Internal_Rela outrel; + bfd_byte *loc; + asection *sreloc = NULL; bfd_vma *local_got_offsets; - boolean ret = true; - long insn; + bfd_boolean ret = TRUE; #ifdef DEBUG - fprintf (stderr, "ppc_elf_relocate_section called for %s section %s, %ld relocations%s\n", + fprintf (stderr, "ppc_elf_relocate_section called for %s section %s, " + "%ld relocations%s\n", bfd_archive_filename (input_bfd), bfd_section_name(input_bfd, input_section), (long) input_section->reloc_count, - (info->relocateable) ? " (relocatable)" : ""); + (info->relocatable) ? " (relocatable)" : ""); #endif - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; + /* Initialize howto table if not already done. */ if (!ppc_elf_howto_table[R_PPC_ADDR32]) - /* Initialize howto table if needed. */ ppc_elf_howto_init (); + htab = ppc_elf_hash_table (info); local_got_offsets = elf_local_got_offsets (input_bfd); - - splt = sgot = NULL; - if (dynobj != NULL) - { - splt = bfd_get_section_by_name (dynobj, ".plt"); - sgot = bfd_get_section_by_name (dynobj, ".got"); - } - + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + rel = relocs; + relend = relocs + input_section->reloc_count; for (; rel < relend; rel++) { - enum elf_ppc_reloc_type r_type = (enum elf_ppc_reloc_type)ELF32_R_TYPE (rel->r_info); - 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; + enum elf_ppc_reloc_type r_type; + bfd_vma addend; + bfd_reloc_status_type r; + Elf_Internal_Sym *sym; + asection *sec; + struct elf_link_hash_entry *h; + const char *sym_name; reloc_howto_type *howto; unsigned long r_symndx; bfd_vma relocation; - int will_become_local; + bfd_vma branch_bit, insn, from; + bfd_boolean unresolved_reloc; + bfd_boolean warned; + unsigned int tls_type, tls_mask, tls_gd; + + r_type = ELF32_R_TYPE (rel->r_info); + sym = NULL; + sec = NULL; + h = NULL; + unresolved_reloc = FALSE; + warned = FALSE; + r_symndx = ELF32_R_SYM (rel->r_info); + + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + sym_name = bfd_elf_local_sym_name (input_bfd, sym); - /* Unknown relocation handling */ - if ((unsigned) r_type >= (unsigned) R_PPC_max - || !ppc_elf_howto_table[(int) r_type]) + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); + } + else { - (*_bfd_error_handler) (_("%s: unknown relocation type %d"), - bfd_archive_filename (input_bfd), - (int) r_type); + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); - bfd_set_error (bfd_error_bad_value); - ret = false; - continue; + sym_name = h->root.root.string; } - howto = ppc_elf_howto_table[(int) r_type]; - r_symndx = ELF32_R_SYM (rel->r_info); + /* TLS optimizations. Replace instruction sequences and relocs + based on information we collected in tls_optimize. We edit + RELOCS so that --emit-relocs will output something sensible + for the final instruction stream. */ + tls_mask = 0; + tls_gd = 0; + if (IS_PPC_TLS_RELOC (r_type)) + { + if (h != NULL) + tls_mask = ((struct ppc_elf_link_hash_entry *) h)->tls_mask; + else if (local_got_offsets != NULL) + { + char *lgot_masks; + lgot_masks = (char *) (local_got_offsets + symtab_hdr->sh_info); + tls_mask = lgot_masks[r_symndx]; + } + } - if (r_symndx < symtab_hdr->sh_info) + /* Ensure reloc mapping code below stays sane. */ + if ((R_PPC_GOT_TLSLD16 & 3) != (R_PPC_GOT_TLSGD16 & 3) + || (R_PPC_GOT_TLSLD16_LO & 3) != (R_PPC_GOT_TLSGD16_LO & 3) + || (R_PPC_GOT_TLSLD16_HI & 3) != (R_PPC_GOT_TLSGD16_HI & 3) + || (R_PPC_GOT_TLSLD16_HA & 3) != (R_PPC_GOT_TLSGD16_HA & 3) + || (R_PPC_GOT_TLSLD16 & 3) != (R_PPC_GOT_TPREL16 & 3) + || (R_PPC_GOT_TLSLD16_LO & 3) != (R_PPC_GOT_TPREL16_LO & 3) + || (R_PPC_GOT_TLSLD16_HI & 3) != (R_PPC_GOT_TPREL16_HI & 3) + || (R_PPC_GOT_TLSLD16_HA & 3) != (R_PPC_GOT_TPREL16_HA & 3)) + abort (); + switch (r_type) { - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; - sym_name = ""; + default: + break; + + case R_PPC_GOT_TPREL16: + case R_PPC_GOT_TPREL16_LO: + if (tls_mask != 0 + && (tls_mask & TLS_TPREL) == 0) + { + bfd_vma insn; + insn = bfd_get_32 (output_bfd, contents + rel->r_offset - 2); + insn &= 31 << 21; + insn |= 0x3c020000; /* addis 0,2,0 */ + bfd_put_32 (output_bfd, insn, contents + rel->r_offset - 2); + r_type = R_PPC_TPREL16_HA; + rel->r_info = ELF32_R_INFO (r_symndx, r_type); + } + break; + + case R_PPC_TLS: + if (tls_mask != 0 + && (tls_mask & TLS_TPREL) == 0) + { + bfd_vma insn, rtra; + insn = bfd_get_32 (output_bfd, contents + rel->r_offset); + if ((insn & ((31 << 26) | (31 << 11))) + == ((31 << 26) | (2 << 11))) + rtra = insn & ((1 << 26) - (1 << 16)); + else if ((insn & ((31 << 26) | (31 << 16))) + == ((31 << 26) | (2 << 16))) + rtra = (insn & (31 << 21)) | ((insn & (31 << 11)) << 5); + else + abort (); + if ((insn & ((1 << 11) - (1 << 1))) == 266 << 1) + /* add -> addi. */ + insn = 14 << 26; + else if ((insn & (31 << 1)) == 23 << 1 + && ((insn & (31 << 6)) < 14 << 6 + || ((insn & (31 << 6)) >= 16 << 6 + && (insn & (31 << 6)) < 24 << 6))) + /* load and store indexed -> dform. */ + insn = (32 | ((insn >> 6) & 31)) << 26; + else if ((insn & (31 << 1)) == 21 << 1 + && (insn & (0x1a << 6)) == 0) + /* ldx, ldux, stdx, stdux -> ld, ldu, std, stdu. */ + insn = (((58 | ((insn >> 6) & 4)) << 26) + | ((insn >> 6) & 1)); + else if ((insn & (31 << 1)) == 21 << 1 + && (insn & ((1 << 11) - (1 << 1))) == 341 << 1) + /* lwax -> lwa. */ + insn = (58 << 26) | 2; + else + abort (); + insn |= rtra; + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); + r_type = R_PPC_TPREL16_LO; + rel->r_info = ELF32_R_INFO (r_symndx, r_type); + /* Was PPC_TLS which sits on insn boundary, now + PPC_TPREL16_LO which is at insn+2. */ + rel->r_offset += 2; + } + break; + + case R_PPC_GOT_TLSGD16_HI: + case R_PPC_GOT_TLSGD16_HA: + tls_gd = TLS_TPRELGD; + if (tls_mask != 0 && (tls_mask & TLS_GD) == 0) + goto tls_gdld_hi; + break; + + case R_PPC_GOT_TLSLD16_HI: + case R_PPC_GOT_TLSLD16_HA: + if (tls_mask != 0 && (tls_mask & TLS_LD) == 0) + { + tls_gdld_hi: + if ((tls_mask & tls_gd) != 0) + r_type = (((r_type - (R_PPC_GOT_TLSGD16 & 3)) & 3) + + R_PPC_GOT_TPREL16); + else + { + bfd_put_32 (output_bfd, NOP, contents + rel->r_offset); + rel->r_offset -= 2; + r_type = R_PPC_NONE; + } + rel->r_info = ELF32_R_INFO (r_symndx, r_type); + } + break; + + case R_PPC_GOT_TLSGD16: + case R_PPC_GOT_TLSGD16_LO: + tls_gd = TLS_TPRELGD; + if (tls_mask != 0 && (tls_mask & TLS_GD) == 0) + goto tls_get_addr_check; + break; + + case R_PPC_GOT_TLSLD16: + case R_PPC_GOT_TLSLD16_LO: + if (tls_mask != 0 && (tls_mask & TLS_LD) == 0) + { + tls_get_addr_check: + if (rel + 1 < relend) + { + enum elf_ppc_reloc_type r_type2; + unsigned long r_symndx2; + struct elf_link_hash_entry *h2; + bfd_vma insn1, insn2; + bfd_vma offset; + + /* The next instruction should be a call to + __tls_get_addr. Peek at the reloc to be sure. */ + r_type2 = ELF32_R_TYPE (rel[1].r_info); + r_symndx2 = ELF32_R_SYM (rel[1].r_info); + if (r_symndx2 < symtab_hdr->sh_info + || (r_type2 != R_PPC_REL14 + && r_type2 != R_PPC_REL14_BRTAKEN + && r_type2 != R_PPC_REL14_BRNTAKEN + && r_type2 != R_PPC_REL24 + && r_type2 != R_PPC_PLTREL24)) + break; + + h2 = sym_hashes[r_symndx2 - symtab_hdr->sh_info]; + while (h2->root.type == bfd_link_hash_indirect + || h2->root.type == bfd_link_hash_warning) + h2 = (struct elf_link_hash_entry *) h2->root.u.i.link; + if (h2 == NULL || h2 != htab->tls_get_addr) + break; + + /* OK, it checks out. Replace the call. */ + offset = rel[1].r_offset; + insn1 = bfd_get_32 (output_bfd, + contents + rel->r_offset - 2); + if ((tls_mask & tls_gd) != 0) + { + /* IE */ + insn1 &= (1 << 26) - 1; + insn1 |= 32 << 26; /* lwz */ + insn2 = 0x7c631214; /* add 3,3,2 */ + rel[1].r_info = ELF32_R_INFO (r_symndx2, R_PPC_NONE); + r_type = (((r_type - (R_PPC_GOT_TLSGD16 & 3)) & 3) + + R_PPC_GOT_TPREL16); + rel->r_info = ELF32_R_INFO (r_symndx, r_type); + } + else + { + /* LE */ + insn1 = 0x3c620000; /* addis 3,2,0 */ + insn2 = 0x38630000; /* addi 3,3,0 */ + if (tls_gd == 0) + { + /* Was an LD reloc. */ + r_symndx = 0; + rel->r_addend = htab->elf.tls_sec->vma + DTP_OFFSET; + rel[1].r_addend = htab->elf.tls_sec->vma + DTP_OFFSET; + } + r_type = R_PPC_TPREL16_HA; + rel->r_info = ELF32_R_INFO (r_symndx, r_type); + rel[1].r_info = ELF32_R_INFO (r_symndx, + R_PPC_TPREL16_LO); + rel[1].r_offset += 2; + } + bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2); + bfd_put_32 (output_bfd, insn2, contents + offset); + if (tls_gd == 0) + { + /* We changed the symbol on an LD reloc. Start over + in order to get h, sym, sec etc. right. */ + rel--; + continue; + } + } + } + break; + } + + /* Handle other relocations that tweak non-addend part of insn. */ + branch_bit = 0; + switch (r_type) + { + default: + break; + + /* Branch taken prediction relocations. */ + case R_PPC_ADDR14_BRTAKEN: + case R_PPC_REL14_BRTAKEN: + branch_bit = BRANCH_PREDICT_BIT; + /* Fall thru */ + + /* Branch not taken prediction relocations. */ + case R_PPC_ADDR14_BRNTAKEN: + case R_PPC_REL14_BRNTAKEN: + insn = bfd_get_32 (output_bfd, contents + rel->r_offset); + insn &= ~BRANCH_PREDICT_BIT; + insn |= branch_bit; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); - addend = rel->r_addend; - /* Relocs to local symbols are always resolved. */ - will_become_local = 1; - } - 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; - sym_name = h->root.root.string; + from = (rel->r_offset + + input_section->output_offset + + input_section->output_section->vma); - /* Can this relocation be resolved immediately? */ - will_become_local = SYMBOL_REFERENCES_LOCAL (info, h); + /* Invert 'y' bit if not the default. */ + if ((bfd_signed_vma) (relocation + rel->r_addend - from) < 0) + insn ^= BRANCH_PREDICT_BIT; - 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 - || r_type == R_PPC_PLTREL24) - && splt != NULL - && h->plt.offset != (bfd_vma) -1) - || (r_type == R_PPC_LOCAL24PC - && sec->output_section == NULL) - || ((r_type == R_PPC_GOT16 - || r_type == R_PPC_GOT16_LO - || r_type == R_PPC_GOT16_HI - || r_type == R_PPC_GOT16_HA) - && elf_hash_table (info)->dynamic_sections_created - && (! info->shared || ! will_become_local)) - || (info->shared - && ! 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 - && (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 - || r_type == R_PPC_ADDR16_LO - || r_type == R_PPC_ADDR16_HI - || r_type == R_PPC_ADDR16_HA - || r_type == R_PPC_ADDR14 - || r_type == R_PPC_ADDR14_BRTAKEN - || r_type == R_PPC_ADDR14_BRNTAKEN - || r_type == R_PPC_COPY - || r_type == R_PPC_GLOB_DAT - || r_type == R_PPC_JMP_SLOT - || r_type == R_PPC_UADDR32 - || r_type == R_PPC_UADDR16 - || r_type == R_PPC_SDAREL16 - || r_type == R_PPC_EMB_NADDR32 - || r_type == R_PPC_EMB_NADDR16 - || r_type == R_PPC_EMB_NADDR16_LO - || r_type == R_PPC_EMB_NADDR16_HI - || r_type == R_PPC_EMB_NADDR16_HA - || r_type == R_PPC_EMB_SDAI16 - || r_type == R_PPC_EMB_SDA2I16 - || r_type == R_PPC_EMB_SDA2REL - || r_type == R_PPC_EMB_SDA21 - || r_type == R_PPC_EMB_MRKREF - || r_type == R_PPC_EMB_BIT_FLD - || r_type == R_PPC_EMB_RELSDA - || ((r_type == R_PPC_REL24 - || r_type == R_PPC_REL32 - || r_type == R_PPC_REL14 - || r_type == R_PPC_REL14_BRTAKEN - || r_type == R_PPC_REL14_BRNTAKEN - || r_type == R_PPC_RELATIVE) - && strcmp (h->root.root.string, - "_GLOBAL_OFFSET_TABLE_") != 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_archive_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->allow_shlib_undefined) - && !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, - rel->r_offset, - (!info->shared - || info->no_undefined - || ELF_ST_VISIBILITY (h->other)))) - return false; - relocation = 0; - } + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); + break; } - switch ((int) r_type) + addend = rel->r_addend; + tls_type = 0; + howto = NULL; + if (r_type < R_PPC_max) + howto = ppc_elf_howto_table[r_type]; + switch (r_type) { default: - (*_bfd_error_handler) (_("%s: unknown relocation type %d for symbol %s"), - bfd_archive_filename (input_bfd), - (int) r_type, sym_name); + (*_bfd_error_handler) + (_("%s: unknown relocation type %d for symbol %s"), + bfd_archive_filename (input_bfd), (int) r_type, sym_name); bfd_set_error (bfd_error_bad_value); - ret = false; + ret = FALSE; continue; - case (int) R_PPC_NONE: + case R_PPC_NONE: + case R_PPC_TLS: + case R_PPC_EMB_MRKREF: + case R_PPC_GNU_VTINHERIT: + case R_PPC_GNU_VTENTRY: continue; + /* GOT16 relocations. Like an ADDR16 using the symbol's + address in the GOT as relocation value instead of the + symbol's value itself. Also, create a GOT entry for the + symbol and put the symbol value there. */ + case R_PPC_GOT_TLSGD16: + case R_PPC_GOT_TLSGD16_LO: + case R_PPC_GOT_TLSGD16_HI: + case R_PPC_GOT_TLSGD16_HA: + tls_type = TLS_TLS | TLS_GD; + goto dogot; + + case R_PPC_GOT_TLSLD16: + case R_PPC_GOT_TLSLD16_LO: + case R_PPC_GOT_TLSLD16_HI: + case R_PPC_GOT_TLSLD16_HA: + tls_type = TLS_TLS | TLS_LD; + goto dogot; + + case R_PPC_GOT_TPREL16: + case R_PPC_GOT_TPREL16_LO: + case R_PPC_GOT_TPREL16_HI: + case R_PPC_GOT_TPREL16_HA: + tls_type = TLS_TLS | TLS_TPREL; + goto dogot; + + case R_PPC_GOT_DTPREL16: + case R_PPC_GOT_DTPREL16_LO: + case R_PPC_GOT_DTPREL16_HI: + case R_PPC_GOT_DTPREL16_HA: + tls_type = TLS_TLS | TLS_DTPREL; + goto dogot; + + case R_PPC_GOT16: + case R_PPC_GOT16_LO: + case R_PPC_GOT16_HI: + case R_PPC_GOT16_HA: + dogot: + { + /* Relocation is to the entry for this symbol in the global + offset table. */ + bfd_vma off; + bfd_vma *offp; + unsigned long indx; + + if (htab->got == NULL) + abort (); + + indx = 0; + if (tls_type == (TLS_TLS | TLS_LD) + && (h == NULL + || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))) + offp = &htab->tlsld_got.offset; + else if (h != NULL) + { + bfd_boolean dyn; + dyn = htab->elf.dynamic_sections_created; + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) + || (info->shared + && SYMBOL_REFERENCES_LOCAL (info, h))) + /* 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. */ + ; + else + { + indx = h->dynindx; + unresolved_reloc = FALSE; + } + offp = &h->got.offset; + } + else + { + if (local_got_offsets == NULL) + abort (); + offp = &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 + processed this entry. */ + off = *offp; + if ((off & 1) != 0) + off &= ~1; + else + { + unsigned int tls_m = (tls_mask + & (TLS_LD | TLS_GD | TLS_DTPREL + | TLS_TPREL | TLS_TPRELGD)); + + if (offp == &htab->tlsld_got.offset) + tls_m = TLS_LD; + else if (h == NULL + || !(h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC)) + tls_m &= ~TLS_LD; + + /* We might have multiple got entries for this sym. + Initialize them all. */ + do + { + int tls_ty = 0; + + if ((tls_m & TLS_LD) != 0) + { + tls_ty = TLS_TLS | TLS_LD; + tls_m &= ~TLS_LD; + } + else if ((tls_m & TLS_GD) != 0) + { + tls_ty = TLS_TLS | TLS_GD; + tls_m &= ~TLS_GD; + } + else if ((tls_m & TLS_DTPREL) != 0) + { + tls_ty = TLS_TLS | TLS_DTPREL; + tls_m &= ~TLS_DTPREL; + } + else if ((tls_m & (TLS_TPREL | TLS_TPRELGD)) != 0) + { + tls_ty = TLS_TLS | TLS_TPREL; + tls_m = 0; + } + + /* Generate relocs for the dynamic linker. */ + if ((info->shared || indx != 0) + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) + { + outrel.r_offset = (htab->got->output_section->vma + + htab->got->output_offset + + off); + outrel.r_addend = 0; + if (tls_ty & (TLS_LD | TLS_GD)) + { + outrel.r_info = ELF32_R_INFO (indx, R_PPC_DTPMOD32); + if (tls_ty == (TLS_TLS | TLS_GD)) + { + loc = htab->relgot->contents; + loc += (htab->relgot->reloc_count++ + * sizeof (Elf32_External_Rela)); + bfd_elf32_swap_reloca_out (output_bfd, + &outrel, loc); + outrel.r_offset += 4; + outrel.r_info + = ELF32_R_INFO (indx, R_PPC_DTPREL32); + } + } + else if (tls_ty == (TLS_TLS | TLS_DTPREL)) + outrel.r_info = ELF32_R_INFO (indx, R_PPC_DTPREL32); + else if (tls_ty == (TLS_TLS | TLS_TPREL)) + outrel.r_info = ELF32_R_INFO (indx, R_PPC_TPREL32); + else if (indx == 0) + outrel.r_info = ELF32_R_INFO (indx, R_PPC_RELATIVE); + else + outrel.r_info = ELF32_R_INFO (indx, R_PPC_GLOB_DAT); + if (indx == 0) + { + outrel.r_addend += relocation; + if (tls_ty & (TLS_GD | TLS_DTPREL | TLS_TPREL)) + outrel.r_addend -= htab->elf.tls_sec->vma; + } + loc = htab->relgot->contents; + loc += (htab->relgot->reloc_count++ + * sizeof (Elf32_External_Rela)); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + } + + /* Init the .got section contents if we're not + emitting a reloc. */ + else + { + bfd_vma value = relocation; + + if (tls_ty == (TLS_TLS | TLS_LD)) + value = 1; + else if (tls_ty != 0) + { + value -= htab->elf.tls_sec->vma + DTP_OFFSET; + if (tls_ty == (TLS_TLS | TLS_TPREL)) + value += DTP_OFFSET - TP_OFFSET; + + if (tls_ty == (TLS_TLS | TLS_GD)) + { + bfd_put_32 (output_bfd, value, + htab->got->contents + off + 4); + value = 1; + } + } + bfd_put_32 (output_bfd, value, + htab->got->contents + off); + } + + off += 4; + if (tls_ty & (TLS_LD | TLS_GD)) + off += 4; + } + while (tls_m != 0); + + off = *offp; + *offp = off | 1; + } + + if (off >= (bfd_vma) -2) + abort (); + + if ((tls_type & TLS_TLS) != 0) + { + if (tls_type != (TLS_TLS | TLS_LD)) + { + if ((tls_mask & TLS_LD) != 0 + && !(h == NULL + || !(h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC))) + off += 8; + if (tls_type != (TLS_TLS | TLS_GD)) + { + if ((tls_mask & TLS_GD) != 0) + off += 8; + if (tls_type != (TLS_TLS | TLS_DTPREL)) + { + if ((tls_mask & TLS_DTPREL) != 0) + off += 4; + } + } + } + } + + relocation = htab->got->output_offset + off - 4; + + /* Addends on got relocations don't make much sense. + x+off@got is actually x@got+off, and since the got is + generated by a hash table traversal, the value in the + got at entry m+n bears little relation to the entry m. */ + if (addend != 0) + (*_bfd_error_handler) + (_("%s(%s+0x%lx): non-zero addend on %s reloc against `%s'"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, + howto->name, + sym_name); + } + break; + /* Relocations that need no special processing. */ - case (int) R_PPC_LOCAL24PC: + case R_PPC_LOCAL24PC: /* It makes no sense to point a local relocation at a symbol not in this object. */ - if (h != NULL - && (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - && sec->output_section == NULL) + if (unresolved_reloc) { if (! (*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, rel->r_offset, - true)) - return false; + TRUE)) + return FALSE; continue; } break; - /* 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 R_PPC_DTPREL16: + case R_PPC_DTPREL16_LO: + case R_PPC_DTPREL16_HI: + case R_PPC_DTPREL16_HA: + addend -= htab->elf.tls_sec->vma + DTP_OFFSET; + break; + + /* Relocations that may need to be propagated if this is a shared + object. */ + case R_PPC_TPREL16: + case R_PPC_TPREL16_LO: + case R_PPC_TPREL16_HI: + case R_PPC_TPREL16_HA: + addend -= htab->elf.tls_sec->vma + TP_OFFSET; + /* The TPREL16 relocs shouldn't really be used in shared + libs as they will result in DT_TEXTREL being set, but + support them anyway. */ + goto dodyn; + + case R_PPC_TPREL32: + addend -= htab->elf.tls_sec->vma + TP_OFFSET; + goto dodyn; + + case R_PPC_DTPREL32: + addend -= htab->elf.tls_sec->vma + DTP_OFFSET; + goto dodyn; + + case R_PPC_DTPMOD32: + relocation = 1; + addend = 0; + goto dodyn; + + case R_PPC_REL24: + case R_PPC_REL32: + case R_PPC_REL14: + case R_PPC_REL14_BRTAKEN: + case R_PPC_REL14_BRNTAKEN: /* 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 - || SYMBOL_REFERENCES_LOCAL (info, h)) + if (SYMBOL_REFERENCES_LOCAL (info, h) + || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) + break; + /* fall through */ + + /* Relocations that always need to be propagated if this is a shared + object. */ + case R_PPC_ADDR32: + case R_PPC_ADDR24: + case R_PPC_ADDR16: + case R_PPC_ADDR16_LO: + case R_PPC_ADDR16_HI: + case R_PPC_ADDR16_HA: + case R_PPC_ADDR14: + case R_PPC_ADDR14_BRTAKEN: + case R_PPC_ADDR14_BRNTAKEN: + case R_PPC_UADDR32: + case R_PPC_UADDR16: + /* r_symndx will be zero only for relocs against symbols + from removed linkonce sections, or sections discarded by + a linker script. */ + dodyn: + if (r_symndx == 0) break; - /* fall through */ - - /* Relocations that always need to be propagated if this is a shared - object. */ - 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 && r_symndx != 0) + /* Fall thru. */ + + if ((info->shared + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && (MUST_BE_DYN_RELOC (r_type) + || !SYMBOL_CALLS_LOCAL (info, h))) + || (ELIMINATE_COPY_RELOCS + && !info->shared + && (input_section->flags & SEC_ALLOC) != 0 + && h != NULL + && h->dynindx != -1 + && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) { - Elf_Internal_Rela outrel; int skip; #ifdef DEBUG - fprintf (stderr, "ppc_elf_relocate_section need to create relocation for %s\n", - (h && h->root.root.string) ? h->root.root.string : ""); + fprintf (stderr, "ppc_elf_relocate_section needs to " + "create relocation for %s\n", + (h && h->root.root.string + ? h->root.root.string : "")); #endif /* When generating a shared object, these relocations - are copied into the output file to be resolved at run - time. */ - + are copied into the output file to be resolved at run + time. */ if (sreloc == NULL) { const char *name; @@ -3201,14 +5320,14 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, elf_elfheader (input_bfd)->e_shstrndx, elf_section_data (input_section)->rel_hdr.sh_name)); if (name == NULL) - return false; + 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); + sreloc = bfd_get_section_by_name (htab->elf.dynobj, name); BFD_ASSERT (sreloc != NULL); } @@ -3225,67 +5344,56 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (skip) memset (&outrel, 0, sizeof outrel); - /* h->dynindx may be -1 if this symbol was marked to - become local. */ - else if (! will_become_local) + else if (!SYMBOL_REFERENCES_LOCAL (info, h)) { + unresolved_reloc = FALSE; outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); outrel.r_addend = rel->r_addend; } else { + outrel.r_addend = relocation + rel->r_addend; + if (r_type == R_PPC_ADDR32) - { - outrel.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE); - outrel.r_addend = relocation + rel->r_addend; - } + outrel.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE); else { long indx; - if (h == NULL) - sec = local_sections[r_symndx]; - else - { - BFD_ASSERT (h->root.type == bfd_link_hash_defined - || (h->root.type - == bfd_link_hash_defweak)); - sec = h->root.u.def.section; - } - if (sec != NULL && bfd_is_abs_section (sec)) + if (bfd_is_abs_section (sec)) indx = 0; else if (sec == NULL || sec->owner == NULL) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } else { asection *osec; + /* We are turning this relocation into one + against a section symbol. It would be + proper to subtract the symbol's value, + osec->vma, from the emitted reloc addend, + but ld.so expects buggy relocs. */ osec = sec->output_section; indx = elf_section_data (osec)->dynindx; BFD_ASSERT (indx > 0); #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 } outrel.r_info = ELF32_R_INFO (indx, r_type); - outrel.r_addend = relocation + rel->r_addend; } } - bfd_elf32_swap_reloca_out (output_bfd, &outrel, - (((Elf32_External_Rela *) - sreloc->contents) - + sreloc->reloc_count)); - ++sreloc->reloc_count; + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); if (skip == -1) continue; @@ -3301,252 +5409,175 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; } } - - /* Arithmetic adjust relocations that aren't going into a - shared object. */ - if (r_type == R_PPC_ADDR16_HA - /* It's just possible that this symbol is a weak symbol - that's not actually defined anywhere. In that case, - 'sec' would be NULL, and we should leave the symbol - alone (it will be set to zero elsewhere in the link). */ - && sec != NULL) - { - addend += ((relocation + addend) & 0x8000) << 1; - } - break; - - /* branch taken prediction relocations */ - 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; - else - insn |= BRANCH_PREDICT_BIT; - bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset); - break; - - /* branch not taken predicition relocations */ - 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; - else - insn &= ~BRANCH_PREDICT_BIT; - bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset); 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: - /* Relocation is to the entry for this symbol in the global - offset table. */ - BFD_ASSERT (sgot != NULL); - - if (h != NULL) - { - bfd_vma off; - - off = h->got.offset; - BFD_ASSERT (off != (bfd_vma) -1); - - if (! elf_hash_table (info)->dynamic_sections_created - || (info->shared - && SYMBOL_REFERENCES_LOCAL (info, h))) - { - /* This is actually a static link, or it is a - -Bsymbolic link and the symbol is defined - locally. 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, - sgot->contents + off); - h->got.offset |= 1; - } - } - - relocation = sgot->output_offset + off - 4; - } - else - { - bfd_vma off; - - BFD_ASSERT (local_got_offsets != NULL - && local_got_offsets[r_symndx] != (bfd_vma) -1); - - off = local_got_offsets[r_symndx]; + case R_PPC_RELAX32PC: + relocation -= (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset - 4); + /* Fall thru */ + case R_PPC_RELAX32: + { + unsigned long t0; + unsigned long t1; - /* The offset must always be a multiple of 4. We use - the least significant bit to record whether we have - already processed this entry. */ - if ((off & 1) != 0) - off &= ~1; - else - { + t0 = bfd_get_32 (output_bfd, contents + rel->r_offset); + t1 = bfd_get_32 (output_bfd, contents + rel->r_offset + 4); - if (info->shared) - { - asection *srelgot; - Elf_Internal_Rela outrel; - - /* We need to generate a R_PPC_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 = ELF32_R_INFO (0, R_PPC_RELATIVE); - outrel.r_addend = relocation; - bfd_elf32_swap_reloca_out (output_bfd, &outrel, - (((Elf32_External_Rela *) - srelgot->contents) - + srelgot->reloc_count)); - ++srelgot->reloc_count; - relocation = 0; - } + /* We're clearing the bits for R_PPC_ADDR16_HA + and R_PPC_ADDR16_LO here. */ + t0 &= ~0xffff; + t1 &= ~0xffff; - bfd_put_32 (output_bfd, relocation, sgot->contents + off); - local_got_offsets[r_symndx] |= 1; - } + /* t0 is HA, t1 is LO */ + relocation += addend; + t0 |= ((relocation + 0x8000) >> 16) & 0xffff; + t1 |= relocation & 0xffff; - relocation = sgot->output_offset + off - 4; - } - break; + bfd_put_32 (output_bfd, t0, contents + rel->r_offset); + bfd_put_32 (output_bfd, t1, contents + rel->r_offset + 4); + } + continue; - /* Indirect .sdata relocation */ - 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, - R_PPC_RELATIVE); + /* Indirect .sdata relocation. */ + case R_PPC_EMB_SDAI16: + BFD_ASSERT (htab->sdata != NULL); + relocation + = elf_finish_pointer_linker_section (output_bfd, input_bfd, info, + htab->sdata, h, relocation, + rel, R_PPC_RELATIVE); break; - /* Indirect .sdata2 relocation */ - 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, - R_PPC_RELATIVE); + /* Indirect .sdata2 relocation. */ + case R_PPC_EMB_SDA2I16: + BFD_ASSERT (htab->sdata2 != NULL); + relocation + = elf_finish_pointer_linker_section (output_bfd, input_bfd, info, + htab->sdata2, h, relocation, + rel, R_PPC_RELATIVE); break; - /* Handle the TOC16 reloc. We want to use the offset within the .got - 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); + /* Handle the TOC16 reloc. We want to use the offset within the .got + 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 R_PPC_TOC16: /* phony GOT16 relocations */ + BFD_ASSERT (sec != NULL); 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) - addend -= sec->output_section->vma + sec->output_offset + 0x8000; + addend -= sec->output_section->vma + sec->output_offset + 0x8000; break; - case (int) R_PPC_PLTREL24: + case R_PPC_PLTREL24: /* Relocation is to the entry for this symbol in the - procedure linkage table. */ + procedure linkage table. */ BFD_ASSERT (h != NULL); if (h->plt.offset == (bfd_vma) -1 - || splt == NULL) + || htab->plt == NULL) { /* We didn't make a PLT entry for this symbol. This - happens when statically linking PIC code, or when - using -Bsymbolic. */ + happens when statically linking PIC code, or when + using -Bsymbolic. */ break; } - relocation = (splt->output_section->vma - + splt->output_offset + unresolved_reloc = FALSE; + relocation = (htab->plt->output_section->vma + + htab->plt->output_offset + h->plt.offset); break; - /* relocate against _SDA_BASE_ */ - case (int) R_PPC_SDAREL16: + /* Relocate against _SDA_BASE_. */ + case R_PPC_SDAREL16: { const char *name; + const struct elf_link_hash_entry *sh; - BFD_ASSERT (sec != (asection *) 0); + BFD_ASSERT (sec != NULL); name = bfd_get_section_name (abfd, sec->output_section); - if (strcmp (name, ".sdata") != 0 - && strcmp (name, ".sbss") != 0) + if (! ((strncmp (name, ".sdata", 6) == 0 + && (name[6] == 0 || name[6] == '.')) + || (strncmp (name, ".sbss", 5) == 0 + && (name[5] == 0 || name[5] == '.')))) { - (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"), - bfd_archive_filename (input_bfd), - sym_name, - ppc_elf_howto_table[(int) r_type]->name, - name); + (*_bfd_error_handler) + (_("%s: the target (%s) of a %s relocation is " + "in the wrong output section (%s)"), + bfd_archive_filename (input_bfd), + sym_name, + howto->name, + name); } - addend -= (sdata->sym_hash->root.u.def.value - + sdata->sym_hash->root.u.def.section->output_section->vma - + sdata->sym_hash->root.u.def.section->output_offset); + sh = htab->sdata->sym_hash; + addend -= (sh->root.u.def.value + + sh->root.u.def.section->output_section->vma + + sh->root.u.def.section->output_offset); } break; - /* relocate against _SDA2_BASE_ */ - case (int) R_PPC_EMB_SDA2REL: + /* Relocate against _SDA2_BASE_. */ + case R_PPC_EMB_SDA2REL: { const char *name; + const struct elf_link_hash_entry *sh; - BFD_ASSERT (sec != (asection *) 0); + BFD_ASSERT (sec != NULL); name = bfd_get_section_name (abfd, sec->output_section); - if (strcmp (name, ".sdata2") != 0 && strcmp (name, ".sbss2") != 0) + if (! (strncmp (name, ".sdata2", 7) == 0 + || strncmp (name, ".sbss2", 6) == 0)) { - (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"), - bfd_archive_filename (input_bfd), - sym_name, - ppc_elf_howto_table[(int) r_type]->name, - name); + (*_bfd_error_handler) + (_("%s: the target (%s) of a %s relocation is " + "in the wrong output section (%s)"), + bfd_archive_filename (input_bfd), + sym_name, + howto->name, + name); bfd_set_error (bfd_error_bad_value); - ret = false; + ret = FALSE; continue; } - addend -= (sdata2->sym_hash->root.u.def.value - + sdata2->sym_hash->root.u.def.section->output_section->vma - + sdata2->sym_hash->root.u.def.section->output_offset); + sh = htab->sdata2->sym_hash; + addend -= (sh->root.u.def.value + + sh->root.u.def.section->output_section->vma + + sh->root.u.def.section->output_offset); } break; - /* relocate against either _SDA_BASE_, _SDA2_BASE_, or 0 */ - case (int) R_PPC_EMB_SDA21: - case (int) R_PPC_EMB_RELSDA: + /* Relocate against either _SDA_BASE_, _SDA2_BASE_, or 0. */ + case R_PPC_EMB_SDA21: + case R_PPC_EMB_RELSDA: { const char *name; + const struct elf_link_hash_entry *sh; int reg; - BFD_ASSERT (sec != (asection *) 0); + BFD_ASSERT (sec != NULL); name = bfd_get_section_name (abfd, sec->output_section); - if (strcmp (name, ".sdata") == 0 || strcmp (name, ".sbss") == 0) + if (((strncmp (name, ".sdata", 6) == 0 + && (name[6] == 0 || name[6] == '.')) + || (strncmp (name, ".sbss", 5) == 0 + && (name[5] == 0 || name[5] == '.')))) { reg = 13; - addend -= (sdata->sym_hash->root.u.def.value - + sdata->sym_hash->root.u.def.section->output_section->vma - + sdata->sym_hash->root.u.def.section->output_offset); + sh = htab->sdata->sym_hash; + addend -= (sh->root.u.def.value + + sh->root.u.def.section->output_section->vma + + sh->root.u.def.section->output_offset); } - else if (strcmp (name, ".sdata2") == 0 - || strcmp (name, ".sbss2") == 0) + else if (strncmp (name, ".sdata2", 7) == 0 + || strncmp (name, ".sbss2", 6) == 0) { reg = 2; - addend -= (sdata2->sym_hash->root.u.def.value - + sdata2->sym_hash->root.u.def.section->output_section->vma - + sdata2->sym_hash->root.u.def.section->output_offset); + sh = htab->sdata2->sym_hash; + addend -= (sh->root.u.def.value + + sh->root.u.def.section->output_section->vma + + sh->root.u.def.section->output_offset); } else if (strcmp (name, ".PPC.EMB.sdata0") == 0 @@ -3557,114 +5588,144 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, else { - (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"), - bfd_archive_filename (input_bfd), - sym_name, - ppc_elf_howto_table[(int) r_type]->name, - name); + (*_bfd_error_handler) + (_("%s: the target (%s) of a %s relocation is " + "in the wrong output section (%s)"), + bfd_archive_filename (input_bfd), + sym_name, + howto->name, + name); bfd_set_error (bfd_error_bad_value); - ret = false; + ret = FALSE; continue; } if (r_type == R_PPC_EMB_SDA21) { /* fill in register field */ - insn = bfd_get_32 (output_bfd, contents + offset); + insn = bfd_get_32 (output_bfd, contents + rel->r_offset); insn = (insn & ~RA_REGISTER_MASK) | (reg << RA_REGISTER_SHIFT); - bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset); + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); } } 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); - addend -= sec->output_section->vma; - break; - - case (int) R_PPC_SECTOFF_HA: - BFD_ASSERT (sec != (asection *) 0); + /* Relocate against the beginning of the section. */ + case R_PPC_SECTOFF: + case R_PPC_SECTOFF_LO: + case R_PPC_SECTOFF_HI: + case R_PPC_SECTOFF_HA: + BFD_ASSERT (sec != NULL); 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: + /* Negative relocations. */ + case R_PPC_EMB_NADDR32: + case R_PPC_EMB_NADDR16: + case R_PPC_EMB_NADDR16_LO: + case R_PPC_EMB_NADDR16_HI: + case R_PPC_EMB_NADDR16_HA: addend -= 2 * relocation; break; - 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: - 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: - (*_bfd_error_handler) (_("%s: Relocation %s is not yet supported for symbol %s."), - bfd_archive_filename (input_bfd), - ppc_elf_howto_table[(int) r_type]->name, - sym_name); + case R_PPC_COPY: + case R_PPC_GLOB_DAT: + case R_PPC_JMP_SLOT: + case R_PPC_RELATIVE: + case R_PPC_PLT32: + case R_PPC_PLTREL32: + case R_PPC_PLT16_LO: + case R_PPC_PLT16_HI: + case R_PPC_PLT16_HA: + case R_PPC_ADDR30: + case R_PPC_EMB_RELSEC16: + case R_PPC_EMB_RELST_LO: + case R_PPC_EMB_RELST_HI: + case R_PPC_EMB_RELST_HA: + case R_PPC_EMB_BIT_FLD: + (*_bfd_error_handler) + (_("%s: relocation %s is not yet supported for symbol %s."), + bfd_archive_filename (input_bfd), + howto->name, + sym_name); bfd_set_error (bfd_error_invalid_operation); - ret = false; + ret = FALSE; continue; + } - case (int) R_PPC_GNU_VTINHERIT: - case (int) R_PPC_GNU_VTENTRY: - /* These are no-ops in the end. */ - continue; + /* Do any further special processing. */ + switch (r_type) + { + default: + break; + + case R_PPC_ADDR16_HA: + case R_PPC_GOT16_HA: + case R_PPC_PLT16_HA: + case R_PPC_SECTOFF_HA: + case R_PPC_TPREL16_HA: + case R_PPC_DTPREL16_HA: + case R_PPC_GOT_TLSGD16_HA: + case R_PPC_GOT_TLSLD16_HA: + case R_PPC_GOT_TPREL16_HA: + case R_PPC_GOT_DTPREL16_HA: + case R_PPC_EMB_NADDR16_HA: + case R_PPC_EMB_RELST_HA: + /* It's just possible that this symbol is a weak symbol + that's not actually defined anywhere. In that case, + 'sec' would be NULL, and we should leave the symbol + alone (it will be set to zero elsewhere in the link). */ + if (sec != NULL) + /* Add 0x10000 if sign bit in 0:15 is set. + Bits 0:15 are not used. */ + addend += 0x8000; + break; } #ifdef DEBUG - fprintf (stderr, "\ttype = %s (%d), name = %s, symbol index = %ld, offset = %ld, addend = %ld\n", + fprintf (stderr, "\ttype = %s (%d), name = %s, symbol index = %ld, " + "offset = %ld, addend = %ld\n", howto->name, (int) r_type, sym_name, r_symndx, - (long) offset, + (long) rel->r_offset, (long) addend); #endif + if (unresolved_reloc + && !((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) + { + (*_bfd_error_handler) + (_("%s(%s+0x%lx): unresolvable %s relocation against symbol `%s'"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, + howto->name, + sym_name); + ret = FALSE; + } + r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, - offset, + rel->r_offset, relocation, addend); - if (r == bfd_reloc_ok) - ; - else if (r == bfd_reloc_overflow) + if (r != bfd_reloc_ok) { - const char *name; - - if (h != NULL) + if (sym_name == NULL) + sym_name = "(null)"; + if (r == bfd_reloc_overflow) { - if (h->root.type == bfd_link_hash_undefweak + if (warned) + continue; + if (h != NULL + && h->root.type == bfd_link_hash_undefweak && howto->pc_relative) { /* Assume this is a call protected by other code that @@ -3676,30 +5737,25 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, continue; } - name = h->root.root.string; + if (! (*info->callbacks->reloc_overflow) (info, + sym_name, + howto->name, + rel->r_addend, + input_bfd, + input_section, + rel->r_offset)) + return FALSE; } else { - name = bfd_elf_string_from_elf_section (input_bfd, - symtab_hdr->sh_link, - sym->st_name); - if (name == NULL) - continue; - if (*name == '\0') - name = bfd_section_name (input_bfd, sec); + (*_bfd_error_handler) + (_("%s(%s+0x%lx): %s reloc against `%s': error %d"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, howto->name, sym_name, (int) r); + ret = FALSE; } - - if (! (*info->callbacks->reloc_overflow) (info, - name, - howto->name, - (bfd_vma) 0, - input_bfd, - input_section, - offset)) - return false; } - else - ret = false; } #ifdef DEBUG @@ -3710,10 +5766,9 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } static enum elf_reloc_type_class -ppc_elf_reloc_type_class (rela) - const Elf_Internal_Rela *rela; +ppc_elf_reloc_type_class (const Elf_Internal_Rela *rela) { - switch ((int) ELF32_R_TYPE (rela->r_info)) + switch (ELF32_R_TYPE (rela->r_info)) { case R_PPC_RELATIVE: return reloc_class_relative; @@ -3728,32 +5783,31 @@ ppc_elf_reloc_type_class (rela) } } -/* Support for core dump NOTE sections */ -static boolean -ppc_elf_grok_prstatus (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +/* Support for core dump NOTE sections. */ + +static bfd_boolean +ppc_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) { int offset; unsigned int raw_size; switch (note->descsz) { - default: - return false; + default: + return FALSE; - case 268: /* Linux/PPC */ - /* pr_cursig */ - elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); + case 268: /* Linux/PPC. */ + /* pr_cursig */ + elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); - /* pr_pid */ - elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24); + /* pr_pid */ + elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 24); - /* pr_reg */ - offset = 72; - raw_size = 192; + /* pr_reg */ + offset = 72; + raw_size = 192; - break; + break; } /* Make a ".reg/999" section. */ @@ -3761,21 +5815,19 @@ ppc_elf_grok_prstatus (abfd, note) raw_size, note->descpos + offset); } -static boolean -ppc_elf_grok_psinfo (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +static bfd_boolean +ppc_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) { switch (note->descsz) { - default: - return false; + default: + return FALSE; - case 128: /* Linux/PPC elf_prpsinfo */ - elf_tdata (abfd)->core_program - = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16); - elf_tdata (abfd)->core_command - = _bfd_elfcore_strndup (abfd, note->descdata + 48, 80); + case 128: /* Linux/PPC elf_prpsinfo. */ + elf_tdata (abfd)->core_program + = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16); + elf_tdata (abfd)->core_command + = _bfd_elfcore_strndup (abfd, note->descdata + 48, 80); } /* Note that for some reason, a spurious space is tacked @@ -3790,8 +5842,310 @@ ppc_elf_grok_psinfo (abfd, note) command[n - 1] = '\0'; } - return true; + return TRUE; +} + +/* Very simple linked list structure for recording apuinfo values. */ +typedef struct apuinfo_list +{ + struct apuinfo_list *next; + unsigned long value; +} +apuinfo_list; + +static apuinfo_list *head; + + +static void +apuinfo_list_init (void) +{ + head = NULL; +} + +static void +apuinfo_list_add (unsigned long value) +{ + apuinfo_list *entry = head; + + while (entry != NULL) + { + if (entry->value == value) + return; + entry = entry->next; + } + + entry = bfd_malloc (sizeof (* entry)); + if (entry == NULL) + return; + + entry->value = value; + entry->next = head; + head = entry; +} + +static unsigned +apuinfo_list_length (void) +{ + apuinfo_list *entry; + unsigned long count; + + for (entry = head, count = 0; + entry; + entry = entry->next) + ++ count; + + return count; +} + +static inline unsigned long +apuinfo_list_element (unsigned long number) +{ + apuinfo_list * entry; + + for (entry = head; + entry && number --; + entry = entry->next) + ; + + return entry ? entry->value : 0; +} + +static void +apuinfo_list_finish (void) +{ + apuinfo_list *entry; + + for (entry = head; entry;) + { + apuinfo_list *next = entry->next; + free (entry); + entry = next; + } + + head = NULL; +} + +#define APUINFO_SECTION_NAME ".PPC.EMB.apuinfo" +#define APUINFO_LABEL "APUinfo" + +/* Scan the input BFDs and create a linked list of + the APUinfo values that will need to be emitted. */ + +static void +ppc_elf_begin_write_processing (bfd *abfd, struct bfd_link_info *link_info) +{ + bfd *ibfd; + asection *asec; + char *buffer; + unsigned num_input_sections; + bfd_size_type output_section_size; + unsigned i; + unsigned num_entries; + unsigned long offset; + unsigned long length; + const char *error_message = NULL; + + if (link_info == NULL) + return; + + /* Scan the input bfds, looking for apuinfo sections. */ + num_input_sections = 0; + output_section_size = 0; + + for (ibfd = link_info->input_bfds; ibfd; ibfd = ibfd->link_next) + { + asec = bfd_get_section_by_name (ibfd, APUINFO_SECTION_NAME); + if (asec) + { + ++ num_input_sections; + output_section_size += asec->_raw_size; + } + } + + /* We need at least one input sections + in order to make merging worthwhile. */ + if (num_input_sections < 1) + return; + + /* Just make sure that the output section exists as well. */ + asec = bfd_get_section_by_name (abfd, APUINFO_SECTION_NAME); + if (asec == NULL) + return; + + /* Allocate a buffer for the contents of the input sections. */ + buffer = bfd_malloc (output_section_size); + if (buffer == NULL) + return; + + offset = 0; + apuinfo_list_init (); + + /* Read in the input sections contents. */ + for (ibfd = link_info->input_bfds; ibfd; ibfd = ibfd->link_next) + { + unsigned long datum; + char *ptr; + + asec = bfd_get_section_by_name (ibfd, APUINFO_SECTION_NAME); + if (asec == NULL) + continue; + + length = asec->_raw_size; + if (length < 24) + { + error_message = _("corrupt or empty %s section in %s"); + goto fail; + } + + if (bfd_seek (ibfd, asec->filepos, SEEK_SET) != 0 + || (bfd_bread (buffer + offset, length, ibfd) != length)) + { + error_message = _("unable to read in %s section from %s"); + goto fail; + } + + /* Process the contents of the section. */ + ptr = buffer + offset; + error_message = _("corrupt %s section in %s"); + + /* Verify the contents of the header. Note - we have to + extract the values this way in order to allow for a + host whose endian-ness is different from the target. */ + datum = bfd_get_32 (ibfd, ptr); + if (datum != sizeof APUINFO_LABEL) + goto fail; + + datum = bfd_get_32 (ibfd, ptr + 8); + if (datum != 0x2) + goto fail; + + if (strcmp (ptr + 12, APUINFO_LABEL) != 0) + goto fail; + + /* Get the number of bytes used for apuinfo entries. */ + datum = bfd_get_32 (ibfd, ptr + 4); + if (datum + 20 != length) + goto fail; + + /* Make sure that we do not run off the end of the section. */ + if (offset + length > output_section_size) + goto fail; + + /* Scan the apuinfo section, building a list of apuinfo numbers. */ + for (i = 0; i < datum; i += 4) + apuinfo_list_add (bfd_get_32 (ibfd, ptr + 20 + i)); + + /* Update the offset. */ + offset += length; + } + + error_message = NULL; + + /* Compute the size of the output section. */ + num_entries = apuinfo_list_length (); + output_section_size = 20 + num_entries * 4; + + asec = bfd_get_section_by_name (abfd, APUINFO_SECTION_NAME); + + if (! bfd_set_section_size (abfd, asec, output_section_size)) + ibfd = abfd, + error_message = _("warning: unable to set size of %s section in %s"); + + fail: + free (buffer); + + if (error_message) + (*_bfd_error_handler) (error_message, APUINFO_SECTION_NAME, + bfd_archive_filename (ibfd)); +} + + +/* Prevent the output section from accumulating the input sections' + contents. We have already stored this in our linked list structure. */ + +static bfd_boolean +ppc_elf_write_section (bfd *abfd ATTRIBUTE_UNUSED, + asection *asec, + bfd_byte *contents ATTRIBUTE_UNUSED) +{ + return (apuinfo_list_length () + && strcmp (asec->name, APUINFO_SECTION_NAME) == 0); +} + + +/* Finally we can generate the output section. */ + +static void +ppc_elf_final_write_processing (bfd *abfd, bfd_boolean linker ATTRIBUTE_UNUSED) +{ + bfd_byte *buffer; + asection *asec; + unsigned i; + unsigned num_entries; + bfd_size_type length; + + asec = bfd_get_section_by_name (abfd, APUINFO_SECTION_NAME); + if (asec == NULL) + return; + + if (apuinfo_list_length () == 0) + return; + + length = asec->_raw_size; + if (length < 20) + return; + + buffer = bfd_malloc (length); + if (buffer == NULL) + { + (*_bfd_error_handler) + (_("failed to allocate space for new APUinfo section.")); + return; + } + + /* Create the apuinfo header. */ + num_entries = apuinfo_list_length (); + bfd_put_32 (abfd, sizeof APUINFO_LABEL, buffer); + bfd_put_32 (abfd, num_entries * 4, buffer + 4); + bfd_put_32 (abfd, 0x2, buffer + 8); + strcpy (buffer + 12, APUINFO_LABEL); + + length = 20; + for (i = 0; i < num_entries; i++) + { + bfd_put_32 (abfd, apuinfo_list_element (i), buffer + length); + length += 4; + } + + if (length != asec->_raw_size) + (*_bfd_error_handler) (_("failed to compute new APUinfo section.")); + + if (! bfd_set_section_contents (abfd, asec, buffer, (file_ptr) 0, length)) + (*_bfd_error_handler) (_("failed to install new APUinfo section.")); + + free (buffer); + + apuinfo_list_finish (); } + +/* Add extra PPC sections -- Note, for now, make .sbss2 and + .PPC.EMB.sbss0 a normal section, and not a bss section so + that the linker doesn't crater when trying to make more than + 2 sections. */ + +static struct bfd_elf_special_section const ppc_elf_special_sections[]= +{ + { ".tags", 5, 0, SHT_ORDERED, SHF_ALLOC }, + { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { ".sdata2", 7, -2, SHT_PROGBITS, SHF_ALLOC }, + { ".sbss2", 6, -2, SHT_PROGBITS, SHF_ALLOC }, + { ".PPC.EMB.apuinfo", 16, 0, SHT_NOTE, 0 }, + { ".PPC.EMB.sdata0", 15, 0, SHT_PROGBITS, SHF_ALLOC }, + { ".PPC.EMB.sbss0", 14, 0, SHT_PROGBITS, SHF_ALLOC }, + { ".plt", 4, 0, SHT_NOBITS, SHF_ALLOC + SHF_EXECINSTR }, + { NULL, 0, 0, 0, 0 } +}; #define TARGET_LITTLE_SYM bfd_elf32_powerpcle_vec #define TARGET_LITTLE_NAME "elf32-powerpcle" @@ -3799,7 +6153,11 @@ ppc_elf_grok_psinfo (abfd, note) #define TARGET_BIG_NAME "elf32-powerpc" #define ELF_ARCH bfd_arch_powerpc #define ELF_MACHINE_CODE EM_PPC +#ifdef __QNXTARGET__ +#define ELF_MAXPAGESIZE 0x1000 +#else #define ELF_MAXPAGESIZE 0x10000 +#endif #define elf_info_to_howto ppc_elf_info_to_howto #ifdef EM_CYGNUS_POWERPC @@ -3815,14 +6173,14 @@ ppc_elf_grok_psinfo (abfd, note) #define elf_backend_can_gc_sections 1 #define elf_backend_can_refcount 1 #define elf_backend_got_header_size 12 -#define elf_backend_plt_header_size PLT_INITIAL_ENTRY_SIZE #define elf_backend_rela_normal 1 +#define bfd_elf32_mkobject ppc_elf_mkobject #define bfd_elf32_bfd_merge_private_bfd_data ppc_elf_merge_private_bfd_data -#define bfd_elf32_bfd_relax_section ppc_elf_relax_section +#define bfd_elf32_bfd_relax_section ppc_elf_relax_section #define bfd_elf32_bfd_reloc_type_lookup ppc_elf_reloc_type_lookup #define bfd_elf32_bfd_set_private_flags ppc_elf_set_private_flags -#define bfd_elf32_bfd_final_link _bfd_elf32_gc_common_final_link +#define bfd_elf32_bfd_link_hash_table_create ppc_elf_link_hash_table_create #define elf_backend_object_p ppc_elf_object_p #define elf_backend_gc_mark_hook ppc_elf_gc_mark_hook @@ -3831,6 +6189,7 @@ ppc_elf_grok_psinfo (abfd, note) #define elf_backend_relocate_section ppc_elf_relocate_section #define elf_backend_create_dynamic_sections ppc_elf_create_dynamic_sections #define elf_backend_check_relocs ppc_elf_check_relocs +#define elf_backend_copy_indirect_symbol ppc_elf_copy_indirect_symbol #define elf_backend_adjust_dynamic_symbol ppc_elf_adjust_dynamic_symbol #define elf_backend_add_symbol_hook ppc_elf_add_symbol_hook #define elf_backend_size_dynamic_sections ppc_elf_size_dynamic_sections @@ -3842,5 +6201,9 @@ ppc_elf_grok_psinfo (abfd, note) #define elf_backend_grok_prstatus ppc_elf_grok_prstatus #define elf_backend_grok_psinfo ppc_elf_grok_psinfo #define elf_backend_reloc_type_class ppc_elf_reloc_type_class +#define elf_backend_begin_write_processing ppc_elf_begin_write_processing +#define elf_backend_final_write_processing ppc_elf_final_write_processing +#define elf_backend_write_section ppc_elf_write_section +#define elf_backend_special_sections ppc_elf_special_sections #include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf32-s390.c b/contrib/binutils/bfd/elf32-s390.c index b7e2189..074c108 100644 --- a/contrib/binutils/bfd/elf32-s390.c +++ b/contrib/binutils/bfd/elf32-s390.c @@ -1,5 +1,5 @@ /* IBM S/390-specific support for 32-bit ELF - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Carl B. Pedersen and Martin Schwidefsky. This file is part of BFD, the Binary File Descriptor library. @@ -29,50 +29,67 @@ static reloc_howto_type *elf_s390_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static void elf_s390_info_to_howto PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); -static boolean elf_s390_is_local_label_name +static bfd_boolean elf_s390_is_local_label_name PARAMS ((bfd *, const char *)); static struct bfd_hash_entry *link_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); static struct bfd_link_hash_table *elf_s390_link_hash_table_create PARAMS ((bfd *)); -static boolean create_got_section +static bfd_boolean create_got_section PARAMS((bfd *, struct bfd_link_info *)); -static boolean elf_s390_create_dynamic_sections +static bfd_boolean elf_s390_create_dynamic_sections PARAMS((bfd *, struct bfd_link_info *)); static void elf_s390_copy_indirect_symbol - PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *, struct elf_link_hash_entry *)); -static boolean elf_s390_check_relocs +static bfd_boolean elf_s390_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection *elf_s390_gc_mark_hook PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static boolean elf_s390_gc_sweep_hook +static bfd_boolean elf_s390_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); -static boolean elf_s390_adjust_dynamic_symbol +struct elf_s390_link_hash_entry; +static void elf_s390_adjust_gotplt + PARAMS ((struct elf_s390_link_hash_entry *)); +static bfd_boolean elf_s390_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); -static boolean allocate_dynrelocs +static bfd_boolean allocate_dynrelocs PARAMS ((struct elf_link_hash_entry *, PTR)); -static boolean readonly_dynrelocs +static bfd_boolean readonly_dynrelocs PARAMS ((struct elf_link_hash_entry *, PTR)); -static boolean elf_s390_size_dynamic_sections +static bfd_boolean elf_s390_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static boolean elf_s390_relocate_section +static bfd_boolean elf_s390_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static boolean elf_s390_finish_dynamic_symbol +static bfd_boolean elf_s390_finish_dynamic_symbol PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static enum elf_reloc_type_class elf_s390_reloc_type_class PARAMS ((const Elf_Internal_Rela *)); -static boolean elf_s390_finish_dynamic_sections +static bfd_boolean elf_s390_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static boolean elf_s390_object_p PARAMS ((bfd *)); -static boolean elf_s390_grok_prstatus PARAMS ((bfd *, Elf_Internal_Note *)); - -#define USE_RELA 1 /* We want RELA relocations, not REL. */ +static bfd_boolean elf_s390_mkobject + PARAMS ((bfd *)); +static bfd_boolean elf_s390_object_p + PARAMS ((bfd *)); +static bfd_boolean elf_s390_grok_prstatus + PARAMS ((bfd *, Elf_Internal_Note *)); +static int elf_s390_tls_transition + PARAMS ((struct bfd_link_info *, int, int)); +static bfd_reloc_status_type s390_tls_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_vma dtpoff_base + PARAMS ((struct bfd_link_info *)); +static bfd_vma tpoff + PARAMS ((struct bfd_link_info *, bfd_vma)); +static void invalid_tls_insn + PARAMS ((bfd *, asection *, Elf_Internal_Rela *)); +static bfd_reloc_status_type s390_elf_ldisp_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); #include "elf/s390.h" @@ -84,45 +101,130 @@ static reloc_howto_type elf_howto_table[] = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_390_NONE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO(R_390_8, 0, 0, 8, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_8", false, 0,0x000000ff, false), - HOWTO(R_390_12, 0, 1, 12, false, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_390_12", false, 0,0x00000fff, false), - HOWTO(R_390_16, 0, 1, 16, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_16", false, 0,0x0000ffff, false), - HOWTO(R_390_32, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_32", false, 0,0xffffffff, false), - HOWTO(R_390_PC32, 0, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC32", false, 0,0xffffffff, true), - HOWTO(R_390_GOT12, 0, 1, 12, false, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_390_GOT12", false, 0,0x00000fff, false), - HOWTO(R_390_GOT32, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOT32", false, 0,0xffffffff, false), - HOWTO(R_390_PLT32, 0, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT32", false, 0,0xffffffff, true), - HOWTO(R_390_COPY, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_COPY", false, 0,0xffffffff, false), - HOWTO(R_390_GLOB_DAT, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GLOB_DAT",false, 0,0xffffffff, false), - HOWTO(R_390_JMP_SLOT, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_JMP_SLOT",false, 0,0xffffffff, false), - HOWTO(R_390_RELATIVE, 0, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_RELATIVE",false, 0,0xffffffff, false), - HOWTO(R_390_GOTOFF, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTOFF", false, 0,0xffffffff, false), - HOWTO(R_390_GOTPC, 0, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTPC", false, 0,0xffffffff, true), - HOWTO(R_390_GOT16, 0, 1, 16, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOT16", false, 0,0x0000ffff, false), - HOWTO(R_390_PC16, 0, 1, 16, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC16", false, 0,0x0000ffff, true), - HOWTO(R_390_PC16DBL, 1, 1, 16, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC16DBL", false, 0,0x0000ffff, true), - HOWTO(R_390_PLT16DBL, 1, 1, 16, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT16DBL", false, 0,0x0000ffff, true), - HOWTO(R_390_PC32DBL, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC32DBL", false, 0,0xffffffff, true), - HOWTO(R_390_PLT32DBL, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT32DBL", false, 0,0xffffffff, true), - HOWTO(R_390_GOTPCDBL, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTPCDBL", false, 0,0xffffffff, true), - HOWTO(R_390_GOTENT, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTENT", false, 0,0xffffffff, true), + FALSE), /* pcrel_offset */ + + HOWTO(R_390_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_8", FALSE, 0,0x000000ff, FALSE), + HOWTO(R_390_12, 0, 1, 12, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_390_12", FALSE, 0,0x00000fff, FALSE), + HOWTO(R_390_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_32", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_PC32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC32", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_GOT12, 0, 1, 12, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOT12", FALSE, 0,0x00000fff, FALSE), + HOWTO(R_390_GOT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOT32", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_PLT32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLT32", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_COPY, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_COPY", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_GLOB_DAT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GLOB_DAT", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_JMP_SLOT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_JMP_SLOT", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_RELATIVE, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_RELATIVE", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_GOTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTOFF32", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_GOTPC, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPC", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_GOT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOT16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_PC16, 0, 1, 16, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC16", FALSE, 0,0x0000ffff, TRUE), + HOWTO(R_390_PC16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC16DBL", FALSE, 0,0x0000ffff, TRUE), + HOWTO(R_390_PLT16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLT16DBL", FALSE, 0,0x0000ffff, TRUE), + HOWTO(R_390_PC32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC32DBL", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_PLT32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLT32DBL", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_GOTPCDBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPCDBL", FALSE, 0,0xffffffff, TRUE), + EMPTY_HOWTO (R_390_64), /* Empty entry for R_390_64. */ + EMPTY_HOWTO (R_390_PC64), /* Empty entry for R_390_PC64. */ + EMPTY_HOWTO (R_390_GOT64), /* Empty entry for R_390_GOT64. */ + EMPTY_HOWTO (R_390_PLT64), /* Empty entry for R_390_PLT64. */ + HOWTO(R_390_GOTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTENT", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_GOTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTOFF16", FALSE, 0,0x0000ffff, FALSE), + EMPTY_HOWTO (R_390_GOTOFF64), /* Empty entry for R_390_GOTOFF64. */ + HOWTO(R_390_GOTPLT12, 0, 1, 12, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_390_GOTPLT12", FALSE, 0,0x00000fff, FALSE), + HOWTO(R_390_GOTPLT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPLT16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_GOTPLT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPLT32", FALSE, 0,0xffffffff, FALSE), + EMPTY_HOWTO (R_390_GOTPLT64), /* Empty entry for R_390_GOTPLT64. */ + HOWTO(R_390_GOTPLTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPLTENT",FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_PLTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLTOFF16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_PLTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLTOFF32", FALSE, 0,0xffffffff, FALSE), + EMPTY_HOWTO (R_390_PLTOFF64), /* Empty entry for R_390_PLTOFF64. */ + HOWTO(R_390_TLS_LOAD, 0, 0, 0, FALSE, 0, complain_overflow_dont, + s390_tls_reloc, "R_390_TLS_LOAD", FALSE, 0, 0, FALSE), + HOWTO(R_390_TLS_GDCALL, 0, 0, 0, FALSE, 0, complain_overflow_dont, + s390_tls_reloc, "R_390_TLS_GDCALL", FALSE, 0, 0, FALSE), + HOWTO(R_390_TLS_LDCALL, 0, 0, 0, FALSE, 0, complain_overflow_dont, + s390_tls_reloc, "R_390_TLS_LDCALL", FALSE, 0, 0, FALSE), + HOWTO(R_390_TLS_GD32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_GD32", FALSE, 0, 0xffffffff, FALSE), + EMPTY_HOWTO (R_390_TLS_GD64), /* Empty entry for R_390_TLS_GD64. */ + HOWTO(R_390_TLS_GOTIE12, 0, 1, 12, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_390_TLS_GOTIE12", FALSE, 0, 0x00000fff, FALSE), + HOWTO(R_390_TLS_GOTIE32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_GOTIE32", FALSE, 0, 0xffffffff, FALSE), + EMPTY_HOWTO (R_390_TLS_GOTIE64), /* Empty entry for R_390_TLS_GOTIE64. */ + HOWTO(R_390_TLS_LDM32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_LDM32", FALSE, 0, 0xffffffff, FALSE), + EMPTY_HOWTO (R_390_TLS_LDM64), /* Empty entry for R_390_TLS_LDM64. */ + HOWTO(R_390_TLS_IE32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_IE32", FALSE, 0, 0xffffffff, FALSE), + EMPTY_HOWTO (R_390_TLS_IE64), /* Empty entry for R_390_TLS_IE64. */ + HOWTO(R_390_TLS_IEENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_IEENT", FALSE, 0, 0xffffffff, TRUE), + HOWTO(R_390_TLS_LE32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_LE32", FALSE, 0, 0xffffffff, FALSE), + EMPTY_HOWTO (R_390_TLS_LE64), /* Empty entry for R_390_TLS_LE64. */ + HOWTO(R_390_TLS_LDO32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_LDO32", FALSE, 0, 0xffffffff, FALSE), + EMPTY_HOWTO (R_390_TLS_LDO64), /* Empty entry for R_390_TLS_LDO64. */ + HOWTO(R_390_TLS_DTPMOD, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_DTPMOD", FALSE, 0, 0xffffffff, FALSE), + HOWTO(R_390_TLS_DTPOFF, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_DTPOFF", FALSE, 0, 0xffffffff, FALSE), + HOWTO(R_390_TLS_TPOFF, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_TPOFF", FALSE, 0, 0xffffffff, FALSE), + HOWTO(R_390_20, 0, 2, 20, FALSE, 8, complain_overflow_dont, + s390_elf_ldisp_reloc, "R_390_20", FALSE, 0,0x0fffff00, FALSE), + HOWTO(R_390_GOT20, 0, 2, 20, FALSE, 8, complain_overflow_dont, + s390_elf_ldisp_reloc, "R_390_GOT20", FALSE, 0,0x0fffff00, FALSE), + HOWTO(R_390_GOTPLT20, 0, 2, 20, FALSE, 8, complain_overflow_dont, + s390_elf_ldisp_reloc, "R_390_GOTPLT20", FALSE, 0,0x0fffff00, FALSE), + HOWTO(R_390_TLS_GOTIE20, 0, 2, 20, FALSE, 8, complain_overflow_dont, + s390_elf_ldisp_reloc, "R_390_TLS_GOTIE20", FALSE, 0,0x0fffff00, FALSE), }; /* GNU extension to record C++ vtable hierarchy. */ static reloc_howto_type elf32_s390_vtinherit_howto = - HOWTO (R_390_GNU_VTINHERIT, 0,2,0,false,0,complain_overflow_dont, NULL, "R_390_GNU_VTINHERIT", false,0, 0, false); + HOWTO (R_390_GNU_VTINHERIT, 0,2,0,FALSE,0,complain_overflow_dont, NULL, "R_390_GNU_VTINHERIT", FALSE,0, 0, FALSE); static reloc_howto_type elf32_s390_vtentry_howto = - HOWTO (R_390_GNU_VTENTRY, 0,2,0,false,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_390_GNU_VTENTRY", false,0,0, false); + HOWTO (R_390_GNU_VTENTRY, 0,2,0,FALSE,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_390_GNU_VTENTRY", FALSE,0,0, FALSE); static reloc_howto_type * elf_s390_reloc_type_lookup (abfd, code) @@ -160,7 +262,7 @@ elf_s390_reloc_type_lookup (abfd, code) case BFD_RELOC_390_RELATIVE: return &elf_howto_table[(int) R_390_RELATIVE]; case BFD_RELOC_32_GOTOFF: - return &elf_howto_table[(int) R_390_GOTOFF]; + return &elf_howto_table[(int) R_390_GOTOFF32]; case BFD_RELOC_390_GOTPC: return &elf_howto_table[(int) R_390_GOTPC]; case BFD_RELOC_390_GOT16: @@ -179,6 +281,56 @@ elf_s390_reloc_type_lookup (abfd, code) return &elf_howto_table[(int) R_390_GOTPCDBL]; case BFD_RELOC_390_GOTENT: return &elf_howto_table[(int) R_390_GOTENT]; + case BFD_RELOC_16_GOTOFF: + return &elf_howto_table[(int) R_390_GOTOFF16]; + case BFD_RELOC_390_GOTPLT12: + return &elf_howto_table[(int) R_390_GOTPLT12]; + case BFD_RELOC_390_GOTPLT16: + return &elf_howto_table[(int) R_390_GOTPLT16]; + case BFD_RELOC_390_GOTPLT32: + return &elf_howto_table[(int) R_390_GOTPLT32]; + case BFD_RELOC_390_GOTPLTENT: + return &elf_howto_table[(int) R_390_GOTPLTENT]; + case BFD_RELOC_390_PLTOFF16: + return &elf_howto_table[(int) R_390_PLTOFF16]; + case BFD_RELOC_390_PLTOFF32: + return &elf_howto_table[(int) R_390_PLTOFF32]; + case BFD_RELOC_390_TLS_LOAD: + return &elf_howto_table[(int) R_390_TLS_LOAD]; + case BFD_RELOC_390_TLS_GDCALL: + return &elf_howto_table[(int) R_390_TLS_GDCALL]; + case BFD_RELOC_390_TLS_LDCALL: + return &elf_howto_table[(int) R_390_TLS_LDCALL]; + case BFD_RELOC_390_TLS_GD32: + return &elf_howto_table[(int) R_390_TLS_GD32]; + case BFD_RELOC_390_TLS_GOTIE12: + return &elf_howto_table[(int) R_390_TLS_GOTIE12]; + case BFD_RELOC_390_TLS_GOTIE32: + return &elf_howto_table[(int) R_390_TLS_GOTIE32]; + case BFD_RELOC_390_TLS_LDM32: + return &elf_howto_table[(int) R_390_TLS_LDM32]; + case BFD_RELOC_390_TLS_IE32: + return &elf_howto_table[(int) R_390_TLS_IE32]; + case BFD_RELOC_390_TLS_IEENT: + return &elf_howto_table[(int) R_390_TLS_IEENT]; + case BFD_RELOC_390_TLS_LE32: + return &elf_howto_table[(int) R_390_TLS_LE32]; + case BFD_RELOC_390_TLS_LDO32: + return &elf_howto_table[(int) R_390_TLS_LDO32]; + case BFD_RELOC_390_TLS_DTPMOD: + return &elf_howto_table[(int) R_390_TLS_DTPMOD]; + case BFD_RELOC_390_TLS_DTPOFF: + return &elf_howto_table[(int) R_390_TLS_DTPOFF]; + case BFD_RELOC_390_TLS_TPOFF: + return &elf_howto_table[(int) R_390_TLS_TPOFF]; + case BFD_RELOC_390_20: + return &elf_howto_table[(int) R_390_20]; + case BFD_RELOC_390_GOT20: + return &elf_howto_table[(int) R_390_GOT20]; + case BFD_RELOC_390_GOTPLT20: + return &elf_howto_table[(int) R_390_GOTPLT20]; + case BFD_RELOC_390_TLS_GOTIE20: + return &elf_howto_table[(int) R_390_TLS_GOTIE20]; case BFD_RELOC_VTABLE_INHERIT: return &elf32_s390_vtinherit_howto; case BFD_RELOC_VTABLE_ENTRY: @@ -214,13 +366,83 @@ elf_s390_info_to_howto (abfd, cache_ptr, dst) } } -static boolean +/* A relocation function which doesn't do anything. */ +static bfd_reloc_status_type +s390_tls_reloc (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) + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; +} + +/* Handle the large displacement relocs. */ +static bfd_reloc_status_type +s390_elf_ldisp_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry; + asymbol *symbol; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + reloc_howto_type *howto = reloc_entry->howto; + bfd_vma relocation; + bfd_vma insn; + + if (output_bfd != (bfd *) NULL + && (symbol->flags & BSF_SECTION_SYM) == 0 + && (! howto->partial_inplace + || reloc_entry->addend == 0)) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + + if (output_bfd != NULL) + return bfd_reloc_continue; + + if (reloc_entry->address > input_section->_cooked_size) + return bfd_reloc_outofrange; + + relocation = (symbol->value + + symbol->section->output_section->vma + + symbol->section->output_offset); + relocation += reloc_entry->addend; + if (howto->pc_relative) + { + relocation -= (input_section->output_section->vma + + input_section->output_offset); + relocation -= reloc_entry->address; + } + + insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + insn |= (relocation & 0xfff) << 16 | (relocation & 0xff000) >> 4; + bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address); + + if ((bfd_signed_vma) relocation < - 0x80000 + || (bfd_signed_vma) relocation > 0x7ffff) + return bfd_reloc_overflow; + else + return bfd_reloc_ok; +} + +static bfd_boolean elf_s390_is_local_label_name (abfd, name) bfd *abfd; const char *name; { if (name[0] == '.' && (name[1] == 'X' || name[1] == 'L')) - return true; + return TRUE; return _bfd_elf_is_local_label_name (abfd, name); } @@ -232,6 +454,12 @@ elf_s390_is_local_label_name (abfd, name) #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" +/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid + copying dynamic variables from a shared lib into an app's dynbss + section, and instead use a dynamic relocation to point into the + shared lib. */ +#define ELIMINATE_COPY_RELOCS 1 + /* The size in bytes of the first entry in the procedure linkage table. */ #define PLT_FIRST_ENTRY_SIZE 32 /* The size in bytes of an entry in the procedure linkage table. */ @@ -256,7 +484,7 @@ elf_s390_is_local_label_name (abfd, name) Word 1 is a pointer to a structure describing the object Word 2 is used to point to the loader entry address. - The code for position independand PLT entries looks like this: + The code for position independent PLT entries looks like this: r12 holds addr of the current GOT at entry to the PLT @@ -413,8 +641,54 @@ struct elf_s390_link_hash_entry /* Track dynamic relocs copied for this symbol. */ struct elf_s390_dyn_relocs *dyn_relocs; + + /* Number of GOTPLT references for a function. */ + bfd_signed_vma gotplt_refcount; + +#define GOT_UNKNOWN 0 +#define GOT_NORMAL 1 +#define GOT_TLS_GD 2 +#define GOT_TLS_IE 3 +#define GOT_TLS_IE_NLT 4 + unsigned char tls_type; }; +#define elf_s390_hash_entry(ent) \ + ((struct elf_s390_link_hash_entry *)(ent)) + +struct elf_s390_obj_tdata +{ + struct elf_obj_tdata root; + + /* tls_type for each local got entry. */ + char *local_got_tls_type; +}; + +#define elf_s390_tdata(abfd) \ + ((struct elf_s390_obj_tdata *) (abfd)->tdata.any) + +#define elf_s390_local_got_tls_type(abfd) \ + (elf_s390_tdata (abfd)->local_got_tls_type) + +static bfd_boolean +elf_s390_mkobject (abfd) + bfd *abfd; +{ + bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + return TRUE; +} + +static bfd_boolean +elf_s390_object_p (abfd) + bfd *abfd; +{ + /* Set the right machine number for an s390 elf32 file. */ + return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_31); +} + /* s390 ELF linker hash table. */ struct elf_s390_link_hash_table @@ -430,6 +704,11 @@ struct elf_s390_link_hash_table asection *sdynbss; asection *srelbss; + union { + bfd_signed_vma refcount; + bfd_vma offset; + } tls_ldm_got; + /* Small local sym to section mapping cache. */ struct sym_sec_cache sym_sec; }; @@ -465,6 +744,8 @@ link_hash_newfunc (entry, table, string) eh = (struct elf_s390_link_hash_entry *) entry; eh->dyn_relocs = NULL; + eh->gotplt_refcount = 0; + eh->tls_type = GOT_UNKNOWN; } return entry; @@ -496,6 +777,7 @@ elf_s390_link_hash_table_create (abfd) ret->srelplt = NULL; ret->sdynbss = NULL; ret->srelbss = NULL; + ret->tls_ldm_got.refcount = 0; ret->sym_sec.abfd = NULL; return &ret->elf.root; @@ -504,7 +786,7 @@ elf_s390_link_hash_table_create (abfd) /* Create .got, .gotplt, and .rela.got sections in DYNOBJ, and set up shortcuts to them in our hash table. */ -static boolean +static bfd_boolean create_got_section (dynobj, info) bfd *dynobj; struct bfd_link_info *info; @@ -512,7 +794,7 @@ create_got_section (dynobj, info) struct elf_s390_link_hash_table *htab; if (! _bfd_elf_create_got_section (dynobj, info)) - return false; + return FALSE; htab = elf_s390_hash_table (info); htab->sgot = bfd_get_section_by_name (dynobj, ".got"); @@ -527,15 +809,15 @@ create_got_section (dynobj, info) | SEC_IN_MEMORY | SEC_LINKER_CREATED | SEC_READONLY)) || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2)) - return false; - return true; + return FALSE; + return TRUE; } /* Create .plt, .rela.plt, .got, .got.plt, .rela.got, .dynbss, and .rela.bss sections in DYNOBJ, and set up shortcuts to them in our hash table. */ -static boolean +static bfd_boolean elf_s390_create_dynamic_sections (dynobj, info) bfd *dynobj; struct bfd_link_info *info; @@ -544,10 +826,10 @@ elf_s390_create_dynamic_sections (dynobj, info) htab = elf_s390_hash_table (info); if (!htab->sgot && !create_got_section (dynobj, info)) - return false; + return FALSE; if (!_bfd_elf_create_dynamic_sections (dynobj, info)) - return false; + return FALSE; htab->splt = bfd_get_section_by_name (dynobj, ".plt"); htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); @@ -559,14 +841,14 @@ elf_s390_create_dynamic_sections (dynobj, info) || (!info->shared && !htab->srelbss)) abort (); - return true; + return TRUE; } /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void elf_s390_copy_indirect_symbol (bed, dir, ind) - struct elf_backend_data *bed; + const struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct elf_s390_link_hash_entry *edir, *eind; @@ -608,14 +890,60 @@ elf_s390_copy_indirect_symbol (bed, dir, ind) eind->dyn_relocs = NULL; } - _bfd_elf_link_hash_copy_indirect (bed, dir, ind); + if (ind->root.type == bfd_link_hash_indirect + && dir->got.refcount <= 0) + { + edir->tls_type = eind->tls_type; + eind->tls_type = GOT_UNKNOWN; + } + + if (ELIMINATE_COPY_RELOCS + && ind->root.type != bfd_link_hash_indirect + && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) + /* If called to transfer flags for a weakdef during processing + of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF. + We clear it ourselves for ELIMINATE_COPY_RELOCS. */ + dir->elf_link_hash_flags |= + (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK + | ELF_LINK_HASH_NEEDS_PLT)); + else + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); +} + +static int +elf_s390_tls_transition (info, r_type, is_local) + struct bfd_link_info *info; + int r_type; + int is_local; +{ + if (info->shared) + return r_type; + + switch (r_type) + { + case R_390_TLS_GD32: + case R_390_TLS_IE32: + if (is_local) + return R_390_TLS_LE32; + return R_390_TLS_IE32; + case R_390_TLS_GOTIE32: + if (is_local) + return R_390_TLS_LE32; + return R_390_TLS_GOTIE32; + case R_390_TLS_LDM32: + return R_390_TLS_LE32; + } + + return r_type; } /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage table. */ -static boolean +static bfd_boolean elf_s390_check_relocs (abfd, info, sec, relocs) bfd *abfd; struct bfd_link_info *info; @@ -628,19 +956,23 @@ elf_s390_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; asection *sreloc; + bfd_signed_vma *local_got_refcounts; + int tls_type, old_tls_type; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; htab = elf_s390_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); sreloc = NULL; rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { + unsigned int r_type; unsigned long r_symndx; struct elf_link_hash_entry *h; @@ -651,7 +983,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) (*_bfd_error_handler) (_("%s: bad symbol index: %d"), bfd_archive_filename (abfd), r_symndx); - return false; + return FALSE; } if (r_symndx < symtab_hdr->sh_info) @@ -659,40 +991,48 @@ elf_s390_check_relocs (abfd, info, sec, relocs) else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - switch (ELF32_R_TYPE (rel->r_info)) + /* Create got section and local_got_refcounts array if they + are needed. */ + r_type = elf_s390_tls_transition (info, + ELF32_R_TYPE (rel->r_info), + h == NULL); + switch (r_type) { case R_390_GOT12: - case R_390_GOT16: + case R_390_GOT16: + case R_390_GOT20: case R_390_GOT32: case R_390_GOTENT: - /* This symbol requires a global offset table entry. */ - if (h != NULL) - { - h->got.refcount += 1; - } - else + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT20: + case R_390_GOTPLT32: + case R_390_GOTPLTENT: + case R_390_TLS_GD32: + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE20: + case R_390_TLS_GOTIE32: + case R_390_TLS_IEENT: + case R_390_TLS_IE32: + case R_390_TLS_LDM32: + if (h == NULL + && local_got_refcounts == NULL) { - bfd_signed_vma *local_got_refcounts; + bfd_size_type size; - /* This is a global offset table entry for a local symbol. */ - local_got_refcounts = elf_local_got_refcounts (abfd); + size = symtab_hdr->sh_info; + size *= (sizeof (bfd_signed_vma) + sizeof(char)); + local_got_refcounts = ((bfd_signed_vma *) + bfd_zalloc (abfd, size)); if (local_got_refcounts == NULL) - { - bfd_size_type size; - - size = symtab_hdr->sh_info; - size *= sizeof (bfd_signed_vma); - local_got_refcounts = ((bfd_signed_vma *) - bfd_zalloc (abfd, size)); - if (local_got_refcounts == NULL) - return false; - elf_local_got_refcounts (abfd) = local_got_refcounts; - } - local_got_refcounts[r_symndx] += 1; + return FALSE; + elf_local_got_refcounts (abfd) = local_got_refcounts; + elf_s390_local_got_tls_type (abfd) + = (char *) (local_got_refcounts + symtab_hdr->sh_info); } - /* Fall through */ - - case R_390_GOTOFF: + /* Fall through. */ + case R_390_GOTOFF16: + case R_390_GOTOFF32: case R_390_GOTPC: case R_390_GOTPCDBL: if (htab->sgot == NULL) @@ -700,34 +1040,155 @@ elf_s390_check_relocs (abfd, info, sec, relocs) if (htab->elf.dynobj == NULL) htab->elf.dynobj = abfd; if (!create_got_section (htab->elf.dynobj, info)) - return false; + return FALSE; } + } + + switch (r_type) + { + case R_390_GOTOFF16: + case R_390_GOTOFF32: + case R_390_GOTPC: + case R_390_GOTPCDBL: + /* Got is created, nothing to be done. */ break; - case R_390_PLT16DBL: - case R_390_PLT32DBL: + case R_390_PLT16DBL: + case R_390_PLT32DBL: case R_390_PLT32: + case R_390_PLTOFF16: + case R_390_PLTOFF32: /* This symbol requires a procedure linkage table entry. We - actually build the entry in adjust_dynamic_symbol, - because this might be a case of linking PIC code which is - never referenced by a dynamic object, in which case we - don't need to generate a procedure linkage table entry - after all. */ + actually build the entry in adjust_dynamic_symbol, + because this might be a case of linking PIC code which is + never referenced by a dynamic object, in which case we + don't need to generate a procedure linkage table entry + after all. */ /* If this is a local symbol, we resolve it directly without - creating a procedure linkage table entry. */ - if (h == NULL) - continue; + creating a procedure linkage table entry. */ + if (h != NULL) + { + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.refcount += 1; + } + break; - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - h->plt.refcount += 1; + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT20: + case R_390_GOTPLT32: + case R_390_GOTPLTENT: + /* This symbol requires either a procedure linkage table entry + or an entry in the local got. We actually build the entry + in adjust_dynamic_symbol because whether this is really a + global reference can change and with it the fact if we have + to create a plt entry or a local got entry. To be able to + make a once global symbol a local one we have to keep track + of the number of gotplt references that exist for this + symbol. */ + if (h != NULL) + { + ((struct elf_s390_link_hash_entry *) h)->gotplt_refcount++; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.refcount += 1; + } + else + local_got_refcounts[r_symndx] += 1; + break; + + case R_390_TLS_LDM32: + htab->tls_ldm_got.refcount += 1; break; - case R_390_8: - case R_390_16: + case R_390_TLS_IE32: + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE20: + case R_390_TLS_GOTIE32: + case R_390_TLS_IEENT: + if (info->shared) + info->flags |= DF_STATIC_TLS; + /* Fall through. */ + + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT20: + case R_390_GOT32: + case R_390_GOTENT: + case R_390_TLS_GD32: + /* This symbol requires a global offset table entry. */ + switch (r_type) + { + default: + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT20: + case R_390_GOT32: + case R_390_GOTENT: + tls_type = GOT_NORMAL; + break; + case R_390_TLS_GD32: + tls_type = GOT_TLS_GD; + break; + case R_390_TLS_IE32: + case R_390_TLS_GOTIE32: + tls_type = GOT_TLS_IE; + break; + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE20: + case R_390_TLS_IEENT: + tls_type = GOT_TLS_IE_NLT; + break; + } + + if (h != NULL) + { + h->got.refcount += 1; + old_tls_type = elf_s390_hash_entry(h)->tls_type; + } + else + { + local_got_refcounts[r_symndx] += 1; + old_tls_type = elf_s390_local_got_tls_type (abfd) [r_symndx]; + } + /* If a TLS symbol is accessed using IE at least once, + there is no point to use dynamic model for it. */ + if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN) + { + if (old_tls_type == GOT_NORMAL || tls_type == GOT_NORMAL) + { + (*_bfd_error_handler) + (_("%s: `%s' accessed both as normal and thread local symbol"), + bfd_archive_filename (abfd), h->root.root.string); + return FALSE; + } + if (old_tls_type > tls_type) + tls_type = old_tls_type; + } + + if (old_tls_type != tls_type) + { + if (h != NULL) + elf_s390_hash_entry (h)->tls_type = tls_type; + else + elf_s390_local_got_tls_type (abfd) [r_symndx] = tls_type; + } + + if (r_type != R_390_TLS_IE32) + break; + /* Fall through. */ + + case R_390_TLS_LE32: + if (!info->shared) + break; + info->flags |= DF_STATIC_TLS; + /* Fall through. */ + + case R_390_8: + case R_390_16: case R_390_32: - case R_390_PC16: - case R_390_PC16DBL: + case R_390_PC16: + case R_390_PC16DBL: case R_390_PC32DBL: case R_390_PC32: if (h != NULL && !info->shared) @@ -777,7 +1238,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs) || h->root.type == bfd_link_hash_defweak || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared + || (ELIMINATE_COPY_RELOCS + && !info->shared && (sec->flags & SEC_ALLOC) != 0 && h != NULL && (h->root.type == bfd_link_hash_defweak @@ -800,7 +1262,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) elf_elfheader (abfd)->e_shstrndx, elf_section_data (sec)->rel_hdr.sh_name)); if (name == NULL) - return false; + return FALSE; if (strncmp (name, ".rela", 5) != 0 || strcmp (bfd_get_section_name (abfd, sec), @@ -828,7 +1290,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) if (sreloc == NULL || ! bfd_set_section_flags (dynobj, sreloc, flags) || ! bfd_set_section_alignment (dynobj, sreloc, 2)) - return false; + return FALSE; } elf_section_data (sec)->sreloc = sreloc; } @@ -844,12 +1306,12 @@ elf_s390_check_relocs (abfd, info, sec, relocs) /* Track dynamic relocs needed for local syms too. We really need local syms available to do this easily. Oh well. */ - asection *s; + s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, sec, r_symndx); if (s == NULL) - return false; + return FALSE; head = ((struct elf_s390_dyn_relocs **) &elf_section_data (s)->local_dynrel); @@ -859,10 +1321,11 @@ elf_s390_check_relocs (abfd, info, sec, relocs) if (p == NULL || p->sec != sec) { bfd_size_type amt = sizeof *p; + p = ((struct elf_s390_dyn_relocs *) bfd_alloc (htab->elf.dynobj, amt)); if (p == NULL) - return false; + return FALSE; p->next = *head; *head = p; p->sec = sec; @@ -881,24 +1344,24 @@ elf_s390_check_relocs (abfd, info, sec, relocs) /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ - case R_390_GNU_VTINHERIT: - if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) - return false; - break; + case R_390_GNU_VTINHERIT: + if (!bfd_elf_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_390_GNU_VTENTRY: - if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend)) - return false; - break; + case R_390_GNU_VTENTRY: + if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return FALSE; + break; default: break; } } - return true; + return TRUE; } /* Return the section that should be marked against GC for a given @@ -943,7 +1406,7 @@ elf_s390_gc_mark_hook (sec, info, rel, h, sym) /* Update the got entry reference counts for the section being removed. */ -static boolean +static bfd_boolean elf_s390_gc_sweep_hook (abfd, info, sec, relocs) bfd *abfd; struct bfd_link_info *info; @@ -954,8 +1417,6 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) 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; elf_section_data (sec)->local_dynrel = NULL; @@ -965,84 +1426,140 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_390_GOT12: - case R_390_GOT16: - case R_390_GOT32: - case R_390_GOTOFF: - case R_390_GOTPC: - case R_390_GOTPCDBL: - case R_390_GOTENT: - 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; - } - else if (local_got_refcounts != NULL) - { - if (local_got_refcounts[r_symndx] > 0) - local_got_refcounts[r_symndx] -= 1; - } - break; + { + unsigned long r_symndx; + unsigned int r_type; + struct elf_link_hash_entry *h = NULL; + + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf_s390_link_hash_entry *eh; + struct elf_s390_dyn_relocs **pp; + struct elf_s390_dyn_relocs *p; - case R_390_8: - case R_390_12: - case R_390_16: - case R_390_32: - case R_390_PC16: - case R_390_PC16DBL: - case R_390_PC32DBL: - case R_390_PC32: - r_symndx = ELF32_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - struct elf_s390_link_hash_entry *eh; - struct elf_s390_dyn_relocs **pp; - struct elf_s390_dyn_relocs *p; - - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - - if (!info->shared && h->plt.refcount > 0) - h->plt.refcount -= 1; - - eh = (struct elf_s390_link_hash_entry *) h; - - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct elf_s390_link_hash_entry *) h; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } + } + + r_type = ELF32_R_TYPE (rel->r_info); + r_type = elf_s390_tls_transition (info, r_type, h != NULL); + switch (r_type) + { + case R_390_TLS_LDM32: + if (elf_s390_hash_table (info)->tls_ldm_got.refcount > 0) + elf_s390_hash_table (info)->tls_ldm_got.refcount -= 1; + break; + + case R_390_TLS_GD32: + case R_390_TLS_IE32: + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE20: + case R_390_TLS_GOTIE32: + case R_390_TLS_IEENT: + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT20: + case R_390_GOT32: + case R_390_GOTOFF16: + case R_390_GOTOFF32: + case R_390_GOTPC: + case R_390_GOTPCDBL: + case R_390_GOTENT: + if (h != NULL) + { + if (h->got.refcount > 0) + h->got.refcount -= 1; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx] -= 1; + } + break; + + case R_390_8: + case R_390_12: + case R_390_16: + case R_390_20: + case R_390_32: + case R_390_PC16: + case R_390_PC16DBL: + case R_390_PC32DBL: + case R_390_PC32: + if (info->shared) + break; + /* Fall through. */ + + case R_390_PLT16DBL: + case R_390_PLT32DBL: + case R_390_PLT32: + case R_390_PLTOFF16: + case R_390_PLTOFF32: + if (h != NULL) + { + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; + + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT20: + case R_390_GOTPLT32: + case R_390_GOTPLTENT: + if (h != NULL) + { + if (h->plt.refcount > 0) { - if (ELF32_R_TYPE (rel->r_info) == R_390_PC16 - || ELF32_R_TYPE (rel->r_info) == R_390_PC16DBL - || ELF32_R_TYPE (rel->r_info) == R_390_PC32DBL - || ELF32_R_TYPE (rel->r_info) == R_390_PC32) - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; + ((struct elf_s390_link_hash_entry *) h)->gotplt_refcount--; + h->plt.refcount -= 1; } - } - break; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx] -= 1; + } + break; - case R_390_PLT16DBL: - case R_390_PLT32DBL: - case R_390_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; + } + } - default: - break; - } + return TRUE; +} + +/* Make sure we emit a GOT entry if the symbol was supposed to have a PLT + entry but we found we will not create any. Called when we find we will + not have any PLT for this symbol, by for example + elf_s390_adjust_dynamic_symbol when we're doing a proper dynamic link, + or elf_s390_size_dynamic_sections if no dynamic sections will be + created (we're only linking static objects). */ + +static void +elf_s390_adjust_gotplt (h) + struct elf_s390_link_hash_entry *h; +{ + if (h->elf.root.type == bfd_link_hash_warning) + h = (struct elf_s390_link_hash_entry *) h->elf.root.u.i.link; - return true; + if (h->gotplt_refcount <= 0) + return; + + /* We simply add the number of gotplt references to the number + * of got references for this symbol. */ + h->elf.got.refcount += h->gotplt_refcount; + h->gotplt_refcount = -1; } /* Adjust a symbol defined by a dynamic object and referenced by a @@ -1051,14 +1568,12 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) change the definition to something the rest of the link can understand. */ -static boolean +static bfd_boolean elf_s390_adjust_dynamic_symbol (info, h) struct bfd_link_info *info; struct elf_link_hash_entry *h; { struct elf_s390_link_hash_table *htab; - struct elf_s390_link_hash_entry * eh; - struct elf_s390_dyn_relocs *p; asection *s; unsigned int power_of_two; @@ -1076,15 +1591,16 @@ elf_s390_adjust_dynamic_symbol (info, h) && h->root.type != bfd_link_hash_undefined)) { /* 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 + 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; + elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h); } - return true; + return TRUE; } else /* It's possible that we incorrectly decided a .plt reloc was @@ -1103,7 +1619,11 @@ elf_s390_adjust_dynamic_symbol (info, h) || 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 (ELIMINATE_COPY_RELOCS || info->nocopyreloc) + h->elf_link_hash_flags + = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF) + | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF)); + return TRUE; } /* This is a reference to a symbol defined by a dynamic object which @@ -1114,34 +1634,40 @@ elf_s390_adjust_dynamic_symbol (info, h) For such cases we need not do anything here; the relocations will be handled correctly by relocate_section. */ if (info->shared) - return true; + 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; + return TRUE; /* If -z nocopyreloc was given, we won't generate them either. */ if (info->nocopyreloc) { h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - return true; + return TRUE; } - eh = (struct elf_s390_link_hash_entry *) h; - for (p = eh->dyn_relocs; p != NULL; p = p->next) + if (ELIMINATE_COPY_RELOCS) { - s = p->sec->output_section; - if (s != NULL && (s->flags & SEC_READONLY) != 0) - break; - } + struct elf_s390_link_hash_entry * eh; + struct elf_s390_dyn_relocs *p; - /* If we didn't find any dynamic relocs in read-only sections, then - we'll be keeping the dynamic relocs and avoiding the copy reloc. */ - if (p == NULL) - { - h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - return true; + eh = (struct elf_s390_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + break; + } + + /* If we didn't find any dynamic relocs in read-only sections, then + we'll be keeping the dynamic relocs and avoiding the copy reloc. */ + if (p == NULL) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return TRUE; + } } /* We must allocate the symbol in our .dynbss section, which will @@ -1177,7 +1703,7 @@ elf_s390_adjust_dynamic_symbol (info, h) if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) { if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return false; + return FALSE; } /* Define the symbol as being at this point in the section. */ @@ -1187,24 +1713,13 @@ elf_s390_adjust_dynamic_symbol (info, h) /* Increment the section size to make room for the symbol. */ s->_raw_size += h->size; - return true; + return TRUE; } -/* This is the condition under which elf_s390_finish_dynamic_symbol - will be called from elflink.h. If elflink.h doesn't call our - finish_dynamic_symbol routine, we'll need to do something about - initializing any .plt and .got entries in elf_s390_relocate_section. */ -#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ - ((DYN) \ - && ((INFO)->shared \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ - && ((H)->dynindx != -1 \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) - /* Allocate space in .plt, .got and associated reloc sections for dynamic relocs. */ -static boolean +static bfd_boolean allocate_dynrelocs (h, inf) struct elf_link_hash_entry *h; PTR inf; @@ -1215,27 +1730,33 @@ allocate_dynrelocs (h, inf) struct elf_s390_dyn_relocs *p; if (h->root.type == bfd_link_hash_indirect) - return true; + return TRUE; if (h->root.type == bfd_link_hash_warning) + /* When warning symbols are created, they **replace** the "real" + entry in the hash table, thus we never get to see the real + symbol in a hash traversal. So look at it now. */ h = (struct elf_link_hash_entry *) h->root.u.i.link; info = (struct bfd_link_info *) inf; htab = elf_s390_hash_table (info); if (htab->elf.dynamic_sections_created - && h->plt.refcount > 0) + && h->plt.refcount > 0 + && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ if (h->dynindx == -1 && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) + if (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) { asection *s = htab->splt; @@ -1272,33 +1793,69 @@ allocate_dynrelocs (h, inf) { h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h); } } else { h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h); } - if (h->got.refcount > 0) + /* If R_390_TLS_{IE32,GOTIE32,GOTIE12,IEENT} symbol is now local to + the binary, we can optimize a bit. IE32 and GOTIE32 get converted + to R_390_TLS_LE32 requiring no TLS entry. For GOTIE12 and IEENT + we can save the dynamic TLS relocation. */ + if (h->got.refcount > 0 + && !info->shared + && h->dynindx == -1 + && elf_s390_hash_entry(h)->tls_type >= GOT_TLS_IE) { + if (elf_s390_hash_entry(h)->tls_type == GOT_TLS_IE_NLT) + /* For the GOTIE access without a literal pool entry the offset has + to be stored somewhere. The immediate value in the instruction + is not bit enough so the value is stored in the got. */ + { + h->got.offset = htab->sgot->_raw_size; + htab->sgot->_raw_size += GOT_ENTRY_SIZE; + } + else + h->got.offset = (bfd_vma) -1; + } + else if (h->got.refcount > 0) + { asection *s; - boolean dyn; + bfd_boolean dyn; + int tls_type = elf_s390_hash_entry(h)->tls_type; /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ if (h->dynindx == -1 && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) { - if (! bfd_elf32_link_record_dynamic_symbol (info, h)) - return false; + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } s = htab->sgot; h->got.offset = s->_raw_size; s->_raw_size += GOT_ENTRY_SIZE; + /* R_390_TLS_GD32 needs 2 consecutive GOT slots. */ + if (tls_type == GOT_TLS_GD) + s->_raw_size += GOT_ENTRY_SIZE; dyn = htab->elf.dynamic_sections_created; - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) + /* R_390_TLS_IE32 needs one dynamic relocation, + R_390_TLS_GD32 needs one if local symbol and two if global. */ + if ((tls_type == GOT_TLS_GD && h->dynindx == -1) + || tls_type >= GOT_TLS_IE) + htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); + else if (tls_type == GOT_TLS_GD) + htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rela); + else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))) htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); } else @@ -1306,7 +1863,7 @@ allocate_dynrelocs (h, inf) eh = (struct elf_s390_link_hash_entry *) h; if (eh->dyn_relocs == NULL) - return true; + return TRUE; /* In the shared -Bsymbolic case, discard space allocated for dynamic pc-relative relocs against symbols which turn out to be @@ -1316,9 +1873,7 @@ allocate_dynrelocs (h, inf) if (info->shared) { - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 - && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 - || info->symbolic)) + if (SYMBOL_REFERENCES_LOCAL (info, h)) { struct elf_s390_dyn_relocs **pp; @@ -1332,8 +1887,14 @@ allocate_dynrelocs (h, inf) pp = &p->next; } } + + /* Also discard relocs on undefined weak syms with non-default + visibility. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + eh->dyn_relocs = NULL; } - else + else if (ELIMINATE_COPY_RELOCS) { /* For the non-shared case, discard space for relocs against symbols which turn out to need copy relocs or are not @@ -1351,8 +1912,8 @@ allocate_dynrelocs (h, inf) 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; + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } /* If that succeeded, we know we'll be keeping all the @@ -1370,15 +1931,16 @@ allocate_dynrelocs (h, inf) for (p = eh->dyn_relocs; p != NULL; p = p->next) { asection *sreloc = elf_section_data (p->sec)->sreloc; + sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela); } - return true; + return TRUE; } /* Find any dynamic relocs that apply to read-only sections. */ -static boolean +static bfd_boolean readonly_dynrelocs (h, inf) struct elf_link_hash_entry *h; PTR inf; @@ -1401,15 +1963,15 @@ readonly_dynrelocs (h, inf) info->flags |= DF_TEXTREL; /* Not an error, just cut short the traversal. */ - return false; + return FALSE; } } - return true; + return TRUE; } /* Set the sizes of the dynamic sections. */ -static boolean +static bfd_boolean elf_s390_size_dynamic_sections (output_bfd, info) bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; @@ -1417,7 +1979,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) struct elf_s390_link_hash_table *htab; bfd *dynobj; asection *s; - boolean relocs; + bfd_boolean relocs; bfd *ibfd; htab = elf_s390_hash_table (info); @@ -1428,7 +1990,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) if (htab->elf.dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); if (s == NULL) @@ -1444,6 +2006,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; + char *local_tls_type; bfd_size_type locsymcount; Elf_Internal_Shdr *symtab_hdr; asection *srela; @@ -1485,14 +2048,17 @@ elf_s390_size_dynamic_sections (output_bfd, info) symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; locsymcount = symtab_hdr->sh_info; end_local_got = local_got + locsymcount; + local_tls_type = elf_s390_local_got_tls_type (ibfd); s = htab->sgot; srela = htab->srelgot; - for (; local_got < end_local_got; ++local_got) + for (; local_got < end_local_got; ++local_got, ++local_tls_type) { if (*local_got > 0) { *local_got = s->_raw_size; s->_raw_size += GOT_ENTRY_SIZE; + if (*local_tls_type == GOT_TLS_GD) + s->_raw_size += GOT_ENTRY_SIZE; if (info->shared) srela->_raw_size += sizeof (Elf32_External_Rela); } @@ -1501,13 +2067,24 @@ elf_s390_size_dynamic_sections (output_bfd, info) } } + if (htab->tls_ldm_got.refcount > 0) + { + /* Allocate 2 got entries and 1 dynamic reloc for R_390_TLS_LDM32 + relocs. */ + htab->tls_ldm_got.offset = htab->sgot->_raw_size; + htab->sgot->_raw_size += 2 * GOT_ENTRY_SIZE; + htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); + } + else + htab->tls_ldm_got.offset = -1; + /* Allocate global sym .plt and .got entries, and space for global sym dynamic relocs. */ elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); /* We now have determined the sizes of the various dynamic sections. Allocate memory for them. */ - relocs = false; + relocs = FALSE; for (s = dynobj->sections; s != NULL; s = s->next) { if ((s->flags & SEC_LINKER_CREATED) == 0) @@ -1522,8 +2099,8 @@ elf_s390_size_dynamic_sections (output_bfd, info) } else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) { - if (s->_raw_size != 0 && s != htab->srelplt) - relocs = true; + if (s->_raw_size != 0) + relocs = TRUE; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -1558,7 +2135,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) of garbage. */ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL) - return false; + return FALSE; } if (htab->elf.dynamic_sections_created) @@ -1569,12 +2146,12 @@ elf_s390_size_dynamic_sections (output_bfd, info) the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ #define add_dynamic_entry(TAG, VAL) \ - bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + _bfd_elf_add_dynamic_entry (info, TAG, VAL) - if (! info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) - return false; + return FALSE; } if (htab->splt->_raw_size != 0) @@ -1583,15 +2160,15 @@ elf_s390_size_dynamic_sections (output_bfd, info) || !add_dynamic_entry (DT_PLTRELSZ, 0) || !add_dynamic_entry (DT_PLTREL, DT_RELA) || !add_dynamic_entry (DT_JMPREL, 0)) - return false; + return FALSE; } if (relocs) - { - if (!add_dynamic_entry (DT_RELA, 0) - || !add_dynamic_entry (DT_RELASZ, 0) - || !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela))) - return false; + { + if (!add_dynamic_entry (DT_RELA, 0) + || !add_dynamic_entry (DT_RELASZ, 0) + || !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela))) + return FALSE; /* If any dynamic relocs apply to a read-only section, then we need a DT_TEXTREL entry. */ @@ -1602,18 +2179,68 @@ elf_s390_size_dynamic_sections (output_bfd, info) if ((info->flags & DF_TEXTREL) != 0) { if (!add_dynamic_entry (DT_TEXTREL, 0)) - return false; + return FALSE; } } } #undef add_dynamic_entry - return true; + return TRUE; +} + +/* Return the base VMA address which should be subtracted from real addresses + when resolving @dtpoff relocation. + This is PT_TLS segment p_vaddr. */ + +static bfd_vma +dtpoff_base (info) + struct bfd_link_info *info; +{ + /* If tls_sec is NULL, we should have signalled an error already. */ + if (elf_hash_table (info)->tls_sec == NULL) + return 0; + return elf_hash_table (info)->tls_sec->vma; +} + +/* Return the relocation value for @tpoff relocation + if STT_TLS virtual address is ADDRESS. */ + +static bfd_vma +tpoff (info, address) + struct bfd_link_info *info; + bfd_vma address; +{ + struct elf_link_hash_table *htab = elf_hash_table (info); + + /* If tls_sec is NULL, we should have signalled an error already. */ + if (htab->tls_sec == NULL) + return 0; + return htab->tls_size + htab->tls_sec->vma - address; +} + +/* Complain if TLS instruction relocation is against an invalid + instruction. */ + +static void +invalid_tls_insn (input_bfd, input_section, rel) + bfd *input_bfd; + asection *input_section; + Elf_Internal_Rela *rel; +{ + reloc_howto_type *howto; + + howto = elf_howto_table + ELF32_R_TYPE (rel->r_info); + (*_bfd_error_handler) + (_("%s(%s+0x%lx): invalid instruction for TLS relocation %s"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, + howto->name); } /* Relocate a 390 ELF section. */ -static boolean +static bfd_boolean elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, local_syms, local_sections) bfd *output_bfd; @@ -1632,8 +2259,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; htab = elf_s390_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -1644,7 +2271,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, relend = relocs + input_section->reloc_count; for (; rel < relend; rel++) { - int r_type; + unsigned int r_type; reloc_howto_type *howto; unsigned long r_symndx; struct elf_link_hash_entry *h; @@ -1652,250 +2279,279 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, asection *sec; bfd_vma off; bfd_vma relocation; - boolean unresolved_reloc; + bfd_boolean unresolved_reloc; bfd_reloc_status_type r; + int tls_type; r_type = ELF32_R_TYPE (rel->r_info); if (r_type == (int) R_390_GNU_VTINHERIT - || r_type == (int) R_390_GNU_VTENTRY) - continue; - if (r_type < 0 || r_type >= (int) R_390_max) + || r_type == (int) R_390_GNU_VTENTRY) + continue; + if (r_type >= (int) R_390_max) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } howto = elf_howto_table + r_type; r_symndx = ELF32_R_SYM (rel->r_info); + + /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; - unresolved_reloc = false; + unresolved_reloc = FALSE; if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; sec = local_sections[r_symndx]; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); } 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; + bfd_boolean warned ATTRIBUTE_UNUSED; - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - sec = h->root.u.def.section; - if (sec->output_section == NULL) - { - /* Set a flag that will be cleared later if we find a - relocation value for this symbol. output_section - is typically NULL for symbols satisfied by a shared - library. */ - unresolved_reloc = true; - 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->allow_shlib_undefined) - && !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, rel->r_offset, - (!info->shared || info->no_undefined - || ELF_ST_VISIBILITY (h->other))))) - return false; - relocation = 0; - } + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); } switch (r_type) { - case R_390_GOT12: - case R_390_GOT16: - case R_390_GOT32: + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT20: + case R_390_GOTPLT32: + case R_390_GOTPLTENT: + /* There are three cases for a GOTPLT relocation. 1) The + relocation is against the jump slot entry of a plt that + will get emitted to the output file. 2) The relocation + is against the jump slot of a plt entry that has been + removed. elf_s390_adjust_gotplt has created a GOT entry + as replacement. 3) The relocation is against a local symbol. + Cases 2) and 3) are the same as the GOT relocation code + so we just have to test for case 1 and fall through for + the other two. */ + if (h != NULL && h->plt.offset != (bfd_vma) -1) + { + bfd_vma plt_index; + + /* Calc. index no. + Current offset - size first entry / entry size. */ + plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / + PLT_ENTRY_SIZE; + + /* Offset in GOT is PLT index plus GOT headers(3) times 4, + addr & GOT addr. */ + relocation = (plt_index + 3) * GOT_ENTRY_SIZE; + unresolved_reloc = FALSE; + + if (r_type == R_390_GOTPLTENT) + relocation += htab->sgot->output_section->vma; + break; + } + /* Fall through. */ + + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT20: + case R_390_GOT32: case R_390_GOTENT: - /* Relocation is to the entry for this symbol in the global - offset table. */ + /* Relocation is to the entry for this symbol in the global + offset table. */ if (htab->sgot == NULL) abort (); - if (h != NULL) - { - boolean dyn; + if (h != NULL) + { + bfd_boolean dyn; - off = h->got.offset; + off = h->got.offset; dyn = htab->elf.dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) - || (info->shared - && (info->symbolic + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) + || (info->shared + && (info->symbolic || h->dynindx == -1 || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) - { - /* This is actually a static link, or it is a - -Bsymbolic link and the symbol is defined - locally, or the symbol was forced to be local - because of a version file. We must initialize - this entry in the global offset table. Since the - offset must always be a multiple of 2, we use the - least significant bit to record whether we have - initialized it already. - - When doing a dynamic link, we create a .rel.got - relocation entry to initialize the value. This - is done in the finish_dynamic_symbol routine. */ - if ((off & 1) != 0) - off &= ~1; - else - { + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) + || (ELF_ST_VISIBILITY (h->other) + && h->root.type == bfd_link_hash_undefweak)) + { + /* 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 2, we use the + least significant bit to record whether we have + initialized it already. + + When doing a dynamic link, we create a .rel.got + relocation entry to initialize the value. This + is done in the finish_dynamic_symbol routine. */ + if ((off & 1) != 0) + off &= ~1; + else + { bfd_put_32 (output_bfd, relocation, htab->sgot->contents + off); - h->got.offset |= 1; - } - } + h->got.offset |= 1; + } + } else - unresolved_reloc = false; - } - else - { + unresolved_reloc = FALSE; + } + else + { if (local_got_offsets == NULL) abort (); - off = local_got_offsets[r_symndx]; + 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, + /* 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, htab->sgot->contents + off); - if (info->shared) - { - asection *srelgot; - Elf_Internal_Rela outrel; - Elf32_External_Rela *loc; + if (info->shared) + { + asection *srelgot; + Elf_Internal_Rela outrel; + bfd_byte *loc; - srelgot = htab->srelgot; + srelgot = htab->srelgot; if (srelgot == NULL) abort (); - outrel.r_offset = (htab->sgot->output_section->vma - + htab->sgot->output_offset - + off); - outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE); + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + + off); + outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE); outrel.r_addend = relocation; - loc = (Elf32_External_Rela *) srelgot->contents; - loc += srelgot->reloc_count++; - bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); - } + loc = srelgot->contents; + loc += srelgot->reloc_count++ * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + } - local_got_offsets[r_symndx] |= 1; - } - } + local_got_offsets[r_symndx] |= 1; + } + } if (off >= (bfd_vma) -2) abort (); relocation = htab->sgot->output_offset + off; - /* - * For @GOTENT the relocation is against the offset between - * the instruction and the symbols entry in the GOT and not - * between the start of the GOT and the symbols entry. We - * add the vma of the GOT to get the correct value. - */ - if (r_type == R_390_GOTENT) + /* For @GOTENT the relocation is against the offset between + the instruction and the symbols entry in the GOT and not + between the start of the GOT and the symbols entry. We + add the vma of the GOT to get the correct value. */ + if ( r_type == R_390_GOTENT + || r_type == R_390_GOTPLTENT) relocation += htab->sgot->output_section->vma; - break; - - case R_390_GOTOFF: - /* Relocation is relative to the start of the global offset - table. */ + break; - /* Note that sgot->output_offset is not involved in this - calculation. We always want the start of .got. If we - defined _GLOBAL_OFFSET_TABLE in a different way, as is - permitted by the ABI, we might have to change this - calculation. */ - relocation -= htab->sgot->output_section->vma; - break; + case R_390_GOTOFF16: + case R_390_GOTOFF32: + /* Relocation is relative to the start of the global offset + table. */ + + /* Note that sgot->output_offset is not involved in this + calculation. We always want the start of .got. If we + defined _GLOBAL_OFFSET_TABLE in a different way, as is + permitted by the ABI, we might have to change this + calculation. */ + relocation -= htab->sgot->output_section->vma; + break; - case R_390_GOTPC: + case R_390_GOTPC: case R_390_GOTPCDBL: - /* Use global offset table as symbol value. */ - relocation = htab->sgot->output_section->vma; - unresolved_reloc = false; - break; - - case R_390_PLT16DBL: - case R_390_PLT32DBL: - case R_390_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 + /* Use global offset table as symbol value. */ + relocation = htab->sgot->output_section->vma; + unresolved_reloc = FALSE; + break; + + case R_390_PLT16DBL: + case R_390_PLT32DBL: + case R_390_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 || htab->splt == NULL) - { - /* We didn't make a PLT entry for this symbol. This - happens when statically linking PIC code, or when - using -Bsymbolic. */ - break; - } - - relocation = (htab->splt->output_section->vma - + htab->splt->output_offset - + h->plt.offset); - unresolved_reloc = false; - break; - - case R_390_8: - case R_390_16: - case R_390_32: - case R_390_PC16: - case R_390_PC16DBL: - case R_390_PC32DBL: - case R_390_PC32: + { + /* We didn't make a PLT entry for this symbol. This + happens when statically linking PIC code, or when + using -Bsymbolic. */ + break; + } + + relocation = (htab->splt->output_section->vma + + htab->splt->output_offset + + h->plt.offset); + unresolved_reloc = FALSE; + break; + + case R_390_PLTOFF16: + case R_390_PLTOFF32: + /* Relocation is to the entry for this symbol in the + procedure linkage table relative to the start of the GOT. */ + + /* For local symbols or if we didn't make a PLT entry for + this symbol resolve the symbol directly. */ + if ( h == NULL + || h->plt.offset == (bfd_vma) -1 + || htab->splt == NULL) + { + relocation -= htab->sgot->output_section->vma; + break; + } + + relocation = (htab->splt->output_section->vma + + htab->splt->output_offset + + h->plt.offset + - htab->sgot->output_section->vma); + unresolved_reloc = FALSE; + break; + + case R_390_8: + case R_390_16: + case R_390_32: + case R_390_PC16: + case R_390_PC16DBL: + case R_390_PC32DBL: + case R_390_PC32: /* r_symndx will be zero only for relocs against symbols from removed linkonce sections, or sections discarded by a linker script. */ - if (r_symndx == 0 - || (input_section->flags & SEC_ALLOC) == 0) + if (r_symndx == 0 + || (input_section->flags & SEC_ALLOC) == 0) break; - if ((info->shared + if ((info->shared + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) && ((r_type != R_390_PC16 && r_type != R_390_PC16DBL && r_type != R_390_PC32DBL && r_type != R_390_PC32) || (h != NULL - && h->dynindx != -1 - && (! info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared + && !SYMBOL_REFERENCES_LOCAL (info, h)))) + || (ELIMINATE_COPY_RELOCS + && !info->shared && h != NULL && h->dynindx != -1 && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 @@ -1905,32 +2561,32 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, & ELF_LINK_HASH_DEF_REGULAR) == 0) || h->root.type == bfd_link_hash_undefweak || h->root.type == bfd_link_hash_undefined))) - { - Elf_Internal_Rela outrel; - boolean skip, relocate; + { + Elf_Internal_Rela outrel; + bfd_boolean skip, relocate; asection *sreloc; - Elf32_External_Rela *loc; + bfd_byte *loc; /* When generating a shared object, these relocations are copied into the output file to be resolved at run time. */ - skip = false; - relocate = false; + skip = FALSE; + relocate = FALSE; outrel.r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, rel->r_offset); if (outrel.r_offset == (bfd_vma) -1) - skip = true; + skip = TRUE; else if (outrel.r_offset == (bfd_vma) -2) - skip = true, relocate = true; - outrel.r_offset += (input_section->output_section->vma - + input_section->output_offset); + skip = TRUE, relocate = TRUE; + outrel.r_offset += (input_section->output_section->vma + + input_section->output_offset); - if (skip) + if (skip) memset (&outrel, 0, sizeof outrel); - else if (h != NULL + else if (h != NULL && h->dynindx != -1 && (r_type == R_390_PC16 || r_type == R_390_PC16DBL @@ -1940,35 +2596,392 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, || !info->symbolic || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) - { - outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); + { + outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); outrel.r_addend = rel->r_addend; - } - else - { + } + else + { /* This symbol is local, or marked to become local. */ - relocate = true; - outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE); outrel.r_addend = relocation + rel->r_addend; - } + if (r_type == R_390_32) + { + relocate = TRUE; + outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE); + } + else + { + long sindx; + + if (bfd_is_abs_section (sec)) + sindx = 0; + else if (sec == NULL || sec->owner == NULL) + { + bfd_set_error(bfd_error_bad_value); + return FALSE; + } + else + { + asection *osec; + + osec = sec->output_section; + sindx = elf_section_data (osec)->dynindx; + BFD_ASSERT (sindx > 0); + + /* We are turning this relocation into one + against a section symbol, so subtract out + the output section's address but not the + offset of the input section in the output + section. */ + + outrel.r_addend -= osec->vma; + } + outrel.r_info = ELF32_R_INFO (sindx, r_type); + } + } sreloc = elf_section_data (input_section)->sreloc; if (sreloc == NULL) abort (); - loc = (Elf32_External_Rela *) sreloc->contents; - loc += sreloc->reloc_count++; + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela); bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); - /* 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; - } + /* 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; + /* Relocations for tls literal pool entries. */ + case R_390_TLS_IE32: + if (info->shared) + { + Elf_Internal_Rela outrel; + asection *sreloc; + bfd_byte *loc; + + outrel.r_offset = rel->r_offset + + input_section->output_section->vma + + input_section->output_offset; + outrel.r_info = ELF32_R_INFO (0, R_390_RELATIVE); + sreloc = elf_section_data (input_section)->sreloc; + if (sreloc == NULL) + abort (); + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloc_out (output_bfd, &outrel, loc); + } + /* Fall through. */ + + case R_390_TLS_GD32: + case R_390_TLS_GOTIE32: + r_type = elf_s390_tls_transition (info, r_type, h == NULL); + tls_type = GOT_UNKNOWN; + if (h == NULL && local_got_offsets) + tls_type = elf_s390_local_got_tls_type (input_bfd) [r_symndx]; + else if (h != NULL) + { + tls_type = elf_s390_hash_entry(h)->tls_type; + if (!info->shared && h->dynindx == -1 && tls_type >= GOT_TLS_IE) + r_type = R_390_TLS_LE32; + } + if (r_type == R_390_TLS_GD32 && tls_type >= GOT_TLS_IE) + r_type = R_390_TLS_IE32; + + if (r_type == R_390_TLS_LE32) + { + /* This relocation gets optimized away by the local exec + access optimization. */ + BFD_ASSERT (! unresolved_reloc); + bfd_put_32 (output_bfd, -tpoff (info, relocation), + contents + rel->r_offset); + continue; + } + + if (htab->sgot == NULL) + abort (); + + if (h != NULL) + off = h->got.offset; + else + { + if (local_got_offsets == NULL) + abort (); + + off = local_got_offsets[r_symndx]; + } + + emit_tls_relocs: + + if ((off & 1) != 0) + off &= ~1; + else + { + Elf_Internal_Rela outrel; + bfd_byte *loc; + int dr_type, indx; + + if (htab->srelgot == NULL) + abort (); + + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off); + + indx = h && h->dynindx != -1 ? h->dynindx : 0; + if (r_type == R_390_TLS_GD32) + dr_type = R_390_TLS_DTPMOD; + else + dr_type = R_390_TLS_TPOFF; + if (dr_type == R_390_TLS_TPOFF && indx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + else + outrel.r_addend = 0; + outrel.r_info = ELF32_R_INFO (indx, dr_type); + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ + * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + + if (r_type == R_390_TLS_GD32) + { + if (indx == 0) + { + BFD_ASSERT (! unresolved_reloc); + bfd_put_32 (output_bfd, + relocation - dtpoff_base (info), + htab->sgot->contents + off + GOT_ENTRY_SIZE); + } + else + { + outrel.r_info = ELF32_R_INFO (indx, R_390_TLS_DTPOFF); + outrel.r_offset += GOT_ENTRY_SIZE; + outrel.r_addend = 0; + htab->srelgot->reloc_count++; + loc += sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + } + } + + if (h != NULL) + h->got.offset |= 1; + else + local_got_offsets[r_symndx] |= 1; + } + + if (off >= (bfd_vma) -2) + abort (); + if (r_type == ELF32_R_TYPE (rel->r_info)) + { + relocation = htab->sgot->output_offset + off; + if (r_type == R_390_TLS_IE32 || r_type == R_390_TLS_IEENT) + relocation += htab->sgot->output_section->vma; + unresolved_reloc = FALSE; + } + else + { + bfd_put_32 (output_bfd, htab->sgot->output_offset + off, + contents + rel->r_offset); + continue; + } + break; + + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE20: + case R_390_TLS_IEENT: + if (h == NULL) + { + if (local_got_offsets == NULL) + abort(); + off = local_got_offsets[r_symndx]; + if (info->shared) + goto emit_tls_relocs; + } + else + { + off = h->got.offset; + tls_type = elf_s390_hash_entry(h)->tls_type; + if (info->shared || h->dynindx != -1 || tls_type < GOT_TLS_IE) + goto emit_tls_relocs; + } + + if (htab->sgot == NULL) + abort (); + + BFD_ASSERT (! unresolved_reloc); + bfd_put_32 (output_bfd, -tpoff (info, relocation), + htab->sgot->contents + off); + relocation = htab->sgot->output_offset + off; + if (r_type == R_390_TLS_IEENT) + relocation += htab->sgot->output_section->vma; + unresolved_reloc = FALSE; + break; + + case R_390_TLS_LDM32: + if (! info->shared) + /* The literal pool entry this relocation refers to gets ignored + by the optimized code of the local exec model. Do nothing + and the value will turn out zero. */ + continue; + + if (htab->sgot == NULL) + abort (); + + off = htab->tls_ldm_got.offset; + if (off & 1) + off &= ~1; + else + { + Elf_Internal_Rela outrel; + bfd_byte *loc; + + if (htab->srelgot == NULL) + abort (); + + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off); + + bfd_put_32 (output_bfd, 0, + htab->sgot->contents + off + GOT_ENTRY_SIZE); + outrel.r_info = ELF32_R_INFO (0, R_390_TLS_DTPMOD); + outrel.r_addend = 0; + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ + * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + htab->tls_ldm_got.offset |= 1; + } + relocation = htab->sgot->output_offset + off; + unresolved_reloc = FALSE; + break; + + case R_390_TLS_LE32: + if (info->shared) + { + /* Linking a shared library with non-fpic code requires + a R_390_TLS_TPOFF relocation. */ + Elf_Internal_Rela outrel; + asection *sreloc; + bfd_byte *loc; + int indx; + + outrel.r_offset = rel->r_offset + + input_section->output_section->vma + + input_section->output_offset; + if (h != NULL && h->dynindx != -1) + indx = h->dynindx; + else + indx = 0; + outrel.r_info = ELF32_R_INFO (indx, R_390_TLS_TPOFF); + if (indx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + else + outrel.r_addend = 0; + sreloc = elf_section_data (input_section)->sreloc; + if (sreloc == NULL) + abort (); + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); + } + else + { + BFD_ASSERT (! unresolved_reloc); + bfd_put_32 (output_bfd, -tpoff (info, relocation), + contents + rel->r_offset); + } + continue; + + case R_390_TLS_LDO32: + if (info->shared || (input_section->flags & SEC_CODE) == 0) + relocation -= dtpoff_base (info); + else + /* When converting LDO to LE, we must negate. */ + relocation = -tpoff (info, relocation); + break; + + /* Relocations for tls instructions. */ + case R_390_TLS_LOAD: + case R_390_TLS_GDCALL: + case R_390_TLS_LDCALL: + tls_type = GOT_UNKNOWN; + if (h == NULL && local_got_offsets) + tls_type = elf_s390_local_got_tls_type (input_bfd) [r_symndx]; + else if (h != NULL) + tls_type = elf_s390_hash_entry(h)->tls_type; + + if (tls_type == GOT_TLS_GD) + continue; + + if (r_type == R_390_TLS_LOAD) + { + if (!info->shared && (h == NULL || h->dynindx == -1)) + { + /* IE->LE transition. Four valid cases: + l %rx,0(0,%ry) -> lr %rx,%ry + bcr 0,0 + l %rx,0(%ry,0) -> lr %rx,%ry + bcr 0,0 + l %rx,0(%ry,%r12) -> lr %rx,%ry + bcr 0,0 + l %rx,0(%r12,%ry) -> lr %rx,%ry + bcr 0,0 */ + unsigned int insn, ry; + + insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + ry = 0; + if ((insn & 0xff00f000) == 0x58000000) + /* l %rx,0(%ry,0) -> lr %rx,%ry + bcr 0,0 */ + ry = (insn & 0x000f0000); + else if ((insn & 0xff0f0000) == 0x58000000) + /* l %rx,0(0,%ry) -> lr %rx,%ry + bcr 0,0 */ + ry = (insn & 0x0000f000) << 4; + else if ((insn & 0xff00f000) == 0x5800c000) + /* l %rx,0(%ry,%r12) -> lr %rx,%ry + bcr 0,0 */ + ry = (insn & 0x000f0000); + else if ((insn & 0xff0f0000) == 0x580c0000) + /* l %rx,0(%r12,%ry) -> lr %rx,%ry + bcr 0,0 */ + ry = (insn & 0x0000f000) << 4; + else + invalid_tls_insn (input_bfd, input_section, rel); + insn = 0x18000700 | (insn & 0x00f00000) | ry; + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); + } + } + else if (r_type == R_390_TLS_GDCALL) + { + unsigned int insn; + + insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + if ((insn & 0xff000fff) != 0x4d000000) + invalid_tls_insn (input_bfd, input_section, rel); + if (!info->shared && (h == NULL || h->dynindx == -1)) + /* GD->LE transition. + bas %r14,0(%rx,%r13) -> bc 0,0 */ + insn = 0x47000000; + else + /* GD->IE transition. + bas %r14,0(%rx,%r13) -> l %r2,0(%r2,%r12) */ + insn = 0x5822c000; + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); + } + else if (r_type == R_390_TLS_LDCALL) + { + if (!info->shared) + { + unsigned int insn; + + insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + if ((insn & 0xff000fff) != 0x4d000000) + invalid_tls_insn (input_bfd, input_section, rel); + /* LD->LE transition. + bas %r14,0(%rx,%r13) -> bc 0,0 */ + insn = 0x47000000; + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); + } + } + continue; + default: break; } @@ -1986,9 +2999,21 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, (long) rel->r_offset, h->root.root.string); - r = _bfd_final_link_relocate (howto, input_bfd, input_section, - contents, rel->r_offset, - relocation, rel->r_addend); + if (r_type == R_390_20 + || r_type == R_390_GOT20 + || r_type == R_390_GOTPLT20 + || r_type == R_390_TLS_GOTIE20) + { + relocation += rel->r_addend; + relocation = (relocation&0xfff) << 8 | (relocation&0xff000) >> 12; + r = _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, + relocation, 0); + } + else + r = _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, + relocation, rel->r_addend); if (r != bfd_reloc_ok) { @@ -2002,7 +3027,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, symtab_hdr->sh_link, sym->st_name); if (name == NULL) - return false; + return FALSE; if (*name == '\0') name = bfd_section_name (input_bfd, sec); } @@ -2013,7 +3038,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, if (! ((*info->callbacks->reloc_overflow) (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset))) - return false; + return FALSE; } else { @@ -2022,18 +3047,18 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, bfd_archive_filename (input_bfd), bfd_get_section_name (input_bfd, input_section), (long) rel->r_offset, name, (int) r); - return false; + return FALSE; } } } - return true; + return TRUE; } /* Finish up dynamic symbol handling. We set the contents of various dynamic sections here. */ -static boolean +static bfd_boolean elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) bfd *output_bfd; struct bfd_link_info *info; @@ -2049,12 +3074,11 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) bfd_vma plt_index; bfd_vma got_offset; Elf_Internal_Rela rela; - Elf32_External_Rela *loc; + bfd_byte *loc; bfd_vma relative_offset; /* This symbol has an entry in the procedure linkage table. Set - it up. */ - + it up. */ if (h->dynindx == -1 || htab->splt == NULL || htab->sgotplt == NULL @@ -2062,26 +3086,26 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) abort (); /* Calc. index no. - Current offset - size first entry / entry size. */ + Current offset - size first entry / entry size. */ plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE; /* Offset in GOT is PLT index plus GOT headers(3) times 4, - addr & GOT addr. */ + addr & GOT addr. */ got_offset = (plt_index + 3) * GOT_ENTRY_SIZE; /* S390 uses halfwords for relative branch calc! */ relative_offset = - ((PLT_FIRST_ENTRY_SIZE + - (PLT_ENTRY_SIZE * plt_index) + 18) / 2); + (PLT_ENTRY_SIZE * plt_index) + 18) / 2); /* If offset is > 32768, branch to a previous branch - 390 can only handle +-64 K jumps. */ + 390 can only handle +-64 K jumps. */ if ( -32768 > (int) relative_offset ) - relative_offset = - -(unsigned) (((65536 / PLT_ENTRY_SIZE - 1) * PLT_ENTRY_SIZE) / 2); + relative_offset + = -(unsigned) (((65536 / PLT_ENTRY_SIZE - 1) * PLT_ENTRY_SIZE) / 2); /* Fill in the entry in the procedure linkage table. */ if (!info->shared) { - bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD0, + bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD0, htab->splt->contents + h->plt.offset); bfd_put_32 (output_bfd, (bfd_vma) PLT_ENTRY_WORD1, htab->splt->contents + h->plt.offset + 4); @@ -2152,10 +3176,10 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) } /* Insert offset into reloc. table here. */ bfd_put_32 (output_bfd, plt_index * sizeof (Elf32_External_Rela), - htab->splt->contents + h->plt.offset + 28); + htab->splt->contents + h->plt.offset + 28); /* Fill in the entry in the global offset table. - Points to instruction after GOT offset. */ + Points to instruction after GOT offset. */ bfd_put_32 (output_bfd, (htab->splt->output_section->vma + htab->splt->output_offset @@ -2169,7 +3193,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) + got_offset); rela.r_info = ELF32_R_INFO (h->dynindx, R_390_JMP_SLOT); rela.r_addend = 0; - loc = (Elf32_External_Rela *) htab->srelplt->contents + plt_index; + loc = htab->srelplt->contents + plt_index * sizeof (Elf32_External_Rela); bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) @@ -2183,13 +3207,16 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) } } - if (h->got.offset != (bfd_vma) -1) + if (h->got.offset != (bfd_vma) -1 + && elf_s390_hash_entry(h)->tls_type != GOT_TLS_GD + && elf_s390_hash_entry(h)->tls_type != GOT_TLS_IE + && elf_s390_hash_entry(h)->tls_type != GOT_TLS_IE_NLT) { Elf_Internal_Rela rela; - Elf32_External_Rela *loc; + bfd_byte *loc; /* This symbol has an entry in the global offset table. Set it - up. */ + up. */ if (htab->sgot == NULL || htab->srelgot == NULL) abort (); @@ -2212,26 +3239,26 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) BFD_ASSERT((h->got.offset & 1) != 0); rela.r_info = ELF32_R_INFO (0, R_390_RELATIVE); rela.r_addend = (h->root.u.def.value - + h->root.u.def.section->output_section->vma - + h->root.u.def.section->output_offset); - } + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + } else { BFD_ASSERT((h->got.offset & 1) == 0); bfd_put_32 (output_bfd, (bfd_vma) 0, htab->sgot->contents + h->got.offset); rela.r_info = ELF32_R_INFO (h->dynindx, R_390_GLOB_DAT); - rela.r_addend = 0; - } + rela.r_addend = 0; + } - loc = (Elf32_External_Rela *) htab->srelgot->contents; - loc += htab->srelgot->reloc_count++; + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ * sizeof (Elf32_External_Rela); bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); } if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) { Elf_Internal_Rela rela; - Elf32_External_Rela *loc; + bfd_byte *loc; /* This symbols needs a copy reloc. Set it up. */ @@ -2246,8 +3273,8 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) + h->root.u.def.section->output_offset); rela.r_info = ELF32_R_INFO (h->dynindx, R_390_COPY); rela.r_addend = 0; - loc = (Elf32_External_Rela *) htab->srelbss->contents; - loc += htab->srelbss->reloc_count++; + loc = htab->srelbss->contents; + loc += htab->srelbss->reloc_count++ * sizeof (Elf32_External_Rela); bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); } @@ -2257,7 +3284,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0) sym->st_shndx = SHN_ABS; - return true; + return TRUE; } /* Used to decide how to sort relocs in an optimal manner for the @@ -2282,7 +3309,7 @@ elf_s390_reloc_type_class (rela) /* Finish up the dynamic sections. */ -static boolean +static bfd_boolean elf_s390_finish_dynamic_sections (output_bfd, info) bfd *output_bfd; struct bfd_link_info *info; @@ -2339,39 +3366,39 @@ elf_s390_finish_dynamic_sections (output_bfd, info) /* Fill in the special first entry in the procedure linkage table. */ if (htab->splt && htab->splt->_raw_size > 0) { - memset (htab->splt->contents, 0, PLT_FIRST_ENTRY_SIZE); - if (info->shared) + memset (htab->splt->contents, 0, PLT_FIRST_ENTRY_SIZE); + if (info->shared) { bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD0, - htab->splt->contents ); + htab->splt->contents ); bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD1, - htab->splt->contents +4 ); + htab->splt->contents +4 ); bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD2, - htab->splt->contents +8 ); + htab->splt->contents +8 ); bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD3, - htab->splt->contents +12 ); + htab->splt->contents +12 ); bfd_put_32 (output_bfd, (bfd_vma) PLT_PIC_FIRST_ENTRY_WORD4, - htab->splt->contents +16 ); - } - else - { - bfd_put_32 (output_bfd, (bfd_vma)PLT_FIRST_ENTRY_WORD0, - htab->splt->contents ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD1, - htab->splt->contents +4 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD2, - htab->splt->contents +8 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD3, - htab->splt->contents +12 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD4, - htab->splt->contents +16 ); - bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD5, - htab->splt->contents +20 ); - bfd_put_32 (output_bfd, - htab->sgotplt->output_section->vma + htab->splt->contents +16 ); + } + else + { + bfd_put_32 (output_bfd, (bfd_vma)PLT_FIRST_ENTRY_WORD0, + htab->splt->contents ); + bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD1, + htab->splt->contents +4 ); + bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD2, + htab->splt->contents +8 ); + bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD3, + htab->splt->contents +12 ); + bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD4, + htab->splt->contents +16 ); + bfd_put_32 (output_bfd, (bfd_vma) PLT_FIRST_ENTRY_WORD5, + htab->splt->contents +20 ); + bfd_put_32 (output_bfd, + htab->sgotplt->output_section->vma + htab->sgotplt->output_offset, - htab->splt->contents + 24); - } + htab->splt->contents + 24); + } elf_section_data (htab->splt->output_section) ->this_hdr.sh_entsize = 4; } @@ -2396,17 +3423,10 @@ elf_s390_finish_dynamic_sections (output_bfd, info) elf_section_data (htab->sgotplt->output_section) ->this_hdr.sh_entsize = 4; } - return true; -} - -static boolean -elf_s390_object_p (abfd) - bfd *abfd; -{ - return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_31); + return TRUE; } -static boolean +static bfd_boolean elf_s390_grok_prstatus (abfd, note) bfd * abfd; Elf_Internal_Note * note; @@ -2417,7 +3437,7 @@ elf_s390_grok_prstatus (abfd, note) switch (note->descsz) { default: - return false; + return FALSE; case 224: /* S/390 Linux. */ /* pr_cursig */ @@ -2450,29 +3470,29 @@ elf_s390_grok_prstatus (abfd, note) #define elf_backend_plt_readonly 1 #define elf_backend_want_plt_sym 0 #define elf_backend_got_header_size 12 -#define elf_backend_plt_header_size PLT_ENTRY_SIZE #define elf_backend_rela_normal 1 -#define elf_info_to_howto elf_s390_info_to_howto +#define elf_info_to_howto elf_s390_info_to_howto #define bfd_elf32_bfd_is_local_label_name elf_s390_is_local_label_name #define bfd_elf32_bfd_link_hash_table_create elf_s390_link_hash_table_create #define bfd_elf32_bfd_reloc_type_lookup elf_s390_reloc_type_lookup #define elf_backend_adjust_dynamic_symbol elf_s390_adjust_dynamic_symbol -#define elf_backend_check_relocs elf_s390_check_relocs +#define elf_backend_check_relocs elf_s390_check_relocs #define elf_backend_copy_indirect_symbol elf_s390_copy_indirect_symbol #define elf_backend_create_dynamic_sections elf_s390_create_dynamic_sections #define elf_backend_finish_dynamic_sections elf_s390_finish_dynamic_sections #define elf_backend_finish_dynamic_symbol elf_s390_finish_dynamic_symbol -#define elf_backend_gc_mark_hook elf_s390_gc_mark_hook -#define elf_backend_gc_sweep_hook elf_s390_gc_sweep_hook +#define elf_backend_gc_mark_hook elf_s390_gc_mark_hook +#define elf_backend_gc_sweep_hook elf_s390_gc_sweep_hook #define elf_backend_reloc_type_class elf_s390_reloc_type_class -#define elf_backend_relocate_section elf_s390_relocate_section +#define elf_backend_relocate_section elf_s390_relocate_section #define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections #define elf_backend_reloc_type_class elf_s390_reloc_type_class #define elf_backend_grok_prstatus elf_s390_grok_prstatus -#define elf_backend_object_p elf_s390_object_p +#define bfd_elf32_mkobject elf_s390_mkobject +#define elf_backend_object_p elf_s390_object_p #include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf32-sparc.c b/contrib/binutils/bfd/elf32-sparc.c index b6cf7eb..0f94f5f 100644 --- a/contrib/binutils/bfd/elf32-sparc.c +++ b/contrib/binutils/bfd/elf32-sparc.c @@ -1,22 +1,22 @@ /* SPARC-specific support for 32-bit ELF - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, + 2003, 2004 Free Software Foundation, Inc. -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" @@ -30,34 +30,61 @@ static reloc_howto_type *elf32_sparc_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static void elf32_sparc_info_to_howto PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); -static boolean elf32_sparc_check_relocs +static bfd_boolean elf32_sparc_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); -static boolean elf32_sparc_adjust_dynamic_symbol +static bfd_boolean elf32_sparc_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); -static boolean elf32_sparc_size_dynamic_sections +static bfd_boolean allocate_dynrelocs + PARAMS ((struct elf_link_hash_entry *, PTR)); +static bfd_boolean readonly_dynrelocs + PARAMS ((struct elf_link_hash_entry *, PTR)); +static bfd_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 +static bfd_boolean elf32_sparc_new_section_hook + PARAMS ((bfd *, asection *)); +static bfd_boolean elf32_sparc_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *)); +static bfd_vma dtpoff_base + PARAMS ((struct bfd_link_info *)); +static bfd_vma tpoff + PARAMS ((struct bfd_link_info *, bfd_vma)); +static bfd_boolean elf32_sparc_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static boolean elf32_sparc_finish_dynamic_symbol +static bfd_boolean elf32_sparc_finish_dynamic_symbol PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static boolean elf32_sparc_finish_dynamic_sections +static bfd_boolean elf32_sparc_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static boolean elf32_sparc_merge_private_bfd_data PARAMS ((bfd *, bfd *)); -static boolean elf32_sparc_object_p +static bfd_boolean elf32_sparc_merge_private_bfd_data + PARAMS ((bfd *, bfd *)); +static struct bfd_hash_entry *link_hash_newfunc + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); +static struct bfd_link_hash_table *elf32_sparc_link_hash_table_create + PARAMS ((bfd *)); +static bfd_boolean create_got_section + PARAMS ((bfd *, struct bfd_link_info *)); +static bfd_boolean elf32_sparc_create_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static void elf32_sparc_copy_indirect_symbol + PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *, + struct elf_link_hash_entry *)); +static int elf32_sparc_tls_transition + PARAMS ((struct bfd_link_info *, bfd *, int, int)); + +static bfd_boolean elf32_sparc_mkobject + PARAMS ((bfd *)); +static bfd_boolean elf32_sparc_object_p PARAMS ((bfd *)); static void elf32_sparc_final_write_processing - PARAMS ((bfd *, boolean)); + PARAMS ((bfd *, bfd_boolean)); static enum elf_reloc_type_class elf32_sparc_reloc_type_class PARAMS ((const Elf_Internal_Rela *)); static asection * elf32_sparc_gc_mark_hook PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static boolean elf32_sparc_gc_sweep_hook +static bfd_boolean elf32_sparc_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); @@ -67,75 +94,104 @@ static bfd_reloc_status_type sparc_elf_notsupported_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type sparc_elf_wdisp16_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type sparc_elf_hix22_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_reloc_status_type sparc_elf_lox10_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); reloc_howto_type _bfd_sparc_elf_howto_table[] = { - HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), - HOWTO(R_SPARC_8, 0,0, 8,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_8", false,0,0x000000ff,true), - HOWTO(R_SPARC_16, 0,1,16,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_16", false,0,0x0000ffff,true), - HOWTO(R_SPARC_32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_32", false,0,0xffffffff,true), - HOWTO(R_SPARC_DISP8, 0,0, 8,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP8", false,0,0x000000ff,true), - HOWTO(R_SPARC_DISP16, 0,1,16,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP16", false,0,0x0000ffff,true), - HOWTO(R_SPARC_DISP32, 0,2,32,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP32", false,0,0xffffffff,true), - HOWTO(R_SPARC_WDISP30, 2,2,30,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP30", false,0,0x3fffffff,true), - HOWTO(R_SPARC_WDISP22, 2,2,22,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP22", false,0,0x003fffff,true), - HOWTO(R_SPARC_HI22, 10,2,22,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_HI22", false,0,0x003fffff,true), - HOWTO(R_SPARC_22, 0,2,22,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_22", false,0,0x003fffff,true), - HOWTO(R_SPARC_13, 0,2,13,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_13", false,0,0x00001fff,true), - HOWTO(R_SPARC_LO10, 0,2,10,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_LO10", false,0,0x000003ff,true), - HOWTO(R_SPARC_GOT10, 0,2,10,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GOT10", false,0,0x000003ff,true), - HOWTO(R_SPARC_GOT13, 0,2,13,false,0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_GOT13", false,0,0x00001fff,true), - HOWTO(R_SPARC_GOT22, 10,2,22,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GOT22", false,0,0x003fffff,true), - HOWTO(R_SPARC_PC10, 0,2,10,true, 0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_PC10", false,0,0x000003ff,true), - HOWTO(R_SPARC_PC22, 10,2,22,true, 0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PC22", false,0,0x003fffff,true), - HOWTO(R_SPARC_WPLT30, 2,2,30,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WPLT30", false,0,0x3fffffff,true), - HOWTO(R_SPARC_COPY, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_COPY", false,0,0x00000000,true), - HOWTO(R_SPARC_GLOB_DAT, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GLOB_DAT",false,0,0x00000000,true), - HOWTO(R_SPARC_JMP_SLOT, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_JMP_SLOT",false,0,0x00000000,true), - HOWTO(R_SPARC_RELATIVE, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_RELATIVE",false,0,0x00000000,true), - HOWTO(R_SPARC_UA32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA32", false,0,0xffffffff,true), - HOWTO(R_SPARC_PLT32, 0,0,00,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT32", false,0,0xffffffff,true), - HOWTO(R_SPARC_HIPLT22, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_HIPLT22", false,0,0x00000000,true), - HOWTO(R_SPARC_LOPLT10, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_LOPLT10", false,0,0x00000000,true), - HOWTO(R_SPARC_PCPLT32, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PCPLT32", false,0,0x00000000,true), - HOWTO(R_SPARC_PCPLT22, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PCPLT22", false,0,0x00000000,true), - HOWTO(R_SPARC_PCPLT10, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PCPLT10", false,0,0x00000000,true), - HOWTO(R_SPARC_10, 0,2,10,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_10", false,0,0x000003ff,true), - HOWTO(R_SPARC_11, 0,2,11,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_11", false,0,0x000007ff,true), + HOWTO(R_SPARC_NONE, 0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_8, 0,0, 8,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_8", FALSE,0,0x000000ff,TRUE), + HOWTO(R_SPARC_16, 0,1,16,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_16", FALSE,0,0x0000ffff,TRUE), + HOWTO(R_SPARC_32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_32", FALSE,0,0xffffffff,TRUE), + HOWTO(R_SPARC_DISP8, 0,0, 8,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP8", FALSE,0,0x000000ff,TRUE), + HOWTO(R_SPARC_DISP16, 0,1,16,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP16", FALSE,0,0x0000ffff,TRUE), + HOWTO(R_SPARC_DISP32, 0,2,32,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP32", FALSE,0,0xffffffff,TRUE), + HOWTO(R_SPARC_WDISP30, 2,2,30,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP30", FALSE,0,0x3fffffff,TRUE), + HOWTO(R_SPARC_WDISP22, 2,2,22,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_HI22, 10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_HI22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_22, 0,2,22,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_13, 0,2,13,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_13", FALSE,0,0x00001fff,TRUE), + HOWTO(R_SPARC_LO10, 0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_LO10", FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_GOT10, 0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GOT10", FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_GOT13, 0,2,13,FALSE,0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_GOT13", FALSE,0,0x00001fff,TRUE), + HOWTO(R_SPARC_GOT22, 10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GOT22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_PC10, 0,2,10,TRUE, 0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_PC10", FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_PC22, 10,2,22,TRUE, 0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PC22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_WPLT30, 2,2,30,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WPLT30", FALSE,0,0x3fffffff,TRUE), + HOWTO(R_SPARC_COPY, 0,0,00,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_COPY", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_GLOB_DAT, 0,0,00,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GLOB_DAT",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_JMP_SLOT, 0,0,00,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_JMP_SLOT",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_RELATIVE, 0,0,00,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_RELATIVE",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_UA32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA32", FALSE,0,0xffffffff,TRUE), + HOWTO(R_SPARC_PLT32, 0,0,00,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT32", FALSE,0,0xffffffff,TRUE), + HOWTO(R_SPARC_HIPLT22, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_HIPLT22", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_LOPLT10, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_LOPLT10", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_PCPLT32, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PCPLT32", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_PCPLT22, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PCPLT22", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_PCPLT10, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PCPLT10", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_10, 0,2,10,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_10", FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_11, 0,2,11,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_11", FALSE,0,0x000007ff,TRUE), /* These are for sparc64 in a 64 bit environment. Values need to be here because the table is indexed by reloc number. */ - HOWTO(R_SPARC_64, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_64", false,0,0x00000000,true), - HOWTO(R_SPARC_OLO10, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_OLO10", false,0,0x00000000,true), - HOWTO(R_SPARC_HH22, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_HH22", false,0,0x00000000,true), - HOWTO(R_SPARC_HM10, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_HM10", false,0,0x00000000,true), - HOWTO(R_SPARC_LM22, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_LM22", false,0,0x00000000,true), - HOWTO(R_SPARC_PC_HH22, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PC_HH22", false,0,0x00000000,true), - HOWTO(R_SPARC_PC_HM10, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PC_HM10", false,0,0x00000000,true), - HOWTO(R_SPARC_PC_LM22, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PC_LM22", false,0,0x00000000,true), + HOWTO(R_SPARC_64, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_64", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_OLO10, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_OLO10", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_HH22, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_HH22", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_HM10, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_HM10", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_LM22, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_LM22", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_PC_HH22, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PC_HH22", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_PC_HM10, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PC_HM10", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_PC_LM22, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_PC_LM22", FALSE,0,0x00000000,TRUE), /* End sparc64 in 64 bit environment values. The following are for sparc64 in a 32 bit environment. */ - HOWTO(R_SPARC_WDISP16, 2,2,16,true, 0,complain_overflow_signed, sparc_elf_wdisp16_reloc,"R_SPARC_WDISP16", false,0,0x00000000,true), - HOWTO(R_SPARC_WDISP19, 2,2,19,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP19", false,0,0x0007ffff,true), - HOWTO(R_SPARC_UNUSED_42, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_UNUSED_42",false,0,0x00000000,true), - HOWTO(R_SPARC_7, 0,2, 7,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_7", false,0,0x0000007f,true), - HOWTO(R_SPARC_5, 0,2, 5,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_5", false,0,0x0000001f,true), - HOWTO(R_SPARC_6, 0,2, 6,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_6", false,0,0x0000003f,true), - HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), - HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), - HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), - HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), - HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), - HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), - HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), - HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), - HOWTO(R_SPARC_UA64, 0,0, 0,false,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_UA64", false,0,0x00000000,true), - HOWTO(R_SPARC_UA16, 0,1,16,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA16", false,0,0x0000ffff,true), - HOWTO(R_SPARC_REV32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_REV32", false,0,0xffffffff,true), + HOWTO(R_SPARC_WDISP16, 2,2,16,TRUE, 0,complain_overflow_signed, sparc_elf_wdisp16_reloc,"R_SPARC_WDISP16", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_WDISP19, 2,2,19,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP19", FALSE,0,0x0007ffff,TRUE), + HOWTO(R_SPARC_UNUSED_42, 0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_UNUSED_42",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_7, 0,2, 7,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_7", FALSE,0,0x0000007f,TRUE), + HOWTO(R_SPARC_5, 0,2, 5,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_5", FALSE,0,0x0000001f,TRUE), + HOWTO(R_SPARC_6, 0,2, 6,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_6", FALSE,0,0x0000003f,TRUE), + HOWTO(R_SPARC_NONE, 0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_NONE, 0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_NONE, 0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_NONE, 0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_NONE, 0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_NONE, 0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_NONE, 0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_NONE, 0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_UA64, 0,0, 0,FALSE,0,complain_overflow_dont, sparc_elf_notsupported_reloc, "R_SPARC_UA64", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_UA16, 0,1,16,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA16", FALSE,0,0x0000ffff,TRUE), + HOWTO(R_SPARC_TLS_GD_HI22,10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_HI22",FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_TLS_GD_LO10,0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_LO10",FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_TLS_GD_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_GD_CALL,2,2,30,TRUE,0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_CALL",FALSE,0,0x3fffffff,TRUE), + HOWTO(R_SPARC_TLS_LDM_HI22,10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_HI22",FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_TLS_LDM_LO10,0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_LO10",FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_TLS_LDM_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_LDM_CALL,2,2,30,TRUE,0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_CALL",FALSE,0,0x3fffffff,TRUE), + HOWTO(R_SPARC_TLS_LDO_HIX22,0,2,0,FALSE,0,complain_overflow_bitfield,sparc_elf_hix22_reloc,"R_SPARC_TLS_LDO_HIX22",FALSE,0,0x003fffff, FALSE), + HOWTO(R_SPARC_TLS_LDO_LOX10,0,2,0,FALSE,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_TLS_LDO_LOX10",FALSE,0,0x000003ff, FALSE), + HOWTO(R_SPARC_TLS_LDO_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDO_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_IE_HI22,10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_HI22",FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_TLS_IE_LO10,0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_LO10",FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_TLS_IE_LD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_LD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_IE_LDX,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_LDX",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_IE_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_LE_HIX22,0,2,0,FALSE,0,complain_overflow_bitfield,sparc_elf_hix22_reloc, "R_SPARC_TLS_LE_HIX22",FALSE,0,0x003fffff, FALSE), + HOWTO(R_SPARC_TLS_LE_LOX10,0,2,0,FALSE,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_TLS_LE_LOX10",FALSE,0,0x000003ff, FALSE), + HOWTO(R_SPARC_TLS_DTPMOD32,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_DTPMOD32",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_DTPMOD64,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_DTPMOD64",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_DTPOFF32,0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc,"R_SPARC_TLS_DTPOFF32",FALSE,0,0xffffffff,TRUE), + HOWTO(R_SPARC_TLS_DTPOFF64,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_DTPOFF64",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_TPOFF32,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_TPOFF32",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_TPOFF64,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_TPOFF64",FALSE,0,0x00000000,TRUE) }; static reloc_howto_type elf32_sparc_vtinherit_howto = - HOWTO (R_SPARC_GNU_VTINHERIT, 0,2,0,false,0,complain_overflow_dont, NULL, "R_SPARC_GNU_VTINHERIT", false,0, 0, false); + HOWTO (R_SPARC_GNU_VTINHERIT, 0,2,0,FALSE,0,complain_overflow_dont, NULL, "R_SPARC_GNU_VTINHERIT", FALSE,0, 0, FALSE); 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); + 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); +static reloc_howto_type elf32_sparc_rev32_howto = + HOWTO(R_SPARC_REV32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_REV32", FALSE,0,0xffffffff,TRUE); struct elf_reloc_map { bfd_reloc_code_real_type bfd_reloc_val; @@ -187,9 +243,33 @@ static const struct elf_reloc_map sparc_reloc_map[] = { BFD_RELOC_SPARC_7, R_SPARC_7 }, { BFD_RELOC_SPARC_5, R_SPARC_5 }, { BFD_RELOC_SPARC_6, R_SPARC_6 }, - { BFD_RELOC_SPARC_REV32, R_SPARC_REV32 }, + { BFD_RELOC_SPARC_TLS_GD_HI22, R_SPARC_TLS_GD_HI22 }, + { BFD_RELOC_SPARC_TLS_GD_LO10, R_SPARC_TLS_GD_LO10 }, + { BFD_RELOC_SPARC_TLS_GD_ADD, R_SPARC_TLS_GD_ADD }, + { BFD_RELOC_SPARC_TLS_GD_CALL, R_SPARC_TLS_GD_CALL }, + { BFD_RELOC_SPARC_TLS_LDM_HI22, R_SPARC_TLS_LDM_HI22 }, + { BFD_RELOC_SPARC_TLS_LDM_LO10, R_SPARC_TLS_LDM_LO10 }, + { BFD_RELOC_SPARC_TLS_LDM_ADD, R_SPARC_TLS_LDM_ADD }, + { BFD_RELOC_SPARC_TLS_LDM_CALL, R_SPARC_TLS_LDM_CALL }, + { BFD_RELOC_SPARC_TLS_LDO_HIX22, R_SPARC_TLS_LDO_HIX22 }, + { BFD_RELOC_SPARC_TLS_LDO_LOX10, R_SPARC_TLS_LDO_LOX10 }, + { BFD_RELOC_SPARC_TLS_LDO_ADD, R_SPARC_TLS_LDO_ADD }, + { BFD_RELOC_SPARC_TLS_IE_HI22, R_SPARC_TLS_IE_HI22 }, + { BFD_RELOC_SPARC_TLS_IE_LO10, R_SPARC_TLS_IE_LO10 }, + { BFD_RELOC_SPARC_TLS_IE_LD, R_SPARC_TLS_IE_LD }, + { BFD_RELOC_SPARC_TLS_IE_LDX, R_SPARC_TLS_IE_LDX }, + { BFD_RELOC_SPARC_TLS_IE_ADD, R_SPARC_TLS_IE_ADD }, + { BFD_RELOC_SPARC_TLS_LE_HIX22, R_SPARC_TLS_LE_HIX22 }, + { BFD_RELOC_SPARC_TLS_LE_LOX10, R_SPARC_TLS_LE_LOX10 }, + { BFD_RELOC_SPARC_TLS_DTPMOD32, R_SPARC_TLS_DTPMOD32 }, + { BFD_RELOC_SPARC_TLS_DTPMOD64, R_SPARC_TLS_DTPMOD64 }, + { BFD_RELOC_SPARC_TLS_DTPOFF32, R_SPARC_TLS_DTPOFF32 }, + { BFD_RELOC_SPARC_TLS_DTPOFF64, R_SPARC_TLS_DTPOFF64 }, + { BFD_RELOC_SPARC_TLS_TPOFF32, R_SPARC_TLS_TPOFF32 }, + { BFD_RELOC_SPARC_TLS_TPOFF64, R_SPARC_TLS_TPOFF64 }, { BFD_RELOC_VTABLE_INHERIT, R_SPARC_GNU_VTINHERIT }, { BFD_RELOC_VTABLE_ENTRY, R_SPARC_GNU_VTENTRY }, + { BFD_RELOC_SPARC_REV32, R_SPARC_REV32 } }; static reloc_howto_type * @@ -207,12 +287,18 @@ elf32_sparc_reloc_type_lookup (abfd, code) case BFD_RELOC_VTABLE_ENTRY: return &elf32_sparc_vtentry_howto; + case BFD_RELOC_SPARC_REV32: + return &elf32_sparc_rev32_howto; + default: - for (i = 0; i < sizeof (sparc_reloc_map) / sizeof (struct elf_reloc_map); i++) - { - if (sparc_reloc_map[i].bfd_reloc_val == code) - return &_bfd_sparc_elf_howto_table[(int) sparc_reloc_map[i].elf_reloc_val]; - } + for (i = 0; + i < sizeof (sparc_reloc_map) / sizeof (struct elf_reloc_map); + i++) + { + if (sparc_reloc_map[i].bfd_reloc_val == code) + return (_bfd_sparc_elf_howto_table + + (int) sparc_reloc_map[i].elf_reloc_val); + } } bfd_set_error (bfd_error_bad_value); return NULL; @@ -237,6 +323,10 @@ elf32_sparc_info_to_howto (abfd, cache_ptr, dst) cache_ptr->howto = &elf32_sparc_vtentry_howto; break; + case R_SPARC_REV32: + cache_ptr->howto = &elf32_sparc_rev32_howto; + break; + default: BFD_ASSERT (ELF32_R_TYPE(dst->r_info) < (unsigned int) R_SPARC_max_std); cache_ptr->howto = &_bfd_sparc_elf_howto_table[ELF32_R_TYPE(dst->r_info)]; @@ -319,6 +409,127 @@ sparc_elf_wdisp16_reloc (abfd, else return bfd_reloc_ok; } + +/* Handle the HIX22 reloc. */ + +static bfd_reloc_status_type +sparc_elf_hix22_reloc (abfd, + reloc_entry, + symbol, + data, + input_section, + output_bfd, + error_message) + bfd *abfd; + arelent *reloc_entry; + asymbol *symbol; + PTR data; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + bfd_vma relocation; + bfd_vma insn; + + if (output_bfd != (bfd *) NULL + && (symbol->flags & BSF_SECTION_SYM) == 0) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + + if (output_bfd != NULL) + return bfd_reloc_continue; + + if (reloc_entry->address > input_section->_cooked_size) + return bfd_reloc_outofrange; + + relocation = (symbol->value + + symbol->section->output_section->vma + + symbol->section->output_offset); + relocation += reloc_entry->addend; + insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + + insn = (insn &~ (bfd_vma) 0x3fffff) | (((~relocation) >> 10) & 0x3fffff); + bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address); + + return bfd_reloc_ok; +} + +/* Handle the LOX10 reloc. */ + +static bfd_reloc_status_type +sparc_elf_lox10_reloc (abfd, + reloc_entry, + symbol, + data, + input_section, + output_bfd, + error_message) + bfd *abfd; + arelent *reloc_entry; + asymbol *symbol; + PTR data; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + bfd_vma relocation; + bfd_vma insn; + + if (output_bfd != (bfd *) NULL + && (symbol->flags & BSF_SECTION_SYM) == 0) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + + if (output_bfd != NULL) + return bfd_reloc_continue; + + if (reloc_entry->address > input_section->_cooked_size) + return bfd_reloc_outofrange; + + relocation = (symbol->value + + symbol->section->output_section->vma + + symbol->section->output_offset); + relocation += reloc_entry->addend; + insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + + insn = (insn &~ (bfd_vma) 0x1fff) | 0x1c00 | (relocation & 0x3ff); + bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address); + + return bfd_reloc_ok; +} + +/* Support for core dump NOTE sections. */ + +static bfd_boolean +elf32_sparc_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) +{ + switch (note->descsz) + { + default: + return FALSE; + + case 260: /* Solaris prpsinfo_t. */ + elf_tdata (abfd)->core_program + = _bfd_elfcore_strndup (abfd, note->descdata + 84, 16); + elf_tdata (abfd)->core_command + = _bfd_elfcore_strndup (abfd, note->descdata + 100, 80); + break; + + case 336: /* Solaris psinfo_t. */ + elf_tdata (abfd)->core_program + = _bfd_elfcore_strndup (abfd, note->descdata + 88, 16); + elf_tdata (abfd)->core_command + = _bfd_elfcore_strndup (abfd, note->descdata + 104, 80); + break; + } + + return TRUE; +} + /* Functions for the SPARC ELF linker. */ @@ -347,185 +558,553 @@ sparc_elf_wdisp16_reloc (abfd, /* nop. */ #define PLT_ENTRY_WORD2 SPARC_NOP +/* The SPARC linker needs to keep track of the number of relocs that it + decides to copy as dynamic relocs in check_relocs for each symbol. + This is so that it can later discard them if they are found to be + unnecessary. We store the information in a field extending the + regular ELF linker hash table. */ + +struct elf32_sparc_dyn_relocs +{ + struct elf32_sparc_dyn_relocs *next; + + /* The input section of the reloc. */ + asection *sec; + + /* Total number of relocs copied for the input section. */ + bfd_size_type count; + + /* Number of pc-relative relocs copied for the input section. */ + bfd_size_type pc_count; +}; + +/* SPARC ELF linker hash entry. */ + +struct elf32_sparc_link_hash_entry +{ + struct elf_link_hash_entry elf; + + /* Track dynamic relocs copied for this symbol. */ + struct elf32_sparc_dyn_relocs *dyn_relocs; + +#define GOT_UNKNOWN 0 +#define GOT_NORMAL 1 +#define GOT_TLS_GD 2 +#define GOT_TLS_IE 3 + unsigned char tls_type; +}; + +#define elf32_sparc_hash_entry(ent) ((struct elf32_sparc_link_hash_entry *)(ent)) + +struct elf32_sparc_obj_tdata +{ + struct elf_obj_tdata root; + + /* tls_type for each local got entry. */ + char *local_got_tls_type; + + /* TRUE if TLS GD relocs has been seen for this object. */ + bfd_boolean has_tlsgd; +}; + +#define elf32_sparc_tdata(abfd) \ + ((struct elf32_sparc_obj_tdata *) (abfd)->tdata.any) + +#define elf32_sparc_local_got_tls_type(abfd) \ + (elf32_sparc_tdata (abfd)->local_got_tls_type) + +static bfd_boolean +elf32_sparc_mkobject (abfd) + bfd *abfd; +{ + bfd_size_type amt = sizeof (struct elf32_sparc_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + return TRUE; +} + +/* SPARC ELF linker hash table. */ + +struct elf32_sparc_link_hash_table +{ + struct elf_link_hash_table elf; + + /* Short-cuts to get to dynamic linker sections. */ + asection *sgot; + asection *srelgot; + asection *splt; + asection *srelplt; + asection *sdynbss; + asection *srelbss; + + union { + bfd_signed_vma refcount; + bfd_vma offset; + } tls_ldm_got; + + /* Small local sym to section mapping cache. */ + struct sym_sec_cache sym_sec; +}; + +/* Get the SPARC ELF linker hash table from a link_info structure. */ + +#define elf32_sparc_hash_table(p) \ + ((struct elf32_sparc_link_hash_table *) ((p)->hash)) + +/* Create an entry in an i386 ELF linker hash table. */ + +static struct bfd_hash_entry * +link_hash_newfunc (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (entry == NULL) + { + entry = bfd_hash_allocate (table, + sizeof (struct elf32_sparc_link_hash_entry)); + if (entry == NULL) + return entry; + } + + /* Call the allocation method of the superclass. */ + entry = _bfd_elf_link_hash_newfunc (entry, table, string); + if (entry != NULL) + { + struct elf32_sparc_link_hash_entry *eh; + + eh = (struct elf32_sparc_link_hash_entry *) entry; + eh->dyn_relocs = NULL; + eh->tls_type = GOT_UNKNOWN; + } + + return entry; +} + +/* Create a SPARC ELF linker hash table. */ + +static struct bfd_link_hash_table * +elf32_sparc_link_hash_table_create (abfd) + bfd *abfd; +{ + struct elf32_sparc_link_hash_table *ret; + bfd_size_type amt = sizeof (struct elf32_sparc_link_hash_table); + + ret = (struct elf32_sparc_link_hash_table *) bfd_malloc (amt); + if (ret == NULL) + return NULL; + + if (! _bfd_elf_link_hash_table_init (&ret->elf, abfd, link_hash_newfunc)) + { + free (ret); + return NULL; + } + + ret->sgot = NULL; + ret->srelgot = NULL; + ret->splt = NULL; + ret->srelplt = NULL; + ret->sdynbss = NULL; + ret->srelbss = NULL; + ret->tls_ldm_got.refcount = 0; + ret->sym_sec.abfd = NULL; + + return &ret->elf.root; +} + +/* Create .got and .rela.got sections in DYNOBJ, and set up + shortcuts to them in our hash table. */ + +static bfd_boolean +create_got_section (dynobj, info) + bfd *dynobj; + struct bfd_link_info *info; +{ + struct elf32_sparc_link_hash_table *htab; + + if (! _bfd_elf_create_got_section (dynobj, info)) + return FALSE; + + htab = elf32_sparc_hash_table (info); + htab->sgot = bfd_get_section_by_name (dynobj, ".got"); + if (!htab->sgot) + abort (); + + htab->srelgot = bfd_make_section (dynobj, ".rela.got"); + if (htab->srelgot == NULL + || ! bfd_set_section_flags (dynobj, htab->srelgot, + (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED + | SEC_READONLY)) + || ! bfd_set_section_alignment (dynobj, htab->srelgot, 2)) + return FALSE; + return TRUE; +} + +/* Create .plt, .rela.plt, .got, .rela.got, .dynbss, and + .rela.bss sections in DYNOBJ, and set up shortcuts to them in our + hash table. */ + +static bfd_boolean +elf32_sparc_create_dynamic_sections (dynobj, info) + bfd *dynobj; + struct bfd_link_info *info; +{ + struct elf32_sparc_link_hash_table *htab; + + htab = elf32_sparc_hash_table (info); + if (!htab->sgot && !create_got_section (dynobj, info)) + return FALSE; + + if (!_bfd_elf_create_dynamic_sections (dynobj, info)) + return FALSE; + + htab->splt = bfd_get_section_by_name (dynobj, ".plt"); + htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); + htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss"); + if (!info->shared) + htab->srelbss = bfd_get_section_by_name (dynobj, ".rela.bss"); + + if (!htab->splt || !htab->srelplt || !htab->sdynbss + || (!info->shared && !htab->srelbss)) + abort (); + + return TRUE; +} + +/* Copy the extra info we tack onto an elf_link_hash_entry. */ + +static void +elf32_sparc_copy_indirect_symbol (bed, dir, ind) + const struct elf_backend_data *bed; + struct elf_link_hash_entry *dir, *ind; +{ + struct elf32_sparc_link_hash_entry *edir, *eind; + + edir = (struct elf32_sparc_link_hash_entry *) dir; + eind = (struct elf32_sparc_link_hash_entry *) ind; + + if (eind->dyn_relocs != NULL) + { + if (edir->dyn_relocs != NULL) + { + struct elf32_sparc_dyn_relocs **pp; + struct elf32_sparc_dyn_relocs *p; + + if (ind->root.type == bfd_link_hash_indirect) + abort (); + + /* Add reloc counts against the weak sym to the strong sym + list. Merge any entries against the same section. */ + for (pp = &eind->dyn_relocs; (p = *pp) != NULL; ) + { + struct elf32_sparc_dyn_relocs *q; + + for (q = edir->dyn_relocs; q != NULL; q = q->next) + if (q->sec == p->sec) + { + q->pc_count += p->pc_count; + q->count += p->count; + *pp = p->next; + break; + } + if (q == NULL) + pp = &p->next; + } + *pp = edir->dyn_relocs; + } + + edir->dyn_relocs = eind->dyn_relocs; + eind->dyn_relocs = NULL; + } + + if (ind->root.type == bfd_link_hash_indirect + && dir->got.refcount <= 0) + { + edir->tls_type = eind->tls_type; + eind->tls_type = GOT_UNKNOWN; + } + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); +} + +static int +elf32_sparc_tls_transition (info, abfd, r_type, is_local) + struct bfd_link_info *info; + bfd *abfd; + int r_type; + int is_local; +{ + if (r_type == R_SPARC_TLS_GD_HI22 + && ! elf32_sparc_tdata (abfd)->has_tlsgd) + r_type = R_SPARC_REV32; + + if (info->shared) + return r_type; + + switch (r_type) + { + case R_SPARC_TLS_GD_HI22: + if (is_local) + return R_SPARC_TLS_LE_HIX22; + return R_SPARC_TLS_IE_HI22; + case R_SPARC_TLS_GD_LO10: + if (is_local) + return R_SPARC_TLS_LE_LOX10; + return R_SPARC_TLS_IE_LO10; + case R_SPARC_TLS_IE_HI22: + if (is_local) + return R_SPARC_TLS_LE_HIX22; + return r_type; + case R_SPARC_TLS_IE_LO10: + if (is_local) + return R_SPARC_TLS_LE_LOX10; + return r_type; + case R_SPARC_TLS_LDM_HI22: + return R_SPARC_TLS_LE_HIX22; + case R_SPARC_TLS_LDM_LO10: + return R_SPARC_TLS_LE_LOX10; + } + + return r_type; +} + /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage table. */ -static boolean +static bfd_boolean elf32_sparc_check_relocs (abfd, info, sec, relocs) bfd *abfd; struct bfd_link_info *info; asection *sec; const Elf_Internal_Rela *relocs; { - bfd *dynobj; + struct elf32_sparc_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; bfd_vma *local_got_offsets; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - asection *sgot; - asection *srelgot; asection *sreloc; + bfd_boolean checked_tlsgd = FALSE; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; - dynobj = elf_hash_table (info)->dynobj; + htab = elf32_sparc_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); local_got_offsets = elf_local_got_offsets (abfd); - sgot = NULL; - srelgot = NULL; sreloc = NULL; rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { + unsigned int r_type; unsigned long r_symndx; struct elf_link_hash_entry *h; r_symndx = ELF32_R_SYM (rel->r_info); + r_type = ELF32_R_TYPE (rel->r_info); + + if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) + { + (*_bfd_error_handler) (_("%s: bad symbol index: %d"), + bfd_archive_filename (abfd), + r_symndx); + return FALSE; + } + 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)) + /* Compatibility with old R_SPARC_REV32 reloc conflicting + with R_SPARC_TLS_GD_HI22. */ + if (! checked_tlsgd) + switch (r_type) + { + case R_SPARC_TLS_GD_HI22: + { + const Elf_Internal_Rela *relt; + + for (relt = rel + 1; relt < rel_end; relt++) + if (ELF32_R_TYPE (relt->r_info) == R_SPARC_TLS_GD_LO10 + || ELF32_R_TYPE (relt->r_info) == R_SPARC_TLS_GD_ADD + || ELF32_R_TYPE (relt->r_info) == R_SPARC_TLS_GD_CALL) + break; + checked_tlsgd = TRUE; + elf32_sparc_tdata (abfd)->has_tlsgd = relt < rel_end; + } + break; + case R_SPARC_TLS_GD_LO10: + case R_SPARC_TLS_GD_ADD: + case R_SPARC_TLS_GD_CALL: + checked_tlsgd = TRUE; + elf32_sparc_tdata (abfd)->has_tlsgd = TRUE; + break; + } + + r_type = elf32_sparc_tls_transition (info, abfd, r_type, h == NULL); + switch (r_type) { + case R_SPARC_TLS_LDM_HI22: + case R_SPARC_TLS_LDM_LO10: + htab->tls_ldm_got.refcount += 1; + break; + + case R_SPARC_TLS_LE_HIX22: + case R_SPARC_TLS_LE_LOX10: + if (info->shared) + goto r_sparc_plt32; + break; + + case R_SPARC_TLS_IE_HI22: + case R_SPARC_TLS_IE_LO10: + if (info->shared) + info->flags |= DF_STATIC_TLS; + /* Fall through */ + case R_SPARC_GOT10: case R_SPARC_GOT13: case R_SPARC_GOT22: + case R_SPARC_TLS_GD_HI22: + case R_SPARC_TLS_GD_LO10: /* This symbol requires a global offset table entry. */ + { + int tls_type, old_tls_type; - if (dynobj == NULL) - { - /* Create the .got section. */ - elf_hash_table (info)->dynobj = dynobj = abfd; - if (! _bfd_elf_create_got_section (dynobj, info)) - return false; - } + switch (r_type) + { + default: + case R_SPARC_GOT10: + case R_SPARC_GOT13: + case R_SPARC_GOT22: + tls_type = GOT_NORMAL; + break; + case R_SPARC_TLS_GD_HI22: + case R_SPARC_TLS_GD_LO10: + tls_type = GOT_TLS_GD; + break; + case R_SPARC_TLS_IE_HI22: + case R_SPARC_TLS_IE_LO10: + tls_type = GOT_TLS_IE; + break; + } - if (sgot == NULL) - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - } + if (h != NULL) + { + h->got.refcount += 1; + old_tls_type = elf32_sparc_hash_entry(h)->tls_type; + } + else + { + bfd_signed_vma *local_got_refcounts; - 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, 2)) - return false; - } - } + /* This is a global offset table entry for a local symbol. */ + local_got_refcounts = elf_local_got_refcounts (abfd); + if (local_got_refcounts == NULL) + { + bfd_size_type size; + + size = symtab_hdr->sh_info; + size *= (sizeof (bfd_signed_vma) + sizeof(char)); + local_got_refcounts = ((bfd_signed_vma *) + bfd_zalloc (abfd, size)); + if (local_got_refcounts == NULL) + return FALSE; + elf_local_got_refcounts (abfd) = local_got_refcounts; + elf32_sparc_local_got_tls_type (abfd) + = (char *) (local_got_refcounts + symtab_hdr->sh_info); + } + local_got_refcounts[r_symndx] += 1; + old_tls_type = elf32_sparc_local_got_tls_type (abfd) [r_symndx]; + } - if (h != NULL) - { - if (h->got.offset != (bfd_vma) -1) - { - /* We have already allocated space in the .got. */ - break; - } - h->got.offset = sgot->_raw_size; + /* If a TLS symbol is accessed using IE at least once, + there is no point to use dynamic model for it. */ + if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN + && (old_tls_type != GOT_TLS_GD + || tls_type != GOT_TLS_IE)) + { + if (old_tls_type == GOT_TLS_IE && tls_type == GOT_TLS_GD) + tls_type = old_tls_type; + else + { + (*_bfd_error_handler) + (_("%s: `%s' accessed both as normal and thread local symbol"), + bfd_archive_filename (abfd), + h ? h->root.root.string : ""); + 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; - } + if (old_tls_type != tls_type) + { + if (h != NULL) + elf32_sparc_hash_entry (h)->tls_type = tls_type; + else + elf32_sparc_local_got_tls_type (abfd) [r_symndx] = tls_type; + } + } - srelgot->_raw_size += sizeof (Elf32_External_Rela); - } - else + if (htab->sgot == NULL) { - /* This is a global offset table entry for a local - symbol. */ - if (local_got_offsets == NULL) - { - bfd_size_type size; - register unsigned int i; - - size = symtab_hdr->sh_info; - size *= sizeof (bfd_vma); - local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size); - if (local_got_offsets == NULL) - return false; - elf_local_got_offsets (abfd) = local_got_offsets; - for (i = 0; i < symtab_hdr->sh_info; i++) - local_got_offsets[i] = (bfd_vma) -1; - } - if (local_got_offsets[r_symndx] != (bfd_vma) -1) - { - /* We have already allocated space in the .got. */ - break; - } - local_got_offsets[r_symndx] = sgot->_raw_size; - - if (info->shared) - { - /* If we are generating a shared object, we need to - output a R_SPARC_RELATIVE reloc so that the - dynamic linker can adjust this GOT entry. */ - srelgot->_raw_size += sizeof (Elf32_External_Rela); - } + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + if (!create_got_section (htab->elf.dynobj, info)) + return FALSE; } - - sgot->_raw_size += 4; - - /* If the .got section is more than 0x1000 bytes, we add - 0x1000 to the value of _GLOBAL_OFFSET_TABLE_, so that 13 - bit relocations have a greater chance of working. */ - if (sgot->_raw_size >= 0x1000 - && elf_hash_table (info)->hgot->root.u.def.value == 0) - elf_hash_table (info)->hgot->root.u.def.value = 0x1000; - break; + case R_SPARC_TLS_GD_CALL: + case R_SPARC_TLS_LDM_CALL: + if (info->shared) + { + /* These are basically R_SPARC_TLS_WPLT30 relocs against + __tls_get_addr. */ + struct bfd_link_hash_entry *bh = NULL; + if (! _bfd_generic_link_add_one_symbol (info, abfd, + "__tls_get_addr", 0, + bfd_und_section_ptr, 0, + NULL, FALSE, FALSE, + &bh)) + return FALSE; + h = (struct elf_link_hash_entry *) bh; + } + else + break; + /* Fall through */ + case R_SPARC_PLT32: case R_SPARC_WPLT30: /* This symbol requires a procedure linkage table entry. We - actually build the entry in adjust_dynamic_symbol, - because this might be a case of linking PIC code without - linking in any dynamic objects, in which case we don't - need to generate a procedure linkage table after all. */ + actually build the entry in adjust_dynamic_symbol, + because this might be a case of linking PIC code without + linking in any dynamic objects, in which case we don't + need to generate a procedure linkage table after all. */ if (h == NULL) { /* The Solaris native assembler will generate a WPLT30 - reloc for a local symbol if you assemble a call from - one section to another when using -K pic. We treat - it as WDISP30. */ - if (ELF32_R_TYPE (rel->r_info) != R_SPARC_WPLT30) + reloc for a local symbol if you assemble a call from + one section to another when using -K pic. We treat + it as WDISP30. */ + if (ELF32_R_TYPE (rel->r_info) == R_SPARC_PLT32) goto r_sparc_plt32; break; } - /* 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; - } - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - if (ELF32_R_TYPE (rel->r_info) != R_SPARC_WPLT30) + if (ELF32_R_TYPE (rel->r_info) == R_SPARC_PLT32) goto r_sparc_plt32; + h->plt.refcount += 1; break; case R_SPARC_PC10: @@ -537,6 +1116,7 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) break; /* Fall through. */ + case R_SPARC_DISP8: case R_SPARC_DISP16: case R_SPARC_DISP32: @@ -544,23 +1124,6 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) case R_SPARC_WDISP22: case R_SPARC_WDISP19: case R_SPARC_WDISP16: - if (h != NULL) - h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; - - /* If we are linking with -Bsymbolic, we do not need to copy - a PC relative reloc against a global symbol which is - defined in an object we are including in the link (i.e., - DEF_REGULAR is set). FIXME: 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). This needs to be handled as in - elf32-i386.c. */ - if (h == NULL - || (info->symbolic - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) != 0)) - break; - /* Fall through. */ case R_SPARC_8: case R_SPARC_16: case R_SPARC_32: @@ -574,26 +1137,75 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; r_sparc_plt32: - if (info->shared && (sec->flags & SEC_ALLOC)) + if (h != NULL && !info->shared) + { + /* We may need a .plt entry if the function this reloc + refers to is in a shared lib. */ + h->plt.refcount += 1; + } + + /* If we are creating a shared library, and this is a reloc + against a global symbol, or a non PC relative reloc + against a local symbol, then we need to copy the reloc + into the shared library. However, if we are linking with + -Bsymbolic, we do not need to copy a reloc against a + global symbol which is defined in an object we are + including in the link (i.e., DEF_REGULAR is set). At + this point we have not seen all the input files, so it is + possible that DEF_REGULAR is not set now but will be set + later (it is never cleared). In case of a weak definition, + DEF_REGULAR may be cleared later by a strong definition in + a shared library. We account for that possibility below by + storing information in the relocs_copied field of the hash + table entry. A similar situation occurs when creating + shared libraries and symbol visibility changes render the + symbol local. + + If on the other hand, we are creating an executable, we + may need to keep relocations for symbols satisfied by a + dynamic library if we manage to avoid copy relocs for the + symbol. */ + if ((info->shared + && (sec->flags & SEC_ALLOC) != 0 + && (! _bfd_sparc_elf_howto_table[r_type].pc_relative + || (h != NULL + && (! info->symbolic + || h->root.type == bfd_link_hash_defweak + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + || (!info->shared + && (sec->flags & SEC_ALLOC) != 0 + && h != NULL + && (h->root.type == bfd_link_hash_defweak + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0))) { + struct elf32_sparc_dyn_relocs *p; + struct elf32_sparc_dyn_relocs **head; + /* 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. */ + relocs into the output file. We create a reloc + section in dynobj and make room for the reloc. */ if (sreloc == NULL) { const char *name; + bfd *dynobj; name = (bfd_elf_string_from_elf_section (abfd, elf_elfheader (abfd)->e_shstrndx, elf_section_data (sec)->rel_hdr.sh_name)); if (name == NULL) - return false; + return FALSE; BFD_ASSERT (strncmp (name, ".rela", 5) == 0 && strcmp (bfd_get_section_name (abfd, sec), name + 5) == 0); + if (htab->elf.dynobj == NULL) + htab->elf.dynobj = abfd; + dynobj = htab->elf.dynobj; + sreloc = bfd_get_section_by_name (dynobj, name); if (sreloc == NULL) { @@ -607,33 +1219,69 @@ elf32_sparc_check_relocs (abfd, info, sec, relocs) if (sreloc == NULL || ! bfd_set_section_flags (dynobj, sreloc, flags) || ! bfd_set_section_alignment (dynobj, sreloc, 2)) - return false; + return FALSE; } - if (sec->flags & SEC_READONLY) - info->flags |= DF_TEXTREL; + elf_section_data (sec)->sreloc = sreloc; + } + + /* If this is a global symbol, we count the number of + relocations we need for this symbol. */ + if (h != NULL) + head = &((struct elf32_sparc_link_hash_entry *) h)->dyn_relocs; + else + { + /* Track dynamic relocs needed for local syms too. + We really need local syms available to do this + easily. Oh well. */ + + asection *s; + s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, + sec, r_symndx); + if (s == NULL) + return FALSE; + + head = ((struct elf32_sparc_dyn_relocs **) + &elf_section_data (s)->local_dynrel); } - sreloc->_raw_size += sizeof (Elf32_External_Rela); + p = *head; + if (p == NULL || p->sec != sec) + { + bfd_size_type amt = sizeof *p; + p = ((struct elf32_sparc_dyn_relocs *) + bfd_alloc (htab->elf.dynobj, amt)); + if (p == NULL) + return FALSE; + p->next = *head; + *head = p; + p->sec = sec; + p->count = 0; + p->pc_count = 0; + } + + p->count += 1; + if (_bfd_sparc_elf_howto_table[r_type].pc_relative) + p->pc_count += 1; } break; - case R_SPARC_GNU_VTINHERIT: - if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) - return false; - break; + case R_SPARC_GNU_VTINHERIT: + if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + return FALSE; + break; - case R_SPARC_GNU_VTENTRY: - if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend)) - return false; - break; + case R_SPARC_GNU_VTENTRY: + if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return FALSE; + break; default: break; } } - return true; + return TRUE; } static asection * @@ -650,21 +1298,21 @@ elf32_sparc_gc_mark_hook (sec, info, rel, h, sym) { case R_SPARC_GNU_VTINHERIT: case R_SPARC_GNU_VTENTRY: - break; + break; default: - switch (h->root.type) - { - case bfd_link_hash_defined: - case bfd_link_hash_defweak: - return h->root.u.def.section; + 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; + case bfd_link_hash_common: + return h->root.u.c.p->section; default: break; - } + } } } else @@ -674,20 +1322,19 @@ elf32_sparc_gc_mark_hook (sec, info, rel, h, sym) } /* Update the got entry reference counts for the section being removed. */ -static boolean +static bfd_boolean elf32_sparc_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; + + elf_section_data (sec)->local_dynrel = NULL; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); @@ -695,44 +1342,100 @@ elf32_sparc_gc_sweep_hook (abfd, info, sec, relocs) relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) - switch (ELF32_R_TYPE (rel->r_info)) - { - case R_SPARC_GOT10: - case R_SPARC_GOT13: - case R_SPARC_GOT22: - 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--; - } - else - { - if (local_got_refcounts[r_symndx] > 0) - local_got_refcounts[r_symndx]--; - } - break; - - case R_SPARC_PLT32: - case R_SPARC_HIPLT22: - case R_SPARC_LOPLT10: - case R_SPARC_PCPLT32: - case R_SPARC_PCPLT10: - 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--; - } - break; + { + unsigned long r_symndx; + unsigned int r_type; + struct elf_link_hash_entry *h = NULL; - default: - break; - } + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf32_sparc_link_hash_entry *eh; + struct elf32_sparc_dyn_relocs **pp; + struct elf32_sparc_dyn_relocs *p; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct elf32_sparc_link_hash_entry *) h; + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } + } + + r_type = ELF32_R_TYPE (rel->r_info); + r_type = elf32_sparc_tls_transition (info, abfd, r_type, h != NULL); + switch (r_type) + { + case R_SPARC_TLS_LDM_HI22: + case R_SPARC_TLS_LDM_LO10: + if (elf32_sparc_hash_table (info)->tls_ldm_got.refcount > 0) + elf32_sparc_hash_table (info)->tls_ldm_got.refcount -= 1; + break; + + case R_SPARC_TLS_GD_HI22: + case R_SPARC_TLS_GD_LO10: + case R_SPARC_TLS_IE_HI22: + case R_SPARC_TLS_IE_LO10: + case R_SPARC_GOT10: + case R_SPARC_GOT13: + case R_SPARC_GOT22: + if (h != NULL) + { + if (h->got.refcount > 0) + h->got.refcount--; + } + else + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx]--; + } + break; + + case R_SPARC_PC10: + case R_SPARC_PC22: + if (h != NULL + && strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) + break; + /* Fall through. */ + + case R_SPARC_DISP8: + case R_SPARC_DISP16: + case R_SPARC_DISP32: + case R_SPARC_WDISP30: + case R_SPARC_WDISP22: + case R_SPARC_WDISP19: + case R_SPARC_WDISP16: + case R_SPARC_8: + case R_SPARC_16: + case R_SPARC_32: + case R_SPARC_HI22: + case R_SPARC_22: + case R_SPARC_13: + case R_SPARC_LO10: + case R_SPARC_UA16: + case R_SPARC_UA32: + case R_SPARC_PLT32: + if (info->shared) + break; + /* Fall through. */ + + case R_SPARC_WPLT30: + if (h != NULL) + { + if (h->plt.refcount > 0) + h->plt.refcount--; + } + break; - return true; + default: + break; + } + } + + return TRUE; } /* Adjust a symbol defined by a dynamic object and referenced by a @@ -741,19 +1444,21 @@ elf32_sparc_gc_sweep_hook (abfd, info, sec, relocs) change the definition to something the rest of the link can understand. */ -static boolean +static bfd_boolean elf32_sparc_adjust_dynamic_symbol (info, h) struct bfd_link_info *info; struct elf_link_hash_entry *h; { - bfd *dynobj; + struct elf32_sparc_link_hash_table *htab; + struct elf32_sparc_link_hash_entry * eh; + struct elf32_sparc_dyn_relocs *p; asection *s; unsigned int power_of_two; - dynobj = elf_hash_table (info)->dynobj; + htab = elf32_sparc_hash_table (info); /* Make sure we know what is going on here. */ - BFD_ASSERT (dynobj != NULL + BFD_ASSERT (htab->elf.dynobj != NULL && ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) || h->weakdef != NULL || ((h->elf_link_hash_flags @@ -777,64 +1482,26 @@ elf32_sparc_adjust_dynamic_symbol (info, h) || h->root.type == bfd_link_hash_defweak) && (h->root.u.def.section->flags & SEC_CODE) != 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)) + if (h->plt.refcount <= 0 + || (! info->shared + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0 + && h->root.type != bfd_link_hash_undefweak + && h->root.type != bfd_link_hash_undefined)) { /* This case can occur if we saw a WPLT30 reloc in an input - file, but none of the input files were dynamic objects. - Or, when linking the main application or a -Bsymbolic - shared library against PIC code. Or when a global symbol - has been made private, e.g. via versioning. - - In these cases we know what value the symbol will resolve - to, so we don't actually need to build a procedure linkage - table, and we can just do a WDISP30 reloc instead. */ - + 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 WDISP30 reloc instead. */ + h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; - return true; } - s = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (s != NULL); - - /* The first four entries in .plt are reserved. */ - if (s->_raw_size == 0) - s->_raw_size = 4 * PLT_ENTRY_SIZE; - - /* The procedure linkage table has a maximum size. */ - if (s->_raw_size >= 0x400000) - { - bfd_set_error (bfd_error_bad_value); - return false; - } - - /* 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 .rela.plt section. */ - - s = bfd_get_section_by_name (dynobj, ".rela.plt"); - BFD_ASSERT (s != NULL); - s->_raw_size += sizeof (Elf32_External_Rela); - - return true; + return TRUE; } + else + h->plt.offset = (bfd_vma) -1; /* If this is a weak symbol, and there is a real definition, the processor independent code will have arranged for us to see the @@ -845,7 +1512,7 @@ elf32_sparc_adjust_dynamic_symbol (info, h) || 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; + return TRUE; } /* This is a reference to a symbol defined by a dynamic object which @@ -856,12 +1523,28 @@ elf32_sparc_adjust_dynamic_symbol (info, h) For such cases we need not do anything here; the relocations will be handled correctly by relocate_section. */ if (info->shared) - return true; + 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; + return TRUE; + + eh = (struct elf32_sparc_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + break; + } + + /* If we didn't find any dynamic relocs in read-only sections, then + we'll be keeping the dynamic relocs and avoiding the copy reloc. */ + if (p == NULL) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return TRUE; + } /* We must allocate the symbol in our .dynbss section, which will become part of the .bss section of the executable. There will be @@ -873,20 +1556,13 @@ elf32_sparc_adjust_dynamic_symbol (info, h) both the dynamic object and the regular object will refer to the same memory location for the variable. */ - s = bfd_get_section_by_name (dynobj, ".dynbss"); - BFD_ASSERT (s != NULL); - /* We must generate a R_SPARC_COPY reloc to tell the dynamic linker to copy the initial value out of the dynamic object and into the runtime process image. We need to remember the offset into the .rel.bss section we are going to use. */ 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 (Elf32_External_Rela); + htab->srelbss->_raw_size += sizeof (Elf32_External_Rela); h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY; } @@ -896,76 +1572,389 @@ elf32_sparc_adjust_dynamic_symbol (info, h) 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)) + /* Apply the required alignment. */ + s = htab->sdynbss; + s->_raw_size = BFD_ALIGN (s->_raw_size, + (bfd_size_type) (1 << power_of_two)); + if (power_of_two > bfd_get_section_alignment (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; +} + +/* Allocate space in .plt, .got and associated reloc sections for + dynamic relocs. */ + +static bfd_boolean +allocate_dynrelocs (h, inf) + struct elf_link_hash_entry *h; + PTR inf; +{ + struct bfd_link_info *info; + struct elf32_sparc_link_hash_table *htab; + struct elf32_sparc_link_hash_entry *eh; + struct elf32_sparc_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_indirect) + return TRUE; + + if (h->root.type == bfd_link_hash_warning) + /* When warning symbols are created, they **replace** the "real" + entry in the hash table, thus we never get to see the real + symbol in a hash traversal. So look at it now. */ + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + info = (struct bfd_link_info *) inf; + htab = elf32_sparc_hash_table (info); + + if (htab->elf.dynamic_sections_created + && h->plt.refcount > 0) + { + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h)) + { + asection *s = htab->splt; + + /* The first four entries in .plt are reserved. */ + if (s->_raw_size == 0) + s->_raw_size = 4 * PLT_ENTRY_SIZE; + + /* The procedure linkage table has a maximum size. */ + if (s->_raw_size >= 0x400000) + { + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + h->plt.offset = s->_raw_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 = h->plt.offset; + } + + /* Make room for this entry. */ + s->_raw_size += PLT_ENTRY_SIZE; + + /* We also need to make an entry in the .rela.plt section. */ + htab->srelplt->_raw_size += sizeof (Elf32_External_Rela); + } + else + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + } + else + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + } + + /* If R_SPARC_TLS_IE_{HI22,LO10} symbol is now local to the binary, + make it a R_SPARC_TLS_LE_{HI22,LO10} requiring no TLS entry. */ + if (h->got.refcount > 0 + && !info->shared + && h->dynindx == -1 + && elf32_sparc_hash_entry(h)->tls_type == GOT_TLS_IE) + h->got.offset = (bfd_vma) -1; + else if (h->got.refcount > 0) + { + asection *s; + bfd_boolean dyn; + int tls_type = elf32_sparc_hash_entry(h)->tls_type; + + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + s = htab->sgot; + h->got.offset = s->_raw_size; + s->_raw_size += 4; + /* R_SPARC_TLS_GD_HI{22,LO10} needs 2 consecutive GOT slots. */ + if (tls_type == GOT_TLS_GD) + s->_raw_size += 4; + dyn = htab->elf.dynamic_sections_created; + /* R_SPARC_TLS_IE_{HI22,LO10} needs one dynamic relocation, + R_SPARC_TLS_GD_{HI22,LO10} needs one if local symbol and two if + global. */ + if ((tls_type == GOT_TLS_GD && h->dynindx == -1) + || tls_type == GOT_TLS_IE) + htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); + else if (tls_type == GOT_TLS_GD) + htab->srelgot->_raw_size += 2 * sizeof (Elf32_External_Rela); + else if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h)) + htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); + } + else + h->got.offset = (bfd_vma) -1; + + eh = (struct elf32_sparc_link_hash_entry *) h; + if (eh->dyn_relocs == NULL) + return TRUE; + + /* In the shared -Bsymbolic case, discard space allocated for + dynamic pc-relative relocs against symbols which turn out to be + defined in regular objects. For the normal shared case, discard + space for pc-relative relocs that have become local due to symbol + visibility changes. */ + + if (info->shared) + { + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 + && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 + || info->symbolic)) + { + struct elf32_sparc_dyn_relocs **pp; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; ) + { + p->count -= p->pc_count; + p->pc_count = 0; + if (p->count == 0) + *pp = p->next; + else + pp = &p->next; + } + } + } + else + { + /* For the non-shared case, discard space for relocs against + symbols which turn out to need copy relocs or are not + dynamic. */ + + if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 + && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + || (htab->elf.dynamic_sections_created + && (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined)))) + { + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + /* If that succeeded, we know we'll be keeping all the + relocs. */ + if (h->dynindx != -1) + goto keep; + } + + eh->dyn_relocs = NULL; + + keep: ; + } + + /* Finally, allocate space. */ + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + asection *sreloc = elf_section_data (p->sec)->sreloc; + sreloc->_raw_size += p->count * sizeof (Elf32_External_Rela); + } + + return TRUE; +} + +/* Find any dynamic relocs that apply to read-only sections. */ + +static bfd_boolean +readonly_dynrelocs (h, inf) + struct elf_link_hash_entry *h; + PTR inf; +{ + struct elf32_sparc_link_hash_entry *eh; + struct elf32_sparc_dyn_relocs *p; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + eh = (struct elf32_sparc_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) { - if (! bfd_set_section_alignment (dynobj, s, power_of_two)) - return false; - } + asection *s = p->sec->output_section; - /* 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; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + { + struct bfd_link_info *info = (struct bfd_link_info *) inf; - /* Increment the section size to make room for the symbol. */ - s->_raw_size += h->size; + info->flags |= DF_TEXTREL; - return true; + /* Not an error, just cut short the traversal. */ + return FALSE; + } + } + return TRUE; } /* Set the sizes of the dynamic sections. */ -static boolean +static bfd_boolean elf32_sparc_size_dynamic_sections (output_bfd, info) bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { + struct elf32_sparc_link_hash_table *htab; bfd *dynobj; asection *s; - boolean relplt; + bfd *ibfd; - dynobj = elf_hash_table (info)->dynobj; + htab = elf32_sparc_hash_table (info); + dynobj = htab->elf.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) + if (info->executable) { 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; } + } - /* Make space for the trailing nop in .plt. */ - s = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (s != NULL); - if (s->_raw_size > 0) - s->_raw_size += 4; + /* Set up .got offsets for local syms, and space for local dynamic + relocs. */ + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + bfd_signed_vma *local_got; + bfd_signed_vma *end_local_got; + char *local_tls_type; + bfd_size_type locsymcount; + Elf_Internal_Shdr *symtab_hdr; + asection *srel; + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) + continue; + + for (s = ibfd->sections; s != NULL; s = s->next) + { + struct elf32_sparc_dyn_relocs *p; + + for (p = *((struct elf32_sparc_dyn_relocs **) + &elf_section_data (s)->local_dynrel); + p != NULL; + p = p->next) + { + if (!bfd_is_abs_section (p->sec) + && bfd_is_abs_section (p->sec->output_section)) + { + /* Input section has been discarded, either because + it is a copy of a linkonce section or due to + linker script /DISCARD/, so we'll be discarding + the relocs too. */ + } + else if (p->count != 0) + { + srel = elf_section_data (p->sec)->sreloc; + srel->_raw_size += p->count * sizeof (Elf32_External_Rela); + if ((p->sec->output_section->flags & SEC_READONLY) != 0) + info->flags |= DF_TEXTREL; + } + } + } + + local_got = elf_local_got_refcounts (ibfd); + if (!local_got) + continue; + + symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + locsymcount = symtab_hdr->sh_info; + end_local_got = local_got + locsymcount; + local_tls_type = elf32_sparc_local_got_tls_type (ibfd); + s = htab->sgot; + srel = htab->srelgot; + for (; local_got < end_local_got; ++local_got, ++local_tls_type) + { + if (*local_got > 0) + { + *local_got = s->_raw_size; + s->_raw_size += 4; + if (*local_tls_type == GOT_TLS_GD) + s->_raw_size += 4; + if (info->shared + || *local_tls_type == GOT_TLS_GD + || *local_tls_type == GOT_TLS_IE) + srel->_raw_size += sizeof (Elf32_External_Rela); + } + else + *local_got = (bfd_vma) -1; + } + } + + if (htab->tls_ldm_got.refcount > 0) + { + /* Allocate 2 got entries and 1 dynamic reloc for + R_SPARC_TLS_LDM_{HI22,LO10} relocs. */ + htab->tls_ldm_got.offset = htab->sgot->_raw_size; + htab->sgot->_raw_size += 8; + htab->srelgot->_raw_size += sizeof (Elf32_External_Rela); } else + htab->tls_ldm_got.offset = -1; + + /* Allocate global sym .plt and .got entries, and space for global + sym dynamic relocs. */ + elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); + + if (elf_hash_table (info)->dynamic_sections_created) { - /* 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; + /* Make space for the trailing nop in .plt. */ + if (htab->splt->_raw_size > 0) + htab->splt->_raw_size += 4; + + /* If the .got section is more than 0x1000 bytes, we add + 0x1000 to the value of _GLOBAL_OFFSET_TABLE_, so that 13 + bit relocations have a greater chance of working. */ + if (htab->sgot->_raw_size >= 0x1000 + && elf_hash_table (info)->hgot->root.u.def.value == 0) + elf_hash_table (info)->hgot->root.u.def.value = 0x1000; } /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ - relplt = false; for (s = dynobj->sections; s != NULL; s = s->next) { const char *name; - boolean strip; + bfd_boolean strip = FALSE; if ((s->flags & SEC_LINKER_CREATED) == 0) continue; @@ -974,8 +1963,6 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) of the dynobj section names depend upon the input files. */ name = bfd_get_section_name (dynobj, s); - strip = false; - if (strncmp (name, ".rela", 5) == 0) { if (s->_raw_size == 0) @@ -989,20 +1976,16 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) adjust_dynamic_symbol is called, and it is that function which decides whether anything needs to go into these sections. */ - strip = true; + strip = TRUE; } else { - if (strcmp (name, ".rela.plt") == 0) - relplt = 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 - && strcmp (name, ".got") != 0) + else if (s != htab->splt && s != htab->sgot) { /* It's not one of our sections, so don't allocate space. */ continue; @@ -1022,7 +2005,7 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) contents to zero. */ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) - return false; + return FALSE; } if (elf_hash_table (info)->dynamic_sections_created) @@ -1033,68 +2016,115 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ #define add_dynamic_entry(TAG, VAL) \ - bfd_elf32_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + _bfd_elf_add_dynamic_entry (info, TAG, VAL) - if (!info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) - return false; + return FALSE; } - if (relplt) + if (htab->srelplt->_raw_size != 0) { if (!add_dynamic_entry (DT_PLTGOT, 0) || !add_dynamic_entry (DT_PLTRELSZ, 0) || !add_dynamic_entry (DT_PLTREL, DT_RELA) || !add_dynamic_entry (DT_JMPREL, 0)) - return false; + return FALSE; } if (!add_dynamic_entry (DT_RELA, 0) || !add_dynamic_entry (DT_RELASZ, 0) || !add_dynamic_entry (DT_RELAENT, sizeof (Elf32_External_Rela))) - return false; + return FALSE; + + /* If any dynamic relocs apply to a read-only section, + then we need a DT_TEXTREL entry. */ + if ((info->flags & DF_TEXTREL) == 0) + elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, + (PTR) info); if (info->flags & DF_TEXTREL) { if (!add_dynamic_entry (DT_TEXTREL, 0)) - return false; + return FALSE; } } #undef add_dynamic_entry - return true; + 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) +struct elf32_sparc_section_data +{ + struct bfd_elf_section_data elf; + unsigned int do_relax; +}; + +#define sec_do_relax(sec) \ + ((struct elf32_sparc_section_data *) elf_section_data (sec))->do_relax + +static bfd_boolean +elf32_sparc_new_section_hook (abfd, sec) + bfd *abfd; + asection *sec; +{ + struct elf32_sparc_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); + + sdata = (struct elf32_sparc_section_data *) bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = (PTR) sdata; -static boolean + return _bfd_elf_new_section_hook (abfd, sec); +} + +static bfd_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; + bfd_boolean *again; +{ + *again = FALSE; + sec_do_relax (section) = 1; + return TRUE; +} + +/* Return the base VMA address which should be subtracted from real addresses + when resolving @dtpoff relocation. + This is PT_TLS segment p_vaddr. */ + +static bfd_vma +dtpoff_base (info) + struct bfd_link_info *info; { - *again = false; - SET_SEC_DO_RELAX (section); - return true; + /* If tls_sec is NULL, we should have signalled an error already. */ + if (elf_hash_table (info)->tls_sec == NULL) + return 0; + return elf_hash_table (info)->tls_sec->vma; } -/* This is the condition under which finish_dynamic_symbol will be called - from elflink.h. If elflink.h doesn't call our finish_dynamic_symbol - routine, we'll need to do something about initializing any .plt and .got - entries in relocate_section. */ -#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ - ((DYN) \ - && ((INFO)->shared \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ - && ((H)->dynindx != -1 \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) +/* Return the relocation value for @tpoff relocation + if STT_TLS virtual address is ADDRESS. */ + +static bfd_vma +tpoff (info, address) + struct bfd_link_info *info; + bfd_vma address; +{ + struct elf_link_hash_table *htab = elf_hash_table (info); + + /* If tls_sec is NULL, we should have signalled an error already. */ + if (htab->tls_sec == NULL) + return 0; + return address - htab->tls_size - htab->tls_sec->vma; +} /* Relocate a SPARC ELF section. */ -static boolean +static bfd_boolean elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, local_syms, local_sections) bfd *output_bfd; @@ -1106,18 +2136,19 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Sym *local_syms; asection **local_sections; { - bfd *dynobj; + struct elf32_sparc_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; bfd_vma *local_got_offsets; bfd_vma got_base; - asection *sgot; - asection *splt; asection *sreloc; Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - dynobj = elf_hash_table (info)->dynobj; + if (info->relocatable) + return TRUE; + + htab = elf32_sparc_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); local_got_offsets = elf_local_got_offsets (input_bfd); @@ -1127,15 +2158,13 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, else got_base = elf_hash_table (info)->hgot->root.u.def.value; - sgot = NULL; - splt = NULL; - sreloc = NULL; + sreloc = elf_section_data (input_section)->sreloc; rel = relocs; relend = relocs + input_section->reloc_count; for (; rel < relend; rel++) { - int r_type; + int r_type, tls_type; reloc_howto_type *howto; unsigned long r_symndx; struct elf_link_hash_entry *h; @@ -1143,93 +2172,42 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, asection *sec; bfd_vma relocation, off; bfd_reloc_status_type r; - boolean is_plt = false; - boolean unresolved_reloc; + bfd_boolean is_plt = FALSE; + bfd_boolean unresolved_reloc; r_type = ELF32_R_TYPE (rel->r_info); if (r_type == R_SPARC_GNU_VTINHERIT - || r_type == R_SPARC_GNU_VTENTRY) - continue; + || r_type == R_SPARC_GNU_VTENTRY) + continue; if (r_type < 0 || r_type >= (int) R_SPARC_max_std) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } howto = _bfd_sparc_elf_howto_table + r_type; - 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. */ + r_symndx = ELF32_R_SYM (rel->r_info); h = NULL; sym = NULL; sec = NULL; - unresolved_reloc = false; + unresolved_reloc = FALSE; if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; sec = local_sections[r_symndx]; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); } 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; + bfd_boolean warned ATTRIBUTE_UNUSED; - relocation = 0; - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - sec = h->root.u.def.section; - if (sec->output_section == NULL) - /* Set a flag that will be cleared later if we find a - relocation value for this symbol. output_section - is typically NULL for symbols satisfied by a shared - library. */ - unresolved_reloc = true; - else - relocation = (h->root.u.def.value - + sec->output_section->vma - + sec->output_offset); - } - else if (h->root.type == bfd_link_hash_undefweak) - ; - else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) - && !info->no_undefined - && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - ; - else - { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.string, input_bfd, - input_section, rel->r_offset, - (!info->shared || info->no_undefined - || ELF_ST_VISIBILITY (h->other))))) - return false; - } + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); } switch (r_type) @@ -1238,22 +2216,19 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, case R_SPARC_GOT13: case R_SPARC_GOT22: /* 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); - } + offset table. */ + if (htab->sgot == NULL) + abort (); if (h != NULL) { - boolean dyn; + bfd_boolean dyn; off = h->got.offset; BFD_ASSERT (off != (bfd_vma) -1); dyn = elf_hash_table (info)->dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) || (info->shared && (info->symbolic || h->dynindx == -1 @@ -1261,13 +2236,13 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, && (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 4, we use the - least significant bit to record whether we have - initialized it already. + -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 @@ -1277,12 +2252,12 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, else { bfd_put_32 (output_bfd, relocation, - sgot->contents + off); + htab->sgot->contents + off); h->got.offset |= 1; } } else - unresolved_reloc = false; + unresolved_reloc = FALSE; } else { @@ -1301,32 +2276,32 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, if (info->shared) { - asection *srelgot; + asection *s; Elf_Internal_Rela outrel; + bfd_byte *loc; /* We need to generate a R_SPARC_RELATIVE reloc for the dynamic linker. */ - srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); - BFD_ASSERT (srelgot != NULL); + s = htab->srelgot; + BFD_ASSERT (s != NULL); - outrel.r_offset = (sgot->output_section->vma - + sgot->output_offset + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off); outrel.r_info = ELF32_R_INFO (0, R_SPARC_RELATIVE); outrel.r_addend = relocation; relocation = 0; - bfd_elf32_swap_reloca_out (output_bfd, &outrel, - (((Elf32_External_Rela *) - srelgot->contents) - + srelgot->reloc_count)); - ++srelgot->reloc_count; + loc = s->contents; + loc += s->reloc_count++ * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); } - bfd_put_32 (output_bfd, relocation, sgot->contents + off); + bfd_put_32 (output_bfd, relocation, + htab->sgot->contents + off); local_got_offsets[r_symndx] |= 1; } } - relocation = sgot->output_offset + off - got_base; + relocation = htab->sgot->output_offset + off - got_base; break; case R_SPARC_PLT32: @@ -1337,8 +2312,9 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, } /* Fall through. */ case R_SPARC_WPLT30: + r_sparc_wplt30: /* Relocation is to the entry for this symbol in the - procedure linkage table. */ + procedure linkage table. */ /* The Solaris native assembler will generate a WPLT30 reloc for a local symbol if you assemble a call from one @@ -1347,28 +2323,22 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, if (h == NULL) break; - if (h->plt.offset == (bfd_vma) -1) + if (h->plt.offset == (bfd_vma) -1 || htab->splt == NULL) { /* We didn't make a PLT entry for this symbol. This - happens when statically linking PIC code, or when - using -Bsymbolic. */ + happens when statically linking PIC code, or when + using -Bsymbolic. */ break; } - if (splt == NULL) - { - splt = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (splt != NULL); - } - - relocation = (splt->output_section->vma - + splt->output_offset + relocation = (htab->splt->output_section->vma + + htab->splt->output_offset + h->plt.offset); - unresolved_reloc = false; + unresolved_reloc = FALSE; if (r_type == R_SPARC_PLT32) { r_type = R_SPARC_32; - is_plt = true; + is_plt = TRUE; goto r_sparc_plt32; } break; @@ -1386,12 +2356,6 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, case R_SPARC_WDISP22: case R_SPARC_WDISP19: case R_SPARC_WDISP16: - if (h == NULL - || (info->symbolic - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) != 0)) - break; - /* Fall through. */ case R_SPARC_8: case R_SPARC_16: case R_SPARC_32: @@ -1402,46 +2366,50 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, case R_SPARC_UA16: case R_SPARC_UA32: r_sparc_plt32: - if (info->shared - && r_symndx != 0 - && (input_section->flags & SEC_ALLOC)) + /* r_symndx will be zero only for relocs against symbols + from removed linkonce sections, or sections discarded by + a linker script. */ + if (r_symndx == 0 + || (input_section->flags & SEC_ALLOC) == 0) + break; + + if ((info->shared + && (! howto->pc_relative + || (h != NULL + && h->dynindx != -1 + && (! info->symbolic + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + || (!info->shared + && h != NULL + && h->dynindx != -1 + && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 + && (((h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0) + || h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined))) { Elf_Internal_Rela outrel; - boolean skip, relocate = false; + bfd_byte *loc; + bfd_boolean skip, relocate = FALSE; /* 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; + are copied into the output file to be resolved at run + time. */ - 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); - } + BFD_ASSERT (sreloc != NULL); - skip = false; + skip = FALSE; outrel.r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, rel->r_offset); if (outrel.r_offset == (bfd_vma) -1) - skip = true; + skip = TRUE; else if (outrel.r_offset == (bfd_vma) -2) - skip = true, relocate = true; + skip = TRUE, relocate = TRUE; outrel.r_offset += (input_section->output_section->vma + input_section->output_offset); @@ -1474,14 +2442,14 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, FIXME: Add code tracking needed dynamic relocs as e.g. i386 has. */ if (h->dynindx == -1) - skip = true, relocate = true; + skip = TRUE, relocate = TRUE; break; } if (skip) memset (&outrel, 0, sizeof outrel); /* h->dynindx may be -1 if the symbol was marked to - become local. */ + become local. */ else if (h != NULL && ! is_plt && ((! info->symbolic && h->dynindx != -1) || (h->elf_link_hash_flags @@ -1503,22 +2471,14 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, long indx; if (is_plt) - sec = splt; - else if (h == NULL) - sec = local_sections[r_symndx]; - else - { - BFD_ASSERT (h->root.type == bfd_link_hash_defined - || (h->root.type - == bfd_link_hash_defweak)); - sec = h->root.u.def.section; - } - if (sec != NULL && bfd_is_abs_section (sec)) + sec = htab->splt; + + if (bfd_is_abs_section (sec)) indx = 0; else if (sec == NULL || sec->owner == NULL) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } else { @@ -1536,7 +2496,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, (_("%s: probably compiled without -fPIC?"), bfd_archive_filename (input_bfd)); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } } @@ -1545,19 +2505,341 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, } } - bfd_elf32_swap_reloca_out (output_bfd, &outrel, - (((Elf32_External_Rela *) - sreloc->contents) - + sreloc->reloc_count)); - ++sreloc->reloc_count; + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &outrel, loc); /* This reloc will be computed at runtime, so there's no - need to do anything now. */ + need to do anything now. */ if (! relocate) continue; } break; + case R_SPARC_TLS_GD_HI22: + if (! elf32_sparc_tdata (input_bfd)->has_tlsgd) + { + /* R_SPARC_REV32 used the same reloc number as + R_SPARC_TLS_GD_HI22. */ + r_type = R_SPARC_REV32; + break; + } + /* Fall through */ + + case R_SPARC_TLS_GD_LO10: + case R_SPARC_TLS_IE_HI22: + case R_SPARC_TLS_IE_LO10: + r_type = elf32_sparc_tls_transition (info, input_bfd, r_type, + h == NULL); + tls_type = GOT_UNKNOWN; + if (h == NULL && local_got_offsets) + tls_type = elf32_sparc_local_got_tls_type (input_bfd) [r_symndx]; + else if (h != NULL) + { + tls_type = elf32_sparc_hash_entry(h)->tls_type; + if (!info->shared && h->dynindx == -1 && tls_type == GOT_TLS_IE) + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_SPARC_TLS_GD_HI22: + case R_SPARC_TLS_IE_HI22: + r_type = R_SPARC_TLS_LE_HIX22; + break; + default: + r_type = R_SPARC_TLS_LE_LOX10; + break; + } + } + if (tls_type == GOT_TLS_IE) + switch (r_type) + { + case R_SPARC_TLS_GD_HI22: + r_type = R_SPARC_TLS_IE_HI22; + break; + case R_SPARC_TLS_GD_LO10: + r_type = R_SPARC_TLS_IE_LO10; + break; + } + + if (r_type == R_SPARC_TLS_LE_HIX22) + { + relocation = tpoff (info, relocation); + break; + } + if (r_type == R_SPARC_TLS_LE_LOX10) + { + /* Change add into xor. */ + relocation = tpoff (info, relocation); + bfd_put_32 (output_bfd, (bfd_get_32 (input_bfd, + contents + rel->r_offset) + | 0x80182000), contents + rel->r_offset); + break; + } + + if (h != NULL) + { + off = h->got.offset; + h->got.offset |= 1; + } + else + { + BFD_ASSERT (local_got_offsets != NULL); + off = local_got_offsets[r_symndx]; + local_got_offsets[r_symndx] |= 1; + } + + r_sparc_tlsldm: + if (htab->sgot == NULL) + abort (); + + if ((off & 1) != 0) + off &= ~1; + else + { + Elf_Internal_Rela outrel; + Elf32_External_Rela *loc; + int dr_type, indx; + + if (htab->srelgot == NULL) + abort (); + + bfd_put_32 (output_bfd, 0, htab->sgot->contents + off); + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off); + indx = h && h->dynindx != -1 ? h->dynindx : 0; + if (r_type == R_SPARC_TLS_IE_HI22 + || r_type == R_SPARC_TLS_IE_LO10) + dr_type = R_SPARC_TLS_TPOFF32; + else + dr_type = R_SPARC_TLS_DTPMOD32; + if (dr_type == R_SPARC_TLS_TPOFF32 && indx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + else + outrel.r_addend = 0; + outrel.r_info = ELF32_R_INFO (indx, dr_type); + loc = (Elf32_External_Rela *) htab->srelgot->contents; + loc += htab->srelgot->reloc_count++; + bfd_elf32_swap_reloca_out (output_bfd, &outrel, + (bfd_byte *) loc); + + if (r_type == R_SPARC_TLS_GD_HI22 + || r_type == R_SPARC_TLS_GD_LO10) + { + if (indx == 0) + { + BFD_ASSERT (! unresolved_reloc); + bfd_put_32 (output_bfd, + relocation - dtpoff_base (info), + htab->sgot->contents + off + 4); + } + else + { + bfd_put_32 (output_bfd, 0, + htab->sgot->contents + off + 4); + outrel.r_info = ELF32_R_INFO (indx, + R_SPARC_TLS_DTPOFF32); + outrel.r_offset += 4; + htab->srelgot->reloc_count++; + loc++; + bfd_elf32_swap_reloca_out (output_bfd, &outrel, + (bfd_byte *) loc); + } + } + else if (dr_type == R_SPARC_TLS_DTPMOD32) + { + bfd_put_32 (output_bfd, 0, + htab->sgot->contents + off + 4); + } + } + + if (off >= (bfd_vma) -2) + abort (); + + relocation = htab->sgot->output_offset + off - got_base; + unresolved_reloc = FALSE; + howto = _bfd_sparc_elf_howto_table + r_type; + break; + + case R_SPARC_TLS_LDM_HI22: + case R_SPARC_TLS_LDM_LO10: + if (! info->shared) + { + bfd_put_32 (output_bfd, SPARC_NOP, contents + rel->r_offset); + continue; + } + off = htab->tls_ldm_got.offset; + htab->tls_ldm_got.offset |= 1; + goto r_sparc_tlsldm; + + case R_SPARC_TLS_LDO_HIX22: + case R_SPARC_TLS_LDO_LOX10: + if (info->shared) + relocation -= dtpoff_base (info); + else + relocation = tpoff (info, relocation); + break; + + case R_SPARC_TLS_LE_HIX22: + case R_SPARC_TLS_LE_LOX10: + if (info->shared) + { + Elf_Internal_Rela outrel; + bfd_boolean skip, relocate = FALSE; + + BFD_ASSERT (sreloc != NULL); + skip = FALSE; + outrel.r_offset = + _bfd_elf_section_offset (output_bfd, info, input_section, + rel->r_offset); + if (outrel.r_offset == (bfd_vma) -1) + skip = TRUE; + else if (outrel.r_offset == (bfd_vma) -2) + skip = TRUE, relocate = TRUE; + outrel.r_offset += (input_section->output_section->vma + + input_section->output_offset); + if (skip) + memset (&outrel, 0, sizeof outrel); + else + { + outrel.r_info = ELF32_R_INFO (0, r_type); + outrel.r_addend = relocation - dtpoff_base (info) + + rel->r_addend; + } + + bfd_elf32_swap_reloca_out (output_bfd, &outrel, + (bfd_byte *) (((Elf32_External_Rela *) + sreloc->contents) + + sreloc->reloc_count)); + ++sreloc->reloc_count; + continue; + } + relocation = tpoff (info, relocation); + break; + + case R_SPARC_TLS_LDM_CALL: + if (! info->shared) + { + /* mov %g0, %o0 */ + bfd_put_32 (output_bfd, 0x90100000, contents + rel->r_offset); + continue; + } + /* Fall through */ + + case R_SPARC_TLS_GD_CALL: + tls_type = GOT_UNKNOWN; + if (h == NULL && local_got_offsets) + tls_type = elf32_sparc_local_got_tls_type (input_bfd) [r_symndx]; + else if (h != NULL) + tls_type = elf32_sparc_hash_entry(h)->tls_type; + if (! info->shared + || (r_type == R_SPARC_TLS_GD_CALL && tls_type == GOT_TLS_IE)) + { + bfd_vma insn; + + if (!info->shared && (h == NULL || h->dynindx == -1)) + { + /* GD -> LE */ + bfd_put_32 (output_bfd, SPARC_NOP, contents + rel->r_offset); + continue; + } + + /* GD -> IE */ + if (rel + 1 < relend + && ELF32_R_TYPE (rel[1].r_info) == R_SPARC_TLS_GD_ADD + && rel[1].r_offset == rel->r_offset + 4 + && ELF32_R_SYM (rel[1].r_info) == r_symndx + && (((insn = bfd_get_32 (input_bfd, + contents + rel[1].r_offset)) + >> 25) & 0x1f) == 8) + { + /* We have + call __tls_get_addr, %tgd_call(foo) + add %reg1, %reg2, %o0, %tgd_add(foo) + and change it into IE: + ld [%reg1 + %reg2], %o0, %tie_ld(foo) + add %g7, %o0, %o0, %tie_add(foo). + add is 0x80000000 | (rd << 25) | (rs1 << 14) | rs2, + ld is 0xc0000000 | (rd << 25) | (rs1 << 14) | rs2. */ + bfd_put_32 (output_bfd, insn | 0xc0000000, + contents + rel->r_offset); + bfd_put_32 (output_bfd, 0x9001c008, + contents + rel->r_offset + 4); + rel++; + continue; + } + + bfd_put_32 (output_bfd, 0x9001c008, contents + rel->r_offset); + continue; + } + + h = (struct elf_link_hash_entry *) + bfd_link_hash_lookup (info->hash, "__tls_get_addr", FALSE, + FALSE, TRUE); + BFD_ASSERT (h != NULL); + r_type = R_SPARC_WPLT30; + howto = _bfd_sparc_elf_howto_table + r_type; + goto r_sparc_wplt30; + + case R_SPARC_TLS_GD_ADD: + tls_type = GOT_UNKNOWN; + if (h == NULL && local_got_offsets) + tls_type = elf32_sparc_local_got_tls_type (input_bfd) [r_symndx]; + else if (h != NULL) + tls_type = elf32_sparc_hash_entry(h)->tls_type; + if (! info->shared || tls_type == GOT_TLS_IE) + { + /* add %reg1, %reg2, %reg3, %tgd_add(foo) + changed into IE: + ld [%reg1 + %reg2], %reg3, %tie_ld(foo) + or LE: + add %g7, %reg2, %reg3. */ + bfd_vma insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + if ((h != NULL && h->dynindx != -1) || info->shared) + relocation = insn | 0xc0000000; + else + relocation = (insn & ~0x7c000) | 0x1c000; + bfd_put_32 (output_bfd, relocation, contents + rel->r_offset); + } + continue; + + case R_SPARC_TLS_LDM_ADD: + if (! info->shared) + bfd_put_32 (output_bfd, SPARC_NOP, contents + rel->r_offset); + continue; + + case R_SPARC_TLS_LDO_ADD: + if (! info->shared) + { + /* Change rs1 into %g7. */ + bfd_vma insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + insn = (insn & ~0x7c000) | 0x1c000; + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); + } + continue; + + case R_SPARC_TLS_IE_LD: + case R_SPARC_TLS_IE_LDX: + if (! info->shared && (h == NULL || h->dynindx == -1)) + { + bfd_vma insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + int rs2 = insn & 0x1f; + int rd = (insn >> 25) & 0x1f; + + if (rs2 == rd) + relocation = SPARC_NOP; + else + relocation = 0x80100000 | (insn & 0x3e00001f); + bfd_put_32 (output_bfd, relocation, contents + rel->r_offset); + } + continue; + + case R_SPARC_TLS_IE_ADD: + /* Totally useless relocation. */ + continue; + + case R_SPARC_TLS_DTPOFF32: + relocation -= dtpoff_base (info); + break; + default: break; } @@ -1607,8 +2889,35 @@ 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 if (r_type == R_SPARC_TLS_LDO_HIX22 + || r_type == R_SPARC_TLS_LE_HIX22) + { + bfd_vma x; + + relocation += rel->r_addend; + relocation = relocation ^ 0xffffffff; + + x = bfd_get_32 (input_bfd, contents + rel->r_offset); + x = (x & ~(bfd_vma) 0x3fffff) | ((relocation >> 10) & 0x3fffff); + bfd_put_32 (input_bfd, x, contents + rel->r_offset); + r = bfd_reloc_ok; + } + else if (r_type == R_SPARC_TLS_LDO_LOX10 + || r_type == R_SPARC_TLS_LE_LOX10) + { + bfd_vma x; + + relocation += rel->r_addend; + relocation = (relocation & 0x3ff) | 0x1c00; + + x = bfd_get_32 (input_bfd, contents + rel->r_offset); + x = (x & ~(bfd_vma) 0x1fff) | relocation; + bfd_put_32 (input_bfd, x, contents + rel->r_offset); + + r = bfd_reloc_ok; + } else if ((r_type == R_SPARC_WDISP30 || r_type == R_SPARC_WPLT30) - && SEC_DO_RELAX (input_section) + && sec_do_relax (input_section) && rel->r_offset + 4 < input_section->_raw_size) { #define G0 0 @@ -1721,27 +3030,27 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, symtab_hdr->sh_link, sym->st_name); if (name == NULL) - return false; + return FALSE; if (*name == '\0') name = bfd_section_name (input_bfd, sec); } if (! ((*info->callbacks->reloc_overflow) (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset))) - return false; + return FALSE; } break; } } } - return true; + return TRUE; } /* Finish up dynamic symbol handling. We set the contents of various dynamic sections here. */ -static boolean +static bfd_boolean elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) bfd *output_bfd; struct bfd_link_info *info; @@ -1749,22 +3058,25 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) Elf_Internal_Sym *sym; { bfd *dynobj; + struct elf32_sparc_link_hash_table *htab; - dynobj = elf_hash_table (info)->dynobj; + htab = elf32_sparc_hash_table (info); + dynobj = htab->elf.dynobj; if (h->plt.offset != (bfd_vma) -1) { asection *splt; asection *srela; Elf_Internal_Rela rela; + bfd_byte *loc; /* This symbol has an entry in the procedure linkage table. Set - it up. */ + it up. */ BFD_ASSERT (h->dynindx != -1); - splt = bfd_get_section_by_name (dynobj, ".plt"); - srela = bfd_get_section_by_name (dynobj, ".rela.plt"); + splt = htab->splt; + srela = htab->srelplt; BFD_ASSERT (splt != NULL && srela != NULL); /* Fill in the entry in the procedure linkage table. */ @@ -1784,9 +3096,9 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) + h->plt.offset); rela.r_info = ELF32_R_INFO (h->dynindx, R_SPARC_JMP_SLOT); rela.r_addend = 0; - bfd_elf32_swap_reloca_out (output_bfd, &rela, - ((Elf32_External_Rela *) srela->contents - + h->plt.offset / PLT_ENTRY_SIZE - 4)); + loc = srela->contents; + loc += (h->plt.offset / PLT_ENTRY_SIZE - 4) * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { @@ -1803,17 +3115,20 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) } } - if (h->got.offset != (bfd_vma) -1) + if (h->got.offset != (bfd_vma) -1 + && elf32_sparc_hash_entry(h)->tls_type != GOT_TLS_GD + && elf32_sparc_hash_entry(h)->tls_type != GOT_TLS_IE) { asection *sgot; asection *srela; Elf_Internal_Rela rela; + bfd_byte *loc; /* This symbol has an entry in the global offset table. Set it - up. */ + up. */ - sgot = bfd_get_section_by_name (dynobj, ".got"); - srela = bfd_get_section_by_name (dynobj, ".rela.got"); + sgot = htab->sgot; + srela = htab->srelgot; BFD_ASSERT (sgot != NULL && srela != NULL); rela.r_offset = (sgot->output_section->vma @@ -1843,16 +3158,16 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + (h->got.offset &~ (bfd_vma) 1)); - bfd_elf32_swap_reloca_out (output_bfd, &rela, - ((Elf32_External_Rela *) srela->contents - + srela->reloc_count)); - ++srela->reloc_count; + loc = srela->contents; + loc += srela->reloc_count++ * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); } if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) { asection *s; Elf_Internal_Rela rela; + bfd_byte *loc; /* This symbols needs a copy reloc. Set it up. */ @@ -1867,10 +3182,8 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) + h->root.u.def.section->output_offset); rela.r_info = ELF32_R_INFO (h->dynindx, R_SPARC_COPY); rela.r_addend = 0; - bfd_elf32_swap_reloca_out (output_bfd, &rela, - ((Elf32_External_Rela *) s->contents - + s->reloc_count)); - ++s->reloc_count; + loc = s->contents + s->reloc_count++ * sizeof (Elf32_External_Rela); + bfd_elf32_swap_reloca_out (output_bfd, &rela, loc); } /* Mark some specially defined symbols as absolute. */ @@ -1879,21 +3192,22 @@ elf32_sparc_finish_dynamic_symbol (output_bfd, info, h, sym) || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0) sym->st_shndx = SHN_ABS; - return true; + return TRUE; } /* Finish up the dynamic sections. */ -static boolean +static bfd_boolean elf32_sparc_finish_dynamic_sections (output_bfd, info) bfd *output_bfd; struct bfd_link_info *info; { bfd *dynobj; asection *sdyn; - asection *sgot; + struct elf32_sparc_link_hash_table *htab; - dynobj = elf_hash_table (info)->dynobj; + htab = elf32_sparc_hash_table (info); + dynobj = htab->elf.dynobj; sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); @@ -1911,16 +3225,16 @@ elf32_sparc_finish_dynamic_sections (output_bfd, info) { Elf_Internal_Dyn dyn; const char *name; - boolean size; + bfd_boolean size; bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); switch (dyn.d_tag) { - case DT_PLTGOT: name = ".plt"; size = false; break; - case DT_PLTRELSZ: name = ".rela.plt"; size = true; break; - case DT_JMPREL: name = ".rela.plt"; size = false; break; - default: name = NULL; size = false; break; + case DT_PLTGOT: name = ".plt"; size = FALSE; break; + case DT_PLTRELSZ: name = ".rela.plt"; size = TRUE; break; + case DT_JMPREL: name = ".rela.plt"; size = FALSE; break; + default: name = NULL; size = FALSE; break; } if (name != NULL) @@ -1955,27 +3269,25 @@ elf32_sparc_finish_dynamic_sections (output_bfd, info) splt->contents + splt->_raw_size - 4); } - elf_section_data (splt->output_section)->this_hdr.sh_entsize = - PLT_ENTRY_SIZE; + elf_section_data (splt->output_section)->this_hdr.sh_entsize = 0; } /* Set the first entry in the global offset table to the address of the dynamic section. */ - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - if (sgot->_raw_size > 0) + if (htab->sgot && htab->sgot->_raw_size > 0) { if (sdyn == NULL) - bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents); + bfd_put_32 (output_bfd, (bfd_vma) 0, htab->sgot->contents); else bfd_put_32 (output_bfd, sdyn->output_section->vma + sdyn->output_offset, - sgot->contents); + htab->sgot->contents); } - elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 4; + if (htab->sgot) + elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize = 4; - return true; + return TRUE; } /* Functions for dealing with the e_flags field. @@ -1988,24 +3300,24 @@ elf32_sparc_finish_dynamic_sections (output_bfd, info) /* Merge backend specific data from an object file to the output object file when linking. */ -static boolean +static bfd_boolean elf32_sparc_merge_private_bfd_data (ibfd, obfd) bfd *ibfd; bfd *obfd; { - boolean error; + bfd_boolean error; /* FIXME: This should not be static. */ static unsigned long previous_ibfd_e_flags = (unsigned long) -1; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) - return true; + return TRUE; - error = false; + error = FALSE; if (bfd_get_mach (ibfd) >= bfd_mach_sparc_v9) { - error = true; + error = TRUE; (*_bfd_error_handler) (_("%s: compiled for a 64 bit system and target is 32 bit"), bfd_archive_filename (ibfd)); @@ -2023,22 +3335,22 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd) (*_bfd_error_handler) (_("%s: linking little endian files with big endian files"), bfd_archive_filename (ibfd)); - error = true; + error = TRUE; } previous_ibfd_e_flags = elf_elfheader (ibfd)->e_flags & EF_SPARC_LEDATA; if (error) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } - return true; + return TRUE; } /* Set the right machine number. */ -static boolean +static bfd_boolean elf32_sparc_object_p (abfd) bfd *abfd; { @@ -2054,7 +3366,7 @@ elf32_sparc_object_p (abfd) return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, bfd_mach_sparc_v8plus); else - return false; + return FALSE; } else if (elf_elfheader (abfd)->e_flags & EF_SPARC_LEDATA) return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, @@ -2069,7 +3381,7 @@ elf32_sparc_object_p (abfd) static void elf32_sparc_final_write_processing (abfd, linker) bfd *abfd; - boolean linker ATTRIBUTE_UNUSED; + bfd_boolean linker ATTRIBUTE_UNUSED; { switch (bfd_get_mach (abfd)) { @@ -2126,10 +3438,15 @@ elf32_sparc_reloc_type_class (rela) #define ELF_MAXPAGESIZE 0x10000 #define bfd_elf32_bfd_reloc_type_lookup elf32_sparc_reloc_type_lookup +#define bfd_elf32_bfd_link_hash_table_create \ + elf32_sparc_link_hash_table_create #define bfd_elf32_bfd_relax_section elf32_sparc_relax_section +#define bfd_elf32_new_section_hook elf32_sparc_new_section_hook #define elf_info_to_howto elf32_sparc_info_to_howto +#define elf_backend_copy_indirect_symbol \ + elf32_sparc_copy_indirect_symbol #define elf_backend_create_dynamic_sections \ - _bfd_elf_create_dynamic_sections + elf32_sparc_create_dynamic_sections #define elf_backend_check_relocs elf32_sparc_check_relocs #define elf_backend_adjust_dynamic_symbol \ elf32_sparc_adjust_dynamic_symbol @@ -2142,18 +3459,21 @@ elf32_sparc_reloc_type_class (rela) elf32_sparc_finish_dynamic_sections #define bfd_elf32_bfd_merge_private_bfd_data \ elf32_sparc_merge_private_bfd_data +#define bfd_elf32_mkobject elf32_sparc_mkobject #define elf_backend_object_p elf32_sparc_object_p #define elf_backend_final_write_processing \ elf32_sparc_final_write_processing -#define elf_backend_gc_mark_hook elf32_sparc_gc_mark_hook +#define elf_backend_gc_mark_hook elf32_sparc_gc_mark_hook #define elf_backend_gc_sweep_hook elf32_sparc_gc_sweep_hook +#define elf_backend_grok_psinfo elf32_sparc_grok_psinfo #define elf_backend_reloc_type_class elf32_sparc_reloc_type_class #define elf_backend_can_gc_sections 1 +#define elf_backend_can_refcount 1 #define elf_backend_want_got_plt 0 #define elf_backend_plt_readonly 0 #define elf_backend_want_plt_sym 1 #define elf_backend_got_header_size 4 -#define elf_backend_plt_header_size (4*PLT_ENTRY_SIZE) +#define elf_backend_rela_normal 1 #include "elf32-target.h" diff --git a/contrib/binutils/bfd/elf64-alpha.c b/contrib/binutils/bfd/elf64-alpha.c index 7397ed1..2d4715b 100644 --- a/contrib/binutils/bfd/elf64-alpha.c +++ b/contrib/binutils/bfd/elf64-alpha.c @@ -1,23 +1,23 @@ /* Alpha specific support for 64-bit ELF - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Richard Henderson . -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. */ /* We need a published ABI spec for this. Until one comes out, don't assume this'll remain unchanged forever. */ @@ -47,108 +47,112 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define ECOFF_64 #include "ecoffswap.h" -static int alpha_elf_dynamic_symbol_p - PARAMS((struct elf_link_hash_entry *, struct bfd_link_info *)); +static bfd_boolean alpha_elf_dynamic_symbol_p + PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *)); static struct bfd_hash_entry * elf64_alpha_link_hash_newfunc - PARAMS((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); static struct bfd_link_hash_table * elf64_alpha_bfd_link_hash_table_create - PARAMS((bfd *)); + PARAMS ((bfd *)); static bfd_reloc_status_type elf64_alpha_reloc_nil - PARAMS((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type elf64_alpha_reloc_bad - PARAMS((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static bfd_reloc_status_type elf64_alpha_do_reloc_gpdisp - PARAMS((bfd *, bfd_vma, bfd_byte *, bfd_byte *)); + PARAMS ((bfd *, bfd_vma, bfd_byte *, bfd_byte *)); static bfd_reloc_status_type elf64_alpha_reloc_gpdisp - PARAMS((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static reloc_howto_type * elf64_alpha_bfd_reloc_type_lookup - PARAMS((bfd *, bfd_reloc_code_real_type)); + PARAMS ((bfd *, bfd_reloc_code_real_type)); static void elf64_alpha_info_to_howto - PARAMS((bfd *, arelent *, Elf64_Internal_Rela *)); - -static boolean elf64_alpha_mkobject - PARAMS((bfd *)); -static boolean elf64_alpha_object_p - PARAMS((bfd *)); -static boolean elf64_alpha_section_from_shdr - PARAMS((bfd *, Elf64_Internal_Shdr *, const char *)); -static boolean elf64_alpha_section_flags - PARAMS((flagword *, Elf64_Internal_Shdr *)); -static boolean elf64_alpha_fake_sections - PARAMS((bfd *, Elf64_Internal_Shdr *, asection *)); -static boolean elf64_alpha_create_got_section - PARAMS((bfd *, struct bfd_link_info *)); -static boolean elf64_alpha_create_dynamic_sections - PARAMS((bfd *, struct bfd_link_info *)); - -static boolean elf64_alpha_read_ecoff_info - PARAMS((bfd *, asection *, struct ecoff_debug_info *)); -static boolean elf64_alpha_is_local_label_name - PARAMS((bfd *, const char *)); -static boolean elf64_alpha_find_nearest_line - PARAMS((bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *)); + PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); + +static bfd_boolean elf64_alpha_mkobject + PARAMS ((bfd *)); +static bfd_boolean elf64_alpha_object_p + PARAMS ((bfd *)); +static bfd_boolean elf64_alpha_section_from_shdr + PARAMS ((bfd *, Elf_Internal_Shdr *, const char *)); +static bfd_boolean elf64_alpha_section_flags + PARAMS ((flagword *, Elf_Internal_Shdr *)); +static bfd_boolean elf64_alpha_fake_sections + PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); +static bfd_boolean elf64_alpha_create_got_section + PARAMS ((bfd *, struct bfd_link_info *)); +static bfd_boolean elf64_alpha_create_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); + +static bfd_boolean elf64_alpha_read_ecoff_info + PARAMS ((bfd *, asection *, struct ecoff_debug_info *)); +static bfd_boolean elf64_alpha_is_local_label_name + PARAMS ((bfd *, const char *)); +static bfd_boolean elf64_alpha_find_nearest_line + PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, + const char **, unsigned int *)); #if defined(__STDC__) || defined(ALMOST_STDC) struct alpha_elf_link_hash_entry; #endif -static boolean elf64_alpha_output_extsym - PARAMS((struct alpha_elf_link_hash_entry *, PTR)); +static bfd_boolean elf64_alpha_output_extsym + PARAMS ((struct alpha_elf_link_hash_entry *, PTR)); -static boolean elf64_alpha_can_merge_gots - PARAMS((bfd *, bfd *)); +static bfd_boolean elf64_alpha_can_merge_gots + PARAMS ((bfd *, bfd *)); static void elf64_alpha_merge_gots - PARAMS((bfd *, bfd *)); -static boolean elf64_alpha_calc_got_offsets_for_symbol + PARAMS ((bfd *, bfd *)); +static bfd_boolean elf64_alpha_calc_got_offsets_for_symbol PARAMS ((struct alpha_elf_link_hash_entry *, PTR)); -static void elf64_alpha_calc_got_offsets PARAMS ((struct bfd_link_info *)); -static boolean elf64_alpha_size_got_sections +static void elf64_alpha_calc_got_offsets + PARAMS ((struct bfd_link_info *)); +static bfd_boolean elf64_alpha_size_got_sections PARAMS ((struct bfd_link_info *)); -static boolean elf64_alpha_size_plt_section +static bfd_boolean elf64_alpha_size_plt_section PARAMS ((struct bfd_link_info *)); -static boolean elf64_alpha_size_plt_section_1 +static bfd_boolean elf64_alpha_size_plt_section_1 PARAMS ((struct alpha_elf_link_hash_entry *, PTR)); -static boolean elf64_alpha_always_size_sections +static bfd_boolean elf64_alpha_always_size_sections PARAMS ((bfd *, struct bfd_link_info *)); static int alpha_dynamic_entries_for_reloc PARAMS ((int, int, int)); -static boolean elf64_alpha_calc_dynrel_sizes +static bfd_boolean elf64_alpha_calc_dynrel_sizes PARAMS ((struct alpha_elf_link_hash_entry *, struct bfd_link_info *)); -static boolean elf64_alpha_size_rela_got_section +static bfd_boolean elf64_alpha_size_rela_got_section PARAMS ((struct bfd_link_info *)); -static boolean elf64_alpha_size_rela_got_1 +static bfd_boolean elf64_alpha_size_rela_got_1 PARAMS ((struct alpha_elf_link_hash_entry *, struct bfd_link_info *)); -static boolean elf64_alpha_add_symbol_hook - PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, +static bfd_boolean elf64_alpha_add_symbol_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **, flagword *, asection **, bfd_vma *)); static struct alpha_elf_got_entry *get_got_entry PARAMS ((bfd *, struct alpha_elf_link_hash_entry *, unsigned long, unsigned long, bfd_vma)); -static boolean elf64_alpha_check_relocs - PARAMS((bfd *, struct bfd_link_info *, asection *sec, +static bfd_boolean elf64_alpha_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, asection *sec, const Elf_Internal_Rela *)); -static boolean elf64_alpha_adjust_dynamic_symbol - PARAMS((struct bfd_link_info *, struct elf_link_hash_entry *)); -static boolean elf64_alpha_size_dynamic_sections - PARAMS((bfd *, struct bfd_link_info *)); -static boolean elf64_alpha_relocate_section_r - PARAMS((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static boolean elf64_alpha_relocate_section - PARAMS((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, +static bfd_boolean elf64_alpha_adjust_dynamic_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); +static bfd_boolean elf64_alpha_size_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static void elf64_alpha_emit_dynrel + PARAMS ((bfd *, struct bfd_link_info *, asection *, asection *, + bfd_vma, long, long, bfd_vma)); +static bfd_boolean elf64_alpha_relocate_section_r + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); +static bfd_boolean elf64_alpha_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static boolean elf64_alpha_finish_dynamic_symbol - PARAMS((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, - Elf_Internal_Sym *)); -static boolean elf64_alpha_finish_dynamic_sections - PARAMS((bfd *, struct bfd_link_info *)); -static boolean elf64_alpha_final_link - PARAMS((bfd *, struct bfd_link_info *)); -static boolean elf64_alpha_merge_ind_symbols - PARAMS((struct alpha_elf_link_hash_entry *, PTR)); +static bfd_boolean elf64_alpha_finish_dynamic_symbol + PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + Elf_Internal_Sym *)); +static bfd_boolean elf64_alpha_finish_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static bfd_boolean elf64_alpha_final_link + PARAMS ((bfd *, struct bfd_link_info *)); +static bfd_boolean elf64_alpha_merge_ind_symbols + PARAMS ((struct alpha_elf_link_hash_entry *, PTR)); static Elf_Internal_Rela * elf64_alpha_find_reloc_at_ofs PARAMS ((Elf_Internal_Rela *, Elf_Internal_Rela *, bfd_vma, int)); static enum elf_reloc_type_class elf64_alpha_reloc_type_class @@ -173,19 +177,24 @@ struct alpha_elf_link_hash_entry #define ALPHA_ELF_LINK_HASH_LU_TLSLDM 0x20 #define ALPHA_ELF_LINK_HASH_LU_FUNC 0x38 #define ALPHA_ELF_LINK_HASH_TLS_IE 0x40 +#define ALPHA_ELF_LINK_HASH_PLT_LOC 0x80 + + /* Used to undo the localization of a plt symbol. */ + asection *plt_old_section; + bfd_vma plt_old_value; /* Used to implement multiple .got subsections. */ struct alpha_elf_got_entry { struct alpha_elf_got_entry *next; - /* which .got subsection? */ + /* Which .got subsection? */ bfd *gotobj; - /* the addend in effect for this entry. */ + /* The addend in effect for this entry. */ bfd_vma addend; - /* the .got offset for this entry. */ + /* The .got offset for this entry. */ int got_offset; /* How many references to this entry? */ @@ -204,22 +213,22 @@ struct alpha_elf_link_hash_entry unsigned char reloc_xlated; } *got_entries; - /* used to count non-got, non-plt relocations for delayed sizing + /* Used to count non-got, non-plt relocations for delayed sizing of relocation sections. */ struct alpha_elf_reloc_entry { struct alpha_elf_reloc_entry *next; - /* which .reloc section? */ + /* Which .reloc section? */ asection *srel; - /* what kind of relocation? */ + /* What kind of relocation? */ unsigned int rtype; - /* is this against read-only section? */ + /* Is this against read-only section? */ unsigned int reltext : 1; - /* how many did we find? */ + /* How many did we find? */ unsigned long count; } *reloc_entries; }; @@ -247,7 +256,7 @@ struct alpha_elf_link_hash_table #define alpha_elf_link_hash_traverse(table, func, info) \ (elf_link_hash_traverse \ (&(table)->root, \ - (boolean (*) PARAMS ((struct elf_link_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) PARAMS ((struct elf_link_hash_entry *, PTR))) (func), \ (info))) /* Get the Alpha ELF linker hash table from a link_info structure. */ @@ -260,47 +269,17 @@ struct alpha_elf_link_hash_table #define alpha_elf_sym_hashes(abfd) \ ((struct alpha_elf_link_hash_entry **)elf_sym_hashes(abfd)) -/* Should we do dynamic things to this symbol? */ +/* Should we do dynamic things to this symbol? This differs from the + generic version in that we never need to consider function pointer + equality wrt PLT entries -- we don't create a PLT entry if a symbol's + address is ever taken. */ -static int +static inline bfd_boolean alpha_elf_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; - - switch (ELF_ST_VISIBILITY (h->other)) - { - case STV_DEFAULT: - break; - case STV_HIDDEN: - case STV_INTERNAL: - return false; - case STV_PROTECTED: - if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) - return false; - break; - } - - 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; + return _bfd_elf_dynamic_symbol_p (h, info, 0); } /* Create an entry in a Alpha ELF linker hash table. */ @@ -399,30 +378,21 @@ struct alpha_elf_obj_tdata #define alpha_elf_tdata(abfd) \ ((struct alpha_elf_obj_tdata *) (abfd)->tdata.any) -static boolean +static bfd_boolean elf64_alpha_mkobject (abfd) bfd *abfd; { bfd_size_type amt = sizeof (struct alpha_elf_obj_tdata); abfd->tdata.any = bfd_zalloc (abfd, amt); if (abfd->tdata.any == NULL) - return false; - return true; + return FALSE; + return TRUE; } -static boolean +static bfd_boolean elf64_alpha_object_p (abfd) bfd *abfd; { - /* Allocate our special target data. */ - struct alpha_elf_obj_tdata *new_tdata; - bfd_size_type amt = sizeof (struct alpha_elf_obj_tdata); - new_tdata = bfd_zalloc (abfd, amt); - if (new_tdata == NULL) - return false; - new_tdata->root = *abfd->tdata.elf_obj_data; - abfd->tdata.any = new_tdata; - /* Set the right machine number for an Alpha ELF file. */ return bfd_default_set_arch_mach (abfd, bfd_arch_alpha, 0); } @@ -440,45 +410,45 @@ static reloc_howto_type elf64_alpha_howto_table[] = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ elf64_alpha_reloc_nil, /* special_function */ "NONE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* A 32 bit reference to a symbol. */ HOWTO (R_ALPHA_REFLONG, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "REFLONG", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A 64 bit reference to a symbol. */ HOWTO (R_ALPHA_REFQUAD, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "REFQUAD", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ MINUS_ONE, /* src_mask */ MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A 32 bit GP relative offset. This is just like REFLONG except that when the value is used the value of the gp register will be @@ -487,30 +457,30 @@ static reloc_howto_type elf64_alpha_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "GPREL32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Used for an instruction that refers to memory off the GP register. */ HOWTO (R_ALPHA_LITERAL, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "ELF_LITERAL", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* This reloc only appears immediately following an ELF_LITERAL reloc. It identifies a use of the literal. The symbol index is special: @@ -523,15 +493,15 @@ static reloc_howto_type elf64_alpha_howto_table[] = 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ elf64_alpha_reloc_nil, /* special_function */ "LITUSE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Load the gp register. This is always used for a ldah instruction which loads the upper 16 bits of the gp register. The symbol @@ -553,90 +523,90 @@ static reloc_howto_type elf64_alpha_howto_table[] = 16, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ elf64_alpha_reloc_gpdisp, /* special_function */ "GPDISP", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* A 21 bit branch. */ HOWTO (R_ALPHA_BRADDR, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "BRADDR", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* A hint for a jump to a register. */ HOWTO (R_ALPHA_HINT, /* type */ 2, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 14, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ 0, /* special_function */ "HINT", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x3fff, /* src_mask */ 0x3fff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* 16 bit PC relative offset. */ HOWTO (R_ALPHA_SREL16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "SREL16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* 32 bit PC relative offset. */ HOWTO (R_ALPHA_SREL32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "SREL32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* A 64 bit PC relative offset. */ HOWTO (R_ALPHA_SREL64, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "SREL64", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ MINUS_ONE, /* src_mask */ MINUS_ONE, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* Skip 12 - 16; deprecated ECOFF relocs. */ SKIP_HOWTO (12), @@ -650,45 +620,45 @@ static reloc_howto_type elf64_alpha_howto_table[] = 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "GPRELHIGH", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* The low 16 bits of the displacement from GP to the target. */ HOWTO (R_ALPHA_GPRELLOW, 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ 0, /* special_function */ "GPRELLOW", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A 16-bit displacement from the GP to the target. */ HOWTO (R_ALPHA_GPREL16, 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "GPREL16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Skip 20 - 23; deprecated ECOFF relocs. */ SKIP_HOWTO (20), @@ -706,120 +676,120 @@ static reloc_howto_type elf64_alpha_howto_table[] = 0, 0, 0, - false, + FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "COPY", - false, + FALSE, 0, 0, - true), + TRUE), /* A dynamic relocation for a .got entry. */ HOWTO (R_ALPHA_GLOB_DAT, 0, 0, 0, - false, + FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "GLOB_DAT", - false, + FALSE, 0, 0, - true), + TRUE), /* A dynamic relocation for a .plt entry. */ HOWTO (R_ALPHA_JMP_SLOT, 0, 0, 0, - false, + FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "JMP_SLOT", - false, + FALSE, 0, 0, - true), + TRUE), /* A dynamic relocation to add the base of the DSO to a 64-bit field. */ HOWTO (R_ALPHA_RELATIVE, 0, 0, 0, - false, + FALSE, 0, complain_overflow_dont, bfd_elf_generic_reloc, "RELATIVE", - false, + FALSE, 0, 0, - true), + TRUE), /* A 21 bit branch that adjusts for gp loads. */ HOWTO (R_ALPHA_BRSGP, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 21, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "BRSGP", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x1fffff, /* src_mask */ 0x1fffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* Creates a tls_index for the symbol in the got. */ HOWTO (R_ALPHA_TLSGD, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "TLSGD", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Creates a tls_index for the (current) module in the got. */ HOWTO (R_ALPHA_TLSLDM, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "TLSLDM", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A dynamic relocation for a DTP module entry. */ HOWTO (R_ALPHA_DTPMOD64, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "DTPMOD64", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ MINUS_ONE, /* src_mask */ MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Creates a 64-bit offset in the got for the displacement from DTP to the target. */ @@ -827,75 +797,75 @@ static reloc_howto_type elf64_alpha_howto_table[] = 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "GOTDTPREL", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A dynamic relocation for a displacement from DTP to the target. */ HOWTO (R_ALPHA_DTPREL64, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "DTPREL64", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ MINUS_ONE, /* src_mask */ MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* The high 16 bits of the displacement from DTP to the target. */ HOWTO (R_ALPHA_DTPRELHI, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "DTPRELHI", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* The low 16 bits of the displacement from DTP to the target. */ HOWTO (R_ALPHA_DTPRELLO, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ 0, /* special_function */ "DTPRELLO", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A 16-bit displacement from DTP to the target. */ HOWTO (R_ALPHA_DTPREL16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "DTPREL16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Creates a 64-bit offset in the got for the displacement from TP to the target. */ @@ -903,75 +873,75 @@ static reloc_howto_type elf64_alpha_howto_table[] = 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "GOTTPREL", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A dynamic relocation for a displacement from TP to the target. */ HOWTO (R_ALPHA_TPREL64, /* type */ 0, /* rightshift */ 4, /* size (0 = byte, 1 = short, 2 = long) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ 0, /* special_function */ "TPREL64", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ MINUS_ONE, /* src_mask */ MINUS_ONE, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* The high 16 bits of the displacement from TP to the target. */ HOWTO (R_ALPHA_TPRELHI, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "TPRELHI", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* The low 16 bits of the displacement from TP to the target. */ HOWTO (R_ALPHA_TPRELLO, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ 0, /* special_function */ "TPRELLO", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A 16-bit displacement from TP to the target. */ HOWTO (R_ALPHA_TPREL16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ 0, /* special_function */ "TPREL16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffff, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ }; /* A relocation function which doesn't do anything. */ @@ -1165,7 +1135,7 @@ static void elf64_alpha_info_to_howto (abfd, cache_ptr, dst) bfd *abfd ATTRIBUTE_UNUSED; arelent *cache_ptr; - Elf64_Internal_Rela *dst; + Elf_Internal_Rela *dst; { unsigned r_type; @@ -1179,13 +1149,15 @@ elf64_alpha_info_to_howto (abfd, cache_ptr, dst) (r_type == R_ALPHA_TLSGD || r_type == R_ALPHA_TLSLDM ? 16 : 8) /* This is PT_TLS segment p_vaddr. */ -#define alpha_get_dtprel_base(tlss) \ - ((tlss)->start) +#define alpha_get_dtprel_base(info) \ + (elf_hash_table (info)->tls_sec->vma) /* Main program TLS (whose template starts at PT_TLS p_vaddr) is assigned offset round(16, PT_TLS p_align). */ -#define alpha_get_tprel_base(tlss) \ - ((tlss)->start - align_power ((bfd_vma) 16, (tlss)->align)) +#define alpha_get_tprel_base(info) \ + (elf_hash_table (info)->tls_sec->vma \ + - align_power ((bfd_vma) 16, \ + elf_hash_table (info)->tls_sec->alignment_power)) /* These functions do relaxation for Alpha ELF. @@ -1219,37 +1191,34 @@ struct alpha_relax_info Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Rela *relocs, *relend; struct bfd_link_info *link_info; - struct elf_link_tls_segment *tls_segment; bfd_vma gp; bfd *gotobj; asection *tsec; struct alpha_elf_link_hash_entry *h; struct alpha_elf_got_entry **first_gotent; struct alpha_elf_got_entry *gotent; - boolean changed_contents; - boolean changed_relocs; + bfd_boolean changed_contents; + bfd_boolean changed_relocs; unsigned char other; }; -static boolean elf64_alpha_relax_with_lituse +static bfd_boolean elf64_alpha_relax_with_lituse PARAMS((struct alpha_relax_info *info, bfd_vma symval, Elf_Internal_Rela *irel)); static bfd_vma elf64_alpha_relax_opt_call PARAMS((struct alpha_relax_info *info, bfd_vma symval)); -static boolean elf64_alpha_relax_got_load +static bfd_boolean elf64_alpha_relax_got_load PARAMS((struct alpha_relax_info *info, bfd_vma symval, Elf_Internal_Rela *irel, unsigned long)); -static boolean elf64_alpha_relax_gprelhilo +static bfd_boolean elf64_alpha_relax_gprelhilo PARAMS((struct alpha_relax_info *info, bfd_vma symval, - Elf_Internal_Rela *irel, boolean)); -static boolean elf64_alpha_relax_tls_get_addr + Elf_Internal_Rela *irel, bfd_boolean)); +static bfd_boolean elf64_alpha_relax_tls_get_addr PARAMS((struct alpha_relax_info *info, bfd_vma symval, - Elf_Internal_Rela *irel, boolean)); -static struct elf_link_tls_segment *elf64_alpha_relax_find_tls_segment - PARAMS((struct alpha_relax_info *, struct elf_link_tls_segment *)); -static boolean elf64_alpha_relax_section + Elf_Internal_Rela *irel, bfd_boolean)); +static bfd_boolean elf64_alpha_relax_section PARAMS((bfd *abfd, asection *sec, struct bfd_link_info *link_info, - boolean *again)); + bfd_boolean *again)); static Elf_Internal_Rela * elf64_alpha_find_reloc_at_ofs (rel, relend, offset, type) @@ -1267,7 +1236,7 @@ elf64_alpha_find_reloc_at_ofs (rel, relend, offset, type) return NULL; } -static boolean +static bfd_boolean elf64_alpha_relax_with_lituse (info, symval, irel) struct alpha_relax_info *info; bfd_vma symval; @@ -1276,10 +1245,10 @@ elf64_alpha_relax_with_lituse (info, symval, irel) Elf_Internal_Rela *urel, *irelend = info->relend; int flags, count, i; bfd_signed_vma disp; - boolean fits16; - boolean fits32; - boolean lit_reused = false; - boolean all_optimized = true; + bfd_boolean fits16; + bfd_boolean fits32; + bfd_boolean lit_reused = FALSE; + bfd_boolean all_optimized = TRUE; unsigned int lit_insn; lit_insn = bfd_get_32 (info->abfd, info->contents + irel->r_offset); @@ -1289,12 +1258,12 @@ elf64_alpha_relax_with_lituse (info, symval, irel) ("%s: %s+0x%lx: warning: LITERAL relocation against unexpected insn", bfd_archive_filename (info->abfd), info->sec->name, (unsigned long) irel->r_offset)); - return true; + return TRUE; } /* Can't relax dynamic symbols. */ if (alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info)) - return true; + return TRUE; /* Summarize how this particular LITERAL is used. */ for (urel = irel+1, flags = count = 0; urel < irelend; ++urel, ++count) @@ -1322,7 +1291,7 @@ elf64_alpha_relax_with_lituse (info, symval, irel) default: /* This type is really just a placeholder to note that all uses cannot be optimized, but to still allow some. */ - all_optimized = false; + all_optimized = FALSE; break; case LITUSE_ALPHA_BASE: @@ -1348,11 +1317,11 @@ elf64_alpha_relax_with_lituse (info, symval, irel) urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), R_ALPHA_GPREL16); urel->r_addend = irel->r_addend; - info->changed_relocs = true; + info->changed_relocs = TRUE; bfd_put_32 (info->abfd, (bfd_vma) insn, info->contents + urel->r_offset); - info->changed_contents = true; + info->changed_contents = TRUE; } /* If all mem+byte, we can optimize 32-bit mem displacements. */ @@ -1365,16 +1334,16 @@ elf64_alpha_relax_with_lituse (info, symval, irel) lit_insn = (OP_LDAH << 26) | (lit_insn & 0x03ff0000); bfd_put_32 (info->abfd, (bfd_vma) lit_insn, info->contents + irel->r_offset); - lit_reused = true; - info->changed_contents = true; + lit_reused = TRUE; + info->changed_contents = TRUE; urel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), R_ALPHA_GPRELLOW); urel->r_addend = irel->r_addend; - info->changed_relocs = true; + info->changed_relocs = TRUE; } else - all_optimized = false; + all_optimized = FALSE; break; case LITUSE_ALPHA_BYTOFF: @@ -1388,11 +1357,11 @@ elf64_alpha_relax_with_lituse (info, symval, irel) urel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); urel->r_addend = 0; - info->changed_relocs = true; + info->changed_relocs = TRUE; bfd_put_32 (info->abfd, (bfd_vma) insn, info->contents + urel->r_offset); - info->changed_contents = true; + info->changed_contents = TRUE; break; case LITUSE_ALPHA_JSR: @@ -1426,7 +1395,7 @@ elf64_alpha_relax_with_lituse (info, symval, irel) if (optdest) urel->r_addend += optdest - symval; else - all_optimized = false; + all_optimized = FALSE; bfd_put_32 (info->abfd, (bfd_vma) insn, info->contents + urel->r_offset); @@ -1438,11 +1407,11 @@ elf64_alpha_relax_with_lituse (info, symval, irel) if (xrel) xrel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); - info->changed_contents = true; - info->changed_relocs = true; + info->changed_contents = TRUE; + info->changed_relocs = TRUE; } else - all_optimized = false; + all_optimized = FALSE; /* Even if the target is not in range for a direct branch, if we share a GP, we can eliminate the gp reload. */ @@ -1470,8 +1439,8 @@ elf64_alpha_relax_with_lituse (info, symval, irel) bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, p_lda); gpdisp->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); - info->changed_contents = true; - info->changed_relocs = true; + info->changed_contents = TRUE; + info->changed_relocs = TRUE; } } } @@ -1499,15 +1468,15 @@ elf64_alpha_relax_with_lituse (info, symval, irel) if (!lit_reused) { irel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); - info->changed_relocs = true; + info->changed_relocs = TRUE; bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, info->contents + irel->r_offset); - info->changed_contents = true; + info->changed_contents = TRUE; } } - return true; + return TRUE; } static bfd_vma @@ -1545,7 +1514,7 @@ elf64_alpha_relax_opt_call (info, symval) } else { - tsec_relocs = (_bfd_elf64_link_read_relocs + tsec_relocs = (_bfd_elf_link_read_relocs (info->abfd, info->tsec, (PTR) NULL, (Elf_Internal_Rela *) NULL, info->link_info->keep_memory)); @@ -1582,7 +1551,7 @@ elf64_alpha_relax_opt_call (info, symval) return symval + 8; } -static boolean +static bfd_boolean elf64_alpha_relax_got_load (info, symval, irel, r_type) struct alpha_relax_info *info; bfd_vma symval; @@ -1602,16 +1571,16 @@ elf64_alpha_relax_got_load (info, symval, irel, r_type) ("%s: %s+0x%lx: warning: %s relocation against unexpected insn", bfd_archive_filename (info->abfd), info->sec->name, (unsigned long) irel->r_offset, howto->name)); - return true; + return TRUE; } /* Can't relax dynamic symbols. */ if (alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info)) - return true; + return TRUE; /* Can't use local-exec relocations in shared libraries. */ if (r_type == R_ALPHA_GOTTPREL && info->link_info->shared) - return true; + return TRUE; if (r_type == R_ALPHA_LITERAL) disp = symval - info->gp; @@ -1619,14 +1588,14 @@ elf64_alpha_relax_got_load (info, symval, irel, r_type) { bfd_vma dtp_base, tp_base; - BFD_ASSERT (info->tls_segment != NULL); - dtp_base = alpha_get_dtprel_base (info->tls_segment); - tp_base = alpha_get_tprel_base (info->tls_segment); + BFD_ASSERT (elf_hash_table (info->link_info)->tls_sec != NULL); + dtp_base = alpha_get_dtprel_base (info->link_info); + tp_base = alpha_get_tprel_base (info->link_info); disp = symval - (r_type == R_ALPHA_GOTDTPREL ? dtp_base : tp_base); } if (disp < -0x8000 || disp >= 0x8000) - return true; + return TRUE; /* Exchange LDQ for LDA. In the case of the TLS relocs, we're loading a constant, so force the base register to be $31. */ @@ -1635,8 +1604,19 @@ elf64_alpha_relax_got_load (info, symval, irel, r_type) else insn = (OP_LDA << 26) | (insn & (31 << 21)) | (31 << 16); bfd_put_32 (info->abfd, (bfd_vma) insn, info->contents + irel->r_offset); - info->changed_contents = true; + info->changed_contents = TRUE; + + /* Reduce the use count on this got entry by one, possibly + eliminating it. */ + if (--info->gotent->use_count == 0) + { + int sz = alpha_got_entry_size (r_type); + alpha_elf_tdata (info->gotobj)->total_got_size -= sz; + if (!info->h) + alpha_elf_tdata (info->gotobj)->local_got_size -= sz; + } + /* Smash the existing GOT relocation for its 16-bit immediate pair. */ switch (r_type) { case R_ALPHA_LITERAL: @@ -1650,21 +1630,11 @@ elf64_alpha_relax_got_load (info, symval, irel, r_type) break; default: BFD_ASSERT (0); - return false; + return FALSE; } irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), r_type); - info->changed_relocs = true; - - /* Reduce the use count on this got entry by one, possibly - eliminating it. */ - if (--info->gotent->use_count == 0) - { - int sz = alpha_got_entry_size (r_type); - alpha_elf_tdata (info->gotobj)->total_got_size -= sz; - if (!info->h) - alpha_elf_tdata (info->gotobj)->local_got_size -= sz; - } + info->changed_relocs = TRUE; /* ??? Search forward through this basic block looking for insns that use the target register. Stop after an insn modifying the @@ -1679,15 +1649,15 @@ elf64_alpha_relax_got_load (info, symval, irel, r_type) This would mean that we'd have to _add_ relocations, the pain of which gives one pause. */ - return true; + return TRUE; } -static boolean +static bfd_boolean elf64_alpha_relax_gprelhilo (info, symval, irel, hi) struct alpha_relax_info *info; bfd_vma symval; Elf_Internal_Rela *irel; - boolean hi; + bfd_boolean hi; { unsigned int insn; bfd_signed_vma disp; @@ -1703,22 +1673,22 @@ elf64_alpha_relax_gprelhilo (info, symval, irel, hi) which would indeed be the most efficient way to implement this. */ - return true; + return TRUE; disp = symval - info->gp; if (disp < -0x8000 || disp >= 0x8000) - return true; + return TRUE; if (hi) { /* Nop out the high instruction. */ bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos); - info->changed_contents = true; + info->changed_contents = TRUE; irel->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); irel->r_addend = 0; - info->changed_relocs = true; + info->changed_relocs = TRUE; } else { @@ -1727,35 +1697,31 @@ elf64_alpha_relax_gprelhilo (info, symval, irel, hi) insn = bfd_get_32 (info->abfd, pos); insn = (insn & 0xffe00000) | (29 << 16); bfd_put_32 (info->abfd, (bfd_vma) insn, pos); - info->changed_contents = true; + info->changed_contents = TRUE; irel->r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), R_ALPHA_GPREL16); - info->changed_relocs = true; + info->changed_relocs = TRUE; } - return true; + return TRUE; } -static boolean +static bfd_boolean elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) struct alpha_relax_info *info; bfd_vma symval; Elf_Internal_Rela *irel; - boolean is_gd; + bfd_boolean is_gd; { bfd_byte *pos[5]; unsigned int insn; Elf_Internal_Rela *gpdisp, *hint; - boolean dynamic, use_gottprel; + bfd_boolean dynamic, use_gottprel, pos1_unusable; + unsigned long new_symndx; dynamic = alpha_elf_dynamic_symbol_p (&info->h->root, info->link_info); - /* ??? For LD relaxation, we need a symbol referencing the beginning - of the TLS segment. */ - if (!is_gd) - return true; - /* If a TLS symbol is accessed using IE at least once, there is no point to use dynamic model for it. */ if (is_gd && info->h && (info->h->flags & ALPHA_ELF_LINK_HASH_TLS_IE)) @@ -1769,39 +1735,44 @@ elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) /* Otherwise we must be building an executable to do anything. */ else if (info->link_info->shared) - return true; + return TRUE; /* The TLSGD/TLSLDM relocation must be followed by a LITERAL and the matching LITUSE_TLS relocations. */ if (irel + 2 >= info->relend) - return true; + return TRUE; if (ELF64_R_TYPE (irel[1].r_info) != R_ALPHA_LITERAL || ELF64_R_TYPE (irel[2].r_info) != R_ALPHA_LITUSE || irel[2].r_addend != (is_gd ? LITUSE_ALPHA_TLSGD : LITUSE_ALPHA_TLSLDM)) - return true; + return TRUE; /* There must be a GPDISP relocation positioned immediately after the LITUSE relocation. */ gpdisp = elf64_alpha_find_reloc_at_ofs (info->relocs, info->relend, irel[2].r_offset + 4, R_ALPHA_GPDISP); if (!gpdisp) - return true; + return TRUE; pos[0] = info->contents + irel[0].r_offset; pos[1] = info->contents + irel[1].r_offset; pos[2] = info->contents + irel[2].r_offset; pos[3] = info->contents + gpdisp->r_offset; pos[4] = pos[3] + gpdisp->r_addend; + pos1_unusable = FALSE; - /* Only positions 0 and 1 are allowed to be out of order. */ - if (pos[1] < pos[0]) + /* Generally, the positions are not allowed to be out of order, lest the + modified insn sequence have different register lifetimes. We can make + an exception when pos 1 is adjacent to pos 0. */ + if (pos[1] + 4 == pos[0]) { bfd_byte *tmp = pos[0]; pos[0] = pos[1]; pos[1] = tmp; } - if (pos[1] >= pos[2] || pos[2] >= pos[3] || pos[3] >= pos[4]) - return true; + else if (pos[1] < pos[0]) + pos1_unusable = TRUE; + if (pos[1] >= pos[2] || pos[2] >= pos[3]) + return TRUE; /* Reduce the use count on the LITERAL relocation. Do this before we smash the symndx when we adjust the relocations below. */ @@ -1855,7 +1826,8 @@ elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) as appropriate. */ - use_gottprel = false; + use_gottprel = FALSE; + new_symndx = is_gd ? ELF64_R_SYM (irel->r_info) : 0; switch (!dynamic && !info->link_info->shared) { case 1: @@ -1863,8 +1835,8 @@ elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) bfd_vma tp_base; bfd_signed_vma disp; - BFD_ASSERT (info->tls_segment != NULL); - tp_base = alpha_get_tprel_base (info->tls_segment); + BFD_ASSERT (elf_hash_table (info->link_info)->tls_sec != NULL); + tp_base = alpha_get_tprel_base (info->link_info); disp = symval - tp_base; if (disp >= -0x8000 && disp < 0x8000) @@ -1874,13 +1846,13 @@ elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos[1]); irel[0].r_offset = pos[0] - info->contents; - irel[0].r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), - R_ALPHA_TPREL16); + irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_TPREL16); irel[1].r_info = ELF64_R_INFO (0, R_ALPHA_NONE); break; } else if (disp >= -(bfd_signed_vma) 0x80000000 - && disp < (bfd_signed_vma) 0x7fff8000) + && disp < (bfd_signed_vma) 0x7fff8000 + && !pos1_unusable) { insn = (OP_LDAH << 26) | (16 << 21) | (31 << 16); bfd_put_32 (info->abfd, (bfd_vma) insn, pos[0]); @@ -1888,26 +1860,23 @@ elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) bfd_put_32 (info->abfd, (bfd_vma) insn, pos[1]); irel[0].r_offset = pos[0] - info->contents; - irel[0].r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), - R_ALPHA_TPRELHI); + irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_TPRELHI); irel[1].r_offset = pos[1] - info->contents; - irel[1].r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), - R_ALPHA_TPRELLO); + irel[1].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_TPRELLO); break; } } /* FALLTHRU */ default: - use_gottprel = true; + use_gottprel = TRUE; insn = (OP_LDQ << 26) | (16 << 21) | (29 << 16); bfd_put_32 (info->abfd, (bfd_vma) insn, pos[0]); bfd_put_32 (info->abfd, (bfd_vma) INSN_UNOP, pos[1]); irel[0].r_offset = pos[0] - info->contents; - irel[0].r_info = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), - R_ALPHA_GOTTPREL); + irel[0].r_info = ELF64_R_INFO (new_symndx, R_ALPHA_GOTTPREL); irel[1].r_info = ELF64_R_INFO (0, R_ALPHA_NONE); break; } @@ -1927,8 +1896,8 @@ elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) if (hint) hint->r_info = ELF64_R_INFO (0, R_ALPHA_NONE); - info->changed_contents = true; - info->changed_relocs = true; + info->changed_contents = TRUE; + info->changed_relocs = TRUE; /* Reduce the use count on the TLSGD/TLSLDM relocation. */ if (--info->gotent->use_count == 0) @@ -1962,7 +1931,7 @@ elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) tprel_gotent = (struct alpha_elf_got_entry *) bfd_alloc (info->abfd, sizeof (struct alpha_elf_got_entry)); if (!tprel_gotent) - return false; + return FALSE; tprel_gotent->next = *info->first_gotent; *info->first_gotent = tprel_gotent; @@ -1979,62 +1948,15 @@ elf64_alpha_relax_tls_get_addr (info, symval, irel, is_gd) } } - return true; + return TRUE; } -static struct elf_link_tls_segment * -elf64_alpha_relax_find_tls_segment (info, seg) - struct alpha_relax_info *info; - struct elf_link_tls_segment *seg; -{ - bfd *output_bfd = info->sec->output_section->owner; - asection *o; - unsigned int align; - bfd_vma base, end; - - for (o = output_bfd->sections; o ; o = o->next) - if ((o->flags & SEC_THREAD_LOCAL) != 0 - && (o->flags & SEC_LOAD) != 0) - break; - if (!o) - return NULL; - - base = o->vma; - align = 0; - - do - { - bfd_vma size; - - if (bfd_get_section_alignment (output_bfd, o) > align) - align = bfd_get_section_alignment (output_bfd, o); - - size = o->_raw_size; - if (size == 0 && (o->flags & SEC_HAS_CONTENTS) == 0) - { - struct bfd_link_order *lo; - for (lo = o->link_order_head; lo ; lo = lo->next) - if (size < lo->offset + lo->size) - size = lo->offset + lo->size; - } - end = o->vma + size; - o = o->next; - } - while (o && (o->flags & SEC_THREAD_LOCAL)); - - seg->start = base; - seg->size = end - base; - seg->align = align; - - return seg; -} - -static boolean +static bfd_boolean elf64_alpha_relax_section (abfd, sec, link_info, again) bfd *abfd; asection *sec; struct bfd_link_info *link_info; - boolean *again; + bfd_boolean *again; { Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Rela *internal_relocs; @@ -2042,15 +1964,14 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) Elf_Internal_Sym *isymbuf = NULL; struct alpha_elf_got_entry **local_got_entries; struct alpha_relax_info info; - struct elf_link_tls_segment tls_segment; /* We are not currently changing any sizes, so only one pass. */ - *again = false; + *again = FALSE; - if (link_info->relocateable + if (link_info->relocatable || (sec->flags & SEC_RELOC) == 0 || sec->reloc_count == 0) - return true; + return TRUE; /* If this is the first time we have been called for this section, initialize the cooked size. */ @@ -2061,11 +1982,11 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) local_got_entries = alpha_elf_tdata(abfd)->local_got_entries; /* Load the relocations for this section. */ - internal_relocs = (_bfd_elf64_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); if (internal_relocs == NULL) - return false; + return FALSE; memset(&info, 0, sizeof (info)); info.abfd = abfd; @@ -2100,16 +2021,12 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) goto error_return; } - /* Compute the TLS segment information. The version normally found in - elf_hash_table (link_info)->tls_segment isn't built until final_link. - ??? Probably should look into extracting this into a common function. */ - info.tls_segment = elf64_alpha_relax_find_tls_segment (&info, &tls_segment); - for (irel = internal_relocs; irel < irelend; irel++) { bfd_vma symval; struct alpha_elf_got_entry *gotent; unsigned long r_type = ELF64_R_TYPE (irel->r_info); + unsigned long r_symndx = ELF64_R_SYM (irel->r_info); /* Early exit for unhandled or unrelaxable relocations. */ switch (r_type) @@ -2120,14 +2037,20 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) case R_ALPHA_GOTDTPREL: case R_ALPHA_GOTTPREL: case R_ALPHA_TLSGD: + break; + case R_ALPHA_TLSLDM: + /* The symbol for a TLSLDM reloc is ignored. Collapse the + reloc to the 0 symbol so that they all match. */ + r_symndx = 0; break; + default: continue; } /* Get the value of the symbol referred to by the reloc. */ - if (ELF64_R_SYM (irel->r_info) < symtab_hdr->sh_info) + if (r_symndx < symtab_hdr->sh_info) { /* A local symbol. */ Elf_Internal_Sym *isym; @@ -2144,27 +2067,44 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) goto error_return; } - isym = isymbuf + ELF64_R_SYM (irel->r_info); - if (isym->st_shndx == SHN_UNDEF) - continue; - else if (isym->st_shndx == SHN_ABS) - info.tsec = bfd_abs_section_ptr; - else if (isym->st_shndx == SHN_COMMON) - info.tsec = bfd_com_section_ptr; + isym = isymbuf + r_symndx; + + /* Given the symbol for a TLSLDM reloc is ignored, this also + means forcing the symbol value to the tp base. */ + if (r_type == R_ALPHA_TLSLDM) + { + info.tsec = bfd_abs_section_ptr; + symval = alpha_get_tprel_base (info.link_info); + } else - info.tsec = bfd_section_from_elf_index (abfd, isym->st_shndx); + { + symval = isym->st_value; + if (isym->st_shndx == SHN_UNDEF) + continue; + else if (isym->st_shndx == SHN_ABS) + info.tsec = bfd_abs_section_ptr; + else if (isym->st_shndx == SHN_COMMON) + info.tsec = bfd_com_section_ptr; + else + info.tsec = bfd_section_from_elf_index (abfd, isym->st_shndx); + } info.h = NULL; info.other = isym->st_other; - info.first_gotent = &local_got_entries[ELF64_R_SYM(irel->r_info)]; - symval = isym->st_value; + if (local_got_entries) + info.first_gotent = &local_got_entries[r_symndx]; + else + { + info.first_gotent = &info.gotent; + info.gotent = NULL; + } } else { unsigned long indx; struct alpha_elf_link_hash_entry *h; - indx = ELF64_R_SYM (irel->r_info) - symtab_hdr->sh_info; + indx = r_symndx - symtab_hdr->sh_info; h = alpha_elf_sym_hashes (abfd)[indx]; BFD_ASSERT (h != NULL); @@ -2180,13 +2120,23 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) /* If the symbol isn't defined in the current module, again we can't do anything. */ if (!(h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) - continue; + { + /* Except for TLSGD relocs, which can sometimes be + relaxed to GOTTPREL relocs. */ + if (r_type != R_ALPHA_TLSGD) + continue; + info.tsec = bfd_abs_section_ptr; + symval = 0; + } + else + { + info.tsec = h->root.root.u.def.section; + symval = h->root.root.u.def.value; + } info.h = h; - info.tsec = h->root.root.u.def.section; info.other = h->root.other; info.first_gotent = &h->got_entries; - symval = h->root.root.u.def.value; } /* Search for the got entry to be used by this relocation. */ @@ -2246,11 +2196,11 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) } if (!elf64_alpha_size_plt_section (link_info)) - return false; + return FALSE; if (!elf64_alpha_size_got_sections (link_info)) - return false; + return FALSE; if (!elf64_alpha_size_rela_got_section (link_info)) - return false; + return FALSE; if (isymbuf != NULL && symtab_hdr->contents != (unsigned char *) isymbuf) @@ -2286,7 +2236,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) *again = info.changed_contents || info.changed_relocs; - return true; + return TRUE; error_return: if (isymbuf != NULL @@ -2298,7 +2248,7 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) if (internal_relocs != NULL && elf_section_data (sec)->relocs != internal_relocs) free (internal_relocs); - return false; + return FALSE; } /* PLT/GOT Stuff */ @@ -2322,10 +2272,10 @@ elf64_alpha_relax_section (abfd, sec, link_info, again) FIXME: We need to handle the SHF_ALPHA_GPREL flag, but I'm not sure how to. */ -static boolean +static bfd_boolean elf64_alpha_section_from_shdr (abfd, hdr, name) bfd *abfd; - Elf64_Internal_Shdr *hdr; + Elf_Internal_Shdr *hdr; const char *name; { asection *newsect; @@ -2339,14 +2289,14 @@ elf64_alpha_section_from_shdr (abfd, hdr, name) { case SHT_ALPHA_DEBUG: if (strcmp (name, ".mdebug") != 0) - return false; + return FALSE; break; default: - return false; + return FALSE; } if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) - return false; + return FALSE; newsect = hdr->bfd_section; if (hdr->sh_type == SHT_ALPHA_DEBUG) @@ -2354,32 +2304,32 @@ elf64_alpha_section_from_shdr (abfd, hdr, name) if (! bfd_set_section_flags (abfd, newsect, (bfd_get_section_flags (abfd, newsect) | SEC_DEBUGGING))) - return false; + return FALSE; } - return true; + return TRUE; } /* Convert Alpha specific section flags to bfd internal section flags. */ -static boolean +static bfd_boolean elf64_alpha_section_flags (flags, hdr) flagword *flags; - Elf64_Internal_Shdr *hdr; + Elf_Internal_Shdr *hdr; { if (hdr->sh_flags & SHF_ALPHA_GPREL) *flags |= SEC_SMALL_DATA; - return true; + return TRUE; } /* Set the correct type for an Alpha ELF section. We do this by the section name, which is a hack, but ought to work. */ -static boolean +static bfd_boolean elf64_alpha_fake_sections (abfd, hdr, sec) bfd *abfd; - Elf64_Internal_Shdr *hdr; + Elf_Internal_Shdr *hdr; asection *sec; { register const char *name; @@ -2403,24 +2353,24 @@ elf64_alpha_fake_sections (abfd, hdr, sec) || strcmp (name, ".lit8") == 0) hdr->sh_flags |= SHF_ALPHA_GPREL; - return true; + return TRUE; } /* 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 +static bfd_boolean elf64_alpha_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd *abfd; struct bfd_link_info *info; - const Elf_Internal_Sym *sym; + 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 + && !info->relocatable && sym->st_size <= elf_gp_size (abfd)) { /* Common symbols less than or equal to -G nn bytes are @@ -2435,27 +2385,32 @@ elf64_alpha_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) || !bfd_set_section_flags (abfd, scomm, (SEC_ALLOC | SEC_IS_COMMON | SEC_LINKER_CREATED))) - return false; + return FALSE; } *secp = scomm; *valp = sym->st_size; } - return true; + return TRUE; } /* Create the .got section. */ -static boolean +static bfd_boolean elf64_alpha_create_got_section(abfd, info) bfd *abfd; struct bfd_link_info *info ATTRIBUTE_UNUSED; { asection *s; - if (bfd_get_section_by_name (abfd, ".got")) - return true; + if ((s = bfd_get_section_by_name (abfd, ".got"))) + { + /* Check for a non-linker created .got? */ + if (alpha_elf_tdata (abfd)->got == NULL) + alpha_elf_tdata (abfd)->got = s; + return TRUE; + } s = bfd_make_section (abfd, ".got"); if (s == NULL @@ -2464,16 +2419,16 @@ elf64_alpha_create_got_section(abfd, info) | SEC_IN_MEMORY | SEC_LINKER_CREATED)) || !bfd_set_section_alignment (abfd, s, 3)) - return false; + return FALSE; alpha_elf_tdata (abfd)->got = s; - return true; + return TRUE; } /* Create all the dynamic sections. */ -static boolean +static bfd_boolean elf64_alpha_create_dynamic_sections (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -2492,23 +2447,23 @@ elf64_alpha_create_dynamic_sections (abfd, info) | SEC_LINKER_CREATED | SEC_CODE)) || ! bfd_set_section_alignment (abfd, s, 3)) - return false; + return FALSE; /* Define the symbol _PROCEDURE_LINKAGE_TABLE_ at the start of the .plt section. */ bh = NULL; if (! (_bfd_generic_link_add_one_symbol (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s, - (bfd_vma) 0, (const char *) NULL, false, + (bfd_vma) 0, (const char *) NULL, FALSE, get_elf_backend_data (abfd)->collect, &bh))) - return false; + return FALSE; h = (struct elf_link_hash_entry *) bh; h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; h->type = STT_OBJECT; if (info->shared - && ! _bfd_elf_link_record_dynamic_symbol (info, h)) - return false; + && ! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; s = bfd_make_section (abfd, ".rela.plt"); if (s == NULL @@ -2518,13 +2473,13 @@ elf64_alpha_create_dynamic_sections (abfd, info) | SEC_LINKER_CREATED | SEC_READONLY)) || ! bfd_set_section_alignment (abfd, s, 3)) - return false; + return FALSE; /* We may or may not have created a .got section for this object, but we definitely havn't done the rest of the work. */ if (!elf64_alpha_create_got_section (abfd, info)) - return false; + return FALSE; s = bfd_make_section(abfd, ".rela.got"); if (s == NULL @@ -2534,7 +2489,7 @@ elf64_alpha_create_dynamic_sections (abfd, info) | SEC_LINKER_CREATED | SEC_READONLY)) || !bfd_set_section_alignment (abfd, s, 3)) - return false; + return FALSE; /* Define the symbol _GLOBAL_OFFSET_TABLE_ at the start of the dynobj's .got section. We don't do this in the linker script @@ -2544,25 +2499,25 @@ elf64_alpha_create_dynamic_sections (abfd, info) if (!(_bfd_generic_link_add_one_symbol (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, alpha_elf_tdata(abfd)->got, (bfd_vma) 0, (const char *) NULL, - false, get_elf_backend_data (abfd)->collect, &bh))) - return false; + FALSE, get_elf_backend_data (abfd)->collect, &bh))) + return FALSE; h = (struct elf_link_hash_entry *) bh; h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; h->type = STT_OBJECT; if (info->shared - && ! _bfd_elf_link_record_dynamic_symbol (info, h)) - return false; + && ! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; elf_hash_table (info)->hgot = h; - return true; + return TRUE; } /* Read ECOFF debugging information from a .mdebug section into a ecoff_debug_info structure. */ -static boolean +static bfd_boolean elf64_alpha_read_ecoff_info (abfd, section, debug) bfd *abfd; asection *section; @@ -2619,7 +2574,7 @@ elf64_alpha_read_ecoff_info (abfd, section, debug) debug->fdr = NULL; debug->adjust = NULL; - return true; + return TRUE; error_return: if (ext_hdr != NULL) @@ -2646,12 +2601,12 @@ elf64_alpha_read_ecoff_info (abfd, section, debug) free (debug->external_rfd); if (debug->external_ext != NULL) free (debug->external_ext); - return false; + return FALSE; } /* Alpha ELF local labels start with '$'. */ -static boolean +static bfd_boolean elf64_alpha_is_local_label_name (abfd, name) bfd *abfd ATTRIBUTE_UNUSED; const char *name; @@ -2670,7 +2625,7 @@ struct mips_elf_find_line struct ecoff_find_line i; }; -static boolean +static bfd_boolean elf64_alpha_find_nearest_line (abfd, section, symbols, offset, filename_ptr, functionname_ptr, line_ptr) bfd *abfd; @@ -2687,7 +2642,7 @@ elf64_alpha_find_nearest_line (abfd, section, symbols, offset, filename_ptr, filename_ptr, functionname_ptr, line_ptr, 0, &elf_tdata (abfd)->dwarf2_find_line_info)) - return true; + return TRUE; msec = bfd_get_section_by_name (abfd, ".mdebug"); if (msec != NULL) @@ -2717,13 +2672,13 @@ elf64_alpha_find_nearest_line (abfd, section, symbols, offset, filename_ptr, if (fi == NULL) { msec->flags = origflags; - return false; + return FALSE; } if (!elf64_alpha_read_ecoff_info (abfd, msec, &fi->d)) { msec->flags = origflags; - return false; + return FALSE; } /* Swap in the FDR information. */ @@ -2732,7 +2687,7 @@ elf64_alpha_find_nearest_line (abfd, section, symbols, offset, filename_ptr, if (fi->d.fdr == NULL) { msec->flags = origflags; - return false; + return FALSE; } external_fdr_size = swap->external_fdr_size; fdr_ptr = fi->d.fdr; @@ -2757,7 +2712,7 @@ elf64_alpha_find_nearest_line (abfd, section, symbols, offset, filename_ptr, line_ptr)) { msec->flags = origflags; - return true; + return TRUE; } msec->flags = origflags; @@ -2778,39 +2733,39 @@ struct extsym_info struct bfd_link_info *info; struct ecoff_debug_info *debug; const struct ecoff_debug_swap *swap; - boolean failed; + bfd_boolean failed; }; -static boolean +static bfd_boolean elf64_alpha_output_extsym (h, data) struct alpha_elf_link_hash_entry *h; PTR data; { struct extsym_info *einfo = (struct extsym_info *) data; - boolean strip; + bfd_boolean strip; asection *sec, *output_section; if (h->root.root.type == bfd_link_hash_warning) h = (struct alpha_elf_link_hash_entry *) h->root.root.u.i.link; if (h->root.indx == -2) - strip = false; + strip = FALSE; else if (((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 || (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0) && (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 && (h->root.elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0) - strip = true; + strip = TRUE; else if (einfo->info->strip == strip_all || (einfo->info->strip == strip_some && bfd_hash_lookup (einfo->info->keep_hash, h->root.root.root.string, - false, false) == NULL)) - strip = true; + FALSE, FALSE) == NULL)) + strip = TRUE; else - strip = false; + strip = FALSE; if (strip) - return true; + return TRUE; if (h->esym.ifd == -2) { @@ -2908,11 +2863,11 @@ elf64_alpha_output_extsym (h, data) h->root.root.root.string, &h->esym)) { - einfo->failed = true; - return false; + einfo->failed = TRUE; + return FALSE; } - return true; + return TRUE; } /* Search for and possibly create a got entry. */ @@ -2996,7 +2951,7 @@ get_got_entry (abfd, h, r_type, r_symndx, r_addend) /* Handle dynamic relocations when doing an Alpha ELF link. */ -static boolean +static bfd_boolean elf64_alpha_check_relocs (abfd, info, sec, relocs) bfd *abfd; struct bfd_link_info *info; @@ -3009,11 +2964,11 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) Elf_Internal_Shdr *symtab_hdr; struct alpha_elf_link_hash_entry **sym_hashes; const Elf_Internal_Rela *rel, *relend; - boolean got_created; + bfd_boolean got_created; bfd_size_type amt; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; dynobj = elf_hash_table(info)->dynobj; if (dynobj == NULL) @@ -3023,7 +2978,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) rel_sec_name = NULL; symtab_hdr = &elf_tdata(abfd)->symtab_hdr; sym_hashes = alpha_elf_sym_hashes(abfd); - got_created = false; + got_created = FALSE; relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; ++rel) @@ -3037,7 +2992,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) unsigned long r_symndx, r_type; struct alpha_elf_link_hash_entry *h; unsigned int gotent_flags; - boolean maybe_dynamic; + bfd_boolean maybe_dynamic; unsigned int need; bfd_vma addend; @@ -3059,12 +3014,12 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) 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; + maybe_dynamic = FALSE; if (h && ((info->shared - && (!info->symbolic || info->allow_shlib_undefined)) + && (!info->symbolic || info->unresolved_syms_in_shared_libs == RM_IGNORE)) || ! (h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) || h->root.root.type == bfd_link_hash_defweak)) - maybe_dynamic = true; + maybe_dynamic = TRUE; need = 0; gotent_flags = 0; @@ -3104,8 +3059,15 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) need = NEED_DYNREL; break; - case R_ALPHA_TLSGD: case R_ALPHA_TLSLDM: + /* The symbol for a TLSLDM reloc is ignored. Collapse the + reloc to the 0 symbol so that they all match. */ + r_symndx = 0; + h = 0; + maybe_dynamic = FALSE; + /* FALLTHRU */ + + case R_ALPHA_TLSGD: case R_ALPHA_GOTDTPREL: need = NEED_GOT | NEED_GOT_ENTRY; break; @@ -3130,7 +3092,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) if (!got_created) { if (!elf64_alpha_create_got_section (abfd, info)) - return false; + return FALSE; /* Make sure the object's gotobj is set to itself so that we default to every object with its own .got. @@ -3148,7 +3110,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) gotent = get_got_entry (abfd, h, r_type, r_symndx, addend); if (!gotent) - return false; + return FALSE; if (gotent_flags) { @@ -3176,7 +3138,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) (abfd, elf_elfheader(abfd)->e_shstrndx, elf_section_data(sec)->rel_hdr.sh_name)); if (rel_sec_name == NULL) - return false; + return FALSE; BFD_ASSERT (strncmp (rel_sec_name, ".rela", 5) == 0 && strcmp (bfd_get_section_name (abfd, sec), @@ -3202,7 +3164,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) if (sreloc == NULL || !bfd_set_section_flags (dynobj, sreloc, flags) || !bfd_set_section_alignment (dynobj, sreloc, 3)) - return false; + return FALSE; } } @@ -3225,7 +3187,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) amt = sizeof (struct alpha_elf_reloc_entry); rent = (struct alpha_elf_reloc_entry *) bfd_alloc (abfd, amt); if (!rent) - return false; + return FALSE; rent->srel = sreloc; rent->rtype = r_type; @@ -3251,7 +3213,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) } } - return true; + return TRUE; } /* Adjust a symbol defined by a dynamic object and referenced by a @@ -3260,7 +3222,7 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs) change the definition to something the rest of the link can understand. */ -static boolean +static bfd_boolean elf64_alpha_adjust_dynamic_symbol (info, h) struct bfd_link_info *info; struct elf_link_hash_entry *h; @@ -3291,7 +3253,7 @@ elf64_alpha_adjust_dynamic_symbol (info, h) s = bfd_get_section_by_name(dynobj, ".plt"); if (!s && !elf64_alpha_create_dynamic_sections (dynobj, info)) - return false; + return FALSE; /* The first bit of the .plt is reserved. */ if (s->_raw_size == 0) @@ -3307,6 +3269,9 @@ elf64_alpha_adjust_dynamic_symbol (info, h) if (! info->shared && h->root.type != bfd_link_hash_defweak) { + ah->plt_old_section = h->root.u.def.section; + ah->plt_old_value = h->root.u.def.value; + ah->flags |= ALPHA_ELF_LINK_HASH_PLT_LOC; h->root.u.def.section = s; h->root.u.def.value = h->plt.offset; } @@ -3316,7 +3281,7 @@ elf64_alpha_adjust_dynamic_symbol (info, h) BFD_ASSERT (s != NULL); s->_raw_size += sizeof (Elf64_External_Rela); - return true; + return TRUE; } else h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; @@ -3330,7 +3295,7 @@ elf64_alpha_adjust_dynamic_symbol (info, h) || 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; + return TRUE; } /* This is a reference to a symbol defined by a dynamic object which @@ -3338,14 +3303,14 @@ elf64_alpha_adjust_dynamic_symbol (info, h) symbols even in regular objects, does not need the hackery of a .dynbss section and COPY dynamic relocations. */ - return true; + return TRUE; } /* Symbol versioning can create new symbols, and make our old symbols indirect to the new ones. Consolidate the got and reloc information in these situations. */ -static boolean +static bfd_boolean elf64_alpha_merge_ind_symbols (hi, dummy) struct alpha_elf_link_hash_entry *hi; PTR dummy ATTRIBUTE_UNUSED; @@ -3353,7 +3318,7 @@ elf64_alpha_merge_ind_symbols (hi, dummy) struct alpha_elf_link_hash_entry *hs; if (hi->root.root.type != bfd_link_hash_indirect) - return true; + return TRUE; hs = hi; do { hs = (struct alpha_elf_link_hash_entry *)hs->root.root.u.i.link; @@ -3416,12 +3381,12 @@ elf64_alpha_merge_ind_symbols (hi, dummy) } hi->reloc_entries = NULL; - return true; + return TRUE; } /* Is it possible to merge two object file's .got tables? */ -static boolean +static bfd_boolean elf64_alpha_can_merge_gots (a, b) bfd *a, *b; { @@ -3430,11 +3395,11 @@ elf64_alpha_can_merge_gots (a, b) /* Trivial quick fallout test. */ if (total + alpha_elf_tdata (b)->total_got_size <= MAX_GOT_SIZE) - return true; + return TRUE; /* By their nature, local .got entries cannot be merged. */ if ((total += alpha_elf_tdata (b)->local_got_size) > MAX_GOT_SIZE) - return false; + return FALSE; /* Failing the common trivial comparison, we must effectively perform the merge. Not actually performing the merge means that @@ -3471,13 +3436,13 @@ elf64_alpha_can_merge_gots (a, b) total += alpha_got_entry_size (be->reloc_type); if (total > MAX_GOT_SIZE) - return false; + return FALSE; global_found:; } } } - return true; + return TRUE; } /* Actually merge two .got tables. */ @@ -3577,11 +3542,12 @@ elf64_alpha_merge_gots (a, b) /* Calculate the offsets for the got entries. */ -static boolean +static bfd_boolean elf64_alpha_calc_got_offsets_for_symbol (h, arg) struct alpha_elf_link_hash_entry *h; PTR arg ATTRIBUTE_UNUSED; { + bfd_boolean result = TRUE; struct alpha_elf_got_entry *gotent; if (h->root.root.type == bfd_link_hash_warning) @@ -3590,14 +3556,23 @@ elf64_alpha_calc_got_offsets_for_symbol (h, arg) for (gotent = h->got_entries; gotent; gotent = gotent->next) if (gotent->use_count > 0) { - bfd_size_type *plge - = &alpha_elf_tdata (gotent->gotobj)->got->_raw_size; + struct alpha_elf_obj_tdata *td; + bfd_size_type *plge; + td = alpha_elf_tdata (gotent->gotobj); + if (td == NULL) + { + _bfd_error_handler (_("Symbol %s has no GOT subsection for offset 0x%x"), + h->root.root.root.string, gotent->got_offset); + result = FALSE; + continue; + } + plge = &td->got->_raw_size; gotent->got_offset = *plge; *plge += alpha_got_entry_size (gotent->reloc_type); } - return true; + return result; } static void @@ -3647,7 +3622,7 @@ elf64_alpha_calc_got_offsets (info) /* Constructs the gots. */ -static boolean +static bfd_boolean elf64_alpha_size_got_sections (info) struct bfd_link_info *info; { @@ -3666,7 +3641,7 @@ elf64_alpha_size_got_sections (info) if (this_got == NULL) continue; - /* We are assuming no merging has yet ocurred. */ + /* We are assuming no merging has yet occurred. */ BFD_ASSERT (this_got == i); if (alpha_elf_tdata (this_got)->total_got_size > MAX_GOT_SIZE) @@ -3676,7 +3651,7 @@ elf64_alpha_size_got_sections (info) (_("%s: .got subsegment exceeds 64K (size %d)"), bfd_archive_filename (i), alpha_elf_tdata (this_got)->total_got_size); - return false; + return FALSE; } if (got_list == NULL) @@ -3688,7 +3663,7 @@ elf64_alpha_size_got_sections (info) /* Strange degenerate case of no got references. */ if (got_list == NULL) - return true; + return TRUE; alpha_elf_hash_table (info)->got_list = got_list; @@ -3719,13 +3694,13 @@ elf64_alpha_size_got_sections (info) if (1 || something_changed) elf64_alpha_calc_got_offsets (info); - return true; + return TRUE; } /* Called from relax_section to rebuild the PLT in light of potential changes in the function's status. */ -static boolean +static bfd_boolean elf64_alpha_size_plt_section (info) struct bfd_link_info *info; { @@ -3736,7 +3711,7 @@ elf64_alpha_size_plt_section (info) dynobj = elf_hash_table(info)->dynobj; splt = bfd_get_section_by_name(dynobj, ".plt"); if (splt == NULL) - return true; + return TRUE; splt->_raw_size = 0; @@ -3754,10 +3729,10 @@ elf64_alpha_size_plt_section (info) spltrel->_raw_size = entries * sizeof (Elf64_External_Rela); spltrel->_cooked_size = spltrel->_raw_size; - return true; + return TRUE; } -static boolean +static bfd_boolean elf64_alpha_size_plt_section_1 (h, data) struct alpha_elf_link_hash_entry *h; PTR data; @@ -3767,7 +3742,7 @@ elf64_alpha_size_plt_section_1 (h, data) /* If we didn't need an entry before, we still don't. */ if (!(h->root.elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT)) - return true; + return TRUE; /* There must still be a LITERAL got entry for the function. */ for (gotent = h->got_entries; gotent ; gotent = gotent->next) @@ -3788,20 +3763,28 @@ elf64_alpha_size_plt_section_1 (h, data) { h->root.elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; h->root.plt.offset = -1; + + /* Undo the definition frobbing begun in adjust_dynamic_symbol. */ + if (h->flags & ALPHA_ELF_LINK_HASH_PLT_LOC) + { + h->root.root.u.def.section = h->plt_old_section; + h->root.root.u.def.value = h->plt_old_value; + h->flags &= ~ALPHA_ELF_LINK_HASH_PLT_LOC; + } } - return true; + return TRUE; } -static boolean +static bfd_boolean elf64_alpha_always_size_sections (output_bfd, info) bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *i; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; /* First, take care of the indirect symbols created by versioning. */ alpha_elf_link_hash_traverse (alpha_elf_hash_table (info), @@ -3809,7 +3792,7 @@ elf64_alpha_always_size_sections (output_bfd, info) NULL); if (!elf64_alpha_size_got_sections (info)) - return false; + return FALSE; /* Allocate space for all of the .got subsections. */ i = alpha_elf_hash_table (info)->got_list; @@ -3820,11 +3803,11 @@ elf64_alpha_always_size_sections (output_bfd, info) { s->contents = (bfd_byte *) bfd_zalloc (i, s->_raw_size); if (s->contents == NULL) - return false; + return FALSE; } } - return true; + return TRUE; } /* The number of dynamic relocations required by a static relocation. */ @@ -3841,18 +3824,16 @@ alpha_dynamic_entries_for_reloc (r_type, dynamic, shared) case R_ALPHA_TLSLDM: return shared; case R_ALPHA_LITERAL: + case R_ALPHA_GOTTPREL: return dynamic || shared; case R_ALPHA_GOTDTPREL: - case R_ALPHA_GOTTPREL: return dynamic; /* May appear in data sections. */ case R_ALPHA_REFLONG: case R_ALPHA_REFQUAD: - return dynamic || shared; - case R_ALPHA_SREL64: case R_ALPHA_TPREL64: - return dynamic; + return dynamic || shared; /* Everything else is illegal. We'll issue an error during relocate_section. */ @@ -3863,12 +3844,12 @@ alpha_dynamic_entries_for_reloc (r_type, dynamic, shared) /* Work out the sizes of the dynamic relocation entries. */ -static boolean +static bfd_boolean elf64_alpha_calc_dynrel_sizes (h, info) struct alpha_elf_link_hash_entry *h; struct bfd_link_info *info; { - boolean dynamic; + bfd_boolean dynamic; struct alpha_elf_reloc_entry *relent; unsigned long entries; @@ -3911,12 +3892,12 @@ elf64_alpha_calc_dynrel_sizes (h, info) } } - return true; + return TRUE; } /* Set the sizes of the dynamic relocation sections. */ -static boolean +static bfd_boolean elf64_alpha_size_rela_got_section (info) struct bfd_link_info *info; { @@ -3956,7 +3937,7 @@ elf64_alpha_size_rela_got_section (info) if (!srel) { BFD_ASSERT (entries == 0); - return true; + return TRUE; } srel->_raw_size = sizeof (Elf64_External_Rela) * entries; @@ -3966,18 +3947,18 @@ elf64_alpha_size_rela_got_section (info) srel->_cooked_size = srel->_raw_size; - return true; + return TRUE; } /* Subroutine of elf64_alpha_size_rela_got_section for doing the global symbols. */ -static boolean +static bfd_boolean elf64_alpha_size_rela_got_1 (h, info) struct alpha_elf_link_hash_entry *h; struct bfd_link_info *info; { - boolean dynamic; + bfd_boolean dynamic; struct alpha_elf_got_entry *gotent; unsigned long entries; @@ -4009,19 +3990,19 @@ elf64_alpha_size_rela_got_1 (h, info) srel->_raw_size += sizeof (Elf64_External_Rela) * entries; } - return true; + return TRUE; } /* Set the sizes of the dynamic sections. */ -static boolean +static bfd_boolean elf64_alpha_size_dynamic_sections (output_bfd, info) bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { bfd *dynobj; asection *s; - boolean relplt; + bfd_boolean relplt; dynobj = elf_hash_table(info)->dynobj; BFD_ASSERT(dynobj != NULL); @@ -4029,7 +4010,7 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (!info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); @@ -4051,11 +4032,11 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ - relplt = false; + relplt = FALSE; for (s = dynobj->sections; s != NULL; s = s->next) { const char *name; - boolean strip; + bfd_boolean strip; if (!(s->flags & SEC_LINKER_CREATED)) continue; @@ -4072,7 +4053,7 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) it is that function which decides whether anything needs to go into these sections. */ - strip = false; + strip = FALSE; if (strncmp (name, ".rela", 5) == 0) { @@ -4081,7 +4062,7 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) if (!strip) { if (strcmp(name, ".rela.plt") == 0) - relplt = true; + relplt = TRUE; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -4101,7 +4082,7 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) /* Allocate memory for the section contents. */ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) - return false; + return FALSE; } } @@ -4113,12 +4094,12 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ #define add_dynamic_entry(TAG, VAL) \ - bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + _bfd_elf_add_dynamic_entry (info, TAG, VAL) - if (!info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) - return false; + return FALSE; } if (relplt) @@ -4127,23 +4108,55 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) || !add_dynamic_entry (DT_PLTRELSZ, 0) || !add_dynamic_entry (DT_PLTREL, DT_RELA) || !add_dynamic_entry (DT_JMPREL, 0)) - return false; + return FALSE; } if (!add_dynamic_entry (DT_RELA, 0) || !add_dynamic_entry (DT_RELASZ, 0) || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) - return false; + return FALSE; if (info->flags & DF_TEXTREL) { if (!add_dynamic_entry (DT_TEXTREL, 0)) - return false; + return FALSE; } } #undef add_dynamic_entry - return true; + return TRUE; +} + +/* Emit a dynamic relocation for (DYNINDX, RTYPE, ADDEND) at (SEC, OFFSET) + into the next available slot in SREL. */ + +static void +elf64_alpha_emit_dynrel (abfd, info, sec, srel, offset, dynindx, rtype, addend) + bfd *abfd; + struct bfd_link_info *info; + asection *sec, *srel; + bfd_vma offset, addend; + long dynindx, rtype; +{ + Elf_Internal_Rela outrel; + bfd_byte *loc; + + BFD_ASSERT (srel != NULL); + + outrel.r_info = ELF64_R_INFO (dynindx, rtype); + outrel.r_addend = addend; + + offset = _bfd_elf_section_offset (abfd, info, sec, offset); + if ((offset | 1) != (bfd_vma) -1) + outrel.r_offset = sec->output_section->vma + sec->output_offset + offset; + else + memset (&outrel, 0, sizeof (outrel)); + + loc = srel->contents; + loc += srel->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (abfd, &outrel, loc); + BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count + <= srel->_cooked_size); } /* Relocate an Alpha ELF section for a relocatable link. @@ -4152,7 +4165,7 @@ elf64_alpha_size_dynamic_sections (output_bfd, info) symbol, in which case we have to adjust according to where the section symbol winds up in the output section. */ -static boolean +static bfd_boolean elf64_alpha_relocate_section_r (output_bfd, info, input_bfd, input_section, contents, relocs, local_syms, local_sections) bfd *output_bfd ATTRIBUTE_UNUSED; @@ -4167,7 +4180,7 @@ elf64_alpha_relocate_section_r (output_bfd, info, input_bfd, input_section, unsigned long symtab_hdr_sh_info; Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - boolean ret_val = true; + bfd_boolean ret_val = TRUE; symtab_hdr_sh_info = elf_tdata (input_bfd)->symtab_hdr.sh_info; @@ -4186,7 +4199,7 @@ elf64_alpha_relocate_section_r (output_bfd, info, input_bfd, input_section, (_("%s: unknown relocation type %d"), bfd_archive_filename (input_bfd), (int)r_type); bfd_set_error (bfd_error_bad_value); - ret_val = false; + ret_val = FALSE; continue; } @@ -4213,7 +4226,7 @@ elf64_alpha_relocate_section_r (output_bfd, info, input_bfd, input_section, /* Relocate an Alpha ELF section. */ -static boolean +static bfd_boolean elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, local_syms, local_sections) bfd *output_bfd; @@ -4228,23 +4241,22 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Shdr *symtab_hdr; Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - struct elf_link_tls_segment *tls_segment; asection *sgot, *srel, *srelgot; bfd *dynobj, *gotobj; bfd_vma gp, tp_base, dtp_base; struct alpha_elf_got_entry **local_got_entries; - boolean ret_val; + bfd_boolean ret_val; const char *section_name; /* Handle relocatable links with a smaller loop. */ - if (info->relocateable) + if (info->relocatable) return elf64_alpha_relocate_section_r (output_bfd, info, input_bfd, input_section, contents, relocs, local_syms, local_sections); /* This is a final link. */ - ret_val = true; + ret_val = TRUE; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -4282,11 +4294,10 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, local_got_entries = alpha_elf_tdata(input_bfd)->local_got_entries; - tls_segment = elf_hash_table (info)->tls_segment; - if (tls_segment) + if (elf_hash_table (info)->tls_sec != NULL) { - dtp_base = alpha_get_dtprel_base (tls_segment); - tp_base = alpha_get_tprel_base (tls_segment); + dtp_base = alpha_get_dtprel_base (info); + tp_base = alpha_get_tprel_base (info); } else dtp_base = tp_base = 0; @@ -4303,8 +4314,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, asection *sec = NULL; bfd_vma value; bfd_vma addend; - boolean dynamic_symbol_p; - boolean undef_weak_ref = false; + bfd_boolean dynamic_symbol_p; + bfd_boolean undef_weak_ref = FALSE; unsigned long r_type; r_type = ELF64_R_TYPE(rel->r_info); @@ -4314,18 +4325,37 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, (_("%s: unknown relocation type %d"), bfd_archive_filename (input_bfd), (int)r_type); bfd_set_error (bfd_error_bad_value); - ret_val = false; + ret_val = FALSE; continue; } howto = elf64_alpha_howto_table + r_type; r_symndx = ELF64_R_SYM(rel->r_info); + /* The symbol for a TLSLDM reloc is ignored. Collapse the + reloc to the 0 symbol so that they all match. */ + if (r_type == R_ALPHA_TLSLDM) + r_symndx = 0; + if (r_symndx < symtab_hdr->sh_info) { + asection *msec; sym = local_syms + r_symndx; sec = local_sections[r_symndx]; - value = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); + msec = sec; + value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel); + + /* If this is a tp-relative relocation against sym 0, + this is hackery from relax_section. Force the value to + be the tls base. */ + if (r_symndx == 0 + && (r_type == R_ALPHA_TLSLDM + || r_type == R_ALPHA_GOTTPREL + || r_type == R_ALPHA_TPREL64 + || r_type == R_ALPHA_TPRELHI + || r_type == R_ALPHA_TPRELLO + || r_type == R_ALPHA_TPREL16)) + value = tp_base; if (local_got_entries) gotent = local_got_entries[r_symndx]; @@ -4336,13 +4366,11 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, unless it has been done already. */ if ((sec->flags & SEC_MERGE) && ELF_ST_TYPE (sym->st_info) == STT_SECTION - && (elf_section_data (sec)->sec_info_type - == ELF_INFO_TYPE_MERGE) + && sec->sec_info_type == ELF_INFO_TYPE_MERGE && gotent && !gotent->reloc_xlated) { struct alpha_elf_got_entry *ent; - asection *msec; for (ent = gotent; ent; ent = ent->next) { @@ -4364,54 +4392,29 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, } } - dynamic_symbol_p = false; + dynamic_symbol_p = FALSE; } else { - h = alpha_elf_sym_hashes (input_bfd)[r_symndx - symtab_hdr->sh_info]; + bfd_boolean warned; + bfd_boolean unresolved_reloc; + struct elf_link_hash_entry *hh; + struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd); - while (h->root.root.type == bfd_link_hash_indirect - || h->root.root.type == bfd_link_hash_warning) - h = (struct alpha_elf_link_hash_entry *)h->root.root.u.i.link; + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + hh, sec, value, + unresolved_reloc, warned); - value = 0; - if (h->root.root.type == bfd_link_hash_defined - || h->root.root.type == bfd_link_hash_defweak) - { - sec = h->root.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 (sec->output_section != NULL) - value = (h->root.root.u.def.value - + sec->output_section->vma - + sec->output_offset); - } - else if (h->root.root.type == bfd_link_hash_undefweak) - undef_weak_ref = true; - else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) - && !info->no_undefined - && ELF_ST_VISIBILITY (h->root.other) == STV_DEFAULT) - ; - else - { - if (!((*info->callbacks->undefined_symbol) - (info, h->root.root.root.string, input_bfd, - input_section, rel->r_offset, - (!info->shared || info->no_undefined - || ELF_ST_VISIBILITY (h->root.other))))) - return false; - ret_val = false; - continue; - } + if (warned) + continue; + + if (value == 0 + && ! unresolved_reloc + && hh->root.type == bfd_link_hash_undefweak) + undef_weak_ref = TRUE; + h = (struct alpha_elf_link_hash_entry *) hh; dynamic_symbol_p = alpha_elf_dynamic_symbol_p (&h->root, info); gotent = h->got_entries; } @@ -4463,25 +4466,9 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, RELATIVE reloc, otherwise it will be handled in finish_dynamic_symbol. */ if (info->shared && !dynamic_symbol_p) - { - Elf_Internal_Rela outrel; - - BFD_ASSERT(srelgot != NULL); - - outrel.r_offset = (sgot->output_section->vma - + sgot->output_offset - + gotent->got_offset); - outrel.r_info = ELF64_R_INFO (0, R_ALPHA_RELATIVE); - outrel.r_addend = value; - - bfd_elf64_swap_reloca_out (output_bfd, &outrel, - ((Elf64_External_Rela *) - srelgot->contents) - + srelgot->reloc_count++); - BFD_ASSERT (sizeof (Elf64_External_Rela) - * srelgot->reloc_count - <= srelgot->_cooked_size); - } + elf64_alpha_emit_dynrel (output_bfd, info, sgot, srelgot, + gotent->got_offset, 0, + R_ALPHA_RELATIVE, value); } value = (sgot->output_section->vma @@ -4490,15 +4477,27 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, value -= gp; goto default_reloc; - case R_ALPHA_GPREL16: case R_ALPHA_GPREL32: + /* If the target section was a removed linkonce section, + r_symndx will be zero. In this case, assume that the + switch will not be used, so don't fill it in. If we + do nothing here, we'll get relocation truncated messages, + due to the placement of the application above 4GB. */ + if (r_symndx == 0) + { + r = bfd_reloc_ok; + break; + } + /* FALLTHRU */ + + case R_ALPHA_GPREL16: case R_ALPHA_GPRELLOW: if (dynamic_symbol_p) { (*_bfd_error_handler) (_("%s: gp-relative relocation against dynamic symbol %s"), bfd_archive_filename (input_bfd), h->root.root.root.string); - ret_val = false; + ret_val = FALSE; } BFD_ASSERT(gp != 0); value -= gp; @@ -4510,7 +4509,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: gp-relative relocation against dynamic symbol %s"), bfd_archive_filename (input_bfd), h->root.root.root.string); - ret_val = false; + ret_val = FALSE; } BFD_ASSERT(gp != 0); value -= gp; @@ -4536,7 +4535,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: pc-relative relocation against dynamic symbol %s"), bfd_archive_filename (input_bfd), h->root.root.root.string); - ret_val = false; + ret_val = FALSE; } /* The regular PC-relative stuff measures from the start of the instruction rather than the end. */ @@ -4564,7 +4563,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: change in gp: BRSGP %s"), bfd_archive_filename (input_bfd), h->root.root.root.string); - ret_val = false; + ret_val = FALSE; } /* The symbol should be marked either NOPV or STD_GPLOAD. */ @@ -4594,7 +4593,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: !samegp reloc against symbol without .prologue: %s"), bfd_archive_filename (input_bfd), name); - ret_val = false; + ret_val = FALSE; break; } @@ -4606,7 +4605,8 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, case R_ALPHA_DTPREL64: case R_ALPHA_TPREL64: { - Elf_Internal_Rela outrel; + long dynindx, dyntype = r_type; + bfd_vma dynaddend; /* Careful here to remember RELATIVE relocations for global variables for symbolic shared objects. */ @@ -4614,21 +4614,26 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, if (dynamic_symbol_p) { BFD_ASSERT(h->root.dynindx != -1); - outrel.r_info = ELF64_R_INFO (h->root.dynindx, r_type); - outrel.r_addend = addend; + dynindx = h->root.dynindx; + dynaddend = addend; addend = 0, value = 0; } else if (r_type == R_ALPHA_DTPREL64) { - BFD_ASSERT(tls_segment != NULL); + BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL); value -= dtp_base; goto default_reloc; } else if (r_type == R_ALPHA_TPREL64) { - BFD_ASSERT(tls_segment != NULL); - value -= dtp_base; - goto default_reloc; + BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL); + if (!info->shared) + { + value -= tp_base; + goto default_reloc; + } + dynindx = 0; + dynaddend = value - dtp_base; } else if (info->shared && r_symndx != 0 @@ -4640,31 +4645,18 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, (_("%s: unhandled dynamic relocation against %s"), bfd_archive_filename (input_bfd), h->root.root.root.string); - ret_val = false; + ret_val = FALSE; } - outrel.r_info = ELF64_R_INFO (0, R_ALPHA_RELATIVE); - outrel.r_addend = value; + dynindx = 0; + dyntype = R_ALPHA_RELATIVE; + dynaddend = value; } else goto default_reloc; - BFD_ASSERT(srel != NULL); - - outrel.r_offset = - _bfd_elf_section_offset (output_bfd, info, input_section, - rel->r_offset); - if ((outrel.r_offset | 1) != (bfd_vma) -1) - outrel.r_offset += (input_section->output_section->vma - + input_section->output_offset); - else - memset (&outrel, 0, sizeof outrel); - - bfd_elf64_swap_reloca_out (output_bfd, &outrel, - ((Elf64_External_Rela *) - srel->contents) - + srel->reloc_count++); - BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count - <= srel->_cooked_size); + elf64_alpha_emit_dynrel (output_bfd, info, input_section, + srel, rel->r_offset, dynindx, + dyntype, dynaddend); } goto default_reloc; @@ -4676,7 +4668,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: pc-relative relocation against dynamic symbol %s"), bfd_archive_filename (input_bfd), h->root.root.root.string); - ret_val = false; + ret_val = FALSE; } /* ??? .eh_frame references to discarded sections will be smashed @@ -4706,32 +4698,15 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, DTPMOD64 reloc, otherwise it will be handled in finish_dynamic_symbol. */ if (info->shared && !dynamic_symbol_p) - { - Elf_Internal_Rela outrel; - - BFD_ASSERT(srelgot != NULL); - - outrel.r_offset = (sgot->output_section->vma - + sgot->output_offset - + gotent->got_offset); - /* ??? Proper dynindx here. */ - outrel.r_info = ELF64_R_INFO (0, R_ALPHA_DTPMOD64); - outrel.r_addend = 0; - - bfd_elf64_swap_reloca_out (output_bfd, &outrel, - ((Elf64_External_Rela *) - srelgot->contents) - + srelgot->reloc_count++); - BFD_ASSERT (sizeof (Elf64_External_Rela) - * srelgot->reloc_count - <= srelgot->_cooked_size); - } + elf64_alpha_emit_dynrel (output_bfd, info, sgot, srelgot, + gotent->got_offset, 0, + R_ALPHA_DTPMOD64, 0); if (dynamic_symbol_p || r_type == R_ALPHA_TLSLDM) value = 0; else { - BFD_ASSERT(tls_segment != NULL); + BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL); value -= dtp_base; } bfd_put_64 (output_bfd, value, @@ -4752,9 +4727,9 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: dtp-relative relocation against dynamic symbol %s"), bfd_archive_filename (input_bfd), h->root.root.root.string); - ret_val = false; + ret_val = FALSE; } - BFD_ASSERT(tls_segment != NULL); + BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL); value -= dtp_base; if (r_type == R_ALPHA_DTPRELHI) value = ((bfd_signed_vma) value >> 16) + ((value >> 15) & 1); @@ -4768,16 +4743,16 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: TLS local exec code cannot be linked into shared objects"), bfd_archive_filename (input_bfd)); - ret_val = false; + ret_val = FALSE; } else if (dynamic_symbol_p) { (*_bfd_error_handler) (_("%s: tp-relative relocation against dynamic symbol %s"), bfd_archive_filename (input_bfd), h->root.root.root.string); - ret_val = false; + ret_val = FALSE; } - BFD_ASSERT(tls_segment != NULL); + BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL); value -= tp_base; if (r_type == R_ALPHA_TPRELHI) value = ((bfd_signed_vma) value >> 16) + ((value >> 15) & 1); @@ -4798,8 +4773,19 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, value = 0; else { - BFD_ASSERT(tls_segment != NULL); - value -= (r_type == R_ALPHA_GOTDTPREL ? dtp_base : tp_base); + BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL); + if (r_type == R_ALPHA_GOTDTPREL) + value -= dtp_base; + else if (!info->shared) + value -= tp_base; + else + { + elf64_alpha_emit_dynrel (output_bfd, info, sgot, srelgot, + gotent->got_offset, 0, + R_ALPHA_TPREL64, + value - dtp_base); + value = 0; + } } bfd_put_64 (output_bfd, value, sgot->contents + gotent->got_offset); @@ -4843,14 +4829,14 @@ elf64_alpha_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) - return false; + return FALSE; if (*name == '\0') name = bfd_section_name (input_bfd, sec); } if (! ((*info->callbacks->reloc_overflow) (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset))) - ret_val = false; + ret_val = FALSE; } break; @@ -4866,7 +4852,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section, /* Finish up dynamic symbol handling. We set the contents of various dynamic sections here. */ -static boolean +static bfd_boolean elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) bfd *output_bfd; struct bfd_link_info *info; @@ -4880,6 +4866,7 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) /* Fill in the .plt entry for this symbol. */ asection *splt, *sgot, *srel; Elf_Internal_Rela outrel; + bfd_byte *loc; bfd_vma got_addr, plt_addr; bfd_vma plt_index; struct alpha_elf_got_entry *gotent; @@ -4925,9 +4912,8 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) outrel.r_info = ELF64_R_INFO(h->dynindx, R_ALPHA_JMP_SLOT); outrel.r_addend = 0; - bfd_elf64_swap_reloca_out (output_bfd, &outrel, - ((Elf64_External_Rela *)srel->contents - + plt_index)); + loc = srel->contents + plt_index * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); if (!(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) { @@ -4956,20 +4942,9 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) sgot->contents + gotent->got_offset); if (info->shared) - { - outrel.r_offset = (sgot->output_section->vma - + sgot->output_offset - + gotent->got_offset); - outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE); - outrel.r_addend = plt_addr; - - bfd_elf64_swap_reloca_out (output_bfd, &outrel, - ((Elf64_External_Rela *) - srel->contents) - + srel->reloc_count++); - BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count - <= srel->_cooked_size); - } + elf64_alpha_emit_dynrel (output_bfd, info, sgot, srel, + gotent->got_offset, 0, + R_ALPHA_RELATIVE, plt_addr); gotent = gotent->next; } @@ -4980,7 +4955,6 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) { /* Fill in the dynamic relocations for this symbol's .got entries. */ asection *srel; - Elf_Internal_Rela outrel; struct alpha_elf_got_entry *gotent; srel = bfd_get_section_by_name (dynobj, ".rela.got"); @@ -4991,15 +4965,12 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) gotent = gotent->next) { asection *sgot; - int r_type; + long r_type; if (gotent->use_count == 0) continue; sgot = alpha_elf_tdata (gotent->gotobj)->got; - outrel.r_offset = (sgot->output_section->vma - + sgot->output_offset - + gotent->got_offset); r_type = gotent->reloc_type; switch (r_type) @@ -5021,25 +4992,14 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) abort (); } - outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); - outrel.r_addend = gotent->addend; - - bfd_elf64_swap_reloca_out (output_bfd, &outrel, - ((Elf64_External_Rela *)srel->contents - + srel->reloc_count++)); + elf64_alpha_emit_dynrel (output_bfd, info, sgot, srel, + gotent->got_offset, h->dynindx, + r_type, gotent->addend); if (gotent->reloc_type == R_ALPHA_TLSGD) - { - outrel.r_offset += 8; - outrel.r_info = ELF64_R_INFO (h->dynindx, R_ALPHA_DTPREL64); - - bfd_elf64_swap_reloca_out (output_bfd, &outrel, - ((Elf64_External_Rela *)srel->contents - + srel->reloc_count++)); - } - - BFD_ASSERT (sizeof (Elf64_External_Rela) * srel->reloc_count - <= srel->_cooked_size); + elf64_alpha_emit_dynrel (output_bfd, info, sgot, srel, + gotent->got_offset + 8, h->dynindx, + R_ALPHA_DTPREL64, gotent->addend); } } @@ -5049,12 +5009,12 @@ elf64_alpha_finish_dynamic_symbol (output_bfd, info, h, sym) || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0) sym->st_shndx = SHN_ABS; - return true; + return TRUE; } /* Finish up the dynamic sections. */ -static boolean +static bfd_boolean elf64_alpha_finish_dynamic_sections (output_bfd, info) bfd *output_bfd; struct bfd_link_info *info; @@ -5124,7 +5084,7 @@ elf64_alpha_finish_dynamic_sections (output_bfd, info) bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); } - /* Initialize the PLT0 entry */ + /* Initialize the PLT0 entry. */ if (splt->_raw_size > 0) { bfd_put_32 (output_bfd, PLT_HEADER_WORD1, splt->contents); @@ -5136,19 +5096,18 @@ elf64_alpha_finish_dynamic_sections (output_bfd, info) bfd_put_64 (output_bfd, (bfd_vma) 0, splt->contents + 16); bfd_put_64 (output_bfd, (bfd_vma) 0, splt->contents + 24); - elf_section_data (splt->output_section)->this_hdr.sh_entsize = - PLT_HEADER_SIZE; + elf_section_data (splt->output_section)->this_hdr.sh_entsize = 0; } } - return true; + return TRUE; } /* We need to use a special link routine to handle the .mdebug section. We need to merge all instances of these sections together, not write them all out sequentially. */ -static boolean +static bfd_boolean elf64_alpha_final_link (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -5205,7 +5164,7 @@ elf64_alpha_final_link (abfd, info) mdebug_handle = bfd_ecoff_debug_init (abfd, &debug, swap, info); if (mdebug_handle == (PTR) NULL) - return false; + return FALSE; if (1) { @@ -5244,7 +5203,7 @@ elf64_alpha_final_link (abfd, info) if (! bfd_ecoff_debug_one_external (abfd, &debug, swap, name[i], &esym)) - return false; + return FALSE; } } @@ -5289,12 +5248,12 @@ elf64_alpha_final_link (abfd, info) ecoff_debug_info structure, so we do that now. */ if (!elf64_alpha_read_ecoff_info (input_bfd, input_section, &input_debug)) - return false; + return FALSE; if (! (bfd_ecoff_debug_accumulate (mdebug_handle, abfd, &debug, swap, input_bfd, &input_debug, input_swap, info))) - return false; + return FALSE; /* Loop through the external symbols. For each one with interesting information, try to find the symbol in @@ -5320,7 +5279,7 @@ elf64_alpha_final_link (abfd, info) name = input_debug.ssext + ext.asym.iss; h = alpha_elf_link_hash_lookup (alpha_elf_hash_table (info), - name, false, false, true); + name, FALSE, FALSE, TRUE); if (h == NULL || h->esym.ifd != -2) continue; @@ -5357,12 +5316,12 @@ elf64_alpha_final_link (abfd, info) einfo.info = info; einfo.debug = &debug; einfo.swap = swap; - einfo.failed = false; + einfo.failed = FALSE; elf_link_hash_traverse (elf_hash_table (info), elf64_alpha_output_extsym, (PTR) &einfo); if (einfo.failed) - return false; + return FALSE; /* Set the size of the .mdebug section. */ o->_raw_size = bfd_ecoff_debug_size (abfd, &debug, swap); @@ -5376,8 +5335,8 @@ elf64_alpha_final_link (abfd, info) } /* Invoke the regular ELF backend linker to do all the work. */ - if (! bfd_elf64_bfd_final_link (abfd, info)) - return false; + if (! bfd_elf_final_link (abfd, info)) + return FALSE; /* Now write out the computed sections. */ @@ -5399,7 +5358,7 @@ elf64_alpha_final_link (abfd, info) sgot->contents, (file_ptr) sgot->output_offset, sgot->_raw_size)) - return false; + return FALSE; } } @@ -5409,12 +5368,12 @@ elf64_alpha_final_link (abfd, info) if (! bfd_ecoff_write_accumulated_debug (mdebug_handle, abfd, &debug, swap, info, mdebug_sec->filepos)) - return false; + return FALSE; bfd_ecoff_debug_free (mdebug_handle, abfd, &debug, swap, info); } - return true; + return TRUE; } static enum elf_reloc_type_class @@ -5434,6 +5393,13 @@ elf64_alpha_reloc_type_class (rela) } } +static struct bfd_elf_special_section const elf64_alpha_special_sections[]= +{ + { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, + { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, + { NULL, 0, 0, 0, 0 } +}; + /* ECOFF swapping routines. These are used when dealing with the .mdebug section, which is in the ECOFF debugging format. Copied from elf32-mips.c. */ @@ -5493,7 +5459,7 @@ static const struct elf_size_info alpha_elf_size_info = sizeof (Elf_External_Note), 8, 1, - 64, 8, + 64, 3, ELFCLASS64, EV_CURRENT, bfd_elf64_write_out_phdrs, bfd_elf64_write_shdrs_and_ehdr, @@ -5504,19 +5470,17 @@ static const struct elf_size_info alpha_elf_size_info = bfd_elf64_slurp_symbol_table, bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_out, - NULL, - NULL, - NULL, - NULL + bfd_elf64_swap_reloc_in, + bfd_elf64_swap_reloc_out, + bfd_elf64_swap_reloca_in, + bfd_elf64_swap_reloca_out }; -#ifndef ELF_ARCH #define TARGET_LITTLE_SYM bfd_elf64_alpha_vec #define TARGET_LITTLE_NAME "elf64-alpha" #define ELF_ARCH bfd_arch_alpha #define ELF_MACHINE_CODE EM_ALPHA #define ELF_MAXPAGESIZE 0x10000 -#endif /* ELF_ARCH */ #define bfd_elf64_bfd_link_hash_table_create \ elf64_alpha_bfd_link_hash_table_create @@ -5574,11 +5538,53 @@ static const struct elf_size_info alpha_elf_size_info = #define elf_backend_size_info \ alpha_elf_size_info +#define elf_backend_special_sections \ + elf64_alpha_special_sections + /* A few constants that determine how the .plt section is set up. */ #define elf_backend_want_got_plt 0 #define elf_backend_plt_readonly 0 #define elf_backend_want_plt_sym 1 #define elf_backend_got_header_size 0 -#define elf_backend_plt_header_size PLT_HEADER_SIZE + +#include "elf64-target.h" + +/* FreeBSD support. */ + +#undef TARGET_LITTLE_SYM +#define TARGET_LITTLE_SYM bfd_elf64_alpha_freebsd_vec +#undef TARGET_LITTLE_NAME +#define TARGET_LITTLE_NAME "elf64-alpha-freebsd" + +/* The kernel recognizes executables as valid only if they carry a + "FreeBSD" label in the ELF header. So we put this label on all + executables and (for simplicity) also all other object files. */ + +static void elf64_alpha_fbsd_post_process_headers + PARAMS ((bfd *, struct bfd_link_info *)); + +static void +elf64_alpha_fbsd_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. */ + + i_ehdrp = elf_elfheader (abfd); + + /* Put an ABI label supported by FreeBSD >= 4.1. */ + i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_FREEBSD; +#ifdef OLD_FREEBSD_ABI_LABEL + /* The ABI label supported by FreeBSD <= 4.0 is quite nonstandard. */ + memcpy (&i_ehdrp->e_ident[EI_ABIVERSION], "FreeBSD", 8); +#endif +} + +#undef elf_backend_post_process_headers +#define elf_backend_post_process_headers \ + elf64_alpha_fbsd_post_process_headers + +#undef elf64_bed +#define elf64_bed elf64_alpha_fbsd_bed #include "elf64-target.h" diff --git a/contrib/binutils/bfd/elf64-gen.c b/contrib/binutils/bfd/elf64-gen.c index a58f6ac..be1dc3e 100644 --- a/contrib/binutils/bfd/elf64-gen.c +++ b/contrib/binutils/bfd/elf64-gen.c @@ -1,5 +1,6 @@ /* Generic support for 64-bit ELF - Copyright 1993, 1995, 1998, 1999, 2001 Free Software Foundation, Inc. + Copyright 1993, 1995, 1998, 1999, 2001, 2002, 2004 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -30,28 +31,28 @@ static reloc_howto_type dummy = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ NULL, /* special_function */ "UNKNOWN", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false); /* pcrel_offset */ + FALSE); /* pcrel_offset */ static void elf_generic_info_to_howto - PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *)); + PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); static void elf_generic_info_to_howto_rel - PARAMS ((bfd *, arelent *, Elf64_Internal_Rel *)); -static boolean elf64_generic_link_add_symbols + PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); +static bfd_boolean elf64_generic_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); static void elf_generic_info_to_howto (abfd, bfd_reloc, elf_reloc) bfd *abfd ATTRIBUTE_UNUSED; arelent *bfd_reloc; - Elf64_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED; + Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED; { bfd_reloc->howto = &dummy; } @@ -60,12 +61,12 @@ static void elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) bfd *abfd ATTRIBUTE_UNUSED; arelent *bfd_reloc; - Elf64_Internal_Rel *elf_reloc ATTRIBUTE_UNUSED; + Elf_Internal_Rela *elf_reloc ATTRIBUTE_UNUSED; { bfd_reloc->howto = &dummy; } -static boolean +static bfd_boolean elf64_generic_link_add_symbols (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -84,10 +85,10 @@ elf64_generic_link_add_symbols (abfd, info) ehdrp->e_machine); bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; } - return bfd_elf64_bfd_link_add_symbols (abfd, info); + return bfd_elf_link_add_symbols (abfd, info); } #define TARGET_LITTLE_SYM bfd_elf64_little_generic_vec diff --git a/contrib/binutils/bfd/elf64-ppc.c b/contrib/binutils/bfd/elf64-ppc.c index c512636..a0d81d0 100644 --- a/contrib/binutils/bfd/elf64-ppc.c +++ b/contrib/binutils/bfd/elf64-ppc.c @@ -1,65 +1,101 @@ /* PowerPC64-specific support for 64-bit ELF. - Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. Written by Linus Nordberg, Swox AB , based on elf32-ppc.c by Ian Lance Taylor. + Largely rewritten by Alan Modra -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. */ -/* This file is based on the 64-bit PowerPC ELF ABI. It is also based - on the file elf32-ppc.c. */ +/* The 64-bit PowerPC ELF ABI may be found at + http://www.linuxbase.org/spec/ELF/ppc64/PPC-elf64abi.txt, and + http://www.linuxbase.org/spec/ELF/ppc64/spec/book1.html */ #include "bfd.h" #include "sysdep.h" #include "bfdlink.h" #include "libbfd.h" #include "elf-bfd.h" -#include "elf/ppc.h" +#include "elf/ppc64.h" #include "elf64-ppc.h" -#define USE_RELA /* we want RELA relocations, not REL. */ - - -static void ppc_howto_init - PARAMS ((void)); -static reloc_howto_type *ppc64_elf_reloc_type_lookup - PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); -static void ppc64_elf_info_to_howto - PARAMS ((bfd *abfd, arelent *cache_ptr, Elf64_Internal_Rela *dst)); static bfd_reloc_status_type ppc64_elf_ha_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type ppc64_elf_brtaken_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type ppc64_elf_sectoff_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type ppc64_elf_sectoff_ha_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type ppc64_elf_toc_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type ppc64_elf_toc_ha_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type ppc64_elf_toc64_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); static bfd_reloc_status_type ppc64_elf_unhandled_reloc - PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); -static boolean ppc64_elf_object_p - PARAMS ((bfd *)); -static boolean ppc64_elf_merge_private_bfd_data - PARAMS ((bfd *, bfd *)); + (bfd *, arelent *, asymbol *, void *, asection *, bfd *, char **); + + +#define TARGET_LITTLE_SYM bfd_elf64_powerpcle_vec +#define TARGET_LITTLE_NAME "elf64-powerpcle" +#define TARGET_BIG_SYM bfd_elf64_powerpc_vec +#define TARGET_BIG_NAME "elf64-powerpc" +#define ELF_ARCH bfd_arch_powerpc +#define ELF_MACHINE_CODE EM_PPC64 +#define ELF_MAXPAGESIZE 0x10000 +#define elf_info_to_howto ppc64_elf_info_to_howto + +#define elf_backend_want_got_sym 0 +#define elf_backend_want_plt_sym 0 +#define elf_backend_plt_alignment 3 +#define elf_backend_plt_not_loaded 1 +#define elf_backend_got_symbol_offset 0 +#define elf_backend_got_header_size 8 +#define elf_backend_can_gc_sections 1 +#define elf_backend_can_refcount 1 +#define elf_backend_rela_normal 1 + +#define bfd_elf64_mkobject ppc64_elf_mkobject +#define bfd_elf64_bfd_reloc_type_lookup ppc64_elf_reloc_type_lookup +#define bfd_elf64_bfd_merge_private_bfd_data ppc64_elf_merge_private_bfd_data +#define bfd_elf64_new_section_hook ppc64_elf_new_section_hook +#define bfd_elf64_bfd_link_hash_table_create ppc64_elf_link_hash_table_create +#define bfd_elf64_bfd_link_hash_table_free ppc64_elf_link_hash_table_free +#define elf_backend_object_p ppc64_elf_object_p +#define elf_backend_grok_prstatus ppc64_elf_grok_prstatus +#define elf_backend_grok_psinfo ppc64_elf_grok_psinfo +#define elf_backend_create_dynamic_sections ppc64_elf_create_dynamic_sections +#define elf_backend_copy_indirect_symbol ppc64_elf_copy_indirect_symbol +#define elf_backend_add_symbol_hook ppc64_elf_add_symbol_hook +#define elf_backend_check_relocs ppc64_elf_check_relocs +#define elf_backend_gc_mark_hook ppc64_elf_gc_mark_hook +#define elf_backend_gc_sweep_hook ppc64_elf_gc_sweep_hook +#define elf_backend_adjust_dynamic_symbol ppc64_elf_adjust_dynamic_symbol +#define elf_backend_hide_symbol ppc64_elf_hide_symbol +#define elf_backend_always_size_sections ppc64_elf_func_desc_adjust +#define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections +#define elf_backend_relocate_section ppc64_elf_relocate_section +#define elf_backend_finish_dynamic_symbol ppc64_elf_finish_dynamic_symbol +#define elf_backend_reloc_type_class ppc64_elf_reloc_type_class +#define elf_backend_finish_dynamic_sections ppc64_elf_finish_dynamic_sections +#define elf_backend_link_output_symbol_hook ppc64_elf_output_symbol_hook +#define elf_backend_special_sections ppc64_elf_special_sections /* The name of the dynamic interpreter. This is put in the .interp section. */ @@ -72,9 +108,16 @@ static boolean ppc64_elf_merge_private_bfd_data #define PLT_INITIAL_ENTRY_SIZE PLT_ENTRY_SIZE /* TOC base pointers offset from start of TOC. */ -#define TOC_BASE_OFF (0x8000) +#define TOC_BASE_OFF 0x8000 + +/* Offset of tp and dtp pointers from start of TLS block. */ +#define TP_OFFSET 0x7000 +#define DTP_OFFSET 0x8000 -/* .plt call stub instructions. */ +/* .plt call stub instructions. The normal stub is like this, but + sometimes the .plt entry crosses a 64k boundary and we need to + insert an addis to adjust r12. */ +#define PLT_CALL_STUB_SIZE (7*4) #define ADDIS_R12_R2 0x3d820000 /* addis %r12,%r2,xxx@ha */ #define STD_R2_40R1 0xf8410028 /* std %r2,40(%r1) */ #define LD_R11_0R12 0xe96c0000 /* ld %r11,xxx+0@l(%r12) */ @@ -83,19 +126,31 @@ static boolean ppc64_elf_merge_private_bfd_data /* ld %r11,xxx+16@l(%r12) */ #define BCTR 0x4e800420 /* bctr */ -/* The normal stub is this size. */ -#define PLT_CALL_STUB_SIZE (7*4) - -/* But sometimes the .plt entry crosses a 64k boundary, and we need - to adjust the high word with this insn. */ -#define ADDIS_R12_R12_1 0x3d8c0001 /* addis %r12,%r12,1 */ - -/* The .glink fixup call stub is the same as the .plt call stub, but - the first instruction restores r2, and the std is omitted. */ -#define LD_R2_40R1 0xe8410028 /* ld %r2,40(%r1) */ -/* Always allow this much space. */ -#define GLINK_CALL_STUB_SIZE (8*4) +#define ADDIS_R2_R2 0x3c420000 /* addis %r2,%r2,off@ha */ +#define ADDI_R2_R2 0x38420000 /* addi %r2,%r2,off@l */ + +#define LD_R2_40R1 0xe8410028 /* ld %r2,40(%r1) */ + +/* glink call stub instructions. We enter with the index in R0, and the + address of glink entry in CTR. From that, we can calculate PLT0. */ +#define GLINK_CALL_STUB_SIZE (16*4) +#define MFCTR_R12 0x7d8902a6 /* mfctr %r12 */ +#define SLDI_R11_R0_3 0x780b1f24 /* sldi %r11,%r0,3 */ +#define ADDIC_R2_R0_32K 0x34408000 /* addic. %r2,%r0,-32768 */ +#define SUB_R12_R12_R11 0x7d8b6050 /* sub %r12,%r12,%r11 */ +#define SRADI_R2_R2_63 0x7c42fe76 /* sradi %r2,%r2,63 */ +#define SLDI_R11_R0_2 0x780b1764 /* sldi %r11,%r0,2 */ +#define AND_R2_R2_R11 0x7c425838 /* and %r2,%r2,%r11 */ + /* sub %r12,%r12,%r11 */ +#define ADD_R12_R12_R2 0x7d8c1214 /* add %r12,%r12,%r2 */ +#define ADDIS_R12_R12 0x3d8c0000 /* addis %r12,%r12,xxx@ha */ + /* ld %r11,xxx@l(%r12) */ +#define ADDI_R12_R12 0x398c0000 /* addi %r12,%r12,xxx@l */ + /* ld %r2,8(%r12) */ + /* mtctr %r11 */ + /* ld %r11,16(%r12) */ + /* bctr */ /* Pad with this. */ #define NOP 0x60000000 @@ -127,40 +182,40 @@ static boolean ppc64_elf_merge_private_bfd_data #endif #define ONES(n) (((bfd_vma) 1 << ((n) - 1) << 1) - 1) - + /* Relocation HOWTO's. */ -static reloc_howto_type *ppc64_elf_howto_table[(int) R_PPC_max]; +static reloc_howto_type *ppc64_elf_howto_table[(int) R_PPC64_max]; static reloc_howto_type ppc64_elf_howto_raw[] = { /* This reloc does nothing. */ HOWTO (R_PPC64_NONE, /* type */ 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - false, /* pc_relative */ + 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_PPC64_NONE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A standard 32 bit relocation. */ HOWTO (R_PPC64_ADDR32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_ADDR32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* An absolute 26 bit branch; the lower two bits must be zero. FIXME: we don't check that, we just clear them. */ @@ -168,60 +223,60 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_ADDR24", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0x03fffffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A standard 16 bit relocation. */ HOWTO (R_PPC64_ADDR16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_ADDR16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A 16 bit relocation without overflow. */ HOWTO (R_PPC64_ADDR16_LO, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_ADDR16_LO", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Bits 16-31 of an address. */ HOWTO (R_PPC64_ADDR16_HI, /* type */ 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_ADDR16_HI", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Bits 16-31 of an address, plus 1 if the contents of the low 16 bits, treated as a signed number, is negative. */ @@ -229,15 +284,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_ha_reloc, /* special_function */ "R_PPC64_ADDR16_HA", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* An absolute 16 bit branch; the lower two bits must be zero. FIXME: we don't check that, we just clear them. */ @@ -245,15 +300,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_ADDR14", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0x0000fffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* An absolute 16 bit branch, for which bit 10 should be set to indicate that the branch is expected to be taken. The lower two @@ -262,15 +317,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ ppc64_elf_brtaken_reloc, /* special_function */ "R_PPC64_ADDR14_BRTAKEN",/* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0x0000fffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* An absolute 16 bit branch, for which bit 10 should be set to indicate that the branch is not expected to be taken. The lower @@ -279,45 +334,45 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ ppc64_elf_brtaken_reloc, /* special_function */ "R_PPC64_ADDR14_BRNTAKEN",/* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0x0000fffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* A relative 26 bit branch; the lower two bits must be zero. */ HOWTO (R_PPC64_REL24, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_REL24", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0x03fffffc, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* A relative 16 bit branch; the lower two bits must be zero. */ HOWTO (R_PPC64_REL14, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_REL14", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0x0000fffc, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* A relative 16 bit branch. Bit 10 should be set to indicate that the branch is expected to be taken. The lower two bits must be @@ -326,15 +381,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ ppc64_elf_brtaken_reloc, /* special_function */ "R_PPC64_REL14_BRTAKEN", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0x0000fffc, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* A relative 16 bit branch. Bit 10 should be set to indicate that the branch is not expected to be taken. The lower two bits must @@ -343,15 +398,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ ppc64_elf_brtaken_reloc, /* special_function */ "R_PPC64_REL14_BRNTAKEN",/* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0x0000fffc, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* Like R_PPC64_ADDR16, but referring to the GOT table entry for the symbol. */ @@ -359,15 +414,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_GOT16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_ADDR16_LO, but referring to the GOT table entry for the symbol. */ @@ -375,15 +430,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_GOT16_LO", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_ADDR16_HI, but referring to the GOT table entry for the symbol. */ @@ -391,15 +446,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_GOT16_HI", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_ADDR16_HA, but referring to the GOT table entry for the symbol. */ @@ -407,15 +462,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_GOT16_HA", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* This is used only by the dynamic linker. The symbol should exist both in the object being run and in some shared library. The @@ -426,15 +481,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 0, /* this one is variable size */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_COPY", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_ADDR64, but used when setting global offset table entries. */ @@ -442,15 +497,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_GLOB_DAT", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ ONES (64), /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Created by the link editor. Marks a procedure linkage table entry for a symbol. */ @@ -458,15 +513,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_JMP_SLOT", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Used only by the dynamic linker. When the object is run, this doubleword64 is set to the load address of the object, plus the @@ -475,76 +530,76 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_RELATIVE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ ONES (64), /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_ADDR32, but may be unaligned. */ HOWTO (R_PPC64_UADDR32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_UADDR32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_ADDR16, but may be unaligned. */ HOWTO (R_PPC64_UADDR16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_UADDR16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 32-bit PC relative. */ HOWTO (R_PPC64_REL32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ /* FIXME: Verify. Was complain_overflow_bitfield. */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_REL32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* 32-bit relocation to the symbol's procedure linkage table. */ HOWTO (R_PPC64_PLT32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_PLT32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 32-bit PC relative relocation to the symbol's procedure linkage table. FIXME: R_PPC64_PLTREL32 not supported. */ @@ -552,15 +607,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_PLTREL32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffffffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* Like R_PPC64_ADDR16_LO, but referring to the PLT table entry for the symbol. */ @@ -568,15 +623,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_PLT16_LO", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_ADDR16_HI, but referring to the PLT table entry for the symbol. */ @@ -584,15 +639,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_PLT16_HI", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_ADDR16_HA, but referring to the PLT table entry for the symbol. */ @@ -600,91 +655,90 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_PLT16_HA", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 16-bit section relative relocation. */ HOWTO (R_PPC64_SECTOFF, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ ppc64_elf_sectoff_reloc, /* special_function */ "R_PPC64_SECTOFF", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_SECTOFF, but no overflow warning. */ HOWTO (R_PPC64_SECTOFF_LO, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_sectoff_reloc, /* special_function */ "R_PPC64_SECTOFF_LO", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 16-bit upper half section relative relocation. */ HOWTO (R_PPC64_SECTOFF_HI, /* type */ 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_sectoff_reloc, /* special_function */ "R_PPC64_SECTOFF_HI", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 16-bit upper half adjusted section relative relocation. */ HOWTO (R_PPC64_SECTOFF_HA, /* type */ 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_sectoff_ha_reloc, /* special_function */ "R_PPC64_SECTOFF_HA", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* Like R_PPC64_REL24 without touching the two least significant - bits. Should have been named R_PPC64_REL30! */ - HOWTO (R_PPC64_ADDR30, /* type */ + /* Like R_PPC64_REL24 without touching the two least significant bits. */ + HOWTO (R_PPC64_REL30, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 30, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ - "R_PPC64_ADDR30", /* name */ - false, /* partial_inplace */ + "R_PPC64_REL30", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffffffc, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* Relocs in the 64-bit PowerPC ELF ABI, not in the 32-bit ABI. */ @@ -693,30 +747,30 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_ADDR64", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ ONES (64), /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* The bits 32-47 of an address. */ HOWTO (R_PPC64_ADDR16_HIGHER, /* type */ 32, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_ADDR16_HIGHER", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* The bits 32-47 of an address, plus 1 if the contents of the low 16 bits, treated as a signed number, is negative. */ @@ -724,30 +778,30 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 32, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_ha_reloc, /* special_function */ "R_PPC64_ADDR16_HIGHERA", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* The bits 48-63 of an address. */ HOWTO (R_PPC64_ADDR16_HIGHEST,/* type */ 48, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_ADDR16_HIGHEST", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* The bits 48-63 of an address, plus 1 if the contents of the low 16 bits, treated as a signed number, is negative. */ @@ -755,60 +809,60 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 48, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_ha_reloc, /* special_function */ "R_PPC64_ADDR16_HIGHESTA", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like ADDR64, but may be unaligned. */ HOWTO (R_PPC64_UADDR64, /* type */ 0, /* rightshift */ 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_UADDR64", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ ONES (64), /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 64-bit relative relocation. */ HOWTO (R_PPC64_REL64, /* type */ 0, /* rightshift */ 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ 64, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_REL64", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ ONES (64), /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* 64-bit relocation to the symbol's procedure linkage table. */ HOWTO (R_PPC64_PLT64, /* type */ 0, /* rightshift */ 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_PLT64", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ ONES (64), /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 64-bit PC relative relocation to the symbol's procedure linkage table. */ @@ -817,15 +871,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ 64, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_PLTREL64", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ ONES (64), /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* 16 bit TOC-relative relocation. */ @@ -834,15 +888,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ ppc64_elf_toc_reloc, /* special_function */ "R_PPC64_TOC16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 16 bit TOC-relative relocation without overflow. */ @@ -851,15 +905,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_toc_reloc, /* special_function */ "R_PPC64_TOC16_LO", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 16 bit TOC-relative relocation, high 16 bits. */ @@ -868,15 +922,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_toc_reloc, /* special_function */ "R_PPC64_TOC16_HI", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 16 bit TOC-relative relocation, high 16 bits, plus 1 if the contents of the low 16 bits, treated as a signed number, is @@ -887,15 +941,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_toc_ha_reloc, /* special_function */ "R_PPC64_TOC16_HA", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 64-bit relocation; insert value of TOC base (.TOC.). */ @@ -904,15 +958,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 4, /* size (0=byte, 1=short, 2=long, 4=64 bits) */ 64, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ ppc64_elf_toc64_reloc, /* special_function */ "R_PPC64_TOC", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ ONES (64), /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_GOT16, but also informs the link editor that the value to relocate may (!) refer to a PLT entry which the link @@ -927,15 +981,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_PLTGOT16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_PLTGOT16, but without overflow. */ /* FIXME: R_PPC64_PLTGOT16_LO not implemented. */ @@ -943,15 +997,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_PLTGOT16_LO", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_PLT_GOT16, but using bits 16-31 of the address. */ /* FIXME: R_PPC64_PLTGOT16_HI not implemented. */ @@ -959,15 +1013,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_PLTGOT16_HI", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_PLT_GOT16, but using bits 16-31 of the address, plus 1 if the contents of the low 16 bits, treated as a signed number, @@ -977,150 +1031,150 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_PLTGOT16_HA", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_ADDR16, but for instructions with a DS field. */ HOWTO (R_PPC64_ADDR16_DS, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_ADDR16_DS", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_ADDR16_LO, but for instructions with a DS field. */ HOWTO (R_PPC64_ADDR16_LO_DS, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_PPC64_ADDR16_LO_DS",/* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_GOT16, but for instructions with a DS field. */ HOWTO (R_PPC64_GOT16_DS, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_GOT16_DS", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_GOT16_LO, but for instructions with a DS field. */ HOWTO (R_PPC64_GOT16_LO_DS, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_GOT16_LO_DS", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_PLT16_LO, but for instructions with a DS field. */ HOWTO (R_PPC64_PLT16_LO_DS, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_PLT16_LO_DS", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_SECTOFF, but for instructions with a DS field. */ HOWTO (R_PPC64_SECTOFF_DS, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ ppc64_elf_sectoff_reloc, /* special_function */ "R_PPC64_SECTOFF_DS", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_SECTOFF_LO, but for instructions with a DS field. */ HOWTO (R_PPC64_SECTOFF_LO_DS, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_sectoff_reloc, /* special_function */ "R_PPC64_SECTOFF_LO_DS",/* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_TOC16, but for instructions with a DS field. */ HOWTO (R_PPC64_TOC16_DS, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ ppc64_elf_toc_reloc, /* special_function */ "R_PPC64_TOC16_DS", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_TOC16_LO, but for instructions with a DS field. */ HOWTO (R_PPC64_TOC16_LO_DS, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_toc_reloc, /* special_function */ "R_PPC64_TOC16_LO_DS", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_PLTGOT16, but for instructions with a DS field. */ /* FIXME: R_PPC64_PLTGOT16_DS not implemented. */ @@ -1128,15 +1182,15 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_PLTGOT16_DS", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Like R_PPC64_PLTGOT16_LO, but for instructions with a DS field. */ /* FIXME: R_PPC64_PLTGOT16_LO not implemented. */ @@ -1144,242 +1198,923 @@ static reloc_howto_type ppc64_elf_howto_raw[] = { 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ ppc64_elf_unhandled_reloc, /* special_function */ "R_PPC64_PLTGOT16_LO_DS",/* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0xfffc, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* GNU extension to record C++ vtable hierarchy. */ - HOWTO (R_PPC64_GNU_VTINHERIT, /* type */ + /* Marker reloc for TLS. */ + HOWTO (R_PPC64_TLS, 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - NULL, /* special_function */ - "R_PPC64_GNU_VTINHERIT", /* name */ - false, /* partial_inplace */ + bfd_elf_generic_reloc, /* special_function */ + "R_PPC64_TLS", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ - /* GNU extension to record C++ vtable member usage. */ - HOWTO (R_PPC64_GNU_VTENTRY, /* type */ + /* Computes the load module index of the load module that contains the + definition of its TLS sym. */ + HOWTO (R_PPC64_DTPMOD64, 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - NULL, /* special_function */ - "R_PPC64_GNU_VTENTRY", /* name */ - false, /* partial_inplace */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_DTPMOD64", /* name */ + FALSE, /* partial_inplace */ 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ -}; - - -/* Initialize the ppc64_elf_howto_table, so that linear accesses can - be done. */ + ONES (64), /* dst_mask */ + FALSE), /* pcrel_offset */ -static void -ppc_howto_init () -{ - unsigned int i, type; + /* Computes a dtv-relative displacement, the difference between the value + of sym+add and the base address of the thread-local storage block that + contains the definition of sym, minus 0x8000. */ + HOWTO (R_PPC64_DTPREL64, + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_DTPREL64", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ONES (64), /* dst_mask */ + FALSE), /* pcrel_offset */ - for (i = 0; - i < sizeof (ppc64_elf_howto_raw) / sizeof (ppc64_elf_howto_raw[0]); - i++) - { - type = ppc64_elf_howto_raw[i].type; - BFD_ASSERT (type < (sizeof (ppc64_elf_howto_table) - / sizeof (ppc64_elf_howto_table[0]))); - ppc64_elf_howto_table[type] = &ppc64_elf_howto_raw[i]; - } -} + /* A 16 bit dtprel reloc. */ + HOWTO (R_PPC64_DTPREL16, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_DTPREL16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ -static reloc_howto_type * -ppc64_elf_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; -{ - enum elf_ppc_reloc_type ppc_reloc = R_PPC_NONE; + /* Like DTPREL16, but no overflow. */ + HOWTO (R_PPC64_DTPREL16_LO, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_DTPREL16_LO", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ - if (!ppc64_elf_howto_table[R_PPC64_ADDR32]) - /* Initialize howto table if needed. */ - ppc_howto_init (); + /* Like DTPREL16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC64_DTPREL16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_DTPREL16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ - switch ((int) code) - { - default: - return (reloc_howto_type *) NULL; + /* Like DTPREL16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC64_DTPREL16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_DTPREL16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ - case BFD_RELOC_NONE: ppc_reloc = R_PPC64_NONE; - break; - case BFD_RELOC_32: ppc_reloc = R_PPC64_ADDR32; - break; - case BFD_RELOC_PPC_BA26: ppc_reloc = R_PPC64_ADDR24; - break; - case BFD_RELOC_16: ppc_reloc = R_PPC64_ADDR16; - break; - case BFD_RELOC_LO16: ppc_reloc = R_PPC64_ADDR16_LO; - break; - case BFD_RELOC_HI16: ppc_reloc = R_PPC64_ADDR16_HI; - break; - case BFD_RELOC_HI16_S: ppc_reloc = R_PPC64_ADDR16_HA; - break; - case BFD_RELOC_PPC_BA16: ppc_reloc = R_PPC64_ADDR14; - break; - case BFD_RELOC_PPC_BA16_BRTAKEN: ppc_reloc = R_PPC64_ADDR14_BRTAKEN; - break; - case BFD_RELOC_PPC_BA16_BRNTAKEN: ppc_reloc = R_PPC64_ADDR14_BRNTAKEN; - break; - case BFD_RELOC_PPC_B26: ppc_reloc = R_PPC64_REL24; - break; - case BFD_RELOC_PPC_B16: ppc_reloc = R_PPC64_REL14; - break; - case BFD_RELOC_PPC_B16_BRTAKEN: ppc_reloc = R_PPC64_REL14_BRTAKEN; - break; - case BFD_RELOC_PPC_B16_BRNTAKEN: ppc_reloc = R_PPC64_REL14_BRNTAKEN; - break; - case BFD_RELOC_16_GOTOFF: ppc_reloc = R_PPC64_GOT16; - break; - case BFD_RELOC_LO16_GOTOFF: ppc_reloc = R_PPC64_GOT16_LO; - break; - case BFD_RELOC_HI16_GOTOFF: ppc_reloc = R_PPC64_GOT16_HI; - break; - case BFD_RELOC_HI16_S_GOTOFF: ppc_reloc = R_PPC64_GOT16_HA; - break; - case BFD_RELOC_PPC_COPY: ppc_reloc = R_PPC64_COPY; - break; - case BFD_RELOC_PPC_GLOB_DAT: ppc_reloc = R_PPC64_GLOB_DAT; - break; - case BFD_RELOC_32_PCREL: ppc_reloc = R_PPC64_REL32; - break; - case BFD_RELOC_32_PLTOFF: ppc_reloc = R_PPC64_PLT32; - break; - case BFD_RELOC_32_PLT_PCREL: ppc_reloc = R_PPC64_PLTREL32; - break; - case BFD_RELOC_LO16_PLTOFF: ppc_reloc = R_PPC64_PLT16_LO; - break; - case BFD_RELOC_HI16_PLTOFF: ppc_reloc = R_PPC64_PLT16_HI; - break; - case BFD_RELOC_HI16_S_PLTOFF: ppc_reloc = R_PPC64_PLT16_HA; - break; - case BFD_RELOC_16_BASEREL: ppc_reloc = R_PPC64_SECTOFF; - break; - case BFD_RELOC_LO16_BASEREL: ppc_reloc = R_PPC64_SECTOFF_LO; - break; - case BFD_RELOC_HI16_BASEREL: ppc_reloc = R_PPC64_SECTOFF_HI; - break; - case BFD_RELOC_HI16_S_BASEREL: ppc_reloc = R_PPC64_SECTOFF_HA; - break; - case BFD_RELOC_CTOR: ppc_reloc = R_PPC64_ADDR64; - break; - case BFD_RELOC_64: ppc_reloc = R_PPC64_ADDR64; - break; - case BFD_RELOC_PPC64_HIGHER: ppc_reloc = R_PPC64_ADDR16_HIGHER; - break; - case BFD_RELOC_PPC64_HIGHER_S: ppc_reloc = R_PPC64_ADDR16_HIGHERA; - break; - case BFD_RELOC_PPC64_HIGHEST: ppc_reloc = R_PPC64_ADDR16_HIGHEST; - break; - case BFD_RELOC_PPC64_HIGHEST_S: ppc_reloc = R_PPC64_ADDR16_HIGHESTA; - break; - case BFD_RELOC_64_PCREL: ppc_reloc = R_PPC64_REL64; - break; - case BFD_RELOC_64_PLTOFF: ppc_reloc = R_PPC64_PLT64; - break; - case BFD_RELOC_64_PLT_PCREL: ppc_reloc = R_PPC64_PLTREL64; - break; - case BFD_RELOC_PPC_TOC16: ppc_reloc = R_PPC64_TOC16; - break; - case BFD_RELOC_PPC64_TOC16_LO: ppc_reloc = R_PPC64_TOC16_LO; - break; - case BFD_RELOC_PPC64_TOC16_HI: ppc_reloc = R_PPC64_TOC16_HI; - break; - case BFD_RELOC_PPC64_TOC16_HA: ppc_reloc = R_PPC64_TOC16_HA; - break; - case BFD_RELOC_PPC64_TOC: ppc_reloc = R_PPC64_TOC; - break; - case BFD_RELOC_PPC64_PLTGOT16: ppc_reloc = R_PPC64_PLTGOT16; - break; - case BFD_RELOC_PPC64_PLTGOT16_LO: ppc_reloc = R_PPC64_PLTGOT16_LO; - break; - case BFD_RELOC_PPC64_PLTGOT16_HI: ppc_reloc = R_PPC64_PLTGOT16_HI; - break; - case BFD_RELOC_PPC64_PLTGOT16_HA: ppc_reloc = R_PPC64_PLTGOT16_HA; - break; - case BFD_RELOC_PPC64_ADDR16_DS: ppc_reloc = R_PPC64_ADDR16_DS; - break; - case BFD_RELOC_PPC64_ADDR16_LO_DS: ppc_reloc = R_PPC64_ADDR16_LO_DS; - break; - case BFD_RELOC_PPC64_GOT16_DS: ppc_reloc = R_PPC64_GOT16_DS; - break; - case BFD_RELOC_PPC64_GOT16_LO_DS: ppc_reloc = R_PPC64_GOT16_LO_DS; - break; - case BFD_RELOC_PPC64_PLT16_LO_DS: ppc_reloc = R_PPC64_PLT16_LO_DS; - break; - case BFD_RELOC_PPC64_SECTOFF_DS: ppc_reloc = R_PPC64_SECTOFF_DS; - break; - case BFD_RELOC_PPC64_SECTOFF_LO_DS: ppc_reloc = R_PPC64_SECTOFF_LO_DS; - break; - case BFD_RELOC_PPC64_TOC16_DS: ppc_reloc = R_PPC64_TOC16_DS; - break; - case BFD_RELOC_PPC64_TOC16_LO_DS: ppc_reloc = R_PPC64_TOC16_LO_DS; - break; - case BFD_RELOC_PPC64_PLTGOT16_DS: ppc_reloc = R_PPC64_PLTGOT16_DS; - break; - case BFD_RELOC_PPC64_PLTGOT16_LO_DS: ppc_reloc = R_PPC64_PLTGOT16_LO_DS; - break; - case BFD_RELOC_VTABLE_INHERIT: ppc_reloc = R_PPC64_GNU_VTINHERIT; - break; - case BFD_RELOC_VTABLE_ENTRY: ppc_reloc = R_PPC64_GNU_VTENTRY; - break; - } + /* Like DTPREL16_HI, but next higher group of 16 bits. */ + HOWTO (R_PPC64_DTPREL16_HIGHER, + 32, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_DTPREL16_HIGHER", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ - return ppc64_elf_howto_table[(int) ppc_reloc]; -}; + /* Like DTPREL16_HIGHER, but adjust for low 16 bits. */ + HOWTO (R_PPC64_DTPREL16_HIGHERA, + 32, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_DTPREL16_HIGHERA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ -/* Set the howto pointer for a PowerPC ELF reloc. */ + /* Like DTPREL16_HIGHER, but next higher group of 16 bits. */ + HOWTO (R_PPC64_DTPREL16_HIGHEST, + 48, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_DTPREL16_HIGHEST", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ -static void -ppc64_elf_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd ATTRIBUTE_UNUSED; - arelent *cache_ptr; - Elf64_Internal_Rela *dst; -{ - unsigned int type; + /* Like DTPREL16_HIGHEST, but adjust for low 16 bits. */ + HOWTO (R_PPC64_DTPREL16_HIGHESTA, + 48, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_DTPREL16_HIGHESTA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ - /* Initialize howto table if needed. */ - if (!ppc64_elf_howto_table[R_PPC64_ADDR32]) - ppc_howto_init (); + /* Like DTPREL16, but for insns with a DS field. */ + HOWTO (R_PPC64_DTPREL16_DS, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_DTPREL16_DS", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + FALSE), /* pcrel_offset */ - type = ELF64_R_TYPE (dst->r_info); - BFD_ASSERT (type < (sizeof (ppc64_elf_howto_table) - / sizeof (ppc64_elf_howto_table[0]))); - cache_ptr->howto = ppc64_elf_howto_table[type]; -} + /* Like DTPREL16_DS, but no overflow. */ + HOWTO (R_PPC64_DTPREL16_LO_DS, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_DTPREL16_LO_DS", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + FALSE), /* pcrel_offset */ -/* Handle the R_PPC_ADDR16_HA and similar relocs. */ + /* Computes a tp-relative displacement, the difference between the value of + sym+add and the value of the thread pointer (r13). */ + HOWTO (R_PPC64_TPREL64, + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_TPREL64", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + ONES (64), /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* A 16 bit tprel reloc. */ + HOWTO (R_PPC64_TPREL16, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_TPREL16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like TPREL16, but no overflow. */ + HOWTO (R_PPC64_TPREL16_LO, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_TPREL16_LO", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like TPREL16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC64_TPREL16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_TPREL16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like TPREL16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC64_TPREL16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_TPREL16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like TPREL16_HI, but next higher group of 16 bits. */ + HOWTO (R_PPC64_TPREL16_HIGHER, + 32, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_TPREL16_HIGHER", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like TPREL16_HIGHER, but adjust for low 16 bits. */ + HOWTO (R_PPC64_TPREL16_HIGHERA, + 32, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_TPREL16_HIGHERA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like TPREL16_HIGHER, but next higher group of 16 bits. */ + HOWTO (R_PPC64_TPREL16_HIGHEST, + 48, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_TPREL16_HIGHEST", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like TPREL16_HIGHEST, but adjust for low 16 bits. */ + HOWTO (R_PPC64_TPREL16_HIGHESTA, + 48, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_TPREL16_HIGHESTA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like TPREL16, but for insns with a DS field. */ + HOWTO (R_PPC64_TPREL16_DS, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_TPREL16_DS", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like TPREL16_DS, but no overflow. */ + HOWTO (R_PPC64_TPREL16_LO_DS, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_TPREL16_LO_DS", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Allocates two contiguous entries in the GOT to hold a tls_index structure, + with values (sym+add)@dtpmod and (sym+add)@dtprel, and computes the offset + to the first entry relative to the TOC base (r2). */ + HOWTO (R_PPC64_GOT_TLSGD16, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_TLSGD16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TLSGD16, but no overflow. */ + HOWTO (R_PPC64_GOT_TLSGD16_LO, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_TLSGD16_LO", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TLSGD16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC64_GOT_TLSGD16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_TLSGD16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TLSGD16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC64_GOT_TLSGD16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_TLSGD16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Allocates two contiguous entries in the GOT to hold a tls_index structure, + with values (sym+add)@dtpmod and zero, and computes the offset to the + first entry relative to the TOC base (r2). */ + HOWTO (R_PPC64_GOT_TLSLD16, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_TLSLD16", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TLSLD16, but no overflow. */ + HOWTO (R_PPC64_GOT_TLSLD16_LO, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_TLSLD16_LO", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TLSLD16_LO, but next higher group of 16 bits. */ + HOWTO (R_PPC64_GOT_TLSLD16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_TLSLD16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TLSLD16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC64_GOT_TLSLD16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_TLSLD16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Allocates an entry in the GOT with value (sym+add)@dtprel, and computes + the offset to the entry relative to the TOC base (r2). */ + HOWTO (R_PPC64_GOT_DTPREL16_DS, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_DTPREL16_DS", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_DTPREL16_DS, but no overflow. */ + HOWTO (R_PPC64_GOT_DTPREL16_LO_DS, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_DTPREL16_LO_DS", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_DTPREL16_LO_DS, but next higher group of 16 bits. */ + HOWTO (R_PPC64_GOT_DTPREL16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_DTPREL16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_DTPREL16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC64_GOT_DTPREL16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_DTPREL16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Allocates an entry in the GOT with value (sym+add)@tprel, and computes the + offset to the entry relative to the TOC base (r2). */ + HOWTO (R_PPC64_GOT_TPREL16_DS, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_TPREL16_DS", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TPREL16_DS, but no overflow. */ + HOWTO (R_PPC64_GOT_TPREL16_LO_DS, + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_TPREL16_LO_DS", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xfffc, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TPREL16_LO_DS, but next higher group of 16 bits. */ + HOWTO (R_PPC64_GOT_TPREL16_HI, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_TPREL16_HI", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* Like GOT_TPREL16_HI, but adjust for low 16 bits. */ + HOWTO (R_PPC64_GOT_TPREL16_HA, + 16, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + ppc64_elf_unhandled_reloc, /* special_function */ + "R_PPC64_GOT_TPREL16_HA", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy. */ + HOWTO (R_PPC64_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_PPC64_GNU_VTINHERIT", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ + + /* GNU extension to record C++ vtable member usage. */ + HOWTO (R_PPC64_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + FALSE, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_PPC64_GNU_VTENTRY", /* name */ + FALSE, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + FALSE), /* pcrel_offset */ +}; + + +/* Initialize the ppc64_elf_howto_table, so that linear accesses can + be done. */ + +static void +ppc_howto_init (void) +{ + unsigned int i, type; + + for (i = 0; + i < sizeof (ppc64_elf_howto_raw) / sizeof (ppc64_elf_howto_raw[0]); + i++) + { + type = ppc64_elf_howto_raw[i].type; + BFD_ASSERT (type < (sizeof (ppc64_elf_howto_table) + / sizeof (ppc64_elf_howto_table[0]))); + ppc64_elf_howto_table[type] = &ppc64_elf_howto_raw[i]; + } +} + +static reloc_howto_type * +ppc64_elf_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED, + bfd_reloc_code_real_type code) +{ + enum elf_ppc64_reloc_type r = R_PPC64_NONE; + + if (!ppc64_elf_howto_table[R_PPC64_ADDR32]) + /* Initialize howto table if needed. */ + ppc_howto_init (); + + switch (code) + { + default: + return NULL; + + case BFD_RELOC_NONE: r = R_PPC64_NONE; + break; + case BFD_RELOC_32: r = R_PPC64_ADDR32; + break; + case BFD_RELOC_PPC_BA26: r = R_PPC64_ADDR24; + break; + case BFD_RELOC_16: r = R_PPC64_ADDR16; + break; + case BFD_RELOC_LO16: r = R_PPC64_ADDR16_LO; + break; + case BFD_RELOC_HI16: r = R_PPC64_ADDR16_HI; + break; + case BFD_RELOC_HI16_S: r = R_PPC64_ADDR16_HA; + break; + case BFD_RELOC_PPC_BA16: r = R_PPC64_ADDR14; + break; + case BFD_RELOC_PPC_BA16_BRTAKEN: r = R_PPC64_ADDR14_BRTAKEN; + break; + case BFD_RELOC_PPC_BA16_BRNTAKEN: r = R_PPC64_ADDR14_BRNTAKEN; + break; + case BFD_RELOC_PPC_B26: r = R_PPC64_REL24; + break; + case BFD_RELOC_PPC_B16: r = R_PPC64_REL14; + break; + case BFD_RELOC_PPC_B16_BRTAKEN: r = R_PPC64_REL14_BRTAKEN; + break; + case BFD_RELOC_PPC_B16_BRNTAKEN: r = R_PPC64_REL14_BRNTAKEN; + break; + case BFD_RELOC_16_GOTOFF: r = R_PPC64_GOT16; + break; + case BFD_RELOC_LO16_GOTOFF: r = R_PPC64_GOT16_LO; + break; + case BFD_RELOC_HI16_GOTOFF: r = R_PPC64_GOT16_HI; + break; + case BFD_RELOC_HI16_S_GOTOFF: r = R_PPC64_GOT16_HA; + break; + case BFD_RELOC_PPC_COPY: r = R_PPC64_COPY; + break; + case BFD_RELOC_PPC_GLOB_DAT: r = R_PPC64_GLOB_DAT; + break; + case BFD_RELOC_32_PCREL: r = R_PPC64_REL32; + break; + case BFD_RELOC_32_PLTOFF: r = R_PPC64_PLT32; + break; + case BFD_RELOC_32_PLT_PCREL: r = R_PPC64_PLTREL32; + break; + case BFD_RELOC_LO16_PLTOFF: r = R_PPC64_PLT16_LO; + break; + case BFD_RELOC_HI16_PLTOFF: r = R_PPC64_PLT16_HI; + break; + case BFD_RELOC_HI16_S_PLTOFF: r = R_PPC64_PLT16_HA; + break; + case BFD_RELOC_16_BASEREL: r = R_PPC64_SECTOFF; + break; + case BFD_RELOC_LO16_BASEREL: r = R_PPC64_SECTOFF_LO; + break; + case BFD_RELOC_HI16_BASEREL: r = R_PPC64_SECTOFF_HI; + break; + case BFD_RELOC_HI16_S_BASEREL: r = R_PPC64_SECTOFF_HA; + break; + case BFD_RELOC_CTOR: r = R_PPC64_ADDR64; + break; + case BFD_RELOC_64: r = R_PPC64_ADDR64; + break; + case BFD_RELOC_PPC64_HIGHER: r = R_PPC64_ADDR16_HIGHER; + break; + case BFD_RELOC_PPC64_HIGHER_S: r = R_PPC64_ADDR16_HIGHERA; + break; + case BFD_RELOC_PPC64_HIGHEST: r = R_PPC64_ADDR16_HIGHEST; + break; + case BFD_RELOC_PPC64_HIGHEST_S: r = R_PPC64_ADDR16_HIGHESTA; + break; + case BFD_RELOC_64_PCREL: r = R_PPC64_REL64; + break; + case BFD_RELOC_64_PLTOFF: r = R_PPC64_PLT64; + break; + case BFD_RELOC_64_PLT_PCREL: r = R_PPC64_PLTREL64; + break; + case BFD_RELOC_PPC_TOC16: r = R_PPC64_TOC16; + break; + case BFD_RELOC_PPC64_TOC16_LO: r = R_PPC64_TOC16_LO; + break; + case BFD_RELOC_PPC64_TOC16_HI: r = R_PPC64_TOC16_HI; + break; + case BFD_RELOC_PPC64_TOC16_HA: r = R_PPC64_TOC16_HA; + break; + case BFD_RELOC_PPC64_TOC: r = R_PPC64_TOC; + break; + case BFD_RELOC_PPC64_PLTGOT16: r = R_PPC64_PLTGOT16; + break; + case BFD_RELOC_PPC64_PLTGOT16_LO: r = R_PPC64_PLTGOT16_LO; + break; + case BFD_RELOC_PPC64_PLTGOT16_HI: r = R_PPC64_PLTGOT16_HI; + break; + case BFD_RELOC_PPC64_PLTGOT16_HA: r = R_PPC64_PLTGOT16_HA; + break; + case BFD_RELOC_PPC64_ADDR16_DS: r = R_PPC64_ADDR16_DS; + break; + case BFD_RELOC_PPC64_ADDR16_LO_DS: r = R_PPC64_ADDR16_LO_DS; + break; + case BFD_RELOC_PPC64_GOT16_DS: r = R_PPC64_GOT16_DS; + break; + case BFD_RELOC_PPC64_GOT16_LO_DS: r = R_PPC64_GOT16_LO_DS; + break; + case BFD_RELOC_PPC64_PLT16_LO_DS: r = R_PPC64_PLT16_LO_DS; + break; + case BFD_RELOC_PPC64_SECTOFF_DS: r = R_PPC64_SECTOFF_DS; + break; + case BFD_RELOC_PPC64_SECTOFF_LO_DS: r = R_PPC64_SECTOFF_LO_DS; + break; + case BFD_RELOC_PPC64_TOC16_DS: r = R_PPC64_TOC16_DS; + break; + case BFD_RELOC_PPC64_TOC16_LO_DS: r = R_PPC64_TOC16_LO_DS; + break; + case BFD_RELOC_PPC64_PLTGOT16_DS: r = R_PPC64_PLTGOT16_DS; + break; + case BFD_RELOC_PPC64_PLTGOT16_LO_DS: r = R_PPC64_PLTGOT16_LO_DS; + break; + case BFD_RELOC_PPC_TLS: r = R_PPC64_TLS; + break; + case BFD_RELOC_PPC_DTPMOD: r = R_PPC64_DTPMOD64; + break; + case BFD_RELOC_PPC_TPREL16: r = R_PPC64_TPREL16; + break; + case BFD_RELOC_PPC_TPREL16_LO: r = R_PPC64_TPREL16_LO; + break; + case BFD_RELOC_PPC_TPREL16_HI: r = R_PPC64_TPREL16_HI; + break; + case BFD_RELOC_PPC_TPREL16_HA: r = R_PPC64_TPREL16_HA; + break; + case BFD_RELOC_PPC_TPREL: r = R_PPC64_TPREL64; + break; + case BFD_RELOC_PPC_DTPREL16: r = R_PPC64_DTPREL16; + break; + case BFD_RELOC_PPC_DTPREL16_LO: r = R_PPC64_DTPREL16_LO; + break; + case BFD_RELOC_PPC_DTPREL16_HI: r = R_PPC64_DTPREL16_HI; + break; + case BFD_RELOC_PPC_DTPREL16_HA: r = R_PPC64_DTPREL16_HA; + break; + case BFD_RELOC_PPC_DTPREL: r = R_PPC64_DTPREL64; + break; + case BFD_RELOC_PPC_GOT_TLSGD16: r = R_PPC64_GOT_TLSGD16; + break; + case BFD_RELOC_PPC_GOT_TLSGD16_LO: r = R_PPC64_GOT_TLSGD16_LO; + break; + case BFD_RELOC_PPC_GOT_TLSGD16_HI: r = R_PPC64_GOT_TLSGD16_HI; + break; + case BFD_RELOC_PPC_GOT_TLSGD16_HA: r = R_PPC64_GOT_TLSGD16_HA; + break; + case BFD_RELOC_PPC_GOT_TLSLD16: r = R_PPC64_GOT_TLSLD16; + break; + case BFD_RELOC_PPC_GOT_TLSLD16_LO: r = R_PPC64_GOT_TLSLD16_LO; + break; + case BFD_RELOC_PPC_GOT_TLSLD16_HI: r = R_PPC64_GOT_TLSLD16_HI; + break; + case BFD_RELOC_PPC_GOT_TLSLD16_HA: r = R_PPC64_GOT_TLSLD16_HA; + break; + case BFD_RELOC_PPC_GOT_TPREL16: r = R_PPC64_GOT_TPREL16_DS; + break; + case BFD_RELOC_PPC_GOT_TPREL16_LO: r = R_PPC64_GOT_TPREL16_LO_DS; + break; + case BFD_RELOC_PPC_GOT_TPREL16_HI: r = R_PPC64_GOT_TPREL16_HI; + break; + case BFD_RELOC_PPC_GOT_TPREL16_HA: r = R_PPC64_GOT_TPREL16_HA; + break; + case BFD_RELOC_PPC_GOT_DTPREL16: r = R_PPC64_GOT_DTPREL16_DS; + break; + case BFD_RELOC_PPC_GOT_DTPREL16_LO: r = R_PPC64_GOT_DTPREL16_LO_DS; + break; + case BFD_RELOC_PPC_GOT_DTPREL16_HI: r = R_PPC64_GOT_DTPREL16_HI; + break; + case BFD_RELOC_PPC_GOT_DTPREL16_HA: r = R_PPC64_GOT_DTPREL16_HA; + break; + case BFD_RELOC_PPC64_TPREL16_DS: r = R_PPC64_TPREL16_DS; + break; + case BFD_RELOC_PPC64_TPREL16_LO_DS: r = R_PPC64_TPREL16_LO_DS; + break; + case BFD_RELOC_PPC64_TPREL16_HIGHER: r = R_PPC64_TPREL16_HIGHER; + break; + case BFD_RELOC_PPC64_TPREL16_HIGHERA: r = R_PPC64_TPREL16_HIGHERA; + break; + case BFD_RELOC_PPC64_TPREL16_HIGHEST: r = R_PPC64_TPREL16_HIGHEST; + break; + case BFD_RELOC_PPC64_TPREL16_HIGHESTA: r = R_PPC64_TPREL16_HIGHESTA; + break; + case BFD_RELOC_PPC64_DTPREL16_DS: r = R_PPC64_DTPREL16_DS; + break; + case BFD_RELOC_PPC64_DTPREL16_LO_DS: r = R_PPC64_DTPREL16_LO_DS; + break; + case BFD_RELOC_PPC64_DTPREL16_HIGHER: r = R_PPC64_DTPREL16_HIGHER; + break; + case BFD_RELOC_PPC64_DTPREL16_HIGHERA: r = R_PPC64_DTPREL16_HIGHERA; + break; + case BFD_RELOC_PPC64_DTPREL16_HIGHEST: r = R_PPC64_DTPREL16_HIGHEST; + break; + case BFD_RELOC_PPC64_DTPREL16_HIGHESTA: r = R_PPC64_DTPREL16_HIGHESTA; + break; + case BFD_RELOC_VTABLE_INHERIT: r = R_PPC64_GNU_VTINHERIT; + break; + case BFD_RELOC_VTABLE_ENTRY: r = R_PPC64_GNU_VTENTRY; + break; + } + + return ppc64_elf_howto_table[r]; +}; + +/* Set the howto pointer for a PowerPC ELF reloc. */ + +static void +ppc64_elf_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, + Elf_Internal_Rela *dst) +{ + unsigned int type; + + /* Initialize howto table if needed. */ + if (!ppc64_elf_howto_table[R_PPC64_ADDR32]) + ppc_howto_init (); + + type = ELF64_R_TYPE (dst->r_info); + BFD_ASSERT (type < (sizeof (ppc64_elf_howto_table) + / sizeof (ppc64_elf_howto_table[0]))); + cache_ptr->howto = ppc64_elf_howto_table[type]; +} + +/* Handle the R_PPC64_ADDR16_HA and similar relocs. */ static bfd_reloc_status_type -ppc64_elf_ha_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +ppc64_elf_ha_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) { /* If this is a relocatable link (output_bfd test tells us), just call the generic function. Any adjustment will be done at final @@ -1396,21 +2131,15 @@ ppc64_elf_ha_reloc (abfd, reloc_entry, symbol, data, } static bfd_reloc_status_type -ppc64_elf_brtaken_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +ppc64_elf_brtaken_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) { long insn; - enum elf_ppc_reloc_type r_type; + enum elf_ppc64_reloc_type r_type; bfd_size_type octets; /* Disabled until we sort out how ld should choose 'y' vs 'at'. */ - boolean is_power4 = false; + bfd_boolean is_power4 = FALSE; /* If this is a relocatable link (output_bfd test tells us), just call the generic function. Any adjustment will be done at final @@ -1422,7 +2151,7 @@ ppc64_elf_brtaken_reloc (abfd, reloc_entry, symbol, data, octets = reloc_entry->address * bfd_octets_per_byte (abfd); insn = bfd_get_32 (abfd, (bfd_byte *) data + octets); insn &= ~(0x01 << 21); - r_type = (enum elf_ppc_reloc_type) reloc_entry->howto->type; + r_type = reloc_entry->howto->type; if (r_type == R_PPC64_ADDR14_BRTAKEN || r_type == R_PPC64_REL14_BRTAKEN) insn |= 0x01 << 21; /* 'y' or 't' bit, lowest bit of BO field. */ @@ -1458,20 +2187,14 @@ ppc64_elf_brtaken_reloc (abfd, reloc_entry, symbol, data, if ((bfd_signed_vma) (target - from) < 0) insn ^= 0x01 << 21; } - bfd_put_32 (abfd, (bfd_vma) insn, (bfd_byte *) data + octets); + bfd_put_32 (abfd, insn, (bfd_byte *) data + octets); return bfd_reloc_continue; } static bfd_reloc_status_type -ppc64_elf_sectoff_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +ppc64_elf_sectoff_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) { /* If this is a relocatable link (output_bfd test tells us), just call the generic function. Any adjustment will be done at final @@ -1486,15 +2209,9 @@ ppc64_elf_sectoff_reloc (abfd, reloc_entry, symbol, data, } static bfd_reloc_status_type -ppc64_elf_sectoff_ha_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +ppc64_elf_sectoff_ha_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) { /* If this is a relocatable link (output_bfd test tells us), just call the generic function. Any adjustment will be done at final @@ -1512,15 +2229,9 @@ ppc64_elf_sectoff_ha_reloc (abfd, reloc_entry, symbol, data, } static bfd_reloc_status_type -ppc64_elf_toc_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +ppc64_elf_toc_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) { bfd_vma TOCstart; @@ -1541,15 +2252,9 @@ ppc64_elf_toc_reloc (abfd, reloc_entry, symbol, data, } static bfd_reloc_status_type -ppc64_elf_toc_ha_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +ppc64_elf_toc_ha_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) { bfd_vma TOCstart; @@ -1573,15 +2278,9 @@ ppc64_elf_toc_ha_reloc (abfd, reloc_entry, symbol, data, } static bfd_reloc_status_type -ppc64_elf_toc64_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +ppc64_elf_toc64_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) { bfd_vma TOCstart; bfd_size_type octets; @@ -1603,15 +2302,9 @@ ppc64_elf_toc64_reloc (abfd, reloc_entry, symbol, data, } static bfd_reloc_status_type -ppc64_elf_unhandled_reloc (abfd, reloc_entry, symbol, data, - input_section, output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +ppc64_elf_unhandled_reloc (bfd *abfd, arelent *reloc_entry, asymbol *symbol, + void *data, asection *input_section, + bfd *output_bfd, char **error_message) { /* If this is a relocatable link (output_bfd test tells us), just call the generic function. Any adjustment will be done at final @@ -1630,12 +2323,45 @@ ppc64_elf_unhandled_reloc (abfd, reloc_entry, symbol, data, return bfd_reloc_dangerous; } +struct ppc64_elf_obj_tdata +{ + struct elf_obj_tdata elf; + + /* Shortcuts to dynamic linker sections. */ + asection *got; + asection *relgot; + + /* TLS local dynamic got entry handling. Suppose for multiple GOT + sections means we potentially need one of these for each input bfd. */ + union { + bfd_signed_vma refcount; + bfd_vma offset; + } tlsld_got; +}; + +#define ppc64_elf_tdata(bfd) \ + ((struct ppc64_elf_obj_tdata *) (bfd)->tdata.any) + +#define ppc64_tlsld_got(bfd) \ + (&ppc64_elf_tdata (bfd)->tlsld_got) + +/* Override the generic function because we store some extras. */ + +static bfd_boolean +ppc64_elf_mkobject (bfd *abfd) +{ + bfd_size_type amt = sizeof (struct ppc64_elf_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + return TRUE; +} + /* Fix bad default arch selected for a 64 bit input bfd when the default is 32 bit. */ -static boolean -ppc64_elf_object_p (abfd) - bfd *abfd; +static bfd_boolean +ppc64_elf_object_p (bfd *abfd) { if (abfd->arch_info->the_default && abfd->arch_info->bits_per_word == 32) { @@ -1648,16 +2374,53 @@ ppc64_elf_object_p (abfd) BFD_ASSERT (abfd->arch_info->bits_per_word == 64); } } - return true; + return TRUE; +} + +/* Support for core dump NOTE sections. */ + +static bfd_boolean +ppc64_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) +{ + size_t offset, raw_size; + + if (note->descsz != 504) + return FALSE; + + /* pr_cursig */ + elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12); + + /* pr_pid */ + elf_tdata (abfd)->core_pid = bfd_get_32 (abfd, note->descdata + 32); + + /* pr_reg */ + offset = 112; + raw_size = 384; + + /* Make a ".reg/999" section. */ + return _bfd_elfcore_make_pseudosection (abfd, ".reg", + raw_size, note->descpos + offset); +} + +static bfd_boolean +ppc64_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) +{ + if (note->descsz != 136) + return FALSE; + + elf_tdata (abfd)->core_program + = _bfd_elfcore_strndup (abfd, note->descdata + 40, 16); + elf_tdata (abfd)->core_command + = _bfd_elfcore_strndup (abfd, note->descdata + 56, 80); + + return TRUE; } /* Merge backend specific data from an object file to the output object file when linking. */ -static boolean -ppc64_elf_merge_private_bfd_data (ibfd, obfd) - bfd *ibfd; - bfd *obfd; +static bfd_boolean +ppc64_elf_merge_private_bfd_data (bfd *ibfd, bfd *obfd) { /* Check if we have the same endianess. */ if (ibfd->xvec->byteorder != obfd->xvec->byteorder @@ -1667,17 +2430,67 @@ ppc64_elf_merge_private_bfd_data (ibfd, obfd) const char *msg; if (bfd_big_endian (ibfd)) - msg = _("%s: compiled for a big endian system and target is little endian"); + 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"); + msg = _("%s: compiled for a little endian system " + "and target is big endian"); (*_bfd_error_handler) (msg, bfd_archive_filename (ibfd)); bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; } - return true; + return TRUE; +} + +/* Add extra PPC sections. */ + +static struct bfd_elf_special_section const ppc64_elf_special_sections[]= +{ + { ".sdata", 6, -2, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { ".sbss", 5, -2, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { ".plt", 4, 0, SHT_NOBITS, 0 }, + { ".toc", 4, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { ".toc1", 5, 0, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, + { ".tocbss", 7, 0, SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, + { NULL, 0, 0, 0, 0 } +}; + +struct _ppc64_elf_section_data +{ + struct bfd_elf_section_data elf; + + /* An array with one entry for each opd function descriptor. */ + union + { + /* Points to the function code section for local opd entries. */ + asection **func_sec; + /* After editing .opd, adjust references to opd local syms. */ + long *adjust; + } opd; + + /* An array for toc sections, indexed by offset/8. + Specifies the relocation symbol index used at a given toc offset. */ + unsigned *t_symndx; +}; + +#define ppc64_elf_section_data(sec) \ + ((struct _ppc64_elf_section_data *) elf_section_data (sec)) + +static bfd_boolean +ppc64_elf_new_section_hook (bfd *abfd, asection *sec) +{ + struct _ppc64_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); + + sdata = bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = sdata; + + return _bfd_elf_new_section_hook (abfd, sec); } /* The following functions are specific to the ELF linker, while @@ -1720,7 +2533,7 @@ ppc64_elf_merge_private_bfd_data (ibfd, obfd) . . .foo_stub: . addis 12,2,Lfoo@toc@ha # in practice, the call stub - . addi 12,12,Lfoo@toc@l # is slightly optimised, but + . addi 12,12,Lfoo@toc@l # is slightly optimized, but . std 2,40(1) # this is the general idea . ld 11,0(12) . ld 2,8(12) @@ -1768,13 +2581,74 @@ struct ppc_dyn_relocs bfd_size_type pc_count; }; +/* Track GOT entries needed for a given symbol. We might need more + than one got entry per symbol. */ +struct got_entry +{ + struct got_entry *next; + + /* The symbol addend that we'll be placing in the GOT. */ + bfd_vma addend; + + /* Unlike other ELF targets, we use separate GOT entries for the same + symbol referenced from different input files. This is to support + automatic multiple TOC/GOT sections, where the TOC base can vary + from one input file to another. + + Point to the BFD owning this GOT entry. */ + bfd *owner; + + /* Zero for non-tls entries, or TLS_TLS and one of TLS_GD, TLS_LD, + TLS_TPREL or TLS_DTPREL for tls entries. */ + char tls_type; + + /* Reference count until size_dynamic_sections, GOT offset thereafter. */ + union + { + bfd_signed_vma refcount; + bfd_vma offset; + } got; +}; + +/* The same for PLT. */ +struct plt_entry +{ + struct plt_entry *next; + + bfd_vma addend; + + union + { + bfd_signed_vma refcount; + bfd_vma offset; + } plt; +}; + /* Of those relocs that might be copied as dynamic relocs, this macro - selects between relative and absolute types. */ + selects those that must be copied when linking a shared library, + even when the symbol is local. */ -#define IS_ABSOLUTE_RELOC(RTYPE) \ +#define MUST_BE_DYN_RELOC(RTYPE) \ ((RTYPE) != R_PPC64_REL32 \ && (RTYPE) != R_PPC64_REL64 \ - && (RTYPE) != R_PPC64_ADDR30) + && (RTYPE) != R_PPC64_REL30) + +/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid + copying dynamic variables from a shared lib into an app's dynbss + section, and instead use a dynamic relocation to point into the + shared lib. With code that gcc generates, it's vital that this be + enabled; In the PowerPC64 ABI, the address of a function is actually + the address of a function descriptor, which resides in the .opd + section. gcc uses the descriptor directly rather than going via the + GOT as some other ABI's do, which means that initialized function + pointers must reference the descriptor. Thus, a function pointer + initialized to the address of a function in a shared library will + either require a copy reloc, or a dynamic reloc. Using a copy reloc + redefines the function descriptor symbol to point to the copy. This + presents a problem as a plt entry for that function is also + initialized from the function descriptor symbol and the copy reloc + may not be initialized first. */ +#define ELIMINATE_COPY_RELOCS 1 /* Section name for stubs is the associated section name plus this string. */ @@ -1803,12 +2677,31 @@ struct ppc_dyn_relocs . mtctr %r11 . ld %r11,xxx+16@toc@l(%r12) . bctr + + ppc_stub_long_branch and ppc_stub_plt_branch may also have additional + code to adjust the value and save r2 to support multiple toc sections. + A ppc_stub_long_branch with an r2 offset looks like: + . std %r2,40(%r1) + . addis %r2,%r2,off@ha + . addi %r2,%r2,off@l + . b dest + + A ppc_stub_plt_branch with an r2 offset looks like: + . std %r2,40(%r1) + . addis %r12,%r2,xxx@toc@ha + . ld %r11,xxx@toc@l(%r12) + . addis %r2,%r2,off@ha + . addi %r2,%r2,off@l + . mtctr %r11 + . bctr */ enum ppc_stub_type { ppc_stub_none, ppc_stub_long_branch, + ppc_stub_long_branch_r2off, ppc_stub_plt_branch, + ppc_stub_plt_branch_r2off, ppc_stub_plt_call }; @@ -1817,6 +2710,8 @@ struct ppc_stub_hash_entry { /* Base hash table entry structure. */ struct bfd_hash_entry root; + enum ppc_stub_type stub_type; + /* The stub section. */ asection *stub_sec; @@ -1828,11 +2723,12 @@ struct ppc_stub_hash_entry { bfd_vma target_value; asection *target_section; - enum ppc_stub_type stub_type; - /* The symbol table entry, if any, that this was derived from. */ struct ppc_link_hash_entry *h; + /* And the reloc addend that this was derived from. */ + bfd_vma addend; + /* 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; @@ -1868,6 +2764,26 @@ struct ppc_link_hash_entry unsigned int is_func:1; unsigned int is_func_descriptor:1; unsigned int is_entry:1; + + /* Whether global opd sym has been adjusted or not. */ + unsigned int adjust_done:1; + + /* Contexts in which symbol is used in the GOT (or TOC). + TLS_GD .. TLS_EXPLICIT bits are or'd into the mask as the + corresponding relocs are encountered during check_relocs. + tls_optimize clears TLS_GD .. TLS_TPREL when optimizing to + indicate the corresponding GOT entry type is not needed. + tls_optimize may also set TLS_TPRELGD when a GD reloc turns into + a TPREL one. We use a separate flag rather than setting TPREL + just for convenience in distinguishing the two cases. */ +#define TLS_GD 1 /* GD reloc. */ +#define TLS_LD 2 /* LD reloc. */ +#define TLS_TPREL 4 /* TPREL reloc, => IE. */ +#define TLS_DTPREL 8 /* DTPREL reloc, => LD. */ +#define TLS_TLS 16 /* Any TLS reloc. */ +#define TLS_EXPLICIT 32 /* Marks TOC section TLS relocs. */ +#define TLS_TPRELGD 64 /* TPREL reloc resulting from GD->IE. */ + char tls_mask; }; /* ppc64 ELF linker hash table. */ @@ -1886,8 +2802,8 @@ struct ppc_link_hash_table bfd *stub_bfd; /* Linker call-backs. */ - asection * (*add_stub_section) PARAMS ((const char *, asection *)); - void (*layout_sections_again) PARAMS ((void)); + asection * (*add_stub_section) (const char *, asection *); + void (*layout_sections_again) (void); /* Array to keep track of which stub sections have been created, and information on stub grouping. */ @@ -1896,23 +2812,45 @@ struct ppc_link_hash_table asection *link_sec; /* The stub section. */ asection *stub_sec; + /* Along with elf_gp, specifies the TOC pointer used in this group. */ + bfd_vma toc_off; } *stub_group; - /* Assorted information used by ppc64_elf_size_stubs. */ + /* Support for multiple toc sections. */ + unsigned int no_multi_toc; + unsigned int multi_toc_needed; + + /* Temp used when calculating TOC pointers. */ + bfd_vma toc_curr; + + /* Highest input section id. */ + int top_id; + + /* Highest output section index. */ int top_index; + + /* List of input sections for each output section. */ asection **input_list; /* Short-cuts to get to dynamic linker sections. */ - asection *sgot; - asection *srelgot; - asection *splt; - asection *srelplt; - asection *sdynbss; - asection *srelbss; - asection *sglink; + asection *got; + asection *plt; + asection *relplt; + asection *dynbss; + asection *relbss; + asection *glink; asection *sfpr; - asection *sbrlt; - asection *srelbrlt; + asection *brlt; + asection *relbrlt; + + /* Shortcut to .__tls_get_addr. */ + struct elf_link_hash_entry *tls_get_addr; + + /* Statistics. */ + unsigned long stub_count[ppc_stub_plt_call]; + + /* Set if we should emit symbols for stubs. */ + unsigned int emit_stub_syms; /* Set on error. */ unsigned int stub_error; @@ -1931,81 +2869,6 @@ struct ppc_link_hash_table struct sym_sec_cache sym_sec; }; -static struct bfd_hash_entry *stub_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static struct bfd_hash_entry *branch_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static struct bfd_hash_entry *link_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static struct bfd_link_hash_table *ppc64_elf_link_hash_table_create - PARAMS ((bfd *)); -static void ppc64_elf_link_hash_table_free - PARAMS ((struct bfd_link_hash_table *)); -static char *ppc_stub_name - PARAMS ((const asection *, const asection *, - const struct ppc_link_hash_entry *, const Elf_Internal_Rela *)); -static struct ppc_stub_hash_entry *ppc_get_stub_entry - PARAMS ((const asection *, const asection *, struct elf_link_hash_entry *, - const Elf_Internal_Rela *, struct ppc_link_hash_table *)); -static struct ppc_stub_hash_entry *ppc_add_stub - PARAMS ((const char *, asection *, struct ppc_link_hash_table *)); -static boolean create_linkage_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static boolean create_got_section - PARAMS ((bfd *, struct bfd_link_info *)); -static boolean ppc64_elf_create_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static void ppc64_elf_copy_indirect_symbol - PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, - struct elf_link_hash_entry *)); -static boolean ppc64_elf_check_relocs - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); -static asection * ppc64_elf_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static boolean ppc64_elf_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); -static boolean func_desc_adjust - PARAMS ((struct elf_link_hash_entry *, PTR)); -static boolean ppc64_elf_func_desc_adjust - PARAMS ((bfd *, struct bfd_link_info *)); -static boolean ppc64_elf_adjust_dynamic_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); -static void ppc64_elf_hide_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); -static boolean edit_opd - PARAMS ((bfd *, struct bfd_link_info *)); -static boolean allocate_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); -static boolean readonly_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); -static enum elf_reloc_type_class ppc64_elf_reloc_type_class - PARAMS ((const Elf_Internal_Rela *)); -static boolean ppc64_elf_size_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); -static INLINE enum ppc_stub_type ppc_type_of_stub - PARAMS ((asection *, const Elf_Internal_Rela *, - struct ppc_link_hash_entry **, bfd_vma)); -static bfd_byte *build_plt_stub - PARAMS ((bfd *, bfd_byte *, int, int)); -static boolean ppc_build_one_stub - PARAMS ((struct bfd_hash_entry *, PTR)); -static boolean ppc_size_one_stub - PARAMS ((struct bfd_hash_entry *, PTR)); -static void group_sections - PARAMS ((struct ppc_link_hash_table *, bfd_size_type, boolean)); -static boolean ppc64_elf_relocate_section - PARAMS ((bfd *, struct bfd_link_info *info, bfd *, asection *, bfd_byte *, - Elf_Internal_Rela *relocs, Elf_Internal_Sym *local_syms, - asection **)); -static boolean ppc64_elf_finish_dynamic_symbol - PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, - Elf_Internal_Sym *)); -static boolean ppc64_elf_finish_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *)); - /* Get the ppc64 ELF linker hash table from a link_info structure. */ #define ppc_hash_table(p) \ @@ -2022,10 +2885,9 @@ static boolean ppc64_elf_finish_dynamic_sections /* Create an entry in the stub hash table. */ static struct bfd_hash_entry * -stub_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +stub_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ @@ -2044,11 +2906,11 @@ stub_hash_newfunc (entry, table, string) /* Initialize the local fields. */ eh = (struct ppc_stub_hash_entry *) entry; + eh->stub_type = ppc_stub_none; eh->stub_sec = NULL; eh->stub_offset = 0; eh->target_value = 0; eh->target_section = NULL; - eh->stub_type = ppc_stub_none; eh->h = NULL; eh->id_sec = NULL; } @@ -2059,10 +2921,9 @@ stub_hash_newfunc (entry, table, string) /* Create an entry in the branch hash table. */ static struct bfd_hash_entry * -branch_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +branch_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ @@ -2091,10 +2952,9 @@ branch_hash_newfunc (entry, table, string) /* Create an entry in a ppc64 ELF linker hash table. */ static struct bfd_hash_entry * -link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ @@ -2117,6 +2977,8 @@ link_hash_newfunc (entry, table, string) eh->is_func = 0; eh->is_func_descriptor = 0; eh->is_entry = 0; + eh->adjust_done = 0; + eh->tls_mask = 0; } return entry; @@ -2125,13 +2987,12 @@ link_hash_newfunc (entry, table, string) /* Create a ppc64 ELF linker hash table. */ static struct bfd_link_hash_table * -ppc64_elf_link_hash_table_create (abfd) - bfd *abfd; +ppc64_elf_link_hash_table_create (bfd *abfd) { struct ppc_link_hash_table *htab; bfd_size_type amt = sizeof (struct ppc_link_hash_table); - htab = (struct ppc_link_hash_table *) bfd_malloc (amt); + htab = bfd_zmalloc (amt); if (htab == NULL) return NULL; @@ -2149,25 +3010,14 @@ ppc64_elf_link_hash_table_create (abfd) if (!bfd_hash_table_init (&htab->branch_hash_table, branch_hash_newfunc)) return NULL; - htab->stub_bfd = NULL; - htab->add_stub_section = NULL; - htab->layout_sections_again = NULL; - htab->stub_group = NULL; - htab->sgot = NULL; - htab->srelgot = NULL; - htab->splt = NULL; - htab->srelplt = NULL; - htab->sdynbss = NULL; - htab->srelbss = NULL; - htab->sglink = NULL; - htab->sfpr = NULL; - htab->sbrlt = NULL; - htab->srelbrlt = NULL; - htab->stub_error = 0; - htab->has_14bit_branch = 0; - htab->have_undefweak = 0; - htab->stub_iteration = 0; - htab->sym_sec.abfd = NULL; + /* Initializing two fields of the union is just cosmetic. We really + only care about glist, but when compiled on a 32-bit host the + bfd_vma fields are larger. Setting the bfd_vma to zero makes + debugger inspection of these fields look nicer. */ + htab->elf.init_refcount.refcount = 0; + htab->elf.init_refcount.glist = NULL; + htab->elf.init_offset.offset = 0; + htab->elf.init_offset.glist = NULL; return &htab->elf.root; } @@ -2175,8 +3025,7 @@ ppc64_elf_link_hash_table_create (abfd) /* Free the derived linker hash table. */ static void -ppc64_elf_link_hash_table_free (hash) - struct bfd_link_hash_table *hash; +ppc64_elf_link_hash_table_free (struct bfd_link_hash_table *hash) { struct ppc_link_hash_table *ret = (struct ppc_link_hash_table *) hash; @@ -2185,14 +3034,30 @@ ppc64_elf_link_hash_table_free (hash) _bfd_generic_link_hash_table_free (hash); } +/* Satisfy the ELF linker by filling in some fields in our fake bfd. */ + +void +ppc64_elf_init_stub_bfd (bfd *abfd, struct bfd_link_info *info) +{ + struct ppc_link_hash_table *htab; + + elf_elfheader (abfd)->e_ident[EI_CLASS] = ELFCLASS64; + +/* Always hook our dynamic sections into the first bfd, which is the + linker created stub bfd. This ensures that the GOT header is at + the start of the output TOC section. */ + htab = ppc_hash_table (info); + htab->stub_bfd = abfd; + htab->elf.dynobj = abfd; +} + /* Build a name for an entry in the stub hash table. */ static char * -ppc_stub_name (input_section, sym_sec, h, rel) - const asection *input_section; - const asection *sym_sec; - const struct ppc_link_hash_entry *h; - const Elf_Internal_Rela *rel; +ppc_stub_name (const asection *input_section, + const asection *sym_sec, + const struct ppc_link_hash_entry *h, + const Elf_Internal_Rela *rel) { char *stub_name; bfd_size_type len; @@ -2208,7 +3073,7 @@ ppc_stub_name (input_section, sym_sec, h, rel) stub_name = bfd_malloc (len); if (stub_name != NULL) { - sprintf (stub_name, "%08x_%s+%x", + sprintf (stub_name, "%08x.%s+%x", input_section->id & 0xffffffff, h->elf.root.root.string, (int) rel->r_addend & 0xffffffff); @@ -2216,11 +3081,11 @@ ppc_stub_name (input_section, sym_sec, h, rel) } else { - len = 8 + 1 + 8 + 1 + 8 + 1 + 16 + 1; + 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", + sprintf (stub_name, "%08x.%x:%x+%x", input_section->id & 0xffffffff, sym_sec->id & 0xffffffff, (int) ELF64_R_SYM (rel->r_info) & 0xffffffff, @@ -2234,12 +3099,11 @@ ppc_stub_name (input_section, sym_sec, h, rel) creating the stub name takes a bit of time. */ static struct ppc_stub_hash_entry * -ppc_get_stub_entry (input_section, sym_sec, hash, rel, htab) - const asection *input_section; - const asection *sym_sec; - struct elf_link_hash_entry *hash; - const Elf_Internal_Rela *rel; - struct ppc_link_hash_table *htab; +ppc_get_stub_entry (const asection *input_section, + const asection *sym_sec, + struct elf_link_hash_entry *hash, + const Elf_Internal_Rela *rel, + struct ppc_link_hash_table *htab) { struct ppc_stub_hash_entry *stub_entry; struct ppc_link_hash_entry *h = (struct ppc_link_hash_entry *) hash; @@ -2267,7 +3131,7 @@ ppc_get_stub_entry (input_section, sym_sec, hash, rel, htab) return NULL; stub_entry = ppc_stub_hash_lookup (&htab->stub_hash_table, - stub_name, false, false); + stub_name, FALSE, FALSE); if (h != NULL) h->stub_cache = stub_entry; @@ -2281,10 +3145,9 @@ ppc_get_stub_entry (input_section, sym_sec, hash, rel, htab) stub entry are initialised. */ static struct ppc_stub_hash_entry * -ppc_add_stub (stub_name, section, htab) - const char *stub_name; - asection *section; - struct ppc_link_hash_table *htab; +ppc_add_stub (const char *stub_name, + asection *section, + struct ppc_link_hash_table *htab) { asection *link_sec; asection *stub_sec; @@ -2319,7 +3182,7 @@ ppc_add_stub (stub_name, section, htab) /* Enter this entry into the linker stub hash table. */ stub_entry = ppc_stub_hash_lookup (&htab->stub_hash_table, stub_name, - true, false); + TRUE, FALSE); if (stub_entry == NULL) { (*_bfd_error_handler) (_("%s: cannot create stub entry %s"), @@ -2336,10 +3199,8 @@ ppc_add_stub (stub_name, section, htab) /* Create sections for linker generated code. */ -static boolean -create_linkage_sections (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; +static bfd_boolean +create_linkage_sections (bfd *dynobj, struct bfd_link_info *info) { struct ppc_link_hash_table *htab; flagword flags; @@ -2353,107 +3214,118 @@ create_linkage_sections (dynobj, info) if (htab->sfpr == NULL || ! bfd_set_section_flags (dynobj, htab->sfpr, flags) || ! bfd_set_section_alignment (dynobj, htab->sfpr, 2)) - return false; + return FALSE; /* Create .glink for lazy dynamic linking support. */ - htab->sglink = bfd_make_section_anyway (dynobj, ".glink"); - if (htab->sglink == NULL - || ! bfd_set_section_flags (dynobj, htab->sglink, flags) - || ! bfd_set_section_alignment (dynobj, htab->sglink, 2)) - return false; + htab->glink = bfd_make_section_anyway (dynobj, ".glink"); + if (htab->glink == NULL + || ! bfd_set_section_flags (dynobj, htab->glink, flags) + || ! bfd_set_section_alignment (dynobj, htab->glink, 2)) + return FALSE; /* Create .branch_lt for plt_branch stubs. */ flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - htab->sbrlt = bfd_make_section_anyway (dynobj, ".branch_lt"); - if (htab->sbrlt == NULL - || ! bfd_set_section_flags (dynobj, htab->sbrlt, flags) - || ! bfd_set_section_alignment (dynobj, htab->sbrlt, 3)) - return false; + htab->brlt = bfd_make_section_anyway (dynobj, ".branch_lt"); + if (htab->brlt == NULL + || ! bfd_set_section_flags (dynobj, htab->brlt, flags) + || ! bfd_set_section_alignment (dynobj, htab->brlt, 3)) + return FALSE; if (info->shared) { flags = (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_LINKER_CREATED); - htab->srelbrlt = bfd_make_section_anyway (dynobj, ".rela.branch_lt"); - if (!htab->srelbrlt - || ! bfd_set_section_flags (dynobj, htab->srelbrlt, flags) - || ! bfd_set_section_alignment (dynobj, htab->srelbrlt, 3)) - return false; + htab->relbrlt = bfd_make_section_anyway (dynobj, ".rela.branch_lt"); + if (!htab->relbrlt + || ! bfd_set_section_flags (dynobj, htab->relbrlt, flags) + || ! bfd_set_section_alignment (dynobj, htab->relbrlt, 3)) + return FALSE; } - return true; + return TRUE; } -/* Create .got and .rela.got sections in DYNOBJ, and set up - shortcuts to them in our hash table. */ +/* Create .got and .rela.got sections in ABFD, and .got in dynobj if + not already done. */ -static boolean -create_got_section (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; +static bfd_boolean +create_got_section (bfd *abfd, struct bfd_link_info *info) { - struct ppc_link_hash_table *htab; + asection *got, *relgot; + flagword flags; + struct ppc_link_hash_table *htab = ppc_hash_table (info); - if (! _bfd_elf_create_got_section (dynobj, info)) - return false; + if (!htab->got) + { + if (! _bfd_elf_create_got_section (htab->elf.dynobj, info)) + return FALSE; - htab = ppc_hash_table (info); - htab->sgot = bfd_get_section_by_name (dynobj, ".got"); - if (!htab->sgot) - abort (); + htab->got = bfd_get_section_by_name (htab->elf.dynobj, ".got"); + if (!htab->got) + abort (); + } - htab->srelgot = bfd_make_section (dynobj, ".rela.got"); - if (!htab->srelgot - || ! bfd_set_section_flags (dynobj, htab->srelgot, - (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS - | SEC_IN_MEMORY | SEC_LINKER_CREATED - | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, htab->srelgot, 3)) - return false; - return true; + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY + | SEC_LINKER_CREATED); + + got = bfd_make_section (abfd, ".got"); + if (!got + || !bfd_set_section_flags (abfd, got, flags) + || !bfd_set_section_alignment (abfd, got, 3)) + return FALSE; + + relgot = bfd_make_section (abfd, ".rela.got"); + if (!relgot + || ! bfd_set_section_flags (abfd, relgot, flags | SEC_READONLY) + || ! bfd_set_section_alignment (abfd, relgot, 3)) + return FALSE; + + ppc64_elf_tdata (abfd)->got = got; + ppc64_elf_tdata (abfd)->relgot = relgot; + return TRUE; } /* Create the dynamic sections, and set up shortcuts. */ -static boolean -ppc64_elf_create_dynamic_sections (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; +static bfd_boolean +ppc64_elf_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) { struct ppc_link_hash_table *htab; - htab = ppc_hash_table (info); - if (!htab->sgot && !create_got_section (dynobj, info)) - return false; - if (!_bfd_elf_create_dynamic_sections (dynobj, info)) - return false; + return FALSE; - htab->splt = bfd_get_section_by_name (dynobj, ".plt"); - htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); - htab->sdynbss = bfd_get_section_by_name (dynobj, ".dynbss"); + htab = ppc_hash_table (info); + if (!htab->got) + htab->got = bfd_get_section_by_name (dynobj, ".got"); + htab->plt = bfd_get_section_by_name (dynobj, ".plt"); + htab->relplt = bfd_get_section_by_name (dynobj, ".rela.plt"); + htab->dynbss = bfd_get_section_by_name (dynobj, ".dynbss"); if (!info->shared) - htab->srelbss = bfd_get_section_by_name (dynobj, ".rela.bss"); + htab->relbss = bfd_get_section_by_name (dynobj, ".rela.bss"); - if (!htab->splt || !htab->srelplt || !htab->sdynbss - || (!info->shared && !htab->srelbss)) + if (!htab->got || !htab->plt || !htab->relplt || !htab->dynbss + || (!info->shared && !htab->relbss)) abort (); - return true; + return TRUE; } /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -ppc64_elf_copy_indirect_symbol (bed, dir, ind) - struct elf_backend_data *bed; - struct elf_link_hash_entry *dir, *ind; +ppc64_elf_copy_indirect_symbol + (const struct elf_backend_data *bed ATTRIBUTE_UNUSED, + struct elf_link_hash_entry *dir, + struct elf_link_hash_entry *ind) { struct ppc_link_hash_entry *edir, *eind; + flagword mask; edir = (struct ppc_link_hash_entry *) dir; eind = (struct ppc_link_hash_entry *) ind; + /* Copy over any dynamic relocs we may have on the indirect sym. */ if (eind->dyn_relocs != NULL) { if (edir->dyn_relocs != NULL) @@ -2461,7 +3333,7 @@ ppc64_elf_copy_indirect_symbol (bed, dir, ind) struct ppc_dyn_relocs **pp; struct ppc_dyn_relocs *p; - if (ind->root.type == bfd_link_hash_indirect) + if (eind->elf.root.type == bfd_link_hash_indirect) abort (); /* Add reloc counts against the weak sym to the strong sym @@ -2478,29 +3350,115 @@ ppc64_elf_copy_indirect_symbol (bed, dir, ind) *pp = p->next; break; } - if (q == NULL) - pp = &p->next; + if (q == NULL) + pp = &p->next; + } + *pp = edir->dyn_relocs; + } + + edir->dyn_relocs = eind->dyn_relocs; + eind->dyn_relocs = NULL; + } + + edir->is_func |= eind->is_func; + edir->is_func_descriptor |= eind->is_func_descriptor; + edir->is_entry |= eind->is_entry; + edir->tls_mask |= eind->tls_mask; + + mask = (ELF_LINK_HASH_REF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK | ELF_LINK_NON_GOT_REF + | ELF_LINK_HASH_NEEDS_PLT); + /* If called to transfer flags for a weakdef during processing + of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF. + We clear it ourselves for ELIMINATE_COPY_RELOCS. */ + if (ELIMINATE_COPY_RELOCS + && eind->elf.root.type != bfd_link_hash_indirect + && (edir->elf.elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) + mask &= ~ELF_LINK_NON_GOT_REF; + + edir->elf.elf_link_hash_flags |= eind->elf.elf_link_hash_flags & mask; + + /* If we were called to copy over info for a weak sym, that's all. */ + if (eind->elf.root.type != bfd_link_hash_indirect) + return; + + /* Copy over got entries that we may have already seen to the + symbol which just became indirect. */ + if (eind->elf.got.glist != NULL) + { + if (edir->elf.got.glist != NULL) + { + struct got_entry **entp; + struct got_entry *ent; + + for (entp = &eind->elf.got.glist; (ent = *entp) != NULL; ) + { + struct got_entry *dent; + + for (dent = edir->elf.got.glist; dent != NULL; dent = dent->next) + if (dent->addend == ent->addend + && dent->owner == ent->owner + && dent->tls_type == ent->tls_type) + { + dent->got.refcount += ent->got.refcount; + *entp = ent->next; + break; + } + if (dent == NULL) + entp = &ent->next; + } + *entp = edir->elf.got.glist; + } + + edir->elf.got.glist = eind->elf.got.glist; + eind->elf.got.glist = NULL; + } + + /* And plt entries. */ + if (eind->elf.plt.plist != NULL) + { + if (edir->elf.plt.plist != NULL) + { + struct plt_entry **entp; + struct plt_entry *ent; + + for (entp = &eind->elf.plt.plist; (ent = *entp) != NULL; ) + { + struct plt_entry *dent; + + for (dent = edir->elf.plt.plist; dent != NULL; dent = dent->next) + if (dent->addend == ent->addend) + { + dent->plt.refcount += ent->plt.refcount; + *entp = ent->next; + break; + } + if (dent == NULL) + entp = &ent->next; } - *pp = edir->dyn_relocs; + *entp = edir->elf.plt.plist; } - edir->dyn_relocs = eind->dyn_relocs; - eind->dyn_relocs = NULL; + edir->elf.plt.plist = eind->elf.plt.plist; + eind->elf.plt.plist = NULL; } - edir->is_func |= eind->is_func; - edir->is_func_descriptor |= eind->is_func_descriptor; - edir->is_entry |= eind->is_entry; - - _bfd_elf_link_hash_copy_indirect (bed, dir, ind); + if (edir->elf.dynindx == -1) + { + edir->elf.dynindx = eind->elf.dynindx; + edir->elf.dynstr_index = eind->elf.dynstr_index; + eind->elf.dynindx = -1; + eind->elf.dynstr_index = 0; + } + else + BFD_ASSERT (eind->elf.dynindx == -1); } /* Set a flag, used by ppc64_elf_gc_mark_hook, on the entry symbol and symbols undefined on the command-line. */ -boolean -ppc64_elf_mark_entry_syms (info) - struct bfd_link_info *info; +bfd_boolean +ppc64_elf_mark_entry_syms (struct bfd_link_info *info) { struct ppc_link_hash_table *htab; struct bfd_sym_chain *sym; @@ -2510,23 +3468,134 @@ ppc64_elf_mark_entry_syms (info) { struct elf_link_hash_entry *h; - h = elf_link_hash_lookup (&htab->elf, sym->name, false, false, false); + h = elf_link_hash_lookup (&htab->elf, sym->name, FALSE, FALSE, FALSE); if (h != NULL) ((struct ppc_link_hash_entry *) h)->is_entry = 1; } - return true; + return TRUE; +} + +/* Hack symbols defined in .opd sections to be function type. */ + +static bfd_boolean +ppc64_elf_add_symbol_hook (bfd *ibfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Sym *isym, + const char **name ATTRIBUTE_UNUSED, + flagword *flags ATTRIBUTE_UNUSED, + asection **sec, + bfd_vma *value ATTRIBUTE_UNUSED) +{ + if (strcmp (bfd_get_section_name (ibfd, *sec), ".opd") == 0) + isym->st_info = ELF_ST_INFO (ELF_ST_BIND (isym->st_info), STT_FUNC); + return TRUE; +} + +static bfd_boolean +update_local_sym_info (bfd *abfd, Elf_Internal_Shdr *symtab_hdr, + unsigned long r_symndx, bfd_vma r_addend, int tls_type) +{ + struct got_entry **local_got_ents = elf_local_got_ents (abfd); + char *local_got_tls_masks; + + if (local_got_ents == NULL) + { + bfd_size_type size = symtab_hdr->sh_info; + + size *= sizeof (*local_got_ents) + sizeof (*local_got_tls_masks); + local_got_ents = bfd_zalloc (abfd, size); + if (local_got_ents == NULL) + return FALSE; + elf_local_got_ents (abfd) = local_got_ents; + } + + if ((tls_type & TLS_EXPLICIT) == 0) + { + struct got_entry *ent; + + for (ent = local_got_ents[r_symndx]; ent != NULL; ent = ent->next) + if (ent->addend == r_addend + && ent->owner == abfd + && ent->tls_type == tls_type) + break; + if (ent == NULL) + { + bfd_size_type amt = sizeof (*ent); + ent = bfd_alloc (abfd, amt); + if (ent == NULL) + return FALSE; + ent->next = local_got_ents[r_symndx]; + ent->addend = r_addend; + ent->owner = abfd; + ent->tls_type = tls_type; + ent->got.refcount = 0; + local_got_ents[r_symndx] = ent; + } + ent->got.refcount += 1; + } + + local_got_tls_masks = (char *) (local_got_ents + symtab_hdr->sh_info); + local_got_tls_masks[r_symndx] |= tls_type; + return TRUE; +} + +static bfd_boolean +update_plt_info (bfd *abfd, struct ppc_link_hash_entry *eh, bfd_vma addend) +{ + struct plt_entry *ent; + + for (ent = eh->elf.plt.plist; ent != NULL; ent = ent->next) + if (ent->addend == addend) + break; + if (ent == NULL) + { + bfd_size_type amt = sizeof (*ent); + ent = bfd_alloc (abfd, amt); + if (ent == NULL) + return FALSE; + ent->next = eh->elf.plt.plist; + ent->addend = addend; + ent->plt.refcount = 0; + eh->elf.plt.plist = ent; + } + ent->plt.refcount += 1; + eh->elf.elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + eh->is_func = 1; + return TRUE; +} + +/* Find the function descriptor hash entry from the given function code + hash entry FH. Link the entries via their OH fields. */ +static struct ppc_link_hash_entry * +get_fdh (struct ppc_link_hash_entry *fh, struct ppc_link_hash_table *htab) +{ + struct ppc_link_hash_entry *fdh = (struct ppc_link_hash_entry *) fh->oh; + + if (fdh == NULL) + { + const char *fd_name = fh->elf.root.root.string + 1; + + fdh = (struct ppc_link_hash_entry *) + elf_link_hash_lookup (&htab->elf, fd_name, FALSE, FALSE, FALSE); + if (fdh != NULL) + { + fdh->is_func_descriptor = 1; + fdh->oh = &fh->elf; + fh->is_func = 1; + fh->oh = &fdh->elf; + } + } + + return fdh; } /* Look through the relocs for a section during the first phase, and calculate needed space in the global offset table, procedure linkage table, and dynamic reloc sections. */ -static boolean -ppc64_elf_check_relocs (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +static bfd_boolean +ppc64_elf_check_relocs (bfd *abfd, struct bfd_link_info *info, + asection *sec, const Elf_Internal_Rela *relocs) { struct ppc_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; @@ -2536,8 +3605,17 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) asection *sreloc; asection **opd_sym_map; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; + + /* Don't do anything special with non-loaded, non-alloced sections. + In particular, any relocs in such sections should not affect GOT + and PLT reference counting (ie. we don't allow them to create GOT + or PLT entries), there's no possibility or desire to optimize TLS + relocs, and there's not much point in propagating relocs to shared + libs that the dynamic linker won't relocate. */ + if ((sec->flags & SEC_ALLOC) == 0) + return TRUE; htab = ppc_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -2567,24 +3645,23 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) bfd_size_type amt; amt = sec->_raw_size * sizeof (union opd_info) / 24; - opd_sym_map = (asection **) bfd_zalloc (abfd, amt); + opd_sym_map = bfd_zalloc (abfd, amt); if (opd_sym_map == NULL) - return false; - elf_section_data (sec)->tdata = opd_sym_map; + return FALSE; + ppc64_elf_section_data (sec)->opd.func_sec = opd_sym_map; } - if (htab->elf.dynobj == NULL) - htab->elf.dynobj = abfd; if (htab->sfpr == NULL && !create_linkage_sections (htab->elf.dynobj, info)) - return false; + return FALSE; rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { unsigned long r_symndx; struct elf_link_hash_entry *h; - enum elf_ppc_reloc_type r_type; + enum elf_ppc64_reloc_type r_type; + int tls_type = 0; r_symndx = ELF64_R_SYM (rel->r_info); if (r_symndx < symtab_hdr->sh_info) @@ -2592,46 +3669,86 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); + r_type = ELF64_R_TYPE (rel->r_info); switch (r_type) { - /* GOT16 relocations */ + case R_PPC64_GOT_TLSLD16: + case R_PPC64_GOT_TLSLD16_LO: + case R_PPC64_GOT_TLSLD16_HI: + case R_PPC64_GOT_TLSLD16_HA: + ppc64_tlsld_got (abfd)->refcount += 1; + tls_type = TLS_TLS | TLS_LD; + goto dogottls; + + case R_PPC64_GOT_TLSGD16: + case R_PPC64_GOT_TLSGD16_LO: + case R_PPC64_GOT_TLSGD16_HI: + case R_PPC64_GOT_TLSGD16_HA: + tls_type = TLS_TLS | TLS_GD; + goto dogottls; + + case R_PPC64_GOT_TPREL16_DS: + case R_PPC64_GOT_TPREL16_LO_DS: + case R_PPC64_GOT_TPREL16_HI: + case R_PPC64_GOT_TPREL16_HA: + if (info->shared) + info->flags |= DF_STATIC_TLS; + tls_type = TLS_TLS | TLS_TPREL; + goto dogottls; + + case R_PPC64_GOT_DTPREL16_DS: + case R_PPC64_GOT_DTPREL16_LO_DS: + case R_PPC64_GOT_DTPREL16_HI: + case R_PPC64_GOT_DTPREL16_HA: + tls_type = TLS_TLS | TLS_DTPREL; + dogottls: + sec->has_tls_reloc = 1; + /* Fall thru */ + case R_PPC64_GOT16: case R_PPC64_GOT16_DS: case R_PPC64_GOT16_HA: case R_PPC64_GOT16_HI: case R_PPC64_GOT16_LO: case R_PPC64_GOT16_LO_DS: - /* This symbol requires a global offset table entry. */ - if (htab->sgot == NULL - && !create_got_section (htab->elf.dynobj, info)) - return false; + sec->has_gp_reloc = 1; + if (ppc64_elf_tdata (abfd)->got == NULL + && !create_got_section (abfd, info)) + return FALSE; if (h != NULL) { - h->got.refcount += 1; - } - else - { - bfd_signed_vma *local_got_refcounts; + struct ppc_link_hash_entry *eh; + struct got_entry *ent; - /* This is a global offset table entry for a local symbol. */ - local_got_refcounts = elf_local_got_refcounts (abfd); - if (local_got_refcounts == NULL) + eh = (struct ppc_link_hash_entry *) h; + for (ent = eh->elf.got.glist; ent != NULL; ent = ent->next) + if (ent->addend == rel->r_addend + && ent->owner == abfd + && ent->tls_type == tls_type) + break; + if (ent == NULL) { - bfd_size_type size; - - size = symtab_hdr->sh_info; - size *= sizeof (bfd_signed_vma); - local_got_refcounts = ((bfd_signed_vma *) - bfd_zalloc (abfd, size)); - if (local_got_refcounts == NULL) - return false; - elf_local_got_refcounts (abfd) = local_got_refcounts; + bfd_size_type amt = sizeof (*ent); + ent = bfd_alloc (abfd, amt); + if (ent == NULL) + return FALSE; + ent->next = eh->elf.got.glist; + ent->addend = rel->r_addend; + ent->owner = abfd; + ent->tls_type = tls_type; + ent->got.refcount = 0; + eh->elf.got.glist = ent; } - local_got_refcounts[r_symndx] += 1; + ent->got.refcount += 1; + eh->tls_mask |= tls_type; } + else + /* This is a global offset table entry for a local symbol. */ + if (!update_local_sym_info (abfd, symtab_hdr, r_symndx, + rel->r_addend, tls_type)) + return FALSE; break; case R_PPC64_PLT16_HA: @@ -2649,12 +3766,12 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) /* It does not make sense to have a procedure linkage table entry for a local symbol. */ bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } - - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - h->plt.refcount += 1; - ((struct ppc_link_hash_entry *) h)->is_func = 1; + else + if (!update_plt_info (abfd, (struct ppc_link_hash_entry *) h, + rel->r_addend)) + return FALSE; break; /* The following relocations don't need to propagate the @@ -2666,26 +3783,40 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) case R_PPC64_SECTOFF_HA: case R_PPC64_SECTOFF_DS: case R_PPC64_SECTOFF_LO_DS: + case R_PPC64_DTPREL16: + case R_PPC64_DTPREL16_LO: + case R_PPC64_DTPREL16_HI: + case R_PPC64_DTPREL16_HA: + case R_PPC64_DTPREL16_DS: + case R_PPC64_DTPREL16_LO_DS: + case R_PPC64_DTPREL16_HIGHER: + case R_PPC64_DTPREL16_HIGHERA: + case R_PPC64_DTPREL16_HIGHEST: + case R_PPC64_DTPREL16_HIGHESTA: + break; + + /* Nor do these. */ case R_PPC64_TOC16: case R_PPC64_TOC16_LO: case R_PPC64_TOC16_HI: case R_PPC64_TOC16_HA: case R_PPC64_TOC16_DS: case R_PPC64_TOC16_LO_DS: + sec->has_gp_reloc = 1; break; /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ case R_PPC64_GNU_VTINHERIT: - if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) - return false; + if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + return FALSE; break; /* This relocation describes which C++ vtable entries are actually used. Record for later use during GC. */ case R_PPC64_GNU_VTENTRY: - if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend)) - return false; + if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return FALSE; break; case R_PPC64_REL14: @@ -2701,9 +3832,92 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) { /* We may need a .plt entry if the function this reloc refers to is in a shared lib. */ - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - h->plt.refcount += 1; - ((struct ppc_link_hash_entry *) h)->is_func = 1; + if (!update_plt_info (abfd, (struct ppc_link_hash_entry *) h, + rel->r_addend)) + return FALSE; + if (h == htab->tls_get_addr) + sec->has_tls_reloc = 1; + else if ((strncmp (h->root.root.string, ".__tls_get_addr", 15) + == 0) + && (h->root.root.string[15] == 0 + || h->root.root.string[15] == '@')) + { + htab->tls_get_addr = h; + sec->has_tls_reloc = 1; + } + } + break; + + case R_PPC64_TPREL64: + tls_type = TLS_EXPLICIT | TLS_TLS | TLS_TPREL; + if (info->shared) + info->flags |= DF_STATIC_TLS; + goto dotlstoc; + + case R_PPC64_DTPMOD64: + if (rel + 1 < rel_end + && rel[1].r_info == ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64) + && rel[1].r_offset == rel->r_offset + 8) + tls_type = TLS_EXPLICIT | TLS_TLS | TLS_GD; + else + tls_type = TLS_EXPLICIT | TLS_TLS | TLS_LD; + goto dotlstoc; + + case R_PPC64_DTPREL64: + tls_type = TLS_EXPLICIT | TLS_TLS | TLS_DTPREL; + if (rel != relocs + && rel[-1].r_info == ELF64_R_INFO (r_symndx, R_PPC64_DTPMOD64) + && rel[-1].r_offset == rel->r_offset - 8) + /* This is the second reloc of a dtpmod, dtprel pair. + Don't mark with TLS_DTPREL. */ + goto dodyn; + + dotlstoc: + sec->has_tls_reloc = 1; + if (h != NULL) + { + struct ppc_link_hash_entry *eh; + eh = (struct ppc_link_hash_entry *) h; + eh->tls_mask |= tls_type; + } + else + if (!update_local_sym_info (abfd, symtab_hdr, r_symndx, + rel->r_addend, tls_type)) + return FALSE; + + if (ppc64_elf_section_data (sec)->t_symndx == NULL) + { + /* One extra to simplify get_tls_mask. */ + bfd_size_type amt = sec->_raw_size * sizeof (unsigned) / 8 + 1; + ppc64_elf_section_data (sec)->t_symndx = bfd_zalloc (abfd, amt); + if (ppc64_elf_section_data (sec)->t_symndx == NULL) + return FALSE; + } + BFD_ASSERT (rel->r_offset % 8 == 0); + ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8] = r_symndx; + + /* Mark the second slot of a GD or LD entry. + -1 to indicate GD and -2 to indicate LD. */ + if (tls_type == (TLS_EXPLICIT | TLS_TLS | TLS_GD)) + ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8 + 1] = -1; + else if (tls_type == (TLS_EXPLICIT | TLS_TLS | TLS_LD)) + ppc64_elf_section_data (sec)->t_symndx[rel->r_offset / 8 + 1] = -2; + goto dodyn; + + case R_PPC64_TPREL16: + case R_PPC64_TPREL16_LO: + case R_PPC64_TPREL16_HI: + case R_PPC64_TPREL16_HA: + case R_PPC64_TPREL16_DS: + case R_PPC64_TPREL16_LO_DS: + case R_PPC64_TPREL16_HIGHER: + case R_PPC64_TPREL16_HIGHERA: + case R_PPC64_TPREL16_HIGHEST: + case R_PPC64_TPREL16_HIGHESTA: + if (info->shared) + { + info->flags |= DF_STATIC_TLS; + goto dodyn; } break; @@ -2712,38 +3926,27 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) && h != NULL && h->root.root.string[0] == '.' && h->root.root.string[1] != 0) - { - struct elf_link_hash_entry *fdh; + get_fdh ((struct ppc_link_hash_entry *) h, htab); - fdh = elf_link_hash_lookup (&htab->elf, h->root.root.string + 1, - false, false, false); - if (fdh != NULL) - { - ((struct ppc_link_hash_entry *) fdh)->is_func_descriptor = 1; - ((struct ppc_link_hash_entry *) fdh)->oh = h; - ((struct ppc_link_hash_entry *) h)->is_func = 1; - ((struct ppc_link_hash_entry *) h)->oh = fdh; - } - } if (opd_sym_map != NULL && h == NULL && rel + 1 < rel_end - && ((enum elf_ppc_reloc_type) ELF64_R_TYPE ((rel + 1)->r_info) - == R_PPC64_TOC)) + && ELF64_R_TYPE ((rel + 1)->r_info) == R_PPC64_TOC) { asection *s; s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, sec, r_symndx); if (s == NULL) - return false; + return FALSE; else if (s != sec) opd_sym_map[rel->r_offset / 24] = s; } /* Fall through. */ - case R_PPC64_REL64: + case R_PPC64_REL30: case R_PPC64_REL32: + case R_PPC64_REL64: case R_PPC64_ADDR14: case R_PPC64_ADDR14_BRNTAKEN: case R_PPC64_ADDR14_BRTAKEN: @@ -2758,12 +3961,15 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) case R_PPC64_ADDR16_LO: case R_PPC64_ADDR16_LO_DS: case R_PPC64_ADDR24: - case R_PPC64_ADDR30: case R_PPC64_ADDR32: case R_PPC64_UADDR16: case R_PPC64_UADDR32: case R_PPC64_UADDR64: case R_PPC64_TOC: + if (h != NULL && !info->shared) + /* We may need a copy reloc. */ + h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; + /* Don't propagate .opd relocs. */ if (NO_OPD_RELOCS && opd_sym_map != NULL) break; @@ -2780,7 +3986,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) 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 + storing information in the dyn_relocs field of the hash table entry. A similar situation occurs when creating shared libraries and symbol visibility changes render the symbol local. @@ -2789,16 +3995,16 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) may need to keep relocations for symbols satisfied by a dynamic library if we manage to avoid copy relocs for the symbol. */ + dodyn: if ((info->shared - && (sec->flags & SEC_ALLOC) != 0 - && (IS_ABSOLUTE_RELOC (r_type) + && (MUST_BE_DYN_RELOC (r_type) || (h != NULL && (! info->symbolic || h->root.type == bfd_link_hash_defweak || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared - && (sec->flags & SEC_ALLOC) != 0 + || (ELIMINATE_COPY_RELOCS + && !info->shared && h != NULL && (h->root.type == bfd_link_hash_defweak || (h->elf_link_hash_flags @@ -2820,7 +4026,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) elf_elfheader (abfd)->e_shstrndx, elf_section_data (sec)->rel_hdr.sh_name)); if (name == NULL) - return false; + return FALSE; if (strncmp (name, ".rela", 5) != 0 || strcmp (bfd_get_section_name (abfd, sec), @@ -2846,7 +4052,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) if (sreloc == NULL || ! bfd_set_section_flags (dynobj, sreloc, flags) || ! bfd_set_section_alignment (dynobj, sreloc, 3)) - return false; + return FALSE; } elf_section_data (sec)->sreloc = sreloc; } @@ -2867,7 +4073,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, sec, r_symndx); if (s == NULL) - return false; + return FALSE; head = ((struct ppc_dyn_relocs **) &elf_section_data (s)->local_dynrel); @@ -2876,11 +4082,9 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) p = *head; if (p == NULL || p->sec != sec) { - p = ((struct ppc_dyn_relocs *) - bfd_alloc (htab->elf.dynobj, - (bfd_size_type) sizeof *p)); + p = bfd_alloc (htab->elf.dynobj, sizeof *p); if (p == NULL) - return false; + return FALSE; p->next = *head; *head = p; p->sec = sec; @@ -2889,7 +4093,7 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) } p->count += 1; - if (!IS_ABSOLUTE_RELOC (r_type)) + if (!MUST_BE_DYN_RELOC (r_type)) p->pc_count += 1; } break; @@ -2899,28 +4103,27 @@ ppc64_elf_check_relocs (abfd, info, sec, relocs) } } - return true; + return TRUE; } /* Return the section that should be marked against GC for a given relocation. */ static asection * -ppc64_elf_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +ppc64_elf_gc_mark_hook (asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { asection *rsec = NULL; if (h != NULL) { - enum elf_ppc_reloc_type r_type; + enum elf_ppc64_reloc_type r_type; struct ppc_link_hash_entry *fdh; - r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); + r_type = ELF64_R_TYPE (rel->r_info); switch (r_type) { case R_PPC64_GNU_VTINHERIT: @@ -2942,10 +4145,10 @@ ppc64_elf_gc_mark_hook (sec, info, rel, h, sym) /* Function entry syms return NULL if they are in .opd and are not ._start (or others undefined on the ld command line). Thus we avoid marking all function - sections, as all functions are referenced in .opd. */ + sections, as all functions are referenced in .opd. */ else if ((fdh->oh != NULL && ((struct ppc_link_hash_entry *) fdh->oh)->is_entry) - || elf_section_data (sec)->tdata == NULL) + || ppc64_elf_section_data (sec)->opd.func_sec == NULL) rsec = h->root.u.def.section; break; @@ -2963,10 +4166,10 @@ ppc64_elf_gc_mark_hook (sec, info, rel, h, sym) asection **opd_sym_section; rsec = bfd_section_from_elf_index (sec->owner, sym->st_shndx); - opd_sym_section = (asection **) elf_section_data (rsec)->tdata; + opd_sym_section = ppc64_elf_section_data (rsec)->opd.func_sec; if (opd_sym_section != NULL) rsec = opd_sym_section[sym->st_value / 24]; - else if (elf_section_data (sec)->tdata != NULL) + else if (ppc64_elf_section_data (sec)->opd.func_sec != NULL) rsec = NULL; } @@ -2976,52 +4179,110 @@ ppc64_elf_gc_mark_hook (sec, info, rel, h, sym) /* Update the .got, .plt. and dynamic reloc reference counts for the section being removed. */ -static boolean -ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - asection *sec; - const Elf_Internal_Rela *relocs; +static bfd_boolean +ppc64_elf_gc_sweep_hook (bfd *abfd, struct bfd_link_info *info, + asection *sec, const Elf_Internal_Rela *relocs) { + struct ppc_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; - bfd_signed_vma *local_got_refcounts; + struct got_entry **local_got_ents; const Elf_Internal_Rela *rel, *relend; + if ((sec->flags & SEC_ALLOC) == 0) + return TRUE; + elf_section_data (sec)->local_dynrel = NULL; + htab = ppc_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); - local_got_refcounts = elf_local_got_refcounts (abfd); + local_got_ents = elf_local_got_ents (abfd); relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) { unsigned long r_symndx; - enum elf_ppc_reloc_type r_type; - struct elf_link_hash_entry *h; + enum elf_ppc64_reloc_type r_type; + struct elf_link_hash_entry *h = NULL; + char tls_type = 0; r_symndx = ELF64_R_SYM (rel->r_info); - r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); + r_type = ELF64_R_TYPE (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct ppc_link_hash_entry *eh; + struct ppc_dyn_relocs **pp; + struct ppc_dyn_relocs *p; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct ppc_link_hash_entry *) h; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } + } + switch (r_type) { + case R_PPC64_GOT_TLSLD16: + case R_PPC64_GOT_TLSLD16_LO: + case R_PPC64_GOT_TLSLD16_HI: + case R_PPC64_GOT_TLSLD16_HA: + ppc64_tlsld_got (abfd)->refcount -= 1; + tls_type = TLS_TLS | TLS_LD; + goto dogot; + + case R_PPC64_GOT_TLSGD16: + case R_PPC64_GOT_TLSGD16_LO: + case R_PPC64_GOT_TLSGD16_HI: + case R_PPC64_GOT_TLSGD16_HA: + tls_type = TLS_TLS | TLS_GD; + goto dogot; + + case R_PPC64_GOT_TPREL16_DS: + case R_PPC64_GOT_TPREL16_LO_DS: + case R_PPC64_GOT_TPREL16_HI: + case R_PPC64_GOT_TPREL16_HA: + tls_type = TLS_TLS | TLS_TPREL; + goto dogot; + + case R_PPC64_GOT_DTPREL16_DS: + case R_PPC64_GOT_DTPREL16_LO_DS: + case R_PPC64_GOT_DTPREL16_HI: + case R_PPC64_GOT_DTPREL16_HA: + tls_type = TLS_TLS | TLS_DTPREL; + goto dogot; + case R_PPC64_GOT16: case R_PPC64_GOT16_DS: case R_PPC64_GOT16_HA: case R_PPC64_GOT16_HI: case R_PPC64_GOT16_LO: case R_PPC64_GOT16_LO_DS: - if (r_symndx >= symtab_hdr->sh_info) - { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (h->got.refcount > 0) - h->got.refcount--; - } - else - { - if (local_got_refcounts[r_symndx] > 0) - local_got_refcounts[r_symndx]--; - } + dogot: + { + struct got_entry *ent; + + if (h != NULL) + ent = h->got.glist; + else + ent = local_got_ents[r_symndx]; + + for (; ent != NULL; ent = ent->next) + if (ent->addend == rel->r_addend + && ent->owner == abfd + && ent->tls_type == tls_type) + break; + if (ent == NULL) + abort (); + if (ent->got.refcount > 0) + ent->got.refcount -= 1; + } break; case R_PPC64_PLT16_HA: @@ -3029,87 +4290,21 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) case R_PPC64_PLT16_LO: case R_PPC64_PLT32: case R_PPC64_PLT64: - if (r_symndx >= symtab_hdr->sh_info) - { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (h->plt.refcount > 0) - h->plt.refcount--; - } - break; - case R_PPC64_REL14: case R_PPC64_REL14_BRNTAKEN: case R_PPC64_REL14_BRTAKEN: case R_PPC64_REL24: - if (r_symndx >= symtab_hdr->sh_info) - { - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - if (h->plt.refcount > 0) - h->plt.refcount--; - } - break; - - case R_PPC64_REL32: - case R_PPC64_REL64: - if (r_symndx >= symtab_hdr->sh_info) - { - struct ppc_link_hash_entry *eh; - struct ppc_dyn_relocs **pp; - struct ppc_dyn_relocs *p; - - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - eh = (struct ppc_link_hash_entry *) h; - - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } - } - break; - - case R_PPC64_ADDR14: - case R_PPC64_ADDR14_BRNTAKEN: - case R_PPC64_ADDR14_BRTAKEN: - case R_PPC64_ADDR16: - case R_PPC64_ADDR16_DS: - case R_PPC64_ADDR16_HA: - case R_PPC64_ADDR16_HI: - case R_PPC64_ADDR16_HIGHER: - case R_PPC64_ADDR16_HIGHERA: - case R_PPC64_ADDR16_HIGHEST: - case R_PPC64_ADDR16_HIGHESTA: - case R_PPC64_ADDR16_LO: - case R_PPC64_ADDR16_LO_DS: - case R_PPC64_ADDR24: - case R_PPC64_ADDR30: - case R_PPC64_ADDR32: - case R_PPC64_ADDR64: - case R_PPC64_UADDR16: - case R_PPC64_UADDR32: - case R_PPC64_UADDR64: - case R_PPC64_TOC: - if (r_symndx >= symtab_hdr->sh_info) + if (h != NULL) { - struct ppc_link_hash_entry *eh; - struct ppc_dyn_relocs **pp; - struct ppc_dyn_relocs *p; + struct plt_entry *ent; - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - eh = (struct ppc_link_hash_entry *) h; - - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } + for (ent = h->plt.plist; ent != NULL; ent = ent->next) + if (ent->addend == rel->r_addend) + break; + if (ent == NULL) + abort (); + if (ent->plt.refcount > 0) + ent->plt.refcount -= 1; } break; @@ -3117,124 +4312,131 @@ ppc64_elf_gc_sweep_hook (abfd, info, sec, relocs) break; } } - return true; + return TRUE; } /* Called via elf_link_hash_traverse to transfer dynamic linking information on function code symbol entries to their corresponding function descriptor symbol entries. */ -static boolean -func_desc_adjust (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +static bfd_boolean +func_desc_adjust (struct elf_link_hash_entry *h, void *inf) { struct bfd_link_info *info; struct ppc_link_hash_table *htab; + struct plt_entry *ent; + struct ppc_link_hash_entry *fh; + struct ppc_link_hash_entry *fdh; + bfd_boolean force_local; - if (h->root.type == bfd_link_hash_indirect) - return true; + fh = (struct ppc_link_hash_entry *) h; + if (fh->elf.root.type == bfd_link_hash_indirect) + return TRUE; - if (h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; + if (fh->elf.root.type == bfd_link_hash_warning) + fh = (struct ppc_link_hash_entry *) fh->elf.root.u.i.link; - info = (struct bfd_link_info *) inf; + info = inf; htab = ppc_hash_table (info); /* If this is a function code symbol, transfer dynamic linking information to the function descriptor symbol. */ - if (!((struct ppc_link_hash_entry *) h)->is_func) - return true; + if (!fh->is_func) + return TRUE; - if (h->root.type == bfd_link_hash_undefweak - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR)) - htab->have_undefweak = true; + if (fh->elf.root.type == bfd_link_hash_undefweak + && (fh->elf.elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR)) + htab->have_undefweak = TRUE; - if (h->plt.refcount > 0 - && h->root.root.string[0] == '.' - && h->root.root.string[1] != '\0') + for (ent = fh->elf.plt.plist; ent != NULL; ent = ent->next) + if (ent->plt.refcount > 0) + break; + if (ent == NULL + || fh->elf.root.root.string[0] != '.' + || fh->elf.root.root.string[1] == '\0') + return TRUE; + + /* Find the corresponding function descriptor symbol. Create it + as undefined if necessary. */ + + fdh = get_fdh (fh, htab); + if (fdh != NULL) + while (fdh->elf.root.type == bfd_link_hash_indirect + || fdh->elf.root.type == bfd_link_hash_warning) + fdh = (struct ppc_link_hash_entry *) fdh->elf.root.u.i.link; + + if (fdh == NULL + && info->shared + && (fh->elf.root.type == bfd_link_hash_undefined + || fh->elf.root.type == bfd_link_hash_undefweak)) { - struct elf_link_hash_entry *fdh = ((struct ppc_link_hash_entry *) h)->oh; - boolean force_local; - - /* Find the corresponding function descriptor symbol. Create it - as undefined if necessary. */ - - if (fdh == NULL) - fdh = elf_link_hash_lookup (&htab->elf, h->root.root.string + 1, - false, false, true); - - if (fdh == NULL - && info->shared - && (h->root.type == bfd_link_hash_undefined - || h->root.type == bfd_link_hash_undefweak)) + bfd *abfd; + asymbol *newsym; + struct bfd_link_hash_entry *bh; + + abfd = fh->elf.root.u.undef.abfd; + newsym = bfd_make_empty_symbol (abfd); + newsym->name = fh->elf.root.root.string + 1; + newsym->section = bfd_und_section_ptr; + newsym->value = 0; + newsym->flags = BSF_OBJECT; + if (fh->elf.root.type == bfd_link_hash_undefweak) + newsym->flags |= BSF_WEAK; + + bh = &fdh->elf.root; + if ( !(_bfd_generic_link_add_one_symbol + (info, abfd, newsym->name, newsym->flags, + newsym->section, newsym->value, NULL, FALSE, FALSE, &bh))) { - bfd *abfd; - asymbol *newsym; - struct bfd_link_hash_entry *bh; - - abfd = h->root.u.undef.abfd; - newsym = bfd_make_empty_symbol (abfd); - newsym->name = h->root.root.string + 1; - newsym->section = bfd_und_section_ptr; - newsym->value = 0; - newsym->flags = BSF_OBJECT; - if (h->root.type == bfd_link_hash_undefweak) - newsym->flags |= BSF_WEAK; - - bh = &fdh->root; - if ( !(_bfd_generic_link_add_one_symbol - (info, abfd, newsym->name, newsym->flags, - newsym->section, newsym->value, NULL, false, false, &bh))) - { - return false; - } - fdh = (struct elf_link_hash_entry *) bh; - fdh->elf_link_hash_flags &= ~ELF_LINK_NON_ELF; + return FALSE; } + fdh = (struct ppc_link_hash_entry *) bh; + fdh->elf.elf_link_hash_flags &= ~ELF_LINK_NON_ELF; + fdh->elf.size = 24; + fdh->elf.type = STT_OBJECT; + } - if (fdh != NULL - && (fdh->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0 - && (info->shared - || (fdh->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - || (fdh->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)) + if (fdh != NULL + && (fdh->elf.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0 + && (info->shared + || (fdh->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + || (fdh->elf.elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0 + || (fdh->elf.root.type == bfd_link_hash_undefweak + && ELF_ST_VISIBILITY (fdh->elf.other) == STV_DEFAULT))) + { + if (fdh->elf.dynindx == -1) + if (! bfd_elf_link_record_dynamic_symbol (info, &fdh->elf)) + return FALSE; + fdh->elf.elf_link_hash_flags + |= (fh->elf.elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR_NONWEAK + | ELF_LINK_NON_GOT_REF)); + if (ELF_ST_VISIBILITY (fh->elf.other) == STV_DEFAULT) { - if (fdh->dynindx == -1) - if (! bfd_elf64_link_record_dynamic_symbol (info, fdh)) - return false; - fdh->elf_link_hash_flags |= (h->elf_link_hash_flags - & (ELF_LINK_HASH_REF_REGULAR - | ELF_LINK_HASH_REF_DYNAMIC - | ELF_LINK_HASH_REF_REGULAR_NONWEAK - | ELF_LINK_NON_GOT_REF)); - if (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - { - fdh->plt.refcount = h->plt.refcount; - fdh->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - } - ((struct ppc_link_hash_entry *) fdh)->is_func_descriptor = 1; - ((struct ppc_link_hash_entry *) fdh)->oh = h; - ((struct ppc_link_hash_entry *) h)->oh = fdh; + fdh->elf.plt.plist = fh->elf.plt.plist; + fdh->elf.elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; } - - /* Now that the info is on the function descriptor, clear the - function code sym info. Any function code syms for which we - don't have a definition in a regular file, we force local. - This prevents a shared library from exporting syms that have - been imported from another library. Function code syms that - are really in the library we must leave global to prevent the - linker dragging in a definition from a static library. */ - force_local = (info->shared - && ((h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0 - || fdh == NULL - || (fdh->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0 - || (fdh->elf_link_hash_flags - & ELF_LINK_FORCED_LOCAL) != 0)); - _bfd_elf_link_hash_hide_symbol (info, h, force_local); + fdh->is_func_descriptor = 1; + fdh->oh = &fh->elf; + fh->oh = &fdh->elf; } - return true; + /* Now that the info is on the function descriptor, clear the + function code sym info. Any function code syms for which we + don't have a definition in a regular file, we force local. + This prevents a shared library from exporting syms that have + been imported from another library. Function code syms that + are really in the library we must leave global to prevent the + linker dragging in a definition from a static library. */ + force_local + = (info->shared + && ((fh->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 + || fdh == NULL + || (fdh->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 + || (fdh->elf.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)); + _bfd_elf_link_hash_hide_symbol (info, &fh->elf, force_local); + + return TRUE; } #define MIN_SAVE_FPR 14 @@ -3244,10 +4446,9 @@ func_desc_adjust (h, inf) this hook to a) provide some gcc support functions, and b) transfer dynamic linking information gathered so far on function code symbol entries, to their corresponding function descriptor symbol entries. */ -static boolean -ppc64_elf_func_desc_adjust (obfd, info) - bfd *obfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; +static bfd_boolean +ppc64_elf_func_desc_adjust (bfd *obfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) { struct ppc_link_hash_table *htab; unsigned int lowest_savef = MAX_SAVE_FPR + 2; @@ -3261,7 +4462,7 @@ ppc64_elf_func_desc_adjust (obfd, info) if (htab->sfpr == NULL) /* We don't have any relocs. */ - return true; + return TRUE; /* First provide any missing ._savef* and ._restf* functions. */ memcpy (sym, "._savef14", 10); @@ -3269,9 +4470,9 @@ ppc64_elf_func_desc_adjust (obfd, info) { sym[7] = i / 10 + '0'; sym[8] = i % 10 + '0'; - h = elf_link_hash_lookup (&htab->elf, sym, false, false, true); + h = elf_link_hash_lookup (&htab->elf, sym, FALSE, FALSE, TRUE); if (h != NULL - && h->root.type == bfd_link_hash_undefined) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { if (lowest_savef > i) lowest_savef = i; @@ -3280,7 +4481,7 @@ ppc64_elf_func_desc_adjust (obfd, info) h->root.u.def.value = (i - lowest_savef) * 4; h->type = STT_FUNC; h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - _bfd_elf_link_hash_hide_symbol (info, h, info->shared); + _bfd_elf_link_hash_hide_symbol (info, h, TRUE); } } @@ -3289,9 +4490,9 @@ ppc64_elf_func_desc_adjust (obfd, info) { sym[7] = i / 10 + '0'; sym[8] = i % 10 + '0'; - h = elf_link_hash_lookup (&htab->elf, sym, false, false, true); + h = elf_link_hash_lookup (&htab->elf, sym, FALSE, FALSE, TRUE); if (h != NULL - && h->root.type == bfd_link_hash_undefined) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { if (lowest_restf > i) lowest_restf = i; @@ -3301,11 +4502,11 @@ ppc64_elf_func_desc_adjust (obfd, info) + (i - lowest_restf) * 4); h->type = STT_FUNC; h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - _bfd_elf_link_hash_hide_symbol (info, h, info->shared); + _bfd_elf_link_hash_hide_symbol (info, h, TRUE); } } - elf_link_hash_traverse (&htab->elf, func_desc_adjust, (PTR) info); + elf_link_hash_traverse (&htab->elf, func_desc_adjust, info); htab->sfpr->_raw_size = ((MAX_SAVE_FPR + 2 - lowest_savef) * 4 + (MAX_SAVE_FPR + 2 - lowest_restf) * 4); @@ -3315,15 +4516,15 @@ ppc64_elf_func_desc_adjust (obfd, info) if (!htab->have_undefweak) { _bfd_strip_section_from_output (info, htab->sfpr); - return true; + return TRUE; } htab->sfpr->_raw_size = 4; } - p = (bfd_byte *) bfd_alloc (htab->elf.dynobj, htab->sfpr->_raw_size); + p = bfd_alloc (htab->elf.dynobj, htab->sfpr->_raw_size); if (p == NULL) - return false; + return FALSE; htab->sfpr->contents = p; for (i = lowest_savef; i <= MAX_SAVE_FPR; i++) @@ -3352,7 +4553,7 @@ ppc64_elf_func_desc_adjust (obfd, info) bfd_put_32 (htab->elf.dynobj, BLR, p); } - return true; + return TRUE; } /* Adjust a symbol defined by a dynamic object and referenced by a @@ -3361,14 +4562,11 @@ ppc64_elf_func_desc_adjust (obfd, info) change the definition to something the rest of the link can understand. */ -static boolean -ppc64_elf_adjust_dynamic_symbol (info, h) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; +static bfd_boolean +ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) { struct ppc_link_hash_table *htab; - struct ppc_link_hash_entry * eh; - struct ppc_dyn_relocs *p; asection *s; unsigned int power_of_two; @@ -3380,20 +4578,22 @@ ppc64_elf_adjust_dynamic_symbol (info, h) { /* Clear procedure linkage table information for any symbol that won't need a .plt entry. */ + struct plt_entry *ent; + for (ent = h->plt.plist; ent != NULL; ent = ent->next) + if (ent->plt.refcount > 0) + break; if (!((struct ppc_link_hash_entry *) h)->is_func_descriptor - || h->plt.refcount <= 0 - || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 - || (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0)) + || ent == NULL + || SYMBOL_CALLS_LOCAL (info, h) + || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak)) { - h->plt.offset = (bfd_vma) -1; + h->plt.plist = NULL; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; } - return true; } else - h->plt.offset = (bfd_vma) -1; + h->plt.plist = NULL; /* If this is a weak symbol, and there is a real definition, the processor independent code will have arranged for us to see the @@ -3404,40 +4604,63 @@ ppc64_elf_adjust_dynamic_symbol (info, h) || 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 (ELIMINATE_COPY_RELOCS) + h->elf_link_hash_flags + = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF) + | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF)); + 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; + 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; + return TRUE; - eh = (struct ppc_link_hash_entry *) h; - for (p = eh->dyn_relocs; p != NULL; p = p->next) + if (ELIMINATE_COPY_RELOCS) { - s = p->sec->output_section; - if (s != NULL && (s->flags & SEC_READONLY) != 0) - break; + struct ppc_link_hash_entry * eh; + struct ppc_dyn_relocs *p; + + eh = (struct ppc_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + break; + } + + /* If we didn't find any dynamic relocs in read-only sections, then + we'll be keeping the dynamic relocs and avoiding the copy reloc. */ + if (p == NULL) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return TRUE; + } } - /* If we didn't find any dynamic relocs in read-only sections, then - we'll be keeping the dynamic relocs and avoiding the copy reloc. */ - if (p == NULL) + if (h->plt.plist != NULL) { - h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - return true; + /* We should never get here, but unfortunately there are versions + of gcc out there that improperly (for this ABI) put initialized + function pointers, vtable refs and suchlike in read-only + sections. Allow them to proceed, but warn that this might + break at runtime. */ + (*_bfd_error_handler) + (_("copy reloc against `%s' requires lazy plt linking; " + "avoid setting LD_BIND_NOW=1 or upgrade gcc"), + h->root.root.string); } + /* This is a reference to a symbol defined by a dynamic object which + is not a function. */ + /* 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 @@ -3448,13 +4671,13 @@ ppc64_elf_adjust_dynamic_symbol (info, h) both the dynamic object and the regular object will refer to the same memory location for the variable. */ - /* We must generate a R_PPC_COPY reloc to tell the dynamic linker to - copy the initial value out of the dynamic object and into the + /* We must generate a R_PPC64_COPY reloc to tell the dynamic linker + to copy the initial value out of the dynamic object and into the runtime process image. We need to remember the offset into the .rela.bss section we are going to use. */ if ((h->root.u.def.section->flags & SEC_ALLOC) != 0) { - htab->srelbss->_raw_size += sizeof (Elf64_External_Rela); + htab->relbss->_raw_size += sizeof (Elf64_External_Rela); h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_COPY; } @@ -3465,12 +4688,12 @@ ppc64_elf_adjust_dynamic_symbol (info, h) power_of_two = 4; /* Apply the required alignment. */ - s = htab->sdynbss; + s = htab->dynbss; s->_raw_size = BFD_ALIGN (s->_raw_size, (bfd_size_type) (1 << power_of_two)); if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) { if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return false; + return FALSE; } /* Define the symbol as being at this point in the section. */ @@ -3480,16 +4703,15 @@ ppc64_elf_adjust_dynamic_symbol (info, h) /* Increment the section size to make room for the symbol. */ s->_raw_size += h->size; - return true; + return TRUE; } /* If given a function descriptor symbol, hide both the function code sym and the descriptor. */ static void -ppc64_elf_hide_symbol (info, h, force_local) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; - boolean force_local; +ppc64_elf_hide_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h, + bfd_boolean force_local) { _bfd_elf_link_hash_hide_symbol (info, h, force_local); @@ -3516,7 +4738,7 @@ ppc64_elf_hide_symbol (info, h, force_local) save = *p; *(char *) p = '.'; htab = ppc_hash_table (info); - fh = elf_link_hash_lookup (&htab->elf, p, false, false, false); + fh = elf_link_hash_lookup (&htab->elf, p, FALSE, FALSE, FALSE); *(char *) p = save; /* Unfortunately, if it so happens that the string we were @@ -3529,7 +4751,7 @@ ppc64_elf_hide_symbol (info, h, force_local) while (q >= h->root.root.string && *q == *p) --q, --p; if (q < h->root.root.string && *p == '.') - fh = elf_link_hash_lookup (&htab->elf, p, false, false, false); + fh = elf_link_hash_lookup (&htab->elf, p, FALSE, FALSE, FALSE); } if (fh != NULL) { @@ -3542,17 +4764,197 @@ ppc64_elf_hide_symbol (info, h, force_local) } } -static boolean -edit_opd (obfd, info) - bfd *obfd; - struct bfd_link_info *info; +static bfd_boolean +get_sym_h (struct elf_link_hash_entry **hp, Elf_Internal_Sym **symp, + asection **symsecp, char **tls_maskp, Elf_Internal_Sym **locsymsp, + unsigned long r_symndx, bfd *ibfd) +{ + Elf_Internal_Shdr *symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; + + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (ibfd); + struct elf_link_hash_entry *h; + + 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 (hp != NULL) + *hp = h; + + if (symp != NULL) + *symp = NULL; + + if (symsecp != NULL) + { + asection *symsec = NULL; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + symsec = h->root.u.def.section; + *symsecp = symsec; + } + + if (tls_maskp != NULL) + { + struct ppc_link_hash_entry *eh; + + eh = (struct ppc_link_hash_entry *) h; + *tls_maskp = &eh->tls_mask; + } + } + else + { + Elf_Internal_Sym *sym; + Elf_Internal_Sym *locsyms = *locsymsp; + + if (locsyms == NULL) + { + locsyms = (Elf_Internal_Sym *) symtab_hdr->contents; + if (locsyms == NULL) + locsyms = bfd_elf_get_elf_syms (ibfd, symtab_hdr, + symtab_hdr->sh_info, + 0, NULL, NULL, NULL); + if (locsyms == NULL) + return FALSE; + *locsymsp = locsyms; + } + sym = locsyms + r_symndx; + + if (hp != NULL) + *hp = NULL; + + if (symp != NULL) + *symp = sym; + + if (symsecp != NULL) + { + asection *symsec = NULL; + if ((sym->st_shndx != SHN_UNDEF + && sym->st_shndx < SHN_LORESERVE) + || sym->st_shndx > SHN_HIRESERVE) + symsec = bfd_section_from_elf_index (ibfd, sym->st_shndx); + *symsecp = symsec; + } + + if (tls_maskp != NULL) + { + struct got_entry **lgot_ents; + char *tls_mask; + + tls_mask = NULL; + lgot_ents = elf_local_got_ents (ibfd); + if (lgot_ents != NULL) + { + char *lgot_masks = (char *) (lgot_ents + symtab_hdr->sh_info); + tls_mask = &lgot_masks[r_symndx]; + } + *tls_maskp = tls_mask; + } + } + return TRUE; +} + +/* Returns TLS_MASKP for the given REL symbol. Function return is 0 on + error, 2 on a toc GD type suitable for optimization, 3 on a toc LD + type suitable for optimization, and 1 otherwise. */ + +static int +get_tls_mask (char **tls_maskp, unsigned long *toc_symndx, + Elf_Internal_Sym **locsymsp, + const Elf_Internal_Rela *rel, bfd *ibfd) +{ + unsigned long r_symndx; + int next_r; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; + asection *sec; + bfd_vma off; + + r_symndx = ELF64_R_SYM (rel->r_info); + if (!get_sym_h (&h, &sym, &sec, tls_maskp, locsymsp, r_symndx, ibfd)) + return 0; + + if ((*tls_maskp != NULL && **tls_maskp != 0) + || sec == NULL + || ppc64_elf_section_data (sec)->t_symndx == NULL) + return 1; + + /* Look inside a TOC section too. */ + if (h != NULL) + { + BFD_ASSERT (h->root.type == bfd_link_hash_defined); + off = h->root.u.def.value; + } + else + off = sym->st_value; + off += rel->r_addend; + BFD_ASSERT (off % 8 == 0); + r_symndx = ppc64_elf_section_data (sec)->t_symndx[off / 8]; + next_r = ppc64_elf_section_data (sec)->t_symndx[off / 8 + 1]; + if (!get_sym_h (&h, &sym, &sec, tls_maskp, locsymsp, r_symndx, ibfd)) + return 0; + if (toc_symndx != NULL) + *toc_symndx = r_symndx; + if ((h == NULL + || ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))) + && (next_r == -1 || next_r == -2)) + return 1 - next_r; + return 1; +} + +/* Adjust all global syms defined in opd sections. In gcc generated + code these will already have been done, but I suppose we have to + cater for all sorts of hand written assembly. */ + +static bfd_boolean +adjust_opd_syms (struct elf_link_hash_entry *h, void *inf ATTRIBUTE_UNUSED) +{ + struct ppc_link_hash_entry *eh; + asection *sym_sec; + long *opd_adjust; + + if (h->root.type == bfd_link_hash_indirect) + return TRUE; + + if (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) + return TRUE; + + eh = (struct ppc_link_hash_entry *) h; + if (eh->adjust_done) + return TRUE; + + sym_sec = eh->elf.root.u.def.section; + if (sym_sec != NULL + && elf_section_data (sym_sec) != NULL + && (opd_adjust = ppc64_elf_section_data (sym_sec)->opd.adjust) != NULL) + { + eh->elf.root.u.def.value += opd_adjust[eh->elf.root.u.def.value / 24]; + eh->adjust_done = 1; + } + return TRUE; +} + +/* Remove unused Official Procedure Descriptor entries. Currently we + only remove those associated with functions in discarded link-once + sections, or weakly defined functions that have been overridden. It + would be possible to remove many more entries for statically linked + applications. */ + +bfd_boolean +ppc64_elf_edit_opd (bfd *obfd, struct bfd_link_info *info) { bfd *ibfd; - unsigned int bfd_indx; + bfd_boolean some_edited = FALSE; - for (bfd_indx = 0, ibfd = info->input_bfds; - ibfd != NULL; - ibfd = ibfd->link_next, bfd_indx++) + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) { asection *sec; Elf_Internal_Rela *relstart, *rel, *relend; @@ -3560,16 +4962,24 @@ edit_opd (obfd, info) Elf_Internal_Sym *local_syms; struct elf_link_hash_entry **sym_hashes; bfd_vma offset; + bfd_size_type amt; long *adjust; - boolean need_edit; + bfd_boolean need_edit; sec = bfd_get_section_by_name (ibfd, ".opd"); if (sec == NULL) continue; - adjust = (long *) elf_section_data (sec)->tdata; - BFD_ASSERT (adjust != NULL); - memset (adjust, 0, (size_t) sec->_raw_size * sizeof (long) / 24); + amt = sec->_raw_size * sizeof (long) / 24; + adjust = ppc64_elf_section_data (sec)->opd.adjust; + if (adjust == NULL) + { + /* Must be a ld -r link. ie. check_relocs hasn't been + called. */ + adjust = bfd_zalloc (obfd, amt); + ppc64_elf_section_data (sec)->opd.adjust = adjust; + } + memset (adjust, 0, amt); if (sec->output_section == bfd_abs_section_ptr) continue; @@ -3583,20 +4993,19 @@ edit_opd (obfd, info) sym_hashes = elf_sym_hashes (ibfd); /* Read the relocations. */ - relstart = _bfd_elf64_link_read_relocs (obfd, sec, (PTR) NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory); + relstart = _bfd_elf_link_read_relocs (ibfd, sec, NULL, NULL, + info->keep_memory); if (relstart == NULL) - return false; + return FALSE; /* First run through the relocs to check they are sane, and to determine whether we need to edit this opd section. */ - need_edit = false; + need_edit = FALSE; offset = 0; relend = relstart + sec->reloc_count; - for (rel = relstart; rel < relend; rel++) + for (rel = relstart; rel < relend; ) { - enum elf_ppc_reloc_type r_type; + enum elf_ppc64_reloc_type r_type; unsigned long r_symndx; asection *sym_sec; struct elf_link_hash_entry *h; @@ -3605,79 +5014,50 @@ edit_opd (obfd, info) /* .opd contains a regular array of 24 byte entries. We're only interested in the reloc pointing to a function entry point. */ - r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); - if (r_type == R_PPC64_TOC) - continue; - - if (r_type != R_PPC64_ADDR64) - { - (*_bfd_error_handler) - (_("%s: unexpected reloc type %u in .opd section"), - bfd_archive_filename (ibfd), r_type); - need_edit = false; - break; - } - - if (rel + 1 >= relend) - continue; - r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE ((rel + 1)->r_info); - if (r_type != R_PPC64_TOC) - continue; - - if (rel->r_offset != offset) + if (rel->r_offset != offset + || rel + 1 >= relend + || (rel + 1)->r_offset != offset + 8) { /* If someone messes with .opd alignment then after a "ld -r" we might have padding in the middle of .opd. Also, there's nothing to prevent someone putting something silly in .opd with the assembler. No .opd - optimization for them! */ + optimization for them! */ (*_bfd_error_handler) (_("%s: .opd is not a regular array of opd entries"), bfd_archive_filename (ibfd)); - need_edit = false; + need_edit = FALSE; break; } - r_symndx = ELF64_R_SYM (rel->r_info); - sym_sec = NULL; - h = NULL; - sym = NULL; - if (r_symndx >= symtab_hdr->sh_info) - { - 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) - sym_sec = h->root.u.def.section; - } - else + if ((r_type = ELF64_R_TYPE (rel->r_info)) != R_PPC64_ADDR64 + || (r_type = ELF64_R_TYPE ((rel + 1)->r_info)) != R_PPC64_TOC) { - if (local_syms == NULL) - { - local_syms = (Elf_Internal_Sym *) symtab_hdr->contents; - if (local_syms == NULL) - local_syms = bfd_elf_get_elf_syms (ibfd, symtab_hdr, - symtab_hdr->sh_info, 0, - NULL, NULL, NULL); - if (local_syms == NULL) - goto error_free_rel; - } - sym = local_syms + r_symndx; - if ((sym->st_shndx != SHN_UNDEF - && sym->st_shndx < SHN_LORESERVE) - || sym->st_shndx > SHN_HIRESERVE) - sym_sec = bfd_section_from_elf_index (ibfd, sym->st_shndx); + (*_bfd_error_handler) + (_("%s: unexpected reloc type %u in .opd section"), + bfd_archive_filename (ibfd), r_type); + need_edit = FALSE; + break; } + r_symndx = ELF64_R_SYM (rel->r_info); + if (!get_sym_h (&h, &sym, &sym_sec, NULL, &local_syms, + r_symndx, ibfd)) + goto error_ret; + if (sym_sec == NULL || sym_sec->owner == NULL) { + const char *sym_name; + if (h != NULL) + sym_name = h->root.root.string; + else + sym_name = bfd_elf_local_sym_name (ibfd, sym); + (*_bfd_error_handler) (_("%s: undefined sym `%s' in .opd section"), bfd_archive_filename (ibfd), - h != NULL ? h->root.root.string : ""); - need_edit = false; + sym_name); + need_edit = FALSE; break; } @@ -3690,16 +5070,21 @@ edit_opd (obfd, info) which we test for via the output_section. */ if (sym_sec->owner != ibfd || sym_sec->output_section == bfd_abs_section_ptr) - need_edit = true; + need_edit = TRUE; offset += 24; + rel += 2; + /* Allow for the possibility of a reloc on the third word. */ + if (rel < relend + && rel->r_offset == offset - 8) + rel += 1; } if (need_edit) { Elf_Internal_Rela *write_rel; bfd_byte *rptr, *wptr; - boolean skip; + bfd_boolean skip; /* This seems a waste of time as input .opd sections are all zeros as generated by gcc, but I suppose there's no reason @@ -3709,16 +5094,16 @@ edit_opd (obfd, info) { bfd_byte *loc = bfd_alloc (ibfd, sec->_raw_size); if (loc == NULL - || !bfd_get_section_contents (ibfd, sec, loc, (bfd_vma) 0, + || !bfd_get_section_contents (ibfd, sec, loc, 0, sec->_raw_size)) { + error_ret: if (local_syms != NULL && symtab_hdr->contents != (unsigned char *) local_syms) free (local_syms); - error_free_rel: if (elf_section_data (sec)->relocs != relstart) free (relstart); - return false; + return FALSE; } sec->contents = loc; sec->flags |= (SEC_IN_MEMORY | SEC_HAS_CONTENTS); @@ -3729,40 +5114,26 @@ edit_opd (obfd, info) wptr = sec->contents; rptr = sec->contents; write_rel = relstart; - skip = false; + skip = FALSE; offset = 0; for (rel = relstart; rel < relend; rel++) { + unsigned long r_symndx; + asection *sym_sec; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; + + r_symndx = ELF64_R_SYM (rel->r_info); + if (!get_sym_h (&h, &sym, &sym_sec, NULL, &local_syms, + r_symndx, ibfd)) + goto error_ret; + if (rel->r_offset == offset) { - unsigned long r_symndx; - asection *sym_sec; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; - - r_symndx = ELF64_R_SYM (rel->r_info); - sym_sec = NULL; - h = NULL; - sym = NULL; - if (r_symndx >= symtab_hdr->sh_info) - { - 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) - sym_sec = h->root.u.def.section; - } - else - { - sym = local_syms + r_symndx; - if ((sym->st_shndx != SHN_UNDEF - && sym->st_shndx < SHN_LORESERVE) - || sym->st_shndx > SHN_HIRESERVE) - sym_sec = bfd_section_from_elf_index (ibfd, - sym->st_shndx); - } + struct ppc_link_hash_entry *fdh = NULL; + if (h != NULL) + fdh = get_fdh ((struct ppc_link_hash_entry *) h, + ppc_hash_table (info)); skip = (sym_sec->owner != ibfd || sym_sec->output_section == bfd_abs_section_ptr); @@ -3772,14 +5143,8 @@ edit_opd (obfd, info) { /* Arrange for the function descriptor sym to be dropped. */ - struct elf_link_hash_entry *fdh; - struct ppc_link_hash_entry *fh; - - fh = (struct ppc_link_hash_entry *) h; - BFD_ASSERT (fh->is_func); - fdh = fh->oh; - fdh->root.u.def.value = 0; - fdh->root.u.def.section = sym_sec; + fdh->elf.root.u.def.value = 0; + fdh->elf.root.u.def.section = sym_sec; } } else @@ -3788,29 +5153,25 @@ edit_opd (obfd, info) if (h != NULL) { - /* Redefine the function descriptor symbol - to this location in the opd section. - We've checked above that opd relocs are - ordered. */ - struct elf_link_hash_entry *fdh; - struct ppc_link_hash_entry *fh; - - fh = (struct ppc_link_hash_entry *) h; - BFD_ASSERT (fh->is_func); - fdh = fh->oh; - fdh->root.u.def.value = wptr - sec->contents; - } - else - { - /* Local syms are a bit tricky. We could - tweak them as they can be cached, but - we'd need to look through the local syms - for the function descriptor sym which we - don't have at the moment. So keep an - array of adjustments. */ - adjust[rel->r_offset / 24] = wptr - rptr; + /* Redefine the function descriptor symbol to + this location in the opd section. It is + necessary to update the value here rather + than using an array of adjustments as we do + for local symbols, because various places + in the generic ELF code use the value + stored in u.def.value. */ + fdh->elf.root.u.def.value = wptr - sec->contents; + fdh->adjust_done = 1; } + /* Local syms are a bit tricky. We could + tweak them as they can be cached, but + we'd need to look through the local syms + for the function descriptor sym which we + don't have at the moment. So keep an + array of adjustments. */ + adjust[rel->r_offset / 24] = wptr - rptr; + if (wptr != rptr) memcpy (wptr, rptr, 24); wptr += 24; @@ -3819,11 +5180,41 @@ edit_opd (obfd, info) offset += 24; } - /* We need to adjust any reloc offsets to point to the - new opd entries. While we're at it, we may as well - remove redundant relocs. */ - if (!skip) + if (skip) + { + BFD_ASSERT (MUST_BE_DYN_RELOC (ELF64_R_TYPE (rel->r_info))); + if (info->shared) + { + /* We won't be needing dynamic relocs here. */ + struct ppc_dyn_relocs **pp; + struct ppc_dyn_relocs *p; + + if (h != NULL) + pp = &((struct ppc_link_hash_entry *) h)->dyn_relocs; + else if (sym_sec != NULL) + pp = ((struct ppc_dyn_relocs **) + &elf_section_data (sym_sec)->local_dynrel); + else + pp = ((struct ppc_dyn_relocs **) + &elf_section_data (sec)->local_dynrel); + while ((p = *pp) != NULL) + { + if (p->sec == sec) + { + p->count -= 1; + if (p->count == 0) + *pp = p->next; + break; + } + pp = &p->next; + } + } + } + else { + /* We need to adjust any reloc offsets to point to the + new opd entries. While we're at it, we may as well + remove redundant relocs. */ rel->r_offset += wptr - rptr; if (write_rel != rel) memcpy (write_rel, rel, sizeof (*rel)); @@ -3833,6 +5224,12 @@ edit_opd (obfd, info) sec->_cooked_size = wptr - sec->contents; sec->reloc_count = write_rel - relstart; + /* Fudge the size too, as this is used later in + elf_bfd_final_link if we are emitting relocs. */ + elf_section_data (sec)->rel_hdr.sh_size + = sec->reloc_count * elf_section_data (sec)->rel_hdr.sh_entsize; + BFD_ASSERT (elf_section_data (sec)->rel_hdr2 == NULL); + some_edited = TRUE; } else if (elf_section_data (sec)->relocs != relstart) free (relstart); @@ -3847,36 +5244,351 @@ edit_opd (obfd, info) } } - return true; + if (some_edited) + elf_link_hash_traverse (elf_hash_table (info), adjust_opd_syms, NULL); + + return TRUE; +} + +/* Set htab->tls_get_addr and call the generic ELF tls_setup function. */ + +asection * +ppc64_elf_tls_setup (bfd *obfd, struct bfd_link_info *info) +{ + struct ppc_link_hash_table *htab; + + htab = ppc_hash_table (info); + if (htab->tls_get_addr != NULL) + { + struct elf_link_hash_entry *h = htab->tls_get_addr; + + 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; + + htab->tls_get_addr = h; + } + + return _bfd_elf_tls_setup (obfd, info); +} + +/* Run through all the TLS relocs looking for optimization + opportunities. The linker has been hacked (see ppc64elf.em) to do + a preliminary section layout so that we know the TLS segment + offsets. We can't optimize earlier because some optimizations need + to know the tp offset, and we need to optimize before allocating + dynamic relocations. */ + +bfd_boolean +ppc64_elf_tls_optimize (bfd *obfd ATTRIBUTE_UNUSED, struct bfd_link_info *info) +{ + bfd *ibfd; + asection *sec; + struct ppc_link_hash_table *htab; + + if (info->relocatable || info->shared) + return TRUE; + + htab = ppc_hash_table (info); + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + Elf_Internal_Sym *locsyms = NULL; + + for (sec = ibfd->sections; sec != NULL; sec = sec->next) + if (sec->has_tls_reloc && !bfd_is_abs_section (sec->output_section)) + { + Elf_Internal_Rela *relstart, *rel, *relend; + int expecting_tls_get_addr; + + /* Read the relocations. */ + relstart = _bfd_elf_link_read_relocs (ibfd, sec, NULL, NULL, + info->keep_memory); + if (relstart == NULL) + return FALSE; + + expecting_tls_get_addr = 0; + relend = relstart + sec->reloc_count; + for (rel = relstart; rel < relend; rel++) + { + enum elf_ppc64_reloc_type r_type; + unsigned long r_symndx; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; + asection *sym_sec; + char *tls_mask; + char tls_set, tls_clear, tls_type = 0; + bfd_vma value; + bfd_boolean ok_tprel, is_local; + + r_symndx = ELF64_R_SYM (rel->r_info); + if (!get_sym_h (&h, &sym, &sym_sec, &tls_mask, &locsyms, + r_symndx, ibfd)) + { + err_free_rel: + if (elf_section_data (sec)->relocs != relstart) + free (relstart); + if (locsyms != NULL + && (elf_tdata (ibfd)->symtab_hdr.contents + != (unsigned char *) locsyms)) + free (locsyms); + return FALSE; + } + + if (h != NULL) + { + if (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + continue; + value = h->root.u.def.value; + } + else + { + value = sym->st_value; + + if (elf_section_data (sym_sec) != NULL) + { + long *adjust; + adjust = ppc64_elf_section_data (sym_sec)->opd.adjust; + if (adjust != NULL) + value += adjust[value / 24]; + } + } + + ok_tprel = FALSE; + is_local = FALSE; + if (h == NULL + || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)) + { + is_local = TRUE; + value += sym_sec->output_offset; + value += sym_sec->output_section->vma; + value -= htab->elf.tls_sec->vma; + ok_tprel = (value + TP_OFFSET + ((bfd_vma) 1 << 31) + < (bfd_vma) 1 << 32); + } + + r_type = ELF64_R_TYPE (rel->r_info); + switch (r_type) + { + case R_PPC64_GOT_TLSLD16: + case R_PPC64_GOT_TLSLD16_LO: + case R_PPC64_GOT_TLSLD16_HI: + case R_PPC64_GOT_TLSLD16_HA: + /* These relocs should never be against a symbol + defined in a shared lib. Leave them alone if + that turns out to be the case. */ + ppc64_tlsld_got (ibfd)->refcount -= 1; + if (!is_local) + continue; + + /* LD -> LE */ + tls_set = 0; + tls_clear = TLS_LD; + tls_type = TLS_TLS | TLS_LD; + expecting_tls_get_addr = 1; + break; + + case R_PPC64_GOT_TLSGD16: + case R_PPC64_GOT_TLSGD16_LO: + case R_PPC64_GOT_TLSGD16_HI: + case R_PPC64_GOT_TLSGD16_HA: + if (ok_tprel) + /* GD -> LE */ + tls_set = 0; + else + /* GD -> IE */ + tls_set = TLS_TLS | TLS_TPRELGD; + tls_clear = TLS_GD; + tls_type = TLS_TLS | TLS_GD; + expecting_tls_get_addr = 1; + break; + + case R_PPC64_GOT_TPREL16_DS: + case R_PPC64_GOT_TPREL16_LO_DS: + case R_PPC64_GOT_TPREL16_HI: + case R_PPC64_GOT_TPREL16_HA: + expecting_tls_get_addr = 0; + if (ok_tprel) + { + /* IE -> LE */ + tls_set = 0; + tls_clear = TLS_TPREL; + tls_type = TLS_TLS | TLS_TPREL; + break; + } + else + continue; + + case R_PPC64_REL14: + case R_PPC64_REL14_BRTAKEN: + case R_PPC64_REL14_BRNTAKEN: + case R_PPC64_REL24: + if (h != NULL + && h == htab->tls_get_addr) + { + if (!expecting_tls_get_addr + && rel != relstart + && ((ELF64_R_TYPE (rel[-1].r_info) + == R_PPC64_TOC16) + || (ELF64_R_TYPE (rel[-1].r_info) + == R_PPC64_TOC16_LO))) + { + /* Check for toc tls entries. */ + char *toc_tls; + int retval; + + retval = get_tls_mask (&toc_tls, NULL, &locsyms, + rel - 1, ibfd); + if (retval == 0) + goto err_free_rel; + if (toc_tls != NULL) + expecting_tls_get_addr = retval > 1; + } + + if (expecting_tls_get_addr) + { + struct plt_entry *ent; + for (ent = h->plt.plist; ent; ent = ent->next) + if (ent->addend == 0) + { + if (ent->plt.refcount > 0) + ent->plt.refcount -= 1; + break; + } + } + } + expecting_tls_get_addr = 0; + continue; + + case R_PPC64_TPREL64: + expecting_tls_get_addr = 0; + if (ok_tprel) + { + /* IE -> LE */ + tls_set = TLS_EXPLICIT; + tls_clear = TLS_TPREL; + break; + } + else + continue; + + case R_PPC64_DTPMOD64: + expecting_tls_get_addr = 0; + if (rel + 1 < relend + && (rel[1].r_info + == ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64)) + && rel[1].r_offset == rel->r_offset + 8) + { + if (ok_tprel) + /* GD -> LE */ + tls_set = TLS_EXPLICIT | TLS_GD; + else + /* GD -> IE */ + tls_set = TLS_EXPLICIT | TLS_GD | TLS_TPRELGD; + tls_clear = TLS_GD; + } + else + { + if (!is_local) + continue; + + /* LD -> LE */ + tls_set = TLS_EXPLICIT; + tls_clear = TLS_LD; + } + break; + + default: + expecting_tls_get_addr = 0; + continue; + } + + if ((tls_set & TLS_EXPLICIT) == 0) + { + struct got_entry *ent; + + /* Adjust got entry for this reloc. */ + if (h != NULL) + ent = h->got.glist; + else + ent = elf_local_got_ents (ibfd)[r_symndx]; + + for (; ent != NULL; ent = ent->next) + if (ent->addend == rel->r_addend + && ent->owner == ibfd + && ent->tls_type == tls_type) + break; + if (ent == NULL) + abort (); + + if (tls_set == 0) + { + /* We managed to get rid of a got entry. */ + if (ent->got.refcount > 0) + ent->got.refcount -= 1; + } + } + else if (h != NULL) + { + struct ppc_link_hash_entry * eh; + struct ppc_dyn_relocs **pp; + struct ppc_dyn_relocs *p; + + /* Adjust dynamic relocs. */ + eh = (struct ppc_link_hash_entry *) h; + for (pp = &eh->dyn_relocs; + (p = *pp) != NULL; + pp = &p->next) + if (p->sec == sec) + { + /* If we got rid of a DTPMOD/DTPREL reloc + pair then we'll lose one or two dyn + relocs. */ + if (tls_set == (TLS_EXPLICIT | TLS_GD)) + p->count -= 1; + p->count -= 1; + if (p->count == 0) + *pp = p->next; + break; + } + } + + *tls_mask |= tls_set; + *tls_mask &= ~tls_clear; + } + + if (elf_section_data (sec)->relocs != relstart) + free (relstart); + } + + if (locsyms != NULL + && (elf_tdata (ibfd)->symtab_hdr.contents + != (unsigned char *) locsyms)) + { + if (!info->keep_memory) + free (locsyms); + else + elf_tdata (ibfd)->symtab_hdr.contents = (unsigned char *) locsyms; + } + } + return TRUE; } - -/* This is the condition under which ppc64_elf_finish_dynamic_symbol - will be called from elflink.h. If elflink.h doesn't call our - finish_dynamic_symbol routine, we'll need to do something about - initializing any .plt and .got entries in ppc64_elf_relocate_section. */ -#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ - ((DYN) \ - && ((INFO)->shared \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ - && ((H)->dynindx != -1 \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) /* Allocate space in .plt, .got and associated reloc sections for dynamic relocs. */ -static boolean -allocate_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +static bfd_boolean +allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct bfd_link_info *info; struct ppc_link_hash_table *htab; asection *s; struct ppc_link_hash_entry *eh; struct ppc_dyn_relocs *p; + struct got_entry *gent; if (h->root.type == bfd_link_hash_indirect) - return true; + return TRUE; if (h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; @@ -3885,75 +5597,122 @@ allocate_dynrelocs (h, inf) htab = ppc_hash_table (info); if (htab->elf.dynamic_sections_created - && h->plt.refcount > 0 - && h->dynindx != -1) + && h->dynindx != -1 + && WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info->shared, h)) { - BFD_ASSERT (((struct ppc_link_hash_entry *) h)->is_func_descriptor); - - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) - { - /* If this is the first .plt entry, make room for the special - first entry. */ - s = htab->splt; - if (s->_raw_size == 0) - s->_raw_size += PLT_INITIAL_ENTRY_SIZE; - - h->plt.offset = s->_raw_size; - - /* Make room for this entry. */ - s->_raw_size += PLT_ENTRY_SIZE; - - /* Make room for the .glink code. */ - s = htab->sglink; - if (s->_raw_size == 0) - s->_raw_size += GLINK_CALL_STUB_SIZE; - /* We need bigger stubs past index 32767. */ - if (s->_raw_size >= GLINK_CALL_STUB_SIZE + 32768*2*4) - s->_raw_size += 4; - s->_raw_size += 2*4; - - /* We also need to make an entry in the .rela.plt section. */ - s = htab->srelplt; - s->_raw_size += sizeof (Elf64_External_Rela); - } - else + struct plt_entry *pent; + bfd_boolean doneone = FALSE; + for (pent = h->plt.plist; pent != NULL; pent = pent->next) + if (pent->plt.refcount > 0) + { + BFD_ASSERT (((struct ppc_link_hash_entry *) h)->is_func_descriptor); + + /* If this is the first .plt entry, make room for the special + first entry. */ + s = htab->plt; + if (s->_raw_size == 0) + s->_raw_size += PLT_INITIAL_ENTRY_SIZE; + + pent->plt.offset = s->_raw_size; + + /* Make room for this entry. */ + s->_raw_size += PLT_ENTRY_SIZE; + + /* Make room for the .glink code. */ + s = htab->glink; + if (s->_raw_size == 0) + s->_raw_size += GLINK_CALL_STUB_SIZE; + /* We need bigger stubs past index 32767. */ + if (s->_raw_size >= GLINK_CALL_STUB_SIZE + 32768*2*4) + s->_raw_size += 4; + s->_raw_size += 2*4; + + /* We also need to make an entry in the .rela.plt section. */ + s = htab->relplt; + s->_raw_size += sizeof (Elf64_External_Rela); + doneone = TRUE; + } + else + pent->plt.offset = (bfd_vma) -1; + if (!doneone) { - h->plt.offset = (bfd_vma) -1; + h->plt.plist = NULL; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; } } else { - h->plt.offset = (bfd_vma) -1; + h->plt.plist = NULL; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; } - if (h->got.refcount > 0) - { - boolean dyn; - - /* Make sure this symbol is output as a dynamic symbol. - Undefined weak syms won't yet be marked as dynamic. */ - if (h->dynindx == -1 - && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + eh = (struct ppc_link_hash_entry *) h; + /* Run through the TLS GD got entries first if we're changing them + to TPREL. */ + if ((eh->tls_mask & TLS_TPRELGD) != 0) + for (gent = h->got.glist; gent != NULL; gent = gent->next) + if (gent->got.refcount > 0 + && (gent->tls_type & TLS_GD) != 0) { - if (! bfd_elf64_link_record_dynamic_symbol (info, h)) - return false; + /* This was a GD entry that has been converted to TPREL. If + there happens to be a TPREL entry we can use that one. */ + struct got_entry *ent; + for (ent = h->got.glist; ent != NULL; ent = ent->next) + if (ent->got.refcount > 0 + && (ent->tls_type & TLS_TPREL) != 0 + && ent->addend == gent->addend + && ent->owner == gent->owner) + { + gent->got.refcount = 0; + break; + } + + /* If not, then we'll be using our own TPREL entry. */ + if (gent->got.refcount != 0) + gent->tls_type = TLS_TLS | TLS_TPREL; } - s = htab->sgot; - h->got.offset = s->_raw_size; - s->_raw_size += 8; - dyn = htab->elf.dynamic_sections_created; - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) - htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); - } - else - h->got.offset = (bfd_vma) -1; + for (gent = h->got.glist; gent != NULL; gent = gent->next) + if (gent->got.refcount > 0) + { + bfd_boolean dyn; + + /* Make sure this symbol is output as a dynamic symbol. + Undefined weak syms won't yet be marked as dynamic, + nor will all TLS symbols. */ + if (h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + } + + if ((gent->tls_type & TLS_LD) != 0 + && !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC)) + { + gent->got.offset = ppc64_tlsld_got (gent->owner)->offset; + continue; + } + + s = ppc64_elf_tdata (gent->owner)->got; + gent->got.offset = s->_raw_size; + s->_raw_size + += (gent->tls_type & eh->tls_mask & (TLS_GD | TLS_LD)) ? 16 : 8; + dyn = htab->elf.dynamic_sections_created; + if ((info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h)) + && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) + ppc64_elf_tdata (gent->owner)->relgot->_raw_size + += (gent->tls_type & eh->tls_mask & TLS_GD + ? 2 * sizeof (Elf64_External_Rela) + : sizeof (Elf64_External_Rela)); + } + else + gent->got.offset = (bfd_vma) -1; - eh = (struct ppc_link_hash_entry *) h; if (eh->dyn_relocs == NULL) - return true; + return TRUE; /* In the shared -Bsymbolic case, discard space allocated for dynamic pc-relative relocs against symbols which turn out to be @@ -3963,9 +5722,13 @@ allocate_dynrelocs (h, inf) if (info->shared) { - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 - && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 - || info->symbolic)) + /* Relocs that use pc_count are those that appear on a call insn, + or certain REL relocs (see MUST_BE_DYN_RELOC) that can be + generated via assembly. We want calls to protected symbols to + resolve directly to the function rather than going via the plt. + If people want function pointer comparisons to work as expected + then they should avoid writing weird assembly. */ + if (SYMBOL_CALLS_LOCAL (info, h)) { struct ppc_dyn_relocs **pp; @@ -3979,27 +5742,30 @@ allocate_dynrelocs (h, inf) pp = &p->next; } } + + /* Also discard relocs on undefined weak syms with non-default + visibility. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + eh->dyn_relocs = NULL; } - else + else if (ELIMINATE_COPY_RELOCS) { /* For the non-shared case, discard space for relocs against symbols which turn out to need copy relocs or are not dynamic. */ if ((h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 - && (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - || (htab->elf.dynamic_sections_created - && (h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_undefined)))) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ if (h->dynindx == -1 && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) { - if (! bfd_elf64_link_record_dynamic_symbol (info, h)) - return false; + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } /* If that succeeded, we know we'll be keeping all the @@ -4020,15 +5786,13 @@ allocate_dynrelocs (h, inf) sreloc->_raw_size += p->count * sizeof (Elf64_External_Rela); } - return true; + return TRUE; } /* Find any dynamic relocs that apply to read-only sections. */ -static boolean -readonly_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +static bfd_boolean +readonly_dynrelocs (struct elf_link_hash_entry *h, void *inf) { struct ppc_link_hash_entry *eh; struct ppc_dyn_relocs *p; @@ -4043,28 +5807,27 @@ readonly_dynrelocs (h, inf) if (s != NULL && (s->flags & SEC_READONLY) != 0) { - struct bfd_link_info *info = (struct bfd_link_info *) inf; + struct bfd_link_info *info = inf; info->flags |= DF_TEXTREL; /* Not an error, just cut short the traversal. */ - return false; + return FALSE; } } - return true; + return TRUE; } /* Set the sizes of the dynamic sections. */ -static boolean -ppc64_elf_size_dynamic_sections (output_bfd, info) - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; +static bfd_boolean +ppc64_elf_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) { struct ppc_link_hash_table *htab; bfd *dynobj; asection *s; - boolean relocs; + bfd_boolean relocs; bfd *ibfd; htab = ppc_hash_table (info); @@ -4075,7 +5838,7 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) if (htab->elf.dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); if (s == NULL) @@ -4089,8 +5852,9 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) relocs. */ for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) { - bfd_signed_vma *local_got; - bfd_signed_vma *end_local_got; + struct got_entry **lgot_ents; + struct got_entry **end_lgot_ents; + char *lgot_masks; bfd_size_type locsymcount; Elf_Internal_Shdr *symtab_hdr; asection *srel; @@ -4098,6 +5862,20 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour) continue; + if (ppc64_tlsld_got (ibfd)->refcount > 0) + { + s = ppc64_elf_tdata (ibfd)->got; + ppc64_tlsld_got (ibfd)->offset = s->_raw_size; + s->_raw_size += 16; + if (info->shared) + { + srel = ppc64_elf_tdata (ibfd)->relgot; + srel->_raw_size += sizeof (Elf64_External_Rela); + } + } + else + ppc64_tlsld_got (ibfd)->offset = (bfd_vma) -1; + for (s = ibfd->sections; s != NULL; s = s->next) { struct ppc_dyn_relocs *p; @@ -4125,50 +5903,78 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) } } - local_got = elf_local_got_refcounts (ibfd); - if (!local_got) + lgot_ents = elf_local_got_ents (ibfd); + if (!lgot_ents) continue; symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; locsymcount = symtab_hdr->sh_info; - end_local_got = local_got + locsymcount; - s = htab->sgot; - srel = htab->srelgot; - for (; local_got < end_local_got; ++local_got) + end_lgot_ents = lgot_ents + locsymcount; + lgot_masks = (char *) end_lgot_ents; + s = ppc64_elf_tdata (ibfd)->got; + srel = ppc64_elf_tdata (ibfd)->relgot; + for (; lgot_ents < end_lgot_ents; ++lgot_ents, ++lgot_masks) { - if (*local_got > 0) - { - *local_got = s->_raw_size; - s->_raw_size += 8; - if (info->shared) - srel->_raw_size += sizeof (Elf64_External_Rela); - } - else - *local_got = (bfd_vma) -1; + struct got_entry *ent; + + for (ent = *lgot_ents; ent != NULL; ent = ent->next) + if (ent->got.refcount > 0) + { + if ((ent->tls_type & *lgot_masks & TLS_LD) != 0) + { + if (ppc64_tlsld_got (ibfd)->offset == (bfd_vma) -1) + { + ppc64_tlsld_got (ibfd)->offset = s->_raw_size; + s->_raw_size += 16; + if (info->shared) + srel->_raw_size += sizeof (Elf64_External_Rela); + } + ent->got.offset = ppc64_tlsld_got (ibfd)->offset; + } + else + { + ent->got.offset = s->_raw_size; + if ((ent->tls_type & *lgot_masks & TLS_GD) != 0) + { + s->_raw_size += 16; + if (info->shared) + srel->_raw_size += 2 * sizeof (Elf64_External_Rela); + } + else + { + s->_raw_size += 8; + if (info->shared) + srel->_raw_size += sizeof (Elf64_External_Rela); + } + } + } + else + ent->got.offset = (bfd_vma) -1; } } - if (!edit_opd (output_bfd, info)) - return false; - /* Allocate global sym .plt and .got entries, and space for global sym dynamic relocs. */ - elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); + elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, info); /* We now have determined the sizes of the various dynamic sections. Allocate memory for them. */ - relocs = false; + relocs = FALSE; for (s = dynobj->sections; s != NULL; s = s->next) { if ((s->flags & SEC_LINKER_CREATED) == 0) continue; - if (s == htab->sbrlt || s == htab->srelbrlt) + /* Reset _cooked_size since prelim layout will set it wrongly, + and a non-zero _cooked_size sticks. */ + s->_cooked_size = 0; + + if (s == htab->brlt || s == htab->relbrlt) /* These haven't been allocated yet; don't strip. */ continue; - else if (s == htab->splt - || s == htab->sgot - || s == htab->sglink) + else if (s == htab->got + || s == htab->plt + || s == htab->glink) { /* Strip this section if we don't need it; see the comment below. */ @@ -4189,8 +5995,8 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) } else { - if (s != htab->srelplt) - relocs = true; + if (s != htab->relplt) + relocs = TRUE; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -4208,19 +6014,53 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) _bfd_strip_section_from_output (info, s); continue; } - - /* .plt is in the bss section. We don't initialise it. */ - if ((s->flags & SEC_LOAD) == 0) - continue; - - /* Allocate memory for the section contents. We use bfd_zalloc - here in case unused entries are not reclaimed before the - section's contents are written out. This should not happen, - but this way if it does, we get a R_PPC64_NONE reloc instead - of garbage. */ - s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); - if (s->contents == NULL) - return false; + + /* .plt is in the bss section. We don't initialise it. */ + if (s == htab->plt) + continue; + + /* Allocate memory for the section contents. We use bfd_zalloc + here in case unused entries are not reclaimed before the + section's contents are written out. This should not happen, + but this way if it does we get a R_PPC64_NONE reloc in .rela + sections instead of garbage. + We also rely on the section contents being zero when writing + the GOT. */ + s->contents = bfd_zalloc (dynobj, s->_raw_size); + if (s->contents == NULL) + return FALSE; + } + + for (ibfd = info->input_bfds; ibfd != NULL; ibfd = ibfd->link_next) + { + s = ppc64_elf_tdata (ibfd)->got; + if (s != NULL && s != htab->got) + { + s->_cooked_size = 0; + if (s->_raw_size == 0) + _bfd_strip_section_from_output (info, s); + else + { + s->contents = bfd_zalloc (ibfd, s->_raw_size); + if (s->contents == NULL) + return FALSE; + } + } + s = ppc64_elf_tdata (ibfd)->relgot; + if (s != NULL) + { + s->_cooked_size = 0; + if (s->_raw_size == 0) + _bfd_strip_section_from_output (info, s); + else + { + s->contents = bfd_zalloc (ibfd, s->_raw_size); + if (s->contents == NULL) + return FALSE; + relocs = TRUE; + s->reloc_count = 0; + } + } } if (htab->elf.dynamic_sections_created) @@ -4231,29 +6071,29 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ #define add_dynamic_entry(TAG, VAL) \ - bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + _bfd_elf_add_dynamic_entry (info, TAG, VAL) - if (!info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) - return false; + return FALSE; } - if (htab->splt != NULL && htab->splt->_raw_size != 0) + if (htab->plt != NULL && htab->plt->_raw_size != 0) { if (!add_dynamic_entry (DT_PLTGOT, 0) || !add_dynamic_entry (DT_PLTRELSZ, 0) || !add_dynamic_entry (DT_PLTREL, DT_RELA) || !add_dynamic_entry (DT_JMPREL, 0) || !add_dynamic_entry (DT_PPC64_GLINK, 0)) - return false; + return FALSE; } if (NO_OPD_RELOCS) { if (!add_dynamic_entry (DT_PPC64_OPD, 0) || !add_dynamic_entry (DT_PPC64_OPDSZ, 0)) - return false; + return FALSE; } if (relocs) @@ -4261,53 +6101,57 @@ ppc64_elf_size_dynamic_sections (output_bfd, info) if (!add_dynamic_entry (DT_RELA, 0) || !add_dynamic_entry (DT_RELASZ, 0) || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) - return false; + return FALSE; /* If any dynamic relocs apply to a read-only section, then we need a DT_TEXTREL entry. */ if ((info->flags & DF_TEXTREL) == 0) - elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, - (PTR) info); + elf_link_hash_traverse (&htab->elf, readonly_dynrelocs, info); if ((info->flags & DF_TEXTREL) != 0) { if (!add_dynamic_entry (DT_TEXTREL, 0)) - return false; + return FALSE; } } } #undef add_dynamic_entry - return true; + return TRUE; } /* Determine the type of stub needed, if any, for a call. */ -static INLINE enum ppc_stub_type -ppc_type_of_stub (input_sec, rel, hash, destination) - asection *input_sec; - const Elf_Internal_Rela *rel; - struct ppc_link_hash_entry **hash; - bfd_vma destination; +static inline enum ppc_stub_type +ppc_type_of_stub (asection *input_sec, + const Elf_Internal_Rela *rel, + struct ppc_link_hash_entry **hash, + bfd_vma destination) { struct ppc_link_hash_entry *h = *hash; bfd_vma location; bfd_vma branch_offset; bfd_vma max_branch_offset; - unsigned int r_type; + enum elf_ppc64_reloc_type r_type; if (h != NULL) { if (h->oh != NULL - && h->oh->plt.offset != (bfd_vma) -1 && h->oh->dynindx != -1) { - *hash = (struct ppc_link_hash_entry *) h->oh; - return ppc_stub_plt_call; + struct plt_entry *ent; + for (ent = h->oh->plt.plist; ent != NULL; ent = ent->next) + if (ent->addend == rel->r_addend + && ent->plt.offset != (bfd_vma) -1) + { + *hash = (struct ppc_link_hash_entry *) h->oh; + return ppc_stub_plt_call; + } } - if (h->elf.root.type == bfd_link_hash_undefweak - || h->elf.root.type == bfd_link_hash_undefined) + if (!(h->elf.root.type == bfd_link_hash_defined + || h->elf.root.type == bfd_link_hash_defweak) + || h->elf.root.u.def.section->output_section == NULL) return ppc_stub_none; } @@ -4321,7 +6165,7 @@ ppc_type_of_stub (input_sec, rel, hash, destination) /* Determine if a long branch stub is needed. */ max_branch_offset = 1 << 25; - if (r_type != (unsigned int) R_PPC64_REL24) + if (r_type != R_PPC64_REL24) max_branch_offset = 1 << 15; if (branch_offset + max_branch_offset >= 2 * max_branch_offset) @@ -4334,29 +6178,22 @@ ppc_type_of_stub (input_sec, rel, hash, destination) /* Build a .plt call stub. */ -static bfd_byte * -build_plt_stub (obfd, p, offset, glink) - bfd *obfd; - bfd_byte *p; - int offset; - int glink; +static inline bfd_byte * +build_plt_stub (bfd *obfd, bfd_byte *p, int offset) { #define PPC_LO(v) ((v) & 0xffff) #define PPC_HI(v) (((v) >> 16) & 0xffff) #define PPC_HA(v) PPC_HI ((v) + 0x8000) - if (glink) - bfd_put_32 (obfd, LD_R2_40R1, p), p += 4; bfd_put_32 (obfd, ADDIS_R12_R2 | PPC_HA (offset), p), p += 4; - if (!glink) - bfd_put_32 (obfd, STD_R2_40R1, p), p += 4; + bfd_put_32 (obfd, STD_R2_40R1, p), p += 4; bfd_put_32 (obfd, LD_R11_0R12 | PPC_LO (offset), p), p += 4; if (PPC_HA (offset + 8) != PPC_HA (offset)) - bfd_put_32 (obfd, ADDIS_R12_R12_1, p), p += 4; + bfd_put_32 (obfd, ADDIS_R12_R12 | 1, p), p += 4; offset += 8; bfd_put_32 (obfd, LD_R2_0R12 | PPC_LO (offset), p), p += 4; if (PPC_HA (offset + 8) != PPC_HA (offset)) - bfd_put_32 (obfd, ADDIS_R12_R12_1, p), p += 4; + bfd_put_32 (obfd, ADDIS_R12_R12 | 1, p), p += 4; offset += 8; bfd_put_32 (obfd, MTCTR_R11, p), p += 4; bfd_put_32 (obfd, LD_R11_0R12 | PPC_LO (offset), p), p += 4; @@ -4364,39 +6201,35 @@ build_plt_stub (obfd, p, offset, glink) return p; } -static boolean -ppc_build_one_stub (gen_entry, in_arg) - struct bfd_hash_entry *gen_entry; - PTR in_arg; +static bfd_boolean +ppc_build_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) { struct ppc_stub_hash_entry *stub_entry; struct ppc_branch_hash_entry *br_entry; struct bfd_link_info *info; struct ppc_link_hash_table *htab; - asection *stub_sec; - bfd *stub_bfd; bfd_byte *loc; bfd_byte *p; unsigned int indx; + struct plt_entry *ent; bfd_vma off; int size; /* Massage our args to the form they really have. */ stub_entry = (struct ppc_stub_hash_entry *) gen_entry; - info = (struct bfd_link_info *) in_arg; + info = in_arg; htab = ppc_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->_cooked_size; - loc = stub_sec->contents + stub_entry->stub_offset; - - stub_bfd = stub_sec->owner; + stub_entry->stub_offset = stub_entry->stub_sec->_cooked_size; + loc = stub_entry->stub_sec->contents + stub_entry->stub_offset; + htab->stub_count[stub_entry->stub_type - 1] += 1; switch (stub_entry->stub_type) { case ppc_stub_long_branch: + case ppc_stub_long_branch_r2off: /* Branches are relative. This is where we are going to. */ off = (stub_entry->target_value + stub_entry->target_section->output_offset @@ -4404,73 +6237,113 @@ ppc_build_one_stub (gen_entry, in_arg) /* And this is where we are coming from. */ off -= (stub_entry->stub_offset - + stub_sec->output_offset - + stub_sec->output_section->vma); + + stub_entry->stub_sec->output_offset + + stub_entry->stub_sec->output_section->vma); - BFD_ASSERT (off + (1 << 25) < (bfd_vma) (1 << 26)); + if (stub_entry->stub_type != ppc_stub_long_branch_r2off) + size = 4; + else + { + bfd_vma r2off; + + r2off = (htab->stub_group[stub_entry->target_section->id].toc_off + - htab->stub_group[stub_entry->id_sec->id].toc_off); + bfd_put_32 (htab->stub_bfd, STD_R2_40R1, loc); + loc += 4; + bfd_put_32 (htab->stub_bfd, ADDIS_R2_R2 | PPC_HA (r2off), loc); + loc += 4; + bfd_put_32 (htab->stub_bfd, ADDI_R2_R2 | PPC_LO (r2off), loc); + loc += 4; + off -= 12; + size = 16; + } + bfd_put_32 (htab->stub_bfd, B_DOT | (off & 0x3fffffc), loc); - bfd_put_32 (stub_bfd, (bfd_vma) B_DOT | (off & 0x3fffffc), loc); - size = 4; + BFD_ASSERT (off + (1 << 25) < (bfd_vma) (1 << 26)); break; case ppc_stub_plt_branch: + case ppc_stub_plt_branch_r2off: br_entry = ppc_branch_hash_lookup (&htab->branch_hash_table, stub_entry->root.string + 9, - false, false); + FALSE, FALSE); if (br_entry == NULL) { (*_bfd_error_handler) (_("can't find branch stub `%s'"), stub_entry->root.string + 9); - htab->stub_error = true; - return false; + htab->stub_error = TRUE; + return FALSE; } off = (stub_entry->target_value + stub_entry->target_section->output_offset + stub_entry->target_section->output_section->vma); - bfd_put_64 (htab->sbrlt->owner, off, - htab->sbrlt->contents + br_entry->offset); + bfd_put_64 (htab->brlt->owner, off, + htab->brlt->contents + br_entry->offset); if (info->shared) { /* Create a reloc for the branch lookup table entry. */ Elf_Internal_Rela rela; - Elf64_External_Rela *r; + bfd_byte *rl; rela.r_offset = (br_entry->offset - + htab->sbrlt->output_offset - + htab->sbrlt->output_section->vma); + + htab->brlt->output_offset + + htab->brlt->output_section->vma); rela.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); rela.r_addend = off; - r = (Elf64_External_Rela *) htab->srelbrlt->contents; - r += htab->srelbrlt->reloc_count++; - bfd_elf64_swap_reloca_out (htab->srelbrlt->owner, &rela, r); + rl = htab->relbrlt->contents; + rl += htab->relbrlt->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (htab->relbrlt->owner, &rela, rl); } off = (br_entry->offset - + htab->sbrlt->output_offset - + htab->sbrlt->output_section->vma - - elf_gp (htab->sbrlt->output_section->owner) - - TOC_BASE_OFF); + + htab->brlt->output_offset + + htab->brlt->output_section->vma + - elf_gp (htab->brlt->output_section->owner) + - htab->stub_group[stub_entry->id_sec->id].toc_off); - if (off + 0x80000000 > 0xffffffff || (off & 7) != 0) + if (off + 0x80008000 > 0xffffffff || (off & 7) != 0) { (*_bfd_error_handler) (_("linkage table error against `%s'"), stub_entry->root.string); bfd_set_error (bfd_error_bad_value); - htab->stub_error = true; - return false; + htab->stub_error = TRUE; + return FALSE; } indx = off; - bfd_put_32 (stub_bfd, (bfd_vma) ADDIS_R12_R2 | PPC_HA (indx), loc); - bfd_put_32 (stub_bfd, (bfd_vma) LD_R11_0R12 | PPC_LO (indx), loc + 4); - bfd_put_32 (stub_bfd, (bfd_vma) MTCTR_R11, loc + 8); - bfd_put_32 (stub_bfd, (bfd_vma) BCTR, loc + 12); - size = 16; + if (stub_entry->stub_type != ppc_stub_plt_branch_r2off) + { + bfd_put_32 (htab->stub_bfd, ADDIS_R12_R2 | PPC_HA (indx), loc); + loc += 4; + bfd_put_32 (htab->stub_bfd, LD_R11_0R12 | PPC_LO (indx), loc); + size = 16; + } + else + { + bfd_vma r2off; + + r2off = (htab->stub_group[stub_entry->target_section->id].toc_off + - htab->stub_group[stub_entry->id_sec->id].toc_off); + bfd_put_32 (htab->stub_bfd, STD_R2_40R1, loc); + loc += 4; + bfd_put_32 (htab->stub_bfd, ADDIS_R12_R2 | PPC_HA (indx), loc); + loc += 4; + bfd_put_32 (htab->stub_bfd, LD_R11_0R12 | PPC_LO (indx), loc); + loc += 4; + bfd_put_32 (htab->stub_bfd, ADDIS_R2_R2 | PPC_HA (r2off), loc); + loc += 4; + bfd_put_32 (htab->stub_bfd, ADDI_R2_R2 | PPC_LO (r2off), loc); + size = 28; + } + loc += 4; + bfd_put_32 (htab->stub_bfd, MTCTR_R11, loc); + loc += 4; + bfd_put_32 (htab->stub_bfd, BCTR, loc); break; case ppc_stub_plt_call: @@ -4482,82 +6355,122 @@ ppc_build_one_stub (gen_entry, in_arg) { /* Point the symbol at the stub. There may be multiple stubs, we don't really care; The main thing is to make this sym - defined somewhere. */ + defined somewhere. Maybe defining the symbol in the stub + section is a silly idea. If we didn't do this, htab->top_id + could disappear. */ stub_entry->h->oh->root.type = bfd_link_hash_defined; stub_entry->h->oh->root.u.def.section = stub_entry->stub_sec; stub_entry->h->oh->root.u.def.value = stub_entry->stub_offset; } /* Now build the stub. */ - off = stub_entry->h->elf.plt.offset; + off = (bfd_vma) -1; + for (ent = stub_entry->h->elf.plt.plist; ent != NULL; ent = ent->next) + if (ent->addend == stub_entry->addend) + { + off = ent->plt.offset; + break; + } if (off >= (bfd_vma) -2) abort (); off &= ~ (bfd_vma) 1; - off += (htab->splt->output_offset - + htab->splt->output_section->vma - - elf_gp (htab->splt->output_section->owner) - - TOC_BASE_OFF); + off += (htab->plt->output_offset + + htab->plt->output_section->vma + - elf_gp (htab->plt->output_section->owner) + - htab->stub_group[stub_entry->id_sec->id].toc_off); - if (off + 0x80000000 > 0xffffffff || (off & 7) != 0) + if (off + 0x80008000 > 0xffffffff || (off & 7) != 0) { (*_bfd_error_handler) (_("linkage table error against `%s'"), stub_entry->h->elf.root.root.string); bfd_set_error (bfd_error_bad_value); - htab->stub_error = true; - return false; + htab->stub_error = TRUE; + return FALSE; } - p = build_plt_stub (stub_bfd, loc, (int) off, 0); + p = build_plt_stub (htab->stub_bfd, loc, off); size = p - loc; break; default: BFD_FAIL (); - return false; + return FALSE; } - stub_sec->_cooked_size += size; - return true; + stub_entry->stub_sec->_cooked_size += size; + + if (htab->emit_stub_syms + && !(stub_entry->stub_type == ppc_stub_plt_call + && stub_entry->h->oh->root.type == bfd_link_hash_defined + && stub_entry->h->oh->root.u.def.section == stub_entry->stub_sec + && stub_entry->h->oh->root.u.def.value == stub_entry->stub_offset)) + { + struct elf_link_hash_entry *h; + h = elf_link_hash_lookup (&htab->elf, stub_entry->root.string, + TRUE, FALSE, FALSE); + if (h == NULL) + return FALSE; + if (h->root.type == bfd_link_hash_new) + { + h->root.type = bfd_link_hash_defined; + h->root.u.def.section = stub_entry->stub_sec; + h->root.u.def.value = stub_entry->stub_offset; + h->elf_link_hash_flags = (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_DEF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK + | ELF_LINK_FORCED_LOCAL); + } + } + + return TRUE; } /* As above, but don't actually build the stub. Just bump offset so we know stub section sizes, and select plt_branch stubs where long_branch stubs won't do. */ -static boolean -ppc_size_one_stub (gen_entry, in_arg) - struct bfd_hash_entry *gen_entry; - PTR in_arg; +static bfd_boolean +ppc_size_one_stub (struct bfd_hash_entry *gen_entry, void *in_arg) { struct ppc_stub_hash_entry *stub_entry; + struct bfd_link_info *info; struct ppc_link_hash_table *htab; bfd_vma off; int size; /* Massage our args to the form they really have. */ stub_entry = (struct ppc_stub_hash_entry *) gen_entry; - htab = (struct ppc_link_hash_table *) in_arg; + info = in_arg; + + htab = ppc_hash_table (info); if (stub_entry->stub_type == ppc_stub_plt_call) { - off = stub_entry->h->elf.plt.offset & ~(bfd_vma) 1; - off += (htab->splt->output_offset - + htab->splt->output_section->vma - - elf_gp (htab->splt->output_section->owner) - - TOC_BASE_OFF); - - size = 28; - if (PPC_HA ((int) off + 16) != PPC_HA ((int) off)) + struct plt_entry *ent; + off = (bfd_vma) -1; + for (ent = stub_entry->h->elf.plt.plist; ent != NULL; ent = ent->next) + if (ent->addend == stub_entry->addend) + { + off = ent->plt.offset & ~(bfd_vma) 1; + break; + } + if (off >= (bfd_vma) -2) + abort (); + off += (htab->plt->output_offset + + htab->plt->output_section->vma + - elf_gp (htab->plt->output_section->owner) + - htab->stub_group[stub_entry->id_sec->id].toc_off); + + size = PLT_CALL_STUB_SIZE; + if (PPC_HA (off + 16) != PPC_HA (off)) size += 4; } else { - /* ppc_stub_long_branch or ppc_stub_plt_branch. */ - stub_entry->stub_type = ppc_stub_long_branch; - size = 4; - + /* ppc_stub_long_branch or ppc_stub_plt_branch, or their r2off + variants. */ off = (stub_entry->target_value + stub_entry->target_section->output_offset + stub_entry->target_section->output_section->vma); @@ -4565,34 +6478,53 @@ ppc_size_one_stub (gen_entry, in_arg) + stub_entry->stub_sec->output_offset + stub_entry->stub_sec->output_section->vma); + /* Reset the stub type from the plt variant in case we now + can reach with a shorter stub. */ + if (stub_entry->stub_type >= ppc_stub_plt_branch) + stub_entry->stub_type += ppc_stub_long_branch - ppc_stub_plt_branch; + + size = 4; + if (stub_entry->stub_type == ppc_stub_long_branch_r2off) + { + off -= 12; + size = 16; + } + + /* If the branch offset if too big, use a ppc_stub_plt_branch. */ if (off + (1 << 25) >= (bfd_vma) (1 << 26)) { struct ppc_branch_hash_entry *br_entry; br_entry = ppc_branch_hash_lookup (&htab->branch_hash_table, stub_entry->root.string + 9, - true, false); + TRUE, FALSE); if (br_entry == NULL) { (*_bfd_error_handler) (_("can't build branch stub `%s'"), stub_entry->root.string + 9); - htab->stub_error = true; - return false; + htab->stub_error = TRUE; + return FALSE; } if (br_entry->iter != htab->stub_iteration) { br_entry->iter = htab->stub_iteration; - br_entry->offset = htab->sbrlt->_raw_size; - htab->sbrlt->_raw_size += 8; + br_entry->offset = htab->brlt->_raw_size; + htab->brlt->_raw_size += 8; + + if (info->shared) + htab->relbrlt->_raw_size += sizeof (Elf64_External_Rela); } - stub_entry->stub_type = ppc_stub_plt_branch; + + stub_entry->stub_type += ppc_stub_plt_branch - ppc_stub_long_branch; size = 16; + if (stub_entry->stub_type != ppc_stub_plt_branch) + size = 28; } } stub_entry->stub_sec->_raw_size += size; - return true; + return TRUE; } /* Set up various things so that we can make a list of input sections @@ -4600,23 +6532,20 @@ ppc_size_one_stub (gen_entry, in_arg) 0 when no stubs will be needed, and 1 on success. */ int -ppc64_elf_setup_section_lists (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +ppc64_elf_setup_section_lists (bfd *output_bfd, struct bfd_link_info *info) { bfd *input_bfd; - int top_id, top_index; + int top_id, top_index, id; asection *section; - asection **input_list, **list; + asection **input_list; bfd_size_type amt; struct ppc_link_hash_table *htab = ppc_hash_table (info); - if (htab->elf.root.creator->flavour != bfd_target_elf_flavour - || htab->sbrlt == NULL) + if (htab->brlt == NULL) return 0; /* Find the top input section id. */ - for (input_bfd = info->input_bfds, top_id = 0; + for (input_bfd = info->input_bfds, top_id = 3; input_bfd != NULL; input_bfd = input_bfd->link_next) { @@ -4629,11 +6558,18 @@ ppc64_elf_setup_section_lists (output_bfd, info) } } + htab->top_id = top_id; amt = sizeof (struct map_stub) * (top_id + 1); - htab->stub_group = (struct map_stub *) bfd_zmalloc (amt); + htab->stub_group = bfd_zmalloc (amt); if (htab->stub_group == NULL) return -1; + /* Set toc_off for com, und, abs and ind sections. */ + for (id = 0; id < 3; id++) + htab->stub_group[id].toc_off = TOC_BASE_OFF; + + elf_gp (output_bfd) = htab->toc_curr = ppc64_elf_toc (output_bfd); + /* 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. */ @@ -4647,27 +6583,114 @@ ppc64_elf_setup_section_lists (output_bfd, info) htab->top_index = top_index; amt = sizeof (asection *) * (top_index + 1); - input_list = (asection **) bfd_malloc (amt); + input_list = bfd_zmalloc (amt); htab->input_list = input_list; if (input_list == NULL) return -1; - /* 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); + return 1; +} - for (section = output_bfd->sections; - section != NULL; - section = section->next) +/* The linker repeatedly calls this function for each TOC input section + and linker generated GOT section. Group input bfds such that the toc + within a group is less than 64k in size. Will break with cute linker + scripts that play games with dot in the output toc section. */ + +void +ppc64_elf_next_toc_section (struct bfd_link_info *info, asection *isec) +{ + struct ppc_link_hash_table *htab = ppc_hash_table (info); + + if (!htab->no_multi_toc) { - if ((section->flags & SEC_CODE) != 0) - input_list[section->index] = NULL; + bfd_vma addr = isec->output_offset + isec->output_section->vma; + bfd_vma off = addr - htab->toc_curr; + if (off + isec->_raw_size > 0x10000) + { + htab->toc_curr = addr; + htab->multi_toc_needed = 1; + } + elf_gp (isec->owner) = (htab->toc_curr + - elf_gp (isec->output_section->owner) + + TOC_BASE_OFF); } +} - return 1; +/* Called after the last call to the above function. */ + +void +ppc64_elf_reinit_toc (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) +{ + struct ppc_link_hash_table *htab = ppc_hash_table (info); + + /* toc_curr tracks the TOC offset used for code sections below in + ppc64_elf_next_input_section. Start off at 0x8000. */ + htab->toc_curr = TOC_BASE_OFF; +} + +/* No toc references were found in ISEC. If the code in ISEC makes no + calls, then there's no need to use toc adjusting stubs when branching + into ISEC. Actually, indirect calls from ISEC are OK as they will + load r2. */ + +static int +toc_adjusting_stub_needed (struct bfd_link_info *info, asection *isec) +{ + bfd_byte *contents; + bfd_size_type i; + int ret; + int branch_ok; + + /* We know none of our code bearing sections will need toc stubs. */ + if ((isec->flags & SEC_LINKER_CREATED) != 0) + return 0; + + if (isec->_raw_size == 0) + return 0; + + /* Hack for linux kernel. .fixup contains branches, but only back to + the function that hit an exception. */ + branch_ok = strcmp (isec->name, ".fixup") == 0; + + contents = elf_section_data (isec)->this_hdr.contents; + if (contents == NULL) + { + contents = bfd_malloc (isec->_raw_size); + if (contents == NULL) + return -1; + if (! bfd_get_section_contents (isec->owner, isec, contents, + 0, isec->_raw_size)) + { + free (contents); + return -1; + } + if (info->keep_memory) + elf_section_data (isec)->this_hdr.contents = contents; + } + + /* Code scan, because we don't necessarily have relocs on calls to + static functions. */ + ret = 0; + for (i = 0; i < isec->_raw_size; i += 4) + { + unsigned long insn = bfd_get_32 (isec->owner, contents + i); + /* Is this a branch? */ + if ((insn & (0x3f << 26)) == (18 << 26) + /* If branch and link, it's a function call. */ + && ((insn & 1) != 0 + /* Sibling calls use a plain branch. I don't know a way + of deciding whether a branch is really a sibling call. */ + || !branch_ok)) + { + ret = 1; + break; + } + } + + if (elf_section_data (isec)->this_hdr.contents != contents) + free (contents); + return ret; } /* The linker repeatedly calls this function for each input section, @@ -4675,26 +6698,43 @@ ppc64_elf_setup_section_lists (output_bfd, info) Build lists of input sections to determine groupings between which we may insert linker stubs. */ -void -ppc64_elf_next_input_section (info, isec) - struct bfd_link_info *info; - asection *isec; +bfd_boolean +ppc64_elf_next_input_section (struct bfd_link_info *info, asection *isec) { struct ppc_link_hash_table *htab = ppc_hash_table (info); + int ret; - if (isec->output_section->index <= htab->top_index) + if ((isec->output_section->flags & SEC_CODE) != 0 + && isec->output_section->index <= htab->top_index) { asection **list = htab->input_list + isec->output_section->index; - if (*list != bfd_abs_section_ptr) - { - /* Steal the link_sec pointer for our list. */ + /* Steal the link_sec pointer for our list. */ #define PREV_SEC(sec) (htab->stub_group[(sec)->id].link_sec) - /* This happens to make the list in reverse order, - which is what we want. */ - PREV_SEC (isec) = *list; - *list = isec; - } + /* This happens to make the list in reverse order, + which is what we want. */ + PREV_SEC (isec) = *list; + *list = isec; + } + + /* If a code section has a function that uses the TOC then we need + to use the right TOC (obviously). Also, make sure that .opd gets + the correct TOC value for R_PPC64_TOC relocs that don't have or + can't find their function symbol (shouldn't ever happen now). */ + if (isec->has_gp_reloc || (isec->flags & SEC_CODE) == 0) + { + if (elf_gp (isec->owner) != 0) + htab->toc_curr = elf_gp (isec->owner); } + else if ((ret = toc_adjusting_stub_needed (info, isec)) < 0) + return FALSE; + else + isec->has_gp_reloc = ret; + + /* Functions that don't use the TOC can belong in any TOC group. + Use the last TOC base. This happens to make _init and _fini + pasting work. */ + htab->stub_group[isec->id].toc_off = htab->toc_curr; + return TRUE; } /* See whether we can group stub sections together. Grouping stub @@ -4705,31 +6745,34 @@ ppc64_elf_next_input_section (info, isec) the middle of a function is not a good idea. */ static void -group_sections (htab, stub_group_size, stubs_always_before_branch) - struct ppc_link_hash_table *htab; - bfd_size_type stub_group_size; - boolean stubs_always_before_branch; +group_sections (struct ppc_link_hash_table *htab, + bfd_size_type stub_group_size, + bfd_boolean stubs_always_before_branch) { asection **list = htab->input_list + htab->top_index; do { asection *tail = *list; - if (tail == bfd_abs_section_ptr) - continue; while (tail != NULL) { asection *curr; asection *prev; bfd_size_type total; + bfd_boolean big_sec; + bfd_vma curr_toc; curr = tail; if (tail->_cooked_size) total = tail->_cooked_size; else total = tail->_raw_size; + big_sec = total >= stub_group_size; + curr_toc = htab->stub_group[tail->id].toc_off; + while ((prev = PREV_SEC (curr)) != NULL && ((total += curr->output_offset - prev->output_offset) - < stub_group_size)) + < stub_group_size) + && htab->stub_group[prev->id].toc_off == curr_toc) curr = prev; /* OK, the size from the start of CURR to the end is less @@ -4741,7 +6784,7 @@ group_sections (htab, stub_group_size, stubs_always_before_branch) section size. That's a little tricky, and this way will only break if stubs added make the total size more than 2^25, ie. for the default stub_group_size, if stubs total - more than 2834432 bytes, or over 100000 plt call stubs. */ + more than 2097152 bytes, or nearly 75000 plt call stubs. */ do { prev = PREV_SEC (tail); @@ -4751,13 +6794,17 @@ group_sections (htab, stub_group_size, stubs_always_before_branch) while (tail != curr && (tail = prev) != NULL); /* But wait, there's more! Input sections up to stub_group_size - bytes before the stub section can be handled by it too. */ - if (!stubs_always_before_branch) + bytes before the stub section can be handled by it too. + Don't do this if we have a really large section after the + stubs, as adding more stubs increases the chance that + branches may not reach into the stub section. */ + if (!stubs_always_before_branch && !big_sec) { total = 0; while (prev != NULL && ((total += tail->output_offset - prev->output_offset) - < stub_group_size)) + < stub_group_size) + && htab->stub_group[prev->id].toc_off == curr_toc) { tail = prev; prev = PREV_SEC (tail); @@ -4778,22 +6825,18 @@ group_sections (htab, stub_group_size, stubs_always_before_branch) PC-relative calls to a target that is unreachable with a "bl" instruction. */ -boolean -ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, - add_stub_section, layout_sections_again) - bfd *output_bfd; - bfd *stub_bfd; - struct bfd_link_info *info; - bfd_signed_vma group_size; - asection * (*add_stub_section) PARAMS ((const char *, asection *)); - void (*layout_sections_again) PARAMS ((void)); +bfd_boolean +ppc64_elf_size_stubs (bfd *output_bfd, + struct bfd_link_info *info, + bfd_signed_vma group_size, + asection *(*add_stub_section) (const char *, asection *), + void (*layout_sections_again) (void)) { bfd_size_type stub_group_size; - boolean stubs_always_before_branch; + bfd_boolean stubs_always_before_branch; struct ppc_link_hash_table *htab = ppc_hash_table (info); /* Stash our params away. */ - htab->stub_bfd = stub_bfd; htab->add_stub_section = add_stub_section; htab->layout_sections_again = layout_sections_again; stubs_always_before_branch = group_size < 0; @@ -4804,9 +6847,18 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, if (stub_group_size == 1) { /* Default values. */ - stub_group_size = 30720000; - if (htab->has_14bit_branch) - stub_group_size = 30000; + if (stubs_always_before_branch) + { + stub_group_size = 0x1e00000; + if (htab->has_14bit_branch) + stub_group_size = 0x7800; + } + else + { + stub_group_size = 0x1c00000; + if (htab->has_14bit_branch) + stub_group_size = 0x7000; + } } group_sections (htab, stub_group_size, stubs_always_before_branch); @@ -4816,10 +6868,10 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, bfd *input_bfd; unsigned int bfd_indx; asection *stub_sec; - boolean stub_changed; + bfd_boolean stub_changed; htab->stub_iteration += 1; - stub_changed = false; + stub_changed = FALSE; for (input_bfd = info->input_bfds, bfd_indx = 0; input_bfd != NULL; @@ -4855,9 +6907,8 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, /* Get the relocs. */ internal_relocs - = _bfd_elf64_link_read_relocs (input_bfd, section, NULL, - (Elf_Internal_Rela *) NULL, - info->keep_memory); + = _bfd_elf_link_read_relocs (input_bfd, section, NULL, NULL, + info->keep_memory); if (internal_relocs == NULL) goto error_ret_free_local; @@ -4866,61 +6917,47 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, irelaend = irela + section->reloc_count; for (; irela < irelaend; irela++) { - unsigned int r_type, r_indx; + enum elf_ppc64_reloc_type r_type; + unsigned int r_indx; enum ppc_stub_type stub_type; struct ppc_stub_hash_entry *stub_entry; asection *sym_sec; bfd_vma sym_value; bfd_vma destination; struct ppc_link_hash_entry *hash; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; char *stub_name; const asection *id_sec; r_type = ELF64_R_TYPE (irela->r_info); r_indx = ELF64_R_SYM (irela->r_info); - if (r_type >= (unsigned int) R_PPC_max) + if (r_type >= R_PPC64_max) { bfd_set_error (bfd_error_bad_value); goto error_ret_free_internal; } /* Only look for stubs on branch instructions. */ - if (r_type != (unsigned int) R_PPC64_REL24 - && r_type != (unsigned int) R_PPC64_REL14 - && r_type != (unsigned int) R_PPC64_REL14_BRTAKEN - && r_type != (unsigned int) R_PPC64_REL14_BRNTAKEN) + if (r_type != R_PPC64_REL24 + && r_type != R_PPC64_REL14 + && r_type != R_PPC64_REL14_BRTAKEN + && r_type != R_PPC64_REL14_BRNTAKEN) 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) + if (!get_sym_h (&h, &sym, &sym_sec, NULL, &local_syms, + r_indx, input_bfd)) + goto error_ret_free_internal; + hash = (struct ppc_link_hash_entry *) h; + + if (hash == NULL) { /* It's a local symbol. */ - Elf_Internal_Sym *sym; - Elf_Internal_Shdr *hdr; - - if (local_syms == NULL) - { - local_syms - = (Elf_Internal_Sym *) symtab_hdr->contents; - if (local_syms == NULL) - local_syms - = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, - symtab_hdr->sh_info, 0, - NULL, NULL, NULL); - if (local_syms == NULL) - goto error_ret_free_internal; - } - 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; + sym_value = sym->st_value; destination = (sym_value + irela->r_addend + sym_sec->output_offset + sym_sec->output_section->vma); @@ -4928,21 +6965,10 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, else { /* It's an external symbol. */ - int e_indx; - - e_indx = r_indx - symtab_hdr->sh_info; - hash = ((struct ppc_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 ppc_link_hash_entry *) - hash->elf.root.u.i.link); - + sym_value = 0; 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 @@ -4963,9 +6989,44 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, /* Determine what (if any) linker stub is needed. */ stub_type = ppc_type_of_stub (section, irela, &hash, destination); + + if (stub_type != ppc_stub_plt_call) + { + /* Check whether we need a TOC adjusting stub. + Since the linker pastes together pieces from + different object files when creating the + _init and _fini functions, it may be that a + call to what looks like a local sym is in + fact a call needing a TOC adjustment. */ + if (sym_sec != NULL + && sym_sec->output_section != NULL + && (htab->stub_group[sym_sec->id].toc_off + != htab->stub_group[section->id].toc_off) + && sym_sec->has_gp_reloc + && section->has_gp_reloc) + stub_type = ppc_stub_long_branch_r2off; + } + if (stub_type == ppc_stub_none) continue; + /* __tls_get_addr calls might be eliminated. */ + if (stub_type != ppc_stub_plt_call + && hash != NULL + && &hash->elf == htab->tls_get_addr + && section->has_tls_reloc + && irela != internal_relocs) + { + /* Get tls info. */ + char *tls_mask; + + if (!get_tls_mask (&tls_mask, NULL, &local_syms, + irela - 1, input_bfd)) + goto error_ret_free_internal; + if (*tls_mask != 0) + continue; + } + /* Support for grouping stub sections. */ id_sec = htab->stub_group[section->id].link_sec; @@ -4975,7 +7036,7 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, goto error_ret_free_internal; stub_entry = ppc_stub_hash_lookup (&htab->stub_hash_table, - stub_name, false, false); + stub_name, FALSE, FALSE); if (stub_entry != NULL) { /* The proper stub has already been created. */ @@ -4995,14 +7056,15 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, && (symtab_hdr->contents != (unsigned char *) local_syms)) free (local_syms); - return false; + return FALSE; } + stub_entry->stub_type = stub_type; stub_entry->target_value = sym_value; stub_entry->target_section = sym_sec; - stub_entry->stub_type = stub_type; stub_entry->h = hash; - stub_changed = true; + stub_entry->addend = irela->r_addend; + stub_changed = TRUE; } /* We're done with the internal relocs, free them. */ @@ -5028,14 +7090,20 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, for (stub_sec = htab->stub_bfd->sections; stub_sec != NULL; stub_sec = stub_sec->next) + if ((stub_sec->flags & SEC_LINKER_CREATED) == 0) + { + stub_sec->_raw_size = 0; + stub_sec->_cooked_size = 0; + } + htab->brlt->_raw_size = 0; + htab->brlt->_cooked_size = 0; + if (info->shared) { - stub_sec->_raw_size = 0; - stub_sec->_cooked_size = 0; + htab->relbrlt->_raw_size = 0; + htab->relbrlt->_cooked_size = 0; } - htab->sbrlt->_raw_size = 0; - htab->sbrlt->_cooked_size = 0; - bfd_hash_traverse (&htab->stub_hash_table, ppc_size_one_stub, htab); + bfd_hash_traverse (&htab->stub_hash_table, ppc_size_one_stub, info); /* Ask the linker to do its stuff. */ (*htab->layout_sections_again) (); @@ -5046,15 +7114,14 @@ ppc64_elf_size_stubs (output_bfd, stub_bfd, info, group_size, the dynamic symbol table is corrupted since the section symbol for the stripped section isn't written. */ - return true; + return TRUE; } /* Called after we have determined section placement. If sections move, we'll be called again. Provide a value for TOCstart. */ bfd_vma -ppc64_elf_toc (obfd) - bfd *obfd; +ppc64_elf_toc (bfd *obfd) { asection *s; bfd_vma TOCstart; @@ -5110,79 +7177,141 @@ ppc64_elf_toc (obfd) The stubs are kept in a hash table attached to the main linker hash table. This function is called via gldelf64ppc_finish. */ -boolean -ppc64_elf_build_stubs (info) - struct bfd_link_info *info; +bfd_boolean +ppc64_elf_build_stubs (bfd_boolean emit_stub_syms, + struct bfd_link_info *info, + char **stats) { struct ppc_link_hash_table *htab = ppc_hash_table (info); asection *stub_sec; - bfd_vma plt_r2; bfd_byte *p; + int stub_sec_count = 0; + htab->emit_stub_syms = emit_stub_syms; for (stub_sec = htab->stub_bfd->sections; stub_sec != NULL; stub_sec = stub_sec->next) - { - bfd_size_type size; + if ((stub_sec->flags & SEC_LINKER_CREATED) == 0) + { + bfd_size_type size; - /* Allocate memory to hold the linker stubs. */ - size = stub_sec->_raw_size; - if (size != 0) - { - stub_sec->contents = (bfd_byte *) bfd_zalloc (htab->stub_bfd, size); - if (stub_sec->contents == NULL) - return false; - } - stub_sec->_cooked_size = 0; - } + /* Allocate memory to hold the linker stubs. */ + size = stub_sec->_raw_size; + if (size != 0) + { + stub_sec->contents = bfd_zalloc (htab->stub_bfd, size); + if (stub_sec->contents == NULL) + return FALSE; + } + stub_sec->_cooked_size = 0; + } - if (htab->splt != NULL) + if (htab->plt != NULL) { unsigned int indx; + bfd_vma plt0; /* Build the .glink plt call stub. */ - plt_r2 = (htab->splt->output_offset - + htab->splt->output_section->vma - - elf_gp (htab->splt->output_section->owner) - - TOC_BASE_OFF); - p = htab->sglink->contents; - p = build_plt_stub (htab->sglink->owner, p, (int) plt_r2, 1); - while (p < htab->sglink->contents + GLINK_CALL_STUB_SIZE) + plt0 = (htab->plt->output_section->vma + + htab->plt->output_offset + - (htab->glink->output_section->vma + + htab->glink->output_offset + + GLINK_CALL_STUB_SIZE)); + if (plt0 + 0x80008000 > 0xffffffff) { - bfd_put_32 (htab->sglink->owner, NOP, p); - p += 4; + (*_bfd_error_handler) (_(".glink and .plt too far apart")); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + if (htab->emit_stub_syms) + { + struct elf_link_hash_entry *h; + h = elf_link_hash_lookup (&htab->elf, "__glink", TRUE, FALSE, FALSE); + if (h == NULL) + return FALSE; + if (h->root.type == bfd_link_hash_new) + { + h->root.type = bfd_link_hash_defined; + h->root.u.def.section = htab->glink; + h->root.u.def.value = 0; + h->elf_link_hash_flags = (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_DEF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK + | ELF_LINK_FORCED_LOCAL); + } } + p = htab->glink->contents; + bfd_put_32 (htab->glink->owner, MFCTR_R12, p); + p += 4; + bfd_put_32 (htab->glink->owner, SLDI_R11_R0_3, p); + p += 4; + bfd_put_32 (htab->glink->owner, ADDIC_R2_R0_32K, p); + p += 4; + bfd_put_32 (htab->glink->owner, SUB_R12_R12_R11, p); + p += 4; + bfd_put_32 (htab->glink->owner, SRADI_R2_R2_63, p); + p += 4; + bfd_put_32 (htab->glink->owner, SLDI_R11_R0_2, p); + p += 4; + bfd_put_32 (htab->glink->owner, AND_R2_R2_R11, p); + p += 4; + bfd_put_32 (htab->glink->owner, SUB_R12_R12_R11, p); + p += 4; + bfd_put_32 (htab->glink->owner, ADD_R12_R12_R2, p); + p += 4; + bfd_put_32 (htab->glink->owner, ADDIS_R12_R12 | PPC_HA (plt0), p); + p += 4; + bfd_put_32 (htab->glink->owner, LD_R11_0R12 | PPC_LO (plt0), p); + p += 4; + bfd_put_32 (htab->glink->owner, ADDI_R12_R12 | PPC_LO (plt0), p); + p += 4; + bfd_put_32 (htab->glink->owner, LD_R2_0R12 | 8, p); + p += 4; + bfd_put_32 (htab->glink->owner, MTCTR_R11, p); + p += 4; + bfd_put_32 (htab->glink->owner, LD_R11_0R12 | 16, p); + p += 4; + bfd_put_32 (htab->glink->owner, BCTR, p); + p += 4; /* Build the .glink lazy link call stubs. */ indx = 0; - while (p < htab->sglink->contents + htab->sglink->_raw_size) + while (p < htab->glink->contents + htab->glink->_raw_size) { if (indx < 0x8000) { - bfd_put_32 (htab->sglink->owner, LI_R0_0 | indx, p); + bfd_put_32 (htab->glink->owner, LI_R0_0 | indx, p); p += 4; } else { - bfd_put_32 (htab->sglink->owner, LIS_R0_0 | PPC_HI (indx), p); + bfd_put_32 (htab->glink->owner, LIS_R0_0 | PPC_HI (indx), p); p += 4; - bfd_put_32 (htab->sglink->owner, ORI_R0_R0_0 | PPC_LO (indx), p); + bfd_put_32 (htab->glink->owner, ORI_R0_R0_0 | PPC_LO (indx), p); p += 4; } - bfd_put_32 (htab->sglink->owner, - B_DOT | ((htab->sglink->contents - p) & 0x3fffffc), p); + bfd_put_32 (htab->glink->owner, + B_DOT | ((htab->glink->contents - p) & 0x3fffffc), p); indx++; p += 4; } - htab->sglink->_cooked_size = p - htab->sglink->contents; + htab->glink->_cooked_size = p - htab->glink->contents; } - if (htab->sbrlt->_raw_size != 0) + if (htab->brlt->_raw_size != 0) { - htab->sbrlt->contents = (bfd_byte *) bfd_zalloc (htab->sbrlt->owner, - htab->sbrlt->_raw_size); - if (htab->sbrlt->contents == NULL) - return false; + htab->brlt->contents = bfd_zalloc (htab->brlt->owner, + htab->brlt->_raw_size); + if (htab->brlt->contents == NULL) + return FALSE; + } + if (info->shared && htab->relbrlt->_raw_size != 0) + { + htab->relbrlt->contents = bfd_zalloc (htab->relbrlt->owner, + htab->relbrlt->_raw_size); + if (htab->relbrlt->contents == NULL) + return FALSE; } /* Build the stubs as directed by the stub hash table. */ @@ -5191,19 +7320,43 @@ ppc64_elf_build_stubs (info) for (stub_sec = htab->stub_bfd->sections; stub_sec != NULL; stub_sec = stub_sec->next) - { - if (stub_sec->_raw_size != stub_sec->_cooked_size) - break; - } + if ((stub_sec->flags & SEC_LINKER_CREATED) == 0) + { + stub_sec_count += 1; + if (stub_sec->_raw_size != stub_sec->_cooked_size) + break; + } if (stub_sec != NULL - || htab->sglink->_raw_size != htab->sglink->_cooked_size) + || htab->glink->_raw_size != htab->glink->_cooked_size) { - htab->stub_error = true; + htab->stub_error = TRUE; (*_bfd_error_handler) (_("stubs don't match calculated size")); } - return !htab->stub_error; + if (htab->stub_error) + return FALSE; + + if (stats != NULL) + { + *stats = bfd_malloc (500); + if (*stats == NULL) + return FALSE; + + sprintf (*stats, _("linker stubs in %u groups\n" + " branch %lu\n" + " toc adjust %lu\n" + " long branch %lu\n" + " long toc adj %lu\n" + " plt call %lu"), + stub_sec_count, + htab->stub_count[ppc_stub_long_branch - 1], + htab->stub_count[ppc_stub_long_branch_r2off - 1], + htab->stub_count[ppc_stub_plt_branch - 1], + htab->stub_count[ppc_stub_plt_branch_r2off - 1], + htab->stub_count[ppc_stub_plt_call - 1]); + } + return TRUE; } /* The RELOCATE_SECTION function is called by the ELF backend linker @@ -5215,7 +7368,7 @@ ppc64_elf_build_stubs (info) This function is responsible for adjust the section contents as necessary, and (if using Rela relocs and generating a - relocateable output file) adjusting the reloc addend as + relocatable output file) adjusting the reloc addend as necessary. This function does not have to worry about setting the reloc @@ -5229,56 +7382,55 @@ ppc64_elf_build_stubs (info) 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 + When generating relocatable output, this function must handle STB_LOCAL/STT_SECTION symbols specially. The output symbol is going to be the section symbol corresponding to the output section, which means that the addend must be adjusted accordingly. */ -static boolean -ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, - contents, relocs, local_syms, local_sections) - bfd *output_bfd; - struct bfd_link_info *info; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - Elf_Internal_Rela *relocs; - Elf_Internal_Sym *local_syms; - asection **local_sections; +static bfd_boolean +ppc64_elf_relocate_section (bfd *output_bfd, + struct bfd_link_info *info, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + Elf_Internal_Rela *relocs, + Elf_Internal_Sym *local_syms, + asection **local_sections) { struct ppc_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - bfd_vma *local_got_offsets; + Elf_Internal_Rela outrel; + bfd_byte *loc; + struct got_entry **local_got_ents; bfd_vma TOCstart; - boolean ret = true; - boolean is_opd; + bfd_boolean ret = TRUE; + bfd_boolean is_opd; /* Disabled until we sort out how ld should choose 'y' vs 'at'. */ - boolean is_power4 = false; + bfd_boolean is_power4 = FALSE; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; /* Initialize howto table if needed. */ if (!ppc64_elf_howto_table[R_PPC64_ADDR32]) ppc_howto_init (); htab = ppc_hash_table (info); - local_got_offsets = elf_local_got_offsets (input_bfd); + local_got_ents = elf_local_got_ents (input_bfd); TOCstart = elf_gp (output_bfd); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); - is_opd = elf_section_data (input_section)->tdata != NULL; + is_opd = ppc64_elf_section_data (input_section)->opd.adjust != NULL; rel = relocs; relend = relocs + input_section->reloc_count; for (; rel < relend; rel++) { - enum elf_ppc_reloc_type r_type; - bfd_vma offset; + enum elf_ppc64_reloc_type r_type; bfd_vma addend; bfd_reloc_status_type r; Elf_Internal_Sym *sym; @@ -5286,96 +7438,420 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, struct elf_link_hash_entry *h; struct elf_link_hash_entry *fdh; const char *sym_name; - unsigned long r_symndx; + unsigned long r_symndx, toc_symndx; + char tls_mask, tls_gd, tls_type; + char sym_type; bfd_vma relocation; - boolean unresolved_reloc; - boolean warned; - long insn; + bfd_boolean unresolved_reloc; + bfd_boolean warned; + unsigned long insn, mask; struct ppc_stub_hash_entry *stub_entry; bfd_vma max_br_offset; bfd_vma from; - r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rel->r_info); - r_symndx = ELF64_R_SYM (rel->r_info); - offset = rel->r_offset; - addend = rel->r_addend; - r = bfd_reloc_other; - sym = (Elf_Internal_Sym *) 0; - sec = (asection *) 0; - h = (struct elf_link_hash_entry *) 0; - sym_name = (const char *) 0; - unresolved_reloc = false; - warned = false; - - if (r_type == R_PPC64_TOC) - { - /* Relocation value is TOC base. Symbol is ignored. */ - relocation = TOCstart + TOC_BASE_OFF; - } - else if (r_symndx < symtab_hdr->sh_info) - { - /* It's a local symbol. */ - sym = local_syms + r_symndx; - sec = local_sections[r_symndx]; - sym_name = ""; + r_type = ELF64_R_TYPE (rel->r_info); + r_symndx = ELF64_R_SYM (rel->r_info); + + /* For old style R_PPC64_TOC relocs with a zero symbol, use the + symbol of the previous ADDR64 reloc. The symbol gives us the + proper TOC base to use. */ + if (rel->r_info == ELF64_R_INFO (0, R_PPC64_TOC) + && rel != relocs + && ELF64_R_TYPE (rel[-1].r_info) == R_PPC64_ADDR64 + && is_opd) + r_symndx = ELF64_R_SYM (rel[-1].r_info); + + sym = NULL; + sec = NULL; + h = NULL; + sym_name = NULL; + unresolved_reloc = FALSE; + warned = FALSE; + + if (r_symndx < symtab_hdr->sh_info) + { + /* It's a local symbol. */ + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + sym_name = bfd_elf_local_sym_name (input_bfd, sym); + sym_type = ELF64_ST_TYPE (sym->st_info); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); + if (elf_section_data (sec) != NULL) + { + long *opd_sym_adjust; + + opd_sym_adjust = ppc64_elf_section_data (sec)->opd.adjust; + if (opd_sym_adjust != NULL) + relocation += opd_sym_adjust[sym->st_value / 24]; + } + } + else + { + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); + sym_name = h->root.root.string; + sym_type = h->type; + } + + /* TLS optimizations. Replace instruction sequences and relocs + based on information we collected in tls_optimize. We edit + RELOCS so that --emit-relocs will output something sensible + for the final instruction stream. */ + tls_mask = 0; + tls_gd = 0; + toc_symndx = 0; + if (IS_PPC64_TLS_RELOC (r_type)) + { + if (h != NULL) + tls_mask = ((struct ppc_link_hash_entry *) h)->tls_mask; + else if (local_got_ents != NULL) + { + char *lgot_masks; + lgot_masks = (char *) (local_got_ents + symtab_hdr->sh_info); + tls_mask = lgot_masks[r_symndx]; + } + if (tls_mask == 0 && r_type == R_PPC64_TLS) + { + /* Check for toc tls entries. */ + char *toc_tls; + + if (!get_tls_mask (&toc_tls, &toc_symndx, &local_syms, + rel, input_bfd)) + return FALSE; + + if (toc_tls) + tls_mask = *toc_tls; + } + } + + /* Check that tls relocs are used with tls syms, and non-tls + relocs are used with non-tls syms. */ + if (r_symndx != 0 + && r_type != R_PPC64_NONE + && (h == NULL + || h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && IS_PPC64_TLS_RELOC (r_type) != (sym_type == STT_TLS)) + { + if (r_type == R_PPC64_TLS && tls_mask != 0) + /* R_PPC64_TLS is OK against a symbol in the TOC. */ + ; + else + (*_bfd_error_handler) + (sym_type == STT_TLS + ? _("%s(%s+0x%lx): %s used with TLS symbol %s") + : _("%s(%s+0x%lx): %s used with non-TLS symbol %s"), + bfd_archive_filename (input_bfd), + input_section->name, + (long) rel->r_offset, + ppc64_elf_howto_table[r_type]->name, + sym_name); + } + + /* Ensure reloc mapping code below stays sane. */ + if (R_PPC64_TOC16_LO_DS != R_PPC64_TOC16_DS + 1 + || R_PPC64_TOC16_LO != R_PPC64_TOC16 + 1 + || (R_PPC64_GOT_TLSLD16 & 3) != (R_PPC64_GOT_TLSGD16 & 3) + || (R_PPC64_GOT_TLSLD16_LO & 3) != (R_PPC64_GOT_TLSGD16_LO & 3) + || (R_PPC64_GOT_TLSLD16_HI & 3) != (R_PPC64_GOT_TLSGD16_HI & 3) + || (R_PPC64_GOT_TLSLD16_HA & 3) != (R_PPC64_GOT_TLSGD16_HA & 3) + || (R_PPC64_GOT_TLSLD16 & 3) != (R_PPC64_GOT_TPREL16_DS & 3) + || (R_PPC64_GOT_TLSLD16_LO & 3) != (R_PPC64_GOT_TPREL16_LO_DS & 3) + || (R_PPC64_GOT_TLSLD16_HI & 3) != (R_PPC64_GOT_TPREL16_HI & 3) + || (R_PPC64_GOT_TLSLD16_HA & 3) != (R_PPC64_GOT_TPREL16_HA & 3)) + abort (); + + switch (r_type) + { + default: + break; + + case R_PPC64_TOC16: + case R_PPC64_TOC16_LO: + case R_PPC64_TOC16_DS: + case R_PPC64_TOC16_LO_DS: + { + /* Check for toc tls entries. */ + char *toc_tls; + int retval; + + retval = get_tls_mask (&toc_tls, &toc_symndx, &local_syms, + rel, input_bfd); + if (retval == 0) + return FALSE; + + if (toc_tls) + { + tls_mask = *toc_tls; + if (r_type == R_PPC64_TOC16_DS + || r_type == R_PPC64_TOC16_LO_DS) + { + if (tls_mask != 0 + && (tls_mask & (TLS_DTPREL | TLS_TPREL)) == 0) + goto toctprel; + } + else + { + /* If we found a GD reloc pair, then we might be + doing a GD->IE transition. */ + if (retval == 2) + { + tls_gd = TLS_TPRELGD; + if (tls_mask != 0 && (tls_mask & TLS_GD) == 0) + goto tls_get_addr_check; + } + else if (retval == 3) + { + if (tls_mask != 0 && (tls_mask & TLS_LD) == 0) + goto tls_get_addr_check; + } + } + } + } + break; + + case R_PPC64_GOT_TPREL16_DS: + case R_PPC64_GOT_TPREL16_LO_DS: + if (tls_mask != 0 + && (tls_mask & TLS_TPREL) == 0) + { + toctprel: + insn = bfd_get_32 (output_bfd, contents + rel->r_offset - 2); + insn &= 31 << 21; + insn |= 0x3c0d0000; /* addis 0,13,0 */ + bfd_put_32 (output_bfd, insn, contents + rel->r_offset - 2); + r_type = R_PPC64_TPREL16_HA; + if (toc_symndx != 0) + { + rel->r_info = ELF64_R_INFO (toc_symndx, r_type); + /* We changed the symbol. Start over in order to + get h, sym, sec etc. right. */ + rel--; + continue; + } + else + rel->r_info = ELF64_R_INFO (r_symndx, r_type); + } + break; + + case R_PPC64_TLS: + if (tls_mask != 0 + && (tls_mask & TLS_TPREL) == 0) + { + bfd_vma rtra; + insn = bfd_get_32 (output_bfd, contents + rel->r_offset); + if ((insn & ((0x3f << 26) | (31 << 11))) + == ((31 << 26) | (13 << 11))) + rtra = insn & ((1 << 26) - (1 << 16)); + else if ((insn & ((0x3f << 26) | (31 << 16))) + == ((31 << 26) | (13 << 16))) + rtra = (insn & (31 << 21)) | ((insn & (31 << 11)) << 5); + else + abort (); + if ((insn & ((1 << 11) - (1 << 1))) == 266 << 1) + /* add -> addi. */ + insn = 14 << 26; + else if ((insn & (31 << 1)) == 23 << 1 + && ((insn & (31 << 6)) < 14 << 6 + || ((insn & (31 << 6)) >= 16 << 6 + && (insn & (31 << 6)) < 24 << 6))) + /* load and store indexed -> dform. */ + insn = (32 | ((insn >> 6) & 31)) << 26; + else if ((insn & (31 << 1)) == 21 << 1 + && (insn & (0x1a << 6)) == 0) + /* ldx, ldux, stdx, stdux -> ld, ldu, std, stdu. */ + insn = (((58 | ((insn >> 6) & 4)) << 26) + | ((insn >> 6) & 1)); + else if ((insn & (31 << 1)) == 21 << 1 + && (insn & ((1 << 11) - (1 << 1))) == 341 << 1) + /* lwax -> lwa. */ + insn = (58 << 26) | 2; + else + abort (); + insn |= rtra; + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); + /* Was PPC64_TLS which sits on insn boundary, now + PPC64_TPREL16_LO which is at insn+2. */ + rel->r_offset += 2; + r_type = R_PPC64_TPREL16_LO; + if (toc_symndx != 0) + { + rel->r_info = ELF64_R_INFO (toc_symndx, r_type); + /* We changed the symbol. Start over in order to + get h, sym, sec etc. right. */ + rel--; + continue; + } + else + rel->r_info = ELF64_R_INFO (r_symndx, r_type); + } + break; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); - /* rel may have changed, update our copy of addend. */ - addend = rel->r_addend; + case R_PPC64_GOT_TLSGD16_HI: + case R_PPC64_GOT_TLSGD16_HA: + tls_gd = TLS_TPRELGD; + if (tls_mask != 0 && (tls_mask & TLS_GD) == 0) + goto tls_gdld_hi; + break; - if (elf_section_data (sec) != NULL) + case R_PPC64_GOT_TLSLD16_HI: + case R_PPC64_GOT_TLSLD16_HA: + if (tls_mask != 0 && (tls_mask & TLS_LD) == 0) { - long *opd_sym_adjust; + tls_gdld_hi: + if ((tls_mask & tls_gd) != 0) + r_type = (((r_type - (R_PPC64_GOT_TLSGD16 & 3)) & 3) + + R_PPC64_GOT_TPREL16_DS); + else + { + bfd_put_32 (output_bfd, NOP, contents + rel->r_offset); + rel->r_offset -= 2; + r_type = R_PPC64_NONE; + } + rel->r_info = ELF64_R_INFO (r_symndx, r_type); + } + break; - opd_sym_adjust = (long *) elf_section_data (sec)->tdata; - if (opd_sym_adjust != NULL && sym->st_value % 24 == 0) - relocation += opd_sym_adjust[sym->st_value / 24]; + case R_PPC64_GOT_TLSGD16: + case R_PPC64_GOT_TLSGD16_LO: + tls_gd = TLS_TPRELGD; + if (tls_mask != 0 && (tls_mask & TLS_GD) == 0) + goto tls_get_addr_check; + break; + + case R_PPC64_GOT_TLSLD16: + case R_PPC64_GOT_TLSLD16_LO: + if (tls_mask != 0 && (tls_mask & TLS_LD) == 0) + { + tls_get_addr_check: + if (rel + 1 < relend) + { + enum elf_ppc64_reloc_type r_type2; + unsigned long r_symndx2; + struct elf_link_hash_entry *h2; + bfd_vma insn1, insn2, insn3; + bfd_vma offset; + + /* The next instruction should be a call to + __tls_get_addr. Peek at the reloc to be sure. */ + r_type2 = ELF64_R_TYPE (rel[1].r_info); + r_symndx2 = ELF64_R_SYM (rel[1].r_info); + if (r_symndx2 < symtab_hdr->sh_info + || (r_type2 != R_PPC64_REL14 + && r_type2 != R_PPC64_REL14_BRTAKEN + && r_type2 != R_PPC64_REL14_BRNTAKEN + && r_type2 != R_PPC64_REL24)) + break; + + h2 = sym_hashes[r_symndx2 - symtab_hdr->sh_info]; + while (h2->root.type == bfd_link_hash_indirect + || h2->root.type == bfd_link_hash_warning) + h2 = (struct elf_link_hash_entry *) h2->root.u.i.link; + if (h2 == NULL || h2 != htab->tls_get_addr) + break; + + /* OK, it checks out. Replace the call. */ + offset = rel[1].r_offset; + insn1 = bfd_get_32 (output_bfd, + contents + rel->r_offset - 2); + insn3 = bfd_get_32 (output_bfd, + contents + offset + 4); + if ((tls_mask & tls_gd) != 0) + { + /* IE */ + insn1 &= (1 << 26) - (1 << 2); + insn1 |= 58 << 26; /* ld */ + insn2 = 0x7c636a14; /* add 3,3,13 */ + rel[1].r_info = ELF64_R_INFO (r_symndx2, R_PPC64_NONE); + if ((tls_mask & TLS_EXPLICIT) == 0) + r_type = (((r_type - (R_PPC64_GOT_TLSGD16 & 3)) & 3) + + R_PPC64_GOT_TPREL16_DS); + else + r_type += R_PPC64_TOC16_DS - R_PPC64_TOC16; + rel->r_info = ELF64_R_INFO (r_symndx, r_type); + } + else + { + /* LE */ + insn1 = 0x3c6d0000; /* addis 3,13,0 */ + insn2 = 0x38630000; /* addi 3,3,0 */ + if (tls_gd == 0) + { + /* Was an LD reloc. */ + r_symndx = 0; + rel->r_addend = htab->elf.tls_sec->vma + DTP_OFFSET; + rel[1].r_addend = htab->elf.tls_sec->vma + DTP_OFFSET; + } + else if (toc_symndx != 0) + r_symndx = toc_symndx; + r_type = R_PPC64_TPREL16_HA; + rel->r_info = ELF64_R_INFO (r_symndx, r_type); + rel[1].r_info = ELF64_R_INFO (r_symndx, + R_PPC64_TPREL16_LO); + rel[1].r_offset += 2; + } + if (insn3 == NOP + || insn3 == CROR_151515 || insn3 == CROR_313131) + { + insn3 = insn2; + insn2 = NOP; + rel[1].r_offset += 4; + } + bfd_put_32 (output_bfd, insn1, contents + rel->r_offset - 2); + bfd_put_32 (output_bfd, insn2, contents + offset); + bfd_put_32 (output_bfd, insn3, contents + offset + 4); + if (tls_gd == 0 || toc_symndx != 0) + { + /* We changed the symbol. Start over in order + to get h, sym, sec etc. right. */ + rel--; + continue; + } + } } - } - else - { - /* It's a global symbol. */ - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - while (h->root.type == bfd_link_hash_indirect - || h->root.type == bfd_link_hash_warning) - h = (struct elf_link_hash_entry *) h->root.u.i.link; - sym_name = h->root.root.string; - relocation = 0; - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) + break; + + case R_PPC64_DTPMOD64: + if (rel + 1 < relend + && rel[1].r_info == ELF64_R_INFO (r_symndx, R_PPC64_DTPREL64) + && rel[1].r_offset == rel->r_offset + 8) { - sec = h->root.u.def.section; - if (sec->output_section == NULL) - /* Set a flag that will be cleared later if we find a - relocation value for this symbol. output_section - is typically NULL for symbols satisfied by a shared - library. */ - unresolved_reloc = true; - else - relocation = (h->root.u.def.value - + sec->output_section->vma - + sec->output_offset); + if ((tls_mask & TLS_GD) == 0) + { + rel[1].r_info = ELF64_R_INFO (r_symndx, R_PPC64_NONE); + if ((tls_mask & TLS_TPRELGD) != 0) + r_type = R_PPC64_TPREL64; + else + { + bfd_put_64 (output_bfd, 1, contents + rel->r_offset); + r_type = R_PPC64_NONE; + } + rel->r_info = ELF64_R_INFO (r_symndx, r_type); + } } - else if (h->root.type == bfd_link_hash_undefweak) - ; - else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) - && !info->no_undefined - && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - ; else { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.string, input_bfd, input_section, - offset, (!info->shared - || info->no_undefined - || ELF_ST_VISIBILITY (h->other))))) - return false; - warned = true; + if ((tls_mask & TLS_LD) == 0) + { + bfd_put_64 (output_bfd, 1, contents + rel->r_offset); + r_type = R_PPC64_NONE; + rel->r_info = ELF64_R_INFO (r_symndx, r_type); + } + } + break; + + case R_PPC64_TPREL64: + if ((tls_mask & TLS_TPREL) == 0) + { + r_type = R_PPC64_NONE; + rel->r_info = ELF64_R_INFO (r_symndx, r_type); } + break; } - /* First handle relocations that tweak non-addend part of insn. */ + /* Handle other relocations that tweak non-addend part of insn. */ insn = 0; switch (r_type) { @@ -5391,7 +7867,8 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Branch not taken prediction relocations. */ case R_PPC64_ADDR14_BRNTAKEN: case R_PPC64_REL14_BRNTAKEN: - insn |= bfd_get_32 (output_bfd, contents + offset) & ~(0x01 << 21); + insn |= bfd_get_32 (output_bfd, + contents + rel->r_offset) & ~(0x01 << 21); if (is_power4) { /* Set 'a' bit. This is 0b00010 in BO field for branch @@ -5406,51 +7883,97 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } else { - from = (offset + from = (rel->r_offset + input_section->output_offset + input_section->output_section->vma); /* Invert 'y' bit if not the default. */ - if ((bfd_signed_vma) (relocation + addend - from) < 0) + if ((bfd_signed_vma) (relocation + rel->r_addend - from) < 0) insn ^= 0x01 << 21; } - bfd_put_32 (output_bfd, (bfd_vma) insn, contents + offset); + bfd_put_32 (output_bfd, insn, contents + rel->r_offset); break; case R_PPC64_REL24: - /* A REL24 branching to a linkage function is followed by a - nop. We replace the nop with a ld in order to restore - the TOC base pointer. Only calls to shared objects need - to alter the TOC base. These are recognized by their - need for a PLT entry. */ - if (h != NULL - && (fdh = ((struct ppc_link_hash_entry *) h)->oh) != NULL - && fdh->plt.offset != (bfd_vma) -1 + /* Calls to functions with a different TOC, such as calls to + shared objects, need to alter the TOC pointer. This is + done using a linkage stub. A REL24 branching to these + linkage stubs needs to be followed by a nop, as the nop + will be replaced with an instruction to restore the TOC + base pointer. */ + if (((h != NULL + && (fdh = ((struct ppc_link_hash_entry *) h)->oh) != NULL + && fdh->plt.plist != NULL) + || ((fdh = h, sec) != NULL + && sec->output_section != NULL + && (htab->stub_group[sec->id].toc_off + != htab->stub_group[input_section->id].toc_off))) && (stub_entry = ppc_get_stub_entry (input_section, sec, fdh, - rel, htab)) != NULL) + rel, htab)) != NULL + && (stub_entry->stub_type == ppc_stub_plt_call + || stub_entry->stub_type == ppc_stub_plt_branch_r2off + || stub_entry->stub_type == ppc_stub_long_branch_r2off)) { - boolean can_plt_call = 0; + bfd_boolean can_plt_call = 0; - if (offset + 8 <= input_section->_cooked_size) + if (rel->r_offset + 8 <= input_section->_cooked_size) { - insn = bfd_get_32 (input_bfd, contents + offset + 4); + insn = bfd_get_32 (input_bfd, contents + rel->r_offset + 4); if (insn == NOP || insn == CROR_151515 || insn == CROR_313131) { - bfd_put_32 (input_bfd, (bfd_vma) LD_R2_40R1, - contents + offset + 4); + bfd_put_32 (input_bfd, LD_R2_40R1, + contents + rel->r_offset + 4); can_plt_call = 1; } } if (!can_plt_call) { - /* If this is a plain branch rather than a branch - and link, don't require a nop. */ - insn = bfd_get_32 (input_bfd, contents + offset); - if ((insn & 1) == 0) - can_plt_call = 1; + if (stub_entry->stub_type == ppc_stub_plt_call) + { + /* If this is a plain branch rather than a branch + and link, don't require a nop. */ + insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + if ((insn & 1) == 0) + can_plt_call = 1; + } + else if (h != NULL + && strcmp (h->root.root.string, + ".__libc_start_main") == 0) + { + /* Allow crt1 branch to go via a toc adjusting stub. */ + can_plt_call = 1; + } + else + { + if (strcmp (input_section->output_section->name, + ".init") == 0 + || strcmp (input_section->output_section->name, + ".fini") == 0) + (*_bfd_error_handler) + (_("%s(%s+0x%lx): automatic multiple TOCs " + "not supported using your crt files; " + "recompile with -mminimal-toc or upgrade gcc"), + bfd_archive_filename (input_bfd), + input_section->name, + (long) rel->r_offset); + else + (*_bfd_error_handler) + (_("%s(%s+0x%lx): sibling call optimization to `%s' " + "does not allow automatic multiple TOCs; " + "recompile with -mminimal-toc or " + "-fno-optimize-sibling-calls, " + "or make `%s' extern"), + bfd_archive_filename (input_bfd), + input_section->name, + (long) rel->r_offset, + sym_name, + sym_name); + bfd_set_error (bfd_error_bad_value); + ret = FALSE; + } } if (can_plt_call) @@ -5458,15 +7981,15 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (stub_entry->stub_offset + stub_entry->stub_sec->output_offset + stub_entry->stub_sec->output_section->vma); - addend = 0; - unresolved_reloc = false; + if (stub_entry->stub_type == ppc_stub_plt_call) + unresolved_reloc = FALSE; } } if (h != NULL && h->root.type == bfd_link_hash_undefweak && relocation == 0 - && addend == 0) + && rel->r_addend == 0) { /* Tweak calls to undefined weak functions to point at a blr. We can thus call a weak function without first @@ -5476,7 +7999,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (htab->sfpr->_raw_size - 4 + htab->sfpr->output_offset + htab->sfpr->output_section->vma); - from = (offset + from = (rel->r_offset + input_section->output_offset + input_section->output_section->vma); @@ -5490,6 +8013,8 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } /* Set `addend'. */ + tls_type = 0; + addend = rel->r_addend; switch (r_type) { default: @@ -5498,116 +8023,211 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_archive_filename (input_bfd), (int) r_type, sym_name); bfd_set_error (bfd_error_bad_value); - ret = false; + ret = FALSE; continue; case R_PPC64_NONE: - case R_PPC_GNU_VTINHERIT: - case R_PPC_GNU_VTENTRY: + case R_PPC64_TLS: + case R_PPC64_GNU_VTINHERIT: + case R_PPC64_GNU_VTENTRY: continue; /* GOT16 relocations. Like an ADDR16 using the symbol's address in the GOT as relocation value instead of the - symbols value itself. Also, create a GOT entry for the + symbol's value itself. Also, create a GOT entry for the symbol and put the symbol value there. */ + case R_PPC64_GOT_TLSGD16: + case R_PPC64_GOT_TLSGD16_LO: + case R_PPC64_GOT_TLSGD16_HI: + case R_PPC64_GOT_TLSGD16_HA: + tls_type = TLS_TLS | TLS_GD; + goto dogot; + + case R_PPC64_GOT_TLSLD16: + case R_PPC64_GOT_TLSLD16_LO: + case R_PPC64_GOT_TLSLD16_HI: + case R_PPC64_GOT_TLSLD16_HA: + tls_type = TLS_TLS | TLS_LD; + goto dogot; + + case R_PPC64_GOT_TPREL16_DS: + case R_PPC64_GOT_TPREL16_LO_DS: + case R_PPC64_GOT_TPREL16_HI: + case R_PPC64_GOT_TPREL16_HA: + tls_type = TLS_TLS | TLS_TPREL; + goto dogot; + + case R_PPC64_GOT_DTPREL16_DS: + case R_PPC64_GOT_DTPREL16_LO_DS: + case R_PPC64_GOT_DTPREL16_HI: + case R_PPC64_GOT_DTPREL16_HA: + tls_type = TLS_TLS | TLS_DTPREL; + goto dogot; + case R_PPC64_GOT16: case R_PPC64_GOT16_LO: case R_PPC64_GOT16_HI: case R_PPC64_GOT16_HA: case R_PPC64_GOT16_DS: case R_PPC64_GOT16_LO_DS: + dogot: { /* Relocation is to the entry for this symbol in the global offset table. */ + asection *got; + bfd_vma *offp; bfd_vma off; + unsigned long indx = 0; - if (htab->sgot == NULL) - abort (); - - if (h != NULL) + if (tls_type == (TLS_TLS | TLS_LD) + && (h == NULL + || !(h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC))) + offp = &ppc64_tlsld_got (input_bfd)->offset; + else { - boolean dyn; - - off = h->got.offset; - dyn = htab->elf.dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) - || (info->shared - && (info->symbolic - || h->dynindx == -1 - || (h->elf_link_hash_flags - & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR))) + struct got_entry *ent; + + if (h != NULL) { - /* This is actually a static link, or it is a - -Bsymbolic link and the symbol is defined - locally, or the symbol was forced to be local - because of a version file. We must initialize - this entry in the global offset table. Since the - offset must always be a multiple of 8, we use the - least significant bit to record whether we have - initialized it already. - - When doing a dynamic link, we create a .rel.got - relocation entry to initialize the value. This - is done in the finish_dynamic_symbol routine. */ - if ((off & 1) != 0) - off &= ~1; + bfd_boolean dyn = htab->elf.dynamic_sections_created; + if (!WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) + || (info->shared + && SYMBOL_REFERENCES_LOCAL (info, h))) + /* 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. */ + ; else { - bfd_put_64 (output_bfd, relocation, - htab->sgot->contents + off); - h->got.offset |= 1; + indx = h->dynindx; + unresolved_reloc = FALSE; } + ent = h->got.glist; } else - unresolved_reloc = false; + { + if (local_got_ents == NULL) + abort (); + ent = local_got_ents[r_symndx]; + } + + for (; ent != NULL; ent = ent->next) + if (ent->addend == rel->r_addend + && ent->owner == input_bfd + && ent->tls_type == tls_type) + break; + if (ent == NULL) + abort (); + offp = &ent->got.offset; } + + got = ppc64_elf_tdata (input_bfd)->got; + if (got == NULL) + abort (); + + /* The offset must always be a multiple of 8. We use the + least significant bit to record whether we have already + processed this entry. */ + off = *offp; + if ((off & 1) != 0) + off &= ~1; else { - if (local_got_offsets == NULL) - abort (); + /* Generate relocs for the dynamic linker, except in + the case of TLSLD where we'll use one entry per + module. */ + asection *relgot = ppc64_elf_tdata (input_bfd)->relgot; + + *offp = off | 1; + if ((info->shared || indx != 0) + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) + { + outrel.r_offset = (got->output_section->vma + + got->output_offset + + off); + outrel.r_addend = rel->r_addend; + if (tls_type & (TLS_LD | TLS_GD)) + { + outrel.r_addend = 0; + outrel.r_info = ELF64_R_INFO (indx, R_PPC64_DTPMOD64); + if (tls_type == (TLS_TLS | TLS_GD)) + { + loc = relgot->contents; + loc += (relgot->reloc_count++ + * sizeof (Elf64_External_Rela)); + bfd_elf64_swap_reloca_out (output_bfd, + &outrel, loc); + outrel.r_offset += 8; + outrel.r_addend = rel->r_addend; + outrel.r_info + = ELF64_R_INFO (indx, R_PPC64_DTPREL64); + } + } + else if (tls_type == (TLS_TLS | TLS_DTPREL)) + outrel.r_info = ELF64_R_INFO (indx, R_PPC64_DTPREL64); + else if (tls_type == (TLS_TLS | TLS_TPREL)) + outrel.r_info = ELF64_R_INFO (indx, R_PPC64_TPREL64); + else if (indx == 0) + { + outrel.r_info = ELF64_R_INFO (indx, R_PPC64_RELATIVE); + + /* Write the .got section contents for the sake + of prelink. */ + loc = got->contents + off; + bfd_put_64 (output_bfd, outrel.r_addend + relocation, + loc); + } + else + outrel.r_info = ELF64_R_INFO (indx, R_PPC64_GLOB_DAT); - off = local_got_offsets[r_symndx]; + if (indx == 0 && tls_type != (TLS_TLS | TLS_LD)) + { + outrel.r_addend += relocation; + if (tls_type & (TLS_GD | TLS_DTPREL | TLS_TPREL)) + outrel.r_addend -= htab->elf.tls_sec->vma; + } + loc = relgot->contents; + loc += (relgot->reloc_count++ + * sizeof (Elf64_External_Rela)); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + } - /* The offset must always be a multiple of 8. We use - the least significant bit to record whether we have - already processed this entry. */ - if ((off & 1) != 0) - off &= ~1; + /* Init the .got section contents here if we're not + emitting a reloc. */ else { - bfd_put_64 (output_bfd, relocation, - htab->sgot->contents + off); - - if (info->shared) + relocation += rel->r_addend; + if (tls_type == (TLS_TLS | TLS_LD)) + relocation = 1; + else if (tls_type != 0) { - Elf_Internal_Rela outrel; - Elf64_External_Rela *loc; - - /* We need to generate a R_PPC64_RELATIVE reloc - for the dynamic linker. */ - outrel.r_offset = (htab->sgot->output_section->vma - + htab->sgot->output_offset - + off); - outrel.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); - outrel.r_addend = relocation; - loc = (Elf64_External_Rela *) htab->srelgot->contents; - loc += htab->srelgot->reloc_count++; - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + relocation -= htab->elf.tls_sec->vma + DTP_OFFSET; + if (tls_type == (TLS_TLS | TLS_TPREL)) + relocation += DTP_OFFSET - TP_OFFSET; + + if (tls_type == (TLS_TLS | TLS_GD)) + { + bfd_put_64 (output_bfd, relocation, + got->contents + off + 8); + relocation = 1; + } } - local_got_offsets[r_symndx] |= 1; + bfd_put_64 (output_bfd, relocation, + got->contents + off); } } if (off >= (bfd_vma) -2) abort (); - relocation = htab->sgot->output_offset + off; + relocation = got->output_offset + off; /* TOC base (r2) is TOC start plus 0x8000. */ - addend -= TOC_BASE_OFF; + addend = -TOC_BASE_OFF; } break; @@ -5624,21 +8244,38 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (h == NULL) break; - if (h->plt.offset == (bfd_vma) -1 - || htab->splt == NULL) + /* It's possible that we didn't make a PLT entry for this + symbol. This happens when statically linking PIC code, + or when using -Bsymbolic. Go find a match if there is a + PLT entry. */ + if (htab->plt != NULL) { - /* We didn't make a PLT entry for this symbol. This - happens when statically linking PIC code, or when - using -Bsymbolic. */ - break; + struct plt_entry *ent; + for (ent = h->plt.plist; ent != NULL; ent = ent->next) + if (ent->addend == rel->r_addend + && ent->plt.offset != (bfd_vma) -1) + { + relocation = (htab->plt->output_section->vma + + htab->plt->output_offset + + ent->plt.offset); + unresolved_reloc = FALSE; + } } - - relocation = (htab->splt->output_section->vma - + htab->splt->output_offset - + h->plt.offset); - unresolved_reloc = false; break; + case R_PPC64_TOC: + /* Relocation value is TOC base. */ + relocation = TOCstart; + if (r_symndx == 0) + relocation += htab->stub_group[input_section->id].toc_off; + else if (unresolved_reloc) + ; + else if (sec != NULL && sec->id <= htab->top_id) + relocation += htab->stub_group[sec->id].toc_off; + else + unresolved_reloc = TRUE; + goto dodyn2; + /* TOC16 relocs. We want the offset relative to the TOC base, which is the address of the start of the TOC plus 0x8000. The TOC consists of sections .got, .toc, .tocbss, and .plt, @@ -5649,7 +8286,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_TOC16_DS: case R_PPC64_TOC16_LO_DS: case R_PPC64_TOC16_HA: - addend -= TOCstart + TOC_BASE_OFF; + addend -= TOCstart + htab->stub_group[input_section->id].toc_off; break; /* Relocate against the beginning of the section. */ @@ -5659,7 +8296,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_SECTOFF_DS: case R_PPC64_SECTOFF_LO_DS: case R_PPC64_SECTOFF_HA: - if (sec != (asection *) 0) + if (sec != NULL) addend -= sec->output_section->vma; break; @@ -5669,8 +8306,53 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_REL24: break; + case R_PPC64_TPREL16: + case R_PPC64_TPREL16_LO: + case R_PPC64_TPREL16_HI: + case R_PPC64_TPREL16_HA: + case R_PPC64_TPREL16_DS: + case R_PPC64_TPREL16_LO_DS: + case R_PPC64_TPREL16_HIGHER: + case R_PPC64_TPREL16_HIGHERA: + case R_PPC64_TPREL16_HIGHEST: + case R_PPC64_TPREL16_HIGHESTA: + addend -= htab->elf.tls_sec->vma + TP_OFFSET; + if (info->shared) + /* The TPREL16 relocs shouldn't really be used in shared + libs as they will result in DT_TEXTREL being set, but + support them anyway. */ + goto dodyn; + break; + + case R_PPC64_DTPREL16: + case R_PPC64_DTPREL16_LO: + case R_PPC64_DTPREL16_HI: + case R_PPC64_DTPREL16_HA: + case R_PPC64_DTPREL16_DS: + case R_PPC64_DTPREL16_LO_DS: + case R_PPC64_DTPREL16_HIGHER: + case R_PPC64_DTPREL16_HIGHERA: + case R_PPC64_DTPREL16_HIGHEST: + case R_PPC64_DTPREL16_HIGHESTA: + addend -= htab->elf.tls_sec->vma + DTP_OFFSET; + break; + + case R_PPC64_DTPMOD64: + relocation = 1; + addend = 0; + goto dodyn; + + case R_PPC64_TPREL64: + addend -= htab->elf.tls_sec->vma + TP_OFFSET; + goto dodyn; + + case R_PPC64_DTPREL64: + addend -= htab->elf.tls_sec->vma + DTP_OFFSET; + /* Fall thru */ + /* Relocations that may need to be propagated if this is a dynamic object. */ + case R_PPC64_REL30: case R_PPC64_REL32: case R_PPC64_REL64: case R_PPC64_ADDR14: @@ -5687,7 +8369,6 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_ADDR16_LO: case R_PPC64_ADDR16_LO_DS: case R_PPC64_ADDR24: - case R_PPC64_ADDR30: case R_PPC64_ADDR32: case R_PPC64_ADDR64: case R_PPC64_UADDR16: @@ -5696,11 +8377,12 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* r_symndx will be zero only for relocs against symbols from removed linkonce sections, or sections discarded by a linker script. */ + dodyn: if (r_symndx == 0) break; /* Fall thru. */ - case R_PPC64_TOC: + dodyn2: if ((input_section->flags & SEC_ALLOC) == 0) break; @@ -5708,56 +8390,59 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; if ((info->shared - && (IS_ABSOLUTE_RELOC (r_type) - || (h != NULL - && h->dynindx != -1 - && (! info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && (MUST_BE_DYN_RELOC (r_type) + || !SYMBOL_CALLS_LOCAL (info, h))) + || (ELIMINATE_COPY_RELOCS + && !info->shared && h != NULL && h->dynindx != -1 && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 - && (((h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_DYNAMIC) != 0 - && (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0) - || h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_undefined))) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) { Elf_Internal_Rela outrel; - boolean skip, relocate; + bfd_boolean skip, relocate; asection *sreloc; - Elf64_External_Rela *loc; + bfd_byte *loc; + bfd_vma out_off; /* When generating a dynamic object, these relocations are copied into the output file to be resolved at run time. */ - skip = false; - relocate = false; - - outrel.r_offset = - _bfd_elf_section_offset (output_bfd, info, input_section, - rel->r_offset); - if (outrel.r_offset == (bfd_vma) -1) - skip = true; - else if (outrel.r_offset == (bfd_vma) -2) - skip = true, relocate = true; - outrel.r_offset += (input_section->output_section->vma - + input_section->output_offset); - outrel.r_addend = addend; + skip = FALSE; + relocate = FALSE; + + out_off = _bfd_elf_section_offset (output_bfd, info, + input_section, rel->r_offset); + if (out_off == (bfd_vma) -1) + skip = TRUE; + else if (out_off == (bfd_vma) -2) + skip = TRUE, relocate = TRUE; + out_off += (input_section->output_section->vma + + input_section->output_offset); + outrel.r_offset = out_off; + outrel.r_addend = rel->r_addend; + + /* Optimize unaligned reloc use. */ + if ((r_type == R_PPC64_ADDR64 && (out_off & 7) != 0) + || (r_type == R_PPC64_UADDR64 && (out_off & 7) == 0)) + r_type ^= R_PPC64_ADDR64 ^ R_PPC64_UADDR64; + else if ((r_type == R_PPC64_ADDR32 && (out_off & 3) != 0) + || (r_type == R_PPC64_UADDR32 && (out_off & 3) == 0)) + r_type ^= R_PPC64_ADDR32 ^ R_PPC64_UADDR32; + else if ((r_type == R_PPC64_ADDR16 && (out_off & 1) != 0) + || (r_type == R_PPC64_UADDR16 && (out_off & 1) == 0)) + r_type ^= R_PPC64_ADDR16 ^ R_PPC64_UADDR16; if (skip) memset (&outrel, 0, sizeof outrel); - else if (h != NULL - && h->dynindx != -1 + else if (!SYMBOL_REFERENCES_LOCAL (info, h) && !is_opd - && (!IS_ABSOLUTE_RELOC (r_type) - || !info->shared - || !info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) + && r_type != R_PPC64_TOC) outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); else { @@ -5765,7 +8450,6 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, or this is an opd section reloc which must point at a local function. */ outrel.r_addend += relocation; - relocate = true; if (r_type == R_PPC64_ADDR64 || r_type == R_PPC64_TOC) { if (is_opd && h != NULL) @@ -5780,9 +8464,15 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, bug in binutils handling of weak syms.) In these cases we won't use the opd entry in this lib. */ - unresolved_reloc = false; + unresolved_reloc = FALSE; } outrel.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); + + /* We need to relocate .opd contents for ld.so. + Prelink also wants simple and consistent rules + for relocs. This make all RELATIVE relocs have + *r_offset equal to r_addend. */ + relocate = TRUE; } else { @@ -5793,7 +8483,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, else if (sec == NULL || sec->owner == NULL) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } else { @@ -5818,15 +8508,35 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (sreloc == NULL) abort (); - loc = (Elf64_External_Rela *) sreloc->contents; - loc += sreloc->reloc_count++; + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); /* If this reloc is against an external symbol, it will be computed at runtime, so there's no need to do - anything now. */ + anything now. However, for the sake of prelink ensure + that the section contents are a known value. */ if (! relocate) - continue; + { + unresolved_reloc = FALSE; + /* The value chosen here is quite arbitrary as ld.so + ignores section contents except for the special + case of .opd where the contents might be accessed + before relocation. Choose zero, as that won't + cause reloc overflow. */ + relocation = 0; + addend = 0; + /* Use *r_offset == r_addend for R_PPC64_ADDR64 relocs + to improve backward compatibility with older + versions of ld. */ + if (r_type == R_PPC64_ADDR64) + addend = outrel.r_addend; + /* Adjust pc_relative relocs to have zero in *r_offset. */ + else if (ppc64_elf_howto_table[r_type]->pc_relative) + addend = (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset); + } } break; @@ -5836,7 +8546,7 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_RELATIVE: /* We shouldn't ever see these dynamic relocs in relocatable files. */ - /* Fall thru */ + /* Fall through. */ case R_PPC64_PLTGOT16: case R_PPC64_PLTGOT16_DS: @@ -5849,12 +8559,12 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* These ones haven't been implemented yet. */ (*_bfd_error_handler) - (_("%s: Relocation %s is not supported for symbol %s."), + (_("%s: relocation %s is not supported for symbol %s."), bfd_archive_filename (input_bfd), - ppc64_elf_howto_table[(int) r_type]->name, sym_name); + ppc64_elf_howto_table[r_type]->name, sym_name); bfd_set_error (bfd_error_invalid_operation); - ret = false; + ret = FALSE; continue; } @@ -5867,16 +8577,33 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_ADDR16_HA: case R_PPC64_ADDR16_HIGHERA: case R_PPC64_ADDR16_HIGHESTA: + case R_PPC64_GOT16_HA: + case R_PPC64_PLTGOT16_HA: case R_PPC64_PLT16_HA: case R_PPC64_TOC16_HA: case R_PPC64_SECTOFF_HA: + case R_PPC64_TPREL16_HA: + case R_PPC64_DTPREL16_HA: + case R_PPC64_GOT_TLSGD16_HA: + case R_PPC64_GOT_TLSLD16_HA: + case R_PPC64_GOT_TPREL16_HA: + case R_PPC64_GOT_DTPREL16_HA: + case R_PPC64_TPREL16_HIGHER: + case R_PPC64_TPREL16_HIGHERA: + case R_PPC64_TPREL16_HIGHEST: + case R_PPC64_TPREL16_HIGHESTA: + case R_PPC64_DTPREL16_HIGHER: + case R_PPC64_DTPREL16_HIGHERA: + case R_PPC64_DTPREL16_HIGHEST: + case R_PPC64_DTPREL16_HIGHESTA: /* It's just possible that this symbol is a weak symbol that's not actually defined anywhere. In that case, 'sec' would be NULL, and we should leave the symbol alone (it will be set to zero elsewhere in the link). */ if (sec != NULL) - /* Add 0x10000 if sign bit in 0:15 is set. */ - addend += ((relocation + addend) & 0x8000) << 1; + /* Add 0x10000 if sign bit in 0:15 is set. + Bits 0:15 are not used. */ + addend += 0x8000; break; case R_PPC64_ADDR16_DS: @@ -5890,14 +8617,33 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_PPC64_TOC16_LO_DS: case R_PPC64_PLTGOT16_DS: case R_PPC64_PLTGOT16_LO_DS: - if (((relocation + addend) & 3) != 0) + case R_PPC64_GOT_TPREL16_DS: + case R_PPC64_GOT_TPREL16_LO_DS: + case R_PPC64_GOT_DTPREL16_DS: + case R_PPC64_GOT_DTPREL16_LO_DS: + case R_PPC64_TPREL16_DS: + case R_PPC64_TPREL16_LO_DS: + case R_PPC64_DTPREL16_DS: + case R_PPC64_DTPREL16_LO_DS: + insn = bfd_get_32 (input_bfd, contents + (rel->r_offset & ~3)); + mask = 3; + /* If this reloc is against an lq insn, then the value must be + a multiple of 16. This is somewhat of a hack, but the + "correct" way to do this by defining _DQ forms of all the + _DS relocs bloats all reloc switches in this file. It + doesn't seem to make much sense to use any of these relocs + in data, so testing the insn should be safe. */ + if ((insn & (0x3f << 26)) == (56u << 26)) + mask = 15; + if (((relocation + addend) & mask) != 0) { (*_bfd_error_handler) - (_("%s: error: relocation %s not a multiple of 4"), + (_("%s: error: relocation %s not a multiple of %d"), bfd_archive_filename (input_bfd), - ppc64_elf_howto_table[(int) r_type]->name); + ppc64_elf_howto_table[r_type]->name, + mask + 1); bfd_set_error (bfd_error_bad_value); - ret = false; + ret = FALSE; continue; } break; @@ -5912,12 +8658,18 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, max_br_offset = 1 << 25; branch_check: - /* If the branch is out of reach, then redirect the - call to the local stub for this function. */ - from = (offset + /* If the branch is out of reach or the TOC register needs + adjusting, then redirect the call to the local stub for + this function. */ + from = (rel->r_offset + input_section->output_offset + input_section->output_section->vma); - if (relocation + addend - from + max_br_offset >= 2 * max_br_offset + if ((relocation + addend - from + max_br_offset >= 2 * max_br_offset + || (sec != NULL + && sec->output_section != NULL + && sec->id <= htab->top_id + && (htab->stub_group[sec->id].toc_off + != htab->stub_group[input_section->id].toc_off))) && (stub_entry = ppc_get_stub_entry (input_section, sec, h, rel, htab)) != NULL) { @@ -5939,30 +8691,34 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) { (*_bfd_error_handler) - (_("%s(%s+0x%lx): unresolvable relocation against symbol `%s'"), + (_("%s(%s+0x%lx): unresolvable %s relocation against symbol `%s'"), bfd_archive_filename (input_bfd), bfd_get_section_name (input_bfd, input_section), (long) rel->r_offset, + ppc64_elf_howto_table[(int) r_type]->name, h->root.root.string); - ret = false; + ret = FALSE; } r = _bfd_final_link_relocate (ppc64_elf_howto_table[(int) r_type], input_bfd, input_section, contents, - offset, + rel->r_offset, relocation, addend); if (r != bfd_reloc_ok) { - const char *name; - - if (h != NULL) + if (sym_name == NULL) + sym_name = "(null)"; + if (r == bfd_reloc_overflow) { - if (h->root.type == bfd_link_hash_undefweak - && ppc64_elf_howto_table[(int) r_type]->pc_relative) + if (warned) + continue; + if (h != NULL + && h->root.type == bfd_link_hash_undefweak + && ppc64_elf_howto_table[r_type]->pc_relative) { /* Assume this is a call protected by other code that detects the symbol is undefined. If this is the case, @@ -5973,36 +8729,22 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, continue; } - name = h->root.root.string; - } - else - { - name = bfd_elf_string_from_elf_section (input_bfd, - symtab_hdr->sh_link, - sym->st_name); - if (name == NULL) - continue; - if (*name == '\0') - name = bfd_section_name (input_bfd, sec); - } - - if (r == bfd_reloc_overflow) - { - if (warned) - continue; if (!((*info->callbacks->reloc_overflow) - (info, name, ppc64_elf_howto_table[(int) r_type]->name, - rel->r_addend, input_bfd, input_section, offset))) - return false; + (info, sym_name, ppc64_elf_howto_table[r_type]->name, + rel->r_addend, input_bfd, input_section, rel->r_offset))) + return FALSE; } else { (*_bfd_error_handler) - (_("%s(%s+0x%lx): reloc against `%s': error %d"), + (_("%s(%s+0x%lx): %s reloc against `%s': error %d"), bfd_archive_filename (input_bfd), bfd_get_section_name (input_bfd, input_section), - (long) rel->r_offset, name, (int) r); - ret = false; + (long) rel->r_offset, + ppc64_elf_howto_table[r_type]->name, + sym_name, + (int) r); + ret = FALSE; } } } @@ -6010,15 +8752,40 @@ ppc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, return ret; } +/* Adjust the value of any local symbols in opd sections. */ + +static bfd_boolean +ppc64_elf_output_symbol_hook (struct bfd_link_info *info, + const char *name ATTRIBUTE_UNUSED, + Elf_Internal_Sym *elfsym, + asection *input_sec, + struct elf_link_hash_entry *h) +{ + long *adjust; + bfd_vma value; + + if (h != NULL + || input_sec == NULL + || ppc64_elf_section_data (input_sec) == NULL + || (adjust = ppc64_elf_section_data (input_sec)->opd.adjust) == NULL) + return TRUE; + + value = elfsym->st_value - input_sec->output_offset; + if (!info->relocatable) + value -= input_sec->output_section->vma; + + elfsym->st_value += adjust[value / 24]; + return TRUE; +} + /* Finish up dynamic symbol handling. We set the contents of various dynamic sections here. */ -static boolean -ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) - bfd *output_bfd; - struct bfd_link_info *info; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +static bfd_boolean +ppc64_elf_finish_dynamic_symbol (bfd *output_bfd, + struct bfd_link_info *info, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { struct ppc_link_hash_table *htab; bfd *dynobj; @@ -6026,91 +8793,49 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) htab = ppc_hash_table (info); dynobj = htab->elf.dynobj; - if (h->plt.offset != (bfd_vma) -1 - && ((struct ppc_link_hash_entry *) h)->is_func_descriptor) - { - Elf_Internal_Rela rela; - Elf64_External_Rela *loc; - - /* This symbol has an entry in the procedure linkage table. Set - it up. */ - - if (htab->splt == NULL - || htab->srelplt == NULL - || htab->sglink == NULL) - abort (); - - /* Create a JMP_SLOT reloc to inform the dynamic linker to - fill in the PLT entry. */ - - rela.r_offset = (htab->splt->output_section->vma - + htab->splt->output_offset - + h->plt.offset); - rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_JMP_SLOT); - rela.r_addend = 0; - - loc = (Elf64_External_Rela *) htab->srelplt->contents; - loc += (h->plt.offset - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE; - bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); - } - - if (h->got.offset != (bfd_vma) -1) + if (((struct ppc_link_hash_entry *) h)->is_func_descriptor) { + struct plt_entry *ent; Elf_Internal_Rela rela; - Elf64_External_Rela *loc; - - /* This symbol has an entry in the global offset table. Set it - up. */ + bfd_byte *loc; - if (htab->sgot == NULL || htab->srelgot == NULL) - abort (); + for (ent = h->plt.plist; ent != NULL; ent = ent->next) + if (ent->plt.offset != (bfd_vma) -1) + { + /* This symbol has an entry in the procedure linkage + table. Set it up. */ - rela.r_offset = (htab->sgot->output_section->vma - + htab->sgot->output_offset - + (h->got.offset &~ (bfd_vma) 1)); - - /* If this is a static link, or it is a -Bsymbolic link and the - symbol is defined locally or was forced to be local because - of a version file, we just want to emit a RELATIVE reloc. - The entry in the global offset table will already have been - initialized in the relocate_section function. */ - if (info->shared - && (info->symbolic - || h->dynindx == -1 - || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) - { - BFD_ASSERT((h->got.offset & 1) != 0); - rela.r_info = ELF64_R_INFO (0, R_PPC64_RELATIVE); - rela.r_addend = (h->root.u.def.value - + h->root.u.def.section->output_section->vma - + h->root.u.def.section->output_offset); - } - else - { - BFD_ASSERT ((h->got.offset & 1) == 0); - bfd_put_64 (output_bfd, (bfd_vma) 0, - htab->sgot->contents + h->got.offset); - rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_GLOB_DAT); - rela.r_addend = 0; - } + if (htab->plt == NULL + || htab->relplt == NULL + || htab->glink == NULL) + abort (); - loc = (Elf64_External_Rela *) htab->srelgot->contents; - loc += htab->srelgot->reloc_count++; - bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); + /* Create a JMP_SLOT reloc to inform the dynamic linker to + fill in the PLT entry. */ + rela.r_offset = (htab->plt->output_section->vma + + htab->plt->output_offset + + ent->plt.offset); + rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_JMP_SLOT); + rela.r_addend = ent->addend; + + loc = htab->relplt->contents; + loc += ((ent->plt.offset - PLT_INITIAL_ENTRY_SIZE) / PLT_ENTRY_SIZE + * sizeof (Elf64_External_Rela)); + bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); + } } if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) { Elf_Internal_Rela rela; - Elf64_External_Rela *loc; + bfd_byte *loc; /* This symbol needs a copy reloc. Set it up. */ if (h->dynindx == -1 || (h->root.type != bfd_link_hash_defined && h->root.type != bfd_link_hash_defweak) - || htab->srelbss == NULL) + || htab->relbss == NULL) abort (); rela.r_offset = (h->root.u.def.value @@ -6118,8 +8843,8 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) + h->root.u.def.section->output_offset); rela.r_info = ELF64_R_INFO (h->dynindx, R_PPC64_COPY); rela.r_addend = 0; - loc = (Elf64_External_Rela *) htab->srelbss->contents; - loc += htab->srelbss->reloc_count++; + loc = htab->relbss->contents; + loc += htab->relbss->reloc_count++ * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); } @@ -6127,19 +8852,18 @@ ppc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) if (strcmp (h->root.root.string, "_DYNAMIC") == 0) sym->st_shndx = SHN_ABS; - return true; + return TRUE; } /* Used to decide how to sort relocs in an optimal manner for the dynamic linker, before writing them out. */ static enum elf_reloc_type_class -ppc64_elf_reloc_type_class (rela) - const Elf_Internal_Rela *rela; +ppc64_elf_reloc_type_class (const Elf_Internal_Rela *rela) { - enum elf_ppc_reloc_type r_type; + enum elf_ppc64_reloc_type r_type; - r_type = (enum elf_ppc_reloc_type) ELF64_R_TYPE (rela->r_info); + r_type = ELF64_R_TYPE (rela->r_info); switch (r_type) { case R_PPC64_RELATIVE: @@ -6155,10 +8879,9 @@ ppc64_elf_reloc_type_class (rela) /* Finish up the dynamic sections. */ -static boolean -ppc64_elf_finish_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +static bfd_boolean +ppc64_elf_finish_dynamic_sections (bfd *output_bfd, + struct bfd_link_info *info) { struct ppc_link_hash_table *htab; bfd *dynobj; @@ -6172,7 +8895,7 @@ ppc64_elf_finish_dynamic_sections (output_bfd, info) { Elf64_External_Dyn *dyncon, *dynconend; - if (sdyn == NULL || htab->sgot == NULL) + if (sdyn == NULL || htab->got == NULL) abort (); dyncon = (Elf64_External_Dyn *) sdyn->contents; @@ -6190,41 +8913,62 @@ ppc64_elf_finish_dynamic_sections (output_bfd, info) continue; case DT_PPC64_GLINK: - dyn.d_un.d_ptr = (htab->sglink->output_section->vma - + htab->sglink->output_offset); + s = htab->glink; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + /* We stupidly defined DT_PPC64_GLINK to be the start + of glink rather than the first entry point, which is + what ld.so needs, and now have a bigger stub to + support automatic multiple TOCs. */ + dyn.d_un.d_ptr += GLINK_CALL_STUB_SIZE - 32; break; case DT_PPC64_OPD: s = bfd_get_section_by_name (output_bfd, ".opd"); - if (s != NULL) - dyn.d_un.d_ptr = s->vma; + if (s == NULL) + continue; + dyn.d_un.d_ptr = s->vma; break; case DT_PPC64_OPDSZ: s = bfd_get_section_by_name (output_bfd, ".opd"); - if (s != NULL) - dyn.d_un.d_val = s->_raw_size; + if (s == NULL) + continue; + dyn.d_un.d_val = s->_raw_size; break; case DT_PLTGOT: - dyn.d_un.d_ptr = (htab->splt->output_section->vma - + htab->splt->output_offset); + s = htab->plt; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; break; case DT_JMPREL: - dyn.d_un.d_ptr = (htab->srelplt->output_section->vma - + htab->srelplt->output_offset); + s = htab->relplt; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; break; case DT_PLTRELSZ: - dyn.d_un.d_val = htab->srelplt->_raw_size; + dyn.d_un.d_val = htab->relplt->_raw_size; break; case DT_RELASZ: /* Don't count procedure linkage table relocs in the overall reloc count. */ - if (htab->srelplt != NULL) - dyn.d_un.d_val -= htab->srelplt->_raw_size; + s = htab->relplt; + if (s == NULL) + continue; + dyn.d_un.d_val -= s->_raw_size; + break; + + case DT_RELA: + /* We may not be using the standard ELF linker script. + If .rela.plt is the first .rela section, we adjust + DT_RELA to not include it. */ + s = htab->relplt; + if (s == NULL) + continue; + if (dyn.d_un.d_ptr != s->output_section->vma + s->output_offset) + continue; + dyn.d_un.d_ptr += s->_raw_size; break; } @@ -6232,74 +8976,49 @@ ppc64_elf_finish_dynamic_sections (output_bfd, info) } } - if (htab->sgot != NULL && htab->sgot->_raw_size != 0) + if (htab->got != NULL && htab->got->_raw_size != 0) { /* Fill in the first entry in the global offset table. We use it to hold the link-time TOCbase. */ bfd_put_64 (output_bfd, elf_gp (output_bfd) + TOC_BASE_OFF, - htab->sgot->contents); + htab->got->contents); /* Set .got entry size. */ - elf_section_data (htab->sgot->output_section)->this_hdr.sh_entsize = 8; + elf_section_data (htab->got->output_section)->this_hdr.sh_entsize = 8; } - if (htab->splt != NULL && htab->splt->_raw_size != 0) + if (htab->plt != NULL && htab->plt->_raw_size != 0) { /* Set .plt entry size. */ - elf_section_data (htab->splt->output_section)->this_hdr.sh_entsize + elf_section_data (htab->plt->output_section)->this_hdr.sh_entsize = PLT_ENTRY_SIZE; } - return true; -} - -#define TARGET_LITTLE_SYM bfd_elf64_powerpcle_vec -#define TARGET_LITTLE_NAME "elf64-powerpcle" -#define TARGET_BIG_SYM bfd_elf64_powerpc_vec -#define TARGET_BIG_NAME "elf64-powerpc" -#define ELF_ARCH bfd_arch_powerpc -#define ELF_MACHINE_CODE EM_PPC64 -#define ELF_MAXPAGESIZE 0x10000 -#define elf_info_to_howto ppc64_elf_info_to_howto - -#ifdef EM_CYGNUS_POWERPC -#define ELF_MACHINE_ALT1 EM_CYGNUS_POWERPC -#endif - -#ifdef EM_PPC_OLD -#define ELF_MACHINE_ALT2 EM_PPC_OLD -#endif - -#define elf_backend_want_got_sym 0 -#define elf_backend_want_plt_sym 0 -#define elf_backend_plt_alignment 3 -#define elf_backend_plt_not_loaded 1 -#define elf_backend_got_symbol_offset 0 -#define elf_backend_got_header_size 8 -#define elf_backend_plt_header_size PLT_INITIAL_ENTRY_SIZE -#define elf_backend_can_gc_sections 1 -#define elf_backend_can_refcount 1 -#define elf_backend_rela_normal 1 - -#define bfd_elf64_bfd_reloc_type_lookup ppc64_elf_reloc_type_lookup -#define bfd_elf64_bfd_merge_private_bfd_data ppc64_elf_merge_private_bfd_data -#define bfd_elf64_bfd_link_hash_table_create ppc64_elf_link_hash_table_create -#define bfd_elf64_bfd_link_hash_table_free ppc64_elf_link_hash_table_free + /* We need to handle writing out multiple GOT sections ourselves, + since we didn't add them to DYNOBJ. */ + while ((dynobj = dynobj->link_next) != NULL) + { + asection *s; + s = ppc64_elf_tdata (dynobj)->got; + if (s != NULL + && s->_raw_size != 0 + && s->output_section != bfd_abs_section_ptr + && !bfd_set_section_contents (output_bfd, s->output_section, + s->contents, s->output_offset, + s->_raw_size)) + return FALSE; + s = ppc64_elf_tdata (dynobj)->relgot; + if (s != NULL + && s->_raw_size != 0 + && s->output_section != bfd_abs_section_ptr + && !bfd_set_section_contents (output_bfd, s->output_section, + s->contents, s->output_offset, + s->_raw_size)) + return FALSE; + } -#define elf_backend_object_p ppc64_elf_object_p -#define elf_backend_create_dynamic_sections ppc64_elf_create_dynamic_sections -#define elf_backend_copy_indirect_symbol ppc64_elf_copy_indirect_symbol -#define elf_backend_check_relocs ppc64_elf_check_relocs -#define elf_backend_gc_mark_hook ppc64_elf_gc_mark_hook -#define elf_backend_gc_sweep_hook ppc64_elf_gc_sweep_hook -#define elf_backend_adjust_dynamic_symbol ppc64_elf_adjust_dynamic_symbol -#define elf_backend_hide_symbol ppc64_elf_hide_symbol -#define elf_backend_always_size_sections ppc64_elf_func_desc_adjust -#define elf_backend_size_dynamic_sections ppc64_elf_size_dynamic_sections -#define elf_backend_relocate_section ppc64_elf_relocate_section -#define elf_backend_finish_dynamic_symbol ppc64_elf_finish_dynamic_symbol -#define elf_backend_reloc_type_class ppc64_elf_reloc_type_class -#define elf_backend_finish_dynamic_sections ppc64_elf_finish_dynamic_sections + return TRUE; +} #include "elf64-target.h" diff --git a/contrib/binutils/bfd/elf64-ppc.h b/contrib/binutils/bfd/elf64-ppc.h index cabc388..998e7e1 100644 --- a/contrib/binutils/bfd/elf64-ppc.h +++ b/contrib/binutils/bfd/elf64-ppc.h @@ -1,5 +1,5 @@ /* PowerPC64-specific support for 64-bit ELF. - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,16 +17,28 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -boolean ppc64_elf_mark_entry_syms - PARAMS ((struct bfd_link_info *)); +void ppc64_elf_init_stub_bfd + (bfd *, struct bfd_link_info *); +bfd_boolean ppc64_elf_mark_entry_syms + (struct bfd_link_info *); +bfd_boolean ppc64_elf_edit_opd + (bfd *, struct bfd_link_info *); +asection *ppc64_elf_tls_setup + (bfd *, struct bfd_link_info *); +bfd_boolean ppc64_elf_tls_optimize + (bfd *, struct bfd_link_info *); bfd_vma ppc64_elf_toc - PARAMS ((bfd *)); + (bfd *); int ppc64_elf_setup_section_lists - PARAMS ((bfd *, struct bfd_link_info *)); -void ppc64_elf_next_input_section - PARAMS ((struct bfd_link_info *, asection *)); -boolean ppc64_elf_size_stubs - PARAMS ((bfd *, bfd *, struct bfd_link_info *, bfd_signed_vma, - asection *(*) (const char *, asection *), void (*) (void))); -boolean ppc64_elf_build_stubs - PARAMS ((struct bfd_link_info *)); + (bfd *, struct bfd_link_info *); +void ppc64_elf_next_toc_section + (struct bfd_link_info *, asection *); +void ppc64_elf_reinit_toc + (bfd *, struct bfd_link_info *); +bfd_boolean ppc64_elf_next_input_section + (struct bfd_link_info *, asection *); +bfd_boolean ppc64_elf_size_stubs + (bfd *, struct bfd_link_info *, bfd_signed_vma, + asection *(*) (const char *, asection *), void (*) (void)); +bfd_boolean ppc64_elf_build_stubs + (bfd_boolean, struct bfd_link_info *, char **); diff --git a/contrib/binutils/bfd/elf64-s390.c b/contrib/binutils/bfd/elf64-s390.c index 5ad1ca7..63a261a 100644 --- a/contrib/binutils/bfd/elf64-s390.c +++ b/contrib/binutils/bfd/elf64-s390.c @@ -1,5 +1,5 @@ /* IBM S/390-specific support for 64-bit ELF - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of BFD, the Binary File Descriptor library. @@ -29,49 +29,65 @@ static reloc_howto_type *elf_s390_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static void elf_s390_info_to_howto PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); -static boolean elf_s390_is_local_label_name +static bfd_boolean elf_s390_is_local_label_name PARAMS ((bfd *, const char *)); static struct bfd_hash_entry *link_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); static struct bfd_link_hash_table *elf_s390_link_hash_table_create PARAMS ((bfd *)); -static boolean create_got_section +static bfd_boolean create_got_section PARAMS((bfd *, struct bfd_link_info *)); -static boolean elf_s390_create_dynamic_sections +static bfd_boolean elf_s390_create_dynamic_sections PARAMS((bfd *, struct bfd_link_info *)); static void elf_s390_copy_indirect_symbol - PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *, struct elf_link_hash_entry *)); -static boolean elf_s390_check_relocs +static bfd_boolean elf_s390_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); static asection *elf_s390_gc_mark_hook PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static boolean elf_s390_gc_sweep_hook +static bfd_boolean elf_s390_gc_sweep_hook PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); -static boolean elf_s390_adjust_dynamic_symbol +struct elf_s390_link_hash_entry; +static void elf_s390_adjust_gotplt + PARAMS ((struct elf_s390_link_hash_entry *)); +static bfd_boolean elf_s390_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); -static boolean allocate_dynrelocs +static bfd_boolean allocate_dynrelocs PARAMS ((struct elf_link_hash_entry *, PTR)); -static boolean readonly_dynrelocs +static bfd_boolean readonly_dynrelocs PARAMS ((struct elf_link_hash_entry *, PTR)); -static boolean elf_s390_size_dynamic_sections +static bfd_boolean elf_s390_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static boolean elf_s390_relocate_section +static bfd_boolean elf_s390_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static boolean elf_s390_finish_dynamic_symbol +static bfd_boolean elf_s390_finish_dynamic_symbol PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); static enum elf_reloc_type_class elf_s390_reloc_type_class PARAMS ((const Elf_Internal_Rela *)); -static boolean elf_s390_finish_dynamic_sections +static bfd_boolean elf_s390_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static boolean elf_s390_object_p PARAMS ((bfd *)); - -#define USE_RELA 1 /* We want RELA relocations, not REL. */ +static bfd_boolean elf_s390_mkobject + PARAMS ((bfd *)); +static bfd_boolean elf_s390_object_p + PARAMS ((bfd *)); +static int elf_s390_tls_transition + PARAMS ((struct bfd_link_info *, int, int)); +static bfd_reloc_status_type s390_tls_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); +static bfd_vma dtpoff_base + PARAMS ((struct bfd_link_info *)); +static bfd_vma tpoff + PARAMS ((struct bfd_link_info *, bfd_vma)); +static void invalid_tls_insn + PARAMS ((bfd *, asection *, Elf_Internal_Rela *)); +static bfd_reloc_status_type s390_elf_ldisp_reloc + PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); #include "elf/s390.h" @@ -86,49 +102,137 @@ static reloc_howto_type elf_howto_table[] = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_390_NONE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ - - HOWTO(R_390_8, 0, 0, 8, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_8", false, 0,0x000000ff, false), - HOWTO(R_390_12, 0, 1, 12, false, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_390_12", false, 0,0x00000fff, false), - HOWTO(R_390_16, 0, 1, 16, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_16", false, 0,0x0000ffff, false), - HOWTO(R_390_32, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_32", false, 0,0xffffffff, false), - HOWTO(R_390_PC32, 0, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC32", false, 0,0xffffffff, true), - HOWTO(R_390_GOT12, 0, 1, 12, false, 0, complain_overflow_dont, bfd_elf_generic_reloc, "R_390_GOT12", false, 0,0x00000fff, false), - HOWTO(R_390_GOT32, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOT32", false, 0,0xffffffff, false), - HOWTO(R_390_PLT32, 0, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT32", false, 0,0xffffffff, true), - HOWTO(R_390_COPY, 0, 4, 64, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_COPY", false, 0,MINUS_ONE, false), - HOWTO(R_390_GLOB_DAT, 0, 4, 64, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GLOB_DAT",false, 0,MINUS_ONE, false), - HOWTO(R_390_JMP_SLOT, 0, 4, 64, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_JMP_SLOT",false, 0,MINUS_ONE, false), - HOWTO(R_390_RELATIVE, 0, 4, 64, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_RELATIVE",false, 0,MINUS_ONE, false), - HOWTO(R_390_GOTOFF, 0, 4, 64, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTOFF", false, 0,MINUS_ONE, false), - HOWTO(R_390_GOTPC, 0, 4, 64, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTPC", false, 0,MINUS_ONE, true), - HOWTO(R_390_GOT16, 0, 1, 16, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOT16", false, 0,0x0000ffff, false), - HOWTO(R_390_PC16, 0, 1, 16, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC16", false, 0,0x0000ffff, true), - HOWTO(R_390_PC16DBL, 1, 1, 16, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC16DBL", false, 0,0x0000ffff, true), - HOWTO(R_390_PLT16DBL, 1, 1, 16, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT16DBL", false, 0,0x0000ffff, true), - HOWTO(R_390_PC32DBL, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC32DBL", false, 0,0xffffffff, true), - HOWTO(R_390_PLT32DBL, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT32DBL", false, 0,0xffffffff, true), - HOWTO(R_390_GOTPCDBL, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTPCDBL", false, 0,MINUS_ONE, true), - HOWTO(R_390_64, 0, 4, 64, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_64", false, 0,MINUS_ONE, false), - HOWTO(R_390_PC64, 0, 4, 64, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PC64", false, 0,MINUS_ONE, true), - HOWTO(R_390_GOT64, 0, 4, 64, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOT64", false, 0,MINUS_ONE, false), - HOWTO(R_390_PLT64, 0, 4, 64, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_PLT64", false, 0,MINUS_ONE, true), - HOWTO(R_390_GOTENT, 1, 2, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_390_GOTENT", false, 0,MINUS_ONE, true), + FALSE), /* pcrel_offset */ + + HOWTO(R_390_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_8", FALSE, 0,0x000000ff, FALSE), + HOWTO(R_390_12, 0, 1, 12, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_390_12", FALSE, 0,0x00000fff, FALSE), + HOWTO(R_390_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_32", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_PC32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC32", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_GOT12, 0, 1, 12, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOT12", FALSE, 0,0x00000fff, FALSE), + HOWTO(R_390_GOT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOT32", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_PLT32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLT32", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_COPY, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_COPY", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_GLOB_DAT, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GLOB_DAT", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_JMP_SLOT, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_JMP_SLOT", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_RELATIVE, 0, 4, 64, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_RELATIVE", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_GOTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTOFF32", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_GOTPC, 0, 4, 64, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPC", FALSE, 0,MINUS_ONE, TRUE), + HOWTO(R_390_GOT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOT16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_PC16, 0, 1, 16, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC16", FALSE, 0,0x0000ffff, TRUE), + HOWTO(R_390_PC16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC16DBL", FALSE, 0,0x0000ffff, TRUE), + HOWTO(R_390_PLT16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLT16DBL", FALSE, 0,0x0000ffff, TRUE), + HOWTO(R_390_PC32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC32DBL", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_PLT32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLT32DBL", FALSE, 0,0xffffffff, TRUE), + HOWTO(R_390_GOTPCDBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPCDBL", FALSE, 0,MINUS_ONE, TRUE), + HOWTO(R_390_64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_64", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_PC64, 0, 4, 64, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PC64", FALSE, 0,MINUS_ONE, TRUE), + HOWTO(R_390_GOT64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOT64", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_PLT64, 0, 4, 64, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLT64", FALSE, 0,MINUS_ONE, TRUE), + HOWTO(R_390_GOTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTENT", FALSE, 0,MINUS_ONE, TRUE), + HOWTO(R_390_GOTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTOFF16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_GOTOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTOFF64", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_GOTPLT12, 0, 1, 12, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_390_GOTPLT12", FALSE, 0,0x00000fff, FALSE), + HOWTO(R_390_GOTPLT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPLT16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_GOTPLT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPLT32", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_GOTPLT64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPLT64", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_GOTPLTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_GOTPLTENT",FALSE, 0,MINUS_ONE, TRUE), + HOWTO(R_390_PLTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLTOFF16", FALSE, 0,0x0000ffff, FALSE), + HOWTO(R_390_PLTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLTOFF32", FALSE, 0,0xffffffff, FALSE), + HOWTO(R_390_PLTOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_PLTOFF64", FALSE, 0,MINUS_ONE, FALSE), + HOWTO(R_390_TLS_LOAD, 0, 0, 0, FALSE, 0, complain_overflow_dont, + s390_tls_reloc, "R_390_TLS_LOAD", FALSE, 0, 0, FALSE), + HOWTO(R_390_TLS_GDCALL, 0, 0, 0, FALSE, 0, complain_overflow_dont, + s390_tls_reloc, "R_390_TLS_GDCALL", FALSE, 0, 0, FALSE), + HOWTO(R_390_TLS_LDCALL, 0, 0, 0, FALSE, 0, complain_overflow_dont, + s390_tls_reloc, "R_390_TLS_LDCALL", FALSE, 0, 0, FALSE), + EMPTY_HOWTO (R_390_TLS_GD32), /* Empty entry for R_390_TLS_GD32. */ + HOWTO(R_390_TLS_GD64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_GD64", FALSE, 0, MINUS_ONE, FALSE), + HOWTO(R_390_TLS_GOTIE12, 0, 1, 12, FALSE, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_390_TLS_GOTIE12", FALSE, 0, 0x00000fff, FALSE), + EMPTY_HOWTO (R_390_TLS_GOTIE32), /* Empty entry for R_390_TLS_GOTIE32. */ + HOWTO(R_390_TLS_GOTIE64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_GOTIE64", FALSE, 0, MINUS_ONE, FALSE), + EMPTY_HOWTO (R_390_TLS_LDM32), /* Empty entry for R_390_TLS_LDM32. */ + HOWTO(R_390_TLS_LDM64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_LDM64", FALSE, 0, MINUS_ONE, FALSE), + EMPTY_HOWTO (R_390_TLS_IE32), /* Empty entry for R_390_TLS_IE32. */ + HOWTO(R_390_TLS_IE64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_IE64", FALSE, 0, MINUS_ONE, FALSE), + HOWTO(R_390_TLS_IEENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_IEENT", FALSE, 0, MINUS_ONE, TRUE), + EMPTY_HOWTO (R_390_TLS_LE32), /* Empty entry for R_390_TLS_LE32. */ + HOWTO(R_390_TLS_LE64, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_LE64", FALSE, 0, MINUS_ONE, FALSE), + EMPTY_HOWTO (R_390_TLS_LDO32), /* Empty entry for R_390_TLS_LDO32. */ + HOWTO(R_390_TLS_LDO64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_LDO64", FALSE, 0, MINUS_ONE, FALSE), + HOWTO(R_390_TLS_DTPMOD, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_DTPMOD", FALSE, 0, MINUS_ONE, FALSE), + HOWTO(R_390_TLS_DTPOFF, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_DTPOFF", FALSE, 0, MINUS_ONE, FALSE), + HOWTO(R_390_TLS_TPOFF, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_390_TLS_TPOFF", FALSE, 0, MINUS_ONE, FALSE), + HOWTO(R_390_20, 0, 2, 20, FALSE, 8, complain_overflow_dont, + s390_elf_ldisp_reloc, "R_390_20", FALSE, 0,0x0fffff00, FALSE), + HOWTO(R_390_GOT20, 0, 2, 20, FALSE, 8, complain_overflow_dont, + s390_elf_ldisp_reloc, "R_390_GOT20", FALSE, 0,0x0fffff00, FALSE), + HOWTO(R_390_GOTPLT20, 0, 2, 20, FALSE, 8, complain_overflow_dont, + s390_elf_ldisp_reloc, "R_390_GOTPLT20", FALSE, 0,0x0fffff00, FALSE), + HOWTO(R_390_TLS_GOTIE20, 0, 2, 20, FALSE, 8, complain_overflow_dont, + s390_elf_ldisp_reloc, "R_390_TLS_GOTIE20", FALSE, 0,0x0fffff00, FALSE), }; /* GNU extension to record C++ vtable hierarchy. */ static reloc_howto_type elf64_s390_vtinherit_howto = - HOWTO (R_390_GNU_VTINHERIT, 0,4,0,false,0,complain_overflow_dont, NULL, "R_390_GNU_VTINHERIT", false,0, 0, false); + HOWTO (R_390_GNU_VTINHERIT, 0,4,0,FALSE,0,complain_overflow_dont, NULL, "R_390_GNU_VTINHERIT", FALSE,0, 0, FALSE); static reloc_howto_type elf64_s390_vtentry_howto = - HOWTO (R_390_GNU_VTENTRY, 0,4,0,false,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_390_GNU_VTENTRY", false,0,0, false); + HOWTO (R_390_GNU_VTENTRY, 0,4,0,FALSE,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_390_GNU_VTENTRY", FALSE,0,0, FALSE); static reloc_howto_type * elf_s390_reloc_type_lookup (abfd, code) @@ -166,7 +270,7 @@ elf_s390_reloc_type_lookup (abfd, code) case BFD_RELOC_390_RELATIVE: return &elf_howto_table[(int) R_390_RELATIVE]; case BFD_RELOC_32_GOTOFF: - return &elf_howto_table[(int) R_390_GOTOFF]; + return &elf_howto_table[(int) R_390_GOTOFF32]; case BFD_RELOC_390_GOTPC: return &elf_howto_table[(int) R_390_GOTPC]; case BFD_RELOC_390_GOT16: @@ -177,10 +281,6 @@ elf_s390_reloc_type_lookup (abfd, code) return &elf_howto_table[(int) R_390_PC16DBL]; case BFD_RELOC_390_PLT16DBL: return &elf_howto_table[(int) R_390_PLT16DBL]; - case BFD_RELOC_VTABLE_INHERIT: - return &elf64_s390_vtinherit_howto; - case BFD_RELOC_VTABLE_ENTRY: - return &elf64_s390_vtentry_howto; case BFD_RELOC_390_PC32DBL: return &elf_howto_table[(int) R_390_PC32DBL]; case BFD_RELOC_390_PLT32DBL: @@ -197,6 +297,66 @@ elf_s390_reloc_type_lookup (abfd, code) return &elf_howto_table[(int) R_390_PLT64]; case BFD_RELOC_390_GOTENT: return &elf_howto_table[(int) R_390_GOTENT]; + case BFD_RELOC_16_GOTOFF: + return &elf_howto_table[(int) R_390_GOTOFF16]; + case BFD_RELOC_390_GOTOFF64: + return &elf_howto_table[(int) R_390_GOTOFF64]; + case BFD_RELOC_390_GOTPLT12: + return &elf_howto_table[(int) R_390_GOTPLT12]; + case BFD_RELOC_390_GOTPLT16: + return &elf_howto_table[(int) R_390_GOTPLT16]; + case BFD_RELOC_390_GOTPLT32: + return &elf_howto_table[(int) R_390_GOTPLT32]; + case BFD_RELOC_390_GOTPLT64: + return &elf_howto_table[(int) R_390_GOTPLT64]; + case BFD_RELOC_390_GOTPLTENT: + return &elf_howto_table[(int) R_390_GOTPLTENT]; + case BFD_RELOC_390_PLTOFF16: + return &elf_howto_table[(int) R_390_PLTOFF16]; + case BFD_RELOC_390_PLTOFF32: + return &elf_howto_table[(int) R_390_PLTOFF32]; + case BFD_RELOC_390_PLTOFF64: + return &elf_howto_table[(int) R_390_PLTOFF64]; + case BFD_RELOC_390_TLS_LOAD: + return &elf_howto_table[(int) R_390_TLS_LOAD]; + case BFD_RELOC_390_TLS_GDCALL: + return &elf_howto_table[(int) R_390_TLS_GDCALL]; + case BFD_RELOC_390_TLS_LDCALL: + return &elf_howto_table[(int) R_390_TLS_LDCALL]; + case BFD_RELOC_390_TLS_GD64: + return &elf_howto_table[(int) R_390_TLS_GD64]; + case BFD_RELOC_390_TLS_GOTIE12: + return &elf_howto_table[(int) R_390_TLS_GOTIE12]; + case BFD_RELOC_390_TLS_GOTIE64: + return &elf_howto_table[(int) R_390_TLS_GOTIE64]; + case BFD_RELOC_390_TLS_LDM64: + return &elf_howto_table[(int) R_390_TLS_LDM64]; + case BFD_RELOC_390_TLS_IE64: + return &elf_howto_table[(int) R_390_TLS_IE64]; + case BFD_RELOC_390_TLS_IEENT: + return &elf_howto_table[(int) R_390_TLS_IEENT]; + case BFD_RELOC_390_TLS_LE64: + return &elf_howto_table[(int) R_390_TLS_LE64]; + case BFD_RELOC_390_TLS_LDO64: + return &elf_howto_table[(int) R_390_TLS_LDO64]; + case BFD_RELOC_390_TLS_DTPMOD: + return &elf_howto_table[(int) R_390_TLS_DTPMOD]; + case BFD_RELOC_390_TLS_DTPOFF: + return &elf_howto_table[(int) R_390_TLS_DTPOFF]; + case BFD_RELOC_390_TLS_TPOFF: + return &elf_howto_table[(int) R_390_TLS_TPOFF]; + case BFD_RELOC_390_20: + return &elf_howto_table[(int) R_390_20]; + case BFD_RELOC_390_GOT20: + return &elf_howto_table[(int) R_390_GOT20]; + case BFD_RELOC_390_GOTPLT20: + return &elf_howto_table[(int) R_390_GOTPLT20]; + case BFD_RELOC_390_TLS_GOTIE20: + return &elf_howto_table[(int) R_390_TLS_GOTIE20]; + case BFD_RELOC_VTABLE_INHERIT: + return &elf64_s390_vtinherit_howto; + case BFD_RELOC_VTABLE_ENTRY: + return &elf64_s390_vtentry_howto; default: break; } @@ -228,13 +388,82 @@ elf_s390_info_to_howto (abfd, cache_ptr, dst) } } -static boolean +/* A relocation function which doesn't do anything. */ +static bfd_reloc_status_type +s390_tls_reloc (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) + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; +} + +/* Handle the large displacement relocs. */ +static bfd_reloc_status_type +s390_elf_ldisp_reloc (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd; + arelent *reloc_entry; + asymbol *symbol; + PTR data; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + reloc_howto_type *howto = reloc_entry->howto; + bfd_vma relocation; + bfd_vma insn; + + if (output_bfd != (bfd *) NULL + && (symbol->flags & BSF_SECTION_SYM) == 0 + && (! howto->partial_inplace + || reloc_entry->addend == 0)) + { + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + if (output_bfd != NULL) + return bfd_reloc_continue; + + if (reloc_entry->address > input_section->_cooked_size) + return bfd_reloc_outofrange; + + relocation = (symbol->value + + symbol->section->output_section->vma + + symbol->section->output_offset); + relocation += reloc_entry->addend; + if (howto->pc_relative) + { + relocation -= (input_section->output_section->vma + + input_section->output_offset); + relocation -= reloc_entry->address; + } + + insn = bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); + insn |= (relocation & 0xfff) << 16 | (relocation & 0xff000) >> 4; + bfd_put_32 (abfd, insn, (bfd_byte *) data + reloc_entry->address); + + if ((bfd_signed_vma) relocation < - 0x80000 + || (bfd_signed_vma) relocation > 0x7ffff) + return bfd_reloc_overflow; + else + return bfd_reloc_ok; +} + +static bfd_boolean elf_s390_is_local_label_name (abfd, name) bfd *abfd; const char *name; { if (name[0] == '.' && (name[1] == 'X' || name[1] == 'L')) - return true; + return TRUE; return _bfd_elf_is_local_label_name (abfd, name); } @@ -246,6 +475,12 @@ elf_s390_is_local_label_name (abfd, name) #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" +/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid + copying dynamic variables from a shared lib into an app's dynbss + section, and instead use a dynamic relocation to point into the + shared lib. */ +#define ELIMINATE_COPY_RELOCS 1 + /* The size in bytes of the first entry in the procedure linkage table. */ #define PLT_FIRST_ENTRY_SIZE 32 /* The size in bytes of an entry in the procedure linkage table. */ @@ -359,8 +594,54 @@ struct elf_s390_link_hash_entry /* Track dynamic relocs copied for this symbol. */ struct elf_s390_dyn_relocs *dyn_relocs; + + /* Number of GOTPLT references for a function. */ + bfd_signed_vma gotplt_refcount; + +#define GOT_UNKNOWN 0 +#define GOT_NORMAL 1 +#define GOT_TLS_GD 2 +#define GOT_TLS_IE 3 +#define GOT_TLS_IE_NLT 3 + unsigned char tls_type; }; +#define elf_s390_hash_entry(ent) \ + ((struct elf_s390_link_hash_entry *)(ent)) + +struct elf_s390_obj_tdata +{ + struct elf_obj_tdata root; + + /* tls_type for each local got entry. */ + char *local_got_tls_type; +}; + +#define elf_s390_tdata(abfd) \ + ((struct elf_s390_obj_tdata *) (abfd)->tdata.any) + +#define elf_s390_local_got_tls_type(abfd) \ + (elf_s390_tdata (abfd)->local_got_tls_type) + +static bfd_boolean +elf_s390_mkobject (abfd) + bfd *abfd; +{ + bfd_size_type amt = sizeof (struct elf_s390_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + return TRUE; +} + +static bfd_boolean +elf_s390_object_p (abfd) + bfd *abfd; +{ + /* Set the right machine number for an s390 elf32 file. */ + return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_64); +} + /* s390 ELF linker hash table. */ struct elf_s390_link_hash_table @@ -376,6 +657,11 @@ struct elf_s390_link_hash_table asection *sdynbss; asection *srelbss; + union { + bfd_signed_vma refcount; + bfd_vma offset; + } tls_ldm_got; + /* Small local sym to section mapping cache. */ struct sym_sec_cache sym_sec; }; @@ -411,6 +697,8 @@ link_hash_newfunc (entry, table, string) eh = (struct elf_s390_link_hash_entry *) entry; eh->dyn_relocs = NULL; + eh->gotplt_refcount = 0; + eh->tls_type = GOT_UNKNOWN; } return entry; @@ -442,6 +730,7 @@ elf_s390_link_hash_table_create (abfd) ret->srelplt = NULL; ret->sdynbss = NULL; ret->srelbss = NULL; + ret->tls_ldm_got.refcount = 0; ret->sym_sec.abfd = NULL; return &ret->elf.root; @@ -450,7 +739,7 @@ elf_s390_link_hash_table_create (abfd) /* Create .got, .gotplt, and .rela.got sections in DYNOBJ, and set up shortcuts to them in our hash table. */ -static boolean +static bfd_boolean create_got_section (dynobj, info) bfd *dynobj; struct bfd_link_info *info; @@ -458,7 +747,7 @@ create_got_section (dynobj, info) struct elf_s390_link_hash_table *htab; if (! _bfd_elf_create_got_section (dynobj, info)) - return false; + return FALSE; htab = elf_s390_hash_table (info); htab->sgot = bfd_get_section_by_name (dynobj, ".got"); @@ -473,15 +762,15 @@ create_got_section (dynobj, info) | SEC_IN_MEMORY | SEC_LINKER_CREATED | SEC_READONLY)) || ! bfd_set_section_alignment (dynobj, htab->srelgot, 3)) - return false; - return true; + return FALSE; + return TRUE; } /* Create .plt, .rela.plt, .got, .got.plt, .rela.got, .dynbss, and .rela.bss sections in DYNOBJ, and set up shortcuts to them in our hash table. */ -static boolean +static bfd_boolean elf_s390_create_dynamic_sections (dynobj, info) bfd *dynobj; struct bfd_link_info *info; @@ -490,10 +779,10 @@ elf_s390_create_dynamic_sections (dynobj, info) htab = elf_s390_hash_table (info); if (!htab->sgot && !create_got_section (dynobj, info)) - return false; + return FALSE; if (!_bfd_elf_create_dynamic_sections (dynobj, info)) - return false; + return FALSE; htab->splt = bfd_get_section_by_name (dynobj, ".plt"); htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); @@ -505,14 +794,14 @@ elf_s390_create_dynamic_sections (dynobj, info) || (!info->shared && !htab->srelbss)) abort (); - return true; + return TRUE; } /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void elf_s390_copy_indirect_symbol (bed, dir, ind) - struct elf_backend_data *bed; + const struct elf_backend_data *bed; struct elf_link_hash_entry *dir, *ind; { struct elf_s390_link_hash_entry *edir, *eind; @@ -554,14 +843,60 @@ elf_s390_copy_indirect_symbol (bed, dir, ind) eind->dyn_relocs = NULL; } - _bfd_elf_link_hash_copy_indirect (bed, dir, ind); + if (ind->root.type == bfd_link_hash_indirect + && dir->got.refcount <= 0) + { + edir->tls_type = eind->tls_type; + eind->tls_type = GOT_UNKNOWN; + } + + if (ELIMINATE_COPY_RELOCS + && ind->root.type != bfd_link_hash_indirect + && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) + /* If called to transfer flags for a weakdef during processing + of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF. + We clear it ourselves for ELIMINATE_COPY_RELOCS. */ + dir->elf_link_hash_flags |= + (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK + | ELF_LINK_HASH_NEEDS_PLT)); + else + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); +} + +static int +elf_s390_tls_transition (info, r_type, is_local) + struct bfd_link_info *info; + int r_type; + int is_local; +{ + if (info->shared) + return r_type; + + switch (r_type) + { + case R_390_TLS_GD64: + case R_390_TLS_IE64: + if (is_local) + return R_390_TLS_LE64; + return R_390_TLS_IE64; + case R_390_TLS_GOTIE64: + if (is_local) + return R_390_TLS_LE64; + return R_390_TLS_GOTIE64; + case R_390_TLS_LDM64: + return R_390_TLS_LE64; + } + + return r_type; } /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage table. */ -static boolean +static bfd_boolean elf_s390_check_relocs (abfd, info, sec, relocs) bfd *abfd; struct bfd_link_info *info; @@ -574,19 +909,23 @@ elf_s390_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; asection *sreloc; + bfd_signed_vma *local_got_refcounts; + int tls_type, old_tls_type; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; htab = elf_s390_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); sreloc = NULL; rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { + unsigned int r_type; unsigned long r_symndx; struct elf_link_hash_entry *h; @@ -597,7 +936,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) (*_bfd_error_handler) (_("%s: bad symbol index: %d"), bfd_archive_filename (abfd), r_symndx); - return false; + return FALSE; } if (r_symndx < symtab_hdr->sh_info) @@ -605,41 +944,51 @@ elf_s390_check_relocs (abfd, info, sec, relocs) else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - switch (ELF64_R_TYPE (rel->r_info)) + /* Create got section and local_got_refcounts array if they + are needed. */ + r_type = elf_s390_tls_transition (info, + ELF64_R_TYPE (rel->r_info), + h == NULL); + switch (r_type) { case R_390_GOT12: - case R_390_GOT16: + case R_390_GOT16: + case R_390_GOT20: case R_390_GOT32: case R_390_GOT64: case R_390_GOTENT: - /* This symbol requires a global offset table entry. */ - if (h != NULL) - { - h->got.refcount += 1; - } - else + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT20: + case R_390_GOTPLT32: + case R_390_GOTPLT64: + case R_390_GOTPLTENT: + case R_390_TLS_GD64: + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE20: + case R_390_TLS_GOTIE64: + case R_390_TLS_IEENT: + case R_390_TLS_IE64: + case R_390_TLS_LDM64: + if (h == NULL + && local_got_refcounts == NULL) { - bfd_signed_vma *local_got_refcounts; + bfd_size_type size; - /* This is a global offset table entry for a local symbol. */ - local_got_refcounts = elf_local_got_refcounts (abfd); + size = symtab_hdr->sh_info; + size *= (sizeof (bfd_signed_vma) + sizeof(char)); + local_got_refcounts = ((bfd_signed_vma *) + bfd_zalloc (abfd, size)); if (local_got_refcounts == NULL) - { - bfd_size_type size; - - size = symtab_hdr->sh_info; - size *= sizeof (bfd_signed_vma); - local_got_refcounts = ((bfd_signed_vma *) - bfd_zalloc (abfd, size)); - if (local_got_refcounts == NULL) - return false; - elf_local_got_refcounts (abfd) = local_got_refcounts; - } - local_got_refcounts[r_symndx] += 1; + return FALSE; + elf_local_got_refcounts (abfd) = local_got_refcounts; + elf_s390_local_got_tls_type (abfd) + = (char *) (local_got_refcounts + symtab_hdr->sh_info); } - /* Fall through */ - - case R_390_GOTOFF: + /* Fall through. */ + case R_390_GOTOFF16: + case R_390_GOTOFF32: + case R_390_GOTOFF64: case R_390_GOTPC: case R_390_GOTPCDBL: if (htab->sgot == NULL) @@ -647,36 +996,161 @@ elf_s390_check_relocs (abfd, info, sec, relocs) if (htab->elf.dynobj == NULL) htab->elf.dynobj = abfd; if (!create_got_section (htab->elf.dynobj, info)) - return false; + return FALSE; } + } + + switch (r_type) + { + case R_390_GOTOFF16: + case R_390_GOTOFF32: + case R_390_GOTOFF64: + case R_390_GOTPC: + case R_390_GOTPCDBL: + /* Got is created, nothing to be done. */ break; - case R_390_PLT16DBL: + case R_390_PLT16DBL: case R_390_PLT32: case R_390_PLT32DBL: case R_390_PLT64: + case R_390_PLTOFF16: + case R_390_PLTOFF32: + case R_390_PLTOFF64: /* This symbol requires a procedure linkage table entry. We - actually build the entry in adjust_dynamic_symbol, - because this might be a case of linking PIC code which is - never referenced by a dynamic object, in which case we - don't need to generate a procedure linkage table entry - after all. */ + actually build the entry in adjust_dynamic_symbol, + because this might be a case of linking PIC code which is + never referenced by a dynamic object, in which case we + don't need to generate a procedure linkage table entry + after all. */ /* If this is a local symbol, we resolve it directly without - creating a procedure linkage table entry. */ - if (h == NULL) - continue; + creating a procedure linkage table entry. */ + if (h != NULL) + { + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.refcount += 1; + } + break; - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - h->plt.refcount += 1; + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT20: + case R_390_GOTPLT32: + case R_390_GOTPLT64: + case R_390_GOTPLTENT: + /* This symbol requires either a procedure linkage table entry + or an entry in the local got. We actually build the entry + in adjust_dynamic_symbol because whether this is really a + global reference can change and with it the fact if we have + to create a plt entry or a local got entry. To be able to + make a once global symbol a local one we have to keep track + of the number of gotplt references that exist for this + symbol. */ + if (h != NULL) + { + ((struct elf_s390_link_hash_entry *) h)->gotplt_refcount++; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.refcount += 1; + } + else + local_got_refcounts[r_symndx] += 1; + break; + + case R_390_TLS_LDM64: + htab->tls_ldm_got.refcount += 1; break; - case R_390_8: - case R_390_16: + case R_390_TLS_IE64: + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE20: + case R_390_TLS_GOTIE64: + case R_390_TLS_IEENT: + if (info->shared) + info->flags |= DF_STATIC_TLS; + /* Fall through */ + + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT20: + case R_390_GOT32: + case R_390_GOT64: + case R_390_GOTENT: + case R_390_TLS_GD64: + /* This symbol requires a global offset table entry. */ + switch (r_type) + { + default: + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT20: + case R_390_GOT32: + case R_390_GOTENT: + tls_type = GOT_NORMAL; + break; + case R_390_TLS_GD64: + tls_type = GOT_TLS_GD; + break; + case R_390_TLS_IE64: + case R_390_TLS_GOTIE64: + tls_type = GOT_TLS_IE; + break; + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE20: + case R_390_TLS_IEENT: + tls_type = GOT_TLS_IE_NLT; + break; + } + + if (h != NULL) + { + h->got.refcount += 1; + old_tls_type = elf_s390_hash_entry(h)->tls_type; + } + else + { + local_got_refcounts[r_symndx] += 1; + old_tls_type = elf_s390_local_got_tls_type (abfd) [r_symndx]; + } + /* If a TLS symbol is accessed using IE at least once, + there is no point to use dynamic model for it. */ + if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN) + { + if (old_tls_type == GOT_NORMAL || tls_type == GOT_NORMAL) + { + (*_bfd_error_handler) + (_("%s: `%s' accessed both as normal and thread local symbol"), + bfd_archive_filename (abfd), h->root.root.string); + return FALSE; + } + if (old_tls_type > tls_type) + tls_type = old_tls_type; + } + + if (old_tls_type != tls_type) + { + if (h != NULL) + elf_s390_hash_entry (h)->tls_type = tls_type; + else + elf_s390_local_got_tls_type (abfd) [r_symndx] = tls_type; + } + + if (r_type != R_390_TLS_IE64) + break; + /* Fall through */ + + case R_390_TLS_LE64: + if (!info->shared) + break; + info->flags |= DF_STATIC_TLS; + /* Fall through */ + + case R_390_8: + case R_390_16: case R_390_32: case R_390_64: - case R_390_PC16: - case R_390_PC16DBL: + case R_390_PC16: + case R_390_PC16DBL: case R_390_PC32: case R_390_PC32DBL: case R_390_PC64: @@ -728,7 +1202,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs) || h->root.type == bfd_link_hash_defweak || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared + || (ELIMINATE_COPY_RELOCS + && !info->shared && (sec->flags & SEC_ALLOC) != 0 && h != NULL && (h->root.type == bfd_link_hash_defweak @@ -751,7 +1226,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) elf_elfheader (abfd)->e_shstrndx, elf_section_data (sec)->rel_hdr.sh_name)); if (name == NULL) - return false; + return FALSE; if (strncmp (name, ".rela", 5) != 0 || strcmp (bfd_get_section_name (abfd, sec), @@ -779,7 +1254,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) if (sreloc == NULL || ! bfd_set_section_flags (dynobj, sreloc, flags) || ! bfd_set_section_alignment (dynobj, sreloc, 3)) - return false; + return FALSE; } elf_section_data (sec)->sreloc = sreloc; } @@ -800,7 +1275,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, sec, r_symndx); if (s == NULL) - return false; + return FALSE; head = ((struct elf_s390_dyn_relocs **) &elf_section_data (s)->local_dynrel); @@ -813,7 +1288,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) p = ((struct elf_s390_dyn_relocs *) bfd_alloc (htab->elf.dynobj, amt)); if (p == NULL) - return false; + return FALSE; p->next = *head; *head = p; p->sec = sec; @@ -833,24 +1308,24 @@ elf_s390_check_relocs (abfd, info, sec, relocs) /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ - case R_390_GNU_VTINHERIT: - if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) - return false; - break; + case R_390_GNU_VTINHERIT: + if (!bfd_elf_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_390_GNU_VTENTRY: - if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend)) - return false; - break; + case R_390_GNU_VTENTRY: + if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return FALSE; + break; default: break; } } - return true; + return TRUE; } /* Return the section that should be marked against GC for a given @@ -895,7 +1370,7 @@ elf_s390_gc_mark_hook (sec, info, rel, h, sym) /* Update the got entry reference counts for the section being removed. */ -static boolean +static bfd_boolean elf_s390_gc_sweep_hook (abfd, info, sec, relocs) bfd *abfd; struct bfd_link_info *info; @@ -906,8 +1381,6 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) 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; elf_section_data (sec)->local_dynrel = NULL; @@ -917,87 +1390,147 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) - switch (ELF64_R_TYPE (rel->r_info)) - { - case R_390_GOT12: - case R_390_GOT16: - case R_390_GOT32: - case R_390_GOT64: - case R_390_GOTOFF: - case R_390_GOTPC: - case R_390_GOTPCDBL: - case R_390_GOTENT: - 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; - } - else if (local_got_refcounts != NULL) - { - if (local_got_refcounts[r_symndx] > 0) - local_got_refcounts[r_symndx] -= 1; - } - break; - - case R_390_8: - case R_390_12: - case R_390_16: - case R_390_32: - case R_390_64: - case R_390_PC16: - case R_390_PC16DBL: - case R_390_PC32: - case R_390_PC32DBL: - case R_390_PC64: - r_symndx = ELF64_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - struct elf_s390_link_hash_entry *eh; - struct elf_s390_dyn_relocs **pp; - struct elf_s390_dyn_relocs *p; - - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - - if (!info->shared && h->plt.refcount > 0) - h->plt.refcount -= 1; - - eh = (struct elf_s390_link_hash_entry *) h; - - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) + { + unsigned long r_symndx; + unsigned int r_type; + struct elf_link_hash_entry *h = NULL; + + r_symndx = ELF64_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf_s390_link_hash_entry *eh; + struct elf_s390_dyn_relocs **pp; + struct elf_s390_dyn_relocs *p; + + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct elf_s390_link_hash_entry *) h; + + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } + } + + r_type = ELF64_R_TYPE (rel->r_info); + r_type = elf_s390_tls_transition (info, r_type, h != NULL); + switch (r_type) + { + case R_390_TLS_LDM64: + if (elf_s390_hash_table (info)->tls_ldm_got.refcount > 0) + elf_s390_hash_table (info)->tls_ldm_got.refcount -= 1; + break; + + case R_390_TLS_GD64: + case R_390_TLS_IE64: + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE20: + case R_390_TLS_GOTIE64: + case R_390_TLS_IEENT: + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT20: + case R_390_GOT32: + case R_390_GOT64: + case R_390_GOTOFF16: + case R_390_GOTOFF32: + case R_390_GOTOFF64: + case R_390_GOTPC: + case R_390_GOTPCDBL: + case R_390_GOTENT: + if (h != NULL) + { + if (h->got.refcount > 0) + h->got.refcount -= 1; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx] -= 1; + } + break; + + case R_390_8: + case R_390_12: + case R_390_16: + case R_390_20: + case R_390_32: + case R_390_64: + case R_390_PC16: + case R_390_PC16DBL: + case R_390_PC32: + case R_390_PC32DBL: + case R_390_PC64: + if (info->shared) + break; + /* Fall through */ + + case R_390_PLT16DBL: + case R_390_PLT32: + case R_390_PLT32DBL: + case R_390_PLT64: + case R_390_PLTOFF16: + case R_390_PLTOFF32: + case R_390_PLTOFF64: + if (h != NULL) + { + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; + + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT20: + case R_390_GOTPLT32: + case R_390_GOTPLT64: + case R_390_GOTPLTENT: + if (h != NULL) + { + if (h->plt.refcount > 0) { - if (ELF64_R_TYPE (rel->r_info) == R_390_PC16 - || ELF64_R_TYPE (rel->r_info) == R_390_PC16DBL - || ELF64_R_TYPE (rel->r_info) == R_390_PC32) - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; + ((struct elf_s390_link_hash_entry *) h)->gotplt_refcount--; + h->plt.refcount -= 1; } - } - break; - - case R_390_PLT16DBL: - case R_390_PLT32: - case R_390_PLT32DBL: - case R_390_PLT64: - 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; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx] -= 1; + } + break; + + default: + break; + } + } + + return TRUE; +} + +/* Make sure we emit a GOT entry if the symbol was supposed to have a PLT + entry but we found we will not create any. Called when we find we will + not have any PLT for this symbol, by for example + elf_s390_adjust_dynamic_symbol when we're doing a proper dynamic link, + or elf_s390_size_dynamic_sections if no dynamic sections will be + created (we're only linking static objects). */ + +static void +elf_s390_adjust_gotplt (h) + struct elf_s390_link_hash_entry *h; +{ + if (h->elf.root.type == bfd_link_hash_warning) + h = (struct elf_s390_link_hash_entry *) h->elf.root.u.i.link; + + if (h->gotplt_refcount <= 0) + return; + + /* We simply add the number of gotplt references to the number + * of got references for this symbol. */ + h->elf.got.refcount += h->gotplt_refcount; + h->gotplt_refcount = -1; } /* Adjust a symbol defined by a dynamic object and referenced by a @@ -1006,14 +1539,12 @@ elf_s390_gc_sweep_hook (abfd, info, sec, relocs) change the definition to something the rest of the link can understand. */ -static boolean +static bfd_boolean elf_s390_adjust_dynamic_symbol (info, h) struct bfd_link_info *info; struct elf_link_hash_entry *h; { struct elf_s390_link_hash_table *htab; - struct elf_s390_link_hash_entry * eh; - struct elf_s390_dyn_relocs *p; asection *s; unsigned int power_of_two; @@ -1031,15 +1562,16 @@ elf_s390_adjust_dynamic_symbol (info, h) && h->root.type != bfd_link_hash_undefined)) { /* 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 + 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; + elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h); } - return true; + return TRUE; } else /* It's possible that we incorrectly decided a .plt reloc was @@ -1058,7 +1590,11 @@ elf_s390_adjust_dynamic_symbol (info, h) || 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 (ELIMINATE_COPY_RELOCS || info->nocopyreloc) + h->elf_link_hash_flags + = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF) + | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF)); + return TRUE; } /* This is a reference to a symbol defined by a dynamic object which @@ -1069,34 +1605,40 @@ elf_s390_adjust_dynamic_symbol (info, h) For such cases we need not do anything here; the relocations will be handled correctly by relocate_section. */ if (info->shared) - return true; + 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; + return TRUE; /* If -z nocopyreloc was given, we won't generate them either. */ if (info->nocopyreloc) { h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - return true; + return TRUE; } - eh = (struct elf_s390_link_hash_entry *) h; - for (p = eh->dyn_relocs; p != NULL; p = p->next) + if (ELIMINATE_COPY_RELOCS) { - s = p->sec->output_section; - if (s != NULL && (s->flags & SEC_READONLY) != 0) - break; - } + struct elf_s390_link_hash_entry * eh; + struct elf_s390_dyn_relocs *p; - /* If we didn't find any dynamic relocs in read-only sections, then - we'll be keeping the dynamic relocs and avoiding the copy reloc. */ - if (p == NULL) - { - h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - return true; + eh = (struct elf_s390_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + break; + } + + /* If we didn't find any dynamic relocs in read-only sections, then + we'll be keeping the dynamic relocs and avoiding the copy reloc. */ + if (p == NULL) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return TRUE; + } } /* We must allocate the symbol in our .dynbss section, which will @@ -1132,7 +1674,7 @@ elf_s390_adjust_dynamic_symbol (info, h) if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) { if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return false; + return FALSE; } /* Define the symbol as being at this point in the section. */ @@ -1142,24 +1684,13 @@ elf_s390_adjust_dynamic_symbol (info, h) /* Increment the section size to make room for the symbol. */ s->_raw_size += h->size; - return true; + return TRUE; } -/* This is the condition under which elf_s390_finish_dynamic_symbol - will be called from elflink.h. If elflink.h doesn't call our - finish_dynamic_symbol routine, we'll need to do something about - initializing any .plt and .got entries in elf_s390_relocate_section. */ -#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ - ((DYN) \ - && ((INFO)->shared \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ - && ((H)->dynindx != -1 \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) - /* Allocate space in .plt, .got and associated reloc sections for dynamic relocs. */ -static boolean +static bfd_boolean allocate_dynrelocs (h, inf) struct elf_link_hash_entry *h; PTR inf; @@ -1170,27 +1701,33 @@ allocate_dynrelocs (h, inf) struct elf_s390_dyn_relocs *p; if (h->root.type == bfd_link_hash_indirect) - return true; + return TRUE; if (h->root.type == bfd_link_hash_warning) + /* When warning symbols are created, they **replace** the "real" + entry in the hash table, thus we never get to see the real + symbol in a hash traversal. So look at it now. */ h = (struct elf_link_hash_entry *) h->root.u.i.link; info = (struct bfd_link_info *) inf; htab = elf_s390_hash_table (info); if (htab->elf.dynamic_sections_created - && h->plt.refcount > 0) + && h->plt.refcount > 0 + && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) { /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ if (h->dynindx == -1 && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) { - if (! bfd_elf64_link_record_dynamic_symbol (info, h)) - return false; + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) + if (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) { asection *s = htab->splt; @@ -1227,33 +1764,69 @@ allocate_dynrelocs (h, inf) { h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h); } } else { h->plt.offset = (bfd_vma) -1; h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h); } - if (h->got.refcount > 0) + /* If R_390_TLS_{IE64,GOTIE64,GOTIE12,IEENT} symbol is now local to + the binary, we can optimize a bit. IE64 and GOTIE64 get converted + to R_390_TLS_LE64 requiring no TLS entry. For GOTIE12 and IEENT + we can save the dynamic TLS relocation. */ + if (h->got.refcount > 0 + && !info->shared + && h->dynindx == -1 + && elf_s390_hash_entry(h)->tls_type >= GOT_TLS_IE) + { + if (elf_s390_hash_entry(h)->tls_type == GOT_TLS_IE_NLT) + /* For the GOTIE access without a literal pool entry the offset has + to be stored somewhere. The immediate value in the instruction + is not bit enough so the value is stored in the got. */ + { + h->got.offset = htab->sgot->_raw_size; + htab->sgot->_raw_size += GOT_ENTRY_SIZE; + } + else + h->got.offset = (bfd_vma) -1; + } + else if (h->got.refcount > 0) { asection *s; - boolean dyn; + bfd_boolean dyn; + int tls_type = elf_s390_hash_entry(h)->tls_type; /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ if (h->dynindx == -1 && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) { - if (! bfd_elf64_link_record_dynamic_symbol (info, h)) - return false; + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } s = htab->sgot; h->got.offset = s->_raw_size; s->_raw_size += GOT_ENTRY_SIZE; + /* R_390_TLS_GD64 needs 2 consecutive GOT slots. */ + if (tls_type == GOT_TLS_GD) + s->_raw_size += GOT_ENTRY_SIZE; dyn = htab->elf.dynamic_sections_created; - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) + /* R_390_TLS_IE64 needs one dynamic relocation, + R_390_TLS_GD64 needs one if local symbol and two if global. */ + if ((tls_type == GOT_TLS_GD && h->dynindx == -1) + || tls_type >= GOT_TLS_IE) + htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); + else if (tls_type == GOT_TLS_GD) + htab->srelgot->_raw_size += 2 * sizeof (Elf64_External_Rela); + else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))) htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); } else @@ -1261,7 +1834,7 @@ allocate_dynrelocs (h, inf) eh = (struct elf_s390_link_hash_entry *) h; if (eh->dyn_relocs == NULL) - return true; + return TRUE; /* In the shared -Bsymbolic case, discard space allocated for dynamic pc-relative relocs against symbols which turn out to be @@ -1271,9 +1844,7 @@ allocate_dynrelocs (h, inf) if (info->shared) { - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 - && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 - || info->symbolic)) + if (SYMBOL_REFERENCES_LOCAL (info, h)) { struct elf_s390_dyn_relocs **pp; @@ -1287,8 +1858,14 @@ allocate_dynrelocs (h, inf) pp = &p->next; } } + + /* Also discard relocs on undefined weak syms with non-default + visibility. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + eh->dyn_relocs = NULL; } - else + else if (ELIMINATE_COPY_RELOCS) { /* For the non-shared case, discard space for relocs against symbols which turn out to need copy relocs or are not @@ -1306,8 +1883,8 @@ allocate_dynrelocs (h, inf) if (h->dynindx == -1 && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) { - if (! bfd_elf64_link_record_dynamic_symbol (info, h)) - return false; + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } /* If that succeeded, we know we'll be keeping all the @@ -1328,12 +1905,12 @@ allocate_dynrelocs (h, inf) sreloc->_raw_size += p->count * sizeof (Elf64_External_Rela); } - return true; + return TRUE; } /* Find any dynamic relocs that apply to read-only sections. */ -static boolean +static bfd_boolean readonly_dynrelocs (h, inf) struct elf_link_hash_entry *h; PTR inf; @@ -1356,15 +1933,15 @@ readonly_dynrelocs (h, inf) info->flags |= DF_TEXTREL; /* Not an error, just cut short the traversal. */ - return false; + return FALSE; } } - return true; + return TRUE; } /* Set the sizes of the dynamic sections. */ -static boolean +static bfd_boolean elf_s390_size_dynamic_sections (output_bfd, info) bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; @@ -1372,7 +1949,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) struct elf_s390_link_hash_table *htab; bfd *dynobj; asection *s; - boolean relocs; + bfd_boolean relocs; bfd *ibfd; htab = elf_s390_hash_table (info); @@ -1383,7 +1960,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) if (htab->elf.dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); if (s == NULL) @@ -1399,6 +1976,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; + char *local_tls_type; bfd_size_type locsymcount; Elf_Internal_Shdr *symtab_hdr; asection *srela; @@ -1440,14 +2018,17 @@ elf_s390_size_dynamic_sections (output_bfd, info) symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; locsymcount = symtab_hdr->sh_info; end_local_got = local_got + locsymcount; + local_tls_type = elf_s390_local_got_tls_type (ibfd); s = htab->sgot; srela = htab->srelgot; - for (; local_got < end_local_got; ++local_got) + for (; local_got < end_local_got; ++local_got, ++local_tls_type) { if (*local_got > 0) { *local_got = s->_raw_size; s->_raw_size += GOT_ENTRY_SIZE; + if (*local_tls_type == GOT_TLS_GD) + s->_raw_size += GOT_ENTRY_SIZE; if (info->shared) srela->_raw_size += sizeof (Elf64_External_Rela); } @@ -1456,13 +2037,24 @@ elf_s390_size_dynamic_sections (output_bfd, info) } } + if (htab->tls_ldm_got.refcount > 0) + { + /* Allocate 2 got entries and 1 dynamic reloc for R_390_TLS_LDM64 + relocs. */ + htab->tls_ldm_got.offset = htab->sgot->_raw_size; + htab->sgot->_raw_size += 2 * GOT_ENTRY_SIZE; + htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); + } + else + htab->tls_ldm_got.offset = -1; + /* Allocate global sym .plt and .got entries, and space for global sym dynamic relocs. */ elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); /* We now have determined the sizes of the various dynamic sections. Allocate memory for them. */ - relocs = false; + relocs = FALSE; for (s = dynobj->sections; s != NULL; s = s->next) { if ((s->flags & SEC_LINKER_CREATED) == 0) @@ -1478,7 +2070,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) { if (s->_raw_size != 0 && s != htab->srelplt) - relocs = true; + relocs = TRUE; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -1513,7 +2105,7 @@ elf_s390_size_dynamic_sections (output_bfd, info) of garbage. */ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL) - return false; + return FALSE; } if (htab->elf.dynamic_sections_created) @@ -1524,12 +2116,12 @@ elf_s390_size_dynamic_sections (output_bfd, info) the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ #define add_dynamic_entry(TAG, VAL) \ - bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + _bfd_elf_add_dynamic_entry (info, TAG, VAL) - if (! info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) - return false; + return FALSE; } if (htab->splt->_raw_size != 0) @@ -1538,15 +2130,15 @@ elf_s390_size_dynamic_sections (output_bfd, info) || !add_dynamic_entry (DT_PLTRELSZ, 0) || !add_dynamic_entry (DT_PLTREL, DT_RELA) || !add_dynamic_entry (DT_JMPREL, 0)) - return false; + return FALSE; } if (relocs) - { - if (!add_dynamic_entry (DT_RELA, 0) - || !add_dynamic_entry (DT_RELASZ, 0) - || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) - return false; + { + if (!add_dynamic_entry (DT_RELA, 0) + || !add_dynamic_entry (DT_RELASZ, 0) + || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) + return FALSE; /* If any dynamic relocs apply to a read-only section, then we need a DT_TEXTREL entry. */ @@ -1557,18 +2149,68 @@ elf_s390_size_dynamic_sections (output_bfd, info) if ((info->flags & DF_TEXTREL) != 0) { if (!add_dynamic_entry (DT_TEXTREL, 0)) - return false; + return FALSE; } } } #undef add_dynamic_entry - return true; + return TRUE; +} + +/* Return the base VMA address which should be subtracted from real addresses + when resolving @dtpoff relocation. + This is PT_TLS segment p_vaddr. */ + +static bfd_vma +dtpoff_base (info) + struct bfd_link_info *info; +{ + /* If tls_sec is NULL, we should have signalled an error already. */ + if (elf_hash_table (info)->tls_sec == NULL) + return 0; + return elf_hash_table (info)->tls_sec->vma; +} + +/* Return the relocation value for @tpoff relocation + if STT_TLS virtual address is ADDRESS. */ + +static bfd_vma +tpoff (info, address) + struct bfd_link_info *info; + bfd_vma address; +{ + struct elf_link_hash_table *htab = elf_hash_table (info); + + /* If tls_sec is NULL, we should have signalled an error already. */ + if (htab->tls_sec == NULL) + return 0; + return htab->tls_size + htab->tls_sec->vma - address; +} + +/* Complain if TLS instruction relocation is against an invalid + instruction. */ + +static void +invalid_tls_insn (input_bfd, input_section, rel) + bfd *input_bfd; + asection *input_section; + Elf_Internal_Rela *rel; +{ + reloc_howto_type *howto; + + howto = elf_howto_table + ELF64_R_TYPE (rel->r_info); + (*_bfd_error_handler) + (_("%s(%s+0x%lx): invalid instruction for TLS relocation %s"), + bfd_archive_filename (input_bfd), + bfd_get_section_name (input_bfd, input_section), + (long) rel->r_offset, + howto->name); } /* Relocate a 390 ELF section. */ -static boolean +static bfd_boolean elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, local_syms, local_sections) bfd *output_bfd; @@ -1587,8 +2229,8 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; htab = elf_s390_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -1599,7 +2241,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, relend = relocs + input_section->reloc_count; for (; rel < relend; rel++) { - int r_type; + unsigned int r_type; reloc_howto_type *howto; unsigned long r_symndx; struct elf_link_hash_entry *h; @@ -1607,256 +2249,287 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, asection *sec; bfd_vma off; bfd_vma relocation; - boolean unresolved_reloc; + bfd_boolean unresolved_reloc; bfd_reloc_status_type r; + int tls_type; r_type = ELF64_R_TYPE (rel->r_info); if (r_type == (int) R_390_GNU_VTINHERIT - || r_type == (int) R_390_GNU_VTENTRY) - continue; - if (r_type < 0 || r_type >= (int) R_390_max) + || r_type == (int) R_390_GNU_VTENTRY) + continue; + if (r_type >= (int) R_390_max) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } howto = elf_howto_table + r_type; r_symndx = ELF64_R_SYM (rel->r_info); + + /* This is a final link. */ h = NULL; sym = NULL; sec = NULL; - unresolved_reloc = false; + unresolved_reloc = FALSE; if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; sec = local_sections[r_symndx]; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); } 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; + bfd_boolean warned ATTRIBUTE_UNUSED; - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - sec = h->root.u.def.section; - if (sec->output_section == NULL) - { - /* Set a flag that will be cleared later if we find a - relocation value for this symbol. output_section - is typically NULL for symbols satisfied by a shared - library. */ - unresolved_reloc = true; - 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->allow_shlib_undefined) - && !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, rel->r_offset, - (!info->shared || info->no_undefined - || ELF_ST_VISIBILITY (h->other))))) - return false; - relocation = 0; - } + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); } switch (r_type) { - case R_390_GOT12: - case R_390_GOT16: - case R_390_GOT32: - case R_390_GOT64: - case R_390_GOTENT: - /* Relocation is to the entry for this symbol in the global - offset table. */ + case R_390_GOTPLT12: + case R_390_GOTPLT16: + case R_390_GOTPLT20: + case R_390_GOTPLT32: + case R_390_GOTPLT64: + case R_390_GOTPLTENT: + /* There are three cases for a GOTPLT relocation. 1) The + relocation is against the jump slot entry of a plt that + will get emitted to the output file. 2) The relocation + is against the jump slot of a plt entry that has been + removed. elf_s390_adjust_gotplt has created a GOT entry + as replacement. 3) The relocation is against a local symbol. + Cases 2) and 3) are the same as the GOT relocation code + so we just have to test for case 1 and fall through for + the other two. */ + if (h != NULL && h->plt.offset != (bfd_vma) -1) + { + bfd_vma plt_index; + + /* Calc. index no. + Current offset - size first entry / entry size. */ + plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / + PLT_ENTRY_SIZE; + + /* Offset in GOT is PLT index plus GOT headers(3) times 4, + addr & GOT addr. */ + relocation = (plt_index + 3) * GOT_ENTRY_SIZE; + unresolved_reloc = FALSE; + + if (r_type == R_390_GOTPLTENT) + relocation += htab->sgot->output_section->vma; + break; + } + /* Fall through. */ + + case R_390_GOT12: + case R_390_GOT16: + case R_390_GOT20: + case R_390_GOT32: + case R_390_GOT64: + case R_390_GOTENT: + /* Relocation is to the entry for this symbol in the global + offset table. */ if (htab->sgot == NULL) abort (); - if (h != NULL) - { - boolean dyn; + if (h != NULL) + { + bfd_boolean dyn; - off = h->got.offset; + off = h->got.offset; dyn = htab->elf.dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) - || (info->shared - && (info->symbolic + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) + || (info->shared + && (info->symbolic || h->dynindx == -1 || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) - { - /* This is actually a static link, or it is a - -Bsymbolic link and the symbol is defined - locally, or the symbol was forced to be local - because of a version file. We must initialize - this entry in the global offset table. Since the - offset must always be a multiple of 2, we use the - least significant bit to record whether we have - initialized it already. - - When doing a dynamic link, we create a .rel.got - relocation entry to initialize the value. This - is done in the finish_dynamic_symbol routine. */ - if ((off & 1) != 0) - off &= ~1; - else - { + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) + || (ELF_ST_VISIBILITY (h->other) + && h->root.type == bfd_link_hash_undefweak)) + { + /* 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 2, we use the + least significant bit to record whether we have + initialized it already. + + When doing a dynamic link, we create a .rel.got + relocation entry to initialize the value. This + is done in the finish_dynamic_symbol routine. */ + if ((off & 1) != 0) + off &= ~1; + else + { bfd_put_64 (output_bfd, relocation, htab->sgot->contents + off); - h->got.offset |= 1; - } - } + h->got.offset |= 1; + } + } else - unresolved_reloc = false; - } - else - { + unresolved_reloc = FALSE; + } + else + { if (local_got_offsets == NULL) abort (); - off = local_got_offsets[r_symndx]; + 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, + /* 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, htab->sgot->contents + off); - if (info->shared) - { - asection *srelgot; - Elf_Internal_Rela outrel; - Elf64_External_Rela *loc; + if (info->shared) + { + asection *s; + Elf_Internal_Rela outrel; + bfd_byte *loc; - srelgot = htab->srelgot; - if (srelgot == NULL) + s = htab->srelgot; + if (s == NULL) abort (); - outrel.r_offset = (htab->sgot->output_section->vma - + htab->sgot->output_offset - + off); - outrel.r_info = ELF64_R_INFO (0, R_390_RELATIVE); + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + + off); + outrel.r_info = ELF64_R_INFO (0, R_390_RELATIVE); outrel.r_addend = relocation; - loc = (Elf64_External_Rela *) srelgot->contents; - loc += srelgot->reloc_count++; - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); - } + loc = s->contents; + loc += s->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + } - local_got_offsets[r_symndx] |= 1; - } - } + local_got_offsets[r_symndx] |= 1; + } + } if (off >= (bfd_vma) -2) abort (); relocation = htab->sgot->output_offset + off; - /* - * For @GOTENT the relocation is against the offset between - * the instruction and the symbols entry in the GOT and not - * between the start of the GOT and the symbols entry. We - * add the vma of the GOT to get the correct value. - */ - if (r_type == R_390_GOTENT) + /* For @GOTENT the relocation is against the offset between + the instruction and the symbols entry in the GOT and not + between the start of the GOT and the symbols entry. We + add the vma of the GOT to get the correct value. */ + if ( r_type == R_390_GOTENT + || r_type == R_390_GOTPLTENT) relocation += htab->sgot->output_section->vma; - break; + break; + + case R_390_GOTOFF16: + case R_390_GOTOFF32: + case R_390_GOTOFF64: + /* Relocation is relative to the start of the global offset + table. */ + + /* Note that sgot->output_offset is not involved in this + calculation. We always want the start of .got. If we + defined _GLOBAL_OFFSET_TABLE in a different way, as is + permitted by the ABI, we might have to change this + calculation. */ + relocation -= htab->sgot->output_section->vma; + break; + + case R_390_GOTPC: + case R_390_GOTPCDBL: + /* Use global offset table as symbol value. */ + relocation = htab->sgot->output_section->vma; + unresolved_reloc = FALSE; + break; - case R_390_GOTOFF: - /* Relocation is relative to the start of the global offset - table. */ + case R_390_PLT16DBL: + case R_390_PLT32: + case R_390_PLT32DBL: + case R_390_PLT64: + /* Relocation is to the entry for this symbol in the + procedure linkage table. */ - /* Note that sgot->output_offset is not involved in this - calculation. We always want the start of .got. If we - defined _GLOBAL_OFFSET_TABLE in a different way, as is - permitted by the ABI, we might have to change this - calculation. */ - relocation -= htab->sgot->output_section->vma; + /* Resolve a PLT32 reloc against a local symbol directly, + without using the procedure linkage table. */ + if (h == NULL) + break; - break; + if (h->plt.offset == (bfd_vma) -1 + || htab->splt == NULL) + { + /* We didn't make a PLT entry for this symbol. This + happens when statically linking PIC code, or when + using -Bsymbolic. */ + break; + } - case R_390_GOTPC: - case R_390_GOTPCDBL: - /* Use global offset table as symbol value. */ - relocation = htab->sgot->output_section->vma; - unresolved_reloc = false; - break; - - case R_390_PLT16DBL: - case R_390_PLT32: - case R_390_PLT32DBL: - case R_390_PLT64: - /* 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 + relocation = (htab->splt->output_section->vma + + htab->splt->output_offset + + h->plt.offset); + unresolved_reloc = FALSE; + break; + + case R_390_PLTOFF16: + case R_390_PLTOFF32: + case R_390_PLTOFF64: + /* Relocation is to the entry for this symbol in the + procedure linkage table relative to the start of the GOT. */ + + /* For local symbols or if we didn't make a PLT entry for + this symbol resolve the symbol directly. */ + if ( h == NULL + || h->plt.offset == (bfd_vma) -1 || htab->splt == NULL) - { - /* We didn't make a PLT entry for this symbol. This - happens when statically linking PIC code, or when - using -Bsymbolic. */ - break; - } - - relocation = (htab->splt->output_section->vma - + htab->splt->output_offset - + h->plt.offset); - unresolved_reloc = false; - break; - - case R_390_8: - case R_390_16: - case R_390_32: - case R_390_64: - case R_390_PC16: - case R_390_PC16DBL: - case R_390_PC32: + { + relocation -= htab->sgot->output_section->vma; + break; + } + + relocation = (htab->splt->output_section->vma + + htab->splt->output_offset + + h->plt.offset + - htab->sgot->output_section->vma); + unresolved_reloc = FALSE; + break; + + case R_390_8: + case R_390_16: + case R_390_32: + case R_390_64: + case R_390_PC16: + case R_390_PC16DBL: + case R_390_PC32: case R_390_PC32DBL: - case R_390_PC64: + case R_390_PC64: /* r_symndx will be zero only for relocs against symbols from removed linkonce sections, or sections discarded by a linker script. */ - if (r_symndx == 0 - || (input_section->flags & SEC_ALLOC) == 0) + if (r_symndx == 0 + || (input_section->flags & SEC_ALLOC) == 0) break; - if ((info->shared + if ((info->shared + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) && ((r_type != R_390_PC16 && r_type != R_390_PC16DBL && r_type != R_390_PC32 && r_type != R_390_PC32DBL && r_type != R_390_PC64) || (h != NULL - && h->dynindx != -1 - && (! info->symbolic - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared + && !SYMBOL_REFERENCES_LOCAL (info, h)))) + || (ELIMINATE_COPY_RELOCS + && !info->shared && h != NULL && h->dynindx != -1 && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 @@ -1866,33 +2539,32 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, & ELF_LINK_HASH_DEF_REGULAR) == 0) || h->root.type == bfd_link_hash_undefweak || h->root.type == bfd_link_hash_undefined))) - { - Elf_Internal_Rela outrel; - boolean skip, relocate; + { + Elf_Internal_Rela outrel; + bfd_boolean skip, relocate; asection *sreloc; - Elf64_External_Rela *loc; + bfd_byte *loc; - /* When generating a shared object, these relocations - are copied into the output file to be resolved at run - time. */ - - skip = false; - relocate = false; + /* When generating a shared object, these relocations + are copied into the output file to be resolved at run + time. */ + skip = FALSE; + relocate = FALSE; outrel.r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, rel->r_offset); if (outrel.r_offset == (bfd_vma) -1) - skip = true; + skip = TRUE; else if (outrel.r_offset == (bfd_vma) -2) - skip = true, relocate = true; + skip = TRUE, relocate = TRUE; - outrel.r_offset += (input_section->output_section->vma - + input_section->output_offset); + outrel.r_offset += (input_section->output_section->vma + + input_section->output_offset); - if (skip) + if (skip) memset (&outrel, 0, sizeof outrel); - else if (h != NULL + else if (h != NULL && h->dynindx != -1 && (r_type == R_390_PC16 || r_type == R_390_PC16DBL @@ -1903,39 +2575,412 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, || !info->symbolic || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) - { - outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); + { + outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); outrel.r_addend = rel->r_addend; - } - else - { + } + else + { /* This symbol is local, or marked to become local. */ - relocate = true; - outrel.r_info = ELF64_R_INFO (0, R_390_RELATIVE); outrel.r_addend = relocation + rel->r_addend; + if (r_type == R_390_64) + { + relocate = TRUE; + outrel.r_info = ELF64_R_INFO (0, R_390_RELATIVE); + } + else + { + long sindx; + + if (bfd_is_abs_section (sec)) + sindx = 0; + else if (sec == NULL || sec->owner == NULL) + { + bfd_set_error(bfd_error_bad_value); + return FALSE; + } + else + { + asection *osec; + + osec = sec->output_section; + sindx = elf_section_data (osec)->dynindx; + BFD_ASSERT (sindx > 0); + + /* We are turning this relocation into one + against a section symbol, so subtract out + the output section's address but not the + offset of the input section in the output + section. */ + + outrel.r_addend -= osec->vma; + } + outrel.r_info = ELF64_R_INFO (sindx, r_type); + } + } + + sreloc = elf_section_data (input_section)->sreloc; + if (sreloc == NULL) + abort (); + + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + + /* 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; + + /* Relocations for tls literal pool entries. */ + case R_390_TLS_IE64: + if (info->shared) + { + Elf_Internal_Rela outrel; + asection *sreloc; + bfd_byte *loc; + + outrel.r_offset = rel->r_offset + + input_section->output_section->vma + + input_section->output_offset; + outrel.r_info = ELF64_R_INFO (0, R_390_RELATIVE); + sreloc = elf_section_data (input_section)->sreloc; + if (sreloc == NULL) + abort (); + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloc_out (output_bfd, &outrel, loc); + } + /* Fall through. */ + + case R_390_TLS_GD64: + case R_390_TLS_GOTIE64: + r_type = elf_s390_tls_transition (info, r_type, h == NULL); + tls_type = GOT_UNKNOWN; + if (h == NULL && local_got_offsets) + tls_type = elf_s390_local_got_tls_type (input_bfd) [r_symndx]; + else if (h != NULL) + { + tls_type = elf_s390_hash_entry(h)->tls_type; + if (!info->shared && h->dynindx == -1 && tls_type >= GOT_TLS_IE) + r_type = R_390_TLS_LE64; + } + if (r_type == R_390_TLS_GD64 && tls_type >= GOT_TLS_IE) + r_type = R_390_TLS_IE64; + + if (r_type == R_390_TLS_LE64) + { + /* This relocation gets optimized away by the local exec + access optimization. */ + BFD_ASSERT (! unresolved_reloc); + bfd_put_64 (output_bfd, -tpoff (info, relocation), + contents + rel->r_offset); + continue; + } + + if (htab->sgot == NULL) + abort (); + + if (h != NULL) + off = h->got.offset; + else + { + if (local_got_offsets == NULL) + abort (); + + off = local_got_offsets[r_symndx]; + } + + emit_tls_relocs: + + if ((off & 1) != 0) + off &= ~1; + else + { + Elf_Internal_Rela outrel; + bfd_byte *loc; + int dr_type, indx; + + if (htab->srelgot == NULL) + abort (); + + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off); + + indx = h && h->dynindx != -1 ? h->dynindx : 0; + if (r_type == R_390_TLS_GD64) + dr_type = R_390_TLS_DTPMOD; + else + dr_type = R_390_TLS_TPOFF; + if (dr_type == R_390_TLS_TPOFF && indx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + else + outrel.r_addend = 0; + outrel.r_info = ELF64_R_INFO (indx, dr_type); + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ + * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + + if (r_type == R_390_TLS_GD64) + { + if (indx == 0) + { + BFD_ASSERT (! unresolved_reloc); + bfd_put_64 (output_bfd, + relocation - dtpoff_base (info), + htab->sgot->contents + off + GOT_ENTRY_SIZE); + } + else + { + outrel.r_info = ELF64_R_INFO (indx, R_390_TLS_DTPOFF); + outrel.r_offset += GOT_ENTRY_SIZE; + outrel.r_addend = 0; + htab->srelgot->reloc_count++; + loc += sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + } } + if (h != NULL) + h->got.offset |= 1; + else + local_got_offsets[r_symndx] |= 1; + } + + if (off >= (bfd_vma) -2) + abort (); + if (r_type == ELF64_R_TYPE (rel->r_info)) + { + relocation = htab->sgot->output_offset + off; + if (r_type == R_390_TLS_IE64 || r_type == R_390_TLS_IEENT) + relocation += htab->sgot->output_section->vma; + unresolved_reloc = FALSE; + } + else + { + bfd_put_64 (output_bfd, htab->sgot->output_offset + off, + contents + rel->r_offset); + continue; + } + break; + + case R_390_TLS_GOTIE12: + case R_390_TLS_GOTIE20: + case R_390_TLS_IEENT: + if (h == NULL) + { + if (local_got_offsets == NULL) + abort(); + off = local_got_offsets[r_symndx]; + if (info->shared) + goto emit_tls_relocs; + } + else + { + off = h->got.offset; + tls_type = elf_s390_hash_entry(h)->tls_type; + if (info->shared || h->dynindx != -1 || tls_type < GOT_TLS_IE) + goto emit_tls_relocs; + } + + if (htab->sgot == NULL) + abort (); + + BFD_ASSERT (! unresolved_reloc); + bfd_put_64 (output_bfd, -tpoff (info, relocation), + htab->sgot->contents + off); + relocation = htab->sgot->output_offset + off; + if (r_type == R_390_TLS_IEENT) + relocation += htab->sgot->output_section->vma; + unresolved_reloc = FALSE; + break; + + case R_390_TLS_LDM64: + if (! info->shared) + /* The literal pool entry this relocation refers to gets ignored + by the optimized code of the local exec model. Do nothing + and the value will turn out zero. */ + continue; + + if (htab->sgot == NULL) + abort (); + + off = htab->tls_ldm_got.offset; + if (off & 1) + off &= ~1; + else + { + Elf_Internal_Rela outrel; + bfd_byte *loc; + + if (htab->srelgot == NULL) + abort (); + + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off); + + bfd_put_64 (output_bfd, 0, + htab->sgot->contents + off + GOT_ENTRY_SIZE); + outrel.r_info = ELF64_R_INFO (0, R_390_TLS_DTPMOD); + outrel.r_addend = 0; + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ + * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + htab->tls_ldm_got.offset |= 1; + } + relocation = htab->sgot->output_offset + off; + unresolved_reloc = FALSE; + break; + + case R_390_TLS_LE64: + if (info->shared) + { + /* Linking a shared library with non-fpic code requires + a R_390_TLS_TPOFF relocation. */ + Elf_Internal_Rela outrel; + asection *sreloc; + bfd_byte *loc; + int indx; + + outrel.r_offset = rel->r_offset + + input_section->output_section->vma + + input_section->output_offset; + if (h != NULL && h->dynindx != -1) + indx = h->dynindx; + else + indx = 0; + outrel.r_info = ELF64_R_INFO (indx, R_390_TLS_TPOFF); + if (indx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + else + outrel.r_addend = 0; sreloc = elf_section_data (input_section)->sreloc; if (sreloc == NULL) abort (); + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + } + else + { + BFD_ASSERT (! unresolved_reloc); + bfd_put_64 (output_bfd, -tpoff (info, relocation), + contents + rel->r_offset); + } + continue; - loc = (Elf64_External_Rela *) sreloc->contents; - loc += sreloc->reloc_count++; - bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + case R_390_TLS_LDO64: + if (info->shared || (input_section->flags & SEC_CODE) == 0) + relocation -= dtpoff_base (info); + else + /* When converting LDO to LE, we must negate. */ + relocation = -tpoff (info, relocation); + break; - /* 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; - } + /* Relocations for tls instructions. */ + case R_390_TLS_LOAD: + case R_390_TLS_GDCALL: + case R_390_TLS_LDCALL: + tls_type = GOT_UNKNOWN; + if (h == NULL && local_got_offsets) + tls_type = elf_s390_local_got_tls_type (input_bfd) [r_symndx]; + else if (h != NULL) + tls_type = elf_s390_hash_entry(h)->tls_type; + + if (tls_type == GOT_TLS_GD) + continue; + + if (r_type == R_390_TLS_LOAD) + { + if (!info->shared && (h == NULL || h->dynindx == -1)) + { + /* IE->LE transition. Four valid cases: + lg %rx,(0,%ry) -> sllg %rx,%ry,0 + lg %rx,(%ry,0) -> sllg %rx,%ry,0 + lg %rx,(%ry,%r12) -> sllg %rx,%ry,0 + lg %rx,(%r12,%ry) -> sllg %rx,%ry,0 */ + unsigned int insn0, insn1, ry; + + insn0 = bfd_get_32 (input_bfd, contents + rel->r_offset); + insn1 = bfd_get_16 (input_bfd, contents + rel->r_offset + 4); + if (insn1 != 0x0004) + invalid_tls_insn (input_bfd, input_section, rel); + ry = 0; + if ((insn0 & 0xff00f000) == 0xe3000000) + /* lg %rx,0(%ry,0) -> sllg %rx,%ry,0 */ + ry = (insn0 & 0x000f0000); + else if ((insn0 & 0xff0f0000) == 0xe3000000) + /* lg %rx,0(0,%ry) -> sllg %rx,%ry,0 */ + ry = (insn0 & 0x0000f000) << 4; + else if ((insn0 & 0xff00f000) == 0xe300c000) + /* lg %rx,0(%ry,%r12) -> sllg %rx,%ry,0 */ + ry = (insn0 & 0x000f0000); + else if ((insn0 & 0xff0f0000) == 0xe30c0000) + /* lg %rx,0(%r12,%ry) -> sllg %rx,%ry,0 */ + ry = (insn0 & 0x0000f000) << 4; + else + invalid_tls_insn (input_bfd, input_section, rel); + insn0 = 0xeb000000 | (insn0 & 0x00f00000) | ry; + insn1 = 0x000d; + bfd_put_32 (output_bfd, insn0, contents + rel->r_offset); + bfd_put_16 (output_bfd, insn1, contents + rel->r_offset + 4); + } + } + else if (r_type == R_390_TLS_GDCALL) + { + unsigned int insn0, insn1; - break; + insn0 = bfd_get_32 (input_bfd, contents + rel->r_offset); + insn1 = bfd_get_16 (input_bfd, contents + rel->r_offset + 4); + if ((insn0 & 0xffff0000) != 0xc0e50000) + invalid_tls_insn (input_bfd, input_section, rel); + if (!info->shared && (h == NULL || h->dynindx == -1)) + { + /* GD->LE transition. + brasl %r14,__tls_get_addr@plt -> brcl 0,. */ + insn0 = 0xc0040000; + insn1 = 0x0000; + } + else + { + /* GD->IE transition. + brasl %r14,__tls_get_addr@plt -> lg %r2,0(%r2,%r12) */ + insn0 = 0xe322c000; + insn1 = 0x0004; + } + bfd_put_32 (output_bfd, insn0, contents + rel->r_offset); + bfd_put_16 (output_bfd, insn1, contents + rel->r_offset + 4); + } + else if (r_type == R_390_TLS_LDCALL) + { + if (!info->shared) + { + unsigned int insn0, insn1; + + insn0 = bfd_get_32 (input_bfd, contents + rel->r_offset); + insn1 = bfd_get_16 (input_bfd, contents + rel->r_offset + 4); + if ((insn0 & 0xffff0000) != 0xc0e50000) + invalid_tls_insn (input_bfd, input_section, rel); + /* LD->LE transition. + brasl %r14,__tls_get_addr@plt -> brcl 0,. */ + insn0 = 0xc0040000; + insn1 = 0x0000; + bfd_put_32 (output_bfd, insn0, contents + rel->r_offset); + bfd_put_16 (output_bfd, insn1, contents + rel->r_offset + 4); + } + } + continue; - default: - break; - } + default: + break; + } /* Dynamic relocs are not propagated for SEC_DEBUGGING sections because such sections are not SEC_ALLOC and thus ld.so will @@ -1950,7 +2995,19 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, (long) rel->r_offset, h->root.root.string); - r = _bfd_final_link_relocate (howto, input_bfd, input_section, + if (r_type == R_390_20 + || r_type == R_390_GOT20 + || r_type == R_390_GOTPLT20 + || r_type == R_390_TLS_GOTIE20) + { + relocation += rel->r_addend; + relocation = (relocation&0xfff) << 8 | (relocation&0xff000) >> 12; + r = _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, + relocation, 0); + } + else + r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, relocation, rel->r_addend); @@ -1966,7 +3023,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, symtab_hdr->sh_link, sym->st_name); if (name == NULL) - return false; + return FALSE; if (*name == '\0') name = bfd_section_name (input_bfd, sec); } @@ -1977,7 +3034,7 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, if (! ((*info->callbacks->reloc_overflow) (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset))) - return false; + return FALSE; } else { @@ -1986,18 +3043,18 @@ elf_s390_relocate_section (output_bfd, info, input_bfd, input_section, bfd_archive_filename (input_bfd), bfd_get_section_name (input_bfd, input_section), (long) rel->r_offset, name, (int) r); - return false; + return FALSE; } } } - return true; + return TRUE; } /* Finish up dynamic symbol handling. We set the contents of various dynamic sections here. */ -static boolean +static bfd_boolean elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) bfd *output_bfd; struct bfd_link_info *info; @@ -2013,10 +3070,10 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) bfd_vma plt_index; bfd_vma got_offset; Elf_Internal_Rela rela; - Elf64_External_Rela *loc; + bfd_byte *loc; /* This symbol has an entry in the procedure linkage table. Set - it up. */ + it up. */ if (h->dynindx == -1 || htab->splt == NULL @@ -2025,11 +3082,11 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) abort (); /* Calc. index no. - Current offset - size first entry / entry size. */ + Current offset - size first entry / entry size. */ plt_index = (h->plt.offset - PLT_FIRST_ENTRY_SIZE) / PLT_ENTRY_SIZE; /* Offset in GOT is PLT index plus GOT headers(3) times 8, - addr & GOT addr. */ + addr & GOT addr. */ got_offset = (plt_index + 3) * GOT_ENTRY_SIZE; /* Fill in the blueprint of a PLT. */ @@ -2064,7 +3121,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) htab->splt->contents + h->plt.offset + 28); /* Fill in the entry in the global offset table. - Points to instruction after GOT offset. */ + Points to instruction after GOT offset. */ bfd_put_64 (output_bfd, (htab->splt->output_section->vma + htab->splt->output_offset @@ -2078,7 +3135,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) + got_offset); rela.r_info = ELF64_R_INFO (h->dynindx, R_390_JMP_SLOT); rela.r_addend = 0; - loc = (Elf64_External_Rela *) htab->srelplt->contents + plt_index; + loc = htab->srelplt->contents + plt_index * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) @@ -2092,14 +3149,16 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) } } - if (h->got.offset != (bfd_vma) -1) + if (h->got.offset != (bfd_vma) -1 + && elf_s390_hash_entry(h)->tls_type != GOT_TLS_GD + && elf_s390_hash_entry(h)->tls_type != GOT_TLS_IE + && elf_s390_hash_entry(h)->tls_type != GOT_TLS_IE_NLT) { Elf_Internal_Rela rela; - Elf64_External_Rela *loc; + bfd_byte *loc; /* This symbol has an entry in the global offset table. Set it - up. */ - + up. */ if (htab->sgot == NULL || htab->srelgot == NULL) abort (); @@ -2117,30 +3176,30 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) || h->dynindx == -1 || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) - { + { BFD_ASSERT((h->got.offset & 1) != 0); - rela.r_info = ELF64_R_INFO (0, R_390_RELATIVE); - rela.r_addend = (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 (0, R_390_RELATIVE); + rela.r_addend = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + } else { BFD_ASSERT((h->got.offset & 1) == 0); bfd_put_64 (output_bfd, (bfd_vma) 0, htab->sgot->contents + h->got.offset); rela.r_info = ELF64_R_INFO (h->dynindx, R_390_GLOB_DAT); - rela.r_addend = 0; - } + rela.r_addend = 0; + } - loc = (Elf64_External_Rela *) htab->srelgot->contents; - loc += htab->srelgot->reloc_count++; + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); } if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) { Elf_Internal_Rela rela; - Elf64_External_Rela *loc; + bfd_byte *loc; /* This symbols needs a copy reloc. Set it up. */ @@ -2155,8 +3214,8 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) + h->root.u.def.section->output_offset); rela.r_info = ELF64_R_INFO (h->dynindx, R_390_COPY); rela.r_addend = 0; - loc = (Elf64_External_Rela *) htab->srelbss->contents; - loc += htab->srelbss->reloc_count++; + loc = htab->srelbss->contents; + loc += htab->srelbss->reloc_count++ * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); } @@ -2166,7 +3225,7 @@ elf_s390_finish_dynamic_symbol (output_bfd, info, h, sym) || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0) sym->st_shndx = SHN_ABS; - return true; + return TRUE; } /* Used to decide how to sort relocs in an optimal manner for the @@ -2191,7 +3250,7 @@ elf_s390_reloc_type_class (rela) /* Finish up the dynamic sections. */ -static boolean +static bfd_boolean elf_s390_finish_dynamic_sections (output_bfd, info) bfd *output_bfd; struct bfd_link_info *info; @@ -2307,21 +3366,12 @@ elf_s390_finish_dynamic_sections (output_bfd, info) elf_section_data (htab->sgot->output_section) ->this_hdr.sh_entsize = 8; } - return true; -} - -static boolean -elf_s390_object_p (abfd) - bfd *abfd; -{ - return bfd_default_set_arch_mach (abfd, bfd_arch_s390, bfd_mach_s390_64); + 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 s390_elf64_size_info structure. - */ +/* 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 s390_elf64_size_info structure. */ const struct elf_size_info s390_elf64_size_info = { @@ -2333,10 +3383,10 @@ const struct elf_size_info s390_elf64_size_info = 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 */ + 8, /* hash-table entry size. */ + 1, /* internal relocations per external relocations. */ + 64, /* arch_size. */ + 3, /* log_file_align. */ ELFCLASS64, EV_CURRENT, bfd_elf64_write_out_phdrs, bfd_elf64_write_shdrs_and_ehdr, @@ -2347,10 +3397,10 @@ const struct elf_size_info s390_elf64_size_info = bfd_elf64_slurp_symbol_table, bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_out, - NULL, - NULL, - NULL, - NULL + bfd_elf64_swap_reloc_in, + bfd_elf64_swap_reloc_out, + bfd_elf64_swap_reloca_in, + bfd_elf64_swap_reloca_out }; #define TARGET_BIG_SYM bfd_elf64_s390_vec @@ -2368,7 +3418,6 @@ const struct elf_size_info s390_elf64_size_info = #define elf_backend_plt_readonly 1 #define elf_backend_want_plt_sym 0 #define elf_backend_got_header_size 24 -#define elf_backend_plt_header_size PLT_ENTRY_SIZE #define elf_backend_rela_normal 1 #define elf_info_to_howto elf_s390_info_to_howto @@ -2390,6 +3439,7 @@ const struct elf_size_info s390_elf64_size_info = #define elf_backend_size_dynamic_sections elf_s390_size_dynamic_sections #define elf_backend_reloc_type_class elf_s390_reloc_type_class -#define elf_backend_object_p elf_s390_object_p +#define bfd_elf64_mkobject elf_s390_mkobject +#define elf_backend_object_p elf_s390_object_p #include "elf64-target.h" diff --git a/contrib/binutils/bfd/elf64-sparc.c b/contrib/binutils/bfd/elf64-sparc.c index a3c100d..4568a22 100644 --- a/contrib/binutils/bfd/elf64-sparc.c +++ b/contrib/binutils/bfd/elf64-sparc.c @@ -1,22 +1,22 @@ /* SPARC-specific support for 64-bit ELF - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, + 2003, 2004 Free Software Foundation, Inc. -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" @@ -51,49 +51,54 @@ static bfd_vma sparc64_elf_plt_entry_offset static bfd_vma sparc64_elf_plt_ptr_offset PARAMS ((bfd_vma, bfd_vma)); -static boolean sparc64_elf_check_relocs +static bfd_boolean sparc64_elf_check_relocs PARAMS ((bfd *, struct bfd_link_info *, asection *sec, const Elf_Internal_Rela *)); -static boolean sparc64_elf_adjust_dynamic_symbol +static bfd_boolean sparc64_elf_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); -static boolean sparc64_elf_size_dynamic_sections +static bfd_boolean sparc64_elf_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); static int sparc64_elf_get_symbol_type PARAMS (( Elf_Internal_Sym *, int)); -static boolean sparc64_elf_add_symbol_hook - PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, +static bfd_boolean sparc64_elf_add_symbol_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Sym *, const char **, flagword *, asection **, bfd_vma *)); -static boolean sparc64_elf_output_arch_syms +static bfd_boolean sparc64_elf_output_arch_syms PARAMS ((bfd *, struct bfd_link_info *, PTR, - boolean (*) (PTR, const char *, Elf_Internal_Sym *, asection *))); + bfd_boolean (*) (PTR, const char *, Elf_Internal_Sym *, + asection *, struct elf_link_hash_entry *))); static void sparc64_elf_symbol_processing PARAMS ((bfd *, asymbol *)); -static boolean sparc64_elf_merge_private_bfd_data +static bfd_boolean sparc64_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); -static boolean sparc64_elf_fake_sections - PARAMS ((bfd *, Elf32_Internal_Shdr *, asection *)); +static bfd_boolean sparc64_elf_fake_sections + PARAMS ((bfd *, Elf_Internal_Shdr *, asection *)); static const char *sparc64_elf_print_symbol_all PARAMS ((bfd *, PTR, asymbol *)); -static boolean sparc64_elf_relax_section - PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); -static boolean sparc64_elf_relocate_section +static bfd_boolean sparc64_elf_new_section_hook + PARAMS ((bfd *, asection *)); +static bfd_boolean sparc64_elf_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *)); +static bfd_boolean sparc64_elf_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static boolean sparc64_elf_finish_dynamic_symbol +static bfd_boolean sparc64_elf_finish_dynamic_symbol PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static boolean sparc64_elf_finish_dynamic_sections +static bfd_boolean sparc64_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static boolean sparc64_elf_object_p PARAMS ((bfd *)); +static bfd_boolean sparc64_elf_object_p PARAMS ((bfd *)); static long sparc64_elf_get_reloc_upper_bound PARAMS ((bfd *, asection *)); static long sparc64_elf_get_dynamic_reloc_upper_bound PARAMS ((bfd *)); -static boolean sparc64_elf_slurp_one_reloc_table - PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, asymbol **, boolean)); -static boolean sparc64_elf_slurp_reloc_table - PARAMS ((bfd *, asection *, asymbol **, boolean)); +static bfd_boolean sparc64_elf_slurp_one_reloc_table + PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, asymbol **, bfd_boolean)); +static bfd_boolean sparc64_elf_slurp_reloc_table + PARAMS ((bfd *, asection *, asymbol **, bfd_boolean)); +static long sparc64_elf_canonicalize_reloc + PARAMS ((bfd *, asection *, arelent **, asymbol **)); static long sparc64_elf_canonicalize_dynamic_reloc PARAMS ((bfd *, arelent **, asymbol **)); static void sparc64_elf_write_relocs PARAMS ((bfd *, asection *, PTR)); @@ -113,65 +118,89 @@ static bfd_reloc_status_type sparc_elf_lox10_reloc static reloc_howto_type sparc64_elf_howto_table[] = { - HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", false,0,0x00000000,true), - HOWTO(R_SPARC_8, 0,0, 8,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_8", false,0,0x000000ff,true), - HOWTO(R_SPARC_16, 0,1,16,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_16", false,0,0x0000ffff,true), - HOWTO(R_SPARC_32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_32", false,0,0xffffffff,true), - HOWTO(R_SPARC_DISP8, 0,0, 8,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP8", false,0,0x000000ff,true), - HOWTO(R_SPARC_DISP16, 0,1,16,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP16", false,0,0x0000ffff,true), - HOWTO(R_SPARC_DISP32, 0,2,32,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP32", false,0,0xffffffff,true), - HOWTO(R_SPARC_WDISP30, 2,2,30,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP30", false,0,0x3fffffff,true), - HOWTO(R_SPARC_WDISP22, 2,2,22,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP22", false,0,0x003fffff,true), - HOWTO(R_SPARC_HI22, 10,2,22,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_HI22", false,0,0x003fffff,true), - HOWTO(R_SPARC_22, 0,2,22,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_22", false,0,0x003fffff,true), - HOWTO(R_SPARC_13, 0,2,13,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_13", false,0,0x00001fff,true), - HOWTO(R_SPARC_LO10, 0,2,10,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_LO10", false,0,0x000003ff,true), - HOWTO(R_SPARC_GOT10, 0,2,10,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GOT10", false,0,0x000003ff,true), - HOWTO(R_SPARC_GOT13, 0,2,13,false,0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_GOT13", false,0,0x00001fff,true), - HOWTO(R_SPARC_GOT22, 10,2,22,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GOT22", false,0,0x003fffff,true), - HOWTO(R_SPARC_PC10, 0,2,10,true, 0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_PC10", false,0,0x000003ff,true), - HOWTO(R_SPARC_PC22, 10,2,22,true, 0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PC22", false,0,0x003fffff,true), - HOWTO(R_SPARC_WPLT30, 2,2,30,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WPLT30", false,0,0x3fffffff,true), - HOWTO(R_SPARC_COPY, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_COPY", false,0,0x00000000,true), - HOWTO(R_SPARC_GLOB_DAT, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GLOB_DAT",false,0,0x00000000,true), - HOWTO(R_SPARC_JMP_SLOT, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_JMP_SLOT",false,0,0x00000000,true), - HOWTO(R_SPARC_RELATIVE, 0,0,00,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_RELATIVE",false,0,0x00000000,true), - HOWTO(R_SPARC_UA32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA32", false,0,0xffffffff,true), + HOWTO(R_SPARC_NONE, 0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_NONE", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_8, 0,0, 8,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_8", FALSE,0,0x000000ff,TRUE), + HOWTO(R_SPARC_16, 0,1,16,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_16", FALSE,0,0x0000ffff,TRUE), + HOWTO(R_SPARC_32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_32", FALSE,0,0xffffffff,TRUE), + HOWTO(R_SPARC_DISP8, 0,0, 8,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP8", FALSE,0,0x000000ff,TRUE), + HOWTO(R_SPARC_DISP16, 0,1,16,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP16", FALSE,0,0x0000ffff,TRUE), + HOWTO(R_SPARC_DISP32, 0,2,32,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP32", FALSE,0,0xffffffff,TRUE), + HOWTO(R_SPARC_WDISP30, 2,2,30,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP30", FALSE,0,0x3fffffff,TRUE), + HOWTO(R_SPARC_WDISP22, 2,2,22,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_HI22, 10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_HI22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_22, 0,2,22,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_13, 0,2,13,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_13", FALSE,0,0x00001fff,TRUE), + HOWTO(R_SPARC_LO10, 0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_LO10", FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_GOT10, 0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GOT10", FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_GOT13, 0,2,13,FALSE,0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_GOT13", FALSE,0,0x00001fff,TRUE), + HOWTO(R_SPARC_GOT22, 10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GOT22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_PC10, 0,2,10,TRUE, 0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_PC10", FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_PC22, 10,2,22,TRUE, 0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PC22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_WPLT30, 2,2,30,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WPLT30", FALSE,0,0x3fffffff,TRUE), + HOWTO(R_SPARC_COPY, 0,0,00,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_COPY", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_GLOB_DAT, 0,0,00,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_GLOB_DAT",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_JMP_SLOT, 0,0,00,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_JMP_SLOT",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_RELATIVE, 0,0,00,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_RELATIVE",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_UA32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA32", FALSE,0,0xffffffff,TRUE), #ifndef SPARC64_OLD_RELOCS - HOWTO(R_SPARC_PLT32, 0,2,32,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT32", false,0,0xffffffff,true), + HOWTO(R_SPARC_PLT32, 0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT32", FALSE,0,0xffffffff,TRUE), /* These aren't implemented yet. */ - HOWTO(R_SPARC_HIPLT22, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_HIPLT22", false,0,0x00000000,true), - HOWTO(R_SPARC_LOPLT10, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_LOPLT10", false,0,0x00000000,true), - HOWTO(R_SPARC_PCPLT32, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PCPLT32", false,0,0x00000000,true), - HOWTO(R_SPARC_PCPLT22, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PCPLT22", false,0,0x00000000,true), - HOWTO(R_SPARC_PCPLT10, 0,0,00,false,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PCPLT10", false,0,0x00000000,true), + HOWTO(R_SPARC_HIPLT22, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_HIPLT22", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_LOPLT10, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_LOPLT10", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_PCPLT32, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PCPLT32", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_PCPLT22, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PCPLT22", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_PCPLT10, 0,0,00,FALSE,0,complain_overflow_dont, sparc_elf_notsup_reloc, "R_SPARC_PCPLT10", FALSE,0,0x00000000,TRUE), #endif - HOWTO(R_SPARC_10, 0,2,10,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_10", false,0,0x000003ff,true), - HOWTO(R_SPARC_11, 0,2,11,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_11", false,0,0x000007ff,true), - HOWTO(R_SPARC_64, 0,4,64,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_64", false,0,MINUS_ONE, true), - HOWTO(R_SPARC_OLO10, 0,2,13,false,0,complain_overflow_signed, sparc_elf_notsup_reloc, "R_SPARC_OLO10", false,0,0x00001fff,true), - HOWTO(R_SPARC_HH22, 42,2,22,false,0,complain_overflow_unsigned,bfd_elf_generic_reloc, "R_SPARC_HH22", false,0,0x003fffff,true), - HOWTO(R_SPARC_HM10, 32,2,10,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_HM10", false,0,0x000003ff,true), - HOWTO(R_SPARC_LM22, 10,2,22,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_LM22", false,0,0x003fffff,true), - HOWTO(R_SPARC_PC_HH22, 42,2,22,true, 0,complain_overflow_unsigned,bfd_elf_generic_reloc, "R_SPARC_PC_HH22", false,0,0x003fffff,true), - HOWTO(R_SPARC_PC_HM10, 32,2,10,true, 0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_PC_HM10", false,0,0x000003ff,true), - HOWTO(R_SPARC_PC_LM22, 10,2,22,true, 0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_PC_LM22", false,0,0x003fffff,true), - HOWTO(R_SPARC_WDISP16, 2,2,16,true, 0,complain_overflow_signed, sparc_elf_wdisp16_reloc,"R_SPARC_WDISP16", false,0,0x00000000,true), - HOWTO(R_SPARC_WDISP19, 2,2,19,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP19", false,0,0x0007ffff,true), - HOWTO(R_SPARC_UNUSED_42, 0,0, 0,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_UNUSED_42",false,0,0x00000000,true), - HOWTO(R_SPARC_7, 0,2, 7,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_7", false,0,0x0000007f,true), - HOWTO(R_SPARC_5, 0,2, 5,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_5", false,0,0x0000001f,true), - HOWTO(R_SPARC_6, 0,2, 6,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_6", false,0,0x0000003f,true), - HOWTO(R_SPARC_DISP64, 0,4,64,true, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP64", false,0,MINUS_ONE, true), - HOWTO(R_SPARC_PLT64, 0,4,64,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT64", false,0,MINUS_ONE, true), - HOWTO(R_SPARC_HIX22, 0,4, 0,false,0,complain_overflow_bitfield,sparc_elf_hix22_reloc, "R_SPARC_HIX22", false,0,MINUS_ONE, false), - HOWTO(R_SPARC_LOX10, 0,4, 0,false,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_LOX10", false,0,MINUS_ONE, false), - HOWTO(R_SPARC_H44, 22,2,22,false,0,complain_overflow_unsigned,bfd_elf_generic_reloc, "R_SPARC_H44", false,0,0x003fffff,false), - HOWTO(R_SPARC_M44, 12,2,10,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_M44", false,0,0x000003ff,false), - HOWTO(R_SPARC_L44, 0,2,13,false,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_L44", false,0,0x00000fff,false), - HOWTO(R_SPARC_REGISTER, 0,4, 0,false,0,complain_overflow_bitfield,sparc_elf_notsup_reloc, "R_SPARC_REGISTER",false,0,MINUS_ONE, false), - HOWTO(R_SPARC_UA64, 0,4,64,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA64", false,0,MINUS_ONE, true), - HOWTO(R_SPARC_UA16, 0,1,16,false,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA16", false,0,0x0000ffff,true) + HOWTO(R_SPARC_10, 0,2,10,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_10", FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_11, 0,2,11,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_11", FALSE,0,0x000007ff,TRUE), + HOWTO(R_SPARC_64, 0,4,64,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_64", FALSE,0,MINUS_ONE, TRUE), + HOWTO(R_SPARC_OLO10, 0,2,13,FALSE,0,complain_overflow_signed, sparc_elf_notsup_reloc, "R_SPARC_OLO10", FALSE,0,0x00001fff,TRUE), + HOWTO(R_SPARC_HH22, 42,2,22,FALSE,0,complain_overflow_unsigned,bfd_elf_generic_reloc, "R_SPARC_HH22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_HM10, 32,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_HM10", FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_LM22, 10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_LM22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_PC_HH22, 42,2,22,TRUE, 0,complain_overflow_unsigned,bfd_elf_generic_reloc, "R_SPARC_PC_HH22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_PC_HM10, 32,2,10,TRUE, 0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_PC_HM10", FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_PC_LM22, 10,2,22,TRUE, 0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_PC_LM22", FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_WDISP16, 2,2,16,TRUE, 0,complain_overflow_signed, sparc_elf_wdisp16_reloc,"R_SPARC_WDISP16", FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_WDISP19, 2,2,19,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_WDISP19", FALSE,0,0x0007ffff,TRUE), + HOWTO(R_SPARC_UNUSED_42, 0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_UNUSED_42",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_7, 0,2, 7,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_7", FALSE,0,0x0000007f,TRUE), + HOWTO(R_SPARC_5, 0,2, 5,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_5", FALSE,0,0x0000001f,TRUE), + HOWTO(R_SPARC_6, 0,2, 6,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_6", FALSE,0,0x0000003f,TRUE), + HOWTO(R_SPARC_DISP64, 0,4,64,TRUE, 0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_DISP64", FALSE,0,MINUS_ONE, TRUE), + HOWTO(R_SPARC_PLT64, 0,4,64,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_PLT64", FALSE,0,MINUS_ONE, TRUE), + HOWTO(R_SPARC_HIX22, 0,4, 0,FALSE,0,complain_overflow_bitfield,sparc_elf_hix22_reloc, "R_SPARC_HIX22", FALSE,0,MINUS_ONE, FALSE), + HOWTO(R_SPARC_LOX10, 0,4, 0,FALSE,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_LOX10", FALSE,0,MINUS_ONE, FALSE), + HOWTO(R_SPARC_H44, 22,2,22,FALSE,0,complain_overflow_unsigned,bfd_elf_generic_reloc, "R_SPARC_H44", FALSE,0,0x003fffff,FALSE), + HOWTO(R_SPARC_M44, 12,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_M44", FALSE,0,0x000003ff,FALSE), + HOWTO(R_SPARC_L44, 0,2,13,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_L44", FALSE,0,0x00000fff,FALSE), + HOWTO(R_SPARC_REGISTER, 0,4, 0,FALSE,0,complain_overflow_bitfield,sparc_elf_notsup_reloc, "R_SPARC_REGISTER",FALSE,0,MINUS_ONE, FALSE), + HOWTO(R_SPARC_UA64, 0,4,64,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA64", FALSE,0,MINUS_ONE, TRUE), + HOWTO(R_SPARC_UA16, 0,1,16,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc, "R_SPARC_UA16", FALSE,0,0x0000ffff,TRUE), + HOWTO(R_SPARC_TLS_GD_HI22,10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_HI22",FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_TLS_GD_LO10,0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_LO10",FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_TLS_GD_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_GD_CALL,2,2,30,TRUE,0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_TLS_GD_CALL",FALSE,0,0x3fffffff,TRUE), + HOWTO(R_SPARC_TLS_LDM_HI22,10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_HI22",FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_TLS_LDM_LO10,0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_LO10",FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_TLS_LDM_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_LDM_CALL,2,2,30,TRUE,0,complain_overflow_signed, bfd_elf_generic_reloc, "R_SPARC_TLS_LDM_CALL",FALSE,0,0x3fffffff,TRUE), + HOWTO(R_SPARC_TLS_LDO_HIX22,0,2,0,FALSE,0,complain_overflow_bitfield,sparc_elf_hix22_reloc,"R_SPARC_TLS_LDO_HIX22",FALSE,0,0x003fffff, FALSE), + HOWTO(R_SPARC_TLS_LDO_LOX10,0,2,0,FALSE,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_TLS_LDO_LOX10",FALSE,0,0x000003ff, FALSE), + HOWTO(R_SPARC_TLS_LDO_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_LDO_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_IE_HI22,10,2,22,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_HI22",FALSE,0,0x003fffff,TRUE), + HOWTO(R_SPARC_TLS_IE_LO10,0,2,10,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_LO10",FALSE,0,0x000003ff,TRUE), + HOWTO(R_SPARC_TLS_IE_LD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_LD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_IE_LDX,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_LDX",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_IE_ADD,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_IE_ADD",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_LE_HIX22,0,2,0,FALSE,0,complain_overflow_bitfield,sparc_elf_hix22_reloc, "R_SPARC_TLS_LE_HIX22",FALSE,0,0x003fffff, FALSE), + HOWTO(R_SPARC_TLS_LE_LOX10,0,2,0,FALSE,0,complain_overflow_dont, sparc_elf_lox10_reloc, "R_SPARC_TLS_LE_LOX10",FALSE,0,0x000003ff, FALSE), + HOWTO(R_SPARC_TLS_DTPMOD32,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_DTPMOD32",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_DTPMOD64,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_DTPMOD64",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_DTPOFF32,0,2,32,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc,"R_SPARC_TLS_DTPOFF32",FALSE,0,0xffffffff,TRUE), + HOWTO(R_SPARC_TLS_DTPOFF64,0,4,64,FALSE,0,complain_overflow_bitfield,bfd_elf_generic_reloc,"R_SPARC_TLS_DTPOFF64",FALSE,0,MINUS_ONE,TRUE), + HOWTO(R_SPARC_TLS_TPOFF32,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_TPOFF32",FALSE,0,0x00000000,TRUE), + HOWTO(R_SPARC_TLS_TPOFF64,0,0, 0,FALSE,0,complain_overflow_dont, bfd_elf_generic_reloc, "R_SPARC_TLS_TPOFF64",FALSE,0,0x00000000,TRUE) }; struct elf_reloc_map { @@ -225,6 +254,30 @@ static const struct elf_reloc_map sparc_reloc_map[] = { BFD_RELOC_SPARC_5, R_SPARC_5 }, { BFD_RELOC_SPARC_6, R_SPARC_6 }, { BFD_RELOC_SPARC_DISP64, R_SPARC_DISP64 }, + { BFD_RELOC_SPARC_TLS_GD_HI22, R_SPARC_TLS_GD_HI22 }, + { BFD_RELOC_SPARC_TLS_GD_LO10, R_SPARC_TLS_GD_LO10 }, + { BFD_RELOC_SPARC_TLS_GD_ADD, R_SPARC_TLS_GD_ADD }, + { BFD_RELOC_SPARC_TLS_GD_CALL, R_SPARC_TLS_GD_CALL }, + { BFD_RELOC_SPARC_TLS_LDM_HI22, R_SPARC_TLS_LDM_HI22 }, + { BFD_RELOC_SPARC_TLS_LDM_LO10, R_SPARC_TLS_LDM_LO10 }, + { BFD_RELOC_SPARC_TLS_LDM_ADD, R_SPARC_TLS_LDM_ADD }, + { BFD_RELOC_SPARC_TLS_LDM_CALL, R_SPARC_TLS_LDM_CALL }, + { BFD_RELOC_SPARC_TLS_LDO_HIX22, R_SPARC_TLS_LDO_HIX22 }, + { BFD_RELOC_SPARC_TLS_LDO_LOX10, R_SPARC_TLS_LDO_LOX10 }, + { BFD_RELOC_SPARC_TLS_LDO_ADD, R_SPARC_TLS_LDO_ADD }, + { BFD_RELOC_SPARC_TLS_IE_HI22, R_SPARC_TLS_IE_HI22 }, + { BFD_RELOC_SPARC_TLS_IE_LO10, R_SPARC_TLS_IE_LO10 }, + { BFD_RELOC_SPARC_TLS_IE_LD, R_SPARC_TLS_IE_LD }, + { BFD_RELOC_SPARC_TLS_IE_LDX, R_SPARC_TLS_IE_LDX }, + { BFD_RELOC_SPARC_TLS_IE_ADD, R_SPARC_TLS_IE_ADD }, + { BFD_RELOC_SPARC_TLS_LE_HIX22, R_SPARC_TLS_LE_HIX22 }, + { BFD_RELOC_SPARC_TLS_LE_LOX10, R_SPARC_TLS_LE_LOX10 }, + { BFD_RELOC_SPARC_TLS_DTPMOD32, R_SPARC_TLS_DTPMOD32 }, + { BFD_RELOC_SPARC_TLS_DTPMOD64, R_SPARC_TLS_DTPMOD64 }, + { BFD_RELOC_SPARC_TLS_DTPOFF32, R_SPARC_TLS_DTPOFF32 }, + { BFD_RELOC_SPARC_TLS_DTPOFF64, R_SPARC_TLS_DTPOFF64 }, + { BFD_RELOC_SPARC_TLS_TPOFF32, R_SPARC_TLS_TPOFF32 }, + { BFD_RELOC_SPARC_TLS_TPOFF64, R_SPARC_TLS_TPOFF64 }, #ifndef SPARC64_OLD_RELOCS { BFD_RELOC_SPARC_PLT32, R_SPARC_PLT32 }, #endif @@ -255,12 +308,23 @@ static void sparc64_elf_info_to_howto (abfd, cache_ptr, dst) bfd *abfd ATTRIBUTE_UNUSED; arelent *cache_ptr; - Elf64_Internal_Rela *dst; + Elf_Internal_Rela *dst; { BFD_ASSERT (ELF64_R_TYPE_ID (dst->r_info) < (unsigned int) R_SPARC_max_std); cache_ptr->howto = &sparc64_elf_howto_table[ELF64_R_TYPE_ID (dst->r_info)]; } +struct sparc64_elf_section_data +{ + struct bfd_elf_section_data elf; + unsigned int do_relax, reloc_count; +}; + +#define sec_do_relax(sec) \ + ((struct sparc64_elf_section_data *) elf_section_data (sec))->do_relax +#define canon_reloc_count(sec) \ + ((struct sparc64_elf_section_data *) elf_section_data (sec))->reloc_count + /* 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. */ @@ -285,13 +349,13 @@ sparc64_elf_get_dynamic_reloc_upper_bound (abfd) 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. */ -static boolean +static bfd_boolean sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic) bfd *abfd; asection *asect; Elf_Internal_Shdr *rel_hdr; asymbol **symbols; - boolean dynamic; + bfd_boolean dynamic; { PTR allocated = NULL; bfd_byte *native_relocs; @@ -311,7 +375,7 @@ sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic) native_relocs = (bfd_byte *) allocated; - relents = asect->relocation + asect->reloc_count; + relents = asect->relocation + canon_reloc_count (asect); entsize = rel_hdr->sh_entsize; BFD_ASSERT (entsize == sizeof (Elf64_External_Rela)); @@ -323,7 +387,7 @@ sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic) { Elf_Internal_Rela rela; - bfd_elf64_swap_reloca_in (abfd, (Elf64_External_Rela *) native_relocs, &rela); + bfd_elf64_swap_reloca_in (abfd, native_relocs, &rela); /* The address of an ELF reloc is section relative for an object file, and absolute for an executable file or shared library. @@ -366,27 +430,27 @@ sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic) relent->howto = &sparc64_elf_howto_table[ELF64_R_TYPE_ID (rela.r_info)]; } - asect->reloc_count += relent - relents; + canon_reloc_count (asect) += relent - relents; if (allocated != NULL) free (allocated); - return true; + return TRUE; error_return: if (allocated != NULL) free (allocated); - return false; + return FALSE; } /* Read in and swap the external relocs. */ -static boolean +static bfd_boolean sparc64_elf_slurp_reloc_table (abfd, asect, symbols, dynamic) bfd *abfd; asection *asect; asymbol **symbols; - boolean dynamic; + bfd_boolean dynamic; { struct bfd_elf_section_data * const d = elf_section_data (asect); Elf_Internal_Shdr *rel_hdr; @@ -394,13 +458,13 @@ sparc64_elf_slurp_reloc_table (abfd, asect, symbols, dynamic) bfd_size_type amt; if (asect->relocation != NULL) - return true; + return TRUE; if (! dynamic) { if ((asect->flags & SEC_RELOC) == 0 || asect->reloc_count == 0) - return true; + return TRUE; rel_hdr = &d->rel_hdr; rel_hdr2 = d->rel_hdr2; @@ -415,7 +479,7 @@ sparc64_elf_slurp_reloc_table (abfd, asect, symbols, dynamic) dynamic symbol table, and in that case bfd_section_from_shdr in elf.c does not update the RELOC_COUNT. */ if (asect->_raw_size == 0) - return true; + return TRUE; rel_hdr = &d->this_hdr; asect->reloc_count = NUM_SHDR_ENTRIES (rel_hdr); @@ -426,23 +490,50 @@ sparc64_elf_slurp_reloc_table (abfd, asect, symbols, dynamic) amt *= 2 * sizeof (arelent); asect->relocation = (arelent *) bfd_alloc (abfd, amt); if (asect->relocation == NULL) - return false; + return FALSE; - /* The sparc64_elf_slurp_one_reloc_table routine increments reloc_count. */ - asect->reloc_count = 0; + /* The sparc64_elf_slurp_one_reloc_table routine increments + canon_reloc_count. */ + canon_reloc_count (asect) = 0; if (!sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic)) - return false; + return FALSE; if (rel_hdr2 && !sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr2, symbols, dynamic)) - return false; + return FALSE; - return true; + return TRUE; } +/* Canonicalize the relocs. */ + +static long +sparc64_elf_canonicalize_reloc (abfd, section, relptr, symbols) + bfd *abfd; + sec_ptr section; + arelent **relptr; + asymbol **symbols; +{ + arelent *tblptr; + unsigned int i; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + + if (! bed->s->slurp_reloc_table (abfd, section, symbols, FALSE)) + return -1; + + tblptr = section->relocation; + for (i = 0; i < canon_reloc_count (section); i++) + *relptr++ = tblptr++; + + *relptr = NULL; + + return canon_reloc_count (section); +} + + /* Canonicalize the dynamic relocation entries. Note that we return the dynamic relocations as a single block, although they are actually associated with particular sections; the interface, which @@ -476,9 +567,9 @@ sparc64_elf_canonicalize_dynamic_reloc (abfd, storage, syms) arelent *p; long count, i; - if (! sparc64_elf_slurp_reloc_table (abfd, s, syms, true)) + if (! sparc64_elf_slurp_reloc_table (abfd, s, syms, TRUE)) return -1; - count = s->reloc_count; + count = canon_reloc_count (s); p = s->relocation; for (i = 0; i < count; i++) *storage++ = p++; @@ -499,7 +590,7 @@ sparc64_elf_write_relocs (abfd, sec, data) asection *sec; PTR data; { - boolean *failedp = (boolean *) data; + bfd_boolean *failedp = (bfd_boolean *) data; Elf_Internal_Shdr *rela_hdr; Elf64_External_Rela *outbound_relocas, *src_rela; unsigned int idx, count; @@ -550,7 +641,7 @@ sparc64_elf_write_relocs (abfd, sec, data) rela_hdr->contents = (PTR) bfd_alloc (abfd, rela_hdr->sh_size); if (rela_hdr->contents == NULL) { - *failedp = true; + *failedp = TRUE; return; } @@ -590,7 +681,7 @@ sparc64_elf_write_relocs (abfd, sec, data) n = _bfd_elf_symbol_from_bfd_symbol (abfd, &sym); if (n < 0) { - *failedp = true; + *failedp = TRUE; return; } last_sym_idx = n; @@ -600,7 +691,7 @@ sparc64_elf_write_relocs (abfd, sec, data) && (*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec && ! _bfd_elf_validate_reloc (abfd, ptr)) { - *failedp = true; + *failedp = TRUE; return; } @@ -626,7 +717,7 @@ sparc64_elf_write_relocs (abfd, sec, data) dst_rela.r_info = ELF64_R_INFO (n, ptr->howto->type); dst_rela.r_addend = ptr->addend; - bfd_elf64_swap_reloca_out (abfd, &dst_rela, src_rela); + bfd_elf64_swap_reloca_out (abfd, &dst_rela, (bfd_byte *) src_rela); ++src_rela; } } @@ -714,7 +805,7 @@ init_insn_reloc (abfd, return bfd_reloc_ok; } - /* This works because partial_inplace is false. */ + /* This works because partial_inplace is FALSE. */ if (output_bfd != NULL) return bfd_reloc_continue; @@ -994,7 +1085,7 @@ sparc64_elf_plt_ptr_offset (index, max) allocate space in the global offset table or procedure linkage table. */ -static boolean +static bfd_boolean sparc64_elf_check_relocs (abfd, info, sec, relocs) bfd *abfd; struct bfd_link_info *info; @@ -1011,8 +1102,8 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) asection *srelgot; asection *sreloc; - if (info->relocateable || !(sec->flags & SEC_ALLOC)) - return true; + if (info->relocatable || !(sec->flags & SEC_ALLOC)) + return TRUE; dynobj = elf_hash_table (info)->dynobj; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -1047,7 +1138,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) /* Create the .got section. */ elf_hash_table (info)->dynobj = dynobj = abfd; if (! _bfd_elf_create_got_section (dynobj, info)) - return false; + return FALSE; } if (sgot == NULL) @@ -1071,7 +1162,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) | SEC_LINKER_CREATED | SEC_READONLY)) || ! bfd_set_section_alignment (dynobj, srelgot, 3)) - return false; + return FALSE; } } @@ -1087,8 +1178,8 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) /* 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; + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } srelgot->_raw_size += sizeof (Elf64_External_Rela); @@ -1106,7 +1197,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) size *= sizeof (bfd_vma); local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size); if (local_got_offsets == NULL) - return false; + 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; @@ -1164,14 +1255,14 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) /* It does not make sense to have a procedure linkage table entry for a local symbol. */ bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } /* 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; + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; @@ -1243,7 +1334,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) elf_elfheader (abfd)->e_shstrndx, elf_section_data (sec)->rel_hdr.sh_name)); if (name == NULL) - return false; + return FALSE; BFD_ASSERT (strncmp (name, ".rela", 5) == 0 && strcmp (bfd_get_section_name (abfd, sec), @@ -1262,7 +1353,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) if (sreloc == NULL || ! bfd_set_section_flags (dynobj, sreloc, flags) || ! bfd_set_section_alignment (dynobj, sreloc, 3)) - return false; + return FALSE; } if (sec->flags & SEC_READONLY) info->flags |= DF_TEXTREL; @@ -1280,21 +1371,21 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) (*_bfd_error_handler) (_("%s: check_relocs: unhandled reloc type %d"), bfd_archive_filename (abfd), ELF64_R_TYPE_ID (rel->r_info)); - return false; + return FALSE; } } - return true; + return TRUE; } /* Hook called by the linker routine which adds symbols from an object file. We use it for STT_REGISTER symbols. */ -static boolean +static bfd_boolean sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd *abfd; struct bfd_link_info *info; - const Elf_Internal_Sym *sym; + Elf_Internal_Sym *sym; const char **namep; flagword *flagsp ATTRIBUTE_UNUSED; asection **secp ATTRIBUTE_UNUSED; @@ -1316,7 +1407,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) (*_bfd_error_handler) (_("%s: Only registers %%g[2367] can be declared using STT_REGISTER"), bfd_archive_filename (abfd)); - return false; + return FALSE; } if (info->hash->creator != abfd->xvec @@ -1326,7 +1417,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) If STT_REGISTER comes from a dynamic object, don't put it into the output bfd. The dynamic linker will recheck it. */ *namep = NULL; - return true; + return TRUE; } p = sparc64_elf_hash_table(info)->app_regs + reg; @@ -1338,7 +1429,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) (int) sym->st_value, **namep ? *namep : "#scratch", bfd_archive_filename (abfd), *p->name ? p->name : "#scratch", bfd_archive_filename (p->abfd)); - return false; + return FALSE; } if (p->name == NULL) @@ -1348,7 +1439,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) struct elf_link_hash_entry *h; h = (struct elf_link_hash_entry *) - bfd_link_hash_lookup (info->hash, *namep, false, false, false); + bfd_link_hash_lookup (info->hash, *namep, FALSE, FALSE, FALSE); if (h != NULL) { @@ -1360,13 +1451,13 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) (_("Symbol `%s' has differing types: REGISTER in %s, previously %s in %s"), *namep, bfd_archive_filename (abfd), stt_types[type], bfd_archive_filename (p->abfd)); - return false; + return FALSE; } p->name = bfd_hash_allocate (&info->hash->table, strlen (*namep) + 1); if (!p->name) - return false; + return FALSE; strcpy (p->name, *namep); } @@ -1386,7 +1477,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) } } *namep = NULL; - return true; + return TRUE; } else if (*namep && **namep && info->hash->creator == abfd->xvec) @@ -1406,22 +1497,23 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) (_("Symbol `%s' has differing types: %s in %s, previously REGISTER in %s"), *namep, stt_types[type], bfd_archive_filename (abfd), bfd_archive_filename (p->abfd)); - return false; + return FALSE; } } - return true; + return TRUE; } -/* This function takes care of emiting STT_REGISTER symbols +/* This function takes care of emitting STT_REGISTER symbols which we cannot easily keep in the symbol hash table. */ -static boolean +static bfd_boolean sparc64_elf_output_arch_syms (output_bfd, info, finfo, func) bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; PTR finfo; - boolean (*func) PARAMS ((PTR, const char *, - Elf_Internal_Sym *, asection *)); + bfd_boolean (*func) + PARAMS ((PTR, const char *, Elf_Internal_Sym *, asection *, + struct elf_link_hash_entry *)); { int reg; struct sparc64_elf_app_reg *app_regs = @@ -1449,7 +1541,7 @@ sparc64_elf_output_arch_syms (output_bfd, info, finfo, func) } if (info->strip == strip_all) - return true; + return TRUE; for (reg = 0; reg < 4; reg++) if (app_regs [reg].name != NULL) @@ -1457,7 +1549,7 @@ sparc64_elf_output_arch_syms (output_bfd, info, finfo, func) if (info->strip == strip_some && bfd_hash_lookup (info->keep_hash, app_regs [reg].name, - false, false) == NULL) + FALSE, FALSE) == NULL) continue; sym.st_value = reg < 2 ? reg + 2 : reg + 4; @@ -1467,11 +1559,12 @@ sparc64_elf_output_arch_syms (output_bfd, info, finfo, func) sym.st_shndx = app_regs [reg].shndx; if (! (*func) (finfo, app_regs [reg].name, &sym, sym.st_shndx == SHN_ABS - ? bfd_abs_section_ptr : bfd_und_section_ptr)) - return false; + ? bfd_abs_section_ptr : bfd_und_section_ptr, + NULL)) + return FALSE; } - return true; + return TRUE; } static int @@ -1509,7 +1602,7 @@ sparc64_elf_symbol_processing (abfd, asym) change the definition to something the rest of the link can understand. */ -static boolean +static bfd_boolean sparc64_elf_adjust_dynamic_symbol (info, h) struct bfd_link_info *info; struct elf_link_hash_entry *h; @@ -1553,7 +1646,7 @@ sparc64_elf_adjust_dynamic_symbol (info, h) procedure linkage table, and we can just do a WDISP30 reloc instead. */ BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0); - return true; + return TRUE; } s = bfd_get_section_by_name (dynobj, ".plt"); @@ -1593,10 +1686,10 @@ sparc64_elf_adjust_dynamic_symbol (info, h) if (s->_raw_size >= (bfd_vma)1 << 32) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } - return true; + return TRUE; } /* If this is a weak symbol, and there is a real definition, the @@ -1608,7 +1701,7 @@ sparc64_elf_adjust_dynamic_symbol (info, h) || 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; + return TRUE; } /* This is a reference to a symbol defined by a dynamic object which @@ -1619,7 +1712,7 @@ sparc64_elf_adjust_dynamic_symbol (info, h) For such cases we need not do anything here; the relocations will be handled correctly by relocate_section. */ if (info->shared) - return true; + 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 @@ -1661,7 +1754,7 @@ sparc64_elf_adjust_dynamic_symbol (info, h) if (power_of_two > bfd_get_section_alignment (dynobj, s)) { if (! bfd_set_section_alignment (dynobj, s, power_of_two)) - return false; + return FALSE; } /* Define the symbol as being at this point in the section. */ @@ -1671,19 +1764,19 @@ sparc64_elf_adjust_dynamic_symbol (info, h) /* Increment the section size to make room for the symbol. */ s->_raw_size += h->size; - return true; + return TRUE; } /* Set the sizes of the dynamic sections. */ -static boolean +static bfd_boolean sparc64_elf_size_dynamic_sections (output_bfd, info) bfd *output_bfd; struct bfd_link_info *info; { bfd *dynobj; asection *s; - boolean relplt; + bfd_boolean relplt; dynobj = elf_hash_table (info)->dynobj; BFD_ASSERT (dynobj != NULL); @@ -1691,7 +1784,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) if (elf_hash_table (info)->dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (s != NULL); @@ -1714,11 +1807,11 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate memory for them. */ - relplt = false; + relplt = FALSE; for (s = dynobj->sections; s != NULL; s = s->next) { const char *name; - boolean strip; + bfd_boolean strip; if ((s->flags & SEC_LINKER_CREATED) == 0) continue; @@ -1727,7 +1820,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) of the dynobj section names depend upon the input files. */ name = bfd_get_section_name (dynobj, s); - strip = false; + strip = FALSE; if (strncmp (name, ".rela", 5) == 0) { @@ -1742,12 +1835,12 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) adjust_dynamic_symbol is called, and it is that function which decides whether anything needs to go into these sections. */ - strip = true; + strip = TRUE; } else { if (strcmp (name, ".rela.plt") == 0) - relplt = true; + relplt = TRUE; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -1772,7 +1865,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) at the beginning, and we don't want garbage. */ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) - return false; + return FALSE; } if (elf_hash_table (info)->dynamic_sections_created) @@ -1783,17 +1876,17 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ #define add_dynamic_entry(TAG, VAL) \ - bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + _bfd_elf_add_dynamic_entry (info, TAG, VAL) int reg; struct sparc64_elf_app_reg * app_regs; struct elf_strtab_hash *dynstr; struct elf_link_hash_table *eht = elf_hash_table (info); - if (!info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) - return false; + return FALSE; } if (relplt) @@ -1802,18 +1895,18 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) || !add_dynamic_entry (DT_PLTRELSZ, 0) || !add_dynamic_entry (DT_PLTREL, DT_RELA) || !add_dynamic_entry (DT_JMPREL, 0)) - return false; + return FALSE; } if (!add_dynamic_entry (DT_RELA, 0) || !add_dynamic_entry (DT_RELASZ, 0) || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) - return false; + return FALSE; if (info->flags & DF_TEXTREL) { if (!add_dynamic_entry (DT_TEXTREL, 0)) - return false; + return FALSE; } /* Add dynamic STT_REGISTER symbols and corresponding DT_SPARC_REGISTER @@ -1827,12 +1920,12 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) struct elf_link_local_dynamic_entry *entry, *e; if (!add_dynamic_entry (DT_SPARC_REGISTER, 0)) - return false; + return FALSE; entry = (struct elf_link_local_dynamic_entry *) bfd_hash_allocate (&info->hash->table, sizeof (*entry)); if (entry == NULL) - return false; + return FALSE; /* We cheat here a little bit: the symbol will not be local, so we put it at the end of the dynlocal linked list. We will fix it @@ -1841,7 +1934,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) entry->isym.st_size = 0; if (*app_regs [reg].name != '\0') entry->isym.st_name - = _bfd_elf_strtab_add (dynstr, app_regs[reg].name, false); + = _bfd_elf_strtab_add (dynstr, app_regs[reg].name, FALSE); else entry->isym.st_name = 0; entry->isym.st_other = 0; @@ -1865,38 +1958,40 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) } #undef add_dynamic_entry - return true; + 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 bfd_boolean +sparc64_elf_new_section_hook (abfd, sec) + bfd *abfd; + asection *sec; +{ + struct sparc64_elf_section_data *sdata; + bfd_size_type amt = sizeof (*sdata); + + sdata = (struct sparc64_elf_section_data *) bfd_zalloc (abfd, amt); + if (sdata == NULL) + return FALSE; + sec->used_by_bfd = (PTR) sdata; -static boolean + return _bfd_elf_new_section_hook (abfd, sec); +} + +static bfd_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; + bfd_boolean *again; { - *again = false; - SET_SEC_DO_RELAX (section); - return true; + *again = FALSE; + sec_do_relax (section) = 1; + return TRUE; } -/* This is the condition under which finish_dynamic_symbol will be called - from elflink.h. If elflink.h doesn't call our finish_dynamic_symbol - routine, we'll need to do something about initializing any .plt and - .got entries in relocate_section. */ -#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ - ((DYN) \ - && ((INFO)->shared \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ - && ((H)->dynindx != -1 \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) - /* Relocate a SPARC64 ELF section. */ -static boolean +static bfd_boolean sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, local_syms, local_sections) bfd *output_bfd; @@ -1919,6 +2014,9 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; + if (info->relocatable) + return TRUE; + dynobj = elf_hash_table (info)->dynobj; symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; sym_hashes = elf_sym_hashes (input_bfd); @@ -1930,6 +2028,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, got_base = elf_hash_table (info)->hgot->root.u.def.value; sgot = splt = sreloc = NULL; + if (dynobj != NULL) + splt = bfd_get_section_by_name (dynobj, ".plt"); rel = relocs; relend = relocs + NUM_SHDR_ENTRIES (& elf_section_data (input_section)->rel_hdr); @@ -1943,92 +2043,42 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, asection *sec; bfd_vma relocation, off; bfd_reloc_status_type r; - boolean is_plt = false; - boolean unresolved_reloc; + bfd_boolean is_plt = FALSE; + bfd_boolean unresolved_reloc; r_type = ELF64_R_TYPE_ID (rel->r_info); if (r_type < 0 || r_type >= (int) R_SPARC_max_std) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } howto = sparc64_elf_howto_table + r_type; - r_symndx = ELF64_R_SYM (rel->r_info); - - if (info->relocateable) - { - /* This is a relocateable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sec = local_sections[r_symndx]; - rel->r_addend += sec->output_offset + sym->st_value; - } - } - - continue; - } - /* This is a final link. */ + r_symndx = ELF64_R_SYM (rel->r_info); h = NULL; sym = NULL; sec = NULL; - unresolved_reloc = false; + unresolved_reloc = FALSE; if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; sec = local_sections[r_symndx]; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); } 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; + bfd_boolean warned; - relocation = 0; - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - sec = h->root.u.def.section; - if (sec->output_section == NULL) - /* Set a flag that will be cleared later if we find a - relocation value for this symbol. output_section - is typically NULL for symbols satisfied by a shared - library. */ - unresolved_reloc = true; - else - relocation = (h->root.u.def.value - + sec->output_section->vma - + sec->output_offset); - } - else if (h->root.type == bfd_link_hash_undefweak) - ; - else if (info->shared - && (!info->symbolic || info->allow_shlib_undefined) - && !info->no_undefined - && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - ; - else + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); + if (warned) { - 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; - /* 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 @@ -2090,7 +2140,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_SPARC_UA16: { Elf_Internal_Rela outrel; - boolean skip, relocate; + bfd_byte *loc; + bfd_boolean skip, relocate; if (sreloc == NULL) { @@ -2101,7 +2152,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, elf_section_data (input_section)->rel_hdr.sh_name)); if (name == NULL) - return false; + return FALSE; BFD_ASSERT (strncmp (name, ".rela", 5) == 0 && strcmp (bfd_get_section_name(input_bfd, @@ -2112,16 +2163,16 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, BFD_ASSERT (sreloc != NULL); } - skip = false; - relocate = false; + skip = FALSE; + relocate = FALSE; outrel.r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, rel->r_offset); if (outrel.r_offset == (bfd_vma) -1) - skip = true; + skip = TRUE; else if (outrel.r_offset == (bfd_vma) -2) - skip = true, relocate = true; + skip = TRUE, relocate = TRUE; outrel.r_offset += (input_section->output_section->vma + input_section->output_offset); @@ -2158,7 +2209,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, FIXME: Add code tracking needed dynamic relocs as e.g. i386 has. */ if (h->dynindx == -1) - skip = true, relocate = true; + skip = TRUE, relocate = TRUE; break; } @@ -2190,21 +2241,13 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (is_plt) sec = splt; - else if (h == NULL) - sec = local_sections[r_symndx]; - else - { - BFD_ASSERT (h->root.type == bfd_link_hash_defined - || (h->root.type - == bfd_link_hash_defweak)); - sec = h->root.u.def.section; - } - if (sec != NULL && bfd_is_abs_section (sec)) + + if (bfd_is_abs_section (sec)) indx = 0; else if (sec == NULL || sec->owner == NULL) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } else { @@ -2229,7 +2272,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, (_("%s: probably compiled without -fPIC?"), bfd_archive_filename (input_bfd)); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } } @@ -2241,11 +2284,9 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } } - bfd_elf64_swap_reloca_out (output_bfd, &outrel, - (((Elf64_External_Rela *) - sreloc->contents) - + sreloc->reloc_count)); - ++sreloc->reloc_count; + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); /* This reloc will be computed at runtime, so there's no need to do anything now. */ @@ -2271,13 +2312,13 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (h != NULL) { - boolean dyn; + bfd_boolean dyn; off = h->got.offset; BFD_ASSERT (off != (bfd_vma) -1); dyn = elf_hash_table (info)->dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) || (info->shared && (info->symbolic || h->dynindx == -1 @@ -2306,7 +2347,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } } else - unresolved_reloc = false; + unresolved_reloc = FALSE; } else { @@ -2325,8 +2366,9 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (info->shared) { - asection *srelgot; + asection *s; Elf_Internal_Rela outrel; + bfd_byte *loc; /* The Solaris 2.7 64-bit linker adds the contents of the location to the value of the reloc. @@ -2338,19 +2380,17 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* We need to generate a R_SPARC_RELATIVE reloc for the dynamic linker. */ - srelgot = bfd_get_section_by_name(dynobj, ".rela.got"); - BFD_ASSERT (srelgot != NULL); + s = bfd_get_section_by_name(dynobj, ".rela.got"); + BFD_ASSERT (s != NULL); outrel.r_offset = (sgot->output_section->vma + sgot->output_offset + off); outrel.r_info = ELF64_R_INFO (0, R_SPARC_RELATIVE); outrel.r_addend = relocation; - bfd_elf64_swap_reloca_out (output_bfd, &outrel, - (((Elf64_External_Rela *) - srelgot->contents) - + srelgot->reloc_count)); - ++srelgot->reloc_count; + loc = s->contents; + loc += s->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); } else bfd_put_64 (output_bfd, relocation, sgot->contents + off); @@ -2371,7 +2411,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, procedure linkage table. */ BFD_ASSERT (h != NULL); - 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 @@ -2379,22 +2419,16 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, goto do_default; } - if (splt == NULL) - { - splt = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (splt != NULL); - } - relocation = (splt->output_section->vma + splt->output_offset + sparc64_elf_plt_entry_offset (h->plt.offset)); - unresolved_reloc = false; + unresolved_reloc = FALSE; if (r_type == R_SPARC_WPLT30) goto do_wplt30; if (r_type == R_SPARC_PLT32 || r_type == R_SPARC_PLT64) { r_type = r_type == R_SPARC_PLT32 ? R_SPARC_32 : R_SPARC_64; - is_plt = true; + is_plt = TRUE; goto do_dynreloc; } goto do_default; @@ -2475,7 +2509,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, case R_SPARC_WDISP30: do_wplt30: - if (SEC_DO_RELAX (input_section) + if (sec_do_relax (input_section) && rel->r_offset + 4 < input_section->_raw_size) { #define G0 0 @@ -2562,7 +2596,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } } } - /* FALLTHROUGH */ + /* Fall through. */ default: do_default: @@ -2601,11 +2635,10 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* The Solaris native linker silently disregards overflows. We don't, but this breaks stabs debugging info, whose relocations are only 32-bits wide. Ignore - overflows in this case. */ - if (r_type == R_SPARC_32 - && (input_section->flags & SEC_DEBUGGING) != 0 - && strcmp (bfd_section_name (input_bfd, input_section), - ".stab") == 0) + overflows for discarded entries. */ + if ((r_type == R_SPARC_32 || r_type == R_SPARC_DISP32) + && _bfd_elf_section_offset (output_bfd, info, input_section, + rel->r_offset) == (bfd_vma) -1) break; if (h != NULL) @@ -2630,26 +2663,26 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, symtab_hdr->sh_link, sym->st_name)); if (name == NULL) - return false; + return FALSE; if (*name == '\0') name = bfd_section_name (input_bfd, sec); } if (! ((*info->callbacks->reloc_overflow) (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset))) - return false; + return FALSE; } break; } } - return true; + return TRUE; } /* Finish up dynamic symbol handling. We set the contents of various dynamic sections here. */ -static boolean +static bfd_boolean sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) bfd *output_bfd; struct bfd_link_info *info; @@ -2665,6 +2698,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) asection *splt; asection *srela; Elf_Internal_Rela rela; + bfd_byte *loc; /* This symbol has an entry in the PLT. Set it up. */ @@ -2696,9 +2730,9 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) 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 - 4))); + loc = srela->contents; + loc += (h->plt.offset - 4) * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { @@ -2720,6 +2754,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) asection *sgot; asection *srela; Elf_Internal_Rela rela; + bfd_byte *loc; /* This symbol has an entry in the GOT. Set it up. */ @@ -2748,24 +2783,24 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) } else { - bfd_put_64 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset); rela.r_info = ELF64_R_INFO (h->dynindx, R_SPARC_GLOB_DAT); rela.r_addend = 0; } - bfd_elf64_swap_reloca_out (output_bfd, &rela, - ((Elf64_External_Rela *) srela->contents - + srela->reloc_count)); - ++srela->reloc_count; + bfd_put_64 (output_bfd, (bfd_vma) 0, + sgot->contents + (h->got.offset &~ (bfd_vma) 1)); + loc = srela->contents; + loc += srela->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); } if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) { asection *s; Elf_Internal_Rela rela; + bfd_byte *loc; /* This symbols needs a copy reloc. Set it up. */ - BFD_ASSERT (h->dynindx != -1); s = bfd_get_section_by_name (h->root.u.def.section->owner, @@ -2777,10 +2812,8 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) + h->root.u.def.section->output_offset); rela.r_info = ELF64_R_INFO (h->dynindx, R_SPARC_COPY); rela.r_addend = 0; - bfd_elf64_swap_reloca_out (output_bfd, &rela, - ((Elf64_External_Rela *) s->contents - + s->reloc_count)); - ++s->reloc_count; + loc = s->contents + s->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); } /* Mark some specially defined symbols as absolute. */ @@ -2789,12 +2822,12 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0) sym->st_shndx = SHN_ABS; - return true; + return TRUE; } /* Finish up the dynamic sections. */ -static boolean +static bfd_boolean sparc64_elf_finish_dynamic_sections (output_bfd, info) bfd *output_bfd; struct bfd_link_info *info; @@ -2822,27 +2855,27 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info) { Elf_Internal_Dyn dyn; const char *name; - boolean size; + bfd_boolean size; bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn); switch (dyn.d_tag) { - case DT_PLTGOT: name = ".plt"; size = false; break; - case DT_PLTRELSZ: name = ".rela.plt"; size = true; break; - case DT_JMPREL: name = ".rela.plt"; size = false; break; + case DT_PLTGOT: name = ".plt"; size = FALSE; break; + case DT_PLTRELSZ: name = ".rela.plt"; size = TRUE; break; + case DT_JMPREL: name = ".rela.plt"; size = FALSE; break; case DT_SPARC_REGISTER: if (stt_regidx == -1) { stt_regidx = _bfd_elf_link_lookup_local_dynindx (info, output_bfd, -1); if (stt_regidx == -1) - return false; + return FALSE; } dyn.d_un.d_val = stt_regidx++; bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); /* fallthrough */ - default: name = NULL; size = false; break; + default: name = NULL; size = FALSE; break; } if (name != NULL) @@ -2870,10 +2903,8 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info) /* Initialize the contents of the .plt section. */ if (splt->_raw_size > 0) - { - sparc64_elf_build_plt (output_bfd, splt->contents, - (int) (splt->_raw_size / PLT_ENTRY_SIZE)); - } + sparc64_elf_build_plt (output_bfd, splt->contents, + (int) (splt->_raw_size / PLT_ENTRY_SIZE)); elf_section_data (splt->output_section)->this_hdr.sh_entsize = PLT_ENTRY_SIZE; @@ -2895,7 +2926,7 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info) elf_section_data (sgot->output_section)->this_hdr.sh_entsize = 8; - return true; + return TRUE; } static enum elf_reloc_type_class @@ -2920,25 +2951,25 @@ sparc64_elf_reloc_type_class (rela) /* Merge backend specific data from an object file to the output object file when linking. */ -static boolean +static bfd_boolean sparc64_elf_merge_private_bfd_data (ibfd, obfd) bfd *ibfd; bfd *obfd; { - boolean error; + bfd_boolean error; flagword new_flags, old_flags; int new_mm, old_mm; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) - return true; + return TRUE; new_flags = elf_elfheader (ibfd)->e_flags; old_flags = elf_elfheader (obfd)->e_flags; if (!elf_flags_init (obfd)) /* First call, no flags set */ { - elf_flags_init (obfd) = true; + elf_flags_init (obfd) = TRUE; elf_elfheader (obfd)->e_flags = new_flags; } @@ -2947,7 +2978,7 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd) else /* Incompatible flags */ { - error = false; + error = FALSE; #define EF_SPARC_ISA_EXTENSIONS \ (EF_SPARC_SUN_US1 | EF_SPARC_SUN_US3 | EF_SPARC_HAL_R1) @@ -2969,7 +3000,7 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd) if ((old_flags & (EF_SPARC_SUN_US1 | EF_SPARC_SUN_US3)) && (old_flags & EF_SPARC_HAL_R1)) { - error = true; + error = TRUE; (*_bfd_error_handler) (_("%s: linking UltraSPARC specific with HAL specific code"), bfd_archive_filename (ibfd)); @@ -2988,7 +3019,7 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd) /* Warn about any other mismatches */ if (new_flags != old_flags) { - error = true; + error = TRUE; (*_bfd_error_handler) (_("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)"), bfd_archive_filename (ibfd), (long) new_flags, (long) old_flags); @@ -2999,18 +3030,18 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd) if (error) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } } - return true; + return TRUE; } /* MARCO: Set the correct entry size for the .stab section. */ -static boolean +static bfd_boolean sparc64_elf_fake_sections (abfd, hdr, sec) bfd *abfd ATTRIBUTE_UNUSED; - Elf32_Internal_Shdr *hdr ATTRIBUTE_UNUSED; + Elf_Internal_Shdr *hdr ATTRIBUTE_UNUSED; asection *sec; { const char *name; @@ -3022,8 +3053,8 @@ sparc64_elf_fake_sections (abfd, hdr, sec) /* Even in the 64bit case the stab entries are only 12 bytes long. */ elf_section_data (sec)->this_hdr.sh_entsize = 12; } - - return true; + + return TRUE; } /* Print a STT_REGISTER symbol to file FILE. */ @@ -3056,7 +3087,7 @@ sparc64_elf_print_symbol_all (abfd, filep, symbol) /* Set the right machine number for a SPARC64 ELF file. */ -static boolean +static bfd_boolean sparc64_elf_object_p (abfd) bfd *abfd; { @@ -3084,14 +3115,14 @@ const struct elf_size_info sparc64_elf_size_info = sizeof (Elf64_External_Sym), sizeof (Elf64_External_Dyn), sizeof (Elf_External_Note), - 4, /* hash-table entry size */ - /* internal relocations per external relocations. + 4, /* hash-table entry size. */ + /* 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. */ 1, - 64, /* arch_size */ - 8, /* file_align */ + 64, /* arch_size. */ + 3, /* log_file_align. */ ELFCLASS64, EV_CURRENT, bfd_elf64_write_out_phdrs, @@ -3103,10 +3134,10 @@ const struct elf_size_info sparc64_elf_size_info = bfd_elf64_slurp_symbol_table, bfd_elf64_swap_dyn_in, bfd_elf64_swap_dyn_out, - NULL, - NULL, - NULL, - NULL + bfd_elf64_swap_reloc_in, + bfd_elf64_swap_reloc_out, + bfd_elf64_swap_reloca_in, + bfd_elf64_swap_reloca_out }; #define TARGET_BIG_SYM bfd_elf64_sparc_vec @@ -3129,12 +3160,16 @@ const struct elf_size_info sparc64_elf_size_info = sparc64_elf_get_reloc_upper_bound #define bfd_elf64_get_dynamic_reloc_upper_bound \ sparc64_elf_get_dynamic_reloc_upper_bound +#define bfd_elf64_canonicalize_reloc \ + sparc64_elf_canonicalize_reloc #define bfd_elf64_canonicalize_dynamic_reloc \ 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 bfd_elf64_new_section_hook \ + sparc64_elf_new_section_hook #define elf_backend_create_dynamic_sections \ _bfd_elf_create_dynamic_sections @@ -3175,11 +3210,11 @@ const struct elf_size_info sparc64_elf_size_info = #define elf_backend_want_got_plt 0 #define elf_backend_plt_readonly 0 #define elf_backend_want_plt_sym 1 +#define elf_backend_rela_normal 1 /* Section 5.2.4 of the ABI specifies a 256-byte boundary for the table. */ #define elf_backend_plt_alignment 8 #define elf_backend_got_header_size 8 -#define elf_backend_plt_header_size PLT_HEADER_SIZE #include "elf64-target.h" diff --git a/contrib/binutils/bfd/elf64-x86-64.c b/contrib/binutils/bfd/elf64-x86-64.c index a7303d0..a1d6250 100644 --- a/contrib/binutils/bfd/elf64-x86-64.c +++ b/contrib/binutils/bfd/elf64-x86-64.c @@ -1,22 +1,22 @@ /* X86-64 specific support for 64-bit ELF - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Jan Hubicka . -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" @@ -26,9 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf/x86-64.h" -/* We use only the RELA entries. */ -#define USE_RELA 1 - /* In case we're on a 32-bit machine, construct a 64-bit "-1" value. */ #define MINUS_ONE (~ (bfd_vma) 0) @@ -37,59 +34,83 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 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), + 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, 2, 32, TRUE, 0, complain_overflow_signed, + bfd_elf_generic_reloc, "R_X86_64_PC32", FALSE, 0xffffffff, 0xffffffff, + TRUE), + HOWTO(R_X86_64_GOT32, 0, 2, 32, FALSE, 0, complain_overflow_signed, + bfd_elf_generic_reloc, "R_X86_64_GOT32", FALSE, 0xffffffff, 0xffffffff, + FALSE), + HOWTO(R_X86_64_PLT32, 0, 2, 32, TRUE, 0, complain_overflow_signed, + bfd_elf_generic_reloc, "R_X86_64_PLT32", FALSE, 0xffffffff, 0xffffffff, + TRUE), + HOWTO(R_X86_64_COPY, 0, 2, 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, 2, 32, TRUE, 0, complain_overflow_signed, + bfd_elf_generic_reloc, "R_X86_64_GOTPCREL", FALSE, 0xffffffff, + 0xffffffff, TRUE), + HOWTO(R_X86_64_32, 0, 2, 32, FALSE, 0, complain_overflow_unsigned, + bfd_elf_generic_reloc, "R_X86_64_32", FALSE, 0xffffffff, 0xffffffff, + FALSE), + HOWTO(R_X86_64_32S, 0, 2, 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), + HOWTO(R_X86_64_DTPMOD64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_X86_64_DTPMOD64", FALSE, MINUS_ONE, + MINUS_ONE, FALSE), + HOWTO(R_X86_64_DTPOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_X86_64_DTPOFF64", FALSE, MINUS_ONE, + MINUS_ONE, FALSE), + HOWTO(R_X86_64_TPOFF64, 0, 4, 64, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_X86_64_TPOFF64", FALSE, MINUS_ONE, + MINUS_ONE, FALSE), + HOWTO(R_X86_64_TLSGD, 0, 2, 32, TRUE, 0, complain_overflow_signed, + bfd_elf_generic_reloc, "R_X86_64_TLSGD", FALSE, 0xffffffff, + 0xffffffff, TRUE), + HOWTO(R_X86_64_TLSLD, 0, 2, 32, TRUE, 0, complain_overflow_signed, + bfd_elf_generic_reloc, "R_X86_64_TLSLD", FALSE, 0xffffffff, + 0xffffffff, TRUE), + HOWTO(R_X86_64_DTPOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_X86_64_DTPOFF32", FALSE, 0xffffffff, + 0xffffffff, FALSE), + HOWTO(R_X86_64_GOTTPOFF, 0, 2, 32, TRUE, 0, complain_overflow_signed, + bfd_elf_generic_reloc, "R_X86_64_GOTTPOFF", FALSE, 0xffffffff, + 0xffffffff, TRUE), + HOWTO(R_X86_64_TPOFF32, 0, 2, 32, FALSE, 0, complain_overflow_signed, + bfd_elf_generic_reloc, "R_X86_64_TPOFF32", FALSE, 0xffffffff, + 0xffffffff, FALSE), /* GNU extension to record C++ vtable hierarchy. */ - HOWTO (R_X86_64_GNU_VTINHERIT, 0, 4, 0, false, 0, complain_overflow_dont, - NULL, "R_X86_64_GNU_VTINHERIT", false, 0, 0, false), + HOWTO (R_X86_64_GNU_VTINHERIT, 0, 4, 0, FALSE, 0, complain_overflow_dont, + NULL, "R_X86_64_GNU_VTINHERIT", FALSE, 0, 0, FALSE), /* GNU extension to record C++ vtable member usage. */ - HOWTO (R_X86_64_GNU_VTENTRY, 0, 4, 0, false, 0, complain_overflow_dont, - _bfd_elf_rel_vtable_reloc_fn, "R_X86_64_GNU_VTENTRY", false, 0, 0, - false) + HOWTO (R_X86_64_GNU_VTENTRY, 0, 4, 0, FALSE, 0, complain_overflow_dont, + _bfd_elf_rel_vtable_reloc_fn, "R_X86_64_GNU_VTENTRY", FALSE, 0, 0, + FALSE) }; /* Map BFD relocs to the x86_64 elf relocs. */ @@ -117,68 +138,26 @@ static const struct elf_reloc_map x86_64_reloc_map[] = { BFD_RELOC_16_PCREL, R_X86_64_PC16, }, { BFD_RELOC_8, R_X86_64_8, }, { BFD_RELOC_8_PCREL, R_X86_64_PC8, }, + { BFD_RELOC_X86_64_DTPMOD64, R_X86_64_DTPMOD64, }, + { BFD_RELOC_X86_64_DTPOFF64, R_X86_64_DTPOFF64, }, + { BFD_RELOC_X86_64_TPOFF64, R_X86_64_TPOFF64, }, + { BFD_RELOC_X86_64_TLSGD, R_X86_64_TLSGD, }, + { BFD_RELOC_X86_64_TLSLD, R_X86_64_TLSLD, }, + { BFD_RELOC_X86_64_DTPOFF32, R_X86_64_DTPOFF32, }, + { BFD_RELOC_X86_64_GOTTPOFF, R_X86_64_GOTTPOFF, }, + { BFD_RELOC_X86_64_TPOFF32, R_X86_64_TPOFF32, }, { BFD_RELOC_VTABLE_INHERIT, R_X86_64_GNU_VTINHERIT, }, { BFD_RELOC_VTABLE_ENTRY, R_X86_64_GNU_VTENTRY, }, }; -static reloc_howto_type *elf64_x86_64_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); -static void elf64_x86_64_info_to_howto - PARAMS ((bfd *, arelent *, Elf64_Internal_Rela *)); -static boolean elf64_x86_64_grok_prstatus - PARAMS ((bfd *, Elf_Internal_Note *)); -static boolean elf64_x86_64_grok_psinfo - PARAMS ((bfd *, Elf_Internal_Note *)); -static struct bfd_link_hash_table *elf64_x86_64_link_hash_table_create - PARAMS ((bfd *)); -static boolean elf64_x86_64_elf_object_p PARAMS ((bfd *abfd)); -static boolean create_got_section - PARAMS((bfd *, struct bfd_link_info *)); -static boolean elf64_x86_64_create_dynamic_sections - PARAMS((bfd *, struct bfd_link_info *)); -static void elf64_x86_64_copy_indirect_symbol - PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, - struct elf_link_hash_entry *)); -static boolean elf64_x86_64_check_relocs - PARAMS ((bfd *, struct bfd_link_info *, asection *sec, - const Elf_Internal_Rela *)); -static asection *elf64_x86_64_gc_mark_hook - PARAMS ((asection *, struct bfd_link_info *, Elf_Internal_Rela *, - struct elf_link_hash_entry *, Elf_Internal_Sym *)); - -static boolean elf64_x86_64_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, - const Elf_Internal_Rela *)); - -static struct bfd_hash_entry *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 allocate_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); -static boolean readonly_dynrelocs - PARAMS ((struct elf_link_hash_entry *, PTR)); -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 *)); -static enum elf_reloc_type_class elf64_x86_64_reloc_type_class - PARAMS ((const Elf_Internal_Rela *)); /* Given a BFD reloc type, return a HOWTO structure. */ static reloc_howto_type * -elf64_x86_64_reloc_type_lookup (abfd, code) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_reloc_code_real_type code; +elf64_x86_64_reloc_type_lookup (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++) { @@ -191,33 +170,29 @@ elf64_x86_64_reloc_type_lookup (abfd, code) /* 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; +elf64_x86_64_info_to_howto (bfd *abfd ATTRIBUTE_UNUSED, arelent *cache_ptr, + Elf_Internal_Rela *dst) { unsigned r_type, i; r_type = ELF64_R_TYPE (dst->r_info); if (r_type < (unsigned int) R_X86_64_GNU_VTINHERIT) { - BFD_ASSERT (r_type <= (unsigned int) R_X86_64_PC8); + BFD_ASSERT (r_type <= (unsigned int) R_X86_64_TPOFF32); i = r_type; } else { BFD_ASSERT (r_type < (unsigned int) R_X86_64_max); - i = r_type - ((unsigned int) R_X86_64_GNU_VTINHERIT - R_X86_64_PC8 - 1); + i = r_type - ((unsigned int) R_X86_64_GNU_VTINHERIT - R_X86_64_TPOFF32 - 1); } cache_ptr->howto = &x86_64_elf_howto_table[i]; BFD_ASSERT (r_type == cache_ptr->howto->type); } /* Support for core dump NOTE sections. */ -static boolean -elf64_x86_64_grok_prstatus (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +static bfd_boolean +elf64_x86_64_grok_prstatus (bfd *abfd, Elf_Internal_Note *note) { int offset; size_t raw_size; @@ -225,7 +200,7 @@ elf64_x86_64_grok_prstatus (abfd, note) switch (note->descsz) { default: - return false; + return FALSE; case 336: /* sizeof(istruct elf_prstatus) on Linux/x86_64 */ /* pr_cursig */ @@ -248,15 +223,13 @@ elf64_x86_64_grok_prstatus (abfd, note) raw_size, note->descpos + offset); } -static boolean -elf64_x86_64_grok_psinfo (abfd, note) - bfd *abfd; - Elf_Internal_Note *note; +static bfd_boolean +elf64_x86_64_grok_psinfo (bfd *abfd, Elf_Internal_Note *note) { switch (note->descsz) { default: - return false; + return FALSE; case 136: /* sizeof(struct elf_prpsinfo) on Linux/x86_64 */ elf_tdata (abfd)->core_program @@ -277,7 +250,7 @@ elf64_x86_64_grok_psinfo (abfd, note) command[n - 1] = '\0'; } - return true; + return TRUE; } /* Functions for the x86-64 ELF linker. */ @@ -287,6 +260,12 @@ elf64_x86_64_grok_psinfo (abfd, note) #define ELF_DYNAMIC_INTERPRETER "/lib/ld64.so.1" +/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid + copying dynamic variables from a shared lib into an app's dynbss + section, and instead use a dynamic relocation to point into the + shared lib. */ +#define ELIMINATE_COPY_RELOCS 1 + /* The size in bytes of an entry in the global offset table. */ #define GOT_ENTRY_SIZE 8 @@ -346,8 +325,32 @@ struct elf64_x86_64_link_hash_entry /* Track dynamic relocs copied for this symbol. */ struct elf64_x86_64_dyn_relocs *dyn_relocs; + +#define GOT_UNKNOWN 0 +#define GOT_NORMAL 1 +#define GOT_TLS_GD 2 +#define GOT_TLS_IE 3 + unsigned char tls_type; +}; + +#define elf64_x86_64_hash_entry(ent) \ + ((struct elf64_x86_64_link_hash_entry *)(ent)) + +struct elf64_x86_64_obj_tdata +{ + struct elf_obj_tdata root; + + /* tls_type for each local got entry. */ + char *local_got_tls_type; }; +#define elf64_x86_64_tdata(abfd) \ + ((struct elf64_x86_64_obj_tdata *) (abfd)->tdata.any) + +#define elf64_x86_64_local_got_tls_type(abfd) \ + (elf64_x86_64_tdata (abfd)->local_got_tls_type) + + /* x86-64 ELF linker hash table. */ struct elf64_x86_64_link_hash_table @@ -363,6 +366,11 @@ struct elf64_x86_64_link_hash_table asection *sdynbss; asection *srelbss; + union { + bfd_signed_vma refcount; + bfd_vma offset; + } tls_ld_got; + /* Small local sym to section mapping cache. */ struct sym_sec_cache sym_sec; }; @@ -375,10 +383,8 @@ struct elf64_x86_64_link_hash_table /* Create an entry in an x86-64 ELF linker hash table. */ static struct bfd_hash_entry * -link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +link_hash_newfunc (struct bfd_hash_entry *entry, struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ @@ -398,6 +404,7 @@ link_hash_newfunc (entry, table, string) eh = (struct elf64_x86_64_link_hash_entry *) entry; eh->dyn_relocs = NULL; + eh->tls_type = GOT_UNKNOWN; } return entry; @@ -406,8 +413,7 @@ link_hash_newfunc (entry, table, string) /* Create an X86-64 ELF linker hash table. */ static struct bfd_link_hash_table * -elf64_x86_64_link_hash_table_create (abfd) - bfd *abfd; +elf64_x86_64_link_hash_table_create (bfd *abfd) { struct elf64_x86_64_link_hash_table *ret; bfd_size_type amt = sizeof (struct elf64_x86_64_link_hash_table); @@ -430,6 +436,7 @@ elf64_x86_64_link_hash_table_create (abfd) ret->sdynbss = NULL; ret->srelbss = NULL; ret->sym_sec.abfd = NULL; + ret->tls_ld_got.refcount = 0; return &ret->elf.root; } @@ -437,15 +444,13 @@ elf64_x86_64_link_hash_table_create (abfd) /* Create .got, .gotplt, and .rela.got sections in DYNOBJ, and set up shortcuts to them in our hash table. */ -static boolean -create_got_section (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; +static bfd_boolean +create_got_section (bfd *dynobj, struct bfd_link_info *info) { struct elf64_x86_64_link_hash_table *htab; if (! _bfd_elf_create_got_section (dynobj, info)) - return false; + return FALSE; htab = elf64_x86_64_hash_table (info); htab->sgot = bfd_get_section_by_name (dynobj, ".got"); @@ -460,27 +465,25 @@ create_got_section (dynobj, info) | SEC_IN_MEMORY | SEC_LINKER_CREATED | SEC_READONLY)) || ! bfd_set_section_alignment (dynobj, htab->srelgot, 3)) - return false; - return true; + return FALSE; + return TRUE; } /* Create .plt, .rela.plt, .got, .got.plt, .rela.got, .dynbss, and .rela.bss sections in DYNOBJ, and set up shortcuts to them in our hash table. */ -static boolean -elf64_x86_64_create_dynamic_sections (dynobj, info) - bfd *dynobj; - struct bfd_link_info *info; +static bfd_boolean +elf64_x86_64_create_dynamic_sections (bfd *dynobj, struct bfd_link_info *info) { struct elf64_x86_64_link_hash_table *htab; htab = elf64_x86_64_hash_table (info); if (!htab->sgot && !create_got_section (dynobj, info)) - return false; + return FALSE; if (!_bfd_elf_create_dynamic_sections (dynobj, info)) - return false; + return FALSE; htab->splt = bfd_get_section_by_name (dynobj, ".plt"); htab->srelplt = bfd_get_section_by_name (dynobj, ".rela.plt"); @@ -492,15 +495,15 @@ elf64_x86_64_create_dynamic_sections (dynobj, info) || (!info->shared && !htab->srelbss)) abort (); - return true; + return TRUE; } /* Copy the extra info we tack onto an elf_link_hash_entry. */ static void -elf64_x86_64_copy_indirect_symbol (bed, dir, ind) - struct elf_backend_data *bed; - struct elf_link_hash_entry *dir, *ind; +elf64_x86_64_copy_indirect_symbol (const struct elf_backend_data *bed, + struct elf_link_hash_entry *dir, + struct elf_link_hash_entry *ind) { struct elf64_x86_64_link_hash_entry *edir, *eind; @@ -541,28 +544,73 @@ elf64_x86_64_copy_indirect_symbol (bed, dir, ind) eind->dyn_relocs = NULL; } - _bfd_elf_link_hash_copy_indirect (bed, dir, ind); + if (ind->root.type == bfd_link_hash_indirect + && dir->got.refcount <= 0) + { + edir->tls_type = eind->tls_type; + eind->tls_type = GOT_UNKNOWN; + } + + if (ELIMINATE_COPY_RELOCS + && ind->root.type != bfd_link_hash_indirect + && (dir->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) + /* If called to transfer flags for a weakdef during processing + of elf_adjust_dynamic_symbol, don't copy ELF_LINK_NON_GOT_REF. + We clear it ourselves for ELIMINATE_COPY_RELOCS. */ + dir->elf_link_hash_flags |= + (ind->elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK + | ELF_LINK_HASH_NEEDS_PLT)); + else + _bfd_elf_link_hash_copy_indirect (bed, dir, ind); +} + +static bfd_boolean +elf64_x86_64_mkobject (bfd *abfd) +{ + bfd_size_type amt = sizeof (struct elf64_x86_64_obj_tdata); + abfd->tdata.any = bfd_zalloc (abfd, amt); + if (abfd->tdata.any == NULL) + return FALSE; + return TRUE; } -static boolean -elf64_x86_64_elf_object_p (abfd) - bfd *abfd; +static bfd_boolean +elf64_x86_64_elf_object_p (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; + return TRUE; +} + +static int +elf64_x86_64_tls_transition (struct bfd_link_info *info, int r_type, int is_local) +{ + if (info->shared) + return r_type; + + switch (r_type) + { + case R_X86_64_TLSGD: + case R_X86_64_GOTTPOFF: + if (is_local) + return R_X86_64_TPOFF32; + return R_X86_64_GOTTPOFF; + case R_X86_64_TLSLD: + return R_X86_64_TPOFF32; + } + + return r_type; } /* Look through the relocs for a section during the first phase, and calculate needed space in the global offset table, procedure linkage table, and dynamic reloc sections. */ -static boolean -elf64_x86_64_check_relocs (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; +static bfd_boolean +elf64_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info, asection *sec, + const Elf_Internal_Rela *relocs) { struct elf64_x86_64_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; @@ -571,8 +619,8 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel_end; asection *sreloc; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; htab = elf64_x86_64_hash_table (info); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; @@ -583,17 +631,19 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { + unsigned int r_type; unsigned long r_symndx; struct elf_link_hash_entry *h; r_symndx = ELF64_R_SYM (rel->r_info); + r_type = ELF64_R_TYPE (rel->r_info); if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr)) { (*_bfd_error_handler) (_("%s: bad symbol index: %d"), bfd_archive_filename (abfd), r_symndx); - return false; + return FALSE; } if (r_symndx < symtab_hdr->sh_info) @@ -601,44 +651,109 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - switch (ELF64_R_TYPE (rel->r_info)) + r_type = elf64_x86_64_tls_transition (info, r_type, h == NULL); + switch (r_type) { - case R_X86_64_GOT32: - case R_X86_64_GOTPCREL: - /* This symbol requires a global offset table entry. */ - if (h != NULL) + case R_X86_64_TLSLD: + htab->tls_ld_got.refcount += 1; + goto create_got; + + case R_X86_64_TPOFF32: + if (info->shared) { - h->got.refcount += 1; + (*_bfd_error_handler) + (_("%s: relocation %s can not be used when making a shared object; recompile with -fPIC"), + bfd_archive_filename (abfd), + x86_64_elf_howto_table[r_type].name); + bfd_set_error (bfd_error_bad_value); + return FALSE; } - else - { - bfd_signed_vma *local_got_refcounts; + break; - /* This is a global offset table entry for a local symbol. */ - local_got_refcounts = elf_local_got_refcounts (abfd); - if (local_got_refcounts == NULL) - { - bfd_size_type size; - - size = symtab_hdr->sh_info; - size *= sizeof (bfd_signed_vma); - local_got_refcounts = ((bfd_signed_vma *) - bfd_zalloc (abfd, size)); - if (local_got_refcounts == NULL) - return false; - elf_local_got_refcounts (abfd) = local_got_refcounts; - } - local_got_refcounts[r_symndx] += 1; - } + case R_X86_64_GOTTPOFF: + if (info->shared) + info->flags |= DF_STATIC_TLS; + /* Fall through */ + + case R_X86_64_GOT32: + case R_X86_64_GOTPCREL: + case R_X86_64_TLSGD: + /* This symbol requires a global offset table entry. */ + { + int tls_type, old_tls_type; + + switch (r_type) + { + default: tls_type = GOT_NORMAL; break; + case R_X86_64_TLSGD: tls_type = GOT_TLS_GD; break; + case R_X86_64_GOTTPOFF: tls_type = GOT_TLS_IE; break; + } + + if (h != NULL) + { + h->got.refcount += 1; + old_tls_type = elf64_x86_64_hash_entry (h)->tls_type; + } + else + { + bfd_signed_vma *local_got_refcounts; + + /* This is a global offset table entry for a local symbol. */ + local_got_refcounts = elf_local_got_refcounts (abfd); + if (local_got_refcounts == NULL) + { + bfd_size_type size; + + size = symtab_hdr->sh_info; + size *= sizeof (bfd_signed_vma) + sizeof (char); + local_got_refcounts = ((bfd_signed_vma *) + bfd_zalloc (abfd, size)); + if (local_got_refcounts == NULL) + return FALSE; + elf_local_got_refcounts (abfd) = local_got_refcounts; + elf64_x86_64_local_got_tls_type (abfd) + = (char *) (local_got_refcounts + symtab_hdr->sh_info); + } + local_got_refcounts[r_symndx] += 1; + old_tls_type + = elf64_x86_64_local_got_tls_type (abfd) [r_symndx]; + } + + /* If a TLS symbol is accessed using IE at least once, + there is no point to use dynamic model for it. */ + if (old_tls_type != tls_type && old_tls_type != GOT_UNKNOWN + && (old_tls_type != GOT_TLS_GD || tls_type != GOT_TLS_IE)) + { + if (old_tls_type == GOT_TLS_IE && tls_type == GOT_TLS_GD) + tls_type = old_tls_type; + else + { + (*_bfd_error_handler) + (_("%s: %s' accessed both as normal and thread local symbol"), + bfd_archive_filename (abfd), + h ? h->root.root.string : ""); + return FALSE; + } + } + + if (old_tls_type != tls_type) + { + if (h != NULL) + elf64_x86_64_hash_entry (h)->tls_type = tls_type; + else + elf64_x86_64_local_got_tls_type (abfd) [r_symndx] = tls_type; + } + } /* Fall through */ //case R_X86_64_GOTPCREL: + create_got: if (htab->sgot == NULL) { if (htab->elf.dynobj == NULL) htab->elf.dynobj = abfd; if (!create_got_section (htab->elf.dynobj, info)) - return false; + return FALSE; } break; @@ -674,9 +789,9 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) (*_bfd_error_handler) (_("%s: relocation %s can not be used when making a shared object; recompile with -fPIC"), bfd_archive_filename (abfd), - x86_64_elf_howto_table[ELF64_R_TYPE (rel->r_info)].name); + x86_64_elf_howto_table[r_type].name); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } /* Fall through. */ @@ -722,15 +837,16 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) symbol. */ if ((info->shared && (sec->flags & SEC_ALLOC) != 0 - && (((ELF64_R_TYPE (rel->r_info) != R_X86_64_PC8) - && (ELF64_R_TYPE (rel->r_info) != R_X86_64_PC16) - && (ELF64_R_TYPE (rel->r_info) != R_X86_64_PC32)) + && (((r_type != R_X86_64_PC8) + && (r_type != R_X86_64_PC16) + && (r_type != R_X86_64_PC32)) || (h != NULL && (! info->symbolic || h->root.type == bfd_link_hash_defweak || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)))) - || (!info->shared + || (ELIMINATE_COPY_RELOCS + && !info->shared && (sec->flags & SEC_ALLOC) != 0 && h != NULL && (h->root.type == bfd_link_hash_defweak @@ -753,7 +869,7 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) elf_elfheader (abfd)->e_shstrndx, elf_section_data (sec)->rel_hdr.sh_name)); if (name == NULL) - return false; + return FALSE; if (strncmp (name, ".rela", 5) != 0 || strcmp (bfd_get_section_name (abfd, sec), @@ -782,7 +898,7 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) if (sreloc == NULL || ! bfd_set_section_flags (dynobj, sreloc, flags) || ! bfd_set_section_alignment (dynobj, sreloc, 3)) - return false; + return FALSE; } elf_section_data (sec)->sreloc = sreloc; } @@ -803,7 +919,7 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) s = bfd_section_from_r_symndx (abfd, &htab->sym_sec, sec, r_symndx); if (s == NULL) - return false; + return FALSE; head = ((struct elf64_x86_64_dyn_relocs **) &elf_section_data (s)->local_dynrel); @@ -816,7 +932,7 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) p = ((struct elf64_x86_64_dyn_relocs *) bfd_alloc (htab->elf.dynobj, amt)); if (p == NULL) - return false; + return FALSE; p->next = *head; *head = p; p->sec = sec; @@ -825,9 +941,9 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) } p->count += 1; - if (ELF64_R_TYPE (rel->r_info) == R_X86_64_PC8 - || ELF64_R_TYPE (rel->r_info) == R_X86_64_PC16 - || ELF64_R_TYPE (rel->r_info) == R_X86_64_PC32) + if (r_type == R_X86_64_PC8 + || r_type == R_X86_64_PC16 + || r_type == R_X86_64_PC32) p->pc_count += 1; } break; @@ -835,15 +951,15 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) /* This relocation describes the C++ object vtable hierarchy. Reconstruct it for later use during GC. */ case R_X86_64_GNU_VTINHERIT: - if (!_bfd_elf64_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) - return false; + if (!bfd_elf_gc_record_vtinherit (abfd, sec, h, rel->r_offset)) + return FALSE; break; /* This relocation describes which C++ vtable entries are actually used. Record for later use during GC. */ case R_X86_64_GNU_VTENTRY: - if (!_bfd_elf64_gc_record_vtentry (abfd, sec, h, rel->r_addend)) - return false; + if (!bfd_elf_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return FALSE; break; default: @@ -851,19 +967,18 @@ elf64_x86_64_check_relocs (abfd, info, sec, relocs) } } - return true; + return TRUE; } /* Return the section that should be marked against GC for a given relocation. */ static asection * -elf64_x86_64_gc_mark_hook (sec, info, rel, h, sym) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - Elf_Internal_Rela *rel; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; +elf64_x86_64_gc_mark_hook (asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + Elf_Internal_Rela *rel, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { if (h != NULL) { @@ -896,19 +1011,14 @@ elf64_x86_64_gc_mark_hook (sec, info, rel, h, sym) /* 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; - asection *sec; - const Elf_Internal_Rela *relocs; +static bfd_boolean +elf64_x86_64_gc_sweep_hook (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; bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel, *relend; - unsigned long r_symndx; - struct elf_link_hash_entry *h; elf_section_data (sec)->local_dynrel = NULL; @@ -918,77 +1028,81 @@ elf64_x86_64_gc_sweep_hook (abfd, info, sec, relocs) 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; - } - else if (local_got_refcounts != NULL) - { - if (local_got_refcounts[r_symndx] > 0) - local_got_refcounts[r_symndx] -= 1; - } - break; + { + unsigned long r_symndx; + unsigned int r_type; + struct elf_link_hash_entry *h = NULL; - case R_X86_64_8: - case R_X86_64_16: - case R_X86_64_32: - case R_X86_64_64: - case R_X86_64_32S: - case R_X86_64_PC8: - case R_X86_64_PC16: - case R_X86_64_PC32: - r_symndx = ELF64_R_SYM (rel->r_info); - if (r_symndx >= symtab_hdr->sh_info) - { - struct elf64_x86_64_link_hash_entry *eh; - struct elf64_x86_64_dyn_relocs **pp; - struct elf64_x86_64_dyn_relocs *p; + r_symndx = ELF64_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + struct elf64_x86_64_link_hash_entry *eh; + struct elf64_x86_64_dyn_relocs **pp; + struct elf64_x86_64_dyn_relocs *p; - h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + eh = (struct elf64_x86_64_link_hash_entry *) h; - if (!info->shared && h->plt.refcount > 0) - h->plt.refcount -= 1; + for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) + if (p->sec == sec) + { + /* Everything must go for SEC. */ + *pp = p->next; + break; + } + } - eh = (struct elf64_x86_64_link_hash_entry *) h; + r_type = ELF64_R_TYPE (rel->r_info); + r_type = elf64_x86_64_tls_transition (info, r_type, h != NULL); + switch (r_type) + { + case R_X86_64_TLSLD: + if (elf64_x86_64_hash_table (info)->tls_ld_got.refcount > 0) + elf64_x86_64_hash_table (info)->tls_ld_got.refcount -= 1; + break; - for (pp = &eh->dyn_relocs; (p = *pp) != NULL; pp = &p->next) - if (p->sec == sec) - { - if (ELF64_R_TYPE (rel->r_info) == R_X86_64_PC8 - || ELF64_R_TYPE (rel->r_info) == R_X86_64_PC16 - || ELF64_R_TYPE (rel->r_info) == R_X86_64_PC32) - p->pc_count -= 1; - p->count -= 1; - if (p->count == 0) - *pp = p->next; - break; - } - } - break; + case R_X86_64_TLSGD: + case R_X86_64_GOTTPOFF: + case R_X86_64_GOT32: + case R_X86_64_GOTPCREL: + if (h != NULL) + { + if (h->got.refcount > 0) + h->got.refcount -= 1; + } + else if (local_got_refcounts != NULL) + { + if (local_got_refcounts[r_symndx] > 0) + local_got_refcounts[r_symndx] -= 1; + } + break; + case R_X86_64_8: + case R_X86_64_16: + case R_X86_64_32: + case R_X86_64_64: + case R_X86_64_32S: + case R_X86_64_PC8: + case R_X86_64_PC16: + case R_X86_64_PC32: + if (info->shared) + break; + /* Fall thru */ - 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; + case R_X86_64_PLT32: + if (h != NULL) + { + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; - default: - break; - } + default: + break; + } + } - return true; + return TRUE; } /* Adjust a symbol defined by a dynamic object and referenced by a @@ -997,14 +1111,11 @@ elf64_x86_64_gc_sweep_hook (abfd, info, sec, relocs) 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; +static bfd_boolean +elf64_x86_64_adjust_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) { struct elf64_x86_64_link_hash_table *htab; - struct elf64_x86_64_link_hash_entry * eh; - struct elf64_x86_64_dyn_relocs *p; asection *s; unsigned int power_of_two; @@ -1015,11 +1126,9 @@ elf64_x86_64_adjust_dynamic_symbol (info, h) || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { if (h->plt.refcount <= 0 - || (! info->shared - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 - && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0 - && h->root.type != bfd_link_hash_undefweak - && h->root.type != bfd_link_hash_undefined)) + || SYMBOL_CALLS_LOCAL (info, h) + || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak)) { /* This case can occur if we saw a PLT32 reloc in an input file, but the symbol was never referred to by a dynamic @@ -1030,7 +1139,7 @@ elf64_x86_64_adjust_dynamic_symbol (info, h) h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; } - return true; + return TRUE; } else /* It's possible that we incorrectly decided a .plt reloc was @@ -1049,7 +1158,11 @@ elf64_x86_64_adjust_dynamic_symbol (info, h) || 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 (ELIMINATE_COPY_RELOCS || info->nocopyreloc) + h->elf_link_hash_flags + = ((h->elf_link_hash_flags & ~ELF_LINK_NON_GOT_REF) + | (h->weakdef->elf_link_hash_flags & ELF_LINK_NON_GOT_REF)); + return TRUE; } /* This is a reference to a symbol defined by a dynamic object which @@ -1060,34 +1173,40 @@ elf64_x86_64_adjust_dynamic_symbol (info, h) For such cases we need not do anything here; the relocations will be handled correctly by relocate_section. */ if (info->shared) - return true; + 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; + return TRUE; /* If -z nocopyreloc was given, we won't generate them either. */ if (info->nocopyreloc) { h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - return true; + return TRUE; } - eh = (struct elf64_x86_64_link_hash_entry *) h; - for (p = eh->dyn_relocs; p != NULL; p = p->next) + if (ELIMINATE_COPY_RELOCS) { - s = p->sec->output_section; - if (s != NULL && (s->flags & SEC_READONLY) != 0) - break; - } + struct elf64_x86_64_link_hash_entry * eh; + struct elf64_x86_64_dyn_relocs *p; - /* If we didn't find any dynamic relocs in read-only sections, then - we'll be keeping the dynamic relocs and avoiding the copy reloc. */ - if (p == NULL) - { - h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; - return true; + eh = (struct elf64_x86_64_link_hash_entry *) h; + for (p = eh->dyn_relocs; p != NULL; p = p->next) + { + s = p->sec->output_section; + if (s != NULL && (s->flags & SEC_READONLY) != 0) + break; + } + + /* If we didn't find any dynamic relocs in read-only sections, then + we'll be keeping the dynamic relocs and avoiding the copy reloc. */ + if (p == NULL) + { + h->elf_link_hash_flags &= ~ELF_LINK_NON_GOT_REF; + return TRUE; + } } /* We must allocate the symbol in our .dynbss section, which will @@ -1126,7 +1245,7 @@ elf64_x86_64_adjust_dynamic_symbol (info, h) if (power_of_two > bfd_get_section_alignment (htab->elf.dynobj, s)) { if (! bfd_set_section_alignment (htab->elf.dynobj, s, power_of_two)) - return false; + return FALSE; } /* Define the symbol as being at this point in the section. */ @@ -1136,27 +1255,14 @@ elf64_x86_64_adjust_dynamic_symbol (info, h) /* Increment the section size to make room for the symbol. */ s->_raw_size += h->size; - return true; + return TRUE; } -/* This is the condition under which elf64_x86_64_finish_dynamic_symbol - will be called from elflink.h. If elflink.h doesn't call our - finish_dynamic_symbol routine, we'll need to do something about - initializing any .plt and .got entries in elf64_x86_64_relocate_section. */ -#define WILL_CALL_FINISH_DYNAMIC_SYMBOL(DYN, INFO, H) \ - ((DYN) \ - && ((INFO)->shared \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) \ - && ((H)->dynindx != -1 \ - || ((H)->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0)) - /* Allocate space in .plt, .got and associated reloc sections for dynamic relocs. */ -static boolean -allocate_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +static bfd_boolean +allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf) { struct bfd_link_info *info; struct elf64_x86_64_link_hash_table *htab; @@ -1164,7 +1270,7 @@ allocate_dynrelocs (h, inf) struct elf64_x86_64_dyn_relocs *p; if (h->root.type == bfd_link_hash_indirect) - return true; + return TRUE; if (h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; @@ -1180,11 +1286,12 @@ allocate_dynrelocs (h, inf) if (h->dynindx == -1 && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) { - if (! bfd_elf64_link_record_dynamic_symbol (info, h)) - return false; + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h)) + if (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) { asection *s = htab->splt; @@ -1229,25 +1336,47 @@ allocate_dynrelocs (h, inf) h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; } - if (h->got.refcount > 0) + /* If R_X86_64_GOTTPOFF symbol is now local to the binary, + make it a R_X86_64_TPOFF32 requiring no GOT entry. */ + if (h->got.refcount > 0 + && !info->shared + && h->dynindx == -1 + && elf64_x86_64_hash_entry (h)->tls_type == GOT_TLS_IE) + h->got.offset = (bfd_vma) -1; + else if (h->got.refcount > 0) { asection *s; - boolean dyn; + bfd_boolean dyn; + int tls_type = elf64_x86_64_hash_entry (h)->tls_type; /* Make sure this symbol is output as a dynamic symbol. Undefined weak syms won't yet be marked as dynamic. */ if (h->dynindx == -1 && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) { - if (! bfd_elf64_link_record_dynamic_symbol (info, h)) - return false; + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } s = htab->sgot; h->got.offset = s->_raw_size; s->_raw_size += GOT_ENTRY_SIZE; + /* R_X86_64_TLSGD needs 2 consecutive GOT slots. */ + if (tls_type == GOT_TLS_GD) + s->_raw_size += GOT_ENTRY_SIZE; dyn = htab->elf.dynamic_sections_created; - if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h)) + /* R_X86_64_TLSGD needs one dynamic relocation if local symbol + and two if global. + R_X86_64_GOTTPOFF needs one dynamic relocation. */ + if ((tls_type == GOT_TLS_GD && h->dynindx == -1) + || tls_type == GOT_TLS_IE) + htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); + else if (tls_type == GOT_TLS_GD) + htab->srelgot->_raw_size += 2 * sizeof (Elf64_External_Rela); + else if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) + && (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, 0, h))) htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); } else @@ -1255,7 +1384,7 @@ allocate_dynrelocs (h, inf) eh = (struct elf64_x86_64_link_hash_entry *) h; if (eh->dyn_relocs == NULL) - return true; + return TRUE; /* In the shared -Bsymbolic case, discard space allocated for dynamic pc-relative relocs against symbols which turn out to be @@ -1265,9 +1394,13 @@ allocate_dynrelocs (h, inf) if (info->shared) { - if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 - && ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0 - || info->symbolic)) + /* Relocs that use pc_count are those that appear on a call + insn, or certain REL relocs that can generated via assembly. + We want calls to protected symbols to resolve directly to the + function rather than going via the plt. If people want + function pointer comparisons to work as expected then they + should avoid writing weird assembly. */ + if (SYMBOL_CALLS_LOCAL (info, h)) { struct elf64_x86_64_dyn_relocs **pp; @@ -1281,8 +1414,14 @@ allocate_dynrelocs (h, inf) pp = &p->next; } } + + /* Also discard relocs on undefined weak syms with non-default + visibility. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + eh->dyn_relocs = NULL; } - else + else if (ELIMINATE_COPY_RELOCS) { /* For the non-shared case, discard space for relocs against symbols which turn out to need copy relocs or are not @@ -1300,8 +1439,8 @@ allocate_dynrelocs (h, inf) if (h->dynindx == -1 && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) { - if (! bfd_elf64_link_record_dynamic_symbol (info, h)) - return false; + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } /* If that succeeded, we know we'll be keeping all the @@ -1322,15 +1461,13 @@ allocate_dynrelocs (h, inf) sreloc->_raw_size += p->count * sizeof (Elf64_External_Rela); } - return true; + return TRUE; } /* Find any dynamic relocs that apply to read-only sections. */ -static boolean -readonly_dynrelocs (h, inf) - struct elf_link_hash_entry *h; - PTR inf; +static bfd_boolean +readonly_dynrelocs (struct elf_link_hash_entry *h, void * inf) { struct elf64_x86_64_link_hash_entry *eh; struct elf64_x86_64_dyn_relocs *p; @@ -1350,23 +1487,22 @@ readonly_dynrelocs (h, inf) info->flags |= DF_TEXTREL; /* Not an error, just cut short the traversal. */ - return false; + return FALSE; } } - return true; + return TRUE; } /* Set the sizes of the dynamic sections. */ -static boolean -elf64_x86_64_size_dynamic_sections (output_bfd, info) - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *info; +static bfd_boolean +elf64_x86_64_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info) { struct elf64_x86_64_link_hash_table *htab; bfd *dynobj; asection *s; - boolean relocs; + bfd_boolean relocs; bfd *ibfd; htab = elf64_x86_64_hash_table (info); @@ -1377,7 +1513,7 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info) if (htab->elf.dynamic_sections_created) { /* Set the contents of the .interp section to the interpreter. */ - if (! info->shared) + if (info->executable) { s = bfd_get_section_by_name (dynobj, ".interp"); if (s == NULL) @@ -1393,6 +1529,7 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info) { bfd_signed_vma *local_got; bfd_signed_vma *end_local_got; + char *local_tls_type; bfd_size_type locsymcount; Elf_Internal_Shdr *symtab_hdr; asection *srel; @@ -1435,15 +1572,20 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info) symtab_hdr = &elf_tdata (ibfd)->symtab_hdr; locsymcount = symtab_hdr->sh_info; end_local_got = local_got + locsymcount; + local_tls_type = elf64_x86_64_local_got_tls_type (ibfd); s = htab->sgot; srel = htab->srelgot; - for (; local_got < end_local_got; ++local_got) + for (; local_got < end_local_got; ++local_got, ++local_tls_type) { if (*local_got > 0) { *local_got = s->_raw_size; s->_raw_size += GOT_ENTRY_SIZE; - if (info->shared) + if (*local_tls_type == GOT_TLS_GD) + s->_raw_size += GOT_ENTRY_SIZE; + if (info->shared + || *local_tls_type == GOT_TLS_GD + || *local_tls_type == GOT_TLS_IE) srel->_raw_size += sizeof (Elf64_External_Rela); } else @@ -1451,13 +1593,24 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info) } } + if (htab->tls_ld_got.refcount > 0) + { + /* Allocate 2 got entries and 1 dynamic reloc for R_X86_64_TLSLD + relocs. */ + htab->tls_ld_got.offset = htab->sgot->_raw_size; + htab->sgot->_raw_size += 2 * GOT_ENTRY_SIZE; + htab->srelgot->_raw_size += sizeof (Elf64_External_Rela); + } + else + htab->tls_ld_got.offset = -1; + /* Allocate global sym .plt and .got entries, and space for global sym dynamic relocs. */ elf_link_hash_traverse (&htab->elf, allocate_dynrelocs, (PTR) info); /* We now have determined the sizes of the various dynamic sections. Allocate memory for them. */ - relocs = false; + relocs = FALSE; for (s = dynobj->sections; s != NULL; s = s->next) { if ((s->flags & SEC_LINKER_CREATED) == 0) @@ -1473,7 +1626,7 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info) else if (strncmp (bfd_get_section_name (dynobj, s), ".rela", 5) == 0) { if (s->_raw_size != 0 && s != htab->srelplt) - relocs = true; + relocs = TRUE; /* We use the reloc_count field as a counter if we need to copy relocs into the output file. */ @@ -1508,7 +1661,7 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info) of garbage. */ s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL) - return false; + return FALSE; } if (htab->elf.dynamic_sections_created) @@ -1519,12 +1672,12 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info) the .dynamic section. The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ #define add_dynamic_entry(TAG, VAL) \ - bfd_elf64_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + _bfd_elf_add_dynamic_entry (info, TAG, VAL) - if (! info->shared) + if (info->executable) { if (!add_dynamic_entry (DT_DEBUG, 0)) - return false; + return FALSE; } if (htab->splt->_raw_size != 0) @@ -1533,7 +1686,7 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info) || !add_dynamic_entry (DT_PLTRELSZ, 0) || !add_dynamic_entry (DT_PLTREL, DT_RELA) || !add_dynamic_entry (DT_JMPREL, 0)) - return false; + return FALSE; } if (relocs) @@ -1541,7 +1694,7 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info) if (!add_dynamic_entry (DT_RELA, 0) || !add_dynamic_entry (DT_RELASZ, 0) || !add_dynamic_entry (DT_RELAENT, sizeof (Elf64_External_Rela))) - return false; + return FALSE; /* If any dynamic relocs apply to a read-only section, then we need a DT_TEXTREL entry. */ @@ -1552,28 +1705,50 @@ elf64_x86_64_size_dynamic_sections (output_bfd, info) if ((info->flags & DF_TEXTREL) != 0) { if (!add_dynamic_entry (DT_TEXTREL, 0)) - return false; + return FALSE; } } } #undef add_dynamic_entry - return true; + return TRUE; +} + +/* Return the base VMA address which should be subtracted from real addresses + when resolving @dtpoff relocation. + This is PT_TLS segment p_vaddr. */ + +static bfd_vma +dtpoff_base (struct bfd_link_info *info) +{ + /* If tls_sec is NULL, we should have signalled an error already. */ + if (elf_hash_table (info)->tls_sec == NULL) + return 0; + return elf_hash_table (info)->tls_sec->vma; +} + +/* Return the relocation value for @tpoff relocation + if STT_TLS virtual address is ADDRESS. */ + +static bfd_vma +tpoff (struct bfd_link_info *info, bfd_vma address) +{ + struct elf_link_hash_table *htab = elf_hash_table (info); + + /* If tls_segment is NULL, we should have signalled an error already. */ + if (htab->tls_sec == NULL) + return 0; + return address - htab->tls_size - htab->tls_sec->vma; } /* 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; +static bfd_boolean +elf64_x86_64_relocate_section (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 elf64_x86_64_link_hash_table *htab; Elf_Internal_Shdr *symtab_hdr; @@ -1582,8 +1757,8 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; htab = elf64_x86_64_hash_table (info); symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; @@ -1594,7 +1769,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, relend = relocs + input_section->reloc_count; for (; rel < relend; rel++) { - int r_type; + unsigned int r_type; reloc_howto_type *howto; unsigned long r_symndx; struct elf_link_hash_entry *h; @@ -1602,18 +1777,19 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, asection *sec; bfd_vma off; bfd_vma relocation; - boolean unresolved_reloc; + bfd_boolean unresolved_reloc; bfd_reloc_status_type r; + int tls_type; r_type = ELF64_R_TYPE (rel->r_info); if (r_type == (int) R_X86_64_GNU_VTINHERIT || r_type == (int) R_X86_64_GNU_VTENTRY) continue; - if (r_type < 0 || r_type >= R_X86_64_max) + if (r_type >= R_X86_64_max) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } howto = x86_64_elf_howto_table + r_type; @@ -1621,56 +1797,22 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, h = NULL; sym = NULL; sec = NULL; - unresolved_reloc = false; + unresolved_reloc = FALSE; if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; sec = local_sections[r_symndx]; - relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel); + relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel); } 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; + bfd_boolean warned; - if (h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - { - sec = h->root.u.def.section; - if (sec->output_section == NULL) - { - /* Set a flag that will be cleared later if we find a - relocation value for this symbol. output_section - is typically NULL for symbols satisfied by a shared - library. */ - unresolved_reloc = true; - 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->allow_shlib_undefined) - && !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, rel->r_offset, - (!info->shared || info->no_undefined - || ELF_ST_VISIBILITY (h->other))))) - return false; - relocation = 0; - } + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sec, relocation, + unresolved_reloc, warned); } /* When generating a shared object, the relocations handled here are copied into the output file to be resolved at run time. */ @@ -1686,17 +1828,16 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, if (h != NULL) { - boolean dyn; + bfd_boolean dyn; off = h->got.offset; dyn = htab->elf.dynamic_sections_created; - if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info, h) + if (! WILL_CALL_FINISH_DYNAMIC_SYMBOL (dyn, info->shared, h) || (info->shared - && (info->symbolic - || h->dynindx == -1 - || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + && SYMBOL_REFERENCES_LOCAL (info, h)) + || (ELF_ST_VISIBILITY (h->other) + && h->root.type == bfd_link_hash_undefweak)) { /* This is actually a static link, or it is a -Bsymbolic link and the symbol is defined locally, or the symbol @@ -1719,7 +1860,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, } } else - unresolved_reloc = false; + unresolved_reloc = FALSE; } else { @@ -1740,14 +1881,14 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, if (info->shared) { - asection *srelgot; + asection *s; Elf_Internal_Rela outrel; - Elf64_External_Rela *loc; + bfd_byte *loc; /* We need to generate a R_X86_64_RELATIVE reloc for the dynamic linker. */ - srelgot = htab->srelgot; - if (srelgot == NULL) + s = htab->srelgot; + if (s == NULL) abort (); outrel.r_offset = (htab->sgot->output_section->vma @@ -1755,8 +1896,8 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, + off); outrel.r_info = ELF64_R_INFO (0, R_X86_64_RELATIVE); outrel.r_addend = relocation; - loc = (Elf64_External_Rela *) srelgot->contents; - loc += srelgot->reloc_count++; + loc = s->contents; + loc += s->reloc_count++ * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); } @@ -1794,7 +1935,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (htab->splt->output_section->vma + htab->splt->output_offset + h->plt.offset); - unresolved_reloc = false; + unresolved_reloc = FALSE; break; case R_X86_64_PC8: @@ -1815,15 +1956,15 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, break; if ((info->shared + && (h == NULL + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak) && ((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)))) - || (!info->shared + || !SYMBOL_CALLS_LOCAL (info, h))) + || (ELIMINATE_COPY_RELOCS + && !info->shared && h != NULL && h->dynindx != -1 && (h->elf_link_hash_flags & ELF_LINK_NON_GOT_REF) == 0 @@ -1835,24 +1976,23 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, || h->root.type == bfd_link_hash_undefined))) { Elf_Internal_Rela outrel; - boolean skip, relocate; + bfd_byte *loc; + bfd_boolean skip, relocate; asection *sreloc; - Elf64_External_Rela *loc; /* When generating a shared object, these relocations are copied into the output file to be resolved at run time. */ - - skip = false; - relocate = false; + skip = FALSE; + relocate = FALSE; outrel.r_offset = _bfd_elf_section_offset (output_bfd, info, input_section, rel->r_offset); if (outrel.r_offset == (bfd_vma) -1) - skip = true; + skip = TRUE; else if (outrel.r_offset == (bfd_vma) -2) - skip = true, relocate = true; + skip = TRUE, relocate = TRUE; outrel.r_offset += (input_section->output_section->vma + input_section->output_offset); @@ -1880,7 +2020,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, /* This symbol is local, or marked to become local. */ if (r_type == R_X86_64_64) { - relocate = true; + relocate = TRUE; outrel.r_info = ELF64_R_INFO (0, R_X86_64_RELATIVE); outrel.r_addend = relocation + rel->r_addend; } @@ -1888,21 +2028,12 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, { long sindx; - if (h == NULL) - sec = local_sections[r_symndx]; - else - { - BFD_ASSERT (h->root.type == bfd_link_hash_defined - || (h->root.type - == bfd_link_hash_defweak)); - sec = h->root.u.def.section; - } - if (sec != NULL && bfd_is_abs_section (sec)) + if (bfd_is_abs_section (sec)) sindx = 0; else if (sec == NULL || sec->owner == NULL) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } else { @@ -1922,8 +2053,8 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, if (sreloc == NULL) abort (); - loc = (Elf64_External_Rela *) sreloc->contents; - loc += sreloc->reloc_count++; + loc = sreloc->contents; + loc += sreloc->reloc_count++ * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); /* If this reloc is against an external symbol, we do @@ -1936,6 +2067,314 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, break; + case R_X86_64_TLSGD: + case R_X86_64_GOTTPOFF: + r_type = elf64_x86_64_tls_transition (info, r_type, h == NULL); + tls_type = GOT_UNKNOWN; + if (h == NULL && local_got_offsets) + tls_type = elf64_x86_64_local_got_tls_type (input_bfd) [r_symndx]; + else if (h != NULL) + { + tls_type = elf64_x86_64_hash_entry (h)->tls_type; + if (!info->shared && h->dynindx == -1 && tls_type == GOT_TLS_IE) + r_type = R_X86_64_TPOFF32; + } + if (r_type == R_X86_64_TLSGD) + { + if (tls_type == GOT_TLS_IE) + r_type = R_X86_64_GOTTPOFF; + } + + if (r_type == R_X86_64_TPOFF32) + { + BFD_ASSERT (! unresolved_reloc); + if (ELF64_R_TYPE (rel->r_info) == R_X86_64_TLSGD) + { + unsigned int i; + static unsigned char tlsgd[8] + = { 0x66, 0x48, 0x8d, 0x3d, 0x66, 0x66, 0x48, 0xe8 }; + + /* GD->LE transition. + .byte 0x66; leaq foo@tlsgd(%rip), %rdi + .word 0x6666; rex64; call __tls_get_addr@plt + Change it into: + movq %fs:0, %rax + leaq foo@tpoff(%rax), %rax */ + BFD_ASSERT (rel->r_offset >= 4); + for (i = 0; i < 4; i++) + BFD_ASSERT (bfd_get_8 (input_bfd, + contents + rel->r_offset - 4 + i) + == tlsgd[i]); + BFD_ASSERT (rel->r_offset + 12 <= input_section->_raw_size); + for (i = 0; i < 4; i++) + BFD_ASSERT (bfd_get_8 (input_bfd, + contents + rel->r_offset + 4 + i) + == tlsgd[i+4]); + BFD_ASSERT (rel + 1 < relend); + BFD_ASSERT (ELF64_R_TYPE (rel[1].r_info) == R_X86_64_PLT32); + memcpy (contents + rel->r_offset - 4, + "\x64\x48\x8b\x04\x25\0\0\0\0\x48\x8d\x80\0\0\0", + 16); + bfd_put_32 (output_bfd, tpoff (info, relocation), + contents + rel->r_offset + 8); + /* Skip R_X86_64_PLT32. */ + rel++; + continue; + } + else + { + unsigned int val, type, reg; + + /* IE->LE transition: + Originally it can be one of: + movq foo@gottpoff(%rip), %reg + addq foo@gottpoff(%rip), %reg + We change it into: + movq $foo, %reg + leaq foo(%reg), %reg + addq $foo, %reg. */ + BFD_ASSERT (rel->r_offset >= 3); + val = bfd_get_8 (input_bfd, contents + rel->r_offset - 3); + BFD_ASSERT (val == 0x48 || val == 0x4c); + type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2); + BFD_ASSERT (type == 0x8b || type == 0x03); + reg = bfd_get_8 (input_bfd, contents + rel->r_offset - 1); + BFD_ASSERT ((reg & 0xc7) == 5); + reg >>= 3; + BFD_ASSERT (rel->r_offset + 4 <= input_section->_raw_size); + if (type == 0x8b) + { + /* movq */ + if (val == 0x4c) + bfd_put_8 (output_bfd, 0x49, + contents + rel->r_offset - 3); + bfd_put_8 (output_bfd, 0xc7, + contents + rel->r_offset - 2); + bfd_put_8 (output_bfd, 0xc0 | reg, + contents + rel->r_offset - 1); + } + else if (reg == 4) + { + /* addq -> addq - addressing with %rsp/%r12 is + special */ + if (val == 0x4c) + bfd_put_8 (output_bfd, 0x49, + contents + rel->r_offset - 3); + bfd_put_8 (output_bfd, 0x81, + contents + rel->r_offset - 2); + bfd_put_8 (output_bfd, 0xc0 | reg, + contents + rel->r_offset - 1); + } + else + { + /* addq -> leaq */ + if (val == 0x4c) + bfd_put_8 (output_bfd, 0x4d, + contents + rel->r_offset - 3); + bfd_put_8 (output_bfd, 0x8d, + contents + rel->r_offset - 2); + bfd_put_8 (output_bfd, 0x80 | reg | (reg << 3), + contents + rel->r_offset - 1); + } + bfd_put_32 (output_bfd, tpoff (info, relocation), + contents + rel->r_offset); + continue; + } + } + + if (htab->sgot == NULL) + abort (); + + if (h != NULL) + off = h->got.offset; + else + { + if (local_got_offsets == NULL) + abort (); + + off = local_got_offsets[r_symndx]; + } + + if ((off & 1) != 0) + off &= ~1; + else + { + Elf_Internal_Rela outrel; + bfd_byte *loc; + int dr_type, indx; + + if (htab->srelgot == NULL) + abort (); + + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off); + + indx = h && h->dynindx != -1 ? h->dynindx : 0; + if (r_type == R_X86_64_TLSGD) + dr_type = R_X86_64_DTPMOD64; + else + dr_type = R_X86_64_TPOFF64; + + bfd_put_64 (output_bfd, 0, htab->sgot->contents + off); + outrel.r_addend = 0; + if (dr_type == R_X86_64_TPOFF64 && indx == 0) + outrel.r_addend = relocation - dtpoff_base (info); + outrel.r_info = ELF64_R_INFO (indx, dr_type); + + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + + if (r_type == R_X86_64_TLSGD) + { + if (indx == 0) + { + BFD_ASSERT (! unresolved_reloc); + bfd_put_64 (output_bfd, + relocation - dtpoff_base (info), + htab->sgot->contents + off + GOT_ENTRY_SIZE); + } + else + { + bfd_put_64 (output_bfd, 0, + htab->sgot->contents + off + GOT_ENTRY_SIZE); + outrel.r_info = ELF64_R_INFO (indx, + R_X86_64_DTPOFF64); + outrel.r_offset += GOT_ENTRY_SIZE; + htab->srelgot->reloc_count++; + loc += sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + } + } + + if (h != NULL) + h->got.offset |= 1; + else + local_got_offsets[r_symndx] |= 1; + } + + if (off >= (bfd_vma) -2) + abort (); + if (r_type == ELF64_R_TYPE (rel->r_info)) + { + relocation = htab->sgot->output_section->vma + + htab->sgot->output_offset + off; + unresolved_reloc = FALSE; + } + else + { + unsigned int i; + static unsigned char tlsgd[8] + = { 0x66, 0x48, 0x8d, 0x3d, 0x66, 0x66, 0x48, 0xe8 }; + + /* GD->IE transition. + .byte 0x66; leaq foo@tlsgd(%rip), %rdi + .word 0x6666; rex64; call __tls_get_addr@plt + Change it into: + movq %fs:0, %rax + addq foo@gottpoff(%rip), %rax */ + BFD_ASSERT (rel->r_offset >= 4); + for (i = 0; i < 4; i++) + BFD_ASSERT (bfd_get_8 (input_bfd, + contents + rel->r_offset - 4 + i) + == tlsgd[i]); + BFD_ASSERT (rel->r_offset + 12 <= input_section->_raw_size); + for (i = 0; i < 4; i++) + BFD_ASSERT (bfd_get_8 (input_bfd, + contents + rel->r_offset + 4 + i) + == tlsgd[i+4]); + BFD_ASSERT (rel + 1 < relend); + BFD_ASSERT (ELF64_R_TYPE (rel[1].r_info) == R_X86_64_PLT32); + memcpy (contents + rel->r_offset - 4, + "\x64\x48\x8b\x04\x25\0\0\0\0\x48\x03\x05\0\0\0", + 16); + + relocation = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off + - rel->r_offset + - input_section->output_section->vma + - input_section->output_offset + - 12); + bfd_put_32 (output_bfd, relocation, + contents + rel->r_offset + 8); + /* Skip R_X86_64_PLT32. */ + rel++; + continue; + } + break; + + case R_X86_64_TLSLD: + if (! info->shared) + { + /* LD->LE transition: + Ensure it is: + leaq foo@tlsld(%rip), %rdi; call __tls_get_addr@plt. + We change it into: + .word 0x6666; .byte 0x66; movl %fs:0, %rax. */ + BFD_ASSERT (rel->r_offset >= 3); + BFD_ASSERT (bfd_get_8 (input_bfd, contents + rel->r_offset - 3) + == 0x48); + BFD_ASSERT (bfd_get_8 (input_bfd, contents + rel->r_offset - 2) + == 0x8d); + BFD_ASSERT (bfd_get_8 (input_bfd, contents + rel->r_offset - 1) + == 0x3d); + BFD_ASSERT (rel->r_offset + 9 <= input_section->_raw_size); + BFD_ASSERT (bfd_get_8 (input_bfd, contents + rel->r_offset + 4) + == 0xe8); + BFD_ASSERT (rel + 1 < relend); + BFD_ASSERT (ELF64_R_TYPE (rel[1].r_info) == R_X86_64_PLT32); + memcpy (contents + rel->r_offset - 3, + "\x66\x66\x66\x64\x48\x8b\x04\x25\0\0\0", 12); + /* Skip R_X86_64_PLT32. */ + rel++; + continue; + } + + if (htab->sgot == NULL) + abort (); + + off = htab->tls_ld_got.offset; + if (off & 1) + off &= ~1; + else + { + Elf_Internal_Rela outrel; + bfd_byte *loc; + + if (htab->srelgot == NULL) + abort (); + + outrel.r_offset = (htab->sgot->output_section->vma + + htab->sgot->output_offset + off); + + bfd_put_64 (output_bfd, 0, + htab->sgot->contents + off); + bfd_put_64 (output_bfd, 0, + htab->sgot->contents + off + GOT_ENTRY_SIZE); + outrel.r_info = ELF64_R_INFO (0, R_X86_64_DTPMOD64); + outrel.r_addend = 0; + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ * sizeof (Elf64_External_Rela); + bfd_elf64_swap_reloca_out (output_bfd, &outrel, loc); + htab->tls_ld_got.offset |= 1; + } + relocation = htab->sgot->output_section->vma + + htab->sgot->output_offset + off; + unresolved_reloc = FALSE; + break; + + case R_X86_64_DTPOFF32: + if (info->shared || (input_section->flags & SEC_CODE) == 0) + relocation -= dtpoff_base (info); + else + relocation = tpoff (info, relocation); + break; + + case R_X86_64_TPOFF32: + BFD_ASSERT (! info->shared); + relocation = tpoff (info, relocation); + break; + default: break; } @@ -1969,7 +2408,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, symtab_hdr->sh_link, sym->st_name); if (name == NULL) - return false; + return FALSE; if (*name == '\0') name = bfd_section_name (input_bfd, sec); } @@ -1980,7 +2419,7 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, if (! ((*info->callbacks->reloc_overflow) (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset))) - return false; + return FALSE; } else { @@ -1989,23 +2428,22 @@ elf64_x86_64_relocate_section (output_bfd, info, input_bfd, input_section, bfd_archive_filename (input_bfd), bfd_get_section_name (input_bfd, input_section), (long) rel->r_offset, name, (int) r); - return false; + return FALSE; } } } - return true; + 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; +static bfd_boolean +elf64_x86_64_finish_dynamic_symbol (bfd *output_bfd, + struct bfd_link_info *info, + struct elf_link_hash_entry *h, + Elf_Internal_Sym *sym) { struct elf64_x86_64_link_hash_table *htab; @@ -2016,11 +2454,10 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym) bfd_vma plt_index; bfd_vma got_offset; Elf_Internal_Rela rela; - Elf64_External_Rela *loc; + bfd_byte *loc; /* This symbol has an entry in the procedure linkage table. Set it up. */ - if (h->dynindx == -1 || htab->splt == NULL || htab->sgotplt == NULL @@ -2076,7 +2513,7 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym) + got_offset); rela.r_info = ELF64_R_INFO (h->dynindx, R_X86_64_JUMP_SLOT); rela.r_addend = 0; - loc = (Elf64_External_Rela *) htab->srelplt->contents + plt_index; + loc = htab->srelplt->contents + plt_index * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) @@ -2090,14 +2527,15 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym) } } - if (h->got.offset != (bfd_vma) -1) + if (h->got.offset != (bfd_vma) -1 + && elf64_x86_64_hash_entry (h)->tls_type != GOT_TLS_GD + && elf64_x86_64_hash_entry (h)->tls_type != GOT_TLS_IE) { Elf_Internal_Rela rela; - Elf64_External_Rela *loc; + bfd_byte *loc; /* This symbol has an entry in the global offset table. Set it - up. */ - + up. */ if (htab->sgot == NULL || htab->srelgot == NULL) abort (); @@ -2111,10 +2549,7 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym) The entry in the global offset table will already have been initialized in the relocate_section function. */ if (info->shared - && (info->symbolic - || h->dynindx == -1 - || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL)) - && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR)) + && SYMBOL_REFERENCES_LOCAL (info, h)) { BFD_ASSERT((h->got.offset & 1) != 0); rela.r_info = ELF64_R_INFO (0, R_X86_64_RELATIVE); @@ -2131,15 +2566,15 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym) rela.r_addend = 0; } - loc = (Elf64_External_Rela *) htab->srelgot->contents; - loc += htab->srelgot->reloc_count++; + loc = htab->srelgot->contents; + loc += htab->srelgot->reloc_count++ * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); } if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) { Elf_Internal_Rela rela; - Elf64_External_Rela *loc; + bfd_byte *loc; /* This symbol needs a copy reloc. Set it up. */ @@ -2154,8 +2589,8 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym) + h->root.u.def.section->output_offset); rela.r_info = ELF64_R_INFO (h->dynindx, R_X86_64_COPY); rela.r_addend = 0; - loc = (Elf64_External_Rela *) htab->srelbss->contents; - loc += htab->srelbss->reloc_count++; + loc = htab->srelbss->contents; + loc += htab->srelbss->reloc_count++ * sizeof (Elf64_External_Rela); bfd_elf64_swap_reloca_out (output_bfd, &rela, loc); } @@ -2164,15 +2599,14 @@ elf64_x86_64_finish_dynamic_symbol (output_bfd, info, h, sym) || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) sym->st_shndx = SHN_ABS; - return true; + return TRUE; } /* Used to decide how to sort relocs in an optimal manner for the dynamic linker, before writing them out. */ static enum elf_reloc_type_class -elf64_x86_64_reloc_type_class (rela) - const Elf_Internal_Rela *rela; +elf64_x86_64_reloc_type_class (const Elf_Internal_Rela *rela) { switch ((int) ELF64_R_TYPE (rela->r_info)) { @@ -2189,10 +2623,8 @@ elf64_x86_64_reloc_type_class (rela) /* Finish up the dynamic sections. */ -static boolean -elf64_x86_64_finish_dynamic_sections (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +static bfd_boolean +elf64_x86_64_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info) { struct elf64_x86_64_link_hash_table *htab; bfd *dynobj; @@ -2315,7 +2747,7 @@ elf64_x86_64_finish_dynamic_sections (output_bfd, info) GOT_ENTRY_SIZE; } - return true; + return TRUE; } @@ -2331,7 +2763,6 @@ elf64_x86_64_finish_dynamic_sections (output_bfd, info) #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_backend_rela_normal 1 #define elf_info_to_howto elf64_x86_64_info_to_howto @@ -2354,5 +2785,6 @@ elf64_x86_64_finish_dynamic_sections (output_bfd, info) #define elf_backend_relocate_section elf64_x86_64_relocate_section #define elf_backend_size_dynamic_sections elf64_x86_64_size_dynamic_sections #define elf_backend_object_p elf64_x86_64_elf_object_p +#define bfd_elf64_mkobject elf64_x86_64_mkobject #include "elf64-target.h" diff --git a/contrib/binutils/bfd/elfarm-nabi.c b/contrib/binutils/bfd/elfarm-nabi.c index 2d791de..5ecbe8e 100644 --- a/contrib/binutils/bfd/elfarm-nabi.c +++ b/contrib/binutils/bfd/elfarm-nabi.c @@ -1,5 +1,5 @@ /* 32-bit ELF support for ARM new abi option. - Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -27,7 +27,7 @@ #define NUM_ELEM(a) (sizeof (a) / (sizeof (a)[0])) #endif -#define USE_REL +#define USE_REL 1 #define TARGET_LITTLE_SYM bfd_elf32_littlearm_vec #define TARGET_LITTLE_NAME "elf32-littlearm" @@ -42,9 +42,9 @@ static reloc_howto_type * elf32_arm_reloc_type_lookup PARAMS ((bfd * abfd, bfd_reloc_code_real_type code)); -static boolean elf32_arm_nabi_grok_prstatus +static bfd_boolean elf32_arm_nabi_grok_prstatus PARAMS ((bfd *abfd, Elf_Internal_Note *note)); -static boolean elf32_arm_nabi_grok_psinfo +static bfd_boolean elf32_arm_nabi_grok_psinfo PARAMS ((bfd *abfd, Elf_Internal_Note *note)); /* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g. @@ -58,247 +58,247 @@ static reloc_howto_type elf32_arm_howto_table[] = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_NONE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_PC24, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 24, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_PC24", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x00ffffff, /* src_mask */ 0x00ffffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* 32 bit absolute */ HOWTO (R_ARM_ABS32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_ABS32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* standard 32bit pc-relative reloc */ HOWTO (R_ARM_REL32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_REL32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* 8 bit absolute */ HOWTO (R_ARM_PC13, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_PC13", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x000000ff, /* src_mask */ 0x000000ff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 16 bit absolute */ HOWTO (R_ARM_ABS16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_ABS16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x0000ffff, /* src_mask */ 0x0000ffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 12 bit absolute */ HOWTO (R_ARM_ABS12, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_ABS12", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x000008ff, /* src_mask */ 0x000008ff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_THM_ABS5, /* type */ 6, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 5, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_THM_ABS5", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x000007e0, /* src_mask */ 0x000007e0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 8 bit absolute */ HOWTO (R_ARM_ABS8, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_ABS8", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x000000ff, /* src_mask */ 0x000000ff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_SBREL32, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_SBREL32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_THM_PC22, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 23, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_THM_PC22", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x07ff07ff, /* src_mask */ 0x07ff07ff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ HOWTO (R_ARM_THM_PC8, /* type */ 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_THM_PC8", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x000000ff, /* src_mask */ 0x000000ff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ HOWTO (R_ARM_AMP_VCALL9, /* type */ 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_AMP_VCALL9", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x000000ff, /* src_mask */ 0x000000ff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ HOWTO (R_ARM_SWI24, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_SWI24", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x00000000, /* src_mask */ 0x00000000, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_THM_SWI8, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_SWI8", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x00000000, /* src_mask */ 0x00000000, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* BLX instruction for the ARM. */ HOWTO (R_ARM_XPC25, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 25, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_XPC25", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x00ffffff, /* src_mask */ 0x00ffffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* BLX instruction for the Thumb. */ HOWTO (R_ARM_THM_XPC22, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 22, /* bitsize */ - true, /* pc_relative */ + 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 */ + FALSE, /* partial_inplace */ 0x07ff07ff, /* src_mask */ 0x07ff07ff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* These next three relocs are not defined, but we need to fill the space. */ @@ -306,43 +306,43 @@ static reloc_howto_type elf32_arm_howto_table[] = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_unknown_17", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_NONE, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_unknown_18", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_NONE, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_unknown_19", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Relocs used in ARM Linux */ @@ -350,113 +350,113 @@ static reloc_howto_type elf32_arm_howto_table[] = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_COPY", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_GLOB_DAT, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_GLOB_DAT", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_JUMP_SLOT, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_JUMP_SLOT", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_RELATIVE, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_RELATIVE", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_GOTOFF, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_GOTOFF", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_GOTPC, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_GOTPC", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ HOWTO (R_ARM_GOT32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_GOT32", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_PLT32, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_PLT32", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0x00ffffff, /* src_mask */ 0x00ffffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* End of relocs used in ARM Linux */ @@ -464,57 +464,57 @@ static reloc_howto_type elf32_arm_howto_table[] = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_RREL32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_RABS32, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_RABS32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_RPC24, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_RPC24", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_RBASE, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_RBASE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ }; @@ -524,15 +524,15 @@ static reloc_howto_type elf32_arm_vtinherit_howto = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ NULL, /* special_function */ "R_ARM_GNU_VTINHERIT", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false); /* pcrel_offset */ + FALSE); /* pcrel_offset */ /* GNU extension to record C++ vtable member usage */ static reloc_howto_type elf32_arm_vtentry_howto = @@ -540,15 +540,15 @@ static reloc_howto_type elf32_arm_vtentry_howto = 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ _bfd_elf_rel_vtable_reloc_fn, /* special_function */ "R_ARM_GNU_VTENTRY", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false); /* pcrel_offset */ + FALSE); /* pcrel_offset */ /* 12 bit pc relative */ static reloc_howto_type elf32_arm_thm_pc11_howto = @@ -556,15 +556,15 @@ static reloc_howto_type elf32_arm_thm_pc11_howto = 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 11, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_THM_PC11", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x000007ff, /* src_mask */ 0x000007ff, /* dst_mask */ - true); /* pcrel_offset */ + TRUE); /* pcrel_offset */ /* 12 bit pc relative */ static reloc_howto_type elf32_arm_thm_pc9_howto = @@ -572,24 +572,24 @@ static reloc_howto_type elf32_arm_thm_pc9_howto = 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_THM_PC9", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x000000ff, /* src_mask */ 0x000000ff, /* dst_mask */ - true); /* pcrel_offset */ + TRUE); /* pcrel_offset */ static void elf32_arm_info_to_howto - PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); + PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); static void elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) bfd * abfd ATTRIBUTE_UNUSED; arelent * bfd_reloc; - Elf32_Internal_Rel * elf_reloc; + Elf_Internal_Rela * elf_reloc; { unsigned int r_type; @@ -682,7 +682,7 @@ elf32_arm_reloc_type_lookup (abfd, code) } /* Support for core dump NOTE sections */ -static boolean +static bfd_boolean elf32_arm_nabi_grok_prstatus (abfd, note) bfd *abfd; Elf_Internal_Note *note; @@ -693,7 +693,7 @@ elf32_arm_nabi_grok_prstatus (abfd, note) switch (note->descsz) { default: - return false; + return FALSE; case 148: /* Linux/ARM 32-bit*/ /* pr_cursig */ @@ -714,7 +714,7 @@ elf32_arm_nabi_grok_prstatus (abfd, note) raw_size, note->descpos + offset); } -static boolean +static bfd_boolean elf32_arm_nabi_grok_psinfo (abfd, note) bfd *abfd; Elf_Internal_Note *note; @@ -722,7 +722,7 @@ elf32_arm_nabi_grok_psinfo (abfd, note) switch (note->descsz) { default: - return false; + return FALSE; case 124: /* Linux/ARM elf_prpsinfo */ elf_tdata (abfd)->core_program @@ -743,7 +743,7 @@ elf32_arm_nabi_grok_psinfo (abfd, note) command[n - 1] = '\0'; } - return true; + return TRUE; } #define elf_backend_grok_prstatus elf32_arm_nabi_grok_prstatus diff --git a/contrib/binutils/bfd/elfarm-oabi.c b/contrib/binutils/bfd/elfarm-oabi.c index c8e3fe6..08ba41e 100644 --- a/contrib/binutils/bfd/elfarm-oabi.c +++ b/contrib/binutils/bfd/elfarm-oabi.c @@ -37,8 +37,6 @@ #define NUM_ELEM(a) (sizeof (a) / sizeof (a)[0]) #endif -#define USE_RELA - #define TARGET_LITTLE_SYM bfd_elf32_littlearm_oabi_vec #define TARGET_LITTLE_NAME "elf32-littlearm-oabi" #define TARGET_BIG_SYM bfd_elf32_bigarm_oabi_vec @@ -51,7 +49,7 @@ #define ARM_ELF_OS_ABI_VERSION 0 static reloc_howto_type * find_howto PARAMS ((unsigned int)); -static void elf32_arm_info_to_howto PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); +static void elf32_arm_info_to_howto PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); static reloc_howto_type * elf32_arm_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); static reloc_howto_type elf32_arm_howto_table[] = @@ -61,220 +59,220 @@ static reloc_howto_type elf32_arm_howto_table[] = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_NONE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_PC24, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 24, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_PC24", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x00ffffff, /* src_mask */ 0x00ffffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* 32 bit absolute. */ HOWTO (R_ARM_ABS32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_ABS32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* Standard 32bit pc-relative reloc. */ HOWTO (R_ARM_REL32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 32, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_REL32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* 8 bit absolute. */ HOWTO (R_ARM_ABS8, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_ABS8", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x000000ff, /* src_mask */ 0x000000ff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 16 bit absolute. */ HOWTO (R_ARM_ABS16, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 16, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_ABS16", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* 12 bit absolute. */ HOWTO (R_ARM_ABS12, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 12, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_ABS12", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x000008ff, /* src_mask */ 0x000008ff, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_THM_ABS5, /* type */ 6, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 5, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_THM_ABS5", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x000007e0, /* src_mask */ 0x000007e0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_THM_PC22, /* type */ 1, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 23, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_THM_PC22", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x07ff07ff, /* src_mask */ 0x07ff07ff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ HOWTO (R_ARM_SBREL32, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_SBREL32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_AMP_VCALL9, /* type */ 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_AMP_VCALL9", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x000000ff, /* src_mask */ 0x000000ff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* 12 bit pc relative. */ HOWTO (R_ARM_THM_PC11, /* type */ 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 11, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_THM_PC11", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x000007ff, /* src_mask */ 0x000007ff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* 12 bit pc relative. */ HOWTO (R_ARM_THM_PC9, /* type */ 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ 8, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_THM_PC9", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0x000000ff, /* src_mask */ 0x000000ff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* GNU extension to record C++ vtable hierarchy. */ HOWTO (R_ARM_GNU_VTINHERIT, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ NULL, /* special_function */ "R_ARM_GNU_VTINHERIT", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* GNU extension to record C++ vtable member usage. */ HOWTO (R_ARM_GNU_VTENTRY, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ _bfd_elf_rel_vtable_reloc_fn, /* special_function */ "R_ARM_GNU_VTENTRY", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ /* XXX - gap in index numbering here. */ @@ -282,15 +280,15 @@ static reloc_howto_type elf32_arm_howto_table[] = 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - true, /* pc_relative */ + TRUE, /* pc_relative */ 0, /* bitpos */ complain_overflow_bitfield,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_PLT32", /* name */ - true, /* partial_inplace */ + TRUE, /* partial_inplace */ 0x00ffffff, /* src_mask */ 0x00ffffff, /* dst_mask */ - true), /* pcrel_offset */ + TRUE), /* pcrel_offset */ /* XXX - gap in index numbering here. */ @@ -298,57 +296,57 @@ static reloc_howto_type elf32_arm_howto_table[] = 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_RREL32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_RABS32, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_RABS32", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_RPC24, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_RPC24", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false), /* pcrel_offset */ + FALSE), /* pcrel_offset */ HOWTO (R_ARM_RBASE, /* type */ 0, /* rightshift */ 0, /* size (0 = byte, 1 = short, 2 = long) */ 0, /* bitsize */ - false, /* pc_relative */ + FALSE, /* pc_relative */ 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_RBASE", /* name */ - false, /* partial_inplace */ + FALSE, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false) /* pcrel_offset */ + FALSE) /* pcrel_offset */ }; /* Locate a reloc in the howto table. This function must be used @@ -371,7 +369,7 @@ static void elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) bfd *abfd ATTRIBUTE_UNUSED; arelent *bfd_reloc; - Elf32_Internal_Rela *elf_reloc; + Elf_Internal_Rela *elf_reloc; { unsigned int r_type; diff --git a/contrib/binutils/bfd/elfcode.h b/contrib/binutils/bfd/elfcode.h index 4f54cd3..bc69d48 100644 --- a/contrib/binutils/bfd/elfcode.h +++ b/contrib/binutils/bfd/elfcode.h @@ -1,6 +1,6 @@ /* ELF executable support for BFD. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 Free Software Foundation, Inc. + 2001, 2002, 2003 Free Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, from information published in "UNIX System V Release 4, Programmers Guide: ANSI C and @@ -102,7 +102,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define elf_get_reloc_upper_bound NAME(bfd_elf,get_reloc_upper_bound) #define elf_canonicalize_reloc NAME(bfd_elf,canonicalize_reloc) #define elf_slurp_symbol_table NAME(bfd_elf,slurp_symbol_table) -#define elf_get_symtab NAME(bfd_elf,get_symtab) +#define elf_canonicalize_symtab NAME(bfd_elf,canonicalize_symtab) #define elf_canonicalize_dynamic_symtab \ NAME(bfd_elf,canonicalize_dynamic_symtab) #define elf_make_empty_symbol NAME(bfd_elf,make_empty_symbol) @@ -115,28 +115,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define elf_no_info_to_howto NAME(bfd_elf,no_info_to_howto) #define elf_no_info_to_howto_rel NAME(bfd_elf,no_info_to_howto_rel) #define elf_find_section NAME(bfd_elf,find_section) -#define elf_bfd_link_add_symbols NAME(bfd_elf,bfd_link_add_symbols) -#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_bfd_discard_info NAME(bfd_elf,discard_info) -#define elf_reloc_symbol_deleted_p NAME(_bfd_elf,reloc_symbol_deleted_p) -#define elf_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol -#define elf_bfd_final_link NAME(bfd_elf,bfd_final_link) -#define elf_create_pointer_linker_section NAME(bfd_elf,create_pointer_linker_section) -#define elf_finish_pointer_linker_section NAME(bfd_elf,finish_pointer_linker_section) -#define elf_gc_sections NAME(_bfd_elf,gc_sections) -#define elf_gc_common_finalize_got_offsets \ - NAME(_bfd_elf,gc_common_finalize_got_offsets) -#define elf_gc_common_final_link NAME(_bfd_elf,gc_common_final_link) -#define elf_gc_record_vtinherit NAME(_bfd_elf,gc_record_vtinherit) -#define elf_gc_record_vtentry NAME(_bfd_elf,gc_record_vtentry) -#define elf_link_record_local_dynamic_symbol \ - NAME(_bfd_elf,link_record_local_dynamic_symbol) #if ARCH_SIZE == 64 #define ELF_R_INFO(X,Y) ELF64_R_INFO(X,Y) @@ -155,31 +137,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define LOG_FILE_ALIGN 2 #endif -/* Static functions */ - -static void elf_swap_ehdr_in - PARAMS ((bfd *, const Elf_External_Ehdr *, Elf_Internal_Ehdr *)); -static void elf_swap_ehdr_out - PARAMS ((bfd *, const Elf_Internal_Ehdr *, Elf_External_Ehdr *)); -static void elf_swap_shdr_in - PARAMS ((bfd *, const Elf_External_Shdr *, Elf_Internal_Shdr *)); -static void elf_swap_shdr_out - PARAMS ((bfd *, const Elf_Internal_Shdr *, Elf_External_Shdr *)); - -#define elf_stringtab_init _bfd_elf_stringtab_init - -#define section_from_elf_index bfd_section_from_elf_index - -static boolean elf_slurp_reloc_table_from_section - PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, bfd_size_type, - arelent *, asymbol **, boolean)); - -static boolean elf_file_p PARAMS ((Elf_External_Ehdr *)); - #ifdef DEBUG -static void elf_debug_section PARAMS ((int, Elf_Internal_Shdr *)); -static void elf_debug_file PARAMS ((Elf_Internal_Ehdr *)); -static char *elf_symbol_flags PARAMS ((flagword)); +static void elf_debug_section (int, Elf_Internal_Shdr *); +static void elf_debug_file (Elf_Internal_Ehdr *); +static char *elf_symbol_flags (flagword); #endif /* Structure swapping routines */ @@ -203,14 +164,13 @@ static char *elf_symbol_flags PARAMS ((flagword)); format. */ void -elf_swap_symbol_in (abfd, psrc, pshn, dst) - bfd *abfd; - const PTR psrc; - const PTR pshn; - Elf_Internal_Sym *dst; +elf_swap_symbol_in (bfd *abfd, + const void *psrc, + const void *pshn, + Elf_Internal_Sym *dst) { - const Elf_External_Sym *src = (const Elf_External_Sym *) psrc; - const Elf_External_Sym_Shndx *shndx = (const Elf_External_Sym_Shndx *) pshn; + const Elf_External_Sym *src = psrc; + const Elf_External_Sym_Shndx *shndx = pshn; int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma; dst->st_name = H_GET_32 (abfd, src->st_name); @@ -234,14 +194,13 @@ elf_swap_symbol_in (abfd, psrc, pshn, dst) format. */ void -elf_swap_symbol_out (abfd, src, cdst, shndx) - bfd *abfd; - const Elf_Internal_Sym *src; - PTR cdst; - PTR shndx; +elf_swap_symbol_out (bfd *abfd, + const Elf_Internal_Sym *src, + void *cdst, + void *shndx) { unsigned int tmp; - Elf_External_Sym *dst = (Elf_External_Sym *) cdst; + Elf_External_Sym *dst = cdst; H_PUT_32 (abfd, src->st_name, dst->st_name); H_PUT_WORD (abfd, src->st_value, dst->st_value); H_PUT_WORD (abfd, src->st_size, dst->st_size); @@ -262,10 +221,9 @@ elf_swap_symbol_out (abfd, src, cdst, shndx) internal format. */ static void -elf_swap_ehdr_in (abfd, src, dst) - bfd *abfd; - const Elf_External_Ehdr *src; - Elf_Internal_Ehdr *dst; +elf_swap_ehdr_in (bfd *abfd, + 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); @@ -291,10 +249,9 @@ elf_swap_ehdr_in (abfd, src, dst) external format. */ static void -elf_swap_ehdr_out (abfd, src, dst) - bfd *abfd; - const Elf_Internal_Ehdr *src; - Elf_External_Ehdr *dst; +elf_swap_ehdr_out (bfd *abfd, + const Elf_Internal_Ehdr *src, + Elf_External_Ehdr *dst) { unsigned int tmp; int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma; @@ -328,10 +285,9 @@ elf_swap_ehdr_out (abfd, src, dst) ELF section header table entry in internal format. */ static void -elf_swap_shdr_in (abfd, src, dst) - bfd *abfd; - const Elf_External_Shdr *src; - Elf_Internal_Shdr *dst; +elf_swap_shdr_in (bfd *abfd, + const Elf_External_Shdr *src, + Elf_Internal_Shdr *dst) { int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma; @@ -356,10 +312,9 @@ elf_swap_shdr_in (abfd, src, dst) ELF section header table entry in external format. */ static void -elf_swap_shdr_out (abfd, src, dst) - bfd *abfd; - const Elf_Internal_Shdr *src; - Elf_External_Shdr *dst; +elf_swap_shdr_out (bfd *abfd, + const Elf_Internal_Shdr *src, + Elf_External_Shdr *dst) { /* note that all elements of dst are *arrays of unsigned char* already... */ H_PUT_32 (abfd, src->sh_name, dst->sh_name); @@ -378,10 +333,9 @@ elf_swap_shdr_out (abfd, src, dst) ELF program header table entry in internal format. */ void -elf_swap_phdr_in (abfd, src, dst) - bfd *abfd; - const Elf_External_Phdr *src; - Elf_Internal_Phdr *dst; +elf_swap_phdr_in (bfd *abfd, + const Elf_External_Phdr *src, + Elf_Internal_Phdr *dst) { int signed_vma = get_elf_backend_data (abfd)->sign_extend_vma; @@ -404,10 +358,9 @@ elf_swap_phdr_in (abfd, src, dst) } void -elf_swap_phdr_out (abfd, src, dst) - bfd *abfd; - const Elf_Internal_Phdr *src; - Elf_External_Phdr *dst; +elf_swap_phdr_out (bfd *abfd, + const Elf_Internal_Phdr *src, + Elf_External_Phdr *dst) { /* note that all elements of dst are *arrays of unsigned char* already... */ H_PUT_32 (abfd, src->p_type, dst->p_type); @@ -421,68 +374,67 @@ elf_swap_phdr_out (abfd, src, dst) } /* Translate an ELF reloc from external format to internal format. */ -INLINE void -elf_swap_reloc_in (abfd, src, dst) - bfd *abfd; - const Elf_External_Rel *src; - Elf_Internal_Rel *dst; +void +elf_swap_reloc_in (bfd *abfd, + const bfd_byte *s, + Elf_Internal_Rela *dst) { + const Elf_External_Rel *src = (const Elf_External_Rel *) s; dst->r_offset = H_GET_WORD (abfd, src->r_offset); dst->r_info = H_GET_WORD (abfd, src->r_info); + dst->r_addend = 0; } -INLINE void -elf_swap_reloca_in (abfd, src, dst) - bfd *abfd; - const Elf_External_Rela *src; - Elf_Internal_Rela *dst; +void +elf_swap_reloca_in (bfd *abfd, + const bfd_byte *s, + Elf_Internal_Rela *dst) { + const Elf_External_Rela *src = (const Elf_External_Rela *) s; dst->r_offset = H_GET_WORD (abfd, src->r_offset); dst->r_info = H_GET_WORD (abfd, src->r_info); dst->r_addend = H_GET_SIGNED_WORD (abfd, src->r_addend); } /* Translate an ELF reloc from internal format to external format. */ -INLINE void -elf_swap_reloc_out (abfd, src, dst) - bfd *abfd; - const Elf_Internal_Rel *src; - Elf_External_Rel *dst; +void +elf_swap_reloc_out (bfd *abfd, + const Elf_Internal_Rela *src, + bfd_byte *d) { + Elf_External_Rel *dst = (Elf_External_Rel *) d; H_PUT_WORD (abfd, src->r_offset, dst->r_offset); H_PUT_WORD (abfd, src->r_info, dst->r_info); } -INLINE void -elf_swap_reloca_out (abfd, src, dst) - bfd *abfd; - const Elf_Internal_Rela *src; - Elf_External_Rela *dst; +void +elf_swap_reloca_out (bfd *abfd, + const Elf_Internal_Rela *src, + bfd_byte *d) { + Elf_External_Rela *dst = (Elf_External_Rela *) d; H_PUT_WORD (abfd, src->r_offset, dst->r_offset); H_PUT_WORD (abfd, src->r_info, dst->r_info); H_PUT_SIGNED_WORD (abfd, src->r_addend, dst->r_addend); } -INLINE void -elf_swap_dyn_in (abfd, p, dst) - bfd *abfd; - const PTR p; - Elf_Internal_Dyn *dst; +void +elf_swap_dyn_in (bfd *abfd, + const void *p, + Elf_Internal_Dyn *dst) { - const Elf_External_Dyn *src = (const Elf_External_Dyn *) p; + const Elf_External_Dyn *src = p; dst->d_tag = H_GET_WORD (abfd, src->d_tag); dst->d_un.d_val = H_GET_WORD (abfd, src->d_un.d_val); } -INLINE void -elf_swap_dyn_out (abfd, src, p) - bfd *abfd; - const Elf_Internal_Dyn *src; - PTR p; +void +elf_swap_dyn_out (bfd *abfd, + const Elf_Internal_Dyn *src, + void *p) { - Elf_External_Dyn *dst = (Elf_External_Dyn *) p; + Elf_External_Dyn *dst = p; H_PUT_WORD (abfd, src->d_tag, dst->d_tag); H_PUT_WORD (abfd, src->d_un.d_val, dst->d_un.d_val); @@ -495,9 +447,8 @@ elf_swap_dyn_out (abfd, src, p) First we validate the file by reading in the ELF header and checking the magic number. */ -static INLINE boolean -elf_file_p (x_ehdrp) - Elf_External_Ehdr *x_ehdrp; +static inline bfd_boolean +elf_file_p (Elf_External_Ehdr *x_ehdrp) { return ((x_ehdrp->e_ident[EI_MAG0] == ELFMAG0) && (x_ehdrp->e_ident[EI_MAG1] == ELFMAG1) @@ -505,16 +456,6 @@ elf_file_p (x_ehdrp) && (x_ehdrp->e_ident[EI_MAG3] == ELFMAG3)); } -struct bfd_preserve -{ - const struct bfd_arch_info *arch_info; - struct elf_obj_tdata *tdata; - struct bfd_hash_table section_htab; - struct sec *sections; - struct sec **section_tail; - unsigned int section_count; -}; - /* Check to see if the file associated with ABFD matches the target vector that ABFD points to. @@ -524,8 +465,7 @@ struct bfd_preserve file does not match the target vector. */ const bfd_target * -elf_object_p (abfd) - bfd *abfd; +elf_object_p (bfd *abfd) { Elf_External_Ehdr x_ehdr; /* Elf file header, external form */ Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */ @@ -534,18 +474,16 @@ elf_object_p (abfd) Elf_Internal_Shdr *i_shdrp; /* Section header table, internal form */ unsigned int shindex; char *shstrtab; /* Internal copy of section header stringtab */ - struct elf_backend_data *ebd; + const struct elf_backend_data *ebd; struct bfd_preserve preserve; - struct elf_obj_tdata *new_tdata = NULL; asection *s; bfd_size_type amt; - preserve.arch_info = abfd->arch_info; + preserve.marker = NULL; /* Read in the ELF header in external format. */ - if (bfd_bread ((PTR) & x_ehdr, (bfd_size_type) sizeof (x_ehdr), abfd) - != sizeof (x_ehdr)) + if (bfd_bread (&x_ehdr, sizeof (x_ehdr), abfd) != sizeof (x_ehdr)) { if (bfd_get_error () != bfd_error_system_call) goto got_wrong_format_error; @@ -580,27 +518,15 @@ elf_object_p (abfd) goto got_wrong_format_error; } + if (!bfd_preserve_save (abfd, &preserve)) + goto got_no_match; + /* Allocate an instance of the elf_obj_tdata structure and hook it up to the tdata pointer in the bfd. */ - amt = sizeof (struct elf_obj_tdata); - new_tdata = (struct elf_obj_tdata *) bfd_zalloc (abfd, amt); - if (new_tdata == NULL) - goto got_no_match; - preserve.tdata = elf_tdata (abfd); - elf_tdata (abfd) = new_tdata; - - /* Clear section information, since there might be a recognized bfd that - we now check if we can replace, and we don't want to append to it. */ - preserve.sections = abfd->sections; - preserve.section_tail = abfd->section_tail; - preserve.section_count = abfd->section_count; - preserve.section_htab = abfd->section_htab; - abfd->sections = NULL; - abfd->section_tail = &abfd->sections; - abfd->section_count = 0; - if (!bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc)) + if (! (*abfd->xvec->_bfd_set_format[bfd_object]) (abfd)) goto got_no_match; + preserve.marker = elf_tdata (abfd); /* Now that we know the byte order, swap in the rest of the header */ i_ehdrp = elf_elfheader (abfd); @@ -633,8 +559,10 @@ elf_object_p (abfd) /* Check that the ELF e_machine field matches what this particular BFD format expects. */ if (ebd->elf_machine_code != i_ehdrp->e_machine - && (ebd->elf_machine_alt1 == 0 || i_ehdrp->e_machine != ebd->elf_machine_alt1) - && (ebd->elf_machine_alt2 == 0 || i_ehdrp->e_machine != ebd->elf_machine_alt2)) + && (ebd->elf_machine_alt1 == 0 + || i_ehdrp->e_machine != ebd->elf_machine_alt1) + && (ebd->elf_machine_alt2 == 0 + || i_ehdrp->e_machine != ebd->elf_machine_alt2)) { const bfd_target * const *target_ptr; @@ -645,11 +573,11 @@ elf_object_p (abfd) for which we do not have a specific backend. */ for (target_ptr = bfd_target_vector; *target_ptr != NULL; target_ptr++) { - struct elf_backend_data *back; + const struct elf_backend_data *back; if ((*target_ptr)->flavour != bfd_target_elf_flavour) continue; - back = (struct elf_backend_data *) (*target_ptr)->backend_data; + back = (const struct elf_backend_data *) (*target_ptr)->backend_data; if (back->elf_machine_code == i_ehdrp->e_machine || (back->elf_machine_alt1 != 0 && back->elf_machine_alt1 == i_ehdrp->e_machine) @@ -689,8 +617,7 @@ elf_object_p (abfd) /* Read the first section header at index 0, and convert to internal form. */ - if (bfd_bread ((PTR) & x_shdr, (bfd_size_type) sizeof x_shdr, abfd) - != sizeof (x_shdr)) + if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr)) goto got_no_match; elf_swap_shdr_in (abfd, &x_shdr, &i_shdr); @@ -712,7 +639,7 @@ elf_object_p (abfd) unsigned int num_sec; amt = sizeof (*i_shdrp) * i_ehdrp->e_shnum; - i_shdrp = (Elf_Internal_Shdr *) bfd_alloc (abfd, amt); + i_shdrp = bfd_alloc (abfd, amt); if (!i_shdrp) goto got_no_match; num_sec = i_ehdrp->e_shnum; @@ -720,7 +647,7 @@ elf_object_p (abfd) num_sec += SHN_HIRESERVE + 1 - SHN_LORESERVE; elf_numsections (abfd) = num_sec; amt = sizeof (i_shdrp) * num_sec; - elf_elfsections (abfd) = (Elf_Internal_Shdr **) bfd_alloc (abfd, amt); + elf_elfsections (abfd) = bfd_alloc (abfd, amt); if (!elf_elfsections (abfd)) goto got_no_match; @@ -741,8 +668,7 @@ elf_object_p (abfd) to internal form. */ for (shindex = 1; shindex < i_ehdrp->e_shnum; shindex++) { - if (bfd_bread ((PTR) & x_shdr, (bfd_size_type) sizeof x_shdr, abfd) - != sizeof (x_shdr)) + if (bfd_bread (&x_shdr, sizeof x_shdr, abfd) != sizeof (x_shdr)) goto got_no_match; elf_swap_shdr_in (abfd, &x_shdr, i_shdrp + shindex); @@ -773,7 +699,7 @@ elf_object_p (abfd) unsigned int i; amt = i_ehdrp->e_phnum * sizeof (Elf_Internal_Phdr); - elf_tdata (abfd)->phdr = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt); + elf_tdata (abfd)->phdr = bfd_alloc (abfd, amt); if (elf_tdata (abfd)->phdr == NULL) goto got_no_match; if (bfd_seek (abfd, (file_ptr) i_ehdrp->e_phoff, SEEK_SET) != 0) @@ -783,8 +709,7 @@ elf_object_p (abfd) { Elf_External_Phdr x_phdr; - if (bfd_bread ((PTR) &x_phdr, (bfd_size_type) sizeof x_phdr, abfd) - != sizeof x_phdr) + if (bfd_bread (&x_phdr, sizeof x_phdr, abfd) != sizeof x_phdr) goto got_no_match; elf_swap_phdr_in (abfd, &x_phdr, i_phdr); } @@ -844,11 +769,8 @@ elf_object_p (abfd) } } - /* It would be nice to be able to free more memory here, eg. old - elf_elfsections, old tdata, but that's not possible since these - blocks are sitting inside obj_alloc'd memory. */ - bfd_hash_table_free (&preserve.section_htab); - return (abfd->xvec); + bfd_preserve_finish (abfd, &preserve); + return abfd->xvec; got_wrong_format_error: /* There is way too much undoing of half-known state here. The caller, @@ -863,18 +785,8 @@ elf_object_p (abfd) bfd_set_error (bfd_error_wrong_format); got_no_match: - abfd->arch_info = preserve.arch_info; - if (new_tdata != NULL) - { - /* bfd_release frees all memory more recently bfd_alloc'd than - its arg, as well as its arg. */ - bfd_release (abfd, new_tdata); - elf_tdata (abfd) = preserve.tdata; - abfd->section_htab = preserve.section_htab; - abfd->sections = preserve.sections; - abfd->section_tail = preserve.section_tail; - abfd->section_count = preserve.section_count; - } + if (preserve.marker != NULL) + bfd_preserve_restore (abfd, &preserve); return NULL; } @@ -883,19 +795,17 @@ elf_object_p (abfd) /* Write out the relocs. */ void -elf_write_relocs (abfd, sec, data) - bfd *abfd; - asection *sec; - PTR data; +elf_write_relocs (bfd *abfd, asection *sec, void *data) { - boolean *failedp = (boolean *) data; + bfd_boolean *failedp = data; Elf_Internal_Shdr *rela_hdr; - Elf_External_Rela *outbound_relocas; - Elf_External_Rel *outbound_relocs; + bfd_vma addr_offset; + void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *); + size_t extsize; + bfd_byte *dst_rela; unsigned int idx; - int use_rela_p; - asymbol *last_sym = 0; - int last_sym_idx = 0; + asymbol *last_sym; + int last_sym_idx; /* If we have already failed, don't do anything. */ if (*failedp) @@ -914,148 +824,94 @@ elf_write_relocs (abfd, sec, data) rela_hdr = &elf_section_data (sec)->rel_hdr; rela_hdr->sh_size = rela_hdr->sh_entsize * sec->reloc_count; - rela_hdr->contents = (PTR) bfd_alloc (abfd, rela_hdr->sh_size); + rela_hdr->contents = bfd_alloc (abfd, rela_hdr->sh_size); if (rela_hdr->contents == NULL) { - *failedp = true; + *failedp = TRUE; return; } /* Figure out whether the relocations are RELA or REL relocations. */ if (rela_hdr->sh_type == SHT_RELA) - use_rela_p = true; + { + swap_out = elf_swap_reloca_out; + extsize = sizeof (Elf_External_Rela); + } else if (rela_hdr->sh_type == SHT_REL) - use_rela_p = false; + { + swap_out = elf_swap_reloc_out; + extsize = sizeof (Elf_External_Rel); + } else /* Every relocation section should be either an SHT_RELA or an SHT_REL section. */ abort (); + /* The address of an ELF reloc is section relative for an object + file, and absolute for an executable file or shared library. + The address of a BFD reloc is always section relative. */ + addr_offset = 0; + if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0) + addr_offset = sec->vma; + /* orelocation has the data, reloc_count has the count... */ - if (use_rela_p) - { - outbound_relocas = (Elf_External_Rela *) rela_hdr->contents; + last_sym = 0; + last_sym_idx = 0; + dst_rela = rela_hdr->contents; - for (idx = 0; idx < sec->reloc_count; idx++) + for (idx = 0; idx < sec->reloc_count; idx++, dst_rela += extsize) + { + Elf_Internal_Rela src_rela; + arelent *ptr; + asymbol *sym; + int n; + + ptr = sec->orelocation[idx]; + sym = *ptr->sym_ptr_ptr; + if (sym == last_sym) + n = last_sym_idx; + else if (bfd_is_abs_section (sym->section) && sym->value == 0) + n = STN_UNDEF; + else { - Elf_Internal_Rela dst_rela; - Elf_External_Rela *src_rela; - arelent *ptr; - asymbol *sym; - int n; - - ptr = sec->orelocation[idx]; - src_rela = outbound_relocas + idx; - - /* The address of an ELF reloc is section relative for an object - file, and absolute for an executable file or shared library. - The address of a BFD reloc is always section relative. */ - if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) - dst_rela.r_offset = ptr->address; - else - dst_rela.r_offset = ptr->address + sec->vma; - - sym = *ptr->sym_ptr_ptr; - if (sym == last_sym) - n = last_sym_idx; - else if (bfd_is_abs_section (sym->section) && sym->value == 0) - n = STN_UNDEF; - else - { - last_sym = sym; - n = _bfd_elf_symbol_from_bfd_symbol (abfd, &sym); - if (n < 0) - { - *failedp = true; - return; - } - last_sym_idx = n; - } - - if ((*ptr->sym_ptr_ptr)->the_bfd != NULL - && (*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec - && ! _bfd_elf_validate_reloc (abfd, ptr)) + last_sym = sym; + n = _bfd_elf_symbol_from_bfd_symbol (abfd, &sym); + if (n < 0) { - *failedp = true; + *failedp = TRUE; return; } - - dst_rela.r_info = ELF_R_INFO (n, ptr->howto->type); - - dst_rela.r_addend = ptr->addend; - elf_swap_reloca_out (abfd, &dst_rela, src_rela); + last_sym_idx = n; } - } - else - /* REL relocations */ - { - outbound_relocs = (Elf_External_Rel *) rela_hdr->contents; - for (idx = 0; idx < sec->reloc_count; idx++) + if ((*ptr->sym_ptr_ptr)->the_bfd != NULL + && (*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec + && ! _bfd_elf_validate_reloc (abfd, ptr)) { - Elf_Internal_Rel dst_rel; - Elf_External_Rel *src_rel; - arelent *ptr; - int n; - asymbol *sym; - - ptr = sec->orelocation[idx]; - sym = *ptr->sym_ptr_ptr; - src_rel = outbound_relocs + idx; - - /* The address of an ELF reloc is section relative for an object - file, and absolute for an executable file or shared library. - The address of a BFD reloc is always section relative. */ - if ((abfd->flags & (EXEC_P | DYNAMIC)) == 0) - dst_rel.r_offset = ptr->address; - else - dst_rel.r_offset = ptr->address + sec->vma; - - if (sym == last_sym) - n = last_sym_idx; - else if (bfd_is_abs_section (sym->section) && sym->value == 0) - n = STN_UNDEF; - else - { - last_sym = sym; - n = _bfd_elf_symbol_from_bfd_symbol (abfd, &sym); - if (n < 0) - { - *failedp = true; - return; - } - last_sym_idx = n; - } - - if ((*ptr->sym_ptr_ptr)->the_bfd != NULL - && (*ptr->sym_ptr_ptr)->the_bfd->xvec != abfd->xvec - && ! _bfd_elf_validate_reloc (abfd, ptr)) - { - *failedp = true; - return; - } - - dst_rel.r_info = ELF_R_INFO (n, ptr->howto->type); - - elf_swap_reloc_out (abfd, &dst_rel, src_rel); + *failedp = TRUE; + return; } + + src_rela.r_offset = ptr->address + addr_offset; + src_rela.r_info = ELF_R_INFO (n, ptr->howto->type); + src_rela.r_addend = ptr->addend; + (*swap_out) (abfd, &src_rela, dst_rela); } } /* Write out the program headers. */ int -elf_write_out_phdrs (abfd, phdr, count) - bfd *abfd; - const Elf_Internal_Phdr *phdr; - unsigned int count; +elf_write_out_phdrs (bfd *abfd, + const Elf_Internal_Phdr *phdr, + unsigned int count) { while (count--) { Elf_External_Phdr extphdr; elf_swap_phdr_out (abfd, phdr, &extphdr); - if (bfd_bwrite (&extphdr, (bfd_size_type) sizeof (Elf_External_Phdr), - abfd) != sizeof (Elf_External_Phdr)) + if (bfd_bwrite (&extphdr, sizeof (Elf_External_Phdr), abfd) + != sizeof (Elf_External_Phdr)) return -1; phdr++; } @@ -1064,9 +920,8 @@ elf_write_out_phdrs (abfd, phdr, count) /* Write out the section headers and the ELF file header. */ -boolean -elf_write_shdrs_and_ehdr (abfd) - bfd *abfd; +bfd_boolean +elf_write_shdrs_and_ehdr (bfd *abfd) { Elf_External_Ehdr x_ehdr; /* Elf file header, external form */ Elf_Internal_Ehdr *i_ehdrp; /* Elf file header, internal form */ @@ -1086,8 +941,8 @@ elf_write_shdrs_and_ehdr (abfd) elf_swap_ehdr_out (abfd, i_ehdrp, &x_ehdr); amt = sizeof (x_ehdr); if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 - || bfd_bwrite ((PTR) & x_ehdr, amt, abfd) != amt) - return false; + || bfd_bwrite (&x_ehdr, amt, abfd) != amt) + return FALSE; /* Some fields in the first section header handle overflow of ehdr fields. */ @@ -1099,9 +954,9 @@ elf_write_shdrs_and_ehdr (abfd) /* at this point we've concocted all the ELF sections... */ amt = i_ehdrp->e_shnum; amt *= sizeof (*x_shdrp); - x_shdrp = (Elf_External_Shdr *) bfd_alloc (abfd, amt); + x_shdrp = bfd_alloc (abfd, amt); if (!x_shdrp) - return false; + return FALSE; for (count = 0; count < i_ehdrp->e_shnum; i_shdrp++, count++) { @@ -1109,24 +964,21 @@ elf_write_shdrs_and_ehdr (abfd) elf_debug_section (count, *i_shdrp); #endif elf_swap_shdr_out (abfd, *i_shdrp, x_shdrp + count); - + if (count == SHN_LORESERVE - 1) i_shdrp += SHN_HIRESERVE + 1 - SHN_LORESERVE; } if (bfd_seek (abfd, (file_ptr) i_ehdrp->e_shoff, SEEK_SET) != 0 - || bfd_bwrite ((PTR) x_shdrp, amt, abfd) != amt) - return false; + || bfd_bwrite (x_shdrp, amt, abfd) != amt) + return FALSE; /* need to dump the string table too... */ - return true; + return TRUE; } long -elf_slurp_symbol_table (abfd, symptrs, dynamic) - bfd *abfd; - asymbol **symptrs; /* Buffer for generated bfd symbols */ - boolean dynamic; +elf_slurp_symbol_table (bfd *abfd, asymbol **symptrs, bfd_boolean dynamic) { Elf_Internal_Shdr *hdr; Elf_Internal_Shdr *verhdr; @@ -1138,7 +990,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) Elf_Internal_Sym *isymbuf = NULL; Elf_External_Versym *xver; Elf_External_Versym *xverbuf = NULL; - struct elf_backend_data *ebd; + const struct elf_backend_data *ebd; bfd_size_type amt; /* Read each raw ELF symbol, converting from external ELF form to @@ -1186,7 +1038,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) amt = symcount; amt *= sizeof (elf_symbol_type); - symbase = (elf_symbol_type *) bfd_zalloc (abfd, amt); + symbase = bfd_zalloc (abfd, amt); if (symbase == (elf_symbol_type *) NULL) goto error_return; @@ -1210,12 +1062,11 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) if (bfd_seek (abfd, verhdr->sh_offset, SEEK_SET) != 0) goto error_return; - xverbuf = (Elf_External_Versym *) bfd_malloc (verhdr->sh_size); + xverbuf = bfd_malloc (verhdr->sh_size); if (xverbuf == NULL && verhdr->sh_size != 0) goto error_return; - if (bfd_bread ((PTR) xverbuf, verhdr->sh_size, abfd) - != verhdr->sh_size) + if (bfd_bread (xverbuf, verhdr->sh_size, abfd) != verhdr->sh_size) goto error_return; } @@ -1242,8 +1093,8 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) else if (isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE) { - sym->symbol.section = section_from_elf_index (abfd, - isym->st_shndx); + sym->symbol.section = bfd_section_from_elf_index (abfd, + isym->st_shndx); if (sym->symbol.section == NULL) { /* This symbol is in a section for which we did not @@ -1268,7 +1119,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) else sym->symbol.section = bfd_abs_section_ptr; - /* If this is a relocateable file, then the symbol value is + /* If this is a relocatable file, then the symbol value is already section relative. */ if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0) sym->symbol.value -= sym->symbol.section->vma; @@ -1360,26 +1211,24 @@ error_return: /* Read relocations for ASECT from REL_HDR. There are RELOC_COUNT of them. */ -static boolean -elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count, - relents, symbols, dynamic) - bfd *abfd; - asection *asect; - Elf_Internal_Shdr *rel_hdr; - bfd_size_type reloc_count; - arelent *relents; - asymbol **symbols; - boolean dynamic; +static bfd_boolean +elf_slurp_reloc_table_from_section (bfd *abfd, + asection *asect, + Elf_Internal_Shdr *rel_hdr, + bfd_size_type reloc_count, + arelent *relents, + asymbol **symbols, + bfd_boolean dynamic) { - struct elf_backend_data * const ebd = get_elf_backend_data (abfd); - PTR allocated = NULL; + const struct elf_backend_data * const ebd = get_elf_backend_data (abfd); + void *allocated = NULL; bfd_byte *native_relocs; arelent *relent; unsigned int i; int entsize; unsigned int symcount; - allocated = (PTR) bfd_malloc (rel_hdr->sh_size); + allocated = bfd_malloc (rel_hdr->sh_size); if (allocated == NULL) goto error_return; @@ -1388,7 +1237,7 @@ elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count, != rel_hdr->sh_size)) goto error_return; - native_relocs = (bfd_byte *) allocated; + native_relocs = allocated; entsize = rel_hdr->sh_entsize; BFD_ASSERT (entsize == sizeof (Elf_External_Rel) @@ -1404,17 +1253,11 @@ elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count, i++, relent++, native_relocs += entsize) { Elf_Internal_Rela rela; - Elf_Internal_Rel rel; if (entsize == sizeof (Elf_External_Rela)) - elf_swap_reloca_in (abfd, (Elf_External_Rela *) native_relocs, &rela); + elf_swap_reloca_in (abfd, native_relocs, &rela); else - { - elf_swap_reloc_in (abfd, (Elf_External_Rel *) native_relocs, &rel); - rela.r_offset = rel.r_offset; - rela.r_info = rel.r_info; - rela.r_addend = 0; - } + elf_swap_reloc_in (abfd, native_relocs, &rela); /* The address of an ELF reloc is section relative for an object file, and absolute for an executable file or shared library. @@ -1450,31 +1293,32 @@ elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count, relent->addend = rela.r_addend; - if (entsize == sizeof (Elf_External_Rela)) + if ((entsize == sizeof (Elf_External_Rela) + && ebd->elf_info_to_howto != NULL) + || ebd->elf_info_to_howto_rel == NULL) (*ebd->elf_info_to_howto) (abfd, relent, &rela); else - (*ebd->elf_info_to_howto_rel) (abfd, relent, &rel); + (*ebd->elf_info_to_howto_rel) (abfd, relent, &rela); } if (allocated != NULL) free (allocated); - return true; + return TRUE; error_return: if (allocated != NULL) free (allocated); - return false; + return FALSE; } /* Read in and swap the external relocs. */ -boolean -elf_slurp_reloc_table (abfd, asect, symbols, dynamic) - bfd *abfd; - asection *asect; - asymbol **symbols; - boolean dynamic; +bfd_boolean +elf_slurp_reloc_table (bfd *abfd, + asection *asect, + asymbol **symbols, + bfd_boolean dynamic) { struct bfd_elf_section_data * const d = elf_section_data (asect); Elf_Internal_Shdr *rel_hdr; @@ -1485,13 +1329,13 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic) bfd_size_type amt; if (asect->relocation != NULL) - return true; + return TRUE; if (! dynamic) { if ((asect->flags & SEC_RELOC) == 0 || asect->reloc_count == 0) - return true; + return TRUE; rel_hdr = &d->rel_hdr; reloc_count = NUM_SHDR_ENTRIES (rel_hdr); @@ -1510,7 +1354,7 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic) dynamic symbol table, and in that case bfd_section_from_shdr in elf.c does not update the RELOC_COUNT. */ if (asect->_raw_size == 0) - return true; + return TRUE; rel_hdr = &d->this_hdr; reloc_count = NUM_SHDR_ENTRIES (rel_hdr); @@ -1519,32 +1363,30 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic) } amt = (reloc_count + reloc_count2) * sizeof (arelent); - relents = (arelent *) bfd_alloc (abfd, amt); + relents = bfd_alloc (abfd, amt); if (relents == NULL) - return false; + return FALSE; if (!elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count, relents, symbols, dynamic)) - return false; + return FALSE; if (rel_hdr2 && !elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr2, reloc_count2, relents + reloc_count, symbols, dynamic)) - return false; + return FALSE; asect->relocation = relents; - return true; + return TRUE; } #ifdef DEBUG static void -elf_debug_section (num, hdr) - int num; - Elf_Internal_Shdr *hdr; +elf_debug_section (int num, Elf_Internal_Shdr *hdr) { fprintf (stderr, "\nSection#%d '%s' 0x%.8lx\n", num, hdr->bfd_section != NULL ? hdr->bfd_section->name : "", @@ -1570,8 +1412,7 @@ elf_debug_section (num, hdr) } static void -elf_debug_file (ehdrp) - Elf_Internal_Ehdr *ehdrp; +elf_debug_file (Elf_Internal_Ehdr *ehdrp) { fprintf (stderr, "e_entry = 0x%.8lx\n", (long) ehdrp->e_entry); fprintf (stderr, "e_phoff = %ld\n", (long) ehdrp->e_phoff); @@ -1583,8 +1424,7 @@ elf_debug_file (ehdrp) } static char * -elf_symbol_flags (flags) - flagword flags; +elf_symbol_flags (flagword flags) { static char buffer[1024]; @@ -1655,8 +1495,230 @@ elf_symbol_flags (flags) } #endif +/* Create a new BFD as if by bfd_openr. Rather than opening a file, + reconstruct an ELF file by reading the segments out of remote memory + based on the ELF file header at EHDR_VMA and the ELF program headers it + points to. If not null, *LOADBASEP is filled in with the difference + between the VMAs from which the segments were read, and the VMAs the + file headers (and hence BFD's idea of each section's VMA) put them at. + + The function TARGET_READ_MEMORY is called to copy LEN bytes from the + remote memory at target address VMA into the local buffer at MYADDR; it + should return zero on success or an `errno' code on failure. TEMPL must + be a BFD for a target with the word size and byte order found in the + remote memory. */ + +bfd * +NAME(_bfd_elf,bfd_from_remote_memory) + (bfd *templ, + bfd_vma ehdr_vma, + bfd_vma *loadbasep, + int (*target_read_memory) (bfd_vma, char *, int)) +{ + Elf_External_Ehdr x_ehdr; /* Elf file header, external form */ + Elf_Internal_Ehdr i_ehdr; /* Elf file header, internal form */ + Elf_External_Phdr *x_phdrs; + Elf_Internal_Phdr *i_phdrs, *last_phdr; + bfd *nbfd; + struct bfd_in_memory *bim; + int contents_size; + char *contents; + int err; + unsigned int i; + bfd_vma loadbase; + + /* Read in the ELF header in external format. */ + err = target_read_memory (ehdr_vma, (char *) &x_ehdr, sizeof x_ehdr); + if (err) + { + bfd_set_error (bfd_error_system_call); + errno = err; + return NULL; + } + + /* Now check to see if we have a valid ELF file, and one that BFD can + make use of. The magic number must match, the address size ('class') + and byte-swapping must match our XVEC entry. */ + + if (! elf_file_p (&x_ehdr) + || x_ehdr.e_ident[EI_VERSION] != EV_CURRENT + || x_ehdr.e_ident[EI_CLASS] != ELFCLASS) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + /* Check that file's byte order matches xvec's */ + switch (x_ehdr.e_ident[EI_DATA]) + { + case ELFDATA2MSB: /* Big-endian */ + if (! bfd_header_big_endian (templ)) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + break; + case ELFDATA2LSB: /* Little-endian */ + if (! bfd_header_little_endian (templ)) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + break; + case ELFDATANONE: /* No data encoding specified */ + default: /* Unknown data encoding specified */ + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + elf_swap_ehdr_in (templ, &x_ehdr, &i_ehdr); + + /* The file header tells where to find the program headers. + These are what we use to actually choose what to read. */ + + if (i_ehdr.e_phentsize != sizeof (Elf_External_Phdr) || i_ehdr.e_phnum == 0) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + x_phdrs = bfd_malloc (i_ehdr.e_phnum * (sizeof *x_phdrs + sizeof *i_phdrs)); + if (x_phdrs == NULL) + { + bfd_set_error (bfd_error_no_memory); + return NULL; + } + err = target_read_memory (ehdr_vma + i_ehdr.e_phoff, (char *) x_phdrs, + i_ehdr.e_phnum * sizeof x_phdrs[0]); + if (err) + { + free (x_phdrs); + bfd_set_error (bfd_error_system_call); + errno = err; + return NULL; + } + i_phdrs = (Elf_Internal_Phdr *) &x_phdrs[i_ehdr.e_phnum]; + + contents_size = 0; + last_phdr = NULL; + loadbase = ehdr_vma; + for (i = 0; i < i_ehdr.e_phnum; ++i) + { + elf_swap_phdr_in (templ, &x_phdrs[i], &i_phdrs[i]); + if (i_phdrs[i].p_type == PT_LOAD) + { + bfd_vma segment_end; + segment_end = (i_phdrs[i].p_offset + i_phdrs[i].p_filesz + + i_phdrs[i].p_align - 1) & -i_phdrs[i].p_align; + if (segment_end > (bfd_vma) contents_size) + contents_size = segment_end; + + if ((i_phdrs[i].p_offset & -i_phdrs[i].p_align) == 0) + loadbase = ehdr_vma - (i_phdrs[i].p_vaddr & -i_phdrs[i].p_align); + + last_phdr = &i_phdrs[i]; + } + } + if (last_phdr == NULL) + { + /* There were no PT_LOAD segments, so we don't have anything to read. */ + free (x_phdrs); + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + /* Trim the last segment so we don't bother with zeros in the last page + that are off the end of the file. However, if the extra bit in that + page includes the section headers, keep them. */ + if ((bfd_vma) contents_size > last_phdr->p_offset + last_phdr->p_filesz + && (bfd_vma) contents_size >= (i_ehdr.e_shoff + + i_ehdr.e_shnum * i_ehdr.e_shentsize)) + { + contents_size = last_phdr->p_offset + last_phdr->p_filesz; + if ((bfd_vma) contents_size < (i_ehdr.e_shoff + + i_ehdr.e_shnum * i_ehdr.e_shentsize)) + contents_size = i_ehdr.e_shoff + i_ehdr.e_shnum * i_ehdr.e_shentsize; + } + else + contents_size = last_phdr->p_offset + last_phdr->p_filesz; + + /* Now we know the size of the whole image we want read in. */ + contents = bfd_zmalloc (contents_size); + if (contents == NULL) + { + free (x_phdrs); + bfd_set_error (bfd_error_no_memory); + return NULL; + } + + for (i = 0; i < i_ehdr.e_phnum; ++i) + if (i_phdrs[i].p_type == PT_LOAD) + { + bfd_vma start = i_phdrs[i].p_offset & -i_phdrs[i].p_align; + bfd_vma end = (i_phdrs[i].p_offset + i_phdrs[i].p_filesz + + i_phdrs[i].p_align - 1) & -i_phdrs[i].p_align; + if (end > (bfd_vma) contents_size) + end = contents_size; + err = target_read_memory ((loadbase + i_phdrs[i].p_vaddr) + & -i_phdrs[i].p_align, + contents + start, end - start); + if (err) + { + free (x_phdrs); + free (contents); + bfd_set_error (bfd_error_system_call); + errno = err; + return NULL; + } + } + free (x_phdrs); + + /* If the segments visible in memory didn't include the section headers, + then clear them from the file header. */ + if ((bfd_vma) contents_size < (i_ehdr.e_shoff + + i_ehdr.e_shnum * i_ehdr.e_shentsize)) + { + memset (&x_ehdr.e_shoff, 0, sizeof x_ehdr.e_shoff); + memset (&x_ehdr.e_shnum, 0, sizeof x_ehdr.e_shnum); + memset (&x_ehdr.e_shstrndx, 0, sizeof x_ehdr.e_shstrndx); + } + + /* This will normally have been in the first PT_LOAD segment. But it + conceivably could be missing, and we might have just changed it. */ + memcpy (contents, &x_ehdr, sizeof x_ehdr); + + /* Now we have a memory image of the ELF file contents. Make a BFD. */ + bim = bfd_malloc (sizeof (struct bfd_in_memory)); + if (bim == NULL) + { + free (contents); + bfd_set_error (bfd_error_no_memory); + return NULL; + } + nbfd = _bfd_new_bfd (); + if (nbfd == NULL) + { + free (bim); + free (contents); + bfd_set_error (bfd_error_no_memory); + return NULL; + } + nbfd->filename = ""; + nbfd->xvec = templ->xvec; + bim->size = contents_size; + bim->buffer = contents; + nbfd->iostream = bim; + nbfd->flags = BFD_IN_MEMORY; + nbfd->direction = read_direction; + nbfd->mtime = time (NULL); + nbfd->mtime_set = TRUE; + + if (loadbasep) + *loadbasep = loadbase; + return nbfd; +} + #include "elfcore.h" -#include "elflink.h" /* Size-dependent data and functions. */ const struct elf_size_info NAME(_bfd_elf,size_info) = { @@ -1670,7 +1732,7 @@ const struct elf_size_info NAME(_bfd_elf,size_info) = { sizeof (Elf_External_Note), 4, 1, - ARCH_SIZE, FILE_ALIGN, + ARCH_SIZE, LOG_FILE_ALIGN, ELFCLASS, EV_CURRENT, elf_write_out_phdrs, elf_write_shdrs_and_ehdr, @@ -1681,8 +1743,8 @@ const struct elf_size_info NAME(_bfd_elf,size_info) = { elf_slurp_symbol_table, elf_swap_dyn_in, elf_swap_dyn_out, - NULL, - NULL, - NULL, - NULL + elf_swap_reloc_in, + elf_swap_reloc_out, + elf_swap_reloca_in, + elf_swap_reloca_out }; diff --git a/contrib/binutils/bfd/elfcore.h b/contrib/binutils/bfd/elfcore.h index 7db5f72..81c4cff 100644 --- a/contrib/binutils/bfd/elfcore.h +++ b/contrib/binutils/bfd/elfcore.h @@ -1,41 +1,37 @@ /* ELF core file support for BFD. - Copyright 1995, 1996, 1997, 1998, 2000, 2001, 2002 + Copyright 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -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. */ char* -elf_core_file_failing_command (abfd) - bfd *abfd; +elf_core_file_failing_command (bfd *abfd) { return elf_tdata (abfd)->core_command; } int -elf_core_file_failing_signal (abfd) - bfd *abfd; +elf_core_file_failing_signal (bfd *abfd) { return elf_tdata (abfd)->core_signal; } -boolean -elf_core_file_matches_executable_p (core_bfd, exec_bfd) - bfd *core_bfd; - bfd *exec_bfd; +bfd_boolean +elf_core_file_matches_executable_p (bfd *core_bfd, bfd *exec_bfd) { char* corename; @@ -44,22 +40,22 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd) if (core_bfd->xvec != exec_bfd->xvec) { bfd_set_error (bfd_error_system_call); - return false; + return FALSE; } /* See if the name in the corefile matches the executable name. */ - corename = elf_tdata (core_bfd)->core_program; if (corename != NULL) { const char* execname = strrchr (exec_bfd->filename, '/'); + execname = execname ? execname + 1 : exec_bfd->filename; - if (strcmp(execname, corename) != 0) - return false; + if (strcmp (execname, corename) != 0) + return FALSE; } - return true; + return TRUE; } /* Core files are simply standard ELF formatted files that partition @@ -71,39 +67,35 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd) register set) and the floating point register set are stored in a segment of type PT_NOTE. We handcraft a couple of extra bfd sections that allow standard bfd access to the general registers (.reg) and the - floating point registers (.reg2). - - */ + floating point registers (.reg2). */ const bfd_target * -elf_core_file_p (abfd) - bfd *abfd; +elf_core_file_p (bfd *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_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. */ unsigned int phindex; - struct elf_backend_data *ebd; + const struct elf_backend_data *ebd; struct bfd_preserve preserve; - struct elf_obj_tdata *new_tdata = NULL; bfd_size_type amt; - preserve.arch_info = abfd->arch_info; + preserve.marker = NULL; /* Read in the ELF header in external format. */ - if (bfd_bread ((PTR) &x_ehdr, (bfd_size_type) sizeof (x_ehdr), abfd) - != sizeof (x_ehdr)) + if (bfd_bread (&x_ehdr, sizeof (x_ehdr), abfd) != sizeof (x_ehdr)) { if (bfd_get_error () != bfd_error_system_call) - bfd_set_error (bfd_error_wrong_format); - return NULL; + goto wrong; + else + goto fail; } /* Check the magic number. */ if (! elf_file_p (&x_ehdr)) goto wrong; - /* FIXME: Check EI_VERSION here ! */ + /* FIXME: Check EI_VERSION here ! */ /* Check the address size ("class"). */ if (x_ehdr.e_ident[EI_CLASS] != ELFCLASS) @@ -112,11 +104,11 @@ elf_core_file_p (abfd) /* Check the byteorder. */ switch (x_ehdr.e_ident[EI_DATA]) { - case ELFDATA2MSB: /* Big-endian */ + case ELFDATA2MSB: /* Big-endian. */ if (! bfd_big_endian (abfd)) goto wrong; break; - case ELFDATA2LSB: /* Little-endian */ + case ELFDATA2LSB: /* Little-endian. */ if (! bfd_little_endian (abfd)) goto wrong; break; @@ -124,25 +116,13 @@ elf_core_file_p (abfd) goto wrong; } + if (!bfd_preserve_save (abfd, &preserve)) + goto fail; + /* Give abfd an elf_obj_tdata. */ - amt = sizeof (struct elf_obj_tdata); - new_tdata = (struct elf_obj_tdata *) bfd_zalloc (abfd, amt); - if (new_tdata == NULL) - return NULL; - preserve.tdata = elf_tdata (abfd); - elf_tdata (abfd) = new_tdata; - - /* Clear section information, since there might be a recognized bfd that - we now check if we can replace, and we don't want to append to it. */ - preserve.sections = abfd->sections; - preserve.section_tail = abfd->section_tail; - preserve.section_count = abfd->section_count; - preserve.section_htab = abfd->section_htab; - abfd->sections = NULL; - abfd->section_tail = &abfd->sections; - abfd->section_count = 0; - if (!bfd_hash_table_init (&abfd->section_htab, bfd_section_hash_newfunc)) + if (! (*abfd->xvec->_bfd_set_format[bfd_core]) (abfd)) goto fail; + preserve.marker = elf_tdata (abfd); /* Swap in the rest of the header, now that we have the byte order. */ i_ehdrp = elf_elfheader (abfd); @@ -173,12 +153,16 @@ elf_core_file_p (abfd) for (target_ptr = bfd_target_vector; *target_ptr != NULL; target_ptr++) { - struct elf_backend_data *back; + const struct elf_backend_data *back; if ((*target_ptr)->flavour != bfd_target_elf_flavour) continue; - back = (struct elf_backend_data *) (*target_ptr)->backend_data; - if (back->elf_machine_code == i_ehdrp->e_machine) + back = (const struct elf_backend_data *) (*target_ptr)->backend_data; + if (back->elf_machine_code == i_ehdrp->e_machine + || (back->elf_machine_alt1 != 0 + && i_ehdrp->e_machine == back->elf_machine_alt1) + || (back->elf_machine_alt2 != 0 + && i_ehdrp->e_machine == back->elf_machine_alt2)) { /* target_ptr is an ELF backend which matches this object file, so reject the generic ELF target. */ @@ -203,7 +187,7 @@ elf_core_file_p (abfd) /* Allocate space for the program headers. */ amt = sizeof (*i_phdrp) * i_ehdrp->e_phnum; - i_phdrp = (Elf_Internal_Phdr *) bfd_alloc (abfd, amt); + i_phdrp = bfd_alloc (abfd, amt); if (!i_phdrp) goto fail; @@ -213,8 +197,8 @@ elf_core_file_p (abfd) for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex) { Elf_External_Phdr x_phdr; - if (bfd_bread ((PTR) &x_phdr, (bfd_size_type) sizeof (x_phdr), abfd) - != sizeof (x_phdr)) + + if (bfd_bread (&x_phdr, sizeof (x_phdr), abfd) != sizeof (x_phdr)) goto fail; elf_swap_phdr_in (abfd, &x_phdr, i_phdrp + phindex); @@ -232,23 +216,19 @@ elf_core_file_p (abfd) /* Process each program header. */ for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex) - { - if (! bfd_section_from_phdr (abfd, i_phdrp + phindex, (int) phindex)) - goto fail; - } + if (! bfd_section_from_phdr (abfd, i_phdrp + phindex, (int) phindex)) + goto fail; /* 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)) - goto wrong; - } + if (ebd->elf_backend_object_p + && (! (*ebd->elf_backend_object_p) (abfd))) + goto wrong; - bfd_hash_table_free (&preserve.section_htab); + bfd_preserve_finish (abfd, &preserve); return abfd->xvec; wrong: @@ -264,17 +244,7 @@ wrong: bfd_set_error (bfd_error_wrong_format); fail: - abfd->arch_info = preserve.arch_info; - if (new_tdata != NULL) - { - /* bfd_release frees all memory more recently bfd_alloc'd than - its arg, as well as its arg. */ - bfd_release (abfd, new_tdata); - elf_tdata (abfd) = preserve.tdata; - abfd->section_htab = preserve.section_htab; - abfd->sections = preserve.sections; - abfd->section_tail = preserve.section_tail; - abfd->section_count = preserve.section_count; - } + if (preserve.marker != NULL) + bfd_preserve_restore (abfd, &preserve); return NULL; } diff --git a/contrib/binutils/bfd/elflink.c b/contrib/binutils/bfd/elflink.c index d6da588..6628db3 100644 --- a/contrib/binutils/bfd/elflink.c +++ b/contrib/binutils/bfd/elflink.c @@ -1,5 +1,5 @@ /* ELF linking support for BFD. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -24,22 +24,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libbfd.h" #define ARCH_SIZE 0 #include "elf-bfd.h" +#include "safe-ctype.h" +#include "libiberty.h" -boolean -_bfd_elf_create_got_section (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +bfd_boolean +_bfd_elf_create_got_section (bfd *abfd, struct bfd_link_info *info) { flagword flags; - register asection *s; + asection *s; struct elf_link_hash_entry *h; struct bfd_link_hash_entry *bh; - struct elf_backend_data *bed = get_elf_backend_data (abfd); + const struct elf_backend_data *bed = get_elf_backend_data (abfd); int ptralign; /* This function may be called more than once. */ - if (bfd_get_section_by_name (abfd, ".got") != NULL) - return true; + s = bfd_get_section_by_name (abfd, ".got"); + if (s != NULL && (s->flags & SEC_LINKER_CREATED) != 0) + return TRUE; switch (bed->s->arch_size) { @@ -53,7 +54,7 @@ _bfd_elf_create_got_section (abfd, info) default: bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY @@ -63,7 +64,7 @@ _bfd_elf_create_got_section (abfd, info) if (s == NULL || !bfd_set_section_flags (abfd, s, flags) || !bfd_set_section_alignment (abfd, s, ptralign)) - return false; + return FALSE; if (bed->want_got_plt) { @@ -71,7 +72,7 @@ _bfd_elf_create_got_section (abfd, info) if (s == NULL || !bfd_set_section_flags (abfd, s, flags) || !bfd_set_section_alignment (abfd, s, ptralign)) - return false; + return FALSE; } if (bed->want_got_sym) @@ -83,16 +84,15 @@ _bfd_elf_create_got_section (abfd, info) bh = NULL; if (!(_bfd_generic_link_add_one_symbol (info, abfd, "_GLOBAL_OFFSET_TABLE_", BSF_GLOBAL, s, - bed->got_symbol_offset, (const char *) NULL, false, - bed->collect, &bh))) - return false; + bed->got_symbol_offset, NULL, FALSE, bed->collect, &bh))) + return FALSE; h = (struct elf_link_hash_entry *) bh; h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; h->type = STT_OBJECT; - if (info->shared - && ! _bfd_elf_link_record_dynamic_symbol (info, h)) - return false; + if (! info->executable + && ! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; elf_hash_table (info)->hgot = h; } @@ -100,36 +100,157 @@ _bfd_elf_create_got_section (abfd, info) /* The first bit of the global offset table is the header. */ s->_raw_size += bed->got_header_size + bed->got_symbol_offset; - return true; + return TRUE; } -/* Create dynamic sections when linking against a dynamic object. */ +/* Create some sections which will be filled in with dynamic linking + information. ABFD is an input file which requires dynamic sections + to be created. The dynamic sections take up virtual memory space + when the final executable is run, so we need to create them before + addresses are assigned to the output sections. We work out the + actual contents and size of these sections later. */ -boolean -_bfd_elf_create_dynamic_sections (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +bfd_boolean +_bfd_elf_link_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) { - flagword flags, pltflags; + flagword flags; register asection *s; - struct elf_backend_data *bed = get_elf_backend_data (abfd); - int ptralign; + struct elf_link_hash_entry *h; + struct bfd_link_hash_entry *bh; + const struct elf_backend_data *bed; - switch (bed->s->arch_size) + if (! is_elf_hash_table (info->hash)) + return FALSE; + + if (elf_hash_table (info)->dynamic_sections_created) + return TRUE; + + /* Make sure that all dynamic sections use the same input BFD. */ + if (elf_hash_table (info)->dynobj == NULL) + elf_hash_table (info)->dynobj = abfd; + else + abfd = elf_hash_table (info)->dynobj; + + /* Note that we set the SEC_IN_MEMORY flag for all of these + sections. */ + flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS + | SEC_IN_MEMORY | SEC_LINKER_CREATED); + + /* A dynamically linked executable has a .interp section, but a + shared library does not. */ + if (info->executable) { - case 32: - ptralign = 2; - break; + s = bfd_make_section (abfd, ".interp"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)) + return FALSE; + } - case 64: - ptralign = 3; - break; + if (! info->traditional_format) + { + s = bfd_make_section (abfd, ".eh_frame_hdr"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || ! bfd_set_section_alignment (abfd, s, 2)) + return FALSE; + elf_hash_table (info)->eh_info.hdr_sec = s; + } - default: - bfd_set_error (bfd_error_bad_value); - return false; + bed = get_elf_backend_data (abfd); + + /* Create sections to hold version informations. These are removed + if they are not needed. */ + s = bfd_make_section (abfd, ".gnu.version_d"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; + + s = bfd_make_section (abfd, ".gnu.version"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || ! bfd_set_section_alignment (abfd, s, 1)) + return FALSE; + + s = bfd_make_section (abfd, ".gnu.version_r"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; + + s = bfd_make_section (abfd, ".dynsym"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; + + s = bfd_make_section (abfd, ".dynstr"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY)) + return FALSE; + + /* Create a strtab to hold the dynamic symbol names. */ + if (elf_hash_table (info)->dynstr == NULL) + { + elf_hash_table (info)->dynstr = _bfd_elf_strtab_init (); + if (elf_hash_table (info)->dynstr == NULL) + return FALSE; } + s = bfd_make_section (abfd, ".dynamic"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags) + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; + + /* The special symbol _DYNAMIC is always set to the start of the + .dynamic section. This call occurs before we have processed the + symbols for any dynamic object, so we don't have to worry about + overriding a dynamic definition. We could set _DYNAMIC in a + linker script, but we only want to define it if we are, in fact, + creating a .dynamic section. We don't want to define it if there + is no .dynamic section, since on some ELF platforms the start up + code examines it to decide how to initialize the process. */ + bh = NULL; + if (! (_bfd_generic_link_add_one_symbol + (info, abfd, "_DYNAMIC", BSF_GLOBAL, s, 0, NULL, FALSE, + get_elf_backend_data (abfd)->collect, &bh))) + return FALSE; + h = (struct elf_link_hash_entry *) bh; + h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; + h->type = STT_OBJECT; + + if (! info->executable + && ! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + + s = bfd_make_section (abfd, ".hash"); + if (s == NULL + || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; + elf_section_data (s)->this_hdr.sh_entsize = bed->s->sizeof_hash_entry; + + /* Let the backend create the rest of the sections. This lets the + backend set the right flags. The backend will normally create + the .got and .plt sections. */ + if (! (*bed->elf_backend_create_dynamic_sections) (abfd, info)) + return FALSE; + + elf_hash_table (info)->dynamic_sections_created = TRUE; + + return TRUE; +} + +/* Create dynamic sections when linking against a dynamic object. */ + +bfd_boolean +_bfd_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info) +{ + flagword flags, pltflags; + asection *s; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + /* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and .rel[a].bss sections. */ @@ -147,7 +268,7 @@ _bfd_elf_create_dynamic_sections (abfd, info) if (s == NULL || ! bfd_set_section_flags (abfd, s, pltflags) || ! bfd_set_section_alignment (abfd, s, bed->plt_alignment)) - return false; + return FALSE; if (bed->want_plt_sym) { @@ -157,28 +278,27 @@ _bfd_elf_create_dynamic_sections (abfd, info) struct bfd_link_hash_entry *bh = NULL; if (! (_bfd_generic_link_add_one_symbol - (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s, - (bfd_vma) 0, (const char *) NULL, false, - get_elf_backend_data (abfd)->collect, &bh))) - return false; + (info, abfd, "_PROCEDURE_LINKAGE_TABLE_", BSF_GLOBAL, s, 0, NULL, + FALSE, get_elf_backend_data (abfd)->collect, &bh))) + return FALSE; h = (struct elf_link_hash_entry *) bh; h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; h->type = STT_OBJECT; - if (info->shared - && ! _bfd_elf_link_record_dynamic_symbol (info, h)) - return false; + if (! info->executable + && ! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; } 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) - || ! bfd_set_section_alignment (abfd, s, ptralign)) - return false; + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; if (! _bfd_elf_create_got_section (abfd, info)) - return false; + return FALSE; if (bed->want_dynbss) { @@ -190,8 +310,8 @@ _bfd_elf_create_dynamic_sections (abfd, info) section into the .bss section of the final image. */ s = bfd_make_section (abfd, ".dynbss"); if (s == NULL - || ! bfd_set_section_flags (abfd, s, SEC_ALLOC)) - return false; + || ! bfd_set_section_flags (abfd, s, SEC_ALLOC | SEC_LINKER_CREATED)) + return FALSE; /* The .rel[a].bss section holds copy relocs. This section is not normally needed. We need to create it here, though, so that the @@ -211,12 +331,12 @@ _bfd_elf_create_dynamic_sections (abfd, info) ? ".rela.bss" : ".rel.bss")); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) - || ! bfd_set_section_alignment (abfd, s, ptralign)) - return false; + || ! bfd_set_section_alignment (abfd, s, bed->s->log_file_align)) + return FALSE; } } - return true; + return TRUE; } /* Record a new dynamic symbol. We record the dynamic symbols as we @@ -227,17 +347,15 @@ _bfd_elf_create_dynamic_sections (abfd, info) symbol should be in the dynamic symbol table, but only if there is one. */ -boolean -_bfd_elf_link_record_dynamic_symbol (info, h) - struct bfd_link_info *info; - struct elf_link_hash_entry *h; +bfd_boolean +bfd_elf_link_record_dynamic_symbol (struct bfd_link_info *info, + struct elf_link_hash_entry *h) { if (h->dynindx == -1) { struct elf_strtab_hash *dynstr; - char *p, *alc; + char *p; const char *name; - boolean copy; bfd_size_type indx; /* XXX: The ABI draft says the linker must turn hidden and @@ -252,7 +370,7 @@ _bfd_elf_link_record_dynamic_symbol (info, h) && h->root.type != bfd_link_hash_undefweak) { h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; - return true; + return TRUE; } default: @@ -268,42 +386,102 @@ _bfd_elf_link_record_dynamic_symbol (info, h) /* Create a strtab to hold the dynamic symbol names. */ elf_hash_table (info)->dynstr = dynstr = _bfd_elf_strtab_init (); if (dynstr == NULL) - return false; + return FALSE; } /* We don't put any version information in the dynamic string - table. */ + table. */ name = h->root.root.string; p = strchr (name, ELF_VER_CHR); - if (p == NULL) - { - alc = NULL; - copy = false; - } - else - { - size_t len = p - name + 1; + if (p != NULL) + /* We know that the p points into writable memory. In fact, + there are only a few symbols that have read-only names, being + those like _GLOBAL_OFFSET_TABLE_ that are created specially + by the backends. Most symbols will have names pointing into + an ELF string table read from a file, or to objalloc memory. */ + *p = 0; - alc = bfd_malloc ((bfd_size_type) len); - if (alc == NULL) - return false; - memcpy (alc, name, len - 1); - alc[len - 1] = '\0'; - name = alc; - copy = true; - } - - indx = _bfd_elf_strtab_add (dynstr, name, copy); + indx = _bfd_elf_strtab_add (dynstr, name, p != NULL); - if (alc != NULL) - free (alc); + if (p != NULL) + *p = ELF_VER_CHR; if (indx == (bfd_size_type) -1) - return false; + return FALSE; h->dynstr_index = indx; } - return true; + return TRUE; +} + +/* Record an assignment to a symbol made by a linker script. We need + this in case some dynamic object refers to this symbol. */ + +bfd_boolean +bfd_elf_record_link_assignment (bfd *output_bfd ATTRIBUTE_UNUSED, + struct bfd_link_info *info, + const char *name, + bfd_boolean provide) +{ + struct elf_link_hash_entry *h; + + if (!is_elf_hash_table (info->hash)) + return TRUE; + + h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, TRUE, FALSE); + if (h == NULL) + return FALSE; + + /* Since we're defining the symbol, don't let it seem to have not + been defined. record_dynamic_symbol and size_dynamic_sections + may depend on this. */ + if (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_undefined) + h->root.type = bfd_link_hash_new; + + if (h->root.type == bfd_link_hash_new) + h->elf_link_hash_flags &= ~ELF_LINK_NON_ELF; + + /* If this symbol is being provided by the linker script, and it is + currently defined by a dynamic object, but not by a regular + object, then mark it as undefined so that the generic linker will + force the correct value. */ + if (provide + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + h->root.type = bfd_link_hash_undefined; + + /* If this symbol is not being provided by the linker script, and it is + currently defined by a dynamic object, but not by a regular object, + then clear out any version information because the symbol will not be + associated with the dynamic object any more. */ + if (!provide + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + h->verinfo.verdef = NULL; + + h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; + + if (((h->elf_link_hash_flags & (ELF_LINK_HASH_DEF_DYNAMIC + | ELF_LINK_HASH_REF_DYNAMIC)) != 0 + || info->shared) + && h->dynindx == -1) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + + /* If this is a weak defined symbol, and we know a corresponding + real symbol from the same dynamic object, make sure the real + symbol is also made into a dynamic symbol. */ + if (h->weakdef != NULL + && h->weakdef->dynindx == -1) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h->weakdef)) + return FALSE; + } + } + + return TRUE; } /* Record a new local dynamic symbol. Returns 0 on failure, 1 on @@ -311,10 +489,9 @@ _bfd_elf_link_record_dynamic_symbol (info, h) in a discarded section, eg. a discarded link-once section symbol. */ int -elf_link_record_local_dynamic_symbol (info, input_bfd, input_indx) - struct bfd_link_info *info; - bfd *input_bfd; - long input_indx; +bfd_elf_link_record_local_dynamic_symbol (struct bfd_link_info *info, + bfd *input_bfd, + long input_indx) { bfd_size_type amt; struct elf_link_local_dynamic_entry *entry; @@ -325,7 +502,7 @@ elf_link_record_local_dynamic_symbol (info, input_bfd, input_indx) Elf_External_Sym_Shndx eshndx; char esym[sizeof (Elf64_External_Sym)]; - if (! is_elf_hash_table (info)) + if (! is_elf_hash_table (info->hash)) return 0; /* See if the entry exists already. */ @@ -334,14 +511,13 @@ elf_link_record_local_dynamic_symbol (info, input_bfd, input_indx) return 1; amt = sizeof (*entry); - entry = (struct elf_link_local_dynamic_entry *) bfd_alloc (input_bfd, amt); + entry = bfd_alloc (input_bfd, amt); if (entry == NULL) return 0; /* Go find the symbol, so that we can find it's name. */ if (!bfd_elf_get_elf_syms (input_bfd, &elf_tdata (input_bfd)->symtab_hdr, - (size_t) 1, (size_t) input_indx, - &entry->isym, esym, &eshndx)) + 1, input_indx, &entry->isym, esym, &eshndx)) { bfd_release (input_bfd, entry); return 0; @@ -376,7 +552,7 @@ elf_link_record_local_dynamic_symbol (info, input_bfd, input_indx) return 0; } - dynstr_index = _bfd_elf_strtab_add (dynstr, name, false); + dynstr_index = _bfd_elf_strtab_add (dynstr, name, FALSE); if (dynstr_index == (unsigned long) -1) return 0; entry->isym.st_name = dynstr_index; @@ -401,10 +577,9 @@ elf_link_record_local_dynamic_symbol (info, input_bfd, input_indx) /* Return the dynindex of a local dynamic symbol. */ long -_bfd_elf_link_lookup_local_dynindx (info, input_bfd, input_indx) - struct bfd_link_info *info; - bfd *input_bfd; - long input_indx; +_bfd_elf_link_lookup_local_dynindx (struct bfd_link_info *info, + bfd *input_bfd, + long input_indx) { struct elf_link_local_dynamic_entry *e; @@ -418,15 +593,11 @@ _bfd_elf_link_lookup_local_dynindx (info, input_bfd, input_indx) them are removed because they are marked as local. This is called via elf_link_hash_traverse. */ -static boolean elf_link_renumber_hash_table_dynsyms - PARAMS ((struct elf_link_hash_entry *, PTR)); - -static boolean -elf_link_renumber_hash_table_dynsyms (h, data) - struct elf_link_hash_entry *h; - PTR data; +static bfd_boolean +elf_link_renumber_hash_table_dynsyms (struct elf_link_hash_entry *h, + void *data) { - size_t *count = (size_t *) data; + size_t *count = data; if (h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; @@ -434,7 +605,7 @@ elf_link_renumber_hash_table_dynsyms (h, data) if (h->dynindx != -1) h->dynindx = ++(*count); - return true; + return TRUE; } /* Assign dynsym indices. In a shared library we generate a section @@ -443,9 +614,7 @@ elf_link_renumber_hash_table_dynsyms (h, data) the global symbols. */ unsigned long -_bfd_elf_link_renumber_dynsyms (output_bfd, info) - bfd *output_bfd; - struct bfd_link_info *info; +_bfd_elf_link_renumber_dynsyms (bfd *output_bfd, struct bfd_link_info *info) { unsigned long dynsymcount = 0; @@ -476,175 +645,8264 @@ _bfd_elf_link_renumber_dynsyms (output_bfd, info) return elf_hash_table (info)->dynsymcount = dynsymcount; } - -/* Create a special linker section, or return a pointer to a linker - section already created */ -elf_linker_section_t * -_bfd_elf_create_linker_section (abfd, info, which, defaults) - bfd *abfd; - struct bfd_link_info *info; - enum elf_linker_section_enum which; - elf_linker_section_t *defaults; +/* This function is called when we want to define a new symbol. It + handles the various cases which arise when we find a definition in + a dynamic object, or when there is already a definition in a + dynamic object. The new symbol is described by NAME, SYM, PSEC, + and PVALUE. We set SYM_HASH to the hash table entry. We set + OVERRIDE if the old symbol is overriding a new definition. We set + TYPE_CHANGE_OK if it is OK for the type to change. We set + SIZE_CHANGE_OK if it is OK for the size to change. By OK to + change, we mean that we shouldn't warn if the type or size does + change. */ + +bfd_boolean +_bfd_elf_merge_symbol (bfd *abfd, + struct bfd_link_info *info, + const char *name, + Elf_Internal_Sym *sym, + asection **psec, + bfd_vma *pvalue, + struct elf_link_hash_entry **sym_hash, + bfd_boolean *skip, + bfd_boolean *override, + bfd_boolean *type_change_ok, + bfd_boolean *size_change_ok) { - bfd *dynobj = elf_hash_table (info)->dynobj; - elf_linker_section_t *lsect; + asection *sec; + struct elf_link_hash_entry *h; + struct elf_link_hash_entry *flip; + int bind; + bfd *oldbfd; + bfd_boolean newdyn, olddyn, olddef, newdef, newdyncommon, olddyncommon; + bfd_boolean newweak, oldweak; + + *skip = FALSE; + *override = FALSE; + + sec = *psec; + bind = ELF_ST_BIND (sym->st_info); + + if (! bfd_is_und_section (sec)) + h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, FALSE, FALSE); + else + h = ((struct elf_link_hash_entry *) + bfd_wrapped_link_hash_lookup (abfd, info, name, TRUE, FALSE, FALSE)); + if (h == NULL) + return FALSE; + *sym_hash = h; + + /* This code is for coping with dynamic objects, and is only useful + if we are doing an ELF link. */ + if (info->hash->creator != abfd->xvec) + return TRUE; + + /* For merging, we only care about real symbols. */ + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; - /* Record the first bfd section that needs the special section */ - if (!dynobj) - dynobj = elf_hash_table (info)->dynobj = abfd; + /* If we just created the symbol, mark it as being an ELF symbol. + Other than that, there is nothing to do--there is no merge issue + with a newly defined symbol--so we just return. */ - /* If this is the first time, create the section */ - lsect = elf_linker_section (dynobj, which); - if (!lsect) + if (h->root.type == bfd_link_hash_new) { - asection *s; - bfd_size_type amt = sizeof (elf_linker_section_t); + h->elf_link_hash_flags &=~ ELF_LINK_NON_ELF; + return TRUE; + } + + /* OLDBFD is a BFD associated with the existing symbol. */ + + switch (h->root.type) + { + default: + oldbfd = NULL; + break; + + case bfd_link_hash_undefined: + case bfd_link_hash_undefweak: + oldbfd = h->root.u.undef.abfd; + break; + + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + oldbfd = h->root.u.def.section->owner; + break; + + case bfd_link_hash_common: + oldbfd = h->root.u.c.p->section->owner; + break; + } + + /* In cases involving weak versioned symbols, we may wind up trying + to merge a symbol with itself. Catch that here, to avoid the + confusion that results if we try to override a symbol with + itself. The additional tests catch cases like + _GLOBAL_OFFSET_TABLE_, which are regular symbols defined in a + dynamic object, which we do want to handle here. */ + if (abfd == oldbfd + && ((abfd->flags & DYNAMIC) == 0 + || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0)) + return TRUE; + + /* NEWDYN and OLDDYN indicate whether the new or old symbol, + respectively, is from a dynamic object. */ - lsect = (elf_linker_section_t *) bfd_alloc (dynobj, amt); + if ((abfd->flags & DYNAMIC) != 0) + newdyn = TRUE; + else + newdyn = FALSE; - *lsect = *defaults; - elf_linker_section (dynobj, which) = lsect; - lsect->which = which; - lsect->hole_written_p = false; + if (oldbfd != NULL) + olddyn = (oldbfd->flags & DYNAMIC) != 0; + else + { + asection *hsec; - /* See if the sections already exist */ - lsect->section = s = bfd_get_section_by_name (dynobj, lsect->name); - if (!s || (s->flags & defaults->flags) != defaults->flags) + /* This code handles the special SHN_MIPS_{TEXT,DATA} section + indices used by MIPS ELF. */ + switch (h->root.type) { - lsect->section = s = bfd_make_section_anyway (dynobj, lsect->name); + default: + hsec = NULL; + break; - if (s == NULL) - return (elf_linker_section_t *)0; + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + hsec = h->root.u.def.section; + break; - bfd_set_section_flags (dynobj, s, defaults->flags); - bfd_set_section_alignment (dynobj, s, lsect->alignment); + case bfd_link_hash_common: + hsec = h->root.u.c.p->section; + break; } - else if (bfd_get_section_alignment (dynobj, s) < lsect->alignment) - bfd_set_section_alignment (dynobj, s, lsect->alignment); - s->_raw_size = align_power (s->_raw_size, lsect->alignment); + if (hsec == NULL) + olddyn = FALSE; + else + olddyn = (hsec->symbol->flags & BSF_DYNAMIC) != 0; + } + + /* NEWDEF and OLDDEF indicate whether the new or old symbol, + respectively, appear to be a definition rather than reference. */ - /* Is there a hole we have to provide? If so check whether the segment is - too big already */ - if (lsect->hole_size) + if (bfd_is_und_section (sec) || bfd_is_com_section (sec)) + newdef = FALSE; + else + newdef = TRUE; + + if (h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_common) + olddef = FALSE; + else + olddef = TRUE; + + /* We need to remember if a symbol has a definition in a dynamic + object or is weak in all dynamic objects. Internal and hidden + visibility will make it unavailable to dynamic objects. */ + if (newdyn && (h->elf_link_hash_flags & ELF_LINK_DYNAMIC_DEF) == 0) + { + if (!bfd_is_und_section (sec)) + h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_DEF; + else { - lsect->hole_offset = s->_raw_size; - s->_raw_size += lsect->hole_size; - if (lsect->hole_offset > lsect->max_hole_offset) + /* Check if this symbol is weak in all dynamic objects. If it + is the first time we see it in a dynamic object, we mark + if it is weak. Otherwise, we clear it. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) == 0) { - (*_bfd_error_handler) (_("%s: Section %s is too large to add hole of %ld bytes"), - bfd_get_filename (abfd), - lsect->name, - (long) lsect->hole_size); - - bfd_set_error (bfd_error_bad_value); - return (elf_linker_section_t *)0; + if (bind == STB_WEAK) + h->elf_link_hash_flags |= ELF_LINK_DYNAMIC_WEAK; } + else if (bind != STB_WEAK) + h->elf_link_hash_flags &= ~ELF_LINK_DYNAMIC_WEAK; } + } -#ifdef DEBUG - fprintf (stderr, "Creating section %s, current size = %ld\n", - lsect->name, (long)s->_raw_size); -#endif + /* If the old symbol has non-default visibility, we ignore the new + definition from a dynamic object. */ + if (newdyn + && ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && !bfd_is_und_section (sec)) + { + *skip = TRUE; + /* Make sure this symbol is dynamic. */ + h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC; + /* A protected symbol has external availability. Make sure it is + recorded as dynamic. + + FIXME: Should we check type and size for protected symbol? */ + if (ELF_ST_VISIBILITY (h->other) == STV_PROTECTED) + return bfd_elf_link_record_dynamic_symbol (info, h); + else + return TRUE; + } + else if (!newdyn + && ELF_ST_VISIBILITY (sym->st_other) != STV_DEFAULT + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0) + { + /* If the new symbol with non-default visibility comes from a + relocatable file and the old definition comes from a dynamic + object, we remove the old definition. */ + if ((*sym_hash)->root.type == bfd_link_hash_indirect) + h = *sym_hash; - if (lsect->sym_name) + if ((h->root.und_next || info->hash->undefs_tail == &h->root) + && bfd_is_und_section (sec)) { - struct elf_link_hash_entry *h; - struct bfd_link_hash_entry *bh; + /* If the new symbol is undefined and the old symbol was + also undefined before, we need to make sure + _bfd_generic_link_add_one_symbol doesn't mess + up the linker hash table undefs list. Since the old + definition came from a dynamic object, it is still on the + undefs list. */ + h->root.type = bfd_link_hash_undefined; + /* FIXME: What if the new symbol is weak undefined? */ + h->root.u.undef.abfd = abfd; + } + else + { + h->root.type = bfd_link_hash_new; + h->root.u.undef.abfd = NULL; + } -#ifdef DEBUG - fprintf (stderr, "Adding %s to section %s\n", - lsect->sym_name, - lsect->name); -#endif - bh = bfd_link_hash_lookup (info->hash, lsect->sym_name, - false, false, false); + if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) + { + h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC; + h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_DYNAMIC_DEF); + } + /* FIXME: Should we check type and size for protected symbol? */ + h->size = 0; + h->type = 0; + return TRUE; + } - if ((bh == NULL || bh->type == bfd_link_hash_undefined) - && !(_bfd_generic_link_add_one_symbol - (info, abfd, lsect->sym_name, BSF_GLOBAL, s, - (lsect->hole_size - ? s->_raw_size - lsect->hole_size + lsect->sym_offset - : lsect->sym_offset), - (const char *) NULL, false, - get_elf_backend_data (abfd)->collect, &bh))) - return (elf_linker_section_t *) 0; - h = (struct elf_link_hash_entry *) bh; + /* Differentiate strong and weak symbols. */ + newweak = bind == STB_WEAK; + oldweak = (h->root.type == bfd_link_hash_defweak + || h->root.type == bfd_link_hash_undefweak); - if ((defaults->which != LINKER_SECTION_SDATA) - && (defaults->which != LINKER_SECTION_SDATA2)) - h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_DYNAMIC; + /* If a new weak symbol definition comes from a regular file and the + old symbol comes from a dynamic library, we treat the new one as + strong. Similarly, an old weak symbol definition from a regular + file is treated as strong when the new symbol comes from a dynamic + library. Further, an old weak symbol from a dynamic library is + treated as strong if the new symbol is from a dynamic library. + This reflects the way glibc's ld.so works. - h->type = STT_OBJECT; - lsect->sym_hash = h; + Do this before setting *type_change_ok or *size_change_ok so that + we warn properly when dynamic library symbols are overridden. */ - if (info->shared - && ! _bfd_elf_link_record_dynamic_symbol (info, h)) - return (elf_linker_section_t *) 0; - } + if (newdef && !newdyn && olddyn) + newweak = FALSE; + if (olddef && newdyn) + oldweak = FALSE; + + /* It's OK to change the type if either the existing symbol or the + new symbol is weak. A type change is also OK if the old symbol + is undefined and the new symbol is defined. */ + + if (oldweak + || newweak + || (newdef + && h->root.type == bfd_link_hash_undefined)) + *type_change_ok = TRUE; + + /* It's OK to change the size if either the existing symbol or the + new symbol is weak, or if the old symbol is undefined. */ + + if (*type_change_ok + || h->root.type == bfd_link_hash_undefined) + *size_change_ok = TRUE; + + /* NEWDYNCOMMON and OLDDYNCOMMON indicate whether the new or old + symbol, respectively, appears to be a common symbol in a dynamic + object. If a symbol appears in an uninitialized section, and is + not weak, and is not a function, then it may be a common symbol + which was resolved when the dynamic object was created. We want + to treat such symbols specially, because they raise special + considerations when setting the symbol size: if the symbol + appears as a common symbol in a regular object, and the size in + the regular object is larger, we must make sure that we use the + larger size. This problematic case can always be avoided in C, + but it must be handled correctly when using Fortran shared + libraries. + + Note that if NEWDYNCOMMON is set, NEWDEF will be set, and + likewise for OLDDYNCOMMON and OLDDEF. + + Note that this test is just a heuristic, and that it is quite + possible to have an uninitialized symbol in a shared object which + is really a definition, rather than a common symbol. This could + lead to some minor confusion when the symbol really is a common + symbol in some regular object. However, I think it will be + harmless. */ + + if (newdyn + && newdef + && !newweak + && (sec->flags & SEC_ALLOC) != 0 + && (sec->flags & SEC_LOAD) == 0 + && sym->st_size > 0 + && ELF_ST_TYPE (sym->st_info) != STT_FUNC) + newdyncommon = TRUE; + else + newdyncommon = FALSE; + + if (olddyn + && olddef + && h->root.type == bfd_link_hash_defined + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + && (h->root.u.def.section->flags & SEC_ALLOC) != 0 + && (h->root.u.def.section->flags & SEC_LOAD) == 0 + && h->size > 0 + && h->type != STT_FUNC) + olddyncommon = TRUE; + else + olddyncommon = FALSE; + + /* If both the old and the new symbols look like common symbols in a + dynamic object, set the size of the symbol to the larger of the + two. */ + + if (olddyncommon + && newdyncommon + && sym->st_size != h->size) + { + /* Since we think we have two common symbols, issue a multiple + common warning if desired. Note that we only warn if the + size is different. If the size is the same, we simply let + the old symbol override the new one as normally happens with + symbols defined in dynamic objects. */ + + if (! ((*info->callbacks->multiple_common) + (info, h->root.root.string, oldbfd, bfd_link_hash_common, + h->size, abfd, bfd_link_hash_common, sym->st_size))) + return FALSE; + + if (sym->st_size > h->size) + h->size = sym->st_size; + + *size_change_ok = TRUE; } -#if 0 - /* This does not make sense. The sections which may exist in the - object file have nothing to do with the sections we want to - create. */ + /* If we are looking at a dynamic object, and we have found a + definition, we need to see if the symbol was already defined by + some other object. If so, we want to use the existing + definition, and we do not want to report a multiple symbol + definition error; we do this by clobbering *PSEC to be + bfd_und_section_ptr. - /* Find the related sections if they have been created */ - if (lsect->bss_name && !lsect->bss_section) - lsect->bss_section = bfd_get_section_by_name (dynobj, lsect->bss_name); + We treat a common symbol as a definition if the symbol in the + shared library is a function, since common symbols always + represent variables; this can cause confusion in principle, but + any such confusion would seem to indicate an erroneous program or + shared library. We also permit a common symbol in a regular + object to override a weak symbol in a shared object. */ - if (lsect->rel_name && !lsect->rel_section) - lsect->rel_section = bfd_get_section_by_name (dynobj, lsect->rel_name); -#endif + if (newdyn + && newdef + && (olddef + || (h->root.type == bfd_link_hash_common + && (newweak + || ELF_ST_TYPE (sym->st_info) == STT_FUNC)))) + { + *override = TRUE; + newdef = FALSE; + newdyncommon = FALSE; + + *psec = sec = bfd_und_section_ptr; + *size_change_ok = TRUE; + + /* If we get here when the old symbol is a common symbol, then + we are explicitly letting it override a weak symbol or + function in a dynamic object, and we don't want to warn about + a type change. If the old symbol is a defined symbol, a type + change warning may still be appropriate. */ + + if (h->root.type == bfd_link_hash_common) + *type_change_ok = TRUE; + } + + /* Handle the special case of an old common symbol merging with a + new symbol which looks like a common symbol in a shared object. + We change *PSEC and *PVALUE to make the new symbol look like a + common symbol, and let _bfd_generic_link_add_one_symbol will do + the right thing. */ + + if (newdyncommon + && h->root.type == bfd_link_hash_common) + { + *override = TRUE; + newdef = FALSE; + newdyncommon = FALSE; + *pvalue = sym->st_size; + *psec = sec = bfd_com_section_ptr; + *size_change_ok = TRUE; + } + + /* If the old symbol is from a dynamic object, and the new symbol is + a definition which is not from a dynamic object, then the new + symbol overrides the old symbol. Symbols from regular files + always take precedence over symbols from dynamic objects, even if + they are defined after the dynamic object in the link. + + As above, we again permit a common symbol in a regular object to + override a definition in a shared object if the shared object + symbol is a function or is weak. */ + + flip = NULL; + if (! newdyn + && (newdef + || (bfd_is_com_section (sec) + && (oldweak + || h->type == STT_FUNC))) + && olddyn + && olddef + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0) + { + /* Change the hash table entry to undefined, and let + _bfd_generic_link_add_one_symbol do the right thing with the + new definition. */ + + h->root.type = bfd_link_hash_undefined; + h->root.u.undef.abfd = h->root.u.def.section->owner; + *size_change_ok = TRUE; + + olddef = FALSE; + olddyncommon = FALSE; + + /* We again permit a type change when a common symbol may be + overriding a function. */ + + if (bfd_is_com_section (sec)) + *type_change_ok = TRUE; + + if ((*sym_hash)->root.type == bfd_link_hash_indirect) + flip = *sym_hash; + else + /* This union may have been set to be non-NULL when this symbol + was seen in a dynamic object. We must force the union to be + NULL, so that it is correct for a regular symbol. */ + h->verinfo.vertree = NULL; + } + + /* Handle the special case of a new common symbol merging with an + old symbol that looks like it might be a common symbol defined in + a shared object. Note that we have already handled the case in + which a new common symbol should simply override the definition + in the shared library. */ + + if (! newdyn + && bfd_is_com_section (sec) + && olddyncommon) + { + /* It would be best if we could set the hash table entry to a + common symbol, but we don't know what to use for the section + or the alignment. */ + if (! ((*info->callbacks->multiple_common) + (info, h->root.root.string, oldbfd, bfd_link_hash_common, + h->size, abfd, bfd_link_hash_common, sym->st_size))) + return FALSE; + + /* If the presumed common symbol in the dynamic object is + larger, pretend that the new symbol has its size. */ + + if (h->size > *pvalue) + *pvalue = h->size; + + /* FIXME: We no longer know the alignment required by the symbol + in the dynamic object, so we just wind up using the one from + the regular object. */ + + olddef = FALSE; + olddyncommon = FALSE; + + h->root.type = bfd_link_hash_undefined; + h->root.u.undef.abfd = h->root.u.def.section->owner; + + *size_change_ok = TRUE; + *type_change_ok = TRUE; + + if ((*sym_hash)->root.type == bfd_link_hash_indirect) + flip = *sym_hash; + else + h->verinfo.vertree = NULL; + } - return lsect; + if (flip != NULL) + { + /* Handle the case where we had a versioned symbol in a dynamic + library and now find a definition in a normal object. In this + case, we make the versioned symbol point to the normal one. */ + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + flip->root.type = h->root.type; + h->root.type = bfd_link_hash_indirect; + h->root.u.i.link = (struct bfd_link_hash_entry *) flip; + (*bed->elf_backend_copy_indirect_symbol) (bed, flip, h); + flip->root.u.undef.abfd = h->root.u.undef.abfd; + if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) + { + h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC; + flip->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC; + } + } + + return TRUE; } - -/* Find a linker generated pointer with a given addend and type. */ -elf_linker_section_pointers_t * -_bfd_elf_find_pointer_linker_section (linker_pointers, addend, which) - elf_linker_section_pointers_t *linker_pointers; - bfd_vma addend; - elf_linker_section_enum_t which; +/* This function is called to create an indirect symbol from the + default for the symbol with the default version if needed. The + symbol is described by H, NAME, SYM, PSEC, VALUE, and OVERRIDE. We + set DYNSYM if the new indirect symbol is dynamic. */ + +bfd_boolean +_bfd_elf_add_default_symbol (bfd *abfd, + struct bfd_link_info *info, + struct elf_link_hash_entry *h, + const char *name, + Elf_Internal_Sym *sym, + asection **psec, + bfd_vma *value, + bfd_boolean *dynsym, + bfd_boolean override) { - for ( ; linker_pointers != NULL; linker_pointers = linker_pointers->next) + bfd_boolean type_change_ok; + bfd_boolean size_change_ok; + bfd_boolean skip; + char *shortname; + struct elf_link_hash_entry *hi; + struct bfd_link_hash_entry *bh; + const struct elf_backend_data *bed; + bfd_boolean collect; + bfd_boolean dynamic; + char *p; + size_t len, shortlen; + asection *sec; + + /* If this symbol has a version, and it is the default version, we + create an indirect symbol from the default name to the fully + decorated name. This will cause external references which do not + specify a version to be bound to this version of the symbol. */ + p = strchr (name, ELF_VER_CHR); + if (p == NULL || p[1] != ELF_VER_CHR) + return TRUE; + + if (override) + { + /* We are overridden by an old definition. We need to check if we + need to create the indirect symbol from the default name. */ + hi = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, + FALSE, FALSE); + BFD_ASSERT (hi != NULL); + if (hi == h) + return TRUE; + while (hi->root.type == bfd_link_hash_indirect + || hi->root.type == bfd_link_hash_warning) + { + hi = (struct elf_link_hash_entry *) hi->root.u.i.link; + if (hi == h) + return TRUE; + } + } + + bed = get_elf_backend_data (abfd); + collect = bed->collect; + dynamic = (abfd->flags & DYNAMIC) != 0; + + shortlen = p - name; + shortname = bfd_hash_allocate (&info->hash->table, shortlen + 1); + if (shortname == NULL) + return FALSE; + memcpy (shortname, name, shortlen); + shortname[shortlen] = '\0'; + + /* We are going to create a new symbol. Merge it with any existing + symbol with this name. For the purposes of the merge, act as + though we were defining the symbol we just defined, although we + actually going to define an indirect symbol. */ + type_change_ok = FALSE; + size_change_ok = FALSE; + sec = *psec; + if (!_bfd_elf_merge_symbol (abfd, info, shortname, sym, &sec, value, + &hi, &skip, &override, &type_change_ok, + &size_change_ok)) + return FALSE; + + if (skip) + goto nondefault; + + if (! override) + { + bh = &hi->root; + if (! (_bfd_generic_link_add_one_symbol + (info, abfd, shortname, BSF_INDIRECT, bfd_ind_section_ptr, + 0, name, FALSE, collect, &bh))) + return FALSE; + hi = (struct elf_link_hash_entry *) bh; + } + else + { + /* In this case the symbol named SHORTNAME is overriding the + indirect symbol we want to add. We were planning on making + SHORTNAME an indirect symbol referring to NAME. SHORTNAME + is the name without a version. NAME is the fully versioned + name, and it is the default version. + + Overriding means that we already saw a definition for the + symbol SHORTNAME in a regular object, and it is overriding + the symbol defined in the dynamic object. + + When this happens, we actually want to change NAME, the + symbol we just added, to refer to SHORTNAME. This will cause + references to NAME in the shared object to become references + to SHORTNAME in the regular object. This is what we expect + when we override a function in a shared object: that the + references in the shared object will be mapped to the + definition in the regular object. */ + + while (hi->root.type == bfd_link_hash_indirect + || hi->root.type == bfd_link_hash_warning) + hi = (struct elf_link_hash_entry *) hi->root.u.i.link; + + h->root.type = bfd_link_hash_indirect; + h->root.u.i.link = (struct bfd_link_hash_entry *) hi; + if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) + { + h->elf_link_hash_flags &=~ ELF_LINK_HASH_DEF_DYNAMIC; + hi->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC; + if (hi->elf_link_hash_flags + & (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_DEF_REGULAR)) + { + if (! bfd_elf_link_record_dynamic_symbol (info, hi)) + return FALSE; + } + } + + /* Now set HI to H, so that the following code will set the + other fields correctly. */ + hi = h; + } + + /* If there is a duplicate definition somewhere, then HI may not + point to an indirect symbol. We will have reported an error to + the user in that case. */ + + if (hi->root.type == bfd_link_hash_indirect) + { + struct elf_link_hash_entry *ht; + + ht = (struct elf_link_hash_entry *) hi->root.u.i.link; + (*bed->elf_backend_copy_indirect_symbol) (bed, ht, hi); + + /* See if the new flags lead us to realize that the symbol must + be dynamic. */ + if (! *dynsym) + { + if (! dynamic) + { + if (info->shared + || ((hi->elf_link_hash_flags + & ELF_LINK_HASH_REF_DYNAMIC) != 0)) + *dynsym = TRUE; + } + else + { + if ((hi->elf_link_hash_flags + & ELF_LINK_HASH_REF_REGULAR) != 0) + *dynsym = TRUE; + } + } + } + + /* We also need to define an indirection from the nondefault version + of the symbol. */ + +nondefault: + len = strlen (name); + shortname = bfd_hash_allocate (&info->hash->table, len); + if (shortname == NULL) + return FALSE; + memcpy (shortname, name, shortlen); + memcpy (shortname + shortlen, p + 1, len - shortlen); + + /* Once again, merge with any existing symbol. */ + type_change_ok = FALSE; + size_change_ok = FALSE; + sec = *psec; + if (!_bfd_elf_merge_symbol (abfd, info, shortname, sym, &sec, value, + &hi, &skip, &override, &type_change_ok, + &size_change_ok)) + return FALSE; + + if (skip) + return TRUE; + + if (override) + { + /* Here SHORTNAME is a versioned name, so we don't expect to see + the type of override we do in the case above unless it is + overridden by a versioned definition. */ + if (hi->root.type != bfd_link_hash_defined + && hi->root.type != bfd_link_hash_defweak) + (*_bfd_error_handler) + (_("%s: warning: unexpected redefinition of indirect versioned symbol `%s'"), + bfd_archive_filename (abfd), shortname); + } + else { - if (which == linker_pointers->which && addend == linker_pointers->addend) - return linker_pointers; + bh = &hi->root; + if (! (_bfd_generic_link_add_one_symbol + (info, abfd, shortname, BSF_INDIRECT, + bfd_ind_section_ptr, 0, name, FALSE, collect, &bh))) + return FALSE; + hi = (struct elf_link_hash_entry *) bh; + + /* If there is a duplicate definition somewhere, then HI may not + point to an indirect symbol. We will have reported an error + to the user in that case. */ + + if (hi->root.type == bfd_link_hash_indirect) + { + (*bed->elf_backend_copy_indirect_symbol) (bed, h, hi); + + /* See if the new flags lead us to realize that the symbol + must be dynamic. */ + if (! *dynsym) + { + if (! dynamic) + { + if (info->shared + || ((hi->elf_link_hash_flags + & ELF_LINK_HASH_REF_DYNAMIC) != 0)) + *dynsym = TRUE; + } + else + { + if ((hi->elf_link_hash_flags + & ELF_LINK_HASH_REF_REGULAR) != 0) + *dynsym = TRUE; + } + } + } } - return (elf_linker_section_pointers_t *)0; + return TRUE; } -/* Make the .rela section corresponding to the generated linker section. */ - -boolean -_bfd_elf_make_linker_section_rela (dynobj, lsect, alignment) - bfd *dynobj; - elf_linker_section_t *lsect; - int alignment; -{ - if (lsect->rel_section) - return true; - - lsect->rel_section = bfd_get_section_by_name (dynobj, lsect->rel_name); - if (lsect->rel_section == NULL) - { - lsect->rel_section = bfd_make_section (dynobj, lsect->rel_name); - if (lsect->rel_section == NULL - || ! bfd_set_section_flags (dynobj, - lsect->rel_section, - (SEC_ALLOC - | SEC_LOAD - | SEC_HAS_CONTENTS - | SEC_IN_MEMORY - | SEC_LINKER_CREATED - | SEC_READONLY)) - || ! bfd_set_section_alignment (dynobj, lsect->rel_section, alignment)) - return false; - } - - return true; +/* This routine is used to export all defined symbols into the dynamic + symbol table. It is called via elf_link_hash_traverse. */ + +bfd_boolean +_bfd_elf_export_symbol (struct elf_link_hash_entry *h, void *data) +{ + struct elf_info_failed *eif = data; + + /* Ignore indirect symbols. These are added by the versioning code. */ + if (h->root.type == bfd_link_hash_indirect) + return TRUE; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->dynindx == -1 + && (h->elf_link_hash_flags + & (ELF_LINK_HASH_DEF_REGULAR | ELF_LINK_HASH_REF_REGULAR)) != 0) + { + struct bfd_elf_version_tree *t; + struct bfd_elf_version_expr *d; + + for (t = eif->verdefs; t != NULL; t = t->next) + { + if (t->globals.list != NULL) + { + d = (*t->match) (&t->globals, NULL, h->root.root.string); + if (d != NULL) + goto doit; + } + + if (t->locals.list != NULL) + { + d = (*t->match) (&t->locals, NULL, h->root.root.string); + if (d != NULL) + return TRUE; + } + } + + if (!eif->verdefs) + { + doit: + if (! bfd_elf_link_record_dynamic_symbol (eif->info, h)) + { + eif->failed = TRUE; + return FALSE; + } + } + } + + return TRUE; +} + +/* Look through the symbols which are defined in other shared + libraries and referenced here. Update the list of version + dependencies. This will be put into the .gnu.version_r section. + This function is called via elf_link_hash_traverse. */ + +bfd_boolean +_bfd_elf_link_find_version_dependencies (struct elf_link_hash_entry *h, + void *data) +{ + struct elf_find_verdep_info *rinfo = data; + Elf_Internal_Verneed *t; + Elf_Internal_Vernaux *a; + bfd_size_type amt; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* We only care about symbols defined in shared objects with version + information. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 + || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 + || h->dynindx == -1 + || h->verinfo.verdef == NULL) + return TRUE; + + /* See if we already know about this version. */ + for (t = elf_tdata (rinfo->output_bfd)->verref; t != NULL; t = t->vn_nextref) + { + if (t->vn_bfd != h->verinfo.verdef->vd_bfd) + continue; + + for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr) + if (a->vna_nodename == h->verinfo.verdef->vd_nodename) + return TRUE; + + break; + } + + /* This is a new version. Add it to tree we are building. */ + + if (t == NULL) + { + amt = sizeof *t; + t = bfd_zalloc (rinfo->output_bfd, amt); + if (t == NULL) + { + rinfo->failed = TRUE; + return FALSE; + } + + t->vn_bfd = h->verinfo.verdef->vd_bfd; + t->vn_nextref = elf_tdata (rinfo->output_bfd)->verref; + elf_tdata (rinfo->output_bfd)->verref = t; + } + + amt = sizeof *a; + a = bfd_zalloc (rinfo->output_bfd, amt); + + /* Note that we are copying a string pointer here, and testing it + above. If bfd_elf_string_from_elf_section is ever changed to + discard the string data when low in memory, this will have to be + fixed. */ + a->vna_nodename = h->verinfo.verdef->vd_nodename; + + a->vna_flags = h->verinfo.verdef->vd_flags; + a->vna_nextptr = t->vn_auxptr; + + h->verinfo.verdef->vd_exp_refno = rinfo->vers; + ++rinfo->vers; + + a->vna_other = h->verinfo.verdef->vd_exp_refno + 1; + + t->vn_auxptr = a; + + return TRUE; +} + +/* Figure out appropriate versions for all the symbols. We may not + have the version number script until we have read all of the input + files, so until that point we don't know which symbols should be + local. This function is called via elf_link_hash_traverse. */ + +bfd_boolean +_bfd_elf_link_assign_sym_version (struct elf_link_hash_entry *h, void *data) +{ + struct elf_assign_sym_version_info *sinfo; + struct bfd_link_info *info; + const struct elf_backend_data *bed; + struct elf_info_failed eif; + char *p; + bfd_size_type amt; + + sinfo = data; + info = sinfo->info; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* Fix the symbol flags. */ + eif.failed = FALSE; + eif.info = info; + if (! _bfd_elf_fix_symbol_flags (h, &eif)) + { + if (eif.failed) + sinfo->failed = TRUE; + return FALSE; + } + + /* We only need version numbers for symbols defined in regular + objects. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + return TRUE; + + bed = get_elf_backend_data (sinfo->output_bfd); + p = strchr (h->root.root.string, ELF_VER_CHR); + if (p != NULL && h->verinfo.vertree == NULL) + { + struct bfd_elf_version_tree *t; + bfd_boolean hidden; + + hidden = TRUE; + + /* There are two consecutive ELF_VER_CHR characters if this is + not a hidden symbol. */ + ++p; + if (*p == ELF_VER_CHR) + { + hidden = FALSE; + ++p; + } + + /* If there is no version string, we can just return out. */ + if (*p == '\0') + { + if (hidden) + h->elf_link_hash_flags |= ELF_LINK_HIDDEN; + return TRUE; + } + + /* Look for the version. If we find it, it is no longer weak. */ + for (t = sinfo->verdefs; t != NULL; t = t->next) + { + if (strcmp (t->name, p) == 0) + { + size_t len; + char *alc; + struct bfd_elf_version_expr *d; + + len = p - h->root.root.string; + alc = bfd_malloc (len); + if (alc == NULL) + return FALSE; + memcpy (alc, h->root.root.string, len - 1); + alc[len - 1] = '\0'; + if (alc[len - 2] == ELF_VER_CHR) + alc[len - 2] = '\0'; + + h->verinfo.vertree = t; + t->used = TRUE; + d = NULL; + + if (t->globals.list != NULL) + d = (*t->match) (&t->globals, NULL, alc); + + /* See if there is anything to force this symbol to + local scope. */ + if (d == NULL && t->locals.list != NULL) + { + d = (*t->match) (&t->locals, NULL, alc); + if (d != NULL + && h->dynindx != -1 + && info->shared + && ! info->export_dynamic) + (*bed->elf_backend_hide_symbol) (info, h, TRUE); + } + + free (alc); + break; + } + } + + /* If we are building an application, we need to create a + version node for this version. */ + if (t == NULL && info->executable) + { + struct bfd_elf_version_tree **pp; + int version_index; + + /* If we aren't going to export this symbol, we don't need + to worry about it. */ + if (h->dynindx == -1) + return TRUE; + + amt = sizeof *t; + t = bfd_zalloc (sinfo->output_bfd, amt); + if (t == NULL) + { + sinfo->failed = TRUE; + return FALSE; + } + + t->name = p; + t->name_indx = (unsigned int) -1; + t->used = TRUE; + + version_index = 1; + /* Don't count anonymous version tag. */ + if (sinfo->verdefs != NULL && sinfo->verdefs->vernum == 0) + version_index = 0; + for (pp = &sinfo->verdefs; *pp != NULL; pp = &(*pp)->next) + ++version_index; + t->vernum = version_index; + + *pp = t; + + h->verinfo.vertree = t; + } + else if (t == NULL) + { + /* We could not find the version for a symbol when + generating a shared archive. Return an error. */ + (*_bfd_error_handler) + (_("%s: undefined versioned symbol name %s"), + bfd_get_filename (sinfo->output_bfd), h->root.root.string); + bfd_set_error (bfd_error_bad_value); + sinfo->failed = TRUE; + return FALSE; + } + + if (hidden) + h->elf_link_hash_flags |= ELF_LINK_HIDDEN; + } + + /* If we don't have a version for this symbol, see if we can find + something. */ + if (h->verinfo.vertree == NULL && sinfo->verdefs != NULL) + { + struct bfd_elf_version_tree *t; + struct bfd_elf_version_tree *local_ver; + struct bfd_elf_version_expr *d; + + /* See if can find what version this symbol is in. If the + symbol is supposed to be local, then don't actually register + it. */ + local_ver = NULL; + for (t = sinfo->verdefs; t != NULL; t = t->next) + { + if (t->globals.list != NULL) + { + bfd_boolean matched; + + matched = FALSE; + d = NULL; + while ((d = (*t->match) (&t->globals, d, + h->root.root.string)) != NULL) + if (d->symver) + matched = TRUE; + else + { + /* There is a version without definition. Make + the symbol the default definition for this + version. */ + h->verinfo.vertree = t; + local_ver = NULL; + d->script = 1; + break; + } + if (d != NULL) + break; + else if (matched) + /* There is no undefined version for this symbol. Hide the + default one. */ + (*bed->elf_backend_hide_symbol) (info, h, TRUE); + } + + if (t->locals.list != NULL) + { + d = NULL; + while ((d = (*t->match) (&t->locals, d, + h->root.root.string)) != NULL) + { + local_ver = t; + /* If the match is "*", keep looking for a more + explicit, perhaps even global, match. + XXX: Shouldn't this be !d->wildcard instead? */ + if (d->pattern[0] != '*' || d->pattern[1] != '\0') + break; + } + + if (d != NULL) + break; + } + } + + if (local_ver != NULL) + { + h->verinfo.vertree = local_ver; + if (h->dynindx != -1 + && info->shared + && ! info->export_dynamic) + { + (*bed->elf_backend_hide_symbol) (info, h, TRUE); + } + } + } + + return TRUE; +} + +/* Read and swap the relocs from the section indicated by SHDR. This + may be either a REL or a RELA section. The relocations are + translated into RELA relocations and stored in INTERNAL_RELOCS, + which should have already been allocated to contain enough space. + The EXTERNAL_RELOCS are a buffer where the external form of the + relocations should be stored. + + Returns FALSE if something goes wrong. */ + +static bfd_boolean +elf_link_read_relocs_from_section (bfd *abfd, + asection *sec, + Elf_Internal_Shdr *shdr, + void *external_relocs, + Elf_Internal_Rela *internal_relocs) +{ + const struct elf_backend_data *bed; + void (*swap_in) (bfd *, const bfd_byte *, Elf_Internal_Rela *); + const bfd_byte *erela; + const bfd_byte *erelaend; + Elf_Internal_Rela *irela; + Elf_Internal_Shdr *symtab_hdr; + size_t nsyms; + + /* Position ourselves at the start of the section. */ + if (bfd_seek (abfd, shdr->sh_offset, SEEK_SET) != 0) + return FALSE; + + /* Read the relocations. */ + if (bfd_bread (external_relocs, shdr->sh_size, abfd) != shdr->sh_size) + return FALSE; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + nsyms = symtab_hdr->sh_size / symtab_hdr->sh_entsize; + + bed = get_elf_backend_data (abfd); + + /* Convert the external relocations to the internal format. */ + if (shdr->sh_entsize == bed->s->sizeof_rel) + swap_in = bed->s->swap_reloc_in; + else if (shdr->sh_entsize == bed->s->sizeof_rela) + swap_in = bed->s->swap_reloca_in; + else + { + bfd_set_error (bfd_error_wrong_format); + return FALSE; + } + + erela = external_relocs; + erelaend = erela + shdr->sh_size; + irela = internal_relocs; + while (erela < erelaend) + { + bfd_vma r_symndx; + + (*swap_in) (abfd, erela, irela); + r_symndx = ELF32_R_SYM (irela->r_info); + if (bed->s->arch_size == 64) + r_symndx >>= 24; + if ((size_t) r_symndx >= nsyms) + { + (*_bfd_error_handler) + (_("%s: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%s'"), + bfd_archive_filename (abfd), (unsigned long) r_symndx, + (unsigned long) nsyms, irela->r_offset, sec->name); + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + irela += bed->s->int_rels_per_ext_rel; + erela += shdr->sh_entsize; + } + + return TRUE; +} + +/* Read and swap the relocs for a section O. They may have been + cached. If the EXTERNAL_RELOCS and INTERNAL_RELOCS arguments are + not NULL, they are used as buffers to read into. They are known to + be large enough. If the INTERNAL_RELOCS relocs argument is NULL, + the return value is allocated using either malloc or bfd_alloc, + according to the KEEP_MEMORY argument. If O has two relocation + sections (both REL and RELA relocations), then the REL_HDR + relocations will appear first in INTERNAL_RELOCS, followed by the + REL_HDR2 relocations. */ + +Elf_Internal_Rela * +_bfd_elf_link_read_relocs (bfd *abfd, + asection *o, + void *external_relocs, + Elf_Internal_Rela *internal_relocs, + bfd_boolean keep_memory) +{ + Elf_Internal_Shdr *rel_hdr; + void *alloc1 = NULL; + Elf_Internal_Rela *alloc2 = NULL; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + + if (elf_section_data (o)->relocs != NULL) + return elf_section_data (o)->relocs; + + if (o->reloc_count == 0) + return NULL; + + rel_hdr = &elf_section_data (o)->rel_hdr; + + if (internal_relocs == NULL) + { + bfd_size_type size; + + size = o->reloc_count; + size *= bed->s->int_rels_per_ext_rel * sizeof (Elf_Internal_Rela); + if (keep_memory) + internal_relocs = bfd_alloc (abfd, size); + else + internal_relocs = alloc2 = bfd_malloc (size); + if (internal_relocs == NULL) + goto error_return; + } + + if (external_relocs == NULL) + { + bfd_size_type size = rel_hdr->sh_size; + + if (elf_section_data (o)->rel_hdr2) + size += elf_section_data (o)->rel_hdr2->sh_size; + alloc1 = bfd_malloc (size); + if (alloc1 == NULL) + goto error_return; + external_relocs = alloc1; + } + + if (!elf_link_read_relocs_from_section (abfd, o, rel_hdr, + external_relocs, + internal_relocs)) + goto error_return; + if (elf_section_data (o)->rel_hdr2 + && (!elf_link_read_relocs_from_section + (abfd, o, + elf_section_data (o)->rel_hdr2, + ((bfd_byte *) external_relocs) + rel_hdr->sh_size, + internal_relocs + (NUM_SHDR_ENTRIES (rel_hdr) + * bed->s->int_rels_per_ext_rel)))) + goto error_return; + + /* Cache the results for next time, if we can. */ + if (keep_memory) + elf_section_data (o)->relocs = internal_relocs; + + if (alloc1 != NULL) + free (alloc1); + + /* Don't free alloc2, since if it was allocated we are passing it + back (under the name of internal_relocs). */ + + return internal_relocs; + + error_return: + if (alloc1 != NULL) + free (alloc1); + if (alloc2 != NULL) + free (alloc2); + return NULL; +} + +/* Compute the size of, and allocate space for, REL_HDR which is the + section header for a section containing relocations for O. */ + +bfd_boolean +_bfd_elf_link_size_reloc_section (bfd *abfd, + Elf_Internal_Shdr *rel_hdr, + asection *o) +{ + bfd_size_type reloc_count; + bfd_size_type num_rel_hashes; + + /* Figure out how many relocations there will be. */ + if (rel_hdr == &elf_section_data (o)->rel_hdr) + reloc_count = elf_section_data (o)->rel_count; + else + reloc_count = elf_section_data (o)->rel_count2; + + num_rel_hashes = o->reloc_count; + if (num_rel_hashes < reloc_count) + num_rel_hashes = reloc_count; + + /* That allows us to calculate the size of the section. */ + rel_hdr->sh_size = rel_hdr->sh_entsize * reloc_count; + + /* The contents field must last into write_object_contents, so we + allocate it with bfd_alloc rather than malloc. Also since we + cannot be sure that the contents will actually be filled in, + we zero the allocated space. */ + rel_hdr->contents = bfd_zalloc (abfd, rel_hdr->sh_size); + if (rel_hdr->contents == NULL && rel_hdr->sh_size != 0) + return FALSE; + + /* We only allocate one set of hash entries, so we only do it the + first time we are called. */ + if (elf_section_data (o)->rel_hashes == NULL + && num_rel_hashes) + { + struct elf_link_hash_entry **p; + + p = bfd_zmalloc (num_rel_hashes * sizeof (struct elf_link_hash_entry *)); + if (p == NULL) + return FALSE; + + elf_section_data (o)->rel_hashes = p; + } + + return TRUE; +} + +/* Copy the relocations indicated by the INTERNAL_RELOCS (which + originated from the section given by INPUT_REL_HDR) to the + OUTPUT_BFD. */ + +bfd_boolean +_bfd_elf_link_output_relocs (bfd *output_bfd, + asection *input_section, + Elf_Internal_Shdr *input_rel_hdr, + Elf_Internal_Rela *internal_relocs) +{ + Elf_Internal_Rela *irela; + Elf_Internal_Rela *irelaend; + bfd_byte *erel; + Elf_Internal_Shdr *output_rel_hdr; + asection *output_section; + unsigned int *rel_countp = NULL; + const struct elf_backend_data *bed; + void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *); + + output_section = input_section->output_section; + output_rel_hdr = NULL; + + if (elf_section_data (output_section)->rel_hdr.sh_entsize + == input_rel_hdr->sh_entsize) + { + output_rel_hdr = &elf_section_data (output_section)->rel_hdr; + rel_countp = &elf_section_data (output_section)->rel_count; + } + else if (elf_section_data (output_section)->rel_hdr2 + && (elf_section_data (output_section)->rel_hdr2->sh_entsize + == input_rel_hdr->sh_entsize)) + { + output_rel_hdr = elf_section_data (output_section)->rel_hdr2; + rel_countp = &elf_section_data (output_section)->rel_count2; + } + else + { + (*_bfd_error_handler) + (_("%s: relocation size mismatch in %s section %s"), + bfd_get_filename (output_bfd), + bfd_archive_filename (input_section->owner), + input_section->name); + bfd_set_error (bfd_error_wrong_object_format); + return FALSE; + } + + bed = get_elf_backend_data (output_bfd); + if (input_rel_hdr->sh_entsize == bed->s->sizeof_rel) + swap_out = bed->s->swap_reloc_out; + else if (input_rel_hdr->sh_entsize == bed->s->sizeof_rela) + swap_out = bed->s->swap_reloca_out; + else + abort (); + + erel = output_rel_hdr->contents; + erel += *rel_countp * input_rel_hdr->sh_entsize; + irela = internal_relocs; + irelaend = irela + (NUM_SHDR_ENTRIES (input_rel_hdr) + * bed->s->int_rels_per_ext_rel); + while (irela < irelaend) + { + (*swap_out) (output_bfd, irela, erel); + irela += bed->s->int_rels_per_ext_rel; + erel += input_rel_hdr->sh_entsize; + } + + /* Bump the counter, so that we know where to add the next set of + relocations. */ + *rel_countp += NUM_SHDR_ENTRIES (input_rel_hdr); + + return TRUE; +} + +/* Fix up the flags for a symbol. This handles various cases which + can only be fixed after all the input files are seen. This is + currently called by both adjust_dynamic_symbol and + assign_sym_version, which is unnecessary but perhaps more robust in + the face of future changes. */ + +bfd_boolean +_bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h, + struct elf_info_failed *eif) +{ + /* If this symbol was mentioned in a non-ELF file, try to set + DEF_REGULAR and REF_REGULAR correctly. This is the only way to + permit a non-ELF file to correctly refer to a symbol defined in + an ELF dynamic object. */ + if ((h->elf_link_hash_flags & ELF_LINK_NON_ELF) != 0) + { + while (h->root.type == bfd_link_hash_indirect) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK); + else + { + if (h->root.u.def.section->owner != NULL + && (bfd_get_flavour (h->root.u.def.section->owner) + == bfd_target_elf_flavour)) + h->elf_link_hash_flags |= (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK); + else + h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; + } + + if (h->dynindx == -1 + && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + || (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0)) + { + if (! bfd_elf_link_record_dynamic_symbol (eif->info, h)) + { + eif->failed = TRUE; + return FALSE; + } + } + } + else + { + /* Unfortunately, ELF_LINK_NON_ELF is only correct if the symbol + was first seen in a non-ELF file. Fortunately, if the symbol + was first seen in an ELF file, we're probably OK unless the + symbol was defined in a non-ELF file. Catch that case here. + FIXME: We're still in trouble if the symbol was first seen in + a dynamic object, and then later in a non-ELF regular object. */ + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 + && (h->root.u.def.section->owner != NULL + ? (bfd_get_flavour (h->root.u.def.section->owner) + != bfd_target_elf_flavour) + : (bfd_is_abs_section (h->root.u.def.section) + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) == 0))) + h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; + } + + /* If this is a final link, and the symbol was defined as a common + symbol in a regular object file, and there was no definition in + any dynamic object, then the linker will have allocated space for + the symbol in a common section but the ELF_LINK_HASH_DEF_REGULAR + flag will not have been set. */ + if (h->root.type == bfd_link_hash_defined + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 + && (h->root.u.def.section->owner->flags & DYNAMIC) == 0) + h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; + + /* If -Bsymbolic was used (which means to bind references to global + symbols to the definition within the shared object), and this + symbol was defined in a regular object, then it actually doesn't + need a PLT entry. Likewise, if the symbol has non-default + visibility. If the symbol has hidden or internal visibility, we + will force it local. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0 + && eif->info->shared + && is_elf_hash_table (eif->info->hash) + && (eif->info->symbolic + || ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) + { + const struct elf_backend_data *bed; + bfd_boolean force_local; + + bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); + + force_local = (ELF_ST_VISIBILITY (h->other) == STV_INTERNAL + || ELF_ST_VISIBILITY (h->other) == STV_HIDDEN); + (*bed->elf_backend_hide_symbol) (eif->info, h, force_local); + } + + /* If a weak undefined symbol has non-default visibility, we also + hide it from the dynamic linker. */ + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT + && h->root.type == bfd_link_hash_undefweak) + { + const struct elf_backend_data *bed; + bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); + (*bed->elf_backend_hide_symbol) (eif->info, h, TRUE); + } + + /* If this is a weak defined symbol in a dynamic object, and we know + the real definition in the dynamic object, copy interesting flags + over to the real definition. */ + if (h->weakdef != NULL) + { + struct elf_link_hash_entry *weakdef; + + weakdef = h->weakdef; + if (h->root.type == bfd_link_hash_indirect) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + BFD_ASSERT (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak); + BFD_ASSERT (weakdef->root.type == bfd_link_hash_defined + || weakdef->root.type == bfd_link_hash_defweak); + BFD_ASSERT (weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC); + + /* If the real definition is defined by a regular object file, + don't do anything special. See the longer description in + _bfd_elf_adjust_dynamic_symbol, below. */ + if ((weakdef->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) + h->weakdef = NULL; + else + { + const struct elf_backend_data *bed; + + bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); + (*bed->elf_backend_copy_indirect_symbol) (bed, weakdef, h); + } + } + + return TRUE; +} + +/* Make the backend pick a good value for a dynamic symbol. This is + called via elf_link_hash_traverse, and also calls itself + recursively. */ + +bfd_boolean +_bfd_elf_adjust_dynamic_symbol (struct elf_link_hash_entry *h, void *data) +{ + struct elf_info_failed *eif = data; + bfd *dynobj; + const struct elf_backend_data *bed; + + if (! is_elf_hash_table (eif->info->hash)) + return FALSE; + + if (h->root.type == bfd_link_hash_warning) + { + h->plt = elf_hash_table (eif->info)->init_offset; + h->got = elf_hash_table (eif->info)->init_offset; + + /* When warning symbols are created, they **replace** the "real" + entry in the hash table, thus we never get to see the real + symbol in a hash traversal. So look at it now. */ + h = (struct elf_link_hash_entry *) h->root.u.i.link; + } + + /* Ignore indirect symbols. These are added by the versioning code. */ + if (h->root.type == bfd_link_hash_indirect) + return TRUE; + + /* Fix the symbol flags. */ + if (! _bfd_elf_fix_symbol_flags (h, eif)) + return FALSE; + + /* If this symbol does not require a PLT entry, and it is not + defined by a dynamic object, or is not referenced by a regular + object, ignore it. We do have to handle a weak defined symbol, + even if no regular object refers to it, if we decided to add it + to the dynamic symbol table. FIXME: Do we normally need to worry + about symbols which are defined by one dynamic object and + referenced by another one? */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0 + && ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 + || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) == 0 + || ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0 + && (h->weakdef == NULL || h->weakdef->dynindx == -1)))) + { + h->plt = elf_hash_table (eif->info)->init_offset; + return TRUE; + } + + /* If we've already adjusted this symbol, don't do it again. This + can happen via a recursive call. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DYNAMIC_ADJUSTED) != 0) + return TRUE; + + /* Don't look at this symbol again. Note that we must set this + after checking the above conditions, because we may look at a + symbol once, decide not to do anything, and then get called + recursively later after REF_REGULAR is set below. */ + h->elf_link_hash_flags |= ELF_LINK_HASH_DYNAMIC_ADJUSTED; + + /* If this is a weak definition, and we know a real definition, and + the real symbol is not itself defined by a regular object file, + then get a good value for the real definition. We handle the + real symbol first, for the convenience of the backend routine. + + Note that there is a confusing case here. If the real definition + is defined by a regular object file, we don't get the real symbol + from the dynamic object, but we do get the weak symbol. If the + processor backend uses a COPY reloc, then if some routine in the + dynamic object changes the real symbol, we will not see that + change in the corresponding weak symbol. This is the way other + ELF linkers work as well, and seems to be a result of the shared + library model. + + I will clarify this issue. Most SVR4 shared libraries define the + variable _timezone and define timezone as a weak synonym. The + tzset call changes _timezone. If you write + extern int timezone; + int _timezone = 5; + int main () { tzset (); printf ("%d %d\n", timezone, _timezone); } + you might expect that, since timezone is a synonym for _timezone, + the same number will print both times. However, if the processor + backend uses a COPY reloc, then actually timezone will be copied + into your process image, and, since you define _timezone + yourself, _timezone will not. Thus timezone and _timezone will + wind up at different memory locations. The tzset call will set + _timezone, leaving timezone unchanged. */ + + if (h->weakdef != NULL) + { + /* If we get to this point, we know there is an implicit + reference by a regular object file via the weak symbol H. + FIXME: Is this really true? What if the traversal finds + H->WEAKDEF before it finds H? */ + h->weakdef->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR; + + if (! _bfd_elf_adjust_dynamic_symbol (h->weakdef, eif)) + return FALSE; + } + + /* If a symbol has no type and no size and does not require a PLT + entry, then we are probably about to do the wrong thing here: we + are probably going to create a COPY reloc for an empty object. + This case can arise when a shared object is built with assembly + code, and the assembly code fails to set the symbol type. */ + if (h->size == 0 + && h->type == STT_NOTYPE + && (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) == 0) + (*_bfd_error_handler) + (_("warning: type and size of dynamic symbol `%s' are not defined"), + h->root.root.string); + + dynobj = elf_hash_table (eif->info)->dynobj; + bed = get_elf_backend_data (dynobj); + if (! (*bed->elf_backend_adjust_dynamic_symbol) (eif->info, h)) + { + eif->failed = TRUE; + return FALSE; + } + + return TRUE; +} + +/* Adjust all external symbols pointing into SEC_MERGE sections + to reflect the object merging within the sections. */ + +bfd_boolean +_bfd_elf_link_sec_merge_syms (struct elf_link_hash_entry *h, void *data) +{ + asection *sec; + + if (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)->flags & SEC_MERGE) + && sec->sec_info_type == ELF_INFO_TYPE_MERGE) + { + bfd *output_bfd = data; + + h->root.u.def.value = + _bfd_merged_section_offset (output_bfd, + &h->root.u.def.section, + elf_section_data (sec)->sec_info, + h->root.u.def.value, 0); + } + + return TRUE; +} + +/* Returns false if the symbol referred to by H should be considered + to resolve local to the current module, and true if it should be + considered to bind dynamically. */ + +bfd_boolean +_bfd_elf_dynamic_symbol_p (struct elf_link_hash_entry *h, + struct bfd_link_info *info, + bfd_boolean ignore_protected) +{ + bfd_boolean binding_stays_local_p; + + 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 it was forced local, then clearly it's not dynamic. */ + if (h->dynindx == -1) + return FALSE; + if (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) + return FALSE; + + /* Identify the cases where name binding rules say that a + visible symbol resolves locally. */ + binding_stays_local_p = info->executable || info->symbolic; + + switch (ELF_ST_VISIBILITY (h->other)) + { + case STV_INTERNAL: + case STV_HIDDEN: + return FALSE; + + case STV_PROTECTED: + /* Proper resolution for function pointer equality may require + that these symbols perhaps be resolved dynamically, even though + we should be resolving them to the current module. */ + if (!ignore_protected) + binding_stays_local_p = TRUE; + break; + + default: + break; + } + + /* If it isn't defined locally, then clearly it's dynamic. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + return TRUE; + + /* Otherwise, the symbol is dynamic if binding rules don't tell + us that it remains local. */ + return !binding_stays_local_p; +} + +/* Return true if the symbol referred to by H should be considered + to resolve local to the current module, and false otherwise. Differs + from (the inverse of) _bfd_elf_dynamic_symbol_p in the treatment of + undefined symbols and weak symbols. */ + +bfd_boolean +_bfd_elf_symbol_refs_local_p (struct elf_link_hash_entry *h, + struct bfd_link_info *info, + bfd_boolean local_protected) +{ + /* If it's a local sym, of course we resolve locally. */ + if (h == NULL) + return TRUE; + + /* If we don't have a definition in a regular file, then we can't + resolve locally. The sym is either undefined or dynamic. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + return FALSE; + + /* Forced local symbols resolve locally. */ + if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) + return TRUE; + + /* As do non-dynamic symbols. */ + if (h->dynindx == -1) + return TRUE; + + /* At this point, we know the symbol is defined and dynamic. In an + executable it must resolve locally, likewise when building symbolic + shared libraries. */ + if (info->executable || info->symbolic) + return TRUE; + + /* Now deal with defined dynamic symbols in shared libraries. Ones + with default visibility might not resolve locally. */ + if (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + return FALSE; + + /* However, STV_HIDDEN or STV_INTERNAL ones must be local. */ + if (ELF_ST_VISIBILITY (h->other) != STV_PROTECTED) + return TRUE; + + /* Function pointer equality tests may require that STV_PROTECTED + symbols be treated as dynamic symbols, even when we know that the + dynamic linker will resolve them locally. */ + return local_protected; +} + +/* Caches some TLS segment info, and ensures that the TLS segment vma is + aligned. Returns the first TLS output section. */ + +struct bfd_section * +_bfd_elf_tls_setup (bfd *obfd, struct bfd_link_info *info) +{ + struct bfd_section *sec, *tls; + unsigned int align = 0; + + for (sec = obfd->sections; sec != NULL; sec = sec->next) + if ((sec->flags & SEC_THREAD_LOCAL) != 0) + break; + tls = sec; + + for (; sec != NULL && (sec->flags & SEC_THREAD_LOCAL) != 0; sec = sec->next) + if (sec->alignment_power > align) + align = sec->alignment_power; + + elf_hash_table (info)->tls_sec = tls; + + /* Ensure the alignment of the first section is the largest alignment, + so that the tls segment starts aligned. */ + if (tls != NULL) + tls->alignment_power = align; + + return tls; +} + +/* Return TRUE iff this is a non-common, definition of a non-function symbol. */ +static bfd_boolean +is_global_data_symbol_definition (bfd *abfd ATTRIBUTE_UNUSED, + Elf_Internal_Sym *sym) +{ + /* Local symbols do not count, but target specific ones might. */ + if (ELF_ST_BIND (sym->st_info) != STB_GLOBAL + && ELF_ST_BIND (sym->st_info) < STB_LOOS) + return FALSE; + + /* Function symbols do not count. */ + if (ELF_ST_TYPE (sym->st_info) == STT_FUNC) + return FALSE; + + /* If the section is undefined, then so is the symbol. */ + if (sym->st_shndx == SHN_UNDEF) + return FALSE; + + /* If the symbol is defined in the common section, then + it is a common definition and so does not count. */ + if (sym->st_shndx == SHN_COMMON) + return FALSE; + + /* If the symbol is in a target specific section then we + must rely upon the backend to tell us what it is. */ + if (sym->st_shndx >= SHN_LORESERVE && sym->st_shndx < SHN_ABS) + /* FIXME - this function is not coded yet: + + return _bfd_is_global_symbol_definition (abfd, sym); + + Instead for now assume that the definition is not global, + Even if this is wrong, at least the linker will behave + in the same way that it used to do. */ + return FALSE; + + return TRUE; +} + +/* Search the symbol table of the archive element of the archive ABFD + whose archive map contains a mention of SYMDEF, and determine if + the symbol is defined in this element. */ +static bfd_boolean +elf_link_is_defined_archive_symbol (bfd * abfd, carsym * symdef) +{ + Elf_Internal_Shdr * hdr; + bfd_size_type symcount; + bfd_size_type extsymcount; + bfd_size_type extsymoff; + Elf_Internal_Sym *isymbuf; + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; + bfd_boolean result; + + abfd = _bfd_get_elt_at_filepos (abfd, symdef->file_offset); + if (abfd == NULL) + return FALSE; + + if (! bfd_check_format (abfd, bfd_object)) + return FALSE; + + /* If we have already included the element containing this symbol in the + link then we do not need to include it again. Just claim that any symbol + it contains is not a definition, so that our caller will not decide to + (re)include this element. */ + if (abfd->archive_pass) + return FALSE; + + /* Select the appropriate symbol table. */ + if ((abfd->flags & DYNAMIC) == 0 || elf_dynsymtab (abfd) == 0) + hdr = &elf_tdata (abfd)->symtab_hdr; + else + hdr = &elf_tdata (abfd)->dynsymtab_hdr; + + symcount = hdr->sh_size / get_elf_backend_data (abfd)->s->sizeof_sym; + + /* The sh_info field of the symtab header tells us where the + external symbols start. We don't care about the local symbols. */ + if (elf_bad_symtab (abfd)) + { + extsymcount = symcount; + extsymoff = 0; + } + else + { + extsymcount = symcount - hdr->sh_info; + extsymoff = hdr->sh_info; + } + + if (extsymcount == 0) + return FALSE; + + /* Read in the symbol table. */ + isymbuf = bfd_elf_get_elf_syms (abfd, hdr, extsymcount, extsymoff, + NULL, NULL, NULL); + if (isymbuf == NULL) + return FALSE; + + /* Scan the symbol table looking for SYMDEF. */ + result = FALSE; + for (isym = isymbuf, isymend = isymbuf + extsymcount; isym < isymend; isym++) + { + const char *name; + + name = bfd_elf_string_from_elf_section (abfd, hdr->sh_link, + isym->st_name); + if (name == NULL) + break; + + if (strcmp (name, symdef->name) == 0) + { + result = is_global_data_symbol_definition (abfd, isym); + break; + } + } + + free (isymbuf); + + return result; +} + +/* Add an entry to the .dynamic table. */ + +bfd_boolean +_bfd_elf_add_dynamic_entry (struct bfd_link_info *info, + bfd_vma tag, + bfd_vma val) +{ + struct elf_link_hash_table *hash_table; + const struct elf_backend_data *bed; + asection *s; + bfd_size_type newsize; + bfd_byte *newcontents; + Elf_Internal_Dyn dyn; + + hash_table = elf_hash_table (info); + if (! is_elf_hash_table (hash_table)) + return FALSE; + + bed = get_elf_backend_data (hash_table->dynobj); + s = bfd_get_section_by_name (hash_table->dynobj, ".dynamic"); + BFD_ASSERT (s != NULL); + + newsize = s->_raw_size + bed->s->sizeof_dyn; + newcontents = bfd_realloc (s->contents, newsize); + if (newcontents == NULL) + return FALSE; + + dyn.d_tag = tag; + dyn.d_un.d_val = val; + bed->s->swap_dyn_out (hash_table->dynobj, &dyn, newcontents + s->_raw_size); + + s->_raw_size = newsize; + s->contents = newcontents; + + return TRUE; +} + +/* Add a DT_NEEDED entry for this dynamic object if DO_IT is true, + otherwise just check whether one already exists. Returns -1 on error, + 1 if a DT_NEEDED tag already exists, and 0 on success. */ + +static int +elf_add_dt_needed_tag (struct bfd_link_info *info, + const char *soname, + bfd_boolean do_it) +{ + struct elf_link_hash_table *hash_table; + bfd_size_type oldsize; + bfd_size_type strindex; + + hash_table = elf_hash_table (info); + oldsize = _bfd_elf_strtab_size (hash_table->dynstr); + strindex = _bfd_elf_strtab_add (hash_table->dynstr, soname, FALSE); + if (strindex == (bfd_size_type) -1) + return -1; + + if (oldsize == _bfd_elf_strtab_size (hash_table->dynstr)) + { + asection *sdyn; + const struct elf_backend_data *bed; + bfd_byte *extdyn; + + bed = get_elf_backend_data (hash_table->dynobj); + sdyn = bfd_get_section_by_name (hash_table->dynobj, ".dynamic"); + BFD_ASSERT (sdyn != NULL); + + for (extdyn = sdyn->contents; + extdyn < sdyn->contents + sdyn->_raw_size; + extdyn += bed->s->sizeof_dyn) + { + Elf_Internal_Dyn dyn; + + bed->s->swap_dyn_in (hash_table->dynobj, extdyn, &dyn); + if (dyn.d_tag == DT_NEEDED + && dyn.d_un.d_val == strindex) + { + _bfd_elf_strtab_delref (hash_table->dynstr, strindex); + return 1; + } + } + } + + if (do_it) + { + if (!_bfd_elf_add_dynamic_entry (info, DT_NEEDED, strindex)) + return -1; + } + else + /* We were just checking for existence of the tag. */ + _bfd_elf_strtab_delref (hash_table->dynstr, strindex); + + return 0; +} + +/* Sort symbol by value and section. */ +static int +elf_sort_symbol (const void *arg1, const void *arg2) +{ + const struct elf_link_hash_entry *h1; + const struct elf_link_hash_entry *h2; + bfd_signed_vma vdiff; + + h1 = *(const struct elf_link_hash_entry **) arg1; + h2 = *(const struct elf_link_hash_entry **) arg2; + vdiff = h1->root.u.def.value - h2->root.u.def.value; + if (vdiff != 0) + return vdiff > 0 ? 1 : -1; + else + { + long sdiff = h1->root.u.def.section - h2->root.u.def.section; + if (sdiff != 0) + return sdiff > 0 ? 1 : -1; + } + return 0; +} + +/* This function is used to adjust offsets into .dynstr for + dynamic symbols. This is called via elf_link_hash_traverse. */ + +static bfd_boolean +elf_adjust_dynstr_offsets (struct elf_link_hash_entry *h, void *data) +{ + struct elf_strtab_hash *dynstr = data; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->dynindx != -1) + h->dynstr_index = _bfd_elf_strtab_offset (dynstr, h->dynstr_index); + return TRUE; +} + +/* Assign string offsets in .dynstr, update all structures referencing + them. */ + +static bfd_boolean +elf_finalize_dynstr (bfd *output_bfd, struct bfd_link_info *info) +{ + struct elf_link_hash_table *hash_table = elf_hash_table (info); + struct elf_link_local_dynamic_entry *entry; + struct elf_strtab_hash *dynstr = hash_table->dynstr; + bfd *dynobj = hash_table->dynobj; + asection *sdyn; + bfd_size_type size; + const struct elf_backend_data *bed; + bfd_byte *extdyn; + + _bfd_elf_strtab_finalize (dynstr); + size = _bfd_elf_strtab_size (dynstr); + + bed = get_elf_backend_data (dynobj); + sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + BFD_ASSERT (sdyn != NULL); + + /* Update all .dynamic entries referencing .dynstr strings. */ + for (extdyn = sdyn->contents; + extdyn < sdyn->contents + sdyn->_raw_size; + extdyn += bed->s->sizeof_dyn) + { + Elf_Internal_Dyn dyn; + + bed->s->swap_dyn_in (dynobj, extdyn, &dyn); + switch (dyn.d_tag) + { + case DT_STRSZ: + dyn.d_un.d_val = size; + break; + case DT_NEEDED: + case DT_SONAME: + case DT_RPATH: + case DT_RUNPATH: + case DT_FILTER: + case DT_AUXILIARY: + dyn.d_un.d_val = _bfd_elf_strtab_offset (dynstr, dyn.d_un.d_val); + break; + default: + continue; + } + bed->s->swap_dyn_out (dynobj, &dyn, extdyn); + } + + /* Now update local dynamic symbols. */ + for (entry = hash_table->dynlocal; entry ; entry = entry->next) + entry->isym.st_name = _bfd_elf_strtab_offset (dynstr, + entry->isym.st_name); + + /* And the rest of dynamic symbols. */ + elf_link_hash_traverse (hash_table, elf_adjust_dynstr_offsets, dynstr); + + /* Adjust version definitions. */ + if (elf_tdata (output_bfd)->cverdefs) + { + asection *s; + bfd_byte *p; + bfd_size_type i; + Elf_Internal_Verdef def; + Elf_Internal_Verdaux defaux; + + s = bfd_get_section_by_name (dynobj, ".gnu.version_d"); + p = s->contents; + do + { + _bfd_elf_swap_verdef_in (output_bfd, (Elf_External_Verdef *) p, + &def); + p += sizeof (Elf_External_Verdef); + for (i = 0; i < def.vd_cnt; ++i) + { + _bfd_elf_swap_verdaux_in (output_bfd, + (Elf_External_Verdaux *) p, &defaux); + defaux.vda_name = _bfd_elf_strtab_offset (dynstr, + defaux.vda_name); + _bfd_elf_swap_verdaux_out (output_bfd, + &defaux, (Elf_External_Verdaux *) p); + p += sizeof (Elf_External_Verdaux); + } + } + while (def.vd_next); + } + + /* Adjust version references. */ + if (elf_tdata (output_bfd)->verref) + { + asection *s; + bfd_byte *p; + bfd_size_type i; + Elf_Internal_Verneed need; + Elf_Internal_Vernaux needaux; + + s = bfd_get_section_by_name (dynobj, ".gnu.version_r"); + p = s->contents; + do + { + _bfd_elf_swap_verneed_in (output_bfd, (Elf_External_Verneed *) p, + &need); + need.vn_file = _bfd_elf_strtab_offset (dynstr, need.vn_file); + _bfd_elf_swap_verneed_out (output_bfd, &need, + (Elf_External_Verneed *) p); + p += sizeof (Elf_External_Verneed); + for (i = 0; i < need.vn_cnt; ++i) + { + _bfd_elf_swap_vernaux_in (output_bfd, + (Elf_External_Vernaux *) p, &needaux); + needaux.vna_name = _bfd_elf_strtab_offset (dynstr, + needaux.vna_name); + _bfd_elf_swap_vernaux_out (output_bfd, + &needaux, + (Elf_External_Vernaux *) p); + p += sizeof (Elf_External_Vernaux); + } + } + while (need.vn_next); + } + + return TRUE; +} + +/* Add symbols from an ELF object file to the linker hash table. */ + +static bfd_boolean +elf_link_add_object_symbols (bfd *abfd, struct bfd_link_info *info) +{ + bfd_boolean (*add_symbol_hook) + (bfd *, struct bfd_link_info *, Elf_Internal_Sym *, + const char **, flagword *, asection **, bfd_vma *); + bfd_boolean (*check_relocs) + (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); + bfd_boolean collect; + Elf_Internal_Shdr *hdr; + bfd_size_type symcount; + bfd_size_type extsymcount; + bfd_size_type extsymoff; + struct elf_link_hash_entry **sym_hash; + bfd_boolean dynamic; + Elf_External_Versym *extversym = NULL; + Elf_External_Versym *ever; + struct elf_link_hash_entry *weaks; + struct elf_link_hash_entry **nondeflt_vers = NULL; + bfd_size_type nondeflt_vers_cnt = 0; + Elf_Internal_Sym *isymbuf = NULL; + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; + const struct elf_backend_data *bed; + bfd_boolean add_needed; + struct elf_link_hash_table * hash_table; + bfd_size_type amt; + + hash_table = elf_hash_table (info); + + bed = get_elf_backend_data (abfd); + add_symbol_hook = bed->elf_add_symbol_hook; + collect = bed->collect; + + if ((abfd->flags & DYNAMIC) == 0) + dynamic = FALSE; + else + { + dynamic = TRUE; + + /* You can't use -r against a dynamic object. Also, there's no + hope of using a dynamic object which does not exactly match + the format of the output file. */ + if (info->relocatable + || !is_elf_hash_table (hash_table) + || hash_table->root.creator != abfd->xvec) + { + bfd_set_error (bfd_error_invalid_operation); + goto error_return; + } + } + + /* As a GNU extension, any input sections which are named + .gnu.warning.SYMBOL are treated as warning symbols for the given + symbol. This differs from .gnu.warning sections, which generate + warnings when they are included in an output file. */ + if (info->executable) + { + asection *s; + + for (s = abfd->sections; s != NULL; s = s->next) + { + const char *name; + + name = bfd_get_section_name (abfd, s); + if (strncmp (name, ".gnu.warning.", sizeof ".gnu.warning." - 1) == 0) + { + char *msg; + bfd_size_type sz; + bfd_size_type prefix_len; + const char * gnu_warning_prefix = _("warning: "); + + name += sizeof ".gnu.warning." - 1; + + /* If this is a shared object, then look up the symbol + in the hash table. If it is there, and it is already + been defined, then we will not be using the entry + from this shared object, so we don't need to warn. + FIXME: If we see the definition in a regular object + later on, we will warn, but we shouldn't. The only + fix is to keep track of what warnings we are supposed + to emit, and then handle them all at the end of the + link. */ + if (dynamic) + { + struct elf_link_hash_entry *h; + + h = elf_link_hash_lookup (hash_table, name, + FALSE, FALSE, TRUE); + + /* FIXME: What about bfd_link_hash_common? */ + if (h != NULL + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak)) + { + /* We don't want to issue this warning. Clobber + the section size so that the warning does not + get copied into the output file. */ + s->_raw_size = 0; + continue; + } + } + + sz = bfd_section_size (abfd, s); + prefix_len = strlen (gnu_warning_prefix); + msg = bfd_alloc (abfd, prefix_len + sz + 1); + if (msg == NULL) + goto error_return; + + strcpy (msg, gnu_warning_prefix); + if (! bfd_get_section_contents (abfd, s, msg + prefix_len, 0, sz)) + goto error_return; + + msg[prefix_len + sz] = '\0'; + + if (! (_bfd_generic_link_add_one_symbol + (info, abfd, name, BSF_WARNING, s, 0, msg, + FALSE, collect, NULL))) + goto error_return; + + if (! info->relocatable) + { + /* Clobber the section size so that the warning does + not get copied into the output file. */ + s->_raw_size = 0; + } + } + } + } + + add_needed = TRUE; + if (! dynamic) + { + /* If we are creating a shared library, create all the dynamic + sections immediately. We need to attach them to something, + so we attach them to this BFD, provided it is the right + format. FIXME: If there are no input BFD's of the same + format as the output, we can't make a shared library. */ + if (info->shared + && is_elf_hash_table (hash_table) + && hash_table->root.creator == abfd->xvec + && ! hash_table->dynamic_sections_created) + { + if (! _bfd_elf_link_create_dynamic_sections (abfd, info)) + goto error_return; + } + } + else if (!is_elf_hash_table (hash_table)) + goto error_return; + else + { + asection *s; + const char *soname = NULL; + struct bfd_link_needed_list *rpath = NULL, *runpath = NULL; + int ret; + + /* ld --just-symbols and dynamic objects don't mix very well. + Test for --just-symbols by looking at info set up by + _bfd_elf_link_just_syms. */ + if ((s = abfd->sections) != NULL + && s->sec_info_type == ELF_INFO_TYPE_JUST_SYMS) + goto error_return; + + /* If this dynamic lib was specified on the command line with + --as-needed in effect, then we don't want to add a DT_NEEDED + tag unless the lib is actually used. Similary for libs brought + in by another lib's DT_NEEDED. */ + add_needed = elf_dyn_lib_class (abfd) == DYN_NORMAL; + + s = bfd_get_section_by_name (abfd, ".dynamic"); + if (s != NULL) + { + bfd_byte *dynbuf; + bfd_byte *extdyn; + int elfsec; + unsigned long shlink; + + dynbuf = bfd_malloc (s->_raw_size); + if (dynbuf == NULL) + goto error_return; + + if (! bfd_get_section_contents (abfd, s, dynbuf, 0, s->_raw_size)) + goto error_free_dyn; + + elfsec = _bfd_elf_section_from_bfd_section (abfd, s); + if (elfsec == -1) + goto error_free_dyn; + shlink = elf_elfsections (abfd)[elfsec]->sh_link; + + for (extdyn = dynbuf; + extdyn < dynbuf + s->_raw_size; + extdyn += bed->s->sizeof_dyn) + { + Elf_Internal_Dyn dyn; + + bed->s->swap_dyn_in (abfd, extdyn, &dyn); + if (dyn.d_tag == DT_SONAME) + { + unsigned int tagv = dyn.d_un.d_val; + soname = bfd_elf_string_from_elf_section (abfd, shlink, tagv); + if (soname == NULL) + goto error_free_dyn; + } + if (dyn.d_tag == DT_NEEDED) + { + struct bfd_link_needed_list *n, **pn; + char *fnm, *anm; + unsigned int tagv = dyn.d_un.d_val; + + amt = sizeof (struct bfd_link_needed_list); + n = bfd_alloc (abfd, amt); + fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv); + if (n == NULL || fnm == NULL) + goto error_free_dyn; + amt = strlen (fnm) + 1; + anm = bfd_alloc (abfd, amt); + if (anm == NULL) + goto error_free_dyn; + memcpy (anm, fnm, amt); + n->name = anm; + n->by = abfd; + n->next = NULL; + for (pn = & hash_table->needed; + *pn != NULL; + pn = &(*pn)->next) + ; + *pn = n; + } + if (dyn.d_tag == DT_RUNPATH) + { + struct bfd_link_needed_list *n, **pn; + char *fnm, *anm; + unsigned int tagv = dyn.d_un.d_val; + + amt = sizeof (struct bfd_link_needed_list); + n = bfd_alloc (abfd, amt); + fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv); + if (n == NULL || fnm == NULL) + goto error_free_dyn; + amt = strlen (fnm) + 1; + anm = bfd_alloc (abfd, amt); + if (anm == NULL) + goto error_free_dyn; + memcpy (anm, fnm, amt); + n->name = anm; + n->by = abfd; + n->next = NULL; + for (pn = & runpath; + *pn != NULL; + pn = &(*pn)->next) + ; + *pn = n; + } + /* Ignore DT_RPATH if we have seen DT_RUNPATH. */ + if (!runpath && dyn.d_tag == DT_RPATH) + { + struct bfd_link_needed_list *n, **pn; + char *fnm, *anm; + unsigned int tagv = dyn.d_un.d_val; + + amt = sizeof (struct bfd_link_needed_list); + n = bfd_alloc (abfd, amt); + fnm = bfd_elf_string_from_elf_section (abfd, shlink, tagv); + if (n == NULL || fnm == NULL) + goto error_free_dyn; + amt = strlen (fnm) + 1; + anm = bfd_alloc (abfd, amt); + if (anm == NULL) + { + error_free_dyn: + free (dynbuf); + goto error_return; + } + memcpy (anm, fnm, amt); + n->name = anm; + n->by = abfd; + n->next = NULL; + for (pn = & rpath; + *pn != NULL; + pn = &(*pn)->next) + ; + *pn = n; + } + } + + free (dynbuf); + } + + /* DT_RUNPATH overrides DT_RPATH. Do _NOT_ bfd_release, as that + frees all more recently bfd_alloc'd blocks as well. */ + if (runpath) + rpath = runpath; + + if (rpath) + { + struct bfd_link_needed_list **pn; + for (pn = & hash_table->runpath; + *pn != NULL; + pn = &(*pn)->next) + ; + *pn = rpath; + } + + /* We do not want to include any of the sections in a dynamic + object in the output file. We hack by simply clobbering the + list of sections in the BFD. This could be handled more + cleanly by, say, a new section flag; the existing + SEC_NEVER_LOAD flag is not the one we want, because that one + still implies that the section takes up space in the output + file. */ + bfd_section_list_clear (abfd); + + /* If this is the first dynamic object found in the link, create + the special sections required for dynamic linking. */ + if (! _bfd_elf_link_create_dynamic_sections (abfd, info)) + goto error_return; + + /* Find the name to use in a DT_NEEDED entry that refers to this + object. If the object has a DT_SONAME entry, we use it. + Otherwise, if the generic linker stuck something in + elf_dt_name, we use that. Otherwise, we just use the file + name. */ + if (soname == NULL || *soname == '\0') + { + soname = elf_dt_name (abfd); + if (soname == NULL || *soname == '\0') + soname = bfd_get_filename (abfd); + } + + /* Save the SONAME because sometimes the linker emulation code + will need to know it. */ + elf_dt_name (abfd) = soname; + + ret = elf_add_dt_needed_tag (info, soname, add_needed); + if (ret < 0) + goto error_return; + + /* If we have already included this dynamic object in the + link, just ignore it. There is no reason to include a + particular dynamic object more than once. */ + if (ret > 0) + return TRUE; + } + + /* If this is a dynamic object, we always link against the .dynsym + symbol table, not the .symtab symbol table. The dynamic linker + will only see the .dynsym symbol table, so there is no reason to + look at .symtab for a dynamic object. */ + + if (! dynamic || elf_dynsymtab (abfd) == 0) + hdr = &elf_tdata (abfd)->symtab_hdr; + else + hdr = &elf_tdata (abfd)->dynsymtab_hdr; + + symcount = hdr->sh_size / bed->s->sizeof_sym; + + /* The sh_info field of the symtab header tells us where the + external symbols start. We don't care about the local symbols at + this point. */ + if (elf_bad_symtab (abfd)) + { + extsymcount = symcount; + extsymoff = 0; + } + else + { + extsymcount = symcount - hdr->sh_info; + extsymoff = hdr->sh_info; + } + + sym_hash = NULL; + if (extsymcount != 0) + { + isymbuf = bfd_elf_get_elf_syms (abfd, hdr, extsymcount, extsymoff, + NULL, NULL, NULL); + if (isymbuf == NULL) + goto error_return; + + /* We store a pointer to the hash table entry for each external + symbol. */ + amt = extsymcount * sizeof (struct elf_link_hash_entry *); + sym_hash = bfd_alloc (abfd, amt); + if (sym_hash == NULL) + goto error_free_sym; + elf_sym_hashes (abfd) = sym_hash; + } + + if (dynamic) + { + /* Read in any version definitions. */ + if (! _bfd_elf_slurp_version_tables (abfd)) + goto error_free_sym; + + /* Read in the symbol versions, but don't bother to convert them + to internal format. */ + if (elf_dynversym (abfd) != 0) + { + Elf_Internal_Shdr *versymhdr; + + versymhdr = &elf_tdata (abfd)->dynversym_hdr; + extversym = bfd_malloc (versymhdr->sh_size); + if (extversym == NULL) + goto error_free_sym; + amt = versymhdr->sh_size; + if (bfd_seek (abfd, versymhdr->sh_offset, SEEK_SET) != 0 + || bfd_bread (extversym, amt, abfd) != amt) + goto error_free_vers; + } + } + + weaks = NULL; + + ever = extversym != NULL ? extversym + extsymoff : NULL; + for (isym = isymbuf, isymend = isymbuf + extsymcount; + isym < isymend; + isym++, sym_hash++, ever = (ever != NULL ? ever + 1 : NULL)) + { + int bind; + bfd_vma value; + asection *sec; + flagword flags; + const char *name; + struct elf_link_hash_entry *h; + bfd_boolean definition; + bfd_boolean size_change_ok; + bfd_boolean type_change_ok; + bfd_boolean new_weakdef; + bfd_boolean override; + unsigned int old_alignment; + bfd *old_bfd; + + override = FALSE; + + flags = BSF_NO_FLAGS; + sec = NULL; + value = isym->st_value; + *sym_hash = NULL; + + bind = ELF_ST_BIND (isym->st_info); + if (bind == STB_LOCAL) + { + /* This should be impossible, since ELF requires that all + global symbols follow all local symbols, and that sh_info + point to the first global symbol. Unfortunately, Irix 5 + screws this up. */ + continue; + } + else if (bind == STB_GLOBAL) + { + if (isym->st_shndx != SHN_UNDEF + && isym->st_shndx != SHN_COMMON) + flags = BSF_GLOBAL; + } + else if (bind == STB_WEAK) + flags = BSF_WEAK; + else + { + /* Leave it up to the processor backend. */ + } + + if (isym->st_shndx == SHN_UNDEF) + sec = bfd_und_section_ptr; + else if (isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE) + { + sec = bfd_section_from_elf_index (abfd, isym->st_shndx); + if (sec == NULL) + sec = bfd_abs_section_ptr; + else if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0) + value -= sec->vma; + } + else if (isym->st_shndx == SHN_ABS) + sec = bfd_abs_section_ptr; + else if (isym->st_shndx == SHN_COMMON) + { + sec = bfd_com_section_ptr; + /* What ELF calls the size we call the value. What ELF + calls the value we call the alignment. */ + value = isym->st_size; + } + else + { + /* Leave it up to the processor backend. */ + } + + name = bfd_elf_string_from_elf_section (abfd, hdr->sh_link, + isym->st_name); + if (name == NULL) + goto error_free_vers; + + if (isym->st_shndx == SHN_COMMON + && ELF_ST_TYPE (isym->st_info) == STT_TLS) + { + asection *tcomm = bfd_get_section_by_name (abfd, ".tcommon"); + + if (tcomm == NULL) + { + tcomm = bfd_make_section (abfd, ".tcommon"); + if (tcomm == NULL + || !bfd_set_section_flags (abfd, tcomm, (SEC_ALLOC + | SEC_IS_COMMON + | SEC_LINKER_CREATED + | SEC_THREAD_LOCAL))) + goto error_free_vers; + } + sec = tcomm; + } + else if (add_symbol_hook) + { + if (! (*add_symbol_hook) (abfd, info, isym, &name, &flags, &sec, + &value)) + goto error_free_vers; + + /* The hook function sets the name to NULL if this symbol + should be skipped for some reason. */ + if (name == NULL) + continue; + } + + /* Sanity check that all possibilities were handled. */ + if (sec == NULL) + { + bfd_set_error (bfd_error_bad_value); + goto error_free_vers; + } + + if (bfd_is_und_section (sec) + || bfd_is_com_section (sec)) + definition = FALSE; + else + definition = TRUE; + + size_change_ok = FALSE; + type_change_ok = get_elf_backend_data (abfd)->type_change_ok; + old_alignment = 0; + old_bfd = NULL; + + if (is_elf_hash_table (hash_table)) + { + Elf_Internal_Versym iver; + unsigned int vernum = 0; + bfd_boolean skip; + + if (ever != NULL) + { + _bfd_elf_swap_versym_in (abfd, ever, &iver); + vernum = iver.vs_vers & VERSYM_VERSION; + + /* If this is a hidden symbol, or if it is not version + 1, we append the version name to the symbol name. + However, we do not modify a non-hidden absolute + symbol, because it might be the version symbol + itself. FIXME: What if it isn't? */ + if ((iver.vs_vers & VERSYM_HIDDEN) != 0 + || (vernum > 1 && ! bfd_is_abs_section (sec))) + { + const char *verstr; + size_t namelen, verlen, newlen; + char *newname, *p; + + if (isym->st_shndx != SHN_UNDEF) + { + if (vernum > elf_tdata (abfd)->dynverdef_hdr.sh_info) + { + (*_bfd_error_handler) + (_("%s: %s: invalid version %u (max %d)"), + bfd_archive_filename (abfd), name, vernum, + elf_tdata (abfd)->dynverdef_hdr.sh_info); + bfd_set_error (bfd_error_bad_value); + goto error_free_vers; + } + else if (vernum > 1) + verstr = + elf_tdata (abfd)->verdef[vernum - 1].vd_nodename; + else + verstr = ""; + } + else + { + /* We cannot simply test for the number of + entries in the VERNEED section since the + numbers for the needed versions do not start + at 0. */ + Elf_Internal_Verneed *t; + + verstr = NULL; + for (t = elf_tdata (abfd)->verref; + t != NULL; + t = t->vn_nextref) + { + Elf_Internal_Vernaux *a; + + for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr) + { + if (a->vna_other == vernum) + { + verstr = a->vna_nodename; + break; + } + } + if (a != NULL) + break; + } + if (verstr == NULL) + { + (*_bfd_error_handler) + (_("%s: %s: invalid needed version %d"), + bfd_archive_filename (abfd), name, vernum); + bfd_set_error (bfd_error_bad_value); + goto error_free_vers; + } + } + + namelen = strlen (name); + verlen = strlen (verstr); + newlen = namelen + verlen + 2; + if ((iver.vs_vers & VERSYM_HIDDEN) == 0 + && isym->st_shndx != SHN_UNDEF) + ++newlen; + + newname = bfd_alloc (abfd, newlen); + if (newname == NULL) + goto error_free_vers; + memcpy (newname, name, namelen); + p = newname + namelen; + *p++ = ELF_VER_CHR; + /* If this is a defined non-hidden version symbol, + we add another @ to the name. This indicates the + default version of the symbol. */ + if ((iver.vs_vers & VERSYM_HIDDEN) == 0 + && isym->st_shndx != SHN_UNDEF) + *p++ = ELF_VER_CHR; + memcpy (p, verstr, verlen + 1); + + name = newname; + } + } + + if (!_bfd_elf_merge_symbol (abfd, info, name, isym, &sec, &value, + sym_hash, &skip, &override, + &type_change_ok, &size_change_ok)) + goto error_free_vers; + + if (skip) + continue; + + if (override) + definition = FALSE; + + h = *sym_hash; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* Remember the old alignment if this is a common symbol, so + that we don't reduce the alignment later on. We can't + check later, because _bfd_generic_link_add_one_symbol + will set a default for the alignment which we want to + override. We also remember the old bfd where the existing + definition comes from. */ + switch (h->root.type) + { + default: + break; + + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + old_bfd = h->root.u.def.section->owner; + break; + + case bfd_link_hash_common: + old_bfd = h->root.u.c.p->section->owner; + old_alignment = h->root.u.c.p->alignment_power; + break; + } + + if (elf_tdata (abfd)->verdef != NULL + && ! override + && vernum > 1 + && definition) + h->verinfo.verdef = &elf_tdata (abfd)->verdef[vernum - 1]; + } + + if (! (_bfd_generic_link_add_one_symbol + (info, abfd, name, flags, sec, value, NULL, FALSE, collect, + (struct bfd_link_hash_entry **) sym_hash))) + goto error_free_vers; + + h = *sym_hash; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + *sym_hash = h; + + new_weakdef = FALSE; + if (dynamic + && definition + && (flags & BSF_WEAK) != 0 + && ELF_ST_TYPE (isym->st_info) != STT_FUNC + && is_elf_hash_table (hash_table) + && h->weakdef == NULL) + { + /* Keep a list of all weak defined non function symbols from + a dynamic object, using the weakdef field. Later in this + function we will set the weakdef field to the correct + value. We only put non-function symbols from dynamic + objects on this list, because that happens to be the only + time we need to know the normal symbol corresponding to a + weak symbol, and the information is time consuming to + figure out. If the weakdef field is not already NULL, + then this symbol was already defined by some previous + dynamic object, and we will be using that previous + definition anyhow. */ + + h->weakdef = weaks; + weaks = h; + new_weakdef = TRUE; + } + + /* Set the alignment of a common symbol. */ + if (isym->st_shndx == SHN_COMMON + && h->root.type == bfd_link_hash_common) + { + unsigned int align; + + align = bfd_log2 (isym->st_value); + if (align > old_alignment + /* Permit an alignment power of zero if an alignment of one + is specified and no other alignments have been specified. */ + || (isym->st_value == 1 && old_alignment == 0)) + h->root.u.c.p->alignment_power = align; + else + h->root.u.c.p->alignment_power = old_alignment; + } + + if (is_elf_hash_table (hash_table)) + { + int old_flags; + bfd_boolean dynsym; + int new_flag; + + /* Check the alignment when a common symbol is involved. This + can change when a common symbol is overridden by a normal + definition or a common symbol is ignored due to the old + normal definition. We need to make sure the maximum + alignment is maintained. */ + if ((old_alignment || isym->st_shndx == SHN_COMMON) + && h->root.type != bfd_link_hash_common) + { + unsigned int common_align; + unsigned int normal_align; + unsigned int symbol_align; + bfd *normal_bfd; + bfd *common_bfd; + + symbol_align = ffs (h->root.u.def.value) - 1; + if (h->root.u.def.section->owner != NULL + && (h->root.u.def.section->owner->flags & DYNAMIC) == 0) + { + normal_align = h->root.u.def.section->alignment_power; + if (normal_align > symbol_align) + normal_align = symbol_align; + } + else + normal_align = symbol_align; + + if (old_alignment) + { + common_align = old_alignment; + common_bfd = old_bfd; + normal_bfd = abfd; + } + else + { + common_align = bfd_log2 (isym->st_value); + common_bfd = abfd; + normal_bfd = old_bfd; + } + + if (normal_align < common_align) + (*_bfd_error_handler) + (_("Warning: alignment %u of symbol `%s' in %s is smaller than %u in %s"), + 1 << normal_align, + name, + bfd_archive_filename (normal_bfd), + 1 << common_align, + bfd_archive_filename (common_bfd)); + } + + /* Remember the symbol size and type. */ + if (isym->st_size != 0 + && (definition || h->size == 0)) + { + if (h->size != 0 && h->size != isym->st_size && ! size_change_ok) + (*_bfd_error_handler) + (_("Warning: size of symbol `%s' changed from %lu in %s to %lu in %s"), + name, (unsigned long) h->size, + bfd_archive_filename (old_bfd), + (unsigned long) isym->st_size, + bfd_archive_filename (abfd)); + + h->size = isym->st_size; + } + + /* If this is a common symbol, then we always want H->SIZE + to be the size of the common symbol. The code just above + won't fix the size if a common symbol becomes larger. We + don't warn about a size change here, because that is + covered by --warn-common. */ + if (h->root.type == bfd_link_hash_common) + h->size = h->root.u.c.size; + + if (ELF_ST_TYPE (isym->st_info) != STT_NOTYPE + && (definition || h->type == STT_NOTYPE)) + { + if (h->type != STT_NOTYPE + && h->type != ELF_ST_TYPE (isym->st_info) + && ! type_change_ok) + (*_bfd_error_handler) + (_("Warning: type of symbol `%s' changed from %d to %d in %s"), + name, h->type, ELF_ST_TYPE (isym->st_info), + bfd_archive_filename (abfd)); + + h->type = ELF_ST_TYPE (isym->st_info); + } + + /* If st_other has a processor-specific meaning, specific + code might be needed here. We never merge the visibility + attribute with the one from a dynamic object. */ + if (bed->elf_backend_merge_symbol_attribute) + (*bed->elf_backend_merge_symbol_attribute) (h, isym, definition, + dynamic); + + if (isym->st_other != 0 && !dynamic) + { + unsigned char hvis, symvis, other, nvis; + + /* Take the balance of OTHER from the definition. */ + other = (definition ? isym->st_other : h->other); + other &= ~ ELF_ST_VISIBILITY (-1); + + /* Combine visibilities, using the most constraining one. */ + hvis = ELF_ST_VISIBILITY (h->other); + symvis = ELF_ST_VISIBILITY (isym->st_other); + if (! hvis) + nvis = symvis; + else if (! symvis) + nvis = hvis; + else + nvis = hvis < symvis ? hvis : symvis; + + h->other = other | nvis; + } + + /* Set a flag in the hash table entry indicating the type of + reference or definition we just found. Keep a count of + the number of dynamic symbols we find. A dynamic symbol + is one which is referenced or defined by both a regular + object and a shared object. */ + old_flags = h->elf_link_hash_flags; + dynsym = FALSE; + if (! dynamic) + { + if (! definition) + { + new_flag = ELF_LINK_HASH_REF_REGULAR; + if (bind != STB_WEAK) + new_flag |= ELF_LINK_HASH_REF_REGULAR_NONWEAK; + } + else + new_flag = ELF_LINK_HASH_DEF_REGULAR; + if (! info->executable + || (old_flags & (ELF_LINK_HASH_DEF_DYNAMIC + | ELF_LINK_HASH_REF_DYNAMIC)) != 0) + dynsym = TRUE; + } + else + { + if (! definition) + new_flag = ELF_LINK_HASH_REF_DYNAMIC; + else + new_flag = ELF_LINK_HASH_DEF_DYNAMIC; + if ((old_flags & (ELF_LINK_HASH_DEF_REGULAR + | ELF_LINK_HASH_REF_REGULAR)) != 0 + || (h->weakdef != NULL + && ! new_weakdef + && h->weakdef->dynindx != -1)) + dynsym = TRUE; + } + + h->elf_link_hash_flags |= new_flag; + + /* Check to see if we need to add an indirect symbol for + the default name. */ + if (definition || h->root.type == bfd_link_hash_common) + if (!_bfd_elf_add_default_symbol (abfd, info, h, name, isym, + &sec, &value, &dynsym, + override)) + goto error_free_vers; + + if (definition && !dynamic) + { + char *p = strchr (name, ELF_VER_CHR); + if (p != NULL && p[1] != ELF_VER_CHR) + { + /* Queue non-default versions so that .symver x, x@FOO + aliases can be checked. */ + if (! nondeflt_vers) + { + amt = (isymend - isym + 1) + * sizeof (struct elf_link_hash_entry *); + nondeflt_vers = bfd_malloc (amt); + } + nondeflt_vers [nondeflt_vers_cnt++] = h; + } + } + + if (dynsym && h->dynindx == -1) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + goto error_free_vers; + if (h->weakdef != NULL + && ! new_weakdef + && h->weakdef->dynindx == -1) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h->weakdef)) + goto error_free_vers; + } + } + else if (dynsym && h->dynindx != -1) + /* If the symbol already has a dynamic index, but + visibility says it should not be visible, turn it into + a local symbol. */ + switch (ELF_ST_VISIBILITY (h->other)) + { + case STV_INTERNAL: + case STV_HIDDEN: + (*bed->elf_backend_hide_symbol) (info, h, TRUE); + dynsym = FALSE; + break; + } + + if (!add_needed + && definition + && dynsym + && (h->elf_link_hash_flags + & ELF_LINK_HASH_REF_REGULAR) != 0) + { + int ret; + const char *soname = elf_dt_name (abfd); + + /* A symbol from a library loaded via DT_NEEDED of some + other library is referenced by a regular object. + Add a DT_NEEDED entry for it. */ + add_needed = TRUE; + ret = elf_add_dt_needed_tag (info, soname, add_needed); + if (ret < 0) + goto error_free_vers; + + BFD_ASSERT (ret == 0); + } + } + } + + /* Now that all the symbols from this input file are created, handle + .symver foo, foo@BAR such that any relocs against foo become foo@BAR. */ + if (nondeflt_vers != NULL) + { + bfd_size_type cnt, symidx; + + for (cnt = 0; cnt < nondeflt_vers_cnt; ++cnt) + { + struct elf_link_hash_entry *h = nondeflt_vers[cnt], *hi; + char *shortname, *p; + + p = strchr (h->root.root.string, ELF_VER_CHR); + if (p == NULL + || (h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak)) + continue; + + amt = p - h->root.root.string; + shortname = bfd_malloc (amt + 1); + memcpy (shortname, h->root.root.string, amt); + shortname[amt] = '\0'; + + hi = (struct elf_link_hash_entry *) + bfd_link_hash_lookup (&hash_table->root, shortname, + FALSE, FALSE, FALSE); + if (hi != NULL + && hi->root.type == h->root.type + && hi->root.u.def.value == h->root.u.def.value + && hi->root.u.def.section == h->root.u.def.section) + { + (*bed->elf_backend_hide_symbol) (info, hi, TRUE); + hi->root.type = bfd_link_hash_indirect; + hi->root.u.i.link = (struct bfd_link_hash_entry *) h; + (*bed->elf_backend_copy_indirect_symbol) (bed, h, hi); + sym_hash = elf_sym_hashes (abfd); + if (sym_hash) + for (symidx = 0; symidx < extsymcount; ++symidx) + if (sym_hash[symidx] == hi) + { + sym_hash[symidx] = h; + break; + } + } + free (shortname); + } + free (nondeflt_vers); + nondeflt_vers = NULL; + } + + if (extversym != NULL) + { + free (extversym); + extversym = NULL; + } + + if (isymbuf != NULL) + free (isymbuf); + isymbuf = NULL; + + /* Now set the weakdefs field correctly for all the weak defined + symbols we found. The only way to do this is to search all the + symbols. Since we only need the information for non functions in + dynamic objects, that's the only time we actually put anything on + the list WEAKS. We need this information so that if a regular + object refers to a symbol defined weakly in a dynamic object, the + real symbol in the dynamic object is also put in the dynamic + symbols; we also must arrange for both symbols to point to the + same memory location. We could handle the general case of symbol + aliasing, but a general symbol alias can only be generated in + assembler code, handling it correctly would be very time + consuming, and other ELF linkers don't handle general aliasing + either. */ + if (weaks != NULL) + { + struct elf_link_hash_entry **hpp; + struct elf_link_hash_entry **hppend; + struct elf_link_hash_entry **sorted_sym_hash; + struct elf_link_hash_entry *h; + size_t sym_count; + + /* Since we have to search the whole symbol list for each weak + defined symbol, search time for N weak defined symbols will be + O(N^2). Binary search will cut it down to O(NlogN). */ + amt = extsymcount * sizeof (struct elf_link_hash_entry *); + sorted_sym_hash = bfd_malloc (amt); + if (sorted_sym_hash == NULL) + goto error_return; + sym_hash = sorted_sym_hash; + hpp = elf_sym_hashes (abfd); + hppend = hpp + extsymcount; + sym_count = 0; + for (; hpp < hppend; hpp++) + { + h = *hpp; + if (h != NULL + && h->root.type == bfd_link_hash_defined + && h->type != STT_FUNC) + { + *sym_hash = h; + sym_hash++; + sym_count++; + } + } + + qsort (sorted_sym_hash, sym_count, + sizeof (struct elf_link_hash_entry *), + elf_sort_symbol); + + while (weaks != NULL) + { + struct elf_link_hash_entry *hlook; + asection *slook; + bfd_vma vlook; + long ilook; + size_t i, j, idx; + + hlook = weaks; + weaks = hlook->weakdef; + hlook->weakdef = NULL; + + BFD_ASSERT (hlook->root.type == bfd_link_hash_defined + || hlook->root.type == bfd_link_hash_defweak + || hlook->root.type == bfd_link_hash_common + || hlook->root.type == bfd_link_hash_indirect); + slook = hlook->root.u.def.section; + vlook = hlook->root.u.def.value; + + ilook = -1; + i = 0; + j = sym_count; + while (i < j) + { + bfd_signed_vma vdiff; + idx = (i + j) / 2; + h = sorted_sym_hash [idx]; + vdiff = vlook - h->root.u.def.value; + if (vdiff < 0) + j = idx; + else if (vdiff > 0) + i = idx + 1; + else + { + long sdiff = slook - h->root.u.def.section; + if (sdiff < 0) + j = idx; + else if (sdiff > 0) + i = idx + 1; + else + { + ilook = idx; + break; + } + } + } + + /* We didn't find a value/section match. */ + if (ilook == -1) + continue; + + for (i = ilook; i < sym_count; i++) + { + h = sorted_sym_hash [i]; + + /* Stop if value or section doesn't match. */ + if (h->root.u.def.value != vlook + || h->root.u.def.section != slook) + break; + else if (h != hlook) + { + hlook->weakdef = h; + + /* If the weak definition is in the list of dynamic + symbols, make sure the real definition is put + there as well. */ + if (hlook->dynindx != -1 && h->dynindx == -1) + { + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + goto error_return; + } + + /* If the real definition is in the list of dynamic + symbols, make sure the weak definition is put + there as well. If we don't do this, then the + dynamic loader might not merge the entries for the + real definition and the weak definition. */ + if (h->dynindx != -1 && hlook->dynindx == -1) + { + if (! bfd_elf_link_record_dynamic_symbol (info, hlook)) + goto error_return; + } + break; + } + } + } + + free (sorted_sym_hash); + } + + /* If this object is the same format as the output object, and it is + not a shared library, then let the backend look through the + relocs. + + This is required to build global offset table entries and to + arrange for dynamic relocs. It is not required for the + particular common case of linking non PIC code, even when linking + against shared libraries, but unfortunately there is no way of + knowing whether an object file has been compiled PIC or not. + Looking through the relocs is not particularly time consuming. + The problem is that we must either (1) keep the relocs in memory, + which causes the linker to require additional runtime memory or + (2) read the relocs twice from the input file, which wastes time. + This would be a good case for using mmap. + + I have no idea how to handle linking PIC code into a file of a + different format. It probably can't be done. */ + check_relocs = get_elf_backend_data (abfd)->check_relocs; + if (! dynamic + && is_elf_hash_table (hash_table) + && hash_table->root.creator == abfd->xvec + && check_relocs != NULL) + { + asection *o; + + for (o = abfd->sections; o != NULL; o = o->next) + { + Elf_Internal_Rela *internal_relocs; + bfd_boolean ok; + + if ((o->flags & SEC_RELOC) == 0 + || o->reloc_count == 0 + || ((info->strip == strip_all || info->strip == strip_debugger) + && (o->flags & SEC_DEBUGGING) != 0) + || bfd_is_abs_section (o->output_section)) + continue; + + internal_relocs = _bfd_elf_link_read_relocs (abfd, o, NULL, NULL, + info->keep_memory); + if (internal_relocs == NULL) + goto error_return; + + ok = (*check_relocs) (abfd, info, o, internal_relocs); + + if (elf_section_data (o)->relocs != internal_relocs) + free (internal_relocs); + + if (! ok) + goto error_return; + } + } + + /* If this is a non-traditional link, try to optimize the handling + of the .stab/.stabstr sections. */ + if (! dynamic + && ! info->traditional_format + && is_elf_hash_table (hash_table) + && (info->strip != strip_all && info->strip != strip_debugger)) + { + asection *stabstr; + + stabstr = bfd_get_section_by_name (abfd, ".stabstr"); + if (stabstr != NULL) + { + bfd_size_type string_offset = 0; + asection *stab; + + for (stab = abfd->sections; stab; stab = stab->next) + if (strncmp (".stab", stab->name, 5) == 0 + && (!stab->name[5] || + (stab->name[5] == '.' && ISDIGIT (stab->name[6]))) + && (stab->flags & SEC_MERGE) == 0 + && !bfd_is_abs_section (stab->output_section)) + { + struct bfd_elf_section_data *secdata; + + secdata = elf_section_data (stab); + if (! _bfd_link_section_stabs (abfd, + & hash_table->stab_info, + stab, stabstr, + &secdata->sec_info, + &string_offset)) + goto error_return; + if (secdata->sec_info) + stab->sec_info_type = ELF_INFO_TYPE_STABS; + } + } + } + + if (! info->relocatable + && ! dynamic + && is_elf_hash_table (hash_table)) + { + asection *s; + + for (s = abfd->sections; s != NULL; s = s->next) + if ((s->flags & SEC_MERGE) != 0 + && !bfd_is_abs_section (s->output_section)) + { + struct bfd_elf_section_data *secdata; + + secdata = elf_section_data (s); + if (! _bfd_merge_section (abfd, + & hash_table->merge_info, + s, &secdata->sec_info)) + goto error_return; + else if (secdata->sec_info) + s->sec_info_type = ELF_INFO_TYPE_MERGE; + } + } + + if (is_elf_hash_table (hash_table)) + { + /* Add this bfd to the loaded list. */ + struct elf_link_loaded_list *n; + + n = bfd_alloc (abfd, sizeof (struct elf_link_loaded_list)); + if (n == NULL) + goto error_return; + n->abfd = abfd; + n->next = hash_table->loaded; + hash_table->loaded = n; + } + + return TRUE; + + error_free_vers: + if (nondeflt_vers != NULL) + free (nondeflt_vers); + if (extversym != NULL) + free (extversym); + error_free_sym: + if (isymbuf != NULL) + free (isymbuf); + error_return: + return FALSE; +} + +/* Add symbols from an ELF archive file to the linker hash table. We + don't use _bfd_generic_link_add_archive_symbols because of a + problem which arises on UnixWare. The UnixWare libc.so is an + archive which includes an entry libc.so.1 which defines a bunch of + symbols. The libc.so archive also includes a number of other + object files, which also define symbols, some of which are the same + as those defined in libc.so.1. Correct linking requires that we + consider each object file in turn, and include it if it defines any + symbols we need. _bfd_generic_link_add_archive_symbols does not do + this; it looks through the list of undefined symbols, and includes + any object file which defines them. When this algorithm is used on + UnixWare, it winds up pulling in libc.so.1 early and defining a + bunch of symbols. This means that some of the other objects in the + archive are not included in the link, which is incorrect since they + precede libc.so.1 in the archive. + + Fortunately, ELF archive handling is simpler than that done by + _bfd_generic_link_add_archive_symbols, which has to allow for a.out + oddities. In ELF, if we find a symbol in the archive map, and the + symbol is currently undefined, we know that we must pull in that + object file. + + Unfortunately, we do have to make multiple passes over the symbol + table until nothing further is resolved. */ + +static bfd_boolean +elf_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info) +{ + symindex c; + bfd_boolean *defined = NULL; + bfd_boolean *included = NULL; + carsym *symdefs; + bfd_boolean loop; + bfd_size_type amt; + + if (! bfd_has_map (abfd)) + { + /* An empty archive is a special case. */ + if (bfd_openr_next_archived_file (abfd, NULL) == NULL) + return TRUE; + bfd_set_error (bfd_error_no_armap); + return FALSE; + } + + /* Keep track of all symbols we know to be already defined, and all + files we know to be already included. This is to speed up the + second and subsequent passes. */ + c = bfd_ardata (abfd)->symdef_count; + if (c == 0) + return TRUE; + amt = c; + amt *= sizeof (bfd_boolean); + defined = bfd_zmalloc (amt); + included = bfd_zmalloc (amt); + if (defined == NULL || included == NULL) + goto error_return; + + symdefs = bfd_ardata (abfd)->symdefs; + + do + { + file_ptr last; + symindex i; + carsym *symdef; + carsym *symdefend; + + loop = FALSE; + last = -1; + + symdef = symdefs; + symdefend = symdef + c; + for (i = 0; symdef < symdefend; symdef++, i++) + { + struct elf_link_hash_entry *h; + bfd *element; + struct bfd_link_hash_entry *undefs_tail; + symindex mark; + + if (defined[i] || included[i]) + continue; + if (symdef->file_offset == last) + { + included[i] = TRUE; + continue; + } + + h = elf_link_hash_lookup (elf_hash_table (info), symdef->name, + FALSE, FALSE, FALSE); + + if (h == NULL) + { + char *p, *copy; + size_t len, first; + + /* If this is a default version (the name contains @@), + look up the symbol again with only one `@' as well + as without the version. The effect is that references + to the symbol with and without the version will be + matched by the default symbol in the archive. */ + + p = strchr (symdef->name, ELF_VER_CHR); + if (p == NULL || p[1] != ELF_VER_CHR) + continue; + + /* First check with only one `@'. */ + len = strlen (symdef->name); + copy = bfd_alloc (abfd, len); + if (copy == NULL) + goto error_return; + first = p - symdef->name + 1; + memcpy (copy, symdef->name, first); + memcpy (copy + first, symdef->name + first + 1, len - first); + + h = elf_link_hash_lookup (elf_hash_table (info), copy, + FALSE, FALSE, FALSE); + + if (h == NULL) + { + /* We also need to check references to the symbol + without the version. */ + + copy[first - 1] = '\0'; + h = elf_link_hash_lookup (elf_hash_table (info), + copy, FALSE, FALSE, FALSE); + } + + bfd_release (abfd, copy); + } + + if (h == NULL) + continue; + + if (h->root.type == bfd_link_hash_common) + { + /* We currently have a common symbol. The archive map contains + a reference to this symbol, so we may want to include it. We + only want to include it however, if this archive element + contains a definition of the symbol, not just another common + declaration of it. + + Unfortunately some archivers (including GNU ar) will put + declarations of common symbols into their archive maps, as + well as real definitions, so we cannot just go by the archive + map alone. Instead we must read in the element's symbol + table and check that to see what kind of symbol definition + this is. */ + if (! elf_link_is_defined_archive_symbol (abfd, symdef)) + continue; + } + else if (h->root.type != bfd_link_hash_undefined) + { + if (h->root.type != bfd_link_hash_undefweak) + defined[i] = TRUE; + continue; + } + + /* We need to include this archive member. */ + element = _bfd_get_elt_at_filepos (abfd, symdef->file_offset); + if (element == NULL) + goto error_return; + + if (! bfd_check_format (element, bfd_object)) + goto error_return; + + /* Doublecheck that we have not included this object + already--it should be impossible, but there may be + something wrong with the archive. */ + if (element->archive_pass != 0) + { + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + element->archive_pass = 1; + + undefs_tail = info->hash->undefs_tail; + + if (! (*info->callbacks->add_archive_element) (info, element, + symdef->name)) + goto error_return; + if (! bfd_link_add_symbols (element, info)) + goto error_return; + + /* If there are any new undefined symbols, we need to make + another pass through the archive in order to see whether + they can be defined. FIXME: This isn't perfect, because + common symbols wind up on undefs_tail and because an + undefined symbol which is defined later on in this pass + does not require another pass. This isn't a bug, but it + does make the code less efficient than it could be. */ + if (undefs_tail != info->hash->undefs_tail) + loop = TRUE; + + /* Look backward to mark all symbols from this object file + which we have already seen in this pass. */ + mark = i; + do + { + included[mark] = TRUE; + if (mark == 0) + break; + --mark; + } + while (symdefs[mark].file_offset == symdef->file_offset); + + /* We mark subsequent symbols from this object file as we go + on through the loop. */ + last = symdef->file_offset; + } + } + while (loop); + + free (defined); + free (included); + + return TRUE; + + error_return: + if (defined != NULL) + free (defined); + if (included != NULL) + free (included); + return FALSE; +} + +/* Given an ELF BFD, add symbols to the global hash table as + appropriate. */ + +bfd_boolean +bfd_elf_link_add_symbols (bfd *abfd, struct bfd_link_info *info) +{ + switch (bfd_get_format (abfd)) + { + case bfd_object: + return elf_link_add_object_symbols (abfd, info); + case bfd_archive: + return elf_link_add_archive_symbols (abfd, info); + default: + bfd_set_error (bfd_error_wrong_format); + return FALSE; + } +} + +/* This function will be called though elf_link_hash_traverse to store + all hash value of the exported symbols in an array. */ + +static bfd_boolean +elf_collect_hash_codes (struct elf_link_hash_entry *h, void *data) +{ + unsigned long **valuep = data; + const char *name; + char *p; + unsigned long ha; + char *alc = NULL; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* Ignore indirect symbols. These are added by the versioning code. */ + if (h->dynindx == -1) + return TRUE; + + name = h->root.root.string; + p = strchr (name, ELF_VER_CHR); + if (p != NULL) + { + alc = bfd_malloc (p - name + 1); + memcpy (alc, name, p - name); + alc[p - name] = '\0'; + name = alc; + } + + /* Compute the hash value. */ + ha = bfd_elf_hash (name); + + /* Store the found hash value in the array given as the argument. */ + *(*valuep)++ = ha; + + /* And store it in the struct so that we can put it in the hash table + later. */ + h->elf_hash_value = ha; + + if (alc != NULL) + free (alc); + + return TRUE; +} + +/* Array used to determine the number of hash table buckets to use + based on the number of symbols there are. If there are fewer than + 3 symbols we use 1 bucket, fewer than 17 symbols we use 3 buckets, + fewer than 37 we use 17 buckets, and so forth. We never use more + than 32771 buckets. */ + +static const size_t elf_buckets[] = +{ + 1, 3, 17, 37, 67, 97, 131, 197, 263, 521, 1031, 2053, 4099, 8209, + 16411, 32771, 0 +}; + +/* Compute bucket count for hashing table. We do not use a static set + of possible tables sizes anymore. Instead we determine for all + possible reasonable sizes of the table the outcome (i.e., the + number of collisions etc) and choose the best solution. The + weighting functions are not too simple to allow the table to grow + without bounds. Instead one of the weighting factors is the size. + Therefore the result is always a good payoff between few collisions + (= short chain lengths) and table size. */ +static size_t +compute_bucket_count (struct bfd_link_info *info) +{ + size_t dynsymcount = elf_hash_table (info)->dynsymcount; + size_t best_size = 0; + unsigned long int *hashcodes; + unsigned long int *hashcodesp; + unsigned long int i; + bfd_size_type amt; + + /* Compute the hash values for all exported symbols. At the same + time store the values in an array so that we could use them for + optimizations. */ + amt = dynsymcount; + amt *= sizeof (unsigned long int); + hashcodes = bfd_malloc (amt); + if (hashcodes == NULL) + return 0; + hashcodesp = hashcodes; + + /* Put all hash values in HASHCODES. */ + elf_link_hash_traverse (elf_hash_table (info), + elf_collect_hash_codes, &hashcodesp); + + /* We have a problem here. The following code to optimize the table + size requires an integer type with more the 32 bits. If + BFD_HOST_U_64_BIT is set we know about such a type. */ +#ifdef BFD_HOST_U_64_BIT + if (info->optimize) + { + unsigned long int nsyms = hashcodesp - hashcodes; + size_t minsize; + size_t maxsize; + BFD_HOST_U_64_BIT best_chlen = ~((BFD_HOST_U_64_BIT) 0); + unsigned long int *counts ; + bfd *dynobj = elf_hash_table (info)->dynobj; + const struct elf_backend_data *bed = get_elf_backend_data (dynobj); + + /* Possible optimization parameters: if we have NSYMS symbols we say + that the hashing table must at least have NSYMS/4 and at most + 2*NSYMS buckets. */ + minsize = nsyms / 4; + if (minsize == 0) + minsize = 1; + best_size = maxsize = nsyms * 2; + + /* Create array where we count the collisions in. We must use bfd_malloc + since the size could be large. */ + amt = maxsize; + amt *= sizeof (unsigned long int); + counts = bfd_malloc (amt); + if (counts == NULL) + { + free (hashcodes); + return 0; + } + + /* Compute the "optimal" size for the hash table. The criteria is a + minimal chain length. The minor criteria is (of course) the size + of the table. */ + for (i = minsize; i < maxsize; ++i) + { + /* Walk through the array of hashcodes and count the collisions. */ + BFD_HOST_U_64_BIT max; + unsigned long int j; + unsigned long int fact; + + memset (counts, '\0', i * sizeof (unsigned long int)); + + /* Determine how often each hash bucket is used. */ + for (j = 0; j < nsyms; ++j) + ++counts[hashcodes[j] % i]; + + /* For the weight function we need some information about the + pagesize on the target. This is information need not be 100% + accurate. Since this information is not available (so far) we + define it here to a reasonable default value. If it is crucial + to have a better value some day simply define this value. */ +# ifndef BFD_TARGET_PAGESIZE +# define BFD_TARGET_PAGESIZE (4096) +# endif + + /* We in any case need 2 + NSYMS entries for the size values and + the chains. */ + max = (2 + nsyms) * (bed->s->arch_size / 8); + +# if 1 + /* Variant 1: optimize for short chains. We add the squares + of all the chain lengths (which favors many small chain + over a few long chains). */ + for (j = 0; j < i; ++j) + max += counts[j] * counts[j]; + + /* This adds penalties for the overall size of the table. */ + fact = i / (BFD_TARGET_PAGESIZE / (bed->s->arch_size / 8)) + 1; + max *= fact * fact; +# else + /* Variant 2: Optimize a lot more for small table. Here we + also add squares of the size but we also add penalties for + empty slots (the +1 term). */ + for (j = 0; j < i; ++j) + max += (1 + counts[j]) * (1 + counts[j]); + + /* The overall size of the table is considered, but not as + strong as in variant 1, where it is squared. */ + fact = i / (BFD_TARGET_PAGESIZE / (bed->s->arch_size / 8)) + 1; + max *= fact; +# endif + + /* Compare with current best results. */ + if (max < best_chlen) + { + best_chlen = max; + best_size = i; + } + } + + free (counts); + } + else +#endif /* defined (BFD_HOST_U_64_BIT) */ + { + /* This is the fallback solution if no 64bit type is available or if we + are not supposed to spend much time on optimizations. We select the + bucket count using a fixed set of numbers. */ + for (i = 0; elf_buckets[i] != 0; i++) + { + best_size = elf_buckets[i]; + if (dynsymcount < elf_buckets[i + 1]) + break; + } + } + + /* Free the arrays we needed. */ + free (hashcodes); + + return best_size; +} + +/* Set up the sizes and contents of the ELF dynamic sections. This is + called by the ELF linker emulation before_allocation routine. We + must set the sizes of the sections before the linker sets the + addresses of the various sections. */ + +bfd_boolean +bfd_elf_size_dynamic_sections (bfd *output_bfd, + const char *soname, + const char *rpath, + const char *filter_shlib, + const char * const *auxiliary_filters, + struct bfd_link_info *info, + asection **sinterpptr, + struct bfd_elf_version_tree *verdefs) +{ + bfd_size_type soname_indx; + bfd *dynobj; + const struct elf_backend_data *bed; + struct elf_assign_sym_version_info asvinfo; + + *sinterpptr = NULL; + + soname_indx = (bfd_size_type) -1; + + if (!is_elf_hash_table (info->hash)) + return TRUE; + + if (info->execstack) + elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | PF_X; + else if (info->noexecstack) + elf_tdata (output_bfd)->stack_flags = PF_R | PF_W; + else + { + bfd *inputobj; + asection *notesec = NULL; + int exec = 0; + + for (inputobj = info->input_bfds; + inputobj; + inputobj = inputobj->link_next) + { + asection *s; + + if (inputobj->flags & DYNAMIC) + continue; + s = bfd_get_section_by_name (inputobj, ".note.GNU-stack"); + if (s) + { + if (s->flags & SEC_CODE) + exec = PF_X; + notesec = s; + } + else + exec = PF_X; + } + if (notesec) + { + elf_tdata (output_bfd)->stack_flags = PF_R | PF_W | exec; + if (exec && info->relocatable + && notesec->output_section != bfd_abs_section_ptr) + notesec->output_section->flags |= SEC_CODE; + } + } + + /* Any syms created from now on start with -1 in + got.refcount/offset and plt.refcount/offset. */ + elf_hash_table (info)->init_refcount = elf_hash_table (info)->init_offset; + + /* The backend may have to create some sections regardless of whether + we're dynamic or not. */ + bed = get_elf_backend_data (output_bfd); + if (bed->elf_backend_always_size_sections + && ! (*bed->elf_backend_always_size_sections) (output_bfd, info)) + return FALSE; + + dynobj = elf_hash_table (info)->dynobj; + + /* If there were no dynamic objects in the link, there is nothing to + do here. */ + if (dynobj == NULL) + return TRUE; + + if (! _bfd_elf_maybe_strip_eh_frame_hdr (info)) + return FALSE; + + if (elf_hash_table (info)->dynamic_sections_created) + { + struct elf_info_failed eif; + struct elf_link_hash_entry *h; + asection *dynstr; + struct bfd_elf_version_tree *t; + struct bfd_elf_version_expr *d; + bfd_boolean all_defined; + + *sinterpptr = bfd_get_section_by_name (dynobj, ".interp"); + BFD_ASSERT (*sinterpptr != NULL || !info->executable); + + if (soname != NULL) + { + soname_indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, + soname, TRUE); + if (soname_indx == (bfd_size_type) -1 + || !_bfd_elf_add_dynamic_entry (info, DT_SONAME, soname_indx)) + return FALSE; + } + + if (info->symbolic) + { + if (!_bfd_elf_add_dynamic_entry (info, DT_SYMBOLIC, 0)) + return FALSE; + info->flags |= DF_SYMBOLIC; + } + + if (rpath != NULL) + { + bfd_size_type indx; + + indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, rpath, + TRUE); + if (indx == (bfd_size_type) -1 + || !_bfd_elf_add_dynamic_entry (info, DT_RPATH, indx)) + return FALSE; + + if (info->new_dtags) + { + _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr, indx); + if (!_bfd_elf_add_dynamic_entry (info, DT_RUNPATH, indx)) + return FALSE; + } + } + + if (filter_shlib != NULL) + { + bfd_size_type indx; + + indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, + filter_shlib, TRUE); + if (indx == (bfd_size_type) -1 + || !_bfd_elf_add_dynamic_entry (info, DT_FILTER, indx)) + return FALSE; + } + + if (auxiliary_filters != NULL) + { + const char * const *p; + + for (p = auxiliary_filters; *p != NULL; p++) + { + bfd_size_type indx; + + indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, + *p, TRUE); + if (indx == (bfd_size_type) -1 + || !_bfd_elf_add_dynamic_entry (info, DT_AUXILIARY, indx)) + return FALSE; + } + } + + eif.info = info; + eif.verdefs = verdefs; + eif.failed = FALSE; + + /* If we are supposed to export all symbols into the dynamic symbol + table (this is not the normal case), then do so. */ + if (info->export_dynamic) + { + elf_link_hash_traverse (elf_hash_table (info), + _bfd_elf_export_symbol, + &eif); + if (eif.failed) + return FALSE; + } + + /* Make all global versions with definition. */ + for (t = verdefs; t != NULL; t = t->next) + for (d = t->globals.list; d != NULL; d = d->next) + if (!d->symver && d->symbol) + { + const char *verstr, *name; + size_t namelen, verlen, newlen; + char *newname, *p; + struct elf_link_hash_entry *newh; + + name = d->symbol; + namelen = strlen (name); + verstr = t->name; + verlen = strlen (verstr); + newlen = namelen + verlen + 3; + + newname = bfd_malloc (newlen); + if (newname == NULL) + return FALSE; + memcpy (newname, name, namelen); + + /* Check the hidden versioned definition. */ + p = newname + namelen; + *p++ = ELF_VER_CHR; + memcpy (p, verstr, verlen + 1); + newh = elf_link_hash_lookup (elf_hash_table (info), + newname, FALSE, FALSE, + FALSE); + if (newh == NULL + || (newh->root.type != bfd_link_hash_defined + && newh->root.type != bfd_link_hash_defweak)) + { + /* Check the default versioned definition. */ + *p++ = ELF_VER_CHR; + memcpy (p, verstr, verlen + 1); + newh = elf_link_hash_lookup (elf_hash_table (info), + newname, FALSE, FALSE, + FALSE); + } + free (newname); + + /* Mark this version if there is a definition and it is + not defined in a shared object. */ + if (newh != NULL + && ((newh->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) == 0) + && (newh->root.type == bfd_link_hash_defined + || newh->root.type == bfd_link_hash_defweak)) + d->symver = 1; + } + + /* Attach all the symbols to their version information. */ + asvinfo.output_bfd = output_bfd; + asvinfo.info = info; + asvinfo.verdefs = verdefs; + asvinfo.failed = FALSE; + + elf_link_hash_traverse (elf_hash_table (info), + _bfd_elf_link_assign_sym_version, + &asvinfo); + if (asvinfo.failed) + return FALSE; + + if (!info->allow_undefined_version) + { + /* Check if all global versions have a definition. */ + all_defined = TRUE; + for (t = verdefs; t != NULL; t = t->next) + for (d = t->globals.list; d != NULL; d = d->next) + if (!d->symver && !d->script) + { + (*_bfd_error_handler) + (_("%s: undefined version: %s"), + d->pattern, t->name); + all_defined = FALSE; + } + + if (!all_defined) + { + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + } + + /* Find all symbols which were defined in a dynamic object and make + the backend pick a reasonable value for them. */ + elf_link_hash_traverse (elf_hash_table (info), + _bfd_elf_adjust_dynamic_symbol, + &eif); + if (eif.failed) + return FALSE; + + /* Add some entries to the .dynamic section. We fill in some of the + values later, in elf_bfd_final_link, but we must add the entries + now so that we know the final size of the .dynamic section. */ + + /* If there are initialization and/or finalization functions to + call then add the corresponding DT_INIT/DT_FINI entries. */ + h = (info->init_function + ? elf_link_hash_lookup (elf_hash_table (info), + info->init_function, FALSE, + FALSE, FALSE) + : NULL); + if (h != NULL + && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_DEF_REGULAR)) != 0) + { + if (!_bfd_elf_add_dynamic_entry (info, DT_INIT, 0)) + return FALSE; + } + h = (info->fini_function + ? elf_link_hash_lookup (elf_hash_table (info), + info->fini_function, FALSE, + FALSE, FALSE) + : NULL); + if (h != NULL + && (h->elf_link_hash_flags & (ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_DEF_REGULAR)) != 0) + { + if (!_bfd_elf_add_dynamic_entry (info, DT_FINI, 0)) + return FALSE; + } + + if (bfd_get_section_by_name (output_bfd, ".preinit_array") != NULL) + { + /* DT_PREINIT_ARRAY is not allowed in shared library. */ + if (! info->executable) + { + bfd *sub; + asection *o; + + for (sub = info->input_bfds; sub != NULL; + sub = sub->link_next) + for (o = sub->sections; o != NULL; o = o->next) + if (elf_section_data (o)->this_hdr.sh_type + == SHT_PREINIT_ARRAY) + { + (*_bfd_error_handler) + (_("%s: .preinit_array section is not allowed in DSO"), + bfd_archive_filename (sub)); + break; + } + + bfd_set_error (bfd_error_nonrepresentable_section); + return FALSE; + } + + if (!_bfd_elf_add_dynamic_entry (info, DT_PREINIT_ARRAY, 0) + || !_bfd_elf_add_dynamic_entry (info, DT_PREINIT_ARRAYSZ, 0)) + return FALSE; + } + if (bfd_get_section_by_name (output_bfd, ".init_array") != NULL) + { + if (!_bfd_elf_add_dynamic_entry (info, DT_INIT_ARRAY, 0) + || !_bfd_elf_add_dynamic_entry (info, DT_INIT_ARRAYSZ, 0)) + return FALSE; + } + if (bfd_get_section_by_name (output_bfd, ".fini_array") != NULL) + { + if (!_bfd_elf_add_dynamic_entry (info, DT_FINI_ARRAY, 0) + || !_bfd_elf_add_dynamic_entry (info, DT_FINI_ARRAYSZ, 0)) + return FALSE; + } + + dynstr = bfd_get_section_by_name (dynobj, ".dynstr"); + /* If .dynstr is excluded from the link, we don't want any of + these tags. Strictly, we should be checking each section + individually; This quick check covers for the case where + someone does a /DISCARD/ : { *(*) }. */ + if (dynstr != NULL && dynstr->output_section != bfd_abs_section_ptr) + { + bfd_size_type strsize; + + strsize = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr); + if (!_bfd_elf_add_dynamic_entry (info, DT_HASH, 0) + || !_bfd_elf_add_dynamic_entry (info, DT_STRTAB, 0) + || !_bfd_elf_add_dynamic_entry (info, DT_SYMTAB, 0) + || !_bfd_elf_add_dynamic_entry (info, DT_STRSZ, strsize) + || !_bfd_elf_add_dynamic_entry (info, DT_SYMENT, + bed->s->sizeof_sym)) + return FALSE; + } + } + + /* The backend must work out the sizes of all the other dynamic + sections. */ + if (bed->elf_backend_size_dynamic_sections + && ! (*bed->elf_backend_size_dynamic_sections) (output_bfd, info)) + return FALSE; + + if (elf_hash_table (info)->dynamic_sections_created) + { + bfd_size_type dynsymcount; + asection *s; + size_t bucketcount = 0; + size_t hash_entry_size; + unsigned int dtagcount; + + /* Set up the version definition section. */ + s = bfd_get_section_by_name (dynobj, ".gnu.version_d"); + BFD_ASSERT (s != NULL); + + /* We may have created additional version definitions if we are + just linking a regular application. */ + verdefs = asvinfo.verdefs; + + /* Skip anonymous version tag. */ + if (verdefs != NULL && verdefs->vernum == 0) + verdefs = verdefs->next; + + if (verdefs == NULL) + _bfd_strip_section_from_output (info, s); + else + { + unsigned int cdefs; + bfd_size_type size; + struct bfd_elf_version_tree *t; + bfd_byte *p; + Elf_Internal_Verdef def; + Elf_Internal_Verdaux defaux; + + cdefs = 0; + size = 0; + + /* Make space for the base version. */ + size += sizeof (Elf_External_Verdef); + size += sizeof (Elf_External_Verdaux); + ++cdefs; + + for (t = verdefs; t != NULL; t = t->next) + { + struct bfd_elf_version_deps *n; + + size += sizeof (Elf_External_Verdef); + size += sizeof (Elf_External_Verdaux); + ++cdefs; + + for (n = t->deps; n != NULL; n = n->next) + size += sizeof (Elf_External_Verdaux); + } + + s->_raw_size = size; + s->contents = bfd_alloc (output_bfd, s->_raw_size); + if (s->contents == NULL && s->_raw_size != 0) + return FALSE; + + /* Fill in the version definition section. */ + + p = s->contents; + + def.vd_version = VER_DEF_CURRENT; + def.vd_flags = VER_FLG_BASE; + def.vd_ndx = 1; + def.vd_cnt = 1; + def.vd_aux = sizeof (Elf_External_Verdef); + def.vd_next = (sizeof (Elf_External_Verdef) + + sizeof (Elf_External_Verdaux)); + + if (soname_indx != (bfd_size_type) -1) + { + _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr, + soname_indx); + def.vd_hash = bfd_elf_hash (soname); + defaux.vda_name = soname_indx; + } + else + { + const char *name; + bfd_size_type indx; + + name = basename (output_bfd->filename); + def.vd_hash = bfd_elf_hash (name); + indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, + name, FALSE); + if (indx == (bfd_size_type) -1) + return FALSE; + defaux.vda_name = indx; + } + defaux.vda_next = 0; + + _bfd_elf_swap_verdef_out (output_bfd, &def, + (Elf_External_Verdef *) p); + p += sizeof (Elf_External_Verdef); + _bfd_elf_swap_verdaux_out (output_bfd, &defaux, + (Elf_External_Verdaux *) p); + p += sizeof (Elf_External_Verdaux); + + for (t = verdefs; t != NULL; t = t->next) + { + unsigned int cdeps; + struct bfd_elf_version_deps *n; + struct elf_link_hash_entry *h; + struct bfd_link_hash_entry *bh; + + cdeps = 0; + for (n = t->deps; n != NULL; n = n->next) + ++cdeps; + + /* Add a symbol representing this version. */ + bh = NULL; + if (! (_bfd_generic_link_add_one_symbol + (info, dynobj, t->name, BSF_GLOBAL, bfd_abs_section_ptr, + 0, NULL, FALSE, + get_elf_backend_data (dynobj)->collect, &bh))) + return FALSE; + h = (struct elf_link_hash_entry *) bh; + h->elf_link_hash_flags &= ~ ELF_LINK_NON_ELF; + h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; + h->type = STT_OBJECT; + h->verinfo.vertree = t; + + if (! bfd_elf_link_record_dynamic_symbol (info, h)) + return FALSE; + + def.vd_version = VER_DEF_CURRENT; + def.vd_flags = 0; + if (t->globals.list == NULL + && t->locals.list == NULL + && ! t->used) + def.vd_flags |= VER_FLG_WEAK; + def.vd_ndx = t->vernum + 1; + def.vd_cnt = cdeps + 1; + def.vd_hash = bfd_elf_hash (t->name); + def.vd_aux = sizeof (Elf_External_Verdef); + def.vd_next = 0; + if (t->next != NULL) + def.vd_next = (sizeof (Elf_External_Verdef) + + (cdeps + 1) * sizeof (Elf_External_Verdaux)); + + _bfd_elf_swap_verdef_out (output_bfd, &def, + (Elf_External_Verdef *) p); + p += sizeof (Elf_External_Verdef); + + defaux.vda_name = h->dynstr_index; + _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr, + h->dynstr_index); + defaux.vda_next = 0; + if (t->deps != NULL) + defaux.vda_next = sizeof (Elf_External_Verdaux); + t->name_indx = defaux.vda_name; + + _bfd_elf_swap_verdaux_out (output_bfd, &defaux, + (Elf_External_Verdaux *) p); + p += sizeof (Elf_External_Verdaux); + + for (n = t->deps; n != NULL; n = n->next) + { + if (n->version_needed == NULL) + { + /* This can happen if there was an error in the + version script. */ + defaux.vda_name = 0; + } + else + { + defaux.vda_name = n->version_needed->name_indx; + _bfd_elf_strtab_addref (elf_hash_table (info)->dynstr, + defaux.vda_name); + } + if (n->next == NULL) + defaux.vda_next = 0; + else + defaux.vda_next = sizeof (Elf_External_Verdaux); + + _bfd_elf_swap_verdaux_out (output_bfd, &defaux, + (Elf_External_Verdaux *) p); + p += sizeof (Elf_External_Verdaux); + } + } + + if (!_bfd_elf_add_dynamic_entry (info, DT_VERDEF, 0) + || !_bfd_elf_add_dynamic_entry (info, DT_VERDEFNUM, cdefs)) + return FALSE; + + elf_tdata (output_bfd)->cverdefs = cdefs; + } + + if ((info->new_dtags && info->flags) || (info->flags & DF_STATIC_TLS)) + { + if (!_bfd_elf_add_dynamic_entry (info, DT_FLAGS, info->flags)) + return FALSE; + } + else if (info->flags & DF_BIND_NOW) + { + if (!_bfd_elf_add_dynamic_entry (info, DT_BIND_NOW, 0)) + return FALSE; + } + + if (info->flags_1) + { + if (info->executable) + info->flags_1 &= ~ (DF_1_INITFIRST + | DF_1_NODELETE + | DF_1_NOOPEN); + if (!_bfd_elf_add_dynamic_entry (info, DT_FLAGS_1, info->flags_1)) + return FALSE; + } + + /* Work out the size of the version reference section. */ + + s = bfd_get_section_by_name (dynobj, ".gnu.version_r"); + BFD_ASSERT (s != NULL); + { + struct elf_find_verdep_info sinfo; + + sinfo.output_bfd = output_bfd; + sinfo.info = info; + sinfo.vers = elf_tdata (output_bfd)->cverdefs; + if (sinfo.vers == 0) + sinfo.vers = 1; + sinfo.failed = FALSE; + + elf_link_hash_traverse (elf_hash_table (info), + _bfd_elf_link_find_version_dependencies, + &sinfo); + + if (elf_tdata (output_bfd)->verref == NULL) + _bfd_strip_section_from_output (info, s); + else + { + Elf_Internal_Verneed *t; + unsigned int size; + unsigned int crefs; + bfd_byte *p; + + /* Build the version definition section. */ + size = 0; + crefs = 0; + for (t = elf_tdata (output_bfd)->verref; + t != NULL; + t = t->vn_nextref) + { + Elf_Internal_Vernaux *a; + + size += sizeof (Elf_External_Verneed); + ++crefs; + for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr) + size += sizeof (Elf_External_Vernaux); + } + + s->_raw_size = size; + s->contents = bfd_alloc (output_bfd, s->_raw_size); + if (s->contents == NULL) + return FALSE; + + p = s->contents; + for (t = elf_tdata (output_bfd)->verref; + t != NULL; + t = t->vn_nextref) + { + unsigned int caux; + Elf_Internal_Vernaux *a; + bfd_size_type indx; + + caux = 0; + for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr) + ++caux; + + t->vn_version = VER_NEED_CURRENT; + t->vn_cnt = caux; + indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, + elf_dt_name (t->vn_bfd) != NULL + ? elf_dt_name (t->vn_bfd) + : basename (t->vn_bfd->filename), + FALSE); + if (indx == (bfd_size_type) -1) + return FALSE; + t->vn_file = indx; + t->vn_aux = sizeof (Elf_External_Verneed); + if (t->vn_nextref == NULL) + t->vn_next = 0; + else + t->vn_next = (sizeof (Elf_External_Verneed) + + caux * sizeof (Elf_External_Vernaux)); + + _bfd_elf_swap_verneed_out (output_bfd, t, + (Elf_External_Verneed *) p); + p += sizeof (Elf_External_Verneed); + + for (a = t->vn_auxptr; a != NULL; a = a->vna_nextptr) + { + a->vna_hash = bfd_elf_hash (a->vna_nodename); + indx = _bfd_elf_strtab_add (elf_hash_table (info)->dynstr, + a->vna_nodename, FALSE); + if (indx == (bfd_size_type) -1) + return FALSE; + a->vna_name = indx; + if (a->vna_nextptr == NULL) + a->vna_next = 0; + else + a->vna_next = sizeof (Elf_External_Vernaux); + + _bfd_elf_swap_vernaux_out (output_bfd, a, + (Elf_External_Vernaux *) p); + p += sizeof (Elf_External_Vernaux); + } + } + + if (!_bfd_elf_add_dynamic_entry (info, DT_VERNEED, 0) + || !_bfd_elf_add_dynamic_entry (info, DT_VERNEEDNUM, crefs)) + return FALSE; + + elf_tdata (output_bfd)->cverrefs = crefs; + } + } + + /* Assign dynsym indicies. In a shared library we generate a + section symbol for each output section, which come first. + Next come all of the back-end allocated local dynamic syms, + followed by the rest of the global symbols. */ + + dynsymcount = _bfd_elf_link_renumber_dynsyms (output_bfd, info); + + /* Work out the size of the symbol version section. */ + s = bfd_get_section_by_name (dynobj, ".gnu.version"); + BFD_ASSERT (s != NULL); + if (dynsymcount == 0 + || (verdefs == NULL && elf_tdata (output_bfd)->verref == NULL)) + { + _bfd_strip_section_from_output (info, s); + /* The DYNSYMCOUNT might have changed if we were going to + output a dynamic symbol table entry for S. */ + dynsymcount = _bfd_elf_link_renumber_dynsyms (output_bfd, info); + } + else + { + s->_raw_size = dynsymcount * sizeof (Elf_External_Versym); + s->contents = bfd_zalloc (output_bfd, s->_raw_size); + if (s->contents == NULL) + return FALSE; + + if (!_bfd_elf_add_dynamic_entry (info, DT_VERSYM, 0)) + return FALSE; + } + + /* Set the size of the .dynsym and .hash sections. We counted + the number of dynamic symbols in elf_link_add_object_symbols. + We will build the contents of .dynsym and .hash when we build + the final symbol table, because until then we do not know the + correct value to give the symbols. We built the .dynstr + section as we went along in elf_link_add_object_symbols. */ + s = bfd_get_section_by_name (dynobj, ".dynsym"); + BFD_ASSERT (s != NULL); + s->_raw_size = dynsymcount * bed->s->sizeof_sym; + s->contents = bfd_alloc (output_bfd, s->_raw_size); + if (s->contents == NULL && s->_raw_size != 0) + return FALSE; + + if (dynsymcount != 0) + { + Elf_Internal_Sym isym; + + /* The first entry in .dynsym is a dummy symbol. */ + isym.st_value = 0; + isym.st_size = 0; + isym.st_name = 0; + isym.st_info = 0; + isym.st_other = 0; + isym.st_shndx = 0; + bed->s->swap_symbol_out (output_bfd, &isym, s->contents, 0); + } + + /* Compute the size of the hashing table. As a side effect this + computes the hash values for all the names we export. */ + bucketcount = compute_bucket_count (info); + + s = bfd_get_section_by_name (dynobj, ".hash"); + BFD_ASSERT (s != NULL); + hash_entry_size = elf_section_data (s)->this_hdr.sh_entsize; + s->_raw_size = ((2 + bucketcount + dynsymcount) * hash_entry_size); + s->contents = bfd_zalloc (output_bfd, s->_raw_size); + if (s->contents == NULL) + return FALSE; + + bfd_put (8 * hash_entry_size, output_bfd, bucketcount, s->contents); + bfd_put (8 * hash_entry_size, output_bfd, dynsymcount, + s->contents + hash_entry_size); + + elf_hash_table (info)->bucketcount = bucketcount; + + s = bfd_get_section_by_name (dynobj, ".dynstr"); + BFD_ASSERT (s != NULL); + + elf_finalize_dynstr (output_bfd, info); + + s->_raw_size = _bfd_elf_strtab_size (elf_hash_table (info)->dynstr); + + for (dtagcount = 0; dtagcount <= info->spare_dynamic_tags; ++dtagcount) + if (!_bfd_elf_add_dynamic_entry (info, DT_NULL, 0)) + return FALSE; + } + + return TRUE; +} + +/* Final phase of ELF linker. */ + +/* A structure we use to avoid passing large numbers of arguments. */ + +struct elf_final_link_info +{ + /* General link information. */ + struct bfd_link_info *info; + /* Output BFD. */ + bfd *output_bfd; + /* Symbol string table. */ + struct bfd_strtab_hash *symstrtab; + /* .dynsym section. */ + asection *dynsym_sec; + /* .hash section. */ + asection *hash_sec; + /* symbol version section (.gnu.version). */ + asection *symver_sec; + /* Buffer large enough to hold contents of any section. */ + bfd_byte *contents; + /* Buffer large enough to hold external relocs of any section. */ + void *external_relocs; + /* Buffer large enough to hold internal relocs of any section. */ + Elf_Internal_Rela *internal_relocs; + /* Buffer large enough to hold external local symbols of any input + BFD. */ + bfd_byte *external_syms; + /* And a buffer for symbol section indices. */ + Elf_External_Sym_Shndx *locsym_shndx; + /* Buffer large enough to hold internal local symbols of any input + BFD. */ + Elf_Internal_Sym *internal_syms; + /* Array large enough to hold a symbol index for each local symbol + of any input BFD. */ + long *indices; + /* Array large enough to hold a section pointer for each local + symbol of any input BFD. */ + asection **sections; + /* Buffer to hold swapped out symbols. */ + bfd_byte *symbuf; + /* And one for symbol section indices. */ + Elf_External_Sym_Shndx *symshndxbuf; + /* Number of swapped out symbols in buffer. */ + size_t symbuf_count; + /* Number of symbols which fit in symbuf. */ + size_t symbuf_size; + /* And same for symshndxbuf. */ + size_t shndxbuf_size; +}; + +/* This struct is used to pass information to elf_link_output_extsym. */ + +struct elf_outext_info +{ + bfd_boolean failed; + bfd_boolean localsyms; + struct elf_final_link_info *finfo; +}; + +/* When performing a relocatable link, the input relocations are + preserved. But, if they reference global symbols, the indices + referenced must be updated. Update all the relocations in + REL_HDR (there are COUNT of them), using the data in REL_HASH. */ + +static void +elf_link_adjust_relocs (bfd *abfd, + Elf_Internal_Shdr *rel_hdr, + unsigned int count, + struct elf_link_hash_entry **rel_hash) +{ + unsigned int i; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + bfd_byte *erela; + void (*swap_in) (bfd *, const bfd_byte *, Elf_Internal_Rela *); + void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *); + bfd_vma r_type_mask; + int r_sym_shift; + + if (rel_hdr->sh_entsize == bed->s->sizeof_rel) + { + swap_in = bed->s->swap_reloc_in; + swap_out = bed->s->swap_reloc_out; + } + else if (rel_hdr->sh_entsize == bed->s->sizeof_rela) + { + swap_in = bed->s->swap_reloca_in; + swap_out = bed->s->swap_reloca_out; + } + else + abort (); + + if (bed->s->int_rels_per_ext_rel > MAX_INT_RELS_PER_EXT_REL) + abort (); + + if (bed->s->arch_size == 32) + { + r_type_mask = 0xff; + r_sym_shift = 8; + } + else + { + r_type_mask = 0xffffffff; + r_sym_shift = 32; + } + + erela = rel_hdr->contents; + for (i = 0; i < count; i++, rel_hash++, erela += rel_hdr->sh_entsize) + { + Elf_Internal_Rela irela[MAX_INT_RELS_PER_EXT_REL]; + unsigned int j; + + if (*rel_hash == NULL) + continue; + + BFD_ASSERT ((*rel_hash)->indx >= 0); + + (*swap_in) (abfd, erela, irela); + for (j = 0; j < bed->s->int_rels_per_ext_rel; j++) + irela[j].r_info = ((bfd_vma) (*rel_hash)->indx << r_sym_shift + | (irela[j].r_info & r_type_mask)); + (*swap_out) (abfd, irela, erela); + } +} + +struct elf_link_sort_rela +{ + union { + bfd_vma offset; + bfd_vma sym_mask; + } u; + enum elf_reloc_type_class type; + /* We use this as an array of size int_rels_per_ext_rel. */ + Elf_Internal_Rela rela[1]; +}; + +static int +elf_link_sort_cmp1 (const void *A, const void *B) +{ + const struct elf_link_sort_rela *a = A; + const struct elf_link_sort_rela *b = B; + int relativea, relativeb; + + relativea = a->type == reloc_class_relative; + relativeb = b->type == reloc_class_relative; + + if (relativea < relativeb) + return 1; + if (relativea > relativeb) + return -1; + if ((a->rela->r_info & a->u.sym_mask) < (b->rela->r_info & b->u.sym_mask)) + return -1; + if ((a->rela->r_info & a->u.sym_mask) > (b->rela->r_info & b->u.sym_mask)) + return 1; + if (a->rela->r_offset < b->rela->r_offset) + return -1; + if (a->rela->r_offset > b->rela->r_offset) + return 1; + return 0; +} + +static int +elf_link_sort_cmp2 (const void *A, const void *B) +{ + const struct elf_link_sort_rela *a = A; + const struct elf_link_sort_rela *b = B; + int copya, copyb; + + if (a->u.offset < b->u.offset) + return -1; + if (a->u.offset > b->u.offset) + return 1; + copya = (a->type == reloc_class_copy) * 2 + (a->type == reloc_class_plt); + copyb = (b->type == reloc_class_copy) * 2 + (b->type == reloc_class_plt); + if (copya < copyb) + return -1; + if (copya > copyb) + return 1; + if (a->rela->r_offset < b->rela->r_offset) + return -1; + if (a->rela->r_offset > b->rela->r_offset) + return 1; + return 0; +} + +static size_t +elf_link_sort_relocs (bfd *abfd, struct bfd_link_info *info, asection **psec) +{ + asection *reldyn; + bfd_size_type count, size; + size_t i, ret, sort_elt, ext_size; + bfd_byte *sort, *s_non_relative, *p; + struct elf_link_sort_rela *sq; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + int i2e = bed->s->int_rels_per_ext_rel; + void (*swap_in) (bfd *, const bfd_byte *, Elf_Internal_Rela *); + void (*swap_out) (bfd *, const Elf_Internal_Rela *, bfd_byte *); + struct bfd_link_order *lo; + bfd_vma r_sym_mask; + + reldyn = bfd_get_section_by_name (abfd, ".rela.dyn"); + if (reldyn == NULL || reldyn->_raw_size == 0) + { + reldyn = bfd_get_section_by_name (abfd, ".rel.dyn"); + if (reldyn == NULL || reldyn->_raw_size == 0) + return 0; + ext_size = bed->s->sizeof_rel; + swap_in = bed->s->swap_reloc_in; + swap_out = bed->s->swap_reloc_out; + } + else + { + ext_size = bed->s->sizeof_rela; + swap_in = bed->s->swap_reloca_in; + swap_out = bed->s->swap_reloca_out; + } + count = reldyn->_raw_size / ext_size; + + size = 0; + for (lo = reldyn->link_order_head; lo != NULL; lo = lo->next) + if (lo->type == bfd_indirect_link_order) + { + asection *o = lo->u.indirect.section; + size += o->_raw_size; + } + + if (size != reldyn->_raw_size) + return 0; + + sort_elt = (sizeof (struct elf_link_sort_rela) + + (i2e - 1) * sizeof (Elf_Internal_Rela)); + sort = bfd_zmalloc (sort_elt * count); + if (sort == NULL) + { + (*info->callbacks->warning) + (info, _("Not enough memory to sort relocations"), 0, abfd, 0, 0); + return 0; + } + + if (bed->s->arch_size == 32) + r_sym_mask = ~(bfd_vma) 0xff; + else + r_sym_mask = ~(bfd_vma) 0xffffffff; + + for (lo = reldyn->link_order_head; lo != NULL; lo = lo->next) + if (lo->type == bfd_indirect_link_order) + { + bfd_byte *erel, *erelend; + asection *o = lo->u.indirect.section; + + erel = o->contents; + erelend = o->contents + o->_raw_size; + p = sort + o->output_offset / ext_size * sort_elt; + while (erel < erelend) + { + struct elf_link_sort_rela *s = (struct elf_link_sort_rela *) p; + (*swap_in) (abfd, erel, s->rela); + s->type = (*bed->elf_backend_reloc_type_class) (s->rela); + s->u.sym_mask = r_sym_mask; + p += sort_elt; + erel += ext_size; + } + } + + qsort (sort, count, sort_elt, elf_link_sort_cmp1); + + for (i = 0, p = sort; i < count; i++, p += sort_elt) + { + struct elf_link_sort_rela *s = (struct elf_link_sort_rela *) p; + if (s->type != reloc_class_relative) + break; + } + ret = i; + s_non_relative = p; + + sq = (struct elf_link_sort_rela *) s_non_relative; + for (; i < count; i++, p += sort_elt) + { + struct elf_link_sort_rela *sp = (struct elf_link_sort_rela *) p; + if (((sp->rela->r_info ^ sq->rela->r_info) & r_sym_mask) != 0) + sq = sp; + sp->u.offset = sq->rela->r_offset; + } + + qsort (s_non_relative, count - ret, sort_elt, elf_link_sort_cmp2); + + for (lo = reldyn->link_order_head; lo != NULL; lo = lo->next) + if (lo->type == bfd_indirect_link_order) + { + bfd_byte *erel, *erelend; + asection *o = lo->u.indirect.section; + + erel = o->contents; + erelend = o->contents + o->_raw_size; + p = sort + o->output_offset / ext_size * sort_elt; + while (erel < erelend) + { + struct elf_link_sort_rela *s = (struct elf_link_sort_rela *) p; + (*swap_out) (abfd, s->rela, erel); + p += sort_elt; + erel += ext_size; + } + } + + free (sort); + *psec = reldyn; + return ret; +} + +/* Flush the output symbols to the file. */ + +static bfd_boolean +elf_link_flush_output_syms (struct elf_final_link_info *finfo, + const struct elf_backend_data *bed) +{ + if (finfo->symbuf_count > 0) + { + Elf_Internal_Shdr *hdr; + file_ptr pos; + bfd_size_type amt; + + hdr = &elf_tdata (finfo->output_bfd)->symtab_hdr; + pos = hdr->sh_offset + hdr->sh_size; + amt = finfo->symbuf_count * bed->s->sizeof_sym; + if (bfd_seek (finfo->output_bfd, pos, SEEK_SET) != 0 + || bfd_bwrite (finfo->symbuf, amt, finfo->output_bfd) != amt) + return FALSE; + + hdr->sh_size += amt; + finfo->symbuf_count = 0; + } + + return TRUE; +} + +/* Add a symbol to the output symbol table. */ + +static bfd_boolean +elf_link_output_sym (struct elf_final_link_info *finfo, + const char *name, + Elf_Internal_Sym *elfsym, + asection *input_sec, + struct elf_link_hash_entry *h) +{ + bfd_byte *dest; + Elf_External_Sym_Shndx *destshndx; + bfd_boolean (*output_symbol_hook) + (struct bfd_link_info *, const char *, Elf_Internal_Sym *, asection *, + struct elf_link_hash_entry *); + const struct elf_backend_data *bed; + + bed = get_elf_backend_data (finfo->output_bfd); + output_symbol_hook = bed->elf_backend_link_output_symbol_hook; + if (output_symbol_hook != NULL) + { + if (! (*output_symbol_hook) (finfo->info, name, elfsym, input_sec, h)) + return FALSE; + } + + if (name == NULL || *name == '\0') + elfsym->st_name = 0; + else if (input_sec->flags & SEC_EXCLUDE) + elfsym->st_name = 0; + else + { + elfsym->st_name = (unsigned long) _bfd_stringtab_add (finfo->symstrtab, + name, TRUE, FALSE); + if (elfsym->st_name == (unsigned long) -1) + return FALSE; + } + + if (finfo->symbuf_count >= finfo->symbuf_size) + { + if (! elf_link_flush_output_syms (finfo, bed)) + return FALSE; + } + + dest = finfo->symbuf + finfo->symbuf_count * bed->s->sizeof_sym; + destshndx = finfo->symshndxbuf; + if (destshndx != NULL) + { + if (bfd_get_symcount (finfo->output_bfd) >= finfo->shndxbuf_size) + { + bfd_size_type amt; + + amt = finfo->shndxbuf_size * sizeof (Elf_External_Sym_Shndx); + finfo->symshndxbuf = destshndx = bfd_realloc (destshndx, amt * 2); + if (destshndx == NULL) + return FALSE; + memset ((char *) destshndx + amt, 0, amt); + finfo->shndxbuf_size *= 2; + } + destshndx += bfd_get_symcount (finfo->output_bfd); + } + + bed->s->swap_symbol_out (finfo->output_bfd, elfsym, dest, destshndx); + finfo->symbuf_count += 1; + bfd_get_symcount (finfo->output_bfd) += 1; + + return TRUE; +} + +/* For DSOs loaded in via a DT_NEEDED entry, emulate ld.so in + allowing an unsatisfied unversioned symbol in the DSO to match a + versioned symbol that would normally require an explicit version. + We also handle the case that a DSO references a hidden symbol + which may be satisfied by a versioned symbol in another DSO. */ + +static bfd_boolean +elf_link_check_versioned_symbol (struct bfd_link_info *info, + const struct elf_backend_data *bed, + struct elf_link_hash_entry *h) +{ + bfd *abfd; + struct elf_link_loaded_list *loaded; + + if (!is_elf_hash_table (info->hash)) + return FALSE; + + switch (h->root.type) + { + default: + abfd = NULL; + break; + + case bfd_link_hash_undefined: + case bfd_link_hash_undefweak: + abfd = h->root.u.undef.abfd; + if ((abfd->flags & DYNAMIC) == 0 + || elf_dyn_lib_class (abfd) != DYN_DT_NEEDED) + return FALSE; + break; + + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + abfd = h->root.u.def.section->owner; + break; + + case bfd_link_hash_common: + abfd = h->root.u.c.p->section->owner; + break; + } + BFD_ASSERT (abfd != NULL); + + for (loaded = elf_hash_table (info)->loaded; + loaded != NULL; + loaded = loaded->next) + { + bfd *input; + Elf_Internal_Shdr *hdr; + bfd_size_type symcount; + bfd_size_type extsymcount; + bfd_size_type extsymoff; + Elf_Internal_Shdr *versymhdr; + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; + Elf_Internal_Sym *isymbuf; + Elf_External_Versym *ever; + Elf_External_Versym *extversym; + + input = loaded->abfd; + + /* We check each DSO for a possible hidden versioned definition. */ + if (input == abfd + || (input->flags & DYNAMIC) == 0 + || elf_dynversym (input) == 0) + continue; + + hdr = &elf_tdata (input)->dynsymtab_hdr; + + symcount = hdr->sh_size / bed->s->sizeof_sym; + if (elf_bad_symtab (input)) + { + extsymcount = symcount; + extsymoff = 0; + } + else + { + extsymcount = symcount - hdr->sh_info; + extsymoff = hdr->sh_info; + } + + if (extsymcount == 0) + continue; + + isymbuf = bfd_elf_get_elf_syms (input, hdr, extsymcount, extsymoff, + NULL, NULL, NULL); + if (isymbuf == NULL) + return FALSE; + + /* Read in any version definitions. */ + versymhdr = &elf_tdata (input)->dynversym_hdr; + extversym = bfd_malloc (versymhdr->sh_size); + if (extversym == NULL) + goto error_ret; + + if (bfd_seek (input, versymhdr->sh_offset, SEEK_SET) != 0 + || (bfd_bread (extversym, versymhdr->sh_size, input) + != versymhdr->sh_size)) + { + free (extversym); + error_ret: + free (isymbuf); + return FALSE; + } + + ever = extversym + extsymoff; + isymend = isymbuf + extsymcount; + for (isym = isymbuf; isym < isymend; isym++, ever++) + { + const char *name; + Elf_Internal_Versym iver; + unsigned short version_index; + + if (ELF_ST_BIND (isym->st_info) == STB_LOCAL + || isym->st_shndx == SHN_UNDEF) + continue; + + name = bfd_elf_string_from_elf_section (input, + hdr->sh_link, + isym->st_name); + if (strcmp (name, h->root.root.string) != 0) + continue; + + _bfd_elf_swap_versym_in (input, ever, &iver); + + if ((iver.vs_vers & VERSYM_HIDDEN) == 0) + { + /* If we have a non-hidden versioned sym, then it should + have provided a definition for the undefined sym. */ + abort (); + } + + version_index = iver.vs_vers & VERSYM_VERSION; + if (version_index == 1 || version_index == 2) + { + /* This is the base or first version. We can use it. */ + free (extversym); + free (isymbuf); + return TRUE; + } + } + + free (extversym); + free (isymbuf); + } + + return FALSE; +} + +/* Add an external symbol to the symbol table. This is called from + the hash table traversal routine. When generating a shared object, + we go through the symbol table twice. The first time we output + anything that might have been forced to local scope in a version + script. The second time we output the symbols that are still + global symbols. */ + +static bfd_boolean +elf_link_output_extsym (struct elf_link_hash_entry *h, void *data) +{ + struct elf_outext_info *eoinfo = data; + struct elf_final_link_info *finfo = eoinfo->finfo; + bfd_boolean strip; + Elf_Internal_Sym sym; + asection *input_sec; + const struct elf_backend_data *bed; + + if (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_new) + return TRUE; + } + + /* Decide whether to output this symbol in this pass. */ + if (eoinfo->localsyms) + { + if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + return TRUE; + } + else + { + if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) + return TRUE; + } + + bed = get_elf_backend_data (finfo->output_bfd); + + /* If we have an undefined symbol reference here then it must have + come from a shared library that is being linked in. (Undefined + references in regular files have already been handled). If we + are reporting errors for this situation then do so now. */ + if (h->root.type == bfd_link_hash_undefined + && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0 + && ! elf_link_check_versioned_symbol (finfo->info, bed, h) + && finfo->info->unresolved_syms_in_shared_libs != RM_IGNORE) + { + if (! ((*finfo->info->callbacks->undefined_symbol) + (finfo->info, h->root.root.string, h->root.u.undef.abfd, + NULL, 0, finfo->info->unresolved_syms_in_shared_libs == RM_GENERATE_ERROR))) + { + eoinfo->failed = TRUE; + return FALSE; + } + } + + /* We should also warn if a forced local symbol is referenced from + shared libraries. */ + if (! finfo->info->relocatable + && (! finfo->info->shared) + && (h->elf_link_hash_flags + & (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC | ELF_LINK_DYNAMIC_DEF | ELF_LINK_DYNAMIC_WEAK)) + == (ELF_LINK_FORCED_LOCAL | ELF_LINK_HASH_REF_DYNAMIC) + && ! elf_link_check_versioned_symbol (finfo->info, bed, h)) + { + (*_bfd_error_handler) + (_("%s: %s symbol `%s' in %s is referenced by DSO"), + bfd_get_filename (finfo->output_bfd), + ELF_ST_VISIBILITY (h->other) == STV_INTERNAL + ? "internal" + : ELF_ST_VISIBILITY (h->other) == STV_HIDDEN + ? "hidden" : "local", + h->root.root.string, + bfd_archive_filename (h->root.u.def.section->owner)); + eoinfo->failed = TRUE; + return FALSE; + } + + /* We don't want to output symbols that have never been mentioned by + a regular file, or that we have been told to strip. However, if + h->indx is set to -2, the symbol is used by a reloc and we must + output it. */ + if (h->indx == -2) + strip = FALSE; + else if (((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0 + || (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) != 0) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) == 0) + strip = TRUE; + else if (finfo->info->strip == strip_all) + strip = TRUE; + else if (finfo->info->strip == strip_some + && bfd_hash_lookup (finfo->info->keep_hash, + h->root.root.string, FALSE, FALSE) == NULL) + strip = TRUE; + else if (finfo->info->strip_discarded + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && elf_discarded_section (h->root.u.def.section)) + strip = TRUE; + else + strip = FALSE; + + /* If we're stripping it, and it's not a dynamic symbol, there's + nothing else to do unless it is a forced local symbol. */ + if (strip + && h->dynindx == -1 + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + return TRUE; + + sym.st_value = 0; + sym.st_size = h->size; + sym.st_other = h->other; + if ((h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) + sym.st_info = ELF_ST_INFO (STB_LOCAL, h->type); + else if (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_defweak) + sym.st_info = ELF_ST_INFO (STB_WEAK, h->type); + else + sym.st_info = ELF_ST_INFO (STB_GLOBAL, h->type); + + switch (h->root.type) + { + default: + case bfd_link_hash_new: + case bfd_link_hash_warning: + abort (); + return FALSE; + + case bfd_link_hash_undefined: + case bfd_link_hash_undefweak: + input_sec = bfd_und_section_ptr; + sym.st_shndx = SHN_UNDEF; + break; + + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + { + input_sec = h->root.u.def.section; + if (input_sec->output_section != NULL) + { + sym.st_shndx = + _bfd_elf_section_from_bfd_section (finfo->output_bfd, + input_sec->output_section); + if (sym.st_shndx == SHN_BAD) + { + (*_bfd_error_handler) + (_("%s: could not find output section %s for input section %s"), + bfd_get_filename (finfo->output_bfd), + input_sec->output_section->name, + input_sec->name); + eoinfo->failed = TRUE; + return FALSE; + } + + /* ELF symbols in relocatable files are section relative, + but in nonrelocatable files they are virtual + addresses. */ + sym.st_value = h->root.u.def.value + input_sec->output_offset; + if (! finfo->info->relocatable) + { + sym.st_value += input_sec->output_section->vma; + if (h->type == STT_TLS) + { + /* STT_TLS symbols are relative to PT_TLS segment + base. */ + BFD_ASSERT (elf_hash_table (finfo->info)->tls_sec != NULL); + sym.st_value -= elf_hash_table (finfo->info)->tls_sec->vma; + } + } + } + else + { + BFD_ASSERT (input_sec->owner == NULL + || (input_sec->owner->flags & DYNAMIC) != 0); + sym.st_shndx = SHN_UNDEF; + input_sec = bfd_und_section_ptr; + } + } + break; + + case bfd_link_hash_common: + input_sec = h->root.u.c.p->section; + sym.st_shndx = SHN_COMMON; + sym.st_value = 1 << h->root.u.c.p->alignment_power; + break; + + case bfd_link_hash_indirect: + /* These symbols are created by symbol versioning. They point + to the decorated version of the name. For example, if the + symbol foo@@GNU_1.2 is the default, which should be used when + foo is used with no version, then we add an indirect symbol + foo which points to foo@@GNU_1.2. We ignore these symbols, + since the indirected symbol is already in the hash table. */ + return TRUE; + } + + /* Give the processor backend a chance to tweak the symbol value, + and also to finish up anything that needs to be done for this + symbol. FIXME: Not calling elf_backend_finish_dynamic_symbol for + forced local syms when non-shared is due to a historical quirk. */ + if ((h->dynindx != -1 + || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) + && ((finfo->info->shared + && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) + || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + && elf_hash_table (finfo->info)->dynamic_sections_created) + { + if (! ((*bed->elf_backend_finish_dynamic_symbol) + (finfo->output_bfd, finfo->info, h, &sym))) + { + eoinfo->failed = TRUE; + return FALSE; + } + } + + /* If we are marking the symbol as undefined, and there are no + non-weak references to this symbol from a regular object, then + mark the symbol as weak undefined; if there are non-weak + references, mark the symbol as strong. We can't do this earlier, + because it might not be marked as undefined until the + finish_dynamic_symbol routine gets through with it. */ + if (sym.st_shndx == SHN_UNDEF + && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR) != 0 + && (ELF_ST_BIND (sym.st_info) == STB_GLOBAL + || ELF_ST_BIND (sym.st_info) == STB_WEAK)) + { + int bindtype; + + if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) != 0) + bindtype = STB_GLOBAL; + else + bindtype = STB_WEAK; + sym.st_info = ELF_ST_INFO (bindtype, ELF_ST_TYPE (sym.st_info)); + } + + /* If a non-weak symbol with non-default visibility is not defined + locally, it is a fatal error. */ + if (! finfo->info->relocatable + && ELF_ST_VISIBILITY (sym.st_other) != STV_DEFAULT + && ELF_ST_BIND (sym.st_info) != STB_WEAK + && h->root.type == bfd_link_hash_undefined + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + { + (*_bfd_error_handler) + (_("%s: %s symbol `%s' isn't defined"), + bfd_get_filename (finfo->output_bfd), + ELF_ST_VISIBILITY (sym.st_other) == STV_PROTECTED + ? "protected" + : ELF_ST_VISIBILITY (sym.st_other) == STV_INTERNAL + ? "internal" : "hidden", + h->root.root.string); + eoinfo->failed = TRUE; + return FALSE; + } + + /* If this symbol should be put in the .dynsym section, then put it + there now. We already know the symbol index. We also fill in + the entry in the .hash section. */ + if (h->dynindx != -1 + && elf_hash_table (finfo->info)->dynamic_sections_created) + { + size_t bucketcount; + size_t bucket; + size_t hash_entry_size; + bfd_byte *bucketpos; + bfd_vma chain; + bfd_byte *esym; + + sym.st_name = h->dynstr_index; + esym = finfo->dynsym_sec->contents + h->dynindx * bed->s->sizeof_sym; + bed->s->swap_symbol_out (finfo->output_bfd, &sym, esym, 0); + + bucketcount = elf_hash_table (finfo->info)->bucketcount; + bucket = h->elf_hash_value % bucketcount; + hash_entry_size + = elf_section_data (finfo->hash_sec)->this_hdr.sh_entsize; + bucketpos = ((bfd_byte *) finfo->hash_sec->contents + + (bucket + 2) * hash_entry_size); + chain = bfd_get (8 * hash_entry_size, finfo->output_bfd, bucketpos); + bfd_put (8 * hash_entry_size, finfo->output_bfd, h->dynindx, bucketpos); + bfd_put (8 * hash_entry_size, finfo->output_bfd, chain, + ((bfd_byte *) finfo->hash_sec->contents + + (bucketcount + 2 + h->dynindx) * hash_entry_size)); + + if (finfo->symver_sec != NULL && finfo->symver_sec->contents != NULL) + { + Elf_Internal_Versym iversym; + Elf_External_Versym *eversym; + + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + { + if (h->verinfo.verdef == NULL) + iversym.vs_vers = 0; + else + iversym.vs_vers = h->verinfo.verdef->vd_exp_refno + 1; + } + else + { + if (h->verinfo.vertree == NULL) + iversym.vs_vers = 1; + else + iversym.vs_vers = h->verinfo.vertree->vernum + 1; + } + + if ((h->elf_link_hash_flags & ELF_LINK_HIDDEN) != 0) + iversym.vs_vers |= VERSYM_HIDDEN; + + eversym = (Elf_External_Versym *) finfo->symver_sec->contents; + eversym += h->dynindx; + _bfd_elf_swap_versym_out (finfo->output_bfd, &iversym, eversym); + } + } + + /* If we're stripping it, then it was just a dynamic symbol, and + there's nothing else to do. */ + if (strip || (input_sec->flags & SEC_EXCLUDE) != 0) + return TRUE; + + h->indx = bfd_get_symcount (finfo->output_bfd); + + if (! elf_link_output_sym (finfo, h->root.root.string, &sym, input_sec, h)) + { + eoinfo->failed = TRUE; + return FALSE; + } + + return TRUE; +} + +static bfd_boolean +elf_section_ignore_discarded_relocs (asection *sec) +{ + const struct elf_backend_data *bed; + + switch (sec->sec_info_type) + { + case ELF_INFO_TYPE_STABS: + case ELF_INFO_TYPE_EH_FRAME: + return TRUE; + default: + break; + } + + bed = get_elf_backend_data (sec->owner); + if (bed->elf_backend_ignore_discarded_relocs != NULL + && (*bed->elf_backend_ignore_discarded_relocs) (sec)) + return TRUE; + + return FALSE; +} + +/* Link an input file into the linker output file. This function + handles all the sections and relocations of the input file at once. + This is so that we only have to read the local symbols once, and + don't have to keep them in memory. */ + +static bfd_boolean +elf_link_input_bfd (struct elf_final_link_info *finfo, bfd *input_bfd) +{ + bfd_boolean (*relocate_section) + (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **); + bfd *output_bfd; + Elf_Internal_Shdr *symtab_hdr; + size_t locsymcount; + size_t extsymoff; + Elf_Internal_Sym *isymbuf; + Elf_Internal_Sym *isym; + Elf_Internal_Sym *isymend; + long *pindex; + asection **ppsection; + asection *o; + const struct elf_backend_data *bed; + bfd_boolean emit_relocs; + struct elf_link_hash_entry **sym_hashes; + + output_bfd = finfo->output_bfd; + bed = get_elf_backend_data (output_bfd); + relocate_section = bed->elf_backend_relocate_section; + + /* If this is a dynamic object, we don't want to do anything here: + we don't want the local symbols, and we don't want the section + contents. */ + if ((input_bfd->flags & DYNAMIC) != 0) + return TRUE; + + emit_relocs = (finfo->info->relocatable + || finfo->info->emitrelocations + || bed->elf_backend_emit_relocs); + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + if (elf_bad_symtab (input_bfd)) + { + locsymcount = symtab_hdr->sh_size / bed->s->sizeof_sym; + extsymoff = 0; + } + else + { + locsymcount = symtab_hdr->sh_info; + extsymoff = symtab_hdr->sh_info; + } + + /* Read the local symbols. */ + isymbuf = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isymbuf == NULL && locsymcount != 0) + { + isymbuf = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, locsymcount, 0, + finfo->internal_syms, + finfo->external_syms, + finfo->locsym_shndx); + if (isymbuf == NULL) + return FALSE; + } + + /* Find local symbol sections and adjust values of symbols in + SEC_MERGE sections. Write out those local symbols we know are + going into the output file. */ + isymend = isymbuf + locsymcount; + for (isym = isymbuf, pindex = finfo->indices, ppsection = finfo->sections; + isym < isymend; + isym++, pindex++, ppsection++) + { + asection *isec; + const char *name; + Elf_Internal_Sym osym; + + *pindex = -1; + + if (elf_bad_symtab (input_bfd)) + { + if (ELF_ST_BIND (isym->st_info) != STB_LOCAL) + { + *ppsection = NULL; + continue; + } + } + + if (isym->st_shndx == SHN_UNDEF) + isec = bfd_und_section_ptr; + else if (isym->st_shndx < SHN_LORESERVE + || isym->st_shndx > SHN_HIRESERVE) + { + isec = bfd_section_from_elf_index (input_bfd, isym->st_shndx); + if (isec + && isec->sec_info_type == ELF_INFO_TYPE_MERGE + && ELF_ST_TYPE (isym->st_info) != STT_SECTION) + isym->st_value = + _bfd_merged_section_offset (output_bfd, &isec, + elf_section_data (isec)->sec_info, + isym->st_value, 0); + } + else if (isym->st_shndx == SHN_ABS) + isec = bfd_abs_section_ptr; + else if (isym->st_shndx == SHN_COMMON) + isec = bfd_com_section_ptr; + else + { + /* Who knows? */ + isec = NULL; + } + + *ppsection = isec; + + /* Don't output the first, undefined, symbol. */ + if (ppsection == finfo->sections) + continue; + + if (ELF_ST_TYPE (isym->st_info) == STT_SECTION) + { + /* We never output section symbols. Instead, we use the + section symbol of the corresponding section in the output + file. */ + continue; + } + + /* If we are stripping all symbols, we don't want to output this + one. */ + if (finfo->info->strip == strip_all) + continue; + + /* If we are discarding all local symbols, we don't want to + output this one. If we are generating a relocatable output + file, then some of the local symbols may be required by + relocs; we output them below as we discover that they are + needed. */ + if (finfo->info->discard == discard_all) + continue; + + /* If this symbol is defined in a section which we are + discarding, we don't need to keep it, but note that + linker_mark is only reliable for sections that have contents. + For the benefit of the MIPS ELF linker, we check SEC_EXCLUDE + as well as linker_mark. */ + if ((isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE) + && isec != NULL + && ((! isec->linker_mark && (isec->flags & SEC_HAS_CONTENTS) != 0) + || (! finfo->info->relocatable + && (isec->flags & SEC_EXCLUDE) != 0))) + continue; + + /* Get the name of the symbol. */ + name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, + isym->st_name); + if (name == NULL) + return FALSE; + + /* See if we are discarding symbols with this name. */ + if ((finfo->info->strip == strip_some + && (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE, FALSE) + == NULL)) + || (((finfo->info->discard == discard_sec_merge + && (isec->flags & SEC_MERGE) && ! finfo->info->relocatable) + || finfo->info->discard == discard_l) + && bfd_is_local_label_name (input_bfd, name))) + continue; + + /* If we get here, we are going to output this symbol. */ + + osym = *isym; + + /* Adjust the section index for the output file. */ + osym.st_shndx = _bfd_elf_section_from_bfd_section (output_bfd, + isec->output_section); + if (osym.st_shndx == SHN_BAD) + return FALSE; + + *pindex = bfd_get_symcount (output_bfd); + + /* ELF symbols in relocatable files are section relative, but + in executable files they are virtual addresses. Note that + this code assumes that all ELF sections have an associated + BFD section with a reasonable value for output_offset; below + we assume that they also have a reasonable value for + output_section. Any special sections must be set up to meet + these requirements. */ + osym.st_value += isec->output_offset; + if (! finfo->info->relocatable) + { + osym.st_value += isec->output_section->vma; + if (ELF_ST_TYPE (osym.st_info) == STT_TLS) + { + /* STT_TLS symbols are relative to PT_TLS segment base. */ + BFD_ASSERT (elf_hash_table (finfo->info)->tls_sec != NULL); + osym.st_value -= elf_hash_table (finfo->info)->tls_sec->vma; + } + } + + if (! elf_link_output_sym (finfo, name, &osym, isec, NULL)) + return FALSE; + } + + /* Relocate the contents of each section. */ + sym_hashes = elf_sym_hashes (input_bfd); + for (o = input_bfd->sections; o != NULL; o = o->next) + { + bfd_byte *contents; + + if (! o->linker_mark) + { + /* This section was omitted from the link. */ + continue; + } + + if ((o->flags & SEC_HAS_CONTENTS) == 0 + || (o->_raw_size == 0 && (o->flags & SEC_RELOC) == 0)) + continue; + + if ((o->flags & SEC_LINKER_CREATED) != 0) + { + /* Section was created by _bfd_elf_link_create_dynamic_sections + or somesuch. */ + continue; + } + + /* Get the contents of the section. They have been cached by a + relaxation routine. Note that o is a section in an input + file, so the contents field will not have been set by any of + the routines which work on output files. */ + if (elf_section_data (o)->this_hdr.contents != NULL) + contents = elf_section_data (o)->this_hdr.contents; + else + { + contents = finfo->contents; + if (! bfd_get_section_contents (input_bfd, o, contents, 0, + o->_raw_size)) + return FALSE; + } + + if ((o->flags & SEC_RELOC) != 0) + { + Elf_Internal_Rela *internal_relocs; + bfd_vma r_type_mask; + int r_sym_shift; + + /* Get the swapped relocs. */ + internal_relocs + = _bfd_elf_link_read_relocs (input_bfd, o, finfo->external_relocs, + finfo->internal_relocs, FALSE); + if (internal_relocs == NULL + && o->reloc_count > 0) + return FALSE; + + if (bed->s->arch_size == 32) + { + r_type_mask = 0xff; + r_sym_shift = 8; + } + else + { + r_type_mask = 0xffffffff; + r_sym_shift = 32; + } + + /* Run through the relocs looking for any against symbols + from discarded sections and section symbols from + removed link-once sections. Complain about relocs + against discarded sections. Zero relocs against removed + link-once sections. Preserve debug information as much + as we can. */ + if (!elf_section_ignore_discarded_relocs (o)) + { + Elf_Internal_Rela *rel, *relend; + + rel = internal_relocs; + relend = rel + o->reloc_count * bed->s->int_rels_per_ext_rel; + for ( ; rel < relend; rel++) + { + unsigned long r_symndx = rel->r_info >> r_sym_shift; + asection *sec; + + if (r_symndx >= locsymcount + || (elf_bad_symtab (input_bfd) + && finfo->sections[r_symndx] == NULL)) + { + struct elf_link_hash_entry *h; + + h = sym_hashes[r_symndx - extsymoff]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* Complain if the definition comes from a + discarded section. */ + sec = h->root.u.def.section; + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && elf_discarded_section (sec)) + { + if ((o->flags & SEC_DEBUGGING) != 0) + { + BFD_ASSERT (r_symndx != 0); + /* Try to preserve debug information. */ + if ((o->flags & SEC_DEBUGGING) != 0 + && sec->kept_section != NULL + && sec->_raw_size == sec->kept_section->_raw_size) + h->root.u.def.section + = sec->kept_section; + else + memset (rel, 0, sizeof (*rel)); + } + else + finfo->info->callbacks->error_handler + (LD_DEFINITION_IN_DISCARDED_SECTION, + _("%T: discarded in section `%s' from %s\n"), + h->root.root.string, + h->root.root.string, + h->root.u.def.section->name, + bfd_archive_filename (h->root.u.def.section->owner)); + } + } + else + { + sec = finfo->sections[r_symndx]; + + if (sec != NULL && elf_discarded_section (sec)) + { + if ((o->flags & SEC_DEBUGGING) != 0 + || (sec->flags & SEC_LINK_ONCE) != 0) + { + BFD_ASSERT (r_symndx != 0); + /* Try to preserve debug information. */ + if ((o->flags & SEC_DEBUGGING) != 0 + && sec->kept_section != NULL + && sec->_raw_size == sec->kept_section->_raw_size) + finfo->sections[r_symndx] + = sec->kept_section; + else + { + rel->r_info &= r_type_mask; + rel->r_addend = 0; + } + } + else + { + static int count; + int ok; + char *buf; + + ok = asprintf (&buf, "local symbol %d", + count++); + if (ok <= 0) + buf = (char *) "local symbol"; + finfo->info->callbacks->error_handler + (LD_DEFINITION_IN_DISCARDED_SECTION, + _("%T: discarded in section `%s' from %s\n"), + buf, buf, sec->name, + bfd_archive_filename (input_bfd)); + if (ok != -1) + free (buf); + } + } + } + } + } + + /* Relocate the section by invoking a back end routine. + + The back end routine is responsible for adjusting the + section contents as necessary, and (if using Rela relocs + and generating a relocatable output file) adjusting the + reloc addend as necessary. + + The back end routine does not have to worry about setting + the reloc address or the reloc symbol index. + + The back end routine is given a pointer to the swapped in + internal symbols, and can access the hash table entries + for the external symbols via elf_sym_hashes (input_bfd). + + When generating relocatable output, the back end routine + must handle STB_LOCAL/STT_SECTION symbols specially. The + output symbol is going to be a section symbol + corresponding to the output section, which will require + the addend to be adjusted. */ + + if (! (*relocate_section) (output_bfd, finfo->info, + input_bfd, o, contents, + internal_relocs, + isymbuf, + finfo->sections)) + return FALSE; + + if (emit_relocs) + { + Elf_Internal_Rela *irela; + Elf_Internal_Rela *irelaend; + bfd_vma last_offset; + struct elf_link_hash_entry **rel_hash; + Elf_Internal_Shdr *input_rel_hdr, *input_rel_hdr2; + unsigned int next_erel; + bfd_boolean (*reloc_emitter) + (bfd *, asection *, Elf_Internal_Shdr *, Elf_Internal_Rela *); + bfd_boolean rela_normal; + + input_rel_hdr = &elf_section_data (o)->rel_hdr; + rela_normal = (bed->rela_normal + && (input_rel_hdr->sh_entsize + == bed->s->sizeof_rela)); + + /* Adjust the reloc addresses and symbol indices. */ + + irela = internal_relocs; + irelaend = irela + o->reloc_count * bed->s->int_rels_per_ext_rel; + rel_hash = (elf_section_data (o->output_section)->rel_hashes + + elf_section_data (o->output_section)->rel_count + + elf_section_data (o->output_section)->rel_count2); + last_offset = o->output_offset; + if (!finfo->info->relocatable) + last_offset += o->output_section->vma; + for (next_erel = 0; irela < irelaend; irela++, next_erel++) + { + unsigned long r_symndx; + asection *sec; + Elf_Internal_Sym sym; + + if (next_erel == bed->s->int_rels_per_ext_rel) + { + rel_hash++; + next_erel = 0; + } + + irela->r_offset = _bfd_elf_section_offset (output_bfd, + finfo->info, o, + irela->r_offset); + if (irela->r_offset >= (bfd_vma) -2) + { + /* This is a reloc for a deleted entry or somesuch. + Turn it into an R_*_NONE reloc, at the same + offset as the last reloc. elf_eh_frame.c and + elf_bfd_discard_info rely on reloc offsets + being ordered. */ + irela->r_offset = last_offset; + irela->r_info = 0; + irela->r_addend = 0; + continue; + } + + irela->r_offset += o->output_offset; + + /* Relocs in an executable have to be virtual addresses. */ + if (!finfo->info->relocatable) + irela->r_offset += o->output_section->vma; + + last_offset = irela->r_offset; + + r_symndx = irela->r_info >> r_sym_shift; + if (r_symndx == STN_UNDEF) + continue; + + if (r_symndx >= locsymcount + || (elf_bad_symtab (input_bfd) + && finfo->sections[r_symndx] == NULL)) + { + struct elf_link_hash_entry *rh; + unsigned long indx; + + /* This is a reloc against a global symbol. We + have not yet output all the local symbols, so + we do not know the symbol index of any global + symbol. We set the rel_hash entry for this + reloc to point to the global hash table entry + for this symbol. The symbol index is then + set at the end of elf_bfd_final_link. */ + indx = r_symndx - extsymoff; + rh = elf_sym_hashes (input_bfd)[indx]; + while (rh->root.type == bfd_link_hash_indirect + || rh->root.type == bfd_link_hash_warning) + rh = (struct elf_link_hash_entry *) rh->root.u.i.link; + + /* Setting the index to -2 tells + elf_link_output_extsym that this symbol is + used by a reloc. */ + BFD_ASSERT (rh->indx < 0); + rh->indx = -2; + + *rel_hash = rh; + + continue; + } + + /* This is a reloc against a local symbol. */ + + *rel_hash = NULL; + sym = isymbuf[r_symndx]; + sec = finfo->sections[r_symndx]; + if (ELF_ST_TYPE (sym.st_info) == STT_SECTION) + { + /* I suppose the backend ought to fill in the + section of any STT_SECTION symbol against a + processor specific section. If we have + discarded a section, the output_section will + be the absolute section. */ + if (bfd_is_abs_section (sec) + || (sec != NULL + && bfd_is_abs_section (sec->output_section))) + r_symndx = 0; + else if (sec == NULL || sec->owner == NULL) + { + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + else + { + r_symndx = sec->output_section->target_index; + BFD_ASSERT (r_symndx != 0); + } + + /* Adjust the addend according to where the + section winds up in the output section. */ + if (rela_normal) + irela->r_addend += sec->output_offset; + } + else + { + if (finfo->indices[r_symndx] == -1) + { + unsigned long shlink; + const char *name; + asection *osec; + + if (finfo->info->strip == strip_all) + { + /* You can't do ld -r -s. */ + bfd_set_error (bfd_error_invalid_operation); + return FALSE; + } + + /* This symbol was skipped earlier, but + since it is needed by a reloc, we + must output it now. */ + shlink = symtab_hdr->sh_link; + name = (bfd_elf_string_from_elf_section + (input_bfd, shlink, sym.st_name)); + if (name == NULL) + return FALSE; + + osec = sec->output_section; + sym.st_shndx = + _bfd_elf_section_from_bfd_section (output_bfd, + osec); + if (sym.st_shndx == SHN_BAD) + return FALSE; + + sym.st_value += sec->output_offset; + if (! finfo->info->relocatable) + { + sym.st_value += osec->vma; + if (ELF_ST_TYPE (sym.st_info) == STT_TLS) + { + /* STT_TLS symbols are relative to PT_TLS + segment base. */ + BFD_ASSERT (elf_hash_table (finfo->info) + ->tls_sec != NULL); + sym.st_value -= (elf_hash_table (finfo->info) + ->tls_sec->vma); + } + } + + finfo->indices[r_symndx] + = bfd_get_symcount (output_bfd); + + if (! elf_link_output_sym (finfo, name, &sym, sec, + NULL)) + return FALSE; + } + + r_symndx = finfo->indices[r_symndx]; + } + + irela->r_info = ((bfd_vma) r_symndx << r_sym_shift + | (irela->r_info & r_type_mask)); + } + + /* Swap out the relocs. */ + if (bed->elf_backend_emit_relocs + && !(finfo->info->relocatable + || finfo->info->emitrelocations)) + reloc_emitter = bed->elf_backend_emit_relocs; + else + reloc_emitter = _bfd_elf_link_output_relocs; + + if (input_rel_hdr->sh_size != 0 + && ! (*reloc_emitter) (output_bfd, o, input_rel_hdr, + internal_relocs)) + return FALSE; + + input_rel_hdr2 = elf_section_data (o)->rel_hdr2; + if (input_rel_hdr2 && input_rel_hdr2->sh_size != 0) + { + internal_relocs += (NUM_SHDR_ENTRIES (input_rel_hdr) + * bed->s->int_rels_per_ext_rel); + if (! (*reloc_emitter) (output_bfd, o, input_rel_hdr2, + internal_relocs)) + return FALSE; + } + } + } + + /* Write out the modified section contents. */ + if (bed->elf_backend_write_section + && (*bed->elf_backend_write_section) (output_bfd, o, contents)) + { + /* Section written out. */ + } + else switch (o->sec_info_type) + { + case ELF_INFO_TYPE_STABS: + if (! (_bfd_write_section_stabs + (output_bfd, + &elf_hash_table (finfo->info)->stab_info, + o, &elf_section_data (o)->sec_info, contents))) + return FALSE; + break; + case ELF_INFO_TYPE_MERGE: + if (! _bfd_write_merged_section (output_bfd, o, + elf_section_data (o)->sec_info)) + return FALSE; + break; + case ELF_INFO_TYPE_EH_FRAME: + { + if (! _bfd_elf_write_section_eh_frame (output_bfd, finfo->info, + o, contents)) + return FALSE; + } + break; + default: + { + bfd_size_type sec_size; + + sec_size = (o->_cooked_size != 0 ? o->_cooked_size : o->_raw_size); + if (! (o->flags & SEC_EXCLUDE) + && ! bfd_set_section_contents (output_bfd, o->output_section, + contents, + (file_ptr) o->output_offset, + sec_size)) + return FALSE; + } + break; + } + } + + return TRUE; +} + +/* Generate a reloc when linking an ELF file. This is a reloc + requested by the linker, and does come from any input file. This + is used to build constructor and destructor tables when linking + with -Ur. */ + +static bfd_boolean +elf_reloc_link_order (bfd *output_bfd, + struct bfd_link_info *info, + asection *output_section, + struct bfd_link_order *link_order) +{ + reloc_howto_type *howto; + long indx; + bfd_vma offset; + bfd_vma addend; + struct elf_link_hash_entry **rel_hash_ptr; + Elf_Internal_Shdr *rel_hdr; + const struct elf_backend_data *bed = get_elf_backend_data (output_bfd); + Elf_Internal_Rela irel[MAX_INT_RELS_PER_EXT_REL]; + bfd_byte *erel; + unsigned int i; + + howto = bfd_reloc_type_lookup (output_bfd, link_order->u.reloc.p->reloc); + if (howto == NULL) + { + bfd_set_error (bfd_error_bad_value); + return FALSE; + } + + addend = link_order->u.reloc.p->addend; + + /* Figure out the symbol index. */ + rel_hash_ptr = (elf_section_data (output_section)->rel_hashes + + elf_section_data (output_section)->rel_count + + elf_section_data (output_section)->rel_count2); + if (link_order->type == bfd_section_reloc_link_order) + { + indx = link_order->u.reloc.p->u.section->target_index; + BFD_ASSERT (indx != 0); + *rel_hash_ptr = NULL; + } + else + { + struct elf_link_hash_entry *h; + + /* Treat a reloc against a defined symbol as though it were + actually against the section. */ + h = ((struct elf_link_hash_entry *) + bfd_wrapped_link_hash_lookup (output_bfd, info, + link_order->u.reloc.p->u.name, + FALSE, FALSE, TRUE)); + if (h != NULL + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak)) + { + asection *section; + + section = h->root.u.def.section; + indx = section->output_section->target_index; + *rel_hash_ptr = NULL; + /* It seems that we ought to add the symbol value to the + addend here, but in practice it has already been added + because it was passed to constructor_callback. */ + addend += section->output_section->vma + section->output_offset; + } + else if (h != NULL) + { + /* Setting the index to -2 tells elf_link_output_extsym that + this symbol is used by a reloc. */ + h->indx = -2; + *rel_hash_ptr = h; + indx = 0; + } + else + { + if (! ((*info->callbacks->unattached_reloc) + (info, link_order->u.reloc.p->u.name, NULL, NULL, 0))) + return FALSE; + indx = 0; + } + } + + /* If this is an inplace reloc, we must write the addend into the + object file. */ + if (howto->partial_inplace && addend != 0) + { + bfd_size_type size; + bfd_reloc_status_type rstat; + bfd_byte *buf; + bfd_boolean ok; + const char *sym_name; + + size = bfd_get_reloc_size (howto); + buf = bfd_zmalloc (size); + if (buf == NULL) + return FALSE; + rstat = _bfd_relocate_contents (howto, output_bfd, addend, buf); + switch (rstat) + { + case bfd_reloc_ok: + break; + + default: + case bfd_reloc_outofrange: + abort (); + + case bfd_reloc_overflow: + if (link_order->type == bfd_section_reloc_link_order) + sym_name = bfd_section_name (output_bfd, + link_order->u.reloc.p->u.section); + else + sym_name = link_order->u.reloc.p->u.name; + if (! ((*info->callbacks->reloc_overflow) + (info, sym_name, howto->name, addend, NULL, NULL, 0))) + { + free (buf); + return FALSE; + } + break; + } + ok = bfd_set_section_contents (output_bfd, output_section, buf, + link_order->offset, size); + free (buf); + if (! ok) + return FALSE; + } + + /* The address of a reloc is relative to the section in a + relocatable file, and is a virtual address in an executable + file. */ + offset = link_order->offset; + if (! info->relocatable) + offset += output_section->vma; + + for (i = 0; i < bed->s->int_rels_per_ext_rel; i++) + { + irel[i].r_offset = offset; + irel[i].r_info = 0; + irel[i].r_addend = 0; + } + if (bed->s->arch_size == 32) + irel[0].r_info = ELF32_R_INFO (indx, howto->type); + else + irel[0].r_info = ELF64_R_INFO (indx, howto->type); + + rel_hdr = &elf_section_data (output_section)->rel_hdr; + erel = rel_hdr->contents; + if (rel_hdr->sh_type == SHT_REL) + { + erel += (elf_section_data (output_section)->rel_count + * bed->s->sizeof_rel); + (*bed->s->swap_reloc_out) (output_bfd, irel, erel); + } + else + { + irel[0].r_addend = addend; + erel += (elf_section_data (output_section)->rel_count + * bed->s->sizeof_rela); + (*bed->s->swap_reloca_out) (output_bfd, irel, erel); + } + + ++elf_section_data (output_section)->rel_count; + + return TRUE; +} + +/* Do the final step of an ELF link. */ + +bfd_boolean +bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info) +{ + bfd_boolean dynamic; + bfd_boolean emit_relocs; + bfd *dynobj; + struct elf_final_link_info finfo; + register asection *o; + register struct bfd_link_order *p; + register bfd *sub; + bfd_size_type max_contents_size; + bfd_size_type max_external_reloc_size; + bfd_size_type max_internal_reloc_count; + bfd_size_type max_sym_count; + bfd_size_type max_sym_shndx_count; + file_ptr off; + Elf_Internal_Sym elfsym; + unsigned int i; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Shdr *symtab_shndx_hdr; + Elf_Internal_Shdr *symstrtab_hdr; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + struct elf_outext_info eoinfo; + bfd_boolean merged; + size_t relativecount = 0; + asection *reldyn = 0; + bfd_size_type amt; + + if (! is_elf_hash_table (info->hash)) + return FALSE; + + if (info->shared) + abfd->flags |= DYNAMIC; + + dynamic = elf_hash_table (info)->dynamic_sections_created; + dynobj = elf_hash_table (info)->dynobj; + + emit_relocs = (info->relocatable + || info->emitrelocations + || bed->elf_backend_emit_relocs); + + finfo.info = info; + finfo.output_bfd = abfd; + finfo.symstrtab = _bfd_elf_stringtab_init (); + if (finfo.symstrtab == NULL) + return FALSE; + + if (! dynamic) + { + finfo.dynsym_sec = NULL; + finfo.hash_sec = NULL; + finfo.symver_sec = NULL; + } + else + { + finfo.dynsym_sec = bfd_get_section_by_name (dynobj, ".dynsym"); + finfo.hash_sec = bfd_get_section_by_name (dynobj, ".hash"); + BFD_ASSERT (finfo.dynsym_sec != NULL && finfo.hash_sec != NULL); + finfo.symver_sec = bfd_get_section_by_name (dynobj, ".gnu.version"); + /* Note that it is OK if symver_sec is NULL. */ + } + + finfo.contents = NULL; + finfo.external_relocs = NULL; + finfo.internal_relocs = NULL; + finfo.external_syms = NULL; + finfo.locsym_shndx = NULL; + finfo.internal_syms = NULL; + finfo.indices = NULL; + finfo.sections = NULL; + finfo.symbuf = NULL; + finfo.symshndxbuf = NULL; + finfo.symbuf_count = 0; + finfo.shndxbuf_size = 0; + + /* Count up the number of relocations we will output for each output + section, so that we know the sizes of the reloc sections. We + also figure out some maximum sizes. */ + max_contents_size = 0; + max_external_reloc_size = 0; + max_internal_reloc_count = 0; + max_sym_count = 0; + max_sym_shndx_count = 0; + merged = FALSE; + for (o = abfd->sections; o != NULL; o = o->next) + { + struct bfd_elf_section_data *esdo = elf_section_data (o); + o->reloc_count = 0; + + for (p = o->link_order_head; p != NULL; p = p->next) + { + unsigned int reloc_count = 0; + struct bfd_elf_section_data *esdi = NULL; + unsigned int *rel_count1; + + if (p->type == bfd_section_reloc_link_order + || p->type == bfd_symbol_reloc_link_order) + reloc_count = 1; + else if (p->type == bfd_indirect_link_order) + { + asection *sec; + + sec = p->u.indirect.section; + esdi = elf_section_data (sec); + + /* Mark all sections which are to be included in the + link. This will normally be every section. We need + to do this so that we can identify any sections which + the linker has decided to not include. */ + sec->linker_mark = TRUE; + + if (sec->flags & SEC_MERGE) + merged = TRUE; + + if (info->relocatable || info->emitrelocations) + reloc_count = sec->reloc_count; + else if (bed->elf_backend_count_relocs) + { + Elf_Internal_Rela * relocs; + + relocs = _bfd_elf_link_read_relocs (abfd, sec, NULL, NULL, + info->keep_memory); + + reloc_count = (*bed->elf_backend_count_relocs) (sec, relocs); + + if (elf_section_data (o)->relocs != relocs) + free (relocs); + } + + if (sec->_raw_size > max_contents_size) + max_contents_size = sec->_raw_size; + if (sec->_cooked_size > max_contents_size) + max_contents_size = sec->_cooked_size; + + /* We are interested in just local symbols, not all + symbols. */ + if (bfd_get_flavour (sec->owner) == bfd_target_elf_flavour + && (sec->owner->flags & DYNAMIC) == 0) + { + size_t sym_count; + + if (elf_bad_symtab (sec->owner)) + sym_count = (elf_tdata (sec->owner)->symtab_hdr.sh_size + / bed->s->sizeof_sym); + else + sym_count = elf_tdata (sec->owner)->symtab_hdr.sh_info; + + if (sym_count > max_sym_count) + max_sym_count = sym_count; + + if (sym_count > max_sym_shndx_count + && elf_symtab_shndx (sec->owner) != 0) + max_sym_shndx_count = sym_count; + + if ((sec->flags & SEC_RELOC) != 0) + { + size_t ext_size; + + ext_size = elf_section_data (sec)->rel_hdr.sh_size; + if (ext_size > max_external_reloc_size) + max_external_reloc_size = ext_size; + if (sec->reloc_count > max_internal_reloc_count) + max_internal_reloc_count = sec->reloc_count; + } + } + } + + if (reloc_count == 0) + continue; + + o->reloc_count += reloc_count; + + /* MIPS may have a mix of REL and RELA relocs on sections. + To support this curious ABI we keep reloc counts in + elf_section_data too. We must be careful to add the + relocations from the input section to the right output + count. FIXME: Get rid of one count. We have + o->reloc_count == esdo->rel_count + esdo->rel_count2. */ + rel_count1 = &esdo->rel_count; + if (esdi != NULL) + { + bfd_boolean same_size; + bfd_size_type entsize1; + + entsize1 = esdi->rel_hdr.sh_entsize; + BFD_ASSERT (entsize1 == bed->s->sizeof_rel + || entsize1 == bed->s->sizeof_rela); + same_size = !o->use_rela_p == (entsize1 == bed->s->sizeof_rel); + + if (!same_size) + rel_count1 = &esdo->rel_count2; + + if (esdi->rel_hdr2 != NULL) + { + bfd_size_type entsize2 = esdi->rel_hdr2->sh_entsize; + unsigned int alt_count; + unsigned int *rel_count2; + + BFD_ASSERT (entsize2 != entsize1 + && (entsize2 == bed->s->sizeof_rel + || entsize2 == bed->s->sizeof_rela)); + + rel_count2 = &esdo->rel_count2; + if (!same_size) + rel_count2 = &esdo->rel_count; + + /* The following is probably too simplistic if the + backend counts output relocs unusually. */ + BFD_ASSERT (bed->elf_backend_count_relocs == NULL); + alt_count = NUM_SHDR_ENTRIES (esdi->rel_hdr2); + *rel_count2 += alt_count; + reloc_count -= alt_count; + } + } + *rel_count1 += reloc_count; + } + + if (o->reloc_count > 0) + o->flags |= SEC_RELOC; + else + { + /* Explicitly clear the SEC_RELOC flag. The linker tends to + set it (this is probably a bug) and if it is set + assign_section_numbers will create a reloc section. */ + o->flags &=~ SEC_RELOC; + } + + /* If the SEC_ALLOC flag is not set, force the section VMA to + zero. This is done in elf_fake_sections as well, but forcing + the VMA to 0 here will ensure that relocs against these + sections are handled correctly. */ + if ((o->flags & SEC_ALLOC) == 0 + && ! o->user_set_vma) + o->vma = 0; + } + + if (! info->relocatable && merged) + elf_link_hash_traverse (elf_hash_table (info), + _bfd_elf_link_sec_merge_syms, abfd); + + /* Figure out the file positions for everything but the symbol table + and the relocs. We set symcount to force assign_section_numbers + to create a symbol table. */ + bfd_get_symcount (abfd) = info->strip == strip_all ? 0 : 1; + BFD_ASSERT (! abfd->output_has_begun); + if (! _bfd_elf_compute_section_file_positions (abfd, info)) + goto error_return; + + /* That created the reloc sections. Set their sizes, and assign + them file positions, and allocate some buffers. */ + for (o = abfd->sections; o != NULL; o = o->next) + { + if ((o->flags & SEC_RELOC) != 0) + { + if (!(_bfd_elf_link_size_reloc_section + (abfd, &elf_section_data (o)->rel_hdr, o))) + goto error_return; + + if (elf_section_data (o)->rel_hdr2 + && !(_bfd_elf_link_size_reloc_section + (abfd, elf_section_data (o)->rel_hdr2, o))) + goto error_return; + } + + /* Now, reset REL_COUNT and REL_COUNT2 so that we can use them + to count upwards while actually outputting the relocations. */ + elf_section_data (o)->rel_count = 0; + elf_section_data (o)->rel_count2 = 0; + } + + _bfd_elf_assign_file_positions_for_relocs (abfd); + + /* We have now assigned file positions for all the sections except + .symtab and .strtab. We start the .symtab section at the current + file position, and write directly to it. We build the .strtab + section in memory. */ + bfd_get_symcount (abfd) = 0; + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + /* sh_name is set in prep_headers. */ + symtab_hdr->sh_type = SHT_SYMTAB; + /* sh_flags, sh_addr and sh_size all start off zero. */ + symtab_hdr->sh_entsize = bed->s->sizeof_sym; + /* sh_link is set in assign_section_numbers. */ + /* sh_info is set below. */ + /* sh_offset is set just below. */ + symtab_hdr->sh_addralign = 1 << bed->s->log_file_align; + + off = elf_tdata (abfd)->next_file_pos; + off = _bfd_elf_assign_file_position_for_section (symtab_hdr, off, TRUE); + + /* Note that at this point elf_tdata (abfd)->next_file_pos is + incorrect. We do not yet know the size of the .symtab section. + We correct next_file_pos below, after we do know the size. */ + + /* Allocate a buffer to hold swapped out symbols. This is to avoid + continuously seeking to the right position in the file. */ + if (! info->keep_memory || max_sym_count < 20) + finfo.symbuf_size = 20; + else + finfo.symbuf_size = max_sym_count; + amt = finfo.symbuf_size; + amt *= bed->s->sizeof_sym; + finfo.symbuf = bfd_malloc (amt); + if (finfo.symbuf == NULL) + goto error_return; + if (elf_numsections (abfd) > SHN_LORESERVE) + { + /* Wild guess at number of output symbols. realloc'd as needed. */ + amt = 2 * max_sym_count + elf_numsections (abfd) + 1000; + finfo.shndxbuf_size = amt; + amt *= sizeof (Elf_External_Sym_Shndx); + finfo.symshndxbuf = bfd_zmalloc (amt); + if (finfo.symshndxbuf == NULL) + goto error_return; + } + + /* Start writing out the symbol table. The first symbol is always a + dummy symbol. */ + if (info->strip != strip_all + || emit_relocs) + { + elfsym.st_value = 0; + elfsym.st_size = 0; + elfsym.st_info = 0; + elfsym.st_other = 0; + elfsym.st_shndx = SHN_UNDEF; + if (! elf_link_output_sym (&finfo, NULL, &elfsym, bfd_und_section_ptr, + NULL)) + goto error_return; + } + +#if 0 + /* Some standard ELF linkers do this, but we don't because it causes + bootstrap comparison failures. */ + /* Output a file symbol for the output file as the second symbol. + We output this even if we are discarding local symbols, although + I'm not sure if this is correct. */ + elfsym.st_value = 0; + elfsym.st_size = 0; + elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_FILE); + elfsym.st_other = 0; + elfsym.st_shndx = SHN_ABS; + if (! elf_link_output_sym (&finfo, bfd_get_filename (abfd), + &elfsym, bfd_abs_section_ptr, NULL)) + goto error_return; +#endif + + /* Output a symbol for each section. We output these even if we are + discarding local symbols, since they are used for relocs. These + symbols have no names. We store the index of each one in the + index field of the section, so that we can find it again when + outputting relocs. */ + if (info->strip != strip_all + || emit_relocs) + { + elfsym.st_size = 0; + elfsym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION); + elfsym.st_other = 0; + for (i = 1; i < elf_numsections (abfd); i++) + { + o = bfd_section_from_elf_index (abfd, i); + if (o != NULL) + o->target_index = bfd_get_symcount (abfd); + elfsym.st_shndx = i; + if (info->relocatable || o == NULL) + elfsym.st_value = 0; + else + elfsym.st_value = o->vma; + if (! elf_link_output_sym (&finfo, NULL, &elfsym, o, NULL)) + goto error_return; + if (i == SHN_LORESERVE - 1) + i += SHN_HIRESERVE + 1 - SHN_LORESERVE; + } + } + + /* Allocate some memory to hold information read in from the input + files. */ + if (max_contents_size != 0) + { + finfo.contents = bfd_malloc (max_contents_size); + if (finfo.contents == NULL) + goto error_return; + } + + if (max_external_reloc_size != 0) + { + finfo.external_relocs = bfd_malloc (max_external_reloc_size); + if (finfo.external_relocs == NULL) + goto error_return; + } + + if (max_internal_reloc_count != 0) + { + amt = max_internal_reloc_count * bed->s->int_rels_per_ext_rel; + amt *= sizeof (Elf_Internal_Rela); + finfo.internal_relocs = bfd_malloc (amt); + if (finfo.internal_relocs == NULL) + goto error_return; + } + + if (max_sym_count != 0) + { + amt = max_sym_count * bed->s->sizeof_sym; + finfo.external_syms = bfd_malloc (amt); + if (finfo.external_syms == NULL) + goto error_return; + + amt = max_sym_count * sizeof (Elf_Internal_Sym); + finfo.internal_syms = bfd_malloc (amt); + if (finfo.internal_syms == NULL) + goto error_return; + + amt = max_sym_count * sizeof (long); + finfo.indices = bfd_malloc (amt); + if (finfo.indices == NULL) + goto error_return; + + amt = max_sym_count * sizeof (asection *); + finfo.sections = bfd_malloc (amt); + if (finfo.sections == NULL) + goto error_return; + } + + if (max_sym_shndx_count != 0) + { + amt = max_sym_shndx_count * sizeof (Elf_External_Sym_Shndx); + finfo.locsym_shndx = bfd_malloc (amt); + if (finfo.locsym_shndx == NULL) + goto error_return; + } + + if (elf_hash_table (info)->tls_sec) + { + bfd_vma base, end = 0; + asection *sec; + + for (sec = elf_hash_table (info)->tls_sec; + sec && (sec->flags & SEC_THREAD_LOCAL); + sec = sec->next) + { + bfd_vma size = sec->_raw_size; + + if (size == 0 && (sec->flags & SEC_HAS_CONTENTS) == 0) + { + struct bfd_link_order *o; + + for (o = sec->link_order_head; o != NULL; o = o->next) + if (size < o->offset + o->size) + size = o->offset + o->size; + } + end = sec->vma + size; + } + base = elf_hash_table (info)->tls_sec->vma; + end = align_power (end, elf_hash_table (info)->tls_sec->alignment_power); + elf_hash_table (info)->tls_size = end - base; + } + + /* Since ELF permits relocations to be against local symbols, we + must have the local symbols available when we do the relocations. + Since we would rather only read the local symbols once, and we + would rather not keep them in memory, we handle all the + relocations for a single input file at the same time. + + Unfortunately, there is no way to know the total number of local + symbols until we have seen all of them, and the local symbol + indices precede the global symbol indices. This means that when + we are generating relocatable output, and we see a reloc against + a global symbol, we can not know the symbol index until we have + finished examining all the local symbols to see which ones we are + going to output. To deal with this, we keep the relocations in + memory, and don't output them until the end of the link. This is + an unfortunate waste of memory, but I don't see a good way around + it. Fortunately, it only happens when performing a relocatable + link, which is not the common case. FIXME: If keep_memory is set + we could write the relocs out and then read them again; I don't + know how bad the memory loss will be. */ + + for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + sub->output_has_begun = FALSE; + for (o = abfd->sections; o != NULL; o = o->next) + { + for (p = o->link_order_head; p != NULL; p = p->next) + { + if (p->type == bfd_indirect_link_order + && (bfd_get_flavour ((sub = p->u.indirect.section->owner)) + == bfd_target_elf_flavour) + && elf_elfheader (sub)->e_ident[EI_CLASS] == bed->s->elfclass) + { + if (! sub->output_has_begun) + { + if (! elf_link_input_bfd (&finfo, sub)) + goto error_return; + sub->output_has_begun = TRUE; + } + } + else if (p->type == bfd_section_reloc_link_order + || p->type == bfd_symbol_reloc_link_order) + { + if (! elf_reloc_link_order (abfd, info, o, p)) + goto error_return; + } + else + { + if (! _bfd_default_link_order (abfd, info, o, p)) + goto error_return; + } + } + } + + /* Output any global symbols that got converted to local in a + version script or due to symbol visibility. We do this in a + separate step since ELF requires all local symbols to appear + prior to any global symbols. FIXME: We should only do this if + some global symbols were, in fact, converted to become local. + FIXME: Will this work correctly with the Irix 5 linker? */ + eoinfo.failed = FALSE; + eoinfo.finfo = &finfo; + eoinfo.localsyms = TRUE; + elf_link_hash_traverse (elf_hash_table (info), elf_link_output_extsym, + &eoinfo); + if (eoinfo.failed) + return FALSE; + + /* That wrote out all the local symbols. Finish up the symbol table + with the global symbols. Even if we want to strip everything we + can, we still need to deal with those global symbols that got + converted to local in a version script. */ + + /* The sh_info field records the index of the first non local symbol. */ + symtab_hdr->sh_info = bfd_get_symcount (abfd); + + if (dynamic + && finfo.dynsym_sec->output_section != bfd_abs_section_ptr) + { + Elf_Internal_Sym sym; + bfd_byte *dynsym = finfo.dynsym_sec->contents; + long last_local = 0; + + /* Write out the section symbols for the output sections. */ + if (info->shared) + { + asection *s; + + sym.st_size = 0; + sym.st_name = 0; + sym.st_info = ELF_ST_INFO (STB_LOCAL, STT_SECTION); + sym.st_other = 0; + + for (s = abfd->sections; s != NULL; s = s->next) + { + int indx; + bfd_byte *dest; + long dynindx; + + indx = elf_section_data (s)->this_idx; + dynindx = elf_section_data (s)->dynindx; + BFD_ASSERT (indx > 0); + sym.st_shndx = indx; + sym.st_value = s->vma; + dest = dynsym + dynindx * bed->s->sizeof_sym; + bed->s->swap_symbol_out (abfd, &sym, dest, 0); + } + + last_local = bfd_count_sections (abfd); + } + + /* Write out the local dynsyms. */ + if (elf_hash_table (info)->dynlocal) + { + struct elf_link_local_dynamic_entry *e; + for (e = elf_hash_table (info)->dynlocal; e ; e = e->next) + { + asection *s; + bfd_byte *dest; + + sym.st_size = e->isym.st_size; + sym.st_other = e->isym.st_other; + + /* Copy the internal symbol as is. + Note that we saved a word of storage and overwrote + the original st_name with the dynstr_index. */ + sym = e->isym; + + if (e->isym.st_shndx != SHN_UNDEF + && (e->isym.st_shndx < SHN_LORESERVE + || e->isym.st_shndx > SHN_HIRESERVE)) + { + s = bfd_section_from_elf_index (e->input_bfd, + e->isym.st_shndx); + + sym.st_shndx = + elf_section_data (s->output_section)->this_idx; + sym.st_value = (s->output_section->vma + + s->output_offset + + e->isym.st_value); + } + + if (last_local < e->dynindx) + last_local = e->dynindx; + + dest = dynsym + e->dynindx * bed->s->sizeof_sym; + bed->s->swap_symbol_out (abfd, &sym, dest, 0); + } + } + + elf_section_data (finfo.dynsym_sec->output_section)->this_hdr.sh_info = + last_local + 1; + } + + /* We get the global symbols from the hash table. */ + eoinfo.failed = FALSE; + eoinfo.localsyms = FALSE; + eoinfo.finfo = &finfo; + elf_link_hash_traverse (elf_hash_table (info), elf_link_output_extsym, + &eoinfo); + if (eoinfo.failed) + return FALSE; + + /* If backend needs to output some symbols not present in the hash + table, do it now. */ + if (bed->elf_backend_output_arch_syms) + { + typedef bfd_boolean (*out_sym_func) + (void *, const char *, Elf_Internal_Sym *, asection *, + struct elf_link_hash_entry *); + + if (! ((*bed->elf_backend_output_arch_syms) + (abfd, info, &finfo, (out_sym_func) elf_link_output_sym))) + return FALSE; + } + + /* Flush all symbols to the file. */ + if (! elf_link_flush_output_syms (&finfo, bed)) + return FALSE; + + /* Now we know the size of the symtab section. */ + off += symtab_hdr->sh_size; + + symtab_shndx_hdr = &elf_tdata (abfd)->symtab_shndx_hdr; + if (symtab_shndx_hdr->sh_name != 0) + { + symtab_shndx_hdr->sh_type = SHT_SYMTAB_SHNDX; + symtab_shndx_hdr->sh_entsize = sizeof (Elf_External_Sym_Shndx); + symtab_shndx_hdr->sh_addralign = sizeof (Elf_External_Sym_Shndx); + amt = bfd_get_symcount (abfd) * sizeof (Elf_External_Sym_Shndx); + symtab_shndx_hdr->sh_size = amt; + + off = _bfd_elf_assign_file_position_for_section (symtab_shndx_hdr, + off, TRUE); + + if (bfd_seek (abfd, symtab_shndx_hdr->sh_offset, SEEK_SET) != 0 + || (bfd_bwrite (finfo.symshndxbuf, amt, abfd) != amt)) + return FALSE; + } + + + /* Finish up and write out the symbol string table (.strtab) + section. */ + symstrtab_hdr = &elf_tdata (abfd)->strtab_hdr; + /* sh_name was set in prep_headers. */ + symstrtab_hdr->sh_type = SHT_STRTAB; + symstrtab_hdr->sh_flags = 0; + symstrtab_hdr->sh_addr = 0; + symstrtab_hdr->sh_size = _bfd_stringtab_size (finfo.symstrtab); + symstrtab_hdr->sh_entsize = 0; + symstrtab_hdr->sh_link = 0; + symstrtab_hdr->sh_info = 0; + /* sh_offset is set just below. */ + symstrtab_hdr->sh_addralign = 1; + + off = _bfd_elf_assign_file_position_for_section (symstrtab_hdr, off, TRUE); + elf_tdata (abfd)->next_file_pos = off; + + if (bfd_get_symcount (abfd) > 0) + { + if (bfd_seek (abfd, symstrtab_hdr->sh_offset, SEEK_SET) != 0 + || ! _bfd_stringtab_emit (abfd, finfo.symstrtab)) + return FALSE; + } + + /* Adjust the relocs to have the correct symbol indices. */ + for (o = abfd->sections; o != NULL; o = o->next) + { + if ((o->flags & SEC_RELOC) == 0) + continue; + + elf_link_adjust_relocs (abfd, &elf_section_data (o)->rel_hdr, + elf_section_data (o)->rel_count, + elf_section_data (o)->rel_hashes); + if (elf_section_data (o)->rel_hdr2 != NULL) + elf_link_adjust_relocs (abfd, elf_section_data (o)->rel_hdr2, + elf_section_data (o)->rel_count2, + (elf_section_data (o)->rel_hashes + + elf_section_data (o)->rel_count)); + + /* Set the reloc_count field to 0 to prevent write_relocs from + trying to swap the relocs out itself. */ + o->reloc_count = 0; + } + + if (dynamic && info->combreloc && dynobj != NULL) + relativecount = elf_link_sort_relocs (abfd, info, &reldyn); + + /* If we are linking against a dynamic object, or generating a + shared library, finish up the dynamic linking information. */ + if (dynamic) + { + bfd_byte *dyncon, *dynconend; + + /* Fix up .dynamic entries. */ + o = bfd_get_section_by_name (dynobj, ".dynamic"); + BFD_ASSERT (o != NULL); + + dyncon = o->contents; + dynconend = o->contents + o->_raw_size; + for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn) + { + Elf_Internal_Dyn dyn; + const char *name; + unsigned int type; + + bed->s->swap_dyn_in (dynobj, dyncon, &dyn); + + switch (dyn.d_tag) + { + default: + continue; + case DT_NULL: + if (relativecount > 0 && dyncon + bed->s->sizeof_dyn < dynconend) + { + switch (elf_section_data (reldyn)->this_hdr.sh_type) + { + case SHT_REL: dyn.d_tag = DT_RELCOUNT; break; + case SHT_RELA: dyn.d_tag = DT_RELACOUNT; break; + default: continue; + } + dyn.d_un.d_val = relativecount; + relativecount = 0; + break; + } + continue; + + case DT_INIT: + name = info->init_function; + goto get_sym; + case DT_FINI: + name = info->fini_function; + get_sym: + { + struct elf_link_hash_entry *h; + + h = elf_link_hash_lookup (elf_hash_table (info), name, + FALSE, FALSE, TRUE); + if (h != NULL + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak)) + { + dyn.d_un.d_val = h->root.u.def.value; + o = h->root.u.def.section; + if (o->output_section != NULL) + dyn.d_un.d_val += (o->output_section->vma + + o->output_offset); + else + { + /* The symbol is imported from another shared + library and does not apply to this one. */ + dyn.d_un.d_val = 0; + } + break; + } + } + continue; + + case DT_PREINIT_ARRAYSZ: + name = ".preinit_array"; + goto get_size; + case DT_INIT_ARRAYSZ: + name = ".init_array"; + goto get_size; + case DT_FINI_ARRAYSZ: + name = ".fini_array"; + get_size: + o = bfd_get_section_by_name (abfd, name); + if (o == NULL) + { + (*_bfd_error_handler) + (_("%s: could not find output section %s"), + bfd_get_filename (abfd), name); + goto error_return; + } + if (o->_raw_size == 0) + (*_bfd_error_handler) + (_("warning: %s section has zero size"), name); + dyn.d_un.d_val = o->_raw_size; + break; + + case DT_PREINIT_ARRAY: + name = ".preinit_array"; + goto get_vma; + case DT_INIT_ARRAY: + name = ".init_array"; + goto get_vma; + case DT_FINI_ARRAY: + name = ".fini_array"; + goto get_vma; + + case DT_HASH: + name = ".hash"; + goto get_vma; + case DT_STRTAB: + name = ".dynstr"; + goto get_vma; + case DT_SYMTAB: + name = ".dynsym"; + goto get_vma; + case DT_VERDEF: + name = ".gnu.version_d"; + goto get_vma; + case DT_VERNEED: + name = ".gnu.version_r"; + goto get_vma; + case DT_VERSYM: + name = ".gnu.version"; + get_vma: + o = bfd_get_section_by_name (abfd, name); + if (o == NULL) + { + (*_bfd_error_handler) + (_("%s: could not find output section %s"), + bfd_get_filename (abfd), name); + goto error_return; + } + dyn.d_un.d_ptr = o->vma; + break; + + case DT_REL: + case DT_RELA: + case DT_RELSZ: + case DT_RELASZ: + if (dyn.d_tag == DT_REL || dyn.d_tag == DT_RELSZ) + type = SHT_REL; + else + type = SHT_RELA; + dyn.d_un.d_val = 0; + for (i = 1; i < elf_numsections (abfd); i++) + { + Elf_Internal_Shdr *hdr; + + hdr = elf_elfsections (abfd)[i]; + if (hdr->sh_type == type + && (hdr->sh_flags & SHF_ALLOC) != 0) + { + if (dyn.d_tag == DT_RELSZ || dyn.d_tag == DT_RELASZ) + dyn.d_un.d_val += hdr->sh_size; + else + { + if (dyn.d_un.d_val == 0 + || hdr->sh_addr < dyn.d_un.d_val) + dyn.d_un.d_val = hdr->sh_addr; + } + } + } + break; + } + bed->s->swap_dyn_out (dynobj, &dyn, dyncon); + } + } + + /* If we have created any dynamic sections, then output them. */ + if (dynobj != NULL) + { + if (! (*bed->elf_backend_finish_dynamic_sections) (abfd, info)) + goto error_return; + + for (o = dynobj->sections; o != NULL; o = o->next) + { + if ((o->flags & SEC_HAS_CONTENTS) == 0 + || o->_raw_size == 0 + || o->output_section == bfd_abs_section_ptr) + continue; + if ((o->flags & SEC_LINKER_CREATED) == 0) + { + /* At this point, we are only interested in sections + created by _bfd_elf_link_create_dynamic_sections. */ + continue; + } + if ((elf_section_data (o->output_section)->this_hdr.sh_type + != SHT_STRTAB) + || strcmp (bfd_get_section_name (abfd, o), ".dynstr") != 0) + { + if (! bfd_set_section_contents (abfd, o->output_section, + o->contents, + (file_ptr) o->output_offset, + o->_raw_size)) + goto error_return; + } + else + { + /* The contents of the .dynstr section are actually in a + stringtab. */ + off = elf_section_data (o->output_section)->this_hdr.sh_offset; + if (bfd_seek (abfd, off, SEEK_SET) != 0 + || ! _bfd_elf_strtab_emit (abfd, + elf_hash_table (info)->dynstr)) + goto error_return; + } + } + } + + if (info->relocatable) + { + bfd_boolean failed = FALSE; + + bfd_map_over_sections (abfd, bfd_elf_set_group_contents, &failed); + if (failed) + goto error_return; + } + + /* If we have optimized stabs strings, output them. */ + if (elf_hash_table (info)->stab_info != NULL) + { + if (! _bfd_write_stab_strings (abfd, &elf_hash_table (info)->stab_info)) + goto error_return; + } + + if (info->eh_frame_hdr) + { + if (! _bfd_elf_write_section_eh_frame_hdr (abfd, info)) + goto error_return; + } + + if (finfo.symstrtab != NULL) + _bfd_stringtab_free (finfo.symstrtab); + if (finfo.contents != NULL) + free (finfo.contents); + if (finfo.external_relocs != NULL) + free (finfo.external_relocs); + if (finfo.internal_relocs != NULL) + free (finfo.internal_relocs); + if (finfo.external_syms != NULL) + free (finfo.external_syms); + if (finfo.locsym_shndx != NULL) + free (finfo.locsym_shndx); + if (finfo.internal_syms != NULL) + free (finfo.internal_syms); + if (finfo.indices != NULL) + free (finfo.indices); + if (finfo.sections != NULL) + free (finfo.sections); + if (finfo.symbuf != NULL) + free (finfo.symbuf); + if (finfo.symshndxbuf != NULL) + free (finfo.symshndxbuf); + for (o = abfd->sections; o != NULL; o = o->next) + { + if ((o->flags & SEC_RELOC) != 0 + && elf_section_data (o)->rel_hashes != NULL) + free (elf_section_data (o)->rel_hashes); + } + + elf_tdata (abfd)->linker = TRUE; + + return TRUE; + + error_return: + if (finfo.symstrtab != NULL) + _bfd_stringtab_free (finfo.symstrtab); + if (finfo.contents != NULL) + free (finfo.contents); + if (finfo.external_relocs != NULL) + free (finfo.external_relocs); + if (finfo.internal_relocs != NULL) + free (finfo.internal_relocs); + if (finfo.external_syms != NULL) + free (finfo.external_syms); + if (finfo.locsym_shndx != NULL) + free (finfo.locsym_shndx); + if (finfo.internal_syms != NULL) + free (finfo.internal_syms); + if (finfo.indices != NULL) + free (finfo.indices); + if (finfo.sections != NULL) + free (finfo.sections); + if (finfo.symbuf != NULL) + free (finfo.symbuf); + if (finfo.symshndxbuf != NULL) + free (finfo.symshndxbuf); + for (o = abfd->sections; o != NULL; o = o->next) + { + if ((o->flags & SEC_RELOC) != 0 + && elf_section_data (o)->rel_hashes != NULL) + free (elf_section_data (o)->rel_hashes); + } + + return FALSE; +} + +/* Garbage collect unused sections. */ + +/* The mark phase of garbage collection. For a given section, mark + it and any sections in this section's group, and all the sections + which define symbols to which it refers. */ + +typedef asection * (*gc_mark_hook_fn) + (asection *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *); + +static bfd_boolean +elf_gc_mark (struct bfd_link_info *info, + asection *sec, + gc_mark_hook_fn gc_mark_hook) +{ + bfd_boolean ret; + asection *group_sec; + + sec->gc_mark = 1; + + /* Mark all the sections in the group. */ + group_sec = elf_section_data (sec)->next_in_group; + if (group_sec && !group_sec->gc_mark) + if (!elf_gc_mark (info, group_sec, gc_mark_hook)) + return FALSE; + + /* Look through the section relocs. */ + ret = TRUE; + if ((sec->flags & SEC_RELOC) != 0 && sec->reloc_count > 0) + { + Elf_Internal_Rela *relstart, *rel, *relend; + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + size_t nlocsyms; + size_t extsymoff; + bfd *input_bfd = sec->owner; + const struct elf_backend_data *bed = get_elf_backend_data (input_bfd); + Elf_Internal_Sym *isym = NULL; + int r_sym_shift; + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + + /* Read the local symbols. */ + if (elf_bad_symtab (input_bfd)) + { + nlocsyms = symtab_hdr->sh_size / bed->s->sizeof_sym; + extsymoff = 0; + } + else + extsymoff = nlocsyms = symtab_hdr->sh_info; + + isym = (Elf_Internal_Sym *) symtab_hdr->contents; + if (isym == NULL && nlocsyms != 0) + { + isym = bfd_elf_get_elf_syms (input_bfd, symtab_hdr, nlocsyms, 0, + NULL, NULL, NULL); + if (isym == NULL) + return FALSE; + } + + /* Read the relocations. */ + relstart = _bfd_elf_link_read_relocs (input_bfd, sec, NULL, NULL, + info->keep_memory); + if (relstart == NULL) + { + ret = FALSE; + goto out1; + } + relend = relstart + sec->reloc_count * bed->s->int_rels_per_ext_rel; + + if (bed->s->arch_size == 32) + r_sym_shift = 8; + else + r_sym_shift = 32; + + for (rel = relstart; rel < relend; rel++) + { + unsigned long r_symndx; + asection *rsec; + struct elf_link_hash_entry *h; + + r_symndx = rel->r_info >> r_sym_shift; + if (r_symndx == 0) + continue; + + if (r_symndx >= nlocsyms + || ELF_ST_BIND (isym[r_symndx].st_info) != STB_LOCAL) + { + h = sym_hashes[r_symndx - extsymoff]; + rsec = (*gc_mark_hook) (sec, info, rel, h, NULL); + } + else + { + rsec = (*gc_mark_hook) (sec, info, rel, NULL, &isym[r_symndx]); + } + + if (rsec && !rsec->gc_mark) + { + if (bfd_get_flavour (rsec->owner) != bfd_target_elf_flavour) + rsec->gc_mark = 1; + else if (!elf_gc_mark (info, rsec, gc_mark_hook)) + { + ret = FALSE; + goto out2; + } + } + } + + out2: + if (elf_section_data (sec)->relocs != relstart) + free (relstart); + out1: + if (isym != NULL && symtab_hdr->contents != (unsigned char *) isym) + { + if (! info->keep_memory) + free (isym); + else + symtab_hdr->contents = (unsigned char *) isym; + } + } + + return ret; +} + +/* Sweep symbols in swept sections. Called via elf_link_hash_traverse. */ + +static bfd_boolean +elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *idxptr) +{ + int *idx = idxptr; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->dynindx != -1 + && ((h->root.type != bfd_link_hash_defined + && h->root.type != bfd_link_hash_defweak) + || h->root.u.def.section->gc_mark)) + h->dynindx = (*idx)++; + + return TRUE; +} + +/* The sweep phase of garbage collection. Remove all garbage sections. */ + +typedef bfd_boolean (*gc_sweep_hook_fn) + (bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *); + +static bfd_boolean +elf_gc_sweep (struct bfd_link_info *info, gc_sweep_hook_fn gc_sweep_hook) +{ + bfd *sub; + + for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + { + asection *o; + + if (bfd_get_flavour (sub) != bfd_target_elf_flavour) + continue; + + for (o = sub->sections; o != NULL; o = o->next) + { + /* Keep special sections. Keep .debug sections. */ + if ((o->flags & SEC_LINKER_CREATED) + || (o->flags & SEC_DEBUGGING)) + o->gc_mark = 1; + + if (o->gc_mark) + continue; + + /* Skip sweeping sections already excluded. */ + if (o->flags & SEC_EXCLUDE) + continue; + + /* Since this is early in the link process, it is simple + to remove a section from the output. */ + o->flags |= SEC_EXCLUDE; + + /* But we also have to update some of the relocation + info we collected before. */ + if (gc_sweep_hook + && (o->flags & SEC_RELOC) && o->reloc_count > 0) + { + Elf_Internal_Rela *internal_relocs; + bfd_boolean r; + + internal_relocs + = _bfd_elf_link_read_relocs (o->owner, o, NULL, NULL, + info->keep_memory); + if (internal_relocs == NULL) + return FALSE; + + r = (*gc_sweep_hook) (o->owner, info, o, internal_relocs); + + if (elf_section_data (o)->relocs != internal_relocs) + free (internal_relocs); + + if (!r) + return FALSE; + } + } + } + + /* Remove the symbols that were in the swept sections from the dynamic + symbol table. GCFIXME: Anyone know how to get them out of the + static symbol table as well? */ + { + int i = 0; + + elf_link_hash_traverse (elf_hash_table (info), elf_gc_sweep_symbol, &i); + + elf_hash_table (info)->dynsymcount = i; + } + + return TRUE; +} + +/* Propagate collected vtable information. This is called through + elf_link_hash_traverse. */ + +static bfd_boolean +elf_gc_propagate_vtable_entries_used (struct elf_link_hash_entry *h, void *okp) +{ + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* Those that are not vtables. */ + if (h->vtable_parent == NULL) + return TRUE; + + /* Those vtables that do not have parents, we cannot merge. */ + if (h->vtable_parent == (struct elf_link_hash_entry *) -1) + return TRUE; + + /* If we've already been done, exit. */ + if (h->vtable_entries_used && h->vtable_entries_used[-1]) + return TRUE; + + /* Make sure the parent's table is up to date. */ + elf_gc_propagate_vtable_entries_used (h->vtable_parent, okp); + + if (h->vtable_entries_used == NULL) + { + /* None of this table's entries were referenced. Re-use the + parent's table. */ + h->vtable_entries_used = h->vtable_parent->vtable_entries_used; + h->vtable_entries_size = h->vtable_parent->vtable_entries_size; + } + else + { + size_t n; + bfd_boolean *cu, *pu; + + /* Or the parent's entries into ours. */ + cu = h->vtable_entries_used; + cu[-1] = TRUE; + pu = h->vtable_parent->vtable_entries_used; + if (pu != NULL) + { + const struct elf_backend_data *bed; + unsigned int log_file_align; + + bed = get_elf_backend_data (h->root.u.def.section->owner); + log_file_align = bed->s->log_file_align; + n = h->vtable_parent->vtable_entries_size >> log_file_align; + while (n--) + { + if (*pu) + *cu = TRUE; + pu++; + cu++; + } + } + } + + return TRUE; +} + +static bfd_boolean +elf_gc_smash_unused_vtentry_relocs (struct elf_link_hash_entry *h, void *okp) +{ + asection *sec; + bfd_vma hstart, hend; + Elf_Internal_Rela *relstart, *relend, *rel; + const struct elf_backend_data *bed; + unsigned int log_file_align; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + /* Take care of both those symbols that do not describe vtables as + well as those that are not loaded. */ + if (h->vtable_parent == NULL) + return TRUE; + + BFD_ASSERT (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak); + + sec = h->root.u.def.section; + hstart = h->root.u.def.value; + hend = hstart + h->size; + + relstart = _bfd_elf_link_read_relocs (sec->owner, sec, NULL, NULL, TRUE); + if (!relstart) + return *(bfd_boolean *) okp = FALSE; + bed = get_elf_backend_data (sec->owner); + log_file_align = bed->s->log_file_align; + + relend = relstart + sec->reloc_count * bed->s->int_rels_per_ext_rel; + + for (rel = relstart; rel < relend; ++rel) + if (rel->r_offset >= hstart && rel->r_offset < hend) + { + /* If the entry is in use, do nothing. */ + if (h->vtable_entries_used + && (rel->r_offset - hstart) < h->vtable_entries_size) + { + bfd_vma entry = (rel->r_offset - hstart) >> log_file_align; + if (h->vtable_entries_used[entry]) + continue; + } + /* Otherwise, kill it. */ + rel->r_offset = rel->r_info = rel->r_addend = 0; + } + + return TRUE; +} + +/* Do mark and sweep of unused sections. */ + +bfd_boolean +bfd_elf_gc_sections (bfd *abfd, struct bfd_link_info *info) +{ + bfd_boolean ok = TRUE; + bfd *sub; + asection * (*gc_mark_hook) + (asection *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *h, Elf_Internal_Sym *); + + if (!get_elf_backend_data (abfd)->can_gc_sections + || info->relocatable + || info->emitrelocations + || !is_elf_hash_table (info->hash) + || elf_hash_table (info)->dynamic_sections_created) + { + (*_bfd_error_handler)(_("Warning: gc-sections option ignored")); + return TRUE; + } + + /* Apply transitive closure to the vtable entry usage info. */ + elf_link_hash_traverse (elf_hash_table (info), + elf_gc_propagate_vtable_entries_used, + &ok); + if (!ok) + return FALSE; + + /* Kill the vtable relocations that were not used. */ + elf_link_hash_traverse (elf_hash_table (info), + elf_gc_smash_unused_vtentry_relocs, + &ok); + if (!ok) + return FALSE; + + /* Grovel through relocs to find out who stays ... */ + + gc_mark_hook = get_elf_backend_data (abfd)->gc_mark_hook; + for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) + { + asection *o; + + if (bfd_get_flavour (sub) != bfd_target_elf_flavour) + continue; + + for (o = sub->sections; o != NULL; o = o->next) + { + if (o->flags & SEC_KEEP) + if (!elf_gc_mark (info, o, gc_mark_hook)) + return FALSE; + } + } + + /* ... and mark SEC_EXCLUDE for those that go. */ + if (!elf_gc_sweep (info, get_elf_backend_data (abfd)->gc_sweep_hook)) + return FALSE; + + return TRUE; +} + +/* Called from check_relocs to record the existence of a VTINHERIT reloc. */ + +bfd_boolean +bfd_elf_gc_record_vtinherit (bfd *abfd, + asection *sec, + struct elf_link_hash_entry *h, + bfd_vma offset) +{ + struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; + struct elf_link_hash_entry **search, *child; + bfd_size_type extsymcount; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + + /* The sh_info field of the symtab header tells us where the + external symbols start. We don't care about the local symbols at + this point. */ + extsymcount = elf_tdata (abfd)->symtab_hdr.sh_size / bed->s->sizeof_sym; + if (!elf_bad_symtab (abfd)) + extsymcount -= elf_tdata (abfd)->symtab_hdr.sh_info; + + sym_hashes = elf_sym_hashes (abfd); + sym_hashes_end = sym_hashes + extsymcount; + + /* Hunt down the child symbol, which is in this section at the same + offset as the relocation. */ + for (search = sym_hashes; search != sym_hashes_end; ++search) + { + if ((child = *search) != NULL + && (child->root.type == bfd_link_hash_defined + || child->root.type == bfd_link_hash_defweak) + && child->root.u.def.section == sec + && child->root.u.def.value == offset) + goto win; + } + + (*_bfd_error_handler) ("%s: %s+%lu: No symbol found for INHERIT", + bfd_archive_filename (abfd), sec->name, + (unsigned long) offset); + bfd_set_error (bfd_error_invalid_operation); + return FALSE; + + win: + if (!h) + { + /* This *should* only be the absolute section. It could potentially + be that someone has defined a non-global vtable though, which + would be bad. It isn't worth paging in the local symbols to be + sure though; that case should simply be handled by the assembler. */ + + child->vtable_parent = (struct elf_link_hash_entry *) -1; + } + else + child->vtable_parent = h; + + return TRUE; +} + +/* Called from check_relocs to record the existence of a VTENTRY reloc. */ + +bfd_boolean +bfd_elf_gc_record_vtentry (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec ATTRIBUTE_UNUSED, + struct elf_link_hash_entry *h, + bfd_vma addend) +{ + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + unsigned int log_file_align = bed->s->log_file_align; + + if (addend >= h->vtable_entries_size) + { + size_t size, bytes, file_align; + bfd_boolean *ptr = h->vtable_entries_used; + + /* While the symbol is undefined, we have to be prepared to handle + a zero size. */ + file_align = 1 << log_file_align; + if (h->root.type == bfd_link_hash_undefined) + size = addend + file_align; + else + { + size = h->size; + if (addend >= size) + { + /* Oops! We've got a reference past the defined end of + the table. This is probably a bug -- shall we warn? */ + size = addend + file_align; + } + } + size = (size + file_align - 1) & -file_align; + + /* Allocate one extra entry for use as a "done" flag for the + consolidation pass. */ + bytes = ((size >> log_file_align) + 1) * sizeof (bfd_boolean); + + if (ptr) + { + ptr = bfd_realloc (ptr - 1, bytes); + + if (ptr != NULL) + { + size_t oldbytes; + + oldbytes = (((h->vtable_entries_size >> log_file_align) + 1) + * sizeof (bfd_boolean)); + memset (((char *) ptr) + oldbytes, 0, bytes - oldbytes); + } + } + else + ptr = bfd_zmalloc (bytes); + + if (ptr == NULL) + return FALSE; + + /* And arrange for that done flag to be at index -1. */ + h->vtable_entries_used = ptr + 1; + h->vtable_entries_size = size; + } + + h->vtable_entries_used[addend >> log_file_align] = TRUE; + + return TRUE; +} + +struct alloc_got_off_arg { + bfd_vma gotoff; + unsigned int got_elt_size; +}; + +/* We need a special top-level link routine to convert got reference counts + to real got offsets. */ + +static bfd_boolean +elf_gc_allocate_got_offsets (struct elf_link_hash_entry *h, void *arg) +{ + struct alloc_got_off_arg *gofarg = arg; + + if (h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if (h->got.refcount > 0) + { + h->got.offset = gofarg->gotoff; + gofarg->gotoff += gofarg->got_elt_size; + } + else + h->got.offset = (bfd_vma) -1; + + return TRUE; +} + +/* And an accompanying bit to work out final got entry offsets once + we're done. Should be called from final_link. */ + +bfd_boolean +bfd_elf_gc_common_finalize_got_offsets (bfd *abfd, + struct bfd_link_info *info) +{ + bfd *i; + const struct elf_backend_data *bed = get_elf_backend_data (abfd); + bfd_vma gotoff; + unsigned int got_elt_size = bed->s->arch_size / 8; + struct alloc_got_off_arg gofarg; + + if (! is_elf_hash_table (info->hash)) + return FALSE; + + /* The GOT offset is relative to the .got section, but the GOT header is + put into the .got.plt section, if the backend uses it. */ + if (bed->want_got_plt) + gotoff = 0; + else + gotoff = bed->got_header_size; + + /* Do the local .got entries first. */ + for (i = info->input_bfds; i; i = i->link_next) + { + bfd_signed_vma *local_got; + bfd_size_type j, locsymcount; + Elf_Internal_Shdr *symtab_hdr; + + if (bfd_get_flavour (i) != bfd_target_elf_flavour) + continue; + + local_got = elf_local_got_refcounts (i); + if (!local_got) + continue; + + symtab_hdr = &elf_tdata (i)->symtab_hdr; + if (elf_bad_symtab (i)) + locsymcount = symtab_hdr->sh_size / bed->s->sizeof_sym; + else + locsymcount = symtab_hdr->sh_info; + + for (j = 0; j < locsymcount; ++j) + { + if (local_got[j] > 0) + { + local_got[j] = gotoff; + gotoff += got_elt_size; + } + else + local_got[j] = (bfd_vma) -1; + } + } + + /* Then the global .got entries. .plt refcounts are handled by + adjust_dynamic_symbol */ + gofarg.gotoff = gotoff; + gofarg.got_elt_size = got_elt_size; + elf_link_hash_traverse (elf_hash_table (info), + elf_gc_allocate_got_offsets, + &gofarg); + return TRUE; +} + +/* Many folk need no more in the way of final link than this, once + got entry reference counting is enabled. */ + +bfd_boolean +bfd_elf_gc_common_final_link (bfd *abfd, struct bfd_link_info *info) +{ + if (!bfd_elf_gc_common_finalize_got_offsets (abfd, info)) + return FALSE; + + /* Invoke the regular ELF backend linker to do all the work. */ + return bfd_elf_final_link (abfd, info); +} + +bfd_boolean +bfd_elf_reloc_symbol_deleted_p (bfd_vma offset, void *cookie) +{ + struct elf_reloc_cookie *rcookie = cookie; + + if (rcookie->bad_symtab) + rcookie->rel = rcookie->rels; + + for (; rcookie->rel < rcookie->relend; rcookie->rel++) + { + unsigned long r_symndx; + + if (! rcookie->bad_symtab) + if (rcookie->rel->r_offset > offset) + return FALSE; + if (rcookie->rel->r_offset != offset) + continue; + + r_symndx = rcookie->rel->r_info >> rcookie->r_sym_shift; + if (r_symndx == SHN_UNDEF) + return TRUE; + + if (r_symndx >= rcookie->locsymcount + || ELF_ST_BIND (rcookie->locsyms[r_symndx].st_info) != STB_LOCAL) + { + struct elf_link_hash_entry *h; + + h = rcookie->sym_hashes[r_symndx - rcookie->extsymoff]; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + if ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && elf_discarded_section (h->root.u.def.section)) + return TRUE; + else + return FALSE; + } + else + { + /* It's not a relocation against a global symbol, + but it could be a relocation against a local + symbol for a discarded section. */ + asection *isec; + Elf_Internal_Sym *isym; + + /* Need to: get the symbol; get the section. */ + isym = &rcookie->locsyms[r_symndx]; + if (isym->st_shndx < SHN_LORESERVE || isym->st_shndx > SHN_HIRESERVE) + { + isec = bfd_section_from_elf_index (rcookie->abfd, isym->st_shndx); + if (isec != NULL && elf_discarded_section (isec)) + return TRUE; + } + } + return FALSE; + } + return FALSE; +} + +/* Discard unneeded references to discarded sections. + Returns TRUE if any section's size was changed. */ +/* This function assumes that the relocations are in sorted order, + which is true for all known assemblers. */ + +bfd_boolean +bfd_elf_discard_info (bfd *output_bfd, struct bfd_link_info *info) +{ + struct elf_reloc_cookie cookie; + asection *stab, *eh; + Elf_Internal_Shdr *symtab_hdr; + const struct elf_backend_data *bed; + bfd *abfd; + unsigned int count; + bfd_boolean ret = FALSE; + + if (info->traditional_format + || !is_elf_hash_table (info->hash)) + return FALSE; + + for (abfd = info->input_bfds; abfd != NULL; abfd = abfd->link_next) + { + if (bfd_get_flavour (abfd) != bfd_target_elf_flavour) + continue; + + bed = get_elf_backend_data (abfd); + + if ((abfd->flags & DYNAMIC) != 0) + continue; + + eh = bfd_get_section_by_name (abfd, ".eh_frame"); + if (info->relocatable + || (eh != NULL + && (eh->_raw_size == 0 + || bfd_is_abs_section (eh->output_section)))) + eh = NULL; + + stab = bfd_get_section_by_name (abfd, ".stab"); + if (stab != NULL + && (stab->_raw_size == 0 + || bfd_is_abs_section (stab->output_section) + || stab->sec_info_type != ELF_INFO_TYPE_STABS)) + stab = NULL; + + if (stab == NULL + && eh == NULL + && bed->elf_backend_discard_info == NULL) + continue; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + cookie.abfd = abfd; + cookie.sym_hashes = elf_sym_hashes (abfd); + cookie.bad_symtab = elf_bad_symtab (abfd); + if (cookie.bad_symtab) + { + cookie.locsymcount = symtab_hdr->sh_size / bed->s->sizeof_sym; + cookie.extsymoff = 0; + } + else + { + cookie.locsymcount = symtab_hdr->sh_info; + cookie.extsymoff = symtab_hdr->sh_info; + } + + if (bed->s->arch_size == 32) + cookie.r_sym_shift = 8; + else + cookie.r_sym_shift = 32; + + cookie.locsyms = (Elf_Internal_Sym *) symtab_hdr->contents; + if (cookie.locsyms == NULL && cookie.locsymcount != 0) + { + cookie.locsyms = bfd_elf_get_elf_syms (abfd, symtab_hdr, + cookie.locsymcount, 0, + NULL, NULL, NULL); + if (cookie.locsyms == NULL) + return FALSE; + } + + if (stab != NULL) + { + cookie.rels = NULL; + count = stab->reloc_count; + if (count != 0) + cookie.rels = _bfd_elf_link_read_relocs (abfd, stab, NULL, NULL, + info->keep_memory); + if (cookie.rels != NULL) + { + cookie.rel = cookie.rels; + cookie.relend = cookie.rels; + cookie.relend += count * bed->s->int_rels_per_ext_rel; + if (_bfd_discard_section_stabs (abfd, stab, + elf_section_data (stab)->sec_info, + bfd_elf_reloc_symbol_deleted_p, + &cookie)) + ret = TRUE; + if (elf_section_data (stab)->relocs != cookie.rels) + free (cookie.rels); + } + } + + if (eh != NULL) + { + cookie.rels = NULL; + count = eh->reloc_count; + if (count != 0) + cookie.rels = _bfd_elf_link_read_relocs (abfd, eh, NULL, NULL, + info->keep_memory); + cookie.rel = cookie.rels; + cookie.relend = cookie.rels; + if (cookie.rels != NULL) + cookie.relend += count * bed->s->int_rels_per_ext_rel; + + if (_bfd_elf_discard_section_eh_frame (abfd, info, eh, + bfd_elf_reloc_symbol_deleted_p, + &cookie)) + ret = TRUE; + + if (cookie.rels != NULL + && elf_section_data (eh)->relocs != cookie.rels) + free (cookie.rels); + } + + if (bed->elf_backend_discard_info != NULL + && (*bed->elf_backend_discard_info) (abfd, &cookie, info)) + ret = TRUE; + + if (cookie.locsyms != NULL + && symtab_hdr->contents != (unsigned char *) cookie.locsyms) + { + if (! info->keep_memory) + free (cookie.locsyms); + else + symtab_hdr->contents = (unsigned char *) cookie.locsyms; + } + } + + if (info->eh_frame_hdr + && !info->relocatable + && _bfd_elf_discard_section_eh_frame_hdr (output_bfd, info)) + ret = TRUE; + + return ret; } diff --git a/contrib/binutils/bfd/elfxx-ia64.c b/contrib/binutils/bfd/elfxx-ia64.c index 06a279e..b19aac2 100644 --- a/contrib/binutils/bfd/elfxx-ia64.c +++ b/contrib/binutils/bfd/elfxx-ia64.c @@ -1,22 +1,23 @@ /* IA-64 support for 64-bit ELF - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. Contributed by David Mosberger-Tang -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" @@ -24,38 +25,36 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf-bfd.h" #include "opcode/ia64.h" #include "elf/ia64.h" +#include "objalloc.h" +#include "hashtab.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 */ +/* 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 require dynamic relocations. */ #define NELEMS(a) ((int) (sizeof (a) / sizeof ((a)[0]))) @@ -83,7 +82,7 @@ struct elfNN_ia64_dyn_sym_info bfd_vma dtpmod_offset; bfd_vma dtprel_offset; - /* The symbol table entry, if any, that this was derrived from. */ + /* The symbol table entry, if any, that this was derived from. */ struct elf_link_hash_entry *h; /* Used to count non-got, non-plt relocations for delayed sizing @@ -94,9 +93,12 @@ struct elfNN_ia64_dyn_sym_info asection *srel; int type; int count; + + /* Is this reloc against readonly section? */ + bfd_boolean reltext; } *reloc_entries; - /* True when the section contents have been updated. */ + /* TRUE when the section contents have been updated. */ unsigned got_done : 1; unsigned fptr_done : 1; unsigned pltoff_done : 1; @@ -104,8 +106,9 @@ struct elfNN_ia64_dyn_sym_info unsigned dtpmod_done : 1; unsigned dtprel_done : 1; - /* True for the different kinds of linker data we want created. */ + /* TRUE for the different kinds of linker data we want created. */ unsigned want_got : 1; + unsigned want_gotx : 1; unsigned want_fptr : 1; unsigned want_ltoff_fptr : 1; unsigned want_plt : 1; @@ -118,20 +121,15 @@ struct elfNN_ia64_dyn_sym_info struct elfNN_ia64_local_hash_entry { - struct bfd_hash_entry root; + int id; + unsigned int r_sym; struct elfNN_ia64_dyn_sym_info *info; - /* True if this hash entry's addends was translated for + /* TRUE if this hash entry's addends was translated for SHF_MERGE optimization. */ unsigned sec_merge_done : 1; }; -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; @@ -140,20 +138,30 @@ struct elfNN_ia64_link_hash_entry struct elfNN_ia64_link_hash_table { - /* The main 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 *rel_fptr_sec; /* dynamic relocation section for same */ 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 */ unsigned reltext : 1; /* are there relocs against readonly sections? */ + unsigned self_dtpmod_done : 1;/* has self DTPMOD entry been finished? */ + bfd_vma self_dtpmod_offset; /* .got offset to self DTPMOD entry */ - struct elfNN_ia64_local_hash_table loc_hash_table; + htab_t loc_hash_table; + void *loc_hash_memory; +}; + +struct elfNN_ia64_allocate_data +{ + struct bfd_link_info *info; + bfd_size_type ofs; }; #define elfNN_ia64_hash_table(p) \ @@ -167,76 +175,66 @@ static reloc_howto_type * lookup_howto 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, arelent *bfd_reloc, Elf_Internal_Rela *elf_reloc)); +static bfd_boolean elfNN_ia64_relax_section PARAMS((bfd *abfd, asection *sec, struct bfd_link_info *link_info, - boolean *again)); -static boolean is_unwind_section_name + bfd_boolean *again)); +static void elfNN_ia64_relax_ldxmov + PARAMS((bfd *abfd, bfd_byte *contents, bfd_vma off)); +static bfd_boolean is_unwind_section_name PARAMS ((bfd *abfd, const char *)); -static boolean elfNN_ia64_section_from_shdr - PARAMS ((bfd *, ElfNN_Internal_Shdr *, const char *)); -static boolean elfNN_ia64_section_flags - PARAMS ((flagword *, ElfNN_Internal_Shdr *)); -static boolean elfNN_ia64_fake_sections - PARAMS ((bfd *abfd, ElfNN_Internal_Shdr *hdr, asection *sec)); +static bfd_boolean elfNN_ia64_section_from_shdr + PARAMS ((bfd *, Elf_Internal_Shdr *, const char *)); +static bfd_boolean elfNN_ia64_section_flags + PARAMS ((flagword *, Elf_Internal_Shdr *)); +static bfd_boolean elfNN_ia64_fake_sections + PARAMS ((bfd *abfd, Elf_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 boolean elfNN_ia64_aix_vec - PARAMS ((const bfd_target *vec)); -static boolean elfNN_ia64_aix_add_symbol_hook - PARAMS ((bfd *abfd, struct bfd_link_info *info, const Elf_Internal_Sym *sym, + PARAMS ((bfd *abfd, bfd_boolean linker)); +static bfd_boolean elfNN_ia64_add_symbol_hook + PARAMS ((bfd *abfd, struct bfd_link_info *info, Elf_Internal_Sym *sym, const char **namep, flagword *flagsp, asection **secp, bfd_vma *valp)); -static boolean elfNN_ia64_aix_link_add_symbols - PARAMS ((bfd *abfd, struct bfd_link_info *info)); static int elfNN_ia64_additional_program_headers PARAMS ((bfd *abfd)); -static boolean elfNN_ia64_modify_segment_map - PARAMS ((bfd *)); -static boolean elfNN_ia64_is_local_label_name +static bfd_boolean elfNN_ia64_modify_segment_map + PARAMS ((bfd *, struct bfd_link_info *)); +static bfd_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 bfd_boolean elfNN_ia64_dynamic_symbol_p + PARAMS ((struct elf_link_hash_entry *h, struct bfd_link_info *info, int)); static struct bfd_hash_entry *elfNN_ia64_new_elf_hash_entry PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table, const char *string)); static void elfNN_ia64_hash_copy_indirect - PARAMS ((struct elf_backend_data *, struct elf_link_hash_entry *, + PARAMS ((const struct elf_backend_data *, struct elf_link_hash_entry *, struct elf_link_hash_entry *)); static void elfNN_ia64_hash_hide_symbol - PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, boolean)); + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *, bfd_boolean)); +static hashval_t elfNN_ia64_local_htab_hash PARAMS ((const void *)); +static int elfNN_ia64_local_htab_eq PARAMS ((const void *ptr1, + const void *ptr2)); static struct bfd_link_hash_table *elfNN_ia64_hash_table_create PARAMS ((bfd *abfd)); -static struct elfNN_ia64_local_hash_entry *elfNN_ia64_local_hash_lookup - PARAMS ((struct elfNN_ia64_local_hash_table *table, const char *string, - boolean create, boolean copy)); -static boolean elfNN_ia64_global_dyn_sym_thunk - PARAMS ((struct bfd_hash_entry *, PTR)); -static boolean elfNN_ia64_local_dyn_sym_thunk +static void elfNN_ia64_hash_table_free + PARAMS ((struct bfd_link_hash_table *hash)); +static bfd_boolean elfNN_ia64_global_dyn_sym_thunk PARAMS ((struct bfd_hash_entry *, PTR)); +static int elfNN_ia64_local_dyn_sym_thunk + PARAMS ((void **, PTR)); static void elfNN_ia64_dyn_sym_traverse PARAMS ((struct elfNN_ia64_link_hash_table *ia64_info, - boolean (*func) (struct elfNN_ia64_dyn_sym_info *, PTR), + bfd_boolean (*func) (struct elfNN_ia64_dyn_sym_info *, PTR), PTR info)); -static boolean elfNN_ia64_create_dynamic_sections +static bfd_boolean elfNN_ia64_create_dynamic_sections PARAMS ((bfd *abfd, struct bfd_link_info *info)); static struct elfNN_ia64_local_hash_entry * get_local_sym_hash PARAMS ((struct elfNN_ia64_link_hash_table *ia64_info, - bfd *abfd, const Elf_Internal_Rela *rel, boolean create)); + bfd *abfd, const Elf_Internal_Rela *rel, bfd_boolean create)); static struct elfNN_ia64_dyn_sym_info * get_dyn_sym_info PARAMS ((struct elfNN_ia64_link_hash_table *ia64_info, struct elf_link_hash_entry *h, - bfd *abfd, const Elf_Internal_Rela *rel, boolean create)); + bfd *abfd, const Elf_Internal_Rela *rel, bfd_boolean create)); static asection *get_got PARAMS ((bfd *abfd, struct bfd_link_info *info, struct elfNN_ia64_link_hash_table *ia64_info)); @@ -248,34 +246,31 @@ static asection *get_pltoff 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 + asection *sec, bfd_boolean create)); +static bfd_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 +static bfd_boolean elfNN_ia64_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *info, struct elf_link_hash_entry *h)); static long global_sym_index PARAMS ((struct elf_link_hash_entry *h)); -static boolean allocate_fptr +static bfd_boolean allocate_fptr PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); -static boolean allocate_global_data_got +static bfd_boolean allocate_global_data_got PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); -static boolean allocate_global_fptr_got +static bfd_boolean allocate_global_fptr_got PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); -static boolean allocate_local_got +static bfd_boolean allocate_local_got PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); -static boolean allocate_pltoff_entries +static bfd_boolean allocate_pltoff_entries PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); -static boolean allocate_plt_entries +static bfd_boolean allocate_plt_entries PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); -static boolean allocate_plt2_entries +static bfd_boolean allocate_plt2_entries PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); -static boolean allocate_dynrel_entries +static bfd_boolean allocate_dynrel_entries PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); -static boolean elfNN_ia64_size_dynamic_sections +static bfd_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)); @@ -294,41 +289,43 @@ static bfd_vma set_fptr_entry 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)); + bfd_vma value, bfd_boolean)); static bfd_vma elfNN_ia64_tprel_base PARAMS ((struct bfd_link_info *info)); static bfd_vma elfNN_ia64_dtprel_base PARAMS ((struct bfd_link_info *info)); static int elfNN_ia64_unwind_entry_compare PARAMS ((const PTR, const PTR)); -static boolean elfNN_ia64_final_link +static bfd_boolean elfNN_ia64_choose_gp + PARAMS ((bfd *abfd, struct bfd_link_info *info)); +static bfd_boolean elfNN_ia64_final_link PARAMS ((bfd *abfd, struct bfd_link_info *info)); -static boolean elfNN_ia64_relocate_section +static bfd_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 +static bfd_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 +static bfd_boolean elfNN_ia64_finish_dynamic_sections PARAMS ((bfd *abfd, struct bfd_link_info *info)); -static boolean elfNN_ia64_set_private_flags +static bfd_boolean elfNN_ia64_set_private_flags PARAMS ((bfd *abfd, flagword flags)); -static boolean elfNN_ia64_merge_private_bfd_data +static bfd_boolean elfNN_ia64_merge_private_bfd_data PARAMS ((bfd *ibfd, bfd *obfd)); -static boolean elfNN_ia64_print_private_bfd_data +static bfd_boolean elfNN_ia64_print_private_bfd_data PARAMS ((bfd *abfd, PTR ptr)); static enum elf_reloc_type_class elfNN_ia64_reloc_type_class PARAMS ((const Elf_Internal_Rela *)); -static boolean elfNN_ia64_hpux_vec +static bfd_boolean elfNN_ia64_hpux_vec PARAMS ((const bfd_target *vec)); static void elfNN_hpux_post_process_headers PARAMS ((bfd *abfd, struct bfd_link_info *info)); -boolean elfNN_hpux_backend_section_from_bfd_section +bfd_boolean elfNN_hpux_backend_section_from_bfd_section PARAMS ((bfd *abfd, asection *sec, int *retval)); -/* ia64-specific relocation */ +/* ia64-specific relocation. */ /* Perform a relocation. Not much to do here as all the hard work is done in elfNN_ia64_final_link_relocate. */ @@ -348,121 +345,125 @@ elfNN_ia64_reloc (abfd, reloc, sym, data, input_section, reloc->address += input_section->output_offset; return bfd_reloc_ok; } + + if (input_section->flags & SEC_DEBUGGING) + return bfd_reloc_continue; + *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) + elfNN_ia64_reloc, NAME, FALSE, 0, -1, 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_FPTR32MSB, "LTOFF_FPTR32MSB", 2, false, true), - IA64_HOWTO (R_IA64_LTOFF_FPTR32LSB, "LTOFF_FPTR32LSB", 2, false, true), - IA64_HOWTO (R_IA64_LTOFF_FPTR64MSB, "LTOFF_FPTR64MSB", 4, false, true), - IA64_HOWTO (R_IA64_LTOFF_FPTR64LSB, "LTOFF_FPTR64LSB", 4, false, true), - - 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_TPREL14, "TPREL14", 0, false, false), - IA64_HOWTO (R_IA64_TPREL22, "TPREL22", 0, false, false), - IA64_HOWTO (R_IA64_TPREL64I, "TPREL64I", 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_TPREL22, "LTOFF_TPREL22", 0, false, false), - - IA64_HOWTO (R_IA64_DTPMOD64MSB, "TPREL64MSB", 8, false, false), - IA64_HOWTO (R_IA64_DTPMOD64LSB, "TPREL64LSB", 8, false, false), - IA64_HOWTO (R_IA64_LTOFF_DTPMOD22, "LTOFF_DTPMOD22", 0, false, false), - - IA64_HOWTO (R_IA64_DTPREL14, "DTPREL14", 0, false, false), - IA64_HOWTO (R_IA64_DTPREL22, "DTPREL22", 0, false, false), - IA64_HOWTO (R_IA64_DTPREL64I, "DTPREL64I", 0, false, false), - IA64_HOWTO (R_IA64_DTPREL32MSB, "DTPREL32MSB", 4, false, false), - IA64_HOWTO (R_IA64_DTPREL32LSB, "DTPREL32LSB", 4, false, false), - IA64_HOWTO (R_IA64_DTPREL64MSB, "DTPREL64MSB", 8, false, false), - IA64_HOWTO (R_IA64_DTPREL64LSB, "DTPREL64LSB", 8, false, false), - IA64_HOWTO (R_IA64_LTOFF_DTPREL22, "LTOFF_DTPREL22", 0, false, false), + 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_FPTR32MSB, "LTOFF_FPTR32MSB", 2, FALSE, TRUE), + IA64_HOWTO (R_IA64_LTOFF_FPTR32LSB, "LTOFF_FPTR32LSB", 2, FALSE, TRUE), + IA64_HOWTO (R_IA64_LTOFF_FPTR64MSB, "LTOFF_FPTR64MSB", 4, FALSE, TRUE), + IA64_HOWTO (R_IA64_LTOFF_FPTR64LSB, "LTOFF_FPTR64LSB", 4, FALSE, TRUE), + + 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_TPREL14, "TPREL14", 0, FALSE, FALSE), + IA64_HOWTO (R_IA64_TPREL22, "TPREL22", 0, FALSE, FALSE), + IA64_HOWTO (R_IA64_TPREL64I, "TPREL64I", 0, FALSE, FALSE), + IA64_HOWTO (R_IA64_TPREL64MSB, "TPREL64MSB", 4, FALSE, FALSE), + IA64_HOWTO (R_IA64_TPREL64LSB, "TPREL64LSB", 4, FALSE, FALSE), + IA64_HOWTO (R_IA64_LTOFF_TPREL22, "LTOFF_TPREL22", 0, FALSE, FALSE), + + IA64_HOWTO (R_IA64_DTPMOD64MSB, "TPREL64MSB", 4, FALSE, FALSE), + IA64_HOWTO (R_IA64_DTPMOD64LSB, "TPREL64LSB", 4, FALSE, FALSE), + IA64_HOWTO (R_IA64_LTOFF_DTPMOD22, "LTOFF_DTPMOD22", 0, FALSE, FALSE), + + IA64_HOWTO (R_IA64_DTPREL14, "DTPREL14", 0, FALSE, FALSE), + IA64_HOWTO (R_IA64_DTPREL22, "DTPREL22", 0, FALSE, FALSE), + IA64_HOWTO (R_IA64_DTPREL64I, "DTPREL64I", 0, FALSE, FALSE), + IA64_HOWTO (R_IA64_DTPREL32MSB, "DTPREL32MSB", 2, FALSE, FALSE), + IA64_HOWTO (R_IA64_DTPREL32LSB, "DTPREL32LSB", 2, FALSE, FALSE), + IA64_HOWTO (R_IA64_DTPREL64MSB, "DTPREL64MSB", 4, FALSE, FALSE), + IA64_HOWTO (R_IA64_DTPREL64LSB, "DTPREL64LSB", 4, FALSE, FALSE), + IA64_HOWTO (R_IA64_LTOFF_DTPREL22, "LTOFF_DTPREL22", 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* +static reloc_howto_type * lookup_howto (rtype) unsigned int rtype; { @@ -601,7 +602,7 @@ static void elfNN_ia64_info_to_howto (abfd, bfd_reloc, elf_reloc) bfd *abfd ATTRIBUTE_UNUSED; arelent *bfd_reloc; - ElfNN_Internal_Rela *elf_reloc; + Elf_Internal_Rela *elf_reloc; { bfd_reloc->howto = lookup_howto ((unsigned int) ELFNN_R_TYPE (elf_reloc->r_info)); @@ -635,7 +636,7 @@ static const bfd_byte plt_min_entry[PLT_MIN_ENTRY_SIZE] = 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 */ + 0x00, 0x41, 0x3c, 0x70, 0x29, 0xc0, /* ld8.acq 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 */ @@ -643,22 +644,14 @@ static const bfd_byte plt_full_entry[PLT_FULL_ENTRY_SIZE] = }; #define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" -#define AIX_DYNAMIC_INTERPRETER "/usr/lib/ia64l64/libc.so.1" -#define DYNAMIC_INTERPRETER(abfd) \ - (elfNN_ia64_aix_vec (abfd->xvec) ? AIX_DYNAMIC_INTERPRETER : ELF_DYNAMIC_INTERPRETER) - -/* Select out of range branch fixup type. Note that Itanium does - not support brl, and so it gets emulated by the kernel. */ -#undef USE_BRL -#ifdef 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 }; -#else + static const bfd_byte oor_ip[48] = { 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */ @@ -671,19 +664,54 @@ static const bfd_byte oor_ip[48] = 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */ 0x60, 0x00, 0x80, 0x00 /* br b6;; */ }; -#endif - -/* 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 size_t oor_branch_size = sizeof (oor_brl); -static boolean +void +bfd_elfNN_ia64_after_parse (int itanium) +{ + oor_branch_size = itanium ? sizeof (oor_ip) : sizeof (oor_brl); +} + +static void +elfNN_ia64_relax_brl (bfd *abfd, bfd_byte *contents, bfd_vma off) +{ + int template; + bfd_byte *hit_addr; + bfd_vma t0, t1, i0, i1, i2; + + hit_addr = (bfd_byte *) (contents + off); + hit_addr -= (long) hit_addr & 0x3; + t0 = bfd_get_64 (abfd, hit_addr); + t1 = bfd_get_64 (abfd, hit_addr + 8); + + /* Keep the instruction in slot 0. */ + i0 = (t0 >> 5) & 0x1ffffffffffLL; + /* Use nop.b for slot 1. */ + i1 = 0x4000000000LL; + /* For slot 2, turn brl into br by masking out bit 40. */ + i2 = (t1 >> 23) & 0x0ffffffffffLL; + + /* Turn a MLX bundle into a MBB bundle with the same stop-bit + variety. */ + template = 0x12; + if ((t0 & 0x1fLL) == 5) + template += 1; + t0 = (i1 << 46) | (i0 << 5) | template; + t1 = (i2 << 23) | (i1 >> 18); + + bfd_put_64 (abfd, t0, hit_addr); + bfd_put_64 (abfd, t1, hit_addr + 8); +} + +/* These functions do relaxation for IA-64 ELF. */ + +static bfd_boolean elfNN_ia64_relax_section (abfd, sec, link_info, again) bfd *abfd; asection *sec; struct bfd_link_info *link_info; - boolean *again; + bfd_boolean *again; { struct one_fixup { @@ -700,17 +728,26 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) Elf_Internal_Sym *isymbuf = NULL; struct elfNN_ia64_link_hash_table *ia64_info; struct one_fixup *fixups = NULL; - boolean changed_contents = false; - boolean changed_relocs = false; + bfd_boolean changed_contents = FALSE; + bfd_boolean changed_relocs = FALSE; + bfd_boolean changed_got = FALSE; + bfd_vma gp = 0; /* Assume we're not going to change any sizes, and we'll only need one pass. */ - *again = false; + *again = FALSE; + + /* Don't even try to relax for non-ELF outputs. */ + if (!is_elf_hash_table (link_info->hash)) + return FALSE; - /* Nothing to do if there are no relocations. */ + /* Nothing to do if there are no relocations or there is no need for + the relax finalize pass. */ if ((sec->flags & SEC_RELOC) == 0 - || sec->reloc_count == 0) - return true; + || sec->reloc_count == 0 + || (!link_info->need_relax_finalize + && sec->need_finalize_relax == 0)) + return TRUE; /* If this is the first time we have been called for this section, initialize the cooked size. */ @@ -720,27 +757,15 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) symtab_hdr = &elf_tdata (abfd)->symtab_hdr; /* Load the relocations for this section. */ - internal_relocs = (_bfd_elfNN_link_read_relocs + internal_relocs = (_bfd_elf_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory)); if (internal_relocs == NULL) - return false; + return FALSE; 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 (elf_section_data (sec)->relocs != internal_relocs) - free (internal_relocs); - return true; - } - /* Get the section contents. */ if (elf_section_data (sec)->this_hdr.contents != NULL) contents = elf_section_data (sec)->this_hdr.contents; @@ -755,15 +780,57 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) goto error_return; } - for (; irel < irelend; irel++) + for (irel = internal_relocs; irel < irelend; irel++) { + unsigned long r_type = ELFNN_R_TYPE (irel->r_info); bfd_vma symaddr, reladdr, trampoff, toff, roff; asection *tsec; struct one_fixup *f; bfd_size_type amt; + bfd_boolean is_branch; + struct elfNN_ia64_dyn_sym_info *dyn_i; - if (ELFNN_R_TYPE (irel->r_info) != (int) R_IA64_PCREL21B) - continue; + switch (r_type) + { + case R_IA64_PCREL21B: + case R_IA64_PCREL21BI: + case R_IA64_PCREL21M: + case R_IA64_PCREL21F: + /* In the finalize pass, all br relaxations are done. We can + skip it. */ + if (!link_info->need_relax_finalize) + continue; + is_branch = TRUE; + break; + + case R_IA64_PCREL60B: + /* We can't optimize brl to br before the finalize pass since + br relaxations will increase the code size. Defer it to + the finalize pass. */ + if (link_info->need_relax_finalize) + { + sec->need_finalize_relax = 1; + continue; + } + is_branch = TRUE; + break; + + case R_IA64_LTOFF22X: + case R_IA64_LDXMOV: + /* We can't relax ldx/mov before the finalize pass since + br relaxations will increase the code size. Defer it to + the finalize pass. */ + if (link_info->need_relax_finalize) + { + sec->need_finalize_relax = 1; + continue; + } + is_branch = FALSE; + break; + + default: + continue; + } /* Get the value of the symbol referred to by the reloc. */ if (ELFNN_R_SYM (irel->r_info) < symtab_hdr->sh_info) @@ -783,9 +850,9 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) goto error_return; } - isym = isymbuf + ELF64_R_SYM (irel->r_info); + isym = isymbuf + ELFNN_R_SYM (irel->r_info); if (isym->st_shndx == SHN_UNDEF) - continue; /* We can't do anthing with undefined symbols. */ + continue; /* We can't do anything with undefined symbols. */ else if (isym->st_shndx == SHN_ABS) tsec = bfd_abs_section_ptr; else if (isym->st_shndx == SHN_COMMON) @@ -796,12 +863,12 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) tsec = bfd_section_from_elf_index (abfd, isym->st_shndx); toff = isym->st_value; + dyn_i = get_dyn_sym_info (ia64_info, NULL, abfd, irel, FALSE); } 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]; @@ -811,18 +878,29 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) || 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); + 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) + if (is_branch && dyn_i && dyn_i->want_plt2) { + /* Internal branches shouldn't be sent to the PLT. + Leave this for now and we'll give an error later. */ + if (r_type != R_IA64_PCREL21B) + continue; + tsec = ia64_info->plt_sec; toff = dyn_i->plt2_offset; + BFD_ASSERT (irel->r_addend == 0); } + + /* Can't do anything else with dynamic symbols. */ + else if (elfNN_ia64_dynamic_symbol_p (h, link_info, r_type)) + continue; + else { - /* We can't do anthing with undefined symbols. */ + /* We can't do anything with undefined symbols. */ if (h->root.type == bfd_link_hash_undefined || h->root.type == bfd_link_hash_undefweak) continue; @@ -832,109 +910,193 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) } } - symaddr = (tsec->output_section->vma - + tsec->output_offset - + toff - + irel->r_addend); + if (tsec->sec_info_type == ELF_INFO_TYPE_MERGE) + toff = _bfd_merged_section_offset (abfd, &tsec, + elf_section_data (tsec)->sec_info, + toff + irel->r_addend, + (bfd_vma) 0); + else + toff += irel->r_addend; + + symaddr = tsec->output_section->vma + tsec->output_offset + toff; roff = irel->r_offset; - reladdr = (sec->output_section->vma - + sec->output_offset - + roff) & (bfd_vma) -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 (is_branch) + { + bfd_signed_vma offset; - /* 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; + reladdr = (sec->output_section->vma + + sec->output_offset + + roff) & (bfd_vma) -4; - /* Look for an existing fixup to this address. */ - for (f = fixups; f ; f = f->next) - if (f->tsec == tsec && f->toff == toff) - break; + /* If the branch is in range, no need to do anything. */ + if ((bfd_signed_vma) (symaddr - reladdr) >= -0x1000000 + && (bfd_signed_vma) (symaddr - reladdr) <= 0x0FFFFF0) + { + /* If the 60-bit branch is in 21-bit range, optimize it. */ + if (r_type == R_IA64_PCREL60B) + { + elfNN_ia64_relax_brl (abfd, contents, roff); - 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. */ + irel->r_info + = ELF64_R_INFO (ELF64_R_SYM (irel->r_info), + R_IA64_PCREL21B); - size_t size; + /* If the original relocation offset points to slot + 1, change it to slot 2. */ + if ((irel->r_offset & 3) == 1) + irel->r_offset += 1; + } - 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 + continue; } + else if (r_type == R_IA64_PCREL60B) + continue; - /* Resize the current section to make room for the new branch. */ - trampoff = (sec->_cooked_size + 15) & (bfd_vma) -16; - amt = trampoff + size; - contents = (bfd_byte *) bfd_realloc (contents, amt); - if (contents == NULL) - goto error_return; - sec->_cooked_size = amt; + /* 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 (tsec == ia64_info->plt_sec) + if (f == NULL) { - memcpy (contents + trampoff, plt_full_entry, size); + /* 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. */ - /* 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; + size_t size; + + if (tsec == ia64_info->plt_sec) + size = sizeof (plt_full_entry); + else + size = oor_branch_size; + + /* Resize the current section to make room for the new branch. */ + trampoff = (sec->_cooked_size + 15) & (bfd_vma) -16; + + /* If trampoline is out of range, there is nothing we + can do. */ + offset = trampoff - (roff & (bfd_vma) -4); + if (offset < -0x1000000 || offset > 0x0FFFFF0) + continue; + + amt = trampoff + size; + contents = (bfd_byte *) bfd_realloc (contents, amt); + if (contents == NULL) + goto error_return; + sec->_cooked_size = amt; + + 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 + { + if (size == sizeof (oor_ip)) + { + 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; + } + else + { + 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; + } + + } + + /* Record the fixup so we don't do it again this section. */ + f = (struct one_fixup *) + bfd_malloc ((bfd_size_type) sizeof (*f)); + f->next = fixups; + f->tsec = tsec; + f->toff = toff; + f->trampoff = trampoff; + fixups = f; } 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 + /* If trampoline is out of range, there is nothing we + can do. */ + offset = f->trampoff - (roff & (bfd_vma) -4); + if (offset < -0x1000000 || offset > 0x0FFFFF0) + continue; + + /* Nop out the reloc, since we're finalizing things here. */ + irel->r_info = ELFNN_R_INFO (0, R_IA64_NONE); } - /* Record the fixup so we don't do it again this section. */ - f = (struct one_fixup *) bfd_malloc ((bfd_size_type) sizeof (*f)); - f->next = fixups; - f->tsec = tsec; - f->toff = toff; - f->trampoff = trampoff; - fixups = f; + /* Fix up the existing branch to hit the trampoline. */ + if (elfNN_ia64_install_value (abfd, contents + roff, offset, + r_type) != bfd_reloc_ok) + goto error_return; + + changed_contents = TRUE; + changed_relocs = TRUE; } else { - /* Nop out the reloc, since we're finalizing things here. */ - irel->r_info = ELFNN_R_INFO (0, R_IA64_NONE); - } + /* Fetch the gp. */ + if (gp == 0) + { + bfd *obfd = sec->output_section->owner; + gp = _bfd_get_gp_value (obfd); + if (gp == 0) + { + if (!elfNN_ia64_choose_gp (obfd, link_info)) + goto error_return; + gp = _bfd_get_gp_value (obfd); + } + } - /* 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 & (bfd_vma) -4), - R_IA64_PCREL21B) != bfd_reloc_ok) - goto error_return; + /* If the data is out of range, do nothing. */ + if ((bfd_signed_vma) (symaddr - gp) >= 0x200000 + ||(bfd_signed_vma) (symaddr - gp) < -0x200000) + continue; - changed_contents = true; - changed_relocs = true; + if (r_type == R_IA64_LTOFF22X) + { + irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info), + R_IA64_GPREL22); + changed_relocs = TRUE; + if (dyn_i->want_gotx) + { + dyn_i->want_gotx = 0; + changed_got |= !dyn_i->want_got; + } + } + else + { + elfNN_ia64_relax_ldxmov (abfd, contents, roff); + irel->r_info = ELFNN_R_INFO (0, R_IA64_NONE); + changed_contents = TRUE; + changed_relocs = TRUE; + } + } } + /* ??? If we created fixups, this may push the code segment large + enough that the data segment moves, which will change the GP. + Reset the GP so that we re-calculate next round. We need to + do this at the _beginning_ of the next round; now will not do. */ + /* Clean up and go home. */ while (fixups) { @@ -975,8 +1137,27 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) elf_section_data (sec)->relocs = internal_relocs; } + if (changed_got) + { + struct elfNN_ia64_allocate_data data; + data.info = link_info; + data.ofs = 0; + ia64_info->self_dtpmod_offset = (bfd_vma) -1; + + 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; + ia64_info->got_sec->_cooked_size = data.ofs; + + /* ??? Resize .rela.got too. */ + } + + if (!link_info->need_relax_finalize) + sec->need_finalize_relax = 0; + *again = changed_contents || changed_relocs; - return true; + return TRUE; error_return: if (isymbuf != NULL && (unsigned char *) isymbuf != symtab_hdr->contents) @@ -987,12 +1168,45 @@ elfNN_ia64_relax_section (abfd, sec, link_info, again) if (internal_relocs != NULL && elf_section_data (sec)->relocs != internal_relocs) free (internal_relocs); - return false; + return FALSE; +} + +static void +elfNN_ia64_relax_ldxmov (abfd, contents, off) + bfd *abfd; + bfd_byte *contents; + bfd_vma off; +{ + int shift, r1, r3; + bfd_vma dword, insn; + + switch ((int)off & 0x3) + { + case 0: shift = 5; break; + case 1: shift = 14; off += 3; break; + case 2: shift = 23; off += 6; break; + default: + abort (); + } + + dword = bfd_get_64 (abfd, contents + off); + insn = (dword >> shift) & 0x1ffffffffffLL; + + r1 = (insn >> 6) & 127; + r3 = (insn >> 20) & 127; + if (r1 == r3) + insn = 0x8000000; /* nop */ + else + insn = (insn & 0x7f01fff) | 0x10800000000LL; /* (qp) mov r1 = r3 */ + + dword &= ~(0x1ffffffffffLL << shift); + dword |= (insn << shift); + bfd_put_64 (abfd, dword, contents + off); } -/* Return true if NAME is an unwind table section name. */ +/* Return TRUE if NAME is an unwind table section name. */ -static inline boolean +static inline bfd_boolean is_unwind_section_name (abfd, name) bfd *abfd; const char *name; @@ -1001,7 +1215,7 @@ is_unwind_section_name (abfd, name) if (elfNN_ia64_hpux_vec (abfd->xvec) && !strcmp (name, ELF_STRING_ia64_unwind_hdr)) - return false; + return FALSE; len1 = sizeof (ELF_STRING_ia64_unwind) - 1; len2 = sizeof (ELF_STRING_ia64_unwind_info) - 1; @@ -1014,10 +1228,10 @@ is_unwind_section_name (abfd, name) /* 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 +static bfd_boolean elfNN_ia64_section_from_shdr (abfd, hdr, name) bfd *abfd; - ElfNN_Internal_Shdr *hdr; + Elf_Internal_Shdr *hdr; const char *name; { asection *newsect; @@ -1035,18 +1249,18 @@ elfNN_ia64_section_from_shdr (abfd, hdr, name) case SHT_IA_64_EXT: if (strcmp (name, ELF_STRING_ia64_archext) != 0) - return false; + return FALSE; break; default: - return false; + return FALSE; } if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) - return false; + return FALSE; newsect = hdr->bfd_section; - return true; + return TRUE; } /* Convert IA-64 specific section flags to bfd internal section flags. */ @@ -1054,24 +1268,24 @@ elfNN_ia64_section_from_shdr (abfd, hdr, name) /* ??? There is no bfd internal flag equivalent to the SHF_IA_64_NORECOV flag. */ -static boolean +static bfd_boolean elfNN_ia64_section_flags (flags, hdr) flagword *flags; - ElfNN_Internal_Shdr *hdr; + Elf_Internal_Shdr *hdr; { if (hdr->sh_flags & SHF_IA_64_SHORT) *flags |= SEC_SMALL_DATA; - return true; + 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 +static bfd_boolean elfNN_ia64_fake_sections (abfd, hdr, sec) bfd *abfd ATTRIBUTE_UNUSED; - ElfNN_Internal_Shdr *hdr; + Elf_Internal_Shdr *hdr; asection *sec; { register const char *name; @@ -1090,30 +1304,28 @@ elfNN_ia64_fake_sections (abfd, hdr, sec) else if (strcmp (name, ".HP.opt_annot") == 0) hdr->sh_type = SHT_IA_64_HP_OPT_ANOT; else if (strcmp (name, ".reloc") == 0) - /* - * This is an ugly, but unfortunately necessary hack that is - * 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. - */ + /* 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; + return TRUE; } /* The final processing done just before writing out an IA-64 ELF @@ -1122,7 +1334,7 @@ elfNN_ia64_fake_sections (abfd, hdr, sec) static void elfNN_ia64_final_write_processing (abfd, linker) bfd *abfd; - boolean linker ATTRIBUTE_UNUSED; + bfd_boolean linker ATTRIBUTE_UNUSED; { Elf_Internal_Shdr *hdr; const char *sname; @@ -1196,23 +1408,36 @@ elfNN_ia64_final_write_processing (abfd, linker) break; } } + + if (! elf_flags_init (abfd)) + { + unsigned long flags = 0; + + if (abfd->xvec->byteorder == BFD_ENDIAN_BIG) + flags |= EF_IA_64_BE; + if (bfd_get_mach (abfd) == bfd_mach_ia64_elf64) + flags |= EF_IA_64_ABI64; + + elf_elfheader(abfd)->e_flags = flags; + elf_flags_init (abfd) = TRUE; + } } /* 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 +static bfd_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; + 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 + && !info->relocatable && sym->st_size <= elf_gp_size (abfd)) { /* Common symbols less than or equal to -G nn bytes are @@ -1227,122 +1452,14 @@ elfNN_ia64_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) || !bfd_set_section_flags (abfd, scomm, (SEC_ALLOC | SEC_IS_COMMON | SEC_LINKER_CREATED))) - return false; + return FALSE; } *secp = scomm; *valp = sym->st_size; } - return true; -} - -static boolean -elfNN_ia64_aix_vec (const bfd_target *vec) -{ - extern const bfd_target bfd_elfNN_ia64_aix_little_vec; - extern const bfd_target bfd_elfNN_ia64_aix_big_vec; - - return (/**/vec == & bfd_elfNN_ia64_aix_little_vec - || vec == & bfd_elfNN_ia64_aix_big_vec); -} - -/* Hook called by the linker routine which adds symbols from an object - file. We use it to handle OS-specific symbols. */ - -static boolean -elfNN_ia64_aix_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) - bfd *abfd; - struct bfd_link_info *info; - const Elf_Internal_Sym *sym; - const char **namep; - flagword *flagsp; - asection **secp; - bfd_vma *valp; -{ - if (strcmp (*namep, "__GLOB_DATA_PTR") == 0) - { - /* Define __GLOB_DATA_PTR when it is encountered. This is expected to - be a linker-defined symbol by the Aix C runtime startup code. IBM sez - no one else should use it b/c it is undocumented. */ - struct elf_link_hash_entry *h; - - h = elf_link_hash_lookup (elf_hash_table (info), *namep, - false, false, false); - if (h == NULL) - { - struct elf_backend_data *bed; - struct elfNN_ia64_link_hash_table *ia64_info; - struct bfd_link_hash_entry *bh = NULL; - - bed = get_elf_backend_data (abfd); - ia64_info = elfNN_ia64_hash_table (info); - - if (!(_bfd_generic_link_add_one_symbol - (info, abfd, *namep, BSF_GLOBAL, - bfd_get_section_by_name (abfd, ".bss"), - bed->got_symbol_offset, (const char *) NULL, false, - bed->collect, &bh))) - return false; - - h = (struct elf_link_hash_entry *) bh; - h->elf_link_hash_flags |= ELF_LINK_HASH_DEF_REGULAR; - h->type = STT_OBJECT; - - if (! _bfd_elf_link_record_dynamic_symbol (info, h)) - return false; - } - - return true; - } - else if (sym->st_shndx == SHN_LOOS) - { - unsigned int i; - - /* SHN_AIX_SYSCALL: Treat this as any other symbol. The special symbol - is only relevant when compiling code for extended system calls. - Replace the "special" section with .text, if possible. - Note that these symbols are always assumed to be in .text. */ - for (i = 1; i < elf_numsections (abfd); i++) - { - asection * sec = bfd_section_from_elf_index (abfd, i); - - if (sec && strcmp (sec->name, ".text") == 0) - { - *secp = sec; - break; - } - } - - if (*secp == NULL) - *secp = bfd_abs_section_ptr; - - *valp = sym->st_size; - - return true; - } - else - { - return elfNN_ia64_add_symbol_hook (abfd, info, sym, - namep, flagsp, secp, valp); - } -} - -boolean -elfNN_ia64_aix_link_add_symbols (abfd, info) - bfd *abfd; - struct bfd_link_info *info; -{ - /* Make sure dynamic sections are always created. */ - if (! elf_hash_table (info)->dynamic_sections_created - && abfd->xvec == info->hash->creator) - { - if (! bfd_elfNN_link_create_dynamic_sections (abfd, info)) - return false; - } - - /* Now do the standard call. */ - return bfd_elfNN_bfd_link_add_symbols (abfd, info); + return TRUE; } /* Return the number of additional phdrs we will need. */ @@ -1367,9 +1484,10 @@ elfNN_ia64_additional_program_headers (abfd) return ret; } -static boolean -elfNN_ia64_modify_segment_map (abfd) +static bfd_boolean +elfNN_ia64_modify_segment_map (abfd, info) bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; { struct elf_segment_map *m, **pm; Elf_Internal_Shdr *hdr; @@ -1388,7 +1506,7 @@ elfNN_ia64_modify_segment_map (abfd) m = ((struct elf_segment_map *) bfd_zalloc (abfd, (bfd_size_type) sizeof *m)); if (m == NULL) - return false; + return FALSE; m->p_type = PT_IA_64_ARCHEXT; m->count = 1; @@ -1436,7 +1554,7 @@ elfNN_ia64_modify_segment_map (abfd) m = ((struct elf_segment_map *) bfd_zalloc (abfd, (bfd_size_type) sizeof *m)); if (m == NULL) - return false; + return FALSE; m->p_type = PT_IA_64_UNWIND; m->count = 1; @@ -1480,13 +1598,13 @@ elfNN_ia64_modify_segment_map (abfd) found:; } - return true; + return TRUE; } /* According to the Tahoe assembler spec, all labels starting with a '.' are local. */ -static boolean +static bfd_boolean elfNN_ia64_is_local_label_name (abfd, name) bfd *abfd ATTRIBUTE_UNUSED; const char *name; @@ -1496,78 +1614,19 @@ elfNN_ia64_is_local_label_name (abfd, name) /* Should we do dynamic things to this symbol? */ -static boolean -elfNN_ia64_dynamic_symbol_p (h, info) +static bfd_boolean +elfNN_ia64_dynamic_symbol_p (h, info, r_type) struct elf_link_hash_entry *h; struct bfd_link_info *info; + int r_type; { - 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; - switch (ELF_ST_VISIBILITY (h->other)) - { - case STV_INTERNAL: - case STV_HIDDEN: - return false; - } - - if (h->root.type == bfd_link_hash_undefweak - || h->root.type == bfd_link_hash_defweak) - return true; + bfd_boolean ignore_protected + = ((r_type & 0xf8) == 0x40 /* FPTR relocs */ + || (r_type & 0xf8) == 0x50); /* LTOFF_FPTR relocs */ - if ((info->shared && (!info->symbolic || info->allow_shlib_undefined)) - || ((h->elf_link_hash_flags - & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR)) - == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))) - return true; - - return false; + return _bfd_elf_dynamic_symbol_p (h, info, ignore_protected); } -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; @@ -1599,7 +1658,7 @@ elfNN_ia64_new_elf_hash_entry (entry, table, string) static void elfNN_ia64_hash_copy_indirect (bed, xdir, xind) - struct elf_backend_data *bed ATTRIBUTE_UNUSED; + const struct elf_backend_data *bed ATTRIBUTE_UNUSED; struct elf_link_hash_entry *xdir, *xind; { struct elfNN_ia64_link_hash_entry *dir, *ind; @@ -1614,7 +1673,8 @@ elfNN_ia64_hash_copy_indirect (bed, xdir, xind) (ind->root.elf_link_hash_flags & (ELF_LINK_HASH_REF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR - | ELF_LINK_HASH_REF_REGULAR_NONWEAK)); + | ELF_LINK_HASH_REF_REGULAR_NONWEAK + | ELF_LINK_HASH_NEEDS_PLT)); if (ind->root.root.type != bfd_link_hash_indirect) return; @@ -1651,7 +1711,7 @@ static void elfNN_ia64_hash_hide_symbol (info, xh, force_local) struct bfd_link_info *info; struct elf_link_hash_entry *xh; - boolean force_local; + bfd_boolean force_local; { struct elfNN_ia64_link_hash_entry *h; struct elfNN_ia64_dyn_sym_info *dyn_i; @@ -1661,7 +1721,37 @@ elfNN_ia64_hash_hide_symbol (info, xh, force_local) _bfd_elf_link_hash_hide_symbol (info, &h->root, force_local); for (dyn_i = h->info; dyn_i; dyn_i = dyn_i->next) - dyn_i->want_plt2 = 0; + { + dyn_i->want_plt2 = 0; + dyn_i->want_plt = 0; + } +} + +/* Compute a hash of a local hash entry. */ + +static hashval_t +elfNN_ia64_local_htab_hash (ptr) + const void *ptr; +{ + struct elfNN_ia64_local_hash_entry *entry + = (struct elfNN_ia64_local_hash_entry *) ptr; + + return (((entry->id & 0xff) << 24) | ((entry->id & 0xff00) << 8)) + ^ entry->r_sym ^ (entry->id >> 16); +} + +/* Compare local hash entries. */ + +static int +elfNN_ia64_local_htab_eq (ptr1, ptr2) + const void *ptr1, *ptr2; +{ + struct elfNN_ia64_local_hash_entry *entry1 + = (struct elfNN_ia64_local_hash_entry *) ptr1; + struct elfNN_ia64_local_hash_entry *entry2 + = (struct elfNN_ia64_local_hash_entry *) ptr2; + + return entry1->id == entry2->id && entry1->r_sym == entry2->r_sym; } /* Create the derived linker hash table. The IA-64 ELF port uses this @@ -1674,43 +1764,53 @@ elfNN_ia64_hash_table_create (abfd) { struct elfNN_ia64_link_hash_table *ret; - ret = bfd_zalloc (abfd, (bfd_size_type) sizeof (*ret)); + ret = bfd_zmalloc ((bfd_size_type) 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); + free (ret); + return 0; + } + + ret->loc_hash_table = htab_try_create (1024, elfNN_ia64_local_htab_hash, + elfNN_ia64_local_htab_eq, NULL); + ret->loc_hash_memory = objalloc_create (); + if (!ret->loc_hash_table || !ret->loc_hash_memory) + { + free (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. */ +/* Destroy IA-64 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; +static void +elfNN_ia64_hash_table_free (hash) + struct bfd_link_hash_table *hash; { - return ((struct elfNN_ia64_local_hash_entry *) - bfd_hash_lookup (&table->root, string, create, copy)); + struct elfNN_ia64_link_hash_table *ia64_info + = (struct elfNN_ia64_link_hash_table *) hash; + if (ia64_info->loc_hash_table) + htab_delete (ia64_info->loc_hash_table); + if (ia64_info->loc_hash_memory) + objalloc_free ((struct objalloc *) ia64_info->loc_hash_memory); + _bfd_generic_link_hash_table_free (hash); } /* Traverse both local and global hash tables. */ struct elfNN_ia64_dyn_sym_traverse_data { - boolean (*func) PARAMS ((struct elfNN_ia64_dyn_sym_info *, PTR)); + bfd_boolean (*func) PARAMS ((struct elfNN_ia64_dyn_sym_info *, PTR)); PTR data; }; -static boolean +static bfd_boolean elfNN_ia64_global_dyn_sym_thunk (xentry, xdata) struct bfd_hash_entry *xentry; PTR xdata; @@ -1726,31 +1826,31 @@ elfNN_ia64_global_dyn_sym_thunk (xentry, xdata) for (dyn_i = entry->info; dyn_i; dyn_i = dyn_i->next) if (! (*data->func) (dyn_i, data->data)) - return false; - return true; + return FALSE; + return TRUE; } -static boolean -elfNN_ia64_local_dyn_sym_thunk (xentry, xdata) - struct bfd_hash_entry *xentry; +static bfd_boolean +elfNN_ia64_local_dyn_sym_thunk (slot, xdata) + void **slot; PTR xdata; { struct elfNN_ia64_local_hash_entry *entry - = (struct elfNN_ia64_local_hash_entry *) xentry; + = (struct elfNN_ia64_local_hash_entry *) *slot; 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; + return 0; + return 1; } 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)); + bfd_boolean (*func) PARAMS ((struct elfNN_ia64_dyn_sym_info *, PTR)); PTR data; { struct elfNN_ia64_dyn_sym_traverse_data xdata; @@ -1760,11 +1860,11 @@ elfNN_ia64_dyn_sym_traverse (ia64_info, func, 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); + htab_traverse (ia64_info->loc_hash_table, + elfNN_ia64_local_dyn_sym_thunk, &xdata); } -static boolean +static bfd_boolean elfNN_ia64_create_dynamic_sections (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -1773,7 +1873,7 @@ elfNN_ia64_create_dynamic_sections (abfd, info) asection *s; if (! _bfd_elf_create_dynamic_sections (abfd, info)) - return false; + return FALSE; ia64_info = elfNN_ia64_hash_table (info); @@ -1783,10 +1883,12 @@ elfNN_ia64_create_dynamic_sections (abfd, info) { flagword flags = bfd_get_section_flags (abfd, ia64_info->got_sec); bfd_set_section_flags (abfd, ia64_info->got_sec, SEC_SMALL_DATA | flags); + /* The .got section is always aligned at 8 bytes. */ + bfd_set_section_alignment (abfd, ia64_info->got_sec, 3); } if (!get_pltoff (abfd, info, ia64_info)) - return false; + return FALSE; s = bfd_make_section(abfd, ".rela.IA_64.pltoff"); if (s == NULL @@ -1796,7 +1898,7 @@ elfNN_ia64_create_dynamic_sections (abfd, info) | SEC_LINKER_CREATED | SEC_READONLY)) || !bfd_set_section_alignment (abfd, s, 3)) - return false; + return FALSE; ia64_info->rel_pltoff_sec = s; s = bfd_make_section(abfd, ".rela.got"); @@ -1807,10 +1909,10 @@ elfNN_ia64_create_dynamic_sections (abfd, info) | SEC_LINKER_CREATED | SEC_READONLY)) || !bfd_set_section_alignment (abfd, s, 3)) - return false; + return FALSE; ia64_info->rel_got_sec = s; - return true; + return TRUE; } /* Find and/or create a hash entry for local symbol. */ @@ -1819,28 +1921,35 @@ get_local_sym_hash (ia64_info, abfd, rel, create) struct elfNN_ia64_link_hash_table *ia64_info; bfd *abfd; const Elf_Internal_Rela *rel; - boolean create; + bfd_boolean create; { - char *addr_name; - size_t len; - struct elfNN_ia64_local_hash_entry *ret; - - /* Construct a string for use in the elfNN_ia64_local_hash_table. - name describes what was once anonymous memory. */ - - len = sizeof (void*)*2 + 1 + sizeof (bfd_vma)*4 + 1 + 1; - len += 10; /* %p slop */ + struct elfNN_ia64_local_hash_entry e, *ret; + asection *sec = abfd->sections; + hashval_t h = (((sec->id & 0xff) << 24) | ((sec->id & 0xff00) << 8)) + ^ ELFNN_R_SYM (rel->r_info) ^ (sec->id >> 16); + void **slot; + + e.id = sec->id; + e.r_sym = ELFNN_R_SYM (rel->r_info); + slot = htab_find_slot_with_hash (ia64_info->loc_hash_table, &e, h, + create ? INSERT : NO_INSERT); + + if (!slot) + return NULL; - addr_name = bfd_malloc (len); - if (addr_name == NULL) - return 0; - sprintf (addr_name, "%p:%lx", - (void *) abfd, (unsigned long) ELFNN_R_SYM (rel->r_info)); + if (*slot) + return (struct elfNN_ia64_local_hash_entry *) *slot; - /* Collect the canonical entry data for this address. */ - ret = elfNN_ia64_local_hash_lookup (&ia64_info->loc_hash_table, - addr_name, create, create); - free (addr_name); + ret = (struct elfNN_ia64_local_hash_entry *) + objalloc_alloc ((struct objalloc *) ia64_info->loc_hash_memory, + sizeof (struct elfNN_ia64_local_hash_entry)); + if (ret) + { + memset (ret, 0, sizeof (*ret)); + ret->id = sec->id; + ret->r_sym = ELFNN_R_SYM (rel->r_info); + *slot = ret; + } return ret; } @@ -1853,7 +1962,7 @@ get_dyn_sym_info (ia64_info, h, abfd, rel, create) struct elf_link_hash_entry *h; bfd *abfd; const Elf_Internal_Rela *rel; - boolean create; + bfd_boolean create; { struct elfNN_ia64_dyn_sym_info **pp; struct elfNN_ia64_dyn_sym_info *dyn_i; @@ -1866,7 +1975,11 @@ get_dyn_sym_info (ia64_info, h, abfd, rel, create) struct elfNN_ia64_local_hash_entry *loc_h; loc_h = get_local_sym_hash (ia64_info, abfd, rel, create); - BFD_ASSERT (loc_h); + if (!loc_h) + { + BFD_ASSERT (!create); + return NULL; + } pp = &loc_h->info; } @@ -1909,6 +2022,10 @@ get_got (abfd, info, ia64_info) BFD_ASSERT (got); ia64_info->got_sec = got; + /* The .got section is always aligned at 8 bytes. */ + if (!bfd_set_section_alignment (abfd, got, 3)) + return 0; + flags = bfd_get_section_flags (abfd, got); bfd_set_section_flags (abfd, got, SEC_SMALL_DATA | flags); } @@ -1917,14 +2034,14 @@ get_got (abfd, info, ia64_info) } /* Create function descriptor section (.opd). This section is called .opd - because it contains "official prodecure descriptors". The "official" + because it contains "official procedure 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 bfd_link_info *info; struct elfNN_ia64_link_hash_table *ia64_info; { asection *fptr; @@ -1944,7 +2061,7 @@ get_fptr (abfd, info, ia64_info) | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY - | SEC_READONLY + | (info->pie ? 0 : SEC_READONLY) | SEC_LINKER_CREATED)) || !bfd_set_section_alignment (abfd, fptr, 4)) { @@ -1953,6 +2070,26 @@ get_fptr (abfd, info, ia64_info) } ia64_info->fptr_sec = fptr; + + if (info->pie) + { + asection *fptr_rel; + fptr_rel = bfd_make_section(dynobj, ".rela.opd"); + if (fptr_rel == NULL + || !bfd_set_section_flags (dynobj, fptr_rel, + (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || !bfd_set_section_alignment (abfd, fptr_rel, 3)) + { + BFD_ASSERT (0); + return NULL; + } + + ia64_info->rel_fptr_sec = fptr_rel; + } } return fptr; @@ -2000,7 +2137,7 @@ get_reloc_section (abfd, ia64_info, sec, create) bfd *abfd; struct elfNN_ia64_link_hash_table *ia64_info; asection *sec; - boolean create; + bfd_boolean create; { const char *srel_name; asection *srel; @@ -2039,18 +2176,12 @@ get_reloc_section (abfd, ia64_info, sec, create) return NULL; } - if (sec->flags & SEC_READONLY) - ia64_info->reltext = 1; - 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; +static bfd_boolean +count_dyn_reloc (bfd *abfd, struct elfNN_ia64_dyn_sym_info *dyn_i, + asection *srel, int type, bfd_boolean reltext) { struct elfNN_ia64_dyn_reloc_entry *rent; @@ -2063,7 +2194,7 @@ count_dyn_reloc (abfd, dyn_i, srel, type) rent = ((struct elfNN_ia64_dyn_reloc_entry *) bfd_alloc (abfd, (bfd_size_type) sizeof (*rent))); if (!rent) - return false; + return FALSE; rent->next = dyn_i->reloc_entries; rent->srel = srel; @@ -2071,12 +2202,13 @@ count_dyn_reloc (abfd, dyn_i, srel, type) rent->count = 0; dyn_i->reloc_entries = rent; } + rent->reltext = reltext; rent->count++; - return true; + return TRUE; } -static boolean +static bfd_boolean elfNN_ia64_check_relocs (abfd, info, sec, relocs) bfd *abfd; struct bfd_link_info *info; @@ -2089,8 +2221,8 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) const Elf_Internal_Rela *rel; asection *got, *fptr, *srel; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; ia64_info = elfNN_ia64_hash_table (info); @@ -2102,22 +2234,23 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) { 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, - NEED_TPREL = 128, - NEED_DTPMOD = 256, - NEED_DTPREL = 512 + NEED_GOTX = 2, + NEED_FPTR = 4, + NEED_PLTOFF = 8, + NEED_MIN_PLT = 16, + NEED_FULL_PLT = 32, + NEED_DYNREL = 64, + NEED_LTOFF_FPTR = 128, + NEED_TPREL = 256, + NEED_DTPMOD = 512, + NEED_DTPREL = 1024 }; 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; + bfd_boolean maybe_dynamic; int dynrel_type = R_IA64_NONE; if (r_symndx >= symtab_hdr->sh_info) @@ -2137,13 +2270,12 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) 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 || info->allow_shlib_undefined)) + maybe_dynamic = FALSE; + if (h && ((!info->executable + && (!info->symbolic || info->unresolved_syms_in_shared_libs == RM_IGNORE)) || ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) - || h->root.type == bfd_link_hash_defweak - || elfNN_ia64_aix_vec (abfd->xvec))) - maybe_dynamic = true; + || h->root.type == bfd_link_hash_defweak)) + maybe_dynamic = TRUE; need_entry = 0; switch (ELFNN_R_TYPE (rel->r_info)) @@ -2199,7 +2331,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) case R_IA64_FPTR32LSB: case R_IA64_FPTR64MSB: case R_IA64_FPTR64LSB: - if (info->shared || h || elfNN_ia64_aix_vec (abfd->xvec)) + if (info->shared || h) need_entry = NEED_FPTR | NEED_DYNREL; else need_entry = NEED_FPTR; @@ -2207,11 +2339,14 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) break; case R_IA64_LTOFF22: - case R_IA64_LTOFF22X: case R_IA64_LTOFF64I: need_entry = NEED_GOT; break; + case R_IA64_LTOFF22X: + need_entry = NEED_GOTX; + break; + case R_IA64_PLTOFF22: case R_IA64_PLTOFF64I: case R_IA64_PLTOFF64MSB: @@ -2248,10 +2383,7 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) case R_IA64_DIR64MSB: case R_IA64_DIR64LSB: /* Shared objects will always need at least a REL relocation. */ - if (info->shared || maybe_dynamic - || (elfNN_ia64_aix_vec (abfd->xvec) - && (!h || strcmp (h->root.root.string, - "__GLOB_DATA_PTR") != 0))) + if (info->shared || maybe_dynamic) need_entry = NEED_DYNREL; dynrel_type = R_IA64_DIR64LSB; break; @@ -2287,22 +2419,25 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) abfd, 0, (bfd_vma) 0); } - dyn_i = get_dyn_sym_info (ia64_info, h, abfd, rel, true); + 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 | NEED_TPREL | NEED_DTPMOD | NEED_DTPREL)) + if (need_entry & (NEED_GOT | NEED_GOTX | NEED_TPREL + | NEED_DTPMOD | NEED_DTPREL)) { if (!got) { got = get_got (abfd, info, ia64_info); if (!got) - return false; + return FALSE; } if (need_entry & NEED_GOT) dyn_i->want_got = 1; + if (need_entry & NEED_GOTX) + dyn_i->want_gotx = 1; if (need_entry & NEED_TPREL) dyn_i->want_tprel = 1; if (need_entry & NEED_DTPMOD) @@ -2316,19 +2451,17 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) { fptr = get_fptr (abfd, info, ia64_info); if (!fptr) - return false; + 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 - /* AIX also needs one */ - || elfNN_ia64_aix_vec (abfd->xvec))) + if (!h && info->shared) { - if (! (_bfd_elfNN_link_record_local_dynamic_symbol + if (! (bfd_elf_link_record_local_dynamic_symbol (info, abfd, (long) r_symndx))) - return false; + return FALSE; } dyn_i->want_fptr = 1; @@ -2350,40 +2483,32 @@ elfNN_ia64_check_relocs (abfd, info, sec, relocs) { if (!srel) { - srel = get_reloc_section (abfd, ia64_info, sec, true); + srel = get_reloc_section (abfd, ia64_info, sec, TRUE); if (!srel) - return false; + return FALSE; } - if (!count_dyn_reloc (abfd, dyn_i, srel, dynrel_type)) - return false; + if (!count_dyn_reloc (abfd, dyn_i, srel, dynrel_type, + (sec->flags & SEC_READONLY) != 0)) + return FALSE; } } - return true; + 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 +static bfd_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 + if ((dyn_i->want_got || dyn_i->want_gotx) && ! dyn_i->want_fptr - && (elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info) - || (elfNN_ia64_aix_vec (x->info->hash->creator) - && (!dyn_i->h || strcmp (dyn_i->h->root.root.string, - "__GLOB_DATA_PTR") != 0)))) + && elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info, 0)) { dyn_i->got_offset = x->ofs; x->ofs += 8; @@ -2395,20 +2520,35 @@ allocate_global_data_got (dyn_i, data) } if (dyn_i->want_dtpmod) { - dyn_i->dtpmod_offset = x->ofs; - x->ofs += 8; + if (elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info, 0)) + { + dyn_i->dtpmod_offset = x->ofs; + x->ofs += 8; + } + else + { + struct elfNN_ia64_link_hash_table *ia64_info; + + ia64_info = elfNN_ia64_hash_table (x->info); + if (ia64_info->self_dtpmod_offset == (bfd_vma) -1) + { + ia64_info->self_dtpmod_offset = x->ofs; + x->ofs += 8; + } + dyn_i->dtpmod_offset = ia64_info->self_dtpmod_offset; + } } if (dyn_i->want_dtprel) { dyn_i->dtprel_offset = x->ofs; x->ofs += 8; } - return true; + return TRUE; } /* Next, allocate all the GOT entries used by LTOFF_FPTR relocs. */ -static boolean +static bfd_boolean allocate_global_fptr_got (dyn_i, data) struct elfNN_ia64_dyn_sym_info *dyn_i; PTR data; @@ -2417,32 +2557,30 @@ allocate_global_fptr_got (dyn_i, data) if (dyn_i->want_got && dyn_i->want_fptr - && (elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info) - || elfNN_ia64_aix_vec (x->info->hash->creator))) + && elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info, R_IA64_FPTR64LSB)) { dyn_i->got_offset = x->ofs; x->ofs += 8; } - return true; + return TRUE; } /* Lastly, allocate all the GOT entries for local data. */ -static boolean +static bfd_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) - || elfNN_ia64_aix_vec (x->info->hash->creator))) + if ((dyn_i->want_got || dyn_i->want_gotx) + && !elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info, 0)) { dyn_i->got_offset = x->ofs; x->ofs += 8; } - return true; + return TRUE; } /* Search for the index of a global symbol in it's defining object file. */ @@ -2467,7 +2605,7 @@ global_sym_index (h) /* Allocate function descriptors. We can do these for every function in a main executable that is not exported. */ -static boolean +static bfd_boolean allocate_fptr (dyn_i, data) struct elfNN_ia64_dyn_sym_info *dyn_i; PTR data; @@ -2483,22 +2621,20 @@ allocate_fptr (dyn_i, data) || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; - if (x->info->shared - /* AIX needs an FPTR in this case. */ - || (elfNN_ia64_aix_vec (x->info->hash->creator) - && (!h - || h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak))) + if (!x->info->executable + && (!h + || ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) { 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 + if (!bfd_elf_link_record_local_dynamic_symbol (x->info, h->root.u.def.section->owner, global_sym_index (h))) - return false; + return FALSE; } dyn_i->want_fptr = 0; @@ -2511,12 +2647,12 @@ allocate_fptr (dyn_i, data) else dyn_i->want_fptr = 0; } - return true; + return TRUE; } /* Allocate all the minimal PLT entries. */ -static boolean +static bfd_boolean allocate_plt_entries (dyn_i, data) struct elfNN_ia64_dyn_sym_info *dyn_i; PTR data; @@ -2533,7 +2669,7 @@ allocate_plt_entries (dyn_i, data) 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)) + if (elfNN_ia64_dynamic_symbol_p (h, x->info, 0)) { bfd_size_type offset = x->ofs; if (offset == 0) @@ -2549,12 +2685,12 @@ allocate_plt_entries (dyn_i, data) dyn_i->want_plt2 = 0; } } - return true; + return TRUE; } /* Allocate all the full PLT entries. */ -static boolean +static bfd_boolean allocate_plt2_entries (dyn_i, data) struct elfNN_ia64_dyn_sym_info *dyn_i; PTR data; @@ -2574,7 +2710,7 @@ allocate_plt2_entries (dyn_i, data) h = (struct elf_link_hash_entry *) h->root.u.i.link; dyn_i->h->plt.offset = ofs; } - return true; + return TRUE; } /* Allocate all the PLTOFF entries requested by relocations and @@ -2582,7 +2718,7 @@ allocate_plt2_entries (dyn_i, data) because the latter are not necessarily addressable by the GP. ??? Relaxation might be able to determine that they are. */ -static boolean +static bfd_boolean allocate_pltoff_entries (dyn_i, data) struct elfNN_ia64_dyn_sym_info *dyn_i; PTR data; @@ -2594,13 +2730,13 @@ allocate_pltoff_entries (dyn_i, data) dyn_i->pltoff_offset = x->ofs; x->ofs += 16; } - return true; + return TRUE; } /* Allocate dynamic relocations for those symbols that turned out to be dynamic. */ -static boolean +static bfd_boolean allocate_dynrel_entries (dyn_i, data) struct elfNN_ia64_dyn_sym_info *dyn_i; PTR data; @@ -2608,15 +2744,17 @@ allocate_dynrel_entries (dyn_i, 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; + bfd_boolean dynamic_symbol, shared, resolved_zero; ia64_info = elfNN_ia64_hash_table (x->info); - dynamic_symbol = elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info) - || (elfNN_ia64_aix_vec (x->info->hash->creator) - /* Don't allocate an entry for __GLOB_DATA_PTR */ - && (!dyn_i->h || strcmp (dyn_i->h->root.root.string, - "__GLOB_DATA_PTR") != 0)); + + /* Note that this can't be used in relation to FPTR relocs below. */ + dynamic_symbol = elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info, 0); + shared = x->info->shared; + resolved_zero = (dyn_i->h + && ELF_ST_VISIBILITY (dyn_i->h->other) + && dyn_i->h->root.type == bfd_link_hash_undefweak); /* Take care of the normal data relocations. */ @@ -2627,10 +2765,11 @@ allocate_dynrel_entries (dyn_i, data) 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) + /* Allocate one iff !want_fptr and not PIE, which by this point + will be true only if we're actually allocating one statically + in the main executable. Position independent executables + need a relative reloc. */ + if (dyn_i->want_fptr && !x->info->pie) continue; break; case R_IA64_PCREL64LSB: @@ -2656,22 +2795,39 @@ allocate_dynrel_entries (dyn_i, data) default: abort (); } + if (rent->reltext) + ia64_info->reltext = 1; 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 ((!resolved_zero + && (dynamic_symbol || shared) + && (dyn_i->want_got || dyn_i->want_gotx)) + || (dyn_i->want_ltoff_fptr + && dyn_i->h + && dyn_i->h->dynindx != -1)) + { + if (!dyn_i->want_ltoff_fptr + || !x->info->pie + || dyn_i->h == NULL + || dyn_i->h->root.type != bfd_link_hash_undefweak) + ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); + } if ((dynamic_symbol || shared) && dyn_i->want_tprel) ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); - if ((dynamic_symbol || shared) && dyn_i->want_dtpmod) + if (dynamic_symbol && dyn_i->want_dtpmod) ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); if (dynamic_symbol && dyn_i->want_dtprel) ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); + if (ia64_info->rel_fptr_sec && dyn_i->want_fptr) + { + if (dyn_i->h == NULL || dyn_i->h->root.type != bfd_link_hash_undefweak) + ia64_info->rel_fptr_sec->_raw_size += sizeof (ElfNN_External_Rela); + } - if (dyn_i->want_pltoff) + if (!resolved_zero && dyn_i->want_pltoff) { bfd_size_type t = 0; @@ -2686,10 +2842,10 @@ allocate_dynrel_entries (dyn_i, data) ia64_info->rel_pltoff_sec->_raw_size += t; } - return true; + return TRUE; } -static boolean +static bfd_boolean elfNN_ia64_adjust_dynamic_symbol (info, h) struct bfd_link_info *info ATTRIBUTE_UNUSED; struct elf_link_hash_entry *h; @@ -2706,7 +2862,7 @@ elfNN_ia64_adjust_dynamic_symbol (info, h) || 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; + return TRUE; } /* If this is a reference to a symbol defined by a dynamic object which @@ -2716,33 +2872,34 @@ elfNN_ia64_adjust_dynamic_symbol (info, h) But IA-64 code is canonically PIC, so as a rule we can avoid this sort of hackery. */ - return true; + return TRUE; } -static boolean +static bfd_boolean elfNN_ia64_size_dynamic_sections (output_bfd, info) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; { struct elfNN_ia64_allocate_data data; struct elfNN_ia64_link_hash_table *ia64_info; asection *sec; bfd *dynobj; - boolean relplt = false; + bfd_boolean relplt = FALSE; dynobj = elf_hash_table(info)->dynobj; ia64_info = elfNN_ia64_hash_table (info); + ia64_info->self_dtpmod_offset = (bfd_vma) -1; 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) + && info->executable) { sec = bfd_get_section_by_name (dynobj, ".interp"); BFD_ASSERT (sec != NULL); - sec->contents = (bfd_byte *) DYNAMIC_INTERPRETER (output_bfd); - sec->_raw_size = strlen (DYNAMIC_INTERPRETER (output_bfd)) + 1; + sec->contents = (bfd_byte *) ELF_DYNAMIC_INTERPRETER; + sec->_raw_size = strlen (ELF_DYNAMIC_INTERPRETER) + 1; } /* Allocate the GOT entries. */ @@ -2767,7 +2924,7 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) /* 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 + 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; @@ -2784,8 +2941,12 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) data.ofs = (data.ofs + 31) & (bfd_vma) -32; elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_plt2_entries, &data); - if (data.ofs != 0) + if (data.ofs != 0 || ia64_info->root.dynamic_sections_created) { + /* FIXME: we always reserve the memory for dynamic linker even if + there are no PLT entries since dynamic linker may assume the + reserved memory always exists. */ + BFD_ASSERT (ia64_info->root.dynamic_sections_created); ia64_info->plt_sec->_raw_size = data.ofs; @@ -2810,6 +2971,8 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) /* Allocate space for the dynamic relocations that turned out to be required. */ + if (info->shared && ia64_info->self_dtpmod_offset != (bfd_vma) -1) + ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_dynrel_entries, &data); } @@ -2817,7 +2980,7 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) Allocate memory for them. */ for (sec = dynobj->sections; sec != NULL; sec = sec->next) { - boolean strip; + bfd_boolean strip; if (!(sec->flags & SEC_LINKER_CREATED)) continue; @@ -2833,7 +2996,7 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) strip = (sec->_raw_size == 0); if (sec == ia64_info->got_sec) - strip = false; + strip = FALSE; else if (sec == ia64_info->rel_got_sec) { if (strip) @@ -2848,6 +3011,15 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) if (strip) ia64_info->fptr_sec = NULL; } + else if (sec == ia64_info->rel_fptr_sec) + { + if (strip) + ia64_info->rel_fptr_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->plt_sec) { if (strip) @@ -2864,7 +3036,7 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) ia64_info->rel_pltoff_sec = NULL; else { - relplt = true; + 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; @@ -2879,7 +3051,7 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) name = bfd_get_section_name (dynobj, sec); if (strcmp (name, ".got.plt") == 0) - strip = false; + strip = FALSE; else if (strncmp (name, ".rel", 4) == 0) { if (!strip) @@ -2900,7 +3072,7 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) /* 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; + return FALSE; } } @@ -2910,46 +3082,46 @@ elfNN_ia64_size_dynamic_sections (output_bfd, info) 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) + if (info->executable) { /* The DT_DEBUG entry is filled in by the dynamic linker and used by the debugger. */ #define add_dynamic_entry(TAG, VAL) \ - bfd_elfNN_add_dynamic_entry (info, (bfd_vma) (TAG), (bfd_vma) (VAL)) + _bfd_elf_add_dynamic_entry (info, TAG, VAL) if (!add_dynamic_entry (DT_DEBUG, 0)) - return false; + return FALSE; } if (!add_dynamic_entry (DT_IA_64_PLT_RESERVE, 0)) - return false; + return FALSE; if (!add_dynamic_entry (DT_PLTGOT, 0)) - return false; + return FALSE; if (relplt) { if (!add_dynamic_entry (DT_PLTRELSZ, 0) || !add_dynamic_entry (DT_PLTREL, DT_RELA) || !add_dynamic_entry (DT_JMPREL, 0)) - return false; + return FALSE; } if (!add_dynamic_entry (DT_RELA, 0) || !add_dynamic_entry (DT_RELASZ, 0) || !add_dynamic_entry (DT_RELAENT, sizeof (ElfNN_External_Rela))) - return false; + return FALSE; if (ia64_info->reltext) { if (!add_dynamic_entry (DT_TEXTREL, 0)) - return false; + return FALSE; info->flags |= DF_TEXTREL; } } /* ??? Perhaps force __gp local. */ - return true; + return TRUE; } static bfd_reloc_status_type @@ -3190,14 +3362,13 @@ elfNN_ia64_install_dyn_reloc (abfd, info, sec, srel, offset, type, bfd_vma addend; { Elf_Internal_Rela outrel; - - offset += sec->output_section->vma + sec->output_offset; + bfd_byte *loc; BFD_ASSERT (dynindx != -1); outrel.r_info = ELFNN_R_INFO (dynindx, type); outrel.r_addend = addend; outrel.r_offset = _bfd_elf_section_offset (abfd, info, sec, offset); - if ((outrel.r_offset | 1) == (bfd_vma) -1) + if (outrel.r_offset >= (bfd_vma) -2) { /* Run for the hills. We shouldn't be outputting a relocation for this. So do what everyone else does and output a no-op. */ @@ -3205,10 +3376,12 @@ elfNN_ia64_install_dyn_reloc (abfd, info, sec, srel, offset, type, outrel.r_addend = 0; outrel.r_offset = 0; } + else + outrel.r_offset += sec->output_section->vma + sec->output_offset; - bfd_elfNN_swap_reloca_out (abfd, &outrel, - ((ElfNN_External_Rela *) srel->contents - + srel->reloc_count++)); + loc = srel->contents; + loc += srel->reloc_count++ * sizeof (ElfNN_External_Rela); + bfd_elfNN_swap_reloca_out (abfd, &outrel, loc); BFD_ASSERT (sizeof (ElfNN_External_Rela) * srel->reloc_count <= srel->_cooked_size); } @@ -3228,7 +3401,7 @@ set_got_entry (abfd, info, dyn_i, dynindx, addend, value, dyn_r_type) { struct elfNN_ia64_link_hash_table *ia64_info; asection *got_sec; - boolean done; + bfd_boolean done; bfd_vma got_offset; ia64_info = elfNN_ia64_hash_table (info); @@ -3238,22 +3411,31 @@ set_got_entry (abfd, info, dyn_i, dynindx, addend, value, dyn_r_type) { case R_IA64_TPREL64LSB: done = dyn_i->tprel_done; - dyn_i->tprel_done = true; + dyn_i->tprel_done = TRUE; got_offset = dyn_i->tprel_offset; break; case R_IA64_DTPMOD64LSB: - done = dyn_i->dtpmod_done; - dyn_i->dtpmod_done = true; + if (dyn_i->dtpmod_offset != ia64_info->self_dtpmod_offset) + { + done = dyn_i->dtpmod_done; + dyn_i->dtpmod_done = TRUE; + } + else + { + done = ia64_info->self_dtpmod_done; + ia64_info->self_dtpmod_done = TRUE; + dynindx = 0; + } got_offset = dyn_i->dtpmod_offset; break; case R_IA64_DTPREL64LSB: done = dyn_i->dtprel_done; - dyn_i->dtprel_done = true; + dyn_i->dtprel_done = TRUE; got_offset = dyn_i->dtprel_offset; break; default: done = dyn_i->got_done; - dyn_i->got_done = true; + dyn_i->got_done = TRUE; got_offset = dyn_i->got_offset; break; } @@ -3266,10 +3448,17 @@ set_got_entry (abfd, info, dyn_i, dynindx, addend, value, dyn_r_type) bfd_put_64 (abfd, value, got_sec->contents + got_offset); /* Install a dynamic relocation if needed. */ - if ((info->shared && dyn_r_type != R_IA64_DTPREL64LSB) - || elfNN_ia64_dynamic_symbol_p (dyn_i->h, info) - || elfNN_ia64_aix_vec (abfd->xvec) - || (dynindx != -1 && dyn_r_type == R_IA64_FPTR64LSB)) + if (((info->shared + && (!dyn_i->h + || ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT + || dyn_i->h->root.type != bfd_link_hash_undefweak) + && dyn_r_type != R_IA64_DTPREL64LSB) + || elfNN_ia64_dynamic_symbol_p (dyn_i->h, info, dyn_r_type) + || (dynindx != -1 && dyn_r_type == R_IA64_FPTR64LSB)) + && (!dyn_i->want_ltoff_fptr + || !info->pie + || !dyn_i->h + || dyn_i->h->root.type != bfd_link_hash_undefweak)) { if (dynindx == -1 && dyn_r_type != R_IA64_TPREL64LSB @@ -3304,7 +3493,7 @@ set_got_entry (abfd, info, dyn_i, dynindx, addend, value, dyn_r_type) dyn_r_type = R_IA64_DTPREL64MSB; break; default: - BFD_ASSERT (false); + BFD_ASSERT (FALSE); break; } } @@ -3348,6 +3537,24 @@ set_fptr_entry (abfd, info, dyn_i, value) 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); + if (ia64_info->rel_fptr_sec) + { + Elf_Internal_Rela outrel; + bfd_byte *loc; + + if (bfd_little_endian (abfd)) + outrel.r_info = ELFNN_R_INFO (0, R_IA64_IPLTLSB); + else + outrel.r_info = ELFNN_R_INFO (0, R_IA64_IPLTMSB); + outrel.r_addend = value; + outrel.r_offset = (fptr_sec->output_section->vma + + fptr_sec->output_offset + + dyn_i->fptr_offset); + loc = ia64_info->rel_fptr_sec->contents; + loc += ia64_info->rel_fptr_sec->reloc_count++ + * sizeof (ElfNN_External_Rela); + bfd_elfNN_swap_reloca_out (abfd, &outrel, loc); + } } /* Return the descriptor's address. */ @@ -3367,7 +3574,7 @@ set_pltoff_entry (abfd, info, dyn_i, value, is_plt) struct bfd_link_info *info; struct elfNN_ia64_dyn_sym_info *dyn_i; bfd_vma value; - boolean is_plt; + bfd_boolean is_plt; { struct elfNN_ia64_link_hash_table *ia64_info; asection *pltoff_sec; @@ -3387,7 +3594,11 @@ set_pltoff_entry (abfd, info, dyn_i, value, is_plt) bfd_put_64 (abfd, gp, pltoff_sec->contents + dyn_i->pltoff_offset + 8); /* Install dynamic relocations if needed. */ - if (!is_plt && info->shared) + if (!is_plt + && info->shared + && (!dyn_i->h + || ELF_ST_VISIBILITY (dyn_i->h->other) == STV_DEFAULT + || dyn_i->h->root.type != bfd_link_hash_undefweak)) { unsigned int dyn_r_type; @@ -3426,12 +3637,10 @@ static bfd_vma elfNN_ia64_tprel_base (info) struct bfd_link_info *info; { - struct elf_link_tls_segment *tls_segment - = elf_hash_table (info)->tls_segment; + asection *tls_sec = elf_hash_table (info)->tls_sec; - BFD_ASSERT (tls_segment != NULL); - return (tls_segment->start - - align_power ((bfd_vma) 16, tls_segment->align)); + BFD_ASSERT (tls_sec != NULL); + return tls_sec->vma - align_power ((bfd_vma) 16, tls_sec->alignment_power); } /* Return the base VMA address which should be subtracted from real addresses @@ -3442,8 +3651,8 @@ static bfd_vma elfNN_ia64_dtprel_base (info) struct bfd_link_info *info; { - BFD_ASSERT (elf_hash_table (info)->tls_segment != NULL); - return elf_hash_table (info)->tls_segment->start; + BFD_ASSERT (elf_hash_table (info)->tls_sec != NULL); + return elf_hash_table (info)->tls_sec->vma; } /* Called through qsort to sort the .IA_64.unwind section during a @@ -3465,125 +3674,148 @@ elfNN_ia64_unwind_entry_compare (a, b) return (av < bv ? -1 : av > bv ? 1 : 0); } -static boolean -elfNN_ia64_final_link (abfd, info) +/* Make sure we've got ourselves a nice fat __gp value. */ +static bfd_boolean +elfNN_ia64_choose_gp (abfd, info) bfd *abfd; struct bfd_link_info *info; { + 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; 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) + /* 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 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; + bfd_vma lo, hi; - /* 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) + 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) { - bfd_vma lo, hi; + if (min_short_vma > lo) + min_short_vma = lo; + if (max_short_vma < hi) + max_short_vma = hi; + } + } - if ((os->flags & SEC_ALLOC) == 0) - continue; + /* See if the user wants to force a value. */ + gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", FALSE, + FALSE, FALSE); - lo = os->vma; - hi = os->vma + os->_raw_size; - if (hi < lo) - hi = (bfd_vma) -1; + 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. */ - 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; - } + 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; } + } - /* See if the user wants to force a value. */ - gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", false, - false, false); + /* Validate whether all SHF_IA_64_SHORT sections are within + range of the chosen GP. */ - if (gp - && (gp->root.type == bfd_link_hash_defined - || gp->root.type == bfd_link_hash_defweak)) + if (max_short_vma != 0) + { + if (max_short_vma - min_short_vma >= 0x400000) { - asection *gp_sec = gp->root.u.def.section; - gp_val = (gp->root.u.def.value - + gp_sec->output_section->vma - + gp_sec->output_offset); + (*_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 + else if ((gp_val > min_short_vma + && gp_val - min_short_vma > 0x200000) + || (gp_val < max_short_vma + && max_short_vma - gp_val >= 0x200000)) { - /* Pick a sensible value. */ + (*_bfd_error_handler) + (_("%s: __gp does not cover short data segment"), + bfd_get_filename (abfd)); + return FALSE; + } + } - asection *got_sec = ia64_info->got_sec; + _bfd_set_gp_value (abfd, gp_val); - /* 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; + return TRUE; +} - /* If we're addressing stuff past the end, adjust back. */ - if (gp_val > max_vma) - gp_val = max_vma - 0x200000 + 8; - } - } +static bfd_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); - /* Validate whether all SHF_IA_64_SHORT sections are within - range of the chosen GP. */ + /* Make sure we've got ourselves a nice fat __gp value. */ + if (!info->relocatable) + { + bfd_vma gp_val = _bfd_get_gp_value (abfd); + struct elf_link_hash_entry *gp; - if (max_short_vma != 0) + if (gp_val == 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; - } + if (! elfNN_ia64_choose_gp (abfd, info)) + return FALSE; + gp_val = _bfd_get_gp_value (abfd); } - _bfd_set_gp_value (abfd, gp_val); - + gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", FALSE, + FALSE, FALSE); if (gp) { gp->root.type = bfd_link_hash_defined; @@ -3596,7 +3828,7 @@ elfNN_ia64_final_link (abfd, info) 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) + if (!info->relocatable) { asection *s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_unwind); if (s) @@ -3605,13 +3837,13 @@ elfNN_ia64_final_link (abfd, info) unwind_output_sec->contents = bfd_malloc (unwind_output_sec->_raw_size); if (unwind_output_sec->contents == NULL) - return false; + return FALSE; } } /* Invoke the regular ELF backend linker to do all the work. */ - if (!bfd_elfNN_bfd_final_link (abfd, info)) - return false; + if (!bfd_elf_final_link (abfd, info)) + return FALSE; if (unwind_output_sec) { @@ -3624,13 +3856,13 @@ elfNN_ia64_final_link (abfd, info) if (! bfd_set_section_contents (abfd, unwind_output_sec, unwind_output_sec->contents, (bfd_vma) 0, unwind_output_sec->_raw_size)) - return false; + return FALSE; } - return true; + return TRUE; } -static boolean +static bfd_boolean elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, local_syms, local_sections) bfd *output_bfd; @@ -3647,14 +3879,14 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, Elf_Internal_Rela *rel; Elf_Internal_Rela *relend; asection *srel; - boolean ret_val = true; /* for non-fatal errors */ + bfd_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) + if (info->relocatable) { bfd_vma flags; @@ -3663,11 +3895,11 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, elf_section_data(input_section->output_section) ->this_hdr.sh_flags |= flags; - return true; + return TRUE; } gp_val = _bfd_get_gp_value (output_bfd); - srel = get_reloc_section (input_bfd, ia64_info, input_section, false); + srel = get_reloc_section (input_bfd, ia64_info, input_section, FALSE); rel = relocs; relend = relocs + input_section->reloc_count; @@ -3683,8 +3915,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma value; asection *sym_sec; bfd_byte *hit_addr; - boolean dynamic_symbol_p; - boolean undef_weak_ref; + bfd_boolean dynamic_symbol_p; + bfd_boolean undef_weak_ref; r_type = ELFNN_R_TYPE (rel->r_info); if (r_type > R_IA64_MAX_RELOC_CODE) @@ -3693,7 +3925,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, (_("%s: unknown relocation type %d"), bfd_archive_filename (input_bfd), (int)r_type); bfd_set_error (bfd_error_bad_value); - ret_val = false; + ret_val = FALSE; continue; } @@ -3702,26 +3934,26 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, h = NULL; sym = NULL; sym_sec = NULL; - undef_weak_ref = false; + undef_weak_ref = FALSE; if (r_symndx < symtab_hdr->sh_info) { /* Reloc against local symbol. */ + asection *msec; sym = local_syms + r_symndx; sym_sec = local_sections[r_symndx]; - value = _bfd_elf_rela_local_sym (output_bfd, sym, sym_sec, rel); + msec = sym_sec; + value = _bfd_elf_rela_local_sym (output_bfd, sym, &msec, rel); if ((sym_sec->flags & SEC_MERGE) && ELF_ST_TYPE (sym->st_info) == STT_SECTION - && (elf_section_data (sym_sec)->sec_info_type - == ELF_INFO_TYPE_MERGE)) + && sym_sec->sec_info_type == ELF_INFO_TYPE_MERGE) { struct elfNN_ia64_local_hash_entry *loc_h; - - loc_h = get_local_sym_hash (ia64_info, input_bfd, rel, false); + + loc_h = get_local_sym_hash (ia64_info, input_bfd, rel, FALSE); if (loc_h && ! loc_h->sec_merge_done) { struct elfNN_ia64_dyn_sym_info *dynent; - asection *msec; for (dynent = loc_h->info; dynent; dynent = dynent->next) { @@ -3745,59 +3977,24 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, } 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->allow_shlib_undefined) - && !info->no_undefined - && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) - ; - else - { - if (! ((*info->callbacks->undefined_symbol) - (info, h->root.root.string, input_bfd, - input_section, rel->r_offset, - (!info->shared || info->no_undefined - || ELF_ST_VISIBILITY (h->other))))) - return false; - ret_val = false; - continue; - } + bfd_boolean unresolved_reloc; + bfd_boolean warned; + struct elf_link_hash_entry **sym_hashes = elf_sym_hashes (input_bfd); + + RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel, + r_symndx, symtab_hdr, sym_hashes, + h, sym_sec, value, + unresolved_reloc, warned); + + if (h->root.type == bfd_link_hash_undefweak) + undef_weak_ref = TRUE; + else if (warned) + continue; } hit_addr = contents + rel->r_offset; value += rel->r_addend; - dynamic_symbol_p = elfNN_ia64_dynamic_symbol_p (h, info); + dynamic_symbol_p = elfNN_ia64_dynamic_symbol_p (h, info, r_type); switch (r_type) { @@ -3813,11 +4010,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, case R_IA64_DIR64MSB: case R_IA64_DIR64LSB: /* Install a dynamic relocation for this reloc. */ - if ((dynamic_symbol_p || info->shared - || (elfNN_ia64_aix_vec (info->hash->creator) - /* Don't emit relocs for __GLOB_DATA_PTR on AIX. */ - && (!h || strcmp (h->root.root.string, - "__GLOB_DATA_PTR") != 0))) + if ((dynamic_symbol_p || info->shared) && r_symndx != 0 && (input_section->flags & SEC_ALLOC) != 0) { @@ -3827,6 +4020,24 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, BFD_ASSERT (srel != NULL); + switch (r_type) + { + case R_IA64_IMM14: + case R_IA64_IMM22: + case R_IA64_IMM64: + /* ??? People shouldn't be doing non-pic code in + shared libraries nor dynamic executables. */ + (*_bfd_error_handler) + (_("%s: non-pic code with imm relocation against dynamic symbol `%s'"), + bfd_archive_filename (input_bfd), + h->root.root.string); + ret_val = FALSE; + continue; + + default: + break; + } + /* If we don't need dynamic symbol lookup, find a matching RELATIVE relocation. */ dyn_r_type = r_type; @@ -3854,29 +4065,17 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, 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_archive_filename (input_bfd)); - ret_val = false; - continue; + break; } dynindx = 0; addend = value; } - if (elfNN_ia64_aix_vec (info->hash->creator)) - rel->r_addend = value; elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section, srel, rel->r_offset, dyn_r_type, dynindx, addend); } - /* FALLTHRU */ + /* Fall through. */ case R_IA64_LTV32MSB: case R_IA64_LTV32LSB: @@ -3896,7 +4095,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: @gprel relocation against dynamic symbol %s"), bfd_archive_filename (input_bfd), h->root.root.string); - ret_val = false; + ret_val = FALSE; continue; } value -= gp_val; @@ -3906,7 +4105,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, 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); + 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; @@ -3917,8 +4116,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, 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); + 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; @@ -3928,20 +4127,42 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, 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); + 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 + if (!dyn_i->want_fptr || info->pie) { long dynindx; + unsigned int dyn_r_type = r_type; + bfd_vma addend = rel->r_addend; /* Otherwise, we expect the dynamic linker to create the entry. */ - if (h) + if (dyn_i->want_fptr) + { + if (r_type == R_IA64_FPTR64I) + { + /* 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 position independent executable"), + bfd_archive_filename (input_bfd)); + ret_val = FALSE; + continue; + } + dynindx = 0; + addend = value; + dyn_r_type = r_type + R_IA64_REL64LSB - R_IA64_FPTR64LSB; + } + else if (h) { if (h->dynindx != -1) dynindx = h->dynindx; @@ -3949,17 +4170,18 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, dynindx = (_bfd_elf_link_lookup_local_dynindx (info, h->root.u.def.section->owner, global_sym_index (h))); + value = 0; } else { dynindx = (_bfd_elf_link_lookup_local_dynindx (info, input_bfd, (long) r_symndx)); + value = 0; } elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section, - srel, rel->r_offset, r_type, - dynindx, rel->r_addend); - value = 0; + srel, rel->r_offset, dyn_r_type, + dynindx, addend); } r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); @@ -3974,7 +4196,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, { long dynindx; - dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false); + 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) @@ -4013,9 +4235,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, case R_IA64_PCREL64MSB: case R_IA64_PCREL64LSB: /* Install a dynamic relocation for this reloc. */ - if ((dynamic_symbol_p - || elfNN_ia64_aix_vec (info->hash->creator)) - && r_symndx != 0) + if (dynamic_symbol_p && r_symndx != 0) { BFD_ASSERT (srel != NULL); @@ -4025,35 +4245,12 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, } 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_archive_filename (input_bfd)); - ret_val = false; - continue; - } - if (undef_weak_ref) - { - (*_bfd_error_handler) - (_("%s: speculation fixup against undefined weak symbol"), - bfd_archive_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); + dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, FALSE); if (dyn_i && dyn_i->want_plt2) { @@ -4079,8 +4276,32 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, } goto finish_pcrel; + case R_IA64_PCREL21BI: + case R_IA64_PCREL21F: + case R_IA64_PCREL21M: case R_IA64_PCREL22: case R_IA64_PCREL64I: + /* The PCREL21BI reloc is specifically not intended for use with + dynamic relocs. PCREL21F and PCREL21M are used for speculation + fixup code, and thus probably ought not be dynamic. The + PCREL22 and PCREL64I relocs aren't emitted as dynamic relocs. */ + if (dynamic_symbol_p) + { + const char *msg; + + if (r_type == R_IA64_PCREL21BI) + msg = _("%s: @internal branch to dynamic symbol %s"); + else if (r_type == R_IA64_PCREL21F || r_type == R_IA64_PCREL21M) + msg = _("%s: speculation fixup to dynamic symbol %s"); + else + msg = _("%s: @pcrel relocation against dynamic symbol %s"); + (*_bfd_error_handler) (msg, bfd_archive_filename (input_bfd), + h->root.root.string); + ret_val = FALSE; + continue; + } + goto finish_pcrel; + finish_pcrel: /* Make pc-relative. */ value -= (input_section->output_section->vma @@ -4112,7 +4333,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, { int i; for (i = m->count - 1; i >= 0; i--) - if (m->sections[i] == sym_sec->output_section) + if (m->sections[i] == input_section->output_section) break; if (i >= 0) break; @@ -4158,7 +4379,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, /* If we don't need dynamic symbol lookup, install two RELATIVE relocations. */ - if (! dynamic_symbol_p) + if (!dynamic_symbol_p) { unsigned int dyn_r_type; @@ -4201,6 +4422,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, case R_IA64_DTPREL14: case R_IA64_DTPREL22: case R_IA64_DTPREL64I: + case R_IA64_DTPREL64LSB: + case R_IA64_DTPREL64MSB: value -= elfNN_ia64_dtprel_base (info); r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); break; @@ -4210,13 +4433,23 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, case R_IA64_LTOFF_DTPREL22: { int got_r_type; + long dynindx = h ? h->dynindx : -1; + bfd_vma r_addend = rel->r_addend; switch (r_type) { default: case R_IA64_LTOFF_TPREL22: - if (!dynamic_symbol_p && !info->shared) - value -= elfNN_ia64_tprel_base (info); + if (!dynamic_symbol_p) + { + if (!info->shared) + value -= elfNN_ia64_tprel_base (info); + else + { + r_addend += value - elfNN_ia64_dtprel_base (info); + dynindx = 0; + } + } got_r_type = R_IA64_TPREL64LSB; break; case R_IA64_LTOFF_DTPMOD22: @@ -4230,9 +4463,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, got_r_type = R_IA64_DTPREL64LSB; break; } - 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, + dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, FALSE); + value = set_got_entry (input_bfd, info, dyn_i, dynindx, r_addend, value, got_r_type); value -= gp_val; r = elfNN_ia64_install_value (output_bfd, hit_addr, value, @@ -4256,7 +4488,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, don't try to continue. */ (*info->callbacks->undefined_symbol) (info, "__gp", input_bfd, input_section, rel->r_offset, 1); - return false; + return FALSE; case bfd_reloc_notsupported: { @@ -4270,15 +4502,15 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, symtab_hdr->sh_link, sym->st_name); if (name == NULL) - return false; + 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; + return FALSE; + ret_val = FALSE; } break; @@ -4297,7 +4529,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, symtab_hdr->sh_link, sym->st_name); if (name == NULL) - return false; + return FALSE; if (*name == '\0') name = bfd_section_name (input_bfd, input_section); } @@ -4307,8 +4539,8 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, input_bfd, input_section, rel->r_offset)) - return false; - ret_val = false; + return FALSE; + ret_val = FALSE; } break; } @@ -4317,7 +4549,7 @@ elfNN_ia64_relocate_section (output_bfd, info, input_bfd, input_section, return ret_val; } -static boolean +static bfd_boolean elfNN_ia64_finish_dynamic_symbol (output_bfd, info, h, sym) bfd *output_bfd; struct bfd_link_info *info; @@ -4328,7 +4560,7 @@ elfNN_ia64_finish_dynamic_symbol (output_bfd, info, h, sym) 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); + 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) @@ -4337,7 +4569,6 @@ elfNN_ia64_finish_dynamic_symbol (output_bfd, info, h, sym) 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); @@ -4355,7 +4586,7 @@ elfNN_ia64_finish_dynamic_symbol (output_bfd, info, h, sym) 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); + 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) @@ -4369,7 +4600,7 @@ elfNN_ia64_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. */ /* ??? We didn't redefine it in adjust_dynamic_symbol in the - first place. But perhaps elflink.h did some for us. */ + first place. But perhaps elflink.c did some for us. */ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) sym->st_shndx = SHN_UNDEF; } @@ -4394,10 +4625,10 @@ elfNN_ia64_finish_dynamic_symbol (output_bfd, info, h, sym) 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); + loc = ia64_info->rel_pltoff_sec->contents; + loc += ((ia64_info->rel_pltoff_sec->reloc_count + index) + * sizeof (ElfNN_External_Rela)); + bfd_elfNN_swap_reloca_out (output_bfd, &outrel, loc); } /* Mark some specially defined symbols as absolute. */ @@ -4406,10 +4637,10 @@ elfNN_ia64_finish_dynamic_symbol (output_bfd, info, h, sym) || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0) sym->st_shndx = SHN_ABS; - return true; + return TRUE; } -static boolean +static bfd_boolean elfNN_ia64_finish_dynamic_sections (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -4475,7 +4706,7 @@ elfNN_ia64_finish_dynamic_sections (abfd, info) bfd_elfNN_swap_dyn_out (abfd, &dyn, dyncon); } - /* Initialize the PLT0 entry */ + /* Initialize the PLT0 entry. */ if (ia64_info->plt_sec) { bfd_byte *loc = ia64_info->plt_sec->contents; @@ -4491,13 +4722,13 @@ elfNN_ia64_finish_dynamic_sections (abfd, info) } } - return true; + return TRUE; } -/* ELF file flag handling: */ +/* ELF file flag handling: */ /* Function to keep IA-64 specific file flags. */ -static boolean +static bfd_boolean elfNN_ia64_set_private_flags (abfd, flags) bfd *abfd; flagword flags; @@ -4506,31 +4737,31 @@ elfNN_ia64_set_private_flags (abfd, flags) || elf_elfheader (abfd)->e_flags == flags); elf_elfheader (abfd)->e_flags = flags; - elf_flags_init (abfd) = true; - return true; + elf_flags_init (abfd) = TRUE; + return TRUE; } /* Merge backend specific data from an object file to the output object file when linking. */ -static boolean +static bfd_boolean elfNN_ia64_merge_private_bfd_data (ibfd, obfd) bfd *ibfd, *obfd; { flagword out_flags; flagword in_flags; - boolean ok = true; + bfd_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; + 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_flags_init (obfd) = TRUE; elf_elfheader (obfd)->e_flags = in_flags; if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) @@ -4540,12 +4771,12 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd) bfd_get_mach (ibfd)); } - return true; + return TRUE; } /* Check flag compatibility. */ if (in_flags == out_flags) - return true; + 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)) @@ -4558,7 +4789,7 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd) bfd_archive_filename (ibfd)); bfd_set_error (bfd_error_bad_value); - ok = false; + ok = FALSE; } if ((in_flags & EF_IA_64_BE) != (out_flags & EF_IA_64_BE)) { @@ -4567,7 +4798,7 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd) bfd_archive_filename (ibfd)); bfd_set_error (bfd_error_bad_value); - ok = false; + ok = FALSE; } if ((in_flags & EF_IA_64_ABI64) != (out_flags & EF_IA_64_ABI64)) { @@ -4576,7 +4807,7 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd) bfd_archive_filename (ibfd)); bfd_set_error (bfd_error_bad_value); - ok = false; + ok = FALSE; } if ((in_flags & EF_IA_64_CONS_GP) != (out_flags & EF_IA_64_CONS_GP)) { @@ -4585,7 +4816,7 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd) bfd_archive_filename (ibfd)); bfd_set_error (bfd_error_bad_value); - ok = false; + ok = FALSE; } if ((in_flags & EF_IA_64_NOFUNCDESC_CONS_GP) != (out_flags & EF_IA_64_NOFUNCDESC_CONS_GP)) @@ -4595,13 +4826,13 @@ elfNN_ia64_merge_private_bfd_data (ibfd, obfd) bfd_archive_filename (ibfd)); bfd_set_error (bfd_error_bad_value); - ok = false; + ok = FALSE; } return ok; } -static boolean +static bfd_boolean elfNN_ia64_print_private_bfd_data (abfd, ptr) bfd *abfd; PTR ptr; @@ -4622,7 +4853,7 @@ elfNN_ia64_print_private_bfd_data (abfd, ptr) (flags & EF_IA_64_ABI64) ? "ABI64" : "ABI32"); _bfd_elf_print_private_bfd_data (abfd, ptr); - return true; + return TRUE; } static enum elf_reloc_type_class @@ -4646,7 +4877,14 @@ elfNN_ia64_reloc_type_class (rela) } } -static boolean +static struct bfd_elf_special_section const elfNN_ia64_special_sections[]= +{ + { ".sbss", 5, -1, SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, + { ".sdata", 6, -1, SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, + { NULL, 0, 0, 0, 0 } +}; + +static bfd_boolean elfNN_ia64_hpux_vec (const bfd_target *vec) { extern const bfd_target bfd_elfNN_ia64_hpux_big_vec; @@ -4664,7 +4902,7 @@ elfNN_hpux_post_process_headers (abfd, info) i_ehdrp->e_ident[EI_ABIVERSION] = 1; } -boolean +bfd_boolean elfNN_hpux_backend_section_from_bfd_section (abfd, sec, retval) bfd *abfd ATTRIBUTE_UNUSED; asection *sec; @@ -4673,10 +4911,27 @@ elfNN_hpux_backend_section_from_bfd_section (abfd, sec, retval) if (bfd_is_com_section (sec)) { *retval = SHN_IA_64_ANSI_COMMON; - return true; + return TRUE; + } + return FALSE; +} + +static void +elfNN_hpux_backend_symbol_processing (bfd *abfd ATTRIBUTE_UNUSED, + asymbol *asym) +{ + elf_symbol_type *elfsym = (elf_symbol_type *) asym;; + + switch (elfsym->internal_elf_sym.st_shndx) + { + case SHN_IA_64_ANSI_COMMON: + asym->section = bfd_com_section_ptr; + asym->value = elfsym->internal_elf_sym.st_size; + asym->flags &= ~BSF_GLOBAL; + break; } - return false; } + #define TARGET_LITTLE_SYM bfd_elfNN_ia64_little_vec #define TARGET_LITTLE_NAME "elfNN-ia64-little" @@ -4715,6 +4970,8 @@ elfNN_hpux_backend_section_from_bfd_section (abfd, sec, retval) /* Stuff for the BFD linker: */ #define bfd_elfNN_bfd_link_hash_table_create \ elfNN_ia64_hash_table_create +#define bfd_elfNN_bfd_link_hash_table_free \ + elfNN_ia64_hash_table_free #define elf_backend_create_dynamic_sections \ elfNN_ia64_create_dynamic_sections #define elf_backend_check_relocs \ @@ -4743,7 +5000,6 @@ elfNN_hpux_backend_section_from_bfd_section (abfd, sec, retval) #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 @@ -4753,27 +5009,7 @@ elfNN_hpux_backend_section_from_bfd_section (abfd, sec, retval) #define elf_backend_hide_symbol elfNN_ia64_hash_hide_symbol #define elf_backend_reloc_type_class elfNN_ia64_reloc_type_class #define elf_backend_rela_normal 1 - -#include "elfNN-target.h" - -/* AIX-specific vectors. */ - -#undef TARGET_LITTLE_SYM -#define TARGET_LITTLE_SYM bfd_elfNN_ia64_aix_little_vec -#undef TARGET_LITTLE_NAME -#define TARGET_LITTLE_NAME "elfNN-ia64-aix-little" -#undef TARGET_BIG_SYM -#define TARGET_BIG_SYM bfd_elfNN_ia64_aix_big_vec -#undef TARGET_BIG_NAME -#define TARGET_BIG_NAME "elfNN-ia64-aix-big" - -#undef elf_backend_add_symbol_hook -#define elf_backend_add_symbol_hook elfNN_ia64_aix_add_symbol_hook - -#undef bfd_elfNN_bfd_link_add_symbols -#define bfd_elfNN_bfd_link_add_symbols elfNN_ia64_aix_link_add_symbols - -#define elfNN_bed elfNN_ia64_aix_bed +#define elf_backend_special_sections elfNN_ia64_special_sections #include "elfNN-target.h" @@ -4786,14 +5022,6 @@ elfNN_hpux_backend_section_from_bfd_section (abfd, sec, retval) #undef TARGET_BIG_NAME #define TARGET_BIG_NAME "elfNN-ia64-hpux-big" -/* We need to undo the AIX specific functions. */ - -#undef elf_backend_add_symbol_hook -#define elf_backend_add_symbol_hook elfNN_ia64_add_symbol_hook - -#undef bfd_elfNN_bfd_link_add_symbols -#define bfd_elfNN_bfd_link_add_symbols _bfd_generic_link_add_symbols - /* These are HP-UX specific functions. */ #undef elf_backend_post_process_headers @@ -4802,6 +5030,9 @@ elfNN_hpux_backend_section_from_bfd_section (abfd, sec, retval) #undef elf_backend_section_from_bfd_section #define elf_backend_section_from_bfd_section elfNN_hpux_backend_section_from_bfd_section +#undef elf_backend_symbol_processing +#define elf_backend_symbol_processing elfNN_hpux_backend_symbol_processing + #undef elf_backend_want_p_paddr_set_to_zero #define elf_backend_want_p_paddr_set_to_zero 1 diff --git a/contrib/binutils/bfd/elfxx-target.h b/contrib/binutils/bfd/elfxx-target.h index 5d7efb0..e250a97 100644 --- a/contrib/binutils/bfd/elfxx-target.h +++ b/contrib/binutils/bfd/elfxx-target.h @@ -1,22 +1,22 @@ /* Target definitions for NN-bit ELF - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, + 2003 Free Software Foundation, Inc. -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. */ /* This structure contains everything that BFD knows about a target. It includes things like its byte order, name, what routines to call @@ -32,14 +32,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define bfd_elfNN_get_section_contents _bfd_generic_get_section_contents #endif -#define bfd_elfNN_canonicalize_dynamic_symtab _bfd_elf_canonicalize_dynamic_symtab +#define bfd_elfNN_canonicalize_dynamic_symtab \ + _bfd_elf_canonicalize_dynamic_symtab +#ifndef bfd_elfNN_canonicalize_reloc #define bfd_elfNN_canonicalize_reloc _bfd_elf_canonicalize_reloc +#endif #ifndef bfd_elfNN_find_nearest_line #define bfd_elfNN_find_nearest_line _bfd_elf_find_nearest_line #endif #define bfd_elfNN_read_minisymbols _bfd_elf_read_minisymbols #define bfd_elfNN_minisymbol_to_symbol _bfd_elf_minisymbol_to_symbol -#define bfd_elfNN_get_dynamic_symtab_upper_bound _bfd_elf_get_dynamic_symtab_upper_bound +#define bfd_elfNN_get_dynamic_symtab_upper_bound \ + _bfd_elf_get_dynamic_symtab_upper_bound #define bfd_elfNN_get_lineno _bfd_elf_get_lineno #ifndef bfd_elfNN_get_reloc_upper_bound #define bfd_elfNN_get_reloc_upper_bound _bfd_elf_get_reloc_upper_bound @@ -47,13 +51,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef bfd_elfNN_get_symbol_info #define bfd_elfNN_get_symbol_info _bfd_elf_get_symbol_info #endif -#define bfd_elfNN_get_symtab _bfd_elf_get_symtab +#define bfd_elfNN_canonicalize_symtab _bfd_elf_canonicalize_symtab #define bfd_elfNN_get_symtab_upper_bound _bfd_elf_get_symtab_upper_bound -#if 0 /* done in elf-bfd.h */ -#define bfd_elfNN_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol -#endif #define bfd_elfNN_make_empty_symbol _bfd_elf_make_empty_symbol +#ifndef bfd_elfNN_new_section_hook #define bfd_elfNN_new_section_hook _bfd_elf_new_section_hook +#endif #define bfd_elfNN_set_arch_mach _bfd_elf_set_arch_mach #ifndef bfd_elfNN_set_section_contents #define bfd_elfNN_set_section_contents _bfd_elf_set_section_contents @@ -96,11 +99,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define bfd_elfNN_bfd_debug_info_start bfd_void #define bfd_elfNN_bfd_debug_info_end bfd_void #define bfd_elfNN_bfd_debug_info_accumulate \ - (void (*) PARAMS ((bfd*, struct sec *))) bfd_void + ((void (*) (bfd*, struct bfd_section *)) bfd_void) #ifndef bfd_elfNN_bfd_get_relocated_section_contents #define bfd_elfNN_bfd_get_relocated_section_contents \ - bfd_generic_get_relocated_section_contents + bfd_generic_get_relocated_section_contents #endif #ifndef bfd_elfNN_bfd_relax_section @@ -123,7 +126,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define elf_backend_gc_sweep_hook NULL #endif #ifndef bfd_elfNN_bfd_gc_sections -#define bfd_elfNN_bfd_gc_sections _bfd_elfNN_gc_sections +#define bfd_elfNN_bfd_gc_sections bfd_elf_gc_sections #endif #ifndef bfd_elfNN_bfd_merge_sections @@ -137,7 +140,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef bfd_elfNN_bfd_make_debug_symbol #define bfd_elfNN_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, void *, unsigned long))) bfd_nullvoidptr) + ((asymbol * (*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) #endif #ifndef bfd_elfNN_bfd_copy_private_symbol_data @@ -159,11 +162,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #endif #ifndef bfd_elfNN_bfd_merge_private_bfd_data #define bfd_elfNN_bfd_merge_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) + ((bfd_boolean (*) (bfd *, bfd *)) bfd_true) #endif #ifndef bfd_elfNN_bfd_set_private_flags #define bfd_elfNN_bfd_set_private_flags \ - ((boolean (*) PARAMS ((bfd *, flagword))) bfd_true) + ((bfd_boolean (*) (bfd *, flagword)) bfd_true) #endif #ifndef bfd_elfNN_bfd_is_local_label_name #define bfd_elfNN_bfd_is_local_label_name _bfd_elf_is_local_label_name @@ -186,6 +189,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef bfd_elfNN_bfd_link_hash_table_create #define bfd_elfNN_bfd_link_hash_table_create _bfd_elf_link_hash_table_create #endif +#ifndef bfd_elfNN_bfd_link_add_symbols +#define bfd_elfNN_bfd_link_add_symbols bfd_elf_link_add_symbols +#endif +#ifndef bfd_elfNN_bfd_final_link +#define bfd_elfNN_bfd_final_link bfd_elf_final_link +#endif #else /* ! defined (elf_backend_relocate_section) */ /* If no backend relocate_section routine, use the generic linker. Note - this will prevent the port from being able to use some of @@ -232,6 +241,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define bfd_elfNN_mkarchive _bfd_generic_mkarchive #endif +#ifndef bfd_elfNN_print_symbol +#define bfd_elfNN_print_symbol bfd_elf_print_symbol +#endif + #ifndef elf_symbol_leading_char #define elf_symbol_leading_char 0 #endif @@ -250,10 +263,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #endif #ifndef elf_backend_collect -#define elf_backend_collect false +#define elf_backend_collect FALSE #endif #ifndef elf_backend_type_change_ok -#define elf_backend_type_change_ok false +#define elf_backend_type_change_ok FALSE #endif #ifndef elf_backend_sym_is_global @@ -271,6 +284,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef elf_backend_get_symbol_type #define elf_backend_get_symbol_type 0 #endif +#ifndef elf_backend_name_local_section_symbols +#define elf_backend_name_local_section_symbols 0 +#endif #ifndef elf_backend_section_processing #define elf_backend_section_processing 0 #endif @@ -334,12 +350,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef elf_backend_ecoff_debug_swap #define elf_backend_ecoff_debug_swap 0 #endif +#ifndef elf_backend_bfd_from_remote_memory +#define elf_backend_bfd_from_remote_memory _bfd_elfNN_bfd_from_remote_memory +#endif #ifndef elf_backend_got_header_size #define elf_backend_got_header_size 0 #endif -#ifndef elf_backend_plt_header_size -#define elf_backend_plt_header_size 0 -#endif #ifndef elf_backend_post_process_headers #define elf_backend_post_process_headers NULL #endif @@ -355,6 +371,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef elf_backend_hide_symbol #define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol #endif +#ifndef elf_backend_merge_symbol_attribute +#define elf_backend_merge_symbol_attribute NULL +#endif #ifndef elf_backend_emit_relocs #define elf_backend_emit_relocs NULL #endif @@ -382,6 +401,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef elf_backend_ignore_discarded_relocs #define elf_backend_ignore_discarded_relocs NULL #endif +#ifndef elf_backend_can_make_relative_eh_frame +#define elf_backend_can_make_relative_eh_frame _bfd_elf_can_make_relative +#endif +#ifndef elf_backend_can_make_lsda_relative_eh_frame +#define elf_backend_can_make_lsda_relative_eh_frame _bfd_elf_can_make_relative +#endif +#ifndef elf_backend_encode_eh_address +#define elf_backend_encode_eh_address _bfd_elf_encode_eh_address +#endif #ifndef elf_backend_write_section #define elf_backend_write_section NULL #endif @@ -398,9 +426,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ For backwards compatibility, we still support this usage. */ #ifndef USE_REL #define USE_REL 0 -#else -#undef USE_REL -#define USE_REL 1 #endif /* Use these in new code. */ @@ -430,6 +455,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define elf_backend_size_info _bfd_elfNN_size_info #endif +#ifndef elf_backend_special_sections +#define elf_backend_special_sections NULL +#endif + #ifndef elf_backend_sign_extend_vma #define elf_backend_sign_extend_vma 0 #endif @@ -449,6 +478,7 @@ static const struct elf_backend_data elfNN_bed = elf_backend_symbol_processing, elf_backend_symbol_table_processing, elf_backend_get_symbol_type, + elf_backend_name_local_section_symbols, elf_backend_section_processing, elf_backend_section_from_shdr, elf_backend_section_flags, @@ -476,6 +506,7 @@ static const struct elf_backend_data elfNN_bed = elf_backend_output_arch_syms, elf_backend_copy_indirect_symbol, elf_backend_hide_symbol, + elf_backend_merge_symbol_attribute, elf_backend_emit_relocs, elf_backend_count_relocs, elf_backend_grok_prstatus, @@ -485,16 +516,20 @@ static const struct elf_backend_data elfNN_bed = elf_backend_reloc_type_class, elf_backend_discard_info, elf_backend_ignore_discarded_relocs, + elf_backend_can_make_relative_eh_frame, + elf_backend_can_make_lsda_relative_eh_frame, + elf_backend_encode_eh_address, elf_backend_write_section, elf_backend_mips_irix_compat, elf_backend_mips_rtype_to_howto, elf_backend_ecoff_debug_swap, + elf_backend_bfd_from_remote_memory, ELF_MACHINE_ALT1, ELF_MACHINE_ALT2, &elf_backend_size_info, + elf_backend_special_sections, elf_backend_got_symbol_offset, elf_backend_got_header_size, - elf_backend_plt_header_size, elf_backend_collect, elf_backend_type_change_ok, elf_backend_may_use_rel_p, @@ -590,19 +625,19 @@ const bfd_target TARGET_BIG_SYM = bfd_elfNN_write_corefile_contents, }, - BFD_JUMP_TABLE_GENERIC (bfd_elfNN), - BFD_JUMP_TABLE_COPY (bfd_elfNN), - BFD_JUMP_TABLE_CORE (bfd_elfNN), + BFD_JUMP_TABLE_GENERIC (bfd_elfNN), + BFD_JUMP_TABLE_COPY (bfd_elfNN), + BFD_JUMP_TABLE_CORE (bfd_elfNN), #ifdef bfd_elfNN_archive_functions - BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive), + BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive), #else - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), #endif - BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN), - BFD_JUMP_TABLE_RELOCS (bfd_elfNN), - BFD_JUMP_TABLE_WRITE (bfd_elfNN), - BFD_JUMP_TABLE_LINK (bfd_elfNN), - BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN), + BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN), + BFD_JUMP_TABLE_RELOCS (bfd_elfNN), + BFD_JUMP_TABLE_WRITE (bfd_elfNN), + BFD_JUMP_TABLE_LINK (bfd_elfNN), + BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN), /* Alternative endian target. */ #ifdef TARGET_LITTLE_SYM @@ -612,7 +647,7 @@ const bfd_target TARGET_BIG_SYM = #endif /* backend_data: */ - (PTR) &elfNN_bed + &elfNN_bed }; #endif @@ -686,19 +721,19 @@ const bfd_target TARGET_LITTLE_SYM = bfd_elfNN_write_corefile_contents, }, - BFD_JUMP_TABLE_GENERIC (bfd_elfNN), - BFD_JUMP_TABLE_COPY (bfd_elfNN), - BFD_JUMP_TABLE_CORE (bfd_elfNN), + BFD_JUMP_TABLE_GENERIC (bfd_elfNN), + BFD_JUMP_TABLE_COPY (bfd_elfNN), + BFD_JUMP_TABLE_CORE (bfd_elfNN), #ifdef bfd_elfNN_archive_functions - BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive), + BFD_JUMP_TABLE_ARCHIVE (bfd_elfNN_archive), #else - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), #endif - BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN), - BFD_JUMP_TABLE_RELOCS (bfd_elfNN), - BFD_JUMP_TABLE_WRITE (bfd_elfNN), - BFD_JUMP_TABLE_LINK (bfd_elfNN), - BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN), + BFD_JUMP_TABLE_SYMBOLS (bfd_elfNN), + BFD_JUMP_TABLE_RELOCS (bfd_elfNN), + BFD_JUMP_TABLE_WRITE (bfd_elfNN), + BFD_JUMP_TABLE_LINK (bfd_elfNN), + BFD_JUMP_TABLE_DYNAMIC (bfd_elfNN), /* Alternative endian target. */ #ifdef TARGET_BIG_SYM @@ -708,6 +743,6 @@ const bfd_target TARGET_LITTLE_SYM = #endif /* backend_data: */ - (PTR) &elfNN_bed + &elfNN_bed }; #endif diff --git a/contrib/binutils/bfd/format.c b/contrib/binutils/bfd/format.c index ef6b46e..9d9ee86 100644 --- a/contrib/binutils/bfd/format.c +++ b/contrib/binutils/bfd/format.c @@ -1,23 +1,23 @@ /* Generic BFD support for file formats. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. -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. */ /* SECTION @@ -52,7 +52,7 @@ FUNCTION bfd_check_format SYNOPSIS - boolean bfd_check_format(bfd *abfd, bfd_format format); + bfd_boolean bfd_check_format (bfd *abfd, bfd_format format); DESCRIPTION Verify if the file attached to the BFD @var{abfd} is compatible @@ -67,7 +67,7 @@ DESCRIPTION matches, it is used. If not, exactly one target must recognize the file, or an error results. - The function returns <> on success, otherwise <> + The function returns <> on success, otherwise <> with one of the following error codes: o <> - @@ -85,10 +85,8 @@ DESCRIPTION more than one backend recognised the file format. */ -boolean -bfd_check_format (abfd, format) - bfd *abfd; - bfd_format format; +bfd_boolean +bfd_check_format (bfd *abfd, bfd_format format) { return bfd_check_format_matches (abfd, format, NULL); } @@ -98,10 +96,11 @@ FUNCTION bfd_check_format_matches SYNOPSIS - boolean bfd_check_format_matches(bfd *abfd, bfd_format format, char ***matching); + bfd_boolean bfd_check_format_matches + (bfd *abfd, bfd_format format, char ***matching); DESCRIPTION - Like <>, except when it returns false with + Like <>, except when it returns FALSE with <> set to <>. In that case, if @var{matching} is not NULL, it will be filled in with a NULL-terminated list of the names of the formats that matched, @@ -112,15 +111,13 @@ DESCRIPTION should free it. */ -boolean -bfd_check_format_matches (abfd, format, matching) - bfd *abfd; - bfd_format format; - char ***matching; +bfd_boolean +bfd_check_format_matches (bfd *abfd, bfd_format format, char ***matching) { extern const bfd_target binary_vec; - const bfd_target * const *target, *save_targ, *right_targ, *ar_right_targ; - char **matching_vector = NULL; + const bfd_target * const *target; + const bfd_target **matching_vector = NULL; + const bfd_target *save_targ, *right_targ, *ar_right_targ; int match_count; int ar_match_index; @@ -128,11 +125,11 @@ bfd_check_format_matches (abfd, format, matching) || (unsigned int) abfd->format >= (unsigned int) bfd_type_end) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } if (abfd->format != bfd_unknown) - return (boolean) (abfd->format == format); + return abfd->format == format; /* Since the target type was defaulted, check them all in the hope that one will be uniquely recognized. */ @@ -145,10 +142,10 @@ bfd_check_format_matches (abfd, format, matching) bfd_size_type amt; *matching = NULL; - amt = sizeof (char *) * 2 * _bfd_target_vector_entries; - matching_vector = (char **) bfd_malloc (amt); + amt = sizeof (*matching_vector) * 2 * _bfd_target_vector_entries; + matching_vector = bfd_malloc (amt); if (!matching_vector) - return false; + return FALSE; } right_targ = 0; @@ -161,7 +158,11 @@ bfd_check_format_matches (abfd, format, matching) if (!abfd->target_defaulted) { if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) /* rewind! */ - return false; + { + if (matching) + free (matching_vector); + return FALSE; + } right_targ = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); @@ -172,7 +173,7 @@ bfd_check_format_matches (abfd, format, matching) if (matching) free (matching_vector); - return true; /* File position has moved, BTW. */ + return TRUE; /* File position has moved, BTW. */ } /* For a long time the code has dropped through to check all @@ -197,7 +198,7 @@ bfd_check_format_matches (abfd, format, matching) bfd_set_error (bfd_error_file_not_recognized); - return false; + return FALSE; } } @@ -209,10 +210,14 @@ bfd_check_format_matches (abfd, format, matching) if (*target == &binary_vec) continue; - abfd->xvec = *target; /* Change BFD's target temporarily */ + abfd->xvec = *target; /* Change BFD's target temporarily. */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) - return false; + { + if (matching) + free (matching_vector); + return FALSE; + } /* If _bfd_check_format neglects to set bfd_error, assume bfd_error_wrong_format. We didn't used to even pay any @@ -223,7 +228,8 @@ bfd_check_format_matches (abfd, format, matching) temp = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); if (temp) - { /* This format checks out as ok! */ + { + /* This format checks out as ok! */ right_targ = temp; /* If this is the default target, accept it, even if other @@ -236,7 +242,7 @@ bfd_check_format_matches (abfd, format, matching) } if (matching) - matching_vector[match_count] = temp->name; + matching_vector[match_count] = temp; match_count++; @@ -259,7 +265,7 @@ bfd_check_format_matches (abfd, format, matching) if (ar_right_targ != bfd_default_vector[0]) ar_right_targ = *target; if (matching) - matching_vector[ar_match_index] = (*target)->name; + matching_vector[ar_match_index] = *target; ar_match_index++; } else if (err != bfd_error_wrong_format) @@ -270,7 +276,7 @@ bfd_check_format_matches (abfd, format, matching) if (matching) free (matching_vector); - return false; + return FALSE; } } @@ -278,6 +284,7 @@ bfd_check_format_matches (abfd, format, matching) { /* Try partial matches. */ right_targ = ar_right_targ; + if (right_targ == bfd_default_vector[0]) { match_count = 1; @@ -285,11 +292,32 @@ bfd_check_format_matches (abfd, format, matching) else { match_count = ar_match_index - _bfd_target_vector_entries; + if (matching && match_count > 1) + memcpy (matching_vector, + matching_vector + _bfd_target_vector_entries, + sizeof (*matching_vector) * match_count); + } + } + + if (match_count > 1 + && bfd_associated_vector != NULL + && matching) + { + const bfd_target * const *assoc = bfd_associated_vector; + + while ((right_targ = *assoc++) != NULL) + { + int i = match_count; + + while (--i >= 0) + if (matching_vector[i] == right_targ) + break; + + if (i >= 0) { - memcpy (matching_vector, - matching_vector + _bfd_target_vector_entries, - sizeof (char *) * match_count); + match_count = 1; + break; } } } @@ -301,7 +329,7 @@ bfd_check_format_matches (abfd, format, matching) if (matching) free (matching_vector); - return true; /* File position has moved, BTW. */ + return TRUE; /* File position has moved, BTW. */ } abfd->xvec = save_targ; /* Restore original target type. */ @@ -320,12 +348,19 @@ bfd_check_format_matches (abfd, format, matching) if (matching) { - *matching = matching_vector; + *matching = (char **) matching_vector; matching_vector[match_count] = NULL; + /* Return target names. This is a little nasty. Maybe we + should do another bfd_malloc? */ + while (--match_count >= 0) + { + const char *name = matching_vector[match_count]->name; + *(const char **) &matching_vector[match_count] = name; + } } } - return false; + return FALSE; } /* @@ -333,7 +368,7 @@ FUNCTION bfd_set_format SYNOPSIS - boolean bfd_set_format(bfd *abfd, bfd_format format); + bfd_boolean bfd_set_format (bfd *abfd, bfd_format format); DESCRIPTION This function sets the file format of the BFD @var{abfd} to the @@ -342,20 +377,18 @@ DESCRIPTION is not open for writing, then an error occurs. */ -boolean -bfd_set_format (abfd, format) - bfd *abfd; - bfd_format format; +bfd_boolean +bfd_set_format (bfd *abfd, bfd_format format) { if (bfd_read_p (abfd) || (unsigned int) abfd->format >= (unsigned int) bfd_type_end) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } if (abfd->format != bfd_unknown) - return (boolean) (abfd->format == format); + return abfd->format == format; /* Presume the answer is yes. */ abfd->format = format; @@ -363,10 +396,10 @@ bfd_set_format (abfd, format) if (!BFD_SEND_FMT (abfd, _bfd_set_format, (abfd))) { abfd->format = bfd_unknown; - return false; + return FALSE; } - return true; + return TRUE; } /* @@ -374,7 +407,7 @@ FUNCTION bfd_format_string SYNOPSIS - const char *bfd_format_string(bfd_format format); + const char *bfd_format_string (bfd_format format); DESCRIPTION Return a pointer to a const string @@ -383,17 +416,16 @@ DESCRIPTION */ const char * -bfd_format_string (format) - bfd_format format; +bfd_format_string (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. */ + return "object"; /* Linker/assembler/compiler output. */ case bfd_archive: return "archive"; /* Object archive file. */ case bfd_core: diff --git a/contrib/binutils/bfd/freebsd.h b/contrib/binutils/bfd/freebsd.h index c2e3af0..424484f 100644 --- a/contrib/binutils/bfd/freebsd.h +++ b/contrib/binutils/bfd/freebsd.h @@ -1,5 +1,5 @@ /* BFD back-end definitions used by all FreeBSD targets. - Copyright 1990, 1991, 1992, 1996, 1997, 2000, 2001 + Copyright 1990, 1991, 1992, 1996, 1997, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -61,7 +61,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #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)); +static bfd_boolean MY(write_object_contents) PARAMS ((bfd *abfd)); #include "aout-target.h" @@ -69,7 +69,7 @@ static boolean MY(write_object_contents) PARAMS ((bfd *abfd)); Section contents have already been written. We write the file header, symbols, and relocation. */ -static boolean +static bfd_boolean MY(write_object_contents) (abfd) bfd *abfd; { @@ -102,5 +102,5 @@ MY(write_object_contents) (abfd) WRITE_HEADERS(abfd, execp); - return true; + return TRUE; } diff --git a/contrib/binutils/bfd/gen-aout.c b/contrib/binutils/bfd/gen-aout.c index b6720e8..ea207db 100644 --- a/contrib/binutils/bfd/gen-aout.c +++ b/contrib/binutils/bfd/gen-aout.c @@ -1,5 +1,5 @@ /* Generate parameters for an a.out system. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2001 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. diff --git a/contrib/binutils/bfd/genlink.h b/contrib/binutils/bfd/genlink.h index 215666a..bcdc34b 100644 --- a/contrib/binutils/bfd/genlink.h +++ b/contrib/binutils/bfd/genlink.h @@ -1,5 +1,5 @@ /* genlink.h -- interface to the BFD generic linker - Copyright 1993, 1994, 1996 Free Software Foundation, Inc. + Copyright 1993, 1994, 1996, 2002 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -42,7 +42,7 @@ struct generic_link_hash_entry { struct bfd_link_hash_entry root; /* Whether this symbol has been written out. */ - boolean written; + bfd_boolean written; /* Symbol from input BFD. */ asymbol *sym; }; @@ -54,18 +54,18 @@ struct generic_link_hash_table struct bfd_link_hash_table root; }; -/* Look up an entry in an generic link hash table. */ +/* Look up an entry in a generic link hash table. */ #define _bfd_generic_link_hash_lookup(table, string, create, copy, follow) \ ((struct generic_link_hash_entry *) \ bfd_link_hash_lookup (&(table)->root, (string), (create), (copy), (follow))) -/* Traverse an generic link hash table. */ +/* Traverse a generic link hash table. */ #define _bfd_generic_link_hash_traverse(table, func, info) \ (bfd_link_hash_traverse \ (&(table)->root, \ - (boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \ (info))) /* Get the generic link hash table from the info structure. This is @@ -82,7 +82,7 @@ struct generic_link_hash_table /* Add the symbols of input_bfd to the symbols being built for output_bfd. */ -extern boolean _bfd_generic_link_output_symbols +extern bfd_boolean _bfd_generic_link_output_symbols PARAMS ((bfd *output_bfd, bfd *input_bfd, struct bfd_link_info *, size_t *psymalloc)); @@ -100,7 +100,7 @@ struct generic_write_global_symbol_info /* Write out a single global symbol. This is expected to be called via _bfd_generic_link_hash_traverse. The second argument must actually be a struct generic_write_global_symbol_info *. */ -extern boolean _bfd_generic_link_write_global_symbol +extern bfd_boolean _bfd_generic_link_write_global_symbol PARAMS ((struct generic_link_hash_entry *, PTR)); /* Generic link hash table entry creation routine. */ diff --git a/contrib/binutils/bfd/hash.c b/contrib/binutils/bfd/hash.c index e7c77fe..58fa532 100644 --- a/contrib/binutils/bfd/hash.c +++ b/contrib/binutils/bfd/hash.c @@ -1,5 +1,5 @@ /* hash.c -- hash table routines for BFD - Copyright 1993, 1994, 1995, 1997, 1999, 2001, 2002 + Copyright 1993, 1994, 1995, 1997, 1999, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Steve Chamberlain @@ -67,7 +67,7 @@ SUBSECTION <> (if you know approximately how many entries you will need, the function <>, which takes a @var{size} argument, may be used). - <> returns <> if some sort of + <> returns <> if some sort of error occurs. @findex bfd_hash_newfunc @@ -96,24 +96,24 @@ SUBSECTION The function <> is used both to look up a string in the hash table and to create a new entry. - If the @var{create} argument is <>, <> + If the @var{create} argument is <>, <> will look up a string. If the string is found, it will returns a pointer to a <>. If the string is not found in the table <> will return <>. You should not modify any of the fields in the returns <>. - If the @var{create} argument is <>, the string will be + If the @var{create} argument is <>, the string will be entered into the hash table if it is not already there. Either way a pointer to a <> will be returned, either to the existing structure or to a newly created one. In this case, a <> return means that an error occurred. - If the @var{create} argument is <>, and a new entry is + If the @var{create} argument is <>, and a new entry is created, the @var{copy} argument is used to decide whether to copy the string onto the hash table objalloc or not. If - @var{copy} is passed as <>, you must be careful not to + @var{copy} is passed as <>, you must be careful not to deallocate or modify the string as long as the hash table exists. @@ -133,7 +133,7 @@ SUBSECTION generic pointer passed to <>. The function must return a <> value, which indicates whether to continue traversing the hash table. If the function returns - <>, <> will stop the traversal and + <>, <> will stop the traversal and return immediately. INODE @@ -299,7 +299,7 @@ SUBSUBSECTION /* Create a new hash table, given a number of entries. */ -boolean +bfd_boolean bfd_hash_table_init_n (table, newfunc, size) struct bfd_hash_table *table; struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *, @@ -315,24 +315,24 @@ bfd_hash_table_init_n (table, newfunc, size) if (table->memory == NULL) { bfd_set_error (bfd_error_no_memory); - return false; + return FALSE; } table->table = ((struct bfd_hash_entry **) objalloc_alloc ((struct objalloc *) table->memory, alloc)); if (table->table == NULL) { bfd_set_error (bfd_error_no_memory); - return false; + return FALSE; } memset ((PTR) table->table, 0, alloc); table->size = size; table->newfunc = newfunc; - return true; + return TRUE; } /* Create a new hash table with the default number of entries. */ -boolean +bfd_boolean bfd_hash_table_init (table, newfunc) struct bfd_hash_table *table; struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *, @@ -358,8 +358,8 @@ struct bfd_hash_entry * bfd_hash_lookup (table, string, create, copy) struct bfd_hash_table *table; const char *string; - boolean create; - boolean copy; + bfd_boolean create; + bfd_boolean copy; { register const unsigned char *s; register unsigned long hash; @@ -446,7 +446,6 @@ bfd_hash_replace (table, old, nw) /* Base method for creating a new hash table entry. */ -/*ARGSUSED*/ struct bfd_hash_entry * bfd_hash_newfunc (entry, table, string) struct bfd_hash_entry *entry; @@ -479,7 +478,7 @@ bfd_hash_allocate (table, size) void bfd_hash_traverse (table, func, info) struct bfd_hash_table *table; - boolean (*func) PARAMS ((struct bfd_hash_entry *, PTR)); + bfd_boolean (*func) PARAMS ((struct bfd_hash_entry *, PTR)); PTR info; { unsigned int i; @@ -532,7 +531,7 @@ struct bfd_strtab_hash struct strtab_hash_entry *last; /* Whether to precede strings with a two byte length, as in the XCOFF .debug section. */ - boolean xcoff; + bfd_boolean xcoff; }; static struct bfd_hash_entry *strtab_hash_newfunc @@ -597,7 +596,7 @@ _bfd_stringtab_init () table->size = 0; table->first = NULL; table->last = NULL; - table->xcoff = false; + table->xcoff = FALSE; return table; } @@ -613,7 +612,7 @@ _bfd_xcoff_stringtab_init () ret = _bfd_stringtab_init (); if (ret != NULL) - ret->xcoff = true; + ret->xcoff = TRUE; return ret; } @@ -628,21 +627,21 @@ _bfd_stringtab_free (table) } /* Get the index of a string in a strtab, adding it if it is not - already present. If HASH is false, we don't really use the hash + already present. If HASH is FALSE, we don't really use the hash table, and we don't eliminate duplicate strings. */ bfd_size_type _bfd_stringtab_add (tab, str, hash, copy) struct bfd_strtab_hash *tab; const char *str; - boolean hash; - boolean copy; + bfd_boolean hash; + bfd_boolean copy; { register struct strtab_hash_entry *entry; if (hash) { - entry = strtab_hash_lookup (tab, str, true, copy); + entry = strtab_hash_lookup (tab, str, TRUE, copy); if (entry == NULL) return (bfd_size_type) -1; } @@ -699,12 +698,12 @@ _bfd_stringtab_size (tab) /* Write out a strtab. ABFD must already be at the right location in the file. */ -boolean +bfd_boolean _bfd_stringtab_emit (abfd, tab) register bfd *abfd; struct bfd_strtab_hash *tab; { - register boolean xcoff; + register bfd_boolean xcoff; register struct strtab_hash_entry *entry; xcoff = tab->xcoff; @@ -724,12 +723,12 @@ _bfd_stringtab_emit (abfd, tab) /* The output length includes the null byte. */ bfd_put_16 (abfd, (bfd_vma) len, buf); if (bfd_bwrite ((PTR) buf, (bfd_size_type) 2, abfd) != 2) - return false; + return FALSE; } if (bfd_bwrite ((PTR) str, (bfd_size_type) len, abfd) != len) - return false; + return FALSE; } - return true; + return TRUE; } diff --git a/contrib/binutils/bfd/i386aout.c b/contrib/binutils/bfd/i386aout.c index c68dbec..6b2948e 100644 --- a/contrib/binutils/bfd/i386aout.c +++ b/contrib/binutils/bfd/i386aout.c @@ -1,5 +1,5 @@ /* BFD back-end for i386 a.out binaries. - Copyright 1990, 1991, 1992, 1994, 1996, 1997, 2001 + Copyright 1990, 1991, 1992, 1994, 1996, 1997, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ system, and I'll stick it in for the next release. */ #define N_HEADER_IN_TEXT(x) 0 -#define BYTES_IN_WORD 4 #define N_TXTOFF(x) 0x20 #define N_TXTADDR(x) (N_MAGIC(x)==ZMAGIC ? 0x1020 : 0) @@ -54,12 +53,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "aout/aout64.h" #include "libaout.h" -static boolean i386aout_write_object_contents PARAMS ((bfd *)); -static boolean MY (set_sizes) PARAMS ((bfd *)); +static bfd_boolean i386aout_write_object_contents PARAMS ((bfd *)); +static bfd_boolean MY (set_sizes) PARAMS ((bfd *)); /* Set the machine type correctly. */ -static boolean +static bfd_boolean i386aout_write_object_contents (abfd) bfd *abfd; { @@ -72,7 +71,7 @@ i386aout_write_object_contents (abfd) WRITE_HEADERS (abfd, execp); - return true; + return TRUE; } #define MY_write_object_contents i386aout_write_object_contents diff --git a/contrib/binutils/bfd/i386linux.c b/contrib/binutils/bfd/i386linux.c index c144822..da36e75 100644 --- a/contrib/binutils/bfd/i386linux.c +++ b/contrib/binutils/bfd/i386linux.c @@ -1,5 +1,5 @@ /* BFD back-end for linux flavored i386 a.out binaries. - Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2001, 2002 + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define SEGMENT_SIZE TARGET_PAGE_SIZE #define TEXT_START_ADDR 0x0 #define N_SHARED_LIB(x) 0 -#define BYTES_IN_WORD 4 #define MACHTYPE_OK(mtype) ((mtype) == M_386 || (mtype) == M_UNKNOWN) @@ -51,11 +50,11 @@ extern const bfd_target MY(vec); static void MY_final_link_callback PARAMS ((bfd *, file_ptr *, file_ptr *, file_ptr *)); -static boolean i386linux_bfd_final_link +static bfd_boolean i386linux_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *)); -static boolean i386linux_write_object_contents PARAMS ((bfd *)); +static bfd_boolean i386linux_write_object_contents PARAMS ((bfd *)); -static boolean +static bfd_boolean i386linux_bfd_final_link (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -68,7 +67,7 @@ i386linux_bfd_final_link (abfd, info) /* Set the machine type correctly. */ -static boolean +static bfd_boolean i386linux_write_object_contents (abfd) bfd *abfd; { @@ -81,7 +80,7 @@ i386linux_write_object_contents (abfd) WRITE_HEADERS(abfd, execp); - return true; + return TRUE; } #define MY_write_object_contents i386linux_write_object_contents @@ -113,7 +112,7 @@ i386linux_write_object_contents (abfd) #endif /* This special symbol is a set vector that contains a list of - pointers to fixup tables. It will be present in any dynamicly + pointers to fixup tables. It will be present in any dynamically linked file. The linker generated fixup table should also be added to the list, and it should always appear in the second slot (the first one is a dummy with a magic number that is defined in @@ -179,15 +178,15 @@ static struct bfd_link_hash_table *linux_link_hash_table_create static struct fixup *new_fixup PARAMS ((struct bfd_link_info *, struct linux_link_hash_entry *, bfd_vma, int)); -static boolean linux_link_create_dynamic_sections +static bfd_boolean linux_link_create_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static boolean linux_add_one_symbol +static bfd_boolean linux_add_one_symbol PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, asection *, - bfd_vma, const char *, boolean, boolean, + bfd_vma, const char *, bfd_boolean, bfd_boolean, struct bfd_link_hash_entry **)); -static boolean linux_tally_symbols +static bfd_boolean linux_tally_symbols PARAMS ((struct linux_link_hash_entry *, PTR)); -static boolean linux_finish_dynamic_link +static bfd_boolean linux_finish_dynamic_link PARAMS ((bfd *, struct bfd_link_info *)); /* Routine to create an entry in an Linux link hash table. */ @@ -259,7 +258,7 @@ linux_link_hash_table_create (abfd) #define linux_link_hash_traverse(table, func, info) \ (aout_link_hash_traverse \ (&(table)->root, \ - (boolean (*) PARAMS ((struct aout_link_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) PARAMS ((struct aout_link_hash_entry *, PTR))) (func), \ (info))) /* Get the Linux link hash table from the info structure. This is @@ -299,7 +298,7 @@ new_fixup (info, h, value, builtin) know the size of the section, but that's OK - we just need to create it for now. */ -static boolean +static bfd_boolean linux_link_create_dynamic_sections (abfd, info) bfd *abfd; struct bfd_link_info *info ATTRIBUTE_UNUSED; @@ -316,18 +315,18 @@ linux_link_create_dynamic_sections (abfd, info) if (s == NULL || ! bfd_set_section_flags (abfd, s, flags) || ! bfd_set_section_alignment (abfd, s, 2)) - return false; + return FALSE; s->_raw_size = 0; s->contents = 0; - return true; + return TRUE; } /* Function to add a single symbol to the linker hash table. This is a wrapper around _bfd_generic_link_add_one_symbol which handles the tweaking needed for dynamic linking support. */ -static boolean +static bfd_boolean linux_add_one_symbol (info, abfd, name, flags, section, value, string, copy, collect, hashp) struct bfd_link_info *info; @@ -337,12 +336,12 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, asection *section; bfd_vma value; const char *string; - boolean copy; - boolean collect; + bfd_boolean copy; + bfd_boolean collect; struct bfd_link_hash_entry **hashp; { struct linux_link_hash_entry *h; - boolean insert; + bfd_boolean insert; /* Look up and see if we already have this symbol in the hash table. If we do, and the defining entry is from a shared library, we @@ -352,25 +351,25 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, be able to link Linux a.out and ELF objects together, but serious confusion is possible. */ - insert = false; + insert = FALSE; - if (! info->relocateable + if (! info->relocatable && linux_hash_table (info)->dynobj == NULL && strcmp (name, SHARABLE_CONFLICTS) == 0 && (flags & BSF_CONSTRUCTOR) != 0 && abfd->xvec == info->hash->creator) { if (! linux_link_create_dynamic_sections (abfd, info)) - return false; + return FALSE; linux_hash_table (info)->dynobj = abfd; - insert = true; + insert = TRUE; } if (bfd_is_abs_section (section) && abfd->xvec == info->hash->creator) { - h = linux_link_hash_lookup (linux_hash_table (info), name, false, - false, false); + h = linux_link_hash_lookup (linux_hash_table (info), name, FALSE, + FALSE, FALSE); if (h != NULL && (h->root.root.type == bfd_link_hash_defined || h->root.root.type == bfd_link_hash_defweak)) @@ -382,10 +381,10 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, f = new_fixup (info, h, value, ! IS_PLT_SYM (name)); if (f == NULL) - return false; + return FALSE; f->jump = IS_PLT_SYM (name); - return true; + return TRUE; } } @@ -393,7 +392,7 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, if (! _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, string, copy, collect, hashp)) - return false; + return FALSE; /* Insert a pointer to our table in the set vector. The dynamic linker requires this information */ @@ -410,11 +409,11 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, if (! (_bfd_generic_link_add_one_symbol (info, linux_hash_table (info)->dynobj, SHARABLE_CONFLICTS, BSF_GLOBAL | BSF_CONSTRUCTOR, s, (bfd_vma) 0, NULL, - false, false, NULL))) - return false; + FALSE, FALSE, NULL))) + return FALSE; } - return true; + return TRUE; } /* We will crawl the hash table and come here for every global symbol. @@ -427,7 +426,7 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, This function is called via linux_link_hash_traverse. */ -static boolean +static bfd_boolean linux_tally_symbols (h, data) struct linux_link_hash_entry *h; PTR data; @@ -436,7 +435,7 @@ linux_tally_symbols (h, data) struct fixup *f, *f1; int is_plt; struct linux_link_hash_entry *h1, *h2; - boolean exists; + bfd_boolean exists; if (h->root.root.type == bfd_link_hash_warning) h = (struct linux_link_hash_entry *) h->root.root.u.i.link; @@ -482,12 +481,12 @@ linux_tally_symbols (h, data) h1 = linux_link_hash_lookup (linux_hash_table (info), (h->root.root.root.string + sizeof PLT_REF_PREFIX - 1), - false, false, true); + FALSE, FALSE, TRUE); /* 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); + FALSE, FALSE, FALSE); /* The real symbol must exist but if it is also an ABS symbol, there is no need to have a fixup. This is because they both @@ -505,7 +504,7 @@ linux_tally_symbols (h, data) involving this symbol. If so, convert it to a regular fixup. In the end, this relaxes some of the requirements about the order of performing fixups. */ - exists = false; + exists = FALSE; for (f1 = linux_hash_table (info)->fixup_list; f1 != NULL; f1 = f1->next) @@ -514,7 +513,7 @@ linux_tally_symbols (h, data) || (! f1->builtin && ! f1->jump)) continue; if (f1->h == h1) - exists = true; + exists = TRUE; if (! exists && bfd_is_abs_section (h->root.root.u.def.section)) { @@ -524,7 +523,7 @@ linux_tally_symbols (h, data) f1->h = h1; f1->jump = is_plt; f1->builtin = 0; - exists = true; + exists = TRUE; } if (! exists && bfd_is_abs_section (h->root.root.u.def.section)) @@ -542,10 +541,10 @@ linux_tally_symbols (h, data) /* Quick and dirty way of stripping these symbols from the symtab. */ if (bfd_is_abs_section (h->root.root.u.def.section)) - h->root.written = true; + h->root.written = TRUE; } - return true; + return TRUE; } /* This is called to set the size of the .linux-dynamic section is. @@ -554,7 +553,7 @@ linux_tally_symbols (h, data) we just scan the hash tables to find out how many additional fixups are required. */ -boolean +bfd_boolean bfd_i386linux_size_dynamic_sections (output_bfd, info) bfd *output_bfd; struct bfd_link_info *info; @@ -563,7 +562,7 @@ bfd_i386linux_size_dynamic_sections (output_bfd, info) asection *s; if (output_bfd->xvec != &MY(vec)) - return true; + return TRUE; /* First find the fixups... */ linux_link_hash_traverse (linux_hash_table (info), @@ -587,7 +586,7 @@ bfd_i386linux_size_dynamic_sections (output_bfd, info) { if (linux_hash_table (info)->fixup_count > 0) abort (); - return true; + return TRUE; } /* Allocate memory for our fixup table. We will fill it in later. */ @@ -599,17 +598,17 @@ bfd_i386linux_size_dynamic_sections (output_bfd, info) s->_raw_size *= 8; s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->_raw_size); if (s->contents == NULL) - return false; + return FALSE; } - return true; + return TRUE; } /* We come here once we are ready to actually write the fixup table to the output file. Scan the fixup tables and so forth and generate the stuff we need. */ -static boolean +static bfd_boolean linux_finish_dynamic_link (output_bfd, info) bfd *output_bfd; struct bfd_link_info *info; @@ -623,7 +622,7 @@ linux_finish_dynamic_link (output_bfd, info) unsigned int fixups_written; if (linux_hash_table (info)->dynobj == NULL) - return true; + return TRUE; s = bfd_get_section_by_name (linux_hash_table (info)->dynobj, ".linux-dynamic"); @@ -739,7 +738,7 @@ linux_finish_dynamic_link (output_bfd, info) h = linux_link_hash_lookup (linux_hash_table (info), "__BUILTIN_FIXUPS__", - false, false, false); + FALSE, FALSE, FALSE); if (h != NULL && (h->root.root.type == bfd_link_hash_defined @@ -760,12 +759,12 @@ linux_finish_dynamic_link (output_bfd, info) if (bfd_seek (output_bfd, (file_ptr) (os->filepos + s->output_offset), SEEK_SET) != 0) - return false; + return FALSE; if (bfd_bwrite ((PTR) s->contents, s->_raw_size, output_bfd) != s->_raw_size) - return false; + return FALSE; - return true; + return TRUE; } #define MY_bfd_link_hash_table_create linux_link_hash_table_create diff --git a/contrib/binutils/bfd/ieee.c b/contrib/binutils/bfd/ieee.c index d1c5eb1..8a08028 100644 --- a/contrib/binutils/bfd/ieee.c +++ b/contrib/binutils/bfd/ieee.c @@ -1,6 +1,6 @@ /* BFD back-end for ieee-695 objects. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. @@ -40,93 +40,151 @@ struct output_buffer_struct int buffer; }; -static boolean ieee_write_byte PARAMS ((bfd *, int)); -static boolean ieee_write_2bytes PARAMS ((bfd *, int)); -static boolean ieee_write_int PARAMS ((bfd *, bfd_vma)); -static boolean ieee_write_id PARAMS ((bfd *, const char *)); -static unsigned short read_2bytes PARAMS ((common_header_type *)); -static void bfd_get_string PARAMS ((common_header_type *, char *, size_t)); -static char *read_id PARAMS ((common_header_type *)); -static boolean ieee_write_expression - PARAMS ((bfd *, bfd_vma, asymbol *, boolean, unsigned int)); -static void ieee_write_int5 PARAMS ((bfd_byte *, bfd_vma)); -static boolean ieee_write_int5_out PARAMS ((bfd *, bfd_vma)); -static boolean parse_int PARAMS ((common_header_type *, bfd_vma *)); -static int parse_i PARAMS ((common_header_type *, boolean *)); -static bfd_vma must_parse_int PARAMS ((common_header_type *)); +static bfd_boolean ieee_write_byte + PARAMS ((bfd *, int)); +static bfd_boolean ieee_write_2bytes + PARAMS ((bfd *, int)); +static bfd_boolean ieee_write_int + PARAMS ((bfd *, bfd_vma)); +static bfd_boolean ieee_write_id + PARAMS ((bfd *, const char *)); +static unsigned short read_2bytes + PARAMS ((common_header_type *)); +static void bfd_get_string + PARAMS ((common_header_type *, char *, size_t)); +static char *read_id + PARAMS ((common_header_type *)); +static bfd_boolean ieee_write_expression + PARAMS ((bfd *, bfd_vma, asymbol *, bfd_boolean, unsigned int)); +static void ieee_write_int5 + PARAMS ((bfd_byte *, bfd_vma)); +static bfd_boolean ieee_write_int5_out + PARAMS ((bfd *, bfd_vma)); +static bfd_boolean parse_int + PARAMS ((common_header_type *, bfd_vma *)); +static int parse_i + PARAMS ((common_header_type *, bfd_boolean *)); +static bfd_vma must_parse_int + PARAMS ((common_header_type *)); static void parse_expression PARAMS ((ieee_data_type *, bfd_vma *, ieee_symbol_index_type *, - boolean *, unsigned int *, asection **)); -static file_ptr ieee_part_after PARAMS ((ieee_data_type *, file_ptr)); + bfd_boolean *, unsigned int *, asection **)); +static file_ptr ieee_part_after + PARAMS ((ieee_data_type *, file_ptr)); static ieee_symbol_type *get_symbol PARAMS ((bfd *, ieee_data_type *, ieee_symbol_type *, unsigned int *, ieee_symbol_type ***, unsigned int *, int)); -static boolean ieee_slurp_external_symbols PARAMS ((bfd *)); -static boolean ieee_slurp_symbol_table PARAMS ((bfd *)); -static long ieee_get_symtab_upper_bound PARAMS ((bfd *)); -static long ieee_get_symtab PARAMS ((bfd *, asymbol **)); +static bfd_boolean ieee_slurp_external_symbols + PARAMS ((bfd *)); +static bfd_boolean ieee_slurp_symbol_table + PARAMS ((bfd *)); +static long ieee_get_symtab_upper_bound + PARAMS ((bfd *)); +static long ieee_canonicalize_symtab + PARAMS ((bfd *, asymbol **)); static asection *get_section_entry PARAMS ((bfd *, ieee_data_type *i, unsigned int)); -static void ieee_slurp_sections PARAMS ((bfd *)); -static boolean ieee_slurp_debug PARAMS ((bfd *)); -const bfd_target *ieee_archive_p PARAMS ((bfd *)); -const bfd_target *ieee_object_p PARAMS ((bfd *)); -static void ieee_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); +static void ieee_slurp_sections + PARAMS ((bfd *)); +static bfd_boolean ieee_slurp_debug + PARAMS ((bfd *)); +const bfd_target *ieee_archive_p + PARAMS ((bfd *)); +const bfd_target *ieee_object_p + PARAMS ((bfd *)); +static void ieee_get_symbol_info + PARAMS ((bfd *, asymbol *, symbol_info *)); static void ieee_print_symbol PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); -static boolean do_one +static bfd_boolean do_one PARAMS ((ieee_data_type *, ieee_per_section_type *, unsigned char *, asection *, int)); -static boolean ieee_slurp_section_data PARAMS ((bfd *)); -static boolean ieee_new_section_hook PARAMS ((bfd *, asection *)); -static long ieee_get_reloc_upper_bound PARAMS ((bfd *, sec_ptr)); -static boolean ieee_get_section_contents +static bfd_boolean ieee_slurp_section_data + PARAMS ((bfd *)); +static bfd_boolean ieee_new_section_hook + PARAMS ((bfd *, asection *)); +static long ieee_get_reloc_upper_bound + PARAMS ((bfd *, sec_ptr)); +static bfd_boolean ieee_get_section_contents PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); static long ieee_canonicalize_reloc PARAMS ((bfd *, sec_ptr, arelent **, asymbol **)); -static int comp PARAMS ((const PTR, const PTR)); -static boolean ieee_write_section_part PARAMS ((bfd *)); -static boolean do_with_relocs PARAMS ((bfd *, asection *)); -static boolean do_as_repeat PARAMS ((bfd *, asection *)); -static boolean do_without_relocs PARAMS ((bfd *, asection *)); -static boolean ieee_mkobject PARAMS ((bfd *)); -static void fill PARAMS ((void)); -static void flush PARAMS ((void)); -static void write_int PARAMS ((int)); -static void copy_id PARAMS ((void)); -static void copy_expression PARAMS ((void)); -static void fill_int PARAMS ((struct output_buffer_struct *)); -static void drop_int PARAMS ((struct output_buffer_struct *)); -static void copy_int PARAMS ((void)); -static void f1_record PARAMS ((void)); -static void f0_record PARAMS ((void)); -static void copy_till_end PARAMS ((void)); -static void f2_record PARAMS ((void)); -static void f8_record PARAMS ((void)); -static void e2_record PARAMS ((void)); -static void block PARAMS ((void)); -static void relocate_debug PARAMS ((bfd *, bfd *)); -static boolean ieee_write_debug_part PARAMS ((bfd *)); -static boolean ieee_write_data_part PARAMS ((bfd *)); -static boolean init_for_output PARAMS ((bfd *)); -static boolean ieee_set_section_contents - PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); -static boolean ieee_write_external_part PARAMS ((bfd *)); -static boolean ieee_write_me_part PARAMS ((bfd *)); -static boolean ieee_write_processor PARAMS ((bfd *)); -static boolean ieee_write_object_contents PARAMS ((bfd *)); -static asymbol *ieee_make_empty_symbol PARAMS ((bfd *)); -static bfd *ieee_openr_next_archived_file PARAMS ((bfd *, bfd *)); -static boolean ieee_find_nearest_line +static int comp + PARAMS ((const PTR, const PTR)); +static bfd_boolean ieee_write_section_part + PARAMS ((bfd *)); +static bfd_boolean do_with_relocs + PARAMS ((bfd *, asection *)); +static bfd_boolean do_as_repeat + PARAMS ((bfd *, asection *)); +static bfd_boolean do_without_relocs + PARAMS ((bfd *, asection *)); +static bfd_boolean ieee_mkobject + PARAMS ((bfd *)); +static void fill + PARAMS ((void)); +static void flush + PARAMS ((void)); +static void write_int + PARAMS ((int)); +static void copy_id + PARAMS ((void)); +static void copy_expression + PARAMS ((void)); +static void fill_int + PARAMS ((struct output_buffer_struct *)); +static void drop_int + PARAMS ((struct output_buffer_struct *)); +static void copy_int + PARAMS ((void)); +static void f1_record + PARAMS ((void)); +static void f0_record + PARAMS ((void)); +static void copy_till_end + PARAMS ((void)); +static void f2_record + PARAMS ((void)); +static void f8_record + PARAMS ((void)); +static void e2_record + PARAMS ((void)); +static void block + PARAMS ((void)); +static void relocate_debug + PARAMS ((bfd *, bfd *)); +static bfd_boolean ieee_write_debug_part + PARAMS ((bfd *)); +static bfd_boolean ieee_write_data_part + PARAMS ((bfd *)); +static bfd_boolean init_for_output + PARAMS ((bfd *)); +static bfd_boolean ieee_set_section_contents + PARAMS ((bfd *, sec_ptr, const PTR, file_ptr, bfd_size_type)); +static bfd_boolean ieee_write_external_part + PARAMS ((bfd *)); +static bfd_boolean ieee_write_me_part + PARAMS ((bfd *)); +static bfd_boolean ieee_write_processor + PARAMS ((bfd *)); +static bfd_boolean ieee_write_object_contents + PARAMS ((bfd *)); +static asymbol *ieee_make_empty_symbol + PARAMS ((bfd *)); +static bfd *ieee_openr_next_archived_file + PARAMS ((bfd *, bfd *)); +static bfd_boolean ieee_find_nearest_line PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *)); -static int ieee_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); -static int ieee_sizeof_headers PARAMS ((bfd *, boolean)); +static int ieee_generic_stat_arch_elt + PARAMS ((bfd *, struct stat *)); +static int ieee_sizeof_headers + PARAMS ((bfd *, bfd_boolean)); /* Functions for writing to ieee files in the strange way that the standard requires. */ -static boolean +static bfd_boolean ieee_write_byte (abfd, barg) bfd *abfd; int barg; @@ -135,11 +193,11 @@ ieee_write_byte (abfd, barg) byte = barg; if (bfd_bwrite ((PTR) &byte, (bfd_size_type) 1, abfd) != 1) - return false; - return true; + return FALSE; + return TRUE; } -static boolean +static bfd_boolean ieee_write_2bytes (abfd, bytes) bfd *abfd; int bytes; @@ -149,11 +207,11 @@ ieee_write_2bytes (abfd, bytes) buffer[0] = bytes >> 8; buffer[1] = bytes & 0xff; if (bfd_bwrite ((PTR) buffer, (bfd_size_type) 2, abfd) != 2) - return false; - return true; + return FALSE; + return TRUE; } -static boolean +static bfd_boolean ieee_write_int (abfd, value) bfd *abfd; bfd_vma value; @@ -161,14 +219,14 @@ ieee_write_int (abfd, value) if (value <= 127) { if (! ieee_write_byte (abfd, (bfd_byte) value)) - return false; + return FALSE; } else { unsigned int length; - /* How many significant bytes ? */ - /* FIXME FOR LONGER INTS */ + /* How many significant bytes ? */ + /* FIXME FOR LONGER INTS. */ if (value & 0xff000000) length = 4; else if (value & 0x00ff0000) @@ -181,31 +239,31 @@ ieee_write_int (abfd, value) if (! ieee_write_byte (abfd, (bfd_byte) ((int) ieee_number_repeat_start_enum + length))) - return false; + return FALSE; switch (length) { case 4: if (! ieee_write_byte (abfd, (bfd_byte) (value >> 24))) - return false; + return FALSE; /* Fall through. */ case 3: if (! ieee_write_byte (abfd, (bfd_byte) (value >> 16))) - return false; + return FALSE; /* Fall through. */ case 2: if (! ieee_write_byte (abfd, (bfd_byte) (value >> 8))) - return false; + return FALSE; /* Fall through. */ case 1: if (! ieee_write_byte (abfd, (bfd_byte) (value))) - return false; + return FALSE; } } - return true; + return TRUE; } -static boolean +static bfd_boolean ieee_write_id (abfd, id) bfd *abfd; const char *id; @@ -215,19 +273,19 @@ ieee_write_id (abfd, id) if (length <= 127) { if (! ieee_write_byte (abfd, (bfd_byte) length)) - return false; + return FALSE; } else if (length < 255) { if (! ieee_write_byte (abfd, ieee_extension_length_1_enum) || ! ieee_write_byte (abfd, (bfd_byte) length)) - return false; + return FALSE; } else if (length < 65535) { if (! ieee_write_byte (abfd, ieee_extension_length_2_enum) || ! ieee_write_2bytes (abfd, (int) length)) - return false; + return FALSE; } else { @@ -235,18 +293,16 @@ ieee_write_id (abfd, id) (_("%s: string too long (%d chars, max 65535)"), bfd_get_filename (abfd), length); bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } if (bfd_bwrite ((PTR) id, (bfd_size_type) length, abfd) != length) - return false; - return true; + return FALSE; + return TRUE; } -/*************************************************************************** -Functions for reading from ieee files in the strange way that the -standard requires: -*/ +/* Functions for reading from ieee files in the strange way that the + standard requires. */ #define this_byte(ieee) *((ieee)->input_p) #define next_byte(ieee) ((ieee)->input_p++) @@ -258,6 +314,7 @@ read_2bytes (ieee) { unsigned char c1 = this_byte_and_next (ieee); unsigned char c2 = this_byte_and_next (ieee); + return (c1 << 8) | c2; } @@ -268,10 +325,9 @@ bfd_get_string (ieee, string, length) size_t length; { size_t i; + for (i = 0; i < length; i++) - { - string[i] = this_byte_and_next (ieee); - } + string[i] = this_byte_and_next (ieee); } static char * @@ -280,23 +336,25 @@ read_id (ieee) { size_t length; char *string; + length = this_byte_and_next (ieee); if (length <= 0x7f) { - /* Simple string of length 0 to 127 */ + /* Simple string of length 0 to 127. */ } else if (length == 0xde) { - /* Length is next byte, allowing 0..255 */ + /* Length is next byte, allowing 0..255. */ length = this_byte_and_next (ieee); } else if (length == 0xdf) { - /* Length is next two bytes, allowing 0..65535 */ + /* Length is next two bytes, allowing 0..65535. */ length = this_byte_and_next (ieee); length = (length * 256) + this_byte_and_next (ieee); } - /* Buy memory and read string */ + + /* Buy memory and read string. */ string = bfd_alloc (ieee->abfd, (bfd_size_type) length + 1); if (!string) return NULL; @@ -305,12 +363,12 @@ read_id (ieee) return string; } -static boolean +static bfd_boolean ieee_write_expression (abfd, value, symbol, pcrel, index) bfd *abfd; bfd_vma value; asymbol *symbol; - boolean pcrel; + bfd_boolean pcrel; unsigned int index; { unsigned int term_count = 0; @@ -318,90 +376,91 @@ ieee_write_expression (abfd, value, symbol, pcrel, index) if (value != 0) { if (! ieee_write_int (abfd, value)) - return false; + return FALSE; term_count++; } - if (bfd_is_com_section (symbol->section) - || bfd_is_und_section (symbol->section)) - { - /* Def of a common symbol */ - if (! ieee_write_byte (abfd, ieee_variable_X_enum) - || ! ieee_write_int (abfd, symbol->value)) - return false; - term_count++; - } - else if (! bfd_is_abs_section (symbol->section)) + /* Badly formatted binaries can have a missing symbol, + so test here to prevent a seg fault. */ + if (symbol != NULL) { - /* Ref to defined symbol - */ - - if (symbol->flags & BSF_GLOBAL) + if (bfd_is_com_section (symbol->section) + || bfd_is_und_section (symbol->section)) { - if (! ieee_write_byte (abfd, ieee_variable_I_enum) + /* Def of a common symbol. */ + if (! ieee_write_byte (abfd, ieee_variable_X_enum) || ! ieee_write_int (abfd, symbol->value)) - return false; - term_count++; + return FALSE; + term_count ++; } - else if (symbol->flags & (BSF_LOCAL | BSF_SECTION_SYM)) + else if (! bfd_is_abs_section (symbol->section)) { - /* This is a reference to a defined local symbol. We can - easily do a local as a section+offset. */ - if (! ieee_write_byte (abfd, ieee_variable_R_enum) - || ! ieee_write_byte (abfd, - (bfd_byte) (symbol->section->index - + IEEE_SECTION_NUMBER_BASE))) - return false; - term_count++; - if (symbol->value != 0) + /* Ref to defined symbol - */ + + if (symbol->flags & BSF_GLOBAL) { - if (! ieee_write_int (abfd, symbol->value)) - return false; + if (! ieee_write_byte (abfd, ieee_variable_I_enum) + || ! ieee_write_int (abfd, symbol->value)) + return FALSE; term_count++; } - } - else - { - (*_bfd_error_handler) - (_("%s: unrecognized symbol `%s' flags 0x%x"), - bfd_get_filename (abfd), bfd_asymbol_name (symbol), - symbol->flags); - bfd_set_error (bfd_error_invalid_operation); - return false; + else if (symbol->flags & (BSF_LOCAL | BSF_SECTION_SYM)) + { + /* This is a reference to a defined local symbol. We can + easily do a local as a section+offset. */ + if (! ieee_write_byte (abfd, ieee_variable_R_enum) + || ! ieee_write_byte (abfd, + (bfd_byte) (symbol->section->index + + IEEE_SECTION_NUMBER_BASE))) + return FALSE; + + term_count++; + if (symbol->value != 0) + { + if (! ieee_write_int (abfd, symbol->value)) + return FALSE; + term_count++; + } + } + else + { + (*_bfd_error_handler) + (_("%s: unrecognized symbol `%s' flags 0x%x"), + bfd_get_filename (abfd), bfd_asymbol_name (symbol), + symbol->flags); + bfd_set_error (bfd_error_invalid_operation); + return FALSE; + } } } if (pcrel) { - /* subtract the pc from here by asking for PC of this section*/ + /* Subtract the pc from here by asking for PC of this section. */ if (! ieee_write_byte (abfd, ieee_variable_P_enum) || ! ieee_write_byte (abfd, (bfd_byte) (index + IEEE_SECTION_NUMBER_BASE)) || ! ieee_write_byte (abfd, ieee_function_minus_enum)) - return false; + return FALSE; } /* Handle the degenerate case of a 0 address. */ if (term_count == 0) - { - if (! ieee_write_int (abfd, (bfd_vma) 0)) - return false; - } + if (! ieee_write_int (abfd, (bfd_vma) 0)) + return FALSE; while (term_count > 1) { if (! ieee_write_byte (abfd, ieee_function_plus_enum)) - return false; + return FALSE; term_count--; } - return true; + return TRUE; } -/*****************************************************************************/ +/* Writes any integer into the buffer supplied and always takes 5 bytes. */ -/* -writes any integer into the buffer supplied and always takes 5 bytes -*/ static void ieee_write_int5 (buffer, value) bfd_byte *buffer; @@ -414,7 +473,7 @@ ieee_write_int5 (buffer, value) buffer[4] = (value >> 0) & 0xff; } -static boolean +static bfd_boolean ieee_write_int5_out (abfd, value) bfd *abfd; bfd_vma value; @@ -423,26 +482,28 @@ ieee_write_int5_out (abfd, value) ieee_write_int5 (b, value); if (bfd_bwrite ((PTR) b, (bfd_size_type) 5, abfd) != 5) - return false; - return true; + return FALSE; + return TRUE; } -static boolean +static bfd_boolean parse_int (ieee, value_ptr) common_header_type *ieee; bfd_vma *value_ptr; { int value = this_byte (ieee); int result; + if (value >= 0 && value <= 127) { *value_ptr = value; next_byte (ieee); - return true; + return TRUE; } else if (value >= 0x80 && value <= 0x88) { unsigned int count = value & 0xf; + result = 0; next_byte (ieee); while (count) @@ -451,15 +512,15 @@ parse_int (ieee, value_ptr) count--; } *value_ptr = result; - return true; + return TRUE; } - return false; + return FALSE; } static int parse_i (ieee, ok) common_header_type *ieee; - boolean *ok; + bfd_boolean *ok; { bfd_vma x; *ok = parse_int (ieee, &x); @@ -486,12 +547,12 @@ typedef struct #if KEEPMINUSPCININST #define SRC_MASK(arg) arg -#define PCREL_OFFSET false +#define PCREL_OFFSET FALSE #else #define SRC_MASK(arg) 0 -#define PCREL_OFFSET true +#define PCREL_OFFSET TRUE #endif @@ -500,57 +561,57 @@ static reloc_howto_type abs32_howto = 0, 2, 32, - false, + FALSE, 0, complain_overflow_bitfield, 0, "abs32", - true, + TRUE, 0xffffffff, 0xffffffff, - false); + FALSE); static reloc_howto_type abs16_howto = HOWTO (1, 0, 1, 16, - false, + FALSE, 0, complain_overflow_bitfield, 0, "abs16", - true, + TRUE, 0x0000ffff, 0x0000ffff, - false); + FALSE); static reloc_howto_type abs8_howto = HOWTO (1, 0, 0, 8, - false, + FALSE, 0, complain_overflow_bitfield, 0, "abs8", - true, + TRUE, 0x000000ff, 0x000000ff, - false); + FALSE); static reloc_howto_type rel32_howto = HOWTO (1, 0, 2, 32, - true, + TRUE, 0, complain_overflow_signed, 0, "rel32", - true, + TRUE, SRC_MASK (0xffffffff), 0xffffffff, PCREL_OFFSET); @@ -560,12 +621,12 @@ static reloc_howto_type rel16_howto = 0, 1, 16, - true, + TRUE, 0, complain_overflow_signed, 0, "rel16", - true, + TRUE, SRC_MASK (0x0000ffff), 0x0000ffff, PCREL_OFFSET); @@ -575,12 +636,12 @@ static reloc_howto_type rel8_howto = 0, 0, 8, - true, + TRUE, 0, complain_overflow_signed, 0, "rel8", - true, + TRUE, SRC_MASK (0x000000ff), 0x000000ff, PCREL_OFFSET); @@ -592,7 +653,7 @@ parse_expression (ieee, value, symbol, pcrel, extra, section) ieee_data_type *ieee; bfd_vma *value; ieee_symbol_index_type *symbol; - boolean *pcrel; + bfd_boolean *pcrel; unsigned int *extra; asection **section; @@ -603,10 +664,10 @@ parse_expression (ieee, value, symbol, pcrel, extra, section) #define INC sp++; #define DEC sp--; - boolean loop = true; + bfd_boolean loop = TRUE; ieee_value_type stack[10]; - /* The stack pointer always points to the next unused location */ + /* The stack pointer always points to the next unused location. */ #define PUSH(x,y,z) TOS.symbol=x;TOS.section=y;TOS.value=z;INC; #define POP(x,y,z) DEC;x=TOS.symbol;y=TOS.section;z=TOS.value; ieee_value_type *sp = stack; @@ -617,35 +678,36 @@ parse_expression (ieee, value, symbol, pcrel, extra, section) switch (this_byte (&(ieee->h))) { case ieee_variable_P_enum: - /* P variable, current program counter for section n */ + /* P variable, current program counter for section n. */ { int section_n; + next_byte (&(ieee->h)); - *pcrel = true; + *pcrel = TRUE; section_n = must_parse_int (&(ieee->h)); PUSH (NOSYMBOL, bfd_abs_section_ptr, 0); break; } case ieee_variable_L_enum: - /* L variable address of section N */ + /* L variable address of section N. */ next_byte (&(ieee->h)); PUSH (NOSYMBOL, ieee->section_table[must_parse_int (&(ieee->h))], 0); break; case ieee_variable_R_enum: - /* R variable, logical address of section module */ - /* FIXME, this should be different to L */ + /* R variable, logical address of section module. */ + /* FIXME, this should be different to L. */ next_byte (&(ieee->h)); PUSH (NOSYMBOL, ieee->section_table[must_parse_int (&(ieee->h))], 0); break; case ieee_variable_S_enum: - /* S variable, size in MAUS of section module */ + /* S variable, size in MAUS of section module. */ next_byte (&(ieee->h)); PUSH (NOSYMBOL, 0, ieee->section_table[must_parse_int (&(ieee->h))]->_raw_size); break; case ieee_variable_I_enum: - /* Push the address of variable n */ + /* Push the address of variable n. */ { ieee_symbol_index_type sy; next_byte (&(ieee->h)); @@ -656,7 +718,7 @@ parse_expression (ieee, value, symbol, pcrel, extra, section) } break; case ieee_variable_X_enum: - /* Push the address of external variable n */ + /* Push the address of external variable n. */ { ieee_symbol_index_type sy; next_byte (&(ieee->h)); @@ -706,7 +768,7 @@ parse_expression (ieee, value, symbol, pcrel, extra, section) else { /* Thats all that we can understand. */ - loop = false; + loop = FALSE; } } } @@ -718,7 +780,6 @@ parse_expression (ieee, value, symbol, pcrel, extra, section) terms. We can tell if that's the case by ensuring that sp == stack here. If not, then we've pushed something too far, so we keep adding. */ - while (sp != stack + 1) { asection *section1; @@ -764,7 +825,7 @@ ieee_part_after (ieee, here) } static unsigned int last_index; -static char last_type; /* is the index for an X or a D */ +static char last_type; /* Is the index for an X or a D. */ static ieee_symbol_type * get_symbol (abfd, ieee, last_symbol, symbol_count, pptr, max_index, this_type) @@ -776,8 +837,9 @@ get_symbol (abfd, ieee, last_symbol, symbol_count, pptr, max_index, this_type) unsigned int *max_index; int this_type; { - /* Need a new symbol */ + /* Need a new symbol. */ unsigned int new_index = must_parse_int (&(ieee->h)); + if (new_index != last_index || this_type != last_type) { ieee_symbol_type *new_symbol; @@ -793,9 +855,8 @@ get_symbol (abfd, ieee, last_symbol, symbol_count, pptr, max_index, this_type) **pptr = new_symbol; *pptr = &new_symbol->next; if (new_index > *max_index) - { - *max_index = new_index; - } + *max_index = new_index; + last_type = this_type; new_symbol->symbol.section = bfd_abs_section_ptr; return new_symbol; @@ -803,7 +864,7 @@ get_symbol (abfd, ieee, last_symbol, symbol_count, pptr, max_index, this_type) return last_symbol; } -static boolean +static bfd_boolean ieee_slurp_external_symbols (abfd) bfd *abfd; { @@ -814,9 +875,9 @@ ieee_slurp_external_symbols (abfd) ieee_symbol_type **prev_reference_ptr = &ieee->external_reference; ieee_symbol_type *symbol = (ieee_symbol_type *) NULL; unsigned int symbol_count = 0; - boolean loop = true; + bfd_boolean loop = TRUE; last_index = 0xffffff; - ieee->symbol_table_full = true; + ieee->symbol_table_full = TRUE; ieee_seek (ieee, offset); @@ -831,7 +892,7 @@ ieee_slurp_external_symbols (abfd) &prev_symbols_ptr, &ieee->external_symbol_max_index, 'I'); if (symbol == NULL) - return false; + return FALSE; symbol->symbol.the_bfd = abfd; symbol->symbol.name = read_id (&(ieee->h)); @@ -845,7 +906,7 @@ ieee_slurp_external_symbols (abfd) &prev_symbols_ptr, &ieee->external_symbol_max_index, 'D'); if (symbol == NULL) - return false; + return FALSE; BFD_ASSERT (symbol->index >= ieee->external_symbol_min_index); @@ -878,12 +939,12 @@ ieee_slurp_external_symbols (abfd) bfd_archive_filename (abfd), symbol_attribute_def, symbol_name_index); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; break; } break; case ieee_external_reference_info_record_enum: - /* Skip over ATX record. */ + /* Skip over ATX record. */ parse_int (&(ieee->h), &value); parse_int (&(ieee->h), &value); parse_int (&(ieee->h), &value); @@ -892,7 +953,7 @@ ieee_slurp_external_symbols (abfd) case ieee_atn_record_enum: /* We may get call optimization information here, which we just ignore. The format is - {$F1}${CE}{index}{$00}{$3F}{$3F}{#_of_ASNs} */ + {$F1}${CE}{index}{$00}{$3F}{$3F}{#_of_ASNs}. */ parse_int (&ieee->h, &value); parse_int (&ieee->h, &value); parse_int (&ieee->h, &value); @@ -902,7 +963,7 @@ ieee_slurp_external_symbols (abfd) (_("%s: unexpected ATN type %d in external part"), bfd_archive_filename (abfd), (int) value); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } parse_int (&ieee->h, &value); parse_int (&ieee->h, &value); @@ -924,7 +985,7 @@ ieee_slurp_external_symbols (abfd) (_("%s: unexpected type after ATN"), bfd_archive_filename (abfd)); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } } } @@ -934,7 +995,7 @@ ieee_slurp_external_symbols (abfd) { unsigned int symbol_name_index; ieee_symbol_index_type symbol_ignore; - boolean pcrel_ignore; + bfd_boolean pcrel_ignore; unsigned int extra; next_byte (&(ieee->h)); next_byte (&(ieee->h)); @@ -978,16 +1039,16 @@ ieee_slurp_external_symbols (abfd) bfd_vma size; bfd_vma value; next_byte (&(ieee->h)); - /* Throw away the external reference index */ + /* Throw away the external reference index. */ (void) must_parse_int (&(ieee->h)); - /* Fetch the default size if not resolved */ + /* Fetch the default size if not resolved. */ size = must_parse_int (&(ieee->h)); - /* Fetch the defautlt value if available */ + /* Fetch the default value if available. */ if (! parse_int (&(ieee->h), &value)) { value = 0; } - /* This turns into a common */ + /* This turns into a common. */ symbol->symbol.section = bfd_com_section_ptr; symbol->symbol.value = size; } @@ -1000,7 +1061,7 @@ ieee_slurp_external_symbols (abfd) &prev_reference_ptr, &ieee->external_reference_max_index, 'X'); if (symbol == NULL) - return false; + return FALSE; symbol->symbol.the_bfd = abfd; symbol->symbol.name = read_id (&(ieee->h)); @@ -1013,7 +1074,7 @@ ieee_slurp_external_symbols (abfd) break; default: - loop = false; + loop = FALSE; } } @@ -1045,26 +1106,26 @@ ieee_slurp_external_symbols (abfd) if (symbol_count != abfd->symcount) { /* There are gaps in the table -- */ - ieee->symbol_table_full = false; + ieee->symbol_table_full = FALSE; } *prev_symbols_ptr = (ieee_symbol_type *) NULL; *prev_reference_ptr = (ieee_symbol_type *) NULL; - return true; + return TRUE; } -static boolean +static bfd_boolean ieee_slurp_symbol_table (abfd) bfd *abfd; { if (! IEEE_DATA (abfd)->read_symbols) { if (! ieee_slurp_external_symbols (abfd)) - return false; - IEEE_DATA (abfd)->read_symbols = true; + return FALSE; + IEEE_DATA (abfd)->read_symbols = TRUE; } - return true; + return TRUE; } static long @@ -1078,15 +1139,13 @@ ieee_get_symtab_upper_bound (abfd) (abfd->symcount + 1) * (sizeof (ieee_symbol_type *)) : 0; } -/* -Move from our internal lists to the canon table, and insert in -symbol index order -*/ +/* Move from our internal lists to the canon table, and insert in + symbol index order. */ extern const bfd_target ieee_vec; static long -ieee_get_symtab (abfd, location) +ieee_canonicalize_symtab (abfd, location) bfd *abfd; asymbol **location; { @@ -1114,41 +1173,35 @@ ieee_get_symtab (abfd, location) if (! ieee->symbol_table_full) { - /* Arrgh - there are gaps in the table, run through and fill them */ - /* up with pointers to a null place */ + /* Arrgh - there are gaps in the table, run through and fill them + up with pointers to a null place. */ unsigned int i; + for (i = 0; i < abfd->symcount; i++) - { - location[i] = &empty_symbol; - } + location[i] = &empty_symbol; } ieee->external_symbol_base_offset = -ieee->external_symbol_min_index; for (symp = IEEE_DATA (abfd)->external_symbols; symp != (ieee_symbol_type *) NULL; symp = symp->next) - { - /* Place into table at correct index locations */ - location[symp->index + ieee->external_symbol_base_offset] = &symp->symbol; - } + /* Place into table at correct index locations. */ + location[symp->index + ieee->external_symbol_base_offset] = &symp->symbol; - /* The external refs are indexed in a bit */ + /* The external refs are indexed in a bit. */ ieee->external_reference_base_offset = -ieee->external_reference_min_index + ieee->external_symbol_count; for (symp = IEEE_DATA (abfd)->external_reference; symp != (ieee_symbol_type *) NULL; symp = symp->next) - { - location[symp->index + ieee->external_reference_base_offset] = - &symp->symbol; - - } + location[symp->index + ieee->external_reference_base_offset] = + &symp->symbol; } + if (abfd->symcount) - { - location[abfd->symcount] = (asymbol *) NULL; - } + location[abfd->symcount] = (asymbol *) NULL; + return abfd->symcount; } @@ -1212,7 +1265,7 @@ ieee_slurp_sections (abfd) { bfd_byte section_type[3]; ieee_seek (ieee, offset); - while (true) + while (TRUE) { switch (this_byte (&(ieee->h))) { @@ -1228,34 +1281,33 @@ ieee_slurp_sections (abfd) section_type[0] = this_byte_and_next (&(ieee->h)); /* Set minimal section attributes. Attributes are - extended later, based on section contents. */ - + extended later, based on section contents. */ switch (section_type[0]) { case 0xC1: - /* Normal attributes for absolute sections */ + /* Normal attributes for absolute sections. */ section_type[1] = this_byte (&(ieee->h)); section->flags = SEC_ALLOC; switch (section_type[1]) { - case 0xD3: /* AS Absolute section attributes */ + case 0xD3: /* AS Absolute section attributes. */ next_byte (&(ieee->h)); section_type[2] = this_byte (&(ieee->h)); switch (section_type[2]) { case 0xD0: - /* Normal code */ + /* Normal code. */ next_byte (&(ieee->h)); section->flags |= SEC_CODE; break; case 0xC4: - /* Normal data */ + /* Normal data. */ next_byte (&(ieee->h)); section->flags |= SEC_DATA; break; case 0xD2: next_byte (&(ieee->h)); - /* Normal rom data */ + /* Normal rom data. */ section->flags |= SEC_ROM | SEC_DATA; break; default: @@ -1263,20 +1315,20 @@ ieee_slurp_sections (abfd) } } break; - case 0xC3: /* Named relocatable sections (type C) */ + case 0xC3: /* Named relocatable sections (type C). */ section_type[1] = this_byte (&(ieee->h)); section->flags = SEC_ALLOC; switch (section_type[1]) { - case 0xD0: /* Normal code (CP) */ + case 0xD0: /* Normal code (CP). */ next_byte (&(ieee->h)); section->flags |= SEC_CODE; break; - case 0xC4: /* Normal data (CD) */ + case 0xC4: /* Normal data (CD). */ next_byte (&(ieee->h)); section->flags |= SEC_DATA; break; - case 0xD2: /* Normal rom data (CR) */ + case 0xD2: /* Normal rom data (CR). */ next_byte (&(ieee->h)); section->flags |= SEC_ROM | SEC_DATA; break; @@ -1285,12 +1337,12 @@ ieee_slurp_sections (abfd) } } - /* Read section name, use it if non empty. */ + /* Read section name, use it if non empty. */ name = read_id (&ieee->h); if (name[0]) section->name = name; - /* Skip these fields, which we don't care about */ + /* Skip these fields, which we don't care about. */ { bfd_vma parent, brother, context; parse_int (&(ieee->h), &parent); @@ -1371,7 +1423,7 @@ ieee_slurp_sections (abfd) at the area in the file so that program which understand can dig it out. */ -static boolean +static bfd_boolean ieee_slurp_debug (abfd) bfd *abfd; { @@ -1380,23 +1432,21 @@ ieee_slurp_debug (abfd) file_ptr debug_end; if (ieee->w.r.debug_information_part == 0) - return true; + return TRUE; sec = bfd_make_section (abfd, ".debug"); if (sec == NULL) - return false; + return FALSE; sec->flags |= SEC_DEBUGGING | SEC_HAS_CONTENTS; sec->filepos = ieee->w.r.debug_information_part; debug_end = ieee_part_after (ieee, ieee->w.r.debug_information_part); sec->_raw_size = debug_end - ieee->w.r.debug_information_part; - return true; + return TRUE; } -/*********************************************************************** -* archive stuff -*/ +/* Archive stuff. */ const bfd_target * ieee_archive_p (abfd) @@ -1566,8 +1616,8 @@ ieee_object_p (abfd) if (this_byte_and_next (&(ieee->h)) != Module_Beginning) goto got_wrong_format; - ieee->read_symbols = false; - ieee->read_data = false; + ieee->read_symbols = FALSE; + ieee->read_data = FALSE; ieee->section_count = 0; ieee->external_symbol_max_index = 0; ieee->external_symbol_min_index = IEEE_PUBLIC_BASE; @@ -1582,16 +1632,14 @@ ieee_object_p (abfd) goto got_wrong_format; ieee->mb.module_name = read_id (&(ieee->h)); if (abfd->filename == (const char *) NULL) - { - abfd->filename = ieee->mb.module_name; - } - /* Determine the architecture and machine type of the object file. - */ + abfd->filename = ieee->mb.module_name; + + /* Determine the architecture and machine type of the object file. */ { const bfd_arch_info_type *arch; char family[10]; - /* IEEE does not specify the format of the processor identificaton + /* IEEE does not specify the format of the processor identification string, so the compiler is free to put in it whatever it wants. We try here to recognize different processors belonging to the m68k family. Code for other processors can be added here. */ @@ -1627,7 +1675,7 @@ ieee_object_p (abfd) } else if (TOUPPER (processor[3]) == 'F') /* 68F333 */ strcpy (family, "68332"); /* CPU32 */ - else if ((TOUPPER (processor[3]) == 'C') /* Embedded controllers */ + else if ((TOUPPER (processor[3]) == 'C') /* Embedded controllers. */ && ((TOUPPER (processor[2]) == 'E') || (TOUPPER (processor[2]) == 'H') || (TOUPPER (processor[2]) == 'L'))) @@ -1636,7 +1684,7 @@ ieee_object_p (abfd) strncat (family, processor + 4, 7); family[9] = '\0'; } - else /* "Regular" processors */ + else /* "Regular" processors. */ { strncpy (family, processor, 9); family[9] = '\0'; @@ -1658,43 +1706,34 @@ ieee_object_p (abfd) } if (this_byte (&(ieee->h)) != (int) ieee_address_descriptor_enum) - { - goto fail; - } + goto fail; + next_byte (&(ieee->h)); if (! parse_int (&(ieee->h), &ieee->ad.number_of_bits_mau)) - { - goto fail; - } + goto fail; + if (! parse_int (&(ieee->h), &ieee->ad.number_of_maus_in_address)) - { - goto fail; - } + goto fail; - /* If there is a byte order info, take it */ - if (this_byte (&(ieee->h)) == (int) ieee_variable_L_enum || - this_byte (&(ieee->h)) == (int) ieee_variable_M_enum) + /* If there is a byte order info, take it. */ + if (this_byte (&(ieee->h)) == (int) ieee_variable_L_enum + || this_byte (&(ieee->h)) == (int) ieee_variable_M_enum) next_byte (&(ieee->h)); for (part = 0; part < N_W_VARIABLES; part++) { - boolean ok; + bfd_boolean ok; + if (read_2bytes (&(ieee->h)) != (int) ieee_assign_value_to_variable_enum) - { - goto fail; - } + goto fail; + if (this_byte_and_next (&(ieee->h)) != part) - { - goto fail; - } + goto fail; ieee->w.offset[part] = parse_i (&(ieee->h), &ok); if (! ok) - { - goto fail; - } - + goto fail; } if (ieee->w.r.external_part != 0) @@ -1703,7 +1742,7 @@ ieee_object_p (abfd) /* By now we know that this is a real IEEE file, we're going to read the whole thing into memory so that we can run up and down it quickly. We can work out how big the file is from the trailer - record */ + record. */ amt = ieee->w.r.me_record + 1; IEEE_DATA (abfd)->h.first_byte = @@ -1724,7 +1763,6 @@ ieee_object_p (abfd) /* Parse section data to activate file and section flags implied by section contents. */ - if (! ieee_slurp_section_data (abfd)) goto fail; @@ -1777,6 +1815,7 @@ ieee_print_symbol (abfd, afile, symbol, how) (symbol->section == (asection *) NULL ? "*abs" : symbol->section->name); + if (symbol->name[0] == ' ') { fprintf (file, "* empty table entry "); @@ -1796,7 +1835,7 @@ ieee_print_symbol (abfd, afile, symbol, how) } } -static boolean +static bfd_boolean do_one (ieee, current_map, location_ptr, s, iterations) ieee_data_type *ieee; ieee_per_section_type *current_map; @@ -1810,6 +1849,7 @@ do_one (ieee, current_map, location_ptr, s, iterations) { unsigned int number_of_maus; unsigned int i; + next_byte (&(ieee->h)); number_of_maus = must_parse_int (&(ieee->h)); @@ -1823,7 +1863,8 @@ do_one (ieee, current_map, location_ptr, s, iterations) case ieee_load_with_relocation_enum: { - boolean loop = true; + bfd_boolean loop = TRUE; + next_byte (&(ieee->h)); while (loop) { @@ -1836,14 +1877,14 @@ do_one (ieee, current_map, location_ptr, s, iterations) case ieee_function_either_open_b_enum: { unsigned int extra = 4; - boolean pcrel = false; + bfd_boolean pcrel = FALSE; asection *section; ieee_reloc_type *r; bfd_size_type amt = sizeof (ieee_reloc_type); r = (ieee_reloc_type *) bfd_alloc (ieee->h.abfd, amt); if (!r) - return false; + return FALSE; *(current_map->reloc_tail_ptr) = r; current_map->reloc_tail_ptr = &r->next; @@ -1865,7 +1906,7 @@ do_one (ieee, current_map, location_ptr, s, iterations) if (this_byte (&(ieee->h)) == (int) ieee_comma) { next_byte (&(ieee->h)); - /* Fetch number of bytes to pad */ + /* Fetch number of bytes to pad. */ extra = must_parse_int (&(ieee->h)); }; @@ -1883,7 +1924,7 @@ do_one (ieee, current_map, location_ptr, s, iterations) default: break; } - /* Build a relocation entry for this type */ + /* Build a relocation entry for this type. */ /* If pc rel then stick -ve pc into instruction and take out of reloc .. @@ -1962,7 +2003,7 @@ do_one (ieee, current_map, location_ptr, s, iterations) default: BFD_FAIL (); - return false; + return FALSE; } } break; @@ -1980,7 +2021,7 @@ do_one (ieee, current_map, location_ptr, s, iterations) } else { - loop = false; + loop = FALSE; } } } @@ -1988,15 +2029,16 @@ do_one (ieee, current_map, location_ptr, s, iterations) /* Prevent more than the first load-item of an LR record from being repeated (MRI convention). */ if (iterations != 1) - loop = false; + loop = FALSE; } } } - return true; + return TRUE; } -/* Read in all the section data and relocation stuff too */ -static boolean +/* Read in all the section data and relocation stuff too. */ + +static bfd_boolean ieee_slurp_section_data (abfd) bfd *abfd; { @@ -2006,45 +2048,43 @@ ieee_slurp_section_data (abfd) ieee_per_section_type *current_map = (ieee_per_section_type *) NULL; asection *s; - /* Seek to the start of the data area */ + /* Seek to the start of the data area. */ if (ieee->read_data) - return true; - ieee->read_data = true; + return TRUE; + ieee->read_data = TRUE; ieee_seek (ieee, ieee->w.r.data_part); - /* Allocate enough space for all the section contents */ - + /* Allocate enough space for all the section contents. */ for (s = abfd->sections; s != (asection *) NULL; s = s->next) { - ieee_per_section_type *per = (ieee_per_section_type *) s->used_by_bfd; + ieee_per_section_type *per = ieee_per_section (s); if ((s->flags & SEC_DEBUGGING) != 0) continue; per->data = (bfd_byte *) bfd_alloc (ieee->h.abfd, s->_raw_size); if (!per->data) - return false; - /*SUPPRESS 68*/ + return FALSE; per->reloc_tail_ptr = (ieee_reloc_type **) & (s->relocation); } - while (true) + while (TRUE) { switch (this_byte (&(ieee->h))) { - /* IF we see anything strange then quit */ + /* IF we see anything strange then quit. */ default: - return true; + return TRUE; case ieee_set_current_section_enum: next_byte (&(ieee->h)); section_number = must_parse_int (&(ieee->h)); s = ieee->section_table[section_number]; s->flags |= SEC_LOAD | SEC_HAS_CONTENTS; - current_map = (ieee_per_section_type *) s->used_by_bfd; + current_map = ieee_per_section (s); location_ptr = current_map->data - s->vma; - /* The document I have says that Microtec's compilers reset */ - /* this after a sec section, even though the standard says not */ - /* to. SO .. */ + /* The document I have says that Microtec's compilers reset + this after a sec section, even though the standard says not + to, SO... */ current_map->pc = s->vma; break; @@ -2057,9 +2097,10 @@ ieee_slurp_section_data (abfd) bfd_vma value; ieee_symbol_index_type symbol; unsigned int extra; - boolean pcrel; + bfd_boolean pcrel; + next_byte (&(ieee->h)); - must_parse_int (&(ieee->h)); /* Throw away section #*/ + must_parse_int (&(ieee->h)); /* Throw away section #. */ parse_expression (ieee, &value, &symbol, &pcrel, &extra, @@ -2074,28 +2115,27 @@ ieee_slurp_section_data (abfd) if (this_byte (&(ieee->h)) == ieee_function_either_open_b_enum) next_byte (&(ieee->h)); abfd->start_address = must_parse_int (&(ieee->h)); - /* We've got to the end of the data now - */ - return true; + /* We've got to the end of the data now - */ + return TRUE; default: BFD_FAIL (); - return false; + return FALSE; } break; case ieee_repeat_data_enum: { /* Repeat the following LD or LR n times - we do this by - remembering the stream pointer before running it and - resetting it and running it n times. We special case - the repetition of a repeat_data/load_constant - */ - + remembering the stream pointer before running it and + resetting it and running it n times. We special case + the repetition of a repeat_data/load_constant. */ unsigned int iterations; unsigned char *start; + next_byte (&(ieee->h)); iterations = must_parse_int (&(ieee->h)); start = ieee->h.input_p; - if (start[0] == (int) ieee_load_constant_bytes_enum && - start[1] == 1) + if (start[0] == (int) ieee_load_constant_bytes_enum + && start[1] == 1) { while (iterations != 0) { @@ -2113,7 +2153,7 @@ ieee_slurp_section_data (abfd) ieee->h.input_p = start; if (!do_one (ieee, current_map, location_ptr, s, (int) iterations)) - return false; + return FALSE; iterations--; } } @@ -2121,26 +2161,24 @@ ieee_slurp_section_data (abfd) break; case ieee_load_constant_bytes_enum: case ieee_load_with_relocation_enum: - { - if (!do_one (ieee, current_map, location_ptr, s, 1)) - return false; - } + if (!do_one (ieee, current_map, location_ptr, s, 1)) + return FALSE; } } } -static boolean +static bfd_boolean ieee_new_section_hook (abfd, newsect) bfd *abfd; asection *newsect; { - newsect->used_by_bfd = (PTR) - bfd_alloc (abfd, (bfd_size_type) sizeof (ieee_per_section_type)); + newsect->used_by_bfd + = (PTR) bfd_alloc (abfd, (bfd_size_type) sizeof (ieee_per_section_type)); if (!newsect->used_by_bfd) - return false; + return FALSE; ieee_per_section (newsect)->data = (bfd_byte *) NULL; ieee_per_section (newsect)->section = newsect; - return true; + return TRUE; } static long @@ -2155,7 +2193,7 @@ ieee_get_reloc_upper_bound (abfd, asect) return (asect->reloc_count + 1) * sizeof (arelent *); } -static boolean +static bfd_boolean ieee_get_section_contents (abfd, section, location, offset, count) bfd *abfd; sec_ptr section; @@ -2163,13 +2201,13 @@ ieee_get_section_contents (abfd, section, location, offset, count) file_ptr offset; bfd_size_type count; { - ieee_per_section_type *p = (ieee_per_section_type *) section->used_by_bfd; + ieee_per_section_type *p = ieee_per_section (section); if ((section->flags & SEC_DEBUGGING) != 0) return _bfd_generic_get_section_contents (abfd, section, location, offset, count); ieee_slurp_section_data (abfd); (void) memcpy ((PTR) location, (PTR) (p->data + offset), (unsigned) count); - return true; + return TRUE; } static long @@ -2179,7 +2217,6 @@ ieee_canonicalize_reloc (abfd, section, relptr, symbols) arelent **relptr; asymbol **symbols; { -/* ieee_per_section_type *p = (ieee_per_section_type *) section->used_by_bfd;*/ ieee_reloc_type *src = (ieee_reloc_type *) (section->relocation); ieee_data_type *ieee = IEEE_DATA (abfd); @@ -2188,7 +2225,7 @@ ieee_canonicalize_reloc (abfd, section, relptr, symbols) while (src != (ieee_reloc_type *) NULL) { - /* Work out which symbol to attach it this reloc to */ + /* Work out which symbol to attach it this reloc to. */ switch (src->symbol.letter) { case 'I': @@ -2227,7 +2264,7 @@ comp (ap, bp) /* Write the section headers. */ -static boolean +static bfd_boolean ieee_write_section_part (abfd) bfd *abfd; { @@ -2243,19 +2280,19 @@ ieee_write_section_part (abfd) || ! ieee_write_byte (abfd, (bfd_byte) (s->index + IEEE_SECTION_NUMBER_BASE))) - return false; + return FALSE; if (abfd->flags & EXEC_P) { - /* This image is executable, so output absolute sections */ + /* This image is executable, so output absolute sections. */ if (! ieee_write_byte (abfd, ieee_variable_A_enum) || ! ieee_write_byte (abfd, ieee_variable_S_enum)) - return false; + return FALSE; } else { if (! ieee_write_byte (abfd, ieee_variable_C_enum)) - return false; + return FALSE; } switch (s->flags & (SEC_CODE | SEC_DATA | SEC_ROM)) @@ -2263,64 +2300,64 @@ ieee_write_section_part (abfd) case SEC_CODE | SEC_LOAD: case SEC_CODE: if (! ieee_write_byte (abfd, ieee_variable_P_enum)) - return false; + return FALSE; break; case SEC_DATA: default: if (! ieee_write_byte (abfd, ieee_variable_D_enum)) - return false; + return FALSE; break; case SEC_ROM: case SEC_ROM | SEC_DATA: case SEC_ROM | SEC_LOAD: case SEC_ROM | SEC_DATA | SEC_LOAD: if (! ieee_write_byte (abfd, ieee_variable_R_enum)) - return false; + return FALSE; } if (! ieee_write_id (abfd, s->name)) - return false; + return FALSE; #if 0 ieee_write_int (abfd, 0); /* Parent */ ieee_write_int (abfd, 0); /* Brother */ ieee_write_int (abfd, 0); /* Context */ #endif - /* Alignment */ + /* Alignment. */ if (! ieee_write_byte (abfd, ieee_section_alignment_enum) || ! ieee_write_byte (abfd, (bfd_byte) (s->index + IEEE_SECTION_NUMBER_BASE)) || ! ieee_write_int (abfd, (bfd_vma) 1 << s->alignment_power)) - return false; + return FALSE; - /* Size */ + /* Size. */ if (! ieee_write_2bytes (abfd, ieee_section_size_enum) || ! ieee_write_byte (abfd, (bfd_byte) (s->index + IEEE_SECTION_NUMBER_BASE)) || ! ieee_write_int (abfd, s->_raw_size)) - return false; + return FALSE; if (abfd->flags & EXEC_P) { - /* Relocateable sections don't have asl records */ - /* Vma */ + /* Relocateable sections don't have asl records. */ + /* Vma. */ if (! ieee_write_2bytes (abfd, ieee_section_base_address_enum) || ! ieee_write_byte (abfd, ((bfd_byte) (s->index + IEEE_SECTION_NUMBER_BASE))) || ! ieee_write_int (abfd, s->lma)) - return false; + return FALSE; } } } - return true; + return TRUE; } -static boolean +static bfd_boolean do_with_relocs (abfd, s) bfd *abfd; asection *s; @@ -2337,51 +2374,49 @@ do_with_relocs (abfd, s) sizeof (arelent **), comp); - /* Output the section preheader */ + /* Output the section preheader. */ if (! ieee_write_byte (abfd, ieee_set_current_section_enum) || ! ieee_write_byte (abfd, (bfd_byte) (s->index + IEEE_SECTION_NUMBER_BASE)) || ! ieee_write_2bytes (abfd, ieee_set_current_pc_enum) || ! ieee_write_byte (abfd, (bfd_byte) (s->index + IEEE_SECTION_NUMBER_BASE))) - return false; + return FALSE; if ((abfd->flags & EXEC_P) != 0 && relocs_to_go == 0) { if (! ieee_write_int (abfd, s->lma)) - return false; + return FALSE; } else { if (! ieee_write_expression (abfd, (bfd_vma) 0, s->symbol, 0, 0)) - return false; + return FALSE; } if (relocs_to_go == 0) { /* If there aren't any relocations then output the load constant - byte opcode rather than the load with relocation opcode */ - + byte opcode rather than the load with relocation opcode. */ while (current_byte_index < s->_raw_size) { bfd_size_type run; unsigned int MAXRUN = 127; + run = MAXRUN; if (run > s->_raw_size - current_byte_index) - { - run = s->_raw_size - current_byte_index; - } + run = s->_raw_size - current_byte_index; if (run != 0) { if (! ieee_write_byte (abfd, ieee_load_constant_bytes_enum)) - return false; - /* Output a stream of bytes */ + return FALSE; + /* Output a stream of bytes. */ if (! ieee_write_int (abfd, run)) - return false; + return FALSE; if (bfd_bwrite ((PTR) (stream + current_byte_index), run, abfd) != run) - return false; + return FALSE; current_byte_index += run; } } @@ -2389,7 +2424,7 @@ do_with_relocs (abfd, s) else { if (! ieee_write_byte (abfd, ieee_load_with_relocation_enum)) - return false; + return FALSE; /* Output the data stream as the longest sequence of bytes possible, allowing for the a reasonable packet size and @@ -2397,15 +2432,16 @@ do_with_relocs (abfd, s) if ((PTR) stream == (PTR) NULL) { - /* Outputting a section without data, fill it up */ + /* Outputting a section without data, fill it up. */ stream = (unsigned char *) bfd_zalloc (abfd, s->_raw_size); if (!stream) - return false; + return FALSE; } while (current_byte_index < s->_raw_size) { bfd_size_type run; unsigned int MAXRUN = 127; + if (relocs_to_go) { run = (*p)->address - current_byte_index; @@ -2413,25 +2449,23 @@ do_with_relocs (abfd, s) run = MAXRUN; } else - { - run = MAXRUN; - } + run = MAXRUN; + if (run > s->_raw_size - current_byte_index) - { - run = s->_raw_size - current_byte_index; - } + run = s->_raw_size - current_byte_index; if (run != 0) { - /* Output a stream of bytes */ + /* Output a stream of bytes. */ if (! ieee_write_int (abfd, run)) - return false; + return FALSE; if (bfd_bwrite ((PTR) (stream + current_byte_index), run, abfd) != run) - return false; + return FALSE; current_byte_index += run; } - /* Output any relocations here */ + + /* Output any relocations here. */ if (relocs_to_go && (*p) && (*p)->address == current_byte_index) { while (relocs_to_go @@ -2439,14 +2473,10 @@ do_with_relocs (abfd, s) { arelent *r = *p; bfd_signed_vma ov; - #if 0 if (r->howto->pc_relative) - { - r->addend += current_byte_index; - } + r->addend += current_byte_index; #endif - switch (r->howto->size) { case 2: @@ -2468,7 +2498,7 @@ do_with_relocs (abfd, s) default: ov = 0; BFD_FAIL (); - return false; + return FALSE; } ov &= r->howto->src_mask; @@ -2479,7 +2509,7 @@ do_with_relocs (abfd, s) if (! ieee_write_byte (abfd, ieee_function_either_open_b_enum)) - return false; + return FALSE; /* abort();*/ @@ -2489,7 +2519,7 @@ do_with_relocs (abfd, s) *(r->sym_ptr_ptr), r->howto->pc_relative, (unsigned) s->index)) - return false; + return FALSE; } else { @@ -2497,7 +2527,7 @@ do_with_relocs (abfd, s) (asymbol *) NULL, r->howto->pc_relative, (unsigned) s->index)) - return false; + return FALSE; } if (number_of_maus_in_address @@ -2505,11 +2535,11 @@ do_with_relocs (abfd, s) { bfd_vma rsize = bfd_get_reloc_size (r->howto); if (! ieee_write_int (abfd, rsize)) - return false; + return FALSE; } if (! ieee_write_byte (abfd, ieee_function_either_close_b_enum)) - return false; + return FALSE; relocs_to_go--; p++; @@ -2519,14 +2549,14 @@ do_with_relocs (abfd, s) } } - return true; + return TRUE; } /* If there are no relocations in the output section then we can be clever about how we write. We block items up into a max of 127 bytes. */ -static boolean +static bfd_boolean do_as_repeat (abfd, s) bfd *abfd; asection *s; @@ -2542,17 +2572,17 @@ do_as_repeat (abfd, s) || ! ieee_write_byte (abfd, (bfd_byte) (s->index + IEEE_SECTION_NUMBER_BASE))) - return false; + return FALSE; if ((abfd->flags & EXEC_P) != 0) { if (! ieee_write_int (abfd, s->lma)) - return false; + return FALSE; } else { if (! ieee_write_expression (abfd, (bfd_vma) 0, s->symbol, 0, 0)) - return false; + return FALSE; } if (! ieee_write_byte (abfd, ieee_repeat_data_enum) @@ -2560,13 +2590,13 @@ do_as_repeat (abfd, s) || ! ieee_write_byte (abfd, ieee_load_constant_bytes_enum) || ! ieee_write_byte (abfd, 1) || ! ieee_write_byte (abfd, 0)) - return false; + return FALSE; } - return true; + return TRUE; } -static boolean +static bfd_boolean do_without_relocs (abfd, s) bfd *abfd; asection *s; @@ -2576,25 +2606,26 @@ do_without_relocs (abfd, s) if (stream == 0 || ((s->flags & SEC_LOAD) == 0)) { if (! do_as_repeat (abfd, s)) - return false; + return FALSE; } else { unsigned int i; + for (i = 0; i < s->_raw_size; i++) { if (stream[i] != 0) { if (! do_with_relocs (abfd, s)) - return false; - return true; + return FALSE; + return TRUE; } } if (! do_as_repeat (abfd, s)) - return false; + return FALSE; } - return true; + return TRUE; } @@ -2608,7 +2639,7 @@ static bfd *input_bfd; static bfd *output_bfd; static int output_buffer; -static boolean +static bfd_boolean ieee_mkobject (abfd) bfd *abfd; { @@ -2642,6 +2673,7 @@ static void flush () { bfd_size_type amt = output_ptr - output_ptr_start; + if (bfd_bwrite ((PTR) (output_ptr_start), amt, output_bfd) != amt) abort (); output_ptr = output_ptr_start; @@ -2663,20 +2695,14 @@ write_int (value) else { unsigned int length; - /* How many significant bytes ? */ - /* FIXME FOR LONGER INTS */ + /* How many significant bytes ? */ + /* FIXME FOR LONGER INTS. */ if (value & 0xff000000) - { - length = 4; - } + length = 4; else if (value & 0x00ff0000) - { - length = 3; - } + length = 3; else if (value & 0x0000ff00) - { - length = 2; - } + length = 2; else length = 1; @@ -2692,7 +2718,6 @@ write_int (value) case 1: OUT (value); } - } } @@ -2701,6 +2726,7 @@ copy_id () { int length = THIS (); char ch; + OUT (length); NEXT (); while (length--) @@ -2718,6 +2744,7 @@ copy_expression () int stack[10]; int *tos = stack; int value; + while (1) { switch (THIS ()) @@ -2765,7 +2792,7 @@ copy_expression () default: if (THIS () > 0x84) { - /* Not a number, just bug out with the answer */ + /* Not a number, just bug out with the answer. */ write_int (*(--tos)); return; } @@ -2773,7 +2800,7 @@ copy_expression () NEXT (); break; case 0xa5: - /* PLUS anything */ + /* PLUS anything. */ value = *(--tos); value += *(--tos); *tos++ = value; @@ -2784,6 +2811,7 @@ copy_expression () int section_number; ieee_data_type *ieee; asection *s; + NEXT (); section_number = THIS (); @@ -2817,7 +2845,7 @@ fill_int (buf) { if (buf->buffer == output_buffer) { - /* Still a chance to output the size */ + /* Still a chance to output the size. */ int value = output_ptr - buf->ptrp + 3; buf->ptrp[0] = value >> 24; buf->ptrp[1] = value >> 16; @@ -2832,6 +2860,7 @@ drop_int (buf) { int type = THIS (); int ch; + if (type <= 0x84) { NEXT (); @@ -2905,7 +2934,8 @@ static void f1_record () { int ch; - /* ATN record */ + + /* ATN record. */ NEXT (); ch = THIS (); switch (ch) @@ -2945,7 +2975,7 @@ f1_record () } break; case 0xd8: - /* EXternal ref */ + /* EXternal ref. */ NEXT (); OUT (0xf1); OUT (0xd8); @@ -2999,13 +3029,12 @@ f1_record () break; } } - } static void f0_record () { - /* Attribute record */ + /* Attribute record. */ NEXT (); OUT (0xf0); INTn (Symbol name); @@ -3016,6 +3045,7 @@ static void copy_till_end () { int ch = THIS (); + while (1) { while (ch <= 0x80) @@ -3074,11 +3104,12 @@ f8_record () case 0x01: case 0x02: case 0x03: - /* Unique typedefs for module */ - /* GLobal typedefs */ - /* High level module scope beginning */ + /* Unique typedefs for module. */ + /* GLobal typedefs. */ + /* High level module scope beginning. */ { struct output_buffer_struct ob; + NEXT (); OUT (0xf8); OUT (ch); @@ -3093,9 +3124,10 @@ f8_record () } break; case 0x04: - /* Global function */ + /* Global function. */ { struct output_buffer_struct ob; + NEXT (); OUT (0xf8); OUT (0x04); @@ -3115,9 +3147,10 @@ f8_record () break; case 0x05: - /* File name for source line numbers */ + /* File name for source line numbers. */ { struct output_buffer_struct ob; + NEXT (); OUT (0xf8); OUT (0x05); @@ -3137,9 +3170,10 @@ f8_record () break; case 0x06: - /* Local function */ + /* Local function. */ { struct output_buffer_struct ob; + NEXT (); OUT (0xf8); OUT (0x06); @@ -3157,7 +3191,7 @@ f8_record () break; case 0x0a: - /* Assembler module scope beginning -*/ + /* Assembler module scope beginning - */ { struct output_buffer_struct ob; @@ -3186,6 +3220,7 @@ f8_record () case 0x0b: { struct output_buffer_struct ob; + NEXT (); OUT (0xf8); OUT (0x0b); @@ -3222,6 +3257,7 @@ static void block () { int ch; + while (1) { ch = THIS (); @@ -3253,11 +3289,8 @@ block () } - -/* relocate_debug, - moves all the debug information from the source bfd to the output - bfd, and relocates any expressions it finds -*/ +/* Moves all the debug information from the source bfd to the output + bfd, and relocates any expressions it finds. */ static void relocate_debug (output, input) @@ -3280,14 +3313,14 @@ relocate_debug (output, input) /* Gather together all the debug information from each input BFD into one place, relocating it and emitting it as we go. */ -static boolean +static bfd_boolean ieee_write_debug_part (abfd) bfd *abfd; { ieee_data_type *ieee = IEEE_DATA (abfd); bfd_chain_type *chain = ieee->chain_root; unsigned char obuff[OBS]; - boolean some_debug = false; + bfd_boolean some_debug = FALSE; file_ptr here = bfd_tell (abfd); output_ptr_start = output_ptr = obuff; @@ -3305,12 +3338,12 @@ ieee_write_debug_part (abfd) if (s == NULL) { ieee->w.r.debug_information_part = 0; - return true; + return TRUE; } ieee->w.r.debug_information_part = here; if (bfd_bwrite (s->contents, s->_raw_size, abfd) != s->_raw_size) - return false; + return FALSE; } else { @@ -3318,40 +3351,40 @@ ieee_write_debug_part (abfd) { bfd *entry = chain->this; ieee_data_type *entry_ieee = IEEE_DATA (entry); + if (entry_ieee->w.r.debug_information_part) { if (bfd_seek (entry, entry_ieee->w.r.debug_information_part, SEEK_SET) != 0) - return false; + return FALSE; relocate_debug (abfd, entry); } chain = chain->next; } + if (some_debug) - { - ieee->w.r.debug_information_part = here; - } + ieee->w.r.debug_information_part = here; else - { - ieee->w.r.debug_information_part = 0; - } + ieee->w.r.debug_information_part = 0; flush (); } - return true; + return TRUE; } /* Write the data in an ieee way. */ -static boolean +static bfd_boolean ieee_write_data_part (abfd) bfd *abfd; { asection *s; + ieee_data_type *ieee = IEEE_DATA (abfd); ieee->w.r.data_part = bfd_tell (abfd); + for (s = abfd->sections; s != (asection *) NULL; s = s->next) { /* Skip sections that have no loadable contents (.bss, @@ -3364,24 +3397,25 @@ ieee_write_data_part (abfd) if (s->reloc_count != 0) { if (! do_with_relocs (abfd, s)) - return false; + return FALSE; } else { if (! do_without_relocs (abfd, s)) - return false; + return FALSE; } } - return true; + return TRUE; } -static boolean +static bfd_boolean init_for_output (abfd) bfd *abfd; { asection *s; + for (s = abfd->sections; s != (asection *) NULL; s = s->next) { if ((s->flags & SEC_DEBUGGING) != 0) @@ -3391,22 +3425,22 @@ init_for_output (abfd) bfd_size_type size = s->_raw_size; ieee_per_section (s)->data = (bfd_byte *) (bfd_alloc (abfd, size)); if (!ieee_per_section (s)->data) - return false; + return FALSE; } } - return true; + return TRUE; } -/** exec and core file sections */ +/* Exec and core file sections. */ -/* set section contents is complicated with IEEE since the format is -* not a byte image, but a record stream. -*/ -static boolean +/* Set section contents is complicated with IEEE since the format is + not a byte image, but a record stream. */ + +static bfd_boolean ieee_set_section_contents (abfd, section, location, offset, count) bfd *abfd; sec_ptr section; - PTR location; + const PTR location; file_ptr offset; bfd_size_type count; { @@ -3417,23 +3451,23 @@ ieee_set_section_contents (abfd, section, location, offset, count) bfd_size_type size = section->_raw_size; section->contents = (unsigned char *) bfd_alloc (abfd, size); if (section->contents == NULL) - return false; + return FALSE; } /* bfd_set_section_contents has already checked that everything is within range. */ memcpy (section->contents + offset, location, (size_t) count); - return true; + return TRUE; } if (ieee_per_section (section)->data == (bfd_byte *) NULL) { if (!init_for_output (abfd)) - return false; + return FALSE; } memcpy ((PTR) (ieee_per_section (section)->data + offset), (PTR) location, (unsigned int) count); - return true; + return TRUE; } /* Write the external symbols of a file. IEEE considers two sorts of @@ -3441,37 +3475,38 @@ ieee_set_section_contents (abfd, section, location, offset, count) forms to index them as well. When we write them out we turn their symbol values into indexes from the right base. */ -static boolean +static bfd_boolean ieee_write_external_part (abfd) bfd *abfd; { asymbol **q; ieee_data_type *ieee = IEEE_DATA (abfd); - unsigned int reference_index = IEEE_REFERENCE_BASE; unsigned int public_index = IEEE_PUBLIC_BASE + 2; file_ptr here = bfd_tell (abfd); - boolean hadone = false; + bfd_boolean hadone = FALSE; + if (abfd->outsymbols != (asymbol **) NULL) { for (q = abfd->outsymbols; *q != (asymbol *) NULL; q++) { asymbol *p = *q; + if (bfd_is_und_section (p->section)) { - /* This must be a symbol reference .. */ + /* This must be a symbol reference. */ if (! ieee_write_byte (abfd, ieee_external_reference_enum) || ! ieee_write_int (abfd, (bfd_vma) reference_index) || ! ieee_write_id (abfd, p->name)) - return false; + return FALSE; p->value = reference_index; reference_index++; - hadone = true; + hadone = TRUE; } else if (bfd_is_com_section (p->section)) { - /* This is a weak reference */ + /* This is a weak reference. */ if (! ieee_write_byte (abfd, ieee_external_reference_enum) || ! ieee_write_int (abfd, (bfd_vma) reference_index) || ! ieee_write_id (abfd, p->name) @@ -3479,15 +3514,14 @@ ieee_write_external_part (abfd) ieee_weak_external_reference_enum) || ! ieee_write_int (abfd, (bfd_vma) reference_index) || ! ieee_write_int (abfd, p->value)) - return false; + return FALSE; p->value = reference_index; reference_index++; - hadone = true; + hadone = TRUE; } else if (p->flags & BSF_GLOBAL) { - /* This must be a symbol definition */ - + /* This must be a symbol definition. */ if (! ieee_write_byte (abfd, ieee_external_symbol_enum) || ! ieee_write_int (abfd, (bfd_vma) public_index) || ! ieee_write_id (abfd, p->name) @@ -3496,24 +3530,24 @@ ieee_write_external_part (abfd) || ! ieee_write_byte (abfd, 15) /* instruction address */ || ! ieee_write_byte (abfd, 19) /* static symbol */ || ! ieee_write_byte (abfd, 1)) /* one of them */ - return false; + return FALSE; - /* Write out the value */ + /* Write out the value. */ if (! ieee_write_2bytes (abfd, ieee_value_record_enum) || ! ieee_write_int (abfd, (bfd_vma) public_index)) - return false; + return FALSE; if (! bfd_is_abs_section (p->section)) { if (abfd->flags & EXEC_P) { /* If fully linked, then output all symbols - relocated */ + relocated. */ if (! (ieee_write_int (abfd, (p->value + p->section->output_offset + p->section->output_section->vma)))) - return false; + return FALSE; } else { @@ -3521,8 +3555,8 @@ ieee_write_external_part (abfd) (abfd, p->value + p->section->output_offset, p->section->output_section->symbol, - false, 0))) - return false; + FALSE, 0))) + return FALSE; } } else @@ -3530,33 +3564,33 @@ ieee_write_external_part (abfd) if (! ieee_write_expression (abfd, p->value, bfd_abs_section_ptr->symbol, - false, 0)) - return false; + FALSE, 0)) + return FALSE; } p->value = public_index; public_index++; - hadone = true; + hadone = TRUE; } else { - /* This can happen - when there are gaps in the symbols read */ - /* from an input ieee file */ + /* This can happen - when there are gaps in the symbols read + from an input ieee file. */ } } } if (hadone) ieee->w.r.external_part = here; - return true; + return TRUE; } static const unsigned char exten[] = { 0xf0, 0x20, 0x00, - 0xf1, 0xce, 0x20, 0x00, 37, 3, 3, /* Set version 3 rev 3 */ - 0xf1, 0xce, 0x20, 0x00, 39, 2,/* keep symbol in original case */ - 0xf1, 0xce, 0x20, 0x00, 38 /* set object type relocateable to x */ + 0xf1, 0xce, 0x20, 0x00, 37, 3, 3, /* Set version 3 rev 3. */ + 0xf1, 0xce, 0x20, 0x00, 39, 2, /* Keep symbol in original case. */ + 0xf1, 0xce, 0x20, 0x00, 38 /* Set object type relocatable to x. */ }; static const unsigned char envi[] = @@ -3572,7 +3606,7 @@ static const unsigned char envi[] = /* 0xf1, 0xce, 0x21, 0, 54, 2,1,1 tool & version # */ }; -static boolean +static bfd_boolean ieee_write_me_part (abfd) bfd *abfd; { @@ -3584,17 +3618,17 @@ ieee_write_me_part (abfd) || ! ieee_write_byte (abfd, ieee_function_either_open_b_enum) || ! ieee_write_int (abfd, abfd->start_address) || ! ieee_write_byte (abfd, ieee_function_either_close_b_enum)) - return false; + return FALSE; } ieee->w.r.me_record = bfd_tell (abfd); if (! ieee_write_byte (abfd, ieee_module_end_enum)) - return false; - return true; + return FALSE; + return TRUE; } /* Write out the IEEE processor ID. */ -static boolean +static bfd_boolean ieee_write_processor (abfd) bfd *abfd; { @@ -3605,22 +3639,22 @@ ieee_write_processor (abfd) { default: if (! ieee_write_id (abfd, bfd_printable_name (abfd))) - return false; + return FALSE; break; case bfd_arch_a29k: if (! ieee_write_id (abfd, "29000")) - return false; + return FALSE; break; case bfd_arch_h8300: if (! ieee_write_id (abfd, "H8/300")) - return false; + return FALSE; break; case bfd_arch_h8500: if (! ieee_write_id (abfd, "H8/500")) - return false; + return FALSE; break; case bfd_arch_i960: @@ -3630,23 +3664,23 @@ ieee_write_processor (abfd) case bfd_mach_i960_core: case bfd_mach_i960_ka_sa: if (! ieee_write_id (abfd, "80960KA")) - return false; + return FALSE; break; case bfd_mach_i960_kb_sb: if (! ieee_write_id (abfd, "80960KB")) - return false; + return FALSE; break; case bfd_mach_i960_ca: if (! ieee_write_id (abfd, "80960CA")) - return false; + return FALSE; break; case bfd_mach_i960_mc: case bfd_mach_i960_xa: if (! ieee_write_id (abfd, "80960MC")) - return false; + return FALSE; break; } break; @@ -3670,18 +3704,19 @@ ieee_write_processor (abfd) case bfd_mach_mcf5206e:id = "5206e"; break; case bfd_mach_mcf5307:id = "5307"; break; case bfd_mach_mcf5407:id = "5407"; break; + case bfd_mach_mcf528x:id = "5282"; break; } if (! ieee_write_id (abfd, id)) - return false; + return FALSE; } break; } - return true; + return TRUE; } -static boolean +static bfd_boolean ieee_write_object_contents (abfd) bfd *abfd; { @@ -3689,51 +3724,51 @@ ieee_write_object_contents (abfd) unsigned int i; file_ptr old; - /* Fast forward over the header area */ + /* Fast forward over the header area. */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) - return false; + return FALSE; if (! ieee_write_byte (abfd, ieee_module_beginning_enum) || ! ieee_write_processor (abfd) || ! ieee_write_id (abfd, abfd->filename)) - return false; + return FALSE; - /* Fast forward over the variable bits */ + /* Fast forward over the variable bits. */ if (! ieee_write_byte (abfd, ieee_address_descriptor_enum)) - return false; + return FALSE; - /* Bits per MAU */ + /* Bits per MAU. */ if (! ieee_write_byte (abfd, (bfd_byte) (bfd_arch_bits_per_byte (abfd)))) - return false; - /* MAU's per address */ + return FALSE; + /* MAU's per address. */ if (! ieee_write_byte (abfd, (bfd_byte) (bfd_arch_bits_per_address (abfd) / bfd_arch_bits_per_byte (abfd)))) - return false; + return FALSE; old = bfd_tell (abfd); if (bfd_seek (abfd, (file_ptr) (8 * N_W_VARIABLES), SEEK_CUR) != 0) - return false; + return FALSE; ieee->w.r.extension_record = bfd_tell (abfd); if (bfd_bwrite ((char *) exten, (bfd_size_type) sizeof (exten), abfd) != sizeof (exten)) - return false; + return FALSE; if (abfd->flags & EXEC_P) { if (! ieee_write_byte (abfd, 0x1)) /* Absolute */ - return false; + return FALSE; } else { if (! ieee_write_byte (abfd, 0x2)) /* Relocateable */ - return false; + return FALSE; } ieee->w.r.environmental_record = bfd_tell (abfd); if (bfd_bwrite ((char *) envi, (bfd_size_type) sizeof (envi), abfd) != sizeof (envi)) - return false; + return FALSE; /* The HP emulator database requires a timestamp in the file. */ { @@ -3752,7 +3787,7 @@ ieee_write_object_contents (abfd) || ! ieee_write_int (abfd, (bfd_vma) t->tm_hour) || ! ieee_write_int (abfd, (bfd_vma) t->tm_min) || ! ieee_write_int (abfd, (bfd_vma) t->tm_sec)) - return false; + return FALSE; } output_bfd = abfd; @@ -3760,51 +3795,46 @@ ieee_write_object_contents (abfd) flush (); if (! ieee_write_section_part (abfd)) - return false; + return FALSE; /* First write the symbols. This changes their values into table indeces so we cant use it after this point. */ if (! ieee_write_external_part (abfd)) - return false; - - /* ieee_write_byte(abfd, ieee_record_seperator_enum);*/ - - /* ieee_write_byte(abfd, ieee_record_seperator_enum);*/ - + return FALSE; /* Write any debugs we have been told about. */ if (! ieee_write_debug_part (abfd)) - return false; + return FALSE; /* Can only write the data once the symbols have been written, since the data contains relocation information which points to the symbols. */ if (! ieee_write_data_part (abfd)) - return false; + return FALSE; /* At the end we put the end! */ if (! ieee_write_me_part (abfd)) - return false; + return FALSE; - /* Generate the header */ + /* Generate the header. */ if (bfd_seek (abfd, old, SEEK_SET) != 0) - return false; + return FALSE; for (i = 0; i < N_W_VARIABLES; i++) { if (! ieee_write_2bytes (abfd, ieee_assign_value_to_variable_enum) || ! ieee_write_byte (abfd, (bfd_byte) i) || ! ieee_write_int5_out (abfd, (bfd_vma) ieee->w.offset[i])) - return false; + return FALSE; } - return true; + return TRUE; } /* Native-level interface to symbols. */ /* We read the symbols into a buffer, which is discarded when this function exits. We read the strings into a buffer large enough to - hold them all plus all the cached symbol entries. */ + hold them all plus all the cached symbol entries. */ static asymbol * ieee_make_empty_symbol (abfd) @@ -3812,6 +3842,7 @@ ieee_make_empty_symbol (abfd) { bfd_size_type amt = sizeof (ieee_symbol_type); ieee_symbol_type *new = (ieee_symbol_type *) bfd_zalloc (abfd, amt); + if (!new) return NULL; new->symbol.the_bfd = abfd; @@ -3824,15 +3855,16 @@ ieee_openr_next_archived_file (arch, prev) bfd *prev; { ieee_ar_data_type *ar = IEEE_AR_DATA (arch); - /* take the next one from the arch state, or reset */ + + /* Take the next one from the arch state, or reset. */ if (prev == (bfd *) NULL) - { - /* Reset the index - the first two entries are bogus*/ - ar->element_index = 2; - } - while (true) + /* Reset the index - the first two entries are bogus. */ + ar->element_index = 2; + + while (TRUE) { ieee_ar_obstack_type *p = ar->elements + ar->element_index; + ar->element_index++; if (ar->element_index <= ar->element_count) { @@ -3851,11 +3883,10 @@ ieee_openr_next_archived_file (arch, prev) bfd_set_error (bfd_error_no_more_archived_files); return (bfd *) NULL; } - } } -static boolean +static bfd_boolean ieee_find_nearest_line (abfd, section, symbols, offset, filename_ptr, functionname_ptr, line_ptr) bfd *abfd ATTRIBUTE_UNUSED; @@ -3866,7 +3897,7 @@ ieee_find_nearest_line (abfd, section, symbols, offset, filename_ptr, const char **functionname_ptr ATTRIBUTE_UNUSED; unsigned int *line_ptr ATTRIBUTE_UNUSED; { - return false; + return FALSE; } static int @@ -3904,7 +3935,7 @@ ieee_generic_stat_arch_elt (abfd, buf) static int ieee_sizeof_headers (abfd, x) bfd *abfd ATTRIBUTE_UNUSED; - boolean x ATTRIBUTE_UNUSED; + bfd_boolean x ATTRIBUTE_UNUSED; { return 0; } @@ -3929,8 +3960,7 @@ ieee_bfd_debug_info_end (abfd) /* Add this section to the list of sections we have debug info for, to - be ready to output it at close time - */ + be ready to output it at close time. */ static void ieee_bfd_debug_info_accumulate (abfd, section) bfd *abfd; @@ -3938,37 +3968,34 @@ ieee_bfd_debug_info_accumulate (abfd, section) { ieee_data_type *ieee = IEEE_DATA (section->owner); ieee_data_type *output_ieee = IEEE_DATA (abfd); - /* can only accumulate data from other ieee bfds */ + + /* Can only accumulate data from other ieee bfds. */ if (section->owner->xvec != abfd->xvec) return; - /* Only bother once per bfd */ + /* Only bother once per bfd. */ if (ieee->done_debug) return; - ieee->done_debug = true; + ieee->done_debug = TRUE; - /* Don't bother if there is no debug info */ + /* Don't bother if there is no debug info. */ if (ieee->w.r.debug_information_part == 0) return; - - /* Add to chain */ + /* Add to chain. */ { bfd_size_type amt = sizeof (bfd_chain_type); bfd_chain_type *n = (bfd_chain_type *) bfd_alloc (abfd, amt); + if (!n) abort (); /* FIXME */ n->this = section->owner; n->next = (bfd_chain_type *) NULL; if (output_ieee->chain_head) - { - output_ieee->chain_head->next = n; - } + output_ieee->chain_head->next = n; else - { - output_ieee->chain_root = n; + output_ieee->chain_root = n; - } output_ieee->chain_head = n; } } @@ -3981,11 +4008,12 @@ ieee_bfd_debug_info_accumulate (abfd, section) #define ieee_slurp_armap bfd_true #define ieee_slurp_extended_name_table bfd_true #define ieee_construct_extended_name_table \ - ((boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \ + ((bfd_boolean (*) \ + PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \ bfd_true) #define ieee_truncate_arname bfd_dont_truncate_arname #define ieee_write_armap \ - ((boolean (*) \ + ((bfd_boolean (*) \ PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int))) \ bfd_true) #define ieee_read_ar_hdr bfd_nullvoidptr @@ -4017,7 +4045,6 @@ ieee_bfd_debug_info_accumulate (abfd, section) #define ieee_bfd_final_link _bfd_generic_final_link #define ieee_bfd_link_split_section _bfd_generic_link_split_section -/*SUPPRESS 460 */ const bfd_target ieee_vec = { "ieee", /* name */ @@ -4071,10 +4098,11 @@ const bfd_target ieee_vec = ieee_update_armap_timestamp */ BFD_JUMP_TABLE_ARCHIVE (ieee), - /* ieee_get_symtab_upper_bound, ieee_get_symtab, ieee_make_empty_symbol, - ieee_print_symbol, ieee_get_symbol_info, ieee_bfd_is_local_label_name, - ieee_get_lineno, ieee_find_nearest_line, ieee_bfd_make_debug_symbol, - ieee_read_minisymbols, ieee_minisymbol_to_symbol */ + /* ieee_get_symtab_upper_bound, ieee_canonicalize_symtab, + ieee_make_empty_symbol, ieee_print_symbol, ieee_get_symbol_info, + ieee_bfd_is_local_label_name, ieee_get_lineno, + ieee_find_nearest_line, ieee_bfd_make_debug_symbol, + ieee_read_minisymbols, ieee_minisymbol_to_symbol */ BFD_JUMP_TABLE_SYMBOLS (ieee), /* ieee_get_reloc_upper_bound, ieee_canonicalize_reloc, diff --git a/contrib/binutils/bfd/ihex.c b/contrib/binutils/bfd/ihex.c index 8188c01..5d2d47f 100644 --- a/contrib/binutils/bfd/ihex.c +++ b/contrib/binutils/bfd/ihex.c @@ -1,5 +1,5 @@ /* BFD back-end for Intel Hex objects. - Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002 + Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor of Cygnus Support . @@ -125,23 +125,32 @@ The MRI compiler uses this, which is a repeat of type 5: #include "libiberty.h" #include "safe-ctype.h" -static void ihex_init PARAMS ((void)); -static boolean ihex_mkobject PARAMS ((bfd *)); -static INLINE int ihex_get_byte PARAMS ((bfd *, boolean *)); -static void ihex_bad_byte PARAMS ((bfd *, unsigned int, int, boolean)); -static boolean ihex_scan PARAMS ((bfd *)); -static const bfd_target *ihex_object_p PARAMS ((bfd *)); -static boolean ihex_read_section PARAMS ((bfd *, asection *, bfd_byte *)); -static boolean ihex_get_section_contents +static void ihex_init + PARAMS ((void)); +static bfd_boolean ihex_mkobject + PARAMS ((bfd *)); +static INLINE int ihex_get_byte + PARAMS ((bfd *, bfd_boolean *)); +static void ihex_bad_byte + PARAMS ((bfd *, unsigned int, int, bfd_boolean)); +static bfd_boolean ihex_scan + PARAMS ((bfd *)); +static const bfd_target *ihex_object_p + PARAMS ((bfd *)); +static bfd_boolean ihex_read_section + PARAMS ((bfd *, asection *, bfd_byte *)); +static bfd_boolean ihex_get_section_contents PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); -static boolean ihex_set_section_contents - PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); -static boolean ihex_write_record +static bfd_boolean ihex_set_section_contents + PARAMS ((bfd *, asection *, const PTR, file_ptr, bfd_size_type)); +static bfd_boolean ihex_write_record PARAMS ((bfd *, size_t, unsigned int, unsigned int, bfd_byte *)); -static boolean ihex_write_object_contents PARAMS ((bfd *)); -static boolean ihex_set_arch_mach +static bfd_boolean ihex_write_object_contents + PARAMS ((bfd *)); +static bfd_boolean ihex_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, unsigned long)); -static int ihex_sizeof_headers PARAMS ((bfd *, boolean)); +static int ihex_sizeof_headers + PARAMS ((bfd *, bfd_boolean)); /* The number of bytes we put on one line during output. */ @@ -178,18 +187,18 @@ struct ihex_data_struct static void ihex_init () { - static boolean inited; + static bfd_boolean inited; if (! inited) { - inited = true; + inited = TRUE; hex_init (); } } /* Create an ihex object. */ -static boolean +static bfd_boolean ihex_mkobject (abfd) bfd *abfd; { @@ -198,12 +207,12 @@ ihex_mkobject (abfd) tdata = (struct ihex_data_struct *) bfd_alloc (abfd, amt); if (tdata == NULL) - return false; + return FALSE; abfd->tdata.ihex_data = tdata; tdata->head = NULL; tdata->tail = NULL; - return true; + return TRUE; } /* Read a byte from a BFD. Set *ERRORPTR if an error occurred. @@ -212,14 +221,14 @@ ihex_mkobject (abfd) static INLINE int ihex_get_byte (abfd, errorptr) bfd *abfd; - boolean *errorptr; + bfd_boolean *errorptr; { bfd_byte c; if (bfd_bread (&c, (bfd_size_type) 1, abfd) != 1) { if (bfd_get_error () != bfd_error_file_truncated) - *errorptr = true; + *errorptr = TRUE; return EOF; } @@ -233,7 +242,7 @@ ihex_bad_byte (abfd, lineno, c, error) bfd *abfd; unsigned int lineno; int c; - boolean error; + bfd_boolean error; { if (c == EOF) { @@ -261,7 +270,7 @@ ihex_bad_byte (abfd, lineno, c, error) /* Read an Intel hex file and turn it into sections. We create a new section for each contiguous set of bytes. */ -static boolean +static bfd_boolean ihex_scan (abfd) bfd *abfd; { @@ -269,7 +278,7 @@ ihex_scan (abfd) bfd_vma extbase; asection *sec; unsigned int lineno; - boolean error; + bfd_boolean error; bfd_byte *buf = NULL; size_t bufsize; int c; @@ -283,7 +292,7 @@ ihex_scan (abfd) extbase = 0; sec = NULL; lineno = 1; - error = false; + error = FALSE; bufsize = 0; while ((c = ihex_get_byte (abfd, &error)) != EOF) @@ -407,7 +416,7 @@ ihex_scan (abfd) abfd->start_address = addr; if (buf != NULL) free (buf); - return true; + return TRUE; case 2: /* An extended address record. */ @@ -496,12 +505,12 @@ ihex_scan (abfd) if (buf != NULL) free (buf); - return true; + return TRUE; error_return: if (buf != NULL) free (buf); - return false; + return FALSE; } /* Try to recognize an Intel Hex file. */ @@ -563,7 +572,7 @@ ihex_object_p (abfd) /* Read the contents of a section in an Intel Hex file. */ -static boolean +static bfd_boolean ihex_read_section (abfd, section, contents) bfd *abfd; asection *section; @@ -573,14 +582,14 @@ ihex_read_section (abfd, section, contents) bfd_byte *p; bfd_byte *buf = NULL; size_t bufsize; - boolean error; + bfd_boolean error; if (bfd_seek (abfd, section->filepos, SEEK_SET) != 0) goto error_return; p = contents; bufsize = 0; - error = false; + error = FALSE; while ((c = ihex_get_byte (abfd, &error)) != EOF) { char hdr[8]; @@ -631,7 +640,7 @@ ihex_read_section (abfd, section, contents) /* We've read everything in the section. */ if (buf != NULL) free (buf); - return true; + return TRUE; } /* Skip the checksum. */ @@ -651,17 +660,17 @@ ihex_read_section (abfd, section, contents) if (buf != NULL) free (buf); - return true; + return TRUE; error_return: if (buf != NULL) free (buf); - return false; + return FALSE; } /* Get the contents of a section in an Intel Hex file. */ -static boolean +static bfd_boolean ihex_get_section_contents (abfd, section, location, offset, count) bfd *abfd; asection *section; @@ -673,24 +682,24 @@ ihex_get_section_contents (abfd, section, location, offset, count) { section->used_by_bfd = bfd_alloc (abfd, section->_raw_size); if (section->used_by_bfd == NULL) - return false; + return FALSE; if (! ihex_read_section (abfd, section, section->used_by_bfd)) - return false; + return FALSE; } memcpy (location, (bfd_byte *) section->used_by_bfd + offset, (size_t) count); - return true; + return TRUE; } /* Set the contents of a section in an Intel Hex file. */ -static boolean +static bfd_boolean ihex_set_section_contents (abfd, section, location, offset, count) bfd *abfd; asection *section; - PTR location; + const PTR location; file_ptr offset; bfd_size_type count; { @@ -702,16 +711,16 @@ ihex_set_section_contents (abfd, section, location, offset, count) if (count == 0 || (section->flags & SEC_ALLOC) == 0 || (section->flags & SEC_LOAD) == 0) - return true; + return TRUE; amt = sizeof (struct ihex_data_list); n = (struct ihex_data_list *) bfd_alloc (abfd, amt); if (n == NULL) - return false; + return FALSE; data = (bfd_byte *) bfd_alloc (abfd, count); if (data == NULL) - return false; + return FALSE; memcpy (data, location, (size_t) count); n->data = data; @@ -742,12 +751,12 @@ ihex_set_section_contents (abfd, section, location, offset, count) tdata->tail = n; } - return true; + return TRUE; } /* Write a record out to an Intel Hex file. */ -static boolean +static bfd_boolean ihex_write_record (abfd, count, addr, type, data) bfd *abfd; size_t count; @@ -785,14 +794,14 @@ ihex_write_record (abfd, count, addr, type, data) total = 9 + count * 2 + 4; if (bfd_bwrite (buf, (bfd_size_type) total, abfd) != total) - return false; + return FALSE; - return true; + return TRUE; } /* Write out an Intel Hex file. */ -static boolean +static bfd_boolean ihex_write_object_contents (abfd) bfd *abfd; { @@ -834,7 +843,7 @@ ihex_write_object_contents (abfd) addr[0] = (bfd_byte)(segbase >> 12) & 0xff; addr[1] = (bfd_byte)(segbase >> 4) & 0xff; if (! ihex_write_record (abfd, 2, 0, 2, addr)) - return false; + return FALSE; } else { @@ -849,7 +858,7 @@ ihex_write_object_contents (abfd) addr[0] = 0; addr[1] = 0; if (! ihex_write_record (abfd, 2, 0, 2, addr)) - return false; + return FALSE; segbase = 0; } @@ -863,12 +872,12 @@ ihex_write_object_contents (abfd) (_("%s: address 0x%s out of range for Intel Hex file"), bfd_get_filename (abfd), buf); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } addr[0] = (bfd_byte)(extbase >> 24) & 0xff; addr[1] = (bfd_byte)(extbase >> 16) & 0xff; if (! ihex_write_record (abfd, 2, 0, 4, addr)) - return false; + return FALSE; } } @@ -879,7 +888,7 @@ ihex_write_object_contents (abfd) now = 0x10000 - rec_addr; if (! ihex_write_record (abfd, now, rec_addr, 0, p)) - return false; + return FALSE; where += now; p += now; @@ -901,7 +910,7 @@ ihex_write_object_contents (abfd) startbuf[2] = (bfd_byte)(start >> 8) & 0xff; startbuf[3] = (bfd_byte)start & 0xff; if (! ihex_write_record (abfd, 4, 0, 3, startbuf)) - return false; + return FALSE; } else { @@ -910,20 +919,20 @@ ihex_write_object_contents (abfd) startbuf[2] = (bfd_byte)(start >> 8) & 0xff; startbuf[3] = (bfd_byte)start & 0xff; if (! ihex_write_record (abfd, 4, 0, 5, startbuf)) - return false; + return FALSE; } } if (! ihex_write_record (abfd, 0, 0, 1, NULL)) - return false; + return FALSE; - return true; + return TRUE; } /* Set the architecture for the output file. The architecture is irrelevant, so we ignore errors about unknown architectures. */ -static boolean +static bfd_boolean ihex_set_arch_mach (abfd, arch, mach) bfd *abfd; enum bfd_architecture arch; @@ -932,18 +941,17 @@ ihex_set_arch_mach (abfd, arch, mach) if (! bfd_default_set_arch_mach (abfd, arch, mach)) { if (arch != bfd_arch_unknown) - return false; + return FALSE; } - return true; + return TRUE; } /* Get the size of the headers, for the linker. */ -/*ARGSUSED*/ static int ihex_sizeof_headers (abfd, exec) bfd *abfd ATTRIBUTE_UNUSED; - boolean exec ATTRIBUTE_UNUSED; + bfd_boolean exec ATTRIBUTE_UNUSED; { return 0; } @@ -957,7 +965,7 @@ ihex_sizeof_headers (abfd, exec) _bfd_generic_get_section_contents_in_window #define ihex_get_symtab_upper_bound bfd_0l -#define ihex_get_symtab \ +#define ihex_canonicalize_symtab \ ((long (*) PARAMS ((bfd *, asymbol **))) bfd_0l) #define ihex_make_empty_symbol _bfd_generic_make_empty_symbol #define ihex_print_symbol _bfd_nosymbols_print_symbol diff --git a/contrib/binutils/bfd/init.c b/contrib/binutils/bfd/init.c index 198b979..07401eb 100644 --- a/contrib/binutils/bfd/init.c +++ b/contrib/binutils/bfd/init.c @@ -1,5 +1,5 @@ /* bfd initialization stuff - Copyright 1990, 1991, 1992, 1993, 1994, 1995 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 2003 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. @@ -35,7 +35,7 @@ FUNCTION bfd_init SYNOPSIS - void bfd_init(void); + void bfd_init (void); DESCRIPTION This routine must be called before any other BFD function to @@ -46,6 +46,6 @@ DESCRIPTION However, someday it may be needed, so keep it around. */ void -bfd_init () +bfd_init (void) { } diff --git a/contrib/binutils/bfd/libaout.h b/contrib/binutils/bfd/libaout.h index a76b935..67054e3 100644 --- a/contrib/binutils/bfd/libaout.h +++ b/contrib/binutils/bfd/libaout.h @@ -1,24 +1,24 @@ /* BFD back-end data structures for a.out (and similar) files. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. -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. */ #ifndef LIBAOUT_H #define LIBAOUT_H @@ -29,51 +29,23 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfdlink.h" -/* Macros for accessing components in an aout header. Saves cluttering - the source with (bfd_vma) and (bfd_byte *) casts. */ - -#define H_PUT_64(abfd, val, where) \ - bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_32(abfd, val, where) \ - bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_16(abfd, val, where) \ - bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) +/* Macros for accessing components in an aout header. */ +#define H_PUT_64 bfd_h_put_64 +#define H_PUT_32 bfd_h_put_32 +#define H_PUT_16 bfd_h_put_16 #define H_PUT_8 bfd_h_put_8 - -#define H_PUT_S64(abfd, val, where) \ - bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_S32(abfd, val, where) \ - bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - -#define H_PUT_S16(abfd, val, where) \ - bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) - +#define H_PUT_S64 bfd_h_put_signed_64 +#define H_PUT_S32 bfd_h_put_signed_32 +#define H_PUT_S16 bfd_h_put_signed_16 #define H_PUT_S8 bfd_h_put_signed_8 - -#define H_GET_64(abfd, where) \ - bfd_h_get_64 ((abfd), (bfd_byte *) (where)) - -#define H_GET_32(abfd, where) \ - bfd_h_get_32 ((abfd), (bfd_byte *) (where)) - -#define H_GET_16(abfd, where) \ - bfd_h_get_16 ((abfd), (bfd_byte *) (where)) - +#define H_GET_64 bfd_h_get_64 +#define H_GET_32 bfd_h_get_32 +#define H_GET_16 bfd_h_get_16 #define H_GET_8 bfd_h_get_8 - -#define H_GET_S64(abfd, where) \ - bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where)) - -#define H_GET_S32(abfd, where) \ - bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where)) - -#define H_GET_S16(abfd, where) \ - bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where)) - +#define H_GET_S64 bfd_h_get_signed_64 +#define H_GET_S32 bfd_h_get_signed_32 +#define H_GET_S16 bfd_h_get_signed_16 #define H_GET_S8 bfd_h_get_signed_8 /* Parameterize the a.out code based on whether it is being built @@ -131,7 +103,7 @@ struct aout_link_hash_entry { struct bfd_link_hash_entry root; /* Whether this symbol has been written out. */ - boolean written; + bfd_boolean written; /* Symbol index in output file. */ int indx; }; @@ -154,7 +126,7 @@ struct aout_link_hash_table #define aout_link_hash_traverse(table, func, info) \ (bfd_link_hash_traverse \ (&(table)->root, \ - (boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \ (info))) /* Get the a.out link hash table from the info structure. This is @@ -193,7 +165,7 @@ struct aout_backend_data /* Callback for setting the page and segment sizes, if they can't be trivially determined from the architecture. */ - boolean (*set_sizes) + bfd_boolean (*set_sizes) PARAMS ((bfd *)); /* zmagic files only. For go32, the length of the exec header contributes @@ -203,39 +175,39 @@ struct aout_backend_data /* Callback from the add symbols phase of the linker code to handle a dynamic object. */ - boolean (*add_dynamic_symbols) + bfd_boolean (*add_dynamic_symbols) PARAMS ((bfd *, struct bfd_link_info *, struct external_nlist **, bfd_size_type *, char **)); /* Callback from the add symbols phase of the linker code to handle adding a single symbol to the global linker hash table. */ - boolean (*add_one_symbol) + bfd_boolean (*add_one_symbol) PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, - asection *, bfd_vma, const char *, boolean, boolean, + asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, struct bfd_link_hash_entry **)); /* Called to handle linking a dynamic object. */ - boolean (*link_dynamic_object) + bfd_boolean (*link_dynamic_object) PARAMS ((struct bfd_link_info *, bfd *)); /* Called for each global symbol being written out by the linker. This should write out the dynamic symbol information. */ - boolean (*write_dynamic_symbol) + bfd_boolean (*write_dynamic_symbol) PARAMS ((bfd *, struct bfd_link_info *, struct aout_link_hash_entry *)); /* If this callback is not NULL, the linker calls it for each reloc. RELOC is a pointer to the unswapped reloc. If *SKIP is set to - true, the reloc will be skipped. *RELOCATION may be changed to + TRUE, the reloc will be skipped. *RELOCATION may be changed to change the effects of the relocation. */ - boolean (*check_dynamic_reloc) + bfd_boolean (*check_dynamic_reloc) PARAMS ((struct bfd_link_info *info, bfd *input_bfd, asection *input_section, struct aout_link_hash_entry *h, - PTR reloc, bfd_byte *contents, boolean *skip, + PTR reloc, bfd_byte *contents, bfd_boolean *skip, bfd_vma *relocation)); /* Called at the end of a link to finish up any dynamic linking information. */ - boolean (*finish_dynamic_link) + bfd_boolean (*finish_dynamic_link) PARAMS ((bfd *, struct bfd_link_info *)); }; #define aout_backend_info(abfd) \ @@ -282,10 +254,10 @@ enum machine_type { M_68010 = 1, M_68020 = 2, M_SPARC = 3, - /* skip a bunch so we don't run into any of suns numbers */ - /* make these up for the ns32k*/ - M_NS32032 = (64), /* ns32032 running ? */ - M_NS32532 = (64 + 5), /* ns32532 running mach */ + /* Skip a bunch so we don't run into any of SUN's numbers. */ + /* Make these up for the ns32k. */ + M_NS32032 = (64), /* ns32032 running ? */ + M_NS32532 = (64 + 5), /* ns32532 running mach */ M_386 = 100, M_29K = 101, /* AMD 29000 */ @@ -377,7 +349,7 @@ struct aoutdata { struct internal_exec *hdr; /* exec file header */ aout_symbol_type *symbols; /* symtab for input bfd */ - /* For ease, we do this */ + /* For ease, we do this. */ asection *textsec; asection *datasec; asection *bsssec; @@ -387,16 +359,16 @@ struct aoutdata { file_ptr sym_filepos; file_ptr str_filepos; - /* Size of a relocation entry in external form */ + /* Size of a relocation entry in external form. */ unsigned reloc_entry_size; - /* Size of a symbol table entry in external form */ + /* Size of a symbol table entry in external form. */ unsigned symbol_entry_size; - /* Page size - needed for alignment of demand paged files. */ + /* Page size - needed for alignment of demand paged files. */ unsigned long page_size; - /* Segment size - needed for alignment of demand paged files. */ + /* Segment size - needed for alignment of demand paged files. */ unsigned long segment_size; /* Zmagic disk block size - need to align the start of the text @@ -406,7 +378,7 @@ struct aoutdata { unsigned exec_bytes_size; unsigned vma_adjusted : 1; - /* used when a bfd supports several highly similar formats */ + /* Used when a bfd supports several highly similar formats. */ enum { default_format = 0, @@ -471,7 +443,7 @@ struct aout_data_struct { #define obj_aout_dynamic_info(bfd) (adata(bfd).dynamic_info) /* We take the address of the first element of an asymbol to ensure that the - macro is only ever applied to an asymbol */ + macro is only ever applied to an asymbol. */ #define aout_symbol(asymbol) ((aout_symbol_type *)(&(asymbol)->the_bfd)) /* Information we keep for each a.out section. This is currently only @@ -489,43 +461,43 @@ struct aout_section_data_struct #define set_aout_section_data(s,v) \ ((s)->used_by_bfd = (PTR)&(v)->relocs) -/* Prototype declarations for functions defined in aoutx.h */ +/* Prototype declarations for functions defined in aoutx.h. */ -extern boolean NAME(aout,squirt_out_relocs) +extern bfd_boolean NAME(aout,squirt_out_relocs) PARAMS ((bfd *, asection *)); -extern boolean NAME(aout,make_sections) +extern bfd_boolean NAME(aout,make_sections) PARAMS ((bfd *)); extern const bfd_target * NAME(aout,some_aout_object_p) PARAMS ((bfd *, struct internal_exec *, const bfd_target *(*) (bfd *))); -extern boolean NAME(aout,mkobject) +extern bfd_boolean NAME(aout,mkobject) PARAMS ((bfd *)); extern enum machine_type NAME(aout,machine_type) - PARAMS ((enum bfd_architecture, unsigned long, boolean *)); + PARAMS ((enum bfd_architecture, unsigned long, bfd_boolean *)); -extern boolean NAME(aout,set_arch_mach) +extern bfd_boolean NAME(aout,set_arch_mach) PARAMS ((bfd *, enum bfd_architecture, unsigned long)); -extern boolean NAME(aout,new_section_hook) +extern bfd_boolean NAME(aout,new_section_hook) PARAMS ((bfd *, asection *)); -extern boolean NAME(aout,set_section_contents) - PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); +extern bfd_boolean NAME(aout,set_section_contents) + PARAMS ((bfd *, sec_ptr, const PTR, file_ptr, bfd_size_type)); extern asymbol * NAME(aout,make_empty_symbol) PARAMS ((bfd *)); -extern boolean NAME(aout,translate_symbol_table) +extern bfd_boolean NAME(aout,translate_symbol_table) PARAMS ((bfd *, aout_symbol_type *, struct external_nlist *, bfd_size_type, - char *, bfd_size_type, boolean)); + char *, bfd_size_type, bfd_boolean)); -extern boolean NAME(aout,slurp_symbol_table) +extern bfd_boolean NAME(aout,slurp_symbol_table) PARAMS ((bfd *)); -extern boolean NAME(aout,write_syms) +extern bfd_boolean NAME(aout,write_syms) PARAMS ((bfd *)); extern void NAME(aout,reclaim_symbol_table) @@ -534,7 +506,7 @@ extern void NAME(aout,reclaim_symbol_table) extern long NAME(aout,get_symtab_upper_bound) PARAMS ((bfd *)); -extern long NAME(aout,get_symtab) +extern long NAME(aout,canonicalize_symtab) PARAMS ((bfd *, asymbol **)); extern void NAME(aout,swap_ext_reloc_in) @@ -547,7 +519,7 @@ extern void NAME(aout,swap_std_reloc_in) extern reloc_howto_type * NAME(aout,reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); -extern boolean NAME(aout,slurp_reloc_table) +extern bfd_boolean NAME(aout,slurp_reloc_table) PARAMS ((bfd *, sec_ptr, asymbol **)); extern long NAME(aout,canonicalize_reloc) @@ -568,20 +540,20 @@ extern void NAME(aout,print_symbol) extern void NAME(aout,get_symbol_info) PARAMS ((bfd *, asymbol *, symbol_info *)); -extern boolean NAME(aout,find_nearest_line) +extern bfd_boolean NAME(aout,find_nearest_line) PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *)); extern long NAME(aout,read_minisymbols) - PARAMS ((bfd *, boolean, PTR *, unsigned int *)); + PARAMS ((bfd *, bfd_boolean, PTR *, unsigned int *)); extern asymbol * NAME(aout,minisymbol_to_symbol) - PARAMS ((bfd *, boolean, const PTR, asymbol *)); + PARAMS ((bfd *, bfd_boolean, const PTR, asymbol *)); extern int NAME(aout,sizeof_headers) - PARAMS ((bfd *, boolean)); + PARAMS ((bfd *, bfd_boolean)); -extern boolean NAME(aout,adjust_sizes_and_vmas) +extern bfd_boolean NAME(aout,adjust_sizes_and_vmas) PARAMS ((bfd *, bfd_size_type *, file_ptr *)); extern void NAME(aout,swap_exec_header_in) @@ -593,7 +565,7 @@ extern void NAME(aout,swap_exec_header_out) extern struct bfd_hash_entry * NAME(aout,link_hash_newfunc) PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -extern boolean NAME(aout,link_hash_table_init) +extern bfd_boolean NAME(aout,link_hash_table_init) PARAMS ((struct aout_link_hash_table *, bfd *, struct bfd_hash_entry *(*) (struct bfd_hash_entry *, struct bfd_hash_table *, @@ -602,17 +574,17 @@ extern boolean NAME(aout,link_hash_table_init) extern struct bfd_link_hash_table * NAME(aout,link_hash_table_create) PARAMS ((bfd *)); -extern boolean NAME(aout,link_add_symbols) +extern bfd_boolean NAME(aout,link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean NAME(aout,final_link) +extern bfd_boolean NAME(aout,final_link) PARAMS ((bfd *, struct bfd_link_info *, void (*) (bfd *, file_ptr *, file_ptr *, file_ptr *))); -extern boolean NAME(aout,bfd_free_cached_info) +extern bfd_boolean NAME(aout,bfd_free_cached_info) PARAMS ((bfd *)); -/* A.out uses the generic versions of these routines... */ +/* A.out uses the generic versions of these routines... */ #define aout_16_get_section_contents _bfd_generic_get_section_contents @@ -647,29 +619,48 @@ extern boolean NAME(aout,bfd_free_cached_info) if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0 \ || bfd_bwrite ((PTR) &exec_bytes, (bfd_size_type) EXEC_BYTES_SIZE, \ abfd) != EXEC_BYTES_SIZE) \ - return false; \ - /* Now write out reloc info, followed by syms and strings */ \ + return FALSE; \ + /* Now write out reloc info, followed by syms and strings. */ \ \ if (bfd_get_outsymbols (abfd) != (asymbol **) NULL \ && bfd_get_symcount (abfd) != 0) \ { \ if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*execp)), SEEK_SET) != 0)\ - return false; \ + return FALSE; \ \ if (! NAME(aout,write_syms) (abfd)) \ - return false; \ + return FALSE; \ } \ \ if (bfd_seek (abfd, (file_ptr) (N_TRELOFF(*execp)), SEEK_SET) != 0) \ - return false; \ + return FALSE; \ if (!NAME(aout,squirt_out_relocs) (abfd, obj_textsec (abfd))) \ - return false; \ + return FALSE; \ \ if (bfd_seek (abfd, (file_ptr) (N_DRELOFF(*execp)), SEEK_SET) != 0) \ - return false; \ + return FALSE; \ if (!NAME(aout,squirt_out_relocs) (abfd, obj_datasec (abfd))) \ - return false; \ + return FALSE; \ } #endif +/* Test if a read-only section can be merged with .text. This is + possible if: + + 1. Section has file contents and is read-only. + 2. The VMA of the section is after the end of .text and before + the start of .data. + 3. The image is demand-pageable (otherwise, a_text in the header + will not reflect the gap between .text and .data). */ + +#define aout_section_merge_with_text_p(abfd, sec) \ + (((sec)->flags & (SEC_HAS_CONTENTS | SEC_READONLY)) == \ + (SEC_HAS_CONTENTS | SEC_READONLY) \ + && obj_textsec (abfd) != NULL \ + && obj_datasec (abfd) != NULL \ + && (sec)->vma >= (obj_textsec (abfd)->vma + \ + obj_textsec (abfd)->_cooked_size) \ + && ((sec)->vma + (sec)->_cooked_size) <= obj_datasec (abfd)->vma \ + && ((abfd)->flags & D_PAGED) != 0) + #endif /* ! defined (LIBAOUT_H) */ diff --git a/contrib/binutils/bfd/libbfd-in.h b/contrib/binutils/bfd/libbfd-in.h index 776dcd6..10cafef 100644 --- a/contrib/binutils/bfd/libbfd-in.h +++ b/contrib/binutils/bfd/libbfd-in.h @@ -1,8 +1,9 @@ /* libbfd.h -- Declarations used by bfd library *implementation*. (This include file is not for users of the library.) - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 - Free Software Foundation, Inc. + + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -36,7 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Set a tdata field. Can't use the other macros for this, since they do casts, and casting to the left of assignment isn't portable. */ -#define set_tdata(bfd, v) ((bfd)->tdata.any = (PTR) (v)) +#define set_tdata(bfd, v) ((bfd)->tdata.any = (v)) /* If BFD_IN_MEMORY is set for a BFD, then the iostream fields points to an instance of this structure. */ @@ -69,7 +70,7 @@ struct artdata { archive. */ file_ptr armap_datepos; /* Position within archive to seek to rewrite the date field. */ - PTR tdata; /* Backend specific information. */ + void *tdata; /* Backend specific information. */ }; #define bfd_ardata(bfd) ((bfd)->tdata.aout_ar_data) @@ -83,70 +84,105 @@ struct areltdata { #define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size) -extern PTR bfd_malloc PARAMS ((bfd_size_type)); -extern PTR bfd_realloc PARAMS ((PTR, bfd_size_type)); -extern PTR bfd_zmalloc PARAMS ((bfd_size_type)); +extern void *bfd_malloc + (bfd_size_type); +extern void *bfd_realloc + (void *, bfd_size_type); +extern void *bfd_zmalloc + (bfd_size_type); extern bfd_error_handler_type _bfd_error_handler; /* These routines allocate and free things on the BFD's objalloc. */ -extern PTR bfd_alloc PARAMS ((bfd *, bfd_size_type)); -extern PTR bfd_zalloc PARAMS ((bfd *, bfd_size_type)); -extern void bfd_release PARAMS ((bfd *, PTR)); - -bfd * _bfd_create_empty_archive_element_shell PARAMS ((bfd *obfd)); -bfd * _bfd_look_for_bfd_in_cache PARAMS ((bfd *, file_ptr)); -boolean _bfd_add_bfd_to_archive_cache PARAMS ((bfd *, file_ptr, bfd *)); -boolean _bfd_generic_mkarchive PARAMS ((bfd *abfd)); -const bfd_target *bfd_generic_archive_p PARAMS ((bfd *abfd)); -boolean bfd_slurp_armap PARAMS ((bfd *abfd)); -boolean bfd_slurp_bsd_armap_f2 PARAMS ((bfd *abfd)); +extern void *bfd_alloc + (bfd *, bfd_size_type); +extern void *bfd_zalloc + (bfd *, bfd_size_type); +extern void bfd_release + (bfd *, void *); + +bfd * _bfd_create_empty_archive_element_shell + (bfd *obfd); +bfd * _bfd_look_for_bfd_in_cache + (bfd *, file_ptr); +bfd_boolean _bfd_add_bfd_to_archive_cache + (bfd *, file_ptr, bfd *); +bfd_boolean _bfd_generic_mkarchive + (bfd *abfd); +const bfd_target *bfd_generic_archive_p + (bfd *abfd); +bfd_boolean bfd_slurp_armap + (bfd *abfd); +bfd_boolean bfd_slurp_bsd_armap_f2 + (bfd *abfd); #define bfd_slurp_bsd_armap bfd_slurp_armap #define bfd_slurp_coff_armap bfd_slurp_armap -boolean _bfd_slurp_extended_name_table PARAMS ((bfd *abfd)); -extern boolean _bfd_construct_extended_name_table - PARAMS ((bfd *, boolean, char **, bfd_size_type *)); -boolean _bfd_write_archive_contents PARAMS ((bfd *abfd)); -boolean _bfd_compute_and_write_armap PARAMS ((bfd *, unsigned int elength)); -bfd *_bfd_get_elt_at_filepos PARAMS ((bfd *archive, file_ptr filepos)); -extern bfd *_bfd_generic_get_elt_at_index PARAMS ((bfd *, symindex)); -bfd * _bfd_new_bfd PARAMS ((void)); -void _bfd_delete_bfd PARAMS ((bfd *)); - -boolean bfd_false PARAMS ((bfd *ignore)); -boolean bfd_true PARAMS ((bfd *ignore)); -PTR bfd_nullvoidptr PARAMS ((bfd *ignore)); -int bfd_0 PARAMS ((bfd *ignore)); -unsigned int bfd_0u PARAMS ((bfd *ignore)); -long bfd_0l PARAMS ((bfd *ignore)); -long _bfd_n1 PARAMS ((bfd *ignore)); -void bfd_void PARAMS ((bfd *ignore)); - -bfd *_bfd_new_bfd_contained_in PARAMS ((bfd *)); -const bfd_target *_bfd_dummy_target PARAMS ((bfd *abfd)); - -void bfd_dont_truncate_arname PARAMS ((bfd *abfd, const char *filename, - char *hdr)); -void bfd_bsd_truncate_arname PARAMS ((bfd *abfd, const char *filename, - char *hdr)); -void bfd_gnu_truncate_arname PARAMS ((bfd *abfd, const char *filename, - char *hdr)); - -boolean bsd_write_armap PARAMS ((bfd *arch, unsigned int elength, - struct orl *map, unsigned int orl_count, int stridx)); - -boolean coff_write_armap PARAMS ((bfd *arch, unsigned int elength, - struct orl *map, unsigned int orl_count, int stridx)); - -extern PTR _bfd_generic_read_ar_hdr PARAMS ((bfd *)); - -extern PTR _bfd_generic_read_ar_hdr_mag PARAMS ((bfd *, const char *)); - -bfd * bfd_generic_openr_next_archived_file PARAMS ((bfd *archive, - bfd *last_file)); - -int bfd_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); +bfd_boolean _bfd_slurp_extended_name_table + (bfd *abfd); +extern bfd_boolean _bfd_construct_extended_name_table + (bfd *, bfd_boolean, char **, bfd_size_type *); +bfd_boolean _bfd_write_archive_contents + (bfd *abfd); +bfd_boolean _bfd_compute_and_write_armap + (bfd *, unsigned int elength); +bfd *_bfd_get_elt_at_filepos + (bfd *archive, file_ptr filepos); +extern bfd *_bfd_generic_get_elt_at_index + (bfd *, symindex); +bfd * _bfd_new_bfd + (void); +void _bfd_delete_bfd + (bfd *); + +bfd_boolean bfd_false + (bfd *ignore); +bfd_boolean bfd_true + (bfd *ignore); +void *bfd_nullvoidptr + (bfd *ignore); +int bfd_0 + (bfd *ignore); +unsigned int bfd_0u + (bfd *ignore); +long bfd_0l + (bfd *ignore); +long _bfd_n1 + (bfd *ignore); +void bfd_void + (bfd *ignore); + +bfd *_bfd_new_bfd_contained_in + (bfd *); +const bfd_target *_bfd_dummy_target + (bfd *abfd); + +void bfd_dont_truncate_arname + (bfd *abfd, const char *filename, char *hdr); +void bfd_bsd_truncate_arname + (bfd *abfd, const char *filename, char *hdr); +void bfd_gnu_truncate_arname + (bfd *abfd, const char *filename, char *hdr); + +bfd_boolean bsd_write_armap + (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count, + int stridx); + +bfd_boolean coff_write_armap + (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count, + int stridx); + +extern void *_bfd_generic_read_ar_hdr + (bfd *); + +extern void *_bfd_generic_read_ar_hdr_mag + (bfd *, const char *); + +bfd * bfd_generic_openr_next_archived_file + (bfd *archive, bfd *last_file); + +int bfd_generic_stat_arch_elt + (bfd *, struct stat *); #define _bfd_read_ar_hdr(abfd) \ BFD_SEND (abfd, _bfd_read_ar_hdr_fn, (abfd)) @@ -157,35 +193,37 @@ int bfd_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); #define _bfd_generic_close_and_cleanup bfd_true #define _bfd_generic_bfd_free_cached_info bfd_true #define _bfd_generic_new_section_hook \ - ((boolean (*) PARAMS ((bfd *, asection *))) bfd_true) -extern boolean _bfd_generic_get_section_contents - PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); -extern boolean _bfd_generic_get_section_contents_in_window - PARAMS ((bfd *, asection *, bfd_window *, file_ptr, bfd_size_type)); + ((bfd_boolean (*) (bfd *, asection *)) bfd_true) +extern bfd_boolean _bfd_generic_get_section_contents + (bfd *, asection *, void *, file_ptr, bfd_size_type); +extern bfd_boolean _bfd_generic_get_section_contents_in_window + (bfd *, asection *, bfd_window *, file_ptr, bfd_size_type); /* Generic routines to use for BFD_JUMP_TABLE_COPY. Use BFD_JUMP_TABLE_COPY (_bfd_generic). */ #define _bfd_generic_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) + ((bfd_boolean (*) (bfd *, bfd *)) bfd_true) #define _bfd_generic_bfd_merge_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) + ((bfd_boolean (*) (bfd *, bfd *)) bfd_true) #define _bfd_generic_bfd_set_private_flags \ - ((boolean (*) PARAMS ((bfd *, flagword))) bfd_true) + ((bfd_boolean (*) (bfd *, flagword)) bfd_true) #define _bfd_generic_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true) + ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true) #define _bfd_generic_bfd_copy_private_symbol_data \ - ((boolean (*) PARAMS ((bfd *, asymbol *, bfd *, asymbol *))) bfd_true) + ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true) #define _bfd_generic_bfd_print_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, PTR))) bfd_true) + ((bfd_boolean (*) (bfd *, void *)) bfd_true) /* Routines to use for BFD_JUMP_TABLE_CORE when there is no core file support. Use BFD_JUMP_TABLE_CORE (_bfd_nocore). */ -extern char *_bfd_nocore_core_file_failing_command PARAMS ((bfd *)); -extern int _bfd_nocore_core_file_failing_signal PARAMS ((bfd *)); -extern boolean _bfd_nocore_core_file_matches_executable_p - PARAMS ((bfd *, bfd *)); +extern char *_bfd_nocore_core_file_failing_command + (bfd *); +extern int _bfd_nocore_core_file_failing_signal + (bfd *); +extern bfd_boolean _bfd_nocore_core_file_matches_executable_p + (bfd *, bfd *); /* Routines to use for BFD_JUMP_TABLE_ARCHIVE when there is no archive file support. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive). */ @@ -193,19 +231,18 @@ extern boolean _bfd_nocore_core_file_matches_executable_p #define _bfd_noarchive_slurp_armap bfd_false #define _bfd_noarchive_slurp_extended_name_table bfd_false #define _bfd_noarchive_construct_extended_name_table \ - ((boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \ + ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) \ bfd_false) #define _bfd_noarchive_truncate_arname \ - ((void (*) PARAMS ((bfd *, const char *, char *))) bfd_void) + ((void (*) (bfd *, const char *, char *)) bfd_void) #define _bfd_noarchive_write_armap \ - ((boolean (*) \ - PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int))) \ + ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) \ bfd_false) #define _bfd_noarchive_read_ar_hdr bfd_nullvoidptr #define _bfd_noarchive_openr_next_archived_file \ - ((bfd *(*) PARAMS ((bfd *, bfd *))) bfd_nullvoidptr) + ((bfd *(*) (bfd *, bfd *)) bfd_nullvoidptr) #define _bfd_noarchive_get_elt_at_index \ - ((bfd *(*) PARAMS ((bfd *, symindex))) bfd_nullvoidptr) + ((bfd *(*) (bfd *, symindex)) bfd_nullvoidptr) #define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt #define _bfd_noarchive_update_armap_timestamp bfd_false @@ -215,8 +252,8 @@ extern boolean _bfd_nocore_core_file_matches_executable_p #define _bfd_archive_bsd_slurp_armap bfd_slurp_bsd_armap #define _bfd_archive_bsd_slurp_extended_name_table \ _bfd_slurp_extended_name_table -extern boolean _bfd_archive_bsd_construct_extended_name_table - PARAMS ((bfd *, char **, bfd_size_type *, const char **)); +extern bfd_boolean _bfd_archive_bsd_construct_extended_name_table + (bfd *, char **, bfd_size_type *, const char **); #define _bfd_archive_bsd_truncate_arname bfd_bsd_truncate_arname #define _bfd_archive_bsd_write_armap bsd_write_armap #define _bfd_archive_bsd_read_ar_hdr _bfd_generic_read_ar_hdr @@ -225,7 +262,8 @@ extern boolean _bfd_archive_bsd_construct_extended_name_table #define _bfd_archive_bsd_get_elt_at_index _bfd_generic_get_elt_at_index #define _bfd_archive_bsd_generic_stat_arch_elt \ bfd_generic_stat_arch_elt -extern boolean _bfd_archive_bsd_update_armap_timestamp PARAMS ((bfd *)); +extern bfd_boolean _bfd_archive_bsd_update_armap_timestamp + (bfd *); /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get COFF style archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff). */ @@ -233,8 +271,8 @@ extern boolean _bfd_archive_bsd_update_armap_timestamp PARAMS ((bfd *)); #define _bfd_archive_coff_slurp_armap bfd_slurp_coff_armap #define _bfd_archive_coff_slurp_extended_name_table \ _bfd_slurp_extended_name_table -extern boolean _bfd_archive_coff_construct_extended_name_table - PARAMS ((bfd *, char **, bfd_size_type *, const char **)); +extern bfd_boolean _bfd_archive_coff_construct_extended_name_table + (bfd *, char **, bfd_size_type *, const char **); #define _bfd_archive_coff_truncate_arname bfd_dont_truncate_arname #define _bfd_archive_coff_write_armap coff_write_armap #define _bfd_archive_coff_read_ar_hdr _bfd_generic_read_ar_hdr @@ -249,95 +287,89 @@ extern boolean _bfd_archive_coff_construct_extended_name_table support. Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols). */ #define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1 -#define _bfd_nosymbols_get_symtab \ - ((long (*) PARAMS ((bfd *, asymbol **))) _bfd_n1) +#define _bfd_nosymbols_canonicalize_symtab \ + ((long (*) (bfd *, asymbol **)) _bfd_n1) #define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol #define _bfd_nosymbols_print_symbol \ - ((void (*) PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type))) bfd_void) + ((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) bfd_void) #define _bfd_nosymbols_get_symbol_info \ - ((void (*) PARAMS ((bfd *, asymbol *, symbol_info *))) bfd_void) + ((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void) #define _bfd_nosymbols_bfd_is_local_label_name \ - ((boolean (*) PARAMS ((bfd *, const char *))) bfd_false) + ((bfd_boolean (*) (bfd *, const char *)) bfd_false) #define _bfd_nosymbols_get_lineno \ - ((alent *(*) PARAMS ((bfd *, asymbol *))) bfd_nullvoidptr) + ((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr) #define _bfd_nosymbols_find_nearest_line \ - ((boolean (*) \ - PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, \ - const char **, unsigned int *))) \ + ((bfd_boolean (*) (bfd *, asection *, asymbol **, bfd_vma, const char **, \ + const char **, unsigned int *)) \ bfd_false) #define _bfd_nosymbols_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, PTR, unsigned long))) bfd_nullvoidptr) + ((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) #define _bfd_nosymbols_read_minisymbols \ - ((long (*) PARAMS ((bfd *, boolean, PTR *, unsigned int *))) _bfd_n1) + ((long (*) (bfd *, bfd_boolean, void **, unsigned int *)) _bfd_n1) #define _bfd_nosymbols_minisymbol_to_symbol \ - ((asymbol *(*) PARAMS ((bfd *, boolean, const PTR, asymbol *))) \ + ((asymbol *(*) (bfd *, bfd_boolean, const void *, asymbol *)) \ bfd_nullvoidptr) /* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc support. Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */ #define _bfd_norelocs_get_reloc_upper_bound \ - ((long (*) PARAMS ((bfd *, asection *))) _bfd_n1) + ((long (*) (bfd *, asection *)) _bfd_n1) #define _bfd_norelocs_canonicalize_reloc \ - ((long (*) PARAMS ((bfd *, asection *, arelent **, asymbol **))) _bfd_n1) + ((long (*) (bfd *, asection *, arelent **, asymbol **)) _bfd_n1) #define _bfd_norelocs_bfd_reloc_type_lookup \ - ((reloc_howto_type *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) \ - bfd_nullvoidptr) + ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr) /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not be written. Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite). */ #define _bfd_nowrite_set_arch_mach \ - ((boolean (*) PARAMS ((bfd *, enum bfd_architecture, unsigned long))) \ + ((bfd_boolean (*) (bfd *, enum bfd_architecture, unsigned long)) \ bfd_false) #define _bfd_nowrite_set_section_contents \ - ((boolean (*) PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type))) \ + ((bfd_boolean (*) (bfd *, asection *, const void *, file_ptr, bfd_size_type)) \ bfd_false) /* Generic routines to use for BFD_JUMP_TABLE_WRITE. Use BFD_JUMP_TABLE_WRITE (_bfd_generic). */ #define _bfd_generic_set_arch_mach bfd_default_set_arch_mach -extern boolean _bfd_generic_set_section_contents - PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); +extern bfd_boolean _bfd_generic_set_section_contents + (bfd *, asection *, const void *, file_ptr, bfd_size_type); /* Routines to use for BFD_JUMP_TABLE_LINK for targets which do not support linking. Use BFD_JUMP_TABLE_LINK (_bfd_nolink). */ -#define _bfd_nolink_sizeof_headers ((int (*) PARAMS ((bfd *, boolean))) bfd_0) +#define _bfd_nolink_sizeof_headers ((int (*) (bfd *, bfd_boolean)) bfd_0) #define _bfd_nolink_bfd_get_relocated_section_contents \ - ((bfd_byte *(*) \ - PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, \ - bfd_byte *, boolean, asymbol **))) \ + ((bfd_byte *(*) (bfd *, struct bfd_link_info *, struct bfd_link_order *, \ + bfd_byte *, bfd_boolean, asymbol **)) \ bfd_nullvoidptr) #define _bfd_nolink_bfd_relax_section \ - ((boolean (*) \ - PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *))) \ + ((bfd_boolean (*) \ + (bfd *, asection *, struct bfd_link_info *, bfd_boolean *)) \ bfd_false) #define _bfd_nolink_bfd_gc_sections \ - ((boolean (*) \ - PARAMS ((bfd *, struct bfd_link_info *))) \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \ bfd_false) #define _bfd_nolink_bfd_merge_sections \ - ((boolean (*) \ - PARAMS ((bfd *, struct bfd_link_info *))) \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \ bfd_false) #define _bfd_nolink_bfd_discard_group \ - ((boolean (*) \ - PARAMS ((bfd *, struct sec *))) \ + ((bfd_boolean (*) (bfd *, struct bfd_section *)) \ bfd_false) #define _bfd_nolink_bfd_link_hash_table_create \ - ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) + ((struct bfd_link_hash_table *(*) (bfd *)) bfd_nullvoidptr) #define _bfd_nolink_bfd_link_hash_table_free \ - ((void (*) PARAMS ((struct bfd_link_hash_table *))) bfd_void) + ((void (*) (struct bfd_link_hash_table *)) bfd_void) #define _bfd_nolink_bfd_link_add_symbols \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false) #define _bfd_nolink_bfd_link_just_syms \ - ((void (*) PARAMS ((asection *, struct bfd_link_info *))) bfd_void) + ((void (*) (asection *, struct bfd_link_info *)) bfd_void) #define _bfd_nolink_bfd_final_link \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false) #define _bfd_nolink_bfd_link_split_section \ - ((boolean (*) PARAMS ((bfd *, struct sec *))) bfd_false) + ((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false) /* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC @@ -345,187 +377,189 @@ extern boolean _bfd_generic_set_section_contents #define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_n1 #define _bfd_nodynamic_canonicalize_dynamic_symtab \ - ((long (*) PARAMS ((bfd *, asymbol **))) _bfd_n1) + ((long (*) (bfd *, asymbol **)) _bfd_n1) #define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_n1 #define _bfd_nodynamic_canonicalize_dynamic_reloc \ - ((long (*) PARAMS ((bfd *, arelent **, asymbol **))) _bfd_n1) + ((long (*) (bfd *, arelent **, asymbol **)) _bfd_n1) /* Generic routine to determine of the given symbol is a local label. */ -extern boolean bfd_generic_is_local_label_name PARAMS ((bfd *, const char *)); +extern bfd_boolean bfd_generic_is_local_label_name + (bfd *, const char *); /* Generic minisymbol routines. */ extern long _bfd_generic_read_minisymbols - PARAMS ((bfd *, boolean, PTR *, unsigned int *)); + (bfd *, bfd_boolean, void **, unsigned int *); extern asymbol *_bfd_generic_minisymbol_to_symbol - PARAMS ((bfd *, boolean, const PTR, asymbol *)); + (bfd *, bfd_boolean, const void *, asymbol *); /* Find the nearest line using .stab/.stabstr sections. */ -extern boolean _bfd_stab_section_find_nearest_line - PARAMS ((bfd *, asymbol **, asection *, bfd_vma, boolean *, const char **, - const char **, unsigned int *, PTR *)); +extern bfd_boolean _bfd_stab_section_find_nearest_line + (bfd *, asymbol **, asection *, bfd_vma, bfd_boolean *, + const char **, const char **, unsigned int *, void **); /* Find the neaderst line using DWARF 1 debugging information. */ -extern boolean _bfd_dwarf1_find_nearest_line - PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *)); +extern bfd_boolean _bfd_dwarf1_find_nearest_line + (bfd *, asection *, asymbol **, bfd_vma, const char **, + const char **, unsigned int *); /* Find the nearest line using DWARF 2 debugging information. */ -extern boolean _bfd_dwarf2_find_nearest_line - PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *, unsigned int, - PTR *)); +extern bfd_boolean _bfd_dwarf2_find_nearest_line + (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, + unsigned int *, unsigned int, void **); /* Create a new section entry. */ extern struct bfd_hash_entry *bfd_section_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); /* A routine to create entries for a bfd_link_hash_table. */ extern struct bfd_hash_entry *_bfd_link_hash_newfunc - PARAMS ((struct bfd_hash_entry *entry, - struct bfd_hash_table *table, - const char *string)); + (struct bfd_hash_entry *entry, struct bfd_hash_table *table, + const char *string); /* Initialize a bfd_link_hash_table. */ -extern boolean _bfd_link_hash_table_init - PARAMS ((struct bfd_link_hash_table *, bfd *, - struct bfd_hash_entry *(*) (struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *))); +extern bfd_boolean _bfd_link_hash_table_init + (struct bfd_link_hash_table *, bfd *, + struct bfd_hash_entry *(*) (struct bfd_hash_entry *, + struct bfd_hash_table *, + const char *)); /* Generic link hash table creation routine. */ extern struct bfd_link_hash_table *_bfd_generic_link_hash_table_create - PARAMS ((bfd *)); + (bfd *); /* Generic link hash table destruction routine. */ extern void _bfd_generic_link_hash_table_free - PARAMS ((struct bfd_link_hash_table *)); + (struct bfd_link_hash_table *); /* Generic add symbol routine. */ -extern boolean _bfd_generic_link_add_symbols - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean _bfd_generic_link_add_symbols + (bfd *, struct bfd_link_info *); /* Generic add symbol routine. This version is used by targets for which the linker must collect constructors and destructors by name, as the collect2 program does. */ -extern boolean _bfd_generic_link_add_symbols_collect - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean _bfd_generic_link_add_symbols_collect + (bfd *, struct bfd_link_info *); /* Generic archive add symbol routine. */ -extern boolean _bfd_generic_link_add_archive_symbols - PARAMS ((bfd *, struct bfd_link_info *, - boolean (*checkfn) (bfd *, struct bfd_link_info *, boolean *))); +extern bfd_boolean _bfd_generic_link_add_archive_symbols + (bfd *, struct bfd_link_info *, + bfd_boolean (*) (bfd *, struct bfd_link_info *, bfd_boolean *)); /* Forward declaration to avoid prototype errors. */ typedef struct bfd_link_hash_entry _bfd_link_hash_entry; /* Generic routine to add a single symbol. */ -extern boolean _bfd_generic_link_add_one_symbol - PARAMS ((struct bfd_link_info *, bfd *, const char *name, flagword, - asection *, bfd_vma, const char *, boolean copy, - boolean constructor, struct bfd_link_hash_entry **)); +extern bfd_boolean _bfd_generic_link_add_one_symbol + (struct bfd_link_info *, bfd *, const char *name, flagword, + asection *, bfd_vma, const char *, bfd_boolean copy, + bfd_boolean constructor, struct bfd_link_hash_entry **); /* Generic routine to mark section as supplying symbols only. */ extern void _bfd_generic_link_just_syms - PARAMS ((asection *, struct bfd_link_info *)); + (asection *, struct bfd_link_info *); /* Generic link routine. */ -extern boolean _bfd_generic_final_link - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean _bfd_generic_final_link + (bfd *, struct bfd_link_info *); -extern boolean _bfd_generic_link_split_section - PARAMS ((bfd *, struct sec *)); +extern bfd_boolean _bfd_generic_link_split_section + (bfd *, struct bfd_section *); /* Generic reloc_link_order processing routine. */ -extern boolean _bfd_generic_reloc_link_order - PARAMS ((bfd *, struct bfd_link_info *, asection *, - struct bfd_link_order *)); +extern bfd_boolean _bfd_generic_reloc_link_order + (bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *); /* Default link order processing routine. */ -extern boolean _bfd_default_link_order - PARAMS ((bfd *, struct bfd_link_info *, asection *, - struct bfd_link_order *)); +extern bfd_boolean _bfd_default_link_order + (bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *); /* Count the number of reloc entries in a link order list. */ extern unsigned int _bfd_count_link_order_relocs - PARAMS ((struct bfd_link_order *)); + (struct bfd_link_order *); /* Final link relocation routine. */ extern bfd_reloc_status_type _bfd_final_link_relocate - PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, - bfd_vma, bfd_vma, bfd_vma)); + (reloc_howto_type *, bfd *, asection *, bfd_byte *, + bfd_vma, bfd_vma, bfd_vma); /* Relocate a particular location by a howto and a value. */ extern bfd_reloc_status_type _bfd_relocate_contents - PARAMS ((reloc_howto_type *, bfd *, bfd_vma, bfd_byte *)); + (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *); /* Link stabs in sections in the first pass. */ -extern boolean _bfd_link_section_stabs - PARAMS ((bfd *, PTR *, asection *, asection *, PTR *)); +extern bfd_boolean _bfd_link_section_stabs + (bfd *, void **, asection *, asection *, void **, bfd_size_type *); /* Eliminate stabs for discarded functions and symbols. */ -extern boolean _bfd_discard_section_stabs - PARAMS ((bfd *, asection *, PTR, - boolean (*) (bfd_vma, PTR), PTR)); +extern bfd_boolean _bfd_discard_section_stabs + (bfd *, asection *, void *, bfd_boolean (*) (bfd_vma, void *), void *); /* Write out the .stab section when linking stabs in sections. */ -extern boolean _bfd_write_section_stabs - PARAMS ((bfd *, PTR *, asection *, PTR *, bfd_byte *)); +extern bfd_boolean _bfd_write_section_stabs + (bfd *, void **, asection *, void **, bfd_byte *); /* Write out the .stabstr string table when linking stabs in sections. */ -extern boolean _bfd_write_stab_strings PARAMS ((bfd *, PTR *)); +extern bfd_boolean _bfd_write_stab_strings + (bfd *, void **); /* Find an offset within a .stab section when linking stabs in sections. */ extern bfd_vma _bfd_stab_section_offset - PARAMS ((bfd *, PTR *, asection *, PTR *, bfd_vma)); + (bfd *, void **, asection *, void **, bfd_vma); /* Attempt to merge a SEC_MERGE section. */ -extern boolean _bfd_merge_section - PARAMS ((bfd *, PTR *, asection *, PTR *)); +extern bfd_boolean _bfd_merge_section + (bfd *, void **, asection *, void **); /* Attempt to merge SEC_MERGE sections. */ -extern boolean _bfd_merge_sections - PARAMS ((bfd *, PTR, void (*)(bfd *, asection *))); +extern bfd_boolean _bfd_merge_sections + (bfd *, void *, void (*) (bfd *, asection *)); /* Write out a merged section. */ -extern boolean _bfd_write_merged_section - PARAMS ((bfd *, asection *, PTR)); +extern bfd_boolean _bfd_write_merged_section + (bfd *, asection *, void *); /* Find an offset within a modified SEC_MERGE section. */ extern bfd_vma _bfd_merged_section_offset - PARAMS ((bfd *, asection **, PTR, bfd_vma, bfd_vma)); + (bfd *, asection **, void *, bfd_vma, bfd_vma); /* Create a string table. */ -extern struct bfd_strtab_hash *_bfd_stringtab_init PARAMS ((void)); +extern struct bfd_strtab_hash *_bfd_stringtab_init + (void); /* Create an XCOFF .debug section style string table. */ -extern struct bfd_strtab_hash *_bfd_xcoff_stringtab_init PARAMS ((void)); +extern struct bfd_strtab_hash *_bfd_xcoff_stringtab_init + (void); /* Free a string table. */ -extern void _bfd_stringtab_free PARAMS ((struct bfd_strtab_hash *)); +extern void _bfd_stringtab_free + (struct bfd_strtab_hash *); /* Get the size of a string table. */ -extern bfd_size_type _bfd_stringtab_size PARAMS ((struct bfd_strtab_hash *)); +extern bfd_size_type _bfd_stringtab_size + (struct bfd_strtab_hash *); /* Add a string to a string table. */ extern bfd_size_type _bfd_stringtab_add - PARAMS ((struct bfd_strtab_hash *, const char *, boolean hash, - boolean copy)); + (struct bfd_strtab_hash *, const char *, bfd_boolean hash, bfd_boolean copy); /* Write out a string table. */ -extern boolean _bfd_stringtab_emit PARAMS ((bfd *, struct bfd_strtab_hash *)); +extern bfd_boolean _bfd_stringtab_emit + (bfd *, struct bfd_strtab_hash *); /* Check that endianness of input and output file match. */ -extern boolean _bfd_generic_verify_endian_match PARAMS ((bfd *, bfd *)); +extern bfd_boolean _bfd_generic_verify_endian_match + (bfd *, bfd *); /* Macros to tell if bfds are read or write enabled. @@ -536,19 +570,22 @@ extern boolean _bfd_generic_verify_endian_match PARAMS ((bfd *, bfd *)); !bfd_read_p, and only sometimes bfd_write_p. */ -#define bfd_read_p(abfd) ((abfd)->direction == read_direction || (abfd)->direction == both_direction) -#define bfd_write_p(abfd) ((abfd)->direction == write_direction || (abfd)->direction == both_direction) +#define bfd_read_p(abfd) \ + ((abfd)->direction == read_direction || (abfd)->direction == both_direction) +#define bfd_write_p(abfd) \ + ((abfd)->direction == write_direction || (abfd)->direction == both_direction) -void bfd_assert PARAMS ((const char*,int)); +void bfd_assert + (const char*,int); #define BFD_ASSERT(x) \ -{ if (!(x)) bfd_assert(__FILE__,__LINE__); } + { if (!(x)) bfd_assert(__FILE__,__LINE__); } #define BFD_FAIL() \ -{ bfd_assert(__FILE__,__LINE__); } + { bfd_assert(__FILE__,__LINE__); } -extern void _bfd_abort PARAMS ((const char *, int, const char *)) - ATTRIBUTE_NORETURN; +extern void _bfd_abort + (const char *, int, const char *) ATTRIBUTE_NORETURN; /* if gcc >= 2.6, we can give a function name, too */ #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6) @@ -558,7 +595,13 @@ extern void _bfd_abort PARAMS ((const char *, int, const char *)) #undef abort #define abort() _bfd_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__) -FILE * bfd_cache_lookup_worker PARAMS ((bfd *)); +/* Manipulate a system FILE but using BFD's "file_ptr", rather than + the system "off_t" or "off64_t", as the offset. */ +extern file_ptr real_ftell (FILE *file); +extern int real_fseek (FILE *file, file_ptr offset, int whence); + +FILE * bfd_cache_lookup_worker + (bfd *); extern bfd *bfd_last_cache; @@ -567,6 +610,9 @@ extern bfd *bfd_last_cache; extern const bfd_target * const *bfd_target_vector; extern const bfd_target *bfd_default_vector[]; +/* List of associated target vectors. */ +extern const bfd_target * const *bfd_associated_vector; + /* Functions shared by the ECOFF and MIPS ELF backends, which have no other common header files. */ @@ -574,22 +620,28 @@ extern const bfd_target *bfd_default_vector[]; struct ecoff_find_line; #endif -extern boolean _bfd_ecoff_locate_line - PARAMS ((bfd *, asection *, bfd_vma, struct ecoff_debug_info * const, - const struct ecoff_debug_swap * const, struct ecoff_find_line *, - const char **, const char **, unsigned int *)); -extern boolean _bfd_ecoff_get_accumulated_pdr PARAMS ((PTR, bfd_byte *)); -extern boolean _bfd_ecoff_get_accumulated_sym PARAMS ((PTR, bfd_byte *)); -extern boolean _bfd_ecoff_get_accumulated_ss PARAMS ((PTR, bfd_byte *)); - -extern bfd_vma _bfd_get_gp_value PARAMS ((bfd *)); -extern void _bfd_set_gp_value PARAMS ((bfd *, bfd_vma)); +extern bfd_boolean _bfd_ecoff_locate_line + (bfd *, asection *, bfd_vma, struct ecoff_debug_info * const, + const struct ecoff_debug_swap * const, struct ecoff_find_line *, + const char **, const char **, unsigned int *); +extern bfd_boolean _bfd_ecoff_get_accumulated_pdr + (void *, bfd_byte *); +extern bfd_boolean _bfd_ecoff_get_accumulated_sym + (void *, bfd_byte *); +extern bfd_boolean _bfd_ecoff_get_accumulated_ss + (void *, bfd_byte *); + +extern bfd_vma _bfd_get_gp_value + (bfd *); +extern void _bfd_set_gp_value + (bfd *, bfd_vma); /* Function shared by the COFF and ELF SH backends, which have no other common header files. */ -extern boolean _bfd_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 *)); - +#ifndef _bfd_sh_align_load_span +extern bfd_boolean _bfd_sh_align_load_span + (bfd *, asection *, bfd_byte *, + bfd_boolean (*) (bfd *, asection *, void *, bfd_byte *, bfd_vma), + void *, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, bfd_boolean *); +#endif diff --git a/contrib/binutils/bfd/libbfd.c b/contrib/binutils/bfd/libbfd.c index f21abbc..be090e9 100644 --- a/contrib/binutils/bfd/libbfd.c +++ b/contrib/binutils/bfd/libbfd.c @@ -1,6 +1,6 @@ /* Assorted BFD support routines, only used internally. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Cygnus Support. @@ -28,8 +28,6 @@ #define getpagesize() 2048 #endif -static size_t real_read PARAMS ((PTR, size_t, size_t, FILE *)); - /* SECTION Internal functions @@ -43,52 +41,46 @@ DESCRIPTION /* A routine which is used in target vectors for unsupported operations. */ -boolean -bfd_false (ignore) - bfd *ignore ATTRIBUTE_UNUSED; +bfd_boolean +bfd_false (bfd *ignore ATTRIBUTE_UNUSED) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } /* A routine which is used in target vectors for supported operations which do not actually do anything. */ -boolean -bfd_true (ignore) - bfd *ignore ATTRIBUTE_UNUSED; +bfd_boolean +bfd_true (bfd *ignore ATTRIBUTE_UNUSED) { - return true; + return TRUE; } /* A routine which is used in target vectors for unsupported operations which return a pointer value. */ -PTR -bfd_nullvoidptr (ignore) - bfd *ignore ATTRIBUTE_UNUSED; +void * +bfd_nullvoidptr (bfd *ignore ATTRIBUTE_UNUSED) { bfd_set_error (bfd_error_invalid_operation); return NULL; } int -bfd_0 (ignore) - bfd *ignore ATTRIBUTE_UNUSED; +bfd_0 (bfd *ignore ATTRIBUTE_UNUSED) { return 0; } unsigned int -bfd_0u (ignore) - bfd *ignore ATTRIBUTE_UNUSED; +bfd_0u (bfd *ignore ATTRIBUTE_UNUSED) { return 0; } long -bfd_0l (ignore) - bfd *ignore ATTRIBUTE_UNUSED; +bfd_0l (bfd *ignore ATTRIBUTE_UNUSED) { return 0; } @@ -97,53 +89,48 @@ bfd_0l (ignore) operations which return -1 on error. */ long -_bfd_n1 (ignore_abfd) - bfd *ignore_abfd ATTRIBUTE_UNUSED; +_bfd_n1 (bfd *ignore_abfd ATTRIBUTE_UNUSED) { bfd_set_error (bfd_error_invalid_operation); return -1; } void -bfd_void (ignore) - bfd *ignore ATTRIBUTE_UNUSED; +bfd_void (bfd *ignore ATTRIBUTE_UNUSED) { } -boolean -_bfd_nocore_core_file_matches_executable_p (ignore_core_bfd, ignore_exec_bfd) - bfd *ignore_core_bfd ATTRIBUTE_UNUSED; - bfd *ignore_exec_bfd ATTRIBUTE_UNUSED; +bfd_boolean +_bfd_nocore_core_file_matches_executable_p + (bfd *ignore_core_bfd ATTRIBUTE_UNUSED, + bfd *ignore_exec_bfd ATTRIBUTE_UNUSED) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } /* Routine to handle core_file_failing_command entry point for targets without core file support. */ char * -_bfd_nocore_core_file_failing_command (ignore_abfd) - bfd *ignore_abfd ATTRIBUTE_UNUSED; +_bfd_nocore_core_file_failing_command (bfd *ignore_abfd ATTRIBUTE_UNUSED) { bfd_set_error (bfd_error_invalid_operation); - return (char *)NULL; + return NULL; } /* Routine to handle core_file_failing_signal entry point for targets without core file support. */ int -_bfd_nocore_core_file_failing_signal (ignore_abfd) - bfd *ignore_abfd ATTRIBUTE_UNUSED; +_bfd_nocore_core_file_failing_signal (bfd *ignore_abfd ATTRIBUTE_UNUSED) { bfd_set_error (bfd_error_invalid_operation); return 0; } const bfd_target * -_bfd_dummy_target (ignore_abfd) - bfd *ignore_abfd ATTRIBUTE_UNUSED; +_bfd_dummy_target (bfd *ignore_abfd ATTRIBUTE_UNUSED) { bfd_set_error (bfd_error_wrong_format); return 0; @@ -151,11 +138,10 @@ _bfd_dummy_target (ignore_abfd) /* Allocate memory using malloc. */ -PTR -bfd_malloc (size) - bfd_size_type size; +void * +bfd_malloc (bfd_size_type size) { - PTR ptr; + void *ptr; if (size != (size_t) size) { @@ -163,7 +149,7 @@ bfd_malloc (size) return NULL; } - ptr = (PTR) malloc ((size_t) size); + ptr = malloc ((size_t) size); if (ptr == NULL && (size_t) size != 0) bfd_set_error (bfd_error_no_memory); @@ -172,12 +158,10 @@ bfd_malloc (size) /* Reallocate memory using realloc. */ -PTR -bfd_realloc (ptr, size) - PTR ptr; - bfd_size_type size; +void * +bfd_realloc (void *ptr, bfd_size_type size) { - PTR ret; + void *ret; if (size != (size_t) size) { @@ -186,9 +170,9 @@ bfd_realloc (ptr, size) } if (ptr == NULL) - ret = (PTR) malloc ((size_t) size); + ret = malloc ((size_t) size); else - ret = (PTR) realloc (ptr, (size_t) size); + ret = realloc (ptr, (size_t) size); if (ret == NULL && (size_t) size != 0) bfd_set_error (bfd_error_no_memory); @@ -198,11 +182,10 @@ bfd_realloc (ptr, size) /* Allocate memory using malloc and clear it. */ -PTR -bfd_zmalloc (size) - bfd_size_type size; +void * +bfd_zmalloc (bfd_size_type size) { - PTR ptr; + void *ptr; if (size != (size_t) size) { @@ -210,7 +193,7 @@ bfd_zmalloc (size) return NULL; } - ptr = (PTR) malloc ((size_t) size); + ptr = malloc ((size_t) size); if ((size_t) size != 0) { @@ -222,378 +205,12 @@ bfd_zmalloc (size) return ptr; } - -/* Some IO code */ - -/* Note that archive entries don't have streams; they share their parent's. - This allows someone to play with the iostream behind BFD's back. - - Also, note that the origin pointer points to the beginning of a file's - contents (0 for non-archive elements). For archive entries this is the - first octet in the file, NOT the beginning of the archive header. */ - -static size_t -real_read (where, a, b, file) - PTR where; - size_t a; - size_t b; - FILE *file; -{ - /* FIXME - this looks like an optimization, but it's really to cover - up for a feature of some OSs (not solaris - sigh) that - ld/pe-dll.c takes advantage of (apparently) when it creates BFDs - internally and tries to link against them. BFD seems to be smart - enough to realize there are no symbol records in the "file" that - doesn't exist but attempts to read them anyway. On Solaris, - attempting to read zero bytes from a NULL file results in a core - dump, but on other platforms it just returns zero bytes read. - This makes it to something reasonable. - DJ */ - if (a == 0 || b == 0) - return 0; - - -#if defined (__VAX) && defined (VMS) - /* Apparently fread on Vax VMS does not keep the record length - information. */ - return read (fileno (file), where, a * b); -#else - return fread (where, a, b, file); -#endif -} - -/* Return value is amount read. */ - -bfd_size_type -bfd_bread (ptr, size, abfd) - PTR ptr; - bfd_size_type size; - bfd *abfd; -{ - size_t nread; - - if ((abfd->flags & BFD_IN_MEMORY) != 0) - { - struct bfd_in_memory *bim; - bfd_size_type get; - - bim = (struct bfd_in_memory *) abfd->iostream; - get = size; - if (abfd->where + get > bim->size) - { - if (bim->size < (bfd_size_type) abfd->where) - get = 0; - else - get = bim->size - abfd->where; - bfd_set_error (bfd_error_file_truncated); - } - memcpy (ptr, bim->buffer + abfd->where, (size_t) get); - abfd->where += get; - return get; - } - - nread = real_read (ptr, 1, (size_t) size, bfd_cache_lookup (abfd)); - if (nread != (size_t) -1) - abfd->where += nread; - - /* Set bfd_error if we did not read as much data as we expected. - - If the read failed due to an error set the bfd_error_system_call, - else set bfd_error_file_truncated. - - A BFD backend may wish to override bfd_error_file_truncated to - provide something more useful (eg. no_symbols or wrong_format). */ - if (nread != size) - { - if (ferror (bfd_cache_lookup (abfd))) - bfd_set_error (bfd_error_system_call); - else - bfd_set_error (bfd_error_file_truncated); - } - - return nread; -} - -/* The window support stuff should probably be broken out into - another file.... */ -/* The idea behind the next and refcount fields is that one mapped - region can suffice for multiple read-only windows or multiple - non-overlapping read-write windows. It's not implemented yet - though. */ -struct _bfd_window_internal { - struct _bfd_window_internal *next; - PTR data; - bfd_size_type size; - int refcount : 31; /* should be enough... */ - unsigned mapped : 1; /* 1 = mmap, 0 = malloc */ -}; - -void -bfd_init_window (windowp) - bfd_window *windowp; -{ - windowp->data = 0; - windowp->i = 0; - windowp->size = 0; -} - -/* Currently, if USE_MMAP is undefined, none if the window stuff is - used. Okay, so it's mis-named. At least the command-line option - "--without-mmap" is more obvious than "--without-windows" or some - such. */ -#ifdef USE_MMAP - -#undef HAVE_MPROTECT /* code's not tested yet */ - -#if HAVE_MMAP || HAVE_MPROTECT || HAVE_MADVISE -#include -#endif - -#ifndef MAP_FILE -#define MAP_FILE 0 -#endif - -static int debug_windows; - -void -bfd_free_window (windowp) - bfd_window *windowp; -{ - bfd_window_internal *i = windowp->i; - windowp->i = 0; - windowp->data = 0; - if (i == 0) - return; - i->refcount--; - if (debug_windows) - fprintf (stderr, "freeing window @%p<%p,%lx,%p>\n", - windowp, windowp->data, windowp->size, windowp->i); - if (i->refcount != 0) - return; - - if (i->mapped) - { -#ifdef HAVE_MMAP - munmap (i->data, i->size); - goto no_free; -#else - abort (); -#endif - } -#ifdef HAVE_MPROTECT - mprotect (i->data, i->size, PROT_READ | PROT_WRITE); -#endif - free (i->data); -#ifdef HAVE_MMAP - no_free: -#endif - i->data = 0; - /* There should be no more references to i at this point. */ - free (i); -} - -static int ok_to_map = 1; - -boolean -bfd_get_file_window (abfd, offset, size, windowp, writable) - bfd *abfd; - file_ptr offset; - bfd_size_type size; - bfd_window *windowp; - boolean writable; -{ - static size_t pagesize; - bfd_window_internal *i = windowp->i; - bfd_size_type size_to_alloc = size; - - if (debug_windows) - fprintf (stderr, "bfd_get_file_window (%p, %6ld, %6ld, %p<%p,%lx,%p>, %d)", - abfd, (long) offset, (long) size, - windowp, windowp->data, (unsigned long) windowp->size, - windowp->i, writable); - - /* Make sure we know the page size, so we can be friendly to mmap. */ - if (pagesize == 0) - pagesize = getpagesize (); - if (pagesize == 0) - abort (); - - if (i == 0) - { - i = ((bfd_window_internal *) - bfd_zmalloc ((bfd_size_type) sizeof (bfd_window_internal))); - windowp->i = i; - if (i == 0) - return false; - i->data = 0; - } -#ifdef HAVE_MMAP - if (ok_to_map - && (i->data == 0 || i->mapped == 1) - && (abfd->flags & BFD_IN_MEMORY) == 0) - { - file_ptr file_offset, offset2; - size_t real_size; - int fd; - FILE *f; - - /* Find the real file and the real offset into it. */ - while (abfd->my_archive != NULL) - { - offset += abfd->origin; - abfd = abfd->my_archive; - } - f = bfd_cache_lookup (abfd); - fd = fileno (f); - - /* Compute offsets and size for mmap and for the user's data. */ - offset2 = offset % pagesize; - if (offset2 < 0) - abort (); - file_offset = offset - offset2; - real_size = offset + size - file_offset; - real_size = real_size + pagesize - 1; - real_size -= real_size % pagesize; - - /* If we're re-using a memory region, make sure it's big enough. */ - if (i->data && i->size < size) - { - munmap (i->data, i->size); - i->data = 0; - } - i->data = mmap (i->data, real_size, - writable ? PROT_WRITE | PROT_READ : PROT_READ, - (writable - ? MAP_FILE | MAP_PRIVATE - : MAP_FILE | MAP_SHARED), - fd, file_offset); - if (i->data == (PTR) -1) - { - /* An error happened. Report it, or try using malloc, or - something. */ - bfd_set_error (bfd_error_system_call); - i->data = 0; - windowp->data = 0; - if (debug_windows) - fprintf (stderr, "\t\tmmap failed!\n"); - return false; - } - if (debug_windows) - fprintf (stderr, "\n\tmapped %ld at %p, offset is %ld\n", - (long) real_size, i->data, (long) offset2); - i->size = real_size; - windowp->data = (PTR) ((bfd_byte *) i->data + offset2); - windowp->size = size; - i->mapped = 1; - return true; - } - else if (debug_windows) - { - if (ok_to_map) - fprintf (stderr, _("not mapping: data=%lx mapped=%d\n"), - (unsigned long) i->data, (int) i->mapped); - else - fprintf (stderr, _("not mapping: env var not set\n")); - } -#else - ok_to_map = 0; -#endif - -#ifdef HAVE_MPROTECT - if (!writable) - { - size_to_alloc += pagesize - 1; - size_to_alloc -= size_to_alloc % pagesize; - } -#endif - if (debug_windows) - fprintf (stderr, "\n\t%s(%6ld)", - i->data ? "realloc" : " malloc", (long) size_to_alloc); - i->data = (PTR) bfd_realloc (i->data, size_to_alloc); - if (debug_windows) - fprintf (stderr, "\t-> %p\n", i->data); - i->refcount = 1; - if (i->data == NULL) - { - if (size_to_alloc == 0) - return true; - return false; - } - if (bfd_seek (abfd, offset, SEEK_SET) != 0) - return false; - i->size = bfd_bread (i->data, size, abfd); - if (i->size != size) - return false; - i->mapped = 0; -#ifdef HAVE_MPROTECT - if (!writable) - { - if (debug_windows) - fprintf (stderr, "\tmprotect (%p, %ld, PROT_READ)\n", i->data, - (long) i->size); - mprotect (i->data, i->size, PROT_READ); - } -#endif - windowp->data = i->data; - windowp->size = i->size; - return true; -} - -#endif /* USE_MMAP */ - -bfd_size_type -bfd_bwrite (ptr, size, abfd) - const PTR ptr; - bfd_size_type size; - bfd *abfd; -{ - size_t nwrote; - - if ((abfd->flags & BFD_IN_MEMORY) != 0) - { - struct bfd_in_memory *bim = (struct bfd_in_memory *) (abfd->iostream); - size = (size_t) size; - if (abfd->where + size > bim->size) - { - bfd_size_type newsize, oldsize; - - oldsize = (bim->size + 127) & ~(bfd_size_type) 127; - bim->size = abfd->where + size; - /* Round up to cut down on memory fragmentation */ - newsize = (bim->size + 127) & ~(bfd_size_type) 127; - if (newsize > oldsize) - { - bim->buffer = (bfd_byte *) bfd_realloc (bim->buffer, newsize); - if (bim->buffer == 0) - { - bim->size = 0; - return 0; - } - } - } - memcpy (bim->buffer + abfd->where, ptr, (size_t) size); - abfd->where += size; - return size; - } - - nwrote = fwrite (ptr, 1, (size_t) size, bfd_cache_lookup (abfd)); - if (nwrote != (size_t) -1) - abfd->where += nwrote; - if (nwrote != size) - { -#ifdef ENOSPC - errno = ENOSPC; -#endif - bfd_set_error (bfd_error_system_call); - } - return nwrote; -} - /* INTERNAL_FUNCTION bfd_write_bigendian_4byte_int SYNOPSIS - boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int); + bfd_boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int); DESCRIPTION Write a 4 byte integer @var{i} to the output BFD @var{abfd}, in big @@ -601,196 +218,14 @@ DESCRIPTION archives. */ -boolean -bfd_write_bigendian_4byte_int (abfd, i) - bfd *abfd; - unsigned int i; +bfd_boolean +bfd_write_bigendian_4byte_int (bfd *abfd, unsigned int i) { bfd_byte buffer[4]; bfd_putb32 ((bfd_vma) i, buffer); - return (boolean) (bfd_bwrite ((PTR) buffer, (bfd_size_type) 4, abfd) == 4); -} - -bfd_vma -bfd_tell (abfd) - bfd *abfd; -{ - file_ptr ptr; - - if ((abfd->flags & BFD_IN_MEMORY) != 0) - return abfd->where; - - ptr = ftell (bfd_cache_lookup (abfd)); - - if (abfd->my_archive) - ptr -= abfd->origin; - abfd->where = ptr; - return ptr; -} - -int -bfd_flush (abfd) - bfd *abfd; -{ - if ((abfd->flags & BFD_IN_MEMORY) != 0) - return 0; - return fflush (bfd_cache_lookup(abfd)); -} - -/* Returns 0 for success, negative value for failure (in which case - bfd_get_error can retrieve the error code). */ -int -bfd_stat (abfd, statbuf) - bfd *abfd; - struct stat *statbuf; -{ - FILE *f; - int result; - - if ((abfd->flags & BFD_IN_MEMORY) != 0) - abort (); - - f = bfd_cache_lookup (abfd); - if (f == NULL) - { - bfd_set_error (bfd_error_system_call); - return -1; - } - result = fstat (fileno (f), statbuf); - if (result < 0) - bfd_set_error (bfd_error_system_call); - return result; + return bfd_bwrite (buffer, (bfd_size_type) 4, abfd) == 4; } -/* Returns 0 for success, nonzero for failure (in which case bfd_get_error - can retrieve the error code). */ - -int -bfd_seek (abfd, position, direction) - bfd *abfd; - file_ptr position; - int direction; -{ - int result; - FILE *f; - long file_position; - /* For the time being, a BFD may not seek to it's end. The problem - is that we don't easily have a way to recognize the end of an - element in an archive. */ - - BFD_ASSERT (direction == SEEK_SET || direction == SEEK_CUR); - - if (direction == SEEK_CUR && position == 0) - return 0; - - if ((abfd->flags & BFD_IN_MEMORY) != 0) - { - struct bfd_in_memory *bim; - - bim = (struct bfd_in_memory *) abfd->iostream; - - if (direction == SEEK_SET) - abfd->where = position; - else - abfd->where += position; - - if (abfd->where > bim->size) - { - if ((abfd->direction == write_direction) || - (abfd->direction == both_direction)) - { - bfd_size_type newsize, oldsize; - oldsize = (bim->size + 127) & ~(bfd_size_type) 127; - bim->size = abfd->where; - /* Round up to cut down on memory fragmentation */ - newsize = (bim->size + 127) & ~(bfd_size_type) 127; - if (newsize > oldsize) - { - bim->buffer = (bfd_byte *) bfd_realloc (bim->buffer, newsize); - if (bim->buffer == 0) - { - bim->size = 0; - return -1; - } - } - } - else - { - abfd->where = bim->size; - bfd_set_error (bfd_error_file_truncated); - return -1; - } - } - return 0; - } - - if (abfd->format != bfd_archive && abfd->my_archive == 0) - { -#if 0 - /* Explanation for this code: I'm only about 95+% sure that the above - conditions are sufficient and that all i/o calls are properly - adjusting the `where' field. So this is sort of an `assert' - that the `where' field is correct. If we can go a while without - tripping the abort, we can probably safely disable this code, - so that the real optimizations happen. */ - file_ptr where_am_i_now; - where_am_i_now = ftell (bfd_cache_lookup (abfd)); - if (abfd->my_archive) - where_am_i_now -= abfd->origin; - if (where_am_i_now != abfd->where) - abort (); -#endif - if (direction == SEEK_SET && (bfd_vma) position == abfd->where) - return 0; - } - else - { - /* We need something smarter to optimize access to archives. - Currently, anything inside an archive is read via the file - handle for the archive. Which means that a bfd_seek on one - component affects the `current position' in the archive, as - well as in any other component. - - It might be sufficient to put a spike through the cache - abstraction, and look to the archive for the file position, - but I think we should try for something cleaner. - - In the meantime, no optimization for archives. */ - } - - f = bfd_cache_lookup (abfd); - file_position = position; - if (direction == SEEK_SET && abfd->my_archive != NULL) - file_position += abfd->origin; - - result = fseek (f, file_position, direction); - if (result != 0) - { - int hold_errno = errno; - - /* Force redetermination of `where' field. */ - bfd_tell (abfd); - - /* An EINVAL error probably means that the file offset was - absurd. */ - if (hold_errno == EINVAL) - bfd_set_error (bfd_error_file_truncated); - else - { - bfd_set_error (bfd_error_system_call); - errno = hold_errno; - } - } - else - { - /* Adjust `where' field. */ - if (direction == SEEK_SET) - abfd->where = position; - else - abfd->where += position; - } - return result; -} /** The do-it-yourself (byte) sex-change kit */ @@ -831,54 +266,54 @@ DESCRIPTION .{* 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)) = (val) & 0xff)) .#define bfd_put_signed_8 \ -. bfd_put_8 +. bfd_put_8 .#define bfd_get_8(abfd, ptr) \ -. (*(unsigned char *) (ptr) & 0xff) +. (*(unsigned char *) (ptr) & 0xff) .#define bfd_get_signed_8(abfd, ptr) \ -. (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) +. (((*(unsigned char *) (ptr) & 0xff) ^ 0x80) - 0x80) . .#define bfd_put_16(abfd, val, ptr) \ -. BFD_SEND(abfd, bfd_putx16, ((val),(ptr))) +. BFD_SEND (abfd, bfd_putx16, ((val),(ptr))) .#define bfd_put_signed_16 \ -. bfd_put_16 +. bfd_put_16 .#define bfd_get_16(abfd, ptr) \ -. BFD_SEND(abfd, bfd_getx16, (ptr)) +. BFD_SEND (abfd, bfd_getx16, (ptr)) .#define bfd_get_signed_16(abfd, ptr) \ -. BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) +. BFD_SEND (abfd, bfd_getx_signed_16, (ptr)) . .#define bfd_put_32(abfd, val, ptr) \ -. BFD_SEND(abfd, bfd_putx32, ((val),(ptr))) +. BFD_SEND (abfd, bfd_putx32, ((val),(ptr))) .#define bfd_put_signed_32 \ -. bfd_put_32 +. bfd_put_32 .#define bfd_get_32(abfd, ptr) \ -. BFD_SEND(abfd, bfd_getx32, (ptr)) +. BFD_SEND (abfd, bfd_getx32, (ptr)) .#define bfd_get_signed_32(abfd, ptr) \ -. BFD_SEND(abfd, bfd_getx_signed_32, (ptr)) +. BFD_SEND (abfd, bfd_getx_signed_32, (ptr)) . .#define bfd_put_64(abfd, val, ptr) \ -. BFD_SEND(abfd, bfd_putx64, ((val), (ptr))) +. BFD_SEND (abfd, bfd_putx64, ((val), (ptr))) .#define bfd_put_signed_64 \ -. bfd_put_64 +. bfd_put_64 .#define bfd_get_64(abfd, ptr) \ -. BFD_SEND(abfd, bfd_getx64, (ptr)) +. BFD_SEND (abfd, bfd_getx64, (ptr)) .#define bfd_get_signed_64(abfd, ptr) \ -. BFD_SEND(abfd, bfd_getx_signed_64, (ptr)) +. BFD_SEND (abfd, bfd_getx_signed_64, (ptr)) . -.#define bfd_get(bits, abfd, ptr) \ -. ( (bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ -. : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ -. : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ -. : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ -. : (abort (), (bfd_vma) - 1)) +.#define bfd_get(bits, abfd, ptr) \ +. ((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) \ +. : (bits) == 16 ? bfd_get_16 (abfd, ptr) \ +. : (bits) == 32 ? bfd_get_32 (abfd, ptr) \ +. : (bits) == 64 ? bfd_get_64 (abfd, ptr) \ +. : (abort (), (bfd_vma) - 1)) . -.#define bfd_put(bits, abfd, val, ptr) \ -. ( (bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ -. : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ -. : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ -. : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ -. : (abort (), (void) 0)) +.#define bfd_put(bits, abfd, val, ptr) \ +. ((bits) == 8 ? bfd_put_8 (abfd, val, ptr) \ +. : (bits) == 16 ? bfd_put_16 (abfd, val, ptr) \ +. : (bits) == 32 ? bfd_put_32 (abfd, val, ptr) \ +. : (bits) == 64 ? bfd_put_64 (abfd, val, ptr) \ +. : (abort (), (void) 0)) . */ @@ -932,139 +367,108 @@ DESCRIPTION .#define bfd_h_get_signed_64(abfd, ptr) \ . BFD_SEND (abfd, bfd_h_getx_signed_64, (ptr)) . -.{* Refinements on the above, which should eventually go away. Save -. cluttering the source with (bfd_vma) and (bfd_byte *) casts. *} -. -.#define H_PUT_64(abfd, val, where) \ -. bfd_h_put_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) -. -.#define H_PUT_32(abfd, val, where) \ -. bfd_h_put_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) -. -.#define H_PUT_16(abfd, val, where) \ -. bfd_h_put_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) -. -.#define H_PUT_8 bfd_h_put_8 -. -.#define H_PUT_S64(abfd, val, where) \ -. bfd_h_put_signed_64 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) +.{* Aliases for the above, which should eventually go away. *} . -.#define H_PUT_S32(abfd, val, where) \ -. bfd_h_put_signed_32 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) -. -.#define H_PUT_S16(abfd, val, where) \ -. bfd_h_put_signed_16 ((abfd), (bfd_vma) (val), (bfd_byte *) (where)) -. -.#define H_PUT_S8 bfd_h_put_signed_8 -. -.#define H_GET_64(abfd, where) \ -. bfd_h_get_64 ((abfd), (bfd_byte *) (where)) -. -.#define H_GET_32(abfd, where) \ -. bfd_h_get_32 ((abfd), (bfd_byte *) (where)) -. -.#define H_GET_16(abfd, where) \ -. bfd_h_get_16 ((abfd), (bfd_byte *) (where)) -. -.#define H_GET_8 bfd_h_get_8 -. -.#define H_GET_S64(abfd, where) \ -. bfd_h_get_signed_64 ((abfd), (bfd_byte *) (where)) -. -.#define H_GET_S32(abfd, where) \ -. bfd_h_get_signed_32 ((abfd), (bfd_byte *) (where)) -. -.#define H_GET_S16(abfd, where) \ -. bfd_h_get_signed_16 ((abfd), (bfd_byte *) (where)) -. -.#define H_GET_S8 bfd_h_get_signed_8 +.#define H_PUT_64 bfd_h_put_64 +.#define H_PUT_32 bfd_h_put_32 +.#define H_PUT_16 bfd_h_put_16 +.#define H_PUT_8 bfd_h_put_8 +.#define H_PUT_S64 bfd_h_put_signed_64 +.#define H_PUT_S32 bfd_h_put_signed_32 +.#define H_PUT_S16 bfd_h_put_signed_16 +.#define H_PUT_S8 bfd_h_put_signed_8 +.#define H_GET_64 bfd_h_get_64 +.#define H_GET_32 bfd_h_get_32 +.#define H_GET_16 bfd_h_get_16 +.#define H_GET_8 bfd_h_get_8 +.#define H_GET_S64 bfd_h_get_signed_64 +.#define H_GET_S32 bfd_h_get_signed_32 +.#define H_GET_S16 bfd_h_get_signed_16 +.#define H_GET_S8 bfd_h_get_signed_8 . .*/ /* Sign extension to bfd_signed_vma. */ #define COERCE16(x) (((bfd_signed_vma) (x) ^ 0x8000) - 0x8000) -#define COERCE32(x) \ - ((bfd_signed_vma) (long) (((unsigned long) (x) ^ 0x80000000) - 0x80000000)) -#define EIGHT_GAZILLION (((BFD_HOST_64_BIT)0x80000000) << 32) +#define COERCE32(x) (((bfd_signed_vma) (x) ^ 0x80000000) - 0x80000000) +#define EIGHT_GAZILLION ((bfd_int64_t) 1 << 63) #define COERCE64(x) \ - (((bfd_signed_vma) (x) ^ EIGHT_GAZILLION) - EIGHT_GAZILLION) + (((bfd_int64_t) (x) ^ EIGHT_GAZILLION) - EIGHT_GAZILLION) bfd_vma -bfd_getb16 (addr) - register const bfd_byte *addr; +bfd_getb16 (const void *p) { + const bfd_byte *addr = p; return (addr[0] << 8) | addr[1]; } bfd_vma -bfd_getl16 (addr) - register const bfd_byte *addr; +bfd_getl16 (const void *p) { + const bfd_byte *addr = p; return (addr[1] << 8) | addr[0]; } bfd_signed_vma -bfd_getb_signed_16 (addr) - register const bfd_byte *addr; +bfd_getb_signed_16 (const void *p) { - return COERCE16((addr[0] << 8) | addr[1]); + const bfd_byte *addr = p; + return COERCE16 ((addr[0] << 8) | addr[1]); } bfd_signed_vma -bfd_getl_signed_16 (addr) - register const bfd_byte *addr; +bfd_getl_signed_16 (const void *p) { - return COERCE16((addr[1] << 8) | addr[0]); + const bfd_byte *addr = p; + return COERCE16 ((addr[1] << 8) | addr[0]); } void -bfd_putb16 (data, addr) - bfd_vma data; - register bfd_byte *addr; +bfd_putb16 (bfd_vma data, void *p) { - addr[0] = (bfd_byte) (data >> 8); - addr[1] = (bfd_byte) data; + bfd_byte *addr = p; + addr[0] = (data >> 8) & 0xff; + addr[1] = data & 0xff; } void -bfd_putl16 (data, addr) - bfd_vma data; - register bfd_byte *addr; +bfd_putl16 (bfd_vma data, void *p) { - addr[0] = (bfd_byte) data; - addr[1] = (bfd_byte) (data >> 8); + bfd_byte *addr = p; + addr[0] = data & 0xff; + addr[1] = (data >> 8) & 0xff; } bfd_vma -bfd_getb32 (addr) - register const bfd_byte *addr; +bfd_getb32 (const void *p) { + const bfd_byte *addr = p; unsigned long v; v = (unsigned long) addr[0] << 24; v |= (unsigned long) addr[1] << 16; v |= (unsigned long) addr[2] << 8; v |= (unsigned long) addr[3]; - return (bfd_vma) v; + return v; } bfd_vma -bfd_getl32 (addr) - register const bfd_byte *addr; +bfd_getl32 (const void *p) { + const bfd_byte *addr = p; unsigned long v; v = (unsigned long) addr[0]; v |= (unsigned long) addr[1] << 8; v |= (unsigned long) addr[2] << 16; v |= (unsigned long) addr[3] << 24; - return (bfd_vma) v; + return v; } bfd_signed_vma -bfd_getb_signed_32 (addr) - register const bfd_byte *addr; +bfd_getb_signed_32 (const void *p) { + const bfd_byte *addr = p; unsigned long v; v = (unsigned long) addr[0] << 24; @@ -1075,9 +479,9 @@ bfd_getb_signed_32 (addr) } bfd_signed_vma -bfd_getl_signed_32 (addr) - register const bfd_byte *addr; +bfd_getl_signed_32 (const void *p) { + const bfd_byte *addr = p; unsigned long v; v = (unsigned long) addr[0]; @@ -1087,47 +491,46 @@ bfd_getl_signed_32 (addr) return COERCE32 (v); } -bfd_vma -bfd_getb64 (addr) - register const bfd_byte *addr ATTRIBUTE_UNUSED; +bfd_uint64_t +bfd_getb64 (const void *p ATTRIBUTE_UNUSED) { -#ifdef BFD64 - bfd_vma low, high; - - high= ((((((((addr[0]) << 8) | - addr[1]) << 8) | - addr[2]) << 8) | - addr[3]) ); +#ifdef BFD_HOST_64_BIT + const bfd_byte *addr = p; + bfd_uint64_t v; - low = (((((((((bfd_vma)addr[4]) << 8) | - addr[5]) << 8) | - addr[6]) << 8) | - addr[7])); + v = addr[0]; v <<= 8; + v |= addr[1]; v <<= 8; + v |= addr[2]; v <<= 8; + v |= addr[3]; v <<= 8; + v |= addr[4]; v <<= 8; + v |= addr[5]; v <<= 8; + v |= addr[6]; v <<= 8; + v |= addr[7]; - return high << 32 | low; + return v; #else BFD_FAIL(); return 0; #endif } -bfd_vma -bfd_getl64 (addr) - register const bfd_byte *addr ATTRIBUTE_UNUSED; +bfd_uint64_t +bfd_getl64 (const void *p ATTRIBUTE_UNUSED) { -#ifdef BFD64 - bfd_vma low, high; - high= (((((((addr[7] << 8) | - addr[6]) << 8) | - addr[5]) << 8) | - addr[4])); - - low = ((((((((bfd_vma)addr[3] << 8) | - addr[2]) << 8) | - addr[1]) << 8) | - addr[0]) ); - - return high << 32 | low; +#ifdef BFD_HOST_64_BIT + const bfd_byte *addr = p; + bfd_uint64_t v; + + v = addr[7]; v <<= 8; + v |= addr[6]; v <<= 8; + v |= addr[5]; v <<= 8; + v |= addr[4]; v <<= 8; + v |= addr[3]; v <<= 8; + v |= addr[2]; v <<= 8; + v |= addr[1]; v <<= 8; + v |= addr[0]; + + return v; #else BFD_FAIL(); return 0; @@ -1135,47 +538,46 @@ bfd_getl64 (addr) } -bfd_signed_vma -bfd_getb_signed_64 (addr) - register const bfd_byte *addr ATTRIBUTE_UNUSED; +bfd_int64_t +bfd_getb_signed_64 (const void *p ATTRIBUTE_UNUSED) { -#ifdef BFD64 - bfd_vma low, high; - - high= ((((((((addr[0]) << 8) | - addr[1]) << 8) | - addr[2]) << 8) | - addr[3]) ); +#ifdef BFD_HOST_64_BIT + const bfd_byte *addr = p; + bfd_uint64_t v; - low = (((((((((bfd_vma)addr[4]) << 8) | - addr[5]) << 8) | - addr[6]) << 8) | - addr[7])); + v = addr[0]; v <<= 8; + v |= addr[1]; v <<= 8; + v |= addr[2]; v <<= 8; + v |= addr[3]; v <<= 8; + v |= addr[4]; v <<= 8; + v |= addr[5]; v <<= 8; + v |= addr[6]; v <<= 8; + v |= addr[7]; - return COERCE64(high << 32 | low); + return COERCE64 (v); #else BFD_FAIL(); return 0; #endif } -bfd_signed_vma -bfd_getl_signed_64 (addr) - register const bfd_byte *addr ATTRIBUTE_UNUSED; +bfd_int64_t +bfd_getl_signed_64 (const void *p ATTRIBUTE_UNUSED) { -#ifdef BFD64 - bfd_vma low, high; - high= (((((((addr[7] << 8) | - addr[6]) << 8) | - addr[5]) << 8) | - addr[4])); - - low = ((((((((bfd_vma)addr[3] << 8) | - addr[2]) << 8) | - addr[1]) << 8) | - addr[0]) ); - - return COERCE64(high << 32 | low); +#ifdef BFD_HOST_64_BIT + const bfd_byte *addr = p; + bfd_uint64_t v; + + v = addr[7]; v <<= 8; + v |= addr[6]; v <<= 8; + v |= addr[5]; v <<= 8; + v |= addr[4]; v <<= 8; + v |= addr[3]; v <<= 8; + v |= addr[2]; v <<= 8; + v |= addr[1]; v <<= 8; + v |= addr[0]; + + return COERCE64 (v); #else BFD_FAIL(); return 0; @@ -1183,72 +585,65 @@ bfd_getl_signed_64 (addr) } void -bfd_putb32 (data, addr) - bfd_vma data; - register bfd_byte *addr; +bfd_putb32 (bfd_vma data, void *p) { - addr[0] = (bfd_byte) (data >> 24); - addr[1] = (bfd_byte) (data >> 16); - addr[2] = (bfd_byte) (data >> 8); - addr[3] = (bfd_byte) data; + bfd_byte *addr = p; + addr[0] = (data >> 24) & 0xff; + addr[1] = (data >> 16) & 0xff; + addr[2] = (data >> 8) & 0xff; + addr[3] = data & 0xff; } void -bfd_putl32 (data, addr) - bfd_vma data; - register bfd_byte *addr; +bfd_putl32 (bfd_vma data, void *p) { - addr[0] = (bfd_byte) data; - addr[1] = (bfd_byte) (data >> 8); - addr[2] = (bfd_byte) (data >> 16); - addr[3] = (bfd_byte) (data >> 24); + bfd_byte *addr = p; + addr[0] = data & 0xff; + addr[1] = (data >> 8) & 0xff; + addr[2] = (data >> 16) & 0xff; + addr[3] = (data >> 24) & 0xff; } void -bfd_putb64 (data, addr) - bfd_vma data ATTRIBUTE_UNUSED; - register bfd_byte *addr ATTRIBUTE_UNUSED; -{ -#ifdef BFD64 - addr[0] = (bfd_byte) (data >> (7*8)); - addr[1] = (bfd_byte) (data >> (6*8)); - addr[2] = (bfd_byte) (data >> (5*8)); - addr[3] = (bfd_byte) (data >> (4*8)); - addr[4] = (bfd_byte) (data >> (3*8)); - addr[5] = (bfd_byte) (data >> (2*8)); - addr[6] = (bfd_byte) (data >> (1*8)); - addr[7] = (bfd_byte) (data >> (0*8)); +bfd_putb64 (bfd_uint64_t data ATTRIBUTE_UNUSED, void *p ATTRIBUTE_UNUSED) +{ +#ifdef BFD_HOST_64_BIT + bfd_byte *addr = p; + addr[0] = (data >> (7*8)) & 0xff; + addr[1] = (data >> (6*8)) & 0xff; + addr[2] = (data >> (5*8)) & 0xff; + addr[3] = (data >> (4*8)) & 0xff; + addr[4] = (data >> (3*8)) & 0xff; + addr[5] = (data >> (2*8)) & 0xff; + addr[6] = (data >> (1*8)) & 0xff; + addr[7] = (data >> (0*8)) & 0xff; #else BFD_FAIL(); #endif } void -bfd_putl64 (data, addr) - bfd_vma data ATTRIBUTE_UNUSED; - register bfd_byte *addr ATTRIBUTE_UNUSED; -{ -#ifdef BFD64 - addr[7] = (bfd_byte) (data >> (7*8)); - addr[6] = (bfd_byte) (data >> (6*8)); - addr[5] = (bfd_byte) (data >> (5*8)); - addr[4] = (bfd_byte) (data >> (4*8)); - addr[3] = (bfd_byte) (data >> (3*8)); - addr[2] = (bfd_byte) (data >> (2*8)); - addr[1] = (bfd_byte) (data >> (1*8)); - addr[0] = (bfd_byte) (data >> (0*8)); +bfd_putl64 (bfd_uint64_t data ATTRIBUTE_UNUSED, void *p ATTRIBUTE_UNUSED) +{ +#ifdef BFD_HOST_64_BIT + bfd_byte *addr = p; + addr[7] = (data >> (7*8)) & 0xff; + addr[6] = (data >> (6*8)) & 0xff; + addr[5] = (data >> (5*8)) & 0xff; + addr[4] = (data >> (4*8)) & 0xff; + addr[3] = (data >> (3*8)) & 0xff; + addr[2] = (data >> (2*8)) & 0xff; + addr[1] = (data >> (1*8)) & 0xff; + addr[0] = (data >> (0*8)) & 0xff; #else BFD_FAIL(); #endif } void -bfd_put_bits (data, addr, bits, big_p) - bfd_vma data; - bfd_byte *addr; - int bits; - boolean big_p; +bfd_put_bits (bfd_uint64_t data, void *p, int bits, bfd_boolean big_p) { + bfd_byte *addr = p; int i; int bytes; @@ -1260,18 +655,16 @@ bfd_put_bits (data, addr, bits, big_p) { int index = big_p ? bytes - i - 1 : i; - addr[index] = (bfd_byte) data; + addr[index] = data & 0xff; data >>= 8; } } -bfd_vma -bfd_get_bits (addr, bits, big_p) - bfd_byte *addr; - int bits; - boolean big_p; +bfd_uint64_t +bfd_get_bits (const void *p, int bits, bfd_boolean big_p) { - bfd_vma data; + const bfd_byte *addr = p; + bfd_uint64_t data; int i; int bytes; @@ -1292,42 +685,42 @@ bfd_get_bits (addr, bits, big_p) /* Default implementation */ -boolean -_bfd_generic_get_section_contents (abfd, section, location, offset, count) - bfd *abfd; - sec_ptr section; - PTR location; - file_ptr offset; - bfd_size_type count; +bfd_boolean +_bfd_generic_get_section_contents (bfd *abfd, + sec_ptr section, + void *location, + file_ptr offset, + bfd_size_type count) { if (count == 0) - return true; + return TRUE; if (offset + count > section->_raw_size) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0 || bfd_bread (location, count, abfd) != count) - return false; + return FALSE; - return true; + return TRUE; } -boolean -_bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count) - bfd *abfd ATTRIBUTE_UNUSED; - sec_ptr section ATTRIBUTE_UNUSED; - bfd_window *w ATTRIBUTE_UNUSED; - file_ptr offset ATTRIBUTE_UNUSED; - bfd_size_type count ATTRIBUTE_UNUSED; +bfd_boolean +_bfd_generic_get_section_contents_in_window + (bfd *abfd ATTRIBUTE_UNUSED, + sec_ptr section ATTRIBUTE_UNUSED, + bfd_window *w ATTRIBUTE_UNUSED, + file_ptr offset ATTRIBUTE_UNUSED, + bfd_size_type count ATTRIBUTE_UNUSED) { #ifdef USE_MMAP if (count == 0) - return true; - if (abfd->xvec->_bfd_get_section_contents != _bfd_generic_get_section_contents) + return TRUE; + if (abfd->xvec->_bfd_get_section_contents + != _bfd_generic_get_section_contents) { /* We don't know what changes the bfd's get_section_contents method may have to make. So punt trying to map the file @@ -1335,16 +728,15 @@ _bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count) /* @@ FIXME : If the internal window has a refcount of 1 and was allocated with malloc instead of mmap, just reuse it. */ bfd_free_window (w); - w->i = ((bfd_window_internal *) - bfd_zmalloc ((bfd_size_type) sizeof (bfd_window_internal))); + w->i = bfd_zmalloc (sizeof (bfd_window_internal)); if (w->i == NULL) - return false; - w->i->data = (PTR) bfd_malloc (count); + return FALSE; + w->i->data = bfd_malloc (count); if (w->i->data == NULL) { free (w->i); w->i = NULL; - return false; + return FALSE; } w->i->mapped = 0; w->i->refcount = 1; @@ -1354,9 +746,9 @@ _bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count) } if (offset + count > section->_raw_size || ! bfd_get_file_window (abfd, section->filepos + offset, count, w, - true)) - return false; - return true; + TRUE)) + return FALSE; + return TRUE; #else abort (); #endif @@ -1366,22 +758,21 @@ _bfd_generic_get_section_contents_in_window (abfd, section, w, offset, count) NEW sections is disallowed. It is useful in patching existing sections in read-write files, though. See other set_section_contents functions to see why it doesn't work for new sections. */ -boolean -_bfd_generic_set_section_contents (abfd, section, location, offset, count) - bfd *abfd; - sec_ptr section; - PTR location; - file_ptr offset; - bfd_size_type count; +bfd_boolean +_bfd_generic_set_section_contents (bfd *abfd, + sec_ptr section, + const void *location, + file_ptr offset, + bfd_size_type count) { if (count == 0) - return true; + return TRUE; if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0 || bfd_bwrite (location, count, abfd) != count) - return false; + return FALSE; - return true; + return TRUE; } /* @@ -1397,8 +788,7 @@ DESCRIPTION */ unsigned int -bfd_log2 (x) - bfd_vma x; +bfd_log2 (bfd_vma x) { unsigned int result = 0; @@ -1407,23 +797,19 @@ bfd_log2 (x) return result; } -boolean -bfd_generic_is_local_label_name (abfd, name) - bfd *abfd; - const char *name; +bfd_boolean +bfd_generic_is_local_label_name (bfd *abfd, const char *name) { char locals_prefix = (bfd_get_symbol_leading_char (abfd) == '_') ? 'L' : '.'; - return (boolean) (name[0] == locals_prefix); + return name[0] == locals_prefix; } /* Can be used from / for bfd_merge_private_bfd_data to check that endianness matches between input and output file. Returns - true for a match, otherwise returns false and emits an error. */ -boolean -_bfd_generic_verify_endian_match (ibfd, obfd) - bfd *ibfd; - bfd *obfd; + TRUE for a match, otherwise returns FALSE and emits an error. */ +bfd_boolean +_bfd_generic_verify_endian_match (bfd *ibfd, bfd *obfd) { if (ibfd->xvec->byteorder != obfd->xvec->byteorder && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN @@ -1439,28 +825,27 @@ _bfd_generic_verify_endian_match (ibfd, obfd) (*_bfd_error_handler) (msg, bfd_archive_filename (ibfd)); bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; } - return true; + return TRUE; } /* Give a warning at runtime if someone compiles code which calls old routines. */ void -warn_deprecated (what, file, line, func) - const char *what; - const char *file; - int line; - const char *func; +warn_deprecated (const char *what, + const char *file, + int line, + const char *func) { /* Poor man's tracking of functions we've already warned about. */ static size_t mask = 0; if (~(size_t) func & ~mask) { - /* Note: seperate sentances in order to allow + /* Note: separate sentences in order to allow for translation into other languages. */ if (func) fprintf (stderr, _("Deprecated %s called at %s line %d in %s\n"), diff --git a/contrib/binutils/bfd/libbfd.h b/contrib/binutils/bfd/libbfd.h index 3480114..62043f3 100644 --- a/contrib/binutils/bfd/libbfd.h +++ b/contrib/binutils/bfd/libbfd.h @@ -1,13 +1,14 @@ /* DO NOT EDIT! -*- buffer-read-only: t -*- This file is automatically - generated from "libbfd-in.h", "init.c", "libbfd.c", "cache.c", - "reloc.c", "archures.c" and "elf.c". + generated from "libbfd-in.h", "init.c", "libbfd.c", "bfdio.c", + "bfdwin.c", "cache.c", "reloc.c", "archures.c" and "elf.c". Run "make headers" in your build bfd/ to regenerate. */ /* libbfd.h -- Declarations used by bfd library *implementation*. (This include file is not for users of the library.) - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 - Free Software Foundation, Inc. + + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, + 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -41,7 +42,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Set a tdata field. Can't use the other macros for this, since they do casts, and casting to the left of assignment isn't portable. */ -#define set_tdata(bfd, v) ((bfd)->tdata.any = (PTR) (v)) +#define set_tdata(bfd, v) ((bfd)->tdata.any = (v)) /* If BFD_IN_MEMORY is set for a BFD, then the iostream fields points to an instance of this structure. */ @@ -74,7 +75,7 @@ struct artdata { archive. */ file_ptr armap_datepos; /* Position within archive to seek to rewrite the date field. */ - PTR tdata; /* Backend specific information. */ + void *tdata; /* Backend specific information. */ }; #define bfd_ardata(bfd) ((bfd)->tdata.aout_ar_data) @@ -88,70 +89,105 @@ struct areltdata { #define arelt_size(bfd) (((struct areltdata *)((bfd)->arelt_data))->parsed_size) -extern PTR bfd_malloc PARAMS ((bfd_size_type)); -extern PTR bfd_realloc PARAMS ((PTR, bfd_size_type)); -extern PTR bfd_zmalloc PARAMS ((bfd_size_type)); +extern void *bfd_malloc + (bfd_size_type); +extern void *bfd_realloc + (void *, bfd_size_type); +extern void *bfd_zmalloc + (bfd_size_type); extern bfd_error_handler_type _bfd_error_handler; /* These routines allocate and free things on the BFD's objalloc. */ -extern PTR bfd_alloc PARAMS ((bfd *, bfd_size_type)); -extern PTR bfd_zalloc PARAMS ((bfd *, bfd_size_type)); -extern void bfd_release PARAMS ((bfd *, PTR)); - -bfd * _bfd_create_empty_archive_element_shell PARAMS ((bfd *obfd)); -bfd * _bfd_look_for_bfd_in_cache PARAMS ((bfd *, file_ptr)); -boolean _bfd_add_bfd_to_archive_cache PARAMS ((bfd *, file_ptr, bfd *)); -boolean _bfd_generic_mkarchive PARAMS ((bfd *abfd)); -const bfd_target *bfd_generic_archive_p PARAMS ((bfd *abfd)); -boolean bfd_slurp_armap PARAMS ((bfd *abfd)); -boolean bfd_slurp_bsd_armap_f2 PARAMS ((bfd *abfd)); +extern void *bfd_alloc + (bfd *, bfd_size_type); +extern void *bfd_zalloc + (bfd *, bfd_size_type); +extern void bfd_release + (bfd *, void *); + +bfd * _bfd_create_empty_archive_element_shell + (bfd *obfd); +bfd * _bfd_look_for_bfd_in_cache + (bfd *, file_ptr); +bfd_boolean _bfd_add_bfd_to_archive_cache + (bfd *, file_ptr, bfd *); +bfd_boolean _bfd_generic_mkarchive + (bfd *abfd); +const bfd_target *bfd_generic_archive_p + (bfd *abfd); +bfd_boolean bfd_slurp_armap + (bfd *abfd); +bfd_boolean bfd_slurp_bsd_armap_f2 + (bfd *abfd); #define bfd_slurp_bsd_armap bfd_slurp_armap #define bfd_slurp_coff_armap bfd_slurp_armap -boolean _bfd_slurp_extended_name_table PARAMS ((bfd *abfd)); -extern boolean _bfd_construct_extended_name_table - PARAMS ((bfd *, boolean, char **, bfd_size_type *)); -boolean _bfd_write_archive_contents PARAMS ((bfd *abfd)); -boolean _bfd_compute_and_write_armap PARAMS ((bfd *, unsigned int elength)); -bfd *_bfd_get_elt_at_filepos PARAMS ((bfd *archive, file_ptr filepos)); -extern bfd *_bfd_generic_get_elt_at_index PARAMS ((bfd *, symindex)); -bfd * _bfd_new_bfd PARAMS ((void)); -void _bfd_delete_bfd PARAMS ((bfd *)); - -boolean bfd_false PARAMS ((bfd *ignore)); -boolean bfd_true PARAMS ((bfd *ignore)); -PTR bfd_nullvoidptr PARAMS ((bfd *ignore)); -int bfd_0 PARAMS ((bfd *ignore)); -unsigned int bfd_0u PARAMS ((bfd *ignore)); -long bfd_0l PARAMS ((bfd *ignore)); -long _bfd_n1 PARAMS ((bfd *ignore)); -void bfd_void PARAMS ((bfd *ignore)); - -bfd *_bfd_new_bfd_contained_in PARAMS ((bfd *)); -const bfd_target *_bfd_dummy_target PARAMS ((bfd *abfd)); - -void bfd_dont_truncate_arname PARAMS ((bfd *abfd, const char *filename, - char *hdr)); -void bfd_bsd_truncate_arname PARAMS ((bfd *abfd, const char *filename, - char *hdr)); -void bfd_gnu_truncate_arname PARAMS ((bfd *abfd, const char *filename, - char *hdr)); - -boolean bsd_write_armap PARAMS ((bfd *arch, unsigned int elength, - struct orl *map, unsigned int orl_count, int stridx)); - -boolean coff_write_armap PARAMS ((bfd *arch, unsigned int elength, - struct orl *map, unsigned int orl_count, int stridx)); - -extern PTR _bfd_generic_read_ar_hdr PARAMS ((bfd *)); - -extern PTR _bfd_generic_read_ar_hdr_mag PARAMS ((bfd *, const char *)); - -bfd * bfd_generic_openr_next_archived_file PARAMS ((bfd *archive, - bfd *last_file)); - -int bfd_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); +bfd_boolean _bfd_slurp_extended_name_table + (bfd *abfd); +extern bfd_boolean _bfd_construct_extended_name_table + (bfd *, bfd_boolean, char **, bfd_size_type *); +bfd_boolean _bfd_write_archive_contents + (bfd *abfd); +bfd_boolean _bfd_compute_and_write_armap + (bfd *, unsigned int elength); +bfd *_bfd_get_elt_at_filepos + (bfd *archive, file_ptr filepos); +extern bfd *_bfd_generic_get_elt_at_index + (bfd *, symindex); +bfd * _bfd_new_bfd + (void); +void _bfd_delete_bfd + (bfd *); + +bfd_boolean bfd_false + (bfd *ignore); +bfd_boolean bfd_true + (bfd *ignore); +void *bfd_nullvoidptr + (bfd *ignore); +int bfd_0 + (bfd *ignore); +unsigned int bfd_0u + (bfd *ignore); +long bfd_0l + (bfd *ignore); +long _bfd_n1 + (bfd *ignore); +void bfd_void + (bfd *ignore); + +bfd *_bfd_new_bfd_contained_in + (bfd *); +const bfd_target *_bfd_dummy_target + (bfd *abfd); + +void bfd_dont_truncate_arname + (bfd *abfd, const char *filename, char *hdr); +void bfd_bsd_truncate_arname + (bfd *abfd, const char *filename, char *hdr); +void bfd_gnu_truncate_arname + (bfd *abfd, const char *filename, char *hdr); + +bfd_boolean bsd_write_armap + (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count, + int stridx); + +bfd_boolean coff_write_armap + (bfd *arch, unsigned int elength, struct orl *map, unsigned int orl_count, + int stridx); + +extern void *_bfd_generic_read_ar_hdr + (bfd *); + +extern void *_bfd_generic_read_ar_hdr_mag + (bfd *, const char *); + +bfd * bfd_generic_openr_next_archived_file + (bfd *archive, bfd *last_file); + +int bfd_generic_stat_arch_elt + (bfd *, struct stat *); #define _bfd_read_ar_hdr(abfd) \ BFD_SEND (abfd, _bfd_read_ar_hdr_fn, (abfd)) @@ -162,35 +198,37 @@ int bfd_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); #define _bfd_generic_close_and_cleanup bfd_true #define _bfd_generic_bfd_free_cached_info bfd_true #define _bfd_generic_new_section_hook \ - ((boolean (*) PARAMS ((bfd *, asection *))) bfd_true) -extern boolean _bfd_generic_get_section_contents - PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); -extern boolean _bfd_generic_get_section_contents_in_window - PARAMS ((bfd *, asection *, bfd_window *, file_ptr, bfd_size_type)); + ((bfd_boolean (*) (bfd *, asection *)) bfd_true) +extern bfd_boolean _bfd_generic_get_section_contents + (bfd *, asection *, void *, file_ptr, bfd_size_type); +extern bfd_boolean _bfd_generic_get_section_contents_in_window + (bfd *, asection *, bfd_window *, file_ptr, bfd_size_type); /* Generic routines to use for BFD_JUMP_TABLE_COPY. Use BFD_JUMP_TABLE_COPY (_bfd_generic). */ #define _bfd_generic_bfd_copy_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) + ((bfd_boolean (*) (bfd *, bfd *)) bfd_true) #define _bfd_generic_bfd_merge_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, bfd *))) bfd_true) + ((bfd_boolean (*) (bfd *, bfd *)) bfd_true) #define _bfd_generic_bfd_set_private_flags \ - ((boolean (*) PARAMS ((bfd *, flagword))) bfd_true) + ((bfd_boolean (*) (bfd *, flagword)) bfd_true) #define _bfd_generic_bfd_copy_private_section_data \ - ((boolean (*) PARAMS ((bfd *, asection *, bfd *, asection *))) bfd_true) + ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) bfd_true) #define _bfd_generic_bfd_copy_private_symbol_data \ - ((boolean (*) PARAMS ((bfd *, asymbol *, bfd *, asymbol *))) bfd_true) + ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) bfd_true) #define _bfd_generic_bfd_print_private_bfd_data \ - ((boolean (*) PARAMS ((bfd *, PTR))) bfd_true) + ((bfd_boolean (*) (bfd *, void *)) bfd_true) /* Routines to use for BFD_JUMP_TABLE_CORE when there is no core file support. Use BFD_JUMP_TABLE_CORE (_bfd_nocore). */ -extern char *_bfd_nocore_core_file_failing_command PARAMS ((bfd *)); -extern int _bfd_nocore_core_file_failing_signal PARAMS ((bfd *)); -extern boolean _bfd_nocore_core_file_matches_executable_p - PARAMS ((bfd *, bfd *)); +extern char *_bfd_nocore_core_file_failing_command + (bfd *); +extern int _bfd_nocore_core_file_failing_signal + (bfd *); +extern bfd_boolean _bfd_nocore_core_file_matches_executable_p + (bfd *, bfd *); /* Routines to use for BFD_JUMP_TABLE_ARCHIVE when there is no archive file support. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive). */ @@ -198,19 +236,18 @@ extern boolean _bfd_nocore_core_file_matches_executable_p #define _bfd_noarchive_slurp_armap bfd_false #define _bfd_noarchive_slurp_extended_name_table bfd_false #define _bfd_noarchive_construct_extended_name_table \ - ((boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \ + ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) \ bfd_false) #define _bfd_noarchive_truncate_arname \ - ((void (*) PARAMS ((bfd *, const char *, char *))) bfd_void) + ((void (*) (bfd *, const char *, char *)) bfd_void) #define _bfd_noarchive_write_armap \ - ((boolean (*) \ - PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int))) \ + ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) \ bfd_false) #define _bfd_noarchive_read_ar_hdr bfd_nullvoidptr #define _bfd_noarchive_openr_next_archived_file \ - ((bfd *(*) PARAMS ((bfd *, bfd *))) bfd_nullvoidptr) + ((bfd *(*) (bfd *, bfd *)) bfd_nullvoidptr) #define _bfd_noarchive_get_elt_at_index \ - ((bfd *(*) PARAMS ((bfd *, symindex))) bfd_nullvoidptr) + ((bfd *(*) (bfd *, symindex)) bfd_nullvoidptr) #define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt #define _bfd_noarchive_update_armap_timestamp bfd_false @@ -220,8 +257,8 @@ extern boolean _bfd_nocore_core_file_matches_executable_p #define _bfd_archive_bsd_slurp_armap bfd_slurp_bsd_armap #define _bfd_archive_bsd_slurp_extended_name_table \ _bfd_slurp_extended_name_table -extern boolean _bfd_archive_bsd_construct_extended_name_table - PARAMS ((bfd *, char **, bfd_size_type *, const char **)); +extern bfd_boolean _bfd_archive_bsd_construct_extended_name_table + (bfd *, char **, bfd_size_type *, const char **); #define _bfd_archive_bsd_truncate_arname bfd_bsd_truncate_arname #define _bfd_archive_bsd_write_armap bsd_write_armap #define _bfd_archive_bsd_read_ar_hdr _bfd_generic_read_ar_hdr @@ -230,7 +267,8 @@ extern boolean _bfd_archive_bsd_construct_extended_name_table #define _bfd_archive_bsd_get_elt_at_index _bfd_generic_get_elt_at_index #define _bfd_archive_bsd_generic_stat_arch_elt \ bfd_generic_stat_arch_elt -extern boolean _bfd_archive_bsd_update_armap_timestamp PARAMS ((bfd *)); +extern bfd_boolean _bfd_archive_bsd_update_armap_timestamp + (bfd *); /* Routines to use for BFD_JUMP_TABLE_ARCHIVE to get COFF style archives. Use BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff). */ @@ -238,8 +276,8 @@ extern boolean _bfd_archive_bsd_update_armap_timestamp PARAMS ((bfd *)); #define _bfd_archive_coff_slurp_armap bfd_slurp_coff_armap #define _bfd_archive_coff_slurp_extended_name_table \ _bfd_slurp_extended_name_table -extern boolean _bfd_archive_coff_construct_extended_name_table - PARAMS ((bfd *, char **, bfd_size_type *, const char **)); +extern bfd_boolean _bfd_archive_coff_construct_extended_name_table + (bfd *, char **, bfd_size_type *, const char **); #define _bfd_archive_coff_truncate_arname bfd_dont_truncate_arname #define _bfd_archive_coff_write_armap coff_write_armap #define _bfd_archive_coff_read_ar_hdr _bfd_generic_read_ar_hdr @@ -254,95 +292,89 @@ extern boolean _bfd_archive_coff_construct_extended_name_table support. Use BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols). */ #define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1 -#define _bfd_nosymbols_get_symtab \ - ((long (*) PARAMS ((bfd *, asymbol **))) _bfd_n1) +#define _bfd_nosymbols_canonicalize_symtab \ + ((long (*) (bfd *, asymbol **)) _bfd_n1) #define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol #define _bfd_nosymbols_print_symbol \ - ((void (*) PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type))) bfd_void) + ((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) bfd_void) #define _bfd_nosymbols_get_symbol_info \ - ((void (*) PARAMS ((bfd *, asymbol *, symbol_info *))) bfd_void) + ((void (*) (bfd *, asymbol *, symbol_info *)) bfd_void) #define _bfd_nosymbols_bfd_is_local_label_name \ - ((boolean (*) PARAMS ((bfd *, const char *))) bfd_false) + ((bfd_boolean (*) (bfd *, const char *)) bfd_false) #define _bfd_nosymbols_get_lineno \ - ((alent *(*) PARAMS ((bfd *, asymbol *))) bfd_nullvoidptr) + ((alent *(*) (bfd *, asymbol *)) bfd_nullvoidptr) #define _bfd_nosymbols_find_nearest_line \ - ((boolean (*) \ - PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, \ - const char **, unsigned int *))) \ + ((bfd_boolean (*) (bfd *, asection *, asymbol **, bfd_vma, const char **, \ + const char **, unsigned int *)) \ bfd_false) #define _bfd_nosymbols_bfd_make_debug_symbol \ - ((asymbol *(*) PARAMS ((bfd *, PTR, unsigned long))) bfd_nullvoidptr) + ((asymbol *(*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) #define _bfd_nosymbols_read_minisymbols \ - ((long (*) PARAMS ((bfd *, boolean, PTR *, unsigned int *))) _bfd_n1) + ((long (*) (bfd *, bfd_boolean, void **, unsigned int *)) _bfd_n1) #define _bfd_nosymbols_minisymbol_to_symbol \ - ((asymbol *(*) PARAMS ((bfd *, boolean, const PTR, asymbol *))) \ + ((asymbol *(*) (bfd *, bfd_boolean, const void *, asymbol *)) \ bfd_nullvoidptr) /* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc support. Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs). */ #define _bfd_norelocs_get_reloc_upper_bound \ - ((long (*) PARAMS ((bfd *, asection *))) _bfd_n1) + ((long (*) (bfd *, asection *)) _bfd_n1) #define _bfd_norelocs_canonicalize_reloc \ - ((long (*) PARAMS ((bfd *, asection *, arelent **, asymbol **))) _bfd_n1) + ((long (*) (bfd *, asection *, arelent **, asymbol **)) _bfd_n1) #define _bfd_norelocs_bfd_reloc_type_lookup \ - ((reloc_howto_type *(*) PARAMS ((bfd *, bfd_reloc_code_real_type))) \ - bfd_nullvoidptr) + ((reloc_howto_type *(*) (bfd *, bfd_reloc_code_real_type)) bfd_nullvoidptr) /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not be written. Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite). */ #define _bfd_nowrite_set_arch_mach \ - ((boolean (*) PARAMS ((bfd *, enum bfd_architecture, unsigned long))) \ + ((bfd_boolean (*) (bfd *, enum bfd_architecture, unsigned long)) \ bfd_false) #define _bfd_nowrite_set_section_contents \ - ((boolean (*) PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type))) \ + ((bfd_boolean (*) (bfd *, asection *, const void *, file_ptr, bfd_size_type)) \ bfd_false) /* Generic routines to use for BFD_JUMP_TABLE_WRITE. Use BFD_JUMP_TABLE_WRITE (_bfd_generic). */ #define _bfd_generic_set_arch_mach bfd_default_set_arch_mach -extern boolean _bfd_generic_set_section_contents - PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); +extern bfd_boolean _bfd_generic_set_section_contents + (bfd *, asection *, const void *, file_ptr, bfd_size_type); /* Routines to use for BFD_JUMP_TABLE_LINK for targets which do not support linking. Use BFD_JUMP_TABLE_LINK (_bfd_nolink). */ -#define _bfd_nolink_sizeof_headers ((int (*) PARAMS ((bfd *, boolean))) bfd_0) +#define _bfd_nolink_sizeof_headers ((int (*) (bfd *, bfd_boolean)) bfd_0) #define _bfd_nolink_bfd_get_relocated_section_contents \ - ((bfd_byte *(*) \ - PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, \ - bfd_byte *, boolean, asymbol **))) \ + ((bfd_byte *(*) (bfd *, struct bfd_link_info *, struct bfd_link_order *, \ + bfd_byte *, bfd_boolean, asymbol **)) \ bfd_nullvoidptr) #define _bfd_nolink_bfd_relax_section \ - ((boolean (*) \ - PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *))) \ + ((bfd_boolean (*) \ + (bfd *, asection *, struct bfd_link_info *, bfd_boolean *)) \ bfd_false) #define _bfd_nolink_bfd_gc_sections \ - ((boolean (*) \ - PARAMS ((bfd *, struct bfd_link_info *))) \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \ bfd_false) #define _bfd_nolink_bfd_merge_sections \ - ((boolean (*) \ - PARAMS ((bfd *, struct bfd_link_info *))) \ + ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \ bfd_false) #define _bfd_nolink_bfd_discard_group \ - ((boolean (*) \ - PARAMS ((bfd *, struct sec *))) \ + ((bfd_boolean (*) (bfd *, struct bfd_section *)) \ bfd_false) #define _bfd_nolink_bfd_link_hash_table_create \ - ((struct bfd_link_hash_table *(*) PARAMS ((bfd *))) bfd_nullvoidptr) + ((struct bfd_link_hash_table *(*) (bfd *)) bfd_nullvoidptr) #define _bfd_nolink_bfd_link_hash_table_free \ - ((void (*) PARAMS ((struct bfd_link_hash_table *))) bfd_void) + ((void (*) (struct bfd_link_hash_table *)) bfd_void) #define _bfd_nolink_bfd_link_add_symbols \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false) #define _bfd_nolink_bfd_link_just_syms \ - ((void (*) PARAMS ((asection *, struct bfd_link_info *))) bfd_void) + ((void (*) (asection *, struct bfd_link_info *)) bfd_void) #define _bfd_nolink_bfd_final_link \ - ((boolean (*) PARAMS ((bfd *, struct bfd_link_info *))) bfd_false) + ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false) #define _bfd_nolink_bfd_link_split_section \ - ((boolean (*) PARAMS ((bfd *, struct sec *))) bfd_false) + ((bfd_boolean (*) (bfd *, struct bfd_section *)) bfd_false) /* Routines to use for BFD_JUMP_TABLE_DYNAMIC for targets which do not have dynamic symbols or relocs. Use BFD_JUMP_TABLE_DYNAMIC @@ -350,187 +382,189 @@ extern boolean _bfd_generic_set_section_contents #define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_n1 #define _bfd_nodynamic_canonicalize_dynamic_symtab \ - ((long (*) PARAMS ((bfd *, asymbol **))) _bfd_n1) + ((long (*) (bfd *, asymbol **)) _bfd_n1) #define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_n1 #define _bfd_nodynamic_canonicalize_dynamic_reloc \ - ((long (*) PARAMS ((bfd *, arelent **, asymbol **))) _bfd_n1) + ((long (*) (bfd *, arelent **, asymbol **)) _bfd_n1) /* Generic routine to determine of the given symbol is a local label. */ -extern boolean bfd_generic_is_local_label_name PARAMS ((bfd *, const char *)); +extern bfd_boolean bfd_generic_is_local_label_name + (bfd *, const char *); /* Generic minisymbol routines. */ extern long _bfd_generic_read_minisymbols - PARAMS ((bfd *, boolean, PTR *, unsigned int *)); + (bfd *, bfd_boolean, void **, unsigned int *); extern asymbol *_bfd_generic_minisymbol_to_symbol - PARAMS ((bfd *, boolean, const PTR, asymbol *)); + (bfd *, bfd_boolean, const void *, asymbol *); /* Find the nearest line using .stab/.stabstr sections. */ -extern boolean _bfd_stab_section_find_nearest_line - PARAMS ((bfd *, asymbol **, asection *, bfd_vma, boolean *, const char **, - const char **, unsigned int *, PTR *)); +extern bfd_boolean _bfd_stab_section_find_nearest_line + (bfd *, asymbol **, asection *, bfd_vma, bfd_boolean *, + const char **, const char **, unsigned int *, void **); /* Find the neaderst line using DWARF 1 debugging information. */ -extern boolean _bfd_dwarf1_find_nearest_line - PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *)); +extern bfd_boolean _bfd_dwarf1_find_nearest_line + (bfd *, asection *, asymbol **, bfd_vma, const char **, + const char **, unsigned int *); /* Find the nearest line using DWARF 2 debugging information. */ -extern boolean _bfd_dwarf2_find_nearest_line - PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, - const char **, unsigned int *, unsigned int, - PTR *)); +extern bfd_boolean _bfd_dwarf2_find_nearest_line + (bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, + unsigned int *, unsigned int, void **); /* Create a new section entry. */ extern struct bfd_hash_entry *bfd_section_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); /* A routine to create entries for a bfd_link_hash_table. */ extern struct bfd_hash_entry *_bfd_link_hash_newfunc - PARAMS ((struct bfd_hash_entry *entry, - struct bfd_hash_table *table, - const char *string)); + (struct bfd_hash_entry *entry, struct bfd_hash_table *table, + const char *string); /* Initialize a bfd_link_hash_table. */ -extern boolean _bfd_link_hash_table_init - PARAMS ((struct bfd_link_hash_table *, bfd *, - struct bfd_hash_entry *(*) (struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *))); +extern bfd_boolean _bfd_link_hash_table_init + (struct bfd_link_hash_table *, bfd *, + struct bfd_hash_entry *(*) (struct bfd_hash_entry *, + struct bfd_hash_table *, + const char *)); /* Generic link hash table creation routine. */ extern struct bfd_link_hash_table *_bfd_generic_link_hash_table_create - PARAMS ((bfd *)); + (bfd *); /* Generic link hash table destruction routine. */ extern void _bfd_generic_link_hash_table_free - PARAMS ((struct bfd_link_hash_table *)); + (struct bfd_link_hash_table *); /* Generic add symbol routine. */ -extern boolean _bfd_generic_link_add_symbols - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean _bfd_generic_link_add_symbols + (bfd *, struct bfd_link_info *); /* Generic add symbol routine. This version is used by targets for which the linker must collect constructors and destructors by name, as the collect2 program does. */ -extern boolean _bfd_generic_link_add_symbols_collect - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean _bfd_generic_link_add_symbols_collect + (bfd *, struct bfd_link_info *); /* Generic archive add symbol routine. */ -extern boolean _bfd_generic_link_add_archive_symbols - PARAMS ((bfd *, struct bfd_link_info *, - boolean (*checkfn) (bfd *, struct bfd_link_info *, boolean *))); +extern bfd_boolean _bfd_generic_link_add_archive_symbols + (bfd *, struct bfd_link_info *, + bfd_boolean (*) (bfd *, struct bfd_link_info *, bfd_boolean *)); /* Forward declaration to avoid prototype errors. */ typedef struct bfd_link_hash_entry _bfd_link_hash_entry; /* Generic routine to add a single symbol. */ -extern boolean _bfd_generic_link_add_one_symbol - PARAMS ((struct bfd_link_info *, bfd *, const char *name, flagword, - asection *, bfd_vma, const char *, boolean copy, - boolean constructor, struct bfd_link_hash_entry **)); +extern bfd_boolean _bfd_generic_link_add_one_symbol + (struct bfd_link_info *, bfd *, const char *name, flagword, + asection *, bfd_vma, const char *, bfd_boolean copy, + bfd_boolean constructor, struct bfd_link_hash_entry **); /* Generic routine to mark section as supplying symbols only. */ extern void _bfd_generic_link_just_syms - PARAMS ((asection *, struct bfd_link_info *)); + (asection *, struct bfd_link_info *); /* Generic link routine. */ -extern boolean _bfd_generic_final_link - PARAMS ((bfd *, struct bfd_link_info *)); +extern bfd_boolean _bfd_generic_final_link + (bfd *, struct bfd_link_info *); -extern boolean _bfd_generic_link_split_section - PARAMS ((bfd *, struct sec *)); +extern bfd_boolean _bfd_generic_link_split_section + (bfd *, struct bfd_section *); /* Generic reloc_link_order processing routine. */ -extern boolean _bfd_generic_reloc_link_order - PARAMS ((bfd *, struct bfd_link_info *, asection *, - struct bfd_link_order *)); +extern bfd_boolean _bfd_generic_reloc_link_order + (bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *); /* Default link order processing routine. */ -extern boolean _bfd_default_link_order - PARAMS ((bfd *, struct bfd_link_info *, asection *, - struct bfd_link_order *)); +extern bfd_boolean _bfd_default_link_order + (bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *); /* Count the number of reloc entries in a link order list. */ extern unsigned int _bfd_count_link_order_relocs - PARAMS ((struct bfd_link_order *)); + (struct bfd_link_order *); /* Final link relocation routine. */ extern bfd_reloc_status_type _bfd_final_link_relocate - PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, - bfd_vma, bfd_vma, bfd_vma)); + (reloc_howto_type *, bfd *, asection *, bfd_byte *, + bfd_vma, bfd_vma, bfd_vma); /* Relocate a particular location by a howto and a value. */ extern bfd_reloc_status_type _bfd_relocate_contents - PARAMS ((reloc_howto_type *, bfd *, bfd_vma, bfd_byte *)); + (reloc_howto_type *, bfd *, bfd_vma, bfd_byte *); /* Link stabs in sections in the first pass. */ -extern boolean _bfd_link_section_stabs - PARAMS ((bfd *, PTR *, asection *, asection *, PTR *)); +extern bfd_boolean _bfd_link_section_stabs + (bfd *, void **, asection *, asection *, void **, bfd_size_type *); /* Eliminate stabs for discarded functions and symbols. */ -extern boolean _bfd_discard_section_stabs - PARAMS ((bfd *, asection *, PTR, - boolean (*) (bfd_vma, PTR), PTR)); +extern bfd_boolean _bfd_discard_section_stabs + (bfd *, asection *, void *, bfd_boolean (*) (bfd_vma, void *), void *); /* Write out the .stab section when linking stabs in sections. */ -extern boolean _bfd_write_section_stabs - PARAMS ((bfd *, PTR *, asection *, PTR *, bfd_byte *)); +extern bfd_boolean _bfd_write_section_stabs + (bfd *, void **, asection *, void **, bfd_byte *); /* Write out the .stabstr string table when linking stabs in sections. */ -extern boolean _bfd_write_stab_strings PARAMS ((bfd *, PTR *)); +extern bfd_boolean _bfd_write_stab_strings + (bfd *, void **); /* Find an offset within a .stab section when linking stabs in sections. */ extern bfd_vma _bfd_stab_section_offset - PARAMS ((bfd *, PTR *, asection *, PTR *, bfd_vma)); + (bfd *, void **, asection *, void **, bfd_vma); /* Attempt to merge a SEC_MERGE section. */ -extern boolean _bfd_merge_section - PARAMS ((bfd *, PTR *, asection *, PTR *)); +extern bfd_boolean _bfd_merge_section + (bfd *, void **, asection *, void **); /* Attempt to merge SEC_MERGE sections. */ -extern boolean _bfd_merge_sections - PARAMS ((bfd *, PTR, void (*)(bfd *, asection *))); +extern bfd_boolean _bfd_merge_sections + (bfd *, void *, void (*) (bfd *, asection *)); /* Write out a merged section. */ -extern boolean _bfd_write_merged_section - PARAMS ((bfd *, asection *, PTR)); +extern bfd_boolean _bfd_write_merged_section + (bfd *, asection *, void *); /* Find an offset within a modified SEC_MERGE section. */ extern bfd_vma _bfd_merged_section_offset - PARAMS ((bfd *, asection **, PTR, bfd_vma, bfd_vma)); + (bfd *, asection **, void *, bfd_vma, bfd_vma); /* Create a string table. */ -extern struct bfd_strtab_hash *_bfd_stringtab_init PARAMS ((void)); +extern struct bfd_strtab_hash *_bfd_stringtab_init + (void); /* Create an XCOFF .debug section style string table. */ -extern struct bfd_strtab_hash *_bfd_xcoff_stringtab_init PARAMS ((void)); +extern struct bfd_strtab_hash *_bfd_xcoff_stringtab_init + (void); /* Free a string table. */ -extern void _bfd_stringtab_free PARAMS ((struct bfd_strtab_hash *)); +extern void _bfd_stringtab_free + (struct bfd_strtab_hash *); /* Get the size of a string table. */ -extern bfd_size_type _bfd_stringtab_size PARAMS ((struct bfd_strtab_hash *)); +extern bfd_size_type _bfd_stringtab_size + (struct bfd_strtab_hash *); /* Add a string to a string table. */ extern bfd_size_type _bfd_stringtab_add - PARAMS ((struct bfd_strtab_hash *, const char *, boolean hash, - boolean copy)); + (struct bfd_strtab_hash *, const char *, bfd_boolean hash, bfd_boolean copy); /* Write out a string table. */ -extern boolean _bfd_stringtab_emit PARAMS ((bfd *, struct bfd_strtab_hash *)); +extern bfd_boolean _bfd_stringtab_emit + (bfd *, struct bfd_strtab_hash *); /* Check that endianness of input and output file match. */ -extern boolean _bfd_generic_verify_endian_match PARAMS ((bfd *, bfd *)); +extern bfd_boolean _bfd_generic_verify_endian_match + (bfd *, bfd *); /* Macros to tell if bfds are read or write enabled. @@ -541,19 +575,22 @@ extern boolean _bfd_generic_verify_endian_match PARAMS ((bfd *, bfd *)); !bfd_read_p, and only sometimes bfd_write_p. */ -#define bfd_read_p(abfd) ((abfd)->direction == read_direction || (abfd)->direction == both_direction) -#define bfd_write_p(abfd) ((abfd)->direction == write_direction || (abfd)->direction == both_direction) +#define bfd_read_p(abfd) \ + ((abfd)->direction == read_direction || (abfd)->direction == both_direction) +#define bfd_write_p(abfd) \ + ((abfd)->direction == write_direction || (abfd)->direction == both_direction) -void bfd_assert PARAMS ((const char*,int)); +void bfd_assert + (const char*,int); #define BFD_ASSERT(x) \ -{ if (!(x)) bfd_assert(__FILE__,__LINE__); } + { if (!(x)) bfd_assert(__FILE__,__LINE__); } #define BFD_FAIL() \ -{ bfd_assert(__FILE__,__LINE__); } + { bfd_assert(__FILE__,__LINE__); } -extern void _bfd_abort PARAMS ((const char *, int, const char *)) - ATTRIBUTE_NORETURN; +extern void _bfd_abort + (const char *, int, const char *) ATTRIBUTE_NORETURN; /* if gcc >= 2.6, we can give a function name, too */ #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6) @@ -563,7 +600,13 @@ extern void _bfd_abort PARAMS ((const char *, int, const char *)) #undef abort #define abort() _bfd_abort (__FILE__, __LINE__, __PRETTY_FUNCTION__) -FILE * bfd_cache_lookup_worker PARAMS ((bfd *)); +/* Manipulate a system FILE but using BFD's "file_ptr", rather than + the system "off_t" or "off64_t", as the offset. */ +extern file_ptr real_ftell (FILE *file); +extern int real_fseek (FILE *file, file_ptr offset, int whence); + +FILE * bfd_cache_lookup_worker + (bfd *); extern bfd *bfd_last_cache; @@ -572,6 +615,9 @@ extern bfd *bfd_last_cache; extern const bfd_target * const *bfd_target_vector; extern const bfd_target *bfd_default_vector[]; +/* List of associated target vectors. */ +extern const bfd_target * const *bfd_associated_vector; + /* Functions shared by the ECOFF and MIPS ELF backends, which have no other common header files. */ @@ -579,33 +625,46 @@ extern const bfd_target *bfd_default_vector[]; struct ecoff_find_line; #endif -extern boolean _bfd_ecoff_locate_line - PARAMS ((bfd *, asection *, bfd_vma, struct ecoff_debug_info * const, - const struct ecoff_debug_swap * const, struct ecoff_find_line *, - const char **, const char **, unsigned int *)); -extern boolean _bfd_ecoff_get_accumulated_pdr PARAMS ((PTR, bfd_byte *)); -extern boolean _bfd_ecoff_get_accumulated_sym PARAMS ((PTR, bfd_byte *)); -extern boolean _bfd_ecoff_get_accumulated_ss PARAMS ((PTR, bfd_byte *)); - -extern bfd_vma _bfd_get_gp_value PARAMS ((bfd *)); -extern void _bfd_set_gp_value PARAMS ((bfd *, bfd_vma)); +extern bfd_boolean _bfd_ecoff_locate_line + (bfd *, asection *, bfd_vma, struct ecoff_debug_info * const, + const struct ecoff_debug_swap * const, struct ecoff_find_line *, + const char **, const char **, unsigned int *); +extern bfd_boolean _bfd_ecoff_get_accumulated_pdr + (void *, bfd_byte *); +extern bfd_boolean _bfd_ecoff_get_accumulated_sym + (void *, bfd_byte *); +extern bfd_boolean _bfd_ecoff_get_accumulated_ss + (void *, bfd_byte *); + +extern bfd_vma _bfd_get_gp_value + (bfd *); +extern void _bfd_set_gp_value + (bfd *, bfd_vma); /* Function shared by the COFF and ELF SH backends, which have no other common header files. */ -extern boolean _bfd_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 *)); - +#ifndef _bfd_sh_align_load_span +extern bfd_boolean _bfd_sh_align_load_span + (bfd *, asection *, bfd_byte *, + bfd_boolean (*) (bfd *, asection *, void *, bfd_byte *, bfd_vma), + void *, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, bfd_boolean *); +#endif /* Extracted from init.c. */ /* Extracted from libbfd.c. */ -boolean -bfd_write_bigendian_4byte_int PARAMS ((bfd *, unsigned int)); +bfd_boolean bfd_write_bigendian_4byte_int (bfd *, unsigned int); -unsigned int -bfd_log2 PARAMS ((bfd_vma x)); +unsigned int bfd_log2 (bfd_vma x); +/* Extracted from bfdio.c. */ +/* Extracted from bfdwin.c. */ +struct _bfd_window_internal { + struct _bfd_window_internal *next; + void *data; + bfd_size_type size; + int refcount : 31; /* should be enough... */ + unsigned mapped : 1; /* 1 = mmap, 0 = malloc */ +}; /* Extracted from cache.c. */ #define BFD_CACHE_MAX_OPEN 10 extern bfd *bfd_last_cache; @@ -614,17 +673,13 @@ extern bfd *bfd_last_cache; ((x)==bfd_last_cache? \ (FILE*) (bfd_last_cache->iostream): \ bfd_cache_lookup_worker(x)) -boolean -bfd_cache_init PARAMS ((bfd *abfd)); +bfd_boolean bfd_cache_init (bfd *abfd); -boolean -bfd_cache_close PARAMS ((bfd *abfd)); +bfd_boolean bfd_cache_close (bfd *abfd); -FILE* -bfd_open_file PARAMS ((bfd *abfd)); +FILE* bfd_open_file (bfd *abfd); -FILE * -bfd_cache_lookup_worker PARAMS ((bfd *abfd)); +FILE *bfd_cache_lookup_worker (bfd *abfd); /* Extracted from reloc.c. */ #ifdef _BFD_MAKE_TABLE_bfd_reloc_code_real @@ -726,6 +781,30 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_SPARC_L44", "BFD_RELOC_SPARC_REGISTER", "BFD_RELOC_SPARC_REV32", + "BFD_RELOC_SPARC_TLS_GD_HI22", + "BFD_RELOC_SPARC_TLS_GD_LO10", + "BFD_RELOC_SPARC_TLS_GD_ADD", + "BFD_RELOC_SPARC_TLS_GD_CALL", + "BFD_RELOC_SPARC_TLS_LDM_HI22", + "BFD_RELOC_SPARC_TLS_LDM_LO10", + "BFD_RELOC_SPARC_TLS_LDM_ADD", + "BFD_RELOC_SPARC_TLS_LDM_CALL", + "BFD_RELOC_SPARC_TLS_LDO_HIX22", + "BFD_RELOC_SPARC_TLS_LDO_LOX10", + "BFD_RELOC_SPARC_TLS_LDO_ADD", + "BFD_RELOC_SPARC_TLS_IE_HI22", + "BFD_RELOC_SPARC_TLS_IE_LO10", + "BFD_RELOC_SPARC_TLS_IE_LD", + "BFD_RELOC_SPARC_TLS_IE_LDX", + "BFD_RELOC_SPARC_TLS_IE_ADD", + "BFD_RELOC_SPARC_TLS_LE_HIX22", + "BFD_RELOC_SPARC_TLS_LE_LOX10", + "BFD_RELOC_SPARC_TLS_DTPMOD32", + "BFD_RELOC_SPARC_TLS_DTPMOD64", + "BFD_RELOC_SPARC_TLS_DTPOFF32", + "BFD_RELOC_SPARC_TLS_DTPOFF64", + "BFD_RELOC_SPARC_TLS_TPOFF32", + "BFD_RELOC_SPARC_TLS_TPOFF64", "BFD_RELOC_ALPHA_GPDISP_HI16", "BFD_RELOC_ALPHA_GPDISP_LO16", "BFD_RELOC_ALPHA_GPDISP", @@ -781,6 +860,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_MIPS_REL16", "BFD_RELOC_MIPS_RELGOT", "BFD_RELOC_MIPS_JALR", + "BFD_RELOC_FRV_LABEL16", "BFD_RELOC_FRV_LABEL24", "BFD_RELOC_FRV_LO16", @@ -790,6 +870,29 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_FRV_GPREL32", "BFD_RELOC_FRV_GPRELHI", "BFD_RELOC_FRV_GPRELLO", + "BFD_RELOC_FRV_GOT12", + "BFD_RELOC_FRV_GOTHI", + "BFD_RELOC_FRV_GOTLO", + "BFD_RELOC_FRV_FUNCDESC", + "BFD_RELOC_FRV_FUNCDESC_GOT12", + "BFD_RELOC_FRV_FUNCDESC_GOTHI", + "BFD_RELOC_FRV_FUNCDESC_GOTLO", + "BFD_RELOC_FRV_FUNCDESC_VALUE", + "BFD_RELOC_FRV_FUNCDESC_GOTOFF12", + "BFD_RELOC_FRV_FUNCDESC_GOTOFFHI", + "BFD_RELOC_FRV_FUNCDESC_GOTOFFLO", + "BFD_RELOC_FRV_GOTOFF12", + "BFD_RELOC_FRV_GOTOFFHI", + "BFD_RELOC_FRV_GOTOFFLO", + + "BFD_RELOC_MN10300_GOTOFF24", + "BFD_RELOC_MN10300_GOT32", + "BFD_RELOC_MN10300_GOT24", + "BFD_RELOC_MN10300_GOT16", + "BFD_RELOC_MN10300_COPY", + "BFD_RELOC_MN10300_GLOB_DAT", + "BFD_RELOC_MN10300_JMP_SLOT", + "BFD_RELOC_MN10300_RELATIVE", "BFD_RELOC_386_GOT32", "BFD_RELOC_386_PLT32", @@ -819,6 +922,14 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_X86_64_RELATIVE", "BFD_RELOC_X86_64_GOTPCREL", "BFD_RELOC_X86_64_32S", + "BFD_RELOC_X86_64_DTPMOD64", + "BFD_RELOC_X86_64_DTPOFF64", + "BFD_RELOC_X86_64_TPOFF64", + "BFD_RELOC_X86_64_TLSGD", + "BFD_RELOC_X86_64_TLSLD", + "BFD_RELOC_X86_64_DTPOFF32", + "BFD_RELOC_X86_64_GOTTPOFF", + "BFD_RELOC_X86_64_TPOFF32", "BFD_RELOC_NS32K_IMM_8", "BFD_RELOC_NS32K_IMM_16", "BFD_RELOC_NS32K_IMM_32", @@ -892,6 +1003,46 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_PPC64_TOC16_LO_DS", "BFD_RELOC_PPC64_PLTGOT16_DS", "BFD_RELOC_PPC64_PLTGOT16_LO_DS", + "BFD_RELOC_PPC_TLS", + "BFD_RELOC_PPC_DTPMOD", + "BFD_RELOC_PPC_TPREL16", + "BFD_RELOC_PPC_TPREL16_LO", + "BFD_RELOC_PPC_TPREL16_HI", + "BFD_RELOC_PPC_TPREL16_HA", + "BFD_RELOC_PPC_TPREL", + "BFD_RELOC_PPC_DTPREL16", + "BFD_RELOC_PPC_DTPREL16_LO", + "BFD_RELOC_PPC_DTPREL16_HI", + "BFD_RELOC_PPC_DTPREL16_HA", + "BFD_RELOC_PPC_DTPREL", + "BFD_RELOC_PPC_GOT_TLSGD16", + "BFD_RELOC_PPC_GOT_TLSGD16_LO", + "BFD_RELOC_PPC_GOT_TLSGD16_HI", + "BFD_RELOC_PPC_GOT_TLSGD16_HA", + "BFD_RELOC_PPC_GOT_TLSLD16", + "BFD_RELOC_PPC_GOT_TLSLD16_LO", + "BFD_RELOC_PPC_GOT_TLSLD16_HI", + "BFD_RELOC_PPC_GOT_TLSLD16_HA", + "BFD_RELOC_PPC_GOT_TPREL16", + "BFD_RELOC_PPC_GOT_TPREL16_LO", + "BFD_RELOC_PPC_GOT_TPREL16_HI", + "BFD_RELOC_PPC_GOT_TPREL16_HA", + "BFD_RELOC_PPC_GOT_DTPREL16", + "BFD_RELOC_PPC_GOT_DTPREL16_LO", + "BFD_RELOC_PPC_GOT_DTPREL16_HI", + "BFD_RELOC_PPC_GOT_DTPREL16_HA", + "BFD_RELOC_PPC64_TPREL16_DS", + "BFD_RELOC_PPC64_TPREL16_LO_DS", + "BFD_RELOC_PPC64_TPREL16_HIGHER", + "BFD_RELOC_PPC64_TPREL16_HIGHERA", + "BFD_RELOC_PPC64_TPREL16_HIGHEST", + "BFD_RELOC_PPC64_TPREL16_HIGHESTA", + "BFD_RELOC_PPC64_DTPREL16_DS", + "BFD_RELOC_PPC64_DTPREL16_LO_DS", + "BFD_RELOC_PPC64_DTPREL16_HIGHER", + "BFD_RELOC_PPC64_DTPREL16_HIGHERA", + "BFD_RELOC_PPC64_DTPREL16_HIGHEST", + "BFD_RELOC_PPC64_DTPREL16_HIGHESTA", "BFD_RELOC_I370_D12", "BFD_RELOC_CTOR", "BFD_RELOC_ARM_PCREL_BRANCH", @@ -904,6 +1055,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_ARM_SWI", "BFD_RELOC_ARM_MULTI", "BFD_RELOC_ARM_CP_OFF_IMM", + "BFD_RELOC_ARM_CP_OFF_IMM_S2", "BFD_RELOC_ARM_ADR_IMM", "BFD_RELOC_ARM_LDR_IMM", "BFD_RELOC_ARM_LITERAL", @@ -997,6 +1149,14 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_SH_IMM_HI16", "BFD_RELOC_SH_IMM_HI16_PCREL", "BFD_RELOC_SH_PT_16", + "BFD_RELOC_SH_TLS_GD_32", + "BFD_RELOC_SH_TLS_LD_32", + "BFD_RELOC_SH_TLS_LDO_32", + "BFD_RELOC_SH_TLS_IE_32", + "BFD_RELOC_SH_TLS_LE_32", + "BFD_RELOC_SH_TLS_DTPMOD32", + "BFD_RELOC_SH_TLS_DTPOFF32", + "BFD_RELOC_SH_TLS_TPOFF32", "BFD_RELOC_THUMB_PCREL_BRANCH9", "BFD_RELOC_THUMB_PCREL_BRANCH12", "BFD_RELOC_THUMB_PCREL_BRANCH23", @@ -1028,6 +1188,20 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_M32R_HI16_SLO", "BFD_RELOC_M32R_LO16", "BFD_RELOC_M32R_SDA16", + "BFD_RELOC_M32R_GOT24", + "BFD_RELOC_M32R_26_PLTREL", + "BFD_RELOC_M32R_COPY", + "BFD_RELOC_M32R_GLOB_DAT", + "BFD_RELOC_M32R_JMP_SLOT", + "BFD_RELOC_M32R_RELATIVE", + "BFD_RELOC_M32R_GOTOFF", + "BFD_RELOC_M32R_GOTPC24", + "BFD_RELOC_M32R_GOT16_HI_ULO", + "BFD_RELOC_M32R_GOT16_HI_SLO", + "BFD_RELOC_M32R_GOT16_LO", + "BFD_RELOC_M32R_GOTPC_HI_ULO", + "BFD_RELOC_M32R_GOTPC_HI_SLO", + "BFD_RELOC_M32R_GOTPC_LO", "BFD_RELOC_V850_9_PCREL", "BFD_RELOC_V850_22_PCREL", "BFD_RELOC_V850_SDA_16_16_OFFSET", @@ -1044,7 +1218,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET", "BFD_RELOC_V850_CALLT_6_7_OFFSET", "BFD_RELOC_V850_CALLT_16_16_OFFSET", - + "BFD_RELOC_V850_LONGCALL", + "BFD_RELOC_V850_LONGJUMP", + "BFD_RELOC_V850_ALIGN", "BFD_RELOC_MN10300_32_PCREL", "BFD_RELOC_MN10300_16_PCREL", "BFD_RELOC_TIC30_LDP", @@ -1080,6 +1256,7 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_MMIX_PUSHJ_1", "BFD_RELOC_MMIX_PUSHJ_2", "BFD_RELOC_MMIX_PUSHJ_3", + "BFD_RELOC_MMIX_PUSHJ_STUBBABLE", "BFD_RELOC_MMIX_JMP", "BFD_RELOC_MMIX_JMP_1", "BFD_RELOC_MMIX_JMP_2", @@ -1123,6 +1300,53 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_390_GOT64", "BFD_RELOC_390_PLT64", "BFD_RELOC_390_GOTENT", + "BFD_RELOC_390_GOTOFF64", + "BFD_RELOC_390_GOTPLT12", + "BFD_RELOC_390_GOTPLT16", + "BFD_RELOC_390_GOTPLT32", + "BFD_RELOC_390_GOTPLT64", + "BFD_RELOC_390_GOTPLTENT", + "BFD_RELOC_390_PLTOFF16", + "BFD_RELOC_390_PLTOFF32", + "BFD_RELOC_390_PLTOFF64", + "BFD_RELOC_390_TLS_LOAD", + "BFD_RELOC_390_TLS_GDCALL", + "BFD_RELOC_390_TLS_LDCALL", + "BFD_RELOC_390_TLS_GD32", + "BFD_RELOC_390_TLS_GD64", + "BFD_RELOC_390_TLS_GOTIE12", + "BFD_RELOC_390_TLS_GOTIE32", + "BFD_RELOC_390_TLS_GOTIE64", + "BFD_RELOC_390_TLS_LDM32", + "BFD_RELOC_390_TLS_LDM64", + "BFD_RELOC_390_TLS_IE32", + "BFD_RELOC_390_TLS_IE64", + "BFD_RELOC_390_TLS_IEENT", + "BFD_RELOC_390_TLS_LE32", + "BFD_RELOC_390_TLS_LE64", + "BFD_RELOC_390_TLS_LDO32", + "BFD_RELOC_390_TLS_LDO64", + "BFD_RELOC_390_TLS_DTPMOD", + "BFD_RELOC_390_TLS_DTPOFF", + "BFD_RELOC_390_TLS_TPOFF", + "BFD_RELOC_390_20", + "BFD_RELOC_390_GOT20", + "BFD_RELOC_390_GOTPLT20", + "BFD_RELOC_390_TLS_GOTIE20", + "BFD_RELOC_IP2K_FR9", + "BFD_RELOC_IP2K_BANK", + "BFD_RELOC_IP2K_ADDR16CJP", + "BFD_RELOC_IP2K_PAGE3", + "BFD_RELOC_IP2K_LO8DATA", + "BFD_RELOC_IP2K_HI8DATA", + "BFD_RELOC_IP2K_EX8DATA", + "BFD_RELOC_IP2K_LO8INSN", + "BFD_RELOC_IP2K_HI8INSN", + "BFD_RELOC_IP2K_PC_SKIP", + "BFD_RELOC_IP2K_TEXT", + "BFD_RELOC_IP2K_FR_OFFSET", + "BFD_RELOC_VPE4KMATH_DATA", + "BFD_RELOC_VPE4KMATH_INSN", "BFD_RELOC_VTABLE_INHERIT", "BFD_RELOC_VTABLE_ENTRY", "BFD_RELOC_IA64_IMM14", @@ -1207,6 +1431,12 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_M68HC11_HI8", "BFD_RELOC_M68HC11_LO8", "BFD_RELOC_M68HC11_3B", + "BFD_RELOC_M68HC11_RL_JUMP", + "BFD_RELOC_M68HC11_RL_GROUP", + "BFD_RELOC_M68HC11_LO16", + "BFD_RELOC_M68HC11_PAGE", + "BFD_RELOC_M68HC11_24", + "BFD_RELOC_M68HC12_5B", "BFD_RELOC_CRIS_BDISP8", "BFD_RELOC_CRIS_UNSIGNED_5", "BFD_RELOC_CRIS_SIGNED_6", @@ -1263,53 +1493,68 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@", "BFD_RELOC_H8_DIR24R8", "BFD_RELOC_H8_DIR32A16", "BFD_RELOC_XSTORMY16_REL_12", + "BFD_RELOC_XSTORMY16_12", "BFD_RELOC_XSTORMY16_24", "BFD_RELOC_XSTORMY16_FPTR16", "BFD_RELOC_VAX_GLOB_DAT", "BFD_RELOC_VAX_JMP_SLOT", "BFD_RELOC_VAX_RELATIVE", + "BFD_RELOC_MSP430_10_PCREL", + "BFD_RELOC_MSP430_16_PCREL", + "BFD_RELOC_MSP430_16", + "BFD_RELOC_MSP430_16_PCREL_BYTE", + "BFD_RELOC_MSP430_16_BYTE", + "BFD_RELOC_IQ2000_OFFSET_16", + "BFD_RELOC_IQ2000_OFFSET_21", + "BFD_RELOC_IQ2000_UHI16", + "BFD_RELOC_XTENSA_RTLD", + "BFD_RELOC_XTENSA_GLOB_DAT", + "BFD_RELOC_XTENSA_JMP_SLOT", + "BFD_RELOC_XTENSA_RELATIVE", + "BFD_RELOC_XTENSA_PLT", + "BFD_RELOC_XTENSA_OP0", + "BFD_RELOC_XTENSA_OP1", + "BFD_RELOC_XTENSA_OP2", + "BFD_RELOC_XTENSA_ASM_EXPAND", + "BFD_RELOC_XTENSA_ASM_SIMPLIFY", "@@overflow: BFD_RELOC_UNUSED@@", }; #endif -reloc_howto_type * -bfd_default_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); +reloc_howto_type *bfd_default_reloc_type_lookup + (bfd *abfd, bfd_reloc_code_real_type code); -boolean -bfd_generic_relax_section PARAMS ((bfd *abfd, +bfd_boolean bfd_generic_relax_section + (bfd *abfd, asection *section, struct bfd_link_info *, - boolean *)); + bfd_boolean *); -boolean -bfd_generic_gc_sections PARAMS ((bfd *, struct bfd_link_info *)); +bfd_boolean bfd_generic_gc_sections + (bfd *, struct bfd_link_info *); -boolean -bfd_generic_merge_sections PARAMS ((bfd *, struct bfd_link_info *)); +bfd_boolean bfd_generic_merge_sections + (bfd *, struct bfd_link_info *); -bfd_byte * -bfd_generic_get_relocated_section_contents PARAMS ((bfd *abfd, +bfd_byte *bfd_generic_get_relocated_section_contents + (bfd *abfd, struct bfd_link_info *link_info, struct bfd_link_order *link_order, bfd_byte *data, - boolean relocateable, - asymbol **symbols)); + bfd_boolean relocatable, + asymbol **symbols); /* Extracted from archures.c. */ extern const bfd_arch_info_type bfd_default_arch_struct; -boolean -bfd_default_set_arch_mach PARAMS ((bfd *abfd, - enum bfd_architecture arch, - unsigned long mach)); +bfd_boolean bfd_default_set_arch_mach + (bfd *abfd, enum bfd_architecture arch, unsigned long mach); -const bfd_arch_info_type * -bfd_default_compatible PARAMS ((const bfd_arch_info_type *a, - const bfd_arch_info_type *b)); +const bfd_arch_info_type *bfd_default_compatible + (const bfd_arch_info_type *a, const bfd_arch_info_type *b); -boolean -bfd_default_scan PARAMS ((const struct bfd_arch_info *info, const char *string)); +bfd_boolean bfd_default_scan + (const struct bfd_arch_info *info, const char *string); /* Extracted from elf.c. */ -struct elf_internal_shdr * -bfd_elf_find_section PARAMS ((bfd *abfd, char *name)); +struct elf_internal_shdr *bfd_elf_find_section (bfd *abfd, char *name); diff --git a/contrib/binutils/bfd/libcoff-in.h b/contrib/binutils/bfd/libcoff-in.h index efc2fee..6b5947c 100644 --- a/contrib/binutils/bfd/libcoff-in.h +++ b/contrib/binutils/bfd/libcoff-in.h @@ -1,6 +1,6 @@ /* BFD COFF object file private structure. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. @@ -74,16 +74,16 @@ typedef struct coff_tdata /* The unswapped external symbols. May be NULL. Read by _bfd_coff_get_external_symbols. */ PTR external_syms; - /* If this is true, the external_syms may not be freed. */ - boolean keep_syms; + /* If this is TRUE, the external_syms may not be freed. */ + bfd_boolean keep_syms; /* The string table. May be NULL. Read by _bfd_coff_read_string_table. */ 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; + /* If this is TRUE, the strings may not be freed. */ + bfd_boolean keep_strings; + /* If this is TRUE, the strings have been written out already. */ + bfd_boolean strings_written; /* is this a PE format coff file */ int pe; @@ -117,10 +117,10 @@ typedef struct pe_tdata struct internal_extra_pe_aouthdr pe_opthdr; int dll; int has_reloc_section; - boolean (*in_reloc_p) PARAMS((bfd *, reloc_howto_type *)); + bfd_boolean (*in_reloc_p) PARAMS((bfd *, reloc_howto_type *)); flagword real_flags; int target_subsystem; - boolean force_minimum_alignment; + bfd_boolean force_minimum_alignment; } pe_data_type; #define pe_data(bfd) ((bfd)->tdata.pe_obj_data) @@ -132,11 +132,11 @@ struct xcoff_tdata /* Basic COFF information. */ coff_data_type coff; - /* True if this is an XCOFF64 file. */ - boolean xcoff64; + /* TRUE if this is an XCOFF64 file. */ + bfd_boolean xcoff64; - /* True if a large a.out header should be generated. */ - boolean full_aouthdr; + /* TRUE if a large a.out header should be generated. */ + bfd_boolean full_aouthdr; /* TOC value. */ bfd_vma toc; @@ -184,12 +184,12 @@ struct coff_section_tdata { /* The relocs, swapped into COFF internal form. This may be NULL. */ struct internal_reloc *relocs; - /* If this is true, the relocs entry may not be freed. */ - boolean keep_relocs; + /* If this is TRUE, the relocs entry may not be freed. */ + bfd_boolean keep_relocs; /* The section contents. This may be NULL. */ bfd_byte *contents; - /* If this is true, the contents entry may not be freed. */ - boolean keep_contents; + /* If this is TRUE, the contents entry may not be freed. */ + bfd_boolean keep_contents; /* Information cached by coff_find_nearest_line. */ bfd_vma offset; unsigned int i; @@ -291,7 +291,7 @@ struct coff_link_hash_table #define coff_link_hash_traverse(table, func, info) \ (bfd_link_hash_traverse \ (&(table)->root, \ - (boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \ (info))) /* Get the COFF linker hash table from a link_info structure. */ @@ -301,33 +301,33 @@ struct coff_link_hash_table /* Functions in coffgen.c. */ extern const bfd_target *coff_object_p PARAMS ((bfd *)); -extern struct sec *coff_section_from_bfd_index +extern struct bfd_section *coff_section_from_bfd_index PARAMS ((bfd *, int)); extern long coff_get_symtab_upper_bound PARAMS ((bfd *)); -extern long coff_get_symtab +extern long coff_canonicalize_symtab PARAMS ((bfd *, asymbol **)); extern int coff_count_linenumbers PARAMS ((bfd *)); extern struct coff_symbol_struct *coff_symbol_from PARAMS ((bfd *, asymbol *)); -extern boolean coff_renumber_symbols +extern bfd_boolean coff_renumber_symbols PARAMS ((bfd *, int *)); extern void coff_mangle_symbols PARAMS ((bfd *)); -extern boolean coff_write_symbols +extern bfd_boolean coff_write_symbols PARAMS ((bfd *)); -extern boolean coff_write_linenumbers +extern bfd_boolean coff_write_linenumbers PARAMS ((bfd *)); extern alent *coff_get_lineno PARAMS ((bfd *, asymbol *)); extern asymbol *coff_section_symbol PARAMS ((bfd *, char *)); -extern boolean _bfd_coff_get_external_symbols +extern bfd_boolean _bfd_coff_get_external_symbols PARAMS ((bfd *)); extern const char *_bfd_coff_read_string_table PARAMS ((bfd *)); -extern boolean _bfd_coff_free_symbols +extern bfd_boolean _bfd_coff_free_symbols PARAMS ((bfd *)); extern struct coff_ptr_struct *coff_get_normalized_symtab PARAMS ((bfd *)); @@ -339,20 +339,20 @@ extern void coff_print_symbol PARAMS ((bfd *, PTR filep, asymbol *, bfd_print_symbol_type)); extern void coff_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *ret)); -extern boolean _bfd_coff_is_local_label_name +extern bfd_boolean _bfd_coff_is_local_label_name PARAMS ((bfd *, const char *)); extern asymbol *coff_bfd_make_debug_symbol PARAMS ((bfd *, PTR, unsigned long)); -extern boolean coff_find_nearest_line +extern bfd_boolean coff_find_nearest_line PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *)); extern int coff_sizeof_headers - PARAMS ((bfd *, boolean)); -extern boolean bfd_coff_reloc16_relax_section - PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); + PARAMS ((bfd *, bfd_boolean)); +extern bfd_boolean bfd_coff_reloc16_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *)); extern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, boolean, asymbol **)); + bfd_byte *, bfd_boolean, asymbol **)); extern bfd_vma bfd_coff_reloc16_get_value PARAMS ((arelent *, struct bfd_link_info *, asection *)); extern void bfd_perform_slip @@ -434,7 +434,7 @@ struct coff_debug_merge_hash_table bfd_hash_lookup (&(table)->root, (string), (create), (copy))) /* Information we keep for each section in the output file when doing - a relocateable link. */ + a relocatable link. */ struct coff_link_section_info { @@ -454,14 +454,14 @@ struct coff_final_link_info /* Output BFD. */ bfd *output_bfd; /* Used to indicate failure in traversal routine. */ - boolean failed; + bfd_boolean failed; /* If doing "task linking" set only during the time when we want the global symbol writer to convert the storage class of defined global symbols from global to static. */ - boolean global_to_static; + bfd_boolean global_to_static; /* Hash table for long symbol names. */ struct bfd_strtab_hash *strtab; - /* When doing a relocateable link, an array of information kept for + /* When doing a relocatable link, an array of information kept for each output section, indexed by the target_index field. */ struct coff_link_section_info *section_info; /* Symbol index of last C_FILE symbol (-1 if none). */ @@ -532,7 +532,7 @@ struct coff_section_alignment_entry extern struct bfd_hash_entry *_bfd_coff_link_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -extern boolean _bfd_coff_link_hash_table_init +extern bfd_boolean _bfd_coff_link_hash_table_init PARAMS ((struct coff_link_hash_table *, bfd *, struct bfd_hash_entry *(*) (struct bfd_hash_entry *, struct bfd_hash_table *, @@ -541,26 +541,26 @@ extern struct bfd_link_hash_table *_bfd_coff_link_hash_table_create PARAMS ((bfd *)); extern const char *_bfd_coff_internal_syment_name PARAMS ((bfd *, const struct internal_syment *, char *)); -extern boolean _bfd_coff_link_add_symbols +extern bfd_boolean _bfd_coff_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean _bfd_coff_final_link +extern bfd_boolean _bfd_coff_final_link PARAMS ((bfd *, struct bfd_link_info *)); extern struct internal_reloc *_bfd_coff_read_internal_relocs - PARAMS ((bfd *, asection *, boolean, bfd_byte *, boolean, + PARAMS ((bfd *, asection *, bfd_boolean, bfd_byte *, bfd_boolean, struct internal_reloc *)); -extern boolean _bfd_coff_generic_relocate_section +extern bfd_boolean _bfd_coff_generic_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **)); extern struct bfd_hash_entry *_bfd_coff_debug_merge_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -extern boolean _bfd_coff_write_global_sym +extern bfd_boolean _bfd_coff_write_global_sym PARAMS ((struct coff_link_hash_entry *, PTR)); -extern boolean _bfd_coff_write_task_globals +extern bfd_boolean _bfd_coff_write_task_globals PARAMS ((struct coff_link_hash_entry *, PTR)); -extern boolean _bfd_coff_link_input_bfd +extern bfd_boolean _bfd_coff_link_input_bfd PARAMS ((struct coff_final_link_info *, bfd *)); -extern boolean _bfd_coff_reloc_link_order +extern bfd_boolean _bfd_coff_reloc_link_order PARAMS ((bfd *, struct coff_final_link_info *, asection *, struct bfd_link_order *)); @@ -582,19 +582,19 @@ extern struct bfd_link_hash_table *_bfd_xcoff_bfd_link_hash_table_create PARAMS ((bfd *)); extern void _bfd_xcoff_bfd_link_hash_table_free PARAMS ((struct bfd_link_hash_table *)); -extern boolean _bfd_xcoff_bfd_link_add_symbols +extern bfd_boolean _bfd_xcoff_bfd_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean _bfd_xcoff_bfd_final_link +extern bfd_boolean _bfd_xcoff_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean _bfd_ppc_xcoff_relocate_section +extern bfd_boolean _bfd_ppc_xcoff_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **)); /* Functions in coff-ppc.c. FIXME: These are called be pe.em in the linker, and so should start with bfd and be declared in bfd.h. */ -extern boolean ppc_allocate_toc_section +extern bfd_boolean ppc_allocate_toc_section PARAMS ((struct bfd_link_info *)); -extern boolean ppc_process_before_allocation +extern bfd_boolean ppc_process_before_allocation PARAMS ((bfd *, struct bfd_link_info *)); diff --git a/contrib/binutils/bfd/libcoff.h b/contrib/binutils/bfd/libcoff.h index ea9c570..5771132 100644 --- a/contrib/binutils/bfd/libcoff.h +++ b/contrib/binutils/bfd/libcoff.h @@ -4,7 +4,7 @@ /* BFD COFF object file private structure. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. @@ -78,16 +78,16 @@ typedef struct coff_tdata /* The unswapped external symbols. May be NULL. Read by _bfd_coff_get_external_symbols. */ PTR external_syms; - /* If this is true, the external_syms may not be freed. */ - boolean keep_syms; + /* If this is TRUE, the external_syms may not be freed. */ + bfd_boolean keep_syms; /* The string table. May be NULL. Read by _bfd_coff_read_string_table. */ 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; + /* If this is TRUE, the strings may not be freed. */ + bfd_boolean keep_strings; + /* If this is TRUE, the strings have been written out already. */ + bfd_boolean strings_written; /* is this a PE format coff file */ int pe; @@ -121,10 +121,10 @@ typedef struct pe_tdata struct internal_extra_pe_aouthdr pe_opthdr; int dll; int has_reloc_section; - boolean (*in_reloc_p) PARAMS((bfd *, reloc_howto_type *)); + bfd_boolean (*in_reloc_p) PARAMS((bfd *, reloc_howto_type *)); flagword real_flags; int target_subsystem; - boolean force_minimum_alignment; + bfd_boolean force_minimum_alignment; } pe_data_type; #define pe_data(bfd) ((bfd)->tdata.pe_obj_data) @@ -136,11 +136,11 @@ struct xcoff_tdata /* Basic COFF information. */ coff_data_type coff; - /* True if this is an XCOFF64 file. */ - boolean xcoff64; + /* TRUE if this is an XCOFF64 file. */ + bfd_boolean xcoff64; - /* True if a large a.out header should be generated. */ - boolean full_aouthdr; + /* TRUE if a large a.out header should be generated. */ + bfd_boolean full_aouthdr; /* TOC value. */ bfd_vma toc; @@ -188,12 +188,12 @@ struct coff_section_tdata { /* The relocs, swapped into COFF internal form. This may be NULL. */ struct internal_reloc *relocs; - /* If this is true, the relocs entry may not be freed. */ - boolean keep_relocs; + /* If this is TRUE, the relocs entry may not be freed. */ + bfd_boolean keep_relocs; /* The section contents. This may be NULL. */ bfd_byte *contents; - /* If this is true, the contents entry may not be freed. */ - boolean keep_contents; + /* If this is TRUE, the contents entry may not be freed. */ + bfd_boolean keep_contents; /* Information cached by coff_find_nearest_line. */ bfd_vma offset; unsigned int i; @@ -295,7 +295,7 @@ struct coff_link_hash_table #define coff_link_hash_traverse(table, func, info) \ (bfd_link_hash_traverse \ (&(table)->root, \ - (boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) PARAMS ((struct bfd_link_hash_entry *, PTR))) (func), \ (info))) /* Get the COFF linker hash table from a link_info structure. */ @@ -305,33 +305,33 @@ struct coff_link_hash_table /* Functions in coffgen.c. */ extern const bfd_target *coff_object_p PARAMS ((bfd *)); -extern struct sec *coff_section_from_bfd_index +extern struct bfd_section *coff_section_from_bfd_index PARAMS ((bfd *, int)); extern long coff_get_symtab_upper_bound PARAMS ((bfd *)); -extern long coff_get_symtab +extern long coff_canonicalize_symtab PARAMS ((bfd *, asymbol **)); extern int coff_count_linenumbers PARAMS ((bfd *)); extern struct coff_symbol_struct *coff_symbol_from PARAMS ((bfd *, asymbol *)); -extern boolean coff_renumber_symbols +extern bfd_boolean coff_renumber_symbols PARAMS ((bfd *, int *)); extern void coff_mangle_symbols PARAMS ((bfd *)); -extern boolean coff_write_symbols +extern bfd_boolean coff_write_symbols PARAMS ((bfd *)); -extern boolean coff_write_linenumbers +extern bfd_boolean coff_write_linenumbers PARAMS ((bfd *)); extern alent *coff_get_lineno PARAMS ((bfd *, asymbol *)); extern asymbol *coff_section_symbol PARAMS ((bfd *, char *)); -extern boolean _bfd_coff_get_external_symbols +extern bfd_boolean _bfd_coff_get_external_symbols PARAMS ((bfd *)); extern const char *_bfd_coff_read_string_table PARAMS ((bfd *)); -extern boolean _bfd_coff_free_symbols +extern bfd_boolean _bfd_coff_free_symbols PARAMS ((bfd *)); extern struct coff_ptr_struct *coff_get_normalized_symtab PARAMS ((bfd *)); @@ -343,20 +343,20 @@ extern void coff_print_symbol PARAMS ((bfd *, PTR filep, asymbol *, bfd_print_symbol_type)); extern void coff_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *ret)); -extern boolean _bfd_coff_is_local_label_name +extern bfd_boolean _bfd_coff_is_local_label_name PARAMS ((bfd *, const char *)); extern asymbol *coff_bfd_make_debug_symbol PARAMS ((bfd *, PTR, unsigned long)); -extern boolean coff_find_nearest_line +extern bfd_boolean coff_find_nearest_line PARAMS ((bfd *, asection *, asymbol **, bfd_vma, const char **, const char **, unsigned int *)); extern int coff_sizeof_headers - PARAMS ((bfd *, boolean)); -extern boolean bfd_coff_reloc16_relax_section - PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); + PARAMS ((bfd *, bfd_boolean)); +extern bfd_boolean bfd_coff_reloc16_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, bfd_boolean *)); extern bfd_byte *bfd_coff_reloc16_get_relocated_section_contents PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, - bfd_byte *, boolean, asymbol **)); + bfd_byte *, bfd_boolean, asymbol **)); extern bfd_vma bfd_coff_reloc16_get_value PARAMS ((arelent *, struct bfd_link_info *, asection *)); extern void bfd_perform_slip @@ -438,7 +438,7 @@ struct coff_debug_merge_hash_table bfd_hash_lookup (&(table)->root, (string), (create), (copy))) /* Information we keep for each section in the output file when doing - a relocateable link. */ + a relocatable link. */ struct coff_link_section_info { @@ -458,14 +458,14 @@ struct coff_final_link_info /* Output BFD. */ bfd *output_bfd; /* Used to indicate failure in traversal routine. */ - boolean failed; + bfd_boolean failed; /* If doing "task linking" set only during the time when we want the global symbol writer to convert the storage class of defined global symbols from global to static. */ - boolean global_to_static; + bfd_boolean global_to_static; /* Hash table for long symbol names. */ struct bfd_strtab_hash *strtab; - /* When doing a relocateable link, an array of information kept for + /* When doing a relocatable link, an array of information kept for each output section, indexed by the target_index field. */ struct coff_link_section_info *section_info; /* Symbol index of last C_FILE symbol (-1 if none). */ @@ -536,7 +536,7 @@ struct coff_section_alignment_entry extern struct bfd_hash_entry *_bfd_coff_link_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -extern boolean _bfd_coff_link_hash_table_init +extern bfd_boolean _bfd_coff_link_hash_table_init PARAMS ((struct coff_link_hash_table *, bfd *, struct bfd_hash_entry *(*) (struct bfd_hash_entry *, struct bfd_hash_table *, @@ -545,26 +545,26 @@ extern struct bfd_link_hash_table *_bfd_coff_link_hash_table_create PARAMS ((bfd *)); extern const char *_bfd_coff_internal_syment_name PARAMS ((bfd *, const struct internal_syment *, char *)); -extern boolean _bfd_coff_link_add_symbols +extern bfd_boolean _bfd_coff_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean _bfd_coff_final_link +extern bfd_boolean _bfd_coff_final_link PARAMS ((bfd *, struct bfd_link_info *)); extern struct internal_reloc *_bfd_coff_read_internal_relocs - PARAMS ((bfd *, asection *, boolean, bfd_byte *, boolean, + PARAMS ((bfd *, asection *, bfd_boolean, bfd_byte *, bfd_boolean, struct internal_reloc *)); -extern boolean _bfd_coff_generic_relocate_section +extern bfd_boolean _bfd_coff_generic_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **)); extern struct bfd_hash_entry *_bfd_coff_debug_merge_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -extern boolean _bfd_coff_write_global_sym +extern bfd_boolean _bfd_coff_write_global_sym PARAMS ((struct coff_link_hash_entry *, PTR)); -extern boolean _bfd_coff_write_task_globals +extern bfd_boolean _bfd_coff_write_task_globals PARAMS ((struct coff_link_hash_entry *, PTR)); -extern boolean _bfd_coff_link_input_bfd +extern bfd_boolean _bfd_coff_link_input_bfd PARAMS ((struct coff_final_link_info *, bfd *)); -extern boolean _bfd_coff_reloc_link_order +extern bfd_boolean _bfd_coff_reloc_link_order PARAMS ((bfd *, struct coff_final_link_info *, asection *, struct bfd_link_order *)); @@ -586,20 +586,20 @@ extern struct bfd_link_hash_table *_bfd_xcoff_bfd_link_hash_table_create PARAMS ((bfd *)); extern void _bfd_xcoff_bfd_link_hash_table_free PARAMS ((struct bfd_link_hash_table *)); -extern boolean _bfd_xcoff_bfd_link_add_symbols +extern bfd_boolean _bfd_xcoff_bfd_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean _bfd_xcoff_bfd_final_link +extern bfd_boolean _bfd_xcoff_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *)); -extern boolean _bfd_ppc_xcoff_relocate_section +extern bfd_boolean _bfd_ppc_xcoff_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **)); /* Functions in coff-ppc.c. FIXME: These are called be pe.em in the linker, and so should start with bfd and be declared in bfd.h. */ -extern boolean ppc_allocate_toc_section +extern bfd_boolean ppc_allocate_toc_section PARAMS ((struct bfd_link_info *)); -extern boolean ppc_process_before_allocation +extern bfd_boolean ppc_process_before_allocation PARAMS ((bfd *, struct bfd_link_info *)); /* Extracted from coffcode.h. */ @@ -653,7 +653,7 @@ typedef struct coff_symbol_struct struct lineno_cache_entry *lineno; /* Have the line numbers been relocated yet ? */ - boolean done_lineno; + bfd_boolean done_lineno; } coff_symbol_type; /* COFF symbol classifications. */ @@ -711,10 +711,10 @@ typedef struct unsigned int _bfd_relsz; unsigned int _bfd_linesz; unsigned int _bfd_filnmlen; - boolean _bfd_coff_long_filenames; - boolean _bfd_coff_long_section_names; + bfd_boolean _bfd_coff_long_filenames; + bfd_boolean _bfd_coff_long_section_names; unsigned int _bfd_coff_default_section_alignment_power; - boolean _bfd_coff_force_symnames_in_strings; + bfd_boolean _bfd_coff_force_symnames_in_strings; unsigned int _bfd_coff_debug_string_prefix_length; void (*_bfd_coff_swap_filehdr_in) @@ -729,32 +729,32 @@ typedef struct void (*_bfd_coff_swap_reloc_in) PARAMS ((bfd *abfd, PTR, PTR)); - boolean (*_bfd_coff_bad_format_hook) + bfd_boolean (*_bfd_coff_bad_format_hook) PARAMS ((bfd *, PTR)); - boolean (*_bfd_coff_set_arch_mach_hook) + bfd_boolean (*_bfd_coff_set_arch_mach_hook) PARAMS ((bfd *, PTR)); PTR (*_bfd_coff_mkobject_hook) PARAMS ((bfd *, PTR, PTR)); - boolean (*_bfd_styp_to_sec_flags_hook) + bfd_boolean (*_bfd_styp_to_sec_flags_hook) PARAMS ((bfd *, PTR, const char *, asection *, flagword *)); void (*_bfd_set_alignment_hook) PARAMS ((bfd *, asection *, PTR)); - boolean (*_bfd_coff_slurp_symbol_table) + bfd_boolean (*_bfd_coff_slurp_symbol_table) PARAMS ((bfd *)); - boolean (*_bfd_coff_symname_in_debug) + bfd_boolean (*_bfd_coff_symname_in_debug) PARAMS ((bfd *, struct internal_syment *)); - boolean (*_bfd_coff_pointerize_aux_hook) + bfd_boolean (*_bfd_coff_pointerize_aux_hook) PARAMS ((bfd *, combined_entry_type *, combined_entry_type *, unsigned int, combined_entry_type *)); - boolean (*_bfd_coff_print_aux) + bfd_boolean (*_bfd_coff_print_aux) PARAMS ((bfd *, FILE *, combined_entry_type *, combined_entry_type *, combined_entry_type *, unsigned int)); @@ -769,13 +769,13 @@ typedef struct enum coff_symbol_classification (*_bfd_coff_classify_symbol) PARAMS ((bfd *, struct internal_syment *)); - boolean (*_bfd_coff_compute_section_file_positions) + bfd_boolean (*_bfd_coff_compute_section_file_positions) PARAMS ((bfd *)); - boolean (*_bfd_coff_start_final_link) + bfd_boolean (*_bfd_coff_start_final_link) PARAMS ((bfd *, struct bfd_link_info *)); - boolean (*_bfd_coff_relocate_section) + bfd_boolean (*_bfd_coff_relocate_section) PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, struct internal_reloc *, struct internal_syment *, asection **)); @@ -784,19 +784,19 @@ typedef struct struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *)); - boolean (*_bfd_coff_adjust_symndx) + bfd_boolean (*_bfd_coff_adjust_symndx) PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, - struct internal_reloc *, boolean *)); + struct internal_reloc *, bfd_boolean *)); - boolean (*_bfd_coff_link_add_one_symbol) + bfd_boolean (*_bfd_coff_link_add_one_symbol) PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, - asection *, bfd_vma, const char *, boolean, boolean, + asection *, bfd_vma, const char *, bfd_boolean, bfd_boolean, struct bfd_link_hash_entry **)); - boolean (*_bfd_coff_link_output_has_begun) + bfd_boolean (*_bfd_coff_link_output_has_begun) PARAMS ((bfd *, struct coff_final_link_info *)); - boolean (*_bfd_coff_final_link_postscript) + bfd_boolean (*_bfd_coff_final_link_postscript) PARAMS ((bfd *, struct coff_final_link_info *)); } bfd_coff_backend_data; @@ -866,7 +866,8 @@ typedef struct #define bfd_coff_set_arch_mach_hook(abfd, filehdr)\ ((coff_backend_info (abfd)->_bfd_coff_set_arch_mach_hook) (abfd, filehdr)) #define bfd_coff_mkobject_hook(abfd, filehdr, aouthdr)\ - ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook) (abfd, filehdr, aouthdr)) + ((coff_backend_info (abfd)->_bfd_coff_mkobject_hook)\ + (abfd, filehdr, aouthdr)) #define bfd_coff_styp_to_sec_flags_hook(abfd, scnhdr, name, section, flags_ptr)\ ((coff_backend_info (abfd)->_bfd_styp_to_sec_flags_hook)\ @@ -891,7 +892,8 @@ typedef struct ((coff_backend_info (abfd)->_bfd_coff_print_aux)\ (abfd, file, base, symbol, aux, indaux)) -#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)\ +#define bfd_coff_reloc16_extra_cases(abfd, link_info, link_order,\ + reloc, data, src_ptr, dst_ptr)\ ((coff_backend_info (abfd)->_bfd_coff_reloc16_extra_cases)\ (abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr)) @@ -919,7 +921,8 @@ typedef struct #define bfd_coff_adjust_symndx(obfd, info, ibfd, sec, rel, adjustedp)\ ((coff_backend_info (abfd)->_bfd_coff_adjust_symndx)\ (obfd, info, ibfd, sec, rel, adjustedp)) -#define bfd_coff_link_add_one_symbol(info,abfd,name,flags,section,value,string,cp,coll,hashp)\ +#define bfd_coff_link_add_one_symbol(info, abfd, name, flags, section,\ + value, string, cp, coll, hashp)\ ((coff_backend_info (abfd)->_bfd_coff_link_add_one_symbol)\ (info, abfd, name, flags, section, value, string, cp, coll, hashp)) diff --git a/contrib/binutils/bfd/libecoff.h b/contrib/binutils/bfd/libecoff.h index eb90a8c..161f06c 100644 --- a/contrib/binutils/bfd/libecoff.h +++ b/contrib/binutils/bfd/libecoff.h @@ -1,5 +1,5 @@ /* BFD ECOFF object file private structure. - Copyright 1993, 1994, 1995, 1996, 1999, 2001, 2002 + Copyright 1993, 1994, 1995, 1996, 1999, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. @@ -44,10 +44,10 @@ struct ecoff_backend_data /* The page boundary used to align sections in a demand-paged executable file. E.g., 0x1000. */ bfd_vma round; - /* True if the .rdata section is part of the text segment, as on the - Alpha. False if .rdata is part of the data segment, as on the + /* TRUE if the .rdata section is part of the text segment, as on the + Alpha. FALSE if .rdata is part of the data segment, as on the MIPS. */ - boolean rdata_in_text; + bfd_boolean rdata_in_text; /* Bitsize of constructor entries. */ unsigned int constructor_bitsize; /* Reloc to use for constructor entries. */ @@ -60,18 +60,18 @@ struct ecoff_backend_data void (*swap_reloc_in) PARAMS ((bfd *, PTR, struct internal_reloc *)); void (*swap_reloc_out) PARAMS ((bfd *, const struct internal_reloc *, PTR)); /* Backend reloc tweaking. */ - void (*adjust_reloc_in) PARAMS ((bfd *, const struct internal_reloc *, - arelent *)); - void (*adjust_reloc_out) PARAMS ((bfd *, const arelent *, - struct internal_reloc *)); + void (*adjust_reloc_in) + PARAMS ((bfd *, const struct internal_reloc *, arelent *)); + void (*adjust_reloc_out) + PARAMS ((bfd *, const arelent *, struct internal_reloc *)); /* Relocate section contents while linking. */ - boolean (*relocate_section) PARAMS ((bfd *output_bfd, struct bfd_link_info *, - bfd *input_bfd, asection *input_section, - bfd_byte *contents, - PTR external_relocs)); + bfd_boolean (*relocate_section) + PARAMS ((bfd *output_bfd, struct bfd_link_info *, bfd *input_bfd, + asection *input_section, bfd_byte *contents, + PTR external_relocs)); /* Do final adjustments to filehdr and aouthdr. */ - boolean (*adjust_headers) PARAMS ((bfd *, struct internal_filehdr *, - struct internal_aouthdr *)); + bfd_boolean (*adjust_headers) + PARAMS ((bfd *, struct internal_filehdr *, struct internal_aouthdr *)); /* Read an element from an archive at a given file position. This is needed because OSF/1 3.2 uses a weird archive format. */ bfd *(*get_elt_at_filepos) PARAMS ((bfd *, file_ptr)); @@ -128,12 +128,12 @@ typedef struct ecoff_tdata linking. */ asection **symndx_to_section; - /* True if this BFD was written by the backend linker. */ - boolean linker; + /* TRUE if this BFD was written by the backend linker. */ + bfd_boolean linker; - /* True if a warning that multiple global pointer values are + /* TRUE if a warning that multiple global pointer values are needed in the output binary was issued already. */ - boolean issued_multiple_gp_warning; + bfd_boolean issued_multiple_gp_warning; /* Used by find_nearest_line entry point. The structure could be included directly in this one, but there's no point to wasting @@ -143,7 +143,7 @@ typedef struct ecoff_tdata /* Whether the .rdata section is in the text segment for this particular ECOFF file. This is not valid until ecoff_compute_section_file_positions is called. */ - boolean rdata_in_text; + bfd_boolean rdata_in_text; } ecoff_data_type; @@ -157,8 +157,8 @@ typedef struct ecoff_symbol_struct /* The fdr for this symbol. */ FDR *fdr; - /* true if this is a local symbol rather than an external one. */ - boolean local; + /* TRUE if this is a local symbol rather than an external one. */ + bfd_boolean local; /* A pointer to the unswapped hidden information for this symbol. This is either a struct sym_ext or a struct ext_ext, depending on @@ -249,27 +249,28 @@ struct ecoff_link_hash_table }; /* Make an ECOFF object. */ -extern boolean _bfd_ecoff_mkobject PARAMS ((bfd *)); +extern bfd_boolean _bfd_ecoff_mkobject PARAMS ((bfd *)); /* Read in the ECOFF symbolic debugging information. */ -extern boolean _bfd_ecoff_slurp_symbolic_info +extern bfd_boolean _bfd_ecoff_slurp_symbolic_info PARAMS ((bfd *, asection *, struct ecoff_debug_info *)); /* Generic ECOFF BFD backend vectors. */ -extern boolean _bfd_ecoff_write_object_contents PARAMS ((bfd *abfd)); +extern bfd_boolean _bfd_ecoff_write_object_contents PARAMS ((bfd *abfd)); extern const bfd_target *_bfd_ecoff_archive_p PARAMS ((bfd *abfd)); #define _bfd_ecoff_close_and_cleanup _bfd_generic_close_and_cleanup #define _bfd_ecoff_bfd_free_cached_info _bfd_generic_bfd_free_cached_info -extern boolean _bfd_ecoff_new_section_hook +extern bfd_boolean _bfd_ecoff_new_section_hook PARAMS ((bfd *, asection *)); -extern boolean _bfd_ecoff_get_section_contents +extern bfd_boolean _bfd_ecoff_get_section_contents PARAMS ((bfd *, asection *, PTR location, file_ptr, bfd_size_type)); #define _bfd_ecoff_bfd_link_split_section _bfd_generic_link_split_section -extern boolean _bfd_ecoff_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *)); +extern bfd_boolean _bfd_ecoff_bfd_copy_private_bfd_data + PARAMS ((bfd *, bfd *)); #define _bfd_ecoff_bfd_copy_private_section_data \ _bfd_generic_bfd_copy_private_section_data @@ -283,12 +284,12 @@ extern boolean _bfd_ecoff_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *)); _bfd_generic_bfd_merge_private_bfd_data #define _bfd_ecoff_bfd_set_private_flags _bfd_generic_bfd_set_private_flags -extern boolean _bfd_ecoff_slurp_armap PARAMS ((bfd *abfd)); +extern bfd_boolean _bfd_ecoff_slurp_armap PARAMS ((bfd *abfd)); #define _bfd_ecoff_slurp_extended_name_table _bfd_slurp_extended_name_table #define _bfd_ecoff_construct_extended_name_table \ _bfd_archive_bsd_construct_extended_name_table #define _bfd_ecoff_truncate_arname bfd_dont_truncate_arname -extern boolean _bfd_ecoff_write_armap +extern bfd_boolean _bfd_ecoff_write_armap PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); #define _bfd_ecoff_read_ar_hdr _bfd_generic_read_ar_hdr #define _bfd_ecoff_openr_next_archived_file \ @@ -298,16 +299,16 @@ extern boolean _bfd_ecoff_write_armap #define _bfd_ecoff_update_armap_timestamp bfd_true extern long _bfd_ecoff_get_symtab_upper_bound PARAMS ((bfd *abfd)); -extern long _bfd_ecoff_get_symtab PARAMS ((bfd *abfd, asymbol **alocation)); +extern long _bfd_ecoff_canonicalize_symtab PARAMS ((bfd *abfd, asymbol **alocation)); extern asymbol *_bfd_ecoff_make_empty_symbol PARAMS ((bfd *abfd)); extern void _bfd_ecoff_print_symbol PARAMS ((bfd *, PTR filep, asymbol *, bfd_print_symbol_type)); extern void _bfd_ecoff_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); -extern boolean _bfd_ecoff_bfd_is_local_label_name +extern bfd_boolean _bfd_ecoff_bfd_is_local_label_name PARAMS ((bfd *, const char *)); #define _bfd_ecoff_get_lineno _bfd_nosymbols_get_lineno -extern boolean _bfd_ecoff_find_nearest_line +extern bfd_boolean _bfd_ecoff_find_nearest_line PARAMS ((bfd *, asection *, asymbol **, bfd_vma offset, const char **filename_ptr, const char **fnname_ptr, unsigned int *retline_ptr)); @@ -320,21 +321,21 @@ extern long _bfd_ecoff_canonicalize_reloc PARAMS ((bfd *, asection *, arelent **, asymbol **symbols)); /* ecoff_bfd_reloc_type_lookup defined by backend. */ -extern boolean _bfd_ecoff_set_arch_mach +extern bfd_boolean _bfd_ecoff_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, unsigned long)); -extern boolean _bfd_ecoff_set_section_contents - PARAMS ((bfd *, asection *, PTR location, file_ptr, bfd_size_type)); +extern bfd_boolean _bfd_ecoff_set_section_contents + PARAMS ((bfd *, asection *, const PTR location, file_ptr, bfd_size_type)); -extern int _bfd_ecoff_sizeof_headers PARAMS ((bfd *abfd, boolean reloc)); +extern int _bfd_ecoff_sizeof_headers PARAMS ((bfd *abfd, bfd_boolean reloc)); /* ecoff_bfd_get_relocated_section_contents defined by backend. */ /* ecoff_bfd_relax_section defined by backend. */ extern struct bfd_link_hash_table *_bfd_ecoff_bfd_link_hash_table_create PARAMS ((bfd *)); #define _bfd_ecoff_bfd_link_hash_table_free _bfd_generic_link_hash_table_free -extern boolean _bfd_ecoff_bfd_link_add_symbols +extern bfd_boolean _bfd_ecoff_bfd_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); #define _bfd_ecoff_bfd_link_just_syms _bfd_generic_link_just_syms -extern boolean _bfd_ecoff_bfd_final_link +extern bfd_boolean _bfd_ecoff_bfd_final_link PARAMS ((bfd *, struct bfd_link_info *)); /* Hook functions for the generic COFF section reading code. */ @@ -342,10 +343,11 @@ extern boolean _bfd_ecoff_bfd_final_link extern PTR _bfd_ecoff_mkobject_hook PARAMS ((bfd *, PTR filehdr, PTR aouthdr)); #define _bfd_ecoff_set_alignment_hook \ ((void (*) PARAMS ((bfd *, asection *, PTR))) bfd_void) -extern boolean _bfd_ecoff_set_arch_mach_hook PARAMS ((bfd *abfd, PTR filehdr)); -extern boolean _bfd_ecoff_styp_to_sec_flags +extern bfd_boolean _bfd_ecoff_set_arch_mach_hook + PARAMS ((bfd *abfd, PTR filehdr)); +extern bfd_boolean _bfd_ecoff_styp_to_sec_flags PARAMS ((bfd *, PTR, const char *, asection *, flagword *)); -extern boolean _bfd_ecoff_slurp_symbol_table PARAMS ((bfd *abfd)); +extern bfd_boolean _bfd_ecoff_slurp_symbol_table PARAMS ((bfd *abfd)); /* ECOFF auxiliary information swapping routines. These are the same for all ECOFF targets, so they are defined in ecofflink.c. */ diff --git a/contrib/binutils/bfd/libieee.h b/contrib/binutils/bfd/libieee.h index c48566c..56c7ce1 100644 --- a/contrib/binutils/bfd/libieee.h +++ b/contrib/binutils/bfd/libieee.h @@ -1,5 +1,5 @@ /* IEEE-695 object file formats: definitions internal to BFD. - Copyright 1990, 1991, 1992, 1994, 1996, 2001 + Copyright 1990, 1991, 1992, 1994, 1996, 2001, 2002 Free Software Foundation, Inc. Written by Cygnus Support. Mostly Steve Chamberlain's fault. @@ -56,7 +56,7 @@ typedef struct ieee_per_section /* For output */ file_ptr current_pos; unsigned int current_byte; - boolean initialized; + bfd_boolean initialized; ieee_reloc_type **reloc_tail_ptr; } ieee_per_section_type; @@ -72,8 +72,8 @@ typedef struct { typedef struct ieee_data_struct { common_header_type h; - boolean read_symbols; - boolean read_data; + bfd_boolean read_symbols; + bfd_boolean read_data; file_ptr output_cursor; /* Map of section indexes to section ptrs */ asection **section_table; @@ -103,10 +103,10 @@ typedef struct ieee_data_struct int external_reference_base_offset; - boolean symbol_table_full; + bfd_boolean symbol_table_full; -boolean done_debug; +bfd_boolean done_debug; bfd_chain_type *chain_head; diff --git a/contrib/binutils/bfd/libpei.h b/contrib/binutils/bfd/libpei.h index 6b232b4..9ed9c12 100644 --- a/contrib/binutils/bfd/libpei.h +++ b/contrib/binutils/bfd/libpei.h @@ -1,31 +1,29 @@ /* Support for the generic parts of PE/PEI; common header information. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Solutions. -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. */ - -/* -Most of this hacked by Steve Chamberlain, +/* Most of this hacked by Steve Chamberlain, sac@cygnus.com -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]! @@ -53,8 +51,7 @@ PE/PEI rearrangement (and code added): Donn Terry FIXME: Please add more docs here so the next poor fool that has to hack on this code has a chance of getting something accomplished without - wasting too much time. -*/ + wasting too much time. */ #ifndef GET_FCN_LNNOPTR #define GET_FCN_LNNOPTR(abfd, ext) \ @@ -313,13 +310,13 @@ unsigned int _bfd_XXi_swap_aouthdr_out PARAMS ((bfd *, PTR, PTR)); unsigned int _bfd_XXi_swap_scnhdr_out PARAMS ((bfd *, PTR, PTR)); #define coff_swap_scnhdr_out _bfd_XXi_swap_scnhdr_out -boolean _bfd_XX_print_private_bfd_data_common PARAMS ((bfd *, PTR)); +bfd_boolean _bfd_XX_print_private_bfd_data_common PARAMS ((bfd *, PTR)); -boolean _bfd_XX_bfd_copy_private_bfd_data_common PARAMS ((bfd *, bfd *)); +bfd_boolean _bfd_XX_bfd_copy_private_bfd_data_common PARAMS ((bfd *, bfd *)); void _bfd_XX_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); -boolean _bfd_XXi_final_link_postscript +bfd_boolean _bfd_XXi_final_link_postscript PARAMS ((bfd *, struct coff_final_link_info *)); #ifndef coff_final_link_postscript @@ -331,5 +328,10 @@ boolean _bfd_XXi_final_link_postscript unsigned int _bfd_XX_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR)); unsigned int _bfd_XXi_only_swap_filehdr_out PARAMS ((bfd*, PTR, PTR)); -boolean _bfd_XX_bfd_copy_private_section_data +bfd_boolean _bfd_XX_bfd_copy_private_section_data PARAMS ((bfd *, asection *, bfd *, asection *)); + +/* Macro: Returns true if the bfd is a PE executable as opposed to a PE object file. */ +#define bfd_pe_executable_p(abfd) \ + (strncmp ((abfd)->xvec->name, "pei-", 4) == 0 \ + || strncmp ((abfd)->xvec->name, "efi-app-", 8) == 0) diff --git a/contrib/binutils/bfd/linker.c b/contrib/binutils/bfd/linker.c index a5ded1f..58befc3 100644 --- a/contrib/binutils/bfd/linker.c +++ b/contrib/binutils/bfd/linker.c @@ -1,23 +1,23 @@ /* linker.c -- BFD linker routines - Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, + 2003, 2004 Free Software Foundation, Inc. Written by Steve Chamberlain and Ian Lance Taylor, Cygnus Support -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" @@ -88,7 +88,7 @@ SUBSECTION 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 + (this index number is used so that when doing a relocatable 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 @@ -200,7 +200,7 @@ SUBSUBSECTION read the symbol information, the <<_bfd_link_add_symbols>> routine should save it somewhere attached to the object file BFD. However, the information should only be saved if the - <> field of the <> argument is true, so + <> field of the <> argument is TRUE, so that the <<-no-keep-memory>> linker switch is effective. The a.out function which adds symbols from an object file is @@ -277,7 +277,7 @@ SUBSECTION the input sections and copy the data into the output sections. It must build an output symbol table including any local symbols from the input files and the global symbols from the - hash table. When producing relocateable output, it must + hash table. When producing relocatable output, it must modify the input relocs and write them into the output file. There may also be object format dependent work to be done. @@ -317,7 +317,7 @@ SUBSUBSECTION types of information. They also describe relocs that must be created by the BFD backend, but do not correspond to any input file; this is used to support -Ur, which builds constructors - while generating a relocateable object file. + while generating a relocatable object file. INODE Relocating the section contents, Writing the symbol table, Information provided by the linker, Performing the Final Link @@ -339,7 +339,7 @@ SUBSUBSECTION input files. The <<_bfd_final_link>> function should read the contents of the section and any associated relocs, apply the relocs to the section contents, and write out the modified - section contents. If performing a relocateable link, the + section contents. If performing a relocatable link, the relocs themselves must also be modified and written out. @findex _bfd_relocate_contents @@ -406,32 +406,26 @@ SUBSUBSECTION file at the end of <>. */ -static boolean generic_link_read_symbols - PARAMS ((bfd *)); -static boolean generic_link_add_symbols - PARAMS ((bfd *, struct bfd_link_info *, boolean collect)); -static boolean generic_link_add_object_symbols - PARAMS ((bfd *, struct bfd_link_info *, boolean collect)); -static boolean generic_link_check_archive_element_no_collect - PARAMS ((bfd *, struct bfd_link_info *, boolean *pneeded)); -static boolean generic_link_check_archive_element_collect - PARAMS ((bfd *, struct bfd_link_info *, boolean *pneeded)); -static boolean generic_link_check_archive_element - PARAMS ((bfd *, struct bfd_link_info *, boolean *pneeded, boolean collect)); -static boolean generic_link_add_symbol_list - PARAMS ((bfd *, struct bfd_link_info *, bfd_size_type count, asymbol **, - boolean collect)); -static bfd *hash_entry_bfd PARAMS ((struct bfd_link_hash_entry *)); -static void set_symbol_from_hash - PARAMS ((asymbol *, struct bfd_link_hash_entry *)); -static boolean generic_add_output_symbol - PARAMS ((bfd *, size_t *psymalloc, asymbol *)); -static boolean default_data_link_order - PARAMS ((bfd *, struct bfd_link_info *, asection *, - struct bfd_link_order *)); -static boolean default_indirect_link_order - PARAMS ((bfd *, struct bfd_link_info *, asection *, - struct bfd_link_order *, boolean)); +static bfd_boolean generic_link_add_object_symbols + (bfd *, struct bfd_link_info *, bfd_boolean collect); +static bfd_boolean generic_link_add_symbols + (bfd *, struct bfd_link_info *, bfd_boolean); +static bfd_boolean generic_link_check_archive_element_no_collect + (bfd *, struct bfd_link_info *, bfd_boolean *); +static bfd_boolean generic_link_check_archive_element_collect + (bfd *, struct bfd_link_info *, bfd_boolean *); +static bfd_boolean generic_link_check_archive_element + (bfd *, struct bfd_link_info *, bfd_boolean *, bfd_boolean); +static bfd_boolean generic_link_add_symbol_list + (bfd *, struct bfd_link_info *, bfd_size_type count, asymbol **, + bfd_boolean); +static bfd_boolean generic_add_output_symbol + (bfd *, size_t *psymalloc, asymbol *); +static bfd_boolean default_data_link_order + (bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *); +static bfd_boolean default_indirect_link_order + (bfd *, struct bfd_link_info *, asection *, struct bfd_link_order *, + bfd_boolean); /* The link hash table structure is defined in bfdlink.h. It provides a base hash table which the backend specific hash tables are built @@ -440,17 +434,15 @@ static boolean default_indirect_link_order /* Routine to create an entry in the link hash table. */ struct bfd_hash_entry * -_bfd_link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +_bfd_link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ if (entry == NULL) { - entry = (struct bfd_hash_entry *) - bfd_hash_allocate (table, sizeof (struct bfd_link_hash_entry)); + entry = bfd_hash_allocate (table, sizeof (struct bfd_link_hash_entry)); if (entry == NULL) return entry; } @@ -463,7 +455,7 @@ _bfd_link_hash_newfunc (entry, table, string) /* Initialize the local fields. */ h->type = bfd_link_hash_new; - h->next = NULL; + h->und_next = NULL; } return entry; @@ -472,13 +464,13 @@ _bfd_link_hash_newfunc (entry, table, string) /* Initialize a link hash table. The BFD argument is the one responsible for creating this table. */ -boolean -_bfd_link_hash_table_init (table, abfd, newfunc) - struct bfd_link_hash_table *table; - bfd *abfd; - struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *)); +bfd_boolean +_bfd_link_hash_table_init + (struct bfd_link_hash_table *table, + bfd *abfd, + struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, + struct bfd_hash_table *, + const char *)) { table->creator = abfd->xvec; table->undefs = NULL; @@ -488,24 +480,23 @@ _bfd_link_hash_table_init (table, abfd, newfunc) return bfd_hash_table_init (&table->table, newfunc); } -/* Look up a symbol in a link hash table. If follow is true, we +/* Look up a symbol in a link hash table. If follow is TRUE, we follow bfd_link_hash_indirect and bfd_link_hash_warning links to the real symbol. */ struct bfd_link_hash_entry * -bfd_link_hash_lookup (table, string, create, copy, follow) - struct bfd_link_hash_table *table; - const char *string; - boolean create; - boolean copy; - boolean follow; +bfd_link_hash_lookup (struct bfd_link_hash_table *table, + const char *string, + bfd_boolean create, + bfd_boolean copy, + bfd_boolean follow) { struct bfd_link_hash_entry *ret; ret = ((struct bfd_link_hash_entry *) bfd_hash_lookup (&table->table, string, create, copy)); - if (follow && ret != (struct bfd_link_hash_entry *) NULL) + if (follow && ret != NULL) { while (ret->type == bfd_link_hash_indirect || ret->type == bfd_link_hash_warning) @@ -520,28 +511,31 @@ bfd_link_hash_lookup (table, string, create, copy, follow) undefined symbol, not for definitions of a symbol. */ struct bfd_link_hash_entry * -bfd_wrapped_link_hash_lookup (abfd, info, string, create, copy, follow) - bfd *abfd; - struct bfd_link_info *info; - const char *string; - boolean create; - boolean copy; - boolean follow; +bfd_wrapped_link_hash_lookup (bfd *abfd, + struct bfd_link_info *info, + const char *string, + bfd_boolean create, + bfd_boolean copy, + bfd_boolean follow) { bfd_size_type amt; if (info->wrap_hash != NULL) { const char *l; + char prefix = '\0'; l = string; - if (*l == bfd_get_symbol_leading_char (abfd)) - ++l; + if (*l == bfd_get_symbol_leading_char (abfd) || *l == info->wrap_char) + { + prefix = *l; + ++l; + } #undef WRAP #define WRAP "__wrap_" - if (bfd_hash_lookup (info->wrap_hash, l, false, false) != NULL) + if (bfd_hash_lookup (info->wrap_hash, l, FALSE, FALSE) != NULL) { char *n; struct bfd_link_hash_entry *h; @@ -550,16 +544,15 @@ bfd_wrapped_link_hash_lookup (abfd, info, string, create, copy, follow) references to SYM with references to __wrap_SYM. */ amt = strlen (l) + sizeof WRAP + 1; - n = (char *) bfd_malloc (amt); + n = bfd_malloc (amt); if (n == NULL) return NULL; - /* Note that symbol_leading_char may be '\0'. */ - n[0] = bfd_get_symbol_leading_char (abfd); + n[0] = prefix; n[1] = '\0'; strcat (n, WRAP); strcat (n, l); - h = bfd_link_hash_lookup (info->hash, n, create, true, follow); + h = bfd_link_hash_lookup (info->hash, n, create, TRUE, follow); free (n); return h; } @@ -572,7 +565,7 @@ bfd_wrapped_link_hash_lookup (abfd, info, string, create, copy, follow) if (*l == '_' && strncmp (l, REAL, sizeof REAL - 1) == 0 && bfd_hash_lookup (info->wrap_hash, l + sizeof REAL - 1, - false, false) != NULL) + FALSE, FALSE) != NULL) { char *n; struct bfd_link_hash_entry *h; @@ -582,15 +575,14 @@ bfd_wrapped_link_hash_lookup (abfd, info, string, create, copy, follow) with references to SYM. */ amt = strlen (l + sizeof REAL - 1) + 2; - n = (char *) bfd_malloc (amt); + n = bfd_malloc (amt); if (n == NULL) return NULL; - /* Note that symbol_leading_char may be '\0'. */ - n[0] = bfd_get_symbol_leading_char (abfd); + n[0] = prefix; n[1] = '\0'; strcat (n, l + sizeof REAL - 1); - h = bfd_link_hash_lookup (info->hash, n, create, true, follow); + h = bfd_link_hash_lookup (info->hash, n, create, TRUE, follow); free (n); return h; } @@ -608,45 +600,42 @@ bfd_wrapped_link_hash_lookup (abfd, info, string, create, copy, follow) call. */ void -bfd_link_hash_traverse (table, func, info) - struct bfd_link_hash_table *table; - boolean (*func) PARAMS ((struct bfd_link_hash_entry *, PTR)); - PTR info; +bfd_link_hash_traverse + (struct bfd_link_hash_table *table, + bfd_boolean (*func) (struct bfd_link_hash_entry *, void *), + void *info) { bfd_hash_traverse (&table->table, - ((boolean (*) PARAMS ((struct bfd_hash_entry *, PTR))) - func), + (bfd_boolean (*) (struct bfd_hash_entry *, void *)) func, info); } /* Add a symbol to the linker hash table undefs list. */ -INLINE void -bfd_link_add_undef (table, h) - struct bfd_link_hash_table *table; - struct bfd_link_hash_entry *h; +void +bfd_link_add_undef (struct bfd_link_hash_table *table, + struct bfd_link_hash_entry *h) { - BFD_ASSERT (h->next == NULL); - if (table->undefs_tail != (struct bfd_link_hash_entry *) NULL) - table->undefs_tail->next = h; - if (table->undefs == (struct bfd_link_hash_entry *) NULL) + BFD_ASSERT (h->und_next == NULL); + if (table->undefs_tail != NULL) + table->undefs_tail->und_next = h; + if (table->undefs == NULL) table->undefs = h; table->undefs_tail = h; } -/* Routine to create an entry in an generic link hash table. */ +/* Routine to create an entry in a generic link hash table. */ struct bfd_hash_entry * -_bfd_generic_link_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +_bfd_generic_link_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ if (entry == NULL) { - entry = (struct bfd_hash_entry *) + entry = bfd_hash_allocate (table, sizeof (struct generic_link_hash_entry)); if (entry == NULL) return entry; @@ -660,37 +649,35 @@ _bfd_generic_link_hash_newfunc (entry, table, string) /* Set local fields. */ ret = (struct generic_link_hash_entry *) entry; - ret->written = false; + ret->written = FALSE; ret->sym = NULL; } return entry; } -/* Create an generic link hash table. */ +/* Create a generic link hash table. */ struct bfd_link_hash_table * -_bfd_generic_link_hash_table_create (abfd) - bfd *abfd; +_bfd_generic_link_hash_table_create (bfd *abfd) { struct generic_link_hash_table *ret; bfd_size_type amt = sizeof (struct generic_link_hash_table); - ret = (struct generic_link_hash_table *) bfd_malloc (amt); + ret = bfd_malloc (amt); if (ret == NULL) - return (struct bfd_link_hash_table *) NULL; + return NULL; if (! _bfd_link_hash_table_init (&ret->root, abfd, _bfd_generic_link_hash_newfunc)) { free (ret); - return (struct bfd_link_hash_table *) NULL; + return NULL; } return &ret->root; } void -_bfd_generic_link_hash_table_free (hash) - struct bfd_link_hash_table *hash; +_bfd_generic_link_hash_table_free (struct bfd_link_hash_table *hash) { struct generic_link_hash_table *ret = (struct generic_link_hash_table *) hash; @@ -706,41 +693,37 @@ _bfd_generic_link_hash_table_free (hash) the hash table pointing to different instances of the symbol structure. */ -static boolean -generic_link_read_symbols (abfd) - bfd *abfd; +static bfd_boolean +generic_link_read_symbols (bfd *abfd) { - if (bfd_get_outsymbols (abfd) == (asymbol **) NULL) + if (bfd_get_outsymbols (abfd) == NULL) { long symsize; long symcount; symsize = bfd_get_symtab_upper_bound (abfd); if (symsize < 0) - return false; - bfd_get_outsymbols (abfd) = - (asymbol **) bfd_alloc (abfd, (bfd_size_type) symsize); + return FALSE; + bfd_get_outsymbols (abfd) = bfd_alloc (abfd, symsize); if (bfd_get_outsymbols (abfd) == NULL && symsize != 0) - return false; + return FALSE; symcount = bfd_canonicalize_symtab (abfd, bfd_get_outsymbols (abfd)); if (symcount < 0) - return false; + return FALSE; bfd_get_symcount (abfd) = symcount; } - return true; + return TRUE; } /* Generic function to add symbols to from an object file to the global hash table. This version does not automatically collect constructors by name. */ -boolean -_bfd_generic_link_add_symbols (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +bfd_boolean +_bfd_generic_link_add_symbols (bfd *abfd, struct bfd_link_info *info) { - return generic_link_add_symbols (abfd, info, false); + return generic_link_add_symbols (abfd, info, FALSE); } /* Generic function to add symbols from an object file to the global @@ -750,12 +733,10 @@ _bfd_generic_link_add_symbols (abfd, info) constructors and destructors; these are approximately those targets for which gcc uses collect2 and do not support stabs. */ -boolean -_bfd_generic_link_add_symbols_collect (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +bfd_boolean +_bfd_generic_link_add_symbols_collect (bfd *abfd, struct bfd_link_info *info) { - return generic_link_add_symbols (abfd, info, true); + return generic_link_add_symbols (abfd, info, TRUE); } /* Indicate that we are only retrieving symbol values from this @@ -763,9 +744,8 @@ _bfd_generic_link_add_symbols_collect (abfd, info) file are absolute. */ void -_bfd_generic_link_just_syms (sec, info) - asection *sec; - struct bfd_link_info *info ATTRIBUTE_UNUSED; +_bfd_generic_link_just_syms (asection *sec, + struct bfd_link_info *info ATTRIBUTE_UNUSED) { sec->output_section = bfd_abs_section_ptr; sec->output_offset = sec->vma; @@ -773,13 +753,12 @@ _bfd_generic_link_just_syms (sec, info) /* Add symbols from an object file to the global hash table. */ -static boolean -generic_link_add_symbols (abfd, info, collect) - bfd *abfd; - struct bfd_link_info *info; - boolean collect; +static bfd_boolean +generic_link_add_symbols (bfd *abfd, + struct bfd_link_info *info, + bfd_boolean collect) { - boolean ret; + bfd_boolean ret; switch (bfd_get_format (abfd)) { @@ -795,7 +774,7 @@ generic_link_add_symbols (abfd, info, collect) break; default: bfd_set_error (bfd_error_wrong_format); - ret = false; + ret = FALSE; } return ret; @@ -803,17 +782,16 @@ generic_link_add_symbols (abfd, info, collect) /* Add symbols from an object file to the global hash table. */ -static boolean -generic_link_add_object_symbols (abfd, info, collect) - bfd *abfd; - struct bfd_link_info *info; - boolean collect; +static bfd_boolean +generic_link_add_object_symbols (bfd *abfd, + struct bfd_link_info *info, + bfd_boolean collect) { bfd_size_type symcount; - struct symbol_cache_entry **outsyms; + struct bfd_symbol **outsyms; if (! generic_link_read_symbols (abfd)) - return false; + return FALSE; symcount = _bfd_generic_link_get_symcount (abfd); outsyms = _bfd_generic_link_get_symbols (abfd); return generic_link_add_symbol_list (abfd, info, symcount, outsyms, collect); @@ -846,30 +824,20 @@ struct archive_hash_table struct bfd_hash_table table; }; -static struct bfd_hash_entry *archive_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static boolean archive_hash_table_init - PARAMS ((struct archive_hash_table *, - struct bfd_hash_entry *(*) (struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *))); - /* Create a new entry for an archive hash table. */ static struct bfd_hash_entry * -archive_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +archive_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { struct archive_hash_entry *ret = (struct archive_hash_entry *) entry; /* Allocate the structure if it has not already been allocated by a subclass. */ - if (ret == (struct archive_hash_entry *) NULL) - ret = ((struct archive_hash_entry *) - bfd_hash_allocate (table, sizeof (struct archive_hash_entry))); - if (ret == (struct archive_hash_entry *) NULL) + if (ret == NULL) + ret = bfd_hash_allocate (table, sizeof (struct archive_hash_entry)); + if (ret == NULL) return NULL; /* Call the allocation method of the superclass. */ @@ -879,20 +847,20 @@ archive_hash_newfunc (entry, table, string) if (ret) { /* Initialize the local fields. */ - ret->defs = (struct archive_list *) NULL; + ret->defs = NULL; } - return (struct bfd_hash_entry *) ret; + return &ret->root; } /* Initialize an archive hash table. */ -static boolean -archive_hash_table_init (table, newfunc) - struct archive_hash_table *table; - struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *)); +static bfd_boolean +archive_hash_table_init + (struct archive_hash_table *table, + struct bfd_hash_entry *(*newfunc) (struct bfd_hash_entry *, + struct bfd_hash_table *, + const char *)) { return bfd_hash_table_init (&table->table, newfunc); } @@ -927,10 +895,10 @@ archive_hash_table_init (table, newfunc) re-search the symbol table each time a new object file was added. The CHECKFN argument is used to see if an object file should be - included. CHECKFN should set *PNEEDED to true if the object file + included. CHECKFN should set *PNEEDED to TRUE if the object file should be included, and must also call the bfd_link_info add_archive_element callback function and handle adding the symbols - to the global hash table. CHECKFN should only return false if some + to the global hash table. CHECKFN should only return FALSE if some sort of error occurs. For some formats, such as a.out, it is possible to look through an @@ -944,12 +912,11 @@ archive_hash_table_init (table, newfunc) may create new undefined symbols which cause a previously examined object file to be included. */ -boolean -_bfd_generic_link_add_archive_symbols (abfd, info, checkfn) - bfd *abfd; - struct bfd_link_info *info; - boolean (*checkfn) PARAMS ((bfd *, struct bfd_link_info *, - boolean *pneeded)); +bfd_boolean +_bfd_generic_link_add_archive_symbols + (bfd *abfd, + struct bfd_link_info *info, + bfd_boolean (*checkfn) (bfd *, struct bfd_link_info *, bfd_boolean *)) { carsym *arsyms; carsym *arsym_end; @@ -962,10 +929,10 @@ _bfd_generic_link_add_archive_symbols (abfd, info, checkfn) if (! bfd_has_map (abfd)) { /* An empty archive is a special case. */ - if (bfd_openr_next_archived_file (abfd, (bfd *) NULL) == NULL) - return true; + if (bfd_openr_next_archived_file (abfd, NULL) == NULL) + return TRUE; bfd_set_error (bfd_error_no_armap); - return false; + return FALSE; } arsyms = bfd_ardata (abfd)->symdefs; @@ -974,23 +941,21 @@ _bfd_generic_link_add_archive_symbols (abfd, info, checkfn) /* In order to quickly determine whether an symbol is defined in this archive, we build a hash table of the symbols. */ if (! archive_hash_table_init (&arsym_hash, archive_hash_newfunc)) - return false; + return FALSE; for (arsym = arsyms, indx = 0; arsym < arsym_end; arsym++, indx++) { struct archive_hash_entry *arh; struct archive_list *l, **pp; - arh = archive_hash_lookup (&arsym_hash, arsym->name, true, false); - if (arh == (struct archive_hash_entry *) NULL) + arh = archive_hash_lookup (&arsym_hash, arsym->name, TRUE, FALSE); + if (arh == NULL) goto error_return; l = ((struct archive_list *) archive_hash_allocate (&arsym_hash, sizeof (struct archive_list))); if (l == NULL) goto error_return; l->indx = indx; - for (pp = &arh->defs; - *pp != (struct archive_list *) NULL; - pp = &(*pp)->next) + for (pp = &arh->defs; *pp != NULL; pp = &(*pp)->next) ; *pp = l; l->next = NULL; @@ -1004,7 +969,7 @@ _bfd_generic_link_add_archive_symbols (abfd, info, checkfn) /* New undefined symbols are added to the end of the list, so we only need to look through it once. */ pundef = &info->hash->undefs; - while (*pundef != (struct bfd_link_hash_entry *) NULL) + while (*pundef != NULL) { struct bfd_link_hash_entry *h; struct archive_hash_entry *arh; @@ -1025,40 +990,40 @@ _bfd_generic_link_add_archive_symbols (abfd, info, checkfn) us to lose track of whether the symbol has been referenced). */ if (*pundef != info->hash->undefs_tail) - *pundef = (*pundef)->next; + *pundef = (*pundef)->und_next; else - pundef = &(*pundef)->next; + pundef = &(*pundef)->und_next; continue; } /* Look for this symbol in the archive symbol map. */ - arh = archive_hash_lookup (&arsym_hash, h->root.string, false, false); - if (arh == (struct archive_hash_entry *) NULL) + arh = archive_hash_lookup (&arsym_hash, h->root.string, FALSE, FALSE); + if (arh == NULL) { /* If we haven't found the exact symbol we're looking for, let's look for its import thunk */ if (info->pei386_auto_import) { bfd_size_type amt = strlen (h->root.string) + 10; - char *buf = (char *) bfd_malloc (amt); + char *buf = bfd_malloc (amt); if (buf == NULL) - return false; + return FALSE; sprintf (buf, "__imp_%s", h->root.string); - arh = archive_hash_lookup (&arsym_hash, buf, false, false); + arh = archive_hash_lookup (&arsym_hash, buf, FALSE, FALSE); free(buf); } - if (arh == (struct archive_hash_entry *) NULL) + if (arh == NULL) { - pundef = &(*pundef)->next; + pundef = &(*pundef)->und_next; continue; } } /* Look at all the objects which define this symbol. */ - for (l = arh->defs; l != (struct archive_list *) NULL; l = l->next) + for (l = arh->defs; l != NULL; l = l->next) { bfd *element; - boolean needed; + bfd_boolean needed; /* If the symbol has gotten defined along the way, quit. */ if (h->type != bfd_link_hash_undefined @@ -1066,7 +1031,7 @@ _bfd_generic_link_add_archive_symbols (abfd, info, checkfn) break; element = bfd_get_elt_at_index (abfd, l->indx); - if (element == (bfd *) NULL) + if (element == NULL) goto error_return; /* If we've already included this element, or if we've @@ -1099,7 +1064,7 @@ _bfd_generic_link_add_archive_symbols (abfd, info, checkfn) } } - pundef = &(*pundef)->next; + pundef = &(*pundef)->und_next; } archive_hash_table_free (&arsym_hash); @@ -1107,11 +1072,11 @@ _bfd_generic_link_add_archive_symbols (abfd, info, checkfn) /* Save PASS in case we are called again. */ abfd->archive_pass = pass; - return true; + return TRUE; error_return: archive_hash_table_free (&arsym_hash); - return false; + return FALSE; } /* See if we should include an archive element. This version is used @@ -1119,44 +1084,42 @@ _bfd_generic_link_add_archive_symbols (abfd, info, checkfn) the symbol name, presumably because we have some other mechanism for finding them. */ -static boolean -generic_link_check_archive_element_no_collect (abfd, info, pneeded) - bfd *abfd; - struct bfd_link_info *info; - boolean *pneeded; +static bfd_boolean +generic_link_check_archive_element_no_collect ( + bfd *abfd, + struct bfd_link_info *info, + bfd_boolean *pneeded) { - return generic_link_check_archive_element (abfd, info, pneeded, false); + return generic_link_check_archive_element (abfd, info, pneeded, FALSE); } /* See if we should include an archive element. This version is used when we want to automatically collect constructors based on the symbol name, as collect2 does. */ -static boolean -generic_link_check_archive_element_collect (abfd, info, pneeded) - bfd *abfd; - struct bfd_link_info *info; - boolean *pneeded; +static bfd_boolean +generic_link_check_archive_element_collect (bfd *abfd, + struct bfd_link_info *info, + bfd_boolean *pneeded) { - return generic_link_check_archive_element (abfd, info, pneeded, true); + return generic_link_check_archive_element (abfd, info, pneeded, TRUE); } /* See if we should include an archive element. Optionally collect constructors. */ -static boolean -generic_link_check_archive_element (abfd, info, pneeded, collect) - bfd *abfd; - struct bfd_link_info *info; - boolean *pneeded; - boolean collect; +static bfd_boolean +generic_link_check_archive_element (bfd *abfd, + struct bfd_link_info *info, + bfd_boolean *pneeded, + bfd_boolean collect) { asymbol **pp, **ppend; - *pneeded = false; + *pneeded = FALSE; if (! generic_link_read_symbols (abfd)) - return false; + return FALSE; pp = _bfd_generic_link_get_symbols (abfd); ppend = pp + _bfd_generic_link_get_symcount (abfd); @@ -1177,9 +1140,9 @@ generic_link_check_archive_element (abfd, info, pneeded, collect) symbol (type bfd_link_hash_undefweak) is not considered to be a reference when pulling files out of an archive. See the SVR4 ABI, p. 4-27. */ - h = bfd_link_hash_lookup (info->hash, bfd_asymbol_name (p), false, - false, true); - if (h == (struct bfd_link_hash_entry *) NULL + h = bfd_link_hash_lookup (info->hash, bfd_asymbol_name (p), FALSE, + FALSE, TRUE); + if (h == NULL || (h->type != bfd_link_hash_undefined && h->type != bfd_link_hash_common)) continue; @@ -1194,14 +1157,14 @@ generic_link_check_archive_element (abfd, info, pneeded, collect) /* This object file defines this symbol, so pull it in. */ if (! (*info->callbacks->add_archive_element) (info, abfd, bfd_asymbol_name (p))) - return false; + return FALSE; symcount = _bfd_generic_link_get_symcount (abfd); symbols = _bfd_generic_link_get_symbols (abfd); if (! generic_link_add_symbol_list (abfd, info, symcount, symbols, collect)) - return false; - *pneeded = true; - return true; + return FALSE; + *pneeded = TRUE; + return TRUE; } /* P is a common symbol. */ @@ -1213,16 +1176,16 @@ generic_link_check_archive_element (abfd, info, pneeded, collect) unsigned int power; symbfd = h->u.undef.abfd; - if (symbfd == (bfd *) NULL) + if (symbfd == NULL) { /* This symbol was created as undefined from outside BFD. We assume that we should link in the object file. This is for the -u option in the linker. */ if (! (*info->callbacks->add_archive_element) (info, abfd, bfd_asymbol_name (p))) - return false; - *pneeded = true; - return true; + return FALSE; + *pneeded = TRUE; + return TRUE; } /* Turn the symbol into a common symbol but do not link in @@ -1234,11 +1197,10 @@ generic_link_check_archive_element (abfd, info, pneeded, collect) will be linked in. */ h->type = bfd_link_hash_common; h->u.c.p = - ((struct bfd_link_hash_common_entry *) - bfd_hash_allocate (&info->hash->table, - sizeof (struct bfd_link_hash_common_entry))); + bfd_hash_allocate (&info->hash->table, + sizeof (struct bfd_link_hash_common_entry)); if (h->u.c.p == NULL) - return false; + return FALSE; size = bfd_asymbol_value (p); h->u.c.size = size; @@ -1267,22 +1229,21 @@ generic_link_check_archive_element (abfd, info, pneeded, collect) } /* This archive element is not needed. */ - return true; + return TRUE; } /* Add the symbols from an object file to the global hash table. ABFD is the object file. INFO is the linker information. SYMBOL_COUNT is the number of symbols. SYMBOLS is the list of symbols. COLLECT - is true if constructors should be automatically collected by name + is TRUE if constructors should be automatically collected by name as is done by collect2. */ -static boolean -generic_link_add_symbol_list (abfd, info, symbol_count, symbols, collect) - bfd *abfd; - struct bfd_link_info *info; - bfd_size_type symbol_count; - asymbol **symbols; - boolean collect; +static bfd_boolean +generic_link_add_symbol_list (bfd *abfd, + struct bfd_link_info *info, + bfd_size_type symbol_count, + asymbol **symbols, + bfd_boolean collect) { asymbol **pp, **ppend; @@ -1331,8 +1292,8 @@ generic_link_add_symbol_list (abfd, info, symbol_count, symbols, collect) bh = NULL; if (! (_bfd_generic_link_add_one_symbol (info, abfd, name, p->flags, bfd_get_section (p), - p->value, string, false, collect, &bh))) - return false; + p->value, string, FALSE, collect, &bh))) + return FALSE; h = (struct generic_link_hash_entry *) bh; /* If this is a constructor symbol, and the linker didn't do @@ -1356,7 +1317,7 @@ generic_link_add_symbol_list (abfd, info, symbol_count, symbols, collect) generic one. */ if (info->hash->creator == abfd->xvec) { - if (h->sym == (asymbol *) NULL + if (h->sym == NULL || (! bfd_is_und_section (bfd_get_section (p)) && (! bfd_is_com_section (bfd_get_section (p)) || bfd_is_und_section (bfd_get_section (h->sym))))) @@ -1375,11 +1336,11 @@ generic_link_add_symbol_list (abfd, info, symbol_count, symbols, collect) it gets rewritten to not use asymbol structures. Setting this is also used to check whether these symbols were set up by the generic linker. */ - p->udata.p = (PTR) h; + p->udata.p = h; } } - return true; + return TRUE; } /* We use a state table to deal with adding symbols from an object @@ -1475,8 +1436,7 @@ static const enum link_action link_action[8][8] = /* Return the BFD in which a hash entry has been defined, if known. */ static bfd * -hash_entry_bfd (h) - struct bfd_link_hash_entry *h; +hash_entry_bfd (struct bfd_link_hash_entry *h) { while (h->type == bfd_link_hash_warning) h = h->u.i.link; @@ -1506,31 +1466,29 @@ hash_entry_bfd (h) STRING is used for either an indirect symbol, in which case it is the name of the symbol to indirect to, or a warning symbol, in which case it is the warning string. - COPY is true if NAME or STRING must be copied into locally + COPY is TRUE if NAME or STRING must be copied into locally allocated memory if they need to be saved. - COLLECT is true if we should automatically collect gcc constructor + COLLECT is TRUE if we should automatically collect gcc constructor 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. */ -boolean -_bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, - string, copy, collect, hashp) - struct bfd_link_info *info; - bfd *abfd; - const char *name; - flagword flags; - asection *section; - bfd_vma value; - const char *string; - boolean copy; - boolean collect; - struct bfd_link_hash_entry **hashp; +bfd_boolean +_bfd_generic_link_add_one_symbol (struct bfd_link_info *info, + bfd *abfd, + const char *name, + flagword flags, + asection *section, + bfd_vma value, + const char *string, + bfd_boolean copy, + bfd_boolean collect, + struct bfd_link_hash_entry **hashp) { enum link_row row; struct bfd_link_hash_entry *h; - boolean cycle; + bfd_boolean cycle; if (bfd_is_ind_section (section) || (flags & BSF_INDIRECT) != 0) @@ -1558,35 +1516,34 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, else { if (row == UNDEF_ROW || row == UNDEFW_ROW) - h = bfd_wrapped_link_hash_lookup (abfd, info, name, true, copy, false); + h = bfd_wrapped_link_hash_lookup (abfd, info, name, TRUE, copy, FALSE); else - h = bfd_link_hash_lookup (info->hash, name, true, copy, false); + h = bfd_link_hash_lookup (info->hash, name, TRUE, copy, FALSE); if (h == NULL) { if (hashp != NULL) *hashp = NULL; - return false; + return FALSE; } } if (info->notice_all - || (info->notice_hash != (struct bfd_hash_table *) NULL - && (bfd_hash_lookup (info->notice_hash, name, false, false) - != (struct bfd_hash_entry *) NULL))) + || (info->notice_hash != NULL + && bfd_hash_lookup (info->notice_hash, name, FALSE, FALSE) != NULL)) { if (! (*info->callbacks->notice) (info, h->root.string, abfd, section, value)) - return false; + return FALSE; } - if (hashp != (struct bfd_link_hash_entry **) NULL) + if (hashp != NULL) *hashp = h; do { enum link_action action; - cycle = false; + cycle = FALSE; action = link_action[(int) row][(int) h->type]; switch (action) { @@ -1617,8 +1574,8 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, if (! ((*info->callbacks->multiple_common) (info, h->root.string, h->u.c.p->section->owner, bfd_link_hash_common, h->u.c.size, - abfd, bfd_link_hash_defined, (bfd_vma) 0))) - return false; + abfd, bfd_link_hash_defined, 0))) + return FALSE; /* Fall through. */ case DEF: case DEFW: @@ -1678,7 +1635,7 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, if (! ((*info->callbacks->constructor) (info, c == 'I', h->root.string, abfd, section, value))) - return false; + return FALSE; } } } @@ -1692,11 +1649,10 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, bfd_link_add_undef (info->hash, h); h->type = bfd_link_hash_common; h->u.c.p = - ((struct bfd_link_hash_common_entry *) - bfd_hash_allocate (&info->hash->table, - sizeof (struct bfd_link_hash_common_entry))); + bfd_hash_allocate (&info->hash->table, + sizeof (struct bfd_link_hash_common_entry)); if (h->u.c.p == NULL) - return false; + return FALSE; h->u.c.size = value; @@ -1738,8 +1694,8 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, case REF: /* A reference to a defined symbol. */ - if (h->next == NULL && info->hash->undefs_tail != h) - h->next = h; + if (h->und_next == NULL && info->hash->undefs_tail != h) + h->und_next = h; break; case BIG: @@ -1751,7 +1707,7 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, (info, h->root.string, h->u.c.p->section->owner, bfd_link_hash_common, h->u.c.size, abfd, bfd_link_hash_common, value))) - return false; + return FALSE; if (value > h->u.c.size) { unsigned int power; @@ -1800,9 +1756,9 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, else obfd = NULL; if (! ((*info->callbacks->multiple_common) - (info, h->root.string, obfd, h->type, (bfd_vma) 0, + (info, h->root.string, obfd, h->type, 0, abfd, bfd_link_hash_common, value))) - return false; + return FALSE; } break; @@ -1844,7 +1800,7 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, if (! ((*info->callbacks->multiple_definition) (info, h->root.string, msec->owner, msec, mval, abfd, section, value))) - return false; + return FALSE; } break; @@ -1854,8 +1810,8 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, if (! ((*info->callbacks->multiple_common) (info, h->root.string, h->u.c.p->section->owner, bfd_link_hash_common, h->u.c.size, - abfd, bfd_link_hash_indirect, (bfd_vma) 0))) - return false; + abfd, bfd_link_hash_indirect, 0))) + return FALSE; /* Fall through. */ case IND: /* Create an indirect symbol. */ @@ -1864,10 +1820,10 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, /* STRING is the name of the symbol we want to indirect to. */ - inh = bfd_wrapped_link_hash_lookup (abfd, info, string, true, - copy, false); - if (inh == (struct bfd_link_hash_entry *) NULL) - return false; + inh = bfd_wrapped_link_hash_lookup (abfd, info, string, TRUE, + copy, FALSE); + if (inh == NULL) + return FALSE; if (inh->type == bfd_link_hash_indirect && inh->u.i.link == h) { @@ -1875,7 +1831,7 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, (_("%s: indirect symbol `%s' to `%s' is a loop"), bfd_archive_filename (abfd), name, string); bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } if (inh->type == bfd_link_hash_new) { @@ -1890,7 +1846,7 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, if (h->type != bfd_link_hash_new) { row = UNDEF_ROW; - cycle = true; + cycle = TRUE; } h->type = bfd_link_hash_indirect; @@ -1902,7 +1858,7 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, /* Add an entry to a set. */ if (! (*info->callbacks->add_to_set) (info, h, BFD_RELOC_CTOR, abfd, section, value)) - return false; + return FALSE; break; case WARNC: @@ -1911,9 +1867,8 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, { if (! (*info->callbacks->warning) (info, h->u.i.warning, h->root.string, abfd, - (asection *) NULL, - (bfd_vma) 0)) - return false; + NULL, 0)) + return FALSE; /* Only issue a warning once. */ h->u.i.warning = NULL; } @@ -1921,38 +1876,35 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, case CYCLE: /* Try again with the referenced symbol. */ h = h->u.i.link; - cycle = true; + cycle = TRUE; break; case REFC: /* A reference to an indirect symbol. */ - if (h->next == NULL && info->hash->undefs_tail != h) - h->next = h; + if (h->und_next == NULL && info->hash->undefs_tail != h) + h->und_next = h; h = h->u.i.link; - cycle = true; + cycle = TRUE; break; case WARN: /* Issue a warning. */ if (! (*info->callbacks->warning) (info, string, h->root.string, - hash_entry_bfd (h), - (asection *) NULL, (bfd_vma) 0)) - return false; + hash_entry_bfd (h), NULL, 0)) + return FALSE; break; case CWARN: /* Warn if this symbol has been referenced already, otherwise add a warning. A symbol has been referenced if - the next field is not NULL, or it is the tail of the + the und_next field is not NULL, or it is the tail of the undefined symbol list. The REF case above helps to ensure this. */ - if (h->next != NULL || info->hash->undefs_tail == h) + if (h->und_next != NULL || info->hash->undefs_tail == h) { if (! (*info->callbacks->warning) (info, string, h->root.string, - hash_entry_bfd (h), - (asection *) NULL, - (bfd_vma) 0)) - return false; + hash_entry_bfd (h), NULL, 0)) + return FALSE; break; } /* Fall through. */ @@ -1964,10 +1916,9 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, /* STRING is the warning to give. */ sub = ((struct bfd_link_hash_entry *) ((*info->hash->table.newfunc) - ((struct bfd_hash_entry *) NULL, &info->hash->table, - h->root.string))); + (NULL, &info->hash->table, h->root.string))); if (sub == NULL) - return false; + return FALSE; *sub = *h; sub->type = bfd_link_hash_warning; sub->u.i.link = h; @@ -1980,7 +1931,7 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, w = bfd_hash_allocate (&info->hash->table, len); if (w == NULL) - return false; + return FALSE; memcpy (w, string, len); sub->u.i.warning = w; } @@ -1996,15 +1947,13 @@ _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, } while (cycle); - return true; + return TRUE; } /* Generic final link routine. */ -boolean -_bfd_generic_final_link (abfd, info) - bfd *abfd; - struct bfd_link_info *info; +bfd_boolean +_bfd_generic_final_link (bfd *abfd, struct bfd_link_info *info) { bfd *sub; asection *o; @@ -2012,7 +1961,7 @@ _bfd_generic_final_link (abfd, info) size_t outsymalloc; struct generic_write_global_symbol_info wginfo; - bfd_get_outsymbols (abfd) = (asymbol **) NULL; + bfd_get_outsymbols (abfd) = NULL; bfd_get_symcount (abfd) = 0; outsymalloc = 0; @@ -2020,12 +1969,12 @@ _bfd_generic_final_link (abfd, info) for (o = abfd->sections; o != NULL; o = o->next) for (p = o->link_order_head; p != NULL; p = p->next) if (p->type == bfd_indirect_link_order) - p->u.indirect.section->linker_mark = (unsigned int) true; + p->u.indirect.section->linker_mark = TRUE; /* Build the output symbol table. */ - for (sub = info->input_bfds; sub != (bfd *) NULL; sub = sub->link_next) + for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) if (! _bfd_generic_link_output_symbols (abfd, sub, info, &outsymalloc)) - return false; + return FALSE; /* Accumulate the global symbols. */ wginfo.info = info; @@ -2033,25 +1982,21 @@ _bfd_generic_final_link (abfd, info) wginfo.psymalloc = &outsymalloc; _bfd_generic_link_hash_traverse (_bfd_generic_hash_table (info), _bfd_generic_link_write_global_symbol, - (PTR) &wginfo); + &wginfo); /* Make sure we have a trailing NULL pointer on OUTSYMBOLS. We shouldn't really need one, since we have SYMCOUNT, but some old code still expects one. */ if (! generic_add_output_symbol (abfd, &outsymalloc, NULL)) - return false; + return FALSE; - if (info->relocateable) + if (info->relocatable) { /* Allocate space for the output relocs for each section. */ - for (o = abfd->sections; - o != (asection *) NULL; - o = o->next) + for (o = abfd->sections; o != NULL; o = o->next) { o->reloc_count = 0; - for (p = o->link_order_head; - p != (struct bfd_link_order *) NULL; - p = p->next) + for (p = o->link_order_head; p != NULL; p = p->next) { if (p->type == bfd_section_reloc_link_order || p->type == bfd_symbol_reloc_link_order) @@ -2070,21 +2015,21 @@ _bfd_generic_final_link (abfd, info) relsize = bfd_get_reloc_upper_bound (input_bfd, input_section); if (relsize < 0) - return false; - relocs = (arelent **) bfd_malloc ((bfd_size_type) relsize); + return FALSE; + relocs = bfd_malloc (relsize); if (!relocs && relsize != 0) - return false; + return FALSE; symbols = _bfd_generic_link_get_symbols (input_bfd); reloc_count = bfd_canonicalize_reloc (input_bfd, input_section, relocs, symbols); + free (relocs); if (reloc_count < 0) - return false; + return FALSE; BFD_ASSERT ((unsigned long) reloc_count == input_section->reloc_count); o->reloc_count += reloc_count; - free (relocs); } } if (o->reloc_count > 0) @@ -2093,9 +2038,9 @@ _bfd_generic_final_link (abfd, info) amt = o->reloc_count; amt *= sizeof (arelent *); - o->orelocation = (arelent **) bfd_alloc (abfd, amt); + o->orelocation = bfd_alloc (abfd, amt); if (!o->orelocation) - return false; + return FALSE; o->flags |= SEC_RELOC; /* Reset the count so that it can be used as an index when putting in the output relocs. */ @@ -2105,43 +2050,36 @@ _bfd_generic_final_link (abfd, info) } /* Handle all the link order information for the sections. */ - for (o = abfd->sections; - o != (asection *) NULL; - o = o->next) + for (o = abfd->sections; o != NULL; o = o->next) { - for (p = o->link_order_head; - p != (struct bfd_link_order *) NULL; - p = p->next) + for (p = o->link_order_head; p != NULL; p = p->next) { switch (p->type) { case bfd_section_reloc_link_order: case bfd_symbol_reloc_link_order: if (! _bfd_generic_reloc_link_order (abfd, info, o, p)) - return false; + return FALSE; break; case bfd_indirect_link_order: - if (! default_indirect_link_order (abfd, info, o, p, true)) - return false; + if (! default_indirect_link_order (abfd, info, o, p, TRUE)) + return FALSE; break; default: if (! _bfd_default_link_order (abfd, info, o, p)) - return false; + return FALSE; break; } } } - return true; + return TRUE; } /* Add an output symbol to the output BFD. */ -static boolean -generic_add_output_symbol (output_bfd, psymalloc, sym) - bfd *output_bfd; - size_t *psymalloc; - asymbol *sym; +static bfd_boolean +generic_add_output_symbol (bfd *output_bfd, size_t *psymalloc, asymbol *sym) { if (bfd_get_symcount (output_bfd) >= *psymalloc) { @@ -2154,9 +2092,9 @@ generic_add_output_symbol (output_bfd, psymalloc, sym) *psymalloc *= 2; amt = *psymalloc; amt *= sizeof (asymbol *); - newsyms = (asymbol **) bfd_realloc (bfd_get_outsymbols (output_bfd), amt); - if (newsyms == (asymbol **) NULL) - return false; + newsyms = bfd_realloc (bfd_get_outsymbols (output_bfd), amt); + if (newsyms == NULL) + return FALSE; bfd_get_outsymbols (output_bfd) = newsyms; } @@ -2164,32 +2102,29 @@ generic_add_output_symbol (output_bfd, psymalloc, sym) if (sym != NULL) ++ bfd_get_symcount (output_bfd); - return true; + return TRUE; } /* Handle the symbols for an input BFD. */ -boolean -_bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc) - bfd *output_bfd; - bfd *input_bfd; - struct bfd_link_info *info; - size_t *psymalloc; +bfd_boolean +_bfd_generic_link_output_symbols (bfd *output_bfd, + bfd *input_bfd, + struct bfd_link_info *info, + size_t *psymalloc) { asymbol **sym_ptr; asymbol **sym_end; if (! generic_link_read_symbols (input_bfd)) - return false; + return FALSE; /* Create a filename symbol if we are supposed to. */ - if (info->create_object_symbols_section != (asection *) NULL) + if (info->create_object_symbols_section != NULL) { asection *sec; - for (sec = input_bfd->sections; - sec != (asection *) NULL; - sec = sec->next) + for (sec = input_bfd->sections; sec != NULL; sec = sec->next) { if (sec->output_section == info->create_object_symbols_section) { @@ -2197,7 +2132,7 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc) newsym = bfd_make_empty_symbol (input_bfd); if (!newsym) - return false; + return FALSE; newsym->name = input_bfd->filename; newsym->value = 0; newsym->flags = BSF_LOCAL | BSF_FILE; @@ -2205,7 +2140,7 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc) if (! generic_add_output_symbol (output_bfd, psymalloc, newsym)) - return false; + return FALSE; break; } @@ -2220,9 +2155,9 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc) { asymbol *sym; struct generic_link_hash_entry *h; - boolean output; + bfd_boolean output; - h = (struct generic_link_hash_entry *) NULL; + h = NULL; sym = *sym_ptr; if ((sym->flags & (BSF_INDIRECT | BSF_WARNING @@ -2234,7 +2169,7 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc) || bfd_is_ind_section (bfd_get_section (sym))) { if (sym->udata.p != NULL) - h = (struct generic_link_hash_entry *) sym->udata.p; + h = sym->udata.p; else if ((sym->flags & BSF_CONSTRUCTOR) != 0) { /* This case normally means that the main linker code @@ -2251,13 +2186,13 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc) h = ((struct generic_link_hash_entry *) bfd_wrapped_link_hash_lookup (output_bfd, info, bfd_asymbol_name (sym), - false, false, true)); + FALSE, FALSE, TRUE)); else h = _bfd_generic_link_hash_lookup (_bfd_generic_hash_table (info), bfd_asymbol_name (sym), - false, false, true); + FALSE, FALSE, TRUE); - if (h != (struct generic_link_hash_entry *) NULL) + if (h != NULL) { /* Force all references to this symbol to point to the same area in memory. It is possible that @@ -2266,7 +2201,7 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc) check that. */ if (info->hash->creator == input_bfd->xvec) { - if (h->sym != (asymbol *) NULL) + if (h->sym != NULL) *sym_ptr = sym = h->sym; } @@ -2318,10 +2253,9 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc) write_file_locals in ldsym.c. */ if (info->strip == strip_all || (info->strip == strip_some - && (bfd_hash_lookup (info->keep_hash, bfd_asymbol_name (sym), - false, false) - == (struct bfd_hash_entry *) NULL))) - output = false; + && bfd_hash_lookup (info->keep_hash, bfd_asymbol_name (sym), + FALSE, FALSE) == NULL)) + output = FALSE; else if ((sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0) { /* If this symbol is marked as occurring now, rather @@ -2330,48 +2264,48 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc) better way. */ if (bfd_asymbol_bfd (sym) == input_bfd && (sym->flags & BSF_NOT_AT_END) != 0) - output = true; + output = TRUE; else - output = false; + output = FALSE; } else if (bfd_is_ind_section (sym->section)) - output = false; + output = FALSE; else if ((sym->flags & BSF_DEBUGGING) != 0) { if (info->strip == strip_none) - output = true; + output = TRUE; else - output = false; + output = FALSE; } else if (bfd_is_und_section (sym->section) || bfd_is_com_section (sym->section)) - output = false; + output = FALSE; else if ((sym->flags & BSF_LOCAL) != 0) { if ((sym->flags & BSF_WARNING) != 0) - output = false; + output = FALSE; else { switch (info->discard) { default: case discard_all: - output = false; + output = FALSE; break; case discard_sec_merge: - output = true; - if (info->relocateable + output = TRUE; + if (info->relocatable || ! (sym->section->flags & SEC_MERGE)) break; /* FALLTHROUGH */ case discard_l: if (bfd_is_local_label (input_bfd, sym)) - output = false; + output = FALSE; else - output = true; + output = TRUE; break; case discard_none: - output = true; + output = TRUE; break; } } @@ -2379,9 +2313,9 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc) else if ((sym->flags & BSF_CONSTRUCTOR)) { if (info->strip != strip_all) - output = true; + output = TRUE; else - output = false; + output = FALSE; } else abort (); @@ -2393,27 +2327,25 @@ _bfd_generic_link_output_symbols (output_bfd, input_bfd, info, psymalloc) field set. */ if ((sym->section->flags & SEC_HAS_CONTENTS) != 0 && ! sym->section->linker_mark) - output = false; + output = FALSE; if (output) { if (! generic_add_output_symbol (output_bfd, psymalloc, sym)) - return false; - if (h != (struct generic_link_hash_entry *) NULL) - h->written = true; + return FALSE; + if (h != NULL) + h->written = TRUE; } } - return true; + return TRUE; } /* Set the section and value of a generic BFD symbol based on a linker hash table entry. */ static void -set_symbol_from_hash (sym, h) - asymbol *sym; - struct bfd_link_hash_entry *h; +set_symbol_from_hash (asymbol *sym, struct bfd_link_hash_entry *h) { switch (h->type) { @@ -2473,36 +2405,34 @@ set_symbol_from_hash (sym, h) /* Write out a global symbol, if it hasn't already been written out. This is called for each symbol in the hash table. */ -boolean -_bfd_generic_link_write_global_symbol (h, data) - struct generic_link_hash_entry *h; - PTR data; +bfd_boolean +_bfd_generic_link_write_global_symbol (struct generic_link_hash_entry *h, + void *data) { - struct generic_write_global_symbol_info *wginfo = - (struct generic_write_global_symbol_info *) data; + struct generic_write_global_symbol_info *wginfo = data; asymbol *sym; if (h->root.type == bfd_link_hash_warning) h = (struct generic_link_hash_entry *) h->root.u.i.link; if (h->written) - return true; + return TRUE; - h->written = true; + h->written = TRUE; if (wginfo->info->strip == strip_all || (wginfo->info->strip == strip_some && bfd_hash_lookup (wginfo->info->keep_hash, h->root.root.string, - false, false) == NULL)) - return true; + FALSE, FALSE) == NULL)) + return TRUE; - if (h->sym != (asymbol *) NULL) + if (h->sym != NULL) sym = h->sym; else { sym = bfd_make_empty_symbol (wginfo->output_bfd); if (!sym) - return false; + return FALSE; sym->name = h->root.root.string; sym->flags = 0; } @@ -2518,35 +2448,34 @@ _bfd_generic_link_write_global_symbol (h, data) abort (); } - return true; + return TRUE; } /* Create a relocation. */ -boolean -_bfd_generic_reloc_link_order (abfd, info, sec, link_order) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - struct bfd_link_order *link_order; +bfd_boolean +_bfd_generic_reloc_link_order (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + struct bfd_link_order *link_order) { arelent *r; - if (! info->relocateable) + if (! info->relocatable) abort (); - if (sec->orelocation == (arelent **) NULL) + if (sec->orelocation == NULL) abort (); - r = (arelent *) bfd_alloc (abfd, (bfd_size_type) sizeof (arelent)); - if (r == (arelent *) NULL) - return false; + r = bfd_alloc (abfd, sizeof (arelent)); + if (r == 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) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } /* Get the symbol to use for the relocation. */ @@ -2559,16 +2488,15 @@ _bfd_generic_reloc_link_order (abfd, info, sec, link_order) h = ((struct generic_link_hash_entry *) bfd_wrapped_link_hash_lookup (abfd, info, link_order->u.reloc.p->u.name, - false, false, true)); - if (h == (struct generic_link_hash_entry *) NULL + FALSE, FALSE, TRUE)); + if (h == NULL || ! h->written) { if (! ((*info->callbacks->unattached_reloc) - (info, link_order->u.reloc.p->u.name, - (bfd *) NULL, (asection *) NULL, (bfd_vma) 0))) - return false; + (info, link_order->u.reloc.p->u.name, NULL, NULL, 0))) + return FALSE; bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } r->sym_ptr_ptr = &h->sym; } @@ -2582,13 +2510,13 @@ _bfd_generic_reloc_link_order (abfd, info, sec, link_order) bfd_size_type size; bfd_reloc_status_type rstat; bfd_byte *buf; - boolean ok; + bfd_boolean ok; file_ptr loc; size = bfd_get_reloc_size (r->howto); - buf = (bfd_byte *) bfd_zmalloc (size); - if (buf == (bfd_byte *) NULL) - return false; + buf = bfd_zmalloc (size); + if (buf == NULL) + return FALSE; rstat = _bfd_relocate_contents (r->howto, abfd, (bfd_vma) link_order->u.reloc.p->addend, buf); @@ -2606,19 +2534,18 @@ _bfd_generic_reloc_link_order (abfd, info, sec, link_order) ? bfd_section_name (abfd, link_order->u.reloc.p->u.section) : link_order->u.reloc.p->u.name), r->howto->name, link_order->u.reloc.p->addend, - (bfd *) NULL, (asection *) NULL, (bfd_vma) 0))) + NULL, NULL, 0))) { free (buf); - return false; + return FALSE; } break; } loc = link_order->offset * bfd_octets_per_byte (abfd); - ok = bfd_set_section_contents (abfd, sec, (PTR) buf, loc, - (bfd_size_type) size); + ok = bfd_set_section_contents (abfd, sec, buf, loc, size); free (buf); if (! ok) - return false; + return FALSE; r->addend = 0; } @@ -2626,26 +2553,24 @@ _bfd_generic_reloc_link_order (abfd, info, sec, link_order) sec->orelocation[sec->reloc_count] = r; ++sec->reloc_count; - return true; + return TRUE; } /* Allocate a new link_order for a section. */ struct bfd_link_order * -bfd_new_link_order (abfd, section) - bfd *abfd; - asection *section; +bfd_new_link_order (bfd *abfd, asection *section) { bfd_size_type amt = sizeof (struct bfd_link_order); struct bfd_link_order *new; - new = (struct bfd_link_order *) bfd_zalloc (abfd, amt); + new = bfd_zalloc (abfd, amt); if (!new) return NULL; new->type = bfd_undefined_link_order; - if (section->link_order_tail != (struct bfd_link_order *) NULL) + if (section->link_order_tail != NULL) section->link_order_tail->next = new; else section->link_order_head = new; @@ -2658,12 +2583,11 @@ bfd_new_link_order (abfd, section) the reloc_link_order types here, since they depend upon the details of how the particular backends generates relocs. */ -boolean -_bfd_default_link_order (abfd, info, sec, link_order) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - struct bfd_link_order *link_order; +bfd_boolean +_bfd_default_link_order (bfd *abfd, + struct bfd_link_info *info, + asection *sec, + struct bfd_link_order *link_order) { switch (link_order->type) { @@ -2674,7 +2598,7 @@ _bfd_default_link_order (abfd, info, sec, link_order) abort (); case bfd_indirect_link_order: return default_indirect_link_order (abfd, info, sec, link_order, - false); + FALSE); case bfd_data_link_order: return default_data_link_order (abfd, info, sec, link_order); } @@ -2682,33 +2606,32 @@ _bfd_default_link_order (abfd, info, sec, link_order) /* Default routine to handle a bfd_data_link_order. */ -static boolean -default_data_link_order (abfd, info, sec, link_order) - bfd *abfd; - struct bfd_link_info *info ATTRIBUTE_UNUSED; - asection *sec; - struct bfd_link_order *link_order; +static bfd_boolean +default_data_link_order (bfd *abfd, + struct bfd_link_info *info ATTRIBUTE_UNUSED, + asection *sec, + struct bfd_link_order *link_order) { bfd_size_type size; size_t fill_size; bfd_byte *fill; file_ptr loc; - boolean result; + bfd_boolean result; BFD_ASSERT ((sec->flags & SEC_HAS_CONTENTS) != 0); size = link_order->size; if (size == 0) - return true; + return TRUE; fill = link_order->u.data.contents; fill_size = link_order->u.data.size; if (fill_size != 0 && fill_size < size) { bfd_byte *p; - fill = (bfd_byte *) bfd_malloc (size); + fill = bfd_malloc (size); if (fill == NULL) - return false; + return FALSE; p = fill; if (fill_size == 1) memset (p, (int) link_order->u.data.contents[0], (size_t) size); @@ -2737,14 +2660,12 @@ default_data_link_order (abfd, info, sec, link_order) /* Default routine to handle a bfd_indirect_link_order. */ -static boolean -default_indirect_link_order (output_bfd, info, output_section, link_order, - generic_linker) - bfd *output_bfd; - struct bfd_link_info *info; - asection *output_section; - struct bfd_link_order *link_order; - boolean generic_linker; +static bfd_boolean +default_indirect_link_order (bfd *output_bfd, + struct bfd_link_info *info, + asection *output_section, + struct bfd_link_order *link_order, + bfd_boolean generic_linker) { asection *input_section; bfd *input_bfd; @@ -2756,7 +2677,7 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, BFD_ASSERT ((output_section->flags & SEC_HAS_CONTENTS) != 0); if (link_order->size == 0) - return true; + return TRUE; input_section = link_order->u.indirect.section; input_bfd = input_section->owner; @@ -2765,9 +2686,9 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, BFD_ASSERT (input_section->output_offset == link_order->offset); BFD_ASSERT (input_section->_cooked_size == link_order->size); - if (info->relocateable + if (info->relocatable && input_section->reloc_count > 0 - && output_section->orelocation == (arelent **) NULL) + && output_section->orelocation == NULL) { /* Space has not been allocated for the output relocations. This can happen when we are called by a specific backend @@ -2775,10 +2696,10 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, types of object files. Handling this case correctly is difficult, and sometimes impossible. */ (*_bfd_error_handler) - (_("Attempt to do relocateable link with %s input and %s output"), + (_("Attempt to do relocatable link with %s input and %s output"), bfd_get_target (input_bfd), bfd_get_target (output_bfd)); bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; } if (! generic_linker) @@ -2791,7 +2712,7 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, a specific linker, presumably because we are linking different types of object files together. */ if (! generic_link_read_symbols (input_bfd)) - return false; + return FALSE; /* Since we have been called by a specific linker, rather than the generic linker, the values of the symbols will not be @@ -2819,15 +2740,15 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, /* sym->udata may have been set by generic_link_add_symbol_list. */ if (sym->udata.p != NULL) - h = (struct bfd_link_hash_entry *) sym->udata.p; + h = sym->udata.p; else if (bfd_is_und_section (bfd_get_section (sym))) h = bfd_wrapped_link_hash_lookup (output_bfd, info, bfd_asymbol_name (sym), - false, false, true); + FALSE, FALSE, TRUE); else h = bfd_link_hash_lookup (info->hash, bfd_asymbol_name (sym), - false, false, true); + FALSE, FALSE, TRUE); if (h != NULL) set_symbol_from_hash (sym, h); } @@ -2836,11 +2757,11 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, /* Get and relocate the section contents. */ sec_size = bfd_section_size (input_bfd, input_section); - contents = ((bfd_byte *) bfd_malloc (sec_size)); + contents = bfd_malloc (sec_size); if (contents == NULL && sec_size != 0) goto error_return; new_contents = (bfd_get_relocated_section_contents - (output_bfd, info, link_order, contents, info->relocateable, + (output_bfd, info, link_order, contents, info->relocatable, _bfd_generic_link_get_symbols (input_bfd))); if (!new_contents) goto error_return; @@ -2848,31 +2769,30 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, /* Output the section contents. */ loc = link_order->offset * bfd_octets_per_byte (output_bfd); if (! bfd_set_section_contents (output_bfd, output_section, - (PTR) new_contents, loc, link_order->size)) + new_contents, loc, link_order->size)) goto error_return; if (contents != NULL) free (contents); - return true; + return TRUE; error_return: if (contents != NULL) free (contents); - return false; + return FALSE; } /* A little routine to count the number of relocs in a link_order list. */ unsigned int -_bfd_count_link_order_relocs (link_order) - struct bfd_link_order *link_order; +_bfd_count_link_order_relocs (struct bfd_link_order *link_order) { register unsigned int c; register struct bfd_link_order *l; c = 0; - for (l = link_order; l != (struct bfd_link_order *) NULL; l = l->next) + for (l = link_order; l != NULL; l = l->next) { if (l->type == bfd_section_reloc_link_order || l->type == bfd_symbol_reloc_link_order) @@ -2887,7 +2807,7 @@ FUNCTION bfd_link_split_section SYNOPSIS - boolean bfd_link_split_section(bfd *abfd, asection *sec); + bfd_boolean bfd_link_split_section (bfd *abfd, asection *sec); DESCRIPTION Return nonzero if @var{sec} should be split during a @@ -2899,10 +2819,9 @@ DESCRIPTION */ -boolean -_bfd_generic_link_split_section (abfd, sec) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; +bfd_boolean +_bfd_generic_link_split_section (bfd *abfd ATTRIBUTE_UNUSED, + asection *sec ATTRIBUTE_UNUSED) { - return false; + return FALSE; } diff --git a/contrib/binutils/bfd/merge.c b/contrib/binutils/bfd/merge.c index 9dc2e70..89f45cd 100644 --- a/contrib/binutils/bfd/merge.c +++ b/contrib/binutils/bfd/merge.c @@ -1,5 +1,5 @@ /* SEC_MERGE support. - Copyright 2001, 2002 Free Software Foundation, Inc. + Copyright 2001, 2002, 2003 Free Software Foundation, Inc. Written by Jakub Jelinek . This file is part of BFD, the Binary File Descriptor library. @@ -34,7 +34,7 @@ struct sec_merge_sec_info; struct sec_merge_hash_entry { struct bfd_hash_entry root; - /* Length of this entry. */ + /* Length of this entry. This includes the zero terminator. */ unsigned int len; /* Start of this string needs to be aligned to alignment octets (not 1 << align). */ @@ -43,8 +43,6 @@ struct sec_merge_hash_entry { /* Index within the merged section. */ bfd_size_type index; - /* Entity size (if present in suffix hash tables). */ - unsigned int entsize; /* Entry this is a suffix of (if alignment is 0). */ struct sec_merge_hash_entry *suffix; } u; @@ -68,7 +66,7 @@ struct sec_merge_hash /* Entity size. */ unsigned int entsize; /* Are entries fixed size or zero terminated strings? */ - boolean strings; + bfd_boolean strings; }; struct sec_merge_info @@ -88,7 +86,7 @@ struct sec_merge_sec_info /* The corresponding section. */ asection *sec; /* Pointer to merge_info pointing to us. */ - PTR *psecinfo; + void **psecinfo; /* A hash table used to hold section content. */ struct sec_merge_hash *htab; /* First string in this section. */ @@ -97,31 +95,12 @@ struct sec_merge_sec_info unsigned char contents[1]; }; -static struct bfd_hash_entry *sec_merge_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static struct sec_merge_hash_entry *sec_merge_hash_lookup - PARAMS ((struct sec_merge_hash *, const char *, unsigned int, boolean)); -static struct sec_merge_hash *sec_merge_init - PARAMS ((unsigned int, boolean)); -static struct sec_merge_hash_entry *sec_merge_add - PARAMS ((struct sec_merge_hash *, const char *, unsigned int, - struct sec_merge_sec_info *)); -static boolean sec_merge_emit - PARAMS ((bfd *, struct sec_merge_hash_entry *)); -static int cmplengthentry PARAMS ((const PTR, const PTR)); -static int last4_eq PARAMS ((const PTR, const PTR)); -static int last_eq PARAMS ((const PTR, const PTR)); -static boolean record_section - PARAMS ((struct sec_merge_info *, struct sec_merge_sec_info *)); -static void merge_strings PARAMS ((struct sec_merge_info *)); /* Routine to create an entry in a section merge hashtab. */ static struct bfd_hash_entry * -sec_merge_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +sec_merge_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, const char *string) { struct sec_merge_hash_entry *ret = (struct sec_merge_hash_entry *) entry; @@ -152,11 +131,8 @@ sec_merge_hash_newfunc (entry, table, string) /* Look up an entry in a section merge hash table. */ static struct sec_merge_hash_entry * -sec_merge_hash_lookup (table, string, alignment, create) - struct sec_merge_hash *table; - const char *string; - unsigned int alignment; - boolean create; +sec_merge_hash_lookup (struct sec_merge_hash *table, const char *string, + unsigned int alignment, bfd_boolean create) { register const unsigned char *s; register unsigned long hash; @@ -227,9 +203,12 @@ sec_merge_hash_lookup (table, string, alignment, create) alignment, we need to insert another copy. */ if (hashp->alignment < alignment) { - /* Mark the less aligned copy as deleted. */ - hashp->len = 0; - hashp->alignment = 0; + if (create) + { + /* Mark the less aligned copy as deleted. */ + hashp->len = 0; + hashp->alignment = 0; + } break; } return hashp; @@ -257,9 +236,7 @@ sec_merge_hash_lookup (table, string, alignment, create) /* Create a new hash table. */ static struct sec_merge_hash * -sec_merge_init (entsize, strings) - unsigned int entsize; - boolean strings; +sec_merge_init (unsigned int entsize, bfd_boolean strings) { struct sec_merge_hash *table; bfd_size_type amt = sizeof (struct sec_merge_hash); @@ -287,15 +264,12 @@ sec_merge_init (entsize, strings) already present. */ static struct sec_merge_hash_entry * -sec_merge_add (tab, str, alignment, secinfo) - struct sec_merge_hash *tab; - const char *str; - unsigned int alignment; - struct sec_merge_sec_info *secinfo; +sec_merge_add (struct sec_merge_hash *tab, const char *str, + unsigned int alignment, struct sec_merge_sec_info *secinfo) { register struct sec_merge_hash_entry *entry; - entry = sec_merge_hash_lookup (tab, str, alignment, true); + entry = sec_merge_hash_lookup (tab, str, alignment, TRUE); if (entry == NULL) return NULL; @@ -313,10 +287,8 @@ sec_merge_add (tab, str, alignment, secinfo) return entry; } -static boolean -sec_merge_emit (abfd, entry) - register bfd *abfd; - struct sec_merge_hash_entry *entry; +static bfd_boolean +sec_merge_emit (bfd *abfd, struct sec_merge_hash_entry *entry) { struct sec_merge_sec_info *secinfo = entry->secinfo; asection *sec = secinfo->sec; @@ -336,7 +308,7 @@ sec_merge_emit (abfd, entry) if (len) { len = entry->alignment - len; - if (bfd_bwrite ((PTR) pad, (bfd_size_type) len, abfd) != len) + if (bfd_bwrite (pad, (bfd_size_type) len, abfd) != len) break; off += len; } @@ -344,7 +316,7 @@ sec_merge_emit (abfd, entry) str = entry->root.string; len = entry->len; - if (bfd_bwrite ((PTR) str, (bfd_size_type) len, abfd) != len) + if (bfd_bwrite (str, (bfd_size_type) len, abfd) != len) break; off += len; @@ -353,18 +325,14 @@ sec_merge_emit (abfd, entry) if (alignment_power) free (pad); - return (boolean) (entry == NULL || entry->secinfo != secinfo); + return entry == NULL || entry->secinfo != secinfo; } /* This function is called for each input file from the add_symbols pass of the linker. */ -boolean -_bfd_merge_section (abfd, psinfo, sec, psecinfo) - bfd *abfd; - PTR *psinfo; - asection *sec; - PTR *psecinfo; +bfd_boolean +_bfd_merge_section (bfd *abfd, void **psinfo, asection *sec, void **psecinfo) { struct sec_merge_info *sinfo; struct sec_merge_sec_info *secinfo; @@ -375,12 +343,12 @@ _bfd_merge_section (abfd, psinfo, sec, psecinfo) || (sec->flags & SEC_EXCLUDE) || (sec->flags & SEC_MERGE) == 0 || sec->entsize == 0) - return true; + return TRUE; if ((sec->flags & SEC_RELOC) != 0) { /* We aren't prepared to handle relocations in merged sections. */ - return true; + return TRUE; } align = bfd_get_section_alignment (sec->owner, sec); @@ -396,7 +364,7 @@ _bfd_merge_section (abfd, psinfo, sec, psecinfo) of alignment. For non-string constants, alignment must be smaller than or equal to entity size and entity size must be integer multiple of alignment. */ - return true; + return TRUE; } for (sinfo = (struct sec_merge_info *) *psinfo; sinfo; sinfo = sinfo->next) @@ -415,7 +383,7 @@ _bfd_merge_section (abfd, psinfo, sec, psecinfo) goto error_return; sinfo->next = (struct sec_merge_info *) *psinfo; sinfo->chain = NULL; - *psinfo = (PTR) sinfo; + *psinfo = sinfo; sinfo->htab = sec_merge_init (sec->entsize, (sec->flags & SEC_STRINGS)); if (sinfo->htab == NULL) goto error_return; @@ -446,108 +414,28 @@ _bfd_merge_section (abfd, psinfo, sec, psecinfo) (bfd_vma) 0, sec->_raw_size)) goto error_return; - return true; + return TRUE; error_return: *psecinfo = NULL; - return false; -} - -/* Compare two sec_merge_hash_entry structures. This is called via qsort. */ - -static int -cmplengthentry (a, b) - const PTR a; - const PTR b; -{ - struct sec_merge_hash_entry * A = *(struct sec_merge_hash_entry **) a; - struct sec_merge_hash_entry * B = *(struct sec_merge_hash_entry **) b; - - if (A->len < B->len) - return 1; - else if (A->len > B->len) - return -1; - - return memcmp (A->root.string, B->root.string, A->len); -} - -static int -last4_eq (a, b) - const PTR a; - const PTR b; -{ - struct sec_merge_hash_entry * A = (struct sec_merge_hash_entry *) a; - struct sec_merge_hash_entry * B = (struct sec_merge_hash_entry *) b; - - if (memcmp (A->root.string + A->len - 5 * A->u.entsize, - B->root.string + B->len - 5 * A->u.entsize, - 4 * A->u.entsize) != 0) - /* This was a hashtable collision. */ - return 0; - - if (A->len <= B->len) - /* B cannot be a suffix of A unless A is equal to B, which is guaranteed - not to be equal by the hash table. */ - return 0; - - if (A->alignment < B->alignment - || ((A->len - B->len) & (B->alignment - 1))) - /* The suffix is not sufficiently aligned. */ - return 0; - - return memcmp (A->root.string + (A->len - B->len), - B->root.string, B->len - 5 * A->u.entsize) == 0; -} - -static int -last_eq (a, b) - const PTR a; - const PTR b; -{ - struct sec_merge_hash_entry * A = (struct sec_merge_hash_entry *) a; - struct sec_merge_hash_entry * B = (struct sec_merge_hash_entry *) b; - - if (B->len >= 5 * A->u.entsize) - /* Longer strings are just pushed into the hash table, - they'll be used when looking up for very short strings. */ - return 0; - - if (memcmp (A->root.string + A->len - 2 * A->u.entsize, - B->root.string + B->len - 2 * A->u.entsize, - A->u.entsize) != 0) - /* This was a hashtable collision. */ - return 0; - - if (A->len <= B->len) - /* B cannot be a suffix of A unless A is equal to B, which is guaranteed - not to be equal by the hash table. */ - return 0; - - if (A->alignment < B->alignment - || ((A->len - B->len) & (B->alignment - 1))) - /* The suffix is not sufficiently aligned. */ - return 0; - - return memcmp (A->root.string + (A->len - B->len), - B->root.string, B->len - 2 * A->u.entsize) == 0; + return FALSE; } /* Record one section into the hash table. */ -static boolean -record_section (sinfo, secinfo) - struct sec_merge_info *sinfo; - struct sec_merge_sec_info *secinfo; +static bfd_boolean +record_section (struct sec_merge_info *sinfo, + struct sec_merge_sec_info *secinfo) { asection *sec = secinfo->sec; struct sec_merge_hash_entry *entry; - boolean nul; + bfd_boolean nul; unsigned char *p, *end; bfd_vma mask, eltalign; unsigned int align, i; align = bfd_get_section_alignment (sec->owner, sec); end = secinfo->contents + sec->_raw_size; - nul = false; + nul = FALSE; mask = ((bfd_vma) 1 << align) - 1; if (sec->flags & SEC_STRINGS) { @@ -567,14 +455,14 @@ record_section (sinfo, secinfo) { if (!nul && !((p - secinfo->contents) & mask)) { - nul = true; + nul = TRUE; entry = sec_merge_add (sinfo->htab, "", (unsigned) mask + 1, secinfo); if (! entry) goto error_return; } p++; - } + } } else { @@ -587,7 +475,7 @@ record_section (sinfo, secinfo) break; if (!nul && !((p - secinfo->contents) & mask)) { - nul = true; + nul = TRUE; entry = sec_merge_add (sinfo->htab, p, (unsigned) mask + 1, secinfo); if (! entry) @@ -608,27 +496,89 @@ record_section (sinfo, secinfo) } } - return true; + return TRUE; error_return: for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next) *secinfo->psecinfo = NULL; - return false; + return FALSE; +} + +static int +strrevcmp (const void *a, const void *b) +{ + struct sec_merge_hash_entry *A = *(struct sec_merge_hash_entry **) a; + struct sec_merge_hash_entry *B = *(struct sec_merge_hash_entry **) b; + unsigned int lenA = A->len; + unsigned int lenB = B->len; + const unsigned char *s = A->root.string + lenA - 1; + const unsigned char *t = B->root.string + lenB - 1; + int l = lenA < lenB ? lenA : lenB; + + while (l) + { + if (*s != *t) + return (int) *s - (int) *t; + s--; + t--; + l--; + } + return lenA - lenB; +} + +/* Like strrevcmp, but for the case where all strings have the same + alignment > entsize. */ + +static int +strrevcmp_align (const void *a, const void *b) +{ + struct sec_merge_hash_entry *A = *(struct sec_merge_hash_entry **) a; + struct sec_merge_hash_entry *B = *(struct sec_merge_hash_entry **) b; + unsigned int lenA = A->len; + unsigned int lenB = B->len; + const unsigned char *s = A->root.string + lenA - 1; + const unsigned char *t = B->root.string + lenB - 1; + int l = lenA < lenB ? lenA : lenB; + int tail_align = (lenA & (A->alignment - 1)) - (lenB & (A->alignment - 1)); + + if (tail_align != 0) + return tail_align; + + while (l) + { + if (*s != *t) + return (int) *s - (int) *t; + s--; + t--; + l--; + } + return lenA - lenB; +} + +static inline int +is_suffix (const struct sec_merge_hash_entry *A, + const struct sec_merge_hash_entry *B) +{ + if (A->len <= B->len) + /* B cannot be a suffix of A unless A is equal to B, which is guaranteed + not to be equal by the hash table. */ + return 0; + + return memcmp (A->root.string + (A->len - B->len), + B->root.string, B->len) == 0; } /* This is a helper function for _bfd_merge_sections. It attempts to merge strings matching suffixes of longer strings. */ static void -merge_strings (sinfo) - struct sec_merge_info *sinfo; +merge_strings (struct sec_merge_info *sinfo) { - struct sec_merge_hash_entry **array, **a, **end, *e; + struct sec_merge_hash_entry **array, **a, *e; struct sec_merge_sec_info *secinfo; - htab_t lasttab = NULL, last4tab = NULL; bfd_size_type size, amt; + unsigned int alignment = 0; - /* Now sort the strings by length, longest first. */ - array = NULL; + /* Now sort the strings */ amt = sinfo->htab->size * sizeof (struct sec_merge_hash_entry *); array = (struct sec_merge_hash_entry **) bfd_malloc (amt); if (array == NULL) @@ -636,90 +586,50 @@ merge_strings (sinfo) for (e = sinfo->htab->first, a = array; e; e = e->next) if (e->alignment) - *a++ = e; + { + *a++ = e; + /* Adjust the length to not include the zero terminator. */ + e->len -= sinfo->htab->entsize; + if (alignment != e->alignment) + { + if (alignment == 0) + alignment = e->alignment; + else + alignment = (unsigned) -1; + } + } sinfo->htab->size = a - array; - - qsort (array, (size_t) sinfo->htab->size, - sizeof (struct sec_merge_hash_entry *), cmplengthentry); - - last4tab = htab_create_alloc ((size_t) sinfo->htab->size * 4, - NULL, last4_eq, NULL, calloc, free); - lasttab = htab_create_alloc ((size_t) sinfo->htab->size * 4, - NULL, last_eq, NULL, calloc, free); - if (lasttab == NULL || last4tab == NULL) - goto alloc_failure; - - /* Now insert the strings into hash tables (strings with last 4 characters - and strings with last character equal), look for longer strings which - we're suffix of. */ - for (a = array, end = array + sinfo->htab->size; a < end; a++) + if (sinfo->htab->size != 0) { - register hashval_t hash; - unsigned int c; - unsigned int i; - const unsigned char *s; - PTR *p; - - e = *a; - e->u.entsize = sinfo->htab->entsize; - if (e->len <= e->u.entsize) - break; - if (e->len > 4 * e->u.entsize) + qsort (array, (size_t) sinfo->htab->size, + sizeof (struct sec_merge_hash_entry *), + (alignment != (unsigned) -1 && alignment > sinfo->htab->entsize + ? strrevcmp_align : strrevcmp)); + + /* Loop over the sorted array and merge suffixes */ + e = *--a; + e->len += sinfo->htab->entsize; + while (--a >= array) { - s = (const unsigned char *) (e->root.string + e->len - e->u.entsize); - hash = 0; - for (i = 0; i < 4 * e->u.entsize; i++) - { - c = *--s; - hash += c + (c << 17); - hash ^= hash >> 2; - } - p = htab_find_slot_with_hash (last4tab, e, hash, INSERT); - if (p == NULL) - goto alloc_failure; - if (*p) - { - struct sec_merge_hash_entry *ent; + struct sec_merge_hash_entry *cmp = *a; - ent = (struct sec_merge_hash_entry *) *p; - e->u.suffix = ent; - e->alignment = 0; - continue; + cmp->len += sinfo->htab->entsize; + if (e->alignment >= cmp->alignment + && !((e->len - cmp->len) & (cmp->alignment - 1)) + && is_suffix (e, cmp)) + { + cmp->u.suffix = e; + cmp->alignment = 0; } else - *p = (PTR) e; + e = cmp; } - s = (const unsigned char *) (e->root.string + e->len - e->u.entsize); - hash = 0; - for (i = 0; i < e->u.entsize; i++) - { - c = *--s; - hash += c + (c << 17); - hash ^= hash >> 2; - } - p = htab_find_slot_with_hash (lasttab, e, hash, INSERT); - if (p == NULL) - goto alloc_failure; - if (*p) - { - struct sec_merge_hash_entry *ent; - - ent = (struct sec_merge_hash_entry *) *p; - e->u.suffix = ent; - e->alignment = 0; - } - else - *p = (PTR) e; } alloc_failure: if (array) free (array); - if (lasttab) - htab_delete (lasttab); - if (last4tab) - htab_delete (last4tab); /* Now assign positions to the strings we want to keep. */ size = 0; @@ -765,11 +675,9 @@ alloc_failure: /* This function is called once after all SEC_MERGE sections are registered with _bfd_merge_section. */ -boolean -_bfd_merge_sections (abfd, xsinfo, remove_hook) - bfd *abfd ATTRIBUTE_UNUSED; - PTR xsinfo; - void (*remove_hook) PARAMS((bfd *, asection *)); +bfd_boolean +_bfd_merge_sections (bfd *abfd ATTRIBUTE_UNUSED, void *xsinfo, + void (*remove_hook) (bfd *, asection *)) { struct sec_merge_info *sinfo; @@ -830,23 +738,23 @@ _bfd_merge_sections (abfd, xsinfo, remove_hook) secinfo->sec->_cooked_size = size; } - /* Finally shrink all input sections which have not made it into + /* Finally remove all input sections which have not made it into the hash table at all. */ for (secinfo = sinfo->chain; secinfo; secinfo = secinfo->next) - if (secinfo->first == NULL) - secinfo->sec->_cooked_size = 0; + if (secinfo->first == NULL) + { + secinfo->sec->_cooked_size = 0; + secinfo->sec->flags |= SEC_EXCLUDE; + } } - return true; + return TRUE; } /* Write out the merged section. */ -boolean -_bfd_write_merged_section (output_bfd, sec, psecinfo) - bfd *output_bfd; - asection *sec; - PTR psecinfo; +bfd_boolean +_bfd_write_merged_section (bfd *output_bfd, asection *sec, void *psecinfo) { struct sec_merge_sec_info *secinfo; file_ptr pos; @@ -854,16 +762,16 @@ _bfd_write_merged_section (output_bfd, sec, psecinfo) secinfo = (struct sec_merge_sec_info *) psecinfo; if (!secinfo->first) - return true; + return TRUE; pos = sec->output_section->filepos + sec->output_offset; if (bfd_seek (output_bfd, pos, SEEK_SET) != 0) - return false; + return FALSE; if (! sec_merge_emit (output_bfd, secinfo->first)) - return false; + return FALSE; - return true; + return TRUE; } /* Adjust an address in the SEC_MERGE section. Given OFFSET within @@ -871,11 +779,8 @@ _bfd_write_merged_section (output_bfd, sec, psecinfo) section and writes the new section back into *PSEC. */ bfd_vma -_bfd_merged_section_offset (output_bfd, psec, psecinfo, offset, addend) - bfd *output_bfd ATTRIBUTE_UNUSED; - asection **psec; - PTR psecinfo; - bfd_vma offset, addend; +_bfd_merged_section_offset (bfd *output_bfd ATTRIBUTE_UNUSED, asection **psec, + void *psecinfo, bfd_vma offset, bfd_vma addend) { struct sec_merge_sec_info *secinfo; struct sec_merge_hash_entry *entry; @@ -928,7 +833,7 @@ _bfd_merged_section_offset (output_bfd, psec, psecinfo, offset, addend) p = secinfo->contents + ((offset + addend) / sec->entsize) * sec->entsize; } - entry = sec_merge_hash_lookup (secinfo->htab, p, 0, false); + entry = sec_merge_hash_lookup (secinfo->htab, p, 0, FALSE); if (!entry) { if (! secinfo->htab->strings) diff --git a/contrib/binutils/bfd/netbsd-core.c b/contrib/binutils/bfd/netbsd-core.c index 2787c46..84f2ad7 100644 --- a/contrib/binutils/bfd/netbsd-core.c +++ b/contrib/binutils/bfd/netbsd-core.c @@ -1,6 +1,6 @@ /* BFD back end for NetBSD style core files Copyright 1988, 1989, 1991, 1992, 1993, 1996, 1998, 1999, 2000, 2001, - 2002 + 2002, 2003, 2004 Free Software Foundation, Inc. Written by Paul Kranenburg, EUR @@ -34,22 +34,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ * FIXME: On NetBSD/sparc CORE_FPU_OFFSET should be (sizeof (struct trapframe)) */ +/* Offset of StackGhost cookie within `struct md_coredump' on + OpenBSD/sparc. */ +#define CORE_WCOOKIE_OFFSET 344 + struct netbsd_core_struct { struct core core; } *rawptr; /* forward declarations */ -static const bfd_target *netbsd_core_file_p PARAMS ((bfd *abfd)); -static char *netbsd_core_file_failing_command PARAMS ((bfd *abfd)); -static int netbsd_core_file_failing_signal PARAMS ((bfd *abfd)); -static boolean netbsd_core_file_matches_executable_p +static const bfd_target *netbsd_core_file_p + PARAMS ((bfd *abfd)); +static char *netbsd_core_file_failing_command + PARAMS ((bfd *abfd)); +static int netbsd_core_file_failing_signal + PARAMS ((bfd *abfd)); +static bfd_boolean netbsd_core_file_matches_executable_p PARAMS ((bfd *core_bfd, bfd *exec_bfd)); -static void swap_abort PARAMS ((void)); +static void swap_abort + PARAMS ((void)); /* Handle NetBSD-style core dump file. */ -/* ARGSUSED */ static const bfd_target * netbsd_core_file_p (abfd) bfd *abfd; @@ -136,6 +143,25 @@ netbsd_core_file_p (abfd) asect->filepos = offset; asect->alignment_power = 2; + if (CORE_GETMID (core) == M_SPARC_NETBSD + && CORE_GETFLAG (coreseg) == CORE_CPU + && coreseg.c_size > CORE_WCOOKIE_OFFSET) + { + /* Truncate the .reg section. */ + asect->_raw_size = CORE_WCOOKIE_OFFSET; + + /* And create the .wcookie section. */ + asect = bfd_make_section_anyway (abfd, ".wcookie"); + if (asect == NULL) + goto punt; + + asect->flags = SEC_ALLOC + SEC_HAS_CONTENTS; + asect->_raw_size = 4; + asect->vma = 0; + asect->filepos = offset + CORE_WCOOKIE_OFFSET; + asect->alignment_power = 2; + } + offset += coreseg.c_size; #ifdef CORE_FPU_OFFSET @@ -175,7 +201,6 @@ netbsd_core_file_failing_command (abfd) return abfd->tdata.netbsd_core_data->core.c_name; } -/* ARGSUSED */ static int netbsd_core_file_failing_signal (abfd) bfd *abfd; @@ -184,13 +209,12 @@ netbsd_core_file_failing_signal (abfd) return abfd->tdata.netbsd_core_data->core.c_signo; } -/* ARGSUSED */ -static boolean +static bfd_boolean netbsd_core_file_matches_executable_p (core_bfd, exec_bfd) bfd *core_bfd ATTRIBUTE_UNUSED; bfd *exec_bfd ATTRIBUTE_UNUSED; { - return true; /* FIXME, We have no way of telling at this point */ + return TRUE; /* FIXME, We have no way of telling at this point */ } /* If somebody calls any byte-swapping routines, shoot them. */ @@ -199,10 +223,13 @@ swap_abort () { 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 ) -#define NO_SIGNED_GET \ - ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort ) + +#define NO_GET ((bfd_vma (*) (const void *)) swap_abort) +#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort) +#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort) +#define NO_GET64 ((bfd_uint64_t (*) (const void *)) swap_abort) +#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort) +#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort) const bfd_target netbsd_core_vec = { @@ -217,39 +244,39 @@ const bfd_target netbsd_core_vec = 0, /* symbol prefix */ ' ', /* ar_pad_char */ 16, /* ar_max_namelen */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs */ + NO_GET64, NO_GETS64, NO_PUT64, /* 64 bit data. */ + NO_GET, NO_GETS, NO_PUT, /* 32 bit data. */ + NO_GET, NO_GETS, NO_PUT, /* 16 bit data. */ + NO_GET64, NO_GETS64, NO_PUT64, /* 64 bit hdrs. */ + NO_GET, NO_GETS, NO_PUT, /* 32 bit hdrs. */ + NO_GET, NO_GETS, NO_PUT, /* 16 bit hdrs. */ { /* bfd_check_format */ - _bfd_dummy_target, /* unknown format */ - _bfd_dummy_target, /* object file */ - _bfd_dummy_target, /* archive */ - netbsd_core_file_p /* a core file */ + _bfd_dummy_target, /* unknown format */ + _bfd_dummy_target, /* object file */ + _bfd_dummy_target, /* archive */ + netbsd_core_file_p /* a core file */ }, { /* bfd_set_format */ - bfd_false, bfd_false, - bfd_false, bfd_false + bfd_false, bfd_false, + bfd_false, bfd_false }, { /* bfd_write_contents */ - bfd_false, bfd_false, - bfd_false, bfd_false + 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), - 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 (netbsd), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (_bfd_generic), + BFD_JUMP_TABLE_LINK (_bfd_nolink), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, (PTR) 0 /* backend_data */ -}; + }; diff --git a/contrib/binutils/bfd/netbsd.h b/contrib/binutils/bfd/netbsd.h index 0558032..04a4eab 100644 --- a/contrib/binutils/bfd/netbsd.h +++ b/contrib/binutils/bfd/netbsd.h @@ -1,5 +1,5 @@ /* BFD back-end definitions used by all NetBSD targets. - Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000 + Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -64,7 +64,7 @@ USA. */ #define MY_entry_is_text_address 1 #define MY_write_object_contents MY(write_object_contents) -static boolean MY(write_object_contents) PARAMS ((bfd *abfd)); +static bfd_boolean MY(write_object_contents) PARAMS ((bfd *abfd)); #define MY_text_includes_header 1 #include "aout-target.h" @@ -73,7 +73,7 @@ static boolean MY(write_object_contents) PARAMS ((bfd *abfd)); Section contents have already been written. We write the file header, symbols, and relocation. */ -static boolean +static bfd_boolean MY(write_object_contents) (abfd) bfd *abfd; { @@ -114,5 +114,5 @@ MY(write_object_contents) (abfd) WRITE_HEADERS(abfd, execp); - return true; + return TRUE; } diff --git a/contrib/binutils/bfd/opncls.c b/contrib/binutils/bfd/opncls.c index cdf08df..6abd405 100644 --- a/contrib/binutils/bfd/opncls.c +++ b/contrib/binutils/bfd/opncls.c @@ -1,6 +1,6 @@ /* opncls.c -- open and close a BFD. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, - 2001, 2002 + 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. @@ -25,6 +25,7 @@ #include "sysdep.h" #include "objalloc.h" #include "libbfd.h" +#include "libiberty.h" #ifndef S_IXUSR #define S_IXUSR 0100 /* Execute by owner. */ @@ -36,21 +37,27 @@ #define S_IXOTH 0001 /* Execute by others. */ #endif +/* Counter used to initialize the bfd identifier. */ + +static unsigned int _bfd_id_counter = 0; + /* fdopen is a loser -- we should use stdio exclusively. Unfortunately if we do that we can't use fcntl. */ /* Return a new BFD. All BFD's are allocated through this routine. */ bfd * -_bfd_new_bfd () +_bfd_new_bfd (void) { bfd *nbfd; - nbfd = (bfd *) bfd_zmalloc ((bfd_size_type) sizeof (bfd)); + nbfd = bfd_zmalloc (sizeof (bfd)); if (nbfd == NULL) return NULL; - nbfd->memory = (PTR) objalloc_create (); + nbfd->id = _bfd_id_counter++; + + nbfd->memory = objalloc_create (); if (nbfd->memory == NULL) { bfd_set_error (bfd_error_no_memory); @@ -63,23 +70,24 @@ _bfd_new_bfd () nbfd->direction = no_direction; nbfd->iostream = NULL; nbfd->where = 0; - if (!bfd_hash_table_init (&nbfd->section_htab, bfd_section_hash_newfunc)) + if (!bfd_hash_table_init_n (& nbfd->section_htab, bfd_section_hash_newfunc, + 251)) { free (nbfd); return NULL; } - nbfd->sections = (asection *) NULL; + nbfd->sections = NULL; nbfd->section_tail = &nbfd->sections; nbfd->format = bfd_unknown; - nbfd->my_archive = (bfd *) NULL; + nbfd->my_archive = NULL; nbfd->origin = 0; - nbfd->opened_once = false; - nbfd->output_has_begun = false; + nbfd->opened_once = FALSE; + nbfd->output_has_begun = FALSE; nbfd->section_count = 0; - nbfd->usrdata = (PTR) NULL; - nbfd->cacheable = false; + nbfd->usrdata = NULL; + nbfd->cacheable = FALSE; nbfd->flags = BFD_NO_FLAGS; - nbfd->mtime_set = false; + nbfd->mtime_set = FALSE; return nbfd; } @@ -87,8 +95,7 @@ _bfd_new_bfd () /* Allocate a new BFD as a member of archive OBFD. */ bfd * -_bfd_new_bfd_contained_in (obfd) - bfd *obfd; +_bfd_new_bfd_contained_in (bfd *obfd) { bfd *nbfd; @@ -105,8 +112,7 @@ _bfd_new_bfd_contained_in (obfd) /* Delete a BFD. */ void -_bfd_delete_bfd (abfd) - bfd *abfd; +_bfd_delete_bfd (bfd *abfd) { bfd_hash_table_free (&abfd->section_htab); objalloc_free ((struct objalloc *) abfd->memory); @@ -124,7 +130,7 @@ FUNCTION bfd_openr SYNOPSIS - bfd *bfd_openr(const char *filename, const char *target); + bfd *bfd_openr (const char *filename, const char *target); DESCRIPTION Open the file @var{filename} (using <>) with the target @@ -134,13 +140,12 @@ DESCRIPTION that function. If <> is returned then an error has occured. Possible errors - are <>, <> or <> error. + are <>, <> or + <> error. */ bfd * -bfd_openr (filename, target) - const char *filename; - const char *target; +bfd_openr (const char *filename, const char *target) { bfd *nbfd; const bfd_target *target_vec; @@ -179,35 +184,32 @@ bfd_openr (filename, target) the file descriptor too, even though we didn't open it. */ /* FUNCTION - bfd_fdopenr + bfd_fdopenr SYNOPSIS - bfd *bfd_fdopenr(const char *filename, const char *target, int fd); + bfd *bfd_fdopenr (const char *filename, const char *target, int fd); DESCRIPTION - <> is to <> much like <> is to <>. - It opens a BFD on a file already described by the @var{fd} - supplied. - - When the file is later <>d, the file descriptor will be closed. - - If the caller desires that this file descriptor be cached by BFD - (opened as needed, closed as needed to free descriptors for - other opens), with the supplied @var{fd} used as an initial - file descriptor (but subject to closure at any time), call - bfd_set_cacheable(bfd, 1) on the returned BFD. The default is to - assume no cacheing; the file descriptor will remain open until - <>, and will not be affected by BFD operations on other - files. - - Possible errors are <>, <> and <>. + <> is to <> much like <> is to + <>. It opens a BFD on a file already described by the + @var{fd} supplied. + + When the file is later <>d, the file descriptor will + be closed. If the caller desires that this file descriptor be + cached by BFD (opened as needed, closed as needed to free + descriptors for other opens), with the supplied @var{fd} used as + an initial file descriptor (but subject to closure at any time), + call bfd_set_cacheable(bfd, 1) on the returned BFD. The default + is to assume no caching; the file descriptor will remain open + until <>, and will not be affected by BFD operations + on other files. + + Possible errors are <>, + <> and <>. */ bfd * -bfd_fdopenr (filename, target, fd) - const char *filename; - const char *target; - int fd; +bfd_fdopenr (const char *filename, const char *target, int fd) { bfd *nbfd; const bfd_target *target_vec; @@ -234,14 +236,14 @@ bfd_fdopenr (filename, target, fd) } #ifndef HAVE_FDOPEN - nbfd->iostream = (PTR) fopen (filename, FOPEN_RB); + nbfd->iostream = fopen (filename, FOPEN_RB); #else /* (O_ACCMODE) parens are to avoid Ultrix header file bug. */ switch (fdflags & (O_ACCMODE)) { - case O_RDONLY: nbfd->iostream = (PTR) fdopen (fd, FOPEN_RB); break; - case O_WRONLY: nbfd->iostream = (PTR) fdopen (fd, FOPEN_RUB); break; - case O_RDWR: nbfd->iostream = (PTR) fdopen (fd, FOPEN_RUB); break; + case O_RDONLY: nbfd->iostream = fdopen (fd, FOPEN_RB); break; + case O_WRONLY: nbfd->iostream = fdopen (fd, FOPEN_RUB); break; + case O_RDWR: nbfd->iostream = fdopen (fd, FOPEN_RUB); break; default: abort (); } #endif @@ -272,7 +274,7 @@ bfd_fdopenr (filename, target, fd) _bfd_delete_bfd (nbfd); return NULL; } - nbfd->opened_once = true; + nbfd->opened_once = TRUE; return nbfd; } @@ -282,7 +284,7 @@ FUNCTION bfd_openstreamr SYNOPSIS - bfd *bfd_openstreamr(const char *, const char *, PTR); + bfd *bfd_openstreamr (const char *, const char *, void *); DESCRIPTION @@ -291,12 +293,9 @@ DESCRIPTION */ bfd * -bfd_openstreamr (filename, target, streamarg) - const char *filename; - const char *target; - PTR streamarg; +bfd_openstreamr (const char *filename, const char *target, void *streamarg) { - FILE *stream = (FILE *) streamarg; + FILE *stream = streamarg; bfd *nbfd; const bfd_target *target_vec; @@ -311,7 +310,7 @@ bfd_openstreamr (filename, target, streamarg) return NULL; } - nbfd->iostream = (PTR) stream; + nbfd->iostream = stream; nbfd->filename = filename; nbfd->direction = read_direction; @@ -334,7 +333,7 @@ FUNCTION bfd_openw SYNOPSIS - bfd *bfd_openw(const char *filename, const char *target); + bfd *bfd_openw (const char *filename, const char *target); DESCRIPTION Create a BFD, associated with file @var{filename}, using the @@ -345,9 +344,7 @@ DESCRIPTION */ bfd * -bfd_openw (filename, target) - const char *filename; - const char *target; +bfd_openw (const char *filename, const char *target) { bfd *nbfd; const bfd_target *target_vec; @@ -385,14 +382,14 @@ FUNCTION bfd_close SYNOPSIS - boolean bfd_close(bfd *abfd); + bfd_boolean bfd_close (bfd *abfd); DESCRIPTION - Close a BFD. If the BFD was open for writing, - then pending operations are completed and the file written out - and closed. If the created file is executable, then - <> is called to mark it as such. + Close a BFD. If the BFD was open for writing, then pending + operations are completed and the file written out and closed. + If the created file is executable, then <> is called + to mark it as such. All memory attached to the BFD is released. @@ -400,24 +397,23 @@ DESCRIPTION if it was passed in to BFD by <>). RETURNS - <> is returned if all is ok, otherwise <>. + <> is returned if all is ok, otherwise <>. */ -boolean -bfd_close (abfd) - bfd *abfd; +bfd_boolean +bfd_close (bfd *abfd) { - boolean ret; + bfd_boolean ret; if (bfd_write_p (abfd)) { if (! BFD_SEND_FMT (abfd, _bfd_write_contents, (abfd))) - return false; + return FALSE; } if (! BFD_SEND (abfd, _close_and_cleanup, (abfd))) - return false; + return FALSE; ret = bfd_cache_close (abfd); @@ -431,7 +427,7 @@ bfd_close (abfd) if (stat (abfd->filename, &buf) == 0) { - unsigned int mask = umask (0); + unsigned int mask = umask (0); umask (mask); chmod (abfd->filename, @@ -450,13 +446,13 @@ FUNCTION bfd_close_all_done SYNOPSIS - boolean bfd_close_all_done(bfd *); + bfd_boolean bfd_close_all_done (bfd *); DESCRIPTION - Close a BFD. Differs from <> - since it does not complete any pending operations. This - routine would be used if the application had just used BFD for - swapping and didn't want to use any of the writing code. + Close a BFD. Differs from <> since it does not + complete any pending operations. This routine would be used + if the application had just used BFD for swapping and didn't + want to use any of the writing code. If the created file is executable, then <> is called to mark it as such. @@ -464,14 +460,13 @@ DESCRIPTION All memory attached to the BFD is released. RETURNS - <> is returned if all is ok, otherwise <>. + <> is returned if all is ok, otherwise <>. */ -boolean -bfd_close_all_done (abfd) - bfd *abfd; +bfd_boolean +bfd_close_all_done (bfd *abfd) { - boolean ret; + bfd_boolean ret; ret = bfd_cache_close (abfd); @@ -504,19 +499,16 @@ FUNCTION bfd_create SYNOPSIS - bfd *bfd_create(const char *filename, bfd *templ); + bfd *bfd_create (const char *filename, bfd *templ); DESCRIPTION - Create a new BFD in the manner of - <>, but without opening a file. The new BFD - takes the target from the target used by @var{template}. The - format is always set to <>. + Create a new BFD in the manner of <>, but without + opening a file. The new BFD takes the target from the target + used by @var{template}. The format is always set to <>. */ bfd * -bfd_create (filename, templ) - const char *filename; - bfd *templ; +bfd_create (const char *filename, bfd *templ) { bfd *nbfd; @@ -537,7 +529,7 @@ FUNCTION bfd_make_writable SYNOPSIS - boolean bfd_make_writable(bfd *abfd); + bfd_boolean bfd_make_writable (bfd *abfd); DESCRIPTION Takes a BFD as created by <> and converts it @@ -546,24 +538,22 @@ DESCRIPTION you will call <> on this bfd later. RETURNS - <> is returned if all is ok, otherwise <>. + <> is returned if all is ok, otherwise <>. */ -boolean -bfd_make_writable(abfd) - bfd *abfd; +bfd_boolean +bfd_make_writable (bfd *abfd) { struct bfd_in_memory *bim; if (abfd->direction != no_direction) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } - bim = ((struct bfd_in_memory *) - bfd_malloc ((bfd_size_type) sizeof (struct bfd_in_memory))); - abfd->iostream = (PTR) bim; + bim = bfd_malloc (sizeof (struct bfd_in_memory)); + abfd->iostream = bim; /* bfd_bwrite will grow these as needed. */ bim->size = 0; bim->buffer = 0; @@ -572,7 +562,7 @@ bfd_make_writable(abfd) abfd->direction = write_direction; abfd->where = 0; - return true; + return TRUE; } /* @@ -580,7 +570,7 @@ FUNCTION bfd_make_readable SYNOPSIS - boolean bfd_make_readable(bfd *abfd); + bfd_boolean bfd_make_readable (bfd *abfd); DESCRIPTION Takes a BFD as created by <> and @@ -590,40 +580,39 @@ DESCRIPTION direction. RETURNS - <> is returned if all is ok, otherwise <>. */ + <> is returned if all is ok, otherwise <>. */ -boolean -bfd_make_readable(abfd) - bfd *abfd; +bfd_boolean +bfd_make_readable (bfd *abfd) { if (abfd->direction != write_direction || !(abfd->flags & BFD_IN_MEMORY)) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } if (! BFD_SEND_FMT (abfd, _bfd_write_contents, (abfd))) - return false; + return FALSE; if (! BFD_SEND (abfd, _close_and_cleanup, (abfd))) - return false; + return FALSE; abfd->arch_info = &bfd_default_arch_struct; abfd->where = 0; abfd->format = bfd_unknown; - abfd->my_archive = (bfd *) NULL; + abfd->my_archive = NULL; abfd->origin = 0; - abfd->opened_once = false; - abfd->output_has_begun = false; + abfd->opened_once = FALSE; + abfd->output_has_begun = FALSE; abfd->section_count = 0; - abfd->usrdata = (PTR) NULL; - abfd->cacheable = false; + abfd->usrdata = NULL; + abfd->cacheable = FALSE; abfd->flags = BFD_IN_MEMORY; - abfd->mtime_set = false; + abfd->mtime_set = FALSE; - abfd->target_defaulted = true; + abfd->target_defaulted = TRUE; abfd->direction = read_direction; abfd->sections = 0; abfd->symcount = 0; @@ -633,7 +622,7 @@ bfd_make_readable(abfd) bfd_section_list_clear (abfd); bfd_check_format (abfd, bfd_object); - return true; + return TRUE; } /* @@ -641,7 +630,7 @@ INTERNAL_FUNCTION bfd_alloc SYNOPSIS - PTR bfd_alloc (bfd *abfd, size_t wanted); + void *bfd_alloc (bfd *abfd, size_t wanted); DESCRIPTION Allocate a block of @var{wanted} bytes of memory attached to @@ -649,12 +638,10 @@ DESCRIPTION */ -PTR -bfd_alloc (abfd, size) - bfd *abfd; - bfd_size_type size; +void * +bfd_alloc (bfd *abfd, bfd_size_type size) { - PTR ret; + void *ret; if (size != (unsigned long) size) { @@ -668,12 +655,10 @@ bfd_alloc (abfd, size) return ret; } -PTR -bfd_zalloc (abfd, size) - bfd *abfd; - bfd_size_type size; +void * +bfd_zalloc (bfd *abfd, bfd_size_type size) { - PTR res; + void *res; res = bfd_alloc (abfd, size); if (res) @@ -685,9 +670,506 @@ bfd_zalloc (abfd, size) Note: Also frees all more recently allocated blocks! */ void -bfd_release (abfd, block) - bfd *abfd; - PTR block; +bfd_release (bfd *abfd, void *block) { objalloc_free_block ((struct objalloc *) abfd->memory, block); } + + +/* + GNU Extension: separate debug-info files + + The idea here is that a special section called .gnu_debuglink might be + embedded in a binary file, which indicates that some *other* file + contains the real debugging information. This special section contains a + filename and CRC32 checksum, which we read and resolve to another file, + if it exists. + + This facilitates "optional" provision of debugging information, without + having to provide two complete copies of every binary object (with and + without debug symbols). +*/ + +#define GNU_DEBUGLINK ".gnu_debuglink" +/* +FUNCTION + bfd_calc_gnu_debuglink_crc32 + +SYNOPSIS + unsigned long bfd_calc_gnu_debuglink_crc32 + (unsigned long crc, const unsigned char *buf, bfd_size_type len); + +DESCRIPTION + Computes a CRC value as used in the .gnu_debuglink section. + Advances the previously computed @var{crc} value by computing + and adding in the crc32 for @var{len} bytes of @var{buf}. + +RETURNS + Return the updated CRC32 value. +*/ + +unsigned long +bfd_calc_gnu_debuglink_crc32 (unsigned long crc, + const unsigned char *buf, + bfd_size_type len) +{ + static const unsigned long crc32_table[256] = + { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, + 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, + 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, + 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, + 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, + 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, + 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, + 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, + 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, + 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, + 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, + 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, + 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, + 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, + 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, + 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, + 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, + 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, + 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, + 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, + 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, + 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, + 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, + 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, + 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, + 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, + 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, + 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, + 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, + 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, + 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, + 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, + 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, + 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, + 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, + 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, + 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, + 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, + 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, + 0x2d02ef8d + }; + const unsigned char *end; + + crc = ~crc & 0xffffffff; + for (end = buf + len; buf < end; ++ buf) + crc = crc32_table[(crc ^ *buf) & 0xff] ^ (crc >> 8); + return ~crc & 0xffffffff;; +} + + +/* +INTERNAL_FUNCTION + get_debug_link_info + +SYNOPSIS + char *get_debug_link_info (bfd *abfd, unsigned long *crc32_out); + +DESCRIPTION + fetch the filename and CRC32 value for any separate debuginfo + associated with @var{abfd}. Return NULL if no such info found, + otherwise return filename and update @var{crc32_out}. +*/ + +static char * +get_debug_link_info (bfd *abfd, unsigned long *crc32_out) +{ + asection * sect; + bfd_size_type debuglink_size; + unsigned long crc32; + char * contents; + int crc_offset; + bfd_boolean ret; + + BFD_ASSERT (abfd); + BFD_ASSERT (crc32_out); + + sect = bfd_get_section_by_name (abfd, GNU_DEBUGLINK); + + if (sect == NULL) + return NULL; + + debuglink_size = bfd_section_size (abfd, sect); + + contents = malloc (debuglink_size); + if (contents == NULL) + return NULL; + + ret = bfd_get_section_contents (abfd, sect, contents, 0, debuglink_size); + if (! ret) + { + free (contents); + return NULL; + } + + /* Crc value is stored after the filename, aligned up to 4 bytes. */ + crc_offset = strlen (contents) + 1; + crc_offset = (crc_offset + 3) & ~3; + + crc32 = bfd_get_32 (abfd, contents + crc_offset); + + *crc32_out = crc32; + return contents; +} + +/* +INTERNAL_FUNCTION + separate_debug_file_exists + +SYNOPSIS + bfd_boolean separate_debug_file_exists + (char *name, unsigned long crc32); + +DESCRIPTION + Checks to see if @var{name} is a file and if its contents + match @var{crc32}. +*/ + +static bfd_boolean +separate_debug_file_exists (const char *name, const unsigned long crc) +{ + static char buffer [8 * 1024]; + unsigned long file_crc = 0; + int fd; + bfd_size_type count; + + BFD_ASSERT (name); + + fd = open (name, O_RDONLY); + if (fd < 0) + return FALSE; + + while ((count = read (fd, buffer, sizeof (buffer))) > 0) + file_crc = bfd_calc_gnu_debuglink_crc32 (file_crc, buffer, count); + + close (fd); + + return crc == file_crc; +} + + +/* +INTERNAL_FUNCTION + find_separate_debug_file + +SYNOPSIS + char *find_separate_debug_file (bfd *abfd); + +DESCRIPTION + Searches @var{abfd} for a reference to separate debugging + information, scans various locations in the filesystem, including + the file tree rooted at @var{debug_file_directory}, and returns a + filename of such debugging information if the file is found and has + matching CRC32. Returns NULL if no reference to debugging file + exists, or file cannot be found. +*/ + +static char * +find_separate_debug_file (bfd *abfd, const char *debug_file_directory) +{ + char *basename; + char *dir; + char *debugfile; + unsigned long crc32; + int i; + + BFD_ASSERT (abfd); + if (debug_file_directory == NULL) + debug_file_directory = "."; + + /* BFD may have been opened from a stream. */ + if (! abfd->filename) + return NULL; + + basename = get_debug_link_info (abfd, & crc32); + if (basename == NULL) + return NULL; + + if (strlen (basename) < 1) + { + free (basename); + return NULL; + } + + dir = strdup (abfd->filename); + if (dir == NULL) + { + free (basename); + return NULL; + } + BFD_ASSERT (strlen (dir) != 0); + + /* Strip off filename part. */ + for (i = strlen (dir) - 1; i >= 0; i--) + if (IS_DIR_SEPARATOR (dir[i])) + break; + + dir[i + 1] = '\0'; + BFD_ASSERT (dir[i] == '/' || dir[0] == '\0') + + debugfile = malloc (strlen (debug_file_directory) + 1 + + strlen (dir) + + strlen (".debug/") + + strlen (basename) + + 1); + if (debugfile == NULL) + { + free (basename); + free (dir); + return NULL; + } + + /* First try in the same directory as the original file: */ + strcpy (debugfile, dir); + strcat (debugfile, basename); + + if (separate_debug_file_exists (debugfile, crc32)) + { + free (basename); + free (dir); + return debugfile; + } + + /* Then try in a subdirectory called .debug. */ + strcpy (debugfile, dir); + strcat (debugfile, ".debug/"); + strcat (debugfile, basename); + + if (separate_debug_file_exists (debugfile, crc32)) + { + free (basename); + free (dir); + return debugfile; + } + + /* Then try in the global debugfile directory. */ + strcpy (debugfile, debug_file_directory); + i = strlen (debug_file_directory) - 1; + if (i > 0 + && debug_file_directory[i] != '/' + && dir[0] != '/') + strcat (debugfile, "/"); + strcat (debugfile, dir); + strcat (debugfile, basename); + + if (separate_debug_file_exists (debugfile, crc32)) + { + free (basename); + free (dir); + return debugfile; + } + + free (debugfile); + free (basename); + free (dir); + return NULL; +} + + +/* +FUNCTION + bfd_follow_gnu_debuglink + +SYNOPSIS + char *bfd_follow_gnu_debuglink (bfd *abfd, const char *dir); + +DESCRIPTION + + Takes a BFD and searches it for a .gnu_debuglink section. If this + section is found, it examines the section for the name and checksum + of a '.debug' file containing auxiliary debugging information. It + then searches the filesystem for this .debug file in some standard + locations, including the directory tree rooted at @var{dir}, and if + found returns the full filename. + + If @var{dir} is NULL, it will search a default path configured into + libbfd at build time. [XXX this feature is not currently + implemented]. + +RETURNS + <> on any errors or failure to locate the .debug file, + otherwise a pointer to a heap-allocated string containing the + filename. The caller is responsible for freeing this string. +*/ + +char * +bfd_follow_gnu_debuglink (bfd *abfd, const char *dir) +{ +#if 0 /* Disabled until DEBUGDIR can be defined by configure.in. */ + if (dir == NULL) + dir = DEBUGDIR; +#endif + return find_separate_debug_file (abfd, dir); +} + +/* +FUNCTION + bfd_create_gnu_debuglink_section + +SYNOPSIS + struct bfd_section *bfd_create_gnu_debuglink_section + (bfd *abfd, const char *filename); + +DESCRIPTION + + Takes a @var{BFD} and adds a .gnu_debuglink section to it. The section is sized + to be big enough to contain a link to the specified @var{filename}. + +RETURNS + A pointer to the new section is returned if all is ok. Otherwise <> is + returned and bfd_error is set. +*/ + +asection * +bfd_create_gnu_debuglink_section (bfd *abfd, const char *filename) +{ + asection *sect; + bfd_size_type debuglink_size; + + if (abfd == NULL || filename == NULL) + { + bfd_set_error (bfd_error_invalid_operation); + return NULL; + } + + /* Strip off any path components in filename. */ + filename = lbasename (filename); + + sect = bfd_get_section_by_name (abfd, GNU_DEBUGLINK); + if (sect) + { + /* Section already exists. */ + bfd_set_error (bfd_error_invalid_operation); + return NULL; + } + + sect = bfd_make_section (abfd, GNU_DEBUGLINK); + if (sect == NULL) + return NULL; + + if (! bfd_set_section_flags (abfd, sect, + SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING)) + /* XXX Should we delete the section from the bfd ? */ + return NULL; + + + debuglink_size = strlen (filename) + 1; + debuglink_size += 3; + debuglink_size &= ~3; + debuglink_size += 4; + + if (! bfd_set_section_size (abfd, sect, debuglink_size)) + /* XXX Should we delete the section from the bfd ? */ + return NULL; + + return sect; +} + + +/* +FUNCTION + bfd_fill_in_gnu_debuglink_section + +SYNOPSIS + bfd_boolean bfd_fill_in_gnu_debuglink_section + (bfd *abfd, struct bfd_section *sect, const char *filename); + +DESCRIPTION + + Takes a @var{BFD} and containing a .gnu_debuglink section @var{SECT} + and fills in the contents of the section to contain a link to the + specified @var{filename}. The filename should be relative to the + current directory. + +RETURNS + <> is returned if all is ok. Otherwise <> is returned + and bfd_error is set. +*/ + +bfd_boolean +bfd_fill_in_gnu_debuglink_section (bfd *abfd, + struct bfd_section *sect, + const char *filename) +{ + bfd_size_type debuglink_size; + unsigned long crc32; + char * contents; + bfd_size_type crc_offset; + FILE * handle; + static char buffer[8 * 1024]; + size_t count; + + if (abfd == NULL || sect == NULL || filename == NULL) + { + bfd_set_error (bfd_error_invalid_operation); + return FALSE; + } + + /* Make sure that we can read the file. + XXX - Should we attempt to locate the debug info file using the same + algorithm as gdb ? At the moment, since we are creating the + .gnu_debuglink section, we insist upon the user providing us with a + correct-for-section-creation-time path, but this need not conform to + the gdb location algorithm. */ + handle = fopen (filename, FOPEN_RB); + if (handle == NULL) + { + bfd_set_error (bfd_error_system_call); + return FALSE; + } + + crc32 = 0; + while ((count = fread (buffer, 1, sizeof buffer, handle)) > 0) + crc32 = bfd_calc_gnu_debuglink_crc32 (crc32, buffer, count); + fclose (handle); + + /* Strip off any path components in filename, + now that we no longer need them. */ + filename = lbasename (filename); + + debuglink_size = strlen (filename) + 1; + debuglink_size += 3; + debuglink_size &= ~3; + debuglink_size += 4; + + contents = malloc (debuglink_size); + if (contents == NULL) + { + /* XXX Should we delete the section from the bfd ? */ + bfd_set_error (bfd_error_no_memory); + return FALSE; + } + + strcpy (contents, filename); + crc_offset = debuglink_size - 4; + + bfd_put_32 (abfd, crc32, contents + crc_offset); + + if (! bfd_set_section_contents (abfd, sect, contents, 0, debuglink_size)) + { + /* XXX Should we delete the section from the bfd ? */ + free (contents); + return FALSE; + } + + return TRUE; +} diff --git a/contrib/binutils/bfd/osf-core.c b/contrib/binutils/bfd/osf-core.c index 862342e..8273504 100644 --- a/contrib/binutils/bfd/osf-core.c +++ b/contrib/binutils/bfd/osf-core.c @@ -1,5 +1,5 @@ /* BFD back-end for OSF/1 core files. - Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002 + Copyright 1993, 1994, 1995, 1998, 1999, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -32,11 +32,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ static asection *make_bfd_asection PARAMS ((bfd *, const char *, flagword, bfd_size_type, bfd_vma, file_ptr)); -static const bfd_target *osf_core_core_file_p PARAMS ((bfd *)); -static char *osf_core_core_file_failing_command PARAMS ((bfd *)); -static int osf_core_core_file_failing_signal PARAMS ((bfd *)); -static boolean osf_core_core_file_matches_executable_p PARAMS ((bfd *, bfd *)); -static void swap_abort PARAMS ((void)); +static const bfd_target *osf_core_core_file_p + PARAMS ((bfd *)); +static char *osf_core_core_file_failing_command + PARAMS ((bfd *)); +static int osf_core_core_file_failing_signal + PARAMS ((bfd *)); +static bfd_boolean osf_core_core_file_matches_executable_p + PARAMS ((bfd *, bfd *)); +static void swap_abort + PARAMS ((void)); /* These are stored in the bfd's tdata */ @@ -159,7 +164,6 @@ osf_core_core_file_failing_command (abfd) return core_command (abfd); } -/* ARGSUSED */ static int osf_core_core_file_failing_signal (abfd) bfd *abfd; @@ -167,13 +171,12 @@ osf_core_core_file_failing_signal (abfd) return core_signal (abfd); } -/* ARGSUSED */ -static boolean +static bfd_boolean osf_core_core_file_matches_executable_p (core_bfd, exec_bfd) bfd *core_bfd ATTRIBUTE_UNUSED; bfd *exec_bfd ATTRIBUTE_UNUSED; { - return true; /* FIXME, We have no way of telling at this point */ + return TRUE; /* FIXME, We have no way of telling at this point */ } /* If somebody calls any byte-swapping routines, shoot them. */ @@ -182,10 +185,13 @@ swap_abort() { 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 ) -#define NO_SIGNED_GET \ - ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort ) + +#define NO_GET ((bfd_vma (*) (const void *)) swap_abort) +#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort) +#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort) +#define NO_GET64 ((bfd_uint64_t (*) (const void *)) swap_abort) +#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort) +#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort) const bfd_target osf_core_vec = { @@ -200,26 +206,26 @@ const bfd_target osf_core_vec = 0, /* symbol prefix */ ' ', /* ar_pad_char */ 16, /* ar_max_namelen */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs */ + NO_GET64, NO_GETS64, NO_PUT64, /* 64 bit data */ + NO_GET, NO_GETS, NO_PUT, /* 32 bit data */ + NO_GET, NO_GETS, NO_PUT, /* 16 bit data */ + NO_GET64, NO_GETS64, NO_PUT64, /* 64 bit hdrs */ + NO_GET, NO_GETS, NO_PUT, /* 32 bit hdrs */ + NO_GET, NO_GETS, NO_PUT, /* 16 bit hdrs */ { /* bfd_check_format */ - _bfd_dummy_target, /* unknown format */ - _bfd_dummy_target, /* object file */ - _bfd_dummy_target, /* archive */ - osf_core_core_file_p /* a core file */ + _bfd_dummy_target, /* unknown format */ + _bfd_dummy_target, /* object file */ + _bfd_dummy_target, /* archive */ + osf_core_core_file_p /* a core file */ }, { /* bfd_set_format */ - bfd_false, bfd_false, - bfd_false, bfd_false + bfd_false, bfd_false, + bfd_false, bfd_false }, { /* bfd_write_contents */ - bfd_false, bfd_false, - bfd_false, bfd_false + bfd_false, bfd_false, + bfd_false, bfd_false }, BFD_JUMP_TABLE_GENERIC (_bfd_generic), @@ -235,4 +241,4 @@ const bfd_target osf_core_vec = NULL, (PTR) 0 /* backend_data */ -}; + }; diff --git a/contrib/binutils/bfd/pe-arm.c b/contrib/binutils/bfd/pe-arm.c index dbb4789..8b5d1c7 100644 --- a/contrib/binutils/bfd/pe-arm.c +++ b/contrib/binutils/bfd/pe-arm.c @@ -1,5 +1,5 @@ /* BFD back-end for ARM PECOFF files. - Copyright 1995, 1996, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #endif #define COFF_WITH_PE -#define PCRELOFFSET true +#define PCRELOFFSET TRUE #define COFF_LONG_SECTION_NAMES #ifndef bfd_arm_allocate_interworking_sections diff --git a/contrib/binutils/bfd/pe-i386.c b/contrib/binutils/bfd/pe-i386.c index 9c75f95..a912cff 100644 --- a/contrib/binutils/bfd/pe-i386.c +++ b/contrib/binutils/bfd/pe-i386.c @@ -23,7 +23,7 @@ #define TARGET_SYM i386pe_vec #define TARGET_NAME "pe-i386" #define COFF_WITH_PE -#define PCRELOFFSET true +#define PCRELOFFSET TRUE #define TARGET_UNDERSCORE '_' #define COFF_LONG_SECTION_NAMES #define COFF_LONG_FILENAMES diff --git a/contrib/binutils/bfd/peXXigen.c b/contrib/binutils/bfd/peXXigen.c index b643f3c..598aa7c 100644 --- a/contrib/binutils/bfd/peXXigen.c +++ b/contrib/binutils/bfd/peXXigen.c @@ -1,5 +1,5 @@ /* Support for the generic parts of PE/PEI; the common executable parts. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Cygnus Solutions. @@ -91,10 +91,10 @@ static void add_data_entry PARAMS ((bfd *, struct internal_extra_pe_aouthdr *, int, char *, bfd_vma)); -static boolean pe_print_pdata PARAMS ((bfd *, PTR)); -static boolean pe_print_reloc PARAMS ((bfd *, PTR)); -static boolean pe_print_idata PARAMS ((bfd *, PTR)); -static boolean pe_print_edata PARAMS ((bfd *, PTR)); +static bfd_boolean pe_print_pdata PARAMS ((bfd *, PTR)); +static bfd_boolean pe_print_reloc PARAMS ((bfd *, PTR)); +static bfd_boolean pe_print_idata PARAMS ((bfd *, PTR)); +static bfd_boolean pe_print_edata PARAMS ((bfd *, PTR)); void @@ -570,7 +570,8 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out) struct internal_extra_pe_aouthdr *extra = &pe->pe_opthdr; PEAOUTHDR *aouthdr_out = (PEAOUTHDR *) out; bfd_vma sa, fa, ib; - + IMAGE_DATA_DIRECTORY idata2, idata5, tls; + if (pe->force_minimum_alignment) { if (!extra->FileAlignment) @@ -586,6 +587,10 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out) fa = extra->FileAlignment; ib = extra->ImageBase; + idata2 = pe->pe_opthdr.DataDirectory[1]; + idata5 = pe->pe_opthdr.DataDirectory[12]; + tls = pe->pe_opthdr.DataDirectory[9]; + if (aouthdr_in->tsize) { aouthdr_in->text_start -= ib; @@ -614,28 +619,35 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out) #define SA(x) (((x) + sa -1 ) & (- sa)) /* 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, 0, sizeof (extra->DataDirectory)); add_data_entry (abfd, extra, 0, ".edata", ib); - - /* Don't call add_data_entry for .idata$2 or .idata$5. It's done in - bfd_coff_final_link where all the required information is - available. */ - - /* 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, 2, ".rsrc", ib); - add_data_entry (abfd, extra, 3, ".pdata", ib); + /* In theory we do not need to call add_data_entry for .idata$2 or + .idata$5. It will be done in bfd_coff_final_link where all the + required information is available. If however, we are not going + to perform a final link, eg because we have been invoked by objcopy + or strip, then we need to make sure that these Data Directory + entries are initialised properly. + + So - we copy the input values into the output values, and then, if + a final link is going to be performed, it can overwrite them. */ + extra->DataDirectory[1] = idata2; + extra->DataDirectory[12] = idata5; + extra->DataDirectory[9] = tls; + + if (extra->DataDirectory[1].VirtualAddress == 0) + /* Until other .idata fixes are made (pending patch), the entry for + .idata is needed for backwards compatibility. FIXME. */ + add_data_entry (abfd, extra, 1, ".idata", ib); + /* For some reason, the virtual size (which is what's set by add_data_entry) for .reloc is not the same as the size recorded in this slot by MSVC; it doesn't seem to cause problems (so far), @@ -663,7 +675,9 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out) 5.0 link.exe) where the file size of the .data segment is quite small compared to the virtual size. Without this fix, strip munges the file. */ - isize += SA (FA (pei_section_data (abfd, sec)->virt_size)); + if (coff_section_data (abfd, sec) != NULL + && pei_section_data (abfd, sec) != NULL) + isize += SA (FA (pei_section_data (abfd, sec)->virt_size)); } aouthdr_in->dsize = dsize; @@ -689,7 +703,7 @@ _bfd_XXi_swap_aouthdr_out (abfd, in, out) aouthdr_out->standard.text_start); #ifndef COFF_WITH_pep - /* PE32+ does not have data_start member! */ + /* PE32+ does not have data_start member! */ PUT_AOUTHDR_DATA_START (abfd, aouthdr_in->data_start, aouthdr_out->standard.data_start); #endif @@ -895,12 +909,24 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out) sometimes). */ if ((scnhdr_int->s_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA) != 0) { - ps = scnhdr_int->s_size; - ss = 0; + if (bfd_pe_executable_p (abfd)) + { + ps = scnhdr_int->s_size; + ss = 0; + } + else + { + ps = 0; + ss = scnhdr_int->s_size; + } } else { - ps = scnhdr_int->s_paddr; + if (bfd_pe_executable_p (abfd)) + ps = scnhdr_int->s_paddr; + else + ps = 0; + ss = scnhdr_int->s_size; } @@ -917,33 +943,76 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out) PUT_SCNHDR_LNNOPTR (abfd, scnhdr_int->s_lnnoptr, scnhdr_ext->s_lnnoptr); - /* Extra flags must be set when dealing with NT. All sections should also - have the IMAGE_SCN_MEM_READ (0x40000000) flag set. In addition, the - .text section must have IMAGE_SCN_MEM_EXECUTE (0x20000000) and the data - sections (.idata, .data, .bss, .CRT) must have IMAGE_SCN_MEM_WRITE set - (this is especially important when dealing with the .idata section since - the addresses for routines from .dlls must be overwritten). If .reloc - section data is ever generated, we must add IMAGE_SCN_MEM_DISCARDABLE - (0x02000000). Also, the resource data should also be read and - writable. */ - - /* FIXME: alignment is also encoded in this field, at least on ppc (krk) */ - /* FIXME: even worse, I don't see how to get the original alignment field*/ - /* back... */ - { + /* Extra flags must be set when dealing with PE. All sections should also + have the IMAGE_SCN_MEM_READ (0x40000000) flag set. In addition, the + .text section must have IMAGE_SCN_MEM_EXECUTE (0x20000000) and the data + sections (.idata, .data, .bss, .CRT) must have IMAGE_SCN_MEM_WRITE set + (this is especially important when dealing with the .idata section since + the addresses for routines from .dlls must be overwritten). If .reloc + section data is ever generated, we must add IMAGE_SCN_MEM_DISCARDABLE + (0x02000000). Also, the resource data should also be read and + writable. */ + + /* FIXME: Alignment is also encoded in this field, at least on PPC and + ARM-WINCE. Although - how do we get the original alignment field + back ? */ + + typedef struct + { + const char * section_name; + unsigned long must_have; + } + pe_required_section_flags; + + pe_required_section_flags known_sections [] = + { + { ".arch", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_DISCARDABLE | IMAGE_SCN_ALIGN_8BYTES }, + { ".bss", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_UNINITIALIZED_DATA | IMAGE_SCN_MEM_WRITE }, + { ".data", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_WRITE }, + { ".edata", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA }, + { ".idata", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_WRITE }, + { ".pdata", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA }, + { ".rdata", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA }, + { ".reloc", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_DISCARDABLE }, + { ".rsrc", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_WRITE }, + { ".text" , IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_CODE | IMAGE_SCN_MEM_EXECUTE }, + { ".tls", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA | IMAGE_SCN_MEM_WRITE }, + { ".xdata", IMAGE_SCN_MEM_READ | IMAGE_SCN_CNT_INITIALIZED_DATA }, + { NULL, 0} + }; + + pe_required_section_flags * p; int flags = scnhdr_int->s_flags; + /* We have defaulted to adding the IMAGE_SCN_MEM_WRITE flag, but now + we know exactly what this specific section wants so we remove it + and then allow the must_have field to add it back in if necessary. + However, we don't remove IMAGE_SCN_MEM_WRITE flag from .text if the + default WP_TEXT file flag has been cleared. WP_TEXT may be cleared + by ld --enable-auto-import (if auto-import is actually needed), + by ld --omagic, or by obcopy --writable-text. */ + + for (p = known_sections; p->section_name; p++) + if (strcmp (scnhdr_int->s_name, p->section_name) == 0) + { + if (strcmp (scnhdr_int->s_name, ".text") + || (bfd_get_file_flags (abfd) & WP_TEXT)) + flags &= ~IMAGE_SCN_MEM_WRITE; + flags |= p->must_have; + break; + } + H_PUT_32 (abfd, flags, scnhdr_ext->s_flags); } if (coff_data (abfd)->link_info - && ! coff_data (abfd)->link_info->relocateable + && ! coff_data (abfd)->link_info->relocatable && ! coff_data (abfd)->link_info->shared && strcmp (scnhdr_int->s_name, ".text") == 0) { /* By inference from looking at MS output, the 32 bit field - which is the combintion of the number_of_relocs and + which is the combination of the number_of_relocs and number_of_linenos is used for the line number count in executables. A 16-bit field won't do for cc1. The MS document says that the number of relocs is zero for @@ -967,7 +1036,11 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out) ret = 0; } - if (scnhdr_int->s_nreloc <= 0xffff) + /* Although we could encode 0xffff relocs here, we do not, to be + consistent with other parts of bfd. Also it lets us warn, as + we should never see 0xffff here w/o having the overflow flag + set. */ + if (scnhdr_int->s_nreloc < 0xffff) H_PUT_16 (abfd, scnhdr_int->s_nreloc, scnhdr_ext->s_nreloc); else { @@ -1016,7 +1089,7 @@ static char * dir_names[IMAGE_NUMBEROF_DIRECTORY_ENTRIES] = PPC- specific code. */ #endif -static boolean +static bfd_boolean pe_print_idata (abfd, vfile) bfd *abfd; PTR vfile; @@ -1048,12 +1121,12 @@ pe_print_idata (abfd, vfile) /* Maybe the extra header isn't there. Look for the section. */ section = bfd_get_section_by_name (abfd, ".idata"); if (section == NULL) - return true; + return TRUE; addr = section->vma; datasize = bfd_section_size (abfd, section); if (datasize == 0) - return true; + return TRUE; } else { @@ -1069,7 +1142,7 @@ pe_print_idata (abfd, vfile) { fprintf (file, _("\nThere is an import table, but the section containing it could not be found\n")); - return true; + return TRUE; } } @@ -1098,7 +1171,7 @@ pe_print_idata (abfd, vfile) amt = bfd_section_size (abfd, rel_section); data = (bfd_byte *) bfd_malloc (amt); if (data == NULL && amt != 0) - return false; + return FALSE; bfd_get_section_contents (abfd, rel_section, (PTR) data, (bfd_vma) 0, amt); @@ -1134,11 +1207,11 @@ pe_print_idata (abfd, vfile) amt = dataoff + datasize; data = (bfd_byte *) bfd_malloc (amt); if (data == NULL) - return false; + return FALSE; /* Read the whole section. Some of the fields might be before dataoff. */ if (! bfd_get_section_contents (abfd, section, (PTR) data, (bfd_vma) 0, amt)) - return false; + return FALSE; adj = section->vma - extra->ImageBase; @@ -1290,10 +1363,10 @@ pe_print_idata (abfd, vfile) free (data); - return true; + return TRUE; } -static boolean +static bfd_boolean pe_print_edata (abfd, vfile) bfd *abfd; PTR vfile; @@ -1332,12 +1405,12 @@ pe_print_edata (abfd, vfile) /* Maybe the extra header isn't there. Look for the section. */ section = bfd_get_section_by_name (abfd, ".edata"); if (section == NULL) - return true; + return TRUE; addr = section->vma; datasize = bfd_section_size (abfd, section); if (datasize == 0) - return true; + return TRUE; } else { @@ -1355,7 +1428,7 @@ pe_print_edata (abfd, vfile) { fprintf (file, _("\nThere is an export table, but the section containing it could not be found\n")); - return true; + return TRUE; } } @@ -1367,11 +1440,11 @@ pe_print_edata (abfd, vfile) data = (bfd_byte *) bfd_malloc (datasize); if (data == NULL) - return false; + return FALSE; if (! bfd_get_section_contents (abfd, section, (PTR) data, (file_ptr) dataoff, datasize)) - return false; + return FALSE; /* Go get Export Directory Table. */ edt.export_flags = bfd_get_32 (abfd, data + 0); @@ -1508,7 +1581,7 @@ pe_print_edata (abfd, vfile) free (data); - return true; + return TRUE; } /* This really is architecture dependent. On IA-64, a .pdata entry @@ -1516,7 +1589,7 @@ pe_print_edata (abfd, vfile) specify the start and end address of the code range the entry covers and the address of the corresponding unwind info data. */ -static boolean +static bfd_boolean pe_print_pdata (abfd, vfile) bfd *abfd; PTR vfile; @@ -1537,7 +1610,7 @@ pe_print_pdata (abfd, vfile) 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) @@ -1558,11 +1631,11 @@ pe_print_pdata (abfd, vfile) datasize = bfd_section_size (abfd, section); if (datasize == 0) - return true; + return TRUE; data = (bfd_byte *) bfd_malloc (datasize); if (data == NULL && datasize != 0) - return false; + return FALSE; bfd_get_section_contents (abfd, section, (PTR) data, (bfd_vma) 0, datasize); @@ -1639,7 +1712,7 @@ pe_print_pdata (abfd, vfile) free (data); - return true; + return TRUE; } #define IMAGE_REL_BASED_HIGHADJ 4 @@ -1660,7 +1733,7 @@ static const char * const tbl[] = "UNKNOWN", /* MUST be last */ }; -static boolean +static bfd_boolean pe_print_reloc (abfd, vfile) bfd *abfd; PTR vfile; @@ -1673,10 +1746,10 @@ pe_print_reloc (abfd, vfile) bfd_size_type start, stop; if (section == NULL) - return true; + return TRUE; if (bfd_section_size (abfd, section) == 0) - return true; + return TRUE; fprintf (file, _("\n\nPE File Base Relocations (interpreted .reloc section contents)\n")); @@ -1684,7 +1757,7 @@ pe_print_reloc (abfd, vfile) datasize = bfd_section_size (abfd, section); data = (bfd_byte *) bfd_malloc (datasize); if (data == NULL && datasize != 0) - return false; + return FALSE; bfd_get_section_contents (abfd, section, (PTR) data, (bfd_vma) 0, datasize); @@ -1743,12 +1816,12 @@ pe_print_reloc (abfd, vfile) free (data); - return true; + return TRUE; } /* Print out the program headers. */ -boolean +bfd_boolean _bfd_XX_print_private_bfd_data_common (abfd, vfile) bfd *abfd; PTR vfile; @@ -1859,20 +1932,20 @@ _bfd_XX_print_private_bfd_data_common (abfd, vfile) pe_print_pdata (abfd, vfile); pe_print_reloc (abfd, vfile); - return true; + return TRUE; } /* Copy any private info we understand from the input bfd to the output bfd. */ -boolean +bfd_boolean _bfd_XX_bfd_copy_private_bfd_data_common (ibfd, obfd) bfd *ibfd, *obfd; { /* One day we may try to grok other private data. */ if (ibfd->xvec->flavour != bfd_target_coff_flavour || obfd->xvec->flavour != bfd_target_coff_flavour) - return true; + return TRUE; pe_data (obfd)->pe_opthdr = pe_data (ibfd)->pe_opthdr; pe_data (obfd)->dll = pe_data (ibfd)->dll; @@ -1884,12 +1957,12 @@ _bfd_XX_bfd_copy_private_bfd_data_common (ibfd, obfd) pe_data (obfd)->pe_opthdr.DataDirectory[5].VirtualAddress = 0; pe_data (obfd)->pe_opthdr.DataDirectory[5].Size = 0; } - return true; + return TRUE; } /* Copy private section data. */ -boolean +bfd_boolean _bfd_XX_bfd_copy_private_section_data (ibfd, isec, obfd, osec) bfd *ibfd; asection *isec; @@ -1898,7 +1971,7 @@ _bfd_XX_bfd_copy_private_section_data (ibfd, isec, obfd, osec) { if (bfd_get_flavour (ibfd) != bfd_target_coff_flavour || bfd_get_flavour (obfd) != bfd_target_coff_flavour) - return true; + return TRUE; if (coff_section_data (ibfd, isec) != NULL && pei_section_data (ibfd, isec) != NULL) @@ -1908,7 +1981,7 @@ _bfd_XX_bfd_copy_private_section_data (ibfd, isec, obfd, osec) bfd_size_type amt = sizeof (struct coff_section_tdata); osec->used_by_bfd = (PTR) bfd_zalloc (obfd, amt); if (osec->used_by_bfd == NULL) - return false; + return FALSE; } if (pei_section_data (obfd, osec) == NULL) @@ -1916,7 +1989,7 @@ _bfd_XX_bfd_copy_private_section_data (ibfd, isec, obfd, osec) bfd_size_type amt = sizeof (struct pei_section_tdata); coff_section_data (obfd, osec)->tdata = (PTR) bfd_zalloc (obfd, amt); if (coff_section_data (obfd, osec)->tdata == NULL) - return false; + return FALSE; } pei_section_data (obfd, osec)->virt_size = @@ -1925,7 +1998,7 @@ _bfd_XX_bfd_copy_private_section_data (ibfd, isec, obfd, osec) pei_section_data (ibfd, isec)->pe_flags; } - return true; + return TRUE; } void @@ -1948,7 +2021,7 @@ _bfd_XX_get_symbol_info (abfd, symbol, ret) /* Handle the .idata section and other things that need symbol table access. */ -boolean +bfd_boolean _bfd_XXi_final_link_postscript (abfd, pfinfo) bfd *abfd; struct coff_final_link_info *pfinfo; @@ -1965,7 +2038,7 @@ _bfd_XXi_final_link_postscript (abfd, pfinfo) /* The import directory. This is the address of .idata$2, with size of .idata$2 + .idata$3. */ h1 = coff_link_hash_lookup (coff_hash_table (info), - ".idata$2", false, false, true); + ".idata$2", FALSE, FALSE, TRUE); if (h1 != NULL) { pe_data (abfd)->pe_opthdr.DataDirectory[1].VirtualAddress = @@ -1973,7 +2046,7 @@ _bfd_XXi_final_link_postscript (abfd, pfinfo) + h1->root.u.def.section->output_section->vma + h1->root.u.def.section->output_offset); h1 = coff_link_hash_lookup (coff_hash_table (info), - ".idata$4", false, false, true); + ".idata$4", FALSE, FALSE, TRUE); pe_data (abfd)->pe_opthdr.DataDirectory[1].Size = ((h1->root.u.def.value + h1->root.u.def.section->output_section->vma @@ -1983,22 +2056,34 @@ _bfd_XXi_final_link_postscript (abfd, pfinfo) /* The import address table. This is the size/address of .idata$5. */ h1 = coff_link_hash_lookup (coff_hash_table (info), - ".idata$5", false, false, true); + ".idata$5", FALSE, FALSE, TRUE); pe_data (abfd)->pe_opthdr.DataDirectory[12].VirtualAddress = (h1->root.u.def.value + h1->root.u.def.section->output_section->vma + h1->root.u.def.section->output_offset); h1 = coff_link_hash_lookup (coff_hash_table (info), - ".idata$6", false, false, true); + ".idata$6", FALSE, FALSE, TRUE); pe_data (abfd)->pe_opthdr.DataDirectory[12].Size = ((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); + } + + h1 = coff_link_hash_lookup (coff_hash_table (info), + "__tls_used", FALSE, FALSE, TRUE); + if (h1 != NULL) + { + pe_data (abfd)->pe_opthdr.DataDirectory[9].VirtualAddress = + (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.ImageBase); + pe_data (abfd)->pe_opthdr.DataDirectory[9].Size = 0x18; } /* If we couldn't find idata$2, we either have an excessively trivial program or are in DEEP trouble; we have to assume trivial program.... */ - return true; + return TRUE; } diff --git a/contrib/binutils/bfd/peicode.h b/contrib/binutils/bfd/peicode.h index a621acc..41445e5 100644 --- a/contrib/binutils/bfd/peicode.h +++ b/contrib/binutils/bfd/peicode.h @@ -1,31 +1,29 @@ /* Support for the generic parts of PE/PEI, for BFD. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Solutions. -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. */ -/* -Most of this hacked by Steve Chamberlain, +/* Most of this hacked by Steve Chamberlain, sac@cygnus.com -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]! @@ -53,12 +51,11 @@ PE/PEI rearrangement (and code added): Donn Terry FIXME: Please add more docs here so the next poor fool that has to hack on this code has a chance of getting something accomplished without - wasting too much time. -*/ + wasting too much time. */ #include "libpei.h" -static boolean (*pe_saved_coff_bfd_print_private_bfd_data) +static bfd_boolean (*pe_saved_coff_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)) = #ifndef coff_bfd_print_private_bfd_data NULL; @@ -67,10 +64,10 @@ static boolean (*pe_saved_coff_bfd_print_private_bfd_data) #undef coff_bfd_print_private_bfd_data #endif -static boolean pe_print_private_bfd_data PARAMS ((bfd *, PTR)); +static bfd_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) +static bfd_boolean (*pe_saved_coff_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)) = #ifndef coff_bfd_copy_private_bfd_data NULL; @@ -79,7 +76,7 @@ static boolean (*pe_saved_coff_bfd_copy_private_bfd_data) #undef coff_bfd_copy_private_bfd_data #endif -static boolean pe_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *)); +static bfd_boolean pe_bfd_copy_private_bfd_data PARAMS ((bfd *, bfd *)); #define coff_bfd_copy_private_bfd_data pe_bfd_copy_private_bfd_data #define coff_mkobject pe_mkobject @@ -91,7 +88,7 @@ static unsigned int coff_swap_reloc_out PARAMS ((bfd *, PTR, PTR)); #endif static void coff_swap_filehdr_in PARAMS ((bfd *, PTR, PTR)); static void coff_swap_scnhdr_in PARAMS ((bfd *, PTR, PTR)); -static boolean pe_mkobject PARAMS ((bfd *)); +static bfd_boolean pe_mkobject PARAMS ((bfd *)); static PTR pe_mkobject_hook PARAMS ((bfd *, PTR, PTR)); #ifdef COFF_IMAGE_WITH_PE @@ -138,8 +135,8 @@ 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 boolean pe_ILF_build_a_bfd PARAMS ((bfd *, unsigned int, bfd_byte *, bfd_byte *, unsigned int, unsigned int)); +static void pe_ILF_make_a_symbol_reloc PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, struct bfd_symbol **, unsigned int)); +static bfd_boolean pe_ILF_build_a_bfd PARAMS ((bfd *, unsigned int, 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 *)); #endif /* COFF_IMAGE_WITH_PE */ @@ -259,12 +256,17 @@ coff_swap_scnhdr_in (abfd, ext, in) } #ifndef COFF_NO_HACK_SCNHDR_SIZE - /* If this section holds uninitialized data, use the virtual size - (stored in s_paddr) instead of the physical size. */ - if ((scnhdr_int->s_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA) != 0 - && (scnhdr_int->s_paddr > 0)) + /* If this section holds uninitialized data and is from an object file + or from an executable image that has not initialized the field, + or if the image is an executable file and the physical size is padded, + use the virtual size (stored in s_paddr) instead. */ + if (scnhdr_int->s_paddr > 0 + && (((scnhdr_int->s_flags & IMAGE_SCN_CNT_UNINITIALIZED_DATA) != 0 + && (! bfd_pe_executable_p (abfd) || scnhdr_int->s_size == 0)) + || (bfd_pe_executable_p (abfd) && scnhdr_int->s_size > scnhdr_int->s_paddr))) { scnhdr_int->s_size = scnhdr_int->s_paddr; + /* This code used to set scnhdr_int->s_paddr to 0. However, coff_set_alignment_hook stores s_paddr in virt_size, which only works if it correctly holds the virtual size of the @@ -273,7 +275,7 @@ coff_swap_scnhdr_in (abfd, ext, in) #endif } -static boolean +static bfd_boolean pe_mkobject (abfd) bfd * abfd; { @@ -283,7 +285,7 @@ pe_mkobject (abfd) abfd->tdata.pe_obj_data = (struct pe_tdata *) bfd_zalloc (abfd, amt); if (abfd->tdata.pe_obj_data == 0) - return false; + return FALSE; pe = pe_data (abfd); @@ -299,7 +301,7 @@ pe_mkobject (abfd) pe->target_subsystem = PEI_TARGET_SUBSYSTEM; #endif - return true; + return TRUE; } /* Create the COFF backend specific information. */ @@ -355,7 +357,7 @@ pe_mkobject_hook (abfd, filehdr, aouthdr) return (PTR) pe; } -static boolean +static bfd_boolean pe_print_private_bfd_data (abfd, vfile) bfd *abfd; PTR vfile; @@ -363,7 +365,7 @@ pe_print_private_bfd_data (abfd, vfile) FILE *file = (FILE *) vfile; if (!_bfd_XX_print_private_bfd_data_common (abfd, vfile)) - return false; + return FALSE; if (pe_saved_coff_bfd_print_private_bfd_data != NULL) { @@ -372,23 +374,23 @@ pe_print_private_bfd_data (abfd, vfile) return pe_saved_coff_bfd_print_private_bfd_data (abfd, vfile); } - return true; + return TRUE; } /* Copy any private info we understand from the input bfd to the output bfd. */ -static boolean +static bfd_boolean pe_bfd_copy_private_bfd_data (ibfd, obfd) bfd *ibfd, *obfd; { if (!_bfd_XX_bfd_copy_private_bfd_data_common (ibfd, obfd)) - return false; + return FALSE; if (pe_saved_coff_bfd_copy_private_bfd_data) return pe_saved_coff_bfd_copy_private_bfd_data (ibfd, obfd); - return true; + return TRUE; } #define coff_bfd_copy_private_section_data \ @@ -468,7 +470,7 @@ static void pe_ILF_make_a_symbol_reloc (pe_ILF_vars * vars, bfd_vma address, bfd_reloc_code_real_type reloc, - struct symbol_cache_entry ** sym, + struct bfd_symbol ** sym, unsigned int sym_index) { arelent * entry; @@ -518,7 +520,7 @@ pe_ILF_save_relocs (pe_ILF_vars * vars, abort (); coff_section_data (vars->abfd, sec)->relocs = vars->int_reltab; - coff_section_data (vars->abfd, sec)->keep_relocs = true; + coff_section_data (vars->abfd, sec)->keep_relocs = TRUE; sec->relocation = vars->reltab; sec->reloc_count = vars->relcount; @@ -610,7 +612,7 @@ pe_ILF_make_a_symbol (pe_ILF_vars * vars, #if 0 /* See comment above. */ sym->symbol.value = 0; sym->symbol.udata.i = 0; - sym->done_lineno = false; + sym->done_lineno = FALSE; sym->lineno = NULL; #endif @@ -753,7 +755,7 @@ static jump_table jtab[] = #endif /* Build a full BFD from the information supplied in a ILF object. */ -static boolean +static bfd_boolean pe_ILF_build_a_bfd (bfd * abfd, unsigned int magic, bfd_byte * symbol_name, @@ -784,12 +786,12 @@ pe_ILF_build_a_bfd (bfd * abfd, /* XXX code yet to be written. */ _bfd_error_handler (_("%s: Unhandled import type; %x"), bfd_archive_filename (abfd), import_type); - return false; + return FALSE; default: _bfd_error_handler (_("%s: Unrecognised import type; %x"), bfd_archive_filename (abfd), import_type); - return false; + return FALSE; } switch (import_name_type) @@ -803,7 +805,7 @@ pe_ILF_build_a_bfd (bfd * abfd, default: _bfd_error_handler (_("%s: Unrecognised import name type; %x"), bfd_archive_filename (abfd), import_name_type); - return false; + return FALSE; } /* Initialise local variables. @@ -815,7 +817,7 @@ pe_ILF_build_a_bfd (bfd * abfd, so allocate all the space that we will need right now. */ ptr = bfd_zalloc (abfd, (bfd_size_type) ILF_DATA_SIZE); if (ptr == NULL) - return false; + return FALSE; /* Create a bfd_in_memory structure. */ vars.bim = (struct bfd_in_memory *) ptr; @@ -875,7 +877,7 @@ pe_ILF_build_a_bfd (bfd * abfd, id4 = pe_ILF_make_a_section (& vars, ".idata$4", SIZEOF_IDATA4, 0); id5 = pe_ILF_make_a_section (& vars, ".idata$5", SIZEOF_IDATA5, 0); if (id4 == NULL || id5 == NULL) - return false; + return FALSE; /* Fill in the contents of these sections. */ if (import_name_type == IMPORT_ORDINAL) @@ -894,16 +896,46 @@ pe_ILF_build_a_bfd (bfd * abfd, /* Create .idata$6 - the Hint Name Table. */ id6 = pe_ILF_make_a_section (& vars, ".idata$6", SIZEOF_IDATA6, 0); if (id6 == NULL) - return false; + return FALSE; /* If necessary, trim the import symbol name. */ symbol = symbol_name; if (import_name_type != IMPORT_NAME) - /* Skip any prefix in symbol_name. */ - while (*symbol == '@' || * symbol == '?' || * symbol == '_') - ++ symbol; - + { + bfd_boolean skipped_leading_underscore = FALSE; + bfd_boolean skipped_leading_at = FALSE; + bfd_boolean skipped_leading_question_mark = FALSE; + bfd_boolean check_again; + + /* Skip any prefix in symbol_name. */ + -- symbol; + do + { + check_again = FALSE; + ++ symbol; + + switch (*symbol) + { + case '@': + if (! skipped_leading_at) + check_again = skipped_leading_at = TRUE; + break; + case '?': + if (! skipped_leading_question_mark) + check_again = skipped_leading_question_mark = TRUE; + break; + case '_': + if (! skipped_leading_underscore) + check_again = skipped_leading_underscore = TRUE; + break; + default: + break; + } + } + while (check_again); + } + if (import_name_type == IMPORT_NAME_UNDECORATE) { /* Truncate at the first '@' */ @@ -950,7 +982,7 @@ pe_ILF_build_a_bfd (bfd * abfd, /* Create the .text section. */ text = pe_ILF_make_a_section (& vars, ".text", jtab[i].size, SEC_CODE); if (text == NULL) - return false; + return FALSE; /* Copy in the jump code. */ memcpy (text->contents, jtab[i].data, jtab[i].size); @@ -965,11 +997,11 @@ pe_ILF_build_a_bfd (bfd * abfd, if (magic == MIPS_ARCH_MAGIC_WINCE) { pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) 0, BFD_RELOC_HI16_S, - (struct symbol_cache_entry **) imp_sym, + (struct bfd_symbol **) imp_sym, imp_index); pe_ILF_make_a_reloc (&vars, (bfd_vma) 0, BFD_RELOC_LO16, text); pe_ILF_make_a_symbol_reloc (&vars, (bfd_vma) 4, BFD_RELOC_LO16, - (struct symbol_cache_entry **) imp_sym, + (struct bfd_symbol **) imp_sym, imp_index); } else @@ -999,10 +1031,10 @@ pe_ILF_build_a_bfd (bfd * abfd, if ( ! bfd_set_start_address (abfd, (bfd_vma) 0) || ! bfd_coff_set_arch_mach_hook (abfd, & internal_f)) - return false; + return FALSE; if (bfd_coff_mkobject_hook (abfd, (PTR) & internal_f, NULL) == NULL) - return false; + return FALSE; coff_data (abfd)->pe = 1; #ifdef THUMBPEMAGIC @@ -1053,17 +1085,17 @@ pe_ILF_build_a_bfd (bfd * abfd, obj_raw_syment_count (abfd) = vars.sym_index; obj_coff_external_syms (abfd) = (PTR) vars.esym_table; - obj_coff_keep_syms (abfd) = true; + 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; + obj_coff_keep_strings (abfd) = TRUE; abfd->flags |= HAS_SYMS; - return true; + return TRUE; } /* We have detected a Image Library Format archive element. diff --git a/contrib/binutils/bfd/po/BLD-POTFILES.in b/contrib/binutils/bfd/po/BLD-POTFILES.in index 28f599d..2dbe723 100644 --- a/contrib/binutils/bfd/po/BLD-POTFILES.in +++ b/contrib/binutils/bfd/po/BLD-POTFILES.in @@ -1,3 +1,4 @@ +bfdver.h elf32-ia64.c elf32-target.h elf64-ia64.c diff --git a/contrib/binutils/bfd/po/Make-in b/contrib/binutils/bfd/po/Make-in index a288585..1608b2d 100644 --- a/contrib/binutils/bfd/po/Make-in +++ b/contrib/binutils/bfd/po/Make-in @@ -24,6 +24,8 @@ gnulocaledir = $(prefix)/share/locale gettextsrcdir = $(prefix)/share/gettext/po subdir = po +DESTDIR = + INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -124,9 +126,9 @@ install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all if test -r $(MKINSTALLDIRS); then \ - $(MKINSTALLDIRS) $(datadir); \ + $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ else \ - $(top_srcdir)/mkinstalldirs $(datadir); \ + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ fi @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ @@ -136,7 +138,7 @@ install-data-yes: all *) destdir=$(localedir);; \ esac; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - dir=$$destdir/$$lang/LC_MESSAGES; \ + dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ if test -r $(MKINSTALLDIRS); then \ $(MKINSTALLDIRS) $$dir; \ else \ @@ -166,12 +168,12 @@ install-data-yes: all done if test "$(PACKAGE)" = "gettext"; then \ if test -r $(MKINSTALLDIRS); then \ - $(MKINSTALLDIRS) $(gettextsrcdir); \ + $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ else \ - $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ fi; \ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ - $(gettextsrcdir)/Makefile.in.in; \ + $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ else \ : ; \ fi @@ -184,12 +186,12 @@ uninstall: for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ - rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ - rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ - rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ done - rm -f $(gettextsrcdir)/po-Makefile.in.in + rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in check: all diff --git a/contrib/binutils/bfd/po/SRC-POTFILES.in b/contrib/binutils/bfd/po/SRC-POTFILES.in index 9a977f5..d29593d 100644 --- a/contrib/binutils/bfd/po/SRC-POTFILES.in +++ b/contrib/binutils/bfd/po/SRC-POTFILES.in @@ -1,22 +1,24 @@ aix386-core.c aix5ppc-core.c +aout0.c +aout32.c +aout64.c aout-adobe.c aout-arm.c aout-cris.c +aoutf1.h aout-ns32k.c aout-sparcle.c aout-target.h aout-tic30.c -aout0.c -aout32.c -aout64.c -aoutf1.h aoutx.h -archive.c archive64.c +archive.c archures.c armnetbsd.c bfd.c +bfdio.c +bfdwin.c binary.c bout.c cache.c @@ -24,17 +26,21 @@ cf-i386lynx.c cf-m68klynx.c cf-sparclynx.c cisco-core.c +coff64-rs6000.c coff-a29k.c coff-alpha.c coff-apollo.c coff-arm.c coff-aux.c +coffcode.h +coffgen.c coff-go32.c coff-h8300.c coff-h8500.c coff-i386.c coff-i860.c coff-i960.c +cofflink.c coff-m68k.c coff-m88k.c coff-mips.c @@ -44,18 +50,15 @@ coff-sh.c coff-sparc.c coff-stgo32.c coff-svm68k.c +coffswap.h coff-tic30.c +coff-tic4x.c coff-tic54x.c coff-tic80.c coff-u68k.c coff-w65.c coff-we32k.c coff-z8k.c -coff64-rs6000.c -coffcode.h -coffgen.c -cofflink.c -coffswap.h corefile.c cpu-a29k.c cpu-alpha.c @@ -76,6 +79,8 @@ cpu-i386.c cpu-i860.c cpu-i960.c cpu-ia64.c +cpu-ip2k.c +cpu-iq2000.c cpu-m10200.c cpu-m10300.c cpu-m32r.c @@ -86,6 +91,7 @@ cpu-m88k.c cpu-mcore.c cpu-mips.c cpu-mmix.c +cpu-msp430.c cpu-ns32k.c cpu-openrisc.c cpu-or32.c @@ -97,6 +103,7 @@ cpu-s390.c cpu-sh.c cpu-sparc.c cpu-tic30.c +cpu-tic4x.c cpu-tic54x.c cpu-tic80.c cpu-v850.c @@ -104,6 +111,7 @@ cpu-vax.c cpu-w65.c cpu-we32k.c cpu-xstormy16.c +cpu-xtensa.c cpu-z8k.c demo64.c dwarf1.c @@ -113,16 +121,11 @@ ecofflink.c ecoffswap.h efi-app-ia32.c efi-app-ia64.c -elf-bfd.h -elf-eh-frame.c -elf-hppa.h -elf-m10200.c -elf-m10300.c -elf-strtab.c -elf.c +elf32-am33lin.c elf32-arc.c elf32-arm.h elf32-avr.c +elf32.c elf32-cris.c elf32-d10v.c elf32-d30v.c @@ -134,36 +137,35 @@ elf32-h8300.c elf32-hppa.c elf32-hppa.h elf32-i370.c -elf32-i386-fbsd.c elf32-i386.c -elf32-i386qnx.c elf32-i860.c elf32-i960.c +elf32-ip2k.c +elf32-iq2000.c elf32-m32r.c elf32-m68hc11.c elf32-m68hc12.c +elf32-m68hc1x.c elf32-m68k.c elf32-m88k.c elf32-mcore.c elf32-mips.c +elf32-msp430.c elf32-openrisc.c elf32-or32.c elf32-pj.c elf32-ppc.c elf32-s390.c -elf32-sh-lin.c -elf32-sh-nbsd.c -elf32-sh.c -elf32-sh64-com.c -elf32-sh64-nbsd.c elf32-sh64.c +elf32-sh64-com.c +elf32-sh.c elf32-sparc.c elf32-v850.c elf32-vax.c elf32-xstormy16.c -elf32.c -elf64-alpha-fbsd.c +elf32-xtensa.c elf64-alpha.c +elf64.c elf64-gen.c elf64-hppa.c elf64-hppa.h @@ -171,17 +173,22 @@ elf64-mips.c elf64-mmix.c elf64-ppc.c elf64-s390.c -elf64-sh64-nbsd.c elf64-sh64.c elf64-sparc.c elf64-x86-64.c -elf64.c elfarm-nabi.c elfarm-oabi.c +elf-bfd.h +elf.c elfcode.h elfcore.h +elf-eh-frame.c +elf-hppa.h elflink.c -elflink.h +elf-m10200.c +elf-m10300.c +elfn32-mips.c +elf-strtab.c elfxx-mips.c epoc-pe-arm.c epoc-pei-arm.c @@ -225,21 +232,23 @@ m68klinux.c m68klynx.c m68knetbsd.c m88kmach3.c +mach-o.c +mach-o.h merge.c mipsbsd.c mmo.c netbsd.h newsos3.c -nlm-target.h -nlm.c nlm32-alpha.c +nlm32.c nlm32-i386.c nlm32-ppc.c nlm32-sparc.c -nlm32.c nlm64.c +nlm.c nlmcode.h nlmswap.h +nlm-target.h ns32k.h ns32knetbsd.c oasys.c @@ -248,32 +257,36 @@ osf-core.c pc532-mach.c pdp11.c pe-arm.c +pef.c +pef.h +pef-traceback.h pe-i386.c -pe-mcore.c -pe-mips.c -pe-ppc.c -pe-sh.c pei-arm.c +peicode.h pei-i386.c pei-mcore.c pei-mips.c pei-ppc.c pei-sh.c -peicode.h +pe-mcore.c +pe-mips.c +pe-ppc.c +pe-sh.c ppcboot.c -reloc.c reloc16.c +reloc.c riscix.c sco5-core.c section.c +simple.c som.c som.h sparclinux.c sparclynx.c sparcnetbsd.c srec.c -stab-syms.c stabs.c +stab-syms.c sunos.c syms.c targets.c @@ -284,11 +297,15 @@ vaxbsd.c vaxnetbsd.c versados.c version.h +vms.c vms-gsd.c +vms.h vms-hdr.c vms-misc.c vms-tir.c -vms.c -vms.h -xcoff-target.h xcofflink.c +xcoff-target.h +xsym.c +xsym.h +xtensa-isa.c +xtensa-modules.c diff --git a/contrib/binutils/bfd/po/bfd.pot b/contrib/binutils/bfd/po/bfd.pot index 8823e66..5d4f234 100644 --- a/contrib/binutils/bfd/po/bfd.pot +++ b/contrib/binutils/bfd/po/bfd.pot @@ -1,13 +1,12 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR Free Software Foundation, Inc. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2002-10-30 10:06-0500\n" +"POT-Creation-Date: 2003-07-17 14:52+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15,922 +14,867 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: aout-adobe.c:197 +#: aout-adobe.c:204 #, c-format msgid "%s: Unknown section type in a.out.adobe file: %x\n" msgstr "" -#: aout-cris.c:208 +#: aout-cris.c:207 #, c-format msgid "%s: Invalid relocation type exported: %d" msgstr "" -#: aout-cris.c:252 +#: aout-cris.c:251 #, c-format msgid "%s: Invalid relocation type imported: %d" msgstr "" -#: aout-cris.c:263 +#: aout-cris.c:262 #, c-format msgid "%s: Bad relocation record imported: %d" msgstr "" -#: aoutx.h:1282 aoutx.h:1699 +#: aoutx.h:1295 aoutx.h:1716 #, c-format msgid "%s: can not represent section `%s' in a.out object file format" msgstr "" -#: aoutx.h:1669 +#: aoutx.h:1682 #, c-format msgid "" "%s: can not represent section for symbol `%s' in a.out object file format" msgstr "" -#: aoutx.h:1671 +#: aoutx.h:1684 msgid "*unknown*" msgstr "" -#: aoutx.h:3732 +#: aoutx.h:3776 #, c-format -msgid "%s: relocateable link from %s to %s not supported" +msgid "%s: relocatable link from %s to %s not supported" msgstr "" -#: archive.c:1818 +#: archive.c:1751 msgid "Warning: writing archive was slow: rewriting timestamp\n" msgstr "" -#: archive.c:2085 +#: archive.c:2014 msgid "Reading archive file mod timestamp" msgstr "" -#. FIXME: bfd can't call perror. -#: archive.c:2112 +#: archive.c:2040 msgid "Writing updated armap timestamp" msgstr "" -#: bfd.c:277 +#: bfd.c:280 msgid "No error" msgstr "" -#: bfd.c:278 +#: bfd.c:281 msgid "System call error" msgstr "" -#: bfd.c:279 +#: bfd.c:282 msgid "Invalid bfd target" msgstr "" -#: bfd.c:280 +#: bfd.c:283 msgid "File in wrong format" msgstr "" -#: bfd.c:281 +#: bfd.c:284 msgid "Archive object file in wrong format" msgstr "" -#: bfd.c:282 +#: bfd.c:285 msgid "Invalid operation" msgstr "" -#: bfd.c:283 +#: bfd.c:286 msgid "Memory exhausted" msgstr "" -#: bfd.c:284 +#: bfd.c:287 msgid "No symbols" msgstr "" -#: bfd.c:285 +#: bfd.c:288 msgid "Archive has no index; run ranlib to add one" msgstr "" -#: bfd.c:286 +#: bfd.c:289 msgid "No more archived files" msgstr "" -#: bfd.c:287 +#: bfd.c:290 msgid "Malformed archive" msgstr "" -#: bfd.c:288 +#: bfd.c:291 msgid "File format not recognized" msgstr "" -#: bfd.c:289 +#: bfd.c:292 msgid "File format is ambiguous" msgstr "" -#: bfd.c:290 +#: bfd.c:293 msgid "Section has no contents" msgstr "" -#: bfd.c:291 +#: bfd.c:294 msgid "Nonrepresentable section on output" msgstr "" -#: bfd.c:292 +#: bfd.c:295 msgid "Symbol needs debug section which does not exist" msgstr "" -#: bfd.c:293 +#: bfd.c:296 msgid "Bad value" msgstr "" -#: bfd.c:294 +#: bfd.c:297 msgid "File truncated" msgstr "" -#: bfd.c:295 +#: bfd.c:298 msgid "File too big" msgstr "" -#: bfd.c:296 +#: bfd.c:299 msgid "#" msgstr "" -#: bfd.c:703 +#: bfd.c:687 #, c-format msgid "BFD %s assertion fail %s:%d" msgstr "" -#: bfd.c:722 +#: bfd.c:703 #, c-format msgid "BFD %s internal error, aborting at %s line %d in %s\n" msgstr "" -#: bfd.c:726 +#: bfd.c:707 #, c-format msgid "BFD %s internal error, aborting at %s line %d\n" msgstr "" -#: bfd.c:728 +#: bfd.c:709 msgid "Please report this bug.\n" msgstr "" +#: bfdwin.c:202 +#, c-format +msgid "not mapping: data=%lx mapped=%d\n" +msgstr "" + +#: bfdwin.c:205 +msgid "not mapping: env var not set\n" +msgstr "" + #: binary.c:306 #, c-format msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx." msgstr "" -#: coff-a29k.c:119 +#: coff-rs6000.c:3616 coff64-rs6000.c:2109 +#, c-format +msgid "%s: symbol `%s' has unrecognized smclas %d" +msgstr "" + +#: coff-a29k.c:120 msgid "Missing IHCONST" msgstr "" -#: coff-a29k.c:180 +#: coff-a29k.c:181 msgid "Missing IHIHALF" msgstr "" -#: coff-a29k.c:212 coff-or32.c:229 +#: coff-a29k.c:213 coff-or32.c:236 msgid "Unrecognized reloc" msgstr "" -#: coff-a29k.c:408 +#: coff-a29k.c:409 msgid "missing IHCONST reloc" msgstr "" -#: coff-a29k.c:498 +#: coff-a29k.c:499 msgid "missing IHIHALF reloc" msgstr "" -#: coff-alpha.c:881 coff-alpha.c:918 coff-alpha.c:1989 coff-mips.c:1432 +#: coff-alpha.c:884 coff-alpha.c:921 coff-alpha.c:1992 coff-mips.c:1397 msgid "GP relative relocation used when GP not defined" msgstr "" -#: coff-alpha.c:1485 +#: coff-alpha.c:1488 msgid "using multiple gp values" msgstr "" -#: coff-arm.c:1066 elf32-arm.h:285 +#: coff-arm.c:1066 elf32-arm.h:294 #, c-format msgid "%s: unable to find THUMB glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1096 elf32-arm.h:320 +#: coff-arm.c:1096 elf32-arm.h:329 #, c-format msgid "%s: unable to find ARM glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1391 coff-arm.c:1486 elf32-arm.h:888 elf32-arm.h:992 +#: coff-arm.c:1394 coff-arm.c:1489 elf32-arm.h:892 elf32-arm.h:999 #, c-format msgid "%s(%s): warning: interworking not enabled." msgstr "" -#: coff-arm.c:1395 elf32-arm.h:995 +#: coff-arm.c:1398 elf32-arm.h:1002 #, c-format msgid " first occurrence: %s: arm call to thumb" msgstr "" -#: coff-arm.c:1490 elf32-arm.h:891 +#: coff-arm.c:1493 elf32-arm.h:895 #, c-format msgid " first occurrence: %s: thumb call to arm" msgstr "" -#: coff-arm.c:1493 +#: coff-arm.c:1496 msgid " consider relinking with --support-old-code enabled" msgstr "" -#: coff-arm.c:1785 coff-tic80.c:686 cofflink.c:3034 +#: coff-arm.c:1788 coff-tic80.c:687 cofflink.c:3038 #, c-format msgid "%s: bad reloc address 0x%lx in section `%s'" msgstr "" -#: coff-arm.c:2129 +#: coff-arm.c:2132 #, c-format msgid "%s: illegal symbol index in reloc: %d" msgstr "" -#: coff-arm.c:2257 +#: coff-arm.c:2265 #, c-format msgid "ERROR: %s is compiled for APCS-%d, whereas %s is compiled for APCS-%d" msgstr "" -#: coff-arm.c:2272 elf32-arm.h:2298 +#: coff-arm.c:2280 elf32-arm.h:2328 #, c-format msgid "" "ERROR: %s passes floats in float registers, whereas %s passes them in " "integer registers" msgstr "" -#: coff-arm.c:2275 elf32-arm.h:2303 +#: coff-arm.c:2283 elf32-arm.h:2333 #, c-format msgid "" "ERROR: %s passes floats in integer registers, whereas %s passes them in " "float registers" msgstr "" -#: coff-arm.c:2290 +#: coff-arm.c:2298 #, c-format msgid "" "ERROR: %s is compiled as position independent code, whereas target %s is " "absolute position" msgstr "" -#: coff-arm.c:2293 +#: coff-arm.c:2301 #, c-format msgid "" "ERROR: %s is compiled as absolute position code, whereas target %s is " "position independent" msgstr "" -#: coff-arm.c:2322 elf32-arm.h:2359 +#: coff-arm.c:2330 elf32-arm.h:2405 #, c-format msgid "Warning: %s supports interworking, whereas %s does not" msgstr "" -#: coff-arm.c:2325 elf32-arm.h:2366 +#: coff-arm.c:2333 elf32-arm.h:2412 #, c-format msgid "Warning: %s does not support interworking, whereas %s does" msgstr "" -#: coff-arm.c:2352 +#: coff-arm.c:2360 #, c-format msgid "private flags = %x:" msgstr "" -#: coff-arm.c:2360 elf32-arm.h:2419 +#: coff-arm.c:2368 elf32-arm.h:2467 msgid " [floats passed in float registers]" msgstr "" -#: coff-arm.c:2362 +#: coff-arm.c:2370 msgid " [floats passed in integer registers]" msgstr "" -#: coff-arm.c:2365 elf32-arm.h:2422 +#: coff-arm.c:2373 elf32-arm.h:2470 msgid " [position independent]" msgstr "" -#: coff-arm.c:2367 +#: coff-arm.c:2375 msgid " [absolute position]" msgstr "" -#: coff-arm.c:2371 +#: coff-arm.c:2379 msgid " [interworking flag not initialised]" msgstr "" -#: coff-arm.c:2373 +#: coff-arm.c:2381 msgid " [interworking supported]" msgstr "" -#: coff-arm.c:2375 +#: coff-arm.c:2383 msgid " [interworking not supported]" msgstr "" -#: coff-arm.c:2423 elf32-arm.h:2125 +#: coff-arm.c:2431 elf32-arm.h:2150 #, c-format msgid "" "Warning: Not setting interworking flag of %s since it has already been " "specified as non-interworking" msgstr "" -#: coff-arm.c:2427 elf32-arm.h:2129 +#: coff-arm.c:2435 elf32-arm.h:2154 #, c-format msgid "Warning: Clearing the interworking flag of %s due to outside request" msgstr "" -#: coff-i960.c:136 coff-i960.c:485 -msgid "uncertain calling convention for non-COFF symbol" +#: coffcode.h:1108 +#, c-format +msgid "%s (%s): Section flag %s (0x%x) ignored" msgstr "" -#: coff-m68k.c:481 coff-mips.c:2429 elf32-m68k.c:2157 elf32-mips.c:1844 -msgid "unsupported reloc type" +#: coffcode.h:2214 +#, c-format +msgid "Unrecognized TI COFF target id '0x%x'" msgstr "" -#: coff-mips.c:874 elf32-mips.c:1062 elf64-mips.c:1609 -msgid "GP relative relocation when _gp not defined" +#: coffcode.h:4439 +#, c-format +msgid "%s: warning: illegal symbol index %ld in line numbers" msgstr "" -#. No other sections should appear in -membedded-pic -#. code. -#: coff-mips.c:2466 -msgid "reloc against unsupported section" +#: coffcode.h:4453 +#, c-format +msgid "%s: warning: duplicate line number information for `%s'" msgstr "" -#: coff-mips.c:2474 -msgid "reloc not properly aligned" +#: coffcode.h:4807 +#, c-format +msgid "%s: Unrecognized storage class %d for %s symbol `%s'" msgstr "" -#: coff-rs6000.c:2760 +#: coffcode.h:4940 #, c-format -msgid "%s: unsupported relocation type 0x%02x" +msgid "warning: %s: local symbol `%s' has no section" msgstr "" -#: coff-rs6000.c:2853 +#: coff-tic4x.c:218 coff-tic54x.c:373 coffcode.h:5047 #, c-format -msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" +msgid "%s: warning: illegal symbol index %ld in relocs" msgstr "" -#: coff-rs6000.c:3586 coff64-rs6000.c:2080 +#: coffcode.h:5085 #, c-format -msgid "%s: symbol `%s' has unrecognized smclas %d" +msgid "%s: illegal relocation type %d at address 0x%lx" msgstr "" -#: coff-tic54x.c:279 coff-tic80.c:449 +#: coffgen.c:1666 #, c-format -msgid "Unrecognized reloc type 0x%x" +msgid "%s: bad string table size %lu" msgstr "" -#: coff-tic54x.c:390 coffcode.h:4981 +#: coff-h8300.c:1047 #, c-format -msgid "%s: warning: illegal symbol index %ld in relocs" +msgid "cannot handle R_MEM_INDIRECT reloc when using %s output" msgstr "" -#: coff-w65.c:363 -#, c-format -msgid "ignoring reloc %s\n" +#: coff-i960.c:137 coff-i960.c:486 +msgid "uncertain calling convention for non-COFF symbol" msgstr "" -#: coffcode.h:1086 +#: cofflink.c:538 elflink.h:1276 #, c-format -msgid "%s (%s): Section flag %s (0x%x) ignored" +msgid "Warning: type of symbol `%s' changed from %d to %d in %s" msgstr "" -#: coffcode.h:2143 +#: cofflink.c:2328 #, c-format -msgid "Unrecognized TI COFF target id '0x%x'" +msgid "%s: relocs in section `%s', but it has no contents" msgstr "" -#: coffcode.h:4372 +#: cofflink.c:2671 coffswap.h:890 #, c-format -msgid "%s: warning: illegal symbol index %ld in line numbers" +msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" msgstr "" -#: coffcode.h:4386 +#: cofflink.c:2680 coffswap.h:876 #, c-format -msgid "%s: warning: duplicate line number information for `%s'" +msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" msgstr "" -#: coffcode.h:4743 -#, c-format -msgid "%s: Unrecognized storage class %d for %s symbol `%s'" +#: coff-m68k.c:482 coff-mips.c:2394 elf32-m68k.c:2193 elf32-mips.c:1783 +msgid "unsupported reloc type" msgstr "" -#: coffcode.h:4874 -#, c-format -msgid "warning: %s: local symbol `%s' has no section" +#: coff-mips.c:839 elf32-mips.c:1088 elf64-mips.c:1590 elfn32-mips.c:1554 +msgid "GP relative relocation when _gp not defined" msgstr "" -#: coffcode.h:5019 +#. No other sections should appear in -membedded-pic +#. code. +#: coff-mips.c:2431 +msgid "reloc against unsupported section" +msgstr "" + +#: coff-mips.c:2439 +msgid "reloc not properly aligned" +msgstr "" + +#: coff-rs6000.c:2790 #, c-format -msgid "%s: illegal relocation type %d at address 0x%lx" +msgid "%s: unsupported relocation type 0x%02x" msgstr "" -#: coffgen.c:1668 +#: coff-rs6000.c:2883 #, c-format -msgid "%s: bad string table size %lu" +msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" msgstr "" -#: cofflink.c:534 elflink.h:1930 +#: coff-tic4x.c:170 coff-tic54x.c:288 coff-tic80.c:450 #, c-format -msgid "Warning: type of symbol `%s' changed from %d to %d in %s" +msgid "Unrecognized reloc type 0x%x" msgstr "" -#: cofflink.c:2324 +#: coff-w65.c:364 #, c-format -msgid "%s: relocs in section `%s', but it has no contents" +msgid "ignoring reloc %s\n" msgstr "" -#: cofflink.c:2667 coffswap.h:877 +#: cpu-arm.c:196 cpu-arm.c:206 #, c-format -msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" +msgid "ERROR: %s is compiled for the EP9312, whereas %s is compiled for XScale" msgstr "" -#: cofflink.c:2676 coffswap.h:864 +#: cpu-arm.c:344 #, c-format -msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" +msgid "warning: unable to update contents of %s section in %s" msgstr "" -#: dwarf2.c:382 +#: dwarf2.c:380 msgid "Dwarf Error: Can't find .debug_str section." msgstr "" -#: dwarf2.c:399 +#: dwarf2.c:397 #, c-format msgid "" "Dwarf Error: DW_FORM_strp offset (%lu) greater than or equal to .debug_str " "size (%lu)." msgstr "" -#: dwarf2.c:543 +#: dwarf2.c:541 msgid "Dwarf Error: Can't find .debug_abbrev section." msgstr "" -#: dwarf2.c:560 +#: dwarf2.c:556 #, c-format msgid "" "Dwarf Error: Abbrev offset (%lu) greater than or equal to .debug_abbrev size " "(%lu)." msgstr "" -#: dwarf2.c:760 +#: dwarf2.c:756 #, c-format msgid "Dwarf Error: Invalid or unhandled FORM value: %u." msgstr "" -#: dwarf2.c:924 +#: dwarf2.c:933 msgid "Dwarf Error: mangled line number section (bad file number)." msgstr "" -#: dwarf2.c:1016 +#: dwarf2.c:1032 msgid "Dwarf Error: Can't find .debug_line section." msgstr "" -#: dwarf2.c:1039 +#: dwarf2.c:1049 #, c-format msgid "" "Dwarf Error: Line offset (%lu) greater than or equal to .debug_line size (%" "lu)." msgstr "" -#: dwarf2.c:1245 +#: dwarf2.c:1255 msgid "Dwarf Error: mangled line number section." msgstr "" -#: dwarf2.c:1454 dwarf2.c:1665 +#: dwarf2.c:1470 dwarf2.c:1620 #, c-format msgid "Dwarf Error: Could not find abbrev number %u." msgstr "" -#: dwarf2.c:1626 +#: dwarf2.c:1581 #, c-format msgid "" "Dwarf Error: found dwarf version '%u', this reader only handles version 2 " "information." msgstr "" -#: dwarf2.c:1633 +#: dwarf2.c:1588 #, c-format msgid "" "Dwarf Error: found address size '%u', this reader can not handle sizes " "greater than '%u'." msgstr "" -#: dwarf2.c:1656 +#: dwarf2.c:1611 #, c-format msgid "Dwarf Error: Bad abbrev number: %u." msgstr "" -#: ecoff.c:1320 +#: ecoff.c:1339 #, c-format msgid "Unknown basic type %d" msgstr "" -#: ecoff.c:1580 +#: ecoff.c:1599 #, c-format msgid "" "\n" " End+1 symbol: %ld" msgstr "" -#: ecoff.c:1587 ecoff.c:1590 +#: ecoff.c:1606 ecoff.c:1609 #, c-format msgid "" "\n" " First symbol: %ld" msgstr "" -#: ecoff.c:1602 +#: ecoff.c:1621 #, c-format msgid "" "\n" " End+1 symbol: %-7ld Type: %s" msgstr "" -#: ecoff.c:1609 +#: ecoff.c:1628 #, c-format msgid "" "\n" " Local symbol: %ld" msgstr "" -#: ecoff.c:1617 +#: ecoff.c:1636 #, c-format msgid "" "\n" " struct; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1622 +#: ecoff.c:1641 #, c-format msgid "" "\n" " union; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1627 +#: ecoff.c:1646 #, c-format msgid "" "\n" " enum; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1633 +#: ecoff.c:1652 #, c-format msgid "" "\n" " Type: %s" msgstr "" -#: elf-hppa.h:1476 elf-hppa.h:1509 elf32-ppc.c:3091 elf32-sh.c:4537 -#: elf64-sh64.c:1659 +#: elf32-arm.h:1228 #, c-format -msgid "" -"%s: warning: unresolvable relocation against symbol `%s' from %s section" -msgstr "" - -#: elf-m10200.c:446 elf-m10300.c:656 elf32-arm.h:2085 elf32-avr.c:833 -#: elf32-cris.c:1403 elf32-d10v.c:481 elf32-fr30.c:635 elf32-frv.c:809 -#: elf32-h8300.c:548 elf32-i860.c:1031 elf32-m32r.c:1280 elf32-openrisc.c:439 -#: elf32-v850.c:1691 elf32-xstormy16.c:933 elf64-mmix.c:1302 -msgid "internal error: out of range error" -msgstr "" - -#: elf-m10200.c:450 elf-m10300.c:660 elf32-arm.h:2089 elf32-avr.c:837 -#: elf32-cris.c:1407 elf32-d10v.c:485 elf32-fr30.c:639 elf32-frv.c:813 -#: elf32-h8300.c:552 elf32-i860.c:1035 elf32-m32r.c:1284 elf32-openrisc.c:443 -#: elf32-v850.c:1695 elf32-xstormy16.c:937 elf64-mmix.c:1306 elfxx-mips.c:5258 -msgid "internal error: unsupported relocation error" -msgstr "" - -#: elf-m10200.c:454 elf-m10300.c:664 elf32-arm.h:2093 elf32-d10v.c:489 -#: elf32-h8300.c:556 elf32-m32r.c:1288 -msgid "internal error: dangerous error" -msgstr "" - -#: elf-m10200.c:458 elf-m10300.c:668 elf32-arm.h:2097 elf32-avr.c:845 -#: elf32-cris.c:1415 elf32-d10v.c:493 elf32-fr30.c:647 elf32-frv.c:821 -#: elf32-h8300.c:560 elf32-i860.c:1043 elf32-m32r.c:1292 elf32-openrisc.c:451 -#: elf32-v850.c:1715 elf32-xstormy16.c:945 elf64-mmix.c:1314 -msgid "internal error: unknown error" -msgstr "" - -#: elf.c:343 -#, c-format -msgid "%s: invalid string offset %u >= %lu for section `%s'" -msgstr "" - -#: elf.c:589 -#, c-format -msgid "%s: invalid SHT_GROUP entry" -msgstr "" - -#: elf.c:660 -#, c-format -msgid "%s: no group info for section %s" -msgstr "" - -#: elf.c:1023 -msgid "" -"\n" -"Program Header:\n" -msgstr "" - -#: elf.c:1073 -msgid "" -"\n" -"Dynamic Section:\n" -msgstr "" - -#: elf.c:1202 -msgid "" -"\n" -"Version definitions:\n" -msgstr "" - -#: elf.c:1225 -msgid "" -"\n" -"Version References:\n" -msgstr "" - -#: elf.c:1230 -#, c-format -msgid " required from %s:\n" -msgstr "" - -#: elf.c:1904 -#, c-format -msgid "%s: invalid link %lu for reloc section %s (index %u)" +msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'." msgstr "" -#: elf.c:3619 +#: elf32-arm.h:1424 #, c-format -msgid "%s: Not enough room for program headers (allocated %u, need %u)" +msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'." msgstr "" -#: elf.c:3724 +#: elf32-arm.h:1918 elf32-sh.c:4706 elf64-sh64.c:1613 #, c-format -msgid "%s: Not enough room for program headers, try linking with -N" +msgid "%s(%s+0x%lx): %s relocation against SEC_MERGE section" msgstr "" -#: elf.c:3849 +#: elf32-arm.h:2012 #, c-format msgid "" -"Error: First section in segment (%s) starts at 0x%x whereas the segment " -"starts at 0x%x" -msgstr "" - -#: elf.c:4164 -#, c-format -msgid "%s: warning: allocated section `%s' not in segment" -msgstr "" - -#: elf.c:4488 -#, c-format -msgid "%s: symbol `%s' required but not present" -msgstr "" - -#: elf.c:4765 -#, c-format -msgid "%s: warning: Empty loadable segment detected, is this intentional ?\n" -msgstr "" - -#: elf.c:6213 -#, c-format -msgid "%s: unsupported relocation type %s" +"%s: warning: unresolvable relocation %d against symbol `%s' from %s section" msgstr "" -#: elf32-arm.h:1222 -#, c-format -msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'." +#: elf-m10200.c:442 elf-m10300.c:1695 elf32-arm.h:2088 elf32-avr.c:812 +#: elf32-cris.c:1390 elf32-d10v.c:482 elf32-fr30.c:634 elf32-frv.c:815 +#: elf32-h8300.c:509 elf32-i860.c:1028 elf32-ip2k.c:1586 elf32-iq2000.c:699 +#: elf32-m32r.c:1283 elf32-m68hc1x.c:1305 elf32-msp430.c:510 +#: elf32-openrisc.c:436 elf32-v850.c:1777 elf32-xstormy16.c:976 +#: elf64-mmix.c:1332 +msgid "internal error: out of range error" msgstr "" -#: elf32-arm.h:1418 -#, c-format -msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'." +#: elf-m10200.c:446 elf-m10300.c:1699 elf32-arm.h:2092 elf32-avr.c:816 +#: elf32-cris.c:1394 elf32-d10v.c:486 elf32-fr30.c:638 elf32-frv.c:819 +#: elf32-h8300.c:513 elf32-i860.c:1032 elf32-iq2000.c:703 elf32-m32r.c:1287 +#: elf32-m68hc1x.c:1309 elf32-msp430.c:514 elf32-openrisc.c:440 +#: elf32-v850.c:1781 elf32-xstormy16.c:980 elf64-mmix.c:1336 elfxx-mips.c:6452 +msgid "internal error: unsupported relocation error" msgstr "" -#: elf32-arm.h:1915 elf32-sh.c:4444 -#, c-format -msgid "%s(%s+0x%lx): %s relocation against SEC_MERGE section" +#: elf-m10200.c:450 elf-m10300.c:1703 elf32-arm.h:2096 elf32-d10v.c:490 +#: elf32-h8300.c:517 elf32-m32r.c:1291 elf32-m68hc1x.c:1313 +msgid "internal error: dangerous error" msgstr "" -#: elf32-arm.h:2009 -#, c-format -msgid "" -"%s: warning: unresolvable relocation %d against symbol `%s' from %s section" +#: elf-m10200.c:454 elf-m10300.c:1707 elf32-arm.h:2100 elf32-avr.c:824 +#: elf32-cris.c:1402 elf32-d10v.c:494 elf32-fr30.c:646 elf32-frv.c:827 +#: elf32-h8300.c:521 elf32-i860.c:1040 elf32-ip2k.c:1601 elf32-iq2000.c:711 +#: elf32-m32r.c:1295 elf32-m68hc1x.c:1317 elf32-msp430.c:522 +#: elf32-openrisc.c:448 elf32-v850.c:1801 elf32-xstormy16.c:988 +#: elf64-mmix.c:1344 +msgid "internal error: unknown error" msgstr "" -#: elf32-arm.h:2177 +#: elf32-arm.h:2202 #, c-format msgid "" "Warning: Clearing the interworking flag of %s because non-interworking code " "in %s has been linked with it" msgstr "" -#: elf32-arm.h:2272 +#: elf32-arm.h:2302 #, c-format msgid "" "ERROR: %s is compiled for EABI version %d, whereas %s is compiled for " "version %d" msgstr "" -#: elf32-arm.h:2286 +#: elf32-arm.h:2316 #, c-format msgid "ERROR: %s is compiled for APCS-%d, whereas target %s uses APCS-%d" msgstr "" -#: elf32-arm.h:2314 +#: elf32-arm.h:2344 #, c-format -msgid "ERROR: %s uses VFP instructions, whereas %s uses FPA instructions" +msgid "ERROR: %s uses VFP instructions, whereas %s does not" msgstr "" -#: elf32-arm.h:2319 +#: elf32-arm.h:2349 #, c-format -msgid "ERROR: %s uses FPA instructions, whereas %s uses VFP instructions" +msgid "ERROR: %s uses FPA instructions, whereas %s does not" msgstr "" -#: elf32-arm.h:2339 +#: elf32-arm.h:2360 elf32-arm.h:2365 +#, c-format +msgid "ERROR: %s uses Maverick instructions, whereas %s does not" +msgstr "" + +#: elf32-arm.h:2385 #, c-format msgid "ERROR: %s uses software FP, whereas %s uses hardware FP" msgstr "" -#: elf32-arm.h:2344 +#: elf32-arm.h:2390 #, c-format msgid "ERROR: %s uses hardware FP, whereas %s uses software FP" msgstr "" #. Ignore init flag - it may not be set, despite the flags field #. containing valid data. -#: elf32-arm.h:2397 elf32-cris.c:2989 elf32-m68k.c:410 elf32-vax.c:548 -#: elfxx-mips.c:7760 +#: elf32-arm.h:2443 elf32-cris.c:2975 elf32-m68hc1x.c:1459 elf32-m68k.c:397 +#: elf32-vax.c:546 elfxx-mips.c:9240 #, c-format msgid "private flags = %lx:" msgstr "" -#: elf32-arm.h:2406 +#: elf32-arm.h:2452 msgid " [interworking enabled]" msgstr "" -#: elf32-arm.h:2414 +#: elf32-arm.h:2460 msgid " [VFP float format]" msgstr "" -#: elf32-arm.h:2416 +#: elf32-arm.h:2462 +msgid " [Maverick float format]" +msgstr "" + +#: elf32-arm.h:2464 msgid " [FPA float format]" msgstr "" -#: elf32-arm.h:2425 +#: elf32-arm.h:2473 msgid " [new ABI]" msgstr "" -#: elf32-arm.h:2428 +#: elf32-arm.h:2476 msgid " [old ABI]" msgstr "" -#: elf32-arm.h:2431 +#: elf32-arm.h:2479 msgid " [software FP]" msgstr "" -#: elf32-arm.h:2439 +#: elf32-arm.h:2488 msgid " [Version1 EABI]" msgstr "" -#: elf32-arm.h:2442 elf32-arm.h:2453 +#: elf32-arm.h:2491 elf32-arm.h:2502 msgid " [sorted symbol table]" msgstr "" -#: elf32-arm.h:2444 elf32-arm.h:2455 +#: elf32-arm.h:2493 elf32-arm.h:2504 msgid " [unsorted symbol table]" msgstr "" -#: elf32-arm.h:2450 +#: elf32-arm.h:2499 msgid " [Version2 EABI]" msgstr "" -#: elf32-arm.h:2458 +#: elf32-arm.h:2507 msgid " [dynamic symbols use segment index]" msgstr "" -#: elf32-arm.h:2461 +#: elf32-arm.h:2510 msgid " [mapping symbols precede others]" msgstr "" -#: elf32-arm.h:2468 +#: elf32-arm.h:2517 msgid " " msgstr "" -#: elf32-arm.h:2475 +#: elf32-arm.h:2524 msgid " [relocatable executable]" msgstr "" -#: elf32-arm.h:2478 +#: elf32-arm.h:2527 msgid " [has entry point]" msgstr "" -#: elf32-arm.h:2483 +#: elf32-arm.h:2532 msgid "" msgstr "" -#: elf32-avr.c:841 elf32-cris.c:1411 elf32-fr30.c:643 elf32-frv.c:817 -#: elf32-i860.c:1039 elf32-openrisc.c:447 elf32-v850.c:1699 -#: elf32-xstormy16.c:941 elf64-mmix.c:1310 +#: elf32-avr.c:820 elf32-cris.c:1398 elf32-fr30.c:642 elf32-frv.c:823 +#: elf32-i860.c:1036 elf32-ip2k.c:1597 elf32-iq2000.c:707 elf32-msp430.c:518 +#: elf32-openrisc.c:444 elf32-v850.c:1785 elf32-xstormy16.c:984 +#: elf64-mmix.c:1340 msgid "internal error: dangerous relocation" msgstr "" -#: elf32-cris.c:949 +#: elf32-cris.c:931 #, c-format msgid "%s: unresolvable relocation %s against symbol `%s' from %s section" msgstr "" -#: elf32-cris.c:1012 +#: elf32-cris.c:993 #, c-format msgid "" "%s: No PLT nor GOT for relocation %s against symbol `%s' from %s section" msgstr "" -#: elf32-cris.c:1015 elf32-cris.c:1141 +#: elf32-cris.c:996 elf32-cris.c:1122 msgid "[whose name is lost]" msgstr "" -#: elf32-cris.c:1130 +#: elf32-cris.c:1111 #, c-format msgid "" "%s: relocation %s with non-zero addend %d against local symbol from %s " "section" msgstr "" -#: elf32-cris.c:1137 +#: elf32-cris.c:1118 #, c-format msgid "" "%s: relocation %s with non-zero addend %d against symbol `%s' from %s section" msgstr "" -#: elf32-cris.c:1155 +#: elf32-cris.c:1143 #, c-format msgid "" "%s: relocation %s is not allowed for global symbol: `%s' from %s section" msgstr "" -#: elf32-cris.c:1170 +#: elf32-cris.c:1158 #, c-format msgid "%s: relocation %s in section %s with no GOT created" msgstr "" -#: elf32-cris.c:1288 +#: elf32-cris.c:1277 #, c-format msgid "%s: Internal inconsistency; no relocation section %s" msgstr "" -#: elf32-cris.c:2514 +#: elf32-cris.c:2500 #, c-format msgid "" "%s, section %s:\n" " relocation %s should not be used in a shared object; recompile with -fPIC" msgstr "" -#: elf32-cris.c:2992 +#: elf32-cris.c:2978 msgid " [symbols have a _ prefix]" msgstr "" -#: elf32-cris.c:3031 +#: elf32-cris.c:3017 #, c-format msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols" msgstr "" -#: elf32-cris.c:3032 +#: elf32-cris.c:3018 #, c-format msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols" msgstr "" -#: elf32-frv.c:1217 +#: elf32-frv.c:1223 #, c-format msgid "" "%s: compiled with %s and linked with modules that use non-pic relocations" msgstr "" -#: elf32-frv.c:1267 +#: elf32-frv.c:1273 elf32-iq2000.c:895 #, c-format msgid "%s: compiled with %s and linked with modules compiled with %s" msgstr "" -#: elf32-frv.c:1279 +#: elf32-frv.c:1285 #, c-format msgid "" "%s: uses different unknown e_flags (0x%lx) fields than previous modules (0x%" "lx)" msgstr "" -#: elf32-frv.c:1315 +#: elf32-frv.c:1321 elf32-iq2000.c:933 #, c-format msgid "private flags = 0x%lx:" msgstr "" -#: elf32-gen.c:82 elf64-gen.c:82 +#: elf32-gen.c:83 elf64-gen.c:82 #, c-format msgid "%s: Relocations in generic ELF (EM: %d)" msgstr "" -#: elf32-hppa.c:672 elf64-ppc.c:2324 +#: elf32-hppa.c:672 elf32-m68hc1x.c:176 elf64-ppc.c:3118 #, c-format msgid "%s: cannot create stub entry %s" msgstr "" -#: elf32-hppa.c:957 elf32-hppa.c:3557 +#: elf32-hppa.c:957 elf32-hppa.c:3538 #, c-format msgid "%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections" msgstr "" -#: elf32-hppa.c:1340 elf64-x86-64.c:675 +#: elf32-hppa.c:1340 elf64-x86-64.c:672 elf64-x86-64.c:797 #, c-format msgid "" "%s: relocation %s can not be used when making a shared object; recompile " @@ -949,437 +893,601 @@ msgstr "" msgid "Could not find relocation section for %s" msgstr "" -#: elf32-hppa.c:2857 +#: elf32-hppa.c:2828 #, c-format msgid "%s: duplicate export stub %s" msgstr "" -#: elf32-hppa.c:3435 +#: elf32-hppa.c:3416 #, c-format msgid "%s(%s+0x%lx): fixing %s" msgstr "" -#: elf32-hppa.c:4082 +#: elf32-hppa.c:4039 #, c-format msgid "%s(%s+0x%lx): cannot handle %s for %s" msgstr "" -#: elf32-hppa.c:4395 +#: elf32-hppa.c:4357 msgid ".got section not immediately after .plt section" msgstr "" -#: elf32-i386.c:401 +#: elf32-i386.c:326 #, c-format msgid "%s: invalid relocation type %d" msgstr "" -#: elf32-i386.c:916 elf32-s390.c:651 elf64-s390.c:597 elf64-x86-64.c:593 +#: elf32-i386.c:841 elf32-s390.c:990 elf32-sparc.c:887 elf32-xtensa.c:637 +#: elf64-s390.c:943 elf64-x86-64.c:650 #, c-format msgid "%s: bad symbol index: %d" msgstr "" -#: elf32-i386.c:1025 +#: elf32-i386.c:949 elf32-s390.c:1168 elf32-sh.c:6426 elf32-sparc.c:1011 +#: elf64-s390.c:1129 #, c-format msgid "%s: `%s' accessed both as normal and thread local symbol" msgstr "" -#: elf32-i386.c:1137 elf32-s390.c:810 elf64-ppc.c:2829 elf64-s390.c:761 -#: elf64-x86-64.c:763 +#: elf32-i386.c:1064 elf32-s390.c:1279 elf64-ppc.c:3929 elf64-s390.c:1243 +#: elf64-x86-64.c:886 #, c-format msgid "%s: bad relocation section name `%s'" msgstr "" -#: elf32-i386.c:2990 elf32-s390.c:1983 elf32-sparc.c:1572 elf64-ppc.c:5941 -#: elf64-s390.c:1947 elf64-sparc.c:2578 elf64-x86-64.c:1950 +#: elf32-i386.c:2908 elf32-m68k.c:1757 elf32-s390.c:3022 elf32-sparc.c:2879 +#: elf32-xtensa.c:2193 elf64-s390.c:3018 elf64-sparc.c:2664 +#: elf64-x86-64.c:2452 #, c-format msgid "%s(%s+0x%lx): unresolvable relocation against symbol `%s'" msgstr "" -#: elf32-i386.c:3029 elf32-s390.c:2021 elf64-ppc.c:6000 elf64-s390.c:1985 -#: elf64-x86-64.c:1988 +#: elf32-i386.c:2947 elf32-m68k.c:1796 elf32-s390.c:3072 elf64-s390.c:3068 +#: elf64-x86-64.c:2490 #, c-format msgid "%s(%s+0x%lx): reloc against `%s': error %d" msgstr "" -#: elf32-m32r.c:926 +#: elf32-ip2k.c:565 elf32-ip2k.c:571 elf32-ip2k.c:734 elf32-ip2k.c:740 +msgid "" +"ip2k relaxer: switch table without complete matching relocation information." +msgstr "" + +#: elf32-ip2k.c:588 elf32-ip2k.c:767 +msgid "ip2k relaxer: switch table header corrupt." +msgstr "" + +#: elf32-ip2k.c:1395 +#, c-format +msgid "ip2k linker: missing page instruction at 0x%08lx (dest = 0x%08lx)." +msgstr "" + +#: elf32-ip2k.c:1409 +#, c-format +msgid "ip2k linker: redundant page instruction at 0x%08lx (dest = 0x%08lx)." +msgstr "" + +#. Only if it's not an unresolved symbol. +#: elf32-ip2k.c:1593 +msgid "unsupported relocation between data/insn address spaces" +msgstr "" + +#: elf32-iq2000.c:907 elf32-m68hc1x.c:1431 elf32-ppc.c:2175 elf64-sparc.c:3072 +#: elfxx-mips.c:9197 +#, c-format +msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" +msgstr "" + +#: elf32-m32r.c:930 msgid "SDA relocation when _SDA_BASE_ not defined" msgstr "" -#: elf32-m32r.c:1015 elf32-ppc.c:2987 elf64-alpha.c:4186 elf64-alpha.c:4314 -#: elf32-ia64.c:3693 elf64-ia64.c:3693 +#: elf32-ia64.c:3817 elf32-m32r.c:1018 elf64-alpha.c:4279 elf64-alpha.c:4407 +#: elf64-ia64.c:3817 #, c-format msgid "%s: unknown relocation type %d" msgstr "" -#: elf32-m32r.c:1223 +#: elf32-m32r.c:1226 #, c-format msgid "%s: The target (%s) of an %s relocation is in the wrong section (%s)" msgstr "" -#: elf32-m32r.c:1949 +#: elf32-m32r.c:1952 #, c-format msgid "%s: Instruction set mismatch with previous modules" msgstr "" -#: elf32-m32r.c:1972 +#: elf32-m32r.c:1975 #, c-format msgid "private flags = %lx" msgstr "" -#: elf32-m32r.c:1977 -msgid ": m32r instructions" +#: elf32-m32r.c:1980 +msgid ": m32r instructions" +msgstr "" + +#: elf32-m32r.c:1981 +msgid ": m32rx instructions" +msgstr "" + +#: elf32-m68hc1x.c:1217 +#, c-format +msgid "" +"Reference to the far symbol `%s' using a wrong relocation may result in " +"incorrect execution" +msgstr "" + +#: elf32-m68hc1x.c:1240 +#, c-format +msgid "" +"banked address [%lx:%04lx] (%lx) is not in the same bank as current banked " +"address [%lx:%04lx] (%lx)" +msgstr "" + +#: elf32-m68hc1x.c:1259 +#, c-format +msgid "" +"reference to a banked address [%lx:%04lx] in the normal address space at %" +"04lx" +msgstr "" + +#: elf32-m68hc1x.c:1396 +#, c-format +msgid "" +"%s: linking files compiled for 16-bit integers (-mshort) and others for 32-" +"bit integers" +msgstr "" + +#: elf32-m68hc1x.c:1404 +#, c-format +msgid "" +"%s: linking files compiled for 32-bit double (-fshort-double) and others for " +"64-bit double" +msgstr "" + +#: elf32-m68hc1x.c:1414 +#, c-format +msgid "%s: linking files compiled for HCS12 with others compiled for HC12" +msgstr "" + +#: elf32-m68hc1x.c:1462 +msgid "[abi=32-bit int, " +msgstr "" + +#: elf32-m68hc1x.c:1464 +msgid "[abi=16-bit int, " +msgstr "" + +#: elf32-m68hc1x.c:1467 +msgid "64-bit double, " +msgstr "" + +#: elf32-m68hc1x.c:1469 +msgid "32-bit double, " +msgstr "" + +#: elf32-m68hc1x.c:1472 +msgid "cpu=HC11]" +msgstr "" + +#: elf32-m68hc1x.c:1474 +msgid "cpu=HCS12]" +msgstr "" + +#: elf32-m68hc1x.c:1476 +msgid "cpu=HC12]" +msgstr "" + +#: elf32-m68hc1x.c:1479 +msgid " [memory=bank-model]" msgstr "" -#: elf32-m32r.c:1978 -msgid ": m32rx instructions" +#: elf32-m68hc1x.c:1481 +msgid " [memory=flat]" msgstr "" -#: elf32-m68k.c:413 +#: elf32-m68k.c:400 msgid " [cpu32]" msgstr "" -#: elf32-m68k.c:416 +#: elf32-m68k.c:403 msgid " [m68000]" msgstr "" -#: elf32-mcore.c:354 elf32-mcore.c:457 +#: elf32-mcore.c:353 elf32-mcore.c:456 #, c-format msgid "%s: Relocation %s (%d) is not currently supported.\n" msgstr "" -#: elf32-mcore.c:442 +#: elf32-mcore.c:441 #, c-format msgid "%s: Unknown relocation type %d\n" msgstr "" -#: elf32-mips.c:1152 elf64-mips.c:1783 +#: elf32-mips.c:1170 elf64-mips.c:1717 elfn32-mips.c:1664 msgid "32bits gp relative relocation occurs for an external symbol" msgstr "" -#: elf32-mips.c:1301 +#: elf32-mips.c:1314 elf64-mips.c:1830 elfn32-mips.c:1783 #, c-format msgid "Linking mips16 objects into %s format is not supported" msgstr "" -#: elf32-ppc.c:1460 +#: elf32-ppc.c:2056 +#, c-format +msgid "generic linker can't handle %s" +msgstr "" + +#: elf32-ppc.c:2138 #, c-format msgid "" "%s: compiled with -mrelocatable and linked with modules compiled normally" msgstr "" -#: elf32-ppc.c:1468 +#: elf32-ppc.c:2147 #, c-format msgid "" "%s: compiled normally and linked with modules compiled with -mrelocatable" msgstr "" -#: elf32-ppc.c:1494 elf64-sparc.c:2990 elfxx-mips.c:7717 +#: elf32-ppc.c:3413 #, c-format -msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" +msgid "%s: relocation %s cannot be used when making a shared object" msgstr "" -#: elf32-ppc.c:1592 +#. It does not make sense to have a procedure linkage +#. table entry for a local symbol. +#: elf32-ppc.c:3619 #, c-format -msgid "%s: Unknown special linker type %d" +msgid "%s(%s+0x%lx): %s reloc against local symbol" msgstr "" -#: elf32-ppc.c:2273 elf32-ppc.c:2307 elf32-ppc.c:2342 +#: elf32-ppc.c:4862 elf64-ppc.c:7789 #, c-format -msgid "%s: relocation %s cannot be used when making a shared object" +msgid "%s: unknown relocation type %d for symbol %s" msgstr "" -#: elf32-ppc.c:3126 elf64-ppc.c:5496 +#: elf32-ppc.c:5113 #, c-format -msgid "%s: unknown relocation type %d for symbol %s" +msgid "%s(%s+0x%lx): non-zero addend on %s reloc against `%s'" msgstr "" -#: elf32-ppc.c:3489 elf32-ppc.c:3510 elf32-ppc.c:3560 +#: elf32-ppc.c:5399 elf32-ppc.c:5425 elf32-ppc.c:5484 #, c-format msgid "" -"%s: The target (%s) of a %s relocation is in the wrong output section (%s)" +"%s: the target (%s) of a %s relocation is in the wrong output section (%s)" msgstr "" -#: elf32-ppc.c:3626 +#: elf32-ppc.c:5539 #, c-format -msgid "%s: Relocation %s is not yet supported for symbol %s." +msgid "%s: relocation %s is not yet supported for symbol %s." msgstr "" -#: elf32-sh.c:1973 +#: elf32-ppc.c:5594 elf64-ppc.c:8461 #, c-format -msgid "%s: 0x%lx: warning: bad R_SH_USES offset" +msgid "%s(%s+0x%lx): unresolvable %s relocation against symbol `%s'" msgstr "" -#: elf32-sh.c:1985 +#: elf32-ppc.c:5644 elf64-ppc.c:8507 #, c-format -msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" +msgid "%s(%s+0x%lx): %s reloc against `%s': error %d" msgstr "" -#: elf32-sh.c:2002 +#: elf32-ppc.c:5888 #, c-format -msgid "%s: 0x%lx: warning: bad R_SH_USES load offset" +msgid "corrupt or empty %s section in %s" msgstr "" -#: elf32-sh.c:2017 +#: elf32-ppc.c:5895 #, c-format -msgid "%s: 0x%lx: warning: could not find expected reloc" +msgid "unable to read in %s section from %s" msgstr "" -#: elf32-sh.c:2045 +#: elf32-ppc.c:5901 #, c-format -msgid "%s: 0x%lx: warning: symbol in unexpected section" +msgid "corrupt %s section in %s" msgstr "" -#: elf32-sh.c:2162 +#: elf32-ppc.c:5944 #, c-format -msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" +msgid "warning: unable to set size of %s section in %s" msgstr "" -#: elf32-sh.c:2171 -#, c-format -msgid "%s: 0x%lx: warning: bad count" +#: elf32-ppc.c:5994 +msgid "failed to allocate space for new APUinfo section." msgstr "" -#: elf32-sh.c:2559 elf32-sh.c:2935 -#, c-format -msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" +#: elf32-ppc.c:6013 +msgid "failed to compute new APUinfo section." msgstr "" -#: elf32-sh.c:4392 elf64-sh64.c:1576 -msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled" +#: elf32-ppc.c:6016 +msgid "failed to install new APUinfo section." msgstr "" -#: elf32-sh.c:4611 +#: elf32-s390.c:2256 elf64-s390.c:2226 #, c-format -msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation" +msgid "%s(%s+0x%lx): invalid instruction for TLS relocation %s" msgstr "" -#: elf32-sh64.c:203 elf64-sh64.c:2364 +#: elf32-sh64.c:221 elf64-sh64.c:2407 #, c-format msgid "%s: compiled as 32-bit object and %s is 64-bit" msgstr "" -#: elf32-sh64.c:206 elf64-sh64.c:2367 +#: elf32-sh64.c:224 elf64-sh64.c:2410 #, c-format msgid "%s: compiled as 64-bit object and %s is 32-bit" msgstr "" -#: elf32-sh64.c:208 elf64-sh64.c:2369 +#: elf32-sh64.c:226 elf64-sh64.c:2412 #, c-format msgid "%s: object size does not match that of target %s" msgstr "" -#: elf32-sh64.c:443 elf64-sh64.c:2944 +#: elf32-sh64.c:461 elf64-sh64.c:2990 #, c-format msgid "%s: encountered datalabel symbol in input" msgstr "" -#: elf32-sh64.c:526 +#: elf32-sh64.c:544 msgid "PTB mismatch: a SHmedia address (bit 0 == 1)" msgstr "" -#: elf32-sh64.c:529 +#: elf32-sh64.c:547 msgid "PTA mismatch: a SHcompact address (bit 0 == 0)" msgstr "" -#: elf32-sh64.c:547 +#: elf32-sh64.c:565 #, c-format msgid "%s: GAS error: unexpected PTB insn with R_SH_PT_16" msgstr "" -#: elf32-sh64.c:596 elf64-sh64.c:1703 +#: elf32-sh64.c:614 elf64-sh64.c:1748 #, c-format msgid "%s: error: unaligned relocation type %d at %08x reloc %08x\n" msgstr "" -#: elf32-sh64.c:680 +#: elf32-sh64.c:698 #, c-format msgid "%s: could not write out added .cranges entries" msgstr "" -#: elf32-sh64.c:742 +#: elf32-sh64.c:760 #, c-format msgid "%s: could not write out sorted .cranges entries" msgstr "" -#: elf32-sparc.c:1536 elf64-sparc.c:2224 +#: elf32-sh.c:2103 +#, c-format +msgid "%s: 0x%lx: warning: bad R_SH_USES offset" +msgstr "" + +#: elf32-sh.c:2115 +#, c-format +msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" +msgstr "" + +#: elf32-sh.c:2132 +#, c-format +msgid "%s: 0x%lx: warning: bad R_SH_USES load offset" +msgstr "" + +#: elf32-sh.c:2147 +#, c-format +msgid "%s: 0x%lx: warning: could not find expected reloc" +msgstr "" + +#: elf32-sh.c:2175 +#, c-format +msgid "%s: 0x%lx: warning: symbol in unexpected section" +msgstr "" + +#: elf32-sh.c:2300 +#, c-format +msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" +msgstr "" + +#: elf32-sh.c:2309 +#, c-format +msgid "%s: 0x%lx: warning: bad count" +msgstr "" + +#: elf32-sh.c:2712 elf32-sh.c:3088 +#, c-format +msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" +msgstr "" + +#: elf32-sh.c:4654 elf64-sh64.c:1585 +msgid "Unexpected STO_SH5_ISA32 on local symbol is not handled" +msgstr "" + +#: elf32-sh.c:4809 +#, c-format +msgid "%s: unresolvable relocation against symbol `%s' from %s section" +msgstr "" + +#: elf32-sh.c:4881 +#, c-format +msgid "%s: 0x%lx: fatal: unaligned branch target for relax-support relocation" +msgstr "" + +#: elf32-sh.c:6627 elf64-alpha.c:4848 +#, c-format +msgid "%s: TLS local exec code cannot be linked into shared objects" +msgstr "" + +#: elf32-sparc.c:2521 elf64-sparc.c:2314 #, c-format msgid "%s: probably compiled without -fPIC?" msgstr "" -#: elf32-sparc.c:2010 +#: elf32-sparc.c:3348 #, c-format msgid "%s: compiled for a 64 bit system and target is 32 bit" msgstr "" -#: elf32-sparc.c:2024 +#: elf32-sparc.c:3362 #, c-format msgid "%s: linking little endian files with big endian files" msgstr "" -#: elf32-v850.c:682 +#: elf32-v850.c:753 #, c-format msgid "Variable `%s' cannot occupy in multiple small data regions" msgstr "" -#: elf32-v850.c:685 +#: elf32-v850.c:756 #, c-format msgid "" "Variable `%s' can only be in one of the small, zero, and tiny data regions" msgstr "" -#: elf32-v850.c:688 +#: elf32-v850.c:759 #, c-format msgid "" "Variable `%s' cannot be in both small and zero data regions simultaneously" msgstr "" -#: elf32-v850.c:691 +#: elf32-v850.c:762 #, c-format msgid "" "Variable `%s' cannot be in both small and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:694 +#: elf32-v850.c:765 #, c-format msgid "" "Variable `%s' cannot be in both zero and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:1072 +#: elf32-v850.c:1144 msgid "FAILED to find previous HI16 reloc\n" msgstr "" -#: elf32-v850.c:1703 +#: elf32-v850.c:1789 msgid "could not locate special linker symbol __gp" msgstr "" -#: elf32-v850.c:1707 +#: elf32-v850.c:1793 msgid "could not locate special linker symbol __ep" msgstr "" -#: elf32-v850.c:1711 +#: elf32-v850.c:1797 msgid "could not locate special linker symbol __ctbp" msgstr "" -#: elf32-v850.c:1875 +#: elf32-v850.c:1963 #, c-format msgid "%s: Architecture mismatch with previous modules" msgstr "" -#: elf32-v850.c:1895 +#: elf32-v850.c:1983 #, c-format msgid "private flags = %lx: " msgstr "" -#: elf32-v850.c:1900 +#: elf32-v850.c:1988 msgid "v850 architecture" msgstr "" -#: elf32-v850.c:1901 +#: elf32-v850.c:1989 msgid "v850e architecture" msgstr "" -#: elf32-v850.c:1902 -msgid "v850ea architecture" -msgstr "" - -#: elf32-vax.c:551 +#: elf32-vax.c:549 msgid " [nonpic]" msgstr "" -#: elf32-vax.c:554 +#: elf32-vax.c:552 msgid " [d-float]" msgstr "" -#: elf32-vax.c:557 +#: elf32-vax.c:555 msgid " [g-float]" msgstr "" -#: elf32-vax.c:665 +#: elf32-vax.c:663 #, c-format msgid "" "%s: warning: GOT addend of %ld to `%s' does not match previous GOT addend of " "%ld" msgstr "" -#: elf32-vax.c:1687 +#: elf32-vax.c:1667 #, c-format msgid "%s: warning: PLT addend of %d to `%s' from %s section ignored" msgstr "" -#: elf32-vax.c:1822 +#: elf32-vax.c:1802 #, c-format msgid "%s: warning: %s relocation against symbol `%s' from %s section" msgstr "" -#: elf32-vax.c:1828 +#: elf32-vax.c:1808 #, c-format msgid "%s: warning: %s relocation to 0x%x from %s section" msgstr "" -#: elf32-xstormy16.c:414 elf32-ia64.c:2286 elf64-ia64.c:2286 +#: elf32-ia64.c:2326 elf32-xstormy16.c:462 elf64-ia64.c:2326 msgid "non-zero addend in @fptr reloc" msgstr "" -#: elf64-alpha.c:1097 +#: elf64-alpha.c:1108 msgid "GPDISP relocation did not find ldah and lda instructions" msgstr "" -#: elf64-alpha.c:3676 +#: elf64-alpha.c:3731 #, c-format msgid "%s: .got subsegment exceeds 64K (size %d)" msgstr "" -#: elf64-alpha.c:4499 elf64-alpha.c:4511 +#: elf64-alpha.c:4602 elf64-alpha.c:4614 #, c-format msgid "%s: gp-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-alpha.c:4537 elf64-alpha.c:4677 +#: elf64-alpha.c:4640 elf64-alpha.c:4773 #, c-format msgid "%s: pc-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-alpha.c:4565 +#: elf64-alpha.c:4668 #, c-format msgid "%s: change in gp: BRSGP %s" msgstr "" -#: elf64-alpha.c:4590 +#: elf64-alpha.c:4693 msgid "" msgstr "" -#: elf64-alpha.c:4595 +#: elf64-alpha.c:4698 #, c-format msgid "%s: !samegp reloc against symbol without .prologue: %s" msgstr "" -#: elf64-alpha.c:4640 +#: elf64-alpha.c:4749 #, c-format msgid "%s: unhandled dynamic relocation against %s" msgstr "" -#: elf64-alpha.c:4753 +#: elf64-alpha.c:4832 #, c-format msgid "%s: dtp-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-alpha.c:4769 -#, c-format -msgid "%s: TLS local exec code cannot be linked into shared objects" -msgstr "" - -#: elf64-alpha.c:4776 +#: elf64-alpha.c:4855 #, c-format msgid "%s: tp-relative relocation against dynamic symbol %s" msgstr "" -#: elf64-hppa.c:2080 +#: elf64-hppa.c:2086 #, c-format msgid "stub entry for %s cannot load .plt, dp offset = %ld" msgstr "" -#: elf64-mmix.c:1002 +#: elf64-mmix.c:1032 #, c-format msgid "" "%s: Internal inconsistency error for value for\n" @@ -1387,704 +1495,842 @@ msgid "" "08lx\n" msgstr "" -#: elf64-mmix.c:1386 +#: elf64-mmix.c:1416 #, c-format msgid "" "%s: base-plus-offset relocation against register symbol: (unknown) in %s" msgstr "" -#: elf64-mmix.c:1391 +#: elf64-mmix.c:1421 #, c-format msgid "%s: base-plus-offset relocation against register symbol: %s in %s" msgstr "" -#: elf64-mmix.c:1435 +#: elf64-mmix.c:1465 #, c-format msgid "%s: register relocation against non-register symbol: (unknown) in %s" msgstr "" -#: elf64-mmix.c:1440 +#: elf64-mmix.c:1470 #, c-format msgid "%s: register relocation against non-register symbol: %s in %s" msgstr "" -#: elf64-mmix.c:1477 +#: elf64-mmix.c:1507 #, c-format msgid "%s: directive LOCAL valid only with a register or absolute value" msgstr "" -#: elf64-mmix.c:1505 +#: elf64-mmix.c:1535 #, c-format msgid "" "%s: LOCAL directive: Register $%ld is not a local register. First global " "register is $%ld." msgstr "" -#: elf64-mmix.c:1965 +#: elf64-mmix.c:1994 #, c-format msgid "" "%s: Error: multiple definition of `%s'; start of %s is set in a earlier " "linked file\n" msgstr "" -#: elf64-mmix.c:2024 +#: elf64-mmix.c:2053 msgid "Register section has contents\n" msgstr "" -#: elf64-mmix.c:2186 +#: elf64-mmix.c:2216 #, c-format msgid "" "Internal inconsistency: remaining %u != max %u.\n" " Please report this bug." msgstr "" -#: elf64-ppc.c:1669 libbfd.c:1435 +#: elf64-ppc.c:2388 libbfd.c:831 #, c-format msgid "%s: compiled for a big endian system and target is little endian" msgstr "" -#: elf64-ppc.c:1671 libbfd.c:1437 +#: elf64-ppc.c:2391 libbfd.c:833 #, c-format msgid "%s: compiled for a little endian system and target is big endian" msgstr "" -#: elf64-ppc.c:3614 +#: elf64-ppc.c:4857 #, c-format msgid "%s: unexpected reloc type %u in .opd section" msgstr "" -#: elf64-ppc.c:3634 +#: elf64-ppc.c:4877 #, c-format msgid "%s: .opd is not a regular array of opd entries" msgstr "" -#: elf64-ppc.c:3676 +#: elf64-ppc.c:4897 #, c-format msgid "%s: undefined sym `%s' in .opd section" msgstr "" -#: elf64-ppc.c:4421 +#: elf64-ppc.c:6136 #, c-format msgid "can't find branch stub `%s'" msgstr "" -#: elf64-ppc.c:4460 elf64-ppc.c:4504 +#: elf64-ppc.c:6175 elf64-ppc.c:6250 #, c-format msgid "linkage table error against `%s'" msgstr "" -#: elf64-ppc.c:4576 +#: elf64-ppc.c:6340 #, c-format msgid "can't build branch stub `%s'" msgstr "" -#: elf64-ppc.c:5202 +#: elf64-ppc.c:7047 +msgid ".glink and .plt too far apart" +msgstr "" + +#: elf64-ppc.c:7135 msgid "stubs don't match calculated size" msgstr "" -#: elf64-ppc.c:5851 +#: elf64-ppc.c:7147 +#, c-format +msgid "" +"linker stubs in %u groups\n" +" branch %lu\n" +" toc adjust %lu\n" +" long branch %lu\n" +" long toc adj %lu\n" +" plt call %lu" +msgstr "" + +#: elf64-ppc.c:7723 +#, c-format +msgid "" +"%s(%s+0x%lx): automatic multiple TOCs not supported using your crt files; " +"recompile with -mminimal-toc or upgrade gcc" +msgstr "" + +#: elf64-ppc.c:7731 +#, c-format +msgid "" +"%s(%s+0x%lx): sibling call optimization to `%s' does not allow automatic " +"multiple TOCs; recompile with -mminimal-toc or -fno-optimize-sibling-calls, " +"or make `%s' extern" +msgstr "" + +#: elf64-ppc.c:8329 +#, c-format +msgid "%s: relocation %s is not supported for symbol %s." +msgstr "" + +#: elf64-ppc.c:8408 #, c-format -msgid "%s: Relocation %s is not supported for symbol %s." +msgid "%s: error: relocation %s not a multiple of %d" msgstr "" -#: elf64-ppc.c:5895 +#: elf-hppa.h:1458 elf-hppa.h:1491 elf-m10300.c:1628 elf64-sh64.c:1704 #, c-format -msgid "%s: error: relocation %s not a multiple of 4" +msgid "" +"%s: warning: unresolvable relocation against symbol `%s' from %s section" msgstr "" -#: elf64-sparc.c:1280 +#: elf64-sparc.c:1370 #, c-format msgid "%s: check_relocs: unhandled reloc type %d" msgstr "" -#: elf64-sparc.c:1317 +#: elf64-sparc.c:1407 #, c-format msgid "%s: Only registers %%g[2367] can be declared using STT_REGISTER" msgstr "" -#: elf64-sparc.c:1337 +#: elf64-sparc.c:1427 #, c-format msgid "Register %%g%d used incompatibly: %s in %s, previously %s in %s" msgstr "" -#: elf64-sparc.c:1360 +#: elf64-sparc.c:1450 #, c-format msgid "Symbol `%s' has differing types: REGISTER in %s, previously %s in %s" msgstr "" -#: elf64-sparc.c:1406 +#: elf64-sparc.c:1496 #, c-format msgid "Symbol `%s' has differing types: %s in %s, previously REGISTER in %s" msgstr "" -#: elf64-sparc.c:2971 +#: elf64-sparc.c:3053 #, c-format msgid "%s: linking UltraSPARC specific with HAL specific code" msgstr "" -#: elfcode.h:1198 +#: elf64-x86-64.c:739 +#, c-format +msgid "%s: %s' accessed both as normal and thread local symbol" +msgstr "" + +#: elf.c:372 +#, c-format +msgid "%s: invalid string offset %u >= %lu for section `%s'" +msgstr "" + +#: elf.c:624 +#, c-format +msgid "%s: invalid SHT_GROUP entry" +msgstr "" + +#: elf.c:695 +#, c-format +msgid "%s: no group info for section %s" +msgstr "" + +#: elf.c:1055 +msgid "" +"\n" +"Program Header:\n" +msgstr "" + +#: elf.c:1106 +msgid "" +"\n" +"Dynamic Section:\n" +msgstr "" + +#: elf.c:1235 +msgid "" +"\n" +"Version definitions:\n" +msgstr "" + +#: elf.c:1258 +msgid "" +"\n" +"Version References:\n" +msgstr "" + +#: elf.c:1263 +#, c-format +msgid " required from %s:\n" +msgstr "" + +#: elf.c:1944 +#, c-format +msgid "%s: invalid link %lu for reloc section %s (index %u)" +msgstr "" + +#: elf.c:3686 +#, c-format +msgid "%s: Not enough room for program headers (allocated %u, need %u)" +msgstr "" + +#: elf.c:3791 +#, c-format +msgid "%s: Not enough room for program headers, try linking with -N" +msgstr "" + +#: elf.c:3922 +#, c-format +msgid "" +"Error: First section in segment (%s) starts at 0x%x whereas the segment " +"starts at 0x%x" +msgstr "" + +#: elf.c:4242 +#, c-format +msgid "%s: warning: allocated section `%s' not in segment" +msgstr "" + +#: elf.c:4566 +#, c-format +msgid "%s: symbol `%s' required but not present" +msgstr "" + +#: elf.c:4854 +#, c-format +msgid "%s: warning: Empty loadable segment detected, is this intentional ?\n" +msgstr "" + +#: elf.c:5485 +#, c-format +msgid "" +"Unable to find equivalent output section for symbol '%s' from section '%s'" +msgstr "" + +#: elf.c:6298 +#, c-format +msgid "%s: unsupported relocation type %s" +msgstr "" + +#: elfcode.h:1113 #, c-format msgid "%s: version count (%ld) does not match symbol count (%ld)" msgstr "" -#: elfcode.h:1433 +#: elfcode.h:1342 #, c-format msgid "%s(%s): relocation %d has invalid symbol index %ld" msgstr "" -#: elflink.c:536 +#: elflink.c:1456 #, c-format -msgid "%s: Section %s is too large to add hole of %ld bytes" +msgid "%s: warning: unexpected redefinition of indirect versioned symbol `%s'" msgstr "" -#: elflink.h:1098 +#: elflink.c:1807 #, c-format -msgid "%s: warning: unexpected redefinition of indirect versioned symbol `%s'" +msgid "%s: undefined versioned symbol name %s" msgstr "" -#: elflink.h:1745 +#: elflink.c:2142 #, c-format -msgid "%s: %s: invalid version %u (max %d)" +msgid "%s: relocation size mismatch in %s section %s" msgstr "" -#: elflink.h:1786 +#: elflink.c:2434 #, c-format -msgid "%s: %s: invalid needed version %d" +msgid "warning: type and size of dynamic symbol `%s' are not defined" msgstr "" -#: elflink.h:1908 +#: elflink.h:1022 #, c-format -msgid "Warning: size of symbol `%s' changed from %lu to %lu in %s" +msgid "%s: %s: invalid version %u (max %d)" msgstr "" -#: elflink.h:3116 +#: elflink.h:1063 #, c-format -msgid "%s: undefined version: %s" +msgid "%s: %s: invalid needed version %d" msgstr "" -#: elflink.h:3182 +#: elflink.h:1238 #, c-format -msgid "%s: .preinit_array section is not allowed in DSO" +msgid "Warning: alignment %u of symbol `%s' in %s is smaller than %u in %s" msgstr "" -#: elflink.h:4039 +#: elflink.h:1252 #, c-format -msgid "warning: type and size of dynamic symbol `%s' are not defined" +msgid "Warning: size of symbol `%s' changed from %lu in %s to %lu in %s" msgstr "" -#: elflink.h:4354 +#: elflink.h:2160 #, c-format -msgid "%s: undefined versioned symbol name %s" +msgid "%s: undefined version: %s" msgstr "" -#: elflink.h:4595 elflink.h:4603 elflink.h:6494 elflink.h:7569 -msgid "Error: out of memory" +#: elflink.h:2226 +#, c-format +msgid "%s: .preinit_array section is not allowed in DSO" msgstr "" -#: elflink.h:4767 +#: elflink.h:3078 msgid "Not enough memory to sort relocations" msgstr "" -#: elflink.h:5668 elflink.h:5711 +#: elflink.h:3958 elflink.h:4001 #, c-format msgid "%s: could not find output section %s" msgstr "" -#: elflink.h:5674 +#: elflink.h:3964 #, c-format msgid "warning: %s section has zero size" msgstr "" -#: elflink.h:6261 +#: elflink.h:4483 #, c-format -msgid "%s: could not find output section %s for input section %s" +msgid "%s: %s symbol `%s' in %s is referenced by DSO" msgstr "" -#: elflink.h:6472 +#: elflink.h:4564 #, c-format -msgid "%s: relocation size mismatch in %s section %s" +msgid "%s: could not find output section %s for input section %s" msgstr "" -#: elflink.h:6862 +#: elflink.h:4666 #, c-format -msgid "local symbols in discarded section %s" +msgid "%s: %s symbol `%s' isn't defined" msgstr "" -#: elfxx-mips.c:734 +#: elflink.h:5053 elflink.h:5095 +msgid "%T: discarded in section `%s' from %s\n" +msgstr "" + +#: elfxx-mips.c:887 msgid "static procedure (no name)" msgstr "" -#: elfxx-mips.c:1604 +#: elfxx-mips.c:1897 msgid "not enough GOT space for local GOT entries" msgstr "" -#: elfxx-mips.c:2755 +#: elfxx-mips.c:3691 #, c-format msgid "%s: %s+0x%lx: jump to stub routine which is not jal" msgstr "" -#: elfxx-mips.c:4264 +#: elfxx-mips.c:5192 #, c-format msgid "%s: Malformed reloc detected for section %s" msgstr "" -#: elfxx-mips.c:4342 +#: elfxx-mips.c:5266 #, c-format msgid "%s: CALL16 reloc at 0x%lx not against global symbol" msgstr "" -#: elfxx-mips.c:7296 +#: elfxx-mips.c:8693 #, c-format msgid "%s: illegal section name `%s'" msgstr "" -#: elfxx-mips.c:7610 +#: elfxx-mips.c:9027 +#, c-format +msgid "%s: endianness incompatible with that of the selected emulation" +msgstr "" + +#: elfxx-mips.c:9039 #, c-format -msgid "%s: linking PIC files with non-PIC files" +msgid "%s: ABI is incompatible with that of the selected emulation" msgstr "" -#: elfxx-mips.c:7620 +#: elfxx-mips.c:9106 #, c-format -msgid "%s: linking abicalls files with non-abicalls files" +msgid "%s: warning: linking PIC files with non-PIC files" msgstr "" -#: elfxx-mips.c:7649 +#: elfxx-mips.c:9123 #, c-format -msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" +msgid "%s: linking 32-bit code with 64-bit code" msgstr "" -#: elfxx-mips.c:7671 +#: elfxx-mips.c:9151 #, c-format -msgid "%s: ISA mismatch (%d) with previous modules (%d)" +msgid "%s: linking %s module with previous %s modules" msgstr "" -#: elfxx-mips.c:7694 +#: elfxx-mips.c:9174 #, c-format msgid "%s: ABI mismatch: linking %s module with previous %s modules" msgstr "" -#: elfxx-mips.c:7763 +#: elfxx-mips.c:9243 msgid " [abi=O32]" msgstr "" -#: elfxx-mips.c:7765 +#: elfxx-mips.c:9245 msgid " [abi=O64]" msgstr "" -#: elfxx-mips.c:7767 +#: elfxx-mips.c:9247 msgid " [abi=EABI32]" msgstr "" -#: elfxx-mips.c:7769 +#: elfxx-mips.c:9249 msgid " [abi=EABI64]" msgstr "" -#: elfxx-mips.c:7771 +#: elfxx-mips.c:9251 msgid " [abi unknown]" msgstr "" -#: elfxx-mips.c:7773 +#: elfxx-mips.c:9253 msgid " [abi=N32]" msgstr "" -#: elfxx-mips.c:7775 +#: elfxx-mips.c:9255 msgid " [abi=64]" msgstr "" -#: elfxx-mips.c:7777 +#: elfxx-mips.c:9257 msgid " [no abi set]" msgstr "" -#: elfxx-mips.c:7780 +#: elfxx-mips.c:9260 msgid " [mips1]" msgstr "" -#: elfxx-mips.c:7782 +#: elfxx-mips.c:9262 msgid " [mips2]" msgstr "" -#: elfxx-mips.c:7784 +#: elfxx-mips.c:9264 msgid " [mips3]" msgstr "" -#: elfxx-mips.c:7786 +#: elfxx-mips.c:9266 msgid " [mips4]" msgstr "" -#: elfxx-mips.c:7788 +#: elfxx-mips.c:9268 msgid " [mips5]" msgstr "" -#: elfxx-mips.c:7790 +#: elfxx-mips.c:9270 msgid " [mips32]" msgstr "" -#: elfxx-mips.c:7792 +#: elfxx-mips.c:9272 msgid " [mips64]" msgstr "" -#: elfxx-mips.c:7794 +#: elfxx-mips.c:9274 +msgid " [mips32r2]" +msgstr "" + +#: elfxx-mips.c:9276 msgid " [unknown ISA]" msgstr "" -#: elfxx-mips.c:7797 +#: elfxx-mips.c:9279 msgid " [mdmx]" msgstr "" -#: elfxx-mips.c:7800 +#: elfxx-mips.c:9282 msgid " [mips16]" msgstr "" -#: elfxx-mips.c:7803 +#: elfxx-mips.c:9285 msgid " [32bitmode]" msgstr "" -#: elfxx-mips.c:7805 +#: elfxx-mips.c:9287 msgid " [not 32bitmode]" msgstr "" -#: i386linux.c:458 m68klinux.c:462 sparclinux.c:459 +#: i386linux.c:457 m68klinux.c:461 sparclinux.c:458 #, c-format msgid "Output file requires shared library `%s'\n" msgstr "" -#: i386linux.c:466 m68klinux.c:470 sparclinux.c:467 +#: i386linux.c:465 m68klinux.c:469 sparclinux.c:466 #, c-format msgid "Output file requires shared library `%s.so.%s'\n" msgstr "" -#: i386linux.c:655 i386linux.c:705 m68klinux.c:662 m68klinux.c:710 -#: sparclinux.c:657 sparclinux.c:707 +#: i386linux.c:654 i386linux.c:704 m68klinux.c:661 m68klinux.c:709 +#: sparclinux.c:656 sparclinux.c:706 #, c-format msgid "Symbol %s not defined for fixups\n" msgstr "" -#: i386linux.c:729 m68klinux.c:734 sparclinux.c:731 +#: i386linux.c:728 m68klinux.c:733 sparclinux.c:730 msgid "Warning: fixup count mismatch\n" msgstr "" -#: ieee.c:235 +#: ieee.c:293 #, c-format msgid "%s: string too long (%d chars, max 65535)" msgstr "" -#: ieee.c:365 +#: ieee.c:428 #, c-format msgid "%s: unrecognized symbol `%s' flags 0x%x" msgstr "" -#: ieee.c:877 +#: ieee.c:938 #, c-format msgid "%s: unimplemented ATI record %u for symbol %u" msgstr "" -#: ieee.c:902 +#: ieee.c:963 #, c-format msgid "%s: unexpected ATN type %d in external part" msgstr "" -#: ieee.c:924 +#: ieee.c:985 #, c-format msgid "%s: unexpected type after ATN" msgstr "" -#: ihex.c:255 +#: ihex.c:264 #, c-format msgid "%s:%d: unexpected character `%s' in Intel Hex file\n" msgstr "" -#: ihex.c:363 +#: ihex.c:372 #, c-format msgid "%s:%u: bad checksum in Intel Hex file (expected %u, found %u)" msgstr "" -#: ihex.c:417 +#: ihex.c:426 #, c-format msgid "%s:%u: bad extended address record length in Intel Hex file" msgstr "" -#: ihex.c:434 +#: ihex.c:443 #, c-format msgid "%s:%u: bad extended start address length in Intel Hex file" msgstr "" -#: ihex.c:451 +#: ihex.c:460 #, c-format msgid "%s:%u: bad extended linear address record length in Intel Hex file" msgstr "" -#: ihex.c:468 +#: ihex.c:477 #, c-format msgid "%s:%u: bad extended linear start address length in Intel Hex file" msgstr "" -#: ihex.c:485 +#: ihex.c:494 #, c-format msgid "%s:%u: unrecognized ihex type %u in Intel Hex file\n" msgstr "" -#: ihex.c:610 +#: ihex.c:619 #, c-format msgid "%s: internal error in ihex_read_section" msgstr "" -#: ihex.c:645 +#: ihex.c:654 #, c-format msgid "%s: bad section length in ihex_read_section" msgstr "" -#: ihex.c:863 +#: ihex.c:872 #, c-format msgid "%s: address 0x%s out of range for Intel Hex file" msgstr "" -#: libbfd.c:492 -#, c-format -msgid "not mapping: data=%lx mapped=%d\n" -msgstr "" - -#: libbfd.c:495 -msgid "not mapping: env var not set\n" -msgstr "" - -#: libbfd.c:1466 +#: libbfd.c:861 #, c-format msgid "Deprecated %s called at %s line %d in %s\n" msgstr "" -#: libbfd.c:1469 +#: libbfd.c:864 #, c-format msgid "Deprecated %s called\n" msgstr "" -#: linker.c:1875 +#: linker.c:1829 #, c-format msgid "%s: indirect symbol `%s' to `%s' is a loop" msgstr "" -#: linker.c:2778 +#: linker.c:2697 #, c-format -msgid "Attempt to do relocateable link with %s input and %s output" +msgid "Attempt to do relocatable link with %s input and %s output" msgstr "" -#: merge.c:892 +#: merge.c:896 #, c-format msgid "%s: access beyond end of merged section (%ld + %ld)" msgstr "" -#: mmo.c:460 +#: mmo.c:503 #, c-format msgid "%s: No core to allocate section name %s\n" msgstr "" -#: mmo.c:536 +#: mmo.c:579 #, c-format msgid "%s: No core to allocate a symbol %d bytes long\n" msgstr "" -#: mmo.c:1245 +#: mmo.c:1287 #, c-format msgid "%s: invalid mmo file: initialization value for $255 is not `Main'\n" msgstr "" -#: mmo.c:1391 +#: mmo.c:1433 #, c-format msgid "" "%s: unsupported wide character sequence 0x%02X 0x%02X after symbol name " "starting with `%s'\n" msgstr "" -#: mmo.c:1633 +#: mmo.c:1674 #, c-format msgid "%s: invalid mmo file: unsupported lopcode `%d'\n" msgstr "" -#: mmo.c:1643 +#: mmo.c:1684 #, c-format msgid "%s: invalid mmo file: expected YZ = 1 got YZ = %d for lop_quote\n" msgstr "" -#: mmo.c:1679 +#: mmo.c:1720 #, c-format msgid "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_loc\n" msgstr "" -#: mmo.c:1725 +#: mmo.c:1766 #, c-format msgid "" "%s: invalid mmo file: expected z = 1 or z = 2, got z = %d for lop_fixo\n" msgstr "" -#: mmo.c:1764 +#: mmo.c:1805 #, c-format msgid "%s: invalid mmo file: expected y = 0, got y = %d for lop_fixrx\n" msgstr "" -#: mmo.c:1773 +#: mmo.c:1814 #, c-format msgid "" "%s: invalid mmo file: expected z = 16 or z = 24, got z = %d for lop_fixrx\n" msgstr "" -#: mmo.c:1796 +#: mmo.c:1837 #, c-format msgid "" "%s: invalid mmo file: leading byte of operand word must be 0 or 1, got %d " "for lop_fixrx\n" msgstr "" -#: mmo.c:1819 +#: mmo.c:1860 #, c-format msgid "%s: cannot allocate file name for file number %d, %d bytes\n" msgstr "" -#: mmo.c:1839 +#: mmo.c:1880 #, c-format msgid "" "%s: invalid mmo file: file number %d `%s', was already entered as `%s'\n" msgstr "" -#: mmo.c:1852 +#: mmo.c:1893 #, c-format msgid "" "%s: invalid mmo file: file name for number %d was not specified before use\n" msgstr "" -#: mmo.c:1958 +#: mmo.c:1999 #, c-format msgid "" "%s: invalid mmo file: fields y and z of lop_stab non-zero, y: %d, z: %d\n" msgstr "" -#: mmo.c:1994 +#: mmo.c:2035 #, c-format msgid "%s: invalid mmo file: lop_end not last item in file\n" msgstr "" -#: mmo.c:2007 +#: mmo.c:2048 #, c-format msgid "" "%s: invalid mmo file: YZ of lop_end (%ld) not equal to the number of tetras " "to the preceding lop_stab (%ld)\n" msgstr "" -#: mmo.c:2670 +#: mmo.c:2698 #, c-format msgid "%s: invalid symbol table: duplicate symbol `%s'\n" msgstr "" -#: mmo.c:2921 +#: mmo.c:2949 #, c-format msgid "" "%s: Bad symbol definition: `Main' set to %s rather than the start address %" "s\n" msgstr "" -#: mmo.c:3011 +#: mmo.c:3039 #, c-format msgid "" "%s: warning: symbol table too large for mmo, larger than 65535 32-bit words: " "%d. Only `Main' will be emitted.\n" msgstr "" -#: mmo.c:3056 +#: mmo.c:3084 #, c-format msgid "%s: internal error, symbol table changed size from %d to %d words\n" msgstr "" -#: mmo.c:3111 +#: mmo.c:3139 #, c-format msgid "%s: internal error, internal register section %s had contents\n" msgstr "" -#: mmo.c:3163 +#: mmo.c:3191 #, c-format msgid "%s: no initialized registers; section length 0\n" msgstr "" -#: mmo.c:3169 +#: mmo.c:3197 #, c-format msgid "%s: too many initialized registers; section length %ld\n" msgstr "" -#: mmo.c:3174 +#: mmo.c:3202 #, c-format msgid "" "%s: invalid start address for initialized registers of length %ld: 0x%lx%" "08lx\n" msgstr "" -#: oasys.c:1029 +#: oasys.c:1052 #, c-format msgid "%s: can not represent section `%s' in oasys" msgstr "" -#: osf-core.c:132 +#: osf-core.c:137 #, c-format msgid "Unhandled OSF/1 core file section type %d\n" msgstr "" -#: pe-mips.c:658 +#. XXX code yet to be written. +#: peicode.h:787 #, c-format -msgid "%s: `ld -r' not supported with PE MIPS objects\n" +msgid "%s: Unhandled import type; %x" msgstr "" -#. OK, at this point the following variables are set up: -#. src = VMA of the memory we're fixing up -#. mem = pointer to memory we're fixing up -#. val = VMA of what we need to refer to -#. -#: pe-mips.c:794 +#: peicode.h:792 #, c-format -msgid "%s: unimplemented %s\n" +msgid "%s: Unrecognised import type; %x" msgstr "" -#: pe-mips.c:820 +#: peicode.h:806 #, c-format -msgid "%s: jump too far away\n" +msgid "%s: Unrecognised import name type; %x" msgstr "" -#: pe-mips.c:847 +#: peicode.h:1164 #, c-format -msgid "%s: bad pair/reflo after refhi\n" +msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive" msgstr "" -#. XXX code yet to be written. -#: peicode.h:785 +#: peicode.h:1176 #, c-format -msgid "%s: Unhandled import type; %x" +msgid "" +"%s: Recognised but unhandled machine type (0x%x) in Import Library Format " +"archive" msgstr "" -#: peicode.h:790 +#: peicode.h:1193 #, c-format -msgid "%s: Unrecognised import type; %x" +msgid "%s: size field is zero in Import Library Format header" msgstr "" -#: peicode.h:804 +#: peicode.h:1224 #, c-format -msgid "%s: Unrecognised import name type; %x" +msgid "%s: string not null terminated in ILF object file." msgstr "" -#: peicode.h:1162 +#: pe-mips.c:659 #, c-format -msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive" +msgid "%s: `ld -r' not supported with PE MIPS objects\n" msgstr "" -#: peicode.h:1174 +#. 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:795 #, c-format -msgid "" -"%s: Recognised but unhandled machine type (0x%x) in Import Library Format " -"archive" +msgid "%s: unimplemented %s\n" msgstr "" -#: peicode.h:1191 +#: pe-mips.c:821 #, c-format -msgid "%s: size field is zero in Import Library Format header" +msgid "%s: jump too far away\n" msgstr "" -#: peicode.h:1222 +#: pe-mips.c:848 #, c-format -msgid "%s: string not null terminated in ILF object file." +msgid "%s: bad pair/reflo after refhi\n" msgstr "" #: ppcboot.c:416 @@ -2135,7 +2381,7 @@ msgstr "" msgid "Partition[%d] length = 0x%.8lx (%ld)\n" msgstr "" -#: som.c:5398 +#: som.c:5422 msgid "som_sizeof_headers unimplemented" msgstr "" @@ -2149,7 +2395,7 @@ msgstr "" msgid "%s(%s+0x%lx): Stabs entry has invalid string index." msgstr "" -#: syms.c:1044 +#: syms.c:1019 msgid "Unsupported .stab relocation" msgstr "" @@ -2168,12 +2414,12 @@ msgstr "" msgid "Size mismatch section %s=%lx, %s=%lx" msgstr "" -#: vms-gsd.c:702 +#: vms-gsd.c:704 #, c-format msgid "unknown gsd/egsd subtype %d" msgstr "" -#: vms-hdr.c:406 +#: vms-hdr.c:408 msgid "Object module NOT error-free !\n" msgstr "" @@ -2199,31 +2445,31 @@ msgstr "" msgid "Symbol %s replaced by %s\n" msgstr "" -#: vms-misc.c:1116 +#: vms-misc.c:1117 #, c-format msgid "failed to enter %s" msgstr "" -#: vms-tir.c:81 +#: vms-tir.c:102 msgid "No Mem !" msgstr "" -#: vms-tir.c:362 +#: vms-tir.c:383 #, c-format msgid "bad section index in %s" msgstr "" -#: vms-tir.c:375 +#: vms-tir.c:396 #, c-format msgid "unsupported STA cmd %s" msgstr "" -#: vms-tir.c:380 vms-tir.c:1240 +#: vms-tir.c:401 vms-tir.c:1261 #, c-format msgid "reserved STA cmd %d" msgstr "" -#: vms-tir.c:491 vms-tir.c:514 +#: vms-tir.c:512 vms-tir.c:535 #, c-format msgid "%s: no symbol \"%s\"" msgstr "" @@ -2232,39 +2478,39 @@ msgstr "" #. rotate #. Redefine symbol to current location. #. Define a literal. -#: vms-tir.c:581 vms-tir.c:693 vms-tir.c:803 vms-tir.c:821 vms-tir.c:829 -#: vms-tir.c:838 vms-tir.c:1563 +#: vms-tir.c:602 vms-tir.c:714 vms-tir.c:824 vms-tir.c:842 vms-tir.c:850 +#: vms-tir.c:859 vms-tir.c:1584 #, c-format msgid "%s: not supported" msgstr "" -#: vms-tir.c:586 vms-tir.c:1418 +#: vms-tir.c:607 vms-tir.c:1439 #, c-format msgid "%s: not implemented" msgstr "" -#: vms-tir.c:590 vms-tir.c:1422 +#: vms-tir.c:611 vms-tir.c:1443 #, c-format msgid "reserved STO cmd %d" msgstr "" -#: vms-tir.c:708 vms-tir.c:1568 +#: vms-tir.c:729 vms-tir.c:1589 #, c-format msgid "reserved OPR cmd %d" msgstr "" -#: vms-tir.c:776 vms-tir.c:1632 +#: vms-tir.c:797 vms-tir.c:1653 #, c-format msgid "reserved CTL cmd %d" msgstr "" #. stack byte from image #. arg: none. -#: vms-tir.c:1148 +#: vms-tir.c:1169 msgid "stack-from-image not implemented" msgstr "" -#: vms-tir.c:1166 +#: vms-tir.c:1187 msgid "stack-entry-mask not fully implemented" msgstr "" @@ -2275,99 +2521,99 @@ msgstr "" #. #. compare argument descriptor with symbol argument (ARG$V_PASSMECH) #. and stack TRUE (args match) or FALSE (args dont match) value. -#: vms-tir.c:1180 +#: vms-tir.c:1201 msgid "PASSMECH not fully implemented" msgstr "" -#: vms-tir.c:1199 +#: vms-tir.c:1220 msgid "stack-local-symbol not fully implemented" msgstr "" -#: vms-tir.c:1212 +#: vms-tir.c:1233 msgid "stack-literal not fully implemented" msgstr "" -#: vms-tir.c:1233 +#: vms-tir.c:1254 msgid "stack-local-symbol-entry-point-mask not fully implemented" msgstr "" -#: vms-tir.c:1510 vms-tir.c:1522 vms-tir.c:1534 vms-tir.c:1546 vms-tir.c:1611 -#: vms-tir.c:1619 vms-tir.c:1627 +#: vms-tir.c:1531 vms-tir.c:1543 vms-tir.c:1555 vms-tir.c:1567 vms-tir.c:1632 +#: vms-tir.c:1640 vms-tir.c:1648 #, c-format msgid "%s: not fully implemented" msgstr "" -#: vms-tir.c:1684 +#: vms-tir.c:1705 #, c-format msgid "obj code %d not found" msgstr "" -#: vms-tir.c:2019 +#: vms-tir.c:2043 #, c-format msgid "SEC_RELOC with no relocs in section %s" msgstr "" -#: vms-tir.c:2307 +#: vms-tir.c:2331 #, c-format msgid "Unhandled relocation %s" msgstr "" -#: xcofflink.c:1243 +#: xcofflink.c:1244 #, c-format msgid "%s: `%s' has line numbers but no enclosing section" msgstr "" -#: xcofflink.c:1296 +#: xcofflink.c:1297 #, c-format msgid "%s: class %d symbol `%s' has no aux entries" msgstr "" -#: xcofflink.c:1319 +#: xcofflink.c:1320 #, c-format msgid "%s: symbol `%s' has unrecognized csect type %d" msgstr "" -#: xcofflink.c:1331 +#: xcofflink.c:1332 #, c-format msgid "%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d" msgstr "" -#: xcofflink.c:1367 +#: xcofflink.c:1368 #, c-format msgid "%s: XMC_TC0 symbol `%s' is class %d scnlen %d" msgstr "" -#: xcofflink.c:1519 +#: xcofflink.c:1520 #, c-format msgid "%s: csect `%s' not in enclosing section" msgstr "" -#: xcofflink.c:1626 +#: xcofflink.c:1627 #, c-format msgid "%s: misplaced XTY_LD `%s'" msgstr "" -#: xcofflink.c:1957 +#: xcofflink.c:1958 #, c-format msgid "%s: reloc %s:%d not in csect" msgstr "" -#: xcofflink.c:2094 +#: xcofflink.c:2095 #, c-format msgid "%s: XCOFF shared object when not producing XCOFF output" msgstr "" -#: xcofflink.c:2115 +#: xcofflink.c:2116 #, c-format msgid "%s: dynamic object with no .loader section" msgstr "" -#: xcofflink.c:2760 +#: xcofflink.c:2761 #, c-format msgid "%s: no such symbol" msgstr "" -#: xcofflink.c:2893 +#: xcofflink.c:2894 msgid "error: undefined symbol __rtinit" msgstr "" @@ -2376,234 +2622,244 @@ msgstr "" msgid "warning: attempt to export undefined symbol `%s'" msgstr "" -#: xcofflink.c:4449 +#: xcofflink.c:4448 #, c-format msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling" msgstr "" -#: xcofflink.c:5289 xcofflink.c:5758 xcofflink.c:5820 xcofflink.c:6124 +#: xcofflink.c:5288 xcofflink.c:5755 xcofflink.c:5817 xcofflink.c:6119 #, c-format msgid "%s: loader reloc in unrecognized section `%s'" msgstr "" -#: xcofflink.c:5311 xcofflink.c:6135 +#: xcofflink.c:5310 xcofflink.c:6130 #, c-format msgid "%s: `%s' in loader reloc but not loader sym" msgstr "" -#: xcofflink.c:5326 +#: xcofflink.c:5325 #, c-format msgid "%s: loader reloc in read-only section %s" msgstr "" -#: elf32-ia64.c:2228 elf64-ia64.c:2228 +#: elf32-ia64.c:2271 elf64-ia64.c:2271 msgid "@pltoff reloc against local symbol" msgstr "" -#: elf32-ia64.c:3568 elf64-ia64.c:3568 +#: elf32-ia64.c:3663 elf64-ia64.c:3663 #, c-format msgid "%s: short data segment overflowed (0x%lx >= 0x400000)" msgstr "" -#: elf32-ia64.c:3579 elf64-ia64.c:3579 +#: elf32-ia64.c:3674 elf64-ia64.c:3674 #, c-format msgid "%s: __gp does not cover short data segment" msgstr "" -#: elf32-ia64.c:3864 elf64-ia64.c:3864 +#: elf32-ia64.c:3986 elf64-ia64.c:3986 #, c-format msgid "%s: linking non-pic code in a shared library" msgstr "" -#: elf32-ia64.c:3897 elf64-ia64.c:3897 +#: elf32-ia64.c:4017 elf64-ia64.c:4017 #, c-format msgid "%s: @gprel relocation against dynamic symbol %s" msgstr "" -#: elf32-ia64.c:4036 elf64-ia64.c:4036 +#: elf32-ia64.c:4077 elf64-ia64.c:4077 +#, c-format +msgid "%s: linking non-pic code in a position independent executable" +msgstr "" + +#: elf32-ia64.c:4214 elf64-ia64.c:4214 +#, c-format +msgid "%s: @internal branch to dynamic symbol %s" +msgstr "" + +#: elf32-ia64.c:4216 elf64-ia64.c:4216 #, c-format -msgid "%s: dynamic relocation against speculation fixup" +msgid "%s: speculation fixup to dynamic symbol %s" msgstr "" -#: elf32-ia64.c:4044 elf64-ia64.c:4044 +#: elf32-ia64.c:4218 elf64-ia64.c:4218 #, c-format -msgid "%s: speculation fixup against undefined weak symbol" +msgid "%s: @pcrel relocation against dynamic symbol %s" msgstr "" -#: elf32-ia64.c:4277 elf64-ia64.c:4277 +#: elf32-ia64.c:4430 elf64-ia64.c:4430 msgid "unsupported reloc" msgstr "" -#: elf32-ia64.c:4557 elf64-ia64.c:4557 +#: elf32-ia64.c:4709 elf64-ia64.c:4709 #, c-format msgid "%s: linking trap-on-NULL-dereference with non-trapping files" msgstr "" -#: elf32-ia64.c:4566 elf64-ia64.c:4566 +#: elf32-ia64.c:4718 elf64-ia64.c:4718 #, c-format msgid "%s: linking big-endian files with little-endian files" msgstr "" -#: elf32-ia64.c:4575 elf64-ia64.c:4575 +#: elf32-ia64.c:4727 elf64-ia64.c:4727 #, c-format msgid "%s: linking 64-bit files with 32-bit files" msgstr "" -#: elf32-ia64.c:4584 elf64-ia64.c:4584 +#: elf32-ia64.c:4736 elf64-ia64.c:4736 #, c-format msgid "%s: linking constant-gp files with non-constant-gp files" msgstr "" -#: elf32-ia64.c:4594 elf64-ia64.c:4594 +#: elf32-ia64.c:4746 elf64-ia64.c:4746 #, c-format msgid "%s: linking auto-pic files with non-auto-pic files" msgstr "" -#: peigen.c:962 pepigen.c:962 +#: peigen.c:985 pepigen.c:985 #, c-format msgid "%s: line number overflow: 0x%lx > 0xffff" msgstr "" -#: peigen.c:979 pepigen.c:979 +#: peigen.c:1002 pepigen.c:1002 #, c-format msgid "%s: reloc overflow 1: 0x%lx > 0xffff" msgstr "" -#: peigen.c:993 pepigen.c:993 +#: peigen.c:1016 pepigen.c:1016 msgid "Export Directory [.edata (or where ever we found it)]" msgstr "" -#: peigen.c:994 pepigen.c:994 +#: peigen.c:1017 pepigen.c:1017 msgid "Import Directory [parts of .idata]" msgstr "" -#: peigen.c:995 pepigen.c:995 +#: peigen.c:1018 pepigen.c:1018 msgid "Resource Directory [.rsrc]" msgstr "" -#: peigen.c:996 pepigen.c:996 +#: peigen.c:1019 pepigen.c:1019 msgid "Exception Directory [.pdata]" msgstr "" -#: peigen.c:997 pepigen.c:997 +#: peigen.c:1020 pepigen.c:1020 msgid "Security Directory" msgstr "" -#: peigen.c:998 pepigen.c:998 +#: peigen.c:1021 pepigen.c:1021 msgid "Base Relocation Directory [.reloc]" msgstr "" -#: peigen.c:999 pepigen.c:999 +#: peigen.c:1022 pepigen.c:1022 msgid "Debug Directory" msgstr "" -#: peigen.c:1000 pepigen.c:1000 +#: peigen.c:1023 pepigen.c:1023 msgid "Description Directory" msgstr "" -#: peigen.c:1001 pepigen.c:1001 +#: peigen.c:1024 pepigen.c:1024 msgid "Special Directory" msgstr "" -#: peigen.c:1002 pepigen.c:1002 +#: peigen.c:1025 pepigen.c:1025 msgid "Thread Storage Directory [.tls]" msgstr "" -#: peigen.c:1003 pepigen.c:1003 +#: peigen.c:1026 pepigen.c:1026 msgid "Load Configuration Directory" msgstr "" -#: peigen.c:1004 pepigen.c:1004 +#: peigen.c:1027 pepigen.c:1027 msgid "Bound Import Directory" msgstr "" -#: peigen.c:1005 pepigen.c:1005 +#: peigen.c:1028 pepigen.c:1028 msgid "Import Address Table Directory" msgstr "" -#: peigen.c:1006 pepigen.c:1006 +#: peigen.c:1029 pepigen.c:1029 msgid "Delay Import Directory" msgstr "" -#: peigen.c:1007 peigen.c:1008 pepigen.c:1007 pepigen.c:1008 +#: peigen.c:1030 peigen.c:1031 pepigen.c:1030 pepigen.c:1031 msgid "Reserved" msgstr "" -#: peigen.c:1071 pepigen.c:1071 +#: peigen.c:1094 pepigen.c:1094 msgid "" "\n" "There is an import table, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1076 pepigen.c:1076 +#: peigen.c:1099 pepigen.c:1099 #, c-format msgid "" "\n" "There is an import table in %s at 0x%lx\n" msgstr "" -#: peigen.c:1113 pepigen.c:1113 +#: peigen.c:1136 pepigen.c:1136 #, c-format msgid "" "\n" "Function descriptor located at the start address: %04lx\n" msgstr "" -#: peigen.c:1116 pepigen.c:1116 +#: peigen.c:1139 pepigen.c:1139 #, c-format msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n" msgstr "" -#: peigen.c:1122 pepigen.c:1122 +#: peigen.c:1145 pepigen.c:1145 msgid "" "\n" "No reldata section! Function descriptor not decoded.\n" msgstr "" -#: peigen.c:1127 pepigen.c:1127 +#: peigen.c:1150 pepigen.c:1150 #, c-format msgid "" "\n" "The Import Tables (interpreted %s section contents)\n" msgstr "" -#: peigen.c:1130 pepigen.c:1130 +#: peigen.c:1153 pepigen.c:1153 msgid "" " vma: Hint Time Forward DLL First\n" " Table Stamp Chain Name Thunk\n" msgstr "" -#: peigen.c:1181 pepigen.c:1181 +#: peigen.c:1204 pepigen.c:1204 #, c-format msgid "" "\n" "\tDLL Name: %s\n" msgstr "" -#: peigen.c:1192 pepigen.c:1192 +#: peigen.c:1215 pepigen.c:1215 msgid "\tvma: Hint/Ord Member-Name Bound-To\n" msgstr "" -#: peigen.c:1217 pepigen.c:1217 +#: peigen.c:1240 pepigen.c:1240 msgid "" "\n" "There is a first thunk, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1357 pepigen.c:1357 +#: peigen.c:1380 pepigen.c:1380 msgid "" "\n" "There is an export table, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1362 pepigen.c:1362 +#: peigen.c:1385 pepigen.c:1385 #, c-format msgid "" "\n" "There is an export table in %s at 0x%lx\n" msgstr "" -#: peigen.c:1393 pepigen.c:1393 +#: peigen.c:1416 pepigen.c:1416 #, c-format msgid "" "\n" @@ -2611,129 +2867,129 @@ msgid "" "\n" msgstr "" -#: peigen.c:1397 pepigen.c:1397 +#: peigen.c:1420 pepigen.c:1420 #, c-format msgid "Export Flags \t\t\t%lx\n" msgstr "" -#: peigen.c:1400 pepigen.c:1400 +#: peigen.c:1423 pepigen.c:1423 #, c-format msgid "Time/Date stamp \t\t%lx\n" msgstr "" -#: peigen.c:1403 pepigen.c:1403 +#: peigen.c:1426 pepigen.c:1426 #, c-format msgid "Major/Minor \t\t\t%d/%d\n" msgstr "" -#: peigen.c:1406 pepigen.c:1406 +#: peigen.c:1429 pepigen.c:1429 msgid "Name \t\t\t\t" msgstr "" -#: peigen.c:1412 pepigen.c:1412 +#: peigen.c:1435 pepigen.c:1435 #, c-format msgid "Ordinal Base \t\t\t%ld\n" msgstr "" -#: peigen.c:1415 pepigen.c:1415 +#: peigen.c:1438 pepigen.c:1438 msgid "Number in:\n" msgstr "" -#: peigen.c:1418 pepigen.c:1418 +#: peigen.c:1441 pepigen.c:1441 #, c-format msgid "\tExport Address Table \t\t%08lx\n" msgstr "" -#: peigen.c:1422 pepigen.c:1422 +#: peigen.c:1445 pepigen.c:1445 #, c-format msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n" msgstr "" -#: peigen.c:1425 pepigen.c:1425 +#: peigen.c:1448 pepigen.c:1448 msgid "Table Addresses\n" msgstr "" -#: peigen.c:1428 pepigen.c:1428 +#: peigen.c:1451 pepigen.c:1451 msgid "\tExport Address Table \t\t" msgstr "" -#: peigen.c:1433 pepigen.c:1433 +#: peigen.c:1456 pepigen.c:1456 msgid "\tName Pointer Table \t\t" msgstr "" -#: peigen.c:1438 pepigen.c:1438 +#: peigen.c:1461 pepigen.c:1461 msgid "\tOrdinal Table \t\t\t" msgstr "" -#: peigen.c:1453 pepigen.c:1453 +#: peigen.c:1476 pepigen.c:1476 #, c-format msgid "" "\n" "Export Address Table -- Ordinal Base %ld\n" msgstr "" -#: peigen.c:1472 pepigen.c:1472 +#: peigen.c:1495 pepigen.c:1495 msgid "Forwarder RVA" msgstr "" -#: peigen.c:1483 pepigen.c:1483 +#: peigen.c:1506 pepigen.c:1506 msgid "Export RVA" msgstr "" -#: peigen.c:1490 pepigen.c:1490 +#: peigen.c:1513 pepigen.c:1513 msgid "" "\n" "[Ordinal/Name Pointer] Table\n" msgstr "" -#: peigen.c:1545 pepigen.c:1545 +#: peigen.c:1568 pepigen.c:1568 #, c-format msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n" msgstr "" -#: peigen.c:1549 pepigen.c:1549 +#: peigen.c:1572 pepigen.c:1572 msgid "" "\n" "The Function Table (interpreted .pdata section contents)\n" msgstr "" -#: peigen.c:1552 pepigen.c:1552 +#: peigen.c:1575 pepigen.c:1575 msgid " vma:\t\t\tBegin Address End Address Unwind Info\n" msgstr "" -#: peigen.c:1554 pepigen.c:1554 +#: peigen.c:1577 pepigen.c:1577 msgid "" " vma:\t\tBegin End EH EH PrologEnd Exception\n" " \t\tAddress Address Handler Data Address Mask\n" msgstr "" -#: peigen.c:1624 pepigen.c:1624 +#: peigen.c:1647 pepigen.c:1647 msgid " Register save millicode" msgstr "" -#: peigen.c:1627 pepigen.c:1627 +#: peigen.c:1650 pepigen.c:1650 msgid " Register restore millicode" msgstr "" -#: peigen.c:1630 pepigen.c:1630 +#: peigen.c:1653 pepigen.c:1653 msgid " Glue code sequence" msgstr "" -#: peigen.c:1682 pepigen.c:1682 +#: peigen.c:1705 pepigen.c:1705 msgid "" "\n" "\n" "PE File Base Relocations (interpreted .reloc section contents)\n" msgstr "" -#: peigen.c:1712 pepigen.c:1712 +#: peigen.c:1735 pepigen.c:1735 #, c-format msgid "" "\n" "Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n" msgstr "" -#: peigen.c:1725 pepigen.c:1725 +#: peigen.c:1748 pepigen.c:1748 #, c-format msgid "\treloc %4d offset %4x [%4lx] %s" msgstr "" @@ -2741,7 +2997,7 @@ msgstr "" #. The MS dumpbin program reportedly ands with 0xff0f before #. printing the characteristics field. Not sure why. No reason to #. emulate it here. -#: peigen.c:1765 pepigen.c:1765 +#: peigen.c:1788 pepigen.c:1788 #, c-format msgid "" "\n" diff --git a/contrib/binutils/bfd/ppcboot.c b/contrib/binutils/bfd/ppcboot.c index 5b153bd..05fb7de 100644 --- a/contrib/binutils/bfd/ppcboot.c +++ b/contrib/binutils/bfd/ppcboot.c @@ -1,5 +1,5 @@ /* BFD back-end for PPCbug boot records. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Michael Meissner, Cygnus Support, @@ -87,27 +87,27 @@ typedef struct ppcboot_data { a start symbol, an end symbol, and an absolute length symbol. */ #define PPCBOOT_SYMS 3 -static boolean ppcboot_mkobject PARAMS ((bfd *)); +static bfd_boolean ppcboot_mkobject PARAMS ((bfd *)); static const bfd_target *ppcboot_object_p PARAMS ((bfd *)); -static boolean ppcboot_set_arch_mach +static bfd_boolean ppcboot_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, unsigned long)); -static boolean ppcboot_get_section_contents +static bfd_boolean ppcboot_get_section_contents PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); static long ppcboot_get_symtab_upper_bound PARAMS ((bfd *)); static char *mangle_name PARAMS ((bfd *, char *)); -static long ppcboot_get_symtab PARAMS ((bfd *, asymbol **)); +static long ppcboot_canonicalize_symtab PARAMS ((bfd *, asymbol **)); static void ppcboot_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); -static boolean ppcboot_set_section_contents - PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); -static int ppcboot_sizeof_headers PARAMS ((bfd *, boolean)); -static boolean ppcboot_bfd_print_private_bfd_data PARAMS ((bfd *, PTR)); +static bfd_boolean ppcboot_set_section_contents + PARAMS ((bfd *, asection *, const PTR, file_ptr, bfd_size_type)); +static int ppcboot_sizeof_headers PARAMS ((bfd *, bfd_boolean)); +static bfd_boolean ppcboot_bfd_print_private_bfd_data PARAMS ((bfd *, PTR)); #define ppcboot_set_tdata(abfd, ptr) ((abfd)->tdata.any = (PTR) (ptr)) #define ppcboot_get_tdata(abfd) ((ppcboot_data_t *) ((abfd)->tdata.any)) /* Create a ppcboot object. Invoked via bfd_set_format. */ -static boolean +static bfd_boolean ppcboot_mkobject (abfd) bfd *abfd; { @@ -117,12 +117,12 @@ ppcboot_mkobject (abfd) ppcboot_set_tdata (abfd, bfd_zalloc (abfd, amt)); } - return true; + return TRUE; } /* Set the architecture to PowerPC */ -static boolean +static bfd_boolean ppcboot_set_arch_mach (abfd, arch, machine) bfd *abfd; enum bfd_architecture arch; @@ -132,7 +132,7 @@ ppcboot_set_arch_mach (abfd, arch, machine) arch = bfd_arch_powerpc; else if (arch != bfd_arch_powerpc) - return false; + return FALSE; return bfd_default_set_arch_mach (abfd, arch, machine); } @@ -229,7 +229,7 @@ ppcboot_object_p (abfd) /* Get contents of the only section. */ -static boolean +static bfd_boolean ppcboot_get_section_contents (abfd, section, location, offset, count) bfd *abfd; asection *section ATTRIBUTE_UNUSED; @@ -239,8 +239,8 @@ ppcboot_get_section_contents (abfd, section, location, offset, count) { if (bfd_seek (abfd, offset + (file_ptr) sizeof (ppcboot_hdr_t), SEEK_SET) != 0 || bfd_bread (location, count, abfd) != count) - return false; - return true; + return FALSE; + return TRUE; } @@ -287,7 +287,7 @@ mangle_name (abfd, suffix) /* Return the symbol table. */ static long -ppcboot_get_symtab (abfd, alocation) +ppcboot_canonicalize_symtab (abfd, alocation) bfd *abfd; asymbol **alocation; { @@ -298,7 +298,7 @@ ppcboot_get_symtab (abfd, alocation) syms = (asymbol *) bfd_alloc (abfd, amt); if (syms == NULL) - return false; + return FALSE; /* Start symbol. */ syms[0].the_bfd = abfd; @@ -360,11 +360,11 @@ ppcboot_get_symbol_info (ignore_abfd, symbol, ret) /* Write section contents of a ppcboot file. */ -static boolean +static bfd_boolean ppcboot_set_section_contents (abfd, sec, data, offset, size) bfd *abfd; asection *sec; - PTR data; + const PTR data; file_ptr offset; bfd_size_type size; { @@ -384,7 +384,7 @@ ppcboot_set_section_contents (abfd, sec, data, offset, size) for (s = abfd->sections; s != NULL; s = s->next) s->filepos = s->vma - low; - abfd->output_has_begun = true; + abfd->output_has_begun = TRUE; } return _bfd_generic_set_section_contents (abfd, sec, data, offset, size); @@ -394,7 +394,7 @@ ppcboot_set_section_contents (abfd, sec, data, offset, size) static int ppcboot_sizeof_headers (abfd, exec) bfd *abfd ATTRIBUTE_UNUSED; - boolean exec ATTRIBUTE_UNUSED; + bfd_boolean exec ATTRIBUTE_UNUSED; { return sizeof (ppcboot_hdr_t); } @@ -402,7 +402,7 @@ ppcboot_sizeof_headers (abfd, exec) /* Print out the program headers. */ -static boolean +static bfd_boolean ppcboot_bfd_print_private_bfd_data (abfd, farg) bfd *abfd; PTR farg; @@ -460,7 +460,7 @@ ppcboot_bfd_print_private_bfd_data (abfd, farg) } fprintf (f, "\n"); - return true; + return TRUE; } diff --git a/contrib/binutils/bfd/ptrace-core.c b/contrib/binutils/bfd/ptrace-core.c index f8db927..15b6777 100644 --- a/contrib/binutils/bfd/ptrace-core.c +++ b/contrib/binutils/bfd/ptrace-core.c @@ -1,5 +1,5 @@ /* BFD backend for core files which use the ptrace_user structure - Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002 + Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. The structure of this file is based on trad-core.c written by John Gilmore of Cygnus Support. @@ -49,13 +49,12 @@ struct trad_core_struct /* forward declarations */ const bfd_target *ptrace_unix_core_file_p PARAMS ((bfd *abfd)); -char * ptrace_unix_core_file_failing_command PARAMS ((bfd *abfd)); -int ptrace_unix_core_file_failing_signal PARAMS ((bfd *abfd)); -boolean ptrace_unix_core_file_matches_executable_p - PARAMS ((bfd *core_bfd, bfd *exec_bfd)); -static void swap_abort PARAMS ((void)); +char * ptrace_unix_core_file_failing_command PARAMS ((bfd *abfd)); +int ptrace_unix_core_file_failing_signal PARAMS ((bfd *abfd)); +bfd_boolean ptrace_unix_core_file_matches_executable_p + PARAMS ((bfd *core_bfd, bfd *exec_bfd)); +static void swap_abort PARAMS ((void)); -/* ARGSUSED */ const bfd_target * ptrace_unix_core_file_p (abfd) bfd *abfd; @@ -146,7 +145,6 @@ ptrace_unix_core_file_failing_command (abfd) return 0; } -/* ARGSUSED */ int ptrace_unix_core_file_failing_signal (abfd) bfd *abfd; @@ -154,14 +152,13 @@ ptrace_unix_core_file_failing_signal (abfd) return abfd->tdata.trad_core_data->u.pt_sigframe.sig_num; } -/* ARGSUSED */ -boolean +bfd_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 the date of the executable */ - return true; + return TRUE; } /* If somebody calls any byte-swapping routines, shoot them. */ @@ -170,10 +167,13 @@ swap_abort () { 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 ) -#define NO_SIGNED_GET \ - ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort ) + +#define NO_GET ((bfd_vma (*) (const void *)) swap_abort) +#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort) +#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort) +#define NO_GET64 ((bfd_uint64_t (*) (const void *)) swap_abort) +#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort) +#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort) const bfd_target ptrace_core_vec = { @@ -188,41 +188,41 @@ const bfd_target ptrace_core_vec = 0, /* symbol prefix */ ' ', /* ar_pad_char */ 16, /* ar_max_namelen */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs */ + NO_GET64, NO_GETS64, NO_PUT64, /* 64 bit data */ + NO_GET, NO_GETS, NO_PUT, /* 32 bit data */ + NO_GET, NO_GETS, NO_PUT, /* 16 bit data */ + NO_GET64, NO_GETS64, NO_PUT64, /* 64 bit hdrs */ + NO_GET, NO_GETS, NO_PUT, /* 32 bit hdrs */ + NO_GET, NO_GETS, NO_PUT, /* 16 bit hdrs */ { /* bfd_check_format */ - _bfd_dummy_target, /* unknown format */ - _bfd_dummy_target, /* object file */ - _bfd_dummy_target, /* archive */ - ptrace_unix_core_file_p /* a core file */ + _bfd_dummy_target, /* unknown format */ + _bfd_dummy_target, /* object file */ + _bfd_dummy_target, /* archive */ + ptrace_unix_core_file_p /* a core file */ }, { /* bfd_set_format */ - bfd_false, bfd_false, - bfd_false, bfd_false + bfd_false, bfd_false, + bfd_false, bfd_false }, { /* bfd_write_contents */ - bfd_false, bfd_false, - bfd_false, bfd_false + 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), - 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 (ptrace_unix), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (_bfd_generic), + BFD_JUMP_TABLE_LINK (_bfd_nolink), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, (PTR) 0 /* backend_data */ -}; + }; #endif /* PTRACE_CORE */ diff --git a/contrib/binutils/bfd/reloc.c b/contrib/binutils/bfd/reloc.c index 01ff516..9bffaa3 100644 --- a/contrib/binutils/bfd/reloc.c +++ b/contrib/binutils/bfd/reloc.c @@ -1,24 +1,24 @@ /* BFD support for handling relocation entries. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Cygnus Support. -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. */ /* SECTION @@ -98,7 +98,7 @@ CODE_FRAGMENT .typedef struct reloc_cache_entry .{ . {* A pointer into the canonical table of pointers. *} -. struct symbol_cache_entry **sym_ptr_ptr; +. struct bfd_symbol **sym_ptr_ptr; . . {* offset in section. *} . bfd_size_type address; @@ -122,15 +122,16 @@ DESCRIPTION o <> The symbol table pointer points to a pointer to the symbol - associated with the relocation request. It is - the pointer into the table returned by the back end's - <> action. @xref{Symbols}. The symbol is referenced - through a pointer to a pointer so that tools like the linker - can fix up all the symbols of the same name by modifying only - one pointer. The relocation routine looks in the symbol and - uses the base of the section the symbol is attached to and the - value of the symbol as the initial relocation offset. If the - symbol pointer is zero, then the section provided is looked up. + associated with the relocation request. It is the pointer + into the table returned by the back end's + <> action. @xref{Symbols}. The symbol is + referenced through a pointer to a pointer so that tools like + the linker can fix up all the symbols of the same name by + modifying only one pointer. The relocation routine looks in + the symbol and uses the base of the section the symbol is + attached to and the value of the symbol as the initial + relocation offset. If the symbol pointer is zero, then the + section provided is looked up. o <
> @@ -277,7 +278,7 @@ SUBSUBSECTION information that libbfd needs to know to tie up a back end's data. CODE_FRAGMENT -.struct symbol_cache_entry; {* Forward declaration. *} +.struct bfd_symbol; {* Forward declaration. *} . .struct reloc_howto_struct .{ @@ -306,7 +307,7 @@ CODE_FRAGMENT . data section of the addend. The relocation function will . subtract from the relocation value the address of the location . being relocated. *} -. boolean pc_relative; +. bfd_boolean pc_relative; . . {* The bit position of the reloc value in the destination. . The relocated value is left shifted by this amount. *} @@ -318,11 +319,11 @@ CODE_FRAGMENT . . {* If this field is non null, then the supplied function is . called rather than the normal function. This allows really -. strange relocation methods to be accomodated (e.g., i960 callj +. strange relocation methods to be accommodated (e.g., i960 callj . instructions). *} . bfd_reloc_status_type (*special_function) -. PARAMS ((bfd *, arelent *, struct symbol_cache_entry *, PTR, asection *, -. bfd *, char **)); +. (bfd *, arelent *, struct bfd_symbol *, void *, asection *, +. bfd *, char **); . . {* The textual name of the relocation type. *} . char *name; @@ -342,21 +343,20 @@ CODE_FRAGMENT . USE_REL targets set this field to TRUE. Why this is so is peculiar . to each particular target. For relocs that aren't used in partial . links (e.g. GOT stuff) it doesn't matter what this is set to. *} -. boolean partial_inplace; +. bfd_boolean partial_inplace; . -. {* The src_mask selects which parts of the read in data -. are to be used in the relocation sum. E.g., if this was an 8 bit -. byte of data which we read and relocated, this would be -. 0x000000ff. When we have relocs which have an addend, such as -. sun4 extended relocs, the value in the offset part of a -. relocating field is garbage so we never use it. In this case -. the mask would be 0x00000000. *} +. {* src_mask selects the part of the instruction (or data) to be used +. in the relocation sum. If the target relocations don't have an +. addend in the reloc, eg. ELF USE_REL, src_mask will normally equal +. dst_mask to extract the addend from the section contents. If +. relocations do have an addend in the reloc, eg. ELF USE_RELA, this +. field should be zero. Non-zero values for ELF USE_RELA targets are +. bogus as in those cases the value in the dst_mask part of the +. section contents should be treated as garbage. *} . bfd_vma src_mask; . -. {* The dst_mask selects which parts of the instruction are replaced -. into the instruction. In most cases src_mask == dst_mask, -. except in the above special case, where dst_mask would be -. 0x000000ff, and src_mask would be 0x00000000. *} +. {* dst_mask selects which parts of the instruction (or data) are +. replaced with a relocated value. *} . bfd_vma dst_mask; . . {* When some formats create PC relative instructions, they leave @@ -365,7 +365,7 @@ CODE_FRAGMENT . be made just by adding in an ordinary offset (e.g., sun3 a.out). . Some formats leave the displacement part of an instruction . empty (e.g., m88k bcs); this flag signals the fact. *} -. boolean pcrel_offset; +. bfd_boolean pcrel_offset; .}; . */ @@ -386,15 +386,15 @@ DESCRIPTION .#define NEWHOWTO(FUNCTION, NAME, SIZE, REL, IN) \ . HOWTO (0, 0, SIZE, 0, REL, 0, complain_overflow_dont, FUNCTION, \ -. NAME, false, 0, 0, IN) +. NAME, FALSE, 0, 0, IN) . DESCRIPTION This is used to fill in an empty howto entry in an array. .#define EMPTY_HOWTO(C) \ -. HOWTO ((C), 0, 0, 0, false, 0, complain_overflow_dont, NULL, \ -. NULL, false, 0, 0, false) +. HOWTO ((C), 0, 0, 0, FALSE, 0, complain_overflow_dont, NULL, \ +. NULL, FALSE, 0, 0, FALSE) . DESCRIPTION @@ -402,7 +402,7 @@ DESCRIPTION .#define HOWTO_PREPARE(relocation, symbol) \ . { \ -. if (symbol != (asymbol *) NULL) \ +. if (symbol != NULL) \ . { \ . if (bfd_is_com_section (symbol->section)) \ . { \ @@ -430,8 +430,7 @@ DESCRIPTION */ unsigned int -bfd_get_reloc_size (howto) - reloc_howto_type *howto; +bfd_get_reloc_size (reloc_howto_type *howto) { switch (howto->size) { @@ -471,13 +470,12 @@ FUNCTION bfd_check_overflow SYNOPSIS - bfd_reloc_status_type - bfd_check_overflow - (enum complain_overflow how, - unsigned int bitsize, - unsigned int rightshift, - unsigned int addrsize, - bfd_vma relocation); + bfd_reloc_status_type bfd_check_overflow + (enum complain_overflow how, + unsigned int bitsize, + unsigned int rightshift, + unsigned int addrsize, + bfd_vma relocation); DESCRIPTION Perform overflow checking on @var{relocation} which has @@ -489,12 +487,11 @@ DESCRIPTION */ bfd_reloc_status_type -bfd_check_overflow (how, bitsize, rightshift, addrsize, relocation) - enum complain_overflow how; - unsigned int bitsize; - unsigned int rightshift; - unsigned int addrsize; - bfd_vma relocation; +bfd_check_overflow (enum complain_overflow how, + unsigned int bitsize, + unsigned int rightshift, + unsigned int addrsize, + bfd_vma relocation) { bfd_vma fieldmask, addrmask, signmask, ss, a; bfd_reloc_status_type flag = bfd_reloc_ok; @@ -554,14 +551,13 @@ FUNCTION bfd_perform_relocation SYNOPSIS - bfd_reloc_status_type - bfd_perform_relocation - (bfd *abfd, - arelent *reloc_entry, - PTR data, - asection *input_section, - bfd *output_bfd, - char **error_message); + bfd_reloc_status_type bfd_perform_relocation + (bfd *abfd, + arelent *reloc_entry, + void *data, + asection *input_section, + bfd *output_bfd, + char **error_message); DESCRIPTION If @var{output_bfd} is supplied to this function, the @@ -582,14 +578,12 @@ DESCRIPTION */ bfd_reloc_status_type -bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, - error_message) - bfd *abfd; - arelent *reloc_entry; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; +bfd_perform_relocation (bfd *abfd, + arelent *reloc_entry, + void *data, + asection *input_section, + bfd *output_bfd, + char **error_message) { bfd_vma relocation; bfd_reloc_status_type flag = bfd_reloc_ok; @@ -601,18 +595,18 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, symbol = *(reloc_entry->sym_ptr_ptr); if (bfd_is_abs_section (symbol->section) - && output_bfd != (bfd *) NULL) + && output_bfd != NULL) { reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; } - /* If we are not producing relocateable output, return an error if + /* If we are not producing relocatable output, return an error if the symbol is not defined. An undefined weak symbol is considered to have a value of zero (SVR4 ABI, p. 4-27). */ if (bfd_is_und_section (symbol->section) && (symbol->flags & BSF_WEAK) == 0 - && output_bfd == (bfd *) NULL) + && output_bfd == NULL) flag = bfd_reloc_undefined; /* If there is a function supplied to handle this relocation type, @@ -633,7 +627,7 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, / bfd_octets_per_byte (abfd))) return bfd_reloc_outofrange; - /* Work out which section the relocation is targetted at and the + /* Work out which section the relocation is targeted at and the initial relocation command value. */ /* Get symbol value. (Common symbols are special.) */ @@ -645,7 +639,8 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, reloc_target_output_section = symbol->section->output_section; /* Convert input-section-relative symbol value to absolute. */ - if (output_bfd && ! howto->partial_inplace) + if ((output_bfd && ! howto->partial_inplace) + || reloc_target_output_section == NULL) output_base = 0; else output_base = reloc_target_output_section->vma; @@ -671,20 +666,20 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, of the location within the section. Some targets arrange for the addend to be the negative of the position of the location within the section; for example, i386-aout does this. For - i386-aout, pcrel_offset is false. Some other targets do not + i386-aout, pcrel_offset is FALSE. Some other targets do not include the position of the location; for example, m88kbcs, - or ELF. For those targets, pcrel_offset is true. + or ELF. For those targets, pcrel_offset is TRUE. - If we are producing relocateable output, then we must ensure + If we are producing relocatable output, then we must ensure that this reloc will be correctly computed when the final - relocation is done. If pcrel_offset is false we want to wind + relocation is done. If pcrel_offset is FALSE we want to wind up with the negative of the location within the section, which means we must adjust the existing addend by the change - in the location within the section. If pcrel_offset is true + in the location within the section. If pcrel_offset is TRUE we do not want to adjust the existing addend at all. FIXME: This seems logical to me, but for the case of - producing relocateable output it is not what the code + producing relocatable output it is not what the code actually does. I don't want to change it, because it seems far too likely that something will break. */ @@ -695,7 +690,7 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, relocation -= reloc_entry->address; } - if (output_bfd != (bfd *) NULL) + if (output_bfd != NULL) { if (! howto->partial_inplace) { @@ -739,7 +734,7 @@ Hmmm. The first obvious point is that bfd_perform_relocation should not have any tests that depend upon the flavour. It's seem like entirely the wrong place for such a thing. The second obvious point is that the current code ignores the reloc addend when producing -relocateable output for COFF. That's peculiar. In fact, I really +relocatable output for COFF. That's peculiar. In fact, I really have no idea what the point of the line you want to remove is. A typical COFF reloc subtracts the old value of the symbol and adds in @@ -754,9 +749,9 @@ different story (we can't change it without losing backward compatibility with old object files) (coff-i386 does subtract the old value, to be compatible with existing coff-i386 targets, like SCO). -So everything works fine when not producing relocateable output. When -we are producing relocateable output, logically we should do exactly -what we do when not producing relocateable output. Therefore, your +So everything works fine when not producing relocatable output. When +we are producing relocatable output, logically we should do exactly +what we do when not producing relocatable output. Therefore, your patch is correct. In fact, it should probably always just set reloc_entry->addend to 0 for all cases, since it is, in fact, going to add the value into the object file. This won't hurt the COFF code, @@ -764,7 +759,7 @@ which doesn't use the addend; I'm not sure what it will do to other formats (the thing to check for would be whether any formats both use the addend and set partial_inplace). -When I wanted to make coff-i386 produce relocateable output, I ran +When I wanted to make coff-i386 produce relocatable output, I ran into the problem that you are running into: I wanted to remove that line. Rather than risk it, I made the coff-i386 relocs use a special function; it's coff_i386_reloc in coff-i386.c. The function @@ -958,13 +953,12 @@ FUNCTION bfd_install_relocation SYNOPSIS - bfd_reloc_status_type - bfd_install_relocation - (bfd *abfd, - arelent *reloc_entry, - PTR data, bfd_vma data_start, - asection *input_section, - char **error_message); + bfd_reloc_status_type bfd_install_relocation + (bfd *abfd, + arelent *reloc_entry, + void *data, bfd_vma data_start, + asection *input_section, + char **error_message); DESCRIPTION This looks remarkably like <>, except it @@ -977,14 +971,12 @@ DESCRIPTION */ bfd_reloc_status_type -bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, - input_section, error_message) - bfd *abfd; - arelent *reloc_entry; - PTR data_start; - bfd_vma data_start_offset; - asection *input_section; - char **error_message; +bfd_install_relocation (bfd *abfd, + arelent *reloc_entry, + void *data_start, + bfd_vma data_start_offset, + asection *input_section, + char **error_message) { bfd_vma relocation; bfd_reloc_status_type flag = bfd_reloc_ok; @@ -1025,7 +1017,7 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, / bfd_octets_per_byte (abfd))) return bfd_reloc_outofrange; - /* Work out which section the relocation is targetted at and the + /* Work out which section the relocation is targeted at and the initial relocation command value. */ /* Get symbol value. (Common symbols are special.) */ @@ -1063,20 +1055,20 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, of the location within the section. Some targets arrange for the addend to be the negative of the position of the location within the section; for example, i386-aout does this. For - i386-aout, pcrel_offset is false. Some other targets do not + i386-aout, pcrel_offset is FALSE. Some other targets do not include the position of the location; for example, m88kbcs, - or ELF. For those targets, pcrel_offset is true. + or ELF. For those targets, pcrel_offset is TRUE. - If we are producing relocateable output, then we must ensure + If we are producing relocatable output, then we must ensure that this reloc will be correctly computed when the final - relocation is done. If pcrel_offset is false we want to wind + relocation is done. If pcrel_offset is FALSE we want to wind up with the negative of the location within the section, which means we must adjust the existing addend by the change - in the location within the section. If pcrel_offset is true + in the location within the section. If pcrel_offset is TRUE we do not want to adjust the existing addend at all. FIXME: This seems logical to me, but for the case of - producing relocateable output it is not what the code + producing relocatable output it is not what the code actually does. I don't want to change it, because it seems far too likely that something will break. */ @@ -1128,7 +1120,7 @@ Hmmm. The first obvious point is that bfd_install_relocation should not have any tests that depend upon the flavour. It's seem like entirely the wrong place for such a thing. The second obvious point is that the current code ignores the reloc addend when producing -relocateable output for COFF. That's peculiar. In fact, I really +relocatable output for COFF. That's peculiar. In fact, I really have no idea what the point of the line you want to remove is. A typical COFF reloc subtracts the old value of the symbol and adds in @@ -1143,9 +1135,9 @@ different story (we can't change it without losing backward compatibility with old object files) (coff-i386 does subtract the old value, to be compatible with existing coff-i386 targets, like SCO). -So everything works fine when not producing relocateable output. When -we are producing relocateable output, logically we should do exactly -what we do when not producing relocateable output. Therefore, your +So everything works fine when not producing relocatable output. When +we are producing relocatable output, logically we should do exactly +what we do when not producing relocatable output. Therefore, your patch is correct. In fact, it should probably always just set reloc_entry->addend to 0 for all cases, since it is, in fact, going to add the value into the object file. This won't hurt the COFF code, @@ -1153,7 +1145,7 @@ which doesn't use the addend; I'm not sure what it will do to other formats (the thing to check for would be whether any formats both use the addend and set partial_inplace). -When I wanted to make coff-i386 produce relocateable output, I ran +When I wanted to make coff-i386 produce relocatable output, I ran into the problem that you are running into: I wanted to remove that line. Rather than risk it, I made the coff-i386 relocs use a special function; it's coff_i386_reloc in coff-i386.c. The function @@ -1277,32 +1269,32 @@ space consuming. For each target: { case 0: { - char x = bfd_get_8 (abfd, (char *) data); + char x = bfd_get_8 (abfd, data); DOIT (x); - bfd_put_8 (abfd, x, (unsigned char *) data); + bfd_put_8 (abfd, x, data); } break; case 1: { - short x = bfd_get_16 (abfd, (bfd_byte *) data); + short x = bfd_get_16 (abfd, data); DOIT (x); - bfd_put_16 (abfd, (bfd_vma) x, (unsigned char *) data); + bfd_put_16 (abfd, (bfd_vma) x, data); } break; case 2: { - long x = bfd_get_32 (abfd, (bfd_byte *) data); + long x = bfd_get_32 (abfd, data); DOIT (x); - bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data); + bfd_put_32 (abfd, (bfd_vma) x, data); } break; case -2: { - long x = bfd_get_32 (abfd, (bfd_byte *) data); + long x = bfd_get_32 (abfd, data); relocation = -relocation; DOIT (x); - bfd_put_32 (abfd, (bfd_vma) x, (bfd_byte *) data); + bfd_put_32 (abfd, (bfd_vma) x, data); } break; @@ -1312,9 +1304,9 @@ space consuming. For each target: case 4: { - bfd_vma x = bfd_get_64 (abfd, (bfd_byte *) data); + bfd_vma x = bfd_get_64 (abfd, data); DOIT (x); - bfd_put_64 (abfd, x, (bfd_byte *) data); + bfd_put_64 (abfd, x, data); } break; default: @@ -1331,7 +1323,7 @@ space consuming. For each target: function than to try to deal with it. This routine does a final relocation. Whether it is useful for a - relocateable link depends upon how the object format defines + relocatable link depends upon how the object format defines relocations. FIXME: This routine ignores any special_function in the HOWTO, @@ -1347,15 +1339,13 @@ space consuming. For each target: ADDEND is the addend of the reloc. */ bfd_reloc_status_type -_bfd_final_link_relocate (howto, input_bfd, input_section, contents, address, - value, addend) - reloc_howto_type *howto; - bfd *input_bfd; - asection *input_section; - bfd_byte *contents; - bfd_vma address; - bfd_vma value; - bfd_vma addend; +_bfd_final_link_relocate (reloc_howto_type *howto, + bfd *input_bfd, + asection *input_section, + bfd_byte *contents, + bfd_vma address, + bfd_vma value, + bfd_vma addend) { bfd_vma relocation; @@ -1374,9 +1364,9 @@ _bfd_final_link_relocate (howto, input_bfd, input_section, contents, address, location we are relocating. Some targets (e.g., i386-aout) arrange for the contents of the section to be the negative of the offset of the location within the section; for such targets - pcrel_offset is false. Other targets (e.g., m88kbcs or ELF) + pcrel_offset is FALSE. Other targets (e.g., m88kbcs or ELF) simply leave the contents of the section as zero; for such - targets pcrel_offset is true. If pcrel_offset is false we do not + targets pcrel_offset is TRUE. If pcrel_offset is FALSE we do not need to subtract out the offset of the location within the section (which is just ADDRESS). */ if (howto->pc_relative) @@ -1394,11 +1384,10 @@ _bfd_final_link_relocate (howto, input_bfd, input_section, contents, address, /* Relocate a given location using a given value and howto. */ bfd_reloc_status_type -_bfd_relocate_contents (howto, input_bfd, relocation, location) - reloc_howto_type *howto; - bfd *input_bfd; - bfd_vma relocation; - bfd_byte *location; +_bfd_relocate_contents (reloc_howto_type *howto, + bfd *input_bfd, + bfd_vma relocation, + bfd_byte *location) { int size; bfd_vma x = 0; @@ -1872,6 +1861,56 @@ ENUM BFD_RELOC_SPARC_REV32 ENUMDOC SPARC little endian relocation +ENUM + BFD_RELOC_SPARC_TLS_GD_HI22 +ENUMX + BFD_RELOC_SPARC_TLS_GD_LO10 +ENUMX + BFD_RELOC_SPARC_TLS_GD_ADD +ENUMX + BFD_RELOC_SPARC_TLS_GD_CALL +ENUMX + BFD_RELOC_SPARC_TLS_LDM_HI22 +ENUMX + BFD_RELOC_SPARC_TLS_LDM_LO10 +ENUMX + BFD_RELOC_SPARC_TLS_LDM_ADD +ENUMX + BFD_RELOC_SPARC_TLS_LDM_CALL +ENUMX + BFD_RELOC_SPARC_TLS_LDO_HIX22 +ENUMX + BFD_RELOC_SPARC_TLS_LDO_LOX10 +ENUMX + BFD_RELOC_SPARC_TLS_LDO_ADD +ENUMX + BFD_RELOC_SPARC_TLS_IE_HI22 +ENUMX + BFD_RELOC_SPARC_TLS_IE_LO10 +ENUMX + BFD_RELOC_SPARC_TLS_IE_LD +ENUMX + BFD_RELOC_SPARC_TLS_IE_LDX +ENUMX + BFD_RELOC_SPARC_TLS_IE_ADD +ENUMX + BFD_RELOC_SPARC_TLS_LE_HIX22 +ENUMX + BFD_RELOC_SPARC_TLS_LE_LOX10 +ENUMX + BFD_RELOC_SPARC_TLS_DTPMOD32 +ENUMX + BFD_RELOC_SPARC_TLS_DTPMOD64 +ENUMX + BFD_RELOC_SPARC_TLS_DTPOFF32 +ENUMX + BFD_RELOC_SPARC_TLS_DTPOFF64 +ENUMX + BFD_RELOC_SPARC_TLS_TPOFF32 +ENUMX + BFD_RELOC_SPARC_TLS_TPOFF64 +ENUMDOC + SPARC TLS relocations ENUM BFD_RELOC_ALPHA_GPDISP_HI16 @@ -1959,7 +1998,7 @@ ENUM BFD_RELOC_ALPHA_BRSGP ENUMDOC Like BFD_RELOC_23_PCREL_S2, except that the source and target must - share a common GP, and the target address is adjusted for + share a common GP, and the target address is adjusted for STO_ALPHA_STD_GPLOAD. ENUM @@ -2078,7 +2117,10 @@ ENUMX BFD_RELOC_MIPS_RELGOT ENUMX BFD_RELOC_MIPS_JALR +ENUMDOC + MIPS ELF relocations. COMMENT + ENUM BFD_RELOC_FRV_LABEL16 ENUMX @@ -2097,13 +2139,73 @@ ENUMX BFD_RELOC_FRV_GPRELHI ENUMX BFD_RELOC_FRV_GPRELLO +ENUMX + BFD_RELOC_FRV_GOT12 +ENUMX + BFD_RELOC_FRV_GOTHI +ENUMX + BFD_RELOC_FRV_GOTLO +ENUMX + BFD_RELOC_FRV_FUNCDESC +ENUMX + BFD_RELOC_FRV_FUNCDESC_GOT12 +ENUMX + BFD_RELOC_FRV_FUNCDESC_GOTHI +ENUMX + BFD_RELOC_FRV_FUNCDESC_GOTLO +ENUMX + BFD_RELOC_FRV_FUNCDESC_VALUE +ENUMX + BFD_RELOC_FRV_FUNCDESC_GOTOFF12 +ENUMX + BFD_RELOC_FRV_FUNCDESC_GOTOFFHI +ENUMX + BFD_RELOC_FRV_FUNCDESC_GOTOFFLO +ENUMX + BFD_RELOC_FRV_GOTOFF12 +ENUMX + BFD_RELOC_FRV_GOTOFFHI +ENUMX + BFD_RELOC_FRV_GOTOFFLO ENUMDOC Fujitsu Frv Relocations. COMMENT -COMMENT -ENUMDOC - MIPS ELF relocations. +ENUM + BFD_RELOC_MN10300_GOTOFF24 +ENUMDOC + This is a 24bit GOT-relative reloc for the mn10300. +ENUM + BFD_RELOC_MN10300_GOT32 +ENUMDOC + This is a 32bit GOT-relative reloc for the mn10300, offset by two bytes + in the instruction. +ENUM + BFD_RELOC_MN10300_GOT24 +ENUMDOC + This is a 24bit GOT-relative reloc for the mn10300, offset by two bytes + in the instruction. +ENUM + BFD_RELOC_MN10300_GOT16 +ENUMDOC + This is a 16bit GOT-relative reloc for the mn10300, offset by two bytes + in the instruction. +ENUM + BFD_RELOC_MN10300_COPY +ENUMDOC + Copy symbol at runtime. +ENUM + BFD_RELOC_MN10300_GLOB_DAT +ENUMDOC + Create GOT entry. +ENUM + BFD_RELOC_MN10300_JMP_SLOT +ENUMDOC + Create PLT entry. +ENUM + BFD_RELOC_MN10300_RELATIVE +ENUMDOC + Adjust by program base. COMMENT ENUM @@ -2165,6 +2267,22 @@ ENUMX BFD_RELOC_X86_64_GOTPCREL ENUMX BFD_RELOC_X86_64_32S +ENUMX + BFD_RELOC_X86_64_DTPMOD64 +ENUMX + BFD_RELOC_X86_64_DTPOFF64 +ENUMX + BFD_RELOC_X86_64_TPOFF64 +ENUMX + BFD_RELOC_X86_64_TLSGD +ENUMX + BFD_RELOC_X86_64_TLSLD +ENUMX + BFD_RELOC_X86_64_DTPOFF32 +ENUMX + BFD_RELOC_X86_64_GOTTPOFF +ENUMX + BFD_RELOC_X86_64_TPOFF32 ENUMDOC x86-64/elf relocations @@ -2327,6 +2445,89 @@ ENUMDOC Power(rs6000) and PowerPC relocations. ENUM + BFD_RELOC_PPC_TLS +ENUMX + BFD_RELOC_PPC_DTPMOD +ENUMX + BFD_RELOC_PPC_TPREL16 +ENUMX + BFD_RELOC_PPC_TPREL16_LO +ENUMX + BFD_RELOC_PPC_TPREL16_HI +ENUMX + BFD_RELOC_PPC_TPREL16_HA +ENUMX + BFD_RELOC_PPC_TPREL +ENUMX + BFD_RELOC_PPC_DTPREL16 +ENUMX + BFD_RELOC_PPC_DTPREL16_LO +ENUMX + BFD_RELOC_PPC_DTPREL16_HI +ENUMX + BFD_RELOC_PPC_DTPREL16_HA +ENUMX + BFD_RELOC_PPC_DTPREL +ENUMX + BFD_RELOC_PPC_GOT_TLSGD16 +ENUMX + BFD_RELOC_PPC_GOT_TLSGD16_LO +ENUMX + BFD_RELOC_PPC_GOT_TLSGD16_HI +ENUMX + BFD_RELOC_PPC_GOT_TLSGD16_HA +ENUMX + BFD_RELOC_PPC_GOT_TLSLD16 +ENUMX + BFD_RELOC_PPC_GOT_TLSLD16_LO +ENUMX + BFD_RELOC_PPC_GOT_TLSLD16_HI +ENUMX + BFD_RELOC_PPC_GOT_TLSLD16_HA +ENUMX + BFD_RELOC_PPC_GOT_TPREL16 +ENUMX + BFD_RELOC_PPC_GOT_TPREL16_LO +ENUMX + BFD_RELOC_PPC_GOT_TPREL16_HI +ENUMX + BFD_RELOC_PPC_GOT_TPREL16_HA +ENUMX + BFD_RELOC_PPC_GOT_DTPREL16 +ENUMX + BFD_RELOC_PPC_GOT_DTPREL16_LO +ENUMX + BFD_RELOC_PPC_GOT_DTPREL16_HI +ENUMX + BFD_RELOC_PPC_GOT_DTPREL16_HA +ENUMX + BFD_RELOC_PPC64_TPREL16_DS +ENUMX + BFD_RELOC_PPC64_TPREL16_LO_DS +ENUMX + BFD_RELOC_PPC64_TPREL16_HIGHER +ENUMX + BFD_RELOC_PPC64_TPREL16_HIGHERA +ENUMX + BFD_RELOC_PPC64_TPREL16_HIGHEST +ENUMX + BFD_RELOC_PPC64_TPREL16_HIGHESTA +ENUMX + BFD_RELOC_PPC64_DTPREL16_DS +ENUMX + BFD_RELOC_PPC64_DTPREL16_LO_DS +ENUMX + BFD_RELOC_PPC64_DTPREL16_HIGHER +ENUMX + BFD_RELOC_PPC64_DTPREL16_HIGHERA +ENUMX + BFD_RELOC_PPC64_DTPREL16_HIGHEST +ENUMX + BFD_RELOC_PPC64_DTPREL16_HIGHESTA +ENUMDOC + PowerPC and PowerPC64 thread-local storage relocations. + +ENUM BFD_RELOC_I370_D12 ENUMDOC IBM 370/390 relocations @@ -2334,7 +2535,7 @@ ENUMDOC ENUM BFD_RELOC_CTOR ENUMDOC - The type of reloc used to build a contructor table - at the moment + The type of reloc used to build a constructor table - at the moment probably a 32 bit wide absolute relocation, but the target can choose. It generally does map to one of the other relocation types. @@ -2370,6 +2571,8 @@ ENUMX ENUMX BFD_RELOC_ARM_CP_OFF_IMM ENUMX + BFD_RELOC_ARM_CP_OFF_IMM_S2 +ENUMX BFD_RELOC_ARM_ADR_IMM ENUMX BFD_RELOC_ARM_LDR_IMM @@ -2559,8 +2762,24 @@ ENUMX BFD_RELOC_SH_IMM_HI16_PCREL ENUMX BFD_RELOC_SH_PT_16 +ENUMX + BFD_RELOC_SH_TLS_GD_32 +ENUMX + BFD_RELOC_SH_TLS_LD_32 +ENUMX + BFD_RELOC_SH_TLS_LDO_32 +ENUMX + BFD_RELOC_SH_TLS_IE_32 +ENUMX + BFD_RELOC_SH_TLS_LE_32 +ENUMX + BFD_RELOC_SH_TLS_DTPMOD32 +ENUMX + BFD_RELOC_SH_TLS_DTPOFF32 +ENUMX + BFD_RELOC_SH_TLS_TPOFF32 ENUMDOC - Hitachi SH relocs. Not all of these appear in object files. + Renesas / SuperH SH relocs. Not all of these appear in object files. ENUM BFD_RELOC_THUMB_PCREL_BRANCH9 @@ -2687,7 +2906,7 @@ ENUMDOC ENUM BFD_RELOC_M32R_24 ENUMDOC - Mitsubishi M32R relocs. + Renesas M32R (formerly Mitsubishi M32R) relocs. This is a 24 bit absolute address. ENUM BFD_RELOC_M32R_10_PCREL @@ -2720,6 +2939,37 @@ ENUM ENUMDOC This is a 16-bit reloc containing the small data area offset for use in add3, load, and store instructions. +ENUM + BFD_RELOC_M32R_GOT24 +ENUMX + BFD_RELOC_M32R_26_PLTREL +ENUMX + BFD_RELOC_M32R_COPY +ENUMX + BFD_RELOC_M32R_GLOB_DAT +ENUMX + BFD_RELOC_M32R_JMP_SLOT +ENUMX + BFD_RELOC_M32R_RELATIVE +ENUMX + BFD_RELOC_M32R_GOTOFF +ENUMX + BFD_RELOC_M32R_GOTPC24 +ENUMX + BFD_RELOC_M32R_GOT16_HI_ULO +ENUMX + BFD_RELOC_M32R_GOT16_HI_SLO +ENUMX + BFD_RELOC_M32R_GOT16_LO +ENUMX + BFD_RELOC_M32R_GOTPC_HI_ULO +ENUMX + BFD_RELOC_M32R_GOTPC_HI_SLO +ENUMX + BFD_RELOC_M32R_GOTPC_LO +ENUMDOC + For PIC. + ENUM BFD_RELOC_V850_9_PCREL @@ -2780,12 +3030,12 @@ ENUM BFD_RELOC_V850_SDA_16_16_SPLIT_OFFSET ENUMDOC This is a 16 bit offset from the short data area pointer, with the - bits placed non-contigously in the instruction. + bits placed non-contiguously in the instruction. ENUM BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET ENUMDOC This is a 16 bit offset from the zero data area pointer, with the - bits placed non-contigously in the instruction. + bits placed non-contiguously in the instruction. ENUM BFD_RELOC_V850_CALLT_6_7_OFFSET ENUMDOC @@ -2794,8 +3044,18 @@ ENUM BFD_RELOC_V850_CALLT_16_16_OFFSET ENUMDOC This is a 16 bit offset from the call table base pointer. -COMMENT - +ENUM + BFD_RELOC_V850_LONGCALL +ENUMDOC + Used for relaxing indirect function calls. +ENUM + BFD_RELOC_V850_LONGJUMP +ENUMDOC + Used for relaxing indirect jumps. +ENUM + BFD_RELOC_V850_ALIGN +ENUMDOC + Used to maintain alignment whilst relaxing. ENUM BFD_RELOC_MN10300_32_PCREL ENUMDOC @@ -2932,6 +3192,8 @@ ENUMX BFD_RELOC_MMIX_PUSHJ_2 ENUMX BFD_RELOC_MMIX_PUSHJ_3 +ENUMX + BFD_RELOC_MMIX_PUSHJ_STUBBABLE ENUMDOC These are relocations for the PUSHJ instruction. ENUM @@ -3127,6 +3389,145 @@ ENUM BFD_RELOC_390_GOTENT ENUMDOC 32 bit rel. offset to GOT entry. +ENUM + BFD_RELOC_390_GOTOFF64 +ENUMDOC + 64 bit offset to GOT. +ENUM + BFD_RELOC_390_GOTPLT12 +ENUMDOC + 12-bit offset to symbol-entry within GOT, with PLT handling. +ENUM + BFD_RELOC_390_GOTPLT16 +ENUMDOC + 16-bit offset to symbol-entry within GOT, with PLT handling. +ENUM + BFD_RELOC_390_GOTPLT32 +ENUMDOC + 32-bit offset to symbol-entry within GOT, with PLT handling. +ENUM + BFD_RELOC_390_GOTPLT64 +ENUMDOC + 64-bit offset to symbol-entry within GOT, with PLT handling. +ENUM + BFD_RELOC_390_GOTPLTENT +ENUMDOC + 32-bit rel. offset to symbol-entry within GOT, with PLT handling. +ENUM + BFD_RELOC_390_PLTOFF16 +ENUMDOC + 16-bit rel. offset from the GOT to a PLT entry. +ENUM + BFD_RELOC_390_PLTOFF32 +ENUMDOC + 32-bit rel. offset from the GOT to a PLT entry. +ENUM + BFD_RELOC_390_PLTOFF64 +ENUMDOC + 64-bit rel. offset from the GOT to a PLT entry. + +ENUM + BFD_RELOC_390_TLS_LOAD +ENUMX + BFD_RELOC_390_TLS_GDCALL +ENUMX + BFD_RELOC_390_TLS_LDCALL +ENUMX + BFD_RELOC_390_TLS_GD32 +ENUMX + BFD_RELOC_390_TLS_GD64 +ENUMX + BFD_RELOC_390_TLS_GOTIE12 +ENUMX + BFD_RELOC_390_TLS_GOTIE32 +ENUMX + BFD_RELOC_390_TLS_GOTIE64 +ENUMX + BFD_RELOC_390_TLS_LDM32 +ENUMX + BFD_RELOC_390_TLS_LDM64 +ENUMX + BFD_RELOC_390_TLS_IE32 +ENUMX + BFD_RELOC_390_TLS_IE64 +ENUMX + BFD_RELOC_390_TLS_IEENT +ENUMX + BFD_RELOC_390_TLS_LE32 +ENUMX + BFD_RELOC_390_TLS_LE64 +ENUMX + BFD_RELOC_390_TLS_LDO32 +ENUMX + BFD_RELOC_390_TLS_LDO64 +ENUMX + BFD_RELOC_390_TLS_DTPMOD +ENUMX + BFD_RELOC_390_TLS_DTPOFF +ENUMX + BFD_RELOC_390_TLS_TPOFF +ENUMDOC + s390 tls relocations. + +ENUM + BFD_RELOC_390_20 +ENUMX + BFD_RELOC_390_GOT20 +ENUMX + BFD_RELOC_390_GOTPLT20 +ENUMX + BFD_RELOC_390_TLS_GOTIE20 +ENUMDOC + Long displacement extension. + +ENUM + BFD_RELOC_IP2K_FR9 +ENUMDOC + Scenix IP2K - 9-bit register number / data address +ENUM + BFD_RELOC_IP2K_BANK +ENUMDOC + Scenix IP2K - 4-bit register/data bank number +ENUM + BFD_RELOC_IP2K_ADDR16CJP +ENUMDOC + Scenix IP2K - low 13 bits of instruction word address +ENUM + BFD_RELOC_IP2K_PAGE3 +ENUMDOC + Scenix IP2K - high 3 bits of instruction word address +ENUM + BFD_RELOC_IP2K_LO8DATA +ENUMX + BFD_RELOC_IP2K_HI8DATA +ENUMX + BFD_RELOC_IP2K_EX8DATA +ENUMDOC + Scenix IP2K - ext/low/high 8 bits of data address +ENUM + BFD_RELOC_IP2K_LO8INSN +ENUMX + BFD_RELOC_IP2K_HI8INSN +ENUMDOC + Scenix IP2K - low/high 8 bits of instruction word address +ENUM + BFD_RELOC_IP2K_PC_SKIP +ENUMDOC + Scenix IP2K - even/odd PC modifier to modify snb pcl.0 +ENUM + BFD_RELOC_IP2K_TEXT +ENUMDOC + Scenix IP2K - 16 bit word address in text section. +ENUM + BFD_RELOC_IP2K_FR_OFFSET +ENUMDOC + Scenix IP2K - 7-bit sp or dp offset +ENUM + BFD_RELOC_VPE4KMATH_DATA +ENUMX + BFD_RELOC_VPE4KMATH_INSN +ENUMDOC + Scenix VPE4K coprocessor - data/insn-space addressing ENUM BFD_RELOC_VTABLE_INHERIT @@ -3140,7 +3541,7 @@ ENUMDOC included in the output. VTABLE_INHERIT is a zero-space relocation used to describe to the - linker the inheritence tree of a C++ virtual function table. The + linker the inheritance tree of a C++ virtual function table. The relocation's symbol should be the parent class' vtable, and the relocation should be located at the child vtable. @@ -3316,17 +3717,58 @@ ENUM BFD_RELOC_M68HC11_HI8 ENUMDOC Motorola 68HC11 reloc. - This is the 8 bits high part of an absolute address. + This is the 8 bit 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. + This is the 8 bit low part of an absolute address. ENUM BFD_RELOC_M68HC11_3B ENUMDOC Motorola 68HC11 reloc. - This is the 3 bits of a value. + This is the 3 bit of a value. +ENUM + BFD_RELOC_M68HC11_RL_JUMP +ENUMDOC + Motorola 68HC11 reloc. + This reloc marks the beginning of a jump/call instruction. + It is used for linker relaxation to correctly identify beginning + of instruction and change some branches to use PC-relative + addressing mode. +ENUM + BFD_RELOC_M68HC11_RL_GROUP +ENUMDOC + Motorola 68HC11 reloc. + This reloc marks a group of several instructions that gcc generates + and for which the linker relaxation pass can modify and/or remove + some of them. +ENUM + BFD_RELOC_M68HC11_LO16 +ENUMDOC + Motorola 68HC11 reloc. + This is the 16-bit lower part of an address. It is used for 'call' + instruction to specify the symbol address without any special + transformation (due to memory bank window). +ENUM + BFD_RELOC_M68HC11_PAGE +ENUMDOC + Motorola 68HC11 reloc. + This is a 8-bit reloc that specifies the page number of an address. + It is used by 'call' instruction to specify the page number of + the symbol. +ENUM + BFD_RELOC_M68HC11_24 +ENUMDOC + Motorola 68HC11 reloc. + This is a 24-bit reloc that represents the address with a 16-bit + value and a 8-bit page number. The symbol address is transformed + to follow the 16K memory bank of 68HC12 (seen as mapped in the window). +ENUM + BFD_RELOC_M68HC12_5B +ENUMDOC + Motorola 68HC12 reloc. + This is the 5 bits of a value. ENUM BFD_RELOC_CRIS_BDISP8 @@ -3470,6 +3912,8 @@ ENUMDOC ENUM BFD_RELOC_XSTORMY16_REL_12 ENUMX + BFD_RELOC_XSTORMY16_12 +ENUMX BFD_RELOC_XSTORMY16_24 ENUMX BFD_RELOC_XSTORMY16_FPTR16 @@ -3484,6 +3928,71 @@ ENUMX BFD_RELOC_VAX_RELATIVE ENUMDOC Relocations used by VAX ELF. + +ENUM + BFD_RELOC_MSP430_10_PCREL +ENUMX + BFD_RELOC_MSP430_16_PCREL +ENUMX + BFD_RELOC_MSP430_16 +ENUMX + BFD_RELOC_MSP430_16_PCREL_BYTE +ENUMX + BFD_RELOC_MSP430_16_BYTE +ENUMDOC + msp430 specific relocation codes + +ENUM + BFD_RELOC_IQ2000_OFFSET_16 +ENUMX + BFD_RELOC_IQ2000_OFFSET_21 +ENUMX + BFD_RELOC_IQ2000_UHI16 +ENUMDOC + IQ2000 Relocations. + +ENUM + BFD_RELOC_XTENSA_RTLD +ENUMDOC + Special Xtensa relocation used only by PLT entries in ELF shared + objects to indicate that the runtime linker should set the value + to one of its own internal functions or data structures. +ENUM + BFD_RELOC_XTENSA_GLOB_DAT +ENUMX + BFD_RELOC_XTENSA_JMP_SLOT +ENUMX + BFD_RELOC_XTENSA_RELATIVE +ENUMDOC + Xtensa relocations for ELF shared objects. +ENUM + BFD_RELOC_XTENSA_PLT +ENUMDOC + Xtensa relocation used in ELF object files for symbols that may require + PLT entries. Otherwise, this is just a generic 32-bit relocation. +ENUM + BFD_RELOC_XTENSA_OP0 +ENUMX + BFD_RELOC_XTENSA_OP1 +ENUMX + BFD_RELOC_XTENSA_OP2 +ENUMDOC + Generic Xtensa relocations. Only the operand number is encoded + in the relocation. The details are determined by extracting the + instruction opcode. +ENUM + BFD_RELOC_XTENSA_ASM_EXPAND +ENUMDOC + Xtensa relocation to mark that the assembler expanded the + instructions from an original target. The expansion size is + encoded in the reloc size. +ENUM + BFD_RELOC_XTENSA_ASM_SIMPLIFY +ENUMDOC + Xtensa relocation to mark that the linker should simplify + assembler-expanded instructions. This is commonly used + internally by the linker after analysis of a + BFD_RELOC_XTENSA_ASM_EXPAND. ENDSENUM BFD_RELOC_UNUSED @@ -3497,8 +4006,8 @@ FUNCTION bfd_reloc_type_lookup SYNOPSIS - reloc_howto_type * - bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code); + reloc_howto_type *bfd_reloc_type_lookup + (bfd *abfd, bfd_reloc_code_real_type code); DESCRIPTION Return a pointer to a howto structure which, when @@ -3508,15 +4017,13 @@ DESCRIPTION */ reloc_howto_type * -bfd_reloc_type_lookup (abfd, code) - bfd *abfd; - bfd_reloc_code_real_type code; +bfd_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) { return BFD_SEND (abfd, 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); +HOWTO (0, 00, 2, 32, FALSE, 0, complain_overflow_bitfield, 0, "VRT32", FALSE, 0xffffffff, 0xffffffff, TRUE); /* INTERNAL_FUNCTION @@ -3524,7 +4031,7 @@ INTERNAL_FUNCTION SYNOPSIS reloc_howto_type *bfd_default_reloc_type_lookup - (bfd *abfd, bfd_reloc_code_real_type code); + (bfd *abfd, bfd_reloc_code_real_type code); DESCRIPTION Provides a default relocation lookup routine for any architecture. @@ -3532,9 +4039,7 @@ DESCRIPTION */ reloc_howto_type * -bfd_default_reloc_type_lookup (abfd, code) - bfd *abfd; - bfd_reloc_code_real_type code; +bfd_default_reloc_type_lookup (bfd *abfd, bfd_reloc_code_real_type code) { switch (code) { @@ -3555,7 +4060,7 @@ bfd_default_reloc_type_lookup (abfd, code) default: BFD_FAIL (); } - return (reloc_howto_type *) NULL; + return NULL; } /* @@ -3571,12 +4076,11 @@ DESCRIPTION */ const char * -bfd_get_reloc_code_name (code) - bfd_reloc_code_real_type code; +bfd_get_reloc_code_name (bfd_reloc_code_real_type code) { - if ((int) code > (int) BFD_RELOC_UNUSED) + if (code > BFD_RELOC_UNUSED) return 0; - return bfd_reloc_code_real_names[(int)code]; + return bfd_reloc_code_real_names[code]; } /* @@ -3584,26 +4088,31 @@ INTERNAL_FUNCTION bfd_generic_relax_section SYNOPSIS - boolean bfd_generic_relax_section - (bfd *abfd, - asection *section, - struct bfd_link_info *, - boolean *); + bfd_boolean bfd_generic_relax_section + (bfd *abfd, + asection *section, + struct bfd_link_info *, + bfd_boolean *); DESCRIPTION Provides default handling for relaxing for back ends which - don't do relaxing -- i.e., does nothing. + don't do relaxing -- i.e., does nothing except make sure that the + final size of the section is set. */ -boolean -bfd_generic_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; +bfd_boolean +bfd_generic_relax_section (bfd *abfd ATTRIBUTE_UNUSED, + asection *section ATTRIBUTE_UNUSED, + struct bfd_link_info *link_info ATTRIBUTE_UNUSED, + bfd_boolean *again) { - *again = false; - return true; + /* We're not relaxing the section, so just copy the size info if it's + zero. Someone else, like bfd_merge_sections, might have set it, so + don't overwrite a non-zero value. */ + if (section->_cooked_size == 0) + section->_cooked_size = section->_raw_size; + *again = FALSE; + return TRUE; } /* @@ -3611,20 +4120,19 @@ INTERNAL_FUNCTION bfd_generic_gc_sections SYNOPSIS - boolean bfd_generic_gc_sections - (bfd *, struct bfd_link_info *); + bfd_boolean bfd_generic_gc_sections + (bfd *, struct bfd_link_info *); DESCRIPTION Provides default handling for relaxing for back ends which don't do section gc -- i.e., does nothing. */ -boolean -bfd_generic_gc_sections (abfd, link_info) - bfd *abfd ATTRIBUTE_UNUSED; - struct bfd_link_info *link_info ATTRIBUTE_UNUSED; +bfd_boolean +bfd_generic_gc_sections (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *link_info ATTRIBUTE_UNUSED) { - return true; + return TRUE; } /* @@ -3632,20 +4140,19 @@ INTERNAL_FUNCTION bfd_generic_merge_sections SYNOPSIS - boolean bfd_generic_merge_sections - (bfd *, struct bfd_link_info *); + bfd_boolean bfd_generic_merge_sections + (bfd *, struct bfd_link_info *); DESCRIPTION Provides default handling for SEC_MERGE section merging for back ends which don't have SEC_MERGE support -- i.e., does nothing. */ -boolean -bfd_generic_merge_sections (abfd, link_info) - bfd *abfd ATTRIBUTE_UNUSED; - struct bfd_link_info *link_info ATTRIBUTE_UNUSED; +bfd_boolean +bfd_generic_merge_sections (bfd *abfd ATTRIBUTE_UNUSED, + struct bfd_link_info *link_info ATTRIBUTE_UNUSED) { - return true; + return TRUE; } /* @@ -3653,13 +4160,13 @@ INTERNAL_FUNCTION bfd_generic_get_relocated_section_contents SYNOPSIS - bfd_byte * - bfd_generic_get_relocated_section_contents (bfd *abfd, - struct bfd_link_info *link_info, - struct bfd_link_order *link_order, - bfd_byte *data, - boolean relocateable, - asymbol **symbols); + bfd_byte *bfd_generic_get_relocated_section_contents + (bfd *abfd, + struct bfd_link_info *link_info, + struct bfd_link_order *link_order, + bfd_byte *data, + bfd_boolean relocatable, + asymbol **symbols); DESCRIPTION Provides default handling of relocation effort for back ends @@ -3668,14 +4175,12 @@ DESCRIPTION */ bfd_byte * -bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data, - relocateable, symbols) - bfd *abfd; - struct bfd_link_info *link_info; - struct bfd_link_order *link_order; - bfd_byte *data; - boolean relocateable; - asymbol **symbols; +bfd_generic_get_relocated_section_contents (bfd *abfd, + struct bfd_link_info *link_info, + struct bfd_link_order *link_order, + bfd_byte *data, + bfd_boolean relocatable, + asymbol **symbols) { /* Get enough memory to hold the stuff. */ bfd *input_bfd = link_order->u.indirect.section->owner; @@ -3688,21 +4193,26 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data, if (reloc_size < 0) goto error_return; - reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); + reloc_vector = bfd_malloc (reloc_size); if (reloc_vector == NULL && reloc_size != 0) goto error_return; /* Read in the section. */ if (!bfd_get_section_contents (input_bfd, input_section, - (PTR) data, - (bfd_vma) 0, + data, + 0, input_section->_raw_size)) goto error_return; - /* We're not relaxing the section, so just copy the size info. */ - input_section->_cooked_size = input_section->_raw_size; - input_section->reloc_done = (unsigned int) true; + /* Don't set input_section->_cooked_size here. The caller has set + _cooked_size or called bfd_relax_section, which sets _cooked_size. + Despite using this generic relocation function, some targets perform + target-specific relaxation or string merging, which happens before + this function is called. We do not want to clobber the _cooked_size + they computed. */ + + input_section->reloc_done = TRUE; reloc_count = bfd_canonicalize_reloc (input_bfd, input_section, @@ -3714,19 +4224,18 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data, if (reloc_count > 0) { arelent **parent; - for (parent = reloc_vector; *parent != (arelent *) NULL; - parent++) + for (parent = reloc_vector; *parent != NULL; parent++) { - char *error_message = (char *) NULL; + char *error_message = NULL; bfd_reloc_status_type r = bfd_perform_relocation (input_bfd, *parent, - (PTR) data, + data, input_section, - relocateable ? abfd : (bfd *) NULL, + relocatable ? abfd : NULL, &error_message); - if (relocateable) + if (relocatable) { asection *os = input_section->output_section; @@ -3743,11 +4252,11 @@ bfd_generic_get_relocated_section_contents (abfd, link_info, link_order, data, if (!((*link_info->callbacks->undefined_symbol) (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr), input_bfd, input_section, (*parent)->address, - true))) + TRUE))) goto error_return; break; case bfd_reloc_dangerous: - BFD_ASSERT (error_message != (char *) NULL); + BFD_ASSERT (error_message != NULL); if (!((*link_info->callbacks->reloc_dangerous) (link_info, error_message, input_bfd, input_section, (*parent)->address))) diff --git a/contrib/binutils/bfd/reloc16.c b/contrib/binutils/bfd/reloc16.c index 1db8daf..720e2d6 100644 --- a/contrib/binutils/bfd/reloc16.c +++ b/contrib/binutils/bfd/reloc16.c @@ -1,6 +1,6 @@ /* 8 and 16 bit COFF relocation functions, for BFD. - Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001 - Free Software Foundation, Inc. + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, + 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ BFD generic relocs. They should store the relocs in some location where coff_link_input_bfd can find them (and coff_link_input_bfd should be changed to use this location rather than rereading the - file) (unless info->keep_memory is false, in which case they should + file) (unless info->keep_memory is FALSE, in which case they should free up the relocs after dealing with them). */ #include "bfd.h" @@ -64,7 +64,7 @@ bfd_coff_reloc16_get_value (reloc, link_info, input_section) the generic symbols. */ h = bfd_wrapped_link_hash_lookup (input_section->owner, link_info, bfd_asymbol_name (symbol), - false, false, true); + FALSE, FALSE, TRUE); if (h != (struct bfd_link_hash_entry *) NULL && (h->type == bfd_link_hash_defined || h->type == bfd_link_hash_defweak)) @@ -79,7 +79,7 @@ bfd_coff_reloc16_get_value (reloc, link_info, input_section) if (!((*link_info->callbacks->undefined_symbol) (link_info, bfd_asymbol_name (symbol), input_section->owner, input_section, reloc->address, - true))) + TRUE))) abort (); value = 0; } @@ -136,12 +136,12 @@ bfd_perform_slip (abfd, slip, input_section, value) } } -boolean +bfd_boolean bfd_coff_reloc16_relax_section (abfd, input_section, link_info, again) bfd *abfd; asection *input_section; struct bfd_link_info *link_info; - boolean *again; + bfd_boolean *again; { /* Get enough memory to hold the stuff. */ bfd *input_bfd = input_section->owner; @@ -153,14 +153,14 @@ bfd_coff_reloc16_relax_section (abfd, input_section, link_info, again) /* We only do global relaxation once. It is not safe to do it multiple times (see discussion of the "shrinks" array below). */ - *again = false; + *again = FALSE; if (reloc_size < 0) - return false; + return FALSE; reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); if (!reloc_vector && reloc_size > 0) - return false; + return FALSE; /* Get the relocs and think about them. */ reloc_count = @@ -169,7 +169,7 @@ bfd_coff_reloc16_relax_section (abfd, input_section, link_info, again) if (reloc_count < 0) { free (reloc_vector); - return false; + return FALSE; } /* The reloc16.c and related relaxing code is very simple, the price @@ -193,36 +193,37 @@ bfd_coff_reloc16_relax_section (abfd, input_section, link_info, again) bfd_size_type amt; /* Allocate and initialize the shrinks array for this section. - The last element is used as an accumlator of shrinks. */ + The last element is used as an accumulator of shrinks. */ amt = reloc_count + 1; amt *= sizeof (unsigned); shrinks = (unsigned *) bfd_zmalloc (amt); /* Loop until nothing changes in this section. */ - do { - arelent **parent; - unsigned int i; - long j; - - another_pass = 0; - - 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. */ - shrink = bfd_coff_reloc16_estimate (abfd, input_section, *parent, - shrinks[i], link_info); - - /* If it shrunk, note it in the shrinks array and set up for - another pass. */ - if (shrink != shrinks[i]) - { - another_pass = 1; - for (j = i + 1; j <= reloc_count; j++) - shrinks[j] += shrink - shrinks[i]; - } - } - } + do + { + arelent **parent; + unsigned int i; + long j; + + another_pass = 0; + + 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. */ + shrink = bfd_coff_reloc16_estimate (abfd, input_section, *parent, + shrinks[i], link_info); + + /* If it shrunk, note it in the shrinks array and set up for + another pass. */ + if (shrink != shrinks[i]) + { + another_pass = 1; + for (j = i + 1; j <= reloc_count; j++) + shrinks[j] += shrink - shrinks[i]; + } + } + } while (another_pass); shrink = shrinks[reloc_count]; @@ -231,21 +232,21 @@ bfd_coff_reloc16_relax_section (abfd, input_section, link_info, again) input_section->_cooked_size -= shrink; free ((char *) reloc_vector); - return true; + return TRUE; } bfd_byte * -bfd_coff_reloc16_get_relocated_section_contents(in_abfd, - link_info, - link_order, - data, - relocateable, - symbols) +bfd_coff_reloc16_get_relocated_section_contents (in_abfd, + link_info, + link_order, + data, + relocatable, + symbols) bfd *in_abfd; struct bfd_link_info *link_info; struct bfd_link_order *link_order; bfd_byte *data; - boolean relocateable; + bfd_boolean relocatable; asymbol **symbols; { /* Get enough memory to hold the stuff. */ @@ -258,19 +259,19 @@ bfd_coff_reloc16_get_relocated_section_contents(in_abfd, if (reloc_size < 0) return NULL; - /* If producing relocateable output, don't bother to relax. */ - if (relocateable) + /* If producing relocatable output, don't bother to relax. */ + if (relocatable) return bfd_generic_get_relocated_section_contents (in_abfd, link_info, link_order, - data, relocateable, + data, relocatable, symbols); /* Read in the section. */ - if (!bfd_get_section_contents(input_bfd, - input_section, - data, - (bfd_vma) 0, - input_section->_raw_size)) + if (!bfd_get_section_contents (input_bfd, + input_section, + data, + (bfd_vma) 0, + input_section->_raw_size)) return NULL; reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); diff --git a/contrib/binutils/bfd/rs6000-core.c b/contrib/binutils/bfd/rs6000-core.c index a61f25c..3fa0975 100644 --- a/contrib/binutils/bfd/rs6000-core.c +++ b/contrib/binutils/bfd/rs6000-core.c @@ -253,19 +253,19 @@ typedef union { /* Try to read into CORE the header from the core file associated with ABFD. Return success. */ -static boolean +static bfd_boolean read_hdr (bfd *abfd, CoreHdr *core) { bfd_size_type size; if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) - return false; + return FALSE; /* Read the leading portion that old and new core dump structures have in common. */ size = CORE_COMMONSZ; if (bfd_bread (core, size, abfd) != size) - return false; + return FALSE; /* Read the trailing portion of the structure. */ if (CORE_NEW (*core)) @@ -630,9 +630,9 @@ rs6000coff_core_p (abfd) return NULL; } -/* Return `true' if given core is from the given executable. */ +/* Return `TRUE' if given core is from the given executable. */ -boolean +bfd_boolean rs6000coff_core_file_matches_executable_p (core_bfd, exec_bfd) bfd *core_bfd; bfd *exec_bfd; @@ -642,11 +642,11 @@ rs6000coff_core_file_matches_executable_p (core_bfd, exec_bfd) char *path, *s; size_t alloc; const char *str1, *str2; - boolean ret; + bfd_boolean ret; file_ptr c_loader; if (!read_hdr (core_bfd, &core)) - return false; + return FALSE; if (CORE_NEW (core)) c_loader = CNEW_LOADER (core.new); @@ -659,12 +659,12 @@ rs6000coff_core_file_matches_executable_p (core_bfd, exec_bfd) size = (int) ((LdInfo *) 0)->l32.ldinfo_filename; if (bfd_seek (core_bfd, c_loader + size, SEEK_SET) != 0) - return false; + return FALSE; alloc = 100; path = bfd_malloc ((bfd_size_type) alloc); if (path == NULL) - return false; + return FALSE; s = path; while (1) @@ -672,7 +672,7 @@ rs6000coff_core_file_matches_executable_p (core_bfd, exec_bfd) if (bfd_bread (s, (bfd_size_type) 1, core_bfd) != 1) { free (path); - return false; + return FALSE; } if (*s == '\0') break; @@ -686,7 +686,7 @@ rs6000coff_core_file_matches_executable_p (core_bfd, exec_bfd) if (n == NULL) { free (path); - return false; + return FALSE; } s = n + (path - s); path = n; @@ -701,9 +701,9 @@ rs6000coff_core_file_matches_executable_p (core_bfd, exec_bfd) str2 = str2 != NULL ? str2 + 1 : exec_bfd->filename; if (strcmp (str1, str2) == 0) - ret = true; + ret = TRUE; else - ret = false; + ret = FALSE; free (path); diff --git a/contrib/binutils/bfd/sco5-core.c b/contrib/binutils/bfd/sco5-core.c index 9f5b793..5c34ff1 100644 --- a/contrib/binutils/bfd/sco5-core.c +++ b/contrib/binutils/bfd/sco5-core.c @@ -1,5 +1,6 @@ /* BFD back end for SCO5 core files (U-area and raw sections) - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Free Software Foundation, Inc. Written by Jouke Numan This file is part of BFD, the Binary File Descriptor library. @@ -21,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" #include "libbfd.h" -#include "libaout.h" /* BFD a.out internal data structures */ +#include "libaout.h" /* BFD a.out internal data structures */ #include #include @@ -29,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include -#include /* After a.out.h */ +#include /* After a.out.h */ #include #include @@ -40,15 +41,14 @@ struct sco5_core_struct /* forward declarations */ -static asection * -make_bfd_asection PARAMS ((bfd *, const char *, flagword, bfd_size_type, - bfd_vma, file_ptr)); +static asection *make_bfd_asection + PARAMS ((bfd *, const char *, flagword, bfd_size_type, bfd_vma, file_ptr)); static struct user *read_uarea PARAMS ((bfd *, int)); const bfd_target *sco5_core_file_p PARAMS ((bfd *abfd)); char *sco5_core_file_failing_command PARAMS ((bfd *abfd)); int sco5_core_file_failing_signal PARAMS ((bfd *abfd)); -boolean sco5_core_file_matches_executable_p PARAMS ((bfd *core_bfd, - bfd *exec_bfd)); +bfd_boolean sco5_core_file_matches_executable_p + PARAMS ((bfd *core_bfd, bfd *exec_bfd)); static void swap_abort PARAMS ((void)); static asection * @@ -111,7 +111,6 @@ read_uarea(abfd, filepos) return &rawptr->u; } -/* ARGSUSED */ const bfd_target * sco5_core_file_p (abfd) bfd *abfd; @@ -133,8 +132,8 @@ sco5_core_file_p (abfd) return NULL; if (fstat (fileno (stream), &statbuf) < 0) { - bfd_set_error (bfd_error_system_call); - return NULL; + bfd_set_error (bfd_error_system_call); + return NULL; } coresize = statbuf.st_size; } @@ -168,24 +167,24 @@ sco5_core_file_p (abfd) goto fail; if (!make_bfd_asection (abfd, ".reg", SEC_HAS_CONTENTS, - (bfd_size_type) coffsets.u_usize, - 0 - (bfd_vma) u->u_ar0, - (file_ptr) coffsets.u_user)) + (bfd_size_type) coffsets.u_usize, + 0 - (bfd_vma) u->u_ar0, + (file_ptr) coffsets.u_user)) goto fail; if (!make_bfd_asection (abfd, ".data", SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS, - ((bfd_size_type) u->u_exdata.ux_dsize + ((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)) + (bfd_vma) u->u_exdata.ux_datorg, + (file_ptr) coffsets.u_data)) goto fail; if (!make_bfd_asection (abfd, ".stack", SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS, - (bfd_size_type) u->u_ssize * NBPC, - (bfd_vma) u->u_sub, - (file_ptr) coffsets.u_stack)) + (bfd_size_type) u->u_ssize * NBPC, + (bfd_vma) u->u_sub, + (file_ptr) coffsets.u_stack)) goto fail; return abfd->xvec; /* Done for version 1 */ @@ -222,10 +221,10 @@ sco5_core_file_p (abfd) if ((bfd_seek (abfd, (file_ptr) chead.cs_hseek, SEEK_SET) != 0) || (bfd_bread ((void *) &chead, (bfd_size_type) sizeof chead, abfd) != sizeof chead)) - { - bfd_set_error (bfd_error_wrong_format); + { + bfd_set_error (bfd_error_wrong_format); goto fail; - } + } switch (chead.cs_stype) { @@ -243,7 +242,7 @@ sco5_core_file_p (abfd) if (! u) goto fail; - /* This is tricky. As the "register section", we give them + /* This is tricky. As the "register section", we give them the entire upage and stack. u.u_ar0 points to where "register 0" is stored. There are two tricks with this, though. One is that the rest of the registers might be @@ -263,33 +262,33 @@ sco5_core_file_p (abfd) chead.cs_vaddr = 0 - (bfd_vma) u->u_ar0; - secname = ".reg"; - flags = SEC_HAS_CONTENTS; + secname = ".reg"; + flags = SEC_HAS_CONTENTS; - break; + break; case CORES_PREGION: /* A program region, map it */ switch (chead.cs_x.csx_preg.csxp_rtyp) { case PT_DATA: - secname = ".data"; /* Data region. */ + secname = ".data"; /* Data region. */ break; case PT_STACK: - secname = ".stack"; /* Stack region. */ + secname = ".stack"; /* Stack region. */ break; case PT_SHMEM: - secname = ".shmem"; /* Shared memory */ + secname = ".shmem"; /* Shared memory */ break; case PT_LIBDAT: - secname = ".libdat"; /* Shared library data */ + secname = ".libdat"; /* Shared library data */ break; case PT_V86: - secname = ".virt86"; /* Virtual 8086 mode */ + secname = ".virt86"; /* Virtual 8086 mode */ break; case PT_SHFIL: - secname = ".mmfile"; /* Memory mapped file */ + secname = ".mmfile"; /* Memory mapped file */ break; case PT_XDATA0: - secname = ".Xdat0"; /* XENIX data region, virtual 0 */ + secname = ".Xdat0"; /* XENIX data region, virtual 0 */ break; default: secname = ""; @@ -301,11 +300,11 @@ sco5_core_file_p (abfd) case CORES_SCOUTSNAME: /* struct scoutsname */ secname = NULL; /* Ignore these */ break; - default: - (*_bfd_error_handler) ("Unhandled SCO core file section type %d\n", - chead.cs_stype); - continue; - } + default: + (*_bfd_error_handler) ("Unhandled SCO core file section type %d\n", + chead.cs_stype); + continue; + } if (secname && !make_bfd_asection (abfd, secname, flags, @@ -339,7 +338,6 @@ sco5_core_file_failing_command (abfd) return NULL; } -/* ARGSUSED */ int sco5_core_file_failing_signal (ignore_abfd) bfd *ignore_abfd; @@ -349,13 +347,12 @@ sco5_core_file_failing_signal (ignore_abfd) : -1); } -/* ARGSUSED */ -boolean +bfd_boolean sco5_core_file_matches_executable_p (core_bfd, exec_bfd) bfd *core_bfd ATTRIBUTE_UNUSED; bfd *exec_bfd ATTRIBUTE_UNUSED; { - return true; /* FIXME, We have no way of telling at this point */ + return TRUE; /* FIXME, We have no way of telling at this point */ } /* If somebody calls any byte-swapping routines, shoot them. */ @@ -364,44 +361,47 @@ swap_abort () { 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 ) -#define NO_SIGNED_GET \ - ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort ) + +#define NO_GET ((bfd_vma (*) (const void *)) swap_abort) +#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort) +#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort) +#define NO_GET64 ((bfd_uint64_t (*) (const void *)) swap_abort) +#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort) +#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort) const bfd_target sco5_core_vec = { "sco5-core", bfd_target_unknown_flavour, - BFD_ENDIAN_LITTLE, /* target byte order */ - BFD_ENDIAN_LITTLE, /* target headers byte order */ - (HAS_RELOC | EXEC_P | /* object flags */ + BFD_ENDIAN_LITTLE, /* target byte order */ + BFD_ENDIAN_LITTLE, /* target headers byte order */ + (HAS_RELOC | EXEC_P | /* object flags */ HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - 0, /* symbol prefix */ - ' ', /* ar_pad_char */ - 16, /* ar_max_namelen */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs */ - - { /* bfd_check_format */ - _bfd_dummy_target, /* unknown format */ - _bfd_dummy_target, /* object file */ - _bfd_dummy_target, /* archive */ - sco5_core_file_p /* a core file */ + 0, /* symbol prefix */ + ' ', /* ar_pad_char */ + 16, /* ar_max_namelen */ + NO_GET64, NO_GETS64, NO_PUT64, /* 64 bit data */ + NO_GET, NO_GETS, NO_PUT, /* 32 bit data */ + NO_GET, NO_GETS, NO_PUT, /* 16 bit data */ + NO_GET64, NO_GETS64, NO_PUT64, /* 64 bit hdrs */ + NO_GET, NO_GETS, NO_PUT, /* 32 bit hdrs */ + NO_GET, NO_GETS, NO_PUT, /* 16 bit hdrs */ + + { /* bfd_check_format */ + _bfd_dummy_target, /* unknown format */ + _bfd_dummy_target, /* object file */ + _bfd_dummy_target, /* archive */ + sco5_core_file_p /* a core file */ }, - { /* bfd_set_format */ - bfd_false, bfd_false, - bfd_false, bfd_false + { /* bfd_set_format */ + bfd_false, bfd_false, + bfd_false, bfd_false }, - { /* bfd_write_contents */ - bfd_false, bfd_false, - bfd_false, bfd_false + { /* bfd_write_contents */ + bfd_false, bfd_false, + bfd_false, bfd_false }, BFD_JUMP_TABLE_GENERIC (_bfd_generic), @@ -416,5 +416,5 @@ const bfd_target sco5_core_vec = NULL, - (PTR) 0 /* backend_data */ -}; + (PTR) 0 /* backend_data */ + }; diff --git a/contrib/binutils/bfd/section.c b/contrib/binutils/bfd/section.c index b5871e9..fce8e1e 100644 --- a/contrib/binutils/bfd/section.c +++ b/contrib/binutils/bfd/section.c @@ -1,6 +1,6 @@ /* Object file "section" support for the BFD library. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. @@ -166,7 +166,7 @@ CODE_FRAGMENT . long symbol; .}; . -.typedef struct sec +.typedef struct bfd_section .{ . {* The name of the section; the name isn't a copy, the pointer is . the same as that passed to bfd_make_section. *} @@ -179,7 +179,7 @@ CODE_FRAGMENT . int index; . . {* The next section in the list belonging to the BFD, or NULL. *} -. struct sec *next; +. struct bfd_section *next; . . {* The field flags contains attributes of the section. Some . flags are read in from the object file, and some are @@ -377,10 +377,39 @@ CODE_FRAGMENT . {* A mark flag used by some linker backends for garbage collection. *} . unsigned int gc_mark : 1; . -. {* Used by the ELF code to mark sections which have been allocated -. to segments. *} +. {* The following flags are used by the ELF linker. *} +. +. {* Mark sections which have been allocated to segments. *} . unsigned int segment_mark : 1; . +. {* Type of sec_info information. *} +. unsigned int sec_info_type:3; +.#define ELF_INFO_TYPE_NONE 0 +.#define ELF_INFO_TYPE_STABS 1 +.#define ELF_INFO_TYPE_MERGE 2 +.#define ELF_INFO_TYPE_EH_FRAME 3 +.#define ELF_INFO_TYPE_JUST_SYMS 4 +. +. {* Nonzero if this section uses RELA relocations, rather than REL. *} +. unsigned int use_rela_p:1; +. +. {* Bits used by various backends. *} +. unsigned int has_tls_reloc:1; +. +. {* Nonzero if this section needs the relax finalize pass. *} +. unsigned int need_finalize_relax:1; +. +. {* Nonzero if this section has a gp reloc. *} +. unsigned int has_gp_reloc:1; +. +. {* Unused bits. *} +. unsigned int flag13:1; +. unsigned int flag14:1; +. unsigned int flag15:1; +. unsigned int flag16:4; +. unsigned int flag20:4; +. unsigned int flag24:8; +. . {* End of internal packed boolean fields. *} . . {* The virtual memory address of the section - where it will be @@ -416,7 +445,7 @@ CODE_FRAGMENT . bfd_vma output_offset; . . {* The output section through which to map on output. *} -. struct sec *output_section; +. struct bfd_section *output_section; . . {* The alignment requirement of the section, as an exponent of 2 - . e.g., 3 aligns to 2^3 (or 8). *} @@ -446,7 +475,7 @@ CODE_FRAGMENT . file_ptr line_filepos; . . {* Pointer to data for applications. *} -. PTR userdata; +. void *userdata; . . {* If the SEC_IN_MEMORY flag is set, this points to the actual . contents. *} @@ -464,6 +493,10 @@ CODE_FRAGMENT . {* Optional information about a COMDAT entry; NULL if not COMDAT. *} . struct bfd_comdat_info *comdat; . +. {* Points to the kept section if this section is a link-once section, +. and is discarded. *} +. struct bfd_section *kept_section; +. . {* When a section is being output, this value changes as more . linenumbers are written out. *} . file_ptr moving_line_filepos; @@ -471,7 +504,7 @@ CODE_FRAGMENT . {* What the section number is in the target world. *} . int target_index; . -. PTR used_by_bfd; +. void *used_by_bfd; . . {* If this is a constructor section then here is a list of the . relocations created to relocate items within it. *} @@ -481,8 +514,8 @@ CODE_FRAGMENT . bfd *owner; . . {* A symbol which points at this section only. *} -. struct symbol_cache_entry *symbol; -. struct symbol_cache_entry **symbol_ptr_ptr; +. struct bfd_symbol *symbol; +. struct bfd_symbol **symbol_ptr_ptr; . . struct bfd_link_order *link_order_head; . struct bfd_link_order *link_order_tail; @@ -499,18 +532,18 @@ CODE_FRAGMENT .#define BFD_IND_SECTION_NAME "*IND*" . .{* The absolute section. *} -.extern const asection bfd_abs_section; +.extern 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. *} -.extern const asection bfd_und_section; +.extern 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. *} -.extern const asection bfd_com_section; +.extern asection bfd_com_section; .#define bfd_com_section_ptr ((asection *) &bfd_com_section) .{* Pointer to the indirect section. *} -.extern const asection bfd_ind_section; +.extern asection bfd_ind_section; .#define bfd_ind_section_ptr ((asection *) &bfd_ind_section) .#define bfd_is_ind_section(sec) ((sec) == bfd_ind_section_ptr) . @@ -520,13 +553,12 @@ CODE_FRAGMENT . || ((SEC) == bfd_com_section_ptr) \ . || ((SEC) == bfd_ind_section_ptr)) . -.extern const struct symbol_cache_entry * const bfd_abs_symbol; -.extern const struct symbol_cache_entry * const bfd_com_symbol; -.extern const struct symbol_cache_entry * const bfd_und_symbol; -.extern const struct symbol_cache_entry * const bfd_ind_symbol; +.extern const struct bfd_symbol * const bfd_abs_symbol; +.extern const struct bfd_symbol * const bfd_com_symbol; +.extern const struct bfd_symbol * const bfd_und_symbol; +.extern const struct bfd_symbol * const bfd_ind_symbol; .#define bfd_get_section_size_before_reloc(section) \ -. ((section)->reloc_done ? (abort (), (bfd_size_type) 1) \ -. : (section)->_raw_size) +. ((section)->_raw_size) .#define bfd_get_section_size_after_reloc(section) \ . ((section)->reloc_done ? (section)->_cooked_size \ . : (abort (), (bfd_size_type) 1)) @@ -583,18 +615,27 @@ static const asymbol global_syms[] = #define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ const asymbol * const SYM = (asymbol *) &global_syms[IDX]; \ - const asection SEC = \ + asection SEC = \ /* name, id, index, next, flags, user_set_vma, reloc_done, */ \ { NAME, IDX, 0, NULL, FLAGS, 0, 0, \ \ /* linker_mark, linker_has_input, gc_mark, segment_mark, */ \ 0, 0, 1, 0, \ \ + /* sec_info_type, use_rela_p, has_tls_reloc, */ \ + 0, 0, 0, \ + \ + /* need_finalize_relax, has_gp_reloc, */ \ + 0, 0, \ + \ + /* flag13, flag14, flag15, flag16, flag20, flag24, */ \ + 0, 0, 0, 0, 0, 0, \ + \ /* vma, lma, _cooked_size, _raw_size, */ \ 0, 0, 0, 0, \ \ /* output_offset, output_section, alignment_power, */ \ - 0, (struct sec *) &SEC, 0, \ + 0, (struct bfd_section *) &SEC, 0, \ \ /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \ NULL, NULL, 0, 0, 0, \ @@ -602,17 +643,17 @@ static const asymbol global_syms[] = /* line_filepos, userdata, contents, lineno, lineno_count, */ \ 0, NULL, NULL, NULL, 0, \ \ - /* entsize, comdat, moving_line_filepos, */ \ - 0, NULL, 0, \ + /* entsize, comdat, kept_section, moving_line_filepos, */ \ + 0, NULL, NULL, 0, \ \ /* target_index, used_by_bfd, constructor_chain, owner, */ \ 0, NULL, NULL, NULL, \ \ /* symbol, */ \ - (struct symbol_cache_entry *) &global_syms[IDX], \ + (struct bfd_symbol *) &global_syms[IDX], \ \ /* symbol_ptr_ptr, */ \ - (struct symbol_cache_entry **) &SYM, \ + (struct bfd_symbol **) &SYM, \ \ /* link_order_head, link_order_tail */ \ NULL, NULL \ @@ -634,10 +675,9 @@ struct section_hash_entry /* Initialize an entry in the section hash table. */ struct bfd_hash_entry * -bfd_section_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +bfd_section_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, + const char *string) { /* Allocate the structure if it has not already been allocated by a subclass. */ @@ -652,10 +692,8 @@ bfd_section_hash_newfunc (entry, table, string) /* Call the allocation method of the superclass. */ entry = bfd_hash_newfunc (entry, table, string); if (entry != NULL) - { - memset ((PTR) &((struct section_hash_entry *) entry)->section, - 0, sizeof (asection)); - } + memset (&((struct section_hash_entry *) entry)->section, 0, + sizeof (asection)); return entry; } @@ -666,12 +704,8 @@ bfd_section_hash_newfunc (entry, table, string) /* Initializes a new section. NEWSECT->NAME is already set. */ -static asection *bfd_section_init PARAMS ((bfd *, asection *)); - static asection * -bfd_section_init (abfd, newsect) - bfd *abfd; - asection *newsect; +bfd_section_init (bfd *abfd, asection *newsect) { static int section_id = 0x10; /* id 0 to 3 used by STD_SECTION. */ @@ -726,13 +760,12 @@ DESCRIPTION */ void -bfd_section_list_clear (abfd) - bfd *abfd; +bfd_section_list_clear (bfd *abfd) { abfd->sections = NULL; abfd->section_tail = &abfd->sections; abfd->section_count = 0; - memset ((PTR) abfd->section_htab.table, 0, + memset (abfd->section_htab.table, 0, abfd->section_htab.size * sizeof (struct bfd_hash_entry *)); } @@ -741,7 +774,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 @@ -755,13 +788,11 @@ DESCRIPTION */ asection * -bfd_get_section_by_name (abfd, name) - bfd *abfd; - const char *name; +bfd_get_section_by_name (bfd *abfd, const char *name) { struct section_hash_entry *sh; - sh = section_hash_lookup (&abfd->section_htab, name, false, false); + sh = section_hash_lookup (&abfd->section_htab, name, FALSE, FALSE); if (sh != NULL) return &sh->section; @@ -773,9 +804,8 @@ FUNCTION bfd_get_unique_section_name SYNOPSIS - char *bfd_get_unique_section_name(bfd *abfd, - const char *templat, - int *count); + 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 @@ -786,17 +816,14 @@ DESCRIPTION */ char * -bfd_get_unique_section_name (abfd, templat, count) - bfd *abfd; - const char *templat; - int *count; +bfd_get_unique_section_name (bfd *abfd, const char *templat, int *count) { int num; unsigned int len; char *sname; len = strlen (templat); - sname = bfd_malloc ((bfd_size_type) len + 8); + sname = bfd_malloc (len + 8); if (sname == NULL) return NULL; memcpy (sname, templat, len); @@ -811,7 +838,7 @@ bfd_get_unique_section_name (abfd, templat, count) abort (); sprintf (sname + len, ".%d", num++); } - while (section_hash_lookup (&abfd->section_htab, sname, false, false)); + while (section_hash_lookup (&abfd->section_htab, sname, FALSE, FALSE)); if (count != NULL) *count = num; @@ -823,7 +850,7 @@ 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} @@ -844,9 +871,7 @@ DESCRIPTION */ asection * -bfd_make_section_old_way (abfd, name) - bfd *abfd; - const char *name; +bfd_make_section_old_way (bfd *abfd, const char *name) { struct section_hash_entry *sh; asection *newsect; @@ -869,7 +894,7 @@ bfd_make_section_old_way (abfd, name) if (strcmp (name, BFD_IND_SECTION_NAME) == 0) return bfd_ind_section_ptr; - sh = section_hash_lookup (&abfd->section_htab, name, true, false); + sh = section_hash_lookup (&abfd->section_htab, name, TRUE, FALSE); if (sh == NULL) return NULL; @@ -889,7 +914,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 @@ -902,9 +927,7 @@ DESCRIPTION */ sec_ptr -bfd_make_section_anyway (abfd, name) - bfd *abfd; - const char *name; +bfd_make_section_anyway (bfd *abfd, const char *name) { struct section_hash_entry *sh; asection *newsect; @@ -915,7 +938,7 @@ bfd_make_section_anyway (abfd, name) return NULL; } - sh = section_hash_lookup (&abfd->section_htab, name, true, false); + sh = section_hash_lookup (&abfd->section_htab, name, TRUE, FALSE); if (sh == NULL) return NULL; @@ -926,7 +949,7 @@ bfd_make_section_anyway (abfd, name) section_htab without generating a unique section name and that would be pointless; We don't need to traverse the hash table. */ - newsect = (asection *) bfd_zalloc (abfd, sizeof (asection)); + newsect = bfd_zalloc (abfd, sizeof (asection)); if (newsect == NULL) return NULL; } @@ -940,7 +963,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 @@ -950,9 +973,7 @@ DESCRIPTION */ asection * -bfd_make_section (abfd, name) - bfd *abfd; - const char *name; +bfd_make_section (bfd *abfd, const char *name) { struct section_hash_entry *sh; asection *newsect; @@ -969,7 +990,7 @@ bfd_make_section (abfd, name) || strcmp (name, BFD_IND_SECTION_NAME) == 0) return NULL; - sh = section_hash_lookup (&abfd->section_htab, name, true, false); + sh = section_hash_lookup (&abfd->section_htab, name, TRUE, FALSE); if (sh == NULL) return NULL; @@ -977,7 +998,7 @@ bfd_make_section (abfd, name) if (newsect->name != NULL) { /* Section already exists. */ - return newsect; + return NULL; } newsect->name = name; @@ -989,12 +1010,13 @@ FUNCTION bfd_set_section_flags SYNOPSIS - boolean bfd_set_section_flags(bfd *abfd, asection *sec, flagword flags); + bfd_boolean bfd_set_section_flags + (bfd *abfd, asection *sec, flagword flags); DESCRIPTION Set the attributes of the section @var{sec} in the BFD - @var{abfd} to the value @var{flags}. Return <> on success, - <> on error. Possible error returns are: + @var{abfd} to the value @var{flags}. Return <> on success, + <> on error. Possible error returns are: o <> - The section cannot have one or more of the attributes @@ -1003,12 +1025,10 @@ DESCRIPTION */ -/*ARGSUSED*/ -boolean -bfd_set_section_flags (abfd, section, flags) - bfd *abfd ATTRIBUTE_UNUSED; - sec_ptr section; - flagword flags; +bfd_boolean +bfd_set_section_flags (bfd *abfd ATTRIBUTE_UNUSED, + sec_ptr section, + flagword flags) { #if 0 /* If you try to copy a text section from an input file (where it @@ -1019,12 +1039,12 @@ bfd_set_section_flags (abfd, section, flags) if ((flags & bfd_applicable_section_flags (abfd)) != flags) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } #endif section->flags = flags; - return true; + return TRUE; } /* @@ -1032,34 +1052,31 @@ FUNCTION bfd_map_over_sections SYNOPSIS - void bfd_map_over_sections(bfd *abfd, - void (*func) (bfd *abfd, - asection *sect, - PTR obj), - PTR obj); + void bfd_map_over_sections + (bfd *abfd, + void (*func) (bfd *abfd, asection *sect, void *obj), + void *obj); DESCRIPTION Call the provided function @var{func} for each section attached to the BFD @var{abfd}, passing @var{obj} as an argument. The function will be called as if by -| func(abfd, the_section, obj); +| func (abfd, the_section, obj); - This is the prefered method for iterating over sections; an + This is the preferred method for iterating over sections; an alternative would be to use a loop: | section *p; | for (p = abfd->sections; p != NULL; p = p->next) -| func(abfd, p, ...) +| func (abfd, p, ...) */ -/*VARARGS2*/ void -bfd_map_over_sections (abfd, operation, user_storage) - bfd *abfd; - void (*operation) PARAMS ((bfd * abfd, asection * sect, PTR obj)); - PTR user_storage; +bfd_map_over_sections (bfd *abfd, + void (*operation) (bfd *, asection *, void *), + void *user_storage) { asection *sect; unsigned int i = 0; @@ -1076,11 +1093,12 @@ FUNCTION bfd_set_section_size SYNOPSIS - boolean bfd_set_section_size(bfd *abfd, asection *sec, bfd_size_type val); + bfd_boolean bfd_set_section_size + (bfd *abfd, asection *sec, bfd_size_type val); DESCRIPTION Set @var{sec} to the size @var{val}. If the operation is - ok, then <> is returned, else <>. + ok, then <> is returned, else <>. Possible error returns: o <> - @@ -1088,11 +1106,8 @@ DESCRIPTION */ -boolean -bfd_set_section_size (abfd, ptr, val) - bfd *abfd; - sec_ptr ptr; - bfd_size_type val; +bfd_boolean +bfd_set_section_size (bfd *abfd, sec_ptr ptr, bfd_size_type val) { /* Once you've started writing to any section you cannot create or change the size of any others. */ @@ -1100,13 +1115,13 @@ bfd_set_section_size (abfd, ptr, val) if (abfd->output_has_begun) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } ptr->_cooked_size = val; ptr->_raw_size = val; - return true; + return TRUE; } /* @@ -1114,9 +1129,9 @@ FUNCTION bfd_set_section_contents SYNOPSIS - boolean bfd_set_section_contents (bfd *abfd, asection *section, - PTR data, file_ptr offset, - bfd_size_type count); + bfd_boolean bfd_set_section_contents + (bfd *abfd, asection *section, const void *data, + file_ptr offset, bfd_size_type count); DESCRIPTION Sets the contents of the section @var{section} in BFD @@ -1124,7 +1139,7 @@ DESCRIPTION data is written to the output section starting at offset @var{offset} for @var{count} octets. - Normally <> is returned, else <>. Possible error + Normally <> is returned, else <>. Possible error returns are: o <> - The output section does not have the <> @@ -1136,25 +1151,24 @@ DESCRIPTION */ -#define bfd_get_section_size_now(abfd,sec) \ -(sec->reloc_done \ - ? bfd_get_section_size_after_reloc (sec) \ - : bfd_get_section_size_before_reloc (sec)) - -boolean -bfd_set_section_contents (abfd, section, location, offset, count) - bfd *abfd; - sec_ptr section; - PTR location; - file_ptr offset; - bfd_size_type count; +#define bfd_get_section_size_now(abfd, sec) \ + (sec->reloc_done \ + ? bfd_get_section_size_after_reloc (sec) \ + : bfd_get_section_size_before_reloc (sec)) + +bfd_boolean +bfd_set_section_contents (bfd *abfd, + sec_ptr section, + const void *location, + file_ptr offset, + bfd_size_type count) { bfd_size_type sz; if (!(bfd_get_section_flags (abfd, section) & SEC_HAS_CONTENTS)) { bfd_set_error (bfd_error_no_contents); - return (false); + return FALSE; } sz = bfd_get_section_size_now (abfd, section); @@ -1164,7 +1178,7 @@ bfd_set_section_contents (abfd, section, location, offset, count) || count != (size_t) count) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } switch (abfd->direction) @@ -1172,7 +1186,7 @@ bfd_set_section_contents (abfd, section, location, offset, count) case read_direction: case no_direction: bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; case write_direction: break; @@ -1181,23 +1195,23 @@ bfd_set_section_contents (abfd, section, location, offset, count) /* File is opened for update. `output_has_begun' some time ago when the file was created. Do not recompute sections sizes or alignments in _bfd_set_section_content. */ - abfd->output_has_begun = true; + abfd->output_has_begun = TRUE; break; } /* Record a copy of the data in memory if desired. */ if (section->contents - && location != (PTR) (section->contents + offset)) + && location != section->contents + offset) memcpy (section->contents + offset, location, (size_t) count); if (BFD_SEND (abfd, _bfd_set_section_contents, (abfd, section, location, offset, count))) { - abfd->output_has_begun = true; - return true; + abfd->output_has_begun = TRUE; + return TRUE; } - return false; + return FALSE; } /* @@ -1205,9 +1219,9 @@ FUNCTION bfd_get_section_contents SYNOPSIS - boolean bfd_get_section_contents (bfd *abfd, asection *section, - PTR location, file_ptr offset, - bfd_size_type count); + bfd_boolean bfd_get_section_contents + (bfd *abfd, asection *section, void *location, file_ptr offset, + bfd_size_type count); DESCRIPTION Read data from @var{section} in BFD @var{abfd} @@ -1218,27 +1232,26 @@ DESCRIPTION If the contents of a constructor with the <> flag set are requested or if the section does not have the <> flag set, then the @var{location} is filled - with zeroes. If no errors occur, <> is returned, else - <>. + with zeroes. If no errors occur, <> is returned, else + <>. */ -boolean -bfd_get_section_contents (abfd, section, location, offset, count) - bfd *abfd; - sec_ptr section; - PTR location; - file_ptr offset; - bfd_size_type count; +bfd_boolean +bfd_get_section_contents (bfd *abfd, + sec_ptr section, + void *location, + file_ptr offset, + bfd_size_type count) { bfd_size_type sz; if (section->flags & SEC_CONSTRUCTOR) { memset (location, 0, (size_t) count); - return true; + return TRUE; } - /* Even if reloc_done is true, this function reads unrelocated + /* Even if reloc_done is TRUE, this function reads unrelocated contents, so we want the raw size. */ sz = section->_raw_size; if ((bfd_size_type) offset > sz @@ -1247,23 +1260,23 @@ bfd_get_section_contents (abfd, section, location, offset, count) || count != (size_t) count) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } if (count == 0) /* Don't bother. */ - return true; + return TRUE; if ((section->flags & SEC_HAS_CONTENTS) == 0) { memset (location, 0, (size_t) count); - return true; + return TRUE; } if ((section->flags & SEC_IN_MEMORY) != 0) { memcpy (location, section->contents + offset, (size_t) count); - return true; + return TRUE; } return BFD_SEND (abfd, _bfd_get_section_contents, @@ -1275,13 +1288,13 @@ FUNCTION bfd_copy_private_section_data SYNOPSIS - boolean bfd_copy_private_section_data (bfd *ibfd, asection *isec, - bfd *obfd, asection *osec); + bfd_boolean bfd_copy_private_section_data + (bfd *ibfd, asection *isec, bfd *obfd, asection *osec); DESCRIPTION Copy private section information from @var{isec} in the BFD @var{ibfd} to the section @var{osec} in the BFD @var{obfd}. - Return <> on success, <> on error. Possible error + Return <> on success, <> on error. Possible error returns are: o <> - @@ -1298,7 +1311,7 @@ FUNCTION SYNOPSIS void _bfd_strip_section_from_output - (struct bfd_link_info *info, asection *section); + (struct bfd_link_info *info, asection *section); DESCRIPTION Remove @var{section} from the output. If the output section @@ -1309,9 +1322,7 @@ DESCRIPTION to remove sections. */ void -_bfd_strip_section_from_output (info, s) - struct bfd_link_info *info; - asection *s; +_bfd_strip_section_from_output (struct bfd_link_info *info, asection *s) { asection *os; asection *is; @@ -1343,16 +1354,15 @@ FUNCTION bfd_generic_discard_group SYNOPSIS - boolean bfd_generic_discard_group (bfd *abfd, asection *group); + bfd_boolean bfd_generic_discard_group (bfd *abfd, asection *group); DESCRIPTION Remove all members of @var{group} from the output. */ -boolean -bfd_generic_discard_group (abfd, group) - bfd *abfd ATTRIBUTE_UNUSED; - asection *group ATTRIBUTE_UNUSED; +bfd_boolean +bfd_generic_discard_group (bfd *abfd ATTRIBUTE_UNUSED, + asection *group ATTRIBUTE_UNUSED) { - return true; + return TRUE; } diff --git a/contrib/binutils/bfd/simple.c b/contrib/binutils/bfd/simple.c new file mode 100644 index 0000000..fc2472e --- /dev/null +++ b/contrib/binutils/bfd/simple.c @@ -0,0 +1,257 @@ +/* simple.c -- BFD simple client routines + Copyright 2002, 2003, 2004 + Free Software Foundation, Inc. + Contributed by MontaVista Software, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "bfdlink.h" + +static bfd_boolean +simple_dummy_warning (struct bfd_link_info *link_info ATTRIBUTE_UNUSED, + const char *warning ATTRIBUTE_UNUSED, + const char *symbol ATTRIBUTE_UNUSED, + bfd *abfd ATTRIBUTE_UNUSED, + asection *section ATTRIBUTE_UNUSED, + bfd_vma address ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +static bfd_boolean +simple_dummy_undefined_symbol (struct bfd_link_info *link_info ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED, + bfd *abfd ATTRIBUTE_UNUSED, + asection *section ATTRIBUTE_UNUSED, + bfd_vma address ATTRIBUTE_UNUSED, + bfd_boolean fatal ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +static bfd_boolean +simple_dummy_reloc_overflow (struct bfd_link_info *link_info ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED, + const char *reloc_name ATTRIBUTE_UNUSED, + bfd_vma addend ATTRIBUTE_UNUSED, + bfd *abfd ATTRIBUTE_UNUSED, + asection *section ATTRIBUTE_UNUSED, + bfd_vma address ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +static bfd_boolean +simple_dummy_reloc_dangerous (struct bfd_link_info *link_info ATTRIBUTE_UNUSED, + const char *message ATTRIBUTE_UNUSED, + bfd *abfd ATTRIBUTE_UNUSED, + asection *section ATTRIBUTE_UNUSED, + bfd_vma address ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +static bfd_boolean +simple_dummy_unattached_reloc (struct bfd_link_info *link_info ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED, + bfd *abfd ATTRIBUTE_UNUSED, + asection *section ATTRIBUTE_UNUSED, + bfd_vma address ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +struct saved_output_info +{ + bfd_vma offset; + asection *section; +}; + +static void +simple_save_output_info (bfd *abfd ATTRIBUTE_UNUSED, + asection *section, + void *ptr) +{ + struct saved_output_info *output_info = ptr; + output_info[section->index].offset = section->output_offset; + output_info[section->index].section = section->output_section; + section->output_offset = 0; + section->output_section = section; +} + +static void +simple_restore_output_info (bfd *abfd ATTRIBUTE_UNUSED, + asection *section, + void *ptr) +{ + struct saved_output_info *output_info = ptr; + section->output_offset = output_info[section->index].offset; + section->output_section = output_info[section->index].section; +} + +/* +FUNCTION + bfd_simple_relocate_secton + +SYNOPSIS + bfd_byte *bfd_simple_get_relocated_section_contents + (bfd *abfd, asection *sec, bfd_byte *outbuf, asymbol **symbol_table); + +DESCRIPTION + Returns the relocated contents of section @var{sec}. The symbols in + @var{symbol_table} will be used, or the symbols from @var{abfd} if + @var{symbol_table} is NULL. The output offsets for all sections will + be temporarily reset to 0. The result will be stored at @var{outbuf} + or allocated with @code{bfd_malloc} if @var{outbuf} is @code{NULL}. + + Generally all sections in @var{abfd} should have their + @code{output_section} pointing back to the original section. + + Returns @code{NULL} on a fatal error; ignores errors applying + particular relocations. +*/ + +bfd_byte * +bfd_simple_get_relocated_section_contents (bfd *abfd, + asection *sec, + bfd_byte *outbuf, + asymbol **symbol_table) +{ + struct bfd_link_info link_info; + struct bfd_link_order link_order; + struct bfd_link_callbacks callbacks; + bfd_byte *contents, *data; + int storage_needed; + void *saved_offsets; + bfd_size_type old_cooked_size; + + if (! (sec->flags & SEC_RELOC)) + { + bfd_size_type size = bfd_section_size (abfd, sec); + + if (outbuf == NULL) + contents = bfd_malloc (size); + else + contents = outbuf; + + if (contents) + bfd_get_section_contents (abfd, sec, contents, 0, size); + + return contents; + } + + /* In order to use bfd_get_relocated_section_contents, we need + to forge some data structures that it expects. */ + + /* Fill in the bare minimum number of fields for our purposes. */ + memset (&link_info, 0, sizeof (link_info)); + link_info.input_bfds = abfd; + + link_info.hash = _bfd_generic_link_hash_table_create (abfd); + link_info.callbacks = &callbacks; + callbacks.warning = simple_dummy_warning; + callbacks.undefined_symbol = simple_dummy_undefined_symbol; + callbacks.reloc_overflow = simple_dummy_reloc_overflow; + callbacks.reloc_dangerous = simple_dummy_reloc_dangerous; + callbacks.unattached_reloc = simple_dummy_unattached_reloc; + + memset (&link_order, 0, sizeof (link_order)); + link_order.next = NULL; + link_order.type = bfd_indirect_link_order; + link_order.offset = 0; + link_order.size = bfd_section_size (abfd, sec); + link_order.u.indirect.section = sec; + + data = NULL; + if (outbuf == NULL) + { + data = bfd_malloc (bfd_section_size (abfd, sec)); + if (data == NULL) + return NULL; + outbuf = data; + } + + /* The sections in ABFD may already have output sections and offsets set. + Because this function is primarily for debug sections, and GCC uses the + knowledge that debug sections will generally have VMA 0 when emitting + relocations between DWARF-2 sections (which are supposed to be + section-relative offsets anyway), we need to reset the output offsets + to zero. We also need to arrange for section->output_section->vma plus + section->output_offset to equal section->vma, which we do by setting + section->output_section to point back to section. Save the original + output offset and output section to restore later. */ + saved_offsets = malloc (sizeof (struct saved_output_info) + * abfd->section_count); + if (saved_offsets == NULL) + { + if (data) + free (data); + return NULL; + } + bfd_map_over_sections (abfd, simple_save_output_info, saved_offsets); + + if (symbol_table == NULL) + { + _bfd_generic_link_add_symbols (abfd, &link_info); + + storage_needed = bfd_get_symtab_upper_bound (abfd); + symbol_table = bfd_malloc (storage_needed); + bfd_canonicalize_symtab (abfd, symbol_table); + } + else + storage_needed = 0; + + /* This function might be called before _cooked_size has been set, and + bfd_perform_relocation needs _cooked_size to be valid. */ + old_cooked_size = sec->_cooked_size; + if (old_cooked_size == 0) + sec->_cooked_size = sec->_raw_size; + + contents = bfd_get_relocated_section_contents (abfd, + &link_info, + &link_order, + outbuf, + 0, + symbol_table); + if (contents == NULL && data != NULL) + free (data); + +#if 0 + /* NOTE: cagney/2003-04-05: This free, which was introduced on + 2003-03-31 to stop a memory leak, caused a memory corruption + between GDB and BFD. The problem, which is stabs specific, can + be identified by a bunch of failures in relocate.exp vis: + + gdb.base/relocate.exp: get address of static_bar + + Details of the problem can be found on the binutils@ mailing + list, see the discussion thread: "gdb.mi/mi-cli.exp failures". */ + if (storage_needed != 0) + free (symbol_table); +#endif + + sec->_cooked_size = old_cooked_size; + bfd_map_over_sections (abfd, simple_restore_output_info, saved_offsets); + free (saved_offsets); + + _bfd_generic_link_hash_table_free (link_info.hash); + + return contents; +} diff --git a/contrib/binutils/bfd/sparclinux.c b/contrib/binutils/bfd/sparclinux.c index e55a4ff..ecaaa0f 100644 --- a/contrib/binutils/bfd/sparclinux.c +++ b/contrib/binutils/bfd/sparclinux.c @@ -1,5 +1,5 @@ /* BFD back-end for linux flavored sparc a.out binaries. - Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002 + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -19,12 +19,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define TARGET_PAGE_SIZE 4096 -#define ZMAGIC_DISK_BLOCK_SIZE 1024 -#define SEGMENT_SIZE TARGET_PAGE_SIZE -#define TEXT_START_ADDR 0x0 -#define N_SHARED_LIB(x) 0 -#define BYTES_IN_WORD 4 +#define TARGET_PAGE_SIZE 4096 +#define ZMAGIC_DISK_BLOCK_SIZE 1024 +#define SEGMENT_SIZE TARGET_PAGE_SIZE +#define TEXT_START_ADDR 0x0 +#define N_SHARED_LIB(x) 0 #define MACHTYPE_OK(mtype) ((mtype) == M_SPARC || (mtype) == M_UNKNOWN) @@ -52,10 +51,10 @@ extern const bfd_target MY(vec); static void MY_final_link_callback PARAMS ((bfd *, file_ptr *, file_ptr *, file_ptr *)); -static boolean sparclinux_bfd_final_link +static bfd_boolean sparclinux_bfd_final_link PARAMS ((bfd *abfd, struct bfd_link_info *info)); -static boolean +static bfd_boolean sparclinux_bfd_final_link (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -68,9 +67,9 @@ sparclinux_bfd_final_link (abfd, info) /* Set the machine type correctly. */ -static boolean sparclinux_write_object_contents PARAMS ((bfd *abfd)); +static bfd_boolean sparclinux_write_object_contents PARAMS ((bfd *abfd)); -static boolean +static bfd_boolean sparclinux_write_object_contents (abfd) bfd *abfd; { @@ -83,7 +82,7 @@ sparclinux_write_object_contents (abfd) WRITE_HEADERS(abfd, execp); - return true; + return TRUE; } #define MY_write_object_contents sparclinux_write_object_contents @@ -92,7 +91,7 @@ sparclinux_write_object_contents (abfd) /* See if a symbol name is a reference to the global offset table. */ #ifndef GOT_REF_PREFIX -#define GOT_REF_PREFIX "__GOT_" +#define GOT_REF_PREFIX "__GOT_" #endif #define IS_GOT_SYM(name) \ @@ -101,7 +100,7 @@ sparclinux_write_object_contents (abfd) /* See if a symbol name is a reference to the procedure linkage table. */ #ifndef PLT_REF_PREFIX -#define PLT_REF_PREFIX "__PLT_" +#define PLT_REF_PREFIX "__PLT_" #endif #define IS_PLT_SYM(name) \ @@ -114,7 +113,7 @@ sparclinux_write_object_contents (abfd) #endif /* This special symbol is a set vector that contains a list of - pointers to fixup tables. It will be present in any dynamicly + pointers to fixup tables. It will be present in any dynamically linked file. The linker generated fixup table should also be added to the list, and it should always appear in the second slot (the first one is a dummy with a magic number that is defined in @@ -179,16 +178,16 @@ static struct bfd_link_hash_table *linux_link_hash_table_create PARAMS ((bfd *)); static struct fixup *new_fixup PARAMS ((struct bfd_link_info *, struct linux_link_hash_entry *, - bfd_vma, int)); -static boolean linux_link_create_dynamic_sections + bfd_vma, int)); +static bfd_boolean linux_link_create_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -static boolean linux_add_one_symbol +static bfd_boolean linux_add_one_symbol PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, asection *, - bfd_vma, const char *, boolean, boolean, - struct bfd_link_hash_entry **)); -static boolean linux_tally_symbols + bfd_vma, const char *, bfd_boolean, bfd_boolean, + struct bfd_link_hash_entry **)); +static bfd_boolean linux_tally_symbols PARAMS ((struct linux_link_hash_entry *, PTR)); -static boolean linux_finish_dynamic_link +static bfd_boolean linux_finish_dynamic_link PARAMS ((bfd *, struct bfd_link_info *)); /* Routine to create an entry in an Linux link hash table. */ @@ -205,14 +204,14 @@ linux_link_hash_newfunc (entry, table, string) subclass. */ if (ret == (struct linux_link_hash_entry *) NULL) ret = ((struct linux_link_hash_entry *) - bfd_hash_allocate (table, sizeof (struct linux_link_hash_entry))); + bfd_hash_allocate (table, sizeof (struct linux_link_hash_entry))); if (ret == NULL) return (struct bfd_hash_entry *) ret; /* Call the allocation method of the superclass. */ ret = ((struct linux_link_hash_entry *) - NAME(aout,link_hash_newfunc) ((struct bfd_hash_entry *) ret, - table, string)); + NAME(aout,link_hash_newfunc) ((struct bfd_hash_entry *) ret, + table, string)); if (ret != NULL) { /* Set local fields; there aren't any. */ @@ -234,7 +233,7 @@ linux_link_hash_table_create (abfd) if (ret == (struct linux_link_hash_table *) NULL) return (struct bfd_link_hash_table *) NULL; if (! NAME(aout,link_hash_table_init) (&ret->root, abfd, - linux_link_hash_newfunc)) + linux_link_hash_newfunc)) { free (ret); return (struct bfd_link_hash_table *) NULL; @@ -253,14 +252,14 @@ linux_link_hash_table_create (abfd) #define linux_link_hash_lookup(table, string, create, copy, follow) \ ((struct linux_link_hash_entry *) \ aout_link_hash_lookup (&(table)->root, (string), (create), (copy),\ - (follow))) + (follow))) /* Traverse a Linux link hash table. */ -#define linux_link_hash_traverse(table, func, info) \ - (aout_link_hash_traverse \ - (&(table)->root, \ - (boolean (*) PARAMS ((struct aout_link_hash_entry *, PTR))) (func), \ +#define linux_link_hash_traverse(table, func, info) \ + (aout_link_hash_traverse \ + (&(table)->root, \ + (bfd_boolean (*) PARAMS ((struct aout_link_hash_entry *, PTR))) (func), \ (info))) /* Get the Linux link hash table from the info structure. This is @@ -280,7 +279,7 @@ new_fixup (info, h, value, builtin) struct fixup *f; f = (struct fixup *) bfd_hash_allocate (&info->hash->table, - sizeof (struct fixup)); + sizeof (struct fixup)); if (f == NULL) return f; f->next = linux_hash_table (info)->fixup_list; @@ -300,7 +299,7 @@ new_fixup (info, h, value, builtin) know the size of the section, but that's OK - we just need to create it for now. */ -static boolean +static bfd_boolean linux_link_create_dynamic_sections (abfd, info) bfd *abfd; struct bfd_link_info *info ATTRIBUTE_UNUSED; @@ -312,25 +311,25 @@ linux_link_create_dynamic_sections (abfd, info) flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY; /* We choose to use the name ".linux-dynamic" for the fixup table. - Why not? */ + Why not? */ s = bfd_make_section (abfd, ".linux-dynamic"); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags) || ! bfd_set_section_alignment (abfd, s, 2)) - return false; + return FALSE; s->_raw_size = 0; s->contents = 0; - return true; + return TRUE; } /* Function to add a single symbol to the linker hash table. This is a wrapper around _bfd_generic_link_add_one_symbol which handles the tweaking needed for dynamic linking support. */ -static boolean +static bfd_boolean linux_add_one_symbol (info, abfd, name, flags, section, value, string, - copy, collect, hashp) + copy, collect, hashp) struct bfd_link_info *info; bfd *abfd; const char *name; @@ -338,12 +337,12 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, asection *section; bfd_vma value; const char *string; - boolean copy; - boolean collect; + bfd_boolean copy; + bfd_boolean collect; struct bfd_link_hash_entry **hashp; { struct linux_link_hash_entry *h; - boolean insert; + bfd_boolean insert; /* Look up and see if we already have this symbol in the hash table. If we do, and the defining entry is from a shared library, we @@ -353,69 +352,69 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, be able to link Linux a.out and ELF objects together, but serious confusion is possible. */ - insert = false; + insert = FALSE; - if (! info->relocateable + if (! info->relocatable && linux_hash_table (info)->dynobj == NULL && strcmp (name, SHARABLE_CONFLICTS) == 0 && (flags & BSF_CONSTRUCTOR) != 0 && abfd->xvec == info->hash->creator) { if (! linux_link_create_dynamic_sections (abfd, info)) - return false; + return FALSE; linux_hash_table (info)->dynobj = abfd; - insert = true; + insert = TRUE; } if (bfd_is_abs_section (section) && abfd->xvec == info->hash->creator) { - h = linux_link_hash_lookup (linux_hash_table (info), name, false, - false, false); + h = linux_link_hash_lookup (linux_hash_table (info), name, FALSE, + FALSE, FALSE); if (h != NULL - && (h->root.root.type == bfd_link_hash_defined - || h->root.root.type == bfd_link_hash_defweak)) - { - struct fixup *f; + && (h->root.root.type == bfd_link_hash_defined + || h->root.root.type == bfd_link_hash_defweak)) + { + struct fixup *f; - if (hashp != NULL) - *hashp = (struct bfd_link_hash_entry *) h; + if (hashp != NULL) + *hashp = (struct bfd_link_hash_entry *) h; - f = new_fixup (info, h, value, ! IS_PLT_SYM (name)); - if (f == NULL) - return false; - f->jump = IS_PLT_SYM (name); + f = new_fixup (info, h, value, ! IS_PLT_SYM (name)); + if (f == NULL) + return FALSE; + f->jump = IS_PLT_SYM (name); - return true; - } + return TRUE; + } } /* Do the usual procedure for adding a symbol. */ if (! _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, - value, string, copy, collect, - hashp)) - return false; + value, string, copy, collect, + hashp)) + return FALSE; /* Insert a pointer to our table in the set vector. The dynamic - linker requires this information */ + linker requires this information. */ if (insert) { asection *s; /* Here we do our special thing to add the pointer to the - dynamic section in the SHARABLE_CONFLICTS set vector. */ + dynamic section in the SHARABLE_CONFLICTS set vector. */ s = bfd_get_section_by_name (linux_hash_table (info)->dynobj, - ".linux-dynamic"); + ".linux-dynamic"); BFD_ASSERT (s != NULL); if (! (_bfd_generic_link_add_one_symbol - (info, linux_hash_table (info)->dynobj, SHARABLE_CONFLICTS, - BSF_GLOBAL | BSF_CONSTRUCTOR, s, (bfd_vma) 0, NULL, - false, false, NULL))) - return false; + (info, linux_hash_table (info)->dynobj, SHARABLE_CONFLICTS, + BSF_GLOBAL | BSF_CONSTRUCTOR, s, (bfd_vma) 0, NULL, + FALSE, FALSE, NULL))) + return FALSE; } - return true; + return TRUE; } /* We will crawl the hash table and come here for every global symbol. @@ -428,7 +427,7 @@ linux_add_one_symbol (info, abfd, name, flags, section, value, string, This function is called via linux_link_hash_traverse. */ -static boolean +static bfd_boolean linux_tally_symbols (h, data) struct linux_link_hash_entry *h; PTR data; @@ -437,14 +436,14 @@ linux_tally_symbols (h, data) struct fixup *f, *f1; int is_plt; struct linux_link_hash_entry *h1, *h2; - boolean exists; + bfd_boolean exists; if (h->root.root.type == bfd_link_hash_warning) h = (struct linux_link_hash_entry *) h->root.root.u.i.link; if (h->root.root.type == bfd_link_hash_undefined && strncmp (h->root.root.root.string, NEEDS_SHRLIB, - sizeof NEEDS_SHRLIB - 1) == 0) + sizeof NEEDS_SHRLIB - 1) == 0) { const char *name; char *p; @@ -453,21 +452,21 @@ linux_tally_symbols (h, data) name = h->root.root.root.string + sizeof NEEDS_SHRLIB - 1; p = strrchr (name, '_'); if (p != NULL) - alloc = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 1); + alloc = (char *) bfd_malloc ((bfd_size_type) strlen (name) + 1); if (p == NULL || alloc == NULL) - (*_bfd_error_handler) (_("Output file requires shared library `%s'\n"), - name); + (*_bfd_error_handler) (_("Output file requires shared library `%s'\n"), + name); else - { - strcpy (alloc, name); - p = strrchr (alloc, '_'); - *p++ = '\0'; - (*_bfd_error_handler) - (_("Output file requires shared library `%s.so.%s'\n"), - alloc, p); - free (alloc); - } + { + strcpy (alloc, name); + p = strrchr (alloc, '_'); + *p++ = '\0'; + (*_bfd_error_handler) + (_("Output file requires shared library `%s.so.%s'\n"), + alloc, p); + free (alloc); + } abort (); } @@ -479,75 +478,75 @@ linux_tally_symbols (h, data) if (is_plt || IS_GOT_SYM (h->root.root.root.string)) { /* Look up this symbol twice. Once just as a regular lookup, - and then again following all of the indirect links until we - reach a real symbol. */ + and then again following all of the indirect links until we + reach a real symbol. */ h1 = linux_link_hash_lookup (linux_hash_table (info), - (h->root.root.root.string - + sizeof PLT_REF_PREFIX - 1), - false, false, true); + (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), - (h->root.root.root.string - + sizeof PLT_REF_PREFIX - 1), - false, false, false); + (h->root.root.root.string + + sizeof PLT_REF_PREFIX - 1), + FALSE, FALSE, FALSE); /* The real symbol must exist but if it is also an ABS symbol, - there is no need to have a fixup. This is because they both - came from the same library. If on the other hand, we had to - use an indirect symbol to get to the real symbol, we add the - fixup anyway, since there are cases where these symbols come - from different shared libraries */ + there is no need to have a fixup. This is because they both + came from the same library. If on the other hand, we had to + use an indirect symbol to get to the real symbol, we add the + fixup anyway, since there are cases where these symbols come + from different shared libraries */ if (h1 != NULL - && (((h1->root.root.type == bfd_link_hash_defined - || h1->root.root.type == bfd_link_hash_defweak) - && ! bfd_is_abs_section (h1->root.root.u.def.section)) - || h2->root.root.type == bfd_link_hash_indirect)) - { - /* See if there is a "builtin" fixup already present - involving this symbol. If so, convert it to a regular - fixup. In the end, this relaxes some of the requirements - about the order of performing fixups. */ - exists = false; - for (f1 = linux_hash_table (info)->fixup_list; - f1 != NULL; - f1 = f1->next) - { - if ((f1->h != h && f1->h != h1) - || (! f1->builtin && ! f1->jump)) - continue; - if (f1->h == h1) - exists = true; - if (! exists - && bfd_is_abs_section (h->root.root.u.def.section)) - { - f = new_fixup (info, h1, f1->h->root.root.u.def.value, 0); - f->jump = is_plt; - } - f1->h = h1; - f1->jump = is_plt; - f1->builtin = 0; - exists = true; - } - if (! exists - && bfd_is_abs_section (h->root.root.u.def.section)) - { - f = new_fixup (info, h1, h->root.root.u.def.value, 0); - if (f == NULL) - { - /* FIXME: No way to return error. */ - abort (); - } - f->jump = is_plt; - } - } + && (((h1->root.root.type == bfd_link_hash_defined + || h1->root.root.type == bfd_link_hash_defweak) + && ! bfd_is_abs_section (h1->root.root.u.def.section)) + || h2->root.root.type == bfd_link_hash_indirect)) + { + /* See if there is a "builtin" fixup already present + involving this symbol. If so, convert it to a regular + fixup. In the end, this relaxes some of the requirements + about the order of performing fixups. */ + exists = FALSE; + for (f1 = linux_hash_table (info)->fixup_list; + f1 != NULL; + f1 = f1->next) + { + if ((f1->h != h && f1->h != h1) + || (! f1->builtin && ! f1->jump)) + continue; + if (f1->h == h1) + exists = TRUE; + if (! exists + && bfd_is_abs_section (h->root.root.u.def.section)) + { + f = new_fixup (info, h1, f1->h->root.root.u.def.value, 0); + f->jump = is_plt; + } + f1->h = h1; + f1->jump = is_plt; + f1->builtin = 0; + exists = TRUE; + } + if (! exists + && bfd_is_abs_section (h->root.root.u.def.section)) + { + f = new_fixup (info, h1, h->root.root.u.def.value, 0); + if (f == NULL) + { + /* FIXME: No way to return error. */ + abort (); + } + f->jump = is_plt; + } + } /* 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; + h->root.written = TRUE; } - return true; + return TRUE; } /* This is called to set the size of the .linux-dynamic section is. @@ -556,7 +555,7 @@ linux_tally_symbols (h, data) we just scan the hash tables to find out how many additional fixups are required. */ -boolean +bfd_boolean bfd_sparclinux_size_dynamic_sections (output_bfd, info) bfd *output_bfd; struct bfd_link_info *info; @@ -565,12 +564,12 @@ bfd_sparclinux_size_dynamic_sections (output_bfd, info) asection *s; if (output_bfd->xvec != &MY(vec)) - return true; + return TRUE; /* First find the fixups... */ linux_link_hash_traverse (linux_hash_table (info), - linux_tally_symbols, - (PTR) info); + linux_tally_symbols, + (PTR) info); /* If there are builtin fixups, leave room for a marker. This is used by the dynamic linker so that it knows that all that follow @@ -578,40 +577,40 @@ bfd_sparclinux_size_dynamic_sections (output_bfd, info) for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next) { if (f->builtin) - { - ++linux_hash_table (info)->fixup_count; - ++linux_hash_table (info)->local_builtins; - break; - } + { + ++linux_hash_table (info)->fixup_count; + ++linux_hash_table (info)->local_builtins; + break; + } } if (linux_hash_table (info)->dynobj == NULL) { if (linux_hash_table (info)->fixup_count > 0) - abort (); - return true; + abort (); + return TRUE; } /* Allocate memory for our fixup table. We will fill it in later. */ s = bfd_get_section_by_name (linux_hash_table (info)->dynobj, - ".linux-dynamic"); + ".linux-dynamic"); if (s != NULL) { s->_raw_size = linux_hash_table (info)->fixup_count + 1; s->_raw_size *= 8; s->contents = (bfd_byte *) bfd_zalloc (output_bfd, s->_raw_size); if (s->contents == NULL) - return false; + return FALSE; } - return true; + return TRUE; } /* We come here once we are ready to actually write the fixup table to the output file. Scan the fixup tables and so forth and generate the stuff we need. */ -static boolean +static bfd_boolean linux_finish_dynamic_link (output_bfd, info) bfd *output_bfd; struct bfd_link_info *info; @@ -625,18 +624,18 @@ linux_finish_dynamic_link (output_bfd, info) unsigned int fixups_written; if (linux_hash_table (info)->dynobj == NULL) - return true; + return TRUE; s = bfd_get_section_by_name (linux_hash_table (info)->dynobj, - ".linux-dynamic"); + ".linux-dynamic"); BFD_ASSERT (s != NULL); os = s->output_section; fixups_written = 0; #ifdef LINUX_LINK_DEBUG printf ("Fixup table file offset: %x VMA: %x\n", - os->filepos + s->output_offset, - os->vma + s->output_offset); + os->filepos + s->output_offset, + os->vma + s->output_offset); #endif fixup_table = s->contents; @@ -648,16 +647,16 @@ linux_finish_dynamic_link (output_bfd, info) for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next) { if (f->builtin) - continue; + continue; if (f->h->root.root.type != bfd_link_hash_defined - && f->h->root.root.type != bfd_link_hash_defweak) - { - (*_bfd_error_handler) - (_("Symbol %s not defined for fixups\n"), - f->h->root.root.root.string); - continue; - } + && f->h->root.root.type != bfd_link_hash_defweak) + { + (*_bfd_error_handler) + (_("Symbol %s not defined for fixups\n"), + f->h->root.root.root.string); + continue; + } is = f->h->root.root.u.def.section; section_offset = is->output_section->vma + is->output_offset; @@ -665,25 +664,25 @@ linux_finish_dynamic_link (output_bfd, info) #ifdef LINUX_LINK_DEBUG printf ("Fixup(%d) %s: %x %x\n",f->jump, f->h->root.root.string, - new_addr, f->value); + new_addr, f->value); #endif if (f->jump) - { - /* Relative address */ - new_addr = new_addr - (f->value + 5); - bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table); - fixup_table += 4; - bfd_put_32 (output_bfd, f->value + 1, fixup_table); - fixup_table += 4; - } + { + /* Relative address */ + new_addr = new_addr - (f->value + 5); + bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table); + fixup_table += 4; + bfd_put_32 (output_bfd, f->value + 1, fixup_table); + fixup_table += 4; + } else - { - bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table); - fixup_table += 4; - bfd_put_32 (output_bfd, f->value, fixup_table); - fixup_table += 4; - } + { + bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table); + fixup_table += 4; + bfd_put_32 (output_bfd, f->value, fixup_table); + fixup_table += 4; + } ++fixups_written; } @@ -696,56 +695,56 @@ linux_finish_dynamic_link (output_bfd, info) fixup_table += 4; ++fixups_written; for (f = linux_hash_table (info)->fixup_list; f != NULL; f = f->next) - { - if (! f->builtin) - continue; - - if (f->h->root.root.type != bfd_link_hash_defined - && f->h->root.root.type != bfd_link_hash_defweak) - { - (*_bfd_error_handler) - (_("Symbol %s not defined for fixups\n"), - f->h->root.root.root.string); - continue; - } - - is = f->h->root.root.u.def.section; - section_offset = is->output_section->vma + is->output_offset; - new_addr = f->h->root.root.u.def.value + section_offset; + { + if (! f->builtin) + continue; + + if (f->h->root.root.type != bfd_link_hash_defined + && f->h->root.root.type != bfd_link_hash_defweak) + { + (*_bfd_error_handler) + (_("Symbol %s not defined for fixups\n"), + f->h->root.root.root.string); + continue; + } + + is = f->h->root.root.u.def.section; + section_offset = is->output_section->vma + is->output_offset; + new_addr = f->h->root.root.u.def.value + section_offset; #ifdef LINUX_LINK_DEBUG - printf ("Fixup(B) %s: %x %x\n", f->h->root.root.string, - new_addr, f->value); + printf ("Fixup(B) %s: %x %x\n", f->h->root.root.string, + new_addr, f->value); #endif - bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table); - fixup_table += 4; - bfd_put_32 (output_bfd, f->value, fixup_table); - fixup_table += 4; - ++fixups_written; - } - } + bfd_put_32 (output_bfd, (bfd_vma) new_addr, fixup_table); + fixup_table += 4; + bfd_put_32 (output_bfd, f->value, fixup_table); + fixup_table += 4; + ++fixups_written; + } + } if (linux_hash_table (info)->fixup_count != fixups_written) { (*_bfd_error_handler) (_("Warning: fixup count mismatch\n")); while (linux_hash_table (info)->fixup_count > fixups_written) - { - bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); - fixup_table += 4; - bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); - fixup_table += 4; - ++fixups_written; - } + { + bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); + fixup_table += 4; + bfd_put_32 (output_bfd, (bfd_vma) 0, fixup_table); + fixup_table += 4; + ++fixups_written; + } } h = linux_link_hash_lookup (linux_hash_table (info), - "__BUILTIN_FIXUPS__", - false, false, false); + "__BUILTIN_FIXUPS__", + FALSE, FALSE, FALSE); if (h != NULL && (h->root.root.type == bfd_link_hash_defined - || h->root.root.type == bfd_link_hash_defweak)) + || h->root.root.type == bfd_link_hash_defweak)) { is = h->root.root.u.def.section; section_offset = is->output_section->vma + is->output_offset; @@ -762,13 +761,12 @@ linux_finish_dynamic_link (output_bfd, info) if (bfd_seek (output_bfd, (file_ptr) (os->filepos + s->output_offset), SEEK_SET) != 0) - return false; + return FALSE; - if (bfd_bwrite ((PTR) s->contents, s->_raw_size, output_bfd) - != s->_raw_size) - return false; + if (bfd_bwrite ((PTR) s->contents, s->_raw_size, output_bfd) != s->_raw_size) + return FALSE; - return true; + return TRUE; } #define MY_bfd_link_hash_table_create linux_link_hash_table_create diff --git a/contrib/binutils/bfd/sparcnetbsd.c b/contrib/binutils/bfd/sparcnetbsd.c index 64d0eb1..be8e536 100644 --- a/contrib/binutils/bfd/sparcnetbsd.c +++ b/contrib/binutils/bfd/sparcnetbsd.c @@ -1,5 +1,5 @@ /* BFD back-end for NetBSD/sparc a.out-ish binaries. - Copyright 1990, 1991, 1992, 1994, 1995, 1997, 1998, 2000, 2001 + Copyright 1990, 1991, 1992, 1994, 1995, 1997, 1998, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -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 BYTES_IN_WORD 4 #define TARGET_IS_BIG_ENDIAN_P /* SPARC chips use either 4K or 8K pages, but object files always diff --git a/contrib/binutils/bfd/srec.c b/contrib/binutils/bfd/srec.c index 6c29fa1..c0a3d58 100644 --- a/contrib/binutils/bfd/srec.c +++ b/contrib/binutils/bfd/srec.c @@ -1,6 +1,6 @@ /* BFD back-end for s-record objects. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . @@ -114,32 +114,31 @@ static void srec_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); static void srec_print_symbol PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); static void srec_init PARAMS ((void)); -static boolean srec_mkobject PARAMS ((bfd *)); -static int srec_get_byte PARAMS ((bfd *, boolean *)); -static void srec_bad_byte PARAMS ((bfd *, unsigned int, int, boolean)); -static boolean srec_scan PARAMS ((bfd *)); +static bfd_boolean srec_mkobject PARAMS ((bfd *)); +static int srec_get_byte PARAMS ((bfd *, bfd_boolean *)); +static void srec_bad_byte PARAMS ((bfd *, unsigned int, int, bfd_boolean)); +static bfd_boolean srec_scan PARAMS ((bfd *)); static const bfd_target *srec_object_p PARAMS ((bfd *)); static const bfd_target *symbolsrec_object_p PARAMS ((bfd *)); -static boolean srec_read_section PARAMS ((bfd *, asection *, bfd_byte *)); - -static boolean srec_write_record PARAMS ((bfd *, unsigned int, bfd_vma, - const bfd_byte *, - const bfd_byte *)); -static boolean srec_write_header PARAMS ((bfd *)); -static boolean srec_write_symbols PARAMS ((bfd *)); -static boolean srec_new_symbol PARAMS ((bfd *, const char *, bfd_vma)); -static boolean srec_get_section_contents +static bfd_boolean srec_read_section PARAMS ((bfd *, asection *, bfd_byte *)); + +static bfd_boolean srec_write_record + PARAMS ((bfd *, unsigned int, bfd_vma, const bfd_byte *, const bfd_byte *)); +static bfd_boolean srec_write_header PARAMS ((bfd *)); +static bfd_boolean srec_write_symbols PARAMS ((bfd *)); +static bfd_boolean srec_new_symbol PARAMS ((bfd *, const char *, bfd_vma)); +static bfd_boolean srec_get_section_contents PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); -static boolean srec_set_arch_mach +static bfd_boolean srec_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, unsigned long)); -static boolean srec_set_section_contents - PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); -static boolean internal_srec_write_object_contents PARAMS ((bfd *, int)); -static boolean srec_write_object_contents PARAMS ((bfd *)); -static boolean symbolsrec_write_object_contents PARAMS ((bfd *)); -static int srec_sizeof_headers PARAMS ((bfd *, boolean)); +static bfd_boolean srec_set_section_contents + PARAMS ((bfd *, sec_ptr, const PTR, file_ptr, bfd_size_type)); +static bfd_boolean internal_srec_write_object_contents PARAMS ((bfd *, int)); +static bfd_boolean srec_write_object_contents PARAMS ((bfd *)); +static bfd_boolean symbolsrec_write_object_contents PARAMS ((bfd *)); +static int srec_sizeof_headers PARAMS ((bfd *, bfd_boolean)); static long srec_get_symtab_upper_bound PARAMS ((bfd *)); -static long srec_get_symtab PARAMS ((bfd *, asymbol **)); +static long srec_canonicalize_symtab PARAMS ((bfd *, asymbol **)); /* Macros for converting between hex and binary. */ @@ -158,11 +157,11 @@ static const char digs[] = "0123456789ABCDEF"; static void srec_init () { - static boolean inited = false; + static bfd_boolean inited = FALSE; if (! inited) { - inited = true; + inited = TRUE; hex_init (); } } @@ -181,7 +180,7 @@ 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 = false; +bfd_boolean S3Forced = FALSE; /* 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. */ @@ -220,13 +219,14 @@ typedef struct srec_data_struct } tdata_type; -static boolean srec_write_section PARAMS ((bfd *, tdata_type *, - srec_data_list_type *)); -static boolean srec_write_terminator PARAMS ((bfd *, tdata_type *)); +static bfd_boolean srec_write_section + PARAMS ((bfd *, tdata_type *, srec_data_list_type *)); +static bfd_boolean srec_write_terminator + PARAMS ((bfd *, tdata_type *)); /* Set up the S-record tdata information. */ -static boolean +static bfd_boolean srec_mkobject (abfd) bfd *abfd; { @@ -238,8 +238,8 @@ srec_mkobject (abfd) amt = sizeof (tdata_type); tdata = (tdata_type *) bfd_alloc (abfd, amt); if (tdata == NULL) - return false; - + return FALSE; + abfd->tdata.srec_data = tdata; tdata->type = 1; tdata->head = NULL; @@ -248,7 +248,7 @@ srec_mkobject (abfd) tdata->symtail = NULL; tdata->csymbols = NULL; - return true; + return TRUE; } /* Read a byte from an S record file. Set *ERRORPTR if an error @@ -257,14 +257,14 @@ srec_mkobject (abfd) static int srec_get_byte (abfd, errorptr) bfd *abfd; - boolean *errorptr; + bfd_boolean *errorptr; { bfd_byte c; if (bfd_bread (&c, (bfd_size_type) 1, abfd) != 1) { if (bfd_get_error () != bfd_error_file_truncated) - *errorptr = true; + *errorptr = TRUE; return EOF; } @@ -280,7 +280,7 @@ srec_bad_byte (abfd, lineno, c, error) bfd *abfd; unsigned int lineno; int c; - boolean error; + bfd_boolean error; { if (c == EOF) { @@ -307,7 +307,7 @@ srec_bad_byte (abfd, lineno, c, error) /* Add a new symbol found in an S-record file. */ -static boolean +static bfd_boolean srec_new_symbol (abfd, name, val) bfd *abfd; const char *name; @@ -318,7 +318,7 @@ srec_new_symbol (abfd, name, val) n = (struct srec_symbol *) bfd_alloc (abfd, amt); if (n == NULL) - return false; + return FALSE; n->name = name; n->val = val; @@ -332,19 +332,19 @@ srec_new_symbol (abfd, name, val) ++abfd->symcount; - return true; + return TRUE; } /* Read the S record file and turn it into sections. We create a new section for each contiguous set of bytes. */ -static boolean +static bfd_boolean srec_scan (abfd) bfd *abfd; { int c; unsigned int lineno = 1; - boolean error = false; + bfd_boolean error = FALSE; bfd_byte *buf = NULL; size_t bufsize = 0; asection *sec = NULL; @@ -356,7 +356,7 @@ srec_scan (abfd) while ((c = srec_get_byte (abfd, &error)) != EOF) { /* We only build sections from contiguous S-records, so if this - is not an S-record, then stop building a section. */ + is not an S-record, then stop building a section. */ if (c != 'S' && c != '\r' && c != '\n') sec = NULL; @@ -542,7 +542,7 @@ srec_scan (abfd) case '0': case '5': /* Prologue--ignore the file name, but stop building a - section at this point. */ + section at this point. */ sec = NULL; break; @@ -567,7 +567,7 @@ srec_scan (abfd) && sec->vma + sec->_raw_size == address) { /* This data goes at the end of the section we are - currently building. */ + currently building. */ sec->_raw_size += bytes; } else @@ -612,7 +612,7 @@ srec_scan (abfd) if (buf != NULL) free (buf); - return true; + return TRUE; } } break; @@ -625,14 +625,14 @@ srec_scan (abfd) if (buf != NULL) free (buf); - return true; + return TRUE; error_return: if (symbuf != NULL) free (symbuf); if (buf != NULL) free (buf); - return false; + return FALSE; } /* Check whether an existing file is an S-record file. */ @@ -709,7 +709,7 @@ symbolsrec_object_p (abfd) /* Read in the contents of a section in an S-record file. */ -static boolean +static bfd_boolean srec_read_section (abfd, section, contents) bfd *abfd; asection *section; @@ -717,7 +717,7 @@ srec_read_section (abfd, section, contents) { int c; bfd_size_type sofar = 0; - boolean error = false; + bfd_boolean error = FALSE; bfd_byte *buf = NULL; size_t bufsize = 0; @@ -735,7 +735,7 @@ srec_read_section (abfd, section, contents) continue; /* This is called after srec_scan has already been called, so we - ought to know the exact format. */ + ought to know the exact format. */ BFD_ASSERT (c == 'S'); if (bfd_bread (hdr, (bfd_size_type) 3, abfd) != 3) @@ -766,7 +766,7 @@ srec_read_section (abfd, section, contents) BFD_ASSERT (sofar == section->_raw_size); if (buf != NULL) free (buf); - return true; + return TRUE; case '3': address = HEX (data); @@ -791,7 +791,7 @@ srec_read_section (abfd, section, contents) BFD_ASSERT (sofar == section->_raw_size); if (buf != NULL) free (buf); - return true; + return TRUE; } /* Don't consider checksum. */ @@ -816,17 +816,17 @@ srec_read_section (abfd, section, contents) if (buf != NULL) free (buf); - return true; + return TRUE; error_return: if (buf != NULL) free (buf); - return false; + return FALSE; } /* Get the contents of a section in an S-record file. */ -static boolean +static bfd_boolean srec_get_section_contents (abfd, section, location, offset, count) bfd *abfd; asection *section; @@ -838,21 +838,21 @@ srec_get_section_contents (abfd, section, location, offset, count) { section->used_by_bfd = bfd_alloc (abfd, section->_raw_size); if (section->used_by_bfd == NULL && section->_raw_size != 0) - return false; + return FALSE; if (! srec_read_section (abfd, section, section->used_by_bfd)) - return false; + return FALSE; } memcpy (location, (bfd_byte *) section->used_by_bfd + offset, (size_t) count); - return true; + return TRUE; } /* Set the architecture. We accept an unknown architecture here. */ -static boolean +static bfd_boolean srec_set_arch_mach (abfd, arch, mach) bfd *abfd; enum bfd_architecture arch; @@ -861,18 +861,18 @@ srec_set_arch_mach (abfd, arch, mach) if (arch == bfd_arch_unknown) { abfd->arch_info = &bfd_default_arch_struct; - return true; + return TRUE; } return bfd_default_set_arch_mach (abfd, arch, mach); } /* We have to save up all the Srecords for a splurge before output. */ -static boolean +static bfd_boolean srec_set_section_contents (abfd, section, location, offset, bytes_to_do) bfd *abfd; sec_ptr section; - PTR location; + const PTR location; file_ptr offset; bfd_size_type bytes_to_do; { @@ -882,7 +882,7 @@ srec_set_section_contents (abfd, section, location, offset, bytes_to_do) entry = ((srec_data_list_type *) bfd_alloc (abfd, (bfd_size_type) sizeof (srec_data_list_type))); if (entry == NULL) - return false; + return FALSE; if (bytes_to_do && (section->flags & SEC_ALLOC) @@ -892,10 +892,10 @@ srec_set_section_contents (abfd, section, location, offset, bytes_to_do) data = (bfd_byte *) bfd_alloc (abfd, bytes_to_do); if (data == NULL) - return false; + return FALSE; memcpy ((PTR) data, location, (size_t) bytes_to_do); - /* Ff S3Forced is true then always select S3 records, + /* Ff S3Forced is TRUE then always select S3 records, regardless of the siez of the addresses. */ if (S3Forced) tdata->type = 3; @@ -912,7 +912,7 @@ srec_set_section_contents (abfd, section, location, offset, bytes_to_do) entry->size = bytes_to_do; /* Sort the records by address. Optimize for the common case of - adding a record to the end of the list. */ + adding a record to the end of the list. */ if (tdata->tail != NULL && entry->where >= tdata->tail->where) { @@ -934,14 +934,14 @@ srec_set_section_contents (abfd, section, location, offset, bytes_to_do) tdata->tail = entry; } } - return true; + return TRUE; } /* 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. */ -static boolean +static bfd_boolean srec_write_record (abfd, type, address, data, end) bfd *abfd; unsigned int type; @@ -999,17 +999,17 @@ srec_write_record (abfd, type, address, data, end) *dst++ = '\n'; wrlen = dst - buffer; if (bfd_bwrite ((PTR) buffer, wrlen, abfd) != wrlen) - return false; - return true; + return FALSE; + return TRUE; } -static boolean +static bfd_boolean srec_write_header (abfd) bfd *abfd; { unsigned int len = strlen (abfd->filename); - /* I'll put an arbitary 40 char limit on header size. */ + /* I'll put an arbitrary 40 char limit on header size. */ if (len > 40) len = 40; @@ -1017,7 +1017,7 @@ srec_write_header (abfd) abfd->filename, abfd->filename + len); } -static boolean +static bfd_boolean srec_write_section (abfd, tdata, list) bfd *abfd; tdata_type *tdata; @@ -1052,16 +1052,16 @@ srec_write_section (abfd, tdata, list) address, location, location + octets_this_chunk)) - return false; + return FALSE; octets_written += octets_this_chunk; location += octets_this_chunk; } - return true; + return TRUE; } -static boolean +static bfd_boolean srec_write_terminator (abfd, tdata) bfd *abfd; tdata_type *tdata; @@ -1070,7 +1070,7 @@ srec_write_terminator (abfd, tdata) abfd->start_address, NULL, NULL); } -static boolean +static bfd_boolean srec_write_symbols (abfd) bfd *abfd; { @@ -1086,7 +1086,7 @@ srec_write_symbols (abfd) if (bfd_bwrite ("$$ ", (bfd_size_type) 3, abfd) != 3 || bfd_bwrite (abfd->filename, len, abfd) != len || bfd_bwrite ("\r\n", (bfd_size_type) 2, abfd) != 2) - return false; + return FALSE; for (i = 0; i < count; i++) { @@ -1095,36 +1095,37 @@ srec_write_symbols (abfd) && (s->flags & BSF_DEBUGGING) == 0) { /* Just dump out non debug symbols. */ - char buf[42], *p; + char buf[43], *p; len = strlen (s->name); if (bfd_bwrite (" ", (bfd_size_type) 2, abfd) != 2 || bfd_bwrite (s->name, len, abfd) != len) - return false; + return FALSE; - sprintf_vma (buf + 1, (s->value + sprintf_vma (buf + 2, (s->value + s->section->output_section->lma + s->section->output_offset)); - p = buf + 1; + p = buf + 2; while (p[0] == '0' && p[1] != 0) p++; len = strlen (p); p[len] = '\r'; p[len + 1] = '\n'; + *--p = '$'; *--p = ' '; - len += 3; + len += 4; if (bfd_bwrite (p, len, abfd) != len) - return false; + return FALSE; } } if (bfd_bwrite ("$$ \r\n", (bfd_size_type) 5, abfd) != 5) - return false; + return FALSE; } - return true; + return TRUE; } -static boolean +static bfd_boolean internal_srec_write_object_contents (abfd, symbols) bfd *abfd; int symbols; @@ -1135,11 +1136,11 @@ internal_srec_write_object_contents (abfd, symbols) if (symbols) { if (! srec_write_symbols (abfd)) - return false; + return FALSE; } if (! srec_write_header (abfd)) - return false; + return FALSE; /* Now wander though all the sections provided and output them. */ list = tdata->head; @@ -1147,20 +1148,20 @@ internal_srec_write_object_contents (abfd, symbols) while (list != (srec_data_list_type *) NULL) { if (! srec_write_section (abfd, tdata, list)) - return false; + return FALSE; list = list->next; } return srec_write_terminator (abfd, tdata); } -static boolean +static bfd_boolean srec_write_object_contents (abfd) bfd *abfd; { return internal_srec_write_object_contents (abfd, 0); } -static boolean +static bfd_boolean symbolsrec_write_object_contents (abfd) bfd *abfd; { @@ -1170,7 +1171,7 @@ symbolsrec_write_object_contents (abfd) static int srec_sizeof_headers (abfd, exec) bfd *abfd ATTRIBUTE_UNUSED; - boolean exec ATTRIBUTE_UNUSED; + bfd_boolean exec ATTRIBUTE_UNUSED; { return 0; } @@ -1187,7 +1188,7 @@ srec_get_symtab_upper_bound (abfd) /* Return the symbol table. */ static long -srec_get_symtab (abfd, alocation) +srec_canonicalize_symtab (abfd, alocation) bfd *abfd; asymbol **alocation; { @@ -1203,7 +1204,7 @@ srec_get_symtab (abfd, alocation) csymbols = (asymbol *) bfd_alloc (abfd, symcount * sizeof (asymbol)); if (csymbols == NULL && symcount != 0) - return (long) false; + return 0; abfd->tdata.srec_data->csymbols = csymbols; for (s = abfd->tdata.srec_data->symbols, c = csymbols; diff --git a/contrib/binutils/bfd/stabs.c b/contrib/binutils/bfd/stabs.c index 0cb3741..04b91f6 100644 --- a/contrib/binutils/bfd/stabs.c +++ b/contrib/binutils/bfd/stabs.c @@ -1,23 +1,23 @@ /* Stabs in sections linking support. - Copyright 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. -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. */ /* This file contains support for linking stabs in sections, as used on COFF and ELF. */ @@ -56,12 +56,19 @@ struct stab_link_includes_table }; /* A linked list of totals that we have found for a particular header - file. */ + file. A total is a unique identifier for a particular BINCL...EINCL + sequence of STABs that can be used to identify duplicate sequences. + It consists of three fields, 'sum_chars' which is the sum of all the + STABS characters; 'num_chars' which is the number of these charactes + and 'symb' which is a buffer of all the symbols in the sequence. This + buffer is only checked as a last resort. */ struct stab_link_includes_totals { struct stab_link_includes_totals *next; - bfd_vma total; + bfd_vma sum_chars; /* Accumulated sum of STABS characters. */ + bfd_vma num_chars; /* Number of STABS characters. */ + const char* symb; /* The STABS characters themselves. */ }; /* An entry in the header file hash table. */ @@ -168,15 +175,16 @@ stab_link_includes_newfunc (entry, table, string) /* This function is called for each input file from the add_symbols pass of the linker. */ -boolean -_bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) +bfd_boolean +_bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo, pstring_offset) bfd *abfd; PTR *psinfo; asection *stabsec; asection *stabstrsec; PTR *psecinfo; + bfd_size_type *pstring_offset; { - boolean first; + bfd_boolean first; struct stab_info *sinfo; bfd_size_type count, amt; struct stab_section_info *secinfo; @@ -190,21 +198,21 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) || stabstrsec->_raw_size == 0) { /* This file does not contain stabs debugging information. */ - return true; + return TRUE; } if (stabsec->_raw_size % STABSIZE != 0) { /* Something is wrong with the format of these stab symbols. - Don't try to optimize them. */ - return true; + Don't try to optimize them. */ + return TRUE; } if ((stabstrsec->flags & SEC_RELOC) != 0) { /* We shouldn't see relocations in the strings, and we aren't - prepared to handle them. */ - return true; + prepared to handle them. */ + return TRUE; } if ((stabsec->output_section != NULL @@ -213,16 +221,16 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) && bfd_is_abs_section (stabstrsec->output_section))) { /* At least one of the sections is being discarded from the - link, so we should just ignore them. */ - return true; + link, so we should just ignore them. */ + return TRUE; } - first = false; + first = FALSE; if (*psinfo == NULL) { /* Initialize the stabs information we need to keep track of. */ - first = true; + first = TRUE; amt = sizeof (struct stab_info); *psinfo = (PTR) bfd_alloc (abfd, amt); if (*psinfo == NULL) @@ -232,7 +240,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) if (sinfo->strings == NULL) goto error_return; /* Make sure the first byte is zero. */ - (void) _bfd_stringtab_add (sinfo->strings, "", true, true); + (void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE); if (! bfd_hash_table_init_n (&sinfo->includes.root, stab_link_includes_newfunc, 251)) @@ -276,7 +284,11 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) and identify N_BINCL symbols which can be eliminated. */ stroff = 0; - next_stroff = 0; + /* The stabs sections can be split when + -split-by-reloc/-split-by-file is used. We must keep track of + each stab section's place in the single concatenated string + table. */ + next_stroff = pstring_offset ? *pstring_offset : 0; skip = 0; symend = stabbuf + stabsec->_raw_size; @@ -299,16 +311,18 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) if (type == 0) { /* Special type 0 stabs indicate the offset to the next - string table. We only copy the very first one. */ + string table. We only copy the very first one. */ stroff = next_stroff; next_stroff += bfd_get_32 (abfd, sym + 8); + if (pstring_offset) + *pstring_offset = next_stroff; if (! first) { *pstridx = (bfd_size_type) -1; ++skip; continue; } - first = false; + first = FALSE; } /* Store the string in the hash table, and record the index. */ @@ -324,7 +338,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) goto error_return; } string = (char *) stabstrbuf + symstroff; - *pstridx = _bfd_stringtab_add (sinfo->strings, string, true, true); + *pstridx = _bfd_stringtab_add (sinfo->strings, string, TRUE, TRUE); /* An N_BINCL symbol indicates the start of the stabs entries for a header file. We need to scan ahead to the next N_EINCL @@ -333,15 +347,21 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) first number after an open parenthesis). */ if (type == (int) N_BINCL) { - bfd_vma val; + bfd_vma sum_chars; + bfd_vma num_chars; + bfd_vma buf_len = 0; + char * symb; + char * symb_rover; int nest; - bfd_byte *incl_sym; - struct stab_link_includes_entry *incl_entry; - struct stab_link_includes_totals *t; - struct stab_excl_list *ne; + bfd_byte * incl_sym; + struct stab_link_includes_entry * incl_entry; + struct stab_link_includes_totals * t; + struct stab_excl_list * ne; - val = 0; + symb = symb_rover = NULL; + sum_chars = num_chars = 0; nest = 0; + for (incl_sym = sym + STABSIZE; incl_sym < symend; incl_sym += STABSIZE) @@ -351,6 +371,8 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) incl_type = incl_sym[TYPEOFF]; if (incl_type == 0) break; + else if (incl_type == (int) N_EXCL) + continue; else if (incl_type == (int) N_EINCL) { if (nest == 0) @@ -368,7 +390,17 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) + bfd_get_32 (abfd, incl_sym + STRDXOFF)); for (; *str != '\0'; str++) { - val += *str; + if (num_chars >= buf_len) + { + buf_len += 32 * 1024; + symb = bfd_realloc (symb, buf_len); + if (symb == NULL) + goto error_return; + symb_rover = symb + num_chars; + } + * symb_rover ++ = * str; + sum_chars += *str; + num_chars ++; if (*str == '(') { /* Skip the file number. */ @@ -381,25 +413,29 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) } } + BFD_ASSERT (num_chars == (bfd_vma) (symb_rover - symb)); + /* If we have already included a header file with the same value, then replaced this one with an N_EXCL symbol. */ incl_entry = stab_link_includes_lookup (&sinfo->includes, string, - true, true); + TRUE, TRUE); if (incl_entry == NULL) goto error_return; for (t = incl_entry->totals; t != NULL; t = t->next) - if (t->total == val) + if (t->sum_chars == sum_chars + && t->num_chars == num_chars + && memcmp (t->symb, symb, num_chars) == 0) break; /* Record this symbol, so that we can set the value - correctly. */ + correctly. */ amt = sizeof *ne; ne = (struct stab_excl_list *) bfd_alloc (abfd, amt); if (ne == NULL) goto error_return; ne->offset = sym - stabbuf; - ne->val = val; + ne->val = sum_chars; ne->type = (int) N_BINCL; ne->next = secinfo->excls; secinfo->excls = ne; @@ -412,7 +448,9 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) bfd_hash_allocate (&sinfo->includes.root, sizeof *t)); if (t == NULL) goto error_return; - t->total = val; + t->sum_chars = sum_chars; + t->num_chars = num_chars; + t->symb = bfd_realloc (symb, num_chars); /* Trim data down. */ t->next = incl_entry->totals; incl_entry->totals = t; } @@ -424,6 +462,9 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) pass to change the type to N_EXCL. */ ne->type = (int) N_EXCL; + /* Free off superfluous symbols. */ + free (symb); + /* Mark the skipped symbols. */ nest = 0; @@ -447,6 +488,9 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) } else if (incl_type == (int) N_BINCL) ++nest; + else if (incl_type == (int) N_EXCL) + /* Keep existing exclusion marks. */ + continue; else if (nest == 0) { *incl_pstridx = (bfd_size_type) -1; @@ -502,30 +546,30 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) BFD_ASSERT (offset != 0); } - return true; + return TRUE; error_return: if (stabbuf != NULL) free (stabbuf); if (stabstrbuf != NULL) free (stabstrbuf); - return false; + return FALSE; } /* This function is called for each input file before the stab section is relocated. It discards stab entries for discarded - functions and variables. The function returns true iff + functions and variables. The function returns TRUE iff any entries have been deleted. */ -boolean +bfd_boolean _bfd_discard_section_stabs (abfd, stabsec, psecinfo, reloc_symbol_deleted_p, cookie) bfd *abfd; asection *stabsec; PTR psecinfo; - boolean (*reloc_symbol_deleted_p) PARAMS ((bfd_vma, PTR)); + bfd_boolean (*reloc_symbol_deleted_p) PARAMS ((bfd_vma, PTR)); PTR cookie; { bfd_size_type count, amt; @@ -539,29 +583,29 @@ _bfd_discard_section_stabs (abfd, stabsec, psecinfo, if (stabsec->_raw_size == 0) { /* This file does not contain stabs debugging information. */ - return false; + return FALSE; } if (stabsec->_raw_size % STABSIZE != 0) { /* Something is wrong with the format of these stab symbols. - Don't try to optimize them. */ - return false; + Don't try to optimize them. */ + return FALSE; } if ((stabsec->output_section != NULL && bfd_is_abs_section (stabsec->output_section))) { /* At least one of the sections is being discarded from the - link, so we should just ignore them. */ - return false; + link, so we should just ignore them. */ + return FALSE; } /* We should have initialized our data in _bfd_link_stab_sections. If there was some bizarre error reading the string sections, though, we might not have. Bail rather than asserting. */ if (psecinfo == NULL) - return false; + return FALSE; count = stabsec->_raw_size / STABSIZE; secinfo = (struct stab_section_info *) psecinfo; @@ -674,18 +718,18 @@ _bfd_discard_section_stabs (abfd, stabsec, psecinfo, BFD_ASSERT (offset != 0); } - return (boolean) (skip > 0); + return skip > 0; error_return: if (stabbuf != NULL) free (stabbuf); - return false; + return FALSE; } /* Write out the stab section. This is called with the relocated contents. */ -boolean +bfd_boolean _bfd_write_section_stabs (output_bfd, psinfo, stabsec, psecinfo, contents) bfd *output_bfd; PTR *psinfo; @@ -736,9 +780,9 @@ _bfd_write_section_stabs (output_bfd, psinfo, stabsec, psecinfo, contents) if (sym[TYPEOFF] == 0) { /* This is the header symbol for the stabs section. We - don't really need one, since we have merged all the - input stabs sections into one, but we generate one - for the benefit of readers which expect to see one. */ + don't really need one, since we have merged all the + input stabs sections into one, but we generate one + for the benefit of readers which expect to see one. */ BFD_ASSERT (sym == contents); bfd_put_32 (output_bfd, _bfd_stringtab_size (sinfo->strings), tosym + VALOFF); @@ -760,7 +804,7 @@ _bfd_write_section_stabs (output_bfd, psinfo, stabsec, psecinfo, contents) /* Write out the .stabstr section. */ -boolean +bfd_boolean _bfd_write_stab_strings (output_bfd, psinfo) bfd *output_bfd; PTR *psinfo; @@ -770,12 +814,12 @@ _bfd_write_stab_strings (output_bfd, psinfo) sinfo = (struct stab_info *) *psinfo; if (sinfo == NULL) - return true; + return TRUE; if (bfd_is_abs_section (sinfo->stabstr->output_section)) { /* The section was discarded from the link. */ - return true; + return TRUE; } BFD_ASSERT ((sinfo->stabstr->output_offset @@ -786,16 +830,16 @@ _bfd_write_stab_strings (output_bfd, psinfo) (file_ptr) (sinfo->stabstr->output_section->filepos + sinfo->stabstr->output_offset), SEEK_SET) != 0) - return false; + return FALSE; if (! _bfd_stringtab_emit (output_bfd, sinfo->strings)) - return false; + return FALSE; /* We no longer need the stabs information. */ _bfd_stringtab_free (sinfo->strings); bfd_hash_table_free (&sinfo->includes.root); - return true; + return TRUE; } /* Adjust an address in the .stab section. Given OFFSET within diff --git a/contrib/binutils/bfd/sunos.c b/contrib/binutils/bfd/sunos.c index 5fec6f9..5b1b18b 100644 --- a/contrib/binutils/bfd/sunos.c +++ b/contrib/binutils/bfd/sunos.c @@ -1,7 +1,6 @@ /* BFD backend for SunOS binaries. Copyright 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 2000, 2001, - 2002 - Free Software Foundation, Inc. + 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -33,9 +32,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Static routines defined in this file. */ -static boolean sunos_read_dynamic_info PARAMS ((bfd *)); +static bfd_boolean sunos_read_dynamic_info PARAMS ((bfd *)); static long sunos_get_dynamic_symtab_upper_bound PARAMS ((bfd *)); -static boolean sunos_slurp_dynamic_symtab PARAMS ((bfd *)); +static bfd_boolean sunos_slurp_dynamic_symtab PARAMS ((bfd *)); static long sunos_canonicalize_dynamic_symtab PARAMS ((bfd *, asymbol **)); static long sunos_get_dynamic_reloc_upper_bound PARAMS ((bfd *)); static long sunos_canonicalize_dynamic_reloc @@ -44,32 +43,32 @@ static struct bfd_hash_entry *sunos_link_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); static struct bfd_link_hash_table *sunos_link_hash_table_create PARAMS ((bfd *)); -static boolean sunos_create_dynamic_sections - PARAMS ((bfd *, struct bfd_link_info *, boolean)); -static boolean sunos_add_dynamic_symbols +static bfd_boolean sunos_create_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean)); +static bfd_boolean sunos_add_dynamic_symbols PARAMS ((bfd *, struct bfd_link_info *, struct external_nlist **, bfd_size_type *, char **)); -static boolean sunos_add_one_symbol +static bfd_boolean sunos_add_one_symbol PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, asection *, - bfd_vma, const char *, boolean, boolean, + bfd_vma, const char *, bfd_boolean, bfd_boolean, struct bfd_link_hash_entry **)); -static boolean sunos_scan_relocs +static bfd_boolean sunos_scan_relocs PARAMS ((struct bfd_link_info *, bfd *, asection *, bfd_size_type)); -static boolean sunos_scan_std_relocs +static bfd_boolean sunos_scan_std_relocs PARAMS ((struct bfd_link_info *, bfd *, asection *, const struct reloc_std_external *, bfd_size_type)); -static boolean sunos_scan_ext_relocs +static bfd_boolean sunos_scan_ext_relocs PARAMS ((struct bfd_link_info *, bfd *, asection *, const struct reloc_ext_external *, bfd_size_type)); -static boolean sunos_link_dynamic_object +static bfd_boolean sunos_link_dynamic_object PARAMS ((struct bfd_link_info *, bfd *)); -static boolean sunos_write_dynamic_symbol +static bfd_boolean sunos_write_dynamic_symbol PARAMS ((bfd *, struct bfd_link_info *, struct aout_link_hash_entry *)); -static boolean sunos_check_dynamic_reloc +static bfd_boolean sunos_check_dynamic_reloc PARAMS ((struct bfd_link_info *, bfd *, asection *, - struct aout_link_hash_entry *, PTR, bfd_byte *, boolean *, + struct aout_link_hash_entry *, PTR, bfd_byte *, bfd_boolean *, bfd_vma *)); -static boolean sunos_finish_dynamic_link +static bfd_boolean sunos_finish_dynamic_link PARAMS ((bfd *, struct bfd_link_info *)); #define MY_get_dynamic_symtab_upper_bound sunos_get_dynamic_symtab_upper_bound @@ -106,7 +105,7 @@ static boolean sunos_finish_dynamic_link struct sunos_dynamic_info { /* Whether we found any dynamic information. */ - boolean valid; + bfd_boolean valid; /* Dynamic information. */ struct internal_sun4_dynamic_link dyninfo; /* Number of dynamic symbols. */ @@ -135,9 +134,9 @@ struct sunos_dynamic_info structure and uses it to find the dynamic_link structure. It creates and saves a sunos_dynamic_info structure. If it can't find __DYNAMIC, it sets the valid field of the sunos_dynamic_info - structure to false to avoid doing this work again. */ + structure to FALSE to avoid doing this work again. */ -static boolean +static bfd_boolean sunos_read_dynamic_info (abfd) bfd *abfd; { @@ -150,19 +149,19 @@ sunos_read_dynamic_info (abfd) bfd_size_type amt; if (obj_aout_dynamic_info (abfd) != (PTR) NULL) - return true; + return TRUE; if ((abfd->flags & DYNAMIC) == 0) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } amt = sizeof (struct sunos_dynamic_info); info = (struct sunos_dynamic_info *) bfd_zalloc (abfd, amt); if (!info) - return false; - info->valid = false; + return FALSE; + info->valid = FALSE; info->dynsym = NULL; info->dynstr = NULL; info->canonical_dynsym = NULL; @@ -178,15 +177,15 @@ sunos_read_dynamic_info (abfd) We could verify this assumption later by looking through the dynamic symbols for the __DYNAMIC symbol. */ if ((abfd->flags & DYNAMIC) == 0) - return true; + return TRUE; if (! bfd_get_section_contents (abfd, obj_datasec (abfd), (PTR) &dyninfo, (file_ptr) 0, (bfd_size_type) sizeof dyninfo)) - return true; + return TRUE; dynver = GET_WORD (abfd, dyninfo.ld_version); if (dynver != 2 && dynver != 3) - return true; + return TRUE; dynoff = GET_WORD (abfd, dyninfo.ld); @@ -198,14 +197,14 @@ sunos_read_dynamic_info (abfd) dynsec = obj_datasec (abfd); dynoff -= bfd_get_section_vma (abfd, dynsec); if (dynoff > bfd_section_size (abfd, dynsec)) - return true; + return TRUE; /* This executable appears to be dynamically linked in a way that we can understand. */ if (! bfd_get_section_contents (abfd, dynsec, (PTR) &linkinfo, (file_ptr) dynoff, (bfd_size_type) sizeof linkinfo)) - return true; + return TRUE; /* Swap in the dynamic link information. */ info->dyninfo.ld_loaded = GET_WORD (abfd, linkinfo.ld_loaded); @@ -252,9 +251,9 @@ sunos_read_dynamic_info (abfd) == (unsigned long) (info->dyninfo.ld_hash - info->dyninfo.ld_rel)); - info->valid = true; + info->valid = TRUE; - return true; + return TRUE; } /* Return the amount of memory required for the dynamic symbols. */ @@ -280,7 +279,7 @@ sunos_get_dynamic_symtab_upper_bound (abfd) /* Read the external dynamic symbols. */ -static boolean +static bfd_boolean sunos_slurp_dynamic_symtab (abfd) bfd *abfd; { @@ -291,14 +290,14 @@ sunos_slurp_dynamic_symtab (abfd) if (obj_aout_dynamic_info (abfd) == NULL) { if (! sunos_read_dynamic_info (abfd)) - return false; + return FALSE; } info = (struct sunos_dynamic_info *) obj_aout_dynamic_info (abfd); if (! info->valid) { bfd_set_error (bfd_error_no_symbols); - return false; + return FALSE; } /* Get the dynamic nlist structures. */ @@ -307,7 +306,7 @@ sunos_slurp_dynamic_symtab (abfd) amt = (bfd_size_type) info->dynsym_count * EXTERNAL_NLIST_SIZE; info->dynsym = (struct external_nlist *) bfd_alloc (abfd, amt); if (info->dynsym == NULL && info->dynsym_count != 0) - return false; + return FALSE; if (bfd_seek (abfd, (file_ptr) info->dyninfo.ld_stab, SEEK_SET) != 0 || bfd_bread ((PTR) info->dynsym, amt, abfd) != amt) { @@ -316,7 +315,7 @@ sunos_slurp_dynamic_symtab (abfd) bfd_release (abfd, info->dynsym); info->dynsym = NULL; } - return false; + return FALSE; } } @@ -326,7 +325,7 @@ sunos_slurp_dynamic_symtab (abfd) amt = info->dyninfo.ld_symb_size; info->dynstr = (char *) bfd_alloc (abfd, amt); if (info->dynstr == NULL && info->dyninfo.ld_symb_size != 0) - return false; + return FALSE; if (bfd_seek (abfd, (file_ptr) info->dyninfo.ld_symbols, SEEK_SET) != 0 || bfd_bread ((PTR) info->dynstr, amt, abfd) != amt) { @@ -335,11 +334,11 @@ sunos_slurp_dynamic_symtab (abfd) bfd_release (abfd, info->dynstr); info->dynstr = NULL; } - return false; + return FALSE; } } - return true; + return TRUE; } /* Read in the dynamic symbols. */ @@ -413,7 +412,7 @@ sunos_canonicalize_dynamic_symtab (abfd, storage) if (! aout_32_translate_symbol_table (abfd, info->canonical_dynsym, info->dynsym, (bfd_size_type) info->dynsym_count, - info->dynstr, strsize, true)) + info->dynstr, strsize, TRUE)) { if (info->canonical_dynsym != NULL) { @@ -651,13 +650,13 @@ struct sunos_link_hash_table bfd *dynobj; /* Whether we have created the dynamic sections. */ - boolean dynamic_sections_created; + bfd_boolean dynamic_sections_created; /* Whether we need the dynamic sections. */ - boolean dynamic_sections_needed; + bfd_boolean dynamic_sections_needed; /* Whether we need the .got table. */ - boolean got_needed; + bfd_boolean got_needed; /* The number of dynamic symbols. */ size_t dynsymcount; @@ -728,9 +727,9 @@ sunos_link_hash_table_create (abfd) } ret->dynobj = NULL; - ret->dynamic_sections_created = false; - ret->dynamic_sections_needed = false; - ret->got_needed = false; + ret->dynamic_sections_created = FALSE; + ret->dynamic_sections_needed = FALSE; + ret->got_needed = FALSE; ret->dynsymcount = 0; ret->bucketcount = 0; ret->needed = NULL; @@ -751,7 +750,7 @@ sunos_link_hash_table_create (abfd) #define sunos_link_hash_traverse(table, func, info) \ (aout_link_hash_traverse \ (&(table)->root, \ - (boolean (*) PARAMS ((struct aout_link_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) PARAMS ((struct aout_link_hash_entry *, PTR))) (func), \ (info))) /* Get the SunOS link hash table from the info structure. This is @@ -759,7 +758,7 @@ sunos_link_hash_table_create (abfd) #define sunos_hash_table(p) ((struct sunos_link_hash_table *) ((p)->hash)) -static boolean sunos_scan_dynamic_symbol +static bfd_boolean sunos_scan_dynamic_symbol PARAMS ((struct sunos_link_hash_entry *, PTR)); /* Create the dynamic sections needed if we are linking against a @@ -769,11 +768,11 @@ static boolean sunos_scan_dynamic_symbol place in the output file. See include/aout/sun4.h for more details of the dynamic linking information. */ -static boolean +static bfd_boolean sunos_create_dynamic_sections (abfd, info, needed) bfd *abfd; struct bfd_link_info *info; - boolean needed; + bfd_boolean needed; { asection *s; @@ -793,7 +792,7 @@ sunos_create_dynamic_sections (abfd, info, needed) if (s == NULL || ! bfd_set_section_flags (abfd, s, flags) || ! bfd_set_section_alignment (abfd, s, 2)) - return false; + return FALSE; /* The .got section holds the global offset table. The address is put in the ld_got field. */ @@ -801,7 +800,7 @@ sunos_create_dynamic_sections (abfd, info, needed) if (s == NULL || ! bfd_set_section_flags (abfd, s, flags) || ! bfd_set_section_alignment (abfd, s, 2)) - return false; + return FALSE; /* The .plt section holds the procedure linkage table. The address is put in the ld_plt field. */ @@ -809,7 +808,7 @@ sunos_create_dynamic_sections (abfd, info, needed) if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_CODE) || ! bfd_set_section_alignment (abfd, s, 2)) - return false; + return FALSE; /* The .dynrel section holds the dynamic relocs. The address is put in the ld_rel field. */ @@ -817,7 +816,7 @@ sunos_create_dynamic_sections (abfd, info, needed) if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) - return false; + return FALSE; /* The .hash section holds the dynamic hash table. The address is put in the ld_hash field. */ @@ -825,7 +824,7 @@ sunos_create_dynamic_sections (abfd, info, needed) if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) - return false; + return FALSE; /* The .dynsym section holds the dynamic symbols. The address is put in the ld_stab field. */ @@ -833,7 +832,7 @@ sunos_create_dynamic_sections (abfd, info, needed) if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) - return false; + return FALSE; /* The .dynstr section holds the dynamic symbol string table. The address is put in the ld_symbols field. */ @@ -841,9 +840,9 @@ sunos_create_dynamic_sections (abfd, info, needed) if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, 2)) - return false; + return FALSE; - sunos_hash_table (info)->dynamic_sections_created = true; + sunos_hash_table (info)->dynamic_sections_created = TRUE; } if ((needed && ! sunos_hash_table (info)->dynamic_sections_needed) @@ -857,17 +856,17 @@ sunos_create_dynamic_sections (abfd, info, needed) if (s->_raw_size == 0) s->_raw_size = BYTES_IN_WORD; - sunos_hash_table (info)->dynamic_sections_needed = true; - sunos_hash_table (info)->got_needed = true; + sunos_hash_table (info)->dynamic_sections_needed = TRUE; + sunos_hash_table (info)->got_needed = TRUE; } - return true; + return TRUE; } /* Add dynamic symbols during a link. This is called by the a.out backend linker for each object it encounters. */ -static boolean +static bfd_boolean sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) bfd *abfd; struct bfd_link_info *info; @@ -884,16 +883,14 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) if (info->hash->creator == abfd->xvec) { if (! sunos_create_dynamic_sections (abfd, info, - (((abfd->flags & DYNAMIC) != 0 - && ! info->relocateable) - ? true - : false))) - return false; + ((abfd->flags & DYNAMIC) != 0 + && !info->relocatable))) + return FALSE; } /* There is nothing else to do for a normal object. */ if ((abfd->flags & DYNAMIC) == 0) - return true; + return TRUE; dynobj = sunos_hash_table (info)->dynobj; @@ -914,15 +911,15 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) /* The native linker seems to just ignore dynamic objects when -r is used. */ - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; /* There's no hope of using a dynamic object which does not exactly match the format of the output file. */ if (info->hash->creator != abfd->xvec) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } /* Make sure we have a .need and a .rules sections. These are only @@ -942,7 +939,7 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) | SEC_IN_MEMORY | SEC_READONLY)) || ! bfd_set_section_alignment (dynobj, s, 2)) - return false; + return FALSE; } if (bfd_get_section_by_name (dynobj, ".rules") == NULL) @@ -959,12 +956,12 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) | SEC_IN_MEMORY | SEC_READONLY)) || ! bfd_set_section_alignment (dynobj, s, 2)) - return false; + return FALSE; } /* Pick up the dynamic symbols and return them to the caller. */ if (! sunos_slurp_dynamic_symtab (abfd)) - return false; + return FALSE; dinfo = (struct sunos_dynamic_info *) obj_aout_dynamic_info (abfd); *symsp = dinfo->dynsym; @@ -986,10 +983,10 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) if (bfd_seek (abfd, (file_ptr) need, SEEK_SET) != 0 || bfd_bread (buf, (bfd_size_type) 16, abfd) != 16) - return false; + return FALSE; /* For the format of an ld_need entry, see aout/sun4.h. We - should probably define structs for this manipulation. */ + should probably define structs for this manipulation. */ name = bfd_get_32 (abfd, buf); flags = bfd_get_32 (abfd, buf + 4); @@ -1000,14 +997,14 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) alc = sizeof (struct bfd_link_needed_list); needed = (struct bfd_link_needed_list *) bfd_alloc (abfd, alc); if (needed == NULL) - return false; + return FALSE; needed->by = abfd; /* We return the name as [-l]name[.maj][.min]. */ alc = 30; namebuf = (char *) bfd_malloc (alc + 1); if (namebuf == NULL) - return false; + return FALSE; p = namebuf; if ((flags & 0x80000000) != 0) @@ -1018,7 +1015,7 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) if (bfd_seek (abfd, (file_ptr) name, SEEK_SET) != 0) { free (namebuf); - return false; + return FALSE; } do @@ -1026,7 +1023,7 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) if (bfd_bread (&b, (bfd_size_type) 1, abfd) != 1) { free (namebuf); - return false; + return FALSE; } if ((bfd_size_type) (p - namebuf) >= alc) @@ -1038,7 +1035,7 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) if (n == NULL) { free (namebuf); - return false; + return FALSE; } p = n + (p - namebuf); namebuf = n; @@ -1070,7 +1067,7 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) if (n == NULL) { free (namebuf); - return false; + return FALSE; } p = n + (p - namebuf); namebuf = n; @@ -1084,7 +1081,7 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) if (namecopy == NULL) { free (namebuf); - return false; + return FALSE; } strcpy (namecopy, namebuf); free (namebuf); @@ -1099,14 +1096,14 @@ sunos_add_dynamic_symbols (abfd, info, symsp, sym_countp, stringsp) *pp = needed; } - return true; + return TRUE; } /* Function to add a single symbol to the linker hash table. This is a wrapper around _bfd_generic_link_add_one_symbol which handles the tweaking needed for dynamic linking support. */ -static boolean +static bfd_boolean sunos_add_one_symbol (info, abfd, name, flags, section, value, string, copy, collect, hashp) struct bfd_link_info *info; @@ -1116,8 +1113,8 @@ sunos_add_one_symbol (info, abfd, name, flags, section, value, string, asection *section; bfd_vma value; const char *string; - boolean copy; - boolean collect; + bfd_boolean copy; + bfd_boolean collect; struct bfd_link_hash_entry **hashp; { struct sunos_link_hash_entry *h; @@ -1125,13 +1122,13 @@ sunos_add_one_symbol (info, abfd, name, flags, section, value, string, if ((flags & (BSF_INDIRECT | BSF_WARNING | BSF_CONSTRUCTOR)) != 0 || ! bfd_is_und_section (section)) - h = sunos_link_hash_lookup (sunos_hash_table (info), name, true, copy, - false); + h = sunos_link_hash_lookup (sunos_hash_table (info), name, TRUE, copy, + FALSE); else h = ((struct sunos_link_hash_entry *) - bfd_wrapped_link_hash_lookup (abfd, info, name, true, copy, false)); + bfd_wrapped_link_hash_lookup (abfd, info, name, TRUE, copy, FALSE)); if (h == NULL) - return false; + return FALSE; if (hashp != NULL) *hashp = (struct bfd_link_hash_entry *) h; @@ -1185,10 +1182,10 @@ sunos_add_one_symbol (info, abfd, name, flags, section, value, string, && (h->flags & SUNOS_CONSTRUCTOR) != 0) { /* The existing symbol is a constructor symbol, and this symbol - is from a dynamic object. A constructor symbol is actually a - definition, although the type will be bfd_link_hash_undefined - at this point. We want to ignore the definition from the - dynamic object. */ + is from a dynamic object. A constructor symbol is actually a + definition, although the type will be bfd_link_hash_undefined + at this point. We want to ignore the definition from the + dynamic object. */ section = bfd_und_section_ptr; } else if ((flags & BSF_CONSTRUCTOR) != 0 @@ -1198,8 +1195,8 @@ sunos_add_one_symbol (info, abfd, name, flags, section, value, string, && (h->root.root.u.def.section->owner->flags & DYNAMIC) != 0) { /* The existing symbol is defined by a dynamic object, and this - is a constructor symbol. As above, we want to force the use - of the constructor symbol from the regular object. */ + is a constructor symbol. As above, we want to force the use + of the constructor symbol from the regular object. */ h->root.root.type = bfd_link_hash_new; } @@ -1207,7 +1204,7 @@ sunos_add_one_symbol (info, abfd, name, flags, section, value, string, if (! _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, string, copy, collect, hashp)) - return false; + return FALSE; if (abfd->xvec == info->hash->creator) { @@ -1244,12 +1241,11 @@ sunos_add_one_symbol (info, abfd, name, flags, section, value, string, h->flags |= SUNOS_CONSTRUCTOR; } - return true; + return TRUE; } /* Return the list of objects needed by BFD. */ -/*ARGSUSED*/ struct bfd_link_needed_list * bfd_sunos_get_needed_list (abfd, info) bfd *abfd ATTRIBUTE_UNUSED; @@ -1263,7 +1259,7 @@ bfd_sunos_get_needed_list (abfd, info) /* Record an assignment made to a symbol by a linker script. We need this in case some dynamic object refers to this symbol. */ -boolean +bfd_boolean bfd_sunos_record_link_assignment (output_bfd, info, name) bfd *output_bfd; struct bfd_link_info *info; @@ -1272,15 +1268,15 @@ bfd_sunos_record_link_assignment (output_bfd, info, name) struct sunos_link_hash_entry *h; if (output_bfd->xvec != &MY(vec)) - return true; + return TRUE; /* This is called after we have examined all the input objects. If the symbol does not exist, it merely means that no object refers to it, and we can just ignore it at this point. */ h = sunos_link_hash_lookup (sunos_hash_table (info), name, - false, false, false); + FALSE, FALSE, FALSE); if (h == NULL) - return true; + return TRUE; /* In a shared library, the __DYNAMIC symbol does not appear in the dynamic symbol table. */ @@ -1295,7 +1291,7 @@ bfd_sunos_record_link_assignment (output_bfd, info, name) } } - return true; + return TRUE; } /* Set up the sizes and contents of the dynamic sections created in @@ -1304,10 +1300,10 @@ bfd_sunos_record_link_assignment (output_bfd, info, name) sections before the linker sets the addresses of the various sections. This unfortunately requires reading all the relocs so that we can work out which ones need to become dynamic relocs. If - info->keep_memory is true, we keep the relocs in memory; otherwise, + info->keep_memory is TRUE, we keep the relocs in memory; otherwise, we discard them, and will read them again later. */ -boolean +bfd_boolean bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, srulesptr) bfd *output_bfd; @@ -1329,11 +1325,11 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, *sneedptr = NULL; *srulesptr = NULL; - if (info->relocateable) - return true; + if (info->relocatable) + return TRUE; if (output_bfd->xvec != &MY(vec)) - return true; + return TRUE; /* Look through all the input BFD's and read their relocs. It would be better if we didn't have to do this, but there is no other way @@ -1349,7 +1345,7 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, exec_hdr (sub)->a_trsize) || ! sunos_scan_relocs (info, sub, obj_datasec (sub), exec_hdr (sub)->a_drsize)) - return false; + return FALSE; } } @@ -1360,11 +1356,11 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, to build a global offset table, there is nothing to do here. */ if (! sunos_hash_table (info)->dynamic_sections_needed && ! sunos_hash_table (info)->got_needed) - return true; + return TRUE; /* If __GLOBAL_OFFSET_TABLE_ was mentioned, define it. */ h = sunos_link_hash_lookup (sunos_hash_table (info), - "__GLOBAL_OFFSET_TABLE_", false, false, false); + "__GLOBAL_OFFSET_TABLE_", FALSE, FALSE, FALSE); if (h != NULL && (h->flags & SUNOS_REF_REGULAR) != 0) { h->flags |= SUNOS_DEF_REGULAR; @@ -1377,8 +1373,8 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, h->root.root.u.def.section = bfd_get_section_by_name (dynobj, ".got"); /* If the .got section is more than 0x1000 bytes, we set - __GLOBAL_OFFSET_TABLE_ to be 0x1000 bytes into the section, - so that 13 bit relocations have a greater chance of working. */ + __GLOBAL_OFFSET_TABLE_ to be 0x1000 bytes into the section, + so that 13 bit relocations have a greater chance of working. */ s = bfd_get_section_by_name (dynobj, ".got"); BFD_ASSERT (s != NULL); if (s->_raw_size >= 0x1000) @@ -1415,7 +1411,7 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, s->_raw_size = dynsymcount * sizeof (struct external_nlist); s->contents = (bfd_byte *) bfd_alloc (output_bfd, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) - return false; + return FALSE; /* The number of buckets is just the number of symbols divided by four. To compute the final size of the hash table, we @@ -1436,7 +1432,7 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, hashalloc = (dynsymcount + bucketcount - 1) * HASH_ENTRY_SIZE; s->contents = (bfd_byte *) bfd_zalloc (dynobj, hashalloc); if (s->contents == NULL && dynsymcount > 0) - return false; + return FALSE; for (i = 0; i < bucketcount; i++) PUT_WORD (output_bfd, (bfd_vma) -1, s->contents + i * HASH_ENTRY_SIZE); s->_raw_size = bucketcount * HASH_ENTRY_SIZE; @@ -1466,7 +1462,7 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, contents = (bfd_byte *) bfd_realloc (s->contents, s->_raw_size + add); if (contents == NULL) - return false; + return FALSE; memset (contents + s->_raw_size, 0, (size_t) add); s->contents = contents; s->_raw_size += add; @@ -1481,7 +1477,7 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, { s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); if (s->contents == NULL) - return false; + return FALSE; /* Fill in the first entry in the table. */ switch (bfd_get_arch (dynobj)) @@ -1504,7 +1500,7 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, { s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); if (s->contents == NULL) - return false; + return FALSE; } /* We use the reloc_count field to keep track of how many of the relocs we have output so far. */ @@ -1514,17 +1510,17 @@ bfd_sunos_size_dynamic_sections (output_bfd, info, sdynptr, sneedptr, s = bfd_get_section_by_name (dynobj, ".got"); s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); if (s->contents == NULL) - return false; + return FALSE; *sneedptr = bfd_get_section_by_name (dynobj, ".need"); *srulesptr = bfd_get_section_by_name (dynobj, ".rules"); - return true; + return TRUE; } /* Scan the relocs for an input section. */ -static boolean +static bfd_boolean sunos_scan_relocs (info, abfd, sec, rel_size) struct bfd_link_info *info; bfd *abfd; @@ -1535,7 +1531,7 @@ sunos_scan_relocs (info, abfd, sec, rel_size) PTR free_relocs = NULL; if (rel_size == 0) - return true; + return TRUE; if (! info->keep_memory) relocs = free_relocs = bfd_malloc (rel_size); @@ -1555,7 +1551,7 @@ sunos_scan_relocs (info, abfd, sec, rel_size) } } if (relocs == NULL) - return false; + return FALSE; if (bfd_seek (abfd, sec->rel_filepos, SEEK_SET) != 0 || bfd_bread (relocs, rel_size, abfd) != rel_size) @@ -1579,12 +1575,12 @@ sunos_scan_relocs (info, abfd, sec, rel_size) if (free_relocs != NULL) free (free_relocs); - return true; + return TRUE; error_return: if (free_relocs != NULL) free (free_relocs); - return false; + return FALSE; } /* Scan the relocs for an input section using standard relocs. We @@ -1597,7 +1593,7 @@ sunos_scan_relocs (info, abfd, sec, rel_size) reloc. FIXME: We should also handle the PIC relocs here by building global offset table entries. */ -static boolean +static bfd_boolean sunos_scan_std_relocs (info, abfd, sec, relocs, rel_size) struct bfd_link_info *info; bfd *abfd; @@ -1615,7 +1611,7 @@ sunos_scan_std_relocs (info, abfd, sec, relocs, rel_size) if (bfd_get_arch (abfd) != bfd_arch_m68k) { bfd_set_error (bfd_error_invalid_target); - return false; + return FALSE; } dynobj = NULL; @@ -1677,8 +1673,8 @@ sunos_scan_std_relocs (info, abfd, sec, relocs, rel_size) { asection *sgot; - if (! sunos_create_dynamic_sections (abfd, info, false)) - return false; + if (! sunos_create_dynamic_sections (abfd, info, FALSE)) + return FALSE; dynobj = sunos_hash_table (info)->dynobj; splt = bfd_get_section_by_name (dynobj, ".plt"); srel = bfd_get_section_by_name (dynobj, ".dynrel"); @@ -1688,7 +1684,7 @@ sunos_scan_std_relocs (info, abfd, sec, relocs, rel_size) BFD_ASSERT (sgot != NULL); if (sgot->_raw_size == 0) sgot->_raw_size = BYTES_IN_WORD; - sunos_hash_table (info)->got_needed = true; + sunos_hash_table (info)->got_needed = TRUE; } BFD_ASSERT ((h->flags & SUNOS_REF_REGULAR) != 0); @@ -1748,7 +1744,7 @@ sunos_scan_std_relocs (info, abfd, sec, relocs, rel_size) } } - return true; + return TRUE; } /* Scan the relocs for an input section using extended relocs. We @@ -1757,7 +1753,7 @@ sunos_scan_std_relocs (info, abfd, sec, relocs, rel_size) section, an entry is made in the procedure linkage table. Otherwise, we must preserve the reloc as a dynamic reloc. */ -static boolean +static bfd_boolean sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size) struct bfd_link_info *info; bfd *abfd; @@ -1777,7 +1773,7 @@ sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size) if (bfd_get_arch (abfd) != bfd_arch_sparc) { bfd_set_error (bfd_error_invalid_target); - return false; + return FALSE; } dynobj = NULL; @@ -1824,15 +1820,15 @@ sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size) } /* If this is a base relative reloc, we need to make an entry in - the .got section. */ + the .got section. */ if (r_type == RELOC_BASE10 || r_type == RELOC_BASE13 || r_type == RELOC_BASE22) { if (dynobj == NULL) { - if (! sunos_create_dynamic_sections (abfd, info, false)) - return false; + if (! sunos_create_dynamic_sections (abfd, info, FALSE)) + return FALSE; dynobj = sunos_hash_table (info)->dynobj; splt = bfd_get_section_by_name (dynobj, ".plt"); sgot = bfd_get_section_by_name (dynobj, ".got"); @@ -1842,7 +1838,7 @@ sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size) /* Make sure we have an initial entry in the .got table. */ if (sgot->_raw_size == 0) sgot->_raw_size = BYTES_IN_WORD; - sunos_hash_table (info)->got_needed = true; + sunos_hash_table (info)->got_needed = TRUE; } if (r_extern) @@ -1868,7 +1864,7 @@ sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size) adata (abfd).local_got_offsets = (bfd_vma *) bfd_zalloc (abfd, amt); if (adata (abfd).local_got_offsets == NULL) - return false; + return FALSE; } if (adata (abfd).local_got_offsets[r_index] != 0) @@ -1892,18 +1888,18 @@ sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size) } /* Otherwise, we are only interested in relocs against symbols - defined in dynamic objects but not in regular objects. We - only need to consider relocs against external symbols. */ + defined in dynamic objects but not in regular objects. We + only need to consider relocs against external symbols. */ if (! r_extern) { /* But, if we are creating a shared library, we need to - generate an absolute reloc. */ + generate an absolute reloc. */ if (info->shared) { if (dynobj == NULL) { - if (! sunos_create_dynamic_sections (abfd, info, true)) - return false; + if (! sunos_create_dynamic_sections (abfd, info, TRUE)) + return FALSE; dynobj = sunos_hash_table (info)->dynobj; splt = bfd_get_section_by_name (dynobj, ".plt"); sgot = bfd_get_section_by_name (dynobj, ".got"); @@ -1939,8 +1935,8 @@ sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size) && (h->flags & SUNOS_DEF_REGULAR) == 0) { /* This symbol is apparently undefined. Don't do anything - here; just let the relocation routine report an undefined - symbol. */ + here; just let the relocation routine report an undefined + symbol. */ continue; } @@ -1949,8 +1945,8 @@ sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size) if (dynobj == NULL) { - if (! sunos_create_dynamic_sections (abfd, info, false)) - return false; + if (! sunos_create_dynamic_sections (abfd, info, FALSE)) + return FALSE; dynobj = sunos_hash_table (info)->dynobj; splt = bfd_get_section_by_name (dynobj, ".plt"); sgot = bfd_get_section_by_name (dynobj, ".got"); @@ -1960,7 +1956,7 @@ sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size) /* Make sure we have an initial entry in the .got table. */ if (sgot->_raw_size == 0) sgot->_raw_size = BYTES_IN_WORD; - sunos_hash_table (info)->got_needed = true; + sunos_hash_table (info)->got_needed = TRUE; } BFD_ASSERT (r_type == RELOC_JMP_TBL @@ -2025,26 +2021,26 @@ sunos_scan_ext_relocs (info, abfd, sec, relocs, rel_size) splt->_raw_size += SPARC_PLT_ENTRY_SIZE; /* We will also need a dynamic reloc entry, unless this - is a JMP_TBL reloc produced by linking PIC compiled - code, and we are not making a shared library. */ + is a JMP_TBL reloc produced by linking PIC compiled + code, and we are not making a shared library. */ if (info->shared || (h->flags & SUNOS_DEF_REGULAR) == 0) srel->_raw_size += RELOC_EXT_SIZE; } /* If we are creating a shared library, we need to copy over - any reloc other than a jump table reloc. */ + any reloc other than a jump table reloc. */ if (info->shared && r_type != RELOC_JMP_TBL) srel->_raw_size += RELOC_EXT_SIZE; } } - return true; + return TRUE; } /* Build the hash table of dynamic symbols, and to mark as written all symbols from dynamic objects which we do not plan to write out. */ -static boolean +static bfd_boolean sunos_scan_dynamic_symbol (h, data) struct sunos_link_hash_entry *h; PTR data; @@ -2066,7 +2062,7 @@ sunos_scan_dynamic_symbol (h, data) if ((h->flags & SUNOS_DEF_REGULAR) == 0 && (h->flags & SUNOS_DEF_DYNAMIC) != 0 && strcmp (h->root.root.root.string, "__DYNAMIC") != 0) - h->root.written = true; + h->root.written = TRUE; /* If this symbol is defined by a dynamic object and referenced by a regular object, see whether we gave it a reasonable value while @@ -2125,7 +2121,7 @@ sunos_scan_dynamic_symbol (h, data) contents = (bfd_byte *) bfd_realloc (s->contents, s->_raw_size + len + 1); if (contents == NULL) - return false; + return FALSE; s->contents = contents; h->dynstr_index = s->_raw_size; @@ -2161,26 +2157,25 @@ sunos_scan_dynamic_symbol (h, data) } } - return true; + return TRUE; } /* Link a dynamic object. We actually don't have anything to do at this point. This entry point exists to prevent the regular linker code from doing anything with the object. */ -/*ARGSUSED*/ -static boolean +static bfd_boolean sunos_link_dynamic_object (info, abfd) struct bfd_link_info *info ATTRIBUTE_UNUSED; bfd *abfd ATTRIBUTE_UNUSED; { - return true; + return TRUE; } /* Write out a dynamic symbol. This is called by the final traversal over the symbol table. */ -static boolean +static bfd_boolean sunos_write_dynamic_symbol (output_bfd, info, harg) bfd *output_bfd; struct bfd_link_info *info; @@ -2254,7 +2249,7 @@ sunos_write_dynamic_symbol (output_bfd, info, harg) } /* We also need to add a jump table reloc, unless this is the - result of a JMP_TBL reloc from PIC compiled code. */ + result of a JMP_TBL reloc from PIC compiled code. */ if (info->shared || (h->flags & SUNOS_DEF_REGULAR) == 0) { BFD_ASSERT (h->dynindx >= 0); @@ -2320,7 +2315,7 @@ sunos_write_dynamic_symbol (output_bfd, info, harg) we can have a PLT entry for a nondynamic symbol when linking PIC compiled code from a regular object. */ if (h->dynindx < 0) - return true; + return TRUE; switch (h->root.root.type) { @@ -2328,7 +2323,7 @@ sunos_write_dynamic_symbol (output_bfd, info, harg) case bfd_link_hash_new: abort (); /* Avoid variable not initialized warnings. */ - return true; + return TRUE; case bfd_link_hash_undefined: type = N_UNDF | N_EXT; val = 0; @@ -2386,7 +2381,7 @@ sunos_write_dynamic_symbol (output_bfd, info, harg) case bfd_link_hash_warning: /* FIXME: Ignore these for now. The circumstances under which they should be written out are not clear to me. */ - return true; + return TRUE; } s = bfd_get_section_by_name (sunos_hash_table (info)->dynobj, ".dynsym"); @@ -2405,7 +2400,7 @@ sunos_write_dynamic_symbol (output_bfd, info, harg) PUT_WORD (output_bfd, h->dynstr_index, outsym->e_strx); PUT_WORD (output_bfd, val, outsym->e_value); - return true; + return TRUE; } /* This is called for each reloc against an external symbol. If this @@ -2413,8 +2408,7 @@ sunos_write_dynamic_symbol (output_bfd, info, harg) copy it over, and tell the caller to not bother processing this reloc. */ -/*ARGSUSED*/ -static boolean +static bfd_boolean sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, contents, skip, relocationp) struct bfd_link_info *info; @@ -2423,19 +2417,19 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, struct aout_link_hash_entry *harg; PTR reloc; bfd_byte *contents ATTRIBUTE_UNUSED; - boolean *skip; + bfd_boolean *skip; bfd_vma *relocationp; { struct sunos_link_hash_entry *h = (struct sunos_link_hash_entry *) harg; bfd *dynobj; - boolean baserel; - boolean jmptbl; - boolean pcrel; + bfd_boolean baserel; + bfd_boolean jmptbl; + bfd_boolean pcrel; asection *s; bfd_byte *p; long indx; - *skip = false; + *skip = FALSE; dynobj = sunos_hash_table (info)->dynobj; @@ -2493,7 +2487,7 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, || r_type == RELOC_WDISP30 || r_type == RELOC_WDISP22); /* We don't consider the PC10 and PC22 types to be PC relative, - because they are pcrel_offset. */ + because they are pcrel_offset. */ } if (baserel) @@ -2562,7 +2556,7 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, && (h->flags & SUNOS_DEF_REGULAR) == 0)) { /* We need to create a GLOB_DAT or 32 reloc to tell the - dynamic linker to fill in this entry in the table. */ + dynamic linker to fill in this entry in the table. */ s = bfd_get_section_by_name (dynobj, ".dynrel"); BFD_ASSERT (s != NULL); @@ -2667,11 +2661,11 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, - sunos_hash_table (info)->got_base); /* There is nothing else to do for a base relative reloc. */ - return true; + return TRUE; } if (! sunos_hash_table (info)->dynamic_sections_needed) - return true; + return TRUE; if (! info->shared) { if (h == NULL @@ -2680,7 +2674,7 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, || (h->flags & SUNOS_DEF_REGULAR) != 0 || (h->flags & SUNOS_DEF_DYNAMIC) == 0 || (h->root.root.u.undef.abfd->flags & DYNAMIC) == 0) - return true; + return TRUE; } else { @@ -2689,7 +2683,7 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, || jmptbl || strcmp (h->root.root.root.string, "__GLOBAL_OFFSET_TABLE_") == 0)) - return true; + return TRUE; } /* It looks like this is a reloc we are supposed to copy. */ @@ -2732,7 +2726,7 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, srel->r_index[0] = (bfd_byte)indx; } /* FIXME: We may have to change the addend for a PC relative - reloc. */ + reloc. */ } else { @@ -2771,14 +2765,14 @@ sunos_check_dynamic_reloc (info, input_bfd, input_section, harg, reloc, ++s->reloc_count; if (h != NULL) - *skip = true; + *skip = TRUE; - return true; + return TRUE; } /* Finish up the dynamic linking information. */ -static boolean +static bfd_boolean sunos_finish_dynamic_link (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -2790,7 +2784,7 @@ sunos_finish_dynamic_link (abfd, info) if (! sunos_hash_table (info)->dynamic_sections_needed && ! sunos_hash_table (info)->got_needed) - return true; + return TRUE; dynobj = sunos_hash_table (info)->dynobj; @@ -2843,7 +2837,7 @@ sunos_finish_dynamic_link (abfd, info) o->contents, (file_ptr) o->output_offset, o->_raw_size)) - return false; + return FALSE; } } @@ -2868,7 +2862,7 @@ sunos_finish_dynamic_link (abfd, info) if (! bfd_set_section_contents (abfd, sdyn->output_section, &esd, (file_ptr) sdyn->output_offset, (bfd_size_type) sizeof esd)) - return false; + return FALSE; PUT_WORD (dynobj, (bfd_vma) 0, esdl.ld_loaded); @@ -2936,10 +2930,10 @@ sunos_finish_dynamic_link (abfd, info) pos += sizeof esd + EXTERNAL_SUN4_DYNAMIC_DEBUGGER_SIZE; if (! bfd_set_section_contents (abfd, sdyn->output_section, &esdl, pos, (bfd_size_type) sizeof esdl)) - return false; + return FALSE; abfd->flags |= DYNAMIC; } - return true; + return TRUE; } diff --git a/contrib/binutils/bfd/syms.c b/contrib/binutils/bfd/syms.c index da71d80..c07f48b 100644 --- a/contrib/binutils/bfd/syms.c +++ b/contrib/binutils/bfd/syms.c @@ -1,24 +1,24 @@ /* Generic symbol-table support for the BFD library. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Cygnus Support. -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. */ /* SECTION @@ -74,10 +74,10 @@ SUBSECTION | if (storage_needed < 0) | FAIL | -| if (storage_needed == 0) { -| return ; -| } -| symbol_table = (asymbol **) xmalloc (storage_needed); +| if (storage_needed == 0) +| return; +| +| symbol_table = xmalloc (storage_needed); | ... | number_of_symbols = | bfd_canonicalize_symtab (abfd, symbol_table); @@ -85,9 +85,8 @@ SUBSECTION | if (number_of_symbols < 0) | FAIL | -| for (i = 0; i < number_of_symbols; i++) { -| process_symbol (symbol_table[i]); -| } +| for (i = 0; i < number_of_symbols; i++) +| process_symbol (symbol_table[i]); All storage for the symbols themselves is in an objalloc connected to the BFD; it is freed when the BFD is closed. @@ -108,34 +107,35 @@ SUBSECTION example showing the creation of a symbol table with only one element: | #include "bfd.h" -| main() +| int main (void) | { | bfd *abfd; | asymbol *ptrs[2]; | asymbol *new; | -| abfd = bfd_openw("foo","a.out-sunos-big"); -| bfd_set_format(abfd, bfd_object); -| new = bfd_make_empty_symbol(abfd); +| abfd = bfd_openw ("foo","a.out-sunos-big"); +| bfd_set_format (abfd, bfd_object); +| new = bfd_make_empty_symbol (abfd); | new->name = "dummy_symbol"; -| new->section = bfd_make_section_old_way(abfd, ".text"); +| new->section = bfd_make_section_old_way (abfd, ".text"); | new->flags = BSF_GLOBAL; | new->value = 0x12345; | | ptrs[0] = new; -| ptrs[1] = (asymbol *)0; +| ptrs[1] = 0; | -| bfd_set_symtab(abfd, ptrs, 1); -| bfd_close(abfd); +| bfd_set_symtab (abfd, ptrs, 1); +| bfd_close (abfd); +| return 0; | } | | ./makesym | nm foo | 00012345 A dummy_symbol - Many formats cannot represent arbitary symbol information; for + Many formats cannot represent arbitrary symbol information; for instance, the <> object format does not allow an - arbitary number of sections. A symbol pointing to a section + arbitrary number of sections. A symbol pointing to a section which is not one of <<.text>>, <<.data>> or <<.bss>> cannot be described. @@ -181,7 +181,7 @@ SUBSECTION CODE_FRAGMENT . -.typedef struct symbol_cache_entry +.typedef struct bfd_symbol .{ . {* A pointer to the BFD which owns the symbol. This information . is necessary so that a back end can work out what additional @@ -192,7 +192,7 @@ CODE_FRAGMENT . instead, except that some symbols point to the global sections . bfd_{abs,com,und}_section. This could be fixed by making . these globals be per-bfd (or per-target-flavor). FIXME. *} -. struct _bfd *the_bfd; {* Use bfd_asymbol_bfd(sym) to access this field. *} +. struct bfd *the_bfd; {* Use bfd_asymbol_bfd(sym) to access this field. *} . . {* The text of the symbol. The name is left alone, and not copied; the . application may not alter it. *} @@ -222,7 +222,7 @@ CODE_FRAGMENT . <>, <>, <> or . <>. *} . -. {* The symbol is a debugging record. The value has an arbitary +. {* The symbol is a debugging record. The value has an arbitrary . meaning, unless BSF_DEBUGGING_RELOC is also set. *} .#define BSF_DEBUGGING 0x08 . @@ -293,12 +293,12 @@ CODE_FRAGMENT . {* A pointer to the section to which this symbol is . relative. This will always be non NULL, there are special . sections for undefined and absolute symbols. *} -. struct sec *section; +. struct bfd_section *section; . . {* Back end special data. *} . union . { -. PTR p; +. void *p; . bfd_vma i; . } . udata; @@ -314,10 +314,6 @@ CODE_FRAGMENT #include "bfdlink.h" #include "aout/stab_gnu.h" -static char coff_section_type PARAMS ((const char *)); -static char decode_section_type PARAMS ((const struct sec *)); -static int cmpindexentry PARAMS ((const PTR, const PTR)); - /* DOCDD INODE @@ -346,25 +342,23 @@ FUNCTION bfd_is_local_label SYNOPSIS - boolean bfd_is_local_label(bfd *abfd, asymbol *sym); + bfd_boolean bfd_is_local_label (bfd *abfd, asymbol *sym); DESCRIPTION - Return true if the given symbol @var{sym} in the BFD @var{abfd} is - a compiler generated local label, else return false. + Return TRUE if the given symbol @var{sym} in the BFD @var{abfd} is + a compiler generated local label, else return FALSE. */ -boolean -bfd_is_local_label (abfd, sym) - bfd *abfd; - asymbol *sym; +bfd_boolean +bfd_is_local_label (bfd *abfd, asymbol *sym) { /* The BSF_SECTION_SYM check is needed for IA-64, where every label that starts with '.' is local. This would accidentally catch section names if we didn't reject them here. */ if ((sym->flags & (BSF_GLOBAL | BSF_WEAK | BSF_SECTION_SYM)) != 0) - return false; + return FALSE; if (sym->name == NULL) - return false; + return FALSE; return bfd_is_local_label_name (abfd, sym->name); } @@ -373,16 +367,16 @@ FUNCTION bfd_is_local_label_name SYNOPSIS - boolean bfd_is_local_label_name(bfd *abfd, const char *name); + bfd_boolean bfd_is_local_label_name (bfd *abfd, const char *name); DESCRIPTION - Return true if a symbol with the name @var{name} in the BFD + Return TRUE if a symbol with the name @var{name} in the BFD @var{abfd} is a compiler generated local label, else return - false. This just checks whether the name has the form of a + FALSE. This just checks whether the name has the form of a local label. .#define bfd_is_local_label_name(abfd, name) \ -. BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) +. BFD_SEND (abfd, _bfd_is_local_label_name, (abfd, name)) . */ @@ -398,8 +392,7 @@ DESCRIPTION including the NULL. .#define bfd_canonicalize_symtab(abfd, location) \ -. BFD_SEND (abfd, _bfd_canonicalize_symtab,\ -. (abfd, location)) +. BFD_SEND (abfd, _bfd_canonicalize_symtab, (abfd, location)) . */ @@ -408,7 +401,8 @@ FUNCTION bfd_set_symtab SYNOPSIS - boolean bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int count); + bfd_boolean bfd_set_symtab + (bfd *abfd, asymbol **location, unsigned int count); DESCRIPTION Arrange that when the output BFD @var{abfd} is closed, @@ -416,21 +410,18 @@ DESCRIPTION will be written. */ -boolean -bfd_set_symtab (abfd, location, symcount) - bfd *abfd; - asymbol **location; - unsigned int symcount; +bfd_boolean +bfd_set_symtab (bfd *abfd, asymbol **location, unsigned int symcount) { - if ((abfd->format != bfd_object) || (bfd_read_p (abfd))) + if (abfd->format != bfd_object || bfd_read_p (abfd)) { bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } bfd_get_outsymbols (abfd) = location; bfd_get_symcount (abfd) = symcount; - return true; + return TRUE; } /* @@ -438,29 +429,23 @@ FUNCTION bfd_print_symbol_vandf SYNOPSIS - void bfd_print_symbol_vandf(bfd *abfd, PTR file, asymbol *symbol); + void bfd_print_symbol_vandf (bfd *abfd, void *file, asymbol *symbol); DESCRIPTION Print the value and flags of the @var{symbol} supplied to the stream @var{file}. */ void -bfd_print_symbol_vandf (abfd, arg, symbol) - bfd *abfd; - PTR arg; - asymbol *symbol; +bfd_print_symbol_vandf (bfd *abfd, void *arg, asymbol *symbol) { - FILE *file = (FILE *) arg; + FILE *file = arg; + flagword type = symbol->flags; - if (symbol->section != (asection *) NULL) - { - bfd_fprintf_vma (abfd, file, - symbol->value + symbol->section->vma); - } + + if (symbol->section != NULL) + bfd_fprintf_vma (abfd, file, symbol->value + symbol->section->vma); else - { - bfd_fprintf_vma (abfd, file, symbol->value); - } + bfd_fprintf_vma (abfd, file, symbol->value); /* This presumes that a symbol can not be both BSF_DEBUGGING and BSF_DYNAMIC, nor more than one of BSF_FUNCTION, BSF_FILE, and @@ -495,7 +480,7 @@ DESCRIPTION information, and will cause problems later on. .#define bfd_make_empty_symbol(abfd) \ -. BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) +. BFD_SEND (abfd, _bfd_make_empty_symbol, (abfd)) . */ @@ -514,11 +499,10 @@ DESCRIPTION */ asymbol * -_bfd_generic_make_empty_symbol (abfd) - bfd *abfd; +_bfd_generic_make_empty_symbol (bfd *abfd) { bfd_size_type amt = sizeof (asymbol); - asymbol *new = (asymbol *) bfd_zalloc (abfd, amt); + asymbol *new = bfd_zalloc (abfd, amt); if (new) new->the_bfd = abfd; return new; @@ -534,7 +518,7 @@ DESCRIPTION yet to be worked out. .#define bfd_make_debug_symbol(abfd,ptr,size) \ -. BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) +. BFD_SEND (abfd, _bfd_make_debug_symbol, (abfd, ptr, size)) . */ @@ -578,8 +562,7 @@ static const struct section_to_type stt[] = 't' as well as .text */ static char -coff_section_type (s) - const char *s; +coff_section_type (const char *s) { const struct section_to_type *t; @@ -598,8 +581,7 @@ coff_section_type (s) we could perhaps obsolete coff_section_type. */ static char -decode_section_type (section) - const struct sec *section; +decode_section_type (const struct bfd_section *section) { if (section->flags & SEC_CODE) return 't'; @@ -621,6 +603,8 @@ decode_section_type (section) } if (section->flags & SEC_DEBUGGING) return 'N'; + if ((section->flags & SEC_HAS_CONTENTS) && (section->flags & SEC_READONLY)) + return 'n'; return '?'; } @@ -634,11 +618,10 @@ DESCRIPTION class of @var{symbol}, or '?' for an unknown class. SYNOPSIS - int bfd_decode_symclass(asymbol *symbol); + int bfd_decode_symclass (asymbol *symbol); */ int -bfd_decode_symclass (symbol) - asymbol *symbol; +bfd_decode_symclass (asymbol *symbol) { char c; @@ -706,14 +689,13 @@ DESCRIPTION Returns zero otherwise. SYNOPSIS - boolean bfd_is_undefined_symclass (int symclass); + bfd_boolean bfd_is_undefined_symclass (int symclass); */ -boolean -bfd_is_undefined_symclass (symclass) - int symclass; +bfd_boolean +bfd_is_undefined_symclass (int symclass) { - return (boolean) (symclass == 'U' || symclass == 'w' || symclass == 'v'); + return symclass == 'U' || symclass == 'w' || symclass == 'v'; } /* @@ -726,13 +708,11 @@ DESCRIPTION calling this function. SYNOPSIS - void bfd_symbol_info(asymbol *symbol, symbol_info *ret); + void bfd_symbol_info (asymbol *symbol, symbol_info *ret); */ void -bfd_symbol_info (symbol, ret) - asymbol *symbol; - symbol_info *ret; +bfd_symbol_info (asymbol *symbol, symbol_info *ret) { ret->type = bfd_decode_symclass (symbol); @@ -749,20 +729,21 @@ FUNCTION bfd_copy_private_symbol_data SYNOPSIS - boolean bfd_copy_private_symbol_data(bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); + bfd_boolean bfd_copy_private_symbol_data + (bfd *ibfd, asymbol *isym, bfd *obfd, asymbol *osym); DESCRIPTION Copy private symbol information from @var{isym} in the BFD @var{ibfd} to the symbol @var{osym} in the BFD @var{obfd}. - Return <> on success, <> on error. Possible error + Return <> on success, <> on error. Possible error returns are: o <> - Not enough memory exists to create private data for @var{osec}. .#define bfd_copy_private_symbol_data(ibfd, isymbol, obfd, osymbol) \ -. BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ -. (ibfd, isymbol, obfd, osymbol)) +. BFD_SEND (obfd, _bfd_copy_private_symbol_data, \ +. (ibfd, isymbol, obfd, osymbol)) . */ @@ -771,11 +752,10 @@ DESCRIPTION version. It just uses BFD asymbol structures as mini symbols. */ long -_bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep) - bfd *abfd; - boolean dynamic; - PTR *minisymsp; - unsigned int *sizep; +_bfd_generic_read_minisymbols (bfd *abfd, + bfd_boolean dynamic, + void **minisymsp, + unsigned int *sizep) { long storage; asymbol **syms = NULL; @@ -790,7 +770,7 @@ _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep) if (storage == 0) return 0; - syms = (asymbol **) bfd_malloc ((bfd_size_type) storage); + syms = bfd_malloc (storage); if (syms == NULL) goto error_return; @@ -801,11 +781,12 @@ _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep) if (symcount < 0) goto error_return; - *minisymsp = (PTR) syms; + *minisymsp = syms; *sizep = sizeof (asymbol *); return symcount; error_return: + bfd_set_error (bfd_error_no_symbols); if (syms != NULL) free (syms); return -1; @@ -815,13 +796,11 @@ _bfd_generic_read_minisymbols (abfd, dynamic, minisymsp, sizep) an asymbol. We don't worry about the sym argument we are passed; we just return the asymbol the minisymbol points to. */ -/*ARGSUSED*/ asymbol * -_bfd_generic_minisymbol_to_symbol (abfd, dynamic, minisym, sym) - bfd *abfd ATTRIBUTE_UNUSED; - boolean dynamic ATTRIBUTE_UNUSED; - const PTR minisym; - asymbol *sym ATTRIBUTE_UNUSED; +_bfd_generic_minisymbol_to_symbol (bfd *abfd ATTRIBUTE_UNUSED, + bfd_boolean dynamic ATTRIBUTE_UNUSED, + const void *minisym, + asymbol *sym ATTRIBUTE_UNUSED) { return *(asymbol **) minisym; } @@ -829,7 +808,7 @@ _bfd_generic_minisymbol_to_symbol (abfd, dynamic, minisym, sym) /* Look through stabs debugging information in .stab and .stabstr sections to find the source file and line closest to a desired location. This is used by COFF and ELF targets. It sets *pfound - to true if it finds some information. The *pinfo field is used to + to TRUE if it finds some information. The *pinfo field is used to pass cached information in and out of this routine; this first time the routine is called for a BFD, *pinfo should be NULL. The value placed in *pinfo should be saved with the BFD, and passed back each @@ -856,12 +835,10 @@ struct indexentry /* Compare two indexentry structures. This is called via qsort. */ static int -cmpindexentry (a, b) - const PTR a; - const PTR b; +cmpindexentry (const void *a, const void *b) { - const struct indexentry *contestantA = (const struct indexentry *) a; - const struct indexentry *contestantB = (const struct indexentry *) b; + const struct indexentry *contestantA = a; + const struct indexentry *contestantB = b; if (contestantA->val < contestantB->val) return -1; @@ -901,18 +878,16 @@ struct stab_find_info char *filename; }; -boolean -_bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, - pfilename, pfnname, pline, pinfo) - bfd *abfd; - asymbol **symbols; - asection *section; - bfd_vma offset; - boolean *pfound; - const char **pfilename; - const char **pfnname; - unsigned int *pline; - PTR *pinfo; +bfd_boolean +_bfd_stab_section_find_nearest_line (bfd *abfd, + asymbol **symbols, + asection *section, + bfd_vma offset, + bfd_boolean *pfound, + const char **pfilename, + const char **pfnname, + unsigned int *pline, + void **pinfo) { struct stab_find_info *info; bfd_size_type stabsize, strsize; @@ -923,9 +898,9 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, char *file_name; char *directory_name; int saw_fun; - boolean saw_line, saw_func; + bfd_boolean saw_line, saw_func; - *pfound = false; + *pfound = FALSE; *pfilename = bfd_get_filename (abfd); *pfnname = NULL; *pline = 0; @@ -950,13 +925,13 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, #define VALOFF (8) #define STABSIZE (12) - info = (struct stab_find_info *) *pinfo; + info = *pinfo; if (info != NULL) { if (info->stabsec == NULL || info->strsec == NULL) { /* No stabs debugging information. */ - return true; + return TRUE; } stabsize = info->stabsec->_raw_size; @@ -971,9 +946,9 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, char *function_name; bfd_size_type amt = sizeof *info; - info = (struct stab_find_info *) bfd_zalloc (abfd, amt); + info = bfd_zalloc (abfd, amt); if (info == NULL) - return false; + return FALSE; /* FIXME: When using the linker --split-by-file or --split-by-reloc options, it is possible for the .stab and @@ -986,41 +961,41 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, { /* No stabs debugging information. Set *pinfo so that we can return quickly in the info != NULL case above. */ - *pinfo = (PTR) info; - return true; + *pinfo = info; + return TRUE; } stabsize = info->stabsec->_raw_size; strsize = info->strsec->_raw_size; - info->stabs = (bfd_byte *) bfd_alloc (abfd, stabsize); - info->strs = (bfd_byte *) bfd_alloc (abfd, strsize); + info->stabs = bfd_alloc (abfd, stabsize); + info->strs = bfd_alloc (abfd, strsize); if (info->stabs == NULL || info->strs == NULL) - return false; + return FALSE; if (! bfd_get_section_contents (abfd, info->stabsec, info->stabs, (bfd_vma) 0, stabsize) || ! bfd_get_section_contents (abfd, info->strsec, info->strs, (bfd_vma) 0, strsize)) - return false; + return FALSE; - /* If this is a relocateable object file, we have to relocate + /* If this is a relocatable object file, we have to relocate the entries in .stab. This should always be simple 32 bit relocations against symbols defined in this object file, so this should be no big deal. */ reloc_size = bfd_get_reloc_upper_bound (abfd, info->stabsec); if (reloc_size < 0) - return false; - reloc_vector = (arelent **) bfd_malloc ((bfd_size_type) reloc_size); + return FALSE; + reloc_vector = bfd_malloc (reloc_size); if (reloc_vector == NULL && reloc_size != 0) - return false; + return FALSE; reloc_count = bfd_canonicalize_reloc (abfd, info->stabsec, reloc_vector, symbols); if (reloc_count < 0) { if (reloc_vector != NULL) free (reloc_vector); - return false; + return FALSE; } if (reloc_count > 0) { @@ -1045,7 +1020,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, bfd_set_error (bfd_error_invalid_operation); if (reloc_vector != NULL) free (reloc_vector); - return false; + return FALSE; } val = bfd_get_32 (abfd, info->stabs + r->address); @@ -1099,14 +1074,14 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, ++info->indextablesize; if (info->indextablesize == 0) - return true; + return TRUE; ++info->indextablesize; amt = info->indextablesize; amt *= sizeof (struct indexentry); - info->indextable = (struct indexentry *) bfd_alloc (abfd, amt); + info->indextable = bfd_alloc (abfd, amt); if (info->indextable == NULL) - return false; + return FALSE; file_name = NULL; directory_name = NULL; @@ -1225,7 +1200,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, qsort (info->indextable, (size_t) i, sizeof (struct indexentry), cmpindexentry); - *pinfo = (PTR) info; + *pinfo = info; } /* We are passed a section relative offset. The offsets in the @@ -1244,12 +1219,11 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, else #endif { - /* Cache non-existant or invalid. Do binary search on - indextable. */ - long low, high; long mid = -1; + /* Cache non-existent or invalid. Do binary search on + indextable. */ indexentry = NULL; low = 0; @@ -1271,7 +1245,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, } if (indexentry == NULL) - return true; + return TRUE; stab = indexentry->stab + STABSIZE; file_name = indexentry->file_name; @@ -1280,14 +1254,14 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, directory_name = indexentry->directory_name; str = indexentry->str; - saw_line = false; - saw_func = false; + saw_line = FALSE; + saw_func = FALSE; for (; stab < (indexentry+1)->stab; stab += STABSIZE) { - boolean done; + bfd_boolean done; bfd_vma val; - done = false; + done = FALSE; switch (stab[TYPEOFF]) { @@ -1304,9 +1278,11 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, case N_SLINE: case N_DSLINE: case N_BSLINE: - /* A line number. The value is relative to the start of the - current function. */ - val = indexentry->val + bfd_get_32 (abfd, stab + VALOFF); + /* A line number. If the function was specified, then the value + is relative to the start of the function. Otherwise, the + value is an absolute address. */ + val = ((indexentry->function_name ? indexentry->val : 0) + + bfd_get_32 (abfd, stab + VALOFF)); /* If this line starts before our desired offset, or if it's the first line we've been able to find, use it. The !saw_line check works around a bug in GCC 2.95.3, which emits @@ -1323,15 +1299,15 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, #endif } if (val > offset) - done = true; - saw_line = true; + done = TRUE; + saw_line = TRUE; break; case N_FUN: case N_SO: if (saw_func || saw_line) - done = true; - saw_func = true; + done = TRUE; + saw_func = TRUE; break; } @@ -1339,7 +1315,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, break; } - *pfound = true; + *pfound = TRUE; if (file_name == NULL || IS_ABSOLUTE_PATH (file_name) || directory_name == NULL) @@ -1358,9 +1334,9 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, if (info->filename != NULL) free (info->filename); len = strlen (file_name) + 1; - info->filename = (char *) bfd_malloc ((bfd_size_type) dirlen + len); + info->filename = bfd_malloc (dirlen + len); if (info->filename == NULL) - return false; + return FALSE; memcpy (info->filename, directory_name, dirlen); memcpy (info->filename + dirlen, file_name, len); } @@ -1375,7 +1351,6 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, /* This will typically be something like main:F(0,1), so we want to clobber the colon. It's OK to change the name, since the string is in our own local storage anyhow. */ - s = strchr (indexentry->function_name, ':'); if (s != NULL) *s = '\0'; @@ -1383,5 +1358,5 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, *pfnname = indexentry->function_name; } - return true; + return TRUE; } diff --git a/contrib/binutils/bfd/sysdep.h b/contrib/binutils/bfd/sysdep.h index 1338d6b..1954470 100644 --- a/contrib/binutils/bfd/sysdep.h +++ b/contrib/binutils/bfd/sysdep.h @@ -1,5 +1,5 @@ /* sysdep.h -- handle host dependencies for the BFD library - Copyright 1995, 1996, 1997, 1998, 1999, 2000 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Cygnus Support. diff --git a/contrib/binutils/bfd/targets.c b/contrib/binutils/bfd/targets.c index 2d0ec04..cec339c 100644 --- a/contrib/binutils/bfd/targets.c +++ b/contrib/binutils/bfd/targets.c @@ -1,24 +1,24 @@ /* Generic target-file-type support for the BFD library. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Cygnus Support. -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" @@ -30,7 +30,7 @@ SECTION Targets DESCRIPTION - Each port of BFD to a different machine requries the creation + Each port of BFD to a different machine requires the creation 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 @@ -70,7 +70,7 @@ DESCRIPTION <> on the BFD with a suggested format. If <> has been set, each possible target type is tried to see if it recognizes the specified format. - <> returns <> when the caller guesses right. + <> returns <> when the caller guesses right. @menu @* bfd_target:: @end menu @@ -103,7 +103,7 @@ DESCRIPTION someone wants to fix this and not break the above, please do. .#define BFD_SEND(bfd, message, arglist) \ -. ((*((bfd)->xvec->message)) arglist) +. ((*((bfd)->xvec->message)) arglist) . .#ifdef DEBUG_BFD_SEND .#undef BFD_SEND @@ -116,7 +116,7 @@ DESCRIPTION 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 @@ -155,7 +155,11 @@ DESCRIPTION . bfd_target_msdos_flavour, . bfd_target_ovax_flavour, . bfd_target_evax_flavour, -. bfd_target_mmo_flavour +. bfd_target_mmo_flavour, +. bfd_target_mach_o_flavour, +. bfd_target_pef_flavour, +. bfd_target_pef_xlib_flavour, +. bfd_target_sym_flavour .}; . .enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; @@ -199,262 +203,266 @@ DESCRIPTION . {* Entries for byte swapping for data. These are different from the . other entry points, since they don't take a BFD asthe first argument. . Certain other handlers could do the same. *} -. bfd_vma (*bfd_getx64) PARAMS ((const bfd_byte *)); -. bfd_signed_vma (*bfd_getx_signed_64) PARAMS ((const bfd_byte *)); -. void (*bfd_putx64) PARAMS ((bfd_vma, bfd_byte *)); -. bfd_vma (*bfd_getx32) PARAMS ((const bfd_byte *)); -. bfd_signed_vma (*bfd_getx_signed_32) PARAMS ((const bfd_byte *)); -. void (*bfd_putx32) PARAMS ((bfd_vma, bfd_byte *)); -. bfd_vma (*bfd_getx16) PARAMS ((const bfd_byte *)); -. bfd_signed_vma (*bfd_getx_signed_16) PARAMS ((const bfd_byte *)); -. void (*bfd_putx16) PARAMS ((bfd_vma, bfd_byte *)); +. bfd_uint64_t (*bfd_getx64) (const void *); +. bfd_int64_t (*bfd_getx_signed_64) (const void *); +. void (*bfd_putx64) (bfd_uint64_t, void *); +. bfd_vma (*bfd_getx32) (const void *); +. bfd_signed_vma (*bfd_getx_signed_32) (const void *); +. void (*bfd_putx32) (bfd_vma, void *); +. bfd_vma (*bfd_getx16) (const void *); +. bfd_signed_vma (*bfd_getx_signed_16) (const void *); +. void (*bfd_putx16) (bfd_vma, void *); . . {* Byte swapping for the headers. *} -. bfd_vma (*bfd_h_getx64) PARAMS ((const bfd_byte *)); -. bfd_signed_vma (*bfd_h_getx_signed_64) PARAMS ((const bfd_byte *)); -. void (*bfd_h_putx64) PARAMS ((bfd_vma, bfd_byte *)); -. bfd_vma (*bfd_h_getx32) PARAMS ((const bfd_byte *)); -. bfd_signed_vma (*bfd_h_getx_signed_32) PARAMS ((const bfd_byte *)); -. void (*bfd_h_putx32) PARAMS ((bfd_vma, bfd_byte *)); -. bfd_vma (*bfd_h_getx16) PARAMS ((const bfd_byte *)); -. bfd_signed_vma (*bfd_h_getx_signed_16) PARAMS ((const bfd_byte *)); -. void (*bfd_h_putx16) PARAMS ((bfd_vma, bfd_byte *)); +. bfd_uint64_t (*bfd_h_getx64) (const void *); +. bfd_int64_t (*bfd_h_getx_signed_64) (const void *); +. void (*bfd_h_putx64) (bfd_uint64_t, void *); +. bfd_vma (*bfd_h_getx32) (const void *); +. bfd_signed_vma (*bfd_h_getx_signed_32) (const void *); +. void (*bfd_h_putx32) (bfd_vma, void *); +. bfd_vma (*bfd_h_getx16) (const void *); +. bfd_signed_vma (*bfd_h_getx_signed_16) (const void *); +. void (*bfd_h_putx16) (bfd_vma, void *); . . {* 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 <> or zero. *} -. const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); +. const struct bfd_target *(*_bfd_check_format[bfd_type_end]) (bfd *); . . {* Set the format of a file being written. *} -. boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); +. bfd_boolean (*_bfd_set_format[bfd_type_end]) (bfd *); . . {* Write cached information into a file being written, at <>. *} -. boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); +. bfd_boolean (*_bfd_write_contents[bfd_type_end]) (bfd *); . The general target vector. These vectors are initialized using the BFD_JUMP_TABLE macros. . . {* Generic entry points. *} -Do not "beautify" the CONCAT* macro args. Traditional C will not -remove whitespace added here, and thus will fail to concatenate -the tokens. .#define BFD_JUMP_TABLE_GENERIC(NAME) \ -.CONCAT2 (NAME,_close_and_cleanup), \ -.CONCAT2 (NAME,_bfd_free_cached_info), \ -.CONCAT2 (NAME,_new_section_hook), \ -.CONCAT2 (NAME,_get_section_contents), \ -.CONCAT2 (NAME,_get_section_contents_in_window) +. NAME##_close_and_cleanup, \ +. NAME##_bfd_free_cached_info, \ +. NAME##_new_section_hook, \ +. NAME##_get_section_contents, \ +. NAME##_get_section_contents_in_window . . {* Called when the BFD is being closed to do any necessary cleanup. *} -. boolean (*_close_and_cleanup) PARAMS ((bfd *)); +. bfd_boolean (*_close_and_cleanup) (bfd *); . {* Ask the BFD to free all cached information. *} -. boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); +. bfd_boolean (*_bfd_free_cached_info) (bfd *); . {* Called when a new section is created. *} -. boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); +. bfd_boolean (*_new_section_hook) (bfd *, sec_ptr); . {* Read the contents of a section. *} -. boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, PTR, -. file_ptr, bfd_size_type)); -. boolean (*_bfd_get_section_contents_in_window) -. PARAMS ((bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type)); +. bfd_boolean (*_bfd_get_section_contents) +. (bfd *, sec_ptr, void *, file_ptr, bfd_size_type); +. bfd_boolean (*_bfd_get_section_contents_in_window) +. (bfd *, sec_ptr, bfd_window *, file_ptr, bfd_size_type); . . {* Entry points to copy private data. *} .#define BFD_JUMP_TABLE_COPY(NAME) \ -.CONCAT2 (NAME,_bfd_copy_private_bfd_data), \ -.CONCAT2 (NAME,_bfd_merge_private_bfd_data), \ -.CONCAT2 (NAME,_bfd_copy_private_section_data), \ -.CONCAT2 (NAME,_bfd_copy_private_symbol_data), \ -.CONCAT2 (NAME,_bfd_set_private_flags), \ -.CONCAT2 (NAME,_bfd_print_private_bfd_data) \ +. NAME##_bfd_copy_private_bfd_data, \ +. NAME##_bfd_merge_private_bfd_data, \ +. NAME##_bfd_copy_private_section_data, \ +. NAME##_bfd_copy_private_symbol_data, \ +. NAME##_bfd_set_private_flags, \ +. NAME##_bfd_print_private_bfd_data +. . {* Called to copy BFD general private data from one object file . to another. *} -. boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); +. bfd_boolean (*_bfd_copy_private_bfd_data) (bfd *, bfd *); . {* Called to merge BFD general private data from one object file . to a common output file when linking. *} -. boolean (*_bfd_merge_private_bfd_data) PARAMS ((bfd *, bfd *)); +. bfd_boolean (*_bfd_merge_private_bfd_data) (bfd *, bfd *); . {* Called to copy BFD private section data from one object file . to another. *} -. boolean (*_bfd_copy_private_section_data) PARAMS ((bfd *, sec_ptr, -. bfd *, sec_ptr)); +. bfd_boolean (*_bfd_copy_private_section_data) +. (bfd *, sec_ptr, bfd *, sec_ptr); . {* Called to copy BFD private symbol data from one symbol . to another. *} -. boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *, -. bfd *, asymbol *)); +. bfd_boolean (*_bfd_copy_private_symbol_data) +. (bfd *, asymbol *, bfd *, asymbol *); . {* Called to set private backend flags. *} -. boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword)); +. bfd_boolean (*_bfd_set_private_flags) (bfd *, flagword); . . {* Called to print private BFD data. *} -. boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); +. bfd_boolean (*_bfd_print_private_bfd_data) (bfd *, void *); . . {* Core file entry points. *} .#define BFD_JUMP_TABLE_CORE(NAME) \ -.CONCAT2 (NAME,_core_file_failing_command), \ -.CONCAT2 (NAME,_core_file_failing_signal), \ -.CONCAT2 (NAME,_core_file_matches_executable_p) -. char * (*_core_file_failing_command) PARAMS ((bfd *)); -. int (*_core_file_failing_signal) PARAMS ((bfd *)); -. boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); +. NAME##_core_file_failing_command, \ +. NAME##_core_file_failing_signal, \ +. NAME##_core_file_matches_executable_p +. +. char * (*_core_file_failing_command) (bfd *); +. int (*_core_file_failing_signal) (bfd *); +. bfd_boolean (*_core_file_matches_executable_p) (bfd *, bfd *); . . {* Archive entry points. *} .#define BFD_JUMP_TABLE_ARCHIVE(NAME) \ -.CONCAT2 (NAME,_slurp_armap), \ -.CONCAT2 (NAME,_slurp_extended_name_table), \ -.CONCAT2 (NAME,_construct_extended_name_table), \ -.CONCAT2 (NAME,_truncate_arname), \ -.CONCAT2 (NAME,_write_armap), \ -.CONCAT2 (NAME,_read_ar_hdr), \ -.CONCAT2 (NAME,_openr_next_archived_file), \ -.CONCAT2 (NAME,_get_elt_at_index), \ -.CONCAT2 (NAME,_generic_stat_arch_elt), \ -.CONCAT2 (NAME,_update_armap_timestamp) -. boolean (*_bfd_slurp_armap) PARAMS ((bfd *)); -. boolean (*_bfd_slurp_extended_name_table) PARAMS ((bfd *)); -. boolean (*_bfd_construct_extended_name_table) -. PARAMS ((bfd *, char **, bfd_size_type *, const char **)); -. void (*_bfd_truncate_arname) PARAMS ((bfd *, const char *, char *)); -. boolean (*write_armap) -. PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); -. PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); -. bfd * (*openr_next_archived_file) PARAMS ((bfd *, bfd *)); -.#define bfd_get_elt_at_index(b,i) BFD_SEND(b, _bfd_get_elt_at_index, (b,i)) -. bfd * (*_bfd_get_elt_at_index) PARAMS ((bfd *, symindex)); -. int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); -. boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); +. NAME##_slurp_armap, \ +. NAME##_slurp_extended_name_table, \ +. NAME##_construct_extended_name_table, \ +. NAME##_truncate_arname, \ +. NAME##_write_armap, \ +. NAME##_read_ar_hdr, \ +. NAME##_openr_next_archived_file, \ +. NAME##_get_elt_at_index, \ +. NAME##_generic_stat_arch_elt, \ +. NAME##_update_armap_timestamp +. +. bfd_boolean (*_bfd_slurp_armap) (bfd *); +. bfd_boolean (*_bfd_slurp_extended_name_table) (bfd *); +. bfd_boolean (*_bfd_construct_extended_name_table) +. (bfd *, char **, bfd_size_type *, const char **); +. void (*_bfd_truncate_arname) (bfd *, const char *, char *); +. bfd_boolean (*write_armap) +. (bfd *, unsigned int, struct orl *, unsigned int, int); +. void * (*_bfd_read_ar_hdr_fn) (bfd *); +. bfd * (*openr_next_archived_file) (bfd *, bfd *); +.#define bfd_get_elt_at_index(b,i) BFD_SEND (b, _bfd_get_elt_at_index, (b,i)) +. bfd * (*_bfd_get_elt_at_index) (bfd *, symindex); +. int (*_bfd_stat_arch_elt) (bfd *, struct stat *); +. bfd_boolean (*_bfd_update_armap_timestamp) (bfd *); . . {* Entry points used for symbols. *} .#define BFD_JUMP_TABLE_SYMBOLS(NAME) \ -.CONCAT2 (NAME,_get_symtab_upper_bound), \ -.CONCAT2 (NAME,_get_symtab), \ -.CONCAT2 (NAME,_make_empty_symbol), \ -.CONCAT2 (NAME,_print_symbol), \ -.CONCAT2 (NAME,_get_symbol_info), \ -.CONCAT2 (NAME,_bfd_is_local_label_name), \ -.CONCAT2 (NAME,_get_lineno), \ -.CONCAT2 (NAME,_find_nearest_line), \ -.CONCAT2 (NAME,_bfd_make_debug_symbol), \ -.CONCAT2 (NAME,_read_minisymbols), \ -.CONCAT2 (NAME,_minisymbol_to_symbol) -. long (*_bfd_get_symtab_upper_bound) PARAMS ((bfd *)); -. long (*_bfd_canonicalize_symtab) PARAMS ((bfd *, -. struct symbol_cache_entry **)); -. struct symbol_cache_entry * -. (*_bfd_make_empty_symbol) PARAMS ((bfd *)); -. void (*_bfd_print_symbol) PARAMS ((bfd *, PTR, -. struct symbol_cache_entry *, -. bfd_print_symbol_type)); -.#define bfd_print_symbol(b,p,s,e) BFD_SEND(b, _bfd_print_symbol, (b,p,s,e)) -. void (*_bfd_get_symbol_info) PARAMS ((bfd *, -. struct symbol_cache_entry *, -. symbol_info *)); -.#define bfd_get_symbol_info(b,p,e) BFD_SEND(b, _bfd_get_symbol_info, (b,p,e)) -. boolean (*_bfd_is_local_label_name) PARAMS ((bfd *, const char *)); +. NAME##_get_symtab_upper_bound, \ +. NAME##_canonicalize_symtab, \ +. NAME##_make_empty_symbol, \ +. NAME##_print_symbol, \ +. NAME##_get_symbol_info, \ +. NAME##_bfd_is_local_label_name, \ +. NAME##_get_lineno, \ +. NAME##_find_nearest_line, \ +. NAME##_bfd_make_debug_symbol, \ +. NAME##_read_minisymbols, \ +. NAME##_minisymbol_to_symbol . -. alent * (*_get_lineno) PARAMS ((bfd *, struct symbol_cache_entry *)); -. boolean (*_bfd_find_nearest_line) -. PARAMS ((bfd *, struct sec *, struct symbol_cache_entry **, bfd_vma, -. const char **, const char **, unsigned int *)); +. long (*_bfd_get_symtab_upper_bound) (bfd *); +. long (*_bfd_canonicalize_symtab) +. (bfd *, struct bfd_symbol **); +. struct bfd_symbol * +. (*_bfd_make_empty_symbol) (bfd *); +. void (*_bfd_print_symbol) +. (bfd *, void *, struct bfd_symbol *, bfd_print_symbol_type); +.#define bfd_print_symbol(b,p,s,e) BFD_SEND (b, _bfd_print_symbol, (b,p,s,e)) +. void (*_bfd_get_symbol_info) +. (bfd *, struct bfd_symbol *, symbol_info *); +.#define bfd_get_symbol_info(b,p,e) BFD_SEND (b, _bfd_get_symbol_info, (b,p,e)) +. bfd_boolean (*_bfd_is_local_label_name) (bfd *, const char *); +. +. alent * (*_get_lineno) (bfd *, struct bfd_symbol *); +. bfd_boolean (*_bfd_find_nearest_line) +. (bfd *, struct bfd_section *, struct bfd_symbol **, bfd_vma, +. const char **, const char **, unsigned int *); . {* Back-door to allow format-aware applications to create debug symbols . while using BFD for everything else. Currently used by the assembler . when creating COFF files. *} -. asymbol *(*_bfd_make_debug_symbol) PARAMS ((bfd *, void *, -. unsigned long size)); +. asymbol * (*_bfd_make_debug_symbol) +. (bfd *, void *, unsigned long size); .#define bfd_read_minisymbols(b, d, m, s) \ . BFD_SEND (b, _read_minisymbols, (b, d, m, s)) -. long (*_read_minisymbols) PARAMS ((bfd *, boolean, PTR *, -. unsigned int *)); +. long (*_read_minisymbols) +. (bfd *, bfd_boolean, void **, unsigned int *); .#define bfd_minisymbol_to_symbol(b, d, m, f) \ . BFD_SEND (b, _minisymbol_to_symbol, (b, d, m, f)) -. asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR, -. asymbol *)); +. asymbol * (*_minisymbol_to_symbol) +. (bfd *, bfd_boolean, const void *, asymbol *); . . {* Routines for relocs. *} .#define BFD_JUMP_TABLE_RELOCS(NAME) \ -.CONCAT2 (NAME,_get_reloc_upper_bound), \ -.CONCAT2 (NAME,_canonicalize_reloc), \ -.CONCAT2 (NAME,_bfd_reloc_type_lookup) -. long (*_get_reloc_upper_bound) PARAMS ((bfd *, sec_ptr)); -. long (*_bfd_canonicalize_reloc) PARAMS ((bfd *, sec_ptr, arelent **, -. struct symbol_cache_entry **)); +. NAME##_get_reloc_upper_bound, \ +. NAME##_canonicalize_reloc, \ +. NAME##_bfd_reloc_type_lookup +. +. long (*_get_reloc_upper_bound) (bfd *, sec_ptr); +. long (*_bfd_canonicalize_reloc) +. (bfd *, sec_ptr, arelent **, struct bfd_symbol **); . {* See documentation on reloc types. *} . reloc_howto_type * -. (*reloc_type_lookup) PARAMS ((bfd *, bfd_reloc_code_real_type)); +. (*reloc_type_lookup) (bfd *, bfd_reloc_code_real_type); . . {* Routines used when writing an object file. *} .#define BFD_JUMP_TABLE_WRITE(NAME) \ -.CONCAT2 (NAME,_set_arch_mach), \ -.CONCAT2 (NAME,_set_section_contents) -. boolean (*_bfd_set_arch_mach) PARAMS ((bfd *, enum bfd_architecture, -. unsigned long)); -. boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, -. file_ptr, bfd_size_type)); +. NAME##_set_arch_mach, \ +. NAME##_set_section_contents +. +. bfd_boolean (*_bfd_set_arch_mach) +. (bfd *, enum bfd_architecture, unsigned long); +. bfd_boolean (*_bfd_set_section_contents) +. (bfd *, sec_ptr, const void *, file_ptr, bfd_size_type); . . {* Routines used by the linker. *} .#define BFD_JUMP_TABLE_LINK(NAME) \ -.CONCAT2 (NAME,_sizeof_headers), \ -.CONCAT2 (NAME,_bfd_get_relocated_section_contents), \ -.CONCAT2 (NAME,_bfd_relax_section), \ -.CONCAT2 (NAME,_bfd_link_hash_table_create), \ -.CONCAT2 (NAME,_bfd_link_hash_table_free), \ -.CONCAT2 (NAME,_bfd_link_add_symbols), \ -.CONCAT2 (NAME,_bfd_link_just_syms), \ -.CONCAT2 (NAME,_bfd_final_link), \ -.CONCAT2 (NAME,_bfd_link_split_section), \ -.CONCAT2 (NAME,_bfd_gc_sections), \ -.CONCAT2 (NAME,_bfd_merge_sections), \ -.CONCAT2 (NAME,_bfd_discard_group) -. int (*_bfd_sizeof_headers) PARAMS ((bfd *, boolean)); -. bfd_byte *(*_bfd_get_relocated_section_contents) -. PARAMS ((bfd *, struct bfd_link_info *, struct bfd_link_order *, -. bfd_byte *, boolean, struct symbol_cache_entry **)); +. NAME##_sizeof_headers, \ +. NAME##_bfd_get_relocated_section_contents, \ +. NAME##_bfd_relax_section, \ +. NAME##_bfd_link_hash_table_create, \ +. NAME##_bfd_link_hash_table_free, \ +. NAME##_bfd_link_add_symbols, \ +. NAME##_bfd_link_just_syms, \ +. NAME##_bfd_final_link, \ +. NAME##_bfd_link_split_section, \ +. NAME##_bfd_gc_sections, \ +. NAME##_bfd_merge_sections, \ +. NAME##_bfd_discard_group +. +. int (*_bfd_sizeof_headers) (bfd *, bfd_boolean); +. bfd_byte * (*_bfd_get_relocated_section_contents) +. (bfd *, struct bfd_link_info *, struct bfd_link_order *, +. bfd_byte *, bfd_boolean, struct bfd_symbol **); . -. boolean (*_bfd_relax_section) -. PARAMS ((bfd *, struct sec *, struct bfd_link_info *, boolean *)); +. bfd_boolean (*_bfd_relax_section) +. (bfd *, struct bfd_section *, struct bfd_link_info *, bfd_boolean *); . . {* Create a hash table for the linker. Different backends store . different information in this table. *} -. struct bfd_link_hash_table *(*_bfd_link_hash_table_create) PARAMS ((bfd *)); +. struct bfd_link_hash_table * +. (*_bfd_link_hash_table_create) (bfd *); . . {* Release the memory associated with the linker hash table. *} -. void (*_bfd_link_hash_table_free) PARAMS ((struct bfd_link_hash_table *)); +. void (*_bfd_link_hash_table_free) (struct bfd_link_hash_table *); . . {* Add symbols from this object file into the hash table. *} -. boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); +. bfd_boolean (*_bfd_link_add_symbols) (bfd *, struct bfd_link_info *); . . {* Indicate that we are only retrieving symbol values from this section. *} -. void (*_bfd_link_just_syms) PARAMS ((asection *, struct bfd_link_info *)); +. void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *); . . {* Do a link based on the link_order structures attached to each . section of the BFD. *} -. boolean (*_bfd_final_link) PARAMS ((bfd *, struct bfd_link_info *)); +. bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *); . . {* Should this section be split up into smaller pieces during linking. *} -. boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); +. bfd_boolean (*_bfd_link_split_section) (bfd *, struct bfd_section *); . . {* Remove sections that are not referenced from the output. *} -. boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); +. bfd_boolean (*_bfd_gc_sections) (bfd *, struct bfd_link_info *); . . {* Attempt to merge SEC_MERGE sections. *} -. boolean (*_bfd_merge_sections) PARAMS ((bfd *, struct bfd_link_info *)); +. bfd_boolean (*_bfd_merge_sections) (bfd *, struct bfd_link_info *); . . {* Discard members of a group. *} -. boolean (*_bfd_discard_group) PARAMS ((bfd *, struct sec *)); +. bfd_boolean (*_bfd_discard_group) (bfd *, struct bfd_section *); . . {* Routines to handle dynamic symbols and relocs. *} .#define BFD_JUMP_TABLE_DYNAMIC(NAME) \ -.CONCAT2 (NAME,_get_dynamic_symtab_upper_bound), \ -.CONCAT2 (NAME,_canonicalize_dynamic_symtab), \ -.CONCAT2 (NAME,_get_dynamic_reloc_upper_bound), \ -.CONCAT2 (NAME,_canonicalize_dynamic_reloc) +. NAME##_get_dynamic_symtab_upper_bound, \ +. NAME##_canonicalize_dynamic_symtab, \ +. NAME##_get_dynamic_reloc_upper_bound, \ +. NAME##_canonicalize_dynamic_reloc +. . {* Get the amount of memory required to hold the dynamic symbols. *} -. long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); +. long (*_bfd_get_dynamic_symtab_upper_bound) (bfd *); . {* Read in the dynamic symbols. *} -. long (*_bfd_canonicalize_dynamic_symtab) -. PARAMS ((bfd *, struct symbol_cache_entry **)); +. long (*_bfd_canonicalize_dynamic_symtab) +. (bfd *, struct bfd_symbol **); . {* Get the amount of memory required to hold the dynamic relocs. *} -. long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); +. long (*_bfd_get_dynamic_reloc_upper_bound) (bfd *); . {* Read in the dynamic relocs. *} -. long (*_bfd_canonicalize_dynamic_reloc) -. PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); +. long (*_bfd_canonicalize_dynamic_reloc) +. (bfd *, arelent **, struct bfd_symbol **); . A pointer to an alternative bfd_target in case the current one is not @@ -469,7 +477,7 @@ to find an alternative output format that is suitable. . {* Data for use by back-end routines, which isn't . generic enough to belong in this structure. *} -. PTR backend_data; +. const void *backend_data; . .} bfd_target; . @@ -515,6 +523,7 @@ extern const bfd_target bfd_elf32_d30v_vec; extern const bfd_target bfd_elf32_dlx_big_vec; extern const bfd_target bfd_elf32_fr30_vec; extern const bfd_target bfd_elf32_frv_vec; +extern const bfd_target bfd_elf32_frvfdpic_vec; extern const bfd_target bfd_elf32_h8300_vec; extern const bfd_target bfd_elf32_hppa_linux_vec; extern const bfd_target bfd_elf32_hppa_vec; @@ -526,12 +535,17 @@ extern const bfd_target bfd_elf32_i860_vec; extern const bfd_target bfd_elf32_i960_vec; extern const bfd_target bfd_elf32_ia64_big_vec; extern const bfd_target bfd_elf32_ia64_hpux_big_vec; +extern const bfd_target bfd_elf32_ip2k_vec; +extern const bfd_target bfd_elf32_iq2000_vec; extern const bfd_target bfd_elf32_little_generic_vec; extern const bfd_target bfd_elf32_littlearc_vec; extern const bfd_target bfd_elf32_littlearm_oabi_vec; extern const bfd_target bfd_elf32_littlearm_vec; extern const bfd_target bfd_elf32_littlemips_vec; extern const bfd_target bfd_elf32_m32r_vec; +extern const bfd_target bfd_elf32_m32rle_vec; +extern const bfd_target bfd_elf32_m32rlin_vec; +extern const bfd_target bfd_elf32_m32rlelin_vec; extern const bfd_target bfd_elf32_m68hc11_vec; extern const bfd_target bfd_elf32_m68hc12_vec; extern const bfd_target bfd_elf32_m68k_vec; @@ -540,6 +554,11 @@ extern const bfd_target bfd_elf32_mcore_big_vec; extern const bfd_target bfd_elf32_mcore_little_vec; extern const bfd_target bfd_elf32_mn10200_vec; extern const bfd_target bfd_elf32_mn10300_vec; +extern const bfd_target bfd_elf32_msp430_vec; +extern const bfd_target bfd_elf32_nbigmips_vec; +extern const bfd_target bfd_elf32_nlittlemips_vec; +extern const bfd_target bfd_elf32_ntradbigmips_vec; +extern const bfd_target bfd_elf32_ntradlittlemips_vec; extern const bfd_target bfd_elf32_openrisc_vec; extern const bfd_target bfd_elf32_or32_big_vec; extern const bfd_target bfd_elf32_pj_vec; @@ -549,6 +568,8 @@ extern const bfd_target bfd_elf32_powerpcle_vec; extern const bfd_target bfd_elf32_s390_vec; extern const bfd_target bfd_elf32_sh64_vec; extern const bfd_target bfd_elf32_sh64l_vec; +extern const bfd_target bfd_elf32_sh64lin_vec; +extern const bfd_target bfd_elf32_sh64blin_vec; extern const bfd_target bfd_elf32_sh64lnbsd_vec; extern const bfd_target bfd_elf32_sh64nbsd_vec; extern const bfd_target bfd_elf32_sh_vec; @@ -564,14 +585,14 @@ extern const bfd_target bfd_elf32_us_cris_vec; extern const bfd_target bfd_elf32_v850_vec; extern const bfd_target bfd_elf32_vax_vec; extern const bfd_target bfd_elf32_xstormy16_vec; +extern const bfd_target bfd_elf32_xtensa_be_vec; +extern const bfd_target bfd_elf32_xtensa_le_vec; extern const bfd_target bfd_elf64_alpha_freebsd_vec; extern const bfd_target bfd_elf64_alpha_vec; extern const bfd_target bfd_elf64_big_generic_vec; extern const bfd_target bfd_elf64_bigmips_vec; extern const bfd_target bfd_elf64_hppa_linux_vec; extern const bfd_target bfd_elf64_hppa_vec; -extern const bfd_target bfd_elf64_ia64_aix_big_vec; -extern const bfd_target bfd_elf64_ia64_aix_little_vec; extern const bfd_target bfd_elf64_ia64_big_vec; extern const bfd_target bfd_elf64_ia64_hpux_big_vec; extern const bfd_target bfd_elf64_ia64_little_vec; @@ -583,6 +604,8 @@ extern const bfd_target bfd_elf64_powerpcle_vec; extern const bfd_target bfd_elf64_s390_vec; extern const bfd_target bfd_elf64_sh64_vec; extern const bfd_target bfd_elf64_sh64l_vec; +extern const bfd_target bfd_elf64_sh64lin_vec; +extern const bfd_target bfd_elf64_sh64blin_vec; extern const bfd_target bfd_elf64_sh64lnbsd_vec; extern const bfd_target bfd_elf64_sh64nbsd_vec; extern const bfd_target bfd_elf64_sparc_vec; @@ -636,6 +659,9 @@ extern const bfd_target m68knetbsd_vec; extern const bfd_target m68ksysvcoff_vec; extern const bfd_target m88kbcs_vec; extern const bfd_target m88kmach3_vec; +extern const bfd_target mach_o_be_vec; +extern const bfd_target mach_o_le_vec; +extern const bfd_target mach_o_fat_vec; extern const bfd_target mcore_pe_big_vec; extern const bfd_target mcore_pe_little_vec; extern const bfd_target mcore_pei_big_vec; @@ -652,6 +678,8 @@ extern const bfd_target or32coff_big_vec; extern const bfd_target pc532machaout_vec; extern const bfd_target pc532netbsd_vec; extern const bfd_target pdp11_aout_vec; +extern const bfd_target pef_vec; +extern const bfd_target pef_xlib_vec; extern const bfd_target pmac_xcoff_vec; extern const bfd_target ppcboot_vec; extern const bfd_target riscix_vec; @@ -671,8 +699,15 @@ extern const bfd_target sparclynx_aout_vec; extern const bfd_target sparclynx_coff_vec; extern const bfd_target sparcnetbsd_vec; extern const bfd_target sunos_big_vec; +extern const bfd_target sym_vec; extern const bfd_target tic30_aout_vec; extern const bfd_target tic30_coff_vec; +extern const bfd_target tic4x_coff0_beh_vec; +extern const bfd_target tic4x_coff0_vec; +extern const bfd_target tic4x_coff1_beh_vec; +extern const bfd_target tic4x_coff1_vec; +extern const bfd_target tic4x_coff2_beh_vec; +extern const bfd_target tic4x_coff2_vec; extern const bfd_target tic54x_coff0_beh_vec; extern const bfd_target tic54x_coff0_vec; extern const bfd_target tic54x_coff1_beh_vec; @@ -710,6 +745,7 @@ extern const bfd_target ptrace_core_vec; extern const bfd_target sco5_core_vec; extern const bfd_target trad_core_vec; +extern const bfd_target bfd_elf32_am33lin_vec; static const bfd_target * const _bfd_target_vector[] = { #ifdef SELECT_VECS @@ -734,7 +770,7 @@ static const bfd_target * const _bfd_target_vector[] = { #endif &aout0_big_vec, #if 0 - /* We have no way of distinguishing these from other a.out variants */ + /* We have no way of distinguishing these from other a.out variants. */ &aout_arm_big_vec, &aout_arm_little_vec, /* No one seems to use this. */ @@ -778,6 +814,7 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_dlx_big_vec, &bfd_elf32_fr30_vec, &bfd_elf32_frv_vec, + &bfd_elf32_frvfdpic_vec, &bfd_elf32_h8300_vec, &bfd_elf32_hppa_linux_vec, &bfd_elf32_hppa_vec, @@ -791,12 +828,17 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_ia64_big_vec, #endif &bfd_elf32_ia64_hpux_big_vec, + &bfd_elf32_ip2k_vec, + &bfd_elf32_iq2000_vec, &bfd_elf32_little_generic_vec, &bfd_elf32_littlearc_vec, &bfd_elf32_littlearm_oabi_vec, &bfd_elf32_littlearm_vec, &bfd_elf32_littlemips_vec, &bfd_elf32_m32r_vec, + &bfd_elf32_m32rle_vec, + &bfd_elf32_m32rlin_vec, + &bfd_elf32_m32rlelin_vec, &bfd_elf32_m68hc11_vec, &bfd_elf32_m68hc12_vec, &bfd_elf32_m68k_vec, @@ -805,6 +847,13 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_mcore_little_vec, &bfd_elf32_mn10200_vec, &bfd_elf32_mn10300_vec, + &bfd_elf32_msp430_vec, +#ifdef BFD64 + &bfd_elf32_nbigmips_vec, + &bfd_elf32_nlittlemips_vec, + &bfd_elf32_ntradbigmips_vec, + &bfd_elf32_ntradlittlemips_vec, +#endif &bfd_elf32_openrisc_vec, &bfd_elf32_or32_big_vec, &bfd_elf32_pj_vec, @@ -823,6 +872,8 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_sh64l_vec, &bfd_elf32_sh64lnbsd_vec, &bfd_elf32_sh64nbsd_vec, + &bfd_elf32_sh64lin_vec, + &bfd_elf32_sh64blin_vec, #endif &bfd_elf32_sparc_vec, &bfd_elf32_tradbigmips_vec, @@ -831,6 +882,8 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf32_v850_vec, &bfd_elf32_vax_vec, &bfd_elf32_xstormy16_vec, + &bfd_elf32_xtensa_be_vec, + &bfd_elf32_xtensa_le_vec, #ifdef BFD64 &bfd_elf64_alpha_freebsd_vec, &bfd_elf64_alpha_vec, @@ -838,8 +891,6 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf64_bigmips_vec, &bfd_elf64_hppa_linux_vec, &bfd_elf64_hppa_vec, - &bfd_elf64_ia64_aix_big_vec, - &bfd_elf64_ia64_aix_little_vec, &bfd_elf64_ia64_big_vec, &bfd_elf64_ia64_hpux_big_vec, &bfd_elf64_ia64_little_vec, @@ -853,9 +904,9 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_elf64_sh64l_vec, &bfd_elf64_sh64lnbsd_vec, &bfd_elf64_sh64nbsd_vec, -#if 0 + &bfd_elf64_sh64lin_vec, + &bfd_elf64_sh64blin_vec, &bfd_elf64_sparc_vec, -#endif &bfd_elf64_tradbigmips_vec, &bfd_elf64_tradlittlemips_vec, &bfd_elf64_x86_64_vec, @@ -867,7 +918,7 @@ static const bfd_target * const _bfd_target_vector[] = { &bfd_powerpcle_pei_vec, &cris_aout_vec, #ifdef BFD64 - &demo_64_vec, /* Only compiled if host has long-long support */ + &demo_64_vec, /* Only compiled if host has long-long support. */ #endif &ecoff_big_vec, &ecoff_biglittle_vec, @@ -931,6 +982,9 @@ static const bfd_target * const _bfd_target_vector[] = { &m68ksysvcoff_vec, &m88kbcs_vec, &m88kmach3_vec, + &mach_o_be_vec, + &mach_o_le_vec, + &mach_o_fat_vec, &mcore_pe_big_vec, &mcore_pe_little_vec, &mcore_pei_big_vec, @@ -958,13 +1012,15 @@ static const bfd_target * const _bfd_target_vector[] = { &pc532machaout_vec, &pc532netbsd_vec, &pdp11_aout_vec, + &pef_vec, + &pef_xlib_vec, #if 0 /* This has the same magic number as RS/6000. */ &pmac_xcoff_vec, #endif &ppcboot_vec, #if 0 - /* We have no way of distinguishing these from other a.out variants */ + /* We have no way of distinguishing these from other a.out variants. */ &riscix_vec, #endif #ifdef BFD64 @@ -987,6 +1043,7 @@ static const bfd_target * const _bfd_target_vector[] = { &sparclynx_coff_vec, &sparcnetbsd_vec, &sunos_big_vec, + &sym_vec, &tic30_aout_vec, &tic30_coff_vec, &tic54x_coff0_beh_vec, @@ -1007,6 +1064,7 @@ static const bfd_target * const _bfd_target_vector[] = { &w65_vec, &we32kcoff_vec, &z8kcoff_vec, + &bfd_elf32_am33lin_vec, #endif /* not SELECT_VECS */ /* Always support S-records, for convenience. */ @@ -1070,6 +1128,17 @@ const bfd_target *bfd_default_vector[] = { NULL }; +/* bfd_associated_vector[] contains the associated target vectors used + to reduce the ambiguity in bfd_check_format_matches. */ + +static const bfd_target *_bfd_associated_vector[] = { +#ifdef ASSOCIATED_VECS + ASSOCIATED_VECS, +#endif + NULL +}; +const bfd_target * const *bfd_associated_vector = _bfd_associated_vector; + /* When there is an ambiguous match, bfd_check_format_matches puts the names of the matching targets in an array. This variable is the maximum number of entries that the array could possibly need. */ @@ -1093,13 +1162,10 @@ static const struct targmatch bfd_target_match[] = { { NULL, NULL } }; -static const bfd_target *find_target PARAMS ((const char *)); - /* Find a target vector, given a name or configuration triplet. */ static const bfd_target * -find_target (name) - const char *name; +find_target (const char *name) { const bfd_target * const *target; const struct targmatch *match; @@ -1131,7 +1197,7 @@ FUNCTION bfd_set_default_target SYNOPSIS - boolean bfd_set_default_target (const char *name); + bfd_boolean bfd_set_default_target (const char *name); DESCRIPTION Set the default target vector to use when recognizing a BFD. @@ -1139,22 +1205,21 @@ DESCRIPTION name or a configuration triplet. */ -boolean -bfd_set_default_target (name) - const char *name; +bfd_boolean +bfd_set_default_target (const char *name) { const bfd_target *target; if (bfd_default_vector[0] != NULL && strcmp (name, bfd_default_vector[0]->name) == 0) - return true; + return TRUE; target = find_target (name); if (target == NULL) - return false; + return FALSE; bfd_default_vector[0] = target; - return true; + return TRUE; } /* @@ -1162,7 +1227,7 @@ FUNCTION bfd_find_target SYNOPSIS - const bfd_target *bfd_find_target(const char *target_name, bfd *abfd); + const bfd_target *bfd_find_target (const char *target_name, bfd *abfd); DESCRIPTION Return a pointer to the transfer vector for the object target @@ -1177,9 +1242,7 @@ DESCRIPTION */ const bfd_target * -bfd_find_target (target_name, abfd) - const char *target_name; - bfd *abfd; +bfd_find_target (const char *target_name, bfd *abfd) { const char *targname; const bfd_target *target; @@ -1189,10 +1252,10 @@ bfd_find_target (target_name, abfd) else targname = getenv ("GNUTARGET"); - /* This is safe; the vector cannot be null */ + /* This is safe; the vector cannot be null. */ if (targname == NULL || strcmp (targname, "default") == 0) { - abfd->target_defaulted = true; + abfd->target_defaulted = TRUE; if (bfd_default_vector[0] != NULL) abfd->xvec = bfd_default_vector[0]; else @@ -1200,7 +1263,7 @@ bfd_find_target (target_name, abfd) return abfd->xvec; } - abfd->target_defaulted = false; + abfd->target_defaulted = FALSE; target = find_target (targname); if (target == NULL) @@ -1215,7 +1278,7 @@ FUNCTION bfd_target_list SYNOPSIS - const char **bfd_target_list(void); + const char ** bfd_target_list (void); DESCRIPTION Return a freshly malloced NULL-terminated @@ -1225,9 +1288,9 @@ DESCRIPTION */ const char ** -bfd_target_list () +bfd_target_list (void) { - int vec_length= 0; + int vec_length = 0; bfd_size_type amt; #if defined (HOST_HPPAHPUX) && ! defined (__STDC__) /* The native compiler on the HP9000/700 has a bug which causes it @@ -1241,7 +1304,7 @@ bfd_target_list () vec_length++; amt = (vec_length + 1) * sizeof (char **); - name_ptr = name_list = (const char **) bfd_zmalloc (amt); + name_ptr = name_list = bfd_malloc (amt); if (name_list == NULL) return NULL; @@ -1251,6 +1314,7 @@ bfd_target_list () || *target != bfd_target_vector[0]) *name_ptr++ = (*target)->name; + *name_ptr = NULL; return name_list; } @@ -1259,7 +1323,9 @@ FUNCTION bfd_seach_for_target 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 @@ -1270,15 +1336,14 @@ DESCRIPTION */ const bfd_target * -bfd_search_for_target (search_func, data) - int (* search_func) PARAMS ((const bfd_target * target, void * data)); - void * data; +bfd_search_for_target (int (*search_func) (const bfd_target *, void *), + void *data) { - const bfd_target * const * target; + const bfd_target * const *target; - for (target = bfd_target_vector; * target != NULL; target ++) - if (search_func (* target, data)) - return * target; + for (target = bfd_target_vector; *target != NULL; target ++) + if (search_func (*target, data)) + return *target; return NULL; } diff --git a/contrib/binutils/bfd/tekhex.c b/contrib/binutils/bfd/tekhex.c index 19dcb87..f828fe7 100644 --- a/contrib/binutils/bfd/tekhex.c +++ b/contrib/binutils/bfd/tekhex.c @@ -1,5 +1,5 @@ /* BFD backend for Extended Tektronix Hex Format objects. - Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 + Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . @@ -29,7 +29,7 @@ DESCRIPTION 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, + It seems that the sections are described 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 read in the file. @@ -104,23 +104,23 @@ static void tekhex_print_symbol PARAMS ((bfd *, PTR, asymbol *, bfd_print_symbol_type)); static void tekhex_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); static asymbol *tekhex_make_empty_symbol PARAMS ((bfd *)); -static int tekhex_sizeof_headers PARAMS ((bfd *, boolean)); -static boolean tekhex_write_object_contents PARAMS ((bfd *)); +static int tekhex_sizeof_headers PARAMS ((bfd *, bfd_boolean)); +static bfd_boolean tekhex_write_object_contents PARAMS ((bfd *)); static void out PARAMS ((bfd *, int, char *, char *)); static void writesym PARAMS ((char **, const char *)); static void writevalue PARAMS ((char **, bfd_vma)); -static boolean tekhex_set_section_contents - PARAMS ((bfd*, sec_ptr, PTR, file_ptr, bfd_size_type)); -static boolean tekhex_set_arch_mach +static bfd_boolean tekhex_set_section_contents + PARAMS ((bfd*, sec_ptr, const PTR, file_ptr, bfd_size_type)); +static bfd_boolean tekhex_set_arch_mach PARAMS ((bfd *, enum bfd_architecture, unsigned long)); -static boolean tekhex_get_section_contents +static bfd_boolean tekhex_get_section_contents PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type)); static void move_section_contents - PARAMS ((bfd *, asection *, PTR, file_ptr, bfd_size_type, boolean)); + PARAMS ((bfd *, asection *, const PTR, file_ptr, bfd_size_type, bfd_boolean)); static const bfd_target *tekhex_object_p PARAMS ((bfd *)); -static boolean tekhex_mkobject PARAMS ((bfd *)); +static bfd_boolean tekhex_mkobject PARAMS ((bfd *)); static long tekhex_get_symtab_upper_bound PARAMS ((bfd *)); -static long tekhex_get_symtab PARAMS ((bfd *, asymbol **)); +static long tekhex_canonicalize_symtab PARAMS ((bfd *, asymbol **)); 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)); @@ -239,12 +239,12 @@ static void tekhex_init () { unsigned int i; - static boolean inited = false; + static bfd_boolean inited = FALSE; int val; if (! inited) { - inited = true; + inited = TRUE; hex_init (); val = 0; for (i = 0; i < 10; i++) @@ -471,7 +471,7 @@ first_phase (abfd, type, src) } } -/* Pass over an tekhex, calling one of the above functions on each +/* Pass over a tekhex, calling one of the above functions on each record. */ static void @@ -480,7 +480,7 @@ pass_over (abfd, func) void (*func) PARAMS ((bfd *, int, char *)); { unsigned int chars_on_line; - boolean eof = false; + bfd_boolean eof = FALSE; /* To the front of the file */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) @@ -492,10 +492,10 @@ pass_over (abfd, func) char type; /* Find first '%' */ - eof = (boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1); + eof = (bfd_boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1); while (*src != '%' && !eof) { - eof = (boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1); + eof = (bfd_boolean) (bfd_bread (src, (bfd_size_type) 1, abfd) != 1); } if (eof) break; @@ -522,7 +522,7 @@ pass_over (abfd, func) } static long -tekhex_get_symtab (abfd, table) +tekhex_canonicalize_symtab (abfd, table) bfd *abfd; asymbol **table; { @@ -547,7 +547,7 @@ tekhex_get_symtab_upper_bound (abfd) } -static boolean +static bfd_boolean tekhex_mkobject (abfd) bfd *abfd; { @@ -555,17 +555,17 @@ tekhex_mkobject (abfd) tdata = (tdata_type *) bfd_alloc (abfd, (bfd_size_type) sizeof (tdata_type)); if (!tdata) - return false; + return FALSE; abfd->tdata.tekhex_data = tdata; tdata->type = 1; tdata->head = (tekhex_data_list_type *) NULL; tdata->symbols = (struct tekhex_symbol_struct *) NULL; tdata->data = (struct data_struct *) NULL; - return true; + return TRUE; } /* - Return true if the file looks like it's in TekHex format. Just look + Return TRUE if the file looks like it's in TekHex format. Just look for a percent sign and some hex digits */ static const bfd_target * @@ -593,10 +593,10 @@ static void move_section_contents (abfd, section, locationp, offset, count, get) bfd *abfd; asection *section; - PTR locationp; + const PTR locationp; file_ptr offset; bfd_size_type count; - boolean get; + bfd_boolean get; { bfd_vma addr; char *location = (char *) locationp; @@ -639,7 +639,7 @@ move_section_contents (abfd, section, locationp, offset, count, get) } -static boolean +static bfd_boolean tekhex_get_section_contents (abfd, section, locationp, offset, count) bfd *abfd; asection *section; @@ -649,14 +649,14 @@ tekhex_get_section_contents (abfd, section, locationp, offset, count) { if (section->flags & (SEC_LOAD | SEC_ALLOC)) { - move_section_contents (abfd, section, locationp, offset, count, true); - return true; + move_section_contents (abfd, section, locationp, offset, count, TRUE); + return TRUE; } else - return false; + return FALSE; } -static boolean +static bfd_boolean tekhex_set_arch_mach (abfd, arch, machine) bfd *abfd; enum bfd_architecture arch; @@ -668,11 +668,11 @@ tekhex_set_arch_mach (abfd, arch, machine) /* we have to save up all the Tekhexords for a splurge before output, */ -static boolean +static bfd_boolean tekhex_set_section_contents (abfd, section, locationp, offset, bytes_to_do) bfd *abfd; sec_ptr section; - PTR locationp; + const PTR locationp; file_ptr offset; bfd_size_type bytes_to_do; { @@ -698,11 +698,11 @@ tekhex_set_section_contents (abfd, section, locationp, offset, bytes_to_do) if (section->flags & (SEC_LOAD | SEC_ALLOC)) { move_section_contents (abfd, section, locationp, offset, bytes_to_do, - false); - return true; + FALSE); + return TRUE; } else - return false; + return FALSE; } @@ -804,7 +804,7 @@ out (abfd, type, start, end) abort (); } -static boolean +static bfd_boolean tekhex_write_object_contents (abfd) bfd *abfd; { @@ -907,7 +907,7 @@ tekhex_write_object_contents (abfd) case 'C': case 'U': bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; } writesym (&dst, sym->name); @@ -920,13 +920,13 @@ tekhex_write_object_contents (abfd) /* And the terminator */ if (bfd_bwrite ("%0781010\n", (bfd_size_type) 9, abfd) != 9) abort (); - return true; + return TRUE; } static int tekhex_sizeof_headers (abfd, exec) bfd *abfd ATTRIBUTE_UNUSED; - boolean exec ATTRIBUTE_UNUSED; + bfd_boolean exec ATTRIBUTE_UNUSED; { return 0; diff --git a/contrib/binutils/bfd/trad-core.c b/contrib/binutils/bfd/trad-core.c index e27cd35..f8c03d7 100644 --- a/contrib/binutils/bfd/trad-core.c +++ b/contrib/binutils/bfd/trad-core.c @@ -1,6 +1,6 @@ /* BFD back end for traditional Unix core files (U-area and raw sections) Copyright 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by John Gilmore of Cygnus Support. @@ -47,13 +47,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include TRAD_HEADER #endif - struct trad_core_struct - { - asection *data_section; - asection *stack_section; - asection *reg_section; - struct user u; - }; +struct trad_core_struct +{ + asection *data_section; + asection *stack_section; + asection *reg_section; + struct user u; +}; #define core_upage(bfd) (&((bfd)->tdata.trad_core_data->u)) #define core_datasec(bfd) ((bfd)->tdata.trad_core_data->data_section) @@ -63,15 +63,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* forward declarations */ const bfd_target *trad_unix_core_file_p PARAMS ((bfd *abfd)); -char * trad_unix_core_file_failing_command PARAMS ((bfd *abfd)); -int trad_unix_core_file_failing_signal PARAMS ((bfd *abfd)); -boolean trad_unix_core_file_matches_executable_p - PARAMS ((bfd *core_bfd, bfd *exec_bfd)); -static void swap_abort PARAMS ((void)); +char * trad_unix_core_file_failing_command PARAMS ((bfd *abfd)); +int trad_unix_core_file_failing_signal PARAMS ((bfd *abfd)); +bfd_boolean trad_unix_core_file_matches_executable_p + PARAMS ((bfd *core_bfd, bfd *exec_bfd)); +static void swap_abort PARAMS ((void)); /* Handle 4.2-style (and perhaps also sysV-style) core dump file. */ -/* ARGSUSED */ const bfd_target * trad_unix_core_file_p (abfd) bfd *abfd; @@ -248,7 +247,6 @@ trad_unix_core_file_failing_command (abfd) return 0; } -/* ARGSUSED */ int trad_unix_core_file_failing_signal (ignore_abfd) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -260,13 +258,12 @@ trad_unix_core_file_failing_signal (ignore_abfd) #endif } -/* ARGSUSED */ -boolean +bfd_boolean trad_unix_core_file_matches_executable_p (core_bfd, exec_bfd) bfd *core_bfd ATTRIBUTE_UNUSED; bfd *exec_bfd ATTRIBUTE_UNUSED; { - return true; /* FIXME, We have no way of telling at this point */ + return TRUE; /* FIXME, We have no way of telling at this point */ } /* If somebody calls any byte-swapping routines, shoot them. */ @@ -275,10 +272,13 @@ swap_abort () { 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 ) -#define NO_SIGNED_GET \ - ((bfd_signed_vma (*) PARAMS ((const bfd_byte *))) swap_abort ) + +#define NO_GET ((bfd_vma (*) (const void *)) swap_abort) +#define NO_PUT ((void (*) (bfd_vma, void *)) swap_abort) +#define NO_GETS ((bfd_signed_vma (*) (const void *)) swap_abort) +#define NO_GET64 ((bfd_uint64_t (*) (const void *)) swap_abort) +#define NO_PUT64 ((void (*) (bfd_uint64_t, void *)) swap_abort) +#define NO_GETS64 ((bfd_int64_t (*) (const void *)) swap_abort) const bfd_target trad_core_vec = { @@ -293,39 +293,39 @@ const bfd_target trad_core_vec = 0, /* symbol prefix */ ' ', /* ar_pad_char */ 16, /* ar_max_namelen */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit data */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit data */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit data */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 64 bit hdrs */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 32 bit hdrs */ - NO_GET, NO_SIGNED_GET, NO_PUT, /* 16 bit hdrs */ + NO_GET64, NO_GETS64, NO_PUT64, /* 64 bit data */ + NO_GET, NO_GETS, NO_PUT, /* 32 bit data */ + NO_GET, NO_GETS, NO_PUT, /* 16 bit data */ + NO_GET64, NO_GETS64, NO_PUT64, /* 64 bit hdrs */ + NO_GET, NO_GETS, NO_PUT, /* 32 bit hdrs */ + NO_GET, NO_GETS, NO_PUT, /* 16 bit hdrs */ { /* bfd_check_format */ - _bfd_dummy_target, /* unknown format */ - _bfd_dummy_target, /* object file */ - _bfd_dummy_target, /* archive */ - trad_unix_core_file_p /* a core file */ + _bfd_dummy_target, /* unknown format */ + _bfd_dummy_target, /* object file */ + _bfd_dummy_target, /* archive */ + trad_unix_core_file_p /* a core file */ }, { /* bfd_set_format */ - bfd_false, bfd_false, - bfd_false, bfd_false + bfd_false, bfd_false, + bfd_false, bfd_false }, { /* bfd_write_contents */ - bfd_false, bfd_false, - bfd_false, bfd_false + 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), - 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 (trad_unix), + BFD_JUMP_TABLE_ARCHIVE (_bfd_noarchive), + BFD_JUMP_TABLE_SYMBOLS (_bfd_nosymbols), + BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), + BFD_JUMP_TABLE_WRITE (_bfd_generic), + BFD_JUMP_TABLE_LINK (_bfd_nolink), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, (PTR) 0 /* backend_data */ -}; + }; diff --git a/contrib/binutils/bfd/version.h b/contrib/binutils/bfd/version.h index 6dac811..ab4618d 100644 --- a/contrib/binutils/bfd/version.h +++ b/contrib/binutils/bfd/version.h @@ -1 +1,3 @@ -#define BFD_VERSION_DATE 20021127 +#define BFD_VERSION_DATE 20040523 +#define BFD_VERSION @bfd_version@ +#define BFD_VERSION_STRING @bfd_version_string@ diff --git a/contrib/binutils/bfd/xcoff-target.h b/contrib/binutils/bfd/xcoff-target.h index 413511b..7bf3de7 100644 --- a/contrib/binutils/bfd/xcoff-target.h +++ b/contrib/binutils/bfd/xcoff-target.h @@ -57,7 +57,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #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 (); +extern bfd_boolean rs6000coff_core_file_matches_executable_p (); #undef coff_core_file_matches_executable_p #define coff_core_file_matches_executable_p \ @@ -78,8 +78,8 @@ extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd)); #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)); +extern bfd_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 @@ -106,7 +106,7 @@ extern int lynx_core_file_failing_signal PARAMS ((bfd *abfd)); #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_boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \ bfd_false) #define _bfd_xcoff_truncate_arname bfd_dont_truncate_arname @@ -118,22 +118,22 @@ extern int lynx_core_file_failing_signal PARAMS ((bfd *abfd)); #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 bfd_boolean _bfd_xcoff_mkobject PARAMS ((bfd *)); +extern bfd_boolean _bfd_xcoff_copy_private_bfd_data PARAMS ((bfd *, bfd *)); +extern bfd_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 bfd_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 +extern bfd_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 bfd_boolean _bfd_xcoff_write_archive_contents PARAMS ((bfd *)); +extern int _bfd_xcoff_sizeof_headers PARAMS ((bfd *, 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)); diff --git a/contrib/binutils/bfd/xcofflink.c b/contrib/binutils/bfd/xcofflink.c index e4e4755..ccd82be 100644 --- a/contrib/binutils/bfd/xcofflink.c +++ b/contrib/binutils/bfd/xcofflink.c @@ -1,5 +1,5 @@ /* POWER/PowerPC XCOFF linker support. - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor , Cygnus Support. @@ -115,34 +115,35 @@ struct xcoff_final_link_info static struct bfd_hash_entry *xcoff_link_hash_newfunc PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static boolean xcoff_get_section_contents PARAMS ((bfd *, asection *)); +static bfd_boolean xcoff_get_section_contents PARAMS ((bfd *, asection *)); static struct internal_reloc *xcoff_read_internal_relocs - PARAMS ((bfd *, asection *, boolean, bfd_byte *, boolean, + PARAMS ((bfd *, asection *, bfd_boolean, bfd_byte *, bfd_boolean, struct internal_reloc *)); -static boolean xcoff_link_add_object_symbols +static bfd_boolean xcoff_link_add_object_symbols PARAMS ((bfd *, struct bfd_link_info *)); -static boolean xcoff_link_check_archive_element - PARAMS ((bfd *, struct bfd_link_info *, boolean *)); -static boolean xcoff_link_check_ar_symbols - PARAMS ((bfd *, struct bfd_link_info *, boolean *)); -static boolean xcoff_link_check_dynamic_ar_symbols - PARAMS ((bfd *, struct bfd_link_info *, boolean *)); +static bfd_boolean xcoff_link_check_archive_element + PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *)); +static bfd_boolean xcoff_link_check_ar_symbols + PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *)); +static bfd_boolean xcoff_link_check_dynamic_ar_symbols + PARAMS ((bfd *, struct bfd_link_info *, bfd_boolean *)); static bfd_size_type xcoff_find_reloc PARAMS ((struct internal_reloc *, bfd_size_type, bfd_vma)); -static boolean xcoff_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); -static boolean xcoff_link_add_dynamic_symbols +static bfd_boolean xcoff_link_add_symbols PARAMS ((bfd *, struct bfd_link_info *)); -static boolean xcoff_mark_symbol +static bfd_boolean xcoff_link_add_dynamic_symbols + PARAMS ((bfd *, struct bfd_link_info *)); +static bfd_boolean xcoff_mark_symbol PARAMS ((struct bfd_link_info *, struct xcoff_link_hash_entry *)); -static boolean xcoff_mark PARAMS ((struct bfd_link_info *, asection *)); +static bfd_boolean xcoff_mark PARAMS ((struct bfd_link_info *, asection *)); static void xcoff_sweep PARAMS ((struct bfd_link_info *)); -static boolean xcoff_build_ldsyms +static bfd_boolean xcoff_build_ldsyms PARAMS ((struct xcoff_link_hash_entry *, PTR)); -static boolean xcoff_link_input_bfd +static bfd_boolean xcoff_link_input_bfd PARAMS ((struct xcoff_final_link_info *, bfd *)); -static boolean xcoff_write_global_symbol +static bfd_boolean xcoff_write_global_symbol PARAMS ((struct xcoff_link_hash_entry *, PTR)); -static boolean xcoff_reloc_link_order +static bfd_boolean xcoff_reloc_link_order PARAMS ((bfd *, struct xcoff_final_link_info *, asection *, struct bfd_link_order *)); static int xcoff_sort_relocs PARAMS ((const PTR, const PTR)); @@ -154,7 +155,7 @@ static int xcoff_sort_relocs PARAMS ((const PTR, const PTR)); /* Read the contents of a section. */ -static boolean +static bfd_boolean xcoff_get_section_contents (abfd, sec) bfd *abfd; asection *sec; @@ -165,7 +166,7 @@ xcoff_get_section_contents (abfd, sec) bfd_size_type amt = sizeof (struct coff_section_tdata); sec->used_by_bfd = bfd_zalloc (abfd, amt); if (sec->used_by_bfd == NULL) - return false; + return FALSE; } if (coff_section_data (abfd, sec)->contents == NULL) @@ -173,15 +174,15 @@ xcoff_get_section_contents (abfd, sec) coff_section_data (abfd, sec)->contents = ((bfd_byte *) bfd_malloc (sec->_raw_size)); if (coff_section_data (abfd, sec)->contents == NULL) - return false; + return FALSE; if (! bfd_get_section_contents (abfd, sec, coff_section_data (abfd, sec)->contents, (file_ptr) 0, sec->_raw_size)) - return false; + return FALSE; } - return true; + return TRUE; } /* Get the size required to hold the dynamic symbols. */ @@ -247,7 +248,7 @@ _bfd_xcoff_canonicalize_dynamic_symtab (abfd, psyms) return -1; contents = coff_section_data (abfd, lsec)->contents; - coff_section_data (abfd, lsec)->keep_contents = true; + coff_section_data (abfd, lsec)->keep_contents = TRUE; bfd_xcoff_swap_ldhdr_in (abfd, contents, &ldhdr); @@ -295,7 +296,7 @@ _bfd_xcoff_canonicalize_dynamic_symtab (abfd, psyms) symbuf->symbol.flags |= BSF_GLOBAL; /* FIXME: We have no way to record the other information stored - with the loader symbol. */ + with the loader symbol. */ *psyms = (asymbol *) symbuf; } @@ -421,8 +422,8 @@ _bfd_xcoff_canonicalize_dynamic_reloc (abfd, prelocs, syms) relbuf->addend = 0; /* Most dynamic relocs have the same type. FIXME: This is only - correct if ldrel.l_rtype == 0. In other cases, we should use - a different howto. */ + correct if ldrel.l_rtype == 0. In other cases, we should use + a different howto. */ relbuf->howto = bfd_xcoff_dynamic_reloc_howto(abfd); /* FIXME: We have no way to record the l_rsecnm field. */ @@ -501,14 +502,14 @@ _bfd_xcoff_bfd_link_hash_table_create (abfd) ret->descriptor_section = NULL; ret->imports = NULL; ret->file_align = 0; - ret->textro = false; - ret->gc = false; + ret->textro = FALSE; + ret->gc = FALSE; memset (ret->special_sections, 0, sizeof ret->special_sections); /* The linker will always generate a full a.out header. We need to record that fact now, before the sizeof_headers routine could be called. */ - xcoff_data (abfd)->full_aouthdr = true; + xcoff_data (abfd)->full_aouthdr = TRUE; return &ret->root; } @@ -535,9 +536,9 @@ xcoff_read_internal_relocs (abfd, sec, cache, external_relocs, require_internal, internal_relocs) bfd *abfd; asection *sec; - boolean cache; + bfd_boolean cache; bfd_byte *external_relocs; - boolean require_internal; + bfd_boolean require_internal; struct internal_reloc *internal_relocs; { @@ -555,8 +556,8 @@ xcoff_read_internal_relocs (abfd, sec, cache, external_relocs, && cache && enclosing->reloc_count > 0) { - if (_bfd_coff_read_internal_relocs (abfd, enclosing, true, - external_relocs, false, + if (_bfd_coff_read_internal_relocs (abfd, enclosing, TRUE, + external_relocs, FALSE, (struct internal_reloc *) NULL) == NULL) return NULL; @@ -587,7 +588,7 @@ xcoff_read_internal_relocs (abfd, sec, cache, external_relocs, /* Given an XCOFF BFD, add symbols to the global hash table as appropriate. */ -boolean +bfd_boolean _bfd_xcoff_bfd_link_add_symbols (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -600,21 +601,21 @@ _bfd_xcoff_bfd_link_add_symbols (abfd, info) case bfd_archive: /* If the archive has a map, do the usual search. We then need - to check the archive for dynamic objects, because they may not - appear in the archive map even though they should, perhaps, be - included. If the archive has no map, we just consider each object - file in turn, since that apparently is what the AIX native linker + to check the archive for dynamic objects, because they may not + appear in the archive map even though they should, perhaps, be + included. If the archive has no map, we just consider each object + file in turn, since that apparently is what the AIX native linker does. */ if (bfd_has_map (abfd)) { if (! (_bfd_generic_link_add_archive_symbols (abfd, info, xcoff_link_check_archive_element))) - return false; + return FALSE; } { bfd *member; - + member = bfd_openr_next_archived_file (abfd, (bfd *) NULL); while (member != NULL) { @@ -622,11 +623,11 @@ _bfd_xcoff_bfd_link_add_symbols (abfd, info) && (info->hash->creator == member->xvec) && (! bfd_has_map (abfd) || (member->flags & DYNAMIC) != 0)) { - boolean needed; - - if (! xcoff_link_check_archive_element (member, info, + bfd_boolean needed; + + if (! xcoff_link_check_archive_element (member, info, &needed)) - return false; + return FALSE; if (needed) member->archive_pass = -1; } @@ -634,32 +635,32 @@ _bfd_xcoff_bfd_link_add_symbols (abfd, info) } } - return true; + return TRUE; default: bfd_set_error (bfd_error_wrong_format); - return false; + return FALSE; } } /* Add symbols from an XCOFF object file. */ -static boolean +static bfd_boolean xcoff_link_add_object_symbols (abfd, info) bfd *abfd; struct bfd_link_info *info; { if (! _bfd_coff_get_external_symbols (abfd)) - return false; + return FALSE; if (! xcoff_link_add_symbols (abfd, info)) - return false; + return FALSE; if (! info->keep_memory) { if (! _bfd_coff_free_symbols (abfd)) - return false; + return FALSE; } - return true; + return TRUE; } /* Check a single archive element to see if we need to include it in @@ -667,48 +668,48 @@ xcoff_link_add_object_symbols (abfd, info) needed in the link or not. This is called via _bfd_generic_link_add_archive_symbols. */ -static boolean +static bfd_boolean xcoff_link_check_archive_element (abfd, info, pneeded) bfd *abfd; struct bfd_link_info *info; - boolean *pneeded; + bfd_boolean *pneeded; { if (! _bfd_coff_get_external_symbols (abfd)) - return false; + return FALSE; if (! xcoff_link_check_ar_symbols (abfd, info, pneeded)) - return false; + return FALSE; if (*pneeded) { if (! xcoff_link_add_symbols (abfd, info)) - return false; + return FALSE; } if (! info->keep_memory || ! *pneeded) { if (! _bfd_coff_free_symbols (abfd)) - return false; + return FALSE; } - return true; + return TRUE; } /* Look through the symbols to see if this object file should be included in the link. */ -static boolean +static bfd_boolean xcoff_link_check_ar_symbols (abfd, info, pneeded) bfd *abfd; struct bfd_link_info *info; - boolean *pneeded; + bfd_boolean *pneeded; { bfd_size_type symesz; bfd_byte *esym; bfd_byte *esym_end; - *pneeded = false; + *pneeded = FALSE; if ((abfd->flags & DYNAMIC) != 0 && ! info->static_link @@ -731,13 +732,13 @@ xcoff_link_check_ar_symbols (abfd, info, pneeded) struct bfd_link_hash_entry *h; /* This symbol is externally visible, and is defined by this - object file. */ + object file. */ name = _bfd_coff_internal_syment_name (abfd, &sym, buf); if (name == NULL) - return false; - h = bfd_link_hash_lookup (info->hash, name, false, false, true); + return FALSE; + h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE); /* We are only interested in symbols that are currently undefined. If a symbol is currently known to be common, @@ -751,9 +752,9 @@ xcoff_link_check_ar_symbols (abfd, info, pneeded) & XCOFF_DEF_DYNAMIC) == 0)) { if (! (*info->callbacks->add_archive_element) (info, abfd, name)) - return false; - *pneeded = true; - return true; + return FALSE; + *pneeded = TRUE; + return TRUE; } } @@ -761,18 +762,18 @@ xcoff_link_check_ar_symbols (abfd, info, pneeded) } /* We do not need this object file. */ - return true; + return TRUE; } /* Look through the loader symbols to see if this dynamic object should be included in the link. The native linker uses the loader symbols, not the normal symbol table, so we do too. */ -static boolean +static bfd_boolean xcoff_link_check_dynamic_ar_symbols (abfd, info, pneeded) bfd *abfd; struct bfd_link_info *info; - boolean *pneeded; + bfd_boolean *pneeded; { asection *lsec; bfd_byte *contents; @@ -780,17 +781,17 @@ xcoff_link_check_dynamic_ar_symbols (abfd, info, pneeded) const char *strings; bfd_byte *elsym, *elsymend; - *pneeded = false; + *pneeded = FALSE; lsec = bfd_get_section_by_name (abfd, ".loader"); if (lsec == NULL) { /* There are no symbols, so don't try to include it. */ - return true; + return TRUE; } if (! xcoff_get_section_contents (abfd, lsec)) - return false; + return FALSE; contents = coff_section_data (abfd, lsec)->contents; bfd_xcoff_swap_ldhdr_in (abfd, contents, &ldhdr); @@ -822,20 +823,20 @@ xcoff_link_check_dynamic_ar_symbols (abfd, info, pneeded) name = nambuf; } - h = bfd_link_hash_lookup (info->hash, name, false, false, true); + h = bfd_link_hash_lookup (info->hash, name, FALSE, FALSE, TRUE); /* We are only interested in symbols that are currently - undefined. At this point we know that we are using an XCOFF - hash table. */ + undefined. At this point we know that we are using an XCOFF + hash table. */ if (h != NULL && h->type == bfd_link_hash_undefined && (((struct xcoff_link_hash_entry *) h)->flags & XCOFF_DEF_DYNAMIC) == 0) { if (! (*info->callbacks->add_archive_element) (info, abfd, name)) - return false; - *pneeded = true; - return true; + return FALSE; + *pneeded = TRUE; + return TRUE; } } @@ -847,7 +848,7 @@ xcoff_link_check_dynamic_ar_symbols (abfd, info, pneeded) coff_section_data (abfd, lsec)->contents = NULL; } - return true; + return TRUE; } /* Returns the index of reloc in RELOCS with the least address greater @@ -905,11 +906,11 @@ xcoff_find_reloc (relocs, count, address) Takes care of creating the .loader, .gl, .ds, .debug and sections. */ -static boolean +static bfd_boolean xcoff_link_create_extra_sections(bfd * abfd, struct bfd_link_info *info) { - boolean return_value = false; + bfd_boolean return_value = FALSE; if (info->hash->creator == abfd->xvec) { @@ -998,7 +999,7 @@ xcoff_link_create_extra_sections(bfd * abfd, struct bfd_link_info *info) } } - return_value = true; + return_value = TRUE; end_return: @@ -1023,21 +1024,21 @@ xcoff_link_create_extra_sections(bfd * abfd, struct bfd_link_info *info) relocation entries carefully, since the only way to tell which csect they belong to is to examine the address. */ -static boolean +static bfd_boolean xcoff_link_add_symbols (abfd, info) bfd *abfd; struct bfd_link_info *info; { unsigned int n_tmask; unsigned int n_btshft; - boolean default_copy; + bfd_boolean default_copy; bfd_size_type symcount; struct xcoff_link_hash_entry **sym_hash; asection **csect_cache; bfd_size_type linesz; asection *o; asection *last_real; - boolean keep_syms; + bfd_boolean keep_syms; asection *csect; unsigned int csect_index; asection *first_csect; @@ -1058,16 +1059,16 @@ xcoff_link_add_symbols (abfd, info) && ! info->static_link) { if (! xcoff_link_add_dynamic_symbols (abfd, info)) - return false; + return FALSE; } /* create the loader, toc, gl, ds and debug sections, if needed */ - if (false == xcoff_link_create_extra_sections(abfd, info)) + if (! xcoff_link_create_extra_sections (abfd, info)) goto error_return; if ((abfd->flags & DYNAMIC) != 0 && ! info->static_link) - return true; + return TRUE; n_tmask = coff_data (abfd)->local_n_tmask; n_btshft = coff_data (abfd)->local_n_btshft; @@ -1077,9 +1078,9 @@ xcoff_link_add_symbols (abfd, info) #define N_BTSHFT n_btshft if (info->keep_memory) - default_copy = false; + default_copy = FALSE; else - default_copy = true; + default_copy = TRUE; symcount = obj_raw_syment_count (abfd); @@ -1122,8 +1123,8 @@ xcoff_link_add_symbols (abfd, info) { reloc_info[o->target_index].relocs = - xcoff_read_internal_relocs (abfd, o, true, (bfd_byte *) NULL, - false, (struct internal_reloc *) NULL); + xcoff_read_internal_relocs (abfd, o, TRUE, (bfd_byte *) NULL, + FALSE, (struct internal_reloc *) NULL); amt = o->reloc_count; amt *= sizeof (asection *); reloc_info[o->target_index].csects = (asection **) bfd_zmalloc (amt); @@ -1150,7 +1151,7 @@ xcoff_link_add_symbols (abfd, info) } /* Don't let the linker relocation routines discard the symbols. */ - obj_coff_keep_syms (abfd) = true; + obj_coff_keep_syms (abfd) = TRUE; csect = NULL; csect_index = 0; @@ -1214,11 +1215,11 @@ xcoff_link_add_symbols (abfd, info) goto error_return; /* If this symbol has line number information attached to it, - and we're not stripping it, count the number of entries and - add them to the count for this csect. In the final link pass - we are going to attach line number information by symbol, - rather than by section, in order to more easily handle - garbage collection. */ + and we're not stripping it, count the number of entries and + add them to the count for this csect. In the final link pass + we are going to attach line number information by symbol, + rather than by section, in order to more easily handle + garbage collection. */ if ((info->strip == strip_none || info->strip == strip_some) && sym.n_numaux > 1 && csect != NULL @@ -1247,7 +1248,7 @@ xcoff_link_add_symbols (abfd, info) } linoff = (auxlin.x_sym.x_fcnary.x_fcn.x_lnnoptr - enclosing->line_filepos); - /* explict cast to bfd_signed_vma for compiler */ + /* explicit cast to bfd_signed_vma for compiler */ if (linoff < (bfd_signed_vma) (enclosing->lineno_count * linesz)) { struct internal_lineno lin; @@ -1336,7 +1337,7 @@ xcoff_link_add_symbols (abfd, info) } /* An XMC_XO external reference is actually a reference to - an absolute location. */ + an absolute location. */ if (aux.x_csect.x_smclas != XMC_XO) section = bfd_und_section_ptr; else @@ -1430,7 +1431,7 @@ xcoff_link_add_symbols (abfd, info) { const char *relname; char relbuf[SYMNMLEN + 1]; - boolean copy; + bfd_boolean copy; struct xcoff_link_hash_entry *h; /* At this point we know that the TOC entry is @@ -1453,8 +1454,8 @@ xcoff_link_add_symbols (abfd, info) || relsym._n._n_n._n_zeroes != 0 || relsym._n._n_n._n_offset == 0); h = xcoff_link_hash_lookup (xcoff_hash_table (info), - relname, true, copy, - false); + relname, TRUE, copy, + FALSE); if (h == NULL) goto error_return; @@ -1606,19 +1607,19 @@ xcoff_link_add_symbols (abfd, info) follow its appropriate XTY_SD symbol. The .set pseudo op can cause the XTY_LD to not follow the XTY_SD symbol. */ { - boolean bad; + bfd_boolean bad; - bad = false; + bad = FALSE; if (aux.x_csect.x_scnlen.l < 0 || (aux.x_csect.x_scnlen.l >= esym - (bfd_byte *) obj_coff_external_syms (abfd))) - bad = true; + bad = TRUE; if (! bad) { section = xcoff_data (abfd)->csects[aux.x_csect.x_scnlen.l]; if (section == NULL || (section->flags & SEC_HAS_CONTENTS) == 0) - bad = true; + bad = TRUE; } if (bad) { @@ -1635,11 +1636,11 @@ xcoff_link_add_symbols (abfd, info) case XTY_CM: /* This is an unitialized csect. We could base the name on - the storage mapping class, but we don't bother except for - an XMC_TD symbol. If this csect is externally visible, - it is a common symbol. We put XMC_TD symbols in sections - named .tocbss, and rely on the linker script to put that - in the TOC area. */ + the storage mapping class, but we don't bother except for + an XMC_TD symbol. If this csect is externally visible, + it is a common symbol. We put XMC_TD symbols in sections + named .tocbss, and rely on the linker script to put that + in the TOC area. */ if (csect != NULL) { @@ -1730,20 +1731,20 @@ xcoff_link_add_symbols (abfd, info) } /* Now we have enough information to add the symbol to the - linker hash table. */ + linker hash table. */ if (sym.n_sclass == C_EXT) { - boolean copy; + bfd_boolean copy; BFD_ASSERT (section != NULL); /* We must copy the name into memory if we got it from the - syment itself, rather than the string table. */ + syment itself, rather than the string table. */ copy = default_copy; if (sym._n._n_n._n_zeroes != 0 || sym._n._n_n._n_offset == 0) - copy = true; + copy = TRUE; /* The AIX linker appears to only detect multiple symbol definitions when there is a reference to the symbol. If @@ -1775,7 +1776,7 @@ xcoff_link_add_symbols (abfd, info) if (! bfd_is_und_section (section)) { *sym_hash = xcoff_link_hash_lookup (xcoff_hash_table (info), - name, true, copy, false); + name, TRUE, copy, FALSE); } else { @@ -1783,8 +1784,8 @@ xcoff_link_add_symbols (abfd, info) merging symbols. */ *sym_hash = ((struct xcoff_link_hash_entry *) bfd_wrapped_link_hash_lookup (abfd, info, name, - true, true, - false)); + TRUE, TRUE, + FALSE)); } if (*sym_hash == NULL) goto error_return; @@ -1801,11 +1802,11 @@ xcoff_link_add_symbols (abfd, info) & DYNAMIC) == 0)) { /* The new symbol is from a shared library, and - either the existing symbol is not global - linkage code or this symbol is global linkage - code. If the existing symbol is global - linkage code and the new symbol is not, then - we want to use the new symbol. */ + either the existing symbol is not global + linkage code or this symbol is global linkage + code. If the existing symbol is global + linkage code and the new symbol is not, then + we want to use the new symbol. */ section = bfd_und_section_ptr; value = 0; } @@ -1813,7 +1814,7 @@ xcoff_link_add_symbols (abfd, info) & DYNAMIC) != 0) { /* The existing symbol is from a shared library. - Replace it. */ + Replace it. */ (*sym_hash)->root.type = bfd_link_hash_undefined; (*sym_hash)->root.u.undef.abfd = (*sym_hash)->root.u.def.section->owner; @@ -1821,24 +1822,24 @@ xcoff_link_add_symbols (abfd, info) else if (abfd->my_archive != NULL) { /* This is a redefinition in an object contained - in an archive. Just ignore it. See the - comment above. */ + in an archive. Just ignore it. See the + comment above. */ section = bfd_und_section_ptr; value = 0; } - else if ((*sym_hash)->root.next != NULL + else if ((*sym_hash)->root.und_next != NULL || info->hash->undefs_tail == &(*sym_hash)->root) { /* This symbol has been referenced. In this - case, we just continue and permit the - multiple definition error. See the comment - above about the behaviour of the AIX linker. */ + case, we just continue and permit the + multiple definition error. See the comment + above about the behaviour of the AIX linker. */ } else if ((*sym_hash)->smclas == aux.x_csect.x_smclas) { /* The symbols are both csects of the same - class. There is at least a chance that this - is a semi-legitimate redefinition. */ + class. There is at least a chance that this + is a semi-legitimate redefinition. */ section = bfd_und_section_ptr; value = 0; (*sym_hash)->flags |= XCOFF_MULTIPLY_DEFINED; @@ -1883,7 +1884,7 @@ xcoff_link_add_symbols (abfd, info) last_real->next = NULL; if (! (_bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, - (const char *) NULL, copy, true, + (const char *) NULL, copy, TRUE, (struct bfd_link_hash_entry **) sym_hash))) goto error_return; last_real->next = first_csect; @@ -1974,14 +1975,14 @@ xcoff_link_add_symbols (abfd, info) h = obj_xcoff_sym_hashes (abfd)[rel->r_symndx]; h->flags |= XCOFF_CALLED; /* If the symbol name starts with a period, it is - the code of a function. If the symbol is - currently undefined, then add an undefined symbol - for the function descriptor. This should do no - harm, because any regular object that defines the - function should also define the function - descriptor. It helps, because it means that we - will identify the function descriptor with a - dynamic object if a dynamic object defines it. */ + the code of a function. If the symbol is + currently undefined, then add an undefined symbol + for the function descriptor. This should do no + harm, because any regular object that defines the + function should also define the function + descriptor. It helps, because it means that we + will identify the function descriptor with a + dynamic object if a dynamic object defines it. */ if (h->root.root.string[0] == '.' && h->descriptor == NULL) { @@ -1990,7 +1991,7 @@ xcoff_link_add_symbols (abfd, info) hds = xcoff_link_hash_lookup (xcoff_hash_table (info), h->root.root.string + 1, - true, false, true); + TRUE, FALSE, TRUE); if (hds == NULL) goto error_return; if (hds->root.type == bfd_link_hash_new) @@ -1999,8 +2000,8 @@ xcoff_link_add_symbols (abfd, info) if (! (_bfd_generic_link_add_one_symbol (info, abfd, hds->root.root.string, (flagword) 0, bfd_und_section_ptr, - (bfd_vma) 0, (const char *) NULL, false, - true, &bh))) + (bfd_vma) 0, (const char *) NULL, FALSE, + TRUE, &bh))) goto error_return; hds = (struct xcoff_link_hash_entry *) bh; } @@ -2033,7 +2034,7 @@ xcoff_link_add_symbols (abfd, info) } /* Free up the line numbers. FIXME: We could cache these - somewhere for the final link, to avoid reading them again. */ + somewhere for the final link, to avoid reading them again. */ if (reloc_info[o->target_index].linenos != NULL) { free (reloc_info[o->target_index].linenos); @@ -2045,7 +2046,7 @@ xcoff_link_add_symbols (abfd, info) obj_coff_keep_syms (abfd) = keep_syms; - return true; + return TRUE; error_return: if (reloc_info != NULL) @@ -2060,7 +2061,7 @@ xcoff_link_add_symbols (abfd, info) free (reloc_info); } obj_coff_keep_syms (abfd) = keep_syms; - return false; + return FALSE; } #undef N_TMASK @@ -2069,7 +2070,7 @@ xcoff_link_add_symbols (abfd, info) /* This function is used to add symbols from a dynamic object to the global symbol table. */ -static boolean +static bfd_boolean xcoff_link_add_dynamic_symbols (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -2094,7 +2095,7 @@ xcoff_link_add_dynamic_symbols (abfd, info) (_("%s: XCOFF shared object when not producing XCOFF output"), bfd_get_filename (abfd)); bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } /* The symbols we use from a dynamic object are not the symbols in @@ -2115,12 +2116,12 @@ xcoff_link_add_dynamic_symbols (abfd, info) (_("%s: dynamic object with no .loader section"), bfd_get_filename (abfd)); bfd_set_error (bfd_error_no_symbols); - return false; + return FALSE; } if (! xcoff_get_section_contents (abfd, lsec)) - return false; + return FALSE; contents = coff_section_data (abfd, lsec)->contents; /* Remove the sections from this object, so that they do not get @@ -2162,10 +2163,10 @@ xcoff_link_add_dynamic_symbols (abfd, info) table. However, we verified above that we are using an XCOFF hash table. */ - h = xcoff_link_hash_lookup (xcoff_hash_table (info), name, true, - true, true); + h = xcoff_link_hash_lookup (xcoff_hash_table (info), name, TRUE, + TRUE, TRUE); if (h == NULL) - return false; + return FALSE; h->flags |= XCOFF_DEF_DYNAMIC; @@ -2191,9 +2192,9 @@ xcoff_link_add_dynamic_symbols (abfd, info) h->smclas = ldsym.l_smclas; /* Unless this is an XMC_XO symbol, we don't bother to actually - define it, since we don't have a section to put it in anyhow. - Instead, the relocation routines handle the DEF_DYNAMIC flag - correctly. */ + define it, since we don't have a section to put it in anyhow. + Instead, the relocation routines handle the DEF_DYNAMIC flag + correctly. */ if (h->smclas == XMC_XO && (h->root.type == bfd_link_hash_undefined @@ -2221,21 +2222,21 @@ xcoff_link_add_dynamic_symbols (abfd, info) dsnm = bfd_malloc ((bfd_size_type) strlen (name) + 2); if (dsnm == NULL) - return false; + return FALSE; dsnm[0] = '.'; strcpy (dsnm + 1, name); hds = xcoff_link_hash_lookup (xcoff_hash_table (info), dsnm, - true, true, true); + TRUE, TRUE, TRUE); free (dsnm); if (hds == NULL) - return false; + return FALSE; if (hds->root.type == bfd_link_hash_new) { hds->root.type = bfd_link_hash_undefined; hds->root.u.undef.abfd = abfd; /* We do not want to add this to the undefined - symbol list. */ + symbol list. */ } hds->descriptor = h; @@ -2272,7 +2273,7 @@ xcoff_link_add_dynamic_symbols (abfd, info) n = ((struct xcoff_import_file *) bfd_alloc (abfd, (bfd_size_type) sizeof (struct xcoff_import_file))); if (n == NULL) - return false; + return FALSE; n->next = NULL; /* For some reason, the path entry in the import file list for a @@ -2305,7 +2306,7 @@ xcoff_link_add_dynamic_symbols (abfd, info) xcoff_data (abfd)->import_file_id = c; - return true; + return TRUE; } /* Routines that are called after all the input files have been @@ -2314,14 +2315,14 @@ xcoff_link_add_dynamic_symbols (abfd, info) /* Mark a symbol as not being garbage, including the section in which it is defined. */ -static INLINE boolean +static INLINE bfd_boolean xcoff_mark_symbol (info, h) struct bfd_link_info *info; struct xcoff_link_hash_entry *h; { if ((h->flags & XCOFF_MARK) != 0) - return true; + return TRUE; h->flags |= XCOFF_MARK; if (h->root.type == bfd_link_hash_defined @@ -2334,7 +2335,7 @@ xcoff_mark_symbol (info, h) && (hsec->flags & SEC_MARK) == 0) { if (! xcoff_mark (info, hsec)) - return false; + return FALSE; } } @@ -2342,10 +2343,10 @@ xcoff_mark_symbol (info, h) && (h->toc_section->flags & SEC_MARK) == 0) { if (! xcoff_mark (info, h->toc_section)) - return false; + return FALSE; } - return true; + return TRUE; } /* The mark phase of garbage collection. For a given section, mark @@ -2354,14 +2355,14 @@ xcoff_mark_symbol (info, h) the number of relocs which need to be copied into the .loader section. */ -static boolean +static bfd_boolean xcoff_mark (info, sec) struct bfd_link_info *info; asection *sec; { if (bfd_is_abs_section (sec) || (sec->flags & SEC_MARK) != 0) - return true; + return TRUE; sec->flags |= SEC_MARK; @@ -2387,7 +2388,7 @@ xcoff_mark (info, sec) && (h->flags & XCOFF_MARK) == 0) { if (! xcoff_mark_symbol (info, h)) - return false; + return FALSE; } } @@ -2396,11 +2397,11 @@ xcoff_mark (info, sec) if ((sec->flags & SEC_RELOC) != 0 && sec->reloc_count > 0) { - rel = xcoff_read_internal_relocs (sec->owner, sec, true, - (bfd_byte *) NULL, false, + rel = xcoff_read_internal_relocs (sec->owner, sec, TRUE, + (bfd_byte *) NULL, FALSE, (struct internal_reloc *) NULL); if (rel == NULL) - return false; + return FALSE; relend = rel + sec->reloc_count; for (; rel < relend; rel++) { @@ -2416,7 +2417,7 @@ xcoff_mark (info, sec) && (h->flags & XCOFF_MARK) == 0) { if (! xcoff_mark_symbol (info, h)) - return false; + return FALSE; } rsec = xcoff_data (sec->owner)->csects[rel->r_symndx]; @@ -2424,11 +2425,11 @@ xcoff_mark (info, sec) && (rsec->flags & SEC_MARK) == 0) { if (! xcoff_mark (info, rsec)) - return false; + return FALSE; } /* See if this reloc needs to be copied into the .loader - section. */ + section. */ switch (rel->r_type) { default: @@ -2477,7 +2478,7 @@ xcoff_mark (info, sec) } } - return true; + return TRUE; } /* The sweep phase of garbage collection. Remove all garbage @@ -2498,8 +2499,8 @@ xcoff_sweep (info) if ((o->flags & SEC_MARK) == 0) { /* Keep all sections from non-XCOFF input files. Keep - special sections. Keep .debug sections for the - moment. */ + special sections. Keep .debug sections for the + moment. */ if (sub->xvec != info->hash->creator || o == xcoff_hash_table (info)->debug_section || o == xcoff_hash_table (info)->loader_section @@ -2522,7 +2523,7 @@ xcoff_sweep (info) /* Record the number of elements in a set. This is used to output the correct csect length. */ -boolean +bfd_boolean bfd_xcoff_link_record_set (output_bfd, info, harg, size) bfd *output_bfd; struct bfd_link_info *info; @@ -2534,7 +2535,7 @@ bfd_xcoff_link_record_set (output_bfd, info, harg, size) bfd_size_type amt; if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) - return true; + return TRUE; /* This will hardly ever be called. I don't want to burn four bytes per global symbol, so instead the size is kept on a linked list @@ -2543,7 +2544,7 @@ bfd_xcoff_link_record_set (output_bfd, info, harg, size) amt = sizeof (struct xcoff_link_size_list); n = (struct xcoff_link_size_list *) bfd_alloc (output_bfd, amt); if (n == NULL) - return false; + return FALSE; n->next = xcoff_hash_table (info)->size_list; n->h = h; n->size = size; @@ -2551,12 +2552,12 @@ bfd_xcoff_link_record_set (output_bfd, info, harg, size) h->flags |= XCOFF_HAS_SIZE; - return true; + return TRUE; } /* Import a symbol. */ -boolean +bfd_boolean bfd_xcoff_import_symbol (output_bfd, info, harg, val, imppath, impfile, impmember, syscall_flag) bfd *output_bfd; @@ -2571,7 +2572,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 (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) - return true; + return TRUE; /* A symbol name which starts with a period is the code for a function. If the symbol is undefined, then add an undefined @@ -2587,9 +2588,9 @@ bfd_xcoff_import_symbol (output_bfd, info, harg, val, imppath, impfile, { hds = xcoff_link_hash_lookup (xcoff_hash_table (info), h->root.root.string + 1, - true, false, true); + TRUE, FALSE, TRUE); if (hds == NULL) - return false; + return FALSE; if (hds->root.type == bfd_link_hash_new) { hds->root.type = bfd_link_hash_undefined; @@ -2603,8 +2604,8 @@ bfd_xcoff_import_symbol (output_bfd, info, harg, val, imppath, impfile, } /* Now, if the descriptor is undefined, import the descriptor - rather than the symbol we were told to import. FIXME: Is - this correct in all cases? */ + rather than the symbol we were told to import. FIXME: Is + this correct in all cases? */ if (hds->root.type == bfd_link_hash_undefined) h = hds; } @@ -2621,7 +2622,7 @@ bfd_xcoff_import_symbol (output_bfd, info, harg, val, imppath, impfile, (info, h->root.root.string, h->root.u.def.section->owner, h->root.u.def.section, h->root.u.def.value, output_bfd, bfd_abs_section_ptr, val))) - return false; + return FALSE; } h->root.type = bfd_link_hash_defined; @@ -2641,7 +2642,7 @@ bfd_xcoff_import_symbol (output_bfd, info, harg, val, imppath, impfile, struct xcoff_import_file **pp; /* We start c at 1 because the first entry in the import list is - reserved for the library search path. */ + reserved for the library search path. */ for (pp = &xcoff_hash_table (info)->imports, c = 1; *pp != NULL; pp = &(*pp)->next, ++c) @@ -2659,7 +2660,7 @@ bfd_xcoff_import_symbol (output_bfd, info, harg, val, imppath, impfile, n = (struct xcoff_import_file *) bfd_alloc (output_bfd, amt); if (n == NULL) - return false; + return FALSE; n->next = NULL; n->path = imppath; n->file = impfile; @@ -2670,12 +2671,12 @@ bfd_xcoff_import_symbol (output_bfd, info, harg, val, imppath, impfile, h->ldindx = c; } - return true; + return TRUE; } /* Export a symbol. */ -boolean +bfd_boolean bfd_xcoff_export_symbol (output_bfd, info, harg) bfd *output_bfd; struct bfd_link_info *info; @@ -2684,7 +2685,7 @@ bfd_xcoff_export_symbol (output_bfd, info, harg) struct xcoff_link_hash_entry *h = (struct xcoff_link_hash_entry *) harg; if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) - return true; + return TRUE; h->flags |= XCOFF_EXPORT; @@ -2702,11 +2703,11 @@ bfd_xcoff_export_symbol (output_bfd, info, harg) fnname = (char *) bfd_malloc (amt); if (fnname == NULL) - return false; + return FALSE; fnname[0] = '.'; strcpy (fnname + 1, h->root.root.string); hfn = xcoff_link_hash_lookup (xcoff_hash_table (info), - fnname, false, false, true); + fnname, FALSE, FALSE, TRUE); free (fnname); if (hfn != NULL && hfn->smclas == XMC_PR @@ -2721,7 +2722,7 @@ bfd_xcoff_export_symbol (output_bfd, info, harg) /* Make sure we don't garbage collect this symbol. */ if (! xcoff_mark_symbol (info, h)) - return false; + return FALSE; /* If this is a function descriptor, make sure we don't garbage collect the associated function code. We normally don't have to @@ -2731,17 +2732,17 @@ bfd_xcoff_export_symbol (output_bfd, info, harg) if ((h->flags & XCOFF_DESCRIPTOR) != 0) { if (! xcoff_mark_symbol (info, h->descriptor)) - return false; + return FALSE; } - return true; + return TRUE; } /* Count a reloc against a symbol. This is called for relocs generated by the linker script, typically for global constructors and destructors. */ -boolean +bfd_boolean bfd_xcoff_link_count_reloc (output_bfd, info, name) bfd *output_bfd; struct bfd_link_info *info; @@ -2750,16 +2751,16 @@ bfd_xcoff_link_count_reloc (output_bfd, info, name) struct xcoff_link_hash_entry *h; if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) - return true; + return TRUE; h = ((struct xcoff_link_hash_entry *) - bfd_wrapped_link_hash_lookup (output_bfd, info, name, false, false, - false)); + bfd_wrapped_link_hash_lookup (output_bfd, info, name, FALSE, FALSE, + FALSE)); if (h == NULL) { (*_bfd_error_handler) (_("%s: no such symbol"), name); bfd_set_error (bfd_error_no_symbols); - return false; + return FALSE; } h->flags |= XCOFF_REF_REGULAR | XCOFF_LDREL; @@ -2767,15 +2768,15 @@ bfd_xcoff_link_count_reloc (output_bfd, info, name) /* Mark the symbol to avoid garbage collection. */ if (! xcoff_mark_symbol (info, h)) - return false; + return FALSE; - return true; + return TRUE; } /* This function is called for each symbol to which the linker script assigns a value. */ -boolean +bfd_boolean bfd_xcoff_record_link_assignment (output_bfd, info, name) bfd *output_bfd; struct bfd_link_info *info; @@ -2784,16 +2785,16 @@ bfd_xcoff_record_link_assignment (output_bfd, info, name) struct xcoff_link_hash_entry *h; if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) - return true; + return TRUE; - h = xcoff_link_hash_lookup (xcoff_hash_table (info), name, true, true, - false); + h = xcoff_link_hash_lookup (xcoff_hash_table (info), name, TRUE, TRUE, + FALSE); if (h == NULL) - return false; + return FALSE; h->flags |= XCOFF_DEF_REGULAR; - return true; + return TRUE; } /* Build the .loader section. This is called by the XCOFF linker @@ -2813,7 +2814,7 @@ bfd_xcoff_record_link_assignment (output_bfd, info, name) option). SPECIAL_SECTIONS is set by this routine to csects with magic names like _end. */ -boolean +bfd_boolean bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, file_align, maxstack, maxdata, gc, modtype, textro, export_defineds, @@ -2825,12 +2826,12 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, unsigned long file_align; unsigned long maxstack; unsigned long maxdata; - boolean gc; + bfd_boolean gc; int modtype; - boolean textro; - boolean export_defineds; + bfd_boolean textro; + bfd_boolean export_defineds; asection **special_sections; - boolean rtld; + bfd_boolean rtld; { struct xcoff_link_hash_entry *hentry; asection *lsec; @@ -2851,10 +2852,10 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, { for (i = 0; i < XCOFF_NUMBER_OF_SPECIAL_SECTIONS; i++) special_sections[i] = NULL; - return true; + return TRUE; } - ldinfo.failed = false; + ldinfo.failed = FALSE; ldinfo.output_bfd = output_bfd; ldinfo.info = info; ldinfo.export_defineds = export_defineds; @@ -2874,56 +2875,55 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, if (entry != NULL) { hentry = xcoff_link_hash_lookup (xcoff_hash_table (info), entry, - false, false, true); + FALSE, FALSE, TRUE); if (hentry != NULL) hentry->flags |= XCOFF_ENTRY; } /* __rtinit */ - if (info->init_function || info->fini_function || rtld) + if (info->init_function || info->fini_function || rtld) { struct xcoff_link_hash_entry *hsym; struct internal_ldsym *ldsym; - + hsym = xcoff_link_hash_lookup (xcoff_hash_table (info), - "__rtinit", false, false, true); + "__rtinit", FALSE, FALSE, TRUE); if (hsym == NULL) { (*_bfd_error_handler) (_("error: undefined symbol __rtinit")); - return false; + return FALSE; } - + xcoff_mark_symbol (info, hsym); hsym->flags |= (XCOFF_DEF_REGULAR | XCOFF_RTINIT); - /* __rtinit initalized */ + /* __rtinit initialized */ amt = sizeof (struct internal_ldsym); ldsym = (struct internal_ldsym *) bfd_malloc (amt); - - ldsym->l_value = 0; /* will be filled in later */ - ldsym->l_scnum = 2; /* data section */ - ldsym->l_smtype = XTY_SD; /* csect section definition */ - ldsym->l_smclas = 5; /* .rw */ - ldsym->l_ifile = 0; /* special system loader symbol */ - ldsym->l_parm = 0; /* NA */ - + + ldsym->l_value = 0; /* will be filled in later */ + ldsym->l_scnum = 2; /* data section */ + ldsym->l_smtype = XTY_SD; /* csect section definition */ + ldsym->l_smclas = 5; /* .rw */ + ldsym->l_ifile = 0; /* special system loader symbol */ + ldsym->l_parm = 0; /* NA */ + /* Force __rtinit to be the first symbol in the loader symbol table See xcoff_build_ldsyms - + The first 3 symbol table indices are reserved to indicate the data, text and bss sections. */ BFD_ASSERT (0 == ldinfo.ldsym_count); - + hsym->ldindx = 3; ldinfo.ldsym_count = 1; hsym->ldsym = ldsym; - - if (false == bfd_xcoff_put_ldsymbol_name (ldinfo.output_bfd, &ldinfo, - hsym->ldsym, - hsym->root.root.string)) - return false; - + + if (! bfd_xcoff_put_ldsymbol_name (ldinfo.output_bfd, &ldinfo, + hsym->ldsym, hsym->root.root.string)) + return FALSE; + /* This symbol is written out by xcoff_write_global_symbol Set stuff up so xcoff_write_global_symbol logic works. */ hsym->flags |= XCOFF_DEF_REGULAR | XCOFF_MARK; @@ -2932,17 +2932,17 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, } /* Garbage collect unused sections. */ - if (info->relocateable + if (info->relocatable || ! gc || hentry == NULL || (hentry->root.type != bfd_link_hash_defined && hentry->root.type != bfd_link_hash_defweak)) { - gc = false; - xcoff_hash_table (info)->gc = false; + gc = FALSE; + xcoff_hash_table (info)->gc = FALSE; /* We still need to call xcoff_mark, in order to set ldrel_count - correctly. */ + correctly. */ for (sub = info->input_bfds; sub != NULL; sub = sub->link_next) { asection *o; @@ -2962,7 +2962,7 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, if (! xcoff_mark (info, hentry->root.u.def.section)) goto error_return; xcoff_sweep (info); - xcoff_hash_table (info)->gc = true; + xcoff_hash_table (info)->gc = TRUE; } /* Return special sections to the caller. */ @@ -2982,7 +2982,7 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, if (info->input_bfds == NULL) { /* I'm not sure what to do in this bizarre case. */ - return true; + return TRUE; } xcoff_link_hash_traverse (xcoff_hash_table (info), xcoff_build_ldsyms, @@ -3158,7 +3158,7 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, csectpp = xcoff_data (sub)->csects; /* Dynamic object do not have csectpp's. */ - if (NULL != csectpp) + if (NULL != csectpp) { symesz = bfd_coff_symesz (sub); esym = (bfd_byte *) obj_coff_external_syms (sub); @@ -3183,7 +3183,7 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, bfd_size_type indx; name = (char *) debug_contents + sym._n._n_n._n_offset; - indx = _bfd_stringtab_add (debug_strtab, name, true, true); + indx = _bfd_stringtab_add (debug_strtab, name, TRUE, TRUE); if (indx == (bfd_size_type) -1) goto error_return; *debug_index = indx; @@ -3213,29 +3213,29 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, xcoff_hash_table (info)->debug_section->_raw_size = _bfd_stringtab_size (debug_strtab); - return true; + return TRUE; error_return: if (ldinfo.strings != NULL) free (ldinfo.strings); if (debug_contents != NULL) free (debug_contents); - return false; + return FALSE; } -boolean +bfd_boolean bfd_xcoff_link_generate_rtinit (abfd, init, fini, rtld) bfd *abfd; const char *init; const char *fini; - boolean rtld; + bfd_boolean rtld; { struct bfd_in_memory *bim; - + bim = ((struct bfd_in_memory *) bfd_malloc ((bfd_size_type) sizeof (struct bfd_in_memory))); if (bim == NULL) - return false; + return FALSE; bim->size = 0; bim->buffer = 0; @@ -3247,21 +3247,21 @@ bfd_xcoff_link_generate_rtinit (abfd, init, fini, rtld) abfd->direction = write_direction; abfd->where = 0; - if (false == bfd_xcoff_generate_rtinit (abfd, init, fini, rtld)) - return false; + if (! bfd_xcoff_generate_rtinit (abfd, init, fini, rtld)) + return FALSE; /* need to reset to unknown or it will not be read back in correctly */ abfd->format = bfd_unknown; abfd->direction = read_direction; abfd->where = 0; - return true; + return TRUE; } /* Add a symbol to the .loader symbols, if necessary. */ -static boolean +static bfd_boolean xcoff_build_ldsyms (h, p) struct xcoff_link_hash_entry *h; PTR p; @@ -3274,7 +3274,7 @@ xcoff_build_ldsyms (h, p) /* __rtinit, this symbol has special handling. */ if (h->flags & XCOFF_RTINIT) - return true; + return TRUE; /* If this is a final link, and the symbol was defined as a common symbol in a regular object file, and there was no definition in @@ -3296,7 +3296,7 @@ xcoff_build_ldsyms (h, p) && (h->flags & XCOFF_DEF_REGULAR) != 0 && h->root.root.string[0] != '.') { - boolean export; + bfd_boolean export; /* We don't export a symbol which is being defined by an object included from an archive which contains a shared object. The @@ -3312,7 +3312,7 @@ xcoff_build_ldsyms (h, p) them. This is confusing, but I haven't been able to think of a different approach. Note that the symbols can, of course, be exported explicitly. */ - export = true; + export = TRUE; if ((h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) && h->root.u.def.section->owner != NULL @@ -3326,7 +3326,7 @@ xcoff_build_ldsyms (h, p) { if ((member->flags & DYNAMIC) != 0) { - export = false; + export = FALSE; break; } member = bfd_openr_next_archived_file (arbfd, member); @@ -3375,7 +3375,7 @@ xcoff_build_ldsyms (h, p) sec->_raw_size += bfd_xcoff_glink_code_size(ldinfo->output_bfd); /* The global linkage code requires a TOC entry for the - descriptor. */ + descriptor. */ hds = h->descriptor; BFD_ASSERT ((hds->root.type == bfd_link_hash_undefined || hds->root.type == bfd_link_hash_undefweak) @@ -3393,7 +3393,7 @@ xcoff_build_ldsyms (h, p) else if (bfd_xcoff_is_xcoff32 (ldinfo->output_bfd)) byte_size = 4; else - return false; + return FALSE; hds->toc_section = xcoff_hash_table (ldinfo->info)->toc_section; hds->u.toc_offset = hds->toc_section->_raw_size; @@ -3425,10 +3425,10 @@ xcoff_build_ldsyms (h, p) asection *sec; /* This is an undefined function descriptor associated with - a defined entry point. We can build up a function - descriptor ourselves. Believe it or not, the AIX linker - actually does this, and there are cases where we need to - do it as well. */ + a defined entry point. We can build up a function + descriptor ourselves. Believe it or not, the AIX linker + actually does this, and there are cases where we need to + do it as well. */ sec = xcoff_hash_table (ldinfo->info)->descriptor_section; h->root.type = bfd_link_hash_defined; h->root.u.def.section = sec; @@ -3455,7 +3455,7 @@ xcoff_build_ldsyms (h, p) (_("warning: attempt to export undefined symbol `%s'"), h->root.root.string); h->ldsym = NULL; - return true; + return TRUE; } } @@ -3484,7 +3484,7 @@ xcoff_build_ldsyms (h, p) && (h->flags & XCOFF_EXPORT) == 0) { h->ldsym = NULL; - return true; + return TRUE; } /* We don't need to add this symbol if we did garbage collection and @@ -3493,13 +3493,13 @@ xcoff_build_ldsyms (h, p) && (h->flags & XCOFF_MARK) == 0) { h->ldsym = NULL; - return true; + return TRUE; } /* We may have already processed this symbol due to the recursive call above. */ if ((h->flags & XCOFF_BUILT_LDSYM) != 0) - return true; + return TRUE; /* We need to add this symbol to the .loader symbols. */ @@ -3508,8 +3508,8 @@ xcoff_build_ldsyms (h, p) h->ldsym = (struct internal_ldsym *) bfd_zalloc (ldinfo->output_bfd, amt); if (h->ldsym == NULL) { - ldinfo->failed = true; - return false; + ldinfo->failed = TRUE; + return FALSE; } if ((h->flags & XCOFF_IMPORT) != 0) @@ -3521,21 +3521,20 @@ xcoff_build_ldsyms (h, p) ++ldinfo->ldsym_count; - if (false == bfd_xcoff_put_ldsymbol_name (ldinfo->output_bfd, ldinfo, - h->ldsym, - h->root.root.string)) + if (! bfd_xcoff_put_ldsymbol_name (ldinfo->output_bfd, ldinfo, + h->ldsym, h->root.root.string)) { - return false; + return FALSE; } h->flags |= XCOFF_BUILT_LDSYM; - return true; + return TRUE; } /* Do the final link step. */ -boolean +bfd_boolean _bfd_xcoff_bfd_final_link (abfd, info) bfd *abfd; struct bfd_link_info *info; @@ -3611,7 +3610,7 @@ _bfd_xcoff_bfd_final_link (abfd, info) link. This will normally be every section. We need to do this so that we can identify any sections which the linker has decided to not include. */ - sec->linker_mark = true; + sec->linker_mark = TRUE; if (info->strip == strip_none || info->strip == strip_some) @@ -3651,49 +3650,49 @@ _bfd_xcoff_bfd_final_link (abfd, info) file_align = xcoff_hash_table (info)->file_align; if (file_align != 0) { - boolean saw_contents; + bfd_boolean saw_contents; int indx; asection **op; file_ptr sofar; - + /* Insert .pad sections before every section which has - contents and is loaded, if it is preceded by some other - section which has contents and is loaded. */ - saw_contents = true; + contents and is loaded, if it is preceded by some other + section which has contents and is loaded. */ + saw_contents = TRUE; for (op = &abfd->sections; *op != NULL; op = &(*op)->next) { if (strcmp ((*op)->name, ".pad") == 0) - saw_contents = false; + saw_contents = FALSE; else if (((*op)->flags & SEC_HAS_CONTENTS) != 0 && ((*op)->flags & SEC_LOAD) != 0) { if (! saw_contents) - saw_contents = true; + saw_contents = TRUE; else { asection *n, **st; - + /* Create a pad section and place it before the section - that needs padding. This requires unlinking and + that needs padding. This requires unlinking and relinking the bfd's section list. */ - + st = abfd->section_tail; n = bfd_make_section_anyway (abfd, ".pad"); n->flags = SEC_HAS_CONTENTS; - n->alignment_power = 0; + n->alignment_power = 0; BFD_ASSERT (*st == n); bfd_section_list_remove (abfd, st); bfd_section_list_insert (abfd, op, n); op = &n->next; - saw_contents = false; + saw_contents = FALSE; } } } - + /* Reset the section indices after inserting the new - sections. */ + sections. */ indx = 0; for (o = abfd->sections; o != NULL; o = o->next) { @@ -3703,9 +3702,9 @@ _bfd_xcoff_bfd_final_link (abfd, info) BFD_ASSERT ((unsigned int) indx == abfd->section_count); /* Work out appropriate sizes for the .pad sections to force - each section to land on a page boundary. This bit of - code knows what compute_section_file_positions is going - to do. */ + each section to land on a page boundary. This bit of + code knows what compute_section_file_positions is going + to do. */ sofar = bfd_coff_filhsz (abfd); sofar += bfd_coff_aoutsz (abfd); sofar += abfd->section_count * bfd_coff_scnhsz (abfd); @@ -3775,8 +3774,8 @@ _bfd_xcoff_bfd_final_link (abfd, info) else { /* A stripped file has no relocs. However, we still - allocate the buffers, so that later code doesn't have to - worry about whether we are stripping or not. */ + allocate the buffers, so that later code doesn't have to + worry about whether we are stripping or not. */ if (info->strip == strip_all) o->rel_filepos = 0; else @@ -3787,13 +3786,13 @@ _bfd_xcoff_bfd_final_link (abfd, info) } /* We don't know the indices of global symbols until we have - written out all the local symbols. For each section in - the output file, we keep an array of pointers to hash - table entries. Each entry in the array corresponds to a - reloc. When we find a reloc against a global symbol, we - set the corresponding entry in this array so that we can - fix up the symbol index after we have written out all the - local symbols. + written out all the local symbols. For each section in + the output file, we keep an array of pointers to hash + table entries. Each entry in the array corresponds to a + reloc. When we find a reloc against a global symbol, we + set the corresponding entry in this array so that we can + fix up the symbol index after we have written out all the + local symbols. Because of this problem, we also keep the relocs in memory until the end of the link. This wastes memory. @@ -3850,7 +3849,7 @@ _bfd_xcoff_bfd_final_link (abfd, info) { bfd_size_type sz; - sub->output_has_begun = false; + sub->output_has_begun = FALSE; sz = obj_raw_syment_count (sub); if (sz > max_sym_count) max_sym_count = sz; @@ -3903,7 +3902,7 @@ _bfd_xcoff_bfd_final_link (abfd, info) { if (! xcoff_link_input_bfd (&finfo, sub)) goto error_return; - sub->output_has_begun = true; + sub->output_has_begun = TRUE; } } else if (p->type == bfd_section_reloc_link_order @@ -4142,7 +4141,7 @@ _bfd_xcoff_bfd_final_link (abfd, info) not try to write out the symbols. */ bfd_get_symcount (abfd) = 0; - return true; + return TRUE; error_return: if (finfo.strtab != NULL) @@ -4176,13 +4175,13 @@ _bfd_xcoff_bfd_final_link (abfd, info) free (finfo.external_relocs); if (external_relocs != NULL) free (external_relocs); - return false; + return FALSE; } /* Link an input file into the linker output file. This function handles all the sections and relocations of the input file at once. */ -static boolean +static bfd_boolean xcoff_link_input_bfd (finfo, input_bfd) struct xcoff_final_link_info *finfo; bfd *input_bfd; @@ -4192,7 +4191,7 @@ xcoff_link_input_bfd (finfo, input_bfd) bfd_size_type syment_base; unsigned int n_tmask; unsigned int n_btshft; - boolean copy, hash; + bfd_boolean copy, hash; bfd_size_type isymesz; bfd_size_type osymesz; bfd_size_type linesz; @@ -4207,13 +4206,13 @@ xcoff_link_input_bfd (finfo, input_bfd) bfd_byte *outsym; unsigned int incls; asection *oline; - boolean keep_syms; + bfd_boolean keep_syms; asection *o; /* We can just skip DYNAMIC files, unless this is a static link. */ if ((input_bfd->flags & DYNAMIC) != 0 && ! finfo->info->static_link) - return true; + return TRUE; /* Move all the symbols to the output file. */ @@ -4232,15 +4231,15 @@ xcoff_link_input_bfd (finfo, input_bfd) #define N_TMASK n_tmask #define N_BTSHFT n_btshft - copy = false; + copy = FALSE; if (! finfo->info->keep_memory) - copy = true; - hash = true; + copy = TRUE; + hash = TRUE; if ((output_bfd->flags & BFD_TRADITIONAL_FORMAT) != 0) - hash = false; + hash = FALSE; if (! _bfd_coff_get_external_symbols (input_bfd)) - return false; + return FALSE; esym = (bfd_byte *) obj_coff_external_syms (input_bfd); esym_end = esym + obj_raw_syment_count (input_bfd) * isymesz; @@ -4260,14 +4259,14 @@ xcoff_link_input_bfd (finfo, input_bfd) struct internal_syment isym; union internal_auxent aux; int smtyp = 0; - boolean skip; - boolean require; + bfd_boolean skip; + bfd_boolean require; int add; bfd_coff_swap_sym_in (input_bfd, (PTR) esym, (PTR) isymp); /* If this is a C_EXT or C_HIDEXT symbol, we need the csect - information. */ + information. */ if (isymp->n_sclass == C_EXT || isymp->n_sclass == C_HIDEXT) { BFD_ASSERT (isymp->n_numaux > 0); @@ -4287,9 +4286,9 @@ xcoff_link_input_bfd (finfo, input_bfd) isym = *isymp; /* If this symbol is in the .loader section, swap out the - .loader symbol information. If this is an external symbol - reference to a defined symbol, though, then wait until we get - to the definition. */ + .loader symbol information. If this is an external symbol + reference to a defined symbol, though, then wait until we get + to the definition. */ if (isym.n_sclass == C_EXT && *sym_hash != NULL && (*sym_hash)->ldsym != NULL @@ -4379,26 +4378,26 @@ xcoff_link_input_bfd (finfo, input_bfd) *indexp = -1; - skip = false; - require = false; + skip = FALSE; + require = FALSE; add = 1 + isym.n_numaux; /* If we are skipping this csect, we want to skip this symbol. */ if (*csectpp == NULL) - skip = true; + skip = TRUE; /* If we garbage collected this csect, we want to skip this - symbol. */ + symbol. */ if (! skip && xcoff_hash_table (finfo->info)->gc && ((*csectpp)->flags & SEC_MARK) == 0 && *csectpp != bfd_abs_section_ptr) - skip = true; + skip = TRUE; /* An XCOFF linker always skips C_STAT symbols. */ if (! skip && isymp->n_sclass == C_STAT) - skip = true; + skip = TRUE; /* We skip all but the first TOC anchor. */ if (! skip @@ -4406,7 +4405,7 @@ xcoff_link_input_bfd (finfo, input_bfd) && aux.x_csect.x_smclas == XMC_TC0) { if (finfo->toc_symindx != -1) - skip = true; + skip = TRUE; else { bfd_vma tocval, tocend; @@ -4418,11 +4417,11 @@ xcoff_link_input_bfd (finfo, input_bfd) - (*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. */ + 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. */ tocend = ((*csectpp)->output_section->vma + (*csectpp)->output_section->_raw_size); for (inp = finfo->info->input_bfds; @@ -4449,7 +4448,7 @@ xcoff_link_input_bfd (finfo, input_bfd) (_("TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling"), (unsigned long) (tocend - tocval)); bfd_set_error (bfd_error_file_too_big); - return false; + return FALSE; } if (tocval + 0x8000 < tocend) @@ -4465,7 +4464,7 @@ xcoff_link_input_bfd (finfo, input_bfd) xcoff_data (finfo->output_bfd)->toc = tocval; xcoff_data (finfo->output_bfd)->sntoc = (*csectpp)->output_section->target_index; - require = true; + require = TRUE; } } @@ -4473,17 +4472,17 @@ xcoff_link_input_bfd (finfo, input_bfd) /* If we are stripping all symbols, we want to skip this one. */ if (! skip && finfo->info->strip == strip_all) - skip = true; + skip = TRUE; /* We can skip resolved external references. */ if (! skip && isym.n_sclass == C_EXT && smtyp == XTY_ER && (*sym_hash)->root.type != bfd_link_hash_undefined) - skip = true; + skip = TRUE; /* We can skip common symbols if they got defined somewhere - else. */ + else. */ if (! skip && isym.n_sclass == C_EXT && smtyp == XTY_CM @@ -4491,7 +4490,7 @@ xcoff_link_input_bfd (finfo, input_bfd) || (*sym_hash)->root.u.c.p->section != *csectpp) && ((*sym_hash)->root.type != bfd_link_hash_defined || (*sym_hash)->root.u.def.section != *csectpp)) - skip = true; + skip = TRUE; /* Skip local symbols if we are discarding them. */ if (! skip @@ -4499,14 +4498,14 @@ xcoff_link_input_bfd (finfo, input_bfd) && isym.n_sclass != C_EXT && (isym.n_sclass != C_HIDEXT || smtyp != XTY_SD)) - skip = true; + skip = TRUE; /* If we stripping debugging symbols, and this is a debugging - symbol, then skip it. */ + symbol, then skip it. */ if (! skip && finfo->info->strip == strip_debugger && isym.n_scnum == N_DEBUG) - skip = true; + skip = TRUE; /* If some symbols are stripped based on the name, work out the name and decide whether to skip this symbol. We don't handle @@ -4524,24 +4523,24 @@ xcoff_link_input_bfd (finfo, input_bfd) name = _bfd_coff_internal_syment_name (input_bfd, &isym, buf); if (name == NULL) - return false; + return FALSE; if ((finfo->info->strip == strip_some - && (bfd_hash_lookup (finfo->info->keep_hash, name, false, - false) == NULL)) + && (bfd_hash_lookup (finfo->info->keep_hash, name, FALSE, + FALSE) == NULL)) || (finfo->info->discard == discard_l && (isym.n_sclass != C_EXT && (isym.n_sclass != C_HIDEXT || smtyp != XTY_SD)) && bfd_is_local_label_name (input_bfd, name))) - skip = true; + skip = TRUE; } /* We can not skip the first TOC anchor. */ if (skip && require && finfo->info->strip != strip_all) - skip = false; + skip = FALSE; /* We now know whether we are to skip this symbol or not. */ if (! skip) @@ -4565,10 +4564,10 @@ xcoff_link_input_bfd (finfo, input_bfd) (char *) NULL); if (name == NULL) - return false; + return FALSE; indx = _bfd_stringtab_add (finfo->strtab, name, hash, copy); if (indx == (bfd_size_type) -1) - return false; + return FALSE; isym._n._n_n._n_offset = STRING_SIZE_SIZE + indx; } } @@ -4622,7 +4621,7 @@ xcoff_link_input_bfd (finfo, input_bfd) if (bfd_seek (output_bfd, pos, SEEK_SET) != 0 || (bfd_bwrite (outsym, osymesz, output_bfd) != osymesz)) - return false; + return FALSE; } } @@ -4631,8 +4630,8 @@ xcoff_link_input_bfd (finfo, input_bfd) } /* The value of a C_BINCL or C_EINCL symbol is a file offset - into the line numbers. We update the symbol values when - we handle the line numbers. */ + into the line numbers. We update the symbol values when + we handle the line numbers. */ if (isym.n_sclass == C_BINCL || isym.n_sclass == C_EINCL) { @@ -4659,8 +4658,8 @@ xcoff_link_input_bfd (finfo, input_bfd) } /* If this is a symbol in the TOC which we may have merged - (class XMC_TC), remember the symbol index of the TOC - symbol. */ + (class XMC_TC), remember the symbol index of the TOC + symbol. */ if (isym.n_sclass == C_HIDEXT && aux.x_csect.x_smclas == XMC_TC && *sym_hash != NULL) @@ -4715,7 +4714,7 @@ xcoff_link_input_bfd (finfo, input_bfd) bfd_vma indx; /* The value of a C_BSTAT symbol is the symbol table - index of the containing csect. */ + index of the containing csect. */ bfd_coff_swap_sym_in (output_bfd, (PTR) outsym, (PTR) &isym); indx = isym.n_value; if (indx < obj_raw_syment_count (input_bfd)) @@ -4760,13 +4759,13 @@ xcoff_link_input_bfd (finfo, input_bfd) { strings = _bfd_coff_read_string_table (input_bfd); if (strings == NULL) - return false; + return FALSE; } filename = strings + aux.x_file.x_n.x_offset; indx = _bfd_stringtab_add (finfo->strtab, filename, hash, copy); if (indx == (bfd_size_type) -1) - return false; + return FALSE; aux.x_file.x_n.x_offset = STRING_SIZE_SIZE + indx; } } @@ -4776,10 +4775,10 @@ xcoff_link_input_bfd (finfo, input_bfd) { /* We don't support type checking. I don't know if - anybody does. */ + anybody does. */ aux.x_csect.x_parmhash = 0; /* I don't think anybody uses these fields, but we'd - better clobber them just in case. */ + better clobber them just in case. */ aux.x_csect.x_stab = 0; aux.x_csect.x_snstab = 0; @@ -4818,9 +4817,9 @@ xcoff_link_input_bfd (finfo, input_bfd) && indx < obj_raw_syment_count (input_bfd)) { /* We look forward through the symbol for - the index of the next symbol we are going - to include. I don't know if this is - entirely right. */ + the index of the next symbol we are going + to include. I don't know if this is + entirely right. */ while (finfo->sym_indices[indx] < 0 && indx < obj_raw_syment_count (input_bfd)) ++indx; @@ -4877,7 +4876,7 @@ xcoff_link_input_bfd (finfo, input_bfd) if (bfd_seek (input_bfd, pos, SEEK_SET) != 0 || (bfd_bread (finfo->linenos, amt, input_bfd) != amt)) - return false; + return FALSE; oline = enclosing; } @@ -4937,7 +4936,7 @@ xcoff_link_input_bfd (finfo, input_bfd) || (bfd_bwrite (finfo->linenos + linoff, linesz * count, output_bfd) != linesz * count)) - return false; + return FALSE; o->output_section->lineno_count += count; @@ -4949,8 +4948,8 @@ xcoff_link_input_bfd (finfo, input_bfd) int iiadd; /* Update any C_BINCL or C_EINCL symbols - that refer to a line number in the - range we just output. */ + that refer to a line number in the + range we just output. */ iisp = finfo->internal_syms; iispend = (iisp + obj_raw_syment_count (input_bfd)); @@ -5028,7 +5027,7 @@ xcoff_link_input_bfd (finfo, input_bfd) bfd_size_type amt = outsym - finfo->outsyms; if (bfd_seek (output_bfd, pos, SEEK_SET) != 0 || bfd_bwrite (finfo->outsyms, amt, output_bfd) != amt) - return false; + return FALSE; BFD_ASSERT ((obj_raw_syment_count (output_bfd) + (outsym - finfo->outsyms) / osymesz) @@ -5039,7 +5038,7 @@ xcoff_link_input_bfd (finfo, input_bfd) /* Don't let the linker relocation routines discard the symbols. */ keep_syms = obj_coff_keep_syms (input_bfd); - obj_coff_keep_syms (input_bfd) = true; + obj_coff_keep_syms (input_bfd) = TRUE; /* Relocate the contents of each section. */ for (o = input_bfd->sections; o != NULL; o = o->next) @@ -5066,7 +5065,7 @@ xcoff_link_input_bfd (finfo, input_bfd) else { if (! bfd_get_section_contents (input_bfd, o, finfo->contents, (file_ptr) 0, o->_raw_size)) - return false; + return FALSE; contents = finfo->contents; } @@ -5083,12 +5082,12 @@ xcoff_link_input_bfd (finfo, input_bfd) /* Read in the relocs. */ target_index = o->output_section->target_index; internal_relocs = (xcoff_read_internal_relocs - (input_bfd, o, false, finfo->external_relocs, - true, + (input_bfd, o, FALSE, finfo->external_relocs, + TRUE, (finfo->section_info[target_index].relocs + o->output_section->reloc_count))); if (internal_relocs == NULL) - return false; + return FALSE; /* Call processor specific code to relocate the section contents. */ @@ -5098,7 +5097,7 @@ xcoff_link_input_bfd (finfo, input_bfd) internal_relocs, finfo->internal_syms, xcoff_data (input_bfd)->csects)) - return false; + return FALSE; offset = o->output_section->vma + o->output_offset - o->vma; irel = internal_relocs; @@ -5109,7 +5108,7 @@ xcoff_link_input_bfd (finfo, input_bfd) { struct xcoff_link_hash_entry *h = NULL; struct internal_ldrel ldrel; - boolean quiet; + bfd_boolean quiet; *rel_hash = NULL; @@ -5153,7 +5152,7 @@ xcoff_link_input_bfd (finfo, input_bfd) n = ((struct xcoff_toc_rel_hash *) bfd_alloc (finfo->output_bfd, amt)); if (n == NULL) - return false; + return FALSE; si = finfo->section_info + target_index; n->next = si->toc_rel_hashes; n->h = h; @@ -5233,17 +5232,17 @@ xcoff_link_input_bfd (finfo, input_bfd) (input_bfd, is, buf)); if (name == NULL) - return false; + return FALSE; if (! ((*finfo->info->callbacks->unattached_reloc) (finfo->info, name, input_bfd, o, irel->r_vaddr))) - return false; + return FALSE; } } } - quiet = false; + quiet = FALSE; switch (irel->r_type) { default: @@ -5290,12 +5289,12 @@ xcoff_link_input_bfd (finfo, input_bfd) bfd_archive_filename (input_bfd), sec->name); bfd_set_error (bfd_error_nonrepresentable_section); - return false; + return FALSE; } } else { - if (! finfo->info->relocateable + if (! finfo->info->relocatable && (h->flags & XCOFF_DEF_DYNAMIC) == 0 && (h->flags & XCOFF_IMPORT) == 0) { @@ -5303,7 +5302,7 @@ xcoff_link_input_bfd (finfo, input_bfd) callback for this relocation, in _bfd_ppc_xcoff_relocate_section. Don't issue any more warnings. */ - quiet = true; + quiet = TRUE; } if (h->ldindx < 0 && ! quiet) { @@ -5312,7 +5311,7 @@ xcoff_link_input_bfd (finfo, input_bfd) bfd_archive_filename (input_bfd), h->root.root.string); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } ldrel.l_symndx = h->ldindx; } @@ -5328,7 +5327,7 @@ xcoff_link_input_bfd (finfo, input_bfd) bfd_get_section_name (finfo->output_bfd, o->output_section)); bfd_set_error (bfd_error_invalid_operation); - return false; + return FALSE; } bfd_xcoff_swap_ldrel_out (output_bfd, &ldrel, finfo->ldrel); @@ -5356,7 +5355,7 @@ xcoff_link_input_bfd (finfo, input_bfd) (o->_cooked_size != 0 ? o->_cooked_size : o->_raw_size))) - return false; + return FALSE; } obj_coff_keep_syms (input_bfd) = keep_syms; @@ -5364,10 +5363,10 @@ xcoff_link_input_bfd (finfo, input_bfd) if (! finfo->info->keep_memory) { if (! _bfd_coff_free_symbols (input_bfd)) - return false; + return FALSE; } - return true; + return TRUE; } #undef N_TMASK @@ -5376,7 +5375,7 @@ xcoff_link_input_bfd (finfo, input_bfd) /* Write out a non-XCOFF global symbol. */ -static boolean +static bfd_boolean xcoff_write_global_symbol (h, inf) struct xcoff_link_hash_entry *h; PTR inf; @@ -5386,7 +5385,7 @@ xcoff_write_global_symbol (h, inf) bfd_byte *outsym; struct internal_syment isym; union internal_auxent aux; - boolean result; + bfd_boolean result; file_ptr pos; bfd_size_type amt; @@ -5397,13 +5396,13 @@ xcoff_write_global_symbol (h, inf) { h = (struct xcoff_link_hash_entry *) h->root.u.i.link; if (h->root.type == bfd_link_hash_new) - return true; + return TRUE; } /* If this symbol was garbage collected, just skip it. */ if (xcoff_hash_table (finfo->info)->gc && (h->flags & XCOFF_MARK) == 0) - return true; + return TRUE; /* If we need a .loader section entry, write it out. */ if (h->ldsym != NULL) @@ -5625,7 +5624,7 @@ xcoff_write_global_symbol (h, inf) } else { - return false; + return FALSE; } irel->r_type = R_POS; finfo->section_info[oindx].rel_hashes[osec->reloc_count] = NULL; @@ -5645,10 +5644,8 @@ xcoff_write_global_symbol (h, inf) result = bfd_xcoff_put_symbol_name (output_bfd, finfo->strtab, &irsym, h->root.root.string); - if (false == result) - { - return false; - } + if (!result) + return FALSE; irsym.n_value = irel->r_vaddr; irsym.n_scnum = osec->target_index; @@ -5674,7 +5671,7 @@ xcoff_write_global_symbol (h, inf) amt = outsym - finfo->outsyms; if (bfd_seek (output_bfd, pos, SEEK_SET) != 0 || bfd_bwrite (finfo->outsyms, amt, output_bfd) != amt) - return false; + return FALSE; obj_raw_syment_count (output_bfd) += (outsym - finfo->outsyms) / bfd_coff_symesz (output_bfd); @@ -5721,7 +5718,7 @@ xcoff_write_global_symbol (h, inf) } else { - return false; + return FALSE; } sec = h->root.u.def.section; @@ -5759,7 +5756,7 @@ xcoff_write_global_symbol (h, inf) bfd_get_filename (output_bfd), esec->output_section->name); bfd_set_error (bfd_error_nonrepresentable_section); - return false; + return FALSE; } ldrel.l_rtype = (reloc_size << 8) | R_POS; ldrel.l_rsecnm = oindx; @@ -5821,7 +5818,7 @@ xcoff_write_global_symbol (h, inf) bfd_get_filename (output_bfd), tsec->output_section->name); bfd_set_error (bfd_error_nonrepresentable_section); - return false; + return FALSE; } ldrel.l_rtype = (reloc_size << 8) | R_POS; ldrel.l_rsecnm = oindx; @@ -5832,24 +5829,24 @@ xcoff_write_global_symbol (h, inf) if (h->indx >= 0 || finfo->info->strip == strip_all) { BFD_ASSERT (outsym == finfo->outsyms); - return true; + return TRUE; } if (h->indx != -2 && (finfo->info->strip == strip_all || (finfo->info->strip == strip_some && bfd_hash_lookup (finfo->info->keep_hash, h->root.root.string, - false, false) == NULL))) + FALSE, FALSE) == NULL))) { BFD_ASSERT (outsym == finfo->outsyms); - return true; + return TRUE; } if (h->indx != -2 && (h->flags & (XCOFF_REF_REGULAR | XCOFF_DEF_REGULAR)) == 0) { BFD_ASSERT (outsym == finfo->outsyms); - return true; + return TRUE; } memset (&aux, 0, sizeof aux); @@ -5858,10 +5855,8 @@ xcoff_write_global_symbol (h, inf) result = bfd_xcoff_put_symbol_name (output_bfd, finfo->strtab, &isym, h->root.root.string); - if (false == result) - { - return false; - } + if (!result) + return FALSE; if (h->root.type == bfd_link_hash_undefined || h->root.type == bfd_link_hash_undefweak) @@ -5957,16 +5952,16 @@ xcoff_write_global_symbol (h, inf) amt = outsym - finfo->outsyms; if (bfd_seek (output_bfd, pos, SEEK_SET) != 0 || bfd_bwrite (finfo->outsyms, amt, output_bfd) != amt) - return false; + return FALSE; obj_raw_syment_count (output_bfd) += (outsym - finfo->outsyms) / bfd_coff_symesz (output_bfd); - return true; + return TRUE; } /* Handle a link order which is supposed to generate a reloc. */ -static boolean +static bfd_boolean xcoff_reloc_link_order (output_bfd, finfo, output_section, link_order) bfd *output_bfd; struct xcoff_final_link_info *finfo; @@ -5985,9 +5980,9 @@ xcoff_reloc_link_order (output_bfd, finfo, output_section, link_order) if (link_order->type == bfd_section_reloc_link_order) { /* We need to somehow locate a symbol in the right section. The - symbol must either have a value of zero, or we must adjust - the addend by the value of the symbol. FIXME: Write this - when we need it. The old linker couldn't handle this anyhow. */ + symbol must either have a value of zero, or we must adjust + the addend by the value of the symbol. FIXME: Write this + when we need it. The old linker couldn't handle this anyhow. */ abort (); } @@ -5995,20 +5990,20 @@ xcoff_reloc_link_order (output_bfd, finfo, output_section, link_order) if (howto == NULL) { bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } h = ((struct xcoff_link_hash_entry *) bfd_wrapped_link_hash_lookup (output_bfd, finfo->info, link_order->u.reloc.p->u.name, - false, false, true)); + FALSE, FALSE, TRUE)); if (h == NULL) { if (! ((*finfo->info->callbacks->unattached_reloc) (finfo->info, link_order->u.reloc.p->u.name, (bfd *) NULL, (asection *) NULL, (bfd_vma) 0))) - return false; - return true; + return FALSE; + return TRUE; } if (h->root.type == bfd_link_hash_common) @@ -6039,12 +6034,12 @@ xcoff_reloc_link_order (output_bfd, finfo, output_section, link_order) bfd_size_type size; bfd_byte *buf; bfd_reloc_status_type rstat; - boolean ok; + bfd_boolean ok; size = bfd_get_reloc_size (howto); buf = (bfd_byte *) bfd_zmalloc (size); if (buf == NULL) - return false; + return FALSE; rstat = _bfd_relocate_contents (howto, output_bfd, addend, buf); switch (rstat) @@ -6061,7 +6056,7 @@ xcoff_reloc_link_order (output_bfd, finfo, output_section, link_order) (bfd_vma) 0))) { free (buf); - return false; + return FALSE; } break; } @@ -6069,7 +6064,7 @@ xcoff_reloc_link_order (output_bfd, finfo, output_section, link_order) (file_ptr) link_order->offset, size); free (buf); if (! ok) - return false; + return FALSE; } /* Store the reloc information in the right place. It will get @@ -6124,7 +6119,7 @@ xcoff_reloc_link_order (output_bfd, finfo, output_section, link_order) (_("%s: loader reloc in unrecognized section `%s'"), bfd_get_filename (output_bfd), secname); bfd_set_error (bfd_error_nonrepresentable_section); - return false; + return FALSE; } } else @@ -6136,7 +6131,7 @@ xcoff_reloc_link_order (output_bfd, finfo, output_section, link_order) bfd_get_filename (output_bfd), h->root.root.string); bfd_set_error (bfd_error_bad_value); - return false; + return FALSE; } ldrel.l_symndx = h->ldindx; } @@ -6146,7 +6141,7 @@ xcoff_reloc_link_order (output_bfd, finfo, output_section, link_order) bfd_xcoff_swap_ldrel_out (output_bfd, &ldrel, finfo->ldrel); finfo->ldrel += bfd_xcoff_ldrelsz(output_bfd); - return true; + return TRUE; } /* Sort relocs by VMA. This is called via qsort. */ diff --git a/contrib/binutils/binutils/ChangeLog b/contrib/binutils/binutils/ChangeLog index 95d72cf..185b21b 100644 --- a/contrib/binutils/binutils/ChangeLog +++ b/contrib/binutils/binutils/ChangeLog @@ -1,2880 +1,132 @@ -2002-11-07 Nick Clifton - - * configure.in (LINGUAS): Add 'da'. - * configure: Regenerate. - * po/da.po: New Danish translation. - -2002-10-30 Daniel Jacobowitz - - * po/binutils.pot: Regenerated. - -2002-10-28 Daniel Jacobowitz - - Merge from mainline: - 2002-10-21 Alan Modra - * bucomm.c (list_supported_targets): Use bfd_target_list. - - 2002-10-09 Daniel Jacobowitz - * readelf.c (display_debug_info): Ignore empty .rela.debug_info - sections. Allow relocations against the absolute symbol. Don't - use the value in compunit.cu_abbrev_offset if we found a RELA - relocation. - -2002-10-21 Svein E. Seldal - - * objdump.c (dump_data): Correct addr_offset for opb != 1. - -2002-09-23 Daniel Jacobowitz - - Merge from mainline: - 2002-09-11 Nick Clifton - * po/tr.po: Updated Turkish translation. - - 2002-08-14 Luke Dunstan - * rcparse.y (acc_entry): Don't warn about ALT use with - non-VIRTKEY. - - 2002-08-09 Nick Clifton - * po/sv.po: Updated Swedish translation. - - 2002-07-31 Nick Clifton - * addr2line.c (process_file): Rename parameter 'filename' to - 'file_name' in order to avoid shadowing global symbol of the - same name. - (main): Likewise. - -2002-07-30 Daniel Jacobowitz - - Merge from mainline: - 2002-07-30 Jakub Jelinek - * readelf.c (OPTION_DEBUG_DUMP): Define. - (options): Use it. - (usage): Update help. - (parse_args): Handle --debug-dump separately from -w. - * doc/binutils.texi (readelf): Update documentation. - -2002-07-25 Nick Clifton - - * po/es.po: Updated Spanish translation. - * po/fr.po: Updated French translation. - -2002-07-24 Nick Clifton - - * po/es.po: Updated Spanish translation. - -2002-07-23 Daniel Jacobowitz - - * po/binutils.pot: Regenerated. - -2002-07-23 Nick Clifton +2004-05-13 Nick Clifton * po/fr.po: Updated French translation. -2002-07-23 Eric S. Raymond - - * doc/binutils.texi (addr2line ): Correct brackets. - -2002-07-20 Alan Modra - - * budemang.c: Include config.h and string.h/strings.h. - -2002-07-16 Nick Clifton - - * NEWS: Add 'Changes in 2.13'. - -2002-07-10 Jakub Jelinek - - * readelf.c (get_dynamic_type): Handle DT_GNU_PRELINKED, - DT_GNU_CONFLICT* and DT_GNU_LIBLISZ*. - (get_section_type_name): Handle SHT_GNU_LIBLIST. - (process_dynamic_segment): Handle DT_GNU_CONFLICTSZ, - DT_GNU_LIBLISTSZ and DT_GNU_PRELINKED. - (process_gnu_liblist): New. - (process_file): Call it. - -2002-07-03 Alan Modra - - * Makefile.am (check-DEJAGNU): Revert 2002-06-25 change. - * Makefile.in: Regenerate. - -2002-07-02 Alan Modra - - * budemang.c: New file, "demangle" function. - * budemang.h: New file. - * addr2line.c (translate_addresses): Use "demangle". - * nm.c (print_symname): Likewise. - * objdump.c (objdump_print_symname): Likewise. - (dump_symbols): Likewise. Also, don't use bfd_asymbol_name macro - here since that obfuscates. - * rdcoff.c: Don't #include demangle.h. - * Makefile.am (CFILES): Add budemang.c, emul_aix.c, - emul_vanilla.c. Remove emul_$(EMULATION).c. Sort. - (HFILES): Add budemang.h. Sort. - (nm_new_SOURCES, objdump_SOURCES, addr2line_SOURCES): Add budemang.c. - Run "make dep-am". - * Makefile.in: Regenerate. - -2002-07-01 Matt Thomas - - * readelf.c: Include "elf/vax.h". - (guess_is_rela): Move EM_VAX from unknown to RELA case. - (dump_relocations): Handle VAX relocations. - (get_machine_flags): Handle VAX machine flags. - -2002-06-29 Stephane Carrez - - * readelf.c (dump_relocations): Handle 68HC11/68HC12 relocations. - -2002-06-26 Nick Clifton - - * MAINTAINERS: Remove Tom Rix from d10v and pcc maintainerships. - -2002-06-26 Alan Modra - - * nm.c (print_symname): When demangling, strip leading dots from - symbol names to avoid confusing the demangler. - -2002-06-25 H.J. Lu - - * Makefile.am (check-DEJAGNU): Set LC_ALL=C and export it. - * Makefile.in: Regenerated. - -2002-06-21 Igor Schein - - * configure.in: Quote bu_cv_have_fopen64. - * configure: Regenerate. - -2002-06-21 Mitsru Chinen - - * configure.in: Check for strcoll. - * configure: Regenerate. - * config.in: Regenerate. - * nm.c (main): Set locale for LC_COLLATE category. - (non_numeric_forward): Use strcoll if available. - -2002-06-20 Dave Brolley - - * MAINTAINERS: Add self as fr30 and frv maintainer. - -2002-06-18 H.J. Lu (hjl@gnu.org) - - * nm.c: Include "elf/common.h". - (extended_symbol_info): Add elfinfo, a pointer to - elf_symbol_type. - (SYM_SIZE): Use elfinfo if it is not NULL. - (get_symbol_type): New function. - (display_archive): Set print_width for each archive member. - (display_file): Likewise. - (display_rel_file): Don't set print_width here. - (print_object_filename_sysv): Handle print_width. - (print_archive_member_sysv): Likewise. - (print_symbols): Pass (bfd_vma) 0 to print_symbol. - (print_symbol): Set the elfinfo field in extended_symbol_info - for ELF. - (print_object_filename_sysv): Fix the output format. - (print_symbol_info_sysv): Print type and section for ELF. - -2002-06-18 Elias Athanasopoulos - - * nm.c (print_size_symbols): Remove assignment, which makes - the symbol's size equal to its value when --size-sort is - used. - -2002-06-18 Dave Brolley - - From Catherine Moore: - * readelf.c (elf/frv.h): #include it. - (guess_is_rela): Support EM_CYGNUS_FRV. - (dump_relocations): Ditto. - (get_machine_name): Ditto. - * Makefile.am (readelf.o): add dependency on $(INCDIR)/elf/frv.h. - -2002-06-18 Jakub Jelinek - - * readelf.c (get_file_header): Only read the first section header if - e_shoff is non-zero. - -2002-06-15 H.J. Lu (hjl@gnu.org) - - * nm.c (print_size): New variable. Initialize to 0. - (long_options): Add 'S'/"print-size". - (main): Handle 'S'. - (print_symbol_info_bsd): Print size only if print_size is not - 0. - - * doc/binutils.texi: Document -S/--print-size. - -2002-6-13 Elias Athanasopoulos - - * nm.c (struct extended_symbol_info): New strcuture: Add the size - of the symbols to the information provided by the symbol_info - structure. - (print_symbols): Pass the symbol size to print_symbol. - (print_size_symbols): Pass the symbol size to print_symbol. - (print_symbol): Extra argument: The size of the symbol. Store - this in the extended_symbol_info structure. - (print_symbol_info): Change type of info parameter to - extended_symbol_info. Display the size, if known. - (print_symbol_info_posix): Likewise. - (print_symbol_info_sysv): Likewise. - -2002-06-08 Alan Modra - - * Makefile.am: Run "make dep-am". - * Makefile.in: Regenerate. - * doc/Makefile.in: Regnerate. - - * bucomm.c: Replace CONST with const. - * nm.c: Likewise. - * objdump.c: Likewise. - -2002-06-07 H.J. Lu - - * readelf.c (DW_CFA_GNU_args_size): Don't define. - (DW_CFA_GNU_negative_offset_extended): Likewise. - (DW_CFA_GNU_window_save): Likewise. - (display_debug_frames): Handle DW_CFA_offset_extended_sf, - DW_CFA_def_cfa_sf and DW_CFA_def_cfa_offset_sf. - -2002-06-07 Elias Athanasopoulos - - * nm.c: When computing size of symbols for an ELF target use the - internal size field. - -2002-06-06 John David Anglin - - * testsuite/binutils-all/objcopy.exp: clear xfail for - "hppa*64*-*-hpux*". - * testsuite/binutils-all/hppa/objdump.exp: Return if - "*64*-*-*". - -2002-06-05 Alan Modra - - * objcopy.c (copy_section): Don't copy SEC_GROUP sections. - -2002-06-03 Elias Athanasopoulos - - * objdump.c: Fix formatting. - -2002-05-29 Ben Elliston - - * MAINTAINERS: Add self as M68k maintainer. - -2002-05-28 Kuang Hwa Lin - - * readelf.c: Modified/Added DLX elf support. - -2002-05-27 Nick Clifton - - * arsup.c: Fix formatting. - * debug.c (debug_record_label): Add missing colon to error - message. - * ieee.c (parse_ieee_ty): Fix spelling typo. - * readelf.c (process_program_headers): Remove English assumption - about making a plural word. - (process_section_headers): Likewise. - (process_relocs): Allow quotes to be translated. - (process_unwind): Likewise, - (process_mips_specific): Improve error message. - (get_note_type): Fix spelling typo. - - * configure.in (ALL_LINGUAS): Add sv - * po/sv.po: New file. - -2002-05-27 Alan Modra - - * unwind-ia64.c (unw_print_brmask): Don't use sprintf. - (unw_print_grmask): Likewise. - (unw_print_frmask): Likewise. - -2002-05-26 Kazu Hirata - - * arsup.c: Remove ARGSUSED. - * debug.c: Likewise. - * ieee.c: Likewise. - * nlmconv.c: Likewise. - * prdbg.c: Likewise. - * stabs.c: Likewise. - * wrstabs.c: Likewise. - -2002-05-25 Alan Modra - - * arlex.l: Use #include "" instead of <> for local header files. - * coffdump.c: Likewise. - * coffgrok.c: Likewise. - * nlmconv.c: Likewise. - * nlmheader.y: Likewise. - * srconv.c: Likewise. - * strings.c: Likewise. - * sysdump.c: Likewise. - * unwind-ia64.h: Likewise. - * windres.h: Likewise. - * winduni.h: Likewise. - -2002-05-24 Tom Rix - - * MAINTAINERS: Add self as the d10v maintainer. - -2002-05-24 TAMURA Kent - - * configure.in: Builds dlltool for i386-netbsdpe. - * configure: Regenerate. - -2002-05-23 Kazu Hirata - - * size.c: Fix formatting. - * srconv.c: Likewise. - * stabs.c: Likewise. - * sysdump.c: Likewise. - * unwind-ia64.c: Likewise. - * wrstabs.c: Likewise. - -2002-05-23 Jakub Jelinek - - * readelf.c (get_segment_type): Add PT_TLS. - (get_elf_section_flags): Add SHF_TLS. - (get_dynamic_flags): Optimize. Add DF_STATIC_TLS. - (process_dynamic_segment): Use puts instead of printf. - (get_symbol_type): Support STT_TLS. - * objdump.c (dump_section_header): Remove SEC_CONSTRUCTOR_TEXT, - SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS. - Add SEC_THREAD_LOCAL. - -2002-05-23 Kazu Hirata - - * rdcoff.c: Fix formatting. - * rddbg.c: Likewise. - * readelf.c: Likewise. - * rename.c: Likewise. - * resbin.c: Likewise. - * resrc.c: Likewise. - * resres.c: Likewise. - -2002-05-21 Kazu Hirata - - * filemode.c: Fix formatting. - * ieee.c: Likewise. - * is-ranlib.c: Likewise. - * is-strip.c: Likewise. - * maybe-ranlib.c: Likewise. - * maybe-strip.c: Likewise. - * nlmconv.c: Likewise. - * nm.c: Likewise. - * not-ranlib.c: Likewise. - * not-strip.c: Likewise. - * objcopy.c: Likewise. - * objdump.c: Likewise. - -2002-05-21 Thiemo Seufer - - * objdump.c (dump_headers): Fix output formatting for ELF32 - architectures in a BFD64 enabled toolchain. - -2002-05-20 Kazu Hirata - - * debug.c: Fix formatting. - * debug.h: Likewise. - * dlltool.c: Likewise. - * dllwrap.c: Likewise. - * emul_aix.c: Likewise. - * emul_vanilla.c: Likewise. - -2002-05-19 Kazu Hirata - - * addr2line.c: Fix formatting. - * ar.c: Likewise. - * arsup.c: Likewise. - * arsup.h: Likewise. - * binemul.c: Likewise. - * binemul.h: Likewise. - * bucomm.c: Likewise. - * coffdump.c: Likewise. - * coffgrok.c: Likewise. - * coffgrok.h: Likewise. - -2002-05-16 Marek Michalkiewicz - - * MAINTAINERS: Add myself as the second AVR port maintainer. - -2002-05-16 Stephane Carrez - - * MAINTAINERS: Update my email address. - -2002-05-09 Nick Clifton - - * MAINTAINERS: Add Jason Thorpe as VAX maintainer. - -2002-05-09 Alan Modra - - * configure.in: Replace `*pe' with `pe' throughout. - * configure: Regenerate. - -2002-05-07 Federico G. Schwindt - - * Makefile.am: Honour DESTDIR. - * Makefile.in: Regenerate. - -2002-05-06 Alan Modra - - * dlltool.c (process_def_file): Add missing prototype. - (new_directive, assemble_file, main): Likewise. - (process_def_file, new_directive): Make static. - (inform): Rewrite using VA_FIXEDARG. - * dllwrap.c (mybasename): Add missing prototype. - (strhash, main): Likewise. - (inform): Rewrite using VA_FIXEDARG. - (warn): Likewise. - (cleanup_and_exit): Use old style function definition. - (strhash): Likewise. - * windres.c (define_resource): Use one memset to clear all of - struct res_resource. - - * rcparse.y: Remove newcmd rule. Move rcparse_discard_strings - call to rules that need no lookahead. Check for no lookahead. +2004-04-09 Daniel Jacobowitz -2002-05-06 Borut Razem - - * rclex.l (get_string): Correct "strings" list handling. - * resrc.c (read_rc_file): Discard strings. - -2002-05-04 Alan Modra - - * ar.c (replace_members): Remove unused var. Formatting fix. - * binemul.c (ar_emul_default_parse_arg): Add ATTRIBUTE_UNUSED. - - * MAINTAINERS: Sort port maintainers by CPU. - -2002-05-04 Bob Byrnes - - * size.c (display_archive): Add last_arfile and code to close archives. - -2002-05-01 Alan Modra - - * nm.c (print_symbol): Check returned filename from - bfd_find_nearest_line is non-NULL. - -2002-04-25 Elena Zannoni - - * readelf.c (get_AT_name): Handle DW_AT_GNU_vector. - -2002-04-24 Christian Groessler - - * MAINTAINERS: Changed my email address. - -2002-04-17 Thiemo Seufer - - * arparse.y: Fix syntax warning. - -2002-04-16 Nick Clifton - - * readelf.c (fetch_location_list): Remove unused function. - - * readelf.c (process_corefile_note_segment): Catch corrupt notes - and display a warning message, then exit the loop. - - * rcparse.y: Set MEMFLAG_DISCARDABLE by default. - -2002-04-15 Nick Clifton - - * resrc.c (write_rc_dialog): If charset is non-default value - display all of the DIALOGEX parameters. - -2002-04-15 Eric Kohl - - * rcparse.y: Allow two to five parameter in FONT statement of - DIALOGEX resources. - * resbin.c (bin_to_res_dialog): Fixed read/write code for dialogex - resource data. - (res_to_bin_dialog): Likewise. - * windres.h: Added misssing charset variable to dialog_ex - structure. - -2002-04-10 Nick Clifton - - * rcparse.y: Set MEMFLAG_PURE by default. - -2002-04-09 Bernd Herd - - * rcparse.y: CLASS definitions in DIALOG resources - are quoted. - Fix typo in BEDIT warning. - Don't add default dialog style when explicit style specified. - Add WS_CAPTION dialog style if CAPTION is specified. - - * rclex.l (handle_quotes): "\xhex" encoding in strings corrected. - (handle_quotes) "\a" escape (used for right justified key - definitions in menus) is encodes as binary 8. - - * resrc.c (write_rc_dialog): Print style even if it is 0. - (write_rc_directory): Fix overlooked sublang shift bug. - (bin_to_res_dialog): Don't print empty dialog caption. - - * resbin.c (bin_to_res_dialog): Use signature to identify - DIALOGEX. - - * windres.c (main): Set default LANGUAGE to english/us. - -2002-04-09 Gunnar Degnbol - - * resrc.c: print CLASS names in quotes - -2002-04-09 J"orn Rennecke - - * MAINTAINERS: Update my email address. - -2002-04-04 Alan Modra - - * dep-in.sed: Cope with absolute paths. - * Makefile.am (dep.sed): Subst TOPDIR. - Run "make dep-am". - * Makefile.in: Regenerate. - -2002-03-27 Peter Targett - - * MAINTAINERS: Update my email address. - -2002-03-21 Alan Modra - - * Makefile.am: Run "make dep-am". - * Makefile.in: Regenerate. - * doc/Makefile.in: Regenerate. - * po/POTFILES.in: Regenerate. - * aclocal.m4: Regenerate. - * config.in: Regenerate. - * configure: Regenerate. - -2002-03-20 Daniel Berlin - - * readelf.c: Add support for displaying dwarf2 location lists. - (do_debug_loc, debug_loc_section, debug_loc_size): New. - (parse_args): Use 'O' as shorthand for displaying location list + Merge from mainline: + 2004-04-07 Benjamin Monate + PR 86 + * arsup.c (ar_save): Use smart_rename. + + 2004-04-01 Dean Luick + * readelf.c (display_debug_pubnames): Align offset and data + columns. + (read_and_display_attr_value): Add missing break; + (debug_displays): Enable the display of the .debug_pubtypes section. - (process_section_headers): Handle debug_loc as well. - (load_debug_loc): New. - (free_debug_loc): New. - (fetch_location_list): New. - (display_debug_loc): New. - (display_debug_info): Call load_debug_loc and free_debug_loc. - (debug_displays): We can display .debug_loc now, too. - (usage): Update usage string. - (read_and_display_attr_value): Note location lists, but don't - display them inline. - -2002-03-18 Tom Rix - - * Makefile.am: Add binutils emulation support. - * configure.in: Same. - * configure.tgt: New file. Same. - * ar.c (main): Use ar_emul_parse_arg. - (usage): Use ar_emul_usage. - (replace_members): Use ar_emul_replace, ar_emul_append. - * binemul.c: New file. Define the binutils emulation - layer. Define default methods. - * binemul.h: New file. Binutils emulation layer header file. - * emul_aix.c: New file. AIX binutils emulation. - * emul_vanilla.c: New file. Default binutils emulation. - * Makefile.in: Regenerate. - * configure: Same. - -2002-03-18 Nick Clifton - - * po/fr.po: Updated version. - -2002-03-13 Nick Clifton - - * po/fr.po: Updated version. - -2002-03-07 Daniel Jacobowitz - - * README: Update some version numbers. - -2002-03-07 Daniel Jacobowitz - - * doc/binutils.texi (Target Selection): Fix LD crossreferences. - (Architecture Selection): Likewise. - -2002-03-01 Dmitry Timoshkov - - * dlltool.c (gen_exp_file): Take into account --kill-at (-k) while - generating .exp file. - -2002-02-21 Nick Clifton - - * readelf.c (dump_relocations): Fix typo. - -2002-02-20 Nick Clifton - - * NEWS: Mark 2.12 branch. - -2002-02-18 Timothy Daly - - * readelf.c (dump_relocations): Display 2nd and 3rd reloc - types for 64-bit MIPS. Narrow some fields for 80-char - output. - (dump_relocations): Change spelling from 'unrecognised' - to 'unrecognized'. - (decode_ARM_machine_flags): Likewise. - (parse_args): Likewise. - (read_and_display_attr_value): Likewise. - (display_debug_section): Likewise. - -2002-02-15 Hans-Peter Nilsson - * NEWS: Mention support for MMIX. + 2004-03-21 Richard Henderson + * readelf.c (display_debug_frames): Don't crash for mismatched + DW_CFA_restore_state. -2002-02-13 Matt Fredette + 2004-03-10 Ben Elliston + * MAINTAINERS: Update my mail address. - * readelf.c (get_machine_flags): Recognize EF_M68000. + 2004-03-08 Danny Smith + * deflex.l: Handle "PRIVATE" string. + * defparse.y (%token): Add PRIVATE. + (%type): Add opt_PRIVATE. + (expline): Pass opt_PRIVATE to def_exports. + (opt_PRIVATE): Handle PRIVATE token. + * dlltool.h (def_exports): Add 7th param for private flag to + declaration. + * dlltool.c: Add PRIVATE to comment on EXPORTS syntax. + (struct export): Add 'private' field. + (def_exports): Set 'private' field of struct exports. + (scan_drectve_symbols): Adjust calls to def_exports. + (scan_filtered_symbols): Likewise. + (dump_def_info): Print 'private' field. + (gen_def_file): Likewise. + (gen_lib_file): Skip generation of lib object if private. + Delete tmp object files in same order as they were generated. + Don't delete non-existent private object files. -2002-02-12 Alexandre Oliva + 2004-02-27 Andreas Schwab + * ar.c (main): Support POSIX-compatible argument parsing. - * MAINTAINERS: Added self as MN10300 co-maintainer. + 2004-02-23 Daniel Lucq + * readelf.c (process_mips_specific): Print conflictsno as an + unsigned long. -2002-02-12 Alan Modra + 2004-02-21 Dmitry Timoshkov + * dlltool.c (gen_exp_file): Always output names for forwarded symbols. - * readelf.c (get_ppc64_dynamic_type): Handle DT_PPC64_OPD and - DT_PPC64_OPDSZ. + 2004-02-19 Jakub Jelinek + * objcopy.c (copy_section): Avoid warnings. -2002-02-11 Daniel Jacobowitz +2004-02-14 Andrew Cagney - * MAINTAINERS: List myself as branch maintainer. + * ar.c (remove_output): Use bfd_cache_close. + * arsup.c (ar_end): Ditto. -2002-02-11 Alan Modra +2004-01-21 Roland McGrath - * configure: Regenerate. - * objcopy.c: Update copyright date. - * doc/Makefile.in: Regenerate. - -2002-02-10 Daniel Jacobowitz - - * nlmconv.c: Back out localtime PARAMS change. - -2002-02-11 Alan Modra - - * objcopy.c (MKDIR): Define. - (copy_archive): Make name_list.name const. Use MKDIR. - Handle duplicate files in archives by making more temp dirs. - -2002-02-10 Daniel Jacobowitz - - * coffdump.c: Include "getopt.h" after "bucomm.h" - so that macros are defined correctly. - * nlmconv.c: Add PARAMS ((const time_t *)) to localtime - prototype. Prototype main. - * nlmheader.y: Add PARAMS ((int)) to strerror prototype. - -2002-02-06 Alexandre Oliva - - * MAINTAINERS: Added self as SH co-maintainer. - -2002-02-05 Nick Clifton - - * po/tr.po: Updated translation. - -2002-02-01 Alan Modra - - * Makefile.am: Run "make dep-am" - * Makefile.in: Regenerate. - -2002-01-29 Daniel Jacobowitz - - * nm.c (print_value): Mark abfd unused. - -2002-01-29 Daniel Jacobowitz - - * unwind-ia64.c (unw_decoder): Change second argument - to unsigned int, to match function prototypes. - -2002-01-29 Daniel Jacobowitz - - * objdump.c: Include "getopt.h" after "bucomm.h" so that - __GNU_LIBRARY__ will be defined. - * size.c: Likewise. - -2002-01-27 Daniel Jacobowitz - - * configure: Regenerated. - -2002-01-26 Hans-Peter Nilsson - - * doc/Makefile.am (install): Depend on install-info. - * doc/Makefile.in: Regenerate. - -2002-01-25 Jason R. Thorpe - - * objcopy.c (strip_usage): Document -d as an alias - --strip-debug. - - * size.c (usage): Document [-t | --totals] options. - (long_options): Add --totals option. - (main): If the [-t | --totals] option is specified and - the output format is Berkeley-style, print the total - text, data, and bss sizes of all objects listed. - (print_berkeley_format): If the [-t | --totals] option - is specified, track the total text, data, and bss - sizes. - * doc/binutils.texi (size): Document [-t | --totals] options. - (strip): Document -d as an alias for --strip-debug. - * NEWS: Mention new feature of size. - -2002-01-25 Nick Clifton - - * po/fr.po: Updated version. - * po/es.po: Updated version. - -2002-01-23 Nick Clifton - - * addr2line.c (usage): Update text to provide verbose - description of the command line options. - * ar.c (usage): Update text to provide verbose - description of the command line options. - (main): Accept -h and -H when running as ranlib. - * coffdump.c (show_usage): Update text to provide verbose - description of the command line options. - * dlltool.c (main): Accept -H as an alias for --help. - * nlmconv.c (show_usage): Update text to provide verbose - description of the command line options. - * nm.c (usage): Replace OPTIONS with option(s). - (main): Accept -H as an alias for --help. - * objcopy.c (strip_main): Accept -H as an alias for --help. - * objdump.c (main): Accept -v as an alias for --verbose. - * readelf.c (usage): Adjust format to match style used in - other binutils. - * size.c (usage): Update text to provide verbose description - of the command line options. - (main): Accept -v, -h and -H as command line options. - * srconv.c (show_usage): Update text to provide verbose - description of the command line options. - * strings.c (main): Accept -H and -v as command line options. - (usage): Update text to provide verbose description of the - command line options. - * sysdump.c (show_usage): Update text to provide verbose - description of the command line options. - * windres.c (usage): Adjust format to match style used in - other binutils. - - * coffdump.c: Fix formatting. - * nlmconv.c: Fix formatting. - * srconv.c: Fix formatting. - * sysdump.c: Fix formatting. - -2002-01-22 Alan Modra + * readelf.c (get_note_type): Match NT_AUXV. - * Makefile.am: Run "make dep-am". - * Makefile.in: Regenerate. +2004-01-20 Nick Clifton -2002-01-18 Andreas Jaeger + * version.c (print_version): Update copyright year to 2004. - * version.c (print_version): Update year. +2004-01-14 Maciej W. Rozycki -2002-01-17 Alan Modra - - * readelf.c (get_machine_name): Handle EM_PPC64. - (guess_is_rela): Here too. - -2002-01-17 Nick Clifton - - * po/binutils.pot: Regenerate. - * po/fr.po: Regenerate. - * po/tr.po: Regenerate. - -2002-01-16 Nick Clifton - - * po/tr.po: Import new version. - -2002-01-16 Alan Modra - - * readelf.c (get_ppc64_dynamic_type): New. - (get_dynamic_type): Call it. - -2002-01-15 Nick Clifton - - * objcopy.c (copy_usage): Use "options" instead of "switches". - (strip_usage): Use "options" instead of "switches". - * doc/binutils.texi (dlltool): Refer to "options" instead of - "switches". - -2002-01-14 Richard Earnshaw - - * MAINTAINERS: Add self as co-maintainer for the ARM code. - -2001-12-18 Nick Clifton - - * po/es.po: Import from translation project. - * configure.in (ALL_LINGUAS): Add es. + * acinclude.m4: Quote names of macros to be defined by AC_DEFUN + throughout. + * aclocal.m4: Regenerate. * configure: Regenerate. -2002-01-09 Jason Thorpe - - * readelf.c (get_netbsd_elfcore_note_type): Use - NT_NETBSDCORE_PROCINFO and NT_NETBSDCORE_FIRSTMACH. - -2002-01-09 Jason Thorpe +2004-01-12 Jakub Jelinek - * readelf.c: Update copyright years. - (get_note_type): Return a const char *. - (get_netbsd_elfcore_note_type): New function. - (process_note): Use get_netbsd_elfcore_note_type to get - the note type string for NetBSD ELF core files. + * objcopy.c: Include elf-bfd.h. + (is_strip_section): Don't strip debugging sections if + STRIP_NONDEBUG. + (setup_section): If STRIP_NONDEBUG make SEC_ALLOC sections + ~(SEC_LOAD | SEC_HAS_CONTENTS) and on ELF targets also SHT_NOBITS. -2002-01-06 Steve Ellcey + * objcopy.c (copy_section): Free relpp if relcount == 0. - * readelf.c (get_ia64_segment_type): Add support for macros. - (get_segment_type): Add support for IA64 specific macros. +2004-01-12 Ian Lance Taylor -2001-12-20 Julian v. Bock + * stabs.c (parse_stab_argtypes): Handle g++ ABI version 3 names. + (stab_demangle_argtypes): Likewise. + (stab_demangle_v3_argtypes): New static function. + (stab_demangle_v3_arg): New static function. - * readelf.c (print_symbol): New function: Print a formatted symbol - name. If --wide is specified do not truncate it. - (dump_relocations): Use print_symbol() to print symbol names. - (process_symbol_table): Likewise. - (process_syminfo): Likewise. - (process_mips_specific): Likewise. - (usage): Document new feature of --wide switch. - * doc/binutils.texi (objdump): Document additional behaviour of - --wide. +2004-01-12 Nick Clifton -2001-12-18 Michael Snyder + * objcopy.c (copy_object): Make the function boolean, returning + FALSE upon failure. + (copy_archive): Handle the return value from copy_object. + (copy_file): Likewise. - * objcopy.c (copy_file): Accept corefiles (format bfd_core). - (copy_object): Don't set the start address or flags of a core file. - (copy_section): Don't relocate a core file. Don't copy contents - if the input section has the contents flag set, but the output - section does not (which happens with the fake 'note' pseudo- - sections that BFD creates for corefiles). +2004-01-07 Nick Clifton -2001-12-18 Thiemo Seufer - - * readelf.c (get_machine_flags): Recognize header flags for ABI and - ASE extensions. More robust code for ISA checking. Ignore empty fields - in header flags for GNU extensions. + * readelf.c (find_section): New function. Locates a named + section. + (get_debug_line_pointer_sizes): New function: Initialises the + debug_line_pointer_sizes array. + (display_debug_lines): Call get_debug_line_pointer_sizes. + (display_debug_loc): Likewise. + (load_debug_loc): Use find_section. + (load_debug_str): Likewise. + (display_debug_info): Likewise. + (prescan_debug_info): Delete. + (debug_displays): Remove prescan field. + (process_section_contents): Do not perform prescans. -2001-12-18 Alan Modra +2004-01-03 Alan Modra - * objcopy.c (copy_archive): Set output bfd format outside the loop. + * objcopy.c (filter_bytes): Delete. Move code to.. + (copy_section): ..here. Simplify size adjustment. Divide + section lma by interleave. -2001-12-18 Nick Clifton +2004-01-02 Nick Clifton - * po/ja.po: Import from translation project. - * configure.in (ALL_LINGUAS): Add ja. + * po/ru.po: New file: Russian translation. + * configure.in (ALL_LINGUAS): Add ru * configure: Regenerate. -2001-12-18 Thiemo Seufer - - * addr2line.c (main): Protoype. - * ar.c (main): Protoype. - * nm.c (main): Protoype. - * objcopy.c (main): Protoype. - * objdump.c (main): Protoype. - * size.c (main): Protoype. - * strings.c (main): Protoype. - -2001-12-17 Alan Modra - - * readelf.c (symtab_shndx_hdr): New global. - (SECTION_HEADER_INDEX): Define. - (SECTION_HEADER_NUM): Define. - (SECTION_HEADER): Define. - (GET_ELF_SYMBOLS): Pass two params rather than three. - (get_32bit_elf_symbols): Take file and section args. Read and - use SHT_SYMTAB_SHNDX. - (get_64bit_elf_symbols): Likewise. - (dump_relocations): Use SECTION_HEADER to index "section_headers". - (process_section_headers): Likewise. Use SECTION_HEADER_NUM too. - Remember symtab_shdx_hdr. - (process_program_headers): Scan from index 1 for segment map. - (slurp_ia64_unwind_table): Use SECTION_HEADER to index - "section_headers". - (process_relocs): Likewise. Also adjust call to GET_ELF_SYMBOLS. - (process_unwind): Likewise. - (process_version_sections): Likewise. - (process_symbol_table): Likewise. - (display_debug_info): Likewise. - (process_dynamic_segment): Fake up a symtab section for changed - GET_ELF_SYMBOLS. - (get_symbol_index_type): Check SHN_LOOS before SHN_LORESERVE. - (process_program_headers): Kill signed/unsigned warning. - (load_debug_str): Likewise. - (display_debug_info): Likewise. - -2001-12-13 Jakub Jelinek - - * readelf.c (get_segment_type): Support PT_GNU_EH_FRAME. - -2001-12-11 Alan Modra - - * readelf.c (process_file_header): Print extended e_shnum and - e_shdtrndx values. Set elf_header values for same. - (get_32bit_section_headers): Add "num" arg to read "num" headers. - (get_64bit_section_headers): Likewise. - (process_section_headers): Update calls. - (get_file_header): Call get_32bit_section_headers or 64bit variant. - -2001-12-10 Jakub Jelinek - - * objcopy.c (setup_section): Copy entsize. - -2001-12-07 Geoffrey Keating - - * readelf.c (guess_is_rela): Add support for stormy16. - (dump_relocations): Likewise. - (get_machine_name): Likewise. - -2001-12-05 Nick Clifton - - * dllwrap.c (main) Replace multiple strings describing a - single error with a single, newline escaped sentence to permit - better translation into foreign languages. - - * readelf.c (get_elf_class): Remove internalionalisation of ELF - class names. - -2001-12-04 Thiemo Seufer - - * strings.c (get_char): Initialize value. - -2001-12-04 Thiemo Seufer - - * arlex.l: Silence compile warnings. - * arsup.h: Likewise. Fix formatting. - -2001-12-04 Jakub Jelinek - - * strings.c: Include config.h before bfd.h. - (file_off): New type. - (file_open): Define. - (print_strings): Use file_off instead of file_ptr. Print addresses - which don't fit into long correctly. - (get_char): Use file_off instead of file_ptr. Use getc_unlocked if - available. - (strings_file): Use file_off instead of file_ptr. Use file_open. - * configure.in: Check for getc_unlocked. - Check for fopen64 and whether _LARGEFILE64_SOURCE needs to - be defined for it. - * configure: Rebuilt. - * config.h.in: Rebuilt. - -2001-11-29 H.J. Lu - - * bucomm.c (make_tempname): Revert the changes made on - 2001-11-14 and 2001-11-12. They won't work with directories. - -2001-11-23 John David Anglin - - * binutils/Makefile.am (check-DEJAGNU): Pass CC_FOR_TARGET and - CFLAGS_FOR_TARGET to runtest in environment. - * Makefile.in: Rebuild. - * doc/Makefile.in: Rebuild. - -2001-11-28 Mike Stump - - * objcopy.c (setup_section): Preserve SEC_RELOC when - --set-section-flags is used. - -2001-11-19 Nick Clifton - - * readelf.c (do_debug_str): New variable. - (display_debug_str): New function: Display the contents of a - .debug_str section. - (load_debug_str): New function: Load in the contents of a - .debug_str section. - (free_debug_str): New function: Free the memory used by - load_debug_str(). - (fetch_indirect_string): Retrieve a string from the .debug_str - section. - (usage): Add -ws. - (parse_args): Accept -ws. - (process_section_headers): Allow the display of the .debug_str - section. - (read_and_display_attr_value): Use fetch_indirect_string. Show - offset into .debug_str section. - (display_debug_info): Use load_debug_str and free_debug_str. - (debug_displays): Add .debug_str. - * doc/binutils.texi: Document -ws. - -2001-11-19 Andreas Jaeger - - * testsuite/binutils-all/objdump.exp: Add x86-64. - -2001-11-15 Andreas Schwab - - * readelf.c: Fix warnings without terminating newline. - -2001-11-15 Alan Modra - - * doc/binutils.texi (objdump): Document ppc -M options. - -2001-11-14 Andreas Jaeger - - * doc/binutils.texi (objdump): Fix description to use x86-64. - -2001-11-14 Nick Clifton - - * bucomm.c (make_tempname): Use mkstemps instead of mkstemp, since - not all systems provide mkstemp. - -2001-11-14 Alan Modra - - * doc/binutils.texi (objdump): Document x86 -M options. - -2001-11-13 Keith Walker - - * readelf.c (read_and_display_attr_value): New function to - handle DW_FORM_indirect. - (read_and_display_attr): Use it. - -2001-11-13 Geoffrey Keating - - * readelf.c (display_debug_lines): Deal with unknown standard - opcodes. Handle DW_LNS_set_prologue_end, DW_LNS_set_epilogue_begin, - DW_LNS_set_isa. - -2001-11-13 Timothy Wall - - * MAINTAINERS: Add self as tic54x maintainer. This target - includes the IBM C54XDSP clone. - -2001-11-12 * Steven J. Hill - - * bucomm.c (make_tempname): Use mkstemp in place of mktemp. - -2001-11-09 Jeffrey A Law (law@cygnus.com) - - * unwind-ia64.c (unw_print_brmask): Fix ISO C portability glitch. - (unw_print_grmask, unw_print_frmask, unw_print_abreg): Likewise. - (unw_print_xyreg, unw_decode_x1, unw_decode_x2): Likewise. - (unw_decode_x3, unw_decode_r1, unw_decode_r2): Likewise. - (unw_decode_r3, unw_decode_p1, unw_decode_p2_p5): Likewise. - (unw_decode_p6, unw_decode_p7_p10, unw_decode_b1): Likewise. - (unw_decode_b2, unw_decode_b3_b4): Likewise. - - * readelf.c (get_elf_class): Fix ISO portability glitch. - (get_data_encoding, get_osabi_name, request_dump): Likewise. - -2001-11-07 Jakub Jelinek - - * readelf.c (debug_str, debug_str_size): New. - (display_debug_abbrev): If no abbrevs were read, skip the CU. - Call free_abbrevs. - (read_and_display_addr): Handle DW_FORM_strp. - (display_debug_info): Read .debug_str section if present, - so that DW_FORM_strp can be handled. - Fix test for non-existant .debug_abbrev section. - -2001-11-05 Jakub Jelinek - - * arlex.l: Accept `\' in filenames. Patch by . - - * arsup.c (ar_open): Prepend tmp- to basename, not whole path. - -2001-11-05 Martin Schwidefsky - - * MAINTAINERS: Add self as s390/s390x maintainer. - -2001-11-02 Tom Rix - - * MAINTAINERS: Add self as PPC XCOFF maintainer. - -2001-11-02 Nick Clifton - - * configure.in (ALL_LINGUAS): Add "fr" and "tr". - * configure: Regernate. - * po/fr.po: New file. - * po/tr.po: New file. - -2001-10-30 Hans-Peter Nilsson - - * MAINTAINERS: Add self as MMIX port maintainer. - * readelf.c: Include elf/mmix.h. - (guess_is_rela): MMIX is RELA. - (dump_relocations): Handle MMIX relocations. - * Makefile.am: Regenerate dependencies. - * Makefile.in: Regenerate. - -2001-10-13 Nick Clifton - - * readelf.c (parse_args): Handle multiple options to the -w - switch. - -2001-10-12 Jakub Jelinek - - * readelf.c (get_section_type_name): Don't print SHT_ prefix for - LOPROC, LOOS and LOUSER. - -2001-10-11 J"orn Rennecke - - * MAINTAINERS: Update my email address. - -2001-10-03 Alan Modra - - * doc/Makefile.in: Regenerate. - * configure: Regenerate. - -2001-10-02 Nick Clifton - - * readelf.c (display_debug_line, display_debug_pubnames, - display_debug_info, display_debug_frames): Detect and warn - about 64-bit format entries. - (display_debug_aranges): Reword 64-bit warning. - (debug_displays): Add .debug_pubtypes as a known, but not yet - supported, debug section. - -2001-10-02 Alan Modra - - * coffdump.c (PROGRAM_VERSION): Delete. - (main <'V'>): Call print_version. - * srconv.c: Likewise. - * sysdump.c: Likewise. - * version.c (program_version): Remove. - (print_version): Use BFD_VERSION_STRING. Just print the current - year in copyright message. - * addr2line.c (program_version): Remove unused declaration. - * objdump.c (display_target_tables): Use BFD_VERSION_STRING in - place of BFD_VERSION. - * Makefile.am (Makefile): Depend on bfd/configure.in. - (cplus-dem.o): Depend on Makefile. - Run "make dep-am". - * Makefile.in: Regenerate. - -2001-10-01 Nick Clifton - - * readelf.c (display_debug_aranges): Detect and warn about DWARF64 - format .debug_arange sections. - (main): Add missing prototype. - -2001-09-30 Hans-Peter Nilsson - - * Makefile.am: Update dependencies with "make dep-am". - * Makefile.in: Regenerate. - -2001-09-28 Richard Henderson - - * objdump.c (dump_section_header): Dump SEC_ARCH_BIT_0. - -2001-09-26 Alan Modra - - * bucomm.c (fatal): Define using VPARAMS, VA_OPEN, VA_FIXEDARG, - VA_CLOSE. - (non_fatal): Likewise. - * objdump.c (objdump_sprintf): Likewise. - * readelf.c (error): Likewise. - (warn): Likewise. - -2001-09-25 Jakub Jelinek - - * readelf.c (do_wide): New. - (options): Add --wide. - (usage, parse_args): Likewise. - (process_program_headers): Put each segment on a single line if - --wide is given. - (process_section_headers): Put each section on a single line if - --wide is given. - * doc/binutils.texi: Document it. - * NEWS: Likewise. - -2001-09-25 Alan Modra - - * readelf.c (print_vma): Print 8 digits of low hex value. - -2001-09-24 Andreas Jaeger - - * nlmconv.c: Fix warnings about unused attributes and function - prototypes. - - * strings.c: Add prototype for get_char. - -2000-09-19 H.J. Lu - - * doc/Makefile.am ($(DEMANGLER_NAME).1): Try cxxfilt.man and - $(srcdir)/cxxfilt.man. - * doc/Makefile.in: Rebuild. - -2001-09-19 Alan Modra - - * objcopy.c (copy_main): Correct rename-section string parsing. - Consolidate new_name parsing, and error messages. - -2001-09-18 Bruno Haible - - * addr2line.c: Don't include . - (main): For gettext, also set the LC_CTYPE locate facet. - * ar.c (main): Likewise. - * coffdump.c (main): Likewise. - * dlltool.c: Include "safe-ctype.h" instead of . - (main): For gettext, also set the LC_CTYPE locate facet. - Use ISALNUM instead of isalpha/isdigit. - * dllwrap.c: Don't include . - (main): For gettext, also set the LC_CTYPE locate facet. - * nlmconv.c: Include "safe-ctype.h" instead of . - (main): For gettext, also set the LC_CTYPE locate facet. - Use TOUPPER instead of islower/toupper. - * nlmheader.y: Include "safe-ctype.h" instead of . - (yylex): Use ISSPACE/ISALNUM instead of isspace/isalnum. - Use TOUPPER instead of islower/toupper. - * nm.c (main): For gettext, also set the LC_CTYPE locate facet. - * objcopy.c (main): Likewise. - * objdump.c: Include "safe-ctype.h" instead of . - (disassemble_bytes): Use ISPRINT instead of isprint. - (dump_section_stabs): Use ISDIGIT instead of isdigit. - (dump_data): Use ISPRINT instead of isprint. - (main): For gettext, also set the LC_CTYPE locate facet. - * rclex.l: Include "safe-ctype.h" instead of . - (cpp_line, handle_quotes): Use ISSPACE instead of isspace. - * rcparse.y: Include "safe-ctype.h" instead of . - Use TOUPPER instead of islower/toupper. - * readelf.c (main): For gettext, also set the LC_CTYPE locate facet. - * resrc.c: Include "safe-ctype.h" instead of . - (write_rc_accelerators): Use ISPRINT instead of isprint. - (write_rc_rcdata): Likewise. - * size.c (main): For gettext, also set the LC_CTYPE locate facet. - * srconv.c (main): Likewise. - * stabs.c: Include "safe-ctype.h" instead of . - (parse_number): Use ISDIGIT/ISUPPER/ISLOWER instead of - isdigit/isupper/islower. - (parse_stab_string, parse_stab_type, parse_stab_argtypes, - parse_stab_array_type, stab_demangle_count, stab_demangle_get_count, - stab_demangle_prefix, stab_demangle_qualified, - stab_demangle_template, stab_demangle_type, - stab_demangle_fund_type): Use ISDIGIT instead of isdigit. - * strings.c: Include "safe-ctype.h" instead of . - (isgraphic): Use ISPRINT instead of isascii/isprint. - (main): Remove HAVE_LC_MESSAGES dependency. - * sysdump.c: Include "safe-ctype.h" instead of . - (pbarray): Use ISPRINT instead of isprint. - (main): For gettext, also set the LC_CTYPE locate facet. - * windres.c: Include "safe-ctype.h" instead of . - (format_from_filename): Use ISPRINT instead of isprint. - (main): For gettext, also set the LC_CTYPE locate facet. - * winduni.c: Include "safe-ctype.h" instead of . - (unicode_print): Use ISPRINT instead of isprint. - * wrstabs.c: Include "safe-ctype.h" instead of . - (stab_variable): Use ISDIGIT instead of isdigit. - -2001-09-18 Alan Modra - - * ar.c (print_contents): Cast args of bfd_seek to the right types. - Replace bfd_read call with call to bfd_bread. - (extract_file): Likewise. - - * objdump.c (dump_section_header): Cast section->filepos to - unsigned long to suit printf format string. - * readelf.c (process_section_headers): Similarly for sh_offset. - (process_unwind): Likewise. - -2001-09-14 Nick Clifton - - * strings.c (encoding, encoding_bytes): New variables. - (long_options): Add --encoding. - (main): Accept -e and --encoding. - (get_char): New function. Read a, possibly wide, character from - the input stream. - (print_strings): Use get_char(). - (usage): Document new command line option. - * doc/binutils.texi: Document new command line option. - * NEWS: Announce new command line option. - -2001-09-12 Alexandre Oliva - - * readelf.c (guess_is_rela, dump_relocations, get_machine_name, - get_machine_flags): Added EM_M32R, EM_D10V, EM_V850, EM_D30V, - EM_MN10200, EM_MN10300, EM_FR30, EM_AVR_OLD and EM_PJ_OLD. - Removed EM_CYGNUS_ARC. - -2001-09-04 Jeffrey A Law (law@cygnus.com) - - * readelf.c: Include elf/h8 for H8 series definitions. - (guess_is_rela): H8 series if RELA. - (dump_relocations): Handle H8 series relocations. - -2001-08-31 Eric Christopher - - * readelf.c (get_machine_flags): Remove E_MIPS_MACH_MIPS32_4K. - -2001-08-29 Peter Targett - - * MAINTAINERS: Include ARC Maintainer. - -2001-08-29 Ben Elliston - - * stabs.c (stab_demangle_template): Initialise s4. - -2001-08-27 Alan Modra - - * readelf.c (dump_relocations): Recognise EM_PPC64. - -2001-08-26 Thiemo Seufer - - * readelf.c (get_machine_flags): Add detection of EF_MIPS_32BITMODE. - -2001-08-25 H.J. Lu - - * nm.c (print_width): New. - (display_rel_file): Set `print_width' according to - bfd_sprintf_vma. - (print_symbol_info_bsd): Check `print_width' instead of BFD64. - -2001-08-24 Alexandre Oliva - - * objcopy.c (use_alt_mach_code): New variable. - (OPTION_ALT_MACH_CODE): Define. - (copy_options): Added --alt-machine-code. - (copy_main): Handle it. - (copy_object): Switch to alternate machine code if requested. - * doc/binutils.texi: Document new option. - * NEWS: Likewise. - -2001-08-22 Thiemo Seufer - - * readelf.c (get_machine_flags): Add detection of EF_MIPS_UCODE. - -2001-08-21 H.J. Lu - - * readelf.c (dump_relocations): Support ELF64 on 32bit hosts. - (display_debug_info): Cast for 64bit hosts. - (display_debug_frames): Likewise. - (process_mips_specific): Likewise. - -2001-08-21 Andreas Jaeger - - * coffgrok.h: Add missing parameter for prototype of coff_grok. - - * sysdump.c: Add missing prototypes. - * srconv.c: Likewise. - * unwind-ia64.c: Likewise. - * coffdump.c: Likewise. - - * sysinfo.y: Print prototypes, include . - - * coffgrok.c: Add missing prototypes, include libiberty.h instead - of declaring xcalloc. - -2001-08-10 H.J. Lu - - * nm.c (print_value): Add one arg, bfd *. - (print_value): Replace fprintf_vma with bfd_fprintf_vma. - (print_symbol_info_bsd): Also pass `abfd' to print_value (). - (print_symbol_info_sysv): Likewise. - (print_symbol_info_posix): Likewise. - - * objdump.c (dump_section_header): Replace printf_vma with - bfd_printf_vma. - (print_section_stabs): Likewise. - (dump_bfd_header): Likewise. - (objdump_print_value): Replace sprintf_vma with - bfd_sprintf_vma. - (disassemble_bytes): Likewise. - (dump_reloc_set): Likewise. - -2001-08-10 Andreas Jaeger - - * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes - to build warnings. - * configure: Regenerate. - -2001-08-09 Alan Modra - - * readelf.c: Add missing prototypes. - * objdump.c: Likewise. Format existing prototypes. - -2001-08-08 Alexandre Oliva - - * readelf.c (display_debug_info): Add to abbrev_offset the addend - of any RELA relocation for the abbrev_offset memory location that - refers to the .debug_abbrev section symbol. - -2001-08-07 H.J. Lu - - * readelf.c (process_file): Return 0 if OK, otherwise return 1. - (main): Return process_file (). - -2001-08-05 Philip Blundell - - * doc/binutils.texi: Use "Thumb" not "THUMB". - -2001-08-03 John Healy - - Patch suggested by Frank Eigler . - * objdump.c (disassemble_data): Fill in section member of the - disasm_info structure. - -2001-08-03 Tom Walsh - - * configure.in: Added --with-windres option. - * configure: Regenerated. - -2001-07-11 Stephane Carrez - - * doc/binutils.texi: Use @command{name} for commands; - use @option{-opt} for options; use @table @env for list of options; - remove spaces arround [ | ] in synopsis. - - * doc/Makefile.am (POD2MAN): Use 'GNU Development Tools' for the - center title. - -2001-07-31 Nick Clifton - - * objcopy.c: Fix formatting. - (section_rename): New structure. - (OPTION_RENAME_SECTION): New switch. - (copy_usage): Document new switch. - (add_section_rename): New function: Add a node to the section - rename list. - (find_section_rename): New function: Find the new name and - flags for a section. - (setup_section): Call find_section_name to determine the name - of the output section. - (copy_main): Handle OPTION_RENAME_SECTION. - * binutils.texi: Document new switch. - * NEWS: Mention new switch. - -2001-07-30 Nick Clifton - - * README: Rename bug-gnu-utils@gcc.org to bug-binutils@gcc.org. - * MAINTAINERS: Rename bug-gnu-utils@gcc.org to - bug-binutils@gcc.org. - -2001-07-28 Matthias Kramm - - * bucomm.c (list_supported_architectures): New function. - * bucomm.h (list_supported_architectures): Declare. - * objdump.c (usage): Call the above. - -2001-07-25 Dave Brolley - - * objdump.c (SKIP_ZEROES): Only define it if it is not already defined. - (SKIP_ZEROES_AT_END): Only define it if it is not already defined. - -2001-07-19 Nick Clifton - - * README: Update for 2.11. Change bug reporting email address. - * MAINTAINERS: Tidy up. Change bug reporting email address. - -2001-07-16 DJ Delorie - - * resres.c (write_res_header): Align header size. - (res_align_file): Calculate alignment correctly. - - * rcparse.y (styles): use SUBLANG_SHIFT instead of 8 (or the more - correct 10). - * resrc.c (write_rc_resource): Likewise. - * windres.h (SUBLANG_SHIFT): Define - as 10. - -2001-07-15 Nick Clifton - - * MAINTAINERS: Add Christian Groessler as maintainer for z8k port. - -2001-07-11 Nick Clifton - - * MAINTAINERS: Add notes about branch checkins. - -2001-07-05 Daniel Berlin - - * readelf.c (display_debug_macinfo): New function, display - .debug_macinfo section. - (do_debug_macinfo): New variable. - (parse_args): Handle "-w[mM]" to mean display macro info. - (process_section_headers): Handle debug_macinfo. - (debug_displays): Replace unsupported function with macinfo - function for .debug_macinfo display. - * doc/binutils.texi: Document new command line switch. - * NEWS: Document new feature of readelf. - -2001-07-05 H.J. Lu - - * objcopy.c (filter_symbols): Don't turn undefined symbols - into local. - -2001-07-03 H.J. Lu - - * doc/Makefile.am (addr2line.1): Use addr2line.pod instead of - $@.pod. - (ar.1): Likewise. - (dlltool.1): Likewise. - (nlmconv.1): Likewise. - (nm.1): Likewise. - (objcopy.1): Likewise. - (objdump.1): Likewise. - (ranlib.1): Likewise. - (readelf.1): Likewise. - (size.1): Likewise. - (strings.1): Likewise. - (strip.1): Likewise. - (windres.1): Likewise. - (cxxfilt.man): Use $(DEMANGLER_NAME).pod instead of $@.pod. - ($(DEMANGLER_NAME).1): Also substitute cxxfilt with - $(DEMANGLER_NAME). - (as.1): Removed. - * doc/Makefile.in: Regenerated. - -2001-07-03 Nick Clifton - - * MAINTAINERS: Change MIPS maintainer to Eric Christopher. - -2001-07-01 Daniel Berlin - - * readelf.c: Support DWARF 2.1 tags, encodings, languages. - -2001-06-29 James Cownie - - * readelf.c: Support DWARF 2.1 attributes. - -2001-06-28 Alan Modra - - * readelf.c (GET_DATA_ALLOC): Remove. - (GET_DATA): Remove. - (get_data): New function combining above macros, with an extra - test for zero size. - (slurp_rela_relocs): Use get_data, and catch error return. - (slurp_rel_relocs): Likewise. - (get_32bit_program_headers): Likewise. - (get_64bit_program_headers): Likewise. - (get_32bit_section_headers): Likewise. - (get_64bit_section_headers): Likewise. - (get_32bit_elf_symbols): Likewise. - (get_64bit_elf_symbols): Likewise. - (process_section_headers): Likewise. - (process_relocs): Likewise. - (slurp_ia64_unwind_table): Likewise. - (process_unwind): Likewise. - (get_32bit_dynamic_segment): Likewise. - (get_64bit_dynamic_segment): Likewise. - (process_dynamic_segment): Likewise. - (process_version_sections): Likewise. - (process_symbol_table): Likewise. - (dump_section): Likewise. - (display_debug_info): Likewise. - (display_debug_section): Likewise. - (process_section_contents): Likewise. - (process_corefile_note_segment): Likewise. - (process_mips_specific): Likewise. Also free econf32, econf64. - -2001-06-25 Alan Modra - - * readelf.c (dump_relocations): Print "bad symbol index" if - symtab == NULL with non-zero symtab_index. - (process_relocs): Don't bomb if reloc section has no symsec. - -2001-06-24 H.J. Lu - - * objcopy.c (strip_main): Revert the change made on 2001-05-30 - by accident. - (copy_main): Apply the the change made to strip_main on - 2001-05-30 by accident. - -2001-06-23 Andreas Jaeger - - * unwind-ia64.c (unw_decode_x1): Add unused attribute for - parameter 'code'. - (unw_decode_x2): Likewise. - (unw_decode_x3): Likewise. - (unw_decode_x4): Likewise. - -2001-06-23 Ben Elliston - - * MAINTAINERS: Add myself as M88k maintainer. - -2001-06-22 Jocelyn Mayer - - * objcopy.c (strip_main): Support -o or --output-file command lien - switch. - -2001-06-19 H.J. Lu - - * doc/Makefile.in: Regenerated. - -2001-06-19 Nick Clifton - - * readelf.c: Restore formatting. - -2001-06-18 H.J. Lu & Nick Clifton - - * Makefile.am: Move documentation into doc subdirectory. - * Makefile.in: Regenerated. - * binutils.texi: Move into doc subdirectory. - * addr2line.1: Removed. - * ar.1: Likewise. - * dlltool.1: Likewise. - * nlmconv.1: Likewise. - * nm.1: Likewise. - * objcopy.1: Likewise. - * objdump.1: Likewise. - * ranlib.1: Likewise. - * readelf.1: Likewise. - * size.1: Likewise. - * strings.1: Likewise. - * strip.1: Likewise. - * windres.1: Likewise. - * cxxfilt.man: Likewise. - * doc: New Directory. - * doc/Makefile.am: New file. - * doc/Makefile.in: Generate. - -2001-06-09 Alan Modra - - * NEWS: Fix a typo. Mention hppa64-elf. Add binutils-2.11 marker. - -2001-06-01 Alan Modra - - * MAINTAINERS: Update my email address. - -2001-05-30 Honda Hiroki - - * objcopy.c: Add new switches: --keep-global-symbol, - --keep-symbols, --localize-symbols, --keep-global-symbols and - --weaken-symbols. - * binutils.texi: Document new switches. - * objcopy.1: Regenerate. - * NEWS: Announce new feature. - -2001-05-28 Andreas Jaeger - - * readelf.c (display_debug_frames): Fix warnings: Remove unused - variables, fix format strings. - -2001-05-28 Nick Clifton - - * objdump.c (disassemble_bytes): Remove section VMA adjustment - when computing the address of the line to show. - -2001-05-16 Richard Henderson - - * readelf.c (do_debug_frames_interp): New. - (byte_get_little_endian): If BFD64, always read entire 8-byte fields. - (byte_get_big_endian): Likewise. - (parse_args) ['F']: Set do_debug_frames_interp. - (Frame_Chunk): Make data_factor signed, add fde_encoding. - (frame_display_row): Don't trunc pc_begin to int. - (size_of_encoded_value): New. - (display_debug_frames): Handle 64-bit targets. Print raw data - unless do_debug_frames_interp. - (debug_displays): Remove duplicate .debug_frame. - -2001-05-15 Ralf Baechle - - * readelf.c: Replace uses of EM_MIPS_RS4_BE with EM_MIPS_RS3_LE. - The former constant was never in active use and is used otherwise - by the ABI. - -2001-05-11 Jakub Jelinek - - * readelf.c (process_unwind): Print all unwind sections, not just - one. - -2001-05-07 Thiemo Seufer - - * readelf.c (process_unwind): Remove const specifier. - -2001-04-27 Michal Svec - - * strings.c (isgraphic): Do not use isascii() unless it is needed - for isprint() to work. - (main): Set the locale domain to LC_ALL not just LC_MESSAGES. - -2001-04-27 Johan Rydberg - - * NEWS: Announce support for OpenRISC. - -2001-04-17 Danny Smith - - * dlltool.c (do_default_excludes): Initialise to true. - -2001-04-10 Alan Modra - - * MAINTAINERS: Update my email address - * nm.c (print_symbol_info_bsd): Use a simple printf string. - -2001-04-05 Hans-Peter Nilsson - - * readelf.c (display_debug_lines): Fix typo for "Prologue". - -2001-03-30 H.J. Lu - - * readelf.c (process_unwind): Just return if do_unwind is 0. - -2001-03-28 Roger Sayle - - * dlltool.c (make_one_lib_file): Fix section flags for - .text, .data and .bss in stub ds*.o files to match those - generated by gas. - -2001-03-29 H.J. Lu - - * readelf.c (process_unwind): Only do unwind sections for - IA64. - -2001-03-28 H.J. Lu - - * Makefile.am ($(srcdir)/dlltool.1): Remove the extra target. - * Makefile.in: Regenerate. - -2001-03-26 Andreas Jaeger - - * binutils.texi (nm): Fix texi syntax. - -2001-03-25 Stephane Carrez - - * binutils.texi: Put @c man begin and @c man end indications - to generate man pages using texi2pod and pod2man. Put @c man title - to identify each man. Add SEEALSO entries. - * Makefile.am (MANCONF, TEXI2POD, POD2MAN): New variable. - (man_MANS): Add dlltool.1, nlmconv.1, readelf.1, windres.1, - sort the list. - (*.1): Build the man pages from binutils.texi. - * Makefile.in: Regenerate. - -2001-03-13 Eric Kohl - - * defparse.y (opt_equal_name): allow "." in name. - * dlltool.c (def_exports): Added ability to generate forwarded exports. - (gen_exp_file): Likewise. - -2001-03-12 Stefan Geuken - - * NEWS: Document addition of -B switch to objcopy. - * binutils.texi: Document addition of -B switch to objcopy. - * objcopy.c: (copy_options): Add --binary-architecture. - (copy_usage): Document -B/--binary-architecture. - (copy_main): Support -B/--binary-architecture. Set - bfd_external_binary_architecture. - -2001-03-11 Andreas Jaeger - - * readelf.c (guess_is_rela): Handle EM_S390_OLD. - (dump_relocations): Likewise. - (get_machine_name): Likewise. - -2001-02-28 Nick Clifton - - * readelf.c: (struct unw_aux_info): Remove const modifier for - 'strtab' field. - (process_unwind): Remove non-K&R compliant LHS type cast in call - to GET_DATA_ALLOC macro. - -2001-02-28 Philip Blundell - - * readelf.c (decode_ARM_machine_flags): Explicitly mention which - ABI is in use; remove ambiguity between the "unknown" EABI and - unrecognised ABIs. Handle version 2 ARM EABI. Update uses of - renamed EF_xx constants. - -2001-02-27 Alan Modra - - * configure.in (BFD_VERSION): New. - (AM_INIT_AUTOMAKE): Use $BFD_VERSION. - * configure: Regenerate. - * Makefile.am: Run "make dep-am" - * Makefile.in: Regenerate. - -2001-02-14 Nick Clifton - - * MAINTAINERS: Add "Obvious Fix" rule. - -2001-02-11 Michael Sokolov - - * unwind-ia64.c: Don't use ANSI C preprocessor stringisation and string - literal concatenation. - -2001-02-11 Michael Sokolov - - * readelf.c (struct unw_aux_info): Remove const from the info member. - (process_unwind): Don't type-cast the third argument to the - GET_DATA_ALLOC macro. - -2001-02-11 Nick Clifton - - * readelf.c (dump_relocations): Free corrected allocated - array. - (process_unwind): Fix compile time warning. - -2001-02-10 Nick Clifton - - * binutils.texi: Document new --unwind option to readelf. - -2001-02-09 Martin Schwidefsky - - * readelf.c: Add linux target for S/390. - -2001-02-10 Alan Modra - - * nm.c (print_symbol_info_bsd): Don't #ifdef inside printf in case - printf is a macro. - -2001-02-08 Hans-Peter Nilsson - - * acinclude.m4 (AM_PROG_LEX): Override installed definition. - * aclocal.m4: Regenerate. - * configure: Regenerate. - -2001-02-07 Todd Vierling - - * bucomm.c (bfd_target_vector): Change extern array to pointer. - * objdump.c (bfd_target_vector): Likewise. - -2001-02-07 David Mosberger - - * readelf.c (process_unwind): New function. - (slurp_ia64_unwind_table): Ditto. - (dump_ia64_unwind): Ditto. - (find_symbol_for_address): Ditto. - (slurp_rela_relocs): New function (split off from dump_relocations()). - (slurp_rel_relocs): Ditto. - (parse_args): Handle '-u' option. - - * unwind-ia64.c: New file. - * unwind-ia64.h: New file. - * Makefile.am: Include unwind-ia64.c in readelf build. - * Makefile.in: Regenerate. - * po/binutils.pot: Regenerate. - -2001-02-04 Philip Blundell - - * 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. - -2000-12-11 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. - -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. - -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.texi: Put back "@end table" deleted by - accident. - -2000-07-05 Kenneth Block - - * nm.c: Add optional style to demangle switch. - * objdump.c: Add optional style to demangle switch. - * addr2line.c: Add optional style to demangle switch. - * 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. - -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. - -2000-07-19 H.J. Lu - - * readelf.c (get_dynamic_type): Fix DT_CHECKSUM. - -2000-07-19 H.J. Lu - - * readelf.c (get_dynamic_type): Change DT_FEATURE_1 to - DT_FEATURE. - (process_dynamic_segment): Likewise. - - * readelf.c (get_dynamic_type): Handle DT_CONFIG, DT_DEPAUDIT, - DT_AUDIT, DT_PLTPAD, DT_MOVETAB and DT_CHECKSUM. - (process_dynamic_segment): Handle DTF_1_CONFEXP, DF_1_NODEPLIB, - DF_1_NODUMP and DF_1_CONLFAT. - -2000-07-18 Nick Clifton - - * binutils.texi (readelf): Fix spelling typo. - -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. - -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. - -2000-06-22 Alan Modra - - * Makefile.am (DEP): grep for leading `/' in DEP1, and fail if we - find one. - * Makefile.in: Regenerate. - -2000-06-20 Alexander Aganichev - - * ar.c (normalize): Correct pointer comparison when checking for - backslashes. - (main): Likewise. - * bucomm.c (make_tempname): Likewise. - - * ieee.c (ieee_start_compilation_unit): Correct pointer comparison - and search for backslashes in the original pathname. - (ieee_add_bb11): Likewise. - -2000-06-18 Nick Clifton - - * ar.c (print_contents): Improve verbose message. - -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. - (normalize) [HAVE_DOS_BASED_FILE_SYSTEM]: Support backslashes - and drive letters in file names. - (main): Support backslashes and drive letters in argv[0]. Drop - the .exe suffix, if any, in argv[0] if is_ranlib is negative. Use - FILENAME_CMP instead of strcmp to compare file names. - (open_inarch) [__GO32__]: Don't ifdef errno != ENOENT test for - DJGPP v2. - (do_quick_append) [__GO32__]: Ditto. - (get_pos_bfd, delete_members, move_members, replace_members): - Compare file names with FILENAME_CMP. - - * bucomm.c: Include filenames.h. - (make_tempname) [HAVE_DOS_BASED_FILE_SYSTEM]: Support mixed - forward/backward slashes and drive letters in file names. - - * ieee.c (ieee_start_compilation_unit, ieee_add_bb11): Support - mixed forward/backward slashes and drive letters in file names. - - * strings.c (O_BINARY, setmode, SET_BINARY): Define. - (main) [SET_BINARY]: Use SET_BINARY to switch stdin into binary - mode. - - * objcopy.c: Include filenames.h. - (main) [HAVE_DOS_BASED_FILE_SYSTEM]: Drop the .exe suffix - before comparing to "strip". - Use FILENAME_CMP to compare file names. - - * arsup.c: Include filenames.h. - (map_over_list, ar_delete, ar_replace, ar_extract): Use - FILENAME_CMP to compare file names. - (ar_open): Prepend "tmp-" instead of appending "-tmp", to create - the temporary file name. - - * configure.in: Check for setmode. - * configure: Regenerate. - -2000-05-24 Alan Modra - - * objdump.c (display_target_list): Close the bfd. - (display_info_table): Likewise. - -2000-05-14 H.J. Lu (hjl@gnu.org) - - * 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 - - * readelf.c (get_osabi_name): Handle ELFOSABI_NONE instead of - ELFOSABI_SYSV. Also handle ELFOSABI_NETBSD, ELFOSABI_HURD, - ELFOSABI_SOLARIS, ELFOSABI_MONTEREY, ELFOSABI_IRIX, - 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. - -2000-04-23 Denis Chertykov - - * readelf.c (guess_is_rela): AVR uses RELA relocations. - (get_machine_name): machine name for EM_AVR added. - -2000-04-21 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. - -2000-04-10 Philippe De Muyter - - * readelf.c (dynamic_segment_mips_val): Call `sprintf', not - `strftime' since strftime is not available on all systems. - (process_mips_specific): Ditto. - -2000-04-07 Andrew Cagney - - * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add - --enable-build-warnings option. - * Makefile.am (AM_CFLAGS, WARN_CFLAGS): Add definitions. - * Makefile.in, configure: Re-generate. - -2000-04-06 Alan Modra - - * addr2line.c: Update copyright. - * objcopy.1: Likewise, and title. - * strings.1: Likewise. - - * version.c (print_version): Add 2000. - - * rddbg.c (read_section_stabs_debugging_info): Don't use - bfd_size_type for strx to avoid printf problems if BFD64. - - * bucomm.c: (report): Remove `static'. - Move inclusion of stdarg.h/vararg.h from here. - * bucomm.h: To here. - (CONST): Change all occurences to const. - (report): Declare it. - (bfd_fatal): Add ATTRIBUTE_NORETURN. - (fatal): Add ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN. - (non_fatal): Add ATTRIBUTE_PRINTF_1. - - * ar.c (main): Use fatal or non_fatal instead of fprintf. - Correct a typo in an error message. - (do_quick_append): Use non_fatal instead of fprintf. - (move_members): Use fatal instead of fprintf, exit. - * coffdump.c (main): Same here. - - * dlltool.c (display): Delete. - (warn): Delete. - (inform): Use `report' instead of `display'. - (rvaafter): Remove trailing \n from fatal error msg. - (rvabefore): Ditto. - (asm_prefix): Ditto. - (yyerror): Replace `warn' with `non_fatal', and remove \n. - (def_name): Likewise. - (run): Likewise. - (scan_all_symbols): Likewise. - (gen_lib_file): Likewise. - (def_library): Likewise. Remove extra program_name too. - (run): Remove \n from inform strings. - (scan_drectve_symbols): Likewise. - (add_excludes): Likewise. - (scan_open_obj_file): Likewise. - (gen_exp_file): Likewise. - (gen_lib_file): Likewise. - (process_duplicates): Likewise. - - * Makefile.am (dllwrap_SOURCES): Add version.c. - * dllwrap.c (program_version): Delete. - (print_version): Delete. - (display): Always print trailing \n. - (warn): New. - (delete_temp_files): Use warn instead of fprintf. Use gettext. - (run): Here too. - (main): And here. - (usage): gettext'ify. - (long_options): Add missing initialisers. - - * nlmconv.c (main): Use fatal/non_fatal instead of fprintf. - (select_output_format): Likewise. - (powerpc_mangle_relocs): Likewise. - (link_inputs): Likewise. - - * nm.c (set_print_radix): Use fatal instead of fprintf, exit. - (set_output_format): Likewise. - (main): Use non_fatal instead of fprintf. - (display_rel_file): Likewise. - - * objdump.c (slurp_symtab): Use non_fatal instead of fprintf. - (slurp_dynamic_symtab): Same here. - (disassemble_data): And here. - (read_section_stabs): And here. - (read_section_stabs): And here. - (dump_bfd): And here. - (main): And here. - (objdump_sprintf): Use fatal instead of fprintf, exit. - (disassemble_data): Same here. - - * rdcoff.c (parse_coff_type): Use non_fatal instead of fprintf. - (parse_coff_struct_type): Same here. - (parse_coff_enum_type): And here. - (parse_coff): And here. - * rddbg.c (read_debugging_info): And here. - * size.c (main): And here. - * windres.c (format_from_name): And here. - * wrstabs.c (stab_write_symbol): Here too. - (write_stabs_in_sections_debugging_info): And here. - (stab_int_type): And here. - (stab_struct_field): And here. - (stab_typdef): And here. - - * rescoff.c (read_coff_rsrc): Use fatal instead of fprintf, exit. - * srconv.c (main): Same here. - * strings.c (main): And here. - (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 - an `=' in the argument. - * objcopy.1: Here too. Remove extra space on discard-all. - - * binutils.texi (objcopy): Mention --redefine-sym. - * objcopy.1: Here too. - * NEWS: And here. - - * objcopy.c (parse_flags): Split off flag names from error message - gettext as they are not translated. - (copy_main): Similarly split off option name for --add-section, - --set-section-flags, --change-section-vma, --change-section-lma - error messages. - Some white space changes. - - from Matthew Benjamin - * objcopy.c (struct redefine_node): New. - (redefine_sym_list): New. - (redefine_list_append): New. - (lookup_sym_redefinition): New. - (OPTION_REDEFINE_SYM): New. - (copy_options): Add --redefine-sym option. - (copy_usage): Mention it. - (filter_symbols): Rename symbols on redefine_sym_list. - (copy_object): Call filter_symbols if redefine_sym_list != NULL. - (copy_main): Handle OPTION_REDEFINE_SYM. - -2000-04-04 H.J. Lu - - * readelf.c (process_symbol_table): Correctly read in symbol - versioning information. - -2000-04-04 Alan Modra - - * po/binutils.pot: Regenerate. - - * addr2line.c (usage): Restore translated part of bug string. - * 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. - * readelf.c (usage): Likewise. - * size.c (usage): Likewise. - * strings.c (usage): Likewise. - * windres.c (usage): Likewise. - - * Makefile.am (MKDEP): Use gcc -MM rather than mkdep. - (DEP): Quote when passing vars to sub-make. Add warning - message to end. - (DEP1): Rewrite for "gcc -MM". - (CLEANFILES): Add DEP2. - Update dependencies. - * Makefile.in: Regenerate. - -2000-04-04 H.J. Lu - - * Makefile.am (GENERATED_HFILES): Add rcparse.h - (arparse.h): Depend on arparse.c - (defparse.h, nlmheader.h, rcparse.h, sysinfo.h): Similarly. - -2000-04-03 H.J. Lu (hjl@gnu.org) - - * size.c (usage): Use REPORT_BUGS_TO. - -2000-04-03 Alan Modra - - * bucomm.h: #include "bin-bugs.h" - * addr2line.c (usage): Use REPORT_BUGS_TO. - * ar.c (usage): Likewise. - * nlmconv.c (show_usage): Likewise. - * nm.c (usage): Likewise. - (OPTION_TARGET): Define. - (long_options): Use OPTION_TARGET rather than 200. - (main): Likewise. - - * objcopy.c (copy_usage): Use REPORT_BUGS_TO. - (strip_usage): Likewise. - * objdump.c (usage): Likewise. - * readelf.c (usage): Likewise. - * strings.c (usage): Likewise. - * windres.c (usage): Likewise. - -2000-03-31 John David Anglin - - * readelf.c: Include sys/types.h before sys/stat.h for ultrix. - -2000-03-27 Nick Clifton - - * rddbg.c (read_section_stabs_debugging_info): Catch out of range - string offsets in corrupt stabs entries. - -2000-03-27 Alan Modra - - * readelf.c: Include elf/avr.h - (dump_relocations): Add EM_AVR case. - -2000-03-09 Tim Waugh - - * strings.1: Correct '-bytes' to '--bytes'. - -2000-03-08 H.J. Lu - - * Makefile.am (install-exec-local): Depend on - install-binPROGRAMS for parallel make. - * Makefile.in: Regenerated. - -2000-02-27 Ian Lance Taylor - - From Brad Lucier : - * readelf.c (process_dynamic_segment): Add cast to make sure - argument to %* is int. - -2000-02-25 H.J. Lu - - * configure.in (AC_SEARCH_LIBS): Pass m, not -lm. - -2000-02-24 Nick Clifton - - * configure.in: Add arm-wince, mips-pe and sh-pe targets. - * configure: Regenerate. - - * dlltool.c: Add support for sh-pe and mips-pe targets. - * rescoff.c: Add support for sh-pe and mips-pe targets. - -2000-02-23 H.J. Lu - - * readelf.c (get_osabi_name): Handle ELFOSABI_LINUX. - -2000-02-22 Nick Clifton - - * readelf.c (process_symbol_table): Remove use of ELF_ST_OTHER. - -2000-02-22 Ian Lance Taylor - - From Brad Lucier : - * readelf.c (process_version_sections): Add casts to make sure - argument to %* is an int. - (process_mips_specific): Add casts to make printf arguments match - format. - -2000-02-21 Alan Modra - - * objdump.c (dump_section_header): Change `opb' to unsigned. - (find_symbol_for_address): Same here. - (disassemble_data): And here. Change `addr_offset', - `stop_offset', `nextstop_offset' to unsigned long. - (dump_data): Change opb to unsigned. - -2000-02-18 Frank Ch. Eigler - - * resrc.c: Remove unmatched #if for cygwin. - -2000-02-14 Fernando Nasser - - * binutils.texi: Document the change of flavor name from atpcs-special - to special-atpcs to prevent name conflict in gdb. - -2000-02-08 Timothy Wall - - * objdump.c (show_line): Fix bug preventing printing of the very - first line (line zero) of a file when interlisting source and - assembly. Added option to print entire context from start of file - when the first line from that file is encountered. - -2000-02-03 Timothy Wall - - * 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 - check to unresolved symbols. - (print_symbol_info_sysv): Ditto. - (print_symbol_info_posix): Ditto. - - * binutils.texi: Document new 'V' symclass flag for nm. - -2000-01-27 Nick Clifton - - * binutils.texi (objdump): Document new ARM specific - disassembler options. - - * objdump.c (usage): Call disassembler_usage(). - -2000-01-27 Alan Modra - - * readelf.c (get_dynamic_flags): Return buff. - (process_dynamic_segment): Don't pass error strings to printf - as format arg. - (read_and_display_attr): Use lx and ld to print longs. - (process_corefile_note_segment): Cast bfd_vma to unsigned long - before printing. - Update copyright. - -2000-01-17 Nick Clifton - - * readelf.c (get_osabi_name): Recognise ELFOSABI_ARM. - -2000-01-15 Alan Modra - - * debug.c (debug_name_type): Return DEBUG_TYPE_NULL rather than - false. - (debug_tag_type): Here too. - * ieee.c (ieee_builtin_type): And here. - * stabs.c (parse_stab_type, parse_stab_array_type): And here. - -2000-01-13 Nick Clifton - - * readelf.c (get_machine_name): Change EM_S370 to return "IBM - System/370". - -2000-01-11 Nick Clifton - - * readelf.c (get_dynamic_type): Remove DT_ENCODING. - -2000-01-10 Nick Clifton - - * readelf.c (get_note_type): Display NT_WIN32PSTATUS notes. - -2000-01-07 Mumit Khan - - * 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 - open_input_stream instead of popen. - (read_rc_file): Likewise. - - * binutils.texi: Document --use-temp-file, --no-use-temp-file - options. - -2000-01-04 Mumit Khan - - * dlltool.c (create_compat_implib): New variable. - (gen_exp_file): Use. - (make_one_lib_file): Use. - (long_options): Add --compat-implib option. - (usage): Handle. - (main): Handle. - - * dllwrap.c (enum target_type): Rename MINGW32_TARGET to MINGW_TARGET. - (main): Use. Don't look for "32" in cygwin and mingw target names. - -2000-01-03 Nick Clifton - - * binutils.texi: Document new, ARM specific disassembler - command line switch "-M force-thumb". - -For older changes see ChangeLog-9899 +For older changes see ChangeLog-0203 Local Variables: mode: change-log diff --git a/contrib/binutils/binutils/ChangeLog-0001 b/contrib/binutils/binutils/ChangeLog-0001 new file mode 100644 index 0000000..9d14894 --- /dev/null +++ b/contrib/binutils/binutils/ChangeLog-0001 @@ -0,0 +1,2060 @@ +2001-12-20 Julian v. Bock + + * readelf.c (print_symbol): New function: Print a formatted symbol + name. If --wide is specified do not truncate it. + (dump_relocations): Use print_symbol() to print symbol names. + (process_symbol_table): Likewise. + (process_syminfo): Likewise. + (process_mips_specific): Likewise. + (usage): Document new feature of --wide switch. + * doc/binutils.texi (objdump): Document additional behaviour of + --wide. + +2001-12-18 Michael Snyder + + * objcopy.c (copy_file): Accept corefiles (format bfd_core). + (copy_object): Don't set the start address or flags of a core file. + (copy_section): Don't relocate a core file. Don't copy contents + if the input section has the contents flag set, but the output + section does not (which happens with the fake 'note' pseudo- + sections that BFD creates for corefiles). + +2001-12-18 Thiemo Seufer + + * readelf.c (get_machine_flags): Recognize header flags for ABI and + ASE extensions. More robust code for ISA checking. Ignore empty fields + in header flags for GNU extensions. + +2001-12-18 Alan Modra + + * objcopy.c (copy_archive): Set output bfd format outside the loop. + +2001-12-18 Nick Clifton + + * po/ja.po: Import from translation project. + * configure.in (ALL_LINGUAS): Add ja. + * configure: Regenerate. + +2001-12-18 Thiemo Seufer + + * addr2line.c (main): Protoype. + * ar.c (main): Protoype. + * nm.c (main): Protoype. + * objcopy.c (main): Protoype. + * objdump.c (main): Protoype. + * size.c (main): Protoype. + * strings.c (main): Protoype. + +2001-12-17 Alan Modra + + * readelf.c (symtab_shndx_hdr): New global. + (SECTION_HEADER_INDEX): Define. + (SECTION_HEADER_NUM): Define. + (SECTION_HEADER): Define. + (GET_ELF_SYMBOLS): Pass two params rather than three. + (get_32bit_elf_symbols): Take file and section args. Read and + use SHT_SYMTAB_SHNDX. + (get_64bit_elf_symbols): Likewise. + (dump_relocations): Use SECTION_HEADER to index "section_headers". + (process_section_headers): Likewise. Use SECTION_HEADER_NUM too. + Remember symtab_shdx_hdr. + (process_program_headers): Scan from index 1 for segment map. + (slurp_ia64_unwind_table): Use SECTION_HEADER to index + "section_headers". + (process_relocs): Likewise. Also adjust call to GET_ELF_SYMBOLS. + (process_unwind): Likewise. + (process_version_sections): Likewise. + (process_symbol_table): Likewise. + (display_debug_info): Likewise. + (process_dynamic_segment): Fake up a symtab section for changed + GET_ELF_SYMBOLS. + (get_symbol_index_type): Check SHN_LOOS before SHN_LORESERVE. + (process_program_headers): Kill signed/unsigned warning. + (load_debug_str): Likewise. + (display_debug_info): Likewise. + +2001-12-13 Jakub Jelinek + + * readelf.c (get_segment_type): Support PT_GNU_EH_FRAME. + +2001-12-11 Alan Modra + + * readelf.c (process_file_header): Print extended e_shnum and + e_shdtrndx values. Set elf_header values for same. + (get_32bit_section_headers): Add "num" arg to read "num" headers. + (get_64bit_section_headers): Likewise. + (process_section_headers): Update calls. + (get_file_header): Call get_32bit_section_headers or 64bit variant. + +2001-12-10 Jakub Jelinek + + * objcopy.c (setup_section): Copy entsize. + +2001-12-07 Geoffrey Keating + + * readelf.c (guess_is_rela): Add support for stormy16. + (dump_relocations): Likewise. + (get_machine_name): Likewise. + +2001-12-05 Nick Clifton + + * dllwrap.c (main) Replace multiple strings describing a + single error with a single, newline escaped sentence to permit + better translation into foreign languages. + + * readelf.c (get_elf_class): Remove internalionalisation of ELF + class names. + +2001-12-04 Thiemo Seufer + + * strings.c (get_char): Initialize value. + +2001-12-04 Thiemo Seufer + + * arlex.l: Silence compile warnings. + * arsup.h: Likewise. Fix formatting. + +2001-12-04 Jakub Jelinek + + * strings.c: Include config.h before bfd.h. + (file_off): New type. + (file_open): Define. + (print_strings): Use file_off instead of file_ptr. Print addresses + which don't fit into long correctly. + (get_char): Use file_off instead of file_ptr. Use getc_unlocked if + available. + (strings_file): Use file_off instead of file_ptr. Use file_open. + * configure.in: Check for getc_unlocked. + Check for fopen64 and whether _LARGEFILE64_SOURCE needs to + be defined for it. + * configure: Rebuilt. + * config.h.in: Rebuilt. + +2001-11-29 H.J. Lu + + * bucomm.c (make_tempname): Revert the changes made on + 2001-11-14 and 2001-11-12. They won't work with directories. + +2001-11-23 John David Anglin + + * binutils/Makefile.am (check-DEJAGNU): Pass CC_FOR_TARGET and + CFLAGS_FOR_TARGET to runtest in environment. + * Makefile.in: Rebuild. + * doc/Makefile.in: Rebuild. + +2001-11-28 Mike Stump + + * objcopy.c (setup_section): Preserve SEC_RELOC when + --set-section-flags is used. + +2001-11-19 Nick Clifton + + * readelf.c (do_debug_str): New variable. + (display_debug_str): New function: Display the contents of a + .debug_str section. + (load_debug_str): New function: Load in the contents of a + .debug_str section. + (free_debug_str): New function: Free the memory used by + load_debug_str(). + (fetch_indirect_string): Retrieve a string from the .debug_str + section. + (usage): Add -ws. + (parse_args): Accept -ws. + (process_section_headers): Allow the display of the .debug_str + section. + (read_and_display_attr_value): Use fetch_indirect_string. Show + offset into .debug_str section. + (display_debug_info): Use load_debug_str and free_debug_str. + (debug_displays): Add .debug_str. + * doc/binutils.texi: Document -ws. + +2001-11-19 Andreas Jaeger + + * testsuite/binutils-all/objdump.exp: Add x86-64. + +2001-11-15 Andreas Schwab + + * readelf.c: Fix warnings without terminating newline. + +2001-11-15 Alan Modra + + * doc/binutils.texi (objdump): Document ppc -M options. + +2001-11-14 Andreas Jaeger + + * doc/binutils.texi (objdump): Fix description to use x86-64. + +2001-11-14 Nick Clifton + + * bucomm.c (make_tempname): Use mkstemps instead of mkstemp, since + not all systems provide mkstemp. + +2001-11-14 Alan Modra + + * doc/binutils.texi (objdump): Document x86 -M options. + +2001-11-13 Keith Walker + + * readelf.c (read_and_display_attr_value): New function to + handle DW_FORM_indirect. + (read_and_display_attr): Use it. + +2001-11-13 Geoffrey Keating + + * readelf.c (display_debug_lines): Deal with unknown standard + opcodes. Handle DW_LNS_set_prologue_end, DW_LNS_set_epilogue_begin, + DW_LNS_set_isa. + +2001-11-13 Timothy Wall + + * MAINTAINERS: Add self as tic54x maintainer. This target + includes the IBM C54XDSP clone. + +2001-11-12 * Steven J. Hill + + * bucomm.c (make_tempname): Use mkstemp in place of mktemp. + +2001-11-09 Jeffrey A Law (law@cygnus.com) + + * unwind-ia64.c (unw_print_brmask): Fix ISO C portability glitch. + (unw_print_grmask, unw_print_frmask, unw_print_abreg): Likewise. + (unw_print_xyreg, unw_decode_x1, unw_decode_x2): Likewise. + (unw_decode_x3, unw_decode_r1, unw_decode_r2): Likewise. + (unw_decode_r3, unw_decode_p1, unw_decode_p2_p5): Likewise. + (unw_decode_p6, unw_decode_p7_p10, unw_decode_b1): Likewise. + (unw_decode_b2, unw_decode_b3_b4): Likewise. + + * readelf.c (get_elf_class): Fix ISO portability glitch. + (get_data_encoding, get_osabi_name, request_dump): Likewise. + +2001-11-07 Jakub Jelinek + + * readelf.c (debug_str, debug_str_size): New. + (display_debug_abbrev): If no abbrevs were read, skip the CU. + Call free_abbrevs. + (read_and_display_addr): Handle DW_FORM_strp. + (display_debug_info): Read .debug_str section if present, + so that DW_FORM_strp can be handled. + Fix test for non-existant .debug_abbrev section. + +2001-11-05 Jakub Jelinek + + * arlex.l: Accept `\' in filenames. Patch by . + + * arsup.c (ar_open): Prepend tmp- to basename, not whole path. + +2001-11-05 Martin Schwidefsky + + * MAINTAINERS: Add self as s390/s390x maintainer. + +2001-11-02 Tom Rix + + * MAINTAINERS: Add self as PPC XCOFF maintainer. + +2001-11-02 Nick Clifton + + * configure.in (ALL_LINGUAS): Add "fr" and "tr". + * configure: Regernate. + * po/fr.po: New file. + * po/tr.po: New file. + +2001-10-30 Hans-Peter Nilsson + + * MAINTAINERS: Add self as MMIX port maintainer. + * readelf.c: Include elf/mmix.h. + (guess_is_rela): MMIX is RELA. + (dump_relocations): Handle MMIX relocations. + * Makefile.am: Regenerate dependencies. + * Makefile.in: Regenerate. + +2001-10-13 Nick Clifton + + * readelf.c (parse_args): Handle multiple options to the -w + switch. + +2001-10-12 Jakub Jelinek + + * readelf.c (get_section_type_name): Don't print SHT_ prefix for + LOPROC, LOOS and LOUSER. + +2001-10-11 J"orn Rennecke + + * MAINTAINERS: Update my email address. + +2001-10-03 Alan Modra + + * doc/Makefile.in: Regenerate. + * configure: Regenerate. + +2001-10-02 Nick Clifton + + * readelf.c (display_debug_line, display_debug_pubnames, + display_debug_info, display_debug_frames): Detect and warn + about 64-bit format entries. + (display_debug_aranges): Reword 64-bit warning. + (debug_displays): Add .debug_pubtypes as a known, but not yet + supported, debug section. + +2001-10-02 Alan Modra + + * coffdump.c (PROGRAM_VERSION): Delete. + (main <'V'>): Call print_version. + * srconv.c: Likewise. + * sysdump.c: Likewise. + * version.c (program_version): Remove. + (print_version): Use BFD_VERSION_STRING. Just print the current + year in copyright message. + * addr2line.c (program_version): Remove unused declaration. + * objdump.c (display_target_tables): Use BFD_VERSION_STRING in + place of BFD_VERSION. + * Makefile.am (Makefile): Depend on bfd/configure.in. + (cplus-dem.o): Depend on Makefile. + Run "make dep-am". + * Makefile.in: Regenerate. + +2001-10-01 Nick Clifton + + * readelf.c (display_debug_aranges): Detect and warn about DWARF64 + format .debug_arange sections. + (main): Add missing prototype. + +2001-09-30 Hans-Peter Nilsson + + * Makefile.am: Update dependencies with "make dep-am". + * Makefile.in: Regenerate. + +2001-09-28 Richard Henderson + + * objdump.c (dump_section_header): Dump SEC_ARCH_BIT_0. + +2001-09-26 Alan Modra + + * bucomm.c (fatal): Define using VPARAMS, VA_OPEN, VA_FIXEDARG, + VA_CLOSE. + (non_fatal): Likewise. + * objdump.c (objdump_sprintf): Likewise. + * readelf.c (error): Likewise. + (warn): Likewise. + +2001-09-25 Jakub Jelinek + + * readelf.c (do_wide): New. + (options): Add --wide. + (usage, parse_args): Likewise. + (process_program_headers): Put each segment on a single line if + --wide is given. + (process_section_headers): Put each section on a single line if + --wide is given. + * doc/binutils.texi: Document it. + * NEWS: Likewise. + +2001-09-25 Alan Modra + + * readelf.c (print_vma): Print 8 digits of low hex value. + +2001-09-24 Andreas Jaeger + + * nlmconv.c: Fix warnings about unused attributes and function + prototypes. + + * strings.c: Add prototype for get_char. + +2000-09-19 H.J. Lu + + * doc/Makefile.am ($(DEMANGLER_NAME).1): Try cxxfilt.man and + $(srcdir)/cxxfilt.man. + * doc/Makefile.in: Rebuild. + +2001-09-19 Alan Modra + + * objcopy.c (copy_main): Correct rename-section string parsing. + Consolidate new_name parsing, and error messages. + +2001-09-18 Bruno Haible + + * addr2line.c: Don't include . + (main): For gettext, also set the LC_CTYPE locate facet. + * ar.c (main): Likewise. + * coffdump.c (main): Likewise. + * dlltool.c: Include "safe-ctype.h" instead of . + (main): For gettext, also set the LC_CTYPE locate facet. + Use ISALNUM instead of isalpha/isdigit. + * dllwrap.c: Don't include . + (main): For gettext, also set the LC_CTYPE locate facet. + * nlmconv.c: Include "safe-ctype.h" instead of . + (main): For gettext, also set the LC_CTYPE locate facet. + Use TOUPPER instead of islower/toupper. + * nlmheader.y: Include "safe-ctype.h" instead of . + (yylex): Use ISSPACE/ISALNUM instead of isspace/isalnum. + Use TOUPPER instead of islower/toupper. + * nm.c (main): For gettext, also set the LC_CTYPE locate facet. + * objcopy.c (main): Likewise. + * objdump.c: Include "safe-ctype.h" instead of . + (disassemble_bytes): Use ISPRINT instead of isprint. + (dump_section_stabs): Use ISDIGIT instead of isdigit. + (dump_data): Use ISPRINT instead of isprint. + (main): For gettext, also set the LC_CTYPE locate facet. + * rclex.l: Include "safe-ctype.h" instead of . + (cpp_line, handle_quotes): Use ISSPACE instead of isspace. + * rcparse.y: Include "safe-ctype.h" instead of . + Use TOUPPER instead of islower/toupper. + * readelf.c (main): For gettext, also set the LC_CTYPE locate facet. + * resrc.c: Include "safe-ctype.h" instead of . + (write_rc_accelerators): Use ISPRINT instead of isprint. + (write_rc_rcdata): Likewise. + * size.c (main): For gettext, also set the LC_CTYPE locate facet. + * srconv.c (main): Likewise. + * stabs.c: Include "safe-ctype.h" instead of . + (parse_number): Use ISDIGIT/ISUPPER/ISLOWER instead of + isdigit/isupper/islower. + (parse_stab_string, parse_stab_type, parse_stab_argtypes, + parse_stab_array_type, stab_demangle_count, stab_demangle_get_count, + stab_demangle_prefix, stab_demangle_qualified, + stab_demangle_template, stab_demangle_type, + stab_demangle_fund_type): Use ISDIGIT instead of isdigit. + * strings.c: Include "safe-ctype.h" instead of . + (isgraphic): Use ISPRINT instead of isascii/isprint. + (main): Remove HAVE_LC_MESSAGES dependency. + * sysdump.c: Include "safe-ctype.h" instead of . + (pbarray): Use ISPRINT instead of isprint. + (main): For gettext, also set the LC_CTYPE locate facet. + * windres.c: Include "safe-ctype.h" instead of . + (format_from_filename): Use ISPRINT instead of isprint. + (main): For gettext, also set the LC_CTYPE locate facet. + * winduni.c: Include "safe-ctype.h" instead of . + (unicode_print): Use ISPRINT instead of isprint. + * wrstabs.c: Include "safe-ctype.h" instead of . + (stab_variable): Use ISDIGIT instead of isdigit. + +2001-09-18 Alan Modra + + * ar.c (print_contents): Cast args of bfd_seek to the right types. + Replace bfd_read call with call to bfd_bread. + (extract_file): Likewise. + + * objdump.c (dump_section_header): Cast section->filepos to + unsigned long to suit printf format string. + * readelf.c (process_section_headers): Similarly for sh_offset. + (process_unwind): Likewise. + +2001-09-14 Nick Clifton + + * strings.c (encoding, encoding_bytes): New variables. + (long_options): Add --encoding. + (main): Accept -e and --encoding. + (get_char): New function. Read a, possibly wide, character from + the input stream. + (print_strings): Use get_char(). + (usage): Document new command line option. + * doc/binutils.texi: Document new command line option. + * NEWS: Announce new command line option. + +2001-09-12 Alexandre Oliva + + * readelf.c (guess_is_rela, dump_relocations, get_machine_name, + get_machine_flags): Added EM_M32R, EM_D10V, EM_V850, EM_D30V, + EM_MN10200, EM_MN10300, EM_FR30, EM_AVR_OLD and EM_PJ_OLD. + Removed EM_CYGNUS_ARC. + +2001-09-04 Jeffrey A Law (law@cygnus.com) + + * readelf.c: Include elf/h8 for H8 series definitions. + (guess_is_rela): H8 series if RELA. + (dump_relocations): Handle H8 series relocations. + +2001-08-31 Eric Christopher + + * readelf.c (get_machine_flags): Remove E_MIPS_MACH_MIPS32_4K. + +2001-08-29 Peter Targett + + * MAINTAINERS: Include ARC Maintainer. + +2001-08-29 Ben Elliston + + * stabs.c (stab_demangle_template): Initialise s4. + +2001-08-27 Alan Modra + + * readelf.c (dump_relocations): Recognise EM_PPC64. + +2001-08-26 Thiemo Seufer + + * readelf.c (get_machine_flags): Add detection of EF_MIPS_32BITMODE. + +2001-08-25 H.J. Lu + + * nm.c (print_width): New. + (display_rel_file): Set `print_width' according to + bfd_sprintf_vma. + (print_symbol_info_bsd): Check `print_width' instead of BFD64. + +2001-08-24 Alexandre Oliva + + * objcopy.c (use_alt_mach_code): New variable. + (OPTION_ALT_MACH_CODE): Define. + (copy_options): Added --alt-machine-code. + (copy_main): Handle it. + (copy_object): Switch to alternate machine code if requested. + * doc/binutils.texi: Document new option. + * NEWS: Likewise. + +2001-08-22 Thiemo Seufer + + * readelf.c (get_machine_flags): Add detection of EF_MIPS_UCODE. + +2001-08-21 H.J. Lu + + * readelf.c (dump_relocations): Support ELF64 on 32bit hosts. + (display_debug_info): Cast for 64bit hosts. + (display_debug_frames): Likewise. + (process_mips_specific): Likewise. + +2001-08-21 Andreas Jaeger + + * coffgrok.h: Add missing parameter for prototype of coff_grok. + + * sysdump.c: Add missing prototypes. + * srconv.c: Likewise. + * unwind-ia64.c: Likewise. + * coffdump.c: Likewise. + + * sysinfo.y: Print prototypes, include . + + * coffgrok.c: Add missing prototypes, include libiberty.h instead + of declaring xcalloc. + +2001-08-10 H.J. Lu + + * nm.c (print_value): Add one arg, bfd *. + (print_value): Replace fprintf_vma with bfd_fprintf_vma. + (print_symbol_info_bsd): Also pass `abfd' to print_value (). + (print_symbol_info_sysv): Likewise. + (print_symbol_info_posix): Likewise. + + * objdump.c (dump_section_header): Replace printf_vma with + bfd_printf_vma. + (print_section_stabs): Likewise. + (dump_bfd_header): Likewise. + (objdump_print_value): Replace sprintf_vma with + bfd_sprintf_vma. + (disassemble_bytes): Likewise. + (dump_reloc_set): Likewise. + +2001-08-10 Andreas Jaeger + + * configure.in: Add -Wstrict-prototypes and -Wmissing-prototypes + to build warnings. + * configure: Regenerate. + +2001-08-09 Alan Modra + + * readelf.c: Add missing prototypes. + * objdump.c: Likewise. Format existing prototypes. + +2001-08-08 Alexandre Oliva + + * readelf.c (display_debug_info): Add to abbrev_offset the addend + of any RELA relocation for the abbrev_offset memory location that + refers to the .debug_abbrev section symbol. + +2001-08-07 H.J. Lu + + * readelf.c (process_file): Return 0 if OK, otherwise return 1. + (main): Return process_file (). + +2001-08-05 Philip Blundell + + * doc/binutils.texi: Use "Thumb" not "THUMB". + +2001-08-03 John Healy + + Patch suggested by Frank Eigler . + * objdump.c (disassemble_data): Fill in section member of the + disasm_info structure. + +2001-08-03 Tom Walsh + + * configure.in: Added --with-windres option. + * configure: Regenerated. + +2001-07-11 Stephane Carrez + + * doc/binutils.texi: Use @command{name} for commands; + use @option{-opt} for options; use @table @env for list of options; + remove spaces arround [ | ] in synopsis. + + * doc/Makefile.am (POD2MAN): Use 'GNU Development Tools' for the + center title. + +2001-07-31 Nick Clifton + + * objcopy.c: Fix formatting. + (section_rename): New structure. + (OPTION_RENAME_SECTION): New switch. + (copy_usage): Document new switch. + (add_section_rename): New function: Add a node to the section + rename list. + (find_section_rename): New function: Find the new name and + flags for a section. + (setup_section): Call find_section_name to determine the name + of the output section. + (copy_main): Handle OPTION_RENAME_SECTION. + * binutils.texi: Document new switch. + * NEWS: Mention new switch. + +2001-07-30 Nick Clifton + + * README: Rename bug-gnu-utils@gcc.org to bug-binutils@gcc.org. + * MAINTAINERS: Rename bug-gnu-utils@gcc.org to + bug-binutils@gcc.org. + +2001-07-28 Matthias Kramm + + * bucomm.c (list_supported_architectures): New function. + * bucomm.h (list_supported_architectures): Declare. + * objdump.c (usage): Call the above. + +2001-07-25 Dave Brolley + + * objdump.c (SKIP_ZEROES): Only define it if it is not already defined. + (SKIP_ZEROES_AT_END): Only define it if it is not already defined. + +2001-07-19 Nick Clifton + + * README: Update for 2.11. Change bug reporting email address. + * MAINTAINERS: Tidy up. Change bug reporting email address. + +2001-07-16 DJ Delorie + + * resres.c (write_res_header): Align header size. + (res_align_file): Calculate alignment correctly. + + * rcparse.y (styles): use SUBLANG_SHIFT instead of 8 (or the more + correct 10). + * resrc.c (write_rc_resource): Likewise. + * windres.h (SUBLANG_SHIFT): Define - as 10. + +2001-07-15 Nick Clifton + + * MAINTAINERS: Add Christian Groessler as maintainer for z8k port. + +2001-07-11 Nick Clifton + + * MAINTAINERS: Add notes about branch checkins. + +2001-07-05 Daniel Berlin + + * readelf.c (display_debug_macinfo): New function, display + .debug_macinfo section. + (do_debug_macinfo): New variable. + (parse_args): Handle "-w[mM]" to mean display macro info. + (process_section_headers): Handle debug_macinfo. + (debug_displays): Replace unsupported function with macinfo + function for .debug_macinfo display. + * doc/binutils.texi: Document new command line switch. + * NEWS: Document new feature of readelf. + +2001-07-05 H.J. Lu + + * objcopy.c (filter_symbols): Don't turn undefined symbols + into local. + +2001-07-03 H.J. Lu + + * doc/Makefile.am (addr2line.1): Use addr2line.pod instead of + $@.pod. + (ar.1): Likewise. + (dlltool.1): Likewise. + (nlmconv.1): Likewise. + (nm.1): Likewise. + (objcopy.1): Likewise. + (objdump.1): Likewise. + (ranlib.1): Likewise. + (readelf.1): Likewise. + (size.1): Likewise. + (strings.1): Likewise. + (strip.1): Likewise. + (windres.1): Likewise. + (cxxfilt.man): Use $(DEMANGLER_NAME).pod instead of $@.pod. + ($(DEMANGLER_NAME).1): Also substitute cxxfilt with + $(DEMANGLER_NAME). + (as.1): Removed. + * doc/Makefile.in: Regenerated. + +2001-07-03 Nick Clifton + + * MAINTAINERS: Change MIPS maintainer to Eric Christopher. + +2001-07-01 Daniel Berlin + + * readelf.c: Support DWARF 2.1 tags, encodings, languages. + +2001-06-29 James Cownie + + * readelf.c: Support DWARF 2.1 attributes. + +2001-06-28 Alan Modra + + * readelf.c (GET_DATA_ALLOC): Remove. + (GET_DATA): Remove. + (get_data): New function combining above macros, with an extra + test for zero size. + (slurp_rela_relocs): Use get_data, and catch error return. + (slurp_rel_relocs): Likewise. + (get_32bit_program_headers): Likewise. + (get_64bit_program_headers): Likewise. + (get_32bit_section_headers): Likewise. + (get_64bit_section_headers): Likewise. + (get_32bit_elf_symbols): Likewise. + (get_64bit_elf_symbols): Likewise. + (process_section_headers): Likewise. + (process_relocs): Likewise. + (slurp_ia64_unwind_table): Likewise. + (process_unwind): Likewise. + (get_32bit_dynamic_segment): Likewise. + (get_64bit_dynamic_segment): Likewise. + (process_dynamic_segment): Likewise. + (process_version_sections): Likewise. + (process_symbol_table): Likewise. + (dump_section): Likewise. + (display_debug_info): Likewise. + (display_debug_section): Likewise. + (process_section_contents): Likewise. + (process_corefile_note_segment): Likewise. + (process_mips_specific): Likewise. Also free econf32, econf64. + +2001-06-25 Alan Modra + + * readelf.c (dump_relocations): Print "bad symbol index" if + symtab == NULL with non-zero symtab_index. + (process_relocs): Don't bomb if reloc section has no symsec. + +2001-06-24 H.J. Lu + + * objcopy.c (strip_main): Revert the change made on 2001-05-30 + by accident. + (copy_main): Apply the the change made to strip_main on + 2001-05-30 by accident. + +2001-06-23 Andreas Jaeger + + * unwind-ia64.c (unw_decode_x1): Add unused attribute for + parameter 'code'. + (unw_decode_x2): Likewise. + (unw_decode_x3): Likewise. + (unw_decode_x4): Likewise. + +2001-06-23 Ben Elliston + + * MAINTAINERS: Add myself as M88k maintainer. + +2001-06-22 Jocelyn Mayer + + * objcopy.c (strip_main): Support -o or --output-file command lien + switch. + +2001-06-19 H.J. Lu + + * doc/Makefile.in: Regenerated. + +2001-06-19 Nick Clifton + + * readelf.c: Restore formatting. + +2001-06-18 H.J. Lu & Nick Clifton + + * Makefile.am: Move documentation into doc subdirectory. + * Makefile.in: Regenerated. + * binutils.texi: Move into doc subdirectory. + * addr2line.1: Removed. + * ar.1: Likewise. + * dlltool.1: Likewise. + * nlmconv.1: Likewise. + * nm.1: Likewise. + * objcopy.1: Likewise. + * objdump.1: Likewise. + * ranlib.1: Likewise. + * readelf.1: Likewise. + * size.1: Likewise. + * strings.1: Likewise. + * strip.1: Likewise. + * windres.1: Likewise. + * cxxfilt.man: Likewise. + * doc: New Directory. + * doc/Makefile.am: New file. + * doc/Makefile.in: Generate. + +2001-06-09 Alan Modra + + * NEWS: Fix a typo. Mention hppa64-elf. Add binutils-2.11 marker. + +2001-06-01 Alan Modra + + * MAINTAINERS: Update my email address. + +2001-05-30 Honda Hiroki + + * objcopy.c: Add new switches: --keep-global-symbol, + --keep-symbols, --localize-symbols, --keep-global-symbols and + --weaken-symbols. + * binutils.texi: Document new switches. + * objcopy.1: Regenerate. + * NEWS: Announce new feature. + +2001-05-28 Andreas Jaeger + + * readelf.c (display_debug_frames): Fix warnings: Remove unused + variables, fix format strings. + +2001-05-28 Nick Clifton + + * objdump.c (disassemble_bytes): Remove section VMA adjustment + when computing the address of the line to show. + +2001-05-16 Richard Henderson + + * readelf.c (do_debug_frames_interp): New. + (byte_get_little_endian): If BFD64, always read entire 8-byte fields. + (byte_get_big_endian): Likewise. + (parse_args) ['F']: Set do_debug_frames_interp. + (Frame_Chunk): Make data_factor signed, add fde_encoding. + (frame_display_row): Don't trunc pc_begin to int. + (size_of_encoded_value): New. + (display_debug_frames): Handle 64-bit targets. Print raw data + unless do_debug_frames_interp. + (debug_displays): Remove duplicate .debug_frame. + +2001-05-15 Ralf Baechle + + * readelf.c: Replace uses of EM_MIPS_RS4_BE with EM_MIPS_RS3_LE. + The former constant was never in active use and is used otherwise + by the ABI. + +2001-05-11 Jakub Jelinek + + * readelf.c (process_unwind): Print all unwind sections, not just + one. + +2001-05-07 Thiemo Seufer + + * readelf.c (process_unwind): Remove const specifier. + +2001-04-27 Michal Svec + + * strings.c (isgraphic): Do not use isascii() unless it is needed + for isprint() to work. + (main): Set the locale domain to LC_ALL not just LC_MESSAGES. + +2001-04-27 Johan Rydberg + + * NEWS: Announce support for OpenRISC. + +2001-04-17 Danny Smith + + * dlltool.c (do_default_excludes): Initialise to true. + +2001-04-10 Alan Modra + + * MAINTAINERS: Update my email address + * nm.c (print_symbol_info_bsd): Use a simple printf string. + +2001-04-05 Hans-Peter Nilsson + + * readelf.c (display_debug_lines): Fix typo for "Prologue". + +2001-03-30 H.J. Lu + + * readelf.c (process_unwind): Just return if do_unwind is 0. + +2001-03-28 Roger Sayle + + * dlltool.c (make_one_lib_file): Fix section flags for + .text, .data and .bss in stub ds*.o files to match those + generated by gas. + +2001-03-29 H.J. Lu + + * readelf.c (process_unwind): Only do unwind sections for + IA64. + +2001-03-28 H.J. Lu + + * Makefile.am ($(srcdir)/dlltool.1): Remove the extra target. + * Makefile.in: Regenerate. + +2001-03-26 Andreas Jaeger + + * binutils.texi (nm): Fix texi syntax. + +2001-03-25 Stephane Carrez + + * binutils.texi: Put @c man begin and @c man end indications + to generate man pages using texi2pod and pod2man. Put @c man title + to identify each man. Add SEEALSO entries. + * Makefile.am (MANCONF, TEXI2POD, POD2MAN): New variable. + (man_MANS): Add dlltool.1, nlmconv.1, readelf.1, windres.1, + sort the list. + (*.1): Build the man pages from binutils.texi. + * Makefile.in: Regenerate. + +2001-03-13 Eric Kohl + + * defparse.y (opt_equal_name): allow "." in name. + * dlltool.c (def_exports): Added ability to generate forwarded exports. + (gen_exp_file): Likewise. + +2001-03-12 Stefan Geuken + + * NEWS: Document addition of -B switch to objcopy. + * binutils.texi: Document addition of -B switch to objcopy. + * objcopy.c: (copy_options): Add --binary-architecture. + (copy_usage): Document -B/--binary-architecture. + (copy_main): Support -B/--binary-architecture. Set + bfd_external_binary_architecture. + +2001-03-11 Andreas Jaeger + + * readelf.c (guess_is_rela): Handle EM_S390_OLD. + (dump_relocations): Likewise. + (get_machine_name): Likewise. + +2001-02-28 Nick Clifton + + * readelf.c: (struct unw_aux_info): Remove const modifier for + 'strtab' field. + (process_unwind): Remove non-K&R compliant LHS type cast in call + to GET_DATA_ALLOC macro. + +2001-02-28 Philip Blundell + + * readelf.c (decode_ARM_machine_flags): Explicitly mention which + ABI is in use; remove ambiguity between the "unknown" EABI and + unrecognised ABIs. Handle version 2 ARM EABI. Update uses of + renamed EF_xx constants. + +2001-02-27 Alan Modra + + * configure.in (BFD_VERSION): New. + (AM_INIT_AUTOMAKE): Use $BFD_VERSION. + * configure: Regenerate. + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + +2001-02-14 Nick Clifton + + * MAINTAINERS: Add "Obvious Fix" rule. + +2001-02-11 Michael Sokolov + + * unwind-ia64.c: Don't use ANSI C preprocessor stringisation and string + literal concatenation. + +2001-02-11 Michael Sokolov + + * readelf.c (struct unw_aux_info): Remove const from the info member. + (process_unwind): Don't type-cast the third argument to the + GET_DATA_ALLOC macro. + +2001-02-11 Nick Clifton + + * readelf.c (dump_relocations): Free corrected allocated + array. + (process_unwind): Fix compile time warning. + +2001-02-10 Nick Clifton + + * binutils.texi: Document new --unwind option to readelf. + +2001-02-09 Martin Schwidefsky + + * readelf.c: Add linux target for S/390. + +2001-02-10 Alan Modra + + * nm.c (print_symbol_info_bsd): Don't #ifdef inside printf in case + printf is a macro. + +2001-02-08 Hans-Peter Nilsson + + * acinclude.m4 (AM_PROG_LEX): Override installed definition. + * aclocal.m4: Regenerate. + * configure: Regenerate. + +2001-02-07 Todd Vierling + + * bucomm.c (bfd_target_vector): Change extern array to pointer. + * objdump.c (bfd_target_vector): Likewise. + +2001-02-07 David Mosberger + + * readelf.c (process_unwind): New function. + (slurp_ia64_unwind_table): Ditto. + (dump_ia64_unwind): Ditto. + (find_symbol_for_address): Ditto. + (slurp_rela_relocs): New function (split off from dump_relocations()). + (slurp_rel_relocs): Ditto. + (parse_args): Handle '-u' option. + + * unwind-ia64.c: New file. + * unwind-ia64.h: New file. + * Makefile.am: Include unwind-ia64.c in readelf build. + * Makefile.in: Regenerate. + * po/binutils.pot: Regenerate. + +2001-02-04 Philip Blundell + + * 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. + +2000-12-11 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. + +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. + +2000-08-14 Todd Vierling + + * objcopy.c (strip_main): Silently accept -d as an alias for -g + for compatibility 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.texi: Put back "@end table" deleted by + accident. + +2000-07-05 Kenneth Block + + * nm.c: Add optional style to demangle switch. + * objdump.c: Add optional style to demangle switch. + * addr2line.c: Add optional style to demangle switch. + * 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. + +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. + +2000-07-19 H.J. Lu + + * readelf.c (get_dynamic_type): Fix DT_CHECKSUM. + +2000-07-19 H.J. Lu + + * readelf.c (get_dynamic_type): Change DT_FEATURE_1 to + DT_FEATURE. + (process_dynamic_segment): Likewise. + + * readelf.c (get_dynamic_type): Handle DT_CONFIG, DT_DEPAUDIT, + DT_AUDIT, DT_PLTPAD, DT_MOVETAB and DT_CHECKSUM. + (process_dynamic_segment): Handle DTF_1_CONFEXP, DF_1_NODEPLIB, + DF_1_NODUMP and DF_1_CONLFAT. + +2000-07-18 Nick Clifton + + * binutils.texi (readelf): Fix spelling typo. + +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. + +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. + +2000-06-22 Alan Modra + + * Makefile.am (DEP): grep for leading `/' in DEP1, and fail if we + find one. + * Makefile.in: Regenerate. + +2000-06-20 Alexander Aganichev + + * ar.c (normalize): Correct pointer comparison when checking for + backslashes. + (main): Likewise. + * bucomm.c (make_tempname): Likewise. + + * ieee.c (ieee_start_compilation_unit): Correct pointer comparison + and search for backslashes in the original pathname. + (ieee_add_bb11): Likewise. + +2000-06-18 Nick Clifton + + * ar.c (print_contents): Improve verbose message. + +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. + (normalize) [HAVE_DOS_BASED_FILE_SYSTEM]: Support backslashes + and drive letters in file names. + (main): Support backslashes and drive letters in argv[0]. Drop + the .exe suffix, if any, in argv[0] if is_ranlib is negative. Use + FILENAME_CMP instead of strcmp to compare file names. + (open_inarch) [__GO32__]: Don't ifdef errno != ENOENT test for + DJGPP v2. + (do_quick_append) [__GO32__]: Ditto. + (get_pos_bfd, delete_members, move_members, replace_members): + Compare file names with FILENAME_CMP. + + * bucomm.c: Include filenames.h. + (make_tempname) [HAVE_DOS_BASED_FILE_SYSTEM]: Support mixed + forward/backward slashes and drive letters in file names. + + * ieee.c (ieee_start_compilation_unit, ieee_add_bb11): Support + mixed forward/backward slashes and drive letters in file names. + + * strings.c (O_BINARY, setmode, SET_BINARY): Define. + (main) [SET_BINARY]: Use SET_BINARY to switch stdin into binary + mode. + + * objcopy.c: Include filenames.h. + (main) [HAVE_DOS_BASED_FILE_SYSTEM]: Drop the .exe suffix + before comparing to "strip". + Use FILENAME_CMP to compare file names. + + * arsup.c: Include filenames.h. + (map_over_list, ar_delete, ar_replace, ar_extract): Use + FILENAME_CMP to compare file names. + (ar_open): Prepend "tmp-" instead of appending "-tmp", to create + the temporary file name. + + * configure.in: Check for setmode. + * configure: Regenerate. + +2000-05-24 Alan Modra + + * objdump.c (display_target_list): Close the bfd. + (display_info_table): Likewise. + +2000-05-14 H.J. Lu (hjl@gnu.org) + + * 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 + + * readelf.c (get_osabi_name): Handle ELFOSABI_NONE instead of + ELFOSABI_SYSV. Also handle ELFOSABI_NETBSD, ELFOSABI_HURD, + ELFOSABI_SOLARIS, ELFOSABI_MONTEREY, ELFOSABI_IRIX, + 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. + +2000-04-23 Denis Chertykov + + * readelf.c (guess_is_rela): AVR uses RELA relocations. + (get_machine_name): machine name for EM_AVR added. + +2000-04-21 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. + +2000-04-10 Philippe De Muyter + + * readelf.c (dynamic_segment_mips_val): Call `sprintf', not + `strftime' since strftime is not available on all systems. + (process_mips_specific): Ditto. + +2000-04-07 Andrew Cagney + + * configure.in (WARN_CFLAGS): Set to -W -Wall by default. Add + --enable-build-warnings option. + * Makefile.am (AM_CFLAGS, WARN_CFLAGS): Add definitions. + * Makefile.in, configure: Re-generate. + +2000-04-06 Alan Modra + + * addr2line.c: Update copyright. + * objcopy.1: Likewise, and title. + * strings.1: Likewise. + + * version.c (print_version): Add 2000. + + * rddbg.c (read_section_stabs_debugging_info): Don't use + bfd_size_type for strx to avoid printf problems if BFD64. + + * bucomm.c: (report): Remove `static'. + Move inclusion of stdarg.h/vararg.h from here. + * bucomm.h: To here. + (CONST): Change all occurences to const. + (report): Declare it. + (bfd_fatal): Add ATTRIBUTE_NORETURN. + (fatal): Add ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN. + (non_fatal): Add ATTRIBUTE_PRINTF_1. + + * ar.c (main): Use fatal or non_fatal instead of fprintf. + Correct a typo in an error message. + (do_quick_append): Use non_fatal instead of fprintf. + (move_members): Use fatal instead of fprintf, exit. + * coffdump.c (main): Same here. + + * dlltool.c (display): Delete. + (warn): Delete. + (inform): Use `report' instead of `display'. + (rvaafter): Remove trailing \n from fatal error msg. + (rvabefore): Ditto. + (asm_prefix): Ditto. + (yyerror): Replace `warn' with `non_fatal', and remove \n. + (def_name): Likewise. + (run): Likewise. + (scan_all_symbols): Likewise. + (gen_lib_file): Likewise. + (def_library): Likewise. Remove extra program_name too. + (run): Remove \n from inform strings. + (scan_drectve_symbols): Likewise. + (add_excludes): Likewise. + (scan_open_obj_file): Likewise. + (gen_exp_file): Likewise. + (gen_lib_file): Likewise. + (process_duplicates): Likewise. + + * Makefile.am (dllwrap_SOURCES): Add version.c. + * dllwrap.c (program_version): Delete. + (print_version): Delete. + (display): Always print trailing \n. + (warn): New. + (delete_temp_files): Use warn instead of fprintf. Use gettext. + (run): Here too. + (main): And here. + (usage): gettext'ify. + (long_options): Add missing initialisers. + + * nlmconv.c (main): Use fatal/non_fatal instead of fprintf. + (select_output_format): Likewise. + (powerpc_mangle_relocs): Likewise. + (link_inputs): Likewise. + + * nm.c (set_print_radix): Use fatal instead of fprintf, exit. + (set_output_format): Likewise. + (main): Use non_fatal instead of fprintf. + (display_rel_file): Likewise. + + * objdump.c (slurp_symtab): Use non_fatal instead of fprintf. + (slurp_dynamic_symtab): Same here. + (disassemble_data): And here. + (read_section_stabs): And here. + (read_section_stabs): And here. + (dump_bfd): And here. + (main): And here. + (objdump_sprintf): Use fatal instead of fprintf, exit. + (disassemble_data): Same here. + + * rdcoff.c (parse_coff_type): Use non_fatal instead of fprintf. + (parse_coff_struct_type): Same here. + (parse_coff_enum_type): And here. + (parse_coff): And here. + * rddbg.c (read_debugging_info): And here. + * size.c (main): And here. + * windres.c (format_from_name): And here. + * wrstabs.c (stab_write_symbol): Here too. + (write_stabs_in_sections_debugging_info): And here. + (stab_int_type): And here. + (stab_struct_field): And here. + (stab_typdef): And here. + + * rescoff.c (read_coff_rsrc): Use fatal instead of fprintf, exit. + * srconv.c (main): Same here. + * strings.c (main): And here. + (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 + an `=' in the argument. + * objcopy.1: Here too. Remove extra space on discard-all. + + * binutils.texi (objcopy): Mention --redefine-sym. + * objcopy.1: Here too. + * NEWS: And here. + + * objcopy.c (parse_flags): Split off flag names from error message + gettext as they are not translated. + (copy_main): Similarly split off option name for --add-section, + --set-section-flags, --change-section-vma, --change-section-lma + error messages. + Some white space changes. + + from Matthew Benjamin + * objcopy.c (struct redefine_node): New. + (redefine_sym_list): New. + (redefine_list_append): New. + (lookup_sym_redefinition): New. + (OPTION_REDEFINE_SYM): New. + (copy_options): Add --redefine-sym option. + (copy_usage): Mention it. + (filter_symbols): Rename symbols on redefine_sym_list. + (copy_object): Call filter_symbols if redefine_sym_list != NULL. + (copy_main): Handle OPTION_REDEFINE_SYM. + +2000-04-04 H.J. Lu + + * readelf.c (process_symbol_table): Correctly read in symbol + versioning information. + +2000-04-04 Alan Modra + + * po/binutils.pot: Regenerate. + + * addr2line.c (usage): Restore translated part of bug string. + * 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. + * readelf.c (usage): Likewise. + * size.c (usage): Likewise. + * strings.c (usage): Likewise. + * windres.c (usage): Likewise. + + * Makefile.am (MKDEP): Use gcc -MM rather than mkdep. + (DEP): Quote when passing vars to sub-make. Add warning + message to end. + (DEP1): Rewrite for "gcc -MM". + (CLEANFILES): Add DEP2. + Update dependencies. + * Makefile.in: Regenerate. + +2000-04-04 H.J. Lu + + * Makefile.am (GENERATED_HFILES): Add rcparse.h + (arparse.h): Depend on arparse.c + (defparse.h, nlmheader.h, rcparse.h, sysinfo.h): Similarly. + +2000-04-03 H.J. Lu (hjl@gnu.org) + + * size.c (usage): Use REPORT_BUGS_TO. + +2000-04-03 Alan Modra + + * bucomm.h: #include "bin-bugs.h" + * addr2line.c (usage): Use REPORT_BUGS_TO. + * ar.c (usage): Likewise. + * nlmconv.c (show_usage): Likewise. + * nm.c (usage): Likewise. + (OPTION_TARGET): Define. + (long_options): Use OPTION_TARGET rather than 200. + (main): Likewise. + + * objcopy.c (copy_usage): Use REPORT_BUGS_TO. + (strip_usage): Likewise. + * objdump.c (usage): Likewise. + * readelf.c (usage): Likewise. + * strings.c (usage): Likewise. + * windres.c (usage): Likewise. + +2000-03-31 John David Anglin + + * readelf.c: Include sys/types.h before sys/stat.h for ultrix. + +2000-03-27 Nick Clifton + + * rddbg.c (read_section_stabs_debugging_info): Catch out of range + string offsets in corrupt stabs entries. + +2000-03-27 Alan Modra + + * readelf.c: Include elf/avr.h + (dump_relocations): Add EM_AVR case. + +2000-03-09 Tim Waugh + + * strings.1: Correct '-bytes' to '--bytes'. + +2000-03-08 H.J. Lu + + * Makefile.am (install-exec-local): Depend on + install-binPROGRAMS for parallel make. + * Makefile.in: Regenerated. + +2000-02-27 Ian Lance Taylor + + From Brad Lucier : + * readelf.c (process_dynamic_segment): Add cast to make sure + argument to %* is int. + +2000-02-25 H.J. Lu + + * configure.in (AC_SEARCH_LIBS): Pass m, not -lm. + +2000-02-24 Nick Clifton + + * configure.in: Add arm-wince, mips-pe and sh-pe targets. + * configure: Regenerate. + + * dlltool.c: Add support for sh-pe and mips-pe targets. + * rescoff.c: Add support for sh-pe and mips-pe targets. + +2000-02-23 H.J. Lu + + * readelf.c (get_osabi_name): Handle ELFOSABI_LINUX. + +2000-02-22 Nick Clifton + + * readelf.c (process_symbol_table): Remove use of ELF_ST_OTHER. + +2000-02-22 Ian Lance Taylor + + From Brad Lucier : + * readelf.c (process_version_sections): Add casts to make sure + argument to %* is an int. + (process_mips_specific): Add casts to make printf arguments match + format. + +2000-02-21 Alan Modra + + * objdump.c (dump_section_header): Change `opb' to unsigned. + (find_symbol_for_address): Same here. + (disassemble_data): And here. Change `addr_offset', + `stop_offset', `nextstop_offset' to unsigned long. + (dump_data): Change opb to unsigned. + +2000-02-18 Frank Ch. Eigler + + * resrc.c: Remove unmatched #if for cygwin. + +2000-02-14 Fernando Nasser + + * binutils.texi: Document the change of flavor name from atpcs-special + to special-atpcs to prevent name conflict in gdb. + +2000-02-08 Timothy Wall + + * objdump.c (show_line): Fix bug preventing printing of the very + first line (line zero) of a file when interlisting source and + assembly. Added option to print entire context from start of file + when the first line from that file is encountered. + +2000-02-03 Timothy Wall + + * 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 + check to unresolved symbols. + (print_symbol_info_sysv): Ditto. + (print_symbol_info_posix): Ditto. + + * binutils.texi: Document new 'V' symclass flag for nm. + +2000-01-27 Nick Clifton + + * binutils.texi (objdump): Document new ARM specific + disassembler options. + + * objdump.c (usage): Call disassembler_usage(). + +2000-01-27 Alan Modra + + * readelf.c (get_dynamic_flags): Return buff. + (process_dynamic_segment): Don't pass error strings to printf + as format arg. + (read_and_display_attr): Use lx and ld to print longs. + (process_corefile_note_segment): Cast bfd_vma to unsigned long + before printing. + Update copyright. + +2000-01-17 Nick Clifton + + * readelf.c (get_osabi_name): Recognise ELFOSABI_ARM. + +2000-01-15 Alan Modra + + * debug.c (debug_name_type): Return DEBUG_TYPE_NULL rather than + false. + (debug_tag_type): Here too. + * ieee.c (ieee_builtin_type): And here. + * stabs.c (parse_stab_type, parse_stab_array_type): And here. + +2000-01-13 Nick Clifton + + * readelf.c (get_machine_name): Change EM_S370 to return "IBM + System/370". + +2000-01-11 Nick Clifton + + * readelf.c (get_dynamic_type): Remove DT_ENCODING. + +2000-01-10 Nick Clifton + + * readelf.c (get_note_type): Display NT_WIN32PSTATUS notes. + +2000-01-07 Mumit Khan + + * 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 + open_input_stream instead of popen. + (read_rc_file): Likewise. + + * binutils.texi: Document --use-temp-file, --no-use-temp-file + options. + +2000-01-04 Mumit Khan + + * dlltool.c (create_compat_implib): New variable. + (gen_exp_file): Use. + (make_one_lib_file): Use. + (long_options): Add --compat-implib option. + (usage): Handle. + (main): Handle. + + * dllwrap.c (enum target_type): Rename MINGW32_TARGET to MINGW_TARGET. + (main): Use. Don't look for "32" in cygwin and mingw target names. + +2000-01-03 Nick Clifton + + * binutils.texi: Document new, ARM specific disassembler + command line switch "-M force-thumb". + +For older changes see ChangeLog-9899 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/binutils/binutils/ChangeLog-0203 b/contrib/binutils/binutils/ChangeLog-0203 new file mode 100644 index 0000000..c633775 --- /dev/null +++ b/contrib/binutils/binutils/ChangeLog-0203 @@ -0,0 +1,2181 @@ +2003-12-31 Daniel Jacobowitz + + * MAINTAINERS: Rename CONFIGURE to BUILD SYSTEM and add myself. + +2003-12-29 Nick Clifton + + * readelf.c (debug_line_pointer_size): Replace with an array + called 'debug_line_pointer_sizes'. + (num_debug_line_pointer_sizes): New variable. + (display_debug_lines): Extract pointer size from the + debug_line_pointer_sizes array. + (display_debug_loc): Likewise. + (prescan_debug_info): Fill in the debug_line_pointer_sizes + array. + +2003-12-23 Ralf Baechle + Maciej W. Rozycki + + * objcopy.c (bfd_flags_to_set, bfd_flags_to_clear): New variables + to handle flags for tweaking. + (copy_options): New options: impure, pure, readonly-text, + writable-text. + (copy_usage, copy_object, command_line_switch): Handle the new + options. + * doc/binutils.texi: Document the new options. + +2003-12-22 Jakub Jelinek + + * objdump.c (disassemble_bytes): Subtract rel_offset from printed + reloc address. + (disassemble_section): Set rel_offset to section->vma instead of + pinfo->buffer_vma. + +2003-12-19 Kazuhiro Inaoka + + * readelf.c (guess_is_rela): Changed m32r's default type to RELA. + +2003-12-11 Nick Clifton + + * objcopy.c (strip_usage): Add --only-keep-debug. + (copy_usage): Likewise. + +2003-12-04 Nick Clifton + + * objcopy.c (copy_object): Do not copy the object if the + output file's format cannot be set to that of the input file. + If the input file's format is unknown, fail. + +2003-11-28 Ian Lance Taylor + + * cxxfilt.c (usage): Mention new -p/--no-params options. + +2003-11-28 Alan Modra + + * Makefile.am (install-exec-local): Remove common term from string + comparison. + * Makefile.in: Regenerate. + * doc/Makefile.am: Don't use $<. + * doc/Makefile.in: Regenerate. + +2003-11-27 Nick Clifton + + * rename.c (smart_rename): Make sure that we have write + permission on the destination file before renaming. + +2003-11-26 Daniel Jacobowitz + Nick Clifton + + * readelf.c: Add a comment describing the difference between + readelf and objdump. + * doc/binutils.texi (readelf): Likewise. + +2003-11-25 Danny Smith + + * doc/binutils.texi (dlltool): Document dlltool --temp-prefix + option. + * dlltool.c (usage): Likewise. + +2003-11-22 Ian Lance Taylor + + * cxxfilt.c (long_options): Add --no-params. + (main): Handle -p/--no-params. + * doc/binutils.texi (c++filt): Document -p/--no-params. + +2003-11-19 Alan Modra + + * objdump.c: Wrap long lines, init vars separately from decl. + (disassemble_section): Reset require_sec after call to + find_symbol_for_address. + +2003-11-14 Nick Clifton + + * objdump.c (find_symbol_for_address): Change parameters so + that the entire disassemble_info structure is passed, not just + a few fields. Use the symbol_is_valid field to check the + validity of located symbols and continue searching if they are + not valid. + (objdump_print_addr): Alter parameters passed to + find_symbol_for_address. + (objdump_symbol_at_address): Likewise. + (disassemble_section): Likewise. Also use symbol_is_valid + function to check the validity of located symbols. + +2003-11-13 Tobias Burnus + + * ar.c (open_inarch): Emit a warning when an archive is created + (only shown with -v) in order to confrom to POSIX specification. + +2003-11-11 Wang Li + + * objcopy.c (wildcard): New variable. True if wildcard pattern + matching is allowed in symbol names. + (strip_options): Add -w option to enable wildcard pattern + matching. + (copy_options): Likewise. + (copy_usage): Mention new switch. + (strip_usage): Likewise. + (is_specified_symbol): If performing wildcard matches use fnmatch + to compare symbol names with entries on the symbol list. + (strip_main): Accept -w switch. + (copy_main): Likewise. + * Makefile.am: Add dependency on fnmatch.h for objcopy.c + * Makefile.in: Regenerate. + * doc/binutils.texi: Document new switch. + * NEWS: Mention new switch. + +2003-11-11 Alan Modra + + * objdump.c: Revert rev 1.81 commit. + +2003-11-10 Tobias Burnus + + * ar.c (print_contents): Remove "member" from verbose output in + order to conform to POSIX specification. + +2003-11-10 Alan Modra + + * README: Expand bug reporting information. + +2003-11-07 Jonathan R. Grant + + * bucomm,c (get_file_size): New function. Returns the size of a + file. + * bucomm.h: Add prototype for get_file_size. + * addr2line.c (process_file): Use new function. + * ar.c (main, ranlib_only, ranlib_touch): Likewise. + * nm.c (display_file): Likewise. + * objcopy.c (add_specific_symbols, copy_file, strip_main, + copy_main): Likewise. + * objdump.c (display_file): Likewise. + * size.c (display_file): Likewise. + * strings.c (strings_file): Likewise. + * readelf.c (process_file): Use similar code to get_file_size. + +2003-11-06 Bruno Rohee + + * ieee.c: Fix "the the" typo. + * stabs.c: Likewise. + +2003-10-30 Marshall T. Vandegrift + + * readelf.c (dump_section): Do not dump the contents of SHT_NOBITS + sections - they have no file space assigned to their contents. + +2003-10-28 Segher Boessenkool + + * readelf.c (dump_section): Don't display DEL characters. + +2003-10-27 Kazu Hirata + + * ChangeLog: Fix typos. + * ChangeLog-9197: Likewise. + * ChangeLog-9899: Likewise. + * NEWS: Likewise. + * ar.c: Fix comment typos. + * arsup.c: Likewise. + * coffgrok.c: Likewise. + * debug.c: Likewise. + * debug.h: Likewise. + * dlltool.c: Likewise. + * ieee.c: Likewise. + * nm.c: Likewise. + * objdump.c: Likewise. + * prdbg.c: Likewise. + * readelf.c: Likewise. + * resrc.c: Likewise. + * sysinfo.y: Likewise. + * windres.c: Likewise. + +2003-10-27 Nick Clifton + + * objcopy.c (copy_section): Do not complain when a target does not + support relocations. + (mark_symbols_used_in_relocations): Likewise. + +2003-10-14 Anil Paranjpe + + * objcopy.c (copy_main): Reads machine flags from arch_info + structure. + +2003-10-20 Andrew Cagney + + * coffgrok.h (coff_section): Replace 'struct sec" with "struct + bfd_section". + +2003-10-07 Nathan Sidwell + + * objdump.c (read_section_stabs): Just read one section, return + pointer to it. Add size parameter. + (print_section_stabs): Add string offset parameter. Adjust. + (struct stab_section_names): Add string offset member. + (find_stabs_sections): Correct check for split section suffix, + adjust read_section_stabs and print_section_stabs calls. + (dump_stabs_section): Clear string_offset, free string table. + +2003-10-01 Martin Fuchs + + * resrc.c (define_icon): Fix storage of color attributes 'planes' and + 'bit count' in icon groups. + +2003-09-30 Chris Demetriou + + * NEWS: Add an indication of the cutoff for 2.14. + +2003-09-30 Chris Demetriou + + * readelf.c (get_machine_flags): Handle E_MIPS_ARCH_64R2. + +2003-09-29 H.J. Lu + + * readelf.c (dump_relocations): Support SHN_IA_64_ANSI_COMMON. + (get_symbol_index_type): Likewise. + +2003-09-25 H.J. Lu + + * readelf.c (process_version_sections): Indent version names. + +2003-09-15 Anthony Green + + * dlltool.c (prefix_encode): Fix ISO C90 conversion. + (dlltmp): Ditto. + (dtab): Ditto. + +2003-09-14 Andreas Jaeger + + * addr2line.c: Convert to ISO C90 prototypes, change PTR, remove + unneeded (void *) casts. + * ar.c: Likewise. + * arlex.l: Likewise. + * arparse.y: Likewise. + * arsup.c: Likewise. + * binemul.c: Likewise. + * binemul.h: Likewise. + * bucomm.c: Likewise. + * bucomm.h: Likewise. + * budbg.h: Likewise. + * budemang.c: Likewise. + * budemang.h: Likewise. + * coffdump.c: Likewise. + * coffgrok.c: Likewise. + * cxxfilt.c: Likewise. + * debug.c: Likewise. + * debug.h: Likewise. + * deflex.l: Likewise. + * dlltool.c: Likewise. + * dlltool.h: Likewise. + * dllwrap.c: Likewise. + * emul_aix.c: Likewise. + * filemode.c: Likewise. + * ieee.c: Likewise. + * nlmconv.c: Likewise. + * nlmconv.h: Likewise. + * nlmheader.y: Likewise. + * nm.c: Likewise. + * prdbg.c: Likewise. + * rclex.l: Likewise. + * rcparse.y: Likewise. + * rdcoff.c: Likewise. + * rddbg.c: Likewise. + * rename.c: Likewise. + * resbin.c: Likewise. + * rescoff.c: Likewise. + * resrc.c: Likewise. + * size.c: Likewise. + * srconv.c: Likewise. + * stabs.c: Likewise. + * strings.c: Likewise. + * sysdump.c: Likewise. + * sysinfo.y: Likewise. + * syslex.l: Likewise. + * unwind-ia64.c: Likewise. + * unwind-ia64.h: Likewise. + * version.c: Likewise. + * windres.c: Likewise. + * windres.h: Likewise. + * winduni.c: Likewise. + * wrstabs.c: Likewise. + +2003-09-10 James E Wilson + + * MAINTAINERS: Update my e-mail address. + +2003-09-09 Ian Lance Taylor + + * MAINTAINERS: Update my e-mail address. + +2003-09-04 Nick Clifton + + * MAINTAINERS: Make it clear what should be done with patches to + the top level configure files (other than config.guess and + config.sub). Add binutils@sources.redhat.com as an address to + which patches can be sent. + +2003-09-04 Nick Clifton + + * readelf.c (get_machine_flags): Recognise V850E1 machine type. + +2003-09-03 Andrew Cagney + + * objdump.c: Refer to init_disassemble_info in comments. + (disassemble_data): Replace INIT_DISASSEMBLE_INFO with + init_disassemble_info. + +2003-09-03 Nick Clifton + + * objdump.c (struct objdump_disasm_info): Add new fields + 'dynrelbuf', 'dynrelcount' and 'disassemble_fn'. + (process_section_p): New function: Returns TRUE if a section + can be dumped. + (disassemble_section): New function: Contains the body of + disassemble_data(), but just for one section. + (disassemble_data): Use bfd_map_over_sections to walk section + chain. + (find_stabs_section): New function: Find a stabs containing + section and then dump it. + (dump_stabs_section): New function: Use bfd_map_over_sections + to find the section to dump. + (dump_stabs): Use dump_stabs_section. + (dump_section): New function: Display the contents of a + section. + (dump_data): Use bfd_map_over_sections to display section + contents. + (dump_relocs_in_section): Display the relocs in a given section. + (dump_relocs): Use bfd_map_over_sections to display relocs. + (adjust_addresses): New function: Adjust the vma and lma of + sections. + (dump_bfd): Use bfd_map_over_sections. + * doc/binutils.texi: Document the "objdump -s" (no longer) + dumps empty sections. + +2003-08-24 Jonathan R. Grant + + * objdump.c: Improve comments/documentation. + dump_data: Eliminate duplicate function calls to bfd_section_size. + +2003-09-02 Alan Modra + + * MAINTAINERS: Move Dave Anglin's entry to where it belongs. + +2003-08-21 Nick Clifton + + * po/tr.po: Updated Turkish translation. + +2003-08-14 Alan Modra + + * dep-in.sed: Remove libintl.h. + * Makefile.am (POTFILES.in): Unset LC_COLLATE. + Run "make dep-am". + * Makefile.in: Regenerate. + +2003-08-11 Ian Lance Taylor + + * readelf.c (process_archive): Fix error handling. Remove memory + leak. + + * readelf.c: Add ability to read archives. + (archive_file_offset): New variable. + (archive_file_size): New variable. + (get_data): Include archive_file_offset in file offset + calculation when fseeking. + (process_program_headers): Likewise. + (process_symbol_table): Likewise. + (process_dynamic_segment): Handle computation of end of file + position when the file is in an archive. + (process_object): New function. Contains the body of + process_file(). + (process_archive): New function. Call process_object on each + member of an archive. + (process_file): Detect archives and handle appropriately. + * Makefile.am: Add dependency on aout/ar.h for readelf.c + * Makefile.in: Regenerate. + * NEWS: Document readelf's new ability. + * doc/binutils: Alter text to say that readelf supports archives + and 64-bit ELF files. + +2003-08-08 Nick Clifton + + * po/fr.po: Updated French translation. + +2003-08-05 Alan Modra + + * objcopy.c: Remove unnecessary prototypes and casts. + * objdump.c: Remove unnecessary casts. + * readelf.c: Convert to C90. Remove unnecessary prototypes and casts. + (get_osabi_name): Move so we don't need a forward declaration. + +2003-08-04 Bradley Harrington + Alan Modra + + * objdump.c (include_paths, include_path_count): New vars. + (usage): Describe --include. + (long_options): Add "include". + (add_include_path): New function. + (struct print_file_list): Make filename const. Add modname. + (try_print_file_open, update_source_path): New functions. + (show_line): Use them. + (main): Handle 'I' option. Don't check for NULL xrealloc arg. + +2003-07-30 Alan Modra + + * objdump.c: Remove unnecessary prototypes. + (disassemble_bytes): Add rel_offset parameter. Simplify reloc skipping + code, and print relocs when dump_dynamic_reloc_info. + (disassemble_data): Read and handle dynamic relocs. Correct reloc + skip code. Formatting. + (dump_bfd): Don't dump dynamic relocs when disassembling. + +2003-07-29 Ben Elliston + + * MAINTAINERS: Remove self as M88k maintainer. Future M88k + maintenance defaults to the blanket write privilege maintainers. + +2003-07-29 Michael Meissner + + * MAINTAINERS: Updated my email address. + +2003-07-29 Nick Clifton + + * objdump.c: Update to ISO C. + +2003-07-24 Nick Clifton + + * objdump.c (disassemble_data): Do not ignore sections without the + LOAD flag when disassemble_all is true. Only print a message + about disassembling a section if it contains some data. + + * po/fr.po: Updated French translation. + +2003-07-23 Nick Clifton + + * objcopy.c: Switch to ISO C. Remove debugging code accidentally + left in. Some formatting tidy ups. + +2003-07-22 Salvador Eduardo Tropea + + * objdump.c: New command line option --debugging-tags. + * doc/binutils.texi: Document new command line option. + * prdbg.c: Code to print the debug info as tags compatible + with ctags. + * budbg.h: Adjust prototype. + * NEWS: Mention new switch + +2003-07-18 Nick Clifton + + * objdump.c (main) :Accept multiple -M switch. + * doc/binutils.texi: Document that multiple -M switches are + accepted and that a single -M switch can contain comma + separated options. + +2003-07-17 Nick Clifton + + * objdump.c (main): Issue a warning message if multiple -M + switches are used. + + * doc/binutils.texi (objdump): Update documentation about -M + option. + +2003-07-17 Nick Clifton + + * po/es.po: New Spanish translation. + +2003-07-11 Alan Modra + + * po/binutils.pot: Regenerate. + +2003-07-05 Christopher Faylor + + * dlltool.c (prefix_encode): Use a fixed length for alpha. + +2003-07-04 Christopher Faylor + + * dlltool.c (prefix_encode): New function. Encode temp file prefix + from pid. + (dlltmp): Pass address of pointer being alloced or suffer neverending + mallocs. + (make_one_lib_file): Allocate enough space for new longer stub names. + (gen_lib_file): Ditto. + (main): Generate the temp file prefix from the pid if prefix was not + specified on the command line. + +2003-07-04 Nick Clifton + + * readelf.c (get_data): Print (unsigned) hex values for size and + offset in error messages. + (process_section_headers): If the string table could not be + allocated, do not continue. + +2003-07-01 Jakub Jelinek + + * readelf.c (dynamic_segment_ia64_val): Print address and newline + for sections by default. Comment fix. + +2003-06-28 Danny Smith + + * rcparse.y (res_text_field): New res_id variable. + (res_null_text): New static const struct res_id object, + with empty unicode name field. + (control): Pop parsing of optresidc up one level. Set + res_text_field to $2 except for controls which do not accept + a text field. Set res_text_field to res_null_text for the + special cases (viz. COMBOBOX, EDITTEXT, LISTBOX, SCROLLBAR). + (control_params): Adjust to use res_text_field rather + than optresidc. + (COMBOBOX): Add comment about discrepency between documented + vs. observed default style. + * resrc.c (define_control): Make first param const. + * windres.h (define_control): Adjust prototype. + +2003-06-27 Nick Clifton + + * objcopy.c (copy_object): Replace call to + bfd_create_gnu_debuglink_section with separate calls to + bfd_add_gnu_debuglink_section and + bfd_fill_in_gnu_debuglink_section, separated by a walk over the + symbol tables. + +2003-06-26 Roland McGrath + + * readelf.c (loadaddr): Variable removed. + (dynamic_info, version_info): Fix type long -> bfd_vma. + (program_headers): New variable. + (get_program_headers): New function, broken out of + process_program_headers. + (process_program_headers): Call it. Don't set `loadaddr'. + (slurp_ia64_unwind_table): Use get_program_headers. + (process_corefile_note_segments): Likewise. + (offset_from_vma): New function. + (process_relocs, process_dynamic_segment): Call that instead of + subtracting `loadaddr'. + (process_version_sections, process_symbol_table): Likewise. + (process_mips_specific): Likewise. + +2003-06-26 Nick Clifton + + * objcopy (enum strip_action): Add STRIP_NONDEBUG. + (OPTION_ONLY_KEEP_DEBUG): New. + (strip_options): Add --only-keep-debug. + (copy_options): Likewise. + (is_strip_section): Invert return value if STRIP_NONDEBUG is + active. + (copy_object): Do not copy private data when STRIP_NONDEBUG is + active. + (setup_section): Likewise. + (strip_main): Handle --only-keep-debug. + (copy_main): Likewise. + * NEWS: Mention new switch + * doc/binutils.texi: Document new switch. + +2003-06-25 Alan Modra + + * NEWS: Correct spelling of "relocatable". + * objdump.c: Likewise. + * sysroff.info: Likewise. + +2003-06-19 Nick Clifton + + * readelf.c (print_vma): When printing DEC_5 values, if the + number is bigger than 99999 switch to using hexadecimal + notation. + +2003-06-11 Nick Clifton + + * objcopy.c (gnu_debuglink_filename): New variable. + (OPTION_ADD_GNU_DEBUGLINK): New switch + (copy_options): Describe --add-gnu-debuglink switch. + Mention that --strip-debug removes sections as well. + (is_strip_section): Process the sections removed and kept + lists before checking for debugging sections. + (add_redefine_syms_file): Make function static. + (copy_object): Use is_strip_section. + Check to see if a .gnu_debuglink section should be added. If + so, call bfd_add_gnu_debuglink. + (setup_section): Use is_strip_section. + (copy_section): Use is_strip_section. + (copy_main): Handle OPTION_ADD_GNU_DEBUGLINK. + * NEWS: Mention new objcopy switch. + * doc/binutils.texi: Document new switch. + +2003-06-11 H.J. Lu + + * po/Make-in (DESTDIR): New. + (install-data-yes): Support $(DESTDIR). + (uninstall): Likewise. + +2003-06-11 Alan Modra + + * Makefile.in: Regenerate. + +2003-05-23 Jakub Jelinek + + * readelf.c (get_segment_type): Handle PT_GNU_STACK. + +2003-06-03 Elias Athanasopoulos + + * NEWS: Document the new BSD/POSIX single-character mapping for + .comment/.note sections. + +2003-06-02 Chris Demetriou + Jason Thorpe + + * objcopy.c (redefine_list_append): Add an argument that + indicates the context from which this function is being + called. Change all callers. + (copy_options): Add a new option, --redefine-syms. + (copy_usage): Document new option. + (copy_main): Handle the --redefine-syms option. + * doc/binutils.text (objcopy): Document new option. + +2003-05-31 Richard Henderson + + * readelf.c (byte_get_signed): New. + (get_encoded_value): New. + (display_debug_frames): Use it. Always pre-process opcodes. + +2003-05-20 Michal Ludvig + + * readelf.c (display_debug_frames): Print both registers + for DW_CFA_register. + +2003-05-16 Kelley Cook + + * configure.in: Accept i[3-7]86 variants. Escape '[]' for + i[3-7]86-*-interix. + * configure.in: Regenerate. + +2003-05-13 Michael Eager + + * objcopy.c: Treat identical src/dst file names as if only one + entered. One Windows creating an output file of the same name as + the input file will delete the input file before it is read. + +2003-05-12 Salvador Eduardo Tropea + + * debug.c (debug_get_real_type): Extend test for circular debug + references. + +2003-05-12 Nick Clifton + + * configure.in (ALL_LINGUAS): Add zh_CN. + * configure: Regenerate. + * po/zh_CN.po: New file: Chinese (simplified) translation. + +2003-05-11 Jason Eckhardt + + * MAINTAINERS: Update my mail address. + +2003-05-07 H.J. Lu + + * readelf.c (dump_relocations): Enlarge the type field in wide + mode by one character. + +2003-05-03 Richard Henderson + + * readelf.c (struct Frame_Chunk): Add cfa_exp. + (frame_display_row): Just print "exp" for cfa or register + defined by a location expression. + (display_debug_frames): Handle DW_CFA_def_cfa_expression, + DW_CFA_expression, DW_CFA_MIPS_advance_loc8. + +2003-04-30 H.J. Lu + + * objdump.c (only): Change it to char **. + (only_size): New. + (only_used): New. + (disassemble_data): Check only as an array. + (dump_data): Likewise. + (dump_relocs): Likewise. + (main): Treat only as an array. + +2003-04-24 Dimitrie O. Paun + + * doc/binutils.texi: Fix the documentation for the -fo option. + +2003-04-23 J"orn Rennecke + + * readelf.c (get_machine_name) : Amend return value + to refer to SuperH. + + * readelf.c (decode_location_expression): Don't add a trailing ';'. + +2003-04-23 Dimitrie O. Paun + Nick Clifton + + * windres.c (long_options): Move close to main, where it is used. + Add 'input' and 'output' long options. + (main): Accept "-fo" as an alias for "-o". This is for rc + comptibility. + * doc/binutils.texi: Mention that -fo is accepted as an alias for + -o, but discourage its use. + +2003-04-22 Dimitrie O. Paun + + * windres.c (format_from_name): Make the exit on error + behaviour optional. + (main): Rename the -I option to -J. Introduce -I as a synonym + for --include-dir. For backwards compatibility also support the + old -I behaviour, but issue a deprecation warning. + * doc/binutils.texi: Rename -I to -J. Document the new behaviour + of the -I option. + +2003-04-22 Kazuhiro Inaoka + + * readelf.c: Replace references to Mitsubishi M32R with + references to Renesas M32R. + +2003-04-15 Rohit Kumar Srivastava + + * readelf.c: Replace occurrances of 'Hitachi' with 'Renesas'. + +2003-04-09 Alexandre Oliva + + * doc/binutils.texi (objdump) [--debugging]: Suggest readelf -w + for debugging information types not supported by objdump. + +2003-04-09 Bernd Jendrissek + + * configure.in: Recognize canonical form of i[3-6]86-pe*. + * configure: Regenerate. + +2003-04-09 Alexandre Oliva + + * readelf.c (display_debug_info): Apply RELA relocations on the + entire section. + (byte_put_little_endian, byte_put_big_endian): New functions. + (byte_put): New variable. + (get_file_header): Initialize it. + +2003-04-05 Dimitrie O. Paun + + * windres.c: Add -l for compatibility with wrc, and rc. + Use the short option as a key for long options that have + a synonymous short option. + * doc/binutils.texi: Added -l to the list of options. + +2003-04-03 Dimitrie O. Paun + + * windres.c: Add -U for compatibility with wrc, rc, and cpp. + (main): Just pass the -U option down to the preprocessor. + * doc/binutils.texi: Added -U to the list of options. + +2003-04-01 Dimitrie O. Paun + + * windres.c (usage): Report -r option. + (main): Ignore the -r option. + * doc/binutils.texi: Add -r to the list of options. + +2003-04-01 Bob Wilson + + * MAINTAINERS: Add myself as Xtensa maintainer. + +2003-04-01 Bob Wilson + + * readelf.c: Include "elf/xtensa.h". + (guess_is_rela): Add EM_XTENSA and EM_XTENSA_OLD to list of + targets that use RELA relocations. + (dump_relocations): Call elf_xtensa_reloc_type for + EM_XTENSA and EM_XTENSA_OLD. + (get_machine_name): Handle EM_XTENSA and EM_XTENSA_OLD. + +2003-04-01 Nick Clifton + + * configure.in: Change "arm-pe*" to "arm-*-pe*". Similarly for + thumb-pe*, mcore-pe and mcore-*elf. + * configure: Regenerate. + +2003-03-31 Alexandre Oliva + + * objdump.c (dump_data): Don't truncate the address to long; make + the width large enough, and uniform for all entries in a section. + +2003-03-31 H.J. Lu + + * readelf.c: Include "libiberty.h". + (dynamic_relocations): New. + (process_relocs): Properly handle dynamic relocation. + (process_dynamic_segment): Fill relocation elements in + dynamic_info. + +2003-03-31 Kevin Buettner + + * readelf.c (read_and_display_attr, read_and_display_attr_value): + Add new arguments ``offset_size'' and ``dwarf_version''. Adjust + all callers. + (display_debug_lines, display_debug_pubnames, display_debug_info) + (display_debug_aranges, display_debug_frames, read_and_display_attr) + (read_and_display_attr_value): Add 64-bit DWARF support. + +2003-03-31 Ian Lance Taylor + + * rcparse.y: Replace uses of 'optstringrc' with 'optresid'. + (optresid): Handle a resource id that can be a string or a number. + * resrc.c (define_control): Replace 'text' parameter with 'iid' a + struct res_id. + (define_icon_control): Pass a struct res_id to define_control. + * windres.h (define_control): Change prototype. + +2003-03-24 Elias Athanasopoulos + + * objcopy (OPTION_FORMATS_INFO): Define. + (strip_options): Add "info"/OPTION_FORMATS_INFO option. + (copy_options): Likewise. + (strip_usage): Add "--info" to usage. + (copy_usage): Likewise. + (strip_main): Declare formats_info. Iniatilize it to FALSE. + Handle "info". + (copy_main). Likewise. + * doc/binutils.texi. Document the "--info" option for + objcopy/strip. + * NEWS: Mention the new command line switch. + + * objdump.c (endian_string): Move to bucomm.c. + (display_info): Likewise. + (display_target_list): Likewise. + (display_info_table): Likewise. + (display_target_tables): Likewise. + (main): Assign the return value of display_info to exit_status. + * bucomm.c: Include bfdver.h and libbfd.h + (display_target_list): Call bfd_nonfatal instead of nonfatal and + return 0 on a non-fatal error, 1 on success. + (display_info_table): Likewise. + * bucomm.h (display_info): Provide a prototype. + * Makefile.am (bucomm.o): Add dependencies on bfdver.h and + libbfd.h. + * Makefile.in: Regenerate. + +2003-03-22 Danny Smith + + * dlltool.c (gen_def_file): Put demangled name comments on + own line preceding export name. + +2003-03-17 Nick Clifton + + * objdump.c (disassemble_data): Use disasm_info.fprintf_func not + printf for emitting new lines. + +2003-03-16 Elias Athanasopoulos + + * nm.c (print_symbol_info_bsd): Print the symbol's size instead of + the symbol's value when --size-sort is used, unless -S is used. + doc/binutils.texi (--size-sort): For non-bsd formats both the + value and size of the symbols are displayed. + +2003-03-13 Nick Clifton + + * po/da.po: Update. + +2003-03-12 Nick Clifton + + * MAINTAINERS: Remove Peter Targett as ARC maintainer. + +2003-03-10 Ben Elliston + + * MAINTAINERS: Update my mail address. + +2003-03-06 Elias Athanasopoulos + + * stabs.c (BYTES_IN_WORD): Remove definition. + * wrstabs.c (BYTES_IN_WORD): Likewise. + +2003-03-04 Nick Clifton + + * nm.c (main): Print a warning message if --size-sort and + --undefined-only are used together. + +2003-03-04 Elias Athanasopoulos + + * nm.c (print_symbol): Remove check for undefined_only. + +2003-03-03 Nick Clifton + + * po/da.po: Installed latest translation. + +2003-02-24 Nick Clifton + + * README: Update binutils references to 2.13. + Add paragraph about using --disable-nls. + +2003-02-24 Elias Athanasopoulos + + * doc/binutils.texi (nm --size-sort): Update. + +2003-02-21 James E Wilson + + * MAINTAINERS: Update email address. + +2003-02-21 Ian Wienand + + * readelf.c (get_ia64_dynamic_type): New function. + (dynamic_segment_ia64_val): New function. + (get_dynamic_type): If machine type is EM_IA_64 call + get_ia64_dynamic_val. + (get_ia64_section_type_name): Handle sections with types in the + SHT_IA_64_LOPSREG to SHT_IA_64_HIPSREG range. + (get_dynamic_flags): If machine type is EM_IA_64 call + dynamic_segment_ia64_val. + +2003-02-21 Bob Wilson + + * doc/binutils.texi: Fix typos and obvious texinfo mistakes. Make + section title capitalization more consistent. Update descriptions + of various options to be consistent with the code. Fix errors and + incomplete list in the description of c++filt format options. Remove + information about the linker. Change to be more polite about poor + bug reports. Replace FDL appendix with include of fdl.texi. + * doc/fdl.texi: New file. + +2003-02-21 Roger Sayle + + * objcopy.c (filter_symbols): Fix compilation problems with + HP-UX's C compiler. + +2003-02-19 Christopher Faylor + + * rclex.l (handle_quotes): Fix minor formatting problems introduced in + previous change. + +2003-02-19 Mark Blackburn + + * rclex.l (handle_quotes): Handle strings spanning more than one line. + +2003-02-12 Bob Wilson + + * nm.c (usage): Add `java' and `gnat' demangle styles and make + quotes consistent. + * objdump.c (usage): Ditto. Also fix some typos. + + * readelf.c (parse_args): Include 'H' option in call to getopt_long. + + * debug.c (debug_record_variable): Handle global register variables. + + * stabs.c (parse_stab): For N_SLINE only include + function_start_offset if the symbol is within a function; + otherwise, the value is absolute. + +2003-02-10 Nick Clifton + + * readelf.c (decode_ARM_machine_flags): Handle the + EF_ARM_MAVERICK_FLOAT flag. + +2003-02-04 Andreas Schwab + + * rddbg.c (read_section_stabs_debugging_info): Cast ptrdiff_t to + long and use %ld in printf format. + +2003-01-28 Richard Sandiford + + * readelf.c (dump_relocations): Reorder the r_info field for + little-endian mips elf64. Move #ifdef BFD64 to cover the new code. + +2003-01-21 Daniel Berlin + + * readelf.c (display_debug_loc): Skip address base changes. + +2003-01-17 Fabio Alemagna + + * readelf.c (get_osabi_name): Handle ELFOSABI_AROS, ELFOSABI_OPENVMS + and ELFOSABI_NSK. + +2003-01-16 Alan Modra + + * readelf.c: Include elf/ppc64.h. + (dump_relocations ): Use elf_ppc64_reloc_type. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2003-01-02 Ben Elliston + + * readelf.c (guess_is_rela): Handle EM_IQ2000. + (get_machine_name): Likewise. + (dump_relocations): Likewise. + * NEWS: Mention IQ2000 support. + +2003-01-02 Richard Sandiford + + * readelf.c (get_machine_flags): Handle E_MIPS_ARCH_32R2. + +2002-12-30 Chris Demetriou + + * doc/binutils.texi (objdump): Note MIPS HWR (Hardware Register) + changes in MIPS -M options. + +2002-12-30 Dmitry Diky + + * Makefile.am: Add msp430 target. + * Makefile.in: Regenerate. + * readelf.c: Add support for msp430 target. + +2002-12-27 Chris Demetriou + + * doc/binutils.texi (objdump): Document MIPS -M options. + +2002-12-23 Andreas Schwab + + * readelf.c (main): Reset dump request after each file. + +2002-12-23 Nick Clifton + + * nlmconv.c (main): Pass TRUE as third argument to + bfd_arch_get_compatible. + +2002-12-23 Nick Clifton + + * strings.c (isgraphic): Replace definition with STRING_ISGRAPHIC + macro. Handle 'S' encoding, accepting 8-bit characters. + (main): Parse 'S' encoding. + (get_char): Accept 'S' encoding. + (print_strings): Use STRING_ISGRAPHIC. + (usage): Document support of 'S' encoding. + * doc/binutils.texi: Document support of 'S' encoding/ + * NEWS: Mention new feature. + +2002-12-20 Alan Modra + + * README : Don't use libibery's needed_list or + required_list, instead link libiberty/*.o. + +2002-12-19 Kazu Hirata + + * doc/binutils.texi: Fix typos. + +2002-12-14 John David Anglin + + * doc/binutils.texi: Add missing parenthesis. + +2002-12-15 Nick Kelsey + + * objcopy.c: Add --prefix-symbols= option to rename all + symbols by adding the given prefix to the begining of the symbol + name. This is useful to provide name space separation regardless + of how the object file was created. Added --prefix-sections= + and --prefix-alloc-sections= options to rename all + sections (or all sections with the alloc flag set) by adding the given + prefix to the begining of the symbol name. + * NEWS: Mention this new feature. + * doc/binutils.texi: Document this new feature. + +2002-12-13 Alan Modra + + * dlltool.c (mcore_elf_gen_out_file): Replace all occurrences of + dyn_string_append with dyn_string_append_cstr. + + * emul_aix.c (ar_emul_aix_create): Remove unused function. + +2002-12-10 James Cownie + + * readelf.h (get_TAG_name, get_AT_name, + read_and_display_attr_value): Add support for UPC extensions to + DWARF2 spec. + * NEWS: Mention this new support. + +2002-12-08 Alan Modra + + * NEWS: Mention that bfd no longer declares a "boolean" type. + +2002-12-07 Alan Modra + + * readelf.c (process_program_headers): When setting loadaddr, don't + assume segment size is 4k. Use p_align instead. + (loadaddr): Change from int to long. + (dynamic_addr, dynamic_info, version_info): Likewise. + (process_dynamic_segment ): Likewise. + (process_dynamic_segment): Adjust print format string. + (rela_addr, rela_size): Delete. + (process_relocs): Formatting. + +2002-12-05 Jim Wilson + + * configure.in (OBJDUMP_DEFS): Define SKIP_ZEROES as 16 for IA-64. + * configure: Regenerate. + +2002-12-04 Ian Lance Taylor + + * MAINTAINERS: Change e-mail address back to airs.com. + +2002-12-04 Aldy Hernandez + + * MAINTAINERS: Add self. + +2002-11-30 Alan Modra + + * addr2line.c, ar.c, arsup.c, binemul.c, binemul.h, bucomm.c, bucomm.h, + budbg.h, debug.c, debug.h, dlltool.c, emul_aix.c, ieee.c, nlmconv.c, + nlmconv.h, nlmheader.y, nm.c, objcopy.c, objdump.c, prdbg.c, rdcoff.c, + rddbg.c, readelf.c, rename.c, size.c, stabs.c, strings.c, + unwind-ia64.h, wrstabs.c: Replace boolean with bfd_boolean, true with + TRUE, false with FALSE. Simplify comparisons of bfd_boolean vars + with TRUE/FALSE. Formatting. + +2002-11-29 Jakub Jelinek + + * readelf.c Replace occurrences of Elf32_Internal_* and + Elf64_Internal_* with Elf_Internal_*. + (slurp_rel_relocs): Change Elf_Internal_Rel to Elf_Internal_Rela. + Zero r_addend fields. + (dump_relocations): Remove relas variable, change Elf_Internal_Rel to + Elf_Internal_Rela. + +2002-11-23 Nick Clifton + + * size.c (usage): Fix typo describing switch for hex format. + +2002-11-18 Svein E. Seldal + + * testsuite/binutils-all/objcopy.exp: Disable tic4x from test + * testsuite/binutils-all/objdump.exp: Setup proper values for tic4x + testcase + +2002-11-14 Nick Clifton + + * readelf.c (process_program_headers): Add comment about return + value. Ensure that 0 is returned if the headers are not loaded. + (process_file): If process_section_headers failed to load the + headers disable any tests that rely upon them. Similarly for + process_program_headers. + +2002-11-12 Nick Clifton + + * po/da.po: Updated Danish translation. + +2002-11-12 Klee Dienes + + * rddbg.c (read_section_stabs_debugging_info): Also recognize + LC_SYMTAB.stab/LC_SYMTAB.stabstr as a valid pair of sections. + +2002-11-11 Christopher Faylor + + * MAINTAINERS: Reinstate DJ Delorie as COFF maintainer. Drop COFF from + cgf maintainership. + +2002-11-11 Christopher Faylor + + * MAINTAINERS: Replace DJ Delorie as PE/COFF maintainer. + +2002-11-07 Nick Clifton + + * configure.in (ALL_LINGUAS): Add 'da'. + * configure: Regenerate. + * po/da.po: New Danish translation. + + * readelf.c (get_symbol_index_type): Revert part of previous + patch: Display unknown symbol types in decimal, not hex. + +2002-11-07 Danny Smith + + * dlltool.c (add_excludes): Don't prefix excluded fastcall + symbols with underscore. + (xlate): Ignore add_underscore for decorated fastcall symbols. + +2002-11-07 Eric Kohl + + * deflex.l: Accept '@' as first character of an ID. + * dlltool.c (gen_exp_file): Use existing '@' prefix rather than + ASM_PREFIX for fastcall symbols. + (scan_drectve_symbols): Handle fastcall symbols when generating + undecorated aliases for symbols in drectve section. + (scan_filtered_symbols): Likewise, with export-all. + (xlate): Likewise, with --kill-at. + (make_imp_label): New function to handle fastcall symbols + correctly. + (make_one_lib_file): Use make_imp_label instead of make_label + for imp symbols. + +2002-11-06 Svein E. Seldal + + * MAINTAINERS: Add self as TIC4X maintainer. + +2002-11-06 Hiroyuki Machida + + * readelf.c (get_symbol_index_type): Add hex number to + PROCESSOR-specific, OS-specific, reserved and unknown symbol + types. + +2002-11-04 Alan Modra + + * readelf.c (byte_get_little_endian): Comment typo fix. + (print_symbol): Constify "symbol" arg. Don't pass "symbol" to printf + as the format string. + (dump_relocations): Correct section sym names. + (process_section_headers): Clear symtab_shndx_hdr. + (read_and_display_attr_value): Don't pass indirect string to printf + as the format string. + (display_debug_frames): Indicate when zero terminator found. Decode + DW_EH_PE_pcrel addresses. + +2002-10-23 Svein E. Seldal + + * configure.in: Define SKIP_ZEROES as 32 for tic4x target in + order to ensure proper disassembly of the valid 0-value opcode. + * configure: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * configure.in: Regenerate. + * doc/Makefile.in: Regenerate. + * po/binutils.pot: Regenerate. + +2002-10-23 Kaz Kojima + + * MAINTAINERS: Add self as SH maintainer. + +2002-10-23 Ben Elliston + + * doc/binutils.texi (objdump): Document -z and move the entry for + --disassemble-zeroes to the end of the options section (for `z'). + +2002-10-21 Nick Clifton + + * MAINTAINERS: Discontinue Hans-Peter Nilsson as SH maintainer. + +2002-10-21 Svein E. Seldal + + * objdump.c (dump_data): Correct addr_offset for opb != 1. + +2002-10-15 Alan Modra + + * bucomm.c (list_supported_targets): Use bfd_target_list. + + * objcopy.c (copy_file): Report ambiguous bfd_object matches, and + other object errors in preference to bfd_core errors. + +2002-10-14 Alan Modra + + * Makefile.am: Run "make dep-am". + * objdump.c: #include "bfdver.h". + * version.c: Likewise. + * Makefile.in: Regenerate. + * config.in: Regenerate. + * configure: Regenerate. + * po/POTFILES.in: Regenerate. + +2002-10-09 Daniel Jacobowitz + + * readelf.c (display_debug_info): Ignore empty .rela.debug_info + sections. Allow relocations against the absolute symbol. Don't + use the value in compunit.cu_abbrev_offset if we found a RELA + relocation. + +2002-10-07 Gordon Chaffee + + * addr2line.c (slurp_symtab): Read in dynamic symbols if no + ordinary ones are available. + +2002-09-30 H.J. Lu + + * readelf.c (get_machine_flags): Handle E_MIPS_MACH_4120, + E_MIPS_MACH_5400 and E_MIPS_MACH_5500. + +2002-09-17 Zack Weinberg + + * Makefile.am (CFILES): Add cxxfilt.c. + (cxxfilt_SOURCES): Now just cxxfilt.c $(BULIBS). + (cxxfilt_LDADD): Delete. + Remove all references to underscore.c. + Regen dependencies. + * configure.in: Define TARGET_PREPENDS_UNDERSCORE in + config.h from $UNDERSCORE, rather than AC_SUBSTing it. + * binutils/cxxfilt.c: Moved here from gcc/cp, minor + adjustments to fit into binutils framework. + * configure, config.in, Makefile.in, doc/Makefile.in: Regenerate. + +2002-09-12 Roland McGrath + + * readelf.c (decode_location_expression): DW_OP_calli -> DW_OP_call_ref + Handle DW_OP_GNU_push_tls_address. + +2002-09-11 Nick Clifton + + * po/tr.po: Updated Turkish translation. + +2002-09-10 Nick Clifton + + * MAINTAINERS: Add Ben Elliston as a maintainer for configure and + testsuite changes. Add paragraphs about testsuite and config + patches. + +2002-08-29 Nick Clifton + + * readelf.c (get_machine_flags): Remove redundant reference to + E_V850EA_ARCH. + +2002-08-28 Alan Modra + + * objdump.c (dump_bfd): Restore lines accidentally deleted in + last commit. + +2002-08-28 Michael Hayes + + * objdump.c (dump_headers): Add printing of HAS_LOAD_PAGE flag. + (dump_bfd_header): Likewise. + +2002-08-27 Alan Modra + + * nm.c: Revert last change. + +2002-08-26 Alan Modra + + * nm.c (display_rel_file): Don't report "no symbols" as an error. + * objdump.c (slurp_symtab): Likewise. + (slurp_dynamic_symtab): Likewise. + (dump_symbols): Likewise. Do print "no symbols" to stdout. + +2002-08-24 Geoffrey Keating + + * MAINTAINERS: Change my mailing address. + +2002-08-23 John David Anglin + + * MAINTAINERS: Add Dave Anglin as HPPA co-maintainer. + +2002-08-22 Nick Clifton + + * MAINTAINERS: Add Jeff Law as (maintainance) maintainer for + HPPA. + +2002-08-21 John David Anglin + + * readelf.c (parse_args): Change debug_dump_opt to static. + +2002-08-16 Sivaguru Sankaridurg + + * stabs.c (parse_stab_argtype): Pass length of physname to + stab_demangle_argtypes. + (stab_demangle_argtypes): Add new parameter - length of physname. + Pass length of physname on to stab_demangle_prefix. + (stab_demangle_prefix): Add new parameter - length of physname. + Use length of physname (if supplied) to compute end of function + name. + +2002-08-15 Alan Modra + + * readelf.c: Include elf/i370.h. + (dump_relocations): Handle EM_S370. + (dynamic_segment_parisc_val): Print \n. + (process_dynamic_segment ): Here too. + +2002-08-14 Nick Clifton + + * nm.c (usage): Change 'gnu-new-abi' to 'gnu-v3'. + * objdump.c (usage): Likewise. + * doc/binutils.texi: Likewise. + +2002-08-14 Luke Dunstan + + * rcparse.y (acc_entry): Don't warn about ALT use with + non-VIRTKEY. + +2002-08-13 H.J. Lu + + * objcopy.c (copy_object): Don't warn about the unsupported + architecture unless the input target is defaulted or the + output architecture is different from the input. + +2002-08-09 Nick Clifton + + * po/sv.po: Updated Swedish translation. + +2002-08-05 Alan Modra + + * prdbg.c (pr_fix_visibility): Remove assert. + +2002-07-31 Nick Clifton + + * addr2line.c (process_file): Rename parameter 'filename' to + 'file_name' in order to avoid shadowing global symbol of the + same name. + (main): Likewise. + +2002-07-30 Jakub Jelinek + + * readelf.c (OPTION_DEBUG_DUMP): Define. + (options): Use it. + (usage): Update help. + (parse_args): Handle --debug-dump separately from -w. + * doc/binutils.texi (readelf): Update documentation. + +2002-07-25 Nick Clifton + + * po/es.po: Updated Spanish translation. + * po/fr.po: Updated French translation. + +2002-07-24 Nick Clifton + + * po/es.po: Updated Spanish translation. + +2002-07-23 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2002-07-23 Nick Clifton + + * po/fr.po: Updated French translation. + +2002-07-23 Eric S. Raymond + + * doc/binutils.texi (addr2line ): Correct brackets. + +2002-07-20 Alan Modra + + * budemang.c: Include config.h and string.h/strings.h. + +2002-07-18 Denis Chertykov + Frank Ch. Eigler + + * readelf.c: Include "elf/ip2k.h". + (guess_is_rela): Add support for EM_IP2K and EM_IP2K_OLD. + (dump_relocations): Likewise. + (get_machine_name): Likewise. + * NEWS: Mention IP2K support. + +2002-07-16 Nick Clifton + + * NEWS: Add 'Changes in 2.13'. + +2002-07-10 Jakub Jelinek + + * readelf.c (get_dynamic_type): Handle DT_GNU_PRELINKED, + DT_GNU_CONFLICT* and DT_GNU_LIBLISZ*. + (get_section_type_name): Handle SHT_GNU_LIBLIST. + (process_dynamic_segment): Handle DT_GNU_CONFLICTSZ, + DT_GNU_LIBLISTSZ and DT_GNU_PRELINKED. + (process_gnu_liblist): New. + (process_file): Call it. + +2002-07-03 Alan Modra + + * Makefile.am (check-DEJAGNU): Revert 2002-06-25 change. + * Makefile.in: Regenerate. + +2002-07-02 Alan Modra + + * budemang.c: New file, "demangle" function. + * budemang.h: New file. + * addr2line.c (translate_addresses): Use "demangle". + * nm.c (print_symname): Likewise. + * objdump.c (objdump_print_symname): Likewise. + (dump_symbols): Likewise. Also, don't use bfd_asymbol_name macro + here since that obfuscates. + * rdcoff.c: Don't #include demangle.h. + * Makefile.am (CFILES): Add budemang.c, emul_aix.c, + emul_vanilla.c. Remove emul_$(EMULATION).c. Sort. + (HFILES): Add budemang.h. Sort. + (nm_new_SOURCES, objdump_SOURCES, addr2line_SOURCES): Add budemang.c. + Run "make dep-am". + * Makefile.in: Regenerate. + +2002-07-01 Matt Thomas + + * readelf.c: Include "elf/vax.h". + (guess_is_rela): Move EM_VAX from unknown to RELA case. + (dump_relocations): Handle VAX relocations. + (get_machine_flags): Handle VAX machine flags. + +2002-06-29 Stephane Carrez + + * readelf.c (dump_relocations): Handle 68HC11/68HC12 relocations. + +2002-06-26 Nick Clifton + + * MAINTAINERS: Remove Tom Rix from d10v and pcc maintainerships. + +2002-06-26 Alan Modra + + * nm.c (print_symname): When demangling, strip leading dots from + symbol names to avoid confusing the demangler. + +2002-06-25 H.J. Lu + + * Makefile.am (check-DEJAGNU): Set LC_ALL=C and export it. + * Makefile.in: Regenerated. + +2002-06-21 Igor Schein + + * configure.in: Quote bu_cv_have_fopen64. + * configure: Regenerate. + +2002-06-21 Mitsru Chinen + + * configure.in: Check for strcoll. + * configure: Regenerate. + * config.in: Regenerate. + * nm.c (main): Set locale for LC_COLLATE category. + (non_numeric_forward): Use strcoll if available. + +2002-06-20 Dave Brolley + + * MAINTAINERS: Add self as fr30 and frv maintainer. + +2002-06-18 H.J. Lu (hjl@gnu.org) + + * nm.c: Include "elf/common.h". + (extended_symbol_info): Add elfinfo, a pointer to + elf_symbol_type. + (SYM_SIZE): Use elfinfo if it is not NULL. + (get_symbol_type): New function. + (display_archive): Set print_width for each archive member. + (display_file): Likewise. + (display_rel_file): Don't set print_width here. + (print_object_filename_sysv): Handle print_width. + (print_archive_member_sysv): Likewise. + (print_symbols): Pass (bfd_vma) 0 to print_symbol. + (print_symbol): Set the elfinfo field in extended_symbol_info + for ELF. + (print_object_filename_sysv): Fix the output format. + (print_symbol_info_sysv): Print type and section for ELF. + +2002-06-18 Elias Athanasopoulos + + * nm.c (print_size_symbols): Remove assignment, which makes + the symbol's size equal to its value when --size-sort is + used. + +2002-06-18 Dave Brolley + + From Catherine Moore: + * readelf.c (elf/frv.h): #include it. + (guess_is_rela): Support EM_CYGNUS_FRV. + (dump_relocations): Ditto. + (get_machine_name): Ditto. + * Makefile.am (readelf.o): add dependency on $(INCDIR)/elf/frv.h. + +2002-06-18 Jakub Jelinek + + * readelf.c (get_file_header): Only read the first section header if + e_shoff is non-zero. + +2002-06-15 H.J. Lu (hjl@gnu.org) + + * nm.c (print_size): New variable. Initialize to 0. + (long_options): Add 'S'/"print-size". + (main): Handle 'S'. + (print_symbol_info_bsd): Print size only if print_size is not + 0. + + * doc/binutils.texi: Document -S/--print-size. + +2002-6-13 Elias Athanasopoulos + + * nm.c (struct extended_symbol_info): New structure: Add the size + of the symbols to the information provided by the symbol_info + structure. + (print_symbols): Pass the symbol size to print_symbol. + (print_size_symbols): Pass the symbol size to print_symbol. + (print_symbol): Extra argument: The size of the symbol. Store + this in the extended_symbol_info structure. + (print_symbol_info): Change type of info parameter to + extended_symbol_info. Display the size, if known. + (print_symbol_info_posix): Likewise. + (print_symbol_info_sysv): Likewise. + +2002-06-08 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * doc/Makefile.in: Regnerate. + + * bucomm.c: Replace CONST with const. + * nm.c: Likewise. + * objdump.c: Likewise. + +2002-06-07 H.J. Lu + + * readelf.c (DW_CFA_GNU_args_size): Don't define. + (DW_CFA_GNU_negative_offset_extended): Likewise. + (DW_CFA_GNU_window_save): Likewise. + (display_debug_frames): Handle DW_CFA_offset_extended_sf, + DW_CFA_def_cfa_sf and DW_CFA_def_cfa_offset_sf. + +2002-06-07 Elias Athanasopoulos + + * nm.c: When computing size of symbols for an ELF target use the + internal size field. + +2002-06-06 John David Anglin + + * testsuite/binutils-all/objcopy.exp: clear xfail for + "hppa*64*-*-hpux*". + * testsuite/binutils-all/hppa/objdump.exp: Return if + "*64*-*-*". + +2002-06-05 Alan Modra + + * objcopy.c (copy_section): Don't copy SEC_GROUP sections. + +2002-06-03 Elias Athanasopoulos + + * objdump.c: Fix formatting. + +2002-05-29 Ben Elliston + + * MAINTAINERS: Add self as M68k maintainer. + +2002-05-28 Kuang Hwa Lin + + * readelf.c: Modified/Added DLX elf support. + +2002-05-27 Nick Clifton + + * arsup.c: Fix formatting. + * debug.c (debug_record_label): Add missing colon to error + message. + * ieee.c (parse_ieee_ty): Fix spelling typo. + * readelf.c (process_program_headers): Remove English assumption + about making a plural word. + (process_section_headers): Likewise. + (process_relocs): Allow quotes to be translated. + (process_unwind): Likewise, + (process_mips_specific): Improve error message. + (get_note_type): Fix spelling typo. + + * configure.in (ALL_LINGUAS): Add sv + * po/sv.po: New file. + +2002-05-27 Alan Modra + + * unwind-ia64.c (unw_print_brmask): Don't use sprintf. + (unw_print_grmask): Likewise. + (unw_print_frmask): Likewise. + +2002-05-26 Kazu Hirata + + * arsup.c: Remove ARGSUSED. + * debug.c: Likewise. + * ieee.c: Likewise. + * nlmconv.c: Likewise. + * prdbg.c: Likewise. + * stabs.c: Likewise. + * wrstabs.c: Likewise. + +2002-05-25 Alan Modra + + * arlex.l: Use #include "" instead of <> for local header files. + * coffdump.c: Likewise. + * coffgrok.c: Likewise. + * nlmconv.c: Likewise. + * nlmheader.y: Likewise. + * srconv.c: Likewise. + * strings.c: Likewise. + * sysdump.c: Likewise. + * unwind-ia64.h: Likewise. + * windres.h: Likewise. + * winduni.h: Likewise. + +2002-05-24 Tom Rix + + * MAINTAINERS: Add self as the d10v maintainer. + +2002-05-24 TAMURA Kent + + * configure.in: Builds dlltool for i386-netbsdpe. + * configure: Regenerate. + +2002-05-23 Kazu Hirata + + * size.c: Fix formatting. + * srconv.c: Likewise. + * stabs.c: Likewise. + * sysdump.c: Likewise. + * unwind-ia64.c: Likewise. + * wrstabs.c: Likewise. + +2002-05-23 Jakub Jelinek + + * readelf.c (get_segment_type): Add PT_TLS. + (get_elf_section_flags): Add SHF_TLS. + (get_dynamic_flags): Optimize. Add DF_STATIC_TLS. + (process_dynamic_segment): Use puts instead of printf. + (get_symbol_type): Support STT_TLS. + * objdump.c (dump_section_header): Remove SEC_CONSTRUCTOR_TEXT, + SEC_CONSTRUCTOR_DATA, SEC_CONSTRUCTOR_BSS. + Add SEC_THREAD_LOCAL. + +2002-05-23 Kazu Hirata + + * rdcoff.c: Fix formatting. + * rddbg.c: Likewise. + * readelf.c: Likewise. + * rename.c: Likewise. + * resbin.c: Likewise. + * resrc.c: Likewise. + * resres.c: Likewise. + +2002-05-21 Kazu Hirata + + * filemode.c: Fix formatting. + * ieee.c: Likewise. + * is-ranlib.c: Likewise. + * is-strip.c: Likewise. + * maybe-ranlib.c: Likewise. + * maybe-strip.c: Likewise. + * nlmconv.c: Likewise. + * nm.c: Likewise. + * not-ranlib.c: Likewise. + * not-strip.c: Likewise. + * objcopy.c: Likewise. + * objdump.c: Likewise. + +2002-05-21 Thiemo Seufer + + * objdump.c (dump_headers): Fix output formatting for ELF32 + architectures in a BFD64 enabled toolchain. + +2002-05-20 Kazu Hirata + + * debug.c: Fix formatting. + * debug.h: Likewise. + * dlltool.c: Likewise. + * dllwrap.c: Likewise. + * emul_aix.c: Likewise. + * emul_vanilla.c: Likewise. + +2002-05-19 Kazu Hirata + + * addr2line.c: Fix formatting. + * ar.c: Likewise. + * arsup.c: Likewise. + * arsup.h: Likewise. + * binemul.c: Likewise. + * binemul.h: Likewise. + * bucomm.c: Likewise. + * coffdump.c: Likewise. + * coffgrok.c: Likewise. + * coffgrok.h: Likewise. + +2002-05-16 Marek Michalkiewicz + + * MAINTAINERS: Add myself as the second AVR port maintainer. + +2002-05-16 Stephane Carrez + + * MAINTAINERS: Update my email address. + +2002-05-09 Nick Clifton + + * MAINTAINERS: Add Jason Thorpe as VAX maintainer. + +2002-05-09 Alan Modra + + * configure.in: Replace `*pe' with `pe' throughout. + * configure: Regenerate. + +2002-05-07 Federico G. Schwindt + + * Makefile.am: Honour DESTDIR. + * Makefile.in: Regenerate. + +2002-05-06 Alan Modra + + * dlltool.c (process_def_file): Add missing prototype. + (new_directive, assemble_file, main): Likewise. + (process_def_file, new_directive): Make static. + (inform): Rewrite using VA_FIXEDARG. + * dllwrap.c (mybasename): Add missing prototype. + (strhash, main): Likewise. + (inform): Rewrite using VA_FIXEDARG. + (warn): Likewise. + (cleanup_and_exit): Use old style function definition. + (strhash): Likewise. + * windres.c (define_resource): Use one memset to clear all of + struct res_resource. + + * rcparse.y: Remove newcmd rule. Move rcparse_discard_strings + call to rules that need no lookahead. Check for no lookahead. + +2002-05-06 Borut Razem + + * rclex.l (get_string): Correct "strings" list handling. + * resrc.c (read_rc_file): Discard strings. + +2002-05-04 Alan Modra + + * ar.c (replace_members): Remove unused var. Formatting fix. + * binemul.c (ar_emul_default_parse_arg): Add ATTRIBUTE_UNUSED. + + * MAINTAINERS: Sort port maintainers by CPU. + +2002-05-04 Bob Byrnes + + * size.c (display_archive): Add last_arfile and code to close archives. + +2002-05-01 Alan Modra + + * nm.c (print_symbol): Check returned filename from + bfd_find_nearest_line is non-NULL. + +2002-04-25 Elena Zannoni + + * readelf.c (get_AT_name): Handle DW_AT_GNU_vector. + +2002-04-24 Christian Groessler + + * MAINTAINERS: Changed my email address. + +2002-04-17 Thiemo Seufer + + * arparse.y: Fix syntax warning. + +2002-04-16 Nick Clifton + + * readelf.c (fetch_location_list): Remove unused function. + + * readelf.c (process_corefile_note_segment): Catch corrupt notes + and display a warning message, then exit the loop. + + * rcparse.y: Set MEMFLAG_DISCARDABLE by default. + +2002-04-15 Nick Clifton + + * resrc.c (write_rc_dialog): If charset is non-default value + display all of the DIALOGEX parameters. + +2002-04-15 Eric Kohl + + * rcparse.y: Allow two to five parameter in FONT statement of + DIALOGEX resources. + * resbin.c (bin_to_res_dialog): Fixed read/write code for dialogex + resource data. + (res_to_bin_dialog): Likewise. + * windres.h: Added misssing charset variable to dialog_ex + structure. + +2002-04-10 Nick Clifton + + * rcparse.y: Set MEMFLAG_PURE by default. + +2002-04-09 Bernd Herd + + * rcparse.y: CLASS definitions in DIALOG resources + are quoted. + Fix typo in BEDIT warning. + Don't add default dialog style when explicit style specified. + Add WS_CAPTION dialog style if CAPTION is specified. + + * rclex.l (handle_quotes): "\xhex" encoding in strings corrected. + (handle_quotes) "\a" escape (used for right justified key + definitions in menus) is encodes as binary 8. + + * resrc.c (write_rc_dialog): Print style even if it is 0. + (write_rc_directory): Fix overlooked sublang shift bug. + (bin_to_res_dialog): Don't print empty dialog caption. + + * resbin.c (bin_to_res_dialog): Use signature to identify + DIALOGEX. + + * windres.c (main): Set default LANGUAGE to english/us. + +2002-04-09 Gunnar Degnbol + + * resrc.c: print CLASS names in quotes + +2002-04-09 J"orn Rennecke + + * MAINTAINERS: Update my email address. + +2002-04-04 Alan Modra + + * dep-in.sed: Cope with absolute paths. + * Makefile.am (dep.sed): Subst TOPDIR. + Run "make dep-am". + * Makefile.in: Regenerate. + +2002-03-27 Peter Targett + + * MAINTAINERS: Update my email address. + +2002-03-21 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * configure: Regenerate. + +2002-03-20 Daniel Berlin + + * readelf.c: Add support for displaying dwarf2 location lists. + (do_debug_loc, debug_loc_section, debug_loc_size): New. + (parse_args): Use 'O' as shorthand for displaying location list + section. + (process_section_headers): Handle debug_loc as well. + (load_debug_loc): New. + (free_debug_loc): New. + (fetch_location_list): New. + (display_debug_loc): New. + (display_debug_info): Call load_debug_loc and free_debug_loc. + (debug_displays): We can display .debug_loc now, too. + (usage): Update usage string. + (read_and_display_attr_value): Note location lists, but don't + display them inline. + +2002-03-18 Tom Rix + + * Makefile.am: Add binutils emulation support. + * configure.in: Same. + * configure.tgt: New file. Same. + * ar.c (main): Use ar_emul_parse_arg. + (usage): Use ar_emul_usage. + (replace_members): Use ar_emul_replace, ar_emul_append. + * binemul.c: New file. Define the binutils emulation + layer. Define default methods. + * binemul.h: New file. Binutils emulation layer header file. + * emul_aix.c: New file. AIX binutils emulation. + * emul_vanilla.c: New file. Default binutils emulation. + * Makefile.in: Regenerate. + * configure: Same. + +2002-03-18 Nick Clifton + + * po/fr.po: Updated version. + +2002-03-13 Nick Clifton + + * po/fr.po: Updated version. + +2002-03-07 Daniel Jacobowitz + + * README: Update some version numbers. + +2002-03-07 Daniel Jacobowitz + + * doc/binutils.texi (Target Selection): Fix LD crossreferences. + (Architecture Selection): Likewise. + +2002-03-01 Dmitry Timoshkov + + * dlltool.c (gen_exp_file): Take into account --kill-at (-k) while + generating .exp file. + +2002-02-21 Nick Clifton + + * readelf.c (dump_relocations): Fix typo. + +2002-02-20 Nick Clifton + + * NEWS: Mark 2.12 branch. + +2002-02-18 Timothy Daly + + * readelf.c (dump_relocations): Display 2nd and 3rd reloc + types for 64-bit MIPS. Narrow some fields for 80-char + output. + (dump_relocations): Change spelling from 'unrecognised' + to 'unrecognized'. + (decode_ARM_machine_flags): Likewise. + (parse_args): Likewise. + (read_and_display_attr_value): Likewise. + (display_debug_section): Likewise. + +2002-02-15 Hans-Peter Nilsson + + * NEWS: Mention support for MMIX. + +2002-02-13 Matt Fredette + + * readelf.c (get_machine_flags): Recognize EF_M68000. + +2002-02-12 Alexandre Oliva + + * MAINTAINERS: Added self as MN10300 co-maintainer. + +2002-02-12 Alan Modra + + * readelf.c (get_ppc64_dynamic_type): Handle DT_PPC64_OPD and + DT_PPC64_OPDSZ. + +2002-02-11 Daniel Jacobowitz + + * MAINTAINERS: List myself as branch maintainer. + +2002-02-11 Alan Modra + + * configure: Regenerate. + * objcopy.c: Update copyright date. + * doc/Makefile.in: Regenerate. + +2002-02-10 Daniel Jacobowitz + + * nlmconv.c: Back out localtime PARAMS change. + +2002-02-11 Alan Modra + + * objcopy.c (MKDIR): Define. + (copy_archive): Make name_list.name const. Use MKDIR. + Handle duplicate files in archives by making more temp dirs. + +2002-02-10 Daniel Jacobowitz + + * coffdump.c: Include "getopt.h" after "bucomm.h" + so that macros are defined correctly. + * nlmconv.c: Add PARAMS ((const time_t *)) to localtime + prototype. Prototype main. + * nlmheader.y: Add PARAMS ((int)) to strerror prototype. + +2002-02-06 Alexandre Oliva + + * MAINTAINERS: Added self as SH co-maintainer. + +2002-02-05 Nick Clifton + + * po/tr.po: Updated translation. + +2002-02-01 Alan Modra + + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + +2002-01-29 Daniel Jacobowitz + + * nm.c (print_value): Mark abfd unused. + +2002-01-29 Daniel Jacobowitz + + * unwind-ia64.c (unw_decoder): Change second argument + to unsigned int, to match function prototypes. + +2002-01-29 Daniel Jacobowitz + + * objdump.c: Include "getopt.h" after "bucomm.h" so that + __GNU_LIBRARY__ will be defined. + * size.c: Likewise. + +2002-01-27 Daniel Jacobowitz + + * configure: Regenerated. + +2002-01-26 Hans-Peter Nilsson + + * doc/Makefile.am (install): Depend on install-info. + * doc/Makefile.in: Regenerate. + +2002-01-25 Jason R. Thorpe + + * objcopy.c (strip_usage): Document -d as an alias + --strip-debug. + + * size.c (usage): Document [-t | --totals] options. + (long_options): Add --totals option. + (main): If the [-t | --totals] option is specified and + the output format is Berkeley-style, print the total + text, data, and bss sizes of all objects listed. + (print_berkeley_format): If the [-t | --totals] option + is specified, track the total text, data, and bss + sizes. + * doc/binutils.texi (size): Document [-t | --totals] options. + (strip): Document -d as an alias for --strip-debug. + * NEWS: Mention new feature of size. + +2002-01-25 Nick Clifton + + * po/fr.po: Updated version. + * po/es.po: Updated version. + +2002-01-23 Nick Clifton + + * addr2line.c (usage): Update text to provide verbose + description of the command line options. + * ar.c (usage): Update text to provide verbose + description of the command line options. + (main): Accept -h and -H when running as ranlib. + * coffdump.c (show_usage): Update text to provide verbose + description of the command line options. + * dlltool.c (main): Accept -H as an alias for --help. + * nlmconv.c (show_usage): Update text to provide verbose + description of the command line options. + * nm.c (usage): Replace OPTIONS with option(s). + (main): Accept -H as an alias for --help. + * objcopy.c (strip_main): Accept -H as an alias for --help. + * objdump.c (main): Accept -v as an alias for --verbose. + * readelf.c (usage): Adjust format to match style used in + other binutils. + * size.c (usage): Update text to provide verbose description + of the command line options. + (main): Accept -v, -h and -H as command line options. + * srconv.c (show_usage): Update text to provide verbose + description of the command line options. + * strings.c (main): Accept -H and -v as command line options. + (usage): Update text to provide verbose description of the + command line options. + * sysdump.c (show_usage): Update text to provide verbose + description of the command line options. + * windres.c (usage): Adjust format to match style used in + other binutils. + + * coffdump.c: Fix formatting. + * nlmconv.c: Fix formatting. + * srconv.c: Fix formatting. + * sysdump.c: Fix formatting. + +2002-01-22 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2002-01-18 Andreas Jaeger + + * version.c (print_version): Update year. + +2002-01-17 Alan Modra + + * readelf.c (get_machine_name): Handle EM_PPC64. + (guess_is_rela): Here too. + +2002-01-17 Nick Clifton + + * po/binutils.pot: Regenerate. + * po/fr.po: Regenerate. + * po/tr.po: Regenerate. + +2002-01-16 Nick Clifton + + * po/tr.po: Import new version. + +2002-01-16 Alan Modra + + * readelf.c (get_ppc64_dynamic_type): New. + (get_dynamic_type): Call it. + +2002-01-15 Nick Clifton + + * objcopy.c (copy_usage): Use "options" instead of "switches". + (strip_usage): Use "options" instead of "switches". + * doc/binutils.texi (dlltool): Refer to "options" instead of + "switches". + +2002-01-14 Richard Earnshaw + + * MAINTAINERS: Add self as co-maintainer for the ARM code. + +2001-12-18 Nick Clifton + + * po/es.po: Import from translation project. + * configure.in (ALL_LINGUAS): Add es. + * configure: Regenerate. + +2002-01-09 Jason Thorpe + + * readelf.c (get_netbsd_elfcore_note_type): Use + NT_NETBSDCORE_PROCINFO and NT_NETBSDCORE_FIRSTMACH. + +2002-01-09 Jason Thorpe + + * readelf.c: Update copyright years. + (get_note_type): Return a const char *. + (get_netbsd_elfcore_note_type): New function. + (process_note): Use get_netbsd_elfcore_note_type to get + the note type string for NetBSD ELF core files. + +2002-01-06 Steve Ellcey + + * readelf.c (get_ia64_segment_type): Add support for macros. + (get_segment_type): Add support for IA64 specific macros. + +For older changes see ChangeLog-0001 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/binutils/binutils/ChangeLog-9197 b/contrib/binutils/binutils/ChangeLog-9197 index 1ed5416..9861315 100644 --- a/contrib/binutils/binutils/ChangeLog-9197 +++ b/contrib/binutils/binutils/ChangeLog-9197 @@ -2394,7 +2394,7 @@ Thu Jul 13 10:43:59 1995 Ian Lance Taylor * 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. + * nm.c (HAVE_SBRK): Define except on amigados and WINDOWS_NT. (struct size_sym): Define. (show_stats): New static variable. (long_options): Add undocumented option "stats". @@ -5200,7 +5200,7 @@ Thu May 16 16:06:55 1991 Steve Chamberlain (steve at cygint.cygnus.com) 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. + * objdump.c: Add some enum-to-int casts to accommodate old compilers. Fri May 3 22:21:44 1991 John Gilmore (gnu at cygint.cygnus.com) diff --git a/contrib/binutils/binutils/ChangeLog-9899 b/contrib/binutils/binutils/ChangeLog-9899 index 22f21e2..ad1fdc7 100644 --- a/contrib/binutils/binutils/ChangeLog-9899 +++ b/contrib/binutils/binutils/ChangeLog-9899 @@ -552,7 +552,7 @@ Mon Jun 7 12:14:57 1999 Andreas Schwab 1999-06-04 Nick Clifton - * readelf.c: Use 64bit wide fields in internal strcutures even if + * readelf.c: Use 64bit wide fields in internal structures even if targetting a 32bit architecture. (dump_relocations): Take a new parameter - the number of symbols in the symbol table. diff --git a/contrib/binutils/binutils/MAINTAINERS b/contrib/binutils/binutils/MAINTAINERS index 4ca6ae8..28c9144 100644 --- a/contrib/binutils/binutils/MAINTAINERS +++ b/contrib/binutils/binutils/MAINTAINERS @@ -14,14 +14,18 @@ The home page for binutils is: and patches should be sent to: - bug-binutils@gnu.org + bug-binutils@gnu.org or binutils@sources.redhat.com with "[Patch]" as part of the subject line. Note - patches to the -top level configure.in and config.sub scripts should be sent to: +top level config.guess and config.sub scripts should be sent to: config-patches@gnu.org -and not to the binutils list. +and not to the binutils lists. Patches to the other top level +configure files (configure, configure.in, config-if, config-ml.in) +should be sent to the binutils lists, and copied to the gcc and gdb +lists as well (gcc-patches@gcc.gnu.org and +gdb-patches@sources.redhat.com). --------- Blanket Write Privs --------- @@ -30,12 +34,12 @@ repository without obtaining approval first: Nick Clifton (head maintainer) Richard Henderson - Ian Taylor + Ian Taylor Jeff Law - Jim Wilson + Jim Wilson DJ Delorie Alan Modra - Michael Meissner + Michael Meissner --------- Maintainers --------- @@ -50,39 +54,49 @@ maintainers for a given domain then responsibility falls to the first maintainer. The first maintainer is free to devolve that responsibility among the other maintainers. - ARC Peter Targett + ALPHA Richard Henderson ARM Nick Clifton ARM Richard Earnshaw AVR Denis Chertykov AVR Marek Michalkiewicz + BUILD SYSTEM Ben Elliston + BUILD SYSTEM Daniel Jacobowitz CRIS Hans-Peter Nilsson DWARF2 Jason Merrill FR30 Dave Brolley FRV Dave Brolley + HPPA Dave Anglin HPPA elf32 Alan Modra - IA64 Jim Wilson - i860 Jason Eckhardt + HPPA elf64 Jeff Law [Basic maintainance only] + IA-64 Jim Wilson + IQ2000 Stan Cox + i860 Jason Eckhardt ix86 Alan Modra - ix86 COFF,PE DJ Delorie + ix86 PE Christopher Faylor + ix86 COFF DJ Delorie ix86 H.J.Lu ix86 INTEL MODE Diego Novillo M68HC11 M68HC12 Stephane Carrez - M68k Ben Elliston - M88k Ben Elliston + M68k Ben Elliston MIPS Eric Christopher + MIPS Thiemo Seufer MMIX Hans-Peter Nilsson MN10300 Eric Christopher MN10300 Alexandre Oliva - PPC Geoff Keating + PPC Geoff Keating + PPC vector ext Aldy Hernandez s390, s390x Martin Schwidefsky SH Jörn Rennecke - SH Hans-Peter Nilsson SH Alexandre Oliva + SH Kaz Kojima SPARC Jakub Jelinek + TESTSUITES Ben Elliston + TIC4X Svein Seldal TIC54X Timothy Wall VAX Jason R Thorpe x86_64 Jan Hubicka x86_64 Andreas Jaeger + Xtensa Bob Wilson z8k Christian Groessler @@ -134,3 +148,21 @@ great). If you are uncertain as to whether a patch is appropriate for the branch, ask the branch maintainer. This is: Daniel Jacobowitz + + -------- Testsuites --------------- + +In general patches to any of the binutils testsuites should be +considered generic and sent to the binutils mailing list for +approval. Patches to target specific tests are the responsibility the +relevent port maintainer(s), and can be approved/checked in by them. +Other testsuite patches need the approval of a blanket-write-priveleges +person. + + -------- Configure patches ---------- + +Patches to the top level configure files (config.sub & config.guess) +are not the domain of the binutils project and they cannot be approved +by the binutils group. Instead they should be submitted to the config +maintainer at: + + config-patches@gnu.org diff --git a/contrib/binutils/binutils/Makefile.am b/contrib/binutils/binutils/Makefile.am index 1fd97ab..324c0ea 100644 --- a/contrib/binutils/binutils/Makefile.am +++ b/contrib/binutils/binutils/Makefile.am @@ -87,7 +87,7 @@ GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h CFILES = \ addr2line.c ar.c arsup.c binemul.c bucomm.c budemang.c \ - coffdump.c coffgrok.c debug.c dlltool.c dllwrap.c \ + coffdump.c coffgrok.c cxxfilt.c debug.c dlltool.c dllwrap.c \ emul_aix.c emul_vanilla.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 \ @@ -98,7 +98,7 @@ CFILES = \ windres.c winduni.c wrstabs.c GENERATED_CFILES = \ - underscore.c arparse.c arlex.c sysroff.c sysinfo.c syslex.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 @@ -115,7 +115,7 @@ LIBIBERTY = ../libiberty/libiberty.a POTFILES = $(CFILES) $(DEBUG_SRCS) $(HFILES) po/POTFILES.in: @MAINT@ Makefile - for file in $(POTFILES); do echo $$file; done | sort > tmp \ + for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \ && mv tmp $(srcdir)/po/POTFILES.in EXPECT = `if [ -f $$r/../expect/expect ] ; then \ @@ -180,19 +180,7 @@ 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 - echo '/*WARNING: This file is automatically generated!*/' >underscore.t - echo "int prepends_underscore = @UNDERSCORE@;" >>underscore.t - $(SHELL) $(srcdir)/../move-if-change underscore.t underscore.c - touch stamp-under - -cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h Makefile - $(COMPILE) -c -DMAIN -DVERSION='"$(VERSION)"' $(BASEDIR)/libiberty/cplus-dem.c - -cxxfilt_SOURCES = -cxxfilt_LDADD = cplus-dem.o underscore.o $(LIBIBERTY) $(INTLLIBS) +cxxfilt_SOURCES = cxxfilt.c $(BULIBS) ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \ emul_$(EMULATION).c $(BULIBS) @@ -290,7 +278,7 @@ EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ diststuff: $(EXTRA_DIST) info -DISTCLEANFILES = stamp-under sysinfo underscore.c sysroff.c sysroff.h \ +DISTCLEANFILES = sysinfo sysroff.c sysroff.h \ site.exp site.bak Makefile: $(BFDDIR)/configure.in @@ -362,7 +350,7 @@ install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) if [ -f $$i$(EXEEXT) ]; then \ j=`echo $$i | sed -e 's/-new//'`; \ k=`echo $$j | sed '$(transform)'`; \ - if [ "$(DESTDIR)$(bindir)/$$k$(EXEEXT)" != "$(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT)" ]; then \ + if [ "$(bindir)/$$k" != "$(tooldir)/bin/$$j" ]; then \ rm -f $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT); \ ln $(DESTDIR)$(bindir)/$$k$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT) >/dev/null 2>/dev/null \ || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$i$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT); \ @@ -392,9 +380,10 @@ binemul.o: binemul.c binemul.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ $(INCDIR)/fopen-same.h bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h -budemang.o: budemang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h ../bfd/bfdver.h $(INCDIR)/libiberty.h \ + bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/filenames.h $(BFDDIR)/libbfd.h +budemang.o: budemang.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \ budemang.h coffdump.o: coffdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ @@ -404,6 +393,9 @@ coffgrok.o: coffgrok.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h coffgrok.h +cxxfilt.o: cxxfilt.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/libiberty.h $(INCDIR)/demangle.h $(INCDIR)/safe-ctype.h debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h @@ -448,12 +440,13 @@ not-strip.o: not-strip.c objcopy.o: objcopy.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h $(INCDIR)/progress.h bucomm.h config.h \ $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ - budbg.h $(INCDIR)/filenames.h + budbg.h $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h objdump.o: objdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/progress.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h budemang.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/dis-asm.h $(INCDIR)/libiberty.h \ - $(INCDIR)/demangle.h debug.h budbg.h $(INCDIR)/aout/aout64.h + $(INCDIR)/symcat.h ../bfd/bfdver.h $(INCDIR)/progress.h \ + bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + budemang.h $(INCDIR)/safe-ctype.h $(INCDIR)/dis-asm.h \ + $(INCDIR)/libiberty.h $(INCDIR)/demangle.h debug.h \ + budbg.h $(INCDIR)/aout/aout64.h prdbg.o: prdbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ @@ -474,15 +467,18 @@ readelf.o: readelf.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/elf/avr.h $(INCDIR)/elf/cris.h $(INCDIR)/elf/d10v.h \ $(INCDIR)/elf/d30v.h $(INCDIR)/elf/dlx.h $(INCDIR)/elf/fr30.h \ $(INCDIR)/elf/frv.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/hppa.h \ - $(INCDIR)/elf/i386.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/i960.h \ - $(INCDIR)/elf/ia64.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/m68k.h \ - $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/mips.h \ - $(INCDIR)/elf/mmix.h $(INCDIR)/elf/mn10200.h $(INCDIR)/elf/mn10300.h \ + $(INCDIR)/elf/i386.h $(INCDIR)/elf/i370.h $(INCDIR)/elf/i860.h \ + $(INCDIR)/elf/i960.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/ip2k.h \ + $(INCDIR)/elf/m32r.h $(INCDIR)/elf/m68k.h $(INCDIR)/elf/m68hc11.h \ + $(INCDIR)/elf/mcore.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/mmix.h \ + $(INCDIR)/elf/mn10200.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/msp430.h \ $(INCDIR)/elf/or32.h $(INCDIR)/elf/pj.h $(INCDIR)/elf/ppc.h \ - $(INCDIR)/elf/s390.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/sparc.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/vax.h $(INCDIR)/elf/x86-64.h \ - $(INCDIR)/elf/xstormy16.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h unwind-ia64.h + $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/sh.h \ + $(INCDIR)/elf/sparc.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/vax.h \ + $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/xstormy16.h $(INCDIR)/elf/iq2000.h \ + $(INCDIR)/elf/xtensa.h $(INCDIR)/aout/ar.h bucomm.h \ + config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/libiberty.h unwind-ia64.h rename.o: rename.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ $(INCDIR)/fopen-same.h @@ -525,8 +521,8 @@ sysdump.o: sysdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h \ sysroff.h sysroff.c version.o: version.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h + $(INCDIR)/symcat.h ../bfd/bfdver.h bucomm.h config.h \ + $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h windres.o: windres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h $(INCDIR)/getopt.h bucomm.h config.h \ $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ @@ -540,7 +536,6 @@ wrstabs.o: wrstabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ debug.h budbg.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def -underscore.o: underscore.c arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ $(INCDIR)/fopen-same.h arsup.h diff --git a/contrib/binutils/binutils/Makefile.in b/contrib/binutils/binutils/Makefile.in index 9208082..46eeac8 100644 --- a/contrib/binutils/binutils/Makefile.in +++ b/contrib/binutils/binutils/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation @@ -109,7 +109,6 @@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ STRIP = @STRIP@ -UNDERSCORE = @UNDERSCORE@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -200,7 +199,7 @@ GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h CFILES = \ addr2line.c ar.c arsup.c binemul.c bucomm.c budemang.c \ - coffdump.c coffgrok.c debug.c dlltool.c dllwrap.c \ + coffdump.c coffgrok.c cxxfilt.c debug.c dlltool.c dllwrap.c \ emul_aix.c emul_vanilla.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 \ @@ -212,7 +211,7 @@ CFILES = \ GENERATED_CFILES = \ - underscore.c arparse.c arlex.c sysroff.c sysinfo.c syslex.c \ + arparse.c arlex.c sysroff.c sysinfo.c syslex.c \ defparse.c deflex.c nlmheader.c rcparse.c rclex.c @@ -273,8 +272,7 @@ nm_new_SOURCES = nm.c budemang.c $(BULIBS) objdump_SOURCES = objdump.c budemang.c prdbg.c $(DEBUG_SRCS) $(BULIBS) objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(INTLLIBS) -cxxfilt_SOURCES = -cxxfilt_LDADD = cplus-dem.o underscore.o $(LIBIBERTY) $(INTLLIBS) +cxxfilt_SOURCES = cxxfilt.c $(BULIBS) ar_SOURCES = arparse.y arlex.l ar.c not-ranlib.c arsup.c rename.c binemul.c \ emul_$(EMULATION).c $(BULIBS) @@ -311,7 +309,7 @@ EXTRA_DIST = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c -DISTCLEANFILES = stamp-under sysinfo underscore.c sysroff.c sysroff.h \ +DISTCLEANFILES = sysinfo sysroff.c sysroff.h \ site.exp site.bak @@ -424,9 +422,10 @@ version.$(OBJEXT) filemode.$(OBJEXT) strip_new_LDADD = $(LDADD) strip_new_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a strip_new_LDFLAGS = -cxxfilt_OBJECTS = -cxxfilt_DEPENDENCIES = cplus-dem.o underscore.o \ -../libiberty/libiberty.a +cxxfilt_OBJECTS = cxxfilt.$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) \ +filemode.$(OBJEXT) +cxxfilt_LDADD = $(LDADD) +cxxfilt_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a cxxfilt_LDFLAGS = LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LEXLIB = @LEXLIB@ @@ -871,7 +870,7 @@ distclean-generic: -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: - -test -z "arlexldeflexlrclexlarparseharparsecdefparsehdefparsecnlmheaderhnlmheadercrcparsehrcparsec" || rm -f arlexl deflexl rclexl arparseh arparsec defparseh defparsec nlmheaderh nlmheaderc rcparseh rcparsec + -test -z "arlex.cdeflex.crclex.carparse.harparse.cdefparse.hdefparse.cnlmheader.hnlmheader.crcparse.hrcparse.c" || rm -f arlex.c deflex.c rclex.c arparse.h arparse.c defparse.h defparse.c nlmheader.h nlmheader.c rcparse.h rcparse.c mostlyclean-am: mostlyclean-hdr mostlyclean-binPROGRAMS \ mostlyclean-noinstPROGRAMS mostlyclean-compile \ mostlyclean-libtool mostlyclean-tags \ @@ -927,7 +926,7 @@ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean po/POTFILES.in: @MAINT@ Makefile - for file in $(POTFILES); do echo $$file; done | sort > tmp \ + for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \ && mv tmp $(srcdir)/po/POTFILES.in check-DEJAGNU: site.exp @@ -952,17 +951,6 @@ installcheck: objdump.o:objdump.c $(COMPILE) -c $(OBJDUMP_DEFS) $(srcdir)/objdump.c -underscore.c: stamp-under ; @true - -stamp-under: Makefile - echo '/*WARNING: This file is automatically generated!*/' >underscore.t - echo "int prepends_underscore = @UNDERSCORE@;" >>underscore.t - $(SHELL) $(srcdir)/../move-if-change underscore.t underscore.c - touch stamp-under - -cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h Makefile - $(COMPILE) -c -DMAIN -DVERSION='"$(VERSION)"' $(BASEDIR)/libiberty/cplus-dem.c - # The following is commented out for the conversion to automake. # This rule creates a single binary that switches between ar and ranlib # by looking at argv[0]. Use this kludge to save some disk space. @@ -1090,7 +1078,7 @@ install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) if [ -f $$i$(EXEEXT) ]; then \ j=`echo $$i | sed -e 's/-new//'`; \ k=`echo $$j | sed '$(transform)'`; \ - if [ "$(DESTDIR)$(bindir)/$$k$(EXEEXT)" != "$(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT)" ]; then \ + if [ "$(bindir)/$$k" != "$(tooldir)/bin/$$j" ]; then \ rm -f $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT); \ ln $(DESTDIR)$(bindir)/$$k$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT) >/dev/null 2>/dev/null \ || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$i$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT); \ @@ -1120,9 +1108,10 @@ binemul.o: binemul.c binemul.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ $(INCDIR)/fopen-same.h bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/filenames.h -budemang.o: budemang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h ../bfd/bfdver.h $(INCDIR)/libiberty.h \ + bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/filenames.h $(BFDDIR)/libbfd.h +budemang.o: budemang.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h $(INCDIR)/libiberty.h $(INCDIR)/demangle.h \ budemang.h coffdump.o: coffdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ @@ -1132,6 +1121,9 @@ coffgrok.o: coffgrok.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h $(INCDIR)/libiberty.h bucomm.h config.h \ $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h coffgrok.h +cxxfilt.o: cxxfilt.c config.h ../bfd/bfd.h $(INCDIR)/ansidecl.h \ + $(INCDIR)/symcat.h bucomm.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/libiberty.h $(INCDIR)/demangle.h $(INCDIR)/safe-ctype.h debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h @@ -1176,12 +1168,13 @@ not-strip.o: not-strip.c objcopy.o: objcopy.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h $(INCDIR)/progress.h bucomm.h config.h \ $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ - budbg.h $(INCDIR)/filenames.h + budbg.h $(INCDIR)/filenames.h $(INCDIR)/fnmatch.h objdump.o: objdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h $(INCDIR)/progress.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h budemang.h \ - $(INCDIR)/safe-ctype.h $(INCDIR)/dis-asm.h $(INCDIR)/libiberty.h \ - $(INCDIR)/demangle.h debug.h budbg.h $(INCDIR)/aout/aout64.h + $(INCDIR)/symcat.h ../bfd/bfdver.h $(INCDIR)/progress.h \ + bucomm.h config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + budemang.h $(INCDIR)/safe-ctype.h $(INCDIR)/dis-asm.h \ + $(INCDIR)/libiberty.h $(INCDIR)/demangle.h debug.h \ + budbg.h $(INCDIR)/aout/aout64.h prdbg.o: prdbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h debug.h \ @@ -1202,15 +1195,18 @@ readelf.o: readelf.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/elf/avr.h $(INCDIR)/elf/cris.h $(INCDIR)/elf/d10v.h \ $(INCDIR)/elf/d30v.h $(INCDIR)/elf/dlx.h $(INCDIR)/elf/fr30.h \ $(INCDIR)/elf/frv.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/hppa.h \ - $(INCDIR)/elf/i386.h $(INCDIR)/elf/i860.h $(INCDIR)/elf/i960.h \ - $(INCDIR)/elf/ia64.h $(INCDIR)/elf/m32r.h $(INCDIR)/elf/m68k.h \ - $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/mcore.h $(INCDIR)/elf/mips.h \ - $(INCDIR)/elf/mmix.h $(INCDIR)/elf/mn10200.h $(INCDIR)/elf/mn10300.h \ + $(INCDIR)/elf/i386.h $(INCDIR)/elf/i370.h $(INCDIR)/elf/i860.h \ + $(INCDIR)/elf/i960.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/ip2k.h \ + $(INCDIR)/elf/m32r.h $(INCDIR)/elf/m68k.h $(INCDIR)/elf/m68hc11.h \ + $(INCDIR)/elf/mcore.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/mmix.h \ + $(INCDIR)/elf/mn10200.h $(INCDIR)/elf/mn10300.h $(INCDIR)/elf/msp430.h \ $(INCDIR)/elf/or32.h $(INCDIR)/elf/pj.h $(INCDIR)/elf/ppc.h \ - $(INCDIR)/elf/s390.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/sparc.h \ - $(INCDIR)/elf/v850.h $(INCDIR)/elf/vax.h $(INCDIR)/elf/x86-64.h \ - $(INCDIR)/elf/xstormy16.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h unwind-ia64.h + $(INCDIR)/elf/ppc64.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/sh.h \ + $(INCDIR)/elf/sparc.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/vax.h \ + $(INCDIR)/elf/x86-64.h $(INCDIR)/elf/xstormy16.h $(INCDIR)/elf/iq2000.h \ + $(INCDIR)/elf/xtensa.h $(INCDIR)/aout/ar.h bucomm.h \ + config.h $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h \ + $(INCDIR)/libiberty.h unwind-ia64.h rename.o: rename.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ $(INCDIR)/fopen-same.h @@ -1253,8 +1249,8 @@ sysdump.o: sysdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/fopen-same.h $(INCDIR)/safe-ctype.h $(INCDIR)/libiberty.h \ sysroff.h sysroff.c version.o: version.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ - $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h + $(INCDIR)/symcat.h ../bfd/bfdver.h bucomm.h config.h \ + $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h windres.o: windres.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h $(INCDIR)/getopt.h bucomm.h config.h \ $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \ @@ -1268,7 +1264,6 @@ wrstabs.o: wrstabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h $(INCDIR)/safe-ctype.h \ debug.h budbg.h $(INCDIR)/aout/aout64.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def -underscore.o: underscore.c arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/symcat.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ $(INCDIR)/fopen-same.h arsup.h diff --git a/contrib/binutils/binutils/NEWS b/contrib/binutils/binutils/NEWS index 5091e3b..a72826e 100644 --- a/contrib/binutils/binutils/NEWS +++ b/contrib/binutils/binutils/NEWS @@ -1,4 +1,47 @@ -*- text -*- + +* objcopy and strip can now take wildcard patterns in symbol names specified on + the command line provided that the --wildcard switch is used to enable them. + +* readelf can now parse archives. + +* objdump now accepts --debugging-tags to print the debug information in a + format compatible with ctags tool. + +* objcopy and strip now accept --only-keep-debug to create a file containing + those sections that would be stripped out by --strip-debug. The idea is that + this can be used in conjunction with the --add-gnu-debuglink switch to create + a two part program distribution - one a stripped executable and the other the + debugging info. + +* objcopy now accepts --add-gnu-debuglink= to insert a .gnu_debuglink + section into a (presumably stripped) executable. This allows the debug + information for the file to be held in a separate file. + +* BFD marks the sections .comment and .note as 'n' in the BSD/POSIX + single-character representation. This can be checked by running nm + with the -a switch. + +Changes in 2.14: + +* Added --info switch to objcopy and strip. + +* Support for Vitesse IQ2000 added by Red Hat. + +* Added 'S' encoding to strings to allow the display of 8-bit characters. + +* Added --prefix-symbols=, --prefix-sections= and + --prefix-alloc-sections= to objcopy. + +* readelf can handle the extensions to the DWARF2 spec used by the Unified + Parallel C compiler. + +* BFD no longer declares a "boolean" type, to avoid clashes with other + headers that declare the same. Users of BFD should replace boolean, + false and true, with int, 0 and 1, or define their own boolean type. + +* Support for IP2K added by Denis Chertykov. + Changes in 2.13: * Support for the Fujitsu FRV architecture added by Red Hat. Models for FR400 @@ -44,7 +87,7 @@ Changes in binutils 2.11: * 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. @@ -57,13 +100,13 @@ Changes in binutils 2.10: * New command line switch to objdump --file-start-context which shows the entire file contents up to the source line first encountered for a given - file. + file. * New command line switch to objdump -M (or --disassembler-options) which takes a parameter which can then be interpreted on a per-target basis by the disassembler. Used by ARM targets to select register name sets, ISA, APCS or raw verions. - + * objdump support for -mi386:intel which causes disassembly to be displayed with intel syntax. @@ -154,7 +197,7 @@ Changes in binutils 2.6: Changes in binutils 2.5: * Changed objdump -dr to dump the relocs interspersed with the assembly - listing, for a more useful listing of relocateable files. + listing, for a more useful listing of relocatable files. * Changed objdump -d/--disassemble to only disassemble SEC_CODE sections. Added -D/--disassemble-all option to disassemble all sections. diff --git a/contrib/binutils/binutils/README b/contrib/binutils/binutils/README index 6633792..5bc2508 100644 --- a/contrib/binutils/binutils/README +++ b/contrib/binutils/binutils/README @@ -18,7 +18,7 @@ Unpacking and Installation -- quick overview When you unpack the binutils archive file, you will get a directory called something like `binutils-XXX', where XXX is the number of the -release. (Probably 2.12 or higher). This directory contains +release. (Probably 2.13 or higher). This directory contains various files and sub-directories. Most of the files in the top directory are for information and for configuration. The actual source code is in sub-directories. @@ -83,6 +83,18 @@ To build under openVMS/AXP, see the file makefile.vms in the top level directory. +Native Language Support +======================= + +By default Native Language Support will be enabled for binutils. On +some systems however this support is not present and can lead to error +messages such as "undefined reference to `libintl_gettext'" when +building there tools. If that happens the NLS support can be disabled +by adding the --disable-nls switch to the configure line like this: + + ../binutils-XXX/configure --disable-nls + + If you don't have ar ==================== @@ -100,7 +112,7 @@ ${MAKE} $* all-bfd cd binutils MAKE="${MAKE_PROG}" export MAKE -${MAKE} $* ar_DEPENDENCIES= ar_LDADD='../bfd/*.o `cat ../libiberty/required-list ../libiberty/needed-list | sed -e "s,\([^ ][^ ]*\),../libiberty/\1,g"` `if test -f ../intl/gettext.o; then echo '../intl/*.o'; fi`' ar +${MAKE} $* ar_DEPENDENCIES= ar_LDADD='../bfd/*.o ../libiberty/*.o `if test -f ../intl/gettext.o; then echo '../intl/*.o'; fi`' ar This script will build an ar program in binutils/ar. Move binutils/ar into a directory on your PATH. After doing this, you can run make as @@ -110,7 +122,7 @@ the ranlib program in order to build the distribution. Porting ======= -Binutils-2.12 supports many different architectures, but there +Binutils-2.13 supports many different architectures, but there are many more not supported, including some that were supported by earlier versions. We are hoping for volunteers to improve this situation. @@ -127,9 +139,66 @@ Send bug reports and patches to: bug-binutils@gnu.org. +Please include the following in bug reports: + +- A description of exactly what went wrong, and exactly what should have + happened instead. + +- The configuration name(s) given to the "configure" script. The + "config.status" file should have this information. This is assuming + you built binutils yourself. If you didn't build binutils youself, + then we need information regarding your machine and operating system, + and it may be more appropriate to report bugs to wherever you obtained + binutils. + +- The options given to the tool (gas, objcopy, ld etc.) at run time. + +- The actual input file that caused the problem. + 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. +reports about bugs, but we do not promise to fix them, particularly so +when the bug report is against an old version. If you are able, please +consider building the latest tools from CVS to check that your bug has +not already been fixed. + +When reporting problems about gas and ld, it's useful to provide a +testcase that triggers the problem. In the case of a gas problem, we +want input files to gas and command line switches used. The inputs to +gas are _NOT_ .c or .i files, but rather .s files. If your original +source was a C program, you can generate the .s file and see the command +line options by passing -v -save-temps to gcc in addition to all the +usual options you use. The reason we don't want C files is that we +might not have a C compiler around for the target you use. While it +might be possible to build a compiler, that takes considerable time and +disk space, and we might not end up with exactly the same compiler you +use. + +In the case of a ld problem, the input files are .o, .a and .so files, +and possibly a linker script specified with -T. Again, when using gcc +to link, you can see these files by adding options to the gcc command +line. Use -v -save-temps -Wl,-t, except that on targets that use gcc's +collect2, you would add -v -save-temps -Wl,-t,-debug. The -t option +tells ld to print all files and libraries used, so that, for example, +you can associate -lc on the ld command line with the actual libc used. +Note that your simple two line C program to trigger a problem typically +expands into several megabytes of objects by the time you include +libraries. + +It is antisocial to post megabyte sized attachments to mailing lists, so +please put large testcases somewhere on an ftp or web site so that only +interested developers need to download them, or offer to email them on +request. Better still, try to reduce the testcase, for example, try to +develop a ld testcase that doesn't use system libraries. However, +please be sure it is a complete testcase and that it really does +demonstrate the problem. Also, don't bother paring it down if that will +cause large delays in filing the bug report. + +If you expect to be contributing a large number of test cases, it would +be helpful if you would look at the test suite included in the release +(based on the Deja Gnu testing framework, available from the usual ftp +sites) and write test cases to fit into that framework. This is +certainly not required. VMS === diff --git a/contrib/binutils/binutils/acinclude.m4 b/contrib/binutils/binutils/acinclude.m4 index 7ffc031..c5ae4d4 100644 --- a/contrib/binutils/binutils/acinclude.m4 +++ b/contrib/binutils/binutils/acinclude.m4 @@ -25,7 +25,7 @@ AC_SUBST(INTLLIBS) 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, +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 diff --git a/contrib/binutils/binutils/aclocal.m4 b/contrib/binutils/binutils/aclocal.m4 index 1c78dc1..d1f4a36 100644 --- a/contrib/binutils/binutils/aclocal.m4 +++ b/contrib/binutils/binutils/aclocal.m4 @@ -37,6 +37,24 @@ AC_CHECK_PROGS(LEX, flex lex, [$missing_dir/missing flex]) AC_PROG_LEX AC_DECL_YYTEXT]) +#serial 1 +# This test replaces the one in autoconf. +# Currently this macro should have the same name as the autoconf macro +# because gettext's gettext.m4 (distributed in the automake package) +# still uses it. Otherwise, the use in gettext.m4 makes autoheader +# give these diagnostics: +# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX +# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX + +undefine([AC_ISC_POSIX]) + +AC_DEFUN([AC_ISC_POSIX], + [ + dnl This test replaces the obsolescent AC_ISC_POSIX kludge. + AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) + ] +) + # Do all the work for Automake. This macro actually does too much -- # some checks are only needed if your package does certain things. # But this isn't really a big deal. diff --git a/contrib/binutils/binutils/addr2line.c b/contrib/binutils/binutils/addr2line.c index 174a034..354153e 100644 --- a/contrib/binutils/binutils/addr2line.c +++ b/contrib/binutils/binutils/addr2line.c @@ -1,5 +1,6 @@ /* addr2line.c -- convert addresses to line number and function name - Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 + Free Software Foundation, Inc. Contributed by Ulrich Lauther This file is part of GNU Binutils. @@ -37,9 +38,9 @@ #include "bucomm.h" #include "budemang.h" -static boolean with_functions; /* -f, show function names. */ -static boolean do_demangle; /* -C, demangle names. */ -static boolean base_names; /* -s, strip directory names. */ +static bfd_boolean with_functions; /* -f, show function names. */ +static bfd_boolean do_demangle; /* -C, demangle names. */ +static bfd_boolean base_names; /* -s, strip directory names. */ static int naddr; /* Number of addresses to process. */ static char **addr; /* Hex addresses to process. */ @@ -58,18 +59,16 @@ static struct option long_options[] = {0, no_argument, 0, 0} }; -static void usage PARAMS ((FILE *, int)); -static void slurp_symtab PARAMS ((bfd *)); -static void find_address_in_section PARAMS ((bfd *, asection *, PTR)); -static void translate_addresses PARAMS ((bfd *)); -static void process_file PARAMS ((const char *, const char *)); +static void usage (FILE *, int); +static void slurp_symtab (bfd *); +static void find_address_in_section (bfd *, asection *, void *); +static void translate_addresses (bfd *); +static void process_file (const char *, const char *); /* Print a usage message to STREAM and exit with STATUS. */ static void -usage (stream, status) - FILE *stream; - int status; +usage (FILE *stream, int status) { fprintf (stream, _("Usage: %s [option(s)] [addr(s)]\n"), program_name); fprintf (stream, _(" Convert addresses into line number/file name pairs.\n")); @@ -93,22 +92,18 @@ usage (stream, status) /* Read in the symbol table. */ static void -slurp_symtab (abfd) - bfd *abfd; +slurp_symtab (bfd *abfd) { - long storage; long symcount; + unsigned int size; if ((bfd_get_file_flags (abfd) & HAS_SYMS) == 0) return; - storage = bfd_get_symtab_upper_bound (abfd); - if (storage < 0) - bfd_fatal (bfd_get_filename (abfd)); - - syms = (asymbol **) xmalloc (storage); + symcount = bfd_read_minisymbols (abfd, FALSE, (void *) &syms, &size); + if (symcount == 0) + symcount = bfd_read_minisymbols (abfd, TRUE /* dynamic */, (void *) &syms, &size); - symcount = bfd_canonicalize_symtab (abfd, syms); if (symcount < 0) bfd_fatal (bfd_get_filename (abfd)); } @@ -120,16 +115,14 @@ static bfd_vma pc; static const char *filename; static const char *functionname; static unsigned int line; -static boolean found; +static bfd_boolean found; /* Look for an address in a section. This is called via bfd_map_over_sections. */ static void -find_address_in_section (abfd, section, data) - bfd *abfd; - asection *section; - PTR data ATTRIBUTE_UNUSED; +find_address_in_section (bfd *abfd, asection *section, + void *data ATTRIBUTE_UNUSED) { bfd_vma vma; bfd_size_type size; @@ -156,8 +149,7 @@ find_address_in_section (abfd, section, data) file_name:line_number and optionally function name. */ static void -translate_addresses (abfd) - bfd *abfd; +translate_addresses (bfd *abfd) { int read_stdin = (naddr == 0); @@ -179,8 +171,8 @@ translate_addresses (abfd) pc = bfd_scan_vma (*addr++, NULL, 16); } - found = false; - bfd_map_over_sections (abfd, find_address_in_section, (PTR) NULL); + found = FALSE; + bfd_map_over_sections (abfd, find_address_in_section, NULL); if (! found) { @@ -233,13 +225,14 @@ translate_addresses (abfd) /* Process a file. */ static void -process_file (file_name, target) - const char *file_name; - const char *target; +process_file (const char *file_name, const char *target) { bfd *abfd; char **matching; + if (get_file_size (file_name) < 1) + return; + abfd = bfd_openr (file_name, target); if (abfd == NULL) bfd_fatal (file_name); @@ -271,12 +264,10 @@ process_file (file_name, target) bfd_close (abfd); } -int main PARAMS ((int, char **)); +int main (int, char **); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { const char *file_name; char *target; @@ -310,7 +301,7 @@ main (argc, argv) target = optarg; break; case 'C': - do_demangle = true; + do_demangle = TRUE; if (optarg != NULL) { enum demangling_styles style; @@ -327,10 +318,10 @@ main (argc, argv) file_name = optarg; break; case 's': - base_names = true; + base_names = TRUE; break; case 'f': - with_functions = true; + with_functions = TRUE; break; case 'v': case 'V': diff --git a/contrib/binutils/binutils/ar.c b/contrib/binutils/binutils/ar.c index ea1b456..ec0657d 100644 --- a/contrib/binutils/binutils/ar.c +++ b/contrib/binutils/binutils/ar.c @@ -1,6 +1,6 @@ /* ar.c - Archive modify and extract. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 + 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -24,7 +24,7 @@ should have long options too. GNU ar used to check file against filesystem in quick_update and replace operations (would check mtime). Doesn't warn when name truncated. No way to specify pos_end. Error messages should be - more consistant. */ + more consistent. */ #include "bfd.h" #include "libiberty.h" @@ -54,54 +54,30 @@ /* Kludge declaration from BFD! This is ugly! FIXME! XXX */ struct ar_hdr * - bfd_special_undocumented_glue PARAMS ((bfd * abfd, const char *filename)); + bfd_special_undocumented_glue (bfd * abfd, const char *filename); /* Static declarations */ -static void -mri_emul PARAMS ((void)); - -static const char * -normalize PARAMS ((const char *, bfd *)); - -static void -remove_output PARAMS ((void)); - -static void -map_over_members PARAMS ((bfd *, void (*)(bfd *), char **, int)); - -static void -print_contents PARAMS ((bfd * member)); - -static void -delete_members PARAMS ((bfd *, char **files_to_delete)); +static void mri_emul (void); +static const char *normalize (const char *, bfd *); +static void remove_output (void); +static void map_over_members (bfd *, void (*)(bfd *), char **, int); +static void print_contents (bfd * member); +static void delete_members (bfd *, char **files_to_delete); #if 0 -static void -do_quick_append PARAMS ((const char *archive_filename, - char **files_to_append)); +static void do_quick_append + (const char *archive_filename, char **files_to_append); #endif -static void -move_members PARAMS ((bfd *, char **files_to_move)); - -static void -replace_members PARAMS ((bfd *, char **files_to_replace, boolean quick)); - -static void -print_descr PARAMS ((bfd * abfd)); - -static void -write_archive PARAMS ((bfd *)); - -static void -ranlib_only PARAMS ((const char *archname)); - -static void -ranlib_touch PARAMS ((const char *archname)); - -static void -usage PARAMS ((int)); +static void move_members (bfd *, char **files_to_move); +static void replace_members + (bfd *, char **files_to_replace, bfd_boolean quick); +static void print_descr (bfd * abfd); +static void write_archive (bfd *); +static void ranlib_only (const char *archname); +static void ranlib_touch (const char *archname); +static void usage (int); /** Globals and flags */ @@ -127,7 +103,7 @@ int newer_only = 0; /* Controls the writing of an archive symbol table (in BSD: a __.SYMDEF member). -1 means we've been explicitly asked to not write a symbol table; - +1 means we've been explictly asked to write it; + +1 means we've been explicitly asked to write it; 0 is the default. Traditionally, the default in BSD has been to not write the table. However, for POSIX.2 compliance the default is now to write a symbol table @@ -148,25 +124,25 @@ enum pos } postype = pos_default; static bfd ** -get_pos_bfd PARAMS ((bfd **, enum pos, const char *)); +get_pos_bfd (bfd **, enum pos, const char *); -/* For extract/delete only. If COUNTED_NAME_MODE is true, we only +/* For extract/delete only. If COUNTED_NAME_MODE is TRUE, we only extract the COUNTED_NAME_COUNTER instance of that name. */ -static boolean counted_name_mode = 0; +static bfd_boolean counted_name_mode = 0; static int counted_name_counter = 0; /* Whether to truncate names of files stored in the archive. */ -static boolean ar_truncate = false; +static bfd_boolean ar_truncate = FALSE; /* Whether to use a full file name match when searching an archive. This is convenient for archives created by the Microsoft lib program. */ -static boolean full_pathname = false; +static bfd_boolean full_pathname = FALSE; int interactive = 0; static void -mri_emul () +mri_emul (void) { interactive = isatty (fileno (stdin)); yyparse (); @@ -177,11 +153,7 @@ mri_emul () whose name matches one in FILES. */ static void -map_over_members (arch, function, files, count) - bfd *arch; - void (*function) PARAMS ((bfd *)); - char **files; - int count; +map_over_members (bfd *arch, void (*function)(bfd *), char **files, int count) { bfd *head; int match_count; @@ -204,7 +176,7 @@ map_over_members (arch, function, files, count) for (; count > 0; files++, count--) { - boolean found = false; + bfd_boolean found = FALSE; match_count = 0; for (head = arch->next; head; head = head->next) @@ -229,7 +201,7 @@ map_over_members (arch, function, files, count) continue; } - found = true; + found = TRUE; function (head); } } @@ -239,11 +211,10 @@ map_over_members (arch, function, files, count) } } -boolean operation_alters_arch = false; +bfd_boolean operation_alters_arch = FALSE; static void -usage (help) - int help; +usage (int help) { FILE *s; @@ -303,9 +274,7 @@ usage (help) name which we will use in an archive. */ static const char * -normalize (file, abfd) - const char *file; - bfd *abfd; +normalize (const char *file, bfd *abfd) { const char *filename; @@ -351,12 +320,12 @@ static FILE *output_file = NULL; static bfd *output_bfd = NULL; static void -remove_output () +remove_output (void) { if (output_filename != NULL) { - if (output_bfd != NULL && output_bfd->iostream != NULL) - fclose ((FILE *) (output_bfd->iostream)); + if (output_bfd != NULL) + bfd_cache_close (output_bfd); if (output_file != NULL) fclose (output_file); unlink (output_filename); @@ -366,12 +335,10 @@ remove_output () /* The option parsing should be in its own function. It will be when I have getopt working. */ -int main PARAMS ((int, char **)); +int main (int, char **); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { char *arg_ptr; char c; @@ -386,6 +353,7 @@ main (argc, argv) char *inarch_filename; int show_version; int i; + int do_posix = 0; #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); @@ -455,7 +423,7 @@ main (argc, argv) if (is_ranlib) { - boolean touch = false; + bfd_boolean touch = FALSE; if (argc < 2 || strcmp (argv[1], "--help") == 0 @@ -470,7 +438,7 @@ main (argc, argv) if (strcmp (argv[1], "-t") == 0) { ++arg_index; - touch = true; + touch = TRUE; } while (arg_index < argc) { @@ -492,107 +460,125 @@ main (argc, argv) if (argc < 2) usage (0); - arg_ptr = argv[1]; + arg_index = 1; + arg_ptr = argv[arg_index]; if (*arg_ptr == '-') - ++arg_ptr; /* compatibility */ + { + /* When the first option starts with '-' we support POSIX-compatible + option parsing. */ + do_posix = 1; + ++arg_ptr; /* compatibility */ + } - while ((c = *arg_ptr++) != '\0') + do { - switch (c) + while ((c = *arg_ptr++) != '\0') { - case 'd': - case 'm': - case 'p': - case 'q': - case 'r': - case 't': - case 'x': - if (operation != none) - fatal (_("two different operation options specified")); switch (c) { case 'd': - operation = delete; - operation_alters_arch = true; - break; case 'm': - operation = move; - operation_alters_arch = true; - break; case 'p': - operation = print_files; - break; case 'q': - operation = quick_append; - operation_alters_arch = true; - break; case 'r': - operation = replace; - operation_alters_arch = true; - break; case 't': - operation = print_table; - break; case 'x': - operation = extract; + if (operation != none) + fatal (_("two different operation options specified")); + switch (c) + { + case 'd': + operation = delete; + operation_alters_arch = TRUE; + break; + case 'm': + operation = move; + operation_alters_arch = TRUE; + break; + case 'p': + operation = print_files; + break; + case 'q': + operation = quick_append; + operation_alters_arch = TRUE; + break; + case 'r': + operation = replace; + operation_alters_arch = TRUE; + break; + case 't': + operation = print_table; + break; + case 'x': + operation = extract; + break; + } + case 'l': + break; + case 'c': + silent_create = 1; + break; + case 'o': + preserve_dates = 1; + break; + case 'V': + show_version = TRUE; + break; + case 's': + write_armap = 1; + break; + case 'S': + write_armap = -1; + break; + case 'u': + newer_only = 1; + break; + case 'v': + verbose = 1; break; + case 'a': + postype = pos_after; + break; + case 'b': + postype = pos_before; + break; + case 'i': + postype = pos_before; + break; + case 'M': + mri_mode = 1; + break; + case 'N': + counted_name_mode = TRUE; + break; + case 'f': + ar_truncate = TRUE; + break; + case 'P': + full_pathname = TRUE; + break; + default: + /* xgettext:c-format */ + non_fatal (_("illegal option -- %c"), c); + usage (0); } - case 'l': - break; - case 'c': - silent_create = 1; - break; - case 'o': - preserve_dates = 1; - break; - case 'V': - show_version = true; - break; - case 's': - write_armap = 1; - break; - case 'S': - write_armap = -1; - break; - case 'u': - newer_only = 1; - break; - case 'v': - verbose = 1; - break; - case 'a': - postype = pos_after; - break; - case 'b': - postype = pos_before; - break; - case 'i': - postype = pos_before; - break; - case 'M': - mri_mode = 1; - break; - case 'N': - counted_name_mode = true; - break; - case 'f': - ar_truncate = true; - break; - case 'P': - full_pathname = true; - break; - default: - /* xgettext:c-format */ - non_fatal (_("illegal option -- %c"), c); - usage (0); } + + /* With POSIX-compatible option parsing continue with the next + argument if it starts with '-'. */ + if (do_posix && arg_index + 1 < argc && argv[arg_index + 1][0] == '-') + arg_ptr = argv[++arg_index] + 1; + else + do_posix = 0; } + while (do_posix); if (show_version) print_version ("ar"); - if (argc < 3) + ++arg_index; + if (arg_index >= argc) usage (0); if (mri_mode) @@ -611,7 +597,7 @@ main (argc, argv) if ((operation == none || operation == print_table) && write_armap == 1) { - ranlib_only (argv[2]); + ranlib_only (argv[arg_index]); xexit (0); } @@ -621,8 +607,6 @@ main (argc, argv) if (newer_only && operation != replace) fatal (_("`u' is only meaningful with the `r' option.")); - arg_index = 2; - if (postype != pos_default) posname = argv[arg_index++]; @@ -726,9 +710,7 @@ main (argc, argv) } bfd * -open_inarch (archive_filename, file) - const char *archive_filename; - const char *file; +open_inarch (const char *archive_filename, const char *file) { const char *target; bfd **last_one; @@ -785,6 +767,8 @@ open_inarch (archive_filename, file) || ! bfd_set_format (arch, bfd_archive) || ! bfd_close (arch)) bfd_fatal (archive_filename); + else if (!silent_create) + non_fatal (_("creating %s"), archive_filename); /* If we die creating a new archive, don't leave it around. */ output_filename = archive_filename; @@ -825,8 +809,7 @@ open_inarch (archive_filename, file) } static void -print_contents (abfd) - bfd *abfd; +print_contents (bfd *abfd) { int ncopied = 0; char *cbuf = xmalloc (BUFSIZE); @@ -838,7 +821,7 @@ print_contents (abfd) if (verbose) /* xgettext:c-format */ - printf (_("\n\n\n"), bfd_get_filename (abfd)); + printf (_("\n<%s>\n\n"), bfd_get_filename (abfd)); bfd_seek (abfd, (file_ptr) 0, SEEK_SET); @@ -873,8 +856,7 @@ print_contents (abfd) Gilmore */ void -extract_file (abfd) - bfd *abfd; +extract_file (bfd *abfd) { FILE *ostream; char *cbuf = xmalloc (BUFSIZE); @@ -966,16 +948,14 @@ extract_file (abfd) /* Just do it quickly; don't worry about dups, armap, or anything like that */ static void -do_quick_append (archive_filename, files_to_append) - const char *archive_filename; - char **files_to_append; +do_quick_append (const char *archive_filename, char **files_to_append) { FILE *ofile, *ifile; char *buf = xmalloc (BUFSIZE); long tocopy, thistime; bfd *temp; struct stat sbuf; - boolean newfile = false; + bfd_boolean newfile = FALSE; bfd_set_error (bfd_error_no_error); if (stat (archive_filename, &sbuf) != 0) @@ -998,7 +978,7 @@ do_quick_append (archive_filename, files_to_append) bfd_fatal (archive_filename); #endif - newfile = true; + newfile = TRUE; } ofile = fopen (archive_filename, FOPEN_AUB); @@ -1013,9 +993,9 @@ do_quick_append (archive_filename, files_to_append) { bfd_fatal (archive_filename); } - if (newfile == false) + if (!newfile) { - if (bfd_check_format (temp, bfd_archive) != true) + if (!bfd_check_format (temp, bfd_archive)) /* xgettext:c-format */ fatal (_("%s is not an archive"), archive_filename); } @@ -1030,7 +1010,7 @@ do_quick_append (archive_filename, files_to_append) if (ar_truncate) temp->flags |= BFD_TRADITIONAL_FORMAT; - /* assume it's an achive, go straight to the end, sans $200 */ + /* assume it's an archive, go straight to the end, sans $200 */ fseek (ofile, 0, 2); for (; files_to_append && *files_to_append; ++files_to_append) @@ -1080,8 +1060,7 @@ do_quick_append (archive_filename, files_to_append) #endif /* 0 */ static void -write_archive (iarch) - bfd *iarch; +write_archive (bfd *iarch) { bfd *obfd; char *old_name, *new_name; @@ -1113,7 +1092,7 @@ write_archive (iarch) obfd->flags |= BFD_TRADITIONAL_FORMAT; } - if (bfd_set_archive_head (obfd, contents_head) != true) + if (!bfd_set_archive_head (obfd, contents_head)) bfd_fatal (old_name); if (!bfd_close (obfd)) @@ -1134,10 +1113,7 @@ write_archive (iarch) and should be a pos value. */ static bfd ** -get_pos_bfd (contents, default_pos, default_posname) - bfd **contents; - enum pos default_pos; - const char *default_posname; +get_pos_bfd (bfd **contents, enum pos default_pos, const char *default_posname) { bfd **after_bfd = contents; enum pos realpos; @@ -1173,13 +1149,11 @@ get_pos_bfd (contents, default_pos, default_posname) } static void -delete_members (arch, files_to_delete) - bfd *arch; - char **files_to_delete; +delete_members (bfd *arch, char **files_to_delete) { bfd **current_ptr_ptr; - boolean found; - boolean something_changed = false; + bfd_boolean found; + bfd_boolean something_changed = FALSE; int match_count; for (; *files_to_delete != NULL; ++files_to_delete) @@ -1192,12 +1166,12 @@ delete_members (arch, files_to_delete) if (!strcmp (*files_to_delete, "__.SYMDEF")) { - arch->has_armap = false; + arch->has_armap = FALSE; write_armap = -1; continue; } - found = false; + found = FALSE; match_count = 0; current_ptr_ptr = &(arch->next); while (*current_ptr_ptr) @@ -1214,8 +1188,8 @@ delete_members (arch, files_to_delete) } else { - found = true; - something_changed = true; + found = TRUE; + something_changed = TRUE; if (verbose) printf ("d - %s\n", *files_to_delete); @@ -1227,7 +1201,7 @@ delete_members (arch, files_to_delete) current_ptr_ptr = &((*current_ptr_ptr)->next); } - if (verbose && found == false) + if (verbose && !found) { /* xgettext:c-format */ printf (_("No member named `%s'\n"), *files_to_delete); @@ -1236,7 +1210,7 @@ delete_members (arch, files_to_delete) ; } - if (something_changed == true) + if (something_changed) write_archive (arch); else output_filename = NULL; @@ -1246,9 +1220,7 @@ delete_members (arch, files_to_delete) /* Reposition existing members within an archive */ static void -move_members (arch, files_to_move) - bfd *arch; - char **files_to_move; +move_members (bfd *arch, char **files_to_move) { bfd **after_bfd; /* New entries go after this one */ bfd **current_ptr_ptr; /* cdr pointer into contents */ @@ -1293,12 +1265,9 @@ move_members (arch, files_to_move) /* Ought to default to replacing in place, but this is existing practice! */ static void -replace_members (arch, files_to_move, quick) - bfd *arch; - char **files_to_move; - boolean quick; +replace_members (bfd *arch, char **files_to_move, bfd_boolean quick) { - boolean changed = false; + bfd_boolean changed = FALSE; bfd **after_bfd; /* New entries go after this one */ bfd *current; bfd **current_ptr; @@ -1344,7 +1313,7 @@ replace_members (arch, files_to_move, quick) { /* Snip out this entry from the chain. */ *current_ptr = (*current_ptr)->next; - changed = true; + changed = TRUE; } goto next_file; @@ -1355,8 +1324,10 @@ replace_members (arch, files_to_move, quick) /* Add to the end of the archive. */ after_bfd = get_pos_bfd (&arch->next, pos_end, NULL); - if (ar_emul_append (after_bfd, *files_to_move, verbose)) - changed = true; + + if (get_file_size (* files_to_move) > 0 + && ar_emul_append (after_bfd, *files_to_move, verbose)) + changed = TRUE; next_file:; @@ -1370,11 +1341,12 @@ replace_members (arch, files_to_move, quick) } static void -ranlib_only (archname) - const char *archname; +ranlib_only (const char *archname) { bfd *arch; + if (get_file_size (archname) < 1) + return; write_armap = 1; arch = open_inarch (archname, (char *) NULL); if (arch == NULL) @@ -1385,8 +1357,7 @@ ranlib_only (archname) /* Update the timestamp of the symbol map of an archive. */ static void -ranlib_touch (archname) - const char *archname; +ranlib_touch (const char *archname) { #ifdef __GO32__ /* I don't think updating works on go32. */ @@ -1396,6 +1367,8 @@ ranlib_touch (archname) bfd *arch; char **matching; + if (get_file_size (archname) < 1) + return; f = open (archname, O_RDWR | O_BINARY, 0); if (f < 0) { @@ -1431,8 +1404,7 @@ ranlib_touch (archname) /* Things which are interesting to map over all or some of the files: */ static void -print_descr (abfd) - bfd *abfd; +print_descr (bfd *abfd) { print_arelt_descr (stdout, abfd, verbose); } diff --git a/contrib/binutils/binutils/arlex.l b/contrib/binutils/binutils/arlex.l index c1771a5..ab1ff16 100644 --- a/contrib/binutils/binutils/arlex.l +++ b/contrib/binutils/binutils/arlex.l @@ -1,7 +1,7 @@ %{ /* arlex.l - Strange script language lexer */ -/* Copyright 1992, 1997, 2000, 2002 Free Software Foundation, Inc. +/* Copyright 1992, 1997, 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define YY_NO_UNPUT -extern int yylex PARAMS ((void)); +extern int yylex (void); int linenumber; %} @@ -87,5 +87,5 @@ int linenumber; %% #ifndef yywrap /* Needed for lex, though not flex. */ -int yywrap() { return 1; } +int yywrap(void) { return 1; } #endif diff --git a/contrib/binutils/binutils/arparse.y b/contrib/binutils/binutils/arparse.y index cf0ece1..d54de24 100644 --- a/contrib/binutils/binutils/arparse.y +++ b/contrib/binutils/binutils/arparse.y @@ -1,7 +1,8 @@ %{ /* arparse.y - Stange script language parser */ -/* Copyright 1992, 1993, 1995, 1997, 1999 Free Software Foundation, Inc. +/* Copyright 1992, 1993, 1995, 1997, 1999, 2003 + Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -29,8 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bucomm.h" #include "arsup.h" extern int verbose; -extern int yylex PARAMS ((void)); -static int yyerror PARAMS ((const char *)); +extern int yylex (void); +static int yyerror (const char *); %} %union { @@ -193,8 +194,7 @@ verbose_command: %% static int -yyerror (x) - const char *x ATTRIBUTE_UNUSED; +yyerror (const char *x ATTRIBUTE_UNUSED) { extern int linenumber; diff --git a/contrib/binutils/binutils/arsup.c b/contrib/binutils/binutils/arsup.c index 7b01d37..5160dc4 100644 --- a/contrib/binutils/binutils/arsup.c +++ b/contrib/binutils/binutils/arsup.c @@ -1,5 +1,5 @@ /* arsup.c - Archive support for MRI compatibility - Copyright 1992, 1994, 1995, 1996, 1997, 2000, 2002 + Copyright 1992, 1994, 1995, 1996, 1997, 2000, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -32,17 +32,14 @@ #include "filenames.h" static void map_over_list - PARAMS ((bfd *, void (*function) (bfd *, bfd *), struct list *)); -static void ar_directory_doer PARAMS ((bfd *, bfd *)); -static void ar_addlib_doer PARAMS ((bfd *, bfd *)); + (bfd *, void (*function) (bfd *, bfd *), struct list *); +static void ar_directory_doer (bfd *, bfd *); +static void ar_addlib_doer (bfd *, bfd *); extern int verbose; static void -map_over_list (arch, function, list) - bfd *arch; - void (*function) PARAMS ((bfd *, bfd *)); - struct list *list; +map_over_list (bfd *arch, void (*function) (bfd *, bfd *), struct list *list) { bfd *head; @@ -69,7 +66,7 @@ map_over_list (arch, function, list) want to hack multiple references. */ for (ptr = list; ptr; ptr = ptr->next) { - boolean found = false; + bfd_boolean found = FALSE; bfd *prev = arch; for (head = arch->next; head; head = head->next) @@ -77,7 +74,7 @@ map_over_list (arch, function, list) if (head->filename != NULL && FILENAME_CMP (ptr->name, head->filename) == 0) { - found = true; + found = TRUE; function (head, prev); } prev = head; @@ -92,18 +89,13 @@ map_over_list (arch, function, list) FILE *outfile; static void -ar_directory_doer (abfd, ignore) - bfd *abfd; - bfd *ignore ATTRIBUTE_UNUSED; +ar_directory_doer (bfd *abfd, bfd *ignore ATTRIBUTE_UNUSED) { print_arelt_descr(outfile, abfd, verbose); } void -ar_directory (ar_name, list, output) - char *ar_name; - struct list *list; - char *output; +ar_directory (char *ar_name, struct list *list, char *output) { bfd *arch; @@ -130,7 +122,7 @@ ar_directory (ar_name, list, output) } void -DEFUN_VOID(prompt) +prompt (void) { extern int interactive; @@ -142,7 +134,7 @@ DEFUN_VOID(prompt) } void -maybequit () +maybequit (void) { if (! interactive) xexit (9); @@ -153,9 +145,7 @@ bfd *obfd; char *real_name; void -ar_open (name, t) - char *name; - int t; +ar_open (char *name, int t) { char *tname = (char *) xmalloc (strlen (name) + 10); const char *bname = lbasename (name); @@ -192,7 +182,7 @@ ar_open (name, t) return; } - if (bfd_check_format(ibfd, bfd_archive) != true) + if (!bfd_check_format(ibfd, bfd_archive)) { fprintf (stderr, _("%s: file %s is not an archive\n"), @@ -219,9 +209,7 @@ ar_open (name, t) } static void -ar_addlib_doer (abfd, prev) - bfd *abfd; - bfd *prev; +ar_addlib_doer (bfd *abfd, bfd *prev) { /* Add this module to the output bfd. */ if (prev != NULL) @@ -232,9 +220,7 @@ ar_addlib_doer (abfd, prev) } void -ar_addlib (name, list) - char *name; - struct list *list; +ar_addlib (char *name, struct list *list) { if (obfd == NULL) { @@ -249,13 +235,12 @@ ar_addlib (name, list) if (arch != NULL) map_over_list (arch, ar_addlib_doer, list); - /* Don't close the bfd, since it will make the elements disasppear. */ + /* Don't close the bfd, since it will make the elements disappear. */ } } void -ar_addmod (list) - struct list *list; +ar_addmod (struct list *list) { if (!obfd) { @@ -286,15 +271,14 @@ ar_addmod (list) void -ar_clear () +ar_clear (void) { if (obfd) obfd->archive_head = 0; } void -ar_delete (list) - struct list *list; +ar_delete (struct list *list) { if (!obfd) { @@ -336,7 +320,7 @@ ar_delete (list) } void -ar_save () +ar_save (void) { if (!obfd) { @@ -349,15 +333,14 @@ ar_save () bfd_close (obfd); - rename (ofilename, real_name); + smart_rename (ofilename, real_name, 0); obfd = 0; free (ofilename); } } void -ar_replace (list) - struct list *list; +ar_replace (struct list *list) { if (!obfd) { @@ -423,7 +406,7 @@ ar_replace (list) /* And I added this one. */ void -ar_list () +ar_list (void) { if (!obfd) { @@ -446,18 +429,17 @@ ar_list () } void -ar_end () +ar_end (void) { if (obfd) { - fclose ((FILE *)(obfd->iostream)); + bfd_cache_close (obfd); unlink (bfd_get_filename (obfd)); } } void -ar_extract (list) - struct list *list; +ar_extract (struct list *list) { if (!obfd) { diff --git a/contrib/binutils/binutils/arsup.h b/contrib/binutils/binutils/arsup.h index aeec258..e3a1807 100644 --- a/contrib/binutils/binutils/arsup.h +++ b/contrib/binutils/binutils/arsup.h @@ -1,5 +1,5 @@ /* arsup.h - archive support header file - Copyright 1992, 1993, 1994, 1996 Free Software Foundation, Inc. + Copyright 1992, 1993, 1994, 1996, 2003 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -22,40 +22,40 @@ struct list { struct list *next; }; -void maybequit PARAMS ((void)); +void maybequit (void); -void prompt PARAMS ((void)); +void prompt (void); -void ar_clear PARAMS ((void)); +void ar_clear (void); -void ar_replace PARAMS ((struct list *)); +void ar_replace (struct list *); -void ar_delete PARAMS ((struct list *)); +void ar_delete (struct list *); -void ar_save PARAMS ((void)); +void ar_save (void); -void ar_list PARAMS ((void)); +void ar_list (void); -void ar_open PARAMS ((char *, int)); +void ar_open (char *, int); -void ar_directory PARAMS ((char *, struct list *, char *)); +void ar_directory (char *, struct list *, char *); -void ar_addmod PARAMS ((struct list *)); +void ar_addmod (struct list *); -void ar_addlib PARAMS ((char *, struct list *)); +void ar_addlib (char *, struct list *); -void ar_end PARAMS ((void)); +void ar_end (void); -void ar_extract PARAMS ((struct list *)); +void ar_extract (struct list *); -bfd *open_inarch PARAMS ((const char *archive_filename, const char *)); +bfd *open_inarch (const char *archive_filename, const char *); -extern int yylex PARAMS ((void)); +extern int yylex (void); -int yyparse PARAMS ((void)); +int yyparse (void); /* Functions from ar.c */ -void extract_file PARAMS ((bfd * abfd)); +void extract_file (bfd * abfd); extern int interactive; diff --git a/contrib/binutils/binutils/binemul.c b/contrib/binutils/binutils/binemul.c index 5144793..3f6ed65 100644 --- a/contrib/binutils/binutils/binemul.c +++ b/contrib/binutils/binutils/binemul.c @@ -1,5 +1,5 @@ /* Binutils emulation layer. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. Written by Tom Rix, Redhat. This file is part of GNU Binutils. @@ -23,39 +23,32 @@ extern bin_emulation_xfer_type bin_dummy_emulation; void -ar_emul_usage (fp) - FILE *fp; +ar_emul_usage (FILE *fp) { if (bin_dummy_emulation.ar_usage) bin_dummy_emulation.ar_usage (fp); } void -ar_emul_default_usage (fp) - FILE *fp; +ar_emul_default_usage (FILE *fp) { AR_EMUL_USAGE_PRINT_OPTION_HEADER (fp); /* xgettext:c-format */ fprintf (fp, _(" No emulation specific options\n")); } -boolean -ar_emul_append (after_bfd, file_name, verbose) - bfd **after_bfd; - char *file_name; - boolean verbose; +bfd_boolean +ar_emul_append (bfd **after_bfd, char *file_name, bfd_boolean verbose) { if (bin_dummy_emulation.ar_append) return bin_dummy_emulation.ar_append (after_bfd, file_name, verbose); - return false; + return FALSE; } -boolean -ar_emul_default_append (after_bfd, file_name, verbose) - bfd **after_bfd; - char *file_name; - boolean verbose; +bfd_boolean +ar_emul_default_append (bfd **after_bfd, char *file_name, + bfd_boolean verbose) { bfd *temp; @@ -67,26 +60,21 @@ ar_emul_default_append (after_bfd, file_name, verbose) (*after_bfd)->next = temp; - return true; + return TRUE; } -boolean -ar_emul_replace (after_bfd, file_name, verbose) - bfd **after_bfd; - char *file_name; - boolean verbose; +bfd_boolean +ar_emul_replace (bfd **after_bfd, char *file_name, bfd_boolean verbose) { if (bin_dummy_emulation.ar_replace) return bin_dummy_emulation.ar_replace (after_bfd, file_name, verbose); - return false; + return FALSE; } -boolean -ar_emul_default_replace (after_bfd, file_name, verbose) - bfd **after_bfd; - char *file_name; - boolean verbose; +bfd_boolean +ar_emul_default_replace (bfd **after_bfd, char *file_name, + bfd_boolean verbose) { bfd *temp; @@ -98,27 +86,22 @@ ar_emul_default_replace (after_bfd, file_name, verbose) (*after_bfd)->next = temp; - return true; + return TRUE; } -boolean -ar_emul_create (abfd_out, archive_file_name, file_name) - bfd **abfd_out; - char *archive_file_name; - char *file_name; +bfd_boolean +ar_emul_create (bfd **abfd_out, char *archive_file_name, char *file_name) { if (bin_dummy_emulation.ar_create) return bin_dummy_emulation.ar_create (abfd_out, archive_file_name, file_name); - return false; + return FALSE; } -boolean -ar_emul_default_create (abfd_out, archive_file_name, file_name) - bfd **abfd_out; - char *archive_file_name; - char *file_name; +bfd_boolean +ar_emul_default_create (bfd **abfd_out, char *archive_file_name, + char *file_name) { char *target = NULL; @@ -144,22 +127,20 @@ ar_emul_default_create (abfd_out, archive_file_name, file_name) || ! bfd_close (*abfd_out)) bfd_fatal (archive_file_name); - return true; + return TRUE; } -boolean -ar_emul_parse_arg (arg) - char *arg; +bfd_boolean +ar_emul_parse_arg (char *arg) { if (bin_dummy_emulation.ar_parse_arg) return bin_dummy_emulation.ar_parse_arg (arg); - return false; + return FALSE; } -boolean -ar_emul_default_parse_arg (arg) - char *arg ATTRIBUTE_UNUSED; +bfd_boolean +ar_emul_default_parse_arg (char *arg ATTRIBUTE_UNUSED) { - return false; + return FALSE; } diff --git a/contrib/binutils/binutils/binemul.h b/contrib/binutils/binutils/binemul.h index bbcb16e..59dc2bd 100644 --- a/contrib/binutils/binutils/binemul.h +++ b/contrib/binutils/binutils/binemul.h @@ -1,5 +1,5 @@ /* Binutils emulation layer. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. Written by Tom Rix, Redhat. This file is part of GNU Binutils. @@ -24,16 +24,16 @@ #include "bfd.h" #include "bucomm.h" -extern void ar_emul_usage PARAMS ((FILE *)); -extern void ar_emul_default_usage PARAMS ((FILE *)); -extern boolean ar_emul_append PARAMS ((bfd **, char *, boolean)); -extern boolean ar_emul_default_append PARAMS ((bfd **, char *, boolean)); -extern boolean ar_emul_replace PARAMS ((bfd **, char *, boolean)); -extern boolean ar_emul_default_replace PARAMS ((bfd **, char *, boolean)); -extern boolean ar_emul_create PARAMS ((bfd **, char *, char *)); -extern boolean ar_emul_default_create PARAMS ((bfd **, char *, char *)); -extern boolean ar_emul_parse_arg PARAMS ((char *)); -extern boolean ar_emul_default_parse_arg PARAMS ((char *)); +extern void ar_emul_usage (FILE *); +extern void ar_emul_default_usage (FILE *); +extern bfd_boolean ar_emul_append (bfd **, char *, bfd_boolean); +extern bfd_boolean ar_emul_default_append (bfd **, char *, bfd_boolean); +extern bfd_boolean ar_emul_replace (bfd **, char *, bfd_boolean); +extern bfd_boolean ar_emul_default_replace (bfd **, char *, bfd_boolean); +extern bfd_boolean ar_emul_create (bfd **, char *, char *); +extern bfd_boolean ar_emul_default_create (bfd **, char *, char *); +extern bfd_boolean ar_emul_parse_arg (char *); +extern bfd_boolean ar_emul_default_parse_arg (char *); /* Macros for common output. */ @@ -53,11 +53,11 @@ extern boolean ar_emul_default_parse_arg PARAMS ((char *)); typedef struct bin_emulation_xfer_struct { /* Print out the extra options. */ - void (* ar_usage) PARAMS ((FILE *fp)); - boolean (* ar_append) PARAMS ((bfd **, char *, boolean)); - boolean (* ar_replace) PARAMS ((bfd **, char *, boolean)); - boolean (* ar_create) PARAMS ((bfd **, char *, char *)); - boolean (* ar_parse_arg) PARAMS ((char *)); + void (* ar_usage) (FILE *fp); + bfd_boolean (* ar_append) (bfd **, char *, bfd_boolean); + bfd_boolean (* ar_replace) (bfd **, char *, bfd_boolean); + bfd_boolean (* ar_create) (bfd **, char *, char *); + bfd_boolean (* ar_parse_arg) (char *); } bin_emulation_xfer_type; diff --git a/contrib/binutils/binutils/bucomm.c b/contrib/binutils/binutils/bucomm.c index 7ffcaba..6573e2d 100644 --- a/contrib/binutils/binutils/bucomm.c +++ b/contrib/binutils/binutils/bucomm.c @@ -1,5 +1,5 @@ /* bucomm.c -- Bin Utils COMmon code. - Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, 2001, 2002 + Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -23,9 +23,11 @@ loaded, but for now it's not necessary. */ #include "bfd.h" +#include "bfdver.h" #include "libiberty.h" #include "bucomm.h" #include "filenames.h" +#include "libbfd.h" #include #include /* ctime, maybe time_t */ @@ -35,14 +37,18 @@ typedef long time_t; #endif #endif + +static const char * endian_string (enum bfd_endian); +static int display_target_list (void); +static int display_info_table (int, int); +static int display_target_tables (void); -/* Error reporting */ +/* Error reporting. */ char *program_name; void -bfd_nonfatal (string) - const char *string; +bfd_nonfatal (const char *string) { const char *errmsg = bfd_errmsg (bfd_get_error ()); @@ -53,17 +59,14 @@ bfd_nonfatal (string) } void -bfd_fatal (string) - const char *string; +bfd_fatal (const char *string) { bfd_nonfatal (string); xexit (1); } void -report (format, args) - const char * format; - va_list args; +report (const char * format, va_list args) { fprintf (stderr, "%s: ", program_name); vfprintf (stderr, format, args); @@ -97,7 +100,7 @@ non_fatal VPARAMS ((const char *format, ...)) different target. */ void -set_default_bfd_target () +set_default_bfd_target (void) { /* The macro TARGET is defined by Makefile. */ const char *target = TARGET; @@ -107,13 +110,12 @@ set_default_bfd_target () target, bfd_errmsg (bfd_get_error ())); } -/* After a false return from bfd_check_format_matches with +/* After a FALSE return from bfd_check_format_matches with bfd_get_error () == bfd_error_file_ambiguously_recognized, print the possible matching targets. */ void -list_matching_formats (p) - char **p; +list_matching_formats (char **p) { fprintf (stderr, _("%s: Matching formats:"), program_name); while (*p) @@ -124,9 +126,7 @@ list_matching_formats (p) /* List the supported targets. */ void -list_supported_targets (name, f) - const char *name; - FILE *f; +list_supported_targets (const char *name, FILE *f) { int t; const char **targ_names = bfd_target_list (); @@ -145,11 +145,9 @@ list_supported_targets (name, f) /* List the supported architectures. */ void -list_supported_architectures (name, f) - const char *name; - FILE *f; +list_supported_architectures (const char *name, FILE *f) { - const char** arch; + const char **arch; if (name == NULL) fprintf (f, _("Supported architectures:")); @@ -161,15 +159,205 @@ list_supported_architectures (name, f) fprintf (f, "\n"); } +/* The length of the longest architecture name + 1. */ +#define LONGEST_ARCH sizeof ("powerpc:common") + +static const char * +endian_string (enum bfd_endian endian) +{ + switch (endian) + { + case BFD_ENDIAN_BIG: return "big endian"; + case BFD_ENDIAN_LITTLE: return "little endian"; + default: return "endianness unknown"; + } +} + +/* List the targets that BFD is configured to support, each followed + by its endianness and the architectures it supports. */ + +static int +display_target_list (void) +{ + char *dummy_name; + int t; + int ret = 1; + + dummy_name = make_temp_file (NULL); + for (t = 0; bfd_target_vector[t]; t++) + { + const bfd_target *p = bfd_target_vector[t]; + bfd *abfd = bfd_openw (dummy_name, p->name); + int a; + + printf ("%s\n (header %s, data %s)\n", p->name, + endian_string (p->header_byteorder), + endian_string (p->byteorder)); + + if (abfd == NULL) + { + bfd_nonfatal (dummy_name); + ret = 0; + continue; + } + + if (! bfd_set_format (abfd, bfd_object)) + { + if (bfd_get_error () != bfd_error_invalid_operation) + { + bfd_nonfatal (p->name); + ret = 0; + } + bfd_close_all_done (abfd); + continue; + } + + for (a = (int) bfd_arch_obscure + 1; a < (int) bfd_arch_last; a++) + if (bfd_set_arch_mach (abfd, (enum bfd_architecture) a, 0)) + printf (" %s\n", + bfd_printable_arch_mach ((enum bfd_architecture) a, 0)); + bfd_close_all_done (abfd); + } + unlink (dummy_name); + free (dummy_name); + + return ret; +} + +/* Print a table showing which architectures are supported for entries + FIRST through LAST-1 of bfd_target_vector (targets across, + architectures down). */ + +static int +display_info_table (int first, int last) +{ + int t; + int a; + int ret = 1; + char *dummy_name; + + /* Print heading of target names. */ + printf ("\n%*s", (int) LONGEST_ARCH, " "); + for (t = first; t < last && bfd_target_vector[t]; t++) + printf ("%s ", bfd_target_vector[t]->name); + putchar ('\n'); + + dummy_name = make_temp_file (NULL); + for (a = (int) bfd_arch_obscure + 1; a < (int) bfd_arch_last; a++) + if (strcmp (bfd_printable_arch_mach (a, 0), "UNKNOWN!") != 0) + { + printf ("%*s ", (int) LONGEST_ARCH - 1, + bfd_printable_arch_mach (a, 0)); + for (t = first; t < last && bfd_target_vector[t]; t++) + { + const bfd_target *p = bfd_target_vector[t]; + bfd_boolean ok = TRUE; + bfd *abfd = bfd_openw (dummy_name, p->name); + + if (abfd == NULL) + { + bfd_nonfatal (p->name); + ret = 0; + ok = FALSE; + } + + if (ok) + { + if (! bfd_set_format (abfd, bfd_object)) + { + if (bfd_get_error () != bfd_error_invalid_operation) + { + bfd_nonfatal (p->name); + ret = 0; + } + ok = FALSE; + } + } + + if (ok) + { + if (! bfd_set_arch_mach (abfd, a, 0)) + ok = FALSE; + } + + if (ok) + printf ("%s ", p->name); + else + { + int l = strlen (p->name); + while (l--) + putchar ('-'); + putchar (' '); + } + if (abfd != NULL) + bfd_close_all_done (abfd); + } + putchar ('\n'); + } + unlink (dummy_name); + free (dummy_name); + + return ret; +} + +/* Print tables of all the target-architecture combinations that + BFD has been configured to support. */ + +static int +display_target_tables (void) +{ + int t; + int columns; + int ret = 1; + char *colum; + + columns = 0; + colum = getenv ("COLUMNS"); + if (colum != NULL) + columns = atoi (colum); + if (columns == 0) + columns = 80; + + t = 0; + while (bfd_target_vector[t] != NULL) + { + int oldt = t, wid; + + wid = LONGEST_ARCH + strlen (bfd_target_vector[t]->name) + 1; + ++t; + while (wid < columns && bfd_target_vector[t] != NULL) + { + int newwid; + + newwid = wid + strlen (bfd_target_vector[t]->name) + 1; + if (newwid >= columns) + break; + wid = newwid; + ++t; + } + if (! display_info_table (oldt, t)) + ret = 0; + } + + return ret; +} + +int +display_info (void) +{ + printf (_("BFD header file version %s\n"), BFD_VERSION_STRING); + if (! display_target_list () || ! display_target_tables ()) + return 1; + else + return 0; +} + /* Display the archive header for an element as if it were an ls -l listing: Mode User\tGroup\tSize\tDate Name */ void -print_arelt_descr (file, abfd, verbose) - FILE *file; - bfd *abfd; - boolean verbose; +print_arelt_descr (FILE *file, bfd *abfd, bfd_boolean verbose) { struct stat buf; @@ -200,8 +388,7 @@ print_arelt_descr (file, abfd, verbose) /* Return the name of a temporary file in the same directory as FILENAME. */ char * -make_tempname (filename) - char *filename; +make_tempname (char *filename) { static char template[] = "stXXXXXX"; char *tmpname; @@ -251,9 +438,7 @@ make_tempname (filename) parsed. */ bfd_vma -parse_vma (s, arg) - const char *s; - const char *arg; +parse_vma (const char *s, const char *arg) { bfd_vma ret; const char *end; @@ -265,3 +450,28 @@ parse_vma (s, arg) return ret; } + +/* Returns the size of the named file. If the file does not + exist, or if it is not a real file, then a suitable non-fatal + error message is printed and zero is returned. */ + +off_t +get_file_size (const char * file_name) +{ + struct stat statbuf; + + if (stat (file_name, &statbuf) < 0) + { + if (errno == ENOENT) + non_fatal (_("'%s': No such file"), file_name); + else + non_fatal (_("Warning: could not locate '%s'. reason: %s"), + file_name, strerror (errno)); + } + else if (! S_ISREG (statbuf.st_mode)) + non_fatal (_("Warning: '%s' is not an ordinary file"), file_name); + else + return statbuf.st_size; + + return 0; +} diff --git a/contrib/binutils/binutils/bucomm.h b/contrib/binutils/binutils/bucomm.h index 0c98a7f..f604053 100644 --- a/contrib/binutils/binutils/bucomm.h +++ b/contrib/binutils/binutils/bucomm.h @@ -1,22 +1,22 @@ /* bucomm.h -- binutils common include file. - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 - Free Software Foundation, Inc. + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2002, 2003 Free Software Foundation, Inc. -This file is part of GNU Binutils. + This file is part of GNU Binutils. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _BUCOMM_H #define _BUCOMM_H @@ -148,46 +148,50 @@ void *alloca (); #endif /* bucomm.c */ -void bfd_nonfatal PARAMS ((const char *)); +void bfd_nonfatal (const char *); -void bfd_fatal PARAMS ((const char *)) ATTRIBUTE_NORETURN; +void bfd_fatal (const char *) ATTRIBUTE_NORETURN; -void report PARAMS ((const char *, va_list)); +void report (const char *, va_list); -void fatal PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; +void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN; -void non_fatal PARAMS ((const char *, ...)) ATTRIBUTE_PRINTF_1; +void non_fatal (const char *, ...) ATTRIBUTE_PRINTF_1; -void set_default_bfd_target PARAMS ((void)); +void set_default_bfd_target (void); -void list_matching_formats PARAMS ((char **p)); +void list_matching_formats (char **); -void list_supported_targets PARAMS ((const char *, FILE *)); +void list_supported_targets (const char *, FILE *); -void list_supported_architectures PARAMS ((const char *, FILE *)); +void list_supported_architectures (const char *, FILE *); -void print_arelt_descr PARAMS ((FILE *file, bfd *abfd, boolean verbose)); +int display_info (void); -char *make_tempname PARAMS ((char *)); +void print_arelt_descr (FILE *, bfd *, bfd_boolean); -bfd_vma parse_vma PARAMS ((const char *, const char *)); +char *make_tempname (char *); + +bfd_vma parse_vma (const char *, const char *); + +off_t get_file_size (const char *); extern char *program_name; /* filemode.c */ -void mode_string PARAMS ((unsigned long mode, char *buf)); +void mode_string (unsigned long, char *); /* version.c */ -extern void print_version PARAMS ((const char *)); +extern void print_version (const char *); /* rename.c */ -extern void set_times PARAMS ((const char *, const struct stat *)); +extern void set_times (const char *, const struct stat *); -extern int smart_rename PARAMS ((const char *, const char *, int)); +extern int smart_rename (const char *, const char *, int); -/* libiberty */ -PTR xmalloc PARAMS ((size_t)); +/* libiberty. */ +void *xmalloc (size_t); -PTR xrealloc PARAMS ((PTR, size_t)); +void *xrealloc (void *, size_t); #endif /* _BUCOMM_H */ diff --git a/contrib/binutils/binutils/budbg.h b/contrib/binutils/binutils/budbg.h index 2bbf72e..f5c03bd 100644 --- a/contrib/binutils/binutils/budbg.h +++ b/contrib/binutils/binutils/budbg.h @@ -1,5 +1,5 @@ /* budbg.c -- Interfaces to the generic debugging information routines. - Copyright 1995, 1996 Free Software Foundation, Inc. + Copyright 1995, 1996, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GNU Binutils. @@ -26,33 +26,33 @@ /* Routine used to read generic debugging information. */ -extern PTR read_debugging_info PARAMS ((bfd *, asymbol **, long)); +extern void *read_debugging_info (bfd *, asymbol **, long); /* Routine used to print generic debugging information. */ -extern boolean print_debugging_info PARAMS ((FILE *, PTR)); +extern bfd_boolean print_debugging_info + (FILE *, void *, bfd *, asymbol **, void *, bfd_boolean); /* Routines used to read and write stabs information. */ -extern PTR start_stab PARAMS ((PTR, bfd *, boolean, asymbol **, long)); +extern void *start_stab (void *, bfd *, bfd_boolean, asymbol **, long); -extern boolean finish_stab PARAMS ((PTR, PTR)); +extern bfd_boolean finish_stab (void *, void *); -extern boolean parse_stab PARAMS ((PTR, PTR, int, int, bfd_vma, const char *)); +extern bfd_boolean parse_stab + (void *, void *, int, int, bfd_vma, const char *); -extern boolean write_stabs_in_sections_debugging_info - PARAMS ((bfd *, PTR, bfd_byte **, bfd_size_type *, bfd_byte **, - bfd_size_type *)); +extern bfd_boolean write_stabs_in_sections_debugging_info + (bfd *, void *, bfd_byte **, bfd_size_type *, bfd_byte **, bfd_size_type *); /* Routines used to read and write IEEE debugging information. */ -extern boolean parse_ieee - PARAMS ((PTR, bfd *, const bfd_byte *, bfd_size_type)); +extern bfd_boolean parse_ieee (void *, bfd *, const bfd_byte *, bfd_size_type); -extern boolean write_ieee_debugging_info PARAMS ((bfd *, PTR)); +extern bfd_boolean write_ieee_debugging_info (bfd *, void *); /* Routine used to read COFF debugging information. */ -extern boolean parse_coff PARAMS ((bfd *, asymbol **, long, PTR)); +extern bfd_boolean parse_coff (bfd *, asymbol **, long, void *); #endif diff --git a/contrib/binutils/binutils/budemang.c b/contrib/binutils/binutils/budemang.c index 3f8d385..525a1c8 100644 --- a/contrib/binutils/binutils/budemang.c +++ b/contrib/binutils/binutils/budemang.c @@ -1,5 +1,5 @@ /* demangle.c -- A wrapper calling libiberty cplus_demangle - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -36,9 +36,7 @@ other such chars that would otherwise confuse the demangler. */ char * -demangle (abfd, name) - bfd *abfd; - const char *name; +demangle (bfd *abfd, const char *name) { char *res; const char *p; diff --git a/contrib/binutils/binutils/budemang.h b/contrib/binutils/binutils/budemang.h index 60a3c2d..b837d71 100644 --- a/contrib/binutils/binutils/budemang.h +++ b/contrib/binutils/binutils/budemang.h @@ -1,5 +1,5 @@ /* demangle.h -- A wrapper calling libiberty cplus_demangle - Copyright 2002 Free Software Foundation, Inc. + Copyright 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -20,6 +20,6 @@ #ifndef BUDEMANG_H #define BUDEMANG_H -char *demangle PARAMS ((bfd *, const char *)); +char *demangle (bfd *, const char *); #endif diff --git a/contrib/binutils/binutils/coffdump.c b/contrib/binutils/binutils/coffdump.c index 8f538e8..039b955 100644 --- a/contrib/binutils/binutils/coffdump.c +++ b/contrib/binutils/binutils/coffdump.c @@ -1,5 +1,5 @@ /* Coff file dumper. - Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002 + Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -32,23 +32,22 @@ static int atnl; -static void tab PARAMS ((int)); -static void nl PARAMS ((void)); -static void dump_coff_lines PARAMS ((struct coff_line *)); -static void dump_coff_type PARAMS ((struct coff_type *)); -static void dump_coff_where PARAMS ((struct coff_where *)); -static void dump_coff_visible PARAMS ((struct coff_visible *)); -extern void dump_coff_symbol PARAMS ((struct coff_symbol *)); -static void dump_coff_scope PARAMS ((struct coff_scope *)); -static void dump_coff_sfile PARAMS ((struct coff_sfile *)); -static void dump_coff_section PARAMS ((struct coff_section *)); -extern void coff_dump PARAMS ((struct coff_ofile *)); -static void show_usage PARAMS ((FILE *, int)); -extern int main PARAMS ((int, char **)); +static void tab (int); +static void nl (void); +static void dump_coff_lines (struct coff_line *); +static void dump_coff_type (struct coff_type *); +static void dump_coff_where (struct coff_where *); +static void dump_coff_visible (struct coff_visible *); +extern void dump_coff_symbol (struct coff_symbol *); +static void dump_coff_scope (struct coff_scope *); +static void dump_coff_sfile (struct coff_sfile *); +static void dump_coff_section (struct coff_section *); +extern void coff_dump (struct coff_ofile *); +static void show_usage (FILE *, int); +extern int main (int, char **); static void -tab (x) - int x; +tab (int x) { static int indent; int i; @@ -91,14 +90,13 @@ tab (x) } static void -nl () +nl (void) { atnl = 1; } static void -dump_coff_lines (p) - struct coff_line *p; +dump_coff_lines (struct coff_line *p) { int i; int online = 0; @@ -124,8 +122,7 @@ dump_coff_lines (p) } static void -dump_coff_type (p) - struct coff_type *p; +dump_coff_type (struct coff_type *p) { tab (1); printf ("size %d ", p->size); @@ -244,8 +241,7 @@ dump_coff_type (p) } static void -dump_coff_where (p) - struct coff_where *p; +dump_coff_where (struct coff_where *p) { tab (1); switch (p->where) @@ -284,8 +280,7 @@ dump_coff_where (p) } static void -dump_coff_visible (p) - struct coff_visible *p; +dump_coff_visible (struct coff_visible *p) { tab (1); switch (p->type) @@ -331,8 +326,7 @@ dump_coff_visible (p) } void -dump_coff_symbol (p) - struct coff_symbol *p; +dump_coff_symbol (struct coff_symbol *p) { tab (1); printf ("List of symbols"); @@ -365,8 +359,7 @@ dump_coff_symbol (p) } static void -dump_coff_scope (p) - struct coff_scope *p; +dump_coff_scope (struct coff_scope *p) { if (p) { @@ -402,8 +395,7 @@ dump_coff_scope (p) } static void -dump_coff_sfile (p) - struct coff_sfile *p; +dump_coff_sfile (struct coff_sfile *p) { tab (1); printf ("List of source files"); @@ -421,8 +413,7 @@ dump_coff_sfile (p) } static void -dump_coff_section(ptr) - struct coff_section *ptr; +dump_coff_section (struct coff_section *ptr) { int i; @@ -446,8 +437,7 @@ dump_coff_section(ptr) } void -coff_dump (ptr) - struct coff_ofile *ptr; +coff_dump (struct coff_ofile *ptr) { int i; @@ -464,9 +454,7 @@ coff_dump (ptr) char * program_name; static void -show_usage (file, status) - FILE *file; - int status; +show_usage (FILE *file, int status) { fprintf (file, _("Usage: %s [option(s)] in-file\n"), program_name); fprintf (file, _(" Print a human readable interpretation of a SYSROFF object file\n")); @@ -482,9 +470,7 @@ show_usage (file, status) } int -main (ac, av) - int ac; - char *av[]; +main (int ac, char **av) { bfd *abfd; struct coff_ofile *tree; diff --git a/contrib/binutils/binutils/coffgrok.c b/contrib/binutils/binutils/coffgrok.c index 8cab8d5..b2ec98c 100644 --- a/contrib/binutils/binutils/coffgrok.c +++ b/contrib/binutils/binutils/coffgrok.c @@ -1,5 +1,5 @@ /* coffgrok.c - Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2002 + Copyright 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -56,30 +56,30 @@ static struct coff_ptr_struct *rawsyms; static int rawcount; static bfd *abfd; -#define PTR_SIZE 4 -#define SHORT_SIZE 2 -#define INT_SIZE 4 -#define LONG_SIZE 4 -#define FLOAT_SIZE 4 -#define DOUBLE_SIZE 8 +#define PTR_SIZE 4 +#define SHORT_SIZE 2 +#define INT_SIZE 4 +#define LONG_SIZE 4 +#define FLOAT_SIZE 4 +#define DOUBLE_SIZE 8 #define INDEXOF(p) ((struct coff_ptr_struct *)(p)-(rawsyms)) -static struct coff_scope *empty_scope PARAMS ((void)); -static struct coff_symbol *empty_symbol PARAMS ((void)); -static void push_scope PARAMS ((int)); -static void pop_scope PARAMS ((void)); -static void do_sections_p1 PARAMS ((struct coff_ofile *)); -static void do_sections_p2 PARAMS ((struct coff_ofile *)); -static struct coff_where *do_where PARAMS ((int)); -static struct coff_line *do_lines PARAMS ((int, char *)); -static struct coff_type *do_type PARAMS ((int)); -static struct coff_visible *do_visible PARAMS ((int)); -static int do_define PARAMS ((int, struct coff_scope *)); -static struct coff_ofile *doit PARAMS ((void)); +static struct coff_scope *empty_scope (void); +static struct coff_symbol *empty_symbol (void); +static void push_scope (int); +static void pop_scope (void); +static void do_sections_p1 (struct coff_ofile *); +static void do_sections_p2 (struct coff_ofile *); +static struct coff_where *do_where (int); +static struct coff_line *do_lines (int, char *); +static struct coff_type *do_type (int); +static struct coff_visible *do_visible (int); +static int do_define (int, struct coff_scope *); +static struct coff_ofile *doit (void); static struct coff_scope * -empty_scope () +empty_scope (void) { struct coff_scope *l; l = (struct coff_scope *) (xcalloc (sizeof (struct coff_scope), 1)); @@ -87,15 +87,14 @@ empty_scope () } static struct coff_symbol * -empty_symbol () +empty_symbol (void) { return (struct coff_symbol *) (xcalloc (sizeof (struct coff_symbol), 1)); } /*int l;*/ static void -push_scope (link) - int link; +push_scope (int link) { struct coff_scope *n = empty_scope (); if (link) @@ -119,14 +118,13 @@ push_scope (link) } static void -pop_scope () +pop_scope (void) { top_scope = top_scope->parent; } static void -do_sections_p1 (head) - struct coff_ofile *head; +do_sections_p1 (struct coff_ofile *head) { asection *section; int idx; @@ -175,8 +173,7 @@ do_sections_p1 (head) } static void -do_sections_p2 (head) - struct coff_ofile *head; +do_sections_p2 (struct coff_ofile *head) { asection *section; for (section = abfd->sections; section; section = section->next) @@ -198,8 +195,7 @@ do_sections_p2 (head) } static struct coff_where * -do_where (i) - int i; +do_where (int i) { struct internal_syment *sym = &rawsyms[i].u.syment; struct coff_where *where = @@ -258,9 +254,7 @@ do_where (i) static struct coff_line * -do_lines (i, name) - int i; - char *name ATTRIBUTE_UNUSED; +do_lines (int i, char *name ATTRIBUTE_UNUSED) { struct coff_line *res = (struct coff_line *) xcalloc (sizeof (struct coff_line), 1); asection *s; @@ -307,8 +301,7 @@ do_lines (i, name) static struct coff_type * -do_type (i) - int i; +do_type (int i) { struct internal_syment *sym = &rawsyms[i].u.syment; union internal_auxent *aux = &rawsyms[i + 1].u.auxent; @@ -377,7 +370,7 @@ do_type (i) { if (aux->x_sym.x_tagndx.p) { - /* Refering to a struct defined elsewhere */ + /* Referring to a struct defined elsewhere */ res->type = coff_structref_type; res->u.astructref.ref = tindex[INDEXOF (aux->x_sym.x_tagndx.p)]; res->size = res->u.astructref.ref ? @@ -396,7 +389,7 @@ do_type (i) } else { - /* No auxents - it's anonynmous */ + /* No auxents - it's anonymous */ res->type = coff_structref_type; res->u.astructref.ref = 0; res->size = 0; @@ -405,7 +398,7 @@ do_type (i) case T_ENUM: if (aux->x_sym.x_tagndx.p) { - /* Refering to a enum defined elsewhere */ + /* Referring to a enum defined elsewhere */ res->type = coff_enumref_type; res->u.aenumref.ref = tindex[INDEXOF (aux->x_sym.x_tagndx.p)]; res->size = res->u.aenumref.ref->type->size; @@ -474,8 +467,7 @@ do_type (i) } static struct coff_visible * -do_visible (i) - int i; +do_visible (int i) { struct internal_syment *sym = &rawsyms[i].u.syment; struct coff_visible *visible = @@ -539,9 +531,7 @@ do_visible (i) } static int -do_define (i, b) - int i; - struct coff_scope *b; +do_define (int i, struct coff_scope *b) { static int symbol_index; struct internal_syment *sym = &rawsyms[i].u.syment; @@ -601,7 +591,7 @@ do_define (i, b) static struct coff_ofile * -doit () +doit (void) { int i; int infile = 0; @@ -728,8 +718,7 @@ doit () } struct coff_ofile * -coff_grok (inabfd) - bfd *inabfd; +coff_grok (bfd *inabfd) { long storage; struct coff_ofile *p; diff --git a/contrib/binutils/binutils/coffgrok.h b/contrib/binutils/binutils/coffgrok.h index d071d24..c063f1d 100644 --- a/contrib/binutils/binutils/coffgrok.h +++ b/contrib/binutils/binutils/coffgrok.h @@ -53,7 +53,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ int nrelocs; int size; struct coff_reloc *relocs; - struct sec *bfd_section; + struct bfd_section *bfd_section; }; struct coff_ofile diff --git a/contrib/binutils/binutils/config.in b/contrib/binutils/binutils/config.in index d404762..f2bd049 100644 --- a/contrib/binutils/binutils/config.in +++ b/contrib/binutils/binutils/config.in @@ -28,9 +28,6 @@ /* Define to `long' if doesn't define. */ #undef off_t -/* Define if you need to in order for stat and other things to work. */ -#undef _POSIX_SOURCE - /* Define to `unsigned' if doesn't define. */ #undef size_t @@ -136,12 +133,6 @@ /* Define if you have the header file. */ #undef HAVE_SYS_PARAM_H -/* Define if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define if you have the header file. */ -#undef HAVE_SYS_TYPES_H - /* Define if you have the header file. */ #undef HAVE_UNISTD_H @@ -208,3 +199,6 @@ /* Configured target name. */ #undef TARGET +/* Define to 1 if user symbol names have a leading underscore, 0 if not. */ +#undef TARGET_PREPENDS_UNDERSCORE + diff --git a/contrib/binutils/binutils/configure b/contrib/binutils/binutils/configure index 7c163c9..8210910 100755 --- a/contrib/binutils/binutils/configure +++ b/contrib/binutils/binutils/configure @@ -53,6 +53,7 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= +sitefile= srcdir= target=NONE verbose= @@ -167,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 @@ -337,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=*) @@ -502,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 @@ -546,12 +557,12 @@ else fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:550: checking for Cygwin environment" >&5 +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 +if { (eval echo configure:577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -579,19 +590,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:583: checking for mingw32 environment" >&5 +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 +if { (eval echo configure:606: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -656,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:660: checking host system type" >&5 +echo "configure:671: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -677,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:681: checking target system type" >&5 +echo "configure:692: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -695,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:699: checking build system type" >&5 +echo "configure:710: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -717,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:724: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -CC="$ac_cv_prog_CC" -if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:754: 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:805: 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="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:837: 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 848 "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:879: 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:884: 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:912: 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:944: checking for POSIXized ISC" >&5 -if test -d /etc/conf/kconfig.d && - grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 -then +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - ISC=yes # If later tests want to check for ISC. - cat >> confdefs.h <<\EOF -#define _POSIX_SOURCE 1 -EOF - - if test "$GCC" = yes; then - CC="$CC -posix" - else - CC="$CC -Xp" - fi + LIBS="$LIBS -lcposix" else echo "$ac_t""no" 1>&6 - ISC= fi + + BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in` # Find a good install program. We prefer a C program (faster), @@ -974,7 +785,7 @@ BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${ # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:978: checking for a BSD compatible install" >&5 +echo "configure:789: 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 @@ -1027,7 +838,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:1031: checking whether build environment is sane" >&5 +echo "configure:842: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -1084,7 +895,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:1088: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:899: 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 @@ -1130,7 +941,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:1134: checking for working aclocal" >&5 +echo "configure:945: 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. @@ -1143,7 +954,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1147: checking for working autoconf" >&5 +echo "configure:958: 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. @@ -1156,7 +967,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1160: checking for working automake" >&5 +echo "configure:971: 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. @@ -1169,7 +980,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1173: checking for working autoheader" >&5 +echo "configure:984: 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. @@ -1182,7 +993,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1186: checking for working makeinfo" >&5 +echo "configure:997: 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. @@ -1265,6 +1076,228 @@ else enable_fast_install=yes fi +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1083: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1113: 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:1164: 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:1196: 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 1207 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:1212: \"$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:1238: 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:1243: 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:1271: 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" @@ -1277,7 +1310,7 @@ ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1281: checking for ld used by GCC" >&5 +echo "configure:1314: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1307,10 +1340,10 @@ echo "configure:1281: 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:1311: checking for GNU ld" >&5 +echo "configure:1344: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1314: checking for non-GNU ld" >&5 +echo "configure:1347: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1345,7 +1378,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:1349: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1382: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1362,7 +1395,7 @@ with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1366: checking for $LD option to reload object files" >&5 +echo "configure:1399: 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 @@ -1374,7 +1407,7 @@ 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:1378: checking for BSD-compatible nm" >&5 +echo "configure:1411: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1412,7 +1445,7 @@ NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1416: checking whether ln -s works" >&5 +echo "configure:1449: 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 @@ -1433,7 +1466,7 @@ else fi echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1437: checking how to recognise dependant libraries" >&5 +echo "configure:1470: 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 @@ -1543,7 +1576,7 @@ irix5* | irix6*) # This must be Linux ELF. linux-gnu*) case $host_cpu in - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) + alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM @@ -1606,13 +1639,13 @@ file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1610: checking for object suffix" >&5 +echo "configure:1643: 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:1616: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1649: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1632,7 +1665,7 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1636: checking for executable suffix" >&5 +echo "configure:1669: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1642,10 +1675,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1646: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1679: \"$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 @@ -1675,7 +1708,7 @@ 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:1679: checking for ${ac_tool_prefix}file" >&5 +echo "configure:1712: 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 @@ -1737,7 +1770,7 @@ 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:1741: checking for file" >&5 +echo "configure:1774: 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 @@ -1808,7 +1841,7 @@ esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1812: checking for $ac_word" >&5 +echo "configure:1845: 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 @@ -1840,7 +1873,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1844: checking for $ac_word" >&5 +echo "configure:1877: 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 @@ -1875,7 +1908,7 @@ fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1879: checking for $ac_word" >&5 +echo "configure:1912: 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 @@ -1907,7 +1940,7 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1911: checking for $ac_word" >&5 +echo "configure:1944: 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 @@ -1974,8 +2007,21 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1978 "configure"' > conftest.$ac_ext - if { (eval echo configure:1979: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 2011 "configure"' > conftest.$ac_ext + if { (eval echo configure:2012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" @@ -1987,6 +2033,7 @@ case $host in LD="${LD-ld} -64" ;; esac + fi fi rm -rf conftest* ;; @@ -1994,7 +2041,7 @@ case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo configure:1998: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:2045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *ELF-32*) HPUX_IA64_MODE="32" @@ -2012,7 +2059,7 @@ ia64-*-hpux*) SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2016: checking whether the C compiler needs -belf" >&5 +echo "configure:2063: 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 @@ -2025,14 +2072,14 @@ ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$a cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2083: \"$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 @@ -2205,7 +2252,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:2209: checking for $ac_word" >&5 +echo "configure:2256: 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 @@ -2235,7 +2282,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:2239: checking for $ac_word" >&5 +echo "configure:2286: 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 @@ -2286,7 +2333,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:2290: checking for $ac_word" >&5 +echo "configure:2337: 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 @@ -2318,7 +2365,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2322: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2369: 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. @@ -2329,12 +2376,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2333 "configure" +#line 2380 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2385: \"$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 @@ -2360,12 +2407,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:2364: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2411: 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:2369: checking whether we are using GNU C" >&5 +echo "configure:2416: 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 @@ -2374,7 +2421,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2378: \"$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:2425: \"$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 @@ -2393,7 +2440,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:2397: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2444: 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 @@ -2430,7 +2477,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:2434: checking for $ac_word" >&5 +echo "configure:2481: 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 @@ -2461,7 +2508,7 @@ done test -n "$YACC" || YACC="yacc" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:2465: checking how to run the C preprocessor" >&5 +echo "configure:2512: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2476,13 +2523,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:2486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2533: \"$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 : @@ -2493,13 +2540,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:2503: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2550: \"$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 : @@ -2510,13 +2557,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:2520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2567: \"$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 : @@ -2546,7 +2593,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:2550: checking for $ac_word" >&5 +echo "configure:2597: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2579,7 +2626,7 @@ test -n "$LEX" || LEX="$missing_dir/missing flex" # Extract the first word of "flex", so it can be a program name with args. set dummy flex; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2583: checking for $ac_word" >&5 +echo "configure:2630: 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 @@ -2613,7 +2660,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:2617: checking for yywrap in -l$ac_lib" >&5 +echo "configure:2664: 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 @@ -2621,7 +2668,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:2683: \"$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 @@ -2655,7 +2702,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:2659: checking lex output file root" >&5 +echo "configure:2706: 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 @@ -2676,7 +2723,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:2680: checking whether yytext is a pointer" >&5 +echo "configure:2727: 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 @@ -2688,14 +2735,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:2746: \"$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 @@ -2717,11 +2764,11 @@ EOF fi -ALL_LINGUAS="fr tr ja es sv da" +ALL_LINGUAS="fr tr ja es sv da zh_CN ru" # 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:2725: checking for $ac_word" >&5 +echo "configure:2772: 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 @@ -2749,12 +2796,12 @@ else fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2753: checking for ANSI C header files" >&5 +echo "configure:2800: 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 @@ -2762,7 +2809,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2766: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2813: \"$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* @@ -2779,7 +2826,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 @@ -2797,7 +2844,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 @@ -2818,7 +2865,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2829,7 +2876,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2853,12 +2900,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2857: checking for working const" >&5 +echo "configure:2904: 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:2958: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2928,21 +2975,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2932: checking for inline" >&5 +echo "configure:2979: 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:2993: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2968,12 +3015,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2972: checking for off_t" >&5 +echo "configure:3019: 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 @@ -3001,12 +3048,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3005: checking for size_t" >&5 +echo "configure:3052: 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 @@ -3036,19 +3083,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:3040: checking for working alloca.h" >&5 +echo "configure:3087: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:3052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3099: \"$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 @@ -3069,12 +3116,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:3073: checking for alloca" >&5 +echo "configure:3120: 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:3153: \"$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 @@ -3134,12 +3181,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:3138: checking whether alloca needs Cray hooks" >&5 +echo "configure:3185: 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:3168: checking for $ac_func" >&5 +echo "configure:3215: 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:3243: \"$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 @@ -3219,7 +3266,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:3223: checking stack direction for C alloca" >&5 +echo "configure:3270: 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 @@ -3227,7 +3274,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:3297: \"$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 @@ -3267,21 +3314,21 @@ EOF fi -for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h +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:3275: checking for $ac_hdr" >&5 +echo "configure:3322: 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:3285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3332: \"$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* @@ -3310,12 +3357,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3314: checking for $ac_func" >&5 +echo "configure:3361: 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:3389: \"$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 @@ -3363,7 +3410,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:3367: checking for working mmap" >&5 +echo "configure:3414: 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 @@ -3371,7 +3418,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext < #include -#if HAVE_SYS_TYPES_H -# include -#endif - -#if HAVE_STDLIB_H -# include -#endif - -#if HAVE_SYS_STAT_H -# include -#endif - -#if HAVE_UNISTD_H -# include -#endif - /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE +# ifdef HAVE_UNISTD_H +# include +# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -3524,7 +3558,7 @@ main() } EOF -if { (eval echo configure:3528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3562: \"$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 @@ -3552,17 +3586,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:3556: checking for $ac_hdr" >&5 +echo "configure:3590: 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:3566: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3600: \"$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* @@ -3592,12 +3626,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3596: checking for $ac_func" >&5 +echo "configure:3630: 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:3658: \"$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 @@ -3649,12 +3683,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3653: checking for $ac_func" >&5 +echo "configure:3687: 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:3715: \"$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 @@ -3711,19 +3745,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3715: checking for LC_MESSAGES" >&5 +echo "configure:3749: 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:3727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3761: \"$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 @@ -3744,7 +3778,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3748: checking whether NLS is requested" >&5 +echo "configure:3782: 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" @@ -3764,7 +3798,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3768: checking whether included gettext is requested" >&5 +echo "configure:3802: 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" @@ -3783,17 +3817,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3787: checking for libintl.h" >&5 +echo "configure:3821: 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:3797: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3831: \"$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* @@ -3810,19 +3844,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:3814: checking for gettext in libc" >&5 +echo "configure:3848: 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:3826: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3860: \"$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 @@ -3838,7 +3872,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:3842: checking for bindtextdomain in -lintl" >&5 +echo "configure:3876: 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 @@ -3846,7 +3880,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:3895: \"$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 @@ -3873,19 +3907,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:3877: checking for gettext in libintl" >&5 +echo "configure:3911: 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:3923: \"$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 @@ -3913,7 +3947,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:3917: checking for $ac_word" >&5 +echo "configure:3951: 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 @@ -3947,12 +3981,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3951: checking for $ac_func" >&5 +echo "configure:3985: 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:4013: \"$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 @@ -4002,7 +4036,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:4006: checking for $ac_word" >&5 +echo "configure:4040: 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 @@ -4038,7 +4072,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:4042: checking for $ac_word" >&5 +echo "configure:4076: 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 @@ -4070,7 +4104,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -4110,7 +4144,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:4114: checking for $ac_word" >&5 +echo "configure:4148: 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 @@ -4144,7 +4178,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:4148: checking for $ac_word" >&5 +echo "configure:4182: 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 @@ -4180,7 +4214,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:4184: checking for $ac_word" >&5 +echo "configure:4218: 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 @@ -4270,7 +4304,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:4274: checking for catalogs to be installed" >&5 +echo "configure:4308: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -4298,17 +4332,17 @@ echo "configure:4274: 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:4302: checking for linux/version.h" >&5 +echo "configure:4336: 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:4312: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4346: \"$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* @@ -4371,7 +4405,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:4375: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:4409: 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" @@ -4396,7 +4430,7 @@ fi echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:4400: checking for executable suffix" >&5 +echo "configure:4434: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4406,10 +4440,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:4410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:4444: \"$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 @@ -4449,7 +4483,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:4453: checking for $ac_word" >&5 +echo "configure:4487: 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 @@ -4488,7 +4522,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:4492: checking for a BSD compatible install" >&5 +echo "configure:4526: 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 @@ -4555,7 +4589,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:4559: checking for build system executable suffix" >&5 +echo "configure:4593: 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 @@ -4590,17 +4624,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:4594: checking for $ac_hdr" >&5 +echo "configure:4628: 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:4604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4638: \"$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* @@ -4627,12 +4661,12 @@ fi done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:4631: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:4665: 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 @@ -4648,7 +4682,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:4652: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4686: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -4671,19 +4705,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:4675: checking for working alloca.h" >&5 +echo "configure:4709: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:4687: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4721: \"$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 @@ -4704,12 +4738,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:4708: checking for alloca" >&5 +echo "configure:4742: 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:4775: \"$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 @@ -4769,12 +4803,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4773: checking whether alloca needs Cray hooks" >&5 +echo "configure:4807: 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:4803: checking for $ac_func" >&5 +echo "configure:4837: 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:4865: \"$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 @@ -4854,7 +4888,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4858: checking stack direction for C alloca" >&5 +echo "configure:4892: 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 @@ -4862,7 +4896,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:4919: \"$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 @@ -4905,12 +4939,12 @@ fi for ac_func in sbrk utimes setmode getc_unlocked strcoll do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4909: checking for $ac_func" >&5 +echo "configure:4943: 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:4971: \"$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 @@ -4961,19 +4995,19 @@ done # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE # needs to be defined for it echo $ac_n "checking for fopen64""... $ac_c" 1>&6 -echo "configure:4965: checking for fopen64" >&5 +echo "configure:4999: checking for fopen64" >&5 if eval "test \"`echo '$''{'bu_cv_have_fopen64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { FILE *f = fopen64 ("/tmp/foo","r"); ; return 0; } EOF -if { (eval echo configure:4977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bu_cv_have_fopen64=yes else @@ -4983,14 +5017,14 @@ else saved_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE" cat > conftest.$ac_ext < int main() { FILE *f = fopen64 ("/tmp/foo","r"); ; return 0; } EOF -if { (eval echo configure:4994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE" else @@ -5022,14 +5056,14 @@ fi # Some systems have frexp only in -lm, not in -lc. echo $ac_n "checking for library containing frexp""... $ac_c" 1>&6 -echo "configure:5026: checking for library containing frexp" >&5 +echo "configure:5060: 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:5078: \"$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 @@ -5051,7 +5085,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:5100: \"$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 @@ -5084,19 +5118,19 @@ else : fi echo $ac_n "checking for time_t in time.h""... $ac_c" 1>&6 -echo "configure:5088: checking for time_t in time.h" >&5 +echo "configure:5122: 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:5100: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5134: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_time_h=yes else @@ -5117,19 +5151,19 @@ EOF fi echo $ac_n "checking for time_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:5121: checking for time_t in sys/types.h" >&5 +echo "configure:5155: 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:5133: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5167: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_types_h=yes else @@ -5152,12 +5186,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:5156: checking for utime.h" >&5 +echo "configure:5190: 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 @@ -5168,7 +5202,7 @@ int main() { struct utimbuf s; ; return 0; } EOF -if { (eval echo configure:5172: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_header_utime_h=yes else @@ -5189,12 +5223,12 @@ EOF fi echo $ac_n "checking whether fprintf must be declared""... $ac_c" 1>&6 -echo "configure:5193: checking whether fprintf must be declared" >&5 +echo "configure:5227: 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 < @@ -5215,7 +5249,7 @@ int main() { char *(*pfn) = (char *(*)) fprintf ; return 0; } EOF -if { (eval echo configure:5219: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5253: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_fprintf=no else @@ -5236,12 +5270,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:5240: checking whether strstr must be declared" >&5 +echo "configure:5274: 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 < @@ -5262,7 +5296,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:5266: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -5283,12 +5317,12 @@ EOF fi echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6 -echo "configure:5287: checking whether sbrk must be declared" >&5 +echo "configure:5321: 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 < @@ -5309,7 +5343,7 @@ int main() { char *(*pfn) = (char *(*)) sbrk ; return 0; } EOF -if { (eval echo configure:5313: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5347: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_sbrk=no else @@ -5330,12 +5364,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:5334: checking whether getenv must be declared" >&5 +echo "configure:5368: 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 < @@ -5356,7 +5390,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:5360: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -5377,12 +5411,12 @@ EOF fi echo $ac_n "checking whether environ must be declared""... $ac_c" 1>&6 -echo "configure:5381: checking whether environ must be declared" >&5 +echo "configure:5415: 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 < @@ -5403,7 +5437,7 @@ int main() { char *(*pfn) = (char *(*)) environ ; return 0; } EOF -if { (eval echo configure:5407: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5441: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_environ=no else @@ -5469,7 +5503,7 @@ do NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC" else case $targ in - i[3456]86*-*-netware*) + i[3-7]86*-*-netware*) BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)' NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386" ;; @@ -5495,12 +5529,12 @@ do DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; - arm-pe* | arm-*-wince) + arm-*-pe* | arm-*-wince) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; - thumb-pe*) + thumb-*-pe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' @@ -5508,16 +5542,21 @@ do arm*-* | xscale-* | strongarm-* | d10v-*) OBJDUMP_DEFS="-DDISASSEMBLER_NEEDS_RELOCS" ;; - i[3-6]86-pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32** | i[3-6]86-*-netbsdpe*) + i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)' ;; - i3-686-*-interix) + i[3-7]86-*-interix) BUILD_DLLTOOL='$(DLLTOOL_PROG)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" ;; + powerpc*-aix5.[01]) + ;; + powerpc*-aix5.*) + OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT" + ;; powerpc*-*-pe* | powerpc*-*-cygwin*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC" @@ -5533,15 +5572,21 @@ do DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; - mcore-pe) + mcore-*-pe) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; - mcore-*elf) + mcore-*-elf) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF" ;; + c4x-*-* | tic4x-*-*) + OBJDUMP_DEFS="$OBJDUMP_DEFS -DSKIP_ZEROES=32" + ;; + ia64-*-*) + OBJDUMP_DEFS="$OBJDUMP_DEFS -DSKIP_ZEROES=16" + ;; esac fi done @@ -5572,6 +5617,9 @@ if test "x$targ_underscore" = "xyes"; then else UNDERSCORE=0 fi +cat >> confdefs.h <demangling_style_name); + + for (demangler = libiberty_demanglers + 1; + demangler->demangling_style != unknown_demangling; + ++demangler) + fprintf (stream, ",%s", demangler->demangling_style_name); + + fprintf (stream, "}"); +} + +static void +usage (FILE *stream, int status) +{ + fprintf (stream, "\ +Usage: %s [-_] [-n] [--strip-underscores] [--no-strip-underscores]\n\ + [-p] [--no-params]\n", + program_name); + + fprintf (stream, "\ + [-s "); + print_demangler_list (stream); + fprintf (stream, "]\n"); + + fprintf (stream, "\ + [--format "); + print_demangler_list (stream); + fprintf (stream, "]\n"); + + fprintf (stream, "\ + [--help] [--version] [arg...]\n"); + exit (status); +} + +#define MBUF_SIZE 32767 +char mbuffer[MBUF_SIZE]; + +int strip_underscore = 0; + +static const struct option long_options[] = { + {"strip-underscores", no_argument, 0, '_'}, + {"format", required_argument, 0, 's'}, + {"help", no_argument, 0, 'h'}, + {"no-params", no_argument, 0, 'p'}, + {"no-strip-underscores", no_argument, 0, 'n'}, + {"version", no_argument, 0, 'v'}, + {0, no_argument, 0, 0} +}; + +static const char *standard_symbol_characters (void); + +static const char *hp_symbol_characters (void); + +/* Return the string of non-alnum characters that may occur + as a valid symbol component, in the standard assembler symbol + syntax. */ + +static const char * +standard_symbol_characters (void) +{ + return "_$."; +} + + +/* Return the string of non-alnum characters that may occur + as a valid symbol name component in an HP object file. + + Note that, since HP's compiler generates object code straight from + C++ source, without going through an assembler, its mangled + identifiers can use all sorts of characters that no assembler would + tolerate, so the alphabet this function creates is a little odd. + Here are some sample mangled identifiers offered by HP: + + typeid*__XT24AddressIndExpClassMember_ + [Vftptr]key:__dt__32OrdinaryCompareIndExpClassMemberFv + __ct__Q2_9Elf64_Dyn18{unnamed.union.#1}Fv + + This still seems really weird to me, since nowhere else in this + file is there anything to recognize curly brackets, parens, etc. + I've talked with Srikanth , and he assures me + this is right, but I still strongly suspect that there's a + misunderstanding here. + + If we decide it's better for c++filt to use HP's assembler syntax + to scrape identifiers out of its input, here's the definition of + the symbol name syntax from the HP assembler manual: + + Symbols are composed of uppercase and lowercase letters, decimal + digits, dollar symbol, period (.), ampersand (&), pound sign(#) and + underscore (_). A symbol can begin with a letter, digit underscore or + dollar sign. If a symbol begins with a digit, it must contain a + non-digit character. + + So have fun. */ +static const char * +hp_symbol_characters (void) +{ + return "_$.<>#,*&[]:(){}"; +} + +extern int main (int, char **); + +int +main (int argc, char **argv) +{ + char *result; + int c; + const char *valid_symbols; + enum demangling_styles style = auto_demangling; + + program_name = argv[0]; + xmalloc_set_program_name (program_name); + + strip_underscore = TARGET_PREPENDS_UNDERSCORE; + + while ((c = getopt_long (argc, argv, "_nps:", long_options, (int *) 0)) != EOF) + { + switch (c) + { + case '?': + usage (stderr, 1); + break; + case 'h': + usage (stdout, 0); + case 'n': + strip_underscore = 0; + break; + case 'p': + flags &= ~ DMGL_PARAMS; + break; + case 'v': + print_version ("c++filt"); + return (0); + case '_': + strip_underscore = 1; + break; + case 's': + { + style = cplus_demangle_name_to_style (optarg); + if (style == unknown_demangling) + { + fprintf (stderr, "%s: unknown demangling style `%s'\n", + program_name, optarg); + return (1); + } + else + cplus_demangle_set_style (style); + } + break; + } + } + + if (optind < argc) + { + for ( ; optind < argc; optind++) + { + demangle_it (argv[optind]); + } + } + else + { + switch (current_demangling_style) + { + case gnu_demangling: + case lucid_demangling: + case arm_demangling: + case java_demangling: + case edg_demangling: + case gnat_demangling: + case gnu_v3_demangling: + case auto_demangling: + valid_symbols = standard_symbol_characters (); + break; + case hp_demangling: + valid_symbols = hp_symbol_characters (); + break; + default: + /* Folks should explicitly indicate the appropriate alphabet for + each demangling. Providing a default would allow the + question to go unconsidered. */ + fatal ("Internal error: no symbol alphabet for current style"); + } + + for (;;) + { + int i = 0; + c = getchar (); + /* Try to read a label. */ + while (c != EOF && (ISALNUM (c) || strchr (valid_symbols, c))) + { + if (i >= MBUF_SIZE-1) + break; + mbuffer[i++] = c; + c = getchar (); + } + if (i > 0) + { + int skip_first = 0; + + mbuffer[i] = 0; + if (mbuffer[0] == '.' || mbuffer[0] == '$') + ++skip_first; + if (strip_underscore && mbuffer[skip_first] == '_') + ++skip_first; + + if (skip_first > i) + skip_first = i; + + flags |= (int) style; + result = cplus_demangle (mbuffer + skip_first, flags); + if (result) + { + if (mbuffer[0] == '.') + putc ('.', stdout); + fputs (result, stdout); + free (result); + } + else + fputs (mbuffer, stdout); + + fflush (stdout); + } + if (c == EOF) + break; + putchar (c); + fflush (stdout); + } + } + + return (0); +} diff --git a/contrib/binutils/binutils/debug.c b/contrib/binutils/binutils/debug.c index 3ce609b..5d46b78 100644 --- a/contrib/binutils/binutils/debug.c +++ b/contrib/binutils/binutils/debug.c @@ -1,5 +1,5 @@ /* debug.c -- Handle generic debugging information. - Copyright 1995, 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GNU Binutils. @@ -22,7 +22,7 @@ /* This file implements a generic debugging format. We may eventually have readers which convert different formats into this generic format, and writers which write it out. The initial impetus for - this was writing a convertor from stabs to HP IEEE-695 debugging + this was writing a converter from stabs to HP IEEE-695 debugging format. */ #include @@ -111,7 +111,7 @@ struct debug_type struct debug_indirect_type *kindirect; /* DEBUG_KIND_INT. */ /* Whether the integer is unsigned. */ - boolean kint; + bfd_boolean kint; /* DEBUG_KIND_STRUCT, DEBUG_KIND_UNION, DEBUG_KIND_CLASS, DEBUG_KIND_UNION_CLASS. */ struct debug_class_type *kclass; @@ -194,7 +194,7 @@ struct debug_function_type /* NULL terminated array of argument types. */ debug_type *arg_types; /* Whether the function takes a variable number of arguments. */ - boolean varargs; + bfd_boolean varargs; }; /* Information kept for a range. */ @@ -222,7 +222,7 @@ struct debug_array_type /* Upper bound. */ bfd_signed_vma upper; /* Whether this array is really a string. */ - boolean stringp; + bfd_boolean stringp; }; /* Information kept for a set. */ @@ -232,7 +232,7 @@ struct debug_set_type /* Base type. */ debug_type type; /* Whether this set is really a bitstring. */ - boolean bitstringp; + bfd_boolean bitstringp; }; /* Information kept for an offset type (a based pointer). */ @@ -256,7 +256,7 @@ struct debug_method_type /* A NULL terminated array of argument types. */ debug_type *arg_types; /* Whether the method takes a variable number of arguments. */ - boolean varargs; + bfd_boolean varargs; }; /* Information kept for a named type. */ @@ -280,7 +280,7 @@ struct debug_field /* Visibility of the field. */ enum debug_visibility visibility; /* Whether this is a static member. */ - boolean static_member; + bfd_boolean static_member; union { /* If static_member is false. */ @@ -308,7 +308,7 @@ struct debug_baseclass /* Bit position of the base class in the object. */ unsigned int bitpos; /* Whether the base class is virtual. */ - boolean virtual; + bfd_boolean virtual; /* Visibility of the base class. */ enum debug_visibility visibility; }; @@ -335,9 +335,9 @@ struct debug_method_variant /* The visibility of the function. */ enum debug_visibility visibility; /* Whether the function is const. */ - boolean constp; + bfd_boolean constp; /* Whether the function is volatile. */ - boolean volatilep; + bfd_boolean volatilep; /* The offset to the function in the virtual function table. */ bfd_vma voffset; /* If voffset is VOFFSET_STATIC_METHOD, this is a static method. */ @@ -554,47 +554,45 @@ struct debug_type_real_list /* Local functions. */ -static void debug_error PARAMS ((const char *)); +static void debug_error (const char *); static struct debug_name *debug_add_to_namespace - PARAMS ((struct debug_handle *, struct debug_namespace **, const char *, - enum debug_object_kind, enum debug_object_linkage)); + (struct debug_handle *, struct debug_namespace **, const char *, + enum debug_object_kind, enum debug_object_linkage); static struct debug_name *debug_add_to_current_namespace - PARAMS ((struct debug_handle *, const char *, enum debug_object_kind, - enum debug_object_linkage)); + (struct debug_handle *, const char *, enum debug_object_kind, + enum debug_object_linkage); static struct debug_type *debug_make_type - PARAMS ((struct debug_handle *, enum debug_type_kind, unsigned int)); + (struct debug_handle *, enum debug_type_kind, unsigned int); static struct debug_type *debug_get_real_type - PARAMS ((PTR, debug_type, struct debug_type_real_list *)); -static boolean debug_write_name - PARAMS ((struct debug_handle *, const struct debug_write_fns *, PTR, - struct debug_name *)); -static boolean debug_write_type - PARAMS ((struct debug_handle *, const struct debug_write_fns *, PTR, - struct debug_type *, struct debug_name *)); -static boolean debug_write_class_type - PARAMS ((struct debug_handle *, const struct debug_write_fns *, PTR, - struct debug_type *, const char *)); -static boolean debug_write_function - PARAMS ((struct debug_handle *, const struct debug_write_fns *, PTR, - const char *, enum debug_object_linkage, struct debug_function *)); -static boolean debug_write_block - PARAMS ((struct debug_handle *, const struct debug_write_fns *, PTR, - struct debug_block *)); -static boolean debug_write_linenos - PARAMS ((struct debug_handle *, const struct debug_write_fns *, PTR, - bfd_vma)); -static boolean debug_set_class_id - PARAMS ((struct debug_handle *, const char *, struct debug_type *)); -static boolean debug_type_samep - PARAMS ((struct debug_handle *, struct debug_type *, struct debug_type *)); -static boolean debug_class_type_samep - PARAMS ((struct debug_handle *, struct debug_type *, struct debug_type *)); + (void *, debug_type, struct debug_type_real_list *); +static bfd_boolean debug_write_name + (struct debug_handle *, const struct debug_write_fns *, void *, + struct debug_name *); +static bfd_boolean debug_write_type + (struct debug_handle *, const struct debug_write_fns *, void *, + struct debug_type *, struct debug_name *); +static bfd_boolean debug_write_class_type + (struct debug_handle *, const struct debug_write_fns *, void *, + struct debug_type *, const char *); +static bfd_boolean debug_write_function + (struct debug_handle *, const struct debug_write_fns *, void *, + const char *, enum debug_object_linkage, struct debug_function *); +static bfd_boolean debug_write_block + (struct debug_handle *, const struct debug_write_fns *, void *, + struct debug_block *); +static bfd_boolean debug_write_linenos + (struct debug_handle *, const struct debug_write_fns *, void *, bfd_vma); +static bfd_boolean debug_set_class_id + (struct debug_handle *, const char *, struct debug_type *); +static bfd_boolean debug_type_samep + (struct debug_handle *, struct debug_type *, struct debug_type *); +static bfd_boolean debug_class_type_samep + (struct debug_handle *, struct debug_type *, struct debug_type *); /* Issue an error message. */ static void -debug_error (message) - const char *message; +debug_error (const char *message) { fprintf (stderr, "%s\n", message); } @@ -602,12 +600,10 @@ debug_error (message) /* Add an object to a namespace. */ static struct debug_name * -debug_add_to_namespace (info, nsp, name, kind, linkage) - struct debug_handle *info ATTRIBUTE_UNUSED; - struct debug_namespace **nsp; - const char *name; - enum debug_object_kind kind; - enum debug_object_linkage linkage; +debug_add_to_namespace (struct debug_handle *info ATTRIBUTE_UNUSED, + struct debug_namespace **nsp, const char *name, + enum debug_object_kind kind, + enum debug_object_linkage linkage) { struct debug_name *n; struct debug_namespace *ns; @@ -639,11 +635,9 @@ debug_add_to_namespace (info, nsp, name, kind, linkage) /* Add an object to the current namespace. */ static struct debug_name * -debug_add_to_current_namespace (info, name, kind, linkage) - struct debug_handle *info; - const char *name; - enum debug_object_kind kind; - enum debug_object_linkage linkage; +debug_add_to_current_namespace (struct debug_handle *info, const char *name, + enum debug_object_kind kind, + enum debug_object_linkage linkage) { struct debug_namespace **nsp; @@ -664,23 +658,21 @@ debug_add_to_current_namespace (info, name, kind, linkage) /* Return a handle for debugging information. */ -PTR -debug_init () +void * +debug_init (void) { struct debug_handle *ret; ret = (struct debug_handle *) xmalloc (sizeof *ret); memset (ret, 0, sizeof *ret); - return (PTR) ret; + return (void *) ret; } /* Set the source filename. This implicitly starts a new compilation unit. */ -boolean -debug_set_filename (handle, name) - PTR handle; - const char *name; +bfd_boolean +debug_set_filename (void *handle, const char *name) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_file *nfile; @@ -714,16 +706,14 @@ debug_set_filename (handle, name) info->current_block = NULL; info->current_lineno = NULL; - return true; + return TRUE; } /* Change source files to the given file name. This is used for include files in a single compilation unit. */ -boolean -debug_start_source (handle, name) - PTR handle; - const char *name; +bfd_boolean +debug_start_source (void *handle, const char *name) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_file *f, **pf; @@ -734,7 +724,7 @@ debug_start_source (handle, name) if (info->current_unit == NULL) { debug_error (_("debug_start_source: no debug_set_filename call")); - return false; + return FALSE; } for (f = info->current_unit->files; f != NULL; f = f->next) @@ -744,7 +734,7 @@ debug_start_source (handle, name) && strcmp (f->filename, name) == 0) { info->current_file = f; - return true; + return TRUE; } } @@ -761,7 +751,7 @@ debug_start_source (handle, name) info->current_file = f; - return true; + return TRUE; } /* Record a function definition. This implicitly starts a function @@ -772,13 +762,10 @@ debug_start_source (handle, name) debug_record_parameter. FIXME: There is no way to specify nested functions. */ -boolean -debug_record_function (handle, name, return_type, global, addr) - PTR handle; - const char *name; - debug_type return_type; - boolean global; - bfd_vma addr; +bfd_boolean +debug_record_function (void *handle, const char *name, + debug_type return_type, bfd_boolean global, + bfd_vma addr) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_function *f; @@ -788,12 +775,12 @@ debug_record_function (handle, name, return_type, global, addr) if (name == NULL) name = ""; if (return_type == NULL) - return false; + return FALSE; if (info->current_unit == NULL) { debug_error (_("debug_record_function: no debug_set_filename call")); - return false; + return FALSE; } f = (struct debug_function *) xmalloc (sizeof *f); @@ -822,34 +809,30 @@ debug_record_function (handle, name, return_type, global, addr) ? DEBUG_LINKAGE_GLOBAL : DEBUG_LINKAGE_STATIC)); if (n == NULL) - return false; + return FALSE; n->u.function = f; - return true; + return TRUE; } /* Record a parameter for the current function. */ -boolean -debug_record_parameter (handle, name, type, kind, val) - PTR handle; - const char *name; - debug_type type; - enum debug_parm_kind kind; - bfd_vma val; +bfd_boolean +debug_record_parameter (void *handle, const char *name, debug_type type, + enum debug_parm_kind kind, bfd_vma val) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_parameter *p, **pp; if (name == NULL || type == NULL) - return false; + return FALSE; if (info->current_unit == NULL || info->current_function == NULL) { debug_error (_("debug_record_parameter: no current function")); - return false; + return FALSE; } p = (struct debug_parameter *) xmalloc (sizeof *p); @@ -866,15 +849,13 @@ debug_record_parameter (handle, name, type, kind, val) ; *pp = p; - return true; + return TRUE; } /* End a function. FIXME: This should handle function nesting. */ -boolean -debug_end_function (handle, addr) - PTR handle; - bfd_vma addr; +bfd_boolean +debug_end_function (void *handle, bfd_vma addr) { struct debug_handle *info = (struct debug_handle *) handle; @@ -883,13 +864,13 @@ debug_end_function (handle, addr) || info->current_function == NULL) { debug_error (_("debug_end_function: no current function")); - return false; + return FALSE; } if (info->current_block->parent != NULL) { debug_error (_("debug_end_function: some blocks were not closed")); - return false; + return FALSE; } info->current_block->end = addr; @@ -897,7 +878,7 @@ debug_end_function (handle, addr) info->current_function = NULL; info->current_block = NULL; - return true; + return TRUE; } /* Start a block in a function. All local information will be @@ -905,10 +886,8 @@ debug_end_function (handle, addr) debug_start_block and debug_end_block may be nested. The bfd_vma argument is the address at which this block starts. */ -boolean -debug_start_block (handle, addr) - PTR handle; - bfd_vma addr; +bfd_boolean +debug_start_block (void *handle, bfd_vma addr) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_block *b, **pb; @@ -919,7 +898,7 @@ debug_start_block (handle, addr) || info->current_block == NULL) { debug_error (_("debug_start_block: no current block")); - return false; + return FALSE; } b = (struct debug_block *) xmalloc (sizeof *b); @@ -938,17 +917,15 @@ debug_start_block (handle, addr) info->current_block = b; - return true; + return TRUE; } /* Finish a block in a function. This matches the call to debug_start_block. The argument is the address at which this block ends. */ -boolean -debug_end_block (handle, addr) - PTR handle; - bfd_vma addr; +bfd_boolean +debug_end_block (void *handle, bfd_vma addr) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_block *parent; @@ -957,31 +934,28 @@ debug_end_block (handle, addr) || info->current_block == NULL) { debug_error (_("debug_end_block: no current block")); - return false; + return FALSE; } parent = info->current_block->parent; if (parent == NULL) { debug_error (_("debug_end_block: attempt to close top level block")); - return false; + return FALSE; } info->current_block->end = addr; info->current_block = parent; - return true; + return TRUE; } /* Associate a line number in the current source file and function with a given address. */ -boolean -debug_record_line (handle, lineno, addr) - PTR handle; - unsigned long lineno; - bfd_vma addr; +bfd_boolean +debug_record_line (void *handle, unsigned long lineno, bfd_vma addr) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_lineno *l; @@ -990,7 +964,7 @@ debug_record_line (handle, lineno, addr) if (info->current_unit == NULL) { debug_error (_("debug_record_line: no current unit")); - return false; + return FALSE; } l = info->current_lineno; @@ -1002,7 +976,7 @@ debug_record_line (handle, lineno, addr) { l->linenos[i] = lineno; l->addrs[i] = addr; - return true; + return TRUE; } } } @@ -1031,102 +1005,91 @@ debug_record_line (handle, lineno, addr) info->current_lineno = l; - return true; + return TRUE; } /* Start a named common block. This is a block of variables that may move in memory. */ -boolean -debug_start_common_block (handle, name) - PTR handle ATTRIBUTE_UNUSED; - const char *name ATTRIBUTE_UNUSED; +bfd_boolean +debug_start_common_block (void *handle ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED) { /* FIXME */ debug_error (_("debug_start_common_block: not implemented")); - return false; + return FALSE; } /* End a named common block. */ -boolean -debug_end_common_block (handle, name) - PTR handle ATTRIBUTE_UNUSED; - const char *name ATTRIBUTE_UNUSED; +bfd_boolean +debug_end_common_block (void *handle ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED) { /* FIXME */ debug_error (_("debug_end_common_block: not implemented")); - return false; + return FALSE; } /* Record a named integer constant. */ -boolean -debug_record_int_const (handle, name, val) - PTR handle; - const char *name; - bfd_vma val; +bfd_boolean +debug_record_int_const (void *handle, const char *name, bfd_vma val) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_name *n; if (name == NULL) - return false; + return FALSE; n = debug_add_to_current_namespace (info, name, DEBUG_OBJECT_INT_CONSTANT, DEBUG_LINKAGE_NONE); if (n == NULL) - return false; + return FALSE; n->u.int_constant = val; - return true; + return TRUE; } /* Record a named floating point constant. */ -boolean -debug_record_float_const (handle, name, val) - PTR handle; - const char *name; - double val; +bfd_boolean +debug_record_float_const (void *handle, const char *name, double val) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_name *n; if (name == NULL) - return false; + return FALSE; n = debug_add_to_current_namespace (info, name, DEBUG_OBJECT_FLOAT_CONSTANT, DEBUG_LINKAGE_NONE); if (n == NULL) - return false; + return FALSE; n->u.float_constant = val; - return true; + return TRUE; } /* Record a typed constant with an integral value. */ -boolean -debug_record_typed_const (handle, name, type, val) - PTR handle; - const char *name; - debug_type type; - bfd_vma val; +bfd_boolean +debug_record_typed_const (void *handle, const char *name, debug_type type, + bfd_vma val) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_name *n; struct debug_typed_constant *tc; if (name == NULL || type == NULL) - return false; + return FALSE; n = debug_add_to_current_namespace (info, name, DEBUG_OBJECT_TYPED_CONSTANT, DEBUG_LINKAGE_NONE); if (n == NULL) - return false; + return FALSE; tc = (struct debug_typed_constant *) xmalloc (sizeof *tc); memset (tc, 0, sizeof *tc); @@ -1136,32 +1099,27 @@ debug_record_typed_const (handle, name, type, val) n->u.typed_constant = tc; - return true; + return TRUE; } /* Record a label. */ -boolean -debug_record_label (handle, name, type, addr) - PTR handle ATTRIBUTE_UNUSED; - const char *name ATTRIBUTE_UNUSED; - debug_type type ATTRIBUTE_UNUSED; - bfd_vma addr ATTRIBUTE_UNUSED; +bfd_boolean +debug_record_label (void *handle ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED, + debug_type type ATTRIBUTE_UNUSED, + bfd_vma addr ATTRIBUTE_UNUSED) { /* FIXME. */ debug_error (_("debug_record_label: not implemented")); - return false; + return FALSE; } /* Record a variable. */ -boolean -debug_record_variable (handle, name, type, kind, val) - PTR handle; - const char *name; - debug_type type; - enum debug_var_kind kind; - bfd_vma val; +bfd_boolean +debug_record_variable (void *handle, const char *name, debug_type type, + enum debug_var_kind kind, bfd_vma val) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_namespace **nsp; @@ -1170,13 +1128,13 @@ debug_record_variable (handle, name, type, kind, val) struct debug_variable *v; if (name == NULL || type == NULL) - return false; + return FALSE; if (info->current_unit == NULL || info->current_file == NULL) { debug_error (_("debug_record_variable: no current file")); - return false; + return FALSE; } if (kind == DEBUG_GLOBAL || kind == DEBUG_STATIC) @@ -1190,17 +1148,15 @@ debug_record_variable (handle, name, type, kind, val) else { if (info->current_block == NULL) - { - debug_error (_("debug_record_variable: no current block")); - return false; - } - nsp = &info->current_block->locals; + nsp = &info->current_file->globals; + else + nsp = &info->current_block->locals; linkage = DEBUG_LINKAGE_AUTOMATIC; } n = debug_add_to_namespace (info, nsp, name, DEBUG_OBJECT_VARIABLE, linkage); if (n == NULL) - return false; + return FALSE; v = (struct debug_variable *) xmalloc (sizeof *v); memset (v, 0, sizeof *v); @@ -1211,16 +1167,14 @@ debug_record_variable (handle, name, type, kind, val) n->u.variable = v; - return true; + return TRUE; } /* Make a type with a given kind and size. */ static struct debug_type * -debug_make_type (info, kind, size) - struct debug_handle *info ATTRIBUTE_UNUSED; - enum debug_type_kind kind; - unsigned int size; +debug_make_type (struct debug_handle *info ATTRIBUTE_UNUSED, + enum debug_type_kind kind, unsigned int size) { struct debug_type *t; @@ -1237,10 +1191,7 @@ debug_make_type (info, kind, size) which is referenced before it is defined. */ debug_type -debug_make_indirect_type (handle, slot, tag) - PTR handle; - debug_type *slot; - const char *tag; +debug_make_indirect_type (void *handle, debug_type *slot, const char *tag) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1264,8 +1215,7 @@ debug_make_indirect_type (handle, slot, tag) /* Make a void type. There is only one of these. */ debug_type -debug_make_void_type (handle) - PTR handle; +debug_make_void_type (void *handle) { struct debug_handle *info = (struct debug_handle *) handle; @@ -1276,10 +1226,7 @@ debug_make_void_type (handle) if the integer is unsigned. */ debug_type -debug_make_int_type (handle, size, unsignedp) - PTR handle; - unsigned int size; - boolean unsignedp; +debug_make_int_type (void *handle, unsigned int size, bfd_boolean unsignedp) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1298,9 +1245,7 @@ debug_make_int_type (handle, size, unsignedp) the format. */ debug_type -debug_make_float_type (handle, size) - PTR handle; - unsigned int size; +debug_make_float_type (void *handle, unsigned int size) { struct debug_handle *info = (struct debug_handle *) handle; @@ -1310,9 +1255,7 @@ debug_make_float_type (handle, size) /* Make a boolean type of a given size. */ debug_type -debug_make_bool_type (handle, size) - PTR handle; - unsigned int size; +debug_make_bool_type (void *handle, unsigned int size) { struct debug_handle *info = (struct debug_handle *) handle; @@ -1322,9 +1265,7 @@ debug_make_bool_type (handle, size) /* Make a complex type of a given size. */ debug_type -debug_make_complex_type (handle, size) - PTR handle; - unsigned int size; +debug_make_complex_type (void *handle, unsigned int size) { struct debug_handle *info = (struct debug_handle *) handle; @@ -1336,11 +1277,8 @@ debug_make_complex_type (handle, size) The fourth argument is a NULL terminated array of fields. */ debug_type -debug_make_struct_type (handle, structp, size, fields) - PTR handle; - boolean structp; - bfd_vma size; - debug_field *fields; +debug_make_struct_type (void *handle, bfd_boolean structp, bfd_vma size, + debug_field *fields) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1370,16 +1308,10 @@ debug_make_struct_type (handle, structp, size, fields) object has its own virtual function table. */ debug_type -debug_make_object_type (handle, structp, size, fields, baseclasses, - methods, vptrbase, ownvptr) - PTR handle; - boolean structp; - bfd_vma size; - debug_field *fields; - debug_baseclass *baseclasses; - debug_method *methods; - debug_type vptrbase; - boolean ownvptr; +debug_make_object_type (void *handle, bfd_boolean structp, bfd_vma size, + debug_field *fields, debug_baseclass *baseclasses, + debug_method *methods, debug_type vptrbase, + bfd_boolean ownvptr) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1411,10 +1343,8 @@ debug_make_object_type (handle, structp, size, fields, baseclasses, array of strings, and an array of corresponding values. */ debug_type -debug_make_enum_type (handle, names, values) - PTR handle; - const char **names; - bfd_signed_vma *values; +debug_make_enum_type (void *handle, const char **names, + bfd_signed_vma *values) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1438,9 +1368,7 @@ debug_make_enum_type (handle, names, values) /* Make a pointer to a given type. */ debug_type -debug_make_pointer_type (handle, type) - PTR handle; - debug_type type; +debug_make_pointer_type (void *handle, debug_type type) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1466,11 +1394,8 @@ debug_make_pointer_type (handle, type) to record the parameter types. */ debug_type -debug_make_function_type (handle, type, arg_types, varargs) - PTR handle; - debug_type type; - debug_type *arg_types; - boolean varargs; +debug_make_function_type (void *handle, debug_type type, + debug_type *arg_types, bfd_boolean varargs) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1498,9 +1423,7 @@ debug_make_function_type (handle, type, arg_types, varargs) /* Make a reference to a given type. */ debug_type -debug_make_reference_type (handle, type) - PTR handle; - debug_type type; +debug_make_reference_type (void *handle, debug_type type) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1520,11 +1443,8 @@ debug_make_reference_type (handle, type) /* Make a range of a given type from a lower to an upper bound. */ debug_type -debug_make_range_type (handle, type, lower, upper) - PTR handle; - debug_type type; - bfd_signed_vma lower; - bfd_signed_vma upper; +debug_make_range_type (void *handle, debug_type type, bfd_signed_vma lower, + bfd_signed_vma upper) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1556,14 +1476,9 @@ debug_make_range_type (handle, type, lower, upper) actually a string, as in C. */ debug_type -debug_make_array_type (handle, element_type, range_type, lower, upper, - stringp) - PTR handle; - debug_type element_type; - debug_type range_type; - bfd_signed_vma lower; - bfd_signed_vma upper; - boolean stringp; +debug_make_array_type (void *handle, debug_type element_type, + debug_type range_type, bfd_signed_vma lower, + bfd_signed_vma upper, bfd_boolean stringp) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1595,10 +1510,7 @@ debug_make_array_type (handle, element_type, range_type, lower, upper, CHILL. */ debug_type -debug_make_set_type (handle, type, bitstringp) - PTR handle; - debug_type type; - boolean bitstringp; +debug_make_set_type (void *handle, debug_type type, bfd_boolean bitstringp) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1628,10 +1540,8 @@ debug_make_set_type (handle, type, bitstringp) to. */ debug_type -debug_make_offset_type (handle, base_type, target_type) - PTR handle; - debug_type base_type; - debug_type target_type; +debug_make_offset_type (void *handle, debug_type base_type, + debug_type target_type) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1660,12 +1570,9 @@ debug_make_offset_type (handle, base_type, target_type) argument is a NULL terminated array of argument types. */ debug_type -debug_make_method_type (handle, return_type, domain_type, arg_types, varargs) - PTR handle; - debug_type return_type; - debug_type domain_type; - debug_type *arg_types; - boolean varargs; +debug_make_method_type (void *handle, debug_type return_type, + debug_type domain_type, debug_type *arg_types, + bfd_boolean varargs) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1694,9 +1601,7 @@ debug_make_method_type (handle, return_type, domain_type, arg_types, varargs) /* Make a const qualified version of a given type. */ debug_type -debug_make_const_type (handle, type) - PTR handle; - debug_type type; +debug_make_const_type (void *handle, debug_type type) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1716,9 +1621,7 @@ debug_make_const_type (handle, type) /* Make a volatile qualified version of a given type. */ debug_type -debug_make_volatile_type (handle, type) - PTR handle; - debug_type type; +debug_make_volatile_type (void *handle, debug_type type) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1739,10 +1642,8 @@ debug_make_volatile_type (handle, type) been mentioned, but not defined. */ debug_type -debug_make_undefined_tagged_type (handle, name, kind) - PTR handle; - const char *name; - enum debug_type_kind kind; +debug_make_undefined_tagged_type (void *handle, const char *name, + enum debug_type_kind kind) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1778,12 +1679,9 @@ debug_make_undefined_tagged_type (handle, name, kind) argument is the visibility of the base class. */ debug_baseclass -debug_make_baseclass (handle, type, bitpos, virtual, visibility) - PTR handle ATTRIBUTE_UNUSED; - debug_type type; - bfd_vma bitpos; - boolean virtual; - enum debug_visibility visibility; +debug_make_baseclass (void *handle ATTRIBUTE_UNUSED, debug_type type, + bfd_vma bitpos, bfd_boolean virtual, + enum debug_visibility visibility) { struct debug_baseclass *b; @@ -1805,13 +1703,9 @@ debug_make_baseclass (handle, type, bitpos, virtual, visibility) of the field. */ debug_field -debug_make_field (handle, name, type, bitpos, bitsize, visibility) - PTR handle ATTRIBUTE_UNUSED; - const char *name; - debug_type type; - bfd_vma bitpos; - bfd_vma bitsize; - enum debug_visibility visibility; +debug_make_field (void *handle ATTRIBUTE_UNUSED, const char *name, + debug_type type, bfd_vma bitpos, bfd_vma bitsize, + enum debug_visibility visibility) { struct debug_field *f; @@ -1820,7 +1714,7 @@ debug_make_field (handle, name, type, bitpos, bitsize, visibility) f->name = name; f->type = type; - f->static_member = false; + f->static_member = FALSE; f->u.f.bitpos = bitpos; f->u.f.bitsize = bitsize; f->visibility = visibility; @@ -1835,12 +1729,9 @@ debug_make_field (handle, name, type, bitpos, bitsize, visibility) member. */ debug_field -debug_make_static_member (handle, name, type, physname, visibility) - PTR handle ATTRIBUTE_UNUSED; - const char *name; - debug_type type; - const char *physname; - enum debug_visibility visibility; +debug_make_static_member (void *handle ATTRIBUTE_UNUSED, const char *name, + debug_type type, const char *physname, + enum debug_visibility visibility) { struct debug_field *f; @@ -1849,7 +1740,7 @@ debug_make_static_member (handle, name, type, physname, visibility) f->name = name; f->type = type; - f->static_member = true; + f->static_member = TRUE; f->u.s.physname = physname; f->visibility = visibility; @@ -1860,10 +1751,8 @@ debug_make_static_member (handle, name, type, physname, visibility) argument is a NULL terminated array of method variants. */ debug_method -debug_make_method (handle, name, variants) - PTR handle ATTRIBUTE_UNUSED; - const char *name; - debug_method_variant *variants; +debug_make_method (void *handle ATTRIBUTE_UNUSED, const char *name, + debug_method_variant *variants) { struct debug_method *m; @@ -1886,16 +1775,11 @@ debug_make_method (handle, name, variants) necessary? Could we just use debug_make_const_type? */ debug_method_variant -debug_make_method_variant (handle, physname, type, visibility, constp, - volatilep, voffset, context) - PTR handle ATTRIBUTE_UNUSED; - const char *physname; - debug_type type; - enum debug_visibility visibility; - boolean constp; - boolean volatilep; - bfd_vma voffset; - debug_type context; +debug_make_method_variant (void *handle ATTRIBUTE_UNUSED, + const char *physname, debug_type type, + enum debug_visibility visibility, + bfd_boolean constp, bfd_boolean volatilep, + bfd_vma voffset, debug_type context) { struct debug_method_variant *m; @@ -1918,14 +1802,10 @@ debug_make_method_variant (handle, physname, type, visibility, constp, since a static method can not also be virtual. */ debug_method_variant -debug_make_static_method_variant (handle, physname, type, visibility, - constp, volatilep) - PTR handle ATTRIBUTE_UNUSED; - const char *physname; - debug_type type; - enum debug_visibility visibility; - boolean constp; - boolean volatilep; +debug_make_static_method_variant (void *handle ATTRIBUTE_UNUSED, + const char *physname, debug_type type, + enum debug_visibility visibility, + bfd_boolean constp, bfd_boolean volatilep) { struct debug_method_variant *m; @@ -1945,10 +1825,7 @@ debug_make_static_method_variant (handle, physname, type, visibility, /* Name a type. */ debug_type -debug_name_type (handle, name, type) - PTR handle; - const char *name; - debug_type type; +debug_name_type (void *handle, const char *name, debug_type type) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -1994,10 +1871,7 @@ debug_name_type (handle, name, type) /* Tag a type. */ debug_type -debug_tag_type (handle, name, type) - PTR handle; - const char *name; - debug_type type; +debug_tag_type (void *handle, const char *name, debug_type type) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_type *t; @@ -2049,11 +1923,9 @@ debug_tag_type (handle, name, type) /* Record the size of a given type. */ -boolean -debug_record_type_size (handle, type, size) - PTR handle ATTRIBUTE_UNUSED; - debug_type type; - unsigned int size; +bfd_boolean +debug_record_type_size (void *handle ATTRIBUTE_UNUSED, debug_type type, + unsigned int size) { if (type->size != 0 && type->size != size) fprintf (stderr, _("Warning: changing type size from %d to %d\n"), @@ -2061,15 +1933,13 @@ debug_record_type_size (handle, type, size) type->size = size; - return true; + return TRUE; } /* Find a named type. */ debug_type -debug_find_named_type (handle, name) - PTR handle; - const char *name; +debug_find_named_type (void *handle, const char *name) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_block *b; @@ -2122,10 +1992,8 @@ debug_find_named_type (handle, name) /* Find a tagged type. */ debug_type -debug_find_tagged_type (handle, name, kind) - PTR handle; - const char *name; - enum debug_type_kind kind; +debug_find_tagged_type (void *handle, const char *name, + enum debug_type_kind kind) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_unit *u; @@ -2163,10 +2031,8 @@ debug_find_tagged_type (handle, name, kind) crashing if the type is defined circularly. */ static struct debug_type * -debug_get_real_type (handle, type, list) - PTR handle; - debug_type type; - struct debug_type_real_list *list; +debug_get_real_type (void *handle, debug_type type, + struct debug_type_real_list *list) { struct debug_type_real_list *l; struct debug_type_real_list rl; @@ -2184,7 +2050,7 @@ debug_get_real_type (handle, type, list) for (l = list; l != NULL; l = l->next) { - if (l->t == type) + if (l->t == type || l == l->next) { fprintf (stderr, _("debug_get_real_type: circular debug information for %s\n"), @@ -2214,9 +2080,7 @@ debug_get_real_type (handle, type, list) /* Get the kind of a type. */ enum debug_type_kind -debug_get_type_kind (handle, type) - PTR handle; - debug_type type; +debug_get_type_kind (void *handle, debug_type type) { if (type == NULL) return DEBUG_KIND_ILLEGAL; @@ -2229,9 +2093,7 @@ debug_get_type_kind (handle, type) /* Get the name of a type. */ const char * -debug_get_type_name (handle, type) - PTR handle; - debug_type type; +debug_get_type_name (void *handle, debug_type type) { if (type->kind == DEBUG_KIND_INDIRECT) { @@ -2248,9 +2110,7 @@ debug_get_type_name (handle, type) /* Get the size of a type. */ bfd_vma -debug_get_type_size (handle, type) - PTR handle; - debug_type type; +debug_get_type_size (void *handle, debug_type type) { if (type == NULL) return 0; @@ -2279,15 +2139,15 @@ debug_get_type_size (handle, type) /* Get the return type of a function or method type. */ debug_type -debug_get_return_type (handle, type) - PTR handle; - debug_type type; +debug_get_return_type (void *handle, debug_type type) { if (type == NULL) return DEBUG_TYPE_NULL; + type = debug_get_real_type (handle, type, NULL); if (type == NULL) return DEBUG_TYPE_NULL; + switch (type->kind) { default: @@ -2304,16 +2164,16 @@ debug_get_return_type (handle, type) we don't currently store the parameter types of a function). */ const debug_type * -debug_get_parameter_types (handle, type, pvarargs) - PTR handle; - debug_type type; - boolean *pvarargs; +debug_get_parameter_types (void *handle, debug_type type, + bfd_boolean *pvarargs) { if (type == NULL) return NULL; + type = debug_get_real_type (handle, type, NULL); if (type == NULL) return NULL; + switch (type->kind) { default: @@ -2331,15 +2191,15 @@ debug_get_parameter_types (handle, type, pvarargs) /* Get the target type of a type. */ debug_type -debug_get_target_type (handle, type) - PTR handle; - debug_type type; +debug_get_target_type (void *handle, debug_type type) { if (type == NULL) return NULL; + type = debug_get_real_type (handle, type, NULL); if (type == NULL) return NULL; + switch (type->kind) { default: @@ -2360,15 +2220,15 @@ debug_get_target_type (handle, type) class. */ const debug_field * -debug_get_fields (handle, type) - PTR handle; - debug_type type; +debug_get_fields (void *handle, debug_type type) { if (type == NULL) return NULL; + type = debug_get_real_type (handle, type, NULL); if (type == NULL) return NULL; + switch (type->kind) { default: @@ -2385,9 +2245,7 @@ debug_get_fields (handle, type) /* Get the type of a field. */ debug_type -debug_get_field_type (handle, field) - PTR handle ATTRIBUTE_UNUSED; - debug_field field; +debug_get_field_type (void *handle ATTRIBUTE_UNUSED, debug_field field) { if (field == NULL) return NULL; @@ -2397,9 +2255,7 @@ debug_get_field_type (handle, field) /* Get the name of a field. */ const char * -debug_get_field_name (handle, field) - PTR handle ATTRIBUTE_UNUSED; - debug_field field; +debug_get_field_name (void *handle ATTRIBUTE_UNUSED, debug_field field) { if (field == NULL) return NULL; @@ -2409,9 +2265,7 @@ debug_get_field_name (handle, field) /* Get the bit position of a field. */ bfd_vma -debug_get_field_bitpos (handle, field) - PTR handle ATTRIBUTE_UNUSED; - debug_field field; +debug_get_field_bitpos (void *handle ATTRIBUTE_UNUSED, debug_field field) { if (field == NULL || field->static_member) return (bfd_vma) -1; @@ -2421,9 +2275,7 @@ debug_get_field_bitpos (handle, field) /* Get the bit size of a field. */ bfd_vma -debug_get_field_bitsize (handle, field) - PTR handle ATTRIBUTE_UNUSED; - debug_field field; +debug_get_field_bitsize (void *handle ATTRIBUTE_UNUSED, debug_field field) { if (field == NULL || field->static_member) return (bfd_vma) -1; @@ -2433,9 +2285,7 @@ debug_get_field_bitsize (handle, field) /* Get the visibility of a field. */ enum debug_visibility -debug_get_field_visibility (handle, field) - PTR handle ATTRIBUTE_UNUSED; - debug_field field; +debug_get_field_visibility (void *handle ATTRIBUTE_UNUSED, debug_field field) { if (field == NULL) return DEBUG_VISIBILITY_IGNORE; @@ -2445,9 +2295,7 @@ debug_get_field_visibility (handle, field) /* Get the physical name of a field. */ const char * -debug_get_field_physname (handle, field) - PTR handle ATTRIBUTE_UNUSED; - debug_field field; +debug_get_field_physname (void *handle ATTRIBUTE_UNUSED, debug_field field) { if (field == NULL || ! field->static_member) return NULL; @@ -2457,11 +2305,8 @@ debug_get_field_physname (handle, field) /* Write out the debugging information. This is given a handle to debugging information, and a set of function pointers to call. */ -boolean -debug_write (handle, fns, fhandle) - PTR handle; - const struct debug_write_fns *fns; - PTR fhandle; +bfd_boolean +debug_write (void *handle, const struct debug_write_fns *fns, void *fhandle) { struct debug_handle *info = (struct debug_handle *) handle; struct debug_unit *u; @@ -2484,70 +2329,61 @@ debug_write (handle, fns, fhandle) for (u = info->units; u != NULL; u = u->next) { struct debug_file *f; - boolean first_file; + bfd_boolean first_file; info->current_write_lineno = u->linenos; info->current_write_lineno_index = 0; if (! (*fns->start_compilation_unit) (fhandle, u->files->filename)) - return false; + return FALSE; - first_file = true; + first_file = TRUE; for (f = u->files; f != NULL; f = f->next) { struct debug_name *n; if (first_file) - first_file = false; - else - { - if (! (*fns->start_source) (fhandle, f->filename)) - return false; - } + first_file = FALSE; + else if (! (*fns->start_source) (fhandle, f->filename)) + return FALSE; if (f->globals != NULL) - { - for (n = f->globals->list; n != NULL; n = n->next) - { - if (! debug_write_name (info, fns, fhandle, n)) - return false; - } - } + for (n = f->globals->list; n != NULL; n = n->next) + if (! debug_write_name (info, fns, fhandle, n)) + return FALSE; } /* Output any line number information which hasn't already been handled. */ if (! debug_write_linenos (info, fns, fhandle, (bfd_vma) -1)) - return false; + return FALSE; } - return true; + return TRUE; } /* Write out an element in a namespace. */ -static boolean -debug_write_name (info, fns, fhandle, n) - struct debug_handle *info; - const struct debug_write_fns *fns; - PTR fhandle; - struct debug_name *n; +static bfd_boolean +debug_write_name (struct debug_handle *info, + const struct debug_write_fns *fns, void *fhandle, + struct debug_name *n) { switch (n->kind) { case DEBUG_OBJECT_TYPE: if (! debug_write_type (info, fns, fhandle, n->u.type, n) || ! (*fns->typdef) (fhandle, n->name)) - return false; - return true; + return FALSE; + return TRUE; case DEBUG_OBJECT_TAG: if (! debug_write_type (info, fns, fhandle, n->u.tag, n)) - return false; + return FALSE; return (*fns->tag) (fhandle, n->name); case DEBUG_OBJECT_VARIABLE: if (! debug_write_type (info, fns, fhandle, n->u.variable->type, (struct debug_name *) NULL)) - return false; + return FALSE; return (*fns->variable) (fhandle, n->name, n->u.variable->kind, n->u.variable->val); case DEBUG_OBJECT_FUNCTION: @@ -2560,12 +2396,12 @@ debug_write_name (info, fns, fhandle, n) case DEBUG_OBJECT_TYPED_CONSTANT: if (! debug_write_type (info, fns, fhandle, n->u.typed_constant->type, (struct debug_name *) NULL)) - return false; + return FALSE; return (*fns->typed_constant) (fhandle, n->name, n->u.typed_constant->val); default: abort (); - return false; + return FALSE; } /*NOTREACHED*/ } @@ -2576,13 +2412,10 @@ debug_write_name (info, fns, fhandle, n) then the name argument is a tag from a DEBUG_KIND_TAGGED type which points to this one. */ -static boolean -debug_write_type (info, fns, fhandle, type, name) - struct debug_handle *info; - const struct debug_write_fns *fns; - PTR fhandle; - struct debug_type *type; - struct debug_name *name; +static bfd_boolean +debug_write_type (struct debug_handle *info, + const struct debug_write_fns *fns, void *fhandle, + struct debug_type *type, struct debug_name *name) { unsigned int i; int is; @@ -2604,7 +2437,7 @@ debug_write_type (info, fns, fhandle, type, name) struct debug_type *real; unsigned int id; - real = debug_get_real_type ((PTR) info, type, NULL); + real = debug_get_real_type ((void *) info, type, NULL); if (real == NULL) return (*fns->empty_type) (fhandle); id = 0; @@ -2619,7 +2452,7 @@ debug_write_type (info, fns, fhandle, type, name) if (! debug_set_class_id (info, type->u.knamed->name->name, real)) - return false; + return FALSE; } id = real->u.kclass->id; } @@ -2648,7 +2481,7 @@ debug_write_type (info, fns, fhandle, type, name) { case DEBUG_KIND_ILLEGAL: debug_error (_("debug_write_type: illegal type encountered")); - return false; + return FALSE; case DEBUG_KIND_INDIRECT: if (*type->u.kindirect->slot == DEBUG_TYPE_NULL) return (*fns->empty_type) (fhandle); @@ -2671,7 +2504,7 @@ debug_write_type (info, fns, fhandle, type, name) if (type->u.kclass->id <= info->base_id) { if (! debug_set_class_id (info, tag, type)) - return false; + return FALSE; } if (info->mark == type->u.kclass->mark) @@ -2692,7 +2525,7 @@ debug_write_type (info, fns, fhandle, type, name) : 0), type->kind == DEBUG_KIND_STRUCT, type->size)) - return false; + return FALSE; if (type->u.kclass != NULL && type->u.kclass->fields != NULL) { @@ -2705,7 +2538,7 @@ debug_write_type (info, fns, fhandle, type, name) (struct debug_name *) NULL) || ! (*fns->struct_field) (fhandle, f->name, f->u.f.bitpos, f->u.f.bitsize, f->visibility)) - return false; + return FALSE; } } return (*fns->end_struct_type) (fhandle); @@ -2721,13 +2554,13 @@ debug_write_type (info, fns, fhandle, type, name) case DEBUG_KIND_POINTER: if (! debug_write_type (info, fns, fhandle, type->u.kpointer, (struct debug_name *) NULL)) - return false; + return FALSE; return (*fns->pointer_type) (fhandle); case DEBUG_KIND_FUNCTION: if (! debug_write_type (info, fns, fhandle, type->u.kfunction->return_type, (struct debug_name *) NULL)) - return false; + return FALSE; if (type->u.kfunction->arg_types == NULL) is = -1; else @@ -2736,19 +2569,19 @@ debug_write_type (info, fns, fhandle, type, name) if (! debug_write_type (info, fns, fhandle, type->u.kfunction->arg_types[is], (struct debug_name *) NULL)) - return false; + return FALSE; } return (*fns->function_type) (fhandle, is, type->u.kfunction->varargs); case DEBUG_KIND_REFERENCE: if (! debug_write_type (info, fns, fhandle, type->u.kreference, (struct debug_name *) NULL)) - return false; + return FALSE; return (*fns->reference_type) (fhandle); case DEBUG_KIND_RANGE: if (! debug_write_type (info, fns, fhandle, type->u.krange->type, (struct debug_name *) NULL)) - return false; + return FALSE; return (*fns->range_type) (fhandle, type->u.krange->lower, type->u.krange->upper); case DEBUG_KIND_ARRAY: @@ -2757,14 +2590,14 @@ debug_write_type (info, fns, fhandle, type, name) || ! debug_write_type (info, fns, fhandle, type->u.karray->range_type, (struct debug_name *) NULL)) - return false; + return FALSE; return (*fns->array_type) (fhandle, type->u.karray->lower, type->u.karray->upper, type->u.karray->stringp); case DEBUG_KIND_SET: if (! debug_write_type (info, fns, fhandle, type->u.kset->type, (struct debug_name *) NULL)) - return false; + return FALSE; return (*fns->set_type) (fhandle, type->u.kset->bitstringp); case DEBUG_KIND_OFFSET: if (! debug_write_type (info, fns, fhandle, type->u.koffset->base_type, @@ -2772,13 +2605,13 @@ debug_write_type (info, fns, fhandle, type, name) || ! debug_write_type (info, fns, fhandle, type->u.koffset->target_type, (struct debug_name *) NULL)) - return false; + return FALSE; return (*fns->offset_type) (fhandle); case DEBUG_KIND_METHOD: if (! debug_write_type (info, fns, fhandle, type->u.kmethod->return_type, (struct debug_name *) NULL)) - return false; + return FALSE; if (type->u.kmethod->arg_types == NULL) is = -1; else @@ -2787,14 +2620,14 @@ debug_write_type (info, fns, fhandle, type, name) if (! debug_write_type (info, fns, fhandle, type->u.kmethod->arg_types[is], (struct debug_name *) NULL)) - return false; + return FALSE; } if (type->u.kmethod->domain_type != NULL) { if (! debug_write_type (info, fns, fhandle, type->u.kmethod->domain_type, (struct debug_name *) NULL)) - return false; + return FALSE; } return (*fns->method_type) (fhandle, type->u.kmethod->domain_type != NULL, @@ -2803,12 +2636,12 @@ debug_write_type (info, fns, fhandle, type, name) case DEBUG_KIND_CONST: if (! debug_write_type (info, fns, fhandle, type->u.kconst, (struct debug_name *) NULL)) - return false; + return FALSE; return (*fns->const_type) (fhandle); case DEBUG_KIND_VOLATILE: if (! debug_write_type (info, fns, fhandle, type->u.kvolatile, (struct debug_name *) NULL)) - return false; + return FALSE; return (*fns->volatile_type) (fhandle); case DEBUG_KIND_NAMED: return debug_write_type (info, fns, fhandle, type->u.knamed->type, @@ -2818,19 +2651,16 @@ debug_write_type (info, fns, fhandle, type, name) type->u.knamed->name); default: abort (); - return false; + return FALSE; } } /* Write out a class type. */ -static boolean -debug_write_class_type (info, fns, fhandle, type, tag) - struct debug_handle *info; - const struct debug_write_fns *fns; - PTR fhandle; - struct debug_type *type; - const char *tag; +static bfd_boolean +debug_write_class_type (struct debug_handle *info, + const struct debug_write_fns *fns, void *fhandle, + struct debug_type *type, const char *tag) { unsigned int i; unsigned int id; @@ -2846,7 +2676,7 @@ debug_write_class_type (info, fns, fhandle, type, tag) if (type->u.kclass->id <= info->base_id) { if (! debug_set_class_id (info, tag, type)) - return false; + return FALSE; } if (info->mark == type->u.kclass->mark) @@ -2866,7 +2696,7 @@ debug_write_class_type (info, fns, fhandle, type, tag) { if (! debug_write_type (info, fns, fhandle, vptrbase, (struct debug_name *) NULL)) - return false; + return FALSE; } } @@ -2875,7 +2705,7 @@ debug_write_class_type (info, fns, fhandle, type, tag) type->size, vptrbase != NULL, vptrbase == type)) - return false; + return FALSE; if (type->u.kclass != NULL) { @@ -2888,19 +2718,19 @@ debug_write_class_type (info, fns, fhandle, type, tag) f = type->u.kclass->fields[i]; if (! debug_write_type (info, fns, fhandle, f->type, (struct debug_name *) NULL)) - return false; + return FALSE; if (f->static_member) { if (! (*fns->class_static_member) (fhandle, f->name, f->u.s.physname, f->visibility)) - return false; + return FALSE; } else { if (! (*fns->struct_field) (fhandle, f->name, f->u.f.bitpos, f->u.f.bitsize, f->visibility)) - return false; + return FALSE; } } } @@ -2914,10 +2744,10 @@ debug_write_class_type (info, fns, fhandle, type, tag) b = type->u.kclass->baseclasses[i]; if (! debug_write_type (info, fns, fhandle, b->type, (struct debug_name *) NULL)) - return false; + return FALSE; if (! (*fns->class_baseclass) (fhandle, b->bitpos, b->virtual, b->visibility)) - return false; + return FALSE; } } @@ -2930,7 +2760,7 @@ debug_write_class_type (info, fns, fhandle, type, tag) m = type->u.kclass->methods[i]; if (! (*fns->class_start_method) (fhandle, m->name)) - return false; + return FALSE; for (j = 0; m->variants[j] != NULL; j++) { struct debug_method_variant *v; @@ -2940,11 +2770,11 @@ debug_write_class_type (info, fns, fhandle, type, tag) { if (! debug_write_type (info, fns, fhandle, v->context, (struct debug_name *) NULL)) - return false; + return FALSE; } if (! debug_write_type (info, fns, fhandle, v->type, (struct debug_name *) NULL)) - return false; + return FALSE; if (v->voffset != VOFFSET_STATIC_METHOD) { if (! (*fns->class_method_variant) (fhandle, v->physname, @@ -2953,7 +2783,7 @@ debug_write_class_type (info, fns, fhandle, type, tag) v->volatilep, v->voffset, v->context != NULL)) - return false; + return FALSE; } else { @@ -2962,11 +2792,11 @@ debug_write_class_type (info, fns, fhandle, type, tag) v->visibility, v->constp, v->volatilep)) - return false; + return FALSE; } } if (! (*fns->class_end_method) (fhandle)) - return false; + return FALSE; } } } @@ -2976,41 +2806,38 @@ debug_write_class_type (info, fns, fhandle, type, tag) /* Write out information for a function. */ -static boolean -debug_write_function (info, fns, fhandle, name, linkage, function) - struct debug_handle *info; - const struct debug_write_fns *fns; - PTR fhandle; - const char *name; - enum debug_object_linkage linkage; - struct debug_function *function; +static bfd_boolean +debug_write_function (struct debug_handle *info, + const struct debug_write_fns *fns, void *fhandle, + const char *name, enum debug_object_linkage linkage, + struct debug_function *function) { struct debug_parameter *p; struct debug_block *b; if (! debug_write_linenos (info, fns, fhandle, function->blocks->start)) - return false; + return FALSE; if (! debug_write_type (info, fns, fhandle, function->return_type, (struct debug_name *) NULL)) - return false; + return FALSE; if (! (*fns->start_function) (fhandle, name, linkage == DEBUG_LINKAGE_GLOBAL)) - return false; + return FALSE; for (p = function->parameters; p != NULL; p = p->next) { if (! debug_write_type (info, fns, fhandle, p->type, (struct debug_name *) NULL) || ! (*fns->function_parameter) (fhandle, p->name, p->kind, p->val)) - return false; + return FALSE; } for (b = function->blocks; b != NULL; b = b->next) { if (! debug_write_block (info, fns, fhandle, b)) - return false; + return FALSE; } return (*fns->end_function) (fhandle); @@ -3018,25 +2845,23 @@ debug_write_function (info, fns, fhandle, name, linkage, function) /* Write out information for a block. */ -static boolean -debug_write_block (info, fns, fhandle, block) - struct debug_handle *info; - const struct debug_write_fns *fns; - PTR fhandle; - struct debug_block *block; +static bfd_boolean +debug_write_block (struct debug_handle *info, + const struct debug_write_fns *fns, void *fhandle, + struct debug_block *block) { struct debug_name *n; struct debug_block *b; if (! debug_write_linenos (info, fns, fhandle, block->start)) - return false; + return FALSE; /* I can't see any point to writing out a block with no local variables, so we don't bother, except for the top level block. */ if (block->locals != NULL || block->parent == NULL) { if (! (*fns->start_block) (fhandle, block->start)) - return false; + return FALSE; } if (block->locals != NULL) @@ -3044,36 +2869,34 @@ debug_write_block (info, fns, fhandle, block) for (n = block->locals->list; n != NULL; n = n->next) { if (! debug_write_name (info, fns, fhandle, n)) - return false; + return FALSE; } } for (b = block->children; b != NULL; b = b->next) { if (! debug_write_block (info, fns, fhandle, b)) - return false; + return FALSE; } if (! debug_write_linenos (info, fns, fhandle, block->end)) - return false; + return FALSE; if (block->locals != NULL || block->parent == NULL) { if (! (*fns->end_block) (fhandle, block->end)) - return false; + return FALSE; } - return true; + return TRUE; } /* Write out line number information up to ADDRESS. */ -static boolean -debug_write_linenos (info, fns, fhandle, address) - struct debug_handle *info; - const struct debug_write_fns *fns; - PTR fhandle; - bfd_vma address; +static bfd_boolean +debug_write_linenos (struct debug_handle *info, + const struct debug_write_fns *fns, void *fhandle, + bfd_vma address) { while (info->current_write_lineno != NULL) { @@ -3088,12 +2911,12 @@ debug_write_linenos (info, fns, fhandle, address) break; if (l->addrs[info->current_write_lineno_index] >= address) - return true; + return TRUE; if (! (*fns->lineno) (fhandle, l->file->filename, l->linenos[info->current_write_lineno_index], l->addrs[info->current_write_lineno_index])) - return false; + return FALSE; ++info->current_write_lineno_index; } @@ -3102,7 +2925,7 @@ debug_write_linenos (info, fns, fhandle, address) info->current_write_lineno_index = 0; } - return true; + return TRUE; } /* Get the ID number for a class. If during the same call to @@ -3110,11 +2933,9 @@ debug_write_linenos (info, fns, fhandle, address) name, we use the same ID. This type of things happens because the same struct will be defined by multiple compilation units. */ -static boolean -debug_set_class_id (info, tag, type) - struct debug_handle *info; - const char *tag; - struct debug_type *type; +static bfd_boolean +debug_set_class_id (struct debug_handle *info, const char *tag, + struct debug_type *type) { struct debug_class_type *c; struct debug_class_id *l; @@ -3127,7 +2948,7 @@ debug_set_class_id (info, tag, type) c = type->u.kclass; if (c->id > info->base_id) - return true; + return TRUE; for (l = info->id_list; l != NULL; l = l->next) { @@ -3150,7 +2971,7 @@ debug_set_class_id (info, tag, type) if (debug_type_samep (info, l->type, type)) { c->id = l->type->u.kclass->id; - return true; + return TRUE; } } @@ -3168,42 +2989,40 @@ debug_set_class_id (info, tag, type) l->next = info->id_list; info->id_list = l; - return true; + return TRUE; } /* See if two types are the same. At this point, we don't care about tags and the like. */ -static boolean -debug_type_samep (info, t1, t2) - struct debug_handle *info; - struct debug_type *t1; - struct debug_type *t2; +static bfd_boolean +debug_type_samep (struct debug_handle *info, struct debug_type *t1, + struct debug_type *t2) { struct debug_type_compare_list *l; struct debug_type_compare_list top; - boolean ret; + bfd_boolean ret; if (t1 == NULL) return t2 == NULL; if (t2 == NULL) - return false; + return FALSE; while (t1->kind == DEBUG_KIND_INDIRECT) { t1 = *t1->u.kindirect->slot; if (t1 == NULL) - return false; + return FALSE; } while (t2->kind == DEBUG_KIND_INDIRECT) { t2 = *t2->u.kindirect->slot; if (t2 == NULL) - return false; + return FALSE; } if (t1 == t2) - return true; + return TRUE; /* As a special case, permit a typedef to match a tag, since C++ debugging output will sometimes add a typedef where C debugging @@ -3217,7 +3036,7 @@ debug_type_samep (info, t1, t2) if (t1->kind != t2->kind || t1->size != t2->size) - return false; + return FALSE; /* Get rid of the trivial cases first. */ switch (t1->kind) @@ -3228,7 +3047,7 @@ debug_type_samep (info, t1, t2) case DEBUG_KIND_FLOAT: case DEBUG_KIND_COMPLEX: case DEBUG_KIND_BOOL: - return true; + return TRUE; case DEBUG_KIND_INT: return t1->u.kint == t2->u.kint; } @@ -3240,7 +3059,7 @@ debug_type_samep (info, t1, t2) for (l = info->compare_list; l != NULL; l = l->next) { if (l->t1 == t1 && l->t2 == t2) - return true; + return TRUE; } top.t1 = t1; @@ -3252,7 +3071,7 @@ debug_type_samep (info, t1, t2) { default: abort (); - ret = false; + ret = FALSE; break; case DEBUG_KIND_STRUCT: @@ -3262,10 +3081,10 @@ debug_type_samep (info, t1, t2) if (t1->u.kclass == NULL) ret = t2->u.kclass == NULL; else if (t2->u.kclass == NULL) - ret = false; + ret = FALSE; else if (t1->u.kclass->id > info->base_id && t1->u.kclass->id == t2->u.kclass->id) - ret = true; + ret = TRUE; else ret = debug_class_type_samep (info, t1, t2); break; @@ -3274,7 +3093,7 @@ debug_type_samep (info, t1, t2) if (t1->u.kenum == NULL) ret = t2->u.kenum == NULL; else if (t2->u.kenum == NULL) - ret = false; + ret = FALSE; else { const char **pn1, **pn2; @@ -3309,9 +3128,9 @@ debug_type_samep (info, t1, t2) t2->u.kfunction->return_type) || ((t1->u.kfunction->arg_types == NULL) != (t2->u.kfunction->arg_types == NULL))) - ret = false; + ret = FALSE; else if (t1->u.kfunction->arg_types == NULL) - ret = true; + ret = TRUE; else { struct debug_type **a1, **a2; @@ -3367,9 +3186,9 @@ debug_type_samep (info, t1, t2) t2->u.kmethod->domain_type) || ((t1->u.kmethod->arg_types == NULL) != (t2->u.kmethod->arg_types == NULL))) - ret = false; + ret = FALSE; else if (t1->u.kmethod->arg_types == NULL) - ret = true; + ret = TRUE; else { struct debug_type **a1, **a2; @@ -3411,11 +3230,9 @@ debug_type_samep (info, t1, t2) /* See if two classes are the same. This is a subroutine of debug_type_samep. */ -static boolean -debug_class_type_samep (info, t1, t2) - struct debug_handle *info; - struct debug_type *t1; - struct debug_type *t2; +static bfd_boolean +debug_class_type_samep (struct debug_handle *info, struct debug_type *t1, + struct debug_type *t2) { struct debug_class_type *c1, *c2; @@ -3426,7 +3243,7 @@ debug_class_type_samep (info, t1, t2) || (c1->baseclasses == NULL) != (c2->baseclasses == NULL) || (c1->methods == NULL) != (c2->methods == NULL) || (c1->vptrbase == NULL) != (c2->vptrbase == NULL)) - return false; + return FALSE; if (c1->fields != NULL) { @@ -3443,17 +3260,17 @@ debug_class_type_samep (info, t1, t2) if (f1->name[0] != f2->name[0] || f1->visibility != f2->visibility || f1->static_member != f2->static_member) - return false; + return FALSE; if (f1->static_member) { if (strcmp (f1->u.s.physname, f2->u.s.physname) != 0) - return false; + return FALSE; } else { if (f1->u.f.bitpos != f2->u.f.bitpos || f1->u.f.bitsize != f2->u.f.bitsize) - return false; + return FALSE; } /* We do the checks which require function calls last. We don't require that the types of fields have the same @@ -3461,20 +3278,20 @@ debug_class_type_samep (info, t1, t2) typedefs and we really don't care. */ if (strcmp (f1->name, f2->name) != 0 || ! debug_type_samep (info, - debug_get_real_type ((PTR) info, + debug_get_real_type ((void *) info, f1->type, NULL), - debug_get_real_type ((PTR) info, + debug_get_real_type ((void *) info, f2->type, NULL))) - return false; + return FALSE; } if (*pf1 != NULL || *pf2 != NULL) - return false; + return FALSE; } if (c1->vptrbase != NULL) { if (! debug_type_samep (info, c1->vptrbase, c2->vptrbase)) - return false; + return FALSE; } if (c1->baseclasses != NULL) @@ -3493,10 +3310,10 @@ debug_class_type_samep (info, t1, t2) || b1->virtual != b2->virtual || b1->visibility != b2->visibility || ! debug_type_samep (info, b1->type, b2->type)) - return false; + return FALSE; } if (*pb1 != NULL || *pb2 != NULL) - return false; + return FALSE; } if (c1->methods != NULL) @@ -3514,7 +3331,7 @@ debug_class_type_samep (info, t1, t2) if (m1->name[0] != m2->name[0] || strcmp (m1->name, m2->name) != 0 || (m1->variants == NULL) != (m2->variants == NULL)) - return false; + return FALSE; if (m1->variants == NULL) { struct debug_method_variant **pv1, **pv2; @@ -3535,21 +3352,21 @@ debug_class_type_samep (info, t1, t2) || (v1->context == NULL) != (v2->context == NULL) || strcmp (v1->physname, v2->physname) != 0 || ! debug_type_samep (info, v1->type, v2->type)) - return false; + return FALSE; if (v1->context != NULL) { if (! debug_type_samep (info, v1->context, v2->context)) - return false; + return FALSE; } } if (*pv1 != NULL || *pv2 != NULL) - return false; + return FALSE; } } if (*pm1 != NULL || *pm2 != NULL) - return false; + return FALSE; } - return true; + return TRUE; } diff --git a/contrib/binutils/binutils/debug.h b/contrib/binutils/binutils/debug.h index c439be3..3331e0b 100644 --- a/contrib/binutils/binutils/debug.h +++ b/contrib/binutils/binutils/debug.h @@ -1,5 +1,5 @@ /* debug.h -- Describe generic debugging information. - Copyright 1995, 1996 Free Software Foundation, Inc. + Copyright 1995, 1996, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GNU Binutils. @@ -25,7 +25,7 @@ /* This header file describes a generic debugging information format. We may eventually have readers which convert different formats into this generic format, and writers which write it out. The initial - impetus for this was writing a convertor from stabs to HP IEEE-695 + impetus for this was writing a converter from stabs to HP IEEE-695 debugging format. */ /* Different kinds of types. */ @@ -169,126 +169,126 @@ struct debug_write_fns { /* This is called at the start of each new compilation unit with the name of the main file in the new unit. */ - boolean (*start_compilation_unit) PARAMS ((PTR, const char *)); + bfd_boolean (*start_compilation_unit) (void *, const char *); /* This is called at the start of each source file within a compilation unit, before outputting any global information for that file. The argument is the name of the file. */ - boolean (*start_source) PARAMS ((PTR, const char *)); + bfd_boolean (*start_source) (void *, const char *); /* Each writer must keep a stack of types. */ /* Push an empty type onto the type stack. This type can appear if there is a reference to a type which is never defined. */ - boolean (*empty_type) PARAMS ((PTR)); + bfd_boolean (*empty_type) (void *); /* Push a void type onto the type stack. */ - boolean (*void_type) PARAMS ((PTR)); + bfd_boolean (*void_type) (void *); /* Push an integer type onto the type stack, given the size and whether it is unsigned. */ - boolean (*int_type) PARAMS ((PTR, unsigned int, boolean)); + bfd_boolean (*int_type) (void *, unsigned int, bfd_boolean); /* Push a floating type onto the type stack, given the size. */ - boolean (*float_type) PARAMS ((PTR, unsigned int)); + bfd_boolean (*float_type) (void *, unsigned int); /* Push a complex type onto the type stack, given the size. */ - boolean (*complex_type) PARAMS ((PTR, unsigned int)); + bfd_boolean (*complex_type) (void *, unsigned int); - /* Push a boolean type onto the type stack, given the size. */ - boolean (*bool_type) PARAMS ((PTR, unsigned int)); + /* Push a bfd_boolean type onto the type stack, given the size. */ + bfd_boolean (*bool_type) (void *, unsigned int); /* Push an enum type onto the type stack, given the tag, a NULL terminated array of names and the associated values. If there is no tag, the tag argument will be NULL. If this is an undefined enum, the names and values arguments will be NULL. */ - boolean (*enum_type) PARAMS ((PTR, const char *, const char **, - bfd_signed_vma *)); + bfd_boolean (*enum_type) + (void *, const char *, const char **, bfd_signed_vma *); /* Pop the top type on the type stack, and push a pointer to that type onto the type stack. */ - boolean (*pointer_type) PARAMS ((PTR)); + bfd_boolean (*pointer_type) (void *); /* Push a function type onto the type stack. The second argument indicates the number of argument types that have been pushed onto the stack. If the number of argument types is passed as -1, then the argument types of the function are unknown, and no types have - been pushed onto the stack. The third argument is true if the + been pushed onto the stack. The third argument is TRUE if the function takes a variable number of arguments. The return type of the function is pushed onto the type stack below the argument types, if any. */ - boolean (*function_type) PARAMS ((PTR, int, boolean)); + bfd_boolean (*function_type) (void *, int, bfd_boolean); /* Pop the top type on the type stack, and push a reference to that type onto the type stack. */ - boolean (*reference_type) PARAMS ((PTR)); + bfd_boolean (*reference_type) (void *); /* Pop the top type on the type stack, and push a range of that type with the given lower and upper bounds onto the type stack. */ - boolean (*range_type) PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma)); + bfd_boolean (*range_type) (void *, bfd_signed_vma, bfd_signed_vma); /* Push an array type onto the type stack. The top type on the type stack is the range, and the next type on the type stack is the element type. These should be popped before the array type is pushed. The arguments are the lower bound, the upper bound, and whether the array is a string. */ - boolean (*array_type) PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma, - boolean)); + bfd_boolean (*array_type) + (void *, bfd_signed_vma, bfd_signed_vma, bfd_boolean); /* Pop the top type on the type stack, and push a set of that type onto the type stack. The argument indicates whether this set is a bitstring. */ - boolean (*set_type) PARAMS ((PTR, boolean)); + bfd_boolean (*set_type) (void *, bfd_boolean); /* Push an offset type onto the type stack. The top type on the type stack is the target type, and the next type on the type stack is the base type. These should be popped before the offset type is pushed. */ - boolean (*offset_type) PARAMS ((PTR)); + bfd_boolean (*offset_type) (void *); /* Push a method type onto the type stack. If the second argument - is true, the top type on the stack is the class to which the + is TRUE, the top type on the stack is the class to which the method belongs; otherwise, the class must be determined by the class to which the method is attached. The third argument is the number of argument types; these are pushed onto the type stack in reverse order (the first type popped is the last argument to the method). A value of -1 for the third argument means that no - argument information is available. The fourth argument is true + argument information is available. The fourth argument is TRUE if the function takes a variable number of arguments. The next type on the type stack below the domain and the argument types is the return type of the method. All these types must be popped, and then the method type must be pushed. */ - boolean (*method_type) PARAMS ((PTR, boolean, int, boolean)); + bfd_boolean (*method_type) (void *, bfd_boolean, int, bfd_boolean); /* Pop the top type off the type stack, and push a const qualified version of that type onto the type stack. */ - boolean (*const_type) PARAMS ((PTR)); + bfd_boolean (*const_type) (void *); /* Pop the top type off the type stack, and push a volatile qualified version of that type onto the type stack. */ - boolean (*volatile_type) PARAMS ((PTR)); + bfd_boolean (*volatile_type) (void *); /* Start building a struct. This is followed by calls to the struct_field function, and finished by a call to the end_struct_type function. The second argument is the tag; this will be NULL if there isn't one. If the second argument is NULL, the third argument is a constant identifying this struct for use - with tag_type. The fourth argument is true for a struct, false + with tag_type. The fourth argument is TRUE for a struct, FALSE for a union. The fifth argument is the size. If this is an undefined struct or union, the size will be 0 and struct_field will not be called before end_struct_type is called. */ - boolean (*start_struct_type) PARAMS ((PTR, const char *, unsigned int, - boolean, unsigned int)); + bfd_boolean (*start_struct_type) + (void *, const char *, unsigned int, bfd_boolean, unsigned int); /* Add a field to the struct type currently being built. The type of the field should be popped off the type stack. The arguments are the name, the bit position, the bit size (may be zero if the field is not packed), and the visibility. */ - boolean (*struct_field) PARAMS ((PTR, const char *, bfd_vma, bfd_vma, - enum debug_visibility)); + bfd_boolean (*struct_field) + (void *, const char *, bfd_vma, bfd_vma, enum debug_visibility); /* Finish building a struct, and push it onto the type stack. */ - boolean (*end_struct_type) PARAMS ((PTR)); + bfd_boolean (*end_struct_type) (void *); /* Start building a class. This is followed by calls to several functions: struct_field, class_static_member, class_baseclass, @@ -296,27 +296,27 @@ struct debug_write_fns class_static_method_variant, and class_end_method. The class is finished by a call to end_class_type. The first five arguments are the same as for start_struct_type. The sixth argument is - true if there is a virtual function table; if there is, the - seventh argument is true if the virtual function table can be - found in the type itself, and is false if the type of the object + TRUE if there is a virtual function table; if there is, the + seventh argument is TRUE if the virtual function table can be + found in the type itself, and is FALSE if the type of the object holding the virtual function table should be popped from the type stack. */ - boolean (*start_class_type) PARAMS ((PTR, const char *, unsigned int, - boolean, unsigned int, boolean, - boolean)); + bfd_boolean (*start_class_type) + (void *, const char *, unsigned int, bfd_boolean, unsigned int, + bfd_boolean, bfd_boolean); /* Add a static member to the class currently being built. The arguments are the field name, the physical name, and the visibility. The type must be popped off the type stack. */ - boolean (*class_static_member) PARAMS ((PTR, const char *, const char *, - enum debug_visibility)); + bfd_boolean (*class_static_member) + (void *, const char *, const char *, enum debug_visibility); /* Add a baseclass to the class currently being built. The type of the baseclass must be popped off the type stack. The arguments are the bit position, whether the class is virtual, and the visibility. */ - boolean (*class_baseclass) PARAMS ((PTR, bfd_vma, boolean, - enum debug_visibility)); + bfd_boolean (*class_baseclass) + (void *, bfd_vma, bfd_boolean, enum debug_visibility); /* Start adding a method to the class currently being built. This is followed by calls to class_method_variant and @@ -324,7 +324,7 @@ struct debug_write_fns method which take different arguments. The method is finished with a call to class_end_method. The argument is the method name. */ - boolean (*class_start_method) PARAMS ((PTR, const char *)); + bfd_boolean (*class_start_method) (void *, const char *); /* Describe a variant to the class method currently being built. The type of the variant must be popped off the type stack. The @@ -333,28 +333,27 @@ struct debug_write_fns const, whether the variant is volatile, the offset in the virtual function table, and whether the context is on the type stack (below the variant type). */ - boolean (*class_method_variant) PARAMS ((PTR, const char *, - enum debug_visibility, - boolean, boolean, - bfd_vma, boolean)); + bfd_boolean (*class_method_variant) + (void *, const char *, enum debug_visibility, bfd_boolean, + bfd_boolean, bfd_vma, bfd_boolean); /* Describe a static variant to the class method currently being built. The arguments are the same as for class_method_variant, except that the last two arguments are omitted. The type of the variant must be popped off the type stack. */ - boolean (*class_static_method_variant) PARAMS ((PTR, const char *, - enum debug_visibility, - boolean, boolean)); + bfd_boolean (*class_static_method_variant) + (void *, const char *, enum debug_visibility, bfd_boolean, + bfd_boolean); /* Finish describing a class method. */ - boolean (*class_end_method) PARAMS ((PTR)); + bfd_boolean (*class_end_method) (void *); /* Finish describing a class, and push it onto the type stack. */ - boolean (*end_class_type) PARAMS ((PTR)); + bfd_boolean (*end_class_type) (void *); /* Push a type on the stack which was given a name by an earlier call to typdef. */ - boolean (*typedef_type) PARAMS ((PTR, const char *)); + bfd_boolean (*typedef_type) (void *, const char *); /* Push a tagged type on the stack which was defined earlier. If the second argument is not NULL, the type was defined by a call @@ -365,58 +364,58 @@ struct debug_write_fns for a struct (class) being defined, in between the call to start_struct_type (start_class_type) and the call to end_struct_type (end_class_type). */ - boolean (*tag_type) PARAMS ((PTR, const char *, unsigned int, - enum debug_type_kind)); + bfd_boolean (*tag_type) + (void *, const char *, unsigned int, enum debug_type_kind); /* Pop the type stack, and typedef it to the given name. */ - boolean (*typdef) PARAMS ((PTR, const char *)); + bfd_boolean (*typdef) (void *, const char *); /* Pop the type stack, and declare it as a tagged struct or union or enum or whatever. The tag passed down here is redundant, since was also passed when enum_type, start_struct_type, or start_class_type was called. */ - boolean (*tag) PARAMS ((PTR, const char *)); + bfd_boolean (*tag) (void *, const char *); /* This is called to record a named integer constant. */ - boolean (*int_constant) PARAMS ((PTR, const char *, bfd_vma)); + bfd_boolean (*int_constant) (void *, const char *, bfd_vma); /* This is called to record a named floating point constant. */ - boolean (*float_constant) PARAMS ((PTR, const char *, double)); + bfd_boolean (*float_constant) (void *, const char *, double); /* This is called to record a typed integer constant. The type is popped off the type stack. */ - boolean (*typed_constant) PARAMS ((PTR, const char *, bfd_vma)); + bfd_boolean (*typed_constant) (void *, const char *, bfd_vma); /* This is called to record a variable. The type is popped off the type stack. */ - boolean (*variable) PARAMS ((PTR, const char *, enum debug_var_kind, - bfd_vma)); + bfd_boolean (*variable) + (void *, const char *, enum debug_var_kind, bfd_vma); /* Start writing out a function. The return type must be popped off - the stack. The boolean is true if the function is global. This + the stack. The bfd_boolean is TRUE if the function is global. This is followed by calls to function_parameter, followed by block information. */ - boolean (*start_function) PARAMS ((PTR, const char *, boolean)); + bfd_boolean (*start_function) (void *, const char *, bfd_boolean); /* Record a function parameter for the current function. The type must be popped off the stack. */ - boolean (*function_parameter) PARAMS ((PTR, const char *, - enum debug_parm_kind, bfd_vma)); + bfd_boolean (*function_parameter) + (void *, const char *, enum debug_parm_kind, bfd_vma); /* Start writing out a block. There is at least one top level block per function. Blocks may be nested. The argument is the starting address of the block. */ - boolean (*start_block) PARAMS ((PTR, bfd_vma)); + bfd_boolean (*start_block) (void *, bfd_vma); /* Finish writing out a block. The argument is the ending address of the block. */ - boolean (*end_block) PARAMS ((PTR, bfd_vma)); + bfd_boolean (*end_block) (void *, bfd_vma); /* Finish writing out a function. */ - boolean (*end_function) PARAMS ((PTR)); + bfd_boolean (*end_function) (void *); /* Record line number information for the current compilation unit. */ - boolean (*lineno) PARAMS ((PTR, const char *, unsigned long, bfd_vma)); + bfd_boolean (*lineno) (void *, const char *, unsigned long, bfd_vma); }; /* Exported functions. */ @@ -429,87 +428,87 @@ struct debug_write_fns /* Return a debugging handle. */ -extern PTR debug_init PARAMS ((void)); +extern void *debug_init (void); /* Set the source filename. This implicitly starts a new compilation unit. */ -extern boolean debug_set_filename PARAMS ((PTR, const char *)); +extern bfd_boolean debug_set_filename (void *, const char *); /* Change source files to the given file name. This is used for include files in a single compilation unit. */ -extern boolean debug_start_source PARAMS ((PTR, const char *)); +extern bfd_boolean debug_start_source (void *, const char *); /* Record a function definition. This implicitly starts a function block. The debug_type argument is the type of the return value. - The boolean indicates whether the function is globally visible. + The bfd_boolean indicates whether the function is globally visible. The bfd_vma is the address of the start of the function. Currently the parameter types are specified by calls to debug_record_parameter. */ -extern boolean debug_record_function - PARAMS ((PTR, const char *, debug_type, boolean, bfd_vma)); +extern bfd_boolean debug_record_function + (void *, const char *, debug_type, bfd_boolean, bfd_vma); /* Record a parameter for the current function. */ -extern boolean debug_record_parameter - PARAMS ((PTR, const char *, debug_type, enum debug_parm_kind, bfd_vma)); +extern bfd_boolean debug_record_parameter + (void *, const char *, debug_type, enum debug_parm_kind, bfd_vma); /* End a function definition. The argument is the address where the function ends. */ -extern boolean debug_end_function PARAMS ((PTR, bfd_vma)); +extern bfd_boolean debug_end_function (void *, bfd_vma); /* Start a block in a function. All local information will be recorded in this block, until the matching call to debug_end_block. debug_start_block and debug_end_block may be nested. The argument is the address at which this block starts. */ -extern boolean debug_start_block PARAMS ((PTR, bfd_vma)); +extern bfd_boolean debug_start_block (void *, bfd_vma); /* Finish a block in a function. This matches the call to debug_start_block. The argument is the address at which this block ends. */ -extern boolean debug_end_block PARAMS ((PTR, bfd_vma)); +extern bfd_boolean debug_end_block (void *, bfd_vma); /* Associate a line number in the current source file with a given address. */ -extern boolean debug_record_line PARAMS ((PTR, unsigned long, bfd_vma)); +extern bfd_boolean debug_record_line (void *, unsigned long, bfd_vma); /* Start a named common block. This is a block of variables that may move in memory. */ -extern boolean debug_start_common_block PARAMS ((PTR, const char *)); +extern bfd_boolean debug_start_common_block (void *, const char *); /* End a named common block. */ -extern boolean debug_end_common_block PARAMS ((PTR, const char *)); +extern bfd_boolean debug_end_common_block (void *, const char *); /* Record a named integer constant. */ -extern boolean debug_record_int_const PARAMS ((PTR, const char *, bfd_vma)); +extern bfd_boolean debug_record_int_const (void *, const char *, bfd_vma); /* Record a named floating point constant. */ -extern boolean debug_record_float_const PARAMS ((PTR, const char *, double)); +extern bfd_boolean debug_record_float_const (void *, const char *, double); /* Record a typed constant with an integral value. */ -extern boolean debug_record_typed_const - PARAMS ((PTR, const char *, debug_type, bfd_vma)); +extern bfd_boolean debug_record_typed_const + (void *, const char *, debug_type, bfd_vma); /* Record a label. */ -extern boolean debug_record_label - PARAMS ((PTR, const char *, debug_type, bfd_vma)); +extern bfd_boolean debug_record_label + (void *, const char *, debug_type, bfd_vma); /* Record a variable. */ -extern boolean debug_record_variable - PARAMS ((PTR, const char *, debug_type, enum debug_var_kind, bfd_vma)); +extern bfd_boolean debug_record_variable + (void *, const char *, debug_type, enum debug_var_kind, bfd_vma); /* Make an indirect type. The first argument is a pointer to the location where the real type will be placed. The second argument @@ -519,107 +518,105 @@ extern boolean debug_record_variable referenced before it is defined. */ extern debug_type debug_make_indirect_type - PARAMS ((PTR, debug_type *, const char *)); + (void *, debug_type *, const char *); /* Make a void type. */ -extern debug_type debug_make_void_type PARAMS ((PTR)); +extern debug_type debug_make_void_type (void *); -/* Make an integer type of a given size. The boolean argument is true +/* Make an integer type of a given size. The bfd_boolean argument is TRUE if the integer is unsigned. */ -extern debug_type debug_make_int_type PARAMS ((PTR, unsigned int, boolean)); +extern debug_type debug_make_int_type (void *, unsigned int, bfd_boolean); /* Make a floating point type of a given size. FIXME: On some platforms, like an Alpha, you probably need to be able to specify the format. */ -extern debug_type debug_make_float_type PARAMS ((PTR, unsigned int)); +extern debug_type debug_make_float_type (void *, unsigned int); /* Make a boolean type of a given size. */ -extern debug_type debug_make_bool_type PARAMS ((PTR, unsigned int)); +extern debug_type debug_make_bool_type (void *, unsigned int); /* Make a complex type of a given size. */ -extern debug_type debug_make_complex_type PARAMS ((PTR, unsigned int)); +extern debug_type debug_make_complex_type (void *, unsigned int); -/* Make a structure type. The second argument is true for a struct, - false for a union. The third argument is the size of the struct. +/* Make a structure type. The second argument is TRUE for a struct, + FALSE for a union. The third argument is the size of the struct. The fourth argument is a NULL terminated array of fields. */ extern debug_type debug_make_struct_type - PARAMS ((PTR, boolean, bfd_vma, debug_field *)); + (void *, bfd_boolean, bfd_vma, debug_field *); /* Make an object type. The first three arguments after the handle are the same as for debug_make_struct_type. The next arguments are a NULL terminated array of base classes, a NULL terminated array of methods, the type of the object holding the virtual function table - if it is not this object, and a boolean which is true if this + if it is not this object, and a bfd_boolean which is TRUE if this object has its own virtual function table. */ extern debug_type debug_make_object_type - PARAMS ((PTR, boolean, bfd_vma, debug_field *, debug_baseclass *, - debug_method *, debug_type, boolean)); + (void *, bfd_boolean, bfd_vma, debug_field *, debug_baseclass *, + debug_method *, debug_type, bfd_boolean); /* Make an enumeration type. The arguments are a null terminated array of strings, and an array of corresponding values. */ extern debug_type debug_make_enum_type - PARAMS ((PTR, const char **, bfd_signed_vma *)); + (void *, const char **, bfd_signed_vma *); /* Make a pointer to a given type. */ -extern debug_type debug_make_pointer_type - PARAMS ((PTR, debug_type)); +extern debug_type debug_make_pointer_type (void *, debug_type); /* Make a function type. The second argument is the return type. The third argument is a NULL terminated array of argument types. The - fourth argument is true if the function takes a variable number of + fourth argument is TRUE if the function takes a variable number of arguments. If the third argument is NULL, then the argument types are unknown. */ extern debug_type debug_make_function_type - PARAMS ((PTR, debug_type, debug_type *, boolean)); + (void *, debug_type, debug_type *, bfd_boolean); /* Make a reference to a given type. */ -extern debug_type debug_make_reference_type PARAMS ((PTR, debug_type)); +extern debug_type debug_make_reference_type (void *, debug_type); /* Make a range of a given type from a lower to an upper bound. */ extern debug_type debug_make_range_type - PARAMS ((PTR, debug_type, bfd_signed_vma, bfd_signed_vma)); + (void *, debug_type, bfd_signed_vma, bfd_signed_vma); /* Make an array type. The second argument is the type of an element of the array. The third argument is the type of a range of the array. The fourth and fifth argument are the lower and upper bounds, respectively (if the bounds are not known, lower should be - 0 and upper should be -1). The sixth argument is true if this + 0 and upper should be -1). The sixth argument is TRUE if this array is actually a string, as in C. */ extern debug_type debug_make_array_type - PARAMS ((PTR, debug_type, debug_type, bfd_signed_vma, bfd_signed_vma, - boolean)); + (void *, debug_type, debug_type, bfd_signed_vma, bfd_signed_vma, + bfd_boolean); /* Make a set of a given type. For example, a Pascal set type. The - boolean argument is true if this set is actually a bitstring, as in + bfd_boolean argument is TRUE if this set is actually a bitstring, as in CHILL. */ -extern debug_type debug_make_set_type PARAMS ((PTR, debug_type, boolean)); +extern debug_type debug_make_set_type (void *, debug_type, bfd_boolean); /* Make a type for a pointer which is relative to an object. The second argument is the type of the object to which the pointer is relative. The third argument is the type that the pointer points to. */ -extern debug_type debug_make_offset_type - PARAMS ((PTR, debug_type, debug_type)); +extern debug_type debug_make_offset_type (void *, debug_type, debug_type); /* Make a type for a method function. The second argument is the return type. The third argument is the domain. The fourth argument is a NULL terminated array of argument types. The fifth - argument is true if the function takes a variable number of + argument is TRUE if the function takes a variable number of arguments, in which case the array of argument types indicates the types of the first arguments. The domain and the argument array may be NULL, in which case this is a stub method and that @@ -627,21 +624,21 @@ extern debug_type debug_make_offset_type the argument types from the mangled name. */ extern debug_type debug_make_method_type - PARAMS ((PTR, debug_type, debug_type, debug_type *, boolean)); + (void *, debug_type, debug_type, debug_type *, bfd_boolean); /* Make a const qualified version of a given type. */ -extern debug_type debug_make_const_type PARAMS ((PTR, debug_type)); +extern debug_type debug_make_const_type (void *, debug_type); /* Make a volatile qualified version of a given type. */ -extern debug_type debug_make_volatile_type PARAMS ((PTR, debug_type)); +extern debug_type debug_make_volatile_type (void *, debug_type); /* Make an undefined tagged type. For example, a struct which has been mentioned, but not defined. */ extern debug_type debug_make_undefined_tagged_type - PARAMS ((PTR, const char *, enum debug_type_kind)); + (void *, const char *, enum debug_type_kind); /* Make a base class for an object. The second argument is the base class type. The third argument is the bit position of this base @@ -650,7 +647,7 @@ extern debug_type debug_make_undefined_tagged_type class. */ extern debug_baseclass debug_make_baseclass - PARAMS ((PTR, debug_type, bfd_vma, boolean, enum debug_visibility)); + (void *, debug_type, bfd_vma, bfd_boolean, enum debug_visibility); /* Make a field for a struct. The second argument is the name. The third argument is the type of the field. The fourth argument is @@ -659,8 +656,7 @@ extern debug_baseclass debug_make_baseclass of the field. */ extern debug_field debug_make_field - PARAMS ((PTR, const char *, debug_type, bfd_vma, bfd_vma, - enum debug_visibility)); + (void *, const char *, debug_type, bfd_vma, bfd_vma, enum debug_visibility); /* Make a static member of an object. The second argument is the name. The third argument is the type of the member. The fourth @@ -669,8 +665,7 @@ extern debug_field debug_make_field member. */ extern debug_field debug_make_static_member - PARAMS ((PTR, const char *, debug_type, const char *, - enum debug_visibility)); + (void *, const char *, debug_type, const char *, enum debug_visibility); /* Make a method. The second argument is the name, and the third argument is a NULL terminated array of method variants. Each @@ -678,7 +673,7 @@ extern debug_field debug_make_static_member argument types. */ extern debug_method debug_make_method - PARAMS ((PTR, const char *, debug_method_variant *)); + (void *, const char *, debug_method_variant *); /* Make a method variant. The second argument is the physical name of the function. The third argument is the type of the function, @@ -690,109 +685,108 @@ extern debug_method debug_make_method function context. */ extern debug_method_variant debug_make_method_variant - PARAMS ((PTR, const char *, debug_type, enum debug_visibility, boolean, - boolean, bfd_vma, debug_type)); + (void *, const char *, debug_type, enum debug_visibility, bfd_boolean, + bfd_boolean, bfd_vma, debug_type); /* Make a static method argument. The arguments are the same as for debug_make_method_variant, except that the last two are omitted since a static method can not also be virtual. */ extern debug_method_variant debug_make_static_method_variant - PARAMS ((PTR, const char *, debug_type, enum debug_visibility, boolean, - boolean)); + (void *, const char *, debug_type, enum debug_visibility, bfd_boolean, + bfd_boolean); /* Name a type. This returns a new type with an attached name. */ -extern debug_type debug_name_type PARAMS ((PTR, const char *, debug_type)); +extern debug_type debug_name_type (void *, const char *, debug_type); /* Give a tag to a type, such as a struct or union. This returns a new type with an attached tag. */ -extern debug_type debug_tag_type PARAMS ((PTR, const char *, debug_type)); +extern debug_type debug_tag_type (void *, const char *, debug_type); /* Record the size of a given type. */ -extern boolean debug_record_type_size PARAMS ((PTR, debug_type, unsigned int)); +extern bfd_boolean debug_record_type_size (void *, debug_type, unsigned int); /* Find a named type. */ -extern debug_type debug_find_named_type PARAMS ((PTR, const char *)); +extern debug_type debug_find_named_type (void *, const char *); /* Find a tagged type. */ extern debug_type debug_find_tagged_type - PARAMS ((PTR, const char *, enum debug_type_kind)); + (void *, const char *, enum debug_type_kind); /* Get the kind of a type. */ -extern enum debug_type_kind debug_get_type_kind PARAMS ((PTR, debug_type)); +extern enum debug_type_kind debug_get_type_kind (void *, debug_type); /* Get the name of a type. */ -extern const char *debug_get_type_name PARAMS ((PTR, debug_type)); +extern const char *debug_get_type_name (void *, debug_type); /* Get the size of a type. */ -extern bfd_vma debug_get_type_size PARAMS ((PTR, debug_type)); +extern bfd_vma debug_get_type_size (void *, debug_type); /* Get the return type of a function or method type. */ -extern debug_type debug_get_return_type PARAMS ((PTR, debug_type)); +extern debug_type debug_get_return_type (void *, debug_type); /* Get the NULL terminated array of parameter types for a function or method type (actually, parameter types are not currently stored for function types). This may be used to determine whether a method type is a stub method or not. The last argument points to a - boolean which is set to true if the function takes a variable + bfd_boolean which is set to TRUE if the function takes a variable number of arguments. */ -extern const debug_type *debug_get_parameter_types PARAMS ((PTR, - debug_type, - boolean *)); +extern const debug_type *debug_get_parameter_types + (void *, debug_type, bfd_boolean *); /* Get the target type of a pointer or reference or const or volatile type. */ -extern debug_type debug_get_target_type PARAMS ((PTR, debug_type)); +extern debug_type debug_get_target_type (void *, debug_type); /* Get the NULL terminated array of fields for a struct, union, or class. */ -extern const debug_field *debug_get_fields PARAMS ((PTR, debug_type)); +extern const debug_field *debug_get_fields (void *, debug_type); /* Get the type of a field. */ -extern debug_type debug_get_field_type PARAMS ((PTR, debug_field)); +extern debug_type debug_get_field_type (void *, debug_field); /* Get the name of a field. */ -extern const char *debug_get_field_name PARAMS ((PTR, debug_field)); +extern const char *debug_get_field_name (void *, debug_field); /* Get the bit position of a field within the containing structure. If the field is a static member, this will return (bfd_vma) -1. */ -extern bfd_vma debug_get_field_bitpos PARAMS ((PTR, debug_field)); +extern bfd_vma debug_get_field_bitpos (void *, debug_field); /* Get the bit size of a field. If the field is a static member, this will return (bfd_vma) -1. */ -extern bfd_vma debug_get_field_bitsize PARAMS ((PTR, debug_field)); +extern bfd_vma debug_get_field_bitsize (void *, debug_field); /* Get the visibility of a field. */ -extern enum debug_visibility debug_get_field_visibility - PARAMS ((PTR, debug_field)); +extern enum debug_visibility debug_get_field_visibility (void *, debug_field); /* Get the physical name of a field, if it is a static member. If the field is not a static member, this will return NULL. */ -extern const char *debug_get_field_physname PARAMS ((PTR, debug_field)); +extern const char *debug_get_field_physname (void *, debug_field); /* Write out the recorded debugging information. This takes a set of function pointers which are called to do the actual writing. The - first PTR is the debugging handle. The second PTR is a handle + first void * is the debugging handle. The second void * is a handle which is passed to the functions. */ -extern boolean debug_write PARAMS ((PTR, const struct debug_write_fns *, PTR)); +extern bfd_boolean debug_write + (void *, const struct debug_write_fns *, void *); #endif /* DEBUG_H */ diff --git a/contrib/binutils/binutils/deflex.l b/contrib/binutils/binutils/deflex.l index 8ff72b8..bdf15d3 100644 --- a/contrib/binutils/binutils/deflex.l +++ b/contrib/binutils/binutils/deflex.l @@ -1,28 +1,27 @@ %{/* deflex.l - Lexer for .def files */ -/* Copyright 1995, 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright 1995, 1997, 1998, 1999, 2002, 2003, 2004 + Free Software Foundation, Inc. -This file is part of GNU Binutils. + This file is part of GNU Binutils. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Contributed by Steve Chamberlain - sac@cygnus.com +/* Contributed by Steve Chamberlain: sac@cygnus.com */ -*/ #define DONTDECLARE_MALLOC #include "libiberty.h" #include "defparse.h" @@ -46,6 +45,7 @@ int linenumber; "BASE" { return BASE;} "CONSTANT" { return CONSTANT; } "NONAME" { return NONAME; } +"PRIVATE" { return PRIVATE; } "READ" { return READ;} "WRITE" { return WRITE;} "EXECUTE" { return EXECUTE;} @@ -61,7 +61,7 @@ int linenumber; [0-9][x0-9A-Fa-f]* { yylval.number = strtol (yytext,0,0); return NUMBER; } -[A-Za-z$:\-\_?][A-Za-z0-9/$:\-\_@?]* { +(@)?[A-Za-z$:\-\_?][A-Za-z0-9/$:\-\_@?]* { yylval.id = xstrdup (yytext); return ID; } @@ -89,5 +89,5 @@ int linenumber; %% #ifndef yywrap /* Needed for lex, though not flex. */ -int yywrap() { return 1; } +int yywrap(void) { return 1; } #endif diff --git a/contrib/binutils/binutils/dep-in.sed b/contrib/binutils/binutils/dep-in.sed index 0981dfc..aeb22a1 100644 --- a/contrib/binutils/binutils/dep-in.sed +++ b/contrib/binutils/binutils/dep-in.sed @@ -8,6 +8,7 @@ s!@BFDDIR@!$(BFDDIR)!g s!@TOPDIR@/bfd!$(BFDDIR)!g s!@SRCDIR@/!!g s!@OBJDIR@/!!g +s! \.\./intl/libintl\.h!!g s/\\\n */ /g diff --git a/contrib/binutils/binutils/dlltool.c b/contrib/binutils/binutils/dlltool.c index 9a1afbc..5f921ae 100644 --- a/contrib/binutils/binutils/dlltool.c +++ b/contrib/binutils/binutils/dlltool.c @@ -1,5 +1,5 @@ /* dlltool.c -- tool to generate stuff for PE style DLLs - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -20,8 +20,7 @@ 02111-1307, USA. */ -/* - This program allows you to build the files necessary to create +/* This program allows you to build the files necessary to create DLLs to run on a system which understands PE format image files. (eg, Windows NT) @@ -50,7 +49,7 @@ EXPORTS ( ( ( [ = ] ) | ( = . )) - [ @ ] [ NONAME ] [CONSTANT] [DATA] ) * + [ @ ] [ NONAME ] [CONSTANT] [DATA] [PRIVATE] ) * Declares name1 as an exported symbol from the DLL, with optional ordinal number . Or declares name1 as an alias (forward) of the function @@ -61,7 +60,7 @@ Declares that or the exported function whoes ordinal number is is to be imported from the file . If is specified then this is the name that the imported - function will be refered to in the body of the DLL. + function will be refereed to in the body of the DLL. DESCRIPTION Puts into output .exp file in the .rdata section @@ -195,8 +194,7 @@ # Build the dll with file1.o, file2.o and the export table - ld -o thedll.dll thedll.exp file1.o file2.o - */ + ld -o thedll.dll thedll.exp file1.o file2.o */ /* .idata section description @@ -232,8 +230,7 @@ = Array of { short, asciz } entries, one for each imported function. The `short' is the function's ordinal number. - .idata$7 = dll name (eg: "kernel32.dll"). (.idata$6 for ppc) -*/ + .idata$7 = dll name (eg: "kernel32.dll"). (.idata$6 for ppc). */ /* AIX requires this to be the first thing in the file. */ #ifndef __GNUC__ @@ -270,8 +267,8 @@ #endif /* Forward references. */ -static char *look_for_prog PARAMS ((const char *, const char *, int)); -static char *deduce_name PARAMS ((const char *)); +static char *look_for_prog (const char *, const char *, int); +static char *deduce_name (const char *); #ifdef DLLTOOL_MCORE_ELF static void mcore_elf_cache_filename (char *); @@ -283,10 +280,10 @@ static void mcore_elf_gen_out_file (void); #else /* ! HAVE_SYS_WAIT_H */ #if ! defined (_WIN32) || defined (__CYGWIN32__) #ifndef WIFEXITED -#define WIFEXITED(w) (((w)&0377) == 0) +#define WIFEXITED(w) (((w) & 0377) == 0) #endif #ifndef WIFSIGNALED -#define WIFSIGNALED(w) (((w)&0377) != 0177 && ((w)&~0377) == 0) +#define WIFSIGNALED(w) (((w) & 0377) != 0177 && ((w) & ~0377) == 0) #endif #ifndef WTERMSIG #define WTERMSIG(w) ((w) & 0177) @@ -327,18 +324,18 @@ static void mcore_elf_gen_out_file (void); typedef struct ifunct { - char *name; /* name of function being imported */ - int ord; /* two-byte ordinal value associated with function */ + char * name; /* Name of function being imported. */ + int ord; /* Two-byte ordinal value associated with function. */ struct ifunct *next; } ifunctype; typedef struct iheadt { - char *dllname; /* name of dll file imported from */ - long nfuncs; /* number of functions in list */ - struct ifunct *funchead; /* first function in list */ - struct ifunct *functail; /* last function in list */ - struct iheadt *next; /* next dll file in list */ + char *dllname; /* Name of dll file imported from. */ + long nfuncs; /* Number of functions in list. */ + struct ifunct *funchead; /* First function in list. */ + struct ifunct *functail; /* Last function in list. */ + struct iheadt *next; /* Next dll file in list. */ } iheadtype; /* Structure containing all import information as defined in .def file @@ -349,6 +346,8 @@ static iheadtype *import_list = NULL; static char *as_name = NULL; static char * as_flags = ""; +static char *tmp_prefix; + static int no_idata4; static int no_idata5; static char *exp_name; @@ -361,20 +360,20 @@ static int add_indirect = 0; static int add_underscore = 0; static int dontdeltemps = 0; -/* True if we should export all symbols. Otherwise, we only export +/* TRUE if we should export all symbols. Otherwise, we only export symbols listed in .drectve sections or in the def file. */ -static boolean export_all_symbols; +static bfd_boolean export_all_symbols; -/* True if we should exclude the symbols in DEFAULT_EXCLUDES when +/* TRUE if we should exclude the symbols in DEFAULT_EXCLUDES when exporting all symbols. */ -static boolean do_default_excludes=true; +static bfd_boolean do_default_excludes = TRUE; /* Default symbols to exclude when exporting all the symbols. */ static const char *default_excludes = "DllMain@12,DllEntryPoint@0,impure_ptr"; -/* True if we should add __imp_ to import libraries for backward +/* TRUE if we should add __imp_ to import libraries for backward compatibility to old Cygwin releases. */ -static boolean create_compat_implib; +static bfd_boolean create_compat_implib; static char *def_file; @@ -428,16 +427,23 @@ static char * mcore_elf_linker_flags = NULL; #define DRECTVE_SECTION_NAME ".drectve" #endif -#define PATHMAX 250 /* What's the right name for this ? */ +#define PATHMAX 250 /* What's the right name for this ? */ + +char *tmp_asm_buf; +char *tmp_head_s_buf; +char *tmp_head_o_buf; +char *tmp_tail_s_buf; +char *tmp_tail_o_buf; +char *tmp_stub_buf; -#define TMP_ASM "dc.s" -#define TMP_HEAD_S "dh.s" -#define TMP_HEAD_O "dh.o" -#define TMP_TAIL_S "dt.s" -#define TMP_TAIL_O "dt.o" -#define TMP_STUB "ds" +#define TMP_ASM dlltmp (&tmp_asm_buf, "%sc.s") +#define TMP_HEAD_S dlltmp (&tmp_head_s_buf, "%sh.s") +#define TMP_HEAD_O dlltmp (&tmp_head_o_buf, "%sh.o") +#define TMP_TAIL_S dlltmp (&tmp_tail_s_buf, "%st.s") +#define TMP_TAIL_O dlltmp (&tmp_tail_o_buf, "%st.o") +#define TMP_STUB dlltmp (&tmp_stub_buf, "%ss") -/* This bit of assemly does jmp * .... */ +/* This bit of assembly does jmp * .... */ static const unsigned char i386_jtab[] = { 0xff, 0x25, 0x00, 0x00, 0x00, 0x00, 0x90, 0x90 @@ -487,11 +493,11 @@ static const unsigned char mcore_le_jtab[] = 0x00, 0x00, 0x00, 0x00 /*
*/ }; -/* This is the glue sequence for PowerPC PE. There is a */ -/* tocrel16-tocdefn reloc against the first instruction. */ -/* We also need a IMGLUE reloc against the glue function */ -/* to restore the toc saved by the third instruction in */ -/* the glue. */ +/* This is the glue sequence for PowerPC PE. There is a + tocrel16-tocdefn reloc against the first instruction. + We also need a IMGLUE reloc against the glue function + to restore the toc saved by the third instruction in + the glue. */ static const unsigned char ppc_jtab[] = { 0x00, 0x00, 0x62, 0x81, /* lwz r11,0(r2) */ @@ -504,8 +510,8 @@ static const unsigned char ppc_jtab[] = }; #ifdef DLLTOOL_PPC -/* the glue instruction, picks up the toc from the stw in */ -/* the above code: "lwz r2,4(r1)" */ +/* The glue instruction, picks up the toc from the stw in + the above code: "lwz r2,4(r1)". */ static bfd_vma ppc_glue_insn = 0x80410004; #endif @@ -526,8 +532,8 @@ struct mac const char *how_bfd_target; enum bfd_architecture how_bfd_arch; const unsigned char *how_jtab; - int how_jtab_size; /* size of the jtab entry */ - int how_jtab_roff; /* offset into it for the ind 32 reloc into idata 5 */ + int how_jtab_size; /* Size of the jtab entry. */ + int how_jtab_roff; /* Offset into it for the ind 32 reloc into idata 5. */ }; static const struct mac @@ -637,10 +643,11 @@ typedef struct export const char *internal_name; int ordinal; int constant; - int noname; + int noname; /* Don't put name in image file. */ + int private; /* Don't put reference in import lib. */ int data; int hint; - int forward; /* number of forward label, 0 means no forward */ + int forward; /* Number of forward label, 0 means no forward. */ struct export *next; } export_type; @@ -655,52 +662,78 @@ struct string_list static struct string_list *excludes; -static const char *rvaafter PARAMS ((int)); -static const char *rvabefore PARAMS ((int)); -static const char *asm_prefix PARAMS ((int)); -static void process_def_file PARAMS ((const char *)); -static void new_directive PARAMS ((char *)); -static void append_import PARAMS ((const char *, const char *, int)); -static void run PARAMS ((const char *, char *)); -static void scan_drectve_symbols PARAMS ((bfd *)); -static void scan_filtered_symbols PARAMS ((bfd *, PTR, long, unsigned int)); -static void add_excludes PARAMS ((const char *)); -static boolean match_exclude PARAMS ((const char *)); -static void set_default_excludes PARAMS ((void)); -static long filter_symbols PARAMS ((bfd *, PTR, long, unsigned int)); -static void scan_all_symbols PARAMS ((bfd *)); -static void scan_open_obj_file PARAMS ((bfd *)); -static void scan_obj_file PARAMS ((const char *)); -static void dump_def_info PARAMS ((FILE *)); -static int sfunc PARAMS ((const void *, const void *)); -static void flush_page PARAMS ((FILE *, long *, int, int)); -static void gen_def_file PARAMS ((void)); -static void generate_idata_ofile PARAMS ((FILE *)); -static void assemble_file PARAMS ((const char *, const char *)); -static void gen_exp_file PARAMS ((void)); -static const char *xlate PARAMS ((const char *)); +static const char *rvaafter (int); +static const char *rvabefore (int); +static const char *asm_prefix (int); +static void process_def_file (const char *); +static void new_directive (char *); +static void append_import (const char *, const char *, int); +static void run (const char *, char *); +static void scan_drectve_symbols (bfd *); +static void scan_filtered_symbols (bfd *, void *, long, unsigned int); +static void add_excludes (const char *); +static bfd_boolean match_exclude (const char *); +static void set_default_excludes (void); +static long filter_symbols (bfd *, void *, long, unsigned int); +static void scan_all_symbols (bfd *); +static void scan_open_obj_file (bfd *); +static void scan_obj_file (const char *); +static void dump_def_info (FILE *); +static int sfunc (const void *, const void *); +static void flush_page (FILE *, long *, int, int); +static void gen_def_file (void); +static void generate_idata_ofile (FILE *); +static void assemble_file (const char *, const char *); +static void gen_exp_file (void); +static const char *xlate (const char *); #if 0 -static void dump_iat PARAMS ((FILE *, export_type *)); +static void dump_iat (FILE *, export_type *); #endif -static char *make_label PARAMS ((const char *, const char *)); -static bfd *make_one_lib_file PARAMS ((export_type *, int)); -static bfd *make_head PARAMS ((void)); -static bfd *make_tail PARAMS ((void)); -static void gen_lib_file PARAMS ((void)); -static int pfunc PARAMS ((const void *, const void *)); -static int nfunc PARAMS ((const void *, const void *)); -static void remove_null_names PARAMS ((export_type **)); -static void dtab PARAMS ((export_type **)); -static void process_duplicates PARAMS ((export_type **)); -static void fill_ordinals PARAMS ((export_type **)); -static int alphafunc PARAMS ((const void *, const void *)); -static void mangle_defs PARAMS ((void)); -static void usage PARAMS ((FILE *, int)); -static void inform PARAMS ((const char *, ...)); +static char *make_label (const char *, const char *); +static char *make_imp_label (const char *, const char *); +static bfd *make_one_lib_file (export_type *, int); +static bfd *make_head (void); +static bfd *make_tail (void); +static void gen_lib_file (void); +static int pfunc (const void *, const void *); +static int nfunc (const void *, const void *); +static void remove_null_names (export_type **); +static void dtab (export_type **); +static void process_duplicates (export_type **); +static void fill_ordinals (export_type **); +static int alphafunc (const void *, const void *); +static void mangle_defs (void); +static void usage (FILE *, int); +static void inform (const char *, ...); + +static char * +prefix_encode (char *start, unsigned code) +{ + static char alpha[26] = "abcdefghijklmnopqrstuvwxyz"; + static char buf[32]; + char *p; + strcpy (buf, start); + p = strchr (buf, '\0'); + do + *p++ = alpha[code % sizeof (alpha)]; + while ((code /= sizeof (alpha)) != 0); + *p = '\0'; + return buf; +} +static char * +dlltmp (char **buf, const char *fmt) +{ + if (!*buf) + { + *buf = malloc (strlen (tmp_prefix) + 64); + sprintf (*buf, fmt, tmp_prefix); + } + return *buf; +} static void -inform VPARAMS ((const char *message, ...)) +inform VPARAMS ((const char * message, ...)) { VA_OPEN (args, message); VA_FIXEDARG (args, const char *, message); @@ -714,8 +747,7 @@ inform VPARAMS ((const char *message, ...)) } static const char * -rvaafter (machine) - int machine; +rvaafter (int machine) { switch (machine) { @@ -739,8 +771,7 @@ rvaafter (machine) } static const char * -rvabefore (machine) - int machine; +rvabefore (int machine) { switch (machine) { @@ -764,8 +795,7 @@ rvabefore (machine) } static const char * -asm_prefix (machine) - int machine; +asm_prefix (int machine) { switch (machine) { @@ -789,17 +819,17 @@ asm_prefix (machine) return ""; } -#define ASM_BYTE mtable[machine].how_byte -#define ASM_SHORT mtable[machine].how_short +#define ASM_BYTE mtable[machine].how_byte +#define ASM_SHORT mtable[machine].how_short #define ASM_LONG mtable[machine].how_long #define ASM_TEXT mtable[machine].how_asciz -#define ASM_C mtable[machine].how_comment -#define ASM_JUMP mtable[machine].how_jump +#define ASM_C mtable[machine].how_comment +#define ASM_JUMP mtable[machine].how_jump #define ASM_GLOBAL mtable[machine].how_global #define ASM_SPACE mtable[machine].how_space #define ASM_ALIGN_SHORT mtable[machine].how_align_short -#define ASM_RVA_BEFORE rvabefore(machine) -#define ASM_RVA_AFTER rvaafter(machine) +#define ASM_RVA_BEFORE rvabefore(machine) +#define ASM_RVA_AFTER rvaafter(machine) #define ASM_PREFIX asm_prefix(machine) #define ASM_ALIGN_LONG mtable[machine].how_align_long #define HOW_BFD_READ_TARGET 0 /* always default*/ @@ -813,8 +843,7 @@ asm_prefix (machine) static char **oav; static void -process_def_file (name) - const char *name; +process_def_file (const char *name) { FILE *f = fopen (name, FOPEN_RT); @@ -834,25 +863,24 @@ process_def_file (name) /**********************************************************************/ -/* Communications with the parser */ +/* Communications with the parser. */ -static const char *d_name; /* Arg to NAME or LIBRARY */ -static int d_nfuncs; /* Number of functions exported */ -static int d_named_nfuncs; /* Number of named functions exported */ -static int d_low_ord; /* Lowest ordinal index */ -static int d_high_ord; /* Highest ordinal index */ -static export_type *d_exports; /*list of exported functions */ -static export_type **d_exports_lexically; /* vector of exported functions in alpha order */ -static dlist_type *d_list; /* Descriptions */ -static dlist_type *a_list; /* Stuff to go in directives */ -static int d_nforwards = 0; /* Number of forwarded exports */ +static const char *d_name; /* Arg to NAME or LIBRARY. */ +static int d_nfuncs; /* Number of functions exported. */ +static int d_named_nfuncs; /* Number of named functions exported. */ +static int d_low_ord; /* Lowest ordinal index. */ +static int d_high_ord; /* Highest ordinal index. */ +static export_type *d_exports; /* List of exported functions. */ +static export_type **d_exports_lexically; /* Vector of exported functions in alpha order. */ +static dlist_type *d_list; /* Descriptions. */ +static dlist_type *a_list; /* Stuff to go in directives. */ +static int d_nforwards = 0; /* Number of forwarded exports. */ static int d_is_dll; static int d_is_exe; int -yyerror (err) - const char * err ATTRIBUTE_UNUSED; +yyerror (const char * err ATTRIBUTE_UNUSED) { /* xgettext:c-format */ non_fatal (_("Syntax error in def file %s:%d"), def_file, linenumber); @@ -861,13 +889,8 @@ yyerror (err) } void -def_exports (name, internal_name, ordinal, noname, constant, data) - const char *name; - const char *internal_name; - int ordinal; - int noname; - int constant; - int data; +def_exports (const char *name, const char *internal_name, int ordinal, + int noname, int constant, int data, int private) { struct export *p = (struct export *) xmalloc (sizeof (*p)); @@ -876,6 +899,7 @@ def_exports (name, internal_name, ordinal, noname, constant, data) p->ordinal = ordinal; p->constant = constant; p->noname = noname; + p->private = private; p->data = data; p->next = d_exports; d_exports = p; @@ -889,9 +913,7 @@ def_exports (name, internal_name, ordinal, noname, constant, data) } void -def_name (name, base) - const char *name; - int base; +def_name (const char *name, int base) { /* xgettext:c-format */ inform (_("NAME: %s base: %x"), name, base); @@ -900,17 +922,15 @@ def_name (name, base) non_fatal (_("Can't have LIBRARY and NAME")); d_name = name; - /* if --dllname not provided, use the one in the DEF file. - FIXME: Is this appropriate for executables? */ + /* If --dllname not provided, use the one in the DEF file. + FIXME: Is this appropriate for executables? */ if (! dll_name) dll_name = xstrdup (name); d_is_exe = 1; } void -def_library (name, base) - const char *name; - int base; +def_library (const char *name, int base) { /* xgettext:c-format */ inform (_("LIBRARY: %s base: %x"), name, base); @@ -919,15 +939,14 @@ def_library (name, base) non_fatal (_("Can't have LIBRARY and NAME")); d_name = name; - /* if --dllname not provided, use the one in the DEF file. */ + /* If --dllname not provided, use the one in the DEF file. */ if (! dll_name) dll_name = xstrdup (name); d_is_dll = 1; } void -def_description (desc) - const char *desc; +def_description (const char *desc) { dlist_type *d = (dlist_type *) xmalloc (sizeof (dlist_type)); d->text = xstrdup (desc); @@ -936,8 +955,7 @@ def_description (desc) } static void -new_directive (dir) - char *dir; +new_directive (char *dir) { dlist_type *d = (dlist_type *) xmalloc (sizeof (dlist_type)); d->text = xstrdup (dir); @@ -946,9 +964,7 @@ new_directive (dir) } void -def_heapsize (reserve, commit) - int reserve; - int commit; +def_heapsize (int reserve, int commit) { char b[200]; if (commit > 0) @@ -959,9 +975,7 @@ def_heapsize (reserve, commit) } void -def_stacksize (reserve, commit) - int reserve; - int commit; +def_stacksize (int reserve, int commit) { char b[200]; if (commit > 0) @@ -975,10 +989,7 @@ def_stacksize (reserve, commit) import_list. It is used by def_import. */ static void -append_import (symbol_name, dll_name, func_ordinal) - const char *symbol_name; - const char *dll_name; - int func_ordinal; +append_import (const char *symbol_name, const char *dll_name, int func_ordinal) { iheadtype **pq; iheadtype *q; @@ -1042,12 +1053,8 @@ append_import (symbol_name, dll_name, func_ordinal) present (i.e., not NULL). */ void -def_import (app_name, module, dllext, entry, ord_val) - const char *app_name; - const char *module; - const char *dllext; - const char *entry; - int ord_val; +def_import (const char *app_name, const char *module, const char *dllext, + const char *entry, int ord_val) { const char *application_name; char *buf; @@ -1073,17 +1080,13 @@ def_import (app_name, module, dllext, entry, ord_val) } void -def_version (major, minor) - int major; - int minor; +def_version (int major, int minor) { printf ("VERSION %d.%d\n", major, minor); } void -def_section (name, attr) - const char *name; - int attr; +def_section (const char *name, int attr) { char buf[200]; char atts[5]; @@ -1103,16 +1106,14 @@ def_section (name, attr) } void -def_code (attr) - int attr; +def_code (int attr) { def_section ("CODE", attr); } void -def_data (attr) - int attr; +def_data (int attr) { def_section ("DATA", attr); } @@ -1120,9 +1121,7 @@ def_data (attr) /**********************************************************************/ static void -run (what, args) - const char *what; - char *args; +run (const char *what, char *args) { char *s; int pid, wait_status; @@ -1193,8 +1192,7 @@ run (what, args) ABFD. Pass each one to def_exports. */ static void -scan_drectve_symbols (abfd) - bfd *abfd; +scan_drectve_symbols (bfd *abfd) { asection * s; int size; @@ -1250,15 +1248,16 @@ scan_drectve_symbols (abfd) /* FIXME: The 5th arg is for the `constant' field. What should it be? Not that it matters since it's not currently useful. */ - def_exports (c, 0, -1, 0, 0, ! (flags & BSF_FUNCTION)); + def_exports (c, 0, -1, 0, 0, ! (flags & BSF_FUNCTION), 0); if (add_stdcall_alias && strchr (c, '@')) { - char *exported_name = xstrdup (c); + int lead_at = (*c == '@') ; + char *exported_name = xstrdup (c + lead_at); char *atsym = strchr (exported_name, '@'); *atsym = '\0'; /* Note: stdcall alias symbols can never be data. */ - def_exports (exported_name, xstrdup (c), -1, 0, 0, 0); + def_exports (exported_name, xstrdup (c), -1, 0, 0, 0, 0); } } else @@ -1271,11 +1270,8 @@ scan_drectve_symbols (abfd) symbols to export. */ static void -scan_filtered_symbols (abfd, minisyms, symcount, size) - bfd *abfd; - PTR minisyms; - long symcount; - unsigned int size; +scan_filtered_symbols (bfd *abfd, void *minisyms, long symcount, + unsigned int size) { asymbol *store; bfd_byte *from, *fromend; @@ -1291,7 +1287,7 @@ scan_filtered_symbols (abfd, minisyms, symcount, size) asymbol *sym; const char *symbol_name; - sym = bfd_minisymbol_to_symbol (abfd, false, from, store); + sym = bfd_minisymbol_to_symbol (abfd, FALSE, from, store); if (sym == NULL) bfd_fatal (bfd_get_filename (abfd)); @@ -1300,15 +1296,16 @@ scan_filtered_symbols (abfd, minisyms, symcount, size) ++symbol_name; def_exports (xstrdup (symbol_name) , 0, -1, 0, 0, - ! (sym->flags & BSF_FUNCTION)); + ! (sym->flags & BSF_FUNCTION), 0); if (add_stdcall_alias && strchr (symbol_name, '@')) { - char *exported_name = xstrdup (symbol_name); + int lead_at = (*symbol_name == '@'); + char *exported_name = xstrdup (symbol_name + lead_at); char *atsym = strchr (exported_name, '@'); *atsym = '\0'; /* Note: stdcall alias symbols can never be data. */ - def_exports (exported_name, xstrdup (symbol_name), -1, 0, 0, 0); + def_exports (exported_name, xstrdup (symbol_name), -1, 0, 0, 0, 0); } } } @@ -1316,8 +1313,7 @@ scan_filtered_symbols (abfd, minisyms, symcount, size) /* Add a list of symbols to exclude. */ static void -add_excludes (new_excludes) - const char *new_excludes; +add_excludes (const char *new_excludes) { char *local_copy; char *exclude_string; @@ -1332,8 +1328,11 @@ add_excludes (new_excludes) new_exclude = ((struct string_list *) xmalloc (sizeof (struct string_list))); new_exclude->string = (char *) xmalloc (strlen (exclude_string) + 2); - /* FIXME: Is it always right to add a leading underscore? */ - sprintf (new_exclude->string, "_%s", exclude_string); + /* Don't add a leading underscore for fastcall symbols. */ + if (*exclude_string == '@') + sprintf (new_exclude->string, "%s", exclude_string); + else + sprintf (new_exclude->string, "_%s", exclude_string); new_exclude->next = excludes; excludes = new_exclude; @@ -1346,16 +1345,15 @@ add_excludes (new_excludes) /* See if STRING is on the list of symbols to exclude. */ -static boolean -match_exclude (string) - const char *string; +static bfd_boolean +match_exclude (const char *string) { struct string_list *excl_item; for (excl_item = excludes; excl_item; excl_item = excl_item->next) if (strcmp (string, excl_item->string) == 0) - return true; - return false; + return TRUE; + return FALSE; } /* Add the default list of symbols to exclude. */ @@ -1369,11 +1367,7 @@ set_default_excludes (void) /* Choose which symbols to export. */ static long -filter_symbols (abfd, minisyms, symcount, size) - bfd *abfd; - PTR minisyms; - long symcount; - unsigned int size; +filter_symbols (bfd *abfd, void *minisyms, long symcount, unsigned int size) { bfd_byte *from, *fromend, *to; asymbol *store; @@ -1391,7 +1385,7 @@ filter_symbols (abfd, minisyms, symcount, size) int keep = 0; asymbol *sym; - sym = bfd_minisymbol_to_symbol (abfd, false, (const PTR) from, store); + sym = bfd_minisymbol_to_symbol (abfd, FALSE, (const void *) from, store); if (sym == NULL) bfd_fatal (bfd_get_filename (abfd)); @@ -1417,11 +1411,10 @@ filter_symbols (abfd, minisyms, symcount, size) export. */ static void -scan_all_symbols (abfd) - bfd *abfd; +scan_all_symbols (bfd *abfd) { long symcount; - PTR minisyms; + void *minisyms; unsigned int size; /* Ignore bfds with an import descriptor table. We assume that any @@ -1437,7 +1430,7 @@ scan_all_symbols (abfd) return; } - symcount = bfd_read_minisymbols (abfd, false, &minisyms, &size); + symcount = bfd_read_minisymbols (abfd, FALSE, &minisyms, &size); if (symcount < 0) bfd_fatal (bfd_get_filename (abfd)); @@ -1460,23 +1453,21 @@ scan_all_symbols (abfd) /* Look at the object file to decide which symbols to export. */ static void -scan_open_obj_file (abfd) - bfd *abfd; +scan_open_obj_file (bfd *abfd) { if (export_all_symbols) scan_all_symbols (abfd); else scan_drectve_symbols (abfd); - /* FIXME: we ought to read in and block out the base relocations */ + /* FIXME: we ought to read in and block out the base relocations. */ /* xgettext:c-format */ inform (_("Done reading %s"), bfd_get_filename (abfd)); } static void -scan_obj_file (filename) - const char *filename; +scan_obj_file (const char *filename) { bfd * f = bfd_openr (filename, 0); @@ -1519,8 +1510,7 @@ scan_obj_file (filename) /**********************************************************************/ static void -dump_def_info (f) - FILE *f; +dump_def_info (FILE *f) { int i; export_type *exp; @@ -1530,38 +1520,33 @@ dump_def_info (f) fprintf (f, "\n"); for (i = 0, exp = d_exports; exp; i++, exp = exp->next) { - fprintf (f, "%s %d = %s %s @ %d %s%s%s\n", + fprintf (f, "%s %d = %s %s @ %d %s%s%s%s\n", ASM_C, i, exp->name, exp->internal_name, exp->ordinal, exp->noname ? "NONAME " : "", + exp->private ? "PRIVATE " : "", exp->constant ? "CONSTANT" : "", exp->data ? "DATA" : ""); } } -/* Generate the .exp file */ +/* Generate the .exp file. */ static int -sfunc (a, b) - const void *a; - const void *b; +sfunc (const void *a, const void *b) { return *(const long *) a - *(const long *) b; } static void -flush_page (f, need, page_addr, on_page) - FILE *f; - long *need; - int page_addr; - int on_page; +flush_page (FILE *f, long *need, int page_addr, int on_page) { int i; - /* Flush this page */ + /* Flush this page. */ fprintf (f, "\t%s\t0x%08x\t%s Starting RVA for chunk\n", ASM_LONG, page_addr, @@ -1587,7 +1572,7 @@ flush_page (f, need, page_addr, on_page) } static void -gen_def_file () +gen_def_file (void) { int i; export_type *exp; @@ -1605,23 +1590,28 @@ gen_def_file () char *quote = strchr (exp->name, '.') ? "\"" : ""; char *res = cplus_demangle (exp->internal_name, DMGL_ANSI | DMGL_PARAMS); - if (strcmp (exp->name, exp->internal_name) == 0) + if (res) { + fprintf (output_def,";\t%s\n", res); + free (res); + } - fprintf (output_def, "\t%s%s%s @ %d%s%s ; %s\n", + if (strcmp (exp->name, exp->internal_name) == 0) + { + fprintf (output_def, "\t%s%s%s @ %d%s%s%s\n", quote, exp->name, quote, exp->ordinal, exp->noname ? " NONAME" : "", - exp->data ? " DATA" : "", - res ? res : ""); + exp->private ? "PRIVATE " : "", + exp->data ? " DATA" : ""); } else { - char *quote1 = strchr (exp->internal_name, '.') ? "\"" : ""; + char * quote1 = strchr (exp->internal_name, '.') ? "\"" : ""; /* char *alias = */ - fprintf (output_def, "\t%s%s%s = %s%s%s @ %d%s%s ; %s\n", + fprintf (output_def, "\t%s%s%s = %s%s%s @ %d%s%s%s\n", quote, exp->name, quote, @@ -1630,11 +1620,9 @@ gen_def_file () quote1, exp->ordinal, exp->noname ? " NONAME" : "", - exp->data ? " DATA" : "", - res ? res : ""); + exp->private ? "PRIVATE " : "", + exp->data ? " DATA" : ""); } - if (res) - free (res); } inform (_("Added exports to output file")); @@ -1645,8 +1633,7 @@ gen_def_file () the file. */ static void -generate_idata_ofile (filvar) - FILE *filvar; +generate_idata_ofile (FILE *filvar) { iheadtype *headptr; ifunctype *funcptr; @@ -1738,9 +1725,7 @@ generate_idata_ofile (filvar) /* Assemble the specified file. */ static void -assemble_file (source, dest) - const char * source; - const char * dest; +assemble_file (const char * source, const char * dest) { char * cmd; @@ -1753,7 +1738,7 @@ assemble_file (source, dest) } static void -gen_exp_file () +gen_exp_file (void) { FILE *f; int i; @@ -1825,9 +1810,15 @@ gen_exp_file () } if (exp->forward == 0) - fprintf (f, "\t%s%s%s%s\t%s %d\n", ASM_RVA_BEFORE, - ASM_PREFIX, - exp->internal_name, ASM_RVA_AFTER, ASM_C, exp->ordinal); + { + if (exp->internal_name[0] == '@') + fprintf (f, "\t%s%s%s\t%s %d\n", ASM_RVA_BEFORE, + exp->internal_name, ASM_RVA_AFTER, ASM_C, exp->ordinal); + else + fprintf (f, "\t%s%s%s%s\t%s %d\n", ASM_RVA_BEFORE, + ASM_PREFIX, + exp->internal_name, ASM_RVA_AFTER, ASM_C, exp->ordinal); + } else fprintf (f, "\t%sf%d%s\t%s %d\n", ASM_RVA_BEFORE, exp->forward, ASM_RVA_AFTER, ASM_C, exp->ordinal); @@ -1854,14 +1845,14 @@ gen_exp_file () fprintf(f,"%s Export Name Table\n", ASM_C); for (i = 0; (exp = d_exports_lexically[i]); i++) - if (!exp->noname || show_allnames) - { + { + if (!exp->noname || show_allnames) fprintf (f, "n%d: %s \"%s\"\n", exp->ordinal, ASM_TEXT, xlate (exp->name)); - if (exp->forward != 0) - fprintf (f, "f%d: %s \"%s\"\n", - exp->forward, ASM_TEXT, exp->internal_name); - } + if (exp->forward != 0) + fprintf (f, "f%d: %s \"%s\"\n", + exp->forward, ASM_TEXT, exp->internal_name); + } if (a_list) { @@ -1927,7 +1918,7 @@ gen_exp_file () } } - /* Dump the reloc section if a base file is provided */ + /* Dump the reloc section if a base file is provided. */ if (base_file) { int addr; @@ -1956,7 +1947,7 @@ gen_exp_file () int dst = 0; int last = -1; qsort (copy, num_entries, sizeof (long), sfunc); - /* Delete duplcates */ + /* Delete duplicates */ for (src = 0; src < num_entries; src++) { if (last != copy[src]) @@ -1987,7 +1978,7 @@ gen_exp_file () fclose (f); - /* assemble the file */ + /* Assemble the file. */ assemble_file (TMP_ASM, exp_name); if (dontdeltemps == 0) @@ -1997,12 +1988,14 @@ gen_exp_file () } static const char * -xlate (name) - const char *name; +xlate (const char *name) { - if (add_underscore) + int lead_at = (*name == '@'); + + if (add_underscore && !lead_at) { char *copy = xmalloc (strlen (name) + 2); + copy[0] = '_'; strcpy (copy + 1, name); name = copy; @@ -2011,6 +2004,8 @@ xlate (name) if (killat) { char *p; + + name += lead_at; p = strchr (name, '@'); if (p) *p = 0; @@ -2023,9 +2018,7 @@ xlate (name) #if 0 static void -dump_iat (f, exp) - FILE *f; - export_type *exp; +dump_iat (FILE *f, export_type *exp) { if (exp->noname && !show_allnames ) { @@ -2053,7 +2046,7 @@ typedef struct asymbol *sym; asymbol **sympp; int size; - unsigned char *data; + unsigned char *data; } sinfo; #ifndef DLLTOOL_PPC @@ -2088,8 +2081,8 @@ static sinfo secdata[NSECS] = #else -/* Sections numbered to make the order the same as other PowerPC NT */ -/* compilers. This also keeps funny alignment thingies from happening. */ +/* Sections numbered to make the order the same as other PowerPC NT + compilers. This also keeps funny alignment thingies from happening. */ #define TEXT 0 #define PDATA 1 #define RDATA 2 @@ -2117,9 +2110,8 @@ static sinfo secdata[NSECS] = #endif -/* -This is what we're trying to make. We generate the imp symbols with -both single and double underscores, for compatibility. +/* This is what we're trying to make. We generate the imp symbols with + both single and double underscores, for compatibility. .text .global _GetFileVersionInfoSizeW@8 @@ -2142,7 +2134,7 @@ ID2: .short 2 .asciz "GetFileVersionInfoSizeW" -For the PowerPC, here's the variation on the above scheme: + For the PowerPC, here's the variation on the above scheme: # Rather than a simple "jmp *", the code to get to the dll function # looks like: @@ -2153,26 +2145,46 @@ For the PowerPC, here's the variation on the above scheme: stw r2,4(r1) mtctr r12 lwz r2,4(r11) - bctr -*/ + bctr */ static char * -make_label (prefix, name) - const char *prefix; - const char *name; +make_label (const char *prefix, const char *name) { int len = strlen (ASM_PREFIX) + strlen (prefix) + strlen (name); char *copy = xmalloc (len +1 ); + strcpy (copy, ASM_PREFIX); strcat (copy, prefix); strcat (copy, name); return copy; } +static char * +make_imp_label (const char *prefix, const char *name) +{ + int len; + char *copy; + + if (name[0] == '@') + { + len = strlen (prefix) + strlen (name); + copy = xmalloc (len + 1); + strcpy (copy, prefix); + strcat (copy, name); + } + else + { + len = strlen (ASM_PREFIX) + strlen (prefix) + strlen (name); + copy = xmalloc (len + 1); + strcpy (copy, prefix); + strcat (copy, ASM_PREFIX); + strcat (copy, name); + } + return copy; +} + static bfd * -make_one_lib_file (exp, i) - export_type *exp; - int i; +make_one_lib_file (export_type *exp, int i) { #if 0 { @@ -2245,7 +2257,7 @@ make_one_lib_file (exp, i) asymbol * ptrs[NSECS + 4 + EXTRA + 1]; flagword applicable; - char * outname = xmalloc (10); + char * outname = xmalloc (strlen (TMP_STUB) + 10); int oidx = 0; @@ -2270,7 +2282,7 @@ make_one_lib_file (exp, i) applicable = bfd_applicable_section_flags (abfd); - /* First make symbols for the sections */ + /* First make symbols for the sections. */ for (i = 0; i < NSECS; i++) { sinfo *si = secdata + i; @@ -2299,12 +2311,12 @@ make_one_lib_file (exp, i) if (! exp->data) { exp_label = bfd_make_empty_symbol (abfd); - exp_label->name = make_label ("", exp->name); + exp_label->name = make_imp_label ("", exp->name); /* On PowerPC, the function name points to a descriptor in the rdata section, the first element of which is a pointer to the code (..function_name), and the second - points to the .toc */ + points to the .toc. */ #ifdef DLLTOOL_PPC if (machine == MPPC) exp_label->section = secdata[RDATA].sec; @@ -2328,14 +2340,14 @@ make_one_lib_file (exp, i) if (create_compat_implib) { iname = bfd_make_empty_symbol (abfd); - iname->name = make_label ("__imp_", exp->name); + iname->name = make_imp_label ("___imp", exp->name); iname->section = secdata[IDATA5].sec; iname->flags = BSF_GLOBAL; iname->value = 0; } iname2 = bfd_make_empty_symbol (abfd); - iname2->name = make_label ("_imp__", exp->name); + iname2->name = make_imp_label ("__imp_", exp->name); iname2->section = secdata[IDATA5].sec; iname2->flags = BSF_GLOBAL; iname2->value = 0; @@ -2347,7 +2359,6 @@ make_one_lib_file (exp, i) iname_lab->flags = 0; iname_lab->value = 0; - iname_pp = ptrs + oidx; if (create_compat_implib) ptrs[oidx++] = iname; @@ -2357,7 +2368,7 @@ make_one_lib_file (exp, i) ptrs[oidx++] = iname_lab; #ifdef DLLTOOL_PPC - /* The symbol refering to the code (.text) */ + /* The symbol referring to the code (.text). */ { asymbol *function_name; @@ -2371,9 +2382,9 @@ make_one_lib_file (exp, i) ptrs[oidx++] = function_name; } - /* The .toc symbol */ + /* The .toc symbol. */ { - asymbol *toc_symbol; /* The .toc symbol */ + asymbol *toc_symbol; toc_symbol = bfd_make_empty_symbol (abfd); toc_symbol->name = make_label (".", "toc"); @@ -2432,7 +2443,7 @@ make_one_lib_file (exp, i) case IDATA4: case IDATA5: /* An idata$4 or idata$5 is one word long, and has an - rva to idata$6 */ + rva to idata$6. */ si->data = xmalloc (4); si->size = 4; @@ -2477,7 +2488,7 @@ make_one_lib_file (exp, i) break; case IDATA7: si->size = 4; - si->data =xmalloc(4); + si->data =xmalloc (4); memset (si->data, 0, si->size); rel = xmalloc (sizeof (arelent)); rpp = xmalloc (sizeof (arelent *) * 2); @@ -2493,16 +2504,16 @@ make_one_lib_file (exp, i) #ifdef DLLTOOL_PPC case PDATA: { - /* The .pdata section is 5 words long. */ - /* Think of it as: */ - /* struct */ - /* { */ - /* bfd_vma BeginAddress, [0x00] */ - /* EndAddress, [0x04] */ - /* ExceptionHandler, [0x08] */ - /* HandlerData, [0x0c] */ - /* PrologEndAddress; [0x10] */ - /* }; */ + /* The .pdata section is 5 words long. + Think of it as: + struct + { + bfd_vma BeginAddress, [0x00] + EndAddress, [0x04] + ExceptionHandler, [0x08] + HandlerData, [0x0c] + PrologEndAddress; [0x10] + }; */ /* So this pdata section setups up this as a glue linkage to a dll routine. There are a number of house keeping things @@ -2517,15 +2528,14 @@ make_one_lib_file (exp, i) So we need a total of four relocs for this section. 3. Lastly, the HandlerData field is set to 0x03, to indicate - that this is a glue routine. - */ + that this is a glue routine. */ arelent *imglue, *ba_rel, *ea_rel, *pea_rel; - /* alignment must be set to 2**2 or you get extra stuff */ + /* Alignment must be set to 2**2 or you get extra stuff. */ bfd_set_section_alignment(abfd, sec, 2); si->size = 4 * 5; - si->data =xmalloc(4 * 5); + si->data = xmalloc (si->size); memset (si->data, 0, si->size); rpp = xmalloc (sizeof (arelent *) * 5); rpp[0] = imglue = xmalloc (sizeof (arelent)); @@ -2534,7 +2544,7 @@ make_one_lib_file (exp, i) rpp[3] = pea_rel = xmalloc (sizeof (arelent)); rpp[4] = 0; - /* stick the toc reload instruction in the glue reloc */ + /* Stick the toc reload instruction in the glue reloc. */ bfd_put_32(abfd, ppc_glue_insn, (char *) &imglue->address); imglue->addend = 0; @@ -2547,17 +2557,17 @@ make_one_lib_file (exp, i) ba_rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32); ba_rel->sym_ptr_ptr = fn_pp; - bfd_put_32(abfd, 0x18, si->data + 0x04); + bfd_put_32 (abfd, 0x18, si->data + 0x04); ea_rel->address = 4; ea_rel->addend = 0; ea_rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32); ea_rel->sym_ptr_ptr = fn_pp; - /* mark it as glue */ - bfd_put_32(abfd, 0x03, si->data + 0x0c); + /* Mark it as glue. */ + bfd_put_32 (abfd, 0x03, si->data + 0x0c); - /* mark the prolog end address */ - bfd_put_32(abfd, 0x0D, si->data + 0x10); + /* Mark the prolog end address. */ + bfd_put_32 (abfd, 0x0D, si->data + 0x10); pea_rel->address = 0x10; pea_rel->addend = 0; pea_rel->howto = bfd_reloc_type_lookup (abfd, BFD_RELOC_32); @@ -2572,9 +2582,7 @@ make_one_lib_file (exp, i) descriptor consisting of: 1. The address of the code. 2. The address of the appropriate .toc - We use relocs to build this. - */ - + We use relocs to build this. */ si->size = 8; si->data = xmalloc (8); memset (si->data, 0, si->size); @@ -2605,7 +2613,7 @@ make_one_lib_file (exp, i) { bfd_vma vma = 0; - /* Size up all the sections */ + /* Size up all the sections. */ for (i = 0; i < NSECS; i++) { sinfo *si = secdata + i; @@ -2616,7 +2624,7 @@ make_one_lib_file (exp, i) /* vma += si->size;*/ } } - /* Write them out */ + /* Write them out. */ for (i = 0; i < NSECS; i++) { sinfo *si = secdata + i; @@ -2641,7 +2649,7 @@ make_one_lib_file (exp, i) } static bfd * -make_head () +make_head (void) { FILE *f = fopen (TMP_HEAD_S, FOPEN_WT); @@ -2700,7 +2708,7 @@ make_head () } static bfd * -make_tail () +make_tail (void) { FILE *f = fopen (TMP_TAIL_S, FOPEN_WT); @@ -2728,8 +2736,7 @@ make_tail () would be to mark this section as a comdat type 2 section, so only one would appear in the final .exe (if our linker supported comdat, that is) or cause it to be inserted by something else (say - crt0) - */ + crt0). */ fprintf (f, "\t.section .idata$3\n"); fprintf (f, "\t%s\t0\n", ASM_LONG); @@ -2741,7 +2748,7 @@ make_tail () #ifdef DLLTOOL_PPC /* Other PowerPC NT compilers use idata$6 for the dllname, so I - do too. Original, huh? */ + do too. Original, huh? */ fprintf (f, "\t.section .idata$6\n"); #else fprintf (f, "\t.section .idata$7\n"); @@ -2755,11 +2762,11 @@ make_tail () assemble_file (TMP_TAIL_S, TMP_TAIL_O); - return bfd_openr (TMP_TAIL_O, HOW_BFD_READ_TARGET); + return bfd_openr (TMP_TAIL_O, HOW_BFD_READ_TARGET); } static void -gen_lib_file () +gen_lib_file (void) { int i; export_type *exp; @@ -2783,7 +2790,6 @@ gen_lib_file () outarch->has_armap = 1; /* Work out a reasonable size of things to put onto one line. */ - ar_head = make_head (); ar_tail = make_tail(); @@ -2792,13 +2798,16 @@ gen_lib_file () for (i = 0; (exp = d_exports_lexically[i]); i++) { - bfd *n = make_one_lib_file (exp, i); + bfd *n; + /* Don't add PRIVATE entries to import lib. */ + if (exp->private) + continue; + n = make_one_lib_file (exp, i); n->next = head; head = n; } - /* Now stick them all into the archive */ - + /* Now stick them all into the archive. */ ar_head->next = head; ar_tail->next = ar_head; head = ar_tail; @@ -2816,8 +2825,7 @@ gen_lib_file () head = n; } - /* Delete all the temp files */ - + /* Delete all the temp files. */ if (dontdeltemps == 0) { unlink (TMP_HEAD_O); @@ -2830,9 +2838,12 @@ gen_lib_file () { char *name; - name = (char *) alloca (sizeof TMP_STUB + 10); - for (i = 0, exp = d_exports; exp; i++, exp = exp->next) + name = (char *) alloca (strlen (TMP_STUB) + 10); + for (i = 0; (exp = d_exports_lexically[i]); i++) { + /* Don't delete non-existent stubs for PRIVATE entries. */ + if (exp->private) + continue; sprintf (name, "%s%05d.o", TMP_STUB, i); if (unlink (name) < 0) /* xgettext:c-format */ @@ -2843,21 +2854,18 @@ gen_lib_file () inform (_("Created lib file")); } -/**********************************************************************/ - /* Run through the information gathered from the .o files and the - .def file and work out the best stuff */ + .def file and work out the best stuff. */ + static int -pfunc (a, b) - const void *a; - const void *b; +pfunc (const void *a, const void *b) { export_type *ap = *(export_type **) a; export_type *bp = *(export_type **) b; if (ap->ordinal == bp->ordinal) return 0; - /* unset ordinals go to the bottom */ + /* Unset ordinals go to the bottom. */ if (ap->ordinal == -1) return 1; if (bp->ordinal == -1) @@ -2866,9 +2874,7 @@ pfunc (a, b) } static int -nfunc (a, b) - const void *a; - const void *b; +nfunc (const void *a, const void *b) { export_type *ap = *(export_type **) a; export_type *bp = *(export_type **) b; @@ -2877,11 +2883,11 @@ nfunc (a, b) } static void -remove_null_names (ptr) - export_type **ptr; +remove_null_names (export_type **ptr) { int src; int dst; + for (dst = src = 0; src < d_nfuncs; src++) { if (ptr[src]) @@ -2894,12 +2900,7 @@ remove_null_names (ptr) } static void -dtab (ptr) - export_type ** ptr -#ifndef SACDEBUG -ATTRIBUTE_UNUSED -#endif - ; +dtab (export_type **ptr ATTRIBUTE_UNUSED) { #ifdef SACDEBUG int i; @@ -2920,16 +2921,15 @@ ATTRIBUTE_UNUSED } static void -process_duplicates (d_export_vec) - export_type **d_export_vec; +process_duplicates (export_type **d_export_vec) { int more = 1; int i; + while (more) { - more = 0; - /* Remove duplicates */ + /* Remove duplicates. */ qsort (d_export_vec, d_nfuncs, sizeof (export_type *), nfunc); dtab (d_export_vec); @@ -2938,7 +2938,6 @@ process_duplicates (d_export_vec) if (strcmp (d_export_vec[i]->name, d_export_vec[i + 1]->name) == 0) { - export_type *a = d_export_vec[i]; export_type *b = d_export_vec[i + 1]; @@ -2954,7 +2953,7 @@ process_duplicates (d_export_vec) fatal (_("Error, duplicate EXPORT with oridinals: %s"), a->name); - /* Merge attributes */ + /* Merge attributes. */ b->ordinal = a->ordinal > 0 ? a->ordinal : b->ordinal; b->constant |= a->constant; b->noname |= a->noname; @@ -2968,18 +2967,14 @@ process_duplicates (d_export_vec) } } - - /* Count the names */ + /* Count the names. */ for (i = 0; i < d_nfuncs; i++) - { - if (!d_export_vec[i]->noname) - d_named_nfuncs++; - } + if (!d_export_vec[i]->noname) + d_named_nfuncs++; } static void -fill_ordinals (d_export_vec) - export_type **d_export_vec; +fill_ordinals (export_type **d_export_vec) { int lowest = -1; int i; @@ -2988,22 +2983,20 @@ fill_ordinals (d_export_vec) qsort (d_export_vec, d_nfuncs, sizeof (export_type *), pfunc); - /* fill in the unset ordinals with ones from our range */ - + /* Fill in the unset ordinals with ones from our range. */ ptr = (char *) xmalloc (size); memset (ptr, 0, size); - /* Mark in our large vector all the numbers that are taken */ + /* Mark in our large vector all the numbers that are taken. */ for (i = 0; i < d_nfuncs; i++) { if (d_export_vec[i]->ordinal != -1) { ptr[d_export_vec[i]->ordinal] = 1; + if (lowest == -1 || d_export_vec[i]->ordinal < lowest) - { - lowest = d_export_vec[i]->ordinal; - } + lowest = d_export_vec[i]->ordinal; } } @@ -3016,7 +3009,7 @@ fill_ordinals (d_export_vec) { if (d_export_vec[i]->ordinal == -1) { - register int j; + int j; /* First try within or after any user supplied range. */ for (j = lowest; j < size; j++) @@ -3041,8 +3034,7 @@ fill_ordinals (d_export_vec) free (ptr); - /* And resort */ - + /* And resort. */ qsort (d_export_vec, d_nfuncs, sizeof (export_type *), pfunc); /* Work out the lowest and highest ordinal numbers. */ @@ -3056,9 +3048,7 @@ fill_ordinals (d_export_vec) } static int -alphafunc (av,bv) - const void *av; - const void *bv; +alphafunc (const void *av, const void *bv) { const export_type **a = (const export_type **) av; const export_type **b = (const export_type **) bv; @@ -3067,28 +3057,24 @@ alphafunc (av,bv) } static void -mangle_defs () +mangle_defs (void) { - /* First work out the minimum ordinal chosen */ - + /* First work out the minimum ordinal chosen. */ export_type *exp; int i; int hint = 0; - export_type **d_export_vec - = (export_type **) xmalloc (sizeof (export_type *) * d_nfuncs); + export_type **d_export_vec = xmalloc (sizeof (export_type *) * d_nfuncs); inform (_("Processing definitions")); for (i = 0, exp = d_exports; exp; i++, exp = exp->next) - { - d_export_vec[i] = exp; - } + d_export_vec[i] = exp; process_duplicates (d_export_vec); fill_ordinals (d_export_vec); - /* Put back the list in the new order */ + /* Put back the list in the new order. */ d_exports = 0; for (i = d_nfuncs - 1; i >= 0; i--) { @@ -3096,35 +3082,27 @@ mangle_defs () d_exports = d_export_vec[i]; } - /* Build list in alpha order */ + /* Build list in alpha order. */ d_exports_lexically = (export_type **) xmalloc (sizeof (export_type *) * (d_nfuncs + 1)); for (i = 0, exp = d_exports; exp; i++, exp = exp->next) - { - d_exports_lexically[i] = exp; - } + d_exports_lexically[i] = exp; + d_exports_lexically[i] = 0; qsort (d_exports_lexically, i, sizeof (export_type *), alphafunc); - /* Fill exp entries with their hint values */ - + /* Fill exp entries with their hint values. */ for (i = 0; i < d_nfuncs; i++) - { - if (!d_exports_lexically[i]->noname || show_allnames) - d_exports_lexically[i]->hint = hint++; - } + if (!d_exports_lexically[i]->noname || show_allnames) + d_exports_lexically[i]->hint = hint++; inform (_("Processed definitions")); } -/**********************************************************************/ - static void -usage (file, status) - FILE *file; - int status; +usage (FILE *file, int status) { /* xgetext:c-format */ fprintf (file, _("Usage %s \n"), program_name); @@ -3151,6 +3129,7 @@ usage (file, status) fprintf (file, _(" -f --as-flags Pass to the assembler.\n")); fprintf (file, _(" -C --compat-implib Create backward compatible import library.\n")); fprintf (file, _(" -n --no-delete Keep temp files (repeat for extra preservation).\n")); + fprintf (file, _(" -t --temp-prefix Use to construct temp file names.\n")); fprintf (file, _(" -v --verbose Be verbose.\n")); fprintf (file, _(" -V --version Display the program version.\n")); fprintf (file, _(" -h --help Display this information.\n")); @@ -3180,7 +3159,7 @@ static const struct option long_options[] = {"exclude-symbols", required_argument, NULL, OPTION_EXCLUDE_SYMS}, {"no-default-excludes", no_argument, NULL, OPTION_NO_DEFAULT_EXCLUDES}, {"output-lib", required_argument, NULL, 'l'}, - {"def", required_argument, NULL, 'd'}, /* for compatiblity with older versions */ + {"def", required_argument, NULL, 'd'}, /* for compatibility with older versions */ {"input-def", required_argument, NULL, 'd'}, {"add-underscore", no_argument, NULL, 'U'}, {"kill-at", no_argument, NULL, 'k'}, @@ -3195,15 +3174,14 @@ static const struct option long_options[] = {"as-flags", required_argument, NULL, 'f'}, {"mcore-elf", required_argument, NULL, 'M'}, {"compat-implib", no_argument, NULL, 'C'}, + {"temp-prefix", required_argument, NULL, 't'}, {NULL,0,NULL,0} }; -int main PARAMS ((int, char **)); +int main (int, char **); int -main (ac, av) - int ac; - char **av; +main (int ac, char **av) { int c; int i; @@ -3232,16 +3210,16 @@ main (ac, av) switch (c) { case OPTION_EXPORT_ALL_SYMS: - export_all_symbols = true; + export_all_symbols = TRUE; break; case OPTION_NO_EXPORT_ALL_SYMS: - export_all_symbols = false; + export_all_symbols = FALSE; break; case OPTION_EXCLUDE_SYMS: add_excludes (optarg); break; case OPTION_NO_DEFAULT_EXCLUDES: - do_default_excludes = false; + do_default_excludes = FALSE; break; case 'x': no_idata4 = 1; @@ -3252,11 +3230,14 @@ main (ac, av) case 'S': as_name = optarg; break; + case 't': + tmp_prefix = optarg; + break; case 'f': as_flags = optarg; break; - /* ignored for compatibility */ + /* Ignored for compatibility. */ case 'u': break; case 'a': @@ -3330,6 +3311,9 @@ main (ac, av) } } + if (!tmp_prefix) + tmp_prefix = prefix_encode ("d", getpid ()); + for (i = 0; mtable[i].type; i++) if (strcmp (mtable[i].type, mname) == 0) break; @@ -3355,7 +3339,7 @@ main (ac, av) symbols in the .drectve section. The default excludes are meant to avoid exporting DLL entry point and Cygwin32 impure_ptr. */ if (! export_all_symbols) - do_default_excludes = false; + do_default_excludes = FALSE; if (do_default_excludes) set_default_excludes (); @@ -3408,10 +3392,7 @@ main (ac, av) appropriate. */ static char * -look_for_prog (prog_name, prefix, end_prefix) - const char *prog_name; - const char *prefix; - int end_prefix; +look_for_prog (const char *prog_name, const char *prefix, int end_prefix) { struct stat s; char *cmd; @@ -3477,8 +3458,7 @@ look_for_prog (prog_name, prefix, end_prefix) Returns a dynamically allocated string. */ static char * -deduce_name (prog_name) - const char *prog_name; +deduce_name (const char *prog_name) { char *cmd; char *dash, *slash, *cp; @@ -3566,21 +3546,21 @@ mcore_elf_gen_out_file (void) ptr = & fnames; ds = dyn_string_new (100); - dyn_string_append (ds, "-r "); + dyn_string_append_cstr (ds, "-r "); if (mcore_elf_linker_flags != NULL) - dyn_string_append (ds, mcore_elf_linker_flags); + dyn_string_append_cstr (ds, mcore_elf_linker_flags); while (ptr->next != NULL) { - dyn_string_append (ds, ptr->filename); - dyn_string_append (ds, " "); + dyn_string_append_cstr (ds, ptr->filename); + dyn_string_append_cstr (ds, " "); ptr = ptr->next; } - dyn_string_append (ds, "-o "); - dyn_string_append (ds, MCORE_ELF_TMP_OBJ); + dyn_string_append_cstr (ds, "-o "); + dyn_string_append_cstr (ds, MCORE_ELF_TMP_OBJ); if (mcore_elf_linker == NULL) mcore_elf_linker = deduce_name ("ld"); @@ -3590,32 +3570,31 @@ mcore_elf_gen_out_file (void) dyn_string_delete (ds); /* Step two. Create a .exp file and a .lib file from the temporary file. - Do this by recursively invoking dlltool....*/ + Do this by recursively invoking dlltool... */ ds = dyn_string_new (100); - dyn_string_append (ds, "-S "); - dyn_string_append (ds, as_name); + dyn_string_append_cstr (ds, "-S "); + dyn_string_append_cstr (ds, as_name); - dyn_string_append (ds, " -e "); - dyn_string_append (ds, MCORE_ELF_TMP_EXP); - dyn_string_append (ds, " -l "); - dyn_string_append (ds, MCORE_ELF_TMP_LIB); - dyn_string_append (ds, " " ); - dyn_string_append (ds, MCORE_ELF_TMP_OBJ); + dyn_string_append_cstr (ds, " -e "); + dyn_string_append_cstr (ds, MCORE_ELF_TMP_EXP); + dyn_string_append_cstr (ds, " -l "); + dyn_string_append_cstr (ds, MCORE_ELF_TMP_LIB); + dyn_string_append_cstr (ds, " " ); + dyn_string_append_cstr (ds, MCORE_ELF_TMP_OBJ); if (verbose) - dyn_string_append (ds, " -v"); + dyn_string_append_cstr (ds, " -v"); if (dontdeltemps) { - dyn_string_append (ds, " -n"); + dyn_string_append_cstr (ds, " -n"); if (dontdeltemps > 1) - dyn_string_append (ds, " -n"); + dyn_string_append_cstr (ds, " -n"); } /* XXX - FIME: ought to check/copy other command line options as well. */ - run (program_name, ds->s); dyn_string_delete (ds); @@ -3623,17 +3602,17 @@ mcore_elf_gen_out_file (void) /* Step four. Feed the .exp and object files to ld -shared to create the dll. */ ds = dyn_string_new (100); - dyn_string_append (ds, "-shared "); + dyn_string_append_cstr (ds, "-shared "); if (mcore_elf_linker_flags) - dyn_string_append (ds, mcore_elf_linker_flags); - - dyn_string_append (ds, " "); - dyn_string_append (ds, MCORE_ELF_TMP_EXP); - dyn_string_append (ds, " "); - dyn_string_append (ds, MCORE_ELF_TMP_OBJ); - dyn_string_append (ds, " -o "); - dyn_string_append (ds, mcore_elf_out_file); + dyn_string_append_cstr (ds, mcore_elf_linker_flags); + + dyn_string_append_cstr (ds, " "); + dyn_string_append_cstr (ds, MCORE_ELF_TMP_EXP); + dyn_string_append_cstr (ds, " "); + dyn_string_append_cstr (ds, MCORE_ELF_TMP_OBJ); + dyn_string_append_cstr (ds, " -o "); + dyn_string_append_cstr (ds, mcore_elf_out_file); run (mcore_elf_linker, ds->s); diff --git a/contrib/binutils/binutils/dlltool.h b/contrib/binutils/binutils/dlltool.h index 29c825d..f488d96 100644 --- a/contrib/binutils/binutils/dlltool.h +++ b/contrib/binutils/binutils/dlltool.h @@ -1,5 +1,5 @@ /* dlltool.h -- header file for dlltool - Copyright 1997, 1998 Free Software Foundation, Inc. + Copyright 1997, 1998, 2003, 2004 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -21,22 +21,22 @@ #include "ansidecl.h" #include -extern void def_code PARAMS ((int)); -extern void def_data PARAMS ((int)); -extern void def_description PARAMS ((const char *)); -extern void def_exports - PARAMS ((const char *, const char *, int, int, int, int)); -extern void def_heapsize PARAMS ((int, int)); +extern void def_code (int); +extern void def_data (int); +extern void def_description (const char *); +extern void def_exports (const char *, const char *, int, int, int, int, int); +extern void def_heapsize (int, int); extern void def_import - PARAMS ((const char *, const char *, const char *, const char *, int)); -extern void def_library PARAMS ((const char *, int)); -extern void def_name PARAMS ((const char *, int)); -extern void def_section PARAMS ((const char *, int)); -extern void def_stacksize PARAMS ((int, int)); -extern void def_version PARAMS ((int, int)); -extern int yyparse PARAMS ((void)); -extern int yyerror PARAMS ((const char *)); + (const char *, const char *, const char *, const char *, int); +extern void def_library (const char *, int); +extern void def_name (const char *, int); +extern void def_section (const char *, int); +extern void def_stacksize (int, int); +extern void def_version (int, int); +extern int yyparse (void); +extern int yyerror (const char *); +extern int yylex (void); + extern int yydebug; -extern int yylex PARAMS ((void)); extern FILE *yyin; extern int linenumber; diff --git a/contrib/binutils/binutils/dllwrap.c b/contrib/binutils/binutils/dllwrap.c index 4ca5936..e4db7ba 100644 --- a/contrib/binutils/binutils/dllwrap.c +++ b/contrib/binutils/binutils/dllwrap.c @@ -1,5 +1,5 @@ /* dllwrap.c -- wrapper for DLLTOOL and GCC to generate PE style DLLs - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Mumit Khan (khan@xraylith.wisc.edu). This file is part of GNU Binutils. @@ -114,17 +114,17 @@ static int delete_base_file = 1; static int delete_exp_file = 1; static int delete_def_file = 1; -static int run PARAMS ((const char *, char *)); -static char *mybasename PARAMS ((const char *)); -static int strhash PARAMS ((const char *)); -static void usage PARAMS ((FILE *, int)); -static void display PARAMS ((const char *, va_list)); -static void inform PARAMS ((const char *, ...)); -static void warn PARAMS ((const char *, ...)); -static char *look_for_prog PARAMS ((const char *, const char *, int)); -static char *deduce_name PARAMS ((const char *)); -static void delete_temp_files PARAMS ((void)); -static void cleanup_and_exit PARAMS ((int)); +static int run (const char *, char *); +static char *mybasename (const char *); +static int strhash (const char *); +static void usage (FILE *, int); +static void display (const char *, va_list); +static void inform (const char *, ...); +static void warn (const char *, ...); +static char *look_for_prog (const char *, const char *, int); +static char *deduce_name (const char *); +static void delete_temp_files (void); +static void cleanup_and_exit (int); /**********************************************************************/ @@ -137,9 +137,7 @@ static void cleanup_and_exit PARAMS ((int)); (hopefully) soon be retired in favor of `ld --shared. */ static void -display (message, args) - const char * message; - va_list args; +display (const char * message, va_list args) { if (program_name != NULL) fprintf (stderr, "%s: ", program_name); @@ -180,10 +178,7 @@ warn VPARAMS ((const char *format, ...)) appropriate. */ static char * -look_for_prog (prog_name, prefix, end_prefix) - const char *prog_name; - const char *prefix; - int end_prefix; +look_for_prog (const char *prog_name, const char *prefix, int end_prefix) { struct stat s; char *cmd; @@ -249,8 +244,7 @@ look_for_prog (prog_name, prefix, end_prefix) Returns a dynamically allocated string. */ static char * -deduce_name (prog_name) - const char *prog_name; +deduce_name (const char *prog_name) { char *cmd; char *dash, *slash, *cp; @@ -298,7 +292,7 @@ deduce_name (prog_name) } static void -delete_temp_files () +delete_temp_files (void) { if (delete_base_file && base_file_name) { @@ -349,17 +343,14 @@ delete_temp_files () } static void -cleanup_and_exit (status) - int status; +cleanup_and_exit (int status) { delete_temp_files (); exit (status); } static int -run (what, args) - const char *what; - char *args; +run (const char *what, char *args) { char *s; int pid, wait_status, retcode; @@ -445,8 +436,7 @@ run (what, args) } static char * -mybasename (name) - const char *name; +mybasename (const char *name) { const char *base = name; @@ -462,8 +452,7 @@ mybasename (name) } static int -strhash (str) - const char *str; +strhash (const char *str) { const unsigned char *s; unsigned long hash; @@ -488,9 +477,7 @@ strhash (str) /**********************************************************************/ static void -usage (file, status) - FILE *file; - int status; +usage (FILE *file, int status) { fprintf (file, _("Usage %s \n"), program_name); fprintf (file, _(" Generic options:\n")); @@ -552,7 +539,7 @@ usage (file, status) /* DLLTOOL options. */ #define OPTION_NODELETE (OPTION_MNO_CYGWIN + 1) #define OPTION_DLLNAME (OPTION_NODELETE + 1) -#define OPTION_NO_IDATA4 (OPTION_DLLNAME + 1) +#define OPTION_NO_IDATA4 (OPTION_DLLNAME + 1) #define OPTION_NO_IDATA5 (OPTION_NO_IDATA4 + 1) #define OPTION_OUTPUT_EXP (OPTION_NO_IDATA5 + 1) #define OPTION_OUTPUT_DEF (OPTION_OUTPUT_EXP + 1) @@ -611,12 +598,10 @@ static const struct option long_options[] = {0, 0, 0, 0} }; -int main PARAMS ((int, char **)); +int main (int, char **); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int c; int i; diff --git a/contrib/binutils/binutils/doc/Makefile.am b/contrib/binutils/binutils/doc/Makefile.am index 9db5819..851f205 100644 --- a/contrib/binutils/binutils/doc/Makefile.am +++ b/contrib/binutils/binutils/doc/Makefile.am @@ -45,98 +45,98 @@ binutils.info: $(binutils_TEXI) config.texi # Man page generation from texinfo addr2line.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Daddr2line < $< > addr2line.pod + -$(TEXI2POD) $(MANCONF) -Daddr2line < $(binutils_TEXI) > addr2line.pod -($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f addr2line.pod ar.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dar < $< > ar.pod + -$(TEXI2POD) $(MANCONF) -Dar < $(binutils_TEXI) > ar.pod -($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f ar.pod dlltool.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Ddlltool < $< > dlltool.pod + -$(TEXI2POD) $(MANCONF) -Ddlltool < $(binutils_TEXI) > dlltool.pod -($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f dlltool.pod nlmconv.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dnlmconv < $< > nlmconv.pod + -$(TEXI2POD) $(MANCONF) -Dnlmconv < $(binutils_TEXI) > nlmconv.pod -($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f nlmconv.pod nm.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dnm < $< > nm.pod + -$(TEXI2POD) $(MANCONF) -Dnm < $(binutils_TEXI) > nm.pod -($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f nm.pod objcopy.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dobjcopy < $< > objcopy.pod + -$(TEXI2POD) $(MANCONF) -Dobjcopy < $(binutils_TEXI) > objcopy.pod -($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f objcopy.pod objdump.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dobjdump < $< > objdump.pod + -$(TEXI2POD) $(MANCONF) -Dobjdump < $(binutils_TEXI) > objdump.pod -($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f objdump.pod ranlib.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dranlib < $< > ranlib.pod + -$(TEXI2POD) $(MANCONF) -Dranlib < $(binutils_TEXI) > ranlib.pod -($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f ranlib.pod readelf.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dreadelf < $< > readelf.pod + -$(TEXI2POD) $(MANCONF) -Dreadelf < $(binutils_TEXI) > readelf.pod -($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f readelf.pod size.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dsize < $< > size.pod + -$(TEXI2POD) $(MANCONF) -Dsize < $(binutils_TEXI) > size.pod -($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f size.pod strings.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dstrings < $< > strings.pod + -$(TEXI2POD) $(MANCONF) -Dstrings < $(binutils_TEXI) > strings.pod -($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f strings.pod strip.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dstrip < $< > strip.pod + -$(TEXI2POD) $(MANCONF) -Dstrip < $(binutils_TEXI) > strip.pod -($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f strip.pod windres.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dwindres < $< > windres.pod + -$(TEXI2POD) $(MANCONF) -Dwindres < $(binutils_TEXI) > windres.pod -($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f windres.pod cxxfilt.man: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $< > $(DEMANGLER_NAME).pod + -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod -($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f $(DEMANGLER_NAME).pod diff --git a/contrib/binutils/binutils/doc/Makefile.in b/contrib/binutils/binutils/doc/Makefile.in index eeef90f..e05f5be 100644 --- a/contrib/binutils/binutils/doc/Makefile.in +++ b/contrib/binutils/binutils/doc/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am +# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation @@ -113,7 +113,6 @@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ STRIP = @STRIP@ -UNDERSCORE = @UNDERSCORE@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -445,98 +444,98 @@ binutils.info: $(binutils_TEXI) config.texi # Man page generation from texinfo addr2line.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Daddr2line < $< > addr2line.pod + -$(TEXI2POD) $(MANCONF) -Daddr2line < $(binutils_TEXI) > addr2line.pod -($(POD2MAN) addr2line.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f addr2line.pod ar.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dar < $< > ar.pod + -$(TEXI2POD) $(MANCONF) -Dar < $(binutils_TEXI) > ar.pod -($(POD2MAN) ar.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f ar.pod dlltool.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Ddlltool < $< > dlltool.pod + -$(TEXI2POD) $(MANCONF) -Ddlltool < $(binutils_TEXI) > dlltool.pod -($(POD2MAN) dlltool.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f dlltool.pod nlmconv.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dnlmconv < $< > nlmconv.pod + -$(TEXI2POD) $(MANCONF) -Dnlmconv < $(binutils_TEXI) > nlmconv.pod -($(POD2MAN) nlmconv.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f nlmconv.pod nm.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dnm < $< > nm.pod + -$(TEXI2POD) $(MANCONF) -Dnm < $(binutils_TEXI) > nm.pod -($(POD2MAN) nm.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f nm.pod objcopy.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dobjcopy < $< > objcopy.pod + -$(TEXI2POD) $(MANCONF) -Dobjcopy < $(binutils_TEXI) > objcopy.pod -($(POD2MAN) objcopy.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f objcopy.pod objdump.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dobjdump < $< > objdump.pod + -$(TEXI2POD) $(MANCONF) -Dobjdump < $(binutils_TEXI) > objdump.pod -($(POD2MAN) objdump.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f objdump.pod ranlib.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dranlib < $< > ranlib.pod + -$(TEXI2POD) $(MANCONF) -Dranlib < $(binutils_TEXI) > ranlib.pod -($(POD2MAN) ranlib.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f ranlib.pod readelf.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dreadelf < $< > readelf.pod + -$(TEXI2POD) $(MANCONF) -Dreadelf < $(binutils_TEXI) > readelf.pod -($(POD2MAN) readelf.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f readelf.pod size.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dsize < $< > size.pod + -$(TEXI2POD) $(MANCONF) -Dsize < $(binutils_TEXI) > size.pod -($(POD2MAN) size.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f size.pod strings.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dstrings < $< > strings.pod + -$(TEXI2POD) $(MANCONF) -Dstrings < $(binutils_TEXI) > strings.pod -($(POD2MAN) strings.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f strings.pod strip.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dstrip < $< > strip.pod + -$(TEXI2POD) $(MANCONF) -Dstrip < $(binutils_TEXI) > strip.pod -($(POD2MAN) strip.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f strip.pod windres.1: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dwindres < $< > windres.pod + -$(TEXI2POD) $(MANCONF) -Dwindres < $(binutils_TEXI) > windres.pod -($(POD2MAN) windres.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f windres.pod cxxfilt.man: $(binutils_TEXI) touch $@ - -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $< > $(DEMANGLER_NAME).pod + -$(TEXI2POD) $(MANCONF) -Dcxxfilt < $(binutils_TEXI) > $(DEMANGLER_NAME).pod -($(POD2MAN) $(DEMANGLER_NAME).pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) rm -f $(DEMANGLER_NAME).pod diff --git a/contrib/binutils/binutils/doc/addr2line.1 b/contrib/binutils/binutils/doc/addr2line.1 index f343f5d..5808d65 100644 --- a/contrib/binutils/binutils/doc/addr2line.1 +++ b/contrib/binutils/binutils/doc/addr2line.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== @@ -21,7 +21,6 @@ .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will @@ -129,8 +128,7 @@ .\" ======================================================================== .\" .IX Title "ADDR2LINE 1" -.TH ADDR2LINE 1 "2002-08-05" "binutils-2.12.91" "GNU Development Tools" -.UC +.TH ADDR2LINE 1 "2004-04-09" "binutils-2.14.91" "GNU Development Tools" .SH "NAME" addr2line \- convert addresses into file names and line numbers. .SH "SYNOPSIS" @@ -221,11 +219,12 @@ Display only the base of each file name. Info entries for \fIbinutils\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" -Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, +2001, 2002, 2003 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document under the terms of the \s-1GNU\s0 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 \*(L"\s-1GNU\s0 Free Documentation License\*(R". +section entitled ``\s-1GNU\s0 Free Documentation License''. diff --git a/contrib/binutils/binutils/doc/ar.1 b/contrib/binutils/binutils/doc/ar.1 index b17417c..6708cf4 100644 --- a/contrib/binutils/binutils/doc/ar.1 +++ b/contrib/binutils/binutils/doc/ar.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== @@ -21,7 +21,6 @@ .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will @@ -129,8 +128,7 @@ .\" ======================================================================== .\" .IX Title "AR 1" -.TH AR 1 "2002-08-05" "binutils-2.12.91" "GNU Development Tools" -.UC +.TH AR 1 "2004-04-09" "binutils-2.14.91" "GNU Development Tools" .SH "NAME" ar \- create, modify, and extract from archives .SH "SYNOPSIS" @@ -229,7 +227,7 @@ index is not updated, even if it already existed; you can use \fBar s\fR or \&\fBranlib\fR explicitly to update the symbol table index. .Sp However, too many different systems assume quick append rebuilds the -index, so \s-1GNU\s0 ar implements \f(CW\*(C`q\*(C'\fR as a synonym for \f(CW\*(C`r\*(C'\fR. +index, so \s-1GNU\s0 \fBar\fR implements \fBq\fR as a synonym for \fBr\fR. .IP "\fBr\fR" 4 .IX Item "r" Insert the files \fImember\fR... into \fIarchive\fR (with @@ -368,11 +366,12 @@ which is the default for \s-1AIX\s0 \fBar\fR. \&\fInm\fR\|(1), \fIranlib\fR\|(1), and the Info entries for \fIbinutils\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" -Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, +2001, 2002, 2003 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document under the terms of the \s-1GNU\s0 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 \*(L"\s-1GNU\s0 Free Documentation License\*(R". +section entitled ``\s-1GNU\s0 Free Documentation License''. diff --git a/contrib/binutils/binutils/doc/binutils.texi b/contrib/binutils/binutils/doc/binutils.texi index 3006d9e..2e78720 100644 --- a/contrib/binutils/binutils/doc/binutils.texi +++ b/contrib/binutils/binutils/doc/binutils.texi @@ -1,6 +1,6 @@ \input texinfo @c -*- Texinfo -*- @setfilename binutils.info -@c Copyright 2001, 2002 Free Software Foundation, Inc. +@c Copyright 2001, 2002, 2003 Free Software Foundation, Inc. @include config.texi @@ -29,14 +29,15 @@ END-INFO-DIR-ENTRY @ifinfo @c man begin COPYRIGHT -Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, +2001, 2002, 2003 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the -section entitled "GNU Free Documentation License". +section entitled ``GNU Free Documentation License''. @c man end @ignore @@ -53,7 +54,8 @@ notice identical to this one except for the removal of this paragraph @c This file documents the GNU binary utilities "ar", "ld", "objcopy", @c "objdump", "nm", "size", "strings", "strip", "readelf" and "ranlib". @c -@c Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +@c Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, +@c 2002, 2003 Free Software Foundation, Inc. @c @c This text may be freely distributed under the terms of the GNU @c Free Documentation License. @@ -78,14 +80,15 @@ notice identical to this one except for the removal of this paragraph @end tex @vskip 0pt plus 1filll -Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 1998, 2000, 2001, +2002, 2003 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the - section entitled "GNU Free Documentation License". + section entitled ``GNU Free Documentation License''. @end titlepage @@ -93,7 +96,7 @@ Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 1998, 2000, 2001, 2002 Free @top Introduction @cindex version -This brief manual contains preliminary documentation for the @sc{gnu} binary +This brief manual contains documentation for the @sc{gnu} binary utilities (collectively version @value{VERSION}): @iftex @@ -238,7 +241,7 @@ program. @page @node ar cmdline -@section Controlling @command{ar} on the command line +@section Controlling @command{ar} on the Command Line @smallexample @c man begin SYNOPSIS ar @@ -314,7 +317,7 @@ index is not updated, even if it already existed; you can use @samp{ar s} or @command{ranlib} explicitly to update the symbol table index. However, too many different systems assume quick append rebuilds the -index, so GNU ar implements @code{q} as a synonym for @code{r}. +index, so @sc{gnu} @command{ar} implements @samp{q} as a synonym for @samp{r}. @item r @cindex replacement in archive @@ -464,7 +467,7 @@ This modifier shows the version number of @command{ar}. @command{ar} ignores an initial option spelt @samp{-X32_64}, for compatibility with AIX. The behaviour produced by this option is the -default for GNU @command{ar}. @command{ar} does not support any of the other +default for @sc{gnu} @command{ar}. @command{ar} does not support any of the other @samp{-X} options; in particular, it does not support @option{-X32} which is the default for AIX @command{ar}. @@ -477,7 +480,7 @@ nm(1), ranlib(1), and the Info entries for @file{binutils}. @end ignore @node ar scripts -@section Controlling @command{ar} with a script +@section Controlling @command{ar} with a Script @smallexample ar -M [ <@var{script} ] @@ -716,7 +719,7 @@ object file formats permit more efficient access to small data objects, such as a global int variable as opposed to a large global array. @item I -The symbol is an indirect reference to another symbol. This is a GNU +The symbol is an indirect reference to another symbol. This is a @sc{gnu} extension to the a.out object file format which is rarely used. @item N @@ -854,7 +857,7 @@ Equivalent to @samp{-f posix}. @item -S @itemx --print-size -Print size of defined symbols for the @code{bsd} output format. +Print size, not the value, of defined symbols for the @code{bsd} output format. @item -s @itemx --print-armap @@ -871,7 +874,9 @@ last come first. @item --size-sort Sort symbols by size. The size is computed as the difference between the value of the symbol and the value of the symbol with the next higher -value. The size of the symbol is printed, rather than the value. +value. If the @code{bsd} output format is used the size of the symbol +is printed, rather than the value, and @samp{-S} must be used in order +both size and value to be printed. @item -t @var{radix} @itemx --radix=@var{radix} @@ -927,21 +932,26 @@ objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}] [@option{-I} @var{bfdname}|@option{--input-target=}@var{bfdname}] [@option{-O} @var{bfdname}|@option{--output-target=}@var{bfdname}] [@option{-B} @var{bfdarch}|@option{--binary-architecture=}@var{bfdarch}] - [@option{-S}|@option{--strip-all}] [@option{-g}|@option{--strip-debug}] + [@option{-S}|@option{--strip-all}] + [@option{-g}|@option{--strip-debug}] [@option{-K} @var{symbolname}|@option{--keep-symbol=}@var{symbolname}] [@option{-N} @var{symbolname}|@option{--strip-symbol=}@var{symbolname}] [@option{-G} @var{symbolname}|@option{--keep-global-symbol=}@var{symbolname}] [@option{-L} @var{symbolname}|@option{--localize-symbol=}@var{symbolname}] [@option{-W} @var{symbolname}|@option{--weaken-symbol=}@var{symbolname}] - [@option{-x}|@option{--discard-all}] [@option{-X}|@option{--discard-locals}] + [@option{-w}|@option{--wildcard}] + [@option{-x}|@option{--discard-all}] + [@option{-X}|@option{--discard-locals}] [@option{-b} @var{byte}|@option{--byte=}@var{byte}] [@option{-i} @var{interleave}|@option{--interleave=}@var{interleave}] [@option{-j} @var{sectionname}|@option{--only-section=}@var{sectionname}] [@option{-R} @var{sectionname}|@option{--remove-section=}@var{sectionname}] [@option{-p}|@option{--preserve-dates}] [@option{--debugging}] - [@option{--gap-fill=}@var{val}] [@option{--pad-to=}@var{address}] - [@option{--set-start=}@var{val}] [@option{--adjust-start=}@var{incr}] + [@option{--gap-fill=}@var{val}] + [@option{--pad-to=}@var{address}] + [@option{--set-start=}@var{val}] + [@option{--adjust-start=}@var{incr}] [@option{--change-addresses=}@var{incr}] [@option{--change-section-address} @var{section}@{=,+,-@}@var{val}] [@option{--change-section-lma} @var{section}@{=,+,-@}@var{val}] @@ -950,19 +960,29 @@ objcopy [@option{-F} @var{bfdname}|@option{--target=}@var{bfdname}] [@option{--set-section-flags} @var{section}=@var{flags}] [@option{--add-section} @var{sectionname}=@var{filename}] [@option{--rename-section} @var{oldname}=@var{newname}[,@var{flags}]] - [@option{--change-leading-char} ] [@option{--remove-leading-char}] - [@option{--srec-len=}@var{ival} ] [@option{--srec-forceS3}] - [@option{--redefine-sym} @var{old}=@var{new} ] + [@option{--change-leading-char}] [@option{--remove-leading-char}] + [@option{--srec-len=}@var{ival}] [@option{--srec-forceS3}] + [@option{--redefine-sym} @var{old}=@var{new}] + [@option{--redefine-syms=}@var{filename}] [@option{--weaken}] [@option{--keep-symbols=}@var{filename}] [@option{--strip-symbols=}@var{filename}] [@option{--keep-global-symbols=}@var{filename}] [@option{--localize-symbols=}@var{filename}] [@option{--weaken-symbols=}@var{filename}] - [@option{--alt-machine-code=@var{index}}] + [@option{--alt-machine-code=}@var{index}] + [@option{--prefix-symbols=}@var{string}] + [@option{--prefix-sections=}@var{string}] + [@option{--prefix-alloc-sections=}@var{string}] + [@option{--add-gnu-debuglink=}@var{path-to-file}] + [@option{--only-keep-debug}] + [@option{--writable-text}] + [@option{--readonly-text}] + [@option{--pure}] + [@option{--impure}] [@option{-v}|@option{--verbose}] [@option{-V}|@option{--version}] - [@option{--help}] + [@option{--help}] [@option{--info}] @var{infile} [@var{outfile}] @c man end @end smallexample @@ -998,10 +1018,10 @@ use @option{-S} to remove sections containing debugging information. In some cases @option{-R} will be useful to remove sections which contain information that is not needed by the binary file. -Note - @command{objcopy} is not able to change the endianness of its input -files. If the input format has an endianness, (some formats do not), +Note---@command{objcopy} is not able to change the endianness of its input +files. If the input format has an endianness (some formats do not), @command{objcopy} can only copy the inputs into file formats that have the -same endianness or which have no endianness (eg @samp{srec}). +same endianness or which have no endianness (e.g., @samp{srec}). @c man end @@ -1060,7 +1080,7 @@ Do not copy relocation and symbol information from the source file. @item -g @itemx --strip-debug -Do not copy debugging symbols from the source file. +Do not copy debugging symbols or sections from the source file. @item --strip-unneeded Strip all symbols that are not needed for relocation processing. @@ -1090,6 +1110,22 @@ visible externally. This option may be given more than once. @itemx --weaken-symbol=@var{symbolname} Make symbol @var{symbolname} weak. This option may be given more than once. +@item -w +@itemx --wildcard +Permit regular expressions in @var{symbolname}s used in other command +line options. The question mark (?), asterisk (*), backslash (\) and +square brackets ([]) operators can be used anywhere in the symbol +name. If the first character of the symbol name is the exclamation +point (!) then the sense of the switch is reversed for that symbol. +For example: + +@smallexample + -w -W !foo -W fo* +@end smallexample + +would cause objcopy to weaken all symbols that start with ``fo'' +except for the symbol ``foo''. + @item -x @itemx --discard-all Do not copy non-global symbols from the source file. @@ -1276,6 +1312,12 @@ Change the name of a symbol @var{old}, to @var{new}. This can be useful when one is trying link two things together for which you have no source, and there are name collisions. +@item --redefine-syms=@var{filename} +Apply @option{--redefine-sym} to each symbol pair "@var{old} @var{new}" +listed in the file @var{filename}. @var{filename} is simply a flat file, +with one symbol pair per line. Line comments may be introduced by the hash +character. This option may be given more than once. + @item --weaken Change all global symbols in the file to be weak. This can be useful when building an object which will be linked against other objects using @@ -1319,6 +1361,73 @@ a machine is assigned an official code and the tool-chain adopts the new code, but other applications still depend on the original code being used. +@item --writable-text +Mark the output text as writable. This option isn't meaningful for all +object file formats. + +@item --readonly-text +Make the output text write protected. This option isn't meaningful for all +object file formats. + +@item --pure +Mark the output file as demand paged. This option isn't meaningful for all +object file formats. + +@item --impure +Mark the output file as impure. This option isn't meaningful for all +object file formats. + +@item --prefix-symbols=@var{string} +Prefix all symbols in the output file with @var{string}. + +@item --prefix-sections=@var{string} +Prefix all section names in the output file with @var{string}. + +@item --prefix-alloc-sections=@var{string} +Prefix all the names of all allocated sections in the output file with +@var{string}. + +@item --add-gnu-debuglink=@var{path-to-file} +Creates a .gnu_debuglink section which contains a reference to @var{path-to-file} +and adds it to the output file. + +@item --only-keep-debug +Strip a file, removing any sections that would be stripped by +@option{--strip-debug} and leaving the debugging sections. + +The intention is that this option will be used in conjunction with +@option{--add-gnu-debuglink} to create a two part executable. One a +stripped binary which will occupy less space in RAM and in a +distribution and the second a debugging information file which is only +needed if debugging abilities are required. The suggested procedure +to create these files is as follows: + +@enumerate +@item Link the executable as normal. Assuming that is is called +@code{foo} then... +@item Run @code{objcopy --only-keep-debug foo foo.dbg} to +create a file containing the debugging info. +@item Run @code{objcopy --strip-debug foo} to create a +stripped executable. +@item Run @code{objcopy --add-gnu-debuglink=foo.dbg foo} +to add a link to the debugging info into the stripped executable. +@end enumerate + +Note - the choice of @code{.dbg} as an extension for the debug info +file is arbitrary. Also the @code{--only-keep-debug} step is +optional. You could instead do this: + +@enumerate +@item Link the executable as normal. +@item Copy @code{foo} to @code{foo.full} +@item Run @code{objcopy --strip-debug foo} +@item Run @code{objcopy --add-gnu-debuglink=foo.full foo} +@end enumerate + +ie the file pointed to by the @option{--add-gnu-debuglink} can be the +full executable. It does not have to be a file created by the +@option{--only-keep-debug} switch. + @item -V @itemx --version Show the version number of @command{objcopy}. @@ -1330,6 +1439,9 @@ archives, @samp{objcopy -V} lists all members of the archive. @item --help Show a summary of the options to @command{objcopy}. + +@item --info +Display a list showing all architectures and object formats available. @end table @c man end @@ -1360,6 +1472,7 @@ objdump [@option{-a}|@option{--archive-headers}] [@option{-f}|@option{--file-headers}] [@option{--file-start-context}] [@option{-g}|@option{--debugging}] + [@option{-e}|@option{--debugging-tags}] [@option{-h}|@option{--section-headers}|@option{--headers}] [@option{-i}|@option{--info}] [@option{-j} @var{section}|@option{--section=}@var{section}] @@ -1405,7 +1518,7 @@ object files. The long and short forms of options, shown here as alternatives, are equivalent. At least one option from the list -@option{-a,-d,-D,-f,-g,-G,-h,-H,-p,-r,-R,-S,-t,-T,-V,-x} must be given. +@option{-a,-d,-D,-e,-f,-g,-G,-h,-H,-p,-r,-R,-s,-S,-t,-T,-V,-x} must be given. @table @env @item -a @@ -1453,11 +1566,18 @@ 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 +@item -g +@itemx --debugging Display debugging information. This attempts to parse debugging information stored in the file and print it out using a C like syntax. Only certain types of debugging information have been implemented. +Some other types are supported by @command{readelf -w}. +@xref{readelf}. + +@item -e +@itemx --debugging-tags +Like @option{-g}, but the information is generated in a format compatible +with ctags tool. @item -d @itemx --disassemble @@ -1476,11 +1596,6 @@ those expected to contain instructions. When disassembling, print the complete address on each line. This is the older disassembly format. -@item --disassemble-zeroes -Normally the disassembly output will skip blocks of zeroes. This -option directs the disassembler to disassemble those blocks, just like -any other data. - @item -EB @itemx -EL @itemx --endian=@{big|little@} @@ -1491,7 +1606,7 @@ disassembly. This can be useful when disassembling a file format which does not describe endianness information, such as S-records. @item -f -@itemx --file-header +@itemx --file-headers @cindex object file header Display summary information from the overall header of each of the @var{objfile} files. @@ -1503,8 +1618,8 @@ Specify that when displaying interlisted source code/disassembly context to the start of the file. @item -h -@itemx --section-header -@itemx --header +@itemx --section-headers +@itemx --headers @cindex section headers Display summary information from the section headers of the object file. @@ -1518,7 +1633,8 @@ although @command{ld} relocates the sections correctly, using @samp{objdump Instead, it shows the usual addresses, which are implicit for the target. -@item --help +@item -H +@itemx --help Print a summary of the options to @command{objdump} and exit. @item -i @@ -1552,7 +1668,9 @@ architectures with the @option{-i} option. @item -M @var{options} @itemx --disassembler-options=@var{options} Pass target specific information to the disassembler. Only supported on -some targets. +some targets. If it is necessary to specify more than one +disassembler option then multiple @option{-M} options can be used or +can be placed together into a comma separated list. If the target is an ARM architecture then this switch can be used to select which register name set is used during disassembler. Specifying @@ -1566,7 +1684,7 @@ just use @samp{r} followed by the register number. There are also two variants on the APCS register naming scheme enabled by @option{-M reg-names-atpcs} and @option{-M reg-names-special-atpcs} which use the ARM/Thumb Procedure Call Standard naming conventions. (Either -with the normal register name or the special register names). +with the normal register names or the special register names). This option can also be used for ARM architectures to force the disassembler to interpret all instructions as Thumb instructions by @@ -1584,13 +1702,55 @@ intel syntax mode and AT&T syntax mode. @option{addr32}, address size and operand size. These four options will be overridden if @option{x86-64}, @option{i386} or @option{i8086} appear later in the option string. Lastly, @option{suffix}, when in AT&T mode, -instructs the dissassembler to print a mnemonic suffix even when the +instructs the disassembler to print a mnemonic suffix even when the suffix could be inferred by the operands. For PPC, @option{booke}, @option{booke32} and @option{booke64} select disassembly of BookE instructions. @option{32} and @option{64} select PowerPC and PowerPC64 disassembly, respectively. +For MIPS, this option controls the printing of register names in +disassembled instructions. Multiple selections from the +following may be specified as a comma separated string, and invalid +options are ignored: + +@table @code +@item gpr-names=@var{ABI} +Print GPR (general-purpose register) names as appropriate +for the specified ABI. By default, GPR names are selected according to +the ABI of the binary being disassembled. + +@item fpr-names=@var{ABI} +Print FPR (floating-point register) names as +appropriate for the specified ABI. By default, FPR numbers are printed +rather than names. + +@item cp0-names=@var{ARCH} +Print CP0 (system control coprocessor; coprocessor 0) register names +as appropriate for the CPU or architecture specified by +@var{ARCH}. By default, CP0 register names are selected according to +the architecture and CPU of the binary being disassembled. + +@item hwr-names=@var{ARCH} +Print HWR (hardware register, used by the @code{rdhwr} instruction) names +as appropriate for the CPU or architecture specified by +@var{ARCH}. By default, HWR names are selected according to +the architecture and CPU of the binary being disassembled. + +@item reg-names=@var{ABI} +Print GPR and FPR names as appropriate for the selected ABI. + +@item reg-names=@var{ARCH} +Print CPU-specific register names (CP0 register and HWR names) +as appropriate for the selected CPU or architecture. +@end table + +For any of the options listed above, @var{ABI} or +@var{ARCH} may be specified as @samp{numeric} to have numbers printed +rather than names, for the selected types of registers. +You can list the available values of @var{ABI} and @var{ARCH} using +the @option{--help} option. + @item -p @itemx --private-headers Print information that is specific to the object file format. The exact @@ -1615,7 +1775,8 @@ libraries. @itemx --full-contents @cindex sections, full contents @cindex object file sections -Display the full contents of any sections requested. +Display the full contents of any sections requested. By default all +non-empty sections are displayed. @item -S @itemx --source @@ -1634,7 +1795,7 @@ When disassembling instructions, do not print the instruction bytes. This is the default when @option{--prefix-addresses} is used. @item -G -@item --stabs +@itemx --stabs @cindex stab @cindex .stab @cindex debug symbols @@ -1675,11 +1836,12 @@ meaningful for dynamic objects, such as certain types of shared libraries. This is similar to the information provided by the @samp{nm} program when given the @option{-D} (@option{--dynamic}) option. -@item --version +@item -V +@itemx --version Print the version number of @command{objdump} and exit. @item -x -@itemx --all-header +@itemx --all-headers @cindex all header information, object file @cindex header information, all Display all available header information, including the symbol table and @@ -1691,6 +1853,12 @@ relocation entries. Using @option{-x} is equivalent to specifying all of @cindex wide output, printing Format some lines for output devices that have more than 80 columns. Also do not truncate symbol names when they are displayed. + +@item -z +@itemx --disassemble-zeroes +Normally the disassembly output will skip blocks of zeroes. This +option directs the disassembler to disassemble those blocks, just like +any other data. @end table @c man end @@ -1942,11 +2110,11 @@ octal, @samp{x} for hexadecimal, or @samp{d} for decimal. @item -e @var{encoding} @itemx --encoding=@var{encoding} Select the character encoding of the strings that are to be found. -Possible values for @var{encoding} are: @samp{s} = single-byte -characters (ASCII, ISO 8859, etc., default), @samp{b} = 16-bit -Bigendian, @samp{l} = 16-bit Littleendian, @samp{B} = 32-bit Bigendian, -@samp{L} = 32-bit Littleendian. Useful for finding wide character -strings. +Possible values for @var{encoding} are: @samp{s} = single-7-bit-byte +characters (ASCII, ISO 8859, etc., default), @samp{S} = +single-8-bit-byte characters, @samp{b} = 16-bit bigendian, @samp{l} = +16-bit littleendian, @samp{B} = 32-bit bigendian, @samp{L} = 32-bit +littleendian. Useful for finding wide character strings. @item --target=@var{bfdname} @cindex object code format @@ -1979,16 +2147,20 @@ and the Info entries for @file{binutils}. @smallexample @c man begin SYNOPSIS strip -strip [@option{-F} @var{bfdname} |@option{--target=}@var{bfdname} ] - [@option{-I} @var{bfdname} |@option{--input-target=}@var{bfdname} ] - [@option{-O} @var{bfdname} |@option{--output-target=}@var{bfdname} ] - [@option{-s}|@option{--strip-all}] [@option{-S}|@option{-g}|@option{-d}|@option{--strip-debug}] - [@option{-K} @var{symbolname} |@option{--keep-symbol=}@var{symbolname} ] - [@option{-N} @var{symbolname} |@option{--strip-symbol=}@var{symbolname} ] - [@option{-x}|@option{--discard-all} ] [@option{-X} |@option{--discard-locals}] - [@option{-R} @var{sectionname} |@option{--remove-section=}@var{sectionname} ] - [@option{-o} @var{file} ] [@option{-p}|@option{--preserve-dates}] - [@option{-v} |@option{--verbose}] [@option{-V}|@option{--version}] [@option{--help}] +strip [@option{-F} @var{bfdname} |@option{--target=}@var{bfdname}] + [@option{-I} @var{bfdname} |@option{--input-target=}@var{bfdname}] + [@option{-O} @var{bfdname} |@option{--output-target=}@var{bfdname}] + [@option{-s}|@option{--strip-all}] + [@option{-S}|@option{-g}|@option{-d}|@option{--strip-debug}] + [@option{-K} @var{symbolname} |@option{--keep-symbol=}@var{symbolname}] + [@option{-N} @var{symbolname} |@option{--strip-symbol=}@var{symbolname}] + [@option{-w}|@option{--wildcard}] + [@option{-x}|@option{--discard-all}] [@option{-X} |@option{--discard-locals}] + [@option{-R} @var{sectionname} |@option{--remove-section=}@var{sectionname}] + [@option{-o} @var{file}] [@option{-p}|@option{--preserve-dates}] + [@option{--only-keep-debug}] + [@option{-v} |@option{--verbose}] [@option{-V}|@option{--version}] + [@option{--help}] [@option{--info}] @var{objfile}@dots{} @c man end @end smallexample @@ -2016,7 +2188,10 @@ code format @var{bfdname}, and rewrite it in the same format. @item --help Show a summary of the options to @command{strip} and exit. -@item -I @var{bfdname} +@item --info +Display a list showing all architectures and object formats available. + +@item -I @var{bfdname} @itemx --input-target=@var{bfdname} Treat the original @var{objfile} as a file with the object code format @var{bfdname}. @@ -2066,6 +2241,22 @@ argument may be specified. @itemx --preserve-dates Preserve the access and modification dates of the file. +@item -w +@itemx --wildcard +Permit regular expressions in @var{symbolname}s used in other command +line options. The question mark (?), asterisk (*), backslash (\) and +square brackets ([]) operators can be used anywhere in the symbol +name. If the first character of the symbol name is the exclamation +point (!) then the sense of the switch is reversed for that symbol. +For example: + +@smallexample + -w -K !foo -K fo* +@end smallexample + +would cause strip to only keep symbols that start with the letters +``fo'', but to discard the symbol ``foo''. + @item -x @itemx --discard-all Remove non-global symbols. @@ -2075,6 +2266,43 @@ Remove non-global symbols. Remove compiler-generated local symbols. (These usually start with @samp{L} or @samp{.}.) +@item --only-keep-debug +Strip a file, removing any sections that would be stripped by +@option{--strip-debug} and leaving the debugging sections. + +The intention is that this option will be used in conjunction with +@option{--add-gnu-debuglink} to create a two part executable. One a +stripped binary which will occupy less space in RAM and in a +distribution and the second a debugging information file which is only +needed if debugging abilities are required. The suggested procedure +to create these files is as follows: + +@enumerate +@item Link the executable as normal. Assuming that is is called +@code{foo} then... +@item Run @code{objcopy --only-keep-debug foo foo.dbg} to +create a file containing the debugging info. +@item Run @code{objcopy --strip-debug foo} to create a +stripped executable. +@item Run @code{objcopy --add-gnu-debuglink=foo.dbg foo} +to add a link to the debugging info into the stripped executable. +@end enumerate + +Note - the choice of @code{.dbg} as an extension for the debug info +file is arbitrary. Also the @code{--only-keep-debug} step is +optional. You could instead do this: + +@enumerate +@item Link the executable as normal. +@item Copy @code{foo} to @code{foo.full} +@item Run @code{strip --strip-debug foo} +@item Run @code{objcopy --add-gnu-debuglink=foo.full foo} +@end enumerate + +ie the file pointed to by the @option{--add-gnu-debuglink} can be the +full executable. It does not have to be a file created by the +@option{--only-keep-debug} switch. + @item -V @itemx --version Show the version number for @command{strip}. @@ -2106,6 +2334,7 @@ the Info entries for @file{binutils}. c++filt [@option{-_}|@option{--strip-underscores}] [@option{-j}|@option{--java}] [@option{-n}|@option{--no-strip-underscores}] + [@option{-p}|@option{--no-params}] [@option{-s} @var{format}|@option{--format=}@var{format}] [@option{--help}] [@option{--version}] [@var{symbol}@dots{}] @c man end @@ -2161,25 +2390,36 @@ syntax. @itemx --no-strip-underscores Do not remove the initial underscore. +@item -p +@itemx --no-params +When demangling the name of a function, do not display the types of +the function's parameters. + @item -s @var{format} @itemx --format=@var{format} -@sc{gnu} @command{nm} can decode three different methods of mangling, used by -different C++ compilers. The argument to this option selects which +@command{c++filt} can decode various methods of mangling, used by +different compilers. The argument to this option selects which method it uses: @table @code +@item auto +Automatic selection based on executable (the default method) @item gnu -the one used by the @sc{gnu} compiler (the default method) +the one used by the @sc{gnu} C++ compiler (g++) @item lucid -the one used by the Lucid compiler +the one used by the Lucid compiler (lcc) @item arm the one specified by the C++ Annotated Reference Manual @item hp -the one used by the HP compiler +the one used by the HP compiler (aCC) @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. +@item gnu-v3 +the one used by the @sc{gnu} C++ compiler (g++) with the V3 ABI. +@item java +the one used by the @sc{gnu} Java compiler (gcj) +@item gnat +the one used by the @sc{gnu} Ada compiler (GNAT). @end table @item --help @@ -2497,9 +2737,11 @@ The name of the output file. If this option is not used, then @command{windres} will use the first non-option argument, after any used for the input file name, as the output file name. If there is no non-option argument, then @command{windres} will write to standard output. -@command{windres} can not write a COFF file to standard output. +@command{windres} can not write a COFF file to standard output. Note, +for compatability with @command{rc} the option @option{-fo} is also +accepted, but its use is not recommended. -@item -I @var{format} +@item -J @var{format} @itemx --input-format @var{format} The input format to read. @var{format} may be @samp{res}, @samp{rc}, or @samp{coff}. If no input format is specified, @command{windres} will @@ -2527,21 +2769,36 @@ preprocessor first. This option may be used to specify the preprocessor to use, including any leading arguments. The default preprocessor argument is @code{gcc -E -xc-header -DRC_INVOKED}. -@item --include-dir @var{directory} +@item -I @var{directory} +@itemx --include-dir @var{directory} Specify an include directory to use when reading an @code{rc} file. @command{windres} will pass this to the preprocessor as an @option{-I} option. @command{windres} will also search this directory when looking for -files named in the @code{rc} file. +files named in the @code{rc} file. If the argument passed to this command +matches any of the supported @var{formats} (as descrived in the @option{-J} +option), it will issue a deprecation warning, and behave just like the +@option{-J} option. New programs should not use this behaviour. If a +directory happens to match a @var{format}, simple prefix it with @samp{./} +to disable the backward compatibility. @item -D @var{target} @itemx --define @var{sym}[=@var{val}] Specify a @option{-D} option to pass to the preprocessor when reading an @code{rc} file. +@item -U @var{target} +@itemx --undefine @var{sym} +Specify a @option{-U} option to pass to the preprocessor when reading an +@code{rc} file. + +@item -r +Ignored for compatibility with rc. + @item -v Enable verbose mode. This tells you what the preprocessor is if you didn't specify one. +@item -l @var{val} @item --language @var{val} Specify the default language to use when reading an @code{rc} file. @var{val} should be a hexadecimal language code. The low eight bits are @@ -2558,9 +2815,11 @@ go the console). Use popen, not a temporary file, to read the output of the preprocessor. This is the default behaviour. +@item -h @item --help Prints a usage summary. +@item -V @item --version Prints the version number for @command{windres}. @@ -2607,7 +2866,8 @@ dlltool [@option{-d}|@option{--input-def} @var{def-file-name}] [@option{-a}|@option{--add-indirect}] [@option{-U}|@option{--add-underscore}] [@option{-k}|@option{--kill-at}] [@option{-A}|@option{--add-stdcall-alias}] [@option{-x}|@option{--no-idata4}] [@option{-c}|@option{--no-idata5}] [@option{-i}|@option{--interwork}] - [@option{-n}|@option{--nodelete}] [@option{-v}|@option{--verbose}] + [@option{-n}|@option{--nodelete}] [@option{-t}|@option{--temp-prefix} @var{prefix}] + [@option{-v}|@option{--verbose}] [@option{-h}|@option{--help}] [@option{-V}|@option{--version}] [object-file @dots{}] @c man end @@ -2817,7 +3077,13 @@ between ARM and Thumb code. Makes @command{dlltool} preserve the temporary assembler files it used to create the exports file. If this option is repeated then dlltool will also preserve the temporary object files it uses to create the library -file. +file. + +@item -t @var{prefix} +@itemx --temp-prefix @var{prefix} +Makes @command{dlltool} use @var{prefix} when constructing the names of +temporary assembler and object files. By default, the temp file prefix +is generated from the pid. @item -v @itemx --verbose @@ -2862,10 +3128,12 @@ readelf [@option{-a}|@option{--all}] [@option{-u}|@option{--unwind}] [@option{-d}|@option{--dynamic}] [@option{-V}|@option{--version-info}] + [@option{-A}|@option{--arch-specific}] [@option{-D}|@option{--use-dynamic}] [@option{-x} |@option{--hex-dump=}] - [@option{-w[liaprmfFso]}|@option{--debug-dump}[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=str,=loc]] - [@option{-histogram}] + [@option{-w[liaprmfFso]}| + @option{--debug-dump}[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=frames-interp,=str,=loc]] + [@option{-I}|@option{-histogram}] [@option{-v}|@option{--version}] [@option{-W}|@option{--wide}] [@option{-H}|@option{--help}] @@ -2878,9 +3146,13 @@ readelf [@option{-a}|@option{--all}] @command{readelf} displays information about one or more ELF format object files. The options control what particular information to display. -@var{elffile}@dots{} are the object files to be examined. At the -moment, @command{readelf} does not support examining archives, nor does it -support examing 64 bit ELF files. +@var{elffile}@dots{} are the object files to be examined. 32-bit and +64-bit ELF files are supported, as are archives containing ELF files. + +This program performs a similar function to @command{objdump} but it +goes into more detail and it exists independently of the @sc{bfd} +library, so if there is a bug in @sc{bfd} then readelf will not be +affected. @c man end @@ -2945,6 +3217,12 @@ Displays the contents of the file's relocation section, if it has one. Displays the contents of the file's unwind section, if it has one. Only the unwind sections for IA64 ELF files are currently supported. +@item -u +@itemx --unwind +@cindex unwind information +Displays the contents of the file's unwind section, if it has one. Only +the unwind sections for IA64 ELF files are currently supported. + @item -d @itemx --dynamic @cindex ELF dynamic section information @@ -2956,6 +3234,11 @@ Displays the contents of the file's dynamic section, if it has one. Displays the contents of the version sections in the file, it they exist. +@item -A +@itemx --arch-specific +Displays architecture-specific information in the file, if there +is any. + @item -D @itemx --use-dynamic When displaying symbols, this option makes @command{readelf} use the @@ -2967,12 +3250,13 @@ symbols section. Displays the contents of the indicated section as a hexadecimal dump. @item -w[liaprmfFso] -@itemx --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=str,=loc] +@itemx --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=frames-interp,=str,=loc] Displays the contents of the debug sections in the file, if any are present. If one of the optional letters or words follows the switch then only data found in those specific sections will be dumped. -@item --histogram +@item -I +@itemx --histogram Display a histogram of bucket list lengths when displaying the contents of the symbol tables. @@ -3003,9 +3287,9 @@ objdump(1), and the Info entries for @file{binutils}. @end ignore @node Selecting The Target System -@chapter Selecting the target system +@chapter Selecting the Target System -You can specify three aspects of the target system to the @sc{gnu} +You can specify two aspects of the target system to the @sc{gnu} binary file utilities, each in several ways: @itemize @bullet @@ -3014,9 +3298,6 @@ the target @item the architecture - -@item -the linker emulation (which applies to the linker only) @end itemize In the following summaries, the lists of ways to specify values are in @@ -3033,7 +3314,6 @@ with the same type as the target system). @menu * Target Selection:: * Architecture Selection:: -* Linker Emulation Selection:: @end menu @node Target Selection @@ -3123,47 +3403,8 @@ environment variable @code{GNUTARGET} deduced from the input file @end enumerate -@subheading Linker Input Target - -Ways to specify: - -@enumerate -@item -command line option: @option{-b} or @option{--format} -(@pxref{Options,,Options,ld.info,Using LD}) - -@item -script command @code{TARGET} -(@pxref{Format Commands,,Format Commands,ld.info,Using LD}) - -@item -environment variable @code{GNUTARGET} -(@pxref{Environment,,Environment,ld.info,Using LD}) - -@item -the default target of the selected linker emulation -(@pxref{Linker Emulation Selection}) -@end enumerate - -@subheading Linker Output Target - -Ways to specify: - -@enumerate -@item -command line option: @option{-oformat} -(@pxref{Options,,Options,ld.info,Using LD}) - -@item -script command @code{OUTPUT_FORMAT} -(@pxref{Format Commands,,Format Commands,ld.info,Using LD}) - -@item -the linker input target (see ``Linker Input Target'' above) -@end enumerate - @node Architecture Selection -@section Architecture selection +@section Architecture Selection An @dfn{architecture} is a type of @sc{cpu} on which an object file is to run. Its name may contain a colon, separating the name of the @@ -3195,67 +3436,6 @@ Ways to specify: deduced from the input file @end enumerate -@subheading Linker Input Architecture - -Ways to specify: - -@enumerate -@item -deduced from the input file -@end enumerate - -@subheading Linker Output Architecture - -Ways to specify: - -@enumerate -@item -script command @code{OUTPUT_ARCH} -(@pxref{Miscellaneous Commands,,Miscellaneous Commands,ld.info,Using LD}) - -@item -the default architecture from the linker output target -(@pxref{Target Selection}) -@end enumerate - -@node Linker Emulation Selection -@section Linker emulation selection - -A linker @dfn{emulation} is a ``personality'' of the linker, which gives -the linker default values for the other aspects of the target system. -In particular, it consists of - -@itemize @bullet -@item -the linker script - -@item -the target - -@item -several ``hook'' functions that are run at certain stages of the linking -process to do special things that some targets require -@end itemize - -The command to list valid linker emulation values is @samp{ld -V}. - -Sample values: @samp{hp300bsd}, @samp{mipslit}, @samp{sun4}. - -Ways to specify: - -@enumerate -@item -command line option: @option{-m} -(@pxref{Options,,Options,ld.info,Using LD}) - -@item -environment variable @code{LDEMULATION} - -@item -compiled-in @code{DEFAULT_EMULATION} from @file{Makefile}, -which comes from @code{EMUL} in @file{config/@var{target}.mt} -@end enumerate - @node Reporting Bugs @chapter Reporting Bugs @cindex bugs @@ -3279,7 +3459,7 @@ information that enables us to fix the bug. @end menu @node Bug Criteria -@section Have you found a bug? +@section Have You Found a Bug? @cindex bug criteria If you are not sure whether you have found a bug, here are some guidelines: @@ -3302,7 +3482,7 @@ improvement are welcome in any case. @end itemize @node Bug Reporting -@section How to report bugs +@section How to Report Bugs @cindex bug reports @cindex bugs, reporting @@ -3337,9 +3517,9 @@ it is new to us. Therefore, always write your bug reports on the assumption that the bug has not been reported previously. Sometimes people give a few sketchy facts and ask, ``Does this ring a -bell?'' Those bug reports are useless, and we urge everyone to -@emph{refuse to respond to them} except to chide the sender to report -bugs properly. +bell?'' This cannot help us fix a bug, so it is basically useless. We +respond by asking for enough details to enable us to investigate. +You might as well expedite matters by sending them to begin with. To enable us to fix the bug, you should include all these things: @@ -3464,369 +3644,7 @@ 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. +@include fdl.texi @node Index @unnumbered Index diff --git a/contrib/binutils/binutils/doc/cxxfilt.man b/contrib/binutils/binutils/doc/cxxfilt.man index 3e95060..8cc8eb2 100644 --- a/contrib/binutils/binutils/doc/cxxfilt.man +++ b/contrib/binutils/binutils/doc/cxxfilt.man @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== @@ -21,7 +21,6 @@ .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will @@ -129,15 +128,15 @@ .\" ======================================================================== .\" .IX Title "C++FILT 1" -.TH C++FILT 1 "2002-08-05" "binutils-2.12.91" "GNU Development Tools" -.UC +.TH C++FILT 1 "2004-04-09" "binutils-2.14.91" "GNU Development Tools" .SH "NAME" -cxxfilt \- Demangle \*(C+ and Java symbols. +cxxfilt \- Demangle C++ and Java symbols. .SH "SYNOPSIS" .IX Header "SYNOPSIS" c++filt [\fB\-_\fR|\fB\-\-strip\-underscores\fR] [\fB\-j\fR|\fB\-\-java\fR] [\fB\-n\fR|\fB\-\-no\-strip\-underscores\fR] + [\fB\-p\fR|\fB\-\-no\-params\fR] [\fB\-s\fR \fIformat\fR|\fB\-\-format=\fR\fIformat\fR] [\fB\-\-help\fR] [\fB\-\-version\fR] [\fIsymbol\fR...] .SH "DESCRIPTION" @@ -162,6 +161,7 @@ You can use \fBc++filt\fR to decipher individual symbols: .Vb 1 \& c++filt .Ve +.PP If no \fIsymbol\fR arguments are given, \fBc++filt\fR reads symbol names from the standard input and writes the demangled names to the standard output. All results are printed on the standard output. @@ -192,24 +192,36 @@ syntax. .IX Item "--no-strip-underscores" .PD Do not remove the initial underscore. +.IP "\fB\-p\fR" 4 +.IX Item "-p" +.PD 0 +.IP "\fB\-\-no\-params\fR" 4 +.IX Item "--no-params" +.PD +When demangling the name of a function, do not display the types of +the function's parameters. .IP "\fB\-s\fR \fIformat\fR" 4 .IX Item "-s format" .PD 0 .IP "\fB\-\-format=\fR\fIformat\fR" 4 .IX Item "--format=format" .PD -\&\s-1GNU\s0 \fBnm\fR can decode three different methods of mangling, used by -different \*(C+ compilers. The argument to this option selects which +\&\fBc++filt\fR can decode various methods of mangling, used by +different compilers. The argument to this option selects which method it uses: .RS 4 +.ie n .IP """auto""" 4 +.el .IP "\f(CWauto\fR" 4 +.IX Item "auto" +Automatic selection based on executable (the default method) .ie n .IP """gnu""" 4 .el .IP "\f(CWgnu\fR" 4 .IX Item "gnu" -the one used by the \s-1GNU\s0 compiler (the default method) +the one used by the \s-1GNU\s0 \*(C+ compiler (g++) .ie n .IP """lucid""" 4 .el .IP "\f(CWlucid\fR" 4 .IX Item "lucid" -the one used by the Lucid compiler +the one used by the Lucid compiler (lcc) .ie n .IP """arm""" 4 .el .IP "\f(CWarm\fR" 4 .IX Item "arm" @@ -217,15 +229,23 @@ the one specified by the \*(C+ Annotated Reference Manual .ie n .IP """hp""" 4 .el .IP "\f(CWhp\fR" 4 .IX Item "hp" -the one used by the \s-1HP\s0 compiler +the one used by the \s-1HP\s0 compiler (aCC) .ie n .IP """edg""" 4 .el .IP "\f(CWedg\fR" 4 .IX Item "edg" the one used by the \s-1EDG\s0 compiler -.ie n .IP """gnu\-new\-abi""" 4 -.el .IP "\f(CWgnu\-new\-abi\fR" 4 -.IX Item "gnu-new-abi" -the one used by the \s-1GNU\s0 compiler with the new \s-1ABI\s0. +.ie n .IP """gnu\-v3""" 4 +.el .IP "\f(CWgnu\-v3\fR" 4 +.IX Item "gnu-v3" +the one used by the \s-1GNU\s0 \*(C+ compiler (g++) with the V3 \s-1ABI\s0. +.ie n .IP """java""" 4 +.el .IP "\f(CWjava\fR" 4 +.IX Item "java" +the one used by the \s-1GNU\s0 Java compiler (gcj) +.ie n .IP """gnat""" 4 +.el .IP "\f(CWgnat\fR" 4 +.IX Item "gnat" +the one used by the \s-1GNU\s0 Ada compiler (\s-1GNAT\s0). .RE .RS 4 .RE @@ -245,11 +265,12 @@ MS-DOS this program is named \fBcxxfilt\fR. the Info entries for \fIbinutils\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" -Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, +2001, 2002, 2003 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document under the terms of the \s-1GNU\s0 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 \*(L"\s-1GNU\s0 Free Documentation License\*(R". +section entitled ``\s-1GNU\s0 Free Documentation License''. diff --git a/contrib/binutils/binutils/doc/dlltool.1 b/contrib/binutils/binutils/doc/dlltool.1 index 47539b1..c1e4642 100644 --- a/contrib/binutils/binutils/doc/dlltool.1 +++ b/contrib/binutils/binutils/doc/dlltool.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== @@ -21,7 +21,6 @@ .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will @@ -129,8 +128,7 @@ .\" ======================================================================== .\" .IX Title "DLLTOOL 1" -.TH DLLTOOL 1 "2002-08-05" "binutils-2.12.91" "GNU Development Tools" -.UC +.TH DLLTOOL 1 "2004-04-09" "binutils-2.14.91" "GNU Development Tools" .SH "NAME" dlltool \- Create files needed to build and use DLLs. .SH "SYNOPSIS" @@ -148,7 +146,8 @@ dlltool [\fB\-d\fR|\fB\-\-input\-def\fR \fIdef-file-name\fR] [\fB\-a\fR|\fB\-\-add\-indirect\fR] [\fB\-U\fR|\fB\-\-add\-underscore\fR] [\fB\-k\fR|\fB\-\-kill\-at\fR] [\fB\-A\fR|\fB\-\-add\-stdcall\-alias\fR] [\fB\-x\fR|\fB\-\-no\-idata4\fR] [\fB\-c\fR|\fB\-\-no\-idata5\fR] [\fB\-i\fR|\fB\-\-interwork\fR] - [\fB\-n\fR|\fB\-\-nodelete\fR] [\fB\-v\fR|\fB\-\-verbose\fR] + [\fB\-n\fR|\fB\-\-nodelete\fR] [\fB\-t\fR|\fB\-\-temp\-prefix\fR \fIprefix\fR] + [\fB\-v\fR|\fB\-\-verbose\fR] [\fB\-h\fR|\fB\-\-help\fR] [\fB\-V\fR|\fB\-\-version\fR] [object\-file ...] .SH "DESCRIPTION" @@ -183,9 +182,11 @@ section of the object file. This can be done in C by using the \& asm (".section .drectve"); \& asm (".ascii \e"-export:my_func\e""); .Ve +.PP .Vb 1 \& int my_func (void) { ... } .Ve +.PP The second file needed for \s-1DLL\s0 creation is an exports file. This file is linked with the object files that make up the body of the \s-1DLL\s0 and it handles the interface between the \s-1DLL\s0 and the outside world. This is a @@ -399,7 +400,16 @@ between \s-1ARM\s0 and Thumb code. Makes \fBdlltool\fR preserve the temporary assembler files it used to create the exports file. If this option is repeated then dlltool will also preserve the temporary object files it uses to create the library -file. +file. +.IP "\fB\-t\fR \fIprefix\fR" 4 +.IX Item "-t prefix" +.PD 0 +.IP "\fB\-\-temp\-prefix\fR \fIprefix\fR" 4 +.IX Item "--temp-prefix prefix" +.PD +Makes \fBdlltool\fR use \fIprefix\fR when constructing the names of +temporary assembler and object files. By default, the temp file prefix +is generated from the pid. .IP "\fB\-v\fR" 4 .IX Item "-v" .PD 0 @@ -426,11 +436,12 @@ Displays dlltool's version number and then exits. the Info entries for \fIbinutils\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" -Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, +2001, 2002, 2003 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document under the terms of the \s-1GNU\s0 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 \*(L"\s-1GNU\s0 Free Documentation License\*(R". +section entitled ``\s-1GNU\s0 Free Documentation License''. diff --git a/contrib/binutils/binutils/doc/fdl.texi b/contrib/binutils/binutils/doc/fdl.texi new file mode 100644 index 0000000..f4726b9 --- /dev/null +++ b/contrib/binutils/binutils/doc/fdl.texi @@ -0,0 +1,368 @@ +@c -*-texinfo-*- +@node GNU Free Documentation License + +@appendix GNU Free Documentation License +@center Version 1.1, March 2000 + +@display +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. +@end display +@sp 1 +@enumerate 0 +@item +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. + +@sp 1 +@item +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. +@sp 1 +@item +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. +@sp 1 +@item +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. +@sp 1 +@item +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.@* +@sp 1 +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. +@sp 1 +@item +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.'' +@sp 1 +@item +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. +@sp 1 +@item +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. +@sp 1 +@item +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. +@sp 1 +@item +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. +@sp 1 +@item +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. + +@end enumerate + +@unnumberedsec 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 +@group +Copyright (C) @var{year} @var{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 @var{list their titles}, with the +Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}. +A copy of the license is included in the section entitled "GNU +Free Documentation License." +@end group +@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 @var{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/contrib/binutils/binutils/doc/nm.1 b/contrib/binutils/binutils/doc/nm.1 index 5702c4a..c472775 100644 --- a/contrib/binutils/binutils/doc/nm.1 +++ b/contrib/binutils/binutils/doc/nm.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== @@ -21,7 +21,6 @@ .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will @@ -129,8 +128,7 @@ .\" ======================================================================== .\" .IX Title "NM 1" -.TH NM 1 "2002-08-05" "binutils-2.12.91" "GNU Development Tools" -.UC +.TH NM 1 "2004-04-09" "binutils-2.14.91" "GNU Development Tools" .SH "NAME" nm \- list symbols from object files .SH "SYNOPSIS" @@ -350,7 +348,7 @@ Equivalent to \fB\-f posix\fR. .IP "\fB\-\-print\-size\fR" 4 .IX Item "--print-size" .PD -Print size of defined symbols for the \f(CW\*(C`bsd\*(C'\fR output format. +Print size, not the value, of defined symbols for the \f(CW\*(C`bsd\*(C'\fR output format. .IP "\fB\-s\fR" 4 .IX Item "-s" .PD 0 @@ -372,7 +370,9 @@ last come first. .IX Item "--size-sort" Sort symbols by size. The size is computed as the difference between the value of the symbol and the value of the symbol with the next higher -value. The size of the symbol is printed, rather than the value. +value. If the \f(CW\*(C`bsd\*(C'\fR output format is used the size of the symbol +is printed, rather than the value, and \fB\-S\fR must be used in order +both size and value to be printed. .IP "\fB\-t\fR \fIradix\fR" 4 .IX Item "-t radix" .PD 0 @@ -415,11 +415,12 @@ Show a summary of the options to \fBnm\fR and exit. \&\fIar\fR\|(1), \fIobjdump\fR\|(1), \fIranlib\fR\|(1), and the Info entries for \fIbinutils\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" -Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, +2001, 2002, 2003 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document under the terms of the \s-1GNU\s0 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 \*(L"\s-1GNU\s0 Free Documentation License\*(R". +section entitled ``\s-1GNU\s0 Free Documentation License''. diff --git a/contrib/binutils/binutils/doc/objcopy.1 b/contrib/binutils/binutils/doc/objcopy.1 index a59a47a..43871d6 100644 --- a/contrib/binutils/binutils/doc/objcopy.1 +++ b/contrib/binutils/binutils/doc/objcopy.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== @@ -21,7 +21,6 @@ .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will @@ -129,8 +128,7 @@ .\" ======================================================================== .\" .IX Title "OBJCOPY 1" -.TH OBJCOPY 1 "2002-08-05" "binutils-2.12.91" "GNU Development Tools" -.UC +.TH OBJCOPY 1 "2004-04-09" "binutils-2.14.91" "GNU Development Tools" .SH "NAME" objcopy \- copy and translate object files .SH "SYNOPSIS" @@ -139,21 +137,26 @@ objcopy [\fB\-F\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR] [\fB\-I\fR \fIbfdname\fR|\fB\-\-input\-target=\fR\fIbfdname\fR] [\fB\-O\fR \fIbfdname\fR|\fB\-\-output\-target=\fR\fIbfdname\fR] [\fB\-B\fR \fIbfdarch\fR|\fB\-\-binary\-architecture=\fR\fIbfdarch\fR] - [\fB\-S\fR|\fB\-\-strip\-all\fR] [\fB\-g\fR|\fB\-\-strip\-debug\fR] + [\fB\-S\fR|\fB\-\-strip\-all\fR] + [\fB\-g\fR|\fB\-\-strip\-debug\fR] [\fB\-K\fR \fIsymbolname\fR|\fB\-\-keep\-symbol=\fR\fIsymbolname\fR] [\fB\-N\fR \fIsymbolname\fR|\fB\-\-strip\-symbol=\fR\fIsymbolname\fR] [\fB\-G\fR \fIsymbolname\fR|\fB\-\-keep\-global\-symbol=\fR\fIsymbolname\fR] [\fB\-L\fR \fIsymbolname\fR|\fB\-\-localize\-symbol=\fR\fIsymbolname\fR] [\fB\-W\fR \fIsymbolname\fR|\fB\-\-weaken\-symbol=\fR\fIsymbolname\fR] - [\fB\-x\fR|\fB\-\-discard\-all\fR] [\fB\-X\fR|\fB\-\-discard\-locals\fR] + [\fB\-w\fR|\fB\-\-wildcard\fR] + [\fB\-x\fR|\fB\-\-discard\-all\fR] + [\fB\-X\fR|\fB\-\-discard\-locals\fR] [\fB\-b\fR \fIbyte\fR|\fB\-\-byte=\fR\fIbyte\fR] [\fB\-i\fR \fIinterleave\fR|\fB\-\-interleave=\fR\fIinterleave\fR] [\fB\-j\fR \fIsectionname\fR|\fB\-\-only\-section=\fR\fIsectionname\fR] [\fB\-R\fR \fIsectionname\fR|\fB\-\-remove\-section=\fR\fIsectionname\fR] [\fB\-p\fR|\fB\-\-preserve\-dates\fR] [\fB\-\-debugging\fR] - [\fB\-\-gap\-fill=\fR\fIval\fR] [\fB\-\-pad\-to=\fR\fIaddress\fR] - [\fB\-\-set\-start=\fR\fIval\fR] [\fB\-\-adjust\-start=\fR\fIincr\fR] + [\fB\-\-gap\-fill=\fR\fIval\fR] + [\fB\-\-pad\-to=\fR\fIaddress\fR] + [\fB\-\-set\-start=\fR\fIval\fR] + [\fB\-\-adjust\-start=\fR\fIincr\fR] [\fB\-\-change\-addresses=\fR\fIincr\fR] [\fB\-\-change\-section\-address\fR \fIsection\fR{=,+,\-}\fIval\fR] [\fB\-\-change\-section\-lma\fR \fIsection\fR{=,+,\-}\fIval\fR] @@ -162,9 +165,10 @@ objcopy [\fB\-F\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR] [\fB\-\-set\-section\-flags\fR \fIsection\fR=\fIflags\fR] [\fB\-\-add\-section\fR \fIsectionname\fR=\fIfilename\fR] [\fB\-\-rename\-section\fR \fIoldname\fR=\fInewname\fR[,\fIflags\fR]] - [\fB\-\-change\-leading\-char\fR ] [\fB\-\-remove\-leading\-char\fR] - [\fB\-\-srec\-len=\fR\fIival\fR ] [\fB\-\-srec\-forceS3\fR] - [\fB\-\-redefine\-sym\fR \fIold\fR=\fInew\fR ] + [\fB\-\-change\-leading\-char\fR] [\fB\-\-remove\-leading\-char\fR] + [\fB\-\-srec\-len=\fR\fIival\fR] [\fB\-\-srec\-forceS3\fR] + [\fB\-\-redefine\-sym\fR \fIold\fR=\fInew\fR] + [\fB\-\-redefine\-syms=\fR\fIfilename\fR] [\fB\-\-weaken\fR] [\fB\-\-keep\-symbols=\fR\fIfilename\fR] [\fB\-\-strip\-symbols=\fR\fIfilename\fR] @@ -172,9 +176,18 @@ objcopy [\fB\-F\fR \fIbfdname\fR|\fB\-\-target=\fR\fIbfdname\fR] [\fB\-\-localize\-symbols=\fR\fIfilename\fR] [\fB\-\-weaken\-symbols=\fR\fIfilename\fR] [\fB\-\-alt\-machine\-code=\fR\fIindex\fR] + [\fB\-\-prefix\-symbols=\fR\fIstring\fR] + [\fB\-\-prefix\-sections=\fR\fIstring\fR] + [\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR] + [\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR] + [\fB\-\-only\-keep\-debug\fR] + [\fB\-\-writable\-text\fR] + [\fB\-\-readonly\-text\fR] + [\fB\-\-pure\fR] + [\fB\-\-impure\fR] [\fB\-v\fR|\fB\-\-verbose\fR] [\fB\-V\fR|\fB\-\-version\fR] - [\fB\-\-help\fR] + [\fB\-\-help\fR] [\fB\-\-info\fR] \fIinfile\fR [\fIoutfile\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" @@ -208,10 +221,10 @@ use \fB\-S\fR to remove sections containing debugging information. In some cases \fB\-R\fR will be useful to remove sections which contain information that is not needed by the binary file. .PP -Note \- \fBobjcopy\fR is not able to change the endianness of its input -files. If the input format has an endianness, (some formats do not), +Note\-\-\-\fBobjcopy\fR is not able to change the endianness of its input +files. If the input format has an endianness (some formats do not), \&\fBobjcopy\fR can only copy the inputs into file formats that have the -same endianness or which have no endianness (eg \fBsrec\fR). +same endianness or which have no endianness (e.g., \fBsrec\fR). .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fIinfile\fR" 4 @@ -293,7 +306,7 @@ Do not copy relocation and symbol information from the source file. .IP "\fB\-\-strip\-debug\fR" 4 .IX Item "--strip-debug" .PD -Do not copy debugging symbols from the source file. +Do not copy debugging symbols or sections from the source file. .IP "\fB\-\-strip\-unneeded\fR" 4 .IX Item "--strip-unneeded" Strip all symbols that are not needed for relocation processing. @@ -337,6 +350,25 @@ visible externally. This option may be given more than once. .IX Item "--weaken-symbol=symbolname" .PD Make symbol \fIsymbolname\fR weak. This option may be given more than once. +.IP "\fB\-w\fR" 4 +.IX Item "-w" +.PD 0 +.IP "\fB\-\-wildcard\fR" 4 +.IX Item "--wildcard" +.PD +Permit regular expressions in \fIsymbolname\fRs used in other command +line options. The question mark (?), asterisk (*), backslash (\e) and +square brackets ([]) operators can be used anywhere in the symbol +name. If the first character of the symbol name is the exclamation +point (!) then the sense of the switch is reversed for that symbol. +For example: +.Sp +.Vb 1 +\& -w -W !foo -W fo* +.Ve +.Sp +would cause objcopy to weaken all symbols that start with ``fo'' +except for the symbol ``foo''. .IP "\fB\-x\fR" 4 .IX Item "-x" .PD 0 @@ -547,6 +579,12 @@ creating S3\-only record format. Change the name of a symbol \fIold\fR, to \fInew\fR. This can be useful when one is trying link two things together for which you have no source, and there are name collisions. +.IP "\fB\-\-redefine\-syms=\fR\fIfilename\fR" 4 +.IX Item "--redefine-syms=filename" +Apply \fB\-\-redefine\-sym\fR to each symbol pair "\fIold\fR \fInew\fR" +listed in the file \fIfilename\fR. \fIfilename\fR is simply a flat file, +with one symbol pair per line. Line comments may be introduced by the hash +character. This option may be given more than once. .IP "\fB\-\-weaken\fR" 4 .IX Item "--weaken" Change all global symbols in the file to be weak. This can be useful @@ -590,6 +628,89 @@ If the output architecture has alternate machine codes, use the a machine is assigned an official code and the tool-chain adopts the new code, but other applications still depend on the original code being used. +.IP "\fB\-\-writable\-text\fR" 4 +.IX Item "--writable-text" +Mark the output text as writable. This option isn't meaningful for all +object file formats. +.IP "\fB\-\-readonly\-text\fR" 4 +.IX Item "--readonly-text" +Make the output text write protected. This option isn't meaningful for all +object file formats. +.IP "\fB\-\-pure\fR" 4 +.IX Item "--pure" +Mark the output file as demand paged. This option isn't meaningful for all +object file formats. +.IP "\fB\-\-impure\fR" 4 +.IX Item "--impure" +Mark the output file as impure. This option isn't meaningful for all +object file formats. +.IP "\fB\-\-prefix\-symbols=\fR\fIstring\fR" 4 +.IX Item "--prefix-symbols=string" +Prefix all symbols in the output file with \fIstring\fR. +.IP "\fB\-\-prefix\-sections=\fR\fIstring\fR" 4 +.IX Item "--prefix-sections=string" +Prefix all section names in the output file with \fIstring\fR. +.IP "\fB\-\-prefix\-alloc\-sections=\fR\fIstring\fR" 4 +.IX Item "--prefix-alloc-sections=string" +Prefix all the names of all allocated sections in the output file with +\&\fIstring\fR. +.IP "\fB\-\-add\-gnu\-debuglink=\fR\fIpath-to-file\fR" 4 +.IX Item "--add-gnu-debuglink=path-to-file" +Creates a .gnu_debuglink section which contains a reference to \fIpath-to-file\fR +and adds it to the output file. +.IP "\fB\-\-only\-keep\-debug\fR" 4 +.IX Item "--only-keep-debug" +Strip a file, removing any sections that would be stripped by +\&\fB\-\-strip\-debug\fR and leaving the debugging sections. +.Sp +The intention is that this option will be used in conjunction with +\&\fB\-\-add\-gnu\-debuglink\fR to create a two part executable. One a +stripped binary which will occupy less space in \s-1RAM\s0 and in a +distribution and the second a debugging information file which is only +needed if debugging abilities are required. The suggested procedure +to create these files is as follows: +.RS 4 +.IP "1." 4 +.IX Item "1." +\&\f(CW\*(C`foo\*(C'\fR then... +.ie n .IP "1." 4 +.el .IP "1." 4 +.IX Item "1." +create a file containing the debugging info. +.ie n .IP "1." 4 +.el .IP "1." 4 +.IX Item "1." +stripped executable. +.ie n .IP "1." 4 +.el .IP "1." 4 +.IX Item "1." +to add a link to the debugging info into the stripped executable. +.RE +.RS 4 +.Sp +Note \- the choice of \f(CW\*(C`.dbg\*(C'\fR as an extension for the debug info +file is arbitrary. Also the \f(CW\*(C`\-\-only\-keep\-debug\*(C'\fR step is +optional. You could instead do this: +.IP "1." 4 +.IX Item "1." +.PD 0 +.ie n .IP "1." 4 +.el .IP "1." 4 +.IX Item "1." +.ie n .IP "1." 4 +.el .IP "1." 4 +.IX Item "1." +.ie n .IP "1." 4 +.el .IP "1." 4 +.IX Item "1." +.RE +.RS 4 +.PD +.Sp +ie the file pointed to by the \fB\-\-add\-gnu\-debuglink\fR can be the +full executable. It does not have to be a file created by the +\&\fB\-\-only\-keep\-debug\fR switch. +.RE .IP "\fB\-V\fR" 4 .IX Item "-V" .PD 0 @@ -608,16 +729,20 @@ archives, \fBobjcopy \-V\fR lists all members of the archive. .IP "\fB\-\-help\fR" 4 .IX Item "--help" Show a summary of the options to \fBobjcopy\fR. +.IP "\fB\-\-info\fR" 4 +.IX Item "--info" +Display a list showing all architectures and object formats available. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIld\fR\|(1), \fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" -Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, +2001, 2002, 2003 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document under the terms of the \s-1GNU\s0 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 \*(L"\s-1GNU\s0 Free Documentation License\*(R". +section entitled ``\s-1GNU\s0 Free Documentation License''. diff --git a/contrib/binutils/binutils/doc/objdump.1 b/contrib/binutils/binutils/doc/objdump.1 index 24d8951..1e9baf5 100644 --- a/contrib/binutils/binutils/doc/objdump.1 +++ b/contrib/binutils/binutils/doc/objdump.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== @@ -21,7 +21,6 @@ .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will @@ -129,8 +128,7 @@ .\" ======================================================================== .\" .IX Title "OBJDUMP 1" -.TH OBJDUMP 1 "2002-08-05" "binutils-2.12.91" "GNU Development Tools" -.UC +.TH OBJDUMP 1 "2004-04-09" "binutils-2.14.91" "GNU Development Tools" .SH "NAME" objdump \- display information from object files. .SH "SYNOPSIS" @@ -145,6 +143,7 @@ objdump [\fB\-a\fR|\fB\-\-archive\-headers\fR] [\fB\-f\fR|\fB\-\-file\-headers\fR] [\fB\-\-file\-start\-context\fR] [\fB\-g\fR|\fB\-\-debugging\fR] + [\fB\-e\fR|\fB\-\-debugging\-tags\fR] [\fB\-h\fR|\fB\-\-section\-headers\fR|\fB\-\-headers\fR] [\fB\-i\fR|\fB\-\-info\fR] [\fB\-j\fR \fIsection\fR|\fB\-\-section=\fR\fIsection\fR] @@ -184,7 +183,7 @@ object files. .IX Header "OPTIONS" The long and short forms of options, shown here as alternatives, are equivalent. At least one option from the list -\&\fB\-a,\-d,\-D,\-f,\-g,\-G,\-h,\-H,\-p,\-r,\-R,\-S,\-t,\-T,\-V,\-x\fR must be given. +\&\fB\-a,\-d,\-D,\-e,\-f,\-g,\-G,\-h,\-H,\-p,\-r,\-R,\-s,\-S,\-t,\-T,\-V,\-x\fR must be given. .IP "\fB\-a\fR" 4 .IX Item "-a" .PD 0 @@ -217,6 +216,7 @@ For example, .Vb 1 \& objdump -b oasys -m vax -h fu.o .Ve +.Sp displays summary information from the section headers (\fB\-h\fR) of \&\fIfu.o\fR, which is explicitly identified (\fB\-m\fR) as a \s-1VAX\s0 object file in the format produced by Oasys compilers. You can list the @@ -232,8 +232,8 @@ Besides removing any initial underscore prepended by the system, this makes \*(C+ function names readable. Different compilers have different mangling styles. The optional demangling style argument can be used to choose an appropriate demangling style for your compiler. -.IP "\fB\-G\fR" 4 -.IX Item "-G" +.IP "\fB\-g\fR" 4 +.IX Item "-g" .PD 0 .IP "\fB\-\-debugging\fR" 4 .IX Item "--debugging" @@ -241,6 +241,15 @@ choose an appropriate demangling style for your compiler. Display debugging information. This attempts to parse debugging information stored in the file and print it out using a C like syntax. Only certain types of debugging information have been implemented. +Some other types are supported by \fBreadelf \-w\fR. +.IP "\fB\-e\fR" 4 +.IX Item "-e" +.PD 0 +.IP "\fB\-\-debugging\-tags\fR" 4 +.IX Item "--debugging-tags" +.PD +Like \fB\-g\fR, but the information is generated in a format compatible +with ctags tool. .IP "\fB\-d\fR" 4 .IX Item "-d" .PD 0 @@ -262,11 +271,6 @@ those expected to contain instructions. .IX Item "--prefix-addresses" When disassembling, print the complete address on each line. This is the older disassembly format. -.IP "\fB\-\-disassemble\-zeroes\fR" 4 -.IX Item "--disassemble-zeroes" -Normally the disassembly output will skip blocks of zeroes. This -option directs the disassembler to disassemble those blocks, just like -any other data. .IP "\fB\-EB\fR" 4 .IX Item "-EB" .PD 0 @@ -281,8 +285,8 @@ does not describe endianness information, such as S\-records. .IP "\fB\-f\fR" 4 .IX Item "-f" .PD 0 -.IP "\fB\-\-file\-header\fR" 4 -.IX Item "--file-header" +.IP "\fB\-\-file\-headers\fR" 4 +.IX Item "--file-headers" .PD Display summary information from the overall header of each of the \fIobjfile\fR files. @@ -294,10 +298,10 @@ context to the start of the file. .IP "\fB\-h\fR" 4 .IX Item "-h" .PD 0 -.IP "\fB\-\-section\-header\fR" 4 -.IX Item "--section-header" -.IP "\fB\-\-header\fR" 4 -.IX Item "--header" +.IP "\fB\-\-section\-headers\fR" 4 +.IX Item "--section-headers" +.IP "\fB\-\-headers\fR" 4 +.IX Item "--headers" .PD Display summary information from the section headers of the object file. @@ -310,8 +314,12 @@ although \fBld\fR relocates the sections correctly, using \fBobjdump \&\-h\fR to list the file section headers cannot show the correct addresses. Instead, it shows the usual addresses, which are implicit for the target. +.IP "\fB\-H\fR" 4 +.IX Item "-H" +.PD 0 .IP "\fB\-\-help\fR" 4 .IX Item "--help" +.PD Print a summary of the options to \fBobjdump\fR and exit. .IP "\fB\-i\fR" 4 .IX Item "-i" @@ -354,7 +362,9 @@ architectures with the \fB\-i\fR option. .IX Item "--disassembler-options=options" .PD Pass target specific information to the disassembler. Only supported on -some targets. +some targets. If it is necessary to specify more than one +disassembler option then multiple \fB\-M\fR options can be used or +can be placed together into a comma separated list. .Sp If the target is an \s-1ARM\s0 architecture then this switch can be used to select which register name set is used during disassembler. Specifying @@ -368,7 +378,7 @@ just use \fBr\fR followed by the register number. There are also two variants on the \s-1APCS\s0 register naming scheme enabled by \fB\-M reg-names-atpcs\fR and \fB\-M reg-names-special-atpcs\fR which use the ARM/Thumb Procedure Call Standard naming conventions. (Either -with the normal register name or the special register names). +with the normal register names or the special register names). .Sp This option can also be used for \s-1ARM\s0 architectures to force the disassembler to interpret all instructions as Thumb instructions by @@ -386,12 +396,62 @@ intel syntax mode and \s-1AT&T\s0 syntax mode. \fBaddr32\fR, address size and operand size. These four options will be overridden if \&\fBx86\-64\fR, \fBi386\fR or \fBi8086\fR appear later in the option string. Lastly, \fBsuffix\fR, when in \s-1AT&T\s0 mode, -instructs the dissassembler to print a mnemonic suffix even when the +instructs the disassembler to print a mnemonic suffix even when the suffix could be inferred by the operands. .Sp For \s-1PPC\s0, \fBbooke\fR, \fBbooke32\fR and \fBbooke64\fR select disassembly of BookE instructions. \fB32\fR and \fB64\fR select PowerPC and PowerPC64 disassembly, respectively. +.Sp +For \s-1MIPS\s0, this option controls the printing of register names in +disassembled instructions. Multiple selections from the +following may be specified as a comma separated string, and invalid +options are ignored: +.RS 4 +.ie n .IP """gpr\-names=\f(CI\s-1ABI\s0\f(CW""" 4 +.el .IP "\f(CWgpr\-names=\f(CI\s-1ABI\s0\f(CW\fR" 4 +.IX Item "gpr-names=ABI" +Print \s-1GPR\s0 (general\-purpose register) names as appropriate +for the specified \s-1ABI\s0. By default, \s-1GPR\s0 names are selected according to +the \s-1ABI\s0 of the binary being disassembled. +.ie n .IP """fpr\-names=\f(CI\s-1ABI\s0\f(CW""" 4 +.el .IP "\f(CWfpr\-names=\f(CI\s-1ABI\s0\f(CW\fR" 4 +.IX Item "fpr-names=ABI" +Print \s-1FPR\s0 (floating\-point register) names as +appropriate for the specified \s-1ABI\s0. By default, \s-1FPR\s0 numbers are printed +rather than names. +.ie n .IP """cp0\-names=\f(CI\s-1ARCH\s0\f(CW""" 4 +.el .IP "\f(CWcp0\-names=\f(CI\s-1ARCH\s0\f(CW\fR" 4 +.IX Item "cp0-names=ARCH" +Print \s-1CP0\s0 (system control coprocessor; coprocessor 0) register names +as appropriate for the \s-1CPU\s0 or architecture specified by +\&\fI\s-1ARCH\s0\fR. By default, \s-1CP0\s0 register names are selected according to +the architecture and \s-1CPU\s0 of the binary being disassembled. +.ie n .IP """hwr\-names=\f(CI\s-1ARCH\s0\f(CW""" 4 +.el .IP "\f(CWhwr\-names=\f(CI\s-1ARCH\s0\f(CW\fR" 4 +.IX Item "hwr-names=ARCH" +Print \s-1HWR\s0 (hardware register, used by the \f(CW\*(C`rdhwr\*(C'\fR instruction) names +as appropriate for the \s-1CPU\s0 or architecture specified by +\&\fI\s-1ARCH\s0\fR. By default, \s-1HWR\s0 names are selected according to +the architecture and \s-1CPU\s0 of the binary being disassembled. +.ie n .IP """reg\-names=\f(CI\s-1ABI\s0\f(CW""" 4 +.el .IP "\f(CWreg\-names=\f(CI\s-1ABI\s0\f(CW\fR" 4 +.IX Item "reg-names=ABI" +Print \s-1GPR\s0 and \s-1FPR\s0 names as appropriate for the selected \s-1ABI\s0. +.ie n .IP """reg\-names=\f(CI\s-1ARCH\s0\f(CW""" 4 +.el .IP "\f(CWreg\-names=\f(CI\s-1ARCH\s0\f(CW\fR" 4 +.IX Item "reg-names=ARCH" +Print CPU-specific register names (\s-1CP0\s0 register and \s-1HWR\s0 names) +as appropriate for the selected \s-1CPU\s0 or architecture. +.RE +.RS 4 +.Sp +For any of the options listed above, \fI\s-1ABI\s0\fR or +\&\fI\s-1ARCH\s0\fR may be specified as \fBnumeric\fR to have numbers printed +rather than names, for the selected types of registers. +You can list the available values of \fI\s-1ABI\s0\fR and \fI\s-1ARCH\s0\fR using +the \fB\-\-help\fR option. +.RE .IP "\fB\-p\fR" 4 .IX Item "-p" .PD 0 @@ -425,7 +485,8 @@ libraries. .IP "\fB\-\-full\-contents\fR" 4 .IX Item "--full-contents" .PD -Display the full contents of any sections requested. +Display the full contents of any sections requested. By default all +non-empty sections are displayed. .IP "\fB\-S\fR" 4 .IX Item "-S" .PD 0 @@ -482,14 +543,18 @@ Print the dynamic symbol table entries of the file. This is only meaningful for dynamic objects, such as certain types of shared libraries. This is similar to the information provided by the \fBnm\fR program when given the \fB\-D\fR (\fB\-\-dynamic\fR) option. +.IP "\fB\-V\fR" 4 +.IX Item "-V" +.PD 0 .IP "\fB\-\-version\fR" 4 .IX Item "--version" +.PD Print the version number of \fBobjdump\fR and exit. .IP "\fB\-x\fR" 4 .IX Item "-x" .PD 0 -.IP "\fB\-\-all\-header\fR" 4 -.IX Item "--all-header" +.IP "\fB\-\-all\-headers\fR" 4 +.IX Item "--all-headers" .PD Display all available header information, including the symbol table and relocation entries. Using \fB\-x\fR is equivalent to specifying all of @@ -502,16 +567,26 @@ relocation entries. Using \fB\-x\fR is equivalent to specifying all of .PD Format some lines for output devices that have more than 80 columns. Also do not truncate symbol names when they are displayed. +.IP "\fB\-z\fR" 4 +.IX Item "-z" +.PD 0 +.IP "\fB\-\-disassemble\-zeroes\fR" 4 +.IX Item "--disassemble-zeroes" +.PD +Normally the disassembly output will skip blocks of zeroes. This +option directs the disassembler to disassemble those blocks, just like +any other data. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fInm\fR\|(1), \fIreadelf\fR\|(1), and the Info entries for \fIbinutils\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" -Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, +2001, 2002, 2003 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document under the terms of the \s-1GNU\s0 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 \*(L"\s-1GNU\s0 Free Documentation License\*(R". +section entitled ``\s-1GNU\s0 Free Documentation License''. diff --git a/contrib/binutils/binutils/doc/ranlib.1 b/contrib/binutils/binutils/doc/ranlib.1 index 5512755..0d8e4ac 100644 --- a/contrib/binutils/binutils/doc/ranlib.1 +++ b/contrib/binutils/binutils/doc/ranlib.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== @@ -21,7 +21,6 @@ .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will @@ -129,8 +128,7 @@ .\" ======================================================================== .\" .IX Title "RANLIB 1" -.TH RANLIB 1 "2002-08-05" "binutils-2.12.91" "GNU Development Tools" -.UC +.TH RANLIB 1 "2004-04-09" "binutils-2.14.91" "GNU Development Tools" .SH "NAME" ranlib \- generate index to archive. .SH "SYNOPSIS" @@ -166,11 +164,12 @@ Show the version number of \fBranlib\fR. \&\fIar\fR\|(1), \fInm\fR\|(1), and the Info entries for \fIbinutils\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" -Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, +2001, 2002, 2003 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document under the terms of the \s-1GNU\s0 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 \*(L"\s-1GNU\s0 Free Documentation License\*(R". +section entitled ``\s-1GNU\s0 Free Documentation License''. diff --git a/contrib/binutils/binutils/doc/readelf.1 b/contrib/binutils/binutils/doc/readelf.1 index 81f655d..7b48563 100644 --- a/contrib/binutils/binutils/doc/readelf.1 +++ b/contrib/binutils/binutils/doc/readelf.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== @@ -21,7 +21,6 @@ .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will @@ -129,10 +128,9 @@ .\" ======================================================================== .\" .IX Title "READELF 1" -.TH READELF 1 "2002-08-05" "binutils-2.12.91" "GNU Development Tools" -.UC +.TH READELF 1 "2004-04-09" "binutils-2.14.91" "GNU Development Tools" .SH "NAME" -readelf \- Displays information about \s-1ELF\s0 files. +readelf \- Displays information about ELF files. .SH "SYNOPSIS" .IX Header "SYNOPSIS" readelf [\fB\-a\fR|\fB\-\-all\fR] @@ -146,10 +144,12 @@ readelf [\fB\-a\fR|\fB\-\-all\fR] [\fB\-u\fR|\fB\-\-unwind\fR] [\fB\-d\fR|\fB\-\-dynamic\fR] [\fB\-V\fR|\fB\-\-version\-info\fR] + [\fB\-A\fR|\fB\-\-arch\-specific\fR] [\fB\-D\fR|\fB\-\-use\-dynamic\fR] [\fB\-x\fR |\fB\-\-hex\-dump=\fR] - [\fB\-w[liaprmfFso]\fR|\fB\-\-debug\-dump\fR[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=str,=loc]] - [\fB\-histogram\fR] + [\fB\-w[liaprmfFso]\fR| + \fB\-\-debug\-dump\fR[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=frames\-interp,=str,=loc]] + [\fB\-I\fR|\fB\-histogram\fR] [\fB\-v\fR|\fB\-\-version\fR] [\fB\-W\fR|\fB\-\-wide\fR] [\fB\-H\fR|\fB\-\-help\fR] @@ -159,9 +159,13 @@ readelf [\fB\-a\fR|\fB\-\-all\fR] \&\fBreadelf\fR displays information about one or more \s-1ELF\s0 format object files. The options control what particular information to display. .PP -\&\fIelffile\fR... are the object files to be examined. At the -moment, \fBreadelf\fR does not support examining archives, nor does it -support examing 64 bit \s-1ELF\s0 files. +\&\fIelffile\fR... are the object files to be examined. 32\-bit and +64\-bit \s-1ELF\s0 files are supported, as are archives containing \s-1ELF\s0 files. +.PP +This program performs a similar function to \fBobjdump\fR but it +goes into more detail and it exists independently of the \s-1BFD\s0 +library, so if there is a bug in \s-1BFD\s0 then readelf will not be +affected. .SH "OPTIONS" .IX Header "OPTIONS" The long and short forms of options, shown here as alternatives, are @@ -243,6 +247,14 @@ Displays the contents of the file's relocation section, if it has one. .PD Displays the contents of the file's unwind section, if it has one. Only the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported. +.IP "\fB\-u\fR" 4 +.IX Item "-u" +.PD 0 +.IP "\fB\-\-unwind\fR" 4 +.IX Item "--unwind" +.PD +Displays the contents of the file's unwind section, if it has one. Only +the unwind sections for \s-1IA64\s0 \s-1ELF\s0 files are currently supported. .IP "\fB\-d\fR" 4 .IX Item "-d" .PD 0 @@ -258,6 +270,14 @@ Displays the contents of the file's dynamic section, if it has one. .PD Displays the contents of the version sections in the file, it they exist. +.IP "\fB\-A\fR" 4 +.IX Item "-A" +.PD 0 +.IP "\fB\-\-arch\-specific\fR" 4 +.IX Item "--arch-specific" +.PD +Displays architecture-specific information in the file, if there +is any. .IP "\fB\-D\fR" 4 .IX Item "-D" .PD 0 @@ -277,14 +297,18 @@ Displays the contents of the indicated section as a hexadecimal dump. .IP "\fB\-w[liaprmfFso]\fR" 4 .IX Item "-w[liaprmfFso]" .PD 0 -.IP "\fB\-\-debug\-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=str,=loc]\fR" 4 -.IX Item "--debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=str,=loc]" +.IP "\fB\-\-debug\-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=frames\-interp,=str,=loc]\fR" 4 +.IX Item "--debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=frames-interp,=str,=loc]" .PD 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. +.IP "\fB\-I\fR" 4 +.IX Item "-I" +.PD 0 .IP "\fB\-\-histogram\fR" 4 .IX Item "--histogram" +.PD Display a histogram of bucket list lengths when displaying the contents of the symbol tables. .IP "\fB\-v\fR" 4 @@ -317,11 +341,12 @@ Display the command line options understood by \fBreadelf\fR. \&\fIobjdump\fR\|(1), and the Info entries for \fIbinutils\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" -Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, +2001, 2002, 2003 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document under the terms of the \s-1GNU\s0 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 \*(L"\s-1GNU\s0 Free Documentation License\*(R". +section entitled ``\s-1GNU\s0 Free Documentation License''. diff --git a/contrib/binutils/binutils/doc/size.1 b/contrib/binutils/binutils/doc/size.1 index 09a8156..4bf0512 100644 --- a/contrib/binutils/binutils/doc/size.1 +++ b/contrib/binutils/binutils/doc/size.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== @@ -21,7 +21,6 @@ .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will @@ -129,8 +128,7 @@ .\" ======================================================================== .\" .IX Title "SIZE 1" -.TH SIZE 1 "2002-08-05" "binutils-2.12.91" "GNU Development Tools" -.UC +.TH SIZE 1 "2004-04-09" "binutils-2.14.91" "GNU Development Tools" .SH "NAME" size \- list section sizes and total size. .SH "SYNOPSIS" @@ -176,6 +174,7 @@ Here is an example of the Berkeley (default) format of output from \& 294880 81920 11592 388392 5ed28 ranlib \& 294880 81920 11888 388688 5ee50 size .Ve +.Sp This is the same data, but displayed closer to System V conventions: .Sp .Vb 7 @@ -187,6 +186,7 @@ This is the same data, but displayed closer to System V conventions: \& .bss 11592 385024 \& Total 388392 .Ve +.Sp .Vb 6 \& size : \& section size addr @@ -239,11 +239,12 @@ Display the version number of \fBsize\fR. \&\fIar\fR\|(1), \fIobjdump\fR\|(1), \fIreadelf\fR\|(1), and the Info entries for \fIbinutils\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" -Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, +2001, 2002, 2003 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document under the terms of the \s-1GNU\s0 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 \*(L"\s-1GNU\s0 Free Documentation License\*(R". +section entitled ``\s-1GNU\s0 Free Documentation License''. diff --git a/contrib/binutils/binutils/doc/strings.1 b/contrib/binutils/binutils/doc/strings.1 index 74d9112..f3b9be0 100644 --- a/contrib/binutils/binutils/doc/strings.1 +++ b/contrib/binutils/binutils/doc/strings.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== @@ -21,7 +21,6 @@ .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will @@ -129,8 +128,7 @@ .\" ======================================================================== .\" .IX Title "STRINGS 1" -.TH STRINGS 1 "2002-08-05" "binutils-2.12.91" "GNU Development Tools" -.UC +.TH STRINGS 1 "2004-04-09" "binutils-2.14.91" "GNU Development Tools" .SH "NAME" strings \- print the strings of printable characters in files. .SH "SYNOPSIS" @@ -206,11 +204,11 @@ octal, \fBx\fR for hexadecimal, or \fBd\fR for decimal. .IX Item "--encoding=encoding" .PD Select the character encoding of the strings that are to be found. -Possible values for \fIencoding\fR are: \fBs\fR = single-byte -characters (\s-1ASCII\s0, \s-1ISO\s0 8859, etc., default), \fBb\fR = 16\-bit -Bigendian, \fBl\fR = 16\-bit Littleendian, \fBB\fR = 32\-bit Bigendian, -\&\fBL\fR = 32\-bit Littleendian. Useful for finding wide character -strings. +Possible values for \fIencoding\fR are: \fBs\fR = single\-7\-bit\-byte +characters (\s-1ASCII\s0, \s-1ISO\s0 8859, etc., default), \fBS\fR = +single\-8\-bit\-byte characters, \fBb\fR = 16\-bit bigendian, \fBl\fR = +16\-bit littleendian, \fBB\fR = 32\-bit bigendian, \fBL\fR = 32\-bit +littleendian. Useful for finding wide character strings. .IP "\fB\-\-target=\fR\fIbfdname\fR" 4 .IX Item "--target=bfdname" Specify an object code format other than your system's default format. @@ -227,11 +225,12 @@ Print the program version number on the standard output and exit. and the Info entries for \fIbinutils\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" -Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, +2001, 2002, 2003 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document under the terms of the \s-1GNU\s0 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 \*(L"\s-1GNU\s0 Free Documentation License\*(R". +section entitled ``\s-1GNU\s0 Free Documentation License''. diff --git a/contrib/binutils/binutils/doc/strip.1 b/contrib/binutils/binutils/doc/strip.1 index f8cca3b..2073020 100644 --- a/contrib/binutils/binutils/doc/strip.1 +++ b/contrib/binutils/binutils/doc/strip.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== @@ -21,7 +21,6 @@ .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will @@ -129,22 +128,25 @@ .\" ======================================================================== .\" .IX Title "STRIP 1" -.TH STRIP 1 "2002-08-05" "binutils-2.12.91" "GNU Development Tools" -.UC +.TH STRIP 1 "2004-04-09" "binutils-2.14.91" "GNU Development Tools" .SH "NAME" strip \- Discard symbols from object files. .SH "SYNOPSIS" .IX Header "SYNOPSIS" -strip [\fB\-F\fR \fIbfdname\fR |\fB\-\-target=\fR\fIbfdname\fR ] - [\fB\-I\fR \fIbfdname\fR |\fB\-\-input\-target=\fR\fIbfdname\fR ] - [\fB\-O\fR \fIbfdname\fR |\fB\-\-output\-target=\fR\fIbfdname\fR ] - [\fB\-s\fR|\fB\-\-strip\-all\fR] [\fB\-S\fR|\fB\-g\fR|\fB\-d\fR|\fB\-\-strip\-debug\fR] - [\fB\-K\fR \fIsymbolname\fR |\fB\-\-keep\-symbol=\fR\fIsymbolname\fR ] - [\fB\-N\fR \fIsymbolname\fR |\fB\-\-strip\-symbol=\fR\fIsymbolname\fR ] - [\fB\-x\fR|\fB\-\-discard\-all\fR ] [\fB\-X\fR |\fB\-\-discard\-locals\fR] - [\fB\-R\fR \fIsectionname\fR |\fB\-\-remove\-section=\fR\fIsectionname\fR ] - [\fB\-o\fR \fIfile\fR ] [\fB\-p\fR|\fB\-\-preserve\-dates\fR] - [\fB\-v\fR |\fB\-\-verbose\fR] [\fB\-V\fR|\fB\-\-version\fR] [\fB\-\-help\fR] +strip [\fB\-F\fR \fIbfdname\fR |\fB\-\-target=\fR\fIbfdname\fR] + [\fB\-I\fR \fIbfdname\fR |\fB\-\-input\-target=\fR\fIbfdname\fR] + [\fB\-O\fR \fIbfdname\fR |\fB\-\-output\-target=\fR\fIbfdname\fR] + [\fB\-s\fR|\fB\-\-strip\-all\fR] + [\fB\-S\fR|\fB\-g\fR|\fB\-d\fR|\fB\-\-strip\-debug\fR] + [\fB\-K\fR \fIsymbolname\fR |\fB\-\-keep\-symbol=\fR\fIsymbolname\fR] + [\fB\-N\fR \fIsymbolname\fR |\fB\-\-strip\-symbol=\fR\fIsymbolname\fR] + [\fB\-w\fR|\fB\-\-wildcard\fR] + [\fB\-x\fR|\fB\-\-discard\-all\fR] [\fB\-X\fR |\fB\-\-discard\-locals\fR] + [\fB\-R\fR \fIsectionname\fR |\fB\-\-remove\-section=\fR\fIsectionname\fR] + [\fB\-o\fR \fIfile\fR] [\fB\-p\fR|\fB\-\-preserve\-dates\fR] + [\fB\-\-only\-keep\-debug\fR] + [\fB\-v\fR |\fB\-\-verbose\fR] [\fB\-V\fR|\fB\-\-version\fR] + [\fB\-\-help\fR] [\fB\-\-info\fR] \fIobjfile\fR... .SH "DESCRIPTION" .IX Header "DESCRIPTION" @@ -167,8 +169,11 @@ code format \fIbfdname\fR, and rewrite it in the same format. .IP "\fB\-\-help\fR" 4 .IX Item "--help" Show a summary of the options to \fBstrip\fR and exit. -.IP "\fB\-I\fR \fIbfdname\fR\fB \fR" 4 -.IX Item "-I bfdname " +.IP "\fB\-\-info\fR" 4 +.IX Item "--info" +Display a list showing all architectures and object formats available. +.IP "\fB\-I\fR \fIbfdname\fR" 4 +.IX Item "-I bfdname" .PD 0 .IP "\fB\-\-input\-target=\fR\fIbfdname\fR" 4 .IX Item "--input-target=bfdname" @@ -241,6 +246,25 @@ argument may be specified. .IX Item "--preserve-dates" .PD Preserve the access and modification dates of the file. +.IP "\fB\-w\fR" 4 +.IX Item "-w" +.PD 0 +.IP "\fB\-\-wildcard\fR" 4 +.IX Item "--wildcard" +.PD +Permit regular expressions in \fIsymbolname\fRs used in other command +line options. The question mark (?), asterisk (*), backslash (\e) and +square brackets ([]) operators can be used anywhere in the symbol +name. If the first character of the symbol name is the exclamation +point (!) then the sense of the switch is reversed for that symbol. +For example: +.Sp +.Vb 1 +\& -w -K !foo -K fo* +.Ve +.Sp +would cause strip to only keep symbols that start with the letters +``fo'', but to discard the symbol ``foo''. .IP "\fB\-x\fR" 4 .IX Item "-x" .PD 0 @@ -256,6 +280,59 @@ Remove non-global symbols. .PD Remove compiler-generated local symbols. (These usually start with \fBL\fR or \fB.\fR.) +.IP "\fB\-\-only\-keep\-debug\fR" 4 +.IX Item "--only-keep-debug" +Strip a file, removing any sections that would be stripped by +\&\fB\-\-strip\-debug\fR and leaving the debugging sections. +.Sp +The intention is that this option will be used in conjunction with +\&\fB\-\-add\-gnu\-debuglink\fR to create a two part executable. One a +stripped binary which will occupy less space in \s-1RAM\s0 and in a +distribution and the second a debugging information file which is only +needed if debugging abilities are required. The suggested procedure +to create these files is as follows: +.RS 4 +.IP "1." 4 +.IX Item "1." +\&\f(CW\*(C`foo\*(C'\fR then... +.ie n .IP "1." 4 +.el .IP "1." 4 +.IX Item "1." +create a file containing the debugging info. +.ie n .IP "1." 4 +.el .IP "1." 4 +.IX Item "1." +stripped executable. +.ie n .IP "1." 4 +.el .IP "1." 4 +.IX Item "1." +to add a link to the debugging info into the stripped executable. +.RE +.RS 4 +.Sp +Note \- the choice of \f(CW\*(C`.dbg\*(C'\fR as an extension for the debug info +file is arbitrary. Also the \f(CW\*(C`\-\-only\-keep\-debug\*(C'\fR step is +optional. You could instead do this: +.IP "1." 4 +.IX Item "1." +.PD 0 +.ie n .IP "1." 4 +.el .IP "1." 4 +.IX Item "1." +.ie n .IP "1." 4 +.el .IP "1." 4 +.IX Item "1." +.ie n .IP "1." 4 +.el .IP "1." 4 +.IX Item "1." +.RE +.RS 4 +.PD +.Sp +ie the file pointed to by the \fB\-\-add\-gnu\-debuglink\fR can be the +full executable. It does not have to be a file created by the +\&\fB\-\-only\-keep\-debug\fR switch. +.RE .IP "\fB\-V\fR" 4 .IX Item "-V" .PD 0 @@ -276,11 +353,12 @@ archives, \fBstrip \-v\fR lists all members of the archive. the Info entries for \fIbinutils\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" -Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. +Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, +2001, 2002, 2003 Free Software Foundation, Inc. .PP Permission is granted to copy, distribute and/or modify this document under the terms of the \s-1GNU\s0 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 \*(L"\s-1GNU\s0 Free Documentation License\*(R". +section entitled ``\s-1GNU\s0 Free Documentation License''. diff --git a/contrib/binutils/binutils/filemode.c b/contrib/binutils/binutils/filemode.c index ca00694f..8b438a9 100644 --- a/contrib/binutils/binutils/filemode.c +++ b/contrib/binutils/binutils/filemode.c @@ -1,5 +1,5 @@ /* filemode.c -- make a string describing file modes - Copyright 1985, 1990, 1991, 1994, 1995, 1997 + Copyright 1985, 1990, 1991, 1994, 1995, 1997, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -20,8 +20,8 @@ #include "bfd.h" #include "bucomm.h" -static char ftypelet PARAMS ((unsigned long)); -static void setst PARAMS ((unsigned long, char *)); +static char ftypelet (unsigned long); +static void setst (unsigned long, char *); /* filemodestring - fill in string STR with an ls-style ASCII representation of the st_mode field of file stats block STATP. @@ -64,9 +64,7 @@ static void setst PARAMS ((unsigned long, char *)); /* This is not used; only mode_string is used. */ void -filemodestring (statp, str) - struct stat *statp; - char *str; +filemodestring (struct stat *statp, char *str) { mode_string ((unsigned long) statp->st_mode, str); } @@ -118,9 +116,7 @@ filemodestring (statp, str) is given as an argument. */ void -mode_string (mode, str) - unsigned long mode; - char *str; +mode_string (unsigned long mode, char *str) { str[0] = ftypelet ((unsigned long) mode); str[1] = (mode & S_IRUSR) != 0 ? 'r' : '-'; @@ -140,7 +136,7 @@ mode_string (mode, str) 'd' for directories 'b' for block special files 'c' for character special files - 'm' for multiplexor files + 'm' for multiplexer files 'l' for symbolic links 's' for sockets 'p' for fifos @@ -195,8 +191,7 @@ mode_string (mode, str) #endif /* ! defined (S_ISLNK) */ static char -ftypelet (bits) - unsigned long bits; +ftypelet (unsigned long bits) { if (S_ISDIR (bits)) return 'd'; @@ -230,9 +225,7 @@ ftypelet (bits) according to the file mode BITS. */ static void -setst (bits, chars) - unsigned long bits ATTRIBUTE_UNUSED; - char *chars ATTRIBUTE_UNUSED; +setst (unsigned long bits ATTRIBUTE_UNUSED, char *chars ATTRIBUTE_UNUSED) { #ifdef S_ISUID if (bits & S_ISUID) diff --git a/contrib/binutils/binutils/ieee.c b/contrib/binutils/binutils/ieee.c index 4735fb3..1ced603 100644 --- a/contrib/binutils/binutils/ieee.c +++ b/contrib/binutils/binutils/ieee.c @@ -1,5 +1,5 @@ /* ieee.c -- Read and write IEEE-695 debugging information. - Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1996, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GNU Binutils. @@ -42,8 +42,8 @@ struct ieee_block const char *filename; /* The index of the function type, for a BB4 or BB6 block. */ unsigned int fnindx; - /* True if this function is being skipped. */ - boolean skip; + /* TRUE if this function is being skipped. */ + bfd_boolean skip; }; /* This structure is the block stack. */ @@ -146,7 +146,7 @@ struct ieee_tag struct ieee_info { /* The debugging handle. */ - PTR dhandle; + void *dhandle; /* The BFD. */ bfd *abfd; /* The start of the bytes to be parsed. */ @@ -156,7 +156,7 @@ struct ieee_info /* The block stack. */ struct ieee_blockstack blockstack; /* Whether we have seen a BB1 or BB2. */ - boolean saw_filename; + bfd_boolean saw_filename; /* The variables. */ struct ieee_vars vars; /* The global variables, after a global typedef block. */ @@ -249,56 +249,50 @@ enum builtin_types /* Local functions. */ -static void ieee_error - PARAMS ((struct ieee_info *, const bfd_byte *, const char *)); -static void ieee_eof PARAMS ((struct ieee_info *)); -static char *savestring PARAMS ((const char *, unsigned long)); -static boolean ieee_read_number - PARAMS ((struct ieee_info *, const bfd_byte **, bfd_vma *)); -static boolean ieee_read_optional_number - PARAMS ((struct ieee_info *, const bfd_byte **, bfd_vma *, boolean *)); -static boolean ieee_read_id - PARAMS ((struct ieee_info *, const bfd_byte **, const char **, - unsigned long *)); -static boolean ieee_read_optional_id - PARAMS ((struct ieee_info *, const bfd_byte **, const char **, - unsigned long *, boolean *)); -static boolean ieee_read_expression - PARAMS ((struct ieee_info *, const bfd_byte **, bfd_vma *)); +static void ieee_error (struct ieee_info *, const bfd_byte *, const char *); +static void ieee_eof (struct ieee_info *); +static char *savestring (const char *, unsigned long); +static bfd_boolean ieee_read_number + (struct ieee_info *, const bfd_byte **, bfd_vma *); +static bfd_boolean ieee_read_optional_number + (struct ieee_info *, const bfd_byte **, bfd_vma *, bfd_boolean *); +static bfd_boolean ieee_read_id + (struct ieee_info *, const bfd_byte **, const char **, unsigned long *); +static bfd_boolean ieee_read_optional_id + (struct ieee_info *, const bfd_byte **, const char **, unsigned long *, + bfd_boolean *); +static bfd_boolean ieee_read_expression + (struct ieee_info *, const bfd_byte **, bfd_vma *); static debug_type ieee_builtin_type - PARAMS ((struct ieee_info *, const bfd_byte *, unsigned int)); -static boolean ieee_alloc_type - PARAMS ((struct ieee_info *, unsigned int, boolean)); -static boolean ieee_read_type_index - PARAMS ((struct ieee_info *, const bfd_byte **, debug_type *)); -static int ieee_regno_to_genreg PARAMS ((bfd *, int)); -static int ieee_genreg_to_regno PARAMS ((bfd *, int)); -static boolean parse_ieee_bb PARAMS ((struct ieee_info *, const bfd_byte **)); -static boolean parse_ieee_be PARAMS ((struct ieee_info *, const bfd_byte **)); -static boolean parse_ieee_nn PARAMS ((struct ieee_info *, const bfd_byte **)); -static boolean parse_ieee_ty PARAMS ((struct ieee_info *, const bfd_byte **)); -static boolean parse_ieee_atn PARAMS ((struct ieee_info *, const bfd_byte **)); -static boolean ieee_read_cxx_misc - PARAMS ((struct ieee_info *, const bfd_byte **, unsigned long)); -static boolean ieee_read_cxx_class - PARAMS ((struct ieee_info *, const bfd_byte **, unsigned long)); -static boolean ieee_read_cxx_defaults - PARAMS ((struct ieee_info *, const bfd_byte **, unsigned long)); -static boolean ieee_read_reference - PARAMS ((struct ieee_info *, const bfd_byte **)); -static boolean ieee_require_asn - PARAMS ((struct ieee_info *, const bfd_byte **, bfd_vma *)); -static boolean ieee_require_atn65 - PARAMS ((struct ieee_info *, const bfd_byte **, const char **, - unsigned long *)); + (struct ieee_info *, const bfd_byte *, unsigned int); +static bfd_boolean ieee_alloc_type + (struct ieee_info *, unsigned int, bfd_boolean); +static bfd_boolean ieee_read_type_index + (struct ieee_info *, const bfd_byte **, debug_type *); +static int ieee_regno_to_genreg (bfd *, int); +static int ieee_genreg_to_regno (bfd *, int); +static bfd_boolean parse_ieee_bb (struct ieee_info *, const bfd_byte **); +static bfd_boolean parse_ieee_be (struct ieee_info *, const bfd_byte **); +static bfd_boolean parse_ieee_nn (struct ieee_info *, const bfd_byte **); +static bfd_boolean parse_ieee_ty (struct ieee_info *, const bfd_byte **); +static bfd_boolean parse_ieee_atn (struct ieee_info *, const bfd_byte **); +static bfd_boolean ieee_read_cxx_misc + (struct ieee_info *, const bfd_byte **, unsigned long); +static bfd_boolean ieee_read_cxx_class + (struct ieee_info *, const bfd_byte **, unsigned long); +static bfd_boolean ieee_read_cxx_defaults + (struct ieee_info *, const bfd_byte **, unsigned long); +static bfd_boolean ieee_read_reference + (struct ieee_info *, const bfd_byte **); +static bfd_boolean ieee_require_asn + (struct ieee_info *, const bfd_byte **, bfd_vma *); +static bfd_boolean ieee_require_atn65 + (struct ieee_info *, const bfd_byte **, const char **, unsigned long *); /* Report an error in the IEEE debugging information. */ static void -ieee_error (info, p, s) - struct ieee_info *info; - const bfd_byte *p; - const char *s; +ieee_error (struct ieee_info *info, const bfd_byte *p, const char *s) { if (p != NULL) fprintf (stderr, "%s: 0x%lx: %s (0x%x)\n", bfd_get_filename (info->abfd), @@ -310,8 +304,7 @@ ieee_error (info, p, s) /* Report an unexpected EOF in the IEEE debugging information. */ static void -ieee_eof (info) - struct ieee_info *info; +ieee_eof (struct ieee_info *info) { ieee_error (info, (const bfd_byte *) NULL, _("unexpected end of debugging information")); @@ -320,9 +313,7 @@ ieee_eof (info) /* Save a string in memory. */ static char * -savestring (start, len) - const char *start; - unsigned long len; +savestring (const char *start, unsigned long len) { char *ret; @@ -334,24 +325,18 @@ savestring (start, len) /* Read a number which must be present in an IEEE file. */ -static boolean -ieee_read_number (info, pp, pv) - struct ieee_info *info; - const bfd_byte **pp; - bfd_vma *pv; +static bfd_boolean +ieee_read_number (struct ieee_info *info, const bfd_byte **pp, bfd_vma *pv) { - return ieee_read_optional_number (info, pp, pv, (boolean *) NULL); + return ieee_read_optional_number (info, pp, pv, (bfd_boolean *) NULL); } /* Read a number in an IEEE file. If ppresent is not NULL, the number need not be there. */ -static boolean -ieee_read_optional_number (info, pp, pv, ppresent) - struct ieee_info *info; - const bfd_byte **pp; - bfd_vma *pv; - boolean *ppresent; +static bfd_boolean +ieee_read_optional_number (struct ieee_info *info, const bfd_byte **pp, + bfd_vma *pv, bfd_boolean *ppresent) { ieee_record_enum_type b; @@ -359,11 +344,11 @@ ieee_read_optional_number (info, pp, pv, ppresent) { if (ppresent != NULL) { - *ppresent = false; - return true; + *ppresent = FALSE; + return TRUE; } ieee_eof (info); - return false; + return FALSE; } b = (ieee_record_enum_type) **pp; @@ -373,8 +358,8 @@ ieee_read_optional_number (info, pp, pv, ppresent) { *pv = (bfd_vma) b; if (ppresent != NULL) - *ppresent = true; - return true; + *ppresent = TRUE; + return TRUE; } if (b >= ieee_number_repeat_start_enum && b <= ieee_number_repeat_end_enum) @@ -385,7 +370,7 @@ ieee_read_optional_number (info, pp, pv, ppresent) if (*pp + i - 1 >= info->pend) { ieee_eof (info); - return false; + return FALSE; } *pv = 0; @@ -397,44 +382,38 @@ ieee_read_optional_number (info, pp, pv, ppresent) } if (ppresent != NULL) - *ppresent = true; + *ppresent = TRUE; - return true; + return TRUE; } if (ppresent != NULL) { --*pp; - *ppresent = false; - return true; + *ppresent = FALSE; + return TRUE; } ieee_error (info, *pp - 1, _("invalid number")); - return false; + return FALSE; } /* Read a required string from an IEEE file. */ -static boolean -ieee_read_id (info, pp, pname, pnamlen) - struct ieee_info *info; - const bfd_byte **pp; - const char **pname; - unsigned long *pnamlen; +static bfd_boolean +ieee_read_id (struct ieee_info *info, const bfd_byte **pp, + const char **pname, unsigned long *pnamlen) { - return ieee_read_optional_id (info, pp, pname, pnamlen, (boolean *) NULL); + return ieee_read_optional_id (info, pp, pname, pnamlen, (bfd_boolean *) NULL); } /* Read a string from an IEEE file. If ppresent is not NULL, the string is optional. */ -static boolean -ieee_read_optional_id (info, pp, pname, pnamlen, ppresent) - struct ieee_info *info; - const bfd_byte **pp; - const char **pname; - unsigned long *pnamlen; - boolean *ppresent; +static bfd_boolean +ieee_read_optional_id (struct ieee_info *info, const bfd_byte **pp, + const char **pname, unsigned long *pnamlen, + bfd_boolean *ppresent) { bfd_byte b; unsigned long len; @@ -442,7 +421,7 @@ ieee_read_optional_id (info, pp, pname, pnamlen, ppresent) if (*pp >= info->pend) { ieee_eof (info); - return false; + return FALSE; } b = **pp; @@ -465,17 +444,17 @@ ieee_read_optional_id (info, pp, pname, pnamlen, ppresent) if (ppresent != NULL) { --*pp; - *ppresent = false; - return true; + *ppresent = FALSE; + return TRUE; } ieee_error (info, *pp - 1, _("invalid string length")); - return false; + return FALSE; } if ((unsigned long) (info->pend - *pp) < len) { ieee_eof (info); - return false; + return FALSE; } *pname = (const char *) *pp; @@ -483,9 +462,9 @@ ieee_read_optional_id (info, pp, pname, pnamlen, ppresent) *pp += len; if (ppresent != NULL) - *ppresent = true; + *ppresent = TRUE; - return true; + return TRUE; } /* Read an expression from an IEEE file. Since this code is only used @@ -494,11 +473,9 @@ ieee_read_optional_id (info, pp, pname, pnamlen, ppresent) seen in debugging information. This can be easily extended if necessary. */ -static boolean -ieee_read_expression (info, pp, pv) - struct ieee_info *info; - const bfd_byte **pp; - bfd_vma *pv; +static bfd_boolean +ieee_read_expression (struct ieee_info *info, const bfd_byte **pp, + bfd_vma *pv) { const bfd_byte *expr_start; #define EXPR_STACK_SIZE (10) @@ -513,20 +490,20 @@ ieee_read_expression (info, pp, pv) { const bfd_byte *start; bfd_vma val; - boolean present; + bfd_boolean present; ieee_record_enum_type c; start = *pp; if (! ieee_read_optional_number (info, pp, &val, &present)) - return false; + return FALSE; if (present) { if (esp - expr_stack >= EXPR_STACK_SIZE) { ieee_error (info, start, _("expression stack overflow")); - return false; + return FALSE; } *esp++ = val; continue; @@ -554,20 +531,20 @@ ieee_read_expression (info, pp, pv) asection *s; if (! ieee_read_number (info, pp, &indx)) - return false; + return FALSE; for (s = info->abfd->sections; s != NULL; s = s->next) if ((bfd_vma) s->target_index == indx) break; if (s == NULL) { ieee_error (info, start, _("unknown section")); - return false; + return FALSE; } if (esp - expr_stack >= EXPR_STACK_SIZE) { ieee_error (info, start, _("expression stack overflow")); - return false; + return FALSE; } *esp++ = bfd_get_section_vma (info->abfd, s); @@ -582,7 +559,7 @@ ieee_read_expression (info, pp, pv) if (esp - expr_stack < 2) { ieee_error (info, start, _("expression stack underflow")); - return false; + return FALSE; } v1 = *--esp; @@ -596,23 +573,21 @@ ieee_read_expression (info, pp, pv) if (esp - 1 != expr_stack) { ieee_error (info, expr_start, _("expression stack mismatch")); - return false; + return FALSE; } *pv = *--esp; - return true; + return TRUE; } /* Return an IEEE builtin type. */ static debug_type -ieee_builtin_type (info, p, indx) - struct ieee_info *info; - const bfd_byte *p; - unsigned int indx; +ieee_builtin_type (struct ieee_info *info, const bfd_byte *p, + unsigned int indx) { - PTR dhandle; + void *dhandle; debug_type type; const char *name; @@ -648,42 +623,42 @@ ieee_builtin_type (info, p, indx) break; case builtin_signed_char: - type = debug_make_int_type (dhandle, 1, false); + type = debug_make_int_type (dhandle, 1, FALSE); name = "signed char"; break; case builtin_unsigned_char: - type = debug_make_int_type (dhandle, 1, true); + type = debug_make_int_type (dhandle, 1, TRUE); name = "unsigned char"; break; case builtin_signed_short_int: - type = debug_make_int_type (dhandle, 2, false); + type = debug_make_int_type (dhandle, 2, FALSE); name = "signed short int"; break; case builtin_unsigned_short_int: - type = debug_make_int_type (dhandle, 2, true); + type = debug_make_int_type (dhandle, 2, TRUE); name = "unsigned short int"; break; case builtin_signed_long: - type = debug_make_int_type (dhandle, 4, false); + type = debug_make_int_type (dhandle, 4, FALSE); name = "signed long"; break; case builtin_unsigned_long: - type = debug_make_int_type (dhandle, 4, true); + type = debug_make_int_type (dhandle, 4, TRUE); name = "unsigned long"; break; case builtin_signed_long_long: - type = debug_make_int_type (dhandle, 8, false); + type = debug_make_int_type (dhandle, 8, FALSE); name = "signed long long"; break; case builtin_unsigned_long_long: - type = debug_make_int_type (dhandle, 8, true); + type = debug_make_int_type (dhandle, 8, TRUE); name = "unsigned long long"; break; @@ -717,64 +692,64 @@ ieee_builtin_type (info, p, indx) ieee_builtin_type (info, p, ((unsigned int) builtin_int)), - 0, -1, true); + 0, -1, TRUE); name = "QUOTED STRING"; break; case builtin_instruction_address: /* FIXME: This should be a code address. */ - type = debug_make_int_type (dhandle, 4, true); + type = debug_make_int_type (dhandle, 4, TRUE); name = "instruction address"; break; case builtin_int: /* FIXME: The size for this type should depend upon the processor. */ - type = debug_make_int_type (dhandle, 4, false); + type = debug_make_int_type (dhandle, 4, FALSE); name = "int"; break; case builtin_unsigned: /* FIXME: The size for this type should depend upon the processor. */ - type = debug_make_int_type (dhandle, 4, true); + type = debug_make_int_type (dhandle, 4, TRUE); name = "unsigned"; break; case builtin_unsigned_int: /* FIXME: The size for this type should depend upon the processor. */ - type = debug_make_int_type (dhandle, 4, true); + type = debug_make_int_type (dhandle, 4, TRUE); name = "unsigned int"; break; case builtin_char: - type = debug_make_int_type (dhandle, 1, false); + type = debug_make_int_type (dhandle, 1, FALSE); name = "char"; break; case builtin_long: - type = debug_make_int_type (dhandle, 4, false); + type = debug_make_int_type (dhandle, 4, FALSE); name = "long"; break; case builtin_short: - type = debug_make_int_type (dhandle, 2, false); + type = debug_make_int_type (dhandle, 2, FALSE); name = "short"; break; case builtin_unsigned_short: - type = debug_make_int_type (dhandle, 2, true); + type = debug_make_int_type (dhandle, 2, TRUE); name = "unsigned short"; break; case builtin_short_int: - type = debug_make_int_type (dhandle, 2, false); + type = debug_make_int_type (dhandle, 2, FALSE); name = "short int"; break; case builtin_signed_short: - type = debug_make_int_type (dhandle, 2, false); + type = debug_make_int_type (dhandle, 2, FALSE); name = "signed short"; break; @@ -793,15 +768,12 @@ ieee_builtin_type (info, p, indx) return type; } -/* Allocate more space in the type table. If ref is true, this is a +/* Allocate more space in the type table. If ref is TRUE, this is a reference to the type; if it is not already defined, we should set up an indirect type. */ -static boolean -ieee_alloc_type (info, indx, ref) - struct ieee_info *info; - unsigned int indx; - boolean ref; +static bfd_boolean +ieee_alloc_type (struct ieee_info *info, unsigned int indx, bfd_boolean ref) { unsigned int nalloc; register struct ieee_type *t; @@ -839,20 +811,18 @@ ieee_alloc_type (info, indx, ref) t->type = debug_make_indirect_type (info->dhandle, t->pslot, (const char *) NULL); if (t->type == NULL) - return false; + return FALSE; } } - return true; + return TRUE; } /* Read a type index and return the corresponding type. */ -static boolean -ieee_read_type_index (info, pp, ptype) - struct ieee_info *info; - const bfd_byte **pp; - debug_type *ptype; +static bfd_boolean +ieee_read_type_index (struct ieee_info *info, const bfd_byte **pp, + debug_type *ptype) { const bfd_byte *start; bfd_vma indx; @@ -860,34 +830,30 @@ ieee_read_type_index (info, pp, ptype) start = *pp; if (! ieee_read_number (info, pp, &indx)) - return false; + return FALSE; if (indx < 256) { *ptype = ieee_builtin_type (info, start, indx); if (*ptype == NULL) - return false; - return true; + return FALSE; + return TRUE; } indx -= 256; - if (! ieee_alloc_type (info, indx, true)) - return false; + if (! ieee_alloc_type (info, indx, TRUE)) + return FALSE; *ptype = info->types.types[indx].type; - return true; + return TRUE; } /* Parse IEEE debugging information for a file. This is passed the bytes which compose the Debug Information Part of an IEEE file. */ -boolean -parse_ieee (dhandle, abfd, bytes, len) - PTR dhandle; - bfd *abfd; - const bfd_byte *bytes; - bfd_size_type len; +bfd_boolean +parse_ieee (void *dhandle, bfd *abfd, const bfd_byte *bytes, bfd_size_type len) { struct ieee_info info; unsigned int i; @@ -898,7 +864,7 @@ parse_ieee (dhandle, abfd, bytes, len) info.bytes = bytes; info.pend = bytes + len; info.blockstack.bsp = info.blockstack.stack; - info.saw_filename = false; + info.saw_filename = FALSE; info.vars.alloc = 0; info.vars.vars = NULL; info.global_vars = NULL; @@ -926,38 +892,38 @@ parse_ieee (dhandle, abfd, bytes, len) if (c <= ieee_number_repeat_end_enum) { ieee_error (&info, record_start, _("unexpected number")); - return false; + return FALSE; } switch (c) { default: ieee_error (&info, record_start, _("unexpected record type")); - return false; + return FALSE; case ieee_bb_record_enum: if (! parse_ieee_bb (&info, &p)) - return false; + return FALSE; break; case ieee_be_record_enum: if (! parse_ieee_be (&info, &p)) - return false; + return FALSE; break; case ieee_nn_record: if (! parse_ieee_nn (&info, &p)) - return false; + return FALSE; break; case ieee_ty_record_enum: if (! parse_ieee_ty (&info, &p)) - return false; + return FALSE; break; case ieee_atn_record_enum: if (! parse_ieee_atn (&info, &p)) - return false; + return FALSE; break; } } @@ -966,18 +932,16 @@ parse_ieee (dhandle, abfd, bytes, len) { ieee_error (&info, (const bfd_byte *) NULL, _("blocks left on stack at end")); - return false; + return FALSE; } - return true; + return TRUE; } /* Handle an IEEE BB record. */ -static boolean -parse_ieee_bb (info, pp) - struct ieee_info *info; - const bfd_byte **pp; +static bfd_boolean +parse_ieee_bb (struct ieee_info *info, const bfd_byte **pp) { const bfd_byte *block_start; bfd_byte b; @@ -986,7 +950,7 @@ parse_ieee_bb (info, pp) unsigned long namlen; char *namcopy = NULL; unsigned int fnindx; - boolean skip; + bfd_boolean skip; block_start = *pp; @@ -995,10 +959,10 @@ parse_ieee_bb (info, pp) if (! ieee_read_number (info, pp, &size) || ! ieee_read_id (info, pp, &name, &namlen)) - return false; + return FALSE; fnindx = (unsigned int) -1; - skip = false; + skip = FALSE; switch (b) { @@ -1006,10 +970,10 @@ parse_ieee_bb (info, pp) /* BB1: Type definitions local to a module. */ namcopy = savestring (name, namlen); if (namcopy == NULL) - return false; + return FALSE; if (! debug_set_filename (info->dhandle, namcopy)) - return false; - info->saw_filename = true; + return FALSE; + info->saw_filename = TRUE; /* Discard any variables or types we may have seen before. */ if (info->vars.vars != NULL) @@ -1038,8 +1002,8 @@ parse_ieee_bb (info, pp) /* BB2: Global type definitions. The name is supposed to be empty, but we don't check. */ if (! debug_set_filename (info->dhandle, "*global*")) - return false; - info->saw_filename = true; + return FALSE; + info->saw_filename = TRUE; break; case 3: @@ -1057,7 +1021,7 @@ parse_ieee_bb (info, pp) if (! ieee_read_number (info, pp, &stackspace) || ! ieee_read_number (info, pp, &typindx) || ! ieee_read_expression (info, pp, &offset)) - return false; + return FALSE; /* We have no way to record the stack space. FIXME. */ @@ -1065,13 +1029,13 @@ parse_ieee_bb (info, pp) { return_type = ieee_builtin_type (info, block_start, typindx); if (return_type == DEBUG_TYPE_NULL) - return false; + return FALSE; } else { typindx -= 256; - if (! ieee_alloc_type (info, typindx, true)) - return false; + if (! ieee_alloc_type (info, typindx, TRUE)) + return FALSE; fnindx = typindx; return_type = info->types.types[typindx].type; if (debug_get_type_kind (info->dhandle, return_type) @@ -1082,10 +1046,10 @@ parse_ieee_bb (info, pp) namcopy = savestring (name, namlen); if (namcopy == NULL) - return false; + return FALSE; if (! debug_record_function (info->dhandle, namcopy, return_type, - true, offset)) - return false; + TRUE, offset)) + return FALSE; } break; @@ -1098,19 +1062,19 @@ parse_ieee_bb (info, pp) for (i = 0; i < 6; i++) { bfd_vma ignore; - boolean present; + bfd_boolean present; if (! ieee_read_optional_number (info, pp, &ignore, &present)) - return false; + return FALSE; if (! present) break; } namcopy = savestring (name, namlen); if (namcopy == NULL) - return false; + return FALSE; if (! debug_start_source (info->dhandle, namcopy)) - return false; + return FALSE; } break; @@ -1122,14 +1086,14 @@ parse_ieee_bb (info, pp) if (! ieee_read_number (info, pp, &stackspace) || ! ieee_read_number (info, pp, &typindx) || ! ieee_read_expression (info, pp, &offset)) - return false; + return FALSE; /* We have no way to record the stack space. FIXME. */ if (namlen == 0) { if (! debug_start_block (info->dhandle, offset)) - return false; + return FALSE; /* Change b to indicate that this is a block rather than a function. */ b = 0x86; @@ -1142,7 +1106,7 @@ parse_ieee_bb (info, pp) converting from IEEE to other debug formats work better. */ if (strncmp (name, "__XRYCPP", namlen) == 0) - skip = true; + skip = TRUE; else { debug_type return_type; @@ -1152,13 +1116,13 @@ parse_ieee_bb (info, pp) return_type = ieee_builtin_type (info, block_start, typindx); if (return_type == NULL) - return false; + return FALSE; } else { typindx -= 256; - if (! ieee_alloc_type (info, typindx, true)) - return false; + if (! ieee_alloc_type (info, typindx, TRUE)) + return FALSE; fnindx = typindx; return_type = info->types.types[typindx].type; if (debug_get_type_kind (info->dhandle, return_type) @@ -1169,10 +1133,10 @@ parse_ieee_bb (info, pp) namcopy = savestring (name, namlen); if (namcopy == NULL) - return false; + return FALSE; if (! debug_record_function (info->dhandle, namcopy, - return_type, false, offset)) - return false; + return_type, FALSE, offset)) + return FALSE; } } } @@ -1185,29 +1149,29 @@ parse_ieee_bb (info, pp) const char *inam, *vstr; unsigned long inamlen, vstrlen; bfd_vma tool_type; - boolean present; + bfd_boolean present; unsigned int i; if (! info->saw_filename) { namcopy = savestring (name, namlen); if (namcopy == NULL) - return false; + return FALSE; if (! debug_set_filename (info->dhandle, namcopy)) - return false; - info->saw_filename = true; + return FALSE; + info->saw_filename = TRUE; } if (! ieee_read_id (info, pp, &inam, &inamlen) || ! ieee_read_number (info, pp, &tool_type) || ! ieee_read_optional_id (info, pp, &vstr, &vstrlen, &present)) - return false; + return FALSE; for (i = 0; i < 6; i++) { bfd_vma ignore; if (! ieee_read_optional_number (info, pp, &ignore, &present)) - return false; + return FALSE; if (! present) break; } @@ -1219,19 +1183,19 @@ parse_ieee_bb (info, pp) information. FIXME. */ { bfd_vma sectype, secindx, offset, map; - boolean present; + bfd_boolean present; if (! ieee_read_number (info, pp, §ype) || ! ieee_read_number (info, pp, &secindx) || ! ieee_read_expression (info, pp, &offset) || ! ieee_read_optional_number (info, pp, &map, &present)) - return false; + return FALSE; } break; default: ieee_error (info, block_start, _("unknown BB type")); - return false; + return FALSE; } @@ -1240,7 +1204,7 @@ parse_ieee_bb (info, pp) if (info->blockstack.bsp >= info->blockstack.stack + BLOCKSTACK_SIZE) { ieee_error (info, (const bfd_byte *) NULL, _("stack overflow")); - return false; + return FALSE; } info->blockstack.bsp->kind = b; @@ -1250,29 +1214,27 @@ parse_ieee_bb (info, pp) info->blockstack.bsp->skip = skip; ++info->blockstack.bsp; - return true; + return TRUE; } /* Handle an IEEE BE record. */ -static boolean -parse_ieee_be (info, pp) - struct ieee_info *info; - const bfd_byte **pp; +static bfd_boolean +parse_ieee_be (struct ieee_info *info, const bfd_byte **pp) { bfd_vma offset; if (info->blockstack.bsp <= info->blockstack.stack) { ieee_error (info, *pp, _("stack underflow")); - return false; + return FALSE; } --info->blockstack.bsp; switch (info->blockstack.bsp->kind) { case 2: - /* When we end the global typedefs block, we copy out the the + /* When we end the global typedefs block, we copy out the contents of info->vars. This is because the variable indices may be reused in the local blocks. However, we need to preserve them so that we can locate a function returning a @@ -1305,11 +1267,11 @@ parse_ieee_be (info, pp) case 4: case 6: if (! ieee_read_expression (info, pp, &offset)) - return false; + return FALSE; if (! info->blockstack.bsp->skip) { if (! debug_end_function (info->dhandle, offset + 1)) - return false; + return FALSE; } break; @@ -1317,9 +1279,9 @@ parse_ieee_be (info, pp) /* This is BE6 when BB6 started a block rather than a local function. */ if (! ieee_read_expression (info, pp, &offset)) - return false; + return FALSE; if (! debug_end_block (info->dhandle, offset + 1)) - return false; + return FALSE; break; case 5: @@ -1336,7 +1298,7 @@ parse_ieee_be (info, pp) if (bl->kind == 5) { if (! debug_start_source (info->dhandle, bl->filename)) - return false; + return FALSE; break; } } @@ -1346,7 +1308,7 @@ parse_ieee_be (info, pp) case 11: if (! ieee_read_expression (info, pp, &offset)) - return false; + return FALSE; /* We just ignore the module size. FIXME. */ break; @@ -1355,15 +1317,13 @@ parse_ieee_be (info, pp) break; } - return true; + return TRUE; } /* Parse an NN record. */ -static boolean -parse_ieee_nn (info, pp) - struct ieee_info *info; - const bfd_byte **pp; +static bfd_boolean +parse_ieee_nn (struct ieee_info *info, const bfd_byte **pp) { const bfd_byte *nn_start; bfd_vma varindx; @@ -1374,12 +1334,12 @@ parse_ieee_nn (info, pp) if (! ieee_read_number (info, pp, &varindx) || ! ieee_read_id (info, pp, &name, &namlen)) - return false; + return FALSE; if (varindx < 32) { ieee_error (info, nn_start, _("illegal variable index")); - return false; + return FALSE; } varindx -= 32; @@ -1403,20 +1363,18 @@ parse_ieee_nn (info, pp) info->vars.vars[varindx].name = name; info->vars.vars[varindx].namlen = namlen; - return true; + return TRUE; } /* Parse a TY record. */ -static boolean -parse_ieee_ty (info, pp) - struct ieee_info *info; - const bfd_byte **pp; +static bfd_boolean +parse_ieee_ty (struct ieee_info *info, const bfd_byte **pp) { const bfd_byte *ty_start, *ty_var_start, *ty_code_start; bfd_vma typeindx, varindx, tc; - PTR dhandle; - boolean tag, typdef; + void *dhandle; + bfd_boolean tag, typdef; debug_type *arg_slots; unsigned long type_bitsize; debug_type type; @@ -1424,59 +1382,59 @@ parse_ieee_ty (info, pp) ty_start = *pp; if (! ieee_read_number (info, pp, &typeindx)) - return false; + return FALSE; if (typeindx < 256) { ieee_error (info, ty_start, _("illegal type index")); - return false; + return FALSE; } typeindx -= 256; - if (! ieee_alloc_type (info, typeindx, false)) - return false; + if (! ieee_alloc_type (info, typeindx, FALSE)) + return FALSE; if (**pp != 0xce) { ieee_error (info, *pp, _("unknown TY code")); - return false; + return FALSE; } ++*pp; ty_var_start = *pp; if (! ieee_read_number (info, pp, &varindx)) - return false; + return FALSE; if (varindx < 32) { ieee_error (info, ty_var_start, _("illegal variable index")); - return false; + return FALSE; } varindx -= 32; if (varindx >= info->vars.alloc || info->vars.vars[varindx].name == NULL) { ieee_error (info, ty_var_start, _("undefined variable in TY")); - return false; + return FALSE; } ty_code_start = *pp; if (! ieee_read_number (info, pp, &tc)) - return false; + return FALSE; dhandle = info->dhandle; - tag = false; - typdef = false; + tag = FALSE; + typdef = FALSE; arg_slots = NULL; type_bitsize = 0; switch (tc) { default: ieee_error (info, ty_code_start, _("unknown TY code")); - return false; + return FALSE; case '!': /* Unknown type, with size. We treat it as int. FIXME. */ @@ -1484,8 +1442,8 @@ parse_ieee_ty (info, pp) bfd_vma size; if (! ieee_read_number (info, pp, &size)) - return false; - type = debug_make_int_type (dhandle, size, false); + return FALSE; + type = debug_make_int_type (dhandle, size, FALSE); } break; @@ -1499,14 +1457,14 @@ parse_ieee_ty (info, pp) if (! ieee_read_type_index (info, pp, &ele_type) || ! ieee_read_number (info, pp, &lower) || ! ieee_read_number (info, pp, &upper)) - return false; + return FALSE; type = debug_make_array_type (dhandle, ele_type, ieee_builtin_type (info, ty_code_start, ((unsigned int) builtin_int)), (bfd_signed_vma) lower, (bfd_signed_vma) upper, - false); + FALSE); } break; @@ -1521,7 +1479,7 @@ parse_ieee_ty (info, pp) unsigned int i; if (! ieee_read_number (info, pp, &size)) - return false; + return FALSE; /* FIXME: we ignore the enumeration size. */ alloc = 10; @@ -1532,10 +1490,10 @@ parse_ieee_ty (info, pp) { const char *name; unsigned long namlen; - boolean present; + bfd_boolean present; if (! ieee_read_optional_id (info, pp, &name, &namlen, &present)) - return false; + return FALSE; if (! present) break; @@ -1548,7 +1506,7 @@ parse_ieee_ty (info, pp) names[c] = savestring (name, namlen); if (names[c] == NULL) - return false; + return FALSE; ++c; } @@ -1559,7 +1517,7 @@ parse_ieee_ty (info, pp) vals[i] = i; type = debug_make_enum_type (dhandle, names, vals); - tag = true; + tag = TRUE; } break; @@ -1572,7 +1530,7 @@ parse_ieee_ty (info, pp) unsigned int c; if (! ieee_read_number (info, pp, &size)) - return false; + return FALSE; alloc = 10; fields = (debug_field *) xmalloc (alloc * sizeof *fields); @@ -1581,18 +1539,18 @@ parse_ieee_ty (info, pp) { const char *name; unsigned long namlen; - boolean present; + bfd_boolean present; debug_type ftype; bfd_vma bitpos, bitsize; if (! ieee_read_optional_id (info, pp, &name, &namlen, &present)) - return false; + return FALSE; if (! present) break; if (! ieee_read_type_index (info, pp, &ftype) || ! ieee_read_number (info, pp, &bitpos) || ! ieee_read_number (info, pp, &bitsize)) - return false; + return FALSE; if (c + 1 >= alloc) { @@ -1605,14 +1563,14 @@ parse_ieee_ty (info, pp) ftype, bitpos, bitsize, DEBUG_VISIBILITY_PUBLIC); if (fields[c] == NULL) - return false; + return FALSE; ++c; } fields[c] = NULL; - type = debug_make_struct_type (dhandle, true, size, fields); - tag = true; + type = debug_make_struct_type (dhandle, TRUE, size, fields); + tag = TRUE; } break; @@ -1632,15 +1590,15 @@ parse_ieee_ty (info, pp) { const char *name; unsigned long namlen; - boolean present; + bfd_boolean present; bfd_vma val; if (! ieee_read_optional_id (info, pp, &name, &namlen, &present)) - return false; + return FALSE; if (! present) break; if (! ieee_read_number (info, pp, &val)) - return false; + return FALSE; /* If the length of the name is zero, then the value is actually the size of the enum. We ignore this @@ -1659,7 +1617,7 @@ parse_ieee_ty (info, pp) names[c] = savestring (name, namlen); if (names[c] == NULL) - return false; + return FALSE; vals[c] = (bfd_signed_vma) val; ++c; } @@ -1667,7 +1625,7 @@ parse_ieee_ty (info, pp) names[c] = NULL; type = debug_make_enum_type (dhandle, names, vals); - tag = true; + tag = TRUE; } break; @@ -1678,7 +1636,7 @@ parse_ieee_ty (info, pp) debug_type t; if (! ieee_read_type_index (info, pp, &t)) - return false; + return FALSE; type = debug_make_pointer_type (dhandle, t); } break; @@ -1692,7 +1650,7 @@ parse_ieee_ty (info, pp) || ! ieee_read_number (info, pp, &high) || ! ieee_read_number (info, pp, &signedp) || ! ieee_read_number (info, pp, &size)) - return false; + return FALSE; type = debug_make_range_type (dhandle, debug_make_int_type (dhandle, size, @@ -1711,7 +1669,7 @@ parse_ieee_ty (info, pp) unsigned int c; if (! ieee_read_number (info, pp, &size)) - return false; + return FALSE; alloc = 10; fields = (debug_field *) xmalloc (alloc * sizeof *fields); @@ -1720,19 +1678,19 @@ parse_ieee_ty (info, pp) { const char *name; unsigned long namlen; - boolean present; + bfd_boolean present; bfd_vma tindx; bfd_vma offset; debug_type ftype; bfd_vma bitsize; if (! ieee_read_optional_id (info, pp, &name, &namlen, &present)) - return false; + return FALSE; if (! present) break; if (! ieee_read_number (info, pp, &tindx) || ! ieee_read_number (info, pp, &offset)) - return false; + return FALSE; if (tindx < 256) { @@ -1745,8 +1703,8 @@ parse_ieee_ty (info, pp) struct ieee_type *t; tindx -= 256; - if (! ieee_alloc_type (info, tindx, true)) - return false; + if (! ieee_alloc_type (info, tindx, TRUE)) + return FALSE; t = info->types.types + tindx; ftype = t->type; bitsize = t->bitsize; @@ -1765,22 +1723,22 @@ parse_ieee_ty (info, pp) ftype, offset, bitsize, DEBUG_VISIBILITY_PUBLIC); if (fields[c] == NULL) - return false; + return FALSE; ++c; } fields[c] = NULL; type = debug_make_struct_type (dhandle, tc == 'S', size, fields); - tag = true; + tag = TRUE; } break; case 'T': /* Typedef. */ if (! ieee_read_type_index (info, pp, &type)) - return false; - typdef = true; + return FALSE; + typdef = TRUE; break; case 'X': @@ -1790,7 +1748,7 @@ parse_ieee_ty (info, pp) bfd_vma attr; debug_type rtype; bfd_vma nargs; - boolean present; + bfd_boolean present; struct ieee_var *pv; /* FIXME: We ignore the attribute and the argument names. */ @@ -1798,14 +1756,14 @@ parse_ieee_ty (info, pp) if (! ieee_read_number (info, pp, &attr) || ! ieee_read_type_index (info, pp, &rtype) || ! ieee_read_number (info, pp, &nargs)) - return false; + return FALSE; do { const char *name; unsigned long namlen; if (! ieee_read_optional_id (info, pp, &name, &namlen, &present)) - return false; + return FALSE; } while (present); @@ -1824,7 +1782,7 @@ parse_ieee_ty (info, pp) } type = debug_make_function_type (dhandle, rtype, (debug_type *) NULL, - false); + FALSE); } break; @@ -1841,13 +1799,13 @@ parse_ieee_ty (info, pp) if (! ieee_read_type_index (info, pp, &etype) || ! ieee_read_number (info, pp, &high)) - return false; + return FALSE; type = debug_make_array_type (dhandle, etype, ieee_builtin_type (info, ty_code_start, ((unsigned int) builtin_int)), - 0, (bfd_signed_vma) high, false); + 0, (bfd_signed_vma) high, FALSE); } break; @@ -1860,7 +1818,7 @@ parse_ieee_ty (info, pp) /* FIXME: I don't know what the name means. */ if (! ieee_read_id (info, pp, &name, &namlen)) - return false; + return FALSE; type = debug_make_complex_type (dhandle, tc == 'c' ? 4 : 8); } @@ -1869,35 +1827,35 @@ parse_ieee_ty (info, pp) case 'f': /* Pascal file name. FIXME. */ ieee_error (info, ty_code_start, _("Pascal file name not supported")); - return false; + return FALSE; case 'g': /* Bitfield type. */ { bfd_vma signedp, bitsize, dummy; const bfd_byte *hold; - boolean present; + bfd_boolean present; if (! ieee_read_number (info, pp, &signedp) || ! ieee_read_number (info, pp, &bitsize)) - return false; + return FALSE; /* I think the documentation says that there is a type index, but some actual files do not have one. */ hold = *pp; if (! ieee_read_optional_number (info, pp, &dummy, &present)) - return false; + return FALSE; if (! present) { /* FIXME: This is just a guess. */ type = debug_make_int_type (dhandle, 4, - signedp ? false : true); + signedp ? FALSE : TRUE); } else { *pp = hold; if (! ieee_read_type_index (info, pp, &type)) - return false; + return FALSE; } type_bitsize = bitsize; } @@ -1911,13 +1869,13 @@ parse_ieee_ty (info, pp) if (! ieee_read_number (info, pp, &kind) || ! ieee_read_type_index (info, pp, &t)) - return false; + return FALSE; switch (kind) { default: ieee_error (info, ty_start, _("unsupported qualifier")); - return false; + return FALSE; case 1: type = debug_make_const_type (dhandle, t); @@ -1938,11 +1896,11 @@ parse_ieee_ty (info, pp) if (! ieee_read_number (info, pp, &size) || ! ieee_read_type_index (info, pp, &etype)) - return false; + return FALSE; /* FIXME: We ignore the size. */ - type = debug_make_set_type (dhandle, etype, false); + type = debug_make_set_type (dhandle, etype, FALSE); } break; @@ -1953,8 +1911,8 @@ parse_ieee_ty (info, pp) bfd_vma attr, frame_type, push_mask, nargs, level, father; debug_type rtype; debug_type *arg_types; - boolean varargs; - boolean present; + bfd_boolean varargs; + bfd_boolean present; /* FIXME: We ignore some of this information. */ @@ -1965,11 +1923,11 @@ parse_ieee_ty (info, pp) || ! ieee_read_number (info, pp, &push_mask) || ! ieee_read_type_index (info, pp, &rtype) || ! ieee_read_number (info, pp, &nargs)) - return false; + return FALSE; if (nargs == (bfd_vma) -1) { arg_types = NULL; - varargs = false; + varargs = FALSE; } else { @@ -1979,11 +1937,11 @@ parse_ieee_ty (info, pp) xmalloc ((nargs + 1) * sizeof *arg_types)); for (i = 0; i < nargs; i++) if (! ieee_read_type_index (info, pp, arg_types + i)) - return false; + return FALSE; /* If the last type is pointer to void, this is really a varargs function. */ - varargs = false; + varargs = FALSE; if (nargs > 0) { debug_type last; @@ -1996,7 +1954,7 @@ parse_ieee_ty (info, pp) == DEBUG_KIND_VOID)) { --nargs; - varargs = true; + varargs = TRUE; } } @@ -2026,7 +1984,7 @@ parse_ieee_ty (info, pp) } if (! ieee_read_number (info, pp, &level) || ! ieee_read_optional_number (info, pp, &father, &present)) - return false; + return FALSE; /* We can't distinguish between a global function and a static function. */ @@ -2052,7 +2010,7 @@ parse_ieee_ty (info, pp) /* Record the type in the table. */ if (type == DEBUG_TYPE_NULL) - return false; + return FALSE; info->vars.vars[varindx].type = type; @@ -2088,7 +2046,7 @@ parse_ieee_ty (info, pp) it->type = type; } if (type == NULL) - return false; + return FALSE; } info->types.types[typeindx].type = type; @@ -2102,39 +2060,37 @@ parse_ieee_ty (info, pp) if (info->types.types[typeindx].pslot != NULL) *info->types.types[typeindx].pslot = type; - return true; + return TRUE; } /* Parse an ATN record. */ -static boolean -parse_ieee_atn (info, pp) - struct ieee_info *info; - const bfd_byte **pp; +static bfd_boolean +parse_ieee_atn (struct ieee_info *info, const bfd_byte **pp) { const bfd_byte *atn_start, *atn_code_start; bfd_vma varindx; struct ieee_var *pvar; debug_type type; bfd_vma atn_code; - PTR dhandle; + void *dhandle; bfd_vma v, v2, v3, v4, v5; const char *name; unsigned long namlen; char *namcopy; - boolean present; + bfd_boolean present; int blocktype; atn_start = *pp; if (! ieee_read_number (info, pp, &varindx) || ! ieee_read_type_index (info, pp, &type)) - return false; + return FALSE; atn_code_start = *pp; if (! ieee_read_number (info, pp, &atn_code)) - return false; + return FALSE; if (varindx == 0) { @@ -2150,7 +2106,7 @@ parse_ieee_atn (info, pp) return ieee_read_number (info, pp, &v); ieee_error (info, atn_start, _("illegal variable index")); - return false; + return FALSE; } else { @@ -2188,7 +2144,7 @@ parse_ieee_atn (info, pp) else { ieee_error (info, atn_start, _("undefined variable in ATN")); - return false; + return FALSE; } } @@ -2231,12 +2187,12 @@ parse_ieee_atn (info, pp) { default: ieee_error (info, atn_code_start, _("unknown ATN type")); - return false; + return FALSE; case 1: /* Automatic variable. */ if (! ieee_read_number (info, pp, &v)) - return false; + return FALSE; namcopy = savestring (name, namlen); if (type == NULL) type = debug_make_void_type (dhandle); @@ -2247,7 +2203,7 @@ parse_ieee_atn (info, pp) case 2: /* Register variable. */ if (! ieee_read_number (info, pp, &v)) - return false; + return FALSE; namcopy = savestring (name, namlen); if (type == NULL) type = debug_make_void_type (dhandle); @@ -2259,7 +2215,7 @@ parse_ieee_atn (info, pp) case 3: /* Static variable. */ if (! ieee_require_asn (info, pp, &v)) - return false; + return FALSE; namcopy = savestring (name, namlen); if (type == NULL) type = debug_make_void_type (dhandle); @@ -2284,30 +2240,30 @@ parse_ieee_atn (info, pp) /* External function. We don't currently record these. FIXME. */ if (pvar != NULL) pvar->kind = IEEE_EXTERNAL; - return true; + return TRUE; case 5: /* External variable. We don't currently record these. FIXME. */ if (pvar != NULL) pvar->kind = IEEE_EXTERNAL; - return true; + return TRUE; case 7: if (! ieee_read_number (info, pp, &v) || ! ieee_read_number (info, pp, &v2) || ! ieee_read_optional_number (info, pp, &v3, &present)) - return false; + return FALSE; if (present) { if (! ieee_read_optional_number (info, pp, &v4, &present)) - return false; + return FALSE; } /* We just ignore the two optional fields in v3 and v4, since they are not defined. */ if (! ieee_require_asn (info, pp, &v3)) - return false; + return FALSE; /* We have no way to record the column number. FIXME. */ @@ -2316,7 +2272,7 @@ parse_ieee_atn (info, pp) case 8: /* Global variable. */ if (! ieee_require_asn (info, pp, &v)) - return false; + return FALSE; namcopy = savestring (name, namlen); if (type == NULL) type = debug_make_void_type (dhandle); @@ -2327,10 +2283,10 @@ parse_ieee_atn (info, pp) case 9: /* Variable lifetime information. */ if (! ieee_read_number (info, pp, &v)) - return false; + return FALSE; /* We have no way to record this information. FIXME. */ - return true; + return TRUE; case 10: /* Locked register. The spec says that there are two required @@ -2338,7 +2294,7 @@ parse_ieee_atn (info, pp) one. */ if (! ieee_read_number (info, pp, &v) || ! ieee_read_optional_number (info, pp, &v2, &present)) - return false; + return FALSE; /* I think this means a variable that is both in a register and a frame slot. We ignore the frame slot. FIXME. */ @@ -2354,8 +2310,8 @@ parse_ieee_atn (info, pp) /* Reserved for FORTRAN common. */ ieee_error (info, atn_code_start, _("unsupported ATN11")); - /* Return true to keep going. */ - return true; + /* Return TRUE to keep going. */ + return TRUE; case 12: /* Based variable. */ @@ -2365,15 +2321,15 @@ parse_ieee_atn (info, pp) if (! ieee_read_number (info, pp, &v) || ! ieee_read_number (info, pp, &v2) || ! ieee_read_optional_number (info, pp, &v3, &present)) - return false; + return FALSE; if (present) { if (! ieee_read_optional_number (info, pp, &v4, &present)) - return false; + return FALSE; if (present) { if (! ieee_read_optional_number (info, pp, &v5, &present)) - return false; + return FALSE; } } @@ -2381,33 +2337,33 @@ parse_ieee_atn (info, pp) ieee_error (info, atn_code_start, _("unsupported ATN12")); - /* Return true to keep going. */ - return true; + /* Return TRUE to keep going. */ + return TRUE; case 16: /* Constant. The description of this that I have is ambiguous, so I'm not going to try to implement it. */ if (! ieee_read_number (info, pp, &v) || ! ieee_read_optional_number (info, pp, &v2, &present)) - return false; + return FALSE; if (present) { if (! ieee_read_optional_number (info, pp, &v2, &present)) - return false; + return FALSE; if (present) { if (! ieee_read_optional_id (info, pp, &name, &namlen, &present)) - return false; + return FALSE; } } if ((ieee_record_enum_type) **pp == ieee_e2_first_byte_enum) { if (! ieee_require_asn (info, pp, &v3)) - return false; + return FALSE; } - return true; + return TRUE; case 19: /* Static variable from assembler. */ @@ -2415,7 +2371,7 @@ parse_ieee_atn (info, pp) if (! ieee_read_number (info, pp, &v) || ! ieee_read_optional_number (info, pp, &v2, &present) || ! ieee_require_asn (info, pp, &v3)) - return false; + return FALSE; namcopy = savestring (name, namlen); /* We don't really handle this correctly. FIXME. */ return debug_record_variable (dhandle, namcopy, @@ -2432,7 +2388,7 @@ parse_ieee_atn (info, pp) if (! ieee_read_number (info, pp, &v) || ! ieee_read_number (info, pp, &v2) || ! ieee_read_optional_id (info, pp, &name, &namlen, &present)) - return false; + return FALSE; if (atn_code == 62 && v == 80) { @@ -2440,7 +2396,7 @@ parse_ieee_atn (info, pp) { ieee_error (info, atn_code_start, _("unexpected string in C++ misc")); - return false; + return FALSE; } return ieee_read_cxx_misc (info, pp, v2); } @@ -2453,21 +2409,21 @@ parse_ieee_atn (info, pp) { default: ieee_error (info, *pp, _("bad misc record")); - return false; + return FALSE; case ieee_at_record_enum: if (! ieee_require_atn65 (info, pp, &name, &namlen)) - return false; + return FALSE; break; case ieee_e2_first_byte_enum: if (! ieee_require_asn (info, pp, &v3)) - return false; + return FALSE; break; } } - return true; + return TRUE; } /*NOTREACHED*/ @@ -2476,11 +2432,9 @@ parse_ieee_atn (info, pp) /* Handle C++ debugging miscellaneous records. This is called for procedure miscellaneous records of type 80. */ -static boolean -ieee_read_cxx_misc (info, pp, count) - struct ieee_info *info; - const bfd_byte **pp; - unsigned long count; +static bfd_boolean +ieee_read_cxx_misc (struct ieee_info *info, const bfd_byte **pp, + unsigned long count) { const bfd_byte *start; bfd_vma category; @@ -2489,18 +2443,18 @@ ieee_read_cxx_misc (info, pp, count) /* Get the category of C++ misc record. */ if (! ieee_require_asn (info, pp, &category)) - return false; + return FALSE; --count; switch (category) { default: ieee_error (info, start, _("unrecognized C++ misc record")); - return false; + return FALSE; case 'T': if (! ieee_read_cxx_class (info, pp, count)) - return false; + return FALSE; break; case 'M': @@ -2514,12 +2468,12 @@ ieee_read_cxx_misc (info, pp, count) function. */ if (! ieee_require_asn (info, pp, &flags)) - return false; + return FALSE; if (*pp < info->pend && (ieee_record_enum_type) **pp == ieee_at_record_enum) { if (! ieee_require_atn65 (info, pp, &name, &namlen)) - return false; + return FALSE; } /* This is emitted for method functions, but I don't think we @@ -2531,7 +2485,7 @@ ieee_read_cxx_misc (info, pp, count) case 'B': if (! ieee_read_cxx_defaults (info, pp, count)) - return false; + return FALSE; break; case 'z': @@ -2546,7 +2500,7 @@ ieee_read_cxx_misc (info, pp, count) || ! ieee_require_atn65 (info, pp, &mangled, &mangledlen) || ! ieee_require_atn65 (info, pp, &class, &classlen) || ! ieee_require_asn (info, pp, &control)) - return false; + return FALSE; /* FIXME: We should now track down name and change its type. */ } @@ -2554,28 +2508,26 @@ ieee_read_cxx_misc (info, pp, count) case 'R': if (! ieee_read_reference (info, pp)) - return false; + return FALSE; break; } - return true; + return TRUE; } /* Read a C++ class definition. This is a pmisc type 80 record of category 'T'. */ -static boolean -ieee_read_cxx_class (info, pp, count) - struct ieee_info *info; - const bfd_byte **pp; - unsigned long count; +static bfd_boolean +ieee_read_cxx_class (struct ieee_info *info, const bfd_byte **pp, + unsigned long count) { const bfd_byte *start; bfd_vma class; const char *tag; unsigned long taglen; struct ieee_tag *it; - PTR dhandle; + void *dhandle; debug_field *fields; unsigned int field_count, field_alloc; debug_baseclass *baseclasses; @@ -2591,17 +2543,17 @@ ieee_read_cxx_class (info, pp, count) } *methods; unsigned int methods_count, methods_alloc; debug_type vptrbase; - boolean ownvptr; + bfd_boolean ownvptr; debug_method *dmethods; start = *pp; if (! ieee_require_asn (info, pp, &class)) - return false; + return FALSE; --count; if (! ieee_require_atn65 (info, pp, &tag, &taglen)) - return false; + return FALSE; --count; /* Find the C struct with this name. */ @@ -2613,7 +2565,7 @@ ieee_read_cxx_class (info, pp, count) if (it == NULL) { ieee_error (info, start, _("undefined C++ object")); - return false; + return FALSE; } dhandle = info->dhandle; @@ -2628,7 +2580,7 @@ ieee_read_cxx_class (info, pp, count) methods_count = 0; methods_alloc = 0; vptrbase = DEBUG_TYPE_NULL; - ownvptr = false; + ownvptr = FALSE; structfields = debug_get_fields (dhandle, it->type); @@ -2640,14 +2592,14 @@ ieee_read_cxx_class (info, pp, count) spec_start = *pp; if (! ieee_require_asn (info, pp, &id)) - return false; + return FALSE; --count; switch (id) { default: ieee_error (info, spec_start, _("unrecognized C++ object spec")); - return false; + return FALSE; case 'b': { @@ -2657,7 +2609,7 @@ ieee_read_cxx_class (info, pp, count) char *basecopy; debug_type basetype; bfd_vma bitpos; - boolean virtualp; + bfd_boolean virtualp; enum debug_visibility visibility; debug_baseclass baseclass; @@ -2667,7 +2619,7 @@ ieee_read_cxx_class (info, pp, count) || ! ieee_require_atn65 (info, pp, &basename, &baselen) || ! ieee_require_asn (info, pp, &cinline) || ! ieee_require_atn65 (info, pp, &fieldname, &fieldlen)) - return false; + return FALSE; count -= 4; /* We have no way of recording friend information, so we @@ -2683,7 +2635,7 @@ ieee_read_cxx_class (info, pp, count) if ((fieldlen == 0) == (cinline == 0)) { ieee_error (info, start, _("unsupported C++ object type")); - return false; + return FALSE; } basecopy = savestring (basename, baselen); @@ -2693,7 +2645,7 @@ ieee_read_cxx_class (info, pp, count) if (basetype == DEBUG_TYPE_NULL) { ieee_error (info, start, _("C++ base class not defined")); - return false; + return FALSE; } if (fieldlen == 0) @@ -2705,7 +2657,7 @@ ieee_read_cxx_class (info, pp, count) if (structfields == NULL) { ieee_error (info, start, _("C++ object has no fields")); - return false; + return FALSE; } for (pf = structfields; *pf != DEBUG_FIELD_NULL; pf++) @@ -2714,7 +2666,7 @@ ieee_read_cxx_class (info, pp, count) fname = debug_get_field_name (dhandle, *pf); if (fname == NULL) - return false; + return FALSE; if (fname[0] == fieldname[0] && strncmp (fname, fieldname, fieldlen) == 0 && strlen (fname) == fieldlen) @@ -2724,16 +2676,16 @@ ieee_read_cxx_class (info, pp, count) { ieee_error (info, start, _("C++ base class not found in container")); - return false; + return FALSE; } bitpos = debug_get_field_bitpos (dhandle, *pf); } if ((flags & BASEFLAGS_VIRTUAL) != 0) - virtualp = true; + virtualp = TRUE; else - virtualp = false; + virtualp = FALSE; if ((flags & BASEFLAGS_PRIVATE) != 0) visibility = DEBUG_VISIBILITY_PRIVATE; else @@ -2742,7 +2694,7 @@ ieee_read_cxx_class (info, pp, count) baseclass = debug_make_baseclass (dhandle, basetype, bitpos, virtualp, visibility); if (baseclass == DEBUG_BASECLASS_NULL) - return false; + return FALSE; if (baseclasses_count + 1 >= baseclasses_alloc) { @@ -2765,7 +2717,7 @@ ieee_read_cxx_class (info, pp, count) const char *fieldname, *mangledname; unsigned long fieldlen, mangledlen; char *fieldcopy; - boolean staticp; + bfd_boolean staticp; debug_type ftype; const debug_field *pf = NULL; enum debug_visibility visibility; @@ -2776,12 +2728,12 @@ ieee_read_cxx_class (info, pp, count) if (! ieee_require_asn (info, pp, &flags) || ! ieee_require_atn65 (info, pp, &fieldname, &fieldlen) || ! ieee_require_atn65 (info, pp, &mangledname, &mangledlen)) - return false; + return FALSE; count -= 3; fieldcopy = savestring (fieldname, fieldlen); - staticp = (flags & CXXFLAGS_STATIC) != 0 ? true : false; + staticp = (flags & CXXFLAGS_STATIC) != 0 ? TRUE : FALSE; if (staticp) { @@ -2810,7 +2762,7 @@ ieee_read_cxx_class (info, pp, count) if (structfields == NULL) { ieee_error (info, start, _("C++ object has no fields")); - return false; + return FALSE; } for (pf = structfields, findx = 0; @@ -2821,7 +2773,7 @@ ieee_read_cxx_class (info, pp, count) fname = debug_get_field_name (dhandle, *pf); if (fname == NULL) - return false; + return FALSE; if (fname[0] == mangledname[0] && strncmp (fname, mangledname, mangledlen) == 0 && strlen (fname) == mangledlen) @@ -2831,7 +2783,7 @@ ieee_read_cxx_class (info, pp, count) { ieee_error (info, start, _("C++ data member not found in container")); - return false; + return FALSE; } ftype = debug_get_field_type (dhandle, *pf); @@ -2858,7 +2810,7 @@ ieee_read_cxx_class (info, pp, count) } if (ftype == DEBUG_TYPE_NULL) - return false; + return FALSE; it->fslots[findx] = ftype; ftype = debug_make_indirect_type (dhandle, it->fslots + findx, @@ -2866,13 +2818,13 @@ ieee_read_cxx_class (info, pp, count) } } if (ftype == DEBUG_TYPE_NULL) - return false; + return FALSE; switch (flags & CXXFLAGS_VISIBILITY) { default: ieee_error (info, start, _("unknown C++ visibility")); - return false; + return FALSE; case CXXFLAGS_VISIBILITY_PUBLIC: visibility = DEBUG_VISIBILITY_PUBLIC; @@ -2906,14 +2858,14 @@ ieee_read_cxx_class (info, pp, count) if (bitpos == (bfd_vma) -1 || bitsize == (bfd_vma) -1) { ieee_error (info, start, _("bad C++ field bit pos or size")); - return false; + return FALSE; } field = debug_make_field (dhandle, fieldcopy, ftype, bitpos, bitsize, visibility); } if (field == DEBUG_FIELD_NULL) - return false; + return FALSE; if (field_count + 1 >= field_alloc) { @@ -2937,7 +2889,7 @@ ieee_read_cxx_class (info, pp, count) struct ieee_var *pv, *pvend; debug_type type; enum debug_visibility visibility; - boolean constp, volatilep; + bfd_boolean constp, volatilep; char *mangledcopy; debug_method_variant mv; struct ieee_method *meth; @@ -2946,18 +2898,18 @@ ieee_read_cxx_class (info, pp, count) if (! ieee_require_asn (info, pp, &flags) || ! ieee_require_atn65 (info, pp, &name, &namlen) || ! ieee_require_atn65 (info, pp, &mangled, &mangledlen)) - return false; + return FALSE; count -= 3; if (id != 'v') voffset = 0; else { if (! ieee_require_asn (info, pp, &voffset)) - return false; + return FALSE; --count; } if (! ieee_require_asn (info, pp, &control)) - return false; + return FALSE; --count; /* We just ignore the control information. */ @@ -2985,20 +2937,20 @@ ieee_read_cxx_class (info, pp, count) ieee_builtin_type (info, start, (unsigned int) builtin_void), (debug_type *) NULL, - false)); + FALSE)); } else { debug_type return_type; const debug_type *arg_types; - boolean varargs; + bfd_boolean varargs; if (debug_get_type_kind (dhandle, pv->type) != DEBUG_KIND_FUNCTION) { ieee_error (info, start, _("bad type for C++ method function")); - return false; + return FALSE; } return_type = debug_get_return_type (dhandle, pv->type); @@ -3008,7 +2960,7 @@ ieee_read_cxx_class (info, pp, count) { ieee_error (info, start, _("no type information for C++ method function")); - return false; + return FALSE; } type = debug_make_method_type (dhandle, return_type, it->type, @@ -3016,13 +2968,13 @@ ieee_read_cxx_class (info, pp, count) varargs); } if (type == DEBUG_TYPE_NULL) - return false; + return FALSE; switch (flags & CXXFLAGS_VISIBILITY) { default: ieee_error (info, start, _("unknown C++ visibility")); - return false; + return FALSE; case CXXFLAGS_VISIBILITY_PUBLIC: visibility = DEBUG_VISIBILITY_PUBLIC; @@ -3037,8 +2989,8 @@ ieee_read_cxx_class (info, pp, count) break; } - constp = (flags & CXXFLAGS_CONST) != 0 ? true : false; - volatilep = (flags & CXXFLAGS_VOLATILE) != 0 ? true : false; + constp = (flags & CXXFLAGS_CONST) != 0 ? TRUE : FALSE; + volatilep = (flags & CXXFLAGS_VOLATILE) != 0 ? TRUE : FALSE; mangledcopy = savestring (mangled, mangledlen); @@ -3047,7 +2999,7 @@ ieee_read_cxx_class (info, pp, count) if (id == 'v') { ieee_error (info, start, _("C++ static virtual method")); - return false; + return FALSE; } mv = debug_make_static_method_variant (dhandle, mangledcopy, type, visibility, @@ -3070,7 +3022,7 @@ ieee_read_cxx_class (info, pp, count) vcontext); } if (mv == DEBUG_METHOD_VARIANT_NULL) - return false; + return FALSE; for (meth = methods, im = 0; im < methods_count; meth++, im++) if (meth->namlen == namlen @@ -3116,7 +3068,7 @@ ieee_read_cxx_class (info, pp, count) /* We have no way to store this information, so we just ignore it. */ if (! ieee_require_asn (info, pp, &spec)) - return false; + return FALSE; --count; if ((spec & 4) != 0) { @@ -3126,7 +3078,7 @@ ieee_read_cxx_class (info, pp, count) if (! ieee_require_atn65 (info, pp, &filename, &filenamlen) || ! ieee_require_asn (info, pp, &lineno)) - return false; + return FALSE; count -= 2; } else if ((spec & 8) != 0) @@ -3135,14 +3087,14 @@ ieee_read_cxx_class (info, pp, count) unsigned long mangledlen; if (! ieee_require_atn65 (info, pp, &mangled, &mangledlen)) - return false; + return FALSE; --count; } else { ieee_error (info, start, _("unrecognized C++ object overhead spec")); - return false; + return FALSE; } } break; @@ -3159,7 +3111,7 @@ ieee_read_cxx_class (info, pp, count) || ! ieee_require_asn (info, pp, &vsize) || ! ieee_require_atn65 (info, pp, &basename, &baselen) || ! ieee_require_asn (info, pp, &control)) - return false; + return FALSE; count -= 4; /* We just ignore the control number. We don't care what @@ -3169,7 +3121,7 @@ ieee_read_cxx_class (info, pp, count) /* FIXME: We can't handle multiple virtual table pointers. */ if (baselen == 0) - ownvptr = true; + ownvptr = TRUE; else { char *basecopy; @@ -3181,7 +3133,7 @@ ieee_read_cxx_class (info, pp, count) if (vptrbase == DEBUG_TYPE_NULL) { ieee_error (info, start, _("undefined C++ vtable")); - return false; + return FALSE; } } } @@ -3208,7 +3160,7 @@ ieee_read_cxx_class (info, pp, count) dmethods[i] = debug_make_method (dhandle, namcopy, methods[i].variants); if (dmethods[i] == DEBUG_METHOD_NULL) - return false; + return FALSE; } dmethods[i] = DEBUG_METHOD_NULL; free (methods); @@ -3224,18 +3176,16 @@ ieee_read_cxx_class (info, pp, count) fields, baseclasses, dmethods, vptrbase, ownvptr); if (it->slot == DEBUG_TYPE_NULL) - return false; + return FALSE; - return true; + return TRUE; } /* Read C++ default argument value and reference type information. */ -static boolean -ieee_read_cxx_defaults (info, pp, count) - struct ieee_info *info; - const bfd_byte **pp; - unsigned long count; +static bfd_boolean +ieee_read_cxx_defaults (struct ieee_info *info, const bfd_byte **pp, + unsigned long count) { const bfd_byte *start; const char *fnname; @@ -3252,12 +3202,12 @@ ieee_read_cxx_defaults (info, pp, count) || info->blockstack.bsp[-1].fnindx == (unsigned int) -1) { ieee_error (info, start, _("C++ default values not in a function")); - return false; + return FALSE; } if (! ieee_require_atn65 (info, pp, &fnname, &fnlen) || ! ieee_require_asn (info, pp, &defcount)) - return false; + return FALSE; count -= 2; while (defcount-- > 0) @@ -3267,7 +3217,7 @@ ieee_read_cxx_defaults (info, pp, count) unsigned long strvallen; if (! ieee_require_asn (info, pp, &type)) - return false; + return FALSE; --count; switch (type) @@ -3279,20 +3229,20 @@ ieee_read_cxx_defaults (info, pp, count) case 1: case 2: if (! ieee_require_asn (info, pp, &val)) - return false; + return FALSE; --count; break; case 3: case 7: if (! ieee_require_atn65 (info, pp, &strval, &strvallen)) - return false; + return FALSE; --count; break; default: ieee_error (info, start, _("unrecognized C++ default type")); - return false; + return FALSE; } /* We have no way to record the default argument values, so we @@ -3303,7 +3253,7 @@ ieee_read_cxx_defaults (info, pp, count) reference type. */ if (count > 0) { - PTR dhandle; + void *dhandle; debug_type *arg_slots; dhandle = info->dhandle; @@ -3314,7 +3264,7 @@ ieee_read_cxx_defaults (info, pp, count) debug_type target; if (! ieee_require_asn (info, pp, &indx)) - return false; + return FALSE; /* The index is 1 based. */ --indx; if (arg_slots == NULL @@ -3323,25 +3273,23 @@ ieee_read_cxx_defaults (info, pp, count) != DEBUG_KIND_POINTER)) { ieee_error (info, start, _("reference parameter is not a pointer")); - return false; + return FALSE; } target = debug_get_target_type (dhandle, arg_slots[indx]); arg_slots[indx] = debug_make_reference_type (dhandle, target); if (arg_slots[indx] == DEBUG_TYPE_NULL) - return false; + return FALSE; } } - return true; + return TRUE; } /* Read a C++ reference definition. */ -static boolean -ieee_read_reference (info, pp) - struct ieee_info *info; - const bfd_byte **pp; +static bfd_boolean +ieee_read_reference (struct ieee_info *info, const bfd_byte **pp) { const bfd_byte *start; bfd_vma flags; @@ -3353,18 +3301,18 @@ ieee_read_reference (info, pp) start = *pp; if (! ieee_require_asn (info, pp, &flags)) - return false; + return FALSE; /* Giving the class name before the member name is in an addendum to the spec. */ if (flags == 3) { if (! ieee_require_atn65 (info, pp, &class, &classlen)) - return false; + return FALSE; } if (! ieee_require_atn65 (info, pp, &name, &namlen)) - return false; + return FALSE; pslot = NULL; if (flags != 3) @@ -3393,7 +3341,7 @@ ieee_read_reference (info, pp) for (i = (int) vars->alloc - 1; i >= 0; i--) { - boolean found; + bfd_boolean found; pv = vars->vars + i; @@ -3402,33 +3350,33 @@ ieee_read_reference (info, pp) || strncmp (pv->name, name, namlen) != 0) continue; - found = false; + found = FALSE; switch (flags) { default: ieee_error (info, start, _("unrecognized C++ reference type")); - return false; + return FALSE; case 0: /* Global variable or function. */ if (pv->kind == IEEE_GLOBAL || pv->kind == IEEE_EXTERNAL || pv->kind == IEEE_FUNCTION) - found = true; + found = TRUE; break; case 1: /* Global static variable or function. */ if (pv->kind == IEEE_STATIC || pv->kind == IEEE_FUNCTION) - found = true; + found = TRUE; break; case 2: /* Local variable. */ if (pv->kind == IEEE_LOCAL) - found = true; + found = TRUE; break; } @@ -3463,7 +3411,7 @@ ieee_read_reference (info, pp) { ieee_error (info, start, "C++ reference in class with no fields"); - return false; + return FALSE; } for (findx = 0; *pf != DEBUG_FIELD_NULL; pf++, findx++) @@ -3472,7 +3420,7 @@ ieee_read_reference (info, pp) fname = debug_get_field_name (info->dhandle, *pf); if (fname == NULL) - return false; + return FALSE; if (strncmp (fname, name, namlen) == 0 && strlen (fname) == namlen) { @@ -3490,7 +3438,7 @@ ieee_read_reference (info, pp) if (pslot == NULL) { ieee_error (info, start, _("C++ reference not found")); - return false; + return FALSE; } /* We allocated the type of the object as an indirect type pointing @@ -3498,24 +3446,21 @@ ieee_read_reference (info, pp) if (debug_get_type_kind (info->dhandle, *pslot) != DEBUG_KIND_POINTER) { ieee_error (info, start, _("C++ reference is not pointer")); - return false; + return FALSE; } target = debug_get_target_type (info->dhandle, *pslot); *pslot = debug_make_reference_type (info->dhandle, target); if (*pslot == DEBUG_TYPE_NULL) - return false; + return FALSE; - return true; + return TRUE; } /* Require an ASN record. */ -static boolean -ieee_require_asn (info, pp, pv) - struct ieee_info *info; - const bfd_byte **pp; - bfd_vma *pv; +static bfd_boolean +ieee_require_asn (struct ieee_info *info, const bfd_byte **pp, bfd_vma *pv) { const bfd_byte *start; ieee_record_enum_type c; @@ -3527,7 +3472,7 @@ ieee_require_asn (info, pp, pv) if (c != ieee_e2_first_byte_enum) { ieee_error (info, start, _("missing required ASN")); - return false; + return FALSE; } ++*pp; @@ -3535,25 +3480,22 @@ ieee_require_asn (info, pp, pv) if (c != ieee_asn_record_enum) { ieee_error (info, start, _("missing required ASN")); - return false; + return FALSE; } ++*pp; /* Just ignore the variable index. */ if (! ieee_read_number (info, pp, &varindx)) - return false; + return FALSE; return ieee_read_expression (info, pp, pv); } /* Require an ATN65 record. */ -static boolean -ieee_require_atn65 (info, pp, pname, pnamlen) - struct ieee_info *info; - const bfd_byte **pp; - const char **pname; - unsigned long *pnamlen; +static bfd_boolean +ieee_require_atn65 (struct ieee_info *info, const bfd_byte **pp, + const char **pname, unsigned long *pnamlen) { const bfd_byte *start; ieee_record_enum_type c; @@ -3565,7 +3507,7 @@ ieee_require_atn65 (info, pp, pname, pnamlen) if (c != ieee_at_record_enum) { ieee_error (info, start, _("missing required ATN65")); - return false; + return FALSE; } ++*pp; @@ -3573,21 +3515,21 @@ ieee_require_atn65 (info, pp, pname, pnamlen) if (c != ieee_atn_record_enum) { ieee_error (info, start, _("missing required ATN65")); - return false; + return FALSE; } ++*pp; if (! ieee_read_number (info, pp, &name_indx) || ! ieee_read_number (info, pp, &type_indx) || ! ieee_read_number (info, pp, &atn_code)) - return false; + return FALSE; /* Just ignore name_indx. */ if (type_indx != 0 || atn_code != 65) { ieee_error (info, start, _("bad ATN65 record")); - return false; + return FALSE; } return ieee_read_id (info, pp, pname, pnamlen); @@ -3597,9 +3539,7 @@ ieee_require_atn65 (info, pp, pname, pnamlen) generic register number. */ static int -ieee_regno_to_genreg (abfd, r) - bfd *abfd; - int r; +ieee_regno_to_genreg (bfd *abfd, int r) { switch (bfd_get_arch (abfd)) { @@ -3626,9 +3566,7 @@ ieee_regno_to_genreg (abfd, r) /* Convert a generic register number to an IEEE specific one. */ static int -ieee_genreg_to_regno (abfd, r) - bfd *abfd; - int r; +ieee_genreg_to_regno (bfd *abfd, int r) { switch (bfd_get_arch (abfd)) { @@ -3709,7 +3647,7 @@ struct ieee_type_class class. */ const char *vclass; /* Whether this class holds its own virtual table. */ - boolean ownvptr; + bfd_boolean ownvptr; /* The largest virtual table offset seen so far. */ bfd_vma voffset; /* The current method. */ @@ -3800,7 +3738,7 @@ struct ieee_defined_enum /* Type index. */ unsigned int indx; /* Whether this enum has been defined. */ - boolean defined; + bfd_boolean defined; /* Tag. */ const char *tag; /* Names. */ @@ -3852,7 +3790,7 @@ struct ieee_pending_parm /* Type index. */ unsigned int type; /* Whether the type is a reference. */ - boolean referencep; + bfd_boolean referencep; /* Kind. */ enum debug_parm_kind kind; /* Value. */ @@ -3867,7 +3805,7 @@ struct ieee_handle bfd *abfd; /* Whether we got an error in a subroutine called via traverse or map_over_sections. */ - boolean error; + bfd_boolean error; /* Current data buffer list. */ struct ieee_buflist *current; /* Current data buffer. */ @@ -3945,112 +3883,109 @@ struct ieee_handle bfd_vma highaddr; }; -static boolean ieee_init_buffer - PARAMS ((struct ieee_handle *, struct ieee_buflist *)); -static boolean ieee_change_buffer - PARAMS ((struct ieee_handle *, struct ieee_buflist *)); -static boolean ieee_append_buffer - PARAMS ((struct ieee_handle *, struct ieee_buflist *, - struct ieee_buflist *)); -static boolean ieee_real_write_byte PARAMS ((struct ieee_handle *, int)); -static boolean ieee_write_2bytes PARAMS ((struct ieee_handle *, int)); -static boolean ieee_write_number PARAMS ((struct ieee_handle *, bfd_vma)); -static boolean ieee_write_id PARAMS ((struct ieee_handle *, const char *)); -static boolean ieee_write_asn - PARAMS ((struct ieee_handle *, unsigned int, bfd_vma)); -static boolean ieee_write_atn65 - PARAMS ((struct ieee_handle *, unsigned int, const char *)); -static boolean ieee_push_type - PARAMS ((struct ieee_handle *, unsigned int, unsigned int, boolean, - boolean)); -static unsigned int ieee_pop_type PARAMS ((struct ieee_handle *)); -static void ieee_pop_unused_type PARAMS ((struct ieee_handle *)); -static unsigned int ieee_pop_type_used - PARAMS ((struct ieee_handle *, boolean)); -static boolean ieee_add_range - PARAMS ((struct ieee_handle *, boolean, bfd_vma, bfd_vma)); -static boolean ieee_start_range PARAMS ((struct ieee_handle *, bfd_vma)); -static boolean ieee_end_range PARAMS ((struct ieee_handle *, bfd_vma)); -static boolean ieee_define_type - PARAMS ((struct ieee_handle *, unsigned int, boolean, boolean)); -static boolean ieee_define_named_type - PARAMS ((struct ieee_handle *, const char *, unsigned int, unsigned int, - boolean, boolean, struct ieee_buflist *)); +static bfd_boolean ieee_init_buffer + (struct ieee_handle *, struct ieee_buflist *); +static bfd_boolean ieee_change_buffer + (struct ieee_handle *, struct ieee_buflist *); +static bfd_boolean ieee_append_buffer + (struct ieee_handle *, struct ieee_buflist *, struct ieee_buflist *); +static bfd_boolean ieee_real_write_byte (struct ieee_handle *, int); +static bfd_boolean ieee_write_2bytes (struct ieee_handle *, int); +static bfd_boolean ieee_write_number (struct ieee_handle *, bfd_vma); +static bfd_boolean ieee_write_id (struct ieee_handle *, const char *); +static bfd_boolean ieee_write_asn + (struct ieee_handle *, unsigned int, bfd_vma); +static bfd_boolean ieee_write_atn65 + (struct ieee_handle *, unsigned int, const char *); +static bfd_boolean ieee_push_type + (struct ieee_handle *, unsigned int, unsigned int, bfd_boolean, + bfd_boolean); +static unsigned int ieee_pop_type (struct ieee_handle *); +static void ieee_pop_unused_type (struct ieee_handle *); +static unsigned int ieee_pop_type_used (struct ieee_handle *, bfd_boolean); +static bfd_boolean ieee_add_range + (struct ieee_handle *, bfd_boolean, bfd_vma, bfd_vma); +static bfd_boolean ieee_start_range (struct ieee_handle *, bfd_vma); +static bfd_boolean ieee_end_range (struct ieee_handle *, bfd_vma); +static bfd_boolean ieee_define_type + (struct ieee_handle *, unsigned int, bfd_boolean, bfd_boolean); +static bfd_boolean ieee_define_named_type + (struct ieee_handle *, const char *, unsigned int, unsigned int, + bfd_boolean, bfd_boolean, struct ieee_buflist *); static struct ieee_modified_type *ieee_get_modified_info - PARAMS ((struct ieee_handle *, unsigned int)); + (struct ieee_handle *, unsigned int); static struct bfd_hash_entry *ieee_name_type_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static boolean ieee_write_undefined_tag - PARAMS ((struct ieee_name_type_hash_entry *, PTR)); -static boolean ieee_finish_compilation_unit PARAMS ((struct ieee_handle *)); -static void ieee_add_bb11_blocks PARAMS ((bfd *, asection *, PTR)); -static boolean ieee_add_bb11 - PARAMS ((struct ieee_handle *, asection *, bfd_vma, bfd_vma)); -static boolean ieee_output_pending_parms PARAMS ((struct ieee_handle *)); -static unsigned int ieee_vis_to_flags PARAMS ((enum debug_visibility)); -static boolean ieee_class_method_var - PARAMS ((struct ieee_handle *, const char *, enum debug_visibility, boolean, - boolean, boolean, bfd_vma, boolean)); - -static boolean ieee_start_compilation_unit PARAMS ((PTR, const char *)); -static boolean ieee_start_source PARAMS ((PTR, const char *)); -static boolean ieee_empty_type PARAMS ((PTR)); -static boolean ieee_void_type PARAMS ((PTR)); -static boolean ieee_int_type PARAMS ((PTR, unsigned int, boolean)); -static boolean ieee_float_type PARAMS ((PTR, unsigned int)); -static boolean ieee_complex_type PARAMS ((PTR, unsigned int)); -static boolean ieee_bool_type PARAMS ((PTR, unsigned int)); -static boolean ieee_enum_type - PARAMS ((PTR, const char *, const char **, bfd_signed_vma *)); -static boolean ieee_pointer_type PARAMS ((PTR)); -static boolean ieee_function_type PARAMS ((PTR, int, boolean)); -static boolean ieee_reference_type PARAMS ((PTR)); -static boolean ieee_range_type PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma)); -static boolean ieee_array_type - PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma, boolean)); -static boolean ieee_set_type PARAMS ((PTR, boolean)); -static boolean ieee_offset_type PARAMS ((PTR)); -static boolean ieee_method_type PARAMS ((PTR, boolean, int, boolean)); -static boolean ieee_const_type PARAMS ((PTR)); -static boolean ieee_volatile_type PARAMS ((PTR)); -static boolean ieee_start_struct_type - PARAMS ((PTR, const char *, unsigned int, boolean, unsigned int)); -static boolean ieee_struct_field - PARAMS ((PTR, const char *, bfd_vma, bfd_vma, enum debug_visibility)); -static boolean ieee_end_struct_type PARAMS ((PTR)); -static boolean ieee_start_class_type - PARAMS ((PTR, const char *, unsigned int, boolean, unsigned int, boolean, - boolean)); -static boolean ieee_class_static_member - PARAMS ((PTR, const char *, const char *, enum debug_visibility)); -static boolean ieee_class_baseclass - PARAMS ((PTR, bfd_vma, boolean, enum debug_visibility)); -static boolean ieee_class_start_method PARAMS ((PTR, const char *)); -static boolean ieee_class_method_variant - PARAMS ((PTR, const char *, enum debug_visibility, boolean, boolean, - bfd_vma, boolean)); -static boolean ieee_class_static_method_variant - PARAMS ((PTR, const char *, enum debug_visibility, boolean, boolean)); -static boolean ieee_class_end_method PARAMS ((PTR)); -static boolean ieee_end_class_type PARAMS ((PTR)); -static boolean ieee_typedef_type PARAMS ((PTR, const char *)); -static boolean ieee_tag_type - PARAMS ((PTR, const char *, unsigned int, enum debug_type_kind)); -static boolean ieee_typdef PARAMS ((PTR, const char *)); -static boolean ieee_tag PARAMS ((PTR, const char *)); -static boolean ieee_int_constant PARAMS ((PTR, const char *, bfd_vma)); -static boolean ieee_float_constant PARAMS ((PTR, const char *, double)); -static boolean ieee_typed_constant PARAMS ((PTR, const char *, bfd_vma)); -static boolean ieee_variable - PARAMS ((PTR, const char *, enum debug_var_kind, bfd_vma)); -static boolean ieee_start_function PARAMS ((PTR, const char *, boolean)); -static boolean ieee_function_parameter - PARAMS ((PTR, const char *, enum debug_parm_kind, bfd_vma)); -static boolean ieee_start_block PARAMS ((PTR, bfd_vma)); -static boolean ieee_end_block PARAMS ((PTR, bfd_vma)); -static boolean ieee_end_function PARAMS ((PTR)); -static boolean ieee_lineno - PARAMS ((PTR, const char *, unsigned long, bfd_vma)); + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); +static bfd_boolean ieee_write_undefined_tag + (struct ieee_name_type_hash_entry *, void *); +static bfd_boolean ieee_finish_compilation_unit (struct ieee_handle *); +static void ieee_add_bb11_blocks (bfd *, asection *, void *); +static bfd_boolean ieee_add_bb11 + (struct ieee_handle *, asection *, bfd_vma, bfd_vma); +static bfd_boolean ieee_output_pending_parms (struct ieee_handle *); +static unsigned int ieee_vis_to_flags (enum debug_visibility); +static bfd_boolean ieee_class_method_var + (struct ieee_handle *, const char *, enum debug_visibility, bfd_boolean, + bfd_boolean, bfd_boolean, bfd_vma, bfd_boolean); + +static bfd_boolean ieee_start_compilation_unit (void *, const char *); +static bfd_boolean ieee_start_source (void *, const char *); +static bfd_boolean ieee_empty_type (void *); +static bfd_boolean ieee_void_type (void *); +static bfd_boolean ieee_int_type (void *, unsigned int, bfd_boolean); +static bfd_boolean ieee_float_type (void *, unsigned int); +static bfd_boolean ieee_complex_type (void *, unsigned int); +static bfd_boolean ieee_bool_type (void *, unsigned int); +static bfd_boolean ieee_enum_type + (void *, const char *, const char **, bfd_signed_vma *); +static bfd_boolean ieee_pointer_type (void *); +static bfd_boolean ieee_function_type (void *, int, bfd_boolean); +static bfd_boolean ieee_reference_type (void *); +static bfd_boolean ieee_range_type (void *, bfd_signed_vma, bfd_signed_vma); +static bfd_boolean ieee_array_type + (void *, bfd_signed_vma, bfd_signed_vma, bfd_boolean); +static bfd_boolean ieee_set_type (void *, bfd_boolean); +static bfd_boolean ieee_offset_type (void *); +static bfd_boolean ieee_method_type (void *, bfd_boolean, int, bfd_boolean); +static bfd_boolean ieee_const_type (void *); +static bfd_boolean ieee_volatile_type (void *); +static bfd_boolean ieee_start_struct_type + (void *, const char *, unsigned int, bfd_boolean, unsigned int); +static bfd_boolean ieee_struct_field + (void *, const char *, bfd_vma, bfd_vma, enum debug_visibility); +static bfd_boolean ieee_end_struct_type (void *); +static bfd_boolean ieee_start_class_type + (void *, const char *, unsigned int, bfd_boolean, unsigned int, bfd_boolean, + bfd_boolean); +static bfd_boolean ieee_class_static_member + (void *, const char *, const char *, enum debug_visibility); +static bfd_boolean ieee_class_baseclass + (void *, bfd_vma, bfd_boolean, enum debug_visibility); +static bfd_boolean ieee_class_start_method (void *, const char *); +static bfd_boolean ieee_class_method_variant + (void *, const char *, enum debug_visibility, bfd_boolean, bfd_boolean, + bfd_vma, bfd_boolean); +static bfd_boolean ieee_class_static_method_variant + (void *, const char *, enum debug_visibility, bfd_boolean, bfd_boolean); +static bfd_boolean ieee_class_end_method (void *); +static bfd_boolean ieee_end_class_type (void *); +static bfd_boolean ieee_typedef_type (void *, const char *); +static bfd_boolean ieee_tag_type + (void *, const char *, unsigned int, enum debug_type_kind); +static bfd_boolean ieee_typdef (void *, const char *); +static bfd_boolean ieee_tag (void *, const char *); +static bfd_boolean ieee_int_constant (void *, const char *, bfd_vma); +static bfd_boolean ieee_float_constant (void *, const char *, double); +static bfd_boolean ieee_typed_constant (void *, const char *, bfd_vma); +static bfd_boolean ieee_variable + (void *, const char *, enum debug_var_kind, bfd_vma); +static bfd_boolean ieee_start_function (void *, const char *, bfd_boolean); +static bfd_boolean ieee_function_parameter + (void *, const char *, enum debug_parm_kind, bfd_vma); +static bfd_boolean ieee_start_block (void *, bfd_vma); +static bfd_boolean ieee_end_block (void *, bfd_vma); +static bfd_boolean ieee_end_function (void *); +static bfd_boolean ieee_lineno (void *, const char *, unsigned long, bfd_vma); static const struct debug_write_fns ieee_fns = { @@ -4102,14 +4037,13 @@ static const struct debug_write_fns ieee_fns = /* Initialize a buffer to be empty. */ -static boolean -ieee_init_buffer (info, buflist) - struct ieee_handle *info ATTRIBUTE_UNUSED; - struct ieee_buflist *buflist; +static bfd_boolean +ieee_init_buffer (struct ieee_handle *info ATTRIBUTE_UNUSED, + struct ieee_buflist *buflist) { buflist->head = NULL; buflist->tail = NULL; - return true; + return TRUE; } /* See whether a buffer list has any data. */ @@ -4118,10 +4052,8 @@ ieee_init_buffer (info, buflist) /* Change the current buffer to a specified buffer chain. */ -static boolean -ieee_change_buffer (info, buflist) - struct ieee_handle *info; - struct ieee_buflist *buflist; +static bfd_boolean +ieee_change_buffer (struct ieee_handle *info, struct ieee_buflist *buflist) { if (buflist->head == NULL) { @@ -4137,16 +4069,15 @@ ieee_change_buffer (info, buflist) info->current = buflist; info->curbuf = buflist->tail; - return true; + return TRUE; } /* Append a buffer chain. */ -static boolean -ieee_append_buffer (info, mainbuf, newbuf) - struct ieee_handle *info ATTRIBUTE_UNUSED; - struct ieee_buflist *mainbuf; - struct ieee_buflist *newbuf; +static bfd_boolean +ieee_append_buffer (struct ieee_handle *info ATTRIBUTE_UNUSED, + struct ieee_buflist *mainbuf, + struct ieee_buflist *newbuf) { if (newbuf->head != NULL) { @@ -4156,7 +4087,7 @@ ieee_append_buffer (info, mainbuf, newbuf) mainbuf->tail->next = newbuf->head; mainbuf->tail = newbuf->tail; } - return true; + return TRUE; } /* Write a byte into the buffer. We use a macro for speed and a @@ -4164,13 +4095,11 @@ ieee_append_buffer (info, mainbuf, newbuf) #define ieee_write_byte(info, b) \ ((info)->curbuf->c < IEEE_BUFSIZE \ - ? ((info)->curbuf->buf[(info)->curbuf->c++] = (b), true) \ + ? ((info)->curbuf->buf[(info)->curbuf->c++] = (b), TRUE) \ : ieee_real_write_byte ((info), (b))) -static boolean -ieee_real_write_byte (info, b) - struct ieee_handle *info; - int b; +static bfd_boolean +ieee_real_write_byte (struct ieee_handle *info, int b) { if (info->curbuf->c >= IEEE_BUFSIZE) { @@ -4190,15 +4119,13 @@ ieee_real_write_byte (info, b) info->curbuf->buf[info->curbuf->c] = b; ++info->curbuf->c; - return true; + return TRUE; } /* Write out two bytes. */ -static boolean -ieee_write_2bytes (info, i) - struct ieee_handle *info; - int i; +static bfd_boolean +ieee_write_2bytes (struct ieee_handle *info, int i) { return (ieee_write_byte (info, i >> 8) && ieee_write_byte (info, i & 0xff)); @@ -4206,10 +4133,8 @@ ieee_write_2bytes (info, i) /* Write out an integer. */ -static boolean -ieee_write_number (info, v) - struct ieee_handle *info; - bfd_vma v; +static bfd_boolean +ieee_write_number (struct ieee_handle *info, bfd_vma v) { bfd_vma t; bfd_byte ab[20]; @@ -4234,26 +4159,24 @@ ieee_write_number (info, v) fprintf (stderr, _("IEEE numeric overflow: 0x")); fprintf_vma (stderr, v); fprintf (stderr, "\n"); - return false; + return FALSE; } if (! ieee_write_byte (info, (int) ieee_number_repeat_start_enum + c)) - return false; + return FALSE; for (; c > 0; --c, ++p) { if (! ieee_write_byte (info, *p)) - return false; + return FALSE; } - return true; + return TRUE; } /* Write out a string. */ -static boolean -ieee_write_id (info, s) - struct ieee_handle *info; - const char *s; +static bfd_boolean +ieee_write_id (struct ieee_handle *info, const char *s) { unsigned int len; @@ -4261,40 +4184,37 @@ ieee_write_id (info, s) if (len <= 0x7f) { if (! ieee_write_byte (info, len)) - return false; + return FALSE; } else if (len <= 0xff) { if (! ieee_write_byte (info, (int) ieee_extension_length_1_enum) || ! ieee_write_byte (info, len)) - return false; + return FALSE; } else if (len <= 0xffff) { if (! ieee_write_byte (info, (int) ieee_extension_length_2_enum) || ! ieee_write_2bytes (info, len)) - return false; + return FALSE; } else { fprintf (stderr, _("IEEE string length overflow: %u\n"), len); - return false; + return FALSE; } for (; *s != '\0'; s++) if (! ieee_write_byte (info, *s)) - return false; + return FALSE; - return true; + return TRUE; } /* Write out an ASN record. */ -static boolean -ieee_write_asn (info, indx, val) - struct ieee_handle *info; - unsigned int indx; - bfd_vma val; +static bfd_boolean +ieee_write_asn (struct ieee_handle *info, unsigned int indx, bfd_vma val) { return (ieee_write_2bytes (info, (int) ieee_asn_record_enum) && ieee_write_number (info, indx) @@ -4303,11 +4223,8 @@ ieee_write_asn (info, indx, val) /* Write out an ATN65 record. */ -static boolean -ieee_write_atn65 (info, indx, s) - struct ieee_handle *info; - unsigned int indx; - const char *s; +static bfd_boolean +ieee_write_atn65 (struct ieee_handle *info, unsigned int indx, const char *s) { return (ieee_write_2bytes (info, (int) ieee_atn_record_enum) && ieee_write_number (info, indx) @@ -4318,13 +4235,9 @@ ieee_write_atn65 (info, indx, s) /* Push a type index onto the type stack. */ -static boolean -ieee_push_type (info, indx, size, unsignedp, localp) - struct ieee_handle *info; - unsigned int indx; - unsigned int size; - boolean unsignedp; - boolean localp; +static bfd_boolean +ieee_push_type (struct ieee_handle *info, unsigned int indx, + unsigned int size, bfd_boolean unsignedp, bfd_boolean localp) { struct ieee_type_stack *ts; @@ -4339,33 +4252,29 @@ ieee_push_type (info, indx, size, unsignedp, localp) ts->next = info->type_stack; info->type_stack = ts; - return true; + return TRUE; } /* Pop a type index off the type stack. */ static unsigned int -ieee_pop_type (info) - struct ieee_handle *info; +ieee_pop_type (struct ieee_handle *info) { - return ieee_pop_type_used (info, true); + return ieee_pop_type_used (info, TRUE); } /* Pop an unused type index off the type stack. */ static void -ieee_pop_unused_type (info) - struct ieee_handle *info; +ieee_pop_unused_type (struct ieee_handle *info) { - (void) ieee_pop_type_used (info, false); + (void) ieee_pop_type_used (info, FALSE); } /* Pop a used or unused type index off the type stack. */ static unsigned int -ieee_pop_type_used (info, used) - struct ieee_handle *info; - boolean used; +ieee_pop_type_used (struct ieee_handle *info, bfd_boolean used) { struct ieee_type_stack *ts; unsigned int ret; @@ -4389,7 +4298,7 @@ ieee_pop_type_used (info, used) || ! ieee_write_byte (info, 1) || ! ieee_write_number (info, 0) || ! ieee_write_id (info, info->modname)) - return false; + return FALSE; } buflist = &info->types; } @@ -4403,13 +4312,13 @@ ieee_pop_type_used (info, used) || ! ieee_write_byte (info, 2) || ! ieee_write_number (info, 0) || ! ieee_write_id (info, "")) - return false; + return FALSE; } buflist = &info->global_types; } if (! ieee_append_buffer (info, buflist, &ts->type.fndef)) - return false; + return FALSE; } ret = ts->type.indx; @@ -4420,17 +4329,14 @@ ieee_pop_type_used (info, used) /* Add a range of bytes included in the current compilation unit. */ -static boolean -ieee_add_range (info, global, low, high) - struct ieee_handle *info; - boolean global; - bfd_vma low; - bfd_vma high; +static bfd_boolean +ieee_add_range (struct ieee_handle *info, bfd_boolean global, bfd_vma low, + bfd_vma high) { struct ieee_range **plist, *r, **pr; if (low == (bfd_vma) -1 || high == (bfd_vma) -1 || low == high) - return true; + return TRUE; if (global) plist = &info->global_ranges; @@ -4457,7 +4363,7 @@ ieee_add_range (info, global, low, high) free (*pr); *pr = n; } - return true; + return TRUE; } } @@ -4474,15 +4380,13 @@ ieee_add_range (info, global, low, high) r->next = *pr; *pr = r; - return true; + return TRUE; } /* Start a new range for which we only have the low address. */ -static boolean -ieee_start_range (info, low) - struct ieee_handle *info; - bfd_vma low; +static bfd_boolean +ieee_start_range (struct ieee_handle *info, bfd_vma low) { struct ieee_range *r; @@ -4491,15 +4395,13 @@ ieee_start_range (info, low) r->low = low; r->next = info->pending_ranges; info->pending_ranges = r; - return true; + return TRUE; } /* Finish a range started by ieee_start_range. */ -static boolean -ieee_end_range (info, high) - struct ieee_handle *info; - bfd_vma high; +static bfd_boolean +ieee_end_range (struct ieee_handle *info, bfd_vma high) { struct ieee_range *r; bfd_vma low; @@ -4509,17 +4411,14 @@ ieee_end_range (info, high) low = r->low; info->pending_ranges = r->next; free (r); - return ieee_add_range (info, false, low, high); + return ieee_add_range (info, FALSE, low, high); } /* Start defining a type. */ -static boolean -ieee_define_type (info, size, unsignedp, localp) - struct ieee_handle *info; - unsigned int size; - boolean unsignedp; - boolean localp; +static bfd_boolean +ieee_define_type (struct ieee_handle *info, unsigned int size, + bfd_boolean unsignedp, bfd_boolean localp) { return ieee_define_named_type (info, (const char *) NULL, (unsigned int) -1, size, unsignedp, @@ -4528,15 +4427,11 @@ ieee_define_type (info, size, unsignedp, localp) /* Start defining a named type. */ -static boolean -ieee_define_named_type (info, name, indx, size, unsignedp, localp, buflist) - struct ieee_handle *info; - const char *name; - unsigned int indx; - unsigned int size; - boolean unsignedp; - boolean localp; - struct ieee_buflist *buflist; +static bfd_boolean +ieee_define_named_type (struct ieee_handle *info, const char *name, + unsigned int indx, unsigned int size, + bfd_boolean unsignedp, bfd_boolean localp, + struct ieee_buflist *buflist) { unsigned int type_indx; unsigned int name_indx; @@ -4561,14 +4456,14 @@ ieee_define_named_type (info, name, indx, size, unsignedp, localp, buflist) if (buflist != NULL) { if (! ieee_change_buffer (info, buflist)) - return false; + return FALSE; } else if (localp) { if (! ieee_buffer_emptyp (&info->types)) { if (! ieee_change_buffer (info, &info->types)) - return false; + return FALSE; } else { @@ -4577,7 +4472,7 @@ ieee_define_named_type (info, name, indx, size, unsignedp, localp, buflist) || ! ieee_write_byte (info, 1) || ! ieee_write_number (info, 0) || ! ieee_write_id (info, info->modname)) - return false; + return FALSE; } } else @@ -4585,7 +4480,7 @@ ieee_define_named_type (info, name, indx, size, unsignedp, localp, buflist) if (! ieee_buffer_emptyp (&info->global_types)) { if (! ieee_change_buffer (info, &info->global_types)) - return false; + return FALSE; } else { @@ -4594,7 +4489,7 @@ ieee_define_named_type (info, name, indx, size, unsignedp, localp, buflist) || ! ieee_write_byte (info, 2) || ! ieee_write_number (info, 0) || ! ieee_write_id (info, "")) - return false; + return FALSE; } } @@ -4602,7 +4497,7 @@ ieee_define_named_type (info, name, indx, size, unsignedp, localp, buflist) write out the start of a TY record. The caller will then finish the TY record. */ if (! ieee_push_type (info, type_indx, size, unsignedp, localp)) - return false; + return FALSE; return (ieee_write_byte (info, (int) ieee_nn_record) && ieee_write_number (info, name_indx) @@ -4616,9 +4511,7 @@ ieee_define_named_type (info, name, indx, size, unsignedp, localp, buflist) /* Get an entry to the list of modified versions of a type. */ static struct ieee_modified_type * -ieee_get_modified_info (info, indx) - struct ieee_handle *info; - unsigned int indx; +ieee_get_modified_info (struct ieee_handle *info, unsigned int indx) { if (indx >= info->modified_alloc) { @@ -4645,10 +4538,8 @@ ieee_get_modified_info (info, indx) /* Initialize an entry in the hash table. */ static struct bfd_hash_entry * -ieee_name_type_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +ieee_name_type_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, const char *string) { struct ieee_name_type_hash_entry *ret = (struct ieee_name_type_hash_entry *) entry; @@ -4684,15 +4575,13 @@ ieee_name_type_newfunc (entry, table, string) #define ieee_name_type_hash_traverse(table, func, info) \ (bfd_hash_traverse \ (&(table)->root, \ - (boolean (*) PARAMS ((struct bfd_hash_entry *, PTR))) (func), \ + (bfd_boolean (*) (struct bfd_hash_entry *, void *)) (func), \ (info))) /* The general routine to write out IEEE debugging information. */ -boolean -write_ieee_debugging_info (abfd, dhandle) - bfd *abfd; - PTR dhandle; +bfd_boolean +write_ieee_debugging_info (bfd *abfd, void *dhandle) { struct ieee_handle info; asection *s; @@ -4706,7 +4595,7 @@ write_ieee_debugging_info (abfd, dhandle) if (! bfd_hash_table_init (&info.typedefs.root, ieee_name_type_newfunc) || ! bfd_hash_table_init (&info.tags.root, ieee_name_type_newfunc)) - return false; + return FALSE; if (! ieee_init_buffer (&info, &info.global_types) || ! ieee_init_buffer (&info, &info.data) @@ -4716,24 +4605,24 @@ write_ieee_debugging_info (abfd, dhandle) || ! ieee_init_buffer (&info, &info.linenos) || ! ieee_init_buffer (&info, &info.fntype) || ! ieee_init_buffer (&info, &info.fnargs)) - return false; + return FALSE; - if (! debug_write (dhandle, &ieee_fns, (PTR) &info)) - return false; + if (! debug_write (dhandle, &ieee_fns, (void *) &info)) + return FALSE; if (info.filename != NULL) { if (! ieee_finish_compilation_unit (&info)) - return false; + return FALSE; } /* Put any undefined tags in the global typedef information. */ - info.error = false; + info.error = FALSE; ieee_name_type_hash_traverse (&info.tags, ieee_write_undefined_tag, - (PTR) &info); + (void *) &info); if (info.error) - return false; + return FALSE; /* Prepend the global typedef information to the other data. */ if (! ieee_buffer_emptyp (&info.global_types)) @@ -4751,29 +4640,29 @@ write_ieee_debugging_info (abfd, dhandle) || ! ieee_write_number (&info, 'P') || ! ieee_write_number (&info, (int) builtin_void + 32) || ! ieee_write_byte (&info, (int) ieee_be_record_enum)) - return false; + return FALSE; if (! ieee_append_buffer (&info, &info.global_types, &info.data)) - return false; + return FALSE; info.data = info.global_types; } /* Make sure that we have declare BB11 blocks for each range in the file. They are added to info->vars. */ - info.error = false; + info.error = FALSE; if (! ieee_init_buffer (&info, &info.vars)) - return false; - bfd_map_over_sections (abfd, ieee_add_bb11_blocks, (PTR) &info); + return FALSE; + bfd_map_over_sections (abfd, ieee_add_bb11_blocks, (void *) &info); if (info.error) - return false; + return FALSE; if (! ieee_buffer_emptyp (&info.vars)) { if (! ieee_change_buffer (&info, &info.vars) || ! ieee_write_byte (&info, (int) ieee_be_record_enum)) - return false; + return FALSE; if (! ieee_append_buffer (&info, &info.data, &info.vars)) - return false; + return FALSE; } /* Now all the data is in info.data. Write it out to the BFD. We @@ -4783,7 +4672,7 @@ write_ieee_debugging_info (abfd, dhandle) if (ieee_buffer_emptyp (&info.data)) { /* There is no debugging information. */ - return true; + return TRUE; } err = NULL; s = bfd_make_section (abfd, ".debug"); @@ -4824,22 +4713,20 @@ write_ieee_debugging_info (abfd, dhandle) { fprintf (stderr, "%s: %s: %s\n", bfd_get_filename (abfd), err, bfd_errmsg (bfd_get_error ())); - return false; + return FALSE; } bfd_hash_table_free (&info.typedefs.root); bfd_hash_table_free (&info.tags.root); - return true; + return TRUE; } /* Write out information for an undefined tag. This is called via ieee_name_type_hash_traverse. */ -static boolean -ieee_write_undefined_tag (h, p) - struct ieee_name_type_hash_entry *h; - PTR p; +static bfd_boolean +ieee_write_undefined_tag (struct ieee_name_type_hash_entry *h, void *p) { struct ieee_handle *info = (struct ieee_handle *) p; struct ieee_name_type *nt; @@ -4860,16 +4747,16 @@ ieee_write_undefined_tag (h, p) || ! ieee_write_number (info, 0) || ! ieee_write_id (info, "")) { - info->error = true; - return false; + info->error = TRUE; + return FALSE; } } else { if (! ieee_change_buffer (info, &info->global_types)) { - info->error = true; - return false; + info->error = TRUE; + return FALSE; } } @@ -4883,16 +4770,16 @@ ieee_write_undefined_tag (h, p) || ! ieee_write_byte (info, 0xce) || ! ieee_write_number (info, name_indx)) { - info->error = true; - return false; + info->error = TRUE; + return FALSE; } switch (nt->kind) { default: abort (); - info->error = true; - return false; + info->error = TRUE; + return FALSE; case DEBUG_KIND_STRUCT: case DEBUG_KIND_CLASS: code = 'S'; @@ -4908,20 +4795,18 @@ ieee_write_undefined_tag (h, p) if (! ieee_write_number (info, code) || ! ieee_write_number (info, 0)) { - info->error = true; - return false; + info->error = TRUE; + return FALSE; } } - return true; + return TRUE; } /* Start writing out information for a compilation unit. */ -static boolean -ieee_start_compilation_unit (p, filename) - PTR p; - const char *filename; +static bfd_boolean +ieee_start_compilation_unit (void *p, const char *filename) { struct ieee_handle *info = (struct ieee_handle *) p; const char *modname; @@ -4934,7 +4819,7 @@ ieee_start_compilation_unit (p, filename) if (info->filename != NULL) { if (! ieee_finish_compilation_unit (info)) - return false; + return FALSE; } info->filename = filename; @@ -4965,7 +4850,7 @@ ieee_start_compilation_unit (p, filename) || ! ieee_init_buffer (info, &info->vars) || ! ieee_init_buffer (info, &info->cxx) || ! ieee_init_buffer (info, &info->linenos)) - return false; + return FALSE; info->ranges = NULL; /* Always include a BB1 and a BB3 block. That is what the output of @@ -4975,7 +4860,7 @@ ieee_start_compilation_unit (p, filename) || ! ieee_write_byte (info, 1) || ! ieee_write_number (info, 0) || ! ieee_write_id (info, info->modname)) - return false; + return FALSE; nindx = info->name_indx; ++info->name_indx; @@ -4984,16 +4869,15 @@ ieee_start_compilation_unit (p, filename) || ! ieee_write_byte (info, 3) || ! ieee_write_number (info, 0) || ! ieee_write_id (info, info->modname)) - return false; + return FALSE; - return true; + return TRUE; } /* Finish up a compilation unit. */ -static boolean -ieee_finish_compilation_unit (info) - struct ieee_handle *info; +static bfd_boolean +ieee_finish_compilation_unit (struct ieee_handle *info) { struct ieee_range *r; @@ -5001,7 +4885,7 @@ ieee_finish_compilation_unit (info) { if (! ieee_change_buffer (info, &info->types) || ! ieee_write_byte (info, (int) ieee_be_record_enum)) - return false; + return FALSE; } if (! ieee_buffer_emptyp (&info->cxx)) @@ -5010,7 +4894,7 @@ ieee_finish_compilation_unit (info) variable information. */ assert (! ieee_buffer_emptyp (&info->vars)); if (! ieee_change_buffer (info, &info->vars)) - return false; + return FALSE; /* We put the pmisc records in a dummy procedure, just as the MRI compiler does. */ @@ -5025,45 +4909,45 @@ ieee_finish_compilation_unit (info) || ! ieee_change_buffer (info, &info->vars) || ! ieee_write_byte (info, (int) ieee_be_record_enum) || ! ieee_write_number (info, info->highaddr - 1)) - return false; + return FALSE; } if (! ieee_buffer_emptyp (&info->vars)) { if (! ieee_change_buffer (info, &info->vars) || ! ieee_write_byte (info, (int) ieee_be_record_enum)) - return false; + return FALSE; } if (info->pending_lineno_filename != NULL) { /* Force out the pending line number. */ - if (! ieee_lineno ((PTR) info, (const char *) NULL, 0, (bfd_vma) -1)) - return false; + if (! ieee_lineno ((void *) info, (const char *) NULL, 0, (bfd_vma) -1)) + return FALSE; } if (! ieee_buffer_emptyp (&info->linenos)) { if (! ieee_change_buffer (info, &info->linenos) || ! ieee_write_byte (info, (int) ieee_be_record_enum)) - return false; + return FALSE; if (strcmp (info->filename, info->lineno_filename) != 0) { /* We were not in the main file. We just closed the included line number block, and now we must close the main line number block. */ if (! ieee_write_byte (info, (int) ieee_be_record_enum)) - return false; + return FALSE; } } if (! ieee_append_buffer (info, &info->data, &info->types) || ! ieee_append_buffer (info, &info->data, &info->vars) || ! ieee_append_buffer (info, &info->data, &info->linenos)) - return false; + return FALSE; /* Build BB10/BB11 blocks based on the ranges we recorded. */ if (! ieee_change_buffer (info, &info->data)) - return false; + return FALSE; if (! ieee_write_byte (info, (int) ieee_bb_record_enum) || ! ieee_write_byte (info, 10) @@ -5072,7 +4956,7 @@ ieee_finish_compilation_unit (info) || ! ieee_write_id (info, "") || ! ieee_write_number (info, 0) || ! ieee_write_id (info, "GNU objcopy")) - return false; + return FALSE; for (r = info->ranges; r != NULL; r = r->next) { @@ -5125,27 +5009,24 @@ ieee_finish_compilation_unit (info) || ! ieee_write_number (info, low) || ! ieee_write_byte (info, (int) ieee_be_record_enum) || ! ieee_write_number (info, high - low)) - return false; + return FALSE; /* Add this range to the list of global ranges. */ - if (! ieee_add_range (info, true, low, high)) - return false; + if (! ieee_add_range (info, TRUE, low, high)) + return FALSE; } if (! ieee_write_byte (info, (int) ieee_be_record_enum)) - return false; + return FALSE; - return true; + return TRUE; } /* Add BB11 blocks describing each range that we have not already described. */ static void -ieee_add_bb11_blocks (abfd, sec, data) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec; - PTR data; +ieee_add_bb11_blocks (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *data) { struct ieee_handle *info = (struct ieee_handle *) data; bfd_vma low, high; @@ -5165,7 +5046,7 @@ ieee_add_bb11_blocks (abfd, sec, data) if (r == NULL || r->low >= high) { if (! ieee_add_bb11 (info, sec, low, high)) - info->error = true; + info->error = TRUE; return; } @@ -5174,7 +5055,7 @@ ieee_add_bb11_blocks (abfd, sec, data) { if (! ieee_add_bb11 (info, sec, low, r->low)) { - info->error = true; + info->error = TRUE; return; } } @@ -5186,19 +5067,16 @@ ieee_add_bb11_blocks (abfd, sec, data) /* Add a single BB11 block for a range. We add it to info->vars. */ -static boolean -ieee_add_bb11 (info, sec, low, high) - struct ieee_handle *info; - asection *sec; - bfd_vma low; - bfd_vma high; +static bfd_boolean +ieee_add_bb11 (struct ieee_handle *info, asection *sec, bfd_vma low, + bfd_vma high) { int kind; if (! ieee_buffer_emptyp (&info->vars)) { if (! ieee_change_buffer (info, &info->vars)) - return false; + return FALSE; } else { @@ -5239,7 +5117,7 @@ ieee_add_bb11 (info, sec, low, high) || ! ieee_write_id (info, "") || ! ieee_write_number (info, 0) || ! ieee_write_id (info, "GNU objcopy")) - return false; + return FALSE; free (c); } @@ -5260,9 +5138,9 @@ ieee_add_bb11 (info, sec, low, high) || ! ieee_write_number (info, low) || ! ieee_write_byte (info, (int) ieee_be_record_enum) || ! ieee_write_number (info, high - low)) - return false; + return FALSE; - return true; + return TRUE; } /* Start recording information from a particular source file. This is @@ -5271,43 +5149,37 @@ ieee_add_bb11 (info, sec, low, high) down the file name anyhow. IEEE debugging information doesn't seem to store this information anywhere. */ -static boolean -ieee_start_source (p, filename) - PTR p ATTRIBUTE_UNUSED; - const char *filename ATTRIBUTE_UNUSED; +static bfd_boolean +ieee_start_source (void *p ATTRIBUTE_UNUSED, + const char *filename ATTRIBUTE_UNUSED) { - return true; + return TRUE; } /* Make an empty type. */ -static boolean -ieee_empty_type (p) - PTR p; +static bfd_boolean +ieee_empty_type (void *p) { struct ieee_handle *info = (struct ieee_handle *) p; - return ieee_push_type (info, (int) builtin_unknown, 0, false, false); + return ieee_push_type (info, (int) builtin_unknown, 0, FALSE, FALSE); } /* Make a void type. */ -static boolean -ieee_void_type (p) - PTR p; +static bfd_boolean +ieee_void_type (void *p) { struct ieee_handle *info = (struct ieee_handle *) p; - return ieee_push_type (info, (int) builtin_void, 0, false, false); + return ieee_push_type (info, (int) builtin_void, 0, FALSE, FALSE); } /* Make an integer type. */ -static boolean -ieee_int_type (p, size, unsignedp) - PTR p; - unsigned int size; - boolean unsignedp; +static bfd_boolean +ieee_int_type (void *p, unsigned int size, bfd_boolean unsignedp) { struct ieee_handle *info = (struct ieee_handle *) p; unsigned int indx; @@ -5328,21 +5200,19 @@ ieee_int_type (p, size, unsignedp) break; default: fprintf (stderr, _("IEEE unsupported integer type size %u\n"), size); - return false; + return FALSE; } if (unsignedp) ++indx; - return ieee_push_type (info, indx, size, unsignedp, false); + return ieee_push_type (info, indx, size, unsignedp, FALSE); } /* Make a floating point type. */ -static boolean -ieee_float_type (p, size) - PTR p; - unsigned int size; +static bfd_boolean +ieee_float_type (void *p, unsigned int size) { struct ieee_handle *info = (struct ieee_handle *) p; unsigned int indx; @@ -5364,18 +5234,16 @@ ieee_float_type (p, size) break; default: fprintf (stderr, _("IEEE unsupported float type size %u\n"), size); - return false; + return FALSE; } - return ieee_push_type (info, indx, size, false, false); + return ieee_push_type (info, indx, size, FALSE, FALSE); } /* Make a complex type. */ -static boolean -ieee_complex_type (p, size) - PTR p; - unsigned int size; +static bfd_boolean +ieee_complex_type (void *p, unsigned int size) { struct ieee_handle *info = (struct ieee_handle *) p; char code; @@ -5385,7 +5253,7 @@ ieee_complex_type (p, size) case 4: if (info->complex_float_index != 0) return ieee_push_type (info, info->complex_float_index, size * 2, - false, false); + FALSE, FALSE); code = 'c'; break; case 12: @@ -5395,55 +5263,50 @@ ieee_complex_type (p, size) case 8: if (info->complex_double_index != 0) return ieee_push_type (info, info->complex_double_index, size * 2, - false, false); + FALSE, FALSE); code = 'd'; break; default: fprintf (stderr, _("IEEE unsupported complex type size %u\n"), size); - return false; + return FALSE; } /* FIXME: I don't know what the string is for. */ - if (! ieee_define_type (info, size * 2, false, false) + if (! ieee_define_type (info, size * 2, FALSE, FALSE) || ! ieee_write_number (info, code) || ! ieee_write_id (info, "")) - return false; + return FALSE; if (size == 4) info->complex_float_index = info->type_stack->type.indx; else info->complex_double_index = info->type_stack->type.indx; - return true; + return TRUE; } /* Make a boolean type. IEEE doesn't support these, so we just make an integer type instead. */ -static boolean -ieee_bool_type (p, size) - PTR p; - unsigned int size; +static bfd_boolean +ieee_bool_type (void *p, unsigned int size) { - return ieee_int_type (p, size, true); + return ieee_int_type (p, size, TRUE); } /* Make an enumeration. */ -static boolean -ieee_enum_type (p, tag, names, vals) - PTR p; - const char *tag; - const char **names; - bfd_signed_vma *vals; +static bfd_boolean +ieee_enum_type (void *p, const char *tag, const char **names, + bfd_signed_vma *vals) { struct ieee_handle *info = (struct ieee_handle *) p; struct ieee_defined_enum *e; - boolean localp, simple; + bfd_boolean localp, simple; unsigned int indx; int i = 0; - localp = false; + localp = FALSE; indx = (unsigned int) -1; for (e = info->enums; e != NULL; e = e->next) { @@ -5485,14 +5348,14 @@ ieee_enum_type (p, tag, names, vals) && e->names[i] == NULL)) { /* We've seen this enum before. */ - return ieee_push_type (info, e->indx, 0, true, false); + return ieee_push_type (info, e->indx, 0, TRUE, FALSE); } if (tag != NULL) { /* We've already seen an enum of the same name, so we must make sure to output this one locally. */ - localp = true; + localp = TRUE; break; } } @@ -5501,40 +5364,40 @@ ieee_enum_type (p, tag, names, vals) and always increment by 1, we can use type E. Otherwise we must use type N. */ - simple = true; + simple = TRUE; if (names != NULL) { for (i = 0; names[i] != NULL; i++) { if (vals[i] != i) { - simple = false; + simple = FALSE; break; } } } - if (! ieee_define_named_type (info, tag, indx, 0, true, localp, + if (! ieee_define_named_type (info, tag, indx, 0, TRUE, localp, (struct ieee_buflist *) NULL) || ! ieee_write_number (info, simple ? 'E' : 'N')) - return false; + return FALSE; if (simple) { /* FIXME: This is supposed to be the enumeration size, but we don't store that. */ if (! ieee_write_number (info, 4)) - return false; + return FALSE; } if (names != NULL) { for (i = 0; names[i] != NULL; i++) { if (! ieee_write_id (info, names[i])) - return false; + return FALSE; if (! simple) { if (! ieee_write_number (info, vals[i])) - return false; + return FALSE; } } } @@ -5554,20 +5417,19 @@ ieee_enum_type (p, tag, names, vals) e->names = names; e->vals = vals; - e->defined = true; + e->defined = TRUE; } - return true; + return TRUE; } /* Make a pointer type. */ -static boolean -ieee_pointer_type (p) - PTR p; +static bfd_boolean +ieee_pointer_type (void *p) { struct ieee_handle *info = (struct ieee_handle *) p; - boolean localp; + bfd_boolean localp; unsigned int indx; struct ieee_modified_type *m = NULL; @@ -5577,28 +5439,28 @@ ieee_pointer_type (p) /* A pointer to a simple builtin type can be obtained by adding 32. FIXME: Will this be a short pointer, and will that matter? */ if (indx < 32) - return ieee_push_type (info, indx + 32, 0, true, false); + return ieee_push_type (info, indx + 32, 0, TRUE, FALSE); if (! localp) { m = ieee_get_modified_info (p, indx); if (m == NULL) - return false; + return FALSE; /* FIXME: The size should depend upon the architecture. */ if (m->pointer > 0) - return ieee_push_type (info, m->pointer, 4, true, false); + return ieee_push_type (info, m->pointer, 4, TRUE, FALSE); } - if (! ieee_define_type (info, 4, true, localp) + if (! ieee_define_type (info, 4, TRUE, localp) || ! ieee_write_number (info, 'P') || ! ieee_write_number (info, indx)) - return false; + return FALSE; if (! localp) m->pointer = info->type_stack->type.indx; - return true; + return TRUE; } /* Make a function type. This will be called for a method, but we @@ -5606,21 +5468,18 @@ ieee_pointer_type (p) handle this by defining the type in a private buffer, and only adding that buffer to the typedef block if we are going to use it. */ -static boolean -ieee_function_type (p, argcount, varargs) - PTR p; - int argcount; - boolean varargs; +static bfd_boolean +ieee_function_type (void *p, int argcount, bfd_boolean varargs) { struct ieee_handle *info = (struct ieee_handle *) p; - boolean localp; + bfd_boolean localp; unsigned int *args = NULL; int i; unsigned int retindx; struct ieee_buflist fndef; struct ieee_modified_type *m; - localp = false; + localp = FALSE; if (argcount > 0) { @@ -5628,15 +5487,15 @@ ieee_function_type (p, argcount, varargs) for (i = argcount - 1; i >= 0; i--) { if (info->type_stack->type.localp) - localp = true; + localp = TRUE; args[i] = ieee_pop_type (info); } } else if (argcount < 0) - varargs = false; + varargs = FALSE; if (info->type_stack->type.localp) - localp = true; + localp = TRUE; retindx = ieee_pop_type (info); m = NULL; @@ -5644,17 +5503,17 @@ ieee_function_type (p, argcount, varargs) { m = ieee_get_modified_info (p, retindx); if (m == NULL) - return false; + return FALSE; if (m->function > 0) - return ieee_push_type (info, m->function, 0, true, false); + return ieee_push_type (info, m->function, 0, TRUE, FALSE); } /* An attribute of 0x41 means that the frame and push mask are unknown. */ if (! ieee_init_buffer (info, &fndef) || ! ieee_define_named_type (info, (const char *) NULL, - (unsigned int) -1, 0, true, localp, + (unsigned int) -1, 0, TRUE, localp, &fndef) || ! ieee_write_number (info, 'x') || ! ieee_write_number (info, 0x41) @@ -5662,12 +5521,12 @@ ieee_function_type (p, argcount, varargs) || ! ieee_write_number (info, 0) || ! ieee_write_number (info, retindx) || ! ieee_write_number (info, (bfd_vma) argcount + (varargs ? 1 : 0))) - return false; + return FALSE; if (argcount > 0) { for (i = 0; i < argcount; i++) if (! ieee_write_number (info, args[i])) - return false; + return FALSE; free (args); } if (varargs) @@ -5675,11 +5534,11 @@ ieee_function_type (p, argcount, varargs) /* A varargs function is represented by writing out the last argument as type void *, although this makes little sense. */ if (! ieee_write_number (info, (bfd_vma) builtin_void + 32)) - return false; + return FALSE; } if (! ieee_write_number (info, 0)) - return false; + return FALSE; /* We wrote the information into fndef, in case we don't need it. It will be appended to info->types by ieee_pop_type. */ @@ -5688,14 +5547,13 @@ ieee_function_type (p, argcount, varargs) if (m != NULL) m->function = info->type_stack->type.indx; - return true; + return TRUE; } /* Make a reference type. */ -static boolean -ieee_reference_type (p) - PTR p; +static bfd_boolean +ieee_reference_type (void *p) { struct ieee_handle *info = (struct ieee_handle *) p; @@ -5703,22 +5561,19 @@ ieee_reference_type (p) pmisc record to indicate that it is really a reference. */ if (! ieee_pointer_type (p)) - return false; - info->type_stack->type.referencep = true; - return true; + return FALSE; + info->type_stack->type.referencep = TRUE; + return TRUE; } /* Make a range type. */ -static boolean -ieee_range_type (p, low, high) - PTR p; - bfd_signed_vma low; - bfd_signed_vma high; +static bfd_boolean +ieee_range_type (void *p, bfd_signed_vma low, bfd_signed_vma high) { struct ieee_handle *info = (struct ieee_handle *) p; unsigned int size; - boolean unsignedp, localp; + bfd_boolean unsignedp, localp; size = info->type_stack->type.size; unsignedp = info->type_stack->type.unsignedp; @@ -5734,16 +5589,13 @@ ieee_range_type (p, low, high) /* Make an array type. */ -static boolean -ieee_array_type (p, low, high, stringp) - PTR p; - bfd_signed_vma low; - bfd_signed_vma high; - boolean stringp ATTRIBUTE_UNUSED; +static bfd_boolean +ieee_array_type (void *p, bfd_signed_vma low, bfd_signed_vma high, + bfd_boolean stringp ATTRIBUTE_UNUSED) { struct ieee_handle *info = (struct ieee_handle *) p; unsigned int eleindx; - boolean localp; + bfd_boolean localp; unsigned int size; struct ieee_modified_type *m = NULL; struct ieee_modified_array_type *a; @@ -5763,27 +5615,27 @@ ieee_array_type (p, low, high, stringp) { m = ieee_get_modified_info (info, eleindx); if (m == NULL) - return false; + return FALSE; for (a = m->arrays; a != NULL; a = a->next) { if (a->low == low && a->high == high) - return ieee_push_type (info, a->indx, size, false, false); + return ieee_push_type (info, a->indx, size, FALSE, FALSE); } } - if (! ieee_define_type (info, size, false, localp) + if (! ieee_define_type (info, size, FALSE, localp) || ! ieee_write_number (info, low == 0 ? 'Z' : 'C') || ! ieee_write_number (info, eleindx)) - return false; + return FALSE; if (low != 0) { if (! ieee_write_number (info, low)) - return false; + return FALSE; } if (! ieee_write_number (info, high + 1)) - return false; + return FALSE; if (! localp) { @@ -5798,18 +5650,16 @@ ieee_array_type (p, low, high, stringp) m->arrays = a; } - return true; + return TRUE; } /* Make a set type. */ -static boolean -ieee_set_type (p, bitstringp) - PTR p; - boolean bitstringp ATTRIBUTE_UNUSED; +static bfd_boolean +ieee_set_type (void *p, bfd_boolean bitstringp ATTRIBUTE_UNUSED) { struct ieee_handle *info = (struct ieee_handle *) p; - boolean localp; + bfd_boolean localp; unsigned int eleindx; localp = info->type_stack->type.localp; @@ -5817,7 +5667,7 @@ ieee_set_type (p, bitstringp) /* FIXME: We don't know the size, so we just use 4. */ - return (ieee_define_type (info, 0, true, localp) + return (ieee_define_type (info, 0, TRUE, localp) && ieee_write_number (info, 's') && ieee_write_number (info, 4) && ieee_write_number (info, eleindx)); @@ -5825,9 +5675,8 @@ ieee_set_type (p, bitstringp) /* Make an offset type. */ -static boolean -ieee_offset_type (p) - PTR p; +static bfd_boolean +ieee_offset_type (void *p) { struct ieee_handle *info = (struct ieee_handle *) p; unsigned int targetindx, baseindx; @@ -5842,17 +5691,14 @@ ieee_offset_type (p) member. Unfortunately, it does not describe the target type, which seems pretty important. I'm going to punt this for now. */ - return ieee_int_type (p, 4, true); + return ieee_int_type (p, 4, TRUE); } /* Make a method type. */ -static boolean -ieee_method_type (p, domain, argcount, varargs) - PTR p; - boolean domain; - int argcount; - boolean varargs; +static bfd_boolean +ieee_method_type (void *p, bfd_boolean domain, int argcount, + bfd_boolean varargs) { struct ieee_handle *info = (struct ieee_handle *) p; @@ -5868,13 +5714,12 @@ ieee_method_type (p, domain, argcount, varargs) /* Make a const qualified type. */ -static boolean -ieee_const_type (p) - PTR p; +static bfd_boolean +ieee_const_type (void *p) { struct ieee_handle *info = (struct ieee_handle *) p; unsigned int size; - boolean unsignedp, localp; + bfd_boolean unsignedp, localp; unsigned int indx; struct ieee_modified_type *m = NULL; @@ -5887,34 +5732,33 @@ ieee_const_type (p) { m = ieee_get_modified_info (info, indx); if (m == NULL) - return false; + return FALSE; if (m->const_qualified > 0) return ieee_push_type (info, m->const_qualified, size, unsignedp, - false); + FALSE); } if (! ieee_define_type (info, size, unsignedp, localp) || ! ieee_write_number (info, 'n') || ! ieee_write_number (info, 1) || ! ieee_write_number (info, indx)) - return false; + return FALSE; if (! localp) m->const_qualified = info->type_stack->type.indx; - return true; + return TRUE; } /* Make a volatile qualified type. */ -static boolean -ieee_volatile_type (p) - PTR p; +static bfd_boolean +ieee_volatile_type (void *p) { struct ieee_handle *info = (struct ieee_handle *) p; unsigned int size; - boolean unsignedp, localp; + bfd_boolean unsignedp, localp; unsigned int indx; struct ieee_modified_type *m = NULL; @@ -5927,30 +5771,29 @@ ieee_volatile_type (p) { m = ieee_get_modified_info (info, indx); if (m == NULL) - return false; + return FALSE; if (m->volatile_qualified > 0) return ieee_push_type (info, m->volatile_qualified, size, unsignedp, - false); + FALSE); } if (! ieee_define_type (info, size, unsignedp, localp) || ! ieee_write_number (info, 'n') || ! ieee_write_number (info, 2) || ! ieee_write_number (info, indx)) - return false; + return FALSE; if (! localp) m->volatile_qualified = info->type_stack->type.indx; - return true; + return TRUE; } /* Convert an enum debug_visibility into a CXXFLAGS value. */ static unsigned int -ieee_vis_to_flags (visibility) - enum debug_visibility visibility; +ieee_vis_to_flags (enum debug_visibility visibility) { switch (visibility) { @@ -5970,25 +5813,21 @@ ieee_vis_to_flags (visibility) the stack, to avoid confusing type definitions required by the fields with the struct type itself. */ -static boolean -ieee_start_struct_type (p, tag, id, structp, size) - PTR p; - const char *tag; - unsigned int id; - boolean structp; - unsigned int size; +static bfd_boolean +ieee_start_struct_type (void *p, const char *tag, unsigned int id, + bfd_boolean structp, unsigned int size) { struct ieee_handle *info = (struct ieee_handle *) p; - boolean localp, ignorep; - boolean copy; + bfd_boolean localp, ignorep; + bfd_boolean copy; char ab[20]; const char *look; struct ieee_name_type_hash_entry *h; struct ieee_name_type *nt, *ntlook; struct ieee_buflist strdef; - localp = false; - ignorep = false; + localp = FALSE; + ignorep = FALSE; /* We need to create a tag for internal use even if we don't want one for external use. This will let us refer to an anonymous @@ -5996,20 +5835,20 @@ ieee_start_struct_type (p, tag, id, structp, size) if (tag != NULL) { look = tag; - copy = false; + copy = FALSE; } else { sprintf (ab, "__anon%u", id); look = ab; - copy = true; + copy = TRUE; } /* If we already have references to the tag, we must use the existing type index. */ - h = ieee_name_type_hash_lookup (&info->tags, look, true, copy); + h = ieee_name_type_hash_lookup (&info->tags, look, TRUE, copy); if (h == NULL) - return false; + return FALSE; nt = NULL; for (ntlook = h->types; ntlook != NULL; ntlook = ntlook->next) @@ -6021,7 +5860,7 @@ ieee_start_struct_type (p, tag, id, structp, size) /* We are creating a duplicate definition of a globally defined tag. Force it to be local to avoid confusion. */ - localp = true; + localp = TRUE; } } @@ -6032,7 +5871,7 @@ ieee_start_struct_type (p, tag, id, structp, size) { /* We've already seen a global definition of the type. Ignore this new definition. */ - ignorep = true; + ignorep = TRUE; } } else @@ -6050,11 +5889,11 @@ ieee_start_struct_type (p, tag, id, structp, size) nt->kind = DEBUG_KIND_ILLEGAL; if (! ieee_init_buffer (info, &strdef) - || ! ieee_define_named_type (info, tag, nt->type.indx, size, true, + || ! ieee_define_named_type (info, tag, nt->type.indx, size, TRUE, localp, &strdef) || ! ieee_write_number (info, structp ? 'S' : 'U') || ! ieee_write_number (info, size)) - return false; + return FALSE; if (! ignorep) { @@ -6072,24 +5911,20 @@ ieee_start_struct_type (p, tag, id, structp, size) info->type_stack->type.strdef = strdef; info->type_stack->type.ignorep = ignorep; - return true; + return TRUE; } /* Add a field to a struct. */ -static boolean -ieee_struct_field (p, name, bitpos, bitsize, visibility) - PTR p; - const char *name; - bfd_vma bitpos; - bfd_vma bitsize; - enum debug_visibility visibility; +static bfd_boolean +ieee_struct_field (void *p, const char *name, bfd_vma bitpos, bfd_vma bitsize, + enum debug_visibility visibility) { struct ieee_handle *info = (struct ieee_handle *) p; unsigned int size; - boolean unsignedp; - boolean referencep; - boolean localp; + bfd_boolean unsignedp; + bfd_boolean referencep; + bfd_boolean localp; unsigned int indx; bfd_vma offset; @@ -6102,7 +5937,7 @@ ieee_struct_field (p, name, bitpos, bitsize, visibility) if (info->type_stack->next->type.ignorep) { ieee_pop_unused_type (info); - return true; + return TRUE; } size = info->type_stack->type.size; @@ -6112,7 +5947,7 @@ ieee_struct_field (p, name, bitpos, bitsize, visibility) indx = ieee_pop_type (info); if (localp) - info->type_stack->type.localp = true; + info->type_stack->type.localp = TRUE; if (info->type_stack->type.classdef != NULL) { @@ -6130,7 +5965,7 @@ ieee_struct_field (p, name, bitpos, bitsize, visibility) || ! ieee_write_asn (info, nindx, flags) || ! ieee_write_atn65 (info, nindx, name) || ! ieee_write_atn65 (info, nindx, name)) - return false; + return FALSE; info->type_stack->type.classdef->pmisccount += 4; if (referencep) @@ -6160,7 +5995,7 @@ ieee_struct_field (p, name, bitpos, bitsize, visibility) || ! ieee_write_asn (info, nindx, 3) || ! ieee_write_atn65 (info, nindx, info->type_stack->type.name) || ! ieee_write_atn65 (info, nindx, name)) - return false; + return FALSE; } } @@ -6176,7 +6011,7 @@ ieee_struct_field (p, name, bitpos, bitsize, visibility) || ! ieee_write_number (info, unsignedp ? 0 : 1) || ! ieee_write_number (info, bitsize) || ! ieee_write_number (info, indx)) - return false; + return FALSE; indx = ieee_pop_type (info); offset = bitpos; } @@ -6191,9 +6026,8 @@ ieee_struct_field (p, name, bitpos, bitsize, visibility) /* Finish up a struct type. */ -static boolean -ieee_end_struct_type (p) - PTR p; +static bfd_boolean +ieee_end_struct_type (void *p) { struct ieee_handle *info = (struct ieee_handle *) p; struct ieee_buflist *pb; @@ -6202,13 +6036,13 @@ ieee_end_struct_type (p) && ! ieee_buffer_emptyp (&info->type_stack->type.strdef)); /* If we were ignoring this struct definition because it was a - duplicate defintion, just through away whatever bytes we have + duplicate definition, just through away whatever bytes we have accumulated. Leave the type on the stack. */ if (info->type_stack->type.ignorep) - return true; + return TRUE; /* If this is not a duplicate definition of this tag, then localp - will be false, and we can put it in the global type block. + will be FALSE, and we can put it in the global type block. FIXME: We should avoid outputting duplicate definitions which are the same. */ if (! info->type_stack->type.localp) @@ -6221,7 +6055,7 @@ ieee_end_struct_type (p) || ! ieee_write_byte (info, 2) || ! ieee_write_number (info, 0) || ! ieee_write_id (info, "")) - return false; + return FALSE; } pb = &info->global_types; } @@ -6235,7 +6069,7 @@ ieee_end_struct_type (p) || ! ieee_write_byte (info, 1) || ! ieee_write_number (info, 0) || ! ieee_write_id (info, info->modname)) - return false; + return FALSE; } pb = &info->types; } @@ -6243,24 +6077,19 @@ ieee_end_struct_type (p) /* Append the struct definition to the types. */ if (! ieee_append_buffer (info, pb, &info->type_stack->type.strdef) || ! ieee_init_buffer (info, &info->type_stack->type.strdef)) - return false; + return FALSE; /* Leave the struct on the type stack. */ - return true; + return TRUE; } /* Start a class type. */ -static boolean -ieee_start_class_type (p, tag, id, structp, size, vptr, ownvptr) - PTR p; - const char *tag; - unsigned int id; - boolean structp; - unsigned int size; - boolean vptr; - boolean ownvptr; +static bfd_boolean +ieee_start_class_type (void *p, const char *tag, unsigned int id, + bfd_boolean structp, unsigned int size, + bfd_boolean vptr, bfd_boolean ownvptr) { struct ieee_handle *info = (struct ieee_handle *) p; const char *vclass; @@ -6296,7 +6125,7 @@ ieee_start_class_type (p, tag, id, structp, size, vptr, ownvptr) } if (! ieee_start_struct_type (p, tag, id, structp, size)) - return false; + return FALSE; indx = info->name_indx; ++info->name_indx; @@ -6309,7 +6138,7 @@ ieee_start_class_type (p, tag, id, structp, size, vptr, ownvptr) || ! ieee_write_asn (info, indx, 'T') || ! ieee_write_asn (info, indx, structp ? 'o' : 'u') || ! ieee_write_atn65 (info, indx, tag)) - return false; + return FALSE; classdef = (struct ieee_type_class *) xmalloc (sizeof *classdef); memset (classdef, 0, sizeof *classdef); @@ -6322,17 +6151,14 @@ ieee_start_class_type (p, tag, id, structp, size, vptr, ownvptr) info->type_stack->type.classdef = classdef; - return true; + return TRUE; } /* Add a static member to a class. */ -static boolean -ieee_class_static_member (p, name, physname, visibility) - PTR p; - const char *name; - const char *physname; - enum debug_visibility visibility; +static bfd_boolean +ieee_class_static_member (void *p, const char *name, const char *physname, + enum debug_visibility visibility) { struct ieee_handle *info = (struct ieee_handle *) p; unsigned int flags; @@ -6356,24 +6182,21 @@ ieee_class_static_member (p, name, physname, visibility) || ! ieee_write_asn (info, nindx, flags) || ! ieee_write_atn65 (info, nindx, name) || ! ieee_write_atn65 (info, nindx, physname)) - return false; + return FALSE; info->type_stack->type.classdef->pmisccount += 4; - return true; + return TRUE; } /* Add a base class to a class. */ -static boolean -ieee_class_baseclass (p, bitpos, virtual, visibility) - PTR p; - bfd_vma bitpos; - boolean virtual; - enum debug_visibility visibility; +static bfd_boolean +ieee_class_baseclass (void *p, bfd_vma bitpos, bfd_boolean virtual, + enum debug_visibility visibility) { struct ieee_handle *info = (struct ieee_handle *) p; const char *bname; - boolean localp; + bfd_boolean localp; unsigned int bindx; char *fname; unsigned int flags; @@ -6403,7 +6226,7 @@ ieee_class_baseclass (p, bitpos, virtual, visibility) else { if (localp) - info->type_stack->type.localp = true; + info->type_stack->type.localp = TRUE; fname = (char *) xmalloc (strlen (bname) + sizeof "_b$"); sprintf (fname, "_b$%s", bname); @@ -6412,7 +6235,7 @@ ieee_class_baseclass (p, bitpos, virtual, visibility) || ! ieee_write_id (info, fname) || ! ieee_write_number (info, bindx) || ! ieee_write_number (info, bitpos / 8)) - return false; + return FALSE; flags = 0; } @@ -6427,20 +6250,18 @@ ieee_class_baseclass (p, bitpos, virtual, visibility) || ! ieee_write_atn65 (info, nindx, bname) || ! ieee_write_asn (info, nindx, 0) || ! ieee_write_atn65 (info, nindx, fname)) - return false; + return FALSE; info->type_stack->type.classdef->pmisccount += 5; free (fname); - return true; + return TRUE; } /* Start building a method for a class. */ -static boolean -ieee_class_start_method (p, name) - PTR p; - const char *name; +static bfd_boolean +ieee_class_start_method (void *p, const char *name) { struct ieee_handle *info = (struct ieee_handle *) p; @@ -6450,26 +6271,21 @@ ieee_class_start_method (p, name) info->type_stack->type.classdef->method = name; - return true; + return TRUE; } /* Define a new method variant, either static or not. */ -static boolean -ieee_class_method_var (info, physname, visibility, staticp, constp, - volatilep, voffset, context) - struct ieee_handle *info; - const char *physname; - enum debug_visibility visibility; - boolean staticp; - boolean constp; - boolean volatilep; - bfd_vma voffset; - boolean context; +static bfd_boolean +ieee_class_method_var (struct ieee_handle *info, const char *physname, + enum debug_visibility visibility, + bfd_boolean staticp, bfd_boolean constp, + bfd_boolean volatilep, bfd_vma voffset, + bfd_boolean context) { unsigned int flags; unsigned int nindx; - boolean virtual; + bfd_boolean virtual; /* We don't need the type of the method. An IEEE consumer which wants the type must track down the function by the physical name @@ -6508,65 +6324,56 @@ ieee_class_method_var (info, physname, visibility, staticp, constp, || ! ieee_write_atn65 (info, nindx, info->type_stack->type.classdef->method) || ! ieee_write_atn65 (info, nindx, physname)) - return false; + return FALSE; if (virtual) { if (voffset > info->type_stack->type.classdef->voffset) info->type_stack->type.classdef->voffset = voffset; if (! ieee_write_asn (info, nindx, voffset)) - return false; + return FALSE; ++info->type_stack->type.classdef->pmisccount; } if (! ieee_write_asn (info, nindx, 0)) - return false; + return FALSE; info->type_stack->type.classdef->pmisccount += 5; - return true; + return TRUE; } /* Define a new method variant. */ -static boolean -ieee_class_method_variant (p, physname, visibility, constp, volatilep, - voffset, context) - PTR p; - const char *physname; - enum debug_visibility visibility; - boolean constp; - boolean volatilep; - bfd_vma voffset; - boolean context; +static bfd_boolean +ieee_class_method_variant (void *p, const char *physname, + enum debug_visibility visibility, + bfd_boolean constp, bfd_boolean volatilep, + bfd_vma voffset, bfd_boolean context) { struct ieee_handle *info = (struct ieee_handle *) p; - return ieee_class_method_var (info, physname, visibility, false, constp, + return ieee_class_method_var (info, physname, visibility, FALSE, constp, volatilep, voffset, context); } /* Define a new static method variant. */ -static boolean -ieee_class_static_method_variant (p, physname, visibility, constp, volatilep) - PTR p; - const char *physname; - enum debug_visibility visibility; - boolean constp; - boolean volatilep; +static bfd_boolean +ieee_class_static_method_variant (void *p, const char *physname, + enum debug_visibility visibility, + bfd_boolean constp, bfd_boolean volatilep) { struct ieee_handle *info = (struct ieee_handle *) p; - return ieee_class_method_var (info, physname, visibility, true, constp, - volatilep, 0, false); + return ieee_class_method_var (info, physname, visibility, TRUE, constp, + volatilep, 0, FALSE); } /* Finish up a method. */ -static boolean -ieee_class_end_method (p) - PTR p; +static bfd_boolean +ieee_class_end_method (void *p) { struct ieee_handle *info = (struct ieee_handle *) p; @@ -6576,14 +6383,13 @@ ieee_class_end_method (p) info->type_stack->type.classdef->method = NULL; - return true; + return TRUE; } /* Finish up a class. */ -static boolean -ieee_end_class_type (p) - PTR p; +static bfd_boolean +ieee_end_class_type (void *p) { struct ieee_handle *info = (struct ieee_handle *) p; unsigned int nindx; @@ -6595,7 +6401,7 @@ ieee_end_class_type (p) duplicate definition, just through away whatever bytes we have accumulated. Leave the type on the stack. */ if (info->type_stack->type.ignorep) - return true; + return TRUE; nindx = info->type_stack->type.classdef->indx; @@ -6609,20 +6415,20 @@ ieee_end_class_type (p) || ! ieee_write_atn65 (info, nindx, "") || ! ieee_write_asn (info, nindx, info->type_stack->type.classdef->voffset)) - return false; + return FALSE; if (info->type_stack->type.classdef->ownvptr) { if (! ieee_write_atn65 (info, nindx, "")) - return false; + return FALSE; } else { if (! ieee_write_atn65 (info, nindx, info->type_stack->type.classdef->vclass)) - return false; + return FALSE; } if (! ieee_write_asn (info, nindx, 0)) - return false; + return FALSE; info->type_stack->type.classdef->pmisccount += 5; } @@ -6641,16 +6447,16 @@ ieee_end_class_type (p) || ! ieee_write_number (info, 80) || ! ieee_write_number (info, info->type_stack->type.classdef->pmisccount)) - return false; + return FALSE; if (! ieee_append_buffer (info, &info->cxx, &info->type_stack->type.classdef->pmiscbuf)) - return false; + return FALSE; if (! ieee_buffer_emptyp (&info->type_stack->type.classdef->refs)) { if (! ieee_append_buffer (info, &info->cxx, &info->type_stack->type.classdef->refs)) - return false; + return FALSE; } return ieee_end_struct_type (p); @@ -6658,16 +6464,14 @@ ieee_end_class_type (p) /* Push a previously seen typedef onto the type stack. */ -static boolean -ieee_typedef_type (p, name) - PTR p; - const char *name; +static bfd_boolean +ieee_typedef_type (void *p, const char *name) { struct ieee_handle *info = (struct ieee_handle *) p; struct ieee_name_type_hash_entry *h; struct ieee_name_type *nt; - h = ieee_name_type_hash_lookup (&info->typedefs, name, false, false); + h = ieee_name_type_hash_lookup (&info->typedefs, name, FALSE, FALSE); /* h should never be NULL, since that would imply that the generic debugging code has asked for a typedef which it has not yet @@ -6680,26 +6484,23 @@ ieee_typedef_type (p, name) nt = h->types; if (! ieee_push_type (info, nt->type.indx, nt->type.size, nt->type.unsignedp, nt->type.localp)) - return false; + return FALSE; /* Copy over any other type information we may have. */ info->type_stack->type = nt->type; - return true; + return TRUE; } /* Push a tagged type onto the type stack. */ -static boolean -ieee_tag_type (p, name, id, kind) - PTR p; - const char *name; - unsigned int id; - enum debug_type_kind kind; +static bfd_boolean +ieee_tag_type (void *p, const char *name, unsigned int id, + enum debug_type_kind kind) { struct ieee_handle *info = (struct ieee_handle *) p; - boolean localp; - boolean copy; + bfd_boolean localp; + bfd_boolean copy; char ab[20]; struct ieee_name_type_hash_entry *h; struct ieee_name_type *nt; @@ -6712,7 +6513,7 @@ ieee_tag_type (p, name, id, kind) abort (); for (e = info->enums; e != NULL; e = e->next) if (e->tag != NULL && strcmp (e->tag, name) == 0) - return ieee_push_type (info, e->indx, 0, true, false); + return ieee_push_type (info, e->indx, 0, TRUE, FALSE); e = (struct ieee_defined_enum *) xmalloc (sizeof *e); memset (e, 0, sizeof *e); @@ -6720,27 +6521,27 @@ ieee_tag_type (p, name, id, kind) e->indx = info->type_indx; ++info->type_indx; e->tag = name; - e->defined = false; + e->defined = FALSE; e->next = info->enums; info->enums = e; - return ieee_push_type (info, e->indx, 0, true, false); + return ieee_push_type (info, e->indx, 0, TRUE, FALSE); } - localp = false; + localp = FALSE; - copy = false; + copy = FALSE; if (name == NULL) { sprintf (ab, "__anon%u", id); name = ab; - copy = true; + copy = TRUE; } - h = ieee_name_type_hash_lookup (&info->tags, name, true, copy); + h = ieee_name_type_hash_lookup (&info->tags, name, TRUE, copy); if (h == NULL) - return false; + return FALSE; for (nt = h->types; nt != NULL; nt = nt->next) { @@ -6748,17 +6549,17 @@ ieee_tag_type (p, name, id, kind) { if (! ieee_push_type (info, nt->type.indx, nt->type.size, nt->type.unsignedp, nt->type.localp)) - return false; + return FALSE; /* Copy over any other type information we may have. */ info->type_stack->type = nt->type; - return true; + return TRUE; } if (! nt->type.localp) { /* This is a duplicate of a global type, so it must be local. */ - localp = true; + localp = TRUE; } } @@ -6775,26 +6576,24 @@ ieee_tag_type (p, name, id, kind) nt->next = h->types; h->types = nt; - if (! ieee_push_type (info, nt->type.indx, 0, false, localp)) - return false; + if (! ieee_push_type (info, nt->type.indx, 0, FALSE, localp)) + return FALSE; info->type_stack->type.name = h->root.string; - return true; + return TRUE; } /* Output a typedef. */ -static boolean -ieee_typdef (p, name) - PTR p; - const char *name; +static bfd_boolean +ieee_typdef (void *p, const char *name) { struct ieee_handle *info = (struct ieee_handle *) p; struct ieee_write_type type; unsigned int indx; - boolean found; - boolean localp; + bfd_boolean found; + bfd_boolean localp; struct ieee_name_type_hash_entry *h; struct ieee_name_type *nt; @@ -6806,7 +6605,7 @@ ieee_typdef (p, name) type index to correspond to the name being used. We recognize names used in stabs debugging output even if they don't exactly correspond to the names used for the IEEE builtin types. */ - found = false; + found = FALSE; if (indx <= (unsigned int) builtin_bcd_float) { switch ((enum builtin_types) indx) @@ -6816,7 +6615,7 @@ ieee_typdef (p, name) case builtin_void: if (strcmp (name, "void") == 0) - found = true; + found = TRUE; break; case builtin_signed_char: @@ -6824,18 +6623,18 @@ ieee_typdef (p, name) if (strcmp (name, "signed char") == 0) { indx = (unsigned int) builtin_signed_char; - found = true; + found = TRUE; } else if (strcmp (name, "char") == 0) { indx = (unsigned int) builtin_char; - found = true; + found = TRUE; } break; case builtin_unsigned_char: if (strcmp (name, "unsigned char") == 0) - found = true; + found = TRUE; break; case builtin_signed_short_int: @@ -6845,22 +6644,22 @@ ieee_typdef (p, name) if (strcmp (name, "signed short int") == 0) { indx = (unsigned int) builtin_signed_short_int; - found = true; + found = TRUE; } else if (strcmp (name, "short") == 0) { indx = (unsigned int) builtin_short; - found = true; + found = TRUE; } else if (strcmp (name, "short int") == 0) { indx = (unsigned int) builtin_short_int; - found = true; + found = TRUE; } else if (strcmp (name, "signed short") == 0) { indx = (unsigned int) builtin_signed_short; - found = true; + found = TRUE; } break; @@ -6870,12 +6669,12 @@ ieee_typdef (p, name) || strcmp (name, "short unsigned int") == 0) { indx = builtin_unsigned_short_int; - found = true; + found = TRUE; } else if (strcmp (name, "unsigned short") == 0) { indx = builtin_unsigned_short; - found = true; + found = TRUE; } break; @@ -6885,18 +6684,18 @@ ieee_typdef (p, name) if (strcmp (name, "signed long") == 0) { indx = builtin_signed_long; - found = true; + found = TRUE; } else if (strcmp (name, "int") == 0) { indx = builtin_int; - found = true; + found = TRUE; } else if (strcmp (name, "long") == 0 || strcmp (name, "long int") == 0) { indx = builtin_long; - found = true; + found = TRUE; } break; @@ -6907,50 +6706,50 @@ ieee_typdef (p, name) || strcmp (name, "long unsigned int") == 0) { indx = builtin_unsigned_long; - found = true; + found = TRUE; } else if (strcmp (name, "unsigned") == 0) { indx = builtin_unsigned; - found = true; + found = TRUE; } else if (strcmp (name, "unsigned int") == 0) { indx = builtin_unsigned_int; - found = true; + found = TRUE; } break; case builtin_signed_long_long: if (strcmp (name, "signed long long") == 0 || strcmp (name, "long long int") == 0) - found = true; + found = TRUE; break; case builtin_unsigned_long_long: if (strcmp (name, "unsigned long long") == 0 || strcmp (name, "long long unsigned int") == 0) - found = true; + found = TRUE; break; case builtin_float: if (strcmp (name, "float") == 0) - found = true; + found = TRUE; break; case builtin_double: if (strcmp (name, "double") == 0) - found = true; + found = TRUE; break; case builtin_long_double: if (strcmp (name, "long double") == 0) - found = true; + found = TRUE; break; case builtin_long_long_double: if (strcmp (name, "long long double") == 0) - found = true; + found = TRUE; break; } @@ -6958,9 +6757,9 @@ ieee_typdef (p, name) type.indx = indx; } - h = ieee_name_type_hash_lookup (&info->typedefs, name, true, false); + h = ieee_name_type_hash_lookup (&info->typedefs, name, TRUE, FALSE); if (h == NULL) - return false; + return FALSE; /* See if we have already defined this type with this name. */ localp = type.localp; @@ -6973,13 +6772,13 @@ ieee_typdef (p, name) if (! nt->type.localp) { ieee_pop_unused_type (info); - return true; + return TRUE; } } else { /* This is a duplicate definition, so make this one local. */ - localp = true; + localp = TRUE; } } @@ -7001,7 +6800,7 @@ ieee_typdef (p, name) /* This is one of the builtin typedefs, so we don't need to actually define it. */ ieee_pop_unused_type (info); - return true; + return TRUE; } indx = ieee_pop_type (info); @@ -7011,85 +6810,75 @@ ieee_typdef (p, name) (struct ieee_buflist *) NULL) || ! ieee_write_number (info, 'T') || ! ieee_write_number (info, indx)) - return false; + return FALSE; /* Remove the type we just added to the type stack. This should not be ieee_pop_unused_type, since the type is used, we just don't need it now. */ (void) ieee_pop_type (info); - return true; + return TRUE; } /* Output a tag for a type. We don't have to do anything here. */ -static boolean -ieee_tag (p, name) - PTR p; - const char *name ATTRIBUTE_UNUSED; +static bfd_boolean +ieee_tag (void *p, const char *name ATTRIBUTE_UNUSED) { struct ieee_handle *info = (struct ieee_handle *) p; /* This should not be ieee_pop_unused_type, since we want the type to be defined. */ (void) ieee_pop_type (info); - return true; + return TRUE; } /* Output an integer constant. */ -static boolean -ieee_int_constant (p, name, val) - PTR p ATTRIBUTE_UNUSED; - const char *name ATTRIBUTE_UNUSED; - bfd_vma val ATTRIBUTE_UNUSED; +static bfd_boolean +ieee_int_constant (void *p ATTRIBUTE_UNUSED, const char *name ATTRIBUTE_UNUSED, + bfd_vma val ATTRIBUTE_UNUSED) { /* FIXME. */ - return true; + return TRUE; } /* Output a floating point constant. */ -static boolean -ieee_float_constant (p, name, val) - PTR p ATTRIBUTE_UNUSED; - const char *name ATTRIBUTE_UNUSED; - double val ATTRIBUTE_UNUSED; +static bfd_boolean +ieee_float_constant (void *p ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED, + double val ATTRIBUTE_UNUSED) { /* FIXME. */ - return true; + return TRUE; } /* Output a typed constant. */ -static boolean -ieee_typed_constant (p, name, val) - PTR p; - const char *name ATTRIBUTE_UNUSED; - bfd_vma val ATTRIBUTE_UNUSED; +static bfd_boolean +ieee_typed_constant (void *p, const char *name ATTRIBUTE_UNUSED, + bfd_vma val ATTRIBUTE_UNUSED) { struct ieee_handle *info = (struct ieee_handle *) p; /* FIXME. */ ieee_pop_unused_type (info); - return true; + return TRUE; } /* Output a variable. */ -static boolean -ieee_variable (p, name, kind, val) - PTR p; - const char *name; - enum debug_var_kind kind; - bfd_vma val; +static bfd_boolean +ieee_variable (void *p, const char *name, enum debug_var_kind kind, + bfd_vma val) { struct ieee_handle *info = (struct ieee_handle *) p; unsigned int name_indx; unsigned int size; - boolean referencep; + bfd_boolean referencep; unsigned int type_indx; - boolean asn; + bfd_boolean asn; int refflag; size = info->type_stack->type.size; @@ -7098,7 +6887,7 @@ ieee_variable (p, name, kind, val) assert (! ieee_buffer_emptyp (&info->vars)); if (! ieee_change_buffer (info, &info->vars)) - return false; + return FALSE; name_indx = info->name_indx; ++info->name_indx; @@ -7110,54 +6899,54 @@ ieee_variable (p, name, kind, val) || ! ieee_write_2bytes (info, (int) ieee_atn_record_enum) || ! ieee_write_number (info, name_indx) || ! ieee_write_number (info, type_indx)) - return false; + return FALSE; switch (kind) { default: abort (); - return false; + return FALSE; case DEBUG_GLOBAL: if (! ieee_write_number (info, 8) - || ! ieee_add_range (info, false, val, val + size)) - return false; + || ! ieee_add_range (info, FALSE, val, val + size)) + return FALSE; refflag = 0; - asn = true; + asn = TRUE; break; case DEBUG_STATIC: if (! ieee_write_number (info, 3) - || ! ieee_add_range (info, false, val, val + size)) - return false; + || ! ieee_add_range (info, FALSE, val, val + size)) + return FALSE; refflag = 1; - asn = true; + asn = TRUE; break; case DEBUG_LOCAL_STATIC: if (! ieee_write_number (info, 3) - || ! ieee_add_range (info, false, val, val + size)) - return false; + || ! ieee_add_range (info, FALSE, val, val + size)) + return FALSE; refflag = 2; - asn = true; + asn = TRUE; break; case DEBUG_LOCAL: if (! ieee_write_number (info, 1) || ! ieee_write_number (info, val)) - return false; + return FALSE; refflag = 2; - asn = false; + asn = FALSE; break; case DEBUG_REGISTER: if (! ieee_write_number (info, 2) || ! ieee_write_number (info, ieee_genreg_to_regno (info->abfd, val))) - return false; + return FALSE; refflag = 2; - asn = false; + asn = FALSE; break; } if (asn) { if (! ieee_write_asn (info, name_indx, val)) - return false; + return FALSE; } /* If this is really a reference type, then we just output it with @@ -7177,7 +6966,7 @@ ieee_variable (p, name, kind, val) if (refflag != 2) { if (! ieee_change_buffer (info, &info->cxx)) - return false; + return FALSE; } if (! ieee_write_byte (info, (int) ieee_nn_record) @@ -7192,22 +6981,19 @@ ieee_variable (p, name, kind, val) || ! ieee_write_asn (info, nindx, 'R') || ! ieee_write_asn (info, nindx, refflag) || ! ieee_write_atn65 (info, nindx, name)) - return false; + return FALSE; } - return true; + return TRUE; } /* Start outputting information for a function. */ -static boolean -ieee_start_function (p, name, global) - PTR p; - const char *name; - boolean global; +static bfd_boolean +ieee_start_function (void *p, const char *name, bfd_boolean global) { struct ieee_handle *info = (struct ieee_handle *) p; - boolean referencep; + bfd_boolean referencep; unsigned int retindx, typeindx; referencep = info->type_stack->type.referencep; @@ -7227,19 +7013,19 @@ ieee_start_function (p, name, global) info->fnname = name; /* An attribute of 0x40 means that the push mask is unknown. */ - if (! ieee_define_named_type (info, name, (unsigned int) -1, 0, false, true, + if (! ieee_define_named_type (info, name, (unsigned int) -1, 0, FALSE, TRUE, &info->fntype) || ! ieee_write_number (info, 'x') || ! ieee_write_number (info, 0x40) || ! ieee_write_number (info, 0) || ! ieee_write_number (info, 0) || ! ieee_write_number (info, retindx)) - return false; + return FALSE; typeindx = ieee_pop_type (info); if (! ieee_init_buffer (info, &info->fnargs)) - return false; + return FALSE; info->fnargcount = 0; /* If the function return value is actually a reference type, we @@ -7263,12 +7049,12 @@ ieee_start_function (p, name, global) || ! ieee_write_asn (info, nindx, 'R') || ! ieee_write_asn (info, nindx, global ? 0 : 1) || ! ieee_write_atn65 (info, nindx, name)) - return false; + return FALSE; } assert (! ieee_buffer_emptyp (&info->vars)); if (! ieee_change_buffer (info, &info->vars)) - return false; + return FALSE; /* The address is written out as the first block. */ @@ -7285,12 +7071,9 @@ ieee_start_function (p, name, global) /* Add a function parameter. This will normally be called before the first block, so we postpone them until we see the block. */ -static boolean -ieee_function_parameter (p, name, kind, val) - PTR p; - const char *name; - enum debug_parm_kind kind; - bfd_vma val; +static bfd_boolean +ieee_function_parameter (void *p, const char *name, enum debug_parm_kind kind, + bfd_vma val) { struct ieee_handle *info = (struct ieee_handle *) p; struct ieee_pending_parm *m, **pm; @@ -7314,17 +7097,16 @@ ieee_function_parameter (p, name, kind, val) /* Add the type to the fnargs list. */ if (! ieee_change_buffer (info, &info->fnargs) || ! ieee_write_number (info, m->type)) - return false; + return FALSE; ++info->fnargcount; - return true; + return TRUE; } /* Output pending function parameters. */ -static boolean -ieee_output_pending_parms (info) - struct ieee_handle *info; +static bfd_boolean +ieee_output_pending_parms (struct ieee_handle *info) { struct ieee_pending_parm *m; unsigned int refcount; @@ -7338,7 +7120,7 @@ ieee_output_pending_parms (info) { default: abort (); - return false; + return FALSE; case DEBUG_PARM_STACK: case DEBUG_PARM_REFERENCE: vkind = DEBUG_LOCAL; @@ -7349,13 +7131,13 @@ ieee_output_pending_parms (info) break; } - if (! ieee_push_type (info, m->type, 0, false, false)) - return false; + if (! ieee_push_type (info, m->type, 0, FALSE, FALSE)) + return FALSE; info->type_stack->type.referencep = m->referencep; if (m->referencep) ++refcount; - if (! ieee_variable ((PTR) info, m->name, vkind, m->val)) - return false; + if (! ieee_variable ((void *) info, m->name, vkind, m->val)) + return FALSE; } /* If there are any reference parameters, we need to output a @@ -7381,7 +7163,7 @@ ieee_output_pending_parms (info) || ! ieee_write_asn (info, nindx, 'B') || ! ieee_write_atn65 (info, nindx, info->fnname) || ! ieee_write_asn (info, nindx, 0)) - return false; + return FALSE; for (m = info->pending_parms, varindx = 1; m != NULL; m = m->next, varindx++) @@ -7389,7 +7171,7 @@ ieee_output_pending_parms (info) if (m->referencep) { if (! ieee_write_asn (info, nindx, varindx)) - return false; + return FALSE; } } } @@ -7406,27 +7188,25 @@ ieee_output_pending_parms (info) info->pending_parms = NULL; - return true; + return TRUE; } /* Start a block. If this is the first block, we output the address to finish the BB4 or BB6, and then output the function parameters. */ -static boolean -ieee_start_block (p, addr) - PTR p; - bfd_vma addr; +static bfd_boolean +ieee_start_block (void *p, bfd_vma addr) { struct ieee_handle *info = (struct ieee_handle *) p; if (! ieee_change_buffer (info, &info->vars)) - return false; + return FALSE; if (info->block_depth == 1) { if (! ieee_write_number (info, addr) || ! ieee_output_pending_parms (info)) - return false; + return FALSE; } else { @@ -7437,23 +7217,21 @@ ieee_start_block (p, addr) || ! ieee_write_number (info, 0) || ! ieee_write_number (info, 0) || ! ieee_write_number (info, addr)) - return false; + return FALSE; } if (! ieee_start_range (info, addr)) - return false; + return FALSE; ++info->block_depth; - return true; + return TRUE; } /* End a block. */ -static boolean -ieee_end_block (p, addr) - PTR p; - bfd_vma addr; +static bfd_boolean +ieee_end_block (void *p, bfd_vma addr) { struct ieee_handle *info = (struct ieee_handle *) p; @@ -7463,24 +7241,23 @@ ieee_end_block (p, addr) if (! ieee_change_buffer (info, &info->vars) || ! ieee_write_byte (info, (int) ieee_be_record_enum) || ! ieee_write_number (info, addr - 1)) - return false; + return FALSE; if (! ieee_end_range (info, addr)) - return false; + return FALSE; --info->block_depth; if (addr > info->highaddr) info->highaddr = addr; - return true; + return TRUE; } /* End a function. */ -static boolean -ieee_end_function (p) - PTR p; +static bfd_boolean +ieee_end_function (void *p) { struct ieee_handle *info = (struct ieee_handle *) p; @@ -7498,7 +7275,7 @@ ieee_end_function (p) || ! ieee_write_number (info, info->fnargcount) || ! ieee_change_buffer (info, &info->fnargs) || ! ieee_write_number (info, 0)) - return false; + return FALSE; /* Make sure the typdef block has been started. */ if (ieee_buffer_emptyp (&info->types)) @@ -7508,30 +7285,26 @@ ieee_end_function (p) || ! ieee_write_byte (info, 1) || ! ieee_write_number (info, 0) || ! ieee_write_id (info, info->modname)) - return false; + return FALSE; } if (! ieee_append_buffer (info, &info->types, &info->fntype) || ! ieee_append_buffer (info, &info->types, &info->fnargs)) - return false; + return FALSE; info->fnname = NULL; if (! ieee_init_buffer (info, &info->fntype) || ! ieee_init_buffer (info, &info->fnargs)) - return false; + return FALSE; info->fnargcount = 0; - return true; + return TRUE; } /* Record line number information. */ -static boolean -ieee_lineno (p, filename, lineno, addr) - PTR p; - const char *filename; - unsigned long lineno; - bfd_vma addr; +static bfd_boolean +ieee_lineno (void *p, const char *filename, unsigned long lineno, bfd_vma addr) { struct ieee_handle *info = (struct ieee_handle *) p; @@ -7548,7 +7321,7 @@ ieee_lineno (p, filename, lineno, addr) if (! ieee_buffer_emptyp (&info->linenos)) { if (! ieee_change_buffer (info, &info->linenos)) - return false; + return FALSE; } else { @@ -7562,7 +7335,7 @@ ieee_lineno (p, filename, lineno, addr) || ! ieee_write_byte (info, (int) ieee_nn_record) || ! ieee_write_number (info, info->lineno_name_indx) || ! ieee_write_id (info, "")) - return false; + return FALSE; info->lineno_filename = info->filename; } @@ -7573,7 +7346,7 @@ ieee_lineno (p, filename, lineno, addr) /* We were not in the main file. Close the block for the included file. */ if (! ieee_write_byte (info, (int) ieee_be_record_enum)) - return false; + return FALSE; if (strcmp (info->filename, info->pending_lineno_filename) == 0) { /* We need a new NN record, and we aren't about to @@ -7583,7 +7356,7 @@ ieee_lineno (p, filename, lineno, addr) if (! ieee_write_byte (info, (int) ieee_nn_record) || ! ieee_write_number (info, info->lineno_name_indx) || ! ieee_write_id (info, "")) - return false; + return FALSE; } } if (strcmp (info->filename, info->pending_lineno_filename) != 0) @@ -7599,7 +7372,7 @@ ieee_lineno (p, filename, lineno, addr) || ! ieee_write_byte (info, (int) ieee_nn_record) || ! ieee_write_number (info, info->lineno_name_indx) || ! ieee_write_id (info, "")) - return false; + return FALSE; } info->lineno_filename = info->pending_lineno_filename; } @@ -7612,12 +7385,12 @@ ieee_lineno (p, filename, lineno, addr) || ! ieee_write_number (info, 0) || ! ieee_write_asn (info, info->lineno_name_indx, info->pending_lineno_addr)) - return false; + return FALSE; } info->pending_lineno_filename = filename; info->pending_lineno = lineno; info->pending_lineno_addr = addr; - return true; + return TRUE; } diff --git a/contrib/binutils/binutils/nm.c b/contrib/binutils/binutils/nm.c index b9689b1..bac7d38 100644 --- a/contrib/binutils/binutils/nm.c +++ b/contrib/binutils/binutils/nm.c @@ -1,6 +1,6 @@ /* nm.c -- Describe symbol table of a rel file. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 + 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -37,7 +37,7 @@ struct size_sym { - const PTR minisym; + const void *minisym; bfd_vma size; }; @@ -68,66 +68,69 @@ struct extended_symbol_info #define SYM_SIZE(sym) \ (sym->elfinfo ? sym->elfinfo->internal_elf_sym.st_size: sym->ssize) -static void usage PARAMS ((FILE *, int)); -static void set_print_radix PARAMS ((char *)); -static void set_output_format PARAMS ((char *)); -static void display_archive PARAMS ((bfd *)); -static boolean display_file PARAMS ((char *)); -static void display_rel_file PARAMS ((bfd *, bfd *)); -static long filter_symbols PARAMS ((bfd *, boolean, PTR, long, unsigned int)); -static long sort_symbols_by_size PARAMS ((bfd *, boolean, PTR, long, unsigned int, struct size_sym **)); -static void print_symbols PARAMS ((bfd *, boolean, PTR, long, unsigned int, bfd *)); -static void print_size_symbols PARAMS ((bfd *, boolean, struct size_sym *, long, bfd *)); -static void print_symname PARAMS ((const char *, const char *, bfd *)); -static void print_symbol PARAMS ((bfd *, asymbol *, bfd_vma ssize, bfd *)); -static void print_symdef_entry PARAMS ((bfd *)); +static void usage (FILE *, int); +static void set_print_radix (char *); +static void set_output_format (char *); +static void display_archive (bfd *); +static bfd_boolean display_file (char *); +static void display_rel_file (bfd *, bfd *); +static long filter_symbols (bfd *, bfd_boolean, void *, long, unsigned int); +static long sort_symbols_by_size + (bfd *, bfd_boolean, void *, long, unsigned int, struct size_sym **); +static void print_symbols + (bfd *, bfd_boolean, void *, long, unsigned int, bfd *); +static void print_size_symbols + (bfd *, bfd_boolean, struct size_sym *, long, bfd *); +static void print_symname (const char *, const char *, bfd *); +static void print_symbol (bfd *, asymbol *, bfd_vma ssize, bfd *); +static void print_symdef_entry (bfd *); /* The sorting functions. */ -static int numeric_forward PARAMS ((const PTR, const PTR)); -static int numeric_reverse PARAMS ((const PTR, const PTR)); -static int non_numeric_forward PARAMS ((const PTR, const PTR)); -static int non_numeric_reverse PARAMS ((const PTR, const PTR)); -static int size_forward1 PARAMS ((const PTR, const PTR)); -static int size_forward2 PARAMS ((const PTR, const PTR)); +static int numeric_forward (const void *, const void *); +static int numeric_reverse (const void *, const void *); +static int non_numeric_forward (const void *, const void *); +static int non_numeric_reverse (const void *, const void *); +static int size_forward1 (const void *, const void *); +static int size_forward2 (const void *, const void *); /* The output formatting functions. */ -static void print_object_filename_bsd PARAMS ((char *)); -static void print_object_filename_sysv PARAMS ((char *)); -static void print_object_filename_posix PARAMS ((char *)); -static void print_archive_filename_bsd PARAMS ((char *)); -static void print_archive_filename_sysv PARAMS ((char *)); -static void print_archive_filename_posix PARAMS ((char *)); -static void print_archive_member_bsd PARAMS ((char *, const char *)); -static void print_archive_member_sysv PARAMS ((char *, const char *)); -static void print_archive_member_posix PARAMS ((char *, const char *)); -static void print_symbol_filename_bsd PARAMS ((bfd *, bfd *)); -static void print_symbol_filename_sysv PARAMS ((bfd *, bfd *)); -static void print_symbol_filename_posix PARAMS ((bfd *, bfd *)); -static void print_value PARAMS ((bfd *, bfd_vma)); -static void print_symbol_info_bsd PARAMS ((struct extended_symbol_info *, bfd *)); -static void print_symbol_info_sysv PARAMS ((struct extended_symbol_info *, bfd *)); -static void print_symbol_info_posix PARAMS ((struct extended_symbol_info *, bfd *)); -static void get_relocs PARAMS ((bfd *, asection *, PTR)); -static const char * get_symbol_type PARAMS ((unsigned int)); +static void print_object_filename_bsd (char *); +static void print_object_filename_sysv (char *); +static void print_object_filename_posix (char *); +static void print_archive_filename_bsd (char *); +static void print_archive_filename_sysv (char *); +static void print_archive_filename_posix (char *); +static void print_archive_member_bsd (char *, const char *); +static void print_archive_member_sysv (char *, const char *); +static void print_archive_member_posix (char *, const char *); +static void print_symbol_filename_bsd (bfd *, bfd *); +static void print_symbol_filename_sysv (bfd *, bfd *); +static void print_symbol_filename_posix (bfd *, bfd *); +static void print_value (bfd *, bfd_vma); +static void print_symbol_info_bsd (struct extended_symbol_info *, bfd *); +static void print_symbol_info_sysv (struct extended_symbol_info *, bfd *); +static void print_symbol_info_posix (struct extended_symbol_info *, bfd *); +static void get_relocs (bfd *, asection *, void *); +static const char * get_symbol_type (unsigned int); /* Support for different output formats. */ struct output_fns { /* Print the name of an object file given on the command line. */ - void (*print_object_filename) PARAMS ((char *)); + void (*print_object_filename) (char *); /* Print the name of an archive file given on the command line. */ - void (*print_archive_filename) PARAMS ((char *)); + void (*print_archive_filename) (char *); /* Print the name of an archive member file. */ - void (*print_archive_member) PARAMS ((char *, const char *)); + void (*print_archive_member) (char *, const char *); /* Print the name of the file (and archive, if there is one) containing a symbol. */ - void (*print_symbol_filename) PARAMS ((bfd *, bfd *)); + void (*print_symbol_filename) (bfd *, bfd *); /* Print a line of information about a symbol. */ - void (*print_symbol_info) PARAMS ((struct extended_symbol_info *, bfd *)); + void (*print_symbol_info) (struct extended_symbol_info *, bfd *); }; static struct output_fns formats[] = @@ -239,9 +242,7 @@ static struct option long_options[] = /* Some error-reporting functions. */ static void -usage (stream, status) - FILE *stream; - int status; +usage (FILE *stream, int status) { fprintf (stream, _("Usage: %s [option(s)] [file(s)]\n"), program_name); fprintf (stream, _(" List symbols in [file(s)] (a.out by default).\n")); @@ -251,7 +252,8 @@ usage (stream, status) -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\ + `gnu', `lucid', `arm', `hp', `edg', `gnu-v3', `java'\n\ + or `gnat'\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\ @@ -285,8 +287,7 @@ usage (stream, status) /* Set the radix for the symbol value and size according to RADIX. */ static void -set_print_radix (radix) - char *radix; +set_print_radix (char *radix) { switch (*radix) { @@ -316,8 +317,7 @@ set_print_radix (radix) } static void -set_output_format (f) - char *f; +set_output_format (char *f) { int i; @@ -341,12 +341,10 @@ set_output_format (f) format = &formats[i]; } -int main PARAMS ((int, char **)); +int main (int, char **); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int c; int retval; @@ -446,7 +444,7 @@ main (argc, argv) break; case 'X': /* Ignored for (partial) AIX compatibility. On AIX, the - argument has values 32, 64, or 32_64, and specfies that + argument has values 32, 64, or 32_64, and specifies 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 @@ -471,6 +469,13 @@ main (argc, argv) if (show_version) print_version ("nm"); + if (sort_by_size && undefined_only) + { + non_fatal (_("Using the --size-sort and --undefined-only options together")); + non_fatal (_("will produce no output, since undefined symbols have no size.")); + return 0; + } + /* OK, all options now parsed. If no filename specified, do a.out. */ if (optind == argc) return !display_file ("a.out"); @@ -504,8 +509,7 @@ main (argc, argv) } static const char * -get_symbol_type (type) - unsigned int type; +get_symbol_type (unsigned int type) { static char buff [32]; @@ -530,8 +534,7 @@ get_symbol_type (type) } static void -display_archive (file) - bfd *file; +display_archive (bfd *file) { bfd *arfile = NULL; bfd *last_arfile = NULL; @@ -592,19 +595,21 @@ display_archive (file) } } -static boolean -display_file (filename) - char *filename; +static bfd_boolean +display_file (char *filename) { - boolean retval = true; + bfd_boolean retval = TRUE; bfd *file; char **matching; + if (get_file_size (filename) < 1) + return FALSE; + file = bfd_openr (filename, target); if (file == NULL) { bfd_nonfatal (filename); - return false; + return FALSE; } if (bfd_check_format (file, bfd_archive)) @@ -628,10 +633,10 @@ display_file (filename) list_matching_formats (matching); free (matching); } - retval = false; + retval = FALSE; } - if (bfd_close (file) == false) + if (!bfd_close (file)) bfd_fatal (filename); lineno_cache_bfd = NULL; @@ -643,7 +648,7 @@ display_file (filename) /* These globals are used to pass information into the sorting routines. */ static bfd *sort_bfd; -static boolean sort_dynamic; +static bfd_boolean sort_dynamic; static asymbol *sort_x; static asymbol *sort_y; @@ -655,9 +660,7 @@ static asymbol *sort_y; specially -- i.e., their sizes are used as their "values". */ static int -numeric_forward (P_x, P_y) - const PTR P_x; - const PTR P_y; +numeric_forward (const void *P_x, const void *P_y) { asymbol *x, *y; asection *xs, *ys; @@ -684,17 +687,13 @@ numeric_forward (P_x, P_y) } static int -numeric_reverse (x, y) - const PTR x; - const PTR y; +numeric_reverse (const void *x, const void *y) { return - numeric_forward (x, y); } static int -non_numeric_forward (P_x, P_y) - const PTR P_x; - const PTR P_y; +non_numeric_forward (const void *P_x, const void *P_y) { asymbol *x, *y; const char *xn, *yn; @@ -727,14 +726,12 @@ non_numeric_forward (P_x, P_y) } static int -non_numeric_reverse (x, y) - const PTR x; - const PTR y; +non_numeric_reverse (const void *x, const void *y) { return - non_numeric_forward (x, y); } -static int (*(sorters[2][2])) PARAMS ((const PTR, const PTR)) = +static int (*(sorters[2][2])) (const void *, const void *) = { { non_numeric_forward, non_numeric_reverse }, { numeric_forward, numeric_reverse } @@ -752,9 +749,7 @@ static int (*(sorters[2][2])) PARAMS ((const PTR, const PTR)) = value. */ static int -size_forward1 (P_x, P_y) - const PTR P_x; - const PTR P_y; +size_forward1 (const void *P_x, const void *P_y) { asymbol *x, *y; asection *xs, *ys; @@ -824,9 +819,7 @@ size_forward1 (P_x, P_y) an array of size_sym structures into size order. */ static int -size_forward2 (P_x, P_y) - const PTR P_x; - const PTR P_y; +size_forward2 (const void *P_x, const void *P_y) { const struct size_sym *x = (const struct size_sym *) P_x; const struct size_sym *y = (const struct size_sym *) P_y; @@ -845,13 +838,9 @@ size_forward2 (P_x, P_y) size. */ static long -sort_symbols_by_size (abfd, dynamic, minisyms, symcount, size, symsizesp) - bfd *abfd; - boolean dynamic; - PTR minisyms; - long symcount; - unsigned int size; - struct size_sym **symsizesp; +sort_symbols_by_size (bfd *abfd, bfd_boolean dynamic, void *minisyms, + long symcount, unsigned int size, + struct size_sym **symsizesp) { struct size_sym *symsizes; bfd_byte *from, *fromend; @@ -876,7 +865,7 @@ sort_symbols_by_size (abfd, dynamic, minisyms, symcount, size, symsizesp) if (from < fromend) { - sym = bfd_minisymbol_to_symbol (abfd, dynamic, (const PTR) from, + sym = bfd_minisymbol_to_symbol (abfd, dynamic, (const void *) from, store_sym); if (sym == NULL) bfd_fatal (bfd_get_filename (abfd)); @@ -893,7 +882,7 @@ sort_symbols_by_size (abfd, dynamic, minisyms, symcount, size, symsizesp) { next = bfd_minisymbol_to_symbol (abfd, dynamic, - (const PTR) (from + size), + (const void *) (from + size), store_next); if (next == NULL) bfd_fatal (bfd_get_filename (abfd)); @@ -920,7 +909,7 @@ sort_symbols_by_size (abfd, dynamic, minisyms, symcount, size, symsizesp) if (sz != 0) { - symsizes->minisym = (const PTR) from; + symsizes->minisym = (const void *) from; symsizes->size = sz; ++symsizes; } @@ -935,7 +924,7 @@ sort_symbols_by_size (abfd, dynamic, minisyms, symcount, size, symsizesp) symcount = symsizes - *symsizesp; /* We must now sort again by size. */ - qsort ((PTR) *symsizesp, symcount, sizeof (struct size_sym), size_forward2); + qsort ((void *) *symsizesp, symcount, sizeof (struct size_sym), size_forward2); return symcount; } @@ -943,12 +932,10 @@ sort_symbols_by_size (abfd, dynamic, minisyms, symcount, size, symsizesp) /* If ARCHIVE_BFD is non-NULL, it is the archive containing ABFD. */ static void -display_rel_file (abfd, archive_bfd) - bfd *abfd; - bfd *archive_bfd; +display_rel_file (bfd *abfd, bfd *archive_bfd) { long symcount; - PTR minisyms; + void *minisyms; unsigned int size; struct size_sym *symsizes; @@ -1008,12 +995,8 @@ display_rel_file (abfd, archive_bfd) Return the number of symbols to be printed. */ static long -filter_symbols (abfd, dynamic, minisyms, symcount, size) - bfd *abfd; - boolean dynamic; - PTR minisyms; - long symcount; - unsigned int size; +filter_symbols (bfd *abfd, bfd_boolean dynamic, void *minisyms, + long symcount, unsigned int size) { bfd_byte *from, *fromend, *to; asymbol *store; @@ -1033,7 +1016,7 @@ filter_symbols (abfd, dynamic, minisyms, symcount, size) PROGRESS (1); - sym = bfd_minisymbol_to_symbol (abfd, dynamic, (const PTR) from, store); + sym = bfd_minisymbol_to_symbol (abfd, dynamic, (const void *) from, store); if (sym == NULL) bfd_fatal (bfd_get_filename (abfd)); @@ -1079,10 +1062,7 @@ filter_symbols (abfd, dynamic, minisyms, symcount, size) demangling it if requested. */ static void -print_symname (format, name, abfd) - const char *format; - const char *name; - bfd *abfd; +print_symname (const char *format, const char *name, bfd *abfd) { if (do_demangle && *name) { @@ -1100,13 +1080,8 @@ print_symname (format, name, abfd) containing ABFD. */ static void -print_symbols (abfd, dynamic, minisyms, symcount, size, archive_bfd) - bfd *abfd; - boolean dynamic; - PTR minisyms; - long symcount; - unsigned int size; - bfd *archive_bfd; +print_symbols (bfd *abfd, bfd_boolean dynamic, void *minisyms, long symcount, + unsigned int size, bfd *archive_bfd) { asymbol *store; bfd_byte *from, *fromend; @@ -1132,12 +1107,9 @@ print_symbols (abfd, dynamic, minisyms, symcount, size, archive_bfd) /* Print the symbols when sorting by size. */ static void -print_size_symbols (abfd, dynamic, symsizes, symcount, archive_bfd) - bfd *abfd; - boolean dynamic; - struct size_sym *symsizes; - long symcount; - bfd *archive_bfd; +print_size_symbols (bfd *abfd, bfd_boolean dynamic, + struct size_sym *symsizes, long symcount, + bfd *archive_bfd) { asymbol *store; struct size_sym *from, *fromend; @@ -1170,35 +1142,23 @@ print_size_symbols (abfd, dynamic, symsizes, symcount, archive_bfd) /* Print a single symbol. */ static void -print_symbol (abfd, sym, ssize, archive_bfd) - bfd *abfd; - asymbol *sym; - bfd_vma ssize; - bfd *archive_bfd; +print_symbol (bfd *abfd, asymbol *sym, bfd_vma ssize, bfd *archive_bfd) { + symbol_info syminfo; + struct extended_symbol_info info; + PROGRESS (1); (*format->print_symbol_filename) (archive_bfd, abfd); - if (undefined_only) - { - if (bfd_is_und_section (bfd_get_section (sym))) - print_symname ("%s", bfd_asymbol_name (sym), abfd); - } + bfd_get_symbol_info (abfd, sym, &syminfo); + info.sinfo = &syminfo; + info.ssize = ssize; + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) + info.elfinfo = (elf_symbol_type *) sym; else - { - symbol_info syminfo; - struct extended_symbol_info info; - - bfd_get_symbol_info (abfd, sym, &syminfo); - info.sinfo = &syminfo; - info.ssize = ssize; - if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) - info.elfinfo = (elf_symbol_type *) sym; - else - info.elfinfo = NULL; - (*format->print_symbol_info) (&info, abfd); - } + info.elfinfo = NULL; + (*format->print_symbol_info) (&info, abfd); if (line_numbers) { @@ -1267,7 +1227,7 @@ print_symbol (abfd, sym, ssize, archive_bfd) info.relocs = relocs; info.relcount = relcount; info.syms = syms; - bfd_map_over_sections (abfd, get_relocs, (PTR) &info); + bfd_map_over_sections (abfd, get_relocs, (void *) &info); lineno_cache_rel_bfd = abfd; } @@ -1324,16 +1284,14 @@ print_symbol (abfd, sym, ssize, archive_bfd) /* Print the name of an object file given on the command line. */ static void -print_object_filename_bsd (filename) - char *filename; +print_object_filename_bsd (char *filename) { if (filename_per_file && !filename_per_symbol) printf ("\n%s:\n", filename); } static void -print_object_filename_sysv (filename) - char *filename; +print_object_filename_sysv (char *filename) { if (undefined_only) printf (_("\n\nUndefined symbols from %s:\n\n"), filename); @@ -1348,8 +1306,7 @@ Name Value Class Type Size } static void -print_object_filename_posix (filename) - char *filename; +print_object_filename_posix (char *filename) { if (filename_per_file && !filename_per_symbol) printf ("%s:\n", filename); @@ -1358,40 +1315,34 @@ print_object_filename_posix (filename) /* Print the name of an archive file given on the command line. */ static void -print_archive_filename_bsd (filename) - char *filename; +print_archive_filename_bsd (char *filename) { if (filename_per_file) printf ("\n%s:\n", filename); } static void -print_archive_filename_sysv (filename) - char *filename ATTRIBUTE_UNUSED; +print_archive_filename_sysv (char *filename ATTRIBUTE_UNUSED) { } static void -print_archive_filename_posix (filename) - char *filename ATTRIBUTE_UNUSED; +print_archive_filename_posix (char *filename ATTRIBUTE_UNUSED) { } /* Print the name of an archive member file. */ static void -print_archive_member_bsd (archive, filename) - char *archive ATTRIBUTE_UNUSED; - const char *filename; +print_archive_member_bsd (char *archive ATTRIBUTE_UNUSED, + const char *filename) { if (!filename_per_symbol) printf ("\n%s:\n", filename); } static void -print_archive_member_sysv (archive, filename) - char *archive; - const char *filename; +print_archive_member_sysv (char *archive, const char *filename) { if (undefined_only) printf (_("\n\nUndefined symbols from %s[%s]:\n\n"), archive, filename); @@ -1406,9 +1357,7 @@ Name Value Class Type Size } static void -print_archive_member_posix (archive, filename) - char *archive; - const char *filename; +print_archive_member_posix (char *archive, const char *filename) { if (!filename_per_symbol) printf ("%s[%s]:\n", archive, filename); @@ -1418,8 +1367,7 @@ print_archive_member_posix (archive, filename) containing a symbol. */ static void -print_symbol_filename_bsd (archive_bfd, abfd) - bfd *archive_bfd, *abfd; +print_symbol_filename_bsd (bfd *archive_bfd, bfd *abfd) { if (filename_per_symbol) { @@ -1430,8 +1378,7 @@ print_symbol_filename_bsd (archive_bfd, abfd) } static void -print_symbol_filename_sysv (archive_bfd, abfd) - bfd *archive_bfd, *abfd; +print_symbol_filename_sysv (bfd *archive_bfd, bfd *abfd) { if (filename_per_symbol) { @@ -1442,8 +1389,7 @@ print_symbol_filename_sysv (archive_bfd, abfd) } static void -print_symbol_filename_posix (archive_bfd, abfd) - bfd *archive_bfd, *abfd; +print_symbol_filename_posix (bfd *archive_bfd, bfd *abfd) { if (filename_per_symbol) { @@ -1458,9 +1404,7 @@ print_symbol_filename_posix (archive_bfd, abfd) /* Print a symbol value. */ static void -print_value (abfd, val) - bfd *abfd ATTRIBUTE_UNUSED; - bfd_vma val; +print_value (bfd *abfd ATTRIBUTE_UNUSED, bfd_vma val) { #if ! defined (BFD64) || BFD_HOST_64BIT_LONG printf (value_format, val); @@ -1490,9 +1434,7 @@ print_value (abfd, val) /* Print a line of information about a symbol. */ static void -print_symbol_info_bsd (info, abfd) - struct extended_symbol_info *info; - bfd *abfd; +print_symbol_info_bsd (struct extended_symbol_info *info, bfd *abfd) { if (bfd_is_undefined_symclass (SYM_TYPE (info))) { @@ -1502,11 +1444,18 @@ print_symbol_info_bsd (info, abfd) } else { - print_value (abfd, SYM_VALUE (info)); + /* Normally we print the value of the symbol. If we are printing the + size or sorting by size then we print its size, except for the + (weird) special case where both flags are defined, in which case we + print both values. This conforms to documented behaviour. */ + if (sort_by_size && !print_size) + print_value (abfd, SYM_SIZE (info)); + else + print_value (abfd, SYM_VALUE (info)); if (print_size && SYM_SIZE (info)) { - printf(" "); + printf (" "); print_value (abfd, SYM_SIZE (info)); } } @@ -1526,9 +1475,7 @@ print_symbol_info_bsd (info, abfd) } static void -print_symbol_info_sysv (info, abfd) - struct extended_symbol_info *info; - bfd *abfd; +print_symbol_info_sysv (struct extended_symbol_info *info, bfd *abfd) { print_symname ("%-20s|", SYM_NAME (info), abfd); @@ -1547,9 +1494,9 @@ print_symbol_info_sysv (info, abfd) if (SYM_TYPE (info) == '-') { /* A stab. */ - printf ("%18s| ", SYM_STAB_NAME (info)); /* (C) Type */ - printf (desc_format, SYM_STAB_DESC (info)); /* Size */ - printf ("| |"); /* Line, Section */ + printf ("%18s| ", SYM_STAB_NAME (info)); /* (C) Type. */ + printf (desc_format, SYM_STAB_DESC (info)); /* Size. */ + printf ("| |"); /* Line, Section. */ } else { @@ -1578,9 +1525,7 @@ print_symbol_info_sysv (info, abfd) } static void -print_symbol_info_posix (info, abfd) - struct extended_symbol_info *info; - bfd *abfd; +print_symbol_info_posix (struct extended_symbol_info *info, bfd *abfd) { print_symname ("%s ", SYM_NAME (info), abfd); printf ("%c ", SYM_TYPE (info)); @@ -1597,12 +1542,11 @@ print_symbol_info_posix (info, abfd) } static void -print_symdef_entry (abfd) - bfd *abfd; +print_symdef_entry (bfd *abfd) { symindex idx = BFD_NO_MORE_SYMBOLS; carsym *thesym; - boolean everprinted = false; + bfd_boolean everprinted = FALSE; for (idx = bfd_get_next_mapent (abfd, idx, &thesym); idx != BFD_NO_MORE_SYMBOLS; @@ -1612,7 +1556,7 @@ print_symdef_entry (abfd) if (!everprinted) { printf (_("\nArchive index:\n")); - everprinted = true; + everprinted = TRUE; } elt = bfd_get_elt_at_index (abfd, idx); if (elt == NULL) @@ -1629,10 +1573,7 @@ print_symdef_entry (abfd) It is called via bfd_map_over_sections. */ static void -get_relocs (abfd, sec, dataarg) - bfd *abfd; - asection *sec; - PTR dataarg; +get_relocs (bfd *abfd, asection *sec, void *dataarg) { struct get_relocs_info *data = (struct get_relocs_info *) dataarg; diff --git a/contrib/binutils/binutils/objcopy.c b/contrib/binutils/binutils/objcopy.c index 241a2c6..9623398 100644 --- a/contrib/binutils/binutils/objcopy.c +++ b/contrib/binutils/binutils/objcopy.c @@ -1,6 +1,6 @@ /* objcopy.c -- copy object file from input to output, optionally massaging it. Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 + 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -27,6 +27,8 @@ #include "libiberty.h" #include "budbg.h" #include "filenames.h" +#include "fnmatch.h" +#include "elf-bfd.h" #include /* A list of symbols to explicitly strip out, or to keep. A linked @@ -58,56 +60,29 @@ typedef struct section_rename section_rename; /* List of sections to be renamed. */ -static section_rename * section_rename_list; - -static void copy_usage PARAMS ((FILE *, int)); -static void strip_usage PARAMS ((FILE *, int)); -static flagword parse_flags PARAMS ((const char *)); -static struct section_list *find_section_list PARAMS ((const char *, boolean)); -static void setup_section PARAMS ((bfd *, asection *, PTR)); -static void copy_section PARAMS ((bfd *, asection *, PTR)); -static void get_sections PARAMS ((bfd *, asection *, PTR)); -static int compare_section_lma PARAMS ((const PTR, const PTR)); -static void add_specific_symbol PARAMS ((const char *, struct symlist **)); -static void add_specific_symbols PARAMS ((const char *, struct symlist **)); -static boolean is_specified_symbol PARAMS ((const char *, struct symlist *)); -static boolean is_strip_section PARAMS ((bfd *, asection *)); -static unsigned int filter_symbols - PARAMS ((bfd *, bfd *, asymbol **, asymbol **, long)); -static void mark_symbols_used_in_relocations PARAMS ((bfd *, asection *, PTR)); -static void filter_bytes PARAMS ((char *, bfd_size_type *)); -static boolean write_debugging_info PARAMS ((bfd *, PTR, long *, asymbol ***)); -static void copy_object PARAMS ((bfd *, bfd *)); -static void copy_archive PARAMS ((bfd *, bfd *, const char *)); -static void copy_file - PARAMS ((const char *, const char *, const char *, const char *)); -static int strip_main PARAMS ((int, char **)); -static int copy_main PARAMS ((int, char **)); -static const char *lookup_sym_redefinition PARAMS((const char *)); -static void redefine_list_append PARAMS ((const char *, const char *)); -static const char * find_section_rename PARAMS ((bfd *, sec_ptr, flagword *)); -static void add_section_rename PARAMS ((const char *, const char *, flagword)); +static section_rename *section_rename_list; #define RETURN_NONFATAL(s) {bfd_nonfatal (s); status = 1; return;} -static asymbol **isympp = NULL; /* Input symbols */ -static asymbol **osympp = NULL; /* Output symbols that survive stripping */ +static asymbol **isympp = NULL; /* Input symbols. */ +static asymbol **osympp = NULL; /* Output symbols that survive stripping. */ /* If `copy_byte' >= 0, copy only that byte of every `interleave' bytes. */ static int copy_byte = -1; static int interleave = 4; -static boolean verbose; /* Print file and target names. */ -static boolean preserve_dates; /* Preserve input file timestamp. */ +static bfd_boolean verbose; /* Print file and target names. */ +static bfd_boolean preserve_dates; /* Preserve input file timestamp. */ static int status = 0; /* Exit status. */ enum strip_action { STRIP_UNDEF, - STRIP_NONE, /* don't strip */ - STRIP_DEBUG, /* strip all debugger symbols */ - STRIP_UNNEEDED, /* strip unnecessary symbols */ - STRIP_ALL /* strip all symbols */ + STRIP_NONE, /* Don't strip. */ + STRIP_DEBUG, /* Strip all debugger symbols. */ + STRIP_UNNEEDED, /* Strip unnecessary symbols. */ + STRIP_NONDEBUG, /* Strip everything but debug info. */ + STRIP_ALL /* Strip all symbols. */ }; /* Which symbols to remove. */ @@ -116,8 +91,8 @@ static enum strip_action strip_symbols; enum locals_action { LOCALS_UNDEF, - LOCALS_START_L, /* discard locals starting with L */ - LOCALS_ALL /* discard all locals */ + LOCALS_START_L, /* Discard locals starting with L. */ + LOCALS_ALL /* Discard all locals. */ }; /* Which local symbols to remove. Overrides STRIP_ALL. */ @@ -134,46 +109,50 @@ enum change_action /* Structure used to hold lists of sections and actions to take. */ struct section_list { - struct section_list * next; /* Next section to change. */ - const char * name; /* Section name. */ - boolean used; /* Whether this entry was used. */ - boolean remove; /* Whether to remove this section. */ - boolean copy; /* Whether to copy this section. */ - enum change_action change_vma;/* Whether to change or set VMA. */ - bfd_vma vma_val; /* Amount to change by or set to. */ - enum change_action change_lma;/* Whether to change or set LMA. */ - bfd_vma lma_val; /* Amount to change by or set to. */ - boolean set_flags; /* Whether to set the section flags. */ - flagword flags; /* What to set the section flags to. */ + struct section_list * next; /* Next section to change. */ + const char * name; /* Section name. */ + bfd_boolean used; /* Whether this entry was used. */ + bfd_boolean remove; /* Whether to remove this section. */ + bfd_boolean copy; /* Whether to copy this section. */ + enum change_action change_vma;/* Whether to change or set VMA. */ + bfd_vma vma_val; /* Amount to change by or set to. */ + enum change_action change_lma;/* Whether to change or set LMA. */ + bfd_vma lma_val; /* Amount to change by or set to. */ + bfd_boolean set_flags; /* Whether to set the section flags. */ + flagword flags; /* What to set the section flags to. */ }; static struct section_list *change_sections; -/* True if some sections are to be removed. */ -static boolean sections_removed; +/* TRUE if some sections are to be removed. */ +static bfd_boolean sections_removed; -/* True if only some sections are to be copied. */ -static boolean sections_copied; +/* TRUE if only some sections are to be copied. */ +static bfd_boolean sections_copied; /* Changes to the start address. */ static bfd_vma change_start = 0; -static boolean set_start_set = false; +static bfd_boolean set_start_set = FALSE; static bfd_vma set_start; /* Changes to section addresses. */ static bfd_vma change_section_address = 0; /* Filling gaps between sections. */ -static boolean gap_fill_set = false; +static bfd_boolean gap_fill_set = FALSE; static bfd_byte gap_fill = 0; /* Pad to a given address. */ -static boolean pad_to_set = false; +static bfd_boolean pad_to_set = FALSE; static bfd_vma pad_to; /* Use alternate machine code? */ static int use_alt_mach_code = 0; +/* Output BFD flags user wants to set or clear */ +static flagword bfd_flags_to_set; +static flagword bfd_flags_to_clear; + /* List of sections to add. */ struct section_add { @@ -194,14 +173,21 @@ struct section_add /* List of sections to add to the output BFD. */ static struct section_add *add_sections; +/* If non-NULL the argument to --add-gnu-debuglink. + This should be the filename to store in the .gnu_debuglink section. */ +static const char * gnu_debuglink_filename = NULL; + /* Whether to convert debugging information. */ -static boolean convert_debugging = false; +static bfd_boolean convert_debugging = FALSE; /* Whether to change the leading character in symbol names. */ -static boolean change_leading_char = false; +static bfd_boolean change_leading_char = FALSE; /* Whether to remove the leading character from global symbol names. */ -static boolean remove_leading_char = false; +static bfd_boolean remove_leading_char = FALSE; + +/* Whether to permit wildcard in symbol comparison. */ +static bfd_boolean wildcard = FALSE; /* List of symbols to strip, keep, localize, keep-global, weaken, or redefine. */ @@ -212,38 +198,56 @@ static struct symlist *keepglobal_specific_list = NULL; static struct symlist *weaken_specific_list = NULL; static struct redefine_node *redefine_sym_list = NULL; -/* If this is true, we weaken global symbols (set BSF_WEAK). */ -static boolean weaken = false; +/* If this is TRUE, we weaken global symbols (set BSF_WEAK). */ +static bfd_boolean weaken = FALSE; -/* 150 isn't special; it's just an arbitrary non-ASCII char value. */ +/* Prefix symbols/sections. */ +static char *prefix_symbols_string = 0; +static char *prefix_sections_string = 0; +static char *prefix_alloc_sections_string = 0; -#define OPTION_ADD_SECTION 150 -#define OPTION_CHANGE_ADDRESSES (OPTION_ADD_SECTION + 1) -#define OPTION_CHANGE_LEADING_CHAR (OPTION_CHANGE_ADDRESSES + 1) -#define OPTION_CHANGE_START (OPTION_CHANGE_LEADING_CHAR + 1) -#define OPTION_CHANGE_SECTION_ADDRESS (OPTION_CHANGE_START + 1) -#define OPTION_CHANGE_SECTION_LMA (OPTION_CHANGE_SECTION_ADDRESS + 1) -#define OPTION_CHANGE_SECTION_VMA (OPTION_CHANGE_SECTION_LMA + 1) -#define OPTION_CHANGE_WARNINGS (OPTION_CHANGE_SECTION_VMA + 1) -#define OPTION_DEBUGGING (OPTION_CHANGE_WARNINGS + 1) -#define OPTION_GAP_FILL (OPTION_DEBUGGING + 1) -#define OPTION_NO_CHANGE_WARNINGS (OPTION_GAP_FILL + 1) -#define OPTION_PAD_TO (OPTION_NO_CHANGE_WARNINGS + 1) -#define OPTION_REMOVE_LEADING_CHAR (OPTION_PAD_TO + 1) -#define OPTION_SET_SECTION_FLAGS (OPTION_REMOVE_LEADING_CHAR + 1) -#define OPTION_SET_START (OPTION_SET_SECTION_FLAGS + 1) -#define OPTION_STRIP_UNNEEDED (OPTION_SET_START + 1) -#define OPTION_WEAKEN (OPTION_STRIP_UNNEEDED + 1) -#define OPTION_REDEFINE_SYM (OPTION_WEAKEN + 1) -#define OPTION_SREC_LEN (OPTION_REDEFINE_SYM + 1) -#define OPTION_SREC_FORCES3 (OPTION_SREC_LEN + 1) -#define OPTION_STRIP_SYMBOLS (OPTION_SREC_FORCES3 + 1) -#define OPTION_KEEP_SYMBOLS (OPTION_STRIP_SYMBOLS + 1) -#define OPTION_LOCALIZE_SYMBOLS (OPTION_KEEP_SYMBOLS + 1) -#define OPTION_KEEPGLOBAL_SYMBOLS (OPTION_LOCALIZE_SYMBOLS + 1) -#define OPTION_WEAKEN_SYMBOLS (OPTION_KEEPGLOBAL_SYMBOLS + 1) -#define OPTION_RENAME_SECTION (OPTION_WEAKEN_SYMBOLS + 1) -#define OPTION_ALT_MACH_CODE (OPTION_RENAME_SECTION + 1) +/* 150 isn't special; it's just an arbitrary non-ASCII char value. */ +enum command_line_switch + { + OPTION_ADD_SECTION=150, + OPTION_CHANGE_ADDRESSES, + OPTION_CHANGE_LEADING_CHAR, + OPTION_CHANGE_START, + OPTION_CHANGE_SECTION_ADDRESS, + OPTION_CHANGE_SECTION_LMA, + OPTION_CHANGE_SECTION_VMA, + OPTION_CHANGE_WARNINGS, + OPTION_DEBUGGING, + OPTION_GAP_FILL, + OPTION_NO_CHANGE_WARNINGS, + OPTION_PAD_TO, + OPTION_REMOVE_LEADING_CHAR, + OPTION_SET_SECTION_FLAGS, + OPTION_SET_START, + OPTION_STRIP_UNNEEDED, + OPTION_WEAKEN, + OPTION_REDEFINE_SYM, + OPTION_REDEFINE_SYMS, + OPTION_SREC_LEN, + OPTION_SREC_FORCES3, + OPTION_STRIP_SYMBOLS, + OPTION_KEEP_SYMBOLS, + OPTION_LOCALIZE_SYMBOLS, + OPTION_KEEPGLOBAL_SYMBOLS, + OPTION_WEAKEN_SYMBOLS, + OPTION_RENAME_SECTION, + OPTION_ALT_MACH_CODE, + OPTION_PREFIX_SYMBOLS, + OPTION_PREFIX_SECTIONS, + OPTION_PREFIX_ALLOC_SECTIONS, + OPTION_FORMATS_INFO, + OPTION_ADD_GNU_DEBUGLINK, + OPTION_ONLY_KEEP_DEBUG, + OPTION_READONLY_TEXT, + OPTION_WRITABLE_TEXT, + OPTION_PURE, + OPTION_IMPURE + }; /* Options to handle if running as "strip". */ @@ -253,9 +257,11 @@ static struct option strip_options[] = {"discard-locals", no_argument, 0, 'X'}, {"format", required_argument, 0, 'F'}, /* Obsolete */ {"help", no_argument, 0, 'h'}, + {"info", no_argument, 0, OPTION_FORMATS_INFO}, {"input-format", required_argument, 0, 'I'}, /* Obsolete */ {"input-target", required_argument, 0, 'I'}, {"keep-symbol", required_argument, 0, 'K'}, + {"only-keep-debug", no_argument, 0, OPTION_ONLY_KEEP_DEBUG}, {"output-format", required_argument, 0, 'O'}, /* Obsolete */ {"output-target", required_argument, 0, 'O'}, {"output-file", required_argument, 0, 'o'}, @@ -268,6 +274,7 @@ static struct option strip_options[] = {"target", required_argument, 0, 'F'}, {"verbose", no_argument, 0, 'v'}, {"version", no_argument, 0, 'V'}, + {"wildcard", no_argument, 0, 'w'}, {0, no_argument, 0, 0} }; @@ -275,11 +282,13 @@ static struct option strip_options[] = static struct option copy_options[] = { + {"add-gnu-debuglink", required_argument, 0, OPTION_ADD_GNU_DEBUGLINK}, {"add-section", required_argument, 0, OPTION_ADD_SECTION}, {"adjust-start", required_argument, 0, OPTION_CHANGE_START}, {"adjust-vma", required_argument, 0, OPTION_CHANGE_ADDRESSES}, {"adjust-section-vma", required_argument, 0, OPTION_CHANGE_SECTION_ADDRESS}, {"adjust-warnings", no_argument, 0, OPTION_CHANGE_WARNINGS}, + {"alt-machine-code", required_argument, 0, OPTION_ALT_MACH_CODE}, {"binary-architecture", required_argument, 0, 'B'}, {"byte", required_argument, 0, 'b'}, {"change-addresses", required_argument, 0, OPTION_CHANGE_ADDRESSES}, @@ -292,45 +301,55 @@ static struct option copy_options[] = {"debugging", no_argument, 0, OPTION_DEBUGGING}, {"discard-all", no_argument, 0, 'x'}, {"discard-locals", no_argument, 0, 'X'}, - {"only-section", required_argument, 0, 'j'}, {"format", required_argument, 0, 'F'}, /* Obsolete */ {"gap-fill", required_argument, 0, OPTION_GAP_FILL}, {"help", no_argument, 0, 'h'}, + {"impure", no_argument, 0, OPTION_IMPURE}, + {"info", no_argument, 0, OPTION_FORMATS_INFO}, {"input-format", required_argument, 0, 'I'}, /* Obsolete */ {"input-target", required_argument, 0, 'I'}, {"interleave", required_argument, 0, 'i'}, + {"keep-global-symbol", required_argument, 0, 'G'}, + {"keep-global-symbols", required_argument, 0, OPTION_KEEPGLOBAL_SYMBOLS}, {"keep-symbol", required_argument, 0, 'K'}, + {"keep-symbols", required_argument, 0, OPTION_KEEP_SYMBOLS}, + {"localize-symbol", required_argument, 0, 'L'}, + {"localize-symbols", required_argument, 0, OPTION_LOCALIZE_SYMBOLS}, {"no-adjust-warnings", no_argument, 0, OPTION_NO_CHANGE_WARNINGS}, {"no-change-warnings", no_argument, 0, OPTION_NO_CHANGE_WARNINGS}, + {"only-keep-debug", no_argument, 0, OPTION_ONLY_KEEP_DEBUG}, + {"only-section", required_argument, 0, 'j'}, {"output-format", required_argument, 0, 'O'}, /* Obsolete */ {"output-target", required_argument, 0, 'O'}, {"pad-to", required_argument, 0, OPTION_PAD_TO}, + {"prefix-symbols", required_argument, 0, OPTION_PREFIX_SYMBOLS}, + {"prefix-sections", required_argument, 0, OPTION_PREFIX_SECTIONS}, + {"prefix-alloc-sections", required_argument, 0, OPTION_PREFIX_ALLOC_SECTIONS}, {"preserve-dates", no_argument, 0, 'p'}, - {"localize-symbol", required_argument, 0, 'L'}, - {"keep-global-symbol", required_argument, 0, 'G'}, + {"pure", no_argument, 0, OPTION_PURE}, + {"readonly-text", no_argument, 0, OPTION_READONLY_TEXT}, + {"redefine-sym", required_argument, 0, OPTION_REDEFINE_SYM}, + {"redefine-syms", required_argument, 0, OPTION_REDEFINE_SYMS}, {"remove-leading-char", no_argument, 0, OPTION_REMOVE_LEADING_CHAR}, {"remove-section", required_argument, 0, 'R'}, {"rename-section", required_argument, 0, OPTION_RENAME_SECTION}, {"set-section-flags", required_argument, 0, OPTION_SET_SECTION_FLAGS}, {"set-start", required_argument, 0, OPTION_SET_START}, + {"srec-len", required_argument, 0, OPTION_SREC_LEN}, + {"srec-forceS3", no_argument, 0, OPTION_SREC_FORCES3}, {"strip-all", no_argument, 0, 'S'}, {"strip-debug", no_argument, 0, 'g'}, {"strip-unneeded", no_argument, 0, OPTION_STRIP_UNNEEDED}, {"strip-symbol", required_argument, 0, 'N'}, + {"strip-symbols", required_argument, 0, OPTION_STRIP_SYMBOLS}, {"target", required_argument, 0, 'F'}, {"verbose", no_argument, 0, 'v'}, {"version", no_argument, 0, 'V'}, {"weaken", no_argument, 0, OPTION_WEAKEN}, {"weaken-symbol", required_argument, 0, 'W'}, - {"redefine-sym", required_argument, 0, OPTION_REDEFINE_SYM}, - {"srec-len", required_argument, 0, OPTION_SREC_LEN}, - {"srec-forceS3", no_argument, 0, OPTION_SREC_FORCES3}, - {"keep-symbols", required_argument, 0, OPTION_KEEP_SYMBOLS}, - {"strip-symbols", required_argument, 0, OPTION_STRIP_SYMBOLS}, - {"keep-global-symbols", required_argument, 0, OPTION_KEEPGLOBAL_SYMBOLS}, - {"localize-symbols", required_argument, 0, OPTION_LOCALIZE_SYMBOLS}, {"weaken-symbols", required_argument, 0, OPTION_WEAKEN_SYMBOLS}, - {"alt-machine-code", required_argument, 0, OPTION_ALT_MACH_CODE}, + {"wildcard", no_argument, 0, 'w'}, + {"writable-text", no_argument, 0, OPTION_WRITABLE_TEXT}, {0, no_argument, 0, 0} }; @@ -349,16 +368,24 @@ extern unsigned int Chunk; /* Restrict the generation of Srecords to type S3 only. This variable is declare in bfd/srec.c and can be toggled on by the --srec-forceS3 command line switch. */ -extern boolean S3Forced; - -/* Defined in bfd/binary.c. Used to set architecture of input binary files. */ -extern enum bfd_architecture bfd_external_binary_architecture; - +extern bfd_boolean S3Forced; + +/* Defined in bfd/binary.c. Used to set architecture and machine of input + binary files. */ +extern enum bfd_architecture bfd_external_binary_architecture; +extern unsigned long bfd_external_machine; + +/* Forward declarations. */ +static void setup_section (bfd *, asection *, void *); +static void copy_section (bfd *, asection *, void *); +static void get_sections (bfd *, asection *, void *); +static int compare_section_lma (const void *, const void *); +static void mark_symbols_used_in_relocations (bfd *, asection *, void *); +static bfd_boolean write_debugging_info (bfd *, void *, long *, asymbol ***); +static const char *lookup_sym_redefinition (const char *); static void -copy_usage (stream, exit_status) - FILE *stream; - int exit_status; +copy_usage (FILE *stream, int exit_status) { fprintf (stream, _("Usage: %s [option(s)] in-file [out-file]\n"), program_name); fprintf (stream, _(" Copies a binary file, possibly transforming it in the process\n")); @@ -371,16 +398,19 @@ copy_usage (stream, exit_status) --debugging Convert debugging information, if possible\n\ -p --preserve-dates Copy modified/access timestamps to the output\n\ -j --only-section Only copy section into the output\n\ + --add-gnu-debuglink= Add section .gnu_debuglink linking to \n\ -R --remove-section Remove section from the output\n\ -S --strip-all Remove all symbol and relocation information\n\ - -g --strip-debug Remove all debugging symbols\n\ + -g --strip-debug Remove all debugging symbols & sections\n\ --strip-unneeded Remove all symbols not needed by relocations\n\ -N --strip-symbol Do not copy symbol \n\ + --only-keep-debug Strip everything but the debug information\n\ -K --keep-symbol Only copy symbol \n\ -L --localize-symbol Force symbol to be marked as a local\n\ -G --keep-global-symbol Localize all symbols except \n\ -W --weaken-symbol Force symbol to be marked as a weak\n\ --weaken Force all global symbols to be marked as weak\n\ + -w --wildcard Permit wildcard in symbol comparasion\n\ -x --discard-all Remove all non-global symbols\n\ -X --discard-locals Remove any compiler-generated symbols\n\ -i --interleave Only copy one out of every bytes\n\ @@ -407,6 +437,8 @@ copy_usage (stream, exit_status) --change-leading-char Force output format's leading character style\n\ --remove-leading-char Remove leading character from global symbols\n\ --redefine-sym = Redefine symbol name to \n\ + --redefine-syms --redefine-sym for all symbol pairs \n\ + listed in \n\ --srec-len Restrict the length of generated Srecords\n\ --srec-forceS3 Restrict the type of generated Srecords to S3\n\ --strip-symbols -N for all symbols listed in \n\ @@ -415,9 +447,19 @@ copy_usage (stream, exit_status) --keep-global-symbols -G for all symbols listed in \n\ --weaken-symbols -W for all symbols listed in \n\ --alt-machine-code Use alternate machine code for output\n\ + --writable-text Mark the output text as writable\n\ + --readonly-text Make the output text write protected\n\ + --pure Mark the output file as demand paged\n\ + --impure Mark the output file as impure\n\ + --prefix-symbols Add to start of every symbol name\n\ + --prefix-sections Add to start of every section name\n\ + --prefix-alloc-sections \n\ + Add to start of every allocatable\n\ + section name\n\ -v --verbose List all object files modified\n\ -V --version Display this program's version number\n\ -h --help Display this output\n\ + --info List object formats & architectures supported\n\ ")); list_supported_targets (program_name, stream); if (exit_status == 0) @@ -426,9 +468,7 @@ copy_usage (stream, exit_status) } static void -strip_usage (stream, exit_status) - FILE *stream; - int exit_status; +strip_usage (FILE *stream, int exit_status) { fprintf (stream, _("Usage: %s in-file(s)\n"), program_name); fprintf (stream, _(" Removes symbols and sections from files\n")); @@ -440,15 +480,18 @@ strip_usage (stream, exit_status) -p --preserve-dates Copy modified/access timestamps to the output\n\ -R --remove-section= Remove section from the output\n\ -s --strip-all Remove all symbol and relocation information\n\ - -g -S -d --strip-debug Remove all debugging symbols\n\ + -g -S -d --strip-debug Remove all debugging symbols & sections\n\ --strip-unneeded Remove all symbols not needed by relocations\n\ + --only-keep-debug Strip everything but the debug information\n\ -N --strip-symbol= Do not copy symbol \n\ -K --keep-symbol= Only copy symbol \n\ + -w --wildcard Permit wildcard in symbol comparasion\n\ -x --discard-all Remove all non-global symbols\n\ -X --discard-locals Remove any compiler-generated symbols\n\ -v --verbose List all object files modified\n\ -V --version Display this program's version number\n\ -h --help Display this output\n\ + --info List object formats & architectures supported\n\ -o Place stripped output into \n\ ")); @@ -462,8 +505,7 @@ strip_usage (stream, exit_status) string can't be parsed. */ static flagword -parse_flags (s) - const char *s; +parse_flags (const char *s) { flagword ret; const char *snext; @@ -518,11 +560,9 @@ parse_flags (s) /* Find and optionally add an entry in the change_sections list. */ static struct section_list * -find_section_list (name, add) - const char *name; - boolean add; +find_section_list (const char *name, bfd_boolean add) { - register struct section_list *p; + struct section_list *p; for (p = change_sections; p != NULL; p = p->next) if (strcmp (p->name, name) == 0) @@ -531,16 +571,16 @@ find_section_list (name, add) if (! add) return NULL; - p = (struct section_list *) xmalloc (sizeof (struct section_list)); + p = xmalloc (sizeof (struct section_list)); p->name = name; - p->used = false; - p->remove = false; - p->copy = false; + p->used = FALSE; + p->remove = FALSE; + p->copy = FALSE; p->change_vma = CHANGE_IGNORE; p->change_lma = CHANGE_IGNORE; p->vma_val = 0; p->lma_val = 0; - p->set_flags = false; + p->set_flags = FALSE; p->flags = 0; p->next = change_sections; @@ -552,13 +592,11 @@ find_section_list (name, add) /* Add a symbol to strip_specific_list. */ static void -add_specific_symbol (name, list) - const char *name; - struct symlist **list; +add_specific_symbol (const char *name, struct symlist **list) { struct symlist *tmp_list; - tmp_list = (struct symlist *) xmalloc (sizeof (struct symlist)); + tmp_list = xmalloc (sizeof (struct symlist)); tmp_list->name = name; tmp_list->next = *list; *list = tmp_list; @@ -570,32 +608,29 @@ add_specific_symbol (name, list) #define IS_LINE_TERMINATOR(c) ((c) == '\n' || (c) == '\r' || (c) == '\0') static void -add_specific_symbols (filename, list) - const char *filename; - struct symlist **list; +add_specific_symbols (const char *filename, struct symlist **list) { - struct stat st; + off_t size; FILE * f; char * line; char * buffer; unsigned int line_count; - if (stat (filename, & st) < 0) - fatal (_("cannot stat: %s: %s"), filename, strerror (errno)); - if (st.st_size == 0) + size = get_file_size (filename); + if (size == 0) return; - buffer = (char *) xmalloc (st.st_size + 2); + buffer = xmalloc (size + 2); f = fopen (filename, FOPEN_RT); if (f == NULL) - fatal (_("cannot open: %s: %s"), filename, strerror (errno)); + fatal (_("cannot open '%s': %s"), filename, strerror (errno)); - if (fread (buffer, 1, st.st_size, f) == 0 || ferror (f)) + if (fread (buffer, 1, size, f) == 0 || ferror (f)) fatal (_("%s: fread failed"), filename); fclose (f); - buffer [st.st_size] = '\n'; - buffer [st.st_size + 1] = '\0'; + buffer [size] = '\n'; + buffer [size + 1] = '\0'; line_count = 1; @@ -604,7 +639,7 @@ add_specific_symbols (filename, list) char * eol; char * name; char * name_end; - int finished = false; + int finished = FALSE; for (eol = line;; eol ++) { @@ -615,7 +650,7 @@ add_specific_symbols (filename, list) /* Cope with \n\r. */ if (eol[1] == '\r') ++ eol; - finished = true; + finished = TRUE; break; case '\r': @@ -623,11 +658,11 @@ add_specific_symbols (filename, list) /* Cope with \r\n. */ if (eol[1] == '\n') ++ eol; - finished = true; + finished = TRUE; break; case 0: - finished = true; + finished = TRUE; break; case '#': @@ -683,46 +718,66 @@ add_specific_symbols (filename, list) /* See whether a symbol should be stripped or kept based on strip_specific_list and keep_symbols. */ -static boolean -is_specified_symbol (name, list) - const char *name; - struct symlist *list; +static bfd_boolean +is_specified_symbol (const char *name, struct symlist *list) { struct symlist *tmp_list; - for (tmp_list = list; tmp_list; tmp_list = tmp_list->next) - if (strcmp (name, tmp_list->name) == 0) - return true; + if (wildcard) + { + for (tmp_list = list; tmp_list; tmp_list = tmp_list->next) + if (*(tmp_list->name) != '!') + { + if (!fnmatch (tmp_list->name, name, 0)) + return TRUE; + } + else + { + if (fnmatch (tmp_list->name + 1, name, 0)) + return TRUE; + } + } + else + { + for (tmp_list = list; tmp_list; tmp_list = tmp_list->next) + if (strcmp (name, tmp_list->name) == 0) + return TRUE; + } - return false; + return FALSE; } /* See if a section is being removed. */ -static boolean -is_strip_section (abfd, sec) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec; +static bfd_boolean +is_strip_section (bfd *abfd ATTRIBUTE_UNUSED, asection *sec) { - struct section_list *p; + if (sections_removed || sections_copied) + { + struct section_list *p; + + p = find_section_list (bfd_get_section_name (abfd, sec), FALSE); - if ((bfd_get_section_flags (abfd, sec) & SEC_DEBUGGING) != 0 - && (strip_symbols == STRIP_DEBUG + if (sections_removed && p != NULL && p->remove) + return TRUE; + if (sections_copied && (p == NULL || ! p->copy)) + return TRUE; + } + + if ((bfd_get_section_flags (abfd, sec) & SEC_DEBUGGING) != 0) + { + if (strip_symbols == STRIP_DEBUG || strip_symbols == STRIP_UNNEEDED || strip_symbols == STRIP_ALL || discard_locals == LOCALS_ALL - || convert_debugging)) - return true; - - if (! sections_removed && ! sections_copied) - return false; - - p = find_section_list (bfd_get_section_name (abfd, sec), false); - if (sections_removed && p != NULL && p->remove) - return true; - if (sections_copied && (p == NULL || ! p->copy)) - return true; - return false; + || convert_debugging) + return TRUE; + + if (strip_symbols == STRIP_NONDEBUG) + return FALSE; + } + + return FALSE; } /* Choose which symbol entries to copy; put the result in OSYMS. @@ -730,13 +785,10 @@ is_strip_section (abfd, sec) Return the number of symbols to print. */ static unsigned int -filter_symbols (abfd, obfd, osyms, isyms, symcount) - bfd *abfd; - bfd *obfd; - asymbol **osyms, **isyms; - long symcount; +filter_symbols (bfd *abfd, bfd *obfd, asymbol **osyms, + asymbol **isyms, long symcount) { - register asymbol **from = isyms, **to = osyms; + asymbol **from = isyms, **to = osyms; long src_count = 0, dst_count = 0; int relocatable = (abfd->flags & (HAS_RELOC | EXEC_P | DYNAMIC)) == HAS_RELOC; @@ -745,51 +797,74 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount) { asymbol *sym = from[src_count]; flagword flags = sym->flags; - const char *name = bfd_asymbol_name (sym); + char *name = (char *) bfd_asymbol_name (sym); int keep; - boolean undefined; + bfd_boolean undefined; + bfd_boolean rem_leading_char; + bfd_boolean add_leading_char; + + undefined = bfd_is_und_section (bfd_get_section (sym)); if (redefine_sym_list) { - const char *old_name, *new_name; + char *old_name, *new_name; - old_name = bfd_asymbol_name (sym); - new_name = lookup_sym_redefinition (old_name); - name = bfd_asymbol_name (sym) = new_name; + old_name = (char *) bfd_asymbol_name (sym); + new_name = (char *) lookup_sym_redefinition (old_name); + bfd_asymbol_name (sym) = new_name; + name = new_name; } - if (change_leading_char - && (bfd_get_symbol_leading_char (abfd) - != bfd_get_symbol_leading_char (obfd)) - && (bfd_get_symbol_leading_char (abfd) == '\0' - || (name[0] == bfd_get_symbol_leading_char (abfd)))) - { - if (bfd_get_symbol_leading_char (obfd) == '\0') - name = bfd_asymbol_name (sym) = name + 1; - else - { - char *n; - - n = xmalloc (strlen (name) + 2); - n[0] = bfd_get_symbol_leading_char (obfd); - if (bfd_get_symbol_leading_char (abfd) == '\0') - strcpy (n + 1, name); - else - strcpy (n + 1, name + 1); - name = bfd_asymbol_name (sym) = n; - } + /* Check if we will remove the current leading character. */ + rem_leading_char = + (name[0] == bfd_get_symbol_leading_char (abfd)) + && (change_leading_char + || (remove_leading_char + && ((flags & (BSF_GLOBAL | BSF_WEAK)) != 0 + || undefined + || bfd_is_com_section (bfd_get_section (sym))))); + + /* Check if we will add a new leading character. */ + add_leading_char = + change_leading_char + && (bfd_get_symbol_leading_char (obfd) != '\0') + && (bfd_get_symbol_leading_char (abfd) == '\0' + || (name[0] == bfd_get_symbol_leading_char (abfd))); + + /* Short circuit for change_leading_char if we can do it in-place. */ + if (rem_leading_char && add_leading_char && !prefix_symbols_string) + { + name[0] = bfd_get_symbol_leading_char (obfd); + bfd_asymbol_name (sym) = name; + rem_leading_char = FALSE; + add_leading_char = FALSE; + } + + /* Remove leading char. */ + if (rem_leading_char) + bfd_asymbol_name (sym) = ++name; + + /* Add new leading char and/or prefix. */ + if (add_leading_char || prefix_symbols_string) + { + char *n, *ptr; + + ptr = n = xmalloc (1 + strlen (prefix_symbols_string) + + strlen (name) + 1); + if (add_leading_char) + *ptr++ = bfd_get_symbol_leading_char (obfd); + + if (prefix_symbols_string) + { + strcpy (ptr, prefix_symbols_string); + ptr += strlen (prefix_symbols_string); + } + + strcpy (ptr, name); + bfd_asymbol_name (sym) = n; + name = n; } - undefined = bfd_is_und_section (bfd_get_section (sym)); - - if (remove_leading_char - && ((flags & BSF_GLOBAL) != 0 - || (flags & BSF_WEAK) != 0 - || undefined - || bfd_is_com_section (bfd_get_section (sym))) - && name[0] == bfd_get_symbol_leading_char (abfd)) - name = bfd_asymbol_name (sym) = name + 1; - if (strip_symbols == STRIP_ALL) keep = 0; else if ((flags & BSF_KEEP) != 0 /* Used in relocation. */ @@ -802,7 +877,7 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount) keep = 1; else if (bfd_decode_symclass (sym) == 'I') /* Global symbols in $idata sections need to be retained - even if relocatable is false. External users of the + even if relocatable is FALSE. External users of the library containing the $idata section may reference these symbols. */ keep = 1; @@ -859,8 +934,7 @@ filter_symbols (abfd, obfd, osyms, isyms, symcount) /* Find the redefined name of symbol SOURCE. */ static const char * -lookup_sym_redefinition (source) - const char *source; +lookup_sym_redefinition (const char *source) { struct redefine_node *list; @@ -874,9 +948,7 @@ lookup_sym_redefinition (source) /* Add a node to a symbol redefine list. */ static void -redefine_list_append (source, target) - const char *source; - const char *target; +redefine_list_append (const char *cause, const char *source, const char *target) { struct redefine_node **p; struct redefine_node *list; @@ -886,16 +958,14 @@ redefine_list_append (source, target) { if (strcmp (source, list->source) == 0) fatal (_("%s: Multiple redefinition of symbol \"%s\""), - "--redefine-sym", - source); + cause, source); if (strcmp (target, list->target) == 0) fatal (_("%s: Symbol \"%s\" is target of more than one redefinition"), - "--redefine-sym", - target); + cause, target); } - new_node = (struct redefine_node *) xmalloc (sizeof (struct redefine_node)); + new_node = xmalloc (sizeof (struct redefine_node)); new_node->source = strdup (source); new_node->target = strdup (target); @@ -904,50 +974,144 @@ redefine_list_append (source, target) *p = new_node; } -/* Keep only every `copy_byte'th byte in MEMHUNK, which is *SIZE bytes long. - Adjust *SIZE. */ +/* Handle the --redefine-syms option. Read lines containing "old new" + from the file, and add them to the symbol redefine list. */ static void -filter_bytes (memhunk, size) - char *memhunk; - bfd_size_type *size; +add_redefine_syms_file (const char *filename) { - char *from = memhunk + copy_byte, *to = memhunk, *end = memhunk + *size; + FILE *file; + char *buf; + size_t bufsize; + size_t len; + size_t outsym_off; + int c, lineno; + + file = fopen (filename, "r"); + if (file == NULL) + fatal (_("couldn't open symbol redefinition file %s (error: %s)"), + filename, strerror (errno)); + + bufsize = 100; + buf = xmalloc (bufsize); + + lineno = 1; + c = getc (file); + len = 0; + outsym_off = 0; + while (c != EOF) + { + /* Collect the input symbol name. */ + while (! IS_WHITESPACE (c) && ! IS_LINE_TERMINATOR (c) && c != EOF) + { + if (c == '#') + goto comment; + buf[len++] = c; + if (len >= bufsize) + { + bufsize *= 2; + buf = xrealloc (buf, bufsize); + } + c = getc (file); + } + buf[len++] = '\0'; + if (c == EOF) + break; + + /* Eat white space between the symbol names. */ + while (IS_WHITESPACE (c)) + c = getc (file); + if (c == '#' || IS_LINE_TERMINATOR (c)) + goto comment; + if (c == EOF) + break; + + /* Collect the output symbol name. */ + outsym_off = len; + while (! IS_WHITESPACE (c) && ! IS_LINE_TERMINATOR (c) && c != EOF) + { + if (c == '#') + goto comment; + buf[len++] = c; + if (len >= bufsize) + { + bufsize *= 2; + buf = xrealloc (buf, bufsize); + } + c = getc (file); + } + buf[len++] = '\0'; + if (c == EOF) + break; + + /* Eat white space at end of line. */ + while (! IS_LINE_TERMINATOR(c) && c != EOF && IS_WHITESPACE (c)) + c = getc (file); + if (c == '#') + goto comment; + /* Handle \r\n. */ + if ((c == '\r' && (c = getc (file)) == '\n') + || c == '\n' || c == EOF) + { + end_of_line: + /* Append the redefinition to the list. */ + if (buf[0] != '\0') + redefine_list_append (filename, &buf[0], &buf[outsym_off]); + + lineno++; + len = 0; + outsym_off = 0; + if (c == EOF) + break; + c = getc (file); + continue; + } + else + fatal (_("%s: garbage at end of line %d"), filename, lineno); + comment: + if (len != 0 && (outsym_off == 0 || outsym_off == len)) + fatal (_("%s: missing new symbol name at line %d"), filename, lineno); + buf[len++] = '\0'; + + /* Eat the rest of the line and finish it. */ + while (c != '\n' && c != EOF) + c = getc (file); + goto end_of_line; + } - for (; from < end; from += interleave) - *to++ = *from; + if (len != 0) + fatal (_("%s: premature end of file at line %d"), filename, lineno); - if (*size % interleave > (bfd_size_type) copy_byte) - *size = (*size / interleave) + 1; - else - *size /= interleave; + free (buf); } -/* Copy object file IBFD onto OBFD. */ +/* Copy object file IBFD onto OBFD. + Returns TRUE upon success, FALSE otherwise. */ -static void -copy_object (ibfd, obfd) - bfd *ibfd; - bfd *obfd; +static bfd_boolean +copy_object (bfd *ibfd, bfd *obfd) { bfd_vma start; long symcount; asection **osections = NULL; + asection *gnu_debuglink_section = NULL; bfd_size_type *gaps = NULL; bfd_size_type max_gap = 0; long symsize; - PTR dhandle; + void *dhandle; + enum bfd_architecture iarch; + unsigned int imach; if (ibfd->xvec->byteorder != obfd->xvec->byteorder && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) - { - fatal (_("Unable to change endianness of input file(s)")); - return; - } + fatal (_("Unable to change endianness of input file(s)")); if (!bfd_set_format (obfd, bfd_get_format (ibfd))) - RETURN_NONFATAL (bfd_get_filename (obfd)); + { + bfd_nonfatal (bfd_get_filename (obfd)); + return FALSE; + } if (verbose) printf (_("copy from %s(%s) to %s(%s)\n"), @@ -964,22 +1128,45 @@ copy_object (ibfd, obfd) need to be set for a core file. */ if (bfd_get_format (obfd) != bfd_core) { + flagword flags; + + flags = bfd_get_file_flags (ibfd); + flags |= bfd_flags_to_set; + flags &= ~bfd_flags_to_clear; + flags &= bfd_applicable_file_flags (obfd); + if (!bfd_set_start_address (obfd, start) - || !bfd_set_file_flags (obfd, - (bfd_get_file_flags (ibfd) - & bfd_applicable_file_flags (obfd)))) - RETURN_NONFATAL (bfd_get_filename (ibfd)); + || !bfd_set_file_flags (obfd, flags)) + { + bfd_nonfatal (bfd_get_filename (ibfd)); + return FALSE; + } } /* Copy architecture of input file to output file. */ - if (!bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), - bfd_get_mach (ibfd))) - non_fatal (_("Warning: Output file cannot represent architecture %s"), - bfd_printable_arch_mach (bfd_get_arch (ibfd), - bfd_get_mach (ibfd))); + iarch = bfd_get_arch (ibfd); + imach = bfd_get_mach (ibfd); + if (!bfd_set_arch_mach (obfd, iarch, imach) + && (ibfd->target_defaulted + || bfd_get_arch (ibfd) != bfd_get_arch (obfd))) + { + if (bfd_get_arch (ibfd) == bfd_arch_unknown) + fatal (_("Unable to recognise the format of the input file %s"), + bfd_get_filename (ibfd)); + else + { + non_fatal (_("Warning: Output file cannot represent architecture %s"), + bfd_printable_arch_mach (bfd_get_arch (ibfd), + bfd_get_mach (ibfd))); + return FALSE; + } + } if (!bfd_set_format (obfd, bfd_get_format (ibfd))) - RETURN_NONFATAL (bfd_get_filename (ibfd)); + { + bfd_nonfatal (bfd_get_filename (ibfd)); + return FALSE; + } if (isympp) free (isympp); @@ -989,7 +1176,7 @@ copy_object (ibfd, obfd) /* BFD mandates that all output sections be created and sizes set before any output is done. Thus, we traverse all sections multiple times. */ - bfd_map_over_sections (ibfd, setup_section, (void *) obfd); + bfd_map_over_sections (ibfd, setup_section, obfd); if (add_sections != NULL) { @@ -998,53 +1185,81 @@ copy_object (ibfd, obfd) for (padd = add_sections; padd != NULL; padd = padd->next) { + flagword flags; + padd->section = bfd_make_section (obfd, padd->name); if (padd->section == NULL) { non_fatal (_("can't create section `%s': %s"), padd->name, bfd_errmsg (bfd_get_error ())); - status = 1; - return; + return FALSE; } - else + + if (! bfd_set_section_size (obfd, padd->section, padd->size)) { - flagword flags; + bfd_nonfatal (bfd_get_filename (obfd)); + return FALSE; + } - if (! bfd_set_section_size (obfd, padd->section, padd->size)) - RETURN_NONFATAL (bfd_get_filename (obfd)); + pset = find_section_list (padd->name, FALSE); + if (pset != NULL) + pset->used = TRUE; - pset = find_section_list (padd->name, false); - if (pset != NULL) - pset->used = true; + if (pset != NULL && pset->set_flags) + flags = pset->flags | SEC_HAS_CONTENTS; + else + flags = SEC_HAS_CONTENTS | SEC_READONLY | SEC_DATA; - if (pset != NULL && pset->set_flags) - flags = pset->flags | SEC_HAS_CONTENTS; - else - flags = SEC_HAS_CONTENTS | SEC_READONLY | SEC_DATA; + if (! bfd_set_section_flags (obfd, padd->section, flags)) + { + bfd_nonfatal (bfd_get_filename (obfd)); + return FALSE; + } - if (! bfd_set_section_flags (obfd, padd->section, flags)) - RETURN_NONFATAL (bfd_get_filename (obfd)); + if (pset != NULL) + { + if (pset->change_vma != CHANGE_IGNORE) + if (! bfd_set_section_vma (obfd, padd->section, + pset->vma_val)) + { + bfd_nonfatal (bfd_get_filename (obfd)); + return FALSE; + } - if (pset != NULL) + if (pset->change_lma != CHANGE_IGNORE) { - if (pset->change_vma != CHANGE_IGNORE) - if (! bfd_set_section_vma (obfd, padd->section, pset->vma_val)) - RETURN_NONFATAL (bfd_get_filename (obfd)); + padd->section->lma = pset->lma_val; - if (pset->change_lma != CHANGE_IGNORE) + if (! bfd_set_section_alignment + (obfd, padd->section, + bfd_section_alignment (obfd, padd->section))) { - padd->section->lma = pset->lma_val; - - if (! bfd_set_section_alignment - (obfd, padd->section, - bfd_section_alignment (obfd, padd->section))) - RETURN_NONFATAL (bfd_get_filename (obfd)); + bfd_nonfatal (bfd_get_filename (obfd)); + return FALSE; } } } } } + if (gnu_debuglink_filename != NULL) + { + gnu_debuglink_section = bfd_create_gnu_debuglink_section + (obfd, gnu_debuglink_filename); + + if (gnu_debuglink_section == NULL) + { + bfd_nonfatal (gnu_debuglink_filename); + return FALSE; + } + } + + if (bfd_count_sections (obfd) == 0) + { + non_fatal (_("there are no sections to be copied!")); + return FALSE; + } + if (gap_fill_set || pad_to_set) { asection **set; @@ -1057,13 +1272,13 @@ copy_object (ibfd, obfd) We write out the gap contents below. */ c = bfd_count_sections (obfd); - osections = (asection **) xmalloc (c * sizeof (asection *)); + osections = xmalloc (c * sizeof (asection *)); set = osections; - bfd_map_over_sections (obfd, get_sections, (void *) &set); + bfd_map_over_sections (obfd, get_sections, &set); qsort (osections, c, sizeof (asection *), compare_section_lma); - gaps = (bfd_size_type *) xmalloc (c * sizeof (bfd_size_type)); + gaps = xmalloc (c * sizeof (bfd_size_type)); memset (gaps, 0, c * sizeof (bfd_size_type)); if (gap_fill_set) @@ -1132,12 +1347,18 @@ copy_object (ibfd, obfd) dhandle = NULL; symsize = bfd_get_symtab_upper_bound (ibfd); if (symsize < 0) - RETURN_NONFATAL (bfd_get_filename (ibfd)); + { + bfd_nonfatal (bfd_get_filename (ibfd)); + return FALSE; + } - osympp = isympp = (asymbol **) xmalloc (symsize); + osympp = isympp = xmalloc (symsize); symcount = bfd_canonicalize_symtab (ibfd, isympp); if (symcount < 0) - RETURN_NONFATAL (bfd_get_filename (ibfd)); + { + bfd_nonfatal (bfd_get_filename (ibfd)); + return FALSE; + } if (convert_debugging) dhandle = read_debugging_info (ibfd, isympp, symcount); @@ -1145,12 +1366,14 @@ copy_object (ibfd, obfd) if (strip_symbols == STRIP_DEBUG || strip_symbols == STRIP_ALL || strip_symbols == STRIP_UNNEEDED + || strip_symbols == STRIP_NONDEBUG || discard_locals != LOCALS_UNDEF || strip_specific_list != NULL || keep_specific_list != NULL || localize_specific_list != NULL || keepglobal_specific_list != NULL || weaken_specific_list != NULL + || prefix_symbols_string || sections_removed || sections_copied || convert_debugging @@ -1170,8 +1393,8 @@ copy_object (ibfd, obfd) if (strip_symbols != STRIP_ALL) bfd_map_over_sections (ibfd, mark_symbols_used_in_relocations, - (PTR)isympp); - osympp = (asymbol **) xmalloc ((symcount + 1) * sizeof (asymbol *)); + isympp); + osympp = xmalloc ((symcount + 1) * sizeof (asymbol *)); symcount = filter_symbols (ibfd, obfd, osympp, isympp, symcount); } @@ -1180,14 +1403,14 @@ copy_object (ibfd, obfd) if (! write_debugging_info (obfd, dhandle, &symcount, &osympp)) { status = 1; - return; + return FALSE; } } bfd_set_symtab (obfd, osympp, symcount); /* This has to happen after the symbol table has been set. */ - bfd_map_over_sections (ibfd, copy_section, (void *) obfd); + bfd_map_over_sections (ibfd, copy_section, obfd); if (add_sections != NULL) { @@ -1195,11 +1418,22 @@ copy_object (ibfd, obfd) for (padd = add_sections; padd != NULL; padd = padd->next) { - if (! bfd_set_section_contents (obfd, padd->section, - (PTR) padd->contents, - (file_ptr) 0, - (bfd_size_type) padd->size)) - RETURN_NONFATAL (bfd_get_filename (obfd)); + if (! bfd_set_section_contents (obfd, padd->section, padd->contents, + 0, padd->size)) + { + bfd_nonfatal (bfd_get_filename (obfd)); + return FALSE; + } + } + } + + if (gnu_debuglink_filename != NULL) + { + if (! bfd_fill_in_gnu_debuglink_section + (obfd, gnu_debuglink_section, gnu_debuglink_filename)) + { + bfd_nonfatal (gnu_debuglink_filename); + return FALSE; } } @@ -1211,8 +1445,8 @@ copy_object (ibfd, obfd) /* Fill in the gaps. */ if (max_gap > 8192) max_gap = 8192; - buf = (bfd_byte *) xmalloc (max_gap); - memset (buf, gap_fill, (size_t) max_gap); + buf = xmalloc (max_gap); + memset (buf, gap_fill, max_gap); c = bfd_count_sections (obfd); for (i = 0; i < c; i++) @@ -1236,7 +1470,10 @@ copy_object (ibfd, obfd) if (! bfd_set_section_contents (obfd, osections[i], buf, off, now)) - RETURN_NONFATAL (bfd_get_filename (obfd)); + { + bfd_nonfatal (bfd_get_filename (obfd)); + return FALSE; + } left -= now; off += now; @@ -1249,23 +1486,27 @@ copy_object (ibfd, obfd) from the input BFD to the output BFD. This is done last to permit the routine to look at the filtered symbol table, which is important for the ECOFF code at least. */ - if (! bfd_copy_private_bfd_data (ibfd, obfd)) + if (bfd_get_flavour (ibfd) == bfd_target_elf_flavour + && strip_symbols == STRIP_NONDEBUG) + /* Do not copy the private data when creating an ELF format + debug info file. We do not want the program headers. */ + ; + else if (! bfd_copy_private_bfd_data (ibfd, obfd)) { non_fatal (_("%s: error copying private BFD data: %s"), bfd_get_filename (obfd), bfd_errmsg (bfd_get_error ())); - status = 1; - return; + return FALSE; } /* Switch to the alternate machine code. We have to do this at the very end, because we only initialize the header when we create the first section. */ - if (use_alt_mach_code != 0) - { - if (!bfd_alt_mach_code (obfd, use_alt_mach_code)) - non_fatal (_("unknown alternate machine code, ignored")); - } + if (use_alt_mach_code != 0 + && ! bfd_alt_mach_code (obfd, use_alt_mach_code)) + non_fatal (_("unknown alternate machine code, ignored")); + + return TRUE; } #undef MKDIR @@ -1279,10 +1520,7 @@ copy_object (ibfd, obfd) contents to temp file, and keep the temp file handle. */ static void -copy_archive (ibfd, obfd, output_target) - bfd *ibfd; - bfd *obfd; - const char *output_target; +copy_archive (bfd *ibfd, bfd *obfd, const char *output_target) { struct name_list { @@ -1296,10 +1534,9 @@ copy_archive (ibfd, obfd, output_target) /* Make a temp directory to hold the contents. */ if (MKDIR (dir, 0700) != 0) - { - fatal (_("cannot mkdir %s for archive copying (error: %s)"), - dir, strerror (errno)); - } + fatal (_("cannot mkdir %s for archive copying (error: %s)"), + dir, strerror (errno)); + obfd->has_armap = ibfd->has_armap; list = NULL; @@ -1309,13 +1546,14 @@ copy_archive (ibfd, obfd, output_target) if (!bfd_set_format (obfd, bfd_get_format (ibfd))) RETURN_NONFATAL (bfd_get_filename (obfd)); - while (!status && this_element != (bfd *) NULL) + while (!status && this_element != NULL) { char *output_name; bfd *output_bfd; bfd *last_element; struct stat buf; int stat_status = 0; + bfd_boolean delete = TRUE; /* Create an output file for this member. */ output_name = concat (dir, "/", @@ -1326,11 +1564,10 @@ copy_archive (ibfd, obfd, output_target) { output_name = make_tempname (output_name); if (MKDIR (output_name, 0700) != 0) - { - fatal (_("cannot mkdir %s for archive copying (error: %s)"), - output_name, strerror (errno)); - } - l = (struct name_list *) xmalloc (sizeof (struct name_list)); + fatal (_("cannot mkdir %s for archive copying (error: %s)"), + output_name, strerror (errno)); + + l = xmalloc (sizeof (struct name_list)); l->name = output_name; l->next = list; l->obfd = NULL; @@ -1349,16 +1586,16 @@ copy_archive (ibfd, obfd, output_target) bfd_get_filename (this_element)); } - l = (struct name_list *) xmalloc (sizeof (struct name_list)); + l = xmalloc (sizeof (struct name_list)); l->name = output_name; l->next = list; list = l; - if (output_bfd == (bfd *) NULL) + if (output_bfd == NULL) RETURN_NONFATAL (output_name); - if (bfd_check_format (this_element, bfd_object) == true) - copy_object (this_element, output_bfd); + if (bfd_check_format (this_element, bfd_object)) + delete = ! copy_object (this_element, output_bfd); if (!bfd_close (output_bfd)) { @@ -1367,24 +1604,32 @@ copy_archive (ibfd, obfd, output_target) status = 1; } - if (preserve_dates && stat_status == 0) - set_times (output_name, &buf); + if (delete) + { + unlink (output_name); + status = 1; + } + else + { + if (preserve_dates && stat_status == 0) + set_times (output_name, &buf); - /* Open the newly output file and attach to our list. */ - output_bfd = bfd_openr (output_name, output_target); + /* Open the newly output file and attach to our list. */ + output_bfd = bfd_openr (output_name, output_target); - l->obfd = output_bfd; + l->obfd = output_bfd; - *ptr = output_bfd; - ptr = &output_bfd->next; + *ptr = output_bfd; + ptr = &output_bfd->next; - last_element = this_element; + last_element = this_element; - this_element = bfd_openr_next_archived_file (ibfd, last_element); + this_element = bfd_openr_next_archived_file (ibfd, last_element); - bfd_close (last_element); + bfd_close (last_element); + } } - *ptr = (bfd *) NULL; + *ptr = NULL; if (!bfd_close (obfd)) RETURN_NONFATAL (bfd_get_filename (obfd)); @@ -1409,14 +1654,18 @@ copy_archive (ibfd, obfd, output_target) /* The top-level control. */ static void -copy_file (input_filename, output_filename, input_target, output_target) - const char *input_filename; - const char *output_filename; - const char *input_target; - const char *output_target; +copy_file (const char *input_filename, const char *output_filename, + const char *input_target, const char *output_target) { bfd *ibfd; - char **matching; + char **obj_matching; + char **core_matching; + + if (get_file_size (input_filename) < 1) + { + status = 1; + return; + } /* To allow us to do "strip *" without dying on the first non-object file, failures are nonfatal. */ @@ -1439,10 +1688,11 @@ copy_file (input_filename, output_filename, input_target, output_target) copy_archive (ibfd, obfd, output_target); } - else if (bfd_check_format_matches (ibfd, bfd_object, &matching) - || bfd_check_format_matches (ibfd, bfd_core, &matching)) + else if (bfd_check_format_matches (ibfd, bfd_object, &obj_matching)) { bfd *obfd; + bfd_boolean delete; + do_copy: /* bfd_get_target does not return the correct value until bfd_check_format succeeds. */ @@ -1453,22 +1703,49 @@ copy_file (input_filename, output_filename, input_target, output_target) if (obfd == NULL) RETURN_NONFATAL (output_filename); - copy_object (ibfd, obfd); + delete = ! copy_object (ibfd, obfd); if (!bfd_close (obfd)) RETURN_NONFATAL (output_filename); if (!bfd_close (ibfd)) RETURN_NONFATAL (input_filename); + + if (delete) + { + unlink (output_filename); + status = 1; + } } else { + bfd_error_type obj_error = bfd_get_error (); + bfd_error_type core_error; + + if (bfd_check_format_matches (ibfd, bfd_core, &core_matching)) + { + /* This probably can't happen.. */ + if (obj_error == bfd_error_file_ambiguously_recognized) + free (obj_matching); + goto do_copy; + } + + core_error = bfd_get_error (); + /* Report the object error in preference to the core error. */ + if (obj_error != core_error) + bfd_set_error (obj_error); + bfd_nonfatal (input_filename); - if (bfd_get_error () == bfd_error_file_ambiguously_recognized) + if (obj_error == bfd_error_file_ambiguously_recognized) { - list_matching_formats (matching); - free (matching); + list_matching_formats (obj_matching); + free (obj_matching); + } + if (core_error == bfd_error_file_ambiguously_recognized) + { + list_matching_formats (core_matching); + free (core_matching); } status = 1; @@ -1478,10 +1755,8 @@ copy_file (input_filename, output_filename, input_target, output_target) /* Add a name to the section renaming list. */ static void -add_section_rename (old_name, new_name, flags) - const char * old_name; - const char * new_name; - flagword flags; +add_section_rename (const char * old_name, const char * new_name, + flagword flags) { section_rename * rename; @@ -1497,7 +1772,7 @@ add_section_rename (old_name, new_name, flags) fatal (_("Multiple renames of section %s"), old_name); } - rename = (section_rename *) xmalloc (sizeof (* rename)); + rename = xmalloc (sizeof (* rename)); rename->old_name = old_name; rename->new_name = new_name; @@ -1512,10 +1787,8 @@ add_section_rename (old_name, new_name, flags) Also set RETURNED_FLAGS to the flags to be used for this section. */ static const char * -find_section_rename (ibfd, isection, returned_flags) - bfd * ibfd ATTRIBUTE_UNUSED; - sec_ptr isection; - flagword * returned_flags; +find_section_rename (bfd * ibfd ATTRIBUTE_UNUSED, sec_ptr isection, + flagword * returned_flags) { const char * old_name = bfd_section_name (ibfd, isection); section_rename * rename; @@ -1539,12 +1812,9 @@ find_section_rename (ibfd, isection, returned_flags) name and attributes as ISECTION in IBFD. */ static void -setup_section (ibfd, isection, obfdarg) - bfd *ibfd; - sec_ptr isection; - PTR obfdarg; +setup_section (bfd *ibfd, sec_ptr isection, void *obfdarg) { - bfd *obfd = (bfd *) obfdarg; + bfd *obfd = obfdarg; struct section_list *p; sec_ptr osection; bfd_size_type size; @@ -1553,27 +1823,35 @@ setup_section (ibfd, isection, obfdarg) flagword flags; const char *err; const char * name; + char *prefix = NULL; - if ((bfd_get_section_flags (ibfd, isection) & SEC_DEBUGGING) != 0 - && (strip_symbols == STRIP_DEBUG - || strip_symbols == STRIP_UNNEEDED - || strip_symbols == STRIP_ALL - || discard_locals == LOCALS_ALL - || convert_debugging)) + if (is_strip_section (ibfd, isection)) return; - p = find_section_list (bfd_section_name (ibfd, isection), false); + p = find_section_list (bfd_section_name (ibfd, isection), FALSE); if (p != NULL) - p->used = true; - - if (sections_removed && p != NULL && p->remove) - return; - if (sections_copied && (p == NULL || ! p->copy)) - return; + p->used = TRUE; /* Get the, possibly new, name of the output section. */ name = find_section_rename (ibfd, isection, & flags); + /* Prefix sections. */ + if ((prefix_alloc_sections_string) + && (bfd_get_section_flags (ibfd, isection) & SEC_ALLOC)) + prefix = prefix_alloc_sections_string; + else if (prefix_sections_string) + prefix = prefix_sections_string; + + if (prefix) + { + char *n; + + n = xmalloc (strlen (prefix) + strlen (name) + 1); + strcpy (n, prefix); + strcat (n, name); + name = n; + } + osection = bfd_make_section_anyway (obfd, name); if (osection == NULL) @@ -1622,10 +1900,9 @@ setup_section (ibfd, isection, obfdarg) /* FIXME: This is probably not enough. If we change the LMA we may have to recompute the header for the file as well. */ - if (bfd_set_section_alignment (obfd, - osection, - bfd_section_alignment (ibfd, isection)) - == false) + if (!bfd_set_section_alignment (obfd, + osection, + bfd_section_alignment (ibfd, isection))) { err = _("alignment"); goto loser; @@ -1633,6 +1910,13 @@ setup_section (ibfd, isection, obfdarg) if (p != NULL && p->set_flags) flags = p->flags | (flags & (SEC_HAS_CONTENTS | SEC_RELOC)); + else if (strip_symbols == STRIP_NONDEBUG && (flags & SEC_ALLOC) != 0) + { + flags &= ~(SEC_HAS_CONTENTS | SEC_LOAD); + if (obfd->xvec->flavour == bfd_target_elf_flavour) + elf_section_type (osection) = SHT_NOBITS; + } + if (!bfd_set_section_flags (obfd, osection, flags)) { err = _("flags"); @@ -1650,7 +1934,12 @@ setup_section (ibfd, isection, obfdarg) /* Allow the BFD backend to copy any private data it understands from the input section to the output section. */ - if (!bfd_copy_private_section_data (ibfd, isection, obfd, osection)) + if (bfd_get_flavour (ibfd) == bfd_target_elf_flavour + && strip_symbols == STRIP_NONDEBUG) + /* Do not copy the private data when creating an ELF format + debug info file. We do not want the program headers. */ + ; + else if (!bfd_copy_private_section_data (ibfd, isection, obfd, osection)) { err = _("private data"); goto loser; @@ -1672,12 +1961,9 @@ loser: If stripping then don't copy any relocation info. */ static void -copy_section (ibfd, isection, obfdarg) - bfd *ibfd; - sec_ptr isection; - PTR obfdarg; +copy_section (bfd *ibfd, sec_ptr isection, void *obfdarg) { - bfd *obfd = (bfd *) obfdarg; + bfd *obfd = obfdarg; struct section_list *p; arelent **relpp; long relcount; @@ -1691,45 +1977,43 @@ copy_section (ibfd, isection, obfdarg) if (status != 0) return; - flags = bfd_get_section_flags (ibfd, isection); - if ((flags & SEC_DEBUGGING) != 0 - && (strip_symbols == STRIP_DEBUG - || strip_symbols == STRIP_UNNEEDED - || strip_symbols == STRIP_ALL - || discard_locals == LOCALS_ALL - || convert_debugging)) + if (is_strip_section (ibfd, isection)) return; + flags = bfd_get_section_flags (ibfd, isection); if ((flags & SEC_GROUP) != 0) return; - p = find_section_list (bfd_section_name (ibfd, isection), false); - - if (sections_removed && p != NULL && p->remove) - return; - if (sections_copied && (p == NULL || ! p->copy)) - return; - osection = isection->output_section; size = bfd_get_section_size_before_reloc (isection); if (size == 0 || osection == 0) return; + p = find_section_list (bfd_get_section_name (ibfd, isection), FALSE); + /* Core files do not need to be relocated. */ if (bfd_get_format (obfd) == bfd_core) relsize = 0; else - relsize = bfd_get_reloc_upper_bound (ibfd, isection); + { + relsize = bfd_get_reloc_upper_bound (ibfd, isection); - if (relsize < 0) - RETURN_NONFATAL (bfd_get_filename (ibfd)); + if (relsize < 0) + { + /* Do not complain if the target does not support relocations. */ + if (relsize == -1 && bfd_get_error () == bfd_error_invalid_operation) + relsize = 0; + else + RETURN_NONFATAL (bfd_get_filename (ibfd)); + } + } if (relsize == 0) - bfd_set_reloc (obfd, osection, (arelent **) NULL, 0); + bfd_set_reloc (obfd, osection, NULL, 0); else { - relpp = (arelent **) xmalloc (relsize); + relpp = xmalloc (relsize); relcount = bfd_canonicalize_reloc (ibfd, isection, relpp, isympp); if (relcount < 0) RETURN_NONFATAL (bfd_get_filename (ibfd)); @@ -1742,45 +2026,54 @@ copy_section (ibfd, isection, obfdarg) long temp_relcount = 0; long i; - temp_relpp = (arelent **) xmalloc (relsize); + temp_relpp = xmalloc (relsize); for (i = 0; i < relcount; i++) - if (is_specified_symbol - (bfd_asymbol_name (*relpp [i]->sym_ptr_ptr), - keep_specific_list)) + if (is_specified_symbol (bfd_asymbol_name (*relpp[i]->sym_ptr_ptr), + keep_specific_list)) temp_relpp [temp_relcount++] = relpp [i]; relcount = temp_relcount; free (relpp); relpp = temp_relpp; } - bfd_set_reloc (obfd, osection, - (relcount == 0 ? (arelent **) NULL : relpp), relcount); + bfd_set_reloc (obfd, osection, relcount == 0 ? NULL : relpp, relcount); + if (relcount == 0) + free (relpp); } isection->_cooked_size = isection->_raw_size; - isection->reloc_done = true; + isection->reloc_done = TRUE; if (bfd_get_section_flags (ibfd, isection) & SEC_HAS_CONTENTS && bfd_get_section_flags (obfd, osection) & SEC_HAS_CONTENTS) { - PTR memhunk = (PTR) xmalloc ((unsigned) size); + void *memhunk = xmalloc (size); - if (!bfd_get_section_contents (ibfd, isection, memhunk, (file_ptr) 0, - size)) + if (!bfd_get_section_contents (ibfd, isection, memhunk, 0, size)) RETURN_NONFATAL (bfd_get_filename (ibfd)); if (copy_byte >= 0) - filter_bytes (memhunk, &size); + { + /* Keep only every `copy_byte'th byte in MEMHUNK. */ + char *from = (char *) memhunk + copy_byte; + char *to = memhunk; + char *end = (char *) memhunk + size; + + for (; from < end; from += interleave) + *to++ = *from; - if (!bfd_set_section_contents (obfd, osection, memhunk, (file_ptr) 0, - size)) + size = (size + interleave - 1 - copy_byte) / interleave; + osection->lma /= interleave; + } + + if (!bfd_set_section_contents (obfd, osection, memhunk, 0, size)) RETURN_NONFATAL (bfd_get_filename (obfd)); free (memhunk); } else if (p != NULL && p->set_flags && (p->flags & SEC_HAS_CONTENTS) != 0) { - PTR memhunk = (PTR) xmalloc ((unsigned) size); + void *memhunk = xmalloc (size); /* We don't permit the user to turn off the SEC_HAS_CONTENTS flag--they can just remove the section entirely and add it @@ -1789,8 +2082,7 @@ copy_section (ibfd, isection, obfdarg) contents should be zeroed out. */ memset (memhunk, 0, size); - if (! bfd_set_section_contents (obfd, osection, memhunk, (file_ptr) 0, - size)) + if (! bfd_set_section_contents (obfd, osection, memhunk, 0, size)) RETURN_NONFATAL (bfd_get_filename (obfd)); free (memhunk); } @@ -1800,12 +2092,9 @@ copy_section (ibfd, isection, obfdarg) used. */ static void -get_sections (obfd, osection, secppparg) - bfd *obfd ATTRIBUTE_UNUSED; - asection *osection; - PTR secppparg; +get_sections (bfd *obfd ATTRIBUTE_UNUSED, asection *osection, void *secppparg) { - asection ***secppp = (asection ***) secppparg; + asection ***secppp = secppparg; **secppp = osection; ++(*secppp); @@ -1816,12 +2105,10 @@ get_sections (obfd, osection, secppparg) sections to the front, where they are easier to ignore. */ static int -compare_section_lma (arg1, arg2) - const PTR arg1; - const PTR arg2; +compare_section_lma (const void *arg1, const void *arg2) { - const asection **sec1 = (const asection **) arg1; - const asection **sec2 = (const asection **) arg2; + const asection *const *sec1 = arg1; + const asection *const *sec2 = arg2; flagword flags1, flags2; /* Sort non loadable sections to the front. */ @@ -1862,12 +2149,9 @@ compare_section_lma (arg1, arg2) Ignore relocations which will not appear in the output file. */ static void -mark_symbols_used_in_relocations (ibfd, isection, symbolsarg) - bfd *ibfd; - sec_ptr isection; - PTR symbolsarg; +mark_symbols_used_in_relocations (bfd *ibfd, sec_ptr isection, void *symbolsarg) { - asymbol **symbols = (asymbol **) symbolsarg; + asymbol **symbols = symbolsarg; long relsize; arelent **relpp; long relcount, i; @@ -1878,12 +2162,17 @@ mark_symbols_used_in_relocations (ibfd, isection, symbolsarg) relsize = bfd_get_reloc_upper_bound (ibfd, isection); if (relsize < 0) - bfd_fatal (bfd_get_filename (ibfd)); + { + /* Do not complain if the target does not support relocations. */ + if (relsize == -1 && bfd_get_error () == bfd_error_invalid_operation) + return; + bfd_fatal (bfd_get_filename (ibfd)); + } if (relsize == 0) return; - relpp = (arelent **) xmalloc (relsize); + relpp = xmalloc (relsize); relcount = bfd_canonicalize_reloc (ibfd, isection, relpp, symbols); if (relcount < 0) bfd_fatal (bfd_get_filename (ibfd)); @@ -1904,12 +2193,10 @@ mark_symbols_used_in_relocations (ibfd, isection, symbolsarg) /* Write out debugging information. */ -static boolean -write_debugging_info (obfd, dhandle, symcountp, symppp) - bfd *obfd; - PTR dhandle; - long *symcountp ATTRIBUTE_UNUSED; - asymbol ***symppp ATTRIBUTE_UNUSED; +static bfd_boolean +write_debugging_info (bfd *obfd, void *dhandle, + long *symcountp ATTRIBUTE_UNUSED, + asymbol ***symppp ATTRIBUTE_UNUSED) { if (bfd_get_flavour (obfd) == bfd_target_ieee_flavour) return write_ieee_debugging_info (obfd, dhandle); @@ -1924,7 +2211,7 @@ write_debugging_info (obfd, dhandle, symcountp, symppp) if (! write_stabs_in_sections_debugging_info (obfd, dhandle, &syms, &symsize, &strings, &stringsize)) - return false; + return FALSE; stabsec = bfd_make_section (obfd, ".stab"); stabstrsec = bfd_make_section (obfd, ".stabstr"); @@ -1946,44 +2233,44 @@ write_debugging_info (obfd, dhandle, symcountp, symppp) non_fatal (_("%s: can't create debugging section: %s"), bfd_get_filename (obfd), bfd_errmsg (bfd_get_error ())); - return false; + return FALSE; } /* We can get away with setting the section contents now because the next thing the caller is going to do is copy over the real sections. We may someday have to split the contents setting out of this function. */ - if (! bfd_set_section_contents (obfd, stabsec, syms, (file_ptr) 0, - symsize) - || ! bfd_set_section_contents (obfd, stabstrsec, strings, - (file_ptr) 0, stringsize)) + if (! bfd_set_section_contents (obfd, stabsec, syms, 0, symsize) + || ! bfd_set_section_contents (obfd, stabstrsec, strings, 0, + stringsize)) { non_fatal (_("%s: can't set debugging section contents: %s"), bfd_get_filename (obfd), bfd_errmsg (bfd_get_error ())); - return false; + return FALSE; } - return true; + return TRUE; } non_fatal (_("%s: don't know how to write debugging information for %s"), bfd_get_filename (obfd), bfd_get_target (obfd)); - return false; + return FALSE; } static int -strip_main (argc, argv) - int argc; - char *argv[]; +strip_main (int argc, char *argv[]) { - char *input_target = NULL, *output_target = NULL; - boolean show_version = false; - int c, i; + char *input_target = NULL; + char *output_target = NULL; + bfd_boolean show_version = FALSE; + bfd_boolean formats_info = FALSE; + int c; + int i; struct section_list *p; char *output_file = NULL; - while ((c = getopt_long (argc, argv, "I:O:F:K:N:R:o:sSpdgxXHhVv", + while ((c = getopt_long (argc, argv, "I:O:F:K:N:R:o:sSpdgxXHhVvw", strip_options, (int *) 0)) != EOF) { switch (c) @@ -1998,9 +2285,9 @@ strip_main (argc, argv) input_target = output_target = optarg; break; case 'R': - p = find_section_list (optarg, true); - p->remove = true; - sections_removed = true; + p = find_section_list (optarg, TRUE); + p->remove = TRUE; + sections_removed = TRUE; break; case 's': strip_symbols = STRIP_ALL; @@ -2023,7 +2310,7 @@ strip_main (argc, argv) output_file = optarg; break; case 'p': - preserve_dates = true; + preserve_dates = TRUE; break; case 'x': discard_locals = LOCALS_ALL; @@ -2032,14 +2319,23 @@ strip_main (argc, argv) discard_locals = LOCALS_START_L; break; case 'v': - verbose = true; + verbose = TRUE; break; case 'V': - show_version = true; + show_version = TRUE; + break; + case OPTION_FORMATS_INFO: + formats_info = TRUE; + break; + case OPTION_ONLY_KEEP_DEBUG: + strip_symbols = STRIP_NONDEBUG; break; case 0: /* We've been given a long option. */ break; + case 'w': + wildcard = TRUE; + break; case 'H': case 'h': strip_usage (stdout, 0); @@ -2048,6 +2344,12 @@ strip_main (argc, argv) } } + if (formats_info) + { + display_info (); + return 0; + } + if (show_version) print_version ("strip"); @@ -2057,7 +2359,7 @@ strip_main (argc, argv) && strip_specific_list == NULL) strip_symbols = STRIP_ALL; - if (output_target == (char *) NULL) + if (output_target == NULL) output_target = input_target; i = optind; @@ -2071,14 +2373,13 @@ strip_main (argc, argv) struct stat statbuf; char *tmpname; + if (get_file_size (argv[i]) < 1) + continue; + if (preserve_dates) - { - if (stat (argv[i], &statbuf) < 0) - { - non_fatal (_("%s: cannot stat: %s"), argv[i], strerror (errno)); - continue; - } - } + /* No need to check the return value of stat(). + It has already been checked in get_file_size(). */ + stat (argv[i], &statbuf); if (output_file != NULL) tmpname = output_file; @@ -2105,20 +2406,21 @@ strip_main (argc, argv) } static int -copy_main (argc, argv) - int argc; - char *argv[]; +copy_main (int argc, char *argv[]) { char * binary_architecture = NULL; - char *input_filename = NULL, *output_filename = NULL; - char *input_target = NULL, *output_target = NULL; - boolean show_version = false; - boolean change_warn = true; + char *input_filename = NULL; + char *output_filename = NULL; + char *input_target = NULL; + char *output_target = NULL; + bfd_boolean show_version = FALSE; + bfd_boolean change_warn = TRUE; + bfd_boolean formats_info = FALSE; int c; struct section_list *p; struct stat statbuf; - while ((c = getopt_long (argc, argv, "b:B:i:I:j:K:N:s:O:d:F:L:G:R:SpgxXHhVvW:", + while ((c = getopt_long (argc, argv, "b:B:i:I:j:K:N:s:O:d:F:L:G:R:SpgxXHhVvW:w", copy_options, (int *) 0)) != EOF) { switch (c) @@ -2154,19 +2456,19 @@ copy_main (argc, argv) break; case 'j': - p = find_section_list (optarg, true); + p = find_section_list (optarg, TRUE); if (p->remove) fatal (_("%s both copied and removed"), optarg); - p->copy = true; - sections_copied = true; + p->copy = TRUE; + sections_copied = TRUE; break; case 'R': - p = find_section_list (optarg, true); + p = find_section_list (optarg, TRUE); if (p->copy) fatal (_("%s both copied and removed"), optarg); - p->remove = true; - sections_removed = true; + p->remove = TRUE; + sections_removed = TRUE; break; case 'S': @@ -2181,6 +2483,14 @@ copy_main (argc, argv) strip_symbols = STRIP_UNNEEDED; break; + case OPTION_ONLY_KEEP_DEBUG: + strip_symbols = STRIP_NONDEBUG; + break; + + case OPTION_ADD_GNU_DEBUGLINK: + gnu_debuglink_filename = optarg; + break; + case 'K': add_specific_symbol (optarg, &keep_specific_list); break; @@ -2202,7 +2512,11 @@ copy_main (argc, argv) break; case 'p': - preserve_dates = true; + preserve_dates = TRUE; + break; + + case 'w': + wildcard = TRUE; break; case 'x': @@ -2214,21 +2528,25 @@ copy_main (argc, argv) break; case 'v': - verbose = true; + verbose = TRUE; break; case 'V': - show_version = true; + show_version = TRUE; + break; + + case OPTION_FORMATS_INFO: + formats_info = TRUE; break; case OPTION_WEAKEN: - weaken = true; + weaken = TRUE; break; case OPTION_ADD_SECTION: { const char *s; - struct stat st; + off_t size; struct section_add *pa; int len; char *name; @@ -2239,26 +2557,27 @@ copy_main (argc, argv) if (s == NULL) fatal (_("bad format for %s"), "--add-section"); - if (stat (s + 1, & st) < 0) - fatal (_("cannot stat: %s: %s"), s + 1, strerror (errno)); + size = get_file_size (s + 1); + if (size < 1) + break; - pa = (struct section_add *) xmalloc (sizeof (struct section_add)); + pa = xmalloc (sizeof (struct section_add)); len = s - optarg; - name = (char *) xmalloc (len + 1); + name = xmalloc (len + 1); strncpy (name, optarg, len); name[len] = '\0'; pa->name = name; pa->filename = s + 1; + pa->size = size; + pa->contents = xmalloc (size); - pa->size = st.st_size; - - pa->contents = (bfd_byte *) xmalloc (pa->size); f = fopen (pa->filename, FOPEN_RB); if (f == NULL) - fatal (_("cannot open: %s: %s"), pa->filename, strerror (errno)); + fatal (_("cannot open: %s: %s"), + pa->filename, strerror (errno)); if (fread (pa->contents, 1, pa->size, f) == 0 || ferror (f)) @@ -2312,11 +2631,11 @@ copy_main (argc, argv) } len = s - optarg; - name = (char *) xmalloc (len + 1); + name = xmalloc (len + 1); strncpy (name, optarg, len); name[len] = '\0'; - p = find_section_list (name, true); + p = find_section_list (name, TRUE); val = parse_vma (s + 1, option); @@ -2353,15 +2672,15 @@ copy_main (argc, argv) break; case OPTION_CHANGE_WARNINGS: - change_warn = true; + change_warn = TRUE; break; case OPTION_CHANGE_LEADING_CHAR: - change_leading_char = true; + change_leading_char = TRUE; break; case OPTION_DEBUGGING: - convert_debugging = true; + convert_debugging = TRUE; break; case OPTION_GAP_FILL: @@ -2379,21 +2698,21 @@ copy_main (argc, argv) non_fatal (_("Warning: truncating gap-fill from 0x%s to 0x%x"), buff, gap_fill); } - gap_fill_set = true; + gap_fill_set = TRUE; } break; case OPTION_NO_CHANGE_WARNINGS: - change_warn = false; + change_warn = FALSE; break; case OPTION_PAD_TO: pad_to = parse_vma (optarg, "--pad-to"); - pad_to_set = true; + pad_to_set = TRUE; break; case OPTION_REMOVE_LEADING_CHAR: - remove_leading_char = true; + remove_leading_char = TRUE; break; case OPTION_REDEFINE_SYM: @@ -2410,22 +2729,26 @@ copy_main (argc, argv) fatal (_("bad format for %s"), "--redefine-sym"); len = s - optarg; - source = (char *) xmalloc (len + 1); + source = xmalloc (len + 1); strncpy (source, optarg, len); source[len] = '\0'; nextarg = s + 1; len = strlen (nextarg); - target = (char *) xmalloc (len + 1); + target = xmalloc (len + 1); strcpy (target, nextarg); - redefine_list_append (source, target); + redefine_list_append ("--redefine-sym", source, target); free (source); free (target); } break; + case OPTION_REDEFINE_SYMS: + add_redefine_syms_file (optarg); + break; + case OPTION_SET_SECTION_FLAGS: { const char *s; @@ -2437,13 +2760,13 @@ copy_main (argc, argv) fatal (_("bad format for %s"), "--set-section-flags"); len = s - optarg; - name = (char *) xmalloc (len + 1); + name = xmalloc (len + 1); strncpy (name, optarg, len); name[len] = '\0'; - p = find_section_list (name, true); + p = find_section_list (name, TRUE); - p->set_flags = true; + p->set_flags = TRUE; p->flags = parse_flags (s + 1); } break; @@ -2464,7 +2787,7 @@ copy_main (argc, argv) if (len == 0) fatal (_("bad format for %s"), "--rename-section"); - old_name = (char *) xmalloc (len + 1); + old_name = xmalloc (len + 1); strncpy (old_name, optarg, len); old_name[len] = 0; @@ -2484,7 +2807,7 @@ copy_main (argc, argv) if (len == 0) fatal (_("bad format for %s"), "--rename-section"); - new_name = (char *) xmalloc (len + 1); + new_name = xmalloc (len + 1); strncpy (new_name, eq, len); new_name[len] = 0; @@ -2494,7 +2817,7 @@ copy_main (argc, argv) case OPTION_SET_START: set_start = parse_vma (optarg, "--set-start"); - set_start_set = true; + set_start_set = TRUE; break; case OPTION_SREC_LEN: @@ -2502,7 +2825,7 @@ copy_main (argc, argv) break; case OPTION_SREC_FORCES3: - S3Forced = true; + S3Forced = TRUE; break; case OPTION_STRIP_SYMBOLS: @@ -2531,8 +2854,41 @@ copy_main (argc, argv) fatal (_("alternate machine code index must be positive")); break; + case OPTION_PREFIX_SYMBOLS: + prefix_symbols_string = optarg; + break; + + case OPTION_PREFIX_SECTIONS: + prefix_sections_string = optarg; + break; + + case OPTION_PREFIX_ALLOC_SECTIONS: + prefix_alloc_sections_string = optarg; + break; + + case OPTION_READONLY_TEXT: + bfd_flags_to_set |= WP_TEXT; + bfd_flags_to_clear &= ~WP_TEXT; + break; + + case OPTION_WRITABLE_TEXT: + bfd_flags_to_clear |= WP_TEXT; + bfd_flags_to_set &= ~WP_TEXT; + break; + + case OPTION_PURE: + bfd_flags_to_set |= D_PAGED; + bfd_flags_to_clear &= ~D_PAGED; + break; + + case OPTION_IMPURE: + bfd_flags_to_clear |= D_PAGED; + bfd_flags_to_set &= ~D_PAGED; + break; + case 0: - break; /* we've been given a long option */ + /* We've been given a long option. */ + break; case 'H': case 'h': @@ -2543,6 +2899,12 @@ copy_main (argc, argv) } } + if (formats_info) + { + display_info (); + return 0; + } + if (show_version) print_version ("objcopy"); @@ -2560,10 +2922,10 @@ copy_main (argc, argv) if (strip_symbols == STRIP_UNDEF && discard_locals == LOCALS_UNDEF) strip_symbols = STRIP_NONE; - if (output_target == (char *) NULL) + if (output_target == NULL) output_target = input_target; - if (binary_architecture != (char *) NULL) + if (binary_architecture != NULL) { if (input_target && strcmp (input_target, "binary") == 0) { @@ -2572,7 +2934,10 @@ copy_main (argc, argv) temp_arch_info = bfd_scan_arch (binary_architecture); if (temp_arch_info != NULL) - bfd_external_binary_architecture = temp_arch_info->arch; + { + bfd_external_binary_architecture = temp_arch_info->arch; + bfd_external_machine = temp_arch_info->mach; + } else fatal (_("architecture %s unknown"), binary_architecture); } @@ -2585,12 +2950,12 @@ copy_main (argc, argv) if (preserve_dates) if (stat (input_filename, & statbuf) < 0) - fatal (_("Cannot stat: %s: %s"), input_filename, strerror (errno)); - - /* If there is no destination file then create a temp and rename - the result into the input. */ + fatal (_("warning: could not locate '%s'. System error message: %s"), + input_filename, strerror (errno)); - if (output_filename == (char *) NULL) + /* If there is no destination file, or the source and destination files + are the same, then create a temp and rename the result into the input. */ + if (output_filename == NULL || strcmp (input_filename, output_filename) == 0) { char *tmpname = make_tempname (input_filename); @@ -2652,12 +3017,8 @@ copy_main (argc, argv) return 0; } -int main PARAMS ((int, char **)); - int -main (argc, argv) - int argc; - char *argv[]; +main (int argc, char *argv[]) { #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); diff --git a/contrib/binutils/binutils/objdump.c b/contrib/binutils/binutils/objdump.c index d09b6e5..f67aacb 100644 --- a/contrib/binutils/binutils/objdump.c +++ b/contrib/binutils/binutils/objdump.c @@ -1,25 +1,55 @@ /* objdump.c -- dump information about an object file. Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -This file is part of GNU Binutils. - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + This file is part of GNU Binutils. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* Objdump overview. + + Objdump displays information about one or more object files, either on + their own, or inside libraries. It is commonly used as a disassembler, + but it can also display information about file headers, symbol tables, + relocations, debugging directives and more. + + The flow of execution is as follows: + + 1. Command line arguments are checked for control switches and the + information to be displayed is selected. + + 2. Any remaining arguments are assumed to be object files, and they are + processed in order by display_bfd(). If the file is an archive each + of its elements is processed in turn. + + 3. The file's target architecture and binary file format are determined + by bfd_check_format(). If they are recognised, then dump_bfd() is + called. + + 4. dump_bfd() in turn calls separate functions to display the requested + item(s) of information(s). For example disassemble_data() is called if + a disassembly has been requested. + + When disassembling the code loops through blocks of instructions bounded + by symbols, calling disassemble_bytes() on each block. The actual + disassembling is done by the libopcodes library, via a function pointer + supplied by the disassembler() function. */ #include "bfd.h" +#include "bfdver.h" #include "progress.h" #include "bucomm.h" #include "budemang.h" @@ -36,19 +66,21 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "aout/aout64.h" #ifdef NEED_DECLARATION_FPRINTF -/* This is needed by INIT_DISASSEMBLE_INFO. */ -extern int fprintf PARAMS ((FILE *, const char *, ...)); +/* This is needed by init_disassemble_info(). */ +extern int fprintf (FILE *, const char *, ...); #endif /* Exit status. */ static int exit_status = 0; -static char *default_target = NULL; /* default at runtime */ +static char *default_target = NULL; /* Default at runtime. */ -static int show_version = 0; /* show the version number */ +/* The following variables are set based on arguments passed on the + command line. */ +static int show_version = 0; /* Show the version number. */ static int dump_section_contents; /* -s */ static int dump_section_headers; /* -h */ -static boolean dump_file_header; /* -f */ +static bfd_boolean dump_file_header; /* -f */ static int dump_symtab; /* -t */ static int dump_dynamic_symtab; /* -T */ static int dump_reloc_info; /* -r */ @@ -57,34 +89,51 @@ static int dump_ar_hdrs; /* -a */ static int dump_private_headers; /* -p */ static int prefix_addresses; /* --prefix-addresses */ static int with_line_numbers; /* -l */ -static boolean with_source_code; /* -S */ +static bfd_boolean with_source_code; /* -S */ static int show_raw_insn; /* --show-raw-insn */ static int dump_stab_section_info; /* --stabs */ static int do_demangle; /* -C, --demangle */ -static boolean disassemble; /* -d */ -static boolean disassemble_all; /* -D */ +static bfd_boolean disassemble; /* -d */ +static bfd_boolean disassemble_all; /* -D */ static int disassemble_zeroes; /* --disassemble-zeroes */ -static boolean formats_info; /* -i */ -static char *only; /* -j secname */ +static bfd_boolean formats_info; /* -i */ static int wide_output; /* -w */ static bfd_vma start_address = (bfd_vma) -1; /* --start-address */ static bfd_vma stop_address = (bfd_vma) -1; /* --stop-address */ static int dump_debugging; /* --debugging */ +static int dump_debugging_tags; /* --debugging-tags */ static bfd_vma adjust_section_vma = 0; /* --adjust-vma */ static int file_start_context = 0; /* --file-start-context */ -/* Extra info to pass to the disassembler address printing function. */ -struct objdump_disasm_info { - bfd *abfd; - asection *sec; - boolean require_sec; +/* Pointer to an array of section names provided by + one or more "-j secname" command line options. */ +static char **only; +/* The total number of slots in the only[] array. */ +static size_t only_size = 0; +/* The number of occupied slots in the only[] array. */ +static size_t only_used = 0; + +/* Variables for handling include file path table. */ +static const char **include_paths; +static int include_path_count; + +/* Extra info to pass to the section disassembler and address printing + function. */ +struct objdump_disasm_info +{ + bfd * abfd; + asection * sec; + bfd_boolean require_sec; + arelent ** dynrelbuf; + long dynrelcount; + disassembler_ftype disassemble_fn; }; /* Architecture to disassemble for, or default if NULL. */ -static char *machine = (char *) NULL; +static char *machine = NULL; /* Target specific options to the disassembler. */ -static char *disassembler_options = (char *) NULL; +static char *disassembler_options = NULL; /* Endianness to disassemble for, or default if BFD_ENDIAN_UNKNOWN. */ static enum bfd_endian endian = BFD_ENDIAN_UNKNOWN; @@ -107,60 +156,14 @@ static asymbol **dynsyms; /* Number of symbols in `dynsyms'. */ static long dynsymcount = 0; -/* Static declarations. */ - -static void usage PARAMS ((FILE *, int)); -static void nonfatal PARAMS ((const char *)); -static void display_file PARAMS ((char *filename, char *target)); -static void dump_section_header PARAMS ((bfd *, asection *, PTR)); -static void dump_headers PARAMS ((bfd *)); -static void dump_data PARAMS ((bfd *abfd)); -static void dump_relocs PARAMS ((bfd *abfd)); -static void dump_dynamic_relocs PARAMS ((bfd * abfd)); -static void dump_reloc_set PARAMS ((bfd *, asection *, arelent **, long)); -static void dump_symbols PARAMS ((bfd *abfd, boolean dynamic)); -static void dump_bfd_header PARAMS ((bfd *)); -static void dump_bfd_private_header PARAMS ((bfd *)); -static void dump_bfd PARAMS ((bfd *)); -static void display_bfd PARAMS ((bfd *abfd)); -static void display_target_list PARAMS ((void)); -static void display_info_table PARAMS ((int, int)); -static void display_target_tables PARAMS ((void)); -static void display_info PARAMS ((void)); -static void objdump_print_value - PARAMS ((bfd_vma, struct disassemble_info *, boolean)); -static void objdump_print_symname - PARAMS ((bfd *, struct disassemble_info *, asymbol *)); -static asymbol *find_symbol_for_address - PARAMS ((bfd *, asection *, bfd_vma, boolean, long *)); -static void objdump_print_addr_with_sym - PARAMS ((bfd *, asection *, asymbol *, bfd_vma, - struct disassemble_info *, boolean)); -static void objdump_print_addr - PARAMS ((bfd_vma, struct disassemble_info *, boolean)); -static void objdump_print_address - PARAMS ((bfd_vma, struct disassemble_info *)); -static int objdump_symbol_at_address - PARAMS ((bfd_vma, struct disassemble_info *)); -static void show_line PARAMS ((bfd *, asection *, bfd_vma)); -static void disassemble_bytes - PARAMS ((struct disassemble_info *, disassembler_ftype, boolean, - bfd_byte *, bfd_vma, bfd_vma, arelent ***, arelent **)); -static void disassemble_data PARAMS ((bfd *)); -static const char *endian_string PARAMS ((enum bfd_endian)); -static asymbol ** slurp_symtab PARAMS ((bfd *)); -static asymbol ** slurp_dynamic_symtab PARAMS ((bfd *)); -static long remove_useless_symbols PARAMS ((asymbol **, long)); -static int compare_symbols PARAMS ((const PTR, const PTR)); -static int compare_relocs PARAMS ((const PTR, const PTR)); -static void dump_stabs PARAMS ((bfd *)); -static boolean read_section_stabs PARAMS ((bfd *, const char *, const char *)); -static void print_section_stabs PARAMS ((bfd *, const char *, const char *)); +static bfd_byte *stabs; +static bfd_size_type stab_size; + +static char *strtab; +static bfd_size_type stabstr_size; static void -usage (stream, status) - FILE *stream; - int status; +usage (FILE *stream, int status) { fprintf (stream, _("Usage: %s \n"), program_name); fprintf (stream, _(" Display information from object .\n")); @@ -176,6 +179,7 @@ usage (stream, status) -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\ + -e, --debugging-tags Display debug information using ctags style\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\ @@ -196,14 +200,16 @@ usage (stream, status) -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\ + -I, --include=DIR Add DIR to search list for source files\n\ -l, --line-numbers Include line numbers and filenames in output\n\ -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\ + The STYLE, if specified, can be `auto', `gnu',\n\ + `lucid', `arm', `hp', `edg', `gnu-v3', `java'\n\ + or `gnat'\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=ADDR Only process data whoes address is >= ADDR\n\ - --stop-address=ADDR Only process data whoes address is <= ADDR\n\ + --start-address=ADDR Only process data whose address is >= ADDR\n\ + --stop-address=ADDR Only process data whose address is <= ADDR\n\ --prefix-addresses Print complete address alongside disassembly\n\ --[no-]show-raw-insn Display hex alongside symbolic disassembly\n\ --adjust-vma=OFFSET Add OFFSET to all displayed section addresses\n\ @@ -219,11 +225,13 @@ usage (stream, status) } /* 150 isn't special; it's just an arbitrary non-ASCII char value. */ - -#define OPTION_ENDIAN (150) -#define OPTION_START_ADDRESS (OPTION_ENDIAN + 1) -#define OPTION_STOP_ADDRESS (OPTION_START_ADDRESS + 1) -#define OPTION_ADJUST_VMA (OPTION_STOP_ADDRESS + 1) +enum option_values + { + OPTION_ENDIAN=150, + OPTION_START_ADDRESS, + OPTION_STOP_ADDRESS, + OPTION_ADJUST_VMA + }; static struct option long_options[]= { @@ -233,6 +241,7 @@ static struct option long_options[]= {"architecture", required_argument, NULL, 'm'}, {"archive-headers", no_argument, NULL, 'a'}, {"debugging", no_argument, NULL, 'g'}, + {"debugging-tags", no_argument, NULL, 'e'}, {"demangle", optional_argument, NULL, 'C'}, {"disassemble", no_argument, NULL, 'd'}, {"disassemble-all", no_argument, NULL, 'D'}, @@ -255,6 +264,7 @@ static struct option long_options[]= {"section-headers", no_argument, NULL, 'h'}, {"show-raw-insn", no_argument, &show_raw_insn, 1}, {"source", no_argument, NULL, 'S'}, + {"include", required_argument, NULL, 'I'}, {"stabs", no_argument, NULL, 'G'}, {"start-address", required_argument, NULL, OPTION_START_ADDRESS}, {"stop-address", required_argument, NULL, OPTION_STOP_ADDRESS}, @@ -266,18 +276,15 @@ static struct option long_options[]= }; static void -nonfatal (msg) - const char *msg; +nonfatal (const char *msg) { bfd_nonfatal (msg); exit_status = 1; } static void -dump_section_header (abfd, section, ignored) - bfd *abfd ATTRIBUTE_UNUSED; - asection *section; - PTR ignored ATTRIBUTE_UNUSED; +dump_section_header (bfd *abfd ATTRIBUTE_UNUSED, asection *section, + void *ignored ATTRIBUTE_UNUSED) { char *comma = ""; unsigned int opb = bfd_octets_per_byte (abfd); @@ -352,8 +359,7 @@ dump_section_header (abfd, section, ignored) } static void -dump_headers (abfd) - bfd *abfd; +dump_headers (bfd *abfd) { printf (_("Sections:\n")); @@ -369,21 +375,21 @@ dump_headers (abfd) if (wide_output) printf (_(" Flags")); + if (abfd->flags & HAS_LOAD_PAGE) + printf (_(" Pg")); printf ("\n"); - bfd_map_over_sections (abfd, dump_section_header, (PTR) NULL); + bfd_map_over_sections (abfd, dump_section_header, NULL); } static asymbol ** -slurp_symtab (abfd) - bfd *abfd; +slurp_symtab (bfd *abfd) { - asymbol **sy = (asymbol **) NULL; + asymbol **sy = NULL; long storage; if (!(bfd_get_file_flags (abfd) & HAS_SYMS)) { - non_fatal (_("%s: no symbols"), bfd_get_filename (abfd)); symcount = 0; return NULL; } @@ -392,23 +398,20 @@ slurp_symtab (abfd) if (storage < 0) bfd_fatal (bfd_get_filename (abfd)); if (storage) - sy = (asymbol **) xmalloc (storage); + sy = xmalloc (storage); symcount = bfd_canonicalize_symtab (abfd, sy); if (symcount < 0) bfd_fatal (bfd_get_filename (abfd)); - if (symcount == 0) - non_fatal (_("%s: no symbols"), bfd_get_filename (abfd)); return sy; } /* Read in the dynamic symbols. */ static asymbol ** -slurp_dynamic_symtab (abfd) - bfd *abfd; +slurp_dynamic_symtab (bfd *abfd) { - asymbol **sy = (asymbol **) NULL; + asymbol **sy = NULL; long storage; storage = bfd_get_dynamic_symtab_upper_bound (abfd); @@ -424,13 +427,11 @@ slurp_dynamic_symtab (abfd) bfd_fatal (bfd_get_filename (abfd)); } if (storage) - sy = (asymbol **) xmalloc (storage); + sy = xmalloc (storage); dynsymcount = bfd_canonicalize_dynamic_symtab (abfd, sy); if (dynsymcount < 0) bfd_fatal (bfd_get_filename (abfd)); - if (dynsymcount == 0) - non_fatal (_("%s: No dynamic symbols"), bfd_get_filename (abfd)); return sy; } @@ -439,11 +440,9 @@ slurp_dynamic_symtab (abfd) Return the number of useful symbols. */ static long -remove_useless_symbols (symbols, count) - asymbol **symbols; - long count; +remove_useless_symbols (asymbol **symbols, long count) { - register asymbol **in_ptr = symbols, **out_ptr = symbols; + asymbol **in_ptr = symbols, **out_ptr = symbols; while (--count >= 0) { @@ -465,16 +464,18 @@ remove_useless_symbols (symbols, count) /* Sort symbols into value order. */ static int -compare_symbols (ap, bp) - const PTR ap; - const PTR bp; +compare_symbols (const void *ap, const void *bp) { - const asymbol *a = *(const asymbol **)ap; - const asymbol *b = *(const asymbol **)bp; - const char *an, *bn; - size_t anl, bnl; - boolean af, bf; - flagword aflags, bflags; + const asymbol *a = * (const asymbol **) ap; + const asymbol *b = * (const asymbol **) bp; + const char *an; + const char *bn; + size_t anl; + size_t bnl; + bfd_boolean af; + bfd_boolean bf; + flagword aflags; + flagword bflags; if (bfd_asymbol_value (a) > bfd_asymbol_value (b)) return 1; @@ -493,7 +494,6 @@ compare_symbols (ap, bp) /* The symbols gnu_compiled and gcc2_compiled convey no real information, so put them after other symbols with the same value. */ - af = (strstr (an, "gnu_compiled") != NULL || strstr (an, "gcc2_compiled") != NULL); bf = (strstr (bn, "gnu_compiled") != NULL @@ -573,12 +573,10 @@ compare_symbols (ap, bp) /* Sort relocs into address order. */ static int -compare_relocs (ap, bp) - const PTR ap; - const PTR bp; +compare_relocs (const void *ap, const void *bp) { - const arelent *a = *(const arelent **)ap; - const arelent *b = *(const arelent **)bp; + const arelent *a = * (const arelent **) ap; + const arelent *b = * (const arelent **) bp; if (a->address > b->address) return 1; @@ -595,19 +593,18 @@ compare_relocs (ap, bp) return 0; } -/* Print VMA to STREAM. If SKIP_ZEROES is true, omit leading zeroes. */ +/* Print an address (VMA) to the output stream in INFO. + If SKIP_ZEROES is TRUE, omit leading zeroes. */ static void -objdump_print_value (vma, info, skip_zeroes) - bfd_vma vma; - struct disassemble_info *info; - boolean skip_zeroes; +objdump_print_value (bfd_vma vma, struct disassemble_info *info, + bfd_boolean skip_zeroes) { char buf[30]; char *p; - struct objdump_disasm_info *aux - = (struct objdump_disasm_info *) info->application_data; + struct objdump_disasm_info *aux; + aux = (struct objdump_disasm_info *) info->application_data; bfd_sprintf_vma (aux->abfd, buf, vma); if (! skip_zeroes) p = buf; @@ -624,10 +621,8 @@ objdump_print_value (vma, info, skip_zeroes) /* Print the name of a symbol. */ static void -objdump_print_symname (abfd, info, sym) - bfd *abfd; - struct disassemble_info *info; - asymbol *sym; +objdump_print_symname (bfd *abfd, struct disassemble_info *info, + asymbol *sym) { char *alloc; const char *name; @@ -650,18 +645,16 @@ objdump_print_symname (abfd, info, sym) free (alloc); } -/* Locate a symbol given a bfd, a section, and a VMA. If REQUIRE_SEC - is true, then always require the symbol to be in the section. This - returns NULL if there is no suitable symbol. If PLACE is not NULL, - then *PLACE is set to the index of the symbol in sorted_syms. */ +/* Locate a symbol given a bfd and a section (from INFO->application_data), + and a VMA. If INFO->application_data->require_sec is TRUE, then always + require the symbol to be in the section. Returns NULL if there is no + suitable symbol. If PLACE is not NULL, then *PLACE is set to the index + of the symbol in sorted_syms. */ static asymbol * -find_symbol_for_address (abfd, sec, vma, require_sec, place) - bfd *abfd; - asection *sec; - bfd_vma vma; - boolean require_sec; - long *place; +find_symbol_for_address (bfd_vma vma, + struct disassemble_info *info, + long *place) { /* @@ Would it speed things up to cache the last two symbols returned, and maybe their address ranges? For many processors, only one memory @@ -672,11 +665,19 @@ find_symbol_for_address (abfd, sec, vma, require_sec, place) long min = 0; long max = sorted_symcount; long thisplace; - unsigned int opb = bfd_octets_per_byte (abfd); + struct objdump_disasm_info *aux; + bfd *abfd; + asection *sec; + unsigned int opb; if (sorted_symcount < 1) return NULL; + aux = (struct objdump_disasm_info *) info->application_data; + abfd = aux->abfd; + sec = aux->sec; + opb = bfd_octets_per_byte (abfd); + /* Perform a binary search looking for the closest symbol to the required value. We are searching the range (min, max]. */ while (min + 1 < max) @@ -706,7 +707,7 @@ find_symbol_for_address (abfd, sec, vma, require_sec, place) == bfd_asymbol_value (sorted_syms[thisplace - 1]))) --thisplace; - /* If the file is relocateable, and the symbol could be from this + /* If the file is relocatable, and the symbol could be from this section, prefer a symbol from this section over symbols from others, even if the other symbol's value might be closer. @@ -714,9 +715,8 @@ find_symbol_for_address (abfd, sec, vma, require_sec, place) sections have overlapping memory ranges, but in that case there's no way to tell what's desired without looking at the relocation table. */ - if (sorted_syms[thisplace]->section != sec - && (require_sec + && (aux->require_sec || ((abfd->flags & HAS_RELOC) != 0 && vma >= bfd_get_section_vma (abfd, sec) && vma < (bfd_get_section_vma (abfd, sec) @@ -730,7 +730,9 @@ find_symbol_for_address (abfd, sec, vma, require_sec, place) != bfd_asymbol_value (sorted_syms[thisplace])) break; } + --i; + for (; i >= 0; i--) { if (sorted_syms[i]->section == sec @@ -759,15 +761,22 @@ find_symbol_for_address (abfd, sec, vma, require_sec, place) } if (sorted_syms[thisplace]->section != sec - && (require_sec + && (aux->require_sec || ((abfd->flags & HAS_RELOC) != 0 && vma >= bfd_get_section_vma (abfd, sec) && vma < (bfd_get_section_vma (abfd, sec) + bfd_section_size (abfd, sec))))) - { - /* There is no suitable symbol. */ - return NULL; - } + /* There is no suitable symbol. */ + return NULL; + } + + /* Give the target a chance to reject the symbol. */ + while (! info->symbol_is_valid (sorted_syms [thisplace], info)) + { + ++ thisplace; + if (thisplace >= sorted_symcount + || bfd_asymbol_value (sorted_syms [thisplace]) > vma) + return NULL; } if (place != NULL) @@ -776,16 +785,12 @@ find_symbol_for_address (abfd, sec, vma, require_sec, place) return sorted_syms[thisplace]; } -/* Print an address to INFO symbolically. */ +/* Print an address and the offset to the nearest symbol. */ static void -objdump_print_addr_with_sym (abfd, sec, sym, vma, info, skip_zeroes) - bfd *abfd; - asection *sec; - asymbol *sym; - bfd_vma vma; - struct disassemble_info *info; - boolean skip_zeroes; +objdump_print_addr_with_sym (bfd *abfd, asection *sec, asymbol *sym, + bfd_vma vma, struct disassemble_info *info, + bfd_boolean skip_zeroes) { objdump_print_value (vma, info, skip_zeroes); @@ -799,12 +804,12 @@ objdump_print_addr_with_sym (abfd, sec, sym, vma, info, skip_zeroes) if (vma < secaddr) { (*info->fprintf_func) (info->stream, "-0x"); - objdump_print_value (secaddr - vma, info, true); + objdump_print_value (secaddr - vma, info, TRUE); } else if (vma > secaddr) { (*info->fprintf_func) (info->stream, "+0x"); - objdump_print_value (vma - secaddr, info, true); + objdump_print_value (vma - secaddr, info, TRUE); } (*info->fprintf_func) (info->stream, ">"); } @@ -815,25 +820,24 @@ objdump_print_addr_with_sym (abfd, sec, sym, vma, info, skip_zeroes) if (bfd_asymbol_value (sym) > vma) { (*info->fprintf_func) (info->stream, "-0x"); - objdump_print_value (bfd_asymbol_value (sym) - vma, info, true); + objdump_print_value (bfd_asymbol_value (sym) - vma, info, TRUE); } else if (vma > bfd_asymbol_value (sym)) { (*info->fprintf_func) (info->stream, "+0x"); - objdump_print_value (vma - bfd_asymbol_value (sym), info, true); + objdump_print_value (vma - bfd_asymbol_value (sym), info, TRUE); } (*info->fprintf_func) (info->stream, ">"); } } -/* Print VMA to INFO, symbolically if possible. If SKIP_ZEROES is - true, don't output leading zeroes. */ +/* Print an address (VMA), symbolically if possible. + If SKIP_ZEROES is TRUE, don't output leading zeroes. */ static void -objdump_print_addr (vma, info, skip_zeroes) - bfd_vma vma; - struct disassemble_info *info; - boolean skip_zeroes; +objdump_print_addr (bfd_vma vma, + struct disassemble_info *info, + bfd_boolean skip_zeroes) { struct objdump_disasm_info *aux; asymbol *sym; @@ -846,8 +850,7 @@ objdump_print_addr (vma, info, skip_zeroes) } aux = (struct objdump_disasm_info *) info->application_data; - sym = find_symbol_for_address (aux->abfd, aux->sec, vma, aux->require_sec, - (long *) NULL); + sym = find_symbol_for_address (vma, info, NULL); objdump_print_addr_with_sym (aux->abfd, aux->sec, sym, vma, info, skip_zeroes); } @@ -856,9 +859,7 @@ objdump_print_addr (vma, info, skip_zeroes) routine. */ static void -objdump_print_address (vma, info) - bfd_vma vma; - struct disassemble_info *info; +objdump_print_address (bfd_vma vma, struct disassemble_info *info) { objdump_print_addr (vma, info, ! prefix_addresses); } @@ -866,20 +867,11 @@ objdump_print_address (vma, info) /* Determine of the given address has a symbol associated with it. */ static int -objdump_symbol_at_address (vma, info) - bfd_vma vma; - struct disassemble_info * info; +objdump_symbol_at_address (bfd_vma vma, struct disassemble_info * info) { - struct objdump_disasm_info * aux; asymbol * sym; - /* No symbols - do not bother checking. */ - if (sorted_symcount < 1) - return 0; - - aux = (struct objdump_disasm_info *) info->application_data; - sym = find_symbol_for_address (aux->abfd, aux->sec, vma, aux->require_sec, - (long *) NULL); + sym = find_symbol_for_address (vma, info, NULL); return (sym != NULL && (bfd_asymbol_value (sym) == vma)); } @@ -891,13 +883,14 @@ static char *prev_functionname; static unsigned int prev_line; /* We keep a list of all files that we have seen when doing a - dissassembly with source, so that we know how much of the file to + disassembly with source, so that we know how much of the file to display. This can be important for inlined functions. */ struct print_file_list { struct print_file_list *next; - char *filename; + const char *filename; + const char *modname; unsigned int line; FILE *f; }; @@ -909,17 +902,95 @@ static struct print_file_list *print_files; #define SHOW_PRECEDING_CONTEXT_LINES (5) +/* Tries to open MODNAME, and if successful adds a node to print_files + linked list and returns that node. Returns NULL on failure. */ + +static struct print_file_list * +try_print_file_open (const char *origname, const char *modname) +{ + struct print_file_list *p; + FILE *f; + + f = fopen (modname, "r"); + if (f == NULL) + return NULL; + + if (print_files != NULL && print_files->f != NULL) + { + fclose (print_files->f); + print_files->f = NULL; + } + + p = xmalloc (sizeof (struct print_file_list)); + p->filename = origname; + p->modname = modname; + p->line = 0; + p->f = f; + p->next = print_files; + print_files = p; + return p; +} + +/* If the the source file, as described in the symtab, is not found + try to locate it in one of the paths specified with -I + If found, add location to print_files linked list. */ + +static struct print_file_list * +update_source_path (const char *filename) +{ + struct print_file_list *p; + const char *fname; + int i; + + if (filename == NULL) + return NULL; + + p = try_print_file_open (filename, filename); + if (p != NULL) + return p; + + if (include_path_count == 0) + return NULL; + + /* Get the name of the file. */ + fname = strrchr (filename, '/'); +#ifdef HAVE_DOS_BASED_FILE_SYSTEM + { + /* We could have a mixed forward/back slash case. */ + char *backslash = strrchr (filename, '\\'); + if (fname == NULL || (backslash != NULL && backslash > fname)) + fname = backslash; + if (fname == NULL && filename[0] != '\0' && filename[1] == ':') + fname = filename + 1; + } +#endif + if (fname == NULL) + fname = filename; + else + ++fname; + + /* If file exists under a new path, we need to add it to the list + so that show_line knows about it. */ + for (i = 0; i < include_path_count; i++) + { + char *modname = concat (include_paths[i], "/", fname, (const char *) 0); + + p = try_print_file_open (filename, modname); + if (p) + return p; + + free (modname); + } + + return NULL; +} + /* Skip ahead to a given line in a file, optionally printing each line. */ static void -skip_to_line PARAMS ((struct print_file_list *, unsigned int, boolean)); - -static void -skip_to_line (p, line, show) - struct print_file_list *p; - unsigned int line; - boolean show; +skip_to_line (struct print_file_list *p, unsigned int line, + bfd_boolean show) { while (p->line < line) { @@ -940,14 +1011,11 @@ skip_to_line (p, line, show) } } -/* Show the line number, or the source line, in a dissassembly +/* Show the line number, or the source line, in a disassembly listing. */ static void -show_line (abfd, section, addr_offset) - bfd *abfd; - asection *section; - bfd_vma addr_offset; +show_line (bfd *abfd, asection *section, bfd_vma addr_offset) { const char *filename; const char *functionname; @@ -1014,11 +1082,11 @@ show_line (abfd, section, addr_offset) if (p->f == NULL) { - p->f = fopen (p->filename, "r"); + p->f = fopen (p->modname, "r"); p->line = 0; } if (p->f != NULL) - skip_to_line (p, l, false); + skip_to_line (p, l, FALSE); if (print_files->f != NULL) { @@ -1029,7 +1097,7 @@ show_line (abfd, section, addr_offset) if (p->f != NULL) { - skip_to_line (p, line, true); + skip_to_line (p, line, TRUE); *pp = p->next; p->next = print_files; print_files = p; @@ -1037,37 +1105,21 @@ show_line (abfd, section, addr_offset) } else { - FILE *f; + p = update_source_path (filename); - f = fopen (filename, "r"); - if (f != NULL) + if (p != NULL) { int l; - p = ((struct print_file_list *) - xmalloc (sizeof (struct print_file_list))); - p->filename = xmalloc (strlen (filename) + 1); - strcpy (p->filename, filename); - p->line = 0; - p->f = f; - - if (print_files != NULL && print_files->f != NULL) - { - fclose (print_files->f); - print_files->f = NULL; - } - p->next = print_files; - print_files = p; - if (file_start_context) l = 0; else l = line - SHOW_PRECEDING_CONTEXT_LINES; if (l < 0) l = 0; - skip_to_line (p, l, false); + skip_to_line (p, l, FALSE); if (p->f != NULL) - skip_to_line (p, line, true); + skip_to_line (p, line, TRUE); } } } @@ -1094,17 +1146,16 @@ typedef struct char *current; } SFILE; -/* sprintf to a "stream" */ +/* sprintf to a "stream". */ static int -objdump_sprintf VPARAMS ((SFILE *f, const char *format, ...)) +objdump_sprintf (SFILE *f, const char *format, ...) { char *buf; size_t n; + va_list args; - VA_OPEN (args, format); - VA_FIXEDARG (args, SFILE *, f); - VA_FIXEDARG (args, const char *, format); + va_start (args, format); vasprintf (&buf, format, args); @@ -1132,10 +1183,28 @@ objdump_sprintf VPARAMS ((SFILE *f, const char *format, ...)) free (buf); - VA_CLOSE (args); + va_end (args); return n; } +/* Returns TRUE if the specified section should be dumped. */ + +static bfd_boolean +process_section_p (asection * section) +{ + size_t i; + + if (only == NULL) + return TRUE; + + for (i = 0; i < only_used; i++) + if (strcmp (only [i], section->name) == 0) + return TRUE; + + return FALSE; +} + + /* The number of zeroes we want to see before we start skipping them. The number is arbitrarily chosen. */ @@ -1157,22 +1226,20 @@ objdump_sprintf VPARAMS ((SFILE *f, const char *format, ...)) /* Disassemble some data in memory between given values. */ static void -disassemble_bytes (info, disassemble_fn, insns, data, - start_offset, stop_offset, relppp, - relppend) - struct disassemble_info *info; - disassembler_ftype disassemble_fn; - boolean insns; - bfd_byte *data; - bfd_vma start_offset; - bfd_vma stop_offset; - arelent ***relppp; - arelent **relppend; +disassemble_bytes (struct disassemble_info * info, + disassembler_ftype disassemble_fn, + bfd_boolean insns, + bfd_byte * data, + bfd_vma start_offset, + bfd_vma stop_offset, + bfd_vma rel_offset, + arelent *** relppp, + arelent ** relppend) { struct objdump_disasm_info *aux; asection *section; int octets_per_line; - boolean done_dot; + bfd_boolean done_dot; int skip_addr_chars; bfd_vma addr_offset; int opb = info->octets_per_byte; @@ -1210,16 +1277,16 @@ disassemble_bytes (info, disassemble_fn, insns, data, info->insn_info_valid = 0; - done_dot = false; + done_dot = FALSE; addr_offset = start_offset; while (addr_offset < stop_offset) { bfd_vma z; int octets = 0; - boolean need_nl = false; + bfd_boolean need_nl = FALSE; /* If we see more than SKIP_ZEROES octets of zeroes, we just - print `...'. */ + print `...'. */ for (z = addr_offset * opb; z < stop_offset * opb; z++) if (data[z] != 0) break; @@ -1233,9 +1300,9 @@ disassemble_bytes (info, disassemble_fn, insns, data, printf ("\t...\n"); /* If there are more nonzero octets to follow, we only skip - zeroes in multiples of 4, to try to avoid running over - the start of an instruction which happens to start with - zero. */ + zeroes in multiples of 4, to try to avoid running over + the start of an instruction which happens to start with + zero. */ if (z != stop_offset * opb) z = addr_offset * opb + ((z - addr_offset * opb) &~ 3); @@ -1248,7 +1315,7 @@ disassemble_bytes (info, disassemble_fn, insns, data, int bpc = 0; int pb = 0; - done_dot = false; + done_dot = FALSE; if (with_line_numbers || with_source_code) /* The line number tables will refer to unadjusted @@ -1269,9 +1336,9 @@ disassemble_bytes (info, disassemble_fn, insns, data, } else { - aux->require_sec = true; + aux->require_sec = TRUE; objdump_print_address (section->vma + addr_offset, info); - aux->require_sec = false; + aux->require_sec = FALSE; putchar (' '); } @@ -1287,10 +1354,11 @@ disassemble_bytes (info, disassemble_fn, insns, data, #ifdef DISASSEMBLER_NEEDS_RELOCS /* FIXME: This is wrong. It tests the number of octets - in the last instruction, not the current one. */ + in the last instruction, not the current one. */ if (*relppp < relppend - && (**relppp)->address >= addr_offset - && (**relppp)->address <= addr_offset + octets / opb) + && (**relppp)->address >= rel_offset + addr_offset + && ((**relppp)->address + < rel_offset + addr_offset + octets / opb)) info->flags = INSN_HAS_RELOC; else #endif @@ -1334,7 +1402,7 @@ disassemble_bytes (info, disassemble_fn, insns, data, bfd_vma j; /* If ! prefix_addresses and ! wide_output, we print - octets_per_line octets per line. */ + octets_per_line octets per line. */ pb = octets; if (pb > octets_per_line && ! prefix_addresses && ! wide_output) pb = octets_per_line; @@ -1430,23 +1498,13 @@ disassemble_bytes (info, disassemble_fn, insns, data, if (!wide_output) putchar ('\n'); else - need_nl = true; + need_nl = TRUE; } - if ((section->flags & SEC_RELOC) != 0 -#ifndef DISASSEMBLER_NEEDS_RELOCS - && dump_reloc_info -#endif - ) + while ((*relppp) < relppend + && (**relppp)->address < rel_offset + addr_offset + octets / opb) { - while ((*relppp) < relppend - && ((**relppp)->address >= (bfd_vma) addr_offset - && (**relppp)->address < (bfd_vma) addr_offset + octets / opb)) -#ifdef DISASSEMBLER_NEEDS_RELOCS - if (! dump_reloc_info) - ++(*relppp); - else -#endif + if (dump_reloc_info || dump_dynamic_reloc_info) { arelent *q; @@ -1457,7 +1515,8 @@ disassemble_bytes (info, disassemble_fn, insns, data, else printf ("\t\t\t"); - objdump_print_value (section->vma + q->address, info, true); + objdump_print_value (section->vma - rel_offset + q->address, + info, TRUE); printf (": %s\t", q->howto->name); @@ -1485,13 +1544,13 @@ disassemble_bytes (info, disassemble_fn, insns, data, if (q->addend) { printf ("+0x"); - objdump_print_value (q->addend, info, true); + objdump_print_value (q->addend, info, TRUE); } printf ("\n"); - need_nl = false; - ++(*relppp); + need_nl = FALSE; } + ++(*relppp); } if (need_nl) @@ -1501,18 +1560,235 @@ disassemble_bytes (info, disassemble_fn, insns, data, } } +static void +disassemble_section (bfd *abfd, asection *section, void *info) +{ + struct disassemble_info * pinfo = (struct disassemble_info *) info; + struct objdump_disasm_info * paux; + unsigned int opb = pinfo->octets_per_byte; + bfd_byte * data = NULL; + bfd_size_type datasize = 0; + arelent ** rel_pp = NULL; + arelent ** rel_ppstart = NULL; + arelent ** rel_ppend; + unsigned long stop_offset; + asymbol * sym = NULL; + long place = 0; + long rel_count; + bfd_vma rel_offset; + unsigned long addr_offset; + + /* Sections that do not contain machine + code are not normally disassembled. */ + if (! disassemble_all + && only == NULL + && (section->flags & SEC_CODE) == 0) + return; + + if (! process_section_p (section)) + return; + + datasize = bfd_get_section_size_before_reloc (section); + if (datasize == 0) + return; + + /* Decide which set of relocs to use. Load them if necessary. */ + paux = (struct objdump_disasm_info *) pinfo->application_data; + if (paux->dynrelbuf) + { + rel_pp = paux->dynrelbuf; + rel_count = paux->dynrelcount; + /* Dynamic reloc addresses are absolute, non-dynamic are section + relative. REL_OFFSET specifies the reloc address corresponding + to the start of this section. */ + rel_offset = section->vma; + } + else + { + rel_count = 0; + rel_pp = NULL; + rel_offset = 0; + + if ((section->flags & SEC_RELOC) != 0 +#ifndef DISASSEMBLER_NEEDS_RELOCS + && dump_reloc_info +#endif + ) + { + long relsize; + + relsize = bfd_get_reloc_upper_bound (abfd, section); + if (relsize < 0) + bfd_fatal (bfd_get_filename (abfd)); + + if (relsize > 0) + { + rel_ppstart = rel_pp = xmalloc (relsize); + rel_count = bfd_canonicalize_reloc (abfd, section, rel_pp, syms); + if (rel_count < 0) + bfd_fatal (bfd_get_filename (abfd)); + + /* Sort the relocs by address. */ + qsort (rel_pp, rel_count, sizeof (arelent *), compare_relocs); + } + } + + } + rel_ppend = rel_pp + rel_count; + + data = xmalloc (datasize); + + bfd_get_section_contents (abfd, section, data, 0, datasize); + + paux->sec = section; + pinfo->buffer = data; + pinfo->buffer_vma = section->vma; + pinfo->buffer_length = datasize; + pinfo->section = section; + + if (start_address == (bfd_vma) -1 + || start_address < pinfo->buffer_vma) + addr_offset = 0; + else + addr_offset = start_address - pinfo->buffer_vma; + + if (stop_address == (bfd_vma) -1) + stop_offset = datasize / opb; + else + { + if (stop_address < pinfo->buffer_vma) + stop_offset = 0; + else + stop_offset = stop_address - pinfo->buffer_vma; + if (stop_offset > pinfo->buffer_length / opb) + stop_offset = pinfo->buffer_length / opb; + } + + /* Skip over the relocs belonging to addresses below the + start address. */ + while (rel_pp < rel_ppend + && (*rel_pp)->address < rel_offset + addr_offset) + ++rel_pp; + + printf (_("Disassembly of section %s:\n"), section->name); + + /* Find the nearest symbol forwards from our current position. */ + paux->require_sec = TRUE; + sym = find_symbol_for_address (section->vma + addr_offset, info, &place); + paux->require_sec = FALSE; + + /* Disassemble a block of instructions up to the address associated with + the symbol we have just found. Then print the symbol and find the + next symbol on. Repeat until we have disassembled the entire section + or we have reached the end of the address range we are interested in. */ + while (addr_offset < stop_offset) + { + bfd_vma addr; + asymbol *nextsym; + unsigned long nextstop_offset; + bfd_boolean insns; + + addr = section->vma + addr_offset; + + if (sym != NULL && bfd_asymbol_value (sym) <= addr) + { + int x; + + for (x = place; + (x < sorted_symcount + && (bfd_asymbol_value (sorted_syms[x]) <= addr)); + ++x) + continue; + + pinfo->symbols = sorted_syms + place; + pinfo->num_symbols = x - place; + } + else + { + pinfo->symbols = NULL; + pinfo->num_symbols = 0; + } + + if (! prefix_addresses) + { + pinfo->fprintf_func (pinfo->stream, "\n"); + objdump_print_addr_with_sym (abfd, section, sym, addr, + pinfo, FALSE); + pinfo->fprintf_func (pinfo->stream, ":\n"); + } + + if (sym != NULL && bfd_asymbol_value (sym) > addr) + nextsym = sym; + else if (sym == NULL) + nextsym = NULL; + else + { +#define is_valid_next_sym(SYM) \ + ((SYM)->section == section \ + && (bfd_asymbol_value (SYM) > bfd_asymbol_value (sym)) \ + && pinfo->symbol_is_valid (SYM, pinfo)) + + /* Search forward for the next appropriate symbol in + SECTION. Note that all the symbols are sorted + together into one big array, and that some sections + may have overlapping addresses. */ + while (place < sorted_symcount + && ! is_valid_next_sym (sorted_syms [place])) + ++place; + + if (place >= sorted_symcount) + nextsym = NULL; + else + nextsym = sorted_syms[place]; + } + + if (sym != NULL && bfd_asymbol_value (sym) > addr) + nextstop_offset = bfd_asymbol_value (sym) - section->vma; + else if (nextsym == NULL) + nextstop_offset = stop_offset; + else + nextstop_offset = bfd_asymbol_value (nextsym) - section->vma; + + if (nextstop_offset > stop_offset) + nextstop_offset = stop_offset; + + /* If a symbol is explicitly marked as being an object + rather than a function, just dump the bytes without + disassembling them. */ + if (disassemble_all + || sym == NULL + || bfd_asymbol_value (sym) > addr + || ((sym->flags & BSF_OBJECT) == 0 + && (strstr (bfd_asymbol_name (sym), "gnu_compiled") + == NULL) + && (strstr (bfd_asymbol_name (sym), "gcc2_compiled") + == NULL)) + || (sym->flags & BSF_FUNCTION) != 0) + insns = TRUE; + else + insns = FALSE; + + disassemble_bytes (pinfo, paux->disassemble_fn, insns, data, + addr_offset, nextstop_offset, + rel_offset, &rel_pp, rel_ppend); + + addr_offset = nextstop_offset; + sym = nextsym; + } + + free (data); + + if (rel_ppstart != NULL) + free (rel_ppstart); +} + /* Disassemble the contents of an object file. */ static void -disassemble_data (abfd) - bfd *abfd; +disassemble_data (bfd *abfd) { - unsigned long addr_offset; - disassembler_ftype disassemble_fn; struct disassemble_info disasm_info; struct objdump_disasm_info aux; - asection *section; - unsigned int opb; print_files = NULL; prev_functionname = NULL; @@ -1520,28 +1796,32 @@ disassemble_data (abfd) /* We make a copy of syms to sort. We don't want to sort syms because that will screw up the relocs. */ - sorted_syms = (asymbol **) xmalloc (symcount * sizeof (asymbol *)); + sorted_syms = xmalloc (symcount * sizeof (asymbol *)); memcpy (sorted_syms, syms, symcount * sizeof (asymbol *)); sorted_symcount = remove_useless_symbols (sorted_syms, symcount); - /* Sort the symbols into section and symbol order */ + /* Sort the symbols into section and symbol order. */ qsort (sorted_syms, sorted_symcount, sizeof (asymbol *), compare_symbols); - INIT_DISASSEMBLE_INFO(disasm_info, stdout, fprintf); - disasm_info.application_data = (PTR) &aux; + init_disassemble_info (&disasm_info, stdout, (fprintf_ftype) fprintf); + + disasm_info.application_data = (void *) &aux; aux.abfd = abfd; - aux.require_sec = false; + aux.require_sec = FALSE; + aux.dynrelbuf = NULL; + aux.dynrelcount = 0; + disasm_info.print_address_func = objdump_print_address; disasm_info.symbol_at_address_func = objdump_symbol_at_address; - if (machine != (char *) NULL) + if (machine != NULL) { const bfd_arch_info_type *info = bfd_scan_arch (machine); + if (info == NULL) - { - fatal (_("Can't use supplied machine %s"), machine); - } + fatal (_("Can't use supplied machine %s"), machine); + abfd->arch_info = info; } @@ -1549,14 +1829,15 @@ disassemble_data (abfd) { struct bfd_target *xvec; - xvec = (struct bfd_target *) xmalloc (sizeof (struct bfd_target)); + xvec = xmalloc (sizeof (struct bfd_target)); memcpy (xvec, abfd->xvec, sizeof (struct bfd_target)); xvec->byteorder = endian; abfd->xvec = xvec; } - disassemble_fn = disassembler (abfd); - if (!disassemble_fn) + /* Use libopcodes to locate a suitable disassembler. */ + aux.disassemble_fn = disassembler (abfd); + if (!aux.disassemble_fn) { non_fatal (_("Can't disassemble for architecture %s\n"), bfd_printable_arch_mach (bfd_get_arch (abfd), 0)); @@ -1564,13 +1845,11 @@ disassemble_data (abfd) return; } - opb = bfd_octets_per_byte (abfd); - disasm_info.flavour = bfd_get_flavour (abfd); disasm_info.arch = bfd_get_arch (abfd); disasm_info.mach = bfd_get_mach (abfd); disasm_info.disassembler_options = disassembler_options; - disasm_info.octets_per_byte = opb; + disasm_info.octets_per_byte = bfd_octets_per_byte (abfd); if (bfd_big_endian (abfd)) disasm_info.display_endian = disasm_info.endian = BFD_ENDIAN_BIG; @@ -1581,315 +1860,105 @@ disassemble_data (abfd) instead. */ disasm_info.endian = BFD_ENDIAN_UNKNOWN; - for (section = abfd->sections; - section != (asection *) NULL; - section = section->next) + /* Allow the target to customize the info structure. */ + disassemble_init_for_target (& disasm_info); + + /* Pre-load the dynamic relocs if we are going + to be dumping them along with the disassembly. */ + if (dump_dynamic_reloc_info) { - bfd_byte *data = NULL; - bfd_size_type datasize = 0; - arelent **relbuf = NULL; - arelent **relpp = NULL; - arelent **relppend = NULL; - unsigned long stop_offset; - asymbol *sym = NULL; - long place = 0; - - if ((section->flags & SEC_LOAD) == 0 - || (! disassemble_all - && only == NULL - && (section->flags & SEC_CODE) == 0)) - continue; - if (only != (char *) NULL && strcmp (only, section->name) != 0) - continue; + long relsize = bfd_get_dynamic_reloc_upper_bound (abfd); + + if (relsize < 0) + bfd_fatal (bfd_get_filename (abfd)); - if ((section->flags & SEC_RELOC) != 0 -#ifndef DISASSEMBLER_NEEDS_RELOCS - && dump_reloc_info -#endif - ) + if (relsize > 0) { - long relsize; - - relsize = bfd_get_reloc_upper_bound (abfd, section); - if (relsize < 0) + aux.dynrelbuf = xmalloc (relsize); + aux.dynrelcount = bfd_canonicalize_dynamic_reloc (abfd, + aux.dynrelbuf, + dynsyms); + if (aux.dynrelcount < 0) bfd_fatal (bfd_get_filename (abfd)); - if (relsize > 0) - { - long relcount; + /* Sort the relocs by address. */ + qsort (aux.dynrelbuf, aux.dynrelcount, sizeof (arelent *), + compare_relocs); + } + } - relbuf = (arelent **) xmalloc (relsize); - relcount = bfd_canonicalize_reloc (abfd, section, relbuf, syms); - if (relcount < 0) - bfd_fatal (bfd_get_filename (abfd)); + bfd_map_over_sections (abfd, disassemble_section, & disasm_info); - /* Sort the relocs by address. */ - qsort (relbuf, relcount, sizeof (arelent *), compare_relocs); + if (aux.dynrelbuf != NULL) + free (aux.dynrelbuf); + free (sorted_syms); +} + +/* Read ABFD's stabs section STABSECT_NAME, and return a pointer to + it. Return NULL on failure. */ - relpp = relbuf; - relppend = relpp + relcount; +static char * +read_section_stabs (bfd *abfd, const char *sect_name, bfd_size_type *size_ptr) +{ + asection *stabsect; + bfd_size_type size; + char *contents; - /* Skip over the relocs belonging to addresses below the - start address. */ - if (start_address != (bfd_vma) -1) - { - while (relpp < relppend - && (*relpp)->address < start_address) - ++relpp; - } - } - } + stabsect = bfd_get_section_by_name (abfd, sect_name); + if (stabsect == NULL) + { + printf (_("No %s section present\n\n"), sect_name); + return FALSE; + } - printf (_("Disassembly of section %s:\n"), section->name); + size = bfd_section_size (abfd, stabsect); + contents = xmalloc (size); - datasize = bfd_get_section_size_before_reloc (section); - if (datasize == 0) - continue; + if (! bfd_get_section_contents (abfd, stabsect, contents, 0, size)) + { + non_fatal (_("Reading %s section of %s failed: %s"), + sect_name, bfd_get_filename (abfd), + bfd_errmsg (bfd_get_error ())); + free (contents); + exit_status = 1; + return NULL; + } - data = (bfd_byte *) xmalloc ((size_t) datasize); + *size_ptr = size; - bfd_get_section_contents (abfd, section, data, 0, datasize); + return contents; +} - aux.sec = section; - disasm_info.buffer = data; - disasm_info.buffer_vma = section->vma; - disasm_info.buffer_length = datasize; - disasm_info.section = section; - if (start_address == (bfd_vma) -1 - || start_address < disasm_info.buffer_vma) - addr_offset = 0; - else - addr_offset = start_address - disasm_info.buffer_vma; - if (stop_address == (bfd_vma) -1) - stop_offset = datasize / opb; - else - { - if (stop_address < disasm_info.buffer_vma) - stop_offset = 0; - else - stop_offset = stop_address - disasm_info.buffer_vma; - if (stop_offset > disasm_info.buffer_length / opb) - stop_offset = disasm_info.buffer_length / opb; - } +/* Stabs entries use a 12 byte format: + 4 byte string table index + 1 byte stab type + 1 byte stab other field + 2 byte stab desc field + 4 byte stab value + FIXME: This will have to change for a 64 bit object format. */ - sym = find_symbol_for_address (abfd, section, section->vma + addr_offset, - true, &place); +#define STRDXOFF (0) +#define TYPEOFF (4) +#define OTHEROFF (5) +#define DESCOFF (6) +#define VALOFF (8) +#define STABSIZE (12) - while (addr_offset < stop_offset) - { - asymbol *nextsym; - unsigned long nextstop_offset; - boolean insns; +/* Print ABFD's stabs section STABSECT_NAME (in `stabs'), + using string table section STRSECT_NAME (in `strtab'). */ - if (sym != NULL && bfd_asymbol_value (sym) <= section->vma + addr_offset) - { - int x; - - for (x = place; - (x < sorted_symcount - && bfd_asymbol_value (sorted_syms[x]) <= section->vma + addr_offset); - ++x) - continue; - disasm_info.symbols = & sorted_syms[place]; - disasm_info.num_symbols = x - place; - } - else - disasm_info.symbols = NULL; +static void +print_section_stabs (bfd *abfd, + const char *stabsect_name, + unsigned *string_offset_ptr) +{ + int i; + unsigned file_string_table_offset = 0; + unsigned next_file_string_table_offset = *string_offset_ptr; + bfd_byte *stabp, *stabs_end; - if (! prefix_addresses) - { - printf ("\n"); - objdump_print_addr_with_sym (abfd, section, sym, - section->vma + addr_offset, - &disasm_info, - false); - printf (":\n"); - } - - if (sym != NULL && bfd_asymbol_value (sym) > section->vma + addr_offset) - nextsym = sym; - else if (sym == NULL) - nextsym = NULL; - else - { - /* Search forward for the next appropriate symbol in - SECTION. Note that all the symbols are sorted - together into one big array, and that some sections - may have overlapping addresses. */ - while (place < sorted_symcount - && (sorted_syms[place]->section != section - || (bfd_asymbol_value (sorted_syms[place]) - <= bfd_asymbol_value (sym)))) - ++place; - if (place >= sorted_symcount) - nextsym = NULL; - else - nextsym = sorted_syms[place]; - } - - if (sym != NULL && bfd_asymbol_value (sym) > section->vma + addr_offset) - { - nextstop_offset = bfd_asymbol_value (sym) - section->vma; - if (nextstop_offset > stop_offset) - nextstop_offset = stop_offset; - } - else if (nextsym == NULL) - nextstop_offset = stop_offset; - else - { - nextstop_offset = bfd_asymbol_value (nextsym) - section->vma; - if (nextstop_offset > stop_offset) - nextstop_offset = stop_offset; - } - - /* If a symbol is explicitly marked as being an object - rather than a function, just dump the bytes without - disassembling them. */ - if (disassemble_all - || sym == NULL - || bfd_asymbol_value (sym) > section->vma + addr_offset - || ((sym->flags & BSF_OBJECT) == 0 - && (strstr (bfd_asymbol_name (sym), "gnu_compiled") - == NULL) - && (strstr (bfd_asymbol_name (sym), "gcc2_compiled") - == NULL)) - || (sym->flags & BSF_FUNCTION) != 0) - insns = true; - else - insns = false; - - disassemble_bytes (&disasm_info, disassemble_fn, insns, data, - addr_offset, nextstop_offset, &relpp, relppend); - - addr_offset = nextstop_offset; - sym = nextsym; - } - - free (data); - if (relbuf != NULL) - free (relbuf); - } - free (sorted_syms); -} - - -/* Define a table of stab values and print-strings. We wish the initializer - could be a direct-mapped table, but instead we build one the first - time we need it. */ - -static void dump_section_stabs PARAMS ((bfd *abfd, char *stabsect_name, - char *strsect_name)); - -/* Dump the stabs sections from an object file that has a section that - uses Sun stabs encoding. */ - -static void -dump_stabs (abfd) - bfd *abfd; -{ - dump_section_stabs (abfd, ".stab", ".stabstr"); - dump_section_stabs (abfd, ".stab.excl", ".stab.exclstr"); - dump_section_stabs (abfd, ".stab.index", ".stab.indexstr"); - dump_section_stabs (abfd, "$GDB_SYMBOLS$", "$GDB_STRINGS$"); -} - -static bfd_byte *stabs; -static bfd_size_type stab_size; - -static char *strtab; -static bfd_size_type stabstr_size; - -/* Read ABFD's stabs section STABSECT_NAME into `stabs' - and string table section STRSECT_NAME into `strtab'. - If the section exists and was read, allocate the space and return true. - Otherwise return false. */ - -static boolean -read_section_stabs (abfd, stabsect_name, strsect_name) - bfd *abfd; - const char *stabsect_name; - const char *strsect_name; -{ - asection *stabsect, *stabstrsect; - - stabsect = bfd_get_section_by_name (abfd, stabsect_name); - if (0 == stabsect) - { - printf (_("No %s section present\n\n"), stabsect_name); - return false; - } - - stabstrsect = bfd_get_section_by_name (abfd, strsect_name); - if (0 == stabstrsect) - { - non_fatal (_("%s has no %s section"), - bfd_get_filename (abfd), strsect_name); - exit_status = 1; - return false; - } - - stab_size = bfd_section_size (abfd, stabsect); - stabstr_size = bfd_section_size (abfd, stabstrsect); - - stabs = (bfd_byte *) xmalloc (stab_size); - strtab = (char *) xmalloc (stabstr_size); - - if (! bfd_get_section_contents (abfd, stabsect, (PTR) stabs, 0, stab_size)) - { - non_fatal (_("Reading %s section of %s failed: %s"), - stabsect_name, bfd_get_filename (abfd), - bfd_errmsg (bfd_get_error ())); - free (stabs); - free (strtab); - exit_status = 1; - return false; - } - - if (! bfd_get_section_contents (abfd, stabstrsect, (PTR) strtab, 0, - stabstr_size)) - { - non_fatal (_("Reading %s section of %s failed: %s\n"), - strsect_name, bfd_get_filename (abfd), - bfd_errmsg (bfd_get_error ())); - free (stabs); - free (strtab); - exit_status = 1; - return false; - } - - return true; -} - -/* Stabs entries use a 12 byte format: - 4 byte string table index - 1 byte stab type - 1 byte stab other field - 2 byte stab desc field - 4 byte stab value - FIXME: This will have to change for a 64 bit object format. */ - -#define STRDXOFF (0) -#define TYPEOFF (4) -#define OTHEROFF (5) -#define DESCOFF (6) -#define VALOFF (8) -#define STABSIZE (12) - -/* Print ABFD's stabs section STABSECT_NAME (in `stabs'), - using string table section STRSECT_NAME (in `strtab'). */ - -static void -print_section_stabs (abfd, stabsect_name, strsect_name) - bfd *abfd; - const char *stabsect_name; - const char *strsect_name ATTRIBUTE_UNUSED; -{ - int i; - unsigned file_string_table_offset = 0, next_file_string_table_offset = 0; - bfd_byte *stabp, *stabs_end; - - stabp = stabs; - stabs_end = stabp + stab_size; + stabp = stabs; + stabs_end = stabp + stab_size; printf (_("Contents of %s section:\n\n"), stabsect_name); printf ("Symnum n_type n_othr n_desc n_value n_strx String\n"); @@ -1898,7 +1967,6 @@ print_section_stabs (abfd, stabsect_name, strsect_name) We start the index at -1 because there is a dummy symbol on the front of stabs-in-{coff,elf} sections that supplies sizes. */ - for (i = -1; stabp < stabs_end; stabp += STABSIZE, i++) { const char *name; @@ -1930,7 +1998,6 @@ print_section_stabs (abfd, stabsect_name, strsect_name) /* Symbols with type == 0 (N_UNDF) specify the length of the string table associated with this file. We use that info to know how to relocate the *next* file's string table indices. */ - if (type == N_UNDF) { file_string_table_offset = next_file_string_table_offset; @@ -1940,7 +2007,6 @@ print_section_stabs (abfd, stabsect_name, strsect_name) { /* Using the (possibly updated) string table offset, print the string (if any) associated with this symbol. */ - if ((strx + file_string_table_offset) < stabstr_size) printf (" %s", &strtab[strx + file_string_table_offset]); else @@ -1948,46 +2014,75 @@ print_section_stabs (abfd, stabsect_name, strsect_name) } } printf ("\n\n"); + *string_offset_ptr = next_file_string_table_offset; } +typedef struct +{ + const char * section_name; + const char * string_section_name; + unsigned string_offset; +} +stab_section_names; + static void -dump_section_stabs (abfd, stabsect_name, strsect_name) - bfd *abfd; - char *stabsect_name; - char *strsect_name; +find_stabs_section (bfd *abfd, asection *section, void *names) { - asection *s; + int len; + stab_section_names * sought = (stab_section_names *) names; /* Check for section names for which stabsect_name is a prefix, to - handle .stab0, etc. */ - for (s = abfd->sections; - s != NULL; - s = s->next) + handle .stab.N, etc. */ + len = strlen (sought->section_name); + + /* If the prefix matches, and the files section name ends with a + nul or a digit, then we match. I.e., we want either an exact + match or a section followed by a number. */ + if (strncmp (sought->section_name, section->name, len) == 0 + && (section->name[len] == 0 + || (section->name[len] == '.' && ISDIGIT (section->name[len + 1])))) { - int len; - - len = strlen (stabsect_name); - - /* If the prefix matches, and the files section name ends with a - nul or a digit, then we match. I.e., we want either an exact - match or a section followed by a number. */ - if (strncmp (stabsect_name, s->name, len) == 0 - && (s->name[len] == '\000' - || ISDIGIT (s->name[len]))) + if (strtab == NULL) + strtab = read_section_stabs (abfd, sought->string_section_name, + &stabstr_size); + + if (strtab) { - if (read_section_stabs (abfd, s->name, strsect_name)) - { - print_section_stabs (abfd, s->name, strsect_name); - free (stabs); - free (strtab); - } + stabs = read_section_stabs (abfd, section->name, &stab_size); + if (stabs) + print_section_stabs (abfd, section->name, &sought->string_offset); } } } + +static void +dump_stabs_section (bfd *abfd, char *stabsect_name, char *strsect_name) +{ + stab_section_names s; + + s.section_name = stabsect_name; + s.string_section_name = strsect_name; + s.string_offset = 0; + + bfd_map_over_sections (abfd, find_stabs_section, & s); + + free (strtab); + strtab = NULL; +} + +/* Dump the any sections containing stabs debugging information. */ + +static void +dump_stabs (bfd *abfd) +{ + dump_stabs_section (abfd, ".stab", ".stabstr"); + dump_stabs_section (abfd, ".stab.excl", ".stab.exclstr"); + dump_stabs_section (abfd, ".stab.index", ".stab.indexstr"); + dump_stabs_section (abfd, "$GDB_SYMBOLS$", "$GDB_STRINGS$"); +} static void -dump_bfd_header (abfd) - bfd *abfd; +dump_bfd_header (bfd *abfd) { char *comma = ""; @@ -2007,438 +2102,216 @@ dump_bfd_header (abfd) PF (WP_TEXT, "WP_TEXT"); PF (D_PAGED, "D_PAGED"); PF (BFD_IS_RELAXABLE, "BFD_IS_RELAXABLE"); + PF (HAS_LOAD_PAGE, "HAS_LOAD_PAGE"); printf (_("\nstart address 0x")); bfd_printf_vma (abfd, abfd->start_address); printf ("\n"); } + static void -dump_bfd_private_header (abfd) -bfd *abfd; +dump_bfd_private_header (bfd *abfd) { bfd_print_private_bfd_data (abfd, stdout); } -/* Dump selected contents of ABFD */ - -static void -dump_bfd (abfd) - bfd *abfd; -{ - /* If we are adjusting section VMA's, change them all now. Changing - the BFD information is a hack. However, we must do it, or - bfd_find_nearest_line will not do the right thing. */ - if (adjust_section_vma != 0) - { - asection *s; - - for (s = abfd->sections; s != NULL; s = s->next) - { - s->vma += adjust_section_vma; - s->lma += adjust_section_vma; - } - } - - printf (_("\n%s: file format %s\n"), bfd_get_filename (abfd), - abfd->xvec->name); - if (dump_ar_hdrs) - print_arelt_descr (stdout, abfd, true); - if (dump_file_header) - dump_bfd_header (abfd); - if (dump_private_headers) - dump_bfd_private_header (abfd); - putchar ('\n'); - if (dump_section_headers) - dump_headers (abfd); - if (dump_symtab || dump_reloc_info || disassemble || dump_debugging) - { - syms = slurp_symtab (abfd); - } - if (dump_dynamic_symtab || dump_dynamic_reloc_info) - { - dynsyms = slurp_dynamic_symtab (abfd); - } - if (dump_symtab) - dump_symbols (abfd, false); - if (dump_dynamic_symtab) - dump_symbols (abfd, true); - if (dump_stab_section_info) - dump_stabs (abfd); - if (dump_reloc_info && ! disassemble) - dump_relocs (abfd); - if (dump_dynamic_reloc_info) - dump_dynamic_relocs (abfd); - if (dump_section_contents) - dump_data (abfd); - if (disassemble) - disassemble_data (abfd); - if (dump_debugging) - { - PTR dhandle; - - dhandle = read_debugging_info (abfd, syms, symcount); - if (dhandle != NULL) - { - if (! print_debugging_info (stdout, dhandle)) - { - non_fatal (_("%s: printing debugging information failed"), - bfd_get_filename (abfd)); - exit_status = 1; - } - } - } - if (syms) - { - free (syms); - syms = NULL; - } - if (dynsyms) - { - free (dynsyms); - dynsyms = NULL; - } -} - -static void -display_bfd (abfd) - bfd *abfd; -{ - char **matching; - - if (bfd_check_format_matches (abfd, bfd_object, &matching)) - { - dump_bfd (abfd); - return; - } - - if (bfd_get_error () == bfd_error_file_ambiguously_recognized) - { - nonfatal (bfd_get_filename (abfd)); - list_matching_formats (matching); - free (matching); - return; - } - - if (bfd_get_error () != bfd_error_file_not_recognized) - { - nonfatal (bfd_get_filename (abfd)); - return; - } - - if (bfd_check_format_matches (abfd, bfd_core, &matching)) - { - dump_bfd (abfd); - return; - } - - nonfatal (bfd_get_filename (abfd)); - - if (bfd_get_error () == bfd_error_file_ambiguously_recognized) - { - list_matching_formats (matching); - free (matching); - } -} - -static void -display_file (filename, target) - char *filename; - char *target; -{ - bfd *file, *arfile = (bfd *) NULL; - - file = bfd_openr (filename, target); - if (file == NULL) - { - nonfatal (filename); - return; - } - - if (bfd_check_format (file, bfd_archive) == true) - { - bfd *last_arfile = NULL; - - printf (_("In archive %s:\n"), bfd_get_filename (file)); - for (;;) - { - bfd_set_error (bfd_error_no_error); - - arfile = bfd_openr_next_archived_file (file, arfile); - if (arfile == NULL) - { - if (bfd_get_error () != bfd_error_no_more_archived_files) - nonfatal (bfd_get_filename (file)); - break; - } - - display_bfd (arfile); - - if (last_arfile != NULL) - bfd_close (last_arfile); - last_arfile = arfile; - } - - if (last_arfile != NULL) - bfd_close (last_arfile); - } - else - display_bfd (file); - - bfd_close (file); -} -/* Actually display the various requested regions */ +/* Display a section in hexadecimal format with associated characters. + Each line prefixed by the zero padded address. */ static void -dump_data (abfd) - bfd *abfd; +dump_section (bfd *abfd, asection *section, void *dummy ATTRIBUTE_UNUSED) { - asection *section; bfd_byte *data = 0; - bfd_size_type datasize = 0; + bfd_size_type datasize; bfd_size_type addr_offset; - bfd_size_type start_offset, stop_offset; + bfd_size_type start_offset; + bfd_size_type stop_offset; unsigned int opb = bfd_octets_per_byte (abfd); + /* Bytes per line. */ + const int onaline = 16; + char buf[64]; + int count; + int width; - for (section = abfd->sections; section != NULL; section = - section->next) - { - int onaline = 16; - - if (only == (char *) NULL || - strcmp (only, section->name) == 0) - { - if (section->flags & SEC_HAS_CONTENTS) - { - printf (_("Contents of section %s:\n"), section->name); - - if (bfd_section_size (abfd, section) == 0) - continue; - data = (bfd_byte *) xmalloc ((size_t) bfd_section_size (abfd, section)); - datasize = bfd_section_size (abfd, section); - + if ((section->flags & SEC_HAS_CONTENTS) == 0) + return; - bfd_get_section_contents (abfd, section, (PTR) data, 0, bfd_section_size (abfd, section)); + if (! process_section_p (section)) + return; + + if ((datasize = bfd_section_size (abfd, section)) == 0) + return; - if (start_address == (bfd_vma) -1 - || start_address < section->vma) - start_offset = 0; - else - start_offset = start_address - section->vma; - if (stop_address == (bfd_vma) -1) - stop_offset = bfd_section_size (abfd, section) / opb; - else - { - if (stop_address < section->vma) - stop_offset = 0; - else - stop_offset = stop_address - section->vma; - if (stop_offset > bfd_section_size (abfd, section) / opb) - stop_offset = bfd_section_size (abfd, section) / opb; - } - for (addr_offset = start_offset; - addr_offset < stop_offset; addr_offset += onaline / opb) - { - bfd_size_type j; + printf (_("Contents of section %s:\n"), section->name); - printf (" %04lx ", (unsigned long int) - (addr_offset + section->vma)); - for (j = addr_offset * opb; - j < addr_offset * opb + onaline; j++) - { - if (j < stop_offset * opb) - printf ("%02x", (unsigned) (data[j])); - else - printf (" "); - if ((j & 3) == 3) - printf (" "); - } - - printf (" "); - for (j = addr_offset * opb; - j < addr_offset * opb + onaline; j++) - { - if (j >= stop_offset * opb) - printf (" "); - else - printf ("%c", ISPRINT (data[j]) ? data[j] : '.'); - } - putchar ('\n'); - } - free (data); - } - } - } -} + data = xmalloc (datasize); -/* Should perhaps share code and display with nm? */ -static void -dump_symbols (abfd, dynamic) - bfd *abfd ATTRIBUTE_UNUSED; - boolean dynamic; -{ - asymbol **current; - long max; - long count; + bfd_get_section_contents (abfd, section, data, 0, datasize); - if (dynamic) - { - current = dynsyms; - max = dynsymcount; - if (max == 0) - return; - printf ("DYNAMIC SYMBOL TABLE:\n"); - } + /* Compute the address range to display. */ + if (start_address == (bfd_vma) -1 + || start_address < section->vma) + start_offset = 0; else - { - current = syms; - max = symcount; - if (max == 0) - return; - printf ("SYMBOL TABLE:\n"); - } + start_offset = start_address - section->vma; - for (count = 0; count < max; count++) + if (stop_address == (bfd_vma) -1) + stop_offset = datasize / opb; + else { - if (*current) - { - bfd *cur_bfd = bfd_asymbol_bfd (*current); - - if (cur_bfd != NULL) - { - const char *name; - char *alloc; + if (stop_address < section->vma) + stop_offset = 0; + else + stop_offset = stop_address - section->vma; - name = (*current)->name; - alloc = NULL; - if (do_demangle && name != NULL && *name != '\0') - { - /* If we want to demangle the name, we demangle it - here, and temporarily clobber it while calling - bfd_print_symbol. FIXME: This is a gross hack. */ + if (stop_offset > datasize / opb) + stop_offset = datasize / opb; + } - alloc = demangle (cur_bfd, name); - (*current)->name = alloc; - } + width = 4; - bfd_print_symbol (cur_bfd, stdout, *current, - bfd_print_symbol_all); + bfd_sprintf_vma (abfd, buf, start_offset + section->vma); + if (strlen (buf) >= sizeof (buf)) + abort (); - (*current)->name = name; - if (alloc != NULL) - free (alloc); + count = 0; + while (buf[count] == '0' && buf[count+1] != '\0') + count++; + count = strlen (buf) - count; + if (count > width) + width = count; - printf ("\n"); - } - } - current++; - } - printf ("\n"); - printf ("\n"); -} + bfd_sprintf_vma (abfd, buf, stop_offset + section->vma - 1); + if (strlen (buf) >= sizeof (buf)) + abort (); -static void -dump_relocs (abfd) - bfd *abfd; -{ - arelent **relpp; - long relcount; - asection *a; + count = 0; + while (buf[count] == '0' && buf[count+1] != '\0') + count++; + count = strlen (buf) - count; + if (count > width) + width = count; - for (a = abfd->sections; a != (asection *) NULL; a = a->next) + for (addr_offset = start_offset; + addr_offset < stop_offset; addr_offset += onaline / opb) { - long relsize; + bfd_size_type j; - if (bfd_is_abs_section (a)) - continue; - if (bfd_is_und_section (a)) - continue; - if (bfd_is_com_section (a)) - continue; + bfd_sprintf_vma (abfd, buf, (addr_offset + section->vma)); + count = strlen (buf); + if ((size_t) count >= sizeof (buf)) + abort (); - if (only) + putchar (' '); + while (count < width) { - if (strcmp (only, a->name)) - continue; + putchar ('0'); + count++; } - else if ((a->flags & SEC_RELOC) == 0) - continue; + fputs (buf + count - width, stdout); + putchar (' '); - relsize = bfd_get_reloc_upper_bound (abfd, a); - if (relsize < 0) - bfd_fatal (bfd_get_filename (abfd)); - - printf ("RELOCATION RECORDS FOR [%s]:", a->name); - - if (relsize == 0) + for (j = addr_offset * opb; + j < addr_offset * opb + onaline; j++) { - printf (" (none)\n\n"); - } - else - { - relpp = (arelent **) xmalloc (relsize); - relcount = bfd_canonicalize_reloc (abfd, a, relpp, syms); - if (relcount < 0) - bfd_fatal (bfd_get_filename (abfd)); - else if (relcount == 0) - { - printf (" (none)\n\n"); - } + if (j < stop_offset * opb) + printf ("%02x", (unsigned) (data[j])); else - { - printf ("\n"); - dump_reloc_set (abfd, a, relpp, relcount); - printf ("\n\n"); - } - free (relpp); + printf (" "); + if ((j & 3) == 3) + printf (" "); + } + + printf (" "); + for (j = addr_offset * opb; + j < addr_offset * opb + onaline; j++) + { + if (j >= stop_offset * opb) + printf (" "); + else + printf ("%c", ISPRINT (data[j]) ? data[j] : '.'); } + putchar ('\n'); } + free (data); } +/* Actually display the various requested regions. */ + static void -dump_dynamic_relocs (abfd) - bfd *abfd; +dump_data (bfd *abfd) { - long relsize; - arelent **relpp; - long relcount; + bfd_map_over_sections (abfd, dump_section, NULL); +} - relsize = bfd_get_dynamic_reloc_upper_bound (abfd); - if (relsize < 0) - bfd_fatal (bfd_get_filename (abfd)); +/* Should perhaps share code and display with nm? */ - printf ("DYNAMIC RELOCATION RECORDS"); +static void +dump_symbols (bfd *abfd ATTRIBUTE_UNUSED, bfd_boolean dynamic) +{ + asymbol **current; + long max; + long count; - if (relsize == 0) + if (dynamic) { - printf (" (none)\n\n"); + current = dynsyms; + max = dynsymcount; + printf ("DYNAMIC SYMBOL TABLE:\n"); } else { - relpp = (arelent **) xmalloc (relsize); - relcount = bfd_canonicalize_dynamic_reloc (abfd, relpp, dynsyms); - if (relcount < 0) - bfd_fatal (bfd_get_filename (abfd)); - else if (relcount == 0) - { - printf (" (none)\n\n"); - } + current = syms; + max = symcount; + printf ("SYMBOL TABLE:\n"); + } + + if (max == 0) + printf (_("no symbols\n")); + + for (count = 0; count < max; count++) + { + bfd *cur_bfd; + + if (*current == NULL) + printf (_("no information for the %ld'th symbol"), count); + + else if ((cur_bfd = bfd_asymbol_bfd (*current)) == NULL) + printf (_("could not determine the type of the %ld'th symbol"), + count); + else { - printf ("\n"); - dump_reloc_set (abfd, (asection *) NULL, relpp, relcount); - printf ("\n\n"); + const char *name = (*current)->name; + + if (do_demangle && name != NULL && *name != '\0') + { + char *alloc; + + /* If we want to demangle the name, we demangle it + here, and temporarily clobber it while calling + bfd_print_symbol. FIXME: This is a gross hack. */ + alloc = demangle (cur_bfd, name); + (*current)->name = alloc; + bfd_print_symbol (cur_bfd, stdout, *current, + bfd_print_symbol_all); + (*current)->name = name; + free (alloc); + } + else + bfd_print_symbol (cur_bfd, stdout, *current, + bfd_print_symbol_all); } - free (relpp); + + printf ("\n"); + current++; } + printf ("\n\n"); } - + static void -dump_reloc_set (abfd, sec, relpp, relcount) - bfd *abfd; - asection *sec; - arelent **relpp; - long relcount; +dump_reloc_set (bfd *abfd, asection *sec, arelent **relpp, long relcount) { arelent **p; char *last_filename, *last_functionname; @@ -2447,9 +2320,11 @@ dump_reloc_set (abfd, sec, relpp, relcount) /* Get column headers lined up reasonably. */ { static int width; + if (width == 0) { char buf[30]; + bfd_sprintf_vma (abfd, buf, (bfd_vma) -1); width = strlen (buf) - 7; } @@ -2460,7 +2335,7 @@ dump_reloc_set (abfd, sec, relpp, relcount) last_functionname = NULL; last_line = 0; - for (p = relpp; relcount && *p != (arelent *) NULL; p++, relcount--) + for (p = relpp; relcount && *p != NULL; p++, relcount--) { arelent *q = *p; const char *filename, *functionname; @@ -2489,6 +2364,7 @@ dump_reloc_set (abfd, sec, relpp, relcount) free (last_functionname); last_functionname = xstrdup (functionname); } + if (line > 0 && (line != last_line || (filename != NULL @@ -2516,6 +2392,7 @@ dump_reloc_set (abfd, sec, relpp, relcount) sym_name = NULL; section_name = NULL; } + if (sym_name) { bfd_printf_vma (abfd, q->address); @@ -2523,221 +2400,317 @@ dump_reloc_set (abfd, sec, relpp, relcount) printf (" %-16s ", q->howto->name); else printf (" %-16d ", q->howto->type); - objdump_print_symname (abfd, (struct disassemble_info *) NULL, - *q->sym_ptr_ptr); + objdump_print_symname (abfd, NULL, *q->sym_ptr_ptr); } else { - if (section_name == (const char *) NULL) + if (section_name == NULL) section_name = "*unknown*"; bfd_printf_vma (abfd, q->address); printf (" %-16s [%s]", q->howto->name, section_name); } + if (q->addend) { printf ("+0x"); bfd_printf_vma (abfd, q->addend); } + printf ("\n"); } } - -/* The length of the longest architecture name + 1. */ -#define LONGEST_ARCH sizeof("powerpc:common") -static const char * -endian_string (endian) - enum bfd_endian endian; +static void +dump_relocs_in_section (bfd *abfd, + asection *section, + void *dummy ATTRIBUTE_UNUSED) { - if (endian == BFD_ENDIAN_BIG) - return "big endian"; - else if (endian == BFD_ENDIAN_LITTLE) - return "little endian"; + arelent **relpp; + long relcount; + long relsize; + + if ( bfd_is_abs_section (section) + || bfd_is_und_section (section) + || bfd_is_com_section (section) + || (! process_section_p (section)) + || ((section->flags & SEC_RELOC) == 0)) + return; + + relsize = bfd_get_reloc_upper_bound (abfd, section); + if (relsize < 0) + bfd_fatal (bfd_get_filename (abfd)); + + printf ("RELOCATION RECORDS FOR [%s]:", section->name); + + if (relsize == 0) + { + printf (" (none)\n\n"); + return; + } + + relpp = xmalloc (relsize); + relcount = bfd_canonicalize_reloc (abfd, section, relpp, syms); + + if (relcount < 0) + bfd_fatal (bfd_get_filename (abfd)); + else if (relcount == 0) + printf (" (none)\n\n"); else - return "endianness unknown"; + { + printf ("\n"); + dump_reloc_set (abfd, section, relpp, relcount); + printf ("\n\n"); + } + free (relpp); } -/* List the targets that BFD is configured to support, each followed - by its endianness and the architectures it supports. */ +static void +dump_relocs (bfd *abfd) +{ + bfd_map_over_sections (abfd, dump_relocs_in_section, NULL); +} static void -display_target_list () +dump_dynamic_relocs (bfd *abfd) { - extern const bfd_target *const *bfd_target_vector; - char *dummy_name; - int t; + long relsize; + arelent **relpp; + long relcount; - dummy_name = make_temp_file (NULL); - for (t = 0; bfd_target_vector[t]; t++) - { - const bfd_target *p = bfd_target_vector[t]; - bfd *abfd = bfd_openw (dummy_name, p->name); - int a; + relsize = bfd_get_dynamic_reloc_upper_bound (abfd); + if (relsize < 0) + bfd_fatal (bfd_get_filename (abfd)); - printf ("%s\n (header %s, data %s)\n", p->name, - endian_string (p->header_byteorder), - endian_string (p->byteorder)); + printf ("DYNAMIC RELOCATION RECORDS"); - if (abfd == NULL) - { - nonfatal (dummy_name); - continue; - } + if (relsize == 0) + printf (" (none)\n\n"); + else + { + relpp = xmalloc (relsize); + relcount = bfd_canonicalize_dynamic_reloc (abfd, relpp, dynsyms); - if (! bfd_set_format (abfd, bfd_object)) + if (relcount < 0) + bfd_fatal (bfd_get_filename (abfd)); + else if (relcount == 0) + printf (" (none)\n\n"); + else { - if (bfd_get_error () != bfd_error_invalid_operation) - nonfatal (p->name); - bfd_close_all_done (abfd); - continue; + printf ("\n"); + dump_reloc_set (abfd, NULL, relpp, relcount); + printf ("\n\n"); } - - for (a = (int) bfd_arch_obscure + 1; a < (int) bfd_arch_last; a++) - if (bfd_set_arch_mach (abfd, (enum bfd_architecture) a, 0)) - printf (" %s\n", - bfd_printable_arch_mach ((enum bfd_architecture) a, 0)); - bfd_close_all_done (abfd); + free (relpp); } - unlink (dummy_name); - free (dummy_name); } -/* Print a table showing which architectures are supported for entries - FIRST through LAST-1 of bfd_target_vector (targets across, - architectures down). */ +/* Creates a table of paths, to search for source files. */ static void -display_info_table (first, last) - int first; - int last; +add_include_path (const char *path) { - extern const bfd_target *const *bfd_target_vector; - int t, a; - char *dummy_name; - - /* Print heading of target names. */ - printf ("\n%*s", (int) LONGEST_ARCH, " "); - for (t = first; t < last && bfd_target_vector[t]; t++) - printf ("%s ", bfd_target_vector[t]->name); - putchar ('\n'); - - dummy_name = make_temp_file (NULL); - for (a = (int) bfd_arch_obscure + 1; a < (int) bfd_arch_last; a++) - if (strcmp (bfd_printable_arch_mach (a, 0), "UNKNOWN!") != 0) - { - printf ("%*s ", (int) LONGEST_ARCH - 1, - bfd_printable_arch_mach (a, 0)); - for (t = first; t < last && bfd_target_vector[t]; t++) - { - const bfd_target *p = bfd_target_vector[t]; - boolean ok = true; - bfd *abfd = bfd_openw (dummy_name, p->name); - - if (abfd == NULL) - { - nonfatal (p->name); - ok = false; - } - - if (ok) - { - if (! bfd_set_format (abfd, bfd_object)) - { - if (bfd_get_error () != bfd_error_invalid_operation) - nonfatal (p->name); - ok = false; - } - } - - if (ok) - { - if (! bfd_set_arch_mach (abfd, a, 0)) - ok = false; - } - - if (ok) - printf ("%s ", p->name); - else - { - int l = strlen (p->name); - while (l--) - putchar ('-'); - putchar (' '); - } - if (abfd != NULL) - bfd_close_all_done (abfd); - } - putchar ('\n'); - } - unlink (dummy_name); - free (dummy_name); + if (path[0] == 0) + return; + include_path_count++; + include_paths = xrealloc (include_paths, + include_path_count * sizeof (*include_paths)); +#ifdef HAVE_DOS_BASED_FILE_SYSTEM + if (path[1] == ':' && path[2] == 0) + path = concat (path, ".", (const char *) 0); +#endif + include_paths[include_path_count - 1] = path; +} + +static void +adjust_addresses (bfd *abfd ATTRIBUTE_UNUSED, + asection *section, + void *dummy ATTRIBUTE_UNUSED) +{ + section->vma += adjust_section_vma; + section->lma += adjust_section_vma; } -/* Print tables of all the target-architecture combinations that - BFD has been configured to support. */ +/* Dump selected contents of ABFD. */ static void -display_target_tables () +dump_bfd (bfd *abfd) { - int t, columns; - extern const bfd_target *const *bfd_target_vector; - char *colum; - - columns = 0; - colum = getenv ("COLUMNS"); - if (colum != NULL) - columns = atoi (colum); - if (columns == 0) - columns = 80; - - t = 0; - while (bfd_target_vector[t] != NULL) + /* If we are adjusting section VMA's, change them all now. Changing + the BFD information is a hack. However, we must do it, or + bfd_find_nearest_line will not do the right thing. */ + if (adjust_section_vma != 0) + bfd_map_over_sections (abfd, adjust_addresses, NULL); + + if (! dump_debugging_tags) + printf (_("\n%s: file format %s\n"), bfd_get_filename (abfd), + abfd->xvec->name); + if (dump_ar_hdrs) + print_arelt_descr (stdout, abfd, TRUE); + if (dump_file_header) + dump_bfd_header (abfd); + if (dump_private_headers) + dump_bfd_private_header (abfd); + if (! dump_debugging_tags) + putchar ('\n'); + if (dump_section_headers) + dump_headers (abfd); + + if (dump_symtab || dump_reloc_info || disassemble || dump_debugging) + syms = slurp_symtab (abfd); + if (dump_dynamic_symtab || dump_dynamic_reloc_info) + dynsyms = slurp_dynamic_symtab (abfd); + + if (dump_symtab) + dump_symbols (abfd, FALSE); + if (dump_dynamic_symtab) + dump_symbols (abfd, TRUE); + if (dump_stab_section_info) + dump_stabs (abfd); + if (dump_reloc_info && ! disassemble) + dump_relocs (abfd); + if (dump_dynamic_reloc_info && ! disassemble) + dump_dynamic_relocs (abfd); + if (dump_section_contents) + dump_data (abfd); + if (disassemble) + disassemble_data (abfd); + + if (dump_debugging) { - int oldt = t, wid; + void *dhandle; - wid = LONGEST_ARCH + strlen (bfd_target_vector[t]->name) + 1; - ++t; - while (wid < columns && bfd_target_vector[t] != NULL) + dhandle = read_debugging_info (abfd, syms, symcount); + if (dhandle != NULL) { - int newwid; - - newwid = wid + strlen (bfd_target_vector[t]->name) + 1; - if (newwid >= columns) - break; - wid = newwid; - ++t; + if (! print_debugging_info (stdout, dhandle, abfd, syms, demangle, + dump_debugging_tags ? TRUE : FALSE)) + { + non_fatal (_("%s: printing debugging information failed"), + bfd_get_filename (abfd)); + exit_status = 1; + } } - display_info_table (oldt, t); + } + + if (syms) + { + free (syms); + syms = NULL; + } + + if (dynsyms) + { + free (dynsyms); + dynsyms = NULL; } } static void -display_info () +display_bfd (bfd *abfd) { - printf (_("BFD header file version %s\n"), BFD_VERSION_STRING); - display_target_list (); - display_target_tables (); + char **matching; + + if (bfd_check_format_matches (abfd, bfd_object, &matching)) + { + dump_bfd (abfd); + return; + } + + if (bfd_get_error () == bfd_error_file_ambiguously_recognized) + { + nonfatal (bfd_get_filename (abfd)); + list_matching_formats (matching); + free (matching); + return; + } + + if (bfd_get_error () != bfd_error_file_not_recognized) + { + nonfatal (bfd_get_filename (abfd)); + return; + } + + if (bfd_check_format_matches (abfd, bfd_core, &matching)) + { + dump_bfd (abfd); + return; + } + + nonfatal (bfd_get_filename (abfd)); + + if (bfd_get_error () == bfd_error_file_ambiguously_recognized) + { + list_matching_formats (matching); + free (matching); + } } -int main PARAMS ((int, char **)); +static void +display_file (char *filename, char *target) +{ + bfd *file; + bfd *arfile = NULL; + + if (get_file_size (filename) < 1) + return; + + file = bfd_openr (filename, target); + if (file == NULL) + { + nonfatal (filename); + return; + } + + /* If the file is an archive, process all of its elements. */ + if (bfd_check_format (file, bfd_archive)) + { + bfd *last_arfile = NULL; + + printf (_("In archive %s:\n"), bfd_get_filename (file)); + for (;;) + { + bfd_set_error (bfd_error_no_error); + + arfile = bfd_openr_next_archived_file (file, arfile); + if (arfile == NULL) + { + if (bfd_get_error () != bfd_error_no_more_archived_files) + nonfatal (bfd_get_filename (file)); + break; + } + + display_bfd (arfile); + + if (last_arfile != NULL) + bfd_close (last_arfile); + last_arfile = arfile; + } + + if (last_arfile != NULL) + bfd_close (last_arfile); + } + else + display_bfd (file); + bfd_close (file); +} + int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int c; char *target = default_target; - boolean seenflag = false; + bfd_boolean seenflag = FALSE; -#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) +#if defined (HAVE_SETLOCALE) +#if defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); #endif -#if defined (HAVE_SETLOCALE) setlocale (LC_CTYPE, ""); #endif + bindtextdomain (PACKAGE, LOCALEDIR); textdomain (PACKAGE); @@ -2749,7 +2722,7 @@ main (argc, argv) bfd_init (); set_default_bfd_target (); - while ((c = getopt_long (argc, argv, "pib:m:M:VvCdDlfaHhrRtTxsSj:wE:zgG", + while ((c = getopt_long (argc, argv, "pib:m:M:VvCdDlfaHhrRtTxsSI:j:wE:zgeG", long_options, (int *) 0)) != EOF) { @@ -2761,19 +2734,29 @@ main (argc, argv) machine = optarg; break; case 'M': - disassembler_options = optarg; + if (disassembler_options) + /* Ignore potential memory leak for now. */ + disassembler_options = concat (disassembler_options, ",", + optarg, NULL); + else + disassembler_options = optarg; break; case 'j': - only = optarg; + if (only_used == only_size) + { + only_size += 8; + only = xrealloc (only, only_size * sizeof (char *)); + } + only [only_used++] = optarg; break; case 'l': - with_line_numbers = true; + with_line_numbers = TRUE; break; case 'b': target = optarg; break; case 'C': - do_demangle = true; + do_demangle = TRUE; if (optarg != NULL) { enum demangling_styles style; @@ -2787,7 +2770,7 @@ main (argc, argv) } break; case 'w': - wide_output = true; + wide_output = TRUE; break; case OPTION_ADJUST_VMA: adjust_section_vma = parse_vma (optarg, "--adjust-vma"); @@ -2822,86 +2805,95 @@ main (argc, argv) break; case 'f': - dump_file_header = true; - seenflag = true; + dump_file_header = TRUE; + seenflag = TRUE; break; case 'i': - formats_info = true; - seenflag = true; + formats_info = TRUE; + seenflag = TRUE; + break; + case 'I': + add_include_path (optarg); break; case 'p': - dump_private_headers = true; - seenflag = true; + dump_private_headers = TRUE; + seenflag = TRUE; break; case 'x': - dump_private_headers = true; - dump_symtab = true; - dump_reloc_info = true; - dump_file_header = true; - dump_ar_hdrs = true; - dump_section_headers = true; - seenflag = true; + dump_private_headers = TRUE; + dump_symtab = TRUE; + dump_reloc_info = TRUE; + dump_file_header = TRUE; + dump_ar_hdrs = TRUE; + dump_section_headers = TRUE; + seenflag = TRUE; break; case 't': - dump_symtab = true; - seenflag = true; + dump_symtab = TRUE; + seenflag = TRUE; break; case 'T': - dump_dynamic_symtab = true; - seenflag = true; + dump_dynamic_symtab = TRUE; + seenflag = TRUE; break; case 'd': - disassemble = true; - seenflag = true; + disassemble = TRUE; + seenflag = TRUE; break; case 'z': - disassemble_zeroes = true; + disassemble_zeroes = TRUE; break; case 'D': - disassemble = true; - disassemble_all = true; - seenflag = true; + disassemble = TRUE; + disassemble_all = TRUE; + seenflag = TRUE; break; case 'S': - disassemble = true; - with_source_code = true; - seenflag = true; + disassemble = TRUE; + with_source_code = TRUE; + seenflag = TRUE; break; case 'g': dump_debugging = 1; - seenflag = true; + seenflag = TRUE; + break; + case 'e': + dump_debugging = 1; + dump_debugging_tags = 1; + do_demangle = TRUE; + seenflag = TRUE; break; case 'G': - dump_stab_section_info = true; - seenflag = true; + dump_stab_section_info = TRUE; + seenflag = TRUE; break; case 's': - dump_section_contents = true; - seenflag = true; + dump_section_contents = TRUE; + seenflag = TRUE; break; case 'r': - dump_reloc_info = true; - seenflag = true; + dump_reloc_info = TRUE; + seenflag = TRUE; break; case 'R': - dump_dynamic_reloc_info = true; - seenflag = true; + dump_dynamic_reloc_info = TRUE; + seenflag = TRUE; break; case 'a': - dump_ar_hdrs = true; - seenflag = true; + dump_ar_hdrs = TRUE; + seenflag = TRUE; break; case 'h': - dump_section_headers = true; - seenflag = true; + dump_section_headers = TRUE; + seenflag = TRUE; break; case 'H': usage (stdout, 0); - seenflag = true; + seenflag = TRUE; case 'v': case 'V': - show_version = true; - seenflag = true; + show_version = TRUE; + seenflag = TRUE; break; default: @@ -2912,11 +2904,11 @@ main (argc, argv) if (show_version) print_version ("objdump"); - if (seenflag == false) + if (!seenflag) usage (stderr, 2); if (formats_info) - display_info (); + exit_status = display_info (); else { if (optind == argc) diff --git a/contrib/binutils/binutils/po/Make-in b/contrib/binutils/binutils/po/Make-in index 0552db1..6176dbf 100644 --- a/contrib/binutils/binutils/po/Make-in +++ b/contrib/binutils/binutils/po/Make-in @@ -24,6 +24,8 @@ gnulocaledir = $(prefix)/share/locale gettextsrcdir = $(prefix)/share/gettext/po subdir = po +DESTDIR = + INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -111,9 +113,9 @@ install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all if test -r $(MKINSTALLDIRS); then \ - $(MKINSTALLDIRS) $(datadir); \ + $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ else \ - $(top_srcdir)/mkinstalldirs $(datadir); \ + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ fi @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ @@ -123,7 +125,7 @@ install-data-yes: all *) destdir=$(localedir);; \ esac; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - dir=$$destdir/$$lang/LC_MESSAGES; \ + dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ if test -r $(MKINSTALLDIRS); then \ $(MKINSTALLDIRS) $$dir; \ else \ @@ -153,12 +155,12 @@ install-data-yes: all done if test "$(PACKAGE)" = "gettext"; then \ if test -r $(MKINSTALLDIRS); then \ - $(MKINSTALLDIRS) $(gettextsrcdir); \ + $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ else \ - $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ fi; \ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ - $(gettextsrcdir)/Makefile.in.in; \ + $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ else \ : ; \ fi @@ -171,12 +173,12 @@ uninstall: for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ - rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ - rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ - rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ done - rm -f $(gettextsrcdir)/po-Makefile.in.in + rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in check: all diff --git a/contrib/binutils/binutils/po/POTFILES.in b/contrib/binutils/binutils/po/POTFILES.in index 1a3e585..9e9e6a5 100644 --- a/contrib/binutils/binutils/po/POTFILES.in +++ b/contrib/binutils/binutils/po/POTFILES.in @@ -12,6 +12,7 @@ budemang.h coffdump.c coffgrok.c coffgrok.h +cxxfilt.c debug.c debug.c debug.h diff --git a/contrib/binutils/binutils/po/binutils.pot b/contrib/binutils/binutils/po/binutils.pot index 6097147..73c60b3 100644 --- a/contrib/binutils/binutils/po/binutils.pot +++ b/contrib/binutils/binutils/po/binutils.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2002-10-30 10:07-0500\n" +"POT-Creation-Date: 2003-07-11 13:56+0930\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -43,19 +43,19 @@ msgid "" "\n" msgstr "" -#: addr2line.c:89 ar.c:297 coffdump.c:479 nlmconv.c:1119 objcopy.c:424 -#: objcopy.c:457 readelf.c:2313 size.c:104 srconv.c:1962 strings.c:666 -#: sysdump.c:774 windres.c:733 +#: addr2line.c:89 ar.c:297 coffdump.c:479 nlmconv.c:1121 objcopy.c:484 +#: objcopy.c:518 readelf.c:2649 size.c:104 srconv.c:1962 strings.c:673 +#: sysdump.c:774 windres.c:702 #, c-format msgid "Report bugs to %s\n" msgstr "" -#: addr2line.c:248 +#: addr2line.c:245 #, c-format msgid "%s: can not get addresses from archive" msgstr "" -#: addr2line.c:320 nm.c:395 objdump.c:2783 +#: addr2line.c:317 nm.c:433 objdump.c:2693 #, c-format msgid "unknown demangling style `%s'" msgstr "" @@ -214,7 +214,7 @@ msgstr "" msgid "internal error -- this option not implemented" msgstr "" -#: ar.c:837 ar.c:888 ar.c:1333 objcopy.c:1348 +#: ar.c:837 ar.c:888 ar.c:1333 objcopy.c:1579 #, c-format msgid "internal stat error on %s" msgstr "" @@ -323,40 +323,45 @@ msgid " No emulation specific options\n" msgstr "" #. Macros for common output. -#: binemul.h:42 +#: binemul.h:52 #, c-format msgid " emulation options: \n" msgstr "" -#: bucomm.c:106 +#: bucomm.c:113 #, c-format msgid "can't set BFD default target to `%s': %s" msgstr "" -#: bucomm.c:118 +#: bucomm.c:125 #, c-format msgid "%s: Matching formats:" msgstr "" -#: bucomm.c:135 +#: bucomm.c:142 msgid "Supported targets:" msgstr "" -#: bucomm.c:137 +#: bucomm.c:144 #, c-format msgid "%s: supported targets:" msgstr "" -#: bucomm.c:155 +#: bucomm.c:162 msgid "Supported architectures:" msgstr "" -#: bucomm.c:157 +#: bucomm.c:164 #, c-format msgid "%s: supported architectures:" msgstr "" -#: bucomm.c:264 +#: bucomm.c:360 +#, c-format +msgid "BFD header file version %s\n" +msgstr "" + +#: bucomm.c:467 #, c-format msgid "%s: bad number: %s" msgstr "" @@ -387,95 +392,91 @@ msgstr "" msgid "no input file specified" msgstr "" -#: debug.c:653 +#: debug.c:654 msgid "debug_add_to_current_namespace: no current file" msgstr "" -#: debug.c:736 +#: debug.c:737 msgid "debug_start_source: no debug_set_filename call" msgstr "" -#: debug.c:795 +#: debug.c:796 msgid "debug_record_function: no debug_set_filename call" msgstr "" -#: debug.c:851 +#: debug.c:852 msgid "debug_record_parameter: no current function" msgstr "" -#: debug.c:885 +#: debug.c:886 msgid "debug_end_function: no current function" msgstr "" -#: debug.c:891 +#: debug.c:892 msgid "debug_end_function: some blocks were not closed" msgstr "" -#: debug.c:921 +#: debug.c:922 msgid "debug_start_block: no current block" msgstr "" -#: debug.c:959 +#: debug.c:960 msgid "debug_end_block: no current block" msgstr "" -#: debug.c:966 +#: debug.c:967 msgid "debug_end_block: attempt to close top level block" msgstr "" -#: debug.c:992 +#: debug.c:993 msgid "debug_record_line: no current unit" msgstr "" #. FIXME -#: debug.c:1046 +#: debug.c:1047 msgid "debug_start_common_block: not implemented" msgstr "" #. FIXME -#: debug.c:1058 +#: debug.c:1059 msgid "debug_end_common_block: not implemented" msgstr "" #. FIXME. -#: debug.c:1152 +#: debug.c:1153 msgid "debug_record_label: not implemented" msgstr "" -#: debug.c:1178 +#: debug.c:1179 msgid "debug_record_variable: no current file" msgstr "" -#: debug.c:1194 -msgid "debug_record_variable: no current block" -msgstr "" - -#: debug.c:1763 +#: debug.c:1762 msgid "debug_make_undefined_type: unsupported kind" msgstr "" -#: debug.c:1964 +#: debug.c:1963 msgid "debug_name_type: no current file" msgstr "" -#: debug.c:2012 +#: debug.c:2011 msgid "debug_tag_type: no current file" msgstr "" -#: debug.c:2020 +#: debug.c:2019 msgid "debug_tag_type: extra tag attempted" msgstr "" -#: debug.c:2059 +#: debug.c:2058 #, c-format msgid "Warning: changing type size from %d to %d\n" msgstr "" -#: debug.c:2083 +#: debug.c:2082 msgid "debug_find_named_type: no current compilation unit" msgstr "" -#: debug.c:2190 +#: debug.c:2189 #, c-format msgid "debug_get_real_type: circular debug information for %s\n" msgstr "" @@ -484,325 +485,325 @@ msgstr "" msgid "debug_write_type: illegal type encountered" msgstr "" -#: dlltool.c:735 dlltool.c:760 dlltool.c:786 +#: dlltool.c:812 dlltool.c:837 dlltool.c:863 #, c-format msgid "Internal error: Unknown machine type: %d" msgstr "" -#: dlltool.c:823 +#: dlltool.c:900 #, c-format msgid "Can't open def file: %s" msgstr "" -#: dlltool.c:828 +#: dlltool.c:905 #, c-format msgid "Processing def file: %s" msgstr "" -#: dlltool.c:832 +#: dlltool.c:909 msgid "Processed def file" msgstr "" -#: dlltool.c:858 +#: dlltool.c:935 #, c-format msgid "Syntax error in def file %s:%d" msgstr "" -#: dlltool.c:897 +#: dlltool.c:974 #, c-format msgid "NAME: %s base: %x" msgstr "" -#: dlltool.c:900 dlltool.c:919 +#: dlltool.c:977 dlltool.c:996 msgid "Can't have LIBRARY and NAME" msgstr "" -#: dlltool.c:916 +#: dlltool.c:993 #, c-format msgid "LIBRARY: %s base: %x" msgstr "" -#: dlltool.c:1174 resrc.c:271 +#: dlltool.c:1251 resrc.c:271 #, c-format msgid "wait: %s" msgstr "" -#: dlltool.c:1179 dllwrap.c:430 resrc.c:276 +#: dlltool.c:1256 dllwrap.c:430 resrc.c:276 #, c-format msgid "subprocess got fatal signal %d" msgstr "" -#: dlltool.c:1185 dllwrap.c:437 resrc.c:283 +#: dlltool.c:1262 dllwrap.c:437 resrc.c:283 #, c-format msgid "%s exited with status %d" msgstr "" -#: dlltool.c:1217 +#: dlltool.c:1294 #, c-format msgid "Sucking in info from %s section in %s" msgstr "" -#: dlltool.c:1341 +#: dlltool.c:1423 #, c-format msgid "Excluding symbol: %s" msgstr "" -#: dlltool.c:1436 dlltool.c:1447 nm.c:959 nm.c:970 objdump.c:386 objdump.c:401 +#: dlltool.c:1518 dlltool.c:1529 nm.c:1004 nm.c:1015 #, c-format msgid "%s: no symbols" msgstr "" -#. FIXME: we ought to read in and block out the base relocations -#: dlltool.c:1474 +#. FIXME: we ought to read in and block out the base relocations. +#: dlltool.c:1556 #, c-format msgid "Done reading %s" msgstr "" -#: dlltool.c:1485 +#: dlltool.c:1567 #, c-format msgid "Unable to open object file: %s" msgstr "" -#: dlltool.c:1488 +#: dlltool.c:1570 #, c-format msgid "Scanning object file %s" msgstr "" -#: dlltool.c:1503 +#: dlltool.c:1585 #, c-format msgid "Cannot produce mcore-elf dll from archive file: %s" msgstr "" -#: dlltool.c:1595 +#: dlltool.c:1677 msgid "Adding exports to output file" msgstr "" -#: dlltool.c:1640 +#: dlltool.c:1724 msgid "Added exports to output file" msgstr "" -#: dlltool.c:1764 +#: dlltool.c:1848 #, c-format msgid "Generating export file: %s" msgstr "" -#: dlltool.c:1769 +#: dlltool.c:1853 #, c-format msgid "Unable to open temporary assembler file: %s" msgstr "" -#: dlltool.c:1772 +#: dlltool.c:1856 #, c-format msgid "Opened temporary file: %s" msgstr "" -#: dlltool.c:1996 +#: dlltool.c:2086 msgid "Generated exports file" msgstr "" -#: dlltool.c:2258 +#: dlltool.c:2378 #, c-format msgid "bfd_open failed open stub file: %s" msgstr "" -#: dlltool.c:2261 +#: dlltool.c:2381 #, c-format msgid "Creating stub file: %s" msgstr "" -#: dlltool.c:2650 +#: dlltool.c:2766 #, c-format msgid "failed to open temporary head file: %s" msgstr "" -#: dlltool.c:2709 +#: dlltool.c:2825 #, c-format msgid "failed to open temporary tail file: %s" msgstr "" -#: dlltool.c:2777 +#: dlltool.c:2892 #, c-format msgid "Can't open .lib file: %s" msgstr "" -#: dlltool.c:2780 +#: dlltool.c:2895 #, c-format msgid "Creating library file: %s" msgstr "" -#: dlltool.c:2839 +#: dlltool.c:2951 #, c-format msgid "cannot delete %s: %s" msgstr "" -#: dlltool.c:2843 +#: dlltool.c:2955 msgid "Created lib file" msgstr "" -#: dlltool.c:2948 +#: dlltool.c:3062 #, c-format msgid "Warning, ignoring duplicate EXPORT %s %d,%d" msgstr "" -#: dlltool.c:2954 +#: dlltool.c:3068 #, c-format msgid "Error, duplicate EXPORT with oridinals: %s" msgstr "" -#: dlltool.c:3081 +#: dlltool.c:3191 msgid "Processing definitions" msgstr "" -#: dlltool.c:3119 +#: dlltool.c:3223 msgid "Processed definitions" msgstr "" #. xgetext:c-format -#: dlltool.c:3130 dllwrap.c:495 +#: dlltool.c:3234 dllwrap.c:495 #, c-format msgid "Usage %s \n" msgstr "" #. xgetext:c-format -#: dlltool.c:3132 +#: dlltool.c:3236 #, c-format msgid "" " -m --machine Create as DLL for . [default: %s]\n" msgstr "" -#: dlltool.c:3133 +#: dlltool.c:3237 msgid "" " possible : arm[_interwork], i386, mcore[-elf]{-le|-be}, " "ppc, thumb\n" msgstr "" -#: dlltool.c:3134 +#: dlltool.c:3238 msgid " -e --output-exp Generate an export file.\n" msgstr "" -#: dlltool.c:3135 +#: dlltool.c:3239 msgid " -l --output-lib Generate an interface library.\n" msgstr "" -#: dlltool.c:3136 +#: dlltool.c:3240 msgid " -a --add-indirect Add dll indirects to export file.\n" msgstr "" -#: dlltool.c:3137 +#: dlltool.c:3241 msgid "" " -D --dllname Name of input dll to put into interface lib.\n" msgstr "" -#: dlltool.c:3138 +#: dlltool.c:3242 msgid " -d --input-def Name of .def file to be read in.\n" msgstr "" -#: dlltool.c:3139 +#: dlltool.c:3243 msgid " -z --output-def Name of .def file to be created.\n" msgstr "" -#: dlltool.c:3140 +#: dlltool.c:3244 msgid " --export-all-symbols Export all symbols to .def\n" msgstr "" -#: dlltool.c:3141 +#: dlltool.c:3245 msgid " --no-export-all-symbols Only export listed symbols\n" msgstr "" -#: dlltool.c:3142 +#: dlltool.c:3246 msgid " --exclude-symbols Don't export \n" msgstr "" -#: dlltool.c:3143 +#: dlltool.c:3247 msgid " --no-default-excludes Clear default exclude symbols\n" msgstr "" -#: dlltool.c:3144 +#: dlltool.c:3248 msgid " -b --base-file Read linker generated base file.\n" msgstr "" -#: dlltool.c:3145 +#: dlltool.c:3249 msgid " -x --no-idata4 Don't generate idata$4 section.\n" msgstr "" -#: dlltool.c:3146 +#: dlltool.c:3250 msgid " -c --no-idata5 Don't generate idata$5 section.\n" msgstr "" -#: dlltool.c:3147 +#: dlltool.c:3251 msgid "" " -U --add-underscore Add underscores to symbols in interface " "library.\n" msgstr "" -#: dlltool.c:3148 +#: dlltool.c:3252 msgid " -k --kill-at Kill @ from exported names.\n" msgstr "" -#: dlltool.c:3149 +#: dlltool.c:3253 msgid " -A --add-stdcall-alias Add aliases without @.\n" msgstr "" -#: dlltool.c:3150 +#: dlltool.c:3254 msgid " -S --as Use for assembler.\n" msgstr "" -#: dlltool.c:3151 +#: dlltool.c:3255 msgid " -f --as-flags Pass to the assembler.\n" msgstr "" -#: dlltool.c:3152 +#: dlltool.c:3256 msgid "" " -C --compat-implib Create backward compatible import library.\n" msgstr "" -#: dlltool.c:3153 +#: dlltool.c:3257 msgid "" " -n --no-delete Keep temp files (repeat for extra " "preservation).\n" msgstr "" -#: dlltool.c:3154 +#: dlltool.c:3258 msgid " -v --verbose Be verbose.\n" msgstr "" -#: dlltool.c:3155 +#: dlltool.c:3259 msgid " -V --version Display the program version.\n" msgstr "" -#: dlltool.c:3156 +#: dlltool.c:3260 msgid " -h --help Display this information.\n" msgstr "" -#: dlltool.c:3158 +#: dlltool.c:3262 msgid "" " -M --mcore-elf Process mcore-elf object files into .\n" msgstr "" -#: dlltool.c:3159 +#: dlltool.c:3263 msgid " -L --linker Use as the linker.\n" msgstr "" -#: dlltool.c:3160 +#: dlltool.c:3264 msgid " -F --linker-flags Pass to the linker.\n" msgstr "" -#: dlltool.c:3310 +#: dlltool.c:3418 #, c-format msgid "Unable to open base-file: %s" msgstr "" -#: dlltool.c:3339 +#: dlltool.c:3450 #, c-format msgid "Machine '%s' not supported" msgstr "" -#: dlltool.c:3442 dllwrap.c:214 +#: dlltool.c:3553 dllwrap.c:214 #, c-format msgid "Tried file: %s" msgstr "" -#: dlltool.c:3449 dllwrap.c:221 +#: dlltool.c:3560 dllwrap.c:221 #, c-format msgid "Using file: %s" msgstr "" @@ -1008,375 +1009,375 @@ msgstr "" msgid "DRIVER options : %s\n" msgstr "" -#: emul_aix.c:52 +#: emul_aix.c:58 #, c-format msgid " [-g] - 32 bit small archive\n" msgstr "" -#: emul_aix.c:53 +#: emul_aix.c:59 msgid " [-X32] - ignores 64 bit objects\n" msgstr "" -#: emul_aix.c:54 +#: emul_aix.c:60 msgid " [-X64] - ignores 32 bit objects\n" msgstr "" -#: emul_aix.c:55 +#: emul_aix.c:61 msgid " [-X32_64] - accepts 32 and 64 bit objects\n" msgstr "" -#: ieee.c:317 +#: ieee.c:326 msgid "unexpected end of debugging information" msgstr "" -#: ieee.c:412 +#: ieee.c:421 msgid "invalid number" msgstr "" -#: ieee.c:471 +#: ieee.c:480 msgid "invalid string length" msgstr "" -#: ieee.c:528 ieee.c:569 +#: ieee.c:537 ieee.c:578 msgid "expression stack overflow" msgstr "" -#: ieee.c:548 +#: ieee.c:557 msgid "unsupported IEEE expression operator" msgstr "" -#: ieee.c:563 +#: ieee.c:572 msgid "unknown section" msgstr "" -#: ieee.c:584 +#: ieee.c:593 msgid "expression stack underflow" msgstr "" -#: ieee.c:598 +#: ieee.c:607 msgid "expression stack mismatch" msgstr "" -#: ieee.c:637 +#: ieee.c:646 msgid "unknown builtin type" msgstr "" -#: ieee.c:782 +#: ieee.c:791 msgid "BCD float type not supported" msgstr "" -#: ieee.c:928 +#: ieee.c:937 msgid "unexpected number" msgstr "" -#: ieee.c:935 +#: ieee.c:944 msgid "unexpected record type" msgstr "" -#: ieee.c:968 +#: ieee.c:977 msgid "blocks left on stack at end" msgstr "" -#: ieee.c:1233 +#: ieee.c:1242 msgid "unknown BB type" msgstr "" -#: ieee.c:1242 +#: ieee.c:1251 msgid "stack overflow" msgstr "" -#: ieee.c:1267 +#: ieee.c:1276 msgid "stack underflow" msgstr "" -#: ieee.c:1381 ieee.c:1453 ieee.c:2152 +#: ieee.c:1390 ieee.c:1462 ieee.c:2161 msgid "illegal variable index" msgstr "" -#: ieee.c:1431 +#: ieee.c:1440 msgid "illegal type index" msgstr "" -#: ieee.c:1441 ieee.c:1478 +#: ieee.c:1450 ieee.c:1487 msgid "unknown TY code" msgstr "" -#: ieee.c:1460 +#: ieee.c:1469 msgid "undefined variable in TY" msgstr "" #. Pascal file name. FIXME. -#: ieee.c:1871 +#: ieee.c:1880 msgid "Pascal file name not supported" msgstr "" -#: ieee.c:1919 +#: ieee.c:1928 msgid "unsupported qualifier" msgstr "" -#: ieee.c:2190 +#: ieee.c:2199 msgid "undefined variable in ATN" msgstr "" -#: ieee.c:2233 +#: ieee.c:2242 msgid "unknown ATN type" msgstr "" #. Reserved for FORTRAN common. -#: ieee.c:2355 +#: ieee.c:2364 msgid "unsupported ATN11" msgstr "" #. We have no way to record this information. FIXME. -#: ieee.c:2382 +#: ieee.c:2391 msgid "unsupported ATN12" msgstr "" -#: ieee.c:2442 +#: ieee.c:2451 msgid "unexpected string in C++ misc" msgstr "" -#: ieee.c:2455 +#: ieee.c:2464 msgid "bad misc record" msgstr "" -#: ieee.c:2498 +#: ieee.c:2507 msgid "unrecognized C++ misc record" msgstr "" -#: ieee.c:2615 +#: ieee.c:2624 msgid "undefined C++ object" msgstr "" -#: ieee.c:2649 +#: ieee.c:2658 msgid "unrecognized C++ object spec" msgstr "" -#: ieee.c:2685 +#: ieee.c:2694 msgid "unsupported C++ object type" msgstr "" -#: ieee.c:2695 +#: ieee.c:2704 msgid "C++ base class not defined" msgstr "" -#: ieee.c:2707 ieee.c:2812 +#: ieee.c:2716 ieee.c:2821 msgid "C++ object has no fields" msgstr "" -#: ieee.c:2726 +#: ieee.c:2735 msgid "C++ base class not found in container" msgstr "" -#: ieee.c:2833 +#: ieee.c:2842 msgid "C++ data member not found in container" msgstr "" -#: ieee.c:2874 ieee.c:3024 +#: ieee.c:2883 ieee.c:3033 msgid "unknown C++ visibility" msgstr "" -#: ieee.c:2908 +#: ieee.c:2917 msgid "bad C++ field bit pos or size" msgstr "" -#: ieee.c:3000 +#: ieee.c:3009 msgid "bad type for C++ method function" msgstr "" -#: ieee.c:3010 +#: ieee.c:3019 msgid "no type information for C++ method function" msgstr "" -#: ieee.c:3049 +#: ieee.c:3058 msgid "C++ static virtual method" msgstr "" -#: ieee.c:3144 +#: ieee.c:3153 msgid "unrecognized C++ object overhead spec" msgstr "" -#: ieee.c:3183 +#: ieee.c:3192 msgid "undefined C++ vtable" msgstr "" -#: ieee.c:3254 +#: ieee.c:3263 msgid "C++ default values not in a function" msgstr "" -#: ieee.c:3294 +#: ieee.c:3303 msgid "unrecognized C++ default type" msgstr "" -#: ieee.c:3325 +#: ieee.c:3334 msgid "reference parameter is not a pointer" msgstr "" -#: ieee.c:3410 +#: ieee.c:3419 msgid "unrecognized C++ reference type" msgstr "" -#: ieee.c:3492 +#: ieee.c:3501 msgid "C++ reference not found" msgstr "" -#: ieee.c:3500 +#: ieee.c:3509 msgid "C++ reference is not pointer" msgstr "" -#: ieee.c:3529 ieee.c:3537 +#: ieee.c:3538 ieee.c:3546 msgid "missing required ASN" msgstr "" -#: ieee.c:3567 ieee.c:3575 +#: ieee.c:3576 ieee.c:3584 msgid "missing required ATN65" msgstr "" -#: ieee.c:3589 +#: ieee.c:3598 msgid "bad ATN65 record" msgstr "" -#: ieee.c:4234 +#: ieee.c:4286 msgid "IEEE numeric overflow: 0x" msgstr "" -#: ieee.c:4280 +#: ieee.c:4332 #, c-format msgid "IEEE string length overflow: %u\n" msgstr "" -#: ieee.c:5330 +#: ieee.c:5382 #, c-format msgid "IEEE unsupported integer type size %u\n" msgstr "" -#: ieee.c:5366 +#: ieee.c:5418 #, c-format msgid "IEEE unsupported float type size %u\n" msgstr "" -#: ieee.c:5402 +#: ieee.c:5454 #, c-format msgid "IEEE unsupported complex type size %u\n" msgstr "" -#: nlmconv.c:281 srconv.c:2043 +#: nlmconv.c:282 srconv.c:2043 msgid "input and output files must be different" msgstr "" -#: nlmconv.c:328 +#: nlmconv.c:329 msgid "input file named both on command line and with INPUT" msgstr "" -#: nlmconv.c:337 +#: nlmconv.c:338 msgid "no input file" msgstr "" -#: nlmconv.c:367 +#: nlmconv.c:368 msgid "no name for output file" msgstr "" -#: nlmconv.c:380 +#: nlmconv.c:382 msgid "warning: input and output formats are not compatible" msgstr "" -#: nlmconv.c:409 +#: nlmconv.c:411 msgid "make .bss section" msgstr "" -#: nlmconv.c:418 +#: nlmconv.c:420 msgid "make .nlmsections section" msgstr "" -#: nlmconv.c:420 +#: nlmconv.c:422 msgid "set .nlmsections flags" msgstr "" -#: nlmconv.c:448 +#: nlmconv.c:450 msgid "set .bss vma" msgstr "" -#: nlmconv.c:455 +#: nlmconv.c:457 msgid "set .data size" msgstr "" -#: nlmconv.c:635 +#: nlmconv.c:637 #, c-format msgid "warning: symbol %s imported but not in import list" msgstr "" -#: nlmconv.c:655 +#: nlmconv.c:657 msgid "set start address" msgstr "" -#: nlmconv.c:704 +#: nlmconv.c:706 #, c-format msgid "warning: START procedure %s not defined" msgstr "" -#: nlmconv.c:706 +#: nlmconv.c:708 #, c-format msgid "warning: EXIT procedure %s not defined" msgstr "" -#: nlmconv.c:708 +#: nlmconv.c:710 #, c-format msgid "warning: CHECK procedure %s not defined" msgstr "" -#: nlmconv.c:729 nlmconv.c:918 +#: nlmconv.c:731 nlmconv.c:920 msgid "custom section" msgstr "" -#: nlmconv.c:750 nlmconv.c:947 +#: nlmconv.c:752 nlmconv.c:949 msgid "help section" msgstr "" -#: nlmconv.c:772 nlmconv.c:965 +#: nlmconv.c:774 nlmconv.c:967 msgid "message section" msgstr "" -#: nlmconv.c:788 nlmconv.c:998 +#: nlmconv.c:790 nlmconv.c:1000 msgid "module section" msgstr "" -#: nlmconv.c:808 nlmconv.c:1014 +#: nlmconv.c:810 nlmconv.c:1016 msgid "rpc section" msgstr "" #. There is no place to record this information. -#: nlmconv.c:844 +#: nlmconv.c:846 #, c-format msgid "%s: warning: shared libraries can not have uninitialized data" msgstr "" -#: nlmconv.c:865 nlmconv.c:1033 +#: nlmconv.c:867 nlmconv.c:1035 msgid "shared section" msgstr "" -#: nlmconv.c:873 +#: nlmconv.c:875 msgid "warning: No version number given" msgstr "" -#: nlmconv.c:913 nlmconv.c:942 nlmconv.c:960 nlmconv.c:1009 nlmconv.c:1028 +#: nlmconv.c:915 nlmconv.c:944 nlmconv.c:962 nlmconv.c:1011 nlmconv.c:1030 #, c-format msgid "%s: read: %s" msgstr "" -#: nlmconv.c:935 +#: nlmconv.c:937 msgid "warning: MAP and FULLMAP are not supported; try ld -M" msgstr "" -#: nlmconv.c:1107 +#: nlmconv.c:1109 #, c-format msgid "Usage: %s [option(s)] [in-file [out-file]]\n" msgstr "" -#: nlmconv.c:1108 +#: nlmconv.c:1110 msgid " Convert an object file into a NetWare Loadable Module\n" msgstr "" -#: nlmconv.c:1109 +#: nlmconv.c:1111 msgid "" " The options are:\n" " -I --input-target= Set the input binary file format\n" @@ -1388,73 +1389,73 @@ msgid "" " -v --version Display the program's version\n" msgstr "" -#: nlmconv.c:1151 +#: nlmconv.c:1153 #, c-format msgid "support not compiled in for %s" msgstr "" -#: nlmconv.c:1191 +#: nlmconv.c:1193 msgid "make section" msgstr "" -#: nlmconv.c:1205 +#: nlmconv.c:1207 msgid "set section size" msgstr "" -#: nlmconv.c:1211 +#: nlmconv.c:1213 msgid "set section alignment" msgstr "" -#: nlmconv.c:1215 +#: nlmconv.c:1217 msgid "set section flags" msgstr "" -#: nlmconv.c:1226 +#: nlmconv.c:1228 msgid "set .nlmsections size" msgstr "" -#: nlmconv.c:1314 nlmconv.c:1322 nlmconv.c:1331 nlmconv.c:1336 +#: nlmconv.c:1316 nlmconv.c:1324 nlmconv.c:1333 nlmconv.c:1338 msgid "set .nlmsection contents" msgstr "" -#: nlmconv.c:1837 +#: nlmconv.c:1839 msgid "stub section sizes" msgstr "" -#: nlmconv.c:1886 +#: nlmconv.c:1888 msgid "writing stub" msgstr "" -#: nlmconv.c:1975 +#: nlmconv.c:1977 #, c-format msgid "unresolved PC relative reloc against %s" msgstr "" -#: nlmconv.c:2039 +#: nlmconv.c:2041 #, c-format msgid "overflow when adjusting relocation against %s" msgstr "" -#: nlmconv.c:2156 +#: nlmconv.c:2158 #, c-format msgid "%s: execution of %s failed: " msgstr "" -#: nlmconv.c:2171 +#: nlmconv.c:2173 #, c-format msgid "Execution of %s failed" msgstr "" -#: nm.c:246 size.c:85 strings.c:650 +#: nm.c:283 size.c:85 strings.c:657 #, c-format msgid "Usage: %s [option(s)] [file(s)]\n" msgstr "" -#: nm.c:247 +#: nm.c:284 msgid " List symbols in [file(s)] (a.out by default).\n" msgstr "" -#: nm.c:248 +#: nm.c:285 msgid "" " The options are:\n" " -a, --debug-syms Display debugger-only symbols\n" @@ -1464,8 +1465,9 @@ msgid "" "names\n" " The STYLE, if specified, can be `auto' (the " "default),\n" -" `gnu', 'lucid', 'arm', 'hp', 'edg' or 'gnu-new-" -"abi'\n" +" `gnu', `lucid', `arm', `hp', `edg', `gnu-v3', " +"`java'\n" +" or `gnat'\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" @@ -1493,46 +1495,54 @@ msgid "" "\n" msgstr "" -#: nm.c:281 objdump.c:217 +#: nm.c:319 objdump.c:250 #, c-format msgid "Report bugs to %s.\n" msgstr "" -#: nm.c:314 +#: nm.c:352 #, c-format msgid "%s: invalid radix" msgstr "" -#: nm.c:339 +#: nm.c:377 #, c-format msgid "%s: invalid output format" msgstr "" -#: nm.c:456 +#: nm.c:494 msgid "Only -X 32_64 is supported" msgstr "" -#: nm.c:498 +#: nm.c:514 +msgid "Using the --size-sort and --undefined-only options together" +msgstr "" + +#: nm.c:515 +msgid "will produce no output, since undefined symbols have no size." +msgstr "" + +#: nm.c:543 #, c-format msgid "data size %ld" msgstr "" -#: nm.c:523 readelf.c:5391 readelf.c:5427 +#: nm.c:568 readelf.c:5809 readelf.c:5845 #, c-format msgid ": %d" msgstr "" -#: nm.c:525 readelf.c:5393 readelf.c:5439 +#: nm.c:570 readelf.c:5811 readelf.c:5857 #, c-format msgid ": %d" msgstr "" -#: nm.c:527 readelf.c:5395 readelf.c:5442 +#: nm.c:572 readelf.c:5813 readelf.c:5860 #, c-format msgid ": %d" msgstr "" -#: nm.c:1339 +#: nm.c:1376 #, c-format msgid "" "\n" @@ -1541,7 +1551,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1341 +#: nm.c:1378 #, c-format msgid "" "\n" @@ -1550,21 +1560,21 @@ msgid "" "\n" msgstr "" -#: nm.c:1343 nm.c:1401 +#: nm.c:1380 nm.c:1438 msgid "" "Name Value Class Type Size Line " "Section\n" "\n" msgstr "" -#: nm.c:1346 nm.c:1404 +#: nm.c:1383 nm.c:1441 msgid "" "Name Value Class Type " "Size Line Section\n" "\n" msgstr "" -#: nm.c:1397 +#: nm.c:1434 #, c-format msgid "" "\n" @@ -1573,7 +1583,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1399 +#: nm.c:1436 #, c-format msgid "" "\n" @@ -1582,26 +1592,26 @@ msgid "" "\n" msgstr "" -#: nm.c:1614 +#: nm.c:1658 msgid "" "\n" "Archive index:\n" msgstr "" -#: objcopy.c:363 srconv.c:1952 +#: objcopy.c:414 srconv.c:1952 #, c-format msgid "Usage: %s [option(s)] in-file [out-file]\n" msgstr "" -#: objcopy.c:364 +#: objcopy.c:415 msgid " Copies a binary file, possibly transforming it in the process\n" msgstr "" -#: objcopy.c:365 objcopy.c:435 +#: objcopy.c:416 objcopy.c:495 msgid " The options are:\n" msgstr "" -#: objcopy.c:366 +#: objcopy.c:417 msgid "" " -I --input-target Assume input file is in format \n" " -O --output-target Create an output file in format " @@ -1615,10 +1625,12 @@ msgid "" " -p --preserve-dates Copy modified/access timestamps to the " "output\n" " -j --only-section Only copy section into the output\n" +" --add-gnu-debuglink= Add section .gnu_debuglink linking to " +"\n" " -R --remove-section Remove section from the output\n" " -S --strip-all Remove all symbol and relocation " "information\n" -" -g --strip-debug Remove all debugging symbols\n" +" -g --strip-debug Remove all debugging symbols & sections\n" " --strip-unneeded Remove all symbols not needed by " "relocations\n" " -N --strip-symbol Do not copy symbol \n" @@ -1667,6 +1679,8 @@ msgid "" " --remove-leading-char Remove leading character from global " "symbols\n" " --redefine-sym = Redefine symbol name to \n" +" --redefine-syms --redefine-sym for all symbol pairs \n" +" listed in \n" " --srec-len Restrict the length of generated " "Srecords\n" " --srec-forceS3 Restrict the type of generated Srecords " @@ -1677,21 +1691,31 @@ msgid "" " --keep-global-symbols -G for all symbols listed in \n" " --weaken-symbols -W for all symbols listed in \n" " --alt-machine-code Use alternate machine code for output\n" +" --prefix-symbols Add to start of every symbol " +"name\n" +" --prefix-sections Add to start of every section " +"name\n" +" --prefix-alloc-sections \n" +" Add to start of every " +"allocatable\n" +" section name\n" " -v --verbose List all object files modified\n" " -V --version Display this program's version number\n" " -h --help Display this output\n" +" --info List object formats & architectures " +"supported\n" msgstr "" -#: objcopy.c:433 +#: objcopy.c:493 #, c-format msgid "Usage: %s in-file(s)\n" msgstr "" -#: objcopy.c:434 +#: objcopy.c:494 msgid " Removes symbols and sections from files\n" msgstr "" -#: objcopy.c:436 +#: objcopy.c:496 msgid "" " -I --input-target= Assume input file is in format \n" " -O --output-target= Create an output file in format " @@ -1703,7 +1727,7 @@ msgid "" " -R --remove-section= Remove section from the output\n" " -s --strip-all Remove all symbol and relocation " "information\n" -" -g -S -d --strip-debug Remove all debugging symbols\n" +" -g -S -d --strip-debug Remove all debugging symbols & sections\n" " --strip-unneeded Remove all symbols not needed by " "relocations\n" " -N --strip-symbol= Do not copy symbol \n" @@ -1713,217 +1737,239 @@ msgid "" " -v --verbose List all object files modified\n" " -V --version Display this program's version number\n" " -h --help Display this output\n" +" --info List object formats & architectures " +"supported\n" " -o Place stripped output into \n" msgstr "" -#: objcopy.c:506 +#: objcopy.c:567 #, c-format msgid "unrecognized section flag `%s'" msgstr "" -#: objcopy.c:507 +#: objcopy.c:568 #, c-format msgid "supported flags: %s" msgstr "" -#: objcopy.c:584 objcopy.c:2243 +#: objcopy.c:645 objcopy.c:2526 #, c-format msgid "cannot stat: %s: %s" msgstr "" -#: objcopy.c:591 objcopy.c:2261 +#: objcopy.c:652 objcopy.c:2544 #, c-format msgid "cannot open: %s: %s" msgstr "" -#: objcopy.c:594 objcopy.c:2265 +#: objcopy.c:655 objcopy.c:2548 #, c-format msgid "%s: fread failed" msgstr "" -#: objcopy.c:667 +#: objcopy.c:728 #, c-format msgid "Ignoring rubbish found on line %d of %s" msgstr "" -#: objcopy.c:888 +#: objcopy.c:979 #, c-format msgid "%s: Multiple redefinition of symbol \"%s\"" msgstr "" -#: objcopy.c:893 +#: objcopy.c:983 #, c-format msgid "%s: Symbol \"%s\" is target of more than one redefinition" msgstr "" -#: objcopy.c:945 +#: objcopy.c:1010 +#, c-format +msgid "couldn't open symbol redefinition file %s (error: %s)" +msgstr "" + +#: objcopy.c:1088 +#, c-format +msgid "%s: garbage at end of line %d" +msgstr "" + +#: objcopy.c:1091 +#, c-format +msgid "%s: missing new symbol name at line %d" +msgstr "" + +#: objcopy.c:1101 +#, c-format +msgid "%s: premature end of file at line %d" +msgstr "" + +#: objcopy.c:1147 msgid "Unable to change endianness of input file(s)" msgstr "" -#: objcopy.c:953 +#: objcopy.c:1155 #, c-format msgid "copy from %s(%s) to %s(%s)\n" msgstr "" -#: objcopy.c:977 +#: objcopy.c:1182 #, c-format msgid "Warning: Output file cannot represent architecture %s" msgstr "" -#: objcopy.c:1004 +#: objcopy.c:1211 #, c-format msgid "can't create section `%s': %s" msgstr "" -#: objcopy.c:1090 +#: objcopy.c:1304 #, c-format msgid "Can't fill gap after %s: %s" msgstr "" -#: objcopy.c:1115 +#: objcopy.c:1329 #, c-format msgid "Can't add padding to %s: %s" msgstr "" -#: objcopy.c:1254 +#: objcopy.c:1485 #, c-format msgid "%s: error copying private BFD data: %s" msgstr "" -#: objcopy.c:1267 +#: objcopy.c:1498 msgid "unknown alternate machine code, ignored" msgstr "" -#: objcopy.c:1300 objcopy.c:1330 +#: objcopy.c:1531 objcopy.c:1561 #, c-format msgid "cannot mkdir %s for archive copying (error: %s)" msgstr "" -#: objcopy.c:1497 +#: objcopy.c:1749 #, c-format msgid "Multiple renames of section %s" msgstr "" -#: objcopy.c:1581 +#: objcopy.c:1840 msgid "making" msgstr "" -#: objcopy.c:1590 +#: objcopy.c:1849 msgid "size" msgstr "" -#: objcopy.c:1604 +#: objcopy.c:1863 msgid "vma" msgstr "" -#: objcopy.c:1630 +#: objcopy.c:1888 msgid "alignment" msgstr "" -#: objcopy.c:1638 +#: objcopy.c:1896 msgid "flags" msgstr "" -#: objcopy.c:1655 +#: objcopy.c:1918 msgid "private data" msgstr "" -#: objcopy.c:1663 +#: objcopy.c:1926 #, c-format msgid "%s: section `%s': error in %s: %s" msgstr "" -#: objcopy.c:1946 +#: objcopy.c:2199 #, c-format msgid "%s: can't create debugging section: %s" msgstr "" -#: objcopy.c:1961 +#: objcopy.c:2214 #, c-format msgid "%s: can't set debugging section contents: %s" msgstr "" -#: objcopy.c:1970 +#: objcopy.c:2223 #, c-format msgid "%s: don't know how to write debugging information for %s" msgstr "" -#: objcopy.c:2078 +#: objcopy.c:2346 #, c-format msgid "%s: cannot stat: %s" msgstr "" -#: objcopy.c:2129 +#: objcopy.c:2400 msgid "byte number must be non-negative" msgstr "" -#: objcopy.c:2139 +#: objcopy.c:2410 msgid "interleave must be positive" msgstr "" -#: objcopy.c:2159 objcopy.c:2167 +#: objcopy.c:2430 objcopy.c:2438 #, c-format msgid "%s both copied and removed" msgstr "" -#: objcopy.c:2240 objcopy.c:2310 objcopy.c:2410 objcopy.c:2437 objcopy.c:2461 -#: objcopy.c:2465 objcopy.c:2485 +#: objcopy.c:2523 objcopy.c:2593 objcopy.c:2693 objcopy.c:2724 objcopy.c:2748 +#: objcopy.c:2752 objcopy.c:2772 #, c-format msgid "bad format for %s" msgstr "" -#: objcopy.c:2379 +#: objcopy.c:2662 #, c-format msgid "Warning: truncating gap-fill from 0x%s to 0x%x" msgstr "" -#: objcopy.c:2531 +#: objcopy.c:2818 msgid "alternate machine code index must be positive" msgstr "" -#: objcopy.c:2550 +#: objcopy.c:2856 msgid "byte number must be less than interleave" msgstr "" -#: objcopy.c:2577 +#: objcopy.c:2883 #, c-format msgid "architecture %s unknown" msgstr "" -#: objcopy.c:2581 +#: objcopy.c:2887 msgid "" "Warning: input target 'binary' required for binary architecture parameter." msgstr "" -#: objcopy.c:2582 +#: objcopy.c:2888 #, c-format msgid " Argument %s ignored" msgstr "" -#: objcopy.c:2588 +#: objcopy.c:2894 #, c-format msgid "Cannot stat: %s: %s" msgstr "" -#: objcopy.c:2628 objcopy.c:2642 +#: objcopy.c:2934 objcopy.c:2948 #, c-format msgid "%s %s%c0x%s never used" msgstr "" -#: objdump.c:165 +#: objdump.c:197 #, c-format msgid "Usage: %s \n" msgstr "" -#: objdump.c:166 +#: objdump.c:198 msgid " Display information from object .\n" msgstr "" -#: objdump.c:167 +#: objdump.c:199 msgid " At least one of the following switches must be given:\n" msgstr "" -#: objdump.c:168 +#: objdump.c:200 msgid "" " -a, --archive-headers Display archive header information\n" " -f, --file-headers Display the contents of the overall file header\n" @@ -1949,13 +1995,13 @@ msgid "" " -H, --help Display this information\n" msgstr "" -#: objdump.c:190 +#: objdump.c:222 msgid "" "\n" " The following switches are optional:\n" msgstr "" -#: objdump.c:191 +#: objdump.c:223 msgid "" " -b, --target=BFDNAME Specify the target object format as " "BFDNAME\n" @@ -1972,14 +2018,15 @@ msgid "" "output\n" " -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" +"`gnu',\n" +" `lucid', `arm', `hp', `edg', `gnu-v3', " +"`java'\n" +" or `gnat'\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=ADDR Only process data whoes address is >= ADDR\n" -" --stop-address=ADDR Only process data whoes address is <= ADDR\n" +" --start-address=ADDR Only process data whose address is >= ADDR\n" +" --stop-address=ADDR Only process data whose address is <= ADDR\n" " --prefix-addresses Print complete address alongside " "disassembly\n" " --[no-]show-raw-insn Display hex alongside symbolic disassembly\n" @@ -1988,324 +2035,322 @@ msgid "" "\n" msgstr "" -#: objdump.c:358 +#: objdump.c:391 msgid "Sections:\n" msgstr "" -#: objdump.c:361 objdump.c:365 +#: objdump.c:394 objdump.c:398 msgid "Idx Name Size VMA LMA File off Algn" msgstr "" -#: objdump.c:367 +#: objdump.c:400 msgid "" "Idx Name Size VMA LMA File off " "Algn" msgstr "" -#: objdump.c:371 +#: objdump.c:404 msgid " Flags" msgstr "" -#: objdump.c:419 -#, c-format -msgid "%s: not a dynamic object" +#: objdump.c:406 +msgid " Pg" msgstr "" -#: objdump.c:433 +#: objdump.c:451 #, c-format -msgid "%s: No dynamic symbols" +msgid "%s: not a dynamic object" msgstr "" -#: objdump.c:1114 +#: objdump.c:1144 msgid "Out of virtual memory" msgstr "" -#: objdump.c:1543 +#: objdump.c:1574 #, c-format msgid "Can't use supplied machine %s" msgstr "" -#: objdump.c:1561 +#: objdump.c:1592 #, c-format msgid "Can't disassemble for architecture %s\n" msgstr "" -#: objdump.c:1643 +#: objdump.c:1682 #, c-format msgid "Disassembly of section %s:\n" msgstr "" -#: objdump.c:1818 +#: objdump.c:1847 #, c-format msgid "" "No %s section present\n" "\n" msgstr "" -#: objdump.c:1825 +#: objdump.c:1854 #, c-format msgid "%s has no %s section" msgstr "" -#: objdump.c:1839 +#: objdump.c:1868 #, c-format msgid "Reading %s section of %s failed: %s" msgstr "" -#: objdump.c:1851 +#: objdump.c:1880 #, c-format msgid "Reading %s section of %s failed: %s\n" msgstr "" -#: objdump.c:1894 +#: objdump.c:1923 #, c-format msgid "" "Contents of %s section:\n" "\n" msgstr "" -#: objdump.c:1994 +#: objdump.c:2021 #, c-format msgid "architecture: %s, " msgstr "" -#: objdump.c:1997 +#: objdump.c:2024 #, c-format msgid "flags 0x%08x:\n" msgstr "" -#: objdump.c:2010 +#: objdump.c:2038 msgid "" "\n" "start address 0x" msgstr "" -#: objdump.c:2042 +#: objdump.c:2071 #, c-format msgid "" "\n" "%s: file format %s\n" msgstr "" -#: objdump.c:2084 +#: objdump.c:2111 #, c-format msgid "%s: printing debugging information failed" msgstr "" -#: objdump.c:2161 +#: objdump.c:2190 #, c-format msgid "In archive %s:\n" msgstr "" -#: objdump.c:2213 +#: objdump.c:2249 #, c-format msgid "Contents of section %s:\n" msgstr "" -#: objdump.c:2719 -#, c-format -msgid "BFD header file version %s\n" +#: objdump.c:2369 +msgid "no symbols\n" msgstr "" -#: objdump.c:2808 +#: objdump.c:2718 msgid "unrecognized -E option" msgstr "" -#: objdump.c:2819 +#: objdump.c:2729 #, c-format msgid "unrecognized --endian type `%s'" msgstr "" -#: rdcoff.c:204 +#: rdcoff.c:206 #, c-format msgid "parse_coff_type: Bad type code 0x%x" msgstr "" -#: rdcoff.c:422 rdcoff.c:530 rdcoff.c:729 +#: rdcoff.c:424 rdcoff.c:532 rdcoff.c:731 #, c-format msgid "bfd_coff_get_syment failed: %s" msgstr "" -#: rdcoff.c:438 rdcoff.c:749 +#: rdcoff.c:440 rdcoff.c:751 #, c-format msgid "bfd_coff_get_auxent failed: %s" msgstr "" -#: rdcoff.c:816 +#: rdcoff.c:818 #, c-format msgid "%ld: .bf without preceding function" msgstr "" -#: rdcoff.c:866 +#: rdcoff.c:868 #, c-format msgid "%ld: unexpected .ef\n" msgstr "" -#: rddbg.c:87 +#: rddbg.c:91 #, c-format msgid "%s: no recognized debugging information" msgstr "" -#: rddbg.c:410 +#: rddbg.c:415 msgid "Last stabs entries before error:\n" msgstr "" -#: readelf.c:328 +#: readelf.c:455 #, c-format msgid "%s: Error: " msgstr "" -#: readelf.c:339 +#: readelf.c:466 #, c-format msgid "%s: Warning: " msgstr "" -#: readelf.c:361 +#: readelf.c:488 #, c-format -msgid "Unable to seek to %x for %s\n" +msgid "Unable to seek to 0x%x for %s\n" msgstr "" -#: readelf.c:372 +#: readelf.c:499 #, c-format -msgid "Out of memory allocating %d bytes for %s\n" +msgid "Out of memory allocating 0x%x bytes for %s\n" msgstr "" -#: readelf.c:380 +#: readelf.c:507 #, c-format -msgid "Unable to read in %d bytes of %s\n" +msgid "Unable to read in 0x%x bytes of %s\n" msgstr "" -#: readelf.c:433 readelf.c:591 +#: readelf.c:560 readelf.c:614 readelf.c:798 readelf.c:833 #, c-format msgid "Unhandled data length: %d\n" msgstr "" -#: readelf.c:675 +#: readelf.c:924 msgid "Don't know about relocations on this machine architecture\n" msgstr "" -#: readelf.c:697 readelf.c:726 readelf.c:772 readelf.c:799 +#: readelf.c:946 readelf.c:975 readelf.c:1021 readelf.c:1049 msgid "relocs" msgstr "" -#: readelf.c:708 readelf.c:737 readelf.c:782 readelf.c:809 +#: readelf.c:957 readelf.c:986 readelf.c:1031 readelf.c:1059 msgid "out of memory parsing relocs" msgstr "" -#: readelf.c:861 +#: readelf.c:1112 msgid "" " Offset Info Type Sym. Value Symbol's Name + Addend\n" msgstr "" -#: readelf.c:863 +#: readelf.c:1114 msgid " Offset Info Type Sym.Value Sym. Name + Addend\n" msgstr "" -#: readelf.c:868 +#: readelf.c:1119 msgid " Offset Info Type Sym. Value Symbol's Name\n" msgstr "" -#: readelf.c:870 +#: readelf.c:1121 msgid " Offset Info Type Sym.Value Sym. Name\n" msgstr "" -#: readelf.c:878 +#: readelf.c:1129 msgid "" -" Offset Info Type Symbol's Value " +" Offset Info Type Symbol's Value " "Symbol's Name + Addend\n" msgstr "" -#: readelf.c:880 +#: readelf.c:1131 msgid "" " Offset Info Type Sym. Value Sym. Name + " "Addend\n" msgstr "" -#: readelf.c:885 +#: readelf.c:1136 msgid "" -" Offset Info Type Symbol's Value " +" Offset Info Type Symbol's Value " "Symbol's Name\n" msgstr "" -#: readelf.c:887 +#: readelf.c:1138 msgid "" " Offset Info Type Sym. Value Sym. Name\n" msgstr "" -#: readelf.c:1134 readelf.c:1136 readelf.c:1184 readelf.c:1186 readelf.c:1195 -#: readelf.c:1197 +#: readelf.c:1414 readelf.c:1416 readelf.c:1492 readelf.c:1494 readelf.c:1503 +#: readelf.c:1505 #, c-format msgid "unrecognized: %-7lx" msgstr "" -#: readelf.c:1158 +#: readelf.c:1466 #, c-format msgid "" msgstr "" -#: readelf.c:1423 +#: readelf.c:1743 #, c-format msgid "Processor Specific: %lx" msgstr "" -#: readelf.c:1442 +#: readelf.c:1762 #, c-format msgid "Operating System specific: %lx" msgstr "" -#: readelf.c:1445 readelf.c:2086 +#: readelf.c:1765 readelf.c:2417 #, c-format msgid ": %lx" msgstr "" -#: readelf.c:1459 +#: readelf.c:1779 msgid "NONE (None)" msgstr "" -#: readelf.c:1460 +#: readelf.c:1780 msgid "REL (Relocatable file)" msgstr "" -#: readelf.c:1461 +#: readelf.c:1781 msgid "EXEC (Executable file)" msgstr "" -#: readelf.c:1462 +#: readelf.c:1782 msgid "DYN (Shared object file)" msgstr "" -#: readelf.c:1463 +#: readelf.c:1783 msgid "CORE (Core file)" msgstr "" -#: readelf.c:1467 +#: readelf.c:1787 #, c-format msgid "Processor Specific: (%x)" msgstr "" -#: readelf.c:1469 +#: readelf.c:1789 #, c-format msgid "OS Specific: (%x)" msgstr "" -#: readelf.c:1471 readelf.c:1573 readelf.c:2238 +#: readelf.c:1791 readelf.c:1898 readelf.c:2574 #, c-format msgid ": %x" msgstr "" -#: readelf.c:1484 +#: readelf.c:1804 msgid "None" msgstr "" -#: readelf.c:2280 +#: readelf.c:2616 msgid "Usage: readelf elf-file(s)\n" msgstr "" -#: readelf.c:2281 +#: readelf.c:2617 msgid " Display information about the contents of ELF format files\n" msgstr "" -#: readelf.c:2282 +#: readelf.c:2618 msgid "" " Options are:\n" " -a --all Equivalent to: -h -l -S -s -r -d -V -A -I\n" @@ -2333,13 +2378,13 @@ msgid "" " Display the contents of DWARF2 debug sections\n" msgstr "" -#: readelf.c:2304 +#: readelf.c:2640 msgid "" " -i --instruction-dump=\n" " Disassemble the contents of section \n" msgstr "" -#: readelf.c:2308 +#: readelf.c:2644 msgid "" " -I --histogram Display histogram of bucket list lengths\n" " -W --wide Allow output width to exceed 80 characters\n" @@ -2347,312 +2392,321 @@ msgid "" " -v --version Display the version number of readelf\n" msgstr "" -#: readelf.c:2330 +#: readelf.c:2666 readelf.c:10765 msgid "Out of memory allocating dump request table." msgstr "" -#: readelf.c:2494 readelf.c:2570 +#: readelf.c:2830 readelf.c:2906 #, c-format msgid "Unrecognized debug option '%s'\n" msgstr "" -#: readelf.c:2604 +#: readelf.c:2940 #, c-format msgid "Invalid option '-%c'\n" msgstr "" -#: readelf.c:2617 +#: readelf.c:2953 msgid "Nothing to do.\n" msgstr "" -#: readelf.c:2630 readelf.c:2647 readelf.c:4952 +#: readelf.c:2966 readelf.c:2983 readelf.c:5366 msgid "none" msgstr "" -#: readelf.c:2634 readelf.c:2651 readelf.c:2679 +#: readelf.c:2970 readelf.c:2987 readelf.c:3018 #, c-format msgid "" msgstr "" -#: readelf.c:2648 +#: readelf.c:2984 msgid "2's complement, little endian" msgstr "" -#: readelf.c:2649 +#: readelf.c:2985 msgid "2's complement, big endian" msgstr "" -#: readelf.c:2676 +#: readelf.c:3015 msgid "Standalone App" msgstr "" -#: readelf.c:2694 +#: readelf.c:3034 msgid "Not an ELF file - it has the wrong magic bytes at the start\n" msgstr "" -#: readelf.c:2702 +#: readelf.c:3042 msgid "ELF Header:\n" msgstr "" -#: readelf.c:2703 +#: readelf.c:3043 msgid " Magic: " msgstr "" -#: readelf.c:2707 +#: readelf.c:3047 #, c-format msgid " Class: %s\n" msgstr "" -#: readelf.c:2709 +#: readelf.c:3049 #, c-format msgid " Data: %s\n" msgstr "" -#: readelf.c:2711 +#: readelf.c:3051 #, c-format msgid " Version: %d %s\n" msgstr "" -#: readelf.c:2718 +#: readelf.c:3058 #, c-format msgid " OS/ABI: %s\n" msgstr "" -#: readelf.c:2720 +#: readelf.c:3060 #, c-format msgid " ABI Version: %d\n" msgstr "" -#: readelf.c:2722 +#: readelf.c:3062 #, c-format msgid " Type: %s\n" msgstr "" -#: readelf.c:2724 +#: readelf.c:3064 #, c-format msgid " Machine: %s\n" msgstr "" -#: readelf.c:2726 +#: readelf.c:3066 #, c-format msgid " Version: 0x%lx\n" msgstr "" -#: readelf.c:2729 +#: readelf.c:3069 msgid " Entry point address: " msgstr "" -#: readelf.c:2731 +#: readelf.c:3071 msgid "" "\n" " Start of program headers: " msgstr "" -#: readelf.c:2733 +#: readelf.c:3073 msgid "" " (bytes into file)\n" " Start of section headers: " msgstr "" -#: readelf.c:2735 +#: readelf.c:3075 msgid " (bytes into file)\n" msgstr "" -#: readelf.c:2737 +#: readelf.c:3077 #, c-format msgid " Flags: 0x%lx%s\n" msgstr "" -#: readelf.c:2740 +#: readelf.c:3080 #, c-format msgid " Size of this header: %ld (bytes)\n" msgstr "" -#: readelf.c:2742 +#: readelf.c:3082 #, c-format msgid " Size of program headers: %ld (bytes)\n" msgstr "" -#: readelf.c:2744 +#: readelf.c:3084 #, c-format msgid " Number of program headers: %ld\n" msgstr "" -#: readelf.c:2746 +#: readelf.c:3086 #, c-format msgid " Size of section headers: %ld (bytes)\n" msgstr "" -#: readelf.c:2748 +#: readelf.c:3088 #, c-format msgid " Number of section headers: %ld" msgstr "" -#: readelf.c:2753 +#: readelf.c:3093 #, c-format msgid " Section header string table index: %ld" msgstr "" -#: readelf.c:2787 readelf.c:2823 +#: readelf.c:3127 readelf.c:3163 msgid "program headers" msgstr "" -#: readelf.c:2857 +#: readelf.c:3203 readelf.c:3480 readelf.c:3526 readelf.c:3589 readelf.c:3656 +#: readelf.c:4715 readelf.c:4758 readelf.c:4948 readelf.c:5917 readelf.c:5931 +#: readelf.c:10411 +msgid "Out of memory\n" +msgstr "" + +#: readelf.c:3231 msgid "" "\n" "There are no program headers in this file.\n" msgstr "" -#: readelf.c:2863 +#: readelf.c:3237 #, c-format msgid "" "\n" "Elf file type is %s\n" msgstr "" -#: readelf.c:2864 +#: readelf.c:3238 msgid "Entry point " msgstr "" -#: readelf.c:2866 +#: readelf.c:3240 #, c-format msgid "" "\n" "There are %d program headers, starting at offset " msgstr "" -#: readelf.c:2877 readelf.c:3104 readelf.c:3150 readelf.c:3213 readelf.c:3280 -#: readelf.c:4314 readelf.c:4357 readelf.c:4546 readelf.c:5499 readelf.c:5513 -#: readelf.c:9747 readelf.c:9787 -msgid "Out of memory\n" -msgstr "" - -#: readelf.c:2895 readelf.c:2897 +#: readelf.c:3252 readelf.c:3254 msgid "" "\n" "Program Headers:\n" msgstr "" -#: readelf.c:2901 +#: readelf.c:3258 msgid "" " Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n" msgstr "" -#: readelf.c:2904 +#: readelf.c:3261 msgid "" " Type Offset VirtAddr PhysAddr FileSiz " "MemSiz Flg Align\n" msgstr "" -#: readelf.c:2908 +#: readelf.c:3265 msgid " Type Offset VirtAddr PhysAddr\n" msgstr "" -#: readelf.c:2910 +#: readelf.c:3267 msgid " FileSiz MemSiz Flags Align\n" msgstr "" -#: readelf.c:3010 +#: readelf.c:3360 msgid "more than one dynamic segment\n" msgstr "" -#: readelf.c:3018 +#: readelf.c:3368 msgid "Unable to find program interpreter name\n" msgstr "" -#: readelf.c:3025 +#: readelf.c:3375 #, c-format msgid "" "\n" " [Requesting program interpreter: %s]" msgstr "" -#: readelf.c:3043 +#: readelf.c:3387 msgid "" "\n" " Section to Segment mapping:\n" msgstr "" -#: readelf.c:3044 +#: readelf.c:3388 msgid " Segment Sections...\n" msgstr "" -#: readelf.c:3095 readelf.c:3141 +#: readelf.c:3437 +msgid "Cannot interpret virtual addresses without program headers.\n" +msgstr "" + +#: readelf.c:3453 +#, c-format +msgid "Virtual address 0x%lx not located in any PT_LOAD segment.\n" +msgstr "" + +#: readelf.c:3471 readelf.c:3517 msgid "section headers" msgstr "" -#: readelf.c:3189 readelf.c:3256 +#: readelf.c:3565 readelf.c:3632 msgid "symbols" msgstr "" -#: readelf.c:3200 readelf.c:3267 +#: readelf.c:3576 readelf.c:3643 msgid "symtab shndx" msgstr "" -#: readelf.c:3369 +#: readelf.c:3745 msgid "" "\n" "There are no sections in this file.\n" msgstr "" -#: readelf.c:3375 +#: readelf.c:3751 #, c-format msgid "There are %d section headers, starting at offset 0x%lx:\n" msgstr "" -#: readelf.c:3392 readelf.c:3706 readelf.c:4053 readelf.c:5650 +#: readelf.c:3768 readelf.c:4098 readelf.c:4433 readelf.c:6070 msgid "string table" msgstr "" -#: readelf.c:3413 +#: readelf.c:3793 msgid "File contains multiple dynamic symbol tables\n" msgstr "" -#: readelf.c:3425 +#: readelf.c:3805 msgid "File contains multiple dynamic string tables\n" msgstr "" -#: readelf.c:3431 +#: readelf.c:3811 msgid "dynamic strings" msgstr "" -#: readelf.c:3437 +#: readelf.c:3817 msgid "File contains multiple symtab shndx tables\n" msgstr "" -#: readelf.c:3475 +#: readelf.c:3855 msgid "" "\n" "Section Headers:\n" msgstr "" -#: readelf.c:3477 +#: readelf.c:3857 msgid "" "\n" "Section Header:\n" msgstr "" -#: readelf.c:3481 +#: readelf.c:3861 msgid "" " [Nr] Name Type Addr Off Size ES Flg Lk " "Inf Al\n" msgstr "" -#: readelf.c:3484 +#: readelf.c:3864 msgid "" " [Nr] Name Type Address Off Size ES " "Flg Lk Inf Al\n" msgstr "" -#: readelf.c:3487 +#: readelf.c:3867 msgid " [Nr] Name Type Address Offset\n" msgstr "" -#: readelf.c:3488 +#: readelf.c:3868 msgid " Size EntSize Flags Link Info Align\n" msgstr "" -#: readelf.c:3583 +#: readelf.c:3963 msgid "" "Key to Flags:\n" " W (write), A (alloc), X (execute), M (merge), S (strings)\n" @@ -2660,500 +2714,500 @@ msgid "" " O (extra OS processing required) o (OS specific), p (processor specific)\n" msgstr "" -#: readelf.c:3644 +#: readelf.c:4031 #, c-format msgid "" "\n" -"Relocation section at offset 0x%lx contains %ld bytes:\n" +"'%s' relocation section at offset 0x%lx contains %ld bytes:\n" msgstr "" -#: readelf.c:3651 +#: readelf.c:4043 msgid "" "\n" "There are no dynamic relocations in this file.\n" msgstr "" -#: readelf.c:3678 +#: readelf.c:4070 msgid "" "\n" "Relocation section " msgstr "" -#: readelf.c:3683 readelf.c:4116 readelf.c:4130 +#: readelf.c:4075 readelf.c:4496 readelf.c:4510 #, c-format msgid "'%s'" msgstr "" -#: readelf.c:3685 readelf.c:4132 +#: readelf.c:4077 readelf.c:4512 #, c-format msgid " at offset 0x%lx contains %lu entries:\n" msgstr "" -#: readelf.c:3723 +#: readelf.c:4115 msgid "" "\n" "There are no relocations in this file.\n" msgstr "" -#: readelf.c:3919 +#: readelf.c:4299 msgid "unwind table" msgstr "" -#: readelf.c:3970 readelf.c:3982 readelf.c:7977 readelf.c:7989 +#: readelf.c:4350 readelf.c:4362 readelf.c:8499 readelf.c:8511 #, c-format msgid "Skipping unexpected symbol type %u\n" msgstr "" -#: readelf.c:3990 +#: readelf.c:4370 #, c-format msgid "Skipping unexpected relocation type %s\n" msgstr "" -#: readelf.c:4035 readelf.c:4060 +#: readelf.c:4415 readelf.c:4440 msgid "" "\n" "There are no unwind sections in this file.\n" msgstr "" -#: readelf.c:4111 +#: readelf.c:4491 msgid "" "\n" "Could not find unwind info section for " msgstr "" -#: readelf.c:4123 +#: readelf.c:4503 msgid "unwind info" msgstr "" -#: readelf.c:4125 +#: readelf.c:4505 msgid "" "\n" "Unwind section " msgstr "" -#: readelf.c:4298 readelf.c:4341 +#: readelf.c:4699 readelf.c:4742 msgid "dynamic segment" msgstr "" -#: readelf.c:4419 +#: readelf.c:4820 msgid "" "\n" "There is no dynamic segment in this file.\n" msgstr "" -#: readelf.c:4453 +#: readelf.c:4854 msgid "Unable to seek to end of file!" msgstr "" -#: readelf.c:4464 +#: readelf.c:4865 msgid "Unable to determine the number of symbols to load\n" msgstr "" -#: readelf.c:4494 +#: readelf.c:4895 msgid "Unable to seek to end of file\n" msgstr "" -#: readelf.c:4500 +#: readelf.c:4901 msgid "Unable to determine the length of the dynamic string table\n" msgstr "" -#: readelf.c:4505 +#: readelf.c:4906 msgid "dynamic string table" msgstr "" -#: readelf.c:4539 +#: readelf.c:4941 msgid "symbol information" msgstr "" -#: readelf.c:4563 +#: readelf.c:4965 #, c-format msgid "" "\n" -"Dynamic segment at offset 0x%x contains %ld entries:\n" +"Dynamic segment at offset 0x%lx contains %ld entries:\n" msgstr "" -#: readelf.c:4566 +#: readelf.c:4968 msgid " Tag Type Name/Value\n" msgstr "" -#: readelf.c:4602 +#: readelf.c:5004 msgid "Auxiliary library" msgstr "" -#: readelf.c:4606 +#: readelf.c:5008 msgid "Filter library" msgstr "" -#: readelf.c:4610 +#: readelf.c:5012 msgid "Configuration file" msgstr "" -#: readelf.c:4614 +#: readelf.c:5016 msgid "Dependency audit library" msgstr "" -#: readelf.c:4618 +#: readelf.c:5020 msgid "Audit library" msgstr "" -#: readelf.c:4636 readelf.c:4662 readelf.c:4688 +#: readelf.c:5038 readelf.c:5066 readelf.c:5094 msgid "Flags:" msgstr "" -#: readelf.c:4638 readelf.c:4664 readelf.c:4690 +#: readelf.c:5041 readelf.c:5069 readelf.c:5096 msgid " None\n" msgstr "" -#: readelf.c:4809 +#: readelf.c:5217 #, c-format msgid "Shared library: [%s]" msgstr "" -#: readelf.c:4812 +#: readelf.c:5220 msgid " program interpreter" msgstr "" -#: readelf.c:4816 +#: readelf.c:5224 #, c-format msgid "Library soname: [%s]" msgstr "" -#: readelf.c:4820 +#: readelf.c:5228 #, c-format msgid "Library rpath: [%s]" msgstr "" -#: readelf.c:4824 +#: readelf.c:5232 #, c-format msgid "Library runpath: [%s]" msgstr "" -#: readelf.c:4887 +#: readelf.c:5296 #, c-format msgid "Not needed object: [%s]\n" msgstr "" -#: readelf.c:4998 +#: readelf.c:5412 #, c-format msgid "" "\n" "Version definition section '%s' contains %ld entries:\n" msgstr "" -#: readelf.c:5001 +#: readelf.c:5415 msgid " Addr: 0x" msgstr "" -#: readelf.c:5003 readelf.c:5198 +#: readelf.c:5417 readelf.c:5612 #, c-format msgid " Offset: %#08lx Link: %lx (%s)\n" msgstr "" -#: readelf.c:5010 +#: readelf.c:5424 msgid "version definition section" msgstr "" -#: readelf.c:5036 +#: readelf.c:5450 #, c-format msgid " %#06x: Rev: %d Flags: %s" msgstr "" -#: readelf.c:5039 +#: readelf.c:5453 #, c-format msgid " Index: %d Cnt: %d " msgstr "" -#: readelf.c:5050 +#: readelf.c:5464 #, c-format msgid "Name: %s\n" msgstr "" -#: readelf.c:5052 +#: readelf.c:5466 #, c-format msgid "Name index: %ld\n" msgstr "" -#: readelf.c:5067 +#: readelf.c:5481 #, c-format msgid " %#06x: Parent %d: %s\n" msgstr "" -#: readelf.c:5070 +#: readelf.c:5484 #, c-format msgid " %#06x: Parent %d, name index: %ld\n" msgstr "" -#: readelf.c:5089 +#: readelf.c:5503 #, c-format msgid "" "\n" "Version needs section '%s' contains %ld entries:\n" msgstr "" -#: readelf.c:5092 +#: readelf.c:5506 msgid " Addr: 0x" msgstr "" -#: readelf.c:5094 +#: readelf.c:5508 #, c-format msgid " Offset: %#08lx Link to section: %ld (%s)\n" msgstr "" -#: readelf.c:5100 +#: readelf.c:5514 msgid "version need section" msgstr "" -#: readelf.c:5122 +#: readelf.c:5536 #, c-format msgid " %#06x: Version: %d" msgstr "" -#: readelf.c:5125 +#: readelf.c:5539 #, c-format msgid " File: %s" msgstr "" -#: readelf.c:5127 +#: readelf.c:5541 #, c-format msgid " File: %lx" msgstr "" -#: readelf.c:5129 +#: readelf.c:5543 #, c-format msgid " Cnt: %d\n" msgstr "" -#: readelf.c:5147 +#: readelf.c:5561 #, c-format msgid " %#06x: Name: %s" msgstr "" -#: readelf.c:5150 +#: readelf.c:5564 #, c-format msgid " %#06x: Name index: %lx" msgstr "" -#: readelf.c:5153 +#: readelf.c:5567 #, c-format msgid " Flags: %s Version: %d\n" msgstr "" -#: readelf.c:5189 +#: readelf.c:5603 msgid "version string table" msgstr "" -#: readelf.c:5193 +#: readelf.c:5607 #, c-format msgid "" "\n" "Version symbols section '%s' contains %d entries:\n" msgstr "" -#: readelf.c:5196 +#: readelf.c:5610 msgid " Addr: " msgstr "" -#: readelf.c:5206 +#: readelf.c:5622 msgid "version symbol data" msgstr "" -#: readelf.c:5233 +#: readelf.c:5649 msgid " 0 (*local*) " msgstr "" -#: readelf.c:5237 +#: readelf.c:5653 msgid " 1 (*global*) " msgstr "" -#: readelf.c:5272 readelf.c:5707 +#: readelf.c:5689 readelf.c:6129 msgid "version need" msgstr "" -#: readelf.c:5282 +#: readelf.c:5699 msgid "version need aux (2)" msgstr "" -#: readelf.c:5323 readelf.c:5769 +#: readelf.c:5741 readelf.c:6192 msgid "version def" msgstr "" -#: readelf.c:5342 readelf.c:5784 +#: readelf.c:5760 readelf.c:6207 msgid "version def aux" msgstr "" -#: readelf.c:5373 +#: readelf.c:5791 msgid "" "\n" "No version information found in this file.\n" msgstr "" -#: readelf.c:5505 +#: readelf.c:5923 msgid "Unable to read in dynamic data\n" msgstr "" -#: readelf.c:5547 +#: readelf.c:5967 msgid "Unable to seek to start of dynamic information" msgstr "" -#: readelf.c:5553 +#: readelf.c:5973 msgid "Failed to read in number of buckets\n" msgstr "" -#: readelf.c:5559 +#: readelf.c:5979 msgid "Failed to read in number of chains\n" msgstr "" -#: readelf.c:5579 +#: readelf.c:5999 msgid "" "\n" "Symbol table for image:\n" msgstr "" -#: readelf.c:5581 +#: readelf.c:6001 msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:5583 +#: readelf.c:6003 msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:5628 +#: readelf.c:6048 #, c-format msgid "" "\n" "Symbol table '%s' contains %lu entries:\n" msgstr "" -#: readelf.c:5632 +#: readelf.c:6052 msgid " Num: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:5634 +#: readelf.c:6054 msgid " Num: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:5680 +#: readelf.c:6101 msgid "version data" msgstr "" -#: readelf.c:5720 +#: readelf.c:6142 msgid "version need aux (3)" msgstr "" -#: readelf.c:5745 +#: readelf.c:6167 msgid "bad dynamic symbol" msgstr "" -#: readelf.c:5807 +#: readelf.c:6230 msgid "" "\n" "Dynamic symbol information is not available for displaying symbols.\n" msgstr "" -#: readelf.c:5819 +#: readelf.c:6242 #, c-format msgid "" "\n" "Histogram for bucket list length (total of %d buckets):\n" msgstr "" -#: readelf.c:5821 +#: readelf.c:6244 #, c-format msgid " Length Number %% of total Coverage\n" msgstr "" -#: readelf.c:5826 readelf.c:5845 readelf.c:9234 readelf.c:9426 +#: readelf.c:6249 readelf.c:6268 readelf.c:9898 readelf.c:10090 msgid "Out of memory" msgstr "" -#: readelf.c:5894 +#: readelf.c:6317 #, c-format msgid "" "\n" "Dynamic info segment at offset 0x%lx contains %d entries:\n" msgstr "" -#: readelf.c:5897 +#: readelf.c:6320 msgid " Num: Name BoundTo Flags\n" msgstr "" -#: readelf.c:5949 +#: readelf.c:6373 #, c-format msgid "" "\n" "Assembly dump of section %s\n" msgstr "" -#: readelf.c:5972 +#: readelf.c:6396 #, c-format msgid "" "\n" "Section '%s' has no data to dump.\n" msgstr "" -#: readelf.c:5977 +#: readelf.c:6401 #, c-format msgid "" "\n" "Hex dump of section '%s':\n" msgstr "" -#: readelf.c:5982 +#: readelf.c:6406 msgid "section data" msgstr "" -#: readelf.c:6131 +#: readelf.c:6555 msgid "badly formed extended line op encountered!\n" msgstr "" -#: readelf.c:6138 +#: readelf.c:6562 #, c-format msgid " Extended opcode %d: " msgstr "" -#: readelf.c:6143 +#: readelf.c:6567 msgid "" "End of Sequence\n" "\n" msgstr "" -#: readelf.c:6149 +#: readelf.c:6573 #, c-format msgid "set Address to 0x%lx\n" msgstr "" -#: readelf.c:6154 +#: readelf.c:6578 msgid " define new File Table entry\n" msgstr "" -#: readelf.c:6155 readelf.c:6284 +#: readelf.c:6579 readelf.c:6726 msgid " Entry\tDir\tTime\tSize\tName\n" msgstr "" -#: readelf.c:6157 +#: readelf.c:6581 #, c-format msgid " %d\t" msgstr "" -#: readelf.c:6160 readelf.c:6162 readelf.c:6164 readelf.c:6296 readelf.c:6298 -#: readelf.c:6300 +#: readelf.c:6584 readelf.c:6586 readelf.c:6588 readelf.c:6738 readelf.c:6740 +#: readelf.c:6742 #, c-format msgid "%lu\t" msgstr "" -#: readelf.c:6165 +#: readelf.c:6589 #, c-format msgid "" "%s\n" "\n" msgstr "" -#: readelf.c:6169 +#: readelf.c:6593 #, c-format msgid "UNKNOWN: length %d\n" msgstr "" -#: readelf.c:6195 +#: readelf.c:6621 #, c-format msgid "" "\n" @@ -3161,690 +3215,674 @@ msgid "" "\n" msgstr "" -#: readelf.c:6207 -msgid "64-bit DWARF line info is not supported yet.\n" -msgstr "" - -#: readelf.c:6214 +#: readelf.c:6649 msgid "The line info appears to be corrupt - the section is too small\n" msgstr "" -#: readelf.c:6222 -msgid "Only DWARF version 2 line info is currently supported.\n" +#: readelf.c:6658 +msgid "Only DWARF version 2 and 3 line info is currently supported.\n" msgstr "" -#: readelf.c:6237 +#: readelf.c:6679 #, c-format msgid " Length: %ld\n" msgstr "" -#: readelf.c:6238 +#: readelf.c:6680 #, c-format msgid " DWARF Version: %d\n" msgstr "" -#: readelf.c:6239 +#: readelf.c:6681 #, c-format msgid " Prologue Length: %d\n" msgstr "" -#: readelf.c:6240 +#: readelf.c:6682 #, c-format msgid " Minimum Instruction Length: %d\n" msgstr "" -#: readelf.c:6241 +#: readelf.c:6683 #, c-format msgid " Initial value of 'is_stmt': %d\n" msgstr "" -#: readelf.c:6242 +#: readelf.c:6684 #, c-format msgid " Line Base: %d\n" msgstr "" -#: readelf.c:6243 +#: readelf.c:6685 #, c-format msgid " Line Range: %d\n" msgstr "" -#: readelf.c:6244 +#: readelf.c:6686 #, c-format msgid " Opcode Base: %d\n" msgstr "" -#: readelf.c:6253 +#: readelf.c:6695 msgid "" "\n" " Opcodes:\n" msgstr "" -#: readelf.c:6256 +#: readelf.c:6698 #, c-format msgid " Opcode %d has %d args\n" msgstr "" -#: readelf.c:6262 +#: readelf.c:6704 msgid "" "\n" " The Directory Table is empty.\n" msgstr "" -#: readelf.c:6265 +#: readelf.c:6707 msgid "" "\n" " The Directory Table:\n" msgstr "" -#: readelf.c:6269 +#: readelf.c:6711 #, c-format msgid " %s\n" msgstr "" -#: readelf.c:6280 +#: readelf.c:6722 msgid "" "\n" " The File Name Table is empty.\n" msgstr "" -#: readelf.c:6283 +#: readelf.c:6725 msgid "" "\n" " The File Name Table:\n" msgstr "" -#: readelf.c:6291 +#: readelf.c:6733 #, c-format msgid " %d\t" msgstr "" -#: readelf.c:6302 +#: readelf.c:6744 #, c-format msgid "%s\n" msgstr "" #. Now display the statements. -#: readelf.c:6310 +#: readelf.c:6752 msgid "" "\n" " Line Number Statements:\n" msgstr "" -#: readelf.c:6326 +#: readelf.c:6768 #, c-format msgid " Special opcode %d: advance Address by %d to 0x%lx" msgstr "" -#: readelf.c:6330 +#: readelf.c:6772 #, c-format msgid " and Line by %d to %d\n" msgstr "" -#: readelf.c:6341 +#: readelf.c:6783 msgid " Copy\n" msgstr "" -#: readelf.c:6348 +#: readelf.c:6790 #, c-format msgid " Advance PC by %d to %lx\n" msgstr "" -#: readelf.c:6356 +#: readelf.c:6798 #, c-format msgid " Advance Line by %d to %d\n" msgstr "" -#: readelf.c:6363 +#: readelf.c:6805 #, c-format msgid " Set File Name to entry %d in the File Name Table\n" msgstr "" -#: readelf.c:6371 +#: readelf.c:6813 #, c-format msgid " Set column to %d\n" msgstr "" -#: readelf.c:6378 +#: readelf.c:6820 #, c-format msgid " Set is_stmt to %d\n" msgstr "" -#: readelf.c:6383 +#: readelf.c:6825 msgid " Set basic block\n" msgstr "" -#: readelf.c:6391 +#: readelf.c:6833 #, c-format msgid " Advance PC by constant %d to 0x%lx\n" msgstr "" -#: readelf.c:6399 +#: readelf.c:6841 #, c-format msgid " Advance PC by fixed size amount %d to 0x%lx\n" msgstr "" -#: readelf.c:6404 +#: readelf.c:6846 msgid " Set prologue_end to true\n" msgstr "" -#: readelf.c:6408 +#: readelf.c:6850 msgid " Set epilogue_begin to true\n" msgstr "" -#: readelf.c:6414 +#: readelf.c:6856 #, c-format msgid " Set ISA to %d\n" msgstr "" -#: readelf.c:6418 +#: readelf.c:6860 #, c-format msgid " Unknown opcode %d with operands: " msgstr "" -#: readelf.c:6450 readelf.c:6912 readelf.c:6984 +#: readelf.c:6891 readelf.c:7371 readelf.c:7443 #, c-format msgid "" "Contents of the %s section:\n" "\n" msgstr "" -#: readelf.c:6469 -msgid "64-bit DWARF pubnames are not supported yet.\n" +#: readelf.c:6931 +msgid "Only DWARF 2 and 3 pubnames are currently supported\n" msgstr "" -#: readelf.c:6479 -msgid "Only DWARF 2 pubnames are currently supported\n" -msgstr "" - -#: readelf.c:6486 +#: readelf.c:6938 #, c-format msgid " Length: %ld\n" msgstr "" -#: readelf.c:6488 +#: readelf.c:6940 #, c-format msgid " Version: %d\n" msgstr "" -#: readelf.c:6490 +#: readelf.c:6942 #, c-format msgid " Offset into .debug_info section: %ld\n" msgstr "" -#: readelf.c:6492 +#: readelf.c:6944 #, c-format msgid " Size of area in .debug_info section: %ld\n" msgstr "" -#: readelf.c:6495 +#: readelf.c:6947 msgid "" "\n" " Offset\tName\n" msgstr "" -#: readelf.c:6586 +#: readelf.c:7042 #, c-format msgid "Unknown TAG value: %lx" msgstr "" -#: readelf.c:6697 +#: readelf.c:7156 #, c-format msgid "Unknown AT value: %lx" msgstr "" -#: readelf.c:6734 +#: readelf.c:7193 #, c-format msgid "Unknown FORM value: %lx" msgstr "" -#: readelf.c:6933 +#: readelf.c:7392 #, c-format msgid " DW_MACINFO_start_file - lineno: %d filenum: %d\n" msgstr "" -#: readelf.c:6938 +#: readelf.c:7397 msgid " DW_MACINFO_end_file\n" msgstr "" -#: readelf.c:6946 +#: readelf.c:7405 #, c-format msgid " DW_MACINFO_define - lineno : %d macro : %s\n" msgstr "" -#: readelf.c:6954 +#: readelf.c:7413 #, c-format msgid " DW_MACINFO_undef - lineno : %d macro : %s\n" msgstr "" -#: readelf.c:6965 +#: readelf.c:7424 #, c-format msgid " DW_MACINFO_vendor_ext - constant : %d string : %s\n" msgstr "" -#: readelf.c:6993 +#: readelf.c:7452 msgid " Number TAG\n" msgstr "" -#: readelf.c:6999 +#: readelf.c:7458 #, c-format msgid " %ld %s [%s]\n" msgstr "" -#: readelf.c:7002 +#: readelf.c:7461 msgid "has children" msgstr "" -#: readelf.c:7002 +#: readelf.c:7461 msgid "no children" msgstr "" -#: readelf.c:7006 +#: readelf.c:7465 #, c-format msgid " %-18s %s\n" msgstr "" -#: readelf.c:7027 +#: readelf.c:7486 #, c-format msgid " %lu byte block: " msgstr "" -#: readelf.c:7350 +#: readelf.c:7814 msgid "(User defined location op)" msgstr "" -#: readelf.c:7352 +#: readelf.c:7816 msgid "(Unknown location op)" msgstr "" -#: readelf.c:7390 +#: readelf.c:7855 msgid "debug_loc section data" msgstr "" -#: readelf.c:7421 +#: readelf.c:7887 msgid "" "\n" "The .debug_loc section is empty.\n" msgstr "" -#: readelf.c:7424 +#: readelf.c:7891 msgid "" "Contents of the .debug_loc section:\n" "\n" msgstr "" -#: readelf.c:7425 +#: readelf.c:7892 msgid "" "\n" " Offset Begin End Expression\n" msgstr "" -#: readelf.c:7497 +#: readelf.c:7968 msgid "debug_str section data" msgstr "" -#: readelf.c:7516 +#: readelf.c:7987 msgid "" msgstr "" -#: readelf.c:7519 +#: readelf.c:7990 msgid "" msgstr "" -#: readelf.c:7539 +#: readelf.c:8009 msgid "" "\n" "The .debug_str section is empty.\n" msgstr "" -#: readelf.c:7543 +#: readelf.c:8013 msgid "" "Contents of the .debug_str section:\n" "\n" msgstr "" -#: readelf.c:7714 +#: readelf.c:8088 +msgid "Internal error: DWARF version is not 2 or 3.\n" +msgstr "" + +#: readelf.c:8203 #, c-format -msgid " (indirect string, offset: 0x%lx): " +msgid " (indirect string, offset: 0x%lx): %s" msgstr "" -#: readelf.c:7723 +#: readelf.c:8212 #, c-format msgid "Unrecognized form: %d\n" msgstr "" -#: readelf.c:7736 +#: readelf.c:8226 msgid "(not inlined)" msgstr "" -#: readelf.c:7737 +#: readelf.c:8229 msgid "(inlined)" msgstr "" -#: readelf.c:7738 +#: readelf.c:8232 msgid "(declared as inline but ignored)" msgstr "" -#: readelf.c:7739 +#: readelf.c:8235 msgid "(declared as inline and inlined)" msgstr "" -#: readelf.c:7740 +#: readelf.c:8238 #, c-format msgid " (Unknown inline attribute value: %lx)" msgstr "" -#: readelf.c:7911 readelf.c:8117 +#: readelf.c:8419 readelf.c:8646 #, c-format msgid "" "The section %s contains:\n" "\n" msgstr "" -#: readelf.c:7935 -msgid "64-bit DWARF debug info is not supported yet.\n" -msgstr "" - -#: readelf.c:8007 +#: readelf.c:8535 #, c-format msgid " Compilation Unit @ %lx:\n" msgstr "" -#: readelf.c:8008 +#: readelf.c:8536 #, c-format msgid " Length: %ld\n" msgstr "" -#: readelf.c:8009 +#: readelf.c:8537 #, c-format msgid " Version: %d\n" msgstr "" -#: readelf.c:8010 +#: readelf.c:8538 #, c-format msgid " Abbrev Offset: %ld\n" msgstr "" -#: readelf.c:8011 +#: readelf.c:8539 #, c-format msgid " Pointer Size: %d\n" msgstr "" -#: readelf.c:8015 -msgid "Only version 2 DWARF debug information is currently supported.\n" +#: readelf.c:8543 +msgid "Only version 2 and 3 DWARF debug information is currently supported.\n" msgstr "" -#: readelf.c:8036 +#: readelf.c:8563 msgid "Unable to locate .debug_abbrev section!\n" msgstr "" -#: readelf.c:8042 +#: readelf.c:8569 msgid "debug_abbrev section data" msgstr "" -#: readelf.c:8079 +#: readelf.c:8606 #, c-format msgid "Unable to locate entry %lu in the abbreviation table\n" msgstr "" -#: readelf.c:8084 +#: readelf.c:8611 #, c-format msgid " <%d><%lx>: Abbrev Number: %lu (%s)\n" msgstr "" -#: readelf.c:8138 -msgid "64-bit DWARF aranges are not supported yet.\n" -msgstr "" - -#: readelf.c:8144 -msgid "Only DWARF 2 aranges are currently supported.\n" +#: readelf.c:8691 +msgid "Only DWARF 2 and 3 aranges are currently supported.\n" msgstr "" -#: readelf.c:8148 +#: readelf.c:8695 #, c-format msgid " Length: %ld\n" msgstr "" -#: readelf.c:8149 +#: readelf.c:8696 #, c-format msgid " Version: %d\n" msgstr "" -#: readelf.c:8150 +#: readelf.c:8697 #, c-format msgid " Offset into .debug_info: %lx\n" msgstr "" -#: readelf.c:8151 +#: readelf.c:8698 #, c-format msgid " Pointer Size: %d\n" msgstr "" -#: readelf.c:8152 +#: readelf.c:8699 #, c-format msgid " Segment Size: %d\n" msgstr "" -#: readelf.c:8154 +#: readelf.c:8701 msgid "" "\n" " Address Length\n" msgstr "" -#: readelf.c:8336 +#: readelf.c:8903 #, c-format msgid "The section %s contains:\n" msgstr "" -#: readelf.c:8359 -msgid "64-bit DWARF format frames are not supported yet.\n" -msgstr "" - -#: readelf.c:8908 +#: readelf.c:9538 #, c-format msgid "Displaying the debug contents of section %s is not yet supported.\n" msgstr "" -#: readelf.c:8974 +#: readelf.c:9634 #, c-format msgid "" "\n" "Section '%s' has no debugging data.\n" msgstr "" -#: readelf.c:8979 readelf.c:9041 +#: readelf.c:9639 readelf.c:9701 msgid "debug section data" msgstr "" -#: readelf.c:8995 +#: readelf.c:9655 #, c-format msgid "Unrecognized debug section: %s\n" msgstr "" -#: readelf.c:9069 +#: readelf.c:9729 msgid "Some sections were not dumped because they do not exist!\n" msgstr "" -#: readelf.c:9142 readelf.c:9506 +#: readelf.c:9806 readelf.c:10170 msgid "liblist" msgstr "" -#: readelf.c:9227 +#: readelf.c:9891 msgid "options" msgstr "" -#: readelf.c:9258 +#: readelf.c:9922 #, c-format msgid "" "\n" "Section '%s' contains %d entries:\n" msgstr "" -#: readelf.c:9419 +#: readelf.c:10083 msgid "conflict list found without a dynamic symbol table" msgstr "" -#: readelf.c:9437 readelf.c:9453 +#: readelf.c:10101 readelf.c:10117 msgid "conflict" msgstr "" -#: readelf.c:9463 +#: readelf.c:10127 #, c-format msgid "" "\n" "Section '.conflict' contains %ld entries:\n" msgstr "" -#: readelf.c:9465 +#: readelf.c:10129 msgid " Num: Index Value Name" msgstr "" -#: readelf.c:9514 +#: readelf.c:10178 msgid "liblist string table" msgstr "" -#: readelf.c:9523 +#: readelf.c:10187 #, c-format msgid "" "\n" "Library list section '%s' contains %lu entries:\n" msgstr "" -#: readelf.c:9572 +#: readelf.c:10236 msgid "NT_PRSTATUS (prstatus structure)" msgstr "" -#: readelf.c:9573 +#: readelf.c:10237 msgid "NT_FPREGSET (floating point registers)" msgstr "" -#: readelf.c:9574 +#: readelf.c:10238 msgid "NT_PRPSINFO (prpsinfo structure)" msgstr "" -#: readelf.c:9575 +#: readelf.c:10239 msgid "NT_TASKSTRUCT (task structure)" msgstr "" -#: readelf.c:9576 +#: readelf.c:10240 msgid "NT_PRXFPREG (user_xfpregs structure)" msgstr "" -#: readelf.c:9577 +#: readelf.c:10241 msgid "NT_PSTATUS (pstatus structure)" msgstr "" -#: readelf.c:9578 +#: readelf.c:10242 msgid "NT_FPREGS (floating point registers)" msgstr "" -#: readelf.c:9579 +#: readelf.c:10243 msgid "NT_PSINFO (psinfo structure)" msgstr "" -#: readelf.c:9580 +#: readelf.c:10244 msgid "NT_LWPSTATUS (lwpstatus_t structure)" msgstr "" -#: readelf.c:9581 +#: readelf.c:10245 msgid "NT_LWPSINFO (lwpsinfo_t structure)" msgstr "" -#: readelf.c:9582 +#: readelf.c:10246 msgid "NT_WIN32PSTATUS (win32_pstatus structure)" msgstr "" -#: readelf.c:9584 readelf.c:9608 +#: readelf.c:10248 readelf.c:10272 #, c-format msgid "Unknown note type: (0x%08x)" msgstr "" #. NetBSD core "procinfo" structure. -#: readelf.c:9598 +#: readelf.c:10262 msgid "NetBSD procinfo structure" msgstr "" -#: readelf.c:9625 readelf.c:9639 +#: readelf.c:10289 readelf.c:10303 msgid "PT_GETREGS (reg structure)" msgstr "" -#: readelf.c:9627 readelf.c:9641 +#: readelf.c:10291 readelf.c:10305 msgid "PT_GETFPREGS (fpreg structure)" msgstr "" -#: readelf.c:9647 +#: readelf.c:10311 #, c-format msgid "PT_FIRSTMACH+%d" msgstr "" -#: readelf.c:9701 +#: readelf.c:10365 msgid "notes" msgstr "" -#: readelf.c:9707 +#: readelf.c:10371 #, c-format msgid "" "\n" "Notes at offset 0x%08lx with length 0x%08lx:\n" msgstr "" -#: readelf.c:9709 +#: readelf.c:10373 msgid " Owner\t\tData size\tDescription\n" msgstr "" -#: readelf.c:9728 +#: readelf.c:10392 #, c-format msgid "corrupt note found at offset %x into core notes\n" msgstr "" -#: readelf.c:9730 +#: readelf.c:10394 #, c-format msgid " type: %x, namesize: %08lx, descsize: %08lx\n" msgstr "" -#: readelf.c:9832 +#: readelf.c:10476 msgid "No note segments present in the core file.\n" msgstr "" -#: readelf.c:9910 +#: readelf.c:10560 msgid "" "This instance of readelf has been built without support for a\n" "64 bit data type and so it cannot read 64 bit ELF files.\n" msgstr "" -#: readelf.c:9956 +#: readelf.c:10606 #, c-format msgid "Cannot stat input file %s.\n" msgstr "" -#: readelf.c:9963 +#: readelf.c:10613 #, c-format msgid "Input file %s not found.\n" msgstr "" -#: readelf.c:9969 +#: readelf.c:10619 #, c-format msgid "%s: Failed to read file header\n" msgstr "" -#: readelf.c:9983 +#: readelf.c:10633 #, c-format msgid "" "\n" "File: %s\n" msgstr "" -#: rename.c:131 +#: rename.c:132 #, c-format msgid "%s: cannot set time: %s" msgstr "" #. We have to clean up here. -#: rename.c:170 rename.c:203 +#: rename.c:171 rename.c:204 #, c-format msgid "%s: rename: %s" msgstr "" -#: rename.c:211 +#: rename.c:212 #, c-format msgid "%s: simple_copy: %s" msgstr "" @@ -4182,7 +4220,7 @@ msgstr "" msgid "%s: read of %lu returned %lu" msgstr "" -#: resrc.c:650 resrc.c:904 resrc.c:1177 resrc.c:1331 +#: resrc.c:650 resrc.c:905 resrc.c:1178 resrc.c:1332 #, c-format msgid "stat failed on bitmap file `%s': %s" msgstr "" @@ -4192,25 +4230,25 @@ msgstr "" msgid "cursor file `%s' does not contain cursor data" msgstr "" -#: resrc.c:735 resrc.c:1048 +#: resrc.c:735 resrc.c:1049 #, c-format msgid "%s: fseek to %lu failed: %s" msgstr "" -#: resrc.c:872 +#: resrc.c:873 msgid "help ID requires DIALOGEX" msgstr "" -#: resrc.c:874 +#: resrc.c:875 msgid "control data requires DIALOGEX" msgstr "" -#: resrc.c:1017 +#: resrc.c:1018 #, c-format msgid "icon file `%s' does not contain icon data" msgstr "" -#: resrc.c:1536 +#: resrc.c:1537 #, c-format msgid "can't open `%s' for output: %s" msgstr "" @@ -4228,7 +4266,7 @@ msgstr "" msgid "" " The options are:\n" " -A|-B --format={sysv|berkeley} Select output style (default is %s)\n" -" -o|-d|-h --radix={8|10|16} Display numbers in octal, decimal or " +" -o|-d|-x --radix={8|10|16} Display numbers in octal, decimal or " "hex\n" " -t --totals Display the total sizes (Berkeley " "only)\n" @@ -4267,88 +4305,88 @@ msgstr "" msgid "unable to open output file %s" msgstr "" -#: stabs.c:343 stabs.c:1759 +#: stabs.c:346 stabs.c:1755 msgid "numeric overflow" msgstr "" -#: stabs.c:354 +#: stabs.c:357 #, c-format msgid "Bad stab: %s\n" msgstr "" -#: stabs.c:364 +#: stabs.c:367 #, c-format msgid "Warning: %s: %s\n" msgstr "" -#: stabs.c:485 +#: stabs.c:488 msgid "N_LBRAC not within function\n" msgstr "" -#: stabs.c:524 +#: stabs.c:527 msgid "Too many N_RBRACs\n" msgstr "" -#: stabs.c:769 +#: stabs.c:773 msgid "unknown C++ encoded name" msgstr "" #. Complain and keep going, so compilers can invent new #. cross-reference types. -#: stabs.c:1296 +#: stabs.c:1293 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:1851 +#: stabs.c:1847 msgid "missing index type" msgstr "" -#: stabs.c:2178 +#: stabs.c:2174 msgid "unknown virtual character for baseclass" msgstr "" -#: stabs.c:2196 +#: stabs.c:2192 msgid "unknown visibility character for baseclass" msgstr "" -#: stabs.c:2388 +#: stabs.c:2384 msgid "unnamed $vb type" msgstr "" -#: stabs.c:2394 +#: stabs.c:2390 msgid "unrecognized C++ abbreviation" msgstr "" -#: stabs.c:2474 +#: stabs.c:2470 msgid "unknown visibility character for field" msgstr "" -#: stabs.c:2730 +#: stabs.c:2726 msgid "const/volatile indicator missing" msgstr "" -#: stabs.c:2970 +#: stabs.c:2967 #, c-format msgid "No mangling for \"%s\"\n" msgstr "" -#: stabs.c:3283 +#: stabs.c:3281 msgid "Undefined N_EXCL" msgstr "" -#: stabs.c:3371 +#: stabs.c:3369 #, c-format msgid "Type file number %d out of range\n" msgstr "" -#: stabs.c:3376 +#: stabs.c:3374 #, c-format msgid "Type index number %d out of range\n" msgstr "" -#: stabs.c:3463 +#: stabs.c:3461 #, c-format msgid "Unrecognized XCOFF type %d\n" msgstr "" @@ -4358,25 +4396,25 @@ msgstr "" msgid "bad mangled name `%s'\n" msgstr "" -#: stabs.c:3858 +#: stabs.c:3859 msgid "no argument types in mangled string\n" msgstr "" -#: strings.c:200 +#: strings.c:208 #, c-format msgid "invalid number %s" msgstr "" -#: strings.c:640 +#: strings.c:647 #, c-format msgid "invalid integer argument %s" msgstr "" -#: strings.c:651 +#: strings.c:658 msgid " Display printable strings in [file(s)] (stdin by default)\n" msgstr "" -#: strings.c:652 +#: strings.c:659 msgid "" " The options are:\n" " -a - --all Scan the entire file, not just the data section\n" @@ -4388,8 +4426,9 @@ msgid "" "or 16\n" " -o An alias for --radix=o\n" " -T --target= Specify the binary file format\n" -" -e --encoding={s,b,l,B,L} Select character size and endianness:\n" -" s = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit\n" +" -e --encoding={s,S,b,l,B,L} Select character size and endianness:\n" +" s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-" +"bit\n" " -h --help Display this information\n" " -v --version Print the program's version number\n" msgstr "" @@ -4410,110 +4449,126 @@ msgstr "" msgid "cannot open input file %s" msgstr "" -#: version.c:35 +#: version.c:36 msgid "Copyright 2002 Free Software Foundation, Inc.\n" msgstr "" -#: version.c:36 +#: version.c:37 msgid "" "This program is free software; you may redistribute it under the terms of\n" "the GNU General Public License. This program has absolutely no warranty.\n" msgstr "" -#: windres.c:239 +#: windres.c:205 #, c-format msgid "can't open %s `%s': %s" msgstr "" -#: windres.c:418 +#: windres.c:384 msgid ": expected to be a directory\n" msgstr "" -#: windres.c:430 +#: windres.c:396 msgid ": expected to be a leaf\n" msgstr "" -#: windres.c:439 +#: windres.c:405 #, c-format msgid "%s: warning: " msgstr "" -#: windres.c:441 +#: windres.c:407 msgid ": duplicate value\n" msgstr "" -#: windres.c:602 +#: windres.c:569 #, c-format msgid "unknown format type `%s'" msgstr "" -#: windres.c:603 +#: windres.c:570 #, c-format msgid "%s: supported formats:" msgstr "" #. Otherwise, we give up. -#: windres.c:688 +#: windres.c:655 #, c-format msgid "can not determine type of file `%s'; use the -I option" msgstr "" -#: windres.c:702 +#: windres.c:669 #, c-format msgid "Usage: %s [option(s)] [input-file] [output-file]\n" msgstr "" -#: windres.c:704 +#: windres.c:671 msgid "" " The options are:\n" " -i --input= Name input file\n" " -o --output= Name output file\n" -" -I --input-format= Specify input format\n" +" -J --input-format= Specify input format\n" " -O --output-format= Specify output format\n" " -F --target= Specify COFF target\n" " --preprocessor= Program to use to preprocess rc file\n" -" --include-dir= Include directory when preprocessing rc file\n" +" -I --include-dir= Include directory when preprocessing rc file\n" " -D --define [=] Define SYM when preprocessing rc file\n" +" -U --undefine Undefine SYM when preprocessing rc file\n" " -v --verbose Verbose - tells you what it's doing\n" -" --language= Set language when reading rc file\n" +" -l --language= Set language when reading rc file\n" " --use-temp-file Use a temporary file instead of popen to " "read\n" " the preprocessor output\n" " --no-use-temp-file Use popen (default)\n" msgstr "" -#: windres.c:719 +#: windres.c:687 msgid " --yydebug Turn on parser debugging\n" msgstr "" -#: windres.c:722 +#: windres.c:690 msgid "" +" -r Ignored for compatibility with rc\n" " -h --help Print this help message\n" " -V --version Print version information\n" msgstr "" -#: windres.c:725 +#: windres.c:694 msgid "" "FORMAT is one of rc, res, or coff, and is deduced from the file name\n" "extension if not specified. A single file name is an input file.\n" "No input-file is stdin, default rc. No output-file is stdout, default rc.\n" msgstr "" -#: windres.c:988 +#: windres.c:833 +msgid "invalid option -f\n" +msgstr "" + +#: windres.c:838 +msgid "No filename following the -fo option.\n" +msgstr "" + +#: windres.c:896 +msgid "" +"Option -I is deprecated for setting the input format, please use -J " +"instead.\n" +msgstr "" + +#: windres.c:1014 msgid "no resources" msgstr "" -#: wrstabs.c:366 wrstabs.c:2026 +#: wrstabs.c:395 wrstabs.c:2055 #, c-format msgid "string_hash_lookup failed: %s" msgstr "" -#: wrstabs.c:666 +#: wrstabs.c:695 #, c-format msgid "stab_int_type: bad size %u" msgstr "" -#: wrstabs.c:1466 +#: wrstabs.c:1495 #, c-format msgid "%s: warning: unknown size for field `%s' in struct" msgstr "" diff --git a/contrib/binutils/binutils/prdbg.c b/contrib/binutils/binutils/prdbg.c index 8bb0053..5b6b047 100644 --- a/contrib/binutils/binutils/prdbg.c +++ b/contrib/binutils/binutils/prdbg.c @@ -1,6 +1,7 @@ /* prdbg.c -- Print out generic debugging information. - Copyright 1995, 1996 Free Software Foundation, Inc. + Copyright 1995, 1996, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor . + Tags style generation written by Salvador E. Tropea . This file is part of GNU Binutils. @@ -43,6 +44,15 @@ struct pr_handle struct pr_stack *stack; /* Parameter number we are about to output. */ int parameter; + /* The following are used only by the tags code (tg_). */ + /* Name of the file we are using. */ + char *filename; + /* The BFD. */ + bfd *abfd; + /* The symbols table for this BFD. */ + asymbol **syms; + /* Pointer to a function to demangle symbols. */ + char *(*demangler) (bfd *, const char *); }; /* The type stack. */ @@ -57,78 +67,131 @@ struct pr_stack enum debug_visibility visibility; /* Name of the current method we are handling. */ const char *method; + /* The following are used only by the tags code (tg_). */ + /* Type for the container (struct, union, class, union class). */ + const char *flavor; + /* A comma separated list of parent classes. */ + char *parents; + /* How many parents contains parents. */ + int num_parents; }; -static void indent PARAMS ((struct pr_handle *)); -static boolean push_type PARAMS ((struct pr_handle *, const char *)); -static boolean prepend_type PARAMS ((struct pr_handle *, const char *)); -static boolean append_type PARAMS ((struct pr_handle *, const char *)); -static boolean substitute_type PARAMS ((struct pr_handle *, const char *)); -static boolean indent_type PARAMS ((struct pr_handle *)); -static char *pop_type PARAMS ((struct pr_handle *)); -static void print_vma PARAMS ((bfd_vma, char *, boolean, boolean)); -static boolean pr_fix_visibility - PARAMS ((struct pr_handle *, enum debug_visibility)); - -static boolean pr_start_compilation_unit PARAMS ((PTR, const char *)); -static boolean pr_start_source PARAMS ((PTR, const char *)); -static boolean pr_empty_type PARAMS ((PTR)); -static boolean pr_void_type PARAMS ((PTR)); -static boolean pr_int_type PARAMS ((PTR, unsigned int, boolean)); -static boolean pr_float_type PARAMS ((PTR, unsigned int)); -static boolean pr_complex_type PARAMS ((PTR, unsigned int)); -static boolean pr_bool_type PARAMS ((PTR, unsigned int)); -static boolean pr_enum_type - PARAMS ((PTR, const char *, const char **, bfd_signed_vma *)); -static boolean pr_pointer_type PARAMS ((PTR)); -static boolean pr_function_type PARAMS ((PTR, int, boolean)); -static boolean pr_reference_type PARAMS ((PTR)); -static boolean pr_range_type PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma)); -static boolean pr_array_type - PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma, boolean)); -static boolean pr_set_type PARAMS ((PTR, boolean)); -static boolean pr_offset_type PARAMS ((PTR)); -static boolean pr_method_type PARAMS ((PTR, boolean, int, boolean)); -static boolean pr_const_type PARAMS ((PTR)); -static boolean pr_volatile_type PARAMS ((PTR)); -static boolean pr_start_struct_type - PARAMS ((PTR, const char *, unsigned int, boolean, unsigned int)); -static boolean pr_struct_field - PARAMS ((PTR, const char *, bfd_vma, bfd_vma, enum debug_visibility)); -static boolean pr_end_struct_type PARAMS ((PTR)); -static boolean pr_start_class_type - PARAMS ((PTR, const char *, unsigned int, boolean, unsigned int, boolean, - boolean)); -static boolean pr_class_static_member - PARAMS ((PTR, const char *, const char *, enum debug_visibility)); -static boolean pr_class_baseclass - PARAMS ((PTR, bfd_vma, boolean, enum debug_visibility)); -static boolean pr_class_start_method PARAMS ((PTR, const char *)); -static boolean pr_class_method_variant - PARAMS ((PTR, const char *, enum debug_visibility, boolean, boolean, - bfd_vma, boolean)); -static boolean pr_class_static_method_variant - PARAMS ((PTR, const char *, enum debug_visibility, boolean, boolean)); -static boolean pr_class_end_method PARAMS ((PTR)); -static boolean pr_end_class_type PARAMS ((PTR)); -static boolean pr_typedef_type PARAMS ((PTR, const char *)); -static boolean pr_tag_type - PARAMS ((PTR, const char *, unsigned int, enum debug_type_kind)); -static boolean pr_typdef PARAMS ((PTR, const char *)); -static boolean pr_tag PARAMS ((PTR, const char *)); -static boolean pr_int_constant PARAMS ((PTR, const char *, bfd_vma)); -static boolean pr_float_constant PARAMS ((PTR, const char *, double)); -static boolean pr_typed_constant PARAMS ((PTR, const char *, bfd_vma)); -static boolean pr_variable - PARAMS ((PTR, const char *, enum debug_var_kind, bfd_vma)); -static boolean pr_start_function PARAMS ((PTR, const char *, boolean)); -static boolean pr_function_parameter - PARAMS ((PTR, const char *, enum debug_parm_kind, bfd_vma)); -static boolean pr_start_block PARAMS ((PTR, bfd_vma)); -static boolean pr_end_block PARAMS ((PTR, bfd_vma)); -static boolean pr_end_function PARAMS ((PTR)); -static boolean pr_lineno PARAMS ((PTR, const char *, unsigned long, bfd_vma)); - +static void indent (struct pr_handle *); +static bfd_boolean push_type (struct pr_handle *, const char *); +static bfd_boolean prepend_type (struct pr_handle *, const char *); +static bfd_boolean append_type (struct pr_handle *, const char *); +static bfd_boolean substitute_type (struct pr_handle *, const char *); +static bfd_boolean indent_type (struct pr_handle *); +static char *pop_type (struct pr_handle *); +static void print_vma (bfd_vma, char *, bfd_boolean, bfd_boolean); +static bfd_boolean pr_fix_visibility + (struct pr_handle *, enum debug_visibility); +static bfd_boolean pr_start_compilation_unit (void *, const char *); +static bfd_boolean pr_start_source (void *, const char *); +static bfd_boolean pr_empty_type (void *); +static bfd_boolean pr_void_type (void *); +static bfd_boolean pr_int_type (void *, unsigned int, bfd_boolean); +static bfd_boolean pr_float_type (void *, unsigned int); +static bfd_boolean pr_complex_type (void *, unsigned int); +static bfd_boolean pr_bool_type (void *, unsigned int); +static bfd_boolean pr_enum_type + (void *, const char *, const char **, bfd_signed_vma *); +static bfd_boolean pr_pointer_type (void *); +static bfd_boolean pr_function_type (void *, int, bfd_boolean); +static bfd_boolean pr_reference_type (void *); +static bfd_boolean pr_range_type (void *, bfd_signed_vma, bfd_signed_vma); +static bfd_boolean pr_array_type + (void *, bfd_signed_vma, bfd_signed_vma, bfd_boolean); +static bfd_boolean pr_set_type (void *, bfd_boolean); +static bfd_boolean pr_offset_type (void *); +static bfd_boolean pr_method_type (void *, bfd_boolean, int, bfd_boolean); +static bfd_boolean pr_const_type (void *); +static bfd_boolean pr_volatile_type (void *); +static bfd_boolean pr_start_struct_type + (void *, const char *, unsigned int, bfd_boolean, unsigned int); +static bfd_boolean pr_struct_field + (void *, const char *, bfd_vma, bfd_vma, enum debug_visibility); +static bfd_boolean pr_end_struct_type (void *); +static bfd_boolean pr_start_class_type + (void *, const char *, unsigned int, bfd_boolean, unsigned int, + bfd_boolean, bfd_boolean); +static bfd_boolean pr_class_static_member + (void *, const char *, const char *, enum debug_visibility); +static bfd_boolean pr_class_baseclass + (void *, bfd_vma, bfd_boolean, enum debug_visibility); +static bfd_boolean pr_class_start_method (void *, const char *); +static bfd_boolean pr_class_method_variant + (void *, const char *, enum debug_visibility, bfd_boolean, bfd_boolean, + bfd_vma, bfd_boolean); +static bfd_boolean pr_class_static_method_variant + (void *, const char *, enum debug_visibility, bfd_boolean, bfd_boolean); +static bfd_boolean pr_class_end_method (void *); +static bfd_boolean pr_end_class_type (void *); +static bfd_boolean pr_typedef_type (void *, const char *); +static bfd_boolean pr_tag_type + (void *, const char *, unsigned int, enum debug_type_kind); +static bfd_boolean pr_typdef (void *, const char *); +static bfd_boolean pr_tag (void *, const char *); +static bfd_boolean pr_int_constant (void *, const char *, bfd_vma); +static bfd_boolean pr_float_constant (void *, const char *, double); +static bfd_boolean pr_typed_constant (void *, const char *, bfd_vma); +static bfd_boolean pr_variable + (void *, const char *, enum debug_var_kind, bfd_vma); +static bfd_boolean pr_start_function (void *, const char *, bfd_boolean); +static bfd_boolean pr_function_parameter + (void *, const char *, enum debug_parm_kind, bfd_vma); +static bfd_boolean pr_start_block (void *, bfd_vma); +static bfd_boolean pr_end_block (void *, bfd_vma); +static bfd_boolean pr_end_function (void *); +static bfd_boolean pr_lineno (void *, const char *, unsigned long, bfd_vma); +static bfd_boolean append_parent (struct pr_handle *, const char *); +/* Only used by tg_ code. */ +static bfd_boolean tg_fix_visibility + (struct pr_handle *, enum debug_visibility); +static void find_address_in_section (bfd *, asection *, void *); +static void translate_addresses (bfd *, char *, FILE *, asymbol **); +static const char *visibility_name (enum debug_visibility); +/* Tags style replacements. */ +static bfd_boolean tg_start_compilation_unit (void *, const char *); +static bfd_boolean tg_start_source (void *, const char *); +static bfd_boolean tg_enum_type + (void *, const char *, const char **, bfd_signed_vma *); +static bfd_boolean tg_start_struct_type + (void *, const char *, unsigned int, bfd_boolean, unsigned int); +static bfd_boolean pr_struct_field + (void *, const char *, bfd_vma, bfd_vma, enum debug_visibility); +static bfd_boolean tg_struct_field + (void *, const char *, bfd_vma, bfd_vma, enum debug_visibility); +static bfd_boolean tg_struct_field + (void *, const char *, bfd_vma, bfd_vma, enum debug_visibility); +static bfd_boolean tg_end_struct_type (void *); +static bfd_boolean tg_start_class_type + (void *, const char *, unsigned int, bfd_boolean, unsigned int, bfd_boolean, bfd_boolean); +static bfd_boolean tg_class_static_member + (void *, const char *, const char *, enum debug_visibility); +static bfd_boolean tg_class_baseclass + (void *, bfd_vma, bfd_boolean, enum debug_visibility); +static bfd_boolean tg_class_method_variant + (void *, const char *, enum debug_visibility, bfd_boolean, bfd_boolean, bfd_vma, bfd_boolean); +static bfd_boolean tg_class_static_method_variant + (void *, const char *, enum debug_visibility, bfd_boolean, bfd_boolean); +static bfd_boolean tg_end_class_type (void *); +static bfd_boolean tg_tag_type + (void *, const char *, unsigned int, enum debug_type_kind); +static bfd_boolean tg_typdef (void *, const char *); +static bfd_boolean tg_tag (void *, const char *); +static bfd_boolean tg_int_constant (void *, const char *, bfd_vma); +static bfd_boolean tg_float_constant (void *, const char *, double); +static bfd_boolean tg_typed_constant (void *, const char *, bfd_vma); +static bfd_boolean tg_variable + (void *, const char *, enum debug_var_kind, bfd_vma); +static bfd_boolean tg_start_function (void *, const char *, bfd_boolean); +static bfd_boolean tg_function_parameter + (void *, const char *, enum debug_parm_kind, bfd_vma); +static bfd_boolean tg_start_block (void *, bfd_vma); +static bfd_boolean tg_end_block (void *, bfd_vma); +static bfd_boolean tg_lineno (void *, const char *, unsigned long, bfd_vma); + static const struct debug_write_fns pr_fns = { pr_start_compilation_unit, @@ -177,12 +240,59 @@ static const struct debug_write_fns pr_fns = pr_lineno }; +static const struct debug_write_fns tg_fns = +{ + tg_start_compilation_unit, + tg_start_source, + pr_empty_type, /* Same, push_type. */ + pr_void_type, /* Same, push_type. */ + pr_int_type, /* Same, push_type. */ + pr_float_type, /* Same, push_type. */ + pr_complex_type, /* Same, push_type. */ + pr_bool_type, /* Same, push_type. */ + tg_enum_type, + pr_pointer_type, /* Same, changes to pointer. */ + pr_function_type, /* Same, push_type. */ + pr_reference_type, /* Same, changes to reference. */ + pr_range_type, /* FIXME: What's that?. */ + pr_array_type, /* Same, push_type. */ + pr_set_type, /* FIXME: What's that?. */ + pr_offset_type, /* FIXME: What's that?. */ + pr_method_type, /* Same. */ + pr_const_type, /* Same, changes to const. */ + pr_volatile_type, /* Same, changes to volatile. */ + tg_start_struct_type, + tg_struct_field, + tg_end_struct_type, + tg_start_class_type, + tg_class_static_member, + tg_class_baseclass, + pr_class_start_method, /* Same, remembers that's a method. */ + tg_class_method_variant, + tg_class_static_method_variant, + pr_class_end_method, /* Same, forgets that's a method. */ + tg_end_class_type, + pr_typedef_type, /* Same, just push type. */ + tg_tag_type, + tg_typdef, + tg_tag, + tg_int_constant, /* Untested. */ + tg_float_constant, /* Untested. */ + tg_typed_constant, /* Untested. */ + tg_variable, + tg_start_function, + tg_function_parameter, + tg_start_block, + tg_end_block, + pr_end_function, /* Same, does nothing. */ + tg_lineno +}; + /* Print out the generic debugging information recorded in dhandle. */ -boolean -print_debugging_info (f, dhandle) - FILE *f; - PTR dhandle; +bfd_boolean +print_debugging_info (FILE *f, void *dhandle, bfd *abfd, asymbol **syms, + void *demangler, bfd_boolean as_tags) { struct pr_handle info; @@ -190,15 +300,27 @@ print_debugging_info (f, dhandle) info.indent = 0; info.stack = NULL; info.parameter = 0; + info.filename = NULL; + info.abfd = abfd; + info.syms = syms; + info.demangler = demangler; + + if (as_tags) + { + fputs ("!_TAG_FILE_FORMAT\t2\t/extended format/\n", f); + fputs ("!_TAG_FILE_SORTED\t0\t/0=unsorted, 1=sorted/\n", f); + fputs ("!_TAG_PROGRAM_AUTHOR\tIan Lance Taylor, Salvador E. Tropea and others\t//\n", f); + fputs ("!_TAG_PROGRAM_NAME\tobjdump\t/From GNU binutils/\n", f); + } - return debug_write (dhandle, &pr_fns, (PTR) &info); + return as_tags ? debug_write (dhandle, &tg_fns, (void *) & info) + : debug_write (dhandle, &pr_fns, (void *) & info); } /* Indent to the current indentation level. */ static void -indent (info) - struct pr_handle *info; +indent (struct pr_handle *info) { unsigned int i; @@ -208,15 +330,13 @@ indent (info) /* Push a type on the type stack. */ -static boolean -push_type (info, type) - struct pr_handle *info; - const char *type; +static bfd_boolean +push_type (struct pr_handle *info, const char *type) { struct pr_stack *n; if (type == NULL) - return false; + return FALSE; n = (struct pr_stack *) xmalloc (sizeof *n); memset (n, 0, sizeof *n); @@ -227,15 +347,13 @@ push_type (info, type) n->next = info->stack; info->stack = n; - return true; + return TRUE; } /* Prepend a string onto the type on the top of the type stack. */ -static boolean -prepend_type (info, s) - struct pr_handle *info; - const char *s; +static bfd_boolean +prepend_type (struct pr_handle *info, const char *s) { char *n; @@ -246,20 +364,18 @@ prepend_type (info, s) free (info->stack->type); info->stack->type = n; - return true; + return TRUE; } /* Append a string to the type on the top of the type stack. */ -static boolean -append_type (info, s) - struct pr_handle *info; - const char *s; +static bfd_boolean +append_type (struct pr_handle *info, const char *s) { unsigned int len; if (s == NULL) - return false; + return FALSE; assert (info->stack != NULL); @@ -268,17 +384,35 @@ append_type (info, s) len + strlen (s) + 1); strcpy (info->stack->type + len, s); - return true; + return TRUE; +} + +/* Append a string to the parents on the top of the type stack. */ + +static bfd_boolean +append_parent (struct pr_handle *info, const char *s) +{ + unsigned int len; + + if (s == NULL) + return FALSE; + + assert (info->stack != NULL); + + len = info->stack->parents ? strlen (info->stack->parents) : 0; + info->stack->parents = (char *) xrealloc (info->stack->parents, + len + strlen (s) + 1); + strcpy (info->stack->parents + len, s); + + return TRUE; } /* We use an underscore to indicate where the name should go in a type string. This function substitutes a string for the underscore. If there is no underscore, the name follows the type. */ -static boolean -substitute_type (info, s) - struct pr_handle *info; - const char *s; +static bfd_boolean +substitute_type (struct pr_handle *info, const char *s) { char *u; @@ -298,7 +432,7 @@ substitute_type (info, s) free (info->stack->type); info->stack->type = n; - return true; + return TRUE; } if (strchr (s, '|') != NULL @@ -307,11 +441,11 @@ substitute_type (info, s) { if (! prepend_type (info, "(") || ! append_type (info, ")")) - return false; + return FALSE; } if (*s == '\0') - return true; + return TRUE; return (append_type (info, " ") && append_type (info, s)); @@ -319,26 +453,24 @@ substitute_type (info, s) /* Indent the type at the top of the stack by appending spaces. */ -static boolean -indent_type (info) - struct pr_handle *info; +static bfd_boolean +indent_type (struct pr_handle *info) { unsigned int i; for (i = 0; i < info->indent; i++) { if (! append_type (info, " ")) - return false; + return FALSE; } - return true; + return TRUE; } /* Pop a type from the type stack. */ static char * -pop_type (info) - struct pr_handle *info; +pop_type (struct pr_handle *info) { struct pr_stack *o; char *ret; @@ -356,11 +488,7 @@ pop_type (info) /* Print a VMA value into a string. */ static void -print_vma (vma, buf, unsignedp, hexp) - bfd_vma vma; - char *buf; - boolean unsignedp; - boolean hexp; +print_vma (bfd_vma vma, char *buf, bfd_boolean unsignedp, bfd_boolean hexp) { if (sizeof (vma) <= sizeof (unsigned long)) { @@ -381,10 +509,8 @@ print_vma (vma, buf, unsignedp, hexp) /* Start a new compilation unit. */ -static boolean -pr_start_compilation_unit (p, filename) - PTR p; - const char *filename; +static bfd_boolean +pr_start_compilation_unit (void *p, const char *filename) { struct pr_handle *info = (struct pr_handle *) p; @@ -392,15 +518,13 @@ pr_start_compilation_unit (p, filename) fprintf (info->f, "%s:\n", filename); - return true; + return TRUE; } /* Start a source file within a compilation unit. */ -static boolean -pr_start_source (p, filename) - PTR p; - const char *filename; +static bfd_boolean +pr_start_source (void *p, const char *filename) { struct pr_handle *info = (struct pr_handle *) p; @@ -408,14 +532,13 @@ pr_start_source (p, filename) fprintf (info->f, " %s:\n", filename); - return true; + return TRUE; } /* Push an empty type onto the type stack. */ -static boolean -pr_empty_type (p) - PTR p; +static bfd_boolean +pr_empty_type (void *p) { struct pr_handle *info = (struct pr_handle *) p; @@ -424,9 +547,8 @@ pr_empty_type (p) /* Push a void type onto the type stack. */ -static boolean -pr_void_type (p) - PTR p; +static bfd_boolean +pr_void_type (void *p) { struct pr_handle *info = (struct pr_handle *) p; @@ -435,11 +557,8 @@ pr_void_type (p) /* Push an integer type onto the type stack. */ -static boolean -pr_int_type (p, size, unsignedp) - PTR p; - unsigned int size; - boolean unsignedp; +static bfd_boolean +pr_int_type (void *p, unsigned int size, bfd_boolean unsignedp) { struct pr_handle *info = (struct pr_handle *) p; char ab[10]; @@ -450,10 +569,8 @@ pr_int_type (p, size, unsignedp) /* Push a floating type onto the type stack. */ -static boolean -pr_float_type (p, size) - PTR p; - unsigned int size; +static bfd_boolean +pr_float_type (void *p, unsigned int size) { struct pr_handle *info = (struct pr_handle *) p; char ab[10]; @@ -469,25 +586,21 @@ pr_float_type (p, size) /* Push a complex type onto the type stack. */ -static boolean -pr_complex_type (p, size) - PTR p; - unsigned int size; +static bfd_boolean +pr_complex_type (void *p, unsigned int size) { struct pr_handle *info = (struct pr_handle *) p; if (! pr_float_type (p, size)) - return false; + return FALSE; return prepend_type (info, "complex "); } -/* Push a boolean type onto the type stack. */ +/* Push a bfd_boolean type onto the type stack. */ -static boolean -pr_bool_type (p, size) - PTR p; - unsigned int size; +static bfd_boolean +pr_bool_type (void *p, unsigned int size) { struct pr_handle *info = (struct pr_handle *) p; char ab[10]; @@ -499,32 +612,29 @@ pr_bool_type (p, size) /* Push an enum type onto the type stack. */ -static boolean -pr_enum_type (p, tag, names, values) - PTR p; - const char *tag; - const char **names; - bfd_signed_vma *values; +static bfd_boolean +pr_enum_type (void *p, const char *tag, const char **names, + bfd_signed_vma *values) { struct pr_handle *info = (struct pr_handle *) p; unsigned int i; bfd_signed_vma val; if (! push_type (info, "enum ")) - return false; + return FALSE; if (tag != NULL) { if (! append_type (info, tag) || ! append_type (info, " ")) - return false; + return FALSE; } if (! append_type (info, "{ ")) - return false; + return FALSE; if (names == NULL) { if (! append_type (info, "/* undefined */")) - return false; + return FALSE; } else { @@ -534,20 +644,20 @@ pr_enum_type (p, tag, names, values) if (i > 0) { if (! append_type (info, ", ")) - return false; + return FALSE; } if (! append_type (info, names[i])) - return false; + return FALSE; if (values[i] != val) { char ab[20]; - print_vma (values[i], ab, false, false); + print_vma (values[i], ab, FALSE, FALSE); if (! append_type (info, " = ") || ! append_type (info, ab)) - return false; + return FALSE; val = values[i]; } @@ -560,9 +670,8 @@ pr_enum_type (p, tag, names, values) /* Turn the top type on the stack into a pointer. */ -static boolean -pr_pointer_type (p) - PTR p; +static bfd_boolean +pr_pointer_type (void *p) { struct pr_handle *info = (struct pr_handle *) p; char *s; @@ -577,11 +686,8 @@ pr_pointer_type (p) /* Turn the top type on the stack into a function returning that type. */ -static boolean -pr_function_type (p, argcount, varargs) - PTR p; - int argcount; - boolean varargs; +static bfd_boolean +pr_function_type (void *p, int argcount, bfd_boolean varargs) { struct pr_handle *info = (struct pr_handle *) p; char **arg_types; @@ -605,10 +711,10 @@ pr_function_type (p, argcount, varargs) for (i = argcount - 1; i >= 0; i--) { if (! substitute_type (info, "")) - return false; + return FALSE; arg_types[i] = pop_type (info); if (arg_types[i] == NULL) - return false; + return FALSE; len += strlen (arg_types[i]) + 2; } if (varargs) @@ -645,18 +751,17 @@ pr_function_type (p, argcount, varargs) strcat (s, ")"); if (! substitute_type (info, s)) - return false; + return FALSE; free (s); - return true; + return TRUE; } /* Turn the top type on the stack into a reference to that type. */ -static boolean -pr_reference_type (p) - PTR p; +static bfd_boolean +pr_reference_type (void *p) { struct pr_handle *info = (struct pr_handle *) p; @@ -667,11 +772,8 @@ pr_reference_type (p) /* Make a range type. */ -static boolean -pr_range_type (p, lower, upper) - PTR p; - bfd_signed_vma lower; - bfd_signed_vma upper; +static bfd_boolean +pr_range_type (void *p, bfd_signed_vma lower, bfd_signed_vma upper) { struct pr_handle *info = (struct pr_handle *) p; char abl[20], abu[20]; @@ -679,10 +781,10 @@ pr_range_type (p, lower, upper) assert (info->stack != NULL); if (! substitute_type (info, "")) - return false; + return FALSE; - print_vma (lower, abl, false, false); - print_vma (upper, abu, false, false); + print_vma (lower, abl, FALSE, FALSE); + print_vma (upper, abu, FALSE, FALSE); return (prepend_type (info, "range (") && append_type (info, "):") @@ -693,12 +795,9 @@ pr_range_type (p, lower, upper) /* Make an array type. */ -static boolean -pr_array_type (p, lower, upper, stringp) - PTR p; - bfd_signed_vma lower; - bfd_signed_vma upper; - boolean stringp; +static bfd_boolean +pr_array_type (void *p, bfd_signed_vma lower, bfd_signed_vma upper, + bfd_boolean stringp) { struct pr_handle *info = (struct pr_handle *) p; char *range_type; @@ -706,7 +805,7 @@ pr_array_type (p, lower, upper, stringp) range_type = pop_type (info); if (range_type == NULL) - return false; + return FALSE; if (lower == 0) { @@ -714,76 +813,73 @@ pr_array_type (p, lower, upper, stringp) sprintf (ab, "|[]"); else { - print_vma (upper + 1, abu, false, false); + print_vma (upper + 1, abu, FALSE, FALSE); sprintf (ab, "|[%s]", abu); } } else { - print_vma (lower, abl, false, false); - print_vma (upper, abu, false, false); + print_vma (lower, abl, FALSE, FALSE); + print_vma (upper, abu, FALSE, FALSE); sprintf (ab, "|[%s:%s]", abl, abu); } if (! substitute_type (info, ab)) - return false; + return FALSE; if (strcmp (range_type, "int") != 0) { if (! append_type (info, ":") || ! append_type (info, range_type)) - return false; + return FALSE; } if (stringp) { if (! append_type (info, " /* string */")) - return false; + return FALSE; } - return true; + return TRUE; } /* Make a set type. */ -static boolean -pr_set_type (p, bitstringp) - PTR p; - boolean bitstringp; +static bfd_boolean +pr_set_type (void *p, bfd_boolean bitstringp) { struct pr_handle *info = (struct pr_handle *) p; if (! substitute_type (info, "")) - return false; + return FALSE; if (! prepend_type (info, "set { ") || ! append_type (info, " }")) - return false; + return FALSE; if (bitstringp) { if (! append_type (info, "/* bitstring */")) - return false; + return FALSE; } - return true; + return TRUE; } /* Make an offset type. */ -static boolean -pr_offset_type (p) - PTR p; +static bfd_boolean +pr_offset_type (void *p) { struct pr_handle *info = (struct pr_handle *) p; char *t; if (! substitute_type (info, "")) - return false; + return FALSE; t = pop_type (info); if (t == NULL) - return false; + return FALSE; return (substitute_type (info, "") && prepend_type (info, " ") @@ -793,12 +889,8 @@ pr_offset_type (p) /* Make a method type. */ -static boolean -pr_method_type (p, domain, argcount, varargs) - PTR p; - boolean domain; - int argcount; - boolean varargs; +static bfd_boolean +pr_method_type (void *p, bfd_boolean domain, int argcount, bfd_boolean varargs) { struct pr_handle *info = (struct pr_handle *) p; unsigned int len; @@ -813,10 +905,10 @@ pr_method_type (p, domain, argcount, varargs) else { if (! substitute_type (info, "")) - return false; + return FALSE; domain_type = pop_type (info); if (domain_type == NULL) - return false; + return FALSE; if (strncmp (domain_type, "class ", sizeof "class " - 1) == 0 && strchr (domain_type + sizeof "class " - 1, ' ') == NULL) domain_type += sizeof "class " - 1; @@ -841,10 +933,10 @@ pr_method_type (p, domain, argcount, varargs) for (i = argcount - 1; i >= 0; i--) { if (! substitute_type (info, "")) - return false; + return FALSE; arg_types[i] = pop_type (info); if (arg_types[i] == NULL) - return false; + return FALSE; len += strlen (arg_types[i]) + 2; } if (varargs) @@ -885,18 +977,17 @@ pr_method_type (p, domain, argcount, varargs) strcat (s, ")"); if (! substitute_type (info, s)) - return false; + return FALSE; free (s); - return true; + return TRUE; } /* Make a const qualified type. */ -static boolean -pr_const_type (p) - PTR p; +static bfd_boolean +pr_const_type (void *p) { struct pr_handle *info = (struct pr_handle *) p; @@ -905,9 +996,8 @@ pr_const_type (p) /* Make a volatile qualified type. */ -static boolean -pr_volatile_type (p) - PTR p; +static bfd_boolean +pr_volatile_type (void *p) { struct pr_handle *info = (struct pr_handle *) p; @@ -916,24 +1006,20 @@ pr_volatile_type (p) /* Start accumulating a struct type. */ -static boolean -pr_start_struct_type (p, tag, id, structp, size) - PTR p; - const char *tag; - unsigned int id; - boolean structp; - unsigned int size; +static bfd_boolean +pr_start_struct_type (void *p, const char *tag, unsigned int id, + bfd_boolean structp, unsigned int size) { struct pr_handle *info = (struct pr_handle *) p; info->indent += 2; if (! push_type (info, structp ? "struct " : "union ")) - return false; + return FALSE; if (tag != NULL) { if (! append_type (info, tag)) - return false; + return FALSE; } else { @@ -941,35 +1027,35 @@ pr_start_struct_type (p, tag, id, structp, size) sprintf (idbuf, "%%anon%u", id); if (! append_type (info, idbuf)) - return false; + return FALSE; } if (! append_type (info, " {")) - return false; + return FALSE; if (size != 0 || tag != NULL) { char ab[30]; if (! append_type (info, " /*")) - return false; + return FALSE; if (size != 0) { sprintf (ab, " size %u", size); if (! append_type (info, ab)) - return false; + return FALSE; } if (tag != NULL) { sprintf (ab, " id %u", id); if (! append_type (info, ab)) - return false; + return FALSE; } if (! append_type (info, " */")) - return false; + return FALSE; } if (! append_type (info, "\n")) - return false; + return FALSE; info->stack->visibility = DEBUG_VISIBILITY_PUBLIC; @@ -978,10 +1064,8 @@ pr_start_struct_type (p, tag, id, structp, size) /* Output the visibility of a field in a struct. */ -static boolean -pr_fix_visibility (info, visibility) - struct pr_handle *info; - enum debug_visibility visibility; +static bfd_boolean +pr_fix_visibility (struct pr_handle *info, enum debug_visibility visibility) { const char *s = NULL; char *t; @@ -990,9 +1074,7 @@ pr_fix_visibility (info, visibility) assert (info->stack != NULL); if (info->stack->visibility == visibility) - return true; - - assert (info->stack->visibility != DEBUG_VISIBILITY_IGNORE); + return TRUE; switch (visibility) { @@ -1010,7 +1092,7 @@ pr_fix_visibility (info, visibility) break; default: abort (); - return false; + return FALSE; } /* Trim off a trailing space in the struct string, to make the @@ -1024,64 +1106,59 @@ pr_fix_visibility (info, visibility) if (! append_type (info, s) || ! append_type (info, ":\n") || ! indent_type (info)) - return false; + return FALSE; info->stack->visibility = visibility; - return true; + return TRUE; } /* Add a field to a struct type. */ -static boolean -pr_struct_field (p, name, bitpos, bitsize, visibility) - PTR p; - const char *name; - bfd_vma bitpos; - bfd_vma bitsize; - enum debug_visibility visibility; +static bfd_boolean +pr_struct_field (void *p, const char *name, bfd_vma bitpos, bfd_vma bitsize, + enum debug_visibility visibility) { struct pr_handle *info = (struct pr_handle *) p; char ab[20]; char *t; if (! substitute_type (info, name)) - return false; + return FALSE; if (! append_type (info, "; /* ")) - return false; + return FALSE; if (bitsize != 0) { - print_vma (bitsize, ab, true, false); + print_vma (bitsize, ab, TRUE, FALSE); if (! append_type (info, "bitsize ") || ! append_type (info, ab) || ! append_type (info, ", ")) - return false; + return FALSE; } - print_vma (bitpos, ab, true, false); + print_vma (bitpos, ab, TRUE, FALSE); if (! append_type (info, "bitpos ") || ! append_type (info, ab) || ! append_type (info, " */\n") || ! indent_type (info)) - return false; + return FALSE; t = pop_type (info); if (t == NULL) - return false; + return FALSE; if (! pr_fix_visibility (info, visibility)) - return false; + return FALSE; return append_type (info, t); } /* Finish a struct type. */ -static boolean -pr_end_struct_type (p) - PTR p; +static bfd_boolean +pr_end_struct_type (void *p) { struct pr_handle *info = (struct pr_handle *) p; char *s; @@ -1098,20 +1175,15 @@ pr_end_struct_type (p) *s++ = '}'; *s = '\0'; - return true; + return TRUE; } /* Start a class type. */ -static boolean -pr_start_class_type (p, tag, id, structp, size, vptr, ownvptr) - PTR p; - const char *tag; - unsigned int id; - boolean structp; - unsigned int size; - boolean vptr; - boolean ownvptr; +static bfd_boolean +pr_start_class_type (void *p, const char *tag, unsigned int id, + bfd_boolean structp, unsigned int size, + bfd_boolean vptr, bfd_boolean ownvptr) { struct pr_handle *info = (struct pr_handle *) p; char *tv = NULL; @@ -1122,15 +1194,15 @@ pr_start_class_type (p, tag, id, structp, size, vptr, ownvptr) { tv = pop_type (info); if (tv == NULL) - return false; + return FALSE; } if (! push_type (info, structp ? "class " : "union class ")) - return false; + return FALSE; if (tag != NULL) { if (! append_type (info, tag)) - return false; + return FALSE; } else { @@ -1138,15 +1210,15 @@ pr_start_class_type (p, tag, id, structp, size, vptr, ownvptr) sprintf (idbuf, "%%anon%u", id); if (! append_type (info, idbuf)) - return false; + return FALSE; } if (! append_type (info, " {")) - return false; + return FALSE; if (size != 0 || vptr || ownvptr || tag != NULL) { if (! append_type (info, " /*")) - return false; + return FALSE; if (size != 0) { @@ -1155,23 +1227,23 @@ pr_start_class_type (p, tag, id, structp, size, vptr, ownvptr) sprintf (ab, "%u", size); if (! append_type (info, " size ") || ! append_type (info, ab)) - return false; + return FALSE; } if (vptr) { if (! append_type (info, " vtable ")) - return false; + return FALSE; if (ownvptr) { if (! append_type (info, "self ")) - return false; + return FALSE; } else { if (! append_type (info, tv) || ! append_type (info, " ")) - return false; + return FALSE; } } @@ -1181,11 +1253,11 @@ pr_start_class_type (p, tag, id, structp, size, vptr, ownvptr) sprintf (ab, " id %u", id); if (! append_type (info, ab)) - return false; + return FALSE; } if (! append_type (info, " */")) - return false; + return FALSE; } info->stack->visibility = DEBUG_VISIBILITY_PRIVATE; @@ -1196,44 +1268,38 @@ pr_start_class_type (p, tag, id, structp, size, vptr, ownvptr) /* Add a static member to a class. */ -static boolean -pr_class_static_member (p, name, physname, visibility) - PTR p; - const char *name; - const char *physname; - enum debug_visibility visibility; +static bfd_boolean +pr_class_static_member (void *p, const char *name, const char *physname, + enum debug_visibility visibility) { struct pr_handle *info = (struct pr_handle *) p; char *t; if (! substitute_type (info, name)) - return false; + return FALSE; if (! prepend_type (info, "static ") || ! append_type (info, "; /* ") || ! append_type (info, physname) || ! append_type (info, " */\n") || ! indent_type (info)) - return false; + return FALSE; t = pop_type (info); if (t == NULL) - return false; + return FALSE; if (! pr_fix_visibility (info, visibility)) - return false; + return FALSE; return append_type (info, t); } /* Add a base class to a class. */ -static boolean -pr_class_baseclass (p, bitpos, virtual, visibility) - PTR p; - bfd_vma bitpos; - boolean virtual; - enum debug_visibility visibility; +static bfd_boolean +pr_class_baseclass (void *p, bfd_vma bitpos, bfd_boolean virtual, + enum debug_visibility visibility) { struct pr_handle *info = (struct pr_handle *) p; char *t; @@ -1244,11 +1310,11 @@ pr_class_baseclass (p, bitpos, virtual, visibility) assert (info->stack != NULL && info->stack->next != NULL); if (! substitute_type (info, "")) - return false; + return FALSE; t = pop_type (info); if (t == NULL) - return false; + return FALSE; if (strncmp (t, "class ", sizeof "class " - 1) == 0) t += sizeof "class " - 1; @@ -1256,12 +1322,12 @@ pr_class_baseclass (p, bitpos, virtual, visibility) /* Push it back on to take advantage of the prepend_type and append_type routines. */ if (! push_type (info, t)) - return false; + return FALSE; if (virtual) { if (! prepend_type (info, "virtual ")) - return false; + return FALSE; } switch (visibility) @@ -1281,15 +1347,15 @@ pr_class_baseclass (p, bitpos, virtual, visibility) } if (! prepend_type (info, prefix)) - return false; + return FALSE; if (bitpos != 0) { - print_vma (bitpos, ab, true, false); + print_vma (bitpos, ab, TRUE, FALSE); if (! append_type (info, " /* bitpos ") || ! append_type (info, ab) || ! append_type (info, " */")) - return false; + return FALSE; } /* Now the top of the stack is something like "public A / * bitpos @@ -1306,11 +1372,11 @@ pr_class_baseclass (p, bitpos, virtual, visibility) if (*l == ':') break; if (! prepend_type (info, l == s ? " : " : ", ")) - return false; + return FALSE; t = pop_type (info); if (t == NULL) - return false; + return FALSE; n = (char *) xmalloc (strlen (info->stack->type) + strlen (t) + 1); memcpy (n, info->stack->type, s - info->stack->type); @@ -1322,35 +1388,28 @@ pr_class_baseclass (p, bitpos, virtual, visibility) free (t); - return true; + return TRUE; } /* Start adding a method to a class. */ -static boolean -pr_class_start_method (p, name) - PTR p; - const char *name; +static bfd_boolean +pr_class_start_method (void *p, const char *name) { struct pr_handle *info = (struct pr_handle *) p; assert (info->stack != NULL); info->stack->method = name; - return true; + return TRUE; } /* Add a variant to a method. */ -static boolean -pr_class_method_variant (p, physname, visibility, constp, volatilep, voffset, - context) - PTR p; - const char *physname; - enum debug_visibility visibility; - boolean constp; - boolean volatilep; - bfd_vma voffset; - boolean context; +static bfd_boolean +pr_class_method_variant (void *p, const char *physname, + enum debug_visibility visibility, + bfd_boolean constp, bfd_boolean volatilep, + bfd_vma voffset, bfd_boolean context) { struct pr_handle *info = (struct pr_handle *) p; char *method_type; @@ -1363,12 +1422,12 @@ pr_class_method_variant (p, physname, visibility, constp, volatilep, voffset, if (volatilep) { if (! append_type (info, " volatile")) - return false; + return FALSE; } if (constp) { if (! append_type (info, " const")) - return false; + return FALSE; } /* Stick the name of the method into its type. */ @@ -1376,12 +1435,12 @@ pr_class_method_variant (p, physname, visibility, constp, volatilep, voffset, (context ? info->stack->next->next->method : info->stack->next->method))) - return false; + return FALSE; /* Get the type. */ method_type = pop_type (info); if (method_type == NULL) - return false; + return FALSE; /* Pull off the context type if there is one. */ if (! context) @@ -1390,19 +1449,19 @@ pr_class_method_variant (p, physname, visibility, constp, volatilep, voffset, { context_type = pop_type (info); if (context_type == NULL) - return false; + return FALSE; } /* Now the top of the stack is the class. */ if (! pr_fix_visibility (info, visibility)) - return false; + return FALSE; if (! append_type (info, method_type) || ! append_type (info, " /* ") || ! append_type (info, physname) || ! append_type (info, " ")) - return false; + return FALSE; if (context || voffset != 0) { char ab[20]; @@ -1412,12 +1471,12 @@ pr_class_method_variant (p, physname, visibility, constp, volatilep, voffset, if (! append_type (info, "context ") || ! append_type (info, context_type) || ! append_type (info, " ")) - return false; + return FALSE; } - print_vma (voffset, ab, true, false); + print_vma (voffset, ab, TRUE, FALSE); if (! append_type (info, "voffset ") || ! append_type (info, ab)) - return false; + return FALSE; } return (append_type (info, " */;\n") @@ -1426,13 +1485,10 @@ pr_class_method_variant (p, physname, visibility, constp, volatilep, voffset, /* Add a static variant to a method. */ -static boolean -pr_class_static_method_variant (p, physname, visibility, constp, volatilep) - PTR p; - const char *physname; - enum debug_visibility visibility; - boolean constp; - boolean volatilep; +static bfd_boolean +pr_class_static_method_variant (void *p, const char *physname, + enum debug_visibility visibility, + bfd_boolean constp, bfd_boolean volatilep) { struct pr_handle *info = (struct pr_handle *) p; char *method_type; @@ -1445,31 +1501,31 @@ pr_class_static_method_variant (p, physname, visibility, constp, volatilep) if (volatilep) { if (! append_type (info, " volatile")) - return false; + return FALSE; } if (constp) { if (! append_type (info, " const")) - return false; + return FALSE; } /* Mark it as static. */ if (! prepend_type (info, "static ")) - return false; + return FALSE; /* Stick the name of the method into its type. */ if (! substitute_type (info, info->stack->next->method)) - return false; + return FALSE; /* Get the type. */ method_type = pop_type (info); if (method_type == NULL) - return false; + return FALSE; /* Now the top of the stack is the class. */ if (! pr_fix_visibility (info, visibility)) - return false; + return FALSE; return (append_type (info, method_type) && append_type (info, " /* ") @@ -1480,31 +1536,27 @@ pr_class_static_method_variant (p, physname, visibility, constp, volatilep) /* Finish up a method. */ -static boolean -pr_class_end_method (p) - PTR p; +static bfd_boolean +pr_class_end_method (void *p) { struct pr_handle *info = (struct pr_handle *) p; info->stack->method = NULL; - return true; + return TRUE; } /* Finish up a class. */ -static boolean -pr_end_class_type (p) - PTR p; +static bfd_boolean +pr_end_class_type (void *p) { return pr_end_struct_type (p); } /* Push a type on the stack using a typedef name. */ -static boolean -pr_typedef_type (p, name) - PTR p; - const char *name; +static bfd_boolean +pr_typedef_type (void *p, const char *name) { struct pr_handle *info = (struct pr_handle *) p; @@ -1513,12 +1565,9 @@ pr_typedef_type (p, name) /* Push a type on the stack using a tag name. */ -static boolean -pr_tag_type (p, name, id, kind) - PTR p; - const char *name; - unsigned int id; - enum debug_type_kind kind; +static bfd_boolean +pr_tag_type (void *p, const char *name, unsigned int id, + enum debug_type_kind kind) { struct pr_handle *info = (struct pr_handle *) p; const char *t, *tag; @@ -1543,11 +1592,11 @@ pr_tag_type (p, name, id, kind) break; default: abort (); - return false; + return FALSE; } if (! push_type (info, t)) - return false; + return FALSE; if (name != NULL) tag = name; else @@ -1557,104 +1606,91 @@ pr_tag_type (p, name, id, kind) } if (! append_type (info, tag)) - return false; + return FALSE; if (name != NULL && kind != DEBUG_KIND_ENUM) { sprintf (idbuf, " /* id %u */", id); if (! append_type (info, idbuf)) - return false; + return FALSE; } - return true; + return TRUE; } /* Output a typedef. */ -static boolean -pr_typdef (p, name) - PTR p; - const char *name; +static bfd_boolean +pr_typdef (void *p, const char *name) { struct pr_handle *info = (struct pr_handle *) p; char *s; if (! substitute_type (info, name)) - return false; + return FALSE; s = pop_type (info); if (s == NULL) - return false; + return FALSE; indent (info); fprintf (info->f, "typedef %s;\n", s); free (s); - return true; + return TRUE; } /* Output a tag. The tag should already be in the string on the stack, so all we have to do here is print it out. */ -static boolean -pr_tag (p, name) - PTR p; - const char *name ATTRIBUTE_UNUSED; +static bfd_boolean +pr_tag (void *p, const char *name ATTRIBUTE_UNUSED) { struct pr_handle *info = (struct pr_handle *) p; char *t; t = pop_type (info); if (t == NULL) - return false; + return FALSE; indent (info); fprintf (info->f, "%s;\n", t); free (t); - return true; + return TRUE; } /* Output an integer constant. */ -static boolean -pr_int_constant (p, name, val) - PTR p; - const char *name; - bfd_vma val; +static bfd_boolean +pr_int_constant (void *p, const char *name, bfd_vma val) { struct pr_handle *info = (struct pr_handle *) p; char ab[20]; indent (info); - print_vma (val, ab, false, false); + print_vma (val, ab, FALSE, FALSE); fprintf (info->f, "const int %s = %s;\n", name, ab); - return true; + return TRUE; } /* Output a floating point constant. */ -static boolean -pr_float_constant (p, name, val) - PTR p; - const char *name; - double val; +static bfd_boolean +pr_float_constant (void *p, const char *name, double val) { struct pr_handle *info = (struct pr_handle *) p; indent (info); fprintf (info->f, "const double %s = %g;\n", name, val); - return true; + return TRUE; } /* Output a typed constant. */ -static boolean -pr_typed_constant (p, name, val) - PTR p; - const char *name; - bfd_vma val; +static bfd_boolean +pr_typed_constant (void *p, const char *name, bfd_vma val) { struct pr_handle *info = (struct pr_handle *) p; char *t; @@ -1662,36 +1698,33 @@ pr_typed_constant (p, name, val) t = pop_type (info); if (t == NULL) - return false; + return FALSE; indent (info); - print_vma (val, ab, false, false); + print_vma (val, ab, FALSE, FALSE); fprintf (info->f, "const %s %s = %s;\n", t, name, ab); free (t); - return true; + return TRUE; } /* Output a variable. */ -static boolean -pr_variable (p, name, kind, val) - PTR p; - const char *name; - enum debug_var_kind kind; - bfd_vma val; +static bfd_boolean +pr_variable (void *p, const char *name, enum debug_var_kind kind, + bfd_vma val) { struct pr_handle *info = (struct pr_handle *) p; char *t; char ab[20]; if (! substitute_type (info, name)) - return false; + return FALSE; t = pop_type (info); if (t == NULL) - return false; + return FALSE; indent (info); switch (kind) @@ -1706,31 +1739,28 @@ pr_variable (p, name, kind, val) default: break; } - print_vma (val, ab, true, true); + print_vma (val, ab, TRUE, TRUE); fprintf (info->f, "%s /* %s */;\n", t, ab); free (t); - return true; + return TRUE; } /* Start outputting a function. */ -static boolean -pr_start_function (p, name, global) - PTR p; - const char *name; - boolean global; +static bfd_boolean +pr_start_function (void *p, const char *name, bfd_boolean global) { struct pr_handle *info = (struct pr_handle *) p; char *t; if (! substitute_type (info, name)) - return false; + return FALSE; t = pop_type (info); if (t == NULL) - return false; + return FALSE; indent (info); if (! global) @@ -1739,17 +1769,14 @@ pr_start_function (p, name, global) info->parameter = 1; - return true; + return TRUE; } /* Output a function parameter. */ -static boolean -pr_function_parameter (p, name, kind, val) - PTR p; - const char *name; - enum debug_parm_kind kind; - bfd_vma val; +static bfd_boolean +pr_function_parameter (void *p, const char *name, + enum debug_parm_kind kind, bfd_vma val) { struct pr_handle *info = (struct pr_handle *) p; char *t; @@ -1759,15 +1786,15 @@ pr_function_parameter (p, name, kind, val) || kind == DEBUG_PARM_REF_REG) { if (! pr_reference_type (p)) - return false; + return FALSE; } if (! substitute_type (info, name)) - return false; + return FALSE; t = pop_type (info); if (t == NULL) - return false; + return FALSE; if (info->parameter != 1) fprintf (info->f, ", "); @@ -1775,22 +1802,20 @@ pr_function_parameter (p, name, kind, val) if (kind == DEBUG_PARM_REG || kind == DEBUG_PARM_REF_REG) fprintf (info->f, "register "); - print_vma (val, ab, true, true); + print_vma (val, ab, TRUE, TRUE); fprintf (info->f, "%s /* %s */", t, ab); free (t); ++info->parameter; - return true; + return TRUE; } /* Start writing out a block. */ -static boolean -pr_start_block (p, addr) - PTR p; - bfd_vma addr; +static bfd_boolean +pr_start_block (void *p, bfd_vma addr) { struct pr_handle *info = (struct pr_handle *) p; char ab[20]; @@ -1802,39 +1827,33 @@ pr_start_block (p, addr) } indent (info); - print_vma (addr, ab, true, true); + print_vma (addr, ab, TRUE, TRUE); fprintf (info->f, "{ /* %s */\n", ab); info->indent += 2; - return true; + return TRUE; } /* Write out line number information. */ -static boolean -pr_lineno (p, filename, lineno, addr) - PTR p; - const char *filename; - unsigned long lineno; - bfd_vma addr; +static bfd_boolean +pr_lineno (void *p, const char *filename, unsigned long lineno, bfd_vma addr) { struct pr_handle *info = (struct pr_handle *) p; char ab[20]; indent (info); - print_vma (addr, ab, true, true); + print_vma (addr, ab, TRUE, TRUE); fprintf (info->f, "/* file %s line %lu addr %s */\n", filename, lineno, ab); - return true; + return TRUE; } /* Finish writing out a block. */ -static boolean -pr_end_block (p, addr) - PTR p; - bfd_vma addr; +static bfd_boolean +pr_end_block (void *p, bfd_vma addr) { struct pr_handle *info = (struct pr_handle *) p; char ab[20]; @@ -1842,17 +1861,934 @@ pr_end_block (p, addr) info->indent -= 2; indent (info); - print_vma (addr, ab, true, true); + print_vma (addr, ab, TRUE, TRUE); fprintf (info->f, "} /* %s */\n", ab); - return true; + return TRUE; } /* Finish writing out a function. */ -static boolean -pr_end_function (p) - PTR p ATTRIBUTE_UNUSED; +static bfd_boolean +pr_end_function (void *p ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +/* Tags style generation functions start here. */ + +/* Variables for address to line translation. */ +static bfd_vma pc; +static const char *filename; +static const char *functionname; +static unsigned int line; +static bfd_boolean found; + +/* Look for an address in a section. This is called via + bfd_map_over_sections. */ + +static void +find_address_in_section (bfd *abfd, asection *section, void *data) +{ + bfd_vma vma; + bfd_size_type size; + asymbol **syms = (asymbol **) data; + + if (found) + return; + + if ((bfd_get_section_flags (abfd, section) & SEC_ALLOC) == 0) + return; + + vma = bfd_get_section_vma (abfd, section); + if (pc < vma) + return; + + size = bfd_get_section_size_before_reloc (section); + if (pc >= vma + size) + return; + + found = bfd_find_nearest_line (abfd, section, syms, pc - vma, + &filename, &functionname, &line); +} + +static void +translate_addresses (bfd *abfd, char *addr_hex, FILE *f, asymbol **syms) +{ + pc = bfd_scan_vma (addr_hex, NULL, 16); + found = FALSE; + bfd_map_over_sections (abfd, find_address_in_section, syms); + + if (! found) + fprintf (f, "??"); + else + fprintf (f, "%u", line); +} + +/* Start a new compilation unit. */ + +static bfd_boolean +tg_start_compilation_unit (void * p, const char *filename ATTRIBUTE_UNUSED) +{ + struct pr_handle *info = (struct pr_handle *) p; + + fprintf (stderr, "New compilation unit: %s\n", filename); + + free (info->filename); + /* Should it be relative? best way to do it here?. */ + info->filename = strdup (filename); + + return TRUE; +} + +/* Start a source file within a compilation unit. */ + +static bfd_boolean +tg_start_source (void *p, const char *filename) +{ + struct pr_handle *info = (struct pr_handle *) p; + + free (info->filename); + /* Should it be relative? best way to do it here?. */ + info->filename = strdup (filename); + + return TRUE; +} + +/* Push an enum type onto the type stack. */ + +static bfd_boolean +tg_enum_type (void *p, const char *tag, const char **names, + bfd_signed_vma *values) +{ + struct pr_handle *info = (struct pr_handle *) p; + unsigned int i; + const char *name; + char ab[20]; + + if (! pr_enum_type (p, tag, names, values)) + return FALSE; + + name = tag ? tag : "unknown"; + /* Generate an entry for the enum. */ + if (tag) + fprintf (info->f, "%s\t%s\t0;\"\tkind:e\ttype:%s\n", tag, + info->filename, info->stack->type); + + /* Generate entries for the values. */ + if (names != NULL) + { + for (i = 0; names[i] != NULL; i++) + { + print_vma (values[i], ab, FALSE, FALSE); + fprintf (info->f, "%s\t%s\t0;\"\tkind:g\tenum:%s\tvalue:%s\n", + names[i], info->filename, name, ab); + } + } + + return TRUE; +} + +/* Start accumulating a struct type. */ + +static bfd_boolean +tg_start_struct_type (void *p, const char *tag, unsigned int id, + bfd_boolean structp, + unsigned int size ATTRIBUTE_UNUSED) +{ + struct pr_handle *info = (struct pr_handle *) p; + const char *name; + char idbuf[20]; + + if (tag != NULL) + name = tag; + else + { + name = idbuf; + sprintf (idbuf, "%%anon%u", id); + } + + if (! push_type (info, name)) + return FALSE; + + info->stack->flavor = structp ? "struct" : "union"; + + fprintf (info->f, "%s\t%s\t0;\"\tkind:%c\n", name, info->filename, + info->stack->flavor[0]); + + info->stack->visibility = DEBUG_VISIBILITY_PUBLIC; + + return indent_type (info); +} + +/* Output the visibility of a field in a struct. */ + +static bfd_boolean +tg_fix_visibility (struct pr_handle *info, enum debug_visibility visibility) +{ + assert (info->stack != NULL); + + if (info->stack->visibility == visibility) + return TRUE; + + assert (info->stack->visibility != DEBUG_VISIBILITY_IGNORE); + + info->stack->visibility = visibility; + + return TRUE; +} + +/* Add a field to a struct type. */ + +static bfd_boolean +tg_struct_field (void *p, const char *name, bfd_vma bitpos ATTRIBUTE_UNUSED, + bfd_vma bitsize ATTRIBUTE_UNUSED, + enum debug_visibility visibility) +{ + struct pr_handle *info = (struct pr_handle *) p; + char *t; + + t = pop_type (info); + if (t == NULL) + return FALSE; + + if (! tg_fix_visibility (info, visibility)) + return FALSE; + + /* It happens, a bug? */ + if (! name[0]) + return TRUE; + + fprintf (info->f, "%s\t%s\t0;\"\tkind:m\ttype:%s\t%s:%s\taccess:%s\n", + name, info->filename, t, info->stack->flavor, info->stack->type, + visibility_name (visibility)); + + return TRUE; +} + +/* Finish a struct type. */ + +static bfd_boolean +tg_end_struct_type (void *p ATTRIBUTE_UNUSED) +{ + struct pr_handle *info = (struct pr_handle *) p; + assert (info->stack != NULL); + + return TRUE; +} + +/* Start a class type. */ + +static bfd_boolean +tg_start_class_type (void *p, const char *tag, unsigned int id, + bfd_boolean structp, unsigned int size, + bfd_boolean vptr, bfd_boolean ownvptr) +{ + struct pr_handle *info = (struct pr_handle *) p; + char *tv = NULL; + const char *name; + + info->indent += 2; + + if (vptr && ! ownvptr) + { + tv = pop_type (info); + if (tv == NULL) + return FALSE; + } + + if (tag != NULL) + name = tag; + else + { + char idbuf[20]; + + sprintf (idbuf, "%%anon%u", id); + name = idbuf; + } + + if (! push_type (info, name)) + return FALSE; + + info->stack->flavor = structp ? "class" : "union class"; + info->stack->parents = NULL; + info->stack->num_parents = 0; + + if (size != 0 || vptr || ownvptr || tag != NULL) + { + if (vptr) + { + if (! append_type (info, " vtable ")) + return FALSE; + if (ownvptr) + { + if (! append_type (info, "self ")) + return FALSE; + } + else + { + if (! append_type (info, tv) + || ! append_type (info, " ")) + return FALSE; + } + } + } + + info->stack->visibility = DEBUG_VISIBILITY_PRIVATE; + + return TRUE; +} + +/* Add a static member to a class. */ + +static bfd_boolean +tg_class_static_member (void *p, const char *name, + const char *physname ATTRIBUTE_UNUSED, + enum debug_visibility visibility) +{ + struct pr_handle *info = (struct pr_handle *) p; + char *t; + int len_var, len_class; + char *full_name; + + len_var = strlen (name); + len_class = strlen (info->stack->next->type); + full_name = (char *) xmalloc (len_var + len_class + 3); + if (! full_name) + return FALSE; + memcpy (full_name, info->stack->next->type, len_class); + memcpy (full_name + len_class, "::", 2); + memcpy (full_name + len_class + 2, name, len_var + 1); + + if (! substitute_type (info, full_name)) + return FALSE; + + if (! prepend_type (info, "static ")) + return FALSE; + + t = pop_type (info); + if (t == NULL) + return FALSE; + + if (! tg_fix_visibility (info, visibility)) + return FALSE; + + fprintf (info->f, "%s\t%s\t0;\"\tkind:x\ttype:%s\tclass:%s\taccess:%s\n", + name, info->filename, t, info->stack->type, + visibility_name (visibility)); + free (t); + free (full_name); + + return TRUE; +} + +/* Add a base class to a class. */ + +static bfd_boolean +tg_class_baseclass (void *p, bfd_vma bitpos ATTRIBUTE_UNUSED, + bfd_boolean virtual, enum debug_visibility visibility) +{ + struct pr_handle *info = (struct pr_handle *) p; + char *t; + const char *prefix; + + assert (info->stack != NULL && info->stack->next != NULL); + + t = pop_type (info); + if (t == NULL) + return FALSE; + + if (strncmp (t, "class ", sizeof "class " - 1) == 0) + t += sizeof "class " - 1; + + /* Push it back on to take advantage of the prepend_type and + append_type routines. */ + if (! push_type (info, t)) + return FALSE; + + if (virtual) + { + if (! prepend_type (info, "virtual ")) + return FALSE; + } + + switch (visibility) + { + case DEBUG_VISIBILITY_PUBLIC: + prefix = "public "; + break; + case DEBUG_VISIBILITY_PROTECTED: + prefix = "protected "; + break; + case DEBUG_VISIBILITY_PRIVATE: + prefix = "private "; + break; + default: + prefix = "/* unknown visibility */ "; + break; + } + + if (! prepend_type (info, prefix)) + return FALSE; + + t = pop_type (info); + if (t == NULL) + return FALSE; + + if (info->stack->num_parents && ! append_parent (info, ", ")) + return FALSE; + + if (! append_parent (info, t)) + return FALSE; + info->stack->num_parents++; + + free (t); + + return TRUE; +} + +/* Add a variant to a method. */ + +static bfd_boolean +tg_class_method_variant (void *p, const char *physname ATTRIBUTE_UNUSED, + enum debug_visibility visibility, + bfd_boolean constp, bfd_boolean volatilep, + bfd_vma voffset ATTRIBUTE_UNUSED, + bfd_boolean context) { - return true; + struct pr_handle *info = (struct pr_handle *) p; + char *method_type; + char *context_type; + char *method_name; + + assert (info->stack != NULL); + assert (info->stack->next != NULL); + + /* Put the const and volatile qualifiers on the type. */ + if (volatilep) + { + if (! append_type (info, " volatile")) + return FALSE; + } + if (constp) + { + if (! append_type (info, " const")) + return FALSE; + } + + method_name = strdup (context ? info->stack->next->next->method + : info->stack->next->method); + + /* Stick the name of the method into its type. */ + if (! substitute_type (info, method_name)) + return FALSE; + + /* Get the type. */ + method_type = pop_type (info); + if (method_type == NULL) + return FALSE; + + /* Pull off the context type if there is one. */ + if (! context) + context_type = NULL; + else + { + context_type = pop_type (info); + if (context_type == NULL) + return FALSE; + } + + /* Now the top of the stack is the class. */ + if (! tg_fix_visibility (info, visibility)) + return FALSE; + + fprintf (info->f, "%s\t%s\t0;\"\tkind:p\ttype:%s\tclass:%s\n", + method_name, info->filename, method_type, info->stack->type); + free (method_type); + free (method_name); + free (context_type); + + return TRUE; +} + +/* Add a static variant to a method. */ + +static bfd_boolean +tg_class_static_method_variant (void *p, + const char *physname ATTRIBUTE_UNUSED, + enum debug_visibility visibility, + bfd_boolean constp, bfd_boolean volatilep) +{ + struct pr_handle *info = (struct pr_handle *) p; + char *method_type; + char *method_name; + + assert (info->stack != NULL); + assert (info->stack->next != NULL); + assert (info->stack->next->method != NULL); + + /* Put the const and volatile qualifiers on the type. */ + if (volatilep) + { + if (! append_type (info, " volatile")) + return FALSE; + } + if (constp) + { + if (! append_type (info, " const")) + return FALSE; + } + + /* Mark it as static. */ + if (! prepend_type (info, "static ")) + return FALSE; + + method_name = strdup (info->stack->next->method); + /* Stick the name of the method into its type. */ + if (! substitute_type (info, info->stack->next->method)) + return FALSE; + + /* Get the type. */ + method_type = pop_type (info); + if (method_type == NULL) + return FALSE; + + /* Now the top of the stack is the class. */ + if (! tg_fix_visibility (info, visibility)) + return FALSE; + + fprintf (info->f, "%s\t%s\t0;\"\tkind:p\ttype:%s\tclass:%s\taccess:%s\n", + method_name, info->filename, method_type, info->stack->type, + visibility_name (visibility)); + free (method_type); + free (method_name); + + return TRUE; +} + +/* Finish up a class. */ + +static bfd_boolean +tg_end_class_type (void *p) +{ + struct pr_handle *info = (struct pr_handle *) p; + + fprintf (info->f, "%s\t%s\t0;\"\tkind:c\ttype:%s", info->stack->type, + info->filename, info->stack->flavor); + if (info->stack->num_parents) + { + fprintf (info->f, "\tinherits:%s", info->stack->parents); + free (info->stack->parents); + } + fputc ('\n', info->f); + + return tg_end_struct_type (p); +} + +/* Push a type on the stack using a tag name. */ + +static bfd_boolean +tg_tag_type (void *p, const char *name, unsigned int id, + enum debug_type_kind kind) +{ + struct pr_handle *info = (struct pr_handle *) p; + const char *t, *tag; + char idbuf[20]; + + switch (kind) + { + case DEBUG_KIND_STRUCT: + t = "struct "; + break; + case DEBUG_KIND_UNION: + t = "union "; + break; + case DEBUG_KIND_ENUM: + t = "enum "; + break; + case DEBUG_KIND_CLASS: + t = "class "; + break; + case DEBUG_KIND_UNION_CLASS: + t = "union class "; + break; + default: + abort (); + return FALSE; + } + + if (! push_type (info, t)) + return FALSE; + if (name != NULL) + tag = name; + else + { + sprintf (idbuf, "%%anon%u", id); + tag = idbuf; + } + + if (! append_type (info, tag)) + return FALSE; + + return TRUE; +} + +/* Output a typedef. */ + +static bfd_boolean +tg_typdef (void *p, const char *name) +{ + struct pr_handle *info = (struct pr_handle *) p; + char *s; + + s = pop_type (info); + if (s == NULL) + return FALSE; + + fprintf (info->f, "%s\t%s\t0;\"\tkind:t\ttype:%s\n", name, + info->filename, s); + + free (s); + + return TRUE; +} + +/* Output a tag. The tag should already be in the string on the + stack, so all we have to do here is print it out. */ + +static bfd_boolean +tg_tag (void *p ATTRIBUTE_UNUSED, const char *name ATTRIBUTE_UNUSED) +{ + struct pr_handle *info = (struct pr_handle *) p; + char *t; + + t = pop_type (info); + if (t == NULL) + return FALSE; + free (t); + + return TRUE; +} + +/* Output an integer constant. */ + +static bfd_boolean +tg_int_constant (void *p, const char *name, bfd_vma val) +{ + struct pr_handle *info = (struct pr_handle *) p; + char ab[20]; + + indent (info); + print_vma (val, ab, FALSE, FALSE); + fprintf (info->f, "%s\t%s\t0;\"\tkind:v\ttype:const int\tvalue:%s\n", + name, info->filename, ab); + return TRUE; +} + +/* Output a floating point constant. */ + +static bfd_boolean +tg_float_constant (void *p, const char *name, double val) +{ + struct pr_handle *info = (struct pr_handle *) p; + + indent (info); + fprintf (info->f, "%s\t%s\t0;\"\tkind:v\ttype:const double\tvalue:%g\n", + name, info->filename, val); + return TRUE; +} + +/* Output a typed constant. */ + +static bfd_boolean +tg_typed_constant (void *p, const char *name, bfd_vma val) +{ + struct pr_handle *info = (struct pr_handle *) p; + char *t; + char ab[20]; + + t = pop_type (info); + if (t == NULL) + return FALSE; + + indent (info); + print_vma (val, ab, FALSE, FALSE); + fprintf (info->f, "%s\t%s\t0;\"\tkind:v\ttype:const %s\tvalue:%s\n", + name, info->filename, t, ab); + + free (t); + + return TRUE; +} + +/* Output a variable. */ + +static bfd_boolean +tg_variable (void *p, const char *name, enum debug_var_kind kind, + bfd_vma val ATTRIBUTE_UNUSED) +{ + struct pr_handle *info = (struct pr_handle *) p; + char *t; + const char *dname, *from_class; + + t = pop_type (info); + if (t == NULL) + return FALSE; + + dname = name; + if (info->demangler) + { + dname = info->demangler (info->abfd, name); + if (strcmp (name, dname) == 0) + { + free ((char *) dname); + dname = name; + } + } + + if (dname != name) + { + char *sep; + sep = strstr (dname, "::"); + if (sep) + { + *sep = 0; + name = sep + 2; + from_class = dname; + } + else + { + /* Obscure types as vts and type_info nodes. */ + name = dname; + from_class = NULL; + } + } + else + from_class = NULL; + + fprintf (info->f, "%s\t%s\t0;\"\tkind:v\ttype:%s", name, info->filename, t); + + switch (kind) + { + case DEBUG_STATIC: + case DEBUG_LOCAL_STATIC: + fprintf (info->f, "\tfile:"); + break; + case DEBUG_REGISTER: + fprintf (info->f, "\tregister:"); + break; + default: + break; + } + + if (from_class) + { + fprintf (info->f, "\tclass:%s",from_class); + free ((char *) dname); + } + + fprintf (info->f, "\n"); + + free (t); + + return TRUE; +} + +/* Start outputting a function. */ + +static bfd_boolean +tg_start_function (void *p, const char *name, bfd_boolean global) +{ + struct pr_handle *info = (struct pr_handle *) p; + const char *dname; + + if (! global) + info->stack->flavor = "static"; + else + info->stack->flavor = NULL; + + dname = name; + if (info->demangler) + { + dname = info->demangler (info->abfd, name); + if (strcmp (name, dname) == 0) + { + free ((char *) dname); + dname = name; + } + } + + if (! substitute_type (info, dname)) + return FALSE; + + if (dname != name) + { + char *sep; + sep = strstr (dname, "::"); + if (sep) + { + info->stack->method = dname; + *sep = 0; + name = sep + 2; + } + else + { + info->stack->method = ""; + name = dname; + } + sep = strchr (name, '('); + if (sep) + *sep = 0; + /* Obscure functions as type_info function. */ + } + else + info->stack->method = NULL; + + info->stack->parents = strdup (name); + + if (! info->stack->method && ! append_type (info, "(")) + return FALSE; + + info->parameter = 1; + + return TRUE; +} + +/* Output a function parameter. */ + +static bfd_boolean +tg_function_parameter (void *p, const char *name, enum debug_parm_kind kind, + bfd_vma val ATTRIBUTE_UNUSED) +{ + struct pr_handle *info = (struct pr_handle *) p; + char *t; + + if (kind == DEBUG_PARM_REFERENCE + || kind == DEBUG_PARM_REF_REG) + { + if (! pr_reference_type (p)) + return FALSE; + } + + if (! substitute_type (info, name)) + return FALSE; + + t = pop_type (info); + if (t == NULL) + return FALSE; + + if (! info->stack->method) + { + if (info->parameter != 1 && ! append_type (info, ", ")) + return FALSE; + + if (kind == DEBUG_PARM_REG || kind == DEBUG_PARM_REF_REG) + if (! append_type (info, "register ")) + return FALSE; + + if (! append_type (info, t)) + return FALSE; + } + + free (t); + + ++info->parameter; + + return TRUE; +} + +/* Start writing out a block. */ + +static bfd_boolean +tg_start_block (void *p, bfd_vma addr) +{ + struct pr_handle *info = (struct pr_handle *) p; + char ab[20], kind, *partof; + char *t; + bfd_boolean local; + + if (info->parameter > 0) + { + info->parameter = 0; + + /* Delayed name. */ + fprintf (info->f, "%s\t%s\t", info->stack->parents, info->filename); + free (info->stack->parents); + + print_vma (addr, ab, TRUE, TRUE); + translate_addresses (info->abfd, ab, info->f, info->syms); + local = info->stack->flavor != NULL; + if (info->stack->method && *info->stack->method) + { + kind = 'm'; + partof = (char *) info->stack->method; + } + else + { + kind = 'f'; + partof = NULL; + if (! info->stack->method && ! append_type (info, ")")) + return FALSE; + } + t = pop_type (info); + if (t == NULL) + return FALSE; + fprintf (info->f, ";\"\tkind:%c\ttype:%s", kind, t); + if (local) + fputs ("\tfile:", info->f); + if (partof) + { + fprintf (info->f, "\tclass:%s", partof); + free (partof); + } + fputc ('\n', info->f); + } + + return TRUE; +} + +/* Write out line number information. */ + +static bfd_boolean +tg_lineno (void *p ATTRIBUTE_UNUSED, const char *filename ATTRIBUTE_UNUSED, + unsigned long lineno ATTRIBUTE_UNUSED, + bfd_vma addr ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +/* Finish writing out a block. */ + +static bfd_boolean +tg_end_block (void *p ATTRIBUTE_UNUSED, bfd_vma addr ATTRIBUTE_UNUSED) +{ + return TRUE; +} + +/* Convert the visibility value into a human readable name. */ + +static const char * +visibility_name (enum debug_visibility visibility) +{ + const char *s; + + switch (visibility) + { + case DEBUG_VISIBILITY_PUBLIC: + s = "public"; + break; + case DEBUG_VISIBILITY_PRIVATE: + s = "private"; + break; + case DEBUG_VISIBILITY_PROTECTED: + s = "protected"; + break; + case DEBUG_VISIBILITY_IGNORE: + s = "/* ignore */"; + break; + default: + abort (); + return FALSE; + } + return s; } diff --git a/contrib/binutils/binutils/rclex.c b/contrib/binutils/binutils/rclex.c index bc9e68c..e5070e3 100644 --- a/contrib/binutils/binutils/rclex.c +++ b/contrib/binutils/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.8.1 2002/08/05 20:43:45 drow Exp $ + * $Header: /cvs/src/src/binutils/Attic/rclex.c,v 1.1.12.1 2004/04/09 19:32:15 drow Exp $ */ #define FLEX_SCANNER @@ -64,6 +64,7 @@ #define YY_PROTO(proto) () #endif + /* Returned upon end-of-file. */ #define YY_NULL 0 @@ -383,58 +384,58 @@ static yyconst int yy_meta[36] = static yyconst short int yy_base[476] = { 0, - 0, 0, 515, 516, 34, 516, 509, 0, 492, 25, - 26, 45, 25, 28, 24, 486, 497, 49, 0, 40, - 43, 486, 51, 66, 67, 482, 35, 516, 516, 81, - 503, 84, 0, 486, 516, 0, 494, 477, 492, 475, - 74, 474, 477, 475, 46, 489, 69, 484, 471, 481, - 55, 477, 481, 466, 67, 469, 83, 83, 467, 477, - 464, 478, 464, 459, 475, 470, 74, 453, 81, 457, - 86, 76, 468, 467, 465, 452, 452, 458, 95, 461, - 453, 447, 446, 106, 466, 456, 0, 451, 444, 449, - 448, 443, 452, 435, 436, 449, 433, 448, 430, 426, - - 429, 430, 433, 441, 424, 0, 423, 436, 435, 420, - 415, 417, 427, 419, 420, 424, 412, 428, 423, 410, - 424, 405, 406, 407, 419, 409, 0, 402, 409, 416, - 414, 410, 408, 415, 393, 399, 412, 406, 392, 401, - 397, 391, 387, 388, 386, 392, 394, 103, 383, 387, - 399, 388, 389, 396, 385, 377, 379, 376, 373, 376, - 370, 374, 387, 368, 363, 98, 381, 0, 379, 367, - 363, 0, 0, 362, 363, 360, 358, 375, 361, 356, - 105, 373, 372, 351, 355, 355, 349, 0, 366, 352, - 347, 346, 352, 346, 343, 356, 346, 354, 356, 352, - - 347, 344, 349, 0, 335, 344, 350, 0, 0, 334, - 115, 334, 345, 119, 0, 345, 331, 0, 328, 326, - 336, 325, 336, 328, 327, 320, 317, 313, 330, 0, - 330, 331, 0, 0, 327, 322, 329, 314, 314, 0, - 114, 305, 307, 318, 322, 318, 0, 321, 318, 107, - 318, 318, 0, 306, 316, 0, 316, 308, 0, 294, - 0, 298, 307, 294, 291, 304, 304, 0, 132, 137, - 293, 287, 290, 300, 288, 290, 0, 293, 295, 295, - 276, 292, 295, 0, 293, 278, 276, 0, 277, 0, - 270, 283, 267, 285, 270, 281, 0, 280, 279, 271, - - 265, 277, 261, 257, 259, 257, 0, 274, 256, 0, - 255, 254, 258, 248, 269, 268, 265, 258, 270, 143, - 269, 149, 0, 259, 241, 0, 240, 0, 259, 238, - 258, 239, 0, 250, 237, 250, 236, 231, 247, 246, - 0, 249, 247, 247, 234, 227, 240, 225, 0, 222, - 0, 223, 222, 239, 224, 237, 218, 227, 0, 216, - 215, 222, 217, 235, 213, 0, 0, 209, 0, 226, - 0, 209, 203, 0, 216, 0, 0, 0, 212, 206, - 211, 0, 220, 0, 0, 215, 204, 199, 200, 199, - 213, 199, 199, 197, 206, 208, 207, 199, 188, 194, - - 192, 188, 188, 190, 196, 0, 198, 182, 184, 182, - 0, 0, 184, 181, 188, 176, 0, 177, 171, 172, - 170, 183, 186, 181, 171, 0, 183, 171, 164, 0, - 167, 175, 0, 164, 160, 155, 157, 156, 159, 0, - 155, 0, 0, 160, 165, 156, 0, 0, 0, 0, - 0, 141, 150, 141, 139, 0, 0, 128, 122, 126, - 0, 0, 109, 91, 79, 0, 0, 0, 516, 156, - 161, 65, 166, 171, 176 + 0, 0, 517, 518, 34, 518, 511, 0, 494, 25, + 26, 45, 25, 28, 24, 488, 499, 49, 0, 40, + 43, 488, 51, 66, 67, 484, 35, 518, 518, 81, + 505, 84, 0, 488, 518, 0, 496, 479, 494, 477, + 75, 476, 479, 477, 46, 491, 70, 486, 473, 483, + 55, 479, 483, 468, 69, 471, 86, 84, 469, 479, + 466, 480, 466, 461, 477, 472, 75, 455, 81, 459, + 87, 77, 470, 469, 467, 454, 454, 460, 96, 463, + 455, 449, 448, 110, 468, 458, 0, 453, 446, 451, + 450, 445, 454, 437, 438, 451, 435, 450, 432, 428, + + 431, 432, 435, 443, 426, 0, 425, 438, 437, 422, + 417, 419, 429, 421, 422, 426, 414, 430, 425, 412, + 426, 407, 408, 409, 421, 411, 0, 404, 411, 418, + 416, 412, 410, 417, 395, 401, 414, 408, 394, 403, + 399, 393, 389, 390, 388, 394, 396, 105, 385, 389, + 401, 390, 391, 398, 387, 379, 381, 378, 375, 378, + 372, 376, 389, 370, 365, 105, 383, 0, 381, 369, + 365, 0, 0, 364, 365, 362, 360, 377, 363, 358, + 105, 375, 374, 353, 357, 357, 351, 0, 368, 354, + 349, 348, 354, 348, 345, 358, 348, 356, 358, 354, + + 349, 346, 351, 0, 337, 346, 352, 0, 0, 336, + 122, 336, 347, 107, 0, 347, 333, 0, 330, 328, + 338, 327, 338, 330, 329, 322, 319, 315, 332, 0, + 332, 333, 0, 0, 329, 324, 331, 316, 316, 0, + 116, 307, 309, 320, 324, 320, 0, 323, 320, 110, + 320, 320, 0, 308, 318, 0, 318, 310, 0, 296, + 0, 300, 309, 296, 293, 306, 306, 0, 135, 139, + 295, 289, 292, 302, 290, 292, 0, 295, 297, 297, + 278, 294, 297, 0, 295, 280, 278, 0, 279, 0, + 272, 285, 269, 287, 272, 283, 0, 282, 281, 273, + + 267, 279, 263, 259, 261, 259, 0, 276, 258, 0, + 257, 256, 260, 250, 271, 270, 267, 260, 272, 145, + 271, 151, 0, 261, 243, 0, 242, 0, 261, 240, + 260, 241, 0, 252, 239, 252, 238, 233, 249, 248, + 0, 251, 249, 249, 236, 229, 242, 227, 0, 224, + 0, 225, 224, 241, 226, 239, 220, 229, 0, 218, + 217, 224, 219, 237, 215, 0, 0, 211, 0, 228, + 0, 211, 205, 0, 218, 0, 0, 0, 214, 208, + 213, 0, 222, 0, 0, 217, 206, 201, 202, 201, + 215, 201, 201, 199, 208, 210, 209, 201, 190, 196, + + 194, 190, 190, 192, 198, 0, 200, 184, 186, 184, + 0, 0, 186, 183, 190, 178, 0, 179, 173, 174, + 172, 185, 188, 183, 173, 0, 185, 173, 166, 0, + 169, 177, 0, 166, 162, 157, 159, 158, 161, 0, + 157, 0, 0, 162, 167, 158, 0, 0, 0, 0, + 0, 143, 152, 143, 141, 0, 0, 130, 124, 124, + 0, 0, 107, 85, 80, 0, 0, 0, 518, 158, + 163, 65, 168, 173, 178 } ; static yyconst short int yy_def[476] = @@ -493,7 +494,7 @@ static yyconst short int yy_def[476] = 469, 469, 469, 469, 469 } ; -static yyconst short int yy_nxt[552] = +static yyconst short int yy_nxt[554] = { 0, 4, 5, 6, 5, 7, 8, 4, 9, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 19, @@ -503,62 +504,62 @@ static yyconst short int yy_nxt[552] = 53, 39, 83, 40, 44, 95, 67, 64, 54, 96, 59, 45, 60, 65, 103, 46, 68, 66, 47, 34, 61, 62, 48, 49, 70, 73, 71, 74, 76, 72, - 77, 104, 30, 78, 30, 84, 90, 108, 85, 91, - 98, 99, 111, 75, 79, 113, 123, 109, 126, 129, - - 124, 131, 132, 114, 139, 468, 112, 84, 127, 130, - 85, 205, 225, 467, 206, 241, 269, 269, 242, 270, - 140, 226, 243, 295, 227, 228, 141, 229, 207, 273, - 304, 466, 274, 269, 269, 305, 319, 465, 321, 296, - 321, 322, 36, 321, 321, 464, 321, 322, 36, 321, - 321, 463, 321, 322, 36, 321, 31, 31, 462, 31, - 31, 33, 33, 461, 33, 33, 36, 460, 459, 36, - 36, 320, 320, 458, 320, 320, 321, 321, 457, 456, - 321, 455, 454, 453, 452, 451, 450, 449, 448, 447, - 446, 445, 444, 443, 442, 441, 440, 439, 438, 437, - - 436, 435, 434, 433, 432, 431, 430, 429, 428, 427, - 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, - 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, - 406, 405, 404, 403, 402, 401, 400, 399, 398, 364, - 397, 396, 395, 394, 393, 392, 391, 390, 389, 388, - 387, 386, 385, 384, 383, 382, 381, 380, 379, 378, - 377, 376, 375, 374, 373, 372, 371, 370, 369, 368, - 367, 366, 365, 364, 364, 363, 362, 361, 360, 359, - 358, 357, 356, 355, 354, 353, 352, 351, 350, 349, - 348, 347, 346, 345, 344, 343, 342, 341, 340, 339, - - 338, 337, 336, 335, 334, 333, 332, 331, 330, 329, - 328, 327, 326, 325, 324, 323, 318, 317, 316, 315, - 314, 313, 312, 311, 310, 309, 308, 307, 306, 303, - 302, 301, 300, 299, 298, 297, 294, 293, 292, 291, - 290, 289, 288, 287, 286, 285, 284, 283, 282, 281, - 280, 279, 278, 277, 276, 275, 272, 271, 268, 267, - 266, 265, 264, 263, 262, 261, 260, 259, 258, 257, - 256, 255, 254, 253, 252, 251, 250, 249, 248, 247, - 246, 245, 244, 240, 239, 238, 237, 236, 235, 234, - 233, 232, 231, 230, 224, 223, 222, 221, 220, 219, - - 218, 217, 216, 215, 214, 213, 212, 211, 210, 209, - 208, 204, 203, 202, 201, 200, 199, 198, 197, 196, - 195, 194, 193, 192, 191, 190, 189, 188, 187, 186, - 185, 184, 183, 182, 181, 180, 179, 178, 177, 176, - 175, 174, 173, 172, 171, 170, 169, 168, 167, 166, - 165, 164, 163, 162, 161, 160, 159, 158, 157, 156, - 155, 154, 153, 152, 151, 150, 149, 148, 147, 146, - 32, 145, 144, 143, 142, 138, 137, 136, 135, 134, - 133, 128, 125, 122, 121, 120, 119, 118, 117, 116, - 115, 110, 107, 106, 105, 102, 101, 100, 97, 94, - - 93, 92, 89, 88, 87, 86, 35, 32, 80, 69, - 58, 57, 35, 32, 469, 3, 469, 469, 469, 469, + 77, 104, 30, 78, 30, 84, 84, 90, 85, 108, + 91, 98, 99, 75, 79, 111, 113, 123, 126, 109, + + 129, 124, 131, 132, 114, 139, 468, 467, 127, 112, + 130, 84, 84, 205, 85, 241, 206, 273, 242, 225, + 274, 140, 243, 269, 269, 295, 270, 141, 226, 466, + 207, 227, 228, 304, 229, 465, 269, 269, 305, 319, + 321, 296, 321, 322, 36, 321, 321, 464, 321, 322, + 36, 321, 321, 463, 321, 322, 36, 321, 31, 31, + 462, 31, 31, 33, 33, 461, 33, 33, 36, 460, + 459, 36, 36, 320, 320, 458, 320, 320, 321, 321, + 457, 456, 321, 455, 454, 453, 452, 451, 450, 449, + 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, + + 438, 437, 436, 435, 434, 433, 432, 431, 430, 429, + 428, 427, 426, 425, 424, 423, 422, 421, 420, 419, + 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, + 408, 407, 406, 405, 404, 403, 402, 401, 400, 399, + 398, 364, 397, 396, 395, 394, 393, 392, 391, 390, + 389, 388, 387, 386, 385, 384, 383, 382, 381, 380, + 379, 378, 377, 376, 375, 374, 373, 372, 371, 370, + 369, 368, 367, 366, 365, 364, 364, 363, 362, 361, + 360, 359, 358, 357, 356, 355, 354, 353, 352, 351, + 350, 349, 348, 347, 346, 345, 344, 343, 342, 341, + + 340, 339, 338, 337, 336, 335, 334, 333, 332, 331, + 330, 329, 328, 327, 326, 325, 324, 323, 318, 317, + 316, 315, 314, 313, 312, 311, 310, 309, 308, 307, + 306, 303, 302, 301, 300, 299, 298, 297, 294, 293, + 292, 291, 290, 289, 288, 287, 286, 285, 284, 283, + 282, 281, 280, 279, 278, 277, 276, 275, 272, 271, + 268, 267, 266, 265, 264, 263, 262, 261, 260, 259, + 258, 257, 256, 255, 254, 253, 252, 251, 250, 249, + 248, 247, 246, 245, 244, 240, 239, 238, 237, 236, + 235, 234, 233, 232, 231, 230, 224, 223, 222, 221, + + 220, 219, 218, 217, 216, 215, 214, 213, 212, 211, + 210, 209, 208, 204, 203, 202, 201, 200, 199, 198, + 197, 196, 195, 194, 193, 192, 191, 190, 189, 188, + 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, + 177, 176, 175, 174, 173, 172, 171, 170, 169, 168, + 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, + 157, 156, 155, 154, 153, 152, 151, 150, 149, 148, + 147, 146, 32, 145, 144, 143, 142, 138, 137, 136, + 135, 134, 133, 128, 125, 122, 121, 120, 119, 118, + 117, 116, 115, 110, 107, 106, 105, 102, 101, 100, + + 97, 94, 93, 92, 89, 88, 87, 86, 35, 32, + 80, 69, 58, 57, 35, 32, 469, 3, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, - 469 + 469, 469, 469 } ; -static yyconst short int yy_chk[552] = +static yyconst short int yy_chk[554] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -568,59 +569,59 @@ static yyconst short int yy_chk[552] = 14, 10, 27, 10, 12, 45, 21, 20, 14, 45, 18, 12, 18, 20, 51, 12, 21, 20, 12, 472, 18, 18, 12, 12, 23, 24, 23, 24, 25, 23, - 25, 51, 30, 25, 30, 32, 41, 55, 32, 41, - 47, 47, 57, 24, 25, 58, 67, 55, 69, 71, - - 67, 72, 72, 58, 79, 465, 57, 84, 69, 71, - 84, 148, 166, 464, 148, 181, 211, 211, 181, 211, - 79, 166, 181, 241, 166, 166, 79, 166, 148, 214, - 250, 463, 214, 269, 269, 250, 269, 460, 270, 241, - 270, 270, 270, 270, 320, 459, 320, 320, 320, 320, - 322, 458, 322, 322, 322, 322, 470, 470, 455, 470, - 470, 471, 471, 454, 471, 471, 473, 453, 452, 473, - 473, 474, 474, 446, 474, 474, 475, 475, 445, 444, - 475, 441, 439, 438, 437, 436, 435, 434, 432, 431, - 429, 428, 427, 425, 424, 423, 422, 421, 420, 419, - - 418, 416, 415, 414, 413, 410, 409, 408, 407, 405, - 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, - 394, 393, 392, 391, 390, 389, 388, 387, 386, 383, - 381, 380, 379, 375, 373, 372, 370, 368, 365, 364, - 363, 362, 361, 360, 358, 357, 356, 355, 354, 353, - 352, 350, 348, 347, 346, 345, 344, 343, 342, 340, - 339, 338, 337, 336, 335, 334, 332, 331, 330, 329, - 327, 325, 324, 321, 319, 318, 317, 316, 315, 314, - 313, 312, 311, 309, 308, 306, 305, 304, 303, 302, - 301, 300, 299, 298, 296, 295, 294, 293, 292, 291, - - 289, 287, 286, 285, 283, 282, 281, 280, 279, 278, - 276, 275, 274, 273, 272, 271, 267, 266, 265, 264, - 263, 262, 260, 258, 257, 255, 254, 252, 251, 249, - 248, 246, 245, 244, 243, 242, 239, 238, 237, 236, - 235, 232, 231, 229, 228, 227, 226, 225, 224, 223, - 222, 221, 220, 219, 217, 216, 213, 212, 210, 207, - 206, 205, 203, 202, 201, 200, 199, 198, 197, 196, - 195, 194, 193, 192, 191, 190, 189, 187, 186, 185, - 184, 183, 182, 180, 179, 178, 177, 176, 175, 174, - 171, 170, 169, 167, 165, 164, 163, 162, 161, 160, - - 159, 158, 157, 156, 155, 154, 153, 152, 151, 150, - 149, 147, 146, 145, 144, 143, 142, 141, 140, 139, - 138, 137, 136, 135, 134, 133, 132, 131, 130, 129, - 128, 126, 125, 124, 123, 122, 121, 120, 119, 118, - 117, 116, 115, 114, 113, 112, 111, 110, 109, 108, - 107, 105, 104, 103, 102, 101, 100, 99, 98, 97, - 96, 95, 94, 93, 92, 91, 90, 89, 88, 86, - 85, 83, 82, 81, 80, 78, 77, 76, 75, 74, - 73, 70, 68, 66, 65, 64, 63, 62, 61, 60, - 59, 56, 54, 53, 52, 50, 49, 48, 46, 44, - - 43, 42, 40, 39, 38, 37, 34, 31, 26, 22, - 17, 16, 9, 7, 3, 469, 469, 469, 469, 469, + 25, 51, 30, 25, 30, 32, 32, 41, 32, 55, + 41, 47, 47, 24, 25, 57, 58, 67, 69, 55, + + 71, 67, 72, 72, 58, 79, 465, 464, 69, 57, + 71, 84, 84, 148, 84, 181, 148, 214, 181, 166, + 214, 79, 181, 211, 211, 241, 211, 79, 166, 463, + 148, 166, 166, 250, 166, 460, 269, 269, 250, 269, + 270, 241, 270, 270, 270, 270, 320, 459, 320, 320, + 320, 320, 322, 458, 322, 322, 322, 322, 470, 470, + 455, 470, 470, 471, 471, 454, 471, 471, 473, 453, + 452, 473, 473, 474, 474, 446, 474, 474, 475, 475, + 445, 444, 475, 441, 439, 438, 437, 436, 435, 434, + 432, 431, 429, 428, 427, 425, 424, 423, 422, 421, + + 420, 419, 418, 416, 415, 414, 413, 410, 409, 408, + 407, 405, 404, 403, 402, 401, 400, 399, 398, 397, + 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, + 386, 383, 381, 380, 379, 375, 373, 372, 370, 368, + 365, 364, 363, 362, 361, 360, 358, 357, 356, 355, + 354, 353, 352, 350, 348, 347, 346, 345, 344, 343, + 342, 340, 339, 338, 337, 336, 335, 334, 332, 331, + 330, 329, 327, 325, 324, 321, 319, 318, 317, 316, + 315, 314, 313, 312, 311, 309, 308, 306, 305, 304, + 303, 302, 301, 300, 299, 298, 296, 295, 294, 293, + + 292, 291, 289, 287, 286, 285, 283, 282, 281, 280, + 279, 278, 276, 275, 274, 273, 272, 271, 267, 266, + 265, 264, 263, 262, 260, 258, 257, 255, 254, 252, + 251, 249, 248, 246, 245, 244, 243, 242, 239, 238, + 237, 236, 235, 232, 231, 229, 228, 227, 226, 225, + 224, 223, 222, 221, 220, 219, 217, 216, 213, 212, + 210, 207, 206, 205, 203, 202, 201, 200, 199, 198, + 197, 196, 195, 194, 193, 192, 191, 190, 189, 187, + 186, 185, 184, 183, 182, 180, 179, 178, 177, 176, + 175, 174, 171, 170, 169, 167, 165, 164, 163, 162, + + 161, 160, 159, 158, 157, 156, 155, 154, 153, 152, + 151, 150, 149, 147, 146, 145, 144, 143, 142, 141, + 140, 139, 138, 137, 136, 135, 134, 133, 132, 131, + 130, 129, 128, 126, 125, 124, 123, 122, 121, 120, + 119, 118, 117, 116, 115, 114, 113, 112, 111, 110, + 109, 108, 107, 105, 104, 103, 102, 101, 100, 99, + 98, 97, 96, 95, 94, 93, 92, 91, 90, 89, + 88, 86, 85, 83, 82, 81, 80, 78, 77, 76, + 75, 74, 73, 70, 68, 66, 65, 64, 63, 62, + 61, 60, 59, 56, 54, 53, 52, 50, 49, 48, + + 46, 44, 43, 42, 40, 39, 38, 37, 34, 31, + 26, 22, 17, 16, 9, 7, 3, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, 469, - 469 + 469, 469, 469 } ; static yy_state_type yy_last_accepting_state; @@ -637,7 +638,7 @@ char *yytext; #line 1 "rclex.l" #define INITIAL 0 #line 2 "rclex.l" -/* Copyright 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. +/* Copyright 1997, 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GNU Binutils. @@ -704,11 +705,11 @@ static struct alloc_string *strings; /* Local functions. */ -static void cpp_line PARAMS ((const char *)); -static char *handle_quotes PARAMS ((const char *, unsigned long *)); -static char *get_string PARAMS ((int)); +static void cpp_line (const char *); +static char *handle_quotes (const char *, unsigned long *); +static char *get_string (int); -#line 712 "lex.yy.c" +#line 713 "lex.yy.c" /* Macros after this point can all be overridden by user definitions in * section 1. @@ -873,7 +874,7 @@ YY_DECL #line 75 "rclex.l" -#line 877 "lex.yy.c" +#line 878 "lex.yy.c" if ( yy_init ) { @@ -930,7 +931,7 @@ yy_match: yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 516 ); + while ( yy_base[yy_current_state] != 518 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1452,7 +1453,7 @@ YY_RULE_SETUP #line 236 "rclex.l" ECHO; YY_BREAK -#line 1456 "lex.yy.c" +#line 1457 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2346,7 +2347,7 @@ int main() #ifndef yywrap /* This is needed for some versions of lex. */ -int yywrap () +int yywrap (void) { return 1; } @@ -2355,8 +2356,7 @@ int yywrap () /* Handle a C preprocessor line. */ static void -cpp_line (s) - const char *s; +cpp_line (const char *s) { int line; char *send, *fn; @@ -2411,9 +2411,7 @@ cpp_line (s) merged separated by whitespace are merged, as in C. */ static char * -handle_quotes (input, len) - const char *input; - unsigned long *len; +handle_quotes (const char *input, unsigned long *len) { char *ret, *s; const char *t; @@ -2535,7 +2533,11 @@ handle_quotes (input, len) ++t; assert (ISSPACE (*t)); while (ISSPACE (*t)) - ++t; + { + if ((*t) == '\n') + ++rc_lineno; + ++t; + } if (*t == '\0') break; assert (*t == '"'); @@ -2553,8 +2555,7 @@ handle_quotes (input, len) /* Allocate a string of a given length. */ static char * -get_string (len) - int len; +get_string (int len) { struct alloc_string *as; @@ -2571,7 +2572,7 @@ get_string (len) when it no longer needs them. */ void -rcparse_discard_strings () +rcparse_discard_strings (void) { struct alloc_string *as; @@ -2592,7 +2593,7 @@ rcparse_discard_strings () /* Enter rcdata mode. */ void -rcparse_rcdata () +rcparse_rcdata (void) { rcdata_mode = 1; } @@ -2600,7 +2601,7 @@ rcparse_rcdata () /* Go back to normal mode from rcdata mode. */ void -rcparse_normal () +rcparse_normal (void) { rcdata_mode = 0; } diff --git a/contrib/binutils/binutils/rclex.l b/contrib/binutils/binutils/rclex.l index 600e38e..2735cc1 100644 --- a/contrib/binutils/binutils/rclex.l +++ b/contrib/binutils/binutils/rclex.l @@ -1,5 +1,5 @@ %{ /* rclex.l -- lexer for Windows rc files parser */ -/* Copyright 1997, 1998, 1999, 2001, 2002 Free Software Foundation, Inc. +/* Copyright 1997, 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GNU Binutils. @@ -66,9 +66,9 @@ static struct alloc_string *strings; /* Local functions. */ -static void cpp_line PARAMS ((const char *)); -static char *handle_quotes PARAMS ((const char *, unsigned long *)); -static char *get_string PARAMS ((int)); +static void cpp_line (const char *); +static char *handle_quotes (const char *, unsigned long *); +static char *get_string (int); %} @@ -196,7 +196,7 @@ static char *get_string PARAMS ((int)); MAYBE_RETURN (NUMBER); } -("\""[^\"\n]*"\""[ \t]*)+ { +("\""[^\"\n]*"\""[ \t\n]*)+ { char *s; unsigned long length; @@ -236,7 +236,7 @@ static char *get_string PARAMS ((int)); %% #ifndef yywrap /* This is needed for some versions of lex. */ -int yywrap () +int yywrap (void) { return 1; } @@ -245,8 +245,7 @@ int yywrap () /* Handle a C preprocessor line. */ static void -cpp_line (s) - const char *s; +cpp_line (const char *s) { int line; char *send, *fn; @@ -301,9 +300,7 @@ cpp_line (s) merged separated by whitespace are merged, as in C. */ static char * -handle_quotes (input, len) - const char *input; - unsigned long *len; +handle_quotes (const char *input, unsigned long *len) { char *ret, *s; const char *t; @@ -425,7 +422,11 @@ handle_quotes (input, len) ++t; assert (ISSPACE (*t)); while (ISSPACE (*t)) - ++t; + { + if ((*t) == '\n') + ++rc_lineno; + ++t; + } if (*t == '\0') break; assert (*t == '"'); @@ -443,8 +444,7 @@ handle_quotes (input, len) /* Allocate a string of a given length. */ static char * -get_string (len) - int len; +get_string (int len) { struct alloc_string *as; @@ -461,7 +461,7 @@ get_string (len) when it no longer needs them. */ void -rcparse_discard_strings () +rcparse_discard_strings (void) { struct alloc_string *as; @@ -482,7 +482,7 @@ rcparse_discard_strings () /* Enter rcdata mode. */ void -rcparse_rcdata () +rcparse_rcdata (void) { rcdata_mode = 1; } @@ -490,7 +490,7 @@ rcparse_rcdata () /* Go back to normal mode from rcdata mode. */ void -rcparse_normal () +rcparse_normal (void) { rcdata_mode = 0; } diff --git a/contrib/binutils/binutils/rdcoff.c b/contrib/binutils/binutils/rdcoff.c index 2091964..84788e0 100644 --- a/contrib/binutils/binutils/rdcoff.c +++ b/contrib/binutils/binutils/rdcoff.c @@ -1,5 +1,5 @@ /* stabs.c -- Parse COFF debugging information - Copyright 1996, 2000 Free Software Foundation, Inc. + Copyright 1996, 2000, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GNU Binutils. @@ -82,30 +82,28 @@ struct coff_types debug_type basic[T_MAX + 1]; }; -static debug_type *coff_get_slot PARAMS ((struct coff_types *, int)); +static debug_type *coff_get_slot (struct coff_types *, int); static debug_type parse_coff_type - PARAMS ((bfd *, struct coff_symbols *, struct coff_types *, long, int, - union internal_auxent *, boolean, PTR)); + (bfd *, struct coff_symbols *, struct coff_types *, long, int, + union internal_auxent *, bfd_boolean, void *); static debug_type parse_coff_base_type - PARAMS ((bfd *, struct coff_symbols *, struct coff_types *, long, int, - union internal_auxent *, PTR)); + (bfd *, struct coff_symbols *, struct coff_types *, long, int, + union internal_auxent *, void *); static debug_type parse_coff_struct_type - PARAMS ((bfd *, struct coff_symbols *, struct coff_types *, int, - union internal_auxent *, PTR)); + (bfd *, struct coff_symbols *, struct coff_types *, int, + union internal_auxent *, void *); static debug_type parse_coff_enum_type - PARAMS ((bfd *, struct coff_symbols *, struct coff_types *, - union internal_auxent *, PTR)); -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)); + (bfd *, struct coff_symbols *, struct coff_types *, + union internal_auxent *, void *); +static bfd_boolean parse_coff_symbol + (bfd *, struct coff_types *, asymbol *, long, struct internal_syment *, + void *, debug_type, bfd_boolean); +static bfd_boolean external_coff_symbol_p (int sym_class); /* Return the slot for a type. */ static debug_type * -coff_get_slot (types, indx) - struct coff_types *types; - int indx; +coff_get_slot (struct coff_types *types, int indx) { struct coff_slots **pps; @@ -134,16 +132,10 @@ coff_get_slot (types, indx) /* Parse a COFF type code in NTYPE. */ static debug_type -parse_coff_type (abfd, symbols, types, coff_symno, ntype, pauxent, useaux, - dhandle) - bfd *abfd; - struct coff_symbols *symbols; - struct coff_types *types; - long coff_symno; - int ntype; - union internal_auxent *pauxent; - boolean useaux; - PTR dhandle; +parse_coff_type (bfd *abfd, struct coff_symbols *symbols, + struct coff_types *types, long coff_symno, int ntype, + union internal_auxent *pauxent, bfd_boolean useaux, + void *dhandle) { debug_type type; @@ -164,7 +156,7 @@ parse_coff_type (abfd, symbols, types, coff_symno, ntype, pauxent, useaux, type = parse_coff_type (abfd, symbols, types, coff_symno, newtype, pauxent, useaux, dhandle); type = debug_make_function_type (dhandle, type, (debug_type *) NULL, - false); + FALSE); } else if (ISARY (ntype)) { @@ -190,14 +182,14 @@ parse_coff_type (abfd, symbols, types, coff_symno, ntype, pauxent, useaux, } type = parse_coff_type (abfd, symbols, types, coff_symno, newtype, - pauxent, false, dhandle); + pauxent, FALSE, dhandle); type = debug_make_array_type (dhandle, type, parse_coff_base_type (abfd, symbols, types, coff_symno, T_INT, NULL, dhandle), - 0, n - 1, false); + 0, n - 1, FALSE); } else { @@ -237,18 +229,12 @@ parse_coff_type (abfd, symbols, types, coff_symno, ntype, pauxent, useaux, /* Parse a basic COFF type in NTYPE. */ static debug_type -parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent, - dhandle) - bfd *abfd; - struct coff_symbols *symbols; - struct coff_types *types; - long coff_symno; - int ntype; - union internal_auxent *pauxent; - PTR dhandle; +parse_coff_base_type (bfd *abfd, struct coff_symbols *symbols, + struct coff_types *types, long coff_symno, int ntype, + union internal_auxent *pauxent, void *dhandle) { debug_type ret; - boolean set_basic; + bfd_boolean set_basic; const char *name; debug_type *slot; @@ -257,7 +243,7 @@ parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent, && types->basic[ntype] != DEBUG_TYPE_NULL) return types->basic[ntype]; - set_basic = true; + set_basic = TRUE; name = NULL; switch (ntype) @@ -273,23 +259,23 @@ parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent, break; case T_CHAR: - ret = debug_make_int_type (dhandle, 1, false); + ret = debug_make_int_type (dhandle, 1, FALSE); name = "char"; break; case T_SHORT: - ret = debug_make_int_type (dhandle, 2, false); + ret = debug_make_int_type (dhandle, 2, FALSE); name = "short"; break; case T_INT: /* FIXME: Perhaps the size should depend upon the architecture. */ - ret = debug_make_int_type (dhandle, 4, false); + ret = debug_make_int_type (dhandle, 4, FALSE); name = "int"; break; case T_LONG: - ret = debug_make_int_type (dhandle, 4, false); + ret = debug_make_int_type (dhandle, 4, FALSE); name = "long"; break; @@ -309,28 +295,28 @@ parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent, break; case T_UCHAR: - ret = debug_make_int_type (dhandle, 1, true); + ret = debug_make_int_type (dhandle, 1, TRUE); name = "unsigned char"; break; case T_USHORT: - ret = debug_make_int_type (dhandle, 2, true); + ret = debug_make_int_type (dhandle, 2, TRUE); name = "unsigned short"; break; case T_UINT: - ret = debug_make_int_type (dhandle, 4, true); + ret = debug_make_int_type (dhandle, 4, TRUE); name = "unsigned int"; break; case T_ULONG: - ret = debug_make_int_type (dhandle, 4, true); + ret = debug_make_int_type (dhandle, 4, TRUE); name = "unsigned long"; break; case T_STRUCT: if (pauxent == NULL) - ret = debug_make_struct_type (dhandle, true, 0, + ret = debug_make_struct_type (dhandle, TRUE, 0, (debug_field *) NULL); else ret = parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, @@ -339,12 +325,12 @@ parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent, slot = coff_get_slot (types, coff_symno); *slot = ret; - set_basic = false; + set_basic = FALSE; break; case T_UNION: if (pauxent == NULL) - ret = debug_make_struct_type (dhandle, false, 0, (debug_field *) NULL); + ret = debug_make_struct_type (dhandle, FALSE, 0, (debug_field *) NULL); else ret = parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle); @@ -352,7 +338,7 @@ parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent, slot = coff_get_slot (types, coff_symno); *slot = ret; - set_basic = false; + set_basic = FALSE; break; case T_ENUM: @@ -365,7 +351,7 @@ parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent, slot = coff_get_slot (types, coff_symno); *slot = ret; - set_basic = false; + set_basic = FALSE; break; } @@ -383,19 +369,15 @@ parse_coff_base_type (abfd, symbols, types, coff_symno, ntype, pauxent, /* Parse a struct type. */ static debug_type -parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle) - bfd *abfd; - struct coff_symbols *symbols; - struct coff_types *types; - int ntype; - union internal_auxent *pauxent; - PTR dhandle; +parse_coff_struct_type (bfd *abfd, struct coff_symbols *symbols, + struct coff_types *types, int ntype, + union internal_auxent *pauxent, void *dhandle) { long symend; int alloc; debug_field *fields; int count; - boolean done; + bfd_boolean done; symend = pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l; @@ -403,7 +385,7 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle) fields = (debug_field *) xmalloc (alloc * sizeof *fields); count = 0; - done = false; + done = FALSE; while (! done && symbols->coff_symno < symend && symbols->symno < symbols->symcount) @@ -456,7 +438,7 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle) break; case C_EOS: - done = true; + done = TRUE; break; } @@ -466,7 +448,7 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle) debug_field f; ftype = parse_coff_type (abfd, symbols, types, this_coff_symno, - syment.n_type, psubaux, true, dhandle); + syment.n_type, psubaux, TRUE, dhandle); f = debug_make_field (dhandle, bfd_asymbol_name (sym), ftype, bitpos, bitsize, DEBUG_VISIBILITY_PUBLIC); if (f == DEBUG_FIELD_NULL) @@ -494,19 +476,16 @@ parse_coff_struct_type (abfd, symbols, types, ntype, pauxent, dhandle) /* Parse an enum type. */ static debug_type -parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle) - bfd *abfd; - struct coff_symbols *symbols; - struct coff_types *types ATTRIBUTE_UNUSED; - union internal_auxent *pauxent; - PTR dhandle; +parse_coff_enum_type (bfd *abfd, struct coff_symbols *symbols, + struct coff_types *types ATTRIBUTE_UNUSED, + union internal_auxent *pauxent, void *dhandle) { long symend; int alloc; const char **names; bfd_signed_vma *vals; int count; - boolean done; + bfd_boolean done; symend = pauxent->x_sym.x_fcnary.x_fcn.x_endndx.l; @@ -515,7 +494,7 @@ parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle) vals = (bfd_signed_vma *) xmalloc (alloc * sizeof *vals); count = 0; - done = false; + done = FALSE; while (! done && symbols->coff_symno < symend && symbols->symno < symbols->symcount) @@ -553,7 +532,7 @@ parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle) break; case C_EOS: - done = true; + done = TRUE; break; } } @@ -565,17 +544,11 @@ parse_coff_enum_type (abfd, symbols, types, pauxent, dhandle) /* Handle a single COFF symbol. */ -static boolean -parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type, - within_function) - bfd *abfd ATTRIBUTE_UNUSED; - struct coff_types *types; - asymbol *sym; - long coff_symno; - struct internal_syment *psyment; - PTR dhandle; - debug_type type; - boolean within_function; +static bfd_boolean +parse_coff_symbol (bfd *abfd ATTRIBUTE_UNUSED, struct coff_types *types, + asymbol *sym, long coff_symno, + struct internal_syment *psyment, void *dhandle, + debug_type type, bfd_boolean within_function) { switch (psyment->n_sclass) { @@ -585,14 +558,14 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type, case C_AUTO: if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type, DEBUG_LOCAL, bfd_asymbol_value (sym))) - return false; + 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))) - return false; + return FALSE; break; case C_STAT: @@ -601,14 +574,14 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type, ? DEBUG_LOCAL_STATIC : DEBUG_STATIC), bfd_asymbol_value (sym))) - return false; + return FALSE; break; case C_REG: /* FIXME: We may need to convert the register number. */ if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type, DEBUG_REGISTER, bfd_asymbol_value (sym))) - return false; + return FALSE; break; case C_LABEL: @@ -617,20 +590,20 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type, case C_ARG: if (! debug_record_parameter (dhandle, bfd_asymbol_name (sym), type, DEBUG_PARM_STACK, bfd_asymbol_value (sym))) - return false; + return FALSE; break; case C_REGPARM: /* FIXME: We may need to convert the register number. */ if (! debug_record_parameter (dhandle, bfd_asymbol_name (sym), type, DEBUG_PARM_REG, bfd_asymbol_value (sym))) - return false; + return FALSE; break; case C_TPDEF: type = debug_name_type (dhandle, bfd_asymbol_name (sym), type); if (type == DEBUG_TYPE_NULL) - return false; + return FALSE; break; case C_STRTAG: @@ -641,7 +614,7 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type, type = debug_tag_type (dhandle, bfd_asymbol_name (sym), type); if (type == DEBUG_TYPE_NULL) - return false; + return FALSE; /* Store the named type into the slot, so that references get the name. */ @@ -654,35 +627,30 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type, break; } - return true; + return TRUE; } /* Determine if a symbol has external visibility. */ -static boolean -external_coff_symbol_p (sym_class) - int sym_class; +static bfd_boolean +external_coff_symbol_p (int sym_class) { switch (sym_class) { case C_EXT: case C_WEAKEXT: - return true; + return TRUE; default: break; } - return false; + return FALSE; } /* This is the main routine. It looks through all the symbols and handles them. */ -boolean -parse_coff (abfd, syms, symcount, dhandle) - bfd *abfd; - asymbol **syms; - long symcount; - PTR dhandle; +bfd_boolean +parse_coff (bfd *abfd, asymbol **syms, long symcount, void *dhandle) { struct coff_symbols symbols; struct coff_types types; @@ -693,7 +661,7 @@ parse_coff (abfd, syms, symcount, dhandle) int fntype; bfd_vma fnend; alent *linenos; - boolean within_function; + bfd_boolean within_function; long this_coff_symno; symbols.syms = syms; @@ -711,7 +679,7 @@ parse_coff (abfd, syms, symcount, dhandle) fntype = 0; fnend = 0; linenos = NULL; - within_function = false; + within_function = FALSE; while (symbols.symno < symcount) { @@ -728,7 +696,7 @@ parse_coff (abfd, syms, symcount, dhandle) { non_fatal (_("bfd_coff_get_syment failed: %s"), bfd_errmsg (bfd_get_error ())); - return false; + return FALSE; } name = bfd_asymbol_name (sym); @@ -748,7 +716,7 @@ parse_coff (abfd, syms, symcount, dhandle) { non_fatal (_("bfd_coff_get_auxent failed: %s"), bfd_errmsg (bfd_get_error ())); - return false; + return FALSE; } paux = &auxent; } @@ -758,7 +726,7 @@ parse_coff (abfd, syms, symcount, dhandle) /* The last C_FILE symbol points to the first external symbol. */ if (! debug_set_filename (dhandle, "*globals*")) - return false; + return FALSE; } switch (syment.n_sclass) @@ -776,7 +744,7 @@ parse_coff (abfd, syms, symcount, dhandle) case C_FILE: next_c_file = syment.n_value; if (! debug_set_filename (dhandle, name)) - return false; + return FALSE; break; case C_STAT: @@ -800,12 +768,12 @@ parse_coff (abfd, syms, symcount, dhandle) break; } type = parse_coff_type (abfd, &symbols, &types, this_coff_symno, - syment.n_type, paux, true, dhandle); + syment.n_type, paux, TRUE, dhandle); if (type == DEBUG_TYPE_NULL) - return false; + return FALSE; if (! parse_coff_symbol (abfd, &types, sym, this_coff_symno, &syment, dhandle, type, within_function)) - return false; + return FALSE; break; case C_FCN: @@ -815,18 +783,18 @@ parse_coff (abfd, syms, symcount, dhandle) { non_fatal (_("%ld: .bf without preceding function"), this_coff_symno); - return false; + return FALSE; } type = parse_coff_type (abfd, &symbols, &types, this_coff_symno, - DECREF (fntype), paux, false, dhandle); + DECREF (fntype), paux, FALSE, dhandle); if (type == DEBUG_TYPE_NULL) - return false; + return FALSE; if (! debug_record_function (dhandle, fnname, type, external_coff_symbol_p (fnclass), bfd_asymbol_value (sym))) - return false; + return FALSE; if (linenos != NULL) { @@ -847,7 +815,7 @@ parse_coff (abfd, syms, symcount, dhandle) if (! debug_record_line (dhandle, linenos->line_number + base, linenos->u.offset + addr)) - return false; + return FALSE; ++linenos; } } @@ -857,23 +825,23 @@ parse_coff (abfd, syms, symcount, dhandle) fnclass = 0; fntype = 0; - within_function = true; + within_function = TRUE; } else if (strcmp (name, ".ef") == 0) { if (! within_function) { non_fatal (_("%ld: unexpected .ef\n"), this_coff_symno); - return false; + return FALSE; } if (bfd_asymbol_value (sym) > fnend) fnend = bfd_asymbol_value (sym); if (! debug_end_function (dhandle, fnend)) - return false; + return FALSE; fnend = 0; - within_function = false; + within_function = FALSE; } break; @@ -881,26 +849,26 @@ parse_coff (abfd, syms, symcount, dhandle) if (strcmp (name, ".bb") == 0) { if (! debug_start_block (dhandle, bfd_asymbol_value (sym))) - return false; + return FALSE; } else if (strcmp (name, ".eb") == 0) { if (! debug_end_block (dhandle, bfd_asymbol_value (sym))) - return false; + return FALSE; } break; default: type = parse_coff_type (abfd, &symbols, &types, this_coff_symno, - syment.n_type, paux, true, dhandle); + syment.n_type, paux, TRUE, dhandle); if (type == DEBUG_TYPE_NULL) - return false; + return FALSE; if (! parse_coff_symbol (abfd, &types, sym, this_coff_symno, &syment, dhandle, type, within_function)) - return false; + return FALSE; break; } } - return true; + return TRUE; } diff --git a/contrib/binutils/binutils/rddbg.c b/contrib/binutils/binutils/rddbg.c index 3430c02..75ddab5 100644 --- a/contrib/binutils/binutils/rddbg.c +++ b/contrib/binutils/binutils/rddbg.c @@ -1,5 +1,6 @@ /* rddbg.c -- Read debugging information into a generic form. - Copyright 1995, 1996, 1997, 2000 Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 2000, 2002, 2003 + Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GNU Binutils. @@ -29,26 +30,23 @@ #include "debug.h" #include "budbg.h" -static boolean read_section_stabs_debugging_info - PARAMS ((bfd *, asymbol **, long, PTR, boolean *)); -static boolean read_symbol_stabs_debugging_info - PARAMS ((bfd *, asymbol **, long, PTR, boolean *)); -static boolean read_ieee_debugging_info PARAMS ((bfd *, PTR, boolean *)); -static void save_stab PARAMS ((int, int, bfd_vma, const char *)); -static void stab_context PARAMS ((void)); -static void free_saved_stabs PARAMS ((void)); +static bfd_boolean read_section_stabs_debugging_info + (bfd *, asymbol **, long, void *, bfd_boolean *); +static bfd_boolean read_symbol_stabs_debugging_info + (bfd *, asymbol **, long, void *, bfd_boolean *); +static bfd_boolean read_ieee_debugging_info (bfd *, void *, bfd_boolean *); +static void save_stab (int, int, bfd_vma, const char *); +static void stab_context (void); +static void free_saved_stabs (void); /* Read debugging information from a BFD. Returns a generic debugging pointer. */ -PTR -read_debugging_info (abfd, syms, symcount) - bfd *abfd; - asymbol **syms; - long symcount; +void * +read_debugging_info (bfd *abfd, asymbol **syms, long symcount) { - PTR dhandle; - boolean found; + void *dhandle; + bfd_boolean found; dhandle = debug_init (); if (dhandle == NULL) @@ -79,7 +77,7 @@ read_debugging_info (abfd, syms, symcount) { if (! parse_coff (abfd, syms, symcount, dhandle)) return NULL; - found = true; + found = TRUE; } if (! found) @@ -94,23 +92,20 @@ read_debugging_info (abfd, syms, symcount) /* Read stabs in sections debugging information from a BFD. */ -static boolean -read_section_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound) - bfd *abfd; - asymbol **syms; - long symcount; - PTR dhandle; - boolean *pfound; +static bfd_boolean +read_section_stabs_debugging_info (bfd *abfd, asymbol **syms, long symcount, + void *dhandle, bfd_boolean *pfound) { static struct { const char *secname; const char *strsecname; - } names[] = { { ".stab", ".stabstr" } }; + } names[] = { { ".stab", ".stabstr" }, + { "LC_SYMTAB.stabs", "LC_SYMTAB.stabstr" } }; unsigned int i; - PTR shandle; + void *shandle; - *pfound = false; + *pfound = FALSE; shandle = NULL; for (i = 0; i < sizeof names / sizeof names[0]; i++) @@ -133,7 +128,7 @@ read_section_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound) fprintf (stderr, "%s: %s: %s\n", bfd_get_filename (abfd), names[i].secname, bfd_errmsg (bfd_get_error ())); - return false; + return FALSE; } strsize = bfd_section_size (abfd, strsec); @@ -143,17 +138,17 @@ read_section_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound) fprintf (stderr, "%s: %s: %s\n", bfd_get_filename (abfd), names[i].strsecname, bfd_errmsg (bfd_get_error ())); - return false; + return FALSE; } if (shandle == NULL) { - shandle = start_stab (dhandle, abfd, true, syms, symcount); + shandle = start_stab (dhandle, abfd, TRUE, syms, symcount); if (shandle == NULL) - return false; + return FALSE; } - *pfound = true; + *pfound = TRUE; stroff = 0; next_stroff = 0; @@ -176,7 +171,7 @@ read_section_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound) if (type == 0) { /* Special type 0 stabs indicate the offset to the - next string table. */ + next string table. */ stroff = next_stroff; next_stroff += value; } @@ -188,9 +183,9 @@ read_section_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound) if (stroff + strx > strsize) { - fprintf (stderr, "%s: %s: stab entry %d is corrupt, strx = 0x%x, type = %d\n", + fprintf (stderr, "%s: %s: stab entry %ld is corrupt, strx = 0x%x, type = %d\n", bfd_get_filename (abfd), names[i].secname, - (stab - stabs) / 12, strx, type); + (long) (stab - stabs) / 12, strx, type); continue; } @@ -211,8 +206,8 @@ read_section_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound) (const char *) NULL); /* We have to restore the backslash, because, if - the linker is hashing stabs strings, we may - see the same string more than once. */ + the linker is hashing stabs strings, we may + see the same string more than once. */ *p = '\\'; if (f != NULL) @@ -226,12 +221,12 @@ read_section_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound) { stab_context (); free_saved_stabs (); - return false; + return FALSE; } /* Don't free f, since I think the stabs code - expects strings to hang around. This should be - straightened out. FIXME. */ + expects strings to hang around. This should be + straightened out. FIXME. */ } } @@ -239,31 +234,27 @@ read_section_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound) free (stabs); /* Don't free strings, since I think the stabs code expects - the strings to hang around. This should be straightened - out. FIXME. */ + the strings to hang around. This should be straightened + out. FIXME. */ } } if (shandle != NULL) { if (! finish_stab (dhandle, shandle)) - return false; + return FALSE; } - return true; + return TRUE; } /* Read stabs in the symbol table. */ -static boolean -read_symbol_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound) - bfd *abfd; - asymbol **syms; - long symcount; - PTR dhandle; - boolean *pfound; +static bfd_boolean +read_symbol_stabs_debugging_info (bfd *abfd, asymbol **syms, long symcount, + void *dhandle, bfd_boolean *pfound) { - PTR shandle; + void *shandle; asymbol **ps, **symend; shandle = NULL; @@ -281,12 +272,12 @@ read_symbol_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound) if (shandle == NULL) { - shandle = start_stab (dhandle, abfd, false, syms, symcount); + shandle = start_stab (dhandle, abfd, FALSE, syms, symcount); if (shandle == NULL) - return false; + return FALSE; } - *pfound = true; + *pfound = TRUE; s = i.name; f = NULL; @@ -313,7 +304,7 @@ read_symbol_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound) { stab_context (); free_saved_stabs (); - return false; + return FALSE; } /* Don't free f, since I think the stabs code expects @@ -327,19 +318,16 @@ read_symbol_stabs_debugging_info (abfd, syms, symcount, dhandle, pfound) if (shandle != NULL) { if (! finish_stab (dhandle, shandle)) - return false; + return FALSE; } - return true; + return TRUE; } /* Read IEEE debugging information. */ -static boolean -read_ieee_debugging_info (abfd, dhandle, pfound) - bfd *abfd; - PTR dhandle; - boolean *pfound; +static bfd_boolean +read_ieee_debugging_info (bfd *abfd, void *dhandle, bfd_boolean *pfound) { asection *dsec; bfd_size_type size; @@ -350,21 +338,21 @@ read_ieee_debugging_info (abfd, dhandle, pfound) dsec = bfd_get_section_by_name (abfd, ".debug"); if (dsec == NULL) - return true; + return TRUE; size = bfd_section_size (abfd, dsec); contents = (bfd_byte *) xmalloc (size); if (! bfd_get_section_contents (abfd, dsec, contents, 0, size)) - return false; + return FALSE; if (! parse_ieee (dhandle, abfd, contents, size)) - return false; + return FALSE; free (contents); - *pfound = true; + *pfound = TRUE; - return true; + return TRUE; } /* Record stabs strings, so that we can give some context for errors. */ @@ -385,11 +373,7 @@ static int saved_stabs_index; /* Save a stabs string. */ static void -save_stab (type, desc, value, string) - int type; - int desc; - bfd_vma value; - const char *string; +save_stab (int type, int desc, bfd_vma value, const char *string) { if (saved_stabs[saved_stabs_index].string != NULL) free (saved_stabs[saved_stabs_index].string); @@ -403,7 +387,7 @@ save_stab (type, desc, value, string) /* Provide context for an error. */ static void -stab_context () +stab_context (void) { int i; @@ -441,7 +425,7 @@ stab_context () /* Free the saved stab strings. */ static void -free_saved_stabs () +free_saved_stabs (void) { int i; diff --git a/contrib/binutils/binutils/readelf.c b/contrib/binutils/binutils/readelf.c index d397032..e95a501 100644 --- a/contrib/binutils/binutils/readelf.c +++ b/contrib/binutils/binutils/readelf.c @@ -1,5 +1,5 @@ /* readelf.c -- display contents of an ELF format file - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Originally developed by Eric Youngdale Modifications by Nick Clifton @@ -21,7 +21,25 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* The difference between readelf and objdump: + Both programs are capabale of displaying the contents of ELF format files, + so why does the binutils project have two file dumpers ? + + The reason is that objdump sees an ELF file through a BFD filter of the + world; if BFD has a bug where, say, it disagrees about a machine constant + in e_flags, then the odds are good that it will remain internally + consistent. The linker sees it the BFD way, objdump sees it the BFD way, + GAS sees it the BFD way. There was need for a tool to go find out what + the file actually says. + + This is why the readelf program does not link against the BFD library - it + exists as an independent program to help verify the correct working of BFD. + + There is also the case that readelf can provide more information about an + ELF file than is provided by objdump. In particular it can display DWARF + debugging information which (at the moment) objdump cannot. */ + #include #include #include @@ -31,7 +49,7 @@ #if __GNUC__ >= 2 /* Define BFD64 here, even if our default architecture is 32 bit ELF as this will allow us to read in and parse 64bit and 32bit ELF files. - Only do this if we belive that the compiler can support a 64 bit + Only do this if we believe that the compiler can support a 64 bit data type. For now we only rely on GCC being able to do this. */ #define BFD64 #endif @@ -62,9 +80,11 @@ #include "elf/h8.h" #include "elf/hppa.h" #include "elf/i386.h" +#include "elf/i370.h" #include "elf/i860.h" #include "elf/i960.h" #include "elf/ia64.h" +#include "elf/ip2k.h" #include "elf/m32r.h" #include "elf/m68k.h" #include "elf/m68hc11.h" @@ -73,9 +93,11 @@ #include "elf/mmix.h" #include "elf/mn10200.h" #include "elf/mn10300.h" +#include "elf/msp430.h" #include "elf/or32.h" #include "elf/pj.h" #include "elf/ppc.h" +#include "elf/ppc64.h" #include "elf/s390.h" #include "elf/sh.h" #include "elf/sparc.h" @@ -83,62 +105,67 @@ #include "elf/vax.h" #include "elf/x86-64.h" #include "elf/xstormy16.h" +#include "elf/iq2000.h" +#include "elf/xtensa.h" + +#include "aout/ar.h" #include "bucomm.h" #include "getopt.h" - -char * program_name = "readelf"; -unsigned int dynamic_addr; -bfd_size_type dynamic_size; -unsigned int rela_addr; -unsigned int rela_size; -char * dynamic_strings; -char * string_table; -unsigned long string_table_length; -unsigned long num_dynamic_syms; -Elf_Internal_Sym * dynamic_symbols; -Elf_Internal_Syminfo * dynamic_syminfo; -unsigned long dynamic_syminfo_offset; -unsigned int dynamic_syminfo_nent; -char program_interpreter [64]; -int dynamic_info[DT_JMPREL + 1]; -int version_info[16]; -int loadaddr = 0; -Elf_Internal_Ehdr elf_header; -Elf_Internal_Shdr * section_headers; -Elf_Internal_Dyn * dynamic_segment; -Elf_Internal_Shdr * symtab_shndx_hdr; -int show_name; -int do_dynamic; -int do_syms; -int do_reloc; -int do_sections; -int do_segments; -int do_unwind; -int do_using_dynamic; -int do_header; -int do_dump; -int do_version; -int do_wide; -int do_histogram; -int do_debugging; -int do_debug_info; -int do_debug_abbrevs; -int do_debug_lines; -int do_debug_pubnames; -int do_debug_aranges; -int do_debug_frames; -int do_debug_frames_interp; -int do_debug_macinfo; -int do_debug_str; -int do_debug_loc; -int do_arch; -int do_notes; -int is_32bit_elf; +#include "libiberty.h" + +char *program_name = "readelf"; +long archive_file_offset; +unsigned long archive_file_size; +unsigned long dynamic_addr; +bfd_size_type dynamic_size; +char *dynamic_strings; +char *string_table; +unsigned long string_table_length; +unsigned long num_dynamic_syms; +Elf_Internal_Sym *dynamic_symbols; +Elf_Internal_Syminfo *dynamic_syminfo; +unsigned long dynamic_syminfo_offset; +unsigned int dynamic_syminfo_nent; +char program_interpreter[64]; +bfd_vma dynamic_info[DT_JMPREL + 1]; +bfd_vma version_info[16]; +Elf_Internal_Ehdr elf_header; +Elf_Internal_Shdr *section_headers; +Elf_Internal_Phdr *program_headers; +Elf_Internal_Dyn *dynamic_segment; +Elf_Internal_Shdr *symtab_shndx_hdr; +int show_name; +int do_dynamic; +int do_syms; +int do_reloc; +int do_sections; +int do_segments; +int do_unwind; +int do_using_dynamic; +int do_header; +int do_dump; +int do_version; +int do_wide; +int do_histogram; +int do_debugging; +int do_debug_info; +int do_debug_abbrevs; +int do_debug_lines; +int do_debug_pubnames; +int do_debug_aranges; +int do_debug_frames; +int do_debug_frames_interp; +int do_debug_macinfo; +int do_debug_str; +int do_debug_loc; +int do_arch; +int do_notes; +int is_32bit_elf; /* A dynamic array of flags indicating which sections require dumping. */ -char * dump_sects = NULL; -unsigned int num_dump_sects = 0; +char *dump_sects = NULL; +unsigned int num_dump_sects = 0; #define HEX_DUMP (1 << 0) #define DISASS_DUMP (1 << 1) @@ -157,121 +184,11 @@ typedef enum print_mode } print_mode; -/* Forward declarations for dumb compilers. */ -static void print_vma PARAMS ((bfd_vma, print_mode)); -static void print_symbol PARAMS ((int, char *)); -static bfd_vma (* byte_get) PARAMS ((unsigned char *, int)); -static bfd_vma byte_get_little_endian PARAMS ((unsigned char *, int)); -static bfd_vma byte_get_big_endian PARAMS ((unsigned char *, int)); -static const char * get_mips_dynamic_type PARAMS ((unsigned long)); -static const char * get_sparc64_dynamic_type PARAMS ((unsigned long)); -static const char * get_ppc64_dynamic_type PARAMS ((unsigned long)); -static const char * get_parisc_dynamic_type PARAMS ((unsigned long)); -static const char * get_dynamic_type PARAMS ((unsigned long)); -static int slurp_rela_relocs PARAMS ((FILE *, unsigned long, unsigned long, Elf_Internal_Rela **, unsigned long *)); -static int slurp_rel_relocs PARAMS ((FILE *, unsigned long, unsigned long, Elf_Internal_Rel **, 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)); -static const char * get_ia64_segment_type PARAMS ((unsigned long)); -static const char * get_segment_type PARAMS ((unsigned long)); -static const char * get_mips_section_type_name PARAMS ((unsigned int)); -static const char * get_parisc_section_type_name PARAMS ((unsigned int)); -static const char * get_ia64_section_type_name PARAMS ((unsigned int)); -static const char * get_section_type_name PARAMS ((unsigned int)); -static const char * get_symbol_binding PARAMS ((unsigned int)); -static const char * get_symbol_type PARAMS ((unsigned int)); -static const char * get_symbol_visibility PARAMS ((unsigned int)); -static const char * get_symbol_index_type PARAMS ((unsigned int)); -static const char * get_dynamic_flags PARAMS ((bfd_vma)); -static void usage PARAMS ((void)); -static void parse_args PARAMS ((int, char **)); -static int process_file_header PARAMS ((void)); -static int process_program_headers PARAMS ((FILE *)); -static int process_section_headers PARAMS ((FILE *)); -static int process_unwind PARAMS ((FILE *)); -static void dynamic_segment_mips_val PARAMS ((Elf_Internal_Dyn *)); -static void dynamic_segment_parisc_val PARAMS ((Elf_Internal_Dyn *)); -static int process_dynamic_segment PARAMS ((FILE *)); -static int process_symbol_table PARAMS ((FILE *)); -static int process_syminfo PARAMS ((FILE *)); -static int process_section_contents PARAMS ((FILE *)); -static void process_mips_fpe_exception PARAMS ((int)); -static int process_mips_specific PARAMS ((FILE *)); -static int process_file PARAMS ((char *)); -static int process_relocs PARAMS ((FILE *)); -static int process_version_sections PARAMS ((FILE *)); -static char * get_ver_flags PARAMS ((unsigned int)); -static int get_32bit_section_headers PARAMS ((FILE *, unsigned int)); -static int get_64bit_section_headers PARAMS ((FILE *, unsigned int)); -static int get_32bit_program_headers PARAMS ((FILE *, Elf_Internal_Phdr *)); -static int get_64bit_program_headers PARAMS ((FILE *, Elf_Internal_Phdr *)); -static int get_file_header PARAMS ((FILE *)); -static Elf_Internal_Sym * get_32bit_elf_symbols PARAMS ((FILE *, Elf_Internal_Shdr *)); -static Elf_Internal_Sym * get_64bit_elf_symbols PARAMS ((FILE *, Elf_Internal_Shdr *)); -static const char * get_elf_section_flags PARAMS ((bfd_vma)); -static int * get_dynamic_data PARAMS ((FILE *, unsigned int)); -static int get_32bit_dynamic_segment PARAMS ((FILE *)); -static int get_64bit_dynamic_segment PARAMS ((FILE *)); -#ifdef SUPPORT_DISASSEMBLY -static int disassemble_section PARAMS ((Elf32_Internal_Shdr *, FILE *)); -#endif -static int dump_section PARAMS ((Elf32_Internal_Shdr *, FILE *)); -static int display_debug_section PARAMS ((Elf32_Internal_Shdr *, FILE *)); -static int display_debug_info PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); -static int display_debug_not_supported PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); -static int prescan_debug_info PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); -static int display_debug_lines PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); -static int display_debug_pubnames PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); -static int display_debug_abbrev PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); -static int display_debug_aranges PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); -static int display_debug_frames PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); -static int display_debug_macinfo PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); -static int display_debug_str PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); -static int display_debug_loc PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); -static unsigned char * process_abbrev_section PARAMS ((unsigned char *, unsigned char *)); -static void load_debug_str PARAMS ((FILE *)); -static void free_debug_str PARAMS ((void)); -static const char * fetch_indirect_string PARAMS ((unsigned long)); -static void load_debug_loc PARAMS ((FILE *)); -static void free_debug_loc PARAMS ((void)); -static unsigned long read_leb128 PARAMS ((unsigned char *, int *, int)); -static int process_extended_line_op PARAMS ((unsigned char *, int, int)); -static void reset_state_machine PARAMS ((int)); -static char * get_TAG_name PARAMS ((unsigned long)); -static char * get_AT_name PARAMS ((unsigned long)); -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, unsigned long)); -static unsigned char * read_and_display_attr_value PARAMS ((unsigned long, unsigned long, unsigned char *, unsigned long, unsigned long)); -static unsigned char * display_block PARAMS ((unsigned char *, unsigned long)); -static void decode_location_expression PARAMS ((unsigned char *, unsigned int, unsigned long)); -static void request_dump PARAMS ((unsigned int, int)); -static const char * get_elf_class PARAMS ((unsigned int)); -static const char * get_data_encoding PARAMS ((unsigned int)); -static const char * get_osabi_name PARAMS ((unsigned int)); -static int guess_is_rela PARAMS ((unsigned long)); -static const char * get_note_type PARAMS ((unsigned int)); -static const char * get_netbsd_elfcore_note_type PARAMS ((unsigned int)); -static int process_note PARAMS ((Elf32_Internal_Note *)); -static int process_corefile_note_segment PARAMS ((FILE *, bfd_vma, bfd_vma)); -static int process_corefile_note_segments PARAMS ((FILE *)); -static int process_corefile_contents PARAMS ((FILE *)); -static int process_arch_specific PARAMS ((FILE *)); -static int process_gnu_liblist PARAMS ((FILE *)); +static bfd_vma (*byte_get) (unsigned char *, int); +static void (*byte_put) (unsigned char *, bfd_vma, int); typedef int Elf32_Word; -#ifndef TRUE -#define TRUE 1 -#define FALSE 0 -#endif #define UNKNOWN -1 #define SECTION_NAME(X) ((X) == NULL ? "" : \ @@ -294,7 +211,7 @@ typedef int Elf32_Word; #define SECTION_HEADER(I) (section_headers + SECTION_HEADER_INDEX (I)) -#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */ +#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */ #define BYTE_GET(field) byte_get (field, sizeof (field)) @@ -320,56 +237,50 @@ typedef int Elf32_Word; static void -error VPARAMS ((const char *message, ...)) +error (const char *message, ...) { - VA_OPEN (args, message); - VA_FIXEDARG (args, const char *, message); + va_list args; + va_start (args, message); fprintf (stderr, _("%s: Error: "), program_name); vfprintf (stderr, message, args); - VA_CLOSE (args); + va_end (args); } static void -warn VPARAMS ((const char *message, ...)) +warn (const char *message, ...) { - VA_OPEN (args, message); - VA_FIXEDARG (args, const char *, message); + va_list args; + va_start (args, message); fprintf (stderr, _("%s: Warning: "), program_name); vfprintf (stderr, message, args); - VA_CLOSE (args); + va_end (args); } -static PTR get_data PARAMS ((PTR, FILE *, long, size_t, const char *)); - -static PTR -get_data (var, file, offset, size, reason) - PTR var; - FILE *file; - long offset; - size_t size; - const char *reason; +static void * +get_data (void *var, FILE *file, long offset, size_t size, const char *reason) { - PTR mvar; + void *mvar; if (size == 0) return NULL; - if (fseek (file, offset, SEEK_SET)) + if (fseek (file, archive_file_offset + offset, SEEK_SET)) { - error (_("Unable to seek to %x for %s\n"), offset, reason); + error (_("Unable to seek to 0x%x for %s\n"), + archive_file_offset + offset, reason); return NULL; } mvar = var; if (mvar == NULL) { - mvar = (PTR) malloc (size); + mvar = malloc (size); if (mvar == NULL) { - error (_("Out of memory allocating %d bytes for %s\n"), + error (_("Out of memory allocating 0x%x bytes for %s\n"), size, reason); return NULL; } @@ -377,7 +288,7 @@ get_data (var, file, offset, size, reason) if (fread (mvar, size, 1, file) != 1) { - error (_("Unable to read in %d bytes of %s\n"), size, reason); + error (_("Unable to read in 0x%x bytes of %s\n"), size, reason); if (mvar != var) free (mvar); return NULL; @@ -387,31 +298,29 @@ get_data (var, file, offset, size, reason) } static bfd_vma -byte_get_little_endian (field, size) - unsigned char * field; - int size; +byte_get_little_endian (unsigned char *field, int size) { switch (size) { case 1: - return * field; + return *field; case 2: - return ((unsigned int) (field [0])) - | (((unsigned int) (field [1])) << 8); + return ((unsigned int) (field[0])) + | (((unsigned int) (field[1])) << 8); #ifndef BFD64 case 8: /* We want to extract data from an 8 byte wide field and place it into a 4 byte wide field. Since this is a little - endian source we can juts use the 4 byte extraction code. */ + endian source we can just use the 4 byte extraction code. */ /* Fall through. */ #endif case 4: - return ((unsigned long) (field [0])) - | (((unsigned long) (field [1])) << 8) - | (((unsigned long) (field [2])) << 16) - | (((unsigned long) (field [3])) << 24); + return ((unsigned long) (field[0])) + | (((unsigned long) (field[1])) << 8) + | (((unsigned long) (field[2])) << 16) + | (((unsigned long) (field[3])) << 24); #ifdef BFD64 case 8: @@ -419,15 +328,15 @@ byte_get_little_endian (field, size) /* This is a special case, generated by the BYTE_GET8 macro. It means that we are loading an 8 byte value from a field in an external structure into an 8 byte value in a field - in an internal strcuture. */ - return ((bfd_vma) (field [0])) - | (((bfd_vma) (field [1])) << 8) - | (((bfd_vma) (field [2])) << 16) - | (((bfd_vma) (field [3])) << 24) - | (((bfd_vma) (field [4])) << 32) - | (((bfd_vma) (field [5])) << 40) - | (((bfd_vma) (field [6])) << 48) - | (((bfd_vma) (field [7])) << 56); + in an internal structure. */ + return ((bfd_vma) (field[0])) + | (((bfd_vma) (field[1])) << 8) + | (((bfd_vma) (field[2])) << 16) + | (((bfd_vma) (field[3])) << 24) + | (((bfd_vma) (field[4])) << 32) + | (((bfd_vma) (field[5])) << 40) + | (((bfd_vma) (field[6])) << 48) + | (((bfd_vma) (field[7])) << 56); #endif default: error (_("Unhandled data length: %d\n"), size); @@ -435,11 +344,58 @@ byte_get_little_endian (field, size) } } +static bfd_vma +byte_get_signed (unsigned char *field, int size) +{ + bfd_vma x = byte_get (field, size); + + switch (size) + { + case 1: + return (x ^ 0x80) - 0x80; + case 2: + return (x ^ 0x8000) - 0x8000; + case 4: + return (x ^ 0x80000000) - 0x80000000; + case 8: + case -8: + return x; + default: + abort (); + } +} + +static void +byte_put_little_endian (unsigned char *field, bfd_vma value, int size) +{ + switch (size) + { + case 8: + field[7] = (((value >> 24) >> 24) >> 8) & 0xff; + field[6] = ((value >> 24) >> 24) & 0xff; + field[5] = ((value >> 24) >> 16) & 0xff; + field[4] = ((value >> 24) >> 8) & 0xff; + /* Fall through. */ + case 4: + field[3] = (value >> 24) & 0xff; + field[2] = (value >> 16) & 0xff; + /* Fall through. */ + case 2: + field[1] = (value >> 8) & 0xff; + /* Fall through. */ + case 1: + field[0] = value & 0xff; + break; + + default: + error (_("Unhandled data length: %d\n"), size); + abort (); + } +} + /* Print a VMA value. */ static void -print_vma (vma, mode) - bfd_vma vma; - print_mode mode; +print_vma (bfd_vma vma, print_mode mode) { #ifdef BFD64 if (is_32bit_elf) @@ -447,13 +403,34 @@ print_vma (vma, mode) { switch (mode) { - case FULL_HEX: printf ("0x"); /* drop through */ - case LONG_HEX: printf ("%8.8lx", (unsigned long) vma); break; - case PREFIX_HEX: printf ("0x"); /* drop through */ - case HEX: printf ("%lx", (unsigned long) vma); break; - case DEC: printf ("%ld", (unsigned long) vma); break; - case DEC_5: printf ("%5ld", (long) vma); break; - case UNSIGNED: printf ("%lu", (unsigned long) vma); break; + case FULL_HEX: + printf ("0x"); + /* Drop through. */ + case LONG_HEX: + printf ("%8.8lx", (unsigned long) vma); + break; + + case DEC_5: + if (vma <= 99999) + { + printf ("%5ld", (long) vma); + break; + } + /* Drop through. */ + case PREFIX_HEX: + printf ("0x"); + /* Drop through. */ + case HEX: + printf ("%lx", (unsigned long) vma); + break; + + case DEC: + printf ("%ld", (unsigned long) vma); + break; + + case UNSIGNED: + printf ("%lu", (unsigned long) vma); + break; } } #ifdef BFD64 @@ -463,7 +440,7 @@ print_vma (vma, mode) { case FULL_HEX: printf ("0x"); - /* drop through */ + /* Drop through. */ case LONG_HEX: printf_vma (vma); @@ -471,7 +448,7 @@ print_vma (vma, mode) case PREFIX_HEX: printf ("0x"); - /* drop through */ + /* Drop through. */ case HEX: #if BFD_HOST_64BIT_LONG @@ -498,13 +475,18 @@ print_vma (vma, mode) case DEC_5: #if BFD_HOST_64BIT_LONG - printf ("%5ld", vma); + if (vma <= 99999) + printf ("%5ld", vma); + else + printf ("%#lx", vma); #else if (_bfd_int64_high (vma)) /* ugg */ printf ("++%ld", _bfd_int64_low (vma)); - else + else if (vma <= 99999) printf ("%5ld", _bfd_int64_low (vma)); + else + printf ("%#lx", _bfd_int64_low (vma)); #endif break; @@ -531,12 +513,10 @@ print_vma (vma, mode) truncating or padding as necessary. */ static void -print_symbol (width, symbol) - int width; - char * symbol; +print_symbol (int width, const char *symbol) { if (do_wide) - printf (symbol); + printf ("%s", symbol); else if (width < 0) printf ("%-*.*s", width, width, symbol); else @@ -544,47 +524,45 @@ print_symbol (width, symbol) } static bfd_vma -byte_get_big_endian (field, size) - unsigned char * field; - int size; +byte_get_big_endian (unsigned char *field, int size) { switch (size) { case 1: - return * field; + return *field; case 2: - return ((unsigned int) (field [1])) | (((int) (field [0])) << 8); + return ((unsigned int) (field[1])) | (((int) (field[0])) << 8); case 4: - return ((unsigned long) (field [3])) - | (((unsigned long) (field [2])) << 8) - | (((unsigned long) (field [1])) << 16) - | (((unsigned long) (field [0])) << 24); + return ((unsigned long) (field[3])) + | (((unsigned long) (field[2])) << 8) + | (((unsigned long) (field[1])) << 16) + | (((unsigned long) (field[0])) << 24); #ifndef BFD64 case 8: /* Although we are extracing data from an 8 byte wide field, we are returning only 4 bytes of data. */ - return ((unsigned long) (field [7])) - | (((unsigned long) (field [6])) << 8) - | (((unsigned long) (field [5])) << 16) - | (((unsigned long) (field [4])) << 24); + return ((unsigned long) (field[7])) + | (((unsigned long) (field[6])) << 8) + | (((unsigned long) (field[5])) << 16) + | (((unsigned long) (field[4])) << 24); #else case 8: case -8: /* This is a special case, generated by the BYTE_GET8 macro. It means that we are loading an 8 byte value from a field in an external structure into an 8 byte value in a field - in an internal strcuture. */ - return ((bfd_vma) (field [7])) - | (((bfd_vma) (field [6])) << 8) - | (((bfd_vma) (field [5])) << 16) - | (((bfd_vma) (field [4])) << 24) - | (((bfd_vma) (field [3])) << 32) - | (((bfd_vma) (field [2])) << 40) - | (((bfd_vma) (field [1])) << 48) - | (((bfd_vma) (field [0])) << 56); + in an internal structure. */ + return ((bfd_vma) (field[7])) + | (((bfd_vma) (field[6])) << 8) + | (((bfd_vma) (field[5])) << 16) + | (((bfd_vma) (field[4])) << 24) + | (((bfd_vma) (field[3])) << 32) + | (((bfd_vma) (field[2])) << 40) + | (((bfd_vma) (field[1])) << 48) + | (((bfd_vma) (field[0])) << 56); #endif default: @@ -593,11 +571,42 @@ byte_get_big_endian (field, size) } } +static void +byte_put_big_endian (unsigned char *field, bfd_vma value, int size) +{ + switch (size) + { + case 8: + field[7] = value & 0xff; + field[6] = (value >> 8) & 0xff; + field[5] = (value >> 16) & 0xff; + field[4] = (value >> 24) & 0xff; + value >>= 16; + value >>= 16; + /* Fall through. */ + case 4: + field[3] = value & 0xff; + field[2] = (value >> 8) & 0xff; + value >>= 16; + /* Fall through. */ + case 2: + field[1] = value & 0xff; + value >>= 8; + /* Fall through. */ + case 1: + field[0] = value & 0xff; + break; + + default: + error (_("Unhandled data length: %d\n"), size); + abort (); + } +} + /* Guess the relocation size commonly used by the specific machines. */ static int -guess_is_rela (e_machine) - unsigned long e_machine; +guess_is_rela (unsigned long e_machine) { switch (e_machine) { @@ -609,7 +618,6 @@ guess_is_rela (e_machine) case EM_DLX: case EM_OPENRISC: case EM_OR32: - case EM_M32R: case EM_CYGNUS_M32R: case EM_D10V: case EM_CYGNUS_D10V: @@ -650,8 +658,16 @@ guess_is_rela (e_machine) case EM_S390: case EM_S390_OLD: case EM_MMIX: + case EM_MSP430: + case EM_MSP430_OLD: case EM_XSTORMY16: case EM_VAX: + case EM_IP2K: + case EM_IP2K_OLD: + case EM_IQ2000: + case EM_XTENSA: + case EM_XTENSA_OLD: + case EM_M32R: return TRUE; case EM_MMA: @@ -678,12 +694,11 @@ guess_is_rela (e_machine) } static int -slurp_rela_relocs (file, rel_offset, rel_size, relasp, nrelasp) - FILE *file; - unsigned long rel_offset; - unsigned long rel_size; - Elf_Internal_Rela **relasp; - unsigned long *nrelasp; +slurp_rela_relocs (FILE *file, + unsigned long rel_offset, + unsigned long rel_size, + Elf_Internal_Rela **relasp, + unsigned long *nrelasp) { Elf_Internal_Rela *relas; unsigned long nrelas; @@ -691,17 +706,15 @@ slurp_rela_relocs (file, rel_offset, rel_size, relasp, nrelasp) if (is_32bit_elf) { - Elf32_External_Rela * erelas; + Elf32_External_Rela *erelas; - erelas = (Elf32_External_Rela *) get_data (NULL, file, rel_offset, - rel_size, _("relocs")); + erelas = get_data (NULL, file, rel_offset, rel_size, _("relocs")); if (!erelas) return 0; nrelas = rel_size / sizeof (Elf32_External_Rela); - relas = (Elf_Internal_Rela *) - malloc (nrelas * sizeof (Elf_Internal_Rela)); + relas = malloc (nrelas * sizeof (Elf_Internal_Rela)); if (relas == NULL) { @@ -720,17 +733,15 @@ slurp_rela_relocs (file, rel_offset, rel_size, relasp, nrelasp) } else { - Elf64_External_Rela * erelas; + Elf64_External_Rela *erelas; - erelas = (Elf64_External_Rela *) get_data (NULL, file, rel_offset, - rel_size, _("relocs")); + erelas = get_data (NULL, file, rel_offset, rel_size, _("relocs")); if (!erelas) return 0; nrelas = rel_size / sizeof (Elf64_External_Rela); - relas = (Elf_Internal_Rela *) - malloc (nrelas * sizeof (Elf_Internal_Rela)); + relas = malloc (nrelas * sizeof (Elf_Internal_Rela)); if (relas == NULL) { @@ -753,29 +764,27 @@ slurp_rela_relocs (file, rel_offset, rel_size, relasp, nrelasp) } static int -slurp_rel_relocs (file, rel_offset, rel_size, relsp, nrelsp) - FILE *file; - unsigned long rel_offset; - unsigned long rel_size; - Elf_Internal_Rel **relsp; - unsigned long *nrelsp; -{ - Elf_Internal_Rel *rels; +slurp_rel_relocs (FILE *file, + unsigned long rel_offset, + unsigned long rel_size, + Elf_Internal_Rela **relsp, + unsigned long *nrelsp) +{ + Elf_Internal_Rela *rels; unsigned long nrels; unsigned int i; if (is_32bit_elf) { - Elf32_External_Rel * erels; + Elf32_External_Rel *erels; - erels = (Elf32_External_Rel *) get_data (NULL, file, rel_offset, - rel_size, _("relocs")); + erels = get_data (NULL, file, rel_offset, rel_size, _("relocs")); if (!erels) return 0; nrels = rel_size / sizeof (Elf32_External_Rel); - rels = (Elf_Internal_Rel *) malloc (nrels * sizeof (Elf_Internal_Rel)); + rels = malloc (nrels * sizeof (Elf_Internal_Rela)); if (rels == NULL) { @@ -787,22 +796,22 @@ slurp_rel_relocs (file, rel_offset, rel_size, relsp, nrelsp) { rels[i].r_offset = BYTE_GET (erels[i].r_offset); rels[i].r_info = BYTE_GET (erels[i].r_info); + rels[i].r_addend = 0; } free (erels); } else { - Elf64_External_Rel * erels; + Elf64_External_Rel *erels; - erels = (Elf64_External_Rel *) get_data (NULL, file, rel_offset, - rel_size, _("relocs")); + erels = get_data (NULL, file, rel_offset, rel_size, _("relocs")); if (!erels) return 0; nrels = rel_size / sizeof (Elf64_External_Rel); - rels = (Elf_Internal_Rel *) malloc (nrels * sizeof (Elf_Internal_Rel)); + rels = malloc (nrels * sizeof (Elf_Internal_Rela)); if (rels == NULL) { @@ -814,6 +823,7 @@ slurp_rel_relocs (file, rel_offset, rel_size, relsp, nrelsp) { rels[i].r_offset = BYTE_GET8 (erels[i].r_offset); rels[i].r_info = BYTE_GET8 (erels[i].r_info); + rels[i].r_addend = 0; } free (erels); @@ -823,20 +833,20 @@ slurp_rel_relocs (file, rel_offset, rel_size, relsp, nrelsp) return 1; } -/* Display the contents of the relocation data found at the specified offset. */ +/* Display the contents of the relocation data found at the specified + offset. */ + static int -dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) - FILE * file; - unsigned long rel_offset; - unsigned long rel_size; - Elf_Internal_Sym * symtab; - unsigned long nsyms; - char * strtab; - int is_rela; +dump_relocations (FILE *file, + unsigned long rel_offset, + unsigned long rel_size, + Elf_Internal_Sym *symtab, + unsigned long nsyms, + char *strtab, + int is_rela) { - unsigned int i; - Elf_Internal_Rel * rels; - Elf_Internal_Rela * relas; + unsigned int i; + Elf_Internal_Rela *rels; if (is_rela == UNKNOWN) @@ -844,7 +854,7 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) if (is_rela) { - if (!slurp_rela_relocs (file, rel_offset, rel_size, &relas, &rel_size)) + if (!slurp_rela_relocs (file, rel_offset, rel_size, &rels, &rel_size)) return 0; } else @@ -875,14 +885,14 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) if (is_rela) { if (do_wide) - printf (_(" Offset Info Type Symbol's Value Symbol's Name + Addend\n")); + printf (_(" Offset Info Type Symbol's Value Symbol's Name + Addend\n")); else printf (_(" Offset Info Type Sym. Value Sym. Name + Addend\n")); } else { if (do_wide) - printf (_(" Offset Info Type Symbol's Value Symbol's Name\n")); + printf (_(" Offset Info Type Symbol's Value Symbol's Name\n")); else printf (_(" Offset Info Type Sym. Value Sym. Name\n")); } @@ -890,26 +900,18 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) for (i = 0; i < rel_size; i++) { - const char * rtype; - const char * rtype2 = NULL; - const char * rtype3 = NULL; - bfd_vma offset; - bfd_vma info; - bfd_vma symtab_index; - bfd_vma type; - bfd_vma type2 = (bfd_vma) NULL; - bfd_vma type3 = (bfd_vma) NULL; + const char *rtype; + const char *rtype2 = NULL; + const char *rtype3 = NULL; + bfd_vma offset; + bfd_vma info; + bfd_vma symtab_index; + bfd_vma type; + bfd_vma type2 = 0; + bfd_vma type3 = 0; - if (is_rela) - { - offset = relas [i].r_offset; - info = relas [i].r_info; - } - else - { - offset = rels [i].r_offset; - info = rels [i].r_info; - } + offset = rels[i].r_offset; + info = rels[i].r_info; if (is_32bit_elf) { @@ -918,8 +920,22 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) } else { + /* The #ifdef BFD64 below is to prevent a compile time warning. + We know that if we do not have a 64 bit data type that we + will never execute this code anyway. */ +#ifdef BFD64 if (elf_header.e_machine == EM_MIPS) { + /* In little-endian objects, r_info isn't really a 64-bit + little-endian value: it has a 32-bit little-endian + symbol index followed by four individual byte fields. + Reorder INFO accordingly. */ + if (elf_header.e_ident[EI_DATA] != ELFDATA2MSB) + info = (((info & 0xffffffff) << 32) + | ((info >> 56) & 0xff) + | ((info >> 40) & 0xff00) + | ((info >> 24) & 0xff0000) + | ((info >> 8) & 0xff000000)); type = ELF64_MIPS_R_TYPE (info); type2 = ELF64_MIPS_R_TYPE2 (info); type3 = ELF64_MIPS_R_TYPE3 (info); @@ -928,10 +944,7 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) type = ELF64_R_TYPE_ID (info); else type = ELF64_R_TYPE (info); - /* The #ifdef BFD64 below is to prevent a compile time warning. - We know that if we do not have a 64 bit data type that we - will never execute this code anyway. */ -#ifdef BFD64 + symtab_index = ELF64_R_SYM (info); #endif } @@ -1053,11 +1066,19 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) rtype = elf_mmix_reloc_type (type); break; + case EM_MSP430: + case EM_MSP430_OLD: + rtype = elf_msp430_reloc_type (type); + break; + case EM_PPC: - case EM_PPC64: rtype = elf_ppc_reloc_type (type); break; + case EM_PPC64: + rtype = elf_ppc64_reloc_type (type); + break; + case EM_MIPS: case EM_MIPS_RS3_LE: rtype = elf_mips_reloc_type (type); @@ -1115,6 +1136,10 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) rtype = elf_x86_64_reloc_type (type); break; + case EM_S370: + rtype = i370_reloc_type (type); + break; + case EM_S390_OLD: case EM_S390: rtype = elf_s390_reloc_type (type); @@ -1127,6 +1152,20 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) case EM_VAX: rtype = elf_vax_reloc_type (type); break; + + case EM_IP2K: + case EM_IP2K_OLD: + rtype = elf_ip2k_reloc_type (type); + break; + + case EM_IQ2000: + rtype = elf_iq2000_reloc_type (type); + break; + + case EM_XTENSA_OLD: + case EM_XTENSA: + rtype = elf_xtensa_reloc_type (type); + break; } if (rtype == NULL) @@ -1136,7 +1175,7 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) printf (_("unrecognized: %-7lx"), type); #endif else - printf (do_wide ? "%-21.21s" : "%-17.17s", rtype); + printf (do_wide ? "%-22.22s" : "%-17.17s", rtype); if (symtab_index) { @@ -1144,7 +1183,7 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) printf (" bad symbol index: %08lx", (unsigned long) symtab_index); else { - Elf_Internal_Sym * psym; + Elf_Internal_Sym *psym; psym = symtab + symtab_index; @@ -1153,20 +1192,52 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) printf (is_32bit_elf ? " " : " "); if (psym->st_name == 0) - print_symbol (22, SECTION_NAME (section_headers + psym->st_shndx)); + { + const char *sec_name = ""; + char name_buf[40]; + + if (ELF_ST_TYPE (psym->st_info) == STT_SECTION) + { + bfd_vma sec_index = (bfd_vma) -1; + + if (psym->st_shndx < SHN_LORESERVE) + sec_index = psym->st_shndx; + else if (psym->st_shndx > SHN_LORESERVE) + sec_index = psym->st_shndx - (SHN_HIRESERVE + 1 + - SHN_LORESERVE); + + if (sec_index != (bfd_vma) -1) + sec_name = SECTION_NAME (section_headers + sec_index); + else if (psym->st_shndx == SHN_ABS) + sec_name = "ABS"; + else if (psym->st_shndx == SHN_COMMON) + sec_name = "COMMON"; + else if (elf_header.e_machine == EM_IA_64 + && elf_header.e_ident[EI_OSABI] == ELFOSABI_HPUX + && psym->st_shndx == SHN_IA_64_ANSI_COMMON) + sec_name = "ANSI_COM"; + else + { + sprintf (name_buf, "
", + (unsigned int) psym->st_shndx); + sec_name = name_buf; + } + } + print_symbol (22, sec_name); + } else if (strtab == NULL) printf (_(""), psym->st_name); else print_symbol (22, strtab + psym->st_name); if (is_rela) - printf (" + %lx", (unsigned long) relas [i].r_addend); + printf (" + %lx", (unsigned long) rels[i].r_addend); } } else if (is_rela) { printf ("%*c", is_32bit_elf ? (do_wide ? 34 : 28) : (do_wide ? 26 : 20), ' '); - print_vma (relas[i].r_addend, LONG_HEX); + print_vma (rels[i].r_addend, LONG_HEX); } if (elf_header.e_machine == EM_SPARCV9 @@ -1203,17 +1274,13 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) } } - if (is_rela) - free (relas); - else - free (rels); + free (rels); return 1; } static const char * -get_mips_dynamic_type (type) - unsigned long type; +get_mips_dynamic_type (unsigned long type) { switch (type) { @@ -1266,8 +1333,7 @@ get_mips_dynamic_type (type) } static const char * -get_sparc64_dynamic_type (type) - unsigned long type; +get_sparc64_dynamic_type (unsigned long type) { switch (type) { @@ -1278,8 +1344,7 @@ get_sparc64_dynamic_type (type) } static const char * -get_ppc64_dynamic_type (type) - unsigned long type; +get_ppc64_dynamic_type (unsigned long type) { switch (type) { @@ -1292,8 +1357,7 @@ get_ppc64_dynamic_type (type) } static const char * -get_parisc_dynamic_type (type) - unsigned long type; +get_parisc_dynamic_type (unsigned long type) { switch (type) { @@ -1316,10 +1380,20 @@ get_parisc_dynamic_type (type) } static const char * -get_dynamic_type (type) - unsigned long type; +get_ia64_dynamic_type (unsigned long type) +{ + switch (type) + { + case DT_IA_64_PLT_RESERVE: return "IA_64_PLT_RESERVE"; + default: + return NULL; + } +} + +static const char * +get_dynamic_type (unsigned long type) { - static char buff [32]; + static char buff[32]; switch (type) { @@ -1398,7 +1472,7 @@ get_dynamic_type (type) default: if ((type >= DT_LOPROC) && (type <= DT_HIPROC)) { - const char * result; + const char *result; switch (elf_header.e_machine) { @@ -1412,6 +1486,9 @@ get_dynamic_type (type) case EM_PPC64: result = get_ppc64_dynamic_type (type); break; + case EM_IA_64: + result = get_ia64_dynamic_type (type); + break; default: result = NULL; break; @@ -1424,7 +1501,7 @@ get_dynamic_type (type) } else if ((type >= DT_LOOS) && (type <= DT_HIOS)) { - const char * result; + const char *result; switch (elf_header.e_machine) { @@ -1449,10 +1526,9 @@ get_dynamic_type (type) } static char * -get_file_type (e_type) - unsigned e_type; +get_file_type (unsigned e_type) { - static char buff [32]; + static char buff[32]; switch (e_type) { @@ -1474,10 +1550,9 @@ get_file_type (e_type) } static char * -get_machine_name (e_machine) - unsigned e_machine; +get_machine_name (unsigned e_machine) { - static char buff [64]; /* XXX */ + static char buff[64]; /* XXX */ switch (e_machine) { @@ -1502,17 +1577,17 @@ get_machine_name (e_machine) case EM_V800: return "NEC V800"; case EM_FR20: return "Fujitsu FR20"; case EM_RH32: return "TRW RH32"; - case EM_MCORE: return "MCORE"; + case EM_MCORE: return "MCORE"; case EM_ARM: return "ARM"; case EM_OLD_ALPHA: return "Digital Alpha (old)"; - case EM_SH: return "Hitachi SH"; + case EM_SH: return "Renesas / SuperH SH"; case EM_SPARCV9: return "Sparc v9"; case EM_TRICORE: return "Siemens Tricore"; case EM_ARC: return "ARC"; - case EM_H8_300: return "Hitachi H8/300"; - case EM_H8_300H: return "Hitachi H8/300H"; - case EM_H8S: return "Hitachi H8S"; - case EM_H8_500: return "Hitachi H8/500"; + case EM_H8_300: return "Renesas H8/300"; + case EM_H8_300H: return "Renesas H8/300H"; + case EM_H8S: return "Renesas H8S"; + case EM_H8_500: return "Renesas H8/500"; case EM_IA_64: return "Intel IA-64"; case EM_MIPS_X: return "Stanford MIPS-X"; case EM_COLDFIRE: return "Motorola Coldfire"; @@ -1521,9 +1596,9 @@ get_machine_name (e_machine) case EM_CYGNUS_D10V: case EM_D10V: return "d10v"; case EM_CYGNUS_D30V: - case EM_D30V: return "d30v"; + case EM_D30V: return "d30v"; case EM_CYGNUS_M32R: - case EM_M32R: return "Mitsubishi M32r"; + case EM_M32R: return "Renesas M32R (formerly Mitsubishi M32r)"; case EM_CYGNUS_V850: case EM_V850: return "NEC v850"; case EM_CYGNUS_MN10300: @@ -1532,9 +1607,9 @@ get_machine_name (e_machine) case EM_MN10200: return "mn10200"; case EM_CYGNUS_FR30: case EM_FR30: return "Fujitsu FR30"; - case EM_CYGNUS_FRV: return "Fujitsu FR-V"; + case EM_CYGNUS_FRV: return "Fujitsu FR-V"; case EM_PJ_OLD: - case EM_PJ: return "picoJava"; + case EM_PJ: return "picoJava"; case EM_MMA: return "Fujitsu Multimedia Accelerator"; case EM_PCP: return "Siemens PCP"; case EM_NCPU: return "Sony nCPU embedded RISC processor"; @@ -1554,21 +1629,26 @@ get_machine_name (e_machine) case EM_ST19: return "STMicroelectronics ST19 8-bit microcontroller"; case EM_VAX: return "Digital VAX"; case EM_AVR_OLD: - case EM_AVR: return "Atmel AVR 8-bit microcontroller"; + case EM_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_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_PRISM: return "Vitesse Prism"; case EM_X86_64: return "Advanced Micro Devices X86-64"; case EM_S390_OLD: - case EM_S390: return "IBM S/390"; + case EM_S390: return "IBM S/390"; case EM_XSTORMY16: return "Sanyo Xstormy16 CPU core"; case EM_OPENRISC: case EM_OR32: return "OpenRISC"; case EM_DLX: return "OpenDLX"; + case EM_IP2K_OLD: + case EM_IP2K: return "Ubicom IP2xxx 8-bit microcontrollers"; + case EM_IQ2000: return "Vitesse IQ2000"; + case EM_XTENSA_OLD: + case EM_XTENSA: return "Tensilica Xtensa Processor"; default: sprintf (buff, _(": %x"), e_machine); return buff; @@ -1576,9 +1656,7 @@ get_machine_name (e_machine) } static void -decode_ARM_machine_flags (e_flags, buf) - unsigned e_flags; - char buf[]; +decode_ARM_machine_flags (unsigned e_flags, char buf[]) { unsigned eabi; int unknown = 0; @@ -1706,6 +1784,10 @@ decode_ARM_machine_flags (e_flags, buf) strcat (buf, ", software FP"); break; + case EF_ARM_MAVERICK_FLOAT: + strcat (buf, ", Maverick FP"); + break; + default: unknown = 1; break; @@ -1718,11 +1800,9 @@ decode_ARM_machine_flags (e_flags, buf) } static char * -get_machine_flags (e_flags, e_machine) - unsigned e_flags; - unsigned e_machine; +get_machine_flags (unsigned e_flags, unsigned e_machine) { - static char buf [1024]; + static char buf[1024]; buf[0] = '\0'; @@ -1759,12 +1839,12 @@ get_machine_flags (e_flags, e_machine) case EM_CYGNUS_V850: switch (e_flags & EF_V850_ARCH) { + case E_V850E1_ARCH: + strcat (buf, ", v850e1"); + break; case E_V850E_ARCH: strcat (buf, ", v850e"); break; - case E_V850EA_ARCH: - strcat (buf, ", v850ea"); - break; case E_V850_ARCH: strcat (buf, ", v850"); break; @@ -1809,8 +1889,11 @@ get_machine_flags (e_flags, e_machine) 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_4120: strcat (buf, ", 4120"); break; + case E_MIPS_MACH_4650: strcat (buf, ", 4650"); break; + case E_MIPS_MACH_5400: strcat (buf, ", 5400"); break; + case E_MIPS_MACH_5500: strcat (buf, ", 5500"); break; case E_MIPS_MACH_SB1: strcat (buf, ", sb1"); break; case 0: /* We simply ignore the field in this case to avoid confusion: @@ -1849,7 +1932,9 @@ get_machine_flags (e_flags, e_machine) case E_MIPS_ARCH_4: strcat (buf, ", mips4"); break; case E_MIPS_ARCH_5: strcat (buf, ", mips5"); break; case E_MIPS_ARCH_32: strcat (buf, ", mips32"); break; + case E_MIPS_ARCH_32R2: strcat (buf, ", mips32r2"); break; case E_MIPS_ARCH_64: strcat (buf, ", mips64"); break; + case E_MIPS_ARCH_64R2: strcat (buf, ", mips64r2"); break; default: strcat (buf, ", unknown ISA"); break; } @@ -1949,8 +2034,37 @@ get_machine_flags (e_flags, e_machine) } static const char * -get_mips_segment_type (type) - unsigned long type; +get_osabi_name (unsigned int osabi) +{ + static char buff[32]; + + switch (osabi) + { + case ELFOSABI_NONE: return "UNIX - System V"; + case ELFOSABI_HPUX: return "UNIX - HP-UX"; + case ELFOSABI_NETBSD: return "UNIX - NetBSD"; + case ELFOSABI_LINUX: return "UNIX - Linux"; + case ELFOSABI_HURD: return "GNU/Hurd"; + case ELFOSABI_SOLARIS: return "UNIX - Solaris"; + case ELFOSABI_AIX: return "UNIX - AIX"; + case ELFOSABI_IRIX: return "UNIX - IRIX"; + case ELFOSABI_FREEBSD: return "UNIX - FreeBSD"; + case ELFOSABI_TRU64: return "UNIX - TRU64"; + case ELFOSABI_MODESTO: return "Novell - Modesto"; + case ELFOSABI_OPENBSD: return "UNIX - OpenBSD"; + case ELFOSABI_OPENVMS: return "VMS - OpenVMS"; + case ELFOSABI_NSK: return "HP - Non-Stop Kernel"; + case ELFOSABI_AROS: return "Amiga Research OS"; + case ELFOSABI_STANDALONE: return _("Standalone App"); + case ELFOSABI_ARM: return "ARM"; + default: + sprintf (buff, _(""), osabi); + return buff; + } +} + +static const char * +get_mips_segment_type (unsigned long type) { switch (type) { @@ -1968,8 +2082,7 @@ get_mips_segment_type (type) } static const char * -get_parisc_segment_type (type) - unsigned long type; +get_parisc_segment_type (unsigned long type) { switch (type) { @@ -1995,8 +2108,7 @@ get_parisc_segment_type (type) } static const char * -get_ia64_segment_type (type) - unsigned long type; +get_ia64_segment_type (unsigned long type) { switch (type) { @@ -2014,29 +2126,29 @@ get_ia64_segment_type (type) } static const char * -get_segment_type (p_type) - unsigned long p_type; +get_segment_type (unsigned long p_type) { - static char buff [32]; + static char buff[32]; switch (p_type) { - case PT_NULL: return "NULL"; - case PT_LOAD: return "LOAD"; + case PT_NULL: return "NULL"; + case PT_LOAD: return "LOAD"; case PT_DYNAMIC: return "DYNAMIC"; - case PT_INTERP: return "INTERP"; - case PT_NOTE: return "NOTE"; - case PT_SHLIB: return "SHLIB"; - case PT_PHDR: return "PHDR"; + case PT_INTERP: return "INTERP"; + case PT_NOTE: return "NOTE"; + case PT_SHLIB: return "SHLIB"; + case PT_PHDR: return "PHDR"; case PT_TLS: return "TLS"; case PT_GNU_EH_FRAME: return "GNU_EH_FRAME"; + case PT_GNU_STACK: return "STACK"; default: if ((p_type >= PT_LOPROC) && (p_type <= PT_HIPROC)) { - const char * result; + const char *result; switch (elf_header.e_machine) { @@ -2062,7 +2174,7 @@ get_segment_type (p_type) } else if ((p_type >= PT_LOOS) && (p_type <= PT_HIOS)) { - const char * result; + const char *result; switch (elf_header.e_machine) { @@ -2090,49 +2202,48 @@ get_segment_type (p_type) } static const char * -get_mips_section_type_name (sh_type) - unsigned int sh_type; +get_mips_section_type_name (unsigned int sh_type) { switch (sh_type) { - case SHT_MIPS_LIBLIST: return "MIPS_LIBLIST"; - case SHT_MIPS_MSYM: return "MIPS_MSYM"; - case SHT_MIPS_CONFLICT: return "MIPS_CONFLICT"; - case SHT_MIPS_GPTAB: return "MIPS_GPTAB"; - case SHT_MIPS_UCODE: return "MIPS_UCODE"; - case SHT_MIPS_DEBUG: return "MIPS_DEBUG"; - case SHT_MIPS_REGINFO: return "MIPS_REGINFO"; - case SHT_MIPS_PACKAGE: return "MIPS_PACKAGE"; - case SHT_MIPS_PACKSYM: return "MIPS_PACKSYM"; - case SHT_MIPS_RELD: return "MIPS_RELD"; - case SHT_MIPS_IFACE: return "MIPS_IFACE"; - case SHT_MIPS_CONTENT: return "MIPS_CONTENT"; - case SHT_MIPS_OPTIONS: return "MIPS_OPTIONS"; - case SHT_MIPS_SHDR: return "MIPS_SHDR"; - case SHT_MIPS_FDESC: return "MIPS_FDESC"; - case SHT_MIPS_EXTSYM: return "MIPS_EXTSYM"; - case SHT_MIPS_DENSE: return "MIPS_DENSE"; - case SHT_MIPS_PDESC: return "MIPS_PDESC"; - case SHT_MIPS_LOCSYM: return "MIPS_LOCSYM"; - case SHT_MIPS_AUXSYM: return "MIPS_AUXSYM"; - case SHT_MIPS_OPTSYM: return "MIPS_OPTSYM"; - case SHT_MIPS_LOCSTR: return "MIPS_LOCSTR"; - case SHT_MIPS_LINE: return "MIPS_LINE"; - case SHT_MIPS_RFDESC: return "MIPS_RFDESC"; - case SHT_MIPS_DELTASYM: return "MIPS_DELTASYM"; - case SHT_MIPS_DELTAINST: return "MIPS_DELTAINST"; - case SHT_MIPS_DELTACLASS: return "MIPS_DELTACLASS"; - case SHT_MIPS_DWARF: return "MIPS_DWARF"; - case SHT_MIPS_DELTADECL: return "MIPS_DELTADECL"; - case SHT_MIPS_SYMBOL_LIB: return "MIPS_SYMBOL_LIB"; - case SHT_MIPS_EVENTS: return "MIPS_EVENTS"; - case SHT_MIPS_TRANSLATE: return "MIPS_TRANSLATE"; - case SHT_MIPS_PIXIE: return "MIPS_PIXIE"; - case SHT_MIPS_XLATE: return "MIPS_XLATE"; - case SHT_MIPS_XLATE_DEBUG: return "MIPS_XLATE_DEBUG"; - case SHT_MIPS_WHIRL: return "MIPS_WHIRL"; - case SHT_MIPS_EH_REGION: return "MIPS_EH_REGION"; - case SHT_MIPS_XLATE_OLD: return "MIPS_XLATE_OLD"; + case SHT_MIPS_LIBLIST: return "MIPS_LIBLIST"; + case SHT_MIPS_MSYM: return "MIPS_MSYM"; + case SHT_MIPS_CONFLICT: return "MIPS_CONFLICT"; + case SHT_MIPS_GPTAB: return "MIPS_GPTAB"; + case SHT_MIPS_UCODE: return "MIPS_UCODE"; + case SHT_MIPS_DEBUG: return "MIPS_DEBUG"; + case SHT_MIPS_REGINFO: return "MIPS_REGINFO"; + case SHT_MIPS_PACKAGE: return "MIPS_PACKAGE"; + case SHT_MIPS_PACKSYM: return "MIPS_PACKSYM"; + case SHT_MIPS_RELD: return "MIPS_RELD"; + case SHT_MIPS_IFACE: return "MIPS_IFACE"; + case SHT_MIPS_CONTENT: return "MIPS_CONTENT"; + case SHT_MIPS_OPTIONS: return "MIPS_OPTIONS"; + case SHT_MIPS_SHDR: return "MIPS_SHDR"; + case SHT_MIPS_FDESC: return "MIPS_FDESC"; + case SHT_MIPS_EXTSYM: return "MIPS_EXTSYM"; + case SHT_MIPS_DENSE: return "MIPS_DENSE"; + case SHT_MIPS_PDESC: return "MIPS_PDESC"; + case SHT_MIPS_LOCSYM: return "MIPS_LOCSYM"; + case SHT_MIPS_AUXSYM: return "MIPS_AUXSYM"; + case SHT_MIPS_OPTSYM: return "MIPS_OPTSYM"; + case SHT_MIPS_LOCSTR: return "MIPS_LOCSTR"; + case SHT_MIPS_LINE: return "MIPS_LINE"; + case SHT_MIPS_RFDESC: return "MIPS_RFDESC"; + case SHT_MIPS_DELTASYM: return "MIPS_DELTASYM"; + case SHT_MIPS_DELTAINST: return "MIPS_DELTAINST"; + case SHT_MIPS_DELTACLASS: return "MIPS_DELTACLASS"; + case SHT_MIPS_DWARF: return "MIPS_DWARF"; + case SHT_MIPS_DELTADECL: return "MIPS_DELTADECL"; + case SHT_MIPS_SYMBOL_LIB: return "MIPS_SYMBOL_LIB"; + case SHT_MIPS_EVENTS: return "MIPS_EVENTS"; + case SHT_MIPS_TRANSLATE: return "MIPS_TRANSLATE"; + case SHT_MIPS_PIXIE: return "MIPS_PIXIE"; + case SHT_MIPS_XLATE: return "MIPS_XLATE"; + case SHT_MIPS_XLATE_DEBUG: return "MIPS_XLATE_DEBUG"; + case SHT_MIPS_WHIRL: return "MIPS_WHIRL"; + case SHT_MIPS_EH_REGION: return "MIPS_EH_REGION"; + case SHT_MIPS_XLATE_OLD: return "MIPS_XLATE_OLD"; case SHT_MIPS_PDR_EXCEPTION: return "MIPS_PDR_EXCEPTION"; default: break; @@ -2141,8 +2252,7 @@ get_mips_section_type_name (sh_type) } static const char * -get_parisc_section_type_name (sh_type) - unsigned int sh_type; +get_parisc_section_type_name (unsigned int sh_type) { switch (sh_type) { @@ -2156,13 +2266,17 @@ get_parisc_section_type_name (sh_type) } static const char * -get_ia64_section_type_name (sh_type) - unsigned int sh_type; +get_ia64_section_type_name (unsigned int sh_type) { + /* If the top 8 bits are 0x78 the next 8 are the os/abi ID. */ + if ((sh_type & 0xFF000000) == SHT_IA_64_LOPSREG) + return get_osabi_name ((sh_type & 0x00FF0000) >> 16); + switch (sh_type) { - case SHT_IA_64_EXT: return "IA_64_EXT"; - case SHT_IA_64_UNWIND: return "IA_64_UNWIND"; + case SHT_IA_64_EXT: return "IA_64_EXT"; + case SHT_IA_64_UNWIND: return "IA_64_UNWIND"; + case SHT_IA_64_PRIORITY_INIT: return "IA_64_PRIORITY_INIT"; default: break; } @@ -2170,10 +2284,9 @@ get_ia64_section_type_name (sh_type) } static const char * -get_section_type_name (sh_type) - unsigned int sh_type; +get_section_type_name (unsigned int sh_type) { - static char buff [32]; + static char buff[32]; switch (sh_type) { @@ -2197,8 +2310,8 @@ get_section_type_name (sh_type) case SHT_GNU_verdef: return "VERDEF"; case SHT_GNU_verneed: return "VERNEED"; case SHT_GNU_versym: return "VERSYM"; - case 0x6ffffff0: return "VERSYM"; - case 0x6ffffffc: return "VERDEF"; + case 0x6ffffff0: return "VERSYM"; + case 0x6ffffffc: return "VERDEF"; case 0x7ffffffd: return "AUXILIARY"; case 0x7fffffff: return "FILTER"; case SHT_GNU_LIBLIST: return "GNU_LIBLIST"; @@ -2206,7 +2319,7 @@ get_section_type_name (sh_type) default: if ((sh_type >= SHT_LOPROC) && (sh_type <= SHT_HIPROC)) { - const char * result; + const char *result; switch (elf_header.e_machine) { @@ -2243,39 +2356,39 @@ get_section_type_name (sh_type) #define OPTION_DEBUG_DUMP 512 -struct option options [] = +struct option options[] = { - {"all", no_argument, 0, 'a'}, + {"all", no_argument, 0, 'a'}, {"file-header", no_argument, 0, 'h'}, {"program-headers", no_argument, 0, 'l'}, - {"headers", no_argument, 0, 'e'}, - {"histogram", no_argument, 0, 'I'}, - {"segments", no_argument, 0, 'l'}, - {"sections", no_argument, 0, 'S'}, + {"headers", no_argument, 0, 'e'}, + {"histogram", no_argument, 0, 'I'}, + {"segments", no_argument, 0, 'l'}, + {"sections", no_argument, 0, 'S'}, {"section-headers", no_argument, 0, 'S'}, - {"symbols", no_argument, 0, 's'}, - {"syms", no_argument, 0, 's'}, - {"relocs", no_argument, 0, 'r'}, - {"notes", no_argument, 0, 'n'}, - {"dynamic", no_argument, 0, 'd'}, + {"symbols", no_argument, 0, 's'}, + {"syms", no_argument, 0, 's'}, + {"relocs", no_argument, 0, 'r'}, + {"notes", no_argument, 0, 'n'}, + {"dynamic", no_argument, 0, 'd'}, {"arch-specific", no_argument, 0, 'A'}, {"version-info", no_argument, 0, 'V'}, {"use-dynamic", no_argument, 0, 'D'}, - {"hex-dump", required_argument, 0, 'x'}, + {"hex-dump", required_argument, 0, 'x'}, {"debug-dump", optional_argument, 0, OPTION_DEBUG_DUMP}, {"unwind", no_argument, 0, 'u'}, #ifdef SUPPORT_DISASSEMBLY {"instruction-dump", required_argument, 0, 'i'}, #endif - {"version", no_argument, 0, 'v'}, - {"wide", no_argument, 0, 'W'}, - {"help", no_argument, 0, 'H'}, - {0, no_argument, 0, 0} + {"version", no_argument, 0, 'v'}, + {"wide", no_argument, 0, 'W'}, + {"help", no_argument, 0, 'H'}, + {0, no_argument, 0, 0} }; static void -usage () +usage (void) { fprintf (stdout, _("Usage: readelf elf-file(s)\n")); fprintf (stdout, _(" Display information about the contents of ELF format files\n")); @@ -2316,15 +2429,13 @@ usage () } static void -request_dump (section, type) - unsigned int section; - int type; +request_dump (unsigned int section, int type) { if (section >= num_dump_sects) { - char * new_dump_sects; + char *new_dump_sects; - new_dump_sects = (char *) calloc (section + 1, 1); + new_dump_sects = calloc (section + 1, 1); if (new_dump_sects == NULL) error (_("Out of memory allocating dump request table.")); @@ -2341,15 +2452,13 @@ request_dump (section, type) } if (dump_sects) - dump_sects [section] |= type; + dump_sects[section] |= type; return; } static void -parse_args (argc, argv) - int argc; - char ** argv; +parse_args (int argc, char **argv) { int c; @@ -2357,10 +2466,10 @@ parse_args (argc, argv) usage (); while ((c = getopt_long - (argc, argv, "ersuahnldSDAIw::x:i:vVW", options, NULL)) != EOF) + (argc, argv, "ersuahnldSDAIw::x:i:vVWH", options, NULL)) != EOF) { - char * cp; - int section; + char *cp; + int section; switch (c) { @@ -2372,67 +2481,67 @@ parse_args (argc, argv) break; case 'a': - do_syms ++; - do_reloc ++; - do_unwind ++; - do_dynamic ++; - do_header ++; - do_sections ++; - do_segments ++; - do_version ++; - do_histogram ++; - do_arch ++; - do_notes ++; + do_syms++; + do_reloc++; + do_unwind++; + do_dynamic++; + do_header++; + do_sections++; + do_segments++; + do_version++; + do_histogram++; + do_arch++; + do_notes++; break; case 'e': - do_header ++; - do_sections ++; - do_segments ++; + do_header++; + do_sections++; + do_segments++; break; case 'A': - do_arch ++; + do_arch++; break; case 'D': - do_using_dynamic ++; + do_using_dynamic++; break; case 'r': - do_reloc ++; + do_reloc++; break; case 'u': - do_unwind ++; + do_unwind++; break; case 'h': - do_header ++; + do_header++; break; case 'l': - do_segments ++; + do_segments++; break; case 's': - do_syms ++; + do_syms++; break; case 'S': - do_sections ++; + do_sections++; break; case 'd': - do_dynamic ++; + do_dynamic++; break; case 'I': - do_histogram ++; + do_histogram++; break; case 'n': - do_notes ++; + do_notes++; break; case 'x': - do_dump ++; + do_dump++; section = strtoul (optarg, & cp, 0); - if (! * cp && section >= 0) + if (! *cp && section >= 0) { request_dump (section, HEX_DUMP); break; } goto oops; case 'w': - do_dump ++; + do_dump++; if (optarg == 0) do_debugging = 1; else @@ -2497,12 +2606,12 @@ parse_args (argc, argv) } break; case OPTION_DEBUG_DUMP: - do_dump ++; + do_dump++; if (optarg == 0) do_debugging = 1; else { - const char *debug_dump_opt[] + static const char *debug_dump_opt[] = { "line", "info", "abbrev", "pubnames", "ranges", "macro", "frames", "frames-interp", "str", "loc", NULL }; unsigned int index; @@ -2580,9 +2689,9 @@ parse_args (argc, argv) break; #ifdef SUPPORT_DISASSEMBLY case 'i': - do_dump ++; + do_dump++; section = strtoul (optarg, & cp, 0); - if (! * cp && section >= 0) + if (! *cp && section >= 0) { request_dump (section, DISASS_DUMP); break; @@ -2593,10 +2702,10 @@ parse_args (argc, argv) print_version (program_name); break; case 'V': - do_version ++; + do_version++; break; case 'W': - do_wide ++; + do_wide++; break; default: oops: @@ -2620,10 +2729,9 @@ parse_args (argc, argv) } static const char * -get_elf_class (elf_class) - unsigned int elf_class; +get_elf_class (unsigned int elf_class) { - static char buff [32]; + static char buff[32]; switch (elf_class) { @@ -2637,10 +2745,9 @@ get_elf_class (elf_class) } static const char * -get_data_encoding (encoding) - unsigned int encoding; +get_data_encoding (unsigned int encoding) { - static char buff [32]; + static char buff[32]; switch (encoding) { @@ -2653,42 +2760,15 @@ get_data_encoding (encoding) } } -static const char * -get_osabi_name (osabi) - unsigned int osabi; -{ - static char buff [32]; - - switch (osabi) - { - case ELFOSABI_NONE: return "UNIX - System V"; - case ELFOSABI_HPUX: return "UNIX - HP-UX"; - case ELFOSABI_NETBSD: return "UNIX - NetBSD"; - case ELFOSABI_LINUX: return "UNIX - Linux"; - case ELFOSABI_HURD: return "GNU/Hurd"; - case ELFOSABI_SOLARIS: return "UNIX - Solaris"; - case ELFOSABI_AIX: return "UNIX - AIX"; - case ELFOSABI_IRIX: return "UNIX - IRIX"; - case ELFOSABI_FREEBSD: return "UNIX - FreeBSD"; - case ELFOSABI_TRU64: return "UNIX - TRU64"; - case ELFOSABI_MODESTO: return "Novell - Modesto"; - case ELFOSABI_OPENBSD: return "UNIX - OpenBSD"; - case ELFOSABI_STANDALONE: return _("Standalone App"); - case ELFOSABI_ARM: return "ARM"; - default: - sprintf (buff, _(""), osabi); - return buff; - } -} - /* Decode the data held in 'elf_header'. */ + static int -process_file_header () +process_file_header (void) { - if ( elf_header.e_ident [EI_MAG0] != ELFMAG0 - || elf_header.e_ident [EI_MAG1] != ELFMAG1 - || elf_header.e_ident [EI_MAG2] != ELFMAG2 - || elf_header.e_ident [EI_MAG3] != ELFMAG3) + if ( elf_header.e_ident[EI_MAG0] != ELFMAG0 + || elf_header.e_ident[EI_MAG1] != ELFMAG1 + || elf_header.e_ident[EI_MAG2] != ELFMAG2 + || elf_header.e_ident[EI_MAG3] != ELFMAG3) { error (_("Not an ELF file - it has the wrong magic bytes at the start\n")); @@ -2701,24 +2781,24 @@ process_file_header () printf (_("ELF Header:\n")); printf (_(" Magic: ")); - for (i = 0; i < EI_NIDENT; i ++) - printf ("%2.2x ", elf_header.e_ident [i]); + for (i = 0; i < EI_NIDENT; i++) + printf ("%2.2x ", elf_header.e_ident[i]); printf ("\n"); printf (_(" Class: %s\n"), - get_elf_class (elf_header.e_ident [EI_CLASS])); + get_elf_class (elf_header.e_ident[EI_CLASS])); printf (_(" Data: %s\n"), - get_data_encoding (elf_header.e_ident [EI_DATA])); + get_data_encoding (elf_header.e_ident[EI_DATA])); printf (_(" Version: %d %s\n"), - elf_header.e_ident [EI_VERSION], - (elf_header.e_ident [EI_VERSION] == EV_CURRENT + elf_header.e_ident[EI_VERSION], + (elf_header.e_ident[EI_VERSION] == EV_CURRENT ? "(current)" - : (elf_header.e_ident [EI_VERSION] != EV_NONE + : (elf_header.e_ident[EI_VERSION] != EV_NONE ? "" : ""))); printf (_(" OS/ABI: %s\n"), - get_osabi_name (elf_header.e_ident [EI_OSABI])); + get_osabi_name (elf_header.e_ident[EI_OSABI])); printf (_(" ABI Version: %d\n"), - elf_header.e_ident [EI_ABIVERSION]); + elf_header.e_ident[EI_ABIVERSION]); printf (_(" Type: %s\n"), get_file_type (elf_header.e_type)); printf (_(" Machine: %s\n"), @@ -2772,25 +2852,22 @@ process_file_header () static int -get_32bit_program_headers (file, program_headers) - FILE * file; - Elf_Internal_Phdr * program_headers; -{ - Elf32_External_Phdr * phdrs; - Elf32_External_Phdr * external; - Elf32_Internal_Phdr * internal; - unsigned int i; - - phdrs = ((Elf32_External_Phdr *) - get_data (NULL, file, elf_header.e_phoff, - elf_header.e_phentsize * elf_header.e_phnum, - _("program headers"))); +get_32bit_program_headers (FILE *file, Elf_Internal_Phdr *program_headers) +{ + Elf32_External_Phdr *phdrs; + Elf32_External_Phdr *external; + Elf_Internal_Phdr *internal; + unsigned int i; + + phdrs = get_data (NULL, file, elf_header.e_phoff, + elf_header.e_phentsize * elf_header.e_phnum, + _("program headers")); if (!phdrs) return 0; for (i = 0, internal = program_headers, external = phdrs; i < elf_header.e_phnum; - i ++, internal ++, external ++) + i++, internal++, external++) { internal->p_type = BYTE_GET (external->p_type); internal->p_offset = BYTE_GET (external->p_offset); @@ -2808,25 +2885,22 @@ get_32bit_program_headers (file, program_headers) } static int -get_64bit_program_headers (file, program_headers) - FILE * file; - Elf_Internal_Phdr * program_headers; -{ - Elf64_External_Phdr * phdrs; - Elf64_External_Phdr * external; - Elf64_Internal_Phdr * internal; - unsigned int i; - - phdrs = ((Elf64_External_Phdr *) - get_data (NULL, file, elf_header.e_phoff, - elf_header.e_phentsize * elf_header.e_phnum, - _("program headers"))); +get_64bit_program_headers (FILE *file, Elf_Internal_Phdr *program_headers) +{ + Elf64_External_Phdr *phdrs; + Elf64_External_Phdr *external; + Elf_Internal_Phdr *internal; + unsigned int i; + + phdrs = get_data (NULL, file, elf_header.e_phoff, + elf_header.e_phentsize * elf_header.e_phnum, + _("program headers")); if (!phdrs) return 0; for (i = 0, internal = program_headers, external = phdrs; i < elf_header.e_phnum; - i ++, internal ++, external ++) + i++, internal++, external++) { internal->p_type = BYTE_GET (external->p_type); internal->p_flags = BYTE_GET (external->p_flags); @@ -2843,19 +2917,50 @@ get_64bit_program_headers (file, program_headers) return 1; } +/* Returns 1 if the program headers were read into `program_headers'. */ + +static int +get_program_headers (FILE *file) +{ + Elf_Internal_Phdr *phdrs; + + /* Check cache of prior read. */ + if (program_headers != NULL) + return 1; + + phdrs = malloc (elf_header.e_phnum * sizeof (Elf_Internal_Phdr)); + + if (phdrs == NULL) + { + error (_("Out of memory\n")); + return 0; + } + + if (is_32bit_elf + ? get_32bit_program_headers (file, phdrs) + : get_64bit_program_headers (file, phdrs)) + { + program_headers = phdrs; + return 1; + } + + free (phdrs); + return 0; +} + +/* Returns 1 if the program headers were loaded. */ + static int -process_program_headers (file) - FILE * file; +process_program_headers (FILE *file) { - Elf_Internal_Phdr * program_headers; - Elf_Internal_Phdr * segment; - unsigned int i; + Elf_Internal_Phdr *segment; + unsigned int i; if (elf_header.e_phnum == 0) { if (do_segments) printf (_("\nThere are no program headers in this file.\n")); - return 1; + return 0; } if (do_segments && !do_header) @@ -2869,25 +2974,8 @@ process_program_headers (file) printf ("\n"); } - program_headers = (Elf_Internal_Phdr *) malloc - (elf_header.e_phnum * sizeof (Elf_Internal_Phdr)); - - if (program_headers == NULL) - { - error (_("Out of memory\n")); - return 0; - } - - if (is_32bit_elf) - i = get_32bit_program_headers (file, program_headers); - else - i = get_64bit_program_headers (file, program_headers); - - if (i == 0) - { - free (program_headers); + if (! get_program_headers (file)) return 0; - } if (do_segments) { @@ -2911,13 +2999,12 @@ process_program_headers (file) } } - loadaddr = -1; dynamic_addr = 0; dynamic_size = 0; for (i = 0, segment = program_headers; i < elf_header.e_phnum; - i ++, segment ++) + i++, segment++) { if (do_segments) { @@ -2999,12 +3086,6 @@ process_program_headers (file) switch (segment->p_type) { - case PT_LOAD: - if (loadaddr == -1) - loadaddr = (segment->p_vaddr & 0xfffff000) - - (segment->p_offset & 0xfffff000); - break; - case PT_DYNAMIC: if (dynamic_addr) error (_("more than one dynamic segment\n")); @@ -3014,7 +3095,8 @@ process_program_headers (file) break; case PT_INTERP: - if (fseek (file, (long) segment->p_offset, SEEK_SET)) + if (fseek (file, archive_file_offset + (long) segment->p_offset, + SEEK_SET)) error (_("Unable to find program interpreter name\n")); else { @@ -3032,12 +3114,6 @@ process_program_headers (file) putc ('\n', stdout); } - if (loadaddr == -1) - { - /* Very strange. */ - loadaddr = 0; - } - if (do_segments && section_headers != NULL) { printf (_("\n Section to Segment mapping:\n")); @@ -3048,14 +3124,14 @@ process_program_headers (file) for (i = 0; i < elf_header.e_phnum; i++) { unsigned int j; - Elf_Internal_Shdr * section; + Elf_Internal_Shdr *section; segment = program_headers + i; section = section_headers; printf (" %2.2d ", i); - for (j = 1; j < elf_header.e_shnum; j++, section ++) + for (j = 1; j < elf_header.e_shnum; j++, section++) { if (section->sh_size > 0 /* Compare allocated sections by VMA, unallocated @@ -3074,30 +3150,54 @@ process_program_headers (file) } } - free (program_headers); - return 1; } +/* Find the file offset corresponding to VMA by using the program headers. */ + +static long +offset_from_vma (FILE *file, bfd_vma vma, bfd_size_type size) +{ + Elf_Internal_Phdr *seg; + + if (! get_program_headers (file)) + { + warn (_("Cannot interpret virtual addresses without program headers.\n")); + return (long) vma; + } + + for (seg = program_headers; + seg < program_headers + elf_header.e_phnum; + ++seg) + { + if (seg->p_type != PT_LOAD) + continue; + + if (vma >= (seg->p_vaddr & -seg->p_align) + && vma + size <= seg->p_vaddr + seg->p_filesz) + return vma - seg->p_vaddr + seg->p_offset; + } + + warn (_("Virtual address 0x%lx not located in any PT_LOAD segment.\n"), + (long) vma); + return (long) vma; +} + + static int -get_32bit_section_headers (file, num) - FILE * file; - unsigned int num; -{ - Elf32_External_Shdr * shdrs; - Elf32_Internal_Shdr * internal; - unsigned int i; - - shdrs = ((Elf32_External_Shdr *) - get_data (NULL, file, elf_header.e_shoff, - elf_header.e_shentsize * num, - _("section headers"))); +get_32bit_section_headers (FILE *file, unsigned int num) +{ + Elf32_External_Shdr *shdrs; + Elf_Internal_Shdr *internal; + unsigned int i; + + shdrs = get_data (NULL, file, elf_header.e_shoff, + elf_header.e_shentsize * num, _("section headers")); if (!shdrs) return 0; - section_headers = ((Elf_Internal_Shdr *) - malloc (num * sizeof (Elf_Internal_Shdr))); + section_headers = malloc (num * sizeof (Elf_Internal_Shdr)); if (section_headers == NULL) { @@ -3107,7 +3207,7 @@ get_32bit_section_headers (file, num) for (i = 0, internal = section_headers; i < num; - i ++, internal ++) + i++, internal++) { internal->sh_name = BYTE_GET (shdrs[i].sh_name); internal->sh_type = BYTE_GET (shdrs[i].sh_type); @@ -3127,23 +3227,18 @@ get_32bit_section_headers (file, num) } static int -get_64bit_section_headers (file, num) - FILE * file; - unsigned int num; -{ - Elf64_External_Shdr * shdrs; - Elf64_Internal_Shdr * internal; - unsigned int i; - - shdrs = ((Elf64_External_Shdr *) - get_data (NULL, file, elf_header.e_shoff, - elf_header.e_shentsize * num, - _("section headers"))); +get_64bit_section_headers (FILE *file, unsigned int num) +{ + Elf64_External_Shdr *shdrs; + Elf_Internal_Shdr *internal; + unsigned int i; + + shdrs = get_data (NULL, file, elf_header.e_shoff, + elf_header.e_shentsize * num, _("section headers")); if (!shdrs) return 0; - section_headers = ((Elf_Internal_Shdr *) - malloc (num * sizeof (Elf_Internal_Shdr))); + section_headers = malloc (num * sizeof (Elf_Internal_Shdr)); if (section_headers == NULL) { @@ -3153,7 +3248,7 @@ get_64bit_section_headers (file, num) for (i = 0, internal = section_headers; i < num; - i ++, internal ++) + i++, internal++) { internal->sh_name = BYTE_GET (shdrs[i].sh_name); internal->sh_type = BYTE_GET (shdrs[i].sh_type); @@ -3173,20 +3268,17 @@ get_64bit_section_headers (file, num) } static Elf_Internal_Sym * -get_32bit_elf_symbols (file, section) - FILE * file; - Elf_Internal_Shdr *section; +get_32bit_elf_symbols (FILE *file, Elf_Internal_Shdr *section) { unsigned long number; - Elf32_External_Sym * esyms; + Elf32_External_Sym *esyms; Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym * isyms; - Elf_Internal_Sym * psym; - unsigned int j; + Elf_Internal_Sym *isyms; + Elf_Internal_Sym *psym; + unsigned int j; - esyms = ((Elf32_External_Sym *) - get_data (NULL, file, section->sh_offset, - section->sh_size, _("symbols"))); + esyms = get_data (NULL, file, section->sh_offset, section->sh_size, + _("symbols")); if (!esyms) return NULL; @@ -3195,9 +3287,8 @@ get_32bit_elf_symbols (file, section) && (symtab_shndx_hdr->sh_link == (unsigned long) SECTION_HEADER_NUM (section - section_headers))) { - shndx = ((Elf_External_Sym_Shndx *) - get_data (NULL, file, symtab_shndx_hdr->sh_offset, - symtab_shndx_hdr->sh_size, _("symtab shndx"))); + shndx = get_data (NULL, file, symtab_shndx_hdr->sh_offset, + symtab_shndx_hdr->sh_size, _("symtab shndx")); if (!shndx) { free (esyms); @@ -3206,7 +3297,7 @@ get_32bit_elf_symbols (file, section) } number = section->sh_size / section->sh_entsize; - isyms = (Elf_Internal_Sym *) malloc (number * sizeof (Elf_Internal_Sym)); + isyms = malloc (number * sizeof (Elf_Internal_Sym)); if (isyms == NULL) { @@ -3219,7 +3310,7 @@ get_32bit_elf_symbols (file, section) for (j = 0, psym = isyms; j < number; - j ++, psym ++) + j++, psym++) { psym->st_name = BYTE_GET (esyms[j].st_name); psym->st_value = BYTE_GET (esyms[j].st_value); @@ -3240,20 +3331,17 @@ get_32bit_elf_symbols (file, section) } static Elf_Internal_Sym * -get_64bit_elf_symbols (file, section) - FILE * file; - Elf_Internal_Shdr *section; +get_64bit_elf_symbols (FILE *file, Elf_Internal_Shdr *section) { unsigned long number; - Elf64_External_Sym * esyms; + Elf64_External_Sym *esyms; Elf_External_Sym_Shndx *shndx; - Elf_Internal_Sym * isyms; - Elf_Internal_Sym * psym; - unsigned int j; + Elf_Internal_Sym *isyms; + Elf_Internal_Sym *psym; + unsigned int j; - esyms = ((Elf64_External_Sym *) - get_data (NULL, file, section->sh_offset, - section->sh_size, _("symbols"))); + esyms = get_data (NULL, file, section->sh_offset, section->sh_size, + _("symbols")); if (!esyms) return NULL; @@ -3262,9 +3350,8 @@ get_64bit_elf_symbols (file, section) && (symtab_shndx_hdr->sh_link == (unsigned long) SECTION_HEADER_NUM (section - section_headers))) { - shndx = ((Elf_External_Sym_Shndx *) - get_data (NULL, file, symtab_shndx_hdr->sh_offset, - symtab_shndx_hdr->sh_size, _("symtab shndx"))); + shndx = get_data (NULL, file, symtab_shndx_hdr->sh_offset, + symtab_shndx_hdr->sh_size, _("symtab shndx")); if (!shndx) { free (esyms); @@ -3273,7 +3360,7 @@ get_64bit_elf_symbols (file, section) } number = section->sh_size / section->sh_entsize; - isyms = (Elf_Internal_Sym *) malloc (number * sizeof (Elf_Internal_Sym)); + isyms = malloc (number * sizeof (Elf_Internal_Sym)); if (isyms == NULL) { @@ -3286,7 +3373,7 @@ get_64bit_elf_symbols (file, section) for (j = 0, psym = isyms; j < number; - j ++, psym ++) + j++, psym++) { psym->st_name = BYTE_GET (esyms[j].st_name); psym->st_info = BYTE_GET (esyms[j].st_info); @@ -3307,12 +3394,11 @@ get_64bit_elf_symbols (file, section) } static const char * -get_elf_section_flags (sh_flags) - bfd_vma sh_flags; +get_elf_section_flags (bfd_vma sh_flags) { - static char buff [32]; + static char buff[32]; - * buff = 0; + *buff = 0; while (sh_flags) { @@ -3323,15 +3409,15 @@ get_elf_section_flags (sh_flags) switch (flag) { - case SHF_WRITE: strcat (buff, "W"); break; - case SHF_ALLOC: strcat (buff, "A"); break; - case SHF_EXECINSTR: strcat (buff, "X"); break; - case SHF_MERGE: strcat (buff, "M"); break; - case SHF_STRINGS: strcat (buff, "S"); break; - case SHF_INFO_LINK: strcat (buff, "I"); break; - case SHF_LINK_ORDER: strcat (buff, "L"); break; + case SHF_WRITE: strcat (buff, "W"); break; + case SHF_ALLOC: strcat (buff, "A"); break; + case SHF_EXECINSTR: strcat (buff, "X"); break; + case SHF_MERGE: strcat (buff, "M"); break; + case SHF_STRINGS: strcat (buff, "S"); break; + 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; + case SHF_GROUP: strcat (buff, "G"); break; case SHF_TLS: strcat (buff, "T"); break; default: @@ -3355,11 +3441,10 @@ get_elf_section_flags (sh_flags) } static int -process_section_headers (file) - FILE * file; +process_section_headers (FILE *file) { - Elf_Internal_Shdr * section; - unsigned int i; + Elf_Internal_Shdr *section; + unsigned int i; section_headers = NULL; @@ -3388,8 +3473,11 @@ process_section_headers (file) if (section->sh_size != 0) { - string_table = (char *) get_data (NULL, file, section->sh_offset, - section->sh_size, _("string table")); + string_table = get_data (NULL, file, section->sh_offset, + section->sh_size, _("string table")); + + if (string_table == NULL) + return 0; string_table_length = section->sh_size; } @@ -3399,12 +3487,13 @@ process_section_headers (file) dynamic_symbols = NULL; dynamic_strings = NULL; dynamic_syminfo = NULL; + symtab_shndx_hdr = NULL; for (i = 0, section = section_headers; i < elf_header.e_shnum; - i ++, section ++) + i++, section++) { - char * name = SECTION_NAME (section); + char *name = SECTION_NAME (section); if (section->sh_type == SHT_DYNSYM) { @@ -3426,9 +3515,8 @@ process_section_headers (file) continue; } - dynamic_strings = (char *) get_data (NULL, file, section->sh_offset, - section->sh_size, - _("dynamic strings")); + dynamic_strings = get_data (NULL, file, section->sh_offset, + section->sh_size, _("dynamic strings")); } else if (section->sh_type == SHT_SYMTAB_SHNDX) { @@ -3490,7 +3578,7 @@ process_section_headers (file) for (i = 0, section = section_headers; i < elf_header.e_shnum; - i ++, section ++) + i++, section++) { printf (" [%2u] %-17.17s %-15.15s ", SECTION_HEADER_NUM (i), @@ -3588,13 +3676,25 @@ process_section_headers (file) return 1; } +struct +{ + const char *name; + int reloc; + int size; + int rela; +} dynamic_relocations [] = +{ + { "REL", DT_REL, DT_RELSZ, FALSE }, + { "RELA", DT_RELA, DT_RELASZ, TRUE }, + { "PLT", DT_JMPREL, DT_PLTRELSZ, UNKNOWN } +}; + /* Process the reloc section. */ static int -process_relocs (file) - FILE * file; +process_relocs (FILE *file) { - unsigned long rel_size; - unsigned long rel_offset; + unsigned long rel_size; + unsigned long rel_offset; if (!do_reloc) @@ -3602,63 +3702,62 @@ process_relocs (file) if (do_using_dynamic) { - int is_rela = FALSE; + int is_rela; + const char *name; + int has_dynamic_reloc; + unsigned int i; - rel_size = 0; - rel_offset = 0; + has_dynamic_reloc = 0; - if (dynamic_info[DT_REL]) - { - rel_offset = dynamic_info[DT_REL]; - rel_size = dynamic_info[DT_RELSZ]; - is_rela = FALSE; - } - else if (dynamic_info [DT_RELA]) - { - rel_offset = dynamic_info[DT_RELA]; - rel_size = dynamic_info[DT_RELASZ]; - is_rela = TRUE; - } - else if (dynamic_info[DT_JMPREL]) + for (i = 0; i < ARRAY_SIZE (dynamic_relocations); i++) { - rel_offset = dynamic_info[DT_JMPREL]; - rel_size = dynamic_info[DT_PLTRELSZ]; + is_rela = dynamic_relocations [i].rela; + name = dynamic_relocations [i].name; + rel_size = dynamic_info [dynamic_relocations [i].size]; + rel_offset = dynamic_info [dynamic_relocations [i].reloc]; - switch (dynamic_info[DT_PLTREL]) + has_dynamic_reloc |= rel_size; + + if (is_rela == UNKNOWN) { - case DT_REL: - is_rela = FALSE; - break; - case DT_RELA: - is_rela = TRUE; - break; - default: - is_rela = UNKNOWN; - break; + if (dynamic_relocations [i].reloc == DT_JMPREL) + switch (dynamic_info[DT_PLTREL]) + { + case DT_REL: + is_rela = FALSE; + break; + case DT_RELA: + is_rela = TRUE; + break; + } } - } - if (rel_size) - { - printf - (_("\nRelocation section at offset 0x%lx contains %ld bytes:\n"), - rel_offset, rel_size); - - dump_relocations (file, rel_offset - loadaddr, rel_size, - dynamic_symbols, num_dynamic_syms, dynamic_strings, is_rela); + if (rel_size) + { + printf + (_("\n'%s' relocation section at offset 0x%lx contains %ld bytes:\n"), + name, rel_offset, rel_size); + + dump_relocations (file, + offset_from_vma (file, rel_offset, rel_size), + rel_size, + dynamic_symbols, num_dynamic_syms, + dynamic_strings, is_rela); + } } - else + + if (! has_dynamic_reloc) printf (_("\nThere are no dynamic relocations in this file.\n")); } else { - Elf32_Internal_Shdr * section; - unsigned long i; - int found = 0; + Elf_Internal_Shdr *section; + unsigned long i; + int found = 0; for (i = 0, section = section_headers; i < elf_header.e_shnum; - i++, section ++) + i++, section++) { if ( section->sh_type != SHT_RELA && section->sh_type != SHT_REL) @@ -3669,11 +3768,11 @@ process_relocs (file) if (rel_size) { - Elf32_Internal_Shdr * strsec; - Elf_Internal_Sym * symtab; - char * strtab; - int is_rela; - unsigned long nsyms; + Elf_Internal_Shdr *strsec; + Elf_Internal_Sym *symtab; + char *strtab; + int is_rela; + unsigned long nsyms; printf (_("\nRelocation section ")); @@ -3690,7 +3789,7 @@ process_relocs (file) nsyms = 0; if (section->sh_link) { - Elf32_Internal_Shdr * symsec; + Elf_Internal_Shdr *symsec; symsec = SECTION_HEADER (section->sh_link); nsyms = symsec->sh_size / symsec->sh_entsize; @@ -3701,9 +3800,8 @@ process_relocs (file) strsec = SECTION_HEADER (symsec->sh_link); - strtab = (char *) get_data (NULL, file, strsec->sh_offset, - strsec->sh_size, - _("string table")); + strtab = get_data (NULL, file, strsec->sh_offset, + strsec->sh_size, _("string table")); } is_rela = section->sh_type == SHT_RELA; @@ -3742,37 +3840,29 @@ struct unw_aux_info { struct unw_table_entry { - struct absaddr start; - struct absaddr end; - struct absaddr info; + struct absaddr start; + struct absaddr end; + struct absaddr info; } - *table; /* Unwind table. */ - unsigned long table_len; /* Length of unwind table. */ - unsigned char * info; /* Unwind info. */ - unsigned long info_size; /* Size of unwind info. */ - bfd_vma info_addr; /* starting address of unwind info. */ - bfd_vma seg_base; /* Starting address of segment. */ - Elf_Internal_Sym * symtab; /* The symbol table. */ - unsigned long nsyms; /* Number of symbols. */ - char * strtab; /* The string table. */ - unsigned long strtab_size; /* Size of string table. */ + *table; /* Unwind table. */ + unsigned long table_len; /* Length of unwind table. */ + unsigned char *info; /* Unwind info. */ + unsigned long info_size; /* Size of unwind info. */ + bfd_vma info_addr; /* starting address of unwind info. */ + bfd_vma seg_base; /* Starting address of segment. */ + Elf_Internal_Sym *symtab; /* The symbol table. */ + unsigned long nsyms; /* Number of symbols. */ + char *strtab; /* The string table. */ + unsigned long strtab_size; /* Size of string table. */ }; -static void find_symbol_for_address PARAMS ((struct unw_aux_info *, - struct absaddr, const char **, - bfd_vma *)); -static void dump_ia64_unwind PARAMS ((struct unw_aux_info *)); -static int slurp_ia64_unwind_table PARAMS ((FILE *, struct unw_aux_info *, - Elf32_Internal_Shdr *)); - static void -find_symbol_for_address (aux, addr, symname, offset) - struct unw_aux_info *aux; - struct absaddr addr; - const char **symname; - bfd_vma *offset; +find_symbol_for_address (struct unw_aux_info *aux, + struct absaddr addr, + const char **symname, + bfd_vma *offset) { - bfd_vma dist = (bfd_vma) 0x100000; + bfd_vma dist = 0x100000; Elf_Internal_Sym *sym, *best = NULL; unsigned long i; @@ -3802,11 +3892,10 @@ find_symbol_for_address (aux, addr, symname, offset) } static void -dump_ia64_unwind (aux) - struct unw_aux_info *aux; +dump_ia64_unwind (struct unw_aux_info *aux) { bfd_vma addr_size; - struct unw_table_entry * tp; + struct unw_table_entry *tp; int in_body; addr_size = is_32bit_elf ? 4 : 8; @@ -3815,9 +3904,9 @@ dump_ia64_unwind (aux) { bfd_vma stamp; bfd_vma offset; - const unsigned char * dp; - const unsigned char * head; - const char * procname; + const unsigned char *dp; + const unsigned char *head; + const char *procname; find_symbol_for_address (aux, tp->start, &procname, &offset); @@ -3835,13 +3924,13 @@ dump_ia64_unwind (aux) print_vma (tp->start.offset, PREFIX_HEX); fputc ('-', stdout); print_vma (tp->end.offset, PREFIX_HEX); - printf ("), info at +0x%lx\n", + printf ("], info at +0x%lx\n", (unsigned long) (tp->info.offset - aux->seg_base)); head = aux->info + (tp->info.offset - aux->info_addr); stamp = BYTE_GET8 ((unsigned char *) head); - printf (" v%u, flags=0x%lx (%s%s ), len=%lu bytes\n", + printf (" v%u, flags=0x%lx (%s%s), len=%lu bytes\n", (unsigned) UNW_VER (stamp), (unsigned long) ((stamp & UNW_FLAG_MASK) >> 32), UNW_FLAG_EHANDLER (stamp) ? " ehandler" : "", @@ -3861,20 +3950,18 @@ dump_ia64_unwind (aux) } static int -slurp_ia64_unwind_table (file, aux, sec) - FILE *file; - struct unw_aux_info *aux; - Elf32_Internal_Shdr *sec; +slurp_ia64_unwind_table (FILE *file, + struct unw_aux_info *aux, + Elf_Internal_Shdr *sec) { unsigned long size, addr_size, nrelas, i; - Elf_Internal_Phdr *prog_hdrs, *seg; + Elf_Internal_Phdr *seg; struct unw_table_entry *tep; - Elf32_Internal_Shdr *relsec; + Elf_Internal_Shdr *relsec; Elf_Internal_Rela *rela, *rp; unsigned char *table, *tp; Elf_Internal_Sym *sym; const char *relname; - int result; addr_size = is_32bit_elf ? 4 : 8; @@ -3883,21 +3970,12 @@ slurp_ia64_unwind_table (file, aux, sec) if (elf_header.e_phnum) { - prog_hdrs = (Elf_Internal_Phdr *) - xmalloc (elf_header.e_phnum * sizeof (Elf_Internal_Phdr)); - - if (is_32bit_elf) - result = get_32bit_program_headers (file, prog_hdrs); - else - result = get_64bit_program_headers (file, prog_hdrs); - - if (!result) - { - free (prog_hdrs); + if (! get_program_headers (file)) return 0; - } - for (seg = prog_hdrs; seg < prog_hdrs + elf_header.e_phnum; ++seg) + for (seg = program_headers; + seg < program_headers + elf_header.e_phnum; + ++seg) { if (seg->p_type != PT_LOAD) continue; @@ -3909,19 +3987,16 @@ slurp_ia64_unwind_table (file, aux, sec) break; } } - - free (prog_hdrs); } /* Second, build the unwind table from the contents of the unwind section: */ size = sec->sh_size; - table = (char *) get_data (NULL, file, sec->sh_offset, - size, _("unwind table")); + table = get_data (NULL, file, sec->sh_offset, size, _("unwind table")); if (!table) return 0; tep = aux->table = xmalloc (size / (3 * addr_size) * sizeof (aux->table[0])); - for (tp = table; tp < table + size; tp += 3 * addr_size, ++ tep) + for (tp = table; tp < table + size; tp += 3 * addr_size, ++tep) { tep->start.section = SHN_UNDEF; tep->end.section = SHN_UNDEF; @@ -4020,10 +4095,9 @@ slurp_ia64_unwind_table (file, aux, sec) } static int -process_unwind (file) - FILE * file; +process_unwind (FILE *file) { - Elf32_Internal_Shdr *sec, *unwsec = NULL, *strsec; + Elf_Internal_Shdr *sec, *unwsec = NULL, *strsec; unsigned long i, addr_size, unwcount = 0, unwstart = 0; struct unw_aux_info aux; @@ -4049,8 +4123,8 @@ process_unwind (file) strsec = SECTION_HEADER (sec->sh_link); aux.strtab_size = strsec->sh_size; - aux.strtab = (char *) get_data (NULL, file, strsec->sh_offset, - aux.strtab_size, _("string table")); + aux.strtab = get_data (NULL, file, strsec->sh_offset, + aux.strtab_size, _("string table")); } else if (sec->sh_type == SHT_IA_64_UNWIND) unwcount++; @@ -4119,8 +4193,8 @@ process_unwind (file) { aux.info_size = sec->sh_size; aux.info_addr = sec->sh_addr; - aux.info = (char *) get_data (NULL, file, sec->sh_offset, - aux.info_size, _("unwind info")); + aux.info = get_data (NULL, file, sec->sh_offset, aux.info_size, + _("unwind info")); printf (_("\nUnwind section ")); @@ -4156,8 +4230,7 @@ process_unwind (file) } static void -dynamic_segment_mips_val (entry) - Elf_Internal_Dyn * entry; +dynamic_segment_mips_val (Elf_Internal_Dyn *entry) { switch (entry->d_tag) { @@ -4176,7 +4249,7 @@ dynamic_segment_mips_val (entry) }; unsigned int cnt; int first = 1; - for (cnt = 0; cnt < NUM_ELEM (opts); ++ cnt) + for (cnt = 0; cnt < NUM_ELEM (opts); ++cnt) if (entry->d_un.d_val & (1 << cnt)) { printf ("%s%s", first ? "" : " ", opts[cnt]); @@ -4197,7 +4270,7 @@ dynamic_segment_mips_val (entry) case DT_MIPS_TIME_STAMP: { char timebuf[20]; - struct tm * tmp; + struct tm *tmp; time_t time = entry->d_un.d_val; tmp = gmtime (&time); @@ -4231,8 +4304,7 @@ dynamic_segment_mips_val (entry) static void -dynamic_segment_parisc_val (entry) - Elf_Internal_Dyn * entry; +dynamic_segment_parisc_val (Elf_Internal_Dyn *entry) { switch (entry->d_tag) { @@ -4241,7 +4313,7 @@ dynamic_segment_parisc_val (entry) static struct { long int bit; - const char * str; + const char *str; } flags[] = { @@ -4284,18 +4356,37 @@ dynamic_segment_parisc_val (entry) print_vma (entry->d_un.d_ptr, PREFIX_HEX); break; } + putchar ('\n'); +} + +static void +dynamic_segment_ia64_val (Elf_Internal_Dyn *entry) +{ + switch (entry->d_tag) + { + case DT_IA_64_PLT_RESERVE: + /* First 3 slots reserved. */ + print_vma (entry->d_un.d_ptr, PREFIX_HEX); + printf (" -- "); + print_vma (entry->d_un.d_ptr + (3 * 8), PREFIX_HEX); + break; + + default: + print_vma (entry->d_un.d_ptr, PREFIX_HEX); + break; + } + putchar ('\n'); } static int -get_32bit_dynamic_segment (file) - FILE * file; +get_32bit_dynamic_segment (FILE *file) { - Elf32_External_Dyn * edyn; - Elf_Internal_Dyn * entry; - bfd_size_type i; + Elf32_External_Dyn *edyn; + Elf_Internal_Dyn *entry; + bfd_size_type i; - edyn = (Elf32_External_Dyn *) get_data (NULL, file, dynamic_addr, - dynamic_size, _("dynamic segment")); + edyn = get_data (NULL, file, dynamic_addr, dynamic_size, + _("dynamic segment")); if (!edyn) return 0; @@ -4303,11 +4394,10 @@ get_32bit_dynamic_segment (file) how large this .dynamic is now. We can do this even before the byte swapping since the DT_NULL tag is recognizable. */ dynamic_size = 0; - while (*(Elf32_Word *) edyn [dynamic_size++].d_tag != DT_NULL) + while (*(Elf32_Word *) edyn[dynamic_size++].d_tag != DT_NULL) ; - dynamic_segment = (Elf_Internal_Dyn *) - malloc (dynamic_size * sizeof (Elf_Internal_Dyn)); + dynamic_segment = malloc (dynamic_size * sizeof (Elf_Internal_Dyn)); if (dynamic_segment == NULL) { @@ -4318,10 +4408,10 @@ get_32bit_dynamic_segment (file) for (i = 0, entry = dynamic_segment; i < dynamic_size; - i ++, entry ++) + i++, entry++) { - entry->d_tag = BYTE_GET (edyn [i].d_tag); - entry->d_un.d_val = BYTE_GET (edyn [i].d_un.d_val); + entry->d_tag = BYTE_GET (edyn[i].d_tag); + entry->d_un.d_val = BYTE_GET (edyn[i].d_un.d_val); } free (edyn); @@ -4330,15 +4420,14 @@ get_32bit_dynamic_segment (file) } static int -get_64bit_dynamic_segment (file) - FILE * file; +get_64bit_dynamic_segment (FILE *file) { - Elf64_External_Dyn * edyn; - Elf_Internal_Dyn * entry; - bfd_size_type i; + Elf64_External_Dyn *edyn; + Elf_Internal_Dyn *entry; + bfd_size_type i; - edyn = (Elf64_External_Dyn *) get_data (NULL, file, dynamic_addr, - dynamic_size, _("dynamic segment")); + edyn = get_data (NULL, file, dynamic_addr, dynamic_size, + _("dynamic segment")); if (!edyn) return 0; @@ -4346,11 +4435,10 @@ get_64bit_dynamic_segment (file) how large this .dynamic is now. We can do this even before the byte swapping since the DT_NULL tag is recognizable. */ dynamic_size = 0; - while (*(bfd_vma *) edyn [dynamic_size ++].d_tag != DT_NULL) + while (*(bfd_vma *) edyn[dynamic_size++].d_tag != DT_NULL) ; - dynamic_segment = (Elf_Internal_Dyn *) - malloc (dynamic_size * sizeof (Elf_Internal_Dyn)); + dynamic_segment = malloc (dynamic_size * sizeof (Elf_Internal_Dyn)); if (dynamic_segment == NULL) { @@ -4361,10 +4449,10 @@ get_64bit_dynamic_segment (file) for (i = 0, entry = dynamic_segment; i < dynamic_size; - i ++, entry ++) + i++, entry++) { - entry->d_tag = BYTE_GET8 (edyn [i].d_tag); - entry->d_un.d_val = BYTE_GET8 (edyn [i].d_un.d_val); + entry->d_tag = BYTE_GET8 (edyn[i].d_tag); + entry->d_un.d_val = BYTE_GET8 (edyn[i].d_un.d_val); } free (edyn); @@ -4373,10 +4461,9 @@ get_64bit_dynamic_segment (file) } static const char * -get_dynamic_flags (flags) - bfd_vma flags; +get_dynamic_flags (bfd_vma flags) { - static char buff [128]; + static char buff[128]; char *p = buff; *p = '\0'; @@ -4392,12 +4479,12 @@ get_dynamic_flags (flags) switch (flag) { - case DF_ORIGIN: strcpy (p, "ORIGIN"); break; - case DF_SYMBOLIC: strcpy (p, "SYMBOLIC"); break; - case DF_TEXTREL: strcpy (p, "TEXTREL"); break; - case DF_BIND_NOW: strcpy (p, "BIND_NOW"); break; - case DF_STATIC_TLS: strcpy (p, "STATIC_TLS"); break; - default: strcpy (p, "unknown"); break; + case DF_ORIGIN: strcpy (p, "ORIGIN"); break; + case DF_SYMBOLIC: strcpy (p, "SYMBOLIC"); break; + case DF_TEXTREL: strcpy (p, "TEXTREL"); break; + case DF_BIND_NOW: strcpy (p, "BIND_NOW"); break; + case DF_STATIC_TLS: strcpy (p, "STATIC_TLS"); break; + default: strcpy (p, "unknown"); break; } p = strchr (p, '\0'); @@ -4407,11 +4494,10 @@ get_dynamic_flags (flags) /* Parse and display the contents of the dynamic segment. */ static int -process_dynamic_segment (file) - FILE * file; +process_dynamic_segment (FILE *file) { - Elf_Internal_Dyn * entry; - bfd_size_type i; + Elf_Internal_Dyn *entry; + bfd_size_type i; if (dynamic_size == 0) { @@ -4434,9 +4520,9 @@ process_dynamic_segment (file) { for (i = 0, entry = dynamic_segment; i < dynamic_size; - ++i, ++ entry) + ++i, ++entry) { - Elf32_Internal_Shdr section; + Elf_Internal_Shdr section; if (entry->d_tag != DT_SYMTAB) continue; @@ -4447,12 +4533,18 @@ process_dynamic_segment (file) we default to reading in the entire file (!) and processing that. This is overkill, I know, but it should work. */ - section.sh_offset = entry->d_un.d_val - loadaddr; + section.sh_offset = offset_from_vma (file, entry->d_un.d_val, 0); + + if (archive_file_offset != 0) + section.sh_size = archive_file_size - section.sh_offset; + else + { + if (fseek (file, 0, SEEK_END)) + error (_("Unable to seek to end of file!")); - if (fseek (file, 0, SEEK_END)) - error (_("Unable to seek to end of file!")); + section.sh_size = ftell (file) - section.sh_offset; + } - section.sh_size = ftell (file) - section.sh_offset; if (is_32bit_elf) section.sh_entsize = sizeof (Elf32_External_Sym); else @@ -4474,10 +4566,10 @@ process_dynamic_segment (file) { for (i = 0, entry = dynamic_segment; i < dynamic_size; - ++i, ++ entry) + ++i, ++entry) { unsigned long offset; - long str_tab_len; + long str_tab_len; if (entry->d_tag != DT_STRTAB) continue; @@ -4489,10 +4581,16 @@ process_dynamic_segment (file) processing that. This is overkill, I know, but it should work. */ - offset = entry->d_un.d_val - loadaddr; - if (fseek (file, 0, SEEK_END)) - error (_("Unable to seek to end of file\n")); - str_tab_len = ftell (file) - offset; + offset = offset_from_vma (file, entry->d_un.d_val, 0); + + if (archive_file_offset != 0) + str_tab_len = archive_file_size - offset; + else + { + if (fseek (file, 0, SEEK_END)) + error (_("Unable to seek to end of file\n")); + str_tab_len = ftell (file) - offset; + } if (str_tab_len < 1) { @@ -4501,8 +4599,8 @@ process_dynamic_segment (file) continue; } - dynamic_strings = (char *) get_data (NULL, file, offset, str_tab_len, - _("dynamic string table")); + dynamic_strings = get_data (NULL, file, offset, str_tab_len, + _("dynamic string table")); break; } } @@ -4510,11 +4608,11 @@ process_dynamic_segment (file) /* And find the syminfo section if available. */ if (dynamic_syminfo == NULL) { - unsigned int syminsz = 0; + unsigned long syminsz = 0; for (i = 0, entry = dynamic_segment; i < dynamic_size; - ++i, ++ entry) + ++i, ++entry) { if (entry->d_tag == DT_SYMINENT) { @@ -4525,22 +4623,22 @@ process_dynamic_segment (file) else if (entry->d_tag == DT_SYMINSZ) syminsz = entry->d_un.d_val; else if (entry->d_tag == DT_SYMINFO) - dynamic_syminfo_offset = entry->d_un.d_val - loadaddr; + dynamic_syminfo_offset = offset_from_vma (file, entry->d_un.d_val, + syminsz); } if (dynamic_syminfo_offset != 0 && syminsz != 0) { - Elf_External_Syminfo * extsyminfo; - Elf_Internal_Syminfo * syminfo; + Elf_External_Syminfo *extsyminfo; + Elf_Internal_Syminfo *syminfo; /* There is a syminfo section. Read the data. */ - extsyminfo = ((Elf_External_Syminfo *) - get_data (NULL, file, dynamic_syminfo_offset, - syminsz, _("symbol information"))); + extsyminfo = get_data (NULL, file, dynamic_syminfo_offset, syminsz, + _("symbol information")); if (!extsyminfo) return 0; - dynamic_syminfo = (Elf_Internal_Syminfo *) malloc (syminsz); + dynamic_syminfo = malloc (syminsz); if (dynamic_syminfo == NULL) { error (_("Out of memory\n")); @@ -4560,18 +4658,18 @@ process_dynamic_segment (file) } if (do_dynamic && dynamic_addr) - printf (_("\nDynamic segment at offset 0x%x contains %ld entries:\n"), + printf (_("\nDynamic segment at offset 0x%lx contains %ld entries:\n"), dynamic_addr, (long) dynamic_size); if (do_dynamic) printf (_(" Tag Type Name/Value\n")); for (i = 0, entry = dynamic_segment; i < dynamic_size; - i++, entry ++) + i++, entry++) { if (do_dynamic) { - const char * dtype; + const char *dtype; putchar (' '); print_vma (entry->d_tag, FULL_HEX); @@ -4597,7 +4695,7 @@ process_dynamic_segment (file) if (do_dynamic) { switch (entry->d_tag) - { + { case DT_AUXILIARY: printf (_("Auxiliary library")); break; @@ -4606,7 +4704,7 @@ process_dynamic_segment (file) printf (_("Filter library")); break; - case DT_CONFIG: + case DT_CONFIG: printf (_("Configuration file")); break; @@ -4634,11 +4732,13 @@ process_dynamic_segment (file) if (do_dynamic) { printf (_("Flags:")); + if (entry->d_un.d_val == 0) printf (_(" None\n")); else { unsigned long int val = entry->d_un.d_val; + if (val & DTF_1_PARINIT) { printf (" PARINIT"); @@ -4660,11 +4760,13 @@ process_dynamic_segment (file) if (do_dynamic) { printf (_("Flags:")); + if (entry->d_un.d_val == 0) printf (_(" None\n")); else { unsigned long int val = entry->d_un.d_val; + if (val & DF_P1_LAZYLOAD) { printf (" LAZYLOAD"); @@ -4691,6 +4793,7 @@ process_dynamic_segment (file) else { unsigned long int val = entry->d_un.d_val; + if (val & DF_1_NOW) { printf (" NOW"); @@ -4769,6 +4872,7 @@ process_dynamic_segment (file) break; case DT_PLTREL: + dynamic_info[entry->d_tag] = entry->d_un.d_val; if (do_dynamic) puts (get_dynamic_type (entry->d_un.d_val)); break; @@ -4794,7 +4898,7 @@ process_dynamic_segment (file) if (do_dynamic) { - char * name; + char *name; if (dynamic_strings == NULL) name = NULL; @@ -4843,6 +4947,7 @@ process_dynamic_segment (file) case DT_RELAENT : case DT_SYMENT : case DT_RELENT : + dynamic_info[entry->d_tag] = entry->d_un.d_val; case DT_PLTPADSZ: case DT_MOVEENT : case DT_MOVESZ : @@ -4878,11 +4983,11 @@ process_dynamic_segment (file) { if (dynamic_strings != NULL && entry->d_tag == DT_USED) { - char * name; + char *name; name = dynamic_strings + entry->d_un.d_val; - if (* name) + if (*name) { printf (_("Not needed object: [%s]\n"), name); break; @@ -4896,12 +5001,14 @@ process_dynamic_segment (file) case DT_BIND_NOW: /* The value of this entry is ignored. */ + if (do_dynamic) + putchar ('\n'); break; case DT_GNU_PRELINKED: if (do_dynamic) { - struct tm * tmp; + struct tm *tmp; time_t time = entry->d_un.d_val; tmp = gmtime (&time); @@ -4914,7 +5021,7 @@ process_dynamic_segment (file) default: if ((entry->d_tag >= DT_VERSYM) && (entry->d_tag <= DT_VERNEEDNUM)) - version_info [DT_VERSIONTAGIDX (entry->d_tag)] = + version_info[DT_VERSIONTAGIDX (entry->d_tag)] = entry->d_un.d_val; if (do_dynamic) @@ -4928,6 +5035,9 @@ process_dynamic_segment (file) case EM_PARISC: dynamic_segment_parisc_val (entry); break; + case EM_IA_64: + dynamic_segment_ia64_val (entry); + break; default: print_vma (entry->d_un.d_val, PREFIX_HEX); putchar ('\n'); @@ -4941,10 +5051,9 @@ process_dynamic_segment (file) } static char * -get_ver_flags (flags) - unsigned int flags; +get_ver_flags (unsigned int flags) { - static char buff [32]; + static char buff[32]; buff[0] = 0; @@ -4970,27 +5079,26 @@ get_ver_flags (flags) /* Display the contents of the version sections. */ static int -process_version_sections (file) - FILE * file; +process_version_sections (FILE *file) { - Elf32_Internal_Shdr * section; - unsigned i; - int found = 0; + Elf_Internal_Shdr *section; + unsigned i; + int found = 0; if (! do_version) return 1; for (i = 0, section = section_headers; i < elf_header.e_shnum; - i++, section ++) + i++, section++) { switch (section->sh_type) { case SHT_GNU_verdef: { - Elf_External_Verdef * edefs; - unsigned int idx; - unsigned int cnt; + Elf_External_Verdef *edefs; + unsigned int idx; + unsigned int cnt; found = 1; @@ -5004,22 +5112,20 @@ process_version_sections (file) (unsigned long) section->sh_offset, section->sh_link, SECTION_NAME (SECTION_HEADER (section->sh_link))); - edefs = ((Elf_External_Verdef *) - get_data (NULL, file, section->sh_offset, - section->sh_size, - _("version definition section"))); + edefs = get_data (NULL, file, section->sh_offset, section->sh_size, + _("version definition section")); if (!edefs) break; - for (idx = cnt = 0; cnt < section->sh_info; ++ cnt) + for (idx = cnt = 0; cnt < section->sh_info; ++cnt) { - char * vstart; - Elf_External_Verdef * edef; - Elf_Internal_Verdef ent; - Elf_External_Verdaux * eaux; - Elf_Internal_Verdaux aux; - int j; - int isum; + char *vstart; + Elf_External_Verdef *edef; + Elf_Internal_Verdef ent; + Elf_External_Verdaux *eaux; + Elf_Internal_Verdaux aux; + int j; + int isum; vstart = ((char *) edefs) + idx; @@ -5053,7 +5159,7 @@ process_version_sections (file) isum = idx + ent.vd_aux; - for (j = 1; j < ent.vd_cnt; j ++) + for (j = 1; j < ent.vd_cnt; j++) { isum += aux.vda_next; vstart += aux.vda_next; @@ -5080,9 +5186,9 @@ process_version_sections (file) case SHT_GNU_verneed: { - Elf_External_Verneed * eneed; - unsigned int idx; - unsigned int cnt; + Elf_External_Verneed *eneed; + unsigned int idx; + unsigned int cnt; found = 1; @@ -5095,19 +5201,18 @@ process_version_sections (file) (unsigned long) section->sh_offset, section->sh_link, SECTION_NAME (SECTION_HEADER (section->sh_link))); - eneed = ((Elf_External_Verneed *) - get_data (NULL, file, section->sh_offset, - section->sh_size, _("version need section"))); + eneed = get_data (NULL, file, section->sh_offset, section->sh_size, + _("version need section")); if (!eneed) break; for (idx = cnt = 0; cnt < section->sh_info; ++cnt) { - Elf_External_Verneed * entry; - Elf_Internal_Verneed ent; - int j; - int isum; - char * vstart; + Elf_External_Verneed *entry; + Elf_Internal_Verneed ent; + int j; + int isum; + char *vstart; vstart = ((char *) eneed) + idx; @@ -5132,8 +5237,8 @@ process_version_sections (file) for (j = 0, isum = idx + ent.vn_aux; j < ent.vn_cnt; ++j) { - Elf_External_Vernaux * eaux; - Elf_Internal_Vernaux aux; + Elf_External_Vernaux *eaux; + Elf_Internal_Vernaux aux; eaux = (Elf_External_Vernaux *) vstart; @@ -5144,10 +5249,10 @@ process_version_sections (file) aux.vna_next = BYTE_GET (eaux->vna_next); if (dynamic_strings) - printf (_(" %#06x: Name: %s"), + printf (_(" %#06x: Name: %s"), isum, dynamic_strings + aux.vna_name); else - printf (_(" %#06x: Name index: %lx"), + printf (_(" %#06x: Name index: %lx"), isum, aux.vna_name); printf (_(" Flags: %s Version: %d\n"), @@ -5166,14 +5271,15 @@ process_version_sections (file) case SHT_GNU_versym: { - Elf32_Internal_Shdr * link_section; - int total; - int cnt; - unsigned char * edata; - unsigned short * data; - char * strtab; - Elf_Internal_Sym * symbols; - Elf32_Internal_Shdr * string_sec; + Elf_Internal_Shdr *link_section; + int total; + int cnt; + unsigned char *edata; + unsigned short *data; + char *strtab; + Elf_Internal_Sym *symbols; + Elf_Internal_Shdr *string_sec; + long off; link_section = SECTION_HEADER (section->sh_link); total = section->sh_size / section->sh_entsize; @@ -5184,9 +5290,8 @@ process_version_sections (file) string_sec = SECTION_HEADER (link_section->sh_link); - strtab = (char *) get_data (NULL, file, string_sec->sh_offset, - string_sec->sh_size, - _("version string table")); + strtab = get_data (NULL, file, string_sec->sh_offset, + string_sec->sh_size, _("version string table")); if (!strtab) break; @@ -5199,22 +5304,22 @@ process_version_sections (file) (unsigned long) section->sh_offset, section->sh_link, SECTION_NAME (link_section)); - edata = - ((unsigned char *) - get_data (NULL, file, - version_info[DT_VERSIONTAGIDX (DT_VERSYM)] - loadaddr, - total * sizeof (short), _("version symbol data"))); + off = offset_from_vma (file, + version_info[DT_VERSIONTAGIDX (DT_VERSYM)], + total * sizeof (short)); + edata = get_data (NULL, file, off, total * sizeof (short), + _("version symbol data")); if (!edata) { free (strtab); break; } - data = (unsigned short *) malloc (total * sizeof (short)); + data = malloc (total * sizeof (short)); for (cnt = total; cnt --;) - data [cnt] = byte_get (edata + cnt * sizeof (short), - sizeof (short)); + data[cnt] = byte_get (edata + cnt * sizeof (short), + sizeof (short)); free (edata); @@ -5222,12 +5327,12 @@ process_version_sections (file) { int j, nn; int check_def, check_need; - char * name; + char *name; printf (" %03x:", cnt); for (j = 0; (j < 4) && (cnt + j) < total; ++j) - switch (data [cnt + j]) + switch (data[cnt + j]) { case 0: fputs (_(" 0 (*local*) "), stdout); @@ -5238,35 +5343,36 @@ process_version_sections (file) break; default: - nn = printf ("%4x%c", data [cnt + j] & 0x7fff, - data [cnt + j] & 0x8000 ? 'h' : ' '); + nn = printf ("%4x%c", data[cnt + j] & 0x7fff, + data[cnt + j] & 0x8000 ? 'h' : ' '); check_def = 1; check_need = 1; - if (SECTION_HEADER (symbols [cnt + j].st_shndx)->sh_type + if (SECTION_HEADER (symbols[cnt + j].st_shndx)->sh_type != SHT_NOBITS) { - if (symbols [cnt + j].st_shndx == SHN_UNDEF) + if (symbols[cnt + j].st_shndx == SHN_UNDEF) check_def = 0; else check_need = 0; } if (check_need - && version_info [DT_VERSIONTAGIDX (DT_VERNEED)]) + && version_info[DT_VERSIONTAGIDX (DT_VERNEED)]) { - Elf_Internal_Verneed ivn; - unsigned long offset; + Elf_Internal_Verneed ivn; + unsigned long offset; - offset = version_info [DT_VERSIONTAGIDX (DT_VERNEED)] - - loadaddr; + offset = offset_from_vma + (file, version_info[DT_VERSIONTAGIDX (DT_VERNEED)], + sizeof (Elf_External_Verneed)); - do + do { - Elf_Internal_Vernaux ivna; - Elf_External_Verneed evn; - Elf_External_Vernaux evna; - unsigned long a_off; + Elf_Internal_Vernaux ivna; + Elf_External_Verneed evn; + Elf_External_Vernaux evna; + unsigned long a_off; get_data (&evn, file, offset, sizeof (evn), _("version need")); @@ -5286,10 +5392,10 @@ process_version_sections (file) a_off += ivna.vna_next; } - while (ivna.vna_other != data [cnt + j] + while (ivna.vna_other != data[cnt + j] && ivna.vna_next != 0); - if (ivna.vna_other == data [cnt + j]) + if (ivna.vna_other == data[cnt + j]) { ivna.vna_name = BYTE_GET (evna.vna_name); @@ -5307,15 +5413,16 @@ process_version_sections (file) while (ivn.vn_next); } - if (check_def && data [cnt + j] != 0x8001 - && version_info [DT_VERSIONTAGIDX (DT_VERDEF)]) + if (check_def && data[cnt + j] != 0x8001 + && version_info[DT_VERSIONTAGIDX (DT_VERDEF)]) { - Elf_Internal_Verdef ivd; - Elf_External_Verdef evd; - unsigned long offset; + Elf_Internal_Verdef ivd; + Elf_External_Verdef evd; + unsigned long offset; - offset = version_info - [DT_VERSIONTAGIDX (DT_VERDEF)] - loadaddr; + offset = offset_from_vma + (file, version_info[DT_VERSIONTAGIDX (DT_VERDEF)], + sizeof evd); do { @@ -5327,13 +5434,13 @@ process_version_sections (file) offset += ivd.vd_next; } - while (ivd.vd_ndx != (data [cnt + j] & 0x7fff) + while (ivd.vd_ndx != (data[cnt + j] & 0x7fff) && ivd.vd_next != 0); - if (ivd.vd_ndx == (data [cnt + j] & 0x7fff)) + if (ivd.vd_ndx == (data[cnt + j] & 0x7fff)) { - Elf_External_Verdaux evda; - Elf_Internal_Verdaux ivda; + Elf_External_Verdaux evda; + Elf_Internal_Verdaux ivda; ivd.vd_aux = BYTE_GET (evd.vd_aux); @@ -5376,16 +5483,15 @@ process_version_sections (file) } static const char * -get_symbol_binding (binding) - unsigned int binding; +get_symbol_binding (unsigned int binding) { - static char buff [32]; + static char buff[32]; switch (binding) { - case STB_LOCAL: return "LOCAL"; - case STB_GLOBAL: return "GLOBAL"; - case STB_WEAK: return "WEAK"; + case STB_LOCAL: return "LOCAL"; + case STB_GLOBAL: return "GLOBAL"; + case STB_WEAK: return "WEAK"; default: if (binding >= STB_LOPROC && binding <= STB_HIPROC) sprintf (buff, _(": %d"), binding); @@ -5398,20 +5504,19 @@ get_symbol_binding (binding) } static const char * -get_symbol_type (type) - unsigned int type; +get_symbol_type (unsigned int type) { - static char buff [32]; + static char buff[32]; switch (type) { - case STT_NOTYPE: return "NOTYPE"; - case STT_OBJECT: return "OBJECT"; - case STT_FUNC: return "FUNC"; - case STT_SECTION: return "SECTION"; - case STT_FILE: return "FILE"; - case STT_COMMON: return "COMMON"; - case STT_TLS: return "TLS"; + case STT_NOTYPE: return "NOTYPE"; + case STT_OBJECT: return "OBJECT"; + case STT_FUNC: return "FUNC"; + case STT_SECTION: return "SECTION"; + case STT_FILE: return "FILE"; + case STT_COMMON: return "COMMON"; + case STT_TLS: return "TLS"; default: if (type >= STT_LOPROC && type <= STT_HIPROC) { @@ -5445,54 +5550,54 @@ get_symbol_type (type) } static const char * -get_symbol_visibility (visibility) - unsigned int visibility; +get_symbol_visibility (unsigned int visibility) { switch (visibility) { - case STV_DEFAULT: return "DEFAULT"; - case STV_INTERNAL: return "INTERNAL"; - case STV_HIDDEN: return "HIDDEN"; + case STV_DEFAULT: return "DEFAULT"; + case STV_INTERNAL: return "INTERNAL"; + case STV_HIDDEN: return "HIDDEN"; case STV_PROTECTED: return "PROTECTED"; default: abort (); } } static const char * -get_symbol_index_type (type) - unsigned int type; +get_symbol_index_type (unsigned int type) { + static char buff[32]; + switch (type) { - case SHN_UNDEF: return "UND"; - case SHN_ABS: return "ABS"; - case SHN_COMMON: return "COM"; + case SHN_UNDEF: return "UND"; + case SHN_ABS: return "ABS"; + case SHN_COMMON: return "COM"; default: - if (type >= SHN_LOPROC && type <= SHN_HIPROC) - return "PRC"; + if (type == SHN_IA_64_ANSI_COMMON + && elf_header.e_machine == EM_IA_64 + && elf_header.e_ident[EI_OSABI] == ELFOSABI_HPUX) + return "ANSI_COM"; + else if (type >= SHN_LOPROC && type <= SHN_HIPROC) + sprintf (buff, "PRC[0x%04x]", type); else if (type >= SHN_LOOS && type <= SHN_HIOS) - return "OS "; + sprintf (buff, "OS [0x%04x]", type); else if (type >= SHN_LORESERVE && type <= SHN_HIRESERVE) - return "RSV"; + sprintf (buff, "RSV[0x%04x]", type); else - { - static char buff [32]; - - sprintf (buff, "%3d", type); - return buff; - } + sprintf (buff, "%3d", type); + break; } + + return buff; } static int * -get_dynamic_data (file, number) - FILE * file; - unsigned int number; +get_dynamic_data (FILE *file, unsigned int number) { - unsigned char * e_data; - int * i_data; + unsigned char *e_data; + int *i_data; - e_data = (unsigned char *) malloc (number * 4); + e_data = malloc (number * 4); if (e_data == NULL) { @@ -5506,7 +5611,7 @@ get_dynamic_data (file, number) return NULL; } - i_data = (int *) malloc (number * sizeof (* i_data)); + i_data = malloc (number * sizeof (*i_data)); if (i_data == NULL) { @@ -5516,7 +5621,7 @@ get_dynamic_data (file, number) } while (number--) - i_data [number] = byte_get (e_data + number * 4, 4); + i_data[number] = byte_get (e_data + number * 4, 4); free (e_data); @@ -5525,16 +5630,15 @@ get_dynamic_data (file, number) /* Dump the symbol table. */ static int -process_symbol_table (file) - FILE * file; +process_symbol_table (FILE *file) { - Elf32_Internal_Shdr * section; - unsigned char nb [4]; - unsigned char nc [4]; - int nbuckets = 0; - int nchains = 0; - int * buckets = NULL; - int * chains = NULL; + Elf_Internal_Shdr *section; + unsigned char nb[4]; + unsigned char nc[4]; + int nbuckets = 0; + int nchains = 0; + int *buckets = NULL; + int *chains = NULL; if (! do_syms && !do_histogram) return 1; @@ -5542,7 +5646,11 @@ process_symbol_table (file) if (dynamic_info[DT_HASH] && ((do_using_dynamic && dynamic_strings != NULL) || do_histogram)) { - if (fseek (file, dynamic_info[DT_HASH] - loadaddr, SEEK_SET)) + if (fseek (file, + (archive_file_offset + + offset_from_vma (file, dynamic_info[DT_HASH], + sizeof nb + sizeof nc)), + SEEK_SET)) { error (_("Unable to seek to start of dynamic information")); return 0; @@ -5573,8 +5681,8 @@ process_symbol_table (file) if (do_syms && dynamic_info[DT_HASH] && do_using_dynamic && dynamic_strings != NULL) { - int hn; - int si; + int hn; + int si; printf (_("\nSymbol table for image:\n")); if (is_32bit_elf) @@ -5584,12 +5692,12 @@ process_symbol_table (file) for (hn = 0; hn < nbuckets; hn++) { - if (! buckets [hn]) + if (! buckets[hn]) continue; - for (si = buckets [hn]; si < nchains && si > 0; si = chains [si]) + for (si = buckets[hn]; si < nchains && si > 0; si = chains[si]) { - Elf_Internal_Sym * psym; + Elf_Internal_Sym *psym; psym = dynamic_symbols + si; @@ -5609,16 +5717,16 @@ process_symbol_table (file) } else if (do_syms && !do_using_dynamic) { - unsigned int i; + unsigned int i; for (i = 0, section = section_headers; i < elf_header.e_shnum; i++, section++) { - unsigned int si; - char * strtab; - Elf_Internal_Sym * symtab; - Elf_Internal_Sym * psym; + unsigned int si; + char *strtab; + Elf_Internal_Sym *symtab; + Elf_Internal_Sym *psym; if ( section->sh_type != SHT_SYMTAB @@ -5641,18 +5749,17 @@ process_symbol_table (file) strtab = string_table; else { - Elf32_Internal_Shdr * string_sec; + Elf_Internal_Shdr *string_sec; string_sec = SECTION_HEADER (section->sh_link); - strtab = (char *) get_data (NULL, file, string_sec->sh_offset, - string_sec->sh_size, - _("string table")); + strtab = get_data (NULL, file, string_sec->sh_offset, + string_sec->sh_size, _("string table")); } for (si = 0, psym = symtab; si < section->sh_size / section->sh_entsize; - si ++, psym ++) + si++, psym++) { printf ("%6d: ", si); print_vma (psym->st_value, LONG_HEX); @@ -5665,16 +5772,17 @@ process_symbol_table (file) print_symbol (25, strtab + psym->st_name); if (section->sh_type == SHT_DYNSYM && - version_info [DT_VERSIONTAGIDX (DT_VERSYM)] != 0) + version_info[DT_VERSIONTAGIDX (DT_VERSYM)] != 0) { - unsigned char data[2]; - unsigned short vers_data; - unsigned long offset; - int is_nobits; - int check_def; + unsigned char data[2]; + unsigned short vers_data; + unsigned long offset; + int is_nobits; + int check_def; - offset = version_info [DT_VERSIONTAGIDX (DT_VERSYM)] - - loadaddr; + offset = offset_from_vma + (file, version_info[DT_VERSIONTAGIDX (DT_VERSYM)], + sizeof data + si * sizeof (vers_data)); get_data (&data, file, offset + si * sizeof (vers_data), sizeof (data), _("version data")); @@ -5688,20 +5796,21 @@ process_symbol_table (file) if ((vers_data & 0x8000) || vers_data > 1) { - if (version_info [DT_VERSIONTAGIDX (DT_VERNEED)] + if (version_info[DT_VERSIONTAGIDX (DT_VERNEED)] && (is_nobits || ! check_def)) { - Elf_External_Verneed evn; - Elf_Internal_Verneed ivn; - Elf_Internal_Vernaux ivna; + Elf_External_Verneed evn; + Elf_Internal_Verneed ivn; + Elf_Internal_Vernaux ivna; /* We must test both. */ - offset = version_info - [DT_VERSIONTAGIDX (DT_VERNEED)] - loadaddr; + offset = offset_from_vma + (file, version_info[DT_VERSIONTAGIDX (DT_VERNEED)], + sizeof evn); do { - unsigned long vna_off; + unsigned long vna_off; get_data (&evn, file, offset, sizeof (evn), _("version need")); @@ -5713,7 +5822,7 @@ process_symbol_table (file) do { - Elf_External_Vernaux evna; + Elf_External_Vernaux evna; get_data (&evna, file, vna_off, sizeof (evna), @@ -5750,26 +5859,27 @@ process_symbol_table (file) if (check_def) { if (vers_data != 0x8001 - && version_info [DT_VERSIONTAGIDX (DT_VERDEF)]) + && version_info[DT_VERSIONTAGIDX (DT_VERDEF)]) { - Elf_Internal_Verdef ivd; - Elf_Internal_Verdaux ivda; - Elf_External_Verdaux evda; - unsigned long offset; + Elf_Internal_Verdef ivd; + Elf_Internal_Verdaux ivda; + Elf_External_Verdaux evda; + unsigned long offset; - offset = - version_info [DT_VERSIONTAGIDX (DT_VERDEF)] - - loadaddr; + offset = offset_from_vma + (file, + version_info[DT_VERSIONTAGIDX (DT_VERDEF)], + sizeof (Elf_External_Verdef)); do { - Elf_External_Verdef evd; + Elf_External_Verdef evd; get_data (&evd, file, offset, sizeof (evd), _("version def")); - ivd.vd_ndx = BYTE_GET (evd.vd_ndx); - ivd.vd_aux = BYTE_GET (evd.vd_aux); + ivd.vd_ndx = BYTE_GET (evd.vd_ndx); + ivd.vd_aux = BYTE_GET (evd.vd_aux); ivd.vd_next = BYTE_GET (evd.vd_next); offset += ivd.vd_next; @@ -5808,19 +5918,19 @@ 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); printf (_(" Length Number %% of total Coverage\n")); - lengths = (int *) calloc (nbuckets, sizeof (int)); + lengths = calloc (nbuckets, sizeof (int)); if (lengths == NULL) { error (_("Out of memory")); @@ -5828,18 +5938,18 @@ process_symbol_table (file) } for (hn = 0; hn < nbuckets; ++hn) { - if (! buckets [hn]) + if (! buckets[hn]) continue; for (si = buckets[hn]; si > 0 && si < nchains; si = chains[si]) { - ++ nsyms; + ++nsyms; if (maxlength < ++lengths[hn]) - ++ maxlength; + ++maxlength; } } - counts = (int *) calloc (maxlength + 1, sizeof (int)); + counts = calloc (maxlength + 1, sizeof (int)); if (counts == NULL) { error (_("Out of memory")); @@ -5847,7 +5957,7 @@ process_symbol_table (file) } for (hn = 0; hn < nbuckets; ++hn) - ++ counts [lengths [hn]]; + ++counts[lengths[hn]]; if (nbuckets > 0) { @@ -5876,8 +5986,7 @@ process_symbol_table (file) } static int -process_syminfo (file) - FILE * file ATTRIBUTE_UNUSED; +process_syminfo (FILE *file ATTRIBUTE_UNUSED) { unsigned int i; @@ -5915,9 +6024,10 @@ process_syminfo (file) if (dynamic_syminfo[i].si_boundto > 0 && dynamic_syminfo[i].si_boundto < dynamic_size) { - print_symbol (10, dynamic_strings - + dynamic_segment - [dynamic_syminfo[i].si_boundto].d_un.d_val); + print_symbol (10, + dynamic_strings + + (dynamic_segment + [dynamic_syminfo[i].si_boundto].d_un.d_val)); putchar (' ' ); } else @@ -5942,9 +6052,7 @@ process_syminfo (file) #ifdef SUPPORT_DISASSEMBLY static void -disassemble_section (section, file) - Elf32_Internal_Shdr * section; - FILE * file; +disassemble_section (Elf_Internal_Shdr *section, FILE *file) { printf (_("\nAssembly dump of section %s\n"), SECTION_NAME (section)); @@ -5956,18 +6064,16 @@ disassemble_section (section, file) #endif static int -dump_section (section, file) - Elf32_Internal_Shdr * section; - FILE * file; +dump_section (Elf_Internal_Shdr *section, FILE *file) { - bfd_size_type bytes; - bfd_vma addr; - unsigned char * data; - unsigned char * start; + bfd_size_type bytes; + bfd_vma addr; + unsigned char *data; + unsigned char *start; bytes = section->sh_size; - if (bytes == 0) + if (bytes == 0 || section->sh_type == SHT_NOBITS) { printf (_("\nSection '%s' has no data to dump.\n"), SECTION_NAME (section)); @@ -5978,8 +6084,7 @@ dump_section (section, file) addr = section->sh_addr; - start = (unsigned char *) get_data (NULL, file, section->sh_offset, bytes, - _("section data")); + start = get_data (NULL, file, section->sh_offset, bytes, _("section data")); if (!start) return 0; @@ -5995,14 +6100,14 @@ dump_section (section, file) printf (" 0x%8.8lx ", (unsigned long) addr); - switch (elf_header.e_ident [EI_DATA]) + switch (elf_header.e_ident[EI_DATA]) { default: case ELFDATA2LSB: for (j = 15; j >= 0; j --) { if (j < lbytes) - printf ("%2.2x", data [j]); + printf ("%2.2x", data[j]); else printf (" "); @@ -6015,7 +6120,7 @@ dump_section (section, file) for (j = 0; j < 16; j++) { if (j < lbytes) - printf ("%2.2x", data [j]); + printf ("%2.2x", data[j]); else printf (" "); @@ -6027,8 +6132,8 @@ dump_section (section, file) for (j = 0; j < lbytes; j++) { - k = data [j]; - if (k >= ' ' && k < 0x80) + k = data[j]; + if (k >= ' ' && k < 0x7f) printf ("%c", k); else printf ("."); @@ -6048,20 +6153,17 @@ dump_section (section, file) static unsigned long int -read_leb128 (data, length_return, sign) - unsigned char * data; - int * length_return; - int sign; +read_leb128 (unsigned char *data, int *length_return, int sign) { unsigned long int result = 0; - unsigned int num_read = 0; - int shift = 0; - unsigned char byte; + unsigned int num_read = 0; + int shift = 0; + unsigned char byte; do { - byte = * data ++; - num_read ++; + byte = *data++; + num_read++; result |= (byte & 0x7f) << shift; @@ -6071,7 +6173,7 @@ read_leb128 (data, length_return, sign) while (byte & 0x80); if (length_return != NULL) - * length_return = num_read; + *length_return = num_read; if (sign && (shift < 32) && (byte & 0x40)) result |= -1 << shift; @@ -6081,23 +6183,22 @@ read_leb128 (data, length_return, sign) typedef struct State_Machine_Registers { - unsigned long address; - unsigned int file; - unsigned int line; - unsigned int column; - int is_stmt; - int basic_block; - int end_sequence; + unsigned long address; + unsigned int file; + unsigned int line; + unsigned int column; + int is_stmt; + int basic_block; + int end_sequence; /* This variable hold the number of the last entry seen in the File Table. */ - unsigned int last_file_entry; + unsigned int last_file_entry; } SMR; static SMR state_machine_regs; static void -reset_state_machine (is_stmt) - int is_stmt; +reset_state_machine (int is_stmt) { state_machine_regs.address = 0; state_machine_regs.file = 1; @@ -6112,16 +6213,13 @@ reset_state_machine (is_stmt) /* Handled an extend line op. Returns true if this is the end of sequence. */ static int -process_extended_line_op (data, is_stmt, pointer_size) - unsigned char * data; - int is_stmt; - int pointer_size; +process_extended_line_op (unsigned char *data, int is_stmt, int pointer_size) { - unsigned char op_code; - int bytes_read; - unsigned int len; - unsigned char * name; - unsigned long adr; + unsigned char op_code; + int bytes_read; + unsigned int len; + unsigned char *name; + unsigned long adr; len = read_leb128 (data, & bytes_read, 0); data += bytes_read; @@ -6133,7 +6231,7 @@ process_extended_line_op (data, is_stmt, pointer_size) } len += bytes_read; - op_code = * data ++; + op_code = *data++; printf (_(" Extended opcode %d: "), op_code); @@ -6154,7 +6252,7 @@ process_extended_line_op (data, is_stmt, pointer_size) printf (_(" define new File Table entry\n")); printf (_(" Entry\tDir\tTime\tSize\tName\n")); - printf (_(" %d\t"), ++ state_machine_regs.last_file_entry); + printf (_(" %d\t"), ++state_machine_regs.last_file_entry); name = data; data += strlen ((char *) data) + 1; printf (_("%lu\t"), read_leb128 (data, & bytes_read, 0)); @@ -6173,42 +6271,180 @@ process_extended_line_op (data, is_stmt, pointer_size) return len; } +/* Finds section NAME inside FILE and returns a + pointer to it, or NULL upon failure. */ + +static Elf_Internal_Shdr * +find_section (const char * name) +{ + Elf_Internal_Shdr *sec; + unsigned int i; + + for (i = elf_header.e_shnum, sec = section_headers + i - 1; + i; --i, --sec) + if (strcmp (SECTION_NAME (sec), name) == 0) + break; + + if (i && sec && sec->sh_size != 0) + return sec; + + return NULL; +} + /* Size of pointers in the .debug_line section. This information is not really present in that section. It's obtained before dumping the debug sections by doing some pre-scan of the .debug_info section. */ -static int debug_line_pointer_size = 4; +static unsigned int * debug_line_pointer_sizes = NULL; +static unsigned int num_debug_line_pointer_sizes = 0; + +/* Locate and scan the .debug_info section in the file and record the pointer + sizes for the compilation units in it. Usually an executable will have + just one pointer size, but this is not guaranteed, and so we try not to + make any assumptions. Returns zero upon failure, or the number of + compilation units upon success. */ + +static unsigned int +get_debug_line_pointer_sizes (FILE * file) +{ + Elf_Internal_Shdr * section; + unsigned char * start; + unsigned char * end; + unsigned char * begin; + unsigned long length; + unsigned int num_units; + unsigned int unit; + + section = find_section (".debug_info"); + if (section == NULL) + return 0; + + length = section->sh_size; + start = get_data (NULL, file, section->sh_offset, section->sh_size, + _("extracting pointer sizes from .debug_info section")); + if (start == NULL) + return 0; + + end = start + section->sh_size; + /* First scan the section to get the number of comp units. */ + for (begin = start, num_units = 0; begin < end; num_units++) + { + /* Read the first 4 bytes. For a 32-bit DWARF section, this will + be the length. For a 64-bit DWARF section, it'll be the escape + code 0xffffffff followed by an 8 byte length. */ + length = byte_get (begin, 4); + + if (length == 0xffffffff) + { + length = byte_get (begin + 4, 8); + begin += length + 12; + } + else + begin += length + 4; + } + + if (num_units == 0) + { + error (_("No comp units in .debug_info section ?")); + free (start); + return 0; + } + + /* Then allocate an array to hold the pointer sizes. */ + debug_line_pointer_sizes = malloc (num_units * sizeof * debug_line_pointer_sizes); + if (debug_line_pointer_sizes == NULL) + { + error (_("Not enough memory for a pointer size array of %u entries"), + num_units); + free (start); + return 0; + } + + /* Populate the array. */ + for (begin = start, unit = 0; begin < end; unit++) + { + length = byte_get (begin, 4); + if (length == 0xffffffff) + { + /* For 64-bit DWARF, the 1-byte address_size field is 22 bytes + from the start of the section. This is computed as follows: + + unit_length: 12 bytes + version: 2 bytes + debug_abbrev_offset: 8 bytes + ----------------------------- + Total: 22 bytes */ + + debug_line_pointer_sizes [unit] = byte_get (begin + 22, 1); + length = byte_get (begin + 4, 8); + begin += length + 12; + } + else + { + /* For 32-bit DWARF, the 1-byte address_size field is 10 bytes from + the start of the section: + + unit_length: 4 bytes + version: 2 bytes + debug_abbrev_offset: 4 bytes + ----------------------------- + Total: 10 bytes */ + + debug_line_pointer_sizes [unit] = byte_get (begin + 10, 1); + begin += length + 4; + } + } + + free (start); + num_debug_line_pointer_sizes = num_units; + return num_units; +} static int -display_debug_lines (section, start, file) - Elf32_Internal_Shdr * section; - unsigned char * start; - FILE * file ATTRIBUTE_UNUSED; -{ - DWARF2_External_LineInfo * external; - DWARF2_Internal_LineInfo info; - unsigned char * standard_opcodes; - unsigned char * data = start; - unsigned char * end = start + section->sh_size; - unsigned char * end_of_sequence; - int i; +display_debug_lines (Elf_Internal_Shdr *section, + unsigned char *start, FILE *file) +{ + unsigned char *hdrptr; + DWARF2_Internal_LineInfo info; + unsigned char *standard_opcodes; + unsigned char *data = start; + unsigned char *end = start + section->sh_size; + unsigned char *end_of_sequence; + int i; + int offset_size; + int initial_length_size; + unsigned int comp_unit = 0; printf (_("\nDump of debug contents of section %s:\n\n"), SECTION_NAME (section)); + if (num_debug_line_pointer_sizes == 0) + get_debug_line_pointer_sizes (file); + while (data < end) { - external = (DWARF2_External_LineInfo *) data; + unsigned int pointer_size; + + hdrptr = data; /* Check the length of the block. */ - info.li_length = BYTE_GET (external->li_length); + info.li_length = byte_get (hdrptr, 4); + hdrptr += 4; if (info.li_length == 0xffffffff) { - warn (_("64-bit DWARF line info is not supported yet.\n")); - break; + /* This section is 64-bit DWARF 3. */ + info.li_length = byte_get (hdrptr, 8); + hdrptr += 8; + offset_size = 8; + initial_length_size = 12; + } + else + { + offset_size = 4; + initial_length_size = 4; } - if (info.li_length + sizeof (external->li_length) > section->sh_size) + if (info.li_length + initial_length_size > section->sh_size) { warn (_("The line info appears to be corrupt - the section is too small\n")); @@ -6216,24 +6452,44 @@ display_debug_lines (section, start, file) } /* Check its version number. */ - info.li_version = BYTE_GET (external->li_version); - if (info.li_version != 2) + info.li_version = byte_get (hdrptr, 2); + hdrptr += 2; + if (info.li_version != 2 && info.li_version != 3) { - warn (_("Only DWARF version 2 line info is currently supported.\n")); + warn (_("Only DWARF version 2 and 3 line info is currently supported.\n")); return 0; } - info.li_prologue_length = BYTE_GET (external->li_prologue_length); - info.li_min_insn_length = BYTE_GET (external->li_min_insn_length); - info.li_default_is_stmt = BYTE_GET (external->li_default_is_stmt); - info.li_line_base = BYTE_GET (external->li_line_base); - info.li_line_range = BYTE_GET (external->li_line_range); - info.li_opcode_base = BYTE_GET (external->li_opcode_base); + info.li_prologue_length = byte_get (hdrptr, offset_size); + hdrptr += offset_size; + info.li_min_insn_length = byte_get (hdrptr, 1); + hdrptr++; + info.li_default_is_stmt = byte_get (hdrptr, 1); + hdrptr++; + info.li_line_base = byte_get (hdrptr, 1); + hdrptr++; + info.li_line_range = byte_get (hdrptr, 1); + hdrptr++; + info.li_opcode_base = byte_get (hdrptr, 1); + hdrptr++; /* Sign extend the line base field. */ info.li_line_base <<= 24; info.li_line_base >>= 24; + /* Get the pointer size from the comp unit associated + with this block of line number information. */ + if (comp_unit >= num_debug_line_pointer_sizes) + { + error (_("Not enough comp units for .debug_lines section\n")); + return 0; + } + else + { + pointer_size = debug_line_pointer_sizes [comp_unit]; + comp_unit ++; + } + printf (_(" Length: %ld\n"), info.li_length); printf (_(" DWARF Version: %d\n"), info.li_version); printf (_(" Prologue Length: %d\n"), info.li_prologue_length); @@ -6242,13 +6498,14 @@ display_debug_lines (section, start, file) printf (_(" Line Base: %d\n"), info.li_line_base); printf (_(" Line Range: %d\n"), info.li_line_range); printf (_(" Opcode Base: %d\n"), info.li_opcode_base); + printf (_(" (Pointer size: %u)\n"), pointer_size); - end_of_sequence = data + info.li_length + sizeof (external->li_length); + end_of_sequence = data + info.li_length + initial_length_size; reset_state_machine (info.li_default_is_stmt); /* Display the contents of the Opcodes table. */ - standard_opcodes = data + sizeof (* external); + standard_opcodes = hdrptr; printf (_("\n Opcodes:\n")); @@ -6258,13 +6515,13 @@ display_debug_lines (section, start, file) /* Display the contents of the Directory table. */ data = standard_opcodes + info.li_opcode_base - 1; - if (* data == 0) + if (*data == 0) printf (_("\n The Directory Table is empty.\n")); else { printf (_("\n The Directory Table:\n")); - while (* data != 0) + while (*data != 0) { printf (_(" %s\n"), data); @@ -6273,22 +6530,22 @@ display_debug_lines (section, start, file) } /* Skip the NUL at the end of the table. */ - data ++; + data++; /* Display the contents of the File Name table. */ - if (* data == 0) + if (*data == 0) printf (_("\n The File Name Table is empty.\n")); else { printf (_("\n The File Name Table:\n")); printf (_(" Entry\tDir\tTime\tSize\tName\n")); - while (* data != 0) + while (*data != 0) { - unsigned char * name; + unsigned char *name; int bytes_read; - printf (_(" %d\t"), ++ state_machine_regs.last_file_entry); + printf (_(" %d\t"), ++state_machine_regs.last_file_entry); name = data; data += strlen ((char *) data) + 1; @@ -6304,7 +6561,7 @@ display_debug_lines (section, start, file) } /* Skip the NUL at the end of the table. */ - data ++; + data++; /* Now display the statements. */ printf (_("\n Line Number Statements:\n")); @@ -6313,10 +6570,10 @@ display_debug_lines (section, start, file) while (data < end_of_sequence) { unsigned char op_code; - int adv; - int bytes_read; + int adv; + int bytes_read; - op_code = * data ++; + op_code = *data++; if (op_code >= info.li_opcode_base) { @@ -6334,7 +6591,7 @@ display_debug_lines (section, start, file) { case DW_LNS_extended_op: data += process_extended_line_op (data, info.li_default_is_stmt, - debug_line_pointer_size); + pointer_size); break; case DW_LNS_copy: @@ -6436,14 +6693,12 @@ display_debug_lines (section, start, file) } static int -display_debug_pubnames (section, start, file) - Elf32_Internal_Shdr * section; - unsigned char * start; - FILE * file ATTRIBUTE_UNUSED; +display_debug_pubnames (Elf_Internal_Shdr *section, + unsigned char *start, + FILE *file ATTRIBUTE_UNUSED) { - DWARF2_External_PubNames * external; - DWARF2_Internal_PubNames pubnames; - unsigned char * end; + DWARF2_Internal_PubNames pubnames; + unsigned char *end; end = start + section->sh_size; @@ -6451,32 +6706,43 @@ display_debug_pubnames (section, start, file) while (start < end) { - unsigned char * data; - unsigned long offset; - - external = (DWARF2_External_PubNames *) start; - - pubnames.pn_length = BYTE_GET (external->pn_length); - pubnames.pn_version = BYTE_GET (external->pn_version); - pubnames.pn_offset = BYTE_GET (external->pn_offset); - pubnames.pn_size = BYTE_GET (external->pn_size); + unsigned char *data; + unsigned long offset; + int offset_size, initial_length_size; - data = start + sizeof (* external); - start += pubnames.pn_length + sizeof (external->pn_length); + data = start; + pubnames.pn_length = byte_get (data, 4); + data += 4; if (pubnames.pn_length == 0xffffffff) { - warn (_("64-bit DWARF pubnames are not supported yet.\n")); - break; + pubnames.pn_length = byte_get (data, 8); + data += 8; + offset_size = 8; + initial_length_size = 12; + } + else + { + offset_size = 4; + initial_length_size = 4; } - if (pubnames.pn_version != 2) + pubnames.pn_version = byte_get (data, 2); + data += 2; + pubnames.pn_offset = byte_get (data, offset_size); + data += offset_size; + pubnames.pn_size = byte_get (data, offset_size); + data += offset_size; + + start += pubnames.pn_length + initial_length_size; + + if (pubnames.pn_version != 2 && pubnames.pn_version != 3) { static int warned = 0; if (! warned) { - warn (_("Only DWARF 2 pubnames are currently supported\n")); + warn (_("Only DWARF 2 and 3 pubnames are currently supported\n")); warned = 1; } @@ -6496,12 +6762,12 @@ display_debug_pubnames (section, start, file) do { - offset = byte_get (data, 4); + offset = byte_get (data, offset_size); if (offset != 0) { - data += 4; - printf (" %ld\t\t%s\n", offset, data); + data += offset_size; + printf (" %-6ld\t\t%s\n", offset, data); data += strlen ((char *) data) + 1; } } @@ -6513,75 +6779,78 @@ display_debug_pubnames (section, start, file) } static char * -get_TAG_name (tag) - unsigned long tag; +get_TAG_name (unsigned long tag) { switch (tag) { - case DW_TAG_padding: return "DW_TAG_padding"; - case DW_TAG_array_type: return "DW_TAG_array_type"; - case DW_TAG_class_type: return "DW_TAG_class_type"; - case DW_TAG_entry_point: return "DW_TAG_entry_point"; - case DW_TAG_enumeration_type: return "DW_TAG_enumeration_type"; - case DW_TAG_formal_parameter: return "DW_TAG_formal_parameter"; - case DW_TAG_imported_declaration: return "DW_TAG_imported_declaration"; - case DW_TAG_label: return "DW_TAG_label"; - case DW_TAG_lexical_block: return "DW_TAG_lexical_block"; - case DW_TAG_member: return "DW_TAG_member"; - case DW_TAG_pointer_type: return "DW_TAG_pointer_type"; - case DW_TAG_reference_type: return "DW_TAG_reference_type"; - case DW_TAG_compile_unit: return "DW_TAG_compile_unit"; - case DW_TAG_string_type: return "DW_TAG_string_type"; - case DW_TAG_structure_type: return "DW_TAG_structure_type"; - case DW_TAG_subroutine_type: return "DW_TAG_subroutine_type"; - case DW_TAG_typedef: return "DW_TAG_typedef"; - case DW_TAG_union_type: return "DW_TAG_union_type"; + case DW_TAG_padding: return "DW_TAG_padding"; + case DW_TAG_array_type: return "DW_TAG_array_type"; + case DW_TAG_class_type: return "DW_TAG_class_type"; + case DW_TAG_entry_point: return "DW_TAG_entry_point"; + case DW_TAG_enumeration_type: return "DW_TAG_enumeration_type"; + case DW_TAG_formal_parameter: return "DW_TAG_formal_parameter"; + case DW_TAG_imported_declaration: return "DW_TAG_imported_declaration"; + case DW_TAG_label: return "DW_TAG_label"; + case DW_TAG_lexical_block: return "DW_TAG_lexical_block"; + case DW_TAG_member: return "DW_TAG_member"; + case DW_TAG_pointer_type: return "DW_TAG_pointer_type"; + case DW_TAG_reference_type: return "DW_TAG_reference_type"; + case DW_TAG_compile_unit: return "DW_TAG_compile_unit"; + case DW_TAG_string_type: return "DW_TAG_string_type"; + case DW_TAG_structure_type: return "DW_TAG_structure_type"; + case DW_TAG_subroutine_type: return "DW_TAG_subroutine_type"; + case DW_TAG_typedef: return "DW_TAG_typedef"; + case DW_TAG_union_type: return "DW_TAG_union_type"; case DW_TAG_unspecified_parameters: return "DW_TAG_unspecified_parameters"; - case DW_TAG_variant: return "DW_TAG_variant"; - case DW_TAG_common_block: return "DW_TAG_common_block"; - case DW_TAG_common_inclusion: return "DW_TAG_common_inclusion"; - case DW_TAG_inheritance: return "DW_TAG_inheritance"; - case DW_TAG_inlined_subroutine: return "DW_TAG_inlined_subroutine"; - case DW_TAG_module: return "DW_TAG_module"; - case DW_TAG_ptr_to_member_type: return "DW_TAG_ptr_to_member_type"; - case DW_TAG_set_type: return "DW_TAG_set_type"; - case DW_TAG_subrange_type: return "DW_TAG_subrange_type"; - case DW_TAG_with_stmt: return "DW_TAG_with_stmt"; - case DW_TAG_access_declaration: return "DW_TAG_access_declaration"; - case DW_TAG_base_type: return "DW_TAG_base_type"; - case DW_TAG_catch_block: return "DW_TAG_catch_block"; - case DW_TAG_const_type: return "DW_TAG_const_type"; - case DW_TAG_constant: return "DW_TAG_constant"; - case DW_TAG_enumerator: return "DW_TAG_enumerator"; - case DW_TAG_file_type: return "DW_TAG_file_type"; - case DW_TAG_friend: return "DW_TAG_friend"; - case DW_TAG_namelist: return "DW_TAG_namelist"; - case DW_TAG_namelist_item: return "DW_TAG_namelist_item"; - case DW_TAG_packed_type: return "DW_TAG_packed_type"; - case DW_TAG_subprogram: return "DW_TAG_subprogram"; - case DW_TAG_template_type_param: return "DW_TAG_template_type_param"; - case DW_TAG_template_value_param: return "DW_TAG_template_value_param"; - case DW_TAG_thrown_type: return "DW_TAG_thrown_type"; - case DW_TAG_try_block: return "DW_TAG_try_block"; - case DW_TAG_variant_part: return "DW_TAG_variant_part"; - case DW_TAG_variable: return "DW_TAG_variable"; - case DW_TAG_volatile_type: return "DW_TAG_volatile_type"; - case DW_TAG_MIPS_loop: return "DW_TAG_MIPS_loop"; - case DW_TAG_format_label: return "DW_TAG_format_label"; - case DW_TAG_function_template: return "DW_TAG_function_template"; - case DW_TAG_class_template: return "DW_TAG_class_template"; + case DW_TAG_variant: return "DW_TAG_variant"; + case DW_TAG_common_block: return "DW_TAG_common_block"; + case DW_TAG_common_inclusion: return "DW_TAG_common_inclusion"; + case DW_TAG_inheritance: return "DW_TAG_inheritance"; + case DW_TAG_inlined_subroutine: return "DW_TAG_inlined_subroutine"; + case DW_TAG_module: return "DW_TAG_module"; + case DW_TAG_ptr_to_member_type: return "DW_TAG_ptr_to_member_type"; + case DW_TAG_set_type: return "DW_TAG_set_type"; + case DW_TAG_subrange_type: return "DW_TAG_subrange_type"; + case DW_TAG_with_stmt: return "DW_TAG_with_stmt"; + case DW_TAG_access_declaration: return "DW_TAG_access_declaration"; + case DW_TAG_base_type: return "DW_TAG_base_type"; + case DW_TAG_catch_block: return "DW_TAG_catch_block"; + case DW_TAG_const_type: return "DW_TAG_const_type"; + case DW_TAG_constant: return "DW_TAG_constant"; + case DW_TAG_enumerator: return "DW_TAG_enumerator"; + case DW_TAG_file_type: return "DW_TAG_file_type"; + case DW_TAG_friend: return "DW_TAG_friend"; + case DW_TAG_namelist: return "DW_TAG_namelist"; + case DW_TAG_namelist_item: return "DW_TAG_namelist_item"; + case DW_TAG_packed_type: return "DW_TAG_packed_type"; + case DW_TAG_subprogram: return "DW_TAG_subprogram"; + case DW_TAG_template_type_param: return "DW_TAG_template_type_param"; + case DW_TAG_template_value_param: return "DW_TAG_template_value_param"; + case DW_TAG_thrown_type: return "DW_TAG_thrown_type"; + case DW_TAG_try_block: return "DW_TAG_try_block"; + case DW_TAG_variant_part: return "DW_TAG_variant_part"; + case DW_TAG_variable: return "DW_TAG_variable"; + case DW_TAG_volatile_type: return "DW_TAG_volatile_type"; + case DW_TAG_MIPS_loop: return "DW_TAG_MIPS_loop"; + case DW_TAG_format_label: return "DW_TAG_format_label"; + case DW_TAG_function_template: return "DW_TAG_function_template"; + case DW_TAG_class_template: return "DW_TAG_class_template"; /* DWARF 2.1 values. */ - case DW_TAG_dwarf_procedure: return "DW_TAG_dwarf_procedure"; - case DW_TAG_restrict_type: return "DW_TAG_restrict_type"; - case DW_TAG_interface_type: return "DW_TAG_interface_type"; - case DW_TAG_namespace: return "DW_TAG_namespace"; - case DW_TAG_imported_module: return "DW_TAG_imported_module"; - case DW_TAG_unspecified_type: return "DW_TAG_unspecified_type"; - case DW_TAG_partial_unit: return "DW_TAG_partial_unit"; - case DW_TAG_imported_unit: return "DW_TAG_imported_unit"; + case DW_TAG_dwarf_procedure: return "DW_TAG_dwarf_procedure"; + case DW_TAG_restrict_type: return "DW_TAG_restrict_type"; + case DW_TAG_interface_type: return "DW_TAG_interface_type"; + case DW_TAG_namespace: return "DW_TAG_namespace"; + case DW_TAG_imported_module: return "DW_TAG_imported_module"; + case DW_TAG_unspecified_type: return "DW_TAG_unspecified_type"; + case DW_TAG_partial_unit: return "DW_TAG_partial_unit"; + case DW_TAG_imported_unit: return "DW_TAG_imported_unit"; + /* UPC values. */ + case DW_TAG_upc_shared_type: return "DW_TAG_upc_shared_type"; + case DW_TAG_upc_strict_type: return "DW_TAG_upc_strict_type"; + case DW_TAG_upc_relaxed_type: return "DW_TAG_upc_relaxed_type"; default: { - static char buffer [100]; + static char buffer[100]; sprintf (buffer, _("Unknown TAG value: %lx"), tag); return buffer; @@ -6590,109 +6859,111 @@ get_TAG_name (tag) } static char * -get_AT_name (attribute) - unsigned long attribute; +get_AT_name (unsigned long attribute) { switch (attribute) { - case DW_AT_sibling: return "DW_AT_sibling"; - case DW_AT_location: return "DW_AT_location"; - case DW_AT_name: return "DW_AT_name"; - case DW_AT_ordering: return "DW_AT_ordering"; - case DW_AT_subscr_data: return "DW_AT_subscr_data"; - case DW_AT_byte_size: return "DW_AT_byte_size"; - case DW_AT_bit_offset: return "DW_AT_bit_offset"; - case DW_AT_bit_size: return "DW_AT_bit_size"; - case DW_AT_element_list: return "DW_AT_element_list"; - case DW_AT_stmt_list: return "DW_AT_stmt_list"; - case DW_AT_low_pc: return "DW_AT_low_pc"; - case DW_AT_high_pc: return "DW_AT_high_pc"; - case DW_AT_language: return "DW_AT_language"; - case DW_AT_member: return "DW_AT_member"; - case DW_AT_discr: return "DW_AT_discr"; - case DW_AT_discr_value: return "DW_AT_discr_value"; - case DW_AT_visibility: return "DW_AT_visibility"; - case DW_AT_import: return "DW_AT_import"; - case DW_AT_string_length: return "DW_AT_string_length"; - case DW_AT_common_reference: return "DW_AT_common_reference"; - case DW_AT_comp_dir: return "DW_AT_comp_dir"; - case DW_AT_const_value: return "DW_AT_const_value"; - case DW_AT_containing_type: return "DW_AT_containing_type"; - case DW_AT_default_value: return "DW_AT_default_value"; - case DW_AT_inline: return "DW_AT_inline"; - case DW_AT_is_optional: return "DW_AT_is_optional"; - case DW_AT_lower_bound: return "DW_AT_lower_bound"; - case DW_AT_producer: return "DW_AT_producer"; - case DW_AT_prototyped: return "DW_AT_prototyped"; - case DW_AT_return_addr: return "DW_AT_return_addr"; - case DW_AT_start_scope: return "DW_AT_start_scope"; - case DW_AT_stride_size: return "DW_AT_stride_size"; - case DW_AT_upper_bound: return "DW_AT_upper_bound"; - case DW_AT_abstract_origin: return "DW_AT_abstract_origin"; - case DW_AT_accessibility: return "DW_AT_accessibility"; - case DW_AT_address_class: return "DW_AT_address_class"; - case DW_AT_artificial: return "DW_AT_artificial"; - case DW_AT_base_types: return "DW_AT_base_types"; - case DW_AT_calling_convention: return "DW_AT_calling_convention"; - case DW_AT_count: return "DW_AT_count"; - case DW_AT_data_member_location: return "DW_AT_data_member_location"; - case DW_AT_decl_column: return "DW_AT_decl_column"; - case DW_AT_decl_file: return "DW_AT_decl_file"; - case DW_AT_decl_line: return "DW_AT_decl_line"; - case DW_AT_declaration: return "DW_AT_declaration"; - case DW_AT_discr_list: return "DW_AT_discr_list"; - case DW_AT_encoding: return "DW_AT_encoding"; - case DW_AT_external: return "DW_AT_external"; - case DW_AT_frame_base: return "DW_AT_frame_base"; - case DW_AT_friend: return "DW_AT_friend"; - case DW_AT_identifier_case: return "DW_AT_identifier_case"; - case DW_AT_macro_info: return "DW_AT_macro_info"; - case DW_AT_namelist_items: return "DW_AT_namelist_items"; - case DW_AT_priority: return "DW_AT_priority"; - case DW_AT_segment: return "DW_AT_segment"; - case DW_AT_specification: return "DW_AT_specification"; - case DW_AT_static_link: return "DW_AT_static_link"; - case DW_AT_type: return "DW_AT_type"; - case DW_AT_use_location: return "DW_AT_use_location"; - case DW_AT_variable_parameter: return "DW_AT_variable_parameter"; - case DW_AT_virtuality: return "DW_AT_virtuality"; - case DW_AT_vtable_elem_location: return "DW_AT_vtable_elem_location"; + case DW_AT_sibling: return "DW_AT_sibling"; + case DW_AT_location: return "DW_AT_location"; + case DW_AT_name: return "DW_AT_name"; + case DW_AT_ordering: return "DW_AT_ordering"; + case DW_AT_subscr_data: return "DW_AT_subscr_data"; + case DW_AT_byte_size: return "DW_AT_byte_size"; + case DW_AT_bit_offset: return "DW_AT_bit_offset"; + case DW_AT_bit_size: return "DW_AT_bit_size"; + case DW_AT_element_list: return "DW_AT_element_list"; + case DW_AT_stmt_list: return "DW_AT_stmt_list"; + case DW_AT_low_pc: return "DW_AT_low_pc"; + case DW_AT_high_pc: return "DW_AT_high_pc"; + case DW_AT_language: return "DW_AT_language"; + case DW_AT_member: return "DW_AT_member"; + case DW_AT_discr: return "DW_AT_discr"; + case DW_AT_discr_value: return "DW_AT_discr_value"; + case DW_AT_visibility: return "DW_AT_visibility"; + case DW_AT_import: return "DW_AT_import"; + case DW_AT_string_length: return "DW_AT_string_length"; + case DW_AT_common_reference: return "DW_AT_common_reference"; + case DW_AT_comp_dir: return "DW_AT_comp_dir"; + case DW_AT_const_value: return "DW_AT_const_value"; + case DW_AT_containing_type: return "DW_AT_containing_type"; + case DW_AT_default_value: return "DW_AT_default_value"; + case DW_AT_inline: return "DW_AT_inline"; + case DW_AT_is_optional: return "DW_AT_is_optional"; + case DW_AT_lower_bound: return "DW_AT_lower_bound"; + case DW_AT_producer: return "DW_AT_producer"; + case DW_AT_prototyped: return "DW_AT_prototyped"; + case DW_AT_return_addr: return "DW_AT_return_addr"; + case DW_AT_start_scope: return "DW_AT_start_scope"; + case DW_AT_stride_size: return "DW_AT_stride_size"; + case DW_AT_upper_bound: return "DW_AT_upper_bound"; + case DW_AT_abstract_origin: return "DW_AT_abstract_origin"; + case DW_AT_accessibility: return "DW_AT_accessibility"; + case DW_AT_address_class: return "DW_AT_address_class"; + case DW_AT_artificial: return "DW_AT_artificial"; + case DW_AT_base_types: return "DW_AT_base_types"; + case DW_AT_calling_convention: return "DW_AT_calling_convention"; + case DW_AT_count: return "DW_AT_count"; + case DW_AT_data_member_location: return "DW_AT_data_member_location"; + case DW_AT_decl_column: return "DW_AT_decl_column"; + case DW_AT_decl_file: return "DW_AT_decl_file"; + case DW_AT_decl_line: return "DW_AT_decl_line"; + case DW_AT_declaration: return "DW_AT_declaration"; + case DW_AT_discr_list: return "DW_AT_discr_list"; + case DW_AT_encoding: return "DW_AT_encoding"; + case DW_AT_external: return "DW_AT_external"; + case DW_AT_frame_base: return "DW_AT_frame_base"; + case DW_AT_friend: return "DW_AT_friend"; + case DW_AT_identifier_case: return "DW_AT_identifier_case"; + case DW_AT_macro_info: return "DW_AT_macro_info"; + case DW_AT_namelist_items: return "DW_AT_namelist_items"; + case DW_AT_priority: return "DW_AT_priority"; + case DW_AT_segment: return "DW_AT_segment"; + case DW_AT_specification: return "DW_AT_specification"; + case DW_AT_static_link: return "DW_AT_static_link"; + case DW_AT_type: return "DW_AT_type"; + case DW_AT_use_location: return "DW_AT_use_location"; + case DW_AT_variable_parameter: return "DW_AT_variable_parameter"; + case DW_AT_virtuality: return "DW_AT_virtuality"; + case DW_AT_vtable_elem_location: return "DW_AT_vtable_elem_location"; /* DWARF 2.1 values. */ - case DW_AT_allocated: return "DW_AT_allocated"; - case DW_AT_associated: return "DW_AT_associated"; - case DW_AT_data_location: return "DW_AT_data_location"; - case DW_AT_stride: return "DW_AT_stride"; - case DW_AT_entry_pc: return "DW_AT_entry_pc"; - case DW_AT_use_UTF8: return "DW_AT_use_UTF8"; - case DW_AT_extension: return "DW_AT_extension"; - case DW_AT_ranges: return "DW_AT_ranges"; - case DW_AT_trampoline: return "DW_AT_trampoline"; - case DW_AT_call_column: return "DW_AT_call_column"; - case DW_AT_call_file: return "DW_AT_call_file"; - case DW_AT_call_line: return "DW_AT_call_line"; + case DW_AT_allocated: return "DW_AT_allocated"; + case DW_AT_associated: return "DW_AT_associated"; + case DW_AT_data_location: return "DW_AT_data_location"; + case DW_AT_stride: return "DW_AT_stride"; + case DW_AT_entry_pc: return "DW_AT_entry_pc"; + case DW_AT_use_UTF8: return "DW_AT_use_UTF8"; + case DW_AT_extension: return "DW_AT_extension"; + case DW_AT_ranges: return "DW_AT_ranges"; + case DW_AT_trampoline: return "DW_AT_trampoline"; + case DW_AT_call_column: return "DW_AT_call_column"; + case DW_AT_call_file: return "DW_AT_call_file"; + case DW_AT_call_line: return "DW_AT_call_line"; /* SGI/MIPS extensions. */ - case DW_AT_MIPS_fde: return "DW_AT_MIPS_fde"; - case DW_AT_MIPS_loop_begin: return "DW_AT_MIPS_loop_begin"; - case DW_AT_MIPS_tail_loop_begin: return "DW_AT_MIPS_tail_loop_begin"; - case DW_AT_MIPS_epilog_begin: return "DW_AT_MIPS_epilog_begin"; + case DW_AT_MIPS_fde: return "DW_AT_MIPS_fde"; + case DW_AT_MIPS_loop_begin: return "DW_AT_MIPS_loop_begin"; + case DW_AT_MIPS_tail_loop_begin: return "DW_AT_MIPS_tail_loop_begin"; + case DW_AT_MIPS_epilog_begin: return "DW_AT_MIPS_epilog_begin"; case DW_AT_MIPS_loop_unroll_factor: return "DW_AT_MIPS_loop_unroll_factor"; - case DW_AT_MIPS_software_pipeline_depth: return "DW_AT_MIPS_software_pipeline_depth"; - case DW_AT_MIPS_linkage_name: return "DW_AT_MIPS_linkage_name"; - case DW_AT_MIPS_stride: return "DW_AT_MIPS_stride"; - case DW_AT_MIPS_abstract_name: return "DW_AT_MIPS_abstract_name"; - case DW_AT_MIPS_clone_origin: return "DW_AT_MIPS_clone_origin"; - case DW_AT_MIPS_has_inlines: return "DW_AT_MIPS_has_inlines"; + case DW_AT_MIPS_software_pipeline_depth: + return "DW_AT_MIPS_software_pipeline_depth"; + case DW_AT_MIPS_linkage_name: return "DW_AT_MIPS_linkage_name"; + case DW_AT_MIPS_stride: return "DW_AT_MIPS_stride"; + case DW_AT_MIPS_abstract_name: return "DW_AT_MIPS_abstract_name"; + case DW_AT_MIPS_clone_origin: return "DW_AT_MIPS_clone_origin"; + case DW_AT_MIPS_has_inlines: return "DW_AT_MIPS_has_inlines"; /* GNU extensions. */ - case DW_AT_sf_names: return "DW_AT_sf_names"; - case DW_AT_src_info: return "DW_AT_src_info"; - case DW_AT_mac_info: return "DW_AT_mac_info"; - case DW_AT_src_coords: return "DW_AT_src_coords"; - case DW_AT_body_begin: return "DW_AT_body_begin"; - case DW_AT_body_end: return "DW_AT_body_end"; - case DW_AT_GNU_vector: return "DW_AT_GNU_vector"; + case DW_AT_sf_names: return "DW_AT_sf_names"; + case DW_AT_src_info: return "DW_AT_src_info"; + case DW_AT_mac_info: return "DW_AT_mac_info"; + case DW_AT_src_coords: return "DW_AT_src_coords"; + case DW_AT_body_begin: return "DW_AT_body_begin"; + case DW_AT_body_end: return "DW_AT_body_end"; + case DW_AT_GNU_vector: return "DW_AT_GNU_vector"; + /* UPC extension. */ + case DW_AT_upc_threads_scaled: return "DW_AT_upc_threads_scaled"; default: { - static char buffer [100]; + static char buffer[100]; sprintf (buffer, _("Unknown AT value: %lx"), attribute); return buffer; @@ -6701,35 +6972,34 @@ get_AT_name (attribute) } static char * -get_FORM_name (form) - unsigned long form; +get_FORM_name (unsigned long form) { switch (form) { - case DW_FORM_addr: return "DW_FORM_addr"; - case DW_FORM_block2: return "DW_FORM_block2"; - case DW_FORM_block4: return "DW_FORM_block4"; - case DW_FORM_data2: return "DW_FORM_data2"; - case DW_FORM_data4: return "DW_FORM_data4"; - case DW_FORM_data8: return "DW_FORM_data8"; - case DW_FORM_string: return "DW_FORM_string"; - case DW_FORM_block: return "DW_FORM_block"; - case DW_FORM_block1: return "DW_FORM_block1"; - case DW_FORM_data1: return "DW_FORM_data1"; - case DW_FORM_flag: return "DW_FORM_flag"; - case DW_FORM_sdata: return "DW_FORM_sdata"; - case DW_FORM_strp: return "DW_FORM_strp"; - case DW_FORM_udata: return "DW_FORM_udata"; - case DW_FORM_ref_addr: return "DW_FORM_ref_addr"; - case DW_FORM_ref1: return "DW_FORM_ref1"; - case DW_FORM_ref2: return "DW_FORM_ref2"; - case DW_FORM_ref4: return "DW_FORM_ref4"; - case DW_FORM_ref8: return "DW_FORM_ref8"; - case DW_FORM_ref_udata: return "DW_FORM_ref_udata"; - case DW_FORM_indirect: return "DW_FORM_indirect"; + case DW_FORM_addr: return "DW_FORM_addr"; + case DW_FORM_block2: return "DW_FORM_block2"; + case DW_FORM_block4: return "DW_FORM_block4"; + case DW_FORM_data2: return "DW_FORM_data2"; + case DW_FORM_data4: return "DW_FORM_data4"; + case DW_FORM_data8: return "DW_FORM_data8"; + case DW_FORM_string: return "DW_FORM_string"; + case DW_FORM_block: return "DW_FORM_block"; + case DW_FORM_block1: return "DW_FORM_block1"; + case DW_FORM_data1: return "DW_FORM_data1"; + case DW_FORM_flag: return "DW_FORM_flag"; + case DW_FORM_sdata: return "DW_FORM_sdata"; + case DW_FORM_strp: return "DW_FORM_strp"; + case DW_FORM_udata: return "DW_FORM_udata"; + case DW_FORM_ref_addr: return "DW_FORM_ref_addr"; + case DW_FORM_ref1: return "DW_FORM_ref1"; + case DW_FORM_ref2: return "DW_FORM_ref2"; + case DW_FORM_ref4: return "DW_FORM_ref4"; + case DW_FORM_ref8: return "DW_FORM_ref8"; + case DW_FORM_ref_udata: return "DW_FORM_ref_udata"; + case DW_FORM_indirect: return "DW_FORM_indirect"; default: { - static char buffer [100]; + static char buffer[100]; sprintf (buffer, _("Unknown FORM value: %lx"), form); return buffer; @@ -6737,44 +7007,44 @@ get_FORM_name (form) } } -/* FIXME: There are better and more effiecint ways to handle +/* FIXME: There are better and more efficient ways to handle these structures. For now though, I just want something that is simple to implement. */ typedef struct abbrev_attr { - unsigned long attribute; - unsigned long form; - struct abbrev_attr * next; + unsigned long attribute; + unsigned long form; + struct abbrev_attr *next; } abbrev_attr; typedef struct abbrev_entry { - unsigned long entry; - unsigned long tag; - int children; - struct abbrev_attr * first_attr; - struct abbrev_attr * last_attr; - struct abbrev_entry * next; + unsigned long entry; + unsigned long tag; + int children; + struct abbrev_attr *first_attr; + struct abbrev_attr *last_attr; + struct abbrev_entry *next; } abbrev_entry; -static abbrev_entry * first_abbrev = NULL; -static abbrev_entry * last_abbrev = NULL; +static abbrev_entry *first_abbrev = NULL; +static abbrev_entry *last_abbrev = NULL; static void -free_abbrevs PARAMS ((void)) +free_abbrevs (void) { - abbrev_entry * abbrev; + abbrev_entry *abbrev; for (abbrev = first_abbrev; abbrev;) { - abbrev_entry * next = abbrev->next; - abbrev_attr * attr; + abbrev_entry *next = abbrev->next; + abbrev_attr *attr; for (attr = abbrev->first_attr; attr;) { - abbrev_attr * next = attr->next; + abbrev_attr *next = attr->next; free (attr); attr = next; @@ -6788,14 +7058,11 @@ free_abbrevs PARAMS ((void)) } static void -add_abbrev (number, tag, children) - unsigned long number; - unsigned long tag; - int children; +add_abbrev (unsigned long number, unsigned long tag, int children) { - abbrev_entry * entry; + abbrev_entry *entry; - entry = (abbrev_entry *) malloc (sizeof (* entry)); + entry = malloc (sizeof (*entry)); if (entry == NULL) /* ugg */ @@ -6817,13 +7084,11 @@ add_abbrev (number, tag, children) } static void -add_abbrev_attr (attribute, form) - unsigned long attribute; - unsigned long form; +add_abbrev_attr (unsigned long attribute, unsigned long form) { - abbrev_attr * attr; + abbrev_attr *attr; - attr = (abbrev_attr *) malloc (sizeof (* attr)); + attr = malloc (sizeof (*attr)); if (attr == NULL) /* ugg */ @@ -6847,20 +7112,18 @@ add_abbrev_attr (attribute, form) an abbreviation set was found. */ static unsigned char * -process_abbrev_section (start, end) - unsigned char * start; - unsigned char * end; +process_abbrev_section (unsigned char *start, unsigned char *end) { if (first_abbrev != NULL) return NULL; while (start < end) { - int bytes_read; + int bytes_read; unsigned long entry; unsigned long tag; unsigned long attribute; - int children; + int children; entry = read_leb128 (start, & bytes_read, 0); start += bytes_read; @@ -6874,7 +7137,7 @@ process_abbrev_section (start, end) tag = read_leb128 (start, & bytes_read, 0); start += bytes_read; - children = * start ++; + children = *start++; add_abbrev (entry, tag, children); @@ -6899,13 +7162,12 @@ process_abbrev_section (start, end) static int -display_debug_macinfo (section, start, file) - Elf32_Internal_Shdr * section; - unsigned char * start; - FILE * file ATTRIBUTE_UNUSED; +display_debug_macinfo (Elf_Internal_Shdr *section, + unsigned char *start, + FILE *file ATTRIBUTE_UNUSED) { - unsigned char * end = start + section->sh_size; - unsigned char * curr = start; + unsigned char *end = start + section->sh_size; + unsigned char *curr = start; unsigned int bytes_read; enum dwarf_macinfo_record_type op; @@ -6914,10 +7176,10 @@ display_debug_macinfo (section, start, file) while (curr < end) { unsigned int lineno; - const char * string; + const char *string; - op = * curr; - curr ++; + op = *curr; + curr++; switch (op) { @@ -6973,13 +7235,12 @@ display_debug_macinfo (section, start, file) static int -display_debug_abbrev (section, start, file) - Elf32_Internal_Shdr * section; - unsigned char * start; - FILE * file ATTRIBUTE_UNUSED; +display_debug_abbrev (Elf_Internal_Shdr *section, + unsigned char *start, + FILE *file ATTRIBUTE_UNUSED) { - abbrev_entry * entry; - unsigned char * end = start + section->sh_size; + abbrev_entry *entry; + unsigned char *end = start + section->sh_size; printf (_("Contents of the %s section:\n\n"), SECTION_NAME (section)); @@ -6994,7 +7255,7 @@ display_debug_abbrev (section, start, file) for (entry = first_abbrev; entry; entry = entry->next) { - abbrev_attr * attr; + abbrev_attr *attr; printf (_(" %ld %s [%s]\n"), entry->entry, @@ -7020,32 +7281,29 @@ display_debug_abbrev (section, start, file) static unsigned char * -display_block (data, length) - unsigned char * data; - unsigned long length; +display_block (unsigned char *data, unsigned long length) { printf (_(" %lu byte block: "), length); while (length --) - printf ("%lx ", (unsigned long) byte_get (data ++, 1)); + printf ("%lx ", (unsigned long) byte_get (data++, 1)); return data; } static void -decode_location_expression (data, pointer_size, length) - unsigned char * data; - unsigned int pointer_size; - unsigned long length; +decode_location_expression (unsigned char * data, + unsigned int pointer_size, + unsigned long length) { - unsigned op; - int bytes_read; - unsigned long uvalue; - unsigned char * end = data + length; + unsigned op; + int bytes_read; + unsigned long uvalue; + unsigned char *end = data + length; while (data < end) { - op = * data ++; + op = *data++; switch (op) { @@ -7328,7 +7586,7 @@ decode_location_expression (data, pointer_size, length) printf ("DW_OP_nop"); break; - /* DWARF 2.1 extensions. */ + /* DWARF 3 extensions. */ case DW_OP_push_object_address: printf ("DW_OP_push_object_address"); break; @@ -7340,8 +7598,13 @@ decode_location_expression (data, pointer_size, length) printf ("DW_OP_call4: <%lx>", (long) byte_get (data, 4)); data += 4; break; - case DW_OP_calli: - printf ("DW_OP_calli"); + case DW_OP_call_ref: + printf ("DW_OP_call_ref"); + break; + + /* GNU extensions. */ + case DW_OP_GNU_push_tls_address: + printf ("DW_OP_GNU_push_tls_address"); break; default: @@ -7355,43 +7618,36 @@ decode_location_expression (data, pointer_size, length) } /* Separate the ops. */ - printf ("; "); + if (data < end) + printf ("; "); } } -static const char * debug_loc_contents; -static bfd_vma debug_loc_size; +static const char *debug_loc_contents; +static bfd_vma debug_loc_size; static void -load_debug_loc (file) - FILE * file; +load_debug_loc (FILE *file) { - Elf32_Internal_Shdr * sec; - unsigned int i; + Elf_Internal_Shdr *sec; /* If it is already loaded, do nothing. */ if (debug_loc_contents != NULL) return; /* Locate the .debug_loc section. */ - for (i = 0, sec = section_headers; - i < elf_header.e_shnum; - i ++, sec ++) - if (strcmp (SECTION_NAME (sec), ".debug_loc") == 0) - break; - - if (i == elf_header.e_shnum || sec->sh_size == 0) + sec = find_section (".debug_loc"); + if (sec == NULL) return; debug_loc_size = sec->sh_size; - debug_loc_contents = ((char *) - get_data (NULL, file, sec->sh_offset, sec->sh_size, - _("debug_loc section data"))); + debug_loc_contents = get_data (NULL, file, sec->sh_offset, sec->sh_size, + _("debug_loc section data")); } static void -free_debug_loc () +free_debug_loc (void) { if (debug_loc_contents == NULL) return; @@ -7403,52 +7659,68 @@ free_debug_loc () static int -display_debug_loc (section, start, file) - Elf32_Internal_Shdr * section; - unsigned char * start; - FILE * file ATTRIBUTE_UNUSED; +display_debug_loc (Elf_Internal_Shdr *section, + unsigned char *start, FILE *file) { unsigned char *section_end; unsigned long bytes; unsigned char *section_begin = start; bfd_vma addr; + unsigned int comp_unit = 0; addr = section->sh_addr; bytes = section->sh_size; section_end = start + bytes; + if (bytes == 0) { printf (_("\nThe .debug_loc section is empty.\n")); return 0; } + + if (num_debug_line_pointer_sizes == 0) + get_debug_line_pointer_sizes (file); + printf (_("Contents of the .debug_loc section:\n\n")); printf (_("\n Offset Begin End Expression\n")); + while (start < section_end) { unsigned long begin; unsigned long end; unsigned short length; unsigned long offset; + unsigned int pointer_size; offset = start - section_begin; + /* Get the pointer size from the comp unit associated + with this block of location information. */ + if (comp_unit >= num_debug_line_pointer_sizes) + { + error (_("Not enough comp units for .debug_loc section\n")); + return 0; + } + else + { + pointer_size = debug_line_pointer_sizes [comp_unit]; + comp_unit ++; + } + while (1) { - /* Normally, the lists in the debug_loc section are related to a - given compilation unit, and thus, we would use the - pointer size of that compilation unit. However, since we are - displaying it seperately here, we either have to store - pointer sizes of all compilation units, or assume they don't - change. We assume, like the debug_line display, that - it doesn't change. */ - begin = byte_get (start, debug_line_pointer_size); - start += debug_line_pointer_size; - end = byte_get (start, debug_line_pointer_size); - start += debug_line_pointer_size; + begin = byte_get (start, pointer_size); + start += pointer_size; + end = byte_get (start, pointer_size); + start += pointer_size; if (begin == 0 && end == 0) break; + /* For now, skip any base address specifiers. */ + if (begin == 0xffffffff) + continue; + begin += addr; end += addr; @@ -7456,7 +7728,7 @@ display_debug_loc (section, start, file) start += 2; printf (" %8.8lx %8.8lx %8.8lx (", offset, begin, end); - decode_location_expression (start, debug_line_pointer_size, length); + decode_location_expression (start, pointer_size, length); printf (")\n"); start += length; @@ -7466,39 +7738,31 @@ display_debug_loc (section, start, file) return 1; } -static const char * debug_str_contents; -static bfd_vma debug_str_size; +static const char *debug_str_contents; +static bfd_vma debug_str_size; static void -load_debug_str (file) - FILE * file; +load_debug_str (FILE *file) { - Elf32_Internal_Shdr * sec; - unsigned int i; + Elf_Internal_Shdr *sec; /* If it is already loaded, do nothing. */ if (debug_str_contents != NULL) return; /* Locate the .debug_str section. */ - for (i = 0, sec = section_headers; - i < elf_header.e_shnum; - i ++, sec ++) - if (strcmp (SECTION_NAME (sec), ".debug_str") == 0) - break; - - if (i == elf_header.e_shnum || sec->sh_size == 0) + sec = find_section (".debug_str"); + if (sec == NULL) return; debug_str_size = sec->sh_size; - debug_str_contents = ((char *) - get_data (NULL, file, sec->sh_offset, sec->sh_size, - _("debug_str section data"))); + debug_str_contents = get_data (NULL, file, sec->sh_offset, sec->sh_size, + _("debug_str section data")); } static void -free_debug_str () +free_debug_str (void) { if (debug_str_contents == NULL) return; @@ -7509,8 +7773,7 @@ free_debug_str () } static const char * -fetch_indirect_string (offset) - unsigned long offset; +fetch_indirect_string (unsigned long offset) { if (debug_str_contents == NULL) return _(""); @@ -7521,15 +7784,13 @@ fetch_indirect_string (offset) return debug_str_contents + offset; } - static int -display_debug_str (section, start, file) - Elf32_Internal_Shdr * section; - unsigned char * start; - FILE * file ATTRIBUTE_UNUSED; +display_debug_str (Elf_Internal_Shdr *section, + unsigned char *start, + FILE *file ATTRIBUTE_UNUSED) { - unsigned long bytes; - bfd_vma addr; + unsigned long bytes; + bfd_vma addr; addr = section->sh_addr; bytes = section->sh_size; @@ -7555,7 +7816,7 @@ display_debug_str (section, start, file) for (j = 0; j < 16; j++) { if (j < lbytes) - printf ("%2.2x", start [j]); + printf ("%2.2x", start[j]); else printf (" "); @@ -7565,7 +7826,7 @@ display_debug_str (section, start, file) for (j = 0; j < lbytes; j++) { - k = start [j]; + k = start[j]; if (k >= ' ' && k < 0x80) printf ("%c", k); else @@ -7582,18 +7843,18 @@ display_debug_str (section, start, file) return 1; } - static unsigned char * -read_and_display_attr_value (attribute, form, data, cu_offset, pointer_size) - unsigned long attribute; - unsigned long form; - unsigned char * data; - unsigned long cu_offset; - unsigned long pointer_size; +read_and_display_attr_value (unsigned long attribute, + unsigned long form, + unsigned char *data, + unsigned long cu_offset, + unsigned long pointer_size, + unsigned long offset_size, + int dwarf_version) { - unsigned long uvalue = 0; - unsigned char * block_start = NULL; - int bytes_read; + unsigned long uvalue = 0; + unsigned char *block_start = NULL; + int bytes_read; switch (form) { @@ -7601,20 +7862,36 @@ read_and_display_attr_value (attribute, form, data, cu_offset, pointer_size) break; case DW_FORM_ref_addr: + if (dwarf_version == 2) + { + uvalue = byte_get (data, pointer_size); + data += pointer_size; + } + else if (dwarf_version == 3) + { + uvalue = byte_get (data, offset_size); + data += offset_size; + } + else + { + error (_("Internal error: DWARF version is not 2 or 3.\n")); + } + break; + case DW_FORM_addr: uvalue = byte_get (data, pointer_size); data += pointer_size; break; case DW_FORM_strp: - uvalue = byte_get (data, /* offset_size */ 4); - data += /* offset_size */ 4; + uvalue = byte_get (data, offset_size); + data += offset_size; break; case DW_FORM_ref1: case DW_FORM_flag: case DW_FORM_data1: - uvalue = byte_get (data ++, 1); + uvalue = byte_get (data++, 1); break; case DW_FORM_ref2: @@ -7645,7 +7922,8 @@ read_and_display_attr_value (attribute, form, data, cu_offset, pointer_size) data += bytes_read; printf (" %s", get_FORM_name (form)); return read_and_display_attr_value (attribute, form, data, cu_offset, - pointer_size); + pointer_size, offset_size, + dwarf_version); } switch (form) @@ -7663,6 +7941,7 @@ read_and_display_attr_value (attribute, form, data, cu_offset, pointer_size) case DW_FORM_addr: printf (" %#lx", uvalue); + break; case DW_FORM_flag: case DW_FORM_data1: @@ -7711,8 +7990,8 @@ read_and_display_attr_value (attribute, form, data, cu_offset, pointer_size) break; case DW_FORM_strp: - printf (_(" (indirect string, offset: 0x%lx): "), uvalue); - printf (fetch_indirect_string (uvalue)); + printf (_(" (indirect string, offset: 0x%lx): %s"), + uvalue, fetch_indirect_string (uvalue)); break; case DW_FORM_indirect: @@ -7724,7 +8003,7 @@ read_and_display_attr_value (attribute, form, data, cu_offset, pointer_size) break; } - /* For some attributes we can display futher information. */ + /* For some attributes we can display further information. */ printf ("\t"); @@ -7733,51 +8012,65 @@ read_and_display_attr_value (attribute, form, data, cu_offset, pointer_size) case DW_AT_inline: switch (uvalue) { - case DW_INL_not_inlined: printf (_("(not inlined)")); break; - case DW_INL_inlined: printf (_("(inlined)")); break; - case DW_INL_declared_not_inlined: printf (_("(declared as inline but ignored)")); break; - case DW_INL_declared_inlined: printf (_("(declared as inline and inlined)")); break; - default: printf (_(" (Unknown inline attribute value: %lx)"), uvalue); break; + case DW_INL_not_inlined: + printf (_("(not inlined)")); + break; + case DW_INL_inlined: + printf (_("(inlined)")); + break; + case DW_INL_declared_not_inlined: + printf (_("(declared as inline but ignored)")); + break; + case DW_INL_declared_inlined: + printf (_("(declared as inline and inlined)")); + break; + default: + printf (_(" (Unknown inline attribute value: %lx)"), uvalue); + break; } break; case DW_AT_language: switch (uvalue) { - case DW_LANG_C: printf ("(non-ANSI C)"); break; - case DW_LANG_C89: printf ("(ANSI C)"); break; - case DW_LANG_C_plus_plus: printf ("(C++)"); break; - case DW_LANG_Fortran77: printf ("(FORTRAN 77)"); break; - case DW_LANG_Fortran90: printf ("(Fortran 90)"); break; - case DW_LANG_Modula2: printf ("(Modula 2)"); break; - case DW_LANG_Pascal83: printf ("(ANSI Pascal)"); break; - case DW_LANG_Ada83: printf ("(Ada)"); break; - case DW_LANG_Cobol74: printf ("(Cobol 74)"); break; - case DW_LANG_Cobol85: printf ("(Cobol 85)"); break; - /* DWARF 2.1 values. */ - case DW_LANG_C99: printf ("(ANSI C99)"); break; - case DW_LANG_Ada95: printf ("(ADA 95)"); break; - case DW_LANG_Fortran95: printf ("(Fortran 95)"); break; + case DW_LANG_C: printf ("(non-ANSI C)"); break; + case DW_LANG_C89: printf ("(ANSI C)"); break; + case DW_LANG_C_plus_plus: printf ("(C++)"); break; + case DW_LANG_Fortran77: printf ("(FORTRAN 77)"); break; + case DW_LANG_Fortran90: printf ("(Fortran 90)"); break; + case DW_LANG_Modula2: printf ("(Modula 2)"); break; + case DW_LANG_Pascal83: printf ("(ANSI Pascal)"); break; + case DW_LANG_Ada83: printf ("(Ada)"); break; + case DW_LANG_Cobol74: printf ("(Cobol 74)"); break; + case DW_LANG_Cobol85: printf ("(Cobol 85)"); break; + /* DWARF 2.1 values. */ + case DW_LANG_C99: printf ("(ANSI C99)"); break; + case DW_LANG_Ada95: printf ("(ADA 95)"); break; + case DW_LANG_Fortran95: printf ("(Fortran 95)"); break; /* MIPS extension. */ - case DW_LANG_Mips_Assembler: printf ("(MIPS assembler)"); break; - default: printf ("(Unknown: %lx)", uvalue); break; + case DW_LANG_Mips_Assembler: printf ("(MIPS assembler)"); break; + /* UPC extension. */ + case DW_LANG_Upc: printf ("(Unified Parallel C)"); break; + default: + printf ("(Unknown: %lx)", uvalue); + break; } break; case DW_AT_encoding: switch (uvalue) { - case DW_ATE_void: printf ("(void)"); break; - case DW_ATE_address: printf ("(machine address)"); break; - case DW_ATE_boolean: printf ("(boolean)"); break; - case DW_ATE_complex_float: printf ("(complex float)"); break; - case DW_ATE_float: printf ("(float)"); break; - case DW_ATE_signed: printf ("(signed)"); break; - case DW_ATE_signed_char: printf ("(signed char)"); break; - case DW_ATE_unsigned: printf ("(unsigned)"); break; - case DW_ATE_unsigned_char: printf ("(unsigned char)"); break; + case DW_ATE_void: printf ("(void)"); break; + case DW_ATE_address: printf ("(machine address)"); break; + case DW_ATE_boolean: printf ("(boolean)"); break; + case DW_ATE_complex_float: printf ("(complex float)"); break; + case DW_ATE_float: printf ("(float)"); break; + case DW_ATE_signed: printf ("(signed)"); break; + case DW_ATE_signed_char: printf ("(signed char)"); break; + case DW_ATE_unsigned: printf ("(unsigned)"); break; + case DW_ATE_unsigned_char: printf ("(unsigned char)"); break; /* DWARF 2.1 value. */ - case DW_ATE_imaginary_float: printf ("(imaginary float)"); break; + case DW_ATE_imaginary_float: printf ("(imaginary float)"); break; default: if (uvalue >= DW_ATE_lo_user && uvalue <= DW_ATE_hi_user) @@ -7794,17 +8087,19 @@ read_and_display_attr_value (attribute, form, data, cu_offset, pointer_size) case DW_ACCESS_public: printf ("(public)"); break; case DW_ACCESS_protected: printf ("(protected)"); break; case DW_ACCESS_private: printf ("(private)"); break; - default: printf ("(unknown accessibility)"); break; + default: + printf ("(unknown accessibility)"); + break; } break; case DW_AT_visibility: switch (uvalue) { - case DW_VIS_local: printf ("(local)"); break; - case DW_VIS_exported: printf ("(exported)"); break; - case DW_VIS_qualified: printf ("(qualified)"); break; - default: printf ("(unknown visibility)"); break; + case DW_VIS_local: printf ("(local)"); break; + case DW_VIS_exported: printf ("(exported)"); break; + case DW_VIS_qualified: printf ("(qualified)"); break; + default: printf ("(unknown visibility)"); break; } break; @@ -7814,7 +8109,7 @@ read_and_display_attr_value (attribute, form, data, cu_offset, pointer_size) case DW_VIRTUALITY_none: printf ("(none)"); break; case DW_VIRTUALITY_virtual: printf ("(virtual)"); break; case DW_VIRTUALITY_pure_virtual:printf ("(pure_virtual)"); break; - default: printf ("(unknown virtuality)"); break; + default: printf ("(unknown virtuality)"); break; } break; @@ -7825,7 +8120,7 @@ read_and_display_attr_value (attribute, form, data, cu_offset, pointer_size) case DW_ID_up_case: printf ("(up_case)"); break; case DW_ID_down_case: printf ("(down_case)"); break; case DW_ID_case_insensitive: printf ("(case_insensitive)"); break; - default: printf ("(unknown case)"); break; + default: printf ("(unknown case)"); break; } break; @@ -7869,7 +8164,7 @@ read_and_display_attr_value (attribute, form, data, cu_offset, pointer_size) decode_location_expression (block_start, pointer_size, uvalue); printf (")"); } - else if (form == DW_FORM_data4) + else if (form == DW_FORM_data4 || form == DW_FORM_data8) { printf ("("); printf ("location list"); @@ -7885,28 +8180,28 @@ read_and_display_attr_value (attribute, form, data, cu_offset, pointer_size) } static unsigned char * -read_and_display_attr (attribute, form, data, cu_offset, pointer_size) - unsigned long attribute; - unsigned long form; - unsigned char * data; - unsigned long cu_offset; - unsigned long pointer_size; +read_and_display_attr (unsigned long attribute, + unsigned long form, + unsigned char *data, + unsigned long cu_offset, + unsigned long pointer_size, + unsigned long offset_size, + int dwarf_version) { printf (" %-18s:", get_AT_name (attribute)); data = read_and_display_attr_value (attribute, form, data, cu_offset, - pointer_size); + pointer_size, offset_size, dwarf_version); printf ("\n"); return data; } static int -display_debug_info (section, start, file) - Elf32_Internal_Shdr * section; - unsigned char * start; - FILE * file; +display_debug_info (Elf_Internal_Shdr *section, + unsigned char *start, + FILE *file) { - unsigned char * end = start + section->sh_size; - unsigned char * section_begin = start; + unsigned char *end = start + section->sh_size; + unsigned char *section_begin = start; printf (_("The section %s contains:\n\n"), SECTION_NAME (section)); @@ -7915,36 +8210,45 @@ display_debug_info (section, start, file) while (start < end) { - DWARF2_External_CompUnit * external; - DWARF2_Internal_CompUnit compunit; - Elf32_Internal_Shdr * relsec; - unsigned char * tags; - unsigned int i; - int level; - unsigned long cu_offset; + DWARF2_Internal_CompUnit compunit; + Elf_Internal_Shdr *relsec; + unsigned char *hdrptr; + unsigned char *cu_abbrev_offset_ptr; + unsigned char *tags; + int level; + unsigned long cu_offset; + int offset_size; + int initial_length_size; - external = (DWARF2_External_CompUnit *) start; + hdrptr = start; - compunit.cu_length = BYTE_GET (external->cu_length); - compunit.cu_version = BYTE_GET (external->cu_version); - compunit.cu_abbrev_offset = BYTE_GET (external->cu_abbrev_offset); - compunit.cu_pointer_size = BYTE_GET (external->cu_pointer_size); + compunit.cu_length = byte_get (hdrptr, 4); + hdrptr += 4; if (compunit.cu_length == 0xffffffff) { - warn (_("64-bit DWARF debug info is not supported yet.\n")); - break; + compunit.cu_length = byte_get (hdrptr, 8); + hdrptr += 8; + offset_size = 8; + initial_length_size = 12; } + else + { + offset_size = 4; + initial_length_size = 4; + } + + compunit.cu_version = byte_get (hdrptr, 2); + hdrptr += 2; - /* Check for RELA relocations in the abbrev_offset address, and - apply them. */ + /* Apply addends of RELA relocations. */ for (relsec = section_headers; relsec < section_headers + elf_header.e_shnum; ++relsec) { unsigned long nrelas; Elf_Internal_Rela *rela, *rp; - Elf32_Internal_Shdr *symsec; + Elf_Internal_Shdr *symsec; Elf_Internal_Sym *symtab; Elf_Internal_Sym *sym; @@ -7962,9 +8266,13 @@ display_debug_info (section, start, file) for (rp = rela; rp < rela + nrelas; ++rp) { - if (rp->r_offset - != (bfd_vma) ((unsigned char *) &external->cu_abbrev_offset - - section_begin)) + unsigned char *loc; + + if (rp->r_offset >= (bfd_vma) (hdrptr - section_begin) + && section->sh_size > (bfd_vma) offset_size + && rp->r_offset <= section->sh_size - offset_size) + loc = section_begin + rp->r_offset; + else continue; if (is_32bit_elf) @@ -7992,17 +8300,23 @@ display_debug_info (section, start, file) } } - compunit.cu_abbrev_offset = rp->r_addend; - break; + byte_put (loc, rp->r_addend, offset_size); } free (rela); break; } - tags = start + sizeof (* external); + cu_abbrev_offset_ptr = hdrptr; + compunit.cu_abbrev_offset = byte_get (hdrptr, offset_size); + hdrptr += offset_size; + + compunit.cu_pointer_size = byte_get (hdrptr, 1); + hdrptr += 1; + + tags = hdrptr; cu_offset = start - section_begin; - start += compunit.cu_length + sizeof (external->cu_length); + start += compunit.cu_length + initial_length_size; printf (_(" Compilation Unit @ %lx:\n"), cu_offset); printf (_(" Length: %ld\n"), compunit.cu_length); @@ -8010,36 +8324,29 @@ display_debug_info (section, start, file) printf (_(" Abbrev Offset: %ld\n"), compunit.cu_abbrev_offset); printf (_(" Pointer Size: %d\n"), compunit.cu_pointer_size); - if (compunit.cu_version != 2) + if (compunit.cu_version != 2 && compunit.cu_version != 3) { - warn (_("Only version 2 DWARF debug information is currently supported.\n")); + warn (_("Only version 2 and 3 DWARF debug information is currently supported.\n")); continue; } free_abbrevs (); /* Read in the abbrevs used by this compilation unit. */ - { - Elf32_Internal_Shdr * sec; - unsigned char * begin; + Elf_Internal_Shdr *sec; + unsigned char *begin; /* Locate the .debug_abbrev section and process it. */ - for (i = 0, sec = section_headers; - i < elf_header.e_shnum; - i ++, sec ++) - if (strcmp (SECTION_NAME (sec), ".debug_abbrev") == 0) - break; - - if (i == elf_header.e_shnum || sec->sh_size == 0) + sec = find_section (".debug_abbrev"); + if (sec == NULL) { warn (_("Unable to locate .debug_abbrev section!\n")); return 0; } - begin = ((unsigned char *) - get_data (NULL, file, sec->sh_offset, sec->sh_size, - _("debug_abbrev section data"))); + begin = get_data (NULL, file, sec->sh_offset, sec->sh_size, + _("debug_abbrev section data")); if (!begin) return 0; @@ -8052,10 +8359,10 @@ display_debug_info (section, start, file) level = 0; while (tags < start) { - int bytes_read; - unsigned long abbrev_number; - abbrev_entry * entry; - abbrev_attr * attr; + int bytes_read; + unsigned long abbrev_number; + abbrev_entry *entry; + abbrev_attr *attr; abbrev_number = read_leb128 (tags, & bytes_read, 0); tags += bytes_read; @@ -8091,7 +8398,9 @@ display_debug_info (section, start, file) tags = read_and_display_attr (attr->attribute, attr->form, tags, cu_offset, - compunit.cu_pointer_size); + compunit.cu_pointer_size, + offset_size, + compunit.cu_version); if (entry->children) ++level; @@ -8107,41 +8416,58 @@ display_debug_info (section, start, file) } static int -display_debug_aranges (section, start, file) - Elf32_Internal_Shdr * section; - unsigned char * start; - FILE * file ATTRIBUTE_UNUSED; +display_debug_aranges (Elf_Internal_Shdr *section, + unsigned char *start, + FILE *file ATTRIBUTE_UNUSED) { - unsigned char * end = start + section->sh_size; + unsigned char *end = start + section->sh_size; printf (_("The section %s contains:\n\n"), SECTION_NAME (section)); while (start < end) { - DWARF2_External_ARange * external; - DWARF2_Internal_ARange arange; - unsigned char * ranges; - unsigned long length; - unsigned long address; - int excess; + unsigned char *hdrptr; + DWARF2_Internal_ARange arange; + unsigned char *ranges; + unsigned long length; + unsigned long address; + int excess; + int offset_size; + int initial_length_size; - external = (DWARF2_External_ARange *) start; + hdrptr = start; - arange.ar_length = BYTE_GET (external->ar_length); - arange.ar_version = BYTE_GET (external->ar_version); - arange.ar_info_offset = BYTE_GET (external->ar_info_offset); - arange.ar_pointer_size = BYTE_GET (external->ar_pointer_size); - arange.ar_segment_size = BYTE_GET (external->ar_segment_size); + arange.ar_length = byte_get (hdrptr, 4); + hdrptr += 4; if (arange.ar_length == 0xffffffff) { - warn (_("64-bit DWARF aranges are not supported yet.\n")); - break; + arange.ar_length = byte_get (hdrptr, 8); + hdrptr += 8; + offset_size = 8; + initial_length_size = 12; + } + else + { + offset_size = 4; + initial_length_size = 4; } - if (arange.ar_version != 2) + arange.ar_version = byte_get (hdrptr, 2); + hdrptr += 2; + + arange.ar_info_offset = byte_get (hdrptr, offset_size); + hdrptr += offset_size; + + arange.ar_pointer_size = byte_get (hdrptr, 1); + hdrptr += 1; + + arange.ar_segment_size = byte_get (hdrptr, 1); + hdrptr += 1; + + if (arange.ar_version != 2 && arange.ar_version != 3) { - warn (_("Only DWARF 2 aranges are currently supported.\n")); + warn (_("Only DWARF 2 and 3 aranges are currently supported.\n")); break; } @@ -8153,10 +8479,10 @@ display_debug_aranges (section, start, file) printf (_("\n Address Length\n")); - ranges = start + sizeof (* external); + ranges = hdrptr; /* Must pad to an alignment boundary that is twice the pointer size. */ - excess = sizeof (* external) % (2 * arange.ar_pointer_size); + excess = (hdrptr - start) % (2 * arange.ar_pointer_size); if (excess) ranges += (2 * arange.ar_pointer_size) - excess; @@ -8177,7 +8503,7 @@ display_debug_aranges (section, start, file) printf (" %8.8lx %lu\n", address, length); } - start += arange.ar_length + sizeof (external->ar_length); + start += arange.ar_length + initial_length_size; } printf ("\n"); @@ -8187,21 +8513,22 @@ display_debug_aranges (section, start, file) typedef struct Frame_Chunk { - struct Frame_Chunk * next; - unsigned char * chunk_start; - int ncols; + 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; - int data_factor; - unsigned long pc_begin; - unsigned long pc_range; - int cfa_reg; - int cfa_offset; - int ra; - unsigned char fde_encoding; + short int *col_type; + int *col_offset; + char *augmentation; + unsigned int code_factor; + int data_factor; + unsigned long pc_begin; + unsigned long pc_range; + int cfa_reg; + int cfa_offset; + int ra; + unsigned char fde_encoding; + unsigned char cfa_exp; } Frame_Chunk; @@ -8209,14 +8536,8 @@ Frame_Chunk; in the frame info. */ #define DW_CFA_unreferenced (-1) -static void frame_need_space PARAMS ((Frame_Chunk *, int)); -static void frame_display_row PARAMS ((Frame_Chunk *, int *, int *)); -static int size_of_encoded_value PARAMS ((int)); - static void -frame_need_space (fc, reg) - Frame_Chunk * fc; - int reg; +frame_need_space (Frame_Chunk *fc, int reg) { int prev = fc->ncols; @@ -8224,10 +8545,8 @@ frame_need_space (fc, reg) 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)); + fc->col_type = xrealloc (fc->col_type, fc->ncols * sizeof (short int)); + fc->col_offset = xrealloc (fc->col_offset, fc->ncols * sizeof (int)); while (prev < fc->ncols) { @@ -8238,24 +8557,21 @@ frame_need_space (fc, reg) } static void -frame_display_row (fc, need_col_headers, max_regs) - Frame_Chunk * fc; - int * need_col_headers; - int * max_regs; +frame_display_row (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 (*max_regs < fc->ncols) + *max_regs = fc->ncols; - if (* need_col_headers) + if (*need_col_headers) { - * need_col_headers = 0; + *need_col_headers = 0; printf (" LOC CFA "); - for (r = 0; r < * max_regs; r++) + for (r = 0; r < *max_regs; r++) if (fc->col_type[r] != DW_CFA_unreferenced) { if (r == fc->ra) @@ -8268,7 +8584,10 @@ frame_display_row (fc, need_col_headers, max_regs) } printf ("%08lx ", fc->pc_begin); - sprintf (tmp, "r%d%+d", fc->cfa_reg, fc->cfa_offset); + if (fc->cfa_exp) + strcpy (tmp, "exp"); + else + sprintf (tmp, "r%d%+d", fc->cfa_reg, fc->cfa_offset); printf ("%-8s ", tmp); for (r = 0; r < fc->ncols; r++) @@ -8289,6 +8608,9 @@ frame_display_row (fc, need_col_headers, max_regs) case DW_CFA_register: sprintf (tmp, "r%d", fc->col_offset[r]); break; + case DW_CFA_expression: + strcpy (tmp, "exp"); + break; default: strcpy (tmp, "n/a"); break; @@ -8300,8 +8622,7 @@ frame_display_row (fc, need_col_headers, max_regs) } static int -size_of_encoded_value (encoding) - int encoding; +size_of_encoded_value (int encoding) { switch (encoding & 0x7) { @@ -8313,69 +8634,91 @@ size_of_encoded_value (encoding) } } +static bfd_vma +get_encoded_value (unsigned char *data, int encoding) +{ + int size = size_of_encoded_value (encoding); + if (encoding & DW_EH_PE_signed) + return byte_get_signed (data, size); + else + return byte_get (data, size); +} + #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; - int addr_size = is_32bit_elf ? 4 : 8; +display_debug_frames (Elf_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; + int addr_size = is_32bit_elf ? 4 : 8; 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; - unsigned char * augmentation_data = NULL; - unsigned long augmentation_data_len = 0; - int encoded_ptr_size = addr_size; + 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; + unsigned char *augmentation_data = NULL; + unsigned long augmentation_data_len = 0; + int encoded_ptr_size = addr_size; + int offset_size; + int initial_length_size; saved_start = start; length = byte_get (start, 4); start += 4; if (length == 0) - return 1; + { + printf ("\n%08lx ZERO terminator\n\n", + (unsigned long)(saved_start - section_start)); + return 1; + } if (length == 0xffffffff) { - warn (_("64-bit DWARF format frames are not supported yet.\n")); - break; + length = byte_get (start, 8); + start += 8; + offset_size = 8; + initial_length_size = 12; + } + else + { + offset_size = 4; + initial_length_size = 4; } - block_end = saved_start + length + 4; - cie_id = byte_get (start, 4); start += 4; + block_end = saved_start + length + initial_length_size; + cie_id = byte_get (start, offset_size); start += offset_size; if (is_eh ? (cie_id == 0) : (cie_id == DW_CIE_ID)) { int version; - fc = (Frame_Chunk *) xmalloc (sizeof (Frame_Chunk)); + fc = 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)); + fc->col_type = xmalloc (sizeof (short int)); + fc->col_offset = xmalloc (sizeof (int)); frame_need_space (fc, max_regs-1); version = *start++; @@ -8460,7 +8803,7 @@ display_debug_frames (section, start, file) } else { - unsigned char * look_for; + unsigned char *look_for; static Frame_Chunk fde_fc; fc = & fde_fc; @@ -8478,8 +8821,8 @@ display_debug_frames (section, start, file) 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)); + fc->col_type = xmalloc (sizeof (short int)); + fc->col_offset = xmalloc (sizeof (int)); frame_need_space (fc, max_regs - 1); cie = fc; fc->augmentation = ""; @@ -8488,8 +8831,8 @@ display_debug_frames (section, start, file) 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)); + fc->col_type = xmalloc (fc->ncols * sizeof (short int)); + fc->col_offset = 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; @@ -8505,7 +8848,9 @@ display_debug_frames (section, start, file) if (fc->fde_encoding) encoded_ptr_size = size_of_encoded_value (fc->fde_encoding); - fc->pc_begin = byte_get (start, encoded_ptr_size); + fc->pc_begin = get_encoded_value (start, fc->fde_encoding); + if ((fc->fde_encoding & 0x70) == DW_EH_PE_pcrel) + fc->pc_begin += section->sh_addr + (start - section_start); start += encoded_ptr_size; fc->pc_range = byte_get (start, encoded_ptr_size); start += encoded_ptr_size; @@ -8534,19 +8879,23 @@ display_debug_frames (section, start, file) /* At this point, fc is the current chunk, cie (if any) is set, and we're about to interpret instructions for the chunk. */ - - if (do_debug_frames_interp) + /* ??? At present we need to do this always, since this sizes the + fc->col_type and fc->col_offset arrays, which we write into always. + We should probably split the interpreted and non-interpreted bits + into two different routines, since there's so much that doesn't + really overlap between them. */ + if (1 || do_debug_frames_interp) { /* Start by making a pass over the chunk, allocating storage and taking note of what registers are used. */ - unsigned char * tmp = start; + unsigned char *tmp = start; while (start < block_end) { unsigned op, opa; - unsigned long reg; + unsigned long reg, tmp; - op = * start ++; + op = *start++; opa = op & 0x3f; if (op & 0xc0) op &= 0xc0; @@ -8612,6 +8961,17 @@ display_debug_frames (section, start, file) case DW_CFA_def_cfa_offset: LEB (); break; + case DW_CFA_def_cfa_expression: + tmp = LEB (); + start += tmp; + break; + case DW_CFA_expression: + reg = LEB (); + tmp = LEB (); + start += tmp; + frame_need_space (fc, reg); + fc->col_type[reg] = DW_CFA_undefined; + break; case DW_CFA_offset_extended_sf: reg = LEB (); SLEB (); frame_need_space (fc, reg); @@ -8623,6 +8983,9 @@ display_debug_frames (section, start, file) case DW_CFA_def_cfa_offset_sf: SLEB (); break; + case DW_CFA_MIPS_advance_loc8: + start += 8; + break; case DW_CFA_GNU_args_size: LEB (); break; @@ -8648,7 +9011,7 @@ display_debug_frames (section, start, file) long l, ofs; bfd_vma vma; - op = * start ++; + op = *start++; opa = op & 0x3f; if (op & 0xc0) op &= 0xc0; @@ -8684,7 +9047,9 @@ display_debug_frames (section, start, file) break; case DW_CFA_set_loc: - vma = byte_get (start, encoded_ptr_size); + vma = get_encoded_value (start, fc->fde_encoding); + if ((fc->fde_encoding & 0x70) == DW_EH_PE_pcrel) + vma += section->sh_addr + (start - section_start); start += encoded_ptr_size; if (do_debug_frames_interp) frame_display_row (fc, &need_col_headers, &max_regs); @@ -8764,7 +9129,7 @@ display_debug_frames (section, start, file) reg = LEB (); roffs = LEB (); if (! do_debug_frames_interp) - printf (" DW_CFA_register: r%ld\n", reg); + printf (" DW_CFA_register: r%ld in r%ld\n", reg, roffs); fc->col_type[reg] = DW_CFA_register; fc->col_offset[reg] = roffs; break; @@ -8772,10 +9137,10 @@ display_debug_frames (section, start, file) case DW_CFA_remember_state: if (! do_debug_frames_interp) printf (" DW_CFA_remember_state\n"); - rs = (Frame_Chunk *) xmalloc (sizeof (Frame_Chunk)); + rs = 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)); + rs->col_type = xmalloc (rs->ncols * sizeof (short int)); + rs->col_offset = 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; @@ -8786,18 +9151,25 @@ display_debug_frames (section, start, file) if (! do_debug_frames_interp) printf (" DW_CFA_restore_state\n"); 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); + if (rs) + { + 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); + } + else if (do_debug_frames_interp) + printf ("Mismatched DW_CFA_restore_state\n"); break; case DW_CFA_def_cfa: fc->cfa_reg = LEB (); fc->cfa_offset = LEB (); + fc->cfa_exp = 0; if (! do_debug_frames_interp) printf (" DW_CFA_def_cfa: r%d ofs %d\n", fc->cfa_reg, fc->cfa_offset); @@ -8805,6 +9177,7 @@ display_debug_frames (section, start, file) case DW_CFA_def_cfa_register: fc->cfa_reg = LEB (); + fc->cfa_exp = 0; if (! do_debug_frames_interp) printf (" DW_CFA_def_cfa_reg: r%d\n", fc->cfa_reg); break; @@ -8820,6 +9193,31 @@ display_debug_frames (section, start, file) printf (" DW_CFA_nop\n"); break; + case DW_CFA_def_cfa_expression: + ul = LEB (); + if (! do_debug_frames_interp) + { + printf (" DW_CFA_def_cfa_expression ("); + decode_location_expression (start, addr_size, ul); + printf (")\n"); + } + fc->cfa_exp = 1; + start += ul; + break; + + case DW_CFA_expression: + reg = LEB (); + ul = LEB (); + if (! do_debug_frames_interp) + { + printf (" DW_CFA_expression: r%ld (", reg); + decode_location_expression (start, addr_size, ul); + printf (")\n"); + } + fc->col_type[reg] = DW_CFA_expression; + start += ul; + break; + case DW_CFA_offset_extended_sf: reg = LEB (); l = SLEB (); @@ -8834,6 +9232,7 @@ display_debug_frames (section, start, file) case DW_CFA_def_cfa_sf: fc->cfa_reg = LEB (); fc->cfa_offset = SLEB (); + fc->cfa_exp = 0; if (! do_debug_frames_interp) printf (" DW_CFA_def_cfa_sf: r%d ofs %d\n", fc->cfa_reg, fc->cfa_offset); @@ -8845,6 +9244,17 @@ display_debug_frames (section, start, file) printf (" DW_CFA_def_cfa_offset_sf: %d\n", fc->cfa_offset); break; + case DW_CFA_MIPS_advance_loc8: + ofs = byte_get (start, 8); start += 8; + if (do_debug_frames_interp) + frame_display_row (fc, &need_col_headers, &max_regs); + else + printf (" DW_CFA_MIPS_advance_loc8: %ld to %08lx\n", + ofs * fc->code_factor, + fc->pc_begin + ofs * fc->code_factor); + fc->pc_begin += ofs * fc->code_factor; + break; + case DW_CFA_GNU_window_save: if (! do_debug_frames_interp) printf (" DW_CFA_GNU_window_save\n"); @@ -8867,17 +9277,6 @@ display_debug_frames (section, start, file) fc->col_offset[reg] = l * fc->data_factor; break; - /* FIXME: How do we handle these? */ - case DW_CFA_def_cfa_expression: - fprintf (stderr, "unsupported DW_CFA_def_cfa_expression\n"); - start = block_end; - break; - - case DW_CFA_expression: - fprintf (stderr, "unsupported DW_CFA_expression\n"); - start = block_end; - break; - default: fprintf (stderr, "unsupported or unknown DW_CFA_%d\n", op); start = block_end; @@ -8900,10 +9299,9 @@ display_debug_frames (section, start, file) #undef SLEB static int -display_debug_not_supported (section, start, file) - Elf32_Internal_Shdr * section; - unsigned char * start ATTRIBUTE_UNUSED; - FILE * file ATTRIBUTE_UNUSED; +display_debug_not_supported (Elf_Internal_Shdr *section, + unsigned char *start ATTRIBUTE_UNUSED, + FILE *file ATTRIBUTE_UNUSED) { printf (_("Displaying the debug contents of section %s is not yet supported.\n"), SECTION_NAME (section)); @@ -8911,62 +9309,40 @@ display_debug_not_supported (section, start, file) return 1; } -/* Pre-scan the .debug_info section to record the size of address. - When dumping the .debug_line, we use that size information, assuming - that all compilation units have the same address size. */ -static int -prescan_debug_info (section, start, file) - Elf32_Internal_Shdr * section ATTRIBUTE_UNUSED; - unsigned char * start; - FILE * file ATTRIBUTE_UNUSED; -{ - DWARF2_External_CompUnit * external; - - external = (DWARF2_External_CompUnit *) start; - - debug_line_pointer_size = BYTE_GET (external->cu_pointer_size); - return 0; -} - - /* A structure containing the name of a debug section and a pointer - to a function that can decode it. The third field is a prescan - function to be run over the section before displaying any of the - sections. */ +/* A structure containing the name of a debug section + and a pointer to a function that can decode it. */ struct { - const char * const name; - int (* display) PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); - int (* prescan) PARAMS ((Elf32_Internal_Shdr *, unsigned char *, FILE *)); + const char *const name; + int (*display) (Elf_Internal_Shdr *, unsigned char *, FILE *); } debug_displays[] = { - { ".debug_abbrev", display_debug_abbrev, NULL }, - { ".debug_aranges", display_debug_aranges, NULL }, - { ".debug_frame", display_debug_frames, NULL }, - { ".debug_info", display_debug_info, prescan_debug_info }, - { ".debug_line", display_debug_lines, NULL }, - { ".debug_pubnames", display_debug_pubnames, NULL }, - { ".eh_frame", display_debug_frames, NULL }, - { ".debug_macinfo", display_debug_macinfo, NULL }, - { ".debug_str", display_debug_str, NULL }, - { ".debug_loc", display_debug_loc, NULL }, - { ".debug_pubtypes", display_debug_not_supported, NULL }, - { ".debug_ranges", display_debug_not_supported, NULL }, - { ".debug_static_func", display_debug_not_supported, NULL }, - { ".debug_static_vars", display_debug_not_supported, NULL }, - { ".debug_types", display_debug_not_supported, NULL }, - { ".debug_weaknames", display_debug_not_supported, NULL } + { ".debug_abbrev", display_debug_abbrev }, + { ".debug_aranges", display_debug_aranges }, + { ".debug_frame", display_debug_frames }, + { ".debug_info", display_debug_info }, + { ".debug_line", display_debug_lines }, + { ".debug_pubnames", display_debug_pubnames }, + { ".eh_frame", display_debug_frames }, + { ".debug_macinfo", display_debug_macinfo }, + { ".debug_str", display_debug_str }, + { ".debug_loc", display_debug_loc }, + { ".debug_pubtypes", display_debug_pubnames }, + { ".debug_ranges", display_debug_not_supported }, + { ".debug_static_func", display_debug_not_supported }, + { ".debug_static_vars", display_debug_not_supported }, + { ".debug_types", display_debug_not_supported }, + { ".debug_weaknames", display_debug_not_supported } }; static int -display_debug_section (section, file) - Elf32_Internal_Shdr * section; - FILE * file; +display_debug_section (Elf_Internal_Shdr *section, FILE *file) { - char * name = SECTION_NAME (section); - bfd_size_type length; - unsigned char * start; - int i; + char *name = SECTION_NAME (section); + bfd_size_type length; + unsigned char *start; + int i; length = section->sh_size; if (length == 0) @@ -8975,8 +9351,8 @@ display_debug_section (section, file) return 0; } - start = (unsigned char *) get_data (NULL, file, section->sh_offset, length, - _("debug section data")); + start = get_data (NULL, file, section->sh_offset, length, + _("debug section data")); if (!start) return 0; @@ -9004,55 +9380,17 @@ display_debug_section (section, file) } static int -process_section_contents (file) - FILE * file; +process_section_contents (FILE *file) { - Elf32_Internal_Shdr * section; - unsigned int i; + Elf_Internal_Shdr *section; + unsigned int i; if (! do_dump) return 1; - /* Pre-scan the debug sections to find some debug information not - present in some of them. For the .debug_line, we must find out the - size of address (specified in .debug_info and .debug_aranges). */ - for (i = 0, section = section_headers; - i < elf_header.e_shnum && i < num_dump_sects; - i ++, section ++) - { - char * name = SECTION_NAME (section); - int j; - - if (section->sh_size == 0) - continue; - - /* See if there is some pre-scan operation for this section. */ - for (j = NUM_ELEM (debug_displays); j--;) - if (strcmp (debug_displays[j].name, name) == 0) - { - if (debug_displays[j].prescan != NULL) - { - bfd_size_type length; - unsigned char * start; - - length = section->sh_size; - start = ((unsigned char *) - get_data (NULL, file, section->sh_offset, length, - _("debug section data"))); - if (!start) - return 0; - - debug_displays[j].prescan (section, start, file); - free (start); - } - - break; - } - } - for (i = 0, section = section_headers; i < elf_header.e_shnum && i < num_dump_sects; - i ++, section ++) + i++, section++) { #ifdef SUPPORT_DISASSEMBLY if (dump_sects[i] & DISASS_DUMP) @@ -9072,8 +9410,7 @@ process_section_contents (file) } static void -process_mips_fpe_exception (mask) - int mask; +process_mips_fpe_exception (int mask) { if (mask) { @@ -9094,10 +9431,9 @@ process_mips_fpe_exception (mask) } static int -process_mips_specific (file) - FILE * file; +process_mips_specific (FILE *file) { - Elf_Internal_Dyn * entry; + Elf_Internal_Dyn *entry; size_t liblist_offset = 0; size_t liblistno = 0; size_t conflictsno = 0; @@ -9113,16 +9449,20 @@ process_mips_specific (file) switch (entry->d_tag) { case DT_MIPS_LIBLIST: - liblist_offset = entry->d_un.d_val - loadaddr; + liblist_offset + = offset_from_vma (file, entry->d_un.d_val, + liblistno * sizeof (Elf32_External_Lib)); break; case DT_MIPS_LIBLISTNO: liblistno = entry->d_un.d_val; break; case DT_MIPS_OPTIONS: - options_offset = entry->d_un.d_val - loadaddr; + options_offset = offset_from_vma (file, entry->d_un.d_val, 0); break; case DT_MIPS_CONFLICT: - conflicts_offset = entry->d_un.d_val - loadaddr; + conflicts_offset + = offset_from_vma (file, entry->d_un.d_val, + conflictsno * sizeof (Elf32_External_Conflict)); break; case DT_MIPS_CONFLICTNO: conflictsno = entry->d_un.d_val; @@ -9133,13 +9473,12 @@ process_mips_specific (file) if (liblist_offset != 0 && liblistno != 0 && do_dynamic) { - Elf32_External_Lib * elib; + Elf32_External_Lib *elib; size_t cnt; - elib = ((Elf32_External_Lib *) - get_data (NULL, file, liblist_offset, - liblistno * sizeof (Elf32_External_Lib), - _("liblist"))); + elib = get_data (NULL, file, liblist_offset, + liblistno * sizeof (Elf32_External_Lib), + _("liblist")); if (elib) { printf ("\nSection '.liblist' contains %lu entries:\n", @@ -9152,7 +9491,7 @@ process_mips_specific (file) Elf32_Lib liblist; time_t time; char timebuf[20]; - struct tm * tmp; + struct tm *tmp; liblist.l_name = BYTE_GET (elib[cnt].l_name); time = BYTE_GET (elib[cnt].l_time_stamp); @@ -9176,7 +9515,7 @@ process_mips_specific (file) { static const struct { - const char * name; + const char *name; int bit; } l_flags_vals[] = @@ -9212,23 +9551,22 @@ process_mips_specific (file) if (options_offset != 0) { - Elf_External_Options * eopt; - Elf_Internal_Shdr * sect = section_headers; - Elf_Internal_Options * iopt; - Elf_Internal_Options * option; + Elf_External_Options *eopt; + Elf_Internal_Shdr *sect = section_headers; + Elf_Internal_Options *iopt; + Elf_Internal_Options *option; size_t offset; int cnt; /* Find the section header so that we get the size. */ while (sect->sh_type != SHT_MIPS_OPTIONS) - ++ sect; + ++sect; - eopt = (Elf_External_Options *) get_data (NULL, file, options_offset, - sect->sh_size, _("options")); + eopt = get_data (NULL, file, options_offset, sect->sh_size, + _("options")); if (eopt) { - iopt = ((Elf_Internal_Options *) - malloc ((sect->sh_size / sizeof (eopt)) * sizeof (* iopt))); + iopt = malloc ((sect->sh_size / sizeof (eopt)) * sizeof (*iopt)); if (iopt == NULL) { error (_("Out of memory")); @@ -9240,7 +9578,7 @@ process_mips_specific (file) while (offset < sect->sh_size) { - Elf_External_Options * eoption; + Elf_External_Options *eoption; eoption = (Elf_External_Options *) ((char *) eopt + offset); @@ -9275,8 +9613,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); @@ -9296,7 +9634,7 @@ process_mips_specific (file) else { /* 64 bit form. */ - Elf64_External_RegInfo * ereg; + Elf64_External_RegInfo *ereg; Elf64_Internal_RegInfo reginfo; ereg = (Elf64_External_RegInfo *) (option + 1); @@ -9393,7 +9731,7 @@ process_mips_specific (file) break; } - len = sizeof (* eopt); + len = sizeof (*eopt); while (len < option->size) if (((char *) option)[len] >= ' ' && ((char *) option)[len] < 0x7f) @@ -9411,7 +9749,7 @@ process_mips_specific (file) if (conflicts_offset != 0 && conflictsno != 0) { - Elf32_Conflict * iconf; + Elf32_Conflict *iconf; size_t cnt; if (dynamic_symbols == NULL) @@ -9420,7 +9758,7 @@ process_mips_specific (file) return 0; } - iconf = (Elf32_Conflict *) malloc (conflictsno * sizeof (* iconf)); + iconf = malloc (conflictsno * sizeof (*iconf)); if (iconf == NULL) { error (_("Out of memory")); @@ -9429,12 +9767,10 @@ process_mips_specific (file) if (is_32bit_elf) { - Elf32_External_Conflict * econf32; + Elf32_External_Conflict *econf32; - econf32 = ((Elf32_External_Conflict *) - get_data (NULL, file, conflicts_offset, - conflictsno * sizeof (* econf32), - _("conflict"))); + econf32 = get_data (NULL, file, conflicts_offset, + conflictsno * sizeof (*econf32), _("conflict")); if (!econf32) return 0; @@ -9445,12 +9781,10 @@ process_mips_specific (file) } else { - Elf64_External_Conflict * econf64; + Elf64_External_Conflict *econf64; - econf64 = ((Elf64_External_Conflict *) - get_data (NULL, file, conflicts_offset, - conflictsno * sizeof (* econf64), - _("conflict"))); + econf64 = get_data (NULL, file, conflicts_offset, + conflictsno * sizeof (*econf64), _("conflict")); if (!econf64) return 0; @@ -9460,15 +9794,15 @@ process_mips_specific (file) free (econf64); } - printf (_("\nSection '.conflict' contains %ld entries:\n"), - (long) conflictsno); + printf (_("\nSection '.conflict' contains %lu entries:\n"), + (unsigned long) conflictsno); puts (_(" Num: Index Value Name")); for (cnt = 0; cnt < conflictsno; ++cnt) { - Elf_Internal_Sym * psym = & dynamic_symbols [iconf [cnt]]; + Elf_Internal_Sym *psym = & dynamic_symbols[iconf[cnt]]; - printf ("%5lu: %8lu ", (unsigned long) cnt, iconf [cnt]); + printf ("%5lu: %8lu ", (unsigned long) cnt, iconf[cnt]); print_vma (psym->st_value, FULL_HEX); putchar (' '); print_symbol (25, dynamic_strings + psym->st_name); @@ -9482,12 +9816,11 @@ process_mips_specific (file) } static int -process_gnu_liblist (file) - FILE * file; +process_gnu_liblist (FILE *file) { - Elf_Internal_Shdr * section, * string_sec; - Elf32_External_Lib * elib; - char * strtab; + Elf_Internal_Shdr *section, *string_sec; + Elf32_External_Lib *elib; + char *strtab; size_t cnt; unsigned i; @@ -9496,22 +9829,20 @@ process_gnu_liblist (file) for (i = 0, section = section_headers; i < elf_header.e_shnum; - i++, section ++) + i++, section++) { switch (section->sh_type) { case SHT_GNU_LIBLIST: - elib = ((Elf32_External_Lib *) - get_data (NULL, file, section->sh_offset, section->sh_size, - _("liblist"))); + elib = get_data (NULL, file, section->sh_offset, section->sh_size, + _("liblist")); if (elib == NULL) break; string_sec = SECTION_HEADER (section->sh_link); - strtab = (char *) get_data (NULL, file, string_sec->sh_offset, - string_sec->sh_size, - _("liblist string table")); + strtab = get_data (NULL, file, string_sec->sh_offset, + string_sec->sh_size, _("liblist string table")); if (strtab == NULL || section->sh_entsize != sizeof (Elf32_External_Lib)) @@ -9532,7 +9863,7 @@ process_gnu_liblist (file) Elf32_Lib liblist; time_t time; char timebuf[20]; - struct tm * tmp; + struct tm *tmp; liblist.l_name = BYTE_GET (elib[cnt].l_name); time = BYTE_GET (elib[cnt].l_time_stamp); @@ -9562,18 +9893,18 @@ process_gnu_liblist (file) } static const char * -get_note_type (e_type) - unsigned e_type; +get_note_type (unsigned e_type) { static char buff[64]; switch (e_type) { + case NT_AUXV: return _("NT_AUXV (auxiliary vector)"); case NT_PRSTATUS: return _("NT_PRSTATUS (prstatus structure)"); case NT_FPREGSET: return _("NT_FPREGSET (floating point registers)"); - case NT_PRPSINFO: return _("NT_PRPSINFO (prpsinfo structure)"); - case NT_TASKSTRUCT: return _("NT_TASKSTRUCT (task structure)"); - case NT_PRXFPREG: return _("NT_PRXFPREG (user_xfpregs structure)"); + case NT_PRPSINFO: return _("NT_PRPSINFO (prpsinfo structure)"); + case NT_TASKSTRUCT: return _("NT_TASKSTRUCT (task structure)"); + case NT_PRXFPREG: return _("NT_PRXFPREG (user_xfpregs structure)"); case NT_PSTATUS: return _("NT_PSTATUS (pstatus structure)"); case NT_FPREGS: return _("NT_FPREGS (floating point registers)"); case NT_PSINFO: return _("NT_PSINFO (psinfo structure)"); @@ -9587,8 +9918,7 @@ get_note_type (e_type) } static const char * -get_netbsd_elfcore_note_type (e_type) - unsigned e_type; +get_netbsd_elfcore_note_type (unsigned e_type) { static char buff[64]; @@ -9654,8 +9984,7 @@ get_netbsd_elfcore_note_type (e_type) If the value of namesz is zero, there is no name present. */ static int -process_note (pnote) - Elf32_Internal_Note * pnote; +process_note (Elf_Internal_Note *pnote) { const char *nt; @@ -9685,20 +10014,16 @@ process_note (pnote) static int -process_corefile_note_segment (file, offset, length) - FILE * file; - bfd_vma offset; - bfd_vma length; +process_corefile_note_segment (FILE *file, bfd_vma offset, bfd_vma length) { - Elf_External_Note * pnotes; - Elf_External_Note * external; - int res = 1; + Elf_External_Note *pnotes; + Elf_External_Note *external; + int res = 1; if (length <= 0) return 0; - pnotes = (Elf_External_Note *) get_data (NULL, file, offset, length, - _("notes")); + pnotes = get_data (NULL, file, offset, length, _("notes")); if (!pnotes) return 0; @@ -9710,9 +10035,9 @@ process_corefile_note_segment (file, offset, length) while (external < (Elf_External_Note *)((char *) pnotes + length)) { - Elf_External_Note * next; - Elf32_Internal_Note inote; - char * temp = NULL; + Elf_External_Note *next; + Elf_Internal_Note inote; + char *temp = NULL; inote.type = BYTE_GET (external->type); inote.namesz = BYTE_GET (external->namesz); @@ -9771,37 +10096,18 @@ process_corefile_note_segment (file, offset, length) } static int -process_corefile_note_segments (file) - FILE * file; +process_corefile_note_segments (FILE *file) { - Elf_Internal_Phdr * program_headers; - Elf_Internal_Phdr * segment; - unsigned int i; - int res = 1; - - program_headers = (Elf_Internal_Phdr *) malloc - (elf_header.e_phnum * sizeof (Elf_Internal_Phdr)); - - if (program_headers == NULL) - { - error (_("Out of memory\n")); - return 0; - } - - if (is_32bit_elf) - i = get_32bit_program_headers (file, program_headers); - else - i = get_64bit_program_headers (file, program_headers); + Elf_Internal_Phdr *segment; + unsigned int i; + int res = 1; - if (i == 0) - { - free (program_headers); + if (! get_program_headers (file)) return 0; - } for (i = 0, segment = program_headers; i < elf_header.e_phnum; - i ++, segment ++) + i++, segment++) { if (segment->p_type == PT_NOTE) res &= process_corefile_note_segment (file, @@ -9809,14 +10115,11 @@ process_corefile_note_segments (file) (bfd_vma) segment->p_filesz); } - free (program_headers); - return res; } static int -process_corefile_contents (file) - FILE * file; +process_corefile_contents (FILE *file) { /* If we have not been asked to display the notes then do nothing. */ if (! do_notes) @@ -9837,8 +10140,7 @@ process_corefile_contents (file) } static int -process_arch_specific (file) - FILE * file; +process_arch_specific (FILE *file) { if (! do_arch) return 1; @@ -9856,24 +10158,29 @@ process_arch_specific (file) } static int -get_file_header (file) - FILE * file; +get_file_header (FILE *file) { /* Read in the identity array. */ if (fread (elf_header.e_ident, EI_NIDENT, 1, file) != 1) return 0; /* Determine how to read the rest of the header. */ - switch (elf_header.e_ident [EI_DATA]) + switch (elf_header.e_ident[EI_DATA]) { default: /* fall through */ case ELFDATANONE: /* fall through */ - case ELFDATA2LSB: byte_get = byte_get_little_endian; break; - case ELFDATA2MSB: byte_get = byte_get_big_endian; break; + case ELFDATA2LSB: + byte_get = byte_get_little_endian; + byte_put = byte_put_little_endian; + break; + case ELFDATA2MSB: + byte_get = byte_get_big_endian; + byte_put = byte_put_big_endian; + break; } /* For now we only support 32 bit and 64 bit ELF files. */ - is_32bit_elf = (elf_header.e_ident [EI_CLASS] != ELFCLASS64); + is_32bit_elf = (elf_header.e_ident[EI_CLASS] != ELFCLASS64); /* Read in the rest of the header. */ if (is_32bit_elf) @@ -9904,7 +10211,7 @@ get_file_header (file) /* If we have been compiled with sizeof (bfd_vma) == 4, then we will not be able to cope with the 64bit data found in 64 ELF files. Detect this now and abort before we start - overwritting things. */ + overwriting things. */ if (sizeof (bfd_vma) < 8) { error (_("This instance of readelf has been built without support for a\n\ @@ -9943,31 +10250,18 @@ get_file_header (file) return 1; } +/* Process one ELF object file according to the command line options. + This file may actually be stored in an archive. The file is + positioned at the start of the ELF object. */ + static int -process_file (file_name) - char * file_name; +process_object (char *file_name, FILE *file) { - FILE * file; - struct stat statbuf; unsigned int i; - if (stat (file_name, & statbuf) < 0) - { - error (_("Cannot stat input file %s.\n"), file_name); - return 1; - } - - file = fopen (file_name, "rb"); - if (file == NULL) - { - error (_("Input file %s not found.\n"), file_name); - return 1; - } - if (! get_file_header (file)) { error (_("%s: Failed to read file header\n"), file_name); - fclose (file); return 1; } @@ -9983,16 +10277,20 @@ process_file (file_name) printf (_("\nFile: %s\n"), file_name); if (! process_file_header ()) - { - fclose (file); - return 1; - } + return 1; - process_section_headers (file); + if (! process_section_headers (file)) + { + /* Without loaded section headers we + cannot process lots of things. */ + do_unwind = do_version = do_dump = do_arch = 0; - process_program_headers (file); + if (! do_using_dynamic) + do_syms = do_reloc = 0; + } - process_dynamic_segment (file); + if (process_program_headers (file)) + process_dynamic_segment (file); process_relocs (file); @@ -10012,7 +10310,11 @@ process_file (file_name) process_arch_specific (file); - fclose (file); + if (program_headers) + { + free (program_headers); + program_headers = NULL; + } if (section_headers) { @@ -10049,13 +10351,237 @@ process_file (file_name) return 0; } +/* Process an ELF archive. The file is positioned just after the + ARMAG string. */ + +static int +process_archive (char *file_name, FILE *file) +{ + struct ar_hdr arhdr; + size_t got; + unsigned long size; + char *longnames = NULL; + unsigned long longnames_size = 0; + size_t file_name_size; + int ret; + + show_name = 1; + + got = fread (&arhdr, 1, sizeof arhdr, file); + if (got != sizeof arhdr) + { + if (got == 0) + return 0; + + error (_("%s: failed to read archive header\n"), file_name); + return 1; + } + + if (memcmp (arhdr.ar_name, "/ ", 16) == 0) + { + /* This is the archive symbol table. Skip it. + FIXME: We should have an option to dump it. */ + size = strtoul (arhdr.ar_size, NULL, 10); + if (fseek (file, size + (size & 1), SEEK_CUR) != 0) + { + error (_("%s: failed to skip archive symbol table\n"), file_name); + return 1; + } + + got = fread (&arhdr, 1, sizeof arhdr, file); + if (got != sizeof arhdr) + { + if (got == 0) + return 0; + + error (_("%s: failed to read archive header\n"), file_name); + return 1; + } + } + + if (memcmp (arhdr.ar_name, "// ", 16) == 0) + { + /* This is the archive string table holding long member + names. */ + + longnames_size = strtoul (arhdr.ar_size, NULL, 10); + + longnames = malloc (longnames_size); + if (longnames == NULL) + { + error (_("Out of memory\n")); + return 1; + } + + if (fread (longnames, longnames_size, 1, file) != 1) + { + free (longnames); + error(_("%s: failed to read string table\n"), file_name); + return 1; + } + + if ((longnames_size & 1) != 0) + getc (file); + + got = fread (&arhdr, 1, sizeof arhdr, file); + if (got != sizeof arhdr) + { + free (longnames); + + if (got == 0) + return 0; + + error (_("%s: failed to read archive header\n"), file_name); + return 1; + } + } + + file_name_size = strlen (file_name); + ret = 0; + + while (1) + { + char *name; + char *nameend; + char *namealc; + + if (arhdr.ar_name[0] == '/') + { + unsigned long off; + + off = strtoul (arhdr.ar_name + 1, NULL, 10); + if (off >= longnames_size) + { + error (_("%s: invalid archive string table offset %lu\n"), off); + ret = 1; + break; + } + + name = longnames + off; + nameend = memchr (name, '/', longnames_size - off); + } + else + { + name = arhdr.ar_name; + nameend = memchr (name, '/', 16); + } + + if (nameend == NULL) + { + error (_("%s: bad archive file name\n")); + ret = 1; + break; + } + + namealc = malloc (file_name_size + (nameend - name) + 3); + if (namealc == NULL) + { + error (_("Out of memory\n")); + ret = 1; + break; + } + + memcpy (namealc, file_name, file_name_size); + namealc[file_name_size] = '('; + memcpy (namealc + file_name_size + 1, name, nameend - name); + namealc[file_name_size + 1 + (nameend - name)] = ')'; + namealc[file_name_size + 2 + (nameend - name)] = '\0'; + + archive_file_offset = ftell (file); + archive_file_size = strtoul (arhdr.ar_size, NULL, 10); + + ret |= process_object (namealc, file); + + free (namealc); + + if (fseek (file, + (archive_file_offset + + archive_file_size + + (archive_file_size & 1)), + SEEK_SET) != 0) + { + error (_("%s: failed to seek to next archive header\n"), file_name); + ret = 1; + break; + } + + got = fread (&arhdr, 1, sizeof arhdr, file); + if (got != sizeof arhdr) + { + if (got == 0) + break; + + error (_("%s: failed to read archive header\n"), file_name); + ret = 1; + break; + } + } + + if (longnames != 0) + free (longnames); + + return ret; +} + +static int +process_file (char *file_name) +{ + FILE *file; + struct stat statbuf; + char armag[SARMAG]; + int ret; + + if (stat (file_name, &statbuf) < 0) + { + if (errno == ENOENT) + error (_("'%s': No such file\n"), file_name); + else + error (_("Could not locate '%s'. System error message: %s\n"), + file_name, strerror (errno)); + return 1; + } + + if (! S_ISREG (statbuf.st_mode)) + { + error (_("'%s' is not an ordinary file\n"), file_name); + return 1; + } + + file = fopen (file_name, "rb"); + if (file == NULL) + { + error (_("Input file '%s' is not readable.\n"), file_name); + return 1; + } + + if (fread (armag, SARMAG, 1, file) != 1) + { + error (_("%s: Failed to read file header\n"), file_name); + fclose (file); + return 1; + } + + if (memcmp (armag, ARMAG, SARMAG) == 0) + ret = process_archive (file_name, file); + else + { + rewind (file); + archive_file_size = archive_file_offset = 0; + ret = process_object (file_name, file); + } + + fclose (file); + + return ret; +} + #ifdef SUPPORT_DISASSEMBLY /* Needed by the i386 disassembler. For extra credit, someone could fix this so that we insert symbolic addresses here, esp for GOT/PLT symbols. */ void -print_address (unsigned int addr, FILE * outfile) +print_address (unsigned int addr, FILE *outfile) { fprintf (outfile,"0x%8.8x", addr); } @@ -10068,14 +10594,12 @@ db_task_printsym (unsigned int addr) } #endif -int main PARAMS ((int, char **)); - int -main (argc, argv) - int argc; - char ** argv; +main (int argc, char **argv) { int err; + char *cmdline_dump_sects = NULL; + unsigned num_cmdline_dump_sects = 0; #if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES) setlocale (LC_MESSAGES, ""); @@ -10091,12 +10615,38 @@ main (argc, argv) if (optind < (argc - 1)) show_name = 1; + /* When processing more than one file remember the dump requests + issued on command line to reset them after each file. */ + if (optind + 1 < argc && dump_sects != NULL) + { + cmdline_dump_sects = malloc (num_dump_sects); + if (cmdline_dump_sects == NULL) + error (_("Out of memory allocating dump request table.")); + else + { + memcpy (cmdline_dump_sects, dump_sects, num_dump_sects); + num_cmdline_dump_sects = num_dump_sects; + } + } + err = 0; while (optind < argc) - err |= process_file (argv [optind ++]); + { + err |= process_file (argv[optind++]); + + /* Reset dump requests. */ + if (optind < argc && dump_sects != NULL) + { + num_dump_sects = num_cmdline_dump_sects; + if (num_cmdline_dump_sects > 0) + memcpy (dump_sects, cmdline_dump_sects, num_cmdline_dump_sects); + } + } if (dump_sects != NULL) free (dump_sects); + if (cmdline_dump_sects != NULL) + free (cmdline_dump_sects); return err; } diff --git a/contrib/binutils/binutils/rename.c b/contrib/binutils/binutils/rename.c index 1a6a86b..398152e 100644 --- a/contrib/binutils/binutils/rename.c +++ b/contrib/binutils/binutils/rename.c @@ -1,5 +1,5 @@ /* rename.c -- rename a file, preserving symlinks. - Copyright 1999 Free Software Foundation, Inc. + Copyright 1999, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -37,7 +37,7 @@ #define O_BINARY 0 #endif -static int simple_copy PARAMS ((const char *, const char *)); +static int simple_copy (const char *, const char *); /* The number of bytes to copy at once. */ #define COPY_BUF 8192 @@ -46,9 +46,7 @@ static int simple_copy PARAMS ((const char *, const char *)); Return 0 if ok, -1 if error. */ static int -simple_copy (from, to) - const char *from; - const char *to; +simple_copy (const char *from, const char *to) { int fromfd, tofd, nread; int saved; @@ -95,9 +93,7 @@ simple_copy (from, to) STATBUF. */ void -set_times (destination, statbuf) - const char *destination; - const struct stat *statbuf; +set_times (const char *destination, const struct stat *statbuf) { int result; @@ -144,12 +140,9 @@ set_times (destination, statbuf) Return 0 if ok, -1 if error. */ int -smart_rename (from, to, preserve_dates) - const char *from; - const char *to; - int preserve_dates; +smart_rename (const char *from, const char *to, int preserve_dates) { - boolean exists; + bfd_boolean exists; struct stat s; int ret = 0; @@ -166,14 +159,18 @@ smart_rename (from, to, preserve_dates) if (ret != 0) { /* We have to clean up here. */ - - non_fatal (_("%s: rename: %s"), to, strerror (errno)); + non_fatal (_("unable to rename '%s' reason: %s"), to, strerror (errno)); unlink (from); } #else /* Use rename only if TO is not a symbolic link and has - only one hard link. */ - if (! exists || (!S_ISLNK (s.st_mode) && s.st_nlink == 1)) + only one hard link, and we have permission to write to it. */ + if (! exists + || (!S_ISLNK (s.st_mode) + && S_ISREG (s.st_mode) + && (s.st_mode & S_IWUSR) + && s.st_nlink == 1) + ) { ret = rename (from, to); if (ret == 0) @@ -200,7 +197,7 @@ smart_rename (from, to, preserve_dates) else { /* We have to clean up here. */ - non_fatal (_("%s: rename: %s"), to, strerror (errno)); + non_fatal (_("unable to rename '%s' reason: %s"), to, strerror (errno)); unlink (from); } } @@ -208,7 +205,7 @@ smart_rename (from, to, preserve_dates) { ret = simple_copy (from, to); if (ret != 0) - non_fatal (_("%s: simple_copy: %s"), to, strerror (errno)); + non_fatal (_("unable to copy file '%s' reason: %s"), to, strerror (errno)); if (preserve_dates) set_times (to, &s); diff --git a/contrib/binutils/binutils/resbin.c b/contrib/binutils/binutils/resbin.c index 079818c..ad14bda 100644 --- a/contrib/binutils/binutils/resbin.c +++ b/contrib/binutils/binutils/resbin.c @@ -1,5 +1,6 @@ /* resbin.c -- manipulate the Windows binary resource format. - Copyright 1997, 1998, 1999, 2002 Free Software Foundation, Inc. + Copyright 1997, 1998, 1999, 2002, 2003 + Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GNU Binutils. @@ -36,42 +37,43 @@ /* Local functions. */ -static void toosmall PARAMS ((const char *)); +static void toosmall (const char *); + static unichar *get_unicode - PARAMS ((const unsigned char *, unsigned long, int, int *)); + (const unsigned char *, unsigned long, int, int *); static int get_resid - PARAMS ((struct res_id *, const unsigned char *, unsigned long, int)); + (struct res_id *, const unsigned char *, unsigned long, int); static struct res_resource *bin_to_res_generic - PARAMS ((enum res_type, const unsigned char *, unsigned long)); + (enum res_type, const unsigned char *, unsigned long); static struct res_resource *bin_to_res_cursor - PARAMS ((const unsigned char *, unsigned long, int)); + (const unsigned char *, unsigned long, int); static struct res_resource *bin_to_res_menu - PARAMS ((const unsigned char *, unsigned long, int)); + (const unsigned char *, unsigned long, int); static struct menuitem *bin_to_res_menuitems - PARAMS ((const unsigned char *, unsigned long, int, int *)); + (const unsigned char *, unsigned long, int, int *); static struct menuitem *bin_to_res_menuexitems - PARAMS ((const unsigned char *, unsigned long, int, int *)); + (const unsigned char *, unsigned long, int, int *); static struct res_resource *bin_to_res_dialog - PARAMS ((const unsigned char *, unsigned long, int)); + (const unsigned char *, unsigned long, int); static struct res_resource *bin_to_res_string - PARAMS ((const unsigned char *, unsigned long, int)); + (const unsigned char *, unsigned long, int); static struct res_resource *bin_to_res_fontdir - PARAMS ((const unsigned char *, unsigned long, int)); + (const unsigned char *, unsigned long, int); static struct res_resource *bin_to_res_accelerators - PARAMS ((const unsigned char *, unsigned long, int)); + (const unsigned char *, unsigned long, int); static struct res_resource *bin_to_res_rcdata - PARAMS ((const unsigned char *, unsigned long, int)); + (const unsigned char *, unsigned long, int); static struct res_resource *bin_to_res_group_cursor - PARAMS ((const unsigned char *, unsigned long, int)); + (const unsigned char *, unsigned long, int); static struct res_resource *bin_to_res_group_icon - PARAMS ((const unsigned char *, unsigned long, int)); + (const unsigned char *, unsigned long, int); static struct res_resource *bin_to_res_version - PARAMS ((const unsigned char *, unsigned long, int)); + (const unsigned char *, unsigned long, int); static struct res_resource *bin_to_res_userdata - PARAMS ((const unsigned char *, unsigned long, int)); + (const unsigned char *, unsigned long, int); static void get_version_header - PARAMS ((const unsigned char *, unsigned long, int, const char *, - unichar **, int *, int *, int *, int *)); + (const unsigned char *, unsigned long, int, const char *, + unichar **, int *, int *, int *, int *); /* Given a resource type ID, a pointer to data, a length, return a res_resource structure which represents that resource. The caller @@ -79,11 +81,8 @@ static void get_version_header of the returned structure. */ struct res_resource * -bin_to_res (type, data, length, big_endian) - struct res_id type; - const unsigned char *data; - unsigned long length; - int big_endian; +bin_to_res (struct res_id type, const unsigned char *data, + unsigned long length, int big_endian) { if (type.named) return bin_to_res_userdata (data, length, big_endian); @@ -128,8 +127,7 @@ bin_to_res (type, data, length, big_endian) /* Give an error if the binary data is too small. */ static void -toosmall (msg) - const char *msg; +toosmall (const char *msg) { fatal (_("%s: not enough binary data"), msg); } @@ -137,11 +135,8 @@ toosmall (msg) /* Swap in a NULL terminated unicode string. */ static unichar * -get_unicode (data, length, big_endian, retlen) - const unsigned char *data; - unsigned long length; - int big_endian; - int *retlen; +get_unicode (const unsigned char *data, unsigned long length, + int big_endian, int *retlen) { int c, i; unichar *ret; @@ -171,11 +166,8 @@ get_unicode (data, length, big_endian, retlen) /* Get a resource identifier. This returns the number of bytes used. */ static int -get_resid (id, data, length, big_endian) - struct res_id *id; - const unsigned char *data; - unsigned long length; - int big_endian; +get_resid (struct res_id *id, const unsigned char *data, + unsigned long length, int big_endian) { int first; @@ -203,10 +195,8 @@ get_resid (id, data, length, big_endian) binary. */ struct res_resource * -bin_to_res_generic (type, data, length) - enum res_type type; - const unsigned char *data; - unsigned long length; +bin_to_res_generic (enum res_type type, const unsigned char *data, + unsigned long length) { struct res_resource *r; @@ -221,10 +211,8 @@ bin_to_res_generic (type, data, length) /* Convert a cursor resource from binary. */ struct res_resource * -bin_to_res_cursor (data, length, big_endian) - const unsigned char *data; - unsigned long length; - int big_endian; +bin_to_res_cursor (const unsigned char *data, unsigned long length, + int big_endian) { struct cursor *c; struct res_resource *r; @@ -248,10 +236,8 @@ bin_to_res_cursor (data, length, big_endian) /* Convert a menu resource from binary. */ struct res_resource * -bin_to_res_menu (data, length, big_endian) - const unsigned char *data; - unsigned long length; - int big_endian; +bin_to_res_menu (const unsigned char *data, unsigned long length, + int big_endian) { struct res_resource *r; struct menu *m; @@ -300,11 +286,8 @@ bin_to_res_menu (data, length, big_endian) /* Convert menu items from binary. */ static struct menuitem * -bin_to_res_menuitems (data, length, big_endian, read) - const unsigned char *data; - unsigned long length; - int big_endian; - int *read; +bin_to_res_menuitems (const unsigned char *data, unsigned long length, + int big_endian, int *read) { struct menuitem *first, **pp; @@ -381,11 +364,8 @@ bin_to_res_menuitems (data, length, big_endian, read) /* Convert menuex items from binary. */ static struct menuitem * -bin_to_res_menuexitems (data, length, big_endian, read) - const unsigned char *data; - unsigned long length; - int big_endian; - int *read; +bin_to_res_menuexitems (const unsigned char *data, unsigned long length, + int big_endian, int *read) { struct menuitem *first, **pp; @@ -459,10 +439,8 @@ bin_to_res_menuexitems (data, length, big_endian, read) /* Convert a dialog resource from binary. */ static struct res_resource * -bin_to_res_dialog (data, length, big_endian) - const unsigned char *data; - unsigned long length; - int big_endian; +bin_to_res_dialog (const unsigned char *data, unsigned long length, + int big_endian) { int signature; struct dialog *d; @@ -647,10 +625,8 @@ bin_to_res_dialog (data, length, big_endian) /* Convert a stringtable resource from binary. */ static struct res_resource * -bin_to_res_string (data, length, big_endian) - const unsigned char *data; - unsigned long length; - int big_endian; +bin_to_res_string (const unsigned char *data, unsigned long length, + int big_endian) { struct stringtable *st; int i; @@ -696,10 +672,8 @@ bin_to_res_string (data, length, big_endian) /* Convert a fontdir resource from binary. */ static struct res_resource * -bin_to_res_fontdir (data, length, big_endian) - const unsigned char *data; - unsigned long length; - int big_endian; +bin_to_res_fontdir (const unsigned char *data, unsigned long length, + int big_endian) { int c, i; struct fontdir *first, **pp; @@ -768,10 +742,8 @@ bin_to_res_fontdir (data, length, big_endian) /* Convert an accelerators resource from binary. */ static struct res_resource * -bin_to_res_accelerators (data, length, big_endian) - const unsigned char *data; - unsigned long length; - int big_endian; +bin_to_res_accelerators (const unsigned char *data, unsigned long length, + int big_endian) { struct accelerator *first, **pp; struct res_resource *r; @@ -813,10 +785,8 @@ bin_to_res_accelerators (data, length, big_endian) /* Convert an rcdata resource from binary. */ static struct res_resource * -bin_to_res_rcdata (data, length, big_endian) - const unsigned char *data; - unsigned long length; - int big_endian ATTRIBUTE_UNUSED; +bin_to_res_rcdata (const unsigned char *data, unsigned long length, + int big_endian ATTRIBUTE_UNUSED) { struct rcdata_item *ri; struct res_resource *r; @@ -838,10 +808,8 @@ bin_to_res_rcdata (data, length, big_endian) /* Convert a group cursor resource from binary. */ static struct res_resource * -bin_to_res_group_cursor (data, length, big_endian) - const unsigned char *data; - unsigned long length; - int big_endian; +bin_to_res_group_cursor (const unsigned char *data, unsigned long length, + int big_endian) { int type, c, i; struct group_cursor *first, **pp; @@ -896,10 +864,8 @@ bin_to_res_group_cursor (data, length, big_endian) /* Convert a group icon resource from binary. */ static struct res_resource * -bin_to_res_group_icon (data, length, big_endian) - const unsigned char *data; - unsigned long length; - int big_endian; +bin_to_res_group_icon (const unsigned char *data, unsigned long length, + int big_endian) { int type, c, i; struct group_icon *first, **pp; @@ -958,17 +924,9 @@ bin_to_res_group_icon (data, length, big_endian) to the type, and *OFF to the offset to the children. */ static void -get_version_header (data, length, big_endian, key, pkey, len, vallen, type, - off) - const unsigned char *data; - unsigned long length; - int big_endian; - const char *key; - unichar **pkey; - int *len; - int *vallen; - int *type; - int *off; +get_version_header (const unsigned char *data, unsigned long length, + int big_endian, const char *key, unichar **pkey, + int *len, int *vallen, int *type, int *off) { if (length < 8) toosmall (key); @@ -1015,10 +973,8 @@ get_version_header (data, length, big_endian, key, pkey, len, vallen, type, /* Convert a version resource from binary. */ static struct res_resource * -bin_to_res_version (data, length, big_endian) - const unsigned char *data; - unsigned long length; - int big_endian; +bin_to_res_version (const unsigned char *data, unsigned long length, + int big_endian) { int verlen, vallen, type, off; struct fixed_versioninfo *fi; @@ -1236,10 +1192,8 @@ bin_to_res_version (data, length, big_endian) /* Convert an arbitrary user defined resource from binary. */ static struct res_resource * -bin_to_res_userdata (data, length, big_endian) - const unsigned char *data; - unsigned long length; - int big_endian ATTRIBUTE_UNUSED; +bin_to_res_userdata (const unsigned char *data, unsigned long length, + int big_endian ATTRIBUTE_UNUSED) { struct rcdata_item *ri; struct res_resource *r; @@ -1266,43 +1220,41 @@ bin_to_res_userdata (data, length, big_endian) /* Local functions used to convert resources to binary format. */ -static void dword_align_bin PARAMS ((struct bindata ***, unsigned long *)); -static struct bindata *resid_to_bin PARAMS ((struct res_id, int)); -static struct bindata *unicode_to_bin PARAMS ((const unichar *, int)); +static void dword_align_bin (struct bindata ***, unsigned long *); +static struct bindata *resid_to_bin (struct res_id, int); +static struct bindata *unicode_to_bin (const unichar *, int); static struct bindata *res_to_bin_accelerator - PARAMS ((const struct accelerator *, int)); + (const struct accelerator *, int); static struct bindata *res_to_bin_cursor - PARAMS ((const struct cursor *, int)); + (const struct cursor *, int); static struct bindata *res_to_bin_group_cursor - PARAMS ((const struct group_cursor *, int)); + (const struct group_cursor *, int); static struct bindata *res_to_bin_dialog - PARAMS ((const struct dialog *, int)); + (const struct dialog *, int); static struct bindata *res_to_bin_fontdir - PARAMS ((const struct fontdir *, int)); + (const struct fontdir *, int); static struct bindata *res_to_bin_group_icon - PARAMS ((const struct group_icon *, int)); + (const struct group_icon *, int); static struct bindata *res_to_bin_menu - PARAMS ((const struct menu *, int)); + (const struct menu *, int); static struct bindata *res_to_bin_menuitems - PARAMS ((const struct menuitem *, int)); + (const struct menuitem *, int); static struct bindata *res_to_bin_menuexitems - PARAMS ((const struct menuitem *, int)); + (const struct menuitem *, int); static struct bindata *res_to_bin_rcdata - PARAMS ((const struct rcdata_item *, int)); + (const struct rcdata_item *, int); static struct bindata *res_to_bin_stringtable - PARAMS ((const struct stringtable *, int)); -static struct bindata *string_to_unicode_bin PARAMS ((const char *, int)); + (const struct stringtable *, int); +static struct bindata *string_to_unicode_bin (const char *, int); static struct bindata *res_to_bin_versioninfo - PARAMS ((const struct versioninfo *, int)); + (const struct versioninfo *, int); static struct bindata *res_to_bin_generic - PARAMS ((unsigned long, const unsigned char *)); + (unsigned long, const unsigned char *); /* Convert a resource to binary. */ struct bindata * -res_to_bin (res, big_endian) - const struct res_resource *res; - int big_endian; +res_to_bin (const struct res_resource *res, int big_endian) { switch (res->type) { @@ -1344,9 +1296,7 @@ res_to_bin (res, big_endian) boundary. It updates *PPP and *LENGTH. */ static void -dword_align_bin (ppp, length) - struct bindata ***ppp; - unsigned long *length; +dword_align_bin (struct bindata ***ppp, unsigned long *length) { int add; struct bindata *d; @@ -1372,9 +1322,7 @@ dword_align_bin (ppp, length) bindata structure. */ static struct bindata * -resid_to_bin (id, big_endian) - struct res_id id; - int big_endian; +resid_to_bin (struct res_id id, int big_endian) { struct bindata *d; @@ -1407,9 +1355,7 @@ resid_to_bin (id, big_endian) returns exactly one bindata structure. */ static struct bindata * -unicode_to_bin (str, big_endian) - const unichar *str; - int big_endian; +unicode_to_bin (const unichar *str, int big_endian) { int len; struct bindata *d; @@ -1447,9 +1393,8 @@ unicode_to_bin (str, big_endian) /* Convert an accelerator resource to binary. */ static struct bindata * -res_to_bin_accelerator (accelerators, big_endian) - const struct accelerator *accelerators; - int big_endian; +res_to_bin_accelerator (const struct accelerator *accelerators, + int big_endian) { struct bindata *first, **pp; const struct accelerator *a; @@ -1483,9 +1428,7 @@ res_to_bin_accelerator (accelerators, big_endian) /* Convert a cursor resource to binary. */ static struct bindata * -res_to_bin_cursor (c, big_endian) - const struct cursor *c; - int big_endian; +res_to_bin_cursor (const struct cursor *c, int big_endian) { struct bindata *d; @@ -1507,9 +1450,8 @@ res_to_bin_cursor (c, big_endian) /* Convert a group cursor resource to binary. */ static struct bindata * -res_to_bin_group_cursor (group_cursors, big_endian) - const struct group_cursor *group_cursors; - int big_endian; +res_to_bin_group_cursor (const struct group_cursor *group_cursors, + int big_endian) { struct bindata *first, **pp; int c; @@ -1556,9 +1498,7 @@ res_to_bin_group_cursor (group_cursors, big_endian) /* Convert a dialog resource to binary. */ static struct bindata * -res_to_bin_dialog (dialog, big_endian) - const struct dialog *dialog; - int big_endian; +res_to_bin_dialog (const struct dialog *dialog, int big_endian) { int dialogex; struct bindata *first, **pp; @@ -1739,9 +1679,7 @@ res_to_bin_dialog (dialog, big_endian) /* Convert a fontdir resource to binary. */ static struct bindata * -res_to_bin_fontdir (fontdirs, big_endian) - const struct fontdir *fontdirs; - int big_endian; +res_to_bin_fontdir (const struct fontdir *fontdirs, int big_endian) { struct bindata *first, **pp; int c; @@ -1787,9 +1725,7 @@ res_to_bin_fontdir (fontdirs, big_endian) /* Convert a group icon resource to binary. */ static struct bindata * -res_to_bin_group_icon (group_icons, big_endian) - const struct group_icon *group_icons; - int big_endian; +res_to_bin_group_icon (const struct group_icon *group_icons, int big_endian) { struct bindata *first, **pp; int c; @@ -1838,9 +1774,7 @@ res_to_bin_group_icon (group_icons, big_endian) /* Convert a menu resource to binary. */ static struct bindata * -res_to_bin_menu (menu, big_endian) - const struct menu *menu; - int big_endian; +res_to_bin_menu (const struct menu *menu, int big_endian) { int menuex; struct bindata *d; @@ -1873,9 +1807,7 @@ res_to_bin_menu (menu, big_endian) /* Convert menu items to binary. */ static struct bindata * -res_to_bin_menuitems (items, big_endian) - const struct menuitem *items; - int big_endian; +res_to_bin_menuitems (const struct menuitem *items, int big_endian) { struct bindata *first, **pp; const struct menuitem *mi; @@ -1923,9 +1855,7 @@ res_to_bin_menuitems (items, big_endian) /* Convert menuex items to binary. */ static struct bindata * -res_to_bin_menuexitems (items, big_endian) - const struct menuitem *items; - int big_endian; +res_to_bin_menuexitems (const struct menuitem *items, int big_endian) { struct bindata *first, **pp; unsigned long length; @@ -1997,9 +1927,7 @@ res_to_bin_menuexitems (items, big_endian) to binary. */ static struct bindata * -res_to_bin_rcdata (items, big_endian) - const struct rcdata_item *items; - int big_endian; +res_to_bin_rcdata (const struct rcdata_item *items, int big_endian) { struct bindata *first, **pp; const struct rcdata_item *ri; @@ -2063,9 +1991,7 @@ res_to_bin_rcdata (items, big_endian) /* Convert a stringtable resource to binary. */ static struct bindata * -res_to_bin_stringtable (st, big_endian) - const struct stringtable *st; - int big_endian; +res_to_bin_stringtable (const struct stringtable *st, int big_endian) { struct bindata *first, **pp; int i; @@ -2103,9 +2029,7 @@ res_to_bin_stringtable (st, big_endian) returns exactly one bindata structure. */ static struct bindata * -string_to_unicode_bin (s, big_endian) - const char *s; - int big_endian; +string_to_unicode_bin (const char *s, int big_endian) { size_t len, i; struct bindata *d; @@ -2128,9 +2052,7 @@ string_to_unicode_bin (s, big_endian) /* Convert a versioninfo resource to binary. */ static struct bindata * -res_to_bin_versioninfo (versioninfo, big_endian) - const struct versioninfo *versioninfo; - int big_endian; +res_to_bin_versioninfo (const struct versioninfo *versioninfo, int big_endian) { struct bindata *first, **pp; unsigned long length; @@ -2382,9 +2304,7 @@ res_to_bin_versioninfo (versioninfo, big_endian) /* Convert a generic resource to binary. */ static struct bindata * -res_to_bin_generic (length, data) - unsigned long length; - const unsigned char *data; +res_to_bin_generic (unsigned long length, const unsigned char *data) { struct bindata *d; diff --git a/contrib/binutils/binutils/rescoff.c b/contrib/binutils/binutils/rescoff.c index e24402b..60122de 100644 --- a/contrib/binutils/binutils/rescoff.c +++ b/contrib/binutils/binutils/rescoff.c @@ -1,5 +1,6 @@ /* rescoff.c -- read and write resources in Windows COFF files. - Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1997, 1998, 1999, 2000, 2003 + Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GNU Binutils. @@ -102,20 +103,17 @@ struct extern_res_data /* Local functions. */ -static void overrun PARAMS ((const struct coff_file_info *, const char *)); +static void overrun (const struct coff_file_info *, const char *); static struct res_directory *read_coff_res_dir - PARAMS ((const bfd_byte *, const struct coff_file_info *, - const struct res_id *, int)); + (const bfd_byte *, const struct coff_file_info *, + const struct res_id *, int); static struct res_resource *read_coff_data_entry - PARAMS ((const bfd_byte *, const struct coff_file_info *, - const struct res_id *)); + (const bfd_byte *, const struct coff_file_info *, const struct res_id *); /* Read the resources in a COFF file. */ struct res_directory * -read_coff_rsrc (filename, target) - const char *filename; - const char *target; +read_coff_rsrc (const char *filename, const char *target) { bfd *abfd; char **matching; @@ -171,9 +169,7 @@ read_coff_rsrc (filename, target) /* Give an error if we are out of bounds. */ static void -overrun (finfo, msg) - const struct coff_file_info *finfo; - const char *msg; +overrun (const struct coff_file_info *finfo, const char *msg) { fatal (_("%s: %s: address out of bounds"), finfo->filename, msg); } @@ -181,11 +177,8 @@ overrun (finfo, msg) /* Read a resource directory. */ static struct res_directory * -read_coff_res_dir (data, finfo, type, level) - const bfd_byte *data; - const struct coff_file_info *finfo; - const struct res_id *type; - int level; +read_coff_res_dir (const bfd_byte *data, const struct coff_file_info *finfo, + const struct res_id *type, int level) { const struct extern_res_directory *erd; struct res_directory *rd; @@ -314,10 +307,7 @@ read_coff_res_dir (data, finfo, type, level) /* Read a resource data entry. */ static struct res_resource * -read_coff_data_entry (data, finfo, type) - const bfd_byte *data; - const struct coff_file_info *finfo; - const struct res_id *type; +read_coff_data_entry (const bfd_byte *data, const struct coff_file_info *finfo, const struct res_id *type) { const struct extern_res_data *erd; struct res_resource *r; @@ -408,12 +398,12 @@ struct coff_write_info ((cwi->big_endian) ? bfd_putb32 ((v), (s)) : bfd_putl32 ((v), (s))) static void coff_bin_sizes - PARAMS ((const struct res_directory *, struct coff_write_info *)); -static unsigned char *coff_alloc PARAMS ((struct bindata_build *, size_t)); + (const struct res_directory *, struct coff_write_info *); +static unsigned char *coff_alloc (struct bindata_build *, size_t); static void coff_to_bin - PARAMS ((const struct res_directory *, struct coff_write_info *)); + (const struct res_directory *, struct coff_write_info *); static void coff_res_to_bin - PARAMS ((const struct res_resource *, struct coff_write_info *)); + (const struct res_resource *, struct coff_write_info *); /* Write resources to a COFF file. RESOURCES should already be sorted. @@ -424,10 +414,8 @@ static void coff_res_to_bin adding the .rsrc section. */ void -write_coff_file (filename, target, resources) - const char *filename; - const char *target; - const struct res_directory *resources; +write_coff_file (const char *filename, const char *target, + const struct res_directory *resources) { bfd *abfd; asection *sec; @@ -584,9 +572,8 @@ write_coff_file (filename, target, resources) entries. This updates fields in CWI. */ static void -coff_bin_sizes (resdir, cwi) - const struct res_directory *resdir; - struct coff_write_info *cwi; +coff_bin_sizes (const struct res_directory *resdir, + struct coff_write_info *cwi) { const struct res_entry *re; @@ -609,9 +596,7 @@ coff_bin_sizes (resdir, cwi) /* Allocate data for a particular list. */ static unsigned char * -coff_alloc (bb, size) - struct bindata_build *bb; - size_t size; +coff_alloc (struct bindata_build *bb, size_t size) { struct bindata *d; @@ -634,9 +619,7 @@ coff_alloc (bb, size) /* Convert the resource directory RESDIR to binary. */ static void -coff_to_bin (resdir, cwi) - const struct res_directory *resdir; - struct coff_write_info *cwi; +coff_to_bin (const struct res_directory *resdir, struct coff_write_info *cwi) { struct extern_res_directory *erd; int ci, cn; @@ -713,9 +696,7 @@ coff_to_bin (resdir, cwi) /* Convert the resource RES to binary. */ static void -coff_res_to_bin (res, cwi) - const struct res_resource *res; - struct coff_write_info *cwi; +coff_res_to_bin (const struct res_resource *res, struct coff_write_info *cwi) { arelent *r; struct extern_res_data *erd; diff --git a/contrib/binutils/binutils/resrc.c b/contrib/binutils/binutils/resrc.c index 3cf708a..c290a9d 100644 --- a/contrib/binutils/binutils/resrc.c +++ b/contrib/binutils/binutils/resrc.c @@ -1,5 +1,5 @@ /* resrc.c -- read and write Windows rc files. - Copyright 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GNU Binutils. @@ -161,24 +161,21 @@ static int icons; /* Local functions. */ -static int run_cmd PARAMS ((char *, const char *)); -static FILE *open_input_stream PARAMS ((char *)); -static FILE *look_for_default PARAMS ((char *, const char *, int, - const char *, const char *)); -static void close_input_stream PARAMS ((void)); -static void unexpected_eof PARAMS ((const char *)); -static int get_word PARAMS ((FILE *, const char *)); -static unsigned long get_long PARAMS ((FILE *, const char *)); -static void get_data - PARAMS ((FILE *, unsigned char *, unsigned long, const char *)); -static void define_fontdirs PARAMS ((void)); +static int run_cmd (char *, const char *); +static FILE *open_input_stream (char *); +static FILE *look_for_default + (char *, const char *, int, const char *, const char *); +static void close_input_stream (void); +static void unexpected_eof (const char *); +static int get_word (FILE *, const char *); +static unsigned long get_long (FILE *, const char *); +static void get_data (FILE *, unsigned char *, unsigned long, const char *); +static void define_fontdirs (void); /* Run `cmd' and redirect the output to `redir'. */ static int -run_cmd (cmd, redir) - char *cmd; - const char *redir; +run_cmd (char *cmd, const char *redir) { char *s; int pid, wait_status, retcode; @@ -254,7 +251,7 @@ run_cmd (cmd, redir) /* Restore stdout to its previous setting. */ dup2 (stdout_save, STDOUT_FILENO); - /* Close reponse file. */ + /* Close response file. */ close (redir_handle); if (pid == -1) @@ -292,8 +289,7 @@ run_cmd (cmd, redir) } static FILE * -open_input_stream (cmd) - char *cmd; +open_input_stream (char *cmd) { if (istream_type == ISTREAM_FILE) { @@ -333,12 +329,8 @@ open_input_stream (cmd) /* look for the preprocessor program */ static FILE * -look_for_default (cmd, prefix, end_prefix, preprocargs, filename) - char *cmd; - const char *prefix; - int end_prefix; - const char *preprocargs; - const char *filename; +look_for_default (char *cmd, const char *prefix, int end_prefix, + const char *preprocargs, const char *filename) { char *space; int found; @@ -386,12 +378,8 @@ look_for_default (cmd, prefix, end_prefix, preprocargs, filename) /* Read an rc file. */ struct res_directory * -read_rc_file (filename, preprocessor, preprocargs, language, use_temp_file) - const char *filename; - const char *preprocessor; - const char *preprocargs; - int language; - int use_temp_file; +read_rc_file (const char *filename, const char *preprocessor, + const char *preprocargs, int language, int use_temp_file) { char *cmd; @@ -497,7 +485,7 @@ read_rc_file (filename, preprocessor, preprocargs, language, use_temp_file) /* Close the input stream if it is open. */ static void -close_input_stream () +close_input_stream (void) { if (istream_type == ISTREAM_FILE) { @@ -527,8 +515,7 @@ close_input_stream () /* Report an error while reading an rc file. */ void -yyerror (msg) - const char *msg; +yyerror (const char *msg) { fatal ("%s:%d: %s", rc_filename, rc_lineno, msg); } @@ -536,8 +523,7 @@ yyerror (msg) /* Issue a warning while reading an rc file. */ void -rcparse_warning (msg) - const char *msg; +rcparse_warning (const char *msg) { fprintf (stderr, _("%s:%d: %s\n"), rc_filename, rc_lineno, msg); } @@ -545,8 +531,7 @@ rcparse_warning (msg) /* Die if we get an unexpected end of file. */ static void -unexpected_eof (msg) - const char *msg; +unexpected_eof (const char *msg) { fatal (_("%s: unexpected EOF"), msg); } @@ -555,9 +540,7 @@ unexpected_eof (msg) endian. */ static int -get_word (e, msg) - FILE *e; - const char *msg; +get_word (FILE *e, const char *msg) { int b1, b2; @@ -572,9 +555,7 @@ get_word (e, msg) endian. */ static unsigned long -get_long (e, msg) - FILE *e; - const char *msg; +get_long (FILE *e, const char *msg) { int b1, b2, b3, b4; @@ -593,11 +574,7 @@ get_long (e, msg) /* Read data from a file. This is a wrapper to do error checking. */ static void -get_data (e, p, c, msg) - FILE *e; - unsigned char *p; - unsigned long c; - const char *msg; +get_data (FILE *e, unsigned char *p, unsigned long c, const char *msg) { unsigned long got; @@ -611,10 +588,8 @@ get_data (e, p, c, msg) /* Define an accelerator resource. */ void -define_accelerator (id, resinfo, data) - struct res_id id; - const struct res_res_info *resinfo; - struct accelerator *data; +define_accelerator (struct res_id id, const struct res_res_info *resinfo, + struct accelerator *data) { struct res_resource *r; @@ -632,10 +607,8 @@ define_accelerator (id, resinfo, data) #define BITMAP_SKIP (14) void -define_bitmap (id, resinfo, filename) - struct res_id id; - const struct res_res_info *resinfo; - const char *filename; +define_bitmap (struct res_id id, const struct res_res_info *resinfo, + const char *filename) { FILE *e; char *real_filename; @@ -676,10 +649,8 @@ define_bitmap (id, resinfo, filename) select one of the actual cursors. */ void -define_cursor (id, resinfo, filename) - struct res_id id; - const struct res_res_info *resinfo; - const char *filename; +define_cursor (struct res_id id, const struct res_res_info *resinfo, + const char *filename) { FILE *e; char *real_filename; @@ -796,10 +767,8 @@ define_cursor (id, resinfo, filename) /* Define a dialog resource. */ void -define_dialog (id, resinfo, dialog) - struct res_id id; - const struct res_res_info *resinfo; - const struct dialog *dialog; +define_dialog (struct res_id id, const struct res_res_info *resinfo, + const struct dialog *dialog) { struct dialog *copy; struct res_resource *r; @@ -818,16 +787,10 @@ define_dialog (id, resinfo, dialog) merely allocates and fills in a structure. */ struct dialog_control * -define_control (text, id, x, y, width, height, class, style, exstyle) - const char *text; - unsigned long id; - unsigned long x; - unsigned long y; - unsigned long width; - unsigned long height; - unsigned long class; - unsigned long style; - unsigned long exstyle; +define_control (const struct res_id iid, unsigned long id, unsigned long x, + unsigned long y, unsigned long width, unsigned long height, + unsigned long class, unsigned long style, + unsigned long exstyle) { struct dialog_control *n; @@ -842,9 +805,7 @@ 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) - text = ""; - res_string_to_id (&n->text, text); + n->text = iid; n->data = NULL; n->help = 0; @@ -852,21 +813,18 @@ define_control (text, id, x, y, width, height, class, style, exstyle) } 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; +define_icon_control (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; + struct res_id tid; + if (style == 0) style = SS_ICON | WS_CHILD | WS_VISIBLE; - n = define_control (0, id, x, y, 0, 0, CTL_STATIC, style, exstyle); + res_string_to_id (&tid, ""); + n = define_control (tid, id, x, y, 0, 0, CTL_STATIC, style, exstyle); n->text = iid; if (help && !ex) rcparse_warning (_("help ID requires DIALOGEX")); @@ -881,10 +839,8 @@ define_icon_control (iid, id, x, y, style, exstyle, help, data, ex) /* Define a font resource. */ void -define_font (id, resinfo, filename) - struct res_id id; - const struct res_res_info *resinfo; - const char *filename; +define_font (struct res_id id, const struct res_res_info *resinfo, + const char *filename) { FILE *e; char *real_filename; @@ -969,7 +925,7 @@ define_font (id, resinfo, filename) file has been parsed, if any font resources were seen. */ static void -define_fontdirs () +define_fontdirs (void) { struct res_resource *r; struct res_id id; @@ -991,10 +947,8 @@ define_fontdirs () select one of the actual icon bitmaps. */ void -define_icon (id, resinfo, filename) - struct res_id id; - const struct res_res_info *resinfo; - const char *filename; +define_icon (struct res_id id, const struct res_res_info *resinfo, + const char *filename) { FILE *e; char *real_filename; @@ -1086,10 +1040,20 @@ define_icon (id, resinfo, filename) cg->height = icondirs[i].height; cg->colors = icondirs[i].colorcount; - cg->planes = 1; - cg->bits = 0; - while ((1 << cg->bits) < cg->colors) - ++cg->bits; + if (icondirs[i].u.icon.planes) + cg->planes = icondirs[i].u.icon.planes; + else + cg->planes = 1; + + if (icondirs[i].u.icon.bits) + cg->bits = icondirs[i].u.icon.bits; + else + { + cg->bits = 0; + + while ((1L << cg->bits) < cg->colors) + ++cg->bits; + } cg->bytes = icondirs[i].bytes; cg->index = first_icon + i + 1; @@ -1110,10 +1074,8 @@ define_icon (id, resinfo, filename) /* Define a menu resource. */ void -define_menu (id, resinfo, menuitems) - struct res_id id; - const struct res_res_info *resinfo; - struct menuitem *menuitems; +define_menu (struct res_id id, const struct res_res_info *resinfo, + struct menuitem *menuitems) { struct menu *m; struct res_resource *r; @@ -1132,13 +1094,9 @@ define_menu (id, resinfo, menuitems) allocates and fills in a structure. */ struct menuitem * -define_menuitem (text, menuid, type, state, help, menuitems) - const char *text; - int menuid; - unsigned long type; - unsigned long state; - unsigned long help; - struct menuitem *menuitems; +define_menuitem (const char *text, int menuid, unsigned long type, + unsigned long state, unsigned long help, + struct menuitem *menuitems) { struct menuitem *mi; @@ -1159,10 +1117,8 @@ define_menuitem (text, menuid, type, state, help, menuitems) /* Define a messagetable resource. */ void -define_messagetable (id, resinfo, filename) - struct res_id id; - const struct res_res_info *resinfo; - const char *filename; +define_messagetable (struct res_id id, const struct res_res_info *resinfo, + const char *filename) { FILE *e; char *real_filename; @@ -1196,10 +1152,8 @@ define_messagetable (id, resinfo, filename) /* Define an rcdata resource. */ void -define_rcdata (id, resinfo, data) - struct res_id id; - const struct res_res_info *resinfo; - struct rcdata_item *data; +define_rcdata (struct res_id id, const struct res_res_info *resinfo, + struct rcdata_item *data) { struct res_resource *r; @@ -1213,9 +1167,7 @@ define_rcdata (id, resinfo, data) /* Create an rcdata item holding a string. */ struct rcdata_item * -define_rcdata_string (string, len) - const char *string; - unsigned long len; +define_rcdata_string (const char *string, unsigned long len) { struct rcdata_item *ri; char *s; @@ -1234,9 +1186,7 @@ define_rcdata_string (string, len) /* Create an rcdata item holding a number. */ struct rcdata_item * -define_rcdata_number (val, dword) - unsigned long val; - int dword; +define_rcdata_number (unsigned long val, int dword) { struct rcdata_item *ri; @@ -1252,10 +1202,8 @@ define_rcdata_number (val, dword) which appears in a STRINGTABLE statement. */ void -define_stringtable (resinfo, stringid, string) - const struct res_res_info *resinfo; - unsigned long stringid; - const char *string; +define_stringtable (const struct res_res_info *resinfo, + unsigned long stringid, const char *string) { struct res_id id; struct res_resource *r; @@ -1289,11 +1237,9 @@ define_stringtable (resinfo, stringid, string) /* Define a user data resource where the data is in the rc file. */ void -define_user_data (id, type, resinfo, data) - struct res_id id; - struct res_id type; - const struct res_res_info *resinfo; - struct rcdata_item *data; +define_user_data (struct res_id id, struct res_id type, + const struct res_res_info *resinfo, + struct rcdata_item *data) { struct res_id ids[3]; struct res_resource *r; @@ -1312,11 +1258,8 @@ define_user_data (id, type, resinfo, data) /* Define a user data resource where the data is in a file. */ void -define_user_file (id, type, resinfo, filename) - struct res_id id; - struct res_id type; - const struct res_res_info *resinfo; - const char *filename; +define_user_file (struct res_id id, struct res_id type, + const struct res_res_info *resinfo, const char *filename) { FILE *e; char *real_filename; @@ -1357,11 +1300,9 @@ define_user_file (id, type, resinfo, filename) /* Define a versioninfo resource. */ void -define_versioninfo (id, language, fixedverinfo, verinfo) - struct res_id id; - int language; - struct fixed_versioninfo *fixedverinfo; - struct ver_info *verinfo; +define_versioninfo (struct res_id id, int language, + struct fixed_versioninfo *fixedverinfo, + struct ver_info *verinfo) { struct res_resource *r; @@ -1377,10 +1318,8 @@ define_versioninfo (id, language, fixedverinfo, verinfo) /* Add string version info to a list of version information. */ struct ver_info * -append_ver_stringfileinfo (verinfo, language, strings) - struct ver_info *verinfo; - const char *language; - struct ver_stringinfo *strings; +append_ver_stringfileinfo (struct ver_info *verinfo, const char *language, + struct ver_stringinfo *strings) { struct ver_info *vi, **pp; @@ -1400,10 +1339,8 @@ append_ver_stringfileinfo (verinfo, language, strings) /* Add variable version info to a list of version information. */ struct ver_info * -append_ver_varfileinfo (verinfo, key, var) - struct ver_info *verinfo; - const char *key; - struct ver_varinfo *var; +append_ver_varfileinfo (struct ver_info *verinfo, const char *key, + struct ver_varinfo *var) { struct ver_info *vi, **pp; @@ -1423,10 +1360,8 @@ append_ver_varfileinfo (verinfo, key, var) /* Append version string information to a list. */ struct ver_stringinfo * -append_verval (strings, key, value) - struct ver_stringinfo *strings; - const char *key; - const char *value; +append_verval (struct ver_stringinfo *strings, const char *key, + const char *value) { struct ver_stringinfo *vs, **pp; @@ -1445,10 +1380,8 @@ append_verval (strings, key, value) /* Append version variable information to a list. */ struct ver_varinfo * -append_vertrans (var, language, charset) - struct ver_varinfo *var; - unsigned long language; - unsigned long charset; +append_vertrans (struct ver_varinfo *var, unsigned long language, + unsigned long charset) { struct ver_varinfo *vv, **pp; @@ -1466,42 +1399,35 @@ append_vertrans (var, language, charset) /* Local functions used to write out an rc file. */ -static void indent PARAMS ((FILE *, int)); +static void indent (FILE *, int); static void write_rc_directory - PARAMS ((FILE *, const struct res_directory *, const struct res_id *, - const struct res_id *, int *, int)); + (FILE *, const struct res_directory *, const struct res_id *, + const struct res_id *, int *, int); static void write_rc_subdir - PARAMS ((FILE *, const struct res_entry *, const struct res_id *, - const struct res_id *, int *, int)); + (FILE *, const struct res_entry *, const struct res_id *, + const struct res_id *, int *, int); static void write_rc_resource - PARAMS ((FILE *, const struct res_id *, const struct res_id *, - const struct res_resource *, int *)); -static void write_rc_accelerators - PARAMS ((FILE *, const struct accelerator *)); -static void write_rc_cursor PARAMS ((FILE *, const struct cursor *)); -static void write_rc_group_cursor - PARAMS ((FILE *, const struct group_cursor *)); -static void write_rc_dialog PARAMS ((FILE *, const struct dialog *)); -static void write_rc_dialog_control - PARAMS ((FILE *, const struct dialog_control *)); -static void write_rc_fontdir PARAMS ((FILE *, const struct fontdir *)); -static void write_rc_group_icon PARAMS ((FILE *, const struct group_icon *)); -static void write_rc_menu PARAMS ((FILE *, const struct menu *, int)); -static void write_rc_menuitems - PARAMS ((FILE *, const struct menuitem *, int, int)); -static void write_rc_rcdata PARAMS ((FILE *, const struct rcdata_item *, int)); + (FILE *, const struct res_id *, const struct res_id *, + const struct res_resource *, int *); +static void write_rc_accelerators (FILE *, const struct accelerator *); +static void write_rc_cursor (FILE *, const struct cursor *); +static void write_rc_group_cursor (FILE *, const struct group_cursor *); +static void write_rc_dialog (FILE *, const struct dialog *); +static void write_rc_dialog_control (FILE *, const struct dialog_control *); +static void write_rc_fontdir (FILE *, const struct fontdir *); +static void write_rc_group_icon (FILE *, const struct group_icon *); +static void write_rc_menu (FILE *, const struct menu *, int); +static void write_rc_menuitems (FILE *, const struct menuitem *, int, int); +static void write_rc_rcdata (FILE *, const struct rcdata_item *, int); static void write_rc_stringtable - PARAMS ((FILE *, const struct res_id *, const struct stringtable *)); -static void write_rc_versioninfo PARAMS ((FILE *, const struct versioninfo *)); -static void write_rc_filedata - PARAMS ((FILE *, unsigned long, const unsigned char *)); + (FILE *, const struct res_id *, const struct stringtable *); +static void write_rc_versioninfo (FILE *, const struct versioninfo *); +static void write_rc_filedata (FILE *, unsigned long, const unsigned char *); /* Indent a given number of spaces. */ static void -indent (e, c) - FILE *e; - int c; +indent (FILE *e, int c) { int i; @@ -1520,9 +1446,7 @@ indent (e, c) comes, this code will have to be fixed up. */ void -write_rc_file (filename, resources) - const char *filename; - const struct res_directory *resources; +write_rc_file (const char *filename, const struct res_directory *resources) { FILE *e; int language; @@ -1548,13 +1472,9 @@ write_rc_file (filename, resources) language. LEVEL is the level in the tree. */ static void -write_rc_directory (e, rd, type, name, language, level) - FILE *e; - const struct res_directory *rd; - const struct res_id *type; - const struct res_id *name; - int *language; - int level; +write_rc_directory (FILE *e, const struct res_directory *rd, + const struct res_id *type, const struct res_id *name, + int *language, int level) { const struct res_entry *re; @@ -1632,13 +1552,9 @@ write_rc_directory (e, rd, type, name, language, level) LEVEL is the level in the tree. */ static void -write_rc_subdir (e, re, type, name, language, level) - FILE *e; - const struct res_entry *re; - const struct res_id *type; - const struct res_id *name; - int *language; - int level; +write_rc_subdir (FILE *e, const struct res_entry *re, + const struct res_id *type, const struct res_id *name, + int *language, int level) { fprintf (e, "\n"); switch (level) @@ -1711,12 +1627,9 @@ write_rc_subdir (e, re, type, name, language, level) language. */ static void -write_rc_resource (e, type, name, res, language) - FILE *e; - const struct res_id *type; - const struct res_id *name; - const struct res_resource *res; - int *language; +write_rc_resource (FILE *e, const struct res_id *type, + const struct res_id *name, const struct res_resource *res, + int *language) { const char *s; int rt; @@ -1964,9 +1877,7 @@ write_rc_resource (e, type, name, res, language) /* Write out accelerator information. */ static void -write_rc_accelerators (e, accelerators) - FILE *e; - const struct accelerator *accelerators; +write_rc_accelerators (FILE *e, const struct accelerator *accelerators) { const struct accelerator *acc; @@ -2017,9 +1928,7 @@ write_rc_accelerators (e, accelerators) file, which the rc file would include. */ static void -write_rc_cursor (e, cursor) - FILE *e; - const struct cursor *cursor; +write_rc_cursor (FILE *e, const struct cursor *cursor) { fprintf (e, "// Hotspot: x: %d; y: %d\n", cursor->xhotspot, cursor->yhotspot); @@ -2030,9 +1939,7 @@ write_rc_cursor (e, cursor) cursor data. */ static void -write_rc_group_cursor (e, group_cursor) - FILE *e; - const struct group_cursor *group_cursor; +write_rc_group_cursor (FILE *e, const struct group_cursor *group_cursor) { const struct group_cursor *gc; @@ -2048,9 +1955,7 @@ write_rc_group_cursor (e, group_cursor) /* Write dialog data. */ static void -write_rc_dialog (e, dialog) - FILE *e; - const struct dialog *dialog; +write_rc_dialog (FILE *e, const struct dialog *dialog) { const struct dialog_control *control; @@ -2143,9 +2048,7 @@ static const struct control_info control_info[] = /* Write a dialog control. */ static void -write_rc_dialog_control (e, control) - FILE *e; - const struct dialog_control *control; +write_rc_dialog_control (FILE *e, const struct dialog_control *control) { const struct control_info *ci; @@ -2216,9 +2119,7 @@ write_rc_dialog_control (e, control) the font data. */ static void -write_rc_fontdir (e, fontdir) - FILE *e; - const struct fontdir *fontdir; +write_rc_fontdir (FILE *e, const struct fontdir *fontdir) { const struct fontdir *fc; @@ -2233,9 +2134,7 @@ write_rc_fontdir (e, fontdir) icon data. */ static void -write_rc_group_icon (e, group_icon) - FILE *e; - const struct group_icon *group_icon; +write_rc_group_icon (FILE *e, const struct group_icon *group_icon) { const struct group_icon *gi; @@ -2251,10 +2150,7 @@ write_rc_group_icon (e, group_icon) /* Write out a menu resource. */ static void -write_rc_menu (e, menu, menuex) - FILE *e; - const struct menu *menu; - int menuex; +write_rc_menu (FILE *e, const struct menu *menu, int menuex) { if (menu->help != 0) fprintf (e, "// Help ID: %lu\n", menu->help); @@ -2264,11 +2160,8 @@ write_rc_menu (e, menu, menuex) /* Write out menuitems. */ static void -write_rc_menuitems (e, menuitems, menuex, ind) - FILE *e; - const struct menuitem *menuitems; - int menuex; - int ind; +write_rc_menuitems (FILE *e, const struct menuitem *menuitems, int menuex, + int ind) { const struct menuitem *mi; @@ -2353,10 +2246,7 @@ write_rc_menuitems (e, menuitems, menuex, ind) resources that need to print arbitrary data. */ static void -write_rc_rcdata (e, rcdata, ind) - FILE *e; - const struct rcdata_item *rcdata; - int ind; +write_rc_rcdata (FILE *e, const struct rcdata_item *rcdata, int ind) { const struct rcdata_item *ri; @@ -2521,10 +2411,8 @@ write_rc_rcdata (e, rcdata, ind) /* Write out a stringtable resource. */ static void -write_rc_stringtable (e, name, stringtable) - FILE *e; - const struct res_id *name; - const struct stringtable *stringtable; +write_rc_stringtable (FILE *e, const struct res_id *name, + const struct stringtable *stringtable) { unsigned long offset; int i; @@ -2557,9 +2445,7 @@ write_rc_stringtable (e, name, stringtable) /* Write out a versioninfo resource. */ static void -write_rc_versioninfo (e, versioninfo) - FILE *e; - const struct versioninfo *versioninfo; +write_rc_versioninfo (FILE *e, const struct versioninfo *versioninfo) { const struct fixed_versioninfo *f; const struct ver_info *vi; @@ -2648,10 +2534,7 @@ write_rc_versioninfo (e, versioninfo) /* Write out data which would normally be read from a file. */ static void -write_rc_filedata (e, length, data) - FILE *e; - unsigned long length; - const unsigned char *data; +write_rc_filedata (FILE *e, unsigned long length, const unsigned char *data) { unsigned long i; diff --git a/contrib/binutils/binutils/size.c b/contrib/binutils/binutils/size.c index 792cb82..9875493 100644 --- a/contrib/binutils/binutils/size.c +++ b/contrib/binutils/binutils/size.c @@ -1,6 +1,6 @@ /* size.c -- report size of various sections of an executable file. - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, + 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -61,33 +61,31 @@ static char *target = NULL; /* Static declarations. */ -static void usage PARAMS ((FILE *, int)); -static void display_file PARAMS ((char *)); -static void display_bfd PARAMS ((bfd *)); -static void display_archive PARAMS ((bfd *)); -static int size_number PARAMS ((bfd_size_type)); +static void usage (FILE *, int); +static void display_file (char *); +static void display_bfd (bfd *); +static void display_archive (bfd *); +static int size_number (bfd_size_type); #if 0 -static void lprint_number PARAMS ((int, bfd_size_type)); +static void lprint_number (int, bfd_size_type); #endif -static void rprint_number PARAMS ((int, bfd_size_type)); -static void print_berkeley_format PARAMS ((bfd *)); -static void sysv_internal_sizer PARAMS ((bfd *, asection *, PTR)); -static void sysv_internal_printer PARAMS ((bfd *, asection *, PTR)); -static void print_sysv_format PARAMS ((bfd *)); -static void print_sizes PARAMS ((bfd * file)); -static void berkeley_sum PARAMS ((bfd *, sec_ptr, PTR)); +static void rprint_number (int, bfd_size_type); +static void print_berkeley_format (bfd *); +static void sysv_internal_sizer (bfd *, asection *, void *); +static void sysv_internal_printer (bfd *, asection *, void *); +static void print_sysv_format (bfd *); +static void print_sizes (bfd * file); +static void berkeley_sum (bfd *, sec_ptr, void *); static void -usage (stream, status) - FILE *stream; - int status; +usage (FILE *stream, int status) { fprintf (stream, _("Usage: %s [option(s)] [file(s)]\n"), program_name); fprintf (stream, _(" Displays the sizes of sections inside binary files\n")); fprintf (stream, _(" If no input file(s) are specified, a.out is assumed\n")); fprintf (stream, _(" The options are:\n\ -A|-B --format={sysv|berkeley} Select output style (default is %s)\n\ - -o|-d|-h --radix={8|10|16} Display numbers in octal, decimal or hex\n\ + -o|-d|-x --radix={8|10|16} Display numbers in octal, decimal or hex\n\ -t --totals Display the total sizes (Berkeley only)\n\ --target= Set the binary file format\n\ -h --help Display this information\n\ @@ -116,12 +114,10 @@ struct option long_options[] = {0, no_argument, 0, 0} }; -int main PARAMS ((int, char **)); +int main (int, char **); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int temp; int c; @@ -260,8 +256,7 @@ main (argc, argv) /* Display stats on file or archive member ABFD. */ static void -display_bfd (abfd) - bfd *abfd; +display_bfd (bfd *abfd) { char **matching; @@ -312,8 +307,7 @@ display_bfd (abfd) } static void -display_archive (file) - bfd *file; +display_archive (bfd *file) { bfd *arfile = (bfd *) NULL; bfd *last_arfile = (bfd *) NULL; @@ -345,11 +339,14 @@ display_archive (file) } static void -display_file (filename) - char *filename; +display_file (char *filename) { - bfd *file = bfd_openr (filename, target); + bfd *file; + if (get_file_size (filename) < 1) + return; + + file = bfd_openr (filename, target); if (file == NULL) { bfd_nonfatal (filename); @@ -357,12 +354,12 @@ display_file (filename) return; } - if (bfd_check_format (file, bfd_archive) == true) + if (bfd_check_format (file, bfd_archive)) display_archive (file); else display_bfd (file); - if (bfd_close (file) == false) + if (!bfd_close (file)) { bfd_nonfatal (filename); return_code = 1; @@ -373,8 +370,7 @@ display_file (filename) /* This is what lexical functions are for. */ static int -size_number (num) - bfd_size_type num; +size_number (bfd_size_type num) { char buffer[40]; @@ -391,9 +387,7 @@ size_number (num) /* This is not used. */ static void -lprint_number (width, num) - int width; - bfd_size_type num; +lprint_number (int width, bfd_size_type num) { char buffer[40]; @@ -408,9 +402,7 @@ lprint_number (width, num) #endif static void -rprint_number (width, num) - int width; - bfd_size_type num; +rprint_number (int width, bfd_size_type num) { char buffer[40]; @@ -427,10 +419,8 @@ static bfd_size_type datasize; static bfd_size_type textsize; static void -berkeley_sum (abfd, sec, ignore) - bfd *abfd ATTRIBUTE_UNUSED; - sec_ptr sec; - PTR ignore ATTRIBUTE_UNUSED; +berkeley_sum (bfd *abfd ATTRIBUTE_UNUSED, sec_ptr sec, + void *ignore ATTRIBUTE_UNUSED) { flagword flags; bfd_size_type size; @@ -449,8 +439,7 @@ berkeley_sum (abfd, sec, ignore) } static void -print_berkeley_format (abfd) - bfd *abfd; +print_berkeley_format (bfd *abfd) { static int files_seen = 0; bfd_size_type total; @@ -459,7 +448,7 @@ print_berkeley_format (abfd) datasize = 0; textsize = 0; - bfd_map_over_sections (abfd, berkeley_sum, (PTR) NULL); + bfd_map_over_sections (abfd, berkeley_sum, NULL); if (files_seen++ == 0) #if 0 @@ -502,10 +491,8 @@ int svi_vmalen = 0; int svi_sizelen = 0; static void -sysv_internal_sizer (file, sec, ignore) - bfd *file ATTRIBUTE_UNUSED; - sec_ptr sec; - PTR ignore ATTRIBUTE_UNUSED; +sysv_internal_sizer (bfd *file ATTRIBUTE_UNUSED, sec_ptr sec, + void *ignore ATTRIBUTE_UNUSED) { bfd_size_type size = bfd_section_size (file, sec); @@ -526,10 +513,8 @@ sysv_internal_sizer (file, sec, ignore) } static void -sysv_internal_printer (file, sec, ignore) - bfd *file ATTRIBUTE_UNUSED; - sec_ptr sec; - PTR ignore ATTRIBUTE_UNUSED; +sysv_internal_printer (bfd *file ATTRIBUTE_UNUSED, sec_ptr sec, + void *ignore ATTRIBUTE_UNUSED) { bfd_size_type size = bfd_section_size (file, sec); @@ -548,14 +533,13 @@ sysv_internal_printer (file, sec, ignore) } static void -print_sysv_format (file) - bfd *file; +print_sysv_format (bfd *file) { /* Size all of the columns. */ svi_total = 0; svi_maxvma = 0; svi_namelen = 0; - bfd_map_over_sections (file, sysv_internal_sizer, (PTR) NULL); + bfd_map_over_sections (file, sysv_internal_sizer, NULL); svi_vmalen = size_number ((bfd_size_type)svi_maxvma); if ((size_t) svi_vmalen < sizeof ("addr") - 1) @@ -574,7 +558,7 @@ print_sysv_format (file) printf (":\n%-*s %*s %*s\n", svi_namelen, "section", svi_sizelen, "size", svi_vmalen, "addr"); - bfd_map_over_sections (file, sysv_internal_printer, (PTR) NULL); + bfd_map_over_sections (file, sysv_internal_printer, NULL); printf ("%-*s ", svi_namelen, "Total"); rprint_number (svi_sizelen, svi_total); @@ -582,8 +566,7 @@ print_sysv_format (file) } static void -print_sizes (file) - bfd *file; +print_sizes (bfd *file) { if (berkeley_format) print_berkeley_format (file); diff --git a/contrib/binutils/binutils/srconv.c b/contrib/binutils/binutils/srconv.c index a45437f..0ffa058 100644 --- a/contrib/binutils/binutils/srconv.c +++ b/contrib/binutils/binutils/srconv.c @@ -1,5 +1,5 @@ /* srconv.c -- Sysroff conversion program - Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 + Copyright 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -42,61 +42,52 @@ static int addrsize; static char *toolname; static char **rnames; -static int get_member_id PARAMS ((int)); -static int get_ordinary_id PARAMS ((int)); -static char *section_translate PARAMS ((char *)); -static char *strip_suffix PARAMS ((char *)); -static void checksum PARAMS ((FILE *, char *, int, int)); -static void writeINT PARAMS ((int, char *, int *, int, FILE *)); -static void writeBITS PARAMS ((int, char *, int *, int)); -static void writeBARRAY PARAMS ((barray, char *, int *, int, FILE *)); -static void writeCHARS PARAMS ((char *, char *, int *, int, FILE *)); -static void wr_tr PARAMS ((void)); -static void wr_un PARAMS ((struct coff_ofile *, struct coff_sfile *, int, int)); -static void wr_hd PARAMS ((struct coff_ofile *)); -static void wr_sh PARAMS ((struct coff_ofile *, struct coff_section *)); -static void wr_ob PARAMS ((struct coff_ofile *, struct coff_section *)); -static void wr_rl PARAMS ((struct coff_ofile *, struct coff_section *)); -static void wr_object_body PARAMS ((struct coff_ofile *)); +static int get_member_id (int); +static int get_ordinary_id (int); +static char *section_translate (char *); +static char *strip_suffix (char *); +static void checksum (FILE *, char *, int, int); +static void writeINT (int, char *, int *, int, FILE *); +static void writeBITS (int, char *, int *, int); +static void writeBARRAY (barray, char *, int *, int, FILE *); +static void writeCHARS (char *, char *, int *, int, FILE *); +static void wr_tr (void); +static void wr_un (struct coff_ofile *, struct coff_sfile *, int, int); +static void wr_hd (struct coff_ofile *); +static void wr_sh (struct coff_ofile *, struct coff_section *); +static void wr_ob (struct coff_ofile *, struct coff_section *); +static void wr_rl (struct coff_ofile *, struct coff_section *); +static void wr_object_body (struct coff_ofile *); static void wr_dps_start - PARAMS ((struct coff_sfile *, struct coff_section *, struct coff_scope *, - int, int)); -static void wr_dps_end - PARAMS ((struct coff_section *, struct coff_scope *, int)); -static int *nints PARAMS ((int)); + (struct coff_sfile *, struct coff_section *, struct coff_scope *, int, int); +static void wr_dps_end (struct coff_section *, struct coff_scope *, int); +static int *nints (int); static void walk_tree_type_1 - PARAMS ((struct coff_sfile *, struct coff_symbol *, struct coff_type *, - int)); + (struct coff_sfile *, struct coff_symbol *, struct coff_type *, int); static void walk_tree_type - PARAMS ((struct coff_sfile *, struct coff_symbol *, struct coff_type *, - int)); + (struct coff_sfile *, struct coff_symbol *, struct coff_type *, int); static void walk_tree_symbol - PARAMS ((struct coff_sfile *, struct coff_section *, - struct coff_symbol *, int)); + (struct coff_sfile *, struct coff_section *, struct coff_symbol *, int); static void walk_tree_scope - PARAMS ((struct coff_section *, struct coff_sfile *, struct coff_scope *, - int, int)); -static void walk_tree_sfile - PARAMS ((struct coff_section *, struct coff_sfile *)); -static void wr_program_structure - PARAMS ((struct coff_ofile *, struct coff_sfile *)); -static void wr_du PARAMS ((struct coff_ofile *, struct coff_sfile *, int)); -static void wr_dus PARAMS ((struct coff_ofile *, struct coff_sfile *)); -static int find_base PARAMS ((struct coff_sfile *, struct coff_section *)); -static void wr_dln PARAMS ((struct coff_ofile *, struct coff_sfile *, int)); -static void wr_globals - PARAMS ((struct coff_ofile *, struct coff_sfile *, int)); -static void wr_debug PARAMS ((struct coff_ofile *)); -static void wr_cs PARAMS ((void)); -static int wr_sc PARAMS ((struct coff_ofile *, struct coff_sfile *)); -static void wr_er PARAMS ((struct coff_ofile *, struct coff_sfile *, int)); -static void wr_ed PARAMS ((struct coff_ofile *, struct coff_sfile *, int)); -static void wr_unit_info PARAMS ((struct coff_ofile *)); -static void wr_module PARAMS ((struct coff_ofile *)); -static int align PARAMS ((int)); -static void prescan PARAMS ((struct coff_ofile *)); -static void show_usage PARAMS ((FILE *, int)); -extern int main PARAMS ((int, char **)); + (struct coff_section *, struct coff_sfile *, struct coff_scope *, int, int); +static void walk_tree_sfile (struct coff_section *, struct coff_sfile *); +static void wr_program_structure (struct coff_ofile *, struct coff_sfile *); +static void wr_du (struct coff_ofile *, struct coff_sfile *, int); +static void wr_dus (struct coff_ofile *, struct coff_sfile *); +static int find_base (struct coff_sfile *, struct coff_section *); +static void wr_dln (struct coff_ofile *, struct coff_sfile *, int); +static void wr_globals (struct coff_ofile *, struct coff_sfile *, int); +static void wr_debug (struct coff_ofile *); +static void wr_cs (void); +static int wr_sc (struct coff_ofile *, struct coff_sfile *); +static void wr_er (struct coff_ofile *, struct coff_sfile *, int); +static void wr_ed (struct coff_ofile *, struct coff_sfile *, int); +static void wr_unit_info (struct coff_ofile *); +static void wr_module (struct coff_ofile *); +static int align (int); +static void prescan (struct coff_ofile *); +static void show_usage (FILE *, int); +extern int main (int, char **); static FILE *file; static bfd *abfd; @@ -118,8 +109,7 @@ static int base1 = 0x18; static int base2 = 0x2018; static int -get_member_id (x) - int x; +get_member_id (int x) { if (ids2[x]) return ids2[x]; @@ -129,8 +119,7 @@ get_member_id (x) } static int -get_ordinary_id (x) - int x; +get_ordinary_id (int x) { if (ids1[x]) return ids1[x]; @@ -139,8 +128,7 @@ get_ordinary_id (x) return ids1[x]; } static char * -section_translate (n) - char *n; +section_translate (char *n) { if (strcmp (n, ".text") == 0) return "P"; @@ -155,8 +143,7 @@ section_translate (n) static char * -strip_suffix (name) - char *name; +strip_suffix (char *name) { int i; char *res; @@ -171,11 +158,7 @@ strip_suffix (name) /* IT LEN stuff CS */ static void -checksum (file, ptr, size, code) - FILE *file; - char *ptr; - int size; - int code; +checksum (FILE *file, char *ptr, int size, int code) { int j; int last; @@ -198,12 +181,7 @@ checksum (file, ptr, size, code) static void -writeINT (n, ptr, idx, size, file) - int n; - char *ptr; - int *idx; - int size; - FILE *file; +writeINT (int n, char *ptr, int *idx, int size, FILE *file) { int byte = *idx / 8; @@ -244,11 +222,7 @@ writeINT (n, ptr, idx, size, file) } static void -writeBITS (val, ptr, idx, size) - int val; - char *ptr; - int *idx; - int size; +writeBITS (int val, char *ptr, int *idx, int size) { int byte = *idx / 8; int bit = *idx % 8; @@ -265,12 +239,8 @@ writeBITS (val, ptr, idx, size) } static void -writeBARRAY (data, ptr, idx, size, file) - barray data; - char *ptr; - int *idx; - int size ATTRIBUTE_UNUSED; - FILE *file; +writeBARRAY (barray data, char *ptr, int *idx, int size ATTRIBUTE_UNUSED, + FILE *file) { int i; @@ -280,12 +250,7 @@ writeBARRAY (data, ptr, idx, size, file) } static void -writeCHARS (string, ptr, idx, size, file) - char *string; - char *ptr; - int *idx; - int size; - FILE *file; +writeCHARS (char *string, char *ptr, int *idx, int size, FILE *file) { int i = *idx / 8; @@ -324,7 +289,7 @@ static char *rname_h8300[] = }; static void -wr_tr () +wr_tr (void) { /* The TR block is not normal - it doesn't have any contents. */ @@ -338,11 +303,8 @@ wr_tr () } static void -wr_un (ptr, sfile, first, nsecs) - struct coff_ofile *ptr; - struct coff_sfile *sfile; - int first; - int nsecs ATTRIBUTE_UNUSED; +wr_un (struct coff_ofile *ptr, struct coff_sfile *sfile, int first, + int nsecs ATTRIBUTE_UNUSED) { struct IT_un un; struct coff_symbol *s; @@ -387,8 +349,7 @@ wr_un (ptr, sfile, first, nsecs) } static void -wr_hd (p) - struct coff_ofile *p; +wr_hd (struct coff_ofile *p) { struct IT_hd hd; @@ -475,9 +436,7 @@ wr_hd (p) static void -wr_sh (p, sec) - struct coff_ofile *p ATTRIBUTE_UNUSED; - struct coff_section *sec; +wr_sh (struct coff_ofile *p ATTRIBUTE_UNUSED, struct coff_section *sec) { struct IT_sh sh; sh.unit = 0; @@ -490,9 +449,7 @@ wr_sh (p, sec) static void -wr_ob (p, section) - struct coff_ofile *p ATTRIBUTE_UNUSED; - struct coff_section *section; +wr_ob (struct coff_ofile *p ATTRIBUTE_UNUSED, struct coff_section *section) { bfd_size_type i; int first = 1; @@ -553,9 +510,7 @@ wr_ob (p, section) } static void -wr_rl (ptr, sec) - struct coff_ofile *ptr ATTRIBUTE_UNUSED; - struct coff_section *sec; +wr_rl (struct coff_ofile *ptr ATTRIBUTE_UNUSED, struct coff_section *sec) { int nr = sec->nrelocs; int i; @@ -613,8 +568,7 @@ wr_rl (ptr, sec) } static void -wr_object_body (p) - struct coff_ofile *p; +wr_object_body (struct coff_ofile *p) { int i; @@ -627,12 +581,9 @@ wr_object_body (p) } static void -wr_dps_start (sfile, section, scope, type, nest) - struct coff_sfile *sfile; - struct coff_section *section ATTRIBUTE_UNUSED; - struct coff_scope *scope; - int type; - int nest; +wr_dps_start (struct coff_sfile *sfile, + struct coff_section *section ATTRIBUTE_UNUSED, + struct coff_scope *scope, int type, int nest) { struct IT_dps dps; @@ -667,10 +618,8 @@ wr_dps_start (sfile, section, scope, type, nest) } static void -wr_dps_end (section, scope, type) - struct coff_section *section ATTRIBUTE_UNUSED; - struct coff_scope *scope ATTRIBUTE_UNUSED; - int type; +wr_dps_end (struct coff_section *section ATTRIBUTE_UNUSED, + struct coff_scope *scope ATTRIBUTE_UNUSED, int type) { struct IT_dps dps; @@ -680,18 +629,14 @@ wr_dps_end (section, scope, type) } static int * -nints (x) - int x; +nints (int x) { return (int *) (xcalloc (sizeof (int), x)); } static void -walk_tree_type_1 (sfile, symbol, type, nest) - struct coff_sfile *sfile; - struct coff_symbol *symbol; - struct coff_type *type; - int nest; +walk_tree_type_1 (struct coff_sfile *sfile, struct coff_symbol *symbol, + struct coff_type *type, int nest) { switch (type->type) { @@ -962,11 +907,8 @@ walk_tree_type_1 (sfile, symbol, type, nest) */ static void -walk_tree_type (sfile, symbol, type, nest) - struct coff_sfile *sfile; - struct coff_symbol *symbol; - struct coff_type *type; - int nest; +walk_tree_type (struct coff_sfile *sfile, struct coff_symbol *symbol, + struct coff_type *type, int nest) { if (symbol->type->type == coff_function_type) { @@ -1012,11 +954,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 ATTRIBUTE_UNUSED; - struct coff_symbol *symbol; - int nest; +walk_tree_symbol (struct coff_sfile *sfile, struct coff_section *section ATTRIBUTE_UNUSED, struct coff_symbol *symbol, int nest) { struct IT_dsy dsy; @@ -1230,12 +1168,7 @@ walk_tree_symbol (sfile, section, symbol, nest) } static void -walk_tree_scope (section, sfile, scope, nest, type) - struct coff_section *section; - struct coff_sfile *sfile; - struct coff_scope *scope; - int nest; - int type; +walk_tree_scope (struct coff_section *section, struct coff_sfile *sfile, struct coff_scope *scope, int nest, int type) { struct coff_symbol *vars; struct coff_scope *child; @@ -1259,26 +1192,19 @@ walk_tree_scope (section, sfile, scope, nest, type) } static void -walk_tree_sfile (section, sfile) - struct coff_section *section; - struct coff_sfile *sfile; +walk_tree_sfile (struct coff_section *section, struct coff_sfile *sfile) { walk_tree_scope (section, sfile, sfile->scope, 0, BLOCK_TYPE_COMPUNIT); } static void -wr_program_structure (p, sfile) - struct coff_ofile *p; - struct coff_sfile *sfile; +wr_program_structure (struct coff_ofile *p, struct coff_sfile *sfile) { walk_tree_sfile (p->sections + 4, sfile); } static void -wr_du (p, sfile, n) - struct coff_ofile *p; - struct coff_sfile *sfile; - int n; +wr_du (struct coff_ofile *p, struct coff_sfile *sfile, int n) { struct IT_du du; int lim; @@ -1391,9 +1317,7 @@ wr_du (p, sfile, n) } static void -wr_dus (p, sfile) - struct coff_ofile *p ATTRIBUTE_UNUSED; - struct coff_sfile *sfile; +wr_dus (struct coff_ofile *p ATTRIBUTE_UNUSED, struct coff_sfile *sfile) { struct IT_dus dus; @@ -1429,19 +1353,14 @@ wr_dus (p, sfile) .text section for the output file. */ static int -find_base (sfile, section) - struct coff_sfile *sfile; - struct coff_section *section; +find_base (struct coff_sfile *sfile, struct coff_section *section) { return sfile->section[section->number].low; } static void -wr_dln (p, sfile, n) - struct coff_ofile *p ATTRIBUTE_UNUSED; - struct coff_sfile *sfile; - int n ATTRIBUTE_UNUSED; - +wr_dln (struct coff_ofile *p ATTRIBUTE_UNUSED, struct coff_sfile *sfile, + int n ATTRIBUTE_UNUSED) { #if 0 if (n == 0) @@ -1578,10 +1497,8 @@ wr_dln (p, sfile, n) /* Write the global symbols out to the debug info. */ static void -wr_globals (p, sfile, n) - struct coff_ofile *p; - struct coff_sfile *sfile; - int n ATTRIBUTE_UNUSED; +wr_globals (struct coff_ofile *p, struct coff_sfile *sfile, + int n ATTRIBUTE_UNUSED) { struct coff_symbol *sy; @@ -1601,8 +1518,7 @@ wr_globals (p, sfile, n) } static void -wr_debug (p) - struct coff_ofile *p; +wr_debug (struct coff_ofile *p) { struct coff_sfile *sfile; int n = 0; @@ -1623,7 +1539,7 @@ wr_debug (p) } static void -wr_cs () +wr_cs (void) { /* It seems that the CS struct is not normal - the size is wrong heres one I prepared earlier. */ @@ -1671,9 +1587,7 @@ wr_cs () if there isn't an equivalent one on the input. */ static int -wr_sc (ptr, sfile) - struct coff_ofile *ptr; - struct coff_sfile *sfile; +wr_sc (struct coff_ofile *ptr, struct coff_sfile *sfile) { int i; int scount = 0; @@ -1795,10 +1709,8 @@ wr_sc (ptr, sfile) /* Write out the ER records for a unit. */ static void -wr_er (ptr, sfile, first) - struct coff_ofile *ptr; - struct coff_sfile *sfile ATTRIBUTE_UNUSED; - int first; +wr_er (struct coff_ofile *ptr, struct coff_sfile *sfile ATTRIBUTE_UNUSED, + int first) { int idx = 0; struct coff_symbol *sym; @@ -1824,10 +1736,8 @@ wr_er (ptr, sfile, first) /* Write out the ED records for a unit. */ static void -wr_ed (ptr, sfile, first) - struct coff_ofile *ptr; - struct coff_sfile *sfile ATTRIBUTE_UNUSED; - int first; +wr_ed (struct coff_ofile *ptr, struct coff_sfile *sfile ATTRIBUTE_UNUSED, + int first) { struct coff_symbol *s; @@ -1866,8 +1776,7 @@ wr_ed (ptr, sfile, first) } static void -wr_unit_info (ptr) - struct coff_ofile *ptr; +wr_unit_info (struct coff_ofile *ptr) { struct coff_sfile *sfile; int first = 1; @@ -1894,8 +1803,7 @@ wr_unit_info (ptr) } static void -wr_module (p) - struct coff_ofile *p; +wr_module (struct coff_ofile *p) { wr_cs (); wr_hd (p); @@ -1906,8 +1814,7 @@ wr_module (p) } static int -align (x) - int x; +align (int x) { return (x + 3) & ~3; } @@ -1916,8 +1823,7 @@ align (x) ordinary defs - dunno why, but thats what hitachi does with 'em. */ static void -prescan (tree) - struct coff_ofile *tree; +prescan (struct coff_ofile *tree) { struct coff_symbol *s; struct coff_section *common_section; @@ -1945,9 +1851,7 @@ prescan (tree) char *program_name; static void -show_usage (file, status) - FILE *file; - int status; +show_usage (FILE *file, int status) { fprintf (file, _("Usage: %s [option(s)] in-file [out-file]\n"), program_name); fprintf (file, _("Convert a COFF object file into a SYSROFF object file\n")); @@ -1964,9 +1868,7 @@ show_usage (file, status) } int -main (ac, av) - int ac; - char *av[]; +main (int ac, char **av) { int opt; static struct option long_options[] = diff --git a/contrib/binutils/binutils/stabs.c b/contrib/binutils/binutils/stabs.c index 0873582..7af10ef 100644 --- a/contrib/binutils/binutils/stabs.c +++ b/contrib/binutils/binutils/stabs.c @@ -1,5 +1,5 @@ /* stabs.c -- Parse stabs debugging information - Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Written by Ian Lance Taylor . @@ -35,10 +35,6 @@ #include "debug.h" #include "budbg.h" #include "filenames.h" - -/* Meaningless definition needs by aout64.h. FIXME. */ -#define BYTES_IN_WORD 4 - #include "aout/aout64.h" #include "aout/stab_gnu.h" @@ -53,8 +49,8 @@ struct stab_handle { /* The BFD. */ bfd *abfd; - /* True if this is stabs in sections. */ - boolean sections; + /* TRUE if this is stabs in sections. */ + bfd_boolean sections; /* The symbol table. */ asymbol **syms; /* The number of symbols. */ @@ -74,7 +70,7 @@ struct stab_handle int gcc_compiled; /* Whether an N_OPT symbol was seen that was not generated by gcc, so that we can detect the SunPRO compiler. */ - boolean n_opt_found; + bfd_boolean n_opt_found; /* The main file name. */ char *main_filename; /* A stack of unfinished N_BINCL files. */ @@ -82,7 +78,7 @@ struct stab_handle /* A list of finished N_BINCL files. */ struct bincl_file *bincl_list; /* Whether we are inside a function or not. */ - boolean within_function; + bfd_boolean within_function; /* The address of the end of the function, used if we have seen an N_FUN symbol while in a function. This is -1 if we have not seen an N_FUN (the normal case). */ @@ -101,7 +97,7 @@ struct stab_handle struct stab_tag *tags; /* Set by parse_stab_type if it sees a structure defined as a cross reference to itself. Reset by parse_stab_type otherwise. */ - boolean self_crossref; + bfd_boolean self_crossref; }; /* A list of these structures is used to hold pending variable @@ -151,76 +147,70 @@ struct stab_tag debug_type type; }; -static char *savestring PARAMS ((const char *, int)); -static bfd_vma parse_number PARAMS ((const char **, boolean *)); -static void bad_stab PARAMS ((const char *)); -static void warn_stab PARAMS ((const char *, const char *)); -static boolean parse_stab_string - PARAMS ((PTR, struct stab_handle *, int, int, bfd_vma, const char *)); +static char *savestring (const char *, int); +static bfd_vma parse_number (const char **, bfd_boolean *); +static void bad_stab (const char *); +static void warn_stab (const char *, const char *); +static bfd_boolean parse_stab_string + (void *, struct stab_handle *, int, int, bfd_vma, const char *); static debug_type parse_stab_type - PARAMS ((PTR, struct stab_handle *, const char *, const char **, - debug_type **)); -static boolean parse_stab_type_number - PARAMS ((const char **, int *)); + (void *, struct stab_handle *, const char *, const char **, debug_type **); +static bfd_boolean parse_stab_type_number (const char **, int *); static debug_type parse_stab_range_type - PARAMS ((PTR, struct stab_handle *, const char *, const char **, - const int *)); -static debug_type parse_stab_sun_builtin_type PARAMS ((PTR, const char **)); -static debug_type parse_stab_sun_floating_type - PARAMS ((PTR, const char **)); -static debug_type parse_stab_enum_type PARAMS ((PTR, const char **)); + (void *, struct stab_handle *, const char *, const char **, const int *); +static debug_type parse_stab_sun_builtin_type (void *, const char **); +static debug_type parse_stab_sun_floating_type (void *, const char **); +static debug_type parse_stab_enum_type (void *, const char **); static debug_type parse_stab_struct_type - PARAMS ((PTR, struct stab_handle *, const char *, const char **, boolean, - const int *)); -static boolean parse_stab_baseclasses - PARAMS ((PTR, struct stab_handle *, const char **, debug_baseclass **)); -static boolean parse_stab_struct_fields - PARAMS ((PTR, struct stab_handle *, const char **, debug_field **, - boolean *)); -static boolean parse_stab_cpp_abbrev - PARAMS ((PTR, struct stab_handle *, const char **, debug_field *)); -static boolean parse_stab_one_struct_field - PARAMS ((PTR, struct stab_handle *, const char **, const char *, - debug_field *, boolean *)); -static boolean parse_stab_members - PARAMS ((PTR, struct stab_handle *, const char *, const char **, - const int *, debug_method **)); + (void *, struct stab_handle *, const char *, const char **, + bfd_boolean, const int *); +static bfd_boolean parse_stab_baseclasses + (void *, struct stab_handle *, const char **, debug_baseclass **); +static bfd_boolean parse_stab_struct_fields + (void *, struct stab_handle *, const char **, debug_field **, bfd_boolean *); +static bfd_boolean parse_stab_cpp_abbrev + (void *, struct stab_handle *, const char **, debug_field *); +static bfd_boolean parse_stab_one_struct_field + (void *, struct stab_handle *, const char **, const char *, + debug_field *, bfd_boolean *); +static bfd_boolean parse_stab_members + (void *, struct stab_handle *, const char *, const char **, const int *, + debug_method **); static debug_type parse_stab_argtypes - PARAMS ((PTR, struct stab_handle *, debug_type, const char *, const char *, - debug_type, const char *, boolean, boolean, const char **)); -static boolean parse_stab_tilde_field - PARAMS ((PTR, struct stab_handle *, const char **, const int *, - debug_type *, boolean *)); + (void *, struct stab_handle *, debug_type, const char *, const char *, + debug_type, const char *, bfd_boolean, bfd_boolean, const char **); +static bfd_boolean parse_stab_tilde_field + (void *, struct stab_handle *, const char **, const int *, debug_type *, + bfd_boolean *); static debug_type parse_stab_array_type - PARAMS ((PTR, struct stab_handle *, const char **, boolean)); -static void push_bincl PARAMS ((struct stab_handle *, const char *, bfd_vma)); -static const char *pop_bincl PARAMS ((struct stab_handle *)); -static boolean find_excl - PARAMS ((struct stab_handle *, const char *, bfd_vma)); -static boolean stab_record_variable - PARAMS ((PTR, struct stab_handle *, const char *, debug_type, - enum debug_var_kind, bfd_vma)); -static boolean stab_emit_pending_vars PARAMS ((PTR, struct stab_handle *)); -static debug_type *stab_find_slot - PARAMS ((struct stab_handle *, const int *)); -static debug_type stab_find_type - PARAMS ((PTR, struct stab_handle *, const int *)); -static boolean stab_record_type - PARAMS ((PTR, struct stab_handle *, const int *, debug_type)); + (void *, struct stab_handle *, const char **, bfd_boolean); +static void push_bincl (struct stab_handle *, const char *, bfd_vma); +static const char *pop_bincl (struct stab_handle *); +static bfd_boolean find_excl (struct stab_handle *, const char *, bfd_vma); +static bfd_boolean stab_record_variable + (void *, struct stab_handle *, const char *, debug_type, + enum debug_var_kind, bfd_vma); +static bfd_boolean stab_emit_pending_vars (void *, struct stab_handle *); +static debug_type *stab_find_slot (struct stab_handle *, const int *); +static debug_type stab_find_type (void *, struct stab_handle *, const int *); +static bfd_boolean stab_record_type + (void *, struct stab_handle *, const int *, debug_type); static debug_type stab_xcoff_builtin_type - PARAMS ((PTR, struct stab_handle *, int)); + (void *, struct stab_handle *, int); static debug_type stab_find_tagged_type - PARAMS ((PTR, struct stab_handle *, const char *, int, - enum debug_type_kind)); + (void *, struct stab_handle *, const char *, int, enum debug_type_kind); static debug_type *stab_demangle_argtypes - PARAMS ((PTR, struct stab_handle *, const char *, boolean *)); + (void *, struct stab_handle *, const char *, bfd_boolean *, unsigned int); +static debug_type *stab_demangle_v3_argtypes + (void *, struct stab_handle *, const char *, bfd_boolean *); +static debug_type stab_demangle_v3_arg + (void *, struct stab_handle *, struct demangle_component *, debug_type, + bfd_boolean *); /* Save a string in memory. */ static char * -savestring (start, len) - const char *start; - int len; +savestring (const char *start, int len) { char *ret; @@ -233,15 +223,13 @@ savestring (start, len) /* Read a number from a string. */ static bfd_vma -parse_number (pp, poverflow) - const char **pp; - boolean *poverflow; +parse_number (const char **pp, bfd_boolean *poverflow) { unsigned long ul; const char *orig; if (poverflow != NULL) - *poverflow = false; + *poverflow = FALSE; orig = *pp; @@ -259,26 +247,24 @@ parse_number (pp, poverflow) /* Note that even though strtoul overflowed, it should have set *pp to the end of the number, which is where we want it. */ - if (sizeof (bfd_vma) > sizeof (unsigned long)) { const char *p; - boolean neg; + bfd_boolean neg; int base; bfd_vma over, lastdig; - boolean overflow; + bfd_boolean overflow; bfd_vma v; /* Our own version of strtoul, for a bfd_vma. */ - p = orig; - neg = false; + neg = FALSE; if (*p == '+') ++p; else if (*p == '-') { - neg = true; + neg = TRUE; ++p; } @@ -300,7 +286,7 @@ parse_number (pp, poverflow) over = ((bfd_vma) (bfd_signed_vma) -1) / (bfd_vma) base; lastdig = ((bfd_vma) (bfd_signed_vma) -1) % (bfd_vma) base; - overflow = false; + overflow = FALSE; v = 0; while (1) { @@ -321,7 +307,7 @@ parse_number (pp, poverflow) if (v > over || (v == over && (bfd_vma) d > lastdig)) { - overflow = true; + overflow = TRUE; break; } } @@ -336,9 +322,8 @@ parse_number (pp, poverflow) /* If we get here, the number is too large to represent in a bfd_vma. */ - if (poverflow != NULL) - *poverflow = true; + *poverflow = TRUE; else warn_stab (orig, _("numeric overflow")); @@ -348,8 +333,7 @@ parse_number (pp, poverflow) /* Give an error for a bad stab string. */ static void -bad_stab (p) - const char *p; +bad_stab (const char *p) { fprintf (stderr, _("Bad stab: %s\n"), p); } @@ -357,22 +341,16 @@ bad_stab (p) /* Warn about something in a stab string. */ static void -warn_stab (p, err) - const char *p; - const char *err; +warn_stab (const char *p, const char *err) { fprintf (stderr, _("Warning: %s: %s\n"), err, p); } /* Create a handle to parse stabs symbols with. */ -PTR -start_stab (dhandle, abfd, sections, syms, symcount) - PTR dhandle ATTRIBUTE_UNUSED; - bfd *abfd; - boolean sections; - asymbol **syms; - long symcount; +void * +start_stab (void *dhandle ATTRIBUTE_UNUSED, bfd *abfd, bfd_boolean sections, + asymbol **syms, long symcount) { struct stab_handle *ret; @@ -386,16 +364,14 @@ start_stab (dhandle, abfd, sections, syms, symcount) ret->file_types = (struct stab_types **) xmalloc (sizeof *ret->file_types); ret->file_types[0] = NULL; ret->function_end = (bfd_vma) -1; - return (PTR) ret; + return (void *) ret; } /* When we have processed all the stabs information, we need to go through and fill in all the undefined tags. */ -boolean -finish_stab (dhandle, handle) - PTR dhandle; - PTR handle; +bfd_boolean +finish_stab (void *dhandle, void *handle) { struct stab_handle *info = (struct stab_handle *) handle; struct stab_tag *st; @@ -404,8 +380,8 @@ finish_stab (dhandle, handle) { if (! stab_emit_pending_vars (dhandle, info) || ! debug_end_function (dhandle, info->function_end)) - return false; - info->within_function = false; + return FALSE; + info->within_function = FALSE; info->function_end = (bfd_vma) -1; } @@ -418,22 +394,17 @@ finish_stab (dhandle, handle) kind = DEBUG_KIND_STRUCT; st->slot = debug_make_undefined_tagged_type (dhandle, st->name, kind); if (st->slot == DEBUG_TYPE_NULL) - return false; + return FALSE; } - return true; + return TRUE; } /* Handle a single stabs symbol. */ -boolean -parse_stab (dhandle, handle, type, desc, value, string) - PTR dhandle; - PTR handle; - int type; - int desc; - bfd_vma value; - const char *string; +bfd_boolean +parse_stab (void *dhandle, void *handle, int type, int desc, bfd_vma value, + const char *string) { struct stab_handle *info = (struct stab_handle *) handle; @@ -445,11 +416,11 @@ parse_stab (dhandle, handle, type, desc, value, string) && (type != N_SO || *string == '\0' || value != info->so_value)) { if (! debug_set_filename (dhandle, info->so_string)) - return false; + return FALSE; info->main_filename = info->so_string; info->gcc_compiled = 0; - info->n_opt_found = false; + info->n_opt_found = FALSE; /* Generally, for stabs in the symbol table, the N_LBRAC and N_RBRAC symbols are relative to the N_SO symbol value. */ @@ -483,7 +454,7 @@ parse_stab (dhandle, handle, type, desc, value, string) if (! info->within_function) { fprintf (stderr, _("N_LBRAC not within function\n")); - return false; + return FALSE; } /* Start an inner lexical block. */ @@ -491,11 +462,11 @@ parse_stab (dhandle, handle, type, desc, value, string) (value + info->file_start_offset + info->function_start_offset))) - return false; + return FALSE; /* Emit any pending variable definitions. */ if (! stab_emit_pending_vars (dhandle, info)) - return false; + return FALSE; ++info->block_depth; break; @@ -509,20 +480,20 @@ parse_stab (dhandle, handle, type, desc, value, string) if we do, we probably need to emit them before closing the block. */ if (! stab_emit_pending_vars (dhandle, info)) - return false; + return FALSE; /* End an inner lexical block. */ if (! debug_end_block (dhandle, (value + info->file_start_offset + info->function_start_offset))) - return false; + return FALSE; --info->block_depth; if (info->block_depth < 0) { fprintf (stderr, _("Too many N_RBRACs\n")); - return false; + return FALSE; } break; @@ -539,15 +510,15 @@ parse_stab (dhandle, handle, type, desc, value, string) endval = info->function_end; if (! stab_emit_pending_vars (dhandle, info) || ! debug_end_function (dhandle, endval)) - return false; - info->within_function = false; + return FALSE; + info->within_function = FALSE; info->function_end = (bfd_vma) -1; } /* An empty string is emitted by gcc at the end of a compilation unit. */ if (*string == '\0') - return true; + return TRUE; /* Just accumulate strings until we see a non N_SO symbol. If the string starts with a directory separator or some other @@ -576,43 +547,44 @@ parse_stab (dhandle, handle, type, desc, value, string) case N_SOL: /* Start an include file. */ if (! debug_start_source (dhandle, string)) - return false; + return FALSE; break; case N_BINCL: /* Start an include file which may be replaced. */ push_bincl (info, string, value); if (! debug_start_source (dhandle, string)) - return false; + return FALSE; break; case N_EINCL: /* End an N_BINCL include. */ if (! debug_start_source (dhandle, pop_bincl (info))) - return false; + return FALSE; break; case N_EXCL: /* This is a duplicate of a header file named by N_BINCL which was eliminated by the linker. */ if (! find_excl (info, string, value)) - return false; + return FALSE; break; case N_SLINE: if (! debug_record_line (dhandle, desc, - value + info->function_start_offset)) - return false; + value + (info->within_function + ? info->function_start_offset : 0))) + return FALSE; break; case N_BCOMM: if (! debug_start_common_block (dhandle, string)) - return false; + return FALSE; break; case N_ECOMM: if (! debug_end_common_block (dhandle, string)) - return false; + return FALSE; break; case N_FUN: @@ -626,8 +598,8 @@ parse_stab (dhandle, handle, type, desc, value, string) value += info->function_start_offset; if (! stab_emit_pending_vars (dhandle, info) || ! debug_end_function (dhandle, value)) - return false; - info->within_function = false; + return FALSE; + info->within_function = FALSE; info->function_end = (bfd_vma) -1; } break; @@ -667,18 +639,18 @@ parse_stab (dhandle, handle, type, desc, value, string) endval = info->function_end; if (! stab_emit_pending_vars (dhandle, info) || ! debug_end_function (dhandle, endval)) - return false; + return FALSE; info->function_end = (bfd_vma) -1; } /* For stabs in sections, line numbers and block addresses are offsets from the start of the function. */ if (info->sections) info->function_start_offset = value; - info->within_function = true; + info->within_function = TRUE; } if (! parse_stab_string (dhandle, info, type, desc, value, string)) - return false; + return FALSE; } break; @@ -688,7 +660,7 @@ parse_stab (dhandle, handle, type, desc, value, string) else if (string != NULL && strcmp (string, "gcc_compiled.") == 0) info->gcc_compiled = 1; else - info->n_opt_found = true; + info->n_opt_found = TRUE; break; case N_OBJ: @@ -698,32 +670,27 @@ parse_stab (dhandle, handle, type, desc, value, string) break; } - return true; + return TRUE; } /* Parse the stabs string. */ -static boolean -parse_stab_string (dhandle, info, stabtype, desc, value, string) - PTR dhandle; - struct stab_handle *info; - int stabtype; - int desc; - bfd_vma value; - const char *string; +static bfd_boolean +parse_stab_string (void *dhandle, struct stab_handle *info, int stabtype, + int desc, bfd_vma value, const char *string) { const char *p; char *name; int type; debug_type dtype; - boolean synonym; - boolean self_crossref; + bfd_boolean synonym; + bfd_boolean self_crossref; unsigned int lineno; debug_type *slot; p = strchr (string, ':'); if (p == NULL) - return true; + return TRUE; while (p[1] == ':') { @@ -732,7 +699,7 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) if (p == NULL) { bad_stab (string); - return false; + return FALSE; } } @@ -797,7 +764,7 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) if (*p != '=') { bad_stab (string); - return false; + return FALSE; } ++p; switch (*p++) @@ -805,7 +772,7 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) case 'r': /* Floating point constant. */ if (! debug_record_float_const (dhandle, name, atof (p))) - return false; + return FALSE; break; case 'i': /* Integer constant. */ @@ -816,7 +783,7 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) other languages probably should have at least unsigned as well as signed constants. */ if (! debug_record_int_const (dhandle, name, atoi (p))) - return false; + return FALSE; break; case 'e': /* SYMBOL:c=eTYPE,INTVALUE for a constant symbol whose value @@ -826,18 +793,18 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p, (debug_type **) NULL); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (*p != ',') { bad_stab (string); - return false; + return FALSE; } if (! debug_record_typed_const (dhandle, name, dtype, atoi (p))) - return false; + return FALSE; break; default: bad_stab (string); - return false; + return FALSE; } break; @@ -847,9 +814,9 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p, (debug_type **) NULL); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (! debug_record_label (dhandle, name, dtype, value)) - return false; + return FALSE; break; case 'f': @@ -858,9 +825,9 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p, (debug_type **) NULL); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (! debug_record_function (dhandle, name, dtype, type == 'F', value)) - return false; + return FALSE; /* Sun acc puts declared types of arguments here. We don't care about their actual types (FIXME -- we should remember the whole @@ -872,7 +839,7 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) if (parse_stab_type (dhandle, info, (const char *) NULL, &p, (debug_type **) NULL) == DEBUG_TYPE_NULL) - return false; + return FALSE; } break; @@ -888,7 +855,7 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p, (debug_type **) NULL); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; leading = bfd_get_symbol_leading_char (info->abfd); for (c = info->symcount, ps = info->syms; c > 0; --c, ++ps) { @@ -904,7 +871,7 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) value = bfd_asymbol_value (*ps); if (! stab_record_variable (dhandle, info, name, dtype, DEBUG_GLOBAL, value)) - return false; + return FALSE; } break; @@ -916,10 +883,10 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p, (debug_type **) NULL); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (! stab_record_variable (dhandle, info, name, dtype, DEBUG_LOCAL, value)) - return false; + return FALSE; break; case 'p': @@ -940,21 +907,20 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) debug_type ftype; ftype = debug_make_function_type (dhandle, dtype, - (debug_type *) NULL, false); + (debug_type *) NULL, FALSE); dtype = debug_make_pointer_type (dhandle, ftype); } } if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (! debug_record_parameter (dhandle, name, dtype, DEBUG_PARM_STACK, value)) - return false; + return FALSE; /* FIXME: At this point gdb considers rearranging the parameter address on a big endian machine if it is smaller than an int. We have no way to do that, since we don't really know much about the target. */ - break; case 'P': @@ -967,7 +933,7 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) if (parse_stab_type (dhandle, info, (const char *) NULL, &p, (debug_type **) NULL) == DEBUG_TYPE_NULL) - return false; + return FALSE; } break; } @@ -977,10 +943,10 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p, (debug_type **) NULL); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (! debug_record_parameter (dhandle, name, dtype, DEBUG_PARM_REG, value)) - return false; + return FALSE; break; case 'r': @@ -988,41 +954,40 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p, (debug_type **) NULL); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (! stab_record_variable (dhandle, info, name, dtype, DEBUG_REGISTER, value)) - return false; + return FALSE; /* FIXME: At this point gdb checks to combine pairs of 'p' and 'r' stabs into a single 'P' stab. */ - break; case 'S': - /* Static symbol at top level of file */ + /* Static symbol at top level of file. */ dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p, (debug_type **) NULL); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (! stab_record_variable (dhandle, info, name, dtype, DEBUG_STATIC, value)) - return false; + return FALSE; break; case 't': /* A typedef. */ dtype = parse_stab_type (dhandle, info, name, &p, &slot); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (name == NULL) { /* A nameless type. Nothing to do. */ - return true; + return TRUE; } dtype = debug_name_type (dhandle, name, dtype); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (slot != NULL) *slot = dtype; @@ -1034,21 +999,21 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) by 't' which means we are typedef'ing it as well. */ if (*p != 't') { - synonym = false; - /* FIXME: gdb sets synonym to true if the current language + synonym = FALSE; + /* FIXME: gdb sets synonym to TRUE if the current language is C++. */ } else { - synonym = true; + synonym = TRUE; ++p; } dtype = parse_stab_type (dhandle, info, name, &p, &slot); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (name == NULL) - return true; + return TRUE; /* INFO->SELF_CROSSREF is set by parse_stab_type if this type is a cross reference to itself. These are generated by some @@ -1057,7 +1022,7 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) dtype = debug_tag_type (dhandle, name, dtype); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (slot != NULL) *slot = dtype; @@ -1084,7 +1049,7 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) { dtype = debug_name_type (dhandle, name, dtype); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (slot != NULL) *slot = dtype; @@ -1097,11 +1062,11 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p, (debug_type **) NULL); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; /* FIXME: gdb checks os9k_stabs here. */ if (! stab_record_variable (dhandle, info, name, dtype, DEBUG_LOCAL_STATIC, value)) - return false; + return FALSE; break; case 'v': @@ -1109,10 +1074,10 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p, (debug_type **) NULL); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (! debug_record_parameter (dhandle, name, dtype, DEBUG_PARM_REFERENCE, value)) - return false; + return FALSE; break; case 'a': @@ -1120,10 +1085,10 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p, (debug_type **) NULL); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (! debug_record_parameter (dhandle, name, dtype, DEBUG_PARM_REF_REG, value)) - return false; + return FALSE; break; case 'X': @@ -1134,21 +1099,21 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) dtype = parse_stab_type (dhandle, info, (const char *) NULL, &p, (debug_type **) NULL); if (dtype == DEBUG_TYPE_NULL) - return false; + return FALSE; if (! stab_record_variable (dhandle, info, name, dtype, DEBUG_LOCAL, value)) - return false; + return FALSE; break; default: bad_stab (string); - return false; + return FALSE; } /* FIXME: gdb converts structure values to structure pointers in a couple of cases, depending upon the target. */ - return true; + return TRUE; } /* Parse a stabs type. The typename argument is non-NULL if this is a @@ -1157,17 +1122,12 @@ parse_stab_string (dhandle, info, stabtype, desc, value, string) store the slot used if the type is being defined. */ static debug_type -parse_stab_type (dhandle, info, typename, pp, slotp) - PTR dhandle; - struct stab_handle *info; - const char *typename; - const char **pp; - debug_type **slotp; +parse_stab_type (void *dhandle, struct stab_handle *info, const char *typename, const char **pp, debug_type **slotp) { const char *orig; int typenums[2]; int size; - boolean stringp; + bfd_boolean stringp; int descriptor; debug_type dtype; @@ -1177,9 +1137,9 @@ parse_stab_type (dhandle, info, typename, pp, slotp) orig = *pp; size = -1; - stringp = false; + stringp = FALSE; - info->self_crossref = false; + info->self_crossref = FALSE; /* Read type number if present. The type number may be omitted. for instance in a two-dimensional array declared with type @@ -1196,11 +1156,9 @@ parse_stab_type (dhandle, info, typename, pp, slotp) return DEBUG_TYPE_NULL; if (**pp != '=') - { - /* Type is not being defined here. Either it already - exists, or this is a forward reference to it. */ - return stab_find_type (dhandle, info, typenums); - } + /* Type is not being defined here. Either it already + exists, or this is a forward reference to it. */ + return stab_find_type (dhandle, info, typenums); /* Only set the slot if the type is being defined. This means that the mapping from type numbers to types will only record @@ -1228,10 +1186,8 @@ parse_stab_type (dhandle, info, typename, pp, slotp) const char *attr; if (ISDIGIT (*p) || *p == '(' || *p == '-') - { - /* Member type. */ - break; - } + /* Member type. */ + break; /* Type attributes. */ attr = p; @@ -1256,7 +1212,7 @@ parse_stab_type (dhandle, info, typename, pp, slotp) break; case 'S': - stringp = true; + stringp = TRUE; break; default: @@ -1278,7 +1234,6 @@ parse_stab_type (dhandle, info, typename, pp, slotp) const char *q1, *q2, *p; /* A cross reference to another type. */ - switch (**pp) { case 's': @@ -1334,7 +1289,7 @@ parse_stab_type (dhandle, info, typename, pp, slotp) if (typename != NULL && strncmp (typename, *pp, p - *pp) == 0 && typename[p - *pp] == '\0') - info->self_crossref = true; + info->self_crossref = TRUE; dtype = stab_find_tagged_type (dhandle, info, *pp, p - *pp, code); @@ -1359,7 +1314,6 @@ parse_stab_type (dhandle, info, typename, pp, slotp) int xtypenums[2]; /* This type is defined as another type. */ - (*pp)--; hold = *pp; @@ -1418,7 +1372,7 @@ parse_stab_type (dhandle, info, typename, pp, slotp) (dhandle, parse_stab_type (dhandle, info, (const char *) NULL, pp, (debug_type **) NULL), - (debug_type *) NULL, false)); + (debug_type *) NULL, FALSE)); break; case 'k': @@ -1489,7 +1443,7 @@ parse_stab_type (dhandle, info, typename, pp, slotp) ++*pp; dtype = debug_make_method_type (dhandle, return_type, DEBUG_TYPE_NULL, - (debug_type *) NULL, false); + (debug_type *) NULL, FALSE); } else { @@ -1498,7 +1452,7 @@ parse_stab_type (dhandle, info, typename, pp, slotp) debug_type *args; unsigned int n; unsigned int alloc; - boolean varargs; + bfd_boolean varargs; domain = parse_stab_type (dhandle, info, (const char *) NULL, pp, (debug_type **) NULL); @@ -1533,7 +1487,7 @@ parse_stab_type (dhandle, info, typename, pp, slotp) { alloc += 10; args = ((debug_type *) - xrealloc ((PTR) args, alloc * sizeof *args)); + xrealloc (args, alloc * sizeof *args)); } args[n] = parse_stab_type (dhandle, info, (const char *) NULL, @@ -1549,11 +1503,11 @@ parse_stab_type (dhandle, info, typename, pp, slotp) the void type. */ if (n == 0 || debug_get_type_kind (dhandle, args[n - 1]) != DEBUG_KIND_VOID) - varargs = true; + varargs = TRUE; else { --n; - varargs = false; + varargs = FALSE; } args[n] = DEBUG_TYPE_NULL; @@ -1640,10 +1594,8 @@ parse_stab_type (dhandle, info, typename, pp, slotp) single number N is equivalent to (0,N). Return the two numbers by storing them in the vector TYPENUMS. */ -static boolean -parse_stab_type_number (pp, typenums) - const char **pp; - int *typenums; +static bfd_boolean +parse_stab_type_number (const char **pp, int *typenums) { const char *orig; @@ -1652,47 +1604,42 @@ parse_stab_type_number (pp, typenums) if (**pp != '(') { typenums[0] = 0; - typenums[1] = (int) parse_number (pp, (boolean *) NULL); + typenums[1] = (int) parse_number (pp, (bfd_boolean *) NULL); } else { ++*pp; - typenums[0] = (int) parse_number (pp, (boolean *) NULL); + typenums[0] = (int) parse_number (pp, (bfd_boolean *) NULL); if (**pp != ',') { bad_stab (orig); - return false; + return FALSE; } ++*pp; - typenums[1] = (int) parse_number (pp, (boolean *) NULL); + typenums[1] = (int) parse_number (pp, (bfd_boolean *) NULL); if (**pp != ')') { bad_stab (orig); - return false; + return FALSE; } ++*pp; } - return true; + return TRUE; } /* Parse a range type. */ static debug_type -parse_stab_range_type (dhandle, info, typename, pp, typenums) - PTR dhandle; - struct stab_handle *info; - const char *typename; - const char **pp; - const int *typenums; +parse_stab_range_type (void *dhandle, struct stab_handle *info, const char *typename, const char **pp, const int *typenums) { const char *orig; int rangenums[2]; - boolean self_subrange; + bfd_boolean self_subrange; debug_type index_type; const char *s2, *s3; bfd_signed_vma n2, n3; - boolean ov2, ov3; + bfd_boolean ov2, ov3; orig = *pp; @@ -1742,18 +1689,18 @@ parse_stab_range_type (dhandle, info, typename, pp, typenums) { /* gcc will emit range stabs for long long types. Handle this as a special case. FIXME: This needs to be more general. */ -#define LLLOW "01000000000000000000000;" -#define LLHIGH "0777777777777777777777;" +#define LLLOW "01000000000000000000000;" +#define LLHIGH "0777777777777777777777;" #define ULLHIGH "01777777777777777777777;" if (index_type == DEBUG_TYPE_NULL) { if (strncmp (s2, LLLOW, sizeof LLLOW - 1) == 0 && strncmp (s3, LLHIGH, sizeof LLHIGH - 1) == 0) - return debug_make_int_type (dhandle, 8, false); + return debug_make_int_type (dhandle, 8, FALSE); if (! ov2 && n2 == 0 && strncmp (s3, ULLHIGH, sizeof ULLHIGH - 1) == 0) - return debug_make_int_type (dhandle, 8, true); + return debug_make_int_type (dhandle, 8, TRUE); } warn_stab (orig, _("numeric overflow")); @@ -1786,50 +1733,50 @@ parse_stab_range_type (dhandle, info, typename, pp, typenums) if (typename != NULL) { if (strcmp (typename, "long long int") == 0) - return debug_make_int_type (dhandle, 8, false); + return debug_make_int_type (dhandle, 8, FALSE); else if (strcmp (typename, "long long unsigned int") == 0) - return debug_make_int_type (dhandle, 8, true); + return debug_make_int_type (dhandle, 8, TRUE); } /* FIXME: The size here really depends upon the target. */ - return debug_make_int_type (dhandle, 4, true); + return debug_make_int_type (dhandle, 4, TRUE); } /* A range of 0 to 127 is char. */ if (self_subrange && n2 == 0 && n3 == 127) - return debug_make_int_type (dhandle, 1, false); + return debug_make_int_type (dhandle, 1, FALSE); /* FIXME: gdb checks for the language CHILL here. */ if (n2 == 0) { if (n3 < 0) - return debug_make_int_type (dhandle, - n3, true); + return debug_make_int_type (dhandle, - n3, TRUE); else if (n3 == 0xff) - return debug_make_int_type (dhandle, 1, true); + return debug_make_int_type (dhandle, 1, TRUE); else if (n3 == 0xffff) - return debug_make_int_type (dhandle, 2, true); + return debug_make_int_type (dhandle, 2, TRUE); else if (n3 == (bfd_signed_vma) 0xffffffff) - return debug_make_int_type (dhandle, 4, true); + return debug_make_int_type (dhandle, 4, TRUE); #ifdef BFD64 else if (n3 == ((((bfd_signed_vma) 0xffffffff) << 32) | 0xffffffff)) - return debug_make_int_type (dhandle, 8, true); + return debug_make_int_type (dhandle, 8, TRUE); #endif } else if (n3 == 0 && n2 < 0 && (self_subrange || n2 == -8)) - return debug_make_int_type (dhandle, - n2, true); + return debug_make_int_type (dhandle, - n2, TRUE); else if (n2 == - n3 - 1 || n2 == n3 + 1) { if (n3 == 0x7f) - return debug_make_int_type (dhandle, 1, false); + return debug_make_int_type (dhandle, 1, FALSE); else if (n3 == 0x7fff) - return debug_make_int_type (dhandle, 2, false); + return debug_make_int_type (dhandle, 2, FALSE); else if (n3 == 0x7fffffff) - return debug_make_int_type (dhandle, 4, false); + return debug_make_int_type (dhandle, 4, FALSE); #ifdef BFD64 else if (n3 == ((((bfd_vma) 0x7fffffff) << 32) | 0xffffffff)) - return debug_make_int_type (dhandle, 8, false); + return debug_make_int_type (dhandle, 8, FALSE); #endif } } @@ -1849,7 +1796,7 @@ parse_stab_range_type (dhandle, info, typename, pp, typenums) /* Does this actually ever happen? Is that why we are worrying about dealing with it rather than just calling error_type? */ warn_stab (orig, _("missing index type")); - index_type = debug_make_int_type (dhandle, 4, false); + index_type = debug_make_int_type (dhandle, 4, FALSE); } return debug_make_range_type (dhandle, index_type, n2, n3); @@ -1868,12 +1815,10 @@ parse_stab_range_type (dhandle, info, typename, pp, typenums) FIXME. */ static debug_type -parse_stab_sun_builtin_type (dhandle, pp) - PTR dhandle; - const char **pp; +parse_stab_sun_builtin_type (void *dhandle, const char **pp) { const char *orig; - boolean unsignedp; + bfd_boolean unsignedp; bfd_vma bits; orig = *pp; @@ -1881,10 +1826,10 @@ parse_stab_sun_builtin_type (dhandle, pp) switch (**pp) { case 's': - unsignedp = false; + unsignedp = FALSE; break; case 'u': - unsignedp = true; + unsignedp = TRUE; break; default: bad_stab (orig); @@ -1903,7 +1848,7 @@ parse_stab_sun_builtin_type (dhandle, pp) by this type, except that unsigned short is 4 instead of 2. Since this information is redundant with the third number, we will ignore it. */ - (void) parse_number (pp, (boolean *) NULL); + (void) parse_number (pp, (bfd_boolean *) NULL); if (**pp != ';') { bad_stab (orig); @@ -1912,7 +1857,7 @@ parse_stab_sun_builtin_type (dhandle, pp) ++*pp; /* The second number is always 0, so ignore it too. */ - (void) parse_number (pp, (boolean *) NULL); + (void) parse_number (pp, (bfd_boolean *) NULL); if (**pp != ';') { bad_stab (orig); @@ -1921,7 +1866,7 @@ parse_stab_sun_builtin_type (dhandle, pp) ++*pp; /* The third number is the number of bits for this type. */ - bits = parse_number (pp, (boolean *) NULL); + bits = parse_number (pp, (bfd_boolean *) NULL); /* The type *should* end with a semicolon. If it are embedded in a larger type the semicolon may be the only way to know where @@ -1941,9 +1886,7 @@ parse_stab_sun_builtin_type (dhandle, pp) /* Parse a builtin floating type generated by the Sun compiler. */ static debug_type -parse_stab_sun_floating_type (dhandle, pp) - PTR dhandle; - const char **pp; +parse_stab_sun_floating_type (void *dhandle, const char **pp) { const char *orig; bfd_vma details; @@ -1953,7 +1896,7 @@ parse_stab_sun_floating_type (dhandle, pp) /* The first number has more details about the type, for example FN_COMPLEX. */ - details = parse_number (pp, (boolean *) NULL); + details = parse_number (pp, (bfd_boolean *) NULL); if (**pp != ';') { bad_stab (orig); @@ -1961,7 +1904,7 @@ parse_stab_sun_floating_type (dhandle, pp) } /* The second number is the number of bytes occupied by this type */ - bytes = parse_number (pp, (boolean *) NULL); + bytes = parse_number (pp, (bfd_boolean *) NULL); if (**pp != ';') { bad_stab (orig); @@ -1979,9 +1922,7 @@ parse_stab_sun_floating_type (dhandle, pp) /* Handle an enum type. */ static debug_type -parse_stab_enum_type (dhandle, pp) - PTR dhandle; - const char **pp; +parse_stab_enum_type (void *dhandle, const char **pp) { const char *orig; const char **names; @@ -2022,7 +1963,7 @@ parse_stab_enum_type (dhandle, pp) name = savestring (*pp, p - *pp); *pp = p + 1; - val = (bfd_signed_vma) parse_number (pp, (boolean *) NULL); + val = (bfd_signed_vma) parse_number (pp, (bfd_boolean *) NULL); if (**pp != ',') { bad_stab (orig); @@ -2034,9 +1975,9 @@ parse_stab_enum_type (dhandle, pp) { alloc += 10; names = ((const char **) - xrealloc ((PTR) names, alloc * sizeof *names)); + xrealloc (names, alloc * sizeof *names)); values = ((bfd_signed_vma *) - xrealloc ((PTR) values, alloc * sizeof *values)); + xrealloc (values, alloc * sizeof *values)); } names[n] = name; @@ -2057,31 +1998,27 @@ parse_stab_enum_type (dhandle, pp) describing the type. PP points to a character pointer that points to the next unconsumed token - in the the stabs string. For example, given stabs "A:T4=s4a:1,0,32;;", + in the stabs string. For example, given stabs "A:T4=s4a:1,0,32;;", *PP will point to "4a:1,0,32;;". */ static debug_type -parse_stab_struct_type (dhandle, info, tagname, pp, structp, typenums) - PTR dhandle; - struct stab_handle *info; - const char *tagname; - const char **pp; - boolean structp; - const int *typenums; +parse_stab_struct_type (void *dhandle, struct stab_handle *info, + const char *tagname, const char **pp, + bfd_boolean structp, const int *typenums) { const char *orig; bfd_vma size; debug_baseclass *baseclasses; debug_field *fields; - boolean statics; + bfd_boolean statics; debug_method *methods; debug_type vptrbase; - boolean ownvptr; + bfd_boolean ownvptr; orig = *pp; /* Get the size. */ - size = parse_number (pp, (boolean *) NULL); + size = parse_number (pp, (bfd_boolean *) NULL); /* Get the other information. */ if (! parse_stab_baseclasses (dhandle, info, pp, &baseclasses) @@ -2114,7 +2051,7 @@ parse_stab_struct_type (dhandle, info, tagname, pp, structp, typenums) the type for the base class, and a terminating semicolon. A typical example, with two base classes, would be "!2,020,19;0264,21;". - ^^ ^ ^ ^ ^ ^ ^ + ^^ ^ ^ ^ ^ ^ ^ Baseclass information marker __________________|| | | | | | | Number of baseclasses __________________________| | | | | | | Visibility specifiers (2) ________________________| | | | | | @@ -2124,14 +2061,11 @@ parse_stab_struct_type (dhandle, info, tagname, pp, structp, typenums) Offset in bits from start of class ________________________| | Type number of base class ____________________________________| - Return true for success, false for failure. */ + Return TRUE for success, FALSE for failure. */ -static boolean -parse_stab_baseclasses (dhandle, info, pp, retp) - PTR dhandle; - struct stab_handle *info; - const char **pp; - debug_baseclass **retp; +static bfd_boolean +parse_stab_baseclasses (void *dhandle, struct stab_handle *info, + const char **pp, debug_baseclass **retp) { const char *orig; unsigned int c, i; @@ -2144,16 +2078,16 @@ parse_stab_baseclasses (dhandle, info, pp, retp) if (**pp != '!') { /* No base classes. */ - return true; + return TRUE; } ++*pp; - c = (unsigned int) parse_number (pp, (boolean *) NULL); + c = (unsigned int) parse_number (pp, (bfd_boolean *) NULL); if (**pp != ',') { bad_stab (orig); - return false; + return FALSE; } ++*pp; @@ -2161,7 +2095,7 @@ parse_stab_baseclasses (dhandle, info, pp, retp) for (i = 0; i < c; i++) { - boolean virtual; + bfd_boolean virtual; enum debug_visibility visibility; bfd_vma bitpos; debug_type type; @@ -2169,14 +2103,14 @@ parse_stab_baseclasses (dhandle, info, pp, retp) switch (**pp) { case '0': - virtual = false; + virtual = FALSE; break; case '1': - virtual = true; + virtual = TRUE; break; default: warn_stab (orig, _("unknown virtual character for baseclass")); - virtual = false; + virtual = FALSE; break; } ++*pp; @@ -2202,26 +2136,26 @@ parse_stab_baseclasses (dhandle, info, pp, retp) /* The remaining value is the bit offset of the portion of the object corresponding to this baseclass. Always zero in the absence of multiple inheritance. */ - bitpos = parse_number (pp, (boolean *) NULL); + bitpos = parse_number (pp, (bfd_boolean *) NULL); if (**pp != ',') { bad_stab (orig); - return false; + return FALSE; } ++*pp; type = parse_stab_type (dhandle, info, (const char *) NULL, pp, (debug_type **) NULL); if (type == DEBUG_TYPE_NULL) - return false; + return FALSE; classes[i] = debug_make_baseclass (dhandle, type, bitpos, virtual, visibility); if (classes[i] == DEBUG_BASECLASS_NULL) - return false; + return FALSE; if (**pp != ';') - return false; + return FALSE; ++*pp; } @@ -2229,12 +2163,12 @@ parse_stab_baseclasses (dhandle, info, pp, retp) *retp = classes; - return true; + return TRUE; } /* Read struct or class data fields. They have the form: - NAME : [VISIBILITY] TYPENUM , BITPOS , BITSIZE ; + NAME : [VISIBILITY] TYPENUM , BITPOS , BITSIZE ; At the end, we see a semicolon instead of a field. @@ -2243,7 +2177,7 @@ parse_stab_baseclasses (dhandle, info, pp, retp) The optional VISIBILITY is one of: - '/0' (VISIBILITY_PRIVATE) + '/0' (VISIBILITY_PRIVATE) '/1' (VISIBILITY_PROTECTED) '/2' (VISIBILITY_PUBLIC) '/9' (VISIBILITY_IGNORE) @@ -2252,13 +2186,10 @@ parse_stab_baseclasses (dhandle, info, pp, retp) Returns 1 for success, 0 for failure. */ -static boolean -parse_stab_struct_fields (dhandle, info, pp, retp, staticsp) - PTR dhandle; - struct stab_handle *info; - const char **pp; - debug_field **retp; - boolean *staticsp; +static bfd_boolean +parse_stab_struct_fields (void *dhandle, struct stab_handle *info, + const char **pp, debug_field **retp, + bfd_boolean *staticsp) { const char *orig; const char *p; @@ -2267,7 +2198,7 @@ parse_stab_struct_fields (dhandle, info, pp, retp, staticsp) unsigned int alloc; *retp = NULL; - *staticsp = false; + *staticsp = FALSE; orig = *pp; @@ -2285,7 +2216,7 @@ parse_stab_struct_fields (dhandle, info, pp, retp, staticsp) { alloc += 10; fields = ((debug_field *) - xrealloc ((PTR) fields, alloc * sizeof *fields)); + xrealloc (fields, alloc * sizeof *fields)); } /* If it starts with CPLUS_MARKER it is a special abbreviation, @@ -2299,7 +2230,7 @@ parse_stab_struct_fields (dhandle, info, pp, retp, staticsp) { ++*pp; if (! parse_stab_cpp_abbrev (dhandle, info, pp, fields + c)) - return false; + return FALSE; ++c; continue; } @@ -2313,7 +2244,7 @@ parse_stab_struct_fields (dhandle, info, pp, retp, staticsp) if (p == NULL) { bad_stab (orig); - return false; + return FALSE; } if (p[1] == ':') @@ -2321,7 +2252,7 @@ parse_stab_struct_fields (dhandle, info, pp, retp, staticsp) if (! parse_stab_one_struct_field (dhandle, info, pp, p, fields + c, staticsp)) - return false; + return FALSE; ++c; } @@ -2330,17 +2261,14 @@ parse_stab_struct_fields (dhandle, info, pp, retp, staticsp) *retp = fields; - return true; + return TRUE; } /* Special GNU C++ name. */ -static boolean -parse_stab_cpp_abbrev (dhandle, info, pp, retp) - PTR dhandle; - struct stab_handle *info; - const char **pp; - debug_field *retp; +static bfd_boolean +parse_stab_cpp_abbrev (void *dhandle, struct stab_handle *info, + const char **pp, debug_field *retp) { const char *orig; int cpp_abbrev; @@ -2357,7 +2285,7 @@ parse_stab_cpp_abbrev (dhandle, info, pp, retp) if (**pp != 'v') { bad_stab (*pp); - return false; + return FALSE; } ++*pp; @@ -2372,7 +2300,7 @@ parse_stab_cpp_abbrev (dhandle, info, pp, retp) context = parse_stab_type (dhandle, info, (const char *) NULL, pp, (debug_type **) NULL); if (context == DEBUG_TYPE_NULL) - return false; + return FALSE; switch (cpp_abbrev) { @@ -2399,7 +2327,7 @@ parse_stab_cpp_abbrev (dhandle, info, pp, retp) if (**pp != ':') { bad_stab (orig); - return false; + return FALSE; } ++*pp; @@ -2408,36 +2336,32 @@ parse_stab_cpp_abbrev (dhandle, info, pp, retp) if (**pp != ',') { bad_stab (orig); - return false; + return FALSE; } ++*pp; - bitpos = parse_number (pp, (boolean *) NULL); + bitpos = parse_number (pp, (bfd_boolean *) NULL); if (**pp != ';') { bad_stab (orig); - return false; + return FALSE; } ++*pp; *retp = debug_make_field (dhandle, name, type, bitpos, 0, DEBUG_VISIBILITY_PRIVATE); if (*retp == DEBUG_FIELD_NULL) - return false; + return FALSE; - return true; + return TRUE; } /* Parse a single field in a struct or union. */ -static boolean -parse_stab_one_struct_field (dhandle, info, pp, p, retp, staticsp) - PTR dhandle; - struct stab_handle *info; - const char **pp; - const char *p; - debug_field *retp; - boolean *staticsp; +static bfd_boolean +parse_stab_one_struct_field (void *dhandle, struct stab_handle *info, + const char **pp, const char *p, + debug_field *retp, bfd_boolean *staticsp) { const char *orig; char *name; @@ -2481,7 +2405,7 @@ parse_stab_one_struct_field (dhandle, info, pp, p, retp, staticsp) type = parse_stab_type (dhandle, info, (const char *) NULL, pp, (debug_type **) NULL); if (type == DEBUG_TYPE_NULL) - return false; + return FALSE; if (**pp == ':') { @@ -2493,7 +2417,7 @@ parse_stab_one_struct_field (dhandle, info, pp, p, retp, staticsp) if (p == NULL) { bad_stab (orig); - return false; + return FALSE; } varname = savestring (*pp, p - *pp); @@ -2502,31 +2426,31 @@ parse_stab_one_struct_field (dhandle, info, pp, p, retp, staticsp) *retp = debug_make_static_member (dhandle, name, type, varname, visibility); - *staticsp = true; + *staticsp = TRUE; - return true; + return TRUE; } if (**pp != ',') { bad_stab (orig); - return false; + return FALSE; } ++*pp; - bitpos = parse_number (pp, (boolean *) NULL); + bitpos = parse_number (pp, (bfd_boolean *) NULL); if (**pp != ',') { bad_stab (orig); - return false; + return FALSE; } ++*pp; - bitsize = parse_number (pp, (boolean *) NULL); + bitsize = parse_number (pp, (bfd_boolean *) NULL); if (**pp != ';') { bad_stab (orig); - return false; + return FALSE; } ++*pp; @@ -2552,7 +2476,7 @@ parse_stab_one_struct_field (dhandle, info, pp, p, retp, staticsp) *retp = debug_make_field (dhandle, name, type, bitpos, bitsize, visibility); - return true; + return TRUE; } /* Read member function stabs info for C++ classes. The form of each member @@ -2568,14 +2492,10 @@ parse_stab_one_struct_field (dhandle, info, pp, p, retp, staticsp) $ is the CPLUS_MARKER (usually '$'), `*' holds the place for an operator name (such as `+=') and `.' marks the end of the operator name. */ -static boolean -parse_stab_members (dhandle, info, tagname, pp, typenums, retp) - PTR dhandle; - struct stab_handle *info; - const char *tagname; - const char **pp; - const int *typenums; - debug_method **retp; +static bfd_boolean +parse_stab_members (void *dhandle, struct stab_handle *info, + const char *tagname, const char **pp, + const int *typenums, debug_method **retp) { const char *orig; debug_method *methods; @@ -2611,7 +2531,7 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) } else { - /* This is a completely wierd case. In order to stuff in the + /* This is a completely weird case. In order to stuff in the names that might contain colons (the usual name delimiter), Mike Tiemann defined a different name format which is signalled if the identifier is "op$". In that case, the @@ -2623,7 +2543,7 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) if (*p != '.') { bad_stab (orig); - return false; + return FALSE; } name = savestring (*pp, p - *pp); *pp = p + 1; @@ -2639,14 +2559,14 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) do { debug_type type; - boolean stub; + bfd_boolean stub; char *argtypes; enum debug_visibility visibility; - boolean constp, volatilep, staticp; + bfd_boolean constp, volatilep, staticp; bfd_vma voffset; debug_type context; const char *physname; - boolean varargs; + bfd_boolean varargs; if (look_ahead_type != DEBUG_TYPE_NULL) { @@ -2659,11 +2579,11 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) type = parse_stab_type (dhandle, info, (const char *) NULL, pp, (debug_type **) NULL); if (type == DEBUG_TYPE_NULL) - return false; + return FALSE; if (**pp != ':') { bad_stab (orig); - return false; + return FALSE; } } @@ -2672,13 +2592,13 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) if (p == NULL) { bad_stab (orig); - return false; + return FALSE; } - stub = false; + stub = FALSE; if (debug_get_type_kind (dhandle, type) == DEBUG_KIND_METHOD && debug_get_parameter_types (dhandle, type, &varargs) == NULL) - stub = true; + stub = TRUE; argtypes = savestring (*pp, p - *pp); *pp = p + 1; @@ -2697,8 +2617,8 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) } ++*pp; - constp = false; - volatilep = false; + constp = FALSE; + volatilep = FALSE; switch (**pp) { case 'A': @@ -2707,18 +2627,18 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) break; case 'B': /* const member function. */ - constp = true; + constp = TRUE; ++*pp; break; case 'C': /* volatile member function. */ - volatilep = true; + volatilep = TRUE; ++*pp; break; case 'D': /* const volatile member function. */ - constp = true; - volatilep = true; + constp = TRUE; + volatilep = TRUE; ++*pp; break; case '*': @@ -2731,7 +2651,7 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) break; } - staticp = false; + staticp = FALSE; switch (**pp) { case '*': @@ -2739,11 +2659,11 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) bit is supposedly set to distinguish pointers-to-methods from virtual function indicies. */ ++*pp; - voffset = parse_number (pp, (boolean *) NULL); + voffset = parse_number (pp, (bfd_boolean *) NULL); if (**pp != ';') { bad_stab (orig); - return false; + return FALSE; } ++*pp; voffset &= 0x7fffffff; @@ -2774,7 +2694,7 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) if (**pp != ';') { bad_stab (orig); - return false; + return FALSE; } ++*pp; } @@ -2784,11 +2704,11 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) case '?': /* static member function. */ ++*pp; - staticp = true; + staticp = TRUE; voffset = 0; context = DEBUG_TYPE_NULL; if (strncmp (argtypes, name, strlen (name)) != 0) - stub = true; + stub = TRUE; break; default: @@ -2817,25 +2737,25 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) class_type = stab_find_type (dhandle, info, typenums); if (class_type == DEBUG_TYPE_NULL) - return false; + return FALSE; return_type = debug_get_return_type (dhandle, type); if (return_type == DEBUG_TYPE_NULL) { bad_stab (orig); - return false; + return FALSE; } type = parse_stab_argtypes (dhandle, info, class_type, name, tagname, return_type, argtypes, constp, volatilep, &physname); if (type == DEBUG_TYPE_NULL) - return false; + return FALSE; } if (cvars + 1 >= allocvars) { allocvars += 10; variants = ((debug_method_variant *) - xrealloc ((PTR) variants, + xrealloc (variants, allocvars * sizeof *variants)); } @@ -2852,7 +2772,7 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) constp, volatilep); if (variants[cvars] == DEBUG_METHOD_VARIANT_NULL) - return false; + return FALSE; ++cvars; } @@ -2867,7 +2787,7 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) { alloc += 10; methods = ((debug_method *) - xrealloc ((PTR) methods, alloc * sizeof *methods)); + xrealloc (methods, alloc * sizeof *methods)); } methods[c] = debug_make_method (dhandle, name, variants); @@ -2880,7 +2800,7 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) *retp = methods; - return true; + return TRUE; } /* Parse a string representing argument types for a method. Stabs @@ -2890,24 +2810,19 @@ parse_stab_members (dhandle, info, tagname, pp, typenums, retp) the tag name. */ static debug_type -parse_stab_argtypes (dhandle, info, class_type, fieldname, tagname, - return_type, argtypes, constp, volatilep, pphysname) - PTR dhandle; - struct stab_handle *info; - debug_type class_type; - const char *fieldname; - const char *tagname; - debug_type return_type; - const char *argtypes; - boolean constp; - boolean volatilep; - const char **pphysname; +parse_stab_argtypes (void *dhandle, struct stab_handle *info, + debug_type class_type, const char *fieldname, + const char *tagname, debug_type return_type, + const char *argtypes, bfd_boolean constp, + bfd_boolean volatilep, const char **pphysname) { - boolean is_full_physname_constructor; - boolean is_constructor; - boolean is_destructor; + bfd_boolean is_full_physname_constructor; + bfd_boolean is_constructor; + bfd_boolean is_destructor; + bfd_boolean is_v3; debug_type *args; - boolean varargs; + bfd_boolean varargs; + unsigned int physname_len = 0; /* Constructors are sometimes handled specially. */ is_full_physname_constructor = ((argtypes[0] == '_' @@ -2924,8 +2839,9 @@ parse_stab_argtypes (dhandle, info, class_type, fieldname, tagname, && (argtypes[1] == '$' || argtypes[1] == '.') && argtypes[2] == '_') || strncmp (argtypes, "__dt", 4) == 0); + is_v3 = argtypes[0] == '_' && argtypes[1] == 'Z'; - if (is_destructor || is_full_physname_constructor) + if (is_destructor || is_full_physname_constructor || is_v3) *pphysname = argtypes; else { @@ -2984,6 +2900,7 @@ parse_stab_argtypes (dhandle, info, class_type, fieldname, tagname, strcpy (physname, fieldname); } + physname_len = strlen (physname); strcat (physname, buf); if (tagname != NULL) strcat (physname, tagname); @@ -2997,10 +2914,10 @@ parse_stab_argtypes (dhandle, info, class_type, fieldname, tagname, args = (debug_type *) xmalloc (sizeof *args); *args = NULL; return debug_make_method_type (dhandle, return_type, class_type, args, - false); + FALSE); } - args = stab_demangle_argtypes (dhandle, info, *pphysname, &varargs); + args = stab_demangle_argtypes (dhandle, info, *pphysname, &varargs, physname_len); if (args == NULL) return DEBUG_TYPE_NULL; @@ -3016,21 +2933,17 @@ parse_stab_argtypes (dhandle, info, class_type, fieldname, tagname, This function is called when we have parsed all the method declarations, so we can look for the vptr base class info. */ -static boolean -parse_stab_tilde_field (dhandle, info, pp, typenums, retvptrbase, retownvptr) - PTR dhandle; - struct stab_handle *info; - const char **pp; - const int *typenums; - debug_type *retvptrbase; - boolean *retownvptr; +static bfd_boolean +parse_stab_tilde_field (void *dhandle, struct stab_handle *info, + const char **pp, const int *typenums, + debug_type *retvptrbase, bfd_boolean *retownvptr) { const char *orig; const char *hold; int vtypenums[2]; *retvptrbase = DEBUG_TYPE_NULL; - *retownvptr = false; + *retownvptr = FALSE; orig = *pp; @@ -3039,7 +2952,7 @@ parse_stab_tilde_field (dhandle, info, pp, typenums, retvptrbase, retownvptr) ++*pp; if (**pp != '~') - return true; + return TRUE; ++*pp; @@ -3051,7 +2964,7 @@ parse_stab_tilde_field (dhandle, info, pp, typenums, retvptrbase, retownvptr) } if (**pp != '%') - return true; + return TRUE; ++*pp; @@ -3060,11 +2973,11 @@ parse_stab_tilde_field (dhandle, info, pp, typenums, retvptrbase, retownvptr) /* The next number is the type number of the base class (possibly our own class) which supplies the vtable for this class. */ if (! parse_stab_type_number (pp, vtypenums)) - return false; + return FALSE; if (vtypenums[0] == typenums[0] && vtypenums[1] == typenums[1]) - *retownvptr = true; + *retownvptr = TRUE; else { debug_type vtype; @@ -3079,7 +2992,7 @@ parse_stab_tilde_field (dhandle, info, pp, typenums, retvptrbase, retownvptr) if (*p != ';') { bad_stab (orig); - return false; + return FALSE; } *retvptrbase = vtype; @@ -3087,23 +3000,20 @@ parse_stab_tilde_field (dhandle, info, pp, typenums, retvptrbase, retownvptr) *pp = p + 1; } - return true; + return TRUE; } /* Read a definition of an array type. */ static debug_type -parse_stab_array_type (dhandle, info, pp, stringp) - PTR dhandle; - struct stab_handle *info; - const char **pp; - boolean stringp; +parse_stab_array_type (void *dhandle, struct stab_handle *info, + const char **pp, bfd_boolean stringp) { const char *orig; const char *p; int typenums[2]; debug_type index_type; - boolean adjustable; + bfd_boolean adjustable; bfd_signed_vma lower, upper; debug_type element_type; @@ -3127,7 +3037,7 @@ parse_stab_array_type (dhandle, info, pp, stringp) index_type = debug_find_named_type (dhandle, "int"); if (index_type == DEBUG_TYPE_NULL) { - index_type = debug_make_int_type (dhandle, 4, false); + index_type = debug_make_int_type (dhandle, 4, FALSE); if (index_type == DEBUG_TYPE_NULL) return DEBUG_TYPE_NULL; } @@ -3146,15 +3056,15 @@ parse_stab_array_type (dhandle, info, pp, stringp) } ++*pp; - adjustable = false; + adjustable = FALSE; if (! ISDIGIT (**pp) && **pp != '-') { ++*pp; - adjustable = true; + adjustable = TRUE; } - lower = (bfd_signed_vma) parse_number (pp, (boolean *) NULL); + lower = (bfd_signed_vma) parse_number (pp, (bfd_boolean *) NULL); if (**pp != ';') { bad_stab (orig); @@ -3165,10 +3075,10 @@ parse_stab_array_type (dhandle, info, pp, stringp) if (! ISDIGIT (**pp) && **pp != '-') { ++*pp; - adjustable = true; + adjustable = TRUE; } - upper = (bfd_signed_vma) parse_number (pp, (boolean *) NULL); + upper = (bfd_signed_vma) parse_number (pp, (bfd_boolean *) NULL); if (**pp != ';') { bad_stab (orig); @@ -3213,10 +3123,7 @@ struct bincl_file /* Start a new N_BINCL file, pushing it onto the stack. */ static void -push_bincl (info, name, hash) - struct stab_handle *info; - const char *name; - bfd_vma hash; +push_bincl (struct stab_handle *info, const char *name, bfd_vma hash) { struct bincl_file *n; @@ -3232,7 +3139,7 @@ push_bincl (info, name, hash) ++info->files; info->file_types = ((struct stab_types **) - xrealloc ((PTR) info->file_types, + xrealloc (info->file_types, (info->files * sizeof *info->file_types))); info->file_types[n->file] = NULL; @@ -3242,8 +3149,7 @@ push_bincl (info, name, hash) stack. */ static const char * -pop_bincl (info) - struct stab_handle *info; +pop_bincl (struct stab_handle *info) { struct bincl_file *o; @@ -3261,17 +3167,14 @@ pop_bincl (info) /* Handle an N_EXCL: get the types from the corresponding N_BINCL. */ -static boolean -find_excl (info, name, hash) - struct stab_handle *info; - const char *name; - bfd_vma hash; +static bfd_boolean +find_excl (struct stab_handle *info, const char *name, bfd_vma hash) { struct bincl_file *l; ++info->files; info->file_types = ((struct stab_types **) - xrealloc ((PTR) info->file_types, + xrealloc (info->file_types, (info->files * sizeof *info->file_types))); @@ -3282,12 +3185,12 @@ find_excl (info, name, hash) { warn_stab (name, _("Undefined N_EXCL")); info->file_types[info->files - 1] = NULL; - return true; + return TRUE; } info->file_types[info->files - 1] = l->file_types; - return true; + return TRUE; } /* Handle a variable definition. gcc emits variable definitions for a @@ -3295,14 +3198,10 @@ find_excl (info, name, hash) it. The SunPRO compiler emits variable definitions after the N_LBRAC, so we can call debug_record_variable immediately. */ -static boolean -stab_record_variable (dhandle, info, name, type, kind, val) - PTR dhandle; - struct stab_handle *info; - const char *name; - debug_type type; - enum debug_var_kind kind; - bfd_vma val; +static bfd_boolean +stab_record_variable (void *dhandle, struct stab_handle *info, + const char *name, debug_type type, + enum debug_var_kind kind, bfd_vma val) { struct stab_pending_var *v; @@ -3321,16 +3220,14 @@ stab_record_variable (dhandle, info, name, type, kind, val) v->val = val; info->pending = v; - return true; + return TRUE; } /* Emit pending variable definitions. This is called after we see the N_LBRAC that starts the block. */ -static boolean -stab_emit_pending_vars (dhandle, info) - PTR dhandle; - struct stab_handle *info; +static bfd_boolean +stab_emit_pending_vars (void *dhandle, struct stab_handle *info) { struct stab_pending_var *v; @@ -3340,7 +3237,7 @@ stab_emit_pending_vars (dhandle, info) struct stab_pending_var *next; if (! debug_record_variable (dhandle, v->name, v->type, v->kind, v->val)) - return false; + return FALSE; next = v->next; free (v); @@ -3349,15 +3246,13 @@ stab_emit_pending_vars (dhandle, info) info->pending = NULL; - return true; + return TRUE; } /* Find the slot for a type in the database. */ static debug_type * -stab_find_slot (info, typenums) - struct stab_handle *info; - const int *typenums; +stab_find_slot (struct stab_handle *info, const int *typenums) { int filenum; int index; @@ -3402,10 +3297,7 @@ stab_find_slot (info, typenums) allocated yet, create an indirect type. */ static debug_type -stab_find_type (dhandle, info, typenums) - PTR dhandle; - struct stab_handle *info; - const int *typenums; +stab_find_type (void *dhandle, struct stab_handle *info, const int *typenums) { debug_type *slot; @@ -3427,33 +3319,28 @@ stab_find_type (dhandle, info, typenums) /* Record that a given type number refers to a given type. */ -static boolean -stab_record_type (dhandle, info, typenums, type) - PTR dhandle ATTRIBUTE_UNUSED; - struct stab_handle *info; - const int *typenums; - debug_type type; +static bfd_boolean +stab_record_type (void *dhandle ATTRIBUTE_UNUSED, struct stab_handle *info, + const int *typenums, debug_type type) { debug_type *slot; slot = stab_find_slot (info, typenums); if (slot == NULL) - return false; + return FALSE; /* gdb appears to ignore type redefinitions, so we do as well. */ *slot = type; - return true; + return TRUE; } /* Return an XCOFF builtin type. */ static debug_type -stab_xcoff_builtin_type (dhandle, info, typenum) - PTR dhandle; - struct stab_handle *info; - int typenum; +stab_xcoff_builtin_type (void *dhandle, struct stab_handle *info, + int typenum) { debug_type rettype; const char *name; @@ -3472,42 +3359,42 @@ stab_xcoff_builtin_type (dhandle, info, typenum) /* The size of this and all the other types are fixed, defined by the debugging format. */ name = "int"; - rettype = debug_make_int_type (dhandle, 4, false); + rettype = debug_make_int_type (dhandle, 4, FALSE); break; case 2: name = "char"; - rettype = debug_make_int_type (dhandle, 1, false); + rettype = debug_make_int_type (dhandle, 1, FALSE); break; case 3: name = "short"; - rettype = debug_make_int_type (dhandle, 2, false); + rettype = debug_make_int_type (dhandle, 2, FALSE); break; case 4: name = "long"; - rettype = debug_make_int_type (dhandle, 4, false); + rettype = debug_make_int_type (dhandle, 4, FALSE); break; case 5: name = "unsigned char"; - rettype = debug_make_int_type (dhandle, 1, true); + rettype = debug_make_int_type (dhandle, 1, TRUE); break; case 6: name = "signed char"; - rettype = debug_make_int_type (dhandle, 1, false); + rettype = debug_make_int_type (dhandle, 1, FALSE); break; case 7: name = "unsigned short"; - rettype = debug_make_int_type (dhandle, 2, true); + rettype = debug_make_int_type (dhandle, 2, TRUE); break; case 8: name = "unsigned int"; - rettype = debug_make_int_type (dhandle, 4, true); + rettype = debug_make_int_type (dhandle, 4, TRUE); break; case 9: name = "unsigned"; - rettype = debug_make_int_type (dhandle, 4, true); + rettype = debug_make_int_type (dhandle, 4, TRUE); case 10: name = "unsigned long"; - rettype = debug_make_int_type (dhandle, 4, true); + rettype = debug_make_int_type (dhandle, 4, TRUE); break; case 11: name = "void"; @@ -3532,7 +3419,7 @@ stab_xcoff_builtin_type (dhandle, info, typenum) break; case 15: name = "integer"; - rettype = debug_make_int_type (dhandle, 4, false); + rettype = debug_make_int_type (dhandle, 4, FALSE); break; case 16: name = "boolean"; @@ -3554,7 +3441,7 @@ stab_xcoff_builtin_type (dhandle, info, typenum) case 20: /* FIXME */ name = "character"; - rettype = debug_make_int_type (dhandle, 1, true); + rettype = debug_make_int_type (dhandle, 1, TRUE); break; case 21: name = "logical*1"; @@ -3584,28 +3471,28 @@ stab_xcoff_builtin_type (dhandle, info, typenum) break; case 27: name = "integer*1"; - rettype = debug_make_int_type (dhandle, 1, false); + rettype = debug_make_int_type (dhandle, 1, FALSE); break; case 28: name = "integer*2"; - rettype = debug_make_int_type (dhandle, 2, false); + rettype = debug_make_int_type (dhandle, 2, FALSE); break; case 29: name = "integer*4"; - rettype = debug_make_int_type (dhandle, 4, false); + rettype = debug_make_int_type (dhandle, 4, FALSE); break; case 30: /* FIXME */ name = "wchar"; - rettype = debug_make_int_type (dhandle, 2, false); + rettype = debug_make_int_type (dhandle, 2, FALSE); break; case 31: name = "long long"; - rettype = debug_make_int_type (dhandle, 8, false); + rettype = debug_make_int_type (dhandle, 8, FALSE); break; case 32: name = "unsigned long long"; - rettype = debug_make_int_type (dhandle, 8, true); + rettype = debug_make_int_type (dhandle, 8, TRUE); break; case 33: name = "logical*8"; @@ -3613,7 +3500,7 @@ stab_xcoff_builtin_type (dhandle, info, typenum) break; case 34: name = "integer*8"; - rettype = debug_make_int_type (dhandle, 8, false); + rettype = debug_make_int_type (dhandle, 8, FALSE); break; default: abort (); @@ -3629,12 +3516,8 @@ stab_xcoff_builtin_type (dhandle, info, typenum) /* Find or create a tagged type. */ static debug_type -stab_find_tagged_type (dhandle, info, p, len, kind) - PTR dhandle; - struct stab_handle *info; - const char *p; - int len; - enum debug_type_kind kind; +stab_find_tagged_type (void *dhandle, struct stab_handle *info, + const char *p, int len, enum debug_type_kind kind) { char *name; debug_type dtype; @@ -3709,13 +3592,13 @@ struct stab_demangle_typestring struct stab_demangle_info { /* The debugging information handle. */ - PTR dhandle; + void *dhandle; /* The stab information handle. */ struct stab_handle *info; /* The array of arguments we are building. */ debug_type *args; /* Whether the method takes a variable number of arguments. */ - boolean varargs; + bfd_boolean varargs; /* The array of types we have remembered. */ struct stab_demangle_typestring *typestrings; /* The number of typestrings. */ @@ -3724,40 +3607,37 @@ struct stab_demangle_info unsigned int typestring_alloc; }; -static void stab_bad_demangle PARAMS ((const char *)); -static unsigned int stab_demangle_count PARAMS ((const char **)); -static boolean stab_demangle_get_count - PARAMS ((const char **, unsigned int *)); -static boolean stab_demangle_prefix - PARAMS ((struct stab_demangle_info *, const char **)); -static boolean stab_demangle_function_name - PARAMS ((struct stab_demangle_info *, const char **, const char *)); -static boolean stab_demangle_signature - PARAMS ((struct stab_demangle_info *, const char **)); -static boolean stab_demangle_qualified - PARAMS ((struct stab_demangle_info *, const char **, debug_type *)); -static boolean stab_demangle_template - PARAMS ((struct stab_demangle_info *, const char **, char **)); -static boolean stab_demangle_class - PARAMS ((struct stab_demangle_info *, const char **, const char **)); -static boolean stab_demangle_args - PARAMS ((struct stab_demangle_info *, const char **, debug_type **, - boolean *)); -static boolean stab_demangle_arg - PARAMS ((struct stab_demangle_info *, const char **, debug_type **, - unsigned int *, unsigned int *)); -static boolean stab_demangle_type - PARAMS ((struct stab_demangle_info *, const char **, debug_type *)); -static boolean stab_demangle_fund_type - PARAMS ((struct stab_demangle_info *, const char **, debug_type *)); -static boolean stab_demangle_remember_type - PARAMS ((struct stab_demangle_info *, const char *, int)); +static void stab_bad_demangle (const char *); +static unsigned int stab_demangle_count (const char **); +static bfd_boolean stab_demangle_get_count (const char **, unsigned int *); +static bfd_boolean stab_demangle_prefix + (struct stab_demangle_info *, const char **, unsigned int); +static bfd_boolean stab_demangle_function_name + (struct stab_demangle_info *, const char **, const char *); +static bfd_boolean stab_demangle_signature + (struct stab_demangle_info *, const char **); +static bfd_boolean stab_demangle_qualified + (struct stab_demangle_info *, const char **, debug_type *); +static bfd_boolean stab_demangle_template + (struct stab_demangle_info *, const char **, char **); +static bfd_boolean stab_demangle_class + (struct stab_demangle_info *, const char **, const char **); +static bfd_boolean stab_demangle_args + (struct stab_demangle_info *, const char **, debug_type **, bfd_boolean *); +static bfd_boolean stab_demangle_arg + (struct stab_demangle_info *, const char **, debug_type **, + unsigned int *, unsigned int *); +static bfd_boolean stab_demangle_type + (struct stab_demangle_info *, const char **, debug_type *); +static bfd_boolean stab_demangle_fund_type + (struct stab_demangle_info *, const char **, debug_type *); +static bfd_boolean stab_demangle_remember_type + (struct stab_demangle_info *, const char *, int); /* Warn about a bad demangling. */ static void -stab_bad_demangle (s) - const char *s; +stab_bad_demangle (const char *s) { fprintf (stderr, _("bad mangled name `%s'\n"), s); } @@ -3765,8 +3645,7 @@ stab_bad_demangle (s) /* Get a count from a stab string. */ static unsigned int -stab_demangle_count (pp) - const char **pp; +stab_demangle_count (const char **pp) { unsigned int count; @@ -3783,13 +3662,11 @@ stab_demangle_count (pp) /* Require a count in a string. The count may be multiple digits, in which case it must end in an underscore. */ -static boolean -stab_demangle_get_count (pp, pi) - const char **pp; - unsigned int *pi; +static bfd_boolean +stab_demangle_get_count (const char **pp, unsigned int *pi) { if (! ISDIGIT (**pp)) - return false; + return FALSE; *pi = **pp - '0'; ++*pp; @@ -3814,25 +3691,27 @@ stab_demangle_get_count (pp, pi) } } - return true; + return TRUE; } /* This function demangles a physical name, returning a NULL terminated array of argument types. */ static debug_type * -stab_demangle_argtypes (dhandle, info, physname, pvarargs) - PTR dhandle; - struct stab_handle *info; - const char *physname; - boolean *pvarargs; +stab_demangle_argtypes (void *dhandle, struct stab_handle *info, + const char *physname, bfd_boolean *pvarargs, + unsigned int physname_len) { struct stab_demangle_info minfo; + /* Check for the g++ V3 ABI. */ + if (physname[0] == '_' && physname[1] == 'Z') + return stab_demangle_v3_argtypes (dhandle, info, physname, pvarargs); + minfo.dhandle = dhandle; minfo.info = info; minfo.args = NULL; - minfo.varargs = false; + minfo.varargs = FALSE; minfo.typestring_alloc = 10; minfo.typestrings = ((struct stab_demangle_typestring *) xmalloc (minfo.typestring_alloc @@ -3842,7 +3721,7 @@ stab_demangle_argtypes (dhandle, info, physname, pvarargs) /* cplus_demangle checks for special GNU mangled forms, but we can't see any of them in mangled method argument types. */ - if (! stab_demangle_prefix (&minfo, &physname)) + if (! stab_demangle_prefix (&minfo, &physname, physname_len)) goto error_return; if (*physname != '\0') @@ -3868,10 +3747,9 @@ stab_demangle_argtypes (dhandle, info, physname, pvarargs) /* Demangle the prefix of the mangled name. */ -static boolean -stab_demangle_prefix (minfo, pp) - struct stab_demangle_info *minfo; - const char **pp; +static bfd_boolean +stab_demangle_prefix (struct stab_demangle_info *minfo, const char **pp, + unsigned int physname_len) { const char *scan; unsigned int i; @@ -3879,26 +3757,29 @@ stab_demangle_prefix (minfo, pp) /* cplus_demangle checks for global constructors and destructors, but we can't see them in mangled argument types. */ - /* Look for `__'. */ - scan = *pp; - do + if (physname_len) + scan = *pp + physname_len; + else { - scan = strchr (scan, '_'); - } - while (scan != NULL && *++scan != '_'); + /* Look for `__'. */ + scan = *pp; + do + scan = strchr (scan, '_'); + while (scan != NULL && *++scan != '_'); - if (scan == NULL) - { - stab_bad_demangle (*pp); - return false; - } + if (scan == NULL) + { + stab_bad_demangle (*pp); + return FALSE; + } - --scan; + --scan; - /* We found `__'; move ahead to the last contiguous `__' pair. */ - i = strspn (scan, "_"); - if (i > 2) - scan += i - 2; + /* We found `__'; move ahead to the last contiguous `__' pair. */ + i = strspn (scan, "_"); + if (i > 2) + scan += i - 2; + } if (scan == *pp && (ISDIGIT (scan[2]) @@ -3907,7 +3788,7 @@ stab_demangle_prefix (minfo, pp) { /* This is a GNU style constructor name. */ *pp = scan + 2; - return true; + return TRUE; } else if (scan == *pp && ! ISDIGIT (scan[2]) @@ -3921,7 +3802,7 @@ stab_demangle_prefix (minfo, pp) if (scan == NULL || scan[2] == '\0') { stab_bad_demangle (*pp); - return false; + return FALSE; } return stab_demangle_function_name (minfo, pp, scan); @@ -3934,7 +3815,7 @@ stab_demangle_prefix (minfo, pp) else { stab_bad_demangle (*pp); - return false; + return FALSE; } /*NOTREACHED*/ } @@ -3943,11 +3824,9 @@ stab_demangle_prefix (minfo, pp) double underscore which separates the function name from the signature. */ -static boolean -stab_demangle_function_name (minfo, pp, scan) - struct stab_demangle_info *minfo; - const char **pp; - const char *scan; +static bfd_boolean +stab_demangle_function_name (struct stab_demangle_info *minfo, + const char **pp, const char *scan) { const char *name; @@ -3968,7 +3847,7 @@ stab_demangle_function_name (minfo, pp, scan) /* This is a type conversion operator. */ tem = name + 5; if (! stab_demangle_type (minfo, &tem, (debug_type *) NULL)) - return false; + return FALSE; } else if (name[0] == '_' && name[1] == '_' @@ -3980,28 +3859,26 @@ stab_demangle_function_name (minfo, pp, scan) /* This is a type conversion operator. */ tem = name + 4; if (! stab_demangle_type (minfo, &tem, (debug_type *) NULL)) - return false; + return FALSE; } - return true; + return TRUE; } /* Demangle the signature. This is where the argument types are found. */ -static boolean -stab_demangle_signature (minfo, pp) - struct stab_demangle_info *minfo; - const char **pp; +static bfd_boolean +stab_demangle_signature (struct stab_demangle_info *minfo, const char **pp) { const char *orig; - boolean expect_func, func_done; + bfd_boolean expect_func, func_done; const char *hold; orig = *pp; - expect_func = false; - func_done = false; + expect_func = FALSE; + func_done = FALSE; hold = NULL; while (**pp != '\0') @@ -4012,8 +3889,8 @@ stab_demangle_signature (minfo, pp) hold = *pp; if (! stab_demangle_qualified (minfo, pp, (debug_type *) NULL) || ! stab_demangle_remember_type (minfo, hold, *pp - hold)) - return false; - expect_func = true; + return FALSE; + expect_func = TRUE; hold = NULL; break; @@ -4037,8 +3914,8 @@ stab_demangle_signature (minfo, pp) hold = *pp; if (! stab_demangle_class (minfo, pp, (const char **) NULL) || ! stab_demangle_remember_type (minfo, hold, *pp - hold)) - return false; - expect_func = true; + return FALSE; + expect_func = TRUE; hold = NULL; break; @@ -4046,10 +3923,10 @@ stab_demangle_signature (minfo, pp) /* Function. I don't know if this actually happens with g++ output. */ hold = NULL; - func_done = true; + func_done = TRUE; ++*pp; if (! stab_demangle_args (minfo, pp, &minfo->args, &minfo->varargs)) - return false; + return FALSE; break; case 't': @@ -4058,9 +3935,9 @@ stab_demangle_signature (minfo, pp) hold = *pp; if (! stab_demangle_template (minfo, pp, (char **) NULL) || ! stab_demangle_remember_type (minfo, hold, *pp - hold)) - return false; + return FALSE; hold = NULL; - expect_func = true; + expect_func = TRUE; break; case '_': @@ -4070,22 +3947,22 @@ stab_demangle_signature (minfo, pp) has been mangled by some algorithm we don't know how to deal with. So just reject the entire demangling. */ stab_bad_demangle (orig); - return false; + return FALSE; default: /* Assume we have stumbled onto the first outermost function argument token, and start processing args. */ - func_done = true; + func_done = TRUE; if (! stab_demangle_args (minfo, pp, &minfo->args, &minfo->varargs)) - return false; + return FALSE; break; } if (expect_func) { - func_done = true; + func_done = TRUE; if (! stab_demangle_args (minfo, pp, &minfo->args, &minfo->varargs)) - return false; + return FALSE; } } @@ -4096,20 +3973,18 @@ stab_demangle_signature (minfo, pp) first case, and need to ensure that the '(void)' gets added to the current declp. */ if (! stab_demangle_args (minfo, pp, &minfo->args, &minfo->varargs)) - return false; + return FALSE; } - return true; + return TRUE; } /* Demangle a qualified name, such as "Q25Outer5Inner" which is the mangled form of "Outer::Inner". */ -static boolean -stab_demangle_qualified (minfo, pp, ptype) - struct stab_demangle_info *minfo; - const char **pp; - debug_type *ptype; +static bfd_boolean +stab_demangle_qualified (struct stab_demangle_info *minfo, const char **pp, + debug_type *ptype) { const char *orig; const char *p; @@ -4128,7 +4003,7 @@ stab_demangle_qualified (minfo, pp, ptype) if (! ISDIGIT (*p) || *p == '0') { stab_bad_demangle (orig); - return false; + return FALSE; } qualifiers = atoi (p); while (ISDIGIT (*p)) @@ -4136,7 +4011,7 @@ stab_demangle_qualified (minfo, pp, ptype) if (*p != '_') { stab_bad_demangle (orig); - return false; + return FALSE; } *pp = p + 1; break; @@ -4153,7 +4028,7 @@ stab_demangle_qualified (minfo, pp, ptype) case '0': default: stab_bad_demangle (orig); - return false; + return FALSE; } context = DEBUG_TYPE_NULL; @@ -4169,7 +4044,7 @@ stab_demangle_qualified (minfo, pp, ptype) if (! stab_demangle_template (minfo, pp, ptype != NULL ? &name : NULL)) - return false; + return FALSE; if (ptype != NULL) { @@ -4178,7 +4053,7 @@ stab_demangle_qualified (minfo, pp, ptype) DEBUG_KIND_CLASS); free (name); if (context == DEBUG_TYPE_NULL) - return false; + return FALSE; } } else @@ -4189,7 +4064,7 @@ stab_demangle_qualified (minfo, pp, ptype) if (strlen (*pp) < len) { stab_bad_demangle (orig); - return false; + return FALSE; } if (ptype != NULL) @@ -4223,7 +4098,7 @@ stab_demangle_qualified (minfo, pp, ptype) ft = debug_get_field_type (minfo->dhandle, *fields); if (ft == NULL) - return false; + return FALSE; dn = debug_get_type_name (minfo->dhandle, ft); if (dn != NULL && strcmp (dn, name) == 0) { @@ -4260,7 +4135,7 @@ stab_demangle_qualified (minfo, pp, ptype) ? DEBUG_KIND_ILLEGAL : DEBUG_KIND_CLASS)); if (context == DEBUG_TYPE_NULL) - return false; + return FALSE; } } } @@ -4272,17 +4147,15 @@ stab_demangle_qualified (minfo, pp, ptype) if (ptype != NULL) *ptype = context; - return true; + return TRUE; } /* Demangle a template. If PNAME is not NULL, this sets *PNAME to a string representation of the template. */ -static boolean -stab_demangle_template (minfo, pp, pname) - struct stab_demangle_info *minfo; - const char **pp; - char **pname; +static bfd_boolean +stab_demangle_template (struct stab_demangle_info *minfo, const char **pp, + char **pname) { const char *orig; unsigned int r, i; @@ -4296,7 +4169,7 @@ stab_demangle_template (minfo, pp, pname) if (r == 0 || strlen (*pp) < r) { stab_bad_demangle (orig); - return false; + return FALSE; } *pp += r; @@ -4304,7 +4177,7 @@ stab_demangle_template (minfo, pp, pname) if (stab_demangle_get_count (pp, &r) == 0) { stab_bad_demangle (orig); - return false; + return FALSE; } for (i = 0; i < r; i++) @@ -4314,26 +4187,26 @@ stab_demangle_template (minfo, pp, pname) /* This is a type parameter. */ ++*pp; if (! stab_demangle_type (minfo, pp, (debug_type *) NULL)) - return false; + return FALSE; } else { const char *old_p; - boolean pointerp, realp, integralp, charp, boolp; - boolean done; + bfd_boolean pointerp, realp, integralp, charp, boolp; + bfd_boolean done; old_p = *pp; - pointerp = false; - realp = false; - integralp = false; - charp = false; - boolp = false; - done = false; + pointerp = FALSE; + realp = FALSE; + integralp = FALSE; + charp = FALSE; + boolp = FALSE; + done = FALSE; /* This is a value parameter. */ if (! stab_demangle_type (minfo, pp, (debug_type *) NULL)) - return false; + return FALSE; while (*old_p != '\0' && ! done) { @@ -4342,8 +4215,8 @@ stab_demangle_template (minfo, pp, pname) case 'P': case 'p': case 'R': - pointerp = true; - done = true; + pointerp = TRUE; + done = TRUE; break; case 'C': /* Const. */ case 'S': /* Signed. */ @@ -4355,8 +4228,8 @@ stab_demangle_template (minfo, pp, pname) ++old_p; break; case 'Q': /* Qualified name. */ - integralp = true; - done = true; + integralp = TRUE; + done = TRUE; break; case 'T': /* Remembered type. */ abort (); @@ -4367,27 +4240,27 @@ stab_demangle_template (minfo, pp, pname) case 'i': /* Int. */ case 's': /* Short. */ case 'w': /* Wchar_t. */ - integralp = true; - done = true; + integralp = TRUE; + done = TRUE; break; case 'b': /* Bool. */ - boolp = true; - done = true; + boolp = TRUE; + done = TRUE; break; case 'c': /* Char. */ - charp = true; - done = true; + charp = TRUE; + done = TRUE; break; case 'r': /* Long double. */ case 'd': /* Double. */ case 'f': /* Float. */ - realp = true; - done = true; + realp = TRUE; + done = TRUE; break; default: /* Assume it's a user defined integral type. */ - integralp = true; - done = true; + integralp = TRUE; + done = TRUE; break; } } @@ -4409,7 +4282,7 @@ stab_demangle_template (minfo, pp, pname) if (val == 0) { stab_bad_demangle (orig); - return false; + return FALSE; } } else if (boolp) @@ -4420,7 +4293,7 @@ stab_demangle_template (minfo, pp, pname) if (val != 0 && val != 1) { stab_bad_demangle (orig); - return false; + return FALSE; } } else if (realp) @@ -4449,7 +4322,7 @@ stab_demangle_template (minfo, pp, pname) if (! stab_demangle_get_count (pp, &len)) { stab_bad_demangle (orig); - return false; + return FALSE; } *pp += len; } @@ -4480,7 +4353,7 @@ stab_demangle_template (minfo, pp, pname) stab_bad_demangle (orig); if (s3 != NULL) free (s3); - return false; + return FALSE; } /* Eliminating all spaces, except those between > characters, @@ -4496,16 +4369,14 @@ stab_demangle_template (minfo, pp, pname) free (s3); } - return true; + return TRUE; } /* Demangle a class name. */ -static boolean -stab_demangle_class (minfo, pp, pstart) - struct stab_demangle_info *minfo ATTRIBUTE_UNUSED; - const char **pp; - const char **pstart; +static bfd_boolean +stab_demangle_class (struct stab_demangle_info *minfo ATTRIBUTE_UNUSED, + const char **pp, const char **pstart) { const char *orig; unsigned int n; @@ -4516,7 +4387,7 @@ stab_demangle_class (minfo, pp, pstart) if (strlen (*pp) < n) { stab_bad_demangle (orig); - return false; + return FALSE; } if (pstart != NULL) @@ -4524,18 +4395,15 @@ stab_demangle_class (minfo, pp, pstart) *pp += n; - return true; + return TRUE; } /* Demangle function arguments. If the pargs argument is not NULL, it is set to a NULL terminated array holding the arguments. */ -static boolean -stab_demangle_args (minfo, pp, pargs, pvarargs) - struct stab_demangle_info *minfo; - const char **pp; - debug_type **pargs; - boolean *pvarargs; +static bfd_boolean +stab_demangle_args (struct stab_demangle_info *minfo, const char **pp, + debug_type **pargs, bfd_boolean *pvarargs) { const char *orig; unsigned int alloc, count; @@ -4546,7 +4414,7 @@ stab_demangle_args (minfo, pp, pargs, pvarargs) if (pargs != NULL) { *pargs = (debug_type *) xmalloc (alloc * sizeof **pargs); - *pvarargs = false; + *pvarargs = FALSE; } count = 0; @@ -4567,20 +4435,20 @@ stab_demangle_args (minfo, pp, pargs, pvarargs) if (! stab_demangle_get_count (pp, &r)) { stab_bad_demangle (orig); - return false; + return FALSE; } } if (! stab_demangle_get_count (pp, &t)) { stab_bad_demangle (orig); - return false; + return FALSE; } if (t >= minfo->typestring_count) { stab_bad_demangle (orig); - return false; + return FALSE; } while (r-- > 0) { @@ -4588,13 +4456,13 @@ stab_demangle_args (minfo, pp, pargs, pvarargs) tem = minfo->typestrings[t].typestring; if (! stab_demangle_arg (minfo, &tem, pargs, &count, &alloc)) - return false; + return FALSE; } } else { if (! stab_demangle_arg (minfo, pp, pargs, &count, &alloc)) - return false; + return FALSE; } } @@ -4604,22 +4472,19 @@ stab_demangle_args (minfo, pp, pargs, pvarargs) if (**pp == 'e') { if (pargs != NULL) - *pvarargs = true; + *pvarargs = TRUE; ++*pp; } - return true; + return TRUE; } /* Demangle a single argument. */ -static boolean -stab_demangle_arg (minfo, pp, pargs, pcount, palloc) - struct stab_demangle_info *minfo; - const char **pp; - debug_type **pargs; - unsigned int *pcount; - unsigned int *palloc; +static bfd_boolean +stab_demangle_arg (struct stab_demangle_info *minfo, const char **pp, + debug_type **pargs, unsigned int *pcount, + unsigned int *palloc) { const char *start; debug_type type; @@ -4628,12 +4493,12 @@ stab_demangle_arg (minfo, pp, pargs, pcount, palloc) if (! stab_demangle_type (minfo, pp, pargs == NULL ? (debug_type *) NULL : &type) || ! stab_demangle_remember_type (minfo, start, *pp - start)) - return false; + return FALSE; if (pargs != NULL) { if (type == DEBUG_TYPE_NULL) - return false; + return FALSE; if (*pcount + 1 >= *palloc) { @@ -4645,17 +4510,15 @@ stab_demangle_arg (minfo, pp, pargs, pcount, palloc) ++*pcount; } - return true; + return TRUE; } /* Demangle a type. If the ptype argument is not NULL, *ptype is set to the newly allocated type. */ -static boolean -stab_demangle_type (minfo, pp, ptype) - struct stab_demangle_info *minfo; - const char **pp; - debug_type *ptype; +static bfd_boolean +stab_demangle_type (struct stab_demangle_info *minfo, const char **pp, + debug_type *ptype) { const char *orig; @@ -4668,7 +4531,7 @@ stab_demangle_type (minfo, pp, ptype) /* A pointer type. */ ++*pp; if (! stab_demangle_type (minfo, pp, ptype)) - return false; + return FALSE; if (ptype != NULL) *ptype = debug_make_pointer_type (minfo->dhandle, *ptype); break; @@ -4677,7 +4540,7 @@ stab_demangle_type (minfo, pp, ptype) /* A reference type. */ ++*pp; if (! stab_demangle_type (minfo, pp, ptype)) - return false; + return FALSE; if (ptype != NULL) *ptype = debug_make_reference_type (minfo->dhandle, *ptype); break; @@ -4694,7 +4557,7 @@ stab_demangle_type (minfo, pp, ptype) if (! ISDIGIT (**pp)) { stab_bad_demangle (orig); - return false; + return FALSE; } high *= 10; high += **pp - '0'; @@ -4703,21 +4566,21 @@ stab_demangle_type (minfo, pp, ptype) if (**pp != '_') { stab_bad_demangle (orig); - return false; + return FALSE; } ++*pp; if (! stab_demangle_type (minfo, pp, ptype)) - return false; + return FALSE; if (ptype != NULL) { debug_type int_type; int_type = debug_find_named_type (minfo->dhandle, "int"); if (int_type == NULL) - int_type = debug_make_int_type (minfo->dhandle, 4, false); + int_type = debug_make_int_type (minfo->dhandle, 4, FALSE); *ptype = debug_make_array_type (minfo->dhandle, *ptype, int_type, - 0, high, false); + 0, high, FALSE); } } break; @@ -4732,16 +4595,16 @@ stab_demangle_type (minfo, pp, ptype) if (! stab_demangle_get_count (pp, &i)) { stab_bad_demangle (orig); - return false; + return FALSE; } if (i >= minfo->typestring_count) { stab_bad_demangle (orig); - return false; + return FALSE; } p = minfo->typestrings[i].typestring; if (! stab_demangle_type (minfo, &p, ptype)) - return false; + return FALSE; } break; @@ -4749,7 +4612,7 @@ stab_demangle_type (minfo, pp, ptype) /* A function. */ { debug_type *args; - boolean varargs; + bfd_boolean varargs; ++*pp; if (! stab_demangle_args (minfo, pp, @@ -4757,20 +4620,20 @@ stab_demangle_type (minfo, pp, ptype) ? (debug_type **) NULL : &args), (ptype == NULL - ? (boolean *) NULL + ? (bfd_boolean *) NULL : &varargs))) - return false; + return FALSE; if (**pp != '_') { /* cplus_demangle will accept a function without a return type, but I don't know when that will happen, or what to do if it does. */ stab_bad_demangle (orig); - return false; + return FALSE; } ++*pp; if (! stab_demangle_type (minfo, pp, ptype)) - return false; + return FALSE; if (ptype != NULL) *ptype = debug_make_function_type (minfo->dhandle, *ptype, args, varargs); @@ -4781,18 +4644,18 @@ stab_demangle_type (minfo, pp, ptype) case 'M': case 'O': { - boolean memberp, constp, volatilep; + bfd_boolean memberp, constp, volatilep; debug_type class_type = DEBUG_TYPE_NULL; debug_type *args; - boolean varargs; + bfd_boolean varargs; unsigned int n; const char *name; memberp = **pp == 'M'; - constp = false; - volatilep = false; + constp = FALSE; + volatilep = FALSE; args = NULL; - varargs = false; + varargs = FALSE; ++*pp; if (ISDIGIT (**pp)) @@ -4801,7 +4664,7 @@ stab_demangle_type (minfo, pp, ptype) if (strlen (*pp) < n) { stab_bad_demangle (orig); - return false; + return FALSE; } name = *pp; *pp += n; @@ -4813,7 +4676,7 @@ stab_demangle_type (minfo, pp, ptype) name, (int) n, DEBUG_KIND_CLASS); if (class_type == DEBUG_TYPE_NULL) - return false; + return FALSE; } } else if (**pp == 'Q') @@ -4822,30 +4685,30 @@ stab_demangle_type (minfo, pp, ptype) (ptype == NULL ? (debug_type *) NULL : &class_type))) - return false; + return FALSE; } else { stab_bad_demangle (orig); - return false; + return FALSE; } if (memberp) { if (**pp == 'C') { - constp = true; + constp = TRUE; ++*pp; } else if (**pp == 'V') { - volatilep = true; + volatilep = TRUE; ++*pp; } if (**pp != 'F') { stab_bad_demangle (orig); - return false; + return FALSE; } ++*pp; if (! stab_demangle_args (minfo, pp, @@ -4853,20 +4716,20 @@ stab_demangle_type (minfo, pp, ptype) ? (debug_type **) NULL : &args), (ptype == NULL - ? (boolean *) NULL + ? (bfd_boolean *) NULL : &varargs))) - return false; + return FALSE; } if (**pp != '_') { stab_bad_demangle (orig); - return false; + return FALSE; } ++*pp; if (! stab_demangle_type (minfo, pp, ptype)) - return false; + return FALSE; if (ptype != NULL) { @@ -4887,13 +4750,13 @@ stab_demangle_type (minfo, pp, ptype) case 'G': ++*pp; if (! stab_demangle_type (minfo, pp, ptype)) - return false; + return FALSE; break; case 'C': ++*pp; if (! stab_demangle_type (minfo, pp, ptype)) - return false; + return FALSE; if (ptype != NULL) *ptype = debug_make_const_type (minfo->dhandle, *ptype); break; @@ -4904,66 +4767,64 @@ stab_demangle_type (minfo, pp, ptype) hold = *pp; if (! stab_demangle_qualified (minfo, pp, ptype)) - return false; + return FALSE; } break; default: if (! stab_demangle_fund_type (minfo, pp, ptype)) - return false; + return FALSE; break; } - return true; + return TRUE; } /* Demangle a fundamental type. If the ptype argument is not NULL, *ptype is set to the newly allocated type. */ -static boolean -stab_demangle_fund_type (minfo, pp, ptype) - struct stab_demangle_info *minfo; - const char **pp; - debug_type *ptype; +static bfd_boolean +stab_demangle_fund_type (struct stab_demangle_info *minfo, const char **pp, + debug_type *ptype) { const char *orig; - boolean constp, volatilep, unsignedp, signedp; - boolean done; + bfd_boolean constp, volatilep, unsignedp, signedp; + bfd_boolean done; orig = *pp; - constp = false; - volatilep = false; - unsignedp = false; - signedp = false; + constp = FALSE; + volatilep = FALSE; + unsignedp = FALSE; + signedp = FALSE; - done = false; + done = FALSE; while (! done) { switch (**pp) { case 'C': - constp = true; + constp = TRUE; ++*pp; break; case 'U': - unsignedp = true; + unsignedp = TRUE; ++*pp; break; case 'S': - signedp = true; + signedp = TRUE; ++*pp; break; case 'V': - volatilep = true; + volatilep = TRUE; ++*pp; break; default: - done = true; + done = TRUE; break; } } @@ -5068,7 +4929,7 @@ stab_demangle_fund_type (minfo, pp, ptype) { *ptype = debug_find_named_type (minfo->dhandle, "__wchar_t"); if (*ptype == DEBUG_TYPE_NULL) - *ptype = debug_make_int_type (minfo->dhandle, 2, true); + *ptype = debug_make_int_type (minfo->dhandle, 2, TRUE); } ++*pp; break; @@ -5108,7 +4969,7 @@ stab_demangle_fund_type (minfo, pp, ptype) if (! ISDIGIT (**pp)) { stab_bad_demangle (orig); - return false; + return FALSE; } /* Fall through. */ case '0': case '1': case '2': case '3': case '4': @@ -5117,7 +4978,7 @@ stab_demangle_fund_type (minfo, pp, ptype) const char *hold; if (! stab_demangle_class (minfo, pp, &hold)) - return false; + return FALSE; if (ptype != NULL) { char *name; @@ -5133,7 +4994,7 @@ stab_demangle_fund_type (minfo, pp, ptype) hold, *pp - hold, DEBUG_KIND_ILLEGAL); if (*ptype == DEBUG_TYPE_NULL) - return false; + return FALSE; } } } @@ -5145,7 +5006,7 @@ stab_demangle_fund_type (minfo, pp, ptype) if (! stab_demangle_template (minfo, pp, ptype != NULL ? &name : NULL)) - return false; + return FALSE; if (ptype != NULL) { *ptype = stab_find_tagged_type (minfo->dhandle, minfo->info, @@ -5153,14 +5014,14 @@ stab_demangle_fund_type (minfo, pp, ptype) DEBUG_KIND_CLASS); free (name); if (*ptype == DEBUG_TYPE_NULL) - return false; + return FALSE; } } break; default: stab_bad_demangle (orig); - return false; + return FALSE; } if (ptype != NULL) @@ -5171,16 +5032,14 @@ stab_demangle_fund_type (minfo, pp, ptype) *ptype = debug_make_volatile_type (minfo->dhandle, *ptype); } - return true; + return TRUE; } /* Remember a type string in a demangled string. */ -static boolean -stab_demangle_remember_type (minfo, p, len) - struct stab_demangle_info *minfo; - const char *p; - int len; +static bfd_boolean +stab_demangle_remember_type (struct stab_demangle_info *minfo, + const char *p, int len) { if (minfo->typestring_count >= minfo->typestring_alloc) { @@ -5195,5 +5054,296 @@ stab_demangle_remember_type (minfo, p, len) minfo->typestrings[minfo->typestring_count].len = (unsigned int) len; ++minfo->typestring_count; - return true; + return TRUE; +} + +/* Demangle names encoded using the g++ V3 ABI. The newer versions of + g++ which use this ABI do not encode ordinary method argument types + in a mangled name; they simply output the argument types. However, + for a static method, g++ simply outputs the return type and the + physical name. So in that case we need to demangle the name here. + Here PHYSNAME is the physical name of the function, and we set the + variable pointed at by PVARARGS to indicate whether this function + is varargs. This returns NULL, or a NULL terminated array of + argument types. */ + +static debug_type * +stab_demangle_v3_argtypes (void *dhandle, struct stab_handle *info, + const char *physname, bfd_boolean *pvarargs) +{ + struct demangle_component *dc; + void *mem; + unsigned int alloc, count; + debug_type *pargs; + + dc = cplus_demangle_v3_components (physname, DMGL_PARAMS | DMGL_ANSI, &mem); + if (dc == NULL) + { + stab_bad_demangle (physname); + return NULL; + } + + /* We expect to see TYPED_NAME, and the right subtree describes the + function type. */ + if (dc->type != DEMANGLE_COMPONENT_TYPED_NAME + || dc->u.s_binary.right->type != DEMANGLE_COMPONENT_FUNCTION_TYPE) + { + fprintf (stderr, _("Demangled name is not a function\n")); + free (mem); + return NULL; + } + + alloc = 10; + pargs = (debug_type *) xmalloc (alloc * sizeof *pargs); + *pvarargs = FALSE; + + count = 0; + + for (dc = dc->u.s_binary.right->u.s_binary.right; + dc != NULL; + dc = dc->u.s_binary.right) + { + debug_type arg; + bfd_boolean varargs; + + if (dc->type != DEMANGLE_COMPONENT_ARGLIST) + { + fprintf (stderr, _("Unexpected type in demangle tree\n")); + free (mem); + return NULL; + } + + arg = stab_demangle_v3_arg (dhandle, info, dc->u.s_binary.left, + NULL, &varargs); + if (arg == NULL) + { + if (varargs) + { + *pvarargs = TRUE; + continue; + } + free (mem); + return NULL; + } + + if (count + 1 >= alloc) + { + alloc += 10; + pargs = (debug_type *) xrealloc (pargs, alloc * sizeof *pargs); + } + + pargs[count] = arg; + ++count; + } + + pargs[count] = DEBUG_TYPE_NULL; + + free (mem); + + return pargs; +} + +/* Convert a struct demangle_component tree describing an argument + type into a debug_type. */ + +static debug_type +stab_demangle_v3_arg (void *dhandle, struct stab_handle *info, + struct demangle_component *dc, debug_type context, + bfd_boolean *pvarargs) +{ + debug_type dt; + + if (pvarargs != NULL) + *pvarargs = FALSE; + + switch (dc->type) + { + /* FIXME: These are demangle component types which we probably + need to handle one way or another. */ + case DEMANGLE_COMPONENT_LOCAL_NAME: + case DEMANGLE_COMPONENT_TYPED_NAME: + case DEMANGLE_COMPONENT_TEMPLATE_PARAM: + case DEMANGLE_COMPONENT_CTOR: + case DEMANGLE_COMPONENT_DTOR: + case DEMANGLE_COMPONENT_JAVA_CLASS: + case DEMANGLE_COMPONENT_RESTRICT_THIS: + case DEMANGLE_COMPONENT_VOLATILE_THIS: + case DEMANGLE_COMPONENT_CONST_THIS: + case DEMANGLE_COMPONENT_VENDOR_TYPE_QUAL: + case DEMANGLE_COMPONENT_COMPLEX: + case DEMANGLE_COMPONENT_IMAGINARY: + case DEMANGLE_COMPONENT_VENDOR_TYPE: + case DEMANGLE_COMPONENT_FUNCTION_TYPE: + case DEMANGLE_COMPONENT_ARRAY_TYPE: + case DEMANGLE_COMPONENT_PTRMEM_TYPE: + case DEMANGLE_COMPONENT_ARGLIST: + default: + fprintf (stderr, _("Unrecognized demangle component\n")); + return NULL; + + case DEMANGLE_COMPONENT_NAME: + if (context != NULL) + { + const debug_field *fields; + + fields = debug_get_fields (dhandle, context); + if (fields != NULL) + { + /* Try to find this type by looking through the context + class. */ + for (; *fields != DEBUG_FIELD_NULL; fields++) + { + debug_type ft; + const char *dn; + + ft = debug_get_field_type (dhandle, *fields); + if (ft == NULL) + return NULL; + dn = debug_get_type_name (dhandle, ft); + if (dn != NULL + && (int) strlen (dn) == dc->u.s_name.len + && strncmp (dn, dc->u.s_name.s, dc->u.s_name.len) == 0) + return ft; + } + } + } + return stab_find_tagged_type (dhandle, info, dc->u.s_name.s, + dc->u.s_name.len, DEBUG_KIND_ILLEGAL); + + case DEMANGLE_COMPONENT_QUAL_NAME: + context = stab_demangle_v3_arg (dhandle, info, dc->u.s_binary.left, + context, NULL); + if (context == NULL) + return NULL; + return stab_demangle_v3_arg (dhandle, info, dc->u.s_binary.right, + context, NULL); + + case DEMANGLE_COMPONENT_TEMPLATE: + { + char *p; + size_t alc; + + /* We print this component to get a class name which we can + use. FIXME: This probably won't work if the template uses + template parameters which refer to an outer template. */ + p = cplus_demangle_print (DMGL_PARAMS | DMGL_ANSI, dc, 20, &alc); + if (p == NULL) + { + fprintf (stderr, _("Failed to print demangled template\n")); + return NULL; + } + dt = stab_find_tagged_type (dhandle, info, p, strlen (p), + DEBUG_KIND_CLASS); + free (p); + return dt; + } + + case DEMANGLE_COMPONENT_SUB_STD: + return stab_find_tagged_type (dhandle, info, dc->u.s_string.string, + dc->u.s_string.len, DEBUG_KIND_ILLEGAL); + + case DEMANGLE_COMPONENT_RESTRICT: + case DEMANGLE_COMPONENT_VOLATILE: + case DEMANGLE_COMPONENT_CONST: + case DEMANGLE_COMPONENT_POINTER: + case DEMANGLE_COMPONENT_REFERENCE: + dt = stab_demangle_v3_arg (dhandle, info, dc->u.s_binary.left, NULL, + NULL); + if (dt == NULL) + return NULL; + + switch (dc->type) + { + default: + abort (); + case DEMANGLE_COMPONENT_RESTRICT: + /* FIXME: We have no way to represent restrict. */ + return dt; + case DEMANGLE_COMPONENT_VOLATILE: + return debug_make_volatile_type (dhandle, dt); + case DEMANGLE_COMPONENT_CONST: + return debug_make_const_type (dhandle, dt); + case DEMANGLE_COMPONENT_POINTER: + return debug_make_pointer_type (dhandle, dt); + case DEMANGLE_COMPONENT_REFERENCE: + return debug_make_reference_type (dhandle, dt); + } + + case DEMANGLE_COMPONENT_BUILTIN_TYPE: + { + char *p; + size_t alc; + debug_type ret; + + /* We print this component in order to find out the type name. + FIXME: Should we instead expose the + demangle_builtin_type_info structure? */ + p = cplus_demangle_print (DMGL_PARAMS | DMGL_ANSI, dc, 20, &alc); + if (p == NULL) + { + fprintf (stderr, _("Couldn't get demangled builtin type\n")); + return NULL; + } + + /* The mangling is based on the type, but does not itself + indicate what the sizes are. So we have to guess. */ + if (strcmp (p, "signed char") == 0) + ret = debug_make_int_type (dhandle, 1, FALSE); + else if (strcmp (p, "bool") == 0) + ret = debug_make_bool_type (dhandle, 1); + else if (strcmp (p, "char") == 0) + ret = debug_make_int_type (dhandle, 1, FALSE); + else if (strcmp (p, "double") == 0) + ret = debug_make_float_type (dhandle, 8); + else if (strcmp (p, "long double") == 0) + ret = debug_make_float_type (dhandle, 8); + else if (strcmp (p, "float") == 0) + ret = debug_make_float_type (dhandle, 4); + else if (strcmp (p, "__float128") == 0) + ret = debug_make_float_type (dhandle, 16); + else if (strcmp (p, "unsigned char") == 0) + ret = debug_make_int_type (dhandle, 1, TRUE); + else if (strcmp (p, "int") == 0) + ret = debug_make_int_type (dhandle, 4, FALSE); + else if (strcmp (p, "unsigned int") == 0) + ret = debug_make_int_type (dhandle, 4, TRUE); + else if (strcmp (p, "long") == 0) + ret = debug_make_int_type (dhandle, 4, FALSE); + else if (strcmp (p, "unsigned long") == 0) + ret = debug_make_int_type (dhandle, 4, TRUE); + else if (strcmp (p, "__int128") == 0) + ret = debug_make_int_type (dhandle, 16, FALSE); + else if (strcmp (p, "unsigned __int128") == 0) + ret = debug_make_int_type (dhandle, 16, TRUE); + else if (strcmp (p, "short") == 0) + ret = debug_make_int_type (dhandle, 2, FALSE); + else if (strcmp (p, "unsigned short") == 0) + ret = debug_make_int_type (dhandle, 2, TRUE); + else if (strcmp (p, "void") == 0) + ret = debug_make_void_type (dhandle); + else if (strcmp (p, "wchar_t") == 0) + ret = debug_make_int_type (dhandle, 4, TRUE); + else if (strcmp (p, "long long") == 0) + ret = debug_make_int_type (dhandle, 8, FALSE); + else if (strcmp (p, "unsigned long long") == 0) + ret = debug_make_int_type (dhandle, 8, TRUE); + else if (strcmp (p, "...") == 0) + { + if (pvarargs == NULL) + fprintf (stderr, _("Unexpected demangled varargs\n")); + else + *pvarargs = TRUE; + ret = NULL; + } + else + { + fprintf (stderr, _("Unrecognized demangled builtin type\n")); + ret = NULL; + } + + free (p); + + return ret; + } + } } diff --git a/contrib/binutils/binutils/strings.c b/contrib/binutils/binutils/strings.c index dade244..68c244c 100644 --- a/contrib/binutils/binutils/strings.c +++ b/contrib/binutils/binutils/strings.c @@ -1,6 +1,6 @@ /* strings -- print the strings of printable characters in files Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002 Free Software Foundation, Inc. + 2002, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -39,10 +39,11 @@ -o Like -to. (Some other implementations have -o like -to, others like -td. We chose one arbitrarily.) - --encoding={s,b,l,B,L} - -e {s,b,l,B,L} - Select character encoding: single-byte, bigendian 16-bit, - littleendian 16-bit, bigendian 32-bit, littleendian 32-bit + --encoding={s,S,b,l,B,L} + -e {s,S,b,l,B,L} + Select character encoding: 7-bit-character, 8-bit-character, + bigendian 16-bit, littleendian 16-bit, bigendian 32-bit, + littleendian 32-bit. --target=BFDNAME Specify a non-default object file format. @@ -80,11 +81,14 @@ #endif #if O_BINARY #include -#define SET_BINARY(f) do { if (!isatty(f)) setmode(f,O_BINARY); } while (0) +#define SET_BINARY(f) do { if (!isatty (f)) setmode (f,O_BINARY); } while (0) #endif #endif -#define isgraphic(c) (ISPRINT (c) || (c) == '\t') +#define STRING_ISGRAPHIC(c) \ + ( (c) >= 0 \ + && (c) <= 255 \ + && ((c) == '\t' || ISPRINT (c) || (encoding == 'S' && (c) > 127))) #ifndef errno extern int errno; @@ -95,10 +99,10 @@ extern int errno; #ifdef HAVE_FOPEN64 typedef off64_t file_off; -#define file_open(s,m) fopen64(s,m) +#define file_open(s,m) fopen64(s, m) #else typedef off_t file_off; -#define file_open(s,m) fopen(s,m) +#define file_open(s,m) fopen(s, m) #endif /* Radix for printing addresses (must be 8, 10 or 16). */ @@ -107,17 +111,17 @@ static int address_radix; /* Minimum length of sequence of graphic chars to trigger output. */ static int string_min; -/* true means print address within file for each string. */ -static boolean print_addresses; +/* TRUE means print address within file for each string. */ +static bfd_boolean print_addresses; -/* true means print filename for each string. */ -static boolean print_filenames; +/* TRUE means print filename for each string. */ +static bfd_boolean print_filenames; -/* true means for object files scan only the data section. */ -static boolean datasection_only; +/* TRUE means for object files scan only the data section. */ +static bfd_boolean datasection_only; -/* true if we found an initialized data section in the current file. */ -static boolean got_a_section; +/* TRUE if we found an initialized data section in the current file. */ +static bfd_boolean got_a_section; /* The BFD object file format. */ static char *target; @@ -139,27 +143,22 @@ static struct option long_options[] = {NULL, 0, NULL, 0} }; -static void strings_a_section PARAMS ((bfd *, asection *, PTR)); -static boolean strings_object_file PARAMS ((const char *)); -static boolean strings_file PARAMS ((char *file)); -static int integer_arg PARAMS ((char *s)); -static void print_strings PARAMS ((const char *filename, FILE *stream, - file_off address, int stop_point, - int magiccount, char *magic)); -static void usage PARAMS ((FILE *stream, int status)); -static long get_char PARAMS ((FILE *stream, file_off *address, - int *magiccount, char **magic)); +static void strings_a_section (bfd *, asection *, void *); +static bfd_boolean strings_object_file (const char *); +static bfd_boolean strings_file (char *file); +static int integer_arg (char *s); +static void print_strings (const char *, FILE *, file_off, int, int, char *); +static void usage (FILE *, int); +static long get_char (FILE *, file_off *, int *, char **); -int main PARAMS ((int, char **)); +int main (int, char **); int -main (argc, argv) - int argc; - char **argv; +main (int argc, char **argv) { int optc; int exit_status = 0; - boolean files_given = false; + bfd_boolean files_given = FALSE; #if defined (HAVE_SETLOCALE) setlocale (LC_ALL, ""); @@ -170,9 +169,9 @@ main (argc, argv) program_name = argv[0]; xmalloc_set_program_name (program_name); string_min = -1; - print_addresses = false; - print_filenames = false; - datasection_only = true; + print_addresses = FALSE; + print_filenames = FALSE; + datasection_only = TRUE; target = NULL; encoding = 's'; @@ -182,11 +181,11 @@ main (argc, argv) switch (optc) { case 'a': - datasection_only = false; + datasection_only = FALSE; break; case 'f': - print_filenames = true; + print_filenames = TRUE; break; case 'H': @@ -196,18 +195,16 @@ main (argc, argv) case 'n': string_min = integer_arg (optarg); if (string_min < 1) - { - fatal (_("invalid number %s"), optarg); - } + fatal (_("invalid number %s"), optarg); break; case 'o': - print_addresses = true; + print_addresses = TRUE; address_radix = 8; break; case 't': - print_addresses = true; + print_addresses = TRUE; if (optarg[1] != '\0') usage (stderr, 1); switch (optarg[0]) @@ -261,6 +258,7 @@ main (argc, argv) switch (encoding) { + case 'S': case 's': encoding_bytes = 1; break; @@ -281,28 +279,28 @@ main (argc, argv) if (optind >= argc) { - datasection_only = false; + datasection_only = FALSE; #ifdef SET_BINARY SET_BINARY (fileno (stdin)); #endif print_strings ("{standard input}", stdin, 0, 0, 0, (char *) NULL); - files_given = true; + files_given = TRUE; } else { for (; optind < argc; ++optind) { if (strcmp (argv[optind], "-") == 0) - datasection_only = false; + datasection_only = FALSE; else { - files_given = true; - exit_status |= (strings_file (argv[optind]) == false); + files_given = TRUE; + exit_status |= strings_file (argv[optind]) == FALSE; } } } - if (files_given == false) + if (!files_given) usage (stderr, 1); return (exit_status); @@ -313,20 +311,18 @@ main (argc, argv) set `got_a_section' and print the strings in it. */ static void -strings_a_section (abfd, sect, filearg) - bfd *abfd; - asection *sect; - PTR filearg; +strings_a_section (bfd *abfd, asection *sect, void *filearg) { const char *file = (const char *) filearg; if ((sect->flags & DATA_FLAGS) == DATA_FLAGS) { bfd_size_type sz = bfd_get_section_size_before_reloc (sect); - PTR mem = xmalloc (sz); + void *mem = xmalloc (sz); + if (bfd_get_section_contents (abfd, sect, mem, (file_ptr) 0, sz)) { - got_a_section = true; + got_a_section = TRUE; print_strings (file, (FILE *) NULL, sect->filepos, 0, sz, mem); } free (mem); @@ -336,48 +332,47 @@ strings_a_section (abfd, sect, filearg) /* Scan all of the sections in FILE, and print the strings in the initialized data section(s). - Return true if successful, - false if not (such as if FILE is not an object file). */ + Return TRUE if successful, + FALSE if not (such as if FILE is not an object file). */ -static boolean -strings_object_file (file) - const char *file; +static bfd_boolean +strings_object_file (const char *file) { bfd *abfd = bfd_openr (file, target); if (abfd == NULL) - { - /* Treat the file as a non-object file. */ - return false; - } + /* Treat the file as a non-object file. */ + return FALSE; /* This call is mainly for its side effect of reading in the sections. We follow the traditional behavior of `strings' in that we don't complain if we don't recognize a file to be an object file. */ - if (bfd_check_format (abfd, bfd_object) == false) + if (!bfd_check_format (abfd, bfd_object)) { bfd_close (abfd); - return false; + return FALSE; } - got_a_section = false; - bfd_map_over_sections (abfd, strings_a_section, (PTR) file); + got_a_section = FALSE; + bfd_map_over_sections (abfd, strings_a_section, (void *) file); if (!bfd_close (abfd)) { bfd_nonfatal (file); - return false; + return FALSE; } return got_a_section; } -/* Print the strings in FILE. Return true if ok, false if an error occurs. */ +/* Print the strings in FILE. Return TRUE if ok, FALSE if an error occurs. */ -static boolean -strings_file (file) - char *file; +static bfd_boolean +strings_file (char *file) { + if (get_file_size (file) < 1) + return FALSE; + /* If we weren't told to scan the whole file, try to open it as an object file and only look at initialized data sections. If that fails, fall back to the @@ -391,7 +386,7 @@ strings_file (file) { fprintf (stderr, "%s: ", program_name); perror (file); - return false; + return FALSE; } print_strings (file, stream, (file_off) 0, 0, 0, (char *) 0); @@ -400,11 +395,11 @@ strings_file (file) { fprintf (stderr, "%s: ", program_name); perror (file); - return false; + return FALSE; } } - return true; + return TRUE; } /* Read the next character, return EOF if none available. @@ -418,11 +413,7 @@ strings_file (file) MAGICCOUNT is how many characters are in it. */ static long -get_char (stream, address, magiccount, magic) - FILE *stream; - file_off *address; - int *magiccount; - char **magic; +get_char (FILE *stream, file_off *address, int *magiccount, char **magic) { int c, i; long r = EOF; @@ -454,6 +445,7 @@ get_char (stream, address, magiccount, magic) switch (encoding) { + case 'S': case 's': r = buf[0]; break; @@ -492,13 +484,8 @@ get_char (stream, address, magiccount, magic) Those characters come at address ADDRESS and the data in STREAM follow. */ static void -print_strings (filename, stream, address, stop_point, magiccount, magic) - const char *filename; - FILE *stream; - file_off address; - int stop_point; - int magiccount; - char *magic; +print_strings (const char *filename, FILE *stream, file_off address, + int stop_point, int magiccount, char *magic) { char *buf = (char *) xmalloc (sizeof (char) * (string_min + 1)); @@ -518,7 +505,7 @@ print_strings (filename, stream, address, stop_point, magiccount, magic) c = get_char (stream, &address, &magiccount, &magic); if (c == EOF) return; - if (c > 255 || c < 0 || !isgraphic (c)) + if (! STRING_ISGRAPHIC (c)) /* Found a non-graphic. Try again starting with next char. */ goto tryline; buf[i] = c; @@ -586,7 +573,7 @@ print_strings (filename, stream, address, stop_point, magiccount, magic) c = get_char (stream, &address, &magiccount, &magic); if (c == EOF) break; - if (c > 255 || c < 0 || !isgraphic (c)) + if (! STRING_ISGRAPHIC (c)) break; putchar (c); } @@ -599,8 +586,7 @@ print_strings (filename, stream, address, stop_point, magiccount, magic) but allowing octal and hex numbers as in C. */ static int -integer_arg (s) - char *s; +integer_arg (char *s) { int value; int radix = 10; @@ -636,16 +622,13 @@ integer_arg (s) p--; if (*p) - { - fatal (_("invalid integer argument %s"), s); - } + fatal (_("invalid integer argument %s"), s); + return value; } static void -usage (stream, status) - FILE *stream; - int status; +usage (FILE *stream, int status) { fprintf (stream, _("Usage: %s [option(s)] [file(s)]\n"), program_name); fprintf (stream, _(" Display printable strings in [file(s)] (stdin by default)\n")); @@ -657,8 +640,8 @@ usage (stream, status) -t --radix={o,x,d} Print the location of the string in base 8, 10 or 16\n\ -o An alias for --radix=o\n\ -T --target= Specify the binary file format\n\ - -e --encoding={s,b,l,B,L} Select character size and endianness:\n\ - s = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit\n\ + -e --encoding={s,S,b,l,B,L} Select character size and endianness:\n\ + s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit\n\ -h --help Display this information\n\ -v --version Print the program's version number\n")); list_supported_targets (program_name, stream); diff --git a/contrib/binutils/binutils/sysdump.c b/contrib/binutils/binutils/sysdump.c index 2d0362b..a1df1e0 100644 --- a/contrib/binutils/binutils/sysdump.c +++ b/contrib/binutils/binutils/sysdump.c @@ -1,5 +1,5 @@ /* Sysroff object format dumper. - Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002 + Copyright 1994, 1995, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -40,35 +40,31 @@ static int code; static int addrsize = 4; static FILE *file; -static void dh PARAMS ((unsigned char *, int)); -static void itheader PARAMS ((char *, int)); -static void p PARAMS ((void)); -static void tabout PARAMS ((void)); -static void pbarray PARAMS ((barray *)); -static int getone PARAMS ((int)); -static int opt PARAMS ((int)); -static void must PARAMS ((int)); -static void tab PARAMS ((int, char *)); -static void dump_symbol_info PARAMS ((void)); -static void derived_type PARAMS ((void)); -static void module PARAMS ((void)); -static void show_usage PARAMS ((FILE *, int)); - -extern char *getCHARS PARAMS ((unsigned char *, int *, int, int)); -extern int fillup PARAMS ((char *)); -extern barray getBARRAY PARAMS ((unsigned char *, int *, int, int)); -extern int getINT PARAMS ((unsigned char *, int *, int, int)); -extern int getBITS PARAMS ((char *, int *, int, int)); -extern void sysroff_swap_tr_in PARAMS ((void)); -extern void sysroff_print_tr_out PARAMS ((void)); -extern int main PARAMS ((int, char **)); +static void dh (unsigned char *, int); +static void itheader (char *, int); +static void p (void); +static void tabout (void); +static void pbarray (barray *); +static int getone (int); +static int opt (int); +static void must (int); +static void tab (int, char *); +static void dump_symbol_info (void); +static void derived_type (void); +static void module (void); +static void show_usage (FILE *, int); + +extern char *getCHARS (unsigned char *, int *, int, int); +extern int fillup (char *); +extern barray getBARRAY (unsigned char *, int *, int, int); +extern int getINT (unsigned char *, int *, int, int); +extern int getBITS (char *, int *, int, int); +extern void sysroff_swap_tr_in (void); +extern void sysroff_print_tr_out (void); +extern int main (int, char **); char * -getCHARS (ptr, idx, size, max) - unsigned char *ptr; - int *idx; - int size; - int max; +getCHARS (unsigned char *ptr, int *idx, int size, int max) { int oc = *idx / 8; char *r; @@ -93,9 +89,7 @@ getCHARS (ptr, idx, size, max) } static void -dh (ptr, size) - unsigned char *ptr; - int size; +dh (unsigned char *ptr, int size) { int i; int j; @@ -127,8 +121,7 @@ dh (ptr, size) } int -fillup (ptr) - char *ptr; +fillup (char *ptr) { int size; int sum; @@ -151,11 +144,8 @@ fillup (ptr) } barray -getBARRAY (ptr, idx, dsize, max) - unsigned char *ptr; - int *idx; - int dsize ATTRIBUTE_UNUSED; - int max ATTRIBUTE_UNUSED; +getBARRAY (unsigned char *ptr, int *idx, int dsize ATTRIBUTE_UNUSED, + int max ATTRIBUTE_UNUSED) { barray res; int i; @@ -172,11 +162,7 @@ getBARRAY (ptr, idx, dsize, max) } int -getINT (ptr, idx, size, max) - unsigned char *ptr; - int *idx; - int size; - int max; +getINT (unsigned char *ptr, int *idx, int size, int max) { int n = 0; int byte = *idx / 8; @@ -212,10 +198,7 @@ getINT (ptr, idx, size, max) } int -getBITS (ptr, idx, size, max) - char *ptr; - int *idx; - int size, max; +getBITS (char *ptr, int *idx, int size, int max) { int byte = *idx / 8; int bit = *idx % 8; @@ -229,9 +212,7 @@ getBITS (ptr, idx, size, max) } static void -itheader (name, code) - char *name; - int code; +itheader (char *name, int code) { printf ("\n%s 0x%02x\n", name, code); } @@ -239,7 +220,7 @@ itheader (name, code) static int indent; static void -p () +p (void) { int i; @@ -250,14 +231,13 @@ p () } static void -tabout () +tabout (void) { p (); } static void -pbarray (y) - barray *y; +pbarray (barray *y) { int x; @@ -283,7 +263,7 @@ pbarray (y) #define IT_tr_CODE 0x7f void -sysroff_swap_tr_in() +sysroff_swap_tr_in (void) { char raw[255]; @@ -292,14 +272,13 @@ sysroff_swap_tr_in() } void -sysroff_print_tr_out() +sysroff_print_tr_out (void) { itheader ("tr", IT_tr_CODE); } static int -getone (type) - int type; +getone (int type) { int c = getc (file); @@ -531,8 +510,7 @@ getone (type) } static int -opt (x) - int x; +opt (int x) { return getone (x); } @@ -542,7 +520,7 @@ opt (x) /* This is no longer used. */ static void -unit_info_list () +unit_info_list (void) { while (opt (IT_un_CODE)) { @@ -566,7 +544,7 @@ unit_info_list () /* This is no longer used. */ static void -object_body_list () +object_body_list (void) { while (getone (IT_sh_CODE)) { @@ -580,17 +558,14 @@ object_body_list () #endif static void -must (x) - int x; +must (int x) { if (!getone (x)) printf ("WANTED %x!!\n", x); } static void -tab (i, s) - int i; - char *s; +tab (int i, char *s) { indent += i; @@ -603,7 +578,7 @@ tab (i, s) } static void -dump_symbol_info () +dump_symbol_info (void) { tab (1, "SYMBOL INFO"); @@ -621,7 +596,7 @@ dump_symbol_info () } static void -derived_type () +derived_type (void) { tab (1, "DERIVED TYPE"); @@ -679,7 +654,7 @@ derived_type () /* This is no longer used. */ static void -program_structure () +program_structure (void) { tab (1, "PROGRAM STRUCTURE"); while (opt (IT_dps_CODE)) @@ -699,7 +674,7 @@ program_structure () /* This is no longer used. */ static void -debug_list () +debug_list (void) { tab (1, "DEBUG LIST"); @@ -714,7 +689,7 @@ debug_list () #endif static void -module () +module (void) { int c = 0; int l = 0; @@ -760,9 +735,7 @@ module () char *program_name; static void -show_usage (file, status) - FILE *file; - int status; +show_usage (FILE *file, int status) { fprintf (file, _("Usage: %s [option(s)] in-file\n"), program_name); fprintf (file, _("Print a human readable interpretation of a SYSROFF object file\n")); @@ -776,9 +749,7 @@ show_usage (file, status) } int -main (ac, av) - int ac; - char **av; +main (int ac, char **av) { char *input_file = NULL; int opt; diff --git a/contrib/binutils/binutils/unwind-ia64.c b/contrib/binutils/binutils/unwind-ia64.c index 803a5fa..2e7e726 100644 --- a/contrib/binutils/binutils/unwind-ia64.c +++ b/contrib/binutils/binutils/unwind-ia64.c @@ -1,5 +1,5 @@ /* unwind-ia64.c -- utility routines to dump IA-64 unwind info for readelf. - Copyright 2000, 2001 Free Software Foundation, Inc. + Copyright 2000, 2001, 2003 Free Software Foundation, Inc. Contributed by David Mosberger-Tang This file is part of GNU Binutils. @@ -25,7 +25,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if __GNUC__ >= 2 /* Define BFD64 here, even if our default architecture is 32 bit ELF as this will allow us to read in and parse 64bit and 32bit ELF files. - Only do this if we belive that the compiler can support a 64 bit + Only do this if we believe that the compiler can support a 64 bit data type. For now we only rely on GCC being able to do this. */ #define BFD64 #endif @@ -33,16 +33,14 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ static bfd_vma unw_rlen = 0; -static void unw_print_brmask PARAMS ((char *, unsigned int)); -static void unw_print_grmask PARAMS ((char *, unsigned int)); -static void unw_print_frmask PARAMS ((char *, unsigned int)); -static void unw_print_abreg PARAMS ((char *, unsigned int)); -static void unw_print_xyreg PARAMS ((char *, unsigned int, unsigned int)); +static void unw_print_brmask (char *, unsigned int); +static void unw_print_grmask (char *, unsigned int); +static void unw_print_frmask (char *, unsigned int); +static void unw_print_abreg (char *, unsigned int); +static void unw_print_xyreg (char *, unsigned int, unsigned int); static void -unw_print_brmask (cp, mask) - char * cp; - unsigned int mask; +unw_print_brmask (char *cp, unsigned int mask) { int sep = 0; int i; @@ -63,9 +61,7 @@ unw_print_brmask (cp, mask) } static void -unw_print_grmask (cp, mask) - char * cp; - unsigned int mask; +unw_print_grmask (char *cp, unsigned int mask) { int sep = 0; int i; @@ -86,9 +82,7 @@ unw_print_grmask (cp, mask) } static void -unw_print_frmask (cp, mask) - char * cp; - unsigned int mask; +unw_print_frmask (char *cp, unsigned int mask) { int sep = 0; int i; @@ -115,9 +109,7 @@ unw_print_frmask (cp, mask) } static void -unw_print_abreg (cp, abreg) - char * cp; - unsigned int abreg; +unw_print_abreg (char *cp, unsigned int abreg) { static const char *special_reg[16] = { @@ -147,10 +139,7 @@ unw_print_abreg (cp, abreg) } static void -unw_print_xyreg (cp, x, ytreg) - char * cp; - unsigned int x; - unsigned int ytreg; +unw_print_xyreg (char *cp, unsigned int x, unsigned int ytreg) { switch ((x << 1) | ((ytreg >> 7) & 1)) { @@ -252,13 +241,13 @@ typedef bfd_vma unw_word; } \ while (0) -#define UNW_DEC_FRGR_MEM(fmt, grmask, frmask, arg) \ +#define UNW_DEC_FRGR_MEM(fmt, grmask, frmask, arg) \ do \ - { \ + { \ char frstr[200], grstr[20]; \ - \ - unw_print_grmask (grstr, grmask); \ - unw_print_frmask (frstr, frmask); \ + \ + unw_print_grmask (grstr, grmask); \ + unw_print_frmask (frstr, frmask); \ printf ("\t%s:frgr_mem(grmask=[%s],frmask=[%s])\n", fmt, grstr, frstr); \ } \ while (0) @@ -360,8 +349,8 @@ typedef bfd_vma unw_word; #define UNW_DEC_SPILL_MASK(fmt, dp, arg) \ do \ { \ - static const char * spill_type = "-frb"; \ - unsigned const char * imaskp = dp; \ + static const char *spill_type = "-frb"; \ + unsigned const char *imaskp = dp; \ unsigned char mask = 0; \ bfd_vma insn = 0; \ \ @@ -390,13 +379,13 @@ typedef bfd_vma unw_word; } \ while (0) -#define UNW_DEC_SPILL_PSPREL(fmt, t, abreg, pspoff, arg) \ +#define UNW_DEC_SPILL_PSPREL(fmt, t, abreg, pspoff, arg) \ do \ - { \ - char regname[10]; \ - \ - unw_print_abreg (regname, abreg); \ - printf ("\t%s:spill_psprel(reg=%s,t=%lu,pspoff=0x10-0x%lx)\n", \ + { \ + char regname[10]; \ + \ + unw_print_abreg (regname, abreg); \ + printf ("\t%s:spill_psprel(reg=%s,t=%lu,pspoff=0x10-0x%lx)\n", \ fmt, regname, (unsigned long) t, 4*(unsigned long)pspoff); \ } \ while (0) @@ -424,12 +413,12 @@ typedef bfd_vma unw_word; } \ while (0) -#define UNW_DEC_SPILL_SPREL_P(fmt, qp, t, abreg, spoff, arg) \ +#define UNW_DEC_SPILL_SPREL_P(fmt, qp, t, abreg, spoff, arg) \ do \ - { \ - char regname[20]; \ - \ - unw_print_abreg (regname, abreg); \ + { \ + char regname[20]; \ + \ + unw_print_abreg (regname, abreg); \ printf ("\t%s:spill_sprel_p(qp=p%u,t=%lu,reg=%s,spoff=0x%lx)\n", \ fmt, qp, (unsigned long) t, regname, 4 * (unsigned long)spoff); \ } \ @@ -541,39 +530,38 @@ typedef bfd_vma unw_word; * UNW_DEC_SPILL_SPREL_P(fmt,qp,t,abreg,pspoff,arg) */ -static unw_word unw_decode_uleb128 PARAMS ((const unsigned char **)); -static const unsigned char *unw_decode_x1 PARAMS ((const unsigned char *, - unsigned int, void *)); -static const unsigned char *unw_decode_x2 PARAMS ((const unsigned char *, - unsigned int, void *)); -static const unsigned char *unw_decode_x3 PARAMS ((const unsigned char *, - unsigned int, void *)); -static const unsigned char *unw_decode_x4 PARAMS ((const unsigned char *, - unsigned int, void *)); -static const unsigned char *unw_decode_r1 PARAMS ((const unsigned char *, - unsigned int, void *)); -static const unsigned char *unw_decode_r2 PARAMS ((const unsigned char *, - unsigned int, void *)); -static const unsigned char *unw_decode_r3 PARAMS ((const unsigned char *, - unsigned int, void *)); -static const unsigned char *unw_decode_p1 PARAMS ((const unsigned char *, - unsigned int, void *)); -static const unsigned char *unw_decode_p2_p5 PARAMS ((const unsigned char *, - unsigned int, void *)); -static const unsigned char *unw_decode_p6 PARAMS ((const unsigned char *, - unsigned int, void *)); -static const unsigned char *unw_decode_p7_p10 PARAMS ((const unsigned char *, - unsigned int, void *)); -static const unsigned char *unw_decode_b1 PARAMS ((const unsigned char *, - unsigned int, void *)); -static const unsigned char *unw_decode_b2 PARAMS ((const unsigned char *, - unsigned int, void *)); -static const unsigned char *unw_decode_b3_x4 PARAMS ((const unsigned char *, - unsigned int, void *)); +static unw_word unw_decode_uleb128 (const unsigned char **); +static const unsigned char *unw_decode_x1 + (const unsigned char *, unsigned int, void *); +static const unsigned char *unw_decode_x2 + (const unsigned char *, unsigned int, void *); +static const unsigned char *unw_decode_x3 + (const unsigned char *, unsigned int, void *); +static const unsigned char *unw_decode_x4 + (const unsigned char *, unsigned int, void *); +static const unsigned char *unw_decode_r1 + (const unsigned char *, unsigned int, void *); +static const unsigned char *unw_decode_r2 + (const unsigned char *, unsigned int, void *); +static const unsigned char *unw_decode_r3 + (const unsigned char *, unsigned int, void *); +static const unsigned char *unw_decode_p1 + (const unsigned char *, unsigned int, void *); +static const unsigned char *unw_decode_p2_p5 + (const unsigned char *, unsigned int, void *); +static const unsigned char *unw_decode_p6 + (const unsigned char *, unsigned int, void *); +static const unsigned char *unw_decode_p7_p10 + (const unsigned char *, unsigned int, void *); +static const unsigned char *unw_decode_b1 + (const unsigned char *, unsigned int, void *); +static const unsigned char *unw_decode_b2 + (const unsigned char *, unsigned int, void *); +static const unsigned char *unw_decode_b3_x4 + (const unsigned char *, unsigned int, void *); static unw_word -unw_decode_uleb128 (dpp) - const unsigned char **dpp; +unw_decode_uleb128 (const unsigned char **dpp) { unsigned shift = 0; unw_word byte, result = 0; @@ -596,10 +584,8 @@ unw_decode_uleb128 (dpp) } static const unsigned char * -unw_decode_x1 (dp, code, arg) - const unsigned char * dp; - unsigned int code ATTRIBUTE_UNUSED; - void * arg ATTRIBUTE_UNUSED; +unw_decode_x1 (const unsigned char *dp, unsigned int code ATTRIBUTE_UNUSED, + void *arg ATTRIBUTE_UNUSED) { unsigned char byte1, abreg; unw_word t, off; @@ -616,10 +602,8 @@ unw_decode_x1 (dp, code, arg) } static const unsigned char * -unw_decode_x2 (dp, code, arg) - const unsigned char * dp; - unsigned int code ATTRIBUTE_UNUSED; - void * arg ATTRIBUTE_UNUSED; +unw_decode_x2 (const unsigned char *dp, unsigned int code ATTRIBUTE_UNUSED, + void *arg ATTRIBUTE_UNUSED) { unsigned char byte1, byte2, abreg, x, ytreg; unw_word t; @@ -638,10 +622,8 @@ unw_decode_x2 (dp, code, arg) } static const unsigned char * -unw_decode_x3 (dp, code, arg) - const unsigned char * dp; - unsigned int code ATTRIBUTE_UNUSED; - void * arg ATTRIBUTE_UNUSED; +unw_decode_x3 (const unsigned char *dp, unsigned int code ATTRIBUTE_UNUSED, + void *arg ATTRIBUTE_UNUSED) { unsigned char byte1, byte2, abreg, qp; unw_word t, off; @@ -662,10 +644,8 @@ unw_decode_x3 (dp, code, arg) } static const unsigned char * -unw_decode_x4 (dp, code, arg) - const unsigned char * dp; - unsigned int code ATTRIBUTE_UNUSED; - void * arg ATTRIBUTE_UNUSED; +unw_decode_x4 (const unsigned char *dp, unsigned int code ATTRIBUTE_UNUSED, + void *arg ATTRIBUTE_UNUSED) { unsigned char byte1, byte2, byte3, qp, abreg, x, ytreg; unw_word t; @@ -688,10 +668,7 @@ unw_decode_x4 (dp, code, arg) } static const unsigned char * -unw_decode_r1 (dp, code, arg) - const unsigned char *dp; - unsigned int code; - void *arg; +unw_decode_r1 (const unsigned char *dp, unsigned int code, void *arg) { int body = (code & 0x20) != 0; unw_word rlen; @@ -702,10 +679,7 @@ unw_decode_r1 (dp, code, arg) } static const unsigned char * -unw_decode_r2 (dp, code, arg) - const unsigned char *dp; - unsigned int code; - void *arg; +unw_decode_r2 (const unsigned char *dp, unsigned int code, void *arg) { unsigned char byte1, mask, grsave; unw_word rlen; @@ -720,10 +694,7 @@ unw_decode_r2 (dp, code, arg) } static const unsigned char * -unw_decode_r3 (dp, code, arg) - const unsigned char *dp; - unsigned int code; - void *arg; +unw_decode_r3 (const unsigned char *dp, unsigned int code, void *arg) { unw_word rlen; @@ -733,10 +704,8 @@ unw_decode_r3 (dp, code, arg) } static const unsigned char * -unw_decode_p1 (dp, code, arg) - const unsigned char * dp; - unsigned int code; - void * arg ATTRIBUTE_UNUSED; +unw_decode_p1 (const unsigned char *dp, unsigned int code, + void *arg ATTRIBUTE_UNUSED) { unsigned char brmask = (code & 0x1f); @@ -745,10 +714,8 @@ unw_decode_p1 (dp, code, arg) } static const unsigned char * -unw_decode_p2_p5 (dp, code, arg) - const unsigned char * dp; - unsigned int code; - void * arg ATTRIBUTE_UNUSED; +unw_decode_p2_p5 (const unsigned char *dp, unsigned int code, + void *arg ATTRIBUTE_UNUSED) { if ((code & 0x10) == 0) { @@ -826,10 +793,8 @@ unw_decode_p2_p5 (dp, code, arg) } static const unsigned char * -unw_decode_p6 (dp, code, arg) - const unsigned char * dp; - unsigned int code; - void * arg ATTRIBUTE_UNUSED; +unw_decode_p6 (const unsigned char *dp, unsigned int code, + void *arg ATTRIBUTE_UNUSED) { int gregs = (code & 0x10) != 0; unsigned char mask = (code & 0x0f); @@ -842,10 +807,7 @@ unw_decode_p6 (dp, code, arg) } static const unsigned char * -unw_decode_p7_p10 (dp, code, arg) - const unsigned char *dp; - unsigned int code; - void *arg; +unw_decode_p7_p10 (const unsigned char *dp, unsigned int code, void *arg) { unsigned char r, byte1, byte2; unw_word t, size; @@ -1018,10 +980,8 @@ unw_decode_p7_p10 (dp, code, arg) } static const unsigned char * -unw_decode_b1 (dp, code, arg) - const unsigned char * dp; - unsigned int code; - void * arg ATTRIBUTE_UNUSED; +unw_decode_b1 (const unsigned char *dp, unsigned int code, + void *arg ATTRIBUTE_UNUSED) { unw_word label = (code & 0x1f); @@ -1033,10 +993,8 @@ unw_decode_b1 (dp, code, arg) } static const unsigned char * -unw_decode_b2 (dp, code, arg) - const unsigned char * dp; - unsigned int code; - void * arg ATTRIBUTE_UNUSED; +unw_decode_b2 (const unsigned char *dp, unsigned int code, + void *arg ATTRIBUTE_UNUSED) { unw_word t; @@ -1046,10 +1004,7 @@ unw_decode_b2 (dp, code, arg) } static const unsigned char * -unw_decode_b3_x4 (dp, code, arg) - const unsigned char *dp; - unsigned int code; - void *arg; +unw_decode_b3_x4 (const unsigned char *dp, unsigned int code, void *arg) { unw_word t, ecount, label; @@ -1086,7 +1041,7 @@ unw_decode_b3_x4 (dp, code, arg) } typedef const unsigned char *(*unw_decoder) - PARAMS ((const unsigned char *, unsigned int, void *)); + (const unsigned char *, unsigned int, void *); static unw_decoder unw_decode_table[2][8] = { @@ -1115,10 +1070,8 @@ static unw_decoder unw_decode_table[2][8] = /* Decode one descriptor and return address of next descriptor. */ const unsigned char * -unw_decode (dp, inside_body, ptr_inside_body) - const unsigned char * dp; - int inside_body; - void * ptr_inside_body; +unw_decode (const unsigned char *dp, int inside_body, + void *ptr_inside_body) { unw_decoder decoder; unsigned char code; diff --git a/contrib/binutils/binutils/unwind-ia64.h b/contrib/binutils/binutils/unwind-ia64.h index 7d5033d..3b6ab22 100644 --- a/contrib/binutils/binutils/unwind-ia64.h +++ b/contrib/binutils/binutils/unwind-ia64.h @@ -1,5 +1,5 @@ /* unwind-ia64.h -- dump IA-64 unwind info. - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by David Mosberger-Tang This file is part of GNU Binutils. @@ -22,10 +22,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "ansidecl.h" #define UNW_VER(x) ((x) >> 48) -#define UNW_FLAG_MASK 0x0000ffff00000000 -#define UNW_FLAG_OSMASK 0x0000f00000000000 -#define UNW_FLAG_EHANDLER(x) ((x) & 0x0000000100000000L) -#define UNW_FLAG_UHANDLER(x) ((x) & 0x0000000200000000L) -#define UNW_LENGTH(x) ((x) & 0x00000000ffffffffL) +#define UNW_FLAG_MASK 0x0000ffff00000000LL +#define UNW_FLAG_OSMASK 0x0000f00000000000LL +#define UNW_FLAG_EHANDLER(x) ((x) & 0x0000000100000000LL) +#define UNW_FLAG_UHANDLER(x) ((x) & 0x0000000200000000LL) +#define UNW_LENGTH(x) ((x) & 0x00000000ffffffffLL) -extern const unsigned char * unw_decode PARAMS ((const unsigned char *, int, void *)); +extern const unsigned char *unw_decode (const unsigned char *, int, void *); diff --git a/contrib/binutils/binutils/version.c b/contrib/binutils/binutils/version.c index edaa065..f965619 100644 --- a/contrib/binutils/binutils/version.c +++ b/contrib/binutils/binutils/version.c @@ -1,38 +1,38 @@ /* version.c -- binutils version information - Copyright 1991, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1991, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. -This file is part of GNU Binutils. + This file is part of GNU Binutils. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "bfd.h" +#include "bfdver.h" #include "bucomm.h" /* Print the version number and copyright information, and exit. This implements the --version option for the various programs. */ void -print_version (name) - const char *name; +print_version (const char *name) { /* This output is intended to follow the GNU standards document. */ /* xgettext:c-format */ printf ("GNU %s %s\n", name, BFD_VERSION_STRING); - printf (_("Copyright 2002 Free Software Foundation, Inc.\n")); + printf (_("Copyright 2004 Free Software Foundation, Inc.\n")); printf (_("\ This program is free software; you may redistribute it under the terms of\n\ the GNU General Public License. This program has absolutely no warranty.\n")); diff --git a/contrib/binutils/binutils/wrstabs.c b/contrib/binutils/binutils/wrstabs.c index 5d0dc3b..0d301f6 100644 --- a/contrib/binutils/binutils/wrstabs.c +++ b/contrib/binutils/binutils/wrstabs.c @@ -1,5 +1,6 @@ /* wrstabs.c -- Output stabs debugging information - Copyright 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. + Copyright 1996, 1997, 1998, 2000, 2001, 2002, 2003 + Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GNU Binutils. @@ -31,10 +32,6 @@ #include "safe-ctype.h" #include "debug.h" #include "budbg.h" - -/* Meaningless definition needs by aout64.h. FIXME. */ -#define BYTES_IN_WORD 4 - #include "aout/aout64.h" #include "aout/stab_gnu.h" @@ -75,7 +72,7 @@ struct stab_type_stack /* The size of the type. */ unsigned int size; /* Whether type string defines a new type. */ - boolean definition; + bfd_boolean definition; /* String defining struct fields. */ char *fields; /* NULL terminated array of strings defining base classes for a @@ -176,83 +173,80 @@ struct stab_write_handle }; static struct bfd_hash_entry *string_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static boolean stab_write_symbol - PARAMS ((struct stab_write_handle *, int, int, bfd_vma, const char *)); -static boolean stab_push_string - PARAMS ((struct stab_write_handle *, const char *, long, boolean, - unsigned int)); -static boolean stab_push_defined_type - PARAMS ((struct stab_write_handle *, long, unsigned int)); -static char *stab_pop_type PARAMS ((struct stab_write_handle *)); -static boolean stab_modify_type - PARAMS ((struct stab_write_handle *, int, unsigned int, long **, size_t *)); + (struct bfd_hash_entry *, struct bfd_hash_table *, const char *); +static bfd_boolean stab_write_symbol + (struct stab_write_handle *, int, int, bfd_vma, const char *); +static bfd_boolean stab_push_string + (struct stab_write_handle *, const char *, long, bfd_boolean, unsigned int); +static bfd_boolean stab_push_defined_type + (struct stab_write_handle *, long, unsigned int); +static char *stab_pop_type (struct stab_write_handle *); +static bfd_boolean stab_modify_type + (struct stab_write_handle *, int, unsigned int, long **, size_t *); static long stab_get_struct_index - PARAMS ((struct stab_write_handle *, const char *, unsigned int, - enum debug_type_kind, unsigned int *)); -static boolean stab_class_method_var - PARAMS ((struct stab_write_handle *, const char *, enum debug_visibility, - boolean, boolean, boolean, bfd_vma, boolean)); - -static boolean stab_start_compilation_unit PARAMS ((PTR, const char *)); -static boolean stab_start_source PARAMS ((PTR, const char *)); -static boolean stab_empty_type PARAMS ((PTR)); -static boolean stab_void_type PARAMS ((PTR)); -static boolean stab_int_type PARAMS ((PTR, unsigned int, boolean)); -static boolean stab_float_type PARAMS ((PTR, unsigned int)); -static boolean stab_complex_type PARAMS ((PTR, unsigned int)); -static boolean stab_bool_type PARAMS ((PTR, unsigned int)); -static boolean stab_enum_type - PARAMS ((PTR, const char *, const char **, bfd_signed_vma *)); -static boolean stab_pointer_type PARAMS ((PTR)); -static boolean stab_function_type PARAMS ((PTR, int, boolean)); -static boolean stab_reference_type PARAMS ((PTR)); -static boolean stab_range_type PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma)); -static boolean stab_array_type - PARAMS ((PTR, bfd_signed_vma, bfd_signed_vma, boolean)); -static boolean stab_set_type PARAMS ((PTR, boolean)); -static boolean stab_offset_type PARAMS ((PTR)); -static boolean stab_method_type PARAMS ((PTR, boolean, int, boolean)); -static boolean stab_const_type PARAMS ((PTR)); -static boolean stab_volatile_type PARAMS ((PTR)); -static boolean stab_start_struct_type - PARAMS ((PTR, const char *, unsigned int, boolean, unsigned int)); -static boolean stab_struct_field - PARAMS ((PTR, const char *, bfd_vma, bfd_vma, enum debug_visibility)); -static boolean stab_end_struct_type PARAMS ((PTR)); -static boolean stab_start_class_type - PARAMS ((PTR, const char *, unsigned int, boolean, unsigned int, boolean, - boolean)); -static boolean stab_class_static_member - PARAMS ((PTR, const char *, const char *, enum debug_visibility)); -static boolean stab_class_baseclass - PARAMS ((PTR, bfd_vma, boolean, enum debug_visibility)); -static boolean stab_class_start_method PARAMS ((PTR, const char *)); -static boolean stab_class_method_variant - PARAMS ((PTR, const char *, enum debug_visibility, boolean, boolean, - bfd_vma, boolean)); -static boolean stab_class_static_method_variant - PARAMS ((PTR, const char *, enum debug_visibility, boolean, boolean)); -static boolean stab_class_end_method PARAMS ((PTR)); -static boolean stab_end_class_type PARAMS ((PTR)); -static boolean stab_typedef_type PARAMS ((PTR, const char *)); -static boolean stab_tag_type - PARAMS ((PTR, const char *, unsigned int, enum debug_type_kind)); -static boolean stab_typdef PARAMS ((PTR, const char *)); -static boolean stab_tag PARAMS ((PTR, const char *)); -static boolean stab_int_constant PARAMS ((PTR, const char *, bfd_vma)); -static boolean stab_float_constant PARAMS ((PTR, const char *, double)); -static boolean stab_typed_constant PARAMS ((PTR, const char *, bfd_vma)); -static boolean stab_variable - PARAMS ((PTR, const char *, enum debug_var_kind, bfd_vma)); -static boolean stab_start_function PARAMS ((PTR, const char *, boolean)); -static boolean stab_function_parameter - PARAMS ((PTR, const char *, enum debug_parm_kind, bfd_vma)); -static boolean stab_start_block PARAMS ((PTR, bfd_vma)); -static boolean stab_end_block PARAMS ((PTR, bfd_vma)); -static boolean stab_end_function PARAMS ((PTR)); -static boolean stab_lineno - PARAMS ((PTR, const char *, unsigned long, bfd_vma)); + (struct stab_write_handle *, const char *, unsigned int, + enum debug_type_kind, unsigned int *); +static bfd_boolean stab_class_method_var + (struct stab_write_handle *, const char *, enum debug_visibility, + bfd_boolean, bfd_boolean, bfd_boolean, bfd_vma, bfd_boolean); +static bfd_boolean stab_start_compilation_unit (void *, const char *); +static bfd_boolean stab_start_source (void *, const char *); +static bfd_boolean stab_empty_type (void *); +static bfd_boolean stab_void_type (void *); +static bfd_boolean stab_int_type (void *, unsigned int, bfd_boolean); +static bfd_boolean stab_float_type (void *, unsigned int); +static bfd_boolean stab_complex_type (void *, unsigned int); +static bfd_boolean stab_bool_type (void *, unsigned int); +static bfd_boolean stab_enum_type + (void *, const char *, const char **, bfd_signed_vma *); +static bfd_boolean stab_pointer_type (void *); +static bfd_boolean stab_function_type (void *, int, bfd_boolean); +static bfd_boolean stab_reference_type (void *); +static bfd_boolean stab_range_type (void *, bfd_signed_vma, bfd_signed_vma); +static bfd_boolean stab_array_type + (void *, bfd_signed_vma, bfd_signed_vma, bfd_boolean); +static bfd_boolean stab_set_type (void *, bfd_boolean); +static bfd_boolean stab_offset_type (void *); +static bfd_boolean stab_method_type (void *, bfd_boolean, int, bfd_boolean); +static bfd_boolean stab_const_type (void *); +static bfd_boolean stab_volatile_type (void *); +static bfd_boolean stab_start_struct_type + (void *, const char *, unsigned int, bfd_boolean, unsigned int); +static bfd_boolean stab_struct_field + (void *, const char *, bfd_vma, bfd_vma, enum debug_visibility); +static bfd_boolean stab_end_struct_type (void *); +static bfd_boolean stab_start_class_type + (void *, const char *, unsigned int, bfd_boolean, unsigned int, + bfd_boolean, bfd_boolean); +static bfd_boolean stab_class_static_member + (void *, const char *, const char *, enum debug_visibility); +static bfd_boolean stab_class_baseclass + (void *, bfd_vma, bfd_boolean, enum debug_visibility); +static bfd_boolean stab_class_start_method (void *, const char *); +static bfd_boolean stab_class_method_variant + (void *, const char *, enum debug_visibility, bfd_boolean, bfd_boolean, + bfd_vma, bfd_boolean); +static bfd_boolean stab_class_static_method_variant + (void *, const char *, enum debug_visibility, bfd_boolean, bfd_boolean); +static bfd_boolean stab_class_end_method (void *); +static bfd_boolean stab_end_class_type (void *); +static bfd_boolean stab_typedef_type (void *, const char *); +static bfd_boolean stab_tag_type + (void *, const char *, unsigned int, enum debug_type_kind); +static bfd_boolean stab_typdef (void *, const char *); +static bfd_boolean stab_tag (void *, const char *); +static bfd_boolean stab_int_constant (void *, const char *, bfd_vma); +static bfd_boolean stab_float_constant (void *, const char *, double); +static bfd_boolean stab_typed_constant (void *, const char *, bfd_vma); +static bfd_boolean stab_variable + (void *, const char *, enum debug_var_kind, bfd_vma); +static bfd_boolean stab_start_function (void *, const char *, bfd_boolean); +static bfd_boolean stab_function_parameter + (void *, const char *, enum debug_parm_kind, bfd_vma); +static bfd_boolean stab_start_block (void *, bfd_vma); +static bfd_boolean stab_end_block (void *, bfd_vma); +static bfd_boolean stab_end_function (void *); +static bfd_boolean stab_lineno (void *, const char *, unsigned long, bfd_vma); static const struct debug_write_fns stab_fns = { @@ -305,10 +299,8 @@ static const struct debug_write_fns stab_fns = /* Routine to create an entry in a string hash table. */ static struct bfd_hash_entry * -string_hash_newfunc (entry, table, string) - struct bfd_hash_entry *entry; - struct bfd_hash_table *table; - const char *string; +string_hash_newfunc (struct bfd_hash_entry *entry, + struct bfd_hash_table *table, const char *string) { struct string_hash_entry *ret = (struct string_hash_entry *) entry; @@ -343,13 +335,9 @@ string_hash_newfunc (entry, table, string) /* Add a symbol to the stabs debugging information we are building. */ -static boolean -stab_write_symbol (info, type, desc, value, string) - struct stab_write_handle *info; - int type; - int desc; - bfd_vma value; - const char *string; +static bfd_boolean +stab_write_symbol (struct stab_write_handle *info, int type, int desc, + bfd_vma value, const char *string) { bfd_size_type strx; bfd_byte sym[STAB_SYMBOL_SIZE]; @@ -360,12 +348,12 @@ stab_write_symbol (info, type, desc, value, string) { struct string_hash_entry *h; - h = string_hash_lookup (&info->strhash, string, true, true); + h = string_hash_lookup (&info->strhash, string, TRUE, TRUE); if (h == NULL) { non_fatal (_("string_hash_lookup failed: %s"), bfd_errmsg (bfd_get_error ())); - return false; + return FALSE; } if (h->index != -1) strx = h->index; @@ -400,18 +388,14 @@ stab_write_symbol (info, type, desc, value, string) info->symbols_size += STAB_SYMBOL_SIZE; - return true; + return TRUE; } /* Push a string on to the type stack. */ -static boolean -stab_push_string (info, string, index, definition, size) - struct stab_write_handle *info; - const char *string; - long index; - boolean definition; - unsigned int size; +static bfd_boolean +stab_push_string (struct stab_write_handle *info, const char *string, + long index, bfd_boolean definition, unsigned int size) { struct stab_type_stack *s; @@ -429,29 +413,26 @@ stab_push_string (info, string, index, definition, size) s->next = info->type_stack; info->type_stack = s; - return true; + return TRUE; } /* Push a type index which has already been defined. */ -static boolean -stab_push_defined_type (info, index, size) - struct stab_write_handle *info; - long index; - unsigned int size; +static bfd_boolean +stab_push_defined_type (struct stab_write_handle *info, long index, + unsigned int size) { char buf[20]; sprintf (buf, "%ld", index); - return stab_push_string (info, buf, index, false, size); + return stab_push_string (info, buf, index, FALSE, size); } /* Pop a type off the type stack. The caller is responsible for freeing the string. */ static char * -stab_pop_type (info) - struct stab_write_handle *info; +stab_pop_type (struct stab_write_handle *info) { struct stab_type_stack *s; char *ret; @@ -477,15 +458,12 @@ stab_pop_type (info) the symbols, *PSYMSIZE the size of the symbols, *PSTRINGS to the strings, and *PSTRINGSIZE to the size of the strings. */ -boolean -write_stabs_in_sections_debugging_info (abfd, dhandle, psyms, psymsize, - pstrings, pstringsize) - bfd *abfd; - PTR dhandle; - bfd_byte **psyms; - bfd_size_type *psymsize; - bfd_byte **pstrings; - bfd_size_type *pstringsize; +bfd_boolean +write_stabs_in_sections_debugging_info (bfd *abfd, void *dhandle, + bfd_byte **psyms, + bfd_size_type *psymsize, + bfd_byte **pstrings, + bfd_size_type *pstringsize) { struct stab_write_handle info; struct string_hash_entry *h; @@ -507,7 +485,7 @@ write_stabs_in_sections_debugging_info (abfd, dhandle, psyms, psymsize, { non_fatal ("bfd_hash_table_init_failed: %s", bfd_errmsg (bfd_get_error ())); - return false; + return FALSE; } info.type_stack = NULL; @@ -522,22 +500,22 @@ write_stabs_in_sections_debugging_info (abfd, dhandle, psyms, psymsize, /* The initial symbol holds the string size. */ if (! stab_write_symbol (&info, 0, 0, 0, (const char *) NULL)) - return false; + return FALSE; /* Output an initial N_SO symbol. */ info.so_offset = info.symbols_size; if (! stab_write_symbol (&info, N_SO, 0, 0, bfd_get_filename (abfd))) - return false; + return FALSE; - if (! debug_write (dhandle, &stab_fns, (PTR) &info)) - return false; + if (! debug_write (dhandle, &stab_fns, (void *) &info)) + return FALSE; assert (info.pending_lbrac == (bfd_vma) -1); /* Output a trailing N_SO. */ if (! stab_write_symbol (&info, N_SO, 0, info.last_text_address, (const char *) NULL)) - return false; + return FALSE; /* Put the string size in the initial symbol. */ bfd_put_32 (abfd, info.strings_size, info.symbols + 8); @@ -556,15 +534,13 @@ write_stabs_in_sections_debugging_info (abfd, dhandle, psyms, psymsize, p += strlen ((char *) p) + 1; } - return true; + return TRUE; } /* Start writing out information for a compilation unit. */ -static boolean -stab_start_compilation_unit (p, filename) - PTR p; - const char *filename; +static bfd_boolean +stab_start_compilation_unit (void *p, const char *filename) { struct stab_write_handle *info = (struct stab_write_handle *) p; @@ -580,10 +556,8 @@ stab_start_compilation_unit (p, filename) /* Start writing out information for a particular source file. */ -static boolean -stab_start_source (p, filename) - PTR p; - const char *filename; +static bfd_boolean +stab_start_source (void *p, const char *filename) { struct stab_write_handle *info = (struct stab_write_handle *) p; @@ -599,9 +573,8 @@ stab_start_source (p, filename) /* Push an empty type. This shouldn't normally happen. We just use a void type. */ -static boolean -stab_empty_type (p) - PTR p; +static bfd_boolean +stab_empty_type (void *p) { struct stab_write_handle *info = (struct stab_write_handle *) p; @@ -620,15 +593,14 @@ stab_empty_type (p) sprintf (buf, "%ld=%ld", index, index); - return stab_push_string (info, buf, index, false, 0); + return stab_push_string (info, buf, index, FALSE, 0); } } /* Push a void type. */ -static boolean -stab_void_type (p) - PTR p; +static bfd_boolean +stab_void_type (void *p) { struct stab_write_handle *info = (struct stab_write_handle *) p; @@ -646,17 +618,14 @@ stab_void_type (p) sprintf (buf, "%ld=%ld", index, index); - return stab_push_string (info, buf, index, true, 0); + return stab_push_string (info, buf, index, TRUE, 0); } } /* Push an integer type. */ -static boolean -stab_int_type (p, size, unsignedp) - PTR p; - unsigned int size; - boolean unsignedp; +static bfd_boolean +stab_int_type (void *p, unsigned int size, bfd_boolean unsignedp) { struct stab_write_handle *info = (struct stab_write_handle *) p; long *cache; @@ -664,7 +633,7 @@ stab_int_type (p, size, unsignedp) if (size <= 0 || (size > sizeof (long) && size != 8)) { non_fatal (_("stab_int_type: bad size %u"), size); - return false; + return FALSE; } if (unsignedp) @@ -709,16 +678,14 @@ stab_int_type (p, size, unsignedp) abort (); } - return stab_push_string (info, buf, index, true, size); + return stab_push_string (info, buf, index, TRUE, size); } } /* Push a floating point type. */ -static boolean -stab_float_type (p, size) - PTR p; - unsigned int size; +static bfd_boolean +stab_float_type (void *p, unsigned int size) { struct stab_write_handle *info = (struct stab_write_handle *) p; @@ -736,8 +703,8 @@ stab_float_type (p, size) char buf[50]; /* Floats are defined as a subrange of int. */ - if (! stab_int_type (info, 4, false)) - return false; + if (! stab_int_type (info, 4, FALSE)) + return FALSE; int_type = stab_pop_type (info); index = info->type_index; @@ -752,16 +719,14 @@ stab_float_type (p, size) free (int_type); - return stab_push_string (info, buf, index, true, size); + return stab_push_string (info, buf, index, TRUE, size); } } /* Push a complex type. */ -static boolean -stab_complex_type (p, size) - PTR p; - unsigned int size; +static bfd_boolean +stab_complex_type (void *p, unsigned int size) { struct stab_write_handle *info = (struct stab_write_handle *) p; char buf[50]; @@ -772,16 +737,14 @@ stab_complex_type (p, size) sprintf (buf, "%ld=r%ld;%u;0;", index, index, size); - return stab_push_string (info, buf, index, true, size * 2); + return stab_push_string (info, buf, index, TRUE, size * 2); } -/* Push a boolean type. We use an XCOFF predefined type, since gdb +/* Push a bfd_boolean type. We use an XCOFF predefined type, since gdb always recognizes them. */ -static boolean -stab_bool_type (p, size) - PTR p; - unsigned int size; +static bfd_boolean +stab_bool_type (void *p, unsigned int size) { struct stab_write_handle *info = (struct stab_write_handle *) p; long index; @@ -811,12 +774,9 @@ stab_bool_type (p, size) /* Push an enum type. */ -static boolean -stab_enum_type (p, tag, names, vals) - PTR p; - const char *tag; - const char **names; - bfd_signed_vma *vals; +static bfd_boolean +stab_enum_type (void *p, const char *tag, const char **names, + bfd_signed_vma *vals) { struct stab_write_handle *info = (struct stab_write_handle *) p; size_t len; @@ -832,10 +792,10 @@ stab_enum_type (p, tag, names, vals) buf = (char *) xmalloc (10 + strlen (tag)); sprintf (buf, "xe%s:", tag); /* FIXME: The size is just a guess. */ - if (! stab_push_string (info, buf, 0, false, 4)) - return false; + if (! stab_push_string (info, buf, 0, FALSE, 4)) + return FALSE; free (buf); - return true; + return TRUE; } len = 10; @@ -862,32 +822,28 @@ stab_enum_type (p, tag, names, vals) if (tag == NULL) { /* FIXME: The size is just a guess. */ - if (! stab_push_string (info, buf, 0, false, 4)) - return false; + if (! stab_push_string (info, buf, 0, FALSE, 4)) + return FALSE; } else { /* FIXME: The size is just a guess. */ if (! stab_write_symbol (info, N_LSYM, 0, 0, buf) || ! stab_push_defined_type (info, index, 4)) - return false; + return FALSE; } free (buf); - return true; + return TRUE; } /* Push a modification of the top type on the stack. Cache the results in CACHE and CACHE_ALLOC. */ -static boolean -stab_modify_type (info, mod, size, cache, cache_alloc) - struct stab_write_handle *info; - int mod; - unsigned int size; - long **cache; - size_t *cache_alloc; +static bfd_boolean +stab_modify_type (struct stab_write_handle *info, int mod, + unsigned int size, long **cache, size_t *cache_alloc) { long targindex; long index; @@ -899,7 +855,7 @@ stab_modify_type (info, mod, size, cache, cache_alloc) if (targindex <= 0 || cache == NULL) { - boolean definition; + bfd_boolean definition; /* Either the target type has no index, or we aren't caching this modifier. Either way we have no way of recording the @@ -910,7 +866,7 @@ stab_modify_type (info, mod, size, cache, cache_alloc) sprintf (buf, "%c%s", mod, s); free (s); if (! stab_push_string (info, buf, 0, definition, size)) - return false; + return FALSE; free (buf); } else @@ -941,7 +897,7 @@ stab_modify_type (info, mod, size, cache, cache_alloc) referenced). */ free (stab_pop_type (info)); if (! stab_push_defined_type (info, index, size)) - return false; + return FALSE; } else { @@ -955,21 +911,20 @@ stab_modify_type (info, mod, size, cache, cache_alloc) (*cache)[targindex] = index; - if (! stab_push_string (info, buf, index, true, size)) - return false; + if (! stab_push_string (info, buf, index, TRUE, size)) + return FALSE; free (buf); } } - return true; + return TRUE; } /* Push a pointer type. */ -static boolean -stab_pointer_type (p) - PTR p; +static bfd_boolean +stab_pointer_type (void *p) { struct stab_write_handle *info = (struct stab_write_handle *) p; @@ -980,11 +935,9 @@ stab_pointer_type (p) /* Push a function type. */ -static boolean -stab_function_type (p, argcount, varargs) - PTR p; - int argcount; - boolean varargs ATTRIBUTE_UNUSED; +static bfd_boolean +stab_function_type (void *p, int argcount, + bfd_boolean varargs ATTRIBUTE_UNUSED) { struct stab_write_handle *info = (struct stab_write_handle *) p; int i; @@ -1007,7 +960,7 @@ stab_function_type (p, argcount, varargs) free (s); if (! stab_write_symbol (info, N_LSYM, 0, 0, buf)) - return false; + return FALSE; free (buf); } @@ -1019,9 +972,8 @@ stab_function_type (p, argcount, varargs) /* Push a reference type. */ -static boolean -stab_reference_type (p) - PTR p; +static bfd_boolean +stab_reference_type (void *p) { struct stab_write_handle *info = (struct stab_write_handle *) p; @@ -1032,14 +984,11 @@ stab_reference_type (p) /* Push a range type. */ -static boolean -stab_range_type (p, low, high) - PTR p; - bfd_signed_vma low; - bfd_signed_vma high; +static bfd_boolean +stab_range_type (void *p, bfd_signed_vma low, bfd_signed_vma high) { struct stab_write_handle *info = (struct stab_write_handle *) p; - boolean definition; + bfd_boolean definition; unsigned int size; char *s, *buf; @@ -1052,24 +1001,21 @@ stab_range_type (p, low, high) free (s); if (! stab_push_string (info, buf, 0, definition, size)) - return false; + return FALSE; free (buf); - return true; + return TRUE; } /* Push an array type. */ -static boolean -stab_array_type (p, low, high, stringp) - PTR p; - bfd_signed_vma low; - bfd_signed_vma high; - boolean stringp; +static bfd_boolean +stab_array_type (void *p, bfd_signed_vma low, bfd_signed_vma high, + bfd_boolean stringp) { struct stab_write_handle *info = (struct stab_write_handle *) p; - boolean definition; + bfd_boolean definition; unsigned int element_size; char *range, *element, *buf; long index; @@ -1095,7 +1041,7 @@ stab_array_type (p, low, high, stringp) attribute. */ index = info->type_index; ++info->type_index; - definition = true; + definition = TRUE; sprintf (buf, "%ld=@S;", index); } @@ -1109,22 +1055,20 @@ stab_array_type (p, low, high, stringp) else size = element_size * ((high - low) + 1); if (! stab_push_string (info, buf, index, definition, size)) - return false; + return FALSE; free (buf); - return true; + return TRUE; } /* Push a set type. */ -static boolean -stab_set_type (p, bitstringp) - PTR p; - boolean bitstringp; +static bfd_boolean +stab_set_type (void *p, bfd_boolean bitstringp) { struct stab_write_handle *info = (struct stab_write_handle *) p; - boolean definition; + bfd_boolean definition; char *s, *buf; long index; @@ -1144,7 +1088,7 @@ stab_set_type (p, bitstringp) attribute. */ index = info->type_index; ++info->type_index; - definition = true; + definition = TRUE; sprintf (buf, "%ld=@S;", index); } @@ -1152,21 +1096,20 @@ stab_set_type (p, bitstringp) free (s); if (! stab_push_string (info, buf, index, definition, 0)) - return false; + return FALSE; free (buf); - return true; + return TRUE; } /* Push an offset type. */ -static boolean -stab_offset_type (p) - PTR p; +static bfd_boolean +stab_offset_type (void *p) { struct stab_write_handle *info = (struct stab_write_handle *) p; - boolean definition; + bfd_boolean definition; char *target, *base, *buf; definition = info->type_stack->definition; @@ -1181,24 +1124,21 @@ stab_offset_type (p) free (target); if (! stab_push_string (info, buf, 0, definition, 0)) - return false; + return FALSE; free (buf); - return true; + return TRUE; } /* Push a method type. */ -static boolean -stab_method_type (p, domainp, argcount, varargs) - PTR p; - boolean domainp; - int argcount; - boolean varargs; +static bfd_boolean +stab_method_type (void *p, bfd_boolean domainp, int argcount, + bfd_boolean varargs) { struct stab_write_handle *info = (struct stab_write_handle *) p; - boolean definition; + bfd_boolean definition; char *domain, *return_type, *buf; char **args; int i; @@ -1213,7 +1153,7 @@ stab_method_type (p, domainp, argcount, varargs) if (! domainp) { if (! stab_empty_type (p)) - return false; + return FALSE; } definition = info->type_stack->definition; @@ -1235,7 +1175,7 @@ stab_method_type (p, domainp, argcount, varargs) { args = (char **) xmalloc (1 * sizeof (*args)); if (! stab_empty_type (p)) - return false; + return FALSE; definition = definition || info->type_stack->definition; args[0] = stab_pop_type (info); argcount = 1; @@ -1252,7 +1192,7 @@ stab_method_type (p, domainp, argcount, varargs) if (! varargs) { if (! stab_empty_type (p)) - return false; + return FALSE; definition = definition || info->type_stack->definition; args[argcount] = stab_pop_type (info); ++argcount; @@ -1283,18 +1223,17 @@ stab_method_type (p, domainp, argcount, varargs) free (args); if (! stab_push_string (info, buf, 0, definition, 0)) - return false; + return FALSE; free (buf); - return true; + return TRUE; } /* Push a const version of a type. */ -static boolean -stab_const_type (p) - PTR p; +static bfd_boolean +stab_const_type (void *p) { struct stab_write_handle *info = (struct stab_write_handle *) p; @@ -1304,9 +1243,8 @@ stab_const_type (p) /* Push a volatile version of a type. */ -static boolean -stab_volatile_type (p) - PTR p; +static bfd_boolean +stab_volatile_type (void *p) { struct stab_write_handle *info = (struct stab_write_handle *) p; @@ -1318,12 +1256,9 @@ stab_volatile_type (p) return -1 if it fails. */ static long -stab_get_struct_index (info, tag, id, kind, psize) - struct stab_write_handle *info; - const char *tag; - unsigned int id; - enum debug_type_kind kind; - unsigned int *psize; +stab_get_struct_index (struct stab_write_handle *info, const char *tag, + unsigned int id, enum debug_type_kind kind, + unsigned int *psize) { if (id >= info->type_cache.struct_types_alloc) { @@ -1368,17 +1303,13 @@ stab_get_struct_index (info, tag, id, kind, psize) /* Start outputting a struct. We ignore the tag, and handle it in stab_tag. */ -static boolean -stab_start_struct_type (p, tag, id, structp, size) - PTR p; - const char *tag; - unsigned int id; - boolean structp; - unsigned int size; +static bfd_boolean +stab_start_struct_type (void *p, const char *tag, unsigned int id, + bfd_boolean structp, unsigned int size) { struct stab_write_handle *info = (struct stab_write_handle *) p; long index; - boolean definition; + bfd_boolean definition; char *buf; buf = (char *) xmalloc (40); @@ -1387,16 +1318,16 @@ stab_start_struct_type (p, tag, id, structp, size) { index = 0; *buf = '\0'; - definition = false; + definition = FALSE; } else { index = stab_get_struct_index (info, tag, id, DEBUG_KIND_ILLEGAL, &size); if (index < 0) - return false; + return FALSE; sprintf (buf, "%ld=", index); - definition = true; + definition = TRUE; } sprintf (buf + strlen (buf), "%c%u", @@ -1404,26 +1335,22 @@ stab_start_struct_type (p, tag, id, structp, size) size); if (! stab_push_string (info, buf, index, definition, size)) - return false; + return FALSE; info->type_stack->fields = (char *) xmalloc (1); info->type_stack->fields[0] = '\0'; - return true; + return TRUE; } /* Add a field to a struct. */ -static boolean -stab_struct_field (p, name, bitpos, bitsize, visibility) - PTR p; - const char *name; - bfd_vma bitpos; - bfd_vma bitsize; - enum debug_visibility visibility; +static bfd_boolean +stab_struct_field (void *p, const char *name, bfd_vma bitpos, + bfd_vma bitsize, enum debug_visibility visibility) { struct stab_write_handle *info = (struct stab_write_handle *) p; - boolean definition; + bfd_boolean definition; unsigned int size; char *s, *n; const char *vis; @@ -1474,19 +1401,18 @@ stab_struct_field (p, name, bitpos, bitsize, visibility) info->type_stack->fields = n; if (definition) - info->type_stack->definition = true; + info->type_stack->definition = TRUE; - return true; + return TRUE; } /* Finish up a struct. */ -static boolean -stab_end_struct_type (p) - PTR p; +static bfd_boolean +stab_end_struct_type (void *p) { struct stab_write_handle *info = (struct stab_write_handle *) p; - boolean definition; + bfd_boolean definition; long index; unsigned int size; char *fields, *first, *buf; @@ -1505,32 +1431,25 @@ stab_end_struct_type (p) free (fields); if (! stab_push_string (info, buf, index, definition, size)) - return false; + return FALSE; free (buf); - return true; + return TRUE; } /* Start outputting a class. */ -static boolean -stab_start_class_type (p, tag, id, structp, size, vptr, ownvptr) - PTR p; - const char *tag; - unsigned int id; - boolean structp; - unsigned int size; - boolean vptr; - boolean ownvptr; +static bfd_boolean +stab_start_class_type (void *p, const char *tag, unsigned int id, bfd_boolean structp, unsigned int size, bfd_boolean vptr, bfd_boolean ownvptr) { struct stab_write_handle *info = (struct stab_write_handle *) p; - boolean definition; + bfd_boolean definition; char *vstring; if (! vptr || ownvptr) { - definition = false; + definition = FALSE; vstring = NULL; } else @@ -1540,7 +1459,7 @@ stab_start_class_type (p, tag, id, structp, size, vptr, ownvptr) } if (! stab_start_struct_type (p, tag, id, structp, size)) - return false; + return FALSE; if (vptr) { @@ -1563,22 +1482,19 @@ stab_start_class_type (p, tag, id, structp, size, vptr, ownvptr) } if (definition) - info->type_stack->definition = true; + info->type_stack->definition = TRUE; - return true; + return TRUE; } /* Add a static member to the class on the type stack. */ -static boolean -stab_class_static_member (p, name, physname, visibility) - PTR p; - const char *name; - const char *physname; - enum debug_visibility visibility; +static bfd_boolean +stab_class_static_member (void *p, const char *name, const char *physname, + enum debug_visibility visibility) { struct stab_write_handle *info = (struct stab_write_handle *) p; - boolean definition; + bfd_boolean definition; char *s, *n; const char *vis; @@ -1620,22 +1536,19 @@ stab_class_static_member (p, name, physname, visibility) info->type_stack->fields = n; if (definition) - info->type_stack->definition = true; + info->type_stack->definition = TRUE; - return true; + return TRUE; } /* Add a base class to the class on the type stack. */ -static boolean -stab_class_baseclass (p, bitpos, virtual, visibility) - PTR p; - bfd_vma bitpos; - boolean virtual; - enum debug_visibility visibility; +static bfd_boolean +stab_class_baseclass (void *p, bfd_vma bitpos, bfd_boolean virtual, + enum debug_visibility visibility) { struct stab_write_handle *info = (struct stab_write_handle *) p; - boolean definition; + bfd_boolean definition; char *s; char *buf; unsigned int c; @@ -1690,17 +1603,15 @@ stab_class_baseclass (p, bitpos, virtual, visibility) info->type_stack->baseclasses = baseclasses; if (definition) - info->type_stack->definition = true; + info->type_stack->definition = TRUE; - return true; + return TRUE; } /* Start adding a method to the class on the type stack. */ -static boolean -stab_class_start_method (p, name) - PTR p; - const char *name; +static bfd_boolean +stab_class_start_method (void *p, const char *name) { struct stab_write_handle *info = (struct stab_write_handle *) p; char *m; @@ -1724,24 +1635,19 @@ stab_class_start_method (p, name) info->type_stack->methods = m; - return true; + return TRUE; } /* Add a variant, either static or not, to the current method. */ -static boolean -stab_class_method_var (info, physname, visibility, staticp, constp, volatilep, - voffset, contextp) - struct stab_write_handle *info; - const char *physname; - enum debug_visibility visibility; - boolean staticp; - boolean constp; - boolean volatilep; - bfd_vma voffset; - boolean contextp; +static bfd_boolean +stab_class_method_var (struct stab_write_handle *info, const char *physname, + enum debug_visibility visibility, + bfd_boolean staticp, bfd_boolean constp, + bfd_boolean volatilep, bfd_vma voffset, + bfd_boolean contextp) { - boolean definition; + bfd_boolean definition; char *type; char *context = NULL; char visc, qualc, typec; @@ -1817,51 +1723,42 @@ stab_class_method_var (info, physname, visibility, staticp, constp, volatilep, } if (definition) - info->type_stack->definition = true; + info->type_stack->definition = TRUE; - return true; + return TRUE; } /* Add a variant to the current method. */ -static boolean -stab_class_method_variant (p, physname, visibility, constp, volatilep, - voffset, contextp) - PTR p; - const char *physname; - enum debug_visibility visibility; - boolean constp; - boolean volatilep; - bfd_vma voffset; - boolean contextp; +static bfd_boolean +stab_class_method_variant (void *p, const char *physname, + enum debug_visibility visibility, + bfd_boolean constp, bfd_boolean volatilep, + bfd_vma voffset, bfd_boolean contextp) { struct stab_write_handle *info = (struct stab_write_handle *) p; - return stab_class_method_var (info, physname, visibility, false, constp, + return stab_class_method_var (info, physname, visibility, FALSE, constp, volatilep, voffset, contextp); } /* Add a static variant to the current method. */ -static boolean -stab_class_static_method_variant (p, physname, visibility, constp, volatilep) - PTR p; - const char *physname; - enum debug_visibility visibility; - boolean constp; - boolean volatilep; +static bfd_boolean +stab_class_static_method_variant (void *p, const char *physname, + enum debug_visibility visibility, + bfd_boolean constp, bfd_boolean volatilep) { struct stab_write_handle *info = (struct stab_write_handle *) p; - return stab_class_method_var (info, physname, visibility, true, constp, - volatilep, 0, false); + return stab_class_method_var (info, physname, visibility, TRUE, constp, + volatilep, 0, FALSE); } /* Finish up a method. */ -static boolean -stab_class_end_method (p) - PTR p; +static bfd_boolean +stab_class_end_method (void *p) { struct stab_write_handle *info = (struct stab_write_handle *) p; @@ -1871,14 +1768,13 @@ stab_class_end_method (p) trailing semicolon. */ strcat (info->type_stack->methods, ";"); - return true; + return TRUE; } /* Finish up a class. */ -static boolean -stab_end_class_type (p) - PTR p; +static bfd_boolean +stab_end_class_type (void *p) { struct stab_write_handle *info = (struct stab_write_handle *) p; size_t len; @@ -1946,20 +1842,18 @@ stab_end_class_type (p) free (info->type_stack->string); info->type_stack->string = buf; - return true; + return TRUE; } /* Push a typedef which was previously defined. */ -static boolean -stab_typedef_type (p, name) - PTR p; - const char *name; +static bfd_boolean +stab_typedef_type (void *p, const char *name) { struct stab_write_handle *info = (struct stab_write_handle *) p; struct string_hash_entry *h; - h = string_hash_lookup (&info->typedef_hash, name, false, false); + h = string_hash_lookup (&info->typedef_hash, name, FALSE, FALSE); assert (h != NULL && h->index > 0); return stab_push_defined_type (info, h->index, h->size); @@ -1967,12 +1861,9 @@ stab_typedef_type (p, name) /* Push a struct, union or class tag. */ -static boolean -stab_tag_type (p, name, id, kind) - PTR p; - const char *name; - unsigned int id; - enum debug_type_kind kind; +static bfd_boolean +stab_tag_type (void *p, const char *name, unsigned int id, + enum debug_type_kind kind) { struct stab_write_handle *info = (struct stab_write_handle *) p; long index; @@ -1980,17 +1871,15 @@ stab_tag_type (p, name, id, kind) index = stab_get_struct_index (info, name, id, kind, &size); if (index < 0) - return false; + return FALSE; return stab_push_defined_type (info, index, size); } /* Define a typedef. */ -static boolean -stab_typdef (p, name) - PTR p; - const char *name; +static bfd_boolean +stab_typdef (void *p, const char *name) { struct stab_write_handle *info = (struct stab_write_handle *) p; long index; @@ -2016,16 +1905,16 @@ stab_typdef (p, name) free (s); if (! stab_write_symbol (info, N_LSYM, 0, 0, buf)) - return false; + return FALSE; free (buf); - h = string_hash_lookup (&info->typedef_hash, name, true, false); + h = string_hash_lookup (&info->typedef_hash, name, TRUE, FALSE); if (h == NULL) { non_fatal (_("string_hash_lookup failed: %s"), bfd_errmsg (bfd_get_error ())); - return false; + return FALSE; } /* I don't think we care about redefinitions. */ @@ -2033,15 +1922,13 @@ stab_typdef (p, name) h->index = index; h->size = size; - return true; + return TRUE; } /* Define a tag. */ -static boolean -stab_tag (p, tag) - PTR p; - const char *tag; +static bfd_boolean +stab_tag (void *p, const char *tag) { struct stab_write_handle *info = (struct stab_write_handle *) p; char *s, *buf; @@ -2054,20 +1941,17 @@ stab_tag (p, tag) free (s); if (! stab_write_symbol (info, N_LSYM, 0, 0, buf)) - return false; + return FALSE; free (buf); - return true; + return TRUE; } /* Define an integer constant. */ -static boolean -stab_int_constant (p, name, val) - PTR p; - const char *name; - bfd_vma val; +static bfd_boolean +stab_int_constant (void *p, const char *name, bfd_vma val) { struct stab_write_handle *info = (struct stab_write_handle *) p; char *buf; @@ -2076,20 +1960,17 @@ stab_int_constant (p, name, val) sprintf (buf, "%s:c=i%ld", name, (long) val); if (! stab_write_symbol (info, N_LSYM, 0, 0, buf)) - return false; + return FALSE; free (buf); - return true; + return TRUE; } /* Define a floating point constant. */ -static boolean -stab_float_constant (p, name, val) - PTR p; - const char *name; - double val; +static bfd_boolean +stab_float_constant (void *p, const char *name, double val) { struct stab_write_handle *info = (struct stab_write_handle *) p; char *buf; @@ -2098,20 +1979,17 @@ stab_float_constant (p, name, val) sprintf (buf, "%s:c=f%g", name, val); if (! stab_write_symbol (info, N_LSYM, 0, 0, buf)) - return false; + return FALSE; free (buf); - return true; + return TRUE; } /* Define a typed constant. */ -static boolean -stab_typed_constant (p, name, val) - PTR p; - const char *name; - bfd_vma val; +static bfd_boolean +stab_typed_constant (void *p, const char *name, bfd_vma val) { struct stab_write_handle *info = (struct stab_write_handle *) p; char *s, *buf; @@ -2123,21 +2001,18 @@ stab_typed_constant (p, name, val) free (s); if (! stab_write_symbol (info, N_LSYM, 0, 0, buf)) - return false; + return FALSE; free (buf); - return true; + return TRUE; } /* Record a variable. */ -static boolean -stab_variable (p, name, kind, val) - PTR p; - const char *name; - enum debug_var_kind kind; - bfd_vma val; +static bfd_boolean +stab_variable (void *p, const char *name, enum debug_var_kind kind, + bfd_vma val) { struct stab_write_handle *info = (struct stab_write_handle *) p; char *s, *buf; @@ -2196,20 +2071,17 @@ stab_variable (p, name, kind, val) free (s); if (! stab_write_symbol (info, stab_type, 0, val, buf)) - return false; + return FALSE; free (buf); - return true; + return TRUE; } /* Start outputting a function. */ -static boolean -stab_start_function (p, name, globalp) - PTR p; - const char *name; - boolean globalp; +static bfd_boolean +stab_start_function (void *p, const char *name, bfd_boolean globalp) { struct stab_write_handle *info = (struct stab_write_handle *) p; char *rettype, *buf; @@ -2227,21 +2099,17 @@ stab_start_function (p, name, globalp) info->fun_offset = info->symbols_size; if (! stab_write_symbol (info, N_FUN, 0, 0, buf)) - return false; + return FALSE; free (buf); - return true; + return TRUE; } /* Output a function parameter. */ -static boolean -stab_function_parameter (p, name, kind, val) - PTR p; - const char *name; - enum debug_parm_kind kind; - bfd_vma val; +static bfd_boolean +stab_function_parameter (void *p, const char *name, enum debug_parm_kind kind, bfd_vma val) { struct stab_write_handle *info = (struct stab_write_handle *) p; char *s, *buf; @@ -2281,19 +2149,17 @@ stab_function_parameter (p, name, kind, val) free (s); if (! stab_write_symbol (info, stab_type, 0, val, buf)) - return false; + return FALSE; free (buf); - return true; + return TRUE; } /* Start a block. */ -static boolean -stab_start_block (p, addr) - PTR p; - bfd_vma addr; +static bfd_boolean +stab_start_block (void *p, bfd_vma addr) { struct stab_write_handle *info = (struct stab_write_handle *) p; @@ -2321,7 +2187,7 @@ stab_start_block (p, addr) if (info->nesting == 1) { info->fnaddr = addr; - return true; + return TRUE; } /* We have to output the LBRAC symbol after any variables which are @@ -2333,22 +2199,20 @@ stab_start_block (p, addr) { if (! stab_write_symbol (info, N_LBRAC, 0, info->pending_lbrac, (const char *) NULL)) - return false; + return FALSE; } /* Remember the address and output it later. */ info->pending_lbrac = addr - info->fnaddr; - return true; + return TRUE; } /* End a block. */ -static boolean -stab_end_block (p, addr) - PTR p; - bfd_vma addr; +static bfd_boolean +stab_end_block (void *p, bfd_vma addr) { struct stab_write_handle *info = (struct stab_write_handle *) p; @@ -2360,7 +2224,7 @@ stab_end_block (p, addr) { if (! stab_write_symbol (info, N_LBRAC, 0, info->pending_lbrac, (const char *) NULL)) - return false; + return FALSE; info->pending_lbrac = (bfd_vma) -1; } @@ -2370,7 +2234,7 @@ stab_end_block (p, addr) /* We ignore the outermost block. */ if (info->nesting == 0) - return true; + return TRUE; return stab_write_symbol (info, N_RBRAC, 0, addr - info->fnaddr, (const char *) NULL); @@ -2378,21 +2242,16 @@ stab_end_block (p, addr) /* End a function. */ -static boolean -stab_end_function (p) - PTR p ATTRIBUTE_UNUSED; +static bfd_boolean +stab_end_function (void *p ATTRIBUTE_UNUSED) { - return true; + return TRUE; } /* Output a line number. */ -static boolean -stab_lineno (p, file, lineno, addr) - PTR p; - const char *file; - unsigned long lineno; - bfd_vma addr; +static bfd_boolean +stab_lineno (void *p, const char *file, unsigned long lineno, bfd_vma addr) { struct stab_write_handle *info = (struct stab_write_handle *) p; @@ -2404,7 +2263,7 @@ stab_lineno (p, file, lineno, addr) if (strcmp (file, info->lineno_filename) != 0) { if (! stab_write_symbol (info, N_SOL, 0, addr, file)) - return false; + return FALSE; info->lineno_filename = file; } diff --git a/contrib/binutils/config-ml.in b/contrib/binutils/config-ml.in index aae3f87..b2e4ea9 100644 --- a/contrib/binutils/config-ml.in +++ b/contrib/binutils/config-ml.in @@ -1,6 +1,32 @@ # Configure fragment invoked in the post-target section for subdirs # wanting multilib support. # +# Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. +# +# Please report bugs to +# and send patches to . + # It is advisable to support a few --enable/--disable options to let the # user select which libraries s/he really wants. # @@ -17,8 +43,6 @@ # . ${srcdir}/../config-ml.in # fi # -# See librx/configure.in in the libg++ distribution for an example of how -# to handle autoconf'd libraries. # # Things are complicated because 6 separate cases must be handled: # 2 (native, cross) x 3 (absolute-path, relative-not-dot, dot) = 6. @@ -30,13 +54,10 @@ # The build tree is layed out as # # ./ -# libg++ # newlib # m68020/ -# libg++ # newlib # m68881/ -# libg++ # newlib # # The nice feature about this arrangement is that inter-library references @@ -69,11 +90,6 @@ # newlib. It is up to each target to turn on multilib support for the other # libraries as desired. -# We have to handle being invoked by both Cygnus configure and Autoconf. -# -# Cygnus configure incoming variables: -# srcdir, subdir, host, arguments -# # Autoconf incoming variables: # srcdir, host, ac_configure_args # @@ -83,26 +99,14 @@ # Note that `host' in this case is GCC's `target'. Target libraries are # configured for a particular host. -if [ -n "${ac_configure_args}" ]; then - Makefile=${ac_file-Makefile} - ml_config_shell=${CONFIG_SHELL-/bin/sh} - ml_arguments="${ac_configure_args}" - ml_realsrcdir=${srcdir} -else - Makefile=${Makefile-Makefile} - ml_config_shell=${config_shell-/bin/sh} - ml_arguments="${arguments}" - if [ -n "${subdir}" -a "${subdir}" != "." ] ; then - ml_realsrcdir=${srcdir}/${subdir} - else - ml_realsrcdir=${srcdir} - fi -fi +Makefile=${ac_file-Makefile} +ml_config_shell=${CONFIG_SHELL-/bin/sh} +ml_realsrcdir=${srcdir} # Scan all the arguments and set all the ones we need. ml_verbose=--verbose -for option in ${ml_arguments} +for option in ${ac_configure_args} do case $option in --*) ;; @@ -128,7 +132,7 @@ do enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'` eval $enableopt="$optarg" ;; - --norecursion | --no*) + --norecursion | --no-recursion) ml_norecursion=yes ;; --silent | --sil* | --quiet | --q*) @@ -156,7 +160,7 @@ done if [ "${enable_multilib}" = yes ]; then # Compute whether this is the library's top level directory -# (ie: not a multilib subdirectory, and not a subdirectory like libg++/src). +# (ie: not a multilib subdirectory, and not a subdirectory like newlib/src). # ${with_multisubdir} tells us we're in the right branch, but we could be # in a subdir of that. # ??? The previous version could void this test by separating the process into @@ -397,6 +401,28 @@ mips*-*-*) esac ;; powerpc*-*-* | rs6000*-*-*) + if [ x$enable_aix64 = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *ppc64* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + if [ x$enable_pthread = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *pthread* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi if [ x$enable_softfloat = xno ] then old_multidirs="${multidirs}" @@ -463,17 +489,6 @@ powerpc*-*-* | rs6000*-*-*) esac done fi - if [ x$enable_aix = xno ] - then - old_multidirs="${multidirs}" - multidirs="" - for x in ${old_multidirs}; do - case "$x" in - *mcall-aix* ) : ;; - *) multidirs="${multidirs} ${x}" ;; - esac - done - fi ;; sparc*-*-*) case " $multidirs " in @@ -510,7 +525,7 @@ multidirs=`echo "$multidirs" | sed -e 's/^[ ][ ]*//' -e 's/[ ][ ]*$//' -e 's/[ ] cat > Multi.tem <<\EOF -PWD=$${PWDCMD-pwd} +PWD_COMMAND=$${PWDCMD-pwd} # FIXME: There should be an @-sign in front of the `if'. # Leave out until this is tested a bit more. @@ -518,8 +533,8 @@ multi-do: if [ -z "$(MULTIDIRS)" ]; then \ true; \ else \ - rootpre=`${PWD}`/; export rootpre; \ - srcrootpre=`cd $(srcdir); ${PWD}`/; export srcrootpre; \ + rootpre=`${PWD_COMMAND}`/; export rootpre; \ + srcrootpre=`cd $(srcdir); ${PWD_COMMAND}`/; export srcrootpre; \ lib=`echo $${rootpre} | sed -e 's,^.*/\([^/][^/]*\)/$$,\1,'`; \ compiler="$(CC)"; \ for i in `$${compiler} --print-multi-lib 2>/dev/null`; do \ @@ -533,11 +548,17 @@ multi-do: CFLAGS="$(CFLAGS) $${flags}" \ prefix="$(prefix)" \ exec_prefix="$(exec_prefix)" \ + GCJFLAGS="$(GCJFLAGS) $${flags}" \ CXXFLAGS="$(CXXFLAGS) $${flags}" \ LIBCFLAGS="$(LIBCFLAGS) $${flags}" \ LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \ LDFLAGS="$(LDFLAGS) $${flags}" \ + MULTIFLAGS="$${flags}" \ DESTDIR="$(DESTDIR)" \ + INSTALL="$(INSTALL)" \ + INSTALL_DATA="$(INSTALL_DATA)" \ + INSTALL_PROGRAM="$(INSTALL_PROGRAM)" \ + INSTALL_SCRIPT="$(INSTALL_SCRIPT)" \ $(DO)); then \ true; \ else \ @@ -555,7 +576,7 @@ multi-clean: if [ -z "$(MULTIDIRS)" ]; then \ true; \ else \ - lib=`${PWD} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \ + lib=`${PWD_COMMAND} | sed -e 's,^.*/\([^/][^/]*\)$$,\1,'`; \ for dir in Makefile $(MULTIDIRS); do \ if [ -f ../$${dir}/$${lib}/Makefile ]; then \ if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) $(DO)); \ @@ -723,7 +744,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then ;; *) case "${srcdir}" in - /*) # absolute path + /* | [A-Za-z]:[\\/]* ) # absolute path ml_newsrcdir=${srcdir} ;; *) # otherwise relative @@ -736,31 +757,32 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then esac case "${progname}" in - /*) ml_recprog=${progname} ;; + /* | [A-Za-z]:[\\/]* ) ml_recprog=${progname} ;; *) ml_recprog=${dotdot}${progname} ;; esac # FIXME: POPDIR=${PWD=`pwd`} doesn't work here. - ML_POPDIR=`pwd` + ML_POPDIR=`${PWDCMD-pwd}` cd ${ml_dir}/${ml_libdir} if [ -f ${ml_newsrcdir}/configure ]; then - ml_recprog="${ml_newsrcdir}/configure --cache-file=../config.cache" + ml_recprog="${ml_newsrcdir}/configure" fi # find compiler flag corresponding to ${ml_dir} - for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do + 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"' + ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags" GCJ="${GCJ_}$flags"' if [ "${with_target_subdir}" = "." ]; then CC_=$CC' ' CXX_=$CXX' ' + GCJ_=$GCJ' ' else # Create a regular expression that matches any string as long # as ML_POPDIR. @@ -789,6 +811,18 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then esac done + GCJ_= + for arg in ${GCJ}; do + case $arg in + -[BIL]"${ML_POPDIR}"/*) + GCJ_="${GCJ_}"`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}"/*) + GCJ_="${GCJ_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; + *) + GCJ_="${GCJ_}${arg} " ;; + esac + done + if test "x${LD_LIBRARY_PATH+set}" = xset; then LD_LIBRARY_PATH_= for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do @@ -826,7 +860,7 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \ --with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \ - ${ml_arguments} ${ml_srcdiroption} ; then + ${ac_configure_args} ${ml_srcdiroption} ; then true else exit 1 diff --git a/contrib/binutils/config.guess b/contrib/binutils/config.guess index fbad77f..00ccf89 100755 --- a/contrib/binutils/config.guess +++ b/contrib/binutils/config.guess @@ -1,9 +1,9 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2002-05-22' +timestamp='2004-02-16' # 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 @@ -88,30 +88,42 @@ if test $# != 0; then exit 1 fi +trap 'exit 1' 1 2 15 -dummy=dummy-$$ -trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. -# CC_FOR_BUILD -- compiler used by this script. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. -set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int dummy(){}" > $dummy.c ; +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do - ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; - if test $? = 0 ; then + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; - rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac' +esac ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) @@ -168,18 +180,35 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # The OS release - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; + amd64:OpenBSD:*:*) + echo x86_64-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; amiga:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; arc:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + cats:OpenBSD:*:*) + echo arm-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -198,6 +227,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in mvmeppc:OpenBSD:*:*) echo powerpc-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + pegasos:OpenBSD:*:*) + echo powerpc-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; pmax:OpenBSD:*:*) echo mipsel-unknown-openbsd${UNAME_RELEASE} exit 0 ;; @@ -213,69 +245,65 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:OpenBSD:*:*) echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} exit 0 ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit 0 ;; + macppc:MirBSD:*:*) + echo powerppc-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit 0 ;; alpha:OSF1:*:*) if test $UNAME_RELEASE = "V4.0"; then UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` fi + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - cat <$dummy.s - .data -\$Lformat: - .byte 37,100,45,37,120,10,0 # "%d-%x\n" - - .text - .globl main - .align 4 - .ent main -main: - .frame \$30,16,\$26,0 - ldgp \$29,0(\$27) - .prologue 1 - .long 0x47e03d80 # implver \$0 - lda \$2,-1 - .long 0x47e20c21 # amask \$2,\$1 - lda \$16,\$Lformat - mov \$0,\$17 - not \$1,\$18 - jsr \$26,printf - ldgp \$29,0(\$26) - mov 0,\$16 - jsr \$26,exit - .end main -EOF - eval $set_cc_for_build - $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null - if test "$?" = 0 ; then - case `./$dummy` in - 0-0) - UNAME_MACHINE="alpha" - ;; - 1-0) - UNAME_MACHINE="alphaev5" - ;; - 1-1) - UNAME_MACHINE="alphaev56" - ;; - 1-101) - UNAME_MACHINE="alphapca56" - ;; - 2-303) - UNAME_MACHINE="alphaev6" - ;; - 2-307) - UNAME_MACHINE="alphaev67" - ;; - 2-1307) - UNAME_MACHINE="alphaev68" - ;; - esac - fi - rm -f $dummy.s $dummy echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit 0 ;; + Alpha*:OpenVMS:*:*) + echo alpha-hp-vms + exit 0 ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead @@ -297,6 +325,9 @@ EOF *:OS/390:*:*) echo i370-ibm-openedition exit 0 ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit 0 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit 0;; @@ -314,6 +345,13 @@ EOF NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit 0 ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit 0 ;; + DRS?6000:UNIX_SV:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7 && exit 0 ;; + esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; @@ -382,6 +420,9 @@ EOF *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit 0 ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit 0 ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit 0 ;; @@ -420,16 +461,18 @@ EOF exit (-1); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy \ - && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + $CC_FOR_BUILD -o $dummy $dummy.c \ + && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && exit 0 echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit 0 ;; - Night_Hawk:*:*:PowerMAX_OS) + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit 0 ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit 0 ;; Night_Hawk:Power_UNIX:*:*) @@ -504,8 +547,7 @@ EOF exit(0); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo rs6000-ibm-aix3.2.5 elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 @@ -603,11 +645,21 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy` - if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi - rm -f $dummy.c $dummy + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + # avoid double evaluation of $set_cc_for_build + test -n "$CC_FOR_BUILD" || eval $set_cc_for_build + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) @@ -641,8 +693,7 @@ EOF exit (0); } EOF - $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0 - rm -f $dummy.c $dummy + $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 echo unknown-hitachi-hiuxwe2 exit 0 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) @@ -700,21 +751,26 @@ EOF CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; - CRAY*T3D:*:*:*) - echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; + *:UNICOS/mp:*:*) + echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit 0 ;; @@ -725,7 +781,21 @@ EOF echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit 0 ;; *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + # Determine whether the default compiler uses glibc. + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #if __GLIBC__ >= 2 + LIBC=gnu + #else + LIBC= + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` + # GNU/KFreeBSD systems have a "k" prefix to indicate we are using + # FreeBSD's kernel, but not the complete OS. + case ${LIBC} in gnu) kernel_only='k' ;; esac + echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC} exit 0 ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin @@ -736,14 +806,17 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit 0 ;; - x86:Interix*:3*) - echo i386-pc-interix3 + x86:Interix*:[34]*) + echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' + exit 0 ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks exit 0 ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? - echo i386-pc-interix + echo i586-pc-interix exit 0 ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin @@ -755,14 +828,22 @@ EOF echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit 0 ;; *:GNU:*:*) + # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit 0 ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit 0 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -786,8 +867,26 @@ EOF #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - rm -f $dummy.c - test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0 + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` + test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu @@ -823,6 +922,9 @@ EOF s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; @@ -849,7 +951,7 @@ EOF ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; + exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; @@ -880,9 +982,11 @@ EOF LIBC=gnuaout #endif #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - rm -f $dummy.c test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; @@ -900,6 +1004,26 @@ EOF # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit 0 ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit 0 ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit 0 ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit 0 ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit 0 ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then @@ -921,22 +1045,19 @@ EOF UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` - (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 - (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 - (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -960,9 +1081,15 @@ EOF # "miniframe" echo m68010-convergent-sysv exit 0 ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit 0 ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit 0 ;; M68*:*:R3V[567]*:*) test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0) + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` @@ -979,9 +1106,6 @@ EOF mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; @@ -1053,6 +1177,9 @@ EOF SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit 0 ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit 0 ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit 0 ;; @@ -1060,7 +1187,11 @@ EOF echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit 0 ;; *:Darwin:*:*) - echo `uname -p`-apple-darwin${UNAME_RELEASE} + case `uname -p` in + *86) UNAME_PROCESSOR=i686 ;; + powerpc) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` @@ -1073,7 +1204,7 @@ EOF *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; - NSR-[GKLNPTVW]:NONSTOP_KERNEL:*:*) + NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) @@ -1096,11 +1227,6 @@ EOF fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; @@ -1119,11 +1245,11 @@ EOF *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit 0 ;; esac @@ -1245,8 +1371,7 @@ main () } EOF -$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0 -rm -f $dummy.c $dummy +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 # Apollos put the system type in the environment. diff --git a/contrib/binutils/config.if b/contrib/binutils/config.if index 3958928..2655bc3 100644 --- a/contrib/binutils/config.if +++ b/contrib/binutils/config.if @@ -2,9 +2,7 @@ # Don't call it directly. This shell script fragment is called to # determine: # -# 1. libstcxx_interface: the interface name for libstdc++. -# 2. cxx_interface: the interface name for c++. -# 3. libc_interface: the interface name for libc. +# 1. libstcxx_incdir: the interface name for libstdc++. # # Get the top level src dir. @@ -21,73 +19,19 @@ else if_topsrcdir=${top_srcdir} fi -if [ "${enable_libstdcxx_v3}" = "yes" ] ; then - libstdcxx_srcdir=${if_topsrcdir}/libstdc++-v3 -else - libstdcxx_srcdir=${if_topsrcdir}/libstdc++ +# Set libstdcxx_incdir. +# This is the same as gcc/configure.in and libstdc++-v3/acinclude.m4. +if test -z "$gcc_version"; then + if test -z "${gcc_version_trigger}" \ + && test -f ${if_topsrcdir}/gcc/version.c; then + gcc_version_trigger=${if_topsrcdir}/gcc/version.c + fi + if test -f "${gcc_version_trigger}"; then + gcc_version_full=`grep version_string "${gcc_version_trigger}" | sed -e 's/.*"\([^"]*\)".*/\1/'` + else + gcc_version_full=`$CC -v 2>&1 | sed -n 's/^gcc version //p'` + fi + gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'` fi +libstdcxx_incdir=c++/${gcc_version} -if [ -f ${libstdcxx_srcdir}/Makefile.in ]; then -# We check libstdc++ for libstdcxx_interface. -libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'` -else -libstdcxx_interface= -fi - -if [ -f ${if_topsrcdir}/gcc/cp/Makefile.in ]; then -# We check gcc/cp for cxx_interface. -cxx_interface=`grep "^INTERFACE" ${if_topsrcdir}/gcc/cp/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'` -else -cxx_interface= -fi - -# The trickiest part is libc_interface. -if [ -z "${libc_interface}" ] -then - case ${target_os} in - *linux*libc1*|*linux*libc5*) - case ${target_alias} in - *alpha*|*powerpc*) - libc_interface=-libc5.9- - ;; - *) - libc_interface=-libc5- - ;; - esac - ;; - *linux*gnu*) - # We have to work harder to figure it out. - if [ ${target_alias} = ${build_alias} ] - then - dummy=if$$ - cat >$dummy.c < -main(argc, argv) - int argc; - char *argv[]; -{ - printf("%d\n", __GLIBC_MINOR__); - return 0; -} -EOF - ${CC-cc} $dummy.c -o $dummy 2>/dev/null - if [ "$?" = 0 ] - then - libc_interface=-libc6.`./$dummy`- - rm -f $dummy.c $dummy - else - # It should never happen. - echo "Cannot find the GNU C library minor version number." >&2 - rm -f $dummy.c $dummy - exit 1 - fi - else - # Cross compiling. Assume glibc 2.2. - libc_interface=-libc6.2- - fi - ;; - *) - libc_interface=- - ;; - esac -fi diff --git a/contrib/binutils/config.sub b/contrib/binutils/config.sub index 69f444e..d2e3557 100755 --- a/contrib/binutils/config.sub +++ b/contrib/binutils/config.sub @@ -1,9 +1,9 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002 Free Software Foundation, Inc. +# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -timestamp='2002-05-22' +timestamp='2004-02-16' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -118,7 +118,8 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*) + nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ + kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; @@ -228,28 +229,42 @@ case $basic_machine in | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ | m32r | m68000 | m68k | m88k | mcore \ - | mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el | mips64vr4300 \ - | mips64vr4300el | mips64vr5000 | mips64vr5000el \ - | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ - | mipsisa32 | mipsisa64 \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | msp430 \ | ns16k | ns32k \ | openrisc | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ - | sh | sh[34] | sh[34]eb | shbe | shle | sh64 \ + | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ | strongarm \ - | tahoe | thumb | tic80 | tron \ + | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xstormy16 | xtensa \ @@ -284,7 +299,7 @@ case $basic_machine in | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* \ | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c54x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ @@ -292,23 +307,39 @@ case $basic_machine in | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ | m32r-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ - | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ - | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ - | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | msp430-* \ + | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \ + | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ @@ -332,6 +363,9 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; + abacus) + basic_machine=abacus-unknown + ;; adobe68k) basic_machine=m68010-adobe os=-scout @@ -346,6 +380,12 @@ case $basic_machine in basic_machine=a29k-none os=-bsd ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; amdahl) basic_machine=580-amdahl os=-sysv @@ -405,6 +445,10 @@ case $basic_machine in basic_machine=j90-cray os=-unicos ;; + cr16c) + basic_machine=cr16c-unknown + os=-elf + ;; crds | unos) basic_machine=m68k-crds ;; @@ -695,6 +739,10 @@ case $basic_machine in np1) basic_machine=np1-gould ;; + nv1) + basic_machine=nv1-cray + os=-unicosmp + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -706,6 +754,10 @@ case $basic_machine in basic_machine=or32-unknown os=-coff ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose @@ -728,49 +780,55 @@ case $basic_machine in pbb) basic_machine=m68k-tti ;; - pc532 | pc532-*) + pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; - pentiumpro | p6 | 6x86 | athlon) + pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; - pentiumii | pentium2) + pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; + pentium4) + basic_machine=i786-pc + ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - pentiumii-* | pentium2-*) + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown - ;; + ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown - ;; + ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown - ;; + ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown - ;; + ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; @@ -801,6 +859,16 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; sequent) basic_machine=i386-sequent ;; @@ -808,6 +876,9 @@ case $basic_machine in basic_machine=sh-hitachi os=-hms ;; + sh64) + basic_machine=sh64-unknown + ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks @@ -866,7 +937,7 @@ case $basic_machine in sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; - sv1) + sv1) basic_machine=sv1-cray os=-unicos ;; @@ -874,10 +945,6 @@ case $basic_machine in basic_machine=i386-sequent os=-dynix ;; - t3d) - basic_machine=alpha-cray - os=-unicos - ;; t3e) basic_machine=alphaev5-cray os=-unicos @@ -890,6 +957,14 @@ case $basic_machine in basic_machine=tic54x-unknown os=-coff ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -903,6 +978,10 @@ case $basic_machine in tower | tower-32) basic_machine=m68k-ncr ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; udi29k) basic_machine=a29k-amd os=-udi @@ -924,8 +1003,8 @@ case $basic_machine in os=-vms ;; vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; + basic_machine=f301-fujitsu + ;; vxworks960) basic_machine=i960-wrs os=-vxworks @@ -946,11 +1025,7 @@ case $basic_machine in basic_machine=hppa1.1-winbond os=-proelf ;; - windows32) - basic_machine=i386-pc - os=-windows32-msvcrt - ;; - xps | xps100) + xps | xps100) basic_machine=xps100-honeywell ;; ymp) @@ -996,7 +1071,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh3 | sh4 | sh3eb | sh4eb) + sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sh64) @@ -1005,7 +1080,7 @@ case $basic_machine in sparc | sparcv9 | sparcv9b) basic_machine=sparc-sun ;; - cydra) + cydra) basic_machine=cydra-cydrome ;; orion) @@ -1020,10 +1095,6 @@ case $basic_machine in pmac | pmac-mpw) basic_machine=powerpc-apple ;; - c4x*) - basic_machine=c4x-none - os=-coff - ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; @@ -1079,18 +1150,20 @@ case $os in | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*) + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1102,8 +1175,10 @@ case $os in ;; esac ;; + -nto-qnx*) + ;; -nto*) - os=-nto-qnx + os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ @@ -1112,6 +1187,9 @@ case $os in -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; @@ -1124,6 +1202,9 @@ case $os in -opened*) os=-openedition ;; + -os400*) + os=-os400 + ;; -wince*) os=-wince ;; @@ -1145,6 +1226,9 @@ case $os in -atheos*) os=-atheos ;; + -syllable*) + os=-syllable + ;; -386bsd) os=-bsd ;; @@ -1155,7 +1239,7 @@ case $os in os=-rtmk-nova ;; -ns2 ) - os=-nextstep2 + os=-nextstep2 ;; -nsk*) os=-nsk @@ -1167,6 +1251,9 @@ case $os in -sinix*) os=-sysv4 ;; + -tpf*) + os=-tpf + ;; -triton*) os=-sysv3 ;; @@ -1194,8 +1281,14 @@ case $os in -xenix) os=-xenix ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos ;; -none) ;; @@ -1228,11 +1321,14 @@ case $basic_machine in arm*-semi) os=-aout ;; + c4x-* | tic4x-*) + os=-coff + ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; - pdp11-*) + pdp11-*) os=-none ;; *-dec | vax-*) @@ -1325,19 +1421,19 @@ case $basic_machine in *-next) os=-nextstep3 ;; - *-gould) + *-gould) os=-sysv ;; - *-highlevel) + *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; - *-sgi) + *-sgi) os=-irix ;; - *-siemens) + *-siemens) os=-sysv4 ;; *-masscomp) @@ -1406,9 +1502,15 @@ case $basic_machine in -mvs* | -opened*) vendor=ibm ;; + -os400*) + vendor=ibm + ;; -ptx*) vendor=sequent ;; + -tpf*) + vendor=ibm + ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; diff --git a/contrib/binutils/configure b/contrib/binutils/configure index 0d398f5..d11c49b1 100755 --- a/contrib/binutils/configure +++ b/contrib/binutils/configure @@ -1,96 +1,48 @@ -#!/bin/sh +#! /bin/sh -### WARNING: this file contains embedded tabs. Do not run untabify on this file. - -# Configuration script -# Copyright (C) 1988, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999, 2000, 2001, -# 2002 Free Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# This file was originally written by K. Richard Pixley. - -# -# Shell script to create proper links to machine-dependent files in -# preparation for compilation. -# -# If configure succeeds, it leaves its status in config.status. -# If configure fails after disturbing the status quo, -# config.status is removed. +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # - -export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0 $argv; kill $$) - -remove=rm -hard_link=ln -symbolic_link='ln -s' - -#for Test -#remove="echo rm" -#hard_link="echo ln" -#symbolic_link="echo ln -s" - -# clear some things potentially inherited from environment. - -Makefile=Makefile -Makefile_in=Makefile.in -arguments= -build_alias= -cache_file=config.cache -cache_file_option= -configdirs= -extraconfigdirs= -diroptions= -enable_threads=no -enable_shared=no -enable_libstdcxx_v3=yes -exec_prefix= -exec_prefixoption= -fatal= -floating_point=default -gas=default -gcc_version= -gcc_version_trigger= -host_alias=NOHOST -host_makefile_frag= -moveifchange= -norecursion= -other_options= -package_makefile_frag= -package_makefile_rules_frag= -prefix=/usr/local -progname= -program_prefix= -program_prefixoption= -program_suffix= -program_suffixoption= -program_transform_name= -program_transform_nameoption= -redirect= -removing= +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-libada Builds libada directory" +ac_help="$ac_help + --enable-serial-[{host,target,build}-]configure + Force sequential configuration of + sub-packages for the host, target or build + machine, or all sub-packages" +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= site= -site_makefile_frag= -site_option= srcdir= -srctrigger= -subdirs= -target_alias=NOTARGET -target_makefile_frag= -undefs=NOUNDEFS -version="$Revision: 1.17 $" -x11=default +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' @@ -104,17 +56,730 @@ oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' -### we might need to use some other shell than /bin/sh for running subshells +# Initialize some other variables. +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=move-if-change + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +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" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +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 + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + +# Do some error checking and defaulting for the host and target type. +# The inputs are: +# configure --host=HOST --target=TARGET --build=BUILD NONOPT +# +# The rules are: +# 1. You are not allowed to specify --host, --target, and nonopt at the +# same time. +# 2. Host defaults to nonopt. +# 3. If nonopt is not specified, then host defaults to the current host, +# as determined by config.guess. +# 4. Target and build default to nonopt. +# 5. If nonopt is not specified, then target and build default to host. + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +case $host---$target---$nonopt in +NONE---*---* | *---NONE---* | *---*---NONE) ;; +*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; +esac + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:583: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +echo $ac_n "checking target system type""... $ac_c" 1>&6 +echo "configure:604: checking target system type" >&5 + +target_alias=$target +case "$target_alias" in +NONE) + case $nonopt in + NONE) target_alias=$host_alias ;; + *) target_alias=$nonopt ;; + esac ;; +esac + +target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` +target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$target" 1>&6 + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:622: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +test "$host_alias" != "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +if test "$program_transform_name" = s,x,x,; then + program_transform_name= +else + # Double any \ or $. echo might interpret backslashes. + cat <<\EOF_SED > conftestsed +s,\\,\\\\,g; s,\$,$$,g +EOF_SED + program_transform_name="`echo $program_transform_name|sed -f conftestsed`" + rm -f conftestsed +fi +test "$program_prefix" != NONE && + program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + +# sed with no file args requires a program. +test "$program_transform_name" = "" && program_transform_name="s,x,x," + + +# Get 'install' or 'install-sh' and its variants. +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:677: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test -f $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +# Autoconf M4 include file defining utility macros for complex Canadian +# cross builds. + + + + + + +#### +# _NCN_TOOL_PREFIXES: Some stuff that oughtta be done in AC_CANONICAL_SYSTEM +# or AC_INIT. +# These demand that AC_CANONICAL_SYSTEM be called beforehand. + +#### +# NCN_CHECK_TARGET_TOOL(variable, prog-to-check-for,[value-if-not-found],[path]) +# Like AC_CHECK_TOOL, but tries a prefix of the target, not the host. +# Code is pretty much lifted from autoconf2.53. + + + +#### +# NCN_STRICT_CHECK_TOOL(variable, prog-to-check-for,[value-if-not-found],[path]) +# Like AC_CHECK_TOOL, but requires the prefix if build!=host. + + + +#### +# NCN_STRICT_CHECK_TARGET_TOOL(variable, prog-to-check-for,[value-if-not-found],[path]) +# Like NCN_CHECK_TARGET_TOOL, but requires the prefix if build!=target. + + +### +# AC_PROG_CPP_WERROR +# Used for autoconf 2.5x to force AC_PREPROC_IFELSE to reject code which +# triggers warnings from the preprocessor. Will be in autoconf 2.58. +# For now, using this also overrides header checks to use only the +# preprocessor (matches 2.13 behavior; matching 2.58's behavior is a +# bit harder from here). +# Eventually autoconf will default to checking headers with the compiler +# instead, and we'll have to do this differently. + +# AC_PROG_CPP_WERROR + + +### we might need to use some other shell than /bin/sh for running subshells ### If we are on Windows, search for the shell. This will permit people ### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure ### without also having to set CONFIG_SHELL. This code will work when ### using bash, which sets OSTYPE. case "${OSTYPE}" in *win32*) - if [ x${CONFIG_SHELL} = x ]; then - if [ ! -f /bin/sh ]; then - if [ x${SHELL} != x ] && [ -f ${SHELL} ]; then + if test x${CONFIG_SHELL} = x ; then + if test ! -f /bin/sh ; then + if test x${SHELL} != x && test -f ${SHELL} ; then CONFIG_SHELL=${SHELL} export CONFIG_SHELL else @@ -139,721 +804,1268 @@ esac config_shell=${CONFIG_SHELL-/bin/sh} -NO_EDIT="This file was generated automatically by configure. Do not edit." - -## this is a little touchy and won't always work, but... -## -## if the argv[0] starts with a slash then it is an absolute name that can (and -## must) be used as is. -## -## otherwise, if argv[0] has no slash in it, we can assume that it is on the -## path. Since PATH might include "." we also add `pwd` to the end of PATH. -## - progname=$0 # if PWD already has a value, it is probably wrong. -if [ -n "$PWD" ]; then PWD=`${PWDCMD-pwd}`; fi +if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi + +# Export original configure arguments for use by sub-configures. These +# will be expanded by make, so quote '$'. +tmp="$progname $@" +sed -e 's,\$,$$,g' < conftestsed.out +$tmp +EOF_SED +TOPLEVEL_CONFIGURE_ARGUMENTS=`cat conftestsed.out` +rm -f conftestsed.out + + +moveifchange=${srcdir}/move-if-change + +# Set srcdir to "." if that's what it is. +# This is important for multilib support. +pwd=`${PWDCMD-pwd}` +srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}` +if test "${pwd}" = "${srcpwd}" ; then + srcdir=. +fi -case "${progname}" in -/* | [A-Za-z]:[\\/]* ) ;; -*/*) ;; -*) - PATH=$PATH:${PWD=`${PWDCMD-pwd}`} ; export PATH +topsrcdir=$srcpwd + +extra_host_args= +# Define the trigger file to make sure configure will re-run whenever +# the gcc version number changes. +if test "${with_gcc_version_trigger+set}" = set ; then + gcc_version_trigger="$with_gcc_version_trigger" + gcc_version=`grep version_string ${with_gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'` +else + # If gcc's sources are available, define the trigger file. + if test -f ${topsrcdir}/gcc/version.c ; then + gcc_version_trigger=${topsrcdir}/gcc/version.c + gcc_version=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'` + case "$ac_configure_args" in + *--with-gcc-version-trigger=$gcc_version_trigger* ) ;; -esac + * ) + # Add to all subconfigure arguments: build, host, and target. + ac_configure_args="$ac_configure_args --with-gcc-version-trigger=$gcc_version_trigger" + ;; + esac + fi +fi -# Export original configure arguments for use by sub-configures. -TOPLEVEL_CONFIGURE_ARGUMENTS="$progname $@" -export TOPLEVEL_CONFIGURE_ARGUMENTS +### To add a new directory to the tree, first choose whether it is a target +### or a host dependent tool. Then put it into the appropriate list +### (library or tools, host or target), doing a dependency sort. -# Loop over all args +# Subdirs will be configured in the order listed in build_configdirs, +# configdirs, or target_configdirs; see the serialization section below. -while : -do +# Dependency sorting is only needed when *configuration* must be done in +# a particular order. In all cases a dependency should be specified in +# the Makefile, whether or not it's implicitly specified here. -# Break out if there are no more args - case $# in - 0) - break - ;; - esac +# Double entries in build_configdirs, configdirs, or target_configdirs may +# cause circular dependencies and break everything horribly. -# Get the first arg, and shuffle - option=$1 - shift +# these libraries are used by various programs built for the host environment +# +host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl tix libgui zlib" + +# these tools are built for the host environment +# Note, the powerpc-eabi build depends on sim occurring before gdb in order to +# know that we are building the simulator. +# binutils, gas and ld appear in that order because it makes sense to run +# "make check" in that particular order. +host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar" + +# libgcj represents the runtime libraries only used by gcj. +libgcj="target-libffi \ + target-boehm-gc \ + target-zlib \ + target-qthreads \ + target-libjava" + +# these libraries are built for the target environment, and are built after +# the host libraries and the host tools (which may be a cross compiler) +# +target_libraries="target-libiberty \ + target-libgloss \ + target-newlib \ + target-libstdc++-v3 \ + target-libf2c \ + ${libgcj} \ + target-libobjc \ + target-libada" + +# these tools are built using the target libraries, and are intended to +# run only in the target environment +# +# note: any program that *uses* libraries that are in the "target_libraries" +# list belongs in this list. those programs are also very likely +# candidates for the "native_only" list which follows +# +target_tools="target-examples target-groff target-gperf target-rda" -# Make all options have two hyphens - orig_option=$option # Save original for error messages - case $option in - --*) ;; - -*) option=-$option ;; - esac - -# Split out the argument for options that take them - case $option in - --*=*) - optarg=`echo $option | sed -e 's/^[^=]*=//'` - arguments="$arguments $option" - ;; -# These options have mandatory values. Since we didn't find an = sign, -# the value must be in the next argument - --bu* | --cache* | --ex* | --ho* | --pre* | --program-p* | --program-s* | --program-t* | --si* | --sr* | --ta* | --tm* | --x-* | --bi* | --sb* | --li* | --da* | --sy* | --sh* | --lo* | --in* | --ol* | --ma*) - optarg=$1 - shift - arguments="$arguments $option=$optarg" - ;; - --v) - arguments="$arguments -v" - ;; - --*) - arguments="$arguments $option" - ;; - esac +################################################################################ -# Now, process the options - case $option in - - --bi*) - bindir=$optarg - diroptions="$diroptions --bindir=$optarg" - ;; - --build* | --bu*) - case "$build_alias" in - "") build_alias=$optarg ;; - *) echo '***' Can only configure for one build machine at a time. 1>&2 - fatal=yes - ;; - esac - ;; - --cache*) - cache_file=$optarg - ;; - --da*) - datadir=$optarg - diroptions="$diroptions --datadir=$optarg" - ;; - --disable-*) - enableopt=`echo ${option} | sed 's:^--disable-:enable_:;s:-:_:g'` - eval $enableopt=no - disableoptions="$disableoptions $option" - ;; - --enable-*) - case "$option" in - *=*) ;; - *) optarg=yes ;; - esac - - enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'` - eval "$enableopt=\$optarg" - enableoptions="$enableoptions '$option'" - ;; - --exec-prefix* | --ex*) - exec_prefix=$optarg - exec_prefixoption="--exec-prefix=$optarg" - ;; - --gas | --g*) - gas=yes - ;; - --help | --he*) - fatal=yes - ;; - --host* | --ho*) - case $host_alias in - NOHOST) host_alias=$optarg ;; - *) echo '***' Can only configure for one host at a time. 1>&2 - fatal=yes - ;; - esac - ;; - --inc*) - includedir=$optarg - diroptions="$diroptions --includedir=$optarg" - ;; - --inf*) - infodir=$optarg - diroptions="$diroptions --infodir=$optarg" - ;; - --libd*) - libdir=$optarg - diroptions="$diroptions --libdir=$optarg" - ;; - --libe*) - libexecdir=$optarg - diroptions="$diroptions --libexecdir=$optarg" - ;; - --lo*) - localstatedir=$optarg - diroptions="$diroptions --localstatedir=$optarg" - ;; - --ma*) - mandir=$optarg - diroptions="$diroptions --mandir=$optarg" - ;; - --nfp | --nf*) - floating_point=no - floating_pointoption="--nfp" - ;; - --norecursion | --no*) - norecursion=yes - ;; - --ol*) - oldincludedir=$optarg - diroptions="$diroptions --oldincludedir=$optarg" - ;; - --prefix* | --pre*) - prefix=$optarg - prefixoption="--prefix=$optarg" - ;; - --program-prefix* | --program-p*) - program_prefix=$optarg - program_prefixoption="--program-prefix=$optarg" - ;; - --program-suffix* | --program-s*) - program_suffix=$optarg - program_suffixoption="--program-suffix=$optarg" - ;; - --program-transform-name* | --program-t*) - # Double any backslashes or dollar signs in the argument - program_transform_name="${program_transform_name} -e `echo ${optarg} | sed -e 's/\\\\/\\\\\\\\/g' -e 's/\\\$/$$/g'`" - program_transform_nameoption="${program_transform_nameoption} --program-transform-name='$optarg'" - ;; - --rm) - removing=--rm - ;; - --sb*) - sbindir=$optarg - diroptions="$diroptions --sbindir=$optarg" - ;; - --sh*) - sharedstatedir=$optarg - diroptions="$diroptions --sharedstatedir=$optarg" - ;; - --silent | --sil* | --quiet | --q*) - redirect=">/dev/null" - verbose=--silent - ;; - --site* | --sit*) - site=$optarg - site_option="--site=$optarg" - ;; - --srcdir*/ | --sr*/) - # Remove trailing slashes. Otherwise, when the file name gets - # bolted into an object file as debug info, it has two slashes - # in it. Ordinarily this is ok, but emacs takes double slash - # to mean "forget the first part". - srcdir=`echo $optarg | sed -e 's:/$::'` - ;; - --srcdir* | --sr*) - srcdir=$optarg - ;; - --sy*) - sysconfdir=$optarg - diroptions="$diroptions --sysconfdir=$optarg" - ;; - --target* | --ta*) - case $target_alias in - NOTARGET) target_alias=$optarg ;; - *) echo '***' Can only configure for one target at a time. 1>&2 - fatal=yes - ;; - esac - ;; - --tmpdir* | --tm*) - TMPDIR=$optarg - tmpdiroption="--tmpdir=$optarg" - ;; - --verbose | --v | --verb*) - redirect= - verbose=--verbose - ;; - --version | --V | --vers*) - echo "This is Cygnus Configure version" `echo ${version} | sed 's/[ $:]//g'` - exit 0 - ;; - --with-*) - case "$option" in - *=*) ;; - *) optarg=yes ;; - esac - - withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'` - eval $withopt="\$optarg" - withoptions="$withoptions $option" - ;; - --without-*) - withopt=`echo ${option} | sed 's:^--::;s:out::;s:-:_:g'` - eval $withopt=no - withoutoptions="$withoutoptions $option" - ;; - --x) with_x=yes - withoptions="$withoptions --with-x" - ;; - --x-i* | --x-l*) other_options="$other_options $orig_option" - ;; - --*) - echo "configure: Unrecognized option: \"$orig_option\"; use --help for usage." >&2 - exit 1 - ;; - *) - case $undefs in - NOUNDEFS) undefs=$option ;; - *) echo '***' Can only configure for one host and one target at a time. 1>&2 - fatal=yes - ;; - esac - ;; - esac -done +## All tools belong in one of the four categories, and are assigned above +## We assign ${configdirs} this way to remove all embedded newlines. This +## is important because configure will choke if they ever get through. +## ${configdirs} is directories we build using the host tools. +## ${target_configdirs} is directories we build using the target tools. +# +configdirs=`echo ${host_libs} ${host_tools}` +target_configdirs=`echo ${target_libraries} ${target_tools}` + +# Only make build modules if build != host. +# This should be done more generally, but at the moment it doesn't matter. +if test ${host_alias} != ${build_alias} ; then + # This is the only build module. + build_modules=libiberty +else + build_modules= +fi -# process host and target -# Do some error checking and defaulting for the host and target type. -# The inputs are: -# configure --host=HOST --target=TARGET UNDEFS -# -# The rules are: -# 1. You aren't allowed to specify --host, --target, and undefs at the -# same time. -# 2. Host defaults to undefs. -# 3. If undefs is not specified, then host defaults to the current host, -# as determined by config.guess. -# 4. Target defaults to undefs. -# 5. If undefs is not specified, then target defaults to host. - -case "${fatal}" in -"") - # Make sure that host, target & undefs aren't all specified at the - # same time. - case $host_alias---$target_alias---$undefs in - NOHOST---*---* | *---NOTARGET---* | *---*---NOUNDEFS) - ;; - *) echo '***' Can only configure for one host and one target at a time. 1>&2 - fatal=yes - break 2 - ;; - esac +################################################################################ - # Now, do defaulting for host. - case $host_alias in - NOHOST) - case $undefs in - NOUNDEFS) - # Neither --host option nor undefs were present. - # Call config.guess. - guesssys=`echo ${progname} | sed 's/configure$/config.guess/'` - if host_alias=`${config_shell} ${guesssys}` - then - # If the string we are going to use for - # the target is a prefix of the string - # we just guessed for the host, then - # assume we are running native, and force - # the same string for both target and host. - case $target_alias in - NOTARGET) ;; - *) - if expr $host_alias : $target_alias >/dev/null - then - host_alias=$target_alias - fi - ;; - esac - echo "Configuring for a ${host_alias} host." - arguments="--host=$host_alias $arguments" - else - echo 'Config.guess failed to determine the host type. You need to specify one.' 1>&2 - fatal=yes - fi - ;; - *) - host_alias=$undefs - arguments="--host=$host_alias $arguments" - undefs=NOUNDEFS - ;; - esac - esac +srcname="gnu development package" - # Do defaulting for target. If --target option isn't present, default - # to undefs. If undefs isn't present, default to host. - case $target_alias in - NOTARGET) - case $undefs in - NOUNDEFS) - target_alias=$host_alias - ;; - *) - target_alias=$undefs - arguments="--target=$target_alias $arguments" - ;; - esac - esac - ;; -*) ;; -esac +# This gets set non-empty for some net releases of packages. +appdirs="" -if [ -n "${fatal}" -o "${host_alias}" = "help" ] ; then - exec 1>&2 - echo Usage: configure [OPTIONS] [HOST] - echo - echo Options: [defaults in brackets] - echo ' --prefix=MYDIR install into MYDIR [/usr/local]' - echo ' --exec-prefix=MYDIR install host-dependent files into MYDIR [/usr/local]' - echo ' --help print this message [normal config]' - echo ' --build=BUILD configure for building on BUILD [BUILD=HOST]' - echo ' --host=HOST configure for HOST [determined via config.guess]' - echo ' --norecursion configure this directory only [recurse]' - echo ' --program-prefix=FOO prepend FOO to installed program names [""]' - echo ' --program-suffix=FOO append FOO to installed program names [""]' - echo ' --program-transform-name=P transform installed names by sed pattern P [""]' - echo ' --site=SITE configure with site-specific makefile for SITE' - echo ' --srcdir=DIR find the sources in DIR [. or ..]' - echo ' --target=TARGET configure for TARGET [TARGET=HOST]' - echo ' --tmpdir=TMPDIR create temporary files in TMPDIR [/tmp]' - echo ' --nfp configure for software floating point [hard float]' - echo ' --with-FOO, --with-FOO=BAR package FOO is available (parameter BAR)' - echo ' --without-FOO package FOO is NOT available' - echo ' --enable-FOO, --enable-FOO=BAR include feature FOO (parameter BAR)' - echo ' --disable-FOO do not include feature FOO' - echo - echo 'Where HOST and TARGET are something like "sparc-sunos", "mips-sgi-irix5", etc.' - echo - if [ -r config.status ] ; then - cat config.status - fi +# Define is_cross_compiler to save on calls to 'test'. +is_cross_compiler= +if test x"${host}" = x"${target}" ; then + is_cross_compiler=no +else + is_cross_compiler=yes +fi - exit 1 -fi +# Find the build and target subdir names. + case ${build_alias} in + "") build_noncanonical=${build} ;; + *) build_noncanonical=${build_alias} ;; +esac -configsub=`echo ${progname} | sed 's/configure$/config.sub/'` -moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'` -## the sed command below emulates the dirname command -topsrcdir=`cd \`echo ${progname} | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'\`; ${PWDCMD-pwd}` + case ${host_alias} in + "") host_noncanonical=${build_noncanonical} ;; + *) host_noncanonical=${host_alias} ;; +esac + case ${target_alias} in + "") target_noncanonical=${host_noncanonical} ;; + *) target_noncanonical=${target_alias} ;; +esac -# this is a hack. sun4 must always be a valid host alias or this will fail. -if ${config_shell} ${configsub} sun4 >/dev/null 2>&1 ; then - true -else - echo '***' cannot find config.sub. 1>&2 - exit 1 + # Prefix 'build-' so this never conflicts with target_subdir. +build_subdir="build-${build_noncanonical}" +# Not really a subdirectory, but here for completeness. +host_subdir=. +# No prefix. +target_subdir=${target_noncanonical} + + +# Skipdirs are removed silently. +skipdirs= +# Noconfigdirs are removed loudly. +noconfigdirs="" + +use_gnu_ld= +# Make sure we don't let GNU ld be added if we didn't want it. +if test x$with_gnu_ld = xno ; then + use_gnu_ld=no + noconfigdirs="$noconfigdirs ld" fi -touch config.junk -if ${config_shell} ${moveifchange} config.junk config.trash ; then - true -else - echo '***' cannot find move-if-change. 1>&2 - exit 1 +use_gnu_as= +# Make sure we don't let GNU as be added if we didn't want it. +if test x$with_gnu_as = xno ; then + use_gnu_as=no + noconfigdirs="$noconfigdirs gas" fi -rm -f config.junk config.trash -case "${srcdir}" in -"") - if [ -r configure.in ] ; then - srcdir=. - else - if [ -r ${progname}.in ] ; then - srcdir=`echo ${progname} | sed 's:/configure$::'` - else - echo '***' "Can't find configure.in. Try using --srcdir=some_dir" 1>&2 - exit 1 - fi - fi - ;; -*) - # Set srcdir to "." if that's what it is. - # This is important for multilib support. - if [ ! -d ${srcdir} ] ; then - echo "Invalid source directory ${srcdir}" >&2 - exit 1 - fi - pwd=`${PWDCMD-pwd}` - srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}` - if [ "${pwd}" = "${srcpwd}" ] ; then - srcdir=. - fi +# some tools are so dependent upon X11 that if we're not building with X, +# it's not even worth trying to configure, much less build, that tool. + +case ${with_x} in + yes | "") ;; # the default value for this tree is that X11 is available + no) + skipdirs="${skipdirs} tk tix itcl libgui" + # We won't be able to build gdbtk without X. + enable_gdbtk=no + ;; + *) echo "*** bad value \"${with_x}\" for -with-x flag; ignored" 1>&2 ;; esac -### warn about some conflicting configurations. +# Some tools are only suitable for building in a "native" situation. +# Remove these if host!=target. +native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" -case "${srcdir}" in -".") ;; -*) - if [ -f ${srcdir}/config.status ] ; then - echo '***' Cannot configure here in \"${PWD=`${PWDCMD-pwd}`}\" when \"${srcdir}\" is currently configured. 1>&2 - exit 1 - fi -esac +# Similarly, some are only suitable for cross toolchains. +# Remove these if host=target. +cross_only="target-libgloss target-newlib target-opcodes" -# default exec_prefix -case "${exec_prefixoption}" in -"") exec_prefix="\$(prefix)" ;; -*) ;; +case $is_cross_compiler in + no) skipdirs="${skipdirs} ${cross_only}" ;; + yes) skipdirs="${skipdirs} ${native_only}" ;; esac -# Define the trigger file to make sure configure will re-run whenever -# the gcc version number changes. -if [ "${with_gcc_version_trigger+set}" = set ]; then - gcc_version_trigger="$with_gcc_version_trigger" - gcc_version=`grep version_string ${with_gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'` -else - # If gcc's sources are available, define the trigger file. - if [ -f ${topsrcdir}/gcc/version.c ] ; then - gcc_version_trigger=${topsrcdir}/gcc/version.c - gcc_version=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([^ \"]*\)[ \"].*/\1/'` - case "$arguments" in - *--with-gcc-version-trigger=$gcc_version_trigger* ) - ;; - * ) - # Make sure configure.in knows about this. - arguments="--with-gcc-version-trigger=$gcc_version_trigger $arguments" - ;; - esac - withoptions="--with-gcc-version-trigger=$gcc_version_trigger $withoptions" - fi +# If both --with-headers and --with-libs are specified, default to +# --without-newlib. +if test x"${with_headers}" != x && test x"${with_headers} != xno \ + && test x"${with_libs}" != x && test x"${with_libs} != xno ; then + if test x"${with_newlib}" = x ; then + with_newlib=no + fi fi -### break up ${srcdir}/configure.in. -case "`grep '^# per\-host:' ${srcdir}/configure.in`" in -"") - echo '***' ${srcdir}/configure.in has no \"per-host:\" line. 1>&2 - # Check for a directory that's been converted to use autoconf since - # it was last configured. - if grep AC_OUTPUT ${srcdir}/configure.in >/dev/null ; then - echo '***' Hmm, looks like this directory has been autoconfiscated. 1>&2 - if [ -r ${srcdir}/configure ] ; then - echo '***' Running the local configure script. 1>&2 - case "${cache_file}" in - "") cache_file_option= ;; - *) cache_file_option="--cache-file=${cache_file}" ;; - esac - srcdiroption="--srcdir=${srcdir}" - case "${build_alias}" in - "") buildopt= ;; - *) buildopt="--build=${build_alias}" ;; - esac - eval exec ${config_shell} ${srcdir}/configure ${verbose} \ - ${buildopt} --host=${host_alias} --target=${target_alias} \ - ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \ - ${srcdiroption} ${diroptions} \ - ${program_prefixoption} ${program_suffixoption} \ - ${program_transform_nameoption} ${site_option} \ - ${withoptions} ${withoutoptions} \ - ${enableoptions} ${disableoptions} ${floating_pointoption} \ - ${cache_file_option} ${removing} ${other_options} ${redirect} - else - echo '***' There is no configure script present though. 1>&2 - fi - fi - exit 1 - ;; -*) ;; -esac - -case "`grep '^# per\-target:' ${srcdir}/configure.in`" in -"") - echo '***' ${srcdir}/configure.in has no \"per-target:\" line. 1>&2 - exit 1 - ;; -*) ;; +# Recognize --with-newlib/--without-newlib. +case ${with_newlib} in + no) skipdirs="${skipdirs} target-newlib" ;; + yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;; esac -case "${TMPDIR}" in -"") TMPDIR=/tmp ; export TMPDIR ;; -*) ;; -esac +# Configure extra directories which are host specific -# keep this filename short for &%*%$*# 14 char file names and 8+3 file names -tmpdir=${TMPDIR}/cNf$$ -mkdir ${tmpdir} || exit 1 -tmpfile=${tmpdir}/cNf$$ -# Note that under many versions of sh a trap handler for 0 will *override* any -# exit status you explicitly specify! At this point, the only non-error exit -# is at the end of the script; these actions are duplicated there, minus -# the "exit 1". Don't use "exit 0" anywhere after this without resetting the -# trap handler, or you'll lose. -trap "rm -rf Makefile.tem ${tmpdir}; exit 1" 0 1 2 15 - -# split ${srcdir}/configure.in into common, per-host, per-target, -# and post-target parts. Post-target is optional. -sed -e '/^# per\-host:/,$d' ${srcdir}/configure.in > ${tmpfile}.com -sed -e '1,/^# per\-host:/d' -e '/^# per\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.hst -if grep '^# post-target:' ${srcdir}/configure.in >/dev/null ; then - sed -e '1,/^# per\-target:/d' -e '/^# post\-target:/,$d' ${srcdir}/configure.in > ${tmpfile}.tgt - sed -e '1,/^# post\-target:/d' ${srcdir}/configure.in > ${tmpfile}.pos -else - sed -e '1,/^# per\-target:/d' ${srcdir}/configure.in > ${tmpfile}.tgt - echo >${tmpfile}.pos -fi - -### do common part of configure.in - -# If the language specific compiler does not exist, but the "gcc" directory does, -# we will skip this directory; in this case the sub-directory's common part -# of configure.in will create a small shell script "skip-this-dir" containing -# commands to completely clean up any temporary or created files. - -. ${tmpfile}.com - -if test -f skip-this-dir; then - # Perform the same cleanup as the trap handler, minus the "exit 1" of course, - # and reset the trap handler. - trap 0 - rm -rf Makefile* ${tmpdir} - # Execute the final clean-up actions - ${config_shell} skip-this-dir - # and stop configuring this directory. - exit 0 -fi - -# some sanity checks on configure.in -case "${srctrigger}" in -"") - echo '***' srctrigger not set in ${PWD=`${PWDCMD-pwd}`}/configure.in. 1>&2 - exit 1 - ;; -*) ;; +case "${host}" in + *-cygwin*) + configdirs="$configdirs libtermcap" ;; esac -case "${build_alias}" in -"") - if result=`${config_shell} ${configsub} ${host_alias}` ; then - build_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` - build_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` - build_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - build=${build_cpu}-${build_vendor}-${build_os} - build_alias=${host_alias} - fi - ;; -*) - if result=`${config_shell} ${configsub} ${build_alias}` ; then - buildopt="--build=${build_alias}" - build_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` - build_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` - build_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` - build=${build_cpu}-${build_vendor}-${build_os} - else - echo "Unrecognized build system name ${build_alias}." 1>&2 - exit 1 - fi - ;; +# Remove more programs from consideration, based on the host or +# target this usually means that a port of the program doesn't +# exist yet. + +case "${host}" in + hppa*64*-*-*) + noconfigdirs="$noconfigdirs byacc" + ;; + i[3456789]86-*-vsta) + noconfigdirs="$noconfigdirs tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl itcl tix gnuserv gettext" + ;; + i[3456789]86-*-go32* | i[3456789]86-*-msdosdjgpp*) + noconfigdirs="$noconfigdirs tcl tk expect dejagnu send-pr uudecode guile itcl tix gnuserv libffi" + ;; + i[3456789]86-*-mingw32*) + # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl tix gnuserv" + noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool" + ;; + i[3456789]86-*-beos*) + noconfigdirs="$noconfigdirs tk itcl tix libgui gdb" + ;; + *-*-cygwin*) + noconfigdirs="$noconfigdirs autoconf automake send-pr rcs guile perl" + ;; + *-*-netbsd*) + noconfigdirs="$noconfigdirs rcs" + ;; + ppc*-*-pe) + noconfigdirs="$noconfigdirs patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv" + ;; + powerpc-*-beos*) + noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline" + ;; + *-*-darwin*) + noconfigdirs="$noconfigdirs tk itcl tix libgui" + ;; esac -if result=`${config_shell} ${configsub} ${host_alias}` ; then - true +# Check whether --enable-libada or --disable-libada was given. +if test "${enable_libada+set}" = set; then + enableval="$enable_libada" + ENABLE_LIBADA=$enableval else - echo "Unrecognized host system name ${host_alias}." 1>&2 - exit 1 + ENABLE_LIBADA=yes fi -host_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -host=${host_cpu}-${host_vendor}-${host_os} -. ${tmpfile}.hst - -if result=`${config_shell} ${configsub} ${target_alias}` ; then - true -else - echo "Unrecognized target system name ${target_alias}." 1>&2 - exit 1 +if test "${ENABLE_LIBADA}" != "yes" ; then + noconfigdirs="$noconfigdirs target-libada" fi -target_cpu=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $result | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -target=${target_cpu}-${target_vendor}-${target_os} -. ${tmpfile}.tgt - -# Find the source files, if location was not specified. -case "${srcdir}" in -"") - srcdirdefaulted=1 - srcdir=. - if [ ! -r ${srctrigger} ] ; then - srcdir=.. - fi - ;; -*) ;; +# Save it here so that, even in case of --enable-libgcj, if the Java +# front-end isn't enabled, we still get libgcj disabled. +libgcj_saved=$libgcj +case $enable_libgcj in +yes) + # If we reset it here, it won't get added to noconfigdirs in the + # target-specific build rules, so it will be forcibly enabled + # (unless the Java language itself isn't enabled). + libgcj= + ;; +no) + # Make sure we get it printed in the list of not supported target libs. + noconfigdirs="$noconfigdirs ${libgcj}" + ;; esac -if [ ! -r ${srcdir}/${srctrigger} ] ; then - case "${srcdirdefaulted}" in - "") echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`${PWDCMD-pwd}`}/${srcdir}" 1>&2 ;; - *) echo '***' "${progname}: Can't find ${srcname} sources in ${PWD=`${PWDCMD-pwd}`}/. or ${PWD=`${PWDCMD-pwd}`}/.." 1>&2 ;; - esac - - echo '***' \(At least ${srctrigger} is missing.\) 1>&2 - exit 1 -fi +case "${target}" in + *-*-chorusos) + noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" + ;; + powerpc-*-darwin*) + noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof" + noconfigdirs="$noconfigdirs target-libobjc" + ;; + *-*-darwin*) + noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof" + noconfigdirs="$noconfigdirs target-libobjc ${libgcj}" + ;; + *-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" + ;; + *-*-kaos*) + # Remove unsupported stuff on all kaOS configurations. + skipdirs="target-libiberty ${libgcj} target-libstdc++-v3 target-libf2c target-librx" + skipdirs="$skipdirs target-libobjc target-examples target-groff target-gperf" + skipdirs="$skipdirs zlib fastjar target-libjava target-boehm-gc target-zlib" + noconfigdirs="$noconfigdirs target-libgloss" + ;; + *-*-netbsd*) + # Skip some stuff on all NetBSD configurations. + noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss" + + # Skip some stuff that's unsupported on some NetBSD configurations. + case "${target}" in + i*86-*-netbsdelf*) ;; + arm*-*-netbsdelf*) ;; + *) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + esac + ;; + *-*-netware) + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-newlib target-libiberty target-libgloss ${libgcj}" + ;; + *-*-rtems*) + noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" + case ${target} in + h8300*-*-* | h8500-*-*) + noconfigdirs="$noconfigdirs target-libf2c" + ;; + *) ;; + esac + ;; + *-*-uclinux*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda ${libgcj}" + ;; + *-*-vxworks*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty ${libgcj}" + ;; + alpha*-dec-osf*) + # ld works, but does not support shared libraries. + # newlib is not 64 bit ready. I'm not sure about fileutils. + # gas doesn't generate exception information. + noconfigdirs="$noconfigdirs gas ld fileutils target-newlib target-libgloss" + ;; + alpha*-*-*vms*) + noconfigdirs="$noconfigdirs gdb ld target-newlib target-libgloss ${libgcj}" + ;; + alpha*-*-linux*) + # newlib is not 64 bit ready + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; + alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; + alpha*-*-*) + # newlib is not 64 bit ready + noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" + ;; + am33_2.0-*-linux*) + noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" + ;; + sh-*-linux*) + noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" + ;; + sh*-*-pe|mips*-*-pe|*arm-wince-pe) + noconfigdirs="$noconfigdirs ${libgcj}" + noconfigdirs="$noconfigdirs target-examples" + noconfigdirs="$noconfigdirs target-libiberty texinfo send-pr" + noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim" + noconfigdirs="$noconfigdirs expect dejagnu" + # the C++ libraries don't build on top of CE's C libraries + noconfigdirs="$noconfigdirs target-libstdc++-v3" + noconfigdirs="$noconfigdirs target-newlib" + case "${host}" in + *-*-cygwin*) ;; # keep gdb and readline + *) noconfigdirs="$noconfigdirs gdb readline" + ;; + esac + ;; + arc-*-*) + noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" + ;; + arm-*-coff | strongarm-*-coff | xscale-*-coff) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + arm-*-elf* | strongarm-*-elf* | xscale-*-elf*) + noconfigdirs="$noconfigdirs target-libffi target-qthreads" + ;; + arm-*-pe*) + noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" + ;; + arm-*-oabi*) + noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" + ;; + thumb-*-coff) + noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" + ;; + thumb-*-elf) + noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" + ;; + thumb-*-oabi) + noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" + ;; + thumb-*-pe) + noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" + ;; + arm-*-riscix*) + noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}" + ;; + avr-*-*) + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" + ;; + c4x-*-* | tic4x-*-*) + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" + ;; + c54x*-*-* | tic54x-*-*) + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib" + ;; + cris-*-*) + noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" + ;; + d10v-*-*) + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" + ;; + d30v-*-*) + noconfigdirs="$noconfigdirs ${libgcj} gdb" + ;; + fr30-*-elf*) + noconfigdirs="$noconfigdirs ${libgcj} gdb" + ;; + frv-*-*) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + h8300*-*-*) + noconfigdirs="$noconfigdirs target-libgloss ${libgcj} target-libf2c" + ;; + h8500-*-*) + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} target-libf2c" + ;; + hppa*64*-*-linux* | parisc*64*-*-linux*) + # In this case, it's because the hppa64-linux target is for + # the kernel only at this point and has no libc, and thus no + # headers, crt*.o, etc., all of which are needed by these. + noconfigdirs="$noconfigdirs target-zlib" + ;; + hppa*-*-*elf* | \ + parisc*-*-linux* | hppa*-*-linux* | \ + hppa*-*-lites* | \ + hppa*-*-openbsd* | \ + hppa*64*-*-*) + noconfigdirs="$noconfigdirs ${libgcj}" + # Do configure ld/binutils/gas for this case. + ;; + hppa*-*-*) + # According to Alexandre Oliva , libjava won't + # build on HP-UX 10.20. + noconfigdirs="$noconfigdirs ld shellutils ${libgcj}" + ;; + i960-*-*) + noconfigdirs="$noconfigdirs ${libgcj} gdb" + ;; + ia64*-*-elf*) + # No gdb support yet. + noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb" + ;; + ia64*-**-hpux*) + # No gdb or ld support yet. + noconfigdirs="$noconfigdirs ${libgcj} tix readline mmalloc libgui itcl gdb ld" + ;; + i[3456789]86-*-coff | i[3456789]86-*-elf) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + i[3456789]86-*-freebsd* | i[3456789]86-*-kfreebsd*-gnu) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; + i[3456789]86-*-linux*) + # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's + # not build java stuff by default. + case "${target}" in + *-*-*libc1*) + noconfigdirs="$noconfigdirs ${libgcj}";; + esac -# Some systems (e.g., one of the i386-aix systems the gas testers are -# using) don't handle "\$" correctly, so don't use it here. -tooldir='$(exec_prefix)'/${target_alias} - -if [ "${host_alias}" != "${target_alias}" ] ; then - if [ "${program_prefixoption}" = "" ] ; then - if [ "${program_suffixoption}" = "" ] ; then - if [ "${program_transform_nameoption}" = "" ] ; then - program_prefix=${target_alias}- ; - fi - fi + # This section makes it possible to build newlib natively on linux. + # If we are using a cross compiler then don't configure newlib. + if test x${is_cross_compiler} != xno ; then + noconfigdirs="$noconfigdirs target-newlib" fi -fi + noconfigdirs="$noconfigdirs target-libgloss" + # If we are not using a cross compiler, do configure newlib. + # Note however, that newlib will only be configured in this situation + # if the --with-newlib option has been given, because otherwise + # 'target-newlib' will appear in skipdirs. + ;; + i[3456789]86-*-mingw32*) + target_configdirs="$target_configdirs target-mingw" + noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}" + + # Can't build gdb for mingw32 if not native. + case "${host}" in + i[3456789]86-*-mingw32) ;; # keep gdb tcl tk expect etc. + *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix gnuserv" + ;; + esac + ;; + *-*-cygwin*) + target_configdirs="$target_configdirs target-libtermcap target-winsup" + noconfigdirs="$noconfigdirs target-gperf target-libgloss ${libgcj}" + # always build newlib. + skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` + + # Can't build gdb for Cygwin if not native. + case "${host}" in + *-*-cygwin*) ;; # keep gdb tcl tk expect etc. + *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui gnuserv" + ;; + esac + ;; + i[3456789]86-*-pe) + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" + ;; + i[3456789]86-*-sco3.2v5*) + # The linker does not yet know about weak symbols in COFF, + # and is not configured to handle mixed ELF and COFF. + noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}" + ;; + i[3456789]86-*-sco*) + noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" + ;; + i[3456789]86-*-solaris2*) + noconfigdirs="$noconfigdirs target-libgloss" + ;; + i[3456789]86-*-sysv4*) + noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" + ;; + i[3456789]86-*-beos*) + noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" + ;; + m32r-*-*) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*) + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" + ;; + m68k-*-elf*) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + m68k-*-coff*) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + mcore-*-pe*) + # The EPOC C++ environment does not support exceptions or rtti, + # and so building libstdc++-v3 tends not to always work. + noconfigdirs="$noconfigdirs target-libstdc++-v3" + ;; + mmix-*-*) + noconfigdirs="$noconfigdirs ${libgcj} gdb libgloss" + ;; + mn10200-*-*) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + mn10300-*-*) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + powerpc-*-aix*) + # copied from rs6000-*-* entry + noconfigdirs="$noconfigdirs gprof target-libada target-libgloss ${libgcj}" + ;; + powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe) + target_configdirs="$target_configdirs target-winsup" + noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix gnuserv ${libgcj}" + # always build newlib. + skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` + ;; + # This is temporary until we can link against shared libraries + powerpcle-*-solaris*) + noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix gnuserv ${libgcj}" + ;; + powerpc-*-beos*) + noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" + ;; + powerpc-*-eabi) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + rs6000-*-lynxos*) + noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}" + ;; + rs6000-*-aix*) + noconfigdirs="$noconfigdirs gprof target-libada target-libgloss ${libgcj}" + ;; + rs6000-*-*) + noconfigdirs="$noconfigdirs gprof ${libgcj}" + ;; + m68k-apollo-*) + noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}" + ;; + mips*-*-irix5*) + noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" + ;; + mips*-*-irix6*) + # Linking libjava exceeds command-line length limits on at least + # IRIX 6.2, but not on IRIX 6.5. + # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham + # + noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" + ;; + mips*-dec-bsd*) + noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" + ;; + mips*-*-bsd*) + noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" + ;; + mipstx39-*-*) + noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips + ;; + mips*-*-linux*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; + mips*-*-*) + noconfigdirs="$noconfigdirs gprof ${libgcj}" + ;; + romp-*-*) + noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}" + ;; + sh-*-*) + case "${host}" in + i[3456789]86-*-vsta) ;; # don't add gprof back in + i[3456789]86-*-go32*) ;; # don't add gprof back in + i[3456789]86-*-msdosdjgpp*) ;; # don't add gprof back in + *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;; + esac + noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" + ;; + sh64-*-*) + noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" + ;; + sparc-*-elf*) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + sparc64-*-elf*) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + sparclite-*-*) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + sparc-*-sunos4*) + noconfigdirs="$noconfigdirs ${libgcj}" + if test x${is_cross_compiler} != xno ; then + noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss" + else + use_gnu_ld=no + fi + ;; + sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*) + ;; + v810-*-*) + noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}" + ;; + v850-*-*) + noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" + ;; + v850e-*-*) + noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" + ;; + v850ea-*-*) + noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" + ;; + vax-*-vms) + noconfigdirs="$noconfigdirs bfd binutils gdb ld target-newlib opcodes target-libgloss ${libgcj}" + ;; + vax-*-*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" + ;; + xtensa-*-*) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + ip2k-*-*) + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" + ;; + *-*-linux*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" + ;; + *-*-lynxos*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" + ;; + *-*-*) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; +esac -# Merge program_prefix and program_suffix onto program_transform_name. -# (program_suffix used to use $, but it's hard to preserve $ through both -# make and sh.) -if [ "${program_suffix}" != "" ] ; then - program_transform_name="-e s,\\\\(.*\\\\),\\\\1${program_suffix}, ${program_transform_name}" -fi +# If we aren't building newlib, then don't build libgloss, since libgloss +# depends upon some newlib header files. +case "${noconfigdirs}" in + *target-libgloss*) ;; + *target-newlib*) noconfigdirs="$noconfigdirs target-libgloss" ;; +esac -if [ "${program_prefix}" != "" ] ; then - program_transform_name="-e s,^,${program_prefix}, ${program_transform_name}" +# Figure out what language subdirectories are present. +# Look if the user specified --enable-languages="..."; if not, use +# the environment variable $LANGUAGES if defined. $LANGUAGES might +# go away some day. +# NB: embedded tabs in this IF block -- do not untabify +if test x"${enable_languages+set}" != xset; then + if test x"${LANGUAGES+set}" = xset; then + enable_languages="${LANGUAGES}" + echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2 + else + enable_languages=all + fi +else + if test x"${enable_languages}" = x || + test x"${enable_languages}" = xyes; + then + echo configure.in: --enable-languages needs at least one language argument 1>&2 + exit 1 + fi fi +enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'` + +# First scan to see if an enabled language requires some other language. +# We assume that a given config-lang.in will list all the language +# front ends it requires, even if some are required indirectly. +for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do + case ${lang_frag} in + ..) ;; + # The odd quoting in the next line works around + # an apparent bug in bash 1.12 on linux. + ${srcdir}/gcc/[*]/config-lang.in) ;; + *) + # From the config-lang.in, get $language, $lang_requires + language= + lang_requires= + . ${lang_frag} + for other in ${lang_requires} ; do + case ,${enable_languages}, in + *,$other,*) ;; + *,all,*) ;; + *,$language,*) + echo " \`$other' language required by \`$language'; enabling" 1>&2 + enable_languages="${enable_languages},${other}" + ;; + esac + done + ;; + esac +done -# If CC and CXX are not set in the environment, and the Makefile -# exists, try to extract them from it. This is to handle running -# ./config.status by hand. -if [ -z "${CC}" ] && [ -r Makefile ]; then - sed -n -e ':loop -/\\$/ N -s/\\\n//g -t loop -/^CC[ ]*=/ s/CC[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc - CC=`tail -1 Makefile.cc` - rm -f Makefile.cc -fi +for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do + case ${lang_frag} in + ..) ;; + # The odd quoting in the next line works around + # an apparent bug in bash 1.12 on linux. + ${srcdir}/gcc/[*]/config-lang.in) ;; + *) + # From the config-lang.in, get $language, $target_libs, + # $lang_dirs, and $build_by_default + language= + target_libs= + lang_dirs= + build_by_default= + . ${lang_frag} + if test "x$language" = x ; then + echo "${lang_frag} doesn't set \$language." 1>&2 + exit 1 + fi + case ,${enable_languages}, in + *,${language},*) + # Language was explicitly selected; include it. + add_this_lang=yes + ;; + *,all,*) + # 'all' was selected; include 'default' languages. + case ${build_by_default} in + no) add_this_lang=no ;; + *) add_this_lang=yes ;; + esac + ;; + *) add_this_lang=no ;; + esac + case ${add_this_lang} in + no) + # Remove language-dependent dirs. + eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\" + ;; + esac + ;; + esac +done -if [ -z "${CFLAGS}" ] && [ -r Makefile ]; then - sed -n -e ':loop -/\\$/ N -s/\\\n//g -t loop -/^CFLAGS[ ]*=/ s/CFLAGS[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc - CFLAGS=`tail -1 Makefile.cc` - rm -f Makefile.cc -fi +# Remove the entries in $skipdirs and $noconfigdirs from $configdirs and +# $target_configdirs. +# If we have the source for $noconfigdirs entries, add them to $notsupp. + +notsupp="" +for dir in . $skipdirs $noconfigdirs ; do + dirname=`echo $dir | sed -e s/target-//g` + if test $dir != . && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then + configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"` + if test -r $srcdir/$dirname/configure ; then + if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then + true + else + notsupp="$notsupp $dir" + fi + fi + fi + if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then + target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"` + if test -r $srcdir/$dirname/configure ; then + if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then + true + else + notsupp="$notsupp $dir" + fi + fi + fi +done -if [ -z "${CXX}" ] && [ -r Makefile ]; then - sed -n -e ':loop -/\\$/ N -s/\\\n//g -t loop -/^CXX[ ]*=/ s/CXX[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc - CXX=`tail -1 Makefile.cc` - rm -f Makefile.cc +# Sometimes the tools are distributed with libiberty but with no other +# libraries. In that case, we don't want to build target-libiberty. +if test -n "${target_configdirs}" ; then + others= + for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do + if test "$i" != "libiberty" ; then + if test -r $srcdir/$i/configure ; then + others=yes; + break; + fi + fi + done + if test -z "${others}" ; then + target_configdirs= + fi +fi + +# Quietly strip out all directories which aren't configurable in this tree. +# This relies on all configurable subdirectories being autoconfiscated, which +# is now the case. +configdirs_all="$configdirs" +configdirs= +for i in ${configdirs_all} ; do + if test -f ${srcdir}/$i/configure ; then + configdirs="${configdirs} $i" + fi +done +target_configdirs_all="$target_configdirs" +target_configdirs= +for i in ${target_configdirs_all} ; do + j=`echo $i | sed -e s/target-//g` + if test -f ${srcdir}/$j/configure ; then + target_configdirs="${target_configdirs} $i" + fi +done + +# Produce a warning message for the subdirs we can't configure. +# This isn't especially interesting in the Cygnus tree, but in the individual +# FSF releases, it's important to let people know when their machine isn't +# supported by the one or two programs in a package. + +if test -n "${notsupp}" && test -z "${norecursion}" ; then + # If $appdirs is non-empty, at least one of those directories must still + # be configured, or we error out. (E.g., if the gas release supports a + # specified target in some subdirs but not the gas subdir, we shouldn't + # pretend that all is well.) + if test -n "$appdirs" ; then + for dir in $appdirs ; do + if test -r $dir/Makefile.in ; then + if echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then + appdirs="" + break + fi + if echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then + appdirs="" + break + fi + fi + done + if test -n "$appdirs" ; then + echo "*** This configuration is not supported by this package." 1>&2 + exit 1 + fi + fi + # Okay, some application will build, or we don't care to check. Still + # notify of subdirs not getting built. + echo "*** This configuration is not supported in the following subdirectories:" 1>&2 + echo " ${notsupp}" 1>&2 + echo " (Any other directories should still work fine.)" 1>&2 +fi + +case "$host" in + *msdosdjgpp*) + enable_gdbtk=no ;; +esac + +copy_dirs= + +# Handle --with-headers=XXX. If the value is not "yes", the contents of +# the named directory are copied to $(tooldir)/sys-include. +if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then + if test x${is_cross_compiler} = xno ; then + echo 1>&2 '***' --with-headers is only supported when cross compiling + exit 1 + fi + if test x"${with_headers}" != xyes ; then + case "${exec_prefixoption}" in + "") x=${prefix} ;; + *) x=${exec_prefix} ;; + esac + copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include" + fi +fi + +# Handle --with-libs=XXX. If the value is not "yes", the contents of +# the name directories are copied to $(tooldir)/lib. Multiple directories +# are permitted. +if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then + if test x${is_cross_compiler} = xno ; then + echo 1>&2 '***' --with-libs is only supported when cross compiling + exit 1 + fi + if test x"${with_libs}" != xyes ; then + # Copy the libraries in reverse order, so that files in the first named + # library override files in subsequent libraries. + case "${exec_prefixoption}" in + "") x=${prefix} ;; + *) x=${exec_prefix} ;; + esac + for l in ${with_libs}; do + copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}" + done + fi +fi + +# Handle ${copy_dirs} +set fnord ${copy_dirs} +shift +while test $# != 0 ; do + if test -f $2/COPIED && test x"`cat $2/COPIED`" = x"$1" ; then + : + else + echo Copying $1 to $2 + + # Use the install script to create the directory and all required + # parent directories. + if test -d $2 ; then + : + else + echo >config.temp + ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED + fi + + # Copy the directory, assuming we have tar. + # FIXME: Should we use B in the second tar? Not all systems support it. + (cd $1; tar -cf - .) | (cd $2; tar -xpf -) + + # It is the responsibility of the user to correctly adjust all + # symlinks. If somebody can figure out how to handle them correctly + # here, feel free to add the code. + + echo $1 > $2/COPIED + fi + shift; shift +done + +# Work in distributions that contain no compiler tools, like Autoconf. +tentative_cc="" +host_makefile_frag=/dev/null +if test -d ${srcdir}/config ; then +case "${host}" in + m68k-hp-hpux*) + # Avoid "too much defining" errors from HPUX compiler. + tentative_cc="cc -Wp,-H256000" + # If "ar" in $PATH is GNU ar, the symbol table may need rebuilding. + # If it's HP/UX ar, this should be harmless. + RANLIB="ar ts" + ;; + m68k-apollo-sysv*) + tentative_cc="cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DUSG" + ;; + m68k-apollo-bsd*) + #None of the Apollo compilers can compile gas or binutils. The preprocessor + # chokes on bfd, the compiler won't let you assign integers to enums, and + # other problems. Defining CC to gcc is a questionable way to say "don't use + # the apollo compiler" (the preferred version of GCC could be called cc, + # or whatever), but I'm not sure leaving CC as cc is any better... + #CC=cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DNO_STDARG + # Used to have BISON=yacc. + tentative_cc=gcc + ;; + m88k-dg-dgux*) + tentative_cc="gcc -Wall -ansi -D__using_DGUX" + ;; + m88k-harris-cxux*) + # Under CX/UX, we want to tell the compiler to use ANSI mode. + tentative_cc="cc -Xa" + host_makefile_frag="config/mh-cxux" + ;; + m88k-motorola-sysv*) + ;; + mips*-dec-ultrix*) + tentative_cc="cc -Wf,-XNg1000" + host_makefile_frag="config/mh-decstation" + ;; + mips*-nec-sysv4*) + # The C compiler on NEC MIPS SVR4 needs bigger tables. + tentative_cc="cc -ZXNd=5000 -ZXNg=1000" + host_makefile_frag="config/mh-necv4" + ;; + mips*-sgi-irix4*) + # Tell compiler to use K&R C. We can't compile under the SGI Ansi + # environment. Also bump switch table size so that cp-parse will + # compile. Bump string length limit so linker builds. + tentative_cc="cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000 -Wf,-XNl8192" + ;; + mips*-*-sysv4*) + host_makefile_frag="config/mh-sysv4" + ;; + mips*-*-sysv*) + # This is for a MIPS running RISC/os 4.52C. + + # This is needed for GDB, but needs to be in the top-level make because + # if a library is compiled with the bsd headers and gets linked with the + # sysv system libraries all hell can break loose (e.g. a jmp_buf might be + # a different size). + # ptrace(2) apparently has problems in the BSD environment. No workaround is + # known except to select the sysv environment. Could we use /proc instead? + # These "sysv environments" and "bsd environments" often end up being a pain. + # + # This is not part of CFLAGS because perhaps not all C compilers have this + # option. + tentative_cc="cc -systype sysv" + ;; + i370-ibm-opened*) + tentative_cc="c89" + ;; + i[3456789]86-*-sysv5*) + host_makefile_frag="config/mh-sysv5" + ;; + i[3456789]86-*-dgux*) + tentative_cc="gcc -Wall -ansi -D__using_DGUX" + host_makefile_frag="config/mh-dgux386" + ;; + i[3456789]86-ncr-sysv4.3*) + # The MetaWare compiler will generate a copyright message unless you + # turn it off by adding the -Hnocopyr flag. + tentative_cc="cc -Hnocopyr" + ;; + i[3456789]86-ncr-sysv4*) + # for an NCR 3000 (i486/SVR4) system. + # The NCR 3000 ships with a MetaWare compiler installed as /bin/cc. + # This compiler not only emits obnoxious copyright messages every time + # you run it, but it chokes and dies on a whole bunch of GNU source + # files. Default to using the AT&T compiler installed in /usr/ccs/ATT/cc. + tentative_cc="/usr/ccs/ATT/cc" + host_makefile_frag="config/mh-ncr3000" + ;; + i[3456789]86-*-sco3.2v5*) + ;; + i[3456789]86-*-sco*) + # The native C compiler botches some simple uses of const. Unfortunately, + # it doesn't defined anything like "__sco__" for us to test for in ansidecl.h. + tentative_cc="cc -Dconst=" + host_makefile_frag="config/mh-sco" + ;; + i[3456789]86-*-udk*) + host_makefile_frag="config/mh-sysv5" + ;; + i[3456789]86-*-solaris2*) + host_makefile_frag="config/mh-sysv4" + ;; + i[3456789]86-*-msdosdjgpp*) + host_makefile_frag="config/mh-djgpp" + ;; + *-cygwin*) + host_makefile_frag="config/mh-cygwin" + ;; + *-mingw32*) + host_makefile_frag="config/mh-mingw32" + ;; + *-interix*) + host_makefile_frag="config/mh-interix" + ;; + vax-*-ultrix2*) + # The old BSD pcc isn't up to compiling parts of gdb so use gcc + tentative_cc=gcc + ;; + *-*-solaris2*) + host_makefile_frag="config/mh-solaris" + ;; + m68k-sun-sunos*) + # Sun's C compiler needs the -J flag to be able to compile cp-parse.c + # without overflowing the jump tables (-J says to use a 32 bit table) + tentative_cc="cc -J" + ;; + *-hp-hpux*) + tentative_cc="cc -Wp,-H256000" + ;; + *-*-hiux*) + tentative_cc="cc -Wp,-H256000" + ;; + rs6000-*-lynxos*) + # /bin/cc is less than useful for our purposes. Always use GCC + tentative_cc="/usr/cygnus/progressive/bin/gcc" + host_makefile_frag="config/mh-lynxrs6k" + ;; + *-*-lynxos*) + # /bin/cc is less than useful for our purposes. Always use GCC + tentative_cc="/bin/gcc" + ;; + *-*-sysv4*) + host_makefile_frag="config/mh-sysv4" + ;; +esac +fi + +extra_arflags_for_target= +extra_nmflags_for_target= +extra_ranlibflags_for_target= +target_makefile_frag=/dev/null +case "${target}" in + i[3456789]86-*-netware*) + target_makefile_frag="config/mt-netware" + ;; + powerpc-*-netware*) + target_makefile_frag="config/mt-netware" + ;; + *-*-linux*) + target_makefile_frag="config/mt-linux" + ;; + *-*-aix4.[3456789]* | *-*-aix[56789].*) + # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm + # commands to handle both 32-bit and 64-bit objects. These flags are + # harmless if we're using GNU nm or ar. + extra_arflags_for_target=" -X32_64" + extra_nmflags_for_target=" -B -X32_64" + ;; + *-*-darwin*) + # ranlib from Darwin requires the -c flag to look at common symbols. + extra_ranlibflags_for_target=" -c" + ;; + mips*-*-pe | sh*-*-pe | *arm-wince-pe) + target_makefile_frag="config/mt-wince" + ;; +esac + +alphaieee_frag=/dev/null +case $target in + alpha*-*-*) + # This just makes sure to use the -mieee option to build target libs. + # This should probably be set individually by each library. + alphaieee_frag="config/mt-alphaieee" + ;; +esac + +# If --enable-target-optspace always use -Os instead of -O2 to build +# the target libraries, similarly if it is not specified, use -Os +# on selected platforms. +ospace_frag=/dev/null +case "${enable_target_optspace}:${target}" in + yes:*) + ospace_frag="config/mt-ospace" + ;; + :d30v-*) + ospace_frag="config/mt-d30v" + ;; + :m32r-* | :d10v-* | :fr30-*) + ospace_frag="config/mt-ospace" + ;; + no:* | :*) + ;; + *) + echo "*** bad value \"${enable_target_optspace}\" for --enable-target-optspace flag; ignored" 1>&2 + ;; +esac + +# Set with_gnu_as and with_gnu_ld as appropriate. +# +# This is done by determining whether or not the appropriate directory +# is available, and by checking whether or not specific configurations +# have requested that this magic not happen. +# +# The command line options always override the explicit settings in +# configure.in, and the settings in configure.in override this magic. +# +# If the default for a toolchain is to use GNU as and ld, and you don't +# want to do that, then you should use the --without-gnu-as and +# --without-gnu-ld options for the configure script. + +if test x${use_gnu_as} = x && + echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then + with_gnu_as=yes + extra_host_args="$extra_host_args --with-gnu-as" +fi + +if test x${use_gnu_ld} = x && + echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 ; then + with_gnu_ld=yes + extra_host_args="$extra_host_args --with-gnu-ld" +fi + +# If using newlib, add --with-newlib to the extra_host_args so that gcc/configure +# can detect this case. + +if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 ; then + with_newlib=yes + extra_host_args="$extra_host_args --with-newlib" +fi + + +# Default to using --with-stabs for certain targets. +if test x${with_stabs} = x ; then + case "${target}" in + mips*-*-irix[56]*) + ;; + mips*-*-* | alpha*-*-osf*) + with_stabs=yes; + extra_host_args="${extra_host_args} --with-stabs" + ;; + esac fi -if [ -z "${CXXFLAGS}" ] && [ -r Makefile ]; then - sed -n -e ':loop -/\\$/ N -s/\\\n//g -t loop -/^CXXFLAGS[ ]*=/ s/CXXFLAGS[ ]*=[ ]*\(.*\)/\1/p' < Makefile > Makefile.cc - CXXFLAGS=`tail -1 Makefile.cc` - rm -f Makefile.cc +# hpux11 in 64bit mode has libraries in a weird place. Arrange to find +# them automatically. +case "${host}" in + hppa*64*-*-hpux11*) + extra_host_args="$extra_host_args -x-libraries=/usr/lib/pa20_64 -x-includes=/usr/X11R6/include" + ;; +esac + +# If we aren't going to be using gcc, see if we can extract a definition +# of CC from the fragment. +# Actually, use the 'pre-extracted' version above. +if test -z "${CC}" && test "${build}" = "${host}" ; then + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" + found= + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/gcc; then + found=yes + break + fi + done + IFS="$save_ifs" + if test -z "${found}" && test -n "${tentative_cc}" ; then + CC=$tentative_cc + fi fi +# Some systems (e.g., one of the i386-aix systems the gas testers are +# using) don't handle "\$" correctly, so don't use it here. +tooldir='${exec_prefix}'/${target_alias} +build_tooldir=${tooldir} + # Generate a default definition for YACC. This is used if the makefile can't # locate bison or byacc in objdir. @@ -911,38 +2123,10 @@ do test -n "$DEFAULT_LEX" && break done -if [ "${build}" != "${host}" ]; then +if test "${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. - tools="AR AR_FOR_TARGET AS AS_FOR_TARGET BISON CC_FOR_BUILD" - tools="${tools} CC_FOR_TARGET CXX_FOR_TARGET GCJ_FOR_TARGET" - tools="${tools} DLLTOOL DLLTOOL_FOR_TARGET GCC_FOR_TARGET BUILD_PREFIX" - tools="${tools} BUILD_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 eval [ -z \"\$${var}\" ] && [ -r Makefile ]; then - sed -n -e ':loop -/\\$/ N -s/\\\n//g -t loop -/^'"${var}"'[ ]*=/ s/'"${var}"'[ ]*=[ ]*\(.*\)/\1/p' \ - < Makefile > Makefile.v - t=`tail -1 Makefile.v` - if [ -n "${t}" ]; then - eval "${var}=\${t}" - fi - rm -f Makefile.v - fi - done - - AR=${AR-${host_alias}-ar} - AR_FOR_TARGET=${AR_FOR_TARGET-${target_alias}-ar} - AS=${AS-${host_alias}-as} - AS_FOR_TARGET=${AS_FOR_TARGET-${target_alias}-as} BISON=${BISON-bison} CC=${CC-${host_alias}-gcc} CFLAGS=${CFLAGS-"-g -O2"} @@ -952,24 +2136,12 @@ t loop CC_FOR_TARGET=${CC_FOR_TARGET-${target_alias}-gcc} CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++} GCJ_FOR_TARGET=${GCJ_FOR_TARGET-${target_alias}-gcj} - DLLTOOL=${DLLTOOL-${host_alias}-dlltool} - DLLTOOL_FOR_TARGET=${DLLTOOL_FOR_TARGET-${target_alias}-dlltool} GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}} BUILD_PREFIX=${build_alias}- BUILD_PREFIX_1=${build_alias}- - LD=${LD-${host_alias}-ld} - LD_FOR_TARGET=${LD_FOR_TARGET-${target_alias}-ld} MAKEINFO=${MAKEINFO-makeinfo} - NM=${NM-${host_alias}-nm} - NM_FOR_TARGET=${NM_FOR_TARGET-${target_alias}-nm} - RANLIB=${RANLIB-${host_alias}-ranlib} - RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET-${target_alias}-ranlib} - WINDRES=${WINDRES-${host_alias}-windres} - WINDRES_FOR_TARGET=${WINDRES_FOR_TARGET-${target_alias}-windres} - OBJCOPY=${OBJCOPY-${host_alias}-objcopy} - OBJDUMP=${OBJDUMP-${host_alias}-objdump} - - if [ -z "${YACC}" ]; then + + if test -z "${YACC}" ; then IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. @@ -987,12 +2159,12 @@ t loop fi done IFS="$save_ifs" - if [ -z "${YACC}" ]; then + if test -z "${YACC}" ; then YACC="bison -y" fi fi - if [ -z "${LEX}" ]; then + if test -z "${LEX}" ; then IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. @@ -1009,25 +2181,33 @@ t loop LEX=${LEX-flex} fi - # Export variables which autoconf might try to set. - export AS - export AR - export CC_FOR_BUILD - export DLLTOOL - export LD - export NM - export RANLIB - export WINDRES - export OBJCOPY - export OBJDUMP else + # Set reasonable default values for some tools even if not Canadian. + # Of course, these are different reasonable default values, originally + # specified directly in the Makefile. + # We don't export, so that autoconf can do its job. + # Note that all these settings are above the fragment inclusion point + # in Makefile.in, so can still be overridden by fragments. + # This is all going to change when we autoconfiscate... + + BISON="\$(USUAL_BISON)" + CC_FOR_BUILD="\$(CC)" + GCC_FOR_TARGET="\$(USUAL_GCC_FOR_TARGET)" + BUILD_PREFIX= + BUILD_PREFIX_1=loser- + MAKEINFO="\$(USUAL_MAKEINFO)" + LEX="\$(USUAL_LEX)" + YACC="\$(USUAL_YACC)" + # If CC is still not set, try to get gcc. - if [ -z "${CC}" ]; then + cc_prog_is_gcc= + if test -z "${CC}" ; then IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/gcc; then CC="gcc" + cc_prog_is_gcc=yes echo 'void f(){}' > conftest.c if test -z "`${CC} -g -c conftest.c 2>&1`"; then CFLAGS=${CFLAGS-"-g -O2"} @@ -1043,11 +2223,20 @@ else IFS="$save_ifs" CC=${CC-cc} else + # Determine if we are using gcc. + cat > conftest.c </dev/null 2>&1; then + cc_prog_is_gcc=yes + fi + rm -f conftest.c if test -z "${CFLAGS}"; then # Here CC is set but CFLAGS is not. Use a quick hack to use -O2 if CC # is set to a version of gcc. - case "${CC}" in - *gcc) + if test "$cc_prog_is_gcc" = yes; then echo 'void f(){}' > conftest.c if test -z "`${CC} -g -c conftest.c 2>&1`"; then CFLAGS=${CFLAGS-"-g -O2"} @@ -1057,7 +2246,25 @@ else CXXFLAGS=${CXXFLAGS-"-O2"} fi rm -f conftest* - ;; + fi + fi + fi + + # We must set the default linker to the linker used by gcc for the correct + # operation of libtool. If LD is not defined and we are using gcc, try to + # set the LD default to the ld used by gcc. + if test -z "$LD"; then + if test "$cc_prog_is_gcc" = yes; then + case $build in + *-*-mingw*) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; + *) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; + esac + case $gcc_prog_ld in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + LD="$gcc_prog_ld" ;; esac fi fi @@ -1067,546 +2274,2156 @@ else CXXFLAGS=${CXXFLAGS-"-g -O2"} fi -export CC -export CXX -export CFLAGS -export CXXFLAGS - -all_build_modules= -if test x"${build_alias}" != x"${host_alias}" -then - all_build_modules='$(ALL_BUILD_MODULES_LIST)' -fi - -for subdir in . ${subdirs} ; do - - # ${subdir} is relative path from . to the directory we're currently - # configuring. - # ${invsubdir} is inverse of ${subdir), *with* trailing /, if needed. - invsubdir=`echo ${subdir}/ | sed -e 's|\./||g' -e 's|[^/]*/|../|g'` - - ### figure out what to do with srcdir - case "${srcdir}" in - ".") # no -srcdir option. We're building in place. - makesrcdir=. ;; - /* | [A-Za-z]:[\\/]* ) # absolute path - makesrcdir=`echo ${srcdir}/${subdir} | sed -e 's|/\.$||'` - ;; - *) # otherwise relative - case "${subdir}" in - .) makesrcdir=${srcdir} ;; - *) makesrcdir=${invsubdir}${srcdir}/${subdir} ;; - esac - ;; - esac +# FIXME Should this be done recursively ??? (Useful for e.g. gdbtest) +# Set up the list of links to be made. +# ${links} is the list of link names, and ${files} is the list of names to link to. - if [ "${subdir}/" != "./" ] ; then - Makefile=${subdir}/Makefile +# Make the links. +configlinks="${links}" +if test -r ./config.status ; then + mv -f ./config.status ./config.back +fi +while test -n "${files}" ; do + # set file to car of files, files to cdr of files + set ${files}; file=$1; shift; files=$* + set ${links}; link=$1; shift; links=$* + + if test ! -r ${srcdir}/${file} ; then + if test ! -r ${file} ; then + echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2 + echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2 + exit 1 + else + srcfile=${file} fi + else + srcfile=${srcdir}/${file} + fi - if [ ! -d ${subdir} ] ; then - if mkdir ${subdir} ; then - true - else - echo '***' "${progname}: could not make ${PWD=`${PWDCMD-pwd}`}/${subdir}" 1>&2 - exit 1 - fi - fi + ${remove} -f ${link} + # Make a symlink if possible, otherwise try a hard link + if ${symbolic_link} ${srcfile} ${link} >/dev/null 2>&1 ; then + true + else + # We need to re-remove the file because Lynx leaves a + # very strange directory there when it fails an NFS symlink. + ${remove} -r -f ${link} + ${hard_link} ${srcfile} ${link} + fi + if test ! -r ${link} ; then + echo '***' "${progname}: unable to link \"${link}\" to \"${srcfile}\"." 1>&2 + exit 1 + fi - case "${removing}" in - "") - case "${subdir}" in - .) ;; - *) eval echo Building in ${subdir} ${redirect} ;; - esac - - # FIXME Should this be done recursively ??? (Useful for e.g. gdbtest) - # Set up the list of links to be made. - # ${links} is the list of link names, and ${files} is the list of names to link to. - - # Make the links. - configlinks="${links}" - if [ -r ${subdir}/config.status ] ; then - mv -f ${subdir}/config.status ${subdir}/config.back - fi - while [ -n "${files}" ] ; do - # set file to car of files, files to cdr of files - set ${files}; file=$1; shift; files=$* - set ${links}; link=$1; shift; links=$* - - if [ ! -r ${srcdir}/${file} ] ; then - if [ ! -r ${file} ] ; then - - echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2 - echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2 - exit 1 - else - srcfile=${file} - fi - else - srcfile=${srcdir}/${file} - fi - - ${remove} -f ${link} - # Make a symlink if possible, otherwise try a hard link - if ${symbolic_link} ${srcfile} ${link} >/dev/null 2>&1 ; then - true - else - # We need to re-remove the file because Lynx leaves a - # very strange directory there when it fails an NFS symlink. - ${remove} -r -f ${link} - ${hard_link} ${srcfile} ${link} - fi - if [ ! -r ${link} ] ; then - echo '***' "${progname}: unable to link \"${link}\" to \"${srcfile}\"." 1>&2 - exit 1 - fi - - echo "Linked \"${link}\" to \"${srcfile}\"." - done - - # Create a .gdbinit file which runs the one in srcdir - # and tells GDB to look there for source files. - - if [ -r ${srcdir}/${subdir}/.gdbinit ] ; then - case ${srcdir} in - .) ;; - *) cat > ${subdir}/.gdbinit < ./.gdbinit < conftest.c +${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c +if test $? = 0 ; then + if test -s conftest || test -s conftest.exe ; then + we_are_ok=yes + fi +fi +case $we_are_ok in + no) + echo 1>&2 "*** The command '${CC} -o conftest ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} conftest.c' failed." + echo 1>&2 "*** You must set the environment variable CC to a working compiler." + rm -f conftest* + exit 1 + ;; +esac +rm -f conftest* + +# The Solaris /usr/ucb/cc compiler does not appear to work. +case "${host}" in + sparc-sun-solaris2*) + CCBASE="`echo ${CC-cc} | sed 's/ .*$//'`" + if test "`type $CCBASE | sed 's/^[^/]*//'`" = "/usr/ucb/cc" ; then + could_use= + test -d /opt/SUNWspro/bin && could_use="/opt/SUNWspro/bin" + if test -d /opt/cygnus/bin ; then + if test "$could_use" = "" ; then + could_use="/opt/cygnus/bin" + else + could_use="$could_use or /opt/cygnus/bin" + fi + fi + if test "$could_use" = "" ; then + echo "Warning: compilation may fail because you're using" + echo "/usr/ucb/cc. You should change your PATH or CC " + echo "variable and rerun configure." + else + echo "Warning: compilation may fail because you're using" + echo "/usr/ucb/cc, when you should use the C compiler from" + echo "$could_use. You should change your" + echo "PATH or CC variable and rerun configure." fi + fi + ;; +esac - # Install a makefile, and make it set VPATH - # if necessary so that the sources are found. - # Also change its value of srcdir. - # NOTE: Makefile generation constitutes the majority of the time in configure. Hence, this section has - # been somewhat optimized and is perhaps a bit twisty. - - # code is order so as to try to sed the smallest input files we know. - # so do these separately because I don't trust the order of sed -e expressions. - - # the five makefile fragments MUST end up in the resulting Makefile in this order: - # package macros, target, host, site, and package rules. - - if [ -f ${srcdir}/${subdir}/${Makefile_in} ] ; then - - # Conditionalize the makefile for this package from "Makefile.in" (or whatever it's called) into Makefile.tem. - rm -f ${subdir}/${Makefile}.tem - case "${package_makefile_rules_frag}" in - "") cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem ;; - *) - if [ ! -f ${package_makefile_rules_frag} ] ; then - package_makefile_rules_frag=${srcdir}/${package_makefile_rules_frag} - fi - if [ -f ${package_makefile_rules_frag} ] ; then - sed -e "/^####/ r ${package_makefile_rules_frag}" ${srcdir}/${subdir}/${Makefile_in} > ${Makefile}.tem - else - echo '***' Expected package makefile rules fragment \"${package_makefile_rules_frag}\" 1>&2 - echo '***' is missing in ${PWD=`${PWDCMD-pwd}`}. 1>&2 - cp ${srcdir}/${subdir}/${Makefile_in} ${subdir}/Makefile.tem - fi - esac - # working copy now in ${Makefile}.tem - - # Conditionalize for this site. - rm -f ${Makefile} - case "${site}" in - "") mv ${subdir}/Makefile.tem ${Makefile} ;; - *) - site_makefile_frag=${srcdir}/config/ms-${site} - - if [ -f ${site_makefile_frag} ] ; then - sed -e "/^####/ r ${site_makefile_frag}" ${subdir}/Makefile.tem \ - > ${Makefile} - else - mv ${subdir}/Makefile.tem ${Makefile} - site_makefile_frag= - fi - ;; - esac - # working copy now in ${Makefile} - - # Conditionalize the makefile for this host. - rm -f ${subdir}/Makefile.tem - case "${host_makefile_frag}" in - "") mv ${Makefile} ${subdir}/Makefile.tem ;; - *) - if [ ! -f ${host_makefile_frag} ] ; then - host_makefile_frag=${srcdir}/${host_makefile_frag} - fi - if [ -f ${host_makefile_frag} ] ; then - sed -e "/^####/ r ${host_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem - else - echo '***' Expected host makefile fragment \"${host_makefile_frag}\" 1>&2 - echo '***' is missing in ${PWD=`${PWDCMD-pwd}`}. 1>&2 - mv ${Makefile} ${subdir}/Makefile.tem - fi - esac - # working copy now in ${subdir)/Makefile.tem - - # Conditionalize the makefile for this target. - rm -f ${Makefile} - case "${target_makefile_frag}" in - "") mv ${subdir}/Makefile.tem ${Makefile} ;; - *) - if [ ! -f ${target_makefile_frag} ] ; then - target_makefile_frag=${srcdir}/${target_makefile_frag} - fi - if [ -f ${target_makefile_frag} ] ; then - sed -e "/^####/ r ${target_makefile_frag}" ${subdir}/Makefile.tem > ${Makefile} - else - mv ${subdir}/Makefile.tem ${Makefile} - target_makefile_frag= - fi - ;; - esac - # working copy now in ${Makefile} - - # Emit the default values of this package's macros. - rm -f ${subdir}/Makefile.tem - case "${package_makefile_frag}" in - "") mv ${Makefile} ${subdir}/Makefile.tem ;; - *) - if [ ! -f ${package_makefile_frag} ] ; then - package_makefile_frag=${srcdir}/${package_makefile_frag} - fi - if [ -f ${package_makefile_frag} ] ; then - sed -e "/^####/ r ${package_makefile_frag}" ${Makefile} > ${subdir}/Makefile.tem - else - echo '***' Expected package makefile fragment \"${package_makefile_rules_frag}\" 1>&2 - echo '***' is missing in ${PWD=`${PWDCMD-pwd}`}. 1>&2 - mv ${Makefile} ${subdir}/Makefile.tem - fi - esac - # real copy now in ${subdir}/Makefile.tem - - # prepend warning about editing, and a bunch of variables. - rm -f ${Makefile} - cat > ${Makefile} <> ${Makefile} << EOF -build_alias = ${build_alias} -build_cpu = ${build_cpu} -build_vendor = ${build_vendor} -build_os = ${build_os} -build_canonical = ${build_cpu}-${build_vendor}-${build_os} -EOF - esac - - case "${package_makefile_frag}" in - "") ;; - /* | [A-Za-z]:[\\/]* ) echo package_makefile_frag = ${package_makefile_frag} >>${Makefile} ;; - *) echo package_makefile_frag = ${invsubdir}${package_makefile_frag} >>${Makefile} ;; - esac - - case "${target_makefile_frag}" in - "") ;; - /* | [A-Za-z]:[\\/]* ) echo target_makefile_frag = ${target_makefile_frag} >>${Makefile} ;; - *) echo target_makefile_frag = ${invsubdir}${target_makefile_frag} >>${Makefile} ;; - esac - - case "${host_makefile_frag}" in - "") ;; - /* | [A-Za-z]:[\\/]* ) echo host_makefile_frag = ${host_makefile_frag} >>${Makefile} ;; - *) echo host_makefile_frag = ${invsubdir}${host_makefile_frag} >>${Makefile} ;; - esac - - if [ "${site_makefile_frag}" != "" ] ; then - echo site_makefile_frag = ${invsubdir}${site_makefile_frag} >>${Makefile} - fi - - echo enable_shared = ${enable_shared} >> ${Makefile} - echo enable_threads = ${enable_threads} >> ${Makefile} - # record if we want to rumtime library stuff installed in libsubdir. - if test -z "${enable_version_specific_runtime_libs}"; then - echo enable_version_specific_runtime_libs = no >> ${Makefile} - else - echo enable_version_specific_runtime_libs = ${enable_version_specific_runtime_libs} >> ${Makefile} - fi +# If --enable-shared was set, we must set LD_LIBRARY_PATH so that the +# binutils tools will find libbfd.so. +case "${enable_shared}" in + no | "") SET_LIB_PATH= ;; + *) SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)" ;; +esac - # Emit a macro which describes the file containing gcc's - # version number. - echo gcc_version_trigger = ${gcc_version_trigger} >> ${Makefile} - # And emit a macro defining gcc's version number. - echo gcc_version = ${gcc_version} >> ${Makefile} - - # reset prefix, exec_prefix, srcdir, SUBDIRS, NONSUBDIRS, - # remove any form feeds. - if [ -z "${subdirs}" ]; then - rm -f ${subdir}/Makefile.tm2 - sedtemp=sed.$$ - cat >$sedtemp < ${subdir}/Makefile.tm2 - rm -f $sedtemp - rm -f ${subdir}/Makefile.tem - mv ${subdir}/Makefile.tm2 ${subdir}/Makefile.tem - fi - sed -e "s|^prefix[ ]*=.*$|prefix = ${prefix}|" \ - -e "s|^exec_prefix[ ]*=.*$|exec_prefix = ${exec_prefix}|" \ - -e "s|^bindir[ ]*=.*$|bindir = ${bindir}|" \ - -e "s|^sbindir[ ]*=.*$|sbindir = ${sbindir}|" \ - -e "s|^libexecdir[ ]*=.*$|libexecdir = ${libexecdir}|" \ - -e "s|^datadir[ ]*=.*$|datadir = ${datadir}|" \ - -e "s|^sysconfdir[ ]*=.*$|sysconfdir = ${sysconfdir}|" \ - -e "s|^sharedstatedir[ ]*=.*$|sharedstatedir = ${sharedstatedir}|" \ - -e "s|^localstatedir[ ]*=.*$|localstatedir = ${localstatedir}|" \ - -e "s|^libdir[ ]*=.*$|libdir = ${libdir}|" \ - -e "s|^includedir[ ]*=.*$|includedir = ${includedir}|" \ - -e "s|^oldincludedir[ ]*=.*$|oldincludedir = ${oldincludedir}|" \ - -e "s|^infodir[ ]*=.*$|infodir = ${infodir}|" \ - -e "s|^mandir[ ]*=.*$|mandir = ${mandir}|" \ - -e "s|^ALL_BUILD_MODULES =.*|ALL_BUILD_MODULES =${all_build_modules}|" \ - -e "/^CC[ ]*=/{ - :loop1 - /\\\\$/ N - s/\\\\\\n//g - t loop1 - s%^CC[ ]*=.*$%CC = ${CC}% - }" \ - -e "/^CXX[ ]*=/{ - :loop2 - /\\\\$/ N - s/\\\\\\n//g - t loop2 - s%^CXX[ ]*=.*$%CXX = ${CXX}% - }" \ - -e "/^CFLAGS[ ]*=/{ - :loop3 - /\\\\$/ N - s/\\\\\\n//g - t loop3 - s%^CFLAGS[ ]*=.*$%CFLAGS = ${CFLAGS}% - }" \ - -e "/^CXXFLAGS[ ]*=/{ - :loop4 - /\\\\$/ N - s/\\\\\\n//g - t loop4 - s%^CXXFLAGS[ ]*=.*$%CXXFLAGS = ${CXXFLAGS}% - }" \ - -e "s|^SHELL[ ]*=.*$|SHELL = ${config_shell}|" \ - -e "s|^srcdir[ ]*=.*$|srcdir = ${makesrcdir}|" \ - -e "s/ //" \ - -e "s:^program_prefix[ ]*=.*$:program_prefix = ${program_prefix}:" \ - -e "s:^program_suffix[ ]*=.*$:program_suffix = ${program_suffix}:" \ - -e "s:^program_transform_name[ ]*=.*$:program_transform_name = ${program_transform_name}:" \ - -e "s|^tooldir[ ]*=.*$|tooldir = ${tooldir}|" \ - -e "s|^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}:" \ - ${subdir}/Makefile.tem >> ${Makefile} - - sed -e "s:^GDB_TK[ ]*=.*$:GDB_TK = ${GDB_TK}:" ${Makefile} >${Makefile}.tem - mv -f ${Makefile}.tem ${Makefile} - - # If this is a Canadian Cross, preset the values of many more - # tools. - if [ "${build}" != "${host}" ]; then - for var in ${tools}; do - eval val=\$${var} - sed -e "/^${var}[ ]*=/{ - :loop1 - /\\\\$/ N - /\\\\$/ b loop1 - s/\\\\\\n//g - s%^${var}[ ]*=.*$%${var} = ${val}% - }" ${Makefile} > ${Makefile}.tem - mv -f ${Makefile}.tem ${Makefile} - done - fi +case "${host}" in + *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;; + *) RPATH_ENVVAR=LD_LIBRARY_PATH ;; +esac - # final copy now in ${Makefile} +# Record target_configdirs and the configure arguments for target and +# build configuration in Makefile. +target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'` - else - echo "No Makefile.in found in ${srcdir}/${subdir}, unable to configure" 1>&2 - fi +# This is the final value for target_configdirs. configdirs already +# has its final value, as does build_modules. It's time to create some +# lists of valid targets. - rm -f ${subdir}/Makefile.tem +all_build_modules= +configure_build_modules= +for module in ${build_modules} ; do + all_build_modules=all-build-${module} + configure_build_modules=configure-build-${module} +done - case "${host_makefile_frag}" in - "") using= ;; - *) using="and \"${host_makefile_frag}\"" ;; - esac +# Determine whether gdb needs tk/tcl or not. +# Use 'maybe' since enable_gdbtk might be true even if tk isn't available +# and in that case we want gdb to be built without tk. Ugh! +# In fact I believe gdb is the *only* package directly dependent on tk, +# so we should be able to put the 'maybe's in unconditionally and +# leave out the maybe dependencies when enable_gdbtk is false. I'm not +# 100% sure that that's safe though. + +gdb_tk="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-tix maybe-all-libgui" +case "$enable_gdbtk" in + no) + GDB_TK="" ;; + yes) + GDB_TK="${gdb_tk}" ;; + *) + # Only add the dependency on gdbtk when GDBtk is part of the gdb + # distro. Eventually someone will fix this and move Insight, nee + # gdbtk to a separate directory. + if test -d ${srcdir}/gdb/gdbtk ; then + GDB_TK="${gdb_tk}" + else + GDB_TK="" + fi + ;; +esac - case "${target_makefile_frag}" in - "") ;; - *) using="${using} and \"${target_makefile_frag}\"" ;; - esac +# Create the 'maybe dependencies'. This uses a temporary file. - case "${site_makefile_frag}" in - "") ;; - *) using="${using} and \"${site_makefile_frag}\"" ;; - esac +# While at that, we remove Makefiles if we were started for recursive +# configuration, so that the top-level Makefile reconfigures them, +# like we used to do when configure itself was recursive. +rm -f maybedep.tmp +echo '# maybedep.tmp' > maybedep.tmp - newusing=`echo "${using}" | sed 's/and/using/'` - using=${newusing} - echo "Created \"${Makefile}\" in" ${PWD=`${PWDCMD-pwd}`} ${using} +# Make-targets which may need maybe dependencies. +mts="configure all install check clean distclean dvi info install-info" +mts="${mts} installcheck mostlyclean maintainer-clean TAGS" - . ${tmpfile}.pos +# Loop over modules and make-targets. +for module in ${build_modules} ; do + if test -z "${no_recursion}" \ + && test -f ${build_subdir}/${module}/Makefile; then + echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure" + rm -f ${build_subdir}/${module}/Makefile + fi + for mt in ${mts} ; do + case ${mt} in + install) ;; # No installing build modules. + *) echo "maybe-${mt}-build-${module}: ${mt}-build-${module}" >> maybedep.tmp ;; + esac + done +done +for module in ${configdirs} ; do + if test -z "${no_recursion}" \ + && test -f ${module}/Makefile; then + echo 1>&2 "*** removing ${module}/Makefile to force reconfigure" + rm -f ${module}/Makefile + fi + for mt in ${mts} ; do + echo "maybe-${mt}-${module}: ${mt}-${module}" >> maybedep.tmp + done +done +for module in ${target_configdirs} ; do + if test -z "${no_recursion}" \ + && test -f ${target_subdir}/${module}/Makefile; then + echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure" + rm -f ${target_subdir}/${module}/Makefile + fi + for mt in ${mts} ; do + echo "maybe-${mt}-target-${module}: ${mt}-target-${module}" >> maybedep.tmp + done +done +maybe_dependencies=maybedep.tmp - # describe the chosen configuration in config.status. - # Make that file a shellscript which will reestablish - # the same configuration. Used in Makefiles to rebuild - # Makefiles. - case "${norecursion}" in - "") arguments="${arguments} --norecursion" ;; - *) ;; - esac +# Create the serialization dependencies. This uses a temporary file. - if [ ${subdir} = . ] ; then - echo "#!/bin/sh -# ${NO_EDIT} -# This directory was configured as follows: -${progname}" ${arguments} " -# ${using}" > ${subdir}/config.new - else - echo "#!/bin/sh -# ${NO_EDIT} -# This directory was configured as follows: -cd ${invsubdir} -${progname}" ${arguments} " -# ${using}" > ${subdir}/config.new - fi - chmod a+x ${subdir}/config.new - if [ -r ${subdir}/config.back ] ; then - mv -f ${subdir}/config.back ${subdir}/config.status - fi - ${config_shell} ${moveifchange} ${subdir}/config.new ${subdir}/config.status - ;; +# Check whether --enable-serial-configure or --disable-serial-configure was given. +if test "${enable_serial_configure+set}" = set; then + enableval="$enable_serial_configure" + : +fi - *) rm -f ${Makefile} ${subdir}/config.status ${links} ;; - esac + +case ${enable_serial_configure} in + yes) + enable_serial_build_configure=yes + enable_serial_host_configure=yes + enable_serial_target_configure=yes + ;; +esac + +# These force 'configure's to be done one at a time, to avoid problems +# with contention over a shared config.cache. +rm -f serdep.tmp +echo '# serdep.tmp' > serdep.tmp +olditem= +test "x${enable_serial_build_configure}" = xyes && +for item in ${build_configdirs} ; do + case ${olditem} in + "") ;; + *) echo "configure-build-${item}: configure-build-${olditem}" >> serdep.tmp ;; + esac + olditem=${item} +done +olditem= +test "x${enable_serial_host_configure}" = xyes && +for item in ${configdirs} ; do + case ${olditem} in + "") ;; + *) echo "configure-${item}: configure-${olditem}" >> serdep.tmp ;; + esac + olditem=${item} done +olditem= +test "x${enable_serial_target_configure}" = xyes && +for item in ${target_configdirs} ; do + case ${olditem} in + "") ;; + *) echo "configure-target-${item}: configure-target-${olditem}" >> serdep.tmp ;; + esac + olditem=${item} +done +serialization_dependencies=serdep.tmp + + +# Base args. Strip norecursion, cache-file, srcdir, host, build, +# target and nonopt. These are the ones we might not want to pass +# down to subconfigures. Also strip program-prefix, program-suffix, +# and program-transform-name, so that we can pass down a consistent +# program-transform-name. If autoconf has put single quotes around +# any of these arguments (because they contain shell metacharacters) +# then this will fail; in practice this only happens for +# --program-transform-name, so be sure to override --program-transform-name +# at the end of the argument list. +# These will be expanded by make, so quote '$'. +cat <<\EOF_SED > conftestsed +s/ --no[^ ]* / / +s/ --c[a-z-]*[= ][^ ]* / / +s/ --sr[a-z-]*[= ][^ ]* / / +s/ --ho[a-z-]*[= ][^ ]* / / +s/ --bu[a-z-]*[= ][^ ]* / / +s/ --t[a-z-]*[= ][^ ]* / / +s/ --program-[pst][a-z-]*[= ][^ ]* / / +s/ -cache-file[= ][^ ]* / / +s/ -srcdir[= ][^ ]* / / +s/ -host[= ][^ ]* / / +s/ -build[= ][^ ]* / / +s/ -target[= ][^ ]* / / +s/ -program-prefix[= ][^ ]* / / +s/ -program-suffix[= ][^ ]* / / +s/ -program-transform-name[= ][^ ]* / / +s/ [^' -][^ ]* / / +s/^ *//;s/ *$// +s,\$,$$,g +EOF_SED +sed -f conftestsed < conftestsed.out + ${ac_configure_args} +EOF_SED +baseargs=`cat conftestsed.out` +rm -f conftestsed conftestsed.out + +# Add in --program-transform-name, after --program-prefix and +# --program-suffix have been applied to it. Autoconf has already +# doubled dollar signs and backslashes in program_transform_name; we want +# the backslashes un-doubled, and then the entire thing wrapped in single +# quotes, because this will be expanded first by make and then by the shell. +# Also, because we want to override the logic in subdir configure scripts to +# choose program_transform_name, replace any s,x,x, with s,y,y,. +sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" < conftestsed.out +${program_transform_name} +EOF_SED +gcc_transform_name=`cat conftestsed.out` +rm -f conftestsed.out +baseargs="$baseargs --program-transform-name='${gcc_transform_name}'" + +# For the build-side libraries, we just need to pretend we're native, +# and not use the same cache file. Multilibs are neither needed nor +# desired. +build_configargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} ${baseargs}" + +# For host modules, accept cache file option, or specification as blank. +case "${cache_file}" in +"") # empty + cache_file_option="" ;; +/* | [A-Za-z]:[\\/]* ) # absolute path + cache_file_option="--cache-file=${cache_file}" ;; +*) # relative path + cache_file_option="--cache-file=../${cache_file}" ;; +esac -# If there are subdirectories, then recur. -if [ -z "${norecursion}" ] && [ -n "${configdirs}" ] ; then - for configdir in ${configdirs} ${extraconfigdirs} ; do - - # If configdir contains ',' it is - # srcdir,builddir,target_alias - # These come from extraconfigdirs. - case ${configdir} in - *,*) - eval `echo ${configdir} | sed -e 's/\([^,]*\),\([^,]*\),\(.*\)/cfg_dir=\1 bld_dir=\2 tgt_alias=\3/'` - ;; - *) - cfg_dir=${configdir} - bld_dir=${configdir} - tgt_alias=${target_alias} - ;; - esac - - if [ -d ${srcdir}/${cfg_dir} ] ; then - eval echo Configuring ${configdir}... ${redirect} - case "${srcdir}" in - ".") ;; - *) - if [ ! -d ./${bld_dir} ] ; then - if mkdir ./${bld_dir} ; then - true - else - echo '***' "${progname}: could not make ${PWD=`${PWDCMD-pwd}`}/${bld_dir}" 1>&2 - exit 1 - fi - fi - ;; - esac - - POPDIR=${PWD=`${PWDCMD-pwd}`} - cd ${bld_dir} - -### figure out what to do with srcdir - case "${srcdir}" in - ".") newsrcdir=${srcdir} ;; # no -srcdir option. We're building in place. - /* | [A-Za-z]:[\\/]* ) # absolute path - newsrcdir=${srcdir}/${cfg_dir} - srcdiroption="--srcdir=${newsrcdir}" - ;; - *) # otherwise relative - newsrcdir=../${srcdir}/${cfg_dir} - srcdiroption="--srcdir=${newsrcdir}" - ;; - esac - - # Handle --cache-file=../XXX - case "${cache_file}" in - "") # empty - ;; - /* | [A-Za-z]:[\\/]* ) # absolute path - cache_file_option="--cache-file=${cache_file}" - ;; - *) # relative path - cache_file_option="--cache-file=../${cache_file}" - ;; - esac - -### check for guested configure, otherwise fix possibly relative progname - if [ -f ${newsrcdir}/configure ] ; then - recprog=${newsrcdir}/configure - elif [ -f ${newsrcdir}/configure.in ] ; then - case "${progname}" in - /* | [A-Za-z]:[\\/]* ) recprog=${progname} ;; - *) recprog=../${progname} ;; - esac - else - eval echo No configuration information in ${cfg_dir} ${redirect} - recprog= - fi - -### The recursion line is here. - if [ ! -z "${recprog}" ] ; then - if eval ${config_shell} ${recprog} ${verbose} ${buildopt} --host=${host_alias} --target=${tgt_alias} \ - ${prefixoption} ${tmpdiroption} ${exec_prefixoption} \ - ${srcdiroption} ${diroptions} ${program_prefixoption} ${program_suffixoption} ${program_transform_nameoption} ${site_option} ${withoptions} ${withoutoptions} ${enableoptions} ${disableoptions} ${floating_pointoption} ${cache_file_option} ${removing} ${other_options} ${redirect} ; then - true - else - echo Configure in `${PWDCMD-pwd}` failed, exiting. 1>&2 - exit 1 - fi - fi - - cd ${POPDIR} - fi - done -fi - -# Perform the same cleanup as the trap handler, minus the "exit 1" of course, -# and reset the trap handler. -rm -rf ${tmpdir} -trap 0 +# Host dirs don't like to share a cache file either, horribly enough. +# This seems to be due to autoconf 2.5x stupidity. +host_configargs="--cache-file=./config.cache --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}" -exit 0 +target_configargs=${baseargs} -# -# Local Variables: -# fill-column: 131 -# End: -# +# Passing a --with-cross-host argument lets the target libraries know +# whether they are being built with a cross-compiler or being built +# native. However, it would be better to use other mechanisms to make the +# sorts of decisions they want to make on this basis. Please consider +# this option to be deprecated. FIXME. +if test x${is_cross_compiler} = xyes ; then + target_configargs="--with-cross-host=${host_alias} ${target_configargs}" +fi + +# Default to --enable-multilib. +if test x${enable_multilib} = x ; then + target_configargs="--enable-multilib ${target_configargs}" +fi + +# Pass --with-newlib if appropriate. Note that target_configdirs has +# changed from the earlier setting of with_newlib. +if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then + target_configargs="--with-newlib ${target_configargs}" +fi + +# Different target subdirs use different values of certain variables +# (notably CXX). Worse, multilibs use *lots* of different values. +# Worse yet, autoconf 2.5x makes some of these 'precious', meaning that +# it doesn't automatically accept command-line overrides of them. +# This means it's not safe for target subdirs to share a cache file, +# which is disgusting, but there you have it. Hopefully this can be +# fixed in future. It's still worthwhile to use a cache file for each +# directory. I think. + +# Pass the appropriate --host, --build, and --cache-file arguments. +target_configargs="--cache-file=./config.cache --host=${target_alias} --build=${build_alias} ${target_configargs}" + +# provide a proper gxx_include_dir. +# Note, if you change the default, make sure to fix both here and in +# the gcc and libstdc++-v3 subdirectories. +# Check whether --with-gxx-include-dir or --without-gxx-include-dir was given. +case "${with_gxx_include_dir}" in + yes) + { echo "configure: error: --with-gxx-include-dir=[dir] requires a directory" 1>&2; exit 1; } + ;; + no | "") + case "${enable_version_specific_runtime_libs}" in + yes) gxx_include_dir='${libsubdir}/include/c++' ;; + *) + . ${srcdir}/config.if + gxx_include_dir='${prefix}/include/'${libstdcxx_incdir} ;; + esac ;; + *) gxx_include_dir=${with_gxx_include_dir} ;; +esac + +FLAGS_FOR_TARGET= +case " $target_configdirs " in + *" newlib "*) + case " $target_configargs " in + *" --with-newlib "*) + case "$target" in + *-cygwin*) + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include' ;; + esac + + # If we're not building GCC, don't discard standard headers. + if test -d ${srcdir}/gcc; then + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -nostdinc' + + if test "${build}" != "${host}"; then + # On Canadian crosses, CC_FOR_TARGET will have already been set + # by `configure', so we won't have an opportunity to add -Bgcc/ + # to it. This is right: we don't want to search that directory + # for binaries, but we want the header files in there, so add + # them explicitly. + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -isystem $$r/gcc/include' + + # Someone might think of using the pre-installed headers on + # Canadian crosses, in case the installed compiler is not fully + # compatible with the compiler being built. In this case, it + # would be better to flag an error than risking having + # incompatible object files being constructed. We can't + # guarantee that an error will be flagged, but let's hope the + # compiler will do it, when presented with incompatible header + # files. + fi + fi + + case "${target}-${is_cross_compiler}" in + i[3456789]86-*-linux*-no) + # Here host == target, so we don't need to build gcc, + # so we don't want to discard standard headers. + FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'` + ;; + *) + # If we're building newlib, use its generic headers last, but search + # for any libc-related directories first (so make it the last -B + # switch). + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$$r/$(TARGET_SUBDIR)/newlib/ -isystem $$r/$(TARGET_SUBDIR)/newlib/targ-include -isystem $$s/newlib/libc/include' + ;; + esac + ;; + esac + ;; +esac + +# Allow the user to override the flags for +# our build compiler if desired. +CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} + +# On Canadian crosses, we'll be searching the right directories for +# the previously-installed cross compiler, so don't bother to add +# flags for directories within the install tree of the compiler +# being built; programs in there won't even run. +if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then + # Search for pre-installed headers if nothing else fits. + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include' +fi + +if test "x${use_gnu_ld}" = x && + echo " ${configdirs} " | grep " ld " > /dev/null ; then + # Arrange for us to find uninstalled linker scripts. + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/ld' +fi + +if test "x${CC_FOR_TARGET+set}" = xset; then + : +elif test -d ${srcdir}/gcc; then + CC_FOR_TARGET='$$r/gcc/xgcc -B$$r/gcc/' +elif test "$host" = "$target"; then + CC_FOR_TARGET='$(CC)' +else + CC_FOR_TARGET=`echo gcc | sed "${program_transform_name}"` +fi +CC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)' + +if test "x${GCJ_FOR_TARGET+set}" = xset; then + : +elif test -d ${srcdir}/gcc; then + GCJ_FOR_TARGET='$$r/gcc/gcj -B$$r/gcc/' +elif test "$host" = "$target"; then + GCJ_FOR_TARGET='gcj' +else + GCJ_FOR_TARGET=`echo gcj | sed "${program_transform_name}"` +fi +GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)' + +# Don't use libstdc++-v3's flags to configure/build itself. +libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' +raw_libstdcxx_flags='-L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' + +if test "x${CXX_FOR_TARGET+set}" = xset; then + if test "x${RAW_CXX_FOR_TARGET+set}" != xset; then + RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET} + fi +elif test -d ${srcdir}/gcc; then + # We add -shared-libgcc to CXX_FOR_TARGET whenever we use xgcc instead + # of g++ for linking C++ or Java, because g++ has -shared-libgcc by + # default whereas gcc does not. + # RAW_CXX_FOR_TARGET is for linking C++ or java; CXX_FOR_TARGET is for + # all other cases. + CXX_FOR_TARGET='$$r/gcc/g++ -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags + RAW_CXX_FOR_TARGET='$$r/gcc/xgcc -shared-libgcc -B$$r/gcc/ -nostdinc++ '$raw_libstdcxx_flags +elif test "$host" = "$target"; then + CXX_FOR_TARGET='$(CXX)' + RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET} +else + CXX_FOR_TARGET=`echo c++ | sed "${program_transform_name}"` + RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET} +fi +CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' +RAW_CXX_FOR_TARGET=$RAW_CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' + +qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'` +qRAW_CXX_FOR_TARGET=`echo "$RAW_CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'` + +# We want to defer the evaluation of `cmd`s and shell variables in +# CXX_FOR_TARGET when recursing in the top-level Makefile, such as for +# bootstrap. We'll enclose CXX_FOR_TARGET_FOR_RECURSIVE_MAKE in single +# quotes, but we still have to duplicate `$'s so that shell variables +# can be expanded by the nested make as shell variables, not as make +# macros. +qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'` +qqRAW_CXX_FOR_TARGET=`echo "$qRAW_CXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'` + +# Wrap CC_FOR_TARGET and friends, for certain types of builds. +CC_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${CC_FOR_TARGET}" +GCJ_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${GCJ_FOR_TARGET}" +CXX_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${qCXX_FOR_TARGET}" +RAW_CXX_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${qRAW_CXX_FOR_TARGET}" +CXX_FOR_TARGET_FOR_RECURSIVE_MAKE="\$(STAGE_CC_WRAPPER) ${qqCXX_FOR_TARGET}" +RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE="\$(STAGE_CC_WRAPPER) ${qqRAW_CXX_FOR_TARGET}" + +# Makefile fragments. +host_makefile_frag=${srcdir}/${host_makefile_frag} +target_makefile_frag=${srcdir}/${target_makefile_frag} +alphaieee_frag=${srcdir}/${alphaieee_frag} +ospace_frag=${srcdir}/${ospace_frag} + + + + + +# Miscellanea: directories, flags, etc. + + + + + + + + + + + + + +# Build module lists & subconfigure args. + + + + +# Host module lists & subconfigure args. + + + +# Target module lists & subconfigure args. + + + +# Build tools. + + + + + + + +# Host tools. +ncn_tool_prefix= +test -n "$host_alias" && ncn_tool_prefix=$host_alias- +ncn_target_tool_prefix= +test -n "$target_alias" && ncn_target_tool_prefix=$target_alias- + + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args. +set dummy ${ncn_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2855: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + 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_AR="${ncn_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +AR="$ac_cv_prog_AR" +if test -n "$AR"; then + echo "$ac_t""$AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ac_cv_prog_AR" ; then + if test $build = $host ; then + ncn_cv_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2888: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_AR"; then + ac_cv_prog_ncn_cv_AR="$ncn_cv_AR" # 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_ncn_cv_AR="ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_AR" && ac_cv_prog_ncn_cv_AR="ar" +fi +fi +ncn_cv_AR="$ac_cv_prog_ncn_cv_AR" +if test -n "$ncn_cv_AR"; then + echo "$ac_t""$ncn_cv_AR" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + AR=$ncn_cv_AR + else + AR="${ncn_tool_prefix}ar" + fi +else + AR="$ac_cv_prog_AR" +fi + + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args. +set dummy ${ncn_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2927: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS"; then + ac_cv_prog_AS="$AS" # 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_AS="${ncn_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +AS="$ac_cv_prog_AS" +if test -n "$AS"; then + echo "$ac_t""$AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ac_cv_prog_AS" ; then + if test $build = $host ; then + ncn_cv_AS=$AS + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2960: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_AS"; then + ac_cv_prog_ncn_cv_AS="$ncn_cv_AS" # 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_ncn_cv_AS="as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_AS" && ac_cv_prog_ncn_cv_AS="as" +fi +fi +ncn_cv_AS="$ac_cv_prog_ncn_cv_AS" +if test -n "$ncn_cv_AS"; then + echo "$ac_t""$ncn_cv_AS" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + AS=$ncn_cv_AS + else + AS="${ncn_tool_prefix}as" + fi +else + AS="$ac_cv_prog_AS" +fi + + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ncn_tool_prefix}dlltool; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2999: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$DLLTOOL"; then + ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ncn_tool_prefix}dlltool" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +DLLTOOL="$ac_cv_prog_DLLTOOL" +if test -n "$DLLTOOL"; then + echo "$ac_t""$DLLTOOL" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ac_cv_prog_DLLTOOL" ; then + if test $build = $host ; then + ncn_cv_DLLTOOL=$DLLTOOL + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3032: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_DLLTOOL"; then + ac_cv_prog_ncn_cv_DLLTOOL="$ncn_cv_DLLTOOL" # 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_ncn_cv_DLLTOOL="dlltool" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_DLLTOOL" && ac_cv_prog_ncn_cv_DLLTOOL="dlltool" +fi +fi +ncn_cv_DLLTOOL="$ac_cv_prog_ncn_cv_DLLTOOL" +if test -n "$ncn_cv_DLLTOOL"; then + echo "$ac_t""$ncn_cv_DLLTOOL" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + DLLTOOL=$ncn_cv_DLLTOOL + else + DLLTOOL="${ncn_tool_prefix}dlltool" + fi +else + DLLTOOL="$ac_cv_prog_DLLTOOL" +fi + + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args. +set dummy ${ncn_tool_prefix}ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3071: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$LD"; then + ac_cv_prog_LD="$LD" # 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_LD="${ncn_tool_prefix}ld" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +LD="$ac_cv_prog_LD" +if test -n "$LD"; then + echo "$ac_t""$LD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ac_cv_prog_LD" ; then + if test $build = $host ; then + ncn_cv_LD=$LD + # Extract the first word of "ld", so it can be a program name with args. +set dummy ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3104: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_LD"; then + ac_cv_prog_ncn_cv_LD="$ncn_cv_LD" # 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_ncn_cv_LD="ld" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_LD" && ac_cv_prog_ncn_cv_LD="ld" +fi +fi +ncn_cv_LD="$ac_cv_prog_ncn_cv_LD" +if test -n "$ncn_cv_LD"; then + echo "$ac_t""$ncn_cv_LD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + LD=$ncn_cv_LD + else + LD="${ncn_tool_prefix}ld" + fi +else + LD="$ac_cv_prog_LD" +fi + + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args. +set dummy ${ncn_tool_prefix}nm; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3143: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$NM"; then + ac_cv_prog_NM="$NM" # 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_NM="${ncn_tool_prefix}nm" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +NM="$ac_cv_prog_NM" +if test -n "$NM"; then + echo "$ac_t""$NM" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ac_cv_prog_NM" ; then + if test $build = $host ; then + ncn_cv_NM=$NM + # Extract the first word of "nm", so it can be a program name with args. +set dummy nm; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3176: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_NM"; then + ac_cv_prog_ncn_cv_NM="$ncn_cv_NM" # 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_ncn_cv_NM="nm" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_NM" && ac_cv_prog_ncn_cv_NM="nm" +fi +fi +ncn_cv_NM="$ac_cv_prog_ncn_cv_NM" +if test -n "$ncn_cv_NM"; then + echo "$ac_t""$ncn_cv_NM" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + NM=$ncn_cv_NM + else + NM="${ncn_tool_prefix}nm" + fi +else + NM="$ac_cv_prog_NM" +fi + + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ncn_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3215: 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="${ncn_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 + +fi +if test -z "$ac_cv_prog_RANLIB" ; then + if test $build = $host ; then + ncn_cv_RANLIB=$RANLIB + # 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:3248: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_RANLIB"; then + ac_cv_prog_ncn_cv_RANLIB="$ncn_cv_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_ncn_cv_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_RANLIB" && ac_cv_prog_ncn_cv_RANLIB=":" +fi +fi +ncn_cv_RANLIB="$ac_cv_prog_ncn_cv_RANLIB" +if test -n "$ncn_cv_RANLIB"; then + echo "$ac_t""$ncn_cv_RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + RANLIB=$ncn_cv_RANLIB + else + RANLIB=":" + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args. +set dummy ${ncn_tool_prefix}windres; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3287: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$WINDRES"; then + ac_cv_prog_WINDRES="$WINDRES" # 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_WINDRES="${ncn_tool_prefix}windres" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +WINDRES="$ac_cv_prog_WINDRES" +if test -n "$WINDRES"; then + echo "$ac_t""$WINDRES" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ac_cv_prog_WINDRES" ; then + if test $build = $host ; then + ncn_cv_WINDRES=$WINDRES + # Extract the first word of "windres", so it can be a program name with args. +set dummy windres; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3320: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_WINDRES"; then + ac_cv_prog_ncn_cv_WINDRES="$ncn_cv_WINDRES" # 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_ncn_cv_WINDRES="windres" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_WINDRES" && ac_cv_prog_ncn_cv_WINDRES="windres" +fi +fi +ncn_cv_WINDRES="$ac_cv_prog_ncn_cv_WINDRES" +if test -n "$ncn_cv_WINDRES"; then + echo "$ac_t""$ncn_cv_WINDRES" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + WINDRES=$ncn_cv_WINDRES + else + WINDRES="${ncn_tool_prefix}windres" + fi +else + WINDRES="$ac_cv_prog_WINDRES" +fi + + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args. +set dummy ${ncn_tool_prefix}objcopy; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3359: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$OBJCOPY"; then + ac_cv_prog_OBJCOPY="$OBJCOPY" # 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_OBJCOPY="${ncn_tool_prefix}objcopy" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +OBJCOPY="$ac_cv_prog_OBJCOPY" +if test -n "$OBJCOPY"; then + echo "$ac_t""$OBJCOPY" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ac_cv_prog_OBJCOPY" ; then + if test $build = $host ; then + ncn_cv_OBJCOPY=$OBJCOPY + # Extract the first word of "objcopy", so it can be a program name with args. +set dummy objcopy; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3392: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_OBJCOPY"; then + ac_cv_prog_ncn_cv_OBJCOPY="$ncn_cv_OBJCOPY" # 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_ncn_cv_OBJCOPY="objcopy" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_OBJCOPY" && ac_cv_prog_ncn_cv_OBJCOPY="objcopy" +fi +fi +ncn_cv_OBJCOPY="$ac_cv_prog_ncn_cv_OBJCOPY" +if test -n "$ncn_cv_OBJCOPY"; then + echo "$ac_t""$ncn_cv_OBJCOPY" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + OBJCOPY=$ncn_cv_OBJCOPY + else + OBJCOPY="${ncn_tool_prefix}objcopy" + fi +else + OBJCOPY="$ac_cv_prog_OBJCOPY" +fi + + if test -n "$ncn_tool_prefix"; then + # Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ncn_tool_prefix}objdump; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3431: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$OBJDUMP"; then + ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ncn_tool_prefix}objdump" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +OBJDUMP="$ac_cv_prog_OBJDUMP" +if test -n "$OBJDUMP"; then + echo "$ac_t""$OBJDUMP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ac_cv_prog_OBJDUMP" ; then + if test $build = $host ; then + ncn_cv_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3464: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_OBJDUMP"; then + ac_cv_prog_ncn_cv_OBJDUMP="$ncn_cv_OBJDUMP" # 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_ncn_cv_OBJDUMP="objdump" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_OBJDUMP" && ac_cv_prog_ncn_cv_OBJDUMP="objdump" +fi +fi +ncn_cv_OBJDUMP="$ac_cv_prog_ncn_cv_OBJDUMP" +if test -n "$ncn_cv_OBJDUMP"; then + echo "$ac_t""$ncn_cv_OBJDUMP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + OBJDUMP=$ncn_cv_OBJDUMP + else + OBJDUMP="${ncn_tool_prefix}objdump" + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + + + + + + + + + + +# Target tools. + if test -n "$ncn_target_tool_prefix"; then + # Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args. +set dummy ${ncn_target_tool_prefix}ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3513: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AR_FOR_TARGET"; then + ac_cv_prog_AR_FOR_TARGET="$AR_FOR_TARGET" # 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_AR_FOR_TARGET="${ncn_target_tool_prefix}ar" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +AR_FOR_TARGET="$ac_cv_prog_AR_FOR_TARGET" +if test -n "$AR_FOR_TARGET"; then + echo "$ac_t""$AR_FOR_TARGET" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ac_cv_prog_AR_FOR_TARGET" ; then + if test $build = $target ; then + ncn_cv_AR_FOR_TARGET=$AR_FOR_TARGET + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3546: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR_FOR_TARGET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_AR_FOR_TARGET"; then + ac_cv_prog_ncn_cv_AR_FOR_TARGET="$ncn_cv_AR_FOR_TARGET" # 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_ncn_cv_AR_FOR_TARGET="ar" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_AR_FOR_TARGET" && ac_cv_prog_ncn_cv_AR_FOR_TARGET="ar" +fi +fi +ncn_cv_AR_FOR_TARGET="$ac_cv_prog_ncn_cv_AR_FOR_TARGET" +if test -n "$ncn_cv_AR_FOR_TARGET"; then + echo "$ac_t""$ncn_cv_AR_FOR_TARGET" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + AR_FOR_TARGET=$ncn_cv_AR_FOR_TARGET + else + AR_FOR_TARGET="${ncn_target_tool_prefix}ar" + fi +else + AR_FOR_TARGET="$ac_cv_prog_AR_FOR_TARGET" +fi + + if test -n "$ncn_target_tool_prefix"; then + # Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args. +set dummy ${ncn_target_tool_prefix}as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3585: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$AS_FOR_TARGET"; then + ac_cv_prog_AS_FOR_TARGET="$AS_FOR_TARGET" # 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_AS_FOR_TARGET="${ncn_target_tool_prefix}as" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +AS_FOR_TARGET="$ac_cv_prog_AS_FOR_TARGET" +if test -n "$AS_FOR_TARGET"; then + echo "$ac_t""$AS_FOR_TARGET" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ac_cv_prog_AS_FOR_TARGET" ; then + if test $build = $target ; then + ncn_cv_AS_FOR_TARGET=$AS_FOR_TARGET + # Extract the first word of "as", so it can be a program name with args. +set dummy as; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3618: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS_FOR_TARGET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_AS_FOR_TARGET"; then + ac_cv_prog_ncn_cv_AS_FOR_TARGET="$ncn_cv_AS_FOR_TARGET" # 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_ncn_cv_AS_FOR_TARGET="as" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_AS_FOR_TARGET" && ac_cv_prog_ncn_cv_AS_FOR_TARGET="as" +fi +fi +ncn_cv_AS_FOR_TARGET="$ac_cv_prog_ncn_cv_AS_FOR_TARGET" +if test -n "$ncn_cv_AS_FOR_TARGET"; then + echo "$ac_t""$ncn_cv_AS_FOR_TARGET" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + AS_FOR_TARGET=$ncn_cv_AS_FOR_TARGET + else + AS_FOR_TARGET="${ncn_target_tool_prefix}as" + fi +else + AS_FOR_TARGET="$ac_cv_prog_AS_FOR_TARGET" +fi + + if test -n "$ncn_target_tool_prefix"; then + # Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args. +set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3657: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$DLLTOOL_FOR_TARGET"; then + ac_cv_prog_DLLTOOL_FOR_TARGET="$DLLTOOL_FOR_TARGET" # 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_DLLTOOL_FOR_TARGET="${ncn_target_tool_prefix}dlltool" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +DLLTOOL_FOR_TARGET="$ac_cv_prog_DLLTOOL_FOR_TARGET" +if test -n "$DLLTOOL_FOR_TARGET"; then + echo "$ac_t""$DLLTOOL_FOR_TARGET" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" ; then + if test $build = $target ; then + ncn_cv_DLLTOOL_FOR_TARGET=$DLLTOOL_FOR_TARGET + # Extract the first word of "dlltool", so it can be a program name with args. +set dummy dlltool; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3690: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_DLLTOOL_FOR_TARGET"; then + ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET="$ncn_cv_DLLTOOL_FOR_TARGET" # 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_ncn_cv_DLLTOOL_FOR_TARGET="dlltool" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET" && ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET="dlltool" +fi +fi +ncn_cv_DLLTOOL_FOR_TARGET="$ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET" +if test -n "$ncn_cv_DLLTOOL_FOR_TARGET"; then + echo "$ac_t""$ncn_cv_DLLTOOL_FOR_TARGET" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + DLLTOOL_FOR_TARGET=$ncn_cv_DLLTOOL_FOR_TARGET + else + DLLTOOL_FOR_TARGET="${ncn_target_tool_prefix}dlltool" + fi +else + DLLTOOL_FOR_TARGET="$ac_cv_prog_DLLTOOL_FOR_TARGET" +fi + + if test -n "$ncn_target_tool_prefix"; then + # Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args. +set dummy ${ncn_target_tool_prefix}ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3729: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$LD_FOR_TARGET"; then + ac_cv_prog_LD_FOR_TARGET="$LD_FOR_TARGET" # 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_LD_FOR_TARGET="${ncn_target_tool_prefix}ld" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +LD_FOR_TARGET="$ac_cv_prog_LD_FOR_TARGET" +if test -n "$LD_FOR_TARGET"; then + echo "$ac_t""$LD_FOR_TARGET" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ac_cv_prog_LD_FOR_TARGET" ; then + if test $build = $target ; then + ncn_cv_LD_FOR_TARGET=$LD_FOR_TARGET + # Extract the first word of "ld", so it can be a program name with args. +set dummy ld; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3762: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD_FOR_TARGET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_LD_FOR_TARGET"; then + ac_cv_prog_ncn_cv_LD_FOR_TARGET="$ncn_cv_LD_FOR_TARGET" # 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_ncn_cv_LD_FOR_TARGET="ld" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_LD_FOR_TARGET" && ac_cv_prog_ncn_cv_LD_FOR_TARGET="ld" +fi +fi +ncn_cv_LD_FOR_TARGET="$ac_cv_prog_ncn_cv_LD_FOR_TARGET" +if test -n "$ncn_cv_LD_FOR_TARGET"; then + echo "$ac_t""$ncn_cv_LD_FOR_TARGET" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + LD_FOR_TARGET=$ncn_cv_LD_FOR_TARGET + else + LD_FOR_TARGET="${ncn_target_tool_prefix}ld" + fi +else + LD_FOR_TARGET="$ac_cv_prog_LD_FOR_TARGET" +fi + + if test -n "$ncn_target_tool_prefix"; then + # Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args. +set dummy ${ncn_target_tool_prefix}nm; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3801: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$NM_FOR_TARGET"; then + ac_cv_prog_NM_FOR_TARGET="$NM_FOR_TARGET" # 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_NM_FOR_TARGET="${ncn_target_tool_prefix}nm" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +NM_FOR_TARGET="$ac_cv_prog_NM_FOR_TARGET" +if test -n "$NM_FOR_TARGET"; then + echo "$ac_t""$NM_FOR_TARGET" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ac_cv_prog_NM_FOR_TARGET" ; then + if test $build = $target ; then + ncn_cv_NM_FOR_TARGET=$NM_FOR_TARGET + # Extract the first word of "nm", so it can be a program name with args. +set dummy nm; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3834: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM_FOR_TARGET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_NM_FOR_TARGET"; then + ac_cv_prog_ncn_cv_NM_FOR_TARGET="$ncn_cv_NM_FOR_TARGET" # 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_ncn_cv_NM_FOR_TARGET="nm" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_NM_FOR_TARGET" && ac_cv_prog_ncn_cv_NM_FOR_TARGET="nm" +fi +fi +ncn_cv_NM_FOR_TARGET="$ac_cv_prog_ncn_cv_NM_FOR_TARGET" +if test -n "$ncn_cv_NM_FOR_TARGET"; then + echo "$ac_t""$ncn_cv_NM_FOR_TARGET" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + NM_FOR_TARGET=$ncn_cv_NM_FOR_TARGET + else + NM_FOR_TARGET="${ncn_target_tool_prefix}nm" + fi +else + NM_FOR_TARGET="$ac_cv_prog_NM_FOR_TARGET" +fi + + if test -n "$ncn_target_tool_prefix"; then + # Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3873: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB_FOR_TARGET"; then + ac_cv_prog_RANLIB_FOR_TARGET="$RANLIB_FOR_TARGET" # 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_FOR_TARGET="${ncn_target_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB_FOR_TARGET="$ac_cv_prog_RANLIB_FOR_TARGET" +if test -n "$RANLIB_FOR_TARGET"; then + echo "$ac_t""$RANLIB_FOR_TARGET" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" ; then + if test $build = $target ; then + ncn_cv_RANLIB_FOR_TARGET=$RANLIB_FOR_TARGET + # 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:3906: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_RANLIB_FOR_TARGET"; then + ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET="$ncn_cv_RANLIB_FOR_TARGET" # 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_ncn_cv_RANLIB_FOR_TARGET="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET" && ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET=":" +fi +fi +ncn_cv_RANLIB_FOR_TARGET="$ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET" +if test -n "$ncn_cv_RANLIB_FOR_TARGET"; then + echo "$ac_t""$ncn_cv_RANLIB_FOR_TARGET" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + RANLIB_FOR_TARGET=$ncn_cv_RANLIB_FOR_TARGET + else + RANLIB_FOR_TARGET=":" + fi +else + RANLIB_FOR_TARGET="$ac_cv_prog_RANLIB_FOR_TARGET" +fi + + if test -n "$ncn_target_tool_prefix"; then + # Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args. +set dummy ${ncn_target_tool_prefix}windres; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3945: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$WINDRES_FOR_TARGET"; then + ac_cv_prog_WINDRES_FOR_TARGET="$WINDRES_FOR_TARGET" # 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_WINDRES_FOR_TARGET="${ncn_target_tool_prefix}windres" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +WINDRES_FOR_TARGET="$ac_cv_prog_WINDRES_FOR_TARGET" +if test -n "$WINDRES_FOR_TARGET"; then + echo "$ac_t""$WINDRES_FOR_TARGET" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +fi +if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" ; then + if test $build = $target ; then + ncn_cv_WINDRES_FOR_TARGET=$WINDRES_FOR_TARGET + # Extract the first word of "windres", so it can be a program name with args. +set dummy windres; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3978: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$ncn_cv_WINDRES_FOR_TARGET"; then + ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET="$ncn_cv_WINDRES_FOR_TARGET" # 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_ncn_cv_WINDRES_FOR_TARGET="windres" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET" && ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET="windres" +fi +fi +ncn_cv_WINDRES_FOR_TARGET="$ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET" +if test -n "$ncn_cv_WINDRES_FOR_TARGET"; then + echo "$ac_t""$ncn_cv_WINDRES_FOR_TARGET" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + WINDRES_FOR_TARGET=$ncn_cv_WINDRES_FOR_TARGET + else + WINDRES_FOR_TARGET="${ncn_target_tool_prefix}windres" + fi +else + WINDRES_FOR_TARGET="$ac_cv_prog_WINDRES_FOR_TARGET" +fi + + + + + + + + + + + +# Fix up target tools. +if test "x${build}" = "x${host}" ; then + # In this case, the newly built tools can and should be used, + # so we override the results of the autoconf tests. + # This should really only happen when the tools are actually being built, + # but that's a further refinement. The new build scheme, where + # tools are built into a structure paralleling where they're installed, + # should also eliminate all of this cleanly. + AR_FOR_TARGET="\$(USUAL_AR_FOR_TARGET)" + AS_FOR_TARGET="\$(USUAL_AS_FOR_TARGET)" + DLLTOOL_FOR_TARGET="\$(USUAL_DLLTOOL_FOR_TARGET)" + LD_FOR_TARGET="\$(USUAL_LD_FOR_TARGET)" + NM_FOR_TARGET="\$(USUAL_NM_FOR_TARGET)" + RANLIB_FOR_TARGET="\$(USUAL_RANLIB_FOR_TARGET)" + WINDRES_FOR_TARGET="\$(USUAL_WINDRES_FOR_TARGET)" +fi +# Certain tools may need extra flags. +AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target} +RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target} +NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target} + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:4045: checking whether to enable maintainer-specific portions of Makefiles" >&5 +# Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + +echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + + +if test "$USE_MAINTAINER_MODE" = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi +MAINT=$MAINTAINER_MODE_TRUE + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +# Transform confdefs.h into DEFS. +# Protect against shell expansion while executing Makefile rules. +# Protect against Makefile macro expansion. +cat > conftest.defs <<\EOF +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g +s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g +s%\[%\\&%g +s%\]%\\&%g +s%\$%$$%g +EOF +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` +rm -f conftest.defs + + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS </dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@target@%$target%g +s%@target_alias@%$target_alias%g +s%@target_cpu@%$target_cpu%g +s%@target_vendor@%$target_vendor%g +s%@target_os@%$target_os%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@TOPLEVEL_CONFIGURE_ARGUMENTS@%$TOPLEVEL_CONFIGURE_ARGUMENTS%g +s%@build_subdir@%$build_subdir%g +s%@host_subdir@%$host_subdir%g +s%@target_subdir@%$target_subdir%g +/@maybe_dependencies@/r $maybe_dependencies +s%@maybe_dependencies@%%g +/@serialization_dependencies@/r $serialization_dependencies +s%@serialization_dependencies@%%g +/@host_makefile_frag@/r $host_makefile_frag +s%@host_makefile_frag@%%g +/@target_makefile_frag@/r $target_makefile_frag +s%@target_makefile_frag@%%g +/@alphaieee_frag@/r $alphaieee_frag +s%@alphaieee_frag@%%g +/@ospace_frag@/r $ospace_frag +s%@ospace_frag@%%g +s%@SET_LIB_PATH@%$SET_LIB_PATH%g +s%@RPATH_ENVVAR@%$RPATH_ENVVAR%g +s%@BUILD_PREFIX@%$BUILD_PREFIX%g +s%@BUILD_PREFIX_1@%$BUILD_PREFIX_1%g +s%@configlinks@%$configlinks%g +s%@gcc_version_trigger@%$gcc_version_trigger%g +s%@gcc_version@%$gcc_version%g +s%@tooldir@%$tooldir%g +s%@build_tooldir@%$build_tooldir%g +s%@GDB_TK@%$GDB_TK%g +s%@gxx_include_dir@%$gxx_include_dir%g +s%@libstdcxx_incdir@%$libstdcxx_incdir%g +s%@build_configargs@%$build_configargs%g +s%@configure_build_modules@%$configure_build_modules%g +s%@all_build_modules@%$all_build_modules%g +s%@host_configargs@%$host_configargs%g +s%@configdirs@%$configdirs%g +s%@target_configargs@%$target_configargs%g +s%@target_configdirs@%$target_configdirs%g +s%@BISON@%$BISON%g +s%@CC_FOR_BUILD@%$CC_FOR_BUILD%g +s%@LEX@%$LEX%g +s%@MAKEINFO@%$MAKEINFO%g +s%@YACC@%$YACC%g +s%@config_shell@%$config_shell%g +s%@AR@%$AR%g +s%@ncn_cv_AR@%$ncn_cv_AR%g +s%@AS@%$AS%g +s%@ncn_cv_AS@%$ncn_cv_AS%g +s%@DLLTOOL@%$DLLTOOL%g +s%@ncn_cv_DLLTOOL@%$ncn_cv_DLLTOOL%g +s%@LD@%$LD%g +s%@ncn_cv_LD@%$ncn_cv_LD%g +s%@NM@%$NM%g +s%@ncn_cv_NM@%$ncn_cv_NM%g +s%@RANLIB@%$RANLIB%g +s%@ncn_cv_RANLIB@%$ncn_cv_RANLIB%g +s%@WINDRES@%$WINDRES%g +s%@ncn_cv_WINDRES@%$ncn_cv_WINDRES%g +s%@OBJCOPY@%$OBJCOPY%g +s%@ncn_cv_OBJCOPY@%$ncn_cv_OBJCOPY%g +s%@OBJDUMP@%$OBJDUMP%g +s%@ncn_cv_OBJDUMP@%$ncn_cv_OBJDUMP%g +s%@CC@%$CC%g +s%@CXX@%$CXX%g +s%@CFLAGS_FOR_BUILD@%$CFLAGS_FOR_BUILD%g +s%@DEFAULT_YACC@%$DEFAULT_YACC%g +s%@DEFAULT_LEX@%$DEFAULT_LEX%g +s%@DEFAULT_M4@%$DEFAULT_M4%g +s%@AR_FOR_TARGET@%$AR_FOR_TARGET%g +s%@ncn_cv_AR_FOR_TARGET@%$ncn_cv_AR_FOR_TARGET%g +s%@AS_FOR_TARGET@%$AS_FOR_TARGET%g +s%@ncn_cv_AS_FOR_TARGET@%$ncn_cv_AS_FOR_TARGET%g +s%@DLLTOOL_FOR_TARGET@%$DLLTOOL_FOR_TARGET%g +s%@ncn_cv_DLLTOOL_FOR_TARGET@%$ncn_cv_DLLTOOL_FOR_TARGET%g +s%@LD_FOR_TARGET@%$LD_FOR_TARGET%g +s%@ncn_cv_LD_FOR_TARGET@%$ncn_cv_LD_FOR_TARGET%g +s%@NM_FOR_TARGET@%$NM_FOR_TARGET%g +s%@ncn_cv_NM_FOR_TARGET@%$ncn_cv_NM_FOR_TARGET%g +s%@RANLIB_FOR_TARGET@%$RANLIB_FOR_TARGET%g +s%@ncn_cv_RANLIB_FOR_TARGET@%$ncn_cv_RANLIB_FOR_TARGET%g +s%@WINDRES_FOR_TARGET@%$WINDRES_FOR_TARGET%g +s%@ncn_cv_WINDRES_FOR_TARGET@%$ncn_cv_WINDRES_FOR_TARGET%g +s%@GCC_FOR_TARGET@%$GCC_FOR_TARGET%g +s%@FLAGS_FOR_TARGET@%$FLAGS_FOR_TARGET%g +s%@CC_FOR_TARGET@%$CC_FOR_TARGET%g +s%@GCJ_FOR_TARGET@%$GCJ_FOR_TARGET%g +s%@CXX_FOR_TARGET@%$CXX_FOR_TARGET%g +s%@RAW_CXX_FOR_TARGET@%$RAW_CXX_FOR_TARGET%g +s%@CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%$CXX_FOR_TARGET_FOR_RECURSIVE_MAKE%g +s%@RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@%$RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 -# end of configure diff --git a/contrib/binutils/configure.in b/contrib/binutils/configure.in index ed4f7a7..3355f0e 100644 --- a/contrib/binutils/configure.in +++ b/contrib/binutils/configure.in @@ -1,21 +1,5 @@ -#! /bin/bash -############################################################################## - -## This file is a shell script fragment that supplies the information -## necessary to tailor a template configure script into the configure -## script appropriate for this directory. For more information, check -## any existing configure script. - -## Be warned, there are two types of configure.in files. There are those -## used by Autoconf, which are macros which are expanded into a configure -## script by autoconf. The other sort, of which this is one, is executed -## by Cygnus configure. - -## For more information on these two systems, check out the documentation -## for 'Autoconf' (autoconf.texi) and 'Configure' (configure.texi). - # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, -# 1999, 2000, 2001, 2002 Free Software Foundation, Inc. +# 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -32,24 +16,124 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ############################################################################## +### WARNING: this file contains embedded tabs. Do not run untabify on this file. + +AC_INIT(move-if-change) +AC_PREREQ(2.13) +AC_CANONICAL_SYSTEM +AC_ARG_PROGRAM + +# Get 'install' or 'install-sh' and its variants. +AC_PROG_INSTALL + +sinclude(config/acx.m4) + +### we might need to use some other shell than /bin/sh for running subshells +### If we are on Windows, search for the shell. This will permit people +### to not have /bin/sh, but to be able to see /SOME/PATH/sh configure +### without also having to set CONFIG_SHELL. This code will work when +### using bash, which sets OSTYPE. +case "${OSTYPE}" in +*win32*) + if test x${CONFIG_SHELL} = x ; then + if test ! -f /bin/sh ; then + if test x${SHELL} != x && test -f ${SHELL} ; then + CONFIG_SHELL=${SHELL} + export CONFIG_SHELL + else + for prog in sh sh.exe bash bash.exe; do + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/$prog; then + CONFIG_SHELL=$dir/$prog + export CONFIG_SHELL + break + fi + done + IFS="$save_ifs" + test -n "${CONFIG_SHELL}" && break + done + fi + fi + fi + ;; +esac + +config_shell=${CONFIG_SHELL-/bin/sh} + +progname=$0 +# if PWD already has a value, it is probably wrong. +if test -n "$PWD" ; then PWD=`${PWDCMD-pwd}`; fi + +# Export original configure arguments for use by sub-configures. These +# will be expanded by make, so quote '$'. +tmp="$progname $@" +sed -e 's,\$,$$,g' < conftestsed.out +$tmp +EOF_SED +TOPLEVEL_CONFIGURE_ARGUMENTS=`cat conftestsed.out` +rm -f conftestsed.out +AC_SUBST(TOPLEVEL_CONFIGURE_ARGUMENTS) + +moveifchange=${srcdir}/move-if-change + +# Set srcdir to "." if that's what it is. +# This is important for multilib support. +pwd=`${PWDCMD-pwd}` +srcpwd=`cd ${srcdir} ; ${PWDCMD-pwd}` +if test "${pwd}" = "${srcpwd}" ; then + srcdir=. +fi + +topsrcdir=$srcpwd + +extra_host_args= +# Define the trigger file to make sure configure will re-run whenever +# the gcc version number changes. +if test "${with_gcc_version_trigger+set}" = set ; then + gcc_version_trigger="$with_gcc_version_trigger" + gcc_version=`grep version_string ${with_gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'` +else + # If gcc's sources are available, define the trigger file. + if test -f ${topsrcdir}/gcc/version.c ; then + gcc_version_trigger=${topsrcdir}/gcc/version.c + gcc_version=`grep version_string ${gcc_version_trigger} | sed -e 's/.*\"\([[^ \"]]*\)[[ \"]].*/\1/'` + case "$ac_configure_args" in + *--with-gcc-version-trigger=$gcc_version_trigger* ) + ;; + * ) + # Add to all subconfigure arguments: build, host, and target. + ac_configure_args="$ac_configure_args --with-gcc-version-trigger=$gcc_version_trigger" + ;; + esac + fi +fi ### To add a new directory to the tree, first choose whether it is a target ### or a host dependent tool. Then put it into the appropriate list -### (library or tools, host or target), doing a dependency sort. For -### example, gdb requires that byacc (or bison) be built first, so it is in -### the ${host_tools} list after byacc and bison. +### (library or tools, host or target), doing a dependency sort. + +# Subdirs will be configured in the order listed in build_configdirs, +# configdirs, or target_configdirs; see the serialization section below. + +# Dependency sorting is only needed when *configuration* must be done in +# a particular order. In all cases a dependency should be specified in +# the Makefile, whether or not it's implicitly specified here. +# Double entries in build_configdirs, configdirs, or target_configdirs may +# cause circular dependencies and break everything horribly. # these libraries are used by various programs built for the host environment # -host_libs="intl mmalloc libiberty opcodes bfd readline db tcl tk tclX itcl tix libgui zlib" - -libstdcxx_version="target-libstdc++-v3" +host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl tix libgui zlib" # these tools are built for the host environment # Note, the powerpc-eabi build depends on sim occurring before gdb in order to # know that we are building the simulator. -host_tools="texinfo byacc flex bison binutils ld gas gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool grep diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils snavigator libtool gettext zip fastjar" +# binutils, gas and ld appear in that order because it makes sense to run +# "make check" in that particular order. +host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar" # libgcj represents the runtime libraries only used by gcj. libgcj="target-libffi \ @@ -61,41 +145,26 @@ libgcj="target-libffi \ # these libraries are built for the target environment, and are built after # the host libraries and the host tools (which may be a cross compiler) # -target_libs="target-libiberty \ +target_libraries="target-libiberty \ target-libgloss \ target-newlib \ - ${libstdcxx_version} \ + target-libstdc++-v3 \ target-libf2c \ - ${libgcj} - target-libobjc" + ${libgcj} \ + target-libobjc \ + target-libada" -# these tools are built using the target libs, and are intended to run only -# in the target environment +# these tools are built using the target libraries, and are intended to +# run only in the target environment # -# note: any program that *uses* libraries that are in the "target_libs" +# note: any program that *uses* libraries that are in the "target_libraries" # list belongs in this list. those programs are also very likely # candidates for the "native_only" list which follows # -target_tools="target-examples target-groff target-gperf" +target_tools="target-examples target-groff target-gperf target-rda" ################################################################################ -## These two lists are of directories that are to be removed from the -## ${configdirs} list for either cross-compilations or for native- -## compilations. For example, it doesn't make that much sense to -## cross-compile Emacs, nor is it terribly useful to compile target-libiberty in -## a native environment. - -# directories to be built in the native environment only -# -# This must be a single line because of the way it is searched by grep in -# the code below. -native_only="autoconf automake libtool fileutils find gawk gettext grep gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms snavigator gnuserv target-gperf" - -# directories to be built in a cross environment only -# -cross_only="target-libgloss target-newlib target-opcodes" - ## All tools belong in one of the four categories, and are assigned above ## We assign ${configdirs} this way to remove all embedded newlines. This ## is important because configure will choke if they ever get through. @@ -103,22 +172,25 @@ cross_only="target-libgloss target-newlib target-opcodes" ## ${target_configdirs} is directories we build using the target tools. # configdirs=`echo ${host_libs} ${host_tools}` -target_configdirs=`echo ${target_libs} ${target_tools}` +target_configdirs=`echo ${target_libraries} ${target_tools}` + +# Only make build modules if build != host. +# This should be done more generally, but at the moment it doesn't matter. +if test ${host_alias} != ${build_alias} ; then + # This is the only build module. + build_modules=libiberty +else + build_modules= +fi + ################################################################################ -srctrigger=move-if-change srcname="gnu development package" # This gets set non-empty for some net releases of packages. appdirs="" -# per-host: - -# There is no longer anything interesting in the per-host section. - -# per-target: - # Define is_cross_compiler to save on calls to 'test'. is_cross_compiler= if test x"${host}" = x"${target}" ; then @@ -127,29 +199,8 @@ else is_cross_compiler=yes fi -# We always want to use the same name for this directory, so that dejagnu -# can reliably find it. -target_subdir=${target_alias} - -if test ! -d ${target_subdir} ; then - if mkdir ${target_subdir} ; then true - else - echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${target_subdir}" 1>&2 - exit 1 - fi -fi - -build_subdir=${build_alias} - -if test x"${build_alias}" != x"${host}" ; then - if test ! -d ${build_subdir} ; then - if mkdir ${build_subdir} ; then true - else - echo "'*** could not make ${PWD=`${PWDCMD-pwd}`}/${build_subdir}" 1>&2 - exit 1 - fi - fi -fi +# Find the build and target subdir names. +GCC_TOPLEV_SUBDIRS # Skipdirs are removed silently. skipdirs= @@ -184,8 +235,12 @@ case ${with_x} in esac # Some tools are only suitable for building in a "native" situation. -# Remove these if host!=target. Similarly, some are only suitable -# for cross toolchains; remove if host=target. +# Remove these if host!=target. +native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" + +# Similarly, some are only suitable for cross toolchains. +# Remove these if host=target. +cross_only="target-libgloss target-newlib target-opcodes" case $is_cross_compiler in no) skipdirs="${skipdirs} ${cross_only}" ;; @@ -194,7 +249,8 @@ esac # If both --with-headers and --with-libs are specified, default to # --without-newlib. -if test x"${with_headers}" != x && test x"${with_libs}" != x ; then +if test x"${with_headers}" != x && test x"${with_headers} != xno \ + && test x"${with_libs}" != x && test x"${with_libs} != xno ; then if test x"${with_newlib}" = x ; then with_newlib=no fi @@ -209,12 +265,8 @@ esac # Configure extra directories which are host specific case "${host}" in - i[3456]86-*-go32*) - configdirs="$configdirs dosrel" ;; - i[3456]86-*-mingw32*) - configdirs="$configdirs dosrel" ;; *-cygwin*) - configdirs="$configdirs libtermcap dosrel" ;; + configdirs="$configdirs libtermcap" ;; esac # Remove more programs from consideration, based on the host or @@ -225,33 +277,44 @@ case "${host}" in hppa*64*-*-*) noconfigdirs="$noconfigdirs byacc" ;; - i[3456]86-*-vsta) - noconfigdirs="tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl itcl tix db snavigator gnuserv gettext" + i[[3456789]]86-*-vsta) + noconfigdirs="$noconfigdirs tcl expect dejagnu make texinfo bison patch flex byacc send-pr gprof uudecode dejagnu diff guile perl itcl tix gnuserv gettext" + ;; + i[[3456789]]86-*-go32* | i[[3456789]]86-*-msdosdjgpp*) + noconfigdirs="$noconfigdirs tcl tk expect dejagnu send-pr uudecode guile itcl tix gnuserv libffi" + ;; + i[[3456789]]86-*-mingw32*) + # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl tix gnuserv" + noconfigdirs="$noconfigdirs expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool" + ;; + i[[3456789]]86-*-beos*) + noconfigdirs="$noconfigdirs tk itcl tix libgui gdb" ;; - i[3456]86-*-go32* | i[3456]86-*-msdosdjgpp*) - noconfigdirs="tcl tk expect dejagnu send-pr uudecode guile itcl tix db snavigator gnuserv libffi" - ;; - i[3456]86-*-mingw32*) - # noconfigdirs="tcl tk expect dejagnu make texinfo bison patch flex byacc send-pr uudecode dejagnu diff guile perl itcl tix db snavigator gnuserv" - noconfigdirs="expect dejagnu autoconf automake send-pr rcs guile perl texinfo libtool" - ;; - i[3456]86-*-beos*) - noconfigdirs="$noconfigdirs tk itcl tix libgui gdb" - ;; *-*-cygwin*) - noconfigdirs="autoconf automake send-pr rcs guile perl" + noconfigdirs="$noconfigdirs autoconf automake send-pr rcs guile perl" ;; *-*-netbsd*) - noconfigdirs="rcs" + noconfigdirs="$noconfigdirs rcs" ;; ppc*-*-pe) - noconfigdirs="patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix db snavigator gnuserv" + noconfigdirs="$noconfigdirs patch diff make tk tcl expect dejagnu autoconf automake texinfo bison send-pr gprof rcs guile perl itcl tix gnuserv" ;; powerpc-*-beos*) noconfigdirs="$noconfigdirs tk itcl tix libgui gdb dejagnu readline" ;; + *-*-darwin*) + noconfigdirs="$noconfigdirs tk itcl tix libgui" + ;; esac +AC_ARG_ENABLE(libada, +[ --enable-libada Builds libada directory], +ENABLE_LIBADA=$enableval, +ENABLE_LIBADA=yes) +if test "${ENABLE_LIBADA}" != "yes" ; then + noconfigdirs="$noconfigdirs target-libada" +fi + # Save it here so that, even in case of --enable-libgcj, if the Java # front-end isn't enabled, we still get libgcj disabled. libgcj_saved=$libgcj @@ -272,23 +335,39 @@ case "${target}" in *-*-chorusos) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; - *-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*) + powerpc-*-darwin*) + noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof" + noconfigdirs="$noconfigdirs target-libobjc" + ;; + *-*-darwin*) + noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof" + noconfigdirs="$noconfigdirs target-libobjc ${libgcj}" + ;; + *-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; + *-*-kaos*) + # Remove unsupported stuff on all kaOS configurations. + skipdirs="target-libiberty ${libgcj} target-libstdc++-v3 target-libf2c target-librx" + skipdirs="$skipdirs target-libobjc target-examples target-groff target-gperf" + skipdirs="$skipdirs zlib fastjar target-libjava target-boehm-gc target-zlib" + noconfigdirs="$noconfigdirs target-libgloss" + ;; *-*-netbsd*) # Skip some stuff on all NetBSD configurations. - skipdirs="$skipdirs target-newlib target-libiberty target-libgloss" + noconfigdirs="$noconfigdirs target-newlib target-libiberty target-libgloss" # Skip some stuff that's unsupported on some NetBSD configurations. case "${target}" in i*86-*-netbsdelf*) ;; + arm*-*-netbsdelf*) ;; *) noconfigdirs="$noconfigdirs ${libgcj}" ;; esac ;; *-*-netware) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-newlib target-libiberty target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-newlib target-libiberty target-libgloss ${libgcj}" ;; *-*-rtems*) noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" @@ -299,8 +378,11 @@ case "${target}" in *) ;; esac ;; + *-*-uclinux*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda ${libgcj}" + ;; *-*-vxworks*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty ${libgcj}" ;; alpha*-dec-osf*) # ld works, but does not support shared libraries. @@ -315,13 +397,16 @@ case "${target}" in # newlib is not 64 bit ready noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; - alpha*-*-freebsd*) + alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu) noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; alpha*-*-*) # newlib is not 64 bit ready noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; + am33_2.0-*-linux*) + noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" + ;; sh-*-linux*) noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" ;; @@ -332,17 +417,23 @@ case "${target}" in noconfigdirs="$noconfigdirs tcl tix tk itcl libgui sim" noconfigdirs="$noconfigdirs expect dejagnu" # the C++ libraries don't build on top of CE's C libraries - noconfigdirs="$noconfigdirs ${libstdcxx_version}" - skipdirs="$skipdirs target-newlib" + noconfigdirs="$noconfigdirs target-libstdc++-v3" + noconfigdirs="$noconfigdirs target-newlib" case "${host}" in *-*-cygwin*) ;; # keep gdb and readline - *) noconfigdirs="$noconfigdirs gdb readline ${libstdcxx_version}" + *) noconfigdirs="$noconfigdirs gdb readline" ;; esac ;; arc-*-*) noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" ;; + arm-*-coff | strongarm-*-coff | xscale-*-coff) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; + arm-*-elf* | strongarm-*-elf* | xscale-*-elf*) + noconfigdirs="$noconfigdirs target-libffi target-qthreads" + ;; arm-*-pe*) noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" ;; @@ -358,18 +449,6 @@ case "${target}" in thumb-*-oabi) noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" ;; - strongarm-*-elf) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; - strongarm-*-coff) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; - xscale-*-elf) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - ;; - xscale-*-coff) - noconfigdirs="$noconfigdirs ${libgcj}" - ;; thumb-*-pe) noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" ;; @@ -377,34 +456,34 @@ case "${target}" in noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}" ;; avr-*-*) - noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}" + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" ;; - c4x-*-*) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}" + c4x-*-* | tic4x-*-*) + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" ;; c54x*-*-* | tic54x-*-*) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} gcc gdb newlib" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} gcc gdb newlib" ;; cris-*-*) - noconfigdirs="$noconfigdirs ${libgcj}" + noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" ;; d10v-*-*) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" ;; d30v-*-*) - noconfigdirs="$noconfigdirs ${libgcj}" + noconfigdirs="$noconfigdirs ${libgcj} gdb" ;; fr30-*-elf*) - noconfigdirs="$noconfigdirs ${libgcj}" + noconfigdirs="$noconfigdirs ${libgcj} gdb" ;; frv-*-*) noconfigdirs="$noconfigdirs ${libgcj}" ;; h8300*-*-*) - noconfigdirs="$noconfigdirs target-libgloss" + noconfigdirs="$noconfigdirs target-libgloss ${libgcj} target-libf2c" ;; h8500-*-*) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj} target-libf2c" + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj} target-libf2c" ;; hppa*64*-*-linux* | parisc*64*-*-linux*) # In this case, it's because the hppa64-linux target is for @@ -415,6 +494,7 @@ case "${target}" in hppa*-*-*elf* | \ parisc*-*-linux* | hppa*-*-linux* | \ hppa*-*-lites* | \ + hppa*-*-openbsd* | \ hppa*64*-*-*) noconfigdirs="$noconfigdirs ${libgcj}" # Do configure ld/binutils/gas for this case. @@ -424,29 +504,35 @@ case "${target}" in # build on HP-UX 10.20. noconfigdirs="$noconfigdirs ld shellutils ${libgcj}" ;; + i960-*-*) + noconfigdirs="$noconfigdirs ${libgcj} gdb" + ;; ia64*-*-elf*) # No gdb support yet. noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb" ;; ia64*-**-hpux*) # No gdb or ld support yet. - noconfigdirs="$noconfigdirs tix readline mmalloc libgui itcl gdb ld" + noconfigdirs="$noconfigdirs ${libgcj} tix readline mmalloc libgui itcl gdb ld" ;; - i[3456]86-*-coff | i[3456]86-*-elf) + i[[3456789]]86-*-coff | i[[3456789]]86-*-elf) noconfigdirs="$noconfigdirs ${libgcj}" ;; - i[34567]86-*-freebsd*) + i[[3456789]]86-*-freebsd* | i[[3456789]]86-*-kfreebsd*-gnu) noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; - s390*-*-linux*) - # The libffi port is not yet in the GCC tree - noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" - ;; - i[3456]86-*-linux*) + i[[3456789]]86-*-linux*) + # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's + # not build java stuff by default. + case "${target}" in + *-*-*libc1*) + noconfigdirs="$noconfigdirs ${libgcj}";; + esac + # This section makes it possible to build newlib natively on linux. # If we are using a cross compiler then don't configure newlib. if test x${is_cross_compiler} != xno ; then - noconfigdirs="$noconfigdirs target-newlib" + noconfigdirs="$noconfigdirs target-newlib" fi noconfigdirs="$noconfigdirs target-libgloss" # If we are not using a cross compiler, do configure newlib. @@ -454,17 +540,14 @@ case "${target}" in # if the --with-newlib option has been given, because otherwise # 'target-newlib' will appear in skipdirs. ;; - *-*-linux*) - noconfigdirs="$noconfigdirs target-newlib target-libgloss" - ;; - i[3456]86-*-mingw32*) + i[[3456789]]86-*-mingw32*) target_configdirs="$target_configdirs target-mingw" noconfigdirs="$noconfigdirs expect target-libgloss ${libgcj}" # Can't build gdb for mingw32 if not native. case "${host}" in - i[3456]86-*-mingw32) ;; # keep gdb tcl tk expect etc. - *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix db snavigator gnuserv" + i[[3456789]]86-*-mingw32) ;; # keep gdb tcl tk expect etc. + *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix gnuserv" ;; esac ;; @@ -477,32 +560,35 @@ case "${target}" in # Can't build gdb for Cygwin if not native. case "${host}" in *-*-cygwin*) ;; # keep gdb tcl tk expect etc. - *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui db snavigator gnuserv" + *) noconfigdirs="$noconfigdirs gdb tcl tk expect itcl tix libgui gnuserv" ;; esac ;; - i[3456]86-*-pe) - noconfigdirs="$noconfigdirs ${libstdcxx_version} target-libgloss ${libgcj}" + i[[3456789]]86-*-pe) + noconfigdirs="$noconfigdirs target-libstdc++-v3 target-libgloss ${libgcj}" ;; - i[3456]86-*-sco3.2v5*) + i[[3456789]]86-*-sco3.2v5*) # The linker does not yet know about weak symbols in COFF, # and is not configured to handle mixed ELF and COFF. noconfigdirs="$noconfigdirs ld target-libgloss ${libgcj}" ;; - i[3456]86-*-sco*) + i[[3456789]]86-*-sco*) noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; - i[3456]86-*-solaris2*) + i[[3456789]]86-*-solaris2*) noconfigdirs="$noconfigdirs target-libgloss" ;; - i[3456]86-*-sysv4*) + i[[3456789]]86-*-sysv4*) noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" ;; - i[3456]86-*-beos*) - noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" - ;; + i[[3456789]]86-*-beos*) + noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" + ;; + m32r-*-*) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*) - noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}" + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" ;; m68k-*-elf*) noconfigdirs="$noconfigdirs ${libgcj}" @@ -516,7 +602,7 @@ case "${target}" in noconfigdirs="$noconfigdirs target-libstdc++-v3" ;; mmix-*-*) - noconfigdirs="$noconfigdirs ${libgcj}" + noconfigdirs="$noconfigdirs ${libgcj} gdb libgloss" ;; mn10200-*-*) noconfigdirs="$noconfigdirs ${libgcj}" @@ -526,17 +612,17 @@ case "${target}" in ;; powerpc-*-aix*) # copied from rs6000-*-* entry - noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs gprof target-libada target-libgloss ${libgcj}" ;; powerpc*-*-winnt* | powerpc*-*-pe* | ppc*-*-pe) target_configdirs="$target_configdirs target-winsup" - noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix db snavigator gnuserv ${libgcj}" + noconfigdirs="$noconfigdirs gdb tcl tk make expect target-libgloss itcl tix gnuserv ${libgcj}" # always build newlib. skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;; # This is temporary until we can link against shared libraries powerpcle-*-solaris*) - noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix db snavigator gnuserv ${libgcj}" + noconfigdirs="$noconfigdirs gdb sim make tcl tk expect itcl tix gnuserv ${libgcj}" ;; powerpc-*-beos*) noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}" @@ -548,7 +634,7 @@ case "${target}" in noconfigdirs="$noconfigdirs target-newlib gprof ${libgcj}" ;; rs6000-*-aix*) - noconfigdirs="$noconfigdirs gprof ${libgcj}" + noconfigdirs="$noconfigdirs gprof target-libada target-libgloss ${libgcj}" ;; rs6000-*-*) noconfigdirs="$noconfigdirs gprof ${libgcj}" @@ -557,16 +643,14 @@ case "${target}" in noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}" ;; mips*-*-irix5*) - # The GNU linker does not support shared libraries. - noconfigdirs="$noconfigdirs ld gprof target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; mips*-*-irix6*) - # The GNU assembler does not support IRIX 6. # Linking libjava exceeds command-line length limits on at least # IRIX 6.2, but not on IRIX 6.5. # Also, boehm-gc won't build on IRIX 6.5, according to Jeffrey Oldham # - noconfigdirs="$noconfigdirs gas gprof target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" ;; mips*-dec-bsd*) noconfigdirs="$noconfigdirs gprof target-libgloss ${libgcj}" @@ -576,9 +660,9 @@ case "${target}" in ;; mipstx39-*-*) noconfigdirs="$noconfigdirs gprof ${libgcj}" # same as generic mips - ;; + ;; mips*-*-linux*) - noconfigdirs="$noconfigdirs target-libffi" + noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; mips*-*-*) noconfigdirs="$noconfigdirs gprof ${libgcj}" @@ -588,9 +672,9 @@ case "${target}" in ;; sh-*-*) case "${host}" in - i[3456]86-*-vsta) ;; # don't add gprof back in - i[3456]86-*-go32*) ;; # don't add gprof back in - i[3456]86-*-msdosdjgpp*) ;; # don't add gprof back in + i[[3456789]]86-*-vsta) ;; # don't add gprof back in + i[[3456789]]86-*-go32*) ;; # don't add gprof back in + i[[3456789]]86-*-msdosdjgpp*) ;; # don't add gprof back in *) skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'` ;; esac noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" @@ -618,7 +702,7 @@ case "${target}" in sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*) ;; v810-*-*) - noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld ${libstdcxx_version} opcodes target-libgloss ${libgcj}" + noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}" ;; v850-*-*) noconfigdirs="$noconfigdirs target-libgloss ${libgcj}" @@ -635,8 +719,14 @@ case "${target}" in vax-*-*) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" ;; + xtensa-*-*) + noconfigdirs="$noconfigdirs ${libgcj}" + ;; ip2k-*-*) - noconfigdirs="$noconfigdirs target-libiberty ${libstdcxx_version} ${libgcj}" + noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}" + ;; + *-*-linux*) + noconfigdirs="$noconfigdirs target-newlib target-libgloss" ;; *-*-lynxos*) noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}" @@ -659,85 +749,90 @@ esac # go away some day. # NB: embedded tabs in this IF block -- do not untabify if test x"${enable_languages+set}" != xset; then - if test x"${LANGUAGES+set}" = xset; then - enable_languages="${LANGUAGES}" - echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2 - else - enable_languages=all - fi + if test x"${LANGUAGES+set}" = xset; then + enable_languages="${LANGUAGES}" + echo configure.in: warning: setting LANGUAGES is deprecated, use --enable-languages instead 1>&2 + else + enable_languages=all + fi else - if test x"${enable_languages}" = x || - test x"${enable_languages}" = xyes; - then - echo configure.in: --enable-languages needs at least one language argument 1>&2 - exit 1 - fi + if test x"${enable_languages}" = x || + test x"${enable_languages}" = xyes; + then + echo configure.in: --enable-languages needs at least one language argument 1>&2 + exit 1 + fi fi -enable_languages=`echo "${enable_languages}" | sed -e 's/[ ,][ ,]*/,/g' -e 's/,$//'` +enable_languages=`echo "${enable_languages}" | sed -e 's/[[ ,]][[ ,]]*/,/g' -e 's/,$//'` # First scan to see if an enabled language requires some other language. # We assume that a given config-lang.in will list all the language # front ends it requires, even if some are required indirectly. -for lang in ${srcdir}/gcc/*/config-lang.in .. -do - case $lang in - ..) - ;; +for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do + case ${lang_frag} in + ..) ;; # The odd quoting in the next line works around # an apparent bug in bash 1.12 on linux. - ${srcdir}/gcc/[*]/config-lang.in) - ;; + ${srcdir}/gcc/[[*]]/config-lang.in) ;; *) - lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang` - this_lang_requires=`sed -n -e 's,^lang_requires=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_requires=\([^ ]*\).*$,\1,p' $lang` - for other in $this_lang_requires - do - case ,${enable_languages}, in - *,$other,*) - ;; - *,all,*) - ;; - *,$lang_alias,*) - echo " \`$other' language required by \`$lang_alias'; enabling" 1>&2 - enable_languages="$enable_languages,$other" - ;; - esac - done - ;; - esac + # From the config-lang.in, get $language, $lang_requires + language= + lang_requires= + . ${lang_frag} + for other in ${lang_requires} ; do + case ,${enable_languages}, in + *,$other,*) ;; + *,all,*) ;; + *,$language,*) + echo " \`$other' language required by \`$language'; enabling" 1>&2 + enable_languages="${enable_languages},${other}" + ;; + esac + done + ;; + esac done -subdirs= -for lang in ${srcdir}/gcc/*/config-lang.in .. -do - case $lang in - ..) ;; - # The odd quoting in the next line works around - # an apparent bug in bash 1.12 on linux. - ${srcdir}/gcc/[*]/config-lang.in) ;; - *) - lang_alias=`sed -n -e 's,^language=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^language=\([^ ]*\).*$,\1,p' $lang` - this_lang_libs=`sed -n -e 's,^target_libs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^target_libs=\([^ ]*\).*$,\1,p' $lang` - this_lang_dirs=`sed -n -e 's,^lang_dirs=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^lang_dirs=\([^ ]*\).*$,\1,p' $lang` - build_by_default=`sed -n -e 's,^build_by_default=['"'"'"'"]\(.*\)["'"'"'"'].*$,\1,p' -e 's,^build_by_default=\([^ ]*\).*$,\1,p' $lang` - if test "x$lang_alias" = x - then - echo "$lang doesn't set \$language." 1>&2 - exit 1 - fi - case ${build_by_default},${enable_languages}, in - *,$lang_alias,*) add_this_lang=yes ;; - no,*) add_this_lang=no ;; - *,all,*) add_this_lang=yes ;; - *) add_this_lang=no ;; - esac - if test x"${add_this_lang}" = xyes; then - eval target_libs='"$target_libs "'\"$this_lang_libs\" - else - eval noconfigdirs='"$noconfigdirs "'\"$this_lang_libs $this_lang_dirs\" - fi - ;; - esac +for lang_frag in ${srcdir}/gcc/*/config-lang.in .. ; do + case ${lang_frag} in + ..) ;; + # The odd quoting in the next line works around + # an apparent bug in bash 1.12 on linux. + ${srcdir}/gcc/[[*]]/config-lang.in) ;; + *) + # From the config-lang.in, get $language, $target_libs, + # $lang_dirs, and $build_by_default + language= + target_libs= + lang_dirs= + build_by_default= + . ${lang_frag} + if test "x$language" = x ; then + echo "${lang_frag} doesn't set \$language." 1>&2 + exit 1 + fi + case ,${enable_languages}, in + *,${language},*) + # Language was explicitly selected; include it. + add_this_lang=yes + ;; + *,all,*) + # 'all' was selected; include 'default' languages. + case ${build_by_default} in + no) add_this_lang=no ;; + *) add_this_lang=yes ;; + esac + ;; + *) add_this_lang=no ;; + esac + case ${add_this_lang} in + no) + # Remove language-dependent dirs. + eval noconfigdirs='"$noconfigdirs "'\"$target_libs $lang_dirs\" + ;; + esac + ;; + esac done # Remove the entries in $skipdirs and $noconfigdirs from $configdirs and @@ -749,8 +844,7 @@ for dir in . $skipdirs $noconfigdirs ; do dirname=`echo $dir | sed -e s/target-//g` if test $dir != . && echo " ${configdirs} " | grep " ${dir} " >/dev/null 2>&1; then configdirs=`echo " ${configdirs} " | sed -e "s/ ${dir} / /"` - if test -r $srcdir/$dirname/configure \ - || test -r $srcdir/$dirname/configure.in ; then + if test -r $srcdir/$dirname/configure ; then if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then true else @@ -760,8 +854,7 @@ for dir in . $skipdirs $noconfigdirs ; do fi if test $dir != . && echo " ${target_configdirs} " | grep " ${dir} " >/dev/null 2>&1; then target_configdirs=`echo " ${target_configdirs} " | sed -e "s/ ${dir} / /"` - if test -r $srcdir/$dirname/configure \ - || test -r $srcdir/$dirname/configure.in ; then + if test -r $srcdir/$dirname/configure ; then if echo " ${skipdirs} " | grep " ${dir} " >/dev/null 2>&1; then true else @@ -777,7 +870,7 @@ if test -n "${target_configdirs}" ; then others= for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do if test "$i" != "libiberty" ; then - if test -r $srcdir/$i/configure || test -r $srcdir/$i/configure.in ; then + if test -r $srcdir/$i/configure ; then others=yes; break; fi @@ -788,20 +881,6 @@ if test -n "${target_configdirs}" ; then fi fi -# Deconfigure all subdirectories, in case we are changing the -# configuration from one where a subdirectory is supported to one where it -# is not. -if test -z "${norecursion}" && test -n "${configdirs}" ; then - for i in `echo ${configdirs} | sed -e s/target-//g` ; do - rm -f $i/Makefile - done -fi -if test -z "${norecursion}" && test -n "${target_configdirs}" ; then - for i in `echo ${target_configdirs} | sed -e s/target-//g` ; do - rm -f ${target_subdir}/$i/Makefile - done -fi - # Quietly strip out all directories which aren't configurable in this tree. # This relies on all configurable subdirectories being autoconfiscated, which # is now the case. @@ -860,46 +939,44 @@ case "$host" in *msdosdjgpp*) enable_gdbtk=no ;; esac -# Determine whether gdb needs tk/tcl or not. -case "$enable_gdbtk" in - no) - GDB_TK="" ;; - *) - GDB_TK="all-tcl all-tk all-itcl all-tix all-libgui" ;; -esac copy_dirs= -# Handle --with-headers=XXX. The contents of the named directory are -# copied to $(tooldir)/sys-include. -if test x"${with_headers}" != x ; then +# Handle --with-headers=XXX. If the value is not "yes", the contents of +# the named directory are copied to $(tooldir)/sys-include. +if test x"${with_headers}" != x && test x"${with_headers}" != xno ; then if test x${is_cross_compiler} = xno ; then echo 1>&2 '***' --with-headers is only supported when cross compiling exit 1 fi - case "${exec_prefixoption}" in - "") x=${prefix} ;; - *) x=${exec_prefix} ;; - esac - copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include" + if test x"${with_headers}" != xyes ; then + case "${exec_prefixoption}" in + "") x=${prefix} ;; + *) x=${exec_prefix} ;; + esac + copy_dirs="${copy_dirs} ${with_headers} $x/${target_alias}/sys-include" + fi fi -# Handle --with-libs=XXX. Multiple directories are permitted. The -# contents are copied to $(tooldir)/lib. -if test x"${with_libs}" != x ; then +# Handle --with-libs=XXX. If the value is not "yes", the contents of +# the name directories are copied to $(tooldir)/lib. Multiple directories +# are permitted. +if test x"${with_libs}" != x && test x"${with_libs}" != xno ; then if test x${is_cross_compiler} = xno ; then echo 1>&2 '***' --with-libs is only supported when cross compiling exit 1 fi - # Copy the libraries in reverse order, so that files in the first named - # library override files in subsequent libraries. - case "${exec_prefixoption}" in - "") x=${prefix} ;; - *) x=${exec_prefix} ;; - esac - for l in ${with_libs}; do - copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}" - done + if test x"${with_libs}" != xyes ; then + # Copy the libraries in reverse order, so that files in the first named + # library override files in subsequent libraries. + case "${exec_prefixoption}" in + "") x=${prefix} ;; + *) x=${exec_prefix} ;; + esac + for l in ${with_libs}; do + copy_dirs="$l $x/${target_alias}/lib ${copy_dirs}" + done + fi fi # Handle ${copy_dirs} @@ -935,16 +1012,18 @@ done # Work in distributions that contain no compiler tools, like Autoconf. tentative_cc="" +host_makefile_frag=/dev/null if test -d ${srcdir}/config ; then case "${host}" in m68k-hp-hpux*) # Avoid "too much defining" errors from HPUX compiler. tentative_cc="cc -Wp,-H256000" - host_makefile_frag="config/mh-hp300" + # If "ar" in $PATH is GNU ar, the symbol table may need rebuilding. + # If it's HP/UX ar, this should be harmless. + RANLIB="ar ts" ;; m68k-apollo-sysv*) tentative_cc="cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DUSG" - host_makefile_frag="config/mh-apollo68" ;; m68k-apollo-bsd*) #None of the Apollo compilers can compile gas or binutils. The preprocessor @@ -953,12 +1032,11 @@ case "${host}" in # the apollo compiler" (the preferred version of GCC could be called cc, # or whatever), but I'm not sure leaving CC as cc is any better... #CC=cc -A ansi -A runtype,any -A systype,any -U__STDC__ -DNO_STDARG + # Used to have BISON=yacc. tentative_cc=gcc - host_makefile_frag="config/mh-a68bsd" ;; m88k-dg-dgux*) tentative_cc="gcc -Wall -ansi -D__using_DGUX" - host_makefile_frag="config/mh-dgux" ;; m88k-harris-cxux*) # Under CX/UX, we want to tell the compiler to use ANSI mode. @@ -966,7 +1044,6 @@ case "${host}" in host_makefile_frag="config/mh-cxux" ;; m88k-motorola-sysv*) - host_makefile_frag="config/mh-delta88" ;; mips*-dec-ultrix*) tentative_cc="cc -Wf,-XNg1000" @@ -977,21 +1054,12 @@ case "${host}" in tentative_cc="cc -ZXNd=5000 -ZXNg=1000" host_makefile_frag="config/mh-necv4" ;; - mips*-sgi-irix6*) - host_makefile_frag="config/mh-irix6" - ;; - mips*-sgi-irix5*) - host_makefile_frag="config/mh-irix5" - ;; mips*-sgi-irix4*) # Tell compiler to use K&R C. We can't compile under the SGI Ansi # environment. Also bump switch table size so that cp-parse will # compile. Bump string length limit so linker builds. tentative_cc="cc -cckr -Wf,-XNg1500 -Wf,-XNk1000 -Wf,-XNh2000 -Wf,-XNl8192" ;; - mips*-sgi-irix3*) - host_makefile_frag="config/mh-sysv" - ;; mips*-*-sysv4*) host_makefile_frag="config/mh-sysv4" ;; @@ -1009,26 +1077,23 @@ case "${host}" in # This is not part of CFLAGS because perhaps not all C compilers have this # option. tentative_cc="cc -systype sysv" - host_makefile_frag="config/mh-riscos" ;; i370-ibm-opened*) tentative_cc="c89" - host_makefile_frag="config/mh-openedition" ;; - i[3456]86-*-sysv5*) + i[[3456789]]86-*-sysv5*) host_makefile_frag="config/mh-sysv5" ;; - i[3456]86-*-dgux*) + i[[3456789]]86-*-dgux*) tentative_cc="gcc -Wall -ansi -D__using_DGUX" host_makefile_frag="config/mh-dgux386" ;; - i[3456]86-ncr-sysv4.3*) + i[[3456789]]86-ncr-sysv4.3*) # The MetaWare compiler will generate a copyright message unless you # turn it off by adding the -Hnocopyr flag. tentative_cc="cc -Hnocopyr" - host_makefile_frag="config/mh-ncrsvr43" ;; - i[3456]86-ncr-sysv4*) + i[[3456789]]86-ncr-sysv4*) # for an NCR 3000 (i486/SVR4) system. # The NCR 3000 ships with a MetaWare compiler installed as /bin/cc. # This compiler not only emits obnoxious copyright messages every time @@ -1037,28 +1102,21 @@ case "${host}" in tentative_cc="/usr/ccs/ATT/cc" host_makefile_frag="config/mh-ncr3000" ;; - i[3456]86-*-sco3.2v5*) - host_makefile_frag="config/mh-sysv" + i[[3456789]]86-*-sco3.2v5*) ;; - i[3456]86-*-sco*) + i[[3456789]]86-*-sco*) # The native C compiler botches some simple uses of const. Unfortunately, # it doesn't defined anything like "__sco__" for us to test for in ansidecl.h. tentative_cc="cc -Dconst=" host_makefile_frag="config/mh-sco" ;; - i[3456]86-*-udk*) + i[[3456789]]86-*-udk*) host_makefile_frag="config/mh-sysv5" ;; - i[3456]86-*-isc*) - host_makefile_frag="config/mh-sysv" - ;; - i[3456]86-*-solaris2*) + i[[3456789]]86-*-solaris2*) host_makefile_frag="config/mh-sysv4" ;; - i[3456]86-*-aix*) - host_makefile_frag="config/mh-aix386" - ;; - i[3456]86-*-msdosdjgpp*) + i[[3456789]]86-*-msdosdjgpp*) host_makefile_frag="config/mh-djgpp" ;; *-cygwin*) @@ -1082,17 +1140,11 @@ case "${host}" in # without overflowing the jump tables (-J says to use a 32 bit table) tentative_cc="cc -J" ;; - *-hp-hpux[78]*) - tentative_cc="cc -Wp,-H256000" - host_makefile_frag="config/mh-hpux8" - ;; *-hp-hpux*) tentative_cc="cc -Wp,-H256000" - host_makefile_frag="config/mh-hpux" ;; *-*-hiux*) tentative_cc="cc -Wp,-H256000" - host_makefile_frag="config/mh-hpux" ;; rs6000-*-lynxos*) # /bin/cc is less than useful for our purposes. Always use GCC @@ -1106,45 +1158,15 @@ case "${host}" in *-*-sysv4*) host_makefile_frag="config/mh-sysv4" ;; - *-*-sysv*) - host_makefile_frag="config/mh-sysv" - ;; esac fi -rm -f mh-frag -if test -n "${host_makefile_frag}" ; then - for f in ${host_makefile_frag} - do - cat ${srcdir}/$f >> mh-frag - done - host_makefile_frag=mh-frag -fi - -# If we aren't going to be using gcc, see if we can extract a definition -# of CC from the fragment. -# Actually, use the 'pre-extracted' version above. -if test -z "${CC}" && test "${build}" = "${host}" ; then - IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" - found= - for dir in $PATH; do - test -z "$dir" && dir=. - if test -f $dir/gcc; then - found=yes - break - fi - done - IFS="$save_ifs" - if test -z "${found}" && test -n "${tentative_cc}" ; then - CC=$tentative_cc - fi -fi - +extra_arflags_for_target= +extra_nmflags_for_target= +extra_ranlibflags_for_target= +target_makefile_frag=/dev/null case "${target}" in - v810*) - target_makefile_frag="config/mt-v810" - ;; - i[3456]86-*-netware*) + i[[3456789]]86-*-netware*) target_makefile_frag="config/mt-netware" ;; powerpc-*-netware*) @@ -1153,15 +1175,23 @@ case "${target}" in *-*-linux*) target_makefile_frag="config/mt-linux" ;; - *-*-aix4.[3456789]* | *-*-aix[56789].*) - target_makefile_frag="config/mt-aix43" + *-*-aix4.[[3456789]]* | *-*-aix[[56789]].*) + # nm and ar from AIX 4.3 and above require -X32_64 flag to all ar and nm + # commands to handle both 32-bit and 64-bit objects. These flags are + # harmless if we're using GNU nm or ar. + extra_arflags_for_target=" -X32_64" + extra_nmflags_for_target=" -B -X32_64" + ;; + *-*-darwin*) + # ranlib from Darwin requires the -c flag to look at common symbols. + extra_ranlibflags_for_target=" -c" ;; mips*-*-pe | sh*-*-pe | *arm-wince-pe) target_makefile_frag="config/mt-wince" ;; esac -alphaieee_frag= +alphaieee_frag=/dev/null case $target in alpha*-*-*) # This just makes sure to use the -mieee option to build target libs. @@ -1173,7 +1203,7 @@ esac # If --enable-target-optspace always use -Os instead of -O2 to build # the target libraries, similarly if it is not specified, use -Os # on selected platforms. -ospace_frag= +ospace_frag=/dev/null case "${enable_target_optspace}:${target}" in yes:*) ospace_frag="config/mt-ospace" @@ -1191,15 +1221,6 @@ case "${enable_target_optspace}:${target}" in ;; esac -rm -f mt-frag -if test -n "${target_makefile_frag}${alphaieee_frag}${ospace_frag}" ; then - for f in ${target_makefile_frag} ${alphaieee_frag} ${ospace_frag} - do - cat ${srcdir}/$f >> mt-frag - done - target_makefile_frag=mt-frag -fi - # Set with_gnu_as and with_gnu_ld as appropriate. # # This is done by determining whether or not the appropriate directory @@ -1216,54 +1237,32 @@ fi if test x${use_gnu_as} = x && echo " ${configdirs} " | grep " gas " > /dev/null 2>&1 ; then with_gnu_as=yes - withoptions="$withoptions --with-gnu-as" + extra_host_args="$extra_host_args --with-gnu-as" fi if test x${use_gnu_ld} = x && echo " ${configdirs} " | grep " ld " > /dev/null 2>&1 ; then with_gnu_ld=yes - withoptions="$withoptions --with-gnu-ld" + extra_host_args="$extra_host_args --with-gnu-ld" fi -# If using newlib, add --with-newlib to the withoptions so that gcc/configure +# If using newlib, add --with-newlib to the extra_host_args so that gcc/configure # can detect this case. if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " target-newlib " > /dev/null 2>&1 ; then with_newlib=yes - withoptions="$withoptions --with-newlib" + extra_host_args="$extra_host_args --with-newlib" fi -# We default to --with-shared on platforms where -fpic is meaningless. -# Well, we don't yet, but we will. -if false && test "${host}" = "${target}" && test x${enable_shared} = x ; then - case "${target}" in - alpha*-dec-osf*) enable_shared=yes ;; - alpha*-*-linux*) enable_shared=yes ;; - mips-sgi-irix5*) enable_shared=yes ;; - *) enable_shared=no ;; - esac -fi - -case "${enable_shared}" in - yes) shared=yes ;; - no) shared=no ;; - "") shared=no ;; - *) shared=yes ;; -esac - # Default to using --with-stabs for certain targets. if test x${with_stabs} = x ; then case "${target}" in - mips*-*-irix6*o32) - with_stabs=yes; - withoptions="${withoptions} --with-stabs" - ;; - mips*-*-irix6*) + mips*-*-irix[[56]]*) ;; mips*-*-* | alpha*-*-osf*) with_stabs=yes; - withoptions="${withoptions} --with-stabs" + extra_host_args="${extra_host_args} --with-stabs" ;; esac fi @@ -1272,11 +1271,301 @@ fi # them automatically. case "${host}" in hppa*64*-*-hpux11*) - withoptions="$withoptions -x-libraries=/usr/lib/pa20_64 -x-includes=/usr/X11R6/include" + extra_host_args="$extra_host_args -x-libraries=/usr/lib/pa20_64 -x-includes=/usr/X11R6/include" ;; esac -# post-target: +# If we aren't going to be using gcc, see if we can extract a definition +# of CC from the fragment. +# Actually, use the 'pre-extracted' version above. +if test -z "${CC}" && test "${build}" = "${host}" ; then + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" + found= + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/gcc; then + found=yes + break + fi + done + IFS="$save_ifs" + if test -z "${found}" && test -n "${tentative_cc}" ; then + CC=$tentative_cc + fi +fi + +# Some systems (e.g., one of the i386-aix systems the gas testers are +# using) don't handle "\$" correctly, so don't use it here. +tooldir='${exec_prefix}'/${target_alias} +build_tooldir=${tooldir} + +# Generate a default definition for YACC. This is used if the makefile can't +# locate bison or byacc in objdir. + +for prog in 'bison -y' byacc yacc +do + set dummy $prog; tmp=$2 + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/$tmp; then + DEFAULT_YACC="$prog" + break + fi + done + IFS="$save_ifs" + + test -n "$DEFAULT_YACC" && break +done + +# Generate a default definition for M4. This is used if the makefile can't +# locate m4 in objdir. + +for prog in gm4 gnum4 m4 +do + set dummy $prog; tmp=$2 + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/$tmp; then + DEFAULT_M4="$prog" + break + fi + done + IFS="$save_ifs" + + test -n "$DEFAULT_M4" && break +done + +# Generate a default definition for LEX. This is used if the makefile can't +# locate flex in objdir. + +for prog in flex lex +do + set dummy $prog; tmp=$2 + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/$tmp; then + DEFAULT_LEX="$prog" + break + fi + done + IFS="$save_ifs" + + test -n "$DEFAULT_LEX" && break +done + +if test "${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. + + BISON=${BISON-bison} + CC=${CC-${host_alias}-gcc} + CFLAGS=${CFLAGS-"-g -O2"} + CXX=${CXX-${host_alias}-c++} + CXXFLAGS=${CXXFLAGS-"-g -O2"} + CC_FOR_BUILD=${CC_FOR_BUILD-gcc} + CC_FOR_TARGET=${CC_FOR_TARGET-${target_alias}-gcc} + CXX_FOR_TARGET=${CXX_FOR_TARGET-${target_alias}-c++} + GCJ_FOR_TARGET=${GCJ_FOR_TARGET-${target_alias}-gcj} + GCC_FOR_TARGET=${GCC_FOR_TARGET-${CC_FOR_TARGET-${target_alias}-gcc}} + BUILD_PREFIX=${build_alias}- + BUILD_PREFIX_1=${build_alias}- + MAKEINFO=${MAKEINFO-makeinfo} + + if test -z "${YACC}" ; then + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/bison; then + YACC="bison -y" + break + fi + if test -f $dir/byacc; then + YACC=byacc + break + fi + if test -f $dir/yacc; then + YACC=yacc + break + fi + done + IFS="$save_ifs" + if test -z "${YACC}" ; then + YACC="bison -y" + fi + fi + + if test -z "${LEX}" ; then + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/flex; then + LEX=flex + break + fi + if test -f $dir/lex; then + LEX=lex + break + fi + done + IFS="$save_ifs" + LEX=${LEX-flex} + fi + +else + # Set reasonable default values for some tools even if not Canadian. + # Of course, these are different reasonable default values, originally + # specified directly in the Makefile. + # We don't export, so that autoconf can do its job. + # Note that all these settings are above the fragment inclusion point + # in Makefile.in, so can still be overridden by fragments. + # This is all going to change when we autoconfiscate... + + BISON="\$(USUAL_BISON)" + CC_FOR_BUILD="\$(CC)" + GCC_FOR_TARGET="\$(USUAL_GCC_FOR_TARGET)" + BUILD_PREFIX= + BUILD_PREFIX_1=loser- + MAKEINFO="\$(USUAL_MAKEINFO)" + LEX="\$(USUAL_LEX)" + YACC="\$(USUAL_YACC)" + + # If CC is still not set, try to get gcc. + cc_prog_is_gcc= + if test -z "${CC}" ; then + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/gcc; then + CC="gcc" + cc_prog_is_gcc=yes + echo 'void f(){}' > conftest.c + if test -z "`${CC} -g -c conftest.c 2>&1`"; then + CFLAGS=${CFLAGS-"-g -O2"} + CXXFLAGS=${CXXFLAGS-"-g -O2"} + else + CFLAGS=${CFLAGS-"-O2"} + CXXFLAGS=${CXXFLAGS-"-O2"} + fi + rm -f conftest* + break + fi + done + IFS="$save_ifs" + CC=${CC-cc} + else + # Determine if we are using gcc. + cat > conftest.c </dev/null 2>&1; then + cc_prog_is_gcc=yes + fi + rm -f conftest.c + if test -z "${CFLAGS}"; then + # Here CC is set but CFLAGS is not. Use a quick hack to use -O2 if CC + # is set to a version of gcc. + if test "$cc_prog_is_gcc" = yes; then + echo 'void f(){}' > conftest.c + if test -z "`${CC} -g -c conftest.c 2>&1`"; then + CFLAGS=${CFLAGS-"-g -O2"} + CXXFLAGS=${CXXFLAGS-"-g -O2"} + else + CFLAGS=${CFLAGS-"-O2"} + CXXFLAGS=${CXXFLAGS-"-O2"} + fi + rm -f conftest* + fi + fi + fi + + # We must set the default linker to the linker used by gcc for the correct + # operation of libtool. If LD is not defined and we are using gcc, try to + # set the LD default to the ld used by gcc. + if test -z "$LD"; then + if test "$cc_prog_is_gcc" = yes; then + case $build in + *-*-mingw*) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; + *) + gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; + esac + case $gcc_prog_ld in + # Accept absolute paths. + [[\\/]* | [A-Za-z]:[\\/]*)] + LD="$gcc_prog_ld" ;; + esac + fi + fi + + CXX=${CXX-"c++"} + CFLAGS=${CFLAGS-"-g"} + CXXFLAGS=${CXXFLAGS-"-g -O2"} +fi + +# FIXME Should this be done recursively ??? (Useful for e.g. gdbtest) +# Set up the list of links to be made. +# ${links} is the list of link names, and ${files} is the list of names to link to. + +# Make the links. +configlinks="${links}" +if test -r ./config.status ; then + mv -f ./config.status ./config.back +fi +while test -n "${files}" ; do + # set file to car of files, files to cdr of files + set ${files}; file=$1; shift; files=$* + set ${links}; link=$1; shift; links=$* + + if test ! -r ${srcdir}/${file} ; then + if test ! -r ${file} ; then + echo '***' "${progname}: cannot create a link \"${link}\"," 1>&2 + echo '***' "since the file \"${srcdir}/${file}\" does not exist." 1>&2 + exit 1 + else + srcfile=${file} + fi + else + srcfile=${srcdir}/${file} + fi + + ${remove} -f ${link} + # Make a symlink if possible, otherwise try a hard link + if ${symbolic_link} ${srcfile} ${link} >/dev/null 2>&1 ; then + true + else + # We need to re-remove the file because Lynx leaves a + # very strange directory there when it fails an NFS symlink. + ${remove} -r -f ${link} + ${hard_link} ${srcfile} ${link} + fi + if test ! -r ${link} ; then + echo '***' "${progname}: unable to link \"${link}\" to \"${srcfile}\"." 1>&2 + exit 1 + fi + + echo "Linked \"${link}\" to \"${srcfile}\"." +done + +# Create a .gdbinit file which runs the one in srcdir +# and tells GDB to look there for source files. + +if test -r ${srcdir}/.gdbinit ; then + case ${srcdir} in + .) ;; + *) cat > ./.gdbinit < Makefile.tem - rm -f Makefile - mv -f Makefile.tem Makefile - - case "${host}" in - *-*-hpux*) - sed -e 's/^RPATH_ENVVAR[ ]*=.*$/RPATH_ENVVAR = SHLIB_PATH/' \ - Makefile > Makefile.tem - rm -f Makefile - mv -f Makefile.tem Makefile +case "${enable_shared}" in + no | "") SET_LIB_PATH= ;; + *) SET_LIB_PATH="\$(REALLY_SET_LIB_PATH)" ;; +esac + +case "${host}" in + *-*-hpux*) RPATH_ENVVAR=SHLIB_PATH ;; + *) RPATH_ENVVAR=LD_LIBRARY_PATH ;; +esac + +# Record target_configdirs and the configure arguments for target and +# build configuration in Makefile. +target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'` + +# This is the final value for target_configdirs. configdirs already +# has its final value, as does build_modules. It's time to create some +# lists of valid targets. + +all_build_modules= +configure_build_modules= +for module in ${build_modules} ; do + all_build_modules=all-build-${module} + configure_build_modules=configure-build-${module} +done + +# Determine whether gdb needs tk/tcl or not. +# Use 'maybe' since enable_gdbtk might be true even if tk isn't available +# and in that case we want gdb to be built without tk. Ugh! +# In fact I believe gdb is the *only* package directly dependent on tk, +# so we should be able to put the 'maybe's in unconditionally and +# leave out the maybe dependencies when enable_gdbtk is false. I'm not +# 100% sure that that's safe though. + +gdb_tk="maybe-all-tcl maybe-all-tk maybe-all-itcl maybe-all-tix maybe-all-libgui" +case "$enable_gdbtk" in + no) + GDB_TK="" ;; + yes) + GDB_TK="${gdb_tk}" ;; + *) + # Only add the dependency on gdbtk when GDBtk is part of the gdb + # distro. Eventually someone will fix this and move Insight, nee + # gdbtk to a separate directory. + if test -d ${srcdir}/gdb/gdbtk ; then + GDB_TK="${gdb_tk}" + else + GDB_TK="" + fi ;; - esac -fi +esac + +# Create the 'maybe dependencies'. This uses a temporary file. -# Base args. Strip norecursion, cache-file, srcdir, host, build, target. -# These are the ones we might not want to pass down to subconfigures. -baseargs=`echo "${arguments}" | \ - sed -e 's/--no[^ ]*//' \ - -e 's/--cache[a-z-]*=[^ ]*//' \ - -e 's/--sr[a-z-]*=[^ ]*//' \ - -e 's/--ho[a-z-]*=[^ ]*//' \ - -e 's/--bu[a-z-]*=[^ ]*//' \ - -e 's/--ta[a-z-]*=[^ ]*//'` +# While at that, we remove Makefiles if we were started for recursive +# configuration, so that the top-level Makefile reconfigures them, +# like we used to do when configure itself was recursive. +rm -f maybedep.tmp +echo '# maybedep.tmp' > maybedep.tmp + +# Make-targets which may need maybe dependencies. +mts="configure all install check clean distclean dvi info install-info" +mts="${mts} installcheck mostlyclean maintainer-clean TAGS" + +# Loop over modules and make-targets. +for module in ${build_modules} ; do + if test -z "${no_recursion}" \ + && test -f ${build_subdir}/${module}/Makefile; then + echo 1>&2 "*** removing ${build_subdir}/${module}/Makefile to force reconfigure" + rm -f ${build_subdir}/${module}/Makefile + fi + for mt in ${mts} ; do + case ${mt} in + install) ;; # No installing build modules. + *) echo "maybe-${mt}-build-${module}: ${mt}-build-${module}" >> maybedep.tmp ;; + esac + done +done +for module in ${configdirs} ; do + if test -z "${no_recursion}" \ + && test -f ${module}/Makefile; then + echo 1>&2 "*** removing ${module}/Makefile to force reconfigure" + rm -f ${module}/Makefile + fi + for mt in ${mts} ; do + echo "maybe-${mt}-${module}: ${mt}-${module}" >> maybedep.tmp + done +done +for module in ${target_configdirs} ; do + if test -z "${no_recursion}" \ + && test -f ${target_subdir}/${module}/Makefile; then + echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure" + rm -f ${target_subdir}/${module}/Makefile + fi + for mt in ${mts} ; do + echo "maybe-${mt}-target-${module}: ${mt}-target-${module}" >> maybedep.tmp + done +done +maybe_dependencies=maybedep.tmp +AC_SUBST_FILE(maybe_dependencies) + +# Create the serialization dependencies. This uses a temporary file. + +AC_ARG_ENABLE([serial-configure], +[ --enable-serial-[{host,target,build}-]configure + Force sequential configuration of + sub-packages for the host, target or build + machine, or all sub-packages]) + +case ${enable_serial_configure} in + yes) + enable_serial_build_configure=yes + enable_serial_host_configure=yes + enable_serial_target_configure=yes + ;; +esac + +# These force 'configure's to be done one at a time, to avoid problems +# with contention over a shared config.cache. +rm -f serdep.tmp +echo '# serdep.tmp' > serdep.tmp +olditem= +test "x${enable_serial_build_configure}" = xyes && +for item in ${build_configdirs} ; do + case ${olditem} in + "") ;; + *) echo "configure-build-${item}: configure-build-${olditem}" >> serdep.tmp ;; + esac + olditem=${item} +done +olditem= +test "x${enable_serial_host_configure}" = xyes && +for item in ${configdirs} ; do + case ${olditem} in + "") ;; + *) echo "configure-${item}: configure-${olditem}" >> serdep.tmp ;; + esac + olditem=${item} +done +olditem= +test "x${enable_serial_target_configure}" = xyes && +for item in ${target_configdirs} ; do + case ${olditem} in + "") ;; + *) echo "configure-target-${item}: configure-target-${olditem}" >> serdep.tmp ;; + esac + olditem=${item} +done +serialization_dependencies=serdep.tmp +AC_SUBST_FILE(serialization_dependencies) + +# Base args. Strip norecursion, cache-file, srcdir, host, build, +# target and nonopt. These are the ones we might not want to pass +# down to subconfigures. Also strip program-prefix, program-suffix, +# and program-transform-name, so that we can pass down a consistent +# program-transform-name. If autoconf has put single quotes around +# any of these arguments (because they contain shell metacharacters) +# then this will fail; in practice this only happens for +# --program-transform-name, so be sure to override --program-transform-name +# at the end of the argument list. +# These will be expanded by make, so quote '$'. +cat <<\EOF_SED > conftestsed +s/ --no[[^ ]]* / / +s/ --c[[a-z-]]*[[= ]][[^ ]]* / / +s/ --sr[[a-z-]]*[[= ]][[^ ]]* / / +s/ --ho[[a-z-]]*[[= ]][[^ ]]* / / +s/ --bu[[a-z-]]*[[= ]][[^ ]]* / / +s/ --t[[a-z-]]*[[= ]][[^ ]]* / / +s/ --program-[[pst]][[a-z-]]*[[= ]][[^ ]]* / / +s/ -cache-file[[= ]][[^ ]]* / / +s/ -srcdir[[= ]][[^ ]]* / / +s/ -host[[= ]][[^ ]]* / / +s/ -build[[= ]][[^ ]]* / / +s/ -target[[= ]][[^ ]]* / / +s/ -program-prefix[[= ]][[^ ]]* / / +s/ -program-suffix[[= ]][[^ ]]* / / +s/ -program-transform-name[[= ]][[^ ]]* / / +s/ [[^' -][^ ]*] / / +s/^ *//;s/ *$// +s,\$,$$,g +EOF_SED +sed -f conftestsed < conftestsed.out + ${ac_configure_args} +EOF_SED +baseargs=`cat conftestsed.out` +rm -f conftestsed conftestsed.out + +# Add in --program-transform-name, after --program-prefix and +# --program-suffix have been applied to it. Autoconf has already +# doubled dollar signs and backslashes in program_transform_name; we want +# the backslashes un-doubled, and then the entire thing wrapped in single +# quotes, because this will be expanded first by make and then by the shell. +# Also, because we want to override the logic in subdir configure scripts to +# choose program_transform_name, replace any s,x,x, with s,y,y,. +sed -e "s,\\\\\\\\,\\\\,g; s,','\\\\'',g; s/s,x,x,/s,y,y,/" < conftestsed.out +${program_transform_name} +EOF_SED +gcc_transform_name=`cat conftestsed.out` +rm -f conftestsed.out +baseargs="$baseargs --program-transform-name='${gcc_transform_name}'" # For the build-side libraries, we just need to pretend we're native, # and not use the same cache file. Multilibs are neither needed nor # desired. -buildargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} ${baseargs}" +build_configargs="--cache-file=../config.cache --build=${build_alias} --host=${build_alias} ${baseargs}" + +# For host modules, accept cache file option, or specification as blank. +case "${cache_file}" in +"") # empty + cache_file_option="" ;; +/* | [[A-Za-z]]:[[\\/]]* ) # absolute path + cache_file_option="--cache-file=${cache_file}" ;; +*) # relative path + cache_file_option="--cache-file=../${cache_file}" ;; +esac -# Record target_configdirs and the configure arguments for target and -# build configuration in Makefile. -target_configdirs=`echo "${target_configdirs}" | sed -e 's/target-//g'` -targargs=${baseargs} +# Host dirs don't like to share a cache file either, horribly enough. +# This seems to be due to autoconf 2.5x stupidity. +host_configargs="--cache-file=./config.cache --build=${build_alias} --host=${host_alias} --target=${target_alias} ${extra_host_args} ${baseargs}" + +target_configargs=${baseargs} # Passing a --with-cross-host argument lets the target libraries know # whether they are being built with a cross-compiler or being built @@ -1372,60 +1846,58 @@ targargs=${baseargs} # sorts of decisions they want to make on this basis. Please consider # this option to be deprecated. FIXME. if test x${is_cross_compiler} = xyes ; then - targargs="--with-cross-host=${host_alias} ${targargs}" + target_configargs="--with-cross-host=${host_alias} ${target_configargs}" fi # Default to --enable-multilib. if test x${enable_multilib} = x ; then - targargs="--enable-multilib ${targargs}" + target_configargs="--enable-multilib ${target_configargs}" fi # Pass --with-newlib if appropriate. Note that target_configdirs has # changed from the earlier setting of with_newlib. if test x${with_newlib} != xno && echo " ${target_configdirs} " | grep " newlib " > /dev/null 2>&1 && test -d ${srcdir}/newlib ; then - targargs="--with-newlib ${targargs}" + target_configargs="--with-newlib ${target_configargs}" fi +# Different target subdirs use different values of certain variables +# (notably CXX). Worse, multilibs use *lots* of different values. +# Worse yet, autoconf 2.5x makes some of these 'precious', meaning that +# it doesn't automatically accept command-line overrides of them. +# This means it's not safe for target subdirs to share a cache file, +# which is disgusting, but there you have it. Hopefully this can be +# fixed in future. It's still worthwhile to use a cache file for each +# directory. I think. + # Pass the appropriate --host, --build, and --cache-file arguments. -targargs="--cache-file=../config.cache --host=${target_alias} --build=${build_alias} ${targargs}" +target_configargs="--cache-file=./config.cache --host=${target_alias} --build=${build_alias} ${target_configargs}" # provide a proper gxx_include_dir. # Note, if you change the default, make sure to fix both here and in # the gcc and libstdc++-v3 subdirectories. # Check whether --with-gxx-include-dir or --without-gxx-include-dir was given. -gxx_include_dir= -if test -n "${with_gxx_include_dir}"; then - case "${with_gxx_include_dir}" in - yes ) - echo "configure.in: error: bad value ${withval} given for g++ include directory" 1>&2 - exit 1 - ;; - no ) - ;; - * ) - gxx_include_dir=${with_gxx_include_dir} - ;; - esac -fi -if test x${gxx_include_dir} = x; then - if test x${enable_version_specific_runtime_libs} = xyes; then - gxx_include_dir='${libsubdir}/include/c++' - else - . ${srcdir}/config.if - gxx_include_dir='${prefix}/include/${libstdcxx_incdir}' - fi -else - gxx_include_dir=${gxx_include_dir} -fi +case "${with_gxx_include_dir}" in + yes) + AC_MSG_ERROR([--with-gxx-include-dir=[[dir]] requires a directory]) + ;; + no | "") + case "${enable_version_specific_runtime_libs}" in + yes) gxx_include_dir='${libsubdir}/include/c++' ;; + *) + . ${srcdir}/config.if + gxx_include_dir='${prefix}/include/'${libstdcxx_incdir} ;; + esac ;; + *) gxx_include_dir=${with_gxx_include_dir} ;; +esac FLAGS_FOR_TARGET= case " $target_configdirs " in *" newlib "*) - case " $targargs " in + case " $target_configargs " in *" --with-newlib "*) case "$target" in *-cygwin*) - FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include -isystem $$s/newlib/libc/sys/cygwin -isystem $$s/newlib/libc/sys/cygwin32' ;; + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -L$$r/$(TARGET_SUBDIR)/winsup -L$$r/$(TARGET_SUBDIR)/winsup/cygwin -L$$r/$(TARGET_SUBDIR)/winsup/w32api/lib -isystem $$s/winsup/include -isystem $$s/winsup/cygwin/include -isystem $$s/winsup/w32api/include' ;; esac # If we're not building GCC, don't discard standard headers. @@ -1452,7 +1924,7 @@ case " $target_configdirs " in fi case "${target}-${is_cross_compiler}" in - i[3456]86-*-linux*-no) + i[[3456789]]86-*-linux*-no) # Here host == target, so we don't need to build gcc, # so we don't want to discard standard headers. FLAGS_FOR_TARGET=`echo " $FLAGS_FOR_TARGET " | sed -e 's/ -nostdinc / /'` @@ -1469,13 +1941,17 @@ case " $target_configdirs " in ;; esac +# Allow the user to override the flags for +# our build compiler if desired. +CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}} + # On Canadian crosses, we'll be searching the right directories for # the previously-installed cross compiler, so don't bother to add # flags for directories within the install tree of the compiler # being built; programs in there won't even run. if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then # Search for pre-installed headers if nothing else fits. - FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include' + FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include' fi if test "x${use_gnu_ld}" = x && @@ -1491,14 +1967,9 @@ elif test -d ${srcdir}/gcc; then elif test "$host" = "$target"; then CC_FOR_TARGET='$(CC)' else - CC_FOR_TARGET=`echo gcc | sed -e 's/x/x/' ${program_transform_name}` + CC_FOR_TARGET=`echo gcc | sed "${program_transform_name}"` fi -# On Canadian crosses, configure reads CC_FOR_TARGET from Makefile, -# if Makefile exists. Prevent $(FLAGS_FOR_TARGET) from being duplicated. -case $CC_FOR_TARGET in -*' $(FLAGS_FOR_TARGET)') ;; -*) CC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;; -esac +CC_FOR_TARGET=$CC_FOR_TARGET' $(FLAGS_FOR_TARGET)' if test "x${GCJ_FOR_TARGET+set}" = xset; then : @@ -1507,33 +1978,38 @@ elif test -d ${srcdir}/gcc; then elif test "$host" = "$target"; then GCJ_FOR_TARGET='gcj' else - GCJ_FOR_TARGET=`echo gcj | sed -e 's/x/x/' ${program_transform_name}` + GCJ_FOR_TARGET=`echo gcj | sed "${program_transform_name}"` fi -case $GCJ_FOR_TARGET in -*' $(FLAGS_FOR_TARGET)') ;; -*) GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;; -esac +GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)' # Don't use libstdc++-v3's flags to configure/build itself. -libstdcxx_flags='`case $$dir in libstdc++-v3 | libjava) ;; *) test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/testsuite_flags --build-includes;; esac` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' +libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' +raw_libstdcxx_flags='-L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs' if test "x${CXX_FOR_TARGET+set}" = xset; then - : + if test "x${RAW_CXX_FOR_TARGET+set}" != xset; then + RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET} + fi elif test -d ${srcdir}/gcc; then # We add -shared-libgcc to CXX_FOR_TARGET whenever we use xgcc instead # of g++ for linking C++ or Java, because g++ has -shared-libgcc by # default whereas gcc does not. - CXX_FOR_TARGET='$$r/gcc/`case $$dir in libstdc++-v3 | libjava) echo xgcc -shared-libgcc ;; *) echo g++ ;; esac` -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags + # RAW_CXX_FOR_TARGET is for linking C++ or java; CXX_FOR_TARGET is for + # all other cases. + CXX_FOR_TARGET='$$r/gcc/g++ -B$$r/gcc/ -nostdinc++ '$libstdcxx_flags + RAW_CXX_FOR_TARGET='$$r/gcc/xgcc -shared-libgcc -B$$r/gcc/ -nostdinc++ '$raw_libstdcxx_flags elif test "$host" = "$target"; then CXX_FOR_TARGET='$(CXX)' + RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET} else - CXX_FOR_TARGET=`echo c++ | sed -e 's/x/x/' ${program_transform_name}` + CXX_FOR_TARGET=`echo c++ | sed "${program_transform_name}"` + RAW_CXX_FOR_TARGET=${CXX_FOR_TARGET} fi -case $CXX_FOR_TARGET in -*' $(FLAGS_FOR_TARGET)') ;; -*) CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' ;; -esac -qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'` +CXX_FOR_TARGET=$CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' +RAW_CXX_FOR_TARGET=$RAW_CXX_FOR_TARGET' $(FLAGS_FOR_TARGET)' + +qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[[&%]],\\\&,g'` +qRAW_CXX_FOR_TARGET=`echo "$RAW_CXX_FOR_TARGET" | sed 's,[[&%]],\\\&,g'` # We want to defer the evaluation of `cmd`s and shell variables in # CXX_FOR_TARGET when recursing in the top-level Makefile, such as for @@ -1541,28 +2017,137 @@ qCXX_FOR_TARGET=`echo "$CXX_FOR_TARGET" | sed 's,[&%],\\\&,g'` # quotes, but we still have to duplicate `$'s so that shell variables # can be expanded by the nested make as shell variables, not as make # macros. -qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[$][$],$$$$,g'` - -sedtemp=sed.$$ -cat >$sedtemp < Makefile.tem -rm -f Makefile $sedtemp -mv -f Makefile.tem Makefile +qqCXX_FOR_TARGET=`echo "$qCXX_FOR_TARGET" | sed -e 's,[[$]][[$]],$$$$,g'` +qqRAW_CXX_FOR_TARGET=`echo "$qRAW_CXX_FOR_TARGET" | sed -e 's,[[$]][[$]],$$$$,g'` + +# Wrap CC_FOR_TARGET and friends, for certain types of builds. +CC_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${CC_FOR_TARGET}" +GCJ_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${GCJ_FOR_TARGET}" +CXX_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${qCXX_FOR_TARGET}" +RAW_CXX_FOR_TARGET="\$(STAGE_CC_WRAPPER) ${qRAW_CXX_FOR_TARGET}" +CXX_FOR_TARGET_FOR_RECURSIVE_MAKE="\$(STAGE_CC_WRAPPER) ${qqCXX_FOR_TARGET}" +RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE="\$(STAGE_CC_WRAPPER) ${qqRAW_CXX_FOR_TARGET}" + +# Makefile fragments. +host_makefile_frag=${srcdir}/${host_makefile_frag} +target_makefile_frag=${srcdir}/${target_makefile_frag} +alphaieee_frag=${srcdir}/${alphaieee_frag} +ospace_frag=${srcdir}/${ospace_frag} +AC_SUBST_FILE(host_makefile_frag) +AC_SUBST_FILE(target_makefile_frag) +AC_SUBST_FILE(alphaieee_frag) +AC_SUBST_FILE(ospace_frag) + +# Miscellanea: directories, flags, etc. +AC_SUBST(SET_LIB_PATH) +AC_SUBST(RPATH_ENVVAR) +AC_SUBST(BUILD_PREFIX) +AC_SUBST(BUILD_PREFIX_1) +AC_SUBST(configlinks) +AC_SUBST(gcc_version_trigger) +AC_SUBST(gcc_version) +AC_SUBST(tooldir) +AC_SUBST(build_tooldir) +AC_SUBST(GDB_TK) +AC_SUBST(gxx_include_dir) +AC_SUBST(libstdcxx_incdir) + +# Build module lists & subconfigure args. +AC_SUBST(build_configargs) +AC_SUBST(configure_build_modules) +AC_SUBST(all_build_modules) + +# Host module lists & subconfigure args. +AC_SUBST(host_configargs) +AC_SUBST(configdirs) + +# Target module lists & subconfigure args. +AC_SUBST(target_configargs) +AC_SUBST(target_configdirs) + +# Build tools. +AC_SUBST(BISON) +AC_SUBST(CC_FOR_BUILD) +AC_SUBST(LEX) +AC_SUBST(MAKEINFO) +AC_SUBST(YACC) +AC_SUBST(config_shell) + +# Host tools. +NCN_STRICT_CHECK_TOOL(AR, ar) +NCN_STRICT_CHECK_TOOL(AS, as) +NCN_STRICT_CHECK_TOOL(DLLTOOL, dlltool) +NCN_STRICT_CHECK_TOOL(LD, ld) +NCN_STRICT_CHECK_TOOL(NM, nm) +NCN_STRICT_CHECK_TOOL(RANLIB, ranlib, :) +NCN_STRICT_CHECK_TOOL(WINDRES, windres) +NCN_STRICT_CHECK_TOOL(OBJCOPY, objcopy) +NCN_STRICT_CHECK_TOOL(OBJDUMP, objdump) +AC_SUBST(CC) +AC_SUBST(CXX) +AC_SUBST(CFLAGS) +AC_SUBST(CFLAGS_FOR_BUILD) +AC_SUBST(CXXFLAGS) +AC_SUBST(DEFAULT_YACC) +AC_SUBST(DEFAULT_LEX) +AC_SUBST(DEFAULT_M4) + +# Target tools. +NCN_STRICT_CHECK_TARGET_TOOL(AR_FOR_TARGET, ar) +NCN_STRICT_CHECK_TARGET_TOOL(AS_FOR_TARGET, as) +NCN_STRICT_CHECK_TARGET_TOOL(DLLTOOL_FOR_TARGET, dlltool) +NCN_STRICT_CHECK_TARGET_TOOL(LD_FOR_TARGET, ld) +NCN_STRICT_CHECK_TARGET_TOOL(NM_FOR_TARGET, nm) +NCN_STRICT_CHECK_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib, :) +NCN_STRICT_CHECK_TARGET_TOOL(WINDRES_FOR_TARGET, windres) + +AC_SUBST(GCC_FOR_TARGET) +AC_SUBST(FLAGS_FOR_TARGET) +AC_SUBST(CC_FOR_TARGET) +AC_SUBST(GCJ_FOR_TARGET) +AC_SUBST(CXX_FOR_TARGET) +AC_SUBST(RAW_CXX_FOR_TARGET) +AC_SUBST(CXX_FOR_TARGET_FOR_RECURSIVE_MAKE) +AC_SUBST(RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE) + +# Fix up target tools. +if test "x${build}" = "x${host}" ; then + # In this case, the newly built tools can and should be used, + # so we override the results of the autoconf tests. + # This should really only happen when the tools are actually being built, + # but that's a further refinement. The new build scheme, where + # tools are built into a structure paralleling where they're installed, + # should also eliminate all of this cleanly. + AR_FOR_TARGET="\$(USUAL_AR_FOR_TARGET)" + AS_FOR_TARGET="\$(USUAL_AS_FOR_TARGET)" + DLLTOOL_FOR_TARGET="\$(USUAL_DLLTOOL_FOR_TARGET)" + LD_FOR_TARGET="\$(USUAL_LD_FOR_TARGET)" + NM_FOR_TARGET="\$(USUAL_NM_FOR_TARGET)" + RANLIB_FOR_TARGET="\$(USUAL_RANLIB_FOR_TARGET)" + WINDRES_FOR_TARGET="\$(USUAL_WINDRES_FOR_TARGET)" +fi +# Certain tools may need extra flags. +AR_FOR_TARGET=${AR_FOR_TARGET}${extra_arflags_for_target} +RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target} +NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target} + +AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) +AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) +AC_MSG_RESULT($USE_MAINTAINER_MODE) +AC_SUBST(MAINTAINER_MODE_TRUE) +AC_SUBST(MAINTAINER_MODE_FALSE) +if test "$USE_MAINTAINER_MODE" = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi +MAINT=$MAINTAINER_MODE_TRUE +AC_SUBST(MAINT)dnl -# -# Local Variables: -# fill-column: 131 -# End: -# +AC_OUTPUT(Makefile) diff --git a/contrib/binutils/gas/CONTRIBUTORS b/contrib/binutils/gas/CONTRIBUTORS index 68d11dc..d564ba8 100644 --- a/contrib/binutils/gas/CONTRIBUTORS +++ b/contrib/binutils/gas/CONTRIBUTORS @@ -30,9 +30,8 @@ sparc opcode file rewrite, decstation, rs6000, and hp300hpux host ports, updated "know" assertions and made them work, much other reorganization, cleanup, and lint. -Ken Raeburn currently maintains gas, and wrote the high-level BFD -interface code to replace most of the code in format-specific I/O -modules. +Ken Raeburn wrote the high-level BFD interface code to replace most of +the code in format-specific I/O modules. The original Vax-VMS support was contributed by David L. Kashtan. Eric Youngdale and Pat Rankin have done much work with it since. diff --git a/contrib/binutils/gas/ChangeLog b/contrib/binutils/gas/ChangeLog index 94223d0..df93f2a 100644 --- a/contrib/binutils/gas/ChangeLog +++ b/contrib/binutils/gas/ChangeLog @@ -1,2642 +1,608 @@ -2002-11-20 Alan Modra +2004-05-23 Alan Modra - * write.c (adjust_reloc_syms): Don't reduce SEC_MERGE fixups with - fx_subsy non-NULL. + * expr.c (operand, operator): Don't reject '++' and '--'. -2002-11-19 Richard Henderson +2004-05-13 Joel Sherrill - * config/obj-elf.c (obj_elf_visibility): Overwrite only the - visibility portion of st_other. - -2002-11-19 Luke Deller - - * config/tc-alpha.c (s_alpha_prologue): as_bad when sym is NULL. - -2002-11-13 Alan Modra - - Merge from mainline. - 2002-09-04 Alan Modra - * config/tc-ppc.c (PPC_HIGHER, PPC_HIGHEST): Fix warning. - (md_parse_option): No -a64 without BFD64. - (ppc_set_cpu): Select appropriate cpu when ppc_obj64. - (ppc_arch): Use bfd_mach_rs6k for bfd_arch_rs6000. - -2002-11-06 Richard Henderson - - * config/tc-alpha.c (alpha_validate_fix): Move code ... - (alpha_fix_adjustable): ... here. - * config/tc-alpha.h (TC_VALIDATE_FIX): Remove. - -2002-11-05 H.J. Lu - - * config/tc-mips.c (support_64bit_objects): Check *l before it - is freed. - -2002-10-31 David O'Brien - - * config/tc-ia64.c: Cast dwarf2_directive_file to int. - * config/tc-sparc.c: Likewise. - * config/tc-alpha.c: Cast s_alpha_file to int. - * config/tc-alpha.h (TC_INIT_FIX_DATA): info is of type struct - alpha_reloc_tag. - -2002-10-30 Daniel Jacobowitz - - * configure.in: Update ARM CPU patterns. - * configure: Regenerated. - -2002-10-30 Daniel Jacobowitz - - * po/gas.pot: Regenerated. - -2002-10-29 Daniel Jacobowitz - - * itbl-lex.l: Use #include <> for generated headers. - * itbl-ops.c: Likewise. - -2002-08-24 Andreas Schwab - - * config/tc-m68k.c (tc_m68k_fix_adjustable): Don't adjust symbols - in merge sections. - -2002-10-28 Daniel Jacobowitz - - * doc/gasp.texi: Fix typo in last typo fix. - -2002-10-28 Daniel Jacobowitz - - Merge from mainline: - 2002-10-21 Richard Sandiford - * config/tc-mips.c (mips_need_elf_addend_fixup): Return true - for relocs against symbols in a merged section. - - Thu Oct 10 14:31:30 2002 J"orn Rennecke - * config/tc-sh.c (assemble_ppi): Initialize reg_x / reg_y / reg_n - inside loop. - -2002-10-17 Johannes Stezenbach - - * itbl-parse.y (entry): Provide empty action. - -2002-10-14 Momchil Velikov - - * config/tc-v850.c (CHECK_): Remove token pasting operator. - -2002-10-11 David O'Brien - - * gas/gasp.texi: Fix typo in noting that gasp is now deprecated. - -2002-10-11 Michel Six - Alan Modra - - * config/tc-i386.c (output_jump): Set fx_signed for loop/jcxz. - (md_estimate_size_before_relax): Likewise for 8 bit branches. - -2002-09-24 Alan Modra - - * config/tc-i386.c (process_operands): Warn about "lea" segment - overrides. - -2002-09-23 Daniel Jacobowitz - - Merge from mainline: - 2002-09-22 Mark Elbrecht - * write.c: Delete set_segment_vma and prototype. Update all callers. - - 2002-09-19 Jakub Jelinek - * config/tc-i386.c (tc_i386_fix_adjustable): Handle - BFD_RELOC_386_TLS_IE and BFD_RELOC_386_TLS_GOTIE. - (BFD_RELOC_386_TLS_IE, BFD_RELOC_386_TLS_GOTIE): Define to 0 - if not defined. - (lex_got): Handle @GOTNTPOFF and @INDNTPOFF. - (md_apply_fix3, tc_gen_reloc): Handle BFD_RELOC_386_TLS_IE and - BFD_RELOC_386_TLS_GOTIE. - - 2002-09-16 Chris Demetriou - * config/tc-mips.c (IS_SEXT_32BIT_NUM): Move closer to top of file. - (IS_SEXT_16BIT_NUM): New macro. - (macro_build_ldst_constoffset): New function, to build a set of - instructions to do a load or store from a constant offset relative - to a given register. - (macro, s_cprestore): Use macro_build_ldst_constoffset to implement - .cprestore pseudo-op. - - 2002-09-16 Elias Athanasopoulos - * dwarf2dbg.c (out_debug_abbrev): Add support for the DW_AT_name field. - (out_debug_info): Likewise. - - 2002-09-13 Nick Clifton - * config/tc-ppc.c (md_assemble): Do not count FAKE operands - when deciding if any operands have been skipped. - - 2002-09-11 Jakub Jelinek - * config/tc-i386.c (md_apply_fix3): Allow addend for - BFD_RELOC_386_TLS_LDO_32, BFD_RELOC_386_TLS_LE and - BFD_RELOC_386_TLS_LE_32. - - 2002-09-11 Nick Clifton - * po/tr.po: Updated Turkish translation. - - 2002-09-04 Nick Clifton - * config/tc-ppc.c (md_begin): Do not insert non-BookE32 - instructions into the hash table if the target cpu is the BookE32. - - 2002-08-20 Richard Sandiford - * config/tc-mips.c (macro2): Implement rotates by zero using shifts - by zero. - - 2002-08-15 Alexandre Oliva - * config/tc-mips.c (macro_build_jalr): Make sure we generate - the fix-up against on the right frag. - (s_cpsetup): Likewise. Parse third argument as expression, to - handle global symbols and forward/backward labels correctly. - - 2002-08-14 Nick Clifton - * read.c (stringer): Catch attempts to create strings in the abs - section. - - 2002-08-12 Richard Sandiford - * config/tc-mips.c (mips_ip): Don't work out the value of - constant %hi()s here. - - 2002-08-10 Alan Modra - * config/tc-i386.c (tc_i386_fix_adjustable): Test OUTPUT_FLAVOR - for ELF, and don't bother checking ELF relocs when non-ELF. - (i386_immediate): Allow absolute_section expressions for aout. - (i386_displacement): Likewise. Also test bfd_is_com_section. - (md_estimate_size_before_relax): Test OUTPUT_FLAVOR for ELF. - (md_apply_fix3): Hack for bfd_install_relocation when fx_pcrel, - not when fx_addsy. Remove dead code. - - 2002-08-06 George France - * config/tc-alpha.c (cpu_types): Enabled ev67, ev68, -m21264a - and m21264b processor names and cpu types. - * doc/c-alpha.texi: Documented new types. - - 2002-08-06 Alan Modra - * config/tc-ppc.c (md_apply_fix3): Adjust 16 bit XCOFF reloc offset. - - 2002-08-03 Jakub Jelinek - * config/tc-i386.c (output_insn): Save frag_now and frag_now_fix () - at start of insn, pass it to output_disp and output_imm. - (output_disp): Added arguments. If _GLOBAL_OFFSET_TABLE_ is seen - in displacement for R_386_32 reloc, use R_386_GOTPC and compute - properly addend. - (output_imm): Added arguments. Compute properly addend for - R_386_GOTPC. - (md_apply_fix3): Remove R_386_GOTPC handling. - - 2002-07-31 Momchil Velikov - * config/tc-v850.c (md_assemble): Fix range check for immediate - operand. - - 2002-07-04 Bruno Haible - * config/tc-i386.h (ELF_TARGET_FORMAT): New macro. - (TARGET_FORMAT): Use ELF_TARGET_FORMAT instead of "elf32-i386". - * config/tc-i386.c (i386_target_format): Likewise. - * config/tc-alpha.h (ELF_TARGET_FORMAT): New macro. - (TARGET_FORMAT): Use ELF_TARGET_FORMAT instead of "elf64-alpha". - -2002-08-26 Alan Modra - - * config/tc-w65.c (md_section_align): Fix typo. - (md_parse_option): Return 0, not 1. - -2002-08-20 Maciej W. Rozycki - - * config/tc-mips.c (macro): Handle a register plus a 16-bit - immediate offset in "dla" and "la" expansions. - -2002-08-01 Daniel Jacobowitz - - Merge from mainline: - 2002-08-01 Richard Sandiford - * config/tc-mips.c (tc_gen_reloc): Extend GP-relative addend - handling to BFD_RELOC_MIPS16_GPREL. - -2002-08-01 H.J. Lu - Daniel Jacobowitz - - * dwarf2dbg.c (dwarf2_finish): Don't emit unreferenced - .debug_line section unless it has line information. - -2002-07-31 Daniel Jacobowitz - - Merge from mainline: - 2002-07-30 Maciej W. Rozycki - * tc-mips.c (load_address): Don't clobber $at when loading a - 64-bit address in non-PIC code if noat is in effect. - (macro): Likewise. - - 2002-07-30 Maciej W. Rozycki - * config/tc-mips.c (macro): Use codes 6 and 7 in trap instructions - used in division/multiply macro expansions similarly to how they - are used in the variants with break instructions. - (macro2): Likewise. - -2002-07-26 Alan Modra - - * config/tc-ppc.c (ppc_set_cpu): Use PPC_OPCODE_64 as the default - rather than PPC_OPCODE_32 for powerpc64*. - -2002-07-25 Nick Clifton - - * po/es.po: Updated Spanish translation. - * po/fr.po: Updated French translation. - -2002-07-24 Nick Clifton - - * po/sv.po: Updated Swedish translation. - * po/es.po: Updated Spanish translation. - -2002-07-23 Daniel Jacobowitz - - * po/gas.pot: Regenerated. - -2002-07-23 Nick Clifton - - * po/fr.po: Updated French translation. - -2002-07-16 Moritz Jodeit - - * config/tc-z8k.c (build_bytes): Correct order of memset args. - -2002-07-16 Nick Clifton - - * NEWS: Add 'Changes in 2.13'. - -2002-07-15 Matt Fredette - - * config/tc-hppa.h (LABELS_WITHOUT_COLONS): Define if TE_NetBSD. - -2002-07-12 Alan Modra - - * config/tc-i386.c (process_suffix): Merge CODE_64BIT JumpByte - case with non CODE_64BIT case. Don't warn on "qword ptr" if - not CODE_64BIT. - -2002-07-11 Alan Modra - - * config/tc-ppc.c (ppc_elf_frob_symbol): Delete. - (ppc_frob_file_before_adjust): New function. - * config/tc-ppc.h (tc_frob_symbol): Don't define. - (ppc_elf_frob_symbol): Don't declare. - (tc_frob_file_before_adjust): Define. - (ppc_frob_file_before_adjust): Declare. - - * config/tc-ppc.c (md_pseudo_table): Warning fix. - (ppc_cpu): Make it unsigned long to agree with struct powerpc_opcode - flags. - (ppc_size): Delete. - (ppc_xcoff64): Rename to ppc_obj64. - (md_parse_option ): Encode old ppc_size value in ppc_cpu. - (ppc_set_cpu): Set PPC_OPCODE_32 too. - (ppc_arch): Use ppc_obj64 instead of ppc_size to select bfd_mach_ppc64 - or bfd_mach_ppc. - (ppc_target_format): Use ppc_obj64 to select format. - (md_begin): Adjust for PPC_OPCODE_32/64 in ppc_cpu. - (ppc_insert_operand): Use ppc_obj64 instead of ppc_size. - (ppc_elf_suffix): Likewise. Don't depend on BFD_DEFAULT_TARGET_SIZE. - (tc_frob_symbol): Likewise. - (md_assemble): Use ppc_obj64 instead of ppc_size. Don't depend on - BFD_DEFAULT_TARGET_SIZE. - (ppc_tc): Likewise. - (ppc_is_toc_sym): Likewise. - (md_apply_fix3): Likewise. - * config/tc-ppc.h (TC_FORCE_RELOCATION): Don't depend on - BFD_DEFAULT_TARGET_SIZE. - (ELF_TC_SPECIAL_SECTIONS): Likewise. - (tc_frob_symbol): Likewise. - -2002-07-09 Thiemo Seufer - - * config/tc-mips.c (macro_build): Handle MIPS16 insns. - (mips_ip): Likewise. - -2002-07-09 Alan Modra - - * config/tc-i386.c (md_pseudo_table ): Warning fix. - (BFD_RELOC_8, BFD_RELOC_8_PCREL): Define for non-BFD. - (md_apply_fix3): Formatting. Remove redundant test. - (tc_gen_reloc): Remove redundant code. - (tc_i386_force_relocation): Delete. Movy body of function to.. - * config/tc-i386.h (TC_FORCE_RELOCATION): .. here. - -2002-07-09 Federico G. Schwindt - - * configure.in: Add hppa-*-openbsd* target, change - alpha*-*-openbsd* format to elf, and use elf for sparc-*-openbsd* - with sparc64 cpu. + * configure.in (or32-*-rtems*): Switch to elf. * configure: Regenerate. -2002-07-08 Maciej W. Rozycki - - * config/tc-mips.c (macro): Shift the 32-bit address range - accessible with a lone "lui" down by 32768. - -2002-07-08 Maciej W. Rozycki - - * config/tc-mips.c (load_address): Use non-trapping "daddu" - instead of "dadd" in address calculations. - (macro): Likewise. - -2002-07-08 Alan Modra - - * config/tc-i386.c (process_suffix): Remove intel mode movsx and - movzx fudges. - (md_assemble): Instead, zap the suffix here. - -2002-07-03 Nick Clifton - - * NEWS: Remove next release number until the release is actually - upon us. - -2002-07-03 Alan Modra - - * Makefile.am (check-DEJAGNU): Revert 2002-06-25 change. - Run "make dep-am". - * Makefile.in: Regenerate. - -2002-07-02 Martin Schwidefsky - - * config/tc-s390.c (tc_s390_fix_adjustable): Prevent any adjustment - to symbols in merge sections, even non pc-relative ones. - -2002-06-29 Stephane Carrez - - * config/tc-m68hc11.h (m68hc11_listing_header): Fix warning. +2004-05-13 Nick Clifton -2002-06-29 Stephane Carrez - - * config/tc-m68hc11.h (ELF_TC_SPECIAL_SECTIONS): New sections - .softregs and .eeprom. - -2002-06-28 David O'Brien - - * NEWS: Note the next release is 2.13. - -2002-06-26 Nick Clifton - - * po/tr.po: New translation imported. - -2002-06-26 Elias Athanasopoulos - - * ecoff.c: (get_tag): Replace strcpy with xstrdup. - (ecoff_directive_def): Likewise. - (ecoff_directive_tag): Likewise. - * listing.c (file_info): Likewise. - * hash.c (what): Likewise. - -2002-06-25 H.J. Lu - - * Makefile.am (check-DEJAGNU): Set LC_ALL=C and export it. - * Makefile.in: Regenerated. - -2002-06-19 Dhananjay R. Deshpande - - * config/tc-sh.c (get_specific): Revert 2002-05-01 change. - (assemble_ppi): Generate warning if the same register is used - twice as destination in the same padd / pmuls instruction. - -2002-06-18 Dave Brolley - - From Catherine Moore, Michael Meissner, Richard Sandiford, Dave Brolley - * po/POTFILES.in: Add tc-frv.c, tc-frv.h. - * configure.in: Support frv-*-*. - * Makefile.am (CPU_TYPES): Add frv. - (TARGET_CPU_CFILES): Add tc-frv.c. - (TARGET_CPU_HFILES): Add tc-frv.h. - (DEPTC_frv_coff): New variable. - (DEPTC_frv_elf): New variable. - (DEPOBJ_frv_coff): New variable. - (DEPOBJ_frv_elf): New variable. - (DEP_frv_coff): New variable. - (DEP_frv_elf): New variable. - * tc-frv.c: New file. - * tc-frv.h: New file. - -2002-06-17 Catherine Moore - - * config/obj-elf.h (TARGET_SYMBOL_FIELDS): Conditionally define. - -2002-06-17 J"orn Rennecke - - * config/tc-sh.c (assemble_ppi): Initialize reg_n. - -2002-06-17 Tom Rix - - * config/tc-i370.h (tc_comment_chars): Define for i370-elf. - -2002-06-14 H.J. Lu - Daniel Jacobowitz - - * dwarf2dbg.h (dwarf2_directive_file): Return char *. - * dwarf2dbg.c (dwarf2_directive_file): Return filename. - * config/tc-mips.c (s_mips_file): Call s_app_file_string - and new_logical_line for the first .file directive. - * read.c (s_app_file_string): New function. - (s_app_file): Call it. - * read.h (s_app_file_string): Add declaration. - -2002-06-14 Daniel Jacobowitz - - * configure.in: Remove MIPS_STABS_ELF. - * configure: Regenerated. - * config.in: Regenerated. - * config/obj-elf.h (ECOFF_DEBUGGING): Define to mips_flag_mdebug - for MIPS targets. - * config/tc-mips.c (mips_pseudo_table): Remove #ifdef around - ".extern". - (pdr_seg): Declare unconditionally. - (md_begin): Always generate .pdr unless ECOFF_DEBUGGING or not ELF. - (s_mips_end): Likewise. Generate stabs function markers. - (s_mips_ent): Generate stabs function markers. - (s_mips_frame): Always generate .pdr unless ECOFF_DEBUGGING or not - ELF. - (s_mips_mask): Likewise. - (mips_flag_mdebug): New. - (md_longopts): Add "mdebug" and "no-mdebug". - (md_parse_options): Add OPTION_MDEBUG and OPTION_NO_MDEBUG. - (mips_after_parse_args): Set mips_flag_mdebug. - * doc/as.texinfo: Add "-mdebug" and "-no-mdebug" for MIPS. - -2002-06-13 Maciej W. Rozycki - - * config/tc-mips.c (md_apply_fix3): Don't subtract the symbol's - value twice for RELA relocations. - -2002-06-12 Ben Elliston - - * symbols.c (resolve_symbol_value): Initialise final_val. - - * subsegs.c (subsegs_print_statistics): Cast frchp to void *. - -2002-06-11 Tom Rix - - * config/tc-ppc.c (ppc_subseg_align): Delete. - (ppc_change_csect): Default csect align is 2. - * config/tc-ppc.h (SUB_SEGMENT_ALIGN): Delete - -2002-06-09 Marek Michalkiewicz - - * config/tc-avr.c (mcu_types): Update. - -2002-06-08 Matt Thomas - - * configure.in (vax-*-netbsdelf*, vax-*-netbsdaout*) - (vax-*-netbsd*): New targets. - * configure: Regenerate. - * config/aout_gnu.h (enum machine_type): Add M_VAX4K_NETBSD. - * config/tc-vax.c: Add support for ELF and PIC. - (flag_want_pic): New flag. - (float_cons): Fix prototype. - (md_apply_fix3): Adjust for BFD_ASSEMBLER. - (md_assemble): Introduce a new is_absolute local, and use it - rather than repeating the test. Make fatal errors actually - fatal by using as_fatal as appropriate. Adjust for BFD_ASSEMBLER. - Add support for ELF. Add support for PIC. - (md_convert_frag): Adjust for BFD_ASSEMBLER. - (tc_aout_fix_to_chars): Only include if OBJ_AOUT and not - BFD_ASSEMBLER. - (vax_reg_parse): Make the % register prefix mandatory for ELF, - optional for a.out, and not allowed for VMS. Adjust all callers. - (md_create_short_jump): Add ATTRIBUTE_UNUSED to unused arguments. - (md_create_long_jump): Likewise. - (md_undefined_symbol): Likewise. - (md_section_align): Likewise. - (md_shortopts): Allow -k and -K for ELF. - (md_parse_option): Set flag_want_pic if -k or -K. - (tc_headers_hook): New function if OBJ_AOUT and not BFD_ASSEMBLER. - (tc_gen_reloc): New function if BFD_ASSEMBLER. - * config/tc-vax.h (tc_headers_hook): Remove. - (TARGET_FORMAT): Set according to object format and target - environment. - (BFD_ARCH, TARGET_ARCH): Define. - (NO_RELOC): Adjust for BFD_ASSEMBLER. - (TC_RELOC_RTSYM_LOC_FIXUP, TC_FIX_ADJUSTABLE) - (tc_fix_adjustable): Define if BFD_ASSEMBLER. - * config/vax-inst.h (VAX_JSB, VAX_CALLS, VAX_CALLG): Define. - -2002-06-08 Alan Modra - - * Makefile.am: Run "make dep-am". - * Makefile.in: Regenerate. - - * as.c: Replace CONST with const. - * write.c: Likewise. - * config/obj-coff.c: Likewise. - * config/tc-a29k.c: Likewise. - * config/tc-arm.c: Likewise. - * config/tc-dlx.c: Likewise. - * config/tc-h8300.c: Likewise. - * config/tc-h8500.c: Likewise. - * config/tc-i370.c: Likewise. - * config/tc-i860.c: Likewise. - * config/tc-i960.c: Likewise. - * config/tc-m68hc11.c: Likewise. - * config/tc-m68k.c: Likewise. - * config/tc-m88k.c: Likewise. - * config/tc-mcore.c: Likewise. - * config/tc-mips.c: Likewise. - * config/tc-ns32k.c: Likewise. - * config/tc-pdp11.c: Likewise. - * config/tc-pj.c: Likewise. - * config/tc-s390.c: Likewise. - * config/tc-sh.c: Likewise. - * config/tc-sparc.c: Likewise. - * config/tc-tahoe.c: Likewise. - * 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. - -2002-06-08 Daniel Jacobowitz - - Based on patch from Matt Green: - * config/obj-elf.h (ECOFF_DEBUGGING): Make configurable. - * config/tc-mips.c (s_mips_file): Renamed from s_file. - (s_mips_loc): New function. - (mips_nonecoff_pseudo_table): Call them. - (append_insn): Call dwarf2_emit_insn. - -2002-06-08 Thiemo Seufer - - * config/tc-mips.c (mips_opts): Fix comment, all ASE fields are set - to -1. - (file_ase_mips16): New veriable. - (mips_eabi64): Remove. - (CPU_HAS_MIPS16): New define. - (CPU_HAS_MDMX): Fix data type. - (md_begin): Code cleanup. Use file_ase_mips16. - (mips_elf_final_processing): Handle mips16 header flag. - Handle EABI flag without intermediate variable. - -2002-06-08 Thiemo Seufer - - * doc/as.texinfo: Update MIPS documentation. - -2002-06-08 Thiemo Seufer - - * config/tc-mips.c: Add define for $zero register. - (md_begin): Add $zero as alias name for $0. - (insn_uses_reg): Use ZERO define. - (mips_ip): Add $zero as alias name for $0. - (mips16_ip): Likewise. - (s_cplocal): Demand empty rest of input line. - (tc_get_register): Likewise. Add support for $kt0, kt1 register - names. Use ZERO define. Fix input_line_pointer progress. - -2002-06-07 Alan Modra - - * symbols.c: Replace CONST by const throughout. - (symbol_find_exact): Split out from.. - (symbol_find_base): ..here. - * symbols.h: Replace CONST by const throughout. - (symbol_find_exact): Declare. - * config/obj-elf.c: #include "struc-symbol.h". - (elf_frob_file): If group name matches an exported symbol, use that - symbol for the signature and ".group" as the section name. - -2002-06-06 J"orn Rennecke - - * config/tc-sh.c (parse_at): @(symbol,pc) is A_DISP_PC again, - but warn about it. - * testsuite/gas/sh/pcrel.s: Also test @(symbol,pc). - * testsuite/gas/sh/pcrel.d: Update. - * testsuite/gas/sh/pcrel.l: New file. - -2002-06-06 Daniel Jacobowitz - - * tc-mips.c (mips_after_parse_args): Always set mips_opts.ase_mips3d - and mips_opts.ase_mdmx if they are uninitialized. - -2002-06-06 John David Anglin - - * gas/config/tc-hppa.c (pa_ip): Replace "L$0\001" with FAKE_LABEL_NAME. - (hppa_force_relocation): Check if a stub just before the start symbol - of the last call_info is reachable before forcing relocation. Fix - typo. - -2002-06-04 Maciej W. Rozycki - - * config/tc-mips.c (mips_after_parse_args): New function. - (md_begin): Move processing of defaults to mips_after_parse_args. - config/tc-mips.h (md_after_parse_args): Define. - -2002-06-04 Jason Thorpe - - * configure.in (sh5*): Set cpu_type to sh64 and endian to big. - (sh5le*, sh64le*): Set cpu_type to sh64 and endian to little. - (sh5*-*-netbsd*, sh64*-*-netbsd*): New targets. - * configure: Regenerate. - * config/tc-sh64.c (sh64_target_format): Add support for NetBSD - environment. - -2002-06-04 Jason Thorpe - - * config/tc-sh64.h (MD_PCREL_FROM_SECTION): Undef before redefining. - -2002-06-04 Alan Modra - - * config/obj-elf.c (obj_elf_change_section): Set and check elf - linkonce flag. Print all warnings. - (obj_elf_section): Parse ",comdat" for groups. - (elf_frob_file): Set SEC_LINK_ONCE on COMDAT groups. Check - consistency of comdat flag. - -2002-06-02 Richard Henderson - - * config/tc-alpha.c (alpha_adjust_symtab_relocs): Fix thinko - with LITERALs without sequence numbers. - -2002-06-01 Richard Henderson - - * config/tc-alpha.c: Move LITUSE constants to "elf/alpha.h". - Rename them LITUSE_ALPHA_*. - -2002-05-31 Shrinivas Atre - - * config/tc-h8300.c (get_operand): Allow stm.l and ldm.l insns to - accept parentheses enclosed register lists. - -2002-05-31 Alan Modra + * po/fr.po: Updated French translation. - * Makefile.am: Run "make dep-am". - * Makefile.in: Regenerate. - * po/POTFILES.in: Regenerate. +2004-05-07 Daniel Jacobowitz -2002-05-31 Graeme Peterson + * Makefile.am (DIST_SUBDIRS): Define. + * aclocal.m4: Regenerate with automake 1.8.4. + * Makefile.in: Likewise. + * doc/Makefile.in: Likewise. - * configure.in: Add i386-*-nto-qnx*. - * configure: Regenerate. +2004-05-07 Daniel Jacobowitz -2002-05-31 Thiemo Seufer - - * config/tc-mips.c (mips_ip): Use unsigned long values for - warning output. - -2002-05-31 Thiemo Seufer - - * config/tc-mips.c (s_cpsetup): Fix initialization of - mips_cpreturn_register and mips_cpreturn_offset. - -2002-05-31 Thiemo Seufer - - * config/tc-mips.c (s_cpsetup): Fix comment. - -2002-05-31 Thiemo Seufer - - * config/tc-mips.c (md_begin): Add $ra as alias name for $31. - (mips_ip): Likewise. - (mips16_ip): Likewise. - (tc_get_register): Likewise. - -2002-05-30 Chris G. Demetriou - Ed Satterthwaite - - * config/tc-mips.c (mips_set_options): New "ase_mdmx" member. - (mips_opts): Initialize "ase_mdmx" member. - (file_ase_mdmx): New variable. - (CPU_HAS_MDMX): New macro. - (md_begin): Initialize mips_opts.ase_mdmx and file_ase_mdmx - based on command line options and configuration defaults. - (macro_build): Note in comment that use of MDMX in macros is - not currently allowed. - (validate_mips_insn): Add support for the "O", "Q", "X", "Y", and - "Z" MDMX operand types. - (mips_ip): Accept MDMX instructions if mips_opts.ase_mdmx is set, - and add support for the "O", "Q", "X", "Y", and "Z" MDMX operand - types. - (OPTION_MDMX, OPTION_NO_MDMX, md_longopts, md_parse_option): - Add support for "-mdmx" and "-no-mdmx" options. - (OPTION_ELF_BASE): Move to accomodate new options. - (s_mipsset): Support ".set mdmx" and ".set nomdmx". - (mips_elf_final_processing): Set MDMX ASE ELF header flag if - file_ase_mdmx was set. - * doc/as.texinfo: Document -mdmx and -no-mdmx options. - * doc/c-mips.texi: Likewise, and document ".set mdmx" and ".set - nomdmx" directives. - -2002-05-31 Thiemo Seufer - - * config/tc-mips.c (OPTION_NO_M7000_HILO_FIX): Rename to - OPTION_MNO_7000_HILO_FIX. Add alternate "mno-fix7000" - command line switch conforming to gcc conventions. - * doc/c-mips.texi: Document -mno-fix7000 instead of no-mfix-7000. - -2002-05-31 Thiemo Seufer - - * config/tc-mips.c (macro_build_jalr): New Function. - (md_begin): NewABI uses big GOTs. - (macro_build): Recognize BFD_RELOC_MIPS_GOT_DISP, - BFD_RELOC_MIPS_GOT_PAGE, BFD_RELOC_MIPS_GOT_OFST as valid. - (load_address): Add some NewABI PIC support. - (macro): Likewise. - (md_apply_fix): Special handling for BFD_RELOC_MIPS_JALR. - (tc_gen_reloc): Don't encode NewABI vtables in REL relocations. - -2002-05-31 Thiemo Seufer - - * config/tc-mips.c (load_address): Use mips_gp_register instead - of hardcoded value. Remove dbl parameter, use HAVE_32BIT_ADDRESSES - instead. - (macro): Use mips_gp_register instead of hardcoded value. - -2002-05-30 Richard Henderson - - * expr.h (operatorT): Add O_md17..O_md32. - * config/tc-alpha.c (O_lituse_tlsgd, O_lituse_tlsldm, O_tlsgd, - O_tlsldm, O_gotdtprel, O_dtprelhi, O_dtprello, O_dtprel, O_gottprel, - O_tprelhi, O_tprello, O_tprel): New. - (USER_RELOC_P, alpha_reloc_op_tag, debug_exp): Include them. - (DUMMY_RELOC_LITUSE_TLSGD, DUMMY_RELOC_LITUSE_TLSLDM): New. - (LITUSE_TLSGD, LITUSE_TLSLDM): New. - (struct alpha_reloc_tag): Add master, saw_tlsgd, saw_tlsld, - saw_lu_tlsgd, saw_lu_tlsldm. Make multi_section_p a bit field. - (md_apply_fix3): Handle TLS relocations. - (alpha_force_relocation, alpha_fix_adjustable): Likewise. - (alpha_adjust_symtab_relocs): Sort LITERAL relocs after the - associated TLS reloc. Check lituse_tls relocs match up. - (emit_insn): Handle TLS relocations. - (ldX_op): Remove. - - * doc/c-alpha.texi: Add docs for tls relocations. - -2002-05-30 Thiemo Seufer - - * config/tc-mips.c (mips_gprel_offset): New variable. - (s_gpvalue): Use it. - -2002-05-30 Diego Novillo - - * gas/config/tc-d10v.c (check_resource_conflict): Only check - write-write conflicts. - (md_assemble): Reformat introductory comment. - (parallel_ok): Prevent packing only if the first - instruction cannot be packed. - -2002-05-30 Jason Eckhardt - Tom Rix - - * config/tc-d10v.c (build_insn): Check for immediates. - -2002-05-28 Thiemo Seufer - - * config/tc-mips.c: Replace GP in comments by $gp. - (mips_big_got): Initialize. - (mips_trap): Initialize. - (load_address): Use mips_gp_register instead of hardcoded value. - Remove dbl parameter, use HAVE_32BIT_ADDRESSES instead. - (macro): Use mips_gp_register instead of hardcoded value. - (macro2): Change load_address calls. - (md_pcrel_from): Comment formatting. - (s_cpload): Use mips_gp_register instead of hardcoded value. - (s_cprestore): Likewise. Comment formatting. - (s_gpword): Fix data type. - (s_cpadd): Use mips_gp_register instead of hardcoded value. - (nopic_need_relax): Replace GP in comments by $gp. - (mips_elf_final_processing): Better comment. - -2002-05-28 Kuang Hwa Lin - - * configure.in: Add DLX configuraton - * Makefile.am: Add DLX configuraton - * configure: Regenerate. + Merge from mainline: + 2004-05-05 Jakub Jelinek + * tc-s390.h (md_do_align, HANDLE_ALIGN): Remove. + (NOP_OPCODE): Define. + (s390_align_code): Remove prototype. + * tc-s390.c (s390_align_code): Remove. + + 2004-04-22 Bruno De Bus + * config/tc-arm.h (enum mstate): Move here, add MAP_UNDEFINED + state. + (TC_SEGMENT_INFO_TYPE): Define to enum mstate. + * config/tc-arm.c (enum mstate): Delete from here. + (mapping_state): Remove the static mapstate variable and instead + store the state in the segment. This allows a per-section mapping + state. Handle and ignore MAP_UNDEFINED states. + (arm_elf_change_section): Get the current mapping state from the + new section. + (s_ltorg): Set the mapping state to MAP_DATA. + (arm_cleanup): Use arm_elf_change_section to get the mapping state + for each pool as it is emitted. + + 2004-04-22 Nick Clifton + * config/tc-arm.h: Formatting tidy ups. + +2004-05-07 Alexandre Oliva + + * config/tc-frv.h (MAX_MEM_FOR_RS_ALIGN_CODE): New. + (HANDLE_ALIGN): New. + +2004-05-05 Alexandre Oliva + + * configure.in: Set em=linux for frv-*-*linux*. + * configure: Rebuilt. + * config/tc-frv.h (TARGET_FORMAT): Use elf32-frvfdpic if... + (frv_md_fdpic_enabled): New. + * config/tc-frv.c (frv_md_fdpic_enabled): New. + (DEFAULT_FDPIC): New. + (frv_flags): Use DEFAULT_FDPIC. + (frv_pic_flag): Likewise. + (OPTION_NOPIC): New. + (md_longopts): Add -mnopic. + (md_parse_option): Handle it. + (md_show_usage): Add -mfdpic and -mnopic. + +2004-04-20 Chris Demetriou + + * NEWS: Note that MIPS -membedded-pic option is deprecated. + +2004-04-19 Eric Christopher + + * config/tc-mips.c (mips_dwarf2_addr_size): Revert part + of previous patch for fix in gcc. + +2004-04-16 Alan Modra + + * expr.c (operand): Correct checks for ++ and --. + +2004-04-14 Richard Sandiford + + * doc/c-mips.texi (-m{no-,}fix-vr4120): Renamed from + -{no-}mfix-vr4122-bugs. + * config/tc-mips.c (mips_fix_vr4120): Renamed from mips_fix_4122_bugs. + (append_insn, mips_emit_delays): Update accordingly. + (OPTION_FIX_VR4120, OPTION_NO_FIX_VR4120): Renamed from *VR4122. + (md_longopts): Change -{no-,}mfix-vr4122-bugs to -m{no-,}fix-vr4120. + (md_parse_option): Update after above changes. + (md_show_usage): Add -mfix-vr4120. + +2004-04-11 Thiemo Seufer + + * Makefile.am: Remove mips from aout targets. * Makefile.in: Regenerate. - * config/tc-dlx.c: New file. - * config/tc-dlx.h: New files. - * NEWS: Mention new support. - -2002-05-27 Nick Clifton - - * config/obj-coff.c (write_object_file): Add missing semicolon. - -2002-05-26 Thiemo Seufer - - * config/tc-mips.c (mips_emit_delays): Replace magic constant for RA - by the define. Remove superfluous check of mips_opts.mips16. - (append_insn): Likewise. Canonicalize variable increments. - (macro_build): Canonicalize variable increments. - (macro_build_lui): Likewise. - (load_register): Likewise. - (load_address): Move pointer initialization. - (macro): Move pointer to a more local scope. Canonicalize variable - increments. Better comments. Replace magic constant for RA by the - define. - (macro2): Replace magic constant for RA by the define. Canonicalize - variable increments. - (mips_ip): Canonicalize variable increments. - (mips16_ip): Replace magic constant for RA by the define. - (my_getSmallParser): Canonicalize variable increments/decrements. - (my_getPercentOp): Likewise. - (my_getSmallExpression): Likewise. - (s_align): Likewise. - (s_mipsset): Likewise. - (s_cpsetup): Likewise. - (s_insn): Remove superfluous check of mips_opts.mips16. - (s_mips_stab): Likewise. - (mips_handle_align): Canonicalize variable increments. - (s_mips_ent): Likewise. - (s_mips_end): Add comment. - -2002-05-26 Jason Thorpe - - * configure.in: Use ns32k-*-netbsd* instead of ns32k-pc532-netbsd*. + * configure.in: Remove mips-dec-bsd* target. * configure: Regenerate. -2002-05-25 Alan Modra +2004-04-09 Daniel Jacobowitz - * Makefile.am (OBJS): Depend on ansidecl.h and fopen-same.h. + Merge from mainline: + 2004-04-07 Alan Modra + PR 96 + * config/tc-ppc.c (ppc_elf_suffix): Add valid32 and valid64 fields + to struct map_bfd. Adjust MAP macro, and define MAP32, MAP64. + Update "mapping". Restrict some @ modifiers to 32 bit. + + 2004-04-01 Asgari Jinia + Dhananjay Deshpande + + * config/tc-sh.c (dont_adjust_reloc_32): New variable. + (sh_fix_adjustable): Avoid adjusting BFD_RELOC_32 when + dont_adjust_reloc_32 is set. + (md_longopts): Add option -renesas. + (md_parse_option, md_show_usage): Likewise. + * doc/c-sh.texi: Likewise. + + 2004-04-01 Dave Korn + * config/tc-dlx.c (md_assemble): set fx_no_overflow flag for + hi16 and lo16 fixS structs. + (md_assemble): generate bit_fixS for RELOC_DLX_LO16 in + exactly the same way as for RELOC_DLX_REL16. + (machine_ip): properly respect LO flag in the_insn and + output RELOC_DLX_LO16 rather than RELOC_DLX_16. + (md_apply_fix3): apply RELOC_DLX_LO16. + + 2004-03-19 John David Anglin + * tc-hppa.c (cons_fix_new_hppa): Check for PC relative base type. + (pa_comm): Set BSF_OBJECT in symbol flags. + + 2004-03-18 Nathan Sidwell + * read.c (read_a_source_file): Use demand_empty_rest_of_line. + (demand_empty_rest_of_line): Issue an error here. + (ignore_rest_of_line): Silently skip to end. + (demand_copy_string): Issue an error, not warning. + (equals): Likewise. + * config/obj-elf.c (obj_elf_section_name): Likewise. + (obj_elf_section): Likewise. + * config/tc-arc.c (arc_extoper): Remove bogus NULL checks. + (arc_extinst): Likewise. + * config/tc-ia64.c (dot_saveb): Use demand_empty_rest_of_line. + (dot_spill): Likewise. + (dot_unwabi): Likewise. + (dot_prologue): Likewise. + + 2004-03-18 Nathan Sidwell + * expr.c (operand): Reject ++ and --. + (operator): Likewise. + + 2004-03-12 Bob Wilson + * read.c (s_leb128): Call md_flush_pending_output. + + 2004-03-07 Andreas Schwab + * doc/c-hppa.texi (HPPA Directives): Fix typo. + + 2004-03-07 Richard Henderson + * dw2gencfi.c (output_cie): Align length to 4 byte boundary. + (cfi_finish): Likewise for fde. + + 2004-03-05 H.J. Lu + * config/tc-ia64.c (md_assemble): Properly handle NULL + align_frag. + (ia64_handle_align): Don't abort if failed to add a stop bit. + + 2004-03-04 H.J. Lu + * Makefile.in: Regenerated. + * aclocal.m4: Likewise. + * configure: Likewise. + * doc/Makefile.in: Likewise. + + 2004-03-03 H.J. Lu + * config/tc-ia64.c (dot_align): New. + (ia64_do_align): Make it static. + (md_pseudo_table): Use "dot_align" for "align". + (ia64_md_do_align): Don't set align_frag here. + (ia64_handle_align): Add a stop bit to the previous bundle if + needed. + + * config/tc-ia64.h (ia64_do_align): Removed. + + 2004-03-02 H.J. Lu + * config/tc-ia64.c (align_frag): New. + (md_assemble): Set the tc_frag_data field in align_frag for + IA64_OPCODE_FIRST instructions. + (ia64_md_do_align): Set align_frag. + (ia64_handle_align): Add a stop bit if needed. + + * config/tc-ia64.h (TC_FRAG_TYPE): New. + (TC_FRAG_INIT): New. + + 2004-02-27 Nick Clifton + * config/tc-sh.c (get_operand): Revert previous delta. + (tc_gen_reloc): Check for an unknown reloc type before processing + the addend. + + 2004-02-27 Hannes Reinecke + * config/tc-s390.c (s390_insn): Correct range check for opcode in + .insn pseudo operation. + + 2004-02-27 Anil Paranjpe + * config/tc-sh.c (get_operand): In case of #Imm, check has been + added for wrong syntax. + + 2004-02-26 Andrew Stubbs + * config/tc-sh.c (build_Mytes): Add REG_N_D and REG_N_B01 + nibble types to assembler. + + 2004-02-25 Fred Fish + * config/tc-iq2000.c: Add missing \n\ in multiline string literal. + + 2004-02-20 James E Wilson + * config/tc-ia64.c (slot_index): New arg before_relax. Use instead of + finalize_syms. + (fixup_unw_records): New arg before_relax. Pass to slot_index. + (ia64_estimate_size_before_relax): New. + (ia64_convert_frag): Pass 0 to fixup_unw_records. Add comment. + (generate_unwind_image): Pass 1 to fixup_unw_records. + * config/tc-ia64.h (ia64_estimate_size_before_relax): Declare. + (md_estimate_size_before_relax): Call ia64_estimate_size_before_relax. + + 2004-02-19 Jakub Jelinek + * stabs.c (generate_asm_file): Avoid warning about use of + uninitialized variable. + + 2004-02-18 David Mosberger + * config/tc-ia64.c (ia64_flush_insns): In addition to prologue, + body, and endp, allow unwind records which do not have a "t" + (time/instruction) field. + +2004-03-22 Bob Wilson + + * config/tc-xtensa.c (xtensa_post_relax_hook): Create literal + tables even when use_literal_section flag is not set. + +2004-03-22 Hans-Peter Nilsson + + * doc/c-cris.texi (CRIS-Opts): Document --no-mul-bug-abort, + --mul-bug-abort and the default behavior. + * config/tc-cris.c (cris_insn_kind): New member CRIS_INSN_MUL. + (err_for_dangerous_mul_placement): New variable. + (STATE_MUL, OPTION_MULBUG_ABORT_ON, OPTION_MULBUG_ABORT_OFF): New + macros. + (md_cris_relax_table): Have placeholder for STATE_MUL. + (md_longopts): New options --mul-bug-abort and --no-mul-bug-abort. + (cris_relax_frag) : New + case doing nothing. + (md_estimate_size_before_relax) : Ditto. + (md_convert_frag) : Check + alignment and position of this frag, emit error message if + suspicious. + (md_assemble): For a multiply insn and when checking it, + transform the current frag into a special frag for that purpose. + (md_parse_option) : Handle new options. + +2004-03-19 Bob Wilson + + * config/tc-xtensa.c (mark_literal_frags): New function. + (xtensa_move_literals): Call mark_literal_frags for all literal + segments, including init and fini literal segments. + (xtensa_post_relax_hook): Swap use of xt_insn_sec and xt_literal_sec. + +2004-03-17 Kaz Kojima + + * config/tc-sh.c: Include dw2gencfi.h. + (sh_cfi_frame_initial_instructions): New function. + (sh_regname_to_dw2regnum): Likewise. + * config/tc-sh.h (DWARF2_LINE_MIN_INSN_LENGTH): Move to the end of + file. + (TARGET_USE_CFIPOP): Define. + (tc_cfi_frame_initial_instructions): Likewise. + (tc_regname_to_dw2regnum): Likewise. + (DWARF2_DEFAULT_RETURN_COLUMN, DWARF2_CIE_DATA_ALIGNMENT): Likewise. + * Makefile.am: Update dependencies. * Makefile.in: Regenerate. - * dep-in.sed: Reorder to match OBJS in Makefile.am. - * configure.in (ALL_OBJ_DEPS): Add symcat.h when need_bfd. - * configure: Regenerate. - * as.h: Use #include "" instead of <> for local header files. - * flonum-konst.c: Likewise. - * flonum-mult.c: Likewise. - * gasp.c: Likewise. - * listing.c: Likewise. - * config/tc-ia64.h: Likewise. - * config/tc-v850.h: Likewise. - -2002-05-24 TAMURA Kent - - * configure.in: Add a target for i386-netbsdpe. - * configure: Regenerate. - -2002-05-23 Jakub Jelinek - - * config/obj-elf.c (elf_common): Renamed from obj_elf_common. - (obj_elf_common): Call elf_common. - (obj_elf_tls_common): New function. - (elf_pseudo_tab): Support .tls_common. - (special_sections): Add .tdata and .tbss. - (obj_elf_change_section): Set SEC_THREAD_LOCAL for SHF_TLS - sections. - (obj_elf_parse_section_letters): Support T in section flags (SHF_TLS). - (obj_elf_parse_section_letters): Include T in error message. - * config/tc-ppc.c (ppc_section_letter): Likewise. - * config/tc-alpha.c (alpha_elf_section_letter): Likewise. - (tc_gen_reloc): Handle SEC_THREAD_LOCAL the same way as - SEC_MERGE. - * config/tc-sparc.c (md_apply_fix3): Likewise. - * config/tc-i386.c (tc_i386_fix_adjustable): Add TLS relocs. - Define them if not BFD_ASSEMBLER. - (lex_got): Support @TLSGD, @TLSLDM, @GOTTPOFF, @TPOFF, @DTPOFF - and @NTPOFF. - (md_apply_fix3): Add TLS relocs. - * config/tc-ia64.c (enum reloc_func): Add FUNC_DTP_MODULE, - FUNC_DTP_RELATIVE, FUNC_TP_RELATIVE, FUNC_LT_DTP_MODULE, - FUNC_LT_DTP_RELATIVE, FUNC_LT_TP_RELATIVE. - (pseudo_func): Support @dtpmod(), @dtprel() and @tprel(). - (ia64_elf_section_letter): Include T in error message. - (md_begin): Support TLS operators. - (md_operand): Likewise. - (ia64_gen_real_reloc_type): Support TLS relocs. - * testsuite/gas/i386/tlspic.s: New file. - * testsuite/gas/i386/tlsd.s: New file. - * testsuite/gas/i386/tlsnopic.s: New file. - * testsuite/gas/i386/tlsd.d: New file. - * testsuite/gas/i386/tlsnopic.d: New file. - * testsuite/gas/i386/tlspic.d: New file. - * testsuite/gas/i386/i386.exp: Add tlsd, tlsnopic and tlspic tests. - * testsuite/gas/ia64/tls.s: New file. - * testsuite/gas/ia64/tls.d: New file. - * testsuite/gas/ia64/ia64.exp: Add tls test. - * write.c (adjust_reloc_syms): Don't change symbols in - SEC_THREAD_LOCAL sections to STT_SECTION + addend. - -2002-05-23 Nick Clifton - - * config/tc-arm.c (md_apply_fix3): For the Thumb BLX reloc - round the relocation up rather than down. - -2002-05-23 Nick Clifton - - * config/obj-coff.c (obj_coff_section): Silently ignore an 'a' - flag. - * doc/as.texinfo: Document that the COFF version of .section - ignores the 'a' flag. - -2002-05-23 Alan Modra - - * config/tc-alpha.c (assemble_tokens): Protect use of - ALPHA_RELOC_TABLE with #ifdef RELOC_OP_P. - - * write.c (size_seg): Check adjustment to last frag. - (SUB_SEGMENT_ALIGN): If HANDLE_ALIGN defined, pad out last frag to - section alignment. - * config/obj-coff.c (SUB_SEGMENT_ALIGN): Likewise. - * config/obj-ieee.c (SUB_SEGMENT_ALIGN): Likewise. - (write_object_file): Invoke md_do_align if available, and use - frag_align_code on text sections. - * config/obj-vms.h (SUB_SEGMENT_ALIGN): Now two args. - * config/tc-m88k.h (SUB_SEGMENT_ALIGN): Likewise. - * config/tc-ppc.h (SUB_SEGMENT_ALIGN): Likewise. - * config/tc-sh.h (SUB_SEGMENT_ALIGN): Likewise. - * config/tc-i386.h (SUB_SEGMENT_ALIGN): Likewise. Define for - BFD_ASSEMBLER too. - -2002-05-22 H.J. Lu - - * dwarf2dbg.c (dwarf2_directive_loc): Call listing_source_file - for source file. - -2002-05-22 Nick Clifton - - * config/tc-arm.c (arm_s_section): Enable for COFF builds as well - as ELF builds. - -2002-05-22 H.J. Lu - - * dwarf2dbg.c (dwarf2_emit_insn): Emit only one line symbol - for one .loc for compiler. - -2002-05-22 Thiemo Seufer - - * config/tc-mips.c (macro): Relax warning, it's toot strict for - embedded-PIC. - -2002-05-22 Thiemo Seufer - - * config/tc-mips.c (macro2): Add 64 bit drol, dror macros. - Optimize the rotate by zero case. - -2002-05-21 Nick Clifton - - * configure.in: Remove accidental enabling of bfd_gas=yes for - sh-coff targets. - * configure: Regenerate. - -2002-05-18 Kazu Hirata - - * app.c: Fix formatting. - * as.c: Likewise. - * ehopt.c: Likewise. - * expr.c: Likewise. - * input-file.c: Likewise. - * listing.c: Likewise. - * macro.h: Likewise. - * stabs.c: Likewise. - * symbols.c: Likewise. - -2002-05-17 Alan Modra - - * config/obj-generic.c: Delete file. - * config/obj-generic.h: Likewise. - -2002-05-16 Marek Michalkiewicz - - * config/tc-avr.c (mcu_types): Update for new devices. - -2002-05-15 Thiemo Seufer - - * config/tc-mips.c (macro): Warn about wrong la/dla use. - -2002-05-15 Thiemo Seufer - - * config/tc_mips.c (s_cpsetup): Fix completely bogus code which had - worked sometimes by accident. Fix copy&paste comment. - -2002-05-15 Thiemo Seufer - - * config/tc-mips.c (md_begin): Fix .reginfo and .MIPS.option section - alignment for NewABI. Let n32 use .reginfo. Remove useless casts. - (mips_elf_final_processing): Let n32 use .reginfo. - -2002-05-15 Thiemo Seufer - - * config/tc-mips.c (append_insn): Fix too small range of variable. - -2002-05-14 Nick Clifton - - * config/tc-arm.c (arm_cleanup): Remove redundant call to - listing_prev_line(). - -2002-05-13 Nick Clifton - - * config/tc-arm.c (md_assemble): Remove redundant call to - listing_prev(). - - * dwarf2dbg.c (dwarf2_emit_insn): Do not reset - loc_directive_seen. - - * stabs.c (s_stab_generic): Fix grammatical error in warning - message. - -2002-05-13 Alan Modra - - * write.c (subsegs_finish): Don't specially align last subseg. - -2002-05-11 Nick Clifton - * stabs.c (s_stab_generic): Warn about a description field that is - too big. - - * config/obj-coff.c: Fix compile time warnings when compiling - without BFD_ASSEMBLER defined. - Fix formatting. - - * config/tc-sh.c (md_pcrel_from): Define for use with sh-hms - target. - (md_pcrel_from_section): Use md_pcrel_from(). - -2002-05-11 Bruno Haible - - * dwarf2dbg.c (dwarf2_emit_insn): Use the 'current' struct filled - by dwarf2_directive_loc, instead of calling dwarf2_where. - -2002-05-11 Kazu Hirata - - * config/obj-coff.h: Fix formatting. - * config/tc-mcore.c: Likewise. - * config/tc-mn10300.c: Likewise. - * config/tc-openrisc.c: Likewise. - * config/tc-or32.c: Likewise. - * config/tc-pdp11.c: Likewise. - * config/tc-ppc.c: Likewise. - * config/tc-ppc.h: Likewise. - * config/tc-sh64.c: Likewise. - * config/tc-sh.c: Likewise. - * config/tc-tic54x.c: Likewise. - * config/tc-xstormy16.c: Likewise. - * config/tc-xstormy16.h: Likewise. - -2002-05-09 Kazu Hirata - - * config/obj-coff.c: Fix formatting. - * config/obj-elf.c: Likewise. - * config/tc-alpha.c: Likewise. - * config/tc-arm.c: Likewise. - * config/tc-d10v.c: Likewise. - * config/tc-d30v.c: Likewise. - * config/tc-h8300.c: Likewise. - * config/tc-hppa.c: Likewise. - -2002-05-09 Alan Modra - - * config/tc-i386.c (md_estimate_size_before_relax) Don't lose - reloc when no_cond_jump_promotion. - -2002-05-08 Jim Wilson - - * config/tc-i960.c (md_estimate_size_before_relax): Return size of - current variable part of frag. - -2002-05-08 Kazu Hirata - - * config/tc-mmix.c: Fix formatting. - * config/tc-mmix.h: Likewise. - -2002-05-08 Alan Modra +2004-03-17 Ralf Corsepius + * configure.in: Switch sh-*-rtems* to ELF. Add sh-*-rtemscoff*. * configure: Regenerate. -2002-05-07 Kazu Hirata - - * config/tc-m68k.c: Fix formatting. - -2002-05-07 Federico G. Schwindt - - * Makefile.am: Honour DESTDIR. - * Makefile.in: Regenerate. - -2002-05-06 Kazu Hirata - - * config/tc-ia64.c: Fix formatting. - * config/tc-ia64.h: Likewise. - -2002-05-04 Kazu Hirata - - * config/tc-mips.c: Fix formatting. - * config/tc-s390.c: Likewise. - * config/tc-s390.h: Likewise. - -2002-05-03 Alexandre Oliva - - * config/tc-s390.c (md_gather_operands): Emit dwarf2 line-number - information for instructions. - -2002-05-02 Kazu Hirata - - * as.h: Fix formatting. - * cgen.c: Likewise. - * cgen.h: Likewise. - * dwarf2dbg.c: Likewise. - * frags.h: Likewise. - * gasp.c: Likewise. - * macro.c: Likewise. - * read.c: Likewise. - * stabs.c: Likewise. - * symbols.c: Likewise. - -2002-05-02 Alan Modra - - * app.c (mri_pseudo): Only declare for TC_M68K. - - * config/tc-ppc.c (mapping): Map sectoff to BFD_RELOC_16_BASEREL. - (ppc_elf_validate_fix): Replace BFD_RELOC_32_BASEREL with - BFD_RELOC_16_BASEREL. - (md_assemble): Likewise. - (md_apply_fix3): Likewise. - -2002-05-02 Nick Clifton - - * config/tc-arm.c (thumb_add_sub): Do not convert a subtract of - zero into an add of zero - it is not the same. - -2002-05-01 Arati Dikey - - * tc-sh.c (get_specific): Generate warning if the same - destination register is used in parallel instructions. - -2002-05-01 Andrew Macleod - - * config/tc-i386.c (extra_symbol_chars): Add '[' to the list. - -2002-05-01 Alan Modra - - * write.c (cvt_frag_to_fill): Set fr_offset to zero on .org - backwards to prevent cascading errors. - -2002-04-30 Mark Mitchell - - * configure.in: Add support for powerpc-*-windiss. - * configure: Regenerated. - -2002-04-28 Alan Modra - - * config/tc-s390.c (md_parse_option): Formatting. - - * config/tc-i386.c: Formatting fixes, add missing space in error - message. - -2002-04-24 Christian Groessler +2004-03-12 Bob Wilson - * config/tc-z8k.c (build_bytes): Add support for new cases: - CLASS_IGNORE and ARG_NIM4. - (md_assemble): Prevent destruction of input_line_pointer if - get_operands returns failure. + * read.c (s_leb128): Call md_flush_pending_output. -2002-04-24 Chris G. Demetriou +2004-03-12 Michal Ludvig - * config/tc-mips.c (macro_build): Do _not_ allow MIPS-3D - instructions to be generated by macros. + * config/tc-i386.c (output_insn): Handle PadLock instructions. + * config/tc-i386.h (CpuPadLock): New define. + (CpuUnknownFlags): Added CpuPadLock. -2002-04-24 Andreas Schwab +2004-02-26 Eric Christopher - * config/tc-i386.c (output_jump, output_disp) - (md_estimate_size_before_relax): Don't set fx_pcrel_adjust any - more. - (md_apply_fix3): Remember addend value for rela relocations. - (tc_gen_reloc): Correctly compute pc-relative relocation addend. + * config/tc-mips.c (mips_dwarf2_addr_size): New. + * config/tc-mips.h (DWARF2_ADDR_SIZE): Use. -2002-04-22 Chris Demetriou +2004-02-17 Petko Manolov - * config/tc-mips.c (macro_build): Add close-parenthesis missing - from previous change. + * config/tc-arm.c (do_mav_dspsc_1): Correct offset of CRn. + (do_mav_dspsc_2): Likewise. + Fix accumulator registers move opcodes. -2002-04-22 Eric Christopher +2004-02-13 Hannes Reinecke + Jakub Jelinek - * config/tc-mips.c (macro_build): Add warning if macro instructions - are expanded into a branch delay slot. + * dwarf2dbg.c (get_filenum): Do not read beyond allocated memory. -2002-04-17 Geoffrey Keating +2004-02-10 Steve Ellcey - * dwarf2dbg.c (dwarf2_gen_line_info): Do emit duplicate line - numbers, gdb relies on them to detect the start of the prologue. + * config/tc-ia64.h (ia64_frob_symbol): New declaration. + (tc_frob_symbol): New macro definition. + * config/tc-ia64.c (ia64_frob_symbol): New routine. -2002-04-17 Martin Schwidefsky +2004-02-09 Daniel Jacobowitz - * config/tc-s390.c (tc_s390_fix_adjustable): Prevent adjustments to - symbols in merge sections. + * config/tc-arm.c (md_begin): Mark .note.gnu.arm.ident as + read-only. -2002-04-16 Alan Modra +2004-02-09 Nathan Sidwell - * as.c (main): Don't reference _bfd_chunksize. + * read.h (IGNORE_OPCODE_CASE): Do not define. Replace with ... + (TC_CASE_SENSITIVE): ... this. + * read.c: Replace IGNORE_OPCODE_CASE with TC_CASE_SENSITIVE. + * doc/internals.texi (TC_CASE_SENSITIVE): Document. -2002-04-15 Tom Rix +2004-02-06 James E Wilson - * config/tc-d10v.c (d10v_fix_adjustable): Prevent adjustments to - symbols in merge sections. + * config/tc-ia64.c (dot_endp): Delete call to output_endp. + (generate_unwind_image): Re-add it here. -2002-04-11 Richard Sandiford +2004-02-06 Nathan Sidwell - * doc/invoke.texi (TC_LARGEST_EXPONENT_IS_NORMAL): Document. - * config/atof-ieee.c (TC_LARGEST_EXPONENT_IS_NORMAL): Add an - argument for the precision. - (gen_to_words): Update accordingly. + * dwarf2dbg.c (DWARF2_ADDR_SIZE): Remove trailing ';' + * read.h (SKIP_WHITESPACE): Turn into an expression. + * read.c (read_a_source_file): A pseudo is removed by having a + NULL handler. -2002-04-10 Alan Modra +2004-02-05 James E Wilson - * as.c (parse_args ): Use VERSION is - BFD_VERSION_STRING unavailable. - * config/tc-i386.c (INLINE): Define (for non-BFD assembler). + * config/tc-ia64.c (output_endp): New. + (count_bits): Delete. + (ia64_flush_insns, process_one_record, optimize_unw_records): Handle + endp unwind records. + (fixup_unw_records): Handle endp unwind records. Delete code for + shortening prologue regions not followed by a body record. + (dot_endp): Call add_unwind_entry to emit endp unwind record. + * config/tc-ia64.h (unw_record_type): Add endp. -2002-04-09 J"orn Rennecke +2004-02-03 James E Wilson - * config/tc-sh.h (TC_FIX_ADJUSTABLE): Disable adjusting if - symbol_used_in_reloc_p is true. + * config/tc-ia64.c (ia64_convert_frag): Call md_number_to_chars to + fill padding bytes with zeroes. + (emit_one_bundle): New locals last_ptr, end_ptr. Rewrite code that + sets unwind_record slot_number and slot_frag fields. - * config/tc-sh.c (md_apply_fix3): Don't zero relocations on big - endian hosts. +2004-02-02 Maciej W. Rozycki -2002-04-04 Alan Modra + * config/tc-mips.c (add_got_offset_hilo): New function. + (macro): Use load_register() and add_got_offset_hilo() to load + constants instead of hardcoding code sequences throughout. - * dep-in.sed: Cope with absolute paths. - * Makefile.am (dep.sed): Subst TOPDIR. - Run "make dep-am". - * Makefile.in: Regenerate. - -2002-04-04 Thiemo Seufer - - * config/tc-mips.c (mips16_macro_build): Cast type mismatch. - (mips_ip): Remove unused variable. - (md_apply_fix3): Cast signed/unsignes mismatches. Replace - unsigned char with bfd_byte. - (s_file): Remove unused variable. - (s_mips_ent): Likewise. - -2002-04-03 Tom Rix - - * config/tc-d10v.c (d10v_insert_operand): Fix warning in as_bad_where. - (build_insn): Same. - (find_opcode): Fix warning in as_warn. - * config/tc-d10v.h: Update Copyright. - -2002-04-03 Alan Matsuoka - Tom Rix - - From Jeff Knaggs - * config/tc-d10v.c (check_resource_conflict): New function to - check for resource conflicts. - - From Jason Eckhardt - * config/tc-d10v.c (build_insn): Check for unresolved imm4 or - imm3 fields. - * config/tc-d10v.c (find_opcode): Emit a warning if one of the - reserved control registers is used. - * config/tc-d10v.c (build_insn): Check for unresolved imm4 or - imm3 fields. - - From 2001-03-28 Diego Novillo - * tc-d10v.c (parallel_ok): Prevent packing only if the first - instruction cannot be packed. - - From 2001-03-30 Diego Novillo - * gas/config/tc-d10v.c (check_resource_conflict): Only check - write-write conflicts. - (md_assemble): Reformat introductory comment. - * opcodes/d10v-opc.c (d10v_opcodes): `btsti' does not modify its - arguments. - -2002-04-03 Alan Modra +2004-01-28 H.J. Lu - * symbols.c (resolve_symbol_value ): Derive final_seg from add_symbol. - : More final_seg twiddles. + * config/tc-ia64.c (emit_one_bundle): Add proper indentation. -2002-04-01 Jessica Han +2004-01-26 Bernardo Innocenti - * config/tc-ia64.c (ia64_cons_fix_new): Handle 8 byte iplt reloc - in 32-bit mode. + * config/tc-m68k.h (EXTERN_FORCE_RELOC): Handle m68k-uclinux specially, + like m68k-elf. + * config/tc-m68k.c (RELAXABLE_SYMBOL): Use EXTERN_FORCE_RELOC instead + of hard-coded test for TARGET_OS=elf. -2002-03-27 Andreas Schwab +2004-01-24 Chris Demetriou - * config/tc-i386.c (output_jump): Set fx_pcrel_adjust to size of - field for pc-relative fixups. - (output_disp): Likewise. - (md_estimate_size_before_relax): Likewise. - (tc_gen_reloc): Subtract fx_pcrel_adjust instead of fx_size for - pc-relative fixups in 64bit mode. + * config/tc-mips.c (hilo_interlocks): Change definition + so that MIPS32, MIPS64 and later ISAs are included, along with + the already-included machines. Update comments. -2002-03-22 Alan Modra +2004-01-23 Daniel Jacobowitz - * config/te-aix5.h: Typo fix. + * config/tc-arm.c (tc_gen_reloc): Improve error message for + undefined local labels. -2002-03-21 Alan Modra +2004-01-23 Richard Sandiford - * Makefile.am: Run "make dep-am". - * Makefile.in: Regenerate. - * doc/Makefile.in: Regenerate. - -2002-03-20 Albert Chin-A-Young + * config/tc-mips.c (load_address, macro): Update comments about + NewABI GP relaxation. - * config/tc-arm.c (vfp_dp_reg_required_here): Fix typo - (vfp_sp_reg_pos -> vfp_dp_reg_pos). +2004-01-23 Richard Sandiford -2002-03-18 Alexandre Oliva + * config/tc-mips.c (macro_build): Remove place and counter arguments. + (mips_build_lui, macro_build_ldst_constoffset): Likewise. + (mips16_macro_build, macro_build_jalr): Remove counter argument. + (set_at, load_register, load_address, move_register): Likewise. + (load_got_offset, add_got_offset): Likewise. + Update all calls and tidy accordingly. - * config/tc-mips.c (md_estimate_size_before_relax): Do not modify - the EXTENDED bit here; report the estimate according to the - current size. - -2002-03-18 Tom Rix - - * configure.in: Add AIX 5 support. - * config/tc-ppc.c (ppc_target_format): Add AIX 5 64 bit target. - * config/te-aix5.h: New file. AIX 5 support. - * configure: Regenerate. +2004-01-23 Richard Sandiford -2002-03-18 Nick Clifton - - * po/fr.po: Updated version. - -2002-03-16 Andreas Jaeger - - * doc/c-mips.texi (Machine Dependencies): Add new node. - -2002-03-15 Chris G. Demetriou - - * config/tc-mips.c (mips_set_options): New "ase_mips3d" member. - (mips_opts): Initialize "ase_mips3d" member. - (file_ase_mips3d): New variable. - (CPU_HAS_MIPS3D): New macro. - (md_begin): Initialize mips_opts.ase_mips3d and file_ase_mips3d - based on command line options and configuration defaults. - (macro_build, mips_ip): Accept MIPS-3D instructions if - mips_opts.ase_mips3d is set. - (OPTION_MIPS3D, OPTION_NO_MIPS3D, md_longopts, md_parse_option): - Add support for "-mips3d" and "-no-mips3d" options. - (OPTION_ELF_BASE): Move to accomodate new options. - (s_mipsset): Support ".set mips3d" and ".set nomips3d". - (mips_elf_final_processing): Add a comment indicating that a - MIPS-3D ASE ELF header flag should be set, when one exists. - * doc/as.texinfo: Document -mips3d and -no-mips3d options. - * doc/c-mips.texi: Likewise, and document ".set mips3d" and ".set - nomips3d" directives. - -2002-03-14 Hans-Peter Nilsson - - * config/tc-mmix.c (md_estimate_size_before_relax): Don't consider - a weak symbol in same section to be within reach. - -2002-03-13 Nick Clifton - - * po/fr.po: Updated version. - -2002-03-12 Andreas Schwab - - * config/tc-ia64.c (fixup_unw_records): Clear region when seeing a - body record so that an error is given for misplaced .save - pseudo-ops. - -2002-03-09 Alan Modra - - * config/tc-i386.h (REX_OPCODE): Define. - (REX_MODE64, REX_EXTX, REX_EXTY, REX_EXTZ): Define. - (rex_byte): typedef to int. - * config/tc-i386.c: Group prototypes and vars together. - Formatting fixes. Remove occurrences of "register" keyword. - (true): Delete. - (false): Delete. - (mode_from_disp_size): Add INLINE keyword to prototype. - (fits_in_signed_byte): Likewise. - (fits_in_unsigned_byte): Likewise. - (fits_in_unsigned_word): Likewise. - (fits_in_signed_word): Likewise. - (fits_in_unsigned_long): Likewise. - (fits_in_signed_long): Likewise. - (type_names): Constify. - (intel_float_operand): Constify param. - (add_prefix): Use REX_OPCODE. - (md_assemble): Likewise. Modify for changed rex_byte. - (parse_insn): Split out of md_assemble. - (parse_operands): Likewise. - (swap_operands): Likewise. - (optimize_imm): Likewise. - (optimize_disp): Likewise. - (match_template): Likewise. - (check_string): Likewise. - (process_suffix): Likewise. - (check_byte_reg): Likewise. - (check_long_reg): Likewise. - (check_qword_reg): Likewise. - (check_word_reg): Likewise. - (finalize_imm): Likewise. - (process_operands): Likewise. - (build_modrm_byte): Likewise. - (output_insn): Likewise. - (output_branch): Likewise. - (output_jump): Likewise. - (output_interseg_jump): Likewise. - (output_disp): Likewise. - (output_imm): Likewise. - -2002-03-07 Daniel Jacobowitz - - * doc/as.texinfo: Wrap @menu in @ifnottex, not @ifinfo. - -2002-03-06 Alan Modra - - * config/tc-i386.c (tc_gen_reloc): Don't attempt to handle 8 byte - relocs except when BFD64. - - * write.c (number_to_chars_bigendian): Don't abort when N is - larger than sizeof (VAL). - (number_to_chars_littleendian): Likewise. - -2002-03-05 John David Anglin - - * config/tc-hppa.c (md_apply_fix3): Add cast. - (hppa_fix_adjustable): Adjust list of selectors using e_lrsel and - e_rrsel. - -2002-03-05 Paul Koning - - * tc-pdp11.c: Use VAX float format support for PDP-11 target. - (parse_ac5): New function for parsing float regs in float operand. - (parse_expression): Remove attempt to make literals be octal. - (parse_op_no_deferred): Support float literals. - (parse_op): Reject attempts to refer to float regs. - (parse_fop): New function, like parse_op but for float operand. - (md_assemble): Add cases to parse float operands. Also fix - IMM3, IMM6, IMM8 cases to pick up the operand from the right spot. - -2002-03-04 H.J. Lu - - * config/obj-elf.c (special_section): Add .init_array, - .fini_array and .preinit_array. - - * config/tc-ia64.h (ELF_TC_SPECIAL_SECTIONS): Remove - .init_array and .fini_array. - -2002-03-01 Jakub Jelinek - - * config/obj-elf.c (elf_copy_symbol_attributes): Don't copy - visibility. - (obj_frob_symbol): Copy visibility. - -2002-02-28 Jakub Jelinek - - * config/tc-alpha.c (s_alpha_text): Use obj_elf_text for OBJ_ELF, not - s_text. - (s_alpha_data): Use obj_elf_data for OBJ_ELF, not s_data. - -2002-02-27 Nick Clifton - - * po/es.po: Updated. - -2002-02-26 Chris Demetriou - - * config/tc-mips.c (mips_need_elf_addend_fixup): For embedded-PIC - only, undo the changes made on 2001-06-08, with the - effect being that common or extern symbols are - adjusted for embedded-PIC, but weak symbols are not. - (md_estimate_size_before_relax: Likewise, with the effect - that extern symbols are treated the same as weak symbols - only if not embedded-PIC. - (mips_fix_adjustable) Likewise, with the effect that - weak or extern symbols are not adjusted for embedded-PIC. - (md_apply_fix3): Tweak so that the case where value is zero - is handled more correctly for embedded-PIC code. - -2002-02-26 Nick Clifton - - * doc/as.texinfo (Overview): Add missing @ifset IA64 - - * configure.in (LINGUAS): Add es.po. + * config/tc-mips.c (RELAX_ENCODE): Remove WARN argument. + (RELAX_FIRST, RELAX_SECOND): Turn into 8-bit quantities. + (RELAX_USE_SECOND): Bump to 0x10000. + (RELAX_SECOND_LONGER, RELAX_NOMACRO, RELAX_DELAY_SLOT): New flags. + (mips_macro_warning): New variable. + (md_assemble): Wrap macro expansion in macro_start() and macro_end(). + (s_cpload, s_cpsetup, s_cprestore, s_cpreturn): Likewise. + (relax_close_frag): Set mips_macro_warning.first_frag. Adjust use + of RELAX_ENCODE. + (append_insn): Update mips_macro_warning.sizes. + (macro_start, macro_warning, macro_end): New functions. + (macro_build): Don't emit warnings here. + (macro_build_lui, md_estimate_size_before_relax): ...or here. + (md_convert_frag): Check for cases where one macro alternative + needs a warning and the other doesn't. Emit a warning if the + longer sequence was chosen. + +2004-01-23 Richard Sandiford + + * config/tc-mips.h (tc_frag_data_type, TC_FRAG_TYPE): Remove. + * config/tc-mips.c (RELAX_ENCODE): Take three arguments: the size of + the first sequence, the size of the second sequence, and a flag + that says whether we should warn. + (RELAX_OLD, RELAX_NEW, RELAX_RELOC[123]): Delete. + (RELAX_FIRST, RELAX_SECOND): New. + (mips_relax): New variable. + (relax_close_frag, relax_start, relax_switch, relax_end): New fns. + (append_insn): Remove "place" argument. Use mips_relax.sequence + rather than "place" to check whether we're expanding the second + alternative of a relaxable macro. Remove redundant check for + branch relaxation. If generating a normal insn, and there + is not enough room in the current frag, call relax_close_frag() + to close it. Update mips_relax.sizes[]. Emit fixups for the + second version of a relaxable macro. Record the first relaxable + fixup in mips_relax. Remove tc_gen_reloc workaround. + (macro_build): Remove all uses of "place". Use mips_relax.sequence + in the same way as in append_insn. + (mips16_macro_build): Remove "place" argument. + (macro_build_lui): As for macro_build. Don't drop the add_symbol + when generating the second version of a relaxable macro. + (load_got_offset, add_got_offset): New functions. + (load_address, macro): Use new relaxation machinery. Remove + tc_gen_reloc workarounds. + (md_estimate_size_before_relax): Set RELAX_USE_SECOND if the second + version of a relaxable macro is needed. Return -RELAX_SECOND if the + first version is needed. + (tc_gen_reloc): Remove relaxation handling. + (md_convert_frag): Go through the fixups for a relaxable macro and + mark those that belong to the unneeded alternative as done. If the + second alternative is needed, adjust the fixup addresses to account + for the deleted first alternative. + +2004-01-23 Richard Sandiford + + * frags.h (frag_room): Declare. + * frags.c (frag_room): New function. + * doc/internals.texi: Document it. + +2004-01-22 Thiemo Seufer + + * config/tc-mips.c (append_insn): Don't do r3900 interlock + optimization for -mtune=r3900, as this will break on other CPUs. + +2004-01-11 Tom Rix + + * config/tc-m68hc11.c (build_indexed_byte): movb and movw cannot + be relaxed, use fixup. + (md_apply_fix3): Use 5 bit reloc from movb and movw fixup. + +2004-01-19 Jakub Jelinek + + * config/tc-sparc.c (sparc_ip): Disallow %f32-%f63 for single + precision operands. + +2004-01-14 Maciej W. Rozycki + + * config/tc-mips.c (append_insn): Properly detect variant frags + that preclude swapping of relaxed branches. Correctly swap + instructions between frags when dealing with relaxed branches. + +2004-01-14 Maciej W. Rozycki + + * acinclude.m4: Quote names of macros to be defined by AC_DEFUN + throughout. + * aclocal.m4: Regenerate. * configure: Regenerate. - * po/es.po: New file. - -2002-02-25 Thiemo Seufer - - * config/tc-mips.c (set_at): Fix handling of 64bit register loads. - (macro): Likewise. Fix la/dla address expansions for EMBEDDED_PIC - and NO_PIC cases. Code cleanup. - (macro2): Fix handling of 64bit register loads. - -2002-02-25 David Mosberger - - * doc/as.texinfo: Add entry for IA64. - * doc/c-ia64.texi: New file. -2002-02-25 Alan Modra - - * config/tc-hppa.c: Update copyright date. - - * doc/c-ppc.texi (PowerPC-Opts): Add -mpower4, -maltivec and -m7400 - Remove references to chip manufacturers. - * config/tc-ppc.c (md_parse_option): Handle -mpower4 option. - Correct comments. - (md_show_usage): Remove references to chip manufacturers. Mention - -mpower4. - (md_begin): Test power4 opcode flag bits. - -2002-02-22 David Mosberger - - * config/tc-ia64.c (dot_restore): Issue error message of epilogue - count exceeds prologue count. - (md_show_usage): Describe -mconstant-gp and -mauto-pic. - (unwind.label_prologue_count): New member. - - Based on a patch by Hans Boehm : - - (get_saved_prologue_count): New function. - (save_prologue_count): New function. - (free_saved_prologue_count): New function. - (dot_label_state): Record state label by calling save_prologue_count(). - (dot_copy_state): Restore prologue count by calling - get_saved_prologue_count(). - (generate_unwind_image): Free up list of saved prologue - counts by calling free_saved_prologue_counts(). - -2002-02-22 Nick Clifton - - * config/tc-tic54x.c: Add missing prototypes and remove ANSI style - function declarations. - -2002-02-21 Nick Clifton - - * NEWS: Note that GASP is now deprecated. - * Makefile.am: Do not build gasp-new by default. +2004-01-12 Anil Paranjpe + + * config/tc-h8300.c (build_bytes): Apply relaxation to bit + manipulation insns. + +2004-01-12 Richard Sandiford + + * config/tc-mips.c (macro_build_jalr): When adding an R_MIPS_JALR + reloc, reserve space for the delay slot as well as the jalr itself. + +2004-01-09 Paul Brook + + * config/tc-arm.c (do_vfp_reg2_from_sp2): Rename from do_vfp_sp_reg2. + (do_vfp_sp2_from_reg2): New function. + (insns): Use them. + (do_vfp_dp_from_reg2): Check return values properly. + +2004-01-08 Ian Lance Taylor + + * config/tc-mips.c (warn_nops): Remove static variable. + (macro): Remove test of warn_nops. + (md_shortops): Remove 'n'. + (md_parse_option): Remove 'n' case. + (md_show_usage): Remove -n. + * doc/as.texinfo (Overview): Remove MIPS -n option. + * doc/c-mips.texi (MIPS Opts): Remove mention -n. + * NEWS: Mention removal of MIPS -n option. + + * config/tc-mips.c (ISA_HAS_COPROC_DELAYS): Remove. + (cop_interlocks): Check ISA level. + (cop_mem_interlocks): Define. + (reg_needs_delay): Check cop_interlocks rather than + ISA_HAS_COPROC_DELAYS. + (append_insn): Likewise. Use cop_mem_interlocks rather than + directly checking mips_opts.isa. + (mips_emit_delays): Likewise. + +2004-01-07 H.J. Lu + + * config/tc-ia64.c (unwind): Move next_slot_number and + next_slot_frag to ... + (unw_rec_list): Here. + (free_list_records): Removed. + (output_unw_records): Likewise. + (generate_unwind_image): Make it void. + (alloc_record): Initialize next_slot_number and next_slot_frag. + (slot_index): Take .org, .space and .align into account. + (fixup_unw_records): Don't set slot_number to 0. Use + list->next_slot_number and list->next_slot_frag instead of + unwind.next_slot_number and unwind.next_slot_frag. + (ia64_convert_frag): New. + (generate_unwind_image): Generate a rs_machine_dependent frag + for unwind record. + (emit_one_bundle): Use list->next_slot_number and + list->next_slot_frag instead of unwind.next_slot_number and + unwind.next_slot_frag. + + * config/tc-ia64.h (md_convert_frag): Defined as + ia64_convert_frag. + (md_estimate_size_before_relax): Defined as (f)->fr_var. + +2004-01-06 Alexandre Oliva + + 2003-12-19 Alexandre Oliva + * config/tc-frv.h (md_apply_fix3): Don't define. + * config/tc-frv.c (md_apply_fix3): New. Shift/truncate %hi/%lo + operands. + * config/tc-frv.h (TC_FORCE_RELOCATION_SUB_LOCAL): Define. + 2003-10-07 Alexandre Oliva + * config/tc-frv.c (line_separator_chars): Add `!'. + 2003-09-19 Alexandre Oliva + * config/tc-frv.c (md_assemble): Clear insn upfront. + 2003-09-18 Alexandre Oliva + * config/tc-frv.c (OPTION_FDPIC): New macro. + (md_longopts): Add mfdpic. + (md_parse_option): Handle it. + 2003-08-04 Alexandre Oliva + * config/tc-frv.c (md_cgen_lookup_reloc) : Use reloc type encoded in fix-up. + (frv_pic_ptr): Parse funcdesc. + +2004-01-05 Maciej W. Rozycki + + * doc/as.texinfo: Let texi2pod parse asconfig.texi and + gasver.texi. Remove duplicate symbol definitions for texi2pod. + +2004-01-05 Maciej W. Rozycki + + * Makefile.am (Makefile): Move the dependency on + $(BFDDIR)/configure.in to... + (CONFIG_STATUS_DEPENDENCIES): ... here. + (AUTOMAKE_OPTIONS): Require automake 1.8. * Makefile.in: Regenerate. - * doc/Makefile.am: Do not install gasp.info. + * doc/Makefile.am (BASEDIR, BFDDIR): Define. + (CONFIG_STATUS_DEPENDENCIES): Add a dependency on + $(BFDDIR)/configure.in here as well. * doc/Makefile.in: Regenerate. - * gas/gasp.texi: Note that gasp is now deprecated. - -2002-02-20 Nick Clifton - - * NEWS: Mark 2.12 branch. - -2002-02-19 Tom Tromey - - * config/tc-xstormy16.h (DWARF2_LINE_MIN_INSN_LENGTH): Define. - -2002-02-19 Thiemo Seufer - - * config/tc-mips.c (md_parse_option): Complain about invalid -mabi - option input. - -2002-02-19 Martin Schwidefsky - - * config/tc-s390.c (md_parse_option): Add switches -m31 and -m64. - Make bit size independent of architecture switch. - (md_begin): Add warning for -m64 with -Aesa. - (s390_md_end): Use renamed architecture defines. - -2002-02-18 Daniel Jacobowitz - - * config/obj-coff.h: Check !target_big_endian, not shl, for coff-sh. - -2002-02-16 Nick Clifton - - * doc/as.texinfo (Machine Dependencies): Fix typo: MMIX used - instead of CRIS. -2002-02-15 Chris Demetriou +2004-01-05 Maciej W. Rozycki - * config/tc-mips.c (md_estimate_size_before_relax): Really - make sure we treat weak like extern only for ELF. (Fixes - patch from 2001-07-25.) - -2002-02-15 Ben Elliston - - * doc/as.texinfo: Add duplicate directory entry so that "info gas" - works as expected. - -2002-02-15 Hans-Peter Nilsson - - * NEWS: Mention support for MMIX. - -2002-02-13 Chris Demetriou - - * config/tc-mips.c (mips_need_elf_addend_fixup): Restructure into - a sequence of indpendent 'if' statements for easier debugging - and future modification. - -2002-02-13 Matt Fredette - - * config/tc-m68k.c (md_show_usage): No longer display a - hard-coded "68020" for the default CPU, instead display the - canonical name of the true, configured default CPU. - (m68k_elf_final_processing): Mark objects for sub-68020 - CPUs with the new EF_M68000 flag. - -2002-02-13 Andreas Schwab - - * config/tc-i386.c (tc_i386_fix_adjustable): Don't adjust - pc-relative relocations to merge sections in 64-bit mode. - -2002-02-13 Ben Elliston - - * NEWS: Document floating point number handling in gasp. - * gasp.c: Include and "xregex.h". - (is_flonum): New function. - (chew_flownum): Likewise. - (change_base): Consume flonums from the input, where possible. - * doc/gasp.texi (Constants): Document floating point numbers. - -2002-02-12 John David Anglin - - * config/tc-hppa.c (hppa_fix_adjustable): Don't adjust final types - that implicitly use LR and RR selectors. - -2002-02-12 Alexandre Oliva - - * config/tc-mn10300.c (other_registers): Added `epsw'. Mark `pc' - and `epsw' as available on AM33 and above only. - (other_register_name): Add logic to handle machine type encoded in - reg_number. - -2002-02-11 Tom Rix - - * config/tc-ppc.c (md_apply_fix3): Check for insert fop invalid for - xcoff64. - -2002-06-11 Alexandre Oliva - - * config/tc-sparc.c (U0x80000000, U0xffffffff): New constants. - Use all over. - -2002-02-11 Jan Hubicka - - * i386.c (md_assemble): Support 32bit address prefix. - (i386_displacement): Likewise. - (i386_index_check): Accept 32bit addressing in 64bit mode. - -2002-02-11 Alexandre Oliva - - * config/tc-sh.c (dot): Removed unused function. - -2002-02-11 Alan Modra - - * Makefile.am: "make dep-am". + * Makefile.am (install, install-info, RECURSIVE_TARGETS): Remove. * Makefile.in: Regenerate. * aclocal.m4: Regenerate. - * config.in: Regenerate. - * configure: Regenerate. + * doc/Makefile.am (install, install-info): Remove. + (install-data-local): A new hook for install-info. + (AUTOMAKE_OPTIONS): Require automake 1.8. * doc/Makefile.in: Regenerate. -2002-02-10 Richard Henderson - - * doc/c-alpha.texi: New file. - * doc/Makefile.am (CPU_DOCS): Add it. - * doc/all.texi, doc/as.texinfo: Add hooks for Alpha. - -2002-02-09 Richard Henderson - - * config/tc-alpha.c (O_samegp): New. - (USER_RELOC_P): Include it. - (alpha_reloc_op_tag, debug_exp, find_macro_match): Add it. - (md_apply_fix3): Handle BFD_RELOC_ALPHA_BRSGP. - (alpha_force_relocation, alpha_fix_adjustable): Likewise. - (alpha_validate_fix): New. - * config/tc-alpha.h (TC_VALIDATE_FIX): New. - -2002-02-09 Hans-Peter Nilsson - - * doc/c-cris.texi: New. - * doc/all.texi: @set CRIS. - * doc/as.texinfo: Ditto. Add CRIS gas manpage option overview. - Include c-cris.texi. - * doc/Makefile.am (CPU_DOCS): Add c-cris.texi - * doc/Makefile.in: Regenerate. +2004-01-02 Nutan Singh -2002-02-08 Chris Demetriou - - * config/tc-mips.c (IS_SEXT_32BIT_NUM): New macro to - determine if a number is a sign-extended 32-bit number. - (load_register): Use IS_SEXT_32BIT_NUM. - (macro): Check if load/store macro handling is using a - constant 32-bit address on 64-bit address systems, and if - so optimize the generation of that address. - -2002-02-08 Richard Henderson - - * config/tc-alpha.c (alpha_force_relocation): Don't assert that - we've eliminated all foreign relocation types yet. - (alpha_fix_adjustable): Likewise. - -2002-02-08 Alexandre Oliva - - Contribute sh64-elf. - 2002-02-08 Alexandre Oliva - Stephen Clarke - * doc/c-sh64.texi: Fix citation of SH64 architecture manual. - 2002-01-31 Alexandre Oliva - * config/tc-sh.c (md_relax_table): Added default sizes for - non-PC-relative UNDEF_MOVI, and relaxation sequences for - MOVI_16, MOVI_32 and MOVI_48. - * config/tc-sh64.c (shmedia_md_apply_fix3): Fix warning. - (shmedia_md_convert_frag): Handle non-PC-relative UNDEF_MOVI - and MOVI_16. - (shmedia_md_estimate_size_before_relax): Remove redundant - blocks. Set fragP->fr_var even if relaxation type unchanged. - Retain UNDEF_MOVI until expression decays to number. - 2002-01-24 Alexandre Oliva - * config/tc-sh64.c (shmedia_init_reloc): Handle new SHmedia PIC - relocation types. Take fixP->fx_addnumber into account too. - (shmedia_md_apply_fix): Likewise. - (shmedia_md_convert_frag): Likewise. - (shmedia_build_Mytes): Likewise. - (sh64_consume_datalabel): Complain about nested datalabel. - Support PIC relocs. Call sh_parse_name. - * config/tc-sh64.h (TC_RELOC_RTSYM_LOC_FIXUP): Extend definition - in tc-sh.h to SHmedia reloc types. - * config/tc-sh.c (SH64PCRELPLT, MOVI_PLT, MOVI_GOTOFF, - MOVI_GOTPC): New relaxation constants. - (md_relax_table): Introduce relaxation directives for PIC-related - constants. - (sh_PIC_related_p): Handle datalabel. - (sh_check_fixup): Choose SH5 PIC relocations. - (sh_cons_fix_new): Added BDF_RELOC_64. - (md_apply_fix3, sh_parse_name): Handle GOTPLT. - 2002-01-18 Alexandre Oliva - * config/tc-sh64.c (sh64_max_mem_for_rs_align_code): If the - current ISA is SHmedia, get 7 bytes. - 2001-11-28 Nick Clifton - * config/tc-sh.c (md_apply_fix3): Treat shmedia_md_apply_fix3 as a - void function. - * config/tc-sh64.c (shmedia_apply_fix): Rename to - shmedia_apply_fix3 and make void. - 2001-05-17 Alexandre Oliva - * config/tc-sh64.c (s_sh64_abi): Remove unused arguments passed to - as_bad. - 2001-04-12 Alexandre Oliva - * config/tc-sh64.h (md_parse_name): Take &c as argument. - 2001-03-14 DJ Delorie - * doc/Makefile.am (CPU_DOCS): Added c-sh64.texi - * doc/Makefile.in(CPU_DOCS): Ditto. - * doc/c-sh64.texi: New file. - * doc/as.texinfo: Add SH64 support. - 2001-03-13 DJ Delorie - * config/tc-sh64.c (shmedia_get_operands): Rename A_RESV_Fx to - A_REUSE_PREV so that its purpose is more obvious. - (shmedia_build_Mytes): Ditto. - 2001-03-07 DJ Delorie - * config/tc-sh64.c (sh64_vtable_entry): New, strip datalabels - before processing. - (sh64_vtable_inherit): Ditto. - (strip_datalabels): New, strip "datalabel" from given line. - * config/tc-sh.c (md_pseudo_table): Add sh64-specific vtable - pseudos. - 2001-03-06 Hans-Peter Nilsson - * config/tc-sh64.c (shmedia_md_assemble): Move dwarf2_emit_insn - call ... - (shmedia_build_Mytes): ... to here. - 2001-03-06 DJ Delorie - * config/tc-sh.c: Remove sh64-specific uaquad now that there - is a generic one. - 2001-01-21 Hans-Peter Nilsson - * config/tc-sh64.h (DWARF2_LINE_MIN_INSN_LENGTH): Override. - * config/tc-sh64.c (shmedia_md_assemble): Offset recorded insn - address by one in call to dwarf2_emit_insn. - 2001-01-13 Hans-Peter Nilsson - Implement ".abi" pseudo and correct .cranges descriptors. Correct - alignment handling broken by imported changes. - * config/tc-sh64.h (HANDLE_ALIGN): Override definition in tc-sh.h. - (sh64_handle_align): Declare. - (MAX_MEM_FOR_RS_ALIGN_CODE): Override definition in tc-sh.h. - (sh64_max_mem_for_rs_align_code): Declare. - (enum sh64_isa_values): Moved here from tc-sh64.c. - (md_do_align): Define. - (sh64_do_align): Declare. - (struct sh64_tc_frag_data): New. - (TC_FRAG_TYPE): Change to struct sh64_tc_frag_data. Users - changed. - (TC_FRAG_INIT): Change to set new datatype. - (struct sh64_segment_info_type): Rename member - last_flushed_location to last_contents_mark. All users changed. - (md_elf_section_change_hook, TC_CONS_FIX_NEW): Do not define. - (shmedia_elf_new_section, sh64_tc_cons_fix_new): Do not prototype. - * config/tc-sh.c (md_pseudo_table): Add ".abi". - (sh_elf_cons) [HAVE_SH64]: Call sh64_update_contents_mark instead - of unsetting seen_insn. - (md_assemble) [HAVE_SH64] : Also - call sh64_update_contents_mark. - (sh_handle_align): Remove HAVE_SH64-conditioned code. - * config/tc-sh64.c (sh64_isa_mode): Correct type from boolean to - enum sh64_isa_values. - (sh64_set_contents_type): Drop segT parameter. All callers changed. - (emitting_crange): Boolean guard moved to file scope from function - scope in sh64_set_contents_type. - (s_sh64_abi): New. - (sh64_update_contents_mark): New; most split out from - sh64_flush_pending_output. - (shmedia_md_end): Call sh64_update_contents_mark. Set - sh64_isa_mode to sh64_isa_sh5_guard unless sh64_isa_unspecified. - (sh64_do_align): New function. - (sh64_max_mem_for_rs_align_code): New function. - (sh64_handle_align): Rename from shmedia_do_align. Make - non-static. Add head comment. Emit zero bytes for n bytes modulo - four. Change return-type to void. - (shmedia_elf_new_section): Remove. - (shmedia_md_assemble): Call sh64_update_contents_mark. - (s_sh64_mode): Ditto. Do not call md_flush_pending_output. Make - new frag. Call sh64_update_contents_mark after making the new - frag. - (sh64_flush_pending_output): Just call sh64_update_contents_mark - and sh_flush_pending_output. - (sh64_flag_output): Also call md_flush_pending_output, but add - condition on not emitting_crange. - (sh64_tc_cons_fix_new): Remove. - 2001-01-12 Nick Clifton - * config/tc-sh64.c (shmedia_do_align): Fix to work with new - alignment handling scheme imported from sourceware. - 2001-01-12 Hans-Peter Nilsson - * config/tc-sh64.h (TARGET_FORMAT): Define. - (sh64_target_format): Prototype. - * config/tc-sh64.c (sh64_target_mach): New function. - 2001-01-07 Hans-Peter Nilsson - * config/tc-sh64.c (shmedia_md_end): When equating a symbol, use - zero_address_frag instead of copying the frag of the symbol. - (shmedia_frob_file_before_adjust): Ditto. - (shmedia_md_apply_fix) : Cast mask - to valueT to remove signedness. - (shmedia_md_convert_frag): Add parameter final. Rename parameter - headers to output_bfd. Do not evaluate symbols if final is false; - do emit fixups. - (shmedia_md_estimate_size_before_relax) : If symbol cannot be modified to be PC-relative - to the current frag, call shmedia_md_convert_frag to emit fixups - and make frag_wane neutralize the frag. Update comments. - * config/tc-sh.c (md_convert_frag): Change caller of - shmedia_md_convert_frag. - 2001-01-06 Hans-Peter Nilsson - * config/tc-sh64.h: Tweak comments and correct formatting. - * config/tc-sh64.c: Ditto. - (shmedia_md_convert_frag) : Fix thinko calculating offset - for the no-relocation case. - (shmedia_check_limits): Fix range check being off-by-one for PTA. - * config/tc-sh.c: Ditto. Add proper comments to #ifdef/#ifndef - wrappers. - (SH64PCREL16_F): Increment for proper max-PTA handling. Update - comment. - (SH64PCREL16_M, MOVI_16_M): Correct range thinko. - (SH64PCREL48_M, MOVI_48_M): Similar; don't count in length of - expansion. - (SH64PCREL32_M, MOVI_32_M): Ditto; handle overflowing expression. - Correct comment. - 2001-01-05 Hans-Peter Nilsson - * config/tc-sh64.c (shmedia_md_apply_fix) : Set lowest bit in field to be relocated to 1. - (shmedia_md_convert_frag) : Set lowest bit of field to relocate to 1 and rest to empty, - if reloc is emitted. - 2000-12-31 Hans-Peter Nilsson - New options plus bugfixes. - * config/tc-sh.c (md_longopts): New options "-no-expand" and - "-expand-pt32". - (md_parse_option): Handle new options. - (md_show_usage): Add blurb for new options. - * config/tc-sh64.c (SHMEDIA_BFD_RELOC_PT): New macro. - (sh64_expand, sh64_pt32): New variables. - (shmedia_init_reloc): Handle BFD_RELOC_SH_PT_16. - (shmedia_md_apply_fix): Hold original fixP->fx_r_type in - orig_fx_r_type. Change SHMEDIA_BFD_RELOC_PT into - BFD_RELOC_SH_PT_16. Handle BFD_RELOC_SH_PT_16 as pc-relative. - : Handle - SHMEDIA_BFD_RELOC_PT and BFD_RELOC_SH_PT_16. - (shmedia_md_convert_frag) : Modify to PTB if operand - points to SHcompact code. - : Check that ISA of what operand points at and - PTA/PTB matches, or emit error. - (shmedia_check_limits): Handle BFD_RELOC_SH_PT_16 and - SHMEDIA_BFD_RELOC_PT. - (shmedia_immediate_op): If pcrel, emit fixup also for constant - operand. - (shmedia_build_Mytes) : Also check sh64_expand in - condition for MOVI expansion. - : Handle expansion to 32 bits only, if - sh64_pt32. Emit only a BFD_RELOC_SH_PT_16 fixup if not - sh64_expand. - : Likewise, but emit a SHMEDIA_BFD_RELOC_PT - fixup. - (sh64_target_format): Error-check setting of sh64_pt32 and - sh64_expand. Fix typo in check for sh64_shcompact_const_crange. - (shmedia_md_pcrel_from_section): Handle BFD_RELOC_SH_PT_16 and - SHMEDIA_BFD_RELOC_PT as coming from SHmedia code. - 2000-12-31 Hans-Peter Nilsson - * config/tc-sh64.c: Improve comments. - (shmedia_md_convert_frag): Remove inactive is_pt_variant code. Do - not say the linker will check correctness of PTA/PTB expansion. - (shmedia_md_end): Make non-static. - * config/tc-sh64.h (md_end): Define to shmedia_md_end. Add - prototype. - * config/tc-sh.c (sh_finalize): Remove. - * config/tc-sh.h (md_end): Do not define. - Remove prototype for sh_finalize. - 2000-12-30 Hans-Peter Nilsson - * config/tc-sh64.c (shmedia_frob_section_type): Use a struct - sh64_section_data container when storing section type in tdata - field in elf_section_data. - * config/tc-sh.c (sh_elf_final_processing): Change from EF_SH64 to - EF_SH5. - * Makefile.am: Update dependencies. - * Makefile.in: Regenerate. - 2000-12-22 Hans-Peter Nilsson - * config/tc-sh64.c (shmedia_md_assemble): Don't protect - dwarf2_emit_insn call with test on debug_type. - 2000-12-19 Hans-Peter Nilsson - * config/tc-sh64.c (sh64_set_contents_type): Make contents-type - CRT_SH5_ISA32 sticky for 64-bit. - 2000-12-18 Hans-Peter Nilsson - Generate .crange sections when switching ISA mode or emitting - constants in same section as code. - * config/tc-sh64.c: Reformat structure definitions. - (sh64_end_of_assembly, sh64_mix, sh64_shcompact_const_crange): New - variables. - (sh64_set_contents_type): Rename from sh64_init_section. Rewrite - to emit a .cranges descriptor when contents type changes. Only - emit error if changing contents type and -no-mix is in effect. - (sh64_emit_crange, sh64_flush_last_crange, sh64_flag_output, - sh64_flush_pending_output, sh64_tc_cons_fix_new): New functions. - (shmedia_md_end): Set sh64_end_of_assembly. Pass - sh64_flush_last_crange over sections. - When checking main symbol of datalabel symbol, check for - STO_SH5_ISA32, not ISA type of section in definition. - (shmedia_frob_file_before_adjust): Check main symbol for - STO_SH5_ISA32; don't check ISA type of section in definition. - (shmedia_frob_section_type): Adjust for .cranges; set section flag - to SHF_SH5_ISA32_MIXED or SHF_SH5_ISA32 according to whether - .cranges entries have been output. - (shmedia_elf_new_section): Just call md_flush_pending_output. - (shmedia_md_assemble): Do not emit a BFD_RELOC_SH_SHMEDIA_CODE - fix. Do not set tc_segment_info_data.in_code for section. Call - sh64_set_contents_type for SHmedia code. - (s_sh64_mode): Do not call sh64_init_section or set seen_insn to - false. Call md_flush_pending_output. - (sh64_target_format): Check that -no-mix and - -shcompact-const-crange are used in sane combination with other - options. - (shmedia_md_pcrel_from_section): Check type of fix for how to - adjust pc-relative. - (sh64_consume_datalabel): Check symbol for having STO_SH5_ISA32, - not ISA type of section in definition. - * config/tc-sh64.h (struct sh64_segment_info_type): Rewrite to - hold contents-type state. - (md_flush_pending_output): Redefine to sh64_flush_pending_output. - (sh64_flush_pending_output): Declare. - (TC_CONS_FIX_NEW): Define to sh64_tc_cons_fix_new. - (sh64_tc_cons_fix_new): Declare. - * config/tc-sh.c (sh_elf_cons) [HAVE_SH64]: Unset seen_insn and - call sh64_flag_output. - (md_assemble) [HAVE_SH64]: Do not emit BFD_RELOC_SH_CODE. Just - call sh64_set_contents_type to mark SHcompact code and set - seen_insn. - (md_longopts): New options "-no-mix" and - "-shcompact-const-crange". - (md_parse_option): Handle new options. - (md_show_usage): Add blurb for new options. - (md_number_to_chars) [HAVE_SH64]: Call sh64_flag_output. - 2000-12-15 Hans-Peter Nilsson - * config/tc-sh64.c: Delete investigated and obsolete fixme:s. - (sh64_last_insn_frag): New. - (shmedia_md_convert_frag): Use tc_frag_data field of incoming frag - to get frag for insn opcode for generating fixups; do not assume it - is the same frag. - (shmedia_build_Mytes): Set sh64_last_insn_frag after growing frag - for new insn. - * config/tc-sh64.h (ELF_TC_SPECIAL_SECTIONS): Define for .cranges - section. - (TC_FRAG_TYPE): Define as fragS *. - (TC_FRAG_INIT): Define to set tc_frag_data to sh64_last_insn_frag. - (sh64_last_insn_frag): Declare. - (sh64_consume_datalabel): Fix typo; check for seginfo != NULL, - not == NULL before dereferencing. - 2000-12-12 Hans-Peter Nilsson - Get rid of BFD section flag and EF_SH64_ABI64. - * config/tc-sh64.c (shmedia_frob_section_type): Use - elf_section_data (sec)->tdata, not a specific BFD section flag, to - communicate the section as containing SHmedia code. Describe why. - * config/tc-sh.c (sh_elf_final_processing): Tweak comment. Set - EF_SH64 regardless of ABI. - * config/tc-sh64.c (shmedia_md_apply_fix): Decapitalize "invalid" - in error message. Handle resolved expressions for - BFD_RELOC_SH_IMMS10, BFD_RELOC_SH_IMMS10BY2, - BFD_RELOC_SH_IMMS10BY4 and BFD_RELOC_64. - (shmedia_check_limits): Handle BFD_RELOC_64. - (sh64_adjust_symtab): Do not decrement the GAS symbol value for - a STO_SH5_ISA32 symbol, only the BFD value. - 2000-12-11 Ben Elliston - * config/tc-sh64.c: Call dwarf2_emit_insn, not the defunct - dwarf2_generate_asm_lineno. - 2000-12-11 Hans-Peter Nilsson - Handle PC-relative MOVI expansions with assembler relaxation. - Generate PC-relative relocs from 16-bit PC-relative expressions. - * config/tc-sh64.c (SHMEDIA_MD_PCREL_FROM_FIX): Break out from... - (shmedia_md_pcrel_from_section): ...here. - (shmedia_md_apply_fix): Handle fixups for 16-bit operands that has - turned completely resolved. Adjust relocation type for 16-bit - immediate operands that has turned PC-relative. Adjust back for - MD_PCREL_FROM_SECTION being applied twice. - (shmedia_md_convert_frag): Always emit reloc for expression with - global or weak symbol. Handle relaxation result for PC-relative - expressions. - (shmedia_md_estimate_size_before_relax): An expression with a weak - or global symbol can not be relaxed. Break out tests for - relaxable symbol into variable sym_relaxable. - : Break out any PC-relative expression and change - relaxation type. - (shmedia_build_Mytes): CSE &operands->operands[j] into variable - opjp. - : Fix typo for initial minor relaxation type of - MOVI expansion. If X_op_symbol of the immediate expression is - set, make an expression symbol for the argument to frag_var. - * config/tc-sh.c (MOVI_IMM_32_PCREL, MOVI_IMM_64_PCREL): New - relaxations. - (END): Adjust for new relaxations. - (md_relax_table): Add entries for new relaxations. - 2000-12-07 Ben Elliston - * config/tc-sh64.c (shmedia_parse_reg): Initialize variable len. - 2000-12-07 Hans-Peter Nilsson - * config/tc-sh64.c (shmedia_md_convert_frag): Correct all MOVI and - SHORI operand offsets in PT/PTA/PTB expansions. - 2000-12-05 Hans-Peter Nilsson - Implement DataLabel semantics. - * config/tc-sh.c (sh_frob_file) [HAVE_SH64]: Call - shmedia_frob_file_before_adjust. - * config/tc-sh64.c [! OBJ_ELF]: Emit #error. - (DATALABEL_SUFFIX): Define. - (shmedia_md_end) : Walk - symbol list to update "datalabel" symbols to their main symbol - counterparts. - (shmedia_frob_file_before_adjust): New. - (sh64_adjust_symtab): For remaining datalabel symbols, set to - undefined and set STT_DATALABEL. - (sh64_frob_label): Initialize TC symbol field. - (sh64_consume_datalabel): Actually implement semantics. New - parameter operandf, call it instead of expression. - (sh64_exclude_symbol): New. - * config/tc-sh64.h (md_parse_name): Pass on the function operand - to sh64_consume_datalabel. - (tc_symbol_new_hook): Define to tc_frob_symbol. - (TC_SYMFIELD_TYPE): Define to symbolS *. - (tc_frob_symbol): Define to call sh64_exclude_symbol. - 2000-12-01 Hans-Peter Nilsson - * config/tc-sh64.c (shmedia_init_reloc): Tweak comment for default - case. - (shmedia_md_assemble): Call dwarf2_generate_asm_lineno if - generating dwarf2 debug information. - 2000-11-30 Hans-Peter Nilsson - * config/tc-sh64.c (sh64_target_format): Use elf64-sh64l and - elf64-sh64 for the 64-bit ABI. - * config/tc-sh.c (md_show_usage): Tweak usage output for -abi=* - option. - 2000-11-29 Hans-Peter Nilsson - * config/tc-sh.c: Remove conditionalizing on HAVE_SH64 for - case-insensitivity. - 2000-11-27 Hans-Peter Nilsson - * config/tc-sh64.c: Tweak comments, formatting and error messages. - (enum sh64_abi_values): New type. - (enum sh64_isa_values): New type. - (sh64_isa_mode): Replace shmedia_mode. All referers changed. - (seen_shcompact_mode, seen_shmedia_mode): Delete. - (sh64_abi): Replace shmedia_64. - (shmedia_md_convert_frag) : Correct register number handling. - (s_sh64_mode): Check validity for this target. - (sh64_target_format): Initialize defaults for ISA and ABI. - Fallback to old object format if no SH64 ISA or ABI has been - specified. - * config/tc-sh.c (md_parse_option): Check combinations for errors. - (sh_elf_final_processing): Change to have EF_SH64_ABI64 for 64-bit - ABI and EF_SH64 for 32-bit ABI, if SH64 options are specified. - * config/tc-sh64.h: Fix typo in comment. - 2000-11-25 Hans-Peter Nilsson - * config/tc-sh64.c (shmedia_md_estimate_size_before_relax) - : Size will be longest, not - shortest. - (shmedia_md_convert_frag): Disable PTB-warning machinery. Correct - all MOVI and SHORI operand offsets in PT/PTA/PTB expansions. - * config/tc-sh.c (parse_reg) [HAVE_SH64]: Add local variables l0 - and l1 to hold lowercase of two first characters. Change all - remaining TO_LOWER to tolower. - * config/tc-sh64.c (TO_LOWER): Delete. - (shmedia_find_cooked_opcode): Use tolower, not TO_LOWER. - (md_parse_name): Define. - (sh64_consume_datalabel): Declare. - (DOLLAR_DOT): Define. - * config/tc-sh64.c (shmedia_parse_exp): New. - (sh64_consume_datalabel): New; just ignoring datalabel semantics. - (shmedia_parse_reg): Remove const from src - parameter. - (shmedia_get_operands): Ditto for args parameter and ptr variable. - (shmedia_md_assemble): Ditto for op_end variable. - (shmedia_get_operand): Ditto for ptr parameter and src variable. - Use shmedia_parse_exp, not parse_exp. - * config/tc-sh64.c (shmedia_parse_reg): Add shmedia_arg_type - parameter. All callers changed. - (shmedia_get_operand): Add shmedia_arg_type parameter. All - callers changed. - (shmedia_parse_reg): Put first two character in local variables. - Use tolower, not TO_LOWER. If no register is found and argtype - indicates a control register, scan shmedia_creg_table - case-insensitive. - 2000-11-24 Hans-Peter Nilsson - * Makefile.am (CPU_TYPES): Add sh64. - (TARGET_CPU_CFILES): Add config/tc-sh64.c. - (TARGET_CPU_HFILES): Add config/tc-sh64.h. - Regenerate dependencies. - * Makefile.in: Regenerate. - * configure.in: Add support for sh64-*-elf*. - * configure: Regenerate. - * config/tc-sh64.h: New. - * config/tc-sh64.c: New. - * config/tc-sh.c (md_pseudo_table) [HAVE_SH64]: New pseudos - .mode, .isa and .uaquad. - [HAVE_SH64] (SH64PCREL16_32, SH64PCREL16_64, SH64PCREL16PT_32, - SH64PCREL16PT_64, MOVI_IMM_32, MOVI_IMM_64): Define. - [HAVE_SH64] (END): Define as 10. - [HAVE_SH64] (UNDEF_SH64PCREL, SH64PCREL16, SH64PCREL32, - SH64PCREL48, SH64PCREL64, UNDEF_MOVI, MOVI_16, MOVI_32, MOVI_48, - MOVI_64): Define. - [HAVE_SH64] (SH64PCREL16_F, SH64PCREL16_M, SH64PCREL16_LENGTH, - SH64PCREL32_F, SH64PCREL32_M, SH64PCREL32_LENGTH, SH64PCREL48_F, - SH64PCREL48_M, SH64PCREL48_LENGTH, SH64PCREL64_LENGTH, - MOVI_16_LENGTH, MOVI_32_LENGTH, MOVI_48_LENGTH, MOVI_64_LENGTH): - Define. - (md_relax_table) [HAVE_SH64]: Provide relaxations for SHmedia. - (md_begin) [HAVE_SH64]: Call shmedia_md_begin. - (parse_reg) [HAVE_SH64]: Parse register names case-insensitive. - (md_assemble) [HAVE_SH64]: Call shmedia_md_assemble if assembling - SHmedia instructions. Handle state-change after switching to - SHcompact. - (md_longopts) [HAVE_SH64]: New options --isa=* and --abi=*. - (md_parse_option) [HAVE_SH64]: Parse new options. - (md_show_usage) [HAVE_SH64]: Show usage of new options. - (md_convert_frag) [HAVE_SH64] : Call - shmedia_md_convert_frag instead of abort. - (sh_force_relocation) [HAVE_SH64]: Also force relocation for - BFD_RELOC_SH_SHMEDIA_CODE. - (sh_elf_final_processing) [HAVE_SH64]: Set flags identifying - SHcompact or SHmedia code. - (md_apply_fix) [HAVE_SH64] : Return result from calling - shmedia_md_apply_fix instead of abort. - (md_estimate_size_before_relax) [HAVE_SH64] : Return - result from calling shmedia_md_estimate_size_before_relax instead - of calling abort. - (sh_do_align) [HAVE_SH64]: If shmedia_mode, let shmedia_do_align - do the work. - (tc_gen_reloc) [HAVE_SH64]: For unrecognized relocs, call - shmedia_init_reloc and do nothing more if it returns non-zero. - (sh_finalize) [HAVE_SH64]: Call shmedia_md_end. - * po/POTFILES.in: Regenerate. - * po/gas.pot: Regenerate. - -2002-02-06 Alexandre Oliva - - * config/tc-sh.c (parse_at): Install the correct version of - 2002-02-04's patch. - - * config/tc-sh.c (md_apply_fix3) : Don't - assume fixP->fx_subsy is non-NULL. - -2002-02-04 Alexandre Oliva - - * config/tc-sh.c (parse_at): Set arg type of @(expr,pc) to - A_DISP_PC_ABS, and adjust it by -4. - (get_specific): Accept A_DISP_PC_ABS where A_DISP_PC is - expected. - (build_Mytes): Mark PCRELIMM fix-ups as pc-relative only if - the operand type is not A_DISP_PC_ABS. - -2002-02-04 Hans-Peter Nilsson - - * config/tc-mmix.c (tc_gen_reloc): Don't try and take the value of - common and weak symbols. Handle common and weak symbols as - undefined symbols with regards to GREG handling and merging. - (mmix_frob_file): Ditto. - -2002-02-02 Jason Thorpe - - * configure.in (hppa-*-netbsd*): New target. - * configure: Regenerate. - * config/tc-hppa.h: Also define WARN_COMMENTS if TE_NetBSD. - -2002-02-02 Alan Modra - - * config/tc-v850.c: Add missing prototypes amd use old-style - function definitions. - (AREA_ZDA, AREA_SDA, AREA_TDA): Delete. - (sdata_section tdata_section, zdata_section, sbss_section, - tbss_section, zbss_section, rosdata_section, rozdata_section, - scommon_section, tcommon_section, zcommon_section, - call_table_data_section, call_table_text_section): Delete. - (v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss, - v850_zbss, v850_bss, v850_rosdata, v850_rozdata, - v850_call_table_data, v850_call_table_text): Delete. - (struct v850_seg_entry): New. - (v850_seg_table): New. - (SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION, - TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION, - ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION, - CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define. - (do_v850_seg): New. - (v850_seg): New. - (v850_comm): Use do_v850_seg and v850_seg_table. Simplify - recording of alignment. - (md_pseudo_table): Use v850_seg. - (md_begin): Don't init .call_table_data and .call_table_text here. - Set v850_seg_table bss entry. - -2002-02-01 Hans-Peter Nilsson - - Support on-demand global register allocation by passing on - base-plus-offset relocs to the linker. - * config/tc-mmix.c: Tweak and fix typos in comments. - (allocate_undefined_gregs_in_linker): New variable. - (OPTION_LINKER_ALLOCATED_GREGS): New option macro. - (md_longopts): Add --linker-allocated-gregs. - (md_parse_option) : Imply --linker-allocated-gregs. - : New. - (md_show_usage): Update text for -x. Add text for - --linker-allocated-gregs. - (tc_gen_reloc): Derive default value for addend from val and - baddsy. Use addsec and bfd_is_abs_section in more places. Don't - emit error for BFD_RELOC_MMIX_BASE_PLUS_OFFSET without suitable - GREG if allocate_undefined_gregs_in_linker. - * doc/as.texinfo (Overview) : Add - --linker-allocated-gregs. - * doc/c-mmix.texi (MMIX-Opts): Add blurb about - --linker-allocated-gregs. Mention that it's implied by -x. - (MMIX-Pseudos) : Mention when and how a GREG can be omitted. - (MMIX-mmixal): Clarify dated comparison and location of MMIXware. - - * config/tc-mmix.h (md_parse_name): Use ISUPPER, not isupper. - -2002-02-01 Alan Modra - - * Makefile.am: Run "make dep-am" - * Makefile.in: Regenerate. + * doc/c-sh.texi: Update description about floating point behavior + of SH family. -2002-01-31 Ivan Guzvinec +2004-01-02 Bernardo Innocenti - * config/tc-or32.c: New file. - * config/tc-or32.h: New file. - * configure.in: Add support for or32 targets. + * configure.in: Add m68k-uClinux target. * configure: Regenerate. - * config/obj-coff.c: Add support for or32 targets. - * config/obj-coff.h: Add support for or32 targets. - * Makefile.am: Add support for or32 targets. - * Makefile.in: Regenerate. - * NEWS: Mention support for OpenRISC. - * doc/Makefile.in: Regenerate. - * po/POTFILES.in: Regenerate. - * po/gas.pot: Regenerate. - -2002-01-30 Richard Sandiford - - * config/tc-sh.c (parse_reg): Fix end-of-word check for is, ix, iy - and mod. - -2002-01-29 Chris Demetriou - - * config/tc-mips.c (tc_gen_reloc): Arrange for - BFD_RELOC_PCREL_HI16_S relocations to be output relative to - their LO16 parts, even for ELF. - -2002-01-29 Daniel Jacobowitz - - * config/tc-i386.c: Protect definitions of true and false - from redefinition. - -2002-01-28 Jakub Jelinek - - * config/obj-elf.c (elf_frob_file_before_adjust): Remove symbols - made because of .weak, if they are neither defined nor used in any - way. - -2002-01-27 Daniel Jacobowitz - - * configure: Regenerated. - -2002-01-26 Hans-Peter Nilsson - - * doc/Makefile.am (install): Depend on install-info. - * doc/Makefile.in: Regenerate. - -2002-01-26 Nick Clifton - - * po/fr.po: Updated version - -2002-01-24 Kazu Hirata - - * config/tc-h8300.c (check_operand): Don't print a warning - when a valid 24-bit address is given to a 16-bit address - operand. - -2002-01-24 Alexandre Oliva - - * config/tc-sh.c (sh_elf_suffix): Removed. - (sh_PIC_related_p, sh_check_fixup, sh_cons_fix_new, - sh_end_of_match, sh_parse_name): New functions. - (sh_elf_cons): Simplify. - (parse_exp): Reject misplaced PIC operands. - (md_undefined_symbol): Simplify. - (sh_fix_adjustable): Let @GOTOFF be adjusted. - (md_apply_fix3): Write @PLT and @GOTOFF addends in place. - (tc_gen_reloc): Move fixp subsy absolute value into addnumber. - Complain if subsy remains at the end. - * config/tc-sh.h (sh_parse_name, sh_cons_fix_new): Declare. - (md_parse_name, TC_CONS_FIX_NEW, O_PIC_reloc): Define. - -2002-01-22 Alexandre Oliva - - * config/tc-mn10300.c (xr_registers): Move `pc'... - (other_registers): ... here. - -2002-01-22 Alan Modra - - * Makefile.am: Run "make dep-am". - * Makefile.in: Regenerate. - * gas/po/POTFILES.in: Regenerate. - -2002-01-21 DJ Delorie - - * config/obj-coff.c (obj_coff_init_stab_section): Make the - stabstr_name allocation permanent, as it will be referenced from - the section hash. - -2002-01-21 Jason Thorpe - - * configure.in (ia64-*-netbsd*): New target. - * configure: Regenerate. - -2002-01-21 Hans-Peter Nilsson - - * doc/as.texinfo (Overview) : Add missing {} - to @dots call. - : Ditto. - * doc/c-arm.texi (ARM Options): Ditto. - -2002-01-18 Richard Earnshaw - - * tc-arm.c (do_xsc_mia, do_xsc_mar, do_xsc_mra): Renamed from - do_mia, do_mar and do_mra respectively. - (do_mav_*): Renamed from do_c_*. - (mav_reg_required_here, mav_parse_offset): Renamed from - cirrus_reg_required_here and cirrus_parse_offset respectively. - (MAV_MODE?): Renamed from CIRRUS_MODE?. - -2002-01-18 Richard Earnshaw - Keith Walker - - * tc-arm.c (ARM_EXT_V5J, ARM_ARCH_V5TEJ): Define. - (insns): Add pattern for bxj instruction. - (do_bxj): New function. - (arm_cpus): Add arm926ej. - (arm_archs): Add armv5tej. - -2002-01-18 Richard Earnshaw - - * doc/c-arm.texi: Add new fpe options to list of supported flags. - -2002-01-19 Keith Walker - - * tc-arm.c (arm_fpus): Add fpe2 and fpe3. - -2002-01-18 Richard Earnshaw - - * NEWS: Mention new ARM command-line options and VFP support. - - * config/tc-arm.c (ARM_CEXT_XSCALE): Replaces ARM_EXT_XSCALE. All - uses changed. - (ARM_CEXT_MAVERICK): Similarly. - (ARM_ANY): Now means any core instruction. - (CPU_DEFAULT): Default to ARM_ANY. - (uses_apcs_26, atcps, support_interwork, uses_apcs_float) - (pic_code): Declare for all object types. Make type int. - (legacy_cpu, legacy_fpu, mcpu_cpu_opt, mcpu_fpu_opt, march_cpu_opt) - (march_fpu_opt, mfpu_opt): Declare. - (md_longopts): Tidy up conditional definitions. - (arm_opts, arm_cpus, arm_archs, arm_fpus, arm_extensions) - (arm_long_opts): New tables. - (arm_parse_cpu, arm_parse_arch, arm_parse_fpu): New functions. - (arm_parse_extension): New function. - (md_parse_option): Rewrite using new table-driven system. - (md_show_usage): Use new table-driven system. - (md_begin): Calculate cpu_variant from command line option data. - * doc/as.texinfo (ARM ISA options): Docuement new ARM-specific - command-line options. - * doc/c-arm.texi: Likewise. - -2002-01-18 Andreas Jaeger - - * as.c (parse_args): Update year. - -2002-01-17 Timothy Wall - - * config/tc-tic54x.c (encode_address): Add a more informative - warning about incorrect syntax. - -2002-01-17 Nick Clifton - - * po/gas.pot: Regenerate. - -2002-01-17 Nick Clifton - - * macro.c (get_any_string): Add no-c-format comment to prevent - confusion when translating string. - * gasp.c (get_any_string): Add no-c-format comment to prevent - confusion when translating string. - -2002-01-16 Thiemo Seufer - Johannes Stezenbach - * config/tc-mips.c (percent_op): Ensure longer percent_op's are - matched before the shorter ones. - (my_getSmallParser): Fix handling of nested parentheses in - percent_op's. Code cleanup. - (my_getPercentOp): New function, code from my_getSmallParser. - (my_getSmallExpression): Fix handling of closing parentheses. - Code cleanup. Better comments. - -2002-01-16 Nick Clifton - - po/tr.po: New file: Turkish translation. - configure.in (LINGUAS): Add "tr". - configure: Regenerate. - -2002-01-15 Richard Earnshaw - - Support for VFP instructions - * tc-arm.c (CP_WB_OK, CP_NO_WB): New defines. - (cp_address_required_here): New argument wb_ok. When false, do not - accept write-back forms of addressing. Change all callers. - (FPU_VFP_EXT_NONE, FPU_VFP_EXT_V1xD, FPU_VFP_VFP_V1) - (FPU_VFP_EXT_V2): Define. - (FPU_ARCH_VFP, FPU_ARCH_VFP_V1xD, FPU_ARCH_VFP_V1, FPU_ARCH_VFP_V2): - Define in terms of above. - (vfp_dp_reg_pos, vfp_sp_reg_pos, vfp_ldstm_type): New enums. - (vfp_reg): New struct. - (vfp_regs): New array of registers. - (insns): Add VFP instructions. - (sn_table): New array of VFP single-precision register names. - (dn_table): New array of VFP double-precision register names. - (all_reg_maps): Add the new register tables. - (arm_reg_type): Add new values for above. Increase RET_TYPE_MAX. - (vfp_sp_reg_required_here, vfp_dp_reg_required_here, do_vfp_sp_monadic) - (do_vfp_dp_monadic, do_vfp_sp_dyadic, do_vfp_dp_dyadic) - (do_vfp_reg_from_sp, do_vfp_sp_reg2, do_vfp_sp_from_reg) - (do_vfp_reg_from_dp, do_vfp_reg2_from_dp, do_vfp_dp_from_reg) - (do_vfp_dp_from_reg2, vfp_psr_parse, vfp_psr_required_here) - (do_vfp_reg_from_ctrl, do_vfp_ctrl_from_reg, do_vfp_sp_ldst) - (do_vfp_dp_ldst, vfp_sp_reg_list, vfp_dp_reg_list, vfp_sp_ldstm) - (vfp_dp_ldstm, do_vfp_sp_ldstmia, do_vfp_sp_ldstmdb, do_vfp_ldstmia) - (do_vfp_dp_ldstmdb, do_vfp_xp_ldstmia, do_vfp_xp_ldstmdb) - (do_vfp_sp_compare_z, do_vfp_dp_compare_z, do_vfp_dp_sp_cvt) - (do_vfp_sp_dp_cvt): New functions. - (md_begin): Set soft-float flag for appropriate VFP work. - (md_atof): Handle VFP-format doubles. - (md_parse_option): Handle VFP command-line options. - (md_show_usage): Display VFP command-line options. - -2002-01-15 Richard Earnshaw - - * tc-arm.c (md_parse_option): Tidy up setting of cpu_variant for - various command line options. - -2002-01-15 Nick Clifton - - * config/tc-xstormy16.c: (xstormy16_fix_adjustable): Do not fix - vtinherit relocs. - (xstormy16_md_apply_fix3): Do not return a value. - -2002-01-14 Richard Earnshaw - - * tc-arm.c (md_longopts): On targets that aren't bi-endian, support - the -EL/-EB option that matches the target's endianness. - (md_parse_option): Likewise. - -2002-01-14 Richard Earnshaw - - * tc-arm.c (md_longopts): Fix misplaced #endif -- the -oabi option - is not dependent on ARM_BI_ENDIAN. - -2002-01-14 Richard Earnshaw - - * tc-arm.c (all error messages): Normalize capitalization of messages. - - * tc-arm.h (md_operand): Delete define. - * tc-arm.c (in_my_get_expression): New static variable. - (my_get_expression): Set and clear it. - (md_operand): New function. If called from my_get_expression - put the error in inst.error. - (output_inst): Now takes argument of instruction being assembled. - Print it out with any error message. - (do_ldst, do_ldstv4, thumb_load_store): Fault attempt to use a store - with '=' syntax. - (end_of_line): Don't update inst.error if it is already set. - -2002-01-11 Richard Earnshaw - - * tc-arm.c ((do_ldst): Fix handling an immediate expression pseudo - op that can be translated into a mvn instruction. - -2002-01-11 Steve Ellcey - - * gas/config/tc-ia64.h (MD_FLAGS_DEFAULT): New Macro for - setting default md.flags. - (SHT_INIT_ARRAY): New elf special section used by HP-UX. - (SHT_FINI_ARRAY): New elf special section used by HP-UX. - * gas/config/tc-ia64.c (setup_unwind_header): Add support - for 32 bit unwind info blocks. - (generate_unwind_image): Add support for different types - of unwind images (32 bits and/or big-endian). - (ia64_init): Use MD_FLAGS_DEFAULT to set md.flags. - (ia64_target_format): Add support for hpux target formats. - (ia64_gen_real_reloc_type): Add support for FUNC_IPLT_RELOC. - (ia64_elf_section_type): Add support for SHT_INIT_ARRAY and - SHT_FINI_ARRAY elf section types. - -2002-01-10 Richard Earnshaw - - * tc-arm.c (struct reg_entry): Move before prototypes. - (int_register, cp_register, fp_register): Delete. - (reg_table): Delete. Replaced with ... - (rn_table, cp_table, cn_table, fn_table, mav_mvf_table) - (mav_mvd_table, mav_mvfx_table, mav_mvdx_table, mav_mvax_table) - (mav_dspsc_table): ... one table per register set. - (arm_reg_hsh): Delete. - (struct reg_map): New structure. - (all_reg_maps): New array. - (enum arm_reg_type): New enums. - (build_reg_hsh): New function. - (insert_reg_alias): Use hash table passed by caller. Adjust all - callers. - (create_register_alias): New function, split out from ... - (md_assemble): ... here. - (md_begin): Build new register hash tables. - (arm_reg_parse): New argument for the hash table to search. Adjust all - callers. - (arm_reg_parse_any): New function. - (co_proc_number): Look up the processor number in the processor hash - table. - (cirrus_regtype): Delete. - (cirrus_register, cirrus_mvf_register, cirrus_mvd_register) - (cirrus_mvfx_register, cirrus_mvdx_register, cirrus_mvax_register) - (ARM_EXT_MAVERICKsc_register): Delete. - (do_c_binops_1, do_c_binops_2, do_c_binops_3): Delete. - (do_c_binops_1[a-o], do_c_binops_2[a-c], do_c_binops_3[a-d]): New - functions. - (do_c_triple_4, do_c_triple_5): Delete. - (do_c_triple_4[ab], do_c_triple_5[a-h]): New functions. - (do_c_quad_6): Delete. - (do_c_quad_6[ab]): New functions. - (do_c_binops, do_c_triple, do_c_quad, do_c_shift, do_c_ldst): Rework - arguments to use new register parsing methods. - (cirrus_reg_required_here): Likewise. - (insns): Reclassify cirrus maverick worker functions. - (cirrus_valid_reg): Delete. - -2002-01-07 Jason Thorpe - - * configure.in (sh*le): Set cpu_type=sh and endian=little. - (sh*-*-netbsdelf*): New target. - * configure: Regenerate. - * tc-sh.h: Update copyright years. - (TARGET_FORMAT): Add version for TE_NetBSD. - -2002-01-07 Nick Clifton - - * read.c (emit_expr): Do not allow 'size' or 'nbytes' to go - negative. - -2002-01-06 Alan Modra - - * config/tc-m68k.h (md_prepare_relax_scan): Rewrite. - * config/tc-m68k.c (md_relax_table): Add md_prepare_relax_scan comment. - -2002-01-05 Daniel Jacobowitz - - * tc-mips.c (mips_cprestore_valid): New flag. - (mips_frame_reg_valid): New flag. - (macro) [M_JAL_2]: Check both flags. - [M_JAL_A]: Likewise. - (s_cprestore): Set mips_cprestore_valid. - (tc_get_register): If setting mips_frame_reg, set - mips_frame_reg_valid and clear mips_cprestore_valid. - (s_mips_ent): Clear both flags. - (s_mips_end): Clear both flags. - -2002-01-05 Alan Modra - - * write.c (write_object_file): Make use of bfd_section_list_remove. - * config/obj-ecoff.c (ecoff_frob_file): Likewise. - * config/tc-mmix.c (mmix_frob_file): Likewise. - -2002-01-04 Jason Thorpe - - * configure.in (i386-*-netbsdelf*): Collapse target into... - (i386-*-netbsd*): ...this. Add support for x86-64. - * configure: Regenerated. - -2002-01-03 matthew green - - * config/tc-ppc.c (md_parse_option): BookE is not Motorola specific. - -2002-01-02 Nick Clifton - - * config/tc-m68k.c (md_estimate_size_before_relax): Test for a - NULL frag link. -For older changes see ChangeLog-0001 +For older changes see ChangeLog-0203 Local Variables: mode: change-log diff --git a/contrib/binutils/gas/ChangeLog-0203 b/contrib/binutils/gas/ChangeLog-0203 new file mode 100644 index 0000000..e22a5d5 --- /dev/null +++ b/contrib/binutils/gas/ChangeLog-0203 @@ -0,0 +1,7519 @@ +2003-12-29 Paul Brook + + * gas/config/tc-arm.c (arm_cpus): Add 926ejs and 1026ejs. + * gas/doc/c-arm.texi: Document them. + +2003-23-12 Paul Brook + + * config/tc-arm.c (arm_archs): Add armv6. + * doc/c-arm.texi: Document -march=armv6. + +2003-12-20 Nick Clifton + + * config/tc-ppc.c (md_apply_fix3): Handle the case where a + .byte directive generates a pc-relative relocation. + +2003-12-19 Nick Clifton + Andreas Schwab + + * messages.c (as_perror): Save errno around library calls. + * input-file.c [BFD_ASSEMBLER]: Set the BFD error to + bfd_error_system_call before each call to as_perror. + (input_file_open): Simplify the error reporting code to just use + as_perror(). + * output-file.c (output_file_create) [BFD_ASSEMBLER]: Set the BFD + error to bfd_error_system_call before calling as_perror. + (output_file_close) [BFD_ASSEMBLER]: Likewise. + (output_file_append) [BFD_ASSEMBLER]: Likewise. + * listing.c (listing_print) [BFD_ASSEMBLER]: Likewise. + +2003-12-19 Kazuhiro Inaoka + + Add m32r-linux and PIC support. Add new ABI that uses RELA. + * configure.in: Add m32r-linux targets. + * configure: Regenerate. + * config/tc-m32r.c (md_parse_option): Add -KPIC option. + (tc_gen_reloc): Added. + (debug_sym, md_estimate_size_before_relax, md_convert_frag, + md_pcrel_from_section, m32r_fix_adjustable): Changed for PIC. + * config/tc-m32r.h (tc_gen_reloc, EXTERN_FORCE_RELOC): Undefined. + (TC_HANDLES_FX_DONE, TC_FIX_ADJUSTABLE, TC_RELOC_RTSYM_LOC_FIXUP): + Defined. + * doc/c-m32r.texi: Document -KPIC option. + * NEWS: Mention the support m32r Linux and PIC. + +2003-12-18 Nick Clifton + + * input-file.c (input_file_open): Remove call to stat(). + Add a check for getc() failing, and catch the case where the + failure is due to an attempt to read a directory. + +2003-12-18 Richard Sandiford + + * config/tc-mips.c (mips_need_elf_addend_fixup): Delete. + (md_apply_fix3): Remove bfd_install_relocation workarounds. + (tc_gen_reloc): Likewise. Factor handling of pc-relative relocations + and treat fx_addnumber as relative to the relocation address. + +2003-12-18 Richard Sandiford + + * config/tc-mips.c (s_change_section): When parsing the MIPS-specific + .section syntax, map SHT_MIPS_DWARF to SHT_PROGBITS. + +2003-12-17 Mark Mitchell + + * config/tc-arm.c (arm_archs): Change "armv6" to "armv6j". + * doc/c-arm.texi (ARM Options): Likewise. + +2003-12-17 Nick Clifton + + * config/tc-m32r.c (error_explicit_parallel_conflicts): Rename + to 'ignore_parallel_conflicts'. + (md_longopts): Change option names as well. + (md_parse_option): Separate the warn_explicit and ignore + parallel conflicts options. + (md_show_usage): Update descriptions of these options. + (first_writes_to_seconds_operands): Do not run this check if + ignoring parallel conflicts. + (assemble_two_insns): Remove code that checked + error_explicit_parallel_conflicts. + * doc/c-m32r.texi: Update descriptions of the options. + +2003-12-16 Dmitry Semyonov + + * tc-arm.c (do_adr): Do not adjust pc by -8 if TE_WINCE is + defined. + (do_adrl): Likewise. + +2003-12-15 Christian Groessler + + * config/tc-z8k.c (struct z8k_exp): Remove, not used anywhere. + (ctrl_table): Add "flags" keyword and some comments. + (flag_table): Convert to uppercase. + (get_flags_operand): Be case insensitive. + (get_interrupt_operand): Be case insensitive. Support notation + where the inperrupt arguments are separated by commas. + (get_operands): Check whether get_flags_operand consumed all + arguments. Return failure if get_ctrl_operand didn't recognize a + valid control register. + (get_specific): Add case CLASS_CTRL: Test for valid control + register for ldctlb opcode. + (build_bytes): Check for valid control registers. + +2003-12-15 Nick Clifton + + * config/obj-aout.c (obj_crawl_symbol_chain): Skip defined + symbols which resolve to symbolic values. + +2003-12-13 Alan Modra + + * config/obj-elf.c: Convert to C90, remove unneeded prototypes and + casts. Formatting. + * config/obj-elf.h: Remove PARAMS. + + * read.c (s_lcomm_internal): Make global. + * read.h (s_lcomm_internal): Declare. + * config/obj-elf.c (elf_pseudo_table): Handle lcomm. + (obj_elf_lcomm): New function. + +2003-12-13 Alan Modra + + * read.c: Remove unneeded prototypes. + (s_comm): Split out code to.. + (s_comm_internal): ..here. Tidy error returns. Rearrange so that + "name" from input line may be used in more places. Merge code + testing for valid size from elf_common. Merge code from + s_lcomm_internal. Call comm_parse_extra. + (bss_alloc): New function, split out of s_lcomm_internal and + elf_common. + (parse_align): Likewise. + (s_lcomm_internal): Rewrite. + (s_lcomm, s_lcomm_bytes): Use s_comm_internal. + * read.h (bss_alloc, parse_align, s_comm_internal): Declare. + * config/obj-elf.c (elf_common): Split out code to.. + (elf_common_parse): ..here. Remove code common to s_comm_internal, + parse_align and bss_alloc. Rearrange and Tidy. + * config/tc-alpha.h (TC_IMPLICIT_LCOMM_ALIGNMENT): Define. + +2003-12-10 Zack Weinberg + + * tc-ppc.c (md_assemble): Rewrite comment about optional operands + to indicate that 'all or none' is also handled. Pluralize a + word in another comment. + +2003-12-10 Paul Brook + + * config/tc-arm.c (FPU_MAVERICK): Define. + (FPU_ARCH_MAVERICK): Define. + (arm_float_abi): Define. + (mfloat_abi_opt): New variable. + (md_begin): Use them. + (arm_opts): Add msoft-float and mhard-float. + (arm_cpus): Use FPU_ARCH_MAVERICK. + (arm_fpus): Add maverick. + (arm_float_abis): Add. + (arm_parse_float_abi): New function. + (arm_long_options): Add mfloat-abi. + * doc/as.texinfo: Document -mfloat-abi=. + * doc/c-arm.text: Ditto. Menution -fpu=maverick. + +2003-12-09 Paul Brook + + * config/tc-arm.c (do_umaal): Fix typo. + +2003-12-06 Kazu Hirata + + * dwarf2dbg.c: Convert to ISO-C. + * write.c: Likewise. + * write.h: Likewise. + +2003-12-06 Richard Sandiford + + * config/tc-mips.c (macro): Switch misordered call to frag_grow() + and setting of tc_fr_offset. + +2003-12-05 Ricardo Anguiano + Mark Mitchell + Richard Earnshaw + + Add V6 support. + * config/tc-arm.c (ARM_EXT_V6): New macro. + (ARM_ARCH_V6): Likewise. + (SHIFT_IMMEDIATE): Likewise. + (SHIFT_LSL_OR_ASR_IMMEDIATE): Likewise. + (SHIFT_ASR_IMMEDIATE): Likewise. + (SHIFT_LSL_IMMMEDIATE): Likewise. + (do_cps): New function. + (do_cpsi): Likewise. + (do_ldrex): Likewise. + (do_pkhbt): Likewise. + (do_pkhtb): Likewise. + (do_qadd16): Likewise. + (do_rev): Likewise. + (do_rfe): Likewise. + (do_sxtah): Likewise. + (do_sxth): Likewise. + (do_setend): Likewise. + (do_smlad): Likewise. + (do_smlald): Likewise. + (do_smmul): Likewise. + (do_ssat): Likewise. + (do_usat): Likewise. + (do_srs): Likewise. + (do_ssat16): Likewise. + (do_usat16): Likewise. + (do_strex): Likewise. + (do_umaal): Likewise. + (do_cps_mode): Likewise. + (do_cps_flags): Likewise. + (do_endian_specifier): Likewise. + (do_pkh_core): Likewise. + (do_sat): Likewise. + (do_sat16): Likewise. + (insns): Add V6 instructions. + (do_t_cps): New function. + (do_t_cpy): Likewise. + (do_t_setend): Likewise. + (THUMB_CPY): New macro. + (tinsns): Add V6 instructions. + (decode_shift): Handle V6 restricted-shift options. + (thumb_mov_compare): Support CPY. + (arm_cores): Add arm1136js and arm1136jfs. + (arm_archs): Add armv6. + (arm_fpus): Add arm1136jfs. + * doc/c-arm.texi (ARM Options): Mention arm1136js, arm1136jfs, and + armv6 options. + +2003-12-06 Christian Groessler + + * config/tc-z8k.c (parse_reg): Be case insensitive when checking + register names. + (get_ctrl_operand): Be case insensitive when checking ctrl names. + +2003-12-05 Nick Clifton + + * config/tc-sh.c (md_show_usage): Fix compilation errors + introduced by the previous delta. + +2003-12-03 Alexandre Oliva + + * config/tc-sh.c: Add support for sh4a and no-fpu variants. + * testsuite/gas/sh/basic.exp: Call tests for sh4a. + * testsuite/gas/sh/{err-sh4a-fp.s, err-sh4a.s, + err-sh4al-dsp.s, sh4a-dsp.d, sh4a-dsp.s, sh4a-fp.d, + sh4a-fp.s, sh4a.d, sh4a.s, sh4al-dsp.d, sh4al-dsp.s: + New files, tests for sh4a and related variants. + +2003-12-05 Michael Snyder + + * config/tc-sh.c (md_show_usage): Mention new -isa options. + * doc/c-sh.texi: Document new -isa options. + * doc/c-sh64.texi: Ditto. + * NEWS: Mention new support for sh4a. + +2003-12-03 H.J. Lu + + * config/tc-alpha.c (s_alpha_end): Don't crash if there is no + matching .ent. + +2003-12-04 Alan Modra + + * tc.h (md_pcrel_from): Don't declare if defined as a macro. + +2003-12-03 Kazuhiro Inaoka + + * config/tc-m32r.h : Add support for new machine m32r2. + * config/tc-m32r.c : Likewise. + Add new command line switches and directives to allow endian-ness + to be selected and some warnings to be turned into errors. + (line_separator_chars) : Use '!'. + * doc/c-m32r.texi: Document new switches and directives. + * NEWS: Mention new support. + +2003-12-03 Dave Airlie + + * configure.in: Likewise. + * configure: Regenerate. + * config/tc-vax.c (md_shortopts): Add 'Q'. + (md_parse_option): Ignore 'Q' for now. + +2003-12-02 Kazu Hirata + + * messages.c: Convert to ISO-C. + * obj.h: Likewise. + * output-file.c: Likewise. + * output-file.h: Likewise. + * sb.c: Likewise. + * sb.h: Likewise. + * stabs.c: Likewise. + * subsegs.c: Likewise. + * subsegs.h: Likewise. + * tc.h: Likewise. + +2003-12-02 Kazu Hirata + + * config/obj-elf.c: Remove ARGSUSED. + +2003-12-02 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2003-11-30 Kazu Hirata + + * symbols.c: Convert to ISO-C. + * symbols.h: Likewise. + +2003-11-28 Christian Groessler + + * config/tc-z8k.c: Convert to ISO-C. + * config/tc-z8k.h: Likewise. + +2003-11-27 Kazu Hirata + + * read.c: Convert to ISO-C. + * read.h: Likewise. + +2003-11-27 Nick Clifton + + * config/tc-sh.c (sh_elf_cons): If md_cons_align is defined + call it to make sure that the constants that are going to be + emitted are correctly aligned. + +2003-11-27 Alexandre Oliva + + * config/tc-frv.c (md_pcrel_from_section): Don't adjust when + referencing symbol in a different section. + +2003-11-26 Christian Groessler + + * config/tc-z8k.c (s_segm): Fix indentation. + (md_apply_fix3): Likewise. + (cc_names): Add alias names for the names generated by the + disassembler. + (get_cc_operand): Be case insensitive. + (get_operands): Improve error handling for cc operands. + (check_operand): Not used, remove. + (md_assemble): Remove unused variable prev_opcode. Skip + whitespace until end-of-line only. Restore *op_end after call to + hash_find. + +2003-11-26 Nick Clifton + + * config/tc-h8300.c (get_operand): Allow er4-er7 for ldm/stm + instructions on the H8SX. + +2003-11-25 Kazu Hirata + + * config/tc-h8300.c (h8_exp): Remove. + +2003-11-25 Asgari Jinia + + * config/tc-h8300.c (md_assemble): Check operands validity for + ldm/stm. + (get_operand): Check register pair's validity as per technical + note TN-H8*-193A/E from Renesas for H8s and for H8Sx manual. + +2003-11-24 Kazu Hirata + + * listing.c: Convert to ISO-C. + * listing.h: Likewise. + * macro.c: Likewise. + * macro.h: Likewise. + +2003-11-24 Jakub Jelinek + + * app.c (do_scrub_chars): Add PUT (ch) and ch = GET () + when transitioning from states 14 or 15 to 0 or 1. + +2003-11-23 Kazu Hirata + + * hash.c: Convert to ISO-C. + * hash.h: Likewise. + * input-file.c: Likewise. + * input-file.h: Likewise. + * input-scrub.c: Likewise. + * itbl-ops.c: Likewise. + * itbl-ops.h: Likewise. + +2003-11-23 Kazu Hirata + + * config/tc-h8300.c (Hmode): Make it global. + (Smode): Likewise. + (Nmode): Likewise. + (SXmode): Likewise. + +2003-11-22 Kazu Hirata + + * ehopt.c: Convert to ISO-C. + * emul.h: Likewise. + * expr.c: Likewise. + * expr.h: Likewise. + * flonum-copy.c: Likewise. + * flonum-mult.c: Likewise. + * flonum.h: Likewise. + * frags.c: Likewise. + * frags.h: Likewise. + +2003-11-22 Alan Modra + + * doc/c-ppc.texi (PowerPC-Pseudo): Add section. + + * app.c (do_scrub_chars): Revert 2003-04-23 and 2003-04-22. + +2003-11-21 Kazu Hirata + + * ecoff.c: Convert to ISO-C. + * ecoff.h: Likewise. + +2003-11-22 Alan Modra + + * config/tc-ppc.c (parse_cpu): New function, broken out from.. + (md_parse_option): ..here. + (ppc_setup_opcodes): New function, broken out from.. + (md_begin): ..here. + (ppc_machine): Implement .machine pseudo op. + +2003-11-20 Kazu Hirata + + * depend.c: Convert to ISO-C. + * dwarf2dbg.c: Likewise. + * dwarf2dbg.h: Likewise. + +2003-11-20 Kazu Hirata + + * app.c: Convert to ISO-C. + * as.h: Likewise. + * atof-generic.c: Likewise. + * bignum-copy.c: Likewise. + * bignum.h: Likewise. + * cgen.c: Likewise. + * cgen.h: Likewise. + * cond.c: Likewise. + +2003-11-20 DJ Delorie + + * config/tc-sh64.c (shmedia_frob_section): Only frob elf32 + sections. + +2003-11-19 Kazu Hirata + + * config/tc-h8300.c: Make some functions and global + variables static appropriately. + +2003-11-19 Kazu Hirata + + * config/obj-ieee.c: Remove duplicate prototypes. + * config/tc-h8300.c: Likewise. + +2003-11-19 Kazu Hirata + + * config/tc-h8300.c: Convert to ISO-C. + * config/tc-h8300.h: Likewise. + +2003-11-19 Kazu Hirata + + * config/tc-mcore.h: Remove prototypes already in tc.h. + * config/tc-tic4x.c: Likewise. + +2003-11-19 Kazu Hirata + + * config/tc-arc.c: Remove a local prototype of atof_ieee. + * config/tc-ip2k.c: Likewise. + * config/tc-iq2000.c: Likewise. + * config/tc-tic30.c: Remove a comment. + +2003-11-19 Bob Wilson + + * config/tc-xtensa.c (xg_emit_insn): Include "dwarf2dbg.h" and add + call to dwarf2_emit_insn. + +2003-11-18 Maciej W. Rozycki + + * config/tc-mips.c (macro): Handle new macros: "lca" and "dlca" + for loading addresses using CALL relocations. + Don't emit CALL relocations when a base register is used. + +2003-11-15 Maciej W. Rozycki + + * config/tc-mips.c: Formatting fixes. + +2003-11-14 Ben Elliston + + * config/tc-arm.c (arm_elf_change_section): Not static. + +2003-11-13 Nick Clifton + + * tc-arm.c (mapping_state): New function. Emit a mapping + symbol if necessary. + (arm_elf_change_section): New function. Intercept section + changes and generate mapping symbols. + (s_bss): Likewise. + (s_arm_elf_cons): Likewise. + (opcode_select): Choose the correct mapping state. + (md_assemble): Likewise. + * tc-arm.h (md_elf_section_change_hook): Define. + * doc/c-arm.texi (ARM Mapping Symbols): New node. + * NEWS: Mention new feature. + +2003-11-12 Daniel Jacobowitz + + * Makefile.am (install, install-info, RECURSIVE_TARGETS): Define. + * doc/Makefile.am (install-info): Define. + + * aclocal.m4: Regenerate. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + +2003-11-11 Dmitry Semyonov + + * configure.in: Add support for arm-wince-pe target. + * configure: Regenerate. + +2003-11-11 Jan Hubicka + + * config/tc-i386.c (tc_i386_fix_adjustable): + +2003-11-10 Alan Modra + + * config/tc-ia64.c (ia64_handle_align): Remove bogus be_nop. + +2003-11-10 Alan Modra + + * README: Update bug report address. Move bug reporting info to + binutils/README. + +2003-11-07 Christian Groessler + + * doc/c-z8k.texi: Document command-line options. Fix byte + register names. Document '.z8001' and '.z8002' directives. + Extend addressing modes documentation. + +2003-11-07 Jonathan R. Grant + + * input-file.c (input_file_open): Use "No such file" error + message. + +2003-11-06 Pete Gonzalez + + * config/tc-arm.texi (struct reg_entry): Add new field 'builtin'. + (rn_table, iwmmxt_table, cp_table, cn_table, fn_table, sn_table, + dn_table, mav_mvf_table, mac_mvd_table, mav_mvfx_table, + mav_mvax_table, mav_dspc_table): Initialise new field. + (insert_reg_alias): Initialise new field. + (md_pseudo_table): Add "unreq" entry. + (s_unreq): New function: Undo the effects of a previous .req. + * doc/c-arm.texi: Document new pseudo op. + * NEWS: Mention new feature. + +2003-11-06 Bruno Rohee + + * config/obj-vms.c: Fix "the the" typo. + * doc/c-arm.texi: Likewise. + +2003-11-06 Nick Clifton + + * config/obj-vms.c: Convert to ISO-C. + +2003-11-05 Alan Modra + + * config/tc-ppc.h (TC_FORCE_RELOCATION): Only define for ELF and XCOFF. + +2003-10-31 Christian Groessler + + * config/tc-i860.c (md_pcrel_from): Fix typo in comment. + +2003-10-29 Phil Edwards + + * configure.in (arm-*-vxworks, i386-*-vxworks, mips-*-vxworks, + ppc-*-vxworks, ppc-*-windiss): Remove separate outdated stanzas. + (*-*-vxworks, *-*-windiss): Use common stanzas, all ELF. + * configure: Regenerated. + +2003-10-27 Kazu Hirata + + * ChangeLog: Fix typos. + * ChangeLog-9295: Likewise. + * as.c: Fix comment typos. + * as.h: Likewise. + * atof-generic.c: Likewise. + * bit_fix.h: Likewise. + * frags.h: Likewise. + * hash.c: Likewise. + * input-file.c: Likewise. + * input-scrub.c: Likewise. + * itbl-ops.c: Likewise. + * itbl-parse.y: Likewise. + * listing.c: Likewise. + * macro.h: Likewise. + * read.c: Likewise. + * sb.c: Likewise. + * sb.h: Likewise. + * symbols.c: Likewise. + * symbols.h: Likewise. + +2003-10-27 Stephane Carrez + + * config/tc-m68hc11.c: Convert to ISO C90. + * config/tc-m68hc11.h: Likewise. + +2003-10-26 Kazu Hirata + + * doc/c-sh64.texi: Fix a typo. + +2003-10-26 Kazu Hirata + + * doc/c-alpha.texi: Fix typos. + * doc/c-ia64.texi: Likewise. + * doc/c-mmix.texi: Likewise. + * doc/c-sh64.texi: Likewise. + * doc/c-xtensa.texi: Likewise. + * doc/internals.texi: Likewise. + +2003-10-24 H.J. Lu + + * config/obj-elf.c (obj_elf_change_section): Allow SHF_ALLOC + for .interp, .strtab and .symtab. Use specified section + attributes. + +2003-10-22 Andreas Schwab + H.J. Lu + Jim Wilson + + * config/tc-ia64.c (update_qp_mutex): New. + (note_register_values): Properly handle one of PRs in compare + is PR0. Don't add a mutex relation for .and.orcm/.or.andcm. + Clear mutex relation for .none/.unc. Don't clear mutex relation + on predicated compare. + +2003-10-21 Wouter van Heyst + + * config/tc-arm.c (all_reg_maps): Correct text describing Maverick + register requirements. + (md_begin): Remove F_SOFT_FLOAT if enabling MAVERICK FP. + +2003-10-21 Peter Barada + Bernardo Innocenti + + * config/tc-m68k.c: Add MCF528x (MCFv4) support. + * config/m68k-parse.h: Likewise. + * NEWS: Mention the new support. + * doc/c-m68k.texi: Document new processor selection switch. + +2003-10-19 Thiemo Seufer + + * config/tc-mips.c (normalize_constant_expr): New function to fix sign + extensions broken by gas' expression evaluation of constants. + (check_absolute_expr): Use it. + (mips_ip): Likewise. + +2003-10-18 Hans-Peter Nilsson + + Generate BFD_RELOC_MMIX_PUSHJ_STUBBABLE for PUSHJ when possible. + * doc/c-mmix.texi (MMIX-Opts): Document --no-pushj-stubs and + --no-stubs. + * config/tc-mmix.c: Include limits.h. Expand on mmix_relax_table + comment. + (expand_op, mmix_next_semicolon_is_eoln): Fix head comment. + (pushj_stubs): New variable. + (OPTION_NOPUSHJSTUBS, STATE_PUSHJSTUB, PUSHJSTUB_MIN) + (PUSHJSTUB_MAX): New macros. + (md_longopts): New options "--no-pushj-stubs" and synonym + "--no-stubs". + (mmix_relax_table): Handle new entry for STATE_PUSHJSTUB. + (md_parse_option): Handle OPTION_NOPUSHJSTUBS. + (md_estimate_size_before_relax): Modify STATE_PUSHJ state for + PUSHJ stub relaxation. + (md_convert_frag): Handle STATE_PUSHJSTUB. + (md_apply_fix3): Handle BFD_RELOC_MMIX_PUSHJ_STUBBABLE. + (tc_gen_reloc): Ditto. + (mmix_md_relax_frag): Handle PUSHJ stub relaxation. + * config/tc-mmix.h (TC_SEGMENT_INFO_TYPE): Define. + (struct mmix_segment_info_type): New. + +2003-10-17 Paul Dale + Bernardo Innocenti + + * config/tc-m68k.c (make_pcrel_absolute): Enforce + PC-relative jumps with --pcrel. + (md_convert_frag_1): Likewise. + (md_create_long_jump): Likewise. + +2003-10-17 Shrinivas Atre + + * config/tc-h8300.c (PSIZE): Correct for Normal mode. + (get_operand): Accept both 16 bit 32 bit registers as pointer + registers, when operating in Normal mode. + (fix_operand_size): Make default address size 16 for Normal mode. + +2003-10-17 Ian Lance Taylor + + * config/tc-arm.c (do_iwmmxt_byte_addr): Reject control + registers. + (do_iwmmxt_word_addr): With a control register, reject conditional + execution and reject a non-word size. + +2003-10-16 Peter Bergner + + * configure.in: Set em=linux for ppc-*-linux-gnu* target. + * configure: Regenerate. + +2003-10-15 Alan Modra + + * doc/as.texinfo (Align): Correct list of byte targets. + +2003-10-15 Thiemo Seufer + + * config/tc-mips.c (macro_build_ldst_constoffset,load_register,macro): + Fix indentation. Better error message. + +2003-10-14 Bob Wilson + + * config/tc-xtensa.c (xtensa_create_property_segments): Remove bfd + argument in call to xtensa_get_property_section_name. Formatting. + +2003-10-11 Kaz Kojima + + * config/tc-sh.h (sh_coff_reloc_mangle): Delete an extra + parenthesis. + +2003-10-11 Kaz Kojima + + * config/tc-sh.c: Convert to ISO C90. Remove unnecessary + prototypes and casts. + * config/tc-sh.h: Likewise. + * config/tc-sh64.c: Likewise. + * config/tc-sh64.h: Likewise. + +2003-10-08 Dave Brolley + + * config/tc-frv.c (fr550_check_insn_acc_range): New function. + (fr550_check_acc_range): New function. + (md_assemble): Call fr550_check_acc_range. + +2003-10-08 Dave Brolley + + * config/tc-frv.c: Handle DEFAULT_CPU_FR550. + (md_parse_option): Handle OPTION_CPU==fr550. + (md_show_usage): Document fr550. + +2003-10-08 Philippe De Muyter + + * as.c (use_gnu_debug_info_extensions) : New variable. + (parse_args) : Accept new --gstabs+ option, and set + `use_gnu_debug_info_extensions'. + (show_usage) : Document --gstabs+ option. + * as.h (use_gnu_debug_info_extensions) : New extern declaration. + * stabs.c (stabs_generate_asm_file) : If + `use_gnu_debug_info_extensions' is set, add the compilation + directory to the stabs debug info. + * doc/as.texinfo : Document --gstabs+ option. + * NEWS: Mention new feature. + +2003-10-06 Matt Thomas + + Switch NetBSD/hppa to use Linux PA-RISC ELF ABI and + assembler syntax. + + * tc-hppa.c: Add "%farg[0-3]", "%fret", "%t[1-4]", "%tf[1-4]" + register names. Change all "defined (TE_LINUX)" to + "(defined (TE_LINUX) || defined (TE_NETBSD))". + + * tc-hppa.h: Make NetBSD use "elfXX-hppa-linux" bfd target. + Remove NetBSD's use of LABELS_WITHOUT_COLONS. + +2003-10-06 Robert Millan + + * configure.in: Match GNU/KNetBSD with new knetbsd*-gnu triplet. + * configure: Regenerate. + +2003-10-05 Nick Clifton + + * as.c (parse_args): Revert patch to change handling of -f + option. Its behaviour is mandated by the POSIX 2 spec. + +2003-10-04 Christian Groessler + + * tc-z8k.c (newfix): Tell fix_new_exp about pc relativeness. + (md_apply_fix3): Fix R_JR, R_DISP7, and R_CALLR cases. + (md_pcrel_from): This function now gets called. Supply return + value. + +2003-10-04 Nick Clifton + + * as.c: Convert to ISO C90. + +2003-10-04 Nick Clifton + + * as.c (std_shortopts): Remove 'f'. + (std_longopts): Add 'f'. Doing this prevents -f being + acecpted as an alias for -f. + +2003-10-04 Danny Smith + + * config/obj-coff.c (obj_coff_section [BEF_ASSEMBLER]): + Make 'r' mean readonly data. + +2003-10-01 Thiemo Seufer + + * config/tc-mips.c (macro_build_ldst_constoffset,load_register,macro): + Unbreak overflow checks. + +2003-10-01 Chris Demetriou + + * config/tc-mips.c (s_cpreturn): Correct errors in comment. + +2003-10-01 Thiemo Seufer + + * config/tc-mips.c (macro_build_ldst_constoffset): Fix sign extension + tests. + (load_register): Likewise. + (macro): Likewise. + +2003-09-30 Chris Demetriou + + * config/tc-mips.c (mips_ip): Capitalize first word of + existing condition code warning, and add condition code + warnings for .ps instructions, and for bc1any[24][tf]. + +2003-09-30 Chris Demetriou + + * NEWS: Mention support for MIPS64 Release 2. + +2003-09-30 Chris Demetriou + + * NEWS: Add an indication of the cutoff for 2.14. + +2003-09-30 Chris Demetriou + + * configure.in (mipsisa64r2, mipsisa64r2el, mipsisa64r2*): New CPUs. + * configure: Regenerate. + * config/tc-mips.c (imm2_expr): New variable. + (md_assemble, mips16_ip): Initialize imm2_expr. + (ISA_HAS_64BIT_REGS, ISA_HAS_DROR, ISA_HAS_ROR): Add ISA_MIPS64R2. + (macro_build): Handle +A, +B, +C, +E, +F, +G, and +H format operands. + (macro): Handle M_DEXT and M_DINS. + (validate_mips_insn): Handle +E, +F, +G, +H, and +I format operands. + (mips_ip): Likewise. + (OPTION_MIPS64R2): New define. + (md_longopts): New entry for -mips64r2 (OPTION_MIPS64R2). + OPTION_ASE_BASE): Increase to compensate for OPTION_MIPS64R2. + (md_parse_option): Handle OPTION_MIPS64R2. + (s_mipsset): Handle setting "mips64r2" ISA. + (mips_cpu_info_table): Add mips64r2. + (md_show_usage): Document -mips64r2 option. + * doc/as.texinfo: Docuemnt -mips64r2 option. + * doc/c-mips.texi: Likewise. + +2003-09-27 John David Anglin + + * config/tc-hppa.c (pa_ip): Check for invalid 64-bit conditions. + +2003-09-26 Matt Thomas + + * config/tc-vax.c (md_shortopts): Fix a typo. Remove 'K'. + (OPTION_PIC): Define. + (md_longopts): Add "pic" option. + (md_parse_option): Change 'K' to OPTION_PIC. + +2003-09-23 Alan Modra + + * config/obj-elf.c (obj_elf_change_section): Adjust for + _bfd_elf_get_sec_type_attr changes. Allow SHF_MERGE and SHF_STRINGS + to be set when defaults are not. Don't set attr from defaults if + old_sec. + +2003-09-18 Thiemo Seufer + + * config/tc-mips.c (macro_build_ldst_constoffset): Don't silently + truncate values which won't fit im 32 bits. + (load_register): Likewise. + (macro): Likewise. + +2003-09-17 Dmitry Diky + + * config/tc-msp430.c (MAX_OP_LEN): Set to 256. + (msp430_operands): Remove redundant l2[16] within switch-case. + +2003-09-16 Ralf Corsepius + + * configure.in: Handle arm-*-rtems* and thumb-*rtems*. + * configure: Regenerate. + +2003-09-14 Thiemo Seufer + + * config/tc-mips.c (HAVE_64BIT_ADDRESS_CONSTANTS): Remove. + (macro_build_ldst_constoffset): Sign-extend 32-bit constants. Change + the function prototype. + (load_register): Likewise. Simplify the checks for sign-extended + constants. + (macro): Likewise. Fix code generation for 64-bit address constants + outside the 32-bit compatibility space. Adjust + macro_build_ldst_constoffset calls. + (s_cprestore): Adjust macro_build_ldst_constoffset call. + +2003-09-11 Bob Wilson + + * config/tc-xtensa.c (insn_labels, free_insn_labels, saved_insn_labels, + literal_syms): New global variables. + (xtensa_define_label, add_target_symbol, xtensa_find_label, + map_over_defined_symbols, is_loop_target_label, + xtensa_mark_target_fragments, xtensa_move_frag_symbol, + xtensa_move_frag_symbols, defined_symbols, branch_targets): Delete. + (xtensa_begin_directive): Call md_flush_pending_output. Move symbols + from insn_labels to saved_insn_labels when entering a literal region. + (xtensa_end_directive): Call md_flush_pending_output. Restore + insn_labels list when leaving a literal region. + (xtensa_literal_position): Call xtensa_clear_insn_labels. + (xtensa_literal_pseudo): Add check to disallow .literal inside a + literal region. Move insn_labels to saved_insn_labels and then restore + insn_labels on exit. + (xg_add_branch_and_loop_targets): Replace add_target_symbol calls with + code to set is_loop_target or is_branch_target flag on the symbol + (xtensa_create_literal_symbol): Call xtensa_add_literal_sym. + (xtensa_add_literal_sym, xtensa_add_insn_label, + xtensa_clear_insn_labels): New functions. + (xtensa_move_labels): Remove old_frag and old_offset arguments. Add + loops_ok argument. Rewrite to use insn_labels list instead of + calling xtensa_find_label and to check the is_loop_target flag on + symbols when loops_ok is false. + (xtensa_frob_label): Remove call to xtensa_define_label. Add call + to either xtensa_add_literal_sym or xtensa_add_insn_label. Adjust + call to xtensa_move_labels. Propagate is_branch_target and + is_loop_target flags from symbols to frags. + (xtensa_flush_pending_output): Call xtensa_clear_insn_labels. + (md_assemble): Use xtensa_move_labels with loops_ok = FALSE when + aligning a loop instruction. Adjust call to xtensa_move_labels for + aligning entry instructions. Add call to xtensa_clear_insn_labels. + (xtensa_end): Remove call to xtensa_mark_target_fragments. + (xtensa_move_literals): Replace xtensa_move_frag_symbols call with + code to use new literal_syms list. + * config/tc-xtensa.h (xtensa_symfield_type): Add is_loop_target and + is_branch_target flags. + +2003-09-09 Bob Wilson + + * config/tc-xtensa.c (xtensa_mark_literal_pool_location): Remove + "move_labels" argument and corresponding call to xtensa_move_labels. + (md_assemble): Add a separate call to xtensa_move_labels and remove + argument for call to xtensa_mark_literal_pool_location. + (xtensa_literal_position, xtensa_switch_to_literal_fragment): Fix + calls to xtensa_mark_literal_pool_location. + (xtensa_create_local_symbol): Delete and inline the code into... + (xtensa_create_literal_symbol): ...here. + (xtensa_frob_label): Combine conditionals. + (expression_maybe_register, xtensa_symbol_new_hook, + fix_new_exp_in_seg): Use symbol_get_tc. + +2003-09-09 Bob Wilson + + * config/tc-xtensa.c (xtensa_literal_pseudo): Remove code for + combining identical literals. + (expression_maybe_register): Remove call to find_lit_sym_translation. + (is_duplicate_expression, cache_literal, is_duplicate_literal, + add_lit_sym_translation, find_lit_sym_translation): Delete. + +2003-09-07 Nick Clifton + + * doc/as.texinfo (Comments): Comment character for PPC is #. + +2003-09-06 Stephane Carrez + + PR savannah/4358: + * config/tc-m68hc11.c (s_m68hc11_relax): Use 2 for size to avoid + overflow complain. + +2003-09-05 Richard Sandiford + + * config/tc-frv.c (md_pcrel_from_section): Heed TC_FORCE_RELOCATION. + +2003-09-04 Nick Clifton + + * config/tc-v850.c (set_machine): Accept v850e1 machine number. + (md_pseudo_table): Add .v850e1 pseudo op. + (md_show_usage): Document -mv850e1 switch. + (md_parse_option): Accept -mv850e1 switch. + (md_begin): Allow TARGET_CPU to be v850e1. + * doc/c-v850.texi: Document -mv850e1 switch and .v850e1 pseudo op. + * NEWS: Mention support for v850e1. + +2003-09-04 Alan Modra + + * config/tc-ppc.c (md_parse_option): Add PPC_OPCODE_ANY to existing + ppc_cpu selection rather than replacing. + (ppc_set_cpu): Ignore and preserve PPC_OPCODE_ANY in ppc_cpu. + (md_begin): When PPC_OPCODE_ANY, insert all opcodes in ppc_hash. + +2003-09-03 Robert Millan + + * configure.in: Match GNU/KFreeBSD with new kfreebsd*-gnu + triplet. + * configure: Regenerate. + +2003-09-02 Daniel Jacobowitz + + * configure.in: Update AC_PREREQ to 2.57. Use AC_CONFIG_FILES + and AC_CONFIG_COMMANDS instead of the three-argument AC_OUTPUT. + Specify AC_CONFIG_AUX_DIR. + * aclocal.m4: Regenerated with aclocal-1.7. + * configure: Regenerated with autoconf 2.57. + * Makefile.in, doc/Makefile.in: Regenerated with automake-1.7. + +2003-08-29 Jakub Jelinek + + * dw2gencfi.c (cfi_pseudo_table): Add cfi_window_save. + (dot_cfi, output_cfi_insn): Handle DW_CFA_GNU_window_save. + (output_cie): Don't use DW_EH_PE_pcrel if neither DIFF_EXPR_OK + nor tc_cfi_emit_pcrel_expr are defined. + (output_fde): Use tc_cfi_emit_pcrel_expr if available and + DIFF_EXPR_OK is not defined. + * config/tc-sparc.h (TARGET_USE_CFIPOP): Define. + (tc_cfi_frame_initial_instructions, tc_regname_to_dw2regnum, + tc_cfi_emit_pcrel_expr): Define. + (sparc_cfi_frame_initial_instructions, sparc_regname_to_dw2regnum, + sparc_cfi_emit_pcrel_expr): New prototypes. + (sparc_cie_data_alignment): New decl. + (DWARF2_DEFAULT_RETURN_COLUMN, DWARF2_CIE_DATA_ALIGNMENT): Define. + * config/tc-sparc.c: Include dw2gencfi.h. + (sparc_cie_data_alignment): New variable. + (md_begin): Initialize it. + (sparc_cfi_frame_initial_instructions): New function. + (sparc_regname_to_dw2regnum): Likewise. + (sparc_cfi_emit_pcrel_expr): Likewise. + * doc/as.texinfo: Document .cfi_window_save. + + * config/tc-sparc.c (s_common): Cast last argument to long and + change format string to shut up warning. + +2003-08-25 Jason Eckhardt + + * doc/c-i860.texi: Update text about relocatable address expansions. + +2003-08-24 Jason Eckhardt + + * config/tc-i860.c (md_assemble): Use isrc2 from the original + instruction when expanding E_ADDR. + +2003-08-21 Nick Clifton + + * po/tr.po: Updated Turkish translation. + +2003-08-20 Alan Modra + + * config/tc-ppc.c (md_parse_option): Add PPC_OPCODE_ISEL and + PPC_OPCODE_RFMCI to -m440 selected ppc_cpu. + +2003-08-19 Nick Clifton + + * config/tc-arm.c (cp_address_required_here): Add code to handle + unindexed addressing mode. + +2003-08-19 Alan Modra + + * config/tc-ppc.c (md_parse_option): Handle -m440. + (md_show_usage): Add -m440. + (md_apply_fix3): Warning fix. + * doc/c-ppc.texi: Document -m440. + +2003-08-16 Benjamin Kalytta + + * read.c (s_print): Check for NULL. + +2003-08-16 Alan Modra + + * write.c (fixup_segment): When handling an expression involving + the subtraction of two symbols in the same segment, don't clear + fx_pcrel except for TC_M68K. + +2003-08-14 Alan Modra + + * config/tc-i386.h: Remove BFD_ASSEMBLER tests and all !BFD_ASSEMBLER + code. + * config/tc-i386.c: Likewise. + (RELOC_ENUM): Don't define. Replace throughout with enum. + + * dep-in.sed: Remove libintl.h. Ignore include/fopen-*.h + * Makefile.am (POTFILES.in): Unset LC_COLLATE. + Run "make dep-am". + * Makefile.in: Regenerate. + +2003-08-08 Andreas Schwab + + * config/tc-m68k.h (TARGET_USE_CFIPOP) + (DWARF2_DEFAULT_RETURN_COLUMN, DWARF2_CIE_DATA_ALIGNMENT) + (tc_regname_to_dw2regnum, tc_cfi_frame_initial_instructions): + Define. + * config/tc-m68k.c: Include "dw2gencfi.h". + (tc_m68k_regname_to_dw2regnum) + (tc_m68k_frame_initial_instructions): New functions. + +2003-08-08 Dmitry Diky + + * config/tc-msp430.c: Add xW42 and xE42 parts. Sort MPU list + according to gcc order. + +2003-08-07 Jason Eckhardt + + * config/tc-i860.c (i860_check_label): New function. + * config/tc-i860.h (i860_check_label): New prototype. + (tc_check_label): Define macro as i860_check_label. + +2003-08-06 Jason Eckhardt + + * config/tc-i860.c (s_align_wrapper): New function and prototype. + (md_pseudo_table): Change s_align_bytes to s_align_wrapper, remove + surrounding OBJ_ELF ifdef, and re-format slightly. + * doc/c-i860.texi: Document the special .align syntax available + in Intel mode. + +2003-08-06 Jason Eckhardt + + * config/tc-i860.c (i860_handle_align): New function. + * config/tc-i860.h (HANDLE_ALIGN): Define macro. + (MAX_MEM_FOR_RS_ALIGN_CODE): Define macro. + +2003-08-06 Jason Eckhardt + + * config/tc-i860.c (i860_process_insn): Check that instructions + with their dual-bit set are 8-byte aligned. + +2003-08-06 Nick Clifton + + * po/fr.po: Updated French translation. + +2003-08-05 Jason Eckhardt + + * config/tc-i860.c (i860_process_insn): Don't handle dual-bit + setting during flop argument parsing. Instead, do it after + instruction is fully parsed. + +2003-08-05 Jason Eckhardt + + * doc/c-i860.texi: Mention that .dual, .enddual, and .atmp + directives are only available in Intel syntax mode. + +2003-08-05 Jason Eckhardt + + * config/tc-i860.c (s_dual): Accept .dual directive only in + the Intel syntax mode. + (s_enddual): Likewise for .enddual. + (s_atmp): Likewise for .atmp. + +2003-08-04 Alan Modra + + * config/tc-i386.c (i386_intel_operand): Always call i386_index_check + for memory operands. Pass the full operand_string to i386_index_check. + +2003-08-01 Jason Eckhardt + + * config/tc-i860.c: Remove SYNTAX_SVR4 macro and occurrences. + (target_intel_syntax): Declare variable. + (OPTION_INTEL_SYNTAX): Declare macro. + (md_longopts): Add option -mintel-syntax. + (md_parse_option): Set target_intel_syntax. + (md_show_usage): Add -mintel-syntax usage. + (md_begin): Set reg_prefix based on target_intel_syntax. + (i860_process_insn): Skip register prefix only if there is one. + Parse relocatable expressions in either Intel or AT&T syntax based + on target_intel_syntax instead of the SYNTAX_SVR4 macro. + * doc/c-i860.texi: Document -mintel-syntax option and give blurb + about the differences in syntax. + +2003-08-01 Dmitry Diky + + * config/tc-msp430.c (msp430_srcoperand): Extend 'push' bug workaround + to all arches. + +2003-07-30 J"orn Rennecke + + * config/tc-sh.c (md_assemble): For branches, check & update + valid_arch here. + +2003-07-30 Jason Eckhardt + + * config/tc-i860.c: Convert to ISO C90. + +2003-07-30 Rainer Orth + + * read.c (s_space): Revert 2003-07-28 change. + +2003-07-30 Alan Modra + + * config/obj-elf.c (obj_elf_change_section): Allow "x" for .note*. + +2003-07-29 Alan Modra + + * config/tc-sh.c (tc_gen_reloc): Test for R_SH_IND12W only when ELF. + +2003-07-29 Jakub Jelinek + + * config/tc-ppc.c (md_apply_fix3): Fix check for lq insns. + +2003-07-28 H.J. Lu + + * config/obj-elf.c (obj_elf_section_type): Also accept "note". + +2003-07-28 Rainer Orth + + * read.c (s_space): Don't warn about .space 0. + +2003-07-28 Rainer Orth + + * config/tc-mips.c (mips_flag_pdr): Define. + (md_begin) [OBJ_ELF]: Use it to control .pdr creation. + (s_mips_end) [OBJ_ELF]: Likewise. + (md_longopts) [OBJ_ELF]: Define OPTION_PDR, OPTION_NO_PDR. + (md_parse_option) [OBJ_ELF]: Handle them. + (md_show_usage) [OBJ_ELF]: Document -mpdr, -mno-pdr. + + * doc/c-mips.texi (MIPS Opts): Document -mpdr, -mno-pdr. + * doc/as.texinfo (Overview) [MIPS]: Likewise. + +2003-07-25 H.J. Lu + + * config/obj-elf.c (obj_elf_change_section): Update + elf_section_type and elf_section_flags only when they are + specified. + +2003-07-25 H.J. Lu + + * config/obj-elf.c (obj_elf_change_section): Always set section + type and flags. + +2003-07-25 H.J. Lu + + * config/obj-elf.c (special_sections): Removed. + (obj_elf_change_section): Call _bfd_elf_get_sec_type_attr. Set + elf_section_type and elf_section_flags. + (elf_frob_file): Set SHT_GROUP. + + * config/obj-elf.h (obj_sec_set_private_data): New. + + * config/tc-alpha.h (ELF_TC_SPECIAL_SECTIONS): Removed. + * config/tc-ia64.h: Likewise. + * config/tc-m32r.h: Likewise. + * config/tc-m68hc11.h: Likewise. + * config/tc-mcore.h: Likewise. + * config/tc-mips.h: Likewise. + * config/tc-ppc.h: Likewise. + * config/tc-sh64.h: Likewise. + * config/tc-v850.h: Likewise. + * config/tc-xtensa.h: Likewise. + + * config/tc-v850.h (SHF_V850_GPREL): Removed. + (SHF_V850_EPREL): Likewise. + (SHF_V850_R0REL): Likewise. + + * subsegs.c (subseg_get): Call obj_sec_set_private_data if it + is defined. + +2003-07-24 Stephane Carrez + + * config/tc-m68hc11.h (DWARF2_ADDR_SIZE): Use 32-bit address for + debugging symbols so that we handle page memory correctly. + +2003-07-24 Nick Clifton + + * po/fr.po: Updated French translation. + +2003-07-23 Daniel Jacobowitz + + * config/tc-arm.c (arm_archs): Add iwmmxt. + +2003-07-22 H.J. Lu + + * read.c (do_parse_cons_expression): Mark nbytes unused to + silence gcc. + +2003-07-22 Alexandre Oliva + + * config/tc-h8300.c (get_specific): No PCREL8 encoding for bsr/bc + or bsr/bs. + + * config/tc-h8300.c (md_assemble): Make sure characters after + slash and dot are lower-case. + +2003-07-17 Nick Clifton + + * po/es.po: New Spanish translation. + * po/tr.po: New Turkish translation. + * po/opcodes.pot: Regenerate. + +2003-07-16 Alan Modra + + * dwarf2dbg.c (get_frag_fix): Revert 2001-11-15 change. + (generic_dwarf2_emit_offset): Don't define function when + TC__DWARF2_EMIT_OFFSET is defined. + +2003-07-15 Richard Sandiford + + * config/tc-mips.c (hilo_interlocks): True for CPU_RM7000. + (mips_cpu_info_table): Add rm7000 and rm9000 entries. + * doc/c-mips.texi: Document -march=rm9000. + +2003-07-15 Alan Modra + + * config/tc-v850.c (md_assemble): When no reloc, create pcrel fixups + only for V850_OPERAND_DISP operands. + +2003-07-15 Alan Modra + + * frags.c (frag_more): Move segment checks to.. + (frag_alloc_check): ..here. New function. + (frag_append_1_char): Call frag_alloc_check. + +2003-07-14 Nick Clifton + + * po/tr.po: Update with latest version. + * po/POTFILES.in: Regenerate. + * po/gas.pot: Regenerate. + * configure: Regenerate. + +2003-07-14 Nick Clifton + + * config/tc-ip2k.c: Remove inclusion of + * config/tc-tic4x.c: Replace inclusion of with + "safe-ctype.h" and update use of macros. + * Makefile.am: Update dependencies. + * Makefile.in: Regenerate. + +2003-07-11 Alan Modra + + * po/gas.pot: Regenerate. + +2003-07-10 Jakub Jelinek + + * config/tc-ppc.h (DWARF2_LINE_MIN_INSN_LENGTH): Define always. + (TARGET_USE_CFIPOP, tc_cfi_frame_initial_instructions, + tc_regname_to_dw2regnum, DWARF2_DEFAULT_RETURN_COLUMN, + DWARF2_CIE_DATA_ALIGNMENT): Define. + (ppc_cfi_frame_initial_instructions, tc_ppc_regname_to_dw2regnum): New + prototypes. + (ppc_cie_data_alignment): Declare. + * config/tc-ppc.c: Include dw2gencfi.h. + (ppc_cie_data_alignment): Define. + (md_begin): Initialize ppc_cie_data_alignment. + (ppc_cfi_frame_initial_instructions, tc_ppc_regname_to_dw2regnum): New + functions. + * config/tc-s390.h (DWARF2_LINE_MIN_INSN_LENGTH): Define always. + (TARGET_USE_CFIPOP, tc_cfi_frame_initial_instructions, + tc_regname_to_dw2regnum, DWARF2_DEFAULT_RETURN_COLUMN, + DWARF2_CIE_DATA_ALIGNMENT): Define. + (s390_cfi_frame_initial_instructions, tc_s390_regname_to_dw2regnum): + New prototypes. + (s390_cie_data_alignment): Declare. + * config/tc-s390.c: Include dw2gencfi.h. + (s390_cie_data_alignment): Define. + (md_begin): Initialize s390_cie_data_alignment. + (s390_cfi_frame_initial_instructions, tc_s390_regname_to_dw2regnum): + New functions. + +2003-07-10 Alexandre Oliva + + 2002-12-12 Alexandre Oliva + * config/tc-mn10300.h (EXTERN_FORCE_RELOC): Don't define to zero. + 2001-05-09 Alexandre Oliva + * configure.in (am33_2.0, mn10300-*-linux*): Added. + * configure: Rebuilt. + * config/tc-mn10300.h (TARGET_FORMAT) [TE_LINUX]: Define to + elf32-am33lin. + * config/tc-mn10300.c (md_begin) [TE_LINUX]: Choose AM33/2.0 + by default. + +2003-07-09 Alexandre Oliva + + 2003-02-25 Alexandre Oliva + * config/tc-mn10300.c (mn10300_check_fixup): Set GOT_PCREL type + for subtracts from GLOBAL_OFFSET_TABLE that could not be + simplified. + 2002-07-18 Alexandre Oliva + * config/tc-mn10300.c (mn10300_check_fixup): Accept subtracts that + could not be simplified. + (tc_gen_reloc): Turn an absolute fx_subsy into part of fx_offset. + 2001-11-04 Alexandre Oliva + * config/tc-mn10300.h (TC_RELOC_RTSYM_LOC_FIXUP): Don't adjust + BDF_RELOC_MN10300_GOT32. + * config/tc-mn10300.c (mn10300_fix_adjustable): If + TC_RELOC_RTSYM_LOC_FIXUP doesn't hold, it's not adjustable. + 2001-05-09 Alexandre Oliva + * config/tc-mn10300.c (mn10300_parse_name): Don't return a + symbol if we know its value. + 2001-05-09 Alexandre Oliva + * config/tc-mn10300.h (GLOBAL_OFFSET_TABLE_NAME): Remove + duplicate underscore prefix. + 2001-05-09 Alexandre Oliva + * config/tc-mn10300.c (mn10300_parse_name): Store relocation + type in X_md, not X_add_number. Zero X_add_number. + (mn10300_check_fixup): Extract relocation type from X_md. + * config/tc-mn10300.h: Update comment. + 2001-04-14 Alexandre Oliva + * config/tc-mn10300.h (O_GOTOFF, O_PLT, O_GOT): Replace with... + (O_PIC_reloc): this. + * config/tc-mn10300.c (mn10300_PIC_related_p): Use it. + (mn10300_check_fixup): Likewise. + (mn10300_parse_name): Set X_add_number to relocation type. + * config/tc-mn10300.h (DIFF_EXPR_OK, GLOBAL_OFFSET_TABLE_NAME, + TC_RELOC_RTSYM_LOC_FIXUP, md_parse_name, TC_CONS_FIX_NEW, + O_GOTOFF, O_PLT, O_GOT): Define. + * config/tc-mn10300.c (mn10300_PIC_related_p): New fn. + (mn10300_check_fixup): New fn. + (md_assemble): Call it. Check for PIC-related relocs. + (mn10300_cons_fix_new): Likewise. New fn. + (mn10300_end_of_match): New fn. + (mn10300_md_parse_name_cont): New fn. + +2003-07-09 Alexandre Oliva + + 2000-05-25 Alexandre Oliva + * config/tc-mn10300.c (mn10300_insert_operand): Negate negative + accumulator's shift. + 2000-05-08 Alexandre Oliva + * config/tc-mn10300.c (md_relax_table, md_convert_frag, + md_assemble, md_estimate_size_before_relax): Handle fbCC. + 2000-04-20 Alexandre Oliva + * config/tc-mn10300.c (HAVE_AM33): Redefine in terms of + HAVE_AM33_2. + 2000-04-03 Alexandre Oliva + * config/tc-mn10300.c (md_pseudo_table): Use AM33_2 constant. + (HAVE_AM33): Match AM33_2 too. + (HAVE_AM33_2): New macro. + (md_assemble): Use it. Match 2.0 registers only if HAVE_AM33_2. + 2000-04-01 Alexandre Oliva + * config/tc-mn10300.c (md_pseudo_table): Added `am33_2'. + (float_registers, double_registers): New variables. + (float_register_name, double_register_name): New functions. + (md_assemble): Recognize FP registers. Implement FMT_D3. + (mn10300_insert_operand): Support FP registers. + +2003-07-08 Chris Demetriou + + * config/tc-mips.c (mips_validate_fix): Do not warn about branch + target being a global symbol if not compiling SVR4 PIC code. + +2003-07-07 Nick Clifton + + * doc/c-m32r.texi (M32R-Directives): New node. Document the + .high, .shigh and .low directives. + +2003-07-07 Richard Sandiford + + * config/tc-h8300.c (h8300sxnmode): Add prototype. + (DSYMMODE): Remove. + (parse_exp): Replace expressionS argument with a h8_op. Parse the + operand size as well. + (skip_colonthing): Remove unused expression argument. Tighten checks + for 2-digit sizes. + (colonmod24): Remove. + (get_mova_operands): Combine calls to parse_exp and skip_colonthing. + (get_operand): Likewise. Use the standard code to read the size of + pc-relative operands. + (fix_operand_size): Include the size-guessing logic that used to be + in colonmod24 and get_operand. Don't apply dd:2 optimizations to + offsets with a symbolic component. + +2003-07-04 Nick Clifton + + * config/tc-i386.c (tc_x86_regname_to_dw2regnum): Use ARRAY_SIZE + macro to compute size of selected register name array. + +2003-07-01 Martin Schwidefsky + + * config/tc-s390.c (md_parse_option): Add cpu type z990. + (md_begin): Add minimal cpu type logic for instructions with different + binary format depending on the cpu. + (md_assemble): Remove check for minimal cpu. + (s390_insert_operand): Add support for long displacements. + (md_gather_operands): Likewise. + (tc_s390_fix_adjustable): Likewise. + (tc_s390_force_relocation): Likewise. + (md_apply_fix3): Likewise. + +2003-06-30 Chris Demetriou + + * config/tc-mips.c (s_mipsset): Implement -march= handling + differently. + +2003-06-30 Thiemo Seufer + + * config/tc-mips.c: Convert to ISO C90 prototypes. Remove unnecessary + prototypes and casts. Replace PTR with void *. Reformat. + * config/tc-mips.h: Likewise. + +2003-06-30 Alan Modra + + * config/tc-ia64.c (note_register_values): Warning fix. + * config/tc-mips.c (append_insn): Likewise. + +2003-06-29 Thiemo Seufer + + * config/tc-mips.c (mips_set_options,mips_opts): Support for + .set arch=FOO. + (file_mips_arch): Rename mips_arch. + (mips_arch_info,mips_tune_info): Remove. + (hilo_interlocks,gpr_interlocks,cop_interlocks): Use mips_opts.arch. + (mips_cpu_info_from_arch): New function. + (md_begin): Use file_mips_arch. + (macro_build,macro,mips_ip): Use mips_opts.arch. + (mips_set_architecture): Init file_mips_arch and mips_opts.arch. + (mips_after_parse_args): Remove mips_arch_info and mips_tune_info. + Use file_mips_arch. + (s_mipsset): Support for .set arch=FOO. + (mips_cpu_info_table): Fix typo. + +2003-06-26 H.J. Lu + + * config/tc-i386.c (md_assemble): Declare "exp" before "if". + +2003-06-25 Richard Sandiford + + * config/tc-h8300.c (get_specific): Allow ':8' to be used for + unsigned 8-bit operands. + +2003-06-24 Nick Clifton + + * read.c (s_comm): Change error message to assume an unsigned size + has been passed to .comm. + * config/tc-sparc.c (s_common): Likewise. + * write.c (write_contents): Replace 'unsigned long' with + 'addressT' and 'long' with offsetT in order to allow computations + with very large values to work for 64-bit addressed targets. + (relax_and_size_all_segments): Likewise. + (relax_frag): Likewise. + (relax_segment): Likewise. + +2003-06-23 Mark Mitchell + + * config/tc-ppc.c (ppc_cleanup): Use bytes to count APUinfo slots. + +2003-06-23 H.J. Lu + + * gas/config/tc-i386.c (md_assemble): Support Intel Precott New + Instructions. + + * gas/config/tc-i386.h (CpuPNI): New. + (CpuUnknownFlags): Add CpuPNI. + +2003-06-23 + + * config/tc-ia64.c (pseudo_func): Add ABI constants for linux, + freebsd, openvms, and nsk (non-stop kernel). + +2003-06-22 Jason Thorpe + + * config/tc-ns32k.c (md_begin): Initialize inst_hash_table after + all locals have been declared. + +2003-06-21 Thiemo Seufer + + * config/tc-mips.c (ADDRESS_ADD_INSN,ADDRESS_ADDI_INSN): Remove + special handling for n32 ABI. + (macro): Likewise. + +2003-06-19 Thiemo Seufer + + * config/tc-mips.c (s_cpsetup,s_cprestore,s_cpreturn): Revert + 2003-06-11 change. + +2003-06-19 Christian Groessler + + * config/tc-z8k.c (parse_reg): Invalid registers generate an error + now, not only a warning. Add some more checks to detect invalid + registers. + (get_operand): For CLASS_IR remember register size in mode struct. + (get_specific): Handle new CLASS_IRO type. Add register size + checks for CLASS_IR and CLASS_IRO. + (md_apply_fix3): Fix undefined usage of buf. + +2003-06-19 Alan Modra + + * config/tc-ppc.c (ppc_csect): Pass alignment to ppc_change_csect. + (ppc_change_csect): Add align param. Align frag at start of csect. + (ppc_section, ppc_named_section): Adjust ppc_change_csect calls. + (ppc_frob_section): Align vma. + +2003-06-18 Jakub Jelinek + + * dw2gencfi.c (EH_FRAME_ALIGNMENT): Define if not defined. + (output_cie): Don't pad. + (output_fde): Add align argument. Pad to align if not 0. + (cfi_finish): Set .eh_frame alignment to EH_FRAME_ALIGNMENT. + Pad just last FDE to EH_FRAME_ALIGNMENT. + +2003-06-18 Martin Schwidefsky + + * config/tc-s390.c (init_default_arch): Make current_mode_mask + dependent on s390_arch_size and current_cpu dependent on + current_mode_mask. + +2003-06-18 Svein E. Seldal + + * configure.in: Add c4x as an architecture variant to tic4x. + * configure: Regenerate. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + +2003-06-18 Alan Modra + + * config/tc-ppc.c (ppc_elf_suffix): Don't remove symbols other than + ".TOC." from PPC64_TOC relocs. + +2003-06-17 Alan Modra + + * config/tc-ppc.c (md_apply_fix3): Allow BRTAKEN, BRNTAKEN relocs. + +2003-06-16 Thiemo Seufer + + * config/tc-mips.c (ADDRESS_ADD_INSN,ADDRESS_ADDI_INSN, + ADDRESS_LOAD_INSN,ADDRESS_STORE_INSN): New macros. + (macro_build_ldst_constoffset,load_address,macro,s_cpsetup, + s_cprestore,s_cpadd): Use them. + +2003-06-16 Hans-Peter Nilsson + + * configure.in: Add specific case for cris-*-linux-gnu* with + em=linux. + * configure: Regenerate. + * config/tc-cris.c (DEFAULT_CRIS_AXIS_LINUX_GNU): New macro, TRUE + if TE_LINUX defined, else FALSE. + (bfd_boolean demand_register_prefix): Set default from + DEFAULT_CRIS_AXIS_LINUX_GNU. + (symbols_have_leading_underscore): Similar. + * config/tc-cris.h (LOCAL_LABELS_DOLLAR): Define to 1. + +2003-06-13 Richard Earnshaw + + * tc-arm.c (FPU_DEFAULT, case TE_LINUX): Default to FPU_ARCH_FPA. + (FPU_DEFAULT, case TE_NetBSD): Default to FPU_ARCH_VFP for ELF, + FPU_ARCH_FPA for AOUT. + (md_begin): Don't try to guess the floating point architecture from + the CPU if the OS ABI (Linux, NetBSD) mandates a particular form. + +2003-06-13 Robert Millan + + * configure.in: Add i386-netbsd-gnu target. + * configure: Regenerate. + +2003-06-12 Tom Tromey + + * doc/as.texinfo (Comm): Added @node. Moved before CFI + directives node. + +2003-06-12 Richard Sandiford + + * config/tc-mips.c (append_insn): In a compound relocation, take the + field width from the final (outermost) operator. + +2003-06-11 Richard Henderson + + * dw2gencfi.c (struct cfi_escape_data): New. + (cfi_add_CFA_nop): Remove. + (CFI_escape, dot_cfi_escape): New. + (dot_cfi): Remove nop. + (cfi_pseudo_table): Remove nop; add escape. + (output_cfi_insn): Likewise. + (select_cie_for_fde): Stop on escape. + * dw2gencfi.h (cfi_add_CFA_nop): Remove. + * read.c, read.h (do_parse_cons_expression): New. + * doc/as.texinfo (.cfi_escape): New. + +2003-06-11 Thiemo Seufer + + * config/tc-mips.c (s_cpsetup): Use mips_frame_reg instead of SP. + (s_cprestore): Likewise. + (s_cpreturn): Likewise. + +2003-06-11 Thiemo Seufer + + * config/tc-mips.c (tc_gen_reloc): Initialize retval amd reloc + with zeros. + +2003-06-11 Thiemo Seufer + + * config/tc-mips.c (md_pcrel_from): Return actual pcrel address. + (md_apply_fix3): Ignore non-special relocations. Remove superfluous + exceptions from size assert. Remove most of the addend fixup + specialcasing. Remove value, use valP directly. simplify fx_addnumber + handling. Remove zero addend specialcases. + (tc_gen_reloc): Use appropriate value for reloc2 addend. Remove + the addend fixup specialcase. + * config/tc-mips.h (MD_APPLY_SYM_VALUE): Define as 0. + +2003-06-11 Thiemo Seufer + + * write.c (write_relocs): Use xcalloc. Fix relocs initialization + in the RELOC_EXPANSION_POSSIBLE case. + +2003-06-11 Alan Modra + + * config/tc-i960.c (line_comment_chars): Add '#'. + * config/tc-mn10200.c (tc_gen_reloc): Don't ignore fx_subsy. + +2003-06-11 H.J. Lu + + * po/Make-in (DESTDIR): New. + (install-data-yes): Support $(DESTDIR). + (uninstall): Likewise. + +2003-06-11 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + +2003-06-10 Doug Evans + + * cgen.c (gas_cgen_finish_insn): CGEN_INSN_RELAX renamed to + CGEN_INSN_RELAXED. + * config/tc-fr30.c (md_estimate_size_before_relax): Ditto. + * config/tc-m32r.c (md_estimate_size_before_relax): Ditto. + * config/tc-openrisc.c (md_estimate_size_before_relax): Ditto. + +2003-06-10 Alan Modra + Gary Hade + + * config/tc-ppc.c (md_assemble): Handle PPC_OPERAND_DQ. + (md_apply_fix3): Special case lq insn. + +2003-06-10 Richard Sandiford + + * config/tc-h8300.c (get_rtsl_operands): Accept unbracketed register + lists. Allow single-register ranges. + +2003-06-10 Richard Sandiford + + * config/tc-h8300.c (h8300sxnmode): New. + (md_pseudo_table): Add .h8300sxn entry. + +2003-06-09 H.J. Lu + + * NEWS: Updated for the new -n option for the i386 assembler. + + * config/tc-i386.c (optimize_align_code): New. + (md_shortopts): Add 'n'. + (md_parse_option): Handle 'n'. + (md_show_usage): Add '-n'. + + * config/tc-i386.h (optimize_align_code): Declared. + (md_do_align): Optimize code alignment only if optimize_align_code + is not 0. + + * doc/as.texinfo: Add the new -n option. + + * doc/c-i386.texi: Document the new -n option. + +2003-06-07 Richard Henderson + + * doc/as.texinfo: Document .cfi_rel_offset. + + * dw2gencfi.c (struct cfa_save_data, cfa_save_stack): New. + (cfi_add_CFA_offset): Detect invalid offsets. + (cfi_add_CFA_remember_state): Save cur_cfa_offset. + (cfi_add_CFA_restore_state): Restore it. + (CFI_rel_offset): New. + (cfi_pseudo_table): Add it. + (dot_cfi): Handle it. + +2003-06-07 H.J. Lu + + * app.c (do_scrub_chars): Add states 14 and 15 to handle + predicate for ia64. + +2003-06-05 Michael Snyder + + * config/tc-h8sx.c (get_specific): Distinguish h8h from h8s ops. + (build_bytes): Ditto. + +2003-06-05 Richard Sandiford + + * config/tc-h8sx.c (DMODE): Remove. + (colonmod24): Don't choose a default if the operand is a 16-bit + constant integer. + (fix_operand_size): New function. + (md_assemble): Use it to choose between @(d:2, ERn) and @(d:16,ERn). + Adjust @(d:2,ERn) operands before choosing the specific opcodes. + +2003-06-05 Michal Ludvig + + * dw2gencfi.c (cfi_add_CFA_insn, cfi_add_CFA_insn_reg) + (cfi_add_CFA_insn_reg_reg, cfi_add_CFA_insn_reg_offset): New. + (cfi_add_CFA_offset, cfi_add_CFA_def_cfa) + (cfi_add_CFA_register, cfi_add_CFA_def_cfa_register) + (cfi_add_CFA_def_cfa_offset): Use cfi_add_CFA_insn_*(). + (cfi_add_CFA_restore, cfi_add_CFA_undefined) + (cfi_add_CFA_same_value, cfi_add_CFA_remember_state) + (cfi_add_CFA_restore_state, cfi_add_CFA_nop): New. + (cfi_pseudo_table): New directives .cfi_return_column, + .cfi_restore, .cfi_undefined, .cfi_same_value, + .cfi_remember_state, .cfi_restore_state, .cfi_nop. + (dot_cfi, output_cfi_insn): Handle new directives. + * dw2gencfi.h (cfi_add_CFA_restore, cfi_add_CFA_undefined) + (cfi_add_CFA_same_value, cfi_add_CFA_remember_state) + (cfi_add_CFA_restore_state, cfi_add_CFA_nop): New prototypes. + +2003-06-04 Richard Henderson + + * dw2gencfi.c (output_cfi_insn): Fix typo for negative offsets. + + * dw2gencfi.c (cfi_finish): Set .eh_frame read-only. + +2003-06-04 Richard Henderson + + * config/tc-alpha.c (s_alpha_usepv): New. + (md_pseudo_table): Add it. + (alpha_cfi_frame_initial_instructions): New. + * config/tc-alpha.h (TARGET_USE_CFIPOP): New. + (tc_cfi_frame_initial_instructions): New. + * doc/c-alpha.texi: Document .usepv. + +2003-06-04 Jakub Jelinek + + * as.c (show_usage): Document --execstack and --noexecstack. + (parse_args): Add --execstack and --noexecstack. + (main): Create .note.GNU-stack section if --execstack or + --noexecstack was given on comand line, set its SHF_EXECINSTR bit. + * as.h (flag_execstack, flag_noexecstack): New. + +2003-06-03 Chris Demetriou + + * config/tc-mips.c: (OPTION_ARCH_BASE, OPTION_ASE_BASE) + (OPTION_COMPAT_ARCH_BASE, OPTION_FIX_BASE) + (OPTION_MISC_BASE): New defines. + (OPTION_BREAK, OPTION_CONSTRUCT_FLOATS, OPTION_EB, OPTION_EL) + (OPTION_ELF_BASE, OPTION_FIX_VR4122, OPTION_FP32, OPTION_FP64) + (OPTION_GP32, OPTION_GP64, OPTION_M3900, OPTION_M4010, OPTION_M4100) + (OPTION_M4650, OPTION_M7000_HILO_FIX, OPTION_MARCH, OPTION_MDMX) + (OPTION_MEMBEDDED_PIC, OPTION_MIPS1, OPTION_MIPS16, OPTION_MIPS2) + (OPTION_MIPS3, OPTION_MIPS32, OPTION_MIPS32R2, OPTION_MIPS3D) + (OPTION_MIPS4, OPTION_MIPS5, OPTION_MIPS64) + (OPTION_MNO_7000_HILO_FIX, OPTION_MTUNE, OPTION_NO_CONSTRUCT_FLOATS) + (OPTION_NO_FIX_VR4122, OPTION_NO_M3900, OPTION_NO_M4010) + (OPTION_NO_M4100, OPTION_NO_M4650, OPTION_NO_MDMX, OPTION_NO_MIPS16) + (OPTION_NO_MIPS3D, OPTION_NO_RELAX_BRANCH, OPTION_RELAX_BRANCH) + (OPTION_TRAP): Redefine in terms of new defines. + (md_longopts): Reorder entries. + +2003-05-14 Michael Snyder + From Bernd Schmidt + and Michael Snyder + and Alexandre Oliva + * config/tc-h8300.c: Add insns and addressing modes for h8300sx. + * config/tc-h8300.h: Ditto. + +2003-06-03 Nick Clifton + + * tc-v850.c (tc-gen_reloc): Translate BFD_RELOC_32 into + BFD_RELOC_32_PCREL if the reloc is pc-relative. Do this + before calling bfd_reloc_type_lookup. + +2003-06-02 Alan Modra + + * read.c (emit_expr): Set dot_value. + * dw2gencfi.c (output_fde): Remove pcrel reloc hack. + +2003-06-02 Alan Modra + + * macro.c (sub_actual): Don't lose string if it turns out that + &string wasn't an arg. + +2003-05-31 Richard Henderson + + * dw2gencfi.c (output_fde): Use fix_new to emit pc-relative reloc. + (cfi_finish): Set flag_traditional_format around .eh_frame data. + +2003-05-29 Richard Henderson + + * config/tc-alpha.c (alpha_cur_ent_sym): Remove. + (all_frame_data, plast_frame_data, cur_frame_data): New. + (s_alpha_ent): Record data for dwarf2 cfi. + (s_alpha_end, s_alpha_mask, s_alpha_frame, s_alpha_prologue): Likewise. + (alpha_elf_md_end): Emit dwarf2 cfi for ecoff unwind directives. + * config/tc-alpha.h (md_end): New. + (DWARF2_DEFAULT_RETURN_COLUMN): New. + (DWARF2_CIE_DATA_ALIGNMENT): New. + +2003-05-29 Nick Clifton + + * configure.in: Add i386-*-freebsd* entry. + * configure: Regenerate. + +2003-05-29 Kazuhiro Inaoka + + * config/tc-m32r.c: Amend comment to refer to Renesas + +2003-05-27 Richard Henderson + + * expr.c (make_expr_symbol): Fold FAKE_LABEL_NAME use into the + symbol_create call. + (current_location): Use symbol_temp_new_now. + * stabs.c (s_stab_generic): Use symbol_temp_new. + * symbols.c (temp_label_name): Remove. + (symbol_temp_new, symbol_temp_make): Use FAKE_LABEL_NAME. + +2003-05-27 Richard Henderson + + * dw2gencfi.c, dw2gencfi.h: Rewrite from scratch. + * as.c (main): Always call cfi_finish. + * config/tc-i386.c (x86_dwarf2_return_column): New. + (x86_cie_data_alignment): New. + (md_begin): Set them. + (tc_x86_cfi_init): Remove. + (tc_x86_regname_to_dw2regnum): Fix 32-bit register numbers; + return int, not unsigned long; don't as_bad here. + (tc_x86_frame_initial_instructions): Streamline; use + updated api. + * config/tc-i386.h (tc_cfi_init): Remove. + (DWARF2_DEFAULT_RETURN_COLUMN): New. + (DWARF2_CIE_DATA_ALIGNMENT): New. + +2003-05-27 Richard Henderson + + * symbols.c (temp_label_name): New. + (symbol_temp_new, symbol_temp_new_now, symbol_temp_make): New. + (symbol_set_value_now): New. + * symbols.h: Prototype them. + * dwarf2dbg.c: Use them. + (fake_label_name, symbol_new_now, set_symbol_value_now): Remove. + +2003-05-23 Jason Eckhardt + + * config/tc-i860.c (target_xp): Declare variable. + (OPTION_XP): Declare macro. + (md_longopts): Add option -mxp. + (md_parse_option): Set target_xp. + (md_show_usage): Add -mxp usage. + (i860_process_insn): Recognize XP registers bear, ccr, p0-p3. + (md_assemble): Don't try expansions if XP_ONLY is set. + * doc/c-i860.texi: Document -mxp option and i860XP support. + +2003-05-23 Eric Christopher + + * config/tc-mips.c (macro_build_jalr): Warning patrol. + +2003-05-22 Thiemo Seufer + + * config/tc-mips.c (append_insn): Use actual relocation size for new + fixp's. Don't relax overflow checking for partial_inplace relocations. + Use the actual relocation type in combined relocs, not just the type + of the first one. + (macro_build_jalr): Use actual relocation size for new fix. + (s_cpsetup, s_gpdword): Likewise. + +2003-05-22 Thiemo Seufer + + * config/tc-mips.c (macro): Don't use uninitialized tempreg. + +2003-05-22 Nick Clifton + + * config/tc-xstormy16.c (md_pcrel_from_section): Do not produce + section relative offsets for relocs that will not be based on the + section symbol. + (xstormy16_md_apply_fix3): Remove previous patch to this + function. + +2003-05-07 Eric Christopher + + * config/tc-mips.c (mips_abicalls): New variable. + (md_parse_option): Use. + (s_option): Ditto. + (s_abicalls): Ditto. + (mips_elf_final_processing): Set EF_MIPS_PIC and + EF_MIPS_CPIC dependent on above. + +2003-05-21 John David Anglin + + * tc-hppa.c (hppa_symbol_chars): Remove `,' and `!'. + +2003-05-21 Nick Clifton + + * config/obj-elf.c: Include dwarf2dbg.h. + (elf_pseudo_tab): Add .file and .loc. + * config/tc-arc.c (md_pseudo_table): Remove .file and .loc. + * config/tc-arm.c: Likewise. + * config/tc-h8300.c: Likewise. + * config/tc-hppa.c: Likewise. + * config/tc-ia64.c: Likewise. + * config/tc-m68hc11.c: Likewise. + * config/tc-m68k.c: Likewise. + * config/tc-mmix.c: Likewise. + * config/tc-mn10300.c: Likewise. + * config/tc-ppc.c: Likewise. + * config/tc-sh.c: Likewise. + * config/tc-sparc.c: Likewise. + * config/tc-v850.c: Likewise. + * config/tc-frv.c: Likewise, and remove redundant inclusion of + dwarf2dbg.h. + * config/tc-ip2k.c: Likewise. + * config/tc-iq2000.c: Likewise. + * config/tc-xstormy16.c: Likewise. + * config/tc-xtensa.c: Likewise. + * Makefile.am: Regenerate dependencies. + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * configure: Regenerate. + * po/POTFILES.in: Regenerate. + * po/gas.pot: Regenerate. + +2003-05-21 Nick Clifton + + * dw2gencfi.c (cfi_get_label): Use symbol_make for non + BFD_ASSEMBLER targets. + (cfi_startproc): Change type of saved_seg and cfi_seg to segT. + (dot_cfi_endproc): Only call bfd_set_section_flags for targets + defining BFD_ASSEMBLER. + +2003-05-20 Michal Ludvig + + * as.c (main): Remove tc_cfi_init(). + * dw2gencfi.c (cfi_parse_arg): Allow regnames beginning + with '%'. + (cfi_pseudo_table): Add "cfi_register" entry. + (cfi_make_insn): Handle CFA_register. + (cfi_output_insn): Ditto. + (dot_cfi): Ditto. + (cfi_get_label): Add 'simple' modifier to .cfi_startproc. + (dot_cfi_endproc): Reuse already emitted CIEs. + * testsuite/gas/cfi/cfi-i386.d: New pattern. + * testsuite/gas/cfi/cfi-x86-64.d: Ditto. + +2003-05-20 Nick Clifton + + * config/tc-xstormy16.c: Include dwarf2dbg.h. + (md_pseudo_table): Add entries for .loc and .line. + +2003-05-20 Alan Modra + + * dw2gencfi.c (cfi_parse_arg): Only use tc_regname_to_dw2regnum if + defined. + (dot_cfi_endproc): Avoid C99 construct. + +2003-05-20 Michal Ludvig + + * dw2gencfi.c, dw2gencfi.h: New files. + * config/tc-i386.c (tc_x86_cfi_init): New function. + * config/tc-i386.h (TARGET_USE_CFIPOP, tc_cfi_init): New defines. + * as.c (parse_args): Set verbose flag on --verbose. + (main): Call tc_cfi_init()/cfi_finish(). + * as.h (verbose): New external variable. + * read.c (pobegin): Insert CFI pops to the list. + * symbols.c (local_symbol_make): Make symbol external. + * symbols.h (local_symbol_make): New prototype. + * Makefile.am: Add dw2gencfi.[ch] files. Run "make dep-am". + * Makefile.in: Regenerate. + * doc/as.texinfo: Added node "CFI directives" with description of + all implemented .cfi_* directives. + * doc/Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + +2003-05-19 Svein E. Seldal + + * config/tc-tic4x.c (md_assemble): Added support for one-line parallel + insns. + * config/tc-tic4x.h: Added DOUBLEBAR_PARALLEL definition + +2003-05-18 Jason Eckhardt + + * config/tc-i860.c (i860_process_insn): Initialize fc after + each opcode mismatch. + +2003-05-16 Kelley Cook + + * configure.in: Accept i[3-7]86 variants. + * configure: Regenerate. + +2003-05-15 Thiemo Seufer + + * config/tc-mips.h: Fix comment formatting. + +2003-05-13 Hans-Peter Nilsson + + * read.c (old_buffer, old_input, old_limit): Remove variables. + (read_a_source_file): Delete label contin. + : Use an "sb" to push #APP expansion into + input as with macros, instead of in separate old_* variables. + Zero-terminate string being scrubbed. + +2003-05-12 Nick Clifton + + * config/tc-xstormy16.c (skipping_fptr): New local variable. + (md_assemble): Reset skipping_fptr. + (md_operand): If @fptr() is followed by a minus sign, set + skipping_fptr and ignore the fptr. If skipping_fptr is set and an + @fptr is detected, ignore it and reset skipping_fptr. + +2003-05-11 Jason Eckhardt + + * config/tc-i860.c (MAX_FIXUPS): Define. + (struct i860_fi fi[]): New struct. + (struct i860_it the_insn): Add above as member and move fields + exp, reloc, pcrel and fup into i860_fi. + (md_assemble): Replace all instances of exp, reloc, pcrel + and fup with fi[].exp, fi[].reloc, fi[].pcrel, fi[].fup. + Add a loop to possibly emit multiple fix-ups for each insn. + (i860_process_insn): Likewise. + (i860_get_expression): Likewise. + (md_apply_fix3): Use a bitwise check for OP_IMM_U5, not equality. + +2003-05-09 Martin Schwidefsky + + * config/tc-s390.c (s390_target_format): Always call init_default_arch. + +2003-05-07 H.J. Lu + + * config/tc-ia64.c (alias_hash): New. + (alias_name_hash): New. + (secalias_hash): New. + (secalias_name_hash): New. + (md_pseudo_table): Add "secalias". + (md_begin): Initialize alias_hash, alias_name_hash, + secalias_hash and secalias_name_hash. + (struct alias): New. + (dot_alias): Implement .alias and .secalias directives. + (do_alias): New. + (ia64_adjust_symtab): New. + (do_secalias): New. + (ia64_frob_file): New. + + * config/tc-ia64.h (ia64_adjust_symtab): New. + (tc_adjust_symtab): Defined. + (ia64_frob_file): New. + (tc_frob_file): Defined. + +2003-05-07 Dmitry Diky + + * tc-msp430.c: Add missing lines to known cpus list. + +2003-05-06 Alexandre Oliva + + * configure.in (MIPS_DEFAULT_ABI): AC_DEFINE. + * config/tc-mips.c (mips_after_parse_args): Set mips_abi to it. + * config.in, configure: Rebuilt. + +2003-05-05 H.J. Lu + + * config/tc-mips.c (tc_gen_reloc): Add addend just once if + howto->partial_inplace is false. + +2003-05-05 Daniel Jacobowitz + + * config/tc-mips.c (mips_need_elf_addend_fixup): Remove + symbol_used_in_reloc_p check. + (md_apply_fix3): Remove check for howto->pcrel_offset. + +2003-05-03 H.J. Lu + + * config/obj-elf.c (obj_elf_parse_section_letters): Make it a + fatal error for unknown section attribute. + + * config/tc-alpha.c (alpha_elf_section_letter): Return -1 for + unknown section attribute. + * config/tc-ia64.c (ia64_elf_section_letter): Likewise. + * config/tc-ppc.c (ppc_section_letter): Likewise. + + * config/tc-ia64.c (ia64_elf_section_letter): Handle 'o'. + (ia64_elf_section_type): Accept "unwind". + +2003-05-02 H.J. Lu + + * read.h (demand_copy_string): New. + + * config/tc-alpha.c (demand_copy_string): Removed. + +2003-05-02 Michael Snyder + + * write.h (FAKE_LABEL_NAME): Allow override + (for targets that like eg. a leading dot in a local label). + +2003-05-02 Nick Clifton + + * config/tc-xstormy16.c (xstormy16_md_apply_fix3): Do not bias the + addend with the symbol's value for pc-relative relocations against + a defined symbol - this will be done automatically. + +2003-05-01 H.J. Lu + + * config/obj-elf.c (obj_elf_type): Accept "notype" and + "STT_NOTYPE". + +2003-05-01 H.J. Lu + + * config/tc-ia64.h (tc_canonicalize_section_name): New. + + * config/obj-elf.c (obj_elf_section_name): Call + tc_canonicalize_section_name if it is defined. + +2003-05-01 H.J. Lu + + * config/tc-ia64.c (ia64_check_label): New. + * config/tc-ia64.h (tc_check_label): New. + + * read.c (read_a_source_file): Call tc_check_label after + creating a user-defined label if defined. + +2003-05-02 Alan Modra + + * config/tc-ppc.c (md_show_usage): Mention -a32, -a64, -l, -le, -b, + -be and split strings to below 509 bytes in length. + +2003-05-01 Christian Groessler + + * expr.h: Fix comments in operatorT typedef. + * config/tc-z8k.c: Add 2003 to copyright message. + Fold s_segm() and s_unseg() into one function s_segm(parm) which + decides by the parameter. + (md_begin): Don't set linkrelax. Only set Z8002 default if no + command line argument was given to select the intended + architecure. + (get_interrupt_operand): Warn if NOP type code is emitted. + (newfix): New parameter 'size', forward it to 'fix_new_exp'. + (apply_fix): Call newfix with additional 'size' parameter. + (build_bytes): Remove unused variable 'nib'. Detect overflow in + 4 bit immediate arguments. + (md_longopts): Add 'linkrelax' option. + (md_parse_option): Adapt to new s_segm function. Set 'linkrelax' + variable when 'linkrelax' command line option is specified. + (md_show_usage): Display 'linkrelax' option. + (md_apply_fix3): Fix cases R_IMM4L, R_JR, and R_IMM8. Add cases + R_CALLR and R_REL16. + * config/tc-z8k.h: Undef WARN_SIGNED_OVERFLOW_WORD. + +2003-04-30 H.J. Lu + + * config/tc-ia64.c (ia64_number_to_chars): New function pointer. + (ia64_float_to_chars): Likewise. + (dot_byteorder): Set target_big_endian, ia64_number_to_chars + and ia64_float_to_chars by tc_segment_info_data.endian from + the current segment if byteorder == -1. + (md_begin): Call dot_byteorder to set target_big_endian. + (md_atof): Call ia64_float_to_chars to convert floating point. + (ia64_float_to_chars_bigendian): New function. + (ia64_float_to_chars_littleendian): Likewise. + (ia64_elf_section_change_hook): Likewise. + + * config/tc-ia64.h (ia64_number_to_chars): New. + (md_number_to_chars): Changed to (*ia64_number_to_chars) + (ia64_elf_section_change_hook): New. + (md_elf_section_change_hook): Defined. + (ia64_segment_info_type): New struct. + (TC_SEGMENT_INFO_TYPE): Defined. + +2003-04-30 H.J. Lu + + * config/tc-ia64.c (md_section_align): Deleted. + + * config/tc-ia64.h (SUB_SEGMENT_ALIGN): New. + (md_section_align): New. + +2003-04-30 H.J. Lu + + * config/tc-ia64.c (stmt_float_cons): Fix alignment for real10 + and add real16. + (md_pseudo_table): Add "xreal16", "xreal16.ua", "real16" and + "real16.ua". + (md_atof): Add 6 byte padding of zero for real16. + +2003-04-29 Nick Clifton + + * config/obj-elf.c (obj_elf_symver): Skip whitespace before the + start of a version name. + +2003-04-28 Chris Demetriou + + * configure.in (mips-*-*n*bsd*): Replace with... + (mips-*-netbsd*, mips-*-openbsd*): These. + * configure: Regenerate. + +2003-04-28 H.J. Lu + + * config/tc-hppa.c (hppa_symbol_chars): New. + * config/tc-hppa.h (tc_symbol_chars): Likewise. + +2003-04-26 Thiemo Seufer + + * config/tc-mips.h (TC_FORCE_RELOCATION_SUB_SAME): Define again. + +2003-04-25 Chris Demetriou + + * NEWS: Belatedly mention support for MIPS32 Release 2. + +2003-04-24 Eric Christopher + + * config/tc-mips.c (nopic_need_relax): Revert previous + change. + +2003-04-24 Dhananjay Deshpande + + * config/tc-h8300.h (DWARF2_LINE_MIN_INSN_LENGTH): New + * config/tc-h8300.c (dwarf2dbg.h): Include + (md_pseudo_table): Handle .loc and .file + (md_assemble): Call dwarf2_emit_insn if BFD_ASSEMBLER. + * Makefile.am: Add dependency on dwarf2dbg.h for h8300 targets. + * Makefile.in: Regenerate. + +2003-04-24 Dhananjay Deshpande + + * config/tc-h8300.c (Nmode, h8300hnmode, h8300snmode): New. + (md_pseudo_table): Add h8300hn, h8300sn. + * config/tc-h8300.h (COFF_MAGIC): Handle h8300hn, h8300sn. + * doc/c-h8300.texi : Add documentation for new machine directives. + +2003-04-24 Nick Clifton + + * config/tc-ppc.c (ppc_symbol_chars): Define. + * config/tc-ppc.h (tc_symbol_chars): Define. + +2003-04-23 J"orn Rennecke + + * config/tc-sh.c: Amend comment to refer to SuperH. + * config/tc-sh.h: Likewise. + (LISTING_HEADER): Amend to refer to SuperH. + * config/tc-sh64.c: Change comment to refer to SuperH. + * config/tc-sh64.h (LISTING_HEADER): Change to refer to SuperH. + * doc/as.texinfo [SH, GENERIC]: Amend / Change to refer to SuperH. + * doc/c-sh.texi: Amend to refer to SuperH. + Add SuperH architecture documentation references. + * doc/c-sh64.texi: Change to refer to SuperH. + +2003-04-23 H.J. Lu + + * app.c (do_scrub_chars): More checks for valid labels. + +2003-04-22 H.J. Lu + + * app.c (do_scrub_chars): Check for valid label. + +2003-04-22 Kazuhiro Inaoka + + * doc/as.texinfo: Replace references to Mitsubishi M32R with + references to Renesas M32R. + * doc/c-m32r.texi: Likewise. + +2003-04-21 Richard Henderson + + * dwarf2dbg.c (get_filenum): Skip as-yet unassigned file numbers. + (out_file_list): Assign non-null filename after generating error. + +2003-04-18 Jakub Jelinek + + * ehopt.c (check_eh_frame): For aug_size == 0 + in state_seeing_aug_size state skip the state_skipping_aug + state. + +2003-04-15 Rohit Kumar Srivastava + + * doc/c-h8300.texi: Replace occurrances of 'Hitachi' with + 'Renesas'. + * doc/c-h8500.texi: Likewise. + * doc/c-sh.texi: Likewise. + * doc/c-sh64.texi: Likewise. + * doc/h8.texi: Likewise. + * config/tc-h8300.c: Likewise. + * config/tc-h8300.h: Likewise. + * config/tc-h8500.c: Likewise. + * config/tc-h8500.h: Likewise. + * config/tc-sh.c: Likewise. + * config/tc-sh.h: Likewise. + * config/tc-sh64.c: Likewise. + * config/tc-sh64.h: Likewise. + +2003-04-10 Alexandre Oliva + + * config/tc-mips.h (tc_frag_data_type, TC_FRAG_TYPE): New. + * config/tc-mips.c: Use signed add for n32 address arithmetic. + (append_insn): When filling delay slots with instructions + that have fixups that tc_gen_reloc might consider modifyable + in variant frags, start a new frag. + (load_address): Generate GOT_DISP with of without offset + depending on whether symbol is local. For -xgot, use + GOT_PAGE/GOT_OFST or GOT_HI16/GOT_LO16. + (macro) : Likewise. + : In NewABI, use CALL16 or GOT_DISP for small got, + CALL_HI16/CALL_LO16 or GOT_PAGE/GOT_OFST for big got. + : In NewABI with small got, always use + GOT_PAGE/GOT_OFST, with the latter in the load/store + instruction. With big got, use GOT_HI16/GOT_LO16 or + GOT_PAGE/GOT_OFST. + (tc_gen_reloc): Adjust variant frags with GOT_DISP in NewABI. + Add tc_frag_data.tc_fr_offset to addends. Decay CALL16, + GOT_OFST and GOT_DISP to GOT_DISP in NewABI. + (md_convert_frag): Use memmove for safe copying of overlapping + regions. + +2003-04-09 Stephane Carrez + + * doc/c-m68hc11.texi (M68HC11-Opts): Document -m68hcs12, -mshort, + -mlong, -mshort-double and -mlong-double options; use table @code. + (M68HC11-Syntax): Update to document 68HC12 operands. + (M68HC11-Modifiers): New section for operand modifiers. + (M68HC11-Directives): New section for specific assembler directives. + (M68HC11-Branch): Fix Overfull hbox error. + +2003-04-09 Alexandre Oliva + + * config/tc-mips.c (macro): Add comments explaining the rationale + for Chris' change. + +2003-04-09 Chris Demetriou + + * config/tc-mips.c (macro): Put back `+ 0x8000' in test for 64-bit + constant address that Alexandre took out by accident. Reject + 64-bit addresses that are not sign extensions of 32 bits only if + we don't support 64-bit address constants. + +2003-04-09 Alan Modra + + * config/tc-ppc.c (md_apply_fix3): Generate ADDR16 relocs. + +2003-04-08 Nick Clifton + + * as.c (perform_an_assembly_pass): If using cgen, call + gas_cgen_begin. + * cgen.c (gas_cgen_begin): New function. If + flag_signed_overflow_ok is set call cgen_set_signed_overflow_ok + otherwise call cgen_clear_signed_overflow_ok. + * cgen.h: Prototype gas_cgen_begin. + +2003-04-07 Thiemo Seufer + + * write.c (write_relocs): Remove unused variable. + +2003-04-06 Chris Demetriou + + * config/tc-mips.c (HAVE_64BIT_ADDRESS_CONSTANTS): New. + (macro): Use new macro to decide whether to emit constant address + as 32 or 64 bits if addresses are 32-bit wide but registers are + 64-bit wide. + +2003-04-05 Stephane Carrez + + * config/tc-m68hc11.c (M6811_OP_CALL_ADDR): New internal define. + (M6811_OP_PAGE_ADDR): New internal define. + (get_operand): New modifier %page and %addr to obtain page and + address part of a far-function. + (fixup8): Use BFD_RELOC_M68HC11_PAGE for a %page modifier; don't + complain on overflow for the BFD_RELOC_M68HC11_PAGE and truncation + relocs. + (fixup16): Use BFD_RELOC_M68HC11_LO16 for a %addr modifier. + (find_opcode): Add comment. + (md_estimate_size_before_relax): Force relocation of + STATE_UNDEXED_OFFSET types when the symbol is not absolute. + (tc_m68hc11_fix_adjustable): Check for BFD_RELOC_M68HC11_LO16 + instead of BFD_RELOC_LO16; temporarily make the BFD_RELOC_32 + on the symbol itself so that DWARF2 strings are merged correctly. + +2003-04-04 Svein E. Seldal + + * config/obj-coff.h (TARGET_FORMAT): Namespace cleanup, changed + default tic4x target format to 'coff2-tic4x'. + * config/tc-tic4x.c: Namespace cleanup. Replace s/c4x/tic4x/ and + s/c3x/tic3x/ + * config/tc-tic4x.h: Ditto + +2003-04-03 Nick Clifton + + * NEWS: Mention support for Xtensa architecture. + +2003-04-02 Philip Blundell + + * config/tc-arm.c (arm_force_relocation): Return 0 for OFFSET_IMM. + +2003-04-02 Chris Demetriou + + * config/tc-mips.c (macro2): Adjust implementation of + M_ULH, M_ULHU, M_ULW, and M_ULD so that they work properly + in the case where the source and destination registers + are the same. + +2003-04-01 Bob Wilson + + * Makefile.am (CPU_TYPES): Add xtensa. + (TARGET_CPU_CFILES): Add config/tc-xtensa.c. + (TARGET_CPU_HFILES): Add config/tc-xtensa.h. + (xtensa-relax.o): New target. + Run "make dep-am". + * Makefile.in: Regenerate. + * configure.in: Handle xtensa-*-*. Add xtensa-relax.o to + extra_objects for xtensa targets. + * configure: Regenerate. + * write.c (write_object_file): Add new md_post_relax_hook. + * config/tc-xtensa.c: New file. + * config/tc-xtensa.h: Likewise. + * config/xtensa-istack.h: Likewise. + * config/xtensa-relax.c: Likewise. + * config/xtensa-relax.h: Likewise. + * doc/Makefile.am (CPU_DOCS): Add c-xtensa.texi. + * doc/Makefile.in: Regenerate. + * doc/all.texi: Set new XTENSA variable. + * doc/as.texinfo: Set new Xtensa variable. Describe + Xtensa-specific options. Define line comment character for + Xtensa. Add Xtensa processors to list of ELF targets where + alignment is specified in bytes. Add new Xtensa-Dependent node. + Add acknowledgements for those contributing to the Xtensa port. + * doc/internals.texi: Describe new md_post_relax_hook. + * doc/c-xtensa.texi: New file. + +2003-04-01 Nick Clifton + Richard Earnshaw + + * config/tc-arm.c: Remove presence of (r) and (tm) symbols. + (ARM_ARCH_IWMMXT): Simplify. + (insns): Place iwmmx instructions in correct place in table. + (arm_add_note): New function: Add a note entry to a .note section. + (md_begin): Make the default architecture be unknown. + Suppress the creation of an arm note section. + +2003-03-26 Eric Christopher + + * config/tc-mips.c (nopic_need_relax): Check for S_IS_EXTERN. + +2003-03-25 Stan Cox + Nick Clifton + + Contribute support for Intel's iWMMXt chip - an ARM variant: + + * config/tc-arm.c: (ARM_CEXT_IWMMXT, ARM_ARCH_IWMMXT, WR_PREFIX, + WC_PREFIX, REG_TYPE_IWMMXT): New constants. + (enum wreg_type, enum iwmmxt_insn_type): New types. + (wr_register, wc_register, wcg_register): New macros. + (iwmmxt_table): New variable. + (wreg_required_here, do_iwmmxt_byte_addr, do_iwmmxt_tandc, + do_iwmmxt_tbcst, do_iwmmxt_textrc, do_iwmmxt_textrm, + do_iwmmxt_tinsr, do_iwmmxt_tmcr, do_iwmmxt_tmcrr, do_iwmmxt_tmia, + do_iwmmxt_tmovmsk, do_iwmmxt_tmrc, do_iwmmxt_tmrrc, + do_iwmmxt_torc, do_iwmmxt_waligni, do_iwmmxt_wmov, + do_iwmmxt_word_addr, do_iwmmxt_wrwr, do_iwmmxt_wrwrwcg, + do_iwmmxt_wrwrwr, do_iwmmxt_wshufh, do_iwmmxt_wzero, + cp_byte_address_offset, cp_byte_address_required_here, + check_iwmmxt_insn): New functions. + (asm_opcode_insns): Add iWMMXt instructions. + (md_begin): Set the mach value for iWMMXt targets. Create a note + section to identify iwmmxt binaries. + (md_apply_fix3): Handle BFD_RELOC_ARM_CP_OFF_IMM_S2. + * doc/c-arm.texi: Document the support for the iWMMXt. + * NEWS: Mention new support. + +2003-03-24 Daniel Néri + + * doc/as.texinfo: Rename the all occurances of C54X to TIC54X. + * doc/all.texi: Likewise. + * doc/c-tic54x.texi: Likewise. + +2003-03-21 Andreas Schwab + + * config/tc-ia64.c (generate_unwind_image): Fix type of unw_rec to + avoid aliasing issue. + +2003-03-21 Martin Schwidefsky + + * config/tc-s390.c (s390_arch_size): Initialize to zero. + (current_arch_mask): Rename to current_mode_mask. + (current_arch_requested): Remove variable. + (current_cpu): New variable. + (init_default_arch): Set defaults values for s390_arch_size, + current_mode_mask and current_cpu. + (md_parse_option): New options -mesa, -mzarch and -march={g5,g6,z900}. + (md_begin): Replace current_arch_mask by current_cpu. + (md_assemble): Adapt check and error message to current_mode_mask and + current_cpu. + +2003-03-09 James E Wilson + + * macro.c (buffer_and_nest): Store more to sb instead of '\n'. + * read.c (get_line_sb): Return end of line character or '\n' if + it is zero or non-existent. + +2003-03-12 Alexandre Oliva + + * config/tc-mips.c (mips_validate_fix): New function. + * config/tc-mips.h (TC_VALIDATE_FIX): Define. + (mips_validate_fix): Declare. + +2003-03-12 Alexandre Oliva + + * Reverted 2003-03-02's patch. + +2003-03-11 Steve Ellcey + + * dwarf2dbg.c (generic_dwarf2_emit_offset): New. + (TC_DWARF2_EMIT_OFFSET): Provide default. + (out_debug_aranges, out_debug_info): Use it. + * config/tc-ia64.c (ia64_dwarf2_emit_offset): New. + (ia64_cons_fix_new): Move FUNC_DTP_RELATIVE handling ... + (ia64_gen_real_reloc_type): ... here. + * config/tc-ia64.h (TC_DWARF2_EMIT_OFFSET): New. + +2003-03-09 Thiemo Seufer + + * config/tc-mips.c (s_mips_end): Remove !BFD_ASSEMBLER case. + (s_mips_ent): Likewise. + +2003-03-04 Dmitry Diky + + * config/tc-msp430.c (mcu_types): Add recently announced x1122 + and x1123 devices, add missed x437. + (md_show_usage): Sort device list. + +2003-03-03 J"orn Rennecke + + * config/tc-sh.c (sh_dsp): Replace with preset_target_arch. + (md_begin): Use preset_target_arch. + (md_longopts): Make isa option unconditional. + (md_parse_option): Make OPTION_DSP and OPTION_ISA sh4 / any + set preset_target_arch. + (md_apply_fix3): If BFD_ASSEMBLER, adjust SWITCH_TABLE fixups + by -S_GET_VALUE (fixP->fx_subsy). + (tc_gen_reloc): For SWITCH_TABLE fixups, the symbol is fixp->fx_subsy, + and the addend is 0. + Adjust addend of R_SH_IND12W relocations by fixp->fx_offset - 4. + * config/tc-sh.h (TC_FORCE_RELOCATION_SUB_LOCAL): Define. + +2003-03-02 Thiemo Seufer + + * config/tc-mips.c (append_insn): Add handling of + BFD_RELOC_MIPSEMB_16_PCREL_S2. Avoid emitting unneeded + BFD_RELOC_16_PCREL_S2 relocs and add earlier warnings about + misaligned address and reange overflow. + (macro_build): Add handling of BFD_RELOC_MIPSEMB_16_PCREL_S2. Add + earlier warnings about misaligned address and reange overflow. + (mips_ip): Add handling of BFD_RELOC_MIPSEMB_16_PCREL_S2. + (md_apply_fix): Likewise. Fix warning output. + (tc_gen_reloc): Add handling of BFD_RELOC_MIPSEMB_16_PCREL_S2. + Allow BFD_RELOC_16_PCREL_S2 for all ABIs. + (md_convert_frag): Add handling of BFD_RELOC_MIPSEMB_16_PCREL_S2. + +2003-02-21 Nick Clifton + + * NEWS: Mention availability of test generator program. + +2003-02-21 Miles Bader + + * config/tc-v850.c (system_registers): Add v850e debug registers. + (system_register_name): Accept up to 27 (the last v850e sys register). + +2003-02-21 Bob Wilson + + * doc/as.texinfo: Define new COFF-ELF variable to conditionalize text + relevant to both COFF and ELF. Fix obvious typos and texinfo bugs. + Capitalize section headings consistently. Format index entries more + consistently. Unconditionalize text about whether text and data + sections are alterable. Use @ifnottex for alternatives to @tex output + so that HTML works. Clean up COFF vs. ELF descriptions of .section, + .size and .type directives. Be more polite about bad bug reports. + Move FDL into a separate file. + * doc/fdl.texi: New file. + +2003-02-21 Richard Sandiford + + * config/tc-mips.c (prev_reloc_op_frag): New variable. + (macro): Check it to decide whether a new frag is needed. + (my_getSmallExpression): Set it. + +2003-02-20 jmc + + * cgen.c: Fix typo: intial -> initial. + +2003-02-19 Jie Zhang + + * app.c (do_scrub_chars): Handle '||' in two states. + +2003-02-13 Alan Modra + + * write.c (TC_FORCE_RELOCATION_SUB_SAME): Revert last change. + * config/tc-s390.h (TC_FORCE_RELOCATION_SUB_SAME): Define. + +2003-02-11 Uwe Stieber + + * configure.in: Add support for kaOS as cross build target system. + * configure: Regenerated. + +2003-02-10 Nick Clifton + + * config/tc-arm.c (md_begin): If the Maverick co-processor is + selected, set the EF_ARM_MAVERICK_FLOAT flag and + bfd_mach_arm_ep9312 machine number. + +2003-02-08 Richard Sandiford + + * config/tc-mips.c (reloc_needs_lo_p): New function. + (fixup_has_matching_lo_p): New function. + (append_insn): Use reloc_needs_lo_p to check whether a relocation + might need a matching %lo(). Reuse the head of mips_hi_fixup_list + if that fixup already has a matching %lo(). Don't call frag_wane here. + (macro): Call frag_wane here if the last unmatched hi was in the + current frag. + (pic_need_relax): New function, split out from... + (md_estimate_size_before_relax): ...here. + (mips_frob_file): Use reloc_needs_lo_p. Use pic_need_relax to test + whether BFD_RELOC_MIPS_GOT16 fixups refer to global symbols. + +2003-02-07 Richard Sandiford + + * config/tc-mips.c (my_getSmallExpression): Rework bracket handling. + +2003-02-06 Alan Modra + + * config/tc-ppc.c (ppc_elf_suffix): Undo part of last change so that + x@toc+off works. + +2003-02-05 Alan Modra + + * config/tc-ppc.c (mapping): Handle new TLS reloc specs. + (ppc_elf_suffix): Don't warn for x+off@got when ppc64 and don't + accept x@got+off etc. + (md_assemble): Handle TLS relocs. + (ppc_force_relocation): Force for all TLS relocs. + (ppc_fix_adjustable): Likewise. + (md_apply_fix3): Handle TLS relocs. + +2003-02-04 Alan Modra + + * config/obj-elf.c (obj_elf_change_section): Set SEC_LINK_ONCE and + SEC_LINK_DUPLICATES_DISCARD directly rather than using elf_linkonce_p. + +2003-02-02 Richard Sandiford + + * config/tc-mips.c (enum small_ex_type): Remove. + (imm_unmatched_hi): Remove. + (md_assemble): Remove use of imm_unmatched_hi. Remove the last + argument from calls to append_insn. + (append_insn): Remove unmatched_hi parameter; check reloc_type[0] + instead. + (macro_build): Update append_insn calls. + (mips16_macro_build, macro_build_lui): Likewise. + (mips_ip): Rework handling of small expressions. Move explicit + relocation handling into my_getSmallExpression. Assume that the + value of 'o' operands is zero if there is only one bracketed + expression left. + (percent_op): Make constant. Record the BFD relocation code + associated with each operator. + (my_getSmallParser, my_getPercentOp): Remove. + (parse_relocation): New function. + (my_getSamllExpression): Rework. Fill in relocations here + rather than in mips_ip. + +2003-01-29 Nick Clifton + + * config/tc-i386.c (line_comment_chars): Add '#'. This makes the + assembler's handling of # "" directives work. + +2003-01-28 Jakub Jelinek + + * dwarf2dbg.c: Include filenames.h. + (struct file_entry): Make filename const char *. + (dirs, dirs_in_use, dirs_allocated): New variables. + (get_filenum): Add NUM argument. Build directory table. + (dwarf2_where): Adjust caller. + (dwarf2_directive_file): Use get_filenum to allocate + slot in file and directory tables. + (dwarf2_directive_loc): Recreate full filename from + directory and filename part if needed for listing. + (out_file_list): Output directory table. + Output main source file dirname before its filename. + +2003-01-28 Dmitry Diky + + * config/tc-msp430.c: Replace occurences of 'tolower' with + 'TOLOWER'. + +2003-01-27 David Mosberger + + * config/tc-ia64.c (dot_vframesp): Correct error message. + (dot_vframepsp): Ditto. + +2003-01-27 Alexandre Oliva + + * configure.in (em): Set to irix on all Irix systems. + * configure: Rebuilt. + * config/te-irix.h: New file. + * config/tc-mips.c (mips_dwarf2_format): Use TE_IRIX to decide + whether to use Irix-specific 64-bit format. + +2003-01-27 Martin Schwidefsky + + * config/tc-s390.c (s390_elf_cons): Avoid designated initializers. + +2003-01-25 Jakub Jelinek + + * config/tc-sparc.c (sparc_ip): Handle TLS % operators. + (tc_gen_reloc): Handle TLS relocs. + (sparc_cons, cons_fix_new_sparc): Handle %r_tls_dtpoff. + * config/tc-sparc.h (tc_fix_adjustable): Don't adjust TLS + relocs. + * config/obj-elf.c (obj_elf_section_word): Handle tls. + (obj_elf_type): Handle tls_object. + +2003-01-24 Martin Schwidefsky + + * config/tc-s390.c (s390_tls_suffix): New function. + (elf_suffix_type): Add suffix enums for TLS relocations. + (s390_elf_suffix): Add suffix strings for TLS relocations. + (s390_elf_cons): Map new lenght/elf suffix combinations for TLS to + bfd relocations. + (md_gather_operands): Map new instruction operand/elf suffix + combinations for TLS to bfd relocations. + (tc_s390_fix_adjustable): Add new TLS relocations. + (tc_s390_force_relocation): Likewise. + (md_apply_fix3): Likewise. + +2003-01-24 Alan Modra + + * as.h: Update copyright date. + * symbols.c: Likewise. + * config/tc-d10v.h: Likewise. + * config/tc-fr30.h: Likewise. + * config/tc-i960.h: Likewise. + * config/tc-mips.h: Likewise. + + * config/tc-hppa.h (DIFF_EXPR_OK): Define. + (MD_APPLY_SYM_VALUE): Move. + +2003-01-23 Nick Clifton + + * NEWS: Announce sh2e support. + + Add sh2e support: + 2002-04-02 Alexandre Oliva + * config/tc-sh.c (md_show_usage): Added sh2e next to sh3e. + (sh_elf_final_processing): Handle arch_sh2e. + +2003-01-23 Alan Modra + + * symbols.c (S_FORCE_RELOC): Add "strict" param. + * symbols.h (S_FORCE_RELOC): Likewise. + * config/obj-aout.h (S_FORCE_RELOC): Likewise. + * config/obj-bout.h (S_FORCE_RELOC): Likewise. + * config/obj-coff.h (S_FORCE_RELOC): Likewise. + * config/obj-ieee.h (S_FORCE_RELOC): Likewise. + * config/obj-vms.h (S_FORCE_RELOC): Likewise. + * write.c (generic_force_reloc): New function. + (TC_FORCE_RELOCATION): Use it here instead of S_FORCE_RELOC. + (TC_FORCE_RELOCATION_SUB_SAME): Test TC_FORCE_RELOCATION too. + (adjust_reloc_syms): Adjust S_FORCE_RELOC call. + * as.h (generic_force_reloc): Declare. + * doc/internals.texi (S_FORCE_RELOC): Update. + (TC_FORCE_RELOCATION_SUB_SAME): Update. + + * config/tc-alpha.c (alpha_force_relocation): Adjust to use + generic_force_reloc. + (alpha_fix_adjustable): Likewise. + * config/tc-arm.c (arm_force_relocation): Likewise. + * config/tc-cris.c (md_cris_force_relocation): Likewise. + * config/tc-frv.c (frv_force_relocation): Likewise. + * config/tc-i386.c (md_apply_fix3): Likewise. + * config/tc-ia64.c (ia64_force_relocation): Likewise. + * config/tc-ip2k.c (ip2k_force_relocation): Likewise. + * config/tc-m32r.c (m32r_force_relocation): Likewise. + * config/tc-m68hc11.c (tc_m68hc11_force_relocation): Likewise. + * config/tc-mcore.c (mcore_force_relocation): Likewise. + * config/tc-mips.c (mips_force_relocation): Likewise. + * config/tc-mmix.c (mmix_force_relocation): Likewise. + * config/tc-ppc.c (ppc_force_relocation): Likewise. + * config/tc-s390.c (tc_s390_force_relocation): Likewise. + * config/tc-sh.c (sh_force_relocation): Likewise. + (md_pcrel_from_section): Likewise. + * config/tc-sparc.c (tc_gen_reloc): Likewise. + * config/tc-v850.c (v850_force_relocation): Likewise. + * config/tc-xstormy16.c (xstormy16_force_relocation): Likewise. + * config/tc-i386.h (TC_FORCE_RELOCATION): Likewise. + * config/tc-mcore.h (TC_FORCE_RELOCATION): Likewise. + * config/tc-sparc.h (tc_fix_adjustable): Likewise. + + * config/tc-d10v.c (d10v_force_relocation): Delete. + * config/tc-d10v.h (TC_FORCE_RELOCATION): Don't define. + * config/tc-dlx.c (md_dlx_force_relocation): Delete. + * config/tc-dlx.h (TC_FORCE_RELOCATION): Don't define. + * config/tc-fr30.c (fr30_force_relocation): Delete. + * config/tc-fr30.h (TC_FORCE_RELOCATION): Don't define. + * config/tc-mn10300.c (mn10300_force_relocation): Delete. + * config/tc-mn10300.h (TC_FORCE_RELOCATION): Don't define. + (TC_FORCE_RELOCATION_SUB_SAME): Test TC_FORCE_RELOCATION too. + * config/tc-i960.h (TC_FORCE_RELOCATION_SUB_SAME): Likewise. + * config/tc-hppa.c (hppa_force_relocation): Adjust S_FORCE_RELOC call. + * config/tc-mips.c (RELAX_BRANCH_TOOFAR): Warning fix. + * config/tc-mips.h (TC_FORCE_RELOCATION_SUB_SAME): Don't define. + * config/tc-openrisc.c (openrisc_force_relocation): Delete. + * config/tc-openrisc.h (TC_FORCE_RELOCATION): Don't define. + * config/tc-sparc.c (elf32_sparc_force_relocation): Delete. + * config/tc-sparc.h (TC_FORCE_RELOCATION): Don't define for ELF. + * config/tc-i386.c (i386_force_relocation): Delete. + * config/tc-i386.h (TC_FORCE_RELOCATION): Don't define for + BFD_ASSEMBLER. + (EXTERN_FORCE_RELOC): Fix TE_PE and STRICT_PE_FORMAT nesting. + * config/tc-m68k.h (TC_FORCE_RELOCATION): Don't define. + * config/tc-pj.h (TC_FORCE_RELOCATION): Don't define. + * config/tc-sh.h (TC_FORCE_RELOCATION_SUB_ABS): Don't call + S_FORCE_RELOC. + (TC_FORCE_RELOCATION_SUB_SAME): Test TC_FORCE_RELOCATION too. + * config/tc-sh64.h (TC_FORCE_RELOCATION_SUB_SAME): Likewise. + +2003-01-23 Alan Modra + + * config/tc-sh64.c (shmedia_frob_section_type): Adjust for changed + sh64_elf_section_data. + * config/tc-sh64.h: Include elf32-sh64.h. + * config/tc-m68hc11.c: Don't include stdio.h. + (md_show_usage): Fix missing continuation. + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + +2003-01-22 Nick Clifton + + * as.h: Include fopen-bin.h not fopen-same.h for mingw32 hosts. + +2003-01-21 Fabio Alemagna + + * configure.in: Handle *-*-aros*. + * configure: Regenerated from configure.in. + +2003-01-20 Martin Schwidefsky + + * config/tc-s390.c (elf_suffix_type): Add suffix enums for gotoff, + gotplt and pltoff relocations. + (s390_elf_suffix): Add suffix strings for gotoff, gotplt and pltoff. + (s390_elf_cons): Map new lenght/elf suffix combinations for gotoff, + gotplt and pltoff to bfd relocations. + (md_gather_operands): Map new instruction operand/elf suffix + combinations to bfd relocations. + (tc_s390_fix_adjustable): Add new gotoff, gotplt and pltoff relocations + to the list of unadjustable relocations. + (tc_s390_force_relocation): Always emit relocations for gotoff, gotplt + and pltoff relocations. + (md_apply_fix3): Add the new relocations. + +2003-01-20 Martin Schwidefsky + + * config/tc-s390.c (md_apply_fix3): Emit error message for relocations + with a subsy symbol. + +2003-01-17 Stephane Carrez + + * config/tc-m68hc11.c (tc_m68hc11_fix_adjustable): Prevent adjustment + of relocs for memory bank addressing. + +2003-01-17 Stephane Carrez + + * config/tc-m68hc11.c (md_show_usage): Update usage. + (md_parse_option): Recognize -m68hcs12. + (m68hc11_elf_final_processing): Set EF_M68HCS12_MACH flag to identify + HCS12. + * doc/as.texinfo (Overview): Document new option -m68hcs12. + +2003-01-16 Jakub Jelinek + + * config/tc-ia64.c (ia64_cons_fix_new): Handle @dtprel() in data. + +2003-01-16 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + +2003-01-11 Alan Modra + + * read.c (get_absolute_expr): New, split out from.. + (get_absolute_expression): ..here. + * read.h (get_absolute_expr): Declare. + * config/obj-elf.c (elf_common): Use offsetT for "temp" and "size". + Trim size to arch bits_per_address, and test for negative input + via get_absolute_expr. + +2003-01-07 DJ Delorie + + * config/tc-xstormy16.c (md_cgen_lookup_reloc): Adjust value based + on operand type. + (xstormy16_md_apply_fix3): Use adjustment. + +2003-01-02 Ben Elliston + + * configure.in: Add iq2000-elf target. + * configure: Regenerate. + * config/tc-iq2000.c: New file. + * config/tc-iq2000.h: Likewise. + * po/gas.pot: Regenerate. + +2003-01-02 Chris Demetriou + + * config/tc-mips.c: Update copyright years to include 2003. + (mips_ip): Fix indentation of "+A", "+B", and "+C" handling. + Additionally, clean up their code slightly and clean up their + comments some more. + + * doc/c-mips.texi: Add MIPS32r2 to ".set mipsN" documentation. + +2003-01-01 Daniel Jacobowitz + + * doc/Makefile.am (as.1): Depend on "asconfig.texi gasver.texi + $(CPU_DOCS)". + * doc/Makefile.in: Regenerate. + +2003-01-01 John David Anglin + + * config/obj-elf.c (special_sections): Work around HP's incorrect usage + of .init and .fini sections for array initializers and finalizers. + +2002-12-31 Chris Demetriou + + * config/tc-mips.c (validate_mips_insn, mips_ip): Recognize + the "+D" operand, which will be used only by the disassembler. + +2002-12-30 Chris Demetriou + + * configure.in: Recognize mipsisa32r2, mipsisa32r2el, and + CPU variants. + * configure: Regenerate. + * config/tc-mips.c (ISA_HAS_DROR, ISA_HAS_ROR): New defines. + (macro_build): Handle "K" operand. + (macro2): Use ISA_HAS_DROR and ISA_HAS_ROR in the places where + CPU_HAS_DROR and CPU_HAS_ROR are currently used. + (mips_ip): New variable "lastpos", and implement "+A", "+B", + and "+C" operands for MIPS32 Release 2 ins/ext instructions. + Implement "K" operand for MIPS32 Release 2 rdhwr instruction. + (validate_mips_insn): Implement "+" as a way to extend the + allowed operands, and implement "K", "+A", "+B", and "+C" + operands. + (OPTION_MIPS32R2): New define. + (md_longopts): Add entry for OPTION_MIPS32R2. + (OPTION_ELF_BASE): Adjust to accommodate OPTIONS_MIPS32R2. + (md_parse_option): Handle OPTION_MIPS32R2. + (s_mipsset): Reimplement handling of ".set mipsN" options + and add support for ".set mips32r2". + (mips_cpu_info_table): Add entry for "mips32r2" (MIPS32 Release 2). + (md_show_usage): Document "-mips32r2" option. + * doc/as.texinfo: Document "-mips32r2" option. + * doc/c-mips.texi: Likewise. + +2002-12-30 Dmitry Diky + + * configure.in: Add msp430 target. + * configure: Regenerate. + * Makefile.am: Add msp430 target. + * Makefile.in: Regenerate. + * config/tc-msp430.c: New file: msp430 assembler. + * config/tc-msp430.h: New file: target macros for msp430. + * doc/Makefile.am: Add msp430 target. + * doc/Makefile.in: Regenerate. + * doc/as.texinfo: Include msp430 documenation. + * doc/all.texi: Enable msp430 documentation. + * doc/c-msp430.texi: New file: document msp430 specific features + of the assembler. + +2002-12-25 Alexandre Oliva + + * dwarf2dbg.c (DWARF2_ADDR_SIZE): New macro. + (dwarf2_finish): Use it. + * doc/internals.texi (DWARF2_ADDR_SIZE): Document it. + * config/tc-mips.h (DWARF2_ADDR_SIZE): Override. + +2002-12-20 DJ Delorie + + * config/tc-xstormy16.c (md_cgen_lookup_reloc): Support + BFD_RELOC_XSTORMY16_12. + +2002-12-19 Alan Modra + + * doc/as.texinfo (Invoking): Typo fix. + * config/tc-tic54x.c (encode_operand): Comment typo fix. + +2002-12-18 Kazu Hirata + + * doc/c-alpha.texi: Fix typos. + * doc/c-arm.texi: Likewise. + * doc/c-d10v.texi: Likewise. + * doc/c-i370.texi: Likewise. + * doc/c-i960.texi: Likewise. + * doc/c-ia64.texi: Likewise. + * doc/c-mmix.texi: Likewise. + * doc/c-ns32k.texi: Likewise. + * doc/c-pdp11.texi: Likewise. + * doc/c-pj.texi: Likewise. + * doc/c-sh64.texi: Likewise. + * doc/c-sparc.texi: Likewise. + * doc/c-tic54x.texi: Likewise. + * doc/c-v850.texi: Likewise. + * doc/c-vax.texi: Likewise. + * doc/internals.texi: Likewise. + +2002-12-18 Chris Demetriou + + * config/tc-mips.c (macro): In M_DROL, M_DROR, M_ROL, and M_ROR, + use hardware rotate ops as appropriate. In M_DROL_I, M_DROR_I, + M_ROL_I, and M_ROR_I, simplify code, clean up warnings, and + arrange not to issue warnings about use of AT when AT is not + actually used. + +2002-12-17 Nick Clifton + + * as.c (std_longopts): Duplicate --keep-locals entry in order to + prevent it being confused with -k. + +2002-12-16 Andrew MacLeod + + * config/tc-xstormy16.c (md_cgen_lookup_reloc): If a relocation + has already been set up, use it. + +2002-12-16 Kazu Hirata + + * ChangeLog-9295: Fix a typo. + * README: Likewise. + * config/tc-d10v.c: Fix a comment typo. + * config/tc-dlx.c: Likewise. + * config/tc-h8300.h: Likewise. + * config/tc-h8500.h: Likewise. + * config/tc-mips.c: Likewise. + * config/tc-s390.c: Likewise. + * config/tc-sh.h: Likewise. + * config/tc-tic80.h: Likewise. + * config/tc-w65.h: Likewise. + * config/tc-z8k.c: Likewise. + * config/tc-z8k.h: Likewise. + * testsuite/gas/h8300/cmpsi2.s: Likewise. + +2002-12-16 Alan Modra + + * config/tc-d30v.c (check_range): Warning fixes, formatting. + Simplify sign extension. Remove redundant unsigned < 0 test. + * config/tc-i960.c (md_ri_to_chars): Prototype. + * config/tc-mcore.c (md_pseudo_table): Fix typo. + (dump_literals): Init brarsym, and test later instead of isforce. + + * config/tc-ns32k.c (encode_operand): Constify operandsP and suffixP. + (parse): Constify line and lineptr. + (md_begin): Calculate endop here. + +2002-12-13 Alan Modra + + * config/obj-vms.c: Formatting. Include fnctl.h. + (Create_VMS_Object_File): Fix creat call for sane unix systems. + (Object_Record_Offset): Make it a size_t. + (Flush_VMS_Object_Record_Buffer): Fix signed/unsigned warning. + (VMS_TBT_Routine_End ): Make var unsigned long. + (VMS_Fix_Indirect_Reference ): Make arg addressT. + (synthesize_data_segment ): Remove ATTRIBUTE_UNUSED. + (vms_fixup_data_section ): Add here instead. + * config/e-criself.c: Fix typo in last change. + +2002-12-13 Alan Modra + + * write.c (write_object_file): Fix signed/unsigned warning. + * config/e-crisaout.c (crisaout_bfd_name): Prototype. + * config/e-criself.c (criself_bfd_name): Prototype. + * config/obj-aout.c (s_sect): Remove unused function. + * config/obj-bout.c (obj_bout_line ): Add ATTRIBUTE_UNUSED. + * config/obj-coff.c (coff_last_bf): Don't declare for OBJ_XCOFF. + (fixup_mdeps ): Add ATTRIBUTE_UNUSED. + * config/obj-ecoff.c (ecoff_frob_file ): Likewise. + * config/obj-vms.c (setup_basic_type ): Likewise. + (VMS_RSYM_Parse ): Likewise. + (vms_fixup_text_section ): Likewise. + (synthesize_data_segment ): Likewise. + (vms_fixup_xtors_section ): Likewise. + (structure_count): Don't use implicit int type. + * config/tc-a29k.c (insert_sreg): Prototype. + (define_some_regs): Prototype, make static. + (parse_operand): Likewise. + (md_parse_option ): Add ATTRIBUTE_UNUSED. + (md_show_usage ): Likewise. + (md_section_align ): Likewise. + (md_convert_frag ): Likewise. + (md_estimate_size_before_relax ): Likewise. + (md_apply_fix3): Don't cast valP pointer type. Fix bogus >>='s. + * config/tc-arm.c (arm_validate_fix): Only for OBJ_COFF or OBJ_ELF. + * config/tc-d30v.c (md_parse_option ): Add ATTRIBUTE_UNUSED. + (md_undefined_symbol ): Likewise. + (md_convert_frag ): Likewise. + (write_long ): Likewise. + (tc_gen_reloc ): Likewise. + (md_estimate_size_before_relax ): Likewise. + (md_apply_fix3 ): Likewise. + (s_d30v_align ): Likewise. + (build_insn): Correct format string. + (md_apply_fix3): Likewise. + * config/tc-fr30.c (md_parse_option ): Add ATTRIBUTE_UNUSED. + (md_undefined_symbol ): Likewise. + (md_convert_frag ): Likewise. + (md_cgen_lookup_reloc ): Likewise. + (md_begin): Delete unused vars. + (md_assemble): Likewise. + (md_estimate_size_before_relax): Likewise. + (fr30_relax_frag): #if 0 out, seems unused. + (md_atof): Remove declaration of atof_ieee. + (restore_colon): Prototype. + * config/tc-frv.c (frv_insert_vliw_insn): Prototype. + (frv_find_in_vliw): Likewise. + (frv_debug_tomcat): Likewise. + (frv_adjust_vliw_count): Likewise. + (frv_tomcat_shuffle): Likewise. + (frv_tomcat_analyze_vliw_chains): Likewise. Correct args to + frv_find_in_vliw call. + (md_atof): Remove declaration of atof_ieee. + * config/tc-h8500.c (cons): Delete declaration. + (md_begin ): Constify. + (displacement_size, immediate_size, absolute_size): Remove. + (build_relaxable_instruction ): Add ATTRIBUTE_UNUSED. + (tc_crawl_symbol_chain ): Likewise. + (md_undefined_symbol ): Likewise. + (tc_headers_hook ): Likewise. + (md_parse_option ): Likewise. + (md_show_usage ): Likewise. + (md_convert_frag ): Likewise. + (tc_coff_symbol_emit_hook ): Likewise. + (md_atof): Remove declaration of atof_ieee. + (tc_aout_fix_to_chars): Remove unused function. + (parse_reg): Prototype. + (parse_exp): Prototype. + (skip_colonthing): Prototype. Use &&, not & in logical expressions. + (parse_reglist): Prototype. + (get_operand): Prototype. + (get_operands): Prototype. + (get_specific): Prototype. Make "this_index" signed. + (check): Prototype, make static. + (insert): Prototype + (build_relaxable_instruction): Prototype, make static. + (build_bytes): Prototype. + (wordify_scb): Prototype. + * config/tc-h8500.h (start_label): Declare. + (tc_coff_sizemachdep): Declare. + * config/tc-i370.c (i370_ebcdic ): Add ATTRIBUTE_UNUSED. + (i370_rmode ): Likewise. + (i370_csect ): Likewise. + (i370_dc ): Likewise. + (i370_ds ): Likewise. + (i370_elf_lcomm ): Likewise. + (i370_ltorg ): Likewise. + (i370_using ): Likewise. + (i370_drop ): Likewise. + (i370_byte ): Likewise. + (i370_tc ): Likewise. + (md_estimate_size_before_relax ): Likewise. + (md_convert_frag ): Likewise. + (md_undefined_symbol ): Likewise. + (md_pcrel_from_section ): Likewise. + (tc_gen_reloc ): Likewise. + (i370_section_letter): #if 0 unused functions. + (i370_section_word, i370_section_type, i370_section_flags): Likewise. + (symbol_locate): Prototype. + * config/tc-i860.c (md_atof): Remove declaration of atof_ieee. + (md_number_to_disp, md_number_to_field): Remove. + (md_apply_fix3): Correct format string and cast "fup". + * config/tc-i960.c (md_convert_frag): Add ATTRIBUTE_UNUSED to args. + (s_endian ): Likewise. + (md_undefined_symbol ): Likewise. + (tc_crawl_symbol_chain ): Likewise. + (tc_set_bal_of_call): Likewise. + (tc_coff_symbol_emit_hook ): Likewise. + (i960_handle_align ): Likewise. + (i960_validate_fix ): Likewise + (tc_gen_reloc
): Likewise. + (tc_coff_symbol_emit_hook): Only define for OBJ_COFF. + (struct memS, struct regop): Forward declare. + (brcnt_emit, brlab_next, cobr_fmt, ctrl_fmt, emit, get_args, + get_cdisp, get_ispec, get_regnum, i_scan, mem_fmt, mema_to_memb, + parse_expr, parse_ldconst, parse_memop, parse_po, parse_regop, + reg_fmt, relax_cobr, s_leafproc, s_sysproc, shift_ok, syntax, + targ_has_sfr, targ_has_iclass, tc_bfd_fix2rtype): Prototype. + (md_chars_to_number, md_number_to_imm): Make static, prototype. + (md_number_to_field): Likewise. + (md_number_to_disp): Remove unused function. + (md_atof): Remove declaration of atof_ieee. + (md_apply_fix3): Correct md_number_to_imm call. + * config/tc-ip2k.c (md_assemble): Warning fix. + * config/tc-m32r.c (md_parse_option ): Add ATTRIBUTE_UNUSED. + (fill_insn ): Likewise. + (debug_sym ): Likewise. + (md_undefined_symbol ): Likewise. + (m32r_scomm ): Likewise. + (md_convert_frag ): Likewise. + (md_cgen_lookup_reloc ): Likewise. + (m32r_record_hi16 ): Likewise. + (md_estimate_size_before_relax): #if 0 old_fr_fix. + (allow_m32rx): Prototype. + (first_writes_to_seconds_operands): Prototype. + (writes_to_pc): Prototype. + (can_make_parallel): Prototype. + (make_parallel): Prototype. + (target_make_parallel): Prototype. + (assemble_two_insns): Prototype. + (m32r_record_hi16): Prototype. + (md_atof): Remove declaration of atof_ieee. + * config/tc-m32r.h (m32r_fix_adjustable): Declare. + (m32r_force_relocation): Prototype. + (m32r_elf_section_change_hook): Prototype. + * config/tc-m68k.c (tc_gen_reloc
): Add ATTRIBUTE_UNUSED. + (md_show_usage): Fix signed/unsigned warning. + * config/tc-m88k.c (get_reg): Make reg_prefix param unsigned. + (calcop): Ditto for reg_prefix var. + (hexval): Add cast to fix signed/unsigned warning. + (md_number_to_disp): Delete unused function. + (md_number_to_field): Likewise. + (float_cons, cons, s_globl, s_space, s_set, s_lcomm): Remove decl. + (match_name): Prototype. + (get_bf2): Prototype. + (get_bf_offset_expression): Prototype. + * config/tc-mcore.c (mcore_s_literals ): Add ATTRIBUTE_UNUSED. + (md_undefined_symbol ): Likewise. + (md_create_short_jump ): Likewise. + (md_create_long_jump ): Likewise. + (md_convert_frag ): Likewise. + (md_apply_fix3 ): Likewise. + (md_section_align ): Likewise. + (md_pcrel_from_section ): Likewise. + (tc_gen_reloc
): Likewise. + (reg_m, reg_n, immediate): Delete unused vars. + (dump_literals): Fix signed/unsigned warning. + (enter_literal): Likewise. + (parse_imm): Likewise. Also fix format string. + (parse_mem): Remove unused var. + (md_assemble ): Abort on unexpected inst. + (md_atof): Remove declaration of atof_ieee. + (md_parse_option): Remove unused vars. + (md_apply_fix3): Fix format strings, cast args. + (tc_gen_reloc): Delete unused var. + * config/tc-mcore.h (tc_coff_sizemachdep): Declare. + * config/tc-mn10200.c (md_parse_option ): Add ATTRIBUTE_UNUSED. + (md_undefined_symbol ): Likewise. + (md_convert_frag ): Likewise. + (tc_gen_reloc ): Likewise. + (check_operand ): Likewise. + (md_convert_frag): Fix format strings. + (tc_gen_reloc): Delete fx_addsy - fx_subsy code. + * config/tc-openrisc.c (ignore_pseudo): Prototype. + (md_atof): Remove declaration of atof_ieee. + * config/tc-or32.c (parse_operand): Prototype non-BFD too. + (md_apply_fix3): Fix bogus >>='s. + (md_undefined_symbol): Delete unused var. + * config/tc-pj.c (little, big, parse_exp_save_ilp): Prototype. + (c_to_r, ipush_code, fake_opcode, alias): Likewise. + (fake_opcode): Adjust for pj_opc_int_t change. + (md_begin): Likewise. + (md_assemble): Likewise. + (ipush_code): Correct parse_exp_save_ilp call. Test pending_reloc + instead of non-existent third arg of parse_exp_save_ilp. + (md_parse_option): Correct "little" and "big" calls. + * config/tc-sparc.c (s_register): Only declare #ifdef OBJ_ELF. + (md_apply_fix3 ): Add ATTRIBUTE_UNUSED. + (tc_gen_reloc
): Likewise. + * config/tc-tic30.c: #include stdarg.h or varargs.h. + (debug): Rewrite using VA_* macros. + (md_estimate_size_before_relax): Add ATTRIBUTE_UNUSED to args. + (md_convert_frag): Likewise. + (md_parse_option): Likewise. + (md_show_usage): Likewise. + (md_undefined_symbol): Likewise. + (tc_gen_reloc): Likewise. + (md_operand): Likewise. + (tc_aout_pre_write_hook): Delete. + (struct tic30_insn): Make "operands" unsigned. + (struct tic30_par_insn): Likewise. + (md_assemble): Likewise for "count", "i" and "numops". + (tic30_parallel_insn): Likewise for vars here. + (tic30_operand): Likewise. Remove useless unsigned >= 0 comparison. + * config/tc-tic30.h (tc_aout_pre_write_hook): Define as empty. + * config/tc-tic80.c (obj_coff_section): Delete declaration. + (md_estimate_size_before_relax): Add ATTRIBUTE_UNUSED on args. + (md_undefined_symbol): Likewise. + (md_parse_option): Likewise. + (md_convert_frag): Likewise. + (tc_coff_symbol_emit_hook): Likewise. + (md_atof): Remove declaration of atof_ieee. + (const_overflow): Warning fixes, tidy. + (get_operands): Delete unused vars. + (internal_error_a): Adjust format string to expect a long for arg. + (find_opcode): Warning fixes, simplify. + (build_insn): Cast internal_error_a arg. + (md_begin): Likewise. + (md_apply_fix3): Likewise. + (md_assemble): Delete unused var. + * config/tc-tic80.h (tc_coff_fix2rtype): Prototype. + * config/tc-z8k.c (cons, obj_coff_section): Delete declarations. + (whatreg, parse_reg, parse_exp): Make static, prototype. + (checkfor, regword, regaddr, get_ctrl_operand): Prototype. + (get_flags_operand, get_interrupt_operand, get_cc_operand): Likewise. + (get_operand, get_operands, get_specific, newfix): Likewise. + (apply_fix, build_bytes): Likewise. + (md_atof): Remove declaration of atof_ieee. + (tc_aout_fix_to_chars): Delete. + (md_begin): Constify "opcode". Don't try to init opcode->idx. + Fix s_unseg call. + (md_parse_option): Fix s_segm and s_unseg calls. + +2002-12-12 Alexandre Oliva + + * tc-mips.c (RELAX_BRANCH_ENCODE): Remove reloc_s2 argument. + Adjust callers. + (RELAX_BRANCH_RELOC_S2): Delete. + (append_insn): Use only BFD_RELOC_16_PCREL_S2 for branches. + Do not handle BFD_RELOC_16_PCREL. + (macro_build, mips_ip): Likewise. + (md_pcrel_from): Return 4 for undefined symbols regardless of + mips_pic. + (md_apply_fix3): Use only BFD_RELOC_16_PCREL_S2 for branches. + Don't dereference howto if no such relocation is available. + Do not apply hack for in-place zero addend in NEWABI. + (md_convert_frag): Use only BFD_RELOC_16_PCREL_S2 for branches. + +2002-12-12 Alexandre Oliva , + Alan Modra + + * config/tc-mn10300.h (TC_VALIDATE_FIX_SUB): Define. + (TC_LINKRELAX_FIXUP): Add comments. + +2002-12-12 Alexandre Oliva + + * config/tc-mn10300.c (set_arch_mach): Change argument type to + avoid warnings. + (r_register_name, xr_register_name): Add prototype declarations. + +2002-12-08 H.J. Lu + + * config/tc-ia64.c (md_apply_fix3): Remove the PCREL hack + copied from tc-i386.c. + +2002-12-08 Stephane Carrez + + Fix Bug savannah/1825: + * config/tc-m68hc11.c (STATE_INDEXED_PCREL): New relax code. + (md_relax_table): Define specific relax for PC-rel offsets. + (build_indexed_byte): Use a STATE_INDEXED_PCREL relax code. + (m68hc11_relax_frag): Handle the new relax code. + (md_convert_frag): Likewise. + (md_estimate_size_before_relax): Likewise. + +2002-12-08 Alan Modra + + * subsegs.c (section_symbol): Use the symbol, not the section, name. + +2002-12-05 Richard Henderson + + * config/ia64.c (enum reloc_func): Add FUNC_LT_RELATIVE_X. + (ia64_gen_real_reloc_type): Handle it. + (pseudo_func): Add @ltoffx. + (md_begin): Build .. + (ia64_force_relocation): True for LTOFF22X and LDXMOV. + +2002-12-05 Alan Modra + + * config/tc-arm.c (arm_force_relocation): Move out of #if OBJ_ELF. + Move OBJ_COFF TC_FORCE_RELOCATION code here so that COFF handles + ARM_IMMEDIATE and ARM_ADRL_IMMEDIATE relocs as for ELF. + * config/tc-arm.h (TC_FORCE_RELOCATION): Define for both ELF and + COFF to call arm_force_relocation. + +2002-12-04 David Mosberger + + * config/tc-ia64.c (pseudo_func): Add "@pause" constant for "hint" + instruction. + (emit_one_bundle): Handle "hint" instruction. + (operand_match): Match IA64_OPND_AR_CSD. + +2002-12-04 Alan Modra + + * dwarf2dbg.c (scale_addr_delta): Correct parameter. Move prototype + inside #if. + +2002-12-03 Nick Clifton + + * config/tc-ppc.c (ppc_cleanup): Do not set SEC_MERGE flag on + .PPC.EMB.apuinfo sections. + +2002-12-03 Richard Henderson + + * config/tc-ia64.c (operand_match): Add IA64_OPND_LDXMOV case. + +2002-12-03 Alan Modra + + * config/tc-w65.c (s_longa): Prototype. Make static, specify int arg. + (cons, s_align_bytes): Delete declaration. + (relax): Delete. + (md_begin): Constify "struct opinfo *" var. Don't try to make "name" + strings common. + (dot): Delete unused function. + (w65_expression): Remove unused arg. + (parse_exp): Prototype. Remove unused arg. Adjust w65_expression + call. + (get_operands): Prototype. Constify "struct opinfo *" arg. Fix + parse_exp call. + (get_specific): Prototype. Constify "struct opinfo *" arg and return + value. + (check): Remove unused function. + (build_Mytes): Prototype. Constify "struct opinfo *" arg. Abort + on unhandled switch case. + (md_assemble): Remove unused op_start, op_end, nlen, p vars. Constify + "opcode". + (tc_crawl_symbol_chain): Delete unused function. + (tc_headers_hook): Likewise. + (tc_Nout_fix_to_chars): Likewise. + (md_undefined_symbol): Add ATTRIBUTE_UNUSED. + (md_parse_option): Likewise. + (md_convert_frag): Likewise. + (tc_coff_symbol_emit_hook): Likewise. + (md_show_usage): Likewise. + * config/tc-w65.h (tc_coff_sizemachdep): Declare. + (TC_PARSE_CONS_EXPRESSION): w65_expression takes one arg. + (w65_expression): Declare. + + * po/POTFILES.in: Regenerate. + + * config/tc-arm.c (arm_force_relocation): Return 0 for ARM_IMMEDIATE + and ARM_ADRL_IMMEDIATE. + +2002-12-02 Nick Clifton + + * gasp.c: Delete. It has been deprecated. + * NEWS: Mention that gasp has been removed. + * Makefile.am: Remove references to gasp. + * makefile.vms: Likewise. + * mpw-make.sed: Likewise. + * Makeile.in: Regenerate. + * doc/gasp.texi: Delete. + * doc/Makefile.am: Remove references to gasp.texi. + * doc/Makefile.in: Regenerate. + * macro.c: Delete references to gasp. + Remove use of comment_char function parameter as it is no longer + needed. + * macro.h: Update prototypes to remove comment_char parameter. + Fix formatting. + * read.c (read_a_source_file, s_irp): Remove comment_char + parameter from invocation of functions in macro.c + +2002-12-02 Hans-Peter Nilsson + + * read.c (emit_expr) [!WORKING_DOT_WORD]: Initialize x->use_jump. + +2002-12-01 Stephane Carrez + + * config/tc-m68hc11.c (md_begin): Fix qsort warning. + (tc_gen_reloc): Mark section param as not used. + +2002-12-01 Stephane Carrez + + Fix Bug savannah/1825: + * config/tc-m68hc11.h (md_relax_frag): Define to support relaxations + that are not pc-relative. + (m68hc11_relax_frag): Declare. + + * config/tc-m68hc11.c (build_indexed_byte): Use a frag_var to handle + the offsetable indexed addressing modes (n,r). + (build_insn): Cleanup some locals. + (m68hc11_relax_frag): New function imported from tc-cris.c to handle + relaxation of difference between two symbols of same section. + (md_convert_frag): For INDEXED_OFFSET relaxs, use the displacement + only when this is a PC-relative operand and the offset is not absolute. + (md_estimate_size_before_relax): Convert the INDEXED_OFFSET,UNDEF frag + to INDEXED_OFFSET,STATE_BITS5 when the symbol is absolute; this will + be handled by m68hc11_relax_frag. + +2002-12-01 Stephane Carrez + + * config/tc-m68hc11.c (elf_flags): Set default ABI to gcc default + (32-bit int, 64-bit double). + (md_longopts): New options -mshort, -mlong, -mshort-double and + -mlong-double to control the ABI. + (md_show_usage): Update. + (md_parse_option): Handle new options. + * doc/as.texinfo (Overview): Document new options for HC11/HC12. + +2002-12-01 Nathan Sidwell + + * symbols.c (report_op_error): New function, broken out of ... + (resolve_symbol_value): ... here. Use for both monadic and dyadic + operators. + +2002-11-30 Kaz Kojima + + * config/tc-sh.c (md_apply_fix3): Take account of fx_offset + for BFD_RELOC_32_PLT_PCREL. + +2002-11-30 Alan Modra + + * dwarf2dbg.c, write.c, config/obj-aout.c, config/obj-coff.c, + config/obj-ecoff.c, config/obj-elf.c, config/obj-som.c, + config/tc-arm.c, config/tc-arm.h, config/tc-avr.c, config/tc-cris.c, + config/tc-d10v.c, config/tc-d10v.h, config/tc-d30v.c, config/tc-d30v.h, + config/tc-dlx.c, config/tc-dlx.h, config/tc-fr30.c, config/tc-fr30.h, + config/tc-frv.c, config/tc-frv.h, config/tc-hppa.c, config/tc-i370.c, + config/tc-i386.c, config/tc-i386.h, config/tc-m32r.c, + config/tc-m68hc11.c, config/tc-mcore.c, config/tc-mcore.h, + config/tc-mips.c, config/tc-mips.h, config/tc-mn10200.c, + config/tc-mn10300.c, config/tc-mn10300.h, config/tc-openrisc.c, + config/tc-openrisc.h, config/tc-ppc.c, config/tc-s390.c, + config/tc-sh.c, config/tc-sh.h, config/tc-sh64.c, config/tc-tic54x.c, + config/tc-v850.c, config/tc-v850.h, config/tc-xstormy16.c, + config/tc-xstormy16.h: Replace boolean with bfd_boolean, true with + TRUE, false with FALSE. Simplify comparisons of bfd_boolean vars with + TRUE/FALSE. Formatting. + +2002-11-29 Nick Clifton + + * config/tc-arm.c (do_t_bkpt): If no operand is specified, + assume a value of zero. + (do_bkpt): Likewise. + +2002-11-29 Kaz Kojima + + * config/tc-sh.c (md_apply_fix3): Call S_SET_THREAD_LOCAL + for TLS relocations. + +2002-11-29 Jakub Jelinek + + * config/tc-ia64.c (md_apply_fix3): Add default case. + +2002-11-28 Jakub Jelinek + + * symbols.c (S_SET_THREAD_LOCAL): New function. + * symbols.h (S_SET_THREAD_LOCAL): New prototype. + * config/tc-i386.c (md_apply_fix3): Call S_SET_THREAD_LOCAL + for TLS relocations. + * config/tc-ia64.c (md_apply_fix3): Likewise. + * config/tc-alpha.c (md_apply_fix3): Likewise. + +2002-11-28 Jakub Jelinek + + * write.c (subsegs_finish): For SEC_MERGE sections pad last fragment + to entsize. + +2002-11-26 DJ Delorie + + * config/tc-cris.c (cris_relax_frag): Fix typo in comment. + (md_assemble): Don't pass on branches to constants as relaxable. + Tweak comment. + +2002-11-25 Svein E. Seldal + + * config/tc-tic4x.c (c4x_operands_match): Bugfix in direct mode + +2002-11-21 Randolph Chung + + * config/tc-hppa.h (tc_frob_symbol): Frob undefined unused symbols + only if they have default visibility. + +2002-11-21 Richard Henderson + + * config/tc-alpha.c (alpha_fix_adjustable): Remove redundant + S_IS_DEFINED test. + +2002-11-21 Alan Modra + + * config/tc-mcore.c (mcore_pool_count): New function. + (mcore_cons, mcore_float_cons, mcore_stringer, mcore_fill): Use it. + +2002-11-20 Klee Dienes + + * config/tc-mcore.c (md_begin): Use a const iterator. Don't + coalesce the name fields to use the same pointer. + + * config/tc-sh.c (md_begin): Use a const iterator. Don't coalesce + the name fields to use the same pointer. + (get_specific): Check for opcodes with the same name using strcmp + as well as comparing the pointer. + +2002-11-20 Alan Modra + + * write.c (adjust_reloc_syms): Don't reduce SEC_MERGE fixups with + fx_subsy non-NULL. + +2002-11-19 Richard Henderson + + * config/obj-elf.c (obj_elf_visibility): Overwrite only the + visibility portion of st_other. + +2002-11-19 Klee Dienes + + * config/tc-h8300.c (struct h8_instruction): New type, used to + wrap h8_opcodes with length, noperands, idx, and size fields + (computed at run-time). + (h8_instructions): New variable. + (md_begin): Allocate the storage for h8_instructions. Fill + h8_instructions with pointers to the appropriate opcode and the + correct value for the additional fields. + (clever_message): Update to use h8_instructions instead of + h8_opcodes. + (build_bytes): Ditto. + (get_specific): Ditto. + (md_assemble): Ditto. + +2002-11-19 Martin Schwidefsky + + * config/tc-s390.c (tc_s390_fix_adjustable): Re-add patch to prevent + adjustments to symbols in merge sections. + +2002-11-19 Luke Deller + + * config/tc-alpha.c (s_alpha_prologue): as_bad when sym is NULL. + +2002-11-18 Kevin Buettner + + * dwarf2dbg.h (dwarf2_format): New enum. + * dwarf2dbg.c (DWARF2_FORMAT): Provide default definition. + (out_debug_line, out_debug_info): Add code for handling 64-bit + DWARF 2 formats. + * config/tc-mips.h (mips_dwarf2_format): Declare. + * config/tc-mips.c (mips_dwarf2_format): New function. + * doc/internals.texi (DWARF2_FORMAT): Document. + +2002-11-18 Alexandre Oliva + + * config/tc-mips.c (s_change_section): Make sure input buffer + is not accessed past the end. Don't hand + obj_elf_change_section a pointer into the input buffer. + +2002-11-18 Alexandre Oliva , Chris Demetriou + + * config/tc-mips.c (tc_gen_reloc): Fix typo in handling of + GOT_LO16 on NEWABI. + +2002-11-18 Svein E. Seldal + + * config/tc-tic4x.c: Fixed proper commandline + parameters. Added support for new opcode-list format. General + error message fixups. + (c4x_inst_add): Reject insn not for our CPU + (md_begin): Added matrix for setting the proper opcode-level & + device-flags according to cpu type and revision. Rewrite the + opcode hasher. + (c4x_operand_parse): Fix opcode bug + (c4x_operands_match): New function argument. Added dry-run + mechanism, that is optional error generation. Added constraint 'i' + and 'j'. + (c4x_insn_check): Added new function for post-verification of the + generated insn. + (md_assemble): Check all opcodes before croaking because of an + argument mismatch. Need this to be able to fully support + ortogonally arguments. + (md_parse_options): Revised commandprompt swicthes and added new + ones. + (md_show_usage): Complete rewrite of printout. + +2002-11-16 Svein E. Seldal + + * config/tc-tic4x.c: Remove c4x_pseudo_ignore function. + (c4x_operands_match): Added check for 8-bits LDF insn. Give + warning when using constant direct bigger than 2^16. Add the new + arguments. + +2002-11-11 Christopher Faylor + + * configure.in: Use .gdbinit under Cygwin. + * configure: Regenerate. + +2002-11-11 Christopher Faylor + + * config/tc-i386.h (EXTERN_FORCE_RELOC): Define only if + STRICT_PE_FORMAT. + +2002-11-11 Svein E. Seldal + + * config/tc-tic4x.c: Declare as many functions as possible as + static. Maintenance on the general indenting. Removed unnecessary + pseudo-ops and added new ones. Removed obsoleted c4x_pseudo_ignore + function. Add support for new DSP, TMS320VC33. Fix bug for + converting flonum constants. + (c4x_do_align): Add proper align handling. Setup align to insert + NOP's. + (c4x_gen_to_words): Support for extended TI type floats. + (md_atof): Proper dumping of multiple-word littlenums. + (c4x_atof): Added support for extended TI type floats. + (c4x_stringer): Added new function to handle compact strings. + (c4x_emit_char): Added new function argument to handle custom + length inserts, like single-byte strings. + * config/tc-tic4x.h: Add proper align handling with NOP's. + * Makefile.am: Added tic4x dependecy + * Makefile.in: Regenerate + +2002-11-11 Hans-Peter Nilsson + + * macro.c (get_any_string): Correct logic for not going beyond end + of in->ptr[]. + +2002-11-10 Hans-Peter Nilsson + + * config/tc-mmix.c (get_putget_operands): Mark both possible + operands as invalid at beginning. + + * config/tc-mmix.c (md_convert_frag) : + Initialize target of fixup to zero. + +2002-11-07 Alexandre Oliva + + * config/tc-mips.c (macro_build_lui): _gp_disp is not special on + NEWABI, but we should still emit HI16_S for non-PIC n32. + +2002-11-06 Richard Henderson + + * config/tc-alpha.c (alpha_validate_fix): Move code ... + (alpha_fix_adjustable): ... here. + * config/tc-alpha.h (TC_VALIDATE_FIX): Remove. + +2002-11-07 Eric Kohl + + * config/te-pe.h (LEX_AT): Accept at-sign (@) as first character + of a label. + +2002-11-05 H.J. Lu + + * config/tc-mips.c (support_64bit_objects): Check *l before it + is freed. + +2002-11-04 Danny Smith + + * config/obj-coff.c (obj-coff-section): Set SEC_DATA and + SEC_LOAD flags for sections marked as 's'. + +2002-11-01 Alan Modra + + * write.c (TC_FORCE_RELOCATION_SUB_ABS): Default to zero. + (TC_FORCE_RELOCATION_SUB_LOCAL): Likewise when DIFF_EXPR_OK. + * doc/internals.texi (TC_FORCE_RELOCATION_SUB_ABS): Document changed + default. + + * dep-in.sed: Fix typo. + +2002-10-30 Daniel Jacobowitz + + * configure.in: Update ARM CPU patterns. + * configure: Regenerated. + +2002-10-29 Daniel Jacobowitz + + * itbl-lex.l: Use #include <> for generated headers. + * itbl-ops.c: Likewise. + +2002-10-28 Daniel Jacobowitz + + * doc/gasp.texi: Fix typo in deprecation note. + +2002-10-23 Nick Clifton + + * config/tc-arm.c (tc_gen_reloc): Allow an absolute reference to + _GLOBAL_TABLE_OFFSET_ to be converted into a GOT reloc. + +2002-10-23 Hans-Peter Nilsson + + * config/tc-mmix.h (mmix_frob_file_before_adjust): Don't declare. + (tc_frob_file_before_adjust): Don't define. + * config/tc-mmix.c (mmix_frob_local_reloc): Remove unused + function. + (mmix_frob_file_before_adjust): Remove ineffective function. + +2002-10-23 Hans-Peter Nilsson + + * config/tc-cris.c (SIMPLE_EXPR): New macro. + (cris_relax_frag): New function. + (md_estimate_size_before_relax) : Pass on unresolved + expressions that will become absolute expressions to relaxation. + (md_convert_frag) : Expect only absolute expressions. Use the symbol + value, not distance to symbol. + : + Ditto. Correct placement of fixup. + (md_assemble): Use SIMPLE_EXPR when dissecting expressions. + (gen_bdap): Ditto. + * config/tc-cris.h (cris_relax_frag): Declare. + (md_relax_frag): Define. + +2002-10-22 Alan Modra + + * config/obj-elf.c (special_sections): Use correct types for init + array sections. + (obj_elf_change_section): Don't mess with init array section type. + +2002-10-21 Richard Sandiford + + * config/tc-mips.c (mips_need_elf_addend_fixup): Return true + for relocs against symbols in a merged section. + +2002-10-18 Alexandre Oliva + + * config/tc-mips.c (md_begin): Add $fcc registers to the symbol + table as register names. + +2002-10-18 Ulrich Weigand + + * config/tc-s390.c (md_parse_option): Set s390_arch_size to 32 + for option -m31. + +2002-10-18 Svein E. Seldal + + * expr.c (operand): Add support for n.nn flonums. + +2002-10-17 Johannes Stezenbach + + * itbl-parse.y (entry): Provide empty action. + +2002-10-16 Alan Modra + + * configure.in (BFDVER_H): Set and subst. + * dep-in.sed: Replace bfdver.h with $(BFDVER_H). + * Makefile.am: Run "make dep-am". + (BFDVER_H): Define. + * configure: Regenerate. + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + +2002-10-15 Alan Modra + + * config/tc-i386.h (EXTERN_FORCE_RELOC): Define. + (MD_APPLY_SYM_VALUE): Define for PE too. + +2002-10-14 Alan Modra + + * Makefile.am: Run "make dep-am". + (CPU_OBJ_VALID): sh64 coff is invalid. + * as.c: #include "bfdver.h". + * Makefile.in: Regenerate. + * config.in: Regenerate. + +2002-10-14 Momchil Velikov + + * config/tc-v850.c (CHECK_): Remove token pasting operator. + +2002-10-14 Richard Sandiford + + * configure.in (mips64vr-elf, mips64vrel-elf): New config. + * configure: Regenerate. + +2002-10-13 Eric Christopher + Alexandre Oliva + + * config/tc-mips.c (s_gpdword): New function. + (mips_pseudo_table): Add .gpdword. + (mips_need_elf_addend_fixup): never for NEWABI. + (md_apply_fix3): Don't mark BFD_RELOC64 after GPREL16 or + GPREL32 as done. + (s_cpadd): Generate .cpadd on NEWABI. + +2002-10-12 Elias Athanasopoulos + + * config/tc-ppc.c (ppc_cleanup): Make 'i' unsigned int. + +2002-10-12 Alexandre Oliva + + * config/tc-mips.h (mips_relax_frag): Take segment as argument. + (md_relax_frag): Adjust macro. + * config/tc-mips.c (mips_relax_branch): New variable. + (RELAX_BRANCH_ENCODE, RELAX_BRANCH_P, RELAX_BRANCH_LIKELY, + RELAX_BRANCH_LINK, RELAX_BRANCH_TOOBAR): New. + (RELAX_MIPS16_P): Adjust. + (append_insn): Emit branch to non-constant in a frag_var if + branch-relaxation is desirable and possible. + (OPTION_RELAX_BRANCH, OPTION_NO_RELAX_BRANCH): New options. + (OPTION_ELF_BASE): Adjust. + (md_parse_option): Handle new options. + (md_apply_fix3): Update comment on EMBEDDED_PIC conditional + branch relaxation. + (relaxed_branch_length): New function. + (md_estimate_size_before_relax): Handle branch frags. + (mips_relax_frag): Likewise. + (md_convert_frag): Handle branch frags. Warn if branch is + relaxed. + +2002-10-11 Kaz Kojima + + * config/tc-sh.c (sh_force_relocation): Make sure TLS relocs get + emitted. + (md_apply_fix3): Add TLS relocs. + (sh_parse_name): Support @TLSGD, @TLSLDM, @GOTTPOFF, @TPOFF and + @DTPOFF. + +2002-10-11 Michel Six + Alan Modra + + * config/tc-i386.c (output_jump): Set fx_signed for loop/jcxz. + (md_estimate_size_before_relax): Likewise for 8 bit branches. + +Thu Oct 10 14:31:30 2002 J"orn Rennecke + + * config/tc-sh.c (assemble_ppi): Initialize reg_x / reg_y / reg_n + inside loop. + +2002-10-09 Richard Shann + Stephen Clarke + + * config/tc-sh64.c (sh64_target_format): Add support for sh64 + Linux environment. + +2002-10-03 Kaz Kojima + + * contig/tc-sh.c (sh_local_pcrel): New. + (sh_force_relocation): Use sh_local_pcrel. + (md_pcrel_from_section): Check the relocation type whether it + should be resolved locally. Use S_FORCE_RELOC. + +2002-10-01 Alan Modra + + * config/tc-mips.h (TC_FORCE_RELOCATION_SUB_SAME): Define. + (TC_FORCE_RELOCATION): Tidy arg. + +2002-09-30 Gavin Romig-Koch + Ken Raeburn + Aldy Hernandez + DJ Delorie + Michael Meissner + Eric Christopher + Richard Sandiford + + * doc/c-mips.texi: Add entries for -march=vr4120,vr4130,vr4181, + vr5400 and vr5500. Add entry for -mfix-vr4122-bugs. + * config/tc-mips.c (CPU_HAS_DROR, CPU_HAS_ROR): New macros. + (hilo_interlocks): True for CPU_VR5500. + (gpr_interlocks, cop_interlocks): True for CPU_VR5400 and CPU_VR5500. + (mips_fix_vr4122_bugs): New. + (append_insn): Work around 4122 errors if mips_fix_vr4122_bugs. + (mips_emit_delays): Likewise. + (macro2) [M_DROLI]: Use dror or dror32 if CPU_HAS_DROR. + [M_ROLI]: Likewise ror if CPU_HAS_ROR. + (validate_mips_insn, mips_ip): Handle '[', ']', 'e' and '%'. + (OPTION_FIX_VR4122, OPTION_NO_FIX_VR4122): New options. + (md_longopts): Add -mfix-vr4122-bugs and -no-mfix-vr4122-bugs. + (OPTION_ELF_BASE): Bump. + (md_parse_option): Handle the new options. + (mips_cpu_info_table): Add entries for vr4120, vr4130, vr4181, + vr5400 and vr5500. + +2002-09-29 H.J. Lu + + * config/tc-mips.c (md_apply_fix3): Subtract the symbol value + twice if howto->pcrel_offset is true. + +2002-09-28 Matt Thomas + Jason Thorpe + + * config/tc-vax.c (md_estimate_size_before_relax): Only try to + convert undefined references to GOT32/PLT32 if PIC code is + requested. Fix comment. + +2002-09-27 Kaz Kojima + + * config/tc-sh.c (sh_force_relocation): Return 0 for + some PC relative relocations when not relaxing. + +2002-09-26 Jakub Jelinek + + * config/tc-i386.c (tc_i386_fix_adjustable): Add x86-64 TLS relocs. + Define them if not BFD_ASSEMBLER. + (lex_got): Handle @tlsgd, @dtpoff and @tpoff in 64-bit mode, add + @tlsld. + (md_apply_fix3): No addend for BFD_RELOC_X86_64_TLSGD, + BFD_RELOC_X86_64_TLSLD and BFD_RELOC_X86_64_GOTTPOFF. + (tc_gen_reloc): Handle x86-64 TLS relocs. + +2002-09-27 Alan Modra + + * config/tc-avr.c (md_apply_fix3): Reinstate code handling pcrel + fixups to current or absolute section. + +2002-09-26 Jim Wilson + + * config/tc-v850.c (v850_offset): Use frag_var instead of frag_now_fix + and frag_more. + +2002-09-26 Thiemo Seufer + + * config/tc-mips.c (CPU_HAS_MIPS16): Add mips-lsi-elf as MIPS16 + capable configuration. + (macro_build): Check for MIPS16 capability, not for actual MIPS16 code + generation. + (mips_ip): Likewise. + +2002-09-26 Thiemo Seufer + + * config/tc-mips.c (append_insn): Fix jump overflow check. + +2002-09-24 Alan Modra + + * config/tc-i386.c (process_operands): Warn about "lea" segment + overrides. + +2002-09-22 Mark Elbrecht + + * write.c: Delete set_segment_vma and prototype. Update all callers. + +2002-09-21 Alan Modra + + * config/tc-i386.c (md_apply_fix3): Replace S_IS_EXTERNAL, + S_IS_WEAK etc. with S_FORCE_RELOC call. Correct comment. + Rename "fseg" to "sym_seg". + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + +2002-09-20 Nick Clifton + + * symbols.c (colon): Do not allow symbols to be created in the + absolute section if WORKING_DOT_WORD is not defined and + new_broken_words would require a new frag to be created. + +2002-09-20 Alan Modra + + * expr.c (expr): Simplify foo-foo here. + (clean_up_expression): Remove O_subtract code. + + * write.h (struct fix): Add fx_dot_value. + (dot_value): Declare. + * write.c (dot_value): New var. + (fix_new_internal): Save dot_value as fx_dot_value. + (fixup_segment): Adjust fx_offset using fx_dot_value. + * expr.c (expr): Update dot_value. + +2002-09-19 Jakub Jelinek + + * config/tc-i386.c (tc_i386_fix_adjustable): Handle + BFD_RELOC_386_TLS_IE and BFD_RELOC_386_TLS_GOTIE. + (BFD_RELOC_386_TLS_IE, BFD_RELOC_386_TLS_GOTIE): Define to 0 + if not defined. + (lex_got): Handle @GOTNTPOFF and @INDNTPOFF. + (md_apply_fix3, tc_gen_reloc): Handle BFD_RELOC_386_TLS_IE and + BFD_RELOC_386_TLS_GOTIE. + +2002-09-19 Richard Henderson + + * config/tc-alpha.c (md_pcrel_from): Only adjust special for + branch type relocs. + (alpha_force_relocation): Don't special-case branch type relocs. + +2002-09-19 Nick Clifton + + * config/tc-m68k.c (select_control_regs): Handle situation where + architecture has not yet been selected. + +2002-09-18 Chris Demetriou + + * config/tc-mips.c (IS_SEXT_32BIT_NUM): Move closer to top of file. + (IS_SEXT_16BIT_NUM): New macro. + (macro_build_ldst_constoffset): New function, to build a set of + instructions to do a load or store from a constant offset relative + to a given register. + (macro, s_cprestore): Use macro_build_ldst_constoffset to implement + .cprestore pseudo-op. + +2002-09-18 Chris Demetriou + + * config/tc-mips.c (md_apply_fix3): Just return for BFD_RELOC_8. + +2002-09-18 Thiemo Seufer + + * config/tc-mips.c (s_change_section): Fix parsing. Code cleanup. + +2002-09-17 Stan Cox + + * tc-mips.c (load_address): Use BFD_RELOC_MIPS_GOT_DISP for newabi. + (macro): Likewise for la. Likewise for ld. + (mips_after_parse_args): Make -xgot optional, not the default. + (md_apply_fix3): Allow composite relocation to set up gp. + (tc_gen_reloc): Allow relaxing for newabi. + Relax R_MIPS_CALL16 to R_MIPS_GOT_PAGE/R_MIPS_GOT_OFST if local. + Relax R_MIPS_GOT16/R_MIPS_LO16 to R_MIPS_GOT_DISP if local. + +2002-09-17 Nick Clifton + + * config/tc-arm.c (md_apply_fix3): Note that an implemented + BFD_RELOC_ARM_IMMEDIATE has been done. + (tc_gen_reloc): Do not issue reloc number of unimplemented + BFD_RELOC_ARM_IMMEDIATE and BFD_RELOC_ARM_OFFSET_IMM relocs - + their name is already in the error message - plus remove them + from the default case. + + * config/tc-arm.c (do_ldmstm): Warn about unpredictable + behavior of instructions. + +2002-09-17 Svein E. Seldal + + * config/tc-tic4x.c: Add function declarations and ATTRIBUTE_UNUSED. + Convert functions to K&R format. + +2002-09-17 Thiemo Seufer + + * config/tc-mips.c (pdr_seg): Define only for ELF. + (s_change_section): Remove unused variable. Don't use for nonELF. + +2002-09-17 Thiemo Seufer + + * config/obj-elf.c (obj_elf_change_section): Move prototype to + obj-elf.h + * config/obj-elf.h (obj_elf_change_section): Likewise. + +2002-09-16 Elias Athanasopoulos + + * dwarf2dbg.c (out_debug_abbrev): Add support for the DW_AT_name field. + (out_debug_info): Likewise. + +2002-09-16 Bruno Haible + + * config/tc-i386.h (ELF_TARGET_FORMAT): New macro. + (TARGET_FORMAT): Use ELF_TARGET_FORMAT instead of "elf32-i386". + * config/tc-i386.c (i386_target_format): Likewise. + * config/tc-alpha.h (ELF_TARGET_FORMAT): New macro. + (TARGET_FORMAT): Use ELF_TARGET_FORMAT instead of "elf64-alpha". + +2002-09-13 Nick Clifton + + * config/tc-ppc.c (md_assemble): Do not count FAKE operands + when deciding if any operands have been skipped. + +2002-09-11 Nick Clifton + + * NEWS: New TI port supports both C4x and C3x series of DSPs. + + * po/tr.po: Updated Turkish translation. + +2002-09-11 Jakub Jelinek + + * config/tc-i386.c (md_apply_fix3): Allow addend for + BFD_RELOC_386_TLS_LDO_32, BFD_RELOC_386_TLS_LE and + BFD_RELOC_386_TLS_LE_32. + +2002-09-05 Jeff Law + + * config/tc-hppa.c (md_apply_fix3): Don't set fx_done for + marker relocations such as ENTRY/EXIT. + * config/tc-hppa.h (MD_APPLY_SYM_VALUE): Definition applies + to both OBJ_ELF and OBJ_SOM. + +2002-09-05 Alan Modra + + * doc/internals.texi (md_apply_fix3): Expand. + (TC_VALIDATE_FIX, TC_FORCE_RELOCATION, TC_FORCE_RELOCATION_ABS, + TC_FORCE_RELOCATION_LOCAL, TC_FORCE_RELOCATION_SUB_SAME, + TC_FORCE_RELOCATION_SUB_ABS, TC_FORCE_RELOCATION_SUB_LOCAL, + TC_VALIDATE_FIX_SUB, MD_APPLY_SYM_VALUE, S_FORCE_RELOC, + EXTERN_FORCE_RELOC): Document. + (TC_HANDLES_FX_DONE, obj_fix_adjustable): Remove. + * as.h: Don't include struc-symbol.h for arc. + (IS_ELF): Define. + * cgen.c (gas_cgen_md_apply_fix3): Remove *valP fudges and code to + subtract absolute symbol. + * obj.h (struct format_ops): Add frob_file_before_fix. + * subsegs.c (section_symbol): Set BSF_SECTION_SYM flag. + * symbols.c (S_FORCE_RELOC): New function. + * symbols.h (S_FORCE_RELOC): Declare. + * write.c (TC_FORCE_RELOCATION): Change default. + (TC_FORCE_RELOCATION_ABS): Define. + (TC_RELOC_RTSYM_LOC_FIXUP): Don't define. + (TC_FORCE_RELOCATION_LOCAL): Define this instead. + (TC_FORCE_RELOCATION_SECTION): Don't define. + (TC_FORCE_RELOCATION_SUB_SAME): Define this instead. + (TC_FORCE_RELOCATION_SUB_ABS): Define. + (TC_FORCE_RELOCATION_SUB_LOCAL): Define. + (TC_VALIDATE_FIX_SUB): Define. + (TC_FIX_ADJUSTABLE): Don't define. + (MD_APPLY_SYM_VALUE): Define this instead. + (abs_section_sym): New variable. + (adjust_reloc_syms): Use S_FORCE_RELOC. Remove obj_fix_adjustable + call. Don't symbol_mark_used_in_reloc here. Simplify link_once tests. + Don't put the absolute section sym on fixups here. + (fix_segment): New function. + (write_relocs): Don't call fixup_segment from here. + (write_object_file): Instead call tc_frob_file_before_fix, + obj_frob_file_before_fix, and fix_segment prior to symbol table code. + Don't output the absolute section symbol. + (fixup_segment): Rewrite. + * write.h (abs_section_sym): Declare. + * config/obj-aout.c (obj_aout_frob_file_before_fix): Rename from + obj_aout_frob_file. + (aout_format_ops): Adjust to suit. + * config/obj-aout.h (obj_frob_file): Don't define. + (obj_frob_file_before_fix): Define. + (obj_aout_frob_file_before_fix): Rename from obj_aout_frob_file. + (S_FORCE_RELOC): Define. + * config/obj-bout.h (S_FORCE_RELOC): Define. + * config/obj-coff.c (coff_format_ops): Init new field. + * config/obj-coff.h: Formatting fixes. + (obj_sec_sym_ok_for_reloc): Define. + (S_FORCE_RELOC): Define. + * config/obj-ecoff.c (ecoff_frob_file_before_fix): Split out .. + (ecoff_frob_file): .. from here. + (ecoff_format_ops): Add new function. + * config/obj-ecoff.h (ecoff_frob_file_before_fix): Declare. + (obj_frob_file_before_fix): Define. + * config/obj-elf.c (elf_format_ops): Init new field. + * config/obj-elf.h (obj_sec_sym_ok_for_reloc): Expand comment. + * config/obj-ieee.h: Formatting fixes. + (S_FORCE_RELOC): Define. + * config/obj-multi.h (obj_frob_file_before_fix): Define. + * config/obj-vms.h (S_FORCE_RELOC): Define. + * config/tc-alpha.c (md_apply_fix3): Correct GPDISP comment. + (alpha_force_relocation): Use S_FORCE_RELOC, and don't return 0 + for BFD_RELOC_32 and BFD_RELOC_64. + (alpha_fix_adjustable): Remove extern and weak tests. + (alpha_before_fix): Rename from alpha_adjust_symtab. + (alpha_adjust_relocs): Rename from alpha_adjust_symtab_relocs. + * config/tc-alpha.h (struct fix, struct alpha_reloc_tag): Declare. + (TC_VALIDATE_FIX): Tweak param name. + (TC_FORCE_RELOCATION, tc_fix_adjustable): Likewise. + (TC_RELOC_RTSYM_LOC_FIXUP): Don't define. + (TC_FORCE_RELOCATION_LOCAL): Define this instead. + (MD_APPLY_SYM_VALUE): Define. + (tc_adjust_symtab): Don't define. + (alpha_adjust_symtab): Don't declare. + (tc_frob_file_before_fix): Define. + (alpha_before_fix): Declare. + (TC_INIT_FIX_DATA): Tweak param names. + * config/tc-arc.c: Include "struc-symbol.h". + (md_pcrel_from): Remove undefined sym fudge. + (md_apply_fix3): Remove *valP fudges and code to subtract abs sym. + Don't set fx_addnumber. + (tc_gen_reloc): Remove spurious fx_addnumber comment. + * config/tc-arc.h (MD_APPLY_SYM_VALUE): Define. + (EXTERN_FORCE_RELOC): Define. + * config/tc-arm.c (md_apply_fix3 ): Remove. + (tc_gen_reloc): Fudge ARM_GOTPC addend. + (arm_validate_fix): Return void. + (arm_fix_adjustable ): Remove extern and weak tests. + Add plt and got reloc tests. + (arm_force_relocation): Call S_FORCE_RELOC. + * config/tc-arm.h (struct fix): Forward declare. + (TC_VALIDATE_FIX): No longer set add_symbolP. + (arm_validate_fix): Adjust declaration. + (TC_FORCE_RELOCATION ): Call i386_force_relocation. + (i386_force_relocation): Declare. + (TC_RELOC_RTSYM_LOC_FIXUP): Don't define. + (TC_FORCE_RELOCATION_LOCAL): Define this instead. + (TC_FORCE_RELOCATION ): Call S_FORCE_RELOC. + * config/tc-i860.c (md_apply_fix3): Don't cast valP pointer type. + * config/tc-i860.h (MD_APPLY_SYM_VALUE): Define. + (EXTERN_FORCE_RELOC): Define. + * config/tc-i960.c (reloc_callj): Remove declaration. Return false. + (md_apply_fix3): Don't cast valP pointer type. Move code here from + old fixup_segment. No need to test fx_pcrel before setting fx_done. + (i960_validate_fix): Remove add_symbolPP arg and add_symbolP macro. + Use fx_addsy instead of add_symbolP, as_bad_where instead of as_bad. + Remove #if 0 code. Invert return boolean. + * config/tc-i960.h (TC_COUNT_RELOC): Tweak param name. + (TC_COFF_FIX2RTYPE, TC_ADJUST_RELOC_COUNT, TC_VALIDATE_FIX): Likewise. + (tc_headers_hook, tc_coff_fix2rtype): Remove declaration. + (tc_coff_sizemachdep): Prototype. + (i960_handle_align): Likewise. + (i960_validate_fix): Adjust declaration. + (reloc_callj): Likewise. + (EXTERN_FORCE_RELOC): Define. + (TC_FORCE_RELOCATION_SUB_SAME): Define. + (TC_FORCE_RELOCATION_ABS): Define. + (TC_RELOC_RTSYM_LOC_FIXUP): Don't define. + (TC_FORCE_RELOCATION_LOCAL): Define this instead. + (TC_FIX_ADJUSTABLE): Don't define. + (MD_APPLY_SYM_VALUE): Define. + * config/tc-ia64.c (ia64_force_relocation): Call S_FORCE_RELOC. + * config/tc-ia64.h (MD_APPLY_SYM_VALUE): Define. + (TC_RELOC_RTSYM_LOC_FIXUP): Don't define. + (TC_FORCE_RELOCATION_LOCAL): Define this instead. + * config/tc-ip2k.c (ip2k_force_relocation): Call S_FORCE_RELOC. + * config/tc-ip2k.h (MD_APPLY_FIX3): Don't define. + (MD_APPLY_SYM_VALUE): Define. + (EXTERN_FORCE_RELOC): Define. + (TC_FORCE_RELOCATION): Tweak param name. + * config/tc-m32r.c (m32r_force_relocation): Call S_FORCE_RELOC. + (m32r_fix_adjustable): Don't test extern, weak. + * config/tc-m32r.h (MD_PCREL_FROM_SECTION): Tweak param name. + (MD_APPLY_SYM_VALUE): Define. + (obj_fix_adjustable): Don't define. + (tc_fix_adjustable): Define. + (tc_frob_file): Don't define. + (tc_frob_file_before_fix): Define. + (EXTERN_FORCE_RELOC): Define. + * config/tc-m68hc11.c (tc_gen_reloc): Set addend to zero. Adjust + BFD_RELOC_VTABLE_ENTRY address. + (tc_m68hc11_force_relocation): Call S_FORCE_RELOC. + (tc_m68hc11_fix_adjustable): Don't test relaxable_symbol. + (md_apply_fix3): Remove *valP fudges and code to subtract abs sym. + Remove duplicated fx_done code. + * config/tc-m68hc11.h (MD_APPLY_SYM_VALUE): Define. + (EXTERN_FORCE_RELOC): Define. + * config/tc-m68k.c (tc_m68k_fix_adjustable): Don't test + relaxable_symbol. + * config/tc-m68k.h (TC_COFF_FIX2RTYPE): Tweak param name. + (TC_RELOC_RTSYM_LOC_FIXUP): Don't define. + (TC_FIX_ADJUSTABLE): Don't define. + (EXTERN_FORCE_RELOC): Define. + (MD_APPLY_SYM_VALUE): Define. + (TC_FORCE_RELOCATION): Call S_FORCE_RELOC. + * config/tc-mcore.c (md_apply_fix3): Don't cast valP pointer type. + Remove fx_addsy tests. + (mcore_force_relocation): Call S_FORCE_RELOC. + (mcore_fix_adjustable): Don't test fx_addsy. + * config/tc-mcore.h (MD_PCREL_FROM_SECTION): Tweak param name. + (EXTERN_FORCE_RELOC): Define. + (obj_fix_adjustable): Don't define. + (tc_fix_adjustable): Define. + (MD_APPLY_SYM_VALUE): Define. + * config/tc-mips.c (enum mips_pic_level): Move to tc-mips.h. + (mips_pic): No longer static. + (mips_force_relocation): Call S_FORCE_RELOC. + (mips_fix_adjustable): Remove extern, weak tests. + * config/tc-mips.h (enum mips_pic_level): Declare. + (mips_pic): Declare. + (tc_frob_file): Don't define. + (tc_frob_file_before_fix): Define this instead. + (EXTERN_FORCE_RELOC): Define. + * config/tc-mmix.c (md_apply_fix3): Replace real_reg_section tests + with reg_section tests. Set fx_done instead of calling + symbol_clear_used_in_reloc on bad relocs. + (tc_gen_reloc): Zero fx_addsy on bad relocs. + (mmix_force_relocation): Remove weak sym test. Call S_FORCE_RELOC. + (mmix_adjust_symtab): Simplify list handling. Abort on any + nonsense. + * config/tc-mmix.h (tc_fix_adjustable): Remove weak tests. Check + BFD_RELOC_MMIX_LOCAL. + (tc_frob_symbol): Keep user defined syms in reg_section. Don't punt. + (EXTERN_FORCE_RELOC): Define. + (MD_PCREL_FROM_SECTION): Tweak param name. + (tc_frob_file): Don't define. + (tc_frob_file_before_fix): Define this instead. + * config/tc-mn10300.c (mn10300_force_relocation): Call S_FORCE_RELOC. + Remove SEC_CODE checks. + (mn10300_fix_adjustable): Remove extern and weak tests. + * config/tc-mn10300.h (EXTERN_FORCE_RELOC): Define. + (TC_FORCE_RELOCATION): Tweak param name. + (obj_fix_adjustable): Don't define. + (TC_FORCE_RELOCATION_SUB_SAME): Define to handle SEC_CODE. + * config/tc-ns32k.h (TC_FIX_DATA_PRINT): Tweak param name. + * config/tc-openrisc.c (openrisc_force_relocation): Call S_FORCE_RELOC. + (openrisc_fix_adjustable): Don't test fx_addsy. + * config/tc-openrisc.h (MD_APPLY_SYM_VALUE): Define. + (obj_fix_adjustable): Don't define. + (tc_fix_adjustable): Define this instead. + (MD_PCREL_FROM_SECTION): Remove duplicate. Tweak param name. + * config/tc-or32.c (md_apply_fix3): Don't cast valP pointer type. + (tc_gen_reloc): Don't fiddle with BFD_RELOC_VTABLE_INHERIT relocs. + Adjust the address for BFD_RELOC_VTABLE_ENTRY, not the addend. + * config/tc-or32.h (EXTERN_FORCE_RELOC): Define. + (MD_APPLY_SYM_VALUE): Define. + * config/tc-pj.c (md_apply_fix3): Don't cast valP pointer type. + Don't subtract symbol value. + * config/tc-pj.h (md_pcrel_from): Tweak param name. + (EXTERN_FORCE_RELOC): Define. + (TC_FORCE_RELOCATION): Call S_FORCE_RELOC. + (MD_APPLY_SYM_VALUE): Define. + (obj_fix_adjustable): Don't define. + (tc_fix_adjustable): Define this instead. + * config/tc-ppc.c (ppc_frob_symbol ): Ignore absolute + section sym. + (ppc_force_relocation ): Call S_FORCE_RELOC. + (ppc_force_relocation ): New. + (ppc_fix_adjustable ): Remove extern and weak tests. + (md_apply_fix3): Don't subtract symbol values for ELF. Update + comments. Don't subtract fx_subsy as that is already done. + * config/tc-ppc.h (tc_fix_adjustable): Tweak param name. + (MD_PCREL_FROM_SECTION): Likewise. + (TC_FORCE_RELOCATION): Define for both ELF and XCOFF as calling + ppc_force_relocation. + (TC_FORCE_RELOCATION_SECTION): Delete. + (TC_RELOC_RTSYM_LOC_FIXUP): Don't define. + (TC_FORCE_RELOCATION_LOCAL): Define this instead. + (MD_APPLY_SYM_VALUE): Define. + * config/tc-s390.c: #include "dwarf2dbg.h". + (s390_insn): Remove excess parens. + (tc_s390_fix_adjustable): Remove extern, weak, SEC_MERGE tests. + (tc_s390_force_relocation): Call S_FORCE_RELOC. + (md_apply_fix3): Add ATTRIBUTE_UNUSED on "seg". Abort when fx_subsy + non-NULL. Don't subtract off fx_addsy value. + * config/tc-s390.h (TC_RELOC_RTSYM_LOC_FIXUP): Don't define. + (TC_FORCE_RELOCATION, MD_PCREL_FROM_SECTION): Tweak param name. + (TC_FIX_ADJUSTABLE): Don't define. + (MD_APPLY_SYM_VALUE): Define. + * config/tc-sh.c (SWITCH_TABLE_CONS): Move to tc-sh.h. + (SWITCH_TABLE): Likewise. + (sh_force_relocation): Call S_FORCE_RELOC. + (sh_fix_adjustable): Remove "return 1" cases handled by the default. + Replace TC_RELOC_RTSYM_LOC_FIXUP with reloc type tests. + (md_apply_fix3 ): Simplify, + fx_addnumber is zero on entry. Save val in fx_addnumber. + (tc_gen_reloc): Don't subtract fx_subsy. + * config/tc-sh.h (struct fix): Move. + (obj_fix_adjustable): Don't define. + (tc_fix_adjustable): Define this instead. + (TC_FIX_ADJUSTABLE): Don't define. + (MD_APPLY_SYM_VALUE): Define. + (SWITCH_TABLE_CONS): Define. + (SWITCH_TABLE): Define. + (TC_FORCE_RELOCATION_SUB_SAME): Define. + (TC_VALIDATE_FIX_SUB): Define. + (MD_PCREL_FROM_SECTION): Tweak param name. + (TC_RELOC_RTSYM_LOC_FIXUP): Don't define. + (TC_FORCE_RELOCATION_LOCAL): Define this instead. + (TC_FORCE_RELOCATION_SUB_ABS): Define. + * config/tc-sh64.h (TC_RELOC_RTSYM_LOC_FIXUP): Don't define. + (TC_FORCE_RELOCATION_LOCAL): Define this instead. + (TC_FORCE_RELOCATION_SUB_SAME): Define. + (TC_VALIDATE_FIX_SUB): Define. + (MD_PCREL_FROM_SECTION): Tweak param name. + * config/tc-sparc.c (md_apply_fix3): Don't subtract off symbol value. + (tc_gen_reloc): Use S_FORCE_RELOC. + (elf32_sparc_force_relocation): Call S_FORCE_RELOC. + * config/tc-sparc.h (TC_FORCE_RELOCATION ): Remove. + (TC_FORCE_RELOCATION_ABS): Define this instead. + (TC_RELOC_RTSYM_LOC_FIXUP): Don't define. + (TC_FORCE_RELOCATION_LOCAL): Define this instead. + (tc_fix_adjustable): Remove extern and weak tests. Use S_FORCE_RELOC. + (MD_APPLY_SYM_VALUE): Define. + (TC_FIX_DATA_PRINT): Tweak param name. + * config/tc-tic30.c (USE_STDOUT): Don't define. + (md_parse_option): Remove stupid debug code. + (tc_gen_reloc): Don't use fx_addnumber. + * config/tc-v850.c (v850_fix_adjustable): Remove extern and weak tests. + (v850_force_relocation): Remove weak test. Call S_FORCE_RELOC. + * config/tc-v850.h (obj_fix_adjustable): Don't define. + (tc_fix_adjustable): Define this instead. + (TC_FIX_ADJUSTABLE): Don't define. + (MD_APPLY_SYM_VALUE): Define this instead. + (TC_FORCE_RELOCATION, MD_PCREL_FROM_SECTION): Tweak param name. + * config/tc-vax.h (TC_RELOC_RTSYM_LOC_FIXUP): Don't define. + (TC_FIX_ADJUSTABLE): Don't define. + (MD_APPLY_SYM_VALUE): Define this instead. + (tc_fix_adjustable): Remove extern and weak tests. + * config/tc-w65.h (struct fix): Forward declare. + * config/tc-xstormy16.c (xstormy16_force_relocation): Call + S_FORCE_RELOC. + (xstormy16_fix_adjustable): Remove extern and weak tests. Don't + call xstormy16_force_relocation; Instead test for FPTR16 reloc. + (xstormy16_md_apply_fix3): Remove *valP fudges and code to subtract + absolute symbol. + * config/tc-xstormy16.h (MD_APPLY_FIX3): Don't define. + (MD_APPLY_SYM_VALUE): Define. + (obj_fix_adjustable): Don't define. + (tc_fix_adjustable): Define this instead. + (MD_PCREL_FROM_SECTION): Remove duplicate. Tweak param name. + +2002-09-04 Alan Modra + + * config/tc-ppc.c (ppc_frob_symbol): Formatting, warning fix. + (ppc_fix_adjustable ): Cleanup. + + * config/tc-ppc.c (PPC_HIGHER, PPC_HIGHEST): Fix warning. + (md_parse_option): No -a64 without BFD64. + (ppc_set_cpu): Select appropriate cpu when ppc_obj64. + (ppc_arch): Use bfd_mach_rs6k for bfd_arch_rs6000. + +2002-09-04 Nick Clifton + + * config/tc-ppc.c (md_begin): Do not insert non-BookE32 + instructions into the hash table if the target cpu is the BookE32. + +2002-08-31 Hans-Peter Nilsson + + * read.c (do_align): Use ATTRIBUTE_UNUSED_LABEL for label, not + ATTRIBUTE_UNUSED. + +2000-08-28 Catherine Moore + + * tc-v850.c (v850_relax): Declare. + (v850_longcode): New routine. + (v850_handle_align): New routine. + (md_pseudo_table): Add longcall and longjump. + (md_parse_option): Check for relax option. + (tc_gen_reloc): Handle BFD_RELOC_V850_LONGCALL, + BFD_RELOC_V850_LONGJUMP, and BFD_RELOC_V850_ALIGN. + (md_apply_fix3): Likewise. + (v850_force_relocation): Likewise. + (v850_comm): Change the current section. + (md_assemble): Ensure that the correct value is put in the + fixup. + (v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss, + v850_zbss, v850_rosdata, v850_rozdata): Fix section book keeping. + Remove redundant v850ea support. + * tc-v850.h (HANDLE_ALIGN): Define. + (v850_handle_align): Declare. + * doc/c-v850.c: Document -mrelax, .longcall and .longjump. + +2002-08-28 Svein E. Seldal + + * configure.in: Add tic4x-coff* and c4x-coff*-coff-coff targets. + * configure: Regenerate. + * NEWS: Mention new port. + +2002-08-28 Michael Hayes + + * config/obj-coff.c: Add sdef definition. + * config/obj-coff.h: Add tic4x include file and set + target format. + * config/tc-tic4x.c: New file. + * config/tc-tic4x.h: New file. + +2002-08-28 Alan Modra + + * write.c (BFD_FAST_SECTION_FILL): Remove unused macro. + (TC_ADJUST_RELOC_COUNT): Tweak param name. + (TC_FORCE_RELOCATION, TC_FORCE_RELOCATION_SECTION): Likewise. + (TC_FIX_ADJUSTABLE, MD_PCREL_FROM_SECTION): Likewise. + (RELOC_ENUM): Define. + (fix_new_internal): Use RELOC_ENUM. + (fix_new, fix_new_exp): Likewise. + (adjust_reloc_syms): Comment. Remove unnecessary tests on sym != NULL. + Replace gotos with continue. + (write_relocs): Formatting. Avoid symbol loops in + RELOC_EXPANSION_POSSIBLE case too. Report bfd_reloc_outofrange + errors, and error number in other cases. + (fixup_segment): Remove param names from prototype. Rename + "this_segment_type" to "this_segment". Update linkrelax comment. + Remove "size, "place" and "where" local vars. Formatting. Update + "no symbol" comment. Remove #if 0 and #if 1. + + * app.c (do_scrub_chars): Don't test IGNORE_NONSTANDARD_ESCAPES. Tidy. + +2002-08-27 Alan Modra + + * dwarf2dbg.c: Always include dwarf2dbg.h. + (dwarf2_directive_file): Adjust dummy version args. + * ecoff.c (ecoff_directive_weakext): Add ATTRIBUTE_UNUSED. + * expr.c (clean_up_expression ): Allow subtraction + when symbol values differ. + * read.c (do_align): Add ATTRIBUTE_UNUSED to label. + (pseudo_set ): Remove unnecessary segment test. + * config/obj-bout.c (obj_pseudo_table): Warning fix. + +2002-08-26 Alan Modra + + * config/tc-w65.c (md_section_align): Fix typo. + (md_parse_option): Return 0, not 1. + +2002-08-22 Nick Clifton + + * doc/as.texinfo (Section): Note that if '@' is a comment + character then another symbol is used to prefix the section's + type. + +2002-08-22 Christian Groessler + + * config/tc-z8k.c (get_operands): Adjust ptr variable also in + "case 0" case. + +2002-08-12 Graeme Peterson + + * configure.in: Add support for sh-**-nto* target. + * configure: Regenerate. + +2002-08-21 Nitin Gupta + + * config/tc-h8300.h (TC_LINKRELAX_FIXUP): Define. + +2002-08-21 Elena Zannoni + + * config/tc-ppc.c (ppc_cleanup): Do something only if format + is ELF. + (ppc_apuinfo_section_add): Define only if format is ELF. + (md_assemble): Emit APUinfo section only if format is ELF. + Fix formatting. + +2002-08-21 Alan Modra + + * config/tc-arc.c (md_pseudo_table ): Cast. + * config/tc-frv.c: Likewise. + * config/tc-hppa.c: Likewise. + * config/tc-ia64.c: Likewise. + * config/tc-ip2k.c: Likewise. + * config/tc-m68hc11.c: Likewise. + * config/tc-m68k.c: Likewise. + * config/tc-mmix.c: Likewise. + * config/tc-mn10300.c: Likewise. + * config/tc-sh.c: Likewise. + * config/tc-sparc.c: Likewise. + * config/tc-v850.c: Likewise. + +2002-08-20 Richard Sandiford + + * config/tc-mips.c (macro2): Implement rotates by zero using shifts + by zero. + +2002-08-19 Elena Zannoni + + From matthew green + + * config/tc-ppc.c (PPC_OPCODE_CLASSIC): Enable this everywhere + PPC_OPCODE_PPC is, except for BookE architectures. + (md_parse_option): Add support for -mspe. + (md_show_usage): Add -mspe. + (md_parse_option): Add support for -me500 and + -me500x2 to generate code for Motorola e500 core complex. + (md_show_usage): Add -me500 and -me500x2. + + (PPC_APUINFO_ISEL, PPC_APUINFO_PMR, PPC_APUINFO_RFMCI, + PPC_APUINFO_CACHELCK, PPC_APUINFO_SPE, PPC_APUINFO_EFS, + PPC_APUINFO_BRLOCK): New macros. + + (ppc_cleanup): New function. + (ppc_apuinfo_section_add): New function. + (APUID): New macro. + (md_assemble): Collect info and write the APUinfo section. + + * config/tc-ppc.h (md_cleanup): Define. + (ppc_cleanup): Export. + (ELF_TC_SPECIAL_SECTIONS): Add .PPC.EMB.apuinfo section. + +2002-08-17 Stan Cox + + * config/obj-elf.c (obj_elf_change_section): Make non-static. + config/tc-mips.c (s_change_section): New function to support + IRIX .section pseudo-op. + +2002-08-16 Nick Clifton + + * config/tc-v850.c (md_assemble): Fix assembling of "callt 0x3f". + +2002-08-15 Alexandre Oliva + + * config/tc-mips.c (macro_build_jalr): Make sure we generate + the fix-up against on the right frag. + (s_cpsetup): Likewise. Parse third argument as expression, to + handle global symbols and forward/backward labels correctly. + +2002-08-14 Nick Clifton + + * read.c (stringer): Catch attempts to create strings in the abs + section. + + * config/tc-alpha.c: Fix compiling for COFF targets. + Some minor formatting tidyups. + +2002-08-13 Stephane Carrez + + * config/tc-m68hc11.h (MD_PCREL_FROM_SECTION): Remove. + (TC_HANDLES_FX_DONE): Define to let md_apply_fix3 set fx_done flag + according to the reloc. + (tc_fix_adjustable, tc_m68hc11_fix_adjustable): Define. + (TC_FORCE_RELOCATION): Define. + (tc_m68hc11_force_relocation): Declare. + + * config/tc-m68hc11.c (md_pseudo_table): Add relax command. + (s_m68hc11_relax): New function for relax group. + (build_insn, build_jump_insn): Emit a M68HC11_RL_JUMP reloc at + beginning of jump instruction. + (md_pcrel_from): Rename from md_pcrel_from_section and fix + address computation. + (tc-gen_reloc): Update. + (md_estimate_size_before_relax): Create the BFD_RELOC_16_PCREL as + PC-relative fixup. + (tc_m68hc11_force_relocation): New function, handle new relocs. + (tc_m68hc11_fix_adjustable): New to make sure there are enough + reloc for the linker relax pass. + (md_apply_fix3): Handle M68HC11_RL_JUMP, M68HC11_RL_GROUP + and VTABLE relocs. + +2002-08-13 Stephane Carrez + + * config/tc-m68hc11.c (m68hc11_elf_final_processing): New function. + (md_pseudo_table): Add .mode, .far and .interrupt pseudo op. + (s_m68hc11_mode): New function for .mode pseudo op. + (s_m68hc11_mark_symbol): New function for .far and .interrupt + pseudo op. + * config/tc-m68hc11.h (elf_tc_final_processing): Define. + (m68hc11_elf_final_processing): Declare. + +2002-08-13 Stephane Carrez + + * config/tc-m68hc11.c (md_begin): Take into account additional + page operand for call instruction. + (print_opcode_format): Likewise. + (check_range): Likewise for page range checking. + (get_operand): Don't skip a possible comma in operands. + (fixup8): Generate BFD_RELOC_M68HC11_PAGE reloc. + (fixup16): Likwise with BFD_RELOC_M68HC11_LO16. + (fixup24): New to handle call reloc. + (build_insn): Handle missing page operand for call instruction. + (find): Likewise. + (md_apply_fix3): Take into account new relocs. + (get_operand): Fix the mode for indexed indirect addressing. + (build_indexed_byte): Fix post index byte for indexed indirect mode. + +2002-08-12 Richard Sandiford + + * config/tc-mips.c (mips_ip): Don't work out the value of + constant %hi()s here. + +2002-08-10 Alan Modra + + * config/tc-i386.c (tc_i386_fix_adjustable): Test OUTPUT_FLAVOR + for ELF, and don't bother checking ELF relocs when non-ELF. + (i386_immediate): Allow absolute_section expressions for aout. + (i386_displacement): Likewise. Also test bfd_is_com_section. + (md_estimate_size_before_relax): Test OUTPUT_FLAVOR for ELF. + (md_apply_fix3): Hack for bfd_install_relocation when fx_pcrel, + not when fx_addsy. Remove dead code. + +2002-08-09 Graeme Peterson + + * configure.in: Add support for ppc-*-nto* target. + * configure: Regenerate. + +2002-08-09 Alan Modra + + * config/tc-i386.h: Reorganize. + +2002-08-09 Maciej W. Rozycki + + * config/tc-mips.c (macro): Handle a register plus a 16-bit + immediate offset in "dla" and "la" expansions. + +2002-08-09 Alan Modra + + * configure.in: bfd_gas=yes for all i386 targets. Formatting. + Remove "bfd_gas=yes" from target table when covered later. + Consolidate some entries. + * configure: Regenerate + +2002-08-09 Jakub Jelinek + + * config/tc-i386.c (output_insn): Save frag_now and frag_now_fix () + at start of insn, pass it to output_disp and output_imm. + (output_disp): Added arguments. If _GLOBAL_OFFSET_TABLE_ is seen + in displacement for R_386_32 reloc, use R_386_GOTPC and compute + properly addend. + (output_imm): Added arguments. Compute properly addend for + R_386_GOTPC. + (md_apply_fix3): Remove R_386_GOTPC handling. + +2002-08-06 George France + + * config/tc-alpha.c (cpu_types): Enabled ev67, ev68, -m21264a + and m21264b processor names and cpu types. + * doc/c-alpha.texi: Documented new types. + +2002-08-06 Alan Modra + + * config/tc-ppc.c (md_apply_fix3): Adjust 16 bit XCOFF reloc offset. + +2002-08-01 Richard Sandiford + + * config/tc-mips.c (tc_gen_reloc): Extend GP-relative addend + handling to BFD_RELOC_MIPS16_GPREL. + +2002-08-01 Nick Clifton + + * config/tc-arm.c (add_to_lit_pool): Ensure that offset to literal + pool is computed using signed arithmetic so that proper sign + extension is performed if X_add_number is a 64-bit integer. + +2002-08-01 H.J. Lu + Daniel Jacobowitz + + * dwarf2dbg.c (dwarf2_finish): Don't emit unreferenced + .debug_line section unless it has line information. + +2002-07-31 Ian Dall + + * config/tc-ns32k.h (md_pcrel_adjust): Supply prototype. + * config/tc-ns32k.c (convert_iif, md_parse_option, md_show_usage): + Allow default displacement size to be an option "--disp-size-default". + (md_number_to_disp): Make error messages include value. Use %d to + print integers, not %s. + (fix_new_ns32k): Conditionally set fx_no_overflow so we don't + get duplicate messages sometimes. + (convert_iif): Grow frag to max possible instruction size. Avoid + creating unnecessary fixes. + (md_number_to_field) Add prototype. + (encode_operand, parse, convert_iif, md_fix_pcrel_adjust): Add + prototypes and make static. + (struct addr_mode): Make mode and scaled_mode explicitly signed. + (evaluate_expr): Use resultP argument instead of exprP global. + (get_addr_mode): Quiten compiler warnings. + (encode_operand): eliminate unused variables. Quiten compiler + warnings. Eliminate nul character in format strings. + (parse): argc is unsigned. + (reloc): Type cast index to quieten compiler. + (md_pcrel_adjust, md_apply_fix3): Remove unused variable. + (md_convert_frag): Note unused parameters. Remove unused + variables. + (md_create_long_jump, md_create_short_jump, + md_undefined_symbol_name, md_section_align, tc_gen_reloc): Note + unused parameters. + +2002-07-31 Nick Clifton + + * NEWS: Retroactively add entry for Lars Brinkhoff's contribution + of the PDP-11 and 2.11BSD a.out support. + +2002-07-31 Momchil Velikov + + * config/tc-v850.c (md_assemble): Fix range check for immediate + operand. + +2002-07-30 Chris Demetriou + + * config/tc-mips.c (mips_cpu_info_table): Clean up entries related + to Broadcom SB-1 core support. + +2002-07-31 Thiemo Seufer + + * config/tc-mips.c (mips_target_format): Fix formatting. + Add recognition of n32 ABI formats. + +2002-07-30 Maciej W. Rozycki + + * tc-mips.c (load_address): Don't clobber $at when loading a + 64-bit address in non-PIC code if noat is in effect. + (macro): Likewise. + +2002-07-30 Maciej W. Rozycki + + * config/tc-mips.c (macro): Use codes 6 and 7 in trap instructions + used in division/multiply macro expansions similarly to how they + are used in the variants with break instructions. + (macro2): Likewise. + +2002-07-30 Graeme Peterson + + * configure.in: Add support for arm-*-nto target. + * configure: Regenerate. + +2002-07-30 Nick Clifton + + * config/tc-arm.c (struct literal_pool): Add fields to allow + multiple literal pools to be maintained. + (find_literal_pool): New function. + (find_or_make_literal_pool): New function. + (add_to_literal_pool): Use find_or_make_literal_pool. + (arm_s_text, arm_s_data, arm_s_section): Remove - no longer + needed. + (s_ltorg): Use find_literal_pool. + (arm_cleanup): Dump all literal pools. + * doc/c-arm.texi: Document new behaviour of only dumping literal + pools upon request. + +2002-07-26 Alan Modra + + * config/tc-ppc.c (ppc_set_cpu): Use PPC_OPCODE_64 as the default + rather than PPC_OPCODE_32 for powerpc64*. + +2002-07-25 Nick Clifton + + * po/es.po: Updated Spanish translation. + * po/fr.po: Updated French translation. + +2002-07-25 Richard Sandiford + + * doc/c-mips.texi: Remove -mcpu. Document -mabi. + * configure.in (MIPS_CPU_STRING_DEFAULT): New configuration macro. + (USE_E_MIPS_ABI_O32, MIPS_DEFAULT_64BIT): New configuration macros. + * configure, config.in: Regenerate. + * config/tc-mips.c (file_mips_abi): Rename to mips_abi. + (mips_set_options): Remove "abi" field. + (mips_opts): Update accordingly. Replace all uses of mips_opts.abi + with mips_abi. + (mips_cpu): Remove. + (mips_arch_string, mips_arch_info): New vars. + (mips_tune_string, mips_tune_info): New vars. + (ABI_NEEDS_32BIT_REGS, ABI_NEEDS_64BIT_REGS): New macros. + (HAVE_32BIT_GPRS, HAVE_32BIT_FPRS): Don't check the ABI. + (mips_isa_to_str, mips_cpu_to_str): Remove. + (mips_ip): If the selected architecture is a generic ISA rather + than a processor, only mention the ISA level in error messages. + (OPTION_MCPU): Remove. + (OPTION_FP64): New. + (md_longopts): Add -mfp64, remove -mcpu. + (mips_set_option_string): New fn. + (md_parse_option): Make -mipsN update file_mips_isa rather than + mips_opts.isa. Use mips_set_option_string to set -march or -mtune. + Don't let -mgp32 and -mfp32 change the ABI. + (show): Move to end of file. Constify string argument. + (md_show_usage): Move to the end of the file. Read available + architectures from mips_cpu_info_table. + (mips_set_architecture): New fn. + (mips_after_parse_args): Rework. Remove -mcpu handling. -mipsN + is an alias for -march=mipsN. Don't change the ABI based on other + flags. Infer the register size from the ABI as well as the + architecture. Complain about more conflicting arguments. + Unify logic with GCC. + (s_mipsset): Don't change the ABI. + (mips_elf_final_processing): Check USE_E_MIPS_ABI_O32. + (mips_cpu_info_table): Remove Generic-MIPS* entries, keeping just + "mipsN"-type entries. Remove entries that vary only in the + manufacturer's prefix, or that have "000" replaced by "k". + Remove TARGET_CPU entries. Make r2000 entry use CPU_R3000. + (mips_strict_matching_cpu_name_p, mips_matching_cpu_name_p): New fns. + (mips_parse_cpu): New fn. + (mips_cpu_info_from_name, mips_cpu_info_from_cpu): Remove. + (mips_cpu_info_from_isa): Minor formatting tweak. + +2002-07-24 Nick Clifton + + * po/sv.po: Updated Swedish translation. + * po/es.po: Updated Spanish translation. + +2002-07-23 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + * config.in: Regenerate. + * po/POTFILES.in: Regenerate. + +2002-07-23 Nick Clifton + + * po/fr.po: Updated French translation. + +2002-07-23 Nick Clifton + + * CONTRIBUTORS: Ken Raeburn is no longer the maintainer for + GAS. + +2002-07-19 Thiemo Seufer + + * config/tc-mips.c (mips_need_elf_addend_fixup): Use S_IS_EXTERNAL + instead of S_IS_EXTERN. + (md_estimate_size_before_relax): Likewise. + (mips_fix_adjustable): Likewise. + +2002-07-19 Thiemo Seufer + + * config/tc-mips.c (mips_pic_level): Remove IRIX4_PIC. + +2002-07-19 Miroslav Tichy + Nick Clifton + + * cond.c (s_ifdef): Treat a referenced but not yet defined + symbol as if it were undefined, in exactly the same way as + .equiv. + + * doc/as.texinfo: Document that .ifdef, .ifndef and .equiv + consider referenced bug not yet defined symbols to be + undefined. + +2002-07-18 Denis Chertykov + Frank Ch. Eigler + Alan Lehotsky + John Healy + Jeff Johnston + + * configure.in: Add ip2k configuraton. + * configure: Regenerate. + * Makefile.am: Add ip2k configuraton. + * Makefile.in: Regenerate. + * configure: Regenerate. + * Makefile.in: Regenerate. + * config/tc-ip2k.c: New file. + * config/tc-ip2k.h: New files. + * NEWS: Mention new support. + * doc/Makefile.am (CPU_DOCS): Add c-ip2k.texi. + * doc/Makefile.in: Regenerate. + * doc/all.texi: Set IP2K + * doc/as.texinfo: Add IP2K description. + * doc/c-ip2k.texi: New file. + +2002-07-19 Nick Clifton + + * NEWS: Reformat to match style of other NEWS files. + +2002-07-17 Jan Hubicka + + * tc-i386.c (i386_align_code): Implement x86_64 neutral code fillers. + +2002-07-16 Moritz Jodeit + + * config/tc-z8k.c (build_bytes): Correct order of memset args. + +2002-07-16 Nick Clifton + + * NEWS: Add 'Changes in 2.13'. + +2002-07-15 Matt Fredette + + * config/tc-hppa.h (LABELS_WITHOUT_COLONS): Define if TE_NetBSD. + +2002-07-12 Alan Modra + + * config/tc-i386.c (process_suffix): Merge CODE_64BIT JumpByte + case with non CODE_64BIT case. Don't warn on "qword ptr" if + not CODE_64BIT. + +2002-07-11 Alan Modra + + * config/tc-ppc.c (ppc_elf_frob_symbol): Delete. + (ppc_frob_file_before_adjust): New function. + * config/tc-ppc.h (tc_frob_symbol): Don't define. + (ppc_elf_frob_symbol): Don't declare. + (tc_frob_file_before_adjust): Define. + (ppc_frob_file_before_adjust): Declare. + + * config/tc-ppc.c (md_pseudo_table): Warning fix. + (ppc_cpu): Make it unsigned long to agree with struct powerpc_opcode + flags. + (ppc_size): Delete. + (ppc_xcoff64): Rename to ppc_obj64. + (md_parse_option ): Encode old ppc_size value in ppc_cpu. + (ppc_set_cpu): Set PPC_OPCODE_32 too. + (ppc_arch): Use ppc_obj64 instead of ppc_size to select bfd_mach_ppc64 + or bfd_mach_ppc. + (ppc_target_format): Use ppc_obj64 to select format. + (md_begin): Adjust for PPC_OPCODE_32/64 in ppc_cpu. + (ppc_insert_operand): Use ppc_obj64 instead of ppc_size. + (ppc_elf_suffix): Likewise. Don't depend on BFD_DEFAULT_TARGET_SIZE. + (tc_frob_symbol): Likewise. + (md_assemble): Use ppc_obj64 instead of ppc_size. Don't depend on + BFD_DEFAULT_TARGET_SIZE. + (ppc_tc): Likewise. + (ppc_is_toc_sym): Likewise. + (md_apply_fix3): Likewise. + * config/tc-ppc.h (TC_FORCE_RELOCATION): Don't depend on + BFD_DEFAULT_TARGET_SIZE. + (ELF_TC_SPECIAL_SECTIONS): Likewise. + (tc_frob_symbol): Likewise. + +2002-07-09 Thiemo Seufer + + * config/tc-mips.c (macro_build): Handle MIPS16 insns. + (mips_ip): Likewise. + +2002-07-09 Alan Modra + + * config/tc-i386.c (md_pseudo_table ): Warning fix. + (BFD_RELOC_8, BFD_RELOC_8_PCREL): Define for non-BFD. + (md_apply_fix3): Formatting. Remove redundant test. + (tc_gen_reloc): Remove redundant code. + (tc_i386_force_relocation): Delete. Movy body of function to.. + * config/tc-i386.h (TC_FORCE_RELOCATION): .. here. + +2002-07-09 Federico G. Schwindt + + * configure.in: Add hppa-*-openbsd* target, change + alpha*-*-openbsd* format to elf, and use elf for sparc-*-openbsd* + with sparc64 cpu. + * configure: Regenerate. + +2002-07-08 Maciej W. Rozycki + + * config/tc-mips.c (macro): Shift the 32-bit address range + accessible with a lone "lui" down by 32768. + +2002-07-08 Maciej W. Rozycki + + * config/tc-mips.c (load_address): Use non-trapping "daddu" + instead of "dadd" in address calculations. + (macro): Likewise. + +2002-07-08 Alan Modra + + * config/tc-i386.c (process_suffix): Remove intel mode movsx and + movzx fudges. + (md_assemble): Instead, zap the suffix here. + +2002-07-03 Nick Clifton + + * NEWS: Remove next release number until the release is actually + upon us. + +2002-07-03 Alan Modra + + * Makefile.am (check-DEJAGNU): Revert 2002-06-25 change. + Run "make dep-am". + * Makefile.in: Regenerate. + +2002-07-02 Martin Schwidefsky + + * config/tc-s390.c (tc_s390_fix_adjustable): Prevent any adjustment + to symbols in merge sections, even non pc-relative ones. + +2002-06-29 Stephane Carrez + + * config/tc-m68hc11.h (m68hc11_listing_header): Fix warning. + +2002-06-29 Stephane Carrez + + * config/tc-m68hc11.h (ELF_TC_SPECIAL_SECTIONS): New sections + .softregs and .eeprom. + +2002-06-28 David O'Brien + + * NEWS: Note the next release is 2.13. + +2002-06-26 Nick Clifton + + * po/tr.po: New translation imported. + +2002-06-26 Elias Athanasopoulos + + * ecoff.c: (get_tag): Replace strcpy with xstrdup. + (ecoff_directive_def): Likewise. + (ecoff_directive_tag): Likewise. + * listing.c (file_info): Likewise. + * hash.c (what): Likewise. + +2002-06-25 H.J. Lu + + * Makefile.am (check-DEJAGNU): Set LC_ALL=C and export it. + * Makefile.in: Regenerated. + +2002-06-19 Dhananjay R. Deshpande + + * config/tc-sh.c (get_specific): Revert 2002-05-01 change. + (assemble_ppi): Generate warning if the same register is used + twice as destination in the same padd / pmuls instruction. + +2002-06-18 Dave Brolley + + From Catherine Moore, Michael Meissner, Richard Sandiford, Dave Brolley + * po/POTFILES.in: Add tc-frv.c, tc-frv.h. + * configure.in: Support frv-*-*. + * Makefile.am (CPU_TYPES): Add frv. + (TARGET_CPU_CFILES): Add tc-frv.c. + (TARGET_CPU_HFILES): Add tc-frv.h. + (DEPTC_frv_coff): New variable. + (DEPTC_frv_elf): New variable. + (DEPOBJ_frv_coff): New variable. + (DEPOBJ_frv_elf): New variable. + (DEP_frv_coff): New variable. + (DEP_frv_elf): New variable. + * tc-frv.c: New file. + * tc-frv.h: New file. + +2002-06-17 Catherine Moore + + * config/obj-elf.h (TARGET_SYMBOL_FIELDS): Conditionally define. + +2002-06-17 J"orn Rennecke + + * config/tc-sh.c (assemble_ppi): Initialize reg_n. + +2002-06-17 Tom Rix + + * config/tc-i370.h (tc_comment_chars): Define for i370-elf. + +2002-06-14 H.J. Lu + Daniel Jacobowitz + + * dwarf2dbg.h (dwarf2_directive_file): Return char *. + * dwarf2dbg.c (dwarf2_directive_file): Return filename. + * config/tc-mips.c (s_mips_file): Call s_app_file_string + and new_logical_line for the first .file directive. + * read.c (s_app_file_string): New function. + (s_app_file): Call it. + * read.h (s_app_file_string): Add declaration. + +2002-06-14 Daniel Jacobowitz + + * configure.in: Remove MIPS_STABS_ELF. + * configure: Regenerated. + * config.in: Regenerated. + * config/obj-elf.h (ECOFF_DEBUGGING): Define to mips_flag_mdebug + for MIPS targets. + * config/tc-mips.c (mips_pseudo_table): Remove #ifdef around + ".extern". + (pdr_seg): Declare unconditionally. + (md_begin): Always generate .pdr unless ECOFF_DEBUGGING or not ELF. + (s_mips_end): Likewise. Generate stabs function markers. + (s_mips_ent): Generate stabs function markers. + (s_mips_frame): Always generate .pdr unless ECOFF_DEBUGGING or not + ELF. + (s_mips_mask): Likewise. + (mips_flag_mdebug): New. + (md_longopts): Add "mdebug" and "no-mdebug". + (md_parse_options): Add OPTION_MDEBUG and OPTION_NO_MDEBUG. + (mips_after_parse_args): Set mips_flag_mdebug. + * doc/as.texinfo: Add "-mdebug" and "-no-mdebug" for MIPS. + +2002-06-13 Maciej W. Rozycki + + * config/tc-mips.c (md_apply_fix3): Don't subtract the symbol's + value twice for RELA relocations. + +2002-06-12 Ben Elliston + + * symbols.c (resolve_symbol_value): Initialise final_val. + + * subsegs.c (subsegs_print_statistics): Cast frchp to void *. + +2002-06-11 Tom Rix + + * config/tc-ppc.c (ppc_subseg_align): Delete. + (ppc_change_csect): Default csect align is 2. + * config/tc-ppc.h (SUB_SEGMENT_ALIGN): Delete + +2002-06-09 Marek Michalkiewicz + + * config/tc-avr.c (mcu_types): Update. + +2002-06-08 Matt Thomas + + * configure.in (vax-*-netbsdelf*, vax-*-netbsdaout*) + (vax-*-netbsd*): New targets. + * configure: Regenerate. + * config/aout_gnu.h (enum machine_type): Add M_VAX4K_NETBSD. + * config/tc-vax.c: Add support for ELF and PIC. + (flag_want_pic): New flag. + (float_cons): Fix prototype. + (md_apply_fix3): Adjust for BFD_ASSEMBLER. + (md_assemble): Introduce a new is_absolute local, and use it + rather than repeating the test. Make fatal errors actually + fatal by using as_fatal as appropriate. Adjust for BFD_ASSEMBLER. + Add support for ELF. Add support for PIC. + (md_convert_frag): Adjust for BFD_ASSEMBLER. + (tc_aout_fix_to_chars): Only include if OBJ_AOUT and not + BFD_ASSEMBLER. + (vax_reg_parse): Make the % register prefix mandatory for ELF, + optional for a.out, and not allowed for VMS. Adjust all callers. + (md_create_short_jump): Add ATTRIBUTE_UNUSED to unused arguments. + (md_create_long_jump): Likewise. + (md_undefined_symbol): Likewise. + (md_section_align): Likewise. + (md_shortopts): Allow -k and -K for ELF. + (md_parse_option): Set flag_want_pic if -k or -K. + (tc_headers_hook): New function if OBJ_AOUT and not BFD_ASSEMBLER. + (tc_gen_reloc): New function if BFD_ASSEMBLER. + * config/tc-vax.h (tc_headers_hook): Remove. + (TARGET_FORMAT): Set according to object format and target + environment. + (BFD_ARCH, TARGET_ARCH): Define. + (NO_RELOC): Adjust for BFD_ASSEMBLER. + (TC_RELOC_RTSYM_LOC_FIXUP, TC_FIX_ADJUSTABLE) + (tc_fix_adjustable): Define if BFD_ASSEMBLER. + * config/vax-inst.h (VAX_JSB, VAX_CALLS, VAX_CALLG): Define. + +2002-06-08 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + + * as.c: Replace CONST with const. + * write.c: Likewise. + * config/obj-coff.c: Likewise. + * config/tc-a29k.c: Likewise. + * config/tc-arm.c: Likewise. + * config/tc-dlx.c: Likewise. + * config/tc-h8300.c: Likewise. + * config/tc-h8500.c: Likewise. + * config/tc-i370.c: Likewise. + * config/tc-i860.c: Likewise. + * config/tc-i960.c: Likewise. + * config/tc-m68hc11.c: Likewise. + * config/tc-m68k.c: Likewise. + * config/tc-m88k.c: Likewise. + * config/tc-mcore.c: Likewise. + * config/tc-mips.c: Likewise. + * config/tc-ns32k.c: Likewise. + * config/tc-pdp11.c: Likewise. + * config/tc-pj.c: Likewise. + * config/tc-s390.c: Likewise. + * config/tc-sh.c: Likewise. + * config/tc-sparc.c: Likewise. + * config/tc-tahoe.c: Likewise. + * 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. + +2002-06-08 Daniel Jacobowitz + + Based on patch from Matt Green: + * config/obj-elf.h (ECOFF_DEBUGGING): Make configurable. + * config/tc-mips.c (s_mips_file): Renamed from s_file. + (s_mips_loc): New function. + (mips_nonecoff_pseudo_table): Call them. + (append_insn): Call dwarf2_emit_insn. + +2002-06-08 Thiemo Seufer + + * config/tc-mips.c (mips_opts): Fix comment, all ASE fields are set + to -1. + (file_ase_mips16): New veriable. + (mips_eabi64): Remove. + (CPU_HAS_MIPS16): New define. + (CPU_HAS_MDMX): Fix data type. + (md_begin): Code cleanup. Use file_ase_mips16. + (mips_elf_final_processing): Handle mips16 header flag. + Handle EABI flag without intermediate variable. + +2002-06-08 Thiemo Seufer + + * doc/as.texinfo: Update MIPS documentation. + +2002-06-08 Thiemo Seufer + + * config/tc-mips.c: Add define for $zero register. + (md_begin): Add $zero as alias name for $0. + (insn_uses_reg): Use ZERO define. + (mips_ip): Add $zero as alias name for $0. + (mips16_ip): Likewise. + (s_cplocal): Demand empty rest of input line. + (tc_get_register): Likewise. Add support for $kt0, kt1 register + names. Use ZERO define. Fix input_line_pointer progress. + +2002-06-07 Alan Modra + + * symbols.c: Replace CONST by const throughout. + (symbol_find_exact): Split out from.. + (symbol_find_base): ..here. + * symbols.h: Replace CONST by const throughout. + (symbol_find_exact): Declare. + * config/obj-elf.c: #include "struc-symbol.h". + (elf_frob_file): If group name matches an exported symbol, use that + symbol for the signature and ".group" as the section name. + +2002-06-06 J"orn Rennecke + + * config/tc-sh.c (parse_at): @(symbol,pc) is A_DISP_PC again, + but warn about it. + +2002-06-06 Daniel Jacobowitz + + * tc-mips.c (mips_after_parse_args): Always set mips_opts.ase_mips3d + and mips_opts.ase_mdmx if they are uninitialized. + +2002-06-06 John David Anglin + + * gas/config/tc-hppa.c (pa_ip): Replace "L$0\001" with FAKE_LABEL_NAME. + (hppa_force_relocation): Check if a stub just before the start symbol + of the last call_info is reachable before forcing relocation. Fix + typo. + +2002-06-04 Maciej W. Rozycki + + * config/tc-mips.c (mips_after_parse_args): New function. + (md_begin): Move processing of defaults to mips_after_parse_args. + config/tc-mips.h (md_after_parse_args): Define. + +2002-06-04 Jason Thorpe + + * configure.in (sh5*): Set cpu_type to sh64 and endian to big. + (sh5le*, sh64le*): Set cpu_type to sh64 and endian to little. + (sh5*-*-netbsd*, sh64*-*-netbsd*): New targets. + * configure: Regenerate. + * config/tc-sh64.c (sh64_target_format): Add support for NetBSD + environment. + +2002-06-04 Jason Thorpe + + * config/tc-sh64.h (MD_PCREL_FROM_SECTION): Undef before redefining. + +2002-06-04 Alan Modra + + * config/obj-elf.c (obj_elf_change_section): Set and check elf + linkonce flag. Print all warnings. + (obj_elf_section): Parse ",comdat" for groups. + (elf_frob_file): Set SEC_LINK_ONCE on COMDAT groups. Check + consistency of comdat flag. + +2002-06-02 Richard Henderson + + * config/tc-alpha.c (alpha_adjust_symtab_relocs): Fix thinko + with LITERALs without sequence numbers. + +2002-06-01 Richard Henderson + + * config/tc-alpha.c: Move LITUSE constants to "elf/alpha.h". + Rename them LITUSE_ALPHA_*. + +2002-05-31 Shrinivas Atre + + * config/tc-h8300.c (get_operand): Allow stm.l and ldm.l insns to + accept parentheses enclosed register lists. + +2002-05-31 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + +2002-05-31 Graeme Peterson + + * configure.in: Add i386-*-nto-qnx*. + * configure: Regenerate. + +2002-05-31 Thiemo Seufer + + * config/tc-mips.c (mips_ip): Use unsigned long values for + warning output. + +2002-05-31 Thiemo Seufer + + * config/tc-mips.c (s_cpsetup): Fix initialization of + mips_cpreturn_register and mips_cpreturn_offset. + +2002-05-31 Thiemo Seufer + + * config/tc-mips.c (s_cpsetup): Fix comment. + +2002-05-31 Thiemo Seufer + + * config/tc-mips.c (md_begin): Add $ra as alias name for $31. + (mips_ip): Likewise. + (mips16_ip): Likewise. + (tc_get_register): Likewise. + +2002-05-30 Chris G. Demetriou + Ed Satterthwaite + + * config/tc-mips.c (mips_set_options): New "ase_mdmx" member. + (mips_opts): Initialize "ase_mdmx" member. + (file_ase_mdmx): New variable. + (CPU_HAS_MDMX): New macro. + (md_begin): Initialize mips_opts.ase_mdmx and file_ase_mdmx + based on command line options and configuration defaults. + (macro_build): Note in comment that use of MDMX in macros is + not currently allowed. + (validate_mips_insn): Add support for the "O", "Q", "X", "Y", and + "Z" MDMX operand types. + (mips_ip): Accept MDMX instructions if mips_opts.ase_mdmx is set, + and add support for the "O", "Q", "X", "Y", and "Z" MDMX operand + types. + (OPTION_MDMX, OPTION_NO_MDMX, md_longopts, md_parse_option): + Add support for "-mdmx" and "-no-mdmx" options. + (OPTION_ELF_BASE): Move to accommodate new options. + (s_mipsset): Support ".set mdmx" and ".set nomdmx". + (mips_elf_final_processing): Set MDMX ASE ELF header flag if + file_ase_mdmx was set. + * doc/as.texinfo: Document -mdmx and -no-mdmx options. + * doc/c-mips.texi: Likewise, and document ".set mdmx" and ".set + nomdmx" directives. + +2002-05-31 Thiemo Seufer + + * config/tc-mips.c (OPTION_NO_M7000_HILO_FIX): Rename to + OPTION_MNO_7000_HILO_FIX. Add alternate "mno-fix7000" + command line switch conforming to gcc conventions. + * doc/c-mips.texi: Document -mno-fix7000 instead of no-mfix-7000. + +2002-05-31 Thiemo Seufer + + * config/tc-mips.c (macro_build_jalr): New Function. + (md_begin): NewABI uses big GOTs. + (macro_build): Recognize BFD_RELOC_MIPS_GOT_DISP, + BFD_RELOC_MIPS_GOT_PAGE, BFD_RELOC_MIPS_GOT_OFST as valid. + (load_address): Add some NewABI PIC support. + (macro): Likewise. + (md_apply_fix): Special handling for BFD_RELOC_MIPS_JALR. + (tc_gen_reloc): Don't encode NewABI vtables in REL relocations. + +2002-05-31 Thiemo Seufer + + * config/tc-mips.c (load_address): Use mips_gp_register instead + of hardcoded value. Remove dbl parameter, use HAVE_32BIT_ADDRESSES + instead. + (macro): Use mips_gp_register instead of hardcoded value. + +2002-05-30 Richard Henderson + + * expr.h (operatorT): Add O_md17..O_md32. + * config/tc-alpha.c (O_lituse_tlsgd, O_lituse_tlsldm, O_tlsgd, + O_tlsldm, O_gotdtprel, O_dtprelhi, O_dtprello, O_dtprel, O_gottprel, + O_tprelhi, O_tprello, O_tprel): New. + (USER_RELOC_P, alpha_reloc_op_tag, debug_exp): Include them. + (DUMMY_RELOC_LITUSE_TLSGD, DUMMY_RELOC_LITUSE_TLSLDM): New. + (LITUSE_TLSGD, LITUSE_TLSLDM): New. + (struct alpha_reloc_tag): Add master, saw_tlsgd, saw_tlsld, + saw_lu_tlsgd, saw_lu_tlsldm. Make multi_section_p a bit field. + (md_apply_fix3): Handle TLS relocations. + (alpha_force_relocation, alpha_fix_adjustable): Likewise. + (alpha_adjust_symtab_relocs): Sort LITERAL relocs after the + associated TLS reloc. Check lituse_tls relocs match up. + (emit_insn): Handle TLS relocations. + (ldX_op): Remove. + + * doc/c-alpha.texi: Add docs for tls relocations. + +2002-05-30 Thiemo Seufer + + * config/tc-mips.c (mips_gprel_offset): New variable. + (s_gpvalue): Use it. + +2002-05-30 Diego Novillo + + * gas/config/tc-d10v.c (check_resource_conflict): Only check + write-write conflicts. + (md_assemble): Reformat introductory comment. + (parallel_ok): Prevent packing only if the first + instruction cannot be packed. + +2002-05-30 Jason Eckhardt + Tom Rix + + * config/tc-d10v.c (build_insn): Check for immediates. + +2002-05-28 Thiemo Seufer + + * config/tc-mips.c: Replace GP in comments by $gp. + (mips_big_got): Initialize. + (mips_trap): Initialize. + (load_address): Use mips_gp_register instead of hardcoded value. + Remove dbl parameter, use HAVE_32BIT_ADDRESSES instead. + (macro): Use mips_gp_register instead of hardcoded value. + (macro2): Change load_address calls. + (md_pcrel_from): Comment formatting. + (s_cpload): Use mips_gp_register instead of hardcoded value. + (s_cprestore): Likewise. Comment formatting. + (s_gpword): Fix data type. + (s_cpadd): Use mips_gp_register instead of hardcoded value. + (nopic_need_relax): Replace GP in comments by $gp. + (mips_elf_final_processing): Better comment. + +2002-05-28 Kuang Hwa Lin + + * configure.in: Add DLX configuraton + * Makefile.am: Add DLX configuraton + * configure: Regenerate. + * Makefile.in: Regenerate. + * config/tc-dlx.c: New file. + * config/tc-dlx.h: New files. + * NEWS: Mention new support. + +2002-05-27 Nick Clifton + + * config/obj-coff.c (write_object_file): Add missing semicolon. + +2002-05-26 Thiemo Seufer + + * config/tc-mips.c (mips_emit_delays): Replace magic constant for RA + by the define. Remove superfluous check of mips_opts.mips16. + (append_insn): Likewise. Canonicalize variable increments. + (macro_build): Canonicalize variable increments. + (macro_build_lui): Likewise. + (load_register): Likewise. + (load_address): Move pointer initialization. + (macro): Move pointer to a more local scope. Canonicalize variable + increments. Better comments. Replace magic constant for RA by the + define. + (macro2): Replace magic constant for RA by the define. Canonicalize + variable increments. + (mips_ip): Canonicalize variable increments. + (mips16_ip): Replace magic constant for RA by the define. + (my_getSmallParser): Canonicalize variable increments/decrements. + (my_getPercentOp): Likewise. + (my_getSmallExpression): Likewise. + (s_align): Likewise. + (s_mipsset): Likewise. + (s_cpsetup): Likewise. + (s_insn): Remove superfluous check of mips_opts.mips16. + (s_mips_stab): Likewise. + (mips_handle_align): Canonicalize variable increments. + (s_mips_ent): Likewise. + (s_mips_end): Add comment. + +2002-05-26 Jason Thorpe + + * configure.in: Use ns32k-*-netbsd* instead of ns32k-pc532-netbsd*. + * configure: Regenerate. + +2002-05-25 Alan Modra + + * Makefile.am (OBJS): Depend on ansidecl.h and fopen-same.h. + * Makefile.in: Regenerate. + * dep-in.sed: Reorder to match OBJS in Makefile.am. + * configure.in (ALL_OBJ_DEPS): Add symcat.h when need_bfd. + * configure: Regenerate. + * as.h: Use #include "" instead of <> for local header files. + * flonum-konst.c: Likewise. + * flonum-mult.c: Likewise. + * gasp.c: Likewise. + * listing.c: Likewise. + * config/tc-ia64.h: Likewise. + * config/tc-v850.h: Likewise. + +2002-05-24 TAMURA Kent + + * configure.in: Add a target for i386-netbsdpe. + * configure: Regenerate. + +2002-05-23 Jakub Jelinek + + * config/obj-elf.c (elf_common): Renamed from obj_elf_common. + (obj_elf_common): Call elf_common. + (obj_elf_tls_common): New function. + (elf_pseudo_tab): Support .tls_common. + (special_sections): Add .tdata and .tbss. + (obj_elf_change_section): Set SEC_THREAD_LOCAL for SHF_TLS + sections. + (obj_elf_parse_section_letters): Support T in section flags (SHF_TLS). + (obj_elf_parse_section_letters): Include T in error message. + * config/tc-ppc.c (ppc_section_letter): Likewise. + * config/tc-alpha.c (alpha_elf_section_letter): Likewise. + (tc_gen_reloc): Handle SEC_THREAD_LOCAL the same way as + SEC_MERGE. + * config/tc-sparc.c (md_apply_fix3): Likewise. + * config/tc-i386.c (tc_i386_fix_adjustable): Add TLS relocs. + Define them if not BFD_ASSEMBLER. + (lex_got): Support @TLSGD, @TLSLDM, @GOTTPOFF, @TPOFF, @DTPOFF + and @NTPOFF. + (md_apply_fix3): Add TLS relocs. + * config/tc-ia64.c (enum reloc_func): Add FUNC_DTP_MODULE, + FUNC_DTP_RELATIVE, FUNC_TP_RELATIVE, FUNC_LT_DTP_MODULE, + FUNC_LT_DTP_RELATIVE, FUNC_LT_TP_RELATIVE. + (pseudo_func): Support @dtpmod(), @dtprel() and @tprel(). + (ia64_elf_section_letter): Include T in error message. + (md_begin): Support TLS operators. + (md_operand): Likewise. + (ia64_gen_real_reloc_type): Support TLS relocs. + * write.c (adjust_reloc_syms): Don't change symbols in + SEC_THREAD_LOCAL sections to STT_SECTION + addend. + +2002-05-23 Nick Clifton + + * config/tc-arm.c (md_apply_fix3): For the Thumb BLX reloc + round the relocation up rather than down. + +2002-05-23 Nick Clifton + + * config/obj-coff.c (obj_coff_section): Silently ignore an 'a' + flag. + * doc/as.texinfo: Document that the COFF version of .section + ignores the 'a' flag. + +2002-05-23 Alan Modra + + * config/tc-alpha.c (assemble_tokens): Protect use of + ALPHA_RELOC_TABLE with #ifdef RELOC_OP_P. + + * write.c (size_seg): Check adjustment to last frag. + (SUB_SEGMENT_ALIGN): If HANDLE_ALIGN defined, pad out last frag to + section alignment. + * config/obj-coff.c (SUB_SEGMENT_ALIGN): Likewise. + * config/obj-ieee.c (SUB_SEGMENT_ALIGN): Likewise. + (write_object_file): Invoke md_do_align if available, and use + frag_align_code on text sections. + * config/obj-vms.h (SUB_SEGMENT_ALIGN): Now two args. + * config/tc-m88k.h (SUB_SEGMENT_ALIGN): Likewise. + * config/tc-ppc.h (SUB_SEGMENT_ALIGN): Likewise. + * config/tc-sh.h (SUB_SEGMENT_ALIGN): Likewise. + * config/tc-i386.h (SUB_SEGMENT_ALIGN): Likewise. Define for + BFD_ASSEMBLER too. + +2002-05-22 H.J. Lu + + * dwarf2dbg.c (dwarf2_directive_loc): Call listing_source_file + for source file. + +2002-05-22 Nick Clifton + + * config/tc-arm.c (arm_s_section): Enable for COFF builds as well + as ELF builds. + +2002-05-22 H.J. Lu + + * dwarf2dbg.c (dwarf2_emit_insn): Emit only one line symbol + for one .loc for compiler. + +2002-05-22 Thiemo Seufer + + * config/tc-mips.c (macro): Relax warning, it's toot strict for + embedded-PIC. + +2002-05-22 Thiemo Seufer + + * config/tc-mips.c (macro2): Add 64 bit drol, dror macros. + Optimize the rotate by zero case. + +2002-05-21 Nick Clifton + + * configure.in: Remove accidental enabling of bfd_gas=yes for + sh-coff targets. + * configure: Regenerate. + +2002-05-18 Kazu Hirata + + * app.c: Fix formatting. + * as.c: Likewise. + * ehopt.c: Likewise. + * expr.c: Likewise. + * input-file.c: Likewise. + * listing.c: Likewise. + * macro.h: Likewise. + * stabs.c: Likewise. + * symbols.c: Likewise. + +2002-05-17 Alan Modra + + * config/obj-generic.c: Delete file. + * config/obj-generic.h: Likewise. + +2002-05-16 Marek Michalkiewicz + + * config/tc-avr.c (mcu_types): Update for new devices. + +2002-05-15 Thiemo Seufer + + * config/tc-mips.c (macro): Warn about wrong la/dla use. + +2002-05-15 Thiemo Seufer + + * config/tc_mips.c (s_cpsetup): Fix completely bogus code which had + worked sometimes by accident. Fix copy&paste comment. + +2002-05-15 Thiemo Seufer + + * config/tc-mips.c (md_begin): Fix .reginfo and .MIPS.option section + alignment for NewABI. Let n32 use .reginfo. Remove useless casts. + (mips_elf_final_processing): Let n32 use .reginfo. + +2002-05-15 Thiemo Seufer + + * config/tc-mips.c (append_insn): Fix too small range of variable. + +2002-05-14 Nick Clifton + + * config/tc-arm.c (arm_cleanup): Remove redundant call to + listing_prev_line(). + +2002-05-13 Nick Clifton + + * config/tc-arm.c (md_assemble): Remove redundant call to + listing_prev(). + + * dwarf2dbg.c (dwarf2_emit_insn): Do not reset + loc_directive_seen. + + * stabs.c (s_stab_generic): Fix grammatical error in warning + message. + +2002-05-13 Alan Modra + + * write.c (subsegs_finish): Don't specially align last subseg. + +2002-05-11 Nick Clifton + + * stabs.c (s_stab_generic): Warn about a description field that is + too big. + + * config/obj-coff.c: Fix compile time warnings when compiling + without BFD_ASSEMBLER defined. + Fix formatting. + + * config/tc-sh.c (md_pcrel_from): Define for use with sh-hms + target. + (md_pcrel_from_section): Use md_pcrel_from(). + +2002-05-11 Bruno Haible + + * dwarf2dbg.c (dwarf2_emit_insn): Use the 'current' struct filled + by dwarf2_directive_loc, instead of calling dwarf2_where. + +2002-05-11 Kazu Hirata + + * config/obj-coff.h: Fix formatting. + * config/tc-mcore.c: Likewise. + * config/tc-mn10300.c: Likewise. + * config/tc-openrisc.c: Likewise. + * config/tc-or32.c: Likewise. + * config/tc-pdp11.c: Likewise. + * config/tc-ppc.c: Likewise. + * config/tc-ppc.h: Likewise. + * config/tc-sh64.c: Likewise. + * config/tc-sh.c: Likewise. + * config/tc-tic54x.c: Likewise. + * config/tc-xstormy16.c: Likewise. + * config/tc-xstormy16.h: Likewise. + +2002-05-09 Kazu Hirata + + * config/obj-coff.c: Fix formatting. + * config/obj-elf.c: Likewise. + * config/tc-alpha.c: Likewise. + * config/tc-arm.c: Likewise. + * config/tc-d10v.c: Likewise. + * config/tc-d30v.c: Likewise. + * config/tc-h8300.c: Likewise. + * config/tc-hppa.c: Likewise. + +2002-05-09 Alan Modra + + * config/tc-i386.c (md_estimate_size_before_relax) Don't lose + reloc when no_cond_jump_promotion. + +2002-05-08 Jim Wilson + + * config/tc-i960.c (md_estimate_size_before_relax): Return size of + current variable part of frag. + +2002-05-08 Kazu Hirata + + * config/tc-mmix.c: Fix formatting. + * config/tc-mmix.h: Likewise. + +2002-05-08 Alan Modra + + * configure: Regenerate. + +2002-05-07 Kazu Hirata + + * config/tc-m68k.c: Fix formatting. + +2002-05-07 Federico G. Schwindt + + * Makefile.am: Honour DESTDIR. + * Makefile.in: Regenerate. + +2002-05-06 Kazu Hirata + + * config/tc-ia64.c: Fix formatting. + * config/tc-ia64.h: Likewise. + +2002-05-04 Kazu Hirata + + * config/tc-mips.c: Fix formatting. + * config/tc-s390.c: Likewise. + * config/tc-s390.h: Likewise. + +2002-05-03 Alexandre Oliva + + * config/tc-s390.c (md_gather_operands): Emit dwarf2 line-number + information for instructions. + +2002-05-02 Kazu Hirata + + * as.h: Fix formatting. + * cgen.c: Likewise. + * cgen.h: Likewise. + * dwarf2dbg.c: Likewise. + * frags.h: Likewise. + * gasp.c: Likewise. + * macro.c: Likewise. + * read.c: Likewise. + * stabs.c: Likewise. + * symbols.c: Likewise. + +2002-05-02 Alan Modra + + * app.c (mri_pseudo): Only declare for TC_M68K. + + * config/tc-ppc.c (mapping): Map sectoff to BFD_RELOC_16_BASEREL. + (ppc_elf_validate_fix): Replace BFD_RELOC_32_BASEREL with + BFD_RELOC_16_BASEREL. + (md_assemble): Likewise. + (md_apply_fix3): Likewise. + +2002-05-02 Nick Clifton + + * config/tc-arm.c (thumb_add_sub): Do not convert a subtract of + zero into an add of zero - it is not the same. + +2002-05-01 Arati Dikey + + * tc-sh.c (get_specific): Generate warning if the same + destination register is used in parallel instructions. + +2002-05-01 Andrew Macleod + + * config/tc-i386.c (extra_symbol_chars): Add '[' to the list. + +2002-05-01 Alan Modra + + * write.c (cvt_frag_to_fill): Set fr_offset to zero on .org + backwards to prevent cascading errors. + +2002-04-30 Mark Mitchell + + * configure.in: Add support for powerpc-*-windiss. + * configure: Regenerated. + +2002-04-28 Alan Modra + + * config/tc-s390.c (md_parse_option): Formatting. + + * config/tc-i386.c: Formatting fixes, add missing space in error + message. + +2002-04-24 Christian Groessler + + * config/tc-z8k.c (build_bytes): Add support for new cases: + CLASS_IGNORE and ARG_NIM4. + (md_assemble): Prevent destruction of input_line_pointer if + get_operands returns failure. + +2002-04-24 Chris G. Demetriou + + * config/tc-mips.c (macro_build): Do _not_ allow MIPS-3D + instructions to be generated by macros. + +2002-04-24 Andreas Schwab + + * config/tc-i386.c (output_jump, output_disp) + (md_estimate_size_before_relax): Don't set fx_pcrel_adjust any + more. + (md_apply_fix3): Remember addend value for rela relocations. + (tc_gen_reloc): Correctly compute pc-relative relocation addend. + +2002-04-22 Chris Demetriou + + * config/tc-mips.c (macro_build): Add close-parenthesis missing + from previous change. + +2002-04-22 Eric Christopher + + * config/tc-mips.c (macro_build): Add warning if macro instructions + are expanded into a branch delay slot. + +2002-04-17 Geoffrey Keating + + * dwarf2dbg.c (dwarf2_gen_line_info): Do emit duplicate line + numbers, gdb relies on them to detect the start of the prologue. + +2002-04-17 Martin Schwidefsky + + * config/tc-s390.c (tc_s390_fix_adjustable): Prevent adjustments to + symbols in merge sections. + +2002-04-16 Alan Modra + + * as.c (main): Don't reference _bfd_chunksize. + +2002-04-15 Tom Rix + + * config/tc-d10v.c (d10v_fix_adjustable): Prevent adjustments to + symbols in merge sections. + +2002-04-11 Richard Sandiford + + * doc/invoke.texi (TC_LARGEST_EXPONENT_IS_NORMAL): Document. + * config/atof-ieee.c (TC_LARGEST_EXPONENT_IS_NORMAL): Add an + argument for the precision. + (gen_to_words): Update accordingly. + +2002-04-10 Alan Modra + + * as.c (parse_args ): Use VERSION is + BFD_VERSION_STRING unavailable. + * config/tc-i386.c (INLINE): Define (for non-BFD assembler). + +2002-04-09 J"orn Rennecke + + * config/tc-sh.h (TC_FIX_ADJUSTABLE): Disable adjusting if + symbol_used_in_reloc_p is true. + + * config/tc-sh.c (md_apply_fix3): Don't zero relocations on big + endian hosts. + +2002-04-04 Alan Modra + + * dep-in.sed: Cope with absolute paths. + * Makefile.am (dep.sed): Subst TOPDIR. + Run "make dep-am". + * Makefile.in: Regenerate. + +2002-04-04 Thiemo Seufer + + * config/tc-mips.c (mips16_macro_build): Cast type mismatch. + (mips_ip): Remove unused variable. + (md_apply_fix3): Cast signed/unsignes mismatches. Replace + unsigned char with bfd_byte. + (s_file): Remove unused variable. + (s_mips_ent): Likewise. + +2002-04-03 Tom Rix + + * config/tc-d10v.c (d10v_insert_operand): Fix warning in as_bad_where. + (build_insn): Same. + (find_opcode): Fix warning in as_warn. + * config/tc-d10v.h: Update Copyright. + +2002-04-03 Alan Matsuoka + Tom Rix + + From Jeff Knaggs + * config/tc-d10v.c (check_resource_conflict): New function to + check for resource conflicts. + + From Jason Eckhardt + * config/tc-d10v.c (build_insn): Check for unresolved imm4 or + imm3 fields. + * config/tc-d10v.c (find_opcode): Emit a warning if one of the + reserved control registers is used. + * config/tc-d10v.c (build_insn): Check for unresolved imm4 or + imm3 fields. + + From 2001-03-28 Diego Novillo + * tc-d10v.c (parallel_ok): Prevent packing only if the first + instruction cannot be packed. + + From 2001-03-30 Diego Novillo + * gas/config/tc-d10v.c (check_resource_conflict): Only check + write-write conflicts. + (md_assemble): Reformat introductory comment. + * opcodes/d10v-opc.c (d10v_opcodes): `btsti' does not modify its + arguments. + +2002-04-03 Alan Modra + + * symbols.c (resolve_symbol_value ): Derive final_seg from add_symbol. + : More final_seg twiddles. + +2002-04-01 Jessica Han + + * config/tc-ia64.c (ia64_cons_fix_new): Handle 8 byte iplt reloc + in 32-bit mode. + +2002-03-27 Andreas Schwab + + * config/tc-i386.c (output_jump): Set fx_pcrel_adjust to size of + field for pc-relative fixups. + (output_disp): Likewise. + (md_estimate_size_before_relax): Likewise. + (tc_gen_reloc): Subtract fx_pcrel_adjust instead of fx_size for + pc-relative fixups in 64bit mode. + +2002-03-22 Alan Modra + + * config/te-aix5.h: Typo fix. + +2002-03-21 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * doc/Makefile.in: Regenerate. + +2002-03-20 Albert Chin-A-Young + + * config/tc-arm.c (vfp_dp_reg_required_here): Fix typo + (vfp_sp_reg_pos -> vfp_dp_reg_pos). + +2002-03-18 Alexandre Oliva + + * config/tc-mips.c (md_estimate_size_before_relax): Do not modify + the EXTENDED bit here; report the estimate according to the + current size. + +2002-03-18 Tom Rix + + * configure.in: Add AIX 5 support. + * config/tc-ppc.c (ppc_target_format): Add AIX 5 64 bit target. + * config/te-aix5.h: New file. AIX 5 support. + * configure: Regenerate. + +2002-03-18 Nick Clifton + + * po/fr.po: Updated version. + +2002-03-16 Andreas Jaeger + + * doc/c-mips.texi (Machine Dependencies): Add new node. + +2002-03-15 Chris G. Demetriou + + * config/tc-mips.c (mips_set_options): New "ase_mips3d" member. + (mips_opts): Initialize "ase_mips3d" member. + (file_ase_mips3d): New variable. + (CPU_HAS_MIPS3D): New macro. + (md_begin): Initialize mips_opts.ase_mips3d and file_ase_mips3d + based on command line options and configuration defaults. + (macro_build, mips_ip): Accept MIPS-3D instructions if + mips_opts.ase_mips3d is set. + (OPTION_MIPS3D, OPTION_NO_MIPS3D, md_longopts, md_parse_option): + Add support for "-mips3d" and "-no-mips3d" options. + (OPTION_ELF_BASE): Move to accommodate new options. + (s_mipsset): Support ".set mips3d" and ".set nomips3d". + (mips_elf_final_processing): Add a comment indicating that a + MIPS-3D ASE ELF header flag should be set, when one exists. + * doc/as.texinfo: Document -mips3d and -no-mips3d options. + * doc/c-mips.texi: Likewise, and document ".set mips3d" and ".set + nomips3d" directives. + +2002-03-14 Hans-Peter Nilsson + + * config/tc-mmix.c (md_estimate_size_before_relax): Don't consider + a weak symbol in same section to be within reach. + +2002-03-13 Nick Clifton + + * po/fr.po: Updated version. + +2002-03-12 Andreas Schwab + + * config/tc-ia64.c (fixup_unw_records): Clear region when seeing a + body record so that an error is given for misplaced .save + pseudo-ops. + +2002-03-09 Alan Modra + + * config/tc-i386.h (REX_OPCODE): Define. + (REX_MODE64, REX_EXTX, REX_EXTY, REX_EXTZ): Define. + (rex_byte): typedef to int. + * config/tc-i386.c: Group prototypes and vars together. + Formatting fixes. Remove occurrences of "register" keyword. + (true): Delete. + (false): Delete. + (mode_from_disp_size): Add INLINE keyword to prototype. + (fits_in_signed_byte): Likewise. + (fits_in_unsigned_byte): Likewise. + (fits_in_unsigned_word): Likewise. + (fits_in_signed_word): Likewise. + (fits_in_unsigned_long): Likewise. + (fits_in_signed_long): Likewise. + (type_names): Constify. + (intel_float_operand): Constify param. + (add_prefix): Use REX_OPCODE. + (md_assemble): Likewise. Modify for changed rex_byte. + (parse_insn): Split out of md_assemble. + (parse_operands): Likewise. + (swap_operands): Likewise. + (optimize_imm): Likewise. + (optimize_disp): Likewise. + (match_template): Likewise. + (check_string): Likewise. + (process_suffix): Likewise. + (check_byte_reg): Likewise. + (check_long_reg): Likewise. + (check_qword_reg): Likewise. + (check_word_reg): Likewise. + (finalize_imm): Likewise. + (process_operands): Likewise. + (build_modrm_byte): Likewise. + (output_insn): Likewise. + (output_branch): Likewise. + (output_jump): Likewise. + (output_interseg_jump): Likewise. + (output_disp): Likewise. + (output_imm): Likewise. + +2002-03-07 Daniel Jacobowitz + + * doc/as.texinfo: Wrap @menu in @ifnottex, not @ifinfo. + +2002-03-06 Alan Modra + + * config/tc-i386.c (tc_gen_reloc): Don't attempt to handle 8 byte + relocs except when BFD64. + + * write.c (number_to_chars_bigendian): Don't abort when N is + larger than sizeof (VAL). + (number_to_chars_littleendian): Likewise. + +2002-03-05 John David Anglin + + * config/tc-hppa.c (md_apply_fix3): Add cast. + (hppa_fix_adjustable): Adjust list of selectors using e_lrsel and + e_rrsel. + +2002-03-05 Paul Koning + + * tc-pdp11.c: Use VAX float format support for PDP-11 target. + (parse_ac5): New function for parsing float regs in float operand. + (parse_expression): Remove attempt to make literals be octal. + (parse_op_no_deferred): Support float literals. + (parse_op): Reject attempts to refer to float regs. + (parse_fop): New function, like parse_op but for float operand. + (md_assemble): Add cases to parse float operands. Also fix + IMM3, IMM6, IMM8 cases to pick up the operand from the right spot. + +2002-03-04 H.J. Lu + + * config/obj-elf.c (special_section): Add .init_array, + .fini_array and .preinit_array. + + * config/tc-ia64.h (ELF_TC_SPECIAL_SECTIONS): Remove + .init_array and .fini_array. + +2002-03-01 Jakub Jelinek + + * config/obj-elf.c (elf_copy_symbol_attributes): Don't copy + visibility. + (obj_frob_symbol): Copy visibility. + +2002-02-28 Jakub Jelinek + + * config/tc-alpha.c (s_alpha_text): Use obj_elf_text for OBJ_ELF, not + s_text. + (s_alpha_data): Use obj_elf_data for OBJ_ELF, not s_data. + +2002-02-27 Nick Clifton + + * po/es.po: Updated. + +2002-02-26 Chris Demetriou + + * config/tc-mips.c (mips_need_elf_addend_fixup): For embedded-PIC + only, undo the changes made on 2001-06-08, with the + effect being that common or extern symbols are + adjusted for embedded-PIC, but weak symbols are not. + (md_estimate_size_before_relax: Likewise, with the effect + that extern symbols are treated the same as weak symbols + only if not embedded-PIC. + (mips_fix_adjustable) Likewise, with the effect that + weak or extern symbols are not adjusted for embedded-PIC. + (md_apply_fix3): Tweak so that the case where value is zero + is handled more correctly for embedded-PIC code. + +2002-02-26 Nick Clifton + + * doc/as.texinfo (Overview): Add missing @ifset IA64 + + * configure.in (LINGUAS): Add es.po. + * configure: Regenerate. + * po/es.po: New file. + +2002-02-25 Thiemo Seufer + + * config/tc-mips.c (set_at): Fix handling of 64bit register loads. + (macro): Likewise. Fix la/dla address expansions for EMBEDDED_PIC + and NO_PIC cases. Code cleanup. + (macro2): Fix handling of 64bit register loads. + +2002-02-25 David Mosberger + + * doc/as.texinfo: Add entry for IA64. + * doc/c-ia64.texi: New file. + +2002-02-25 Alan Modra + + * config/tc-hppa.c: Update copyright date. + + * doc/c-ppc.texi (PowerPC-Opts): Add -mpower4, -maltivec and -m7400 + Remove references to chip manufacturers. + * config/tc-ppc.c (md_parse_option): Handle -mpower4 option. + Correct comments. + (md_show_usage): Remove references to chip manufacturers. Mention + -mpower4. + (md_begin): Test power4 opcode flag bits. + +2002-02-22 David Mosberger + + * config/tc-ia64.c (dot_restore): Issue error message of epilogue + count exceeds prologue count. + (md_show_usage): Describe -mconstant-gp and -mauto-pic. + (unwind.label_prologue_count): New member. + + Based on a patch by Hans Boehm : + + (get_saved_prologue_count): New function. + (save_prologue_count): New function. + (free_saved_prologue_count): New function. + (dot_label_state): Record state label by calling save_prologue_count(). + (dot_copy_state): Restore prologue count by calling + get_saved_prologue_count(). + (generate_unwind_image): Free up list of saved prologue + counts by calling free_saved_prologue_counts(). + +2002-02-22 Nick Clifton + + * config/tc-tic54x.c: Add missing prototypes and remove ANSI style + function declarations. + +2002-02-21 Nick Clifton + + * NEWS: Note that GASP is now deprecated. + * Makefile.am: Do not build gasp-new by default. + * Makefile.in: Regenerate. + * doc/Makefile.am: Do not install gasp.info. + * doc/Makefile.in: Regenerate. + * gas/gasp.texi: Note that gasp is now deprecated. + +2002-02-20 Nick Clifton + + * NEWS: Mark 2.12 branch. + +2002-02-19 Tom Tromey + + * config/tc-xstormy16.h (DWARF2_LINE_MIN_INSN_LENGTH): Define. + +2002-02-19 Thiemo Seufer + + * config/tc-mips.c (md_parse_option): Complain about invalid -mabi + option input. + +2002-02-19 Martin Schwidefsky + + * config/tc-s390.c (md_parse_option): Add switches -m31 and -m64. + Make bit size independent of architecture switch. + (md_begin): Add warning for -m64 with -Aesa. + (s390_md_end): Use renamed architecture defines. + +2002-02-18 Daniel Jacobowitz + + * config/obj-coff.h: Check !target_big_endian, not shl, for coff-sh. + +2002-02-16 Nick Clifton + + * doc/as.texinfo (Machine Dependencies): Fix typo: MMIX used + instead of CRIS. + +2002-02-15 Chris Demetriou + + * config/tc-mips.c (md_estimate_size_before_relax): Really + make sure we treat weak like extern only for ELF. (Fixes + patch from 2001-07-25.) + +2002-02-15 Ben Elliston + + * doc/as.texinfo: Add duplicate directory entry so that "info gas" + works as expected. + +2002-02-15 Hans-Peter Nilsson + + * NEWS: Mention support for MMIX. + +2002-02-13 Chris Demetriou + + * config/tc-mips.c (mips_need_elf_addend_fixup): Restructure into + a sequence of indpendent 'if' statements for easier debugging + and future modification. + +2002-02-13 Matt Fredette + + * config/tc-m68k.c (md_show_usage): No longer display a + hard-coded "68020" for the default CPU, instead display the + canonical name of the true, configured default CPU. + (m68k_elf_final_processing): Mark objects for sub-68020 + CPUs with the new EF_M68000 flag. + +2002-02-13 Andreas Schwab + + * config/tc-i386.c (tc_i386_fix_adjustable): Don't adjust + pc-relative relocations to merge sections in 64-bit mode. + +2002-02-13 Ben Elliston + + * NEWS: Document floating point number handling in gasp. + * gasp.c: Include and "xregex.h". + (is_flonum): New function. + (chew_flownum): Likewise. + (change_base): Consume flonums from the input, where possible. + * doc/gasp.texi (Constants): Document floating point numbers. + +2002-02-12 John David Anglin + + * config/tc-hppa.c (hppa_fix_adjustable): Don't adjust final types + that implicitly use LR and RR selectors. + +2002-02-12 Alexandre Oliva + + * config/tc-mn10300.c (other_registers): Added `epsw'. Mark `pc' + and `epsw' as available on AM33 and above only. + (other_register_name): Add logic to handle machine type encoded in + reg_number. + +2002-02-11 Tom Rix + + * config/tc-ppc.c (md_apply_fix3): Check for insert fop invalid for + xcoff64. + +2002-06-11 Alexandre Oliva + + * config/tc-sparc.c (U0x80000000, U0xffffffff): New constants. + Use all over. + +2002-02-11 Jan Hubicka + + * i386.c (md_assemble): Support 32bit address prefix. + (i386_displacement): Likewise. + (i386_index_check): Accept 32bit addressing in 64bit mode. + +2002-02-11 Alexandre Oliva + + * config/tc-sh.c (dot): Removed unused function. + +2002-02-11 Alan Modra + + * Makefile.am: "make dep-am". + * Makefile.in: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * configure: Regenerate. + * doc/Makefile.in: Regenerate. + +2002-02-10 Richard Henderson + + * doc/c-alpha.texi: New file. + * doc/Makefile.am (CPU_DOCS): Add it. + * doc/all.texi, doc/as.texinfo: Add hooks for Alpha. + +2002-02-09 Richard Henderson + + * config/tc-alpha.c (O_samegp): New. + (USER_RELOC_P): Include it. + (alpha_reloc_op_tag, debug_exp, find_macro_match): Add it. + (md_apply_fix3): Handle BFD_RELOC_ALPHA_BRSGP. + (alpha_force_relocation, alpha_fix_adjustable): Likewise. + (alpha_validate_fix): New. + * config/tc-alpha.h (TC_VALIDATE_FIX): New. + +2002-02-09 Hans-Peter Nilsson + + * doc/c-cris.texi: New. + * doc/all.texi: @set CRIS. + * doc/as.texinfo: Ditto. Add CRIS gas manpage option overview. + Include c-cris.texi. + * doc/Makefile.am (CPU_DOCS): Add c-cris.texi + * doc/Makefile.in: Regenerate. + +2002-02-08 Chris Demetriou + + * config/tc-mips.c (IS_SEXT_32BIT_NUM): New macro to + determine if a number is a sign-extended 32-bit number. + (load_register): Use IS_SEXT_32BIT_NUM. + (macro): Check if load/store macro handling is using a + constant 32-bit address on 64-bit address systems, and if + so optimize the generation of that address. + +2002-02-08 Richard Henderson + + * config/tc-alpha.c (alpha_force_relocation): Don't assert that + we've eliminated all foreign relocation types yet. + (alpha_fix_adjustable): Likewise. + +2002-02-08 Alexandre Oliva + + Contribute sh64-elf. + 2002-02-08 Alexandre Oliva + Stephen Clarke + * doc/c-sh64.texi: Fix citation of SH64 architecture manual. + 2002-01-31 Alexandre Oliva + * config/tc-sh.c (md_relax_table): Added default sizes for + non-PC-relative UNDEF_MOVI, and relaxation sequences for + MOVI_16, MOVI_32 and MOVI_48. + * config/tc-sh64.c (shmedia_md_apply_fix3): Fix warning. + (shmedia_md_convert_frag): Handle non-PC-relative UNDEF_MOVI + and MOVI_16. + (shmedia_md_estimate_size_before_relax): Remove redundant + blocks. Set fragP->fr_var even if relaxation type unchanged. + Retain UNDEF_MOVI until expression decays to number. + 2002-01-24 Alexandre Oliva + * config/tc-sh64.c (shmedia_init_reloc): Handle new SHmedia PIC + relocation types. Take fixP->fx_addnumber into account too. + (shmedia_md_apply_fix): Likewise. + (shmedia_md_convert_frag): Likewise. + (shmedia_build_Mytes): Likewise. + (sh64_consume_datalabel): Complain about nested datalabel. + Support PIC relocs. Call sh_parse_name. + * config/tc-sh64.h (TC_RELOC_RTSYM_LOC_FIXUP): Extend definition + in tc-sh.h to SHmedia reloc types. + * config/tc-sh.c (SH64PCRELPLT, MOVI_PLT, MOVI_GOTOFF, + MOVI_GOTPC): New relaxation constants. + (md_relax_table): Introduce relaxation directives for PIC-related + constants. + (sh_PIC_related_p): Handle datalabel. + (sh_check_fixup): Choose SH5 PIC relocations. + (sh_cons_fix_new): Added BDF_RELOC_64. + (md_apply_fix3, sh_parse_name): Handle GOTPLT. + 2002-01-18 Alexandre Oliva + * config/tc-sh64.c (sh64_max_mem_for_rs_align_code): If the + current ISA is SHmedia, get 7 bytes. + 2001-11-28 Nick Clifton + * config/tc-sh.c (md_apply_fix3): Treat shmedia_md_apply_fix3 as a + void function. + * config/tc-sh64.c (shmedia_apply_fix): Rename to + shmedia_apply_fix3 and make void. + 2001-05-17 Alexandre Oliva + * config/tc-sh64.c (s_sh64_abi): Remove unused arguments passed to + as_bad. + 2001-04-12 Alexandre Oliva + * config/tc-sh64.h (md_parse_name): Take &c as argument. + 2001-03-14 DJ Delorie + * doc/Makefile.am (CPU_DOCS): Added c-sh64.texi + * doc/Makefile.in(CPU_DOCS): Ditto. + * doc/c-sh64.texi: New file. + * doc/as.texinfo: Add SH64 support. + 2001-03-13 DJ Delorie + * config/tc-sh64.c (shmedia_get_operands): Rename A_RESV_Fx to + A_REUSE_PREV so that its purpose is more obvious. + (shmedia_build_Mytes): Ditto. + 2001-03-07 DJ Delorie + * config/tc-sh64.c (sh64_vtable_entry): New, strip datalabels + before processing. + (sh64_vtable_inherit): Ditto. + (strip_datalabels): New, strip "datalabel" from given line. + * config/tc-sh.c (md_pseudo_table): Add sh64-specific vtable + pseudos. + 2001-03-06 Hans-Peter Nilsson + * config/tc-sh64.c (shmedia_md_assemble): Move dwarf2_emit_insn + call ... + (shmedia_build_Mytes): ... to here. + 2001-03-06 DJ Delorie + * config/tc-sh.c: Remove sh64-specific uaquad now that there + is a generic one. + 2001-01-21 Hans-Peter Nilsson + * config/tc-sh64.h (DWARF2_LINE_MIN_INSN_LENGTH): Override. + * config/tc-sh64.c (shmedia_md_assemble): Offset recorded insn + address by one in call to dwarf2_emit_insn. + 2001-01-13 Hans-Peter Nilsson + Implement ".abi" pseudo and correct .cranges descriptors. Correct + alignment handling broken by imported changes. + * config/tc-sh64.h (HANDLE_ALIGN): Override definition in tc-sh.h. + (sh64_handle_align): Declare. + (MAX_MEM_FOR_RS_ALIGN_CODE): Override definition in tc-sh.h. + (sh64_max_mem_for_rs_align_code): Declare. + (enum sh64_isa_values): Moved here from tc-sh64.c. + (md_do_align): Define. + (sh64_do_align): Declare. + (struct sh64_tc_frag_data): New. + (TC_FRAG_TYPE): Change to struct sh64_tc_frag_data. Users + changed. + (TC_FRAG_INIT): Change to set new datatype. + (struct sh64_segment_info_type): Rename member + last_flushed_location to last_contents_mark. All users changed. + (md_elf_section_change_hook, TC_CONS_FIX_NEW): Do not define. + (shmedia_elf_new_section, sh64_tc_cons_fix_new): Do not prototype. + * config/tc-sh.c (md_pseudo_table): Add ".abi". + (sh_elf_cons) [HAVE_SH64]: Call sh64_update_contents_mark instead + of unsetting seen_insn. + (md_assemble) [HAVE_SH64] : Also + call sh64_update_contents_mark. + (sh_handle_align): Remove HAVE_SH64-conditioned code. + * config/tc-sh64.c (sh64_isa_mode): Correct type from boolean to + enum sh64_isa_values. + (sh64_set_contents_type): Drop segT parameter. All callers changed. + (emitting_crange): Boolean guard moved to file scope from function + scope in sh64_set_contents_type. + (s_sh64_abi): New. + (sh64_update_contents_mark): New; most split out from + sh64_flush_pending_output. + (shmedia_md_end): Call sh64_update_contents_mark. Set + sh64_isa_mode to sh64_isa_sh5_guard unless sh64_isa_unspecified. + (sh64_do_align): New function. + (sh64_max_mem_for_rs_align_code): New function. + (sh64_handle_align): Rename from shmedia_do_align. Make + non-static. Add head comment. Emit zero bytes for n bytes modulo + four. Change return-type to void. + (shmedia_elf_new_section): Remove. + (shmedia_md_assemble): Call sh64_update_contents_mark. + (s_sh64_mode): Ditto. Do not call md_flush_pending_output. Make + new frag. Call sh64_update_contents_mark after making the new + frag. + (sh64_flush_pending_output): Just call sh64_update_contents_mark + and sh_flush_pending_output. + (sh64_flag_output): Also call md_flush_pending_output, but add + condition on not emitting_crange. + (sh64_tc_cons_fix_new): Remove. + 2001-01-12 Nick Clifton + * config/tc-sh64.c (shmedia_do_align): Fix to work with new + alignment handling scheme imported from sourceware. + 2001-01-12 Hans-Peter Nilsson + * config/tc-sh64.h (TARGET_FORMAT): Define. + (sh64_target_format): Prototype. + * config/tc-sh64.c (sh64_target_mach): New function. + 2001-01-07 Hans-Peter Nilsson + * config/tc-sh64.c (shmedia_md_end): When equating a symbol, use + zero_address_frag instead of copying the frag of the symbol. + (shmedia_frob_file_before_adjust): Ditto. + (shmedia_md_apply_fix) : Cast mask + to valueT to remove signedness. + (shmedia_md_convert_frag): Add parameter final. Rename parameter + headers to output_bfd. Do not evaluate symbols if final is false; + do emit fixups. + (shmedia_md_estimate_size_before_relax) : If symbol cannot be modified to be PC-relative + to the current frag, call shmedia_md_convert_frag to emit fixups + and make frag_wane neutralize the frag. Update comments. + * config/tc-sh.c (md_convert_frag): Change caller of + shmedia_md_convert_frag. + 2001-01-06 Hans-Peter Nilsson + * config/tc-sh64.h: Tweak comments and correct formatting. + * config/tc-sh64.c: Ditto. + (shmedia_md_convert_frag) : Fix thinko calculating offset + for the no-relocation case. + (shmedia_check_limits): Fix range check being off-by-one for PTA. + * config/tc-sh.c: Ditto. Add proper comments to #ifdef/#ifndef + wrappers. + (SH64PCREL16_F): Increment for proper max-PTA handling. Update + comment. + (SH64PCREL16_M, MOVI_16_M): Correct range thinko. + (SH64PCREL48_M, MOVI_48_M): Similar; don't count in length of + expansion. + (SH64PCREL32_M, MOVI_32_M): Ditto; handle overflowing expression. + Correct comment. + 2001-01-05 Hans-Peter Nilsson + * config/tc-sh64.c (shmedia_md_apply_fix) : Set lowest bit in field to be relocated to 1. + (shmedia_md_convert_frag) : Set lowest bit of field to relocate to 1 and rest to empty, + if reloc is emitted. + 2000-12-31 Hans-Peter Nilsson + New options plus bugfixes. + * config/tc-sh.c (md_longopts): New options "-no-expand" and + "-expand-pt32". + (md_parse_option): Handle new options. + (md_show_usage): Add blurb for new options. + * config/tc-sh64.c (SHMEDIA_BFD_RELOC_PT): New macro. + (sh64_expand, sh64_pt32): New variables. + (shmedia_init_reloc): Handle BFD_RELOC_SH_PT_16. + (shmedia_md_apply_fix): Hold original fixP->fx_r_type in + orig_fx_r_type. Change SHMEDIA_BFD_RELOC_PT into + BFD_RELOC_SH_PT_16. Handle BFD_RELOC_SH_PT_16 as pc-relative. + : Handle + SHMEDIA_BFD_RELOC_PT and BFD_RELOC_SH_PT_16. + (shmedia_md_convert_frag) : Modify to PTB if operand + points to SHcompact code. + : Check that ISA of what operand points at and + PTA/PTB matches, or emit error. + (shmedia_check_limits): Handle BFD_RELOC_SH_PT_16 and + SHMEDIA_BFD_RELOC_PT. + (shmedia_immediate_op): If pcrel, emit fixup also for constant + operand. + (shmedia_build_Mytes) : Also check sh64_expand in + condition for MOVI expansion. + : Handle expansion to 32 bits only, if + sh64_pt32. Emit only a BFD_RELOC_SH_PT_16 fixup if not + sh64_expand. + : Likewise, but emit a SHMEDIA_BFD_RELOC_PT + fixup. + (sh64_target_format): Error-check setting of sh64_pt32 and + sh64_expand. Fix typo in check for sh64_shcompact_const_crange. + (shmedia_md_pcrel_from_section): Handle BFD_RELOC_SH_PT_16 and + SHMEDIA_BFD_RELOC_PT as coming from SHmedia code. + 2000-12-31 Hans-Peter Nilsson + * config/tc-sh64.c: Improve comments. + (shmedia_md_convert_frag): Remove inactive is_pt_variant code. Do + not say the linker will check correctness of PTA/PTB expansion. + (shmedia_md_end): Make non-static. + * config/tc-sh64.h (md_end): Define to shmedia_md_end. Add + prototype. + * config/tc-sh.c (sh_finalize): Remove. + * config/tc-sh.h (md_end): Do not define. + Remove prototype for sh_finalize. + 2000-12-30 Hans-Peter Nilsson + * config/tc-sh64.c (shmedia_frob_section_type): Use a struct + sh64_section_data container when storing section type in tdata + field in elf_section_data. + * config/tc-sh.c (sh_elf_final_processing): Change from EF_SH64 to + EF_SH5. + * Makefile.am: Update dependencies. + * Makefile.in: Regenerate. + 2000-12-22 Hans-Peter Nilsson + * config/tc-sh64.c (shmedia_md_assemble): Don't protect + dwarf2_emit_insn call with test on debug_type. + 2000-12-19 Hans-Peter Nilsson + * config/tc-sh64.c (sh64_set_contents_type): Make contents-type + CRT_SH5_ISA32 sticky for 64-bit. + 2000-12-18 Hans-Peter Nilsson + Generate .crange sections when switching ISA mode or emitting + constants in same section as code. + * config/tc-sh64.c: Reformat structure definitions. + (sh64_end_of_assembly, sh64_mix, sh64_shcompact_const_crange): New + variables. + (sh64_set_contents_type): Rename from sh64_init_section. Rewrite + to emit a .cranges descriptor when contents type changes. Only + emit error if changing contents type and -no-mix is in effect. + (sh64_emit_crange, sh64_flush_last_crange, sh64_flag_output, + sh64_flush_pending_output, sh64_tc_cons_fix_new): New functions. + (shmedia_md_end): Set sh64_end_of_assembly. Pass + sh64_flush_last_crange over sections. + When checking main symbol of datalabel symbol, check for + STO_SH5_ISA32, not ISA type of section in definition. + (shmedia_frob_file_before_adjust): Check main symbol for + STO_SH5_ISA32; don't check ISA type of section in definition. + (shmedia_frob_section_type): Adjust for .cranges; set section flag + to SHF_SH5_ISA32_MIXED or SHF_SH5_ISA32 according to whether + .cranges entries have been output. + (shmedia_elf_new_section): Just call md_flush_pending_output. + (shmedia_md_assemble): Do not emit a BFD_RELOC_SH_SHMEDIA_CODE + fix. Do not set tc_segment_info_data.in_code for section. Call + sh64_set_contents_type for SHmedia code. + (s_sh64_mode): Do not call sh64_init_section or set seen_insn to + false. Call md_flush_pending_output. + (sh64_target_format): Check that -no-mix and + -shcompact-const-crange are used in sane combination with other + options. + (shmedia_md_pcrel_from_section): Check type of fix for how to + adjust pc-relative. + (sh64_consume_datalabel): Check symbol for having STO_SH5_ISA32, + not ISA type of section in definition. + * config/tc-sh64.h (struct sh64_segment_info_type): Rewrite to + hold contents-type state. + (md_flush_pending_output): Redefine to sh64_flush_pending_output. + (sh64_flush_pending_output): Declare. + (TC_CONS_FIX_NEW): Define to sh64_tc_cons_fix_new. + (sh64_tc_cons_fix_new): Declare. + * config/tc-sh.c (sh_elf_cons) [HAVE_SH64]: Unset seen_insn and + call sh64_flag_output. + (md_assemble) [HAVE_SH64]: Do not emit BFD_RELOC_SH_CODE. Just + call sh64_set_contents_type to mark SHcompact code and set + seen_insn. + (md_longopts): New options "-no-mix" and + "-shcompact-const-crange". + (md_parse_option): Handle new options. + (md_show_usage): Add blurb for new options. + (md_number_to_chars) [HAVE_SH64]: Call sh64_flag_output. + 2000-12-15 Hans-Peter Nilsson + * config/tc-sh64.c: Delete investigated and obsolete fixme:s. + (sh64_last_insn_frag): New. + (shmedia_md_convert_frag): Use tc_frag_data field of incoming frag + to get frag for insn opcode for generating fixups; do not assume it + is the same frag. + (shmedia_build_Mytes): Set sh64_last_insn_frag after growing frag + for new insn. + * config/tc-sh64.h (ELF_TC_SPECIAL_SECTIONS): Define for .cranges + section. + (TC_FRAG_TYPE): Define as fragS *. + (TC_FRAG_INIT): Define to set tc_frag_data to sh64_last_insn_frag. + (sh64_last_insn_frag): Declare. + (sh64_consume_datalabel): Fix typo; check for seginfo != NULL, + not == NULL before dereferencing. + 2000-12-12 Hans-Peter Nilsson + Get rid of BFD section flag and EF_SH64_ABI64. + * config/tc-sh64.c (shmedia_frob_section_type): Use + elf_section_data (sec)->tdata, not a specific BFD section flag, to + communicate the section as containing SHmedia code. Describe why. + * config/tc-sh.c (sh_elf_final_processing): Tweak comment. Set + EF_SH64 regardless of ABI. + * config/tc-sh64.c (shmedia_md_apply_fix): Decapitalize "invalid" + in error message. Handle resolved expressions for + BFD_RELOC_SH_IMMS10, BFD_RELOC_SH_IMMS10BY2, + BFD_RELOC_SH_IMMS10BY4 and BFD_RELOC_64. + (shmedia_check_limits): Handle BFD_RELOC_64. + (sh64_adjust_symtab): Do not decrement the GAS symbol value for + a STO_SH5_ISA32 symbol, only the BFD value. + 2000-12-11 Ben Elliston + * config/tc-sh64.c: Call dwarf2_emit_insn, not the defunct + dwarf2_generate_asm_lineno. + 2000-12-11 Hans-Peter Nilsson + Handle PC-relative MOVI expansions with assembler relaxation. + Generate PC-relative relocs from 16-bit PC-relative expressions. + * config/tc-sh64.c (SHMEDIA_MD_PCREL_FROM_FIX): Break out from... + (shmedia_md_pcrel_from_section): ...here. + (shmedia_md_apply_fix): Handle fixups for 16-bit operands that has + turned completely resolved. Adjust relocation type for 16-bit + immediate operands that has turned PC-relative. Adjust back for + MD_PCREL_FROM_SECTION being applied twice. + (shmedia_md_convert_frag): Always emit reloc for expression with + global or weak symbol. Handle relaxation result for PC-relative + expressions. + (shmedia_md_estimate_size_before_relax): An expression with a weak + or global symbol can not be relaxed. Break out tests for + relaxable symbol into variable sym_relaxable. + : Break out any PC-relative expression and change + relaxation type. + (shmedia_build_Mytes): CSE &operands->operands[j] into variable + opjp. + : Fix typo for initial minor relaxation type of + MOVI expansion. If X_op_symbol of the immediate expression is + set, make an expression symbol for the argument to frag_var. + * config/tc-sh.c (MOVI_IMM_32_PCREL, MOVI_IMM_64_PCREL): New + relaxations. + (END): Adjust for new relaxations. + (md_relax_table): Add entries for new relaxations. + 2000-12-07 Ben Elliston + * config/tc-sh64.c (shmedia_parse_reg): Initialize variable len. + 2000-12-07 Hans-Peter Nilsson + * config/tc-sh64.c (shmedia_md_convert_frag): Correct all MOVI and + SHORI operand offsets in PT/PTA/PTB expansions. + 2000-12-05 Hans-Peter Nilsson + Implement DataLabel semantics. + * config/tc-sh.c (sh_frob_file) [HAVE_SH64]: Call + shmedia_frob_file_before_adjust. + * config/tc-sh64.c [! OBJ_ELF]: Emit #error. + (DATALABEL_SUFFIX): Define. + (shmedia_md_end) : Walk + symbol list to update "datalabel" symbols to their main symbol + counterparts. + (shmedia_frob_file_before_adjust): New. + (sh64_adjust_symtab): For remaining datalabel symbols, set to + undefined and set STT_DATALABEL. + (sh64_frob_label): Initialize TC symbol field. + (sh64_consume_datalabel): Actually implement semantics. New + parameter operandf, call it instead of expression. + (sh64_exclude_symbol): New. + * config/tc-sh64.h (md_parse_name): Pass on the function operand + to sh64_consume_datalabel. + (tc_symbol_new_hook): Define to tc_frob_symbol. + (TC_SYMFIELD_TYPE): Define to symbolS *. + (tc_frob_symbol): Define to call sh64_exclude_symbol. + 2000-12-01 Hans-Peter Nilsson + * config/tc-sh64.c (shmedia_init_reloc): Tweak comment for default + case. + (shmedia_md_assemble): Call dwarf2_generate_asm_lineno if + generating dwarf2 debug information. + 2000-11-30 Hans-Peter Nilsson + * config/tc-sh64.c (sh64_target_format): Use elf64-sh64l and + elf64-sh64 for the 64-bit ABI. + * config/tc-sh.c (md_show_usage): Tweak usage output for -abi=* + option. + 2000-11-29 Hans-Peter Nilsson + * config/tc-sh.c: Remove conditionalizing on HAVE_SH64 for + case-insensitivity. + 2000-11-27 Hans-Peter Nilsson + * config/tc-sh64.c: Tweak comments, formatting and error messages. + (enum sh64_abi_values): New type. + (enum sh64_isa_values): New type. + (sh64_isa_mode): Replace shmedia_mode. All referers changed. + (seen_shcompact_mode, seen_shmedia_mode): Delete. + (sh64_abi): Replace shmedia_64. + (shmedia_md_convert_frag) : Correct register number handling. + (s_sh64_mode): Check validity for this target. + (sh64_target_format): Initialize defaults for ISA and ABI. + Fallback to old object format if no SH64 ISA or ABI has been + specified. + * config/tc-sh.c (md_parse_option): Check combinations for errors. + (sh_elf_final_processing): Change to have EF_SH64_ABI64 for 64-bit + ABI and EF_SH64 for 32-bit ABI, if SH64 options are specified. + * config/tc-sh64.h: Fix typo in comment. + 2000-11-25 Hans-Peter Nilsson + * config/tc-sh64.c (shmedia_md_estimate_size_before_relax) + : Size will be longest, not + shortest. + (shmedia_md_convert_frag): Disable PTB-warning machinery. Correct + all MOVI and SHORI operand offsets in PT/PTA/PTB expansions. + * config/tc-sh.c (parse_reg) [HAVE_SH64]: Add local variables l0 + and l1 to hold lowercase of two first characters. Change all + remaining TO_LOWER to tolower. + * config/tc-sh64.c (TO_LOWER): Delete. + (shmedia_find_cooked_opcode): Use tolower, not TO_LOWER. + (md_parse_name): Define. + (sh64_consume_datalabel): Declare. + (DOLLAR_DOT): Define. + * config/tc-sh64.c (shmedia_parse_exp): New. + (sh64_consume_datalabel): New; just ignoring datalabel semantics. + (shmedia_parse_reg): Remove const from src + parameter. + (shmedia_get_operands): Ditto for args parameter and ptr variable. + (shmedia_md_assemble): Ditto for op_end variable. + (shmedia_get_operand): Ditto for ptr parameter and src variable. + Use shmedia_parse_exp, not parse_exp. + * config/tc-sh64.c (shmedia_parse_reg): Add shmedia_arg_type + parameter. All callers changed. + (shmedia_get_operand): Add shmedia_arg_type parameter. All + callers changed. + (shmedia_parse_reg): Put first two character in local variables. + Use tolower, not TO_LOWER. If no register is found and argtype + indicates a control register, scan shmedia_creg_table + case-insensitive. + 2000-11-24 Hans-Peter Nilsson + * Makefile.am (CPU_TYPES): Add sh64. + (TARGET_CPU_CFILES): Add config/tc-sh64.c. + (TARGET_CPU_HFILES): Add config/tc-sh64.h. + Regenerate dependencies. + * Makefile.in: Regenerate. + * configure.in: Add support for sh64-*-elf*. + * configure: Regenerate. + * config/tc-sh64.h: New. + * config/tc-sh64.c: New. + * config/tc-sh.c (md_pseudo_table) [HAVE_SH64]: New pseudos + .mode, .isa and .uaquad. + [HAVE_SH64] (SH64PCREL16_32, SH64PCREL16_64, SH64PCREL16PT_32, + SH64PCREL16PT_64, MOVI_IMM_32, MOVI_IMM_64): Define. + [HAVE_SH64] (END): Define as 10. + [HAVE_SH64] (UNDEF_SH64PCREL, SH64PCREL16, SH64PCREL32, + SH64PCREL48, SH64PCREL64, UNDEF_MOVI, MOVI_16, MOVI_32, MOVI_48, + MOVI_64): Define. + [HAVE_SH64] (SH64PCREL16_F, SH64PCREL16_M, SH64PCREL16_LENGTH, + SH64PCREL32_F, SH64PCREL32_M, SH64PCREL32_LENGTH, SH64PCREL48_F, + SH64PCREL48_M, SH64PCREL48_LENGTH, SH64PCREL64_LENGTH, + MOVI_16_LENGTH, MOVI_32_LENGTH, MOVI_48_LENGTH, MOVI_64_LENGTH): + Define. + (md_relax_table) [HAVE_SH64]: Provide relaxations for SHmedia. + (md_begin) [HAVE_SH64]: Call shmedia_md_begin. + (parse_reg) [HAVE_SH64]: Parse register names case-insensitive. + (md_assemble) [HAVE_SH64]: Call shmedia_md_assemble if assembling + SHmedia instructions. Handle state-change after switching to + SHcompact. + (md_longopts) [HAVE_SH64]: New options --isa=* and --abi=*. + (md_parse_option) [HAVE_SH64]: Parse new options. + (md_show_usage) [HAVE_SH64]: Show usage of new options. + (md_convert_frag) [HAVE_SH64] : Call + shmedia_md_convert_frag instead of abort. + (sh_force_relocation) [HAVE_SH64]: Also force relocation for + BFD_RELOC_SH_SHMEDIA_CODE. + (sh_elf_final_processing) [HAVE_SH64]: Set flags identifying + SHcompact or SHmedia code. + (md_apply_fix) [HAVE_SH64] : Return result from calling + shmedia_md_apply_fix instead of abort. + (md_estimate_size_before_relax) [HAVE_SH64] : Return + result from calling shmedia_md_estimate_size_before_relax instead + of calling abort. + (sh_do_align) [HAVE_SH64]: If shmedia_mode, let shmedia_do_align + do the work. + (tc_gen_reloc) [HAVE_SH64]: For unrecognized relocs, call + shmedia_init_reloc and do nothing more if it returns non-zero. + (sh_finalize) [HAVE_SH64]: Call shmedia_md_end. + * po/POTFILES.in: Regenerate. + * po/gas.pot: Regenerate. + +2002-02-06 Alexandre Oliva + + * config/tc-sh.c (parse_at): Install the correct version of + 2002-02-04's patch. + + * config/tc-sh.c (md_apply_fix3) : Don't + assume fixP->fx_subsy is non-NULL. + +2002-02-04 Alexandre Oliva + + * config/tc-sh.c (parse_at): Set arg type of @(expr,pc) to + A_DISP_PC_ABS, and adjust it by -4. + (get_specific): Accept A_DISP_PC_ABS where A_DISP_PC is + expected. + (build_Mytes): Mark PCRELIMM fix-ups as pc-relative only if + the operand type is not A_DISP_PC_ABS. + +2002-02-04 Hans-Peter Nilsson + + * config/tc-mmix.c (tc_gen_reloc): Don't try and take the value of + common and weak symbols. Handle common and weak symbols as + undefined symbols with regards to GREG handling and merging. + (mmix_frob_file): Ditto. + +2002-02-02 Jason Thorpe + + * configure.in (hppa-*-netbsd*): New target. + * configure: Regenerate. + * config/tc-hppa.h: Also define WARN_COMMENTS if TE_NetBSD. + +2002-02-02 Alan Modra + + * config/tc-v850.c: Add missing prototypes amd use old-style + function definitions. + (AREA_ZDA, AREA_SDA, AREA_TDA): Delete. + (sdata_section tdata_section, zdata_section, sbss_section, + tbss_section, zbss_section, rosdata_section, rozdata_section, + scommon_section, tcommon_section, zcommon_section, + call_table_data_section, call_table_text_section): Delete. + (v850_sdata, v850_tdata, v850_zdata, v850_sbss, v850_tbss, + v850_zbss, v850_bss, v850_rosdata, v850_rozdata, + v850_call_table_data, v850_call_table_text): Delete. + (struct v850_seg_entry): New. + (v850_seg_table): New. + (SDATA_SECTION TDATA_SECTION, ZDATA_SECTION, SBSS_SECTION, + TBSS_SECTION, ZBSS_SECTION, BSS_SECTION, ROSDATA_SECTION, + ROZDATA_SECTION, SCOMMON_SECTION, TCOMMON_SECTION, ZCOMMON_SECTION, + CALL_TABLE_DATA_SECTION, CALL_TABLE_TEXT_SECTION): Define. + (do_v850_seg): New. + (v850_seg): New. + (v850_comm): Use do_v850_seg and v850_seg_table. Simplify + recording of alignment. + (md_pseudo_table): Use v850_seg. + (md_begin): Don't init .call_table_data and .call_table_text here. + Set v850_seg_table bss entry. + +2002-02-01 Hans-Peter Nilsson + + Support on-demand global register allocation by passing on + base-plus-offset relocs to the linker. + * config/tc-mmix.c: Tweak and fix typos in comments. + (allocate_undefined_gregs_in_linker): New variable. + (OPTION_LINKER_ALLOCATED_GREGS): New option macro. + (md_longopts): Add --linker-allocated-gregs. + (md_parse_option) : Imply --linker-allocated-gregs. + : New. + (md_show_usage): Update text for -x. Add text for + --linker-allocated-gregs. + (tc_gen_reloc): Derive default value for addend from val and + baddsy. Use addsec and bfd_is_abs_section in more places. Don't + emit error for BFD_RELOC_MMIX_BASE_PLUS_OFFSET without suitable + GREG if allocate_undefined_gregs_in_linker. + * doc/as.texinfo (Overview) : Add + --linker-allocated-gregs. + * doc/c-mmix.texi (MMIX-Opts): Add blurb about + --linker-allocated-gregs. Mention that it's implied by -x. + (MMIX-Pseudos) : Mention when and how a GREG can be omitted. + (MMIX-mmixal): Clarify dated comparison and location of MMIXware. + + * config/tc-mmix.h (md_parse_name): Use ISUPPER, not isupper. + +2002-02-01 Alan Modra + + * Makefile.am: Run "make dep-am" + * Makefile.in: Regenerate. + +2002-01-31 Ivan Guzvinec + + * config/tc-or32.c: New file. + * config/tc-or32.h: New file. + * configure.in: Add support for or32 targets. + * configure: Regenerate. + * config/obj-coff.c: Add support for or32 targets. + * config/obj-coff.h: Add support for or32 targets. + * Makefile.am: Add support for or32 targets. + * Makefile.in: Regenerate. + * NEWS: Mention support for OpenRISC. + * doc/Makefile.in: Regenerate. + * po/POTFILES.in: Regenerate. + * po/gas.pot: Regenerate. + +2002-01-30 Richard Sandiford + + * config/tc-sh.c (parse_reg): Fix end-of-word check for is, ix, iy + and mod. + +2002-01-29 Chris Demetriou + + * config/tc-mips.c (tc_gen_reloc): Arrange for + BFD_RELOC_PCREL_HI16_S relocations to be output relative to + their LO16 parts, even for ELF. + +2002-01-29 Daniel Jacobowitz + + * config/tc-i386.c: Protect definitions of true and false + from redefinition. + +2002-01-28 Jakub Jelinek + + * config/obj-elf.c (elf_frob_file_before_adjust): Remove symbols + made because of .weak, if they are neither defined nor used in any + way. + +2002-01-27 Daniel Jacobowitz + + * configure: Regenerated. + +2002-01-26 Hans-Peter Nilsson + + * doc/Makefile.am (install): Depend on install-info. + * doc/Makefile.in: Regenerate. + +2002-01-26 Nick Clifton + + * po/fr.po: Updated version + +2002-01-24 Kazu Hirata + + * config/tc-h8300.c (check_operand): Don't print a warning + when a valid 24-bit address is given to a 16-bit address + operand. + +2002-01-24 Alexandre Oliva + + * config/tc-sh.c (sh_elf_suffix): Removed. + (sh_PIC_related_p, sh_check_fixup, sh_cons_fix_new, + sh_end_of_match, sh_parse_name): New functions. + (sh_elf_cons): Simplify. + (parse_exp): Reject misplaced PIC operands. + (md_undefined_symbol): Simplify. + (sh_fix_adjustable): Let @GOTOFF be adjusted. + (md_apply_fix3): Write @PLT and @GOTOFF addends in place. + (tc_gen_reloc): Move fixp subsy absolute value into addnumber. + Complain if subsy remains at the end. + * config/tc-sh.h (sh_parse_name, sh_cons_fix_new): Declare. + (md_parse_name, TC_CONS_FIX_NEW, O_PIC_reloc): Define. + +2002-01-22 Alexandre Oliva + + * config/tc-mn10300.c (xr_registers): Move `pc'... + (other_registers): ... here. + +2002-01-22 Alan Modra + + * Makefile.am: Run "make dep-am". + * Makefile.in: Regenerate. + * gas/po/POTFILES.in: Regenerate. + +2002-01-21 DJ Delorie + + * config/obj-coff.c (obj_coff_init_stab_section): Make the + stabstr_name allocation permanent, as it will be referenced from + the section hash. + +2002-01-21 Jason Thorpe + + * configure.in (ia64-*-netbsd*): New target. + * configure: Regenerate. + +2002-01-21 Hans-Peter Nilsson + + * doc/as.texinfo (Overview) : Add missing {} + to @dots call. + : Ditto. + * doc/c-arm.texi (ARM Options): Ditto. + +2002-01-18 Richard Earnshaw + + * tc-arm.c (do_xsc_mia, do_xsc_mar, do_xsc_mra): Renamed from + do_mia, do_mar and do_mra respectively. + (do_mav_*): Renamed from do_c_*. + (mav_reg_required_here, mav_parse_offset): Renamed from + cirrus_reg_required_here and cirrus_parse_offset respectively. + (MAV_MODE?): Renamed from CIRRUS_MODE?. + +2002-01-18 Richard Earnshaw + Keith Walker + + * tc-arm.c (ARM_EXT_V5J, ARM_ARCH_V5TEJ): Define. + (insns): Add pattern for bxj instruction. + (do_bxj): New function. + (arm_cpus): Add arm926ej. + (arm_archs): Add armv5tej. + +2002-01-18 Richard Earnshaw + + * doc/c-arm.texi: Add new fpe options to list of supported flags. + +2002-01-19 Keith Walker + + * tc-arm.c (arm_fpus): Add fpe2 and fpe3. + +2002-01-18 Richard Earnshaw + + * NEWS: Mention new ARM command-line options and VFP support. + + * config/tc-arm.c (ARM_CEXT_XSCALE): Replaces ARM_EXT_XSCALE. All + uses changed. + (ARM_CEXT_MAVERICK): Similarly. + (ARM_ANY): Now means any core instruction. + (CPU_DEFAULT): Default to ARM_ANY. + (uses_apcs_26, atcps, support_interwork, uses_apcs_float) + (pic_code): Declare for all object types. Make type int. + (legacy_cpu, legacy_fpu, mcpu_cpu_opt, mcpu_fpu_opt, march_cpu_opt) + (march_fpu_opt, mfpu_opt): Declare. + (md_longopts): Tidy up conditional definitions. + (arm_opts, arm_cpus, arm_archs, arm_fpus, arm_extensions) + (arm_long_opts): New tables. + (arm_parse_cpu, arm_parse_arch, arm_parse_fpu): New functions. + (arm_parse_extension): New function. + (md_parse_option): Rewrite using new table-driven system. + (md_show_usage): Use new table-driven system. + (md_begin): Calculate cpu_variant from command line option data. + * doc/as.texinfo (ARM ISA options): Docuement new ARM-specific + command-line options. + * doc/c-arm.texi: Likewise. + +2002-01-18 Andreas Jaeger + + * as.c (parse_args): Update year. + +2002-01-17 Timothy Wall + + * config/tc-tic54x.c (encode_address): Add a more informative + warning about incorrect syntax. + +2002-01-17 Nick Clifton + + * po/gas.pot: Regenerate. + +2002-01-17 Nick Clifton + + * macro.c (get_any_string): Add no-c-format comment to prevent + confusion when translating string. + * gasp.c (get_any_string): Add no-c-format comment to prevent + confusion when translating string. + +2002-01-16 Thiemo Seufer + Johannes Stezenbach + * config/tc-mips.c (percent_op): Ensure longer percent_op's are + matched before the shorter ones. + (my_getSmallParser): Fix handling of nested parentheses in + percent_op's. Code cleanup. + (my_getPercentOp): New function, code from my_getSmallParser. + (my_getSmallExpression): Fix handling of closing parentheses. + Code cleanup. Better comments. + +2002-01-16 Nick Clifton + + po/tr.po: New file: Turkish translation. + configure.in (LINGUAS): Add "tr". + configure: Regenerate. + +2002-01-15 Richard Earnshaw + + Support for VFP instructions + * tc-arm.c (CP_WB_OK, CP_NO_WB): New defines. + (cp_address_required_here): New argument wb_ok. When false, do not + accept write-back forms of addressing. Change all callers. + (FPU_VFP_EXT_NONE, FPU_VFP_EXT_V1xD, FPU_VFP_VFP_V1) + (FPU_VFP_EXT_V2): Define. + (FPU_ARCH_VFP, FPU_ARCH_VFP_V1xD, FPU_ARCH_VFP_V1, FPU_ARCH_VFP_V2): + Define in terms of above. + (vfp_dp_reg_pos, vfp_sp_reg_pos, vfp_ldstm_type): New enums. + (vfp_reg): New struct. + (vfp_regs): New array of registers. + (insns): Add VFP instructions. + (sn_table): New array of VFP single-precision register names. + (dn_table): New array of VFP double-precision register names. + (all_reg_maps): Add the new register tables. + (arm_reg_type): Add new values for above. Increase RET_TYPE_MAX. + (vfp_sp_reg_required_here, vfp_dp_reg_required_here, do_vfp_sp_monadic) + (do_vfp_dp_monadic, do_vfp_sp_dyadic, do_vfp_dp_dyadic) + (do_vfp_reg_from_sp, do_vfp_sp_reg2, do_vfp_sp_from_reg) + (do_vfp_reg_from_dp, do_vfp_reg2_from_dp, do_vfp_dp_from_reg) + (do_vfp_dp_from_reg2, vfp_psr_parse, vfp_psr_required_here) + (do_vfp_reg_from_ctrl, do_vfp_ctrl_from_reg, do_vfp_sp_ldst) + (do_vfp_dp_ldst, vfp_sp_reg_list, vfp_dp_reg_list, vfp_sp_ldstm) + (vfp_dp_ldstm, do_vfp_sp_ldstmia, do_vfp_sp_ldstmdb, do_vfp_ldstmia) + (do_vfp_dp_ldstmdb, do_vfp_xp_ldstmia, do_vfp_xp_ldstmdb) + (do_vfp_sp_compare_z, do_vfp_dp_compare_z, do_vfp_dp_sp_cvt) + (do_vfp_sp_dp_cvt): New functions. + (md_begin): Set soft-float flag for appropriate VFP work. + (md_atof): Handle VFP-format doubles. + (md_parse_option): Handle VFP command-line options. + (md_show_usage): Display VFP command-line options. + +2002-01-15 Richard Earnshaw + + * tc-arm.c (md_parse_option): Tidy up setting of cpu_variant for + various command line options. + +2002-01-15 Nick Clifton + + * config/tc-xstormy16.c: (xstormy16_fix_adjustable): Do not fix + vtinherit relocs. + (xstormy16_md_apply_fix3): Do not return a value. + +2002-01-14 Richard Earnshaw + + * tc-arm.c (md_longopts): On targets that aren't bi-endian, support + the -EL/-EB option that matches the target's endianness. + (md_parse_option): Likewise. + +2002-01-14 Richard Earnshaw + + * tc-arm.c (md_longopts): Fix misplaced #endif -- the -oabi option + is not dependent on ARM_BI_ENDIAN. + +2002-01-14 Richard Earnshaw + + * tc-arm.c (all error messages): Normalize capitalization of messages. + + * tc-arm.h (md_operand): Delete define. + * tc-arm.c (in_my_get_expression): New static variable. + (my_get_expression): Set and clear it. + (md_operand): New function. If called from my_get_expression + put the error in inst.error. + (output_inst): Now takes argument of instruction being assembled. + Print it out with any error message. + (do_ldst, do_ldstv4, thumb_load_store): Fault attempt to use a store + with '=' syntax. + (end_of_line): Don't update inst.error if it is already set. + +2002-01-11 Richard Earnshaw + + * tc-arm.c (do_ldst): Fix handling an immediate expression pseudo + op that can be translated into a mvn instruction. + +2002-01-11 Steve Ellcey + + * gas/config/tc-ia64.h (MD_FLAGS_DEFAULT): New Macro for + setting default md.flags. + (SHT_INIT_ARRAY): New elf special section used by HP-UX. + (SHT_FINI_ARRAY): New elf special section used by HP-UX. + * gas/config/tc-ia64.c (setup_unwind_header): Add support + for 32 bit unwind info blocks. + (generate_unwind_image): Add support for different types + of unwind images (32 bits and/or big-endian). + (ia64_init): Use MD_FLAGS_DEFAULT to set md.flags. + (ia64_target_format): Add support for hpux target formats. + (ia64_gen_real_reloc_type): Add support for FUNC_IPLT_RELOC. + (ia64_elf_section_type): Add support for SHT_INIT_ARRAY and + SHT_FINI_ARRAY elf section types. + +2002-01-10 Richard Earnshaw + + * tc-arm.c (struct reg_entry): Move before prototypes. + (int_register, cp_register, fp_register): Delete. + (reg_table): Delete. Replaced with ... + (rn_table, cp_table, cn_table, fn_table, mav_mvf_table) + (mav_mvd_table, mav_mvfx_table, mav_mvdx_table, mav_mvax_table) + (mav_dspsc_table): ... one table per register set. + (arm_reg_hsh): Delete. + (struct reg_map): New structure. + (all_reg_maps): New array. + (enum arm_reg_type): New enums. + (build_reg_hsh): New function. + (insert_reg_alias): Use hash table passed by caller. Adjust all + callers. + (create_register_alias): New function, split out from ... + (md_assemble): ... here. + (md_begin): Build new register hash tables. + (arm_reg_parse): New argument for the hash table to search. Adjust all + callers. + (arm_reg_parse_any): New function. + (co_proc_number): Look up the processor number in the processor hash + table. + (cirrus_regtype): Delete. + (cirrus_register, cirrus_mvf_register, cirrus_mvd_register) + (cirrus_mvfx_register, cirrus_mvdx_register, cirrus_mvax_register) + (ARM_EXT_MAVERICKsc_register): Delete. + (do_c_binops_1, do_c_binops_2, do_c_binops_3): Delete. + (do_c_binops_1[a-o], do_c_binops_2[a-c], do_c_binops_3[a-d]): New + functions. + (do_c_triple_4, do_c_triple_5): Delete. + (do_c_triple_4[ab], do_c_triple_5[a-h]): New functions. + (do_c_quad_6): Delete. + (do_c_quad_6[ab]): New functions. + (do_c_binops, do_c_triple, do_c_quad, do_c_shift, do_c_ldst): Rework + arguments to use new register parsing methods. + (cirrus_reg_required_here): Likewise. + (insns): Reclassify cirrus maverick worker functions. + (cirrus_valid_reg): Delete. + +2002-01-07 Jason Thorpe + + * configure.in (sh*le): Set cpu_type=sh and endian=little. + (sh*-*-netbsdelf*): New target. + * configure: Regenerate. + * tc-sh.h: Update copyright years. + (TARGET_FORMAT): Add version for TE_NetBSD. + +2002-01-07 Nick Clifton + + * read.c (emit_expr): Do not allow 'size' or 'nbytes' to go + negative. + +2002-01-06 Alan Modra + + * config/tc-m68k.h (md_prepare_relax_scan): Rewrite. + * config/tc-m68k.c (md_relax_table): Add md_prepare_relax_scan comment. + +2002-01-05 Daniel Jacobowitz + + * tc-mips.c (mips_cprestore_valid): New flag. + (mips_frame_reg_valid): New flag. + (macro) [M_JAL_2]: Check both flags. + [M_JAL_A]: Likewise. + (s_cprestore): Set mips_cprestore_valid. + (tc_get_register): If setting mips_frame_reg, set + mips_frame_reg_valid and clear mips_cprestore_valid. + (s_mips_ent): Clear both flags. + (s_mips_end): Clear both flags. + +2002-01-05 Alan Modra + + * write.c (write_object_file): Make use of bfd_section_list_remove. + * config/obj-ecoff.c (ecoff_frob_file): Likewise. + * config/tc-mmix.c (mmix_frob_file): Likewise. + +2002-01-04 Jason Thorpe + + * configure.in (i386-*-netbsdelf*): Collapse target into... + (i386-*-netbsd*): ...this. Add support for x86-64. + * configure: Regenerated. + +2002-01-03 matthew green + + * config/tc-ppc.c (md_parse_option): BookE is not Motorola specific. + +2002-01-02 Nick Clifton + + * config/tc-m68k.c (md_estimate_size_before_relax): Test for a + NULL frag link. + +For older changes see ChangeLog-0001 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/contrib/binutils/gas/ChangeLog-9295 b/contrib/binutils/gas/ChangeLog-9295 index a761ea1..7135733 100644 --- a/contrib/binutils/gas/ChangeLog-9295 +++ b/contrib/binutils/gas/ChangeLog-9295 @@ -9003,7 +9003,7 @@ Thu Oct 14 16:51:00 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) * app.c (do_scrub_next_char): Always accept 'x' and 'X' as escape characters in state 6. * read.c (next_char_of_string): Accept \Xh* and \xh* where h* are - hexidecimal digits. + hexadecimal digits. * config/tc-i386.c (md_apply_fix_1): Make cross segment calls work for ELF by hacking around bizarre bfd_perform_relocation behaviour @@ -10401,7 +10401,7 @@ Thu Jul 8 14:15:05 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) Thu Jul 8 07:25:25 1993 Doug Evans (dje@canuck.cygnus.com) - * config/tc-h8300.h (TC_CONS_RELOC): Use R_RELLONG if h8/300h. + * config/tc-h8300.h (TC_CONS_RELOC): Use R_RELLONG if H8/300H. Wed Jul 7 18:11:07 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com) @@ -13007,7 +13007,7 @@ Sat Feb 22 12:26:28 1992 Steve Chamberlain (sac at rtl.cygnus.com) * app.c: MRI compatibility - allow single quote to start a string. * as.c: fix typo recently introduced. * as.h : Don't include aout/reloc.h - it's not right for COFF! - * expr.c: Much rewriting, to accomodate MRI syntax for + * expr.c: Much rewriting, to accommodate MRI syntax for expressions. Also easier to read now. * listing.c: Put back defuns * read.c: modified to accept MRI syntax, put back listing pseudo diff --git a/contrib/binutils/gas/Makefile.am b/contrib/binutils/gas/Makefile.am index e8d060f..7728434 100644 --- a/contrib/binutils/gas/Makefile.am +++ b/contrib/binutils/gas/Makefile.am @@ -3,9 +3,12 @@ ## Work around apparent automake bug. INTLLIBS = @INTLLIBS@ -AUTOMAKE_OPTIONS = cygnus dejagnu +AUTOMAKE_OPTIONS = 1.8 cygnus dejagnu SUBDIRS = doc po +# Automake should figure this out on its own. It doesn't, because +# of the "cygnus" option. But distclean still wants it. +DIST_SUBDIRS = $(SUBDIRS) tooldir = $(exec_prefix)/$(target_alias) @@ -56,6 +59,7 @@ CPU_TYPES = \ i386 \ i860 \ i960 \ + ip2k \ m32r \ m68hc11 \ m68k \ @@ -65,6 +69,7 @@ CPU_TYPES = \ mmix \ mn10200 \ mn10300 \ + msp430 \ ns32k \ openrisc \ or32 \ @@ -77,12 +82,14 @@ CPU_TYPES = \ sparc \ tahoe \ tic30 \ + tic4x \ tic54x \ tic80 \ vax \ w65 \ v850 \ xstormy16 \ + xtensa \ z8k # Object format types. This is only used for dependency information. @@ -109,7 +116,7 @@ CPU_OBJ_VALID = \ case $$o in \ aout) \ case $$c in \ - a29k | arm | cris | i386 | m68k | mips | ns32k | pdp11 | sparc | tahoe | tic30 | vax) \ + a29k | arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tahoe | tic30 | vax) \ valid=yes ;; \ esac ;; \ bout) \ @@ -118,7 +125,7 @@ CPU_OBJ_VALID = \ esac ;; \ coff) valid=yes; \ case $$c in \ - cris | i860 | mmix) \ + cris | i860 | mmix | sh64) \ valid= ;; \ esac ;; \ ecoff) \ @@ -172,6 +179,7 @@ GAS_CFILES = \ cond.c \ depend.c \ dwarf2dbg.c \ + dw2gencfi.c \ ecoff.c \ ehopt.c \ expr.c \ @@ -194,7 +202,7 @@ GAS_CFILES = \ symbols.c \ write.c -CFILES = $(GAS_CFILES) gasp.c itbl-ops.c +CFILES = $(GAS_CFILES) itbl-ops.c HFILES = \ as.h \ @@ -203,6 +211,7 @@ HFILES = \ bit_fix.h \ cgen.h \ dwarf2dbg.h \ + dw2gencfi.h \ ecoff.h \ emul-target.h \ emul.h \ @@ -246,6 +255,7 @@ TARGET_CPU_CFILES = \ config/tc-i386.c \ config/tc-i860.c \ config/tc-i960.c \ + config/tc-ip2k.c \ config/tc-m32r.c \ config/tc-m68hc11.c \ config/tc-m68k.c \ @@ -255,6 +265,7 @@ TARGET_CPU_CFILES = \ config/tc-mmix.c \ config/tc-mn10200.c \ config/tc-mn10300.c \ + config/tc-msp430.c \ config/tc-ns32k.c \ config/tc-openrisc.c \ config/tc-or32.c \ @@ -273,6 +284,7 @@ TARGET_CPU_CFILES = \ config/tc-w65.c \ config/tc-v850.c \ config/tc-xstormy16.c \ + config/tc-xtensa.c \ config/tc-z8k.c TARGET_CPU_HFILES = \ @@ -295,6 +307,7 @@ TARGET_CPU_HFILES = \ config/tc-i386.h \ config/tc-i860.h \ config/tc-i960.h \ + config/tc-ip2k.h \ config/tc-m32r.h \ config/tc-m68hc11.h \ config/tc-m68k.h \ @@ -304,6 +317,7 @@ TARGET_CPU_HFILES = \ config/tc-mmix.h \ config/tc-mn10200.h \ config/tc-mn10300.h \ + config/tc-msp430.h \ config/tc-ns32k.h \ config/tc-openrisc.h \ config/tc-or32.h \ @@ -322,6 +336,7 @@ TARGET_CPU_HFILES = \ config/tc-w65.h \ config/tc-v850.h \ config/tc-xstormy16.h \ + config/tc-xtensa.h \ config/tc-z8k.h # OBJ files in config @@ -412,6 +427,7 @@ GENERIC_OBJS = \ cond.o \ depend.o \ dwarf2dbg.o \ + dw2gencfi.o \ ehopt.o \ expr.o \ flonum-konst.o \ @@ -440,11 +456,11 @@ POTFILES = $(MULTI_CFILES) $(TARGET_ENV_HFILES) $(OBJ_FORMAT_HFILES) \ $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_CFILES) \ $(HFILES) $(CFILES) $(GAS_CFILES) po/POTFILES.in: @MAINT@ Makefile - for file in $(POTFILES); do echo $$file; done | sort > tmp \ + for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \ && mv tmp $(srcdir)/po/POTFILES.in -# Note: GASP is now deprecated and will be removed at some point in the future. -# Anything that GASP could do can now be done by GAS. +# Note: GASP is now deprecated and has been removed. It is still +# available in the CVS archive or older binutils releases if it is needed. noinst_PROGRAMS = as-new noinst_SCRIPTS = $(GDBINIT) EXTRA_SCRIPTS = .gdbinit @@ -490,6 +506,8 @@ GASLIBS = @OPCODES_LIB@ @BFDLIB@ ../libiberty/libiberty.a # Files to be copied away after each stage in building. STAGESTUFF = *.o $(noinst_PROGRAMS) +BFDVER_H = @BFDVER_H@ + $(OBJS): @ALL_OBJ_DEPS@ as_new_SOURCES = $(GAS_CFILES) @@ -506,10 +524,6 @@ $(OBJS): $(INCDIR)/bin-bugs.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.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) -gasp_new_DEPENDENCIES = ../libiberty/libiberty.a $(INTLDEPS) - EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \ echo $${rootme}/../expect/expect ; \ else echo expect ; fi` @@ -596,6 +610,9 @@ e-crisaout.o: $(srcdir)/config/e-crisaout.c e-criself.o: $(srcdir)/config/e-criself.c $(COMPILE) -c $(srcdir)/config/e-criself.c +xtensa-relax.o: $(srcdir)/config/xtensa-relax.c + $(COMPILE) -c $(srcdir)/config/xtensa-relax.c + # The m68k operand parser. EXTRA_as_new_SOURCES = config/m68k-parse.y @@ -642,7 +659,7 @@ itbl-parse.c itbl-parse.h: $(srcdir)/itbl-parse.y # stand-alone itbl assembler & disassembler -EXTRA_PROGRAMS = gasp-new itbl-test +EXTRA_PROGRAMS = itbl-test itbl_test_SOURCES = itbl-parse.y itbl-lex.l itbl_test_LDADD = itbl-tops.o itbl-test.o $(GASLIBS) @LEXLIB@ @@ -774,7 +791,7 @@ de-stage3: DEP_FILE_DEPS = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \ $(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES) -Makefile: $(BFDDIR)/configure.in +CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in # Automatic dependency computation. This is a real pain, because the # dependencies change based on target_cpu_type and obj_format. @@ -983,7 +1000,8 @@ DEPTC_alpha_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.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 $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c + dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h \ + $(srcdir)/config/atof-vax.c DEPTC_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \ $(srcdir)/config/tc-alpha.h subsegs.h $(INCDIR)/obstack.h \ struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h $(INCDIR)/safe-ctype.h \ @@ -1072,26 +1090,25 @@ DEPTC_fr30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(srcdir)/../opcodes/fr30-opc.h cgen.h DEPTC_frv_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-frv.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h dwarf2dbg.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/frv-opc.h \ - cgen.h $(BFDDIR)/libbfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/frv.h \ - $(INCDIR)/elf/reloc-macros.h + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/frv-desc.h $(INCDIR)/opcode/cgen.h \ + $(srcdir)/../opcodes/frv-opc.h cgen.h $(BFDDIR)/libbfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h DEPTC_frv_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \ $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/frv-opc.h \ cgen.h $(BFDDIR)/libbfd.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h DEPTC_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \ - $(INCDIR)/safe-ctype.h + $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ + $(INCDIR)/opcode/h8300.h $(INCDIR)/safe-ctype.h DEPTC_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/h8300.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h DEPTC_h8500_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \ @@ -1132,21 +1149,23 @@ DEPTC_i370_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/opcode/i370.h $(INCDIR)/elf/i370.h + struc-symbol.h $(INCDIR)/opcode/i370.h $(INCDIR)/elf/i370.h \ + $(INCDIR)/elf/reloc-macros.h DEPTC_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dwarf2dbg.h $(INCDIR)/opcode/i386.h + dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/i386.h DEPTC_i386_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/i386.h + $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/opcode/i386.h DEPTC_i386_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dwarf2dbg.h $(INCDIR)/opcode/i386.h + dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/i386.h DEPTC_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ @@ -1163,6 +1182,19 @@ DEPTC_i960_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h +DEPTC_ip2k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-ip2k.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/ip2k-desc.h $(INCDIR)/opcode/cgen.h \ + $(srcdir)/../opcodes/ip2k-opc.h cgen.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h +DEPTC_ip2k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/ip2k-desc.h \ + $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/ip2k-opc.h \ + cgen.h $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/reloc-macros.h \ + $(BFDDIR)/libbfd.h DEPTC_m32r_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ @@ -1179,32 +1211,37 @@ DEPTC_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h + $(INCDIR)/obstack.h $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h \ + $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h DEPTC_m68hc11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h + $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h $(INCDIR)/elf/m68hc11.h \ + $(INCDIR)/elf/reloc-macros.h DEPTC_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ - dwarf2dbg.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h + dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ + $(srcdir)/config/m68k-parse.h DEPTC_m68k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ - subsegs.h dwarf2dbg.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h + subsegs.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h DEPTC_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ - dwarf2dbg.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h \ - $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h + dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ + $(srcdir)/config/m68k-parse.h $(INCDIR)/elf/m68k.h \ + $(INCDIR)/elf/reloc-macros.h DEPTC_m68k_hp300 = $(INCDIR)/symcat.h $(srcdir)/config/obj-hp300.h \ $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h subsegs.h dwarf2dbg.h $(INCDIR)/opcode/m68k.h \ - $(srcdir)/config/m68k-parse.h + $(INCDIR)/obstack.h subsegs.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h DEPTC_m88k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-m88k.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/m88k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ @@ -1279,6 +1316,15 @@ DEPTC_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/mn10300.h dwarf2dbg.h +DEPTC_msp430_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-msp430.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/msp430.h $(INCDIR)/safe-ctype.h +DEPTC_msp430_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h \ + $(INCDIR)/safe-ctype.h DEPTC_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h @@ -1334,56 +1380,59 @@ DEPTC_ppc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-ppc.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/ppc.h + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h DEPTC_ppc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/ppc.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ - dwarf2dbg.h + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h \ + $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h DEPTC_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-s390.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/s390.h \ + subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/s390.h \ $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h DEPTC_s390_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/opcode/s390.h $(INCDIR)/elf/s390.h \ - $(INCDIR)/elf/reloc-macros.h + struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/opcode/s390.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h DEPTC_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ - $(INCDIR)/safe-ctype.h struc-symbol.h dwarf2dbg.h + $(INCDIR)/safe-ctype.h struc-symbol.h dwarf2dbg.h dw2gencfi.h DEPTC_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h \ subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ $(INCDIR)/safe-ctype.h struc-symbol.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h dw2gencfi.h DEPTC_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \ + $(BFDDIR)/elf32-sh64.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \ $(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/sh-opc.h struc-symbol.h dwarf2dbg.h + $(srcdir)/../opcodes/sh-opc.h struc-symbol.h dwarf2dbg.h dw2gencfi.h DEPTC_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/sparc.h + $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h DEPTC_sparc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h + $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h DEPTC_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/sparc.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ dwarf2dbg.h DEPTC_tahoe_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-tahoe.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ @@ -1407,6 +1456,16 @@ DEPTC_tic30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h +DEPTC_tic4x_coff = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ + $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic4x.h \ + subsegs.h $(INCDIR)/obstack.h +DEPTC_tic4x_elf = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ + $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(srcdir)/config/tc-tic4x.h $(INCDIR)/opcode/tic4x.h \ + subsegs.h $(INCDIR)/obstack.h DEPTC_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ @@ -1477,6 +1536,13 @@ DEPTC_xstormy16_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/xstormy16-desc.h \ $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/xstormy16-opc.h \ cgen.h +DEPTC_xtensa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ + $(INCDIR)/xtensa-config.h sb.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/config/xtensa-relax.h \ + $(INCDIR)/xtensa-isa.h $(srcdir)/config/xtensa-istack.h \ + dwarf2dbg.h struc-symbol.h DEPTC_z8k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ @@ -1504,7 +1570,7 @@ DEPOBJ_a29k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-a29k.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_alpha_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1517,20 +1583,20 @@ DEPOBJ_alpha_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ + struc-symbol.h dwarf2dbg.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)/symcat.h $(srcdir)/config/obj-evax.h \ $(srcdir)/config/tc-alpha.h DEPOBJ_arc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \ - $(INCDIR)/obstack.h subsegs.h + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h DEPOBJ_arc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h \ - struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/aout/aout64.h + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_arm_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -1542,7 +1608,7 @@ DEPOBJ_arm_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_avr_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1551,7 +1617,7 @@ DEPOBJ_avr_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -1559,7 +1625,7 @@ DEPOBJ_cris_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_d10v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1568,7 +1634,7 @@ DEPOBJ_d10v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_d30v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1577,7 +1643,7 @@ DEPOBJ_d30v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_dlx_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-dlx.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1586,7 +1652,7 @@ DEPOBJ_dlx_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_fr30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1595,7 +1661,7 @@ DEPOBJ_fr30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_frv_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-frv.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1604,7 +1670,7 @@ DEPOBJ_frv_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ @@ -1613,7 +1679,7 @@ DEPOBJ_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_h8500_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/h8500.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ @@ -1622,7 +1688,7 @@ DEPOBJ_h8500_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8500.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1632,7 +1698,8 @@ DEPOBJ_hppa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h \ $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/aout/aout64.h + subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ + $(INCDIR)/aout/aout64.h DEPOBJ_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ @@ -1643,7 +1710,7 @@ DEPOBJ_ia64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \ $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1652,7 +1719,8 @@ DEPOBJ_i370_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/i370.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/i370.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/aout/aout64.h DEPOBJ_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -1664,12 +1732,12 @@ DEPOBJ_i386_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_i960_bout = $(INCDIR)/symcat.h $(srcdir)/config/obj-bout.h \ $(srcdir)/config/tc-i960.h $(INCDIR)/obstack.h DEPOBJ_i960_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ @@ -1680,7 +1748,16 @@ DEPOBJ_i960_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_ip2k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-ip2k.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h +DEPOBJ_ip2k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_m32r_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1689,7 +1766,7 @@ DEPOBJ_m32r_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ @@ -1698,7 +1775,7 @@ DEPOBJ_m68hc11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -1710,7 +1787,7 @@ DEPOBJ_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_m68k_hp300 = $(srcdir)/config/obj-aout.c $(INCDIR)/symcat.h \ $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/aout/aout64.h \ @@ -1723,7 +1800,7 @@ DEPOBJ_m88k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m88k.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/mcore.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ @@ -1732,7 +1809,7 @@ DEPOBJ_mcore_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_mips_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-mips.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -1748,13 +1825,14 @@ DEPOBJ_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.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_mmix_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1763,7 +1841,7 @@ DEPOBJ_mn10200_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_mn10300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1772,7 +1850,16 @@ DEPOBJ_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_msp430_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-msp430.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h +DEPOBJ_msp430_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -1784,7 +1871,7 @@ DEPOBJ_ns32k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_openrisc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-openrisc.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1793,7 +1880,7 @@ DEPOBJ_openrisc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_or32_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-or32.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/or32.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ @@ -1802,7 +1889,7 @@ DEPOBJ_or32_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_pdp11_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-pdp11.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -1814,7 +1901,7 @@ DEPOBJ_pdp11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_pj_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1823,7 +1910,7 @@ DEPOBJ_pj_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_ppc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-ppc.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ @@ -1832,7 +1919,7 @@ DEPOBJ_ppc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/aout/aout64.h DEPOBJ_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-s390.h $(INCDIR)/coff/internal.h \ @@ -1842,7 +1929,7 @@ DEPOBJ_s390_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ @@ -1851,18 +1938,13 @@ DEPOBJ_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h -DEPOBJ_sh64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \ - $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + $(BFDDIR)/elf32-sh64.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -1874,7 +1956,7 @@ DEPOBJ_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_tahoe_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-tahoe.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -1886,7 +1968,7 @@ DEPOBJ_tahoe_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tahoe.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -1898,7 +1980,16 @@ DEPOBJ_tic30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_tic4x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic4x.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h +DEPOBJ_tic4x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic4x.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ @@ -1907,7 +1998,7 @@ DEPOBJ_tic54x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_tic80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-tic80.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/tic80.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ @@ -1916,7 +2007,7 @@ DEPOBJ_tic80_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic80.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h @@ -1928,7 +2019,7 @@ DEPOBJ_vax_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_vax_vms = $(INCDIR)/symcat.h $(srcdir)/config/obj-vms.h \ $(srcdir)/config/tc-vax.h $(INCDIR)/aout/stab_gnu.h \ $(INCDIR)/aout/stab.def $(INCDIR)/safe-ctype.h subsegs.h \ @@ -1941,7 +2032,7 @@ DEPOBJ_w65_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ @@ -1950,7 +2041,8 @@ DEPOBJ_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \ $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/aout/aout64.h + subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ + $(INCDIR)/aout/aout64.h DEPOBJ_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ @@ -1959,7 +2051,12 @@ DEPOBJ_xstormy16_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h +DEPOBJ_xtensa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ + $(INCDIR)/xtensa-config.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_z8k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ @@ -1968,7 +2065,7 @@ DEPOBJ_z8k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.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 @@ -2101,6 +2198,12 @@ DEP_i960_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i960.h \ DEP_i960_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h +DEP_ip2k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ip2k.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_ip2k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h DEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h @@ -2160,6 +2263,12 @@ DEP_mn10300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10300.h \ DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h +DEP_msp430_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-msp430.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h +DEP_msp430_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h DEP_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_ns32k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ns32k.h \ @@ -2212,14 +2321,11 @@ DEP_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ DEP_sh_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h -DEP_sh64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h + $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + $(BFDDIR)/elf32-sh64.h DEP_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h DEP_sparc_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sparc.h \ @@ -2244,6 +2350,12 @@ DEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.h \ DEP_tic30_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h +DEP_tic4x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h \ + $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h +DEP_tic4x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic4x.h DEP_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h \ $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h @@ -2285,6 +2397,10 @@ DEP_xstormy16_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-xstormy16.h DEP_xstormy16_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h +DEP_xtensa_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ + $(INCDIR)/xtensa-config.h DEP_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h \ $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h @@ -2301,13 +2417,17 @@ 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 $(INCDIR)/symcat.h as.o: as.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - output-file.h sb.h macro.h dwarf2dbg.h + output-file.h sb.h macro.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(BFDVER_H) atof-generic.o: atof-generic.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h bignum-copy.o: bignum-copy.c $(INCDIR)/symcat.h cond.o: cond.c $(INCDIR)/symcat.h macro.h sb.h $(INCDIR)/obstack.h depend.o: depend.c $(INCDIR)/symcat.h dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/symcat.h dwarf2dbg.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h + $(INCDIR)/filenames.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/elf/dwarf2.h +dw2gencfi.o: dw2gencfi.c $(INCDIR)/symcat.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h ecoff.o: ecoff.c $(INCDIR)/symcat.h ecoff.h ehopt.o: ehopt.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/elf/dwarf2.h @@ -2330,7 +2450,8 @@ macro.o: macro.c $(INCDIR)/safe-ctype.h sb.h macro.h messages.o: messages.c $(INCDIR)/symcat.h output-file.o: output-file.c $(INCDIR)/symcat.h output-file.h read.o: read.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h sb.h macro.h ecoff.h + subsegs.h $(INCDIR)/obstack.h sb.h macro.h ecoff.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h sb.o: sb.c sb.h stabs.o: stabs.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \ subsegs.h ecoff.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def @@ -2339,8 +2460,6 @@ symbols.o: symbols.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/obstack.h subsegs.h struc-symbol.h write.o: write.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ output-file.h dwarf2dbg.h -gasp.o: gasp.c $(INCDIR)/getopt.h $(INCDIR)/safe-ctype.h \ - sb.h macro.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h itbl-ops.o: itbl-ops.c itbl-ops.h $(INCDIR)/symcat.h e-crisaout.o: $(srcdir)/config/e-crisaout.c $(INCDIR)/symcat.h \ emul-target.h diff --git a/contrib/binutils/gas/Makefile.in b/contrib/binutils/gas/Makefile.in index c411820..67ed432 100644 --- a/contrib/binutils/gas/Makefile.in +++ b/contrib/binutils/gas/Makefile.in @@ -1,6 +1,8 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am +# Makefile.in generated by automake 1.8.4 from Makefile.am. +# @configure_input@ -# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -10,124 +12,244 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +@SET_MAKE@ -SHELL = @SHELL@ + +SOURCES = $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) $(itbl_test_SOURCES) srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ - top_builddir = . - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_alias = @build_alias@ build_triplet = @build@ -host_alias = @host_alias@ host_triplet = @host@ -target_alias = @target_alias@ target_triplet = @target@ +noinst_PROGRAMS = as-new$(EXEEXT) +EXTRA_PROGRAMS = itbl-test$(EXEEXT) +DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \ + README ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.in $(srcdir)/../mkinstalldirs \ + $(srcdir)/gdbinit.in $(srcdir)/gdbinit.in \ + $(top_srcdir)/po/Make-in m68k-parse.c itbl-parse.c itbl-lex.c \ + $(srcdir)/../ylwrap $(srcdir)/../ltmain.sh \ + $(srcdir)/../config.guess $(srcdir)/../config.sub +subdir = . +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../gettext.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno configure.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = gdb.ini .gdbinit po/Makefile.in +PROGRAMS = $(noinst_PROGRAMS) +am__objects_1 = app.$(OBJEXT) as.$(OBJEXT) atof-generic.$(OBJEXT) \ + bignum-copy.$(OBJEXT) cond.$(OBJEXT) depend.$(OBJEXT) \ + dwarf2dbg.$(OBJEXT) dw2gencfi.$(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) +am_as_new_OBJECTS = $(am__objects_1) +as_new_OBJECTS = $(am_as_new_OBJECTS) +am__DEPENDENCIES_1 = tc-@target_cpu_type@.o +am__DEPENDENCIES_2 = obj-@obj_format@.o +am__DEPENDENCIES_3 = atof-@atof@.o +am__DEPENDENCIES_4 = +am__DEPENDENCIES_5 = ../libiberty/libiberty.a +am_itbl_test_OBJECTS = itbl-parse.$(OBJEXT) itbl-lex.$(OBJEXT) +itbl_test_OBJECTS = $(am_itbl_test_OBJECTS) +itbl_test_DEPENDENCIES = itbl-tops.o itbl-test.o $(am__DEPENDENCIES_5) +SCRIPTS = $(noinst_SCRIPTS) +DEFAULT_INCLUDES = -I. -I$(srcdir) -I. +depcomp = +am__depfiles_maybe = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS) +LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS) +YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS) +LTYACCCOMPILE = $(LIBTOOL) --mode=compile $(YACC) $(YFLAGS) \ + $(AM_YFLAGS) +YLWRAP = $(top_srcdir)/../ylwrap +SOURCES = $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) \ + $(itbl_test_SOURCES) +DIST_SOURCES = $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) \ + $(itbl_test_SOURCES) +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-exec-recursive install-info-recursive \ + install-recursive installcheck-recursive installdirs-recursive \ + pdf-recursive ps-recursive uninstall-info-recursive \ + uninstall-recursive +ETAGS = etags +CTAGS = ctags +DEJATOOL = $(PACKAGE) +RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ ALL_OBJ_DEPS = @ALL_OBJ_DEPS@ -AS = @AS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ BFDLIB = @BFDLIB@ +BFDVER_H = @BFDVER_H@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ -DLLTOOL = @DLLTOOL@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ EXEEXT = @EXEEXT@ -GCJ = @GCJ@ -GCJFLAGS = @GCJFLAGS@ GDBINIT = @GDBINIT@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GT_NO = @GT_NO@ GT_YES = @GT_YES@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ +INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ +LDFLAGS = @LDFLAGS@ +LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo @LEX@ ; fi` +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ -OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPCODES_LIB = @OPCODES_LIB@ PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ STRIP = @STRIP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ +XGETTEXT = @XGETTEXT@ +YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo @YACC@ ; fi` +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ atof = @atof@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ cgen_cpu_prefix = @cgen_cpu_prefix@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ extra_objects = @extra_objects@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ install_tooldir = @install_tooldir@ l = @l@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ obj_format = @obj_format@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ target_cpu_type = @target_cpu_type@ +target_os = @target_os@ +target_vendor = @target_vendor@ te_file = @te_file@ - -INTLLIBS = @INTLLIBS@ - -AUTOMAKE_OPTIONS = cygnus dejagnu - +AUTOMAKE_OPTIONS = 1.8 cygnus dejagnu SUBDIRS = doc po - +# Automake should figure this out on its own. It doesn't, because +# of the "cygnus" option. But distclean still wants it. +DIST_SUBDIRS = $(SUBDIRS) 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@ TARG_CPU_C = $(srcdir)/config/tc-@target_cpu_type@.c TARG_CPU_O = tc-@target_cpu_type@.o @@ -146,7 +268,6 @@ IT_DEPS = $(srcdir)/itbl-parse.y $(srcdir)/itbl-lex.l $(srcdir)/config/itbl-@tar IT_OBJS = itbl-parse.o itbl-lex.o itbl-ops.o # CPU types. This is only used for dependency information. - CPU_TYPES = \ a29k \ alpha \ @@ -167,6 +288,7 @@ CPU_TYPES = \ i386 \ i860 \ i960 \ + ip2k \ m32r \ m68hc11 \ m68k \ @@ -176,6 +298,7 @@ CPU_TYPES = \ mmix \ mn10200 \ mn10300 \ + msp430 \ ns32k \ openrisc \ or32 \ @@ -188,18 +311,19 @@ CPU_TYPES = \ sparc \ tahoe \ tic30 \ + tic4x \ tic54x \ tic80 \ vax \ w65 \ v850 \ xstormy16 \ + xtensa \ z8k # Object format types. This is only used for dependency information. # We deliberately omit SOM, since it does not work as a cross assembler. - OBJ_FORMATS = \ aout \ bout \ @@ -216,13 +340,12 @@ OBJ_FORMATS = \ # type in the shell variable c and the OS type in the shell variable o # are supported. This helps cuts down on the amount of dependency # information. - CPU_OBJ_VALID = \ valid= ; \ case $$o in \ aout) \ case $$c in \ - a29k | arm | cris | i386 | m68k | mips | ns32k | pdp11 | sparc | tahoe | tic30 | vax) \ + a29k | arm | cris | i386 | m68k | ns32k | pdp11 | sparc | tahoe | tic30 | vax) \ valid=yes ;; \ esac ;; \ bout) \ @@ -231,7 +354,7 @@ CPU_OBJ_VALID = \ esac ;; \ coff) valid=yes; \ case $$c in \ - cris | i860 | mmix) \ + cris | i860 | mmix | sh64) \ valid= ;; \ esac ;; \ ecoff) \ @@ -255,9 +378,7 @@ CPU_OBJ_VALID = \ # These are like CPU_TYPES and CPU_OBJ_VALID, for the obj=multi case. - MULTI_CPU_TYPES = i386 mips cris - MULTI_CPU_OBJ_VALID = \ valid= ; \ case $$o in \ @@ -278,7 +399,6 @@ MULTI_CPU_OBJ_VALID = \ # Regular source files. - GAS_CFILES = \ app.c \ as.c \ @@ -287,6 +407,7 @@ GAS_CFILES = \ cond.c \ depend.c \ dwarf2dbg.c \ + dw2gencfi.c \ ecoff.c \ ehopt.c \ expr.c \ @@ -309,9 +430,7 @@ GAS_CFILES = \ symbols.c \ write.c - -CFILES = $(GAS_CFILES) gasp.c itbl-ops.c - +CFILES = $(GAS_CFILES) itbl-ops.c HFILES = \ as.h \ asintl.h \ @@ -319,6 +438,7 @@ HFILES = \ bit_fix.h \ cgen.h \ dwarf2dbg.h \ + dw2gencfi.h \ ecoff.h \ emul-target.h \ emul.h \ @@ -342,7 +462,6 @@ HFILES = \ # CPU files in config. - TARGET_CPU_CFILES = \ config/tc-a29k.c \ config/tc-alpha.c \ @@ -363,6 +482,7 @@ TARGET_CPU_CFILES = \ config/tc-i386.c \ config/tc-i860.c \ config/tc-i960.c \ + config/tc-ip2k.c \ config/tc-m32r.c \ config/tc-m68hc11.c \ config/tc-m68k.c \ @@ -372,6 +492,7 @@ TARGET_CPU_CFILES = \ config/tc-mmix.c \ config/tc-mn10200.c \ config/tc-mn10300.c \ + config/tc-msp430.c \ config/tc-ns32k.c \ config/tc-openrisc.c \ config/tc-or32.c \ @@ -390,9 +511,9 @@ TARGET_CPU_CFILES = \ config/tc-w65.c \ config/tc-v850.c \ config/tc-xstormy16.c \ + config/tc-xtensa.c \ config/tc-z8k.c - TARGET_CPU_HFILES = \ config/tc-a29k.h \ config/tc-alpha.h \ @@ -413,6 +534,7 @@ TARGET_CPU_HFILES = \ config/tc-i386.h \ config/tc-i860.h \ config/tc-i960.h \ + config/tc-ip2k.h \ config/tc-m32r.h \ config/tc-m68hc11.h \ config/tc-m68k.h \ @@ -422,6 +544,7 @@ TARGET_CPU_HFILES = \ config/tc-mmix.h \ config/tc-mn10200.h \ config/tc-mn10300.h \ + config/tc-msp430.h \ config/tc-ns32k.h \ config/tc-openrisc.h \ config/tc-or32.h \ @@ -440,11 +563,11 @@ TARGET_CPU_HFILES = \ config/tc-w65.h \ config/tc-v850.h \ config/tc-xstormy16.h \ + config/tc-xtensa.h \ config/tc-z8k.h # OBJ files in config - OBJ_FORMAT_CFILES = \ config/obj-aout.c \ config/obj-bout.c \ @@ -457,7 +580,6 @@ OBJ_FORMAT_CFILES = \ config/obj-som.c \ config/obj-vms.c - OBJ_FORMAT_HFILES = \ config/obj-aout.h \ config/obj-bout.h \ @@ -472,7 +594,6 @@ OBJ_FORMAT_HFILES = \ # Emulation header files in config - TARG_ENV_HFILES = \ config/te-386bsd.h \ config/te-aux.h \ @@ -510,7 +631,6 @@ TARG_ENV_HFILES = \ # Multi files in config - MULTI_CFILES = \ config/e-crisaout.c \ config/e-criself.c \ @@ -520,14 +640,12 @@ MULTI_CFILES = \ config/e-mipsecoff.c \ config/e-mipself.c - CONFIG_OBJS = \ $(TARG_CPU_O) \ $(OBJ_FORMAT_O) \ $(ATOF_TARG_O) \ $(extra_objects) - GENERIC_OBJS = \ app.o \ as.o \ @@ -536,6 +654,7 @@ GENERIC_OBJS = \ cond.o \ depend.o \ dwarf2dbg.o \ + dw2gencfi.o \ ehopt.o \ expr.o \ flonum-konst.o \ @@ -558,26 +677,17 @@ GENERIC_OBJS = \ sb.o \ macro.o - OBJS = $(CONFIG_OBJS) $(GENERIC_OBJS) - POTFILES = $(MULTI_CFILES) $(TARGET_ENV_HFILES) $(OBJ_FORMAT_HFILES) \ $(OBJ_FORMAT_CFILES) $(TARGET_CPU_HFILES) $(TARGET_CPU_CFILES) \ $(HFILES) $(CFILES) $(GAS_CFILES) - -# Note: GASP is now deprecated and will be removed at some point in the future. -# Anything that GASP could do can now be done by GAS. -noinst_PROGRAMS = as-new noinst_SCRIPTS = $(GDBINIT) EXTRA_SCRIPTS = .gdbinit - EXTRA_DIST = make-gas.com m68k-parse.c itbl-parse.c itbl-parse.h itbl-lex.c - DISTCLEANFILES = targ-cpu.h obj-format.h targ-env.h itbl-cpu.h cgen-desc.h # Now figure out from those variables how to compile and link. - BASEDIR = $(srcdir)/.. BFDDIR = $(BASEDIR)/bfd INCDIR = $(BASEDIR)/include @@ -594,19 +704,16 @@ INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(INCDIR) # when building dependencies, because the dependency building is done # in a subdirectory. DEP_INCLUDES = -D_GNU_SOURCE -I.. -I$${srcdir} -I../../bfd -I$${srcdir}/config -I$${srcdir}/../include -I$${srcdir}/.. -I$${srcdir}/../bfd -I$${srcdir}/../intl -I../../intl -DLOCALEDIR="\"$(prefix)/share/locale\"" - DEP_FLAGS = -DBFD_ASSEMBLER -DOBJ_MAYBE_ELF \ -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) # How to link with both our special library facilities # and the system's installed libraries. - GASLIBS = @OPCODES_LIB@ @BFDLIB@ ../libiberty/libiberty.a # Files to be copied away after each stage in building. 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) $(LIBM) @@ -614,16 +721,10 @@ as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ $(extra_objects) $(GASLIBS) $(INTLDEPS) - -gasp_new_SOURCES = gasp.c macro.c sb.c hash.c -gasp_new_LDADD = ../libiberty/libiberty.a $(INTLLIBS) -gasp_new_DEPENDENCIES = ../libiberty/libiberty.a $(INTLDEPS) - EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \ echo $${rootme}/../expect/expect ; \ else echo expect ; fi` - RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \ echo $${srcdir}/../dejagnu/runtest ; else echo runtest; \ fi` @@ -631,34 +732,24 @@ RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \ RUNTESTFLAGS = # The m68k operand parser. - EXTRA_as_new_SOURCES = config/m68k-parse.y - -# stand-alone itbl assembler & disassembler - -EXTRA_PROGRAMS = gasp-new itbl-test itbl_test_SOURCES = itbl-parse.y itbl-lex.l itbl_test_LDADD = itbl-tops.o itbl-test.o $(GASLIBS) @LEXLIB@ # CGEN interface. - CGEN_CPU_PREFIX = @cgen_cpu_prefix@ # Remake the info files. - MOSTLYCLEANFILES = $(STAGESTUFF) core stamp-mk.com \ testsuite/*.o testsuite/*.out testsuite/gas.log testsuite/gas.sum \ testsuite/site.exp site.bak site.exp stage stage1 stage2 - CLEANFILES = dep.sed DEPTC DEPTCA DEPOBJ DEPOBJA DEP2 DEP2A DEP1 DEPA DEP DEPDIR - against = stage2 - DEP_FILE_DEPS = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \ $(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES) - +CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in AMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. DEPTC_a29k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-a29k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ @@ -692,7 +783,8 @@ DEPTC_alpha_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.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 $(INCDIR)/safe-ctype.h $(srcdir)/config/atof-vax.c + dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/safe-ctype.h \ + $(srcdir)/config/atof-vax.c DEPTC_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \ $(srcdir)/config/tc-alpha.h subsegs.h $(INCDIR)/obstack.h \ @@ -800,29 +892,28 @@ DEPTC_fr30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ DEPTC_frv_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-frv.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h dwarf2dbg.h \ - subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \ - $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/frv-opc.h \ - cgen.h $(BFDDIR)/libbfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/frv.h \ - $(INCDIR)/elf/reloc-macros.h + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/frv-desc.h $(INCDIR)/opcode/cgen.h \ + $(srcdir)/../opcodes/frv-opc.h cgen.h $(BFDDIR)/libbfd.h \ + $(INCDIR)/elf/common.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h DEPTC_frv_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/frv-desc.h \ $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/frv-opc.h \ cgen.h $(BFDDIR)/libbfd.h $(INCDIR)/elf/frv.h $(INCDIR)/elf/reloc-macros.h DEPTC_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/h8300.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \ - $(INCDIR)/safe-ctype.h + $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h \ + $(INCDIR)/opcode/h8300.h $(INCDIR)/safe-ctype.h DEPTC_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h \ + subsegs.h $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/h8300.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/elf/h8.h $(INCDIR)/elf/reloc-macros.h DEPTC_h8500_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ @@ -871,24 +962,26 @@ DEPTC_i370_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/opcode/i370.h $(INCDIR)/elf/i370.h + struc-symbol.h $(INCDIR)/opcode/i370.h $(INCDIR)/elf/i370.h \ + $(INCDIR)/elf/reloc-macros.h DEPTC_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dwarf2dbg.h $(INCDIR)/opcode/i386.h + dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/i386.h DEPTC_i386_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/i386.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/i386.h + $(INCDIR)/obstack.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/opcode/i386.h DEPTC_i386_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - dwarf2dbg.h $(INCDIR)/opcode/i386.h + dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/i386.h DEPTC_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ @@ -910,6 +1003,21 @@ DEPTC_i960_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h +DEPTC_ip2k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-ip2k.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(srcdir)/../opcodes/ip2k-desc.h $(INCDIR)/opcode/cgen.h \ + $(srcdir)/../opcodes/ip2k-opc.h cgen.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/reloc-macros.h $(BFDDIR)/libbfd.h + +DEPTC_ip2k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/ip2k-desc.h \ + $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/ip2k-opc.h \ + cgen.h $(INCDIR)/elf/ip2k.h $(INCDIR)/elf/reloc-macros.h \ + $(BFDDIR)/libbfd.h + DEPTC_m32r_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ @@ -928,37 +1036,42 @@ DEPTC_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h + $(INCDIR)/obstack.h $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h \ + $(INCDIR)/elf/m68hc11.h $(INCDIR)/elf/reloc-macros.h DEPTC_m68hc11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h + $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h $(INCDIR)/elf/m68hc11.h \ + $(INCDIR)/elf/reloc-macros.h DEPTC_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ - dwarf2dbg.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h + dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ + $(srcdir)/config/m68k-parse.h DEPTC_m68k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/m68k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h \ - subsegs.h dwarf2dbg.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h + subsegs.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h DEPTC_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/obstack.h subsegs.h \ - dwarf2dbg.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h \ - $(INCDIR)/elf/m68k.h $(INCDIR)/elf/reloc-macros.h + dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h \ + $(srcdir)/config/m68k-parse.h $(INCDIR)/elf/m68k.h \ + $(INCDIR)/elf/reloc-macros.h DEPTC_m68k_hp300 = $(INCDIR)/symcat.h $(srcdir)/config/obj-hp300.h \ $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - $(INCDIR)/obstack.h subsegs.h dwarf2dbg.h $(INCDIR)/opcode/m68k.h \ - $(srcdir)/config/m68k-parse.h + $(INCDIR)/obstack.h subsegs.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/m68k.h $(srcdir)/config/m68k-parse.h DEPTC_m88k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-m88k.h $(INCDIR)/coff/internal.h \ @@ -1047,6 +1160,17 @@ DEPTC_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/opcode/mn10300.h dwarf2dbg.h +DEPTC_msp430_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-msp430.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/opcode/msp430.h $(INCDIR)/safe-ctype.h + +DEPTC_msp430_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/msp430.h \ + $(INCDIR)/safe-ctype.h + DEPTC_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h @@ -1114,65 +1238,68 @@ DEPTC_ppc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-ppc.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/rs6000.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/ppc.h + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h DEPTC_ppc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/ppc.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ - dwarf2dbg.h + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/ppc.h \ + $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h DEPTC_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-s390.h $(INCDIR)/coff/internal.h \ $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/s390.h \ + subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h $(INCDIR)/opcode/s390.h \ $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h DEPTC_s390_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/opcode/s390.h $(INCDIR)/elf/s390.h \ - $(INCDIR)/elf/reloc-macros.h + struc-symbol.h dwarf2dbg.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/opcode/s390.h $(INCDIR)/elf/s390.h $(INCDIR)/elf/reloc-macros.h DEPTC_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ - $(INCDIR)/safe-ctype.h struc-symbol.h dwarf2dbg.h + $(INCDIR)/safe-ctype.h struc-symbol.h dwarf2dbg.h dw2gencfi.h DEPTC_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h \ subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ $(INCDIR)/safe-ctype.h struc-symbol.h $(INCDIR)/elf/sh.h \ - $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h + $(INCDIR)/elf/reloc-macros.h dwarf2dbg.h dw2gencfi.h DEPTC_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \ + $(BFDDIR)/elf32-sh64.h $(INCDIR)/safe-ctype.h $(srcdir)/../opcodes/sh64-opc.h \ $(srcdir)/config/tc-sh.c subsegs.h $(INCDIR)/obstack.h \ - $(srcdir)/../opcodes/sh-opc.h struc-symbol.h dwarf2dbg.h + $(srcdir)/../opcodes/sh-opc.h struc-symbol.h dwarf2dbg.h dw2gencfi.h DEPTC_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/sparc.h + $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h DEPTC_sparc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/sparc.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h $(INCDIR)/safe-ctype.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h + $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h DEPTC_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/sparc.h $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/opcode/sparc.h dw2gencfi.h $(INCDIR)/elf/dwarf2.h \ + $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h \ dwarf2dbg.h DEPTC_tahoe_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ @@ -1203,6 +1330,18 @@ DEPTC_tic30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ $(INCDIR)/safe-ctype.h $(INCDIR)/opcode/tic30.h +DEPTC_tic4x_coff = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ + $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/opcode/tic4x.h \ + subsegs.h $(INCDIR)/obstack.h + +DEPTC_tic4x_elf = $(INCDIR)/safe-ctype.h $(INCDIR)/symcat.h \ + $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h \ + $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h \ + $(srcdir)/config/tc-tic4x.h $(INCDIR)/opcode/tic4x.h \ + subsegs.h $(INCDIR)/obstack.h + DEPTC_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ @@ -1287,6 +1426,14 @@ DEPTC_xstormy16_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/xstormy16-opc.h \ cgen.h +DEPTC_xtensa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ + $(INCDIR)/xtensa-config.h sb.h $(INCDIR)/safe-ctype.h \ + subsegs.h $(INCDIR)/obstack.h $(srcdir)/config/xtensa-relax.h \ + $(INCDIR)/xtensa-isa.h $(srcdir)/config/xtensa-istack.h \ + dwarf2dbg.h struc-symbol.h + DEPTC_z8k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \ $(INCDIR)/coff/z8k.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ @@ -1321,7 +1468,7 @@ DEPOBJ_a29k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-a29k.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_alpha_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ @@ -1337,8 +1484,8 @@ DEPOBJ_alpha_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-alpha.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ + struc-symbol.h dwarf2dbg.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)/symcat.h $(srcdir)/config/obj-evax.h \ @@ -1346,14 +1493,14 @@ DEPOBJ_alpha_evax = $(INCDIR)/symcat.h $(srcdir)/config/obj-evax.h \ DEPOBJ_arc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h struc-symbol.h \ - $(INCDIR)/obstack.h subsegs.h + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h DEPOBJ_arc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arc.h \ - struc-symbol.h $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - $(INCDIR)/aout/aout64.h + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_arm_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ @@ -1368,7 +1515,7 @@ DEPOBJ_arm_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-arm.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_avr_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ @@ -1379,7 +1526,7 @@ DEPOBJ_avr_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-avr.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_cris_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-cris.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ @@ -1389,7 +1536,7 @@ DEPOBJ_cris_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-cris.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_d10v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ @@ -1400,7 +1547,7 @@ DEPOBJ_d10v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d10v.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_d30v_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ @@ -1411,7 +1558,7 @@ DEPOBJ_d30v_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-d30v.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_dlx_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-dlx.h $(INCDIR)/coff/internal.h \ @@ -1422,7 +1569,7 @@ DEPOBJ_dlx_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-dlx.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_fr30_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ @@ -1433,7 +1580,7 @@ DEPOBJ_fr30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-fr30.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_frv_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-frv.h $(INCDIR)/coff/internal.h \ @@ -1444,7 +1591,7 @@ DEPOBJ_frv_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-frv.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_h8300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ @@ -1455,7 +1602,7 @@ DEPOBJ_h8300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8300.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_h8500_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \ @@ -1466,7 +1613,7 @@ DEPOBJ_h8500_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-h8500.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_hppa_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ @@ -1478,7 +1625,8 @@ DEPOBJ_hppa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-hppa.h \ $(BFDDIR)/elf32-hppa.h $(BFDDIR)/libhppa.h $(INCDIR)/elf/hppa.h \ $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/aout/aout64.h + subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ + $(INCDIR)/aout/aout64.h DEPOBJ_ia64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-ia64.h $(INCDIR)/opcode/ia64.h \ @@ -1491,7 +1639,7 @@ DEPOBJ_ia64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ia64.h \ $(INCDIR)/opcode/ia64.h $(INCDIR)/elf/ia64.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_i370_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ @@ -1502,7 +1650,8 @@ DEPOBJ_i370_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i370.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/i370.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/i370.h $(INCDIR)/elf/reloc-macros.h \ + $(INCDIR)/aout/aout64.h DEPOBJ_i386_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ @@ -1517,13 +1666,13 @@ DEPOBJ_i386_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_i860_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_i960_bout = $(INCDIR)/symcat.h $(srcdir)/config/obj-bout.h \ $(srcdir)/config/tc-i960.h $(INCDIR)/obstack.h @@ -1537,7 +1686,18 @@ DEPOBJ_i960_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_ip2k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-ip2k.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h + +DEPOBJ_ip2k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_m32r_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ @@ -1548,7 +1708,7 @@ DEPOBJ_m32r_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m32r.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_m68hc11_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-m68hc11.h $(INCDIR)/coff/internal.h \ @@ -1559,7 +1719,7 @@ DEPOBJ_m68hc11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68hc11.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_m68k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ @@ -1574,7 +1734,7 @@ DEPOBJ_m68k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m68k.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_m68k_hp300 = $(srcdir)/config/obj-aout.c $(INCDIR)/symcat.h \ $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ @@ -1590,7 +1750,7 @@ DEPOBJ_m88k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-m88k.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_mcore_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ @@ -1601,7 +1761,7 @@ DEPOBJ_mcore_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mcore.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_mips_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-mips.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ @@ -1621,14 +1781,15 @@ DEPOBJ_mips_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mips.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.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_mmix_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mmix.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_mn10200_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ @@ -1639,7 +1800,7 @@ DEPOBJ_mn10200_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10200.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_mn10300_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ @@ -1650,7 +1811,18 @@ DEPOBJ_mn10300_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_msp430_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-msp430.h $(INCDIR)/coff/internal.h \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ + subsegs.h + +DEPOBJ_msp430_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_ns32k_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ @@ -1665,7 +1837,7 @@ DEPOBJ_ns32k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ns32k.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_openrisc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-openrisc.h $(INCDIR)/coff/internal.h \ @@ -1676,7 +1848,7 @@ DEPOBJ_openrisc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-openrisc.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_or32_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-or32.h $(INCDIR)/coff/internal.h \ @@ -1687,7 +1859,7 @@ DEPOBJ_or32_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-or32.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_pdp11_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-pdp11.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ @@ -1702,7 +1874,7 @@ DEPOBJ_pdp11_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pdp11.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_pj_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ @@ -1713,7 +1885,7 @@ DEPOBJ_pj_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-pj.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_ppc_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-ppc.h $(INCDIR)/coff/internal.h \ @@ -1724,7 +1896,7 @@ DEPOBJ_ppc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ppc.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ + struc-symbol.h dwarf2dbg.h $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h \ $(INCDIR)/aout/aout64.h DEPOBJ_s390_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ @@ -1736,7 +1908,7 @@ DEPOBJ_s390_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-s390.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_sh_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ @@ -1747,20 +1919,14 @@ DEPOBJ_sh_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h - -DEPOBJ_sh64_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sh64.h $(srcdir)/config/tc-sh.h \ - $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sh.h $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h \ - $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_sh64_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + $(BFDDIR)/elf32-sh64.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_sparc_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ @@ -1775,7 +1941,7 @@ DEPOBJ_sparc_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sparc.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_tahoe_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-tahoe.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ @@ -1790,7 +1956,7 @@ DEPOBJ_tahoe_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tahoe.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_tic30_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ @@ -1805,7 +1971,18 @@ DEPOBJ_tic30_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_tic4x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ + $(srcdir)/config/tc-tic4x.h $(INCDIR)/coff/internal.h \ + $(INCDIR)/coff/tic4x.h $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h + +DEPOBJ_tic4x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic4x.h \ + $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_tic54x_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-tic54x.h $(INCDIR)/coff/internal.h \ @@ -1816,7 +1993,7 @@ DEPOBJ_tic54x_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic54x.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_tic80_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-tic80.h $(INCDIR)/coff/internal.h \ @@ -1827,7 +2004,7 @@ DEPOBJ_tic80_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic80.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_vax_aout = $(INCDIR)/symcat.h $(srcdir)/config/obj-aout.h \ $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ @@ -1842,7 +2019,7 @@ DEPOBJ_vax_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-vax.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_vax_vms = $(INCDIR)/symcat.h $(srcdir)/config/obj-vms.h \ $(srcdir)/config/tc-vax.h $(INCDIR)/aout/stab_gnu.h \ @@ -1858,7 +2035,7 @@ DEPOBJ_w65_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_v850_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-v850.h $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h \ @@ -1869,7 +2046,8 @@ DEPOBJ_v850_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-v850.h \ $(INCDIR)/elf/v850.h $(INCDIR)/elf/reloc-macros.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/aout/aout64.h + subsegs.h $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h \ + $(INCDIR)/aout/aout64.h DEPOBJ_xstormy16_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-xstormy16.h $(INCDIR)/coff/internal.h \ @@ -1880,7 +2058,13 @@ DEPOBJ_xstormy16_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h + +DEPOBJ_xtensa_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ + $(INCDIR)/xtensa-config.h $(INCDIR)/safe-ctype.h subsegs.h \ + $(INCDIR)/obstack.h struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_z8k_coff = $(INCDIR)/symcat.h $(srcdir)/config/obj-coff.h \ $(srcdir)/config/tc-z8k.h $(INCDIR)/coff/internal.h \ @@ -1891,7 +2075,7 @@ DEPOBJ_z8k_elf = $(INCDIR)/symcat.h $(srcdir)/config/obj-elf.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h \ $(INCDIR)/safe-ctype.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/aout/aout64.h + struc-symbol.h dwarf2dbg.h $(INCDIR)/aout/aout64.h DEPOBJ_hppa_som = $(srcdir)/config/obj-som.h subsegs.h \ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(BFDDIR)/som.h \ @@ -2069,6 +2253,14 @@ DEP_i960_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i960.h +DEP_ip2k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ip2k.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h + +DEP_ip2k_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-ip2k.h + DEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ $(INCDIR)/bfdlink.h @@ -2149,6 +2341,14 @@ DEP_mn10300_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-mn10300.h +DEP_msp430_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-msp430.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h + +DEP_msp430_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-msp430.h + DEP_ns32k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-ns32k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h @@ -2219,15 +2419,11 @@ DEP_sh_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh.h -DEP_sh64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ - $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h \ - $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - DEP_sh64_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-sh64.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h + $(srcdir)/config/tc-sh.h $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h \ + $(BFDDIR)/elf32-sh64.h DEP_sparc_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-sparc.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h @@ -2262,6 +2458,14 @@ DEP_tic30_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic30.h +DEP_tic4x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic4x.h \ + $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic4x.h \ + $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h + +DEP_tic4x_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-tic4x.h + DEP_tic54x_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic54x.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h \ $(INCDIR)/coff/ti.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h @@ -2317,6 +2521,11 @@ DEP_xstormy16_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xstormy16.h +DEP_xtensa_elf = $(srcdir)/config/obj-elf.h $(INCDIR)/symcat.h \ + $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-xtensa.h \ + $(INCDIR)/xtensa-config.h + DEP_z8k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-z8k.h \ $(INCDIR)/symcat.h $(INCDIR)/coff/internal.h $(INCDIR)/coff/z8k.h \ $(INCDIR)/coff/external.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h @@ -2334,147 +2543,103 @@ DEP_mips_multi = $(DEP_mips_coff) $(DEP_mips_ecoff) \ DEP_cris_multi = $(DEP_cris_aout) $(DEP_cris_elf) BMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE. -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs -CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = ${GDBINIT} -noinst_PROGRAMS = as-new$(EXEEXT) -PROGRAMS = $(noinst_PROGRAMS) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I. -CPPFLAGS = @CPPFLAGS@ -LDFLAGS = @LDFLAGS@ -LIBS = @LIBS@ -gasp_new_OBJECTS = gasp.$(OBJEXT) macro.$(OBJEXT) sb.$(OBJEXT) \ -hash.$(OBJEXT) -gasp_new_LDFLAGS = -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.$(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 = -SCRIPTS = $(noinst_SCRIPTS) - -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LEXLIB = @LEXLIB@ -YLWRAP = $(top_srcdir)/../ylwrap -CFLAGS = @CFLAGS@ -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ -DIST_COMMON = README ./stamp-h.in COPYING ChangeLog Makefile.am \ -Makefile.in NEWS acinclude.m4 aclocal.m4 config.in config/m68k-parse.c \ -configure configure.in gdbinit.in itbl-lex.c itbl-parse.c - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP_ENV = --best -SOURCES = $(gasp_new_SOURCES) $(itbl_test_SOURCES) $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) -OBJECTS = $(gasp_new_OBJECTS) $(itbl_test_OBJECTS) $(as_new_OBJECTS) +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive -all: all-redirect .SUFFIXES: -.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 - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status - -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4 - cd $(srcdir) && $(ACLOCAL) +.SUFFIXES: .c .l .lo .o .obj .y +am--refresh: + @: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ + cd $(srcdir) && $(AUTOMAKE) --foreign \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; -config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -config.h: stamp-h +config.h: stamp-h1 @if test ! -f $@; then \ - rm -f stamp-h; \ - $(MAKE) stamp-h; \ + rm -f stamp-h1; \ + $(MAKE) stamp-h1; \ else :; fi -stamp-h: $(srcdir)/config.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES= CONFIG_HEADERS=config.h:config.in \ - $(SHELL) ./config.status - @echo timestamp > stamp-h 2> /dev/null -$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in - @if test ! -f $@; then \ - rm -f $(srcdir)/stamp-h.in; \ - $(MAKE) $(srcdir)/stamp-h.in; \ - else :; fi -$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOHEADER) - @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null -mostlyclean-hdr: - -clean-hdr: +stamp-h1: $(srcdir)/config.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ distclean-hdr: - -rm -f config.h - -maintainer-clean-hdr: -${GDBINIT}: $(top_builddir)/config.status gdbinit.in - cd $(top_builddir) && CONFIG_FILES=$@:gdbinit.in CONFIG_HEADERS= $(SHELL) ./config.status - -mostlyclean-noinstPROGRAMS: + -rm -f config.h stamp-h1 +gdb.ini: $(top_builddir)/config.status $(srcdir)/gdbinit.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +.gdbinit: $(top_builddir)/config.status $(srcdir)/gdbinit.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +po/Makefile.in: $(top_builddir)/config.status $(top_srcdir)/po/Make-in + cd $(top_builddir) && $(SHELL) ./config.status $@ clean-noinstPROGRAMS: - -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) - -distclean-noinstPROGRAMS: - -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 $< - -.S.o: - $(COMPILE) -c $< + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +as-new$(EXEEXT): $(as_new_OBJECTS) $(as_new_DEPENDENCIES) + @rm -f as-new$(EXEEXT) + $(LINK) $(as_new_LDFLAGS) $(as_new_OBJECTS) $(as_new_LDADD) $(LIBS) +itbl-test$(EXEEXT): $(itbl_test_OBJECTS) $(itbl_test_DEPENDENCIES) + @rm -f itbl-test$(EXEEXT) + $(LINK) $(itbl_test_LDFLAGS) $(itbl_test_OBJECTS) $(itbl_test_LDADD) $(LIBS) mostlyclean-compile: - -rm -f *.o core *.core -rm -f *.$(OBJEXT) -clean-compile: - distclean-compile: -rm -f *.tab.c -maintainer-clean-compile: +.c.o: + $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< + $(LTCOMPILE) -c -o $@ $< -.s.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< +.l.c: + $(LEXCOMPILE) $< + sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@ + rm -f $(LEX_OUTPUT_ROOT).c -.S.lo: - $(LIBTOOL) --mode=compile $(COMPILE) -c $< +.y.c: + $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h $*.h y.output $*.output -- $(YACCCOMPILE) mostlyclean-libtool: -rm -f *.lo @@ -2483,27 +2648,8 @@ clean-libtool: -rm -rf .libs _libs distclean-libtool: - -maintainer-clean-libtool: - -gasp-new$(EXEEXT): $(gasp_new_OBJECTS) $(gasp_new_DEPENDENCIES) - @rm -f gasp-new$(EXEEXT) - $(LINK) $(gasp_new_LDFLAGS) $(gasp_new_OBJECTS) $(gasp_new_LDADD) $(LIBS) - -itbl-test$(EXEEXT): $(itbl_test_OBJECTS) $(itbl_test_DEPENDENCIES) - @rm -f itbl-test$(EXEEXT) - $(LINK) $(itbl_test_LDFLAGS) $(itbl_test_OBJECTS) $(itbl_test_LDADD) $(LIBS) - -as-new$(EXEEXT): $(as_new_OBJECTS) $(as_new_DEPENDENCIES) - @rm -f as-new$(EXEEXT) - $(LINK) $(as_new_LDFLAGS) $(as_new_OBJECTS) $(as_new_LDADD) $(LIBS) -.l.c: - $(LEX) $(AM_LFLAGS) $(LFLAGS) $< && mv $(LEX_OUTPUT_ROOT).c $@ -.y.c: - $(SHELL) $(YLWRAP) "$(YACC)" $< y.tab.c $*.c y.tab.h $*.h -- $(AM_YFLAGS) $(YFLAGS) -config/m68k-parse.h: config/m68k-parse.c -itbl-parse.h: itbl-parse.c - + -rm -f libtool +uninstall-info-am: # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. @@ -2511,13 +2657,8 @@ itbl-parse.h: itbl-parse.c # (1) if the variable is set in `config.status', edit `config.status' # (which will cause the Makefiles to be regenerated when you run `make'); # (2) otherwise, pass the desired values on the `make' command line. - -@SET_MAKE@ - -all-recursive install-data-recursive install-exec-recursive \ -installdirs-recursive install-recursive uninstall-recursive install-info-recursive \ -check-recursive installcheck-recursive info-recursive dvi-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ +$(RECURSIVE_TARGETS): + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ list='$(SUBDIRS)'; for subdir in $$list; do \ @@ -2537,13 +2678,18 @@ check-recursive installcheck-recursive info-recursive dvi-recursive: mostlyclean-recursive clean-recursive distclean-recursive \ maintainer-clean-recursive: - @set fnord $(MAKEFLAGS); amf=$$2; \ + @set fnord $$MAKEFLAGS; amf=$$2; \ dot_seen=no; \ - rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ - rev="$$subdir $$rev"; \ - test "$$subdir" != "." || dot_seen=yes; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ done; \ - test "$$dot_seen" = "no" && rev=". $$rev"; \ + rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ @@ -2559,155 +2705,116 @@ tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done -tags: TAGS - -ID: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - here=`pwd` && cd $(srcdir) \ - && mkid -f$$here/ID $$unique $(LISP) + mkid -fID $$unique +tags: TAGS -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) $(LISP) +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ - fi; \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ done; \ - list='$(SOURCES) $(HEADERS)'; \ - unique=`for i in $$list; do echo $$i; done | \ - awk ' { files[$$0] = 1; } \ + list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ - test -z "$(ETAGS_ARGS)config.in$$unique$(LISP)$$tags" \ - || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.in $$unique $(LISP) -o $$here/TAGS) - -mostlyclean-tags: + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -z "$$unique" && unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) config.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique -clean-tags: +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID - -maintainer-clean-tags: - -distdir = $(PACKAGE)-$(VERSION) -top_distdir = $(distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - -rm -rf $(distdir) - GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz - mkdir $(distdir)/=build - mkdir $(distdir)/=inst - dc_install_base=`cd $(distdir)/=inst && pwd`; \ - cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_install_base \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) dist - -rm -rf $(distdir) - @banner="$(distdir).tar.gz is ready for distribution"; \ - dashes=`echo "$$banner" | sed s/./=/g`; \ - echo "$$dashes"; \ - echo "$$banner"; \ - echo "$$dashes" -dist: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -dist-all: distdir - -chmod -R a+r $(distdir) - GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) - -rm -rf $(distdir) -distdir: $(DISTFILES) - -rm -rf $(distdir) - mkdir $(distdir) - -chmod 777 $(distdir) - @for file in $(DISTFILES); do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - for subdir in $(SUBDIRS); do \ - if test "$$subdir" = .; then :; else \ - test -d $(distdir)/$$subdir \ - || mkdir $(distdir)/$$subdir \ - || exit 1; \ - chmod 777 $(distdir)/$$subdir; \ - (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ - || exit 1; \ - fi; \ - done - -DEJATOOL = $(PACKAGE) - -RUNTESTDEFAULTFLAGS = --tool $(DEJATOOL) --srcdir $$srcdir + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags site.exp: Makefile @echo 'Making a new site.exp file...' - @test ! -f site.bak || rm -f site.bak - @echo '## these variables are automatically generated by make ##' > $@-t - @echo '# Do not edit here. If you wish to override these values' >> $@-t - @echo '# edit the last section' >> $@-t - @echo 'set tool $(DEJATOOL)' >> $@-t - @echo 'set srcdir $(srcdir)' >> $@-t - @echo 'set objdir' `pwd` >> $@-t - @echo 'set host_alias $(host_alias)' >> $@-t - @echo 'set host_triplet $(host_triplet)' >> $@-t - @echo 'set target_alias $(target_alias)' >> $@-t - @echo 'set target_triplet $(target_triplet)' >> $@-t - @echo 'set build_alias $(build_alias)' >> $@-t - @echo 'set build_triplet $(build_triplet)' >> $@-t - @echo '## All variables above are generated by configure. Do Not Edit ##' >> $@-t - @test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> $@-t + @echo '## these variables are automatically generated by make ##' >site.tmp + @echo '# Do not edit here. If you wish to override these values' >>site.tmp + @echo '# edit the last section' >>site.tmp + @echo 'set srcdir $(srcdir)' >>site.tmp + @echo "set objdir `pwd`" >>site.tmp + @echo 'set build_alias "$(build_alias)"' >>site.tmp + @echo 'set build_triplet $(build_triplet)' >>site.tmp + @echo 'set host_alias "$(host_alias)"' >>site.tmp + @echo 'set host_triplet $(host_triplet)' >>site.tmp + @echo 'set target_alias "$(target_alias)"' >>site.tmp + @echo 'set target_triplet $(target_triplet)' >>site.tmp + @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp + @test ! -f site.exp || \ + sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp + @-rm -f site.bak @test ! -f site.exp || mv site.exp site.bak - @mv $@-t site.exp -info-am: -info: info-recursive -dvi-am: -dvi: dvi-recursive + @mv site.tmp site.exp + +distclean-DEJAGNU: + -rm -f site.exp site.bak + -l='$(DEJATOOL)'; for tool in $$l; do \ + rm -f $$tool.sum $$tool.log; \ + done check-am: $(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU check: check-recursive -installcheck-am: -installcheck: installcheck-recursive -install-info-am: -install-info: install-info-recursive -all-recursive-am: config.h - $(MAKE) $(AM_MAKEFLAGS) all-recursive - -install-exec-am: install-exec-local +all-am: Makefile $(PROGRAMS) $(SCRIPTS) config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive install-exec: install-exec-recursive - -install-data-am: install-data: install-data-recursive +uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-recursive -uninstall-am: -uninstall: uninstall-recursive -all-am: Makefile $(PROGRAMS) $(SCRIPTS) config.h -all-redirect: all-recursive-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: installdirs-recursive -installdirs-am: - +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) @@ -2715,63 +2822,87 @@ clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: - -test -z "itbl-lexlconfig/m68k-parsehconfig/m68k-parsecitbl-parsehitbl-parsec" || rm -f itbl-lexl config/m68k-parseh config/m68k-parsec itbl-parseh itbl-parsec -mostlyclean-am: mostlyclean-hdr mostlyclean-noinstPROGRAMS \ - mostlyclean-compile mostlyclean-libtool \ - mostlyclean-tags mostlyclean-generic + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -rm -f m68k-parse.c + -rm -f itbl-lex.c + -rm -f itbl-parse.c +clean: clean-recursive -mostlyclean: mostlyclean-recursive +clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ + mostlyclean-am -clean-am: clean-hdr clean-noinstPROGRAMS clean-compile clean-libtool \ - clean-tags clean-generic mostlyclean-am +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-DEJAGNU distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags -clean: clean-recursive +dvi: dvi-recursive -distclean-am: distclean-hdr distclean-noinstPROGRAMS distclean-compile \ - distclean-libtool distclean-tags distclean-generic \ - clean-am - -rm -f libtool +dvi-am: -distclean: distclean-recursive - -rm -f config.status - -maintainer-clean-am: maintainer-clean-hdr \ - maintainer-clean-noinstPROGRAMS \ - maintainer-clean-compile maintainer-clean-libtool \ - maintainer-clean-tags maintainer-clean-generic \ - distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: install-exec-local + +install-info: install-info-recursive + +install-man: + +installcheck-am: maintainer-clean: maintainer-clean-recursive - -rm -f config.status - -.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ -mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \ -clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \ -mostlyclean-compile distclean-compile clean-compile \ -maintainer-clean-compile mostlyclean-libtool distclean-libtool \ -clean-libtool maintainer-clean-libtool install-data-recursive \ -uninstall-data-recursive install-exec-recursive \ -uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ -all-recursive check-recursive installcheck-recursive info-recursive \ -dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ -maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir check-DEJAGNU \ -info-am info dvi-am dvi check check-am installcheck-am installcheck \ -install-info-am install-info all-recursive-am install-exec-local \ -install-exec-am install-exec install-data-am install-data install-am \ -install uninstall-am uninstall all-redirect all-am all installdirs-am \ -installdirs mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \ + check-DEJAGNU check-am clean clean-generic clean-libtool \ + clean-noinstPROGRAMS clean-recursive ctags ctags-recursive \ + distclean distclean-DEJAGNU distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-recursive distclean-tags dvi dvi-am html html-am \ + info info-am install install-am install-data install-data-am \ + install-exec install-exec-am install-exec-local install-info \ + install-info-am install-man install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \ + tags tags-recursive uninstall uninstall-am uninstall-info-am po/POTFILES.in: @MAINT@ Makefile - for file in $(POTFILES); do echo $$file; done | sort > tmp \ + for f in $(POTFILES); do echo $$f; done | LC_COLLATE= sort > tmp \ && mv tmp $(srcdir)/po/POTFILES.in $(srcdir)/make-gas.com: stamp-mk.com @@ -2868,6 +2999,9 @@ e-crisaout.o: $(srcdir)/config/e-crisaout.c e-criself.o: $(srcdir)/config/e-criself.c $(COMPILE) -c $(srcdir)/config/e-criself.c +xtensa-relax.o: $(srcdir)/config/xtensa-relax.c + $(COMPILE) -c $(srcdir)/config/xtensa-relax.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 # absolute path into the generated file. That's a pain when it comes @@ -3019,8 +3153,6 @@ de-stage3: - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..) - rmdir stage3 -Makefile: $(BFDDIR)/configure.in - # Automatic dependency computation. This is a real pain, because the # dependencies change based on target_cpu_type and obj_format. # Just to make things even more complicated, automake separates the @@ -3202,13 +3334,17 @@ dep-am: DEP #MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW. app.o: app.c $(INCDIR)/symcat.h as.o: as.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ - output-file.h sb.h macro.h dwarf2dbg.h + output-file.h sb.h macro.h dwarf2dbg.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h $(BFDVER_H) atof-generic.o: atof-generic.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h bignum-copy.o: bignum-copy.c $(INCDIR)/symcat.h cond.o: cond.c $(INCDIR)/symcat.h macro.h sb.h $(INCDIR)/obstack.h depend.o: depend.c $(INCDIR)/symcat.h dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/symcat.h dwarf2dbg.h \ - subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h + $(INCDIR)/filenames.h subsegs.h $(INCDIR)/obstack.h \ + $(INCDIR)/elf/dwarf2.h +dw2gencfi.o: dw2gencfi.c $(INCDIR)/symcat.h dw2gencfi.h \ + $(INCDIR)/elf/dwarf2.h ecoff.o: ecoff.c $(INCDIR)/symcat.h ecoff.h ehopt.o: ehopt.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ $(INCDIR)/elf/dwarf2.h @@ -3231,7 +3367,8 @@ macro.o: macro.c $(INCDIR)/safe-ctype.h sb.h macro.h messages.o: messages.c $(INCDIR)/symcat.h output-file.o: output-file.c $(INCDIR)/symcat.h output-file.h read.o: read.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ - subsegs.h $(INCDIR)/obstack.h sb.h macro.h ecoff.h + subsegs.h $(INCDIR)/obstack.h sb.h macro.h ecoff.h \ + dw2gencfi.h $(INCDIR)/elf/dwarf2.h sb.o: sb.c sb.h stabs.o: stabs.c $(INCDIR)/symcat.h $(INCDIR)/obstack.h \ subsegs.h ecoff.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def @@ -3240,8 +3377,6 @@ symbols.o: symbols.c $(INCDIR)/symcat.h $(INCDIR)/safe-ctype.h \ $(INCDIR)/obstack.h subsegs.h struc-symbol.h write.o: write.c $(INCDIR)/symcat.h subsegs.h $(INCDIR)/obstack.h \ output-file.h dwarf2dbg.h -gasp.o: gasp.c $(INCDIR)/getopt.h $(INCDIR)/safe-ctype.h \ - sb.h macro.h $(INCDIR)/xregex.h $(INCDIR)/xregex2.h itbl-ops.o: itbl-ops.c itbl-ops.h $(INCDIR)/symcat.h e-crisaout.o: $(srcdir)/config/e-crisaout.c $(INCDIR)/symcat.h \ emul-target.h @@ -3261,7 +3396,6 @@ $(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@) #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. .NOEXPORT: diff --git a/contrib/binutils/gas/NEWS b/contrib/binutils/gas/NEWS index 18482a9..1a31e79 100644 --- a/contrib/binutils/gas/NEWS +++ b/contrib/binutils/gas/NEWS @@ -1,370 +1,420 @@ -*- text -*- +* The MIPS -membedded-pic option (Embedded-PIC code generation) is + deprecated and will be removed in a future release. + +* Added PIC m32r Linux (ELF) and support to M32R assembler. + +* Added support for ARM V6. + +* Added support for sh4a and variants. + +* Support for Renesas M32R2 added. + +* Limited support for Mapping Symbols as specified in the ARM ELF + specification has been added to the arm assembler. + +* On ARM architectures, added a new gas directive ".unreq" that undoes + definitions created by ".req". + +* Support for Motorola ColdFire MCF528x added. + +* Added --gstabs+ switch to enable the generation of STABS debug format + information with GNU extensions. + +* Added support for MIPS64 Release 2. + +* Added support for v850e1. + +* Added -n switch for x86 assembler. By default, x86 GAS replaces + multiple nop instructions used for alignment within code sections + with multi-byte nop instructions such as leal 0(%esi,1),%esi. This + switch disables the optimization. + +* Removed -n option from MIPS assembler. It was not useful, and confused the + existing -non_shared option. + +Changes in 2.14: + +* Added support for MIPS32 Release 2. + +* Added support for Xtensa architecture. + +* Support for Intel's iWMMXt processor (an ARM variant) added. + +* An assembler test generator has been contributed and an example file that + uses it (gas/testsuite/gas/all/test-gen.c and test-exmaple.c). + +* Support for SH2E added. + +* GASP has now been removed. + +* Support for Texas Instruments TMS320C4x and TMS320C3x series of + DSP's contributed by Michael Hayes and Svein E. Seldal. + +* Support for the Ubicom IP2xxx microcontroller added. + Changes in 2.13: -Support for the Fujitsu FRV architecture added by Red Hat. Models for FR400 and -FR500 included. +* Support for the Fujitsu FRV architecture added by Red Hat. Models for FR400 + and FR500 included. -Support for DLX processor added. +* Support for DLX processor added. -GASP has now been deprecated and will be removed in a future release. Use the -macro facilities in GAS instead. +* GASP has now been deprecated and will be removed in a future release. Use + the macro facilities in GAS instead. -GASP now correctly parses floating point numbers. Unless the base is explicitly -specified, they are interpreted as decimal numbers regardless of the currently -specified base. +* GASP now correctly parses floating point numbers. Unless the base is + explicitly specified, they are interpreted as decimal numbers regardless of + the currently specified base. Changes in 2.12: -Support for Don Knuth's MMIX, by Hans-Peter Nilsson. +* Support for Don Knuth's MMIX, by Hans-Peter Nilsson. -Support for the OpenRISC 32-bit embedded processor by OpenCores. +* Support for the OpenRISC 32-bit embedded processor by OpenCores. -The ARM assembler now accepts -march=..., -mcpu=... and -mfpu=... for -specifying the target instruction set. The old method of specifying the -target processor has been deprecated, but is still accepted for -compatibility. +* The ARM assembler now accepts -march=..., -mcpu=... and -mfpu=... for + specifying the target instruction set. The old method of specifying the + target processor has been deprecated, but is still accepted for + compatibility. -Support for the VFP floating-point instruction set has been added to -the ARM assembler. +* Support for the VFP floating-point instruction set has been added to + the ARM assembler. -New psuedo op: .incbin to include a set of binary data at a given point -in the assembly. Contributed by Anders Norlander. +* New psuedo op: .incbin to include a set of binary data at a given point + in the assembly. Contributed by Anders Norlander. -The MIPS assembler now accepts -march/-mtune. -mcpu has been deprecated -but still works for compatability. +* The MIPS assembler now accepts -march/-mtune. -mcpu has been deprecated + but still works for compatability. -The MIPS assembler no longer issues a warning by default when it -generates a nop instruction from a macro. The new command line option --n will turn on the warning. +* The MIPS assembler no longer issues a warning by default when it + generates a nop instruction from a macro. The new command line option + -n will turn on the warning. Changes in 2.11: -x86 gas now supports the full Pentium4 instruction set. +* Support for PDP-11 and 2.11BSD a.out format, by Lars Brinkhoff. -Support for AMD x86-64 architecture, by Jan Hubicka, SuSE Labs. +* x86 gas now supports the full Pentium4 instruction set. -Support for Motorola 68HC11 and 68HC12. +* Support for AMD x86-64 architecture, by Jan Hubicka, SuSE Labs. -Support for Texas Instruments TMS320C54x (tic54x). +* Support for Motorola 68HC11 and 68HC12. -Support for IA-64. +* Support for Texas Instruments TMS320C54x (tic54x). -Support for i860, by Jason Eckhardt. +* Support for IA-64. -Support for CRIS (Axis Communications ETRAX series). +* Support for i860, by Jason Eckhardt. -x86 gas has a new .arch pseudo op to specify the target CPU architecture. +* Support for CRIS (Axis Communications ETRAX series). -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. +* 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 -operand when altering the flags field. +* Support for the ARM msr instruction was changed to only allow an immediate + operand when altering the flags field. -Support for ATMEL AVR. +* Support for ATMEL AVR. -Support for IBM 370 ELF. Somewhat experimental. +* Support for IBM 370 ELF. Somewhat experimental. -Support for numbers with suffixes. +* Support for numbers with suffixes. -Added support for breaking to the end of repeat loops. +* Added support for breaking to the end of repeat loops. -Added support for parallel instruction syntax (DOUBLEBAR_PARALLEL). +* Added support for parallel instruction syntax (DOUBLEBAR_PARALLEL). -New .elseif pseudo-op added. +* New .elseif pseudo-op added. -New --fatal-warnings option. +* New --fatal-warnings option. -picoJava architecture support added. +* picoJava architecture support added. -Motorola MCore 210 processor support added. +* Motorola MCore 210 processor support added. -A new pseudo-op .intel_syntax has been implemented to allow gas to parse i386 -assembly programs with intel syntax. +* A new pseudo-op .intel_syntax has been implemented to allow gas to parse i386 + assembly programs with intel syntax. -New pseudo-ops .func,.endfunc to aid in debugging user-written assembler code. +* New pseudo-ops .func,.endfunc to aid in debugging user-written assembler code. -Added -gdwarf2 option to generate DWARF 2 debugging information. +* Added -gdwarf2 option to generate DWARF 2 debugging information. -Full 16-bit mode support for i386. +* Full 16-bit mode support for i386. -Greatly improved instruction operand checking for i386. This change will -produce errors or warnings on incorrect assembly code that previous versions of -gas accepted. If you get unexpected messages from code that worked with older -versions of gas, please double check the code before reporting a bug. +* Greatly improved instruction operand checking for i386. This change will + produce errors or warnings on incorrect assembly code that previous versions + of gas accepted. If you get unexpected messages from code that worked with + older versions of gas, please double check the code before reporting a bug. -Weak symbol support added for COFF targets. +* Weak symbol support added for COFF targets. -Mitsubishi D30V support added. +* Mitsubishi D30V support added. -Texas Instruments c80 (tms320c80) support added. +* Texas Instruments c80 (tms320c80) support added. -i960 ELF support added. +* i960 ELF support added. -ARM ELF support added. +* ARM ELF support added. Changes in 2.9: -Texas Instruments c30 (tms320c30) support added. +* Texas Instruments c30 (tms320c30) support added. -The assembler now optimizes the exception frame information generated by egcs -and gcc 2.8. The new --traditional-format option disables this optimization. +* The assembler now optimizes the exception frame information generated by egcs + and gcc 2.8. The new --traditional-format option disables this optimization. -Added --gstabs option to generate stabs debugging information. +* Added --gstabs option to generate stabs debugging information. -The -a option takes a new suboption, m (e.g., -alm) to expand macros in a -listing. +* The -a option takes a new suboption, m (e.g., -alm) to expand macros in a + listing. -Added -MD option to print dependencies. +* Added -MD option to print dependencies. Changes in 2.8: -BeOS support added. +* BeOS support added. -MIPS16 support added. +* MIPS16 support added. -Motorola ColdFire 5200 support added (configure for m68k and use -m5200). +* Motorola ColdFire 5200 support added (configure for m68k and use -m5200). -Alpha/VMS support added. +* Alpha/VMS support added. -m68k options --base-size-default-16, --base-size-default-32, ---disp-size-default-16, and --disp-size-default-32 added. +* m68k options --base-size-default-16, --base-size-default-32, + --disp-size-default-16, and --disp-size-default-32 added. -The alignment directives now take an optional third argument, which is the -maximum number of bytes to skip. If doing the alignment would require skipping -more than the given number of bytes, the alignment is not done at all. +* The alignment directives now take an optional third argument, which is the + maximum number of bytes to skip. If doing the alignment would require + skipping more than the given number of bytes, the alignment is not done at + all. -The ELF assembler has a new pseudo-op, .symver, used for symbol versioning. +* The ELF assembler has a new pseudo-op, .symver, used for symbol versioning. -The -a option takes a new suboption, c (e.g., -alc), to skip false conditionals -in listings. +* The -a option takes a new suboption, c (e.g., -alc), to skip false + conditionals in listings. -Added new pseudo-op, .equiv; it's like .equ, except that it is an error if the -symbol is already defined. +* Added new pseudo-op, .equiv; it's like .equ, except that it is an error if + the symbol is already defined. Changes in 2.7: -The PowerPC assembler now allows the use of symbolic register names (r0, etc.) -if -mregnames is used. Symbolic names preceded by a '%' (%r0, etc.) can be -used any time. PowerPC 860 move to/from SPR instructions have been added. +* The PowerPC assembler now allows the use of symbolic register names (r0, + etc.) if -mregnames is used. Symbolic names preceded by a '%' (%r0, etc.) + can be used any time. PowerPC 860 move to/from SPR instructions have been + added. -Alpha Linux (ELF) support added. +* Alpha Linux (ELF) support added. -PowerPC ELF support added. +* PowerPC ELF support added. -m68k Linux (ELF) support added. +* m68k Linux (ELF) support added. -i960 Hx/Jx support added. +* i960 Hx/Jx support added. -i386/PowerPC gnu-win32 support added. +* i386/PowerPC gnu-win32 support added. -SCO ELF support added. For OpenServer 5 targets (i386-unknown-sco3.2v5) the -default is to build COFF-only support. To get a set of tools that generate ELF -(they'll understand both COFF and ELF), you must configure with -target=i386-unknown-sco3.2v5elf. +* SCO ELF support added. For OpenServer 5 targets (i386-unknown-sco3.2v5) the + default is to build COFF-only support. To get a set of tools that generate + ELF (they'll understand both COFF and ELF), you must configure with + target=i386-unknown-sco3.2v5elf. -m88k-motorola-sysv3* support added. +* m88k-motorola-sysv3* support added. Changes in 2.6: -Gas now directly supports macros, without requiring GASP. +* Gas now directly supports macros, without requiring GASP. -Gas now has an MRI assembler compatibility mode. Use -M or --mri to select MRI -mode. The pseudo-op ``.mri 1'' will switch into the MRI mode until the ``.mri -0'' is seen; this can be convenient for inline assembler code. +* Gas now has an MRI assembler compatibility mode. Use -M or --mri to select + MRI mode. The pseudo-op ``.mri 1'' will switch into the MRI mode until the + ``.mri 0'' is seen; this can be convenient for inline assembler code. -Added --defsym SYM=VALUE option. +* Added --defsym SYM=VALUE option. -Added -mips4 support to MIPS assembler. +* Added -mips4 support to MIPS assembler. -Added PIC support to Solaris and SPARC SunOS 4 assembler. +* Added PIC support to Solaris and SPARC SunOS 4 assembler. Changes in 2.4: -Converted this directory to use an autoconf-generated configure script. +* Converted this directory to use an autoconf-generated configure script. -ARM support, from Richard Earnshaw. +* ARM support, from Richard Earnshaw. -Updated VMS support, from Pat Rankin, including considerably improved debugging -support. +* Updated VMS support, from Pat Rankin, including considerably improved + debugging support. -Support for the control registers in the 68060. +* Support for the control registers in the 68060. -Handles (ignores) a new directive ".this_GCC_requires_the_GNU_assembler", to -provide for possible future gcc changes, for targets where gas provides some -features not available in the native assembler. If the native assembler is -used, it should become obvious pretty quickly what the problem is. +* Handles (ignores) a new directive ".this_GCC_requires_the_GNU_assembler", to + provide for possible future gcc changes, for targets where gas provides some + features not available in the native assembler. If the native assembler is + used, it should become obvious pretty quickly what the problem is. -Usage message is available with "--help". +* Usage message is available with "--help". -The GNU Assembler Preprocessor (gasp) is included. (Actually, it was in 2.3 -also, but didn't get into the NEWS file.) +* The GNU Assembler Preprocessor (gasp) is included. (Actually, it was in 2.3 + also, but didn't get into the NEWS file.) -Weak symbol support for a.out. +* Weak symbol support for a.out. -A bug in the listing code which could cause an infinite loop has been fixed. -Bugs in listings when generating a COFF object file have also been fixed. +* A bug in the listing code which could cause an infinite loop has been fixed. + Bugs in listings when generating a COFF object file have also been fixed. -Initial i386-svr4 PIC implementation from Eric Youngdale, based on code by Paul -Kranenburg. +* Initial i386-svr4 PIC implementation from Eric Youngdale, based on code by + Paul Kranenburg. -Improved Alpha support. Immediate constants can have a much larger range now. -Support for the 21164 has been contributed by Digital. +* Improved Alpha support. Immediate constants can have a much larger range + now. Support for the 21164 has been contributed by Digital. -Updated ns32k (pc532-mach, netbsd532) support from Ian Dall. +* Updated ns32k (pc532-mach, netbsd532) support from Ian Dall. Changes in 2.3: -Mach i386 support, by David Mackenzie and Ken Raeburn. - -RS/6000 and PowerPC support by Ian Taylor. +* Mach i386 support, by David Mackenzie and Ken Raeburn. -VMS command scripts (make-gas.com, config-gas.com) have been worked on a bit, -based on mail received from various people. The `-h#' option should work again -too. +* RS/6000 and PowerPC support by Ian Taylor. -HP-PA work, by Jeff Law. Note, for the PA, gas-2.3 has been designed to work -with gdb-4.12 and gcc-2.6. As gcc-2.6 has not been released yet, a special -version of gcc-2.5.8 has been patched to work with gas-2.3. You can retrieve -this special version of gcc-2.5.8 via anonymous ftp from jaguar.cs.utah.edu -in the "dist" directory. +* VMS command scripts (make-gas.com, config-gas.com) have been worked on a bit, + based on mail received from various people. The `-h#' option should work + again too. -Vax support in gas fixed for BSD, so it builds and seems to run a couple simple -tests okay. I haven't put it through extensive testing. (GNU make is -currently required for BSD 4.3 builds.) +* HP-PA work, by Jeff Law. Note, for the PA, gas-2.3 has been designed to work + with gdb-4.12 and gcc-2.6. As gcc-2.6 has not been released yet, a special + version of gcc-2.5.8 has been patched to work with gas-2.3. You can retrieve + this special version of gcc-2.5.8 via anonymous ftp from jaguar.cs.utah.edu + in the "dist" directory. -Support for the DEC Alpha, running OSF/1 (ECOFF format). The gas support is -based on code donated by CMU, which used an a.out-based format. I'm afraid the -alpha-a.out support is pretty badly mangled, and much of it removed; making it -work will require rewriting it as BFD support for the format anyways. +* Vax support in gas fixed for BSD, so it builds and seems to run a couple + simple tests okay. I haven't put it through extensive testing. (GNU make is + currently required for BSD 4.3 builds.) -Irix 5 support. +* Support for the DEC Alpha, running OSF/1 (ECOFF format). The gas support is + based on code donated by CMU, which used an a.out-based format. I'm afraid + the alpha-a.out support is pretty badly mangled, and much of it removed; + making it work will require rewriting it as BFD support for the format anyways. -The test suites have been fixed up a bit, so that they should work with a -couple different versions of expect and dejagnu. +* Irix 5 support. -Symbols' values are now handled internally as expressions, permitting more -flexibility in evaluating them in some cases. Some details of relocation -handling have also changed, and simple constant pool management has been added, -to make the Alpha port easier. +* The test suites have been fixed up a bit, so that they should work with a + couple different versions of expect and dejagnu. -New option "--statistics" for printing out program run times. This is intended -to be used with the gcc "-Q" option, which prints out times spent in various -phases of compilation. (You should be able to get all of them printed out with -"gcc -Q -Wa,--statistics", I think.) +* Symbols' values are now handled internally as expressions, permitting more + flexibility in evaluating them in some cases. Some details of relocation + handling have also changed, and simple constant pool management has been + added, to make the Alpha port easier. ----------------------------------------------------------------- +* New option "--statistics" for printing out program run times. This is + intended to be used with the gcc "-Q" option, which prints out times spent in + various phases of compilation. (You should be able to get all of them + printed out with "gcc -Q -Wa,--statistics", I think.) Changes in 2.2: -RS/6000 AIX and MIPS SGI Irix 5 support has been added. - -Configurations that are still in development (and therefore are convenient to -have listed in configure.in) still get rejected without a minor change to -gas/Makefile.in, so people not doing development work shouldn't get the -impression that support for such configurations is actually believed to be -reliable. +* RS/6000 AIX and MIPS SGI Irix 5 support has been added. -The program name (usually "as") is printed when a fatal error message is -displayed. This should prevent some confusion about the source of occasional -messages about "internal errors". +* Configurations that are still in development (and therefore are convenient to + have listed in configure.in) still get rejected without a minor change to + gas/Makefile.in, so people not doing development work shouldn't get the + impression that support for such configurations is actually believed to be + reliable. -ELF support is falling into place. Support for the 386 should be working. -Support for SPARC Solaris is in. HPPA support from Utah is being integrated. +* The program name (usually "as") is printed when a fatal error message is + displayed. This should prevent some confusion about the source of occasional + messages about "internal errors". -Symbol values are maintained as expressions instead of being immediately boiled -down to add-symbol, sub-symbol, and constant. This permits slightly more -complex calculations involving symbols whose values are not alreadey known. +* ELF support is falling into place. Support for the 386 should be working. + Support for SPARC Solaris is in. HPPA support from Utah is being integrated. -DBX-style debugging info ("stabs") is now supported for COFF formats. -If any stabs directives are seen in the source, GAS will create two new -sections: a ".stab" and a ".stabstr" section. The format of the .stab -section is nearly identical to the a.out symbol format, and .stabstr is -its string table. For this to be useful, you must have configured GCC -to generate stabs (by defining DBX_DEBUGGING_INFO), and must have a GDB -that can use the stab sections (4.11 or later). +* Symbol values are maintained as expressions instead of being immediately + boiled down to add-symbol, sub-symbol, and constant. This permits slightly + more complex calculations involving symbols whose values are not alreadey + known. -LynxOS, on i386 and m68k platforms, is now supported. SPARC LynxOS -support is in progress. +* DBX-style debugging info ("stabs") is now supported for COFF formats. + If any stabs directives are seen in the source, GAS will create two new + sections: a ".stab" and a ".stabstr" section. The format of the .stab + section is nearly identical to the a.out symbol format, and .stabstr is + its string table. For this to be useful, you must have configured GCC + to generate stabs (by defining DBX_DEBUGGING_INFO), and must have a GDB + that can use the stab sections (4.11 or later). ----------------------------------------------------------------- +* LynxOS, on i386 and m68k platforms, is now supported. SPARC LynxOS + support is in progress. Changes in 2.1: -Several small fixes for i386-aix (PS/2) support from Minh Tran-Le have been -incorporated, but not well tested yet. +* Several small fixes for i386-aix (PS/2) support from Minh Tran-Le have been + incorporated, but not well tested yet. -Altered the opcode table split for m68k; it should require less VM to compile -with gcc now. +* Altered the opcode table split for m68k; it should require less VM to compile + with gcc now. -Some minor adjustments to add (Convergent Technologies') Miniframe support, -suggested by Ronald Cole. +* Some minor adjustments to add (Convergent Technologies') Miniframe support, + suggested by Ronald Cole. -HPPA support (running OSF only, not HPUX) has been contributed by Utah. This -includes improved ELF support, which I've started adapting for SPARC Solaris -2.x. Integration isn't completely, so it probably won't work. +* HPPA support (running OSF only, not HPUX) has been contributed by Utah. This + includes improved ELF support, which I've started adapting for SPARC Solaris + 2.x. Integration isn't completely, so it probably won't work. -HP9000/300 support, donated by HP, has been merged in. +* HP9000/300 support, donated by HP, has been merged in. -Ian Taylor has finished the MIPS ECOFF (Ultrix, Irix) support. +* Ian Taylor has finished the MIPS ECOFF (Ultrix, Irix) support. -Better error messages for unsupported configurations (e.g., hppa-hpux). +* Better error messages for unsupported configurations (e.g., hppa-hpux). -Test suite framework is starting to become reasonable. - ----------------------------------------------------------------- +* Test suite framework is starting to become reasonable. Changes in 2.0: -Mostly bug fixes. - -Some more merging of BFD and ELF code, but ELF still doesn't work. +* Mostly bug fixes. ----------------------------------------------------------------- +* Some more merging of BFD and ELF code, but ELF still doesn't work. Changes in 1.94: -BFD merge is partly done. Adventurous souls may try giving configure the -"--with-bfd-assembler" option. Currently, ELF format requires it, a.out format -accepts it; SPARC CPU accepts it. It's the default only for OS "elf" or -"solaris". (ELF isn't really supported yet. It needs work. I've got some -code from Utah for HP-PA ELF, and from DG for m88k ELF, but they're not fully -merged yet.) - -The 68K opcode table has been split in half. It should now compile under gcc -without consuming ridiculous amounts of memory. +* BFD merge is partly done. Adventurous souls may try giving configure the + "--with-bfd-assembler" option. Currently, ELF format requires it, a.out + format accepts it; SPARC CPU accepts it. It's the default only for OS "elf" + or "solaris". (ELF isn't really supported yet. It needs work. I've got + some code from Utah for HP-PA ELF, and from DG for m88k ELF, but they're not + fully merged yet.) -A couple data structures have been reduced in size. This should result in -saving a little bit of space at runtime. +* The 68K opcode table has been split in half. It should now compile under gcc + without consuming ridiculous amounts of memory. -Support for MIPS, from OSF and Ralph Campbell, has been merged in. The OSF -code provided ROSE format support, which I haven't merged in yet. (I can make -it available, if anyone wants to try it out.) Ralph's code, for BSD 4.4, -supports a.out format. We don't have ECOFF support in just yet; it's coming. +* A couple data structures have been reduced in size. This should result in + saving a little bit of space at runtime. -Support for the Hitachi H8/500 has been added. +* Support for MIPS, from OSF and Ralph Campbell, has been merged in. The OSF + code provided ROSE format support, which I haven't merged in yet. (I can + make it available, if anyone wants to try it out.) Ralph's code, for BSD + 4.4, supports a.out format. We don't have ECOFF support in just yet; it's + coming. -VMS host and target support should be working now, thanks chiefly to Eric -Youngdale. +* Support for the Hitachi H8/500 has been added. ----------------------------------------------------------------- +* VMS host and target support should be working now, thanks chiefly to Eric + Youngdale. Changes in 1.93.01: -For m68k, support for more processors has been added: 68040, CPU32, 68851. +* For m68k, support for more processors has been added: 68040, CPU32, 68851. -For i386, .align is now power-of-two; was number-of-bytes. +* For i386, .align is now power-of-two; was number-of-bytes. -For m68k, "%" is now accepted before register names. For COFF format, which -doesn't use underscore prefixes for C labels, it is required, so variable "a0" -can be distinguished from the register. +* For m68k, "%" is now accepted before register names. For COFF format, which + doesn't use underscore prefixes for C labels, it is required, so variable "a0" + can be distinguished from the register. -Last public release was 1.38. Lots of configuration changes since then, lots -of new CPUs and formats, lots of bugs fixed. +* Last public release was 1.38. Lots of configuration changes since then, lots + of new CPUs and formats, lots of bugs fixed. Local variables: diff --git a/contrib/binutils/gas/README b/contrib/binutils/gas/README index ef12d3f..7905395 100644 --- a/contrib/binutils/gas/README +++ b/contrib/binutils/gas/README @@ -180,7 +180,7 @@ most of the above hosts, plus decstation-bsd (a.out format, to be used in BSD 4.4) ebmon29k go32 (DOS on i386, with DJGPP -- old a.out version) - h8/300, h8/500 (Hitachi) + H8/300, H8/500 (Hitachi) i386-aix (ps/2) i960-coff mips ecoff (decstation-ultrix, iris, mips magnum, mips-idt-ecoff) @@ -232,47 +232,10 @@ REPORTING BUGS IN GAS Bugs in gas should be reported to: - bug-gnu-utils@gnu.org. + bug-binutils@gnu.org. They may be cross-posted to gcc-bugs@gnu.org if they affect the use of gas with gcc. They should not be reported just to gcc-bugs, since not all of the maintainers read that list. -If you report a bug in GAS, please remember to include: - -A description of exactly what went wrong, and exactly what should have -happened instead. - -The type of machine (VAX, 68020, etc) and operating system (BSD, SunOS, DYNIX, -VMS, etc) GAS was running on. - -The configuration name(s) given to the "configure" script. The -"config.status" file should have this information. - -The options given to GAS at run time. - -The actual input file that caused the problem. - -It is silly to report a bug in GAS without including an input file for GAS. -Don't ask us to generate the file just because you made it from files you -think we have access to. - -1. You might be mistaken. -2. It might take us a lot of time to install things to regenerate that file. -3. We might get a different file from the one you got, and might not see any - bug. - -To save us these delays and uncertainties, always send the input file for the -program that failed. A smaller test case that demonstrates the problem is of -course preferable, but be sure it is a complete input file, and that it really -does demonstrate the problem; but if paring it down would cause large delays -in filing the bug report, don't bother. - -If the input file is very large, and you are on the internet, you may want to -make it available for anonymous FTP instead of mailing it. If you do, include -instructions for FTP'ing it in your bug report. - -If you expect to be contributing a large number of test cases, it would be -helpful if you would look at the test suite included in the release (based on -the Deja Gnu testing framework, available from the usual ftp sites) and write -test cases to fit into that framework. This is certainly not required. +See ../binutils/README for what we need in a bug report. diff --git a/contrib/binutils/gas/acinclude.m4 b/contrib/binutils/gas/acinclude.m4 index f16eefc..4a3ccf3 100644 --- a/contrib/binutils/gas/acinclude.m4 +++ b/contrib/binutils/gas/acinclude.m4 @@ -1,5 +1,5 @@ dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers) -AC_DEFUN(GAS_CHECK_DECL_NEEDED,[ +AC_DEFUN([GAS_CHECK_DECL_NEEDED],[ AC_MSG_CHECKING(whether declaration is required for $1) AC_CACHE_VAL(gas_cv_decl_needed_$1, AC_TRY_LINK([$4], @@ -19,7 +19,7 @@ dnl Some non-ANSI preprocessors botch requoting inside strings. That's bad dnl enough, but on some of those systems, the assert macro relies on requoting dnl working properly! dnl GAS_WORKING_ASSERT -AC_DEFUN(GAS_WORKING_ASSERT, +AC_DEFUN([GAS_WORKING_ASSERT], [AC_MSG_CHECKING([for working assert macro]) AC_CACHE_VAL(gas_cv_assert_ok, AC_TRY_LINK([#include @@ -39,7 +39,7 @@ dnl dnl Since many Bourne shell implementations lack subroutines, use this dnl hack to simplify the code in configure.in. dnl GAS_UNIQ(listvar) -AC_DEFUN(GAS_UNIQ, +AC_DEFUN([GAS_UNIQ], [_gas_uniq_list="[$]$1" _gas_uniq_newlist="" dnl Protect against empty input list. diff --git a/contrib/binutils/gas/aclocal.m4 b/contrib/binutils/gas/aclocal.m4 index c936be4..c5ef088 100644 --- a/contrib/binutils/gas/aclocal.m4 +++ b/contrib/binutils/gas/aclocal.m4 @@ -1,143 +1,949 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p5 - -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. - -dnl GAS_CHECK_DECL_NEEDED(name, typedefname, typedef, headers) -AC_DEFUN(GAS_CHECK_DECL_NEEDED,[ -AC_MSG_CHECKING(whether declaration is required for $1) -AC_CACHE_VAL(gas_cv_decl_needed_$1, -AC_TRY_LINK([$4], -[ -typedef $3; -$2 x; -x = ($2) $1; -], gas_cv_decl_needed_$1=no, gas_cv_decl_needed_$1=yes))dnl -AC_MSG_RESULT($gas_cv_decl_needed_$1) -if test $gas_cv_decl_needed_$1 = yes; then - AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), 1, - [Define if $1 is not declared in system header files.]) +# generated automatically by aclocal 1.8.4 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# -*- Autoconf -*- +# Copyright (C) 2002, 2003 Free Software Foundation, Inc. +# Generated from amversion.in; do not edit by hand. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"]) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION so it can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], + [AM_AUTOMAKE_VERSION([1.8.4])]) + +# AM_AUX_DIR_EXPAND + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 6 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE]) +AC_SUBST([$1_FALSE]) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= fi -])dnl -dnl -dnl Some non-ANSI preprocessors botch requoting inside strings. That's bad -dnl enough, but on some of those systems, the assert macro relies on requoting -dnl working properly! -dnl GAS_WORKING_ASSERT -AC_DEFUN(GAS_WORKING_ASSERT, -[AC_MSG_CHECKING([for working assert macro]) -AC_CACHE_VAL(gas_cv_assert_ok, -AC_TRY_LINK([#include -#include ], [ -/* check for requoting problems */ -static int a, b, c, d; -static char *s; -assert (!strcmp(s, "foo bar baz quux")); -/* check for newline handling */ -assert (a == b - || c == d); -], gas_cv_assert_ok=yes, gas_cv_assert_ok=no))dnl -AC_MSG_RESULT($gas_cv_assert_ok) -test $gas_cv_assert_ok = yes || AC_DEFINE(BROKEN_ASSERT, 1, [assert broken?]) -])dnl -dnl -dnl Since many Bourne shell implementations lack subroutines, use this -dnl hack to simplify the code in configure.in. -dnl GAS_UNIQ(listvar) -AC_DEFUN(GAS_UNIQ, -[_gas_uniq_list="[$]$1" -_gas_uniq_newlist="" -dnl Protect against empty input list. -for _gas_uniq_i in _gas_uniq_dummy [$]_gas_uniq_list ; do - case [$]_gas_uniq_i in - _gas_uniq_dummy) ;; - *) case " [$]_gas_uniq_newlist " in - *" [$]_gas_uniq_i "*) ;; - *) _gas_uniq_newlist="[$]_gas_uniq_newlist [$]_gas_uniq_i" ;; - esac ;; - esac -done -$1=[$]_gas_uniq_newlist -])dnl - -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) +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]) +fi])]) + +# serial 7 -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) -sinclude(../gettext.m4) -ifelse(yes,no,[ -AC_DEFUN([CY_WITH_NLS],) -AC_SUBST(INTLLIBS) + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) -# Do all the work for Automake. This macro actually does too much -- -# some checks are only needed if your package does certain things. -# But this isn't really a big deal. -# serial 1 +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH]) +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +#serial 2 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 7 + +# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS. +AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)]) + +# Do all the work for Automake. -*- Autoconf -*- + +# 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. + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. -dnl Usage: -dnl AM_INIT_AUTOMAKE(package,version, [no-define]) +# 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. +# serial 11 + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_REQUIRE([AC_PROG_INSTALL]) -PACKAGE=[$1] -AC_SUBST(PACKAGE) -VERSION=[$2] -AC_SUBST(VERSION) -dnl test to see if srcdir already configured -if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then +[AC_PREREQ([2.58])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi -ifelse([$3],, -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) -AC_REQUIRE([AM_SANITY_CHECK]) -AC_REQUIRE([AC_ARG_PROGRAM]) -dnl FIXME This is truly gross. -missing_dir=`cd $ac_aux_dir && pwd` -AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) -AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) -AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) -AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) -AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) -AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG(AMTAR, tar) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl + +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $1 | $1:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count]) + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. + +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"$am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# -*- Autoconf -*- +# Copyright (C) 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 1 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + + +# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 4 + +# AM_PROG_LEX +# ----------- +# Autoconf leaves LEX=: if lex or flex can't be found. Change that to a +# "missing" invocation, for better error output. +AC_DEFUN([AM_PROG_LEX], +[AC_PREREQ(2.50)dnl +AC_REQUIRE([AM_MISSING_HAS_RUN])dnl +AC_REQUIRE([AC_PROG_LEX])dnl +if test "$LEX" = :; then + LEX=${am_missing_run}flex +fi]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004 +# Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +AC_DEFUN([AM_MAINTAINER_MODE], +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# -*- Autoconf -*- + + +# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# AM_PROG_MKDIR_P +# --------------- +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise. + +# Copyright (C) 2003, 2004 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories +# created by `make install' are always world readable, even if the +# installer happens to have an overly restrictive umask (e.g. 077). +# This was a mistake. There are at least two reasons why we must not +# use `-m 0755': +# - it causes special bits like SGID to be ignored, +# - it may be too restrictive (some setups expect 775 directories). +# +# Do not use -m 0755 and let people choose whatever they expect by +# setting umask. +# +# We cannot accept any implementation of `mkdir' that recognizes `-p'. +# Some implementations (such as Solaris 8's) are not thread-safe: if a +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c' +# concurrently, both version can detect that a/ is missing, but only +# one can create it and the other will error out. Consequently we +# restrict ourselves to GNU make (using the --version option ensures +# this.) +AC_DEFUN([AM_PROG_MKDIR_P], +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # Keeping the `.' argument allows $(mkdir_p) to be used without + # argument. Indeed, we sometimes output rules like + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. + # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more + # expensive solution, as it forces Make to start a sub-shell.) + mkdir_p='mkdir -p -- .' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi +AC_SUBST([mkdir_p])]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 2 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # # Check to make sure that the build environment is sane. # +# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +# serial 3 + +# AM_SANITY_CHECK +# --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 -echo timestamp > conftestfile +echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` - if test "[$]*" = "X"; then + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` + set X `ls -t $srcdir/configure conftest.file` fi - if test "[$]*" != "X $srcdir/configure conftestfile" \ - && test "[$]*" != "X conftestfile $srcdir/configure"; then + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a @@ -147,7 +953,7 @@ if ( alias in your environment]) fi - test "[$]2" = conftestfile + test "$[2]" = conftest.file ) then # Ok. @@ -156,87 +962,45 @@ else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -rm -f conftest* AC_MSG_RESULT(yes)]) -dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) -dnl The program must properly implement --version. -AC_DEFUN([AM_MISSING_PROG], -[AC_MSG_CHECKING(for working $2) -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if ($2 --version) < /dev/null > /dev/null 2>&1; then - $1=$2 - AC_MSG_RESULT(found) -else - $1="$3/missing $2" - AC_MSG_RESULT(missing) -fi -AC_SUBST($1)]) - -# Like AC_CONFIG_HEADER, but automatically create stamp file. - -AC_DEFUN([AM_CONFIG_HEADER], -[AC_PREREQ([2.12]) -AC_CONFIG_HEADER([$1]) -dnl When config.status generates a header, we must update the stamp-h file. -dnl This file resides in the same directory as the config header -dnl that is generated. We must strip everything past the first ":", -dnl and everything past the last "/". -AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl -ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, -<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, -<>; do - case " <<$>>CONFIG_HEADERS " in - *" <<$>>am_file "*<<)>> - echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx - ;; - esac - am_indx=`expr "<<$>>am_indx" + 1` -done<<>>dnl>>) -changequote([,]))]) - +# AM_PROG_INSTALL_STRIP -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]) - -# Add --enable-maintainer-mode option to configure. -# From Jim Meyering +# Copyright (C) 2001, 2003 Free Software Foundation, Inc. -# serial 1 +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. -AC_DEFUN([AM_MAINTAINER_MODE], -[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -[ --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer], - USE_MAINTAINER_MODE=$enableval, - USE_MAINTAINER_MODE=no) - AC_MSG_RESULT($USE_MAINTAINER_MODE) - AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST(MAINT)dnl -] -) +# 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. -# Define a conditional. +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. -AC_DEFUN([AM_CONDITIONAL], -[AC_SUBST($1_TRUE) -AC_SUBST($1_FALSE) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi]) +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) +m4_include([acinclude.m4]) diff --git a/contrib/binutils/gas/app.c b/contrib/binutils/gas/app.c index f9c5c7d..1dbc49a 100644 --- a/contrib/binutils/gas/app.c +++ b/contrib/binutils/gas/app.c @@ -1,6 +1,6 @@ /* This is the Assembler Pre-Processor Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000 + 1999, 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -20,14 +20,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Modified by Allen Wirfs-Brock, Instantiations Inc 2/90 */ +/* Modified by Allen Wirfs-Brock, Instantiations Inc 2/90. */ /* App, the assembler pre-processor. This pre-processor strips out excess spaces, turns single-quoted characters into a decimal constant, and turns # into a .line \n.file pair. This needs better error-handling. */ #include -#include "as.h" /* For BAD_CASE() only */ +#include "as.h" /* For BAD_CASE() only. */ #if (__STDC__ != 1) #ifndef const @@ -87,15 +87,14 @@ static const char symbol_chars[] = #define IS_LINE_COMMENT(c) (lex[c] == LEX_IS_LINE_COMMENT_START) #define IS_NEWLINE(c) (lex[c] == LEX_IS_NEWLINE) -static int process_escape PARAMS ((int)); +static int process_escape (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. */ void -do_scrub_begin (m68k_mri) - int m68k_mri ATTRIBUTE_UNUSED; +do_scrub_begin (int m68k_mri ATTRIBUTE_UNUSED) { const char *p; int c; @@ -115,7 +114,7 @@ do_scrub_begin (m68k_mri) lex['"'] = LEX_IS_STRINGQUOTE; #if ! defined (TC_HPPA) && ! defined (TC_I370) - /* I370 uses single-quotes to delimit integer, float constants */ + /* I370 uses single-quotes to delimit integer, float constants. */ lex['\''] = LEX_IS_ONECHAR_QUOTE; #endif @@ -130,9 +129,7 @@ do_scrub_begin (m68k_mri) /* Note that these override the previous defaults, e.g. if ';' is a comment char, then it isn't a line separator. */ for (p = symbol_chars; *p; ++p) - { - lex[(unsigned char) *p] = LEX_IS_SYMBOL_COMPONENT; - } /* declare symbol characters */ + lex[(unsigned char) *p] = LEX_IS_SYMBOL_COMPONENT; for (c = 128; c < 256; ++c) lex[c] = LEX_IS_SYMBOL_COMPONENT; @@ -152,35 +149,25 @@ do_scrub_begin (m68k_mri) #define tc_comment_chars comment_chars #endif for (p = tc_comment_chars; *p; p++) - { - lex[(unsigned char) *p] = LEX_IS_COMMENT_START; - } /* declare comment chars */ + lex[(unsigned char) *p] = LEX_IS_COMMENT_START; for (p = line_comment_chars; *p; p++) - { - lex[(unsigned char) *p] = LEX_IS_LINE_COMMENT_START; - } /* declare line comment chars */ + lex[(unsigned char) *p] = LEX_IS_LINE_COMMENT_START; for (p = line_separator_chars; *p; p++) - { - lex[(unsigned char) *p] = LEX_IS_LINE_SEPARATOR; - } /* declare line separators */ + lex[(unsigned char) *p] = LEX_IS_LINE_SEPARATOR; #ifdef tc_parallel_separator_chars /* This macro permits the processor to specify all characters which separate parallel insns on the same line. */ for (p = tc_parallel_separator_chars; *p; p++) - { - lex[(unsigned char) *p] = LEX_IS_PARALLEL_SEPARATOR; - } /* declare parallel separators */ + lex[(unsigned char) *p] = LEX_IS_PARALLEL_SEPARATOR; #endif /* Only allow slash-star comments if slash is not in use. FIXME: This isn't right. We should always permit them. */ if (lex['/'] == 0) - { - lex['/'] = LEX_IS_TWOCHAR_COMMENT_1ST; - } + lex['/'] = LEX_IS_TWOCHAR_COMMENT_1ST; #ifdef TC_M68K if (m68k_mri) @@ -189,7 +176,7 @@ do_scrub_begin (m68k_mri) lex[';'] = LEX_IS_COMMENT_START; lex['*'] = LEX_IS_LINE_COMMENT_START; /* The MRI documentation says '!' is LEX_IS_COMMENT_START, but - then it can't be used in an expression. */ + then it can't be used in an expression. */ lex['!'] = LEX_IS_LINE_COMMENT_START; } #endif @@ -201,12 +188,12 @@ do_scrub_begin (m68k_mri) lex['|'] = LEX_IS_DOUBLEBAR_1ST; #endif #ifdef TC_D30V - /* must do this is we want VLIW instruction with "->" or "<-" */ + /* Must do this is we want VLIW instruction with "->" or "<-". */ lex['-'] = LEX_IS_SYMBOL_COMPONENT; #endif -} /* do_scrub_begin() */ +} -/* Saved state of the scrubber */ +/* Saved state of the scrubber. */ static int state; static int old_state; static char *out_string; @@ -223,7 +210,8 @@ 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 { +struct app_save +{ int state; int old_state; char * out_string; @@ -242,7 +230,7 @@ struct app_save { }; char * -app_push () +app_push (void) { register struct app_save *saved; @@ -278,8 +266,7 @@ app_push () } void -app_pop (arg) - char *arg; +app_pop (char *arg) { register struct app_save *saved = (struct app_save *) arg; @@ -309,13 +296,13 @@ app_pop (arg) #endif free (arg); -} /* app_pop() */ +} /* @@ This assumes that \n &c are the same on host and target. This is not necessarily true. */ + static int -process_escape (ch) - int ch; +process_escape (int ch) { switch (ch) { @@ -350,10 +337,7 @@ process_escape (ch) This is the way the old code used to work. */ int -do_scrub_chars (get, tostart, tolen) - int (*get) PARAMS ((char *, int)); - char *tostart; - int tolen; +do_scrub_chars (int (*get) (char *, int), char *tostart, int tolen) { char *to = tostart; char *toend = tostart + tolen; @@ -377,10 +361,18 @@ do_scrub_chars (get, tostart, tolen) -1: output string in out_string and go to the state in old_state -2: flush text until a '*' '/' is seen, then go to state old_state #ifdef TC_V850 - 12: After seeing a dash, looking for a second dash as a start of comment. + 12: After seeing a dash, looking for a second dash as a start + of comment. #endif #ifdef DOUBLEBAR_PARALLEL - 13: After seeing a vertical bar, looking for a second vertical bar as a parallel expression seperator. + 13: After seeing a vertical bar, looking for a second + vertical bar as a parallel expression separator. +#endif +#ifdef TC_IA64 + 14: After seeing a `(' at state 0, looking for a `)' as + predicate. + 15: After seeing a `(' at state 1, looking for a `)' as + predicate. #endif */ @@ -450,8 +442,8 @@ do_scrub_chars (get, tostart, tolen) while (1) { /* The cases in this switch end with continue, in order to - branch back to the top of this while loop and generate the - next output character in the appropriate state. */ + branch back to the top of this while loop and generate the + next output character in the appropriate state. */ switch (state) { case -1: @@ -534,9 +526,9 @@ do_scrub_chars (get, tostart, tolen) case 5: /* We are going to copy everything up to a quote character, - with special handling for a backslash. We try to - optimize the copying in the simple case without using the - GET and PUT macros. */ + with special handling for a backslash. We try to + optimize the copying in the simple case without using the + GET and PUT macros. */ { char *s; int len; @@ -545,7 +537,7 @@ do_scrub_chars (get, tostart, tolen) { ch = *s; /* This condition must be changed if the type of any - other character can be LEX_IS_STRINGQUOTE. */ + other character can be LEX_IS_STRINGQUOTE. */ if (ch == '\\' || ch == '"' || ch == '\'' @@ -586,8 +578,7 @@ do_scrub_chars (get, tostart, tolen) else if (scrub_m68k_mri && ch == '\n') { /* Just quietly terminate the string. This permits lines like - bne label loop if we haven't reach end yet - */ + bne label loop if we haven't reach end yet. */ state = old_state; UNGET (ch); PUT ('\''); @@ -611,6 +602,11 @@ do_scrub_chars (get, tostart, tolen) PUT ('\\'); continue; + case EOF: + as_warn (_("end of file in string; '\"' inserted")); + PUT ('"'); + continue; + case '"': case '\\': case 'b': @@ -630,20 +626,12 @@ do_scrub_chars (get, tostart, tolen) case '6': case '7': break; -#if defined(IGNORE_NONSTANDARD_ESCAPES) | defined(ONLY_STANDARD_ESCAPES) + default: +#ifdef ONLY_STANDARD_ESCAPES as_warn (_("unknown escape '\\%c' in string; ignored"), ch); +#endif break; -#else /* ONLY_STANDARD_ESCAPES */ - default: - /* Accept \x as x for any x */ - break; -#endif /* ONLY_STANDARD_ESCAPES */ - - case EOF: - as_warn (_("end of file in string; '\"' inserted")); - PUT ('"'); - continue; } PUT (ch); continue; @@ -666,13 +654,49 @@ do_scrub_chars (get, tostart, tolen) state = 0; PUT (ch); continue; + +#ifdef DOUBLEBAR_PARALLEL + case 13: + ch = GET (); + if (ch != '|') + abort (); + + /* Reset back to state 1 and pretend that we are parsing a + line from just after the first white space. */ + state = 1; + PUT ('|'); + continue; +#endif } - /* OK, we are somewhere in states 0 through 4 or 9 through 11 */ + /* OK, we are somewhere in states 0 through 4 or 9 through 11. */ /* flushchar: */ ch = GET (); +#ifdef TC_IA64 + if (ch == '(' && (state == 0 || state == 1)) + { + state += 14; + PUT (ch); + continue; + } + else if (state == 14 || state == 15) + { + if (ch == ')') + { + state -= 14; + PUT (ch); + ch = GET (); + } + else + { + PUT (ch); + continue; + } + } +#endif + recycle: #if defined TC_ARM && defined OBJ_ELF @@ -706,9 +730,9 @@ do_scrub_chars (get, tostart, tolen) #ifdef TC_M68K /* We want to have pseudo-ops which control whether we are in - MRI mode or not. Unfortunately, since m68k MRI mode affects - the scrubber, that means that we need a special purpose - recognizer here. */ + MRI mode or not. Unfortunately, since m68k MRI mode affects + the scrubber, that means that we need a special purpose + recognizer here. */ if (mri_state == NULL) { if ((state == 0 || state == 1) @@ -745,14 +769,14 @@ do_scrub_chars (get, tostart, tolen) else { /* We've read the entire pseudo-op. mips_last_ch is - either '0' or '1' indicating whether to enter or - leave MRI mode. */ + either '0' or '1' indicating whether to enter or + leave MRI mode. */ do_scrub_begin (mri_last_ch == '1'); mri_state = NULL; /* We continue handling the character as usual. The - main gas reader must also handle the .mri pseudo-op - to control expression parsing and the like. */ + main gas reader must also handle the .mri pseudo-op + to control expression parsing and the like. */ } } #endif @@ -793,7 +817,7 @@ do_scrub_chars (get, tostart, tolen) if (lex[ch] == LEX_IS_COLON) { /* Only keep this white if there's no white *after* the - colon. */ + colon. */ ch2 = GET (); UNGET (ch2); if (!IS_WHITESPACE (ch2)) @@ -881,9 +905,9 @@ do_scrub_chars (get, tostart, tolen) else { /* We know that ch is not ':', since we tested that - case above. Therefore this is not a label, so it - must be the opcode, and we've just seen the - whitespace after it. */ + case above. Therefore this is not a label, so it + must be the opcode, and we've just seen the + whitespace after it. */ state = 3; } UNGET (ch); @@ -915,7 +939,7 @@ do_scrub_chars (get, tostart, tolen) break; /* This UNGET will ensure that we count newlines - correctly. */ + correctly. */ UNGET (ch2); } @@ -953,13 +977,13 @@ do_scrub_chars (get, tostart, tolen) case LEX_IS_STRINGQUOTE: if (state == 10) { - /* Preserve the whitespace in foo "bar" */ + /* Preserve the whitespace in foo "bar". */ UNGET (ch); state = 3; PUT (' '); /* PUT didn't jump out. We could just break, but we - know what will happen, so optimize a bit. */ + know what will happen, so optimize a bit. */ ch = GET (); old_state = 3; } @@ -975,7 +999,7 @@ do_scrub_chars (get, tostart, tolen) case LEX_IS_ONECHAR_QUOTE: if (state == 10) { - /* Preserve the whitespace in foo 'b' */ + /* Preserve the whitespace in foo 'b'. */ UNGET (ch); state = 3; PUT (' '); @@ -1070,10 +1094,10 @@ do_scrub_chars (get, tostart, tolen) ch = GET (); } while (ch != EOF && ch != '\n'); + if (ch == EOF) - { - as_warn (_("end of file in comment; newline inserted")); - } + as_warn (_("end of file in comment; newline inserted")); + state = 0; PUT ('\n'); break; @@ -1081,15 +1105,14 @@ do_scrub_chars (get, tostart, tolen) #ifdef DOUBLEBAR_PARALLEL case LEX_IS_DOUBLEBAR_1ST: ch2 = GET (); + UNGET (ch2); if (ch2 != '|') - { - UNGET (ch2); - goto de_fault; - } - /* Reset back to state 1 and pretend that we are parsing a line from - just after the first white space. */ - state = 1; - PUT ('|'); + goto de_fault; + + /* Handle '||' in two states as invoking PUT twice might + result in the first one jumping out of this loop. We'd + then lose track of the state and one '|' char. */ + state = 13; PUT ('|'); break; #endif @@ -1111,7 +1134,7 @@ do_scrub_chars (get, tostart, tolen) { UNGET (ch2); } - } /* bad hack */ + } if (state == 0 || state == 1) /* Only comment at start of line. */ { @@ -1124,12 +1147,14 @@ do_scrub_chars (get, tostart, tolen) ch = GET (); } while (ch != EOF && IS_WHITESPACE (ch)); + if (ch == EOF) { as_warn (_("end of file in comment; newline inserted")); PUT ('\n'); break; } + if (ch < '0' || ch > '9' || state != 0 || startch != '#') { /* Not a cpp line. */ @@ -1222,7 +1247,7 @@ do_scrub_chars (get, tostart, tolen) state = 9; /* This is a common case. Quickly copy CH and all the - following symbol component or normal characters. */ + following symbol component or normal characters. */ if (to + 1 < toend && mri_state == NULL #if defined TC_ARM && defined OBJ_ELF @@ -1243,15 +1268,17 @@ do_scrub_chars (get, tostart, tolen) && type != LEX_IS_SYMBOL_COMPONENT) break; } + if (s > from) - { - /* Handle the last character normally, for - simplicity. */ - --s; - } + /* Handle the last character normally, for + simplicity. */ + --s; + len = s - from; + if (len > (toend - to) - 1) len = (toend - to) - 1; + if (len > 0) { PUT (ch); @@ -1285,15 +1312,15 @@ do_scrub_chars (get, tostart, tolen) /* Some relatively `normal' character. */ if (state == 0) { - state = 11; /* Now seeing label definition */ + state = 11; /* Now seeing label definition. */ } else if (state == 1) { - state = 2; /* Ditto */ + state = 2; /* Ditto. */ } else if (state == 9) { - if (lex[ch] != LEX_IS_SYMBOL_COMPONENT) + if (!IS_SYMBOL_COMPONENT (ch)) state = 3; } else if (state == 10) @@ -1342,4 +1369,3 @@ do_scrub_chars (get, tostart, tolen) return to - tostart; } -/* end of app.c */ diff --git a/contrib/binutils/gas/as.c b/contrib/binutils/gas/as.c index 346ecc8..0911aa1 100644 --- a/contrib/binutils/gas/as.c +++ b/contrib/binutils/gas/as.c @@ -21,16 +21,15 @@ 02111-1307, USA. */ /* 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. - */ + 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" @@ -42,6 +41,11 @@ #include "sb.h" #include "macro.h" #include "dwarf2dbg.h" +#include "dw2gencfi.h" + +#ifdef BFD_ASSEMBLER +#include "bfdver.h" +#endif #ifdef HAVE_ITBL_CPU #include "itbl-ops.h" @@ -56,31 +60,40 @@ extern PTR sbrk (); #endif #endif -static void show_usage PARAMS ((FILE *)); -static void parse_args PARAMS ((int *, char ***)); -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 *)); +#ifdef USING_CGEN +/* Perform any cgen specific initialisation for gas. */ +extern void gas_cgen_begin (void); +#endif + +/* Keep a record of the itbl files we read in. */ +struct itbl_file_list +{ + struct itbl_file_list *next; + char *name; +}; + +/* 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 *next; + char *name; + valueT value; +}; + /* True if a listing is wanted. */ int listing; -/* Name of listing file. */ -static char *listing_filename = NULL; - /* Type of debugging to generate. */ - enum debug_info_type debug_type = DEBUG_UNSPECIFIED; +int use_gnu_debug_info_extensions = 0; /* Maximum level of macro nesting. */ int max_macro_nest = 100; /* argv[0] */ -char *myname; -#ifdef BFD_ASSEMBLER -segT reg_section, expr_section; -segT text_section, data_section, bss_section; -#endif +char * myname; /* The default obstack chunk size. If we set this to zero, the obstack code will use whatever will fit in a 4096 byte block. */ @@ -90,25 +103,26 @@ int chunksize = 0; Then the chunk sizes for gas and bfd will be reduced. */ int debug_memory = 0; -/* We build a list of defsyms as we read the options, and then define - them after we have initialized everything. */ +/* Enable verbose mode. */ +int verbose = 0; -struct defsym_list { - struct defsym_list *next; - char *name; - valueT value; -}; +#ifdef BFD_ASSEMBLER +segT reg_section; +segT expr_section; +segT text_section; +segT data_section; +segT bss_section; +#endif + +/* Name of listing file. */ +static char *listing_filename = NULL; static struct defsym_list *defsyms; -/* Keep a record of the itbl files we read in. */ +static struct itbl_file_list *itbl_files; -struct itbl_file_list { - struct itbl_file_list *next; - char *name; -}; +static long start_time; -static struct itbl_file_list *itbl_files; #ifdef USE_EMULATIONS #define EMULATION_ENVIRON "AS_EMULATION" @@ -121,12 +135,8 @@ extern struct emulation crisaout, criself; static struct emulation *const emulations[] = { EMULATIONS }; static const int n_emulations = sizeof (emulations) / sizeof (emulations[0]); -static void select_emulation_mode PARAMS ((int, char **)); - static void -select_emulation_mode (argc, argv) - int argc; - char **argv; +select_emulation_mode (int argc, char **argv) { int i; char *p, *em = 0; @@ -170,14 +180,14 @@ select_emulation_mode (argc, argv) } const char * -default_emul_bfd_name () +default_emul_bfd_name (void) { abort (); return NULL; } void -common_emul_init () +common_emul_init (void) { this_format = this_emulation->format; @@ -199,9 +209,10 @@ common_emul_init () #endif void -print_version_id () +print_version_id (void) { static int printed; + if (printed) return; printed = 1; @@ -216,8 +227,7 @@ print_version_id () } static void -show_usage (stream) - FILE *stream; +show_usage (FILE * stream) { fprintf (stream, _("Usage: %s [option...] [asmfile...]\n"), myname); @@ -256,11 +266,19 @@ Options:\n\ emulate output (default %s)\n"), def_em); } #endif +#if defined BFD_ASSEMBLER && (defined OBJ_ELF || defined OBJ_MAYBE_ELF) + fprintf (stream, _("\ + --execstack require executable stack for this object\n")); + fprintf (stream, _("\ + --noexecstack don't require executable stack for this object\n")); +#endif fprintf (stream, _("\ -f skip whitespace and comment preprocessing\n")); fprintf (stream, _("\ --gstabs generate stabs debugging information\n")); fprintf (stream, _("\ + --gstabs+ generate stabs debug info with GNU extensions\n")); + fprintf (stream, _("\ --gdwarf2 generate DWARF2 debugging information\n")); fprintf (stream, _("\ --help show this message and exit\n")); @@ -337,60 +355,84 @@ Options:\n\ md_parse_option definitions in config/tc-*.c. */ static void -parse_args (pargc, pargv) - int *pargc; - char ***pargv; +parse_args (int * pargc, char *** pargv) { - int old_argc, new_argc; - char **old_argv, **new_argv; - + int old_argc; + int new_argc; + char ** old_argv; + char ** new_argv; /* Starting the short option string with '-' is for programs that expect options and other ARGV-elements in any order and that care about the ordering of the two. We describe each non-option ARGV-element as if it were the argument of an option with character code 1. */ - char *shortopts; extern const char *md_shortopts; - static const char std_shortopts[] = { + static const char std_shortopts[] = + { '-', 'J', #ifndef WORKING_DOT_WORD /* -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', 'a', ':', ':', 'D', 'f', 'I', ':', 'o', ':', #ifndef VMS /* -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) */ + /* 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; - static const struct option std_longopts[] = { -#define OPTION_HELP (OPTION_STD_BASE) + /* Codes used for the long options with no short synonyms. */ + enum option_values + { + OPTION_HELP = OPTION_STD_BASE, + OPTION_NOCPP, + OPTION_STATISTICS, + OPTION_VERSION, + OPTION_DUMPCONFIG, + OPTION_VERBOSE, + OPTION_EMULATION, + OPTION_DEFSYM, + OPTION_INSTTBL, + OPTION_LISTING_LHS_WIDTH, + OPTION_LISTING_LHS_WIDTH2, + OPTION_LISTING_RHS_WIDTH, + OPTION_LISTING_CONT_LINES, + OPTION_DEPFILE, + OPTION_GSTABS, + OPTION_GSTABS_PLUS, + OPTION_STRIP_LOCAL_ABSOLUTE, + OPTION_TRADITIONAL_FORMAT, + OPTION_GDWARF2, + OPTION_WARN, + OPTION_TARGET_HELP, + OPTION_EXECSTACK, + OPTION_NOEXECSTACK, + OPTION_WARN_FATAL + }; + + static const struct option std_longopts[] = + { {"help", no_argument, NULL, OPTION_HELP}, + /* getopt allows abbreviations, so we do this to stop it from + treating -k as an abbreviation for --keep-locals. Some + ports use -k to enable PIC assembly. */ + {"keep-locals", no_argument, NULL, 'L'}, {"keep-locals", no_argument, NULL, 'L'}, {"mri", no_argument, NULL, 'M'}, -#define OPTION_NOCPP (OPTION_STD_BASE + 1) {"nocpp", no_argument, NULL, OPTION_NOCPP}, -#define OPTION_STATISTICS (OPTION_STD_BASE + 2) {"statistics", no_argument, NULL, OPTION_STATISTICS}, -#define OPTION_VERSION (OPTION_STD_BASE + 3) {"version", no_argument, NULL, OPTION_VERSION}, -#define OPTION_DUMPCONFIG (OPTION_STD_BASE + 4) {"dump-config", no_argument, NULL, OPTION_DUMPCONFIG}, -#define OPTION_VERBOSE (OPTION_STD_BASE + 5) {"verbose", no_argument, NULL, OPTION_VERBOSE}, -#define OPTION_EMULATION (OPTION_STD_BASE + 6) {"emulation", required_argument, NULL, OPTION_EMULATION}, -#define OPTION_DEFSYM (OPTION_STD_BASE + 7) {"defsym", required_argument, NULL, OPTION_DEFSYM}, -#define OPTION_INSTTBL (OPTION_STD_BASE + 8) /* New option for extending instruction set (see also -t above). The "-t file" or "--itbl file" option extends the basic set of valid instructions by reading "file", a text file containing a @@ -398,30 +440,23 @@ parse_args (pargc, pargv) formats are added to the built-in set of instructions, and mnemonics for new registers may also be defined. */ {"itbl", required_argument, NULL, OPTION_INSTTBL}, -#define OPTION_LISTING_LHS_WIDTH (OPTION_STD_BASE + 9) {"listing-lhs-width", required_argument, NULL, OPTION_LISTING_LHS_WIDTH}, -#define OPTION_LISTING_LHS_WIDTH2 (OPTION_STD_BASE + 10) {"listing-lhs-width2", required_argument, NULL, OPTION_LISTING_LHS_WIDTH2}, -#define OPTION_LISTING_RHS_WIDTH (OPTION_STD_BASE + 11) {"listing-rhs-width", required_argument, NULL, OPTION_LISTING_RHS_WIDTH}, -#define OPTION_LISTING_CONT_LINES (OPTION_STD_BASE + 12) {"listing-cont-lines", required_argument, NULL, OPTION_LISTING_CONT_LINES}, -#define OPTION_DEPFILE (OPTION_STD_BASE + 13) {"MD", required_argument, NULL, OPTION_DEPFILE}, -#define OPTION_GSTABS (OPTION_STD_BASE + 14) {"gstabs", no_argument, NULL, OPTION_GSTABS}, -#define OPTION_STRIP_LOCAL_ABSOLUTE (OPTION_STD_BASE + 15) + {"gstabs+", no_argument, NULL, OPTION_GSTABS_PLUS}, {"strip-local-absolute", no_argument, NULL, OPTION_STRIP_LOCAL_ABSOLUTE}, -#define OPTION_TRADITIONAL_FORMAT (OPTION_STD_BASE + 16) {"traditional-format", no_argument, NULL, OPTION_TRADITIONAL_FORMAT}, -#define OPTION_GDWARF2 (OPTION_STD_BASE + 17) {"gdwarf2", no_argument, NULL, OPTION_GDWARF2}, {"no-warn", no_argument, NULL, 'W'}, -#define OPTION_WARN (OPTION_STD_BASE + 18) {"warn", no_argument, NULL, OPTION_WARN}, -#define OPTION_TARGET_HELP (OPTION_STD_BASE + 19) {"target-help", no_argument, NULL, OPTION_TARGET_HELP}, -#define OPTION_WARN_FATAL (OPTION_STD_BASE + 20) +#if defined BFD_ASSEMBLER && (defined OBJ_ELF || defined OBJ_MAYBE_ELF) + {"execstack", no_argument, NULL, OPTION_EXECSTACK}, + {"noexecstack", no_argument, NULL, OPTION_NOEXECSTACK}, +#endif {"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. */ @@ -431,13 +466,10 @@ parse_args (pargc, pargv) 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 - + sizeof (struct option)); + longopts = 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, + 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. */ @@ -445,7 +477,7 @@ parse_args (pargc, pargv) old_argv = *pargv; /* Initialize a new argv that contains no options. */ - new_argv = (char **) xmalloc (sizeof (char *) * (old_argc + 1)); + new_argv = xmalloc (sizeof (char *) * (old_argc + 1)); new_argv[0] = old_argv[0]; new_argc = 1; new_argv[new_argc] = NULL; @@ -469,7 +501,7 @@ parse_args (pargc, pargv) if (md_parse_option (optc, optarg) != 0) break; /* `-v' isn't included in the general short_opts list, so check for - it explicity here before deciding we've gotten a bad argument. */ + it explicitly here before deciding we've gotten a bad argument. */ if (optc == 'v') { #ifdef VMS @@ -485,6 +517,7 @@ parse_args (pargc, pargv) #endif case OPTION_VERBOSE: print_version_id (); + verbose = 1; break; } /* Fall through. */ @@ -574,7 +607,7 @@ the GNU General Public License. This program has absolutely no warranty.\n")); #else i = strtol (s, (char **) NULL, 0); #endif - n = (struct defsym_list *) xmalloc (sizeof *n); + n = xmalloc (sizeof *n); n->next = defsyms; n->name = optarg; n->value = i; @@ -595,7 +628,7 @@ the GNU General Public License. This program has absolutely no warranty.\n")); break; } - n = (struct itbl_file_list *) xmalloc (sizeof *n); + n = xmalloc (sizeof * n); n->next = itbl_files; n->name = optarg; itbl_files = n; @@ -615,6 +648,9 @@ the GNU General Public License. This program has absolutely no warranty.\n")); start_dependencies (optarg); break; + case OPTION_GSTABS_PLUS: + use_gnu_debug_info_extensions = 1; + /* Fall through. */ case OPTION_GSTABS: debug_type = DEBUG_STABS; break; @@ -632,7 +668,6 @@ the GNU General Public License. This program has absolutely no warranty.\n")); flag_warn_displacement = 1; break; #endif - case 'L': flag_keep_locals = 1; break; @@ -681,6 +716,17 @@ the GNU General Public License. This program has absolutely no warranty.\n")); flag_fatal_warnings = 1; break; +#if defined BFD_ASSEMBLER && (defined OBJ_ELF || defined OBJ_MAYBE_ELF) + case OPTION_EXECSTACK: + flag_execstack = 1; + flag_noexecstack = 0; + break; + + case OPTION_NOEXECSTACK: + flag_noexecstack = 1; + flag_execstack = 0; + break; +#endif case 'Z': flag_always_generate_output = 1; break; @@ -772,14 +818,168 @@ the GNU General Public License. This program has absolutely no warranty.\n")); #endif } -static long start_time; +static void +dump_statistics (void) +{ +#ifdef HAVE_SBRK + char *lim = (char *) sbrk (0); +#endif + long run_time = get_run_time () - start_time; + + fprintf (stderr, _("%s: total time in assembly: %ld.%06ld\n"), + myname, run_time / 1000000, run_time % 1000000); +#ifdef HAVE_SBRK + fprintf (stderr, _("%s: data size %ld\n"), + myname, (long) (lim - (char *) &environ)); +#endif + + subsegs_print_statistics (stderr); + write_print_statistics (stderr); + symbol_print_statistics (stderr); + read_print_statistics (stderr); + +#ifdef tc_print_statistics + tc_print_statistics (stderr); +#endif + +#ifdef obj_print_statistics + obj_print_statistics (stderr); +#endif +} + +/* The interface between the macro code and gas expression handling. */ + +static int +macro_expr (const char *emsg, int idx, sb *in, int *val) +{ + char *hold; + expressionS ex; + + sb_terminate (in); + + hold = input_line_pointer; + input_line_pointer = in->ptr + idx; + expression (&ex); + idx = input_line_pointer - in->ptr; + input_line_pointer = hold; + + if (ex.X_op != O_constant) + as_bad ("%s", emsg); + + *val = (int) ex.X_add_number; + + return idx; +} + +/* 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 +perform_an_assembly_pass (int argc, char ** argv) +{ + int saw_a_file = 0; +#ifdef BFD_ASSEMBLER + flagword applicable; +#endif + + need_pass_2 = 0; + +#ifndef BFD_ASSEMBLER +#ifdef MANY_SEGMENTS + { + unsigned int i; + for (i = SEG_E0; i < SEG_UNKNOWN; i++) + segment_info[i].fix_root = 0; + } + /* Create the three fixed ones. */ + { + segT seg; + +#ifdef TE_APOLLO + seg = subseg_new (".wtext", 0); +#else + seg = subseg_new (".text", 0); +#endif + assert (seg == SEG_E0); + seg = subseg_new (".data", 0); + assert (seg == SEG_E1); + seg = subseg_new (".bss", 0); + assert (seg == SEG_E2); +#ifdef TE_APOLLO + create_target_segments (); +#endif + } + +#else /* not MANY_SEGMENTS. */ + text_fix_root = NULL; + data_fix_root = NULL; + bss_fix_root = NULL; +#endif /* not MANY_SEGMENTS. */ +#else /* BFD_ASSEMBLER. */ + /* Create the standard sections, and those the assembler uses + internally. */ + text_section = subseg_new (TEXT_SECTION_NAME, 0); + data_section = subseg_new (DATA_SECTION_NAME, 0); + bss_section = subseg_new (BSS_SECTION_NAME, 0); + /* @@ FIXME -- we're setting the RELOC flag so that sections are assumed + to have relocs, otherwise we don't find out in time. */ + applicable = bfd_applicable_section_flags (stdoutput); + bfd_set_section_flags (stdoutput, text_section, + applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC + | SEC_CODE | SEC_READONLY)); + bfd_set_section_flags (stdoutput, data_section, + applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC + | SEC_DATA)); + bfd_set_section_flags (stdoutput, bss_section, applicable & SEC_ALLOC); + seg_info (bss_section)->bss = 1; + subseg_new (BFD_ABS_SECTION_NAME, 0); + subseg_new (BFD_UND_SECTION_NAME, 0); + reg_section = subseg_new ("*GAS `reg' section*", 0); + expr_section = subseg_new ("*GAS `expr' section*", 0); -int main PARAMS ((int, char **)); +#endif /* BFD_ASSEMBLER. */ + + subseg_set (text_section, 0); + + /* This may add symbol table entries, which requires having an open BFD, + and sections already created, in BFD_ASSEMBLER mode. */ + md_begin (); + +#ifdef USING_CGEN + gas_cgen_begin (); +#endif +#ifdef obj_begin + obj_begin (); +#endif + + /* Skip argv[0]. */ + argv++; + argc--; + + while (argc--) + { + if (*argv) + { /* Is it a file-name argument? */ + PROGRESS (1); + saw_a_file++; + /* argv->"" if stdin desired, else->filename. */ + read_a_source_file (*argv); + } + argv++; /* Completed that argv. */ + } + if (!saw_a_file) + read_a_source_file (""); +} + int -main (argc, argv) - int argc; - char **argv; +main (int argc, char ** argv) { int macro_alternate; int macro_strip_at; @@ -890,10 +1090,27 @@ main (argc, argv) md_end (); #endif +#if defined BFD_ASSEMBLER && (defined OBJ_ELF || defined OBJ_MAYBE_ELF) + if ((flag_execstack || flag_noexecstack) + && OUTPUT_FLAVOR == bfd_target_elf_flavour) + { + segT gnustack; + + gnustack = subseg_new (".note.GNU-stack", 0); + bfd_set_section_flags (stdoutput, gnustack, + SEC_READONLY | (flag_execstack ? SEC_CODE : 0)); + + } +#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 we constructed dwarf2 .eh_frame info, either via .cfi + directives from the user or by the backend, emit it now. */ + cfi_finish (); + if (seen_at_least_1_file () && (flag_always_generate_output || had_errors () == 0)) keep_it = 1; @@ -915,7 +1132,7 @@ main (argc, argv) listing_print (listing_filename); #endif -#ifndef OBJ_VMS /* does its own file handling */ +#ifndef OBJ_VMS /* Does its own file handling. */ #ifndef BFD_ASSEMBLER if (keep_it) #endif @@ -946,163 +1163,3 @@ main (argc, argv) xexit (EXIT_SUCCESS); } -static void -dump_statistics () -{ -#ifdef HAVE_SBRK - char *lim = (char *) sbrk (0); -#endif - long run_time = get_run_time () - start_time; - - fprintf (stderr, _("%s: total time in assembly: %ld.%06ld\n"), - myname, run_time / 1000000, run_time % 1000000); -#ifdef HAVE_SBRK - fprintf (stderr, _("%s: data size %ld\n"), - myname, (long) (lim - (char *) &environ)); -#endif - - subsegs_print_statistics (stderr); - write_print_statistics (stderr); - symbol_print_statistics (stderr); - read_print_statistics (stderr); - -#ifdef tc_print_statistics - tc_print_statistics (stderr); -#endif -#ifdef obj_print_statistics - obj_print_statistics (stderr); -#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). - - 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; -{ - int saw_a_file = 0; -#ifdef BFD_ASSEMBLER - flagword applicable; -#endif - - need_pass_2 = 0; - -#ifndef BFD_ASSEMBLER -#ifdef MANY_SEGMENTS - { - unsigned int i; - for (i = SEG_E0; i < SEG_UNKNOWN; i++) - segment_info[i].fix_root = 0; - } - /* Create the three fixed ones. */ - { - segT seg; - -#ifdef TE_APOLLO - seg = subseg_new (".wtext", 0); -#else - seg = subseg_new (".text", 0); -#endif - assert (seg == SEG_E0); - seg = subseg_new (".data", 0); - assert (seg == SEG_E1); - seg = subseg_new (".bss", 0); - assert (seg == SEG_E2); -#ifdef TE_APOLLO - create_target_segments (); -#endif - } - -#else /* not MANY_SEGMENTS */ - text_fix_root = NULL; - data_fix_root = NULL; - bss_fix_root = NULL; -#endif /* not MANY_SEGMENTS */ -#else /* BFD_ASSEMBLER */ - /* Create the standard sections, and those the assembler uses - internally. */ - text_section = subseg_new (TEXT_SECTION_NAME, 0); - data_section = subseg_new (DATA_SECTION_NAME, 0); - bss_section = subseg_new (BSS_SECTION_NAME, 0); - /* @@ FIXME -- we're setting the RELOC flag so that sections are assumed - to have relocs, otherwise we don't find out in time. */ - applicable = bfd_applicable_section_flags (stdoutput); - bfd_set_section_flags (stdoutput, text_section, - applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC - | SEC_CODE | SEC_READONLY)); - bfd_set_section_flags (stdoutput, data_section, - applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC - | SEC_DATA)); - bfd_set_section_flags (stdoutput, bss_section, applicable & SEC_ALLOC); - seg_info (bss_section)->bss = 1; - subseg_new (BFD_ABS_SECTION_NAME, 0); - subseg_new (BFD_UND_SECTION_NAME, 0); - reg_section = subseg_new ("*GAS `reg' section*", 0); - expr_section = subseg_new ("*GAS `expr' section*", 0); - -#endif /* BFD_ASSEMBLER */ - - subseg_set (text_section, 0); - - /* This may add symbol table entries, which requires having an open BFD, - and sections already created, in BFD_ASSEMBLER mode. */ - md_begin (); - -#ifdef obj_begin - obj_begin (); -#endif - - /* Skip argv[0]. */ - argv++; - argc--; - - while (argc--) - { - if (*argv) - { /* Is it a file-name argument? */ - PROGRESS (1); - saw_a_file++; - /* argv->"" if stdin desired, else->filename */ - read_a_source_file (*argv); - } - argv++; /* completed that argv */ - } - if (!saw_a_file) - read_a_source_file (""); -} - -/* The interface between the macro code and gas expression handling. */ - -static int -macro_expr (emsg, idx, in, val) - const char *emsg; - int idx; - sb *in; - int *val; -{ - char *hold; - expressionS ex; - - sb_terminate (in); - - hold = input_line_pointer; - input_line_pointer = in->ptr + idx; - expression (&ex); - idx = input_line_pointer - in->ptr; - input_line_pointer = hold; - - if (ex.X_op != O_constant) - as_bad ("%s", emsg); - - *val = (int) ex.X_add_number; - - return idx; -} diff --git a/contrib/binutils/gas/as.h b/contrib/binutils/gas/as.h index ff434cb..890ecd8 100644 --- a/contrib/binutils/gas/as.h +++ b/contrib/binutils/gas/as.h @@ -1,6 +1,6 @@ /* as.h - global header file Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002 + 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -188,7 +188,7 @@ extern char **environ; #endif /* __FILE__ */ #ifndef FOPEN_WB -#ifdef GO32 +#if defined GO32 || defined __MINGW32__ #include "fopen-bin.h" #else #include "fopen-same.h" @@ -237,7 +237,7 @@ typedef addressT valueT; #ifdef TEST #define COMMON /* declare our COMMONs storage here. */ #else -#define COMMON extern /* our commons live elswhere */ +#define COMMON extern /* our commons live elsewhere */ #endif #endif /* COMMON now defined */ @@ -301,7 +301,7 @@ typedef asection *segT; #endif typedef int subsegT; -/* What subseg we are accreting now? */ +/* What subseg we are accessing now? */ COMMON subsegT now_subseg; /* Segment our instructions emit to. */ @@ -436,6 +436,12 @@ COMMON int flag_strip_local_absolute; /* True if we should generate a traditional format object file. */ COMMON int flag_traditional_format; +/* TRUE if .note.GNU-stack section with SEC_CODE should be created */ +COMMON int flag_execstack; + +/* TRUE if .note.GNU-stack section with SEC_CODE should be created */ +COMMON int flag_noexecstack; + /* name of emitted object file */ COMMON char *out_file_name; @@ -470,10 +476,14 @@ enum debug_info_type { }; extern enum debug_info_type debug_type; +extern int use_gnu_debug_info_extensions; /* Maximum level of macro nesting. */ extern int max_macro_nest; +/* Verbosity level. */ +extern int verbose; + /* Obstack chunk size. Keep large for efficient space use, make small to increase malloc calls for monitoring memory allocation. */ extern int chunksize; @@ -482,7 +492,7 @@ struct _pseudo_type { /* assembler mnemonic, lower case, no '.' */ const char *poc_name; /* Do the work */ - void (*poc_handler) PARAMS ((int)); + void (*poc_handler) (int); /* Value to pass to handler */ int poc_val; }; @@ -522,10 +532,10 @@ typedef struct _pseudo_type pseudo_typeS; #else /* __GNUC__ < 2 || defined(VMS) */ -#define PRINTF_LIKE(FCN) void FCN PARAMS ((const char *format, ...)) -#define PRINTF_WHERE_LIKE(FCN) void FCN PARAMS ((char *file, \ - unsigned int line, \ - const char *format, ...)) +#define PRINTF_LIKE(FCN) void FCN (const char *format, ...) +#define PRINTF_WHERE_LIKE(FCN) void FCN (char *file, \ + unsigned int line, \ + const char *format, ...) #endif /* __GNUC__ < 2 || defined(VMS) */ @@ -543,54 +553,54 @@ PRINTF_LIKE (as_warn); PRINTF_WHERE_LIKE (as_bad_where); PRINTF_WHERE_LIKE (as_warn_where); -void as_assert PARAMS ((const char *, int, const char *)); -void as_abort PARAMS ((const char *, int, const char *)) ATTRIBUTE_NORETURN; - -void fprint_value PARAMS ((FILE *file, addressT value)); -void sprint_value PARAMS ((char *buf, addressT value)); - -int had_errors PARAMS ((void)); -int had_warnings PARAMS ((void)); - -void print_version_id PARAMS ((void)); -char *app_push PARAMS ((void)); -char *atof_ieee PARAMS ((char *str, int what_kind, LITTLENUM_TYPE * words)); -char *input_scrub_include_file PARAMS ((char *filename, char *position)); -extern void input_scrub_insert_line PARAMS((const char *line)); -extern void input_scrub_insert_file PARAMS((char *path)); -char *input_scrub_new_file PARAMS ((char *filename)); -char *input_scrub_next_buffer PARAMS ((char **bufp)); -int do_scrub_chars PARAMS ((int (*get) (char *, int), char *to, int tolen)); -int gen_to_words PARAMS ((LITTLENUM_TYPE * words, int precision, - long exponent_bits)); -int had_err PARAMS ((void)); -int ignore_input PARAMS ((void)); -void cond_finish_check PARAMS ((int)); -void cond_exit_macro PARAMS ((int)); -int seen_at_least_1_file PARAMS ((void)); -void app_pop PARAMS ((char *arg)); -void as_howmuch PARAMS ((FILE * stream)); -void as_perror PARAMS ((const char *gripe, const char *filename)); -void as_where PARAMS ((char **namep, unsigned int *linep)); -void bump_line_counters PARAMS ((void)); -void do_scrub_begin PARAMS ((int)); -void input_scrub_begin PARAMS ((void)); -void input_scrub_close PARAMS ((void)); -void input_scrub_end PARAMS ((void)); -int new_logical_line PARAMS ((char *fname, int line_number)); -void subsegs_begin PARAMS ((void)); -void subseg_change PARAMS ((segT seg, int subseg)); -segT subseg_new PARAMS ((const char *name, subsegT subseg)); -segT subseg_force_new PARAMS ((const char *name, subsegT subseg)); -void subseg_set PARAMS ((segT seg, subsegT subseg)); +void as_assert (const char *, int, const char *); +void as_abort (const char *, int, const char *) ATTRIBUTE_NORETURN; + +void fprint_value (FILE *file, addressT value); +void sprint_value (char *buf, addressT value); + +int had_errors (void); +int had_warnings (void); + +void print_version_id (void); +char *app_push (void); +char *atof_ieee (char *str, int what_kind, LITTLENUM_TYPE * words); +char *input_scrub_include_file (char *filename, char *position); +extern void input_scrub_insert_line (const char *line); +extern void input_scrub_insert_file (char *path); +char *input_scrub_new_file (char *filename); +char *input_scrub_next_buffer (char **bufp); +int do_scrub_chars (int (*get) (char *, int), char *to, int tolen); +int gen_to_words (LITTLENUM_TYPE * words, int precision, + long exponent_bits); +int had_err (void); +int ignore_input (void); +void cond_finish_check (int); +void cond_exit_macro (int); +int seen_at_least_1_file (void); +void app_pop (char *arg); +void as_howmuch (FILE * stream); +void as_perror (const char *gripe, const char *filename); +void as_where (char **namep, unsigned int *linep); +void bump_line_counters (void); +void do_scrub_begin (int); +void input_scrub_begin (void); +void input_scrub_close (void); +void input_scrub_end (void); +int new_logical_line (char *fname, int line_number); +void subsegs_begin (void); +void subseg_change (segT seg, int subseg); +segT subseg_new (const char *name, subsegT subseg); +segT subseg_force_new (const char *name, subsegT subseg); +void subseg_set (segT seg, subsegT subseg); #ifdef BFD_ASSEMBLER -segT subseg_get PARAMS ((const char *, int)); +segT subseg_get (const char *, int); #endif -int subseg_text_p PARAMS ((segT)); +int subseg_text_p (segT); -void start_dependencies PARAMS ((char *)); -void register_dependency PARAMS ((char *)); -void print_dependencies PARAMS ((void)); +void start_dependencies (char *); +void register_dependency (char *); +void print_dependencies (void); struct expressionS; struct fix; @@ -600,21 +610,29 @@ typedef struct frag fragS; #ifdef BFD_ASSEMBLER /* literal.c */ -valueT add_to_literal_pool PARAMS ((symbolS *, valueT, segT, int)); +valueT add_to_literal_pool (symbolS *, valueT, segT, int); #endif -int check_eh_frame PARAMS ((struct expressionS *, unsigned int *)); -int eh_frame_estimate_size_before_relax PARAMS ((fragS *)); -int eh_frame_relax_frag PARAMS ((fragS *)); -void eh_frame_convert_frag PARAMS ((fragS *)); +int check_eh_frame (struct expressionS *, unsigned int *); +int eh_frame_estimate_size_before_relax (fragS *); +int eh_frame_relax_frag (fragS *); +void eh_frame_convert_frag (fragS *); + +int generic_force_reloc (struct fix *); #include "expr.h" /* Before targ-*.h */ /* this one starts the chain of target dependant headers */ #include "targ-env.h" -#ifdef TC_ARC -#include "struc-symbol.h" +#ifdef OBJ_MAYBE_ELF +#define IS_ELF (OUTPUT_FLAVOR == bfd_target_elf_flavour) +#else +#ifdef OBJ_ELF +#define IS_ELF 1 +#else +#define IS_ELF 0 +#endif #endif #include "write.h" diff --git a/contrib/binutils/gas/atof-generic.c b/contrib/binutils/gas/atof-generic.c index c5d10d4..8c599b5 100644 --- a/contrib/binutils/gas/atof-generic.c +++ b/contrib/binutils/gas/atof-generic.c @@ -32,7 +32,7 @@ #endif #ifdef TRACE -static void flonum_print PARAMS ((const FLONUM_TYPE *)); +static void flonum_print (const FLONUM_TYPE *); #endif #define ASSUME_DECIMAL_MARK_IS_DOT @@ -75,16 +75,12 @@ static void flonum_print PARAMS ((const FLONUM_TYPE *)); */ int -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. */ - char **address_of_string_pointer; - /* 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; +atof_generic (/* return pointer to just AFTER number we read. */ + char **address_of_string_pointer, + /* 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. */ char *first_digit; @@ -472,7 +468,7 @@ atof_generic (address_of_string_pointer, { /* * Compute the mantssa (& exponent) of the power of 10. - * If sucessful, then multiply the power of 10 by the digits + * If successful, then multiply the power of 10 by the digits * giving return_binary_mantissa and return_binary_exponent. */ diff --git a/contrib/binutils/gas/bignum-copy.c b/contrib/binutils/gas/bignum-copy.c index b4ed7d1..5697472 100644 --- a/contrib/binutils/gas/bignum-copy.c +++ b/contrib/binutils/gas/bignum-copy.c @@ -33,11 +33,10 @@ /* void */ int -bignum_copy (in, in_length, out, out_length) - register LITTLENUM_TYPE *in; - register int in_length; /* in sizeof(littlenum)s */ - register LITTLENUM_TYPE *out; - register int out_length; /* in sizeof(littlenum)s */ +bignum_copy (register LITTLENUM_TYPE *in, + register int in_length, /* in sizeof(littlenum)s */ + register LITTLENUM_TYPE *out, + register int out_length /* in sizeof(littlenum)s */) { int significant_littlenums_dropped; diff --git a/contrib/binutils/gas/bignum.h b/contrib/binutils/gas/bignum.h index 42954cf..fbb77ff 100644 --- a/contrib/binutils/gas/bignum.h +++ b/contrib/binutils/gas/bignum.h @@ -46,7 +46,7 @@ typedef unsigned short LITTLENUM_TYPE; /* lengths are in sizeof(littlenum)s */ -int bignum_copy PARAMS ((LITTLENUM_TYPE * in, int in_length, - LITTLENUM_TYPE * out, int out_length)); +int bignum_copy (LITTLENUM_TYPE * in, int in_length, + LITTLENUM_TYPE * out, int out_length); /* end of bignum.h */ diff --git a/contrib/binutils/gas/bit_fix.h b/contrib/binutils/gas/bit_fix.h index 80c0022..1676d2c 100644 --- a/contrib/binutils/gas/bit_fix.h +++ b/contrib/binutils/gas/bit_fix.h @@ -20,7 +20,7 @@ /* The bit_fix was implemented to support machines that need variables to be inserted in bitfields other than 1, 2 and 4 bytes. - Furthermore it gives us a possibillity to mask in bits in the symbol + Furthermore it gives us a possibility to mask in bits in the symbol when it's fixed in the objectcode and check the symbols limits. The or-mask is used to set the huffman bits in displacements for the diff --git a/contrib/binutils/gas/cgen.c b/contrib/binutils/gas/cgen.c index 67b9b16..5ce7f4c 100644 --- a/contrib/binutils/gas/cgen.c +++ b/contrib/binutils/gas/cgen.c @@ -1,22 +1,22 @@ /* GAS interface for targets using CGEN: Cpu tools GENerator. - Copyright 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -This file is part of GAS, the GNU Assembler. + 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 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. + 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. */ + 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 "ansidecl.h" @@ -29,7 +29,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "cgen.h" #include "dwarf2dbg.h" -static void queue_fixup PARAMS ((int, int, expressionS *)); +static void queue_fixup (int, int, expressionS *); /* Opcode table descriptor, must be set by md_begin. */ @@ -61,7 +61,8 @@ 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; @@ -112,7 +113,7 @@ queue_fixup (opindex, opinfo, expP) gas_cgen_initialize_saved_fixups_array(): Sets num_fixups_in_chain to 0 for each element. Call this from md_begin() if you plan to use these functions and you want the - fixup count in each element to be set to 0 intially. This is + fixup count in each element to be set to 0 initially. This is not necessary, but it's included just in case. It performs the same function for each element in the array of fixup chains that gas_init_parse() performs for the current fixups. @@ -130,7 +131,8 @@ queue_fixup (opindex, opinfo, expP) element - swap the current fixups with those in this element number. */ -struct saved_fixups { +struct saved_fixups +{ struct fixup fixup_chain[GAS_CGEN_MAX_FIXUPS]; int num_fixups_in_chain; }; @@ -240,7 +242,6 @@ gas_cgen_record_fixup (frag, where, insn, length, operand, opinfo, symbol, offse /* It may seem strange to use operand->attrs and not insn->attrs here, but it is the operand that has a pc relative relocation. */ - fixP = fix_new (frag, where, length / 8, symbol, offset, CGEN_OPERAND_ATTR_VALUE (operand, CGEN_OPERAND_PCREL_ADDR), (bfd_reloc_code_real_type) @@ -279,7 +280,6 @@ gas_cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp) /* It may seem strange to use operand->attrs and not insn->attrs here, but it is the operand that has a pc relative relocation. */ - fixP = fix_new_exp (frag, where, length / 8, exp, CGEN_OPERAND_ATTR_VALUE (operand, CGEN_OPERAND_PCREL_ADDR), (bfd_reloc_code_real_type) @@ -431,7 +431,7 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result) Relaxable instructions: We need to ensure we allocate enough space for the largest insn. */ - if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_RELAX)) + if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_RELAXED)) /* These currently shouldn't get here. */ abort (); @@ -531,7 +531,7 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result) cgen_operand_lookup_by_num (gas_cgen_cpu_desc, fixups[i].opindex); /* Don't create fixups for these. That's done during relaxation. - We don't need to test for CGEN_INSN_RELAX as they can't get here + We don't need to test for CGEN_INSN_RELAXED as they can't get here (see above). */ if (relax_p && CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_RELAXABLE) @@ -580,39 +580,12 @@ gas_cgen_md_apply_fix3 (fixP, valP, seg) /* 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 - bfd_install_relocation, which is also going to use the symbol - value. That means that if the reloc is fully resolved we want to - use *valuep since bfd_install_relocation is not being used. - However, if the reloc is not fully resolved we do not want to use - *valuep, and must use fx_offset instead. However, if the reloc - is PC relative, we do want to use *valuep since it includes the - result of md_pcrel_from. This is confusing. */ - if (fixP->fx_addsy == (symbolS *) NULL) fixP->fx_done = 1; - else if (fixP->fx_pcrel) - ; - - else - { - value = fixP->fx_offset; - - if (fixP->fx_subsy != (symbolS *) NULL) - { - if (S_GET_SEGMENT (fixP->fx_subsy) == absolute_section) - value -= S_GET_VALUE (fixP->fx_subsy); - else - { - /* We don't actually support subtracting a symbol. */ - as_bad_where (fixP->fx_file, fixP->fx_line, - _("expression too complex")); - } - } - } + /* We don't actually support subtracting a symbol. */ + if (fixP->fx_subsy != (symbolS *) NULL) + as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED) { @@ -743,3 +716,15 @@ gas_cgen_tc_gen_reloc (section, fixP) reloc->address = fixP->fx_frag->fr_address + fixP->fx_where; return reloc; } + +/* Perform any cgen specific initialisation. + Called after gas_cgen_cpu_desc has been created. */ + +void +gas_cgen_begin () +{ + if (flag_signed_overflow_ok) + cgen_set_signed_overflow_ok (gas_cgen_cpu_desc); + else + cgen_clear_signed_overflow_ok (gas_cgen_cpu_desc); +} diff --git a/contrib/binutils/gas/cgen.h b/contrib/binutils/gas/cgen.h index 9d814b7..8cf72af 100644 --- a/contrib/binutils/gas/cgen.h +++ b/contrib/binutils/gas/cgen.h @@ -46,56 +46,57 @@ typedef struct { The result is an error message or NULL for success. The parsed value is stored in the bfd_vma *. */ extern const char * gas_cgen_parse_operand - PARAMS ((CGEN_CPU_DESC, enum cgen_parse_operand_type, - const char **, int, int, enum cgen_parse_operand_result *, - bfd_vma *)); + (CGEN_CPU_DESC, enum cgen_parse_operand_type, + const char **, int, int, enum cgen_parse_operand_result *, + bfd_vma *); /* Call this from md_assemble to initialize the assembler callback. */ -extern void gas_cgen_init_parse PARAMS ((void)); +extern void gas_cgen_init_parse (void); /* Routines and macros for saving fixup chains. */ -extern void gas_cgen_save_fixups PARAMS ((int)); -extern void gas_cgen_restore_fixups PARAMS ((int)); -extern void gas_cgen_swap_fixups PARAMS ((int)); -extern void gas_cgen_initialize_saved_fixups_array PARAMS ((void)); +extern void gas_cgen_save_fixups (int); +extern void gas_cgen_restore_fixups (int); +extern void gas_cgen_swap_fixups (int); +extern void gas_cgen_initialize_saved_fixups_array (void); #define MAX_SAVED_FIXUP_CHAINS 50 /* 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. */ -extern void cgen_asm_record_register PARAMS ((char *, int)); +extern void cgen_asm_record_register (char *, int); /* After CGEN_SYM (assemble_insn) is done, this is called to output the insn and record any fixups. */ -extern void gas_cgen_finish_insn PARAMS ((const CGEN_INSN *, - CGEN_INSN_BYTES_PTR, unsigned int, - int, finished_insnS *)); +extern void gas_cgen_finish_insn (const CGEN_INSN *, + CGEN_INSN_BYTES_PTR, unsigned int, + int, finished_insnS *); /* Record a fixup. */ -extern fixS * gas_cgen_record_fixup PARAMS ((fragS *, int, const CGEN_INSN *, - int, const CGEN_OPERAND *, int, - symbolS *, offsetT)); -extern fixS * gas_cgen_record_fixup_exp PARAMS ((fragS *, int, const CGEN_INSN *, - int, const CGEN_OPERAND *, int, - expressionS *)); +extern fixS * gas_cgen_record_fixup (fragS *, int, const CGEN_INSN *, + int, const CGEN_OPERAND *, int, + symbolS *, offsetT); +extern fixS * gas_cgen_record_fixup_exp (fragS *, int, const CGEN_INSN *, + int, const CGEN_OPERAND *, int, + expressionS *); /* md_apply_fix3 handler */ -extern void gas_cgen_md_apply_fix3 PARAMS ((fixS *, valueT *, segT)); +extern void gas_cgen_md_apply_fix3 (fixS *, valueT *, segT); /* tc_gen_reloc handler */ -extern arelent *gas_cgen_tc_gen_reloc PARAMS ((asection *, fixS *)); +extern arelent *gas_cgen_tc_gen_reloc (asection *, fixS *); /* Target supplied routine to lookup a reloc. */ extern bfd_reloc_code_real_type -md_cgen_lookup_reloc PARAMS ((const CGEN_INSN *, const CGEN_OPERAND *, - fixS *)); +md_cgen_lookup_reloc (const CGEN_INSN *, const CGEN_OPERAND *, fixS *); /* Optional target supplied routine to record a fixup for an expression. */ extern fixS * -md_cgen_record_fixup_exp PARAMS ((fragS *, int, const CGEN_INSN *, int, - const CGEN_OPERAND *, int, - expressionS *)); +md_cgen_record_fixup_exp (fragS *, int, const CGEN_INSN *, int, + const CGEN_OPERAND *, int, expressionS *); -extern void gas_cgen_md_operand PARAMS ((expressionS *)); +extern void gas_cgen_md_operand (expressionS *); + +/* Perform any cgen specific initialisation for gas. */ +extern void gas_cgen_begin (void); #endif /* GAS_CGEN_H */ diff --git a/contrib/binutils/gas/cond.c b/contrib/binutils/gas/cond.c index 73304cb..870a7d5 100644 --- a/contrib/binutils/gas/cond.c +++ b/contrib/binutils/gas/cond.c @@ -55,20 +55,23 @@ struct conditional_frame { int macro_nest; }; -static void initialize_cframe PARAMS ((struct conditional_frame *cframe)); -static char *get_mri_string PARAMS ((int, int *)); +static void initialize_cframe (struct conditional_frame *cframe); +static char *get_mri_string (int, int *); static struct conditional_frame *current_cframe = NULL; +/* Performs the .ifdef (test_defined == 1) and + the .ifndef (test_defined == 0) pseudo op. */ + void -s_ifdef (arg) - int arg; +s_ifdef (int test_defined) { /* Points to name of symbol. */ - register char *name; + char *name; /* Points to symbol. */ - register symbolS *symbolP; + symbolS *symbolP; struct conditional_frame cframe; + char c; /* Leading whitespace is part of operand. */ SKIP_WHITESPACE (); @@ -79,34 +82,47 @@ s_ifdef (arg) as_bad (_("invalid identifier for \".ifdef\"")); obstack_1grow (&cond_obstack, 0); ignore_rest_of_line (); + return; } + + c = get_symbol_end (); + symbolP = symbol_find (name); + *input_line_pointer = c; + + initialize_cframe (&cframe); + + if (cframe.dead_tree) + cframe.ignoring = 1; else { - char c; + int is_defined; - c = get_symbol_end (); - symbolP = symbol_find (name); - *input_line_pointer = c; + /* Use the same definition of 'defined' as .equiv so that a symbol + which has been referenced but not yet given a value/address is + considered to be undefined. */ + is_defined = + symbolP != NULL + && S_IS_DEFINED (symbolP) + && S_GET_SEGMENT (symbolP) != reg_section; - initialize_cframe (&cframe); - cframe.ignoring = cframe.dead_tree || !((symbolP != 0) ^ arg); - current_cframe = ((struct conditional_frame *) - obstack_copy (&cond_obstack, &cframe, - sizeof (cframe))); + cframe.ignoring = ! (test_defined ^ is_defined); + } - if (LISTING_SKIP_COND () - && cframe.ignoring - && (cframe.previous_cframe == NULL - || ! cframe.previous_cframe->ignoring)) - listing_list (2); + current_cframe = ((struct conditional_frame *) + obstack_copy (&cond_obstack, &cframe, + sizeof (cframe))); + + if (LISTING_SKIP_COND () + && cframe.ignoring + && (cframe.previous_cframe == NULL + || ! cframe.previous_cframe->ignoring)) + listing_list (2); - demand_empty_rest_of_line (); - } /* if a valid identifyer name */ + demand_empty_rest_of_line (); } void -s_if (arg) - int arg; +s_if (int arg) { expressionS operand; struct conditional_frame cframe; @@ -168,9 +184,7 @@ s_if (arg) /* Get a string for the MRI IFC or IFNC pseudo-ops. */ static char * -get_mri_string (terminator, len) - int terminator; - int *len; +get_mri_string (int terminator, int *len) { char *ret; char *s; @@ -210,8 +224,7 @@ get_mri_string (terminator, len) /* The MRI IFC and IFNC pseudo-ops. */ void -s_ifc (arg) - int arg; +s_ifc (int arg) { char *stop = NULL; char stopc; @@ -252,8 +265,7 @@ s_ifc (arg) } void -s_elseif (arg) - int arg; +s_elseif (int arg) { if (current_cframe == NULL) { @@ -328,8 +340,7 @@ s_elseif (arg) } void -s_endif (arg) - int arg ATTRIBUTE_UNUSED; +s_endif (int arg ATTRIBUTE_UNUSED) { struct conditional_frame *hold; @@ -360,8 +371,7 @@ s_endif (arg) } void -s_else (arg) - int arg ATTRIBUTE_UNUSED; +s_else (int arg ATTRIBUTE_UNUSED) { if (current_cframe == NULL) { @@ -408,8 +418,7 @@ s_else (arg) } void -s_ifeqs (arg) - int arg; +s_ifeqs (int arg) { char *s1, *s2; int len1, len2; @@ -447,7 +456,7 @@ s_ifeqs (arg) } int -ignore_input () +ignore_input (void) { char *s; @@ -481,8 +490,7 @@ ignore_input () } static void -initialize_cframe (cframe) - struct conditional_frame *cframe; +initialize_cframe (struct conditional_frame *cframe) { memset (cframe, 0, sizeof (*cframe)); as_where (&cframe->if_file_line.file, @@ -498,8 +506,7 @@ initialize_cframe (cframe) negative, we are being called at the of the input files. */ void -cond_finish_check (nest) - int nest; +cond_finish_check (int nest) { if (current_cframe != NULL && current_cframe->macro_nest >= nest) { @@ -522,8 +529,7 @@ cond_finish_check (nest) nested, and just pop them off the stack. */ void -cond_exit_macro (nest) - int nest; +cond_exit_macro (int nest) { while (current_cframe != NULL && current_cframe->macro_nest >= nest) { diff --git a/contrib/binutils/gas/config.in b/contrib/binutils/gas/config.in index 8b8c8b2..fe2bc3f 100644 --- a/contrib/binutils/gas/config.in +++ b/contrib/binutils/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 @@ -160,6 +157,18 @@ /* Define as 1 if big endian. */ #undef TARGET_BYTES_BIG_ENDIAN +/* Default CPU for MIPS targets. */ +#undef MIPS_CPU_STRING_DEFAULT + +/* Allow use of E_MIPS_ABI_O32 on MIPS targets. */ +#undef USE_E_MIPS_ABI_O32 + +/* Generate 64-bit code by default on MIPS targets. */ +#undef MIPS_DEFAULT_64BIT + +/* Choose a default ABI for MIPS targets. */ +#undef MIPS_DEFAULT_ABI + /* Default architecture. */ #undef DEFAULT_ARCH diff --git a/contrib/binutils/gas/config/obj-aout.c b/contrib/binutils/gas/config/obj-aout.c index a394306..6e5fd29 100644 --- a/contrib/binutils/gas/config/obj-aout.c +++ b/contrib/binutils/gas/config/obj-aout.c @@ -1,6 +1,6 @@ /* a.out object file format - Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001 - Free Software Foundation, Inc. + Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, + 2001, 2002 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -200,13 +200,13 @@ obj_aout_frob_symbol (sym, punt) } void -obj_aout_frob_file () +obj_aout_frob_file_before_fix () { /* Relocation processing may require knowing the VMAs of the sections. Since writing to a section will cause the BFD back end to compute the VMAs, fake it out here.... */ bfd_byte b = 0; - boolean x = true; + bfd_boolean x = TRUE; if (bfd_section_size (stdoutput, text_section) != 0) { x = bfd_set_section_contents (stdoutput, text_section, &b, (file_ptr) 0, @@ -217,7 +217,7 @@ obj_aout_frob_file () x = bfd_set_section_contents (stdoutput, data_section, &b, (file_ptr) 0, (bfd_size_type) 1); } - assert (x == true); + assert (x); } #else /* ! BFD_ASSEMBLER */ @@ -464,14 +464,18 @@ obj_crawl_symbol_chain (headers) if (flag_readonly_data_in_text && (S_GET_SEGMENT (symbolP) == SEG_DATA)) { S_SET_SEGMENT (symbolP, SEG_TEXT); - } /* if pusing data into text */ + } /* if pushing data into text */ resolve_symbol_value (symbolP); /* Skip symbols which were equated to undefined or common - symbols. */ + symbols. Also skip defined uncommon symbols which can + be resolved since in this case they should have been + resolved to a non-symbolic constant. */ if (symbolP->sy_value.X_op == O_symbol - && (! S_IS_DEFINED (symbolP) || S_IS_COMMON (symbolP))) + && (! S_IS_DEFINED (symbolP) + || S_IS_COMMON (symbolP) + || symbol_resolved_p (symbolP))) { *symbolPP = symbol_next (symbolP); continue; @@ -572,62 +576,6 @@ obj_pre_write_hook (headers) tc_aout_pre_write_hook (headers); } -void -s_sect () -{ - /* Strip out the section name */ - char *section_name; - char *section_name_end; - char c; - - unsigned int len; - unsigned int exp; - char *save; - - section_name = input_line_pointer; - c = get_symbol_end (); - section_name_end = input_line_pointer; - - len = section_name_end - section_name; - input_line_pointer++; - save = input_line_pointer; - - SKIP_WHITESPACE (); - if (c == ',') - { - exp = get_absolute_expression (); - } - else if (*input_line_pointer == ',') - { - input_line_pointer++; - exp = get_absolute_expression (); - } - else - { - input_line_pointer = save; - exp = 0; - } - if (exp >= 1000) - { - as_bad (_("subsegment index too high")); - } - - if (strcmp (section_name, ".text") == 0) - { - subseg_set (SEG_TEXT, (subsegT) exp); - } - - if (strcmp (section_name, ".data") == 0) - { - if (flag_readonly_data_in_text) - subseg_set (SEG_TEXT, (subsegT) exp + 1000); - else - subseg_set (SEG_DATA, (subsegT) exp); - } - - *section_name_end = c; -} - #endif /* ! BFD_ASSEMBLER */ #ifdef BFD_ASSEMBLER @@ -731,8 +679,9 @@ const struct format_ops aout_format_ops = 0, /* begin */ 0, /* app_file */ obj_aout_frob_symbol, - obj_aout_frob_file, + 0, /* frob_file */ 0, /* frob_file_before_adjust */ + obj_aout_frob_file_before_fix, 0, /* frob_file_after_relocs */ 0, /* s_get_size */ 0, /* s_set_size */ diff --git a/contrib/binutils/gas/config/obj-aout.h b/contrib/binutils/gas/config/obj-aout.h index 54168d1..23a2907 100644 --- a/contrib/binutils/gas/config/obj-aout.h +++ b/contrib/binutils/gas/config/obj-aout.h @@ -1,6 +1,6 @@ /* obj-aout.h, a.out object file format for gas, the assembler. - Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000 - Free Software Foundation, Inc. + Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, + 2002, 2003 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -82,9 +82,9 @@ typedef struct nlist obj_symbol_type; /* Symbol table entry */ asection *text_section, *data_section, *bss_section; #define obj_frob_symbol(S,PUNT) obj_aout_frob_symbol (S, &PUNT) -#define obj_frob_file() obj_aout_frob_file () +#define obj_frob_file_before_fix() obj_aout_frob_file_before_fix () extern void obj_aout_frob_symbol PARAMS ((symbolS *, int *)); -extern void obj_aout_frob_file PARAMS ((void)); +extern void obj_aout_frob_file_before_fix PARAMS ((void)); #define obj_sec_sym_ok_for_reloc(SEC) (1) @@ -95,7 +95,7 @@ extern void obj_aout_frob_file PARAMS ((void)); /* * Macros to extract information from a symbol table entry. - * This syntaxic indirection allows independence regarding a.out or coff. + * This syntactic indirection allows independence regarding a.out or coff. * The argument (s) of all these macros is a pointer to a symbol table entry. */ @@ -109,6 +109,12 @@ extern void obj_aout_frob_file PARAMS ((void)); #define S_IS_COMMON(s) \ (S_GET_TYPE (s) == N_UNDF && S_GET_VALUE (s) != 0) +/* Return true for symbols that should not be reduced to section + symbols or eliminated from expressions, because they may be + overridden by the linker. */ +#define S_FORCE_RELOC(s, strict) \ + (!SEG_NORMAL (S_GET_SEGMENT (s))) + #define S_IS_REGISTER(s) ((s)->sy_symbol.n_type == N_REGISTER) /* True if a debug special symbol entry */ diff --git a/contrib/binutils/gas/config/obj-coff.c b/contrib/binutils/gas/config/obj-coff.c index eb592aa..bd08c2b 100644 --- a/contrib/binutils/gas/config/obj-coff.c +++ b/contrib/binutils/gas/config/obj-coff.c @@ -143,7 +143,7 @@ stack_pop (st) } /* - * Maintain a list of the tagnames of the structres. + * Maintain a list of the tagnames of the structures. */ static struct hash_control *tag_hash; @@ -1147,7 +1147,9 @@ coff_obj_read_begin_hook () } symbolS *coff_last_function; +#ifndef OBJ_XCOFF static symbolS *coff_last_bf; +#endif void coff_frob_symbol (symp, punt) @@ -1465,12 +1467,14 @@ obj_coff_section (ignore) { case 'b': flags |= SEC_ALLOC; flags &=~ SEC_LOAD; break; case 'n': flags &=~ SEC_LOAD; flags |= SEC_NEVER_LOAD; break; + + case 's': flags |= SEC_SHARED; /* fall through */ case 'd': flags |= SEC_DATA | SEC_LOAD; /* fall through */ case 'w': flags &=~ SEC_READONLY; break; - case 'a': break; /* For compatability with ELF. */ + + case 'a': break; /* For compatibility with ELF. */ case 'x': flags |= SEC_CODE | SEC_LOAD; break; - case 'r': flags |= SEC_READONLY; break; - case 's': flags |= SEC_SHARED; break; + case 'r': flags |= SEC_DATA | SEC_LOAD | SEC_READONLY; break; case 'i': /* STYP_INFO */ case 'l': /* STYP_LIB */ @@ -2034,7 +2038,7 @@ do_relocs_for (abfd, h, file_cursor) ext_ptr++; #if defined(TC_A29K) /* The 29k has a special kludge for the high 16 bit - reloc. Two relocations are emited, R_IHIHALF, + reloc. Two relocations are emitted, R_IHIHALF, and R_IHCONST. The second one doesn't contain a symbol, but uses the value for offset. */ if (intr.r_type == R_IHIHALF) @@ -2048,7 +2052,7 @@ do_relocs_for (abfd, h, file_cursor) #endif #if defined(TC_OR32) /* The or32 has a special kludge for the high 16 bit - reloc. Two relocations are emited, R_IHIHALF, + reloc. Two relocations are emitted, R_IHIHALF, and R_IHCONST. The second one doesn't contain a symbol, but uses the value for offset. */ if (intr.r_type == R_IHIHALF) @@ -2092,7 +2096,7 @@ do_relocs_for (abfd, h, file_cursor) } /* 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. */ + in the scnhdrs with the info on the file positions. */ static void fill_section (abfd, h, file_cursor) @@ -2960,7 +2964,7 @@ yank_symbols () /* FIXME-SOON: where do dups come from? 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. Do NOT do the opposite (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. */ @@ -3424,7 +3428,7 @@ int coff_flags; #ifndef SUB_SEGMENT_ALIGN #ifdef HANDLE_ALIGN -/* The last subsegment gets an aligment corresponding to the alignment +/* The last subsegment gets an alignment corresponding to the alignment of the section. This allows proper nop-filling at the end of code-bearing sections. */ #define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) \ @@ -3627,7 +3631,7 @@ write_object_file () #if 0 /* Recent changes to write need this, but where it should go is up to Ken.. */ - if (bfd_close_all_done (abfd) == false) + if (!bfd_close_all_done (abfd)) as_fatal (_("Can't close %s: %s"), out_file_name, bfd_errmsg (bfd_get_error ())); #else @@ -4098,8 +4102,8 @@ obj_coff_lcomm (ignore) static void fixup_mdeps (frags, h, this_segment) - fragS * frags; - object_headers * h; + fragS *frags; + object_headers *h ATTRIBUTE_UNUSED; segT this_segment; { subseg_change (this_segment, 0); @@ -4623,8 +4627,8 @@ const pseudo_typeS coff_pseudo_table[] = #endif {"version", s_ignore, 0}, {"ABORT", s_abort, 0}, -#ifdef TC_M88K - /* The m88k uses sdef instead of def. */ +#if defined( TC_M88K ) || defined ( TC_TIC4X ) + /* The m88k and tic4x uses sdef instead of def. */ {"sdef", obj_coff_def, 0}, #endif {NULL, NULL, 0} /* end sentinel */ @@ -4659,6 +4663,7 @@ const struct format_ops coff_format_ops = coff_frob_symbol, 0, /* frob_file */ 0, /* frob_file_before_adjust */ + 0, /* frob_file_before_fix */ coff_frob_file_after_relocs, 0, /* s_get_size */ 0, /* s_set_size */ diff --git a/contrib/binutils/gas/config/obj-coff.h b/contrib/binutils/gas/config/obj-coff.h index 56389c9..5200552 100644 --- a/contrib/binutils/gas/config/obj-coff.h +++ b/contrib/binutils/gas/config/obj-coff.h @@ -1,6 +1,6 @@ /* coff object file format Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2002 + 1999, 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of GAS. @@ -157,6 +157,11 @@ #define TARGET_FORMAT "coff-tic30" #endif +#ifdef TC_TIC4X +#include "coff/tic4x.h" +#define TARGET_FORMAT "coff2-tic4x" +#endif + #ifdef TC_TIC54X #include "coff/tic54x.h" #define TARGET_FORMAT "coff1-c54x" @@ -244,6 +249,12 @@ extern void coff_obj_read_begin_hook PARAMS ((void)); #define OBJ_SYMFIELD_TYPE unsigned long #define sy_obj sy_flags +/* We can't use the predefined section symbols in bfd/section.c, as + COFF symbols have extra fields. See bfd/libcoff.h:coff_symbol_type. */ +#ifndef obj_sec_sym_ok_for_reloc +#define obj_sec_sym_ok_for_reloc(SEC) ((SEC)->owner != 0) +#endif + #define SYM_AUXENT(S) \ (&coffsymbol (symbol_get_bfdsym (S))->native[1].u.auxent) #define SYM_AUXINFO(S) \ @@ -458,7 +469,7 @@ typedef struct #endif /* Symbol table macros and constants. */ -/* Possible and usefull section number in symbol table +/* Possible and useful section number in symbol table The values of TEXT, DATA and BSS may not be portable. */ #define C_ABS_SECTION N_ABS @@ -469,12 +480,14 @@ typedef struct #define C_REGISTER_SECTION 50 /* Macros to extract information from a symbol table entry. - This syntaxic indirection allows independence regarding a.out or coff. + This syntactic indirection allows independence regarding a.out or coff. The argument (s) of all these macros is a pointer to a symbol table entry. */ /* Predicates. */ /* True if the symbol is external. */ -#define S_IS_EXTERNAL(s) ((s)->sy_symbol.ost_entry.n_scnum == C_UNDEF_SECTION) +#define S_IS_EXTERNAL(s) \ + ((s)->sy_symbol.ost_entry.n_scnum == C_UNDEF_SECTION) + /* True if symbol has been defined, ie : section > 0 (DATA, TEXT or BSS) section == 0 and value > 0 (external bss symbol). */ @@ -483,8 +496,17 @@ typedef struct || ((s)->sy_symbol.ost_entry.n_scnum == C_UNDEF_SECTION \ && S_GET_VALUE (s) > 0) \ || ((s)->sy_symbol.ost_entry.n_scnum == C_ABS_SECTION)) + +/* Return true for symbols that should not be reduced to section + symbols or eliminated from expressions, because they may be + overridden by the linker. */ +#define S_FORCE_RELOC(s, strict) \ + (!SEG_NORMAL (S_GET_SEGMENT (s)) || (strict && S_IS_WEAK (s))) + /* True if a debug special symbol entry. */ -#define S_IS_DEBUG(s) ((s)->sy_symbol.ost_entry.n_scnum == C_DEBUG_SECTION) +#define S_IS_DEBUG(s) \ + ((s)->sy_symbol.ost_entry.n_scnum == C_DEBUG_SECTION) + /* True if a symbol is local symbol name. */ /* A symbol name whose name includes ^A is a gas internal pseudo symbol. */ #define S_IS_LOCAL(s) \ @@ -495,13 +517,16 @@ typedef struct || (flag_strip_local_absolute \ && !S_IS_EXTERNAL(s) \ && (s)->sy_symbol.ost_entry.n_scnum == C_ABS_SECTION)) + /* True if a symbol is not defined in this file. */ #define S_IS_EXTERN(s) ((s)->sy_symbol.ost_entry.n_scnum == 0 \ && S_GET_VALUE (s) == 0) + /* True if a symbol can be multiply defined (bss symbols have this def though it is bad practice). */ #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. */ #define S_IS_STRING(s) (strlen(S_GET_NAME(s)) > 8 ? 1 : 0) @@ -518,34 +543,51 @@ typedef struct /* Accessors. */ /* The name of the symbol. */ #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. */ #define S_GET_SEGMENT(s) s_get_segment(s) + /* The data type. */ #define S_GET_DATA_TYPE(s) ((s)->sy_symbol.ost_entry.n_type) + /* The storage class. */ #define S_GET_STORAGE_CLASS(s) ((s)->sy_symbol.ost_entry.n_sclass) + /* The number of auxiliary entries. */ #define S_GET_NUMBER_AUXILIARY(s) ((s)->sy_symbol.ost_entry.n_numaux) /* 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)) +#define S_SET_OFFSET(s,v) \ + ((s)->sy_symbol.ost_entry.n_offset = (v)) + /* The numeric value of the segment. */ -#define S_SET_SEGMENT(s,v) ((s)->sy_symbol.ost_entry.n_scnum = SEGMENT_TO_SYMBOL_TYPE(v)) +#define S_SET_SEGMENT(s,v) \ + ((s)->sy_symbol.ost_entry.n_scnum = SEGMENT_TO_SYMBOL_TYPE(v)) + /* The data type. */ -#define S_SET_DATA_TYPE(s,v) ((s)->sy_symbol.ost_entry.n_type = (v)) +#define S_SET_DATA_TYPE(s,v) \ + ((s)->sy_symbol.ost_entry.n_type = (v)) + /* The storage class. */ -#define S_SET_STORAGE_CLASS(s,v) ((s)->sy_symbol.ost_entry.n_sclass = (v)) +#define S_SET_STORAGE_CLASS(s,v) \ + ((s)->sy_symbol.ost_entry.n_sclass = (v)) + /* The number of auxiliary entries. */ -#define S_SET_NUMBER_AUXILIARY(s,v) ((s)->sy_symbol.ost_entry.n_numaux = (v)) +#define S_SET_NUMBER_AUXILIARY(s,v) \ + ((s)->sy_symbol.ost_entry.n_numaux = (v)) /* Additional modifiers. */ /* The symbol is external (does not mean undefined). */ -#define S_SET_EXTERNAL(s) { S_SET_STORAGE_CLASS(s, C_EXT) ; SF_CLEAR_LOCAL(s); } +#define S_SET_EXTERNAL(s) \ + { S_SET_STORAGE_CLASS(s, C_EXT) ; SF_CLEAR_LOCAL(s); } /* Auxiliary entry macros. SA_ stands for symbol auxiliary. */ /* Omit the tv related fields. */ @@ -753,7 +795,7 @@ typedef struct #define H_SET_SYMBOL_TABLE_SIZE(h,v) ((h)->filehdr.f_nsyms = (v)) #define H_SET_SIZEOF_OPTIONAL_HEADER(h,v) ((h)->filehdr.f_opthdr = (v)) #define H_SET_FLAGS(h,v) ((h)->filehdr.f_flags = (v)) -/* Extra fields to achieve bsd a.out compatibility and for convinience. */ +/* Extra fields to achieve bsd a.out compatibility and for convenience. */ #define H_SET_RELOCATION_SIZE(h,t,d) ((h)->relocation_size = (t)+(d)) #define H_SET_STRING_SIZE(h,v) ((h)->string_table_size = (v)) #define H_SET_LINENO_SIZE(h,v) ((h)->lineno_size = (v)) diff --git a/contrib/binutils/gas/config/obj-ecoff.c b/contrib/binutils/gas/config/obj-ecoff.c index 4d055cb..69f8d9a 100644 --- a/contrib/binutils/gas/config/obj-ecoff.c +++ b/contrib/binutils/gas/config/obj-ecoff.c @@ -1,5 +1,5 @@ /* ECOFF object file format. - Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 + Copyright 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Cygnus Support. This file was put together by Ian Lance Taylor . @@ -98,18 +98,13 @@ const pseudo_typeS obj_pseudo_table[] = { NULL, s_ignore, 0 } }; -/* Swap out the symbols and debugging information for BFD. */ +/* Set section VMAs and GP values before reloc processing. */ void -ecoff_frob_file () +ecoff_frob_file_before_fix () { - const struct ecoff_debug_swap * const debug_swap - = &ecoff_backend (stdoutput)->debug_swap; bfd_vma addr; asection **sec; - HDRR *hdr; - char *buf; - char *set; /* Set the section VMA values. We force the .sdata and .sbss sections to the end to ensure that their VMA addresses are close @@ -177,6 +172,46 @@ ecoff_frob_file () if (secs[i]) bfd_section_list_insert (stdoutput, &stdoutput->sections, secs[i]); + /* Fill in the register masks. */ + { + unsigned long gprmask = 0; + unsigned long fprmask = 0; + unsigned long *cprmask = NULL; + +#ifdef TC_MIPS + /* Fill in the MIPS register masks. It's probably not worth + setting up a generic interface for this. */ + gprmask = mips_gprmask; + cprmask = mips_cprmask; +#endif + +#ifdef TC_ALPHA + alpha_frob_ecoff_data (); + + if (! bfd_ecoff_set_gp_value (stdoutput, alpha_gp_value)) + as_fatal (_("Can't set GP value")); + + gprmask = alpha_gprmask; + fprmask = alpha_fprmask; +#endif + + if (! bfd_ecoff_set_regmasks (stdoutput, gprmask, fprmask, cprmask)) + as_fatal (_("Can't set register masks")); + } +} + +/* Swap out the symbols and debugging information for BFD. */ + +void +ecoff_frob_file () +{ + const struct ecoff_debug_swap * const debug_swap + = &ecoff_backend (stdoutput)->debug_swap; + bfd_vma addr ATTRIBUTE_UNUSED; + HDRR *hdr; + char *buf; + char *set; + /* Build the ECOFF debugging information. */ assert (ecoff_data (stdoutput) != 0); hdr = &ecoff_data (stdoutput)->debug_info.symbolic_header; @@ -204,35 +239,7 @@ ecoff_frob_file () SET (external_rfd, crfd, PTR, debug_swap->external_rfd_size); SET (external_fdr, ifdMax, PTR, debug_swap->external_fdr_size); SET (external_ext, iextMax, PTR, debug_swap->external_ext_size); - #undef SET - - /* Fill in the register masks. */ - { - unsigned long gprmask = 0; - unsigned long fprmask = 0; - unsigned long *cprmask = NULL; - -#ifdef TC_MIPS - /* Fill in the MIPS register masks. It's probably not worth - setting up a generic interface for this. */ - gprmask = mips_gprmask; - cprmask = mips_cprmask; -#endif - -#ifdef TC_ALPHA - alpha_frob_ecoff_data (); - - if (! bfd_ecoff_set_gp_value (stdoutput, alpha_gp_value)) - as_fatal (_("Can't set GP value")); - - gprmask = alpha_gprmask; - fprmask = alpha_fprmask; -#endif - - if (! bfd_ecoff_set_regmasks (stdoutput, gprmask, fprmask, cprmask)) - as_fatal (_("Can't set register masks")); - } } /* This is called by the ECOFF code to set the external information @@ -251,7 +258,7 @@ obj_ecoff_set_ext (sym, ext) know (bfd_asymbol_flavour (symbol_get_bfdsym (sym)) == bfd_target_ecoff_flavour); esym = ecoffsymbol (symbol_get_bfdsym (sym)); - esym->local = false; + esym->local = FALSE; esym->native = xmalloc (debug_swap->external_ext_size); (*debug_swap->swap_ext_out) (stdoutput, ext, esym->native); } @@ -296,6 +303,7 @@ const struct format_ops ecoff_format_ops = obj_ecoff_frob_symbol, ecoff_frob_file, 0, /* frob_file_before_adjust */ + ecoff_frob_file_before_fix, 0, /* frob_file_after_relocs */ 0, /* s_get_size */ 0, /* s_set_size */ diff --git a/contrib/binutils/gas/config/obj-ecoff.h b/contrib/binutils/gas/config/obj-ecoff.h index 01a67d7..54ee043 100644 --- a/contrib/binutils/gas/config/obj-ecoff.h +++ b/contrib/binutils/gas/config/obj-ecoff.h @@ -1,5 +1,5 @@ /* ECOFF object file format header file. - Copyright 1993, 1994, 1995, 1996, 1997, 1999 + Copyright 1993, 1994, 1995, 1996, 1997, 1999, 2002 Free Software Foundation, Inc. Contributed by Cygnus Support. Written by Ian Lance Taylor . @@ -49,6 +49,10 @@ struct ecoff_sy_obj /* Modify the ECOFF symbol. */ #define obj_frob_symbol(symp, punt) ecoff_frob_symbol (symp) +/* Set section VMAs and GP. */ +extern void ecoff_frob_file_before_fix PARAMS ((void)); +#define obj_frob_file_before_fix() ecoff_frob_file_before_fix () + /* This is used to write the symbolic data in the format that BFD expects it. */ extern void ecoff_frob_file PARAMS ((void)); diff --git a/contrib/binutils/gas/config/obj-elf.c b/contrib/binutils/gas/config/obj-elf.c index bbfbf40..14d48f2 100644 --- a/contrib/binutils/gas/config/obj-elf.c +++ b/contrib/binutils/gas/config/obj-elf.c @@ -1,6 +1,6 @@ /* ELF object file format Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 Free Software Foundation, Inc. + 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -25,6 +25,7 @@ #include "subsegs.h" #include "obstack.h" #include "struc-symbol.h" +#include "dwarf2dbg.h" #ifndef ECOFF_DEBUGGING #define ECOFF_DEBUGGING 0 @@ -52,47 +53,25 @@ #include "elf/i370.h" #endif -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 int elf_sec_sym_ok_for_reloc PARAMS ((asection *)); -static void adjust_stab_sections PARAMS ((bfd *, asection *, PTR)); -static void build_group_lists PARAMS ((bfd *, asection *, PTR)); -static int elf_separate_stab_sections PARAMS ((void)); -static void elf_init_stab_section PARAMS ((segT)); -static symbolS *elf_common PARAMS ((int)); - -#ifdef NEED_ECOFF_DEBUG -static boolean elf_get_extr PARAMS ((asymbol *, EXTR *)); -static void elf_set_index PARAMS ((asymbol *, bfd_size_type)); -#endif - -static void obj_elf_line PARAMS ((int)); -void obj_elf_version PARAMS ((int)); -static void obj_elf_size PARAMS ((int)); -static void obj_elf_type PARAMS ((int)); -static void obj_elf_ident PARAMS ((int)); -static void obj_elf_weak PARAMS ((int)); -static void obj_elf_local PARAMS ((int)); -static void obj_elf_visibility PARAMS ((int)); -static void obj_elf_change_section - PARAMS ((const char *, int, int, int, const char *, int, int)); -static int obj_elf_parse_section_letters PARAMS ((char *, size_t)); -static int obj_elf_section_word PARAMS ((char *, size_t)); -static char *obj_elf_section_name PARAMS ((void)); -static int obj_elf_section_type PARAMS ((char *, size_t)); -static void obj_elf_symver PARAMS ((int)); -static void obj_elf_subsection PARAMS ((int)); -static void obj_elf_popsection PARAMS ((int)); -static void obj_elf_tls_common PARAMS ((int)); +static void obj_elf_line (int); +static void obj_elf_size (int); +static void obj_elf_type (int); +static void obj_elf_ident (int); +static void obj_elf_weak (int); +static void obj_elf_local (int); +static void obj_elf_visibility (int); +static void obj_elf_symver (int); +static void obj_elf_subsection (int); +static void obj_elf_popsection (int); +static void obj_elf_tls_common (int); +static void obj_elf_lcomm (int); static const pseudo_typeS elf_pseudo_table[] = { {"comm", obj_elf_common, 0}, {"common", obj_elf_common, 1}, {"ident", obj_elf_ident, 0}, + {"lcomm", obj_elf_lcomm, 0}, {"local", obj_elf_local, 0}, {"previous", obj_elf_previous, 0}, {"section", obj_elf_section, 0}, @@ -121,13 +100,16 @@ 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", (void (*) PARAMS ((int))) &obj_elf_vtable_inherit, 0}, - {"vtable_entry", (void (*) PARAMS ((int))) &obj_elf_vtable_entry, 0}, + {"vtable_inherit", (void (*) (int)) &obj_elf_vtable_inherit, 0}, + {"vtable_entry", (void (*) (int)) &obj_elf_vtable_entry, 0}, /* These are used for dwarf. */ {"2byte", cons, 2}, {"4byte", cons, 4}, {"8byte", cons, 8}, + /* These are used for dwarf2. */ + { "file", (void (*) (int)) dwarf2_directive_file, 0 }, + { "loc", dwarf2_directive_loc, 0 }, /* We need to trap the section changing calls to handle .previous. */ {"data", obj_elf_data, 0}, @@ -190,19 +172,21 @@ static const pseudo_typeS ecoff_debug_pseudo_table[] = /* This is called when the assembler starts. */ void -elf_begin () +elf_begin (void) { + asection *s; + /* Add symbols for the known sections to the symbol table. */ - symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput, - TEXT_SECTION_NAME))); - symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput, - DATA_SECTION_NAME))); - symbol_table_insert (section_symbol (bfd_get_section_by_name (stdoutput, - BSS_SECTION_NAME))); + s = bfd_get_section_by_name (stdoutput, TEXT_SECTION_NAME); + symbol_table_insert (section_symbol (s)); + s = bfd_get_section_by_name (stdoutput, DATA_SECTION_NAME); + symbol_table_insert (section_symbol (s)); + s = bfd_get_section_by_name (stdoutput, BSS_SECTION_NAME); + symbol_table_insert (section_symbol (s)); } void -elf_pop_insert () +elf_pop_insert (void) { pop_insert (elf_pseudo_table); if (ECOFF_DEBUGGING) @@ -210,64 +194,53 @@ elf_pop_insert () } static bfd_vma -elf_s_get_size (sym) - symbolS *sym; +elf_s_get_size (symbolS *sym) { return S_GET_SIZE (sym); } static void -elf_s_set_size (sym, sz) - symbolS *sym; - bfd_vma sz; +elf_s_set_size (symbolS *sym, bfd_vma sz) { S_SET_SIZE (sym, sz); } static bfd_vma -elf_s_get_align (sym) - symbolS *sym; +elf_s_get_align (symbolS *sym) { return S_GET_ALIGN (sym); } static void -elf_s_set_align (sym, align) - symbolS *sym; - bfd_vma align; +elf_s_set_align (symbolS *sym, bfd_vma align) { S_SET_ALIGN (sym, align); } int -elf_s_get_other (sym) - symbolS *sym; +elf_s_get_other (symbolS *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; +elf_s_set_other (symbolS *sym, int other) { S_SET_OTHER (sym, other); } static int -elf_sec_sym_ok_for_reloc (sec) - asection *sec; +elf_sec_sym_ok_for_reloc (asection *sec) { return obj_sec_sym_ok_for_reloc (sec); } void -elf_file_symbol (s) - const char *s; +elf_file_symbol (const char *s) { symbolS *sym; - sym = symbol_new (s, absolute_section, (valueT) 0, (struct frag *) 0); + sym = symbol_new (s, absolute_section, 0, NULL); symbol_set_frag (sym, &zero_address_frag); symbol_get_bfdsym (sym)->flags |= BSF_FILE; @@ -285,189 +258,110 @@ elf_file_symbol (s) #endif } +/* Called from read.c:s_comm after we've parsed .comm symbol, size. + Parse a possible alignment value. */ + static symbolS * -elf_common (is_common) - int is_common; +elf_common_parse (int ignore ATTRIBUTE_UNUSED, symbolS *symbolP, addressT size) { - char *name; - char c; - char *p; - int temp, size; - symbolS *symbolP; - int have_align; + addressT align = 0; + int is_local = symbol_get_obj (symbolP)->local; - if (flag_mri && is_common) + if (*input_line_pointer == ',') { - s_mri_common (0); - return NULL; - } + char *save = input_line_pointer; - name = input_line_pointer; - c = get_symbol_end (); - /* just after name is now '\0' */ - p = input_line_pointer; - *p = c; - SKIP_WHITESPACE (); - if (*input_line_pointer != ',') - { - as_bad (_("expected comma after symbol-name")); - ignore_rest_of_line (); - return NULL; - } - input_line_pointer++; /* skip ',' */ - if ((temp = get_absolute_expression ()) < 0) - { - as_bad (_(".COMMon length (%d.) <0! Ignored."), temp); - ignore_rest_of_line (); - return NULL; - } - size = temp; - *p = 0; - symbolP = symbol_find_or_make (name); - *p = c; - if (S_IS_DEFINED (symbolP) && ! S_IS_COMMON (symbolP)) - { - as_bad (_("symbol `%s' is already defined"), S_GET_NAME (symbolP)); - ignore_rest_of_line (); - return NULL; - } - if (S_GET_VALUE (symbolP) != 0) - { - if (S_GET_VALUE (symbolP) != (valueT) size) - { - as_warn (_("length of .comm \"%s\" is already %ld; not changed to %d"), - S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size); - } - } - know (symbolP->sy_frag == &zero_address_frag); - if (*input_line_pointer != ',') - have_align = 0; - else - { - have_align = 1; input_line_pointer++; SKIP_WHITESPACE (); - } - if (! have_align || *input_line_pointer != '"') - { - if (! have_align) - temp = 0; - else - { - temp = get_absolute_expression (); - if (temp < 0) - { - temp = 0; - as_warn (_("common alignment negative; 0 assumed")); - } - } - if (symbol_get_obj (symbolP)->local) + + if (*input_line_pointer == '"') { - segT old_sec; - int old_subsec; - char *pfrag; - int align; - - /* allocate_bss: */ - old_sec = now_seg; - old_subsec = now_subseg; - if (temp) + /* For sparc. Accept .common symbol, length, "bss" */ + input_line_pointer++; + /* Some use the dot, some don't. */ + if (*input_line_pointer == '.') + input_line_pointer++; + /* Some say data, some say bss. */ + if (strncmp (input_line_pointer, "bss\"", 4) == 0) + input_line_pointer += 4; + else if (strncmp (input_line_pointer, "data\"", 5) == 0) + input_line_pointer += 5; + else { - /* convert to a power of 2 alignment */ - for (align = 0; (temp & 1) == 0; temp >>= 1, ++align); - if (temp != 1) - { - as_bad (_("common alignment not a power of 2")); - ignore_rest_of_line (); - return NULL; - } + char *p = input_line_pointer; + char c; + + while (*--p != '"') + ; + while (!is_end_of_line[(unsigned char) *input_line_pointer]) + if (*input_line_pointer++ == '"') + break; + c = *input_line_pointer; + *input_line_pointer = '\0'; + as_bad (_("bad .common segment %s"), p); + *input_line_pointer = c; + ignore_rest_of_line (); + return NULL; } - else - align = 0; - 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); - 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); - subseg_set (old_sec, old_subsec); + /* ??? Don't ask me why these are always global. */ + is_local = 0; } else { - allocate_common: - S_SET_VALUE (symbolP, (valueT) size); - S_SET_ALIGN (symbolP, temp); - S_SET_EXTERNAL (symbolP); - S_SET_SEGMENT (symbolP, bfd_com_section_ptr); + input_line_pointer = save; + align = parse_align (is_local); + if (align == (addressT) -1) + return NULL; } } + + if (is_local) + { + bss_alloc (symbolP, size, align); + S_CLEAR_EXTERNAL (symbolP); + } else { - input_line_pointer++; - /* @@ Some use the dot, some don't. Can we get some consistency?? */ - if (*input_line_pointer == '.') - input_line_pointer++; - /* @@ Some say data, some say bss. */ - if (strncmp (input_line_pointer, "bss\"", 4) - && strncmp (input_line_pointer, "data\"", 5)) - { - while (*--input_line_pointer != '"') - ; - input_line_pointer--; - goto bad_common_segment; - } - while (*input_line_pointer++ != '"') - ; - goto allocate_common; + S_SET_VALUE (symbolP, size); + S_SET_ALIGN (symbolP, align); + S_SET_EXTERNAL (symbolP); + S_SET_SEGMENT (symbolP, bfd_com_section_ptr); } symbol_get_bfdsym (symbolP)->flags |= BSF_OBJECT; - demand_empty_rest_of_line (); return symbolP; - - { - 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 NULL; - } } void -obj_elf_common (is_common) - int is_common; +obj_elf_common (int is_common) { - elf_common (is_common); + if (flag_mri && is_common) + s_mri_common (0); + else + s_comm_internal (0, elf_common_parse); } static void -obj_elf_tls_common (ignore) - int ignore ATTRIBUTE_UNUSED; +obj_elf_tls_common (int ignore ATTRIBUTE_UNUSED) { - symbolS *symbolP = elf_common (0); + symbolS *symbolP = s_comm_internal (0, elf_common_parse); if (symbolP) symbol_get_bfdsym (symbolP)->flags |= BSF_THREAD_LOCAL; } static void -obj_elf_local (ignore) - int ignore ATTRIBUTE_UNUSED; +obj_elf_lcomm (int ignore ATTRIBUTE_UNUSED) +{ + symbolS *symbolP = s_comm_internal (0, s_lcomm_internal); + + if (symbolP) + symbol_get_bfdsym (symbolP)->flags |= BSF_OBJECT; +} + +static void +obj_elf_local (int ignore ATTRIBUTE_UNUSED) { char *name; int c; @@ -495,8 +389,7 @@ obj_elf_local (ignore) } static void -obj_elf_weak (ignore) - int ignore ATTRIBUTE_UNUSED; +obj_elf_weak (int ignore ATTRIBUTE_UNUSED) { char *name; int c; @@ -524,8 +417,7 @@ obj_elf_weak (ignore) } static void -obj_elf_visibility (visibility) - int visibility; +obj_elf_visibility (int visibility) { char *name; int c; @@ -595,90 +487,19 @@ static struct section_stack *section_stack; other possibilities, but I don't know what they are. In any case, BFD doesn't really let us set the section type. */ -/* Certain named sections have particular defined types, listed on p. - 4-19 of the ABI. */ -struct special_section -{ - const char *name; - int type; - int attributes; -}; - -static struct special_section const special_sections[] = -{ - { ".bss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, - { ".comment", SHT_PROGBITS, 0 }, - { ".data", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".data1", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".debug", SHT_PROGBITS, 0 }, - { ".fini", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { ".init", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, - { ".line", SHT_PROGBITS, 0 }, - { ".note", SHT_NOTE, 0 }, - { ".rodata", SHT_PROGBITS, SHF_ALLOC }, - { ".rodata1", SHT_PROGBITS, SHF_ALLOC }, - { ".tbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS }, - { ".tdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_TLS }, - { ".text", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR }, -#if 0 - /* FIXME: The current gcc, as of 2002-03-03, will emit - - .section .init_array,"aw",@progbits - - for __attribute__ ((section (".init_array"))). "@progbits" marks - the incorrect section type. For now, we make them with - SHT_PROGBITS. BFD will fix the section type. Gcc should be changed - to emit - - .section .init_array - - */ - { ".init_array",SHT_INIT_ARRAY, SHF_ALLOC + SHF_WRITE }, - { ".fini_array",SHT_FINI_ARRAY, SHF_ALLOC + SHF_WRITE }, - { ".preinit_array",SHT_PREINIT_ARRAY, SHF_ALLOC + SHF_WRITE }, -#else - { ".init_array",SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".fini_array",SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, - { ".preinit_array",SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, -#endif - -#ifdef ELF_TC_SPECIAL_SECTIONS - ELF_TC_SPECIAL_SECTIONS -#endif - -#if 0 - /* The following section names are special, but they can not - reasonably appear in assembler code. Some of the attributes are - processor dependent. */ - { ".dynamic", SHT_DYNAMIC, SHF_ALLOC /* + SHF_WRITE */ }, - { ".dynstr", SHT_STRTAB, SHF_ALLOC }, - { ".dynsym", SHT_DYNSYM, SHF_ALLOC }, - { ".got", SHT_PROGBITS, 0 }, - { ".hash", SHT_HASH, SHF_ALLOC }, - { ".interp", SHT_PROGBITS, /* SHF_ALLOC */ }, - { ".plt", SHT_PROGBITS, 0 }, - { ".shstrtab",SHT_STRTAB, 0 }, - { ".strtab", SHT_STRTAB, /* SHF_ALLOC */ }, - { ".symtab", SHT_SYMTAB, /* SHF_ALLOC */ }, -#endif - - { NULL, 0, 0 } -}; - -static void -obj_elf_change_section (name, type, attr, entsize, group_name, linkonce, push) - const char *name; - int type; - int attr; - int entsize; - const char *group_name; - int linkonce; - int push; +void +obj_elf_change_section (const char *name, + int type, + int attr, + int entsize, + const char *group_name, + int linkonce, + int push) { asection *old_sec; segT sec; flagword flags; - int i; + const struct bfd_elf_special_section *ssect; #ifdef md_flush_pending_output md_flush_pending_output (); @@ -701,40 +522,79 @@ obj_elf_change_section (name, type, attr, entsize, group_name, linkonce, push) old_sec = bfd_get_section_by_name (stdoutput, name); sec = subseg_new (name, 0); + ssect = _bfd_elf_get_sec_type_attr (stdoutput, name); - /* 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_warn (_("setting incorrect section type for %s"), name); - } - else - { - as_warn (_("ignoring incorrect section type for %s"), name); - type = special_sections[i].type; - } - } - 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) + if (ssect != NULL) + { + bfd_boolean override = FALSE; + + if (type == SHT_NULL) + type = ssect->type; + else if (type != ssect->type) + { + if (old_sec == NULL + /* FIXME: gcc, as of 2002-10-22, will emit + + .section .init_array,"aw",@progbits + + for __attribute__ ((section (".init_array"))). + "@progbits" is incorrect. */ + && ssect->type != SHT_INIT_ARRAY + && ssect->type != SHT_FINI_ARRAY + && ssect->type != SHT_PREINIT_ARRAY) + { + /* We allow to specify any type for a .note section. */ + if (ssect->type != SHT_NOTE) + as_warn (_("setting incorrect section type for %s"), + name); + } + else + { + as_warn (_("ignoring incorrect section type for %s"), + name); + type = ssect->type; + } + } + + if (old_sec == NULL && (attr & ~ssect->attr) != 0) + { + /* As a GNU extension, we permit a .note section to be + allocatable. If the linker sees an allocatable .note + section, it will create a PT_NOTE segment in the output + file. We also allow "x" for .note.GNU-stack. */ + if (ssect->type == SHT_NOTE + && (attr == SHF_ALLOC || attr == SHF_EXECINSTR)) + ; + /* Allow different SHF_MERGE and SHF_STRINGS if we have + something like .rodata.str. */ + else if (ssect->suffix_length == -2 + && name[ssect->prefix_length] == '.' + && (attr + & ~ssect->attr + & ~SHF_MERGE + & ~SHF_STRINGS) == 0) + ; + /* .interp, .strtab and .symtab can have SHF_ALLOC. */ + else if (attr == SHF_ALLOC + && (strcmp (name, ".interp") == 0 + || strcmp (name, ".strtab") == 0 + || strcmp (name, ".symtab") == 0)) + override = TRUE; + else + { as_warn (_("setting incorrect section attributes for %s"), name); - } - attr |= special_sections[i].attributes; - break; - } + override = TRUE; + } + } + if (!override && old_sec == NULL) + attr |= ssect->attr; + } + + if (type != SHT_NULL) + elf_section_type (sec) = type; + if (attr != 0) + elf_section_flags (sec) = attr; /* Convert ELF type and flags to BFD flags. */ flags = (SEC_RELOC @@ -755,20 +615,21 @@ obj_elf_change_section (name, type, attr, entsize, group_name, linkonce, push) /* Prevent SEC_HAS_CONTENTS from being inadvertently set. */ if (type == SHT_NOBITS) - seg_info (sec)->bss = 1; + seg_info (sec)->bss = 1; + if (linkonce) + flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; bfd_set_section_flags (stdoutput, sec, flags); if (flags & SEC_MERGE) sec->entsize = entsize; elf_group_name (sec) = group_name; - elf_linkonce_p (sec) = linkonce; /* Add a symbol for this section to the symbol table. */ secsym = symbol_find (name); if (secsym != NULL) symbol_set_bfdsym (secsym, sec->symbol); else - symbol_table_insert (section_symbol (sec)); + symbol_table_insert (section_symbol (sec)); } else if (attr != 0) { @@ -778,8 +639,8 @@ obj_elf_change_section (name, type, attr, entsize, group_name, linkonce, push) if (((old_sec->flags ^ flags) & (SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE | SEC_EXCLUDE | SEC_SORT_ENTRIES | SEC_MERGE | SEC_STRINGS - | SEC_THREAD_LOCAL)) - || linkonce != elf_linkonce_p (sec)) + | SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD + | SEC_THREAD_LOCAL))) as_warn (_("ignoring changed section attributes for %s"), name); if ((flags & SEC_MERGE) && old_sec->entsize != (unsigned) entsize) as_warn (_("ignoring changed section entity size for %s"), name); @@ -794,9 +655,7 @@ obj_elf_change_section (name, type, attr, entsize, group_name, linkonce, push) } static int -obj_elf_parse_section_letters (str, len) - char *str; - size_t len; +obj_elf_parse_section_letters (char *str, size_t len) { int attr = 0; @@ -846,10 +705,7 @@ obj_elf_parse_section_letters (str, len) attr |= md_attr; else #endif - { - as_warn ("%s", bad_msg); - attr = -1; - } + as_fatal ("%s", bad_msg); } break; } @@ -860,9 +716,7 @@ obj_elf_parse_section_letters (str, len) } static int -obj_elf_section_word (str, len) - char *str; - size_t len; +obj_elf_section_word (char *str, size_t len) { if (len == 5 && strncmp (str, "write", 5) == 0) return SHF_WRITE; @@ -870,6 +724,8 @@ obj_elf_section_word (str, len) return SHF_ALLOC; if (len == 9 && strncmp (str, "execinstr", 9) == 0) return SHF_EXECINSTR; + if (len == 3 && strncmp (str, "tls", 3) == 0) + return SHF_TLS; #ifdef md_elf_section_word { @@ -884,14 +740,14 @@ obj_elf_section_word (str, len) } static int -obj_elf_section_type (str, len) - char *str; - size_t len; +obj_elf_section_type (char *str, size_t len) { if (len == 8 && strncmp (str, "progbits", 8) == 0) return SHT_PROGBITS; if (len == 6 && strncmp (str, "nobits", 6) == 0) return SHT_NOBITS; + if (len == 4 && strncmp (str, "note", 4) == 0) + return SHT_NOTE; #ifdef md_elf_section_type { @@ -907,7 +763,7 @@ obj_elf_section_type (str, len) /* Get name of section. */ static char * -obj_elf_section_name () +obj_elf_section_name (void) { char *name; @@ -931,7 +787,7 @@ obj_elf_section_name () end++; if (end == input_line_pointer) { - as_warn (_("missing name")); + as_bad (_("missing name")); ignore_rest_of_line (); return NULL; } @@ -939,6 +795,9 @@ obj_elf_section_name () name = xmalloc (end - input_line_pointer + 1); memcpy (name, input_line_pointer, end - input_line_pointer); name[end - input_line_pointer] = '\0'; +#ifdef tc_canonicalize_section_name + name = tc_canonicalize_section_name (name); +#endif input_line_pointer = end; } SKIP_WHITESPACE (); @@ -946,8 +805,7 @@ obj_elf_section_name () } void -obj_elf_section (push) - int push; +obj_elf_section (int push) { char *name, *group_name, *beg; int type, attr, dummy; @@ -1080,7 +938,7 @@ obj_elf_section (push) SKIP_WHITESPACE (); if (*input_line_pointer != '#') { - as_warn (_("character following name is not '#'")); + as_bad (_("character following name is not '#'")); ignore_rest_of_line (); return; } @@ -1105,8 +963,7 @@ obj_elf_section (push) /* Change to the .data section. */ void -obj_elf_data (i) - int i; +obj_elf_data (int i) { #ifdef md_flush_pending_output md_flush_pending_output (); @@ -1124,8 +981,7 @@ obj_elf_data (i) /* Change to the .text section. */ void -obj_elf_text (i) - int i; +obj_elf_text (int i) { #ifdef md_flush_pending_output md_flush_pending_output (); @@ -1141,8 +997,7 @@ obj_elf_text (i) } static void -obj_elf_subsection (ignore) - int ignore ATTRIBUTE_UNUSED; +obj_elf_subsection (int ignore ATTRIBUTE_UNUSED) { register int temp; @@ -1166,15 +1021,14 @@ obj_elf_subsection (ignore) sections. */ void -obj_elf_section_change_hook () +obj_elf_section_change_hook (void) { previous_section = now_seg; previous_subsection = now_subseg; } void -obj_elf_previous (ignore) - int ignore ATTRIBUTE_UNUSED; +obj_elf_previous (int ignore ATTRIBUTE_UNUSED) { segT new_section; int new_subsection; @@ -1201,8 +1055,7 @@ obj_elf_previous (ignore) } static void -obj_elf_popsection (xxx) - int xxx ATTRIBUTE_UNUSED; +obj_elf_popsection (int xxx ATTRIBUTE_UNUSED) { struct section_stack *top = section_stack; @@ -1228,12 +1081,11 @@ obj_elf_popsection (xxx) } static void -obj_elf_line (ignore) - int ignore ATTRIBUTE_UNUSED; +obj_elf_line (int ignore ATTRIBUTE_UNUSED) { /* 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 ())); + new_logical_line (NULL, get_absolute_expression ()); demand_empty_rest_of_line (); } @@ -1244,8 +1096,7 @@ obj_elf_line (ignore) with the same value as the symbol NAME. */ static void -obj_elf_symver (ignore) - int ignore ATTRIBUTE_UNUSED; +obj_elf_symver (int ignore ATTRIBUTE_UNUSED) { char *name; char c; @@ -1268,6 +1119,7 @@ obj_elf_symver (ignore) } ++input_line_pointer; + SKIP_WHITESPACE (); name = input_line_pointer; /* Temporarily include '@' in symbol names. */ @@ -1314,8 +1166,7 @@ obj_elf_symver (ignore) syntax is ".vtable_inherit CHILDNAME, PARENTNAME". */ struct fix * -obj_elf_vtable_inherit (ignore) - int ignore ATTRIBUTE_UNUSED; +obj_elf_vtable_inherit (int ignore ATTRIBUTE_UNUSED) { char *cname, *pname; symbolS *csym, *psym; @@ -1386,8 +1237,7 @@ obj_elf_vtable_inherit (ignore) ".vtable_entry tablename, offset". */ struct fix * -obj_elf_vtable_entry (ignore) - int ignore ATTRIBUTE_UNUSED; +obj_elf_vtable_entry (int ignore ATTRIBUTE_UNUSED) { char *name; symbolS *sym; @@ -1423,7 +1273,7 @@ obj_elf_vtable_entry (ignore) } void -elf_obj_read_begin_hook () +elf_obj_read_begin_hook (void) { #ifdef NEED_ECOFF_DEBUG if (ECOFF_DEBUGGING) @@ -1432,8 +1282,7 @@ elf_obj_read_begin_hook () } void -elf_obj_symbol_new_hook (symbolP) - symbolS *symbolP; +elf_obj_symbol_new_hook (symbolS *symbolP) { struct elf_obj_sy *sy_obj; @@ -1452,16 +1301,14 @@ elf_obj_symbol_new_hook (symbolP) context. */ void -elf_copy_symbol_attributes (dest, src) - symbolS *dest, *src; +elf_copy_symbol_attributes (symbolS *dest, symbolS *src) { struct elf_obj_sy *srcelf = symbol_get_obj (src); struct elf_obj_sy *destelf = symbol_get_obj (dest); if (srcelf->size) { if (destelf->size == NULL) - destelf->size = - (expressionS *) xmalloc (sizeof (expressionS)); + destelf->size = xmalloc (sizeof (expressionS)); *destelf->size = *srcelf->size; } else @@ -1477,8 +1324,7 @@ elf_copy_symbol_attributes (dest, src) } void -obj_elf_version (ignore) - int ignore ATTRIBUTE_UNUSED; +obj_elf_version (int ignore ATTRIBUTE_UNUSED) { char *name; unsigned int c; @@ -1487,7 +1333,7 @@ obj_elf_version (ignore) subsegT subseg = now_subseg; Elf_Internal_Note i_note; Elf_External_Note e_note; - asection *note_secp = (asection *) NULL; + asection *note_secp = NULL; int len; SKIP_WHITESPACE (); @@ -1518,11 +1364,11 @@ obj_elf_version (ignore) i_note.descsz = 0; /* no description */ i_note.type = NT_VERSION; p = frag_more (sizeof (e_note.namesz)); - md_number_to_chars (p, (valueT) i_note.namesz, sizeof (e_note.namesz)); + md_number_to_chars (p, i_note.namesz, sizeof (e_note.namesz)); p = frag_more (sizeof (e_note.descsz)); - md_number_to_chars (p, (valueT) i_note.descsz, sizeof (e_note.descsz)); + md_number_to_chars (p, i_note.descsz, sizeof (e_note.descsz)); p = frag_more (sizeof (e_note.type)); - md_number_to_chars (p, (valueT) i_note.type, sizeof (e_note.type)); + md_number_to_chars (p, i_note.type, sizeof (e_note.type)); p = frag_more (len + 1); strcpy (p, name); @@ -1538,8 +1384,7 @@ obj_elf_version (ignore) } static void -obj_elf_size (ignore) - int ignore ATTRIBUTE_UNUSED; +obj_elf_size (int ignore ATTRIBUTE_UNUSED) { char *name = input_line_pointer; char c = get_symbol_end (); @@ -1580,8 +1425,7 @@ obj_elf_size (ignore) } else { - symbol_get_obj (sym)->size = - (expressionS *) xmalloc (sizeof (expressionS)); + symbol_get_obj (sym)->size = xmalloc (sizeof (expressionS)); *symbol_get_obj (sym)->size = exp; } demand_empty_rest_of_line (); @@ -1603,8 +1447,7 @@ obj_elf_size (ignore) */ static void -obj_elf_type (ignore) - int ignore ATTRIBUTE_UNUSED; +obj_elf_type (int ignore ATTRIBUTE_UNUSED) { char *name; char c; @@ -1640,6 +1483,12 @@ obj_elf_type (ignore) else if (strcmp (typename, "object") == 0 || strcmp (typename, "STT_OBJECT") == 0) type = BSF_OBJECT; + else if (strcmp (typename, "tls_object") == 0 + || strcmp (typename, "STT_TLS") == 0) + type = BSF_OBJECT | BSF_THREAD_LOCAL; + else if (strcmp (typename, "notype") == 0 + || strcmp (typename, "STT_NOTYPE") == 0) + ; #ifdef md_elf_symbol_type else if ((type = md_elf_symbol_type (typename, sym, elfsym)) != -1) ; @@ -1658,8 +1507,7 @@ obj_elf_type (ignore) } static void -obj_elf_ident (ignore) - int ignore ATTRIBUTE_UNUSED; +obj_elf_ident (int ignore ATTRIBUTE_UNUSED) { static segT comment_section; segT old_section = now_seg; @@ -1689,8 +1537,7 @@ obj_elf_ident (ignore) /* The first entry in a .stabs section is special. */ void -obj_elf_init_stab_section (seg) - segT seg; +obj_elf_init_stab_section (segT seg) { char *file; char *p; @@ -1705,8 +1552,8 @@ obj_elf_init_stab_section (seg) p = frag_more (12); /* Zero it out. */ memset (p, 0, 12); - as_where (&file, (unsigned int *) NULL); - stabstr_name = (char *) xmalloc (strlen (segment_name (seg)) + 4); + as_where (&file, NULL); + stabstr_name = xmalloc (strlen (segment_name (seg)) + 4); strcpy (stabstr_name, segment_name (seg)); strcat (stabstr_name, "str"); stroff = get_stab_string_offset (file, stabstr_name); @@ -1720,10 +1567,7 @@ obj_elf_init_stab_section (seg) /* Fill in the counts in the first entry in a .stabs section. */ static void -adjust_stab_sections (abfd, sec, xxx) - bfd *abfd; - asection *sec; - PTR xxx ATTRIBUTE_UNUSED; +adjust_stab_sections (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED) { char *name; asection *strsec; @@ -1735,7 +1579,7 @@ adjust_stab_sections (abfd, sec, xxx) if (!strcmp ("str", sec->name + strlen (sec->name) - 3)) return; - name = (char *) alloca (strlen (sec->name) + 4); + name = alloca (strlen (sec->name) + 4); strcpy (name, sec->name); strcat (name, "str"); strsec = bfd_get_section_by_name (abfd, name); @@ -1748,8 +1592,8 @@ adjust_stab_sections (abfd, sec, xxx) p = seg_info (sec)->stabu.p; assert (p != 0); - bfd_h_put_16 (abfd, (bfd_vma) nsyms, (bfd_byte *) p + 6); - bfd_h_put_32 (abfd, (bfd_vma) strsz, (bfd_byte *) p + 8); + bfd_h_put_16 (abfd, nsyms, p + 6); + bfd_h_put_32 (abfd, strsz, p + 8); } #ifdef NEED_ECOFF_DEBUG @@ -1761,45 +1605,37 @@ adjust_stab_sections (abfd, sec, xxx) in the symbol. */ void -elf_ecoff_set_ext (sym, ext) - symbolS *sym; - struct ecoff_extr *ext; +elf_ecoff_set_ext (symbolS *sym, struct ecoff_extr *ext) { - symbol_get_bfdsym (sym)->udata.p = (PTR) ext; + symbol_get_bfdsym (sym)->udata.p = ext; } /* This function is called by bfd_ecoff_debug_externals. It is supposed to *EXT to the external symbol information, and return whether the symbol should be used at all. */ -static boolean -elf_get_extr (sym, ext) - asymbol *sym; - EXTR *ext; +static bfd_boolean +elf_get_extr (asymbol *sym, EXTR *ext) { if (sym->udata.p == NULL) - return false; + return FALSE; *ext = *(EXTR *) sym->udata.p; - return true; + return TRUE; } /* This function is called by bfd_ecoff_debug_externals. It has nothing to do for ELF. */ -/*ARGSUSED*/ static void -elf_set_index (sym, indx) - asymbol *sym ATTRIBUTE_UNUSED; - bfd_size_type indx ATTRIBUTE_UNUSED; +elf_set_index (asymbol *sym ATTRIBUTE_UNUSED, + bfd_size_type indx ATTRIBUTE_UNUSED) { } #endif /* NEED_ECOFF_DEBUG */ void -elf_frob_symbol (symp, puntp) - symbolS *symp; - int *puntp; +elf_frob_symbol (symbolS *symp, int *puntp) { struct elf_obj_sy *sy_obj; @@ -1842,9 +1678,9 @@ elf_frob_symbol (symp, puntp) /* This symbol was given a new name with the .symver directive. - If this is an external reference, just rename the symbol to - include the version string. This will make the relocs be - against the correct versioned symbol. + If this is an external reference, just rename the symbol to + include the version string. This will make the relocs be + against the correct versioned symbol. If this is a definition, add an alias. FIXME: Using an alias will permit the debugging information to refer to the right @@ -1854,26 +1690,26 @@ elf_frob_symbol (symp, puntp) if (! S_IS_DEFINED (symp)) { /* Verify that the name isn't using the @@ syntax--this is - reserved for definitions of the default version to link - against. */ + reserved for definitions of the default version to link + against. */ if (p[1] == ELF_VER_CHR) { as_bad (_("invalid attempt to declare external version name as default in symbol `%s'"), sy_obj->versioned_name); - *puntp = true; + *puntp = TRUE; } S_SET_NAME (symp, sy_obj->versioned_name); } else { - if (p [1] == ELF_VER_CHR && p [2] == ELF_VER_CHR) + if (p[1] == ELF_VER_CHR && p[2] == ELF_VER_CHR) { size_t l; /* 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); + memmove (&p[2], &p[3], l); S_SET_NAME (symp, sy_obj->versioned_name); } else @@ -1965,12 +1801,9 @@ struct group_list each list. */ static void -build_group_lists (abfd, sec, inf) - bfd *abfd ATTRIBUTE_UNUSED; - asection *sec; - PTR inf; +build_group_lists (bfd *abfd ATTRIBUTE_UNUSED, asection *sec, void *inf) { - struct group_list *list = (struct group_list *) inf; + struct group_list *list = inf; const char *group_name = elf_group_name (sec); unsigned int i; @@ -2006,18 +1839,18 @@ build_group_lists (abfd, sec, inf) } void -elf_frob_file () +elf_frob_file (void) { struct group_list list; unsigned int i; - bfd_map_over_sections (stdoutput, adjust_stab_sections, (PTR) 0); + bfd_map_over_sections (stdoutput, adjust_stab_sections, NULL); /* Go find section groups. */ list.num_group = 0; list.head = NULL; list.elt_count = NULL; - bfd_map_over_sections (stdoutput, build_group_lists, (PTR) &list); + bfd_map_over_sections (stdoutput, build_group_lists, &list); /* Make the SHT_GROUP sections that describe each section group. We can't set up the section contents here yet, because elf section @@ -2034,7 +1867,7 @@ elf_frob_file () flags = SEC_READONLY | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_GROUP; for (s = list.head[i]; s != NULL; s = elf_next_in_group (s)) - if (elf_linkonce_p (s) != ((flags & SEC_LINK_ONCE) != 0)) + if ((s->flags ^ flags) & SEC_LINK_ONCE) { flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; if (s != list.head[i]) @@ -2064,6 +1897,7 @@ elf_frob_file () as_fatal (_("can't create group: %s"), bfd_errmsg (bfd_get_error ())); } + elf_section_type (s) = SHT_GROUP; /* Pass a pointer to the first section in this group. */ elf_next_in_group (s) = list.head[i]; @@ -2083,7 +1917,7 @@ elf_frob_file () /* It removes any unneeded versioned symbols from the symbol table. */ void -elf_frob_file_before_adjust () +elf_frob_file_before_adjust (void) { if (symbol_rootP) { @@ -2103,10 +1937,10 @@ elf_frob_file_before_adjust () 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) + if (p[1] == ELF_VER_CHR && p[2] == ELF_VER_CHR) { size_t l = strlen (&p[3]) + 1; - memmove (&p [1], &p[3], l); + memmove (&p[1], &p[3], l); } if (symbol_used_p (symp) == 0 && symbol_used_in_reloc_p (symp) == 0) @@ -2130,7 +1964,7 @@ elf_frob_file_before_adjust () have generated the relocation section. */ void -elf_frob_file_after_relocs () +elf_frob_file_after_relocs (void) { #ifdef NEED_ECOFF_DEBUG if (ECOFF_DEBUGGING) @@ -2143,7 +1977,7 @@ elf_frob_file_after_relocs () debug_swap = get_elf_backend_data (stdoutput)->elf_backend_ecoff_debug_swap; - know (debug_swap != (const struct ecoff_debug_swap *) NULL); + know (debug_swap != NULL); ecoff_build_debug (&debug.symbolic_header, &buf, debug_swap); /* Set up the pointers in debug. */ @@ -2151,14 +1985,14 @@ elf_frob_file_after_relocs () debug.ptr = (type) (buf + debug.symbolic_header.offset) SET (line, cbLineOffset, unsigned char *); - SET (external_dnr, cbDnOffset, PTR); - SET (external_pdr, cbPdOffset, PTR); - SET (external_sym, cbSymOffset, PTR); - SET (external_opt, cbOptOffset, PTR); + SET (external_dnr, cbDnOffset, void *); + SET (external_pdr, cbPdOffset, void *); + SET (external_sym, cbSymOffset, void *); + SET (external_opt, cbOptOffset, void *); SET (external_aux, cbAuxOffset, union aux_ext *); SET (ss, cbSsOffset, char *); - SET (external_fdr, cbFdOffset, PTR); - SET (external_rfd, cbRfdOffset, PTR); + SET (external_fdr, cbFdOffset, void *); + SET (external_rfd, cbRfdOffset, void *); /* ssext and external_ext are set up just below. */ #undef SET @@ -2166,7 +2000,7 @@ elf_frob_file_after_relocs () /* Set up the external symbols. */ debug.ssext = debug.ssext_end = NULL; debug.external_ext = debug.external_ext_end = NULL; - if (! bfd_ecoff_debug_externals (stdoutput, &debug, debug_swap, true, + if (! bfd_ecoff_debug_externals (stdoutput, &debug, debug_swap, TRUE, elf_get_extr, elf_set_index)) as_fatal (_("failed to set up debugging information: %s"), bfd_errmsg (bfd_get_error ())); @@ -2174,7 +2008,7 @@ elf_frob_file_after_relocs () sec = bfd_get_section_by_name (stdoutput, ".mdebug"); assert (sec != NULL); - know (stdoutput->output_has_begun == false); + know (!stdoutput->output_has_begun); /* We set the size of the section, call bfd_set_section_contents to force the ELF backend to allocate a file position, and then @@ -2183,15 +2017,14 @@ elf_frob_file_after_relocs () sec->_raw_size = bfd_ecoff_debug_size (stdoutput, &debug, debug_swap); /* Pass BUF to bfd_set_section_contents because this will - eventually become a call to fwrite, and ISO C prohibits - passing a NULL pointer to a stdio function even if the - pointer will not be used. */ - if (! bfd_set_section_contents (stdoutput, sec, (PTR) buf, - (file_ptr) 0, (bfd_size_type) 0)) + eventually become a call to fwrite, and ISO C prohibits + passing a NULL pointer to a stdio function even if the + pointer will not be used. */ + if (! bfd_set_section_contents (stdoutput, sec, buf, 0, 0)) as_fatal (_("can't start writing .mdebug section: %s"), bfd_errmsg (bfd_get_error ())); - know (stdoutput->output_has_begun == true); + know (stdoutput->output_has_begun); know (sec->filepos != 0); if (! bfd_ecoff_write_debug (stdoutput, &debug, debug_swap, @@ -2204,7 +2037,7 @@ elf_frob_file_after_relocs () #ifdef SCO_ELF -/* Heavily plagarized from obj_elf_version. The idea is to emit the +/* Heavily plagiarized from obj_elf_version. The idea is to emit the SCO specific identifier in the .notes section to satisfy the SCO linker. @@ -2224,7 +2057,7 @@ elf_frob_file_after_relocs () int_32 version = (major ver # << 16) | version of tools ; int_32 source = (tool_id << 16 ) | 1 ; int_32 info = 0 ; These are set by the SCO tools, but we - don't know enough about the source + don't know enough about the source environment to set them. SCO ld currently ignores them, and recommends we set them to zero. */ @@ -2233,7 +2066,7 @@ elf_frob_file_after_relocs () #define SCO_MINOR_VERSION 0x1 void -sco_id () +sco_id (void) { char *name; @@ -2244,7 +2077,7 @@ sco_id () subsegT subseg = now_subseg; Elf_Internal_Note i_note; Elf_External_Note e_note; - asection *note_secp = (asection *) NULL; + asection *note_secp = NULL; int i, len; /* create the .note section */ @@ -2261,13 +2094,13 @@ sco_id () i_note.type = NT_VERSION; /* Contains a version string */ p = frag_more (sizeof (i_note.namesz)); - md_number_to_chars (p, (valueT) i_note.namesz, 4); + md_number_to_chars (p, i_note.namesz, 4); p = frag_more (sizeof (i_note.descsz)); - md_number_to_chars (p, (valueT) i_note.descsz, 4); + md_number_to_chars (p, i_note.descsz, 4); p = frag_more (sizeof (i_note.type)); - md_number_to_chars (p, (valueT) i_note.type, 4); + md_number_to_chars (p, i_note.type, 4); p = frag_more (4); strcpy (p, "SCO"); @@ -2300,7 +2133,7 @@ sco_id () #endif /* SCO_ELF */ static int -elf_separate_stab_sections () +elf_separate_stab_sections (void) { #ifdef NEED_ECOFF_DEBUG return (!ECOFF_DEBUGGING); @@ -2310,8 +2143,7 @@ elf_separate_stab_sections () } static void -elf_init_stab_section (seg) - segT seg; +elf_init_stab_section (segT seg) { #ifdef NEED_ECOFF_DEBUG if (!ECOFF_DEBUGGING) @@ -2329,6 +2161,7 @@ const struct format_ops elf_format_ops = elf_frob_symbol, elf_frob_file, elf_frob_file_before_adjust, + 0, /* obj_frob_file_before_fix */ elf_frob_file_after_relocs, elf_s_get_size, elf_s_set_size, elf_s_get_align, elf_s_set_align, diff --git a/contrib/binutils/gas/config/obj-elf.h b/contrib/binutils/gas/config/obj-elf.h index 6197bf1..e713797 100644 --- a/contrib/binutils/gas/config/obj-elf.h +++ b/contrib/binutils/gas/config/obj-elf.h @@ -1,6 +1,6 @@ /* ELF object file format. - Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, + 2002, 2003 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -100,7 +100,7 @@ struct elf_obj_sy #ifndef obj_begin #define obj_begin() elf_begin () #endif -extern void elf_begin PARAMS ((void)); +extern void elf_begin (void); /* should be conditional on address size! */ #define elf_symbol(asymbol) ((elf_symbol_type *) (&(asymbol)->the_bfd)) @@ -123,7 +123,7 @@ extern void elf_begin PARAMS ((void)); (elf_symbol (symbol_get_bfdsym (S))->internal_elf_sym.st_value = (V)) #endif -int elf_s_get_other PARAMS ((symbolS *)); +int elf_s_get_other (symbolS *); #ifndef S_GET_OTHER #define S_GET_OTHER(S) (elf_s_get_other (S)) #endif @@ -134,54 +134,63 @@ int elf_s_get_other PARAMS ((symbolS *)); extern asection *gdb_section; +#ifndef obj_sec_set_private_data +#define obj_sec_set_private_data(B, S) \ + if (! BFD_SEND ((B), _new_section_hook, ((B), (S)))) \ + as_fatal (_("can't allocate ELF private section data: %s"), \ + bfd_errmsg (bfd_get_error ())) +#endif + #ifndef obj_frob_file #define obj_frob_file elf_frob_file #endif -extern void elf_frob_file PARAMS ((void)); +extern void elf_frob_file (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)); +extern void elf_frob_file_before_adjust (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)); +extern void elf_frob_file_after_relocs (void); #ifndef obj_app_file #define obj_app_file elf_file_symbol #endif -extern void elf_file_symbol PARAMS ((const char *)); +extern void elf_file_symbol (const char *); -extern void obj_elf_section_change_hook PARAMS ((void)); +extern void obj_elf_section_change_hook (void); -extern void obj_elf_section PARAMS ((int)); -extern void obj_elf_previous PARAMS ((int)); -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)); +extern void obj_elf_section (int); +extern void obj_elf_previous (int); +extern void obj_elf_version (int); +extern void obj_elf_common (int); +extern void obj_elf_data (int); +extern void obj_elf_text (int); +extern void obj_elf_change_section + (const char *, int, int, int, const char *, int, int); +extern struct fix *obj_elf_vtable_inherit (int); +extern struct fix *obj_elf_vtable_entry (int); /* BFD wants to write the udata field, which is a no-no for the - globally defined sections. */ + predefined section symbols in bfd/section.c. They are read-only. */ #ifndef obj_sec_sym_ok_for_reloc #define obj_sec_sym_ok_for_reloc(SEC) ((SEC)->owner != 0) #endif -void elf_obj_read_begin_hook PARAMS ((void)); +void elf_obj_read_begin_hook (void); #ifndef obj_read_begin_hook #define obj_read_begin_hook elf_obj_read_begin_hook #endif -void elf_obj_symbol_new_hook PARAMS ((symbolS *)); +void elf_obj_symbol_new_hook (symbolS *); #ifndef obj_symbol_new_hook #define obj_symbol_new_hook elf_obj_symbol_new_hook #endif -void elf_copy_symbol_attributes PARAMS ((symbolS *, symbolS *)); +void elf_copy_symbol_attributes (symbolS *, symbolS *); #ifndef OBJ_COPY_SYMBOL_ATTRIBUTES #define OBJ_COPY_SYMBOL_ATTRIBUTES(DEST, SRC) \ (elf_copy_symbol_attributes (DEST, SRC)) @@ -198,7 +207,7 @@ void elf_copy_symbol_attributes PARAMS ((symbolS *, symbolS *)); /* We need 12 bytes at the start of the section to hold some initial information. */ -extern void obj_elf_init_stab_section PARAMS ((segT)); +extern void obj_elf_init_stab_section (segT); #define INIT_STAB_SECTION(seg) obj_elf_init_stab_section (seg) #ifdef ECOFF_DEBUGGING @@ -220,12 +229,12 @@ extern void obj_elf_init_stab_section PARAMS ((segT)); #endif /* SEPARATE_STAB_SECTIONS not defined. */ -extern void elf_frob_symbol PARAMS ((symbolS *, int *)); +extern void elf_frob_symbol (symbolS *, int *); #ifndef obj_frob_symbol #define obj_frob_symbol(symp, punt) elf_frob_symbol (symp, &punt) #endif -extern void elf_pop_insert PARAMS ((void)); +extern void elf_pop_insert (void); #ifndef obj_pop_insert #define obj_pop_insert() elf_pop_insert() #endif @@ -235,7 +244,7 @@ extern void elf_pop_insert PARAMS ((void)); #ifdef ANSI_PROTOTYPES struct ecoff_extr; #endif -extern void elf_ecoff_set_ext PARAMS ((symbolS *, struct ecoff_extr *)); +extern void elf_ecoff_set_ext (symbolS *, struct ecoff_extr *); #endif #endif /* _OBJ_ELF_H */ diff --git a/contrib/binutils/gas/config/obj-ieee.c b/contrib/binutils/gas/config/obj-ieee.c index 1846a92..02f4339 100644 --- a/contrib/binutils/gas/config/obj-ieee.c +++ b/contrib/binutils/gas/config/obj-ieee.c @@ -264,7 +264,7 @@ do_relocs_for (idx) from = from->fx_next; } - /* Attatch to the section. */ + /* Attach to the section. */ section->orelocation = reloc_ptr_vector; section->reloc_count = nrelocs; section->flags |= SEC_LOAD; @@ -467,10 +467,6 @@ ok: input_line_pointer = p; } -void cons (); -void s_ignore (); - -void s_globl (); const pseudo_typeS obj_pseudo_table[] = { {"section", obj_ieee_section, 0}, @@ -496,7 +492,7 @@ obj_symbol_new_hook (symbolP) #ifndef SUB_SEGMENT_ALIGN #ifdef HANDLE_ALIGN -/* The last subsegment gets an aligment corresponding to the alignment +/* The last subsegment gets an alignment corresponding to the alignment of the section. This allows proper nop-filling at the end of code-bearing sections. */ #define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) \ diff --git a/contrib/binutils/gas/config/obj-ieee.h b/contrib/binutils/gas/config/obj-ieee.h index 2652bc2..c0bd628 100644 --- a/contrib/binutils/gas/config/obj-ieee.h +++ b/contrib/binutils/gas/config/obj-ieee.h @@ -1,5 +1,5 @@ /* This file is obj-ieee.h - Copyright 1987, 1988, 1989, 1990, 1991, 1992, 2000 + Copyright 1987, 1988, 1989, 1990, 1991, 1992, 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -28,16 +28,19 @@ typedef struct asymbol sy; int seg; } - obj_symbol_type; #define S_GET_NAME(s) (((s)->sy_symbol.sy.name)) +/* Return true for symbols that should not be reduced to section + symbols or eliminated from expressions, because they may be + overridden by the linker. */ +#define S_FORCE_RELOC(s, strict) (!SEG_NORMAL (x->sy_symbol.seg)) + typedef struct { int x; } - object_headers; #define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE 1 diff --git a/contrib/binutils/gas/config/obj-multi.h b/contrib/binutils/gas/config/obj-multi.h index 225de2c..37d9fe8 100644 --- a/contrib/binutils/gas/config/obj-multi.h +++ b/contrib/binutils/gas/config/obj-multi.h @@ -1,5 +1,5 @@ /* Multiple object format emulation. - Copyright 1995, 1996, 1997, 1999, 2000 + Copyright 1995, 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -55,6 +55,11 @@ ? (*this_format->frob_file_before_adjust) () \ : (void) 0) +#define obj_frob_file_before_fix() \ + (this_format->frob_file_before_fix \ + ? (*this_format->frob_file_before_fix) () \ + : (void) 0) + #define obj_frob_file_after_relocs() \ (this_format->frob_file_after_relocs \ ? (*this_format->frob_file_after_relocs) () \ diff --git a/contrib/binutils/gas/config/tc-alpha.c b/contrib/binutils/gas/config/tc-alpha.c index b9faadf..9360047 100644 --- a/contrib/binutils/gas/config/tc-alpha.c +++ b/contrib/binutils/gas/config/tc-alpha.c @@ -1,6 +1,6 @@ /* tc-alpha.c - Processor-specific code for the DEC Alpha AXP CPU. Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 Free Software Foundation, Inc. + 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by Carnegie Mellon University, 1993. Written by Alessandro Forin, based on earlier gas-1.38 target CPU files. Modified by Ken Raeburn for gas-2.x and ECOFF support. @@ -60,11 +60,12 @@ #ifdef OBJ_ELF #include "elf/alpha.h" #include "dwarf2dbg.h" +#include "dw2gencfi.h" #endif #include "safe-ctype.h" -/* Local types */ +/* Local types. */ #define TOKENIZE_ERROR -1 #define TOKENIZE_ERROR_REPORT -2 @@ -72,29 +73,33 @@ #define MAX_INSN_FIXUPS 2 #define MAX_INSN_ARGS 5 -struct alpha_fixup { +struct alpha_fixup +{ expressionS exp; bfd_reloc_code_real_type reloc; }; -struct alpha_insn { +struct alpha_insn +{ unsigned insn; int nfixups; struct alpha_fixup fixups[MAX_INSN_FIXUPS]; long sequence; }; -enum alpha_macro_arg { - MACRO_EOA = 1, - MACRO_IR, - MACRO_PIR, - MACRO_OPIR, - MACRO_CPIR, - MACRO_FPR, - MACRO_EXP, -}; +enum alpha_macro_arg + { + MACRO_EOA = 1, + MACRO_IR, + MACRO_PIR, + MACRO_OPIR, + MACRO_CPIR, + MACRO_FPR, + MACRO_EXP, + }; -struct alpha_macro { +struct alpha_macro +{ const char *name; void (*emit) PARAMS ((const expressionS *, int, const PTR)); const PTR arg; @@ -139,13 +144,13 @@ struct alpha_macro { #define USER_RELOC_P(R) ((R) >= O_literal && (R) <= O_tprel) -/* Macros for extracting the type and number of encoded register tokens */ +/* Macros for extracting the type and number of encoded register tokens. */ #define is_ir_num(x) (((x) & 32) == 0) #define is_fpr_num(x) (((x) & 32) != 0) #define regno(x) ((x) & 31) -/* Something odd inherited from the old assembler */ +/* Something odd inherited from the old assembler. */ #define note_gpreg(R) (alpha_gprmask |= (1 << (R))) #define note_fpreg(R) (alpha_fprmask |= (1 << (R))) @@ -179,7 +184,7 @@ struct alpha_macro { ^ 0x80000000) - 0x80000000) #endif -/* Macros to build tokens */ +/* Macros to build tokens. */ #define set_tok_reg(t, r) (memset (&(t), 0, sizeof (t)), \ (t).X_op = O_register, \ @@ -201,10 +206,10 @@ struct alpha_macro { (t).X_op = O_constant, \ (t).X_add_number = (n)) -/* Prototypes for all local functions */ +/* Prototypes for all local functions. */ static struct alpha_reloc_tag *get_alpha_reloc_tag PARAMS ((long)); -static void alpha_adjust_symtab_relocs PARAMS ((bfd *, asection *, PTR)); +static void alpha_adjust_relocs PARAMS ((bfd *, asection *, PTR)); static int tokenize_arguments PARAMS ((char *, expressionS *, int)); static const struct alpha_opcode *find_opcode_match @@ -262,6 +267,7 @@ static void s_alpha_file PARAMS ((int)); static void s_alpha_loc PARAMS ((int)); static void s_alpha_stab PARAMS ((int)); static void s_alpha_coff_wrapper PARAMS ((int)); +static void s_alpha_usepv PARAMS ((int)); #endif #ifdef OBJ_EVAX static void s_alpha_section PARAMS ((int)); @@ -315,19 +321,20 @@ const char *md_shortopts = "Fm:g+1h:HG:"; const char *md_shortopts = "Fm:gG:"; #endif -struct option md_longopts[] = { +struct option md_longopts[] = + { #define OPTION_32ADDR (OPTION_MD_BASE) - { "32addr", no_argument, NULL, OPTION_32ADDR }, + { "32addr", no_argument, NULL, OPTION_32ADDR }, #define OPTION_RELAX (OPTION_32ADDR + 1) - { "relax", no_argument, NULL, OPTION_RELAX }, + { "relax", no_argument, NULL, OPTION_RELAX }, #ifdef OBJ_ELF #define OPTION_MDEBUG (OPTION_RELAX + 1) #define OPTION_NO_MDEBUG (OPTION_MDEBUG + 1) - { "mdebug", no_argument, NULL, OPTION_MDEBUG }, - { "no-mdebug", no_argument, NULL, OPTION_NO_MDEBUG }, + { "mdebug", no_argument, NULL, OPTION_MDEBUG }, + { "no-mdebug", no_argument, NULL, OPTION_NO_MDEBUG }, #endif - { NULL, no_argument, NULL, 0 } -}; + { NULL, no_argument, NULL, 0 } + }; size_t md_longopts_size = sizeof (md_longopts); @@ -351,34 +358,33 @@ size_t md_longopts_size = sizeof (md_longopts); #define AXP_REG_GP AXP_REG_PV #endif /* OBJ_EVAX */ -/* The cpu for which we are generating code */ +/* The cpu for which we are generating code. */ static unsigned alpha_target = AXP_OPCODE_BASE; static const char *alpha_target_name = ""; -/* The hash table of instruction opcodes */ +/* The hash table of instruction opcodes. */ static struct hash_control *alpha_opcode_hash; -/* The hash table of macro opcodes */ +/* The hash table of macro opcodes. */ static struct hash_control *alpha_macro_hash; #ifdef OBJ_ECOFF -/* The $gp relocation symbol */ +/* The $gp relocation symbol. */ static symbolS *alpha_gp_symbol; /* XXX: what is this, and why is it exported? */ valueT alpha_gp_value; #endif -/* The current $gp register */ +/* The current $gp register. */ static int alpha_gp_register = AXP_REG_GP; -/* A table of the register symbols */ +/* A table of the register symbols. */ static symbolS *alpha_register_table[64]; -/* Constant sections, or sections of constants */ +/* Constant sections, or sections of constants. */ #ifdef OBJ_ECOFF static segT alpha_lita_section; -static segT alpha_lit4_section; #endif #ifdef OBJ_EVAX static segT alpha_link_section; @@ -390,7 +396,6 @@ static segT alpha_lit8_section; /* Symbols referring to said sections. */ #ifdef OBJ_ECOFF static symbolS *alpha_lita_symbol; -static symbolS *alpha_lit4_symbol; #endif #ifdef OBJ_EVAX static symbolS *alpha_link_symbol; @@ -399,27 +404,21 @@ static symbolS *alpha_dtors_symbol; #endif static symbolS *alpha_lit8_symbol; -/* Literal for .litX+0x8000 within .lita */ +/* Literal for .litX+0x8000 within .lita. */ #ifdef OBJ_ECOFF -static offsetT alpha_lit4_literal; static offsetT alpha_lit8_literal; #endif -#ifdef OBJ_ELF -/* The active .ent symbol. */ -static symbolS *alpha_cur_ent_sym; -#endif - -/* Is the assembler not allowed to use $at? */ +/* Is the assembler not allowed to use $at? */ static int alpha_noat_on = 0; -/* Are macros enabled? */ +/* Are macros enabled? */ static int alpha_macros_on = 1; -/* Are floats disabled? */ +/* Are floats disabled? */ static int alpha_nofloats_on = 0; -/* Are addresses 32 bit? */ +/* Are addresses 32 bit? */ static int alpha_addr32_on = 0; /* Symbol labelling the current insn. When the Alpha gas sees @@ -473,8 +472,7 @@ static int alpha_flag_hash_long_names = 0; /* -+ */ static int alpha_flag_show_after_trunc = 0; /* -H */ /* If the -+ switch is given, then a hash is appended to any name that is - * longer than 64 characters, else longer symbol names are truncated. - */ + longer than 64 characters, else longer symbol names are truncated. */ #endif @@ -491,14 +489,17 @@ static int alpha_flag_show_after_trunc = 0; /* -H */ #define DEF(NAME, RELOC, REQ, ALLOW) \ { #NAME, sizeof(#NAME)-1, O_##NAME, RELOC, REQ, ALLOW} -static const struct alpha_reloc_op_tag { +static const struct alpha_reloc_op_tag +{ const char *name; /* string to lookup */ size_t length; /* size of the string */ operatorT op; /* which operator to use */ bfd_reloc_code_real_type reloc; /* relocation before frob */ unsigned int require_seq : 1; /* require a sequence number */ unsigned int allow_seq : 1; /* allow a sequence number */ -} alpha_reloc_op[] = { +} +alpha_reloc_op[] = +{ DEF(literal, BFD_RELOC_ALPHA_ELF_LITERAL, 0, 1), DEF(lituse_addr, DUMMY_RELOC_LITUSE_ADDR, 1, 1), DEF(lituse_base, DUMMY_RELOC_LITUSE_BASE, 1, 1), @@ -532,7 +533,7 @@ static const int alpha_num_reloc_op /* Maximum # digits needed to hold the largest sequence # */ #define ALPHA_RELOC_DIGITS 25 -/* Structure to hold explict sequence information. */ +/* Structure to hold explicit sequence information. */ struct alpha_reloc_tag { fixS *master; /* the literal reloc */ @@ -557,10 +558,13 @@ static long next_sequence_num = -1; /* A table of CPU names and opcode sets. */ -static const struct cpu_type { +static const struct cpu_type +{ const char *name; unsigned flags; -} cpu_types[] = { +} +cpu_types[] = +{ /* Ad hoc convention: cpu number gets palcode, process code doesn't. This supports usage under DU 4.0b that does ".arch ev4", and usage in MILO that does -m21064. Probably something more @@ -597,7 +601,8 @@ static const struct cpu_type { /* The macro table */ -static const struct alpha_macro alpha_macros[] = { +static const struct alpha_macro alpha_macros[] = +{ /* Load/Store macros */ { "lda", emit_lda, NULL, { MACRO_IR, MACRO_EXP, MACRO_OPIR, MACRO_EOA } }, @@ -809,8 +814,7 @@ md_begin () assert (e.X_op == O_max); } - /* Create the opcode hash table */ - + /* Create the opcode hash table. */ alpha_opcode_hash = hash_new (); for (i = 0; i < alpha_num_opcodes;) { @@ -844,8 +848,7 @@ md_begin () continue; } - /* Create the macro hash table */ - + /* Create the macro hash table. */ alpha_macro_hash = hash_new (); for (i = 0; i < alpha_num_macros;) { @@ -863,11 +866,11 @@ md_begin () continue; } - /* Construct symbols for each of the registers */ - + /* Construct symbols for each of the registers. */ for (i = 0; i < 32; ++i) { char name[4]; + sprintf (name, "$%d", i); alpha_register_table[i] = symbol_create (name, reg_section, i, &zero_address_frag); @@ -875,12 +878,13 @@ md_begin () for (; i < 64; ++i) { char name[5]; + sprintf (name, "$f%d", i - 32); alpha_register_table[i] = symbol_create (name, reg_section, i, &zero_address_frag); } - /* Create the special symbols and sections we'll be using */ + /* Create the special symbols and sections we'll be using. */ /* So .sbss will get used for tiny objects. */ bfd_set_gp_size (stdoutput, g_switch_value); @@ -919,12 +923,12 @@ void md_assemble (str) char *str; { - char opname[32]; /* current maximum is 13 */ + char opname[32]; /* Current maximum is 13. */ expressionS tok[MAX_INSN_ARGS]; int ntok, trunclen; size_t opnamelen; - /* split off the opcode */ + /* Split off the opcode. */ opnamelen = strspn (str, "abcdefghijklmnopqrstuvwxyz_/46819"); trunclen = (opnamelen < sizeof (opname) - 1 ? opnamelen @@ -932,7 +936,7 @@ md_assemble (str) memcpy (opname, str, trunclen); opname[trunclen] = '\0'; - /* tokenize the rest of the line */ + /* Tokenize the rest of the line. */ if ((ntok = tokenize_arguments (str + opnamelen, tok, MAX_INSN_ARGS)) < 0) { if (ntok != TOKENIZE_ERROR_REPORT) @@ -941,7 +945,7 @@ md_assemble (str) return; } - /* finish it off */ + /* Finish it off. */ assemble_tokens (opname, tok, ntok, alpha_macros_on); } @@ -963,7 +967,7 @@ md_section_align (seg, size) 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 extern char *vax_md_atof PARAMS ((int, char *, int *)); @@ -1132,12 +1136,12 @@ md_pcrel_from (fixP) valueT addr = fixP->fx_where + fixP->fx_frag->fr_address; switch (fixP->fx_r_type) { - case BFD_RELOC_ALPHA_GPDISP: - case BFD_RELOC_ALPHA_GPDISP_HI16: - case BFD_RELOC_ALPHA_GPDISP_LO16: - return addr; + case BFD_RELOC_23_PCREL_S2: + case BFD_RELOC_ALPHA_HINT: + case BFD_RELOC_ALPHA_BRSGP: + return addr + 4; default: - return fixP->fx_size + addr; + return addr; } } @@ -1164,9 +1168,9 @@ md_apply_fix3 (fixP, valP, seg) switch (fixP->fx_r_type) { /* The GPDISP relocations are processed internally with a symbol - referring to the current function; we need to drop in a value - which, when added to the address of the start of the function, - gives the desired GP. */ + referring to the current function's section; we need to drop + in a value which, when added to the address of the start of + the function, gives the desired GP. */ case BFD_RELOC_ALPHA_GPDISP_HI16: { fixS *next = fixP->fx_next; @@ -1254,6 +1258,8 @@ md_apply_fix3 (fixP, valP, seg) #ifdef OBJ_ELF case BFD_RELOC_ALPHA_BRSGP: + return; + case BFD_RELOC_ALPHA_TLSGD: case BFD_RELOC_ALPHA_TLSLDM: case BFD_RELOC_ALPHA_GOTDTPREL16: @@ -1264,6 +1270,8 @@ md_apply_fix3 (fixP, valP, seg) case BFD_RELOC_ALPHA_TPREL_HI16: case BFD_RELOC_ALPHA_TPREL_LO16: case BFD_RELOC_ALPHA_TPREL16: + if (fixP->fx_addsy) + S_SET_THREAD_LOCAL (fixP->fx_addsy); return; #endif @@ -1437,8 +1445,6 @@ alpha_force_relocation (f) case BFD_RELOC_ALPHA_LINKAGE: case BFD_RELOC_ALPHA_CODEADDR: case BFD_RELOC_ALPHA_BRSGP: - case BFD_RELOC_VTABLE_INHERIT: - case BFD_RELOC_VTABLE_ENTRY: case BFD_RELOC_ALPHA_TLSGD: case BFD_RELOC_ALPHA_TLSLDM: case BFD_RELOC_ALPHA_GOTDTPREL16: @@ -1451,15 +1457,11 @@ alpha_force_relocation (f) case BFD_RELOC_ALPHA_TPREL16: return 1; - case BFD_RELOC_23_PCREL_S2: - case BFD_RELOC_32: - case BFD_RELOC_64: - case BFD_RELOC_ALPHA_HINT: - return 0; - default: - return 0; + break; } + + return generic_force_reloc (f); } /* Return true if we can partially resolve a relocation now. */ @@ -1468,12 +1470,6 @@ int alpha_fix_adjustable (f) fixS *f; { -#ifdef OBJ_ELF - /* Prevent all adjustments to global symbols */ - if (S_IS_EXTERN (f->fx_addsy) || S_IS_WEAK (f->fx_addsy)) - return 0; -#endif - /* Are there any relocation types for which we must generate a reloc but we can adjust the values contained within it? */ switch (f->fx_r_type) @@ -1518,6 +1514,7 @@ alpha_fix_adjustable (f) we're preventing this in the other assemblers. Follow for now. */ return 0; +#ifdef OBJ_ELF case BFD_RELOC_ALPHA_BRSGP: /* If we have a BRSGP reloc to a local symbol, adjust it to BRADDR and let it get resolved at assembly time. */ @@ -1526,7 +1523,7 @@ alpha_fix_adjustable (f) const char *name; int offset = 0; - if (! S_IS_DEFINED (sym)) + if (generic_force_reloc (f)) return 0; switch (S_GET_OTHER (sym) & STO_ALPHA_STD_GPLOAD) @@ -1550,6 +1547,7 @@ alpha_fix_adjustable (f) f->fx_offset += offset; return 1; } +#endif default: return 1; @@ -1595,7 +1593,7 @@ tc_gen_reloc (sec, fixp) #ifdef OBJ_ECOFF if (fixp->fx_r_type == BFD_RELOC_ALPHA_LITERAL) { - /* fake out bfd_perform_relocation. sigh */ + /* Fake out bfd_perform_relocation. sigh. */ reloc->addend = -alpha_gp_value; } else @@ -1603,12 +1601,10 @@ tc_gen_reloc (sec, fixp) { reloc->addend = fixp->fx_offset; #ifdef OBJ_ELF - /* - * Ohhh, this is ugly. The problem is that if this is a local global - * symbol, the relocation will entirely be performed at link time, not - * at assembly time. bfd_perform_reloc doesn't know about this sort - * of thing, and as a result we need to fake it out here. - */ + /* Ohhh, this is ugly. The problem is that if this is a local global + symbol, the relocation will entirely be performed at link time, not + at assembly time. bfd_perform_reloc doesn't know about this sort + of thing, and as a result we need to fake it out here. */ if ((S_IS_EXTERN (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy) || (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_MERGE) || (S_GET_SEGMENT (fixp->fx_addsy)->flags & SEC_THREAD_LOCAL)) @@ -1703,14 +1699,14 @@ get_alpha_reloc_tag (sequence) relocations, and similarly for !gpdisp relocations. */ void -alpha_adjust_symtab () +alpha_before_fix () { if (alpha_literal_hash) - bfd_map_over_sections (stdoutput, alpha_adjust_symtab_relocs, NULL); + bfd_map_over_sections (stdoutput, alpha_adjust_relocs, NULL); } static void -alpha_adjust_symtab_relocs (abfd, sec, ptr) +alpha_adjust_relocs (abfd, sec, ptr) bfd *abfd ATTRIBUTE_UNUSED; asection *sec; PTR ptr ATTRIBUTE_UNUSED; @@ -1731,7 +1727,7 @@ alpha_adjust_symtab_relocs (abfd, sec, ptr) if (! seginfo->fix_root) return; - /* First rebuild the fixup chain without the expicit lituse and + /* First rebuild the fixup chain without the explicit lituse and gpdisp_lo16 relocs. */ prevP = &seginfo->fix_root; for (fixp = seginfo->fix_root; fixp; fixp = next) @@ -1746,6 +1742,7 @@ alpha_adjust_symtab_relocs (abfd, sec, ptr) as_bad_where (fixp->fx_file, fixp->fx_line, _("No !literal!%ld was found"), fixp->tc_fix_data.info->sequence); +#ifdef RELOC_OP_P if (fixp->fx_offset == LITUSE_ALPHA_TLSGD) { if (! fixp->tc_fix_data.info->saw_tlsgd) @@ -1760,6 +1757,7 @@ alpha_adjust_symtab_relocs (abfd, sec, ptr) _("No !tlsldm!%ld was found"), fixp->tc_fix_data.info->sequence); } +#endif break; case BFD_RELOC_ALPHA_GPDISP_LO16: @@ -1874,6 +1872,7 @@ debug_exp (tok, ntok) { expressionS *t = &tok[i]; const char *name; + switch (t->X_op) { default: name = "unknown"; break; @@ -1957,15 +1956,17 @@ tokenize_arguments (str, tok, ntok) #ifdef DEBUG_ALPHA expressionS *orig_tok = tok; #endif +#ifdef RELOC_OP_P char *p; const struct alpha_reloc_op_tag *r; int c, i; size_t len; int reloc_found_p = 0; +#endif memset (tok, 0, sizeof (*tok) * ntok); - /* Save and restore input_line_pointer around this function */ + /* Save and restore input_line_pointer around this function. */ old_input_line_pointer = input_line_pointer; input_line_pointer = str; @@ -1988,7 +1989,8 @@ tokenize_arguments (str, tok, ntok) assembly language statement, and has the following form: !relocation_type!sequence_number. */ if (reloc_found_p) - { /* only support one relocation op per insn */ + { + /* Only support one relocation op per insn. */ as_bad (_("More than one relocation op per insn")); goto err_report; } @@ -2001,7 +2003,7 @@ tokenize_arguments (str, tok, ntok) p = input_line_pointer; c = get_symbol_end (); - /* Parse !relocation_type */ + /* Parse !relocation_type. */ len = input_line_pointer - p; if (len == 0) { @@ -2041,7 +2043,7 @@ tokenize_arguments (str, tok, ntok) input_line_pointer++; - /* Parse !sequence_number */ + /* Parse !sequence_number. */ expression (tok); if (tok->X_op != O_constant || tok->X_add_number <= 0) { @@ -2080,7 +2082,7 @@ tokenize_arguments (str, tok, ntok) break; } - /* ... then fall through to plain expression */ + /* ... then fall through to plain expression. */ input_line_pointer = hold; } @@ -2120,8 +2122,8 @@ err: input_line_pointer = old_input_line_pointer; return TOKENIZE_ERROR; -err_report: #ifdef RELOC_OP_P +err_report: is_end_of_line[(unsigned char) '!'] = 0; #endif input_line_pointer = old_input_line_pointer; @@ -2147,7 +2149,7 @@ find_opcode_match (first_opcode, tok, pntok, pcpumatch) const unsigned char *opidx; int tokidx = 0; - /* Don't match opcodes that don't exist on this architecture */ + /* Don't match opcodes that don't exist on this architecture. */ if (!(opcode->flags & alpha_target)) goto match_failed; @@ -2157,11 +2159,11 @@ find_opcode_match (first_opcode, tok, pntok, pcpumatch) { const struct alpha_operand *operand = &alpha_operands[*opidx]; - /* only take input from real operands */ + /* Only take input from real operands. */ if (operand->flags & AXP_OPERAND_FAKE) continue; - /* when we expect input, make sure we have it */ + /* When we expect input, make sure we have it. */ if (tokidx >= ntok) { if ((operand->flags & AXP_OPERAND_OPTIONAL_MASK) == 0) @@ -2169,7 +2171,7 @@ find_opcode_match (first_opcode, tok, pntok, pcpumatch) continue; } - /* match operand type with expression type */ + /* Match operand type with expression type. */ switch (operand->flags & AXP_OPERAND_TYPECHECK_MASK) { case AXP_OPERAND_IR: @@ -2211,13 +2213,13 @@ find_opcode_match (first_opcode, tok, pntok, pcpumatch) break; default: - /* everything else should have been fake */ + /* Everything else should have been fake. */ abort (); } ++tokidx; } - /* possible match -- did we use all of our input? */ + /* Possible match -- did we use all of our input? */ if (tokidx == ntok) { *pntok = ntok; @@ -2226,7 +2228,7 @@ find_opcode_match (first_opcode, tok, pntok, pcpumatch) match_failed:; } - while (++opcode - alpha_opcodes < alpha_num_opcodes + while (++opcode - alpha_opcodes < (int) alpha_num_opcodes && !strcmp (opcode->name, first_opcode->name)); if (*pcpumatch) @@ -2263,7 +2265,7 @@ find_macro_match (first_macro, tok, pntok) tokidx = 0; break; - /* index register */ + /* Index register. */ case MACRO_IR: if (tokidx >= ntok || tok[tokidx].X_op != O_register || !is_ir_num (tok[tokidx].X_add_number)) @@ -2271,7 +2273,7 @@ find_macro_match (first_macro, tok, pntok) ++tokidx; break; - /* parenthesized index register */ + /* Parenthesized index register. */ case MACRO_PIR: if (tokidx >= ntok || tok[tokidx].X_op != O_pregister || !is_ir_num (tok[tokidx].X_add_number)) @@ -2279,14 +2281,14 @@ find_macro_match (first_macro, tok, pntok) ++tokidx; break; - /* optional parenthesized index register */ + /* Optional parenthesized index register. */ case MACRO_OPIR: if (tokidx < ntok && tok[tokidx].X_op == O_pregister && is_ir_num (tok[tokidx].X_add_number)) ++tokidx; break; - /* leading comma with a parenthesized index register */ + /* Leading comma with a parenthesized index register. */ case MACRO_CPIR: if (tokidx >= ntok || tok[tokidx].X_op != O_cpregister || !is_ir_num (tok[tokidx].X_add_number)) @@ -2294,7 +2296,7 @@ find_macro_match (first_macro, tok, pntok) ++tokidx; break; - /* floating point register */ + /* Floating point register. */ case MACRO_FPR: if (tokidx >= ntok || tok[tokidx].X_op != O_register || !is_fpr_num (tok[tokidx].X_add_number)) @@ -2302,7 +2304,7 @@ find_macro_match (first_macro, tok, pntok) ++tokidx; break; - /* normal expression */ + /* Normal expression. */ case MACRO_EXP: if (tokidx >= ntok) goto match_failed; @@ -2339,7 +2341,7 @@ find_macro_match (first_macro, tok, pntok) ++arg; } } - while (++macro - alpha_macros < alpha_num_macros + while (++macro - alpha_macros < (int) alpha_num_macros && !strcmp (macro->name, first_macro->name)); return NULL; @@ -2398,10 +2400,8 @@ insert_operand (insn, operand, val, file, line) return insn; } -/* - * Turn an opcode description and a set of arguments into - * an instruction and a fixup. - */ +/* Turn an opcode description and a set of arguments into + an instruction and a fixup. */ static void assemble_insn (opcode, tok, ntok, insn, reloc) @@ -2550,9 +2550,7 @@ assemble_insn (opcode, tok, ntok, insn, reloc) insn->insn = image; } -/* - * Actually output an instruction with its fixup. - */ +/* Actually output an instruction with its fixup. */ static void emit_insn (insn) @@ -2576,7 +2574,7 @@ emit_insn (insn) dwarf2_emit_insn (4); #endif - /* Apply the fixups in order */ + /* Apply the fixups in order. */ for (i = 0; i < insn->nfixups; ++i) { const struct alpha_operand *operand = (const struct alpha_operand *) 0; @@ -2585,7 +2583,7 @@ emit_insn (insn) int size, pcrel; fixS *fixP; - /* Some fixups are only used internally and so have no howto */ + /* Some fixups are only used internally and so have no howto. */ if ((int) fixup->reloc < 0) { operand = &alpha_operands[-(int) fixup->reloc]; @@ -2675,6 +2673,7 @@ emit_insn (insn) fixP->tc_fix_data.info = info; break; +#ifdef RELOC_OP_P case DUMMY_RELOC_LITUSE_ADDR: fixP->fx_offset = LITUSE_ALPHA_ADDR; goto do_lituse; @@ -2749,7 +2748,7 @@ emit_insn (insn) info->saw_tlsldm = 1; fixP->tc_fix_data.info = info; break; - +#endif default: if ((int) fixup->reloc < 0) { @@ -2838,7 +2837,7 @@ assemble_tokens (opname, tok, ntok, local_macros_on) } } - /* search opcodes */ + /* Search opcodes. */ opcode = (const struct alpha_opcode *) hash_find (alpha_opcode_hash, opname); if (opcode) { @@ -2870,7 +2869,7 @@ assemble_tokens (opname, tok, ntok, local_macros_on) as_bad (_("unknown opcode `%s'"), opname); } -/* Some instruction sets indexed by lg(size) */ +/* Some instruction sets indexed by lg(size). */ static const char * const sextX_op[] = { "sextb", "sextw", "sextl", NULL }; static const char * const insXl_op[] = { "insbl", "inswl", "insll", "insql" }; static const char * const insXh_op[] = { NULL, "inswh", "inslh", "insqh" }; @@ -3015,7 +3014,7 @@ add_to_link_pool (basesym, sym, addend) but this is what OSF/1 does. If explicit relocations of the form !literal! are allowed, - and used, then explict_reloc with be an expression pointer. + and used, then explicit_reloc with be an expression pointer. Finally, the return value is nonzero if the calling macro may emit a LITUSE reloc if otherwise appropriate; the return value is the @@ -3041,7 +3040,7 @@ load_expression (targreg, exp, pbasereg, poffset) #ifdef OBJ_ECOFF offsetT lit; - /* attempt to reduce .lit load by splitting the offset from + /* Attempt to reduce .lit load by splitting the offset from its symbol when possible, but don't create a situation in which we'd fail. */ if (!range_signed_32 (addend) && @@ -3366,7 +3365,7 @@ load_expression (targreg, exp, pbasereg, poffset) } /* The lda macro differs from the lda instruction in that it handles - most simple expressions, particualrly symbol address loads and + most simple expressions, particularly symbol address loads and large constants. */ static void @@ -3893,19 +3892,18 @@ emit_division (tok, ntok, symname) const PTR symname; { /* DIVISION and MODULUS. Yech. - * - * Convert - * OP x,y,result - * to - * mov x,R16 # if x != R16 - * mov y,R17 # if y != R17 - * lda AT,__OP - * jsr AT,(AT),0 - * mov R0,result - * - * with appropriate optimizations if R0,R16,R17 are the registers - * specified by the compiler. - */ + + Convert + OP x,y,result + to + mov x,R16 # if x != R16 + mov y,R17 # if y != R17 + lda AT,__OP + jsr AT,(AT),0 + mov R0,result + + with appropriate optimizations if R0,R16,R17 are the registers + specified by the compiler. */ int xr, yr, rr; symbolS *sym; @@ -3919,10 +3917,10 @@ emit_division (tok, ntok, symname) else rr = regno (tok[2].X_add_number); - /* Move the operands into the right place */ + /* Move the operands into the right place. */ if (yr == AXP_REG_R16 && xr == AXP_REG_R17) { - /* They are in exactly the wrong order -- swap through AT */ + /* They are in exactly the wrong order -- swap through AT. */ if (alpha_noat_on) as_bad (_("macro requires $at register while noat in effect")); @@ -3969,13 +3967,13 @@ emit_division (tok, ntok, symname) set_tok_sym (newtok[1], sym, 0); assemble_tokens ("lda", newtok, 2, 1); - /* Call the division routine */ + /* Call the division routine. */ set_tok_reg (newtok[0], AXP_REG_AT); set_tok_cpreg (newtok[1], AXP_REG_AT); set_tok_const (newtok[2], 0); assemble_tokens ("jsr", newtok, 3, 1); - /* Move the result to the right place */ + /* Move the result to the right place. */ if (rr != AXP_REG_R0) { set_tok_reg (newtok[0], AXP_REG_R0); @@ -3993,18 +3991,17 @@ emit_division (tok, ntok, symname) const PTR symname; { /* DIVISION and MODULUS. Yech. - * Convert - * OP x,y,result - * to - * lda pv,__OP - * mov x,t10 - * mov y,t11 - * jsr t9,(pv),__OP - * mov t12,result - * - * with appropriate optimizations if t10,t11,t12 are the registers - * specified by the compiler. - */ + Convert + OP x,y,result + to + lda pv,__OP + mov x,t10 + mov y,t11 + jsr t9,(pv),__OP + mov t12,result + + with appropriate optimizations if t10,t11,t12 are the registers + specified by the compiler. */ int xr, yr, rr; symbolS *sym; @@ -4020,11 +4017,10 @@ emit_division (tok, ntok, symname) sym = symbol_find_or_make ((const char *) symname); - /* Move the operands into the right place */ + /* Move the operands into the right place. */ if (yr == AXP_REG_T10 && xr == AXP_REG_T11) { - /* They are in exactly the wrong order -- swap through AT */ - + /* They are in exactly the wrong order -- swap through AT. */ if (alpha_noat_on) as_bad (_("macro requires $at register while noat in effect")); @@ -4064,12 +4060,12 @@ emit_division (tok, ntok, symname) } } - /* Call the division routine */ + /* Call the division routine. */ set_tok_reg (newtok[0], AXP_REG_T9); set_tok_sym (newtok[1], sym, 0); assemble_tokens ("jsr", newtok, 2, 1); - /* Reload the GP register */ + /* Reload the GP register. */ #ifdef OBJ_AOUT FIXME #endif @@ -4080,7 +4076,7 @@ FIXME assemble_tokens ("ldgp", newtok, 3, 1); #endif - /* Move the result to the right place */ + /* Move the result to the right place. */ if (rr != AXP_REG_T12) { set_tok_reg (newtok[0], AXP_REG_T12); @@ -4188,7 +4184,7 @@ emit_retjcr (tok, ntok, vopname) assemble_tokens (opname, newtok, 3, 0); } -/* Assembler directives */ +/* Assembler directives. */ /* Handle the .text pseudo-op. This is like the usual one, but it clears alpha_insn_label and restores auto alignment. */ @@ -4232,7 +4228,7 @@ s_alpha_data (i) static void s_alpha_comm (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { register char *name; register char c; @@ -4348,7 +4344,7 @@ s_alpha_comm (ignore) static void s_alpha_rdata (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { int temp; @@ -4369,7 +4365,7 @@ s_alpha_rdata (ignore) static void s_alpha_sdata (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { int temp; @@ -4383,13 +4379,32 @@ s_alpha_sdata (ignore) #endif #ifdef OBJ_ELF +struct alpha_elf_frame_data +{ + symbolS *func_sym; + symbolS *func_end_sym; + symbolS *prologue_sym; + unsigned int mask; + unsigned int fmask; + int fp_regno; + int ra_regno; + offsetT frame_size; + offsetT mask_offset; + offsetT fmask_offset; + + struct alpha_elf_frame_data *next; +}; + +static struct alpha_elf_frame_data *all_frame_data; +static struct alpha_elf_frame_data **plast_frame_data = &all_frame_data; +static struct alpha_elf_frame_data *cur_frame_data; /* Handle the .section pseudo-op. This is like the usual one, but it clears alpha_insn_label and restores auto alignment. */ static void s_alpha_section (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { obj_elf_section (ignore); @@ -4419,12 +4434,21 @@ s_alpha_ent (dummy) { symbolS *sym; - if (alpha_cur_ent_sym) + if (cur_frame_data) as_warn (_("nested .ent directives")); sym = symbol_find_or_make (name); symbol_get_bfdsym (sym)->flags |= BSF_FUNCTION; - alpha_cur_ent_sym = sym; + + cur_frame_data = calloc (1, sizeof (*cur_frame_data)); + cur_frame_data->func_sym = sym; + + /* Provide sensible defaults. */ + cur_frame_data->fp_regno = 30; /* sp */ + cur_frame_data->ra_regno = 26; /* ra */ + + *plast_frame_data = cur_frame_data; + plast_frame_data = &cur_frame_data->next; /* The .ent directive is sometimes followed by a number. Not sure what it really means, but ignore it. */ @@ -4464,22 +4488,27 @@ s_alpha_end (dummy) symbolS *sym; sym = symbol_find (name); - if (sym != alpha_cur_ent_sym) + if (!cur_frame_data) + as_warn (_(".end directive without matching .ent")); + else if (sym != cur_frame_data->func_sym) as_warn (_(".end directive names different symbol than .ent")); /* Create an expression to calculate the size of the function. */ - if (sym) + if (sym && cur_frame_data) { - symbol_get_obj (sym)->size = - (expressionS *) xmalloc (sizeof (expressionS)); - symbol_get_obj (sym)->size->X_op = O_subtract; - symbol_get_obj (sym)->size->X_add_symbol - = symbol_new ("L0\001", now_seg, frag_now_fix (), frag_now); - symbol_get_obj (sym)->size->X_op_symbol = sym; - symbol_get_obj (sym)->size->X_add_number = 0; + OBJ_SYMFIELD_TYPE *obj = symbol_get_obj (sym); + expressionS *exp = xmalloc (sizeof (expressionS)); + + obj->size = exp; + exp->X_op = O_subtract; + exp->X_add_symbol = symbol_temp_new_now (); + exp->X_op_symbol = sym; + exp->X_add_number = 0; + + cur_frame_data->func_end_sym = exp->X_add_symbol; } - alpha_cur_ent_sym = NULL; + cur_frame_data = NULL; *input_line_pointer = name_end; } @@ -4499,7 +4528,45 @@ s_alpha_mask (fp) ecoff_directive_mask (0); } else - discard_rest_of_line (); + { + long val; + offsetT offset; + + if (!cur_frame_data) + { + if (fp) + as_warn (_(".fmask outside of .ent")); + else + as_warn (_(".mask outside of .ent")); + discard_rest_of_line (); + return; + } + + if (get_absolute_expression_and_terminator (&val) != ',') + { + if (fp) + as_warn (_("bad .fmask directive")); + else + as_warn (_("bad .mask directive")); + --input_line_pointer; + discard_rest_of_line (); + return; + } + + offset = get_absolute_expression (); + demand_empty_rest_of_line (); + + if (fp) + { + cur_frame_data->fmask = val; + cur_frame_data->fmask_offset = offset; + } + else + { + cur_frame_data->mask = val; + cur_frame_data->mask_offset = offset; + } + } } static void @@ -4509,7 +4576,36 @@ s_alpha_frame (dummy) if (ECOFF_DEBUGGING) ecoff_directive_frame (0); else - discard_rest_of_line (); + { + long val; + + if (!cur_frame_data) + { + as_warn (_(".frame outside of .ent")); + discard_rest_of_line (); + return; + } + + cur_frame_data->fp_regno = tc_get_register (1); + + SKIP_WHITESPACE (); + if (*input_line_pointer++ != ',' + || get_absolute_expression_and_terminator (&val) != ',') + { + as_warn (_("bad .frame directive")); + --input_line_pointer; + discard_rest_of_line (); + return; + } + cur_frame_data->frame_size = val; + + cur_frame_data->ra_regno = tc_get_register (0); + + /* Next comes the "offset of saved $a0 from $sp". In gcc terms + this is current_function_pretend_args_size. There's no place + to put this value, so ignore it. */ + s_ignore (42); + } } static void @@ -4525,7 +4621,7 @@ s_alpha_prologue (ignore) if (ECOFF_DEBUGGING) sym = ecoff_get_cur_proc_sym (); else - sym = alpha_cur_ent_sym; + sym = cur_frame_data ? cur_frame_data->func_sym : NULL; if (sym == NULL) { @@ -4550,6 +4646,9 @@ s_alpha_prologue (ignore) as_bad (_("Invalid argument %d to .prologue."), arg); break; } + + if (cur_frame_data) + cur_frame_data->prologue_sym = symbol_temp_new_now (); } static char *first_file_directive; @@ -4643,8 +4742,146 @@ s_alpha_coff_wrapper (which) ignore_rest_of_line (); } } + +/* Called at the end of assembly. Here we emit unwind info for frames + unless the compiler has done it for us. */ + +void +alpha_elf_md_end (void) +{ + struct alpha_elf_frame_data *p; + + if (cur_frame_data) + as_warn (_(".ent directive without matching .end")); + + /* If someone has generated the unwind info themselves, great. */ + if (bfd_get_section_by_name (stdoutput, ".eh_frame") != NULL) + return; + + /* Generate .eh_frame data for the unwind directives specified. */ + for (p = all_frame_data; p ; p = p->next) + if (p->prologue_sym) + { + /* Create a temporary symbol at the same location as our + function symbol. This prevents problems with globals. */ + cfi_new_fde (symbol_temp_new (S_GET_SEGMENT (p->func_sym), + S_GET_VALUE (p->func_sym), + symbol_get_frag (p->func_sym))); + + cfi_set_return_column (p->ra_regno); + cfi_add_CFA_def_cfa_register (30); + if (p->fp_regno != 30 || p->mask || p->fmask || p->frame_size) + { + unsigned int mask; + offsetT offset; + + cfi_add_advance_loc (p->prologue_sym); + + if (p->fp_regno != 30) + if (p->frame_size != 0) + cfi_add_CFA_def_cfa (p->fp_regno, p->frame_size); + else + cfi_add_CFA_def_cfa_register (p->fp_regno); + else if (p->frame_size != 0) + cfi_add_CFA_def_cfa_offset (p->frame_size); + + mask = p->mask; + offset = p->mask_offset; + + /* Recall that $26 is special-cased and stored first. */ + if ((mask >> 26) & 1) + { + cfi_add_CFA_offset (26, offset); + offset += 8; + mask &= ~(1 << 26); + } + while (mask) + { + unsigned int i; + i = mask & -mask; + mask ^= i; + i = ffs (i) - 1; + + cfi_add_CFA_offset (i, offset); + offset += 8; + } + + mask = p->fmask; + offset = p->fmask_offset; + while (mask) + { + unsigned int i; + i = mask & -mask; + mask ^= i; + i = ffs (i) - 1; + + cfi_add_CFA_offset (i + 32, offset); + offset += 8; + } + } + + cfi_end_fde (p->func_end_sym); + } +} + +static void +s_alpha_usepv (int unused ATTRIBUTE_UNUSED) +{ + char *name, name_end; + char *which, which_end; + symbolS *sym; + int other; + + name = input_line_pointer; + name_end = get_symbol_end (); + + if (! is_name_beginner (*name)) + { + as_bad (_(".usepv directive has no name")); + *input_line_pointer = name_end; + ignore_rest_of_line (); + return; + } + + sym = symbol_find_or_make (name); + *input_line_pointer++ = name_end; + + if (name_end != ',') + { + as_bad (_(".usepv directive has no type")); + ignore_rest_of_line (); + return; + } + + SKIP_WHITESPACE (); + which = input_line_pointer; + which_end = get_symbol_end (); + + if (strcmp (which, "no") == 0) + other = STO_ALPHA_NOPV; + else if (strcmp (which, "std") == 0) + other = STO_ALPHA_STD_GPLOAD; + else + { + as_bad (_("unknown argument for .usepv")); + other = 0; + } + + *input_line_pointer = which_end; + demand_empty_rest_of_line (); + + S_SET_OTHER (sym, other | (S_GET_OTHER (sym) & ~STO_ALPHA_STD_GPLOAD)); +} #endif /* OBJ_ELF */ +/* Standard calling conventions leaves the CFA at $30 on entry. */ + +void +alpha_cfi_frame_initial_instructions () +{ + cfi_add_CFA_def_cfa_register (30); +} + #ifdef OBJ_EVAX /* Handle the section specific pseudo-op. */ @@ -4676,7 +4913,7 @@ s_alpha_section (secid) static void s_alpha_ent (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { symbolS *symbol; expressionS symexpr; @@ -4706,14 +4943,13 @@ s_alpha_ent (ignore) alpha_evax_proc.symbol = symbol; demand_empty_rest_of_line (); - return; } /* Parse .frame ,,RA, directives. */ static void s_alpha_frame (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { long val; @@ -4741,13 +4977,11 @@ s_alpha_frame (ignore) return; } alpha_evax_proc.rsa_offset = get_absolute_expression (); - - return; } static void s_alpha_pdesc (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { char *name; char name_end; @@ -4892,15 +5126,13 @@ s_alpha_pdesc (ignore) md_number_to_chars (p, alpha_evax_proc.imask, 4); md_number_to_chars (p + 4, alpha_evax_proc.fmask, 4); - - return; } /* Support for crash debug on vms. */ static void s_alpha_name (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { register char *p; expressionS exp; @@ -4932,13 +5164,11 @@ s_alpha_name (ignore) seginfo->literal_pool_size += 8; fix_new_exp (frag_now, p - frag_now->fr_literal, 8, &exp, 0, BFD_RELOC_64); - - return; } static void s_alpha_linkage (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { expressionS exp; char *p; @@ -4960,13 +5190,11 @@ s_alpha_linkage (ignore) BFD_RELOC_ALPHA_LINKAGE); } demand_empty_rest_of_line (); - - return; } static void s_alpha_code_address (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { expressionS exp; char *p; @@ -4988,24 +5216,21 @@ s_alpha_code_address (ignore) BFD_RELOC_ALPHA_CODEADDR); } demand_empty_rest_of_line (); - - return; } static void s_alpha_fp_save (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { alpha_evax_proc.fp_save = tc_get_register (1); demand_empty_rest_of_line (); - return; } static void s_alpha_mask (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { long val; @@ -5020,13 +5245,11 @@ s_alpha_mask (ignore) (void) get_absolute_expression (); } demand_empty_rest_of_line (); - - return; } static void s_alpha_fmask (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { long val; @@ -5041,13 +5264,11 @@ s_alpha_fmask (ignore) (void) get_absolute_expression (); } demand_empty_rest_of_line (); - - return; } static void s_alpha_end (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { char c; @@ -5055,20 +5276,16 @@ s_alpha_end (ignore) *input_line_pointer = c; demand_empty_rest_of_line (); alpha_evax_proc.symbol = 0; - - return; } static void s_alpha_file (ignore) - int ignore; + int ignore ATTRIBUTE_UNUSED; { symbolS *s; int length; static char case_hack[32]; - extern char *demand_copy_string PARAMS ((int *lenP)); - sprintf (case_hack, "", alpha_flag_hash_long_names, alpha_flag_show_after_trunc); @@ -5079,8 +5296,6 @@ s_alpha_file (ignore) s = symbol_find_or_make (demand_copy_string (&length)); symbol_get_bfdsym (s)->flags |= BSF_FILE; demand_empty_rest_of_line (); - - return; } #endif /* OBJ_EVAX */ @@ -5440,7 +5655,6 @@ alpha_print_token (f, exp) print_expr (f, exp); break; } - return; } #endif @@ -5488,10 +5702,11 @@ const pseudo_typeS md_pseudo_table[] = { {"fmask", s_alpha_mask, 1}, {"frame", s_alpha_frame, 0}, {"prologue", s_alpha_prologue, 0}, - {"file", (void (*) PARAMS ((int))) s_alpha_file, 5}, + {"file", s_alpha_file, 5}, {"loc", s_alpha_loc, 9}, {"stabs", s_alpha_stab, 's'}, {"stabn", s_alpha_stab, 'n'}, + {"usepv", s_alpha_usepv, 0}, /* COFF debugging related pseudos. */ {"begin", s_alpha_coff_wrapper, 0}, {"bend", s_alpha_coff_wrapper, 1}, @@ -5581,6 +5796,7 @@ create_literal_section (name, secp, symp) /* @@@ GP selection voodoo. All of this seems overly complicated and unnecessary; which is the primary reason it's for ECOFF only. */ +static inline void maybe_set_gp PARAMS ((asection *)); static inline void maybe_set_gp (sec) @@ -5637,7 +5853,7 @@ alpha_elf_section_letter (letter, ptr_msg) return SHF_ALPHA_GPREL; *ptr_msg = _("Bad .section directive: want a,s,w,x,M,S,G,T in string"); - return 0; + return -1; } /* Map SHF_ALPHA_GPREL to SEC_SMALL_DATA. */ diff --git a/contrib/binutils/gas/config/tc-alpha.h b/contrib/binutils/gas/config/tc-alpha.h index 12146b7..939a14f 100644 --- a/contrib/binutils/gas/config/tc-alpha.h +++ b/contrib/binutils/gas/config/tc-alpha.h @@ -1,5 +1,5 @@ /* This file is tc-alpha.h - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Written by Ken Raeburn . @@ -46,27 +46,21 @@ #define NEED_LITERAL_POOL #define REPEAT_CONS_EXPRESSIONS +struct fix; +struct alpha_reloc_tag; + extern int alpha_force_relocation PARAMS ((struct fix *)); extern int alpha_fix_adjustable PARAMS ((struct fix *)); extern unsigned long alpha_gprmask, alpha_fprmask; extern valueT alpha_gp_value; -#define TC_FORCE_RELOCATION(FIXP) alpha_force_relocation (FIXP) -#define tc_fix_adjustable(FIXP) alpha_fix_adjustable (FIXP) +#define TC_FORCE_RELOCATION(FIX) alpha_force_relocation (FIX) +#define tc_fix_adjustable(FIX) alpha_fix_adjustable (FIX) #define RELOC_REQUIRES_SYMBOL -/* 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 \ - || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ - && ! S_IS_WEAK ((FIX)->fx_addsy) \ - && S_IS_DEFINED ((FIX)->fx_addsy) \ - && ! S_IS_COMMON ((FIX)->fx_addsy))) +/* Values passed to md_apply_fix3 don't include the symbol value. */ +#define MD_APPLY_SYM_VALUE(FIX) 0 #define md_convert_frag(b,s,f) as_fatal ("alpha convert_frag\n") #define md_estimate_size_before_relax(f,s) \ @@ -86,6 +80,21 @@ extern valueT alpha_gp_value; : BFD_RELOC_ALPHA_LINKAGE); #endif +#ifndef VMS +#define TC_IMPLICIT_LCOMM_ALIGNMENT(size, align) \ + do \ + { \ + align = 0; \ + if (size > 1) \ + { \ + addressT temp = 1; \ + while ((size & temp) == 0) \ + ++align, temp <<= 1; \ + } \ + } \ + while (0) +#endif + #define md_number_to_chars number_to_chars_littleendian extern int tc_get_register PARAMS ((int frame)); @@ -110,17 +119,13 @@ extern void alpha_frob_file_before_adjust PARAMS ((void)); #define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */ #ifdef OBJ_ELF -#define ELF_TC_SPECIAL_SECTIONS \ - { ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, \ - { ".sbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_ALPHA_GPREL }, - #define md_elf_section_letter alpha_elf_section_letter extern int alpha_elf_section_letter PARAMS ((int, char **)); #define md_elf_section_flags alpha_elf_section_flags extern flagword alpha_elf_section_flags PARAMS ((flagword, int, int)); #endif -/* Whether to add support for explict !relocation_op!sequence_number. At the +/* Whether to add support for explicit !relocation_op!sequence_number. At the moment, only do this for ELF, though ECOFF could use it as well. */ #ifdef OBJ_ELF @@ -131,8 +136,13 @@ extern flagword alpha_elf_section_flags PARAMS ((flagword, int, int)); supplied !lituse relocations follow the appropriate !literal relocations. Also convert the gas-internal relocations to the appropriate linker relocations. */ -#define tc_adjust_symtab() alpha_adjust_symtab () -extern void alpha_adjust_symtab PARAMS ((void)); +#define tc_frob_file_before_fix() alpha_before_fix () +extern void alpha_before_fix PARAMS ((void)); + +#ifdef OBJ_ELF +#define md_end alpha_elf_md_end +extern void alpha_elf_md_end PARAMS ((void)); +#endif /* New fields for supporting explicit relocations (such as !literal to mark where a pointer is loaded from the global table, and !lituse_base to track @@ -147,19 +157,26 @@ struct alpha_fix_tag }; /* Initialize the TC_FIX_TYPE field. */ -#define TC_INIT_FIX_DATA(fixP) \ +#define TC_INIT_FIX_DATA(FIX) \ do { \ - fixP->tc_fix_data.next_reloc = (struct fix *)0; \ - fixP->tc_fix_data.info = (struct alpha_reloc_tag *)0; \ + FIX->tc_fix_data.next_reloc = (struct fix *) 0; \ + FIX->tc_fix_data.info = (struct alpha_reloc_tag *) 0; \ } while (0) /* Work with DEBUG5 to print fields in tc_fix_type. */ -#define TC_FIX_DATA_PRINT(stream,fixP) \ +#define TC_FIX_DATA_PRINT(STREAM, FIX) \ do { \ - if (fixP->tc_fix_data.info) \ - fprintf (stderr, "\tinfo = 0x%lx, next_reloc = 0x%lx\n", \ - (long)fixP->tc_fix_data.info, \ - (long)fixP->tc_fix_data.next_reloc); \ + if (FIX->tc_fix_data.info) \ + fprintf (STREAM, "\tinfo = 0x%lx, next_reloc = 0x%lx\n", \ + (long) FIX->tc_fix_data.info, \ + (long) FIX->tc_fix_data.next_reloc); \ } while (0) -#define DWARF2_LINE_MIN_INSN_LENGTH 4 +#define TARGET_USE_CFIPOP 1 + +#define tc_cfi_frame_initial_instructions alpha_cfi_frame_initial_instructions +extern void alpha_cfi_frame_initial_instructions(void); + +#define DWARF2_LINE_MIN_INSN_LENGTH 4 +#define DWARF2_DEFAULT_RETURN_COLUMN 26 +#define DWARF2_CIE_DATA_ALIGNMENT -8 diff --git a/contrib/binutils/gas/config/tc-arc.c b/contrib/binutils/gas/config/tc-arc.c index 3e829fa..60cfa34 100644 --- a/contrib/binutils/gas/config/tc-arc.c +++ b/contrib/binutils/gas/config/tc-arc.c @@ -1,5 +1,5 @@ /* tc-arc.c -- Assembler for the ARC - Copyright 1994, 1995, 1997, 1999, 2000, 2001 + Copyright 1994, 1995, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). @@ -23,6 +23,7 @@ #include #include "libiberty.h" #include "as.h" +#include "struc-symbol.h" #include "safe-ctype.h" #include "subsegs.h" #include "opcode/arc.h" @@ -93,8 +94,6 @@ const pseudo_typeS md_pseudo_table[] = { { "option", arc_option, 0 }, { "cpu", arc_option, 0 }, { "block", s_space, 0 }, - { "file", dwarf2_directive_file, 0 }, - { "loc", dwarf2_directive_loc, 0 }, { "extcondcode", arc_extoper, 0 }, { "extcoreregister", arc_extoper, 1 }, { "extauxregister", arc_extoper, 2 }, @@ -906,11 +905,6 @@ arc_extoper (opertype) name = input_line_pointer; c = get_symbol_end (); name = xstrdup (name); - if (NULL == name) - { - ignore_rest_of_line (); - return; - } p = name; while (*p) @@ -1154,11 +1148,6 @@ arc_extinst (ignore) 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); @@ -1306,18 +1295,7 @@ arc_extinst (ignore) 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); @@ -1476,7 +1454,6 @@ arc_common (localScope) symbolP->bsym->flags |= BSF_OBJECT; demand_empty_rest_of_line (); - return; } /* Select the cpu we're assembling for. */ @@ -1547,7 +1524,6 @@ md_atof (type, litP, sizeP) LITTLENUM_TYPE words[MAX_LITTLENUMS]; LITTLENUM_TYPE *wordP; char *t; - char * atof_ieee PARAMS ((char *, int, LITTLENUM_TYPE *)); switch (type) { @@ -1801,13 +1777,6 @@ long md_pcrel_from (fixP) fixS *fixP; { - if (fixP->fx_addsy != (symbolS *) NULL - && ! S_IS_DEFINED (fixP->fx_addsy)) - { - /* The symbol is undefined. Let the linker figure it out. */ - return 0; - } - /* Return the address of the delay slot. */ return fixP->fx_frag->fr_address + fixP->fx_where + fixP->fx_size; } @@ -1841,7 +1810,7 @@ get_arc_exp_reloc_type (data_p, default_type, exp, expnew) expressionS *expnew; { /* If the expression is "symbol >> 2" we must change it to just "symbol", - as fix_new_exp can't handle it. Similarily for (symbol - symbol) >> 2. + as fix_new_exp can't handle it. Similarly for (symbol - symbol) >> 2. That's ok though. What's really going on here is that we're using ">> 2" as a special syntax for specifying BFD_RELOC_ARC_B26. */ @@ -1891,45 +1860,19 @@ md_apply_fix3 (fixP, valP, seg) #endif valueT value = * valP; - /* FIXME FIXME FIXME: The value we are passed in *valueP includes - the symbol values. Since we are using BFD_ASSEMBLER, if we are - doing this relocation the code in write.c is going to call - bfd_perform_relocation, which is also going to use the symbol - value. That means that if the reloc is fully resolved we want to - use *valueP since bfd_perform_relocation is not being used. - However, if the reloc is not fully resolved we do not want to use - *valueP, and must use fx_offset instead. However, if the reloc - is PC relative, we do want to use *valueP since it includes the - result of md_pcrel_from. This is confusing. */ - if (fixP->fx_addsy == (symbolS *) NULL) fixP->fx_done = 1; else if (fixP->fx_pcrel) { - /* ELF relocations are against symbols. - If this symbol is in a different section then we need to leave it for - the linker to deal with. Unfortunately, md_pcrel_from can't tell, - so we have to undo it's effects here. */ - if (S_IS_DEFINED (fixP->fx_addsy) - && S_GET_SEGMENT (fixP->fx_addsy) != seg) + /* Hack around bfd_install_relocation brain damage. */ + if (S_GET_SEGMENT (fixP->fx_addsy) != seg) value += md_pcrel_from (fixP); } - else - { - value = fixP->fx_offset; - if (fixP->fx_subsy != (symbolS *) NULL) - { - if (S_GET_SEGMENT (fixP->fx_subsy) == absolute_section) - value -= S_GET_VALUE (fixP->fx_subsy); - else - { - /* We can't actually support subtracting a symbol. */ - as_bad_where (fixP->fx_file, fixP->fx_line, - "expression too complex"); - } - } - } + + /* We can't actually support subtracting a symbol. */ + if (fixP->fx_subsy != NULL) + as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED) { @@ -2032,8 +1975,6 @@ md_apply_fix3 (fixP, valP, seg) abort (); } } - - fixP->fx_addnumber = value; } /* Translate internal representation of relocation info to BFD target @@ -2063,8 +2004,7 @@ tc_gen_reloc (section, fixP) assert (!fixP->fx_pcrel == !reloc->howto->pc_relative); /* 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 */ + target address is computed. */ reloc->addend = (fixP->fx_pcrel ? -4 : 0); diff --git a/contrib/binutils/gas/config/tc-arc.h b/contrib/binutils/gas/config/tc-arc.h index f144271..884d375 100644 --- a/contrib/binutils/gas/config/tc-arc.h +++ b/contrib/binutils/gas/config/tc-arc.h @@ -1,5 +1,6 @@ /* tc-arc.h - Macros and type defines for the ARC. - Copyright 1994, 1995, 1997, 2000, 2001 Free Software Foundation, Inc. + Copyright 1994, 1995, 1997, 2000, 2001, 2002 + Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). This file is part of GAS, the GNU Assembler. @@ -64,3 +65,10 @@ extern void arc_cons_fix_new PARAMS ((struct frag *, int, int, struct expression arc_cons_fix_new (FRAG, WHERE, NBYTES, EXP) #define DWARF2_LINE_MIN_INSN_LENGTH 4 + +/* Values passed to md_apply_fix3 don't include the symbol value. */ +#define MD_APPLY_SYM_VALUE(FIX) 0 + +/* No shared lib support, so we don't need to ensure externally + visible symbols can be overridden. */ +#define EXTERN_FORCE_RELOC 0 diff --git a/contrib/binutils/gas/config/tc-arm.c b/contrib/binutils/gas/config/tc-arm.c index a6bbba1..2ed5196 100644 --- a/contrib/binutils/gas/config/tc-arm.c +++ b/contrib/binutils/gas/config/tc-arm.c @@ -1,9 +1,11 @@ /* tc-arm.c -- Assemble for the ARM - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Modified by David Taylor (dtaylor@armltd.co.uk) Cirrus coprocessor mods by Aldy Hernandez (aldyh@redhat.com) + Cirrus coprocessor fixes by Petko Manolov (petkan@nucleusys.com) + Cirrus coprocessor fixes by Vladimir Ivanov (vladitx@nucleusys.com) This file is part of GAS, the GNU Assembler. @@ -55,10 +57,12 @@ #define ARM_EXT_V5ExP 0x00000200 /* DSP core set. */ #define ARM_EXT_V5E 0x00000400 /* DSP Double transfers. */ #define ARM_EXT_V5J 0x00000800 /* Jazelle extension. */ +#define ARM_EXT_V6 0x00001000 /* ARM V6. */ /* Co-processor space extensions. */ #define ARM_CEXT_XSCALE 0x00800000 /* Allow MIA etc. */ #define ARM_CEXT_MAVERICK 0x00400000 /* Use Cirrus/DSP coprocessor. */ +#define ARM_CEXT_IWMMXT 0x00200000 /* Intel Wireless MMX technology coprocessor. */ /* Architectures are the sum of the base and extensions. The ARM ARM (rev E) defines the following: ARMv3, ARMv3M, ARMv4xM, ARMv4, ARMv4TxM, ARMv4T, @@ -81,9 +85,11 @@ #define ARM_ARCH_V5TExP (ARM_ARCH_V5T | ARM_EXT_V5ExP) #define ARM_ARCH_V5TE (ARM_ARCH_V5TExP | ARM_EXT_V5E) #define ARM_ARCH_V5TEJ (ARM_ARCH_V5TE | ARM_EXT_V5J) +#define ARM_ARCH_V6 (ARM_ARCH_V5TEJ | ARM_EXT_V6) /* Processors with specific extensions in the co-processor space. */ #define ARM_ARCH_XSCALE (ARM_ARCH_V5TE | ARM_CEXT_XSCALE) +#define ARM_ARCH_IWMMXT (ARM_ARCH_XSCALE | ARM_CEXT_IWMMXT) /* Some useful combinations: */ #define ARM_ANY 0x0000ffff /* Any basic core. */ @@ -98,6 +104,7 @@ #define FPU_VFP_EXT_V1xD 0x10000000 /* Base VFP instruction set. */ #define FPU_VFP_EXT_V1 0x08000000 /* Double-precision insns. */ #define FPU_VFP_EXT_V2 0x04000000 /* ARM10E VFPr1. */ +#define FPU_MAVERICK 0x02000000 /* Cirrus Maverick. */ #define FPU_NONE 0 #define FPU_ARCH_FPE FPU_FPA_EXT_V1 @@ -108,6 +115,15 @@ #define FPU_ARCH_VFP_V1 (FPU_ARCH_VFP_V1xD | FPU_VFP_EXT_V1) #define FPU_ARCH_VFP_V2 (FPU_ARCH_VFP_V1 | FPU_VFP_EXT_V2) +#define FPU_ARCH_MAVERICK FPU_MAVERICK + +enum arm_float_abi +{ + ARM_FLOAT_ABI_HARD, + ARM_FLOAT_ABI_SOFTFP, + ARM_FLOAT_ABI_SOFT +}; + /* Types of processor to assemble for. */ #define ARM_1 ARM_ARCH_V1 #define ARM_2 ARM_ARCH_V2 @@ -132,6 +148,19 @@ #endif #endif +#ifdef TE_LINUX +#define FPU_DEFAULT FPU_ARCH_FPA +#endif + +#ifdef TE_NetBSD +#ifdef OBJ_ELF +#define FPU_DEFAULT FPU_ARCH_VFP /* Soft-float, but VFP order. */ +#else +/* Legacy a.out format. */ +#define FPU_DEFAULT FPU_ARCH_FPA /* Soft-float, but FPA order. */ +#endif +#endif + /* For backwards compatibility we default to the FPA. */ #ifndef FPU_DEFAULT #define FPU_DEFAULT FPU_ARCH_FPA @@ -144,11 +173,11 @@ static unsigned long cpu_variant; static int target_oabi = 0; /* Flags stored in private area of BFD structure. */ -static int uses_apcs_26 = false; -static int atpcs = false; -static int support_interwork = false; -static int uses_apcs_float = false; -static int pic_code = false; +static int uses_apcs_26 = FALSE; +static int atpcs = FALSE; +static int support_interwork = FALSE; +static int uses_apcs_float = FALSE; +static int pic_code = FALSE; /* Variables that we set while parsing command-line options. Once all options have been read we re-process these values to set the real @@ -161,6 +190,7 @@ static int mcpu_fpu_opt = -1; static int march_cpu_opt = -1; static int march_fpu_opt = -1; static int mfpu_opt = -1; +static int mfloat_abi_opt = -1; /* This array holds the chars that always start a comment. If the pre-processor is disabled, these aren't very useful. */ @@ -273,8 +303,16 @@ static const struct asm_shift_name shift_names [] = { "RRX", shift_properties + SHIFT_RRX } }; +/* Any kind of shift is accepted. */ #define NO_SHIFT_RESTRICT 1 -#define SHIFT_RESTRICT 0 +/* The shift operand must be an immediate value, not a register. */ +#define SHIFT_IMMEDIATE 0 +/* The shift must be LSL or ASR and the operand must be an immediate. */ +#define SHIFT_LSL_OR_ASR_IMMEDIATE 2 +/* The shift must be ASR and the operand must be an immediate. */ +#define SHIFT_ASR_IMMEDIATE 3 +/* The shift must be LSL and the operand must be an immediate. */ +#define SHIFT_LSL_IMMEDIATE 4 #define NUM_FLOAT_VALS 8 @@ -342,12 +380,12 @@ static const struct asm_cond conds[] = struct asm_psr { - const char * template; - boolean cpsr; + const char *template; + bfd_boolean cpsr; unsigned long field; }; -/* The bit that distnguishes CPSR and SPSR. */ +/* The bit that distinguishes CPSR and SPSR. */ #define SPSR_BIT (1 << 22) /* How many bits to shift the PSR_xxx bits up by. */ @@ -360,143 +398,172 @@ struct asm_psr static const struct asm_psr psrs[] = { - {"CPSR", true, PSR_c | PSR_f}, - {"CPSR_all", true, PSR_c | PSR_f}, - {"SPSR", false, PSR_c | PSR_f}, - {"SPSR_all", false, PSR_c | PSR_f}, - {"CPSR_flg", true, PSR_f}, - {"CPSR_f", true, PSR_f}, - {"SPSR_flg", false, PSR_f}, - {"SPSR_f", false, PSR_f}, - {"CPSR_c", true, PSR_c}, - {"CPSR_ctl", true, PSR_c}, - {"SPSR_c", false, PSR_c}, - {"SPSR_ctl", false, PSR_c}, - {"CPSR_x", true, PSR_x}, - {"CPSR_s", true, PSR_s}, - {"SPSR_x", false, PSR_x}, - {"SPSR_s", false, PSR_s}, + {"CPSR", TRUE, PSR_c | PSR_f}, + {"CPSR_all", TRUE, PSR_c | PSR_f}, + {"SPSR", FALSE, PSR_c | PSR_f}, + {"SPSR_all", FALSE, PSR_c | PSR_f}, + {"CPSR_flg", TRUE, PSR_f}, + {"CPSR_f", TRUE, PSR_f}, + {"SPSR_flg", FALSE, PSR_f}, + {"SPSR_f", FALSE, PSR_f}, + {"CPSR_c", TRUE, PSR_c}, + {"CPSR_ctl", TRUE, PSR_c}, + {"SPSR_c", FALSE, PSR_c}, + {"SPSR_ctl", FALSE, PSR_c}, + {"CPSR_x", TRUE, PSR_x}, + {"CPSR_s", TRUE, PSR_s}, + {"SPSR_x", FALSE, PSR_x}, + {"SPSR_s", FALSE, PSR_s}, /* Combinations of flags. */ - {"CPSR_fs", true, PSR_f | PSR_s}, - {"CPSR_fx", true, PSR_f | PSR_x}, - {"CPSR_fc", true, PSR_f | PSR_c}, - {"CPSR_sf", true, PSR_s | PSR_f}, - {"CPSR_sx", true, PSR_s | PSR_x}, - {"CPSR_sc", true, PSR_s | PSR_c}, - {"CPSR_xf", true, PSR_x | PSR_f}, - {"CPSR_xs", true, PSR_x | PSR_s}, - {"CPSR_xc", true, PSR_x | PSR_c}, - {"CPSR_cf", true, PSR_c | PSR_f}, - {"CPSR_cs", true, PSR_c | PSR_s}, - {"CPSR_cx", true, PSR_c | PSR_x}, - {"CPSR_fsx", true, PSR_f | PSR_s | PSR_x}, - {"CPSR_fsc", true, PSR_f | PSR_s | PSR_c}, - {"CPSR_fxs", true, PSR_f | PSR_x | PSR_s}, - {"CPSR_fxc", true, PSR_f | PSR_x | PSR_c}, - {"CPSR_fcs", true, PSR_f | PSR_c | PSR_s}, - {"CPSR_fcx", true, PSR_f | PSR_c | PSR_x}, - {"CPSR_sfx", true, PSR_s | PSR_f | PSR_x}, - {"CPSR_sfc", true, PSR_s | PSR_f | PSR_c}, - {"CPSR_sxf", true, PSR_s | PSR_x | PSR_f}, - {"CPSR_sxc", true, PSR_s | PSR_x | PSR_c}, - {"CPSR_scf", true, PSR_s | PSR_c | PSR_f}, - {"CPSR_scx", true, PSR_s | PSR_c | PSR_x}, - {"CPSR_xfs", true, PSR_x | PSR_f | PSR_s}, - {"CPSR_xfc", true, PSR_x | PSR_f | PSR_c}, - {"CPSR_xsf", true, PSR_x | PSR_s | PSR_f}, - {"CPSR_xsc", true, PSR_x | PSR_s | PSR_c}, - {"CPSR_xcf", true, PSR_x | PSR_c | PSR_f}, - {"CPSR_xcs", true, PSR_x | PSR_c | PSR_s}, - {"CPSR_cfs", true, PSR_c | PSR_f | PSR_s}, - {"CPSR_cfx", true, PSR_c | PSR_f | PSR_x}, - {"CPSR_csf", true, PSR_c | PSR_s | PSR_f}, - {"CPSR_csx", true, PSR_c | PSR_s | PSR_x}, - {"CPSR_cxf", true, PSR_c | PSR_x | PSR_f}, - {"CPSR_cxs", true, PSR_c | PSR_x | PSR_s}, - {"CPSR_fsxc", true, PSR_f | PSR_s | PSR_x | PSR_c}, - {"CPSR_fscx", true, PSR_f | PSR_s | PSR_c | PSR_x}, - {"CPSR_fxsc", true, PSR_f | PSR_x | PSR_s | PSR_c}, - {"CPSR_fxcs", true, PSR_f | PSR_x | PSR_c | PSR_s}, - {"CPSR_fcsx", true, PSR_f | PSR_c | PSR_s | PSR_x}, - {"CPSR_fcxs", true, PSR_f | PSR_c | PSR_x | PSR_s}, - {"CPSR_sfxc", true, PSR_s | PSR_f | PSR_x | PSR_c}, - {"CPSR_sfcx", true, PSR_s | PSR_f | PSR_c | PSR_x}, - {"CPSR_sxfc", true, PSR_s | PSR_x | PSR_f | PSR_c}, - {"CPSR_sxcf", true, PSR_s | PSR_x | PSR_c | PSR_f}, - {"CPSR_scfx", true, PSR_s | PSR_c | PSR_f | PSR_x}, - {"CPSR_scxf", true, PSR_s | PSR_c | PSR_x | PSR_f}, - {"CPSR_xfsc", true, PSR_x | PSR_f | PSR_s | PSR_c}, - {"CPSR_xfcs", true, PSR_x | PSR_f | PSR_c | PSR_s}, - {"CPSR_xsfc", true, PSR_x | PSR_s | PSR_f | PSR_c}, - {"CPSR_xscf", true, PSR_x | PSR_s | PSR_c | PSR_f}, - {"CPSR_xcfs", true, PSR_x | PSR_c | PSR_f | PSR_s}, - {"CPSR_xcsf", true, PSR_x | PSR_c | PSR_s | PSR_f}, - {"CPSR_cfsx", true, PSR_c | PSR_f | PSR_s | PSR_x}, - {"CPSR_cfxs", true, PSR_c | PSR_f | PSR_x | PSR_s}, - {"CPSR_csfx", true, PSR_c | PSR_s | PSR_f | PSR_x}, - {"CPSR_csxf", true, PSR_c | PSR_s | PSR_x | PSR_f}, - {"CPSR_cxfs", true, PSR_c | PSR_x | PSR_f | PSR_s}, - {"CPSR_cxsf", true, PSR_c | PSR_x | PSR_s | PSR_f}, - {"SPSR_fs", false, PSR_f | PSR_s}, - {"SPSR_fx", false, PSR_f | PSR_x}, - {"SPSR_fc", false, PSR_f | PSR_c}, - {"SPSR_sf", false, PSR_s | PSR_f}, - {"SPSR_sx", false, PSR_s | PSR_x}, - {"SPSR_sc", false, PSR_s | PSR_c}, - {"SPSR_xf", false, PSR_x | PSR_f}, - {"SPSR_xs", false, PSR_x | PSR_s}, - {"SPSR_xc", false, PSR_x | PSR_c}, - {"SPSR_cf", false, PSR_c | PSR_f}, - {"SPSR_cs", false, PSR_c | PSR_s}, - {"SPSR_cx", false, PSR_c | PSR_x}, - {"SPSR_fsx", false, PSR_f | PSR_s | PSR_x}, - {"SPSR_fsc", false, PSR_f | PSR_s | PSR_c}, - {"SPSR_fxs", false, PSR_f | PSR_x | PSR_s}, - {"SPSR_fxc", false, PSR_f | PSR_x | PSR_c}, - {"SPSR_fcs", false, PSR_f | PSR_c | PSR_s}, - {"SPSR_fcx", false, PSR_f | PSR_c | PSR_x}, - {"SPSR_sfx", false, PSR_s | PSR_f | PSR_x}, - {"SPSR_sfc", false, PSR_s | PSR_f | PSR_c}, - {"SPSR_sxf", false, PSR_s | PSR_x | PSR_f}, - {"SPSR_sxc", false, PSR_s | PSR_x | PSR_c}, - {"SPSR_scf", false, PSR_s | PSR_c | PSR_f}, - {"SPSR_scx", false, PSR_s | PSR_c | PSR_x}, - {"SPSR_xfs", false, PSR_x | PSR_f | PSR_s}, - {"SPSR_xfc", false, PSR_x | PSR_f | PSR_c}, - {"SPSR_xsf", false, PSR_x | PSR_s | PSR_f}, - {"SPSR_xsc", false, PSR_x | PSR_s | PSR_c}, - {"SPSR_xcf", false, PSR_x | PSR_c | PSR_f}, - {"SPSR_xcs", false, PSR_x | PSR_c | PSR_s}, - {"SPSR_cfs", false, PSR_c | PSR_f | PSR_s}, - {"SPSR_cfx", false, PSR_c | PSR_f | PSR_x}, - {"SPSR_csf", false, PSR_c | PSR_s | PSR_f}, - {"SPSR_csx", false, PSR_c | PSR_s | PSR_x}, - {"SPSR_cxf", false, PSR_c | PSR_x | PSR_f}, - {"SPSR_cxs", false, PSR_c | PSR_x | PSR_s}, - {"SPSR_fsxc", false, PSR_f | PSR_s | PSR_x | PSR_c}, - {"SPSR_fscx", false, PSR_f | PSR_s | PSR_c | PSR_x}, - {"SPSR_fxsc", false, PSR_f | PSR_x | PSR_s | PSR_c}, - {"SPSR_fxcs", false, PSR_f | PSR_x | PSR_c | PSR_s}, - {"SPSR_fcsx", false, PSR_f | PSR_c | PSR_s | PSR_x}, - {"SPSR_fcxs", false, PSR_f | PSR_c | PSR_x | PSR_s}, - {"SPSR_sfxc", false, PSR_s | PSR_f | PSR_x | PSR_c}, - {"SPSR_sfcx", false, PSR_s | PSR_f | PSR_c | PSR_x}, - {"SPSR_sxfc", false, PSR_s | PSR_x | PSR_f | PSR_c}, - {"SPSR_sxcf", false, PSR_s | PSR_x | PSR_c | PSR_f}, - {"SPSR_scfx", false, PSR_s | PSR_c | PSR_f | PSR_x}, - {"SPSR_scxf", false, PSR_s | PSR_c | PSR_x | PSR_f}, - {"SPSR_xfsc", false, PSR_x | PSR_f | PSR_s | PSR_c}, - {"SPSR_xfcs", false, PSR_x | PSR_f | PSR_c | PSR_s}, - {"SPSR_xsfc", false, PSR_x | PSR_s | PSR_f | PSR_c}, - {"SPSR_xscf", false, PSR_x | PSR_s | PSR_c | PSR_f}, - {"SPSR_xcfs", false, PSR_x | PSR_c | PSR_f | PSR_s}, - {"SPSR_xcsf", false, PSR_x | PSR_c | PSR_s | PSR_f}, - {"SPSR_cfsx", false, PSR_c | PSR_f | PSR_s | PSR_x}, - {"SPSR_cfxs", false, PSR_c | PSR_f | PSR_x | PSR_s}, - {"SPSR_csfx", false, PSR_c | PSR_s | PSR_f | PSR_x}, - {"SPSR_csxf", false, PSR_c | PSR_s | PSR_x | PSR_f}, - {"SPSR_cxfs", false, PSR_c | PSR_x | PSR_f | PSR_s}, - {"SPSR_cxsf", false, PSR_c | PSR_x | PSR_s | PSR_f}, + {"CPSR_fs", TRUE, PSR_f | PSR_s}, + {"CPSR_fx", TRUE, PSR_f | PSR_x}, + {"CPSR_fc", TRUE, PSR_f | PSR_c}, + {"CPSR_sf", TRUE, PSR_s | PSR_f}, + {"CPSR_sx", TRUE, PSR_s | PSR_x}, + {"CPSR_sc", TRUE, PSR_s | PSR_c}, + {"CPSR_xf", TRUE, PSR_x | PSR_f}, + {"CPSR_xs", TRUE, PSR_x | PSR_s}, + {"CPSR_xc", TRUE, PSR_x | PSR_c}, + {"CPSR_cf", TRUE, PSR_c | PSR_f}, + {"CPSR_cs", TRUE, PSR_c | PSR_s}, + {"CPSR_cx", TRUE, PSR_c | PSR_x}, + {"CPSR_fsx", TRUE, PSR_f | PSR_s | PSR_x}, + {"CPSR_fsc", TRUE, PSR_f | PSR_s | PSR_c}, + {"CPSR_fxs", TRUE, PSR_f | PSR_x | PSR_s}, + {"CPSR_fxc", TRUE, PSR_f | PSR_x | PSR_c}, + {"CPSR_fcs", TRUE, PSR_f | PSR_c | PSR_s}, + {"CPSR_fcx", TRUE, PSR_f | PSR_c | PSR_x}, + {"CPSR_sfx", TRUE, PSR_s | PSR_f | PSR_x}, + {"CPSR_sfc", TRUE, PSR_s | PSR_f | PSR_c}, + {"CPSR_sxf", TRUE, PSR_s | PSR_x | PSR_f}, + {"CPSR_sxc", TRUE, PSR_s | PSR_x | PSR_c}, + {"CPSR_scf", TRUE, PSR_s | PSR_c | PSR_f}, + {"CPSR_scx", TRUE, PSR_s | PSR_c | PSR_x}, + {"CPSR_xfs", TRUE, PSR_x | PSR_f | PSR_s}, + {"CPSR_xfc", TRUE, PSR_x | PSR_f | PSR_c}, + {"CPSR_xsf", TRUE, PSR_x | PSR_s | PSR_f}, + {"CPSR_xsc", TRUE, PSR_x | PSR_s | PSR_c}, + {"CPSR_xcf", TRUE, PSR_x | PSR_c | PSR_f}, + {"CPSR_xcs", TRUE, PSR_x | PSR_c | PSR_s}, + {"CPSR_cfs", TRUE, PSR_c | PSR_f | PSR_s}, + {"CPSR_cfx", TRUE, PSR_c | PSR_f | PSR_x}, + {"CPSR_csf", TRUE, PSR_c | PSR_s | PSR_f}, + {"CPSR_csx", TRUE, PSR_c | PSR_s | PSR_x}, + {"CPSR_cxf", TRUE, PSR_c | PSR_x | PSR_f}, + {"CPSR_cxs", TRUE, PSR_c | PSR_x | PSR_s}, + {"CPSR_fsxc", TRUE, PSR_f | PSR_s | PSR_x | PSR_c}, + {"CPSR_fscx", TRUE, PSR_f | PSR_s | PSR_c | PSR_x}, + {"CPSR_fxsc", TRUE, PSR_f | PSR_x | PSR_s | PSR_c}, + {"CPSR_fxcs", TRUE, PSR_f | PSR_x | PSR_c | PSR_s}, + {"CPSR_fcsx", TRUE, PSR_f | PSR_c | PSR_s | PSR_x}, + {"CPSR_fcxs", TRUE, PSR_f | PSR_c | PSR_x | PSR_s}, + {"CPSR_sfxc", TRUE, PSR_s | PSR_f | PSR_x | PSR_c}, + {"CPSR_sfcx", TRUE, PSR_s | PSR_f | PSR_c | PSR_x}, + {"CPSR_sxfc", TRUE, PSR_s | PSR_x | PSR_f | PSR_c}, + {"CPSR_sxcf", TRUE, PSR_s | PSR_x | PSR_c | PSR_f}, + {"CPSR_scfx", TRUE, PSR_s | PSR_c | PSR_f | PSR_x}, + {"CPSR_scxf", TRUE, PSR_s | PSR_c | PSR_x | PSR_f}, + {"CPSR_xfsc", TRUE, PSR_x | PSR_f | PSR_s | PSR_c}, + {"CPSR_xfcs", TRUE, PSR_x | PSR_f | PSR_c | PSR_s}, + {"CPSR_xsfc", TRUE, PSR_x | PSR_s | PSR_f | PSR_c}, + {"CPSR_xscf", TRUE, PSR_x | PSR_s | PSR_c | PSR_f}, + {"CPSR_xcfs", TRUE, PSR_x | PSR_c | PSR_f | PSR_s}, + {"CPSR_xcsf", TRUE, PSR_x | PSR_c | PSR_s | PSR_f}, + {"CPSR_cfsx", TRUE, PSR_c | PSR_f | PSR_s | PSR_x}, + {"CPSR_cfxs", TRUE, PSR_c | PSR_f | PSR_x | PSR_s}, + {"CPSR_csfx", TRUE, PSR_c | PSR_s | PSR_f | PSR_x}, + {"CPSR_csxf", TRUE, PSR_c | PSR_s | PSR_x | PSR_f}, + {"CPSR_cxfs", TRUE, PSR_c | PSR_x | PSR_f | PSR_s}, + {"CPSR_cxsf", TRUE, PSR_c | PSR_x | PSR_s | PSR_f}, + {"SPSR_fs", FALSE, PSR_f | PSR_s}, + {"SPSR_fx", FALSE, PSR_f | PSR_x}, + {"SPSR_fc", FALSE, PSR_f | PSR_c}, + {"SPSR_sf", FALSE, PSR_s | PSR_f}, + {"SPSR_sx", FALSE, PSR_s | PSR_x}, + {"SPSR_sc", FALSE, PSR_s | PSR_c}, + {"SPSR_xf", FALSE, PSR_x | PSR_f}, + {"SPSR_xs", FALSE, PSR_x | PSR_s}, + {"SPSR_xc", FALSE, PSR_x | PSR_c}, + {"SPSR_cf", FALSE, PSR_c | PSR_f}, + {"SPSR_cs", FALSE, PSR_c | PSR_s}, + {"SPSR_cx", FALSE, PSR_c | PSR_x}, + {"SPSR_fsx", FALSE, PSR_f | PSR_s | PSR_x}, + {"SPSR_fsc", FALSE, PSR_f | PSR_s | PSR_c}, + {"SPSR_fxs", FALSE, PSR_f | PSR_x | PSR_s}, + {"SPSR_fxc", FALSE, PSR_f | PSR_x | PSR_c}, + {"SPSR_fcs", FALSE, PSR_f | PSR_c | PSR_s}, + {"SPSR_fcx", FALSE, PSR_f | PSR_c | PSR_x}, + {"SPSR_sfx", FALSE, PSR_s | PSR_f | PSR_x}, + {"SPSR_sfc", FALSE, PSR_s | PSR_f | PSR_c}, + {"SPSR_sxf", FALSE, PSR_s | PSR_x | PSR_f}, + {"SPSR_sxc", FALSE, PSR_s | PSR_x | PSR_c}, + {"SPSR_scf", FALSE, PSR_s | PSR_c | PSR_f}, + {"SPSR_scx", FALSE, PSR_s | PSR_c | PSR_x}, + {"SPSR_xfs", FALSE, PSR_x | PSR_f | PSR_s}, + {"SPSR_xfc", FALSE, PSR_x | PSR_f | PSR_c}, + {"SPSR_xsf", FALSE, PSR_x | PSR_s | PSR_f}, + {"SPSR_xsc", FALSE, PSR_x | PSR_s | PSR_c}, + {"SPSR_xcf", FALSE, PSR_x | PSR_c | PSR_f}, + {"SPSR_xcs", FALSE, PSR_x | PSR_c | PSR_s}, + {"SPSR_cfs", FALSE, PSR_c | PSR_f | PSR_s}, + {"SPSR_cfx", FALSE, PSR_c | PSR_f | PSR_x}, + {"SPSR_csf", FALSE, PSR_c | PSR_s | PSR_f}, + {"SPSR_csx", FALSE, PSR_c | PSR_s | PSR_x}, + {"SPSR_cxf", FALSE, PSR_c | PSR_x | PSR_f}, + {"SPSR_cxs", FALSE, PSR_c | PSR_x | PSR_s}, + {"SPSR_fsxc", FALSE, PSR_f | PSR_s | PSR_x | PSR_c}, + {"SPSR_fscx", FALSE, PSR_f | PSR_s | PSR_c | PSR_x}, + {"SPSR_fxsc", FALSE, PSR_f | PSR_x | PSR_s | PSR_c}, + {"SPSR_fxcs", FALSE, PSR_f | PSR_x | PSR_c | PSR_s}, + {"SPSR_fcsx", FALSE, PSR_f | PSR_c | PSR_s | PSR_x}, + {"SPSR_fcxs", FALSE, PSR_f | PSR_c | PSR_x | PSR_s}, + {"SPSR_sfxc", FALSE, PSR_s | PSR_f | PSR_x | PSR_c}, + {"SPSR_sfcx", FALSE, PSR_s | PSR_f | PSR_c | PSR_x}, + {"SPSR_sxfc", FALSE, PSR_s | PSR_x | PSR_f | PSR_c}, + {"SPSR_sxcf", FALSE, PSR_s | PSR_x | PSR_c | PSR_f}, + {"SPSR_scfx", FALSE, PSR_s | PSR_c | PSR_f | PSR_x}, + {"SPSR_scxf", FALSE, PSR_s | PSR_c | PSR_x | PSR_f}, + {"SPSR_xfsc", FALSE, PSR_x | PSR_f | PSR_s | PSR_c}, + {"SPSR_xfcs", FALSE, PSR_x | PSR_f | PSR_c | PSR_s}, + {"SPSR_xsfc", FALSE, PSR_x | PSR_s | PSR_f | PSR_c}, + {"SPSR_xscf", FALSE, PSR_x | PSR_s | PSR_c | PSR_f}, + {"SPSR_xcfs", FALSE, PSR_x | PSR_c | PSR_f | PSR_s}, + {"SPSR_xcsf", FALSE, PSR_x | PSR_c | PSR_s | PSR_f}, + {"SPSR_cfsx", FALSE, PSR_c | PSR_f | PSR_s | PSR_x}, + {"SPSR_cfxs", FALSE, PSR_c | PSR_f | PSR_x | PSR_s}, + {"SPSR_csfx", FALSE, PSR_c | PSR_s | PSR_f | PSR_x}, + {"SPSR_csxf", FALSE, PSR_c | PSR_s | PSR_x | PSR_f}, + {"SPSR_cxfs", FALSE, PSR_c | PSR_x | PSR_f | PSR_s}, + {"SPSR_cxsf", FALSE, PSR_c | PSR_x | PSR_s | PSR_f}, +}; + +enum wreg_type + { + IWMMXT_REG_WR = 0, + IWMMXT_REG_WC = 1, + IWMMXT_REG_WR_OR_WC = 2, + IWMMXT_REG_WCG + }; + +enum iwmmxt_insn_type +{ + check_rd, + check_wr, + check_wrwr, + check_wrwrwr, + check_wrwrwcg, + check_tbcst, + check_tmovmsk, + check_tmia, + check_tmcrr, + check_tmrrc, + check_tmcr, + check_tmrc, + check_tinsr, + check_textrc, + check_waligni, + check_textrm, + check_wshufh }; enum vfp_dp_reg_pos @@ -536,6 +603,7 @@ struct reg_entry { const char * name; int number; + bfd_boolean builtin; }; /* Some well known registers that we refer to directly elsewhere. */ @@ -543,129 +611,168 @@ struct reg_entry #define REG_LR 14 #define REG_PC 15 -/* These are the standard names. Users can add aliases with .req. */ +#define wr_register(reg) ((reg ^ WR_PREFIX) >= 0 && (reg ^ WR_PREFIX) <= 15) +#define wc_register(reg) ((reg ^ WC_PREFIX) >= 0 && (reg ^ WC_PREFIX) <= 15) +#define wcg_register(reg) ((reg ^ WC_PREFIX) >= 8 && (reg ^ WC_PREFIX) <= 11) + +/* These are the standard names. Users can add aliases with .req. + and delete them with .unreq. */ + /* Integer Register Numbers. */ static const struct reg_entry rn_table[] = { - {"r0", 0}, {"r1", 1}, {"r2", 2}, {"r3", 3}, - {"r4", 4}, {"r5", 5}, {"r6", 6}, {"r7", 7}, - {"r8", 8}, {"r9", 9}, {"r10", 10}, {"r11", 11}, - {"r12", 12}, {"r13", REG_SP}, {"r14", REG_LR}, {"r15", REG_PC}, + {"r0", 0, TRUE}, {"r1", 1, TRUE}, {"r2", 2, TRUE}, {"r3", 3, TRUE}, + {"r4", 4, TRUE}, {"r5", 5, TRUE}, {"r6", 6, TRUE}, {"r7", 7, TRUE}, + {"r8", 8, TRUE}, {"r9", 9, TRUE}, {"r10", 10, TRUE}, {"r11", 11, TRUE}, + {"r12", 12, TRUE}, {"r13", REG_SP, TRUE}, {"r14", REG_LR, TRUE}, {"r15", REG_PC, TRUE}, /* ATPCS Synonyms. */ - {"a1", 0}, {"a2", 1}, {"a3", 2}, {"a4", 3}, - {"v1", 4}, {"v2", 5}, {"v3", 6}, {"v4", 7}, - {"v5", 8}, {"v6", 9}, {"v7", 10}, {"v8", 11}, + {"a1", 0, TRUE}, {"a2", 1, TRUE}, {"a3", 2, TRUE}, {"a4", 3, TRUE}, + {"v1", 4, TRUE}, {"v2", 5, TRUE}, {"v3", 6, TRUE}, {"v4", 7, TRUE}, + {"v5", 8, TRUE}, {"v6", 9, TRUE}, {"v7", 10, TRUE}, {"v8", 11, TRUE}, /* Well-known aliases. */ - {"wr", 7}, - {"sb", 9}, {"sl", 10}, {"fp", 11}, - {"ip", 12}, {"sp", REG_SP}, {"lr", REG_LR}, {"pc", REG_PC}, - {NULL, 0} + {"wr", 7, TRUE}, {"sb", 9, TRUE}, {"sl", 10, TRUE}, {"fp", 11, TRUE}, + {"ip", 12, TRUE}, {"sp", REG_SP, TRUE}, {"lr", REG_LR, TRUE}, {"pc", REG_PC, TRUE}, + {NULL, 0, TRUE} +}; + +#define WR_PREFIX 0x200 +#define WC_PREFIX 0x400 + +static const struct reg_entry iwmmxt_table[] = +{ + /* Intel Wireless MMX technology register names. */ + { "wr0", 0x0 | WR_PREFIX, TRUE}, {"wr1", 0x1 | WR_PREFIX, TRUE}, + { "wr2", 0x2 | WR_PREFIX, TRUE}, {"wr3", 0x3 | WR_PREFIX, TRUE}, + { "wr4", 0x4 | WR_PREFIX, TRUE}, {"wr5", 0x5 | WR_PREFIX, TRUE}, + { "wr6", 0x6 | WR_PREFIX, TRUE}, {"wr7", 0x7 | WR_PREFIX, TRUE}, + { "wr8", 0x8 | WR_PREFIX, TRUE}, {"wr9", 0x9 | WR_PREFIX, TRUE}, + { "wr10", 0xa | WR_PREFIX, TRUE}, {"wr11", 0xb | WR_PREFIX, TRUE}, + { "wr12", 0xc | WR_PREFIX, TRUE}, {"wr13", 0xd | WR_PREFIX, TRUE}, + { "wr14", 0xe | WR_PREFIX, TRUE}, {"wr15", 0xf | WR_PREFIX, TRUE}, + { "wcid", 0x0 | WC_PREFIX, TRUE}, {"wcon", 0x1 | WC_PREFIX, TRUE}, + {"wcssf", 0x2 | WC_PREFIX, TRUE}, {"wcasf", 0x3 | WC_PREFIX, TRUE}, + {"wcgr0", 0x8 | WC_PREFIX, TRUE}, {"wcgr1", 0x9 | WC_PREFIX, TRUE}, + {"wcgr2", 0xa | WC_PREFIX, TRUE}, {"wcgr3", 0xb | WC_PREFIX, TRUE}, + + { "wR0", 0x0 | WR_PREFIX, TRUE}, {"wR1", 0x1 | WR_PREFIX, TRUE}, + { "wR2", 0x2 | WR_PREFIX, TRUE}, {"wR3", 0x3 | WR_PREFIX, TRUE}, + { "wR4", 0x4 | WR_PREFIX, TRUE}, {"wR5", 0x5 | WR_PREFIX, TRUE}, + { "wR6", 0x6 | WR_PREFIX, TRUE}, {"wR7", 0x7 | WR_PREFIX, TRUE}, + { "wR8", 0x8 | WR_PREFIX, TRUE}, {"wR9", 0x9 | WR_PREFIX, TRUE}, + { "wR10", 0xa | WR_PREFIX, TRUE}, {"wR11", 0xb | WR_PREFIX, TRUE}, + { "wR12", 0xc | WR_PREFIX, TRUE}, {"wR13", 0xd | WR_PREFIX, TRUE}, + { "wR14", 0xe | WR_PREFIX, TRUE}, {"wR15", 0xf | WR_PREFIX, TRUE}, + { "wCID", 0x0 | WC_PREFIX, TRUE}, {"wCon", 0x1 | WC_PREFIX, TRUE}, + {"wCSSF", 0x2 | WC_PREFIX, TRUE}, {"wCASF", 0x3 | WC_PREFIX, TRUE}, + {"wCGR0", 0x8 | WC_PREFIX, TRUE}, {"wCGR1", 0x9 | WC_PREFIX, TRUE}, + {"wCGR2", 0xa | WC_PREFIX, TRUE}, {"wCGR3", 0xb | WC_PREFIX, TRUE}, + {NULL, 0, TRUE} }; /* Co-processor Numbers. */ static const struct reg_entry cp_table[] = { - {"p0", 0}, {"p1", 1}, {"p2", 2}, {"p3", 3}, - {"p4", 4}, {"p5", 5}, {"p6", 6}, {"p7", 7}, - {"p8", 8}, {"p9", 9}, {"p10", 10}, {"p11", 11}, - {"p12", 12}, {"p13", 13}, {"p14", 14}, {"p15", 15}, - {NULL, 0} + {"p0", 0, TRUE}, {"p1", 1, TRUE}, {"p2", 2, TRUE}, {"p3", 3, TRUE}, + {"p4", 4, TRUE}, {"p5", 5, TRUE}, {"p6", 6, TRUE}, {"p7", 7, TRUE}, + {"p8", 8, TRUE}, {"p9", 9, TRUE}, {"p10", 10, TRUE}, {"p11", 11, TRUE}, + {"p12", 12, TRUE}, {"p13", 13, TRUE}, {"p14", 14, TRUE}, {"p15", 15, TRUE}, + {NULL, 0, TRUE} }; /* Co-processor Register Numbers. */ static const struct reg_entry cn_table[] = { - {"c0", 0}, {"c1", 1}, {"c2", 2}, {"c3", 3}, - {"c4", 4}, {"c5", 5}, {"c6", 6}, {"c7", 7}, - {"c8", 8}, {"c9", 9}, {"c10", 10}, {"c11", 11}, - {"c12", 12}, {"c13", 13}, {"c14", 14}, {"c15", 15}, + {"c0", 0, TRUE}, {"c1", 1, TRUE}, {"c2", 2, TRUE}, {"c3", 3, TRUE}, + {"c4", 4, TRUE}, {"c5", 5, TRUE}, {"c6", 6, TRUE}, {"c7", 7, TRUE}, + {"c8", 8, TRUE}, {"c9", 9, TRUE}, {"c10", 10, TRUE}, {"c11", 11, TRUE}, + {"c12", 12, TRUE}, {"c13", 13, TRUE}, {"c14", 14, TRUE}, {"c15", 15, TRUE}, /* Not really valid, but kept for back-wards compatibility. */ - {"cr0", 0}, {"cr1", 1}, {"cr2", 2}, {"cr3", 3}, - {"cr4", 4}, {"cr5", 5}, {"cr6", 6}, {"cr7", 7}, - {"cr8", 8}, {"cr9", 9}, {"cr10", 10}, {"cr11", 11}, - {"cr12", 12}, {"cr13", 13}, {"cr14", 14}, {"cr15", 15}, - {NULL, 0} + {"cr0", 0, TRUE}, {"cr1", 1, TRUE}, {"cr2", 2, TRUE}, {"cr3", 3, TRUE}, + {"cr4", 4, TRUE}, {"cr5", 5, TRUE}, {"cr6", 6, TRUE}, {"cr7", 7, TRUE}, + {"cr8", 8, TRUE}, {"cr9", 9, TRUE}, {"cr10", 10, TRUE}, {"cr11", 11, TRUE}, + {"cr12", 12, TRUE}, {"cr13", 13, TRUE}, {"cr14", 14, TRUE}, {"cr15", 15, TRUE}, + {NULL, 0, TRUE} }; /* FPA Registers. */ static const struct reg_entry fn_table[] = { - {"f0", 0}, {"f1", 1}, {"f2", 2}, {"f3", 3}, - {"f4", 4}, {"f5", 5}, {"f6", 6}, {"f7", 7}, - {NULL, 0} + {"f0", 0, TRUE}, {"f1", 1, TRUE}, {"f2", 2, TRUE}, {"f3", 3, TRUE}, + {"f4", 4, TRUE}, {"f5", 5, TRUE}, {"f6", 6, TRUE}, {"f7", 7, TRUE}, + {NULL, 0, TRUE} }; /* VFP SP Registers. */ static const struct reg_entry sn_table[] = { - {"s0", 0}, {"s1", 1}, {"s2", 2}, {"s3", 3}, - {"s4", 4}, {"s5", 5}, {"s6", 6}, {"s7", 7}, - {"s8", 8}, {"s9", 9}, {"s10", 10}, {"s11", 11}, - {"s12", 12}, {"s13", 13}, {"s14", 14}, {"s15", 15}, - {"s16", 16}, {"s17", 17}, {"s18", 18}, {"s19", 19}, - {"s20", 20}, {"s21", 21}, {"s22", 22}, {"s23", 23}, - {"s24", 24}, {"s25", 25}, {"s26", 26}, {"s27", 27}, - {"s28", 28}, {"s29", 29}, {"s30", 30}, {"s31", 31}, - {NULL, 0} + {"s0", 0, TRUE}, {"s1", 1, TRUE}, {"s2", 2, TRUE}, {"s3", 3, TRUE}, + {"s4", 4, TRUE}, {"s5", 5, TRUE}, {"s6", 6, TRUE}, {"s7", 7, TRUE}, + {"s8", 8, TRUE}, {"s9", 9, TRUE}, {"s10", 10, TRUE}, {"s11", 11, TRUE}, + {"s12", 12, TRUE}, {"s13", 13, TRUE}, {"s14", 14, TRUE}, {"s15", 15, TRUE}, + {"s16", 16, TRUE}, {"s17", 17, TRUE}, {"s18", 18, TRUE}, {"s19", 19, TRUE}, + {"s20", 20, TRUE}, {"s21", 21, TRUE}, {"s22", 22, TRUE}, {"s23", 23, TRUE}, + {"s24", 24, TRUE}, {"s25", 25, TRUE}, {"s26", 26, TRUE}, {"s27", 27, TRUE}, + {"s28", 28, TRUE}, {"s29", 29, TRUE}, {"s30", 30, TRUE}, {"s31", 31, TRUE}, + {NULL, 0, TRUE} }; /* VFP DP Registers. */ static const struct reg_entry dn_table[] = { - {"d0", 0}, {"d1", 1}, {"d2", 2}, {"d3", 3}, - {"d4", 4}, {"d5", 5}, {"d6", 6}, {"d7", 7}, - {"d8", 8}, {"d9", 9}, {"d10", 10}, {"d11", 11}, - {"d12", 12}, {"d13", 13}, {"d14", 14}, {"d15", 15}, - {NULL, 0} + {"d0", 0, TRUE}, {"d1", 1, TRUE}, {"d2", 2, TRUE}, {"d3", 3, TRUE}, + {"d4", 4, TRUE}, {"d5", 5, TRUE}, {"d6", 6, TRUE}, {"d7", 7, TRUE}, + {"d8", 8, TRUE}, {"d9", 9, TRUE}, {"d10", 10, TRUE}, {"d11", 11, TRUE}, + {"d12", 12, TRUE}, {"d13", 13, TRUE}, {"d14", 14, TRUE}, {"d15", 15, TRUE}, + {NULL, 0, TRUE} }; /* Maverick DSP coprocessor registers. */ static const struct reg_entry mav_mvf_table[] = { - {"mvf0", 0}, {"mvf1", 1}, {"mvf2", 2}, {"mvf3", 3}, - {"mvf4", 4}, {"mvf5", 5}, {"mvf6", 6}, {"mvf7", 7}, - {"mvf8", 8}, {"mvf9", 9}, {"mvf10", 10}, {"mvf11", 11}, - {"mvf12", 12}, {"mvf13", 13}, {"mvf14", 14}, {"mvf15", 15}, - {NULL, 0} + {"mvf0", 0, TRUE}, {"mvf1", 1, TRUE}, {"mvf2", 2, TRUE}, {"mvf3", 3, TRUE}, + {"mvf4", 4, TRUE}, {"mvf5", 5, TRUE}, {"mvf6", 6, TRUE}, {"mvf7", 7, TRUE}, + {"mvf8", 8, TRUE}, {"mvf9", 9, TRUE}, {"mvf10", 10, TRUE}, {"mvf11", 11, TRUE}, + {"mvf12", 12, TRUE}, {"mvf13", 13, TRUE}, {"mvf14", 14, TRUE}, {"mvf15", 15, TRUE}, + {NULL, 0, TRUE} }; static const struct reg_entry mav_mvd_table[] = { - {"mvd0", 0}, {"mvd1", 1}, {"mvd2", 2}, {"mvd3", 3}, - {"mvd4", 4}, {"mvd5", 5}, {"mvd6", 6}, {"mvd7", 7}, - {"mvd8", 8}, {"mvd9", 9}, {"mvd10", 10}, {"mvd11", 11}, - {"mvd12", 12}, {"mvd13", 13}, {"mvd14", 14}, {"mvd15", 15}, - {NULL, 0} + {"mvd0", 0, TRUE}, {"mvd1", 1, TRUE}, {"mvd2", 2, TRUE}, {"mvd3", 3, TRUE}, + {"mvd4", 4, TRUE}, {"mvd5", 5, TRUE}, {"mvd6", 6, TRUE}, {"mvd7", 7, TRUE}, + {"mvd8", 8, TRUE}, {"mvd9", 9, TRUE}, {"mvd10", 10, TRUE}, {"mvd11", 11, TRUE}, + {"mvd12", 12, TRUE}, {"mvd13", 13, TRUE}, {"mvd14", 14, TRUE}, {"mvd15", 15, TRUE}, + {NULL, 0, TRUE} }; static const struct reg_entry mav_mvfx_table[] = { - {"mvfx0", 0}, {"mvfx1", 1}, {"mvfx2", 2}, {"mvfx3", 3}, - {"mvfx4", 4}, {"mvfx5", 5}, {"mvfx6", 6}, {"mvfx7", 7}, - {"mvfx8", 8}, {"mvfx9", 9}, {"mvfx10", 10}, {"mvfx11", 11}, - {"mvfx12", 12}, {"mvfx13", 13}, {"mvfx14", 14}, {"mvfx15", 15}, - {NULL, 0} + {"mvfx0", 0, TRUE}, {"mvfx1", 1, TRUE}, {"mvfx2", 2, TRUE}, {"mvfx3", 3, TRUE}, + {"mvfx4", 4, TRUE}, {"mvfx5", 5, TRUE}, {"mvfx6", 6, TRUE}, {"mvfx7", 7, TRUE}, + {"mvfx8", 8, TRUE}, {"mvfx9", 9, TRUE}, {"mvfx10", 10, TRUE}, {"mvfx11", 11, TRUE}, + {"mvfx12", 12, TRUE}, {"mvfx13", 13, TRUE}, {"mvfx14", 14, TRUE}, {"mvfx15", 15, TRUE}, + {NULL, 0, TRUE} }; static const struct reg_entry mav_mvdx_table[] = { - {"mvdx0", 0}, {"mvdx1", 1}, {"mvdx2", 2}, {"mvdx3", 3}, - {"mvdx4", 4}, {"mvdx5", 5}, {"mvdx6", 6}, {"mvdx7", 7}, - {"mvdx8", 8}, {"mvdx9", 9}, {"mvdx10", 10}, {"mvdx11", 11}, - {"mvdx12", 12}, {"mvdx13", 13}, {"mvdx14", 14}, {"mvdx15", 15}, - {NULL, 0} + {"mvdx0", 0, TRUE}, {"mvdx1", 1, TRUE}, {"mvdx2", 2, TRUE}, {"mvdx3", 3, TRUE}, + {"mvdx4", 4, TRUE}, {"mvdx5", 5, TRUE}, {"mvdx6", 6, TRUE}, {"mvdx7", 7, TRUE}, + {"mvdx8", 8, TRUE}, {"mvdx9", 9, TRUE}, {"mvdx10", 10, TRUE}, {"mvdx11", 11, TRUE}, + {"mvdx12", 12, TRUE}, {"mvdx13", 13, TRUE}, {"mvdx14", 14, TRUE}, {"mvdx15", 15, TRUE}, + {NULL, 0, TRUE} }; static const struct reg_entry mav_mvax_table[] = { - {"mvax0", 0}, {"mvax1", 1}, {"mvax2", 2}, {"mvax3", 3}, - {NULL, 0} + {"mvax0", 0, TRUE}, {"mvax1", 1, TRUE}, {"mvax2", 2, TRUE}, {"mvax3", 3, TRUE}, + {NULL, 0, TRUE} }; static const struct reg_entry mav_dspsc_table[] = { - {"dspsc", 0}, - {NULL, 0} + {"dspsc", 0, TRUE}, + {NULL, 0, TRUE} }; struct reg_map @@ -687,9 +794,10 @@ struct reg_map all_reg_maps[] = {mav_mvf_table, 15, NULL, N_("Maverick MVF register expected")}, {mav_mvd_table, 15, NULL, N_("Maverick MVD register expected")}, {mav_mvfx_table, 15, NULL, N_("Maverick MVFX register expected")}, - {mav_mvdx_table, 15, NULL, N_("Maverick MVFX register expected")}, + {mav_mvdx_table, 15, NULL, N_("Maverick MVDX register expected")}, {mav_mvax_table, 3, NULL, N_("Maverick MVAX register expected")}, {mav_dspsc_table, 0, NULL, N_("Maverick DSPSC register expected")}, + {iwmmxt_table, 23, NULL, N_("Intel Wireless MMX technology register expected")}, }; /* Enumeration matching entries in table above. */ @@ -708,8 +816,9 @@ enum arm_reg_type REG_TYPE_MVDX = 9, REG_TYPE_MVAX = 10, REG_TYPE_DSPSC = 11, + REG_TYPE_IWMMXT = 12, - REG_TYPE_MAX = 12 + REG_TYPE_MAX = 13 }; /* Functions called by parser. */ @@ -770,6 +879,36 @@ static void do_co_reg2c PARAMS ((char *)); /* ARM v5TEJ. */ static void do_bxj PARAMS ((char *)); +/* ARM V6. */ +static void do_cps PARAMS ((char *)); +static void do_cpsi PARAMS ((char *)); +static void do_ldrex PARAMS ((char *)); +static void do_pkhbt PARAMS ((char *)); +static void do_pkhtb PARAMS ((char *)); +static void do_qadd16 PARAMS ((char *)); +static void do_rev PARAMS ((char *)); +static void do_rfe PARAMS ((char *)); +static void do_sxtah PARAMS ((char *)); +static void do_sxth PARAMS ((char *)); +static void do_setend PARAMS ((char *)); +static void do_smlad PARAMS ((char *)); +static void do_smlald PARAMS ((char *)); +static void do_smmul PARAMS ((char *)); +static void do_ssat PARAMS ((char *)); +static void do_usat PARAMS ((char *)); +static void do_srs PARAMS ((char *)); +static void do_ssat16 PARAMS ((char *)); +static void do_usat16 PARAMS ((char *)); +static void do_strex PARAMS ((char *)); +static void do_umaal PARAMS ((char *)); + +static void do_cps_mode PARAMS ((char **)); +static void do_cps_flags PARAMS ((char **, int)); +static int do_endian_specifier PARAMS ((char *)); +static void do_pkh_core PARAMS ((char *, int)); +static void do_sat PARAMS ((char **, int)); +static void do_sat16 PARAMS ((char **, int)); + /* Coprocessor Instructions. */ static void do_cdp PARAMS ((char *)); static void do_lstc PARAMS ((char *)); @@ -792,7 +931,8 @@ static void do_vfp_sp_dyadic PARAMS ((char *)); static void do_vfp_dp_dyadic PARAMS ((char *)); static void do_vfp_reg_from_sp PARAMS ((char *)); static void do_vfp_sp_from_reg PARAMS ((char *)); -static void do_vfp_sp_reg2 PARAMS ((char *)); +static void do_vfp_reg2_from_sp2 PARAMS ((char *)); +static void do_vfp_sp2_from_reg2 PARAMS ((char *)); static void do_vfp_reg_from_dp PARAMS ((char *)); static void do_vfp_reg2_from_dp PARAMS ((char *)); static void do_vfp_dp_from_reg PARAMS ((char *)); @@ -938,6 +1078,31 @@ static symbolS * find_real_start PARAMS ((symbolS *)); static bfd_reloc_code_real_type arm_parse_reloc PARAMS ((void)); #endif +static int wreg_required_here PARAMS ((char **, int, enum wreg_type)); +static void do_iwmmxt_byte_addr PARAMS ((char *)); +static void do_iwmmxt_tandc PARAMS ((char *)); +static void do_iwmmxt_tbcst PARAMS ((char *)); +static void do_iwmmxt_textrc PARAMS ((char *)); +static void do_iwmmxt_textrm PARAMS ((char *)); +static void do_iwmmxt_tinsr PARAMS ((char *)); +static void do_iwmmxt_tmcr PARAMS ((char *)); +static void do_iwmmxt_tmcrr PARAMS ((char *)); +static void do_iwmmxt_tmia PARAMS ((char *)); +static void do_iwmmxt_tmovmsk PARAMS ((char *)); +static void do_iwmmxt_tmrc PARAMS ((char *)); +static void do_iwmmxt_tmrrc PARAMS ((char *)); +static void do_iwmmxt_torc PARAMS ((char *)); +static void do_iwmmxt_waligni PARAMS ((char *)); +static void do_iwmmxt_wmov PARAMS ((char *)); +static void do_iwmmxt_word_addr PARAMS ((char *)); +static void do_iwmmxt_wrwr PARAMS ((char *)); +static void do_iwmmxt_wrwrwcg PARAMS ((char *)); +static void do_iwmmxt_wrwrwr PARAMS ((char *)); +static void do_iwmmxt_wshufh PARAMS ((char *)); +static void do_iwmmxt_wzero PARAMS ((char *)); +static int cp_byte_address_offset PARAMS ((char **)); +static int cp_byte_address_required_here PARAMS ((char **)); + /* ARM instructions take 4bytes in the object file, Thumb instructions take 2: */ #define INSN_SIZE 4 @@ -948,8 +1113,8 @@ static bfd_reloc_code_real_type arm_parse_reloc PARAMS ((void)); /* "INSN X,Y" where X:bit16, Y:bit12. */ #define MAV_MODE2 0x0c10 -/* "INSN X,Y" where X:0, Y:bit16. */ -#define MAV_MODE3 0x1000 +/* "INSN X,Y" where X:bit12, Y:bit16. */ +#define MAV_MODE3 0x100c /* "INSN X,Y,Z" where X:16, Y:0, Z:12. */ #define MAV_MODE4 0x0c0010 @@ -1069,7 +1234,7 @@ static const struct asm_opcode insns[] = {"mla", 0xe0200090, 3, ARM_EXT_V2, do_mla}, {"mlas", 0xe0300090, 3, ARM_EXT_V2, do_mla}, - /* Generic copressor instructions. */ + /* Generic coprocessor instructions. */ {"cdp", 0xee000000, 3, ARM_EXT_V2, do_cdp}, {"ldc", 0xec100000, 3, ARM_EXT_V2, do_lstc}, {"ldcl", 0xec500000, 3, ARM_EXT_V2, do_lstc}, @@ -1162,6 +1327,107 @@ static const struct asm_opcode insns[] = /* ARM Architecture 5TEJ. */ {"bxj", 0xe12fff20, 3, ARM_EXT_V5J, do_bxj}, + /* ARM V6. */ + { "cps", 0xf1020000, 0, ARM_EXT_V6, do_cps}, + { "cpsie", 0xf1080000, 0, ARM_EXT_V6, do_cpsi}, + { "cpsid", 0xf10C0000, 0, ARM_EXT_V6, do_cpsi}, + { "ldrex", 0xe1900f9f, 5, ARM_EXT_V6, do_ldrex}, + { "mcrr2", 0xfc400000, 0, ARM_EXT_V6, do_co_reg2c}, + { "mrrc2", 0xfc500000, 0, ARM_EXT_V6, do_co_reg2c}, + { "pkhbt", 0xe6800010, 5, ARM_EXT_V6, do_pkhbt}, + { "pkhtb", 0xe6800050, 5, ARM_EXT_V6, do_pkhtb}, + { "qadd16", 0xe6200f10, 6, ARM_EXT_V6, do_qadd16}, + { "qadd8", 0xe6200f90, 5, ARM_EXT_V6, do_qadd16}, + { "qaddsubx", 0xe6200f30, 8, ARM_EXT_V6, do_qadd16}, + { "qsub16", 0xe6200f70, 6, ARM_EXT_V6, do_qadd16}, + { "qsub8", 0xe6200ff0, 5, ARM_EXT_V6, do_qadd16}, + { "qsubaddx", 0xe6200f50, 8, ARM_EXT_V6, do_qadd16}, + { "sadd16", 0xe6100f10, 6, ARM_EXT_V6, do_qadd16}, + { "sadd8", 0xe6100f90, 5, ARM_EXT_V6, do_qadd16}, + { "saddsubx", 0xe6100f30, 8, ARM_EXT_V6, do_qadd16}, + { "shadd16", 0xe6300f10, 7, ARM_EXT_V6, do_qadd16}, + { "shadd8", 0xe6300f90, 6, ARM_EXT_V6, do_qadd16}, + { "shaddsubx", 0xe6300f30, 9, ARM_EXT_V6, do_qadd16}, + { "shsub16", 0xe6300f70, 7, ARM_EXT_V6, do_qadd16}, + { "shsub8", 0xe6300ff0, 6, ARM_EXT_V6, do_qadd16}, + { "shsubaddx", 0xe6300f50, 9, ARM_EXT_V6, do_qadd16}, + { "ssub16", 0xe6100f70, 6, ARM_EXT_V6, do_qadd16}, + { "ssub8", 0xe6100ff0, 5, ARM_EXT_V6, do_qadd16}, + { "ssubaddx", 0xe6100f50, 8, ARM_EXT_V6, do_qadd16}, + { "uadd16", 0xe6500f10, 6, ARM_EXT_V6, do_qadd16}, + { "uadd8", 0xe6500f90, 5, ARM_EXT_V6, do_qadd16}, + { "uaddsubx", 0xe6500f30, 8, ARM_EXT_V6, do_qadd16}, + { "uhadd16", 0xe6700f10, 7, ARM_EXT_V6, do_qadd16}, + { "uhadd8", 0xe6700f90, 6, ARM_EXT_V6, do_qadd16}, + { "uhaddsubx", 0xe6700f30, 9, ARM_EXT_V6, do_qadd16}, + { "uhsub16", 0xe6700f70, 7, ARM_EXT_V6, do_qadd16}, + { "uhsub8", 0xe6700ff0, 6, ARM_EXT_V6, do_qadd16}, + { "uhsubaddx", 0xe6700f50, 9, ARM_EXT_V6, do_qadd16}, + { "uqadd16", 0xe6600f10, 7, ARM_EXT_V6, do_qadd16}, + { "uqadd8", 0xe6600f90, 6, ARM_EXT_V6, do_qadd16}, + { "uqaddsubx", 0xe6600f30, 9, ARM_EXT_V6, do_qadd16}, + { "uqsub16", 0xe6600f70, 7, ARM_EXT_V6, do_qadd16}, + { "uqsub8", 0xe6600ff0, 6, ARM_EXT_V6, do_qadd16}, + { "uqsubaddx", 0xe6600f50, 9, ARM_EXT_V6, do_qadd16}, + { "usub16", 0xe6500f70, 6, ARM_EXT_V6, do_qadd16}, + { "usub8", 0xe6500ff0, 5, ARM_EXT_V6, do_qadd16}, + { "usubaddx", 0xe6500f50, 8, ARM_EXT_V6, do_qadd16}, + { "rev", 0xe6bf0f30, 3, ARM_EXT_V6, do_rev}, + { "rev16", 0xe6bf0fb0, 5, ARM_EXT_V6, do_rev}, + { "revsh", 0xe6ff0fb0, 5, ARM_EXT_V6, do_rev}, + { "rfeia", 0xf8900a00, 0, ARM_EXT_V6, do_rfe}, + { "rfeib", 0xf9900a00, 0, ARM_EXT_V6, do_rfe}, + { "rfeda", 0xf8100a00, 0, ARM_EXT_V6, do_rfe}, + { "rfedb", 0xf9100a00, 0, ARM_EXT_V6, do_rfe}, + { "rfefd", 0xf8900a00, 0, ARM_EXT_V6, do_rfe}, + { "rfefa", 0xf9900a00, 0, ARM_EXT_V6, do_rfe}, + { "rfeea", 0xf8100a00, 0, ARM_EXT_V6, do_rfe}, + { "rfeed", 0xf9100a00, 0, ARM_EXT_V6, do_rfe}, + { "sxtah", 0xe6b00070, 5, ARM_EXT_V6, do_sxtah}, + { "sxtab16", 0xe6800070, 7, ARM_EXT_V6, do_sxtah}, + { "sxtab", 0xe6a00070, 5, ARM_EXT_V6, do_sxtah}, + { "sxth", 0xe6bf0070, 4, ARM_EXT_V6, do_sxth}, + { "sxtb16", 0xe68f0070, 6, ARM_EXT_V6, do_sxth}, + { "sxtb", 0xe6af0070, 4, ARM_EXT_V6, do_sxth}, + { "uxtah", 0xe6f00070, 5, ARM_EXT_V6, do_sxtah}, + { "uxtab16", 0xe6c00070, 7, ARM_EXT_V6, do_sxtah}, + { "uxtab", 0xe6e00070, 5, ARM_EXT_V6, do_sxtah}, + { "uxth", 0xe6ff0070, 4, ARM_EXT_V6, do_sxth}, + { "uxtb16", 0xe6cf0070, 6, ARM_EXT_V6, do_sxth}, + { "uxtb", 0xe6ef0070, 4, ARM_EXT_V6, do_sxth}, + { "sel", 0xe68000b0, 3, ARM_EXT_V6, do_qadd16}, + { "setend", 0xf1010000, 0, ARM_EXT_V6, do_setend}, + { "smlad", 0xe7000010, 5, ARM_EXT_V6, do_smlad}, + { "smladx", 0xe7000030, 6, ARM_EXT_V6, do_smlad}, + { "smlald", 0xe7400010, 6, ARM_EXT_V6, do_smlald}, + { "smlaldx", 0xe7400030, 7, ARM_EXT_V6, do_smlald}, + { "smlsd", 0xe7000050, 5, ARM_EXT_V6, do_smlad}, + { "smlsdx", 0xe7000070, 6, ARM_EXT_V6, do_smlad}, + { "smlsld", 0xe7400050, 6, ARM_EXT_V6, do_smlald}, + { "smlsldx", 0xe7400070, 7, ARM_EXT_V6, do_smlald}, + { "smmla", 0xe7500010, 5, ARM_EXT_V6, do_smlad}, + { "smmlar", 0xe7500030, 6, ARM_EXT_V6, do_smlad}, + { "smmls", 0xe75000d0, 5, ARM_EXT_V6, do_smlad}, + { "smmlsr", 0xe75000f0, 6, ARM_EXT_V6, do_smlad}, + { "smmul", 0xe750f010, 5, ARM_EXT_V6, do_smmul}, + { "smmulr", 0xe750f030, 6, ARM_EXT_V6, do_smmul}, + { "smuad", 0xe700f010, 5, ARM_EXT_V6, do_smmul}, + { "smuadx", 0xe700f030, 6, ARM_EXT_V6, do_smmul}, + { "smusd", 0xe700f050, 5, ARM_EXT_V6, do_smmul}, + { "smusdx", 0xe700f070, 6, ARM_EXT_V6, do_smmul}, + { "srsia", 0xf8cd0500, 0, ARM_EXT_V6, do_srs}, + { "srsib", 0xf9cd0500, 0, ARM_EXT_V6, do_srs}, + { "srsda", 0xf84d0500, 0, ARM_EXT_V6, do_srs}, + { "srsdb", 0xf94d0500, 0, ARM_EXT_V6, do_srs}, + { "ssat", 0xe6a00010, 4, ARM_EXT_V6, do_ssat}, + { "ssat16", 0xe6a00f30, 6, ARM_EXT_V6, do_ssat16}, + { "strex", 0xe1800f90, 5, ARM_EXT_V6, do_strex}, + { "umaal", 0xe0400090, 5, ARM_EXT_V6, do_umaal}, + { "usad8", 0xe780f010, 5, ARM_EXT_V6, do_smmul}, + { "usada8", 0xe7800010, 6, ARM_EXT_V6, do_smlad}, + { "usat", 0xe6e00010, 4, ARM_EXT_V6, do_usat}, + { "usat16", 0xe6e00f30, 6, ARM_EXT_V6, do_usat16}, + /* Core FPA instruction set (V1). */ {"wfs", 0xee200110, 3, FPU_FPA_EXT_V1, do_fpa_ctrl}, {"rfs", 0xee300110, 3, FPU_FPA_EXT_V1, do_fpa_ctrl}, @@ -1713,8 +1979,8 @@ static const struct asm_opcode insns[] = {"fcmpezd", 0xeeb50bc0, 7, FPU_VFP_EXT_V1, do_vfp_dp_compare_z}, /* VFP V2. */ - {"fmsrr", 0xec400a10, 5, FPU_VFP_EXT_V2, do_vfp_sp_reg2}, - {"fmrrs", 0xec500a10, 5, FPU_VFP_EXT_V2, do_vfp_sp_reg2}, + {"fmsrr", 0xec400a10, 5, FPU_VFP_EXT_V2, do_vfp_sp2_from_reg2}, + {"fmrrs", 0xec500a10, 5, FPU_VFP_EXT_V2, do_vfp_reg2_from_sp2}, {"fmdrr", 0xec400b10, 5, FPU_VFP_EXT_V2, do_vfp_dp_from_reg2}, {"fmrrd", 0xec500b10, 5, FPU_VFP_EXT_V2, do_vfp_reg2_from_dp}, @@ -1728,6 +1994,170 @@ static const struct asm_opcode insns[] = {"mar", 0xec400000, 3, ARM_CEXT_XSCALE, do_xsc_mar}, {"mra", 0xec500000, 3, ARM_CEXT_XSCALE, do_xsc_mra}, + /* Intel Wireless MMX technology instructions. */ + {"tandcb", 0xee130130, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tandc}, + {"tandch", 0xee530130, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tandc}, + {"tandcw", 0xee930130, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tandc}, + {"tbcstb", 0xee400010, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tbcst}, + {"tbcsth", 0xee400050, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tbcst}, + {"tbcstw", 0xee400090, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tbcst}, + {"textrcb", 0xee130170, 7, ARM_CEXT_IWMMXT, do_iwmmxt_textrc}, + {"textrch", 0xee530170, 7, ARM_CEXT_IWMMXT, do_iwmmxt_textrc}, + {"textrcw", 0xee930170, 7, ARM_CEXT_IWMMXT, do_iwmmxt_textrc}, + {"textrmub", 0xee100070, 8, ARM_CEXT_IWMMXT, do_iwmmxt_textrm}, + {"textrmuh", 0xee500070, 8, ARM_CEXT_IWMMXT, do_iwmmxt_textrm}, + {"textrmuw", 0xee900070, 8, ARM_CEXT_IWMMXT, do_iwmmxt_textrm}, + {"textrmsb", 0xee100078, 8, ARM_CEXT_IWMMXT, do_iwmmxt_textrm}, + {"textrmsh", 0xee500078, 8, ARM_CEXT_IWMMXT, do_iwmmxt_textrm}, + {"textrmsw", 0xee900078, 8, ARM_CEXT_IWMMXT, do_iwmmxt_textrm}, + {"tinsrb", 0xee600010, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tinsr}, + {"tinsrh", 0xee600050, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tinsr}, + {"tinsrw", 0xee600090, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tinsr}, + {"tmcr", 0xee000110, 4, ARM_CEXT_IWMMXT, do_iwmmxt_tmcr}, + {"tmcrr", 0xec400000, 5, ARM_CEXT_IWMMXT, do_iwmmxt_tmcrr}, + {"tmia", 0xee200010, 4, ARM_CEXT_IWMMXT, do_iwmmxt_tmia}, + {"tmiaph", 0xee280010, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tmia}, + {"tmiabb", 0xee2c0010, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tmia}, + {"tmiabt", 0xee2d0010, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tmia}, + {"tmiatb", 0xee2e0010, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tmia}, + {"tmiatt", 0xee2f0010, 6, ARM_CEXT_IWMMXT, do_iwmmxt_tmia}, + {"tmovmskb", 0xee100030, 8, ARM_CEXT_IWMMXT, do_iwmmxt_tmovmsk}, + {"tmovmskh", 0xee500030, 8, ARM_CEXT_IWMMXT, do_iwmmxt_tmovmsk}, + {"tmovmskw", 0xee900030, 8, ARM_CEXT_IWMMXT, do_iwmmxt_tmovmsk}, + {"tmrc", 0xee100110, 4, ARM_CEXT_IWMMXT, do_iwmmxt_tmrc}, + {"tmrrc", 0xec500000, 5, ARM_CEXT_IWMMXT, do_iwmmxt_tmrrc}, + {"torcb", 0xee130150, 5, ARM_CEXT_IWMMXT, do_iwmmxt_torc}, + {"torch", 0xee530150, 5, ARM_CEXT_IWMMXT, do_iwmmxt_torc}, + {"torcw", 0xee930150, 5, ARM_CEXT_IWMMXT, do_iwmmxt_torc}, + {"waccb", 0xee0001c0, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, + {"wacch", 0xee4001c0, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, + {"waccw", 0xee8001c0, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, + {"waddbss", 0xee300180, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"waddb", 0xee000180, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"waddbus", 0xee100180, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"waddhss", 0xee700180, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"waddh", 0xee400180, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"waddhus", 0xee500180, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"waddwss", 0xeeb00180, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"waddw", 0xee800180, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"waddwus", 0xee900180, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"waligni", 0xee000020, 7, ARM_CEXT_IWMMXT, do_iwmmxt_waligni}, + {"walignr0", 0xee800020, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"walignr1", 0xee900020, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"walignr2", 0xeea00020, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"walignr3", 0xeeb00020, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wand", 0xee200000, 4, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wandn", 0xee300000, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wavg2b", 0xee800000, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wavg2br", 0xee900000, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wavg2h", 0xeec00000, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wavg2hr", 0xeed00000, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wcmpeqb", 0xee000060, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wcmpeqh", 0xee400060, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wcmpeqw", 0xee800060, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wcmpgtub", 0xee100060, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wcmpgtuh", 0xee500060, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wcmpgtuw", 0xee900060, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wcmpgtsb", 0xee300060, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wcmpgtsh", 0xee700060, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wcmpgtsw", 0xeeb00060, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wldrb", 0xec100000, 5, ARM_CEXT_IWMMXT, do_iwmmxt_byte_addr}, + {"wldrh", 0xec100100, 5, ARM_CEXT_IWMMXT, do_iwmmxt_byte_addr}, + {"wldrw", 0xec100200, 5, ARM_CEXT_IWMMXT, do_iwmmxt_word_addr}, + {"wldrd", 0xec100300, 5, ARM_CEXT_IWMMXT, do_iwmmxt_word_addr}, + {"wmacs", 0xee600100, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wmacsz", 0xee700100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wmacu", 0xee400100, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wmacuz", 0xee500100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wmadds", 0xeea00100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wmaddu", 0xee800100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wmaxsb", 0xee200160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wmaxsh", 0xee600160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wmaxsw", 0xeea00160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wmaxub", 0xee000160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wmaxuh", 0xee400160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wmaxuw", 0xee800160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wminsb", 0xee300160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wminsh", 0xee700160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wminsw", 0xeeb00160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wminub", 0xee100160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wminuh", 0xee500160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wminuw", 0xee900160, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wmov", 0xee000000, 4, ARM_CEXT_IWMMXT, do_iwmmxt_wmov}, + {"wmulsm", 0xee300100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wmulsl", 0xee200100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wmulum", 0xee100100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wmulul", 0xee000100, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wor", 0xee000000, 3, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wpackhss", 0xee700080, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wpackhus", 0xee500080, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wpackwss", 0xeeb00080, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wpackwus", 0xee900080, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wpackdss", 0xeef00080, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wpackdus", 0xeed00080, 8, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wrorh", 0xee700040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wrorhg", 0xee700148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, + {"wrorw", 0xeeb00040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wrorwg", 0xeeb00148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, + {"wrord", 0xeef00040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wrordg", 0xeef00148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, + {"wsadb", 0xee000120, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsadbz", 0xee100120, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsadh", 0xee400120, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsadhz", 0xee500120, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wshufh", 0xee0001e0, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wshufh}, + {"wsllh", 0xee500040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsllhg", 0xee500148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, + {"wsllw", 0xee900040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsllwg", 0xee900148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, + {"wslld", 0xeed00040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wslldg", 0xeed00148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, + {"wsrah", 0xee400040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsrahg", 0xee400148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, + {"wsraw", 0xee800040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsrawg", 0xee800148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, + {"wsrad", 0xeec00040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsradg", 0xeec00148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, + {"wsrlh", 0xee600040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsrlhg", 0xee600148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, + {"wsrlw", 0xeea00040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsrlwg", 0xeea00148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, + {"wsrld", 0xeee00040, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsrldg", 0xeee00148, 6, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwcg}, + {"wstrb", 0xec000000, 5, ARM_CEXT_IWMMXT, do_iwmmxt_byte_addr}, + {"wstrh", 0xec000100, 5, ARM_CEXT_IWMMXT, do_iwmmxt_byte_addr}, + {"wstrw", 0xec000200, 5, ARM_CEXT_IWMMXT, do_iwmmxt_word_addr}, + {"wstrd", 0xec000300, 5, ARM_CEXT_IWMMXT, do_iwmmxt_word_addr}, + {"wsubbss", 0xee3001a0, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsubb", 0xee0001a0, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsubbus", 0xee1001a0, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsubhss", 0xee7001a0, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsubh", 0xee4001a0, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsubhus", 0xee5001a0, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsubwss", 0xeeb001a0, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsubw", 0xee8001a0, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wsubwus", 0xee9001a0, 7, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wunpckehub", 0xee0000c0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, + {"wunpckehuh", 0xee4000c0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, + {"wunpckehuw", 0xee8000c0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, + {"wunpckehsb", 0xee2000c0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, + {"wunpckehsh", 0xee6000c0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, + {"wunpckehsw", 0xeea000c0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, + {"wunpckihb", 0xee1000c0, 9, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wunpckihh", 0xee5000c0, 9, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wunpckihw", 0xee9000c0, 9, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wunpckelub", 0xee0000e0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, + {"wunpckeluh", 0xee4000e0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, + {"wunpckeluw", 0xee8000e0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, + {"wunpckelsb", 0xee2000e0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, + {"wunpckelsh", 0xee6000e0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, + {"wunpckelsw", 0xeea000e0, 10, ARM_CEXT_IWMMXT, do_iwmmxt_wrwr}, + {"wunpckilb", 0xee1000e0, 9, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wunpckilh", 0xee5000e0, 9, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wunpckilw", 0xee9000e0, 9, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wxor", 0xee100000, 4, ARM_CEXT_IWMMXT, do_iwmmxt_wrwrwr}, + {"wzero", 0xee300000, 5, ARM_CEXT_IWMMXT, do_iwmmxt_wzero}, + /* Cirrus Maverick instructions. */ {"cfldrs", 0xec100400, 6, ARM_CEXT_MAVERICK, do_mav_ldst_1}, {"cfldrd", 0xec500400, 6, ARM_CEXT_MAVERICK, do_mav_ldst_2}, @@ -1747,18 +2177,18 @@ static const struct asm_opcode insns[] = {"cfmvr64l", 0xee100510, 8, ARM_CEXT_MAVERICK, do_mav_binops_1c}, {"cfmv64hr", 0xee000530, 8, ARM_CEXT_MAVERICK, do_mav_binops_2c}, {"cfmvr64h", 0xee100530, 8, ARM_CEXT_MAVERICK, do_mav_binops_1c}, - {"cfmval32", 0xee100610, 8, ARM_CEXT_MAVERICK, do_mav_binops_3a}, - {"cfmv32al", 0xee000610, 8, ARM_CEXT_MAVERICK, do_mav_binops_3b}, - {"cfmvam32", 0xee100630, 8, ARM_CEXT_MAVERICK, do_mav_binops_3a}, - {"cfmv32am", 0xee000630, 8, ARM_CEXT_MAVERICK, do_mav_binops_3b}, - {"cfmvah32", 0xee100650, 8, ARM_CEXT_MAVERICK, do_mav_binops_3a}, - {"cfmv32ah", 0xee000650, 8, ARM_CEXT_MAVERICK, do_mav_binops_3b}, - {"cfmva32", 0xee100670, 7, ARM_CEXT_MAVERICK, do_mav_binops_3a}, - {"cfmv32a", 0xee000670, 7, ARM_CEXT_MAVERICK, do_mav_binops_3b}, - {"cfmva64", 0xee100690, 7, ARM_CEXT_MAVERICK, do_mav_binops_3c}, - {"cfmv64a", 0xee000690, 7, ARM_CEXT_MAVERICK, do_mav_binops_3d}, - {"cfmvsc32", 0xee1006b0, 8, ARM_CEXT_MAVERICK, do_mav_dspsc_1}, - {"cfmv32sc", 0xee0006b0, 8, ARM_CEXT_MAVERICK, do_mav_dspsc_2}, + {"cfmval32", 0xee200440, 8, ARM_CEXT_MAVERICK, do_mav_binops_3a}, + {"cfmv32al", 0xee100440, 8, ARM_CEXT_MAVERICK, do_mav_binops_3b}, + {"cfmvam32", 0xee200460, 8, ARM_CEXT_MAVERICK, do_mav_binops_3a}, + {"cfmv32am", 0xee100460, 8, ARM_CEXT_MAVERICK, do_mav_binops_3b}, + {"cfmvah32", 0xee200480, 8, ARM_CEXT_MAVERICK, do_mav_binops_3a}, + {"cfmv32ah", 0xee100480, 8, ARM_CEXT_MAVERICK, do_mav_binops_3b}, + {"cfmva32", 0xee2004a0, 7, ARM_CEXT_MAVERICK, do_mav_binops_3a}, + {"cfmv32a", 0xee1004a0, 7, ARM_CEXT_MAVERICK, do_mav_binops_3b}, + {"cfmva64", 0xee2004c0, 7, ARM_CEXT_MAVERICK, do_mav_binops_3c}, + {"cfmv64a", 0xee1004c0, 7, ARM_CEXT_MAVERICK, do_mav_binops_3d}, + {"cfmvsc32", 0xee2004e0, 8, ARM_CEXT_MAVERICK, do_mav_dspsc_1}, + {"cfmv32sc", 0xee1004e0, 8, ARM_CEXT_MAVERICK, do_mav_dspsc_2}, {"cfcpys", 0xee000400, 6, ARM_CEXT_MAVERICK, do_mav_binops_1d}, {"cfcpyd", 0xee000420, 6, ARM_CEXT_MAVERICK, do_mav_binops_1e}, {"cfcvtsd", 0xee000460, 7, ARM_CEXT_MAVERICK, do_mav_binops_1f}, @@ -1871,6 +2301,11 @@ static void do_t_adr PARAMS ((char *)); static void do_t_blx PARAMS ((char *)); static void do_t_bkpt PARAMS ((char *)); +/* ARM V6. */ +static void do_t_cps PARAMS ((char *)); +static void do_t_cpy PARAMS ((char *)); +static void do_t_setend PARAMS ((char *));; + #define T_OPCODE_MUL 0x4340 #define T_OPCODE_TST 0x4200 #define T_OPCODE_CMN 0x42c0 @@ -1939,6 +2374,7 @@ static int thumb_reg PARAMS ((char ** str, int hi_lo)); #define THUMB_MOVE 0 #define THUMB_COMPARE 1 +#define THUMB_CPY 2 #define THUMB_LOAD 0 #define THUMB_STORE 1 @@ -2031,6 +2467,19 @@ static const struct thumb_opcode tinsns[] = /* Thumb v2 (ARMv5T). */ {"blx", 0, 0, ARM_EXT_V5T, do_t_blx}, {"bkpt", 0xbe00, 2, ARM_EXT_V5T, do_t_bkpt}, + + /* ARM V6. */ + {"cpsie", 0xb660, 2, ARM_EXT_V6, do_t_cps}, + {"cpsid", 0xb670, 2, ARM_EXT_V6, do_t_cps}, + {"cpy", 0x4600, 2, ARM_EXT_V6, do_t_cpy}, + {"rev", 0xba00, 2, ARM_EXT_V6, do_t_arit}, + {"rev16", 0xba40, 2, ARM_EXT_V6, do_t_arit}, + {"revsh", 0xbac0, 2, ARM_EXT_V6, do_t_arit}, + {"setend", 0xb650, 2, ARM_EXT_V6, do_t_setend}, + {"sxth", 0xb200, 2, ARM_EXT_V6, do_t_arit}, + {"sxtb", 0xb240, 2, ARM_EXT_V6, do_t_arit}, + {"uxth", 0xb280, 2, ARM_EXT_V6, do_t_arit}, + {"uxtb", 0xb2c0, 2, ARM_EXT_V6, do_t_arit}, }; #define BAD_ARGS _("bad arguments to instruction") @@ -2051,6 +2500,7 @@ static struct hash_control * arm_psr_hsh = NULL; Integer arg to pass to the function. */ static void s_req PARAMS ((int)); +static void s_unreq PARAMS ((int)); static void s_align PARAMS ((int)); static void s_bss PARAMS ((int)); static void s_even PARAMS ((int)); @@ -2061,9 +2511,6 @@ static void s_code PARAMS ((int)); static void s_force_thumb PARAMS ((int)); static void s_thumb_func PARAMS ((int)); static void s_thumb_set PARAMS ((int)); -static void arm_s_text PARAMS ((int)); -static void arm_s_data PARAMS ((int)); -static void arm_s_section PARAMS ((int)); #ifdef OBJ_ELF static void s_arm_elf_cons PARAMS ((int)); #endif @@ -2072,8 +2519,9 @@ static int my_get_expression PARAMS ((expressionS *, char **)); const pseudo_typeS md_pseudo_table[] = { - /* Never called becasue '.req' does not start line. */ + /* Never called because '.req' does not start a line. */ { "req", s_req, 0 }, + { "unreq", s_unreq, 0 }, { "bss", s_bss, 0 }, { "align", s_align, 0 }, { "arm", s_arm, 0 }, @@ -2085,18 +2533,9 @@ const pseudo_typeS md_pseudo_table[] = { "even", s_even, 0 }, { "ltorg", s_ltorg, 0 }, { "pool", s_ltorg, 0 }, - /* Allow for the effect of section changes. */ - { "text", arm_s_text, 0 }, - { "data", arm_s_data, 0 }, - { "section", arm_s_section, 0 }, - { "section.s", arm_s_section, 0 }, - { "sect", arm_s_section, 0 }, - { "sect.s", arm_s_section, 0 }, #ifdef OBJ_ELF { "word", s_arm_elf_cons, 4 }, { "long", s_arm_elf_cons, 4 }, - { "file", dwarf2_directive_file, 0 }, - { "loc", dwarf2_directive_loc, 0 }, #else { "word", cons, 4}, #endif @@ -2111,6 +2550,12 @@ static int arm_parse_extension PARAMS ((char *, int *)); static int arm_parse_cpu PARAMS ((char *)); static int arm_parse_arch PARAMS ((char *)); static int arm_parse_fpu PARAMS ((char *)); +static int arm_parse_float_abi PARAMS ((char *)); +#if 0 /* Suppressed - for now. */ +#if defined OBJ_COFF || defined OBJ_ELF +static void arm_add_note PARAMS ((const char *, const char *, unsigned int)); +#endif +#endif /* Stuff needed to resolve the label ambiguity As: @@ -2123,75 +2568,132 @@ static int arm_parse_fpu PARAMS ((char *)); */ symbolS * last_label_seen; -static int label_is_thumb_function_name = false; +static int label_is_thumb_function_name = FALSE; -/* Literal stuff. */ +/* Literal Pool stuff. */ #define MAX_LITERAL_POOL_SIZE 1024 -typedef struct literalS +/* Literal pool structure. Held on a per-section + and per-sub-section basis. */ +typedef struct literal_pool +{ + expressionS literals [MAX_LITERAL_POOL_SIZE]; + unsigned int next_free_entry; + unsigned int id; + symbolS * symbol; + segT section; + subsegT sub_section; + struct literal_pool * next; +} literal_pool; + +/* Pointer to a linked list of literal pools. */ +literal_pool * list_of_pools = NULL; + +static literal_pool * find_literal_pool PARAMS ((void)); +static literal_pool * find_or_make_literal_pool PARAMS ((void)); + +static literal_pool * +find_literal_pool () { - struct expressionS exp; - struct arm_it * inst; -} literalT; + literal_pool * pool; -literalT literals[MAX_LITERAL_POOL_SIZE]; + for (pool = list_of_pools; pool != NULL; pool = pool->next) + { + if (pool->section == now_seg + && pool->sub_section == now_subseg) + break; + } + + return pool; +} + +static literal_pool * +find_or_make_literal_pool () +{ + /* Next literal pool ID number. */ + static unsigned int latest_pool_num = 1; + literal_pool * pool; + + pool = find_literal_pool (); -/* Next free entry in the pool. */ -int next_literal_pool_place = 0; + if (pool == NULL) + { + /* Create a new pool. */ + pool = (literal_pool *) xmalloc (sizeof (* pool)); + if (! pool) + return NULL; + + pool->next_free_entry = 0; + pool->section = now_seg; + pool->sub_section = now_subseg; + pool->next = list_of_pools; + pool->symbol = NULL; + + /* Add it to the list. */ + list_of_pools = pool; + } -/* Next literal pool number. */ -int lit_pool_num = 1; + /* New pools, and emptied pools, will have a NULL symbol. */ + if (pool->symbol == NULL) + { + pool->symbol = symbol_create (FAKE_LABEL_NAME, undefined_section, + (valueT) 0, &zero_address_frag); + pool->id = latest_pool_num ++; + } -symbolS * current_poolP = NULL; + /* Done. */ + return pool; +} +/* Add the literal in the global 'inst' + structure to the relevent literal pool. */ static int add_to_lit_pool () { - int lit_count = 0; + literal_pool * pool; + unsigned int entry; - if (current_poolP == NULL) - current_poolP = symbol_create (FAKE_LABEL_NAME, undefined_section, - (valueT) 0, &zero_address_frag); + pool = find_or_make_literal_pool (); - /* Check if this literal value is already in the pool: */ - while (lit_count < next_literal_pool_place) + /* Check if this literal value is already in the pool. */ + for (entry = 0; entry < pool->next_free_entry; entry ++) { - if (literals[lit_count].exp.X_op == inst.reloc.exp.X_op - && inst.reloc.exp.X_op == O_constant - && (literals[lit_count].exp.X_add_number + if ((pool->literals[entry].X_op == inst.reloc.exp.X_op) + && (inst.reloc.exp.X_op == O_constant) + && (pool->literals[entry].X_add_number == inst.reloc.exp.X_add_number) - && literals[lit_count].exp.X_unsigned == inst.reloc.exp.X_unsigned) + && (pool->literals[entry].X_unsigned + == inst.reloc.exp.X_unsigned)) break; - if (literals[lit_count].exp.X_op == inst.reloc.exp.X_op - && inst.reloc.exp.X_op == O_symbol - && (literals[lit_count].exp.X_add_number + if ((pool->literals[entry].X_op == inst.reloc.exp.X_op) + && (inst.reloc.exp.X_op == O_symbol) + && (pool->literals[entry].X_add_number == inst.reloc.exp.X_add_number) - && (literals[lit_count].exp.X_add_symbol + && (pool->literals[entry].X_add_symbol == inst.reloc.exp.X_add_symbol) - && (literals[lit_count].exp.X_op_symbol + && (pool->literals[entry].X_op_symbol == inst.reloc.exp.X_op_symbol)) - break; - - lit_count++; + break; } - if (lit_count == next_literal_pool_place) /* New entry. */ + /* Do we need to create a new entry? */ + if (entry == pool->next_free_entry) { - if (next_literal_pool_place >= MAX_LITERAL_POOL_SIZE) + if (entry >= MAX_LITERAL_POOL_SIZE) { inst.error = _("literal pool overflow"); return FAIL; } - literals[next_literal_pool_place].exp = inst.reloc.exp; - lit_count = next_literal_pool_place++; + pool->literals[entry] = inst.reloc.exp; + pool->next_free_entry += 1; } - inst.reloc.exp.X_op = O_symbol; - inst.reloc.exp.X_add_number = (lit_count) * 4 - 8; - inst.reloc.exp.X_add_symbol = current_poolP; + inst.reloc.exp.X_op = O_symbol; + inst.reloc.exp.X_add_number = ((int) entry) * 4 - 8; + inst.reloc.exp.X_add_symbol = pool->symbol; return SUCCESS; } @@ -2270,7 +2772,7 @@ validate_immediate (val) return FAIL; } -/* Check to see if an immediate can be computed as two seperate immediate +/* Check to see if an immediate can be computed as two separate immediate values, added together. We already know that this value cannot be computed by just one ARM instruction. */ @@ -2319,6 +2821,167 @@ validate_offset_imm (val, hwse) return val; } + +#ifdef OBJ_ELF +/* This code is to handle mapping symbols as defined in the ARM ELF spec. + (This text is taken from version B-02 of the spec): + + 4.4.7 Mapping and tagging symbols + + A section of an ARM ELF file can contain a mixture of ARM code, + Thumb code, and data. There are inline transitions between code + and data at literal pool boundaries. There can also be inline + transitions between ARM code and Thumb code, for example in + ARM-Thumb inter-working veneers. Linkers, machine-level + debuggers, profiling tools, and disassembly tools need to map + images accurately. For example, setting an ARM breakpoint on a + Thumb location, or in a literal pool, can crash the program + being debugged, ruining the debugging session. + + ARM ELF entities are mapped (see section 4.4.7.1 below) and + tagged (see section 4.4.7.2 below) using local symbols (with + binding STB_LOCAL). To assist consumers, mapping and tagging + symbols should be collated first in the symbol table, before + other symbols with binding STB_LOCAL. + + To allow properly collated mapping and tagging symbols to be + skipped by consumers that have no interest in them, the first + such symbol should have the name $m and its st_value field equal + to the total number of mapping and tagging symbols (including + the $m) in the symbol table. + + 4.4.7.1 Mapping symbols + + $a Labels the first byte of a sequence of ARM instructions. + Its type is STT_FUNC. + + $d Labels the first byte of a sequence of data items. + Its type is STT_OBJECT. + + $t Labels the first byte of a sequence of Thumb instructions. + Its type is STT_FUNC. + + This list of mapping symbols may be extended in the future. + + Section-relative mapping symbols + + Mapping symbols defined in a section define a sequence of + half-open address intervals that cover the address range of the + section. Each interval starts at the address defined by a + mapping symbol, and continues up to, but not including, the + address defined by the next (in address order) mapping symbol or + the end of the section. A corollary is that there must be a + mapping symbol defined at the beginning of each section. + Consumers can ignore the size of a section-relative mapping + symbol. Producers can set it to 0. + + Absolute mapping symbols + + Because of the need to crystallize a Thumb address with the + Thumb-bit set, absolute symbol of type STT_FUNC (symbols of type + STT_FUNC defined in section SHN_ABS) need to be mapped with $a + or $t. + + The extent of a mapping symbol defined in SHN_ABS is [st_value, + st_value + st_size), or [st_value, st_value + 1) if st_size = 0, + where [x, y) denotes the half-open address range from x, + inclusive, to y, exclusive. + + In the absence of a mapping symbol, a consumer can interpret a + function symbol with an odd value as the Thumb code address + obtained by clearing the least significant bit of the + value. This interpretation is deprecated, and it may not work in + the future. + + Note - the Tagging symbols ($b, $f, $p $m) have been dropped from + the EABI (which is still under development), so they are not + implemented here. */ + +static enum mstate mapstate = MAP_UNDEFINED; + +static void +mapping_state (enum mstate state) +{ + symbolS * symbolP; + const char * symname; + int type; + + if (mapstate == state) + /* The mapping symbol has already been emitted. + There is nothing else to do. */ + return; + + mapstate = state; + + switch (state) + { + case MAP_DATA: + symname = "$d"; + type = BSF_OBJECT; + break; + case MAP_ARM: + symname = "$a"; + type = BSF_FUNCTION; + break; + case MAP_THUMB: + symname = "$t"; + type = BSF_FUNCTION; + break; + case MAP_UNDEFINED: + return; + default: + abort (); + } + + seg_info (now_seg)->tc_segment_info_data = state; + + symbolP = symbol_new (symname, now_seg, (valueT) frag_now_fix (), frag_now); + symbol_table_insert (symbolP); + symbol_get_bfdsym (symbolP)->flags |= type | BSF_LOCAL; + + switch (state) + { + case MAP_ARM: + THUMB_SET_FUNC (symbolP, 0); + ARM_SET_THUMB (symbolP, 0); + ARM_SET_INTERWORK (symbolP, support_interwork); + break; + + case MAP_THUMB: + THUMB_SET_FUNC (symbolP, 1); + ARM_SET_THUMB (symbolP, 1); + ARM_SET_INTERWORK (symbolP, support_interwork); + break; + + case MAP_DATA: + default: + return; + } +} + +/* When we change sections we need to issue a new mapping symbol. */ + +void +arm_elf_change_section (void) +{ + flagword flags; + + if (!SEG_NORMAL (now_seg)) + return; + + flags = bfd_get_section_flags (stdoutput, now_seg); + + /* We can ignore sections that only contain debug info. */ + if ((flags & SEC_ALLOC) == 0) + return; + + mapstate = seg_info (now_seg)->tc_segment_info_data; +} +#else +#define mapping_state(a) +#endif /* OBJ_ELF */ + + static void s_req (a) int a ATTRIBUTE_UNUSED; @@ -2326,6 +2989,77 @@ s_req (a) as_bad (_("invalid syntax for .req directive")); } +/* The .unreq directive deletes an alias which was previously defined + by .req. For example: + + my_alias .req r11 + .unreq my_alias */ + +static void +s_unreq (int a ATTRIBUTE_UNUSED) +{ + char *name; + char saved_char; + + skip_whitespace (input_line_pointer); + name = input_line_pointer; + + while (*input_line_pointer != 0 + && *input_line_pointer != ' ' + && *input_line_pointer != '\n') + ++input_line_pointer; + + saved_char = *input_line_pointer; + *input_line_pointer = 0; + + if (*name) + { + enum arm_reg_type req_type = arm_reg_parse_any (name); + + if (req_type != REG_TYPE_MAX) + { + char *temp_name = name; + int req_no = arm_reg_parse (&temp_name, all_reg_maps[req_type].htab); + + if (req_no != FAIL) + { + struct reg_entry *req_entry; + + /* Check to see if this alias is a builtin one. */ + req_entry = hash_delete (all_reg_maps[req_type].htab, name); + + if (!req_entry) + as_bad (_("unreq: missing hash entry for \"%s\""), name); + else if (req_entry->builtin) + /* FIXME: We are deleting a built in register alias which + points to a const data structure, so we only need to + free up the memory used by the key in the hash table. + Unfortunately we have not recorded this value, so this + is a memory leak. */ + /* FIXME: Should we issue a warning message ? */ + ; + else + { + /* Deleting a user defined alias. We need to free the + key and the value, but fortunately the key is the same + as the value->name field. */ + free ((char *) req_entry->name); + free (req_entry); + } + } + else + as_bad (_(".unreq: unrecognized symbol \"%s\""), name); + } + else + as_bad (_(".unreq: unrecognized symbol \"%s\""), name); + } + else + as_bad (_("invalid syntax for .unreq directive")); + + *input_line_pointer = saved_char; + demand_empty_rest_of_line (); +} + static void s_bss (ignore) int ignore ATTRIBUTE_UNUSED; @@ -2334,6 +3068,7 @@ s_bss (ignore) marking in_bss, then looking at s_skip for clues. */ subseg_set (bss_section, 0); demand_empty_rest_of_line (); + mapping_state (MAP_DATA); } static void @@ -2353,12 +3088,18 @@ static void s_ltorg (ignored) int ignored ATTRIBUTE_UNUSED; { - int lit_count = 0; + unsigned int entry; + literal_pool * pool; char sym_name[20]; - if (current_poolP == NULL) + pool = find_literal_pool (); + if (pool == NULL + || pool->symbol == NULL + || pool->next_free_entry == 0) return; + mapping_state (MAP_DATA); + /* Align pool as you have word accesses. Only make a frag if we have to. */ if (!need_pass_2) @@ -2366,24 +3107,25 @@ s_ltorg (ignored) record_alignment (now_seg, 2); - sprintf (sym_name, "$$lit_\002%x", lit_pool_num++); + sprintf (sym_name, "$$lit_\002%x", pool->id); - symbol_locate (current_poolP, sym_name, now_seg, + symbol_locate (pool->symbol, sym_name, now_seg, (valueT) frag_now_fix (), frag_now); - symbol_table_insert (current_poolP); + symbol_table_insert (pool->symbol); - ARM_SET_THUMB (current_poolP, thumb_mode); + ARM_SET_THUMB (pool->symbol, thumb_mode); #if defined OBJ_COFF || defined OBJ_ELF - ARM_SET_INTERWORK (current_poolP, support_interwork); + ARM_SET_INTERWORK (pool->symbol, support_interwork); #endif - while (lit_count < next_literal_pool_place) + for (entry = 0; entry < pool->next_free_entry; entry ++) /* First output the expression in the instruction to the pool. */ - emit_expr (&(literals[lit_count++].exp), 4); /* .word */ + emit_expr (&(pool->literals[entry]), 4); /* .word */ - next_literal_pool_place = 0; - current_poolP = NULL; + /* Mark the pool as empty. */ + pool->next_free_entry = 0; + pool->symbol = NULL; } /* Same as s_align_ptwo but align 0 => align 2. */ @@ -2452,7 +3194,7 @@ s_thumb_func (ignore) /* The following label is the name/address of the start of a Thumb function. We need to know this for the interworking support. */ - label_is_thumb_function_name = true; + label_is_thumb_function_name = TRUE; demand_empty_rest_of_line (); } @@ -2550,55 +3292,6 @@ s_thumb_set (equiv) #endif } -/* If we change section we must dump the literal pool first. */ - -static void -arm_s_text (ignore) - int ignore; -{ - if (now_seg != text_section) - s_ltorg (0); - -#ifdef OBJ_ELF - obj_elf_text (ignore); -#else - s_text (ignore); -#endif -} - -static void -arm_s_data (ignore) - int ignore; -{ - if (flag_readonly_data_in_text) - { - if (now_seg != text_section) - s_ltorg (0); - } - else if (now_seg != data_section) - s_ltorg (0); - -#ifdef OBJ_ELF - obj_elf_data (ignore); -#else - s_data (ignore); -#endif -} - -static void -arm_s_section (ignore) - int ignore; -{ - s_ltorg (0); - -#ifdef OBJ_ELF - obj_elf_section (ignore); -#endif -#ifdef OBJ_COFF - obj_coff_section (ignore); -#endif -} - static void opcode_select (width) int width; @@ -2616,6 +3309,7 @@ opcode_select (width) coming from ARM mode, which is word-aligned. */ record_alignment (now_seg, 1); } + mapping_state (MAP_THUMB); break; case 32: @@ -2631,6 +3325,7 @@ opcode_select (width) record_alignment (now_seg, 1); } + mapping_state (MAP_ARM); break; default: @@ -2736,6 +3431,57 @@ reg_required_here (str, shift) return FAIL; } +/* A Intel Wireless MMX technology register + must be given at this point. + Shift is the place to put it in inst.instruction. + Restores input start point on err. + Returns the reg#, or FAIL. */ + +static int +wreg_required_here (str, shift, reg_type) + char ** str; + int shift; + enum wreg_type reg_type; +{ + static char buff [128]; + int reg; + char * start = *str; + + if ((reg = arm_reg_parse (str, all_reg_maps[REG_TYPE_IWMMXT].htab)) != FAIL) + { + if (wr_register (reg) + && (reg_type == IWMMXT_REG_WR || reg_type == IWMMXT_REG_WR_OR_WC)) + { + if (shift >= 0) + inst.instruction |= (reg ^ WR_PREFIX) << shift; + return reg; + } + else if (wc_register (reg) + && (reg_type == IWMMXT_REG_WC || reg_type == IWMMXT_REG_WR_OR_WC)) + { + if (shift >= 0) + inst.instruction |= (reg ^ WC_PREFIX) << shift; + return reg; + } + else if ((wcg_register (reg) && reg_type == IWMMXT_REG_WCG)) + { + if (shift >= 0) + inst.instruction |= ((reg ^ WC_PREFIX) - 8) << shift; + return reg; + } + } + + /* Restore the start point, we may have got a reg of the wrong class. */ + *str = start; + + /* In the few cases where we might be able to accept + something else this error can be overridden. */ + sprintf (buff, _("Intel Wireless MMX technology register expected, not '%.100s'"), start); + inst.error = buff; + + return FAIL; +} + static const struct asm_psr * arm_psr_parse (ccp) register char ** ccp; @@ -3001,22 +3747,96 @@ cp_address_required_here (str, wb_ok) { p++; - if (wb_ok && skip_past_comma (& p) == SUCCESS) + skip_whitespace (p); + + if (*p == '\0') { - /* [Rn], #expr */ - write_back = WRITE_BACK; + /* As an extension to the official ARM syntax we allow: + + [Rn] + + as a short hand for: + + [Rn,#0] */ + inst.instruction |= PRE_INDEX | INDEX_UP; + *str = p; + return SUCCESS; + } + + if (skip_past_comma (& p) == FAIL) + { + inst.error = _("comma expected after closing square bracket"); + return FAIL; + } - if (reg == REG_PC) + skip_whitespace (p); + + if (*p == '#') + { + if (wb_ok) { - inst.error = _("pc may not be used in post-increment"); - return FAIL; + /* [Rn], #expr */ + write_back = WRITE_BACK; + + if (reg == REG_PC) + { + inst.error = _("pc may not be used in post-increment"); + return FAIL; + } + + if (cp_address_offset (& p) == FAIL) + return FAIL; } + else + pre_inc = PRE_INDEX | INDEX_UP; + } + else if (*p == '{') + { + int option; + + /* [Rn], {} */ + p++; - if (cp_address_offset (& p) == FAIL) + skip_whitespace (p); + + if (my_get_expression (& inst.reloc.exp, & p)) return FAIL; + + if (inst.reloc.exp.X_op == O_constant) + { + option = inst.reloc.exp.X_add_number; + + if (option > 255 || option < 0) + { + inst.error = _("'option' field too large"); + return FAIL; + } + + skip_whitespace (p); + + if (*p != '}') + { + inst.error = _("'}' expected at end of 'option' field"); + return FAIL; + } + else + { + p++; + inst.instruction |= option; + inst.instruction |= INDEX_UP; + } + } + else + { + inst.error = _("non-constant expressions for 'option' field not supported"); + return FAIL; + } } else - pre_inc = PRE_INDEX | INDEX_UP; + { + inst.error = _("# or { expected after comma"); + return FAIL; + } } else { @@ -3073,16 +3893,153 @@ cp_address_required_here (str, wb_ok) return SUCCESS; } -static void -do_empty (str) - char * str; +static int +cp_byte_address_offset (str) + char ** str; { - /* Do nothing really. */ - end_of_line (str); - return; -} + int offset; -static void + skip_whitespace (* str); + + if (! is_immediate_prefix (**str)) + { + inst.error = _("immediate expression expected"); + return FAIL; + } + + (*str)++; + + if (my_get_expression (& inst.reloc.exp, str)) + return FAIL; + + if (inst.reloc.exp.X_op == O_constant) + { + offset = inst.reloc.exp.X_add_number; + + if (offset > 255 || offset < -255) + { + inst.error = _("offset too large"); + return FAIL; + } + + if (offset >= 0) + inst.instruction |= INDEX_UP; + else + offset = -offset; + + inst.instruction |= offset; + } + else + inst.reloc.type = BFD_RELOC_ARM_CP_OFF_IMM_S2; + + return SUCCESS; +} + +static int +cp_byte_address_required_here (str) + char ** str; +{ + char * p = * str; + int pre_inc = 0; + int write_back = 0; + + if (*p == '[') + { + int reg; + + p++; + skip_whitespace (p); + + if ((reg = reg_required_here (& p, 16)) == FAIL) + return FAIL; + + skip_whitespace (p); + + if (*p == ']') + { + p++; + + if (skip_past_comma (& p) == SUCCESS) + { + /* [Rn], #expr */ + write_back = WRITE_BACK; + + if (reg == REG_PC) + { + inst.error = _("pc may not be used in post-increment"); + return FAIL; + } + + if (cp_byte_address_offset (& p) == FAIL) + return FAIL; + } + else + pre_inc = PRE_INDEX | INDEX_UP; + } + else + { + /* '['Rn, #expr']'[!] */ + + if (skip_past_comma (& p) == FAIL) + { + inst.error = _("pre-indexed expression expected"); + return FAIL; + } + + pre_inc = PRE_INDEX; + + if (cp_byte_address_offset (& p) == FAIL) + return FAIL; + + skip_whitespace (p); + + if (*p++ != ']') + { + inst.error = _("missing ]"); + return FAIL; + } + + skip_whitespace (p); + + if (*p == '!') + { + if (reg == REG_PC) + { + inst.error = _("pc may not be used with write-back"); + return FAIL; + } + + p++; + write_back = WRITE_BACK; + } + } + } + else + { + if (my_get_expression (&inst.reloc.exp, &p)) + return FAIL; + + inst.reloc.type = BFD_RELOC_ARM_CP_OFF_IMM_S2; + inst.reloc.exp.X_add_number -= 8; /* PC rel adjust. */ + inst.reloc.pc_rel = 1; + inst.instruction |= (REG_PC << 16); + pre_inc = PRE_INDEX; + } + + inst.instruction |= write_back | pre_inc; + *str = p; + return SUCCESS; +} + +static void +do_empty (str) + char * str; +{ + /* Do nothing really. */ + end_of_line (str); +} + +static void do_mrs (str) char *str; { @@ -3107,12 +4064,12 @@ do_mrs (str) if ( strcmp (str, "CPSR") == 0 || strcmp (str, "SPSR") == 0 - /* Lower case versions for backwards compatability. */ + /* Lower case versions for backwards compatibility. */ || strcmp (str, "cpsr") == 0 || strcmp (str, "spsr") == 0) skip = 4; - /* This is for backwards compatability with older toolchains. */ + /* This is for backwards compatibility with older toolchains. */ else if ( strcmp (str, "cpsr_all") == 0 || strcmp (str, "spsr_all") == 0) skip = 8; @@ -3263,7 +4220,6 @@ do_mull (str) } end_of_line (str); - return; } static void @@ -3317,7 +4273,6 @@ do_mul (str) } end_of_line (str); - return; } static void @@ -3373,7 +4328,6 @@ do_mla (str) } end_of_line (str); - return; } /* Expects *str -> the characters "acc0", possibly with leading blanks. @@ -3730,7 +4684,7 @@ do_clz (str) /* ARM V5 (argument parse) LDC2{L} , , STC2{L} , , - Instruction is not conditional, and has 0xf in the codition field. + Instruction is not conditional, and has 0xf in the condition field. Otherwise, it's the same as LDC/STC. */ static void @@ -3909,172 +4863,1119 @@ do_bxj (str) end_of_line (str); } -/* THUMB V5 breakpoint instruction (argument parse) - BKPT . */ +/* ARM V6 umaal (argument parse). */ static void -do_t_bkpt (str) - char * str; +do_umaal (str) + char *str; { - expressionS expr; - unsigned long number; - - skip_whitespace (str); - /* Allow optional leading '#'. */ - if (is_immediate_prefix (*str)) - str ++; + int rdlo, rdhi, rm, rs; - memset (& expr, '\0', sizeof (expr)); - if (my_get_expression (& expr, & str) || (expr.X_op != O_constant)) + skip_whitespace (str); + if ((rdlo = reg_required_here (& str, 12)) == FAIL + || skip_past_comma (& str) == FAIL + || (rdhi = reg_required_here (& str, 16)) == FAIL + || skip_past_comma (& str) == FAIL + || (rm = reg_required_here (& str, 0)) == FAIL + || skip_past_comma (& str) == FAIL + || (rs = reg_required_here (& str, 8)) == FAIL) { - inst.error = _("bad or missing expression"); - return; + inst.error = BAD_ARGS; + return; } - number = expr.X_add_number; - - /* Check it fits an 8 bit unsigned. */ - if (number != (number & 0xff)) + if (rdlo == REG_PC || rdhi == REG_PC || rm == REG_PC || rs == REG_PC) { - inst.error = _("immediate value out of range"); + inst.error = BAD_PC; return; } - inst.instruction |= number; - end_of_line (str); } -/* ARM V5 branch-link-exchange (argument parse) for BLX(1) only. - Expects inst.instruction is set for BLX(1). - Note: this is cloned from do_branch, and the reloc changed to be a - new one that can cope with setting one extra bit (the H bit). */ +/* ARM V6 strex (argument parse). */ -static void -do_branch25 (str) - char * str; +static void +do_strex (str) + char *str; { - if (my_get_expression (& inst.reloc.exp, & str)) - return; - -#ifdef OBJ_ELF - { - char * save_in; - - /* ScottB: February 5, 1998 */ - /* Check to see of PLT32 reloc required for the instruction. */ + int rd, rm, rn; - /* arm_parse_reloc() works on input_line_pointer. - We actually want to parse the operands to the branch instruction - passed in 'str'. Save the input pointer and restore it later. */ - save_in = input_line_pointer; - input_line_pointer = str; + /* Parse Rd, Rm,. */ + skip_whitespace (str); + if ((rd = reg_required_here (& str, 12)) == FAIL + || skip_past_comma (& str) == FAIL + || (rm = reg_required_here (& str, 0)) == FAIL + || skip_past_comma (& str) == FAIL) + { + inst.error = BAD_ARGS; + return; + } + if (rd == REG_PC || rm == REG_PC) + { + inst.error = BAD_PC; + return; + } + if (rd == rm) + { + inst.error = _("Rd equal to Rm or Rn yields unpredictable results"); + return; + } - if (inst.reloc.exp.X_op == O_symbol - && *str == '(' - && arm_parse_reloc () == BFD_RELOC_ARM_PLT32) - { - inst.reloc.type = BFD_RELOC_ARM_PLT32; - inst.reloc.pc_rel = 0; - /* Modify str to point to after parsed operands, otherwise - end_of_line() will complain about the (PLT) left in str. */ - str = input_line_pointer; - } - else - { - inst.reloc.type = BFD_RELOC_ARM_PCREL_BLX; - inst.reloc.pc_rel = 1; - } + /* Skip past '['. */ + if ((strlen (str) >= 1) + && strncmp (str, "[", 1) == 0) + str+=1; + skip_whitespace (str); - input_line_pointer = save_in; - } -#else - inst.reloc.type = BFD_RELOC_ARM_PCREL_BLX; - inst.reloc.pc_rel = 1; -#endif /* OBJ_ELF */ + /* Parse Rn. */ + if ((rn = reg_required_here (& str, 16)) == FAIL) + { + inst.error = BAD_ARGS; + return; + } + else if (rn == REG_PC) + { + inst.error = BAD_PC; + return; + } + if (rd == rn) + { + inst.error = _("Rd equal to Rm or Rn yields unpredictable results"); + return; + } + skip_whitespace (str); + /* Skip past ']'. */ + if ((strlen (str) >= 1) + && strncmp (str, "]", 1) == 0) + str+=1; + end_of_line (str); } -/* ARM V5 branch-link-exchange instruction (argument parse) - BLX ie BLX(1) - BLX{} ie BLX(2) - Unfortunately, there are two different opcodes for this mnemonic. - So, the insns[].value is not used, and the code here zaps values - into inst.instruction. - Also, the can be 25 bits, hence has its own reloc. */ +/* ARM V6 ssat (argument parse). */ static void -do_blx (str) - char * str; +do_ssat (str) + char* str; { - char * mystr = str; - int rm; - - skip_whitespace (mystr); - rm = reg_required_here (& mystr, 0); - - /* The above may set inst.error. Ignore his opinion. */ - inst.error = 0; - - if (rm != FAIL) - { - /* Arg is a register. - Use the condition code our caller put in inst.instruction. - Pass ourselves off as a BX with a funny opcode. */ - inst.instruction |= 0x012fff30; - do_bx (str); - } - else - { - /* This must be is BLX , no condition allowed. */ - if (inst.instruction != COND_ALWAYS) - { - inst.error = BAD_COND; - return; - } - - inst.instruction = 0xfafffffe; - - /* Process like a B/BL, but with a different reloc. - Note that B/BL expecte fffffe, not 0, offset in the opcode table. */ - do_branch25 (str); - } + do_sat (&str, /*bias=*/-1); + end_of_line (str); } -/* ARM V5 Thumb BLX (argument parse) - BLX which is BLX(1) - BLX which is BLX(2) - Unfortunately, there are two different opcodes for this mnemonic. - So, the tinsns[].value is not used, and the code here zaps values - into inst.instruction. */ +/* ARM V6 usat (argument parse). */ static void -do_t_blx (str) - char * str; +do_usat (str) + char* str; { - char * mystr = str; - int rm; - - skip_whitespace (mystr); - inst.instruction = 0x4780; + do_sat (&str, /*bias=*/0); + end_of_line (str); +} - /* Note that this call is to the ARM register recognizer. BLX(2) - uses the ARM register space, not the Thumb one, so a call to - thumb_reg() would be wrong. */ - rm = reg_required_here (& mystr, 3); - inst.error = 0; +static void +do_sat (str, bias) + char **str; + int bias; +{ + int rd, rm; + expressionS expr; - if (rm != FAIL) + skip_whitespace (*str); + + /* Parse , field. */ + if ((rd = reg_required_here (str, 12)) == FAIL + || skip_past_comma (str) == FAIL) { - /* It's BLX(2). The .instruction was zapped with rm & is final. */ - inst.size = 2; + inst.error = BAD_ARGS; + return; } - else + if (rd == REG_PC) { - /* No ARM register. This must be BLX(1). Change the .instruction. */ - inst.instruction = 0xf7ffeffe; + inst.error = BAD_PC; + return; + } + + /* Parse #, field. */ + if (is_immediate_prefix (**str)) + (*str)++; + else + { + inst.error = _("immediate expression expected"); + return; + } + if (my_get_expression (&expr, str)) + { + inst.error = _("bad expression"); + return; + } + if (expr.X_op != O_constant) + { + inst.error = _("constant expression expected"); + return; + } + if (expr.X_add_number + bias < 0 + || expr.X_add_number + bias > 31) + { + inst.error = _("immediate value out of range"); + return; + } + inst.instruction |= (expr.X_add_number + bias) << 16; + if (skip_past_comma (str) == FAIL) + { + inst.error = BAD_ARGS; + return; + } + + /* Parse field. */ + if ((rm = reg_required_here (str, 0)) == FAIL) + { + inst.error = BAD_ARGS; + return; + } + if (rm == REG_PC) + { + inst.error = BAD_PC; + return; + } + + if (skip_past_comma (str) == SUCCESS) + decode_shift (str, SHIFT_LSL_OR_ASR_IMMEDIATE); +} + +/* ARM V6 ssat16 (argument parse). */ + +static void +do_ssat16 (str) + char *str; +{ + do_sat16 (&str, /*bias=*/-1); + end_of_line (str); +} + +static void +do_usat16 (str) + char *str; +{ + do_sat16 (&str, /*bias=*/0); + end_of_line (str); +} + +static void +do_sat16 (str, bias) + char **str; + int bias; +{ + int rd, rm; + expressionS expr; + + skip_whitespace (*str); + + /* Parse the field. */ + if ((rd = reg_required_here (str, 12)) == FAIL + || skip_past_comma (str) == FAIL) + { + inst.error = BAD_ARGS; + return; + } + if (rd == REG_PC) + { + inst.error = BAD_PC; + return; + } + + /* Parse #, field. */ + if (is_immediate_prefix (**str)) + (*str)++; + else + { + inst.error = _("immediate expression expected"); + return; + } + if (my_get_expression (&expr, str)) + { + inst.error = _("bad expression"); + return; + } + if (expr.X_op != O_constant) + { + inst.error = _("constant expression expected"); + return; + } + if (expr.X_add_number + bias < 0 + || expr.X_add_number + bias > 15) + { + inst.error = _("immediate value out of range"); + return; + } + inst.instruction |= (expr.X_add_number + bias) << 16; + if (skip_past_comma (str) == FAIL) + { + inst.error = BAD_ARGS; + return; + } + + /* Parse field. */ + if ((rm = reg_required_here (str, 0)) == FAIL) + { + inst.error = BAD_ARGS; + return; + } + if (rm == REG_PC) + { + inst.error = BAD_PC; + return; + } +} + +/* ARM V6 srs (argument parse). */ + +static void +do_srs (str) + char* str; +{ + char *exclam; + skip_whitespace (str); + exclam = strchr (str, '!'); + if (exclam) + *exclam = '\0'; + do_cps_mode (&str); + if (exclam) + *exclam = '!'; + if (*str == '!') + { + inst.instruction |= WRITE_BACK; + str++; + } + end_of_line (str); +} + +/* ARM V6 SMMUL (argument parse). */ + +static void +do_smmul (str) + char* str; +{ + int rd, rm, rs; + + skip_whitespace (str); + if ((rd = reg_required_here (&str, 16)) == FAIL + || skip_past_comma (&str) == FAIL + || (rm = reg_required_here (&str, 0)) == FAIL + || skip_past_comma (&str) == FAIL + || (rs = reg_required_here (&str, 8)) == FAIL) + { + inst.error = BAD_ARGS; + return; + } + + if (rd == REG_PC + || rm == REG_PC + || rs == REG_PC) + { + inst.error = BAD_PC; + return; + } + + end_of_line (str); + +} + +/* ARM V6 SMLALD (argument parse). */ + +static void +do_smlald (str) + char* str; +{ + int rdlo, rdhi, rm, rs; + skip_whitespace (str); + if ((rdlo = reg_required_here (&str, 12)) == FAIL + || skip_past_comma (&str) == FAIL + || (rdhi = reg_required_here (&str, 16)) == FAIL + || skip_past_comma (&str) == FAIL + || (rm = reg_required_here (&str, 0)) == FAIL + || skip_past_comma (&str) == FAIL + || (rs = reg_required_here (&str, 8)) == FAIL) + { + inst.error = BAD_ARGS; + return; + } + + if (rdlo == REG_PC + || rdhi == REG_PC + || rm == REG_PC + || rs == REG_PC) + { + inst.error = BAD_PC; + return; + } + + end_of_line (str); +} + +/* ARM V6 SMLAD (argument parse). Signed multiply accumulate dual. + smlad{x}{} Rd, Rm, Rs, Rn */ + +static void +do_smlad (str) + char *str; +{ + int rd, rm, rs, rn; + + skip_whitespace (str); + if ((rd = reg_required_here (&str, 16)) == FAIL + || skip_past_comma (&str) == FAIL + || (rm = reg_required_here (&str, 0)) == FAIL + || skip_past_comma (&str) == FAIL + || (rs = reg_required_here (&str, 8)) == FAIL + || skip_past_comma (&str) == FAIL + || (rn = reg_required_here (&str, 12)) == FAIL) + { + inst.error = BAD_ARGS; + return; + } + + if (rd == REG_PC + || rn == REG_PC + || rs == REG_PC + || rm == REG_PC) + { + inst.error = BAD_PC; + return; + } + + end_of_line (str); +} + +/* ARM V6 SETEND (argument parse). Sets the E bit in the CPSR while + preserving the other bits. + + setend , where is either + BE or LE. */ + +static void +do_setend (str) + char *str; +{ + if (do_endian_specifier (str)) + inst.instruction |= 0x200; +} + +/* Returns true if the endian-specifier indicates big-endianness. */ + +static int +do_endian_specifier (str) + char *str; +{ + int big_endian = 0; + + skip_whitespace (str); + if (strlen (str) < 2) + inst.error = _("missing endian specifier"); + else if (strncasecmp (str, "BE", 2) == 0) + { + str += 2; + big_endian = 1; + } + else if (strncasecmp (str, "LE", 2) == 0) + str += 2; + else + inst.error = _("valid endian specifiers are be or le"); + + end_of_line (str); + + return big_endian; +} + +/* ARM V6 SXTH. + + SXTH {} , {, } + Condition defaults to COND_ALWAYS. + Error if any register uses R15. */ + +static void +do_sxth (str) + char *str; +{ + int rd, rm; + expressionS expr; + int rotation_clear_mask = 0xfffff3ff; + int rotation_eight_mask = 0x00000400; + int rotation_sixteen_mask = 0x00000800; + int rotation_twenty_four_mask = 0x00000c00; + + skip_whitespace (str); + if ((rd = reg_required_here (&str, 12)) == FAIL + || skip_past_comma (&str) == FAIL + || (rm = reg_required_here (&str, 0)) == FAIL) + { + inst.error = BAD_ARGS; + return; + } + + else if (rd == REG_PC || rm == REG_PC) + { + inst.error = BAD_PC; + return; + } + + /* Zero out the rotation field. */ + inst.instruction &= rotation_clear_mask; + + /* Check for lack of optional rotation field. */ + if (skip_past_comma (&str) == FAIL) + { + end_of_line (str); + return; + } + + /* Move past 'ROR'. */ + skip_whitespace (str); + if (strncasecmp (str, "ROR", 3) == 0) + str+=3; + else + { + inst.error = _("missing rotation field after comma"); + return; + } + + /* Get the immediate constant. */ + skip_whitespace (str); + if (is_immediate_prefix (* str)) + str++; + else + { + inst.error = _("immediate expression expected"); + return; + } + + if (my_get_expression (&expr, &str)) + { + inst.error = _("bad expression"); + return; + } + + if (expr.X_op != O_constant) + { + inst.error = _("constant expression expected"); + return; + } + + switch (expr.X_add_number) + { + case 0: + /* Rotation field has already been zeroed. */ + break; + case 8: + inst.instruction |= rotation_eight_mask; + break; + + case 16: + inst.instruction |= rotation_sixteen_mask; + break; + + case 24: + inst.instruction |= rotation_twenty_four_mask; + break; + + default: + inst.error = _("rotation can be 8, 16, 24 or 0 when field is ommited"); + break; + } + + end_of_line (str); + +} + +/* ARM V6 SXTAH extracts a 16-bit value from a register, sign + extends it to 32-bits, and adds the result to a value in another + register. You can specify a rotation by 0, 8, 16, or 24 bits + before extracting the 16-bit value. + SXTAH{} , , {, } + Condition defaults to COND_ALWAYS. + Error if any register uses R15. */ + +static void +do_sxtah (str) + char *str; +{ + int rd, rn, rm; + expressionS expr; + int rotation_clear_mask = 0xfffff3ff; + int rotation_eight_mask = 0x00000400; + int rotation_sixteen_mask = 0x00000800; + int rotation_twenty_four_mask = 0x00000c00; + + skip_whitespace (str); + if ((rd = reg_required_here (&str, 12)) == FAIL + || skip_past_comma (&str) == FAIL + || (rn = reg_required_here (&str, 16)) == FAIL + || skip_past_comma (&str) == FAIL + || (rm = reg_required_here (&str, 0)) == FAIL) + { + inst.error = BAD_ARGS; + return; + } + + else if (rd == REG_PC || rn == REG_PC || rm == REG_PC) + { + inst.error = BAD_PC; + return; + } + + /* Zero out the rotation field. */ + inst.instruction &= rotation_clear_mask; + + /* Check for lack of optional rotation field. */ + if (skip_past_comma (&str) == FAIL) + { + end_of_line (str); + return; + } + + /* Move past 'ROR'. */ + skip_whitespace (str); + if (strncasecmp (str, "ROR", 3) == 0) + str+=3; + else + { + inst.error = _("missing rotation field after comma"); + return; + } + + /* Get the immediate constant. */ + skip_whitespace (str); + if (is_immediate_prefix (* str)) + str++; + else + { + inst.error = _("immediate expression expected"); + return; + } + + if (my_get_expression (&expr, &str)) + { + inst.error = _("bad expression"); + return; + } + + if (expr.X_op != O_constant) + { + inst.error = _("constant expression expected"); + return; + } + + switch (expr.X_add_number) + { + case 0: + /* Rotation field has already been zeroed. */ + break; + + case 8: + inst.instruction |= rotation_eight_mask; + break; + + case 16: + inst.instruction |= rotation_sixteen_mask; + break; + + case 24: + inst.instruction |= rotation_twenty_four_mask; + break; + + default: + inst.error = _("rotation can be 8, 16, 24 or 0 when field is ommited"); + break; + } + + end_of_line (str); + +} + + +/* ARM V6 RFE (Return from Exception) loads the PC and CPSR from the + word at the specified address and the following word + respectively. + Unconditionally executed. + Error if Rn is R15. +*/ + +static void +do_rfe (str) + char *str; +{ + int rn; + + skip_whitespace (str); + + if ((rn = reg_required_here (&str, 16)) == FAIL) + return; + + if (rn == REG_PC) + { + inst.error = BAD_PC; + return; + } + + skip_whitespace (str); + + if (*str == '!') + { + inst.instruction |= WRITE_BACK; + str++; + } + end_of_line (str); +} + +/* ARM V6 REV (Byte Reverse Word) reverses the byte order in a 32-bit + register (argument parse). + REV{} Rd, Rm. + Condition defaults to COND_ALWAYS. + Error if Rd or Rm are R15. */ + +static void +do_rev (str) + char* str; +{ + int rd, rm; + + skip_whitespace (str); + + if ((rd = reg_required_here (&str, 12)) == FAIL + || skip_past_comma (&str) == FAIL + || (rm = reg_required_here (&str, 0)) == FAIL) + inst.error = BAD_ARGS; + + else if (rd == REG_PC || rm == REG_PC) + inst.error = BAD_PC; + + else + end_of_line (str); +} + +/* ARM V6 Perform Two Sixteen Bit Integer Additions. (argument parse). + QADD16{} , , + Condition defaults to COND_ALWAYS. + Error if Rd, Rn or Rm are R15. */ + +static void +do_qadd16 (str) + char* str; +{ + int rd, rm, rn; + + skip_whitespace (str); + + if ((rd = reg_required_here (&str, 12)) == FAIL + || skip_past_comma (&str) == FAIL + || (rn = reg_required_here (&str, 16)) == FAIL + || skip_past_comma (&str) == FAIL + || (rm = reg_required_here (&str, 0)) == FAIL) + inst.error = BAD_ARGS; + + else if (rd == REG_PC || rm == REG_PC || rn == REG_PC) + inst.error = BAD_PC; + + else + end_of_line (str); +} + +/* ARM V6 Pack Halfword Bottom Top instruction (argument parse). + PKHBT {} , , {, LSL #} + Condition defaults to COND_ALWAYS. + Error if Rd, Rn or Rm are R15. */ + +static void +do_pkhbt (str) + char* str; +{ + do_pkh_core (str, SHIFT_LSL_IMMEDIATE); +} + +/* ARM V6 PKHTB (Argument Parse). */ + +static void +do_pkhtb (str) + char* str; +{ + do_pkh_core (str, SHIFT_ASR_IMMEDIATE); +} + +static void +do_pkh_core (str, shift) + char* str; + int shift; +{ + int rd, rn, rm; + + skip_whitespace (str); + if (((rd = reg_required_here (&str, 12)) == FAIL) + || (skip_past_comma (&str) == FAIL) + || ((rn = reg_required_here (&str, 16)) == FAIL) + || (skip_past_comma (&str) == FAIL) + || ((rm = reg_required_here (&str, 0)) == FAIL)) + { + inst.error = BAD_ARGS; + return; + } + + else if (rd == REG_PC || rn == REG_PC || rm == REG_PC) + { + inst.error = BAD_PC; + return; + } + + /* Check for optional shift immediate constant. */ + if (skip_past_comma (&str) == FAIL) + { + if (shift == SHIFT_ASR_IMMEDIATE) + { + /* If the shift specifier is ommited, turn the instruction + into pkhbt rd, rm, rn. First, switch the instruction + code, and clear the rn and rm fields. */ + inst.instruction &= 0xfff0f010; + /* Now, re-encode the registers. */ + inst.instruction |= (rm << 16) | rn; + } + return; + } + + decode_shift (&str, shift); +} + +/* ARM V6 Load Register Exclusive instruction (argument parse). + LDREX{} ] + Condition defaults to COND_ALWAYS. + Error if Rd or Rn are R15. + See ARMARMv6 A4.1.27: LDREX. */ + + +static void +do_ldrex (str) + char * str; +{ + int rd, rn; + + skip_whitespace (str); + + /* Parse Rd. */ + if (((rd = reg_required_here (&str, 12)) == FAIL) + || (skip_past_comma (&str) == FAIL)) + { + inst.error = BAD_ARGS; + return; + } + else if (rd == REG_PC) + { + inst.error = BAD_PC; + return; + } + skip_whitespace (str); + + /* Skip past '['. */ + if ((strlen (str) >= 1) + &&strncmp (str, "[", 1) == 0) + str+=1; + skip_whitespace (str); + + /* Parse Rn. */ + if ((rn = reg_required_here (&str, 16)) == FAIL) + { + inst.error = BAD_ARGS; + return; + } + else if (rn == REG_PC) + { + inst.error = BAD_PC; + return; + } + skip_whitespace (str); + + /* Skip past ']'. */ + if ((strlen (str) >= 1) + && strncmp (str, "]", 1) == 0) + str+=1; + + end_of_line (str); +} + +/* ARM V6 change processor state instruction (argument parse) + CPS, CPSIE, CSPID . */ + +static void +do_cps (str) + char * str; +{ + do_cps_mode (&str); + end_of_line (str); +} + +static void +do_cpsi (str) + char * str; +{ + do_cps_flags (&str, /*thumb_p=*/0); + + if (skip_past_comma (&str) == SUCCESS) + { + skip_whitespace (str); + do_cps_mode (&str); + } + end_of_line (str); +} + +static void +do_cps_mode (str) + char **str; +{ + expressionS expr; + + skip_whitespace (*str); + + if (! is_immediate_prefix (**str)) + { + inst.error = _("immediate expression expected"); + return; + } + + (*str)++; /* Strip off the immediate signifier. */ + if (my_get_expression (&expr, str)) + { + inst.error = _("bad expression"); + return; + } + + if (expr.X_op != O_constant) + { + inst.error = _("constant expression expected"); + return; + } + + /* The mode is a 5 bit field. Valid values are 0-31. */ + if (((unsigned) expr.X_add_number) > 31 + || (inst.reloc.exp.X_add_number) < 0) + { + inst.error = _("invalid constant"); + return; + } + + inst.instruction |= expr.X_add_number; +} + +static void +do_cps_flags (str, thumb_p) + char **str; + int thumb_p; +{ + struct cps_flag { + char character; + unsigned long arm_value; + unsigned long thumb_value; + }; + static struct cps_flag flag_table[] = { + {'a', 0x100, 0x4 }, + {'i', 0x080, 0x2 }, + {'f', 0x040, 0x1 } + }; + + int saw_a_flag = 0; + + skip_whitespace (*str); + + /* Get the a, f and i flags. */ + while (**str && **str != ',') + { + struct cps_flag *p; + struct cps_flag *q = flag_table + sizeof (flag_table)/sizeof (*p); + for (p = flag_table; p < q; ++p) + if (strncasecmp (*str, &p->character, 1) == 0) + { + inst.instruction |= (thumb_p ? p->thumb_value : p->arm_value); + saw_a_flag = 1; + break; + } + if (p == q) + { + inst.error = _("unrecognized flag"); + return; + } + (*str)++; + } + if (!saw_a_flag) + inst.error = _("no 'a', 'i', or 'f' flags for 'cps'"); +} + +/* THUMB V5 breakpoint instruction (argument parse) + BKPT . */ + +static void +do_t_bkpt (str) + char * str; +{ + expressionS expr; + unsigned long number; + + skip_whitespace (str); + + /* Allow optional leading '#'. */ + if (is_immediate_prefix (*str)) + str ++; + + memset (& expr, '\0', sizeof (expr)); + if (my_get_expression (& expr, & str) + || (expr.X_op != O_constant + /* As a convenience we allow 'bkpt' without an operand. */ + && expr.X_op != O_absent)) + { + inst.error = _("bad expression"); + return; + } + + number = expr.X_add_number; + + /* Check it fits an 8 bit unsigned. */ + if (number != (number & 0xff)) + { + inst.error = _("immediate value out of range"); + return; + } + + inst.instruction |= number; + + end_of_line (str); +} + +/* ARM V5 branch-link-exchange (argument parse) for BLX(1) only. + Expects inst.instruction is set for BLX(1). + Note: this is cloned from do_branch, and the reloc changed to be a + new one that can cope with setting one extra bit (the H bit). */ + +static void +do_branch25 (str) + char * str; +{ + if (my_get_expression (& inst.reloc.exp, & str)) + return; + +#ifdef OBJ_ELF + { + char * save_in; + + /* ScottB: February 5, 1998 */ + /* Check to see of PLT32 reloc required for the instruction. */ + + /* arm_parse_reloc() works on input_line_pointer. + We actually want to parse the operands to the branch instruction + passed in 'str'. Save the input pointer and restore it later. */ + save_in = input_line_pointer; + input_line_pointer = str; + + if (inst.reloc.exp.X_op == O_symbol + && *str == '(' + && arm_parse_reloc () == BFD_RELOC_ARM_PLT32) + { + inst.reloc.type = BFD_RELOC_ARM_PLT32; + inst.reloc.pc_rel = 0; + /* Modify str to point to after parsed operands, otherwise + end_of_line() will complain about the (PLT) left in str. */ + str = input_line_pointer; + } + else + { + inst.reloc.type = BFD_RELOC_ARM_PCREL_BLX; + inst.reloc.pc_rel = 1; + } + + input_line_pointer = save_in; + } +#else + inst.reloc.type = BFD_RELOC_ARM_PCREL_BLX; + inst.reloc.pc_rel = 1; +#endif /* OBJ_ELF */ + + end_of_line (str); +} + +/* ARM V5 branch-link-exchange instruction (argument parse) + BLX ie BLX(1) + BLX{} ie BLX(2) + Unfortunately, there are two different opcodes for this mnemonic. + So, the insns[].value is not used, and the code here zaps values + into inst.instruction. + Also, the can be 25 bits, hence has its own reloc. */ + +static void +do_blx (str) + char * str; +{ + char * mystr = str; + int rm; + + skip_whitespace (mystr); + rm = reg_required_here (& mystr, 0); + + /* The above may set inst.error. Ignore his opinion. */ + inst.error = 0; + + if (rm != FAIL) + { + /* Arg is a register. + Use the condition code our caller put in inst.instruction. + Pass ourselves off as a BX with a funny opcode. */ + inst.instruction |= 0x012fff30; + do_bx (str); + } + else + { + /* This must be is BLX , no condition allowed. */ + if (inst.instruction != COND_ALWAYS) + { + inst.error = BAD_COND; + return; + } + + inst.instruction = 0xfafffffe; + + /* Process like a B/BL, but with a different reloc. + Note that B/BL expecte fffffe, not 0, offset in the opcode table. */ + do_branch25 (str); + } +} + +/* ARM V5 Thumb BLX (argument parse) + BLX which is BLX(1) + BLX which is BLX(2) + Unfortunately, there are two different opcodes for this mnemonic. + So, the tinsns[].value is not used, and the code here zaps values + into inst.instruction. */ + +static void +do_t_blx (str) + char * str; +{ + char * mystr = str; + int rm; + + skip_whitespace (mystr); + inst.instruction = 0x4780; + + /* Note that this call is to the ARM register recognizer. BLX(2) + uses the ARM register space, not the Thumb one, so a call to + thumb_reg() would be wrong. */ + rm = reg_required_here (& mystr, 3); + inst.error = 0; + + if (rm != FAIL) + { + /* It's BLX(2). The .instruction was zapped with rm & is final. */ + inst.size = 2; + } + else + { + /* No ARM register. This must be BLX(1). Change the .instruction. */ + inst.instruction = 0xf7ffeffe; inst.size = 4; if (my_get_expression (& inst.reloc.exp, & mystr)) @@ -4108,28 +6009,480 @@ do_bkpt (str) memset (& expr, '\0', sizeof (expr)); - if (my_get_expression (& expr, & str) || (expr.X_op != O_constant)) + if (my_get_expression (& expr, & str) + || (expr.X_op != O_constant + /* As a convenience we allow 'bkpt' without an operand. */ + && expr.X_op != O_absent)) { - inst.error = _("bad or missing expression"); + inst.error = _("bad expression"); + return; + } + + number = expr.X_add_number; + + /* Check it fits a 16 bit unsigned. */ + if (number != (number & 0xffff)) + { + inst.error = _("immediate value out of range"); return; } - number = expr.X_add_number; + /* Top 12 of 16 bits to bits 19:8. */ + inst.instruction |= (number & 0xfff0) << 4; + + /* Bottom 4 of 16 bits to bits 3:0. */ + inst.instruction |= number & 0xf; + + end_of_line (str); +} + +/* THUMB CPS instruction (argument parse). */ + +static void +do_t_cps (str) + char *str; +{ + do_cps_flags (&str, /*thumb_p=*/1); + end_of_line (str); +} + +/* THUMB CPY instruction (argument parse). */ + +static void +do_t_cpy (str) + char *str; +{ + thumb_mov_compare (str, THUMB_CPY); +} + +/* THUMB SETEND instruction (argument parse). */ + +static void +do_t_setend (str) + char *str; +{ + if (do_endian_specifier (str)) + inst.instruction |= 0x8; +} + +static unsigned long check_iwmmxt_insn PARAMS ((char *, enum iwmmxt_insn_type, int)); + +/* Parse INSN_TYPE insn STR having a possible IMMEDIATE_SIZE immediate. */ + +static unsigned long +check_iwmmxt_insn (str, insn_type, immediate_size) + char * str; + enum iwmmxt_insn_type insn_type; + int immediate_size; +{ + int reg = 0; + const char * inst_error; + expressionS expr; + unsigned long number; + + inst_error = inst.error; + if (!inst.error) + inst.error = BAD_ARGS; + skip_whitespace (str); + + switch (insn_type) + { + case check_rd: + if ((reg = reg_required_here (&str, 12)) == FAIL) + return FAIL; + break; + + case check_wr: + if ((wreg_required_here (&str, 0, IWMMXT_REG_WR)) == FAIL) + return FAIL; + break; + + case check_wrwr: + if ((wreg_required_here (&str, 12, IWMMXT_REG_WR) == FAIL + || skip_past_comma (&str) == FAIL + || wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL)) + return FAIL; + break; + + case check_wrwrwr: + if ((wreg_required_here (&str, 12, IWMMXT_REG_WR) == FAIL + || skip_past_comma (&str) == FAIL + || wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL + || skip_past_comma (&str) == FAIL + || wreg_required_here (&str, 0, IWMMXT_REG_WR) == FAIL)) + return FAIL; + break; + + case check_wrwrwcg: + if ((wreg_required_here (&str, 12, IWMMXT_REG_WR) == FAIL + || skip_past_comma (&str) == FAIL + || wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL + || skip_past_comma (&str) == FAIL + || wreg_required_here (&str, 0, IWMMXT_REG_WCG) == FAIL)) + return FAIL; + break; + + case check_tbcst: + if ((wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL + || skip_past_comma (&str) == FAIL + || reg_required_here (&str, 12) == FAIL)) + return FAIL; + break; + + case check_tmovmsk: + if ((reg_required_here (&str, 12) == FAIL + || skip_past_comma (&str) == FAIL + || wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL)) + return FAIL; + break; + + case check_tmia: + if ((wreg_required_here (&str, 5, IWMMXT_REG_WR) == FAIL + || skip_past_comma (&str) == FAIL + || reg_required_here (&str, 0) == FAIL + || skip_past_comma (&str) == FAIL + || reg_required_here (&str, 12) == FAIL)) + return FAIL; + break; + + case check_tmcrr: + if ((wreg_required_here (&str, 0, IWMMXT_REG_WR) == FAIL + || skip_past_comma (&str) == FAIL + || reg_required_here (&str, 12) == FAIL + || skip_past_comma (&str) == FAIL + || reg_required_here (&str, 16) == FAIL)) + return FAIL; + break; + + case check_tmrrc: + if ((reg_required_here (&str, 12) == FAIL + || skip_past_comma (&str) == FAIL + || reg_required_here (&str, 16) == FAIL + || skip_past_comma (&str) == FAIL + || wreg_required_here (&str, 0, IWMMXT_REG_WR) == FAIL)) + return FAIL; + break; + + case check_tmcr: + if ((wreg_required_here (&str, 16, IWMMXT_REG_WC) == FAIL + || skip_past_comma (&str) == FAIL + || reg_required_here (&str, 12) == FAIL)) + return FAIL; + break; + + case check_tmrc: + if ((reg_required_here (&str, 12) == FAIL + || skip_past_comma (&str) == FAIL + || wreg_required_here (&str, 16, IWMMXT_REG_WC) == FAIL)) + return FAIL; + break; + + case check_tinsr: + if ((wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL + || skip_past_comma (&str) == FAIL + || reg_required_here (&str, 12) == FAIL + || skip_past_comma (&str) == FAIL)) + return FAIL; + break; + + case check_textrc: + if ((reg_required_here (&str, 12) == FAIL + || skip_past_comma (&str) == FAIL)) + return FAIL; + break; + + case check_waligni: + if ((wreg_required_here (&str, 12, IWMMXT_REG_WR) == FAIL + || skip_past_comma (&str) == FAIL + || wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL + || skip_past_comma (&str) == FAIL + || wreg_required_here (&str, 0, IWMMXT_REG_WR) == FAIL + || skip_past_comma (&str) == FAIL)) + return FAIL; + break; + + case check_textrm: + if ((reg_required_here (&str, 12) == FAIL + || skip_past_comma (&str) == FAIL + || wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL + || skip_past_comma (&str) == FAIL)) + return FAIL; + break; + + case check_wshufh: + if ((wreg_required_here (&str, 12, IWMMXT_REG_WR) == FAIL + || skip_past_comma (&str) == FAIL + || wreg_required_here (&str, 16, IWMMXT_REG_WR) == FAIL + || skip_past_comma (&str) == FAIL)) + return FAIL; + break; + } + + if (immediate_size == 0) + { + end_of_line (str); + inst.error = inst_error; + return reg; + } + else + { + skip_whitespace (str); + + /* Allow optional leading '#'. */ + if (is_immediate_prefix (* str)) + str++; + + memset (& expr, '\0', sizeof (expr)); + + if (my_get_expression (& expr, & str) || (expr.X_op != O_constant)) + { + inst.error = _("bad or missing expression"); + return FAIL; + } + + number = expr.X_add_number; + + if (number != (number & immediate_size)) + { + inst.error = _("immediate value out of range"); + return FAIL; + } + end_of_line (str); + inst.error = inst_error; + return number; + } +} + +static void +do_iwmmxt_byte_addr (str) + char * str; +{ + int op = (inst.instruction & 0x300) >> 8; + int reg; + + inst.instruction &= ~0x300; + inst.instruction |= (op & 1) << 22 | (op & 2) << 7; + + skip_whitespace (str); + + if ((reg = wreg_required_here (&str, 12, IWMMXT_REG_WR_OR_WC)) == FAIL + || skip_past_comma (& str) == FAIL + || cp_byte_address_required_here (&str) == FAIL) + { + if (! inst.error) + inst.error = BAD_ARGS; + } + else + end_of_line (str); + + if (wc_register (reg)) + { + as_bad (_("non-word size not supported with control register")); + inst.instruction |= 0xf0000100; + inst.instruction &= ~0x00400000; + } +} + +static void +do_iwmmxt_tandc (str) + char * str; +{ + int reg; + + reg = check_iwmmxt_insn (str, check_rd, 0); + + if (reg != REG_PC && !inst.error) + inst.error = _("only r15 allowed here"); +} + +static void +do_iwmmxt_tbcst (str) + char * str; +{ + check_iwmmxt_insn (str, check_tbcst, 0); +} + +static void +do_iwmmxt_textrc (str) + char * str; +{ + unsigned long number; + + if ((number = check_iwmmxt_insn (str, check_textrc, 7)) == (unsigned long) FAIL) + return; + + inst.instruction |= number & 0x7; +} + +static void +do_iwmmxt_textrm (str) + char * str; +{ + unsigned long number; + + if ((number = check_iwmmxt_insn (str, check_textrm, 7)) == (unsigned long) FAIL) + return; + + inst.instruction |= number & 0x7; +} + +static void +do_iwmmxt_tinsr (str) + char * str; +{ + unsigned long number; + + if ((number = check_iwmmxt_insn (str, check_tinsr, 7)) == (unsigned long) FAIL) + return; + + inst.instruction |= number & 0x7; +} + +static void +do_iwmmxt_tmcr (str) + char * str; +{ + check_iwmmxt_insn (str, check_tmcr, 0); +} + +static void +do_iwmmxt_tmcrr (str) + char * str; +{ + check_iwmmxt_insn (str, check_tmcrr, 0); +} + +static void +do_iwmmxt_tmia (str) + char * str; +{ + check_iwmmxt_insn (str, check_tmia, 0); +} + +static void +do_iwmmxt_tmovmsk (str) + char * str; +{ + check_iwmmxt_insn (str, check_tmovmsk, 0); +} + +static void +do_iwmmxt_tmrc (str) + char * str; +{ + check_iwmmxt_insn (str, check_tmrc, 0); +} + +static void +do_iwmmxt_tmrrc (str) + char * str; +{ + check_iwmmxt_insn (str, check_tmrrc, 0); +} + +static void +do_iwmmxt_torc (str) + char * str; +{ + check_iwmmxt_insn (str, check_rd, 0); +} + +static void +do_iwmmxt_waligni (str) + char * str; +{ + unsigned long number; + + if ((number = check_iwmmxt_insn (str, check_waligni, 7)) == (unsigned long) FAIL) + return; + + inst.instruction |= ((number & 0x7) << 20); +} + +static void +do_iwmmxt_wmov (str) + char * str; +{ + if (check_iwmmxt_insn (str, check_wrwr, 0) == (unsigned long) FAIL) + return; + + inst.instruction |= ((inst.instruction >> 16) & 0xf); +} + +static void +do_iwmmxt_word_addr (str) + char * str; +{ + int op = (inst.instruction & 0x300) >> 8; + int reg; + + inst.instruction &= ~0x300; + inst.instruction |= (op & 1) << 22 | (op & 2) << 7; + + skip_whitespace (str); + + if ((reg = wreg_required_here (&str, 12, IWMMXT_REG_WR_OR_WC)) == FAIL + || skip_past_comma (& str) == FAIL + || cp_address_required_here (& str, CP_WB_OK) == FAIL) + { + if (! inst.error) + inst.error = BAD_ARGS; + } + else + end_of_line (str); + + if (wc_register (reg)) + { + if ((inst.instruction & COND_MASK) != COND_ALWAYS) + as_bad (_("conditional execution not supported with control register")); + if (op != 2) + as_bad (_("non-word size not supported with control register")); + inst.instruction |= 0xf0000100; + inst.instruction &= ~0x00400000; + } +} + +static void +do_iwmmxt_wrwr (str) + char * str; +{ + check_iwmmxt_insn (str, check_wrwr, 0); +} + +static void +do_iwmmxt_wrwrwcg (str) + char * str; +{ + check_iwmmxt_insn (str, check_wrwrwcg, 0); +} + +static void +do_iwmmxt_wrwrwr (str) + char * str; +{ + check_iwmmxt_insn (str, check_wrwrwr, 0); +} - /* Check it fits a 16 bit unsigned. */ - if (number != (number & 0xffff)) - { - inst.error = _("immediate value out of range"); - return; - } +static void +do_iwmmxt_wshufh (str) + char * str; +{ + unsigned long number; - /* Top 12 of 16 bits to bits 19:8. */ - inst.instruction |= (number & 0xfff0) << 4; + if ((number = check_iwmmxt_insn (str, check_wshufh, 0xff)) == (unsigned long) FAIL) + return; - /* Bottom 4 of 16 bits to bits 3:0. */ - inst.instruction |= number & 0xf; + inst.instruction |= ((number & 0xf0) << 16) | (number & 0xf); +} - end_of_line (str); +static void +do_iwmmxt_wzero (str) + char * str; +{ + if (check_iwmmxt_insn (str, check_wr, 0) == (unsigned long) FAIL) + return; + + inst.instruction |= ((inst.instruction & 0xf) << 12) | ((inst.instruction & 0xf) << 16); } /* Xscale multiply-accumulate (argument parse) @@ -4440,7 +6793,7 @@ my_get_float_expression (str) return -1; } -/* Return true if anything in the expression is a bignum. */ +/* Return TRUE if anything in the expression is a bignum. */ static int walk_no_bignums (sp) @@ -4531,13 +6884,12 @@ md_operand (expr) } } -/* UNRESTRICT should be one if is permitted for this - instruction. */ +/* KIND indicates what kind of shifts are accepted. */ static int -decode_shift (str, unrestrict) +decode_shift (str, kind) char ** str; - int unrestrict; + int kind; { const struct asm_shift_name * shift; char * p; @@ -4567,6 +6919,26 @@ decode_shift (str, unrestrict) assert (shift->properties->index == shift_properties[shift->properties->index].index); + if (kind == SHIFT_LSL_OR_ASR_IMMEDIATE + && shift->properties->index != SHIFT_LSL + && shift->properties->index != SHIFT_ASR) + { + inst.error = _("'LSL' or 'ASR' required"); + return FAIL; + } + else if (kind == SHIFT_LSL_IMMEDIATE + && shift->properties->index != SHIFT_LSL) + { + inst.error = _("'LSL' required"); + return FAIL; + } + else if (kind == SHIFT_ASR_IMMEDIATE + && shift->properties->index != SHIFT_ASR) + { + inst.error = _("'ASR' required"); + return FAIL; + } + if (shift->properties->index == SHIFT_RRX) { * str = p; @@ -4576,7 +6948,7 @@ decode_shift (str, unrestrict) skip_whitespace (p); - if (unrestrict && reg_required_here (& p, 8) != FAIL) + if (kind == NO_SHIFT_RESTRICT && reg_required_here (& p, 8) != FAIL) { inst.instruction |= shift->properties->bit_field | SHIFT_BY_REG; * str = p; @@ -4584,7 +6956,7 @@ decode_shift (str, unrestrict) } else if (! is_immediate_prefix (* p)) { - inst.error = (unrestrict + inst.error = (NO_SHIFT_RESTRICT ? _("shift requires register or #expression") : _("shift requires #expression")); * str = p; @@ -4646,7 +7018,7 @@ decode_shift (str, unrestrict) } /* Do those data_ops which can take a negative immediate constant - by altering the instuction. A bit of a hack really. + by altering the instruction. A bit of a hack really. MOV <-> MVN AND <-> BIC ADC <-> SBC @@ -4899,7 +7271,6 @@ do_arit (str) } end_of_line (str); - return; } static void @@ -4922,7 +7293,9 @@ do_adr (str) /* Frag hacking will turn this into a sub instruction if the offset turns out to be negative. */ inst.reloc.type = BFD_RELOC_ARM_IMMEDIATE; +#ifndef TE_WINCE inst.reloc.exp.X_add_number -= 8; /* PC relative adjust. */ +#endif inst.reloc.pc_rel = 1; end_of_line (str); @@ -4953,11 +7326,11 @@ do_adrl (str) /* Frag hacking will turn this into a sub instruction if the offset turns out to be negative. */ inst.reloc.type = BFD_RELOC_ARM_ADRL_IMMEDIATE; +#ifndef TE_WINCE inst.reloc.exp.X_add_number -= 8; /* PC relative adjust */ +#endif inst.reloc.pc_rel = 1; inst.size = INSN_SIZE * 2; - - return; } static void @@ -4982,7 +7355,6 @@ do_cmp (str) } end_of_line (str); - return; } static void @@ -5007,7 +7379,6 @@ do_mov (str) } end_of_line (str); - return; } static int @@ -5063,7 +7434,7 @@ ldst_extend (str) inst.instruction |= add | OFFSET_REG; if (skip_past_comma (str) == SUCCESS) - return decode_shift (str, SHIFT_RESTRICT); + return decode_shift (str, SHIFT_IMMEDIATE); return SUCCESS; } @@ -5258,7 +7629,6 @@ do_ldst (str) inst.instruction |= (pre_inc ? PRE_INDEX : 0); end_of_line (str); - return; } static void @@ -5337,7 +7707,6 @@ do_ldstt (str) } end_of_line (str); - return; } static int @@ -5593,7 +7962,6 @@ do_ldstv4 (str) inst.instruction |= (pre_inc ? PRE_INDEX : 0); end_of_line (str); - return; } static long @@ -5763,9 +8131,33 @@ do_ldmstm (str) inst.instruction |= LDM_TYPE_2_OR_3; } + if (inst.instruction & WRITE_BACK) + { + /* Check for unpredictable uses of writeback. */ + if (inst.instruction & LOAD_BIT) + { + /* Not allowed in LDM type 2. */ + if ((inst.instruction & LDM_TYPE_2_OR_3) + && ((range & (1 << REG_PC)) == 0)) + as_warn (_("writeback of base register is UNPREDICTABLE")); + /* Only allowed if base reg not in list for other types. */ + else if (range & (1 << base_reg)) + as_warn (_("writeback of base register when in register list is UNPREDICTABLE")); + } + else /* STM. */ + { + /* Not allowed for type 2. */ + if (inst.instruction & LDM_TYPE_2_OR_3) + as_warn (_("writeback of base register is UNPREDICTABLE")); + /* Only allowed if base reg not in list, or first in list. */ + else if ((range & (1 << base_reg)) + && (range & ((1 << base_reg) - 1))) + as_warn (_("if writeback register is in list, it must be the lowest reg in the list")); + } + } + inst.instruction |= range; end_of_line (str); - return; } static void @@ -5784,8 +8176,6 @@ do_swi (str) inst.reloc.type = BFD_RELOC_ARM_SWI; inst.reloc.pc_rel = 0; end_of_line (str); - - return; } static void @@ -5846,7 +8236,6 @@ do_swap (str) } end_of_line (str); - return; } static void @@ -5891,7 +8280,6 @@ do_branch (str) #endif /* OBJ_ELF */ end_of_line (str); - return; } static void @@ -5973,7 +8361,6 @@ do_cdp (str) } end_of_line (str); - return; } static void @@ -6009,7 +8396,6 @@ do_lstc (str) } end_of_line (str); - return; } static void @@ -6071,7 +8457,6 @@ do_co_reg (str) } end_of_line (str); - return; } static void @@ -6091,7 +8476,6 @@ do_fpa_ctrl (str) } end_of_line (str); - return; } static void @@ -6287,7 +8671,6 @@ do_fpa_dyadic (str) } end_of_line (str); - return; } static void @@ -6312,7 +8695,6 @@ do_fpa_monadic (str) } end_of_line (str); - return; } static void @@ -6337,7 +8719,6 @@ do_fpa_cmp (str) } end_of_line (str); - return; } static void @@ -6362,7 +8743,6 @@ do_fpa_from_reg (str) } end_of_line (str); - return; } static void @@ -6383,7 +8763,6 @@ do_fpa_to_reg (str) } end_of_line (str); - return; } static int @@ -6482,7 +8861,6 @@ do_vfp_sp_monadic (str) } end_of_line (str); - return; } static void @@ -6503,7 +8881,6 @@ do_vfp_dp_monadic (str) } end_of_line (str); - return; } static void @@ -6526,7 +8903,6 @@ do_vfp_sp_dyadic (str) } end_of_line (str); - return; } static void @@ -6549,7 +8925,6 @@ do_vfp_dp_dyadic (str) } end_of_line (str); - return; } static void @@ -6570,19 +8945,16 @@ do_vfp_reg_from_sp (str) } end_of_line (str); - return; } static void -do_vfp_sp_reg2 (str) +do_vfp_reg2_from_sp2 (str) char *str; { skip_whitespace (str); - if (reg_required_here (&str, 12) == FAIL) - return; - - if (skip_past_comma (&str) == FAIL + if (reg_required_here (&str, 12) == FAIL + || skip_past_comma (&str) == FAIL || reg_required_here (&str, 16) == FAIL || skip_past_comma (&str) == FAIL) { @@ -6599,7 +8971,6 @@ do_vfp_sp_reg2 (str) } end_of_line (str); - return; } static void @@ -6620,7 +8991,32 @@ do_vfp_sp_from_reg (str) } end_of_line (str); - return; +} + +static void +do_vfp_sp2_from_reg2 (str) + char *str; +{ + skip_whitespace (str); + + /* We require exactly two consecutive SP registers. */ + if (vfp_sp_reg_list (&str, VFP_REG_Sm) != 2) + { + if (! inst.error) + inst.error = _("only two consecutive VFP SP registers allowed here"); + } + + if (skip_past_comma (&str) == FAIL + || reg_required_here (&str, 12) == FAIL + || skip_past_comma (&str) == FAIL + || reg_required_here (&str, 16) == FAIL) + { + if (! inst.error) + inst.error = BAD_ARGS; + return; + } + + end_of_line (str); } static void @@ -6641,7 +9037,6 @@ do_vfp_reg_from_dp (str) } end_of_line (str); - return; } static void @@ -6664,7 +9059,6 @@ do_vfp_reg2_from_dp (str) } end_of_line (str); - return; } static void @@ -6685,7 +9079,6 @@ do_vfp_dp_from_reg (str) } end_of_line (str); - return; } static void @@ -6700,7 +9093,7 @@ do_vfp_dp_from_reg2 (str) if (skip_past_comma (&str) == FAIL || reg_required_here (&str, 12) == FAIL || skip_past_comma (&str) == FAIL - || reg_required_here (&str, 16)) + || reg_required_here (&str, 16) == FAIL) { if (! inst.error) inst.error = BAD_ARGS; @@ -6708,7 +9101,6 @@ do_vfp_dp_from_reg2 (str) } end_of_line (str); - return; } static const struct vfp_reg * @@ -6787,7 +9179,6 @@ do_vfp_reg_from_ctrl (str) } end_of_line (str); - return; } static void @@ -6808,7 +9199,6 @@ do_vfp_ctrl_from_reg (str) } end_of_line (str); - return; } static void @@ -6833,7 +9223,6 @@ do_vfp_sp_ldst (str) } end_of_line (str); - return; } static void @@ -6858,7 +9247,6 @@ do_vfp_dp_ldst (str) } end_of_line (str); - return; } /* Parse and encode a VFP SP register list, storing the initial @@ -7225,7 +9613,6 @@ do_vfp_sp_compare_z (str) } end_of_line (str); - return; } static void @@ -7242,7 +9629,6 @@ do_vfp_dp_compare_z (str) } end_of_line (str); - return; } static void @@ -7263,7 +9649,6 @@ do_vfp_dp_sp_cvt (str) } end_of_line (str); - return; } static void @@ -7284,7 +9669,6 @@ do_vfp_sp_dp_cvt (str) } end_of_line (str); - return; } /* Thumb specific routines. */ @@ -7629,7 +10013,7 @@ thumb_mov_compare (str, move) return; } - if (is_immediate_prefix (*str)) + if (move != THUMB_CPY && is_immediate_prefix (*str)) { str++; if (my_get_expression (&inst.reloc.exp, &str)) @@ -7640,7 +10024,7 @@ thumb_mov_compare (str, move) if (Rs != FAIL) { - if (Rs < 8 && Rd < 8) + if (move != THUMB_CPY && Rs < 8 && Rd < 8) { if (move == THUMB_MOVE) /* A move of two lowregs is encoded as ADD Rd, Rs, #0 @@ -7654,7 +10038,7 @@ thumb_mov_compare (str, move) { if (move == THUMB_MOVE) inst.instruction = T_OPCODE_MOV_HR; - else + else if (move != THUMB_CPY) inst.instruction = T_OPCODE_CMP_HR; if (Rd > 7) @@ -8184,7 +10568,7 @@ do_mav_quad_6b (str) REG_TYPE_MVFX); } -/* cfmvsc32 DSPSC,MVFX[15:0]. */ +/* cfmvsc32 DSPSC,MVDX[15:0]. */ static void do_mav_dspsc_1 (str) char * str; @@ -8194,7 +10578,7 @@ do_mav_dspsc_1 (str) /* cfmvsc32. */ if (mav_reg_required_here (&str, -1, REG_TYPE_DSPSC) == FAIL || skip_past_comma (&str) == FAIL - || mav_reg_required_here (&str, 16, REG_TYPE_MVFX) == FAIL) + || mav_reg_required_here (&str, 12, REG_TYPE_MVDX) == FAIL) { if (!inst.error) inst.error = BAD_ARGS; @@ -8205,7 +10589,7 @@ do_mav_dspsc_1 (str) end_of_line (str); } -/* cfmv32sc MVFX[15:0],DSPSC. */ +/* cfmv32sc MVDX[15:0],DSPSC. */ static void do_mav_dspsc_2 (str) char * str; @@ -8213,7 +10597,7 @@ do_mav_dspsc_2 (str) skip_whitespace (str); /* cfmv32sc. */ - if (mav_reg_required_here (&str, 0, REG_TYPE_MVFX) == FAIL + if (mav_reg_required_here (&str, 12, REG_TYPE_MVDX) == FAIL || skip_past_comma (&str) == FAIL || mav_reg_required_here (&str, -1, REG_TYPE_DSPSC) == FAIL) { @@ -8534,7 +10918,7 @@ do_mav_ldst (str, reg0) if (negative) offset = -offset; else - inst.instruction |= CP_T_UD; /* Postive, so set bit U. */ + inst.instruction |= CP_T_UD; /* Positive, so set bit U. */ inst.instruction |= offset >> 2; end_of_line (str); @@ -8543,7 +10927,6 @@ do_mav_ldst (str, reg0) fail_ldst: if (!inst.error) inst.error = BAD_ARGS; - return; } static void @@ -8552,7 +10935,6 @@ do_t_nop (str) { /* Do nothing. */ end_of_line (str); - return; } /* Handle the Format 4 instructions that do not have equivalents in other @@ -8654,7 +11036,7 @@ find_real_start (symbolP) const char * name = S_GET_NAME (symbolP); symbolS * new_target; - /* This definiton must agree with the one in gcc/config/arm/thumb.c. */ + /* This definition must agree with the one in gcc/config/arm/thumb.c. */ #define STUB_NAME ".real_start_of" if (name == NULL) @@ -8926,7 +11308,6 @@ do_t_swi (str) inst.reloc.type = BFD_RELOC_ARM_SWI; end_of_line (str); - return; } static void @@ -9002,20 +11383,29 @@ insert_reg_alias (str, regnum, htab) int regnum; struct hash_control *htab; { - struct reg_entry *new = - (struct reg_entry *) xmalloc (sizeof (struct reg_entry)); - char *name = xmalloc (strlen (str) + 1); - strcpy (name, str); - + const char *error; + struct reg_entry *new = xmalloc (sizeof (struct reg_entry)); + const char *name = xmalloc (strlen (str) + 1); + + strcpy ((char *) name, str); + new->name = name; new->number = regnum; + new->builtin = FALSE; - hash_insert (htab, name, (PTR) new); + error = hash_insert (htab, name, (PTR) new); + if (error) + { + as_bad (_("failed to create an alias for %s, reason: %s"), + str, error); + free ((char *) name); + free (new); + } } /* Look for the .req directive. This is of the form: - newname .req existing_name + new_register_name .req existing_register_name If we find one, or if it looks sufficiently like one that we want to handle any error here, return non-zero. Otherwise return zero. */ @@ -9095,6 +11485,7 @@ create_register_alias (newname, p) *p = c; return 1; } + *p = c; return 0; } @@ -9157,6 +11548,56 @@ build_arm_ops_hsh () } } +#if 0 /* Suppressed - for now. */ +#if defined OBJ_ELF || defined OBJ_COFF + +#ifdef OBJ_ELF +#define arm_Note Elf_External_Note +#else +typedef struct +{ + unsigned char namesz[4]; /* Size of entry's owner string. */ + unsigned char descsz[4]; /* Size of the note descriptor. */ + unsigned char type[4]; /* Interpretation of the descriptor. */ + char name[1]; /* Start of the name+desc data. */ +} arm_Note; +#endif + +/* The description is kept to a fix sized in order to make updating + it and merging it easier. */ +#define ARM_NOTE_DESCRIPTION_LENGTH 8 + +static void +arm_add_note (name, description, type) + const char * name; + const char * description; + unsigned int type; +{ + arm_Note note ATTRIBUTE_UNUSED; + char * p; + unsigned int name_len; + + name_len = (strlen (name) + 1 + 3) & ~3; + + p = frag_more (sizeof (note.namesz)); + md_number_to_chars (p, (valueT) name_len, sizeof (note.namesz)); + + p = frag_more (sizeof (note.descsz)); + md_number_to_chars (p, (valueT) ARM_NOTE_DESCRIPTION_LENGTH, sizeof (note.descsz)); + + p = frag_more (sizeof (note.type)); + md_number_to_chars (p, (valueT) type, sizeof (note.type)); + + p = frag_more (name_len); + strcpy (p, name); + + p = frag_more (ARM_NOTE_DESCRIPTION_LENGTH); + strncpy (p, description, ARM_NOTE_DESCRIPTION_LENGTH); + frag_align (2, 0, 0); +} +#endif +#endif + void md_begin () { @@ -9208,10 +11649,16 @@ md_begin () } else if (mfpu_opt == -1) { +#if !(defined (TE_LINUX) || defined (TE_NetBSD)) + /* Some environments specify a default FPU. If they don't, infer it + from the processor. */ if (mcpu_fpu_opt != -1) mfpu_opt = mcpu_fpu_opt; else mfpu_opt = march_fpu_opt; +#else + mfpu_opt = FPU_DEFAULT; +#endif } if (mfpu_opt == -1) @@ -9239,11 +11686,29 @@ md_begin () if (uses_apcs_float) flags |= F_APCS_FLOAT; if (pic_code) flags |= F_PIC; if ((cpu_variant & FPU_ANY) == FPU_NONE - || (cpu_variant & FPU_ANY) == FPU_ARCH_VFP) /* VFP layout only. */ - flags |= F_SOFT_FLOAT; + || (cpu_variant & FPU_ANY) == FPU_ARCH_VFP) /* VFP layout only. */ + { + flags |= F_SOFT_FLOAT; + } + switch (mfloat_abi_opt) + { + case ARM_FLOAT_ABI_SOFT: + case ARM_FLOAT_ABI_SOFTFP: + flags |= F_SOFT_FLOAT; + break; + + case ARM_FLOAT_ABI_HARD: + if (flags & F_SOFT_FLOAT) + as_bad (_("hard-float conflicts with specified fpu")); + break; + } /* Using VFP conventions (even if soft-float). */ if (cpu_variant & FPU_VFP_EXT_NONE) flags |= F_VFP_FLOAT; +#if defined OBJ_ELF + if (cpu_variant & FPU_ARCH_MAVERICK) + flags |= EF_ARM_MAVERICK_FLOAT; +#endif bfd_set_private_flags (stdoutput, flags); @@ -9283,13 +11748,17 @@ md_begin () break; default: - mach = bfd_mach_arm_4; + mach = bfd_mach_arm_unknown; break; } /* Catch special cases. */ - if (cpu_variant & ARM_CEXT_XSCALE) + if (cpu_variant & ARM_CEXT_IWMMXT) + mach = bfd_mach_arm_iWMMXt; + else if (cpu_variant & ARM_CEXT_XSCALE) mach = bfd_mach_arm_XScale; + else if (cpu_variant & ARM_CEXT_MAVERICK) + mach = bfd_mach_arm_ep9312; else if (cpu_variant & ARM_EXT_V5E) mach = bfd_mach_arm_5TE; else if (cpu_variant & ARM_EXT_V5) @@ -9309,6 +11778,62 @@ md_begin () else if (cpu_variant & ARM_EXT_V3M) mach = bfd_mach_arm_3M; +#if 0 /* Suppressed - for now. */ +#if defined (OBJ_ELF) || defined (OBJ_COFF) + + /* Create a .note section to fully identify this arm binary. */ + +#define NOTE_ARCH_STRING "arch: " + +#if defined OBJ_COFF && ! defined NT_VERSION +#define NT_VERSION 1 +#define NT_ARCH 2 +#endif + + { + segT current_seg = now_seg; + subsegT current_subseg = now_subseg; + asection * arm_arch; + const char * arch_string; + + arm_arch = bfd_make_section_old_way (stdoutput, ARM_NOTE_SECTION); + +#ifdef OBJ_COFF + bfd_set_section_flags (stdoutput, arm_arch, + SEC_DATA | SEC_ALLOC | SEC_LOAD | SEC_LINK_ONCE \ + | SEC_HAS_CONTENTS); +#else + bfd_set_section_flags (stdoutput, arm_arch, + SEC_READONLY | SEC_HAS_CONTENTS); +#endif + arm_arch->output_section = arm_arch; + subseg_set (arm_arch, 0); + + switch (mach) + { + default: + case bfd_mach_arm_unknown: arch_string = "unknown"; break; + case bfd_mach_arm_2: arch_string = "armv2"; break; + case bfd_mach_arm_2a: arch_string = "armv2a"; break; + case bfd_mach_arm_3: arch_string = "armv3"; break; + case bfd_mach_arm_3M: arch_string = "armv3M"; break; + case bfd_mach_arm_4: arch_string = "armv4"; break; + case bfd_mach_arm_4T: arch_string = "armv4t"; break; + case bfd_mach_arm_5: arch_string = "armv5"; break; + case bfd_mach_arm_5T: arch_string = "armv5t"; break; + case bfd_mach_arm_5TE: arch_string = "armv5te"; break; + case bfd_mach_arm_XScale: arch_string = "XScale"; break; + case bfd_mach_arm_ep9312: arch_string = "ep9312"; break; + case bfd_mach_arm_iWMMXt: arch_string = "iWMMXt"; break; + } + + arm_add_note (NOTE_ARCH_STRING, arch_string, NT_ARCH); + + subseg_set (current_seg, current_subseg); + } +#endif +#endif /* Suppressed code. */ + bfd_set_arch_mach (stdoutput, TARGET_ARCH, mach); } @@ -9471,8 +11996,8 @@ md_pcrel_from (fixP) } #ifdef TE_WINCE - /* The pattern was adjusted to accomodate CE's off-by-one fixups, - so we un-adjust here to compensate for the accomodation. */ + /* The pattern was adjusted to accommodate CE's off-by-one fixups, + so we un-adjust here to compensate for the accommodation. */ return fixP->fx_where + fixP->fx_frag->fr_address + 8; #else return fixP->fx_where + fixP->fx_frag->fr_address; @@ -9649,12 +12174,14 @@ md_apply_fix3 (fixP, valP, seg) newimm |= (temp & 0xfffff000); md_number_to_chars (buf, (valueT) newimm, INSN_SIZE); + fixP->fx_done = 1; break; case BFD_RELOC_ARM_ADRL_IMMEDIATE: { unsigned int highpart = 0; unsigned int newinsn = 0xe1a00000; /* nop. */ + newimm = validate_immediate (value); temp = md_chars_to_number (buf, INSN_SIZE); @@ -9679,7 +12206,7 @@ md_apply_fix3 (fixP, valP, seg) { as_bad_where (fixP->fx_file, fixP->fx_line, _("unable to compute ADRL instructions for PC offset of 0x%lx"), - value); + (long) value); break; } @@ -9835,7 +12362,7 @@ md_apply_fix3 (fixP, valP, seg) the absolute address that is the destination of the branch in the 24 bits of the branch instruction. If however, we happen to know that the destination of the branch is in the same section as the - branch instruciton itself, then we can compute the relocation for + branch instruction itself, then we can compute the relocation for ourselves and not have to bother the linker with it. FIXME: The tests for OBJ_ELF and ! target_oabi are only here @@ -10007,10 +12534,6 @@ md_apply_fix3 (fixP, valP, seg) break; #endif - case BFD_RELOC_ARM_GOTPC: - md_number_to_chars (buf, value, 4); - break; - case BFD_RELOC_ARM_CP_OFF_IMM: sign = value >= 0; if (value < -1023 || value > 1023 || (value & 3)) @@ -10023,6 +12546,18 @@ md_apply_fix3 (fixP, valP, seg) md_number_to_chars (buf, newval, INSN_SIZE); break; + case BFD_RELOC_ARM_CP_OFF_IMM_S2: + sign = value >= 0; + if (value < -255 || value > 255) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("Illegal value for co-processor offset")); + if (value < 0) + value = -value; + newval = md_chars_to_number (buf, INSN_SIZE) & 0xff7fff00; + newval |= value | (sign ? INDEX_UP : 0); + md_number_to_chars (buf, newval , INSN_SIZE); + break; + case BFD_RELOC_ARM_THUMB_OFFSET: newval = md_chars_to_number (buf, THUMB_SIZE); /* Exactly what ranges, and where the offset is inserted depends @@ -10045,7 +12580,8 @@ md_apply_fix3 (fixP, valP, seg) if ((value + 2) & ~0x3fe) as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, value too big (0x%08lX)"), value); + _("invalid offset, value too big (0x%08lX)"), + (long) value); /* Round up, since pc will be rounded down. */ newval |= (value + 2) >> 2; @@ -10054,28 +12590,32 @@ md_apply_fix3 (fixP, valP, seg) case 9: /* SP load/store. */ if (value & ~0x3fc) as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, value too big (0x%08lX)"), value); + _("invalid offset, value too big (0x%08lX)"), + (long) value); newval |= value >> 2; break; case 6: /* Word load/store. */ if (value & ~0x7c) as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, value too big (0x%08lX)"), value); + _("invalid offset, value too big (0x%08lX)"), + (long) value); newval |= value << 4; /* 6 - 2. */ break; case 7: /* Byte load/store. */ if (value & ~0x1f) as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, value too big (0x%08lX)"), value); + _("invalid offset, value too big (0x%08lX)"), + (long) value); newval |= value << 6; break; case 8: /* Halfword load/store. */ if (value & ~0x3e) as_bad_where (fixP->fx_file, fixP->fx_line, - _("invalid offset, value too big (0x%08lX)"), value); + _("invalid offset, value too big (0x%08lX)"), + (long) value); newval |= value << 5; /* 6 - 1. */ break; @@ -10254,10 +12794,10 @@ tc_gen_reloc (section, fixp) case BFD_RELOC_ARM_LITERAL: case BFD_RELOC_ARM_HWLITERAL: - /* If this is called then the a literal has been referenced across - a section boundary - possibly due to an implicit dump. */ + /* If this is called then the a literal has + been referenced across a section boundary. */ as_bad_where (fixp->fx_file, fixp->fx_line, - _("literal referenced across section boundary (Implicit dump?)")); + _("literal referenced across section boundary")); return NULL; #ifdef OBJ_ELF @@ -10270,8 +12810,7 @@ tc_gen_reloc (section, fixp) case BFD_RELOC_ARM_IMMEDIATE: as_bad_where (fixp->fx_file, fixp->fx_line, - _("internal relocation (type %d) not fixed up (IMMEDIATE)"), - fixp->fx_r_type); + _("internal relocation (type: IMMEDIATE) not fixed up")); return NULL; case BFD_RELOC_ARM_ADRL_IMMEDIATE: @@ -10280,9 +12819,18 @@ tc_gen_reloc (section, fixp) return NULL; case BFD_RELOC_ARM_OFFSET_IMM: + if (fixp->fx_addsy != NULL + && !S_IS_DEFINED (fixp->fx_addsy) + && S_IS_LOCAL (fixp->fx_addsy)) + { + as_bad_where (fixp->fx_file, fixp->fx_line, + _("undefined local label `%s'"), + S_GET_NAME (fixp->fx_addsy)); + return NULL; + } + as_bad_where (fixp->fx_file, fixp->fx_line, - _("internal_relocation (type %d) not fixed up (OFFSET_IMM)"), - fixp->fx_r_type); + _("internal_relocation (type: OFFSET_IMM) not fixed up")); return NULL; default: @@ -10291,8 +12839,6 @@ tc_gen_reloc (section, fixp) switch (fixp->fx_r_type) { - case BFD_RELOC_ARM_IMMEDIATE: type = "IMMEDIATE"; break; - case BFD_RELOC_ARM_OFFSET_IMM: type = "OFFSET_IMM"; break; case BFD_RELOC_ARM_OFFSET_IMM8: type = "OFFSET_IMM8"; break; case BFD_RELOC_ARM_SHIFT_IMM: type = "SHIFT_IMM"; break; case BFD_RELOC_ARM_SWI: type = "SWI"; break; @@ -10312,7 +12858,7 @@ tc_gen_reloc (section, fixp) } #ifdef OBJ_ELF - if (code == BFD_RELOC_32_PCREL + if ((code == BFD_RELOC_32_PCREL || code == BFD_RELOC_32) && GOT_symbol && fixp->fx_addsy == GOT_symbol) { @@ -10444,6 +12990,7 @@ md_assemble (str) return; } + mapping_state (MAP_THUMB); inst.instruction = opcode->value; inst.size = opcode->size; (*opcode->parms) (p); @@ -10469,6 +13016,7 @@ md_assemble (str) return; } + mapping_state (MAP_ARM); inst.instruction = opcode->value; inst.size = INSN_SIZE; (*opcode->parms) (p); @@ -10505,7 +13053,7 @@ md_assemble (str) -mthumb Start in Thumb mode -mthumb-interwork Code supports ARM/Thumb interworking - For now we will also provide support for + For now we will also provide support for: -mapcs-32 32-bit Program counter -mapcs-26 26-bit Program counter @@ -10680,6 +13228,7 @@ struct arm_option_table arm_opts[] = {"mstrongarm1110", NULL, &legacy_cpu, ARM_ARCH_V4, N_("use -mcpu=strongarm1110")}, {"mxscale", NULL, &legacy_cpu, ARM_ARCH_XSCALE, N_("use -mcpu=xscale")}, + {"miwmmxt", NULL, &legacy_cpu, ARM_ARCH_IWMMXT, N_("use -mcpu=iwmmxt")}, {"mall", NULL, &legacy_cpu, ARM_ANY, N_("use -mcpu=all")}, /* Architecture variants -- don't add any more to this list either. */ @@ -10773,6 +13322,7 @@ static struct arm_cpu_option_table arm_cpus[] = {"arm9e-r0", ARM_ARCH_V5TExP, FPU_ARCH_VFP_V2}, {"arm9e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, {"arm926ej", ARM_ARCH_V5TEJ, FPU_ARCH_VFP_V2}, + {"arm926ejs", ARM_ARCH_V5TEJ, FPU_ARCH_VFP_V2}, {"arm946e-r0", ARM_ARCH_V5TExP, FPU_ARCH_VFP_V2}, {"arm946e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, {"arm966e-r0", ARM_ARCH_V5TExP, FPU_ARCH_VFP_V2}, @@ -10782,11 +13332,16 @@ static struct arm_cpu_option_table arm_cpus[] = {"arm1020", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, {"arm1020t", ARM_ARCH_V5T, FPU_ARCH_VFP_V1}, {"arm1020e", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, + {"arm1026ejs", ARM_ARCH_V5TE, FPU_ARCH_VFP_V2}, + {"arm1136js", ARM_ARCH_V6, FPU_NONE}, + {"arm1136jfs", ARM_ARCH_V6, FPU_ARCH_VFP_V2}, /* ??? XSCALE is really an architecture. */ {"xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP_V2}, + /* ??? iwmmxt is not a processor. */ + {"iwmmxt", ARM_ARCH_IWMMXT, FPU_ARCH_VFP_V2}, {"i80200", ARM_ARCH_XSCALE, FPU_ARCH_VFP_V2}, /* Maverick */ - {"ep9312", ARM_ARCH_V4T | ARM_CEXT_MAVERICK, FPU_NONE}, + {"ep9312", ARM_ARCH_V4T | ARM_CEXT_MAVERICK, FPU_ARCH_MAVERICK}, {NULL, 0, 0} }; @@ -10818,7 +13373,10 @@ static struct arm_arch_option_table arm_archs[] = {"armv5te", ARM_ARCH_V5TE, FPU_ARCH_VFP}, {"armv5texp", ARM_ARCH_V5TExP, FPU_ARCH_VFP}, {"armv5tej", ARM_ARCH_V5TEJ, FPU_ARCH_VFP}, + {"armv6", ARM_ARCH_V6, FPU_ARCH_VFP}, + {"armv6j", ARM_ARCH_V6, FPU_ARCH_VFP}, {"xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP}, + {"iwmmxt", ARM_ARCH_IWMMXT, FPU_ARCH_VFP}, {NULL, 0, 0} }; @@ -10833,6 +13391,7 @@ static struct arm_arch_extension_table arm_extensions[] = { {"maverick", ARM_CEXT_MAVERICK}, {"xscale", ARM_CEXT_XSCALE}, + {"iwmmxt", ARM_CEXT_IWMMXT}, {NULL, 0} }; @@ -10863,6 +13422,22 @@ static struct arm_fpu_option_table arm_fpus[] = {"vfpxd", FPU_ARCH_VFP_V1xD}, {"arm1020t", FPU_ARCH_VFP_V1}, {"arm1020e", FPU_ARCH_VFP_V2}, + {"arm1136jfs", FPU_ARCH_VFP_V2}, + {"maverick", FPU_ARCH_MAVERICK}, + {NULL, 0} +}; + +struct arm_float_abi_option_table +{ + char *name; + int value; +}; + +static struct arm_float_abi_option_table arm_float_abis[] = +{ + {"hard", ARM_FLOAT_ABI_HARD}, + {"softfp", ARM_FLOAT_ABI_SOFTFP}, + {"soft", ARM_FLOAT_ABI_SOFT}, {NULL, 0} }; @@ -11012,6 +13587,23 @@ arm_parse_fpu (str) return 0; } +static int +arm_parse_float_abi (str) + char * str; +{ + struct arm_float_abi_option_table *opt; + + for (opt = arm_float_abis; opt->name != NULL; opt++) + if (strcmp (opt->name, str) == 0) + { + mfloat_abi_opt = opt->value; + return 1; + } + + as_bad (_("unknown floating point abi `%s'\n"), str); + return 0; +} + struct arm_long_option_table arm_long_opts[] = { {"mcpu=", N_("\t assemble for CPU "), @@ -11020,6 +13612,8 @@ struct arm_long_option_table arm_long_opts[] = arm_parse_arch, NULL}, {"mfpu=", N_("\t assemble for FPU architecture "), arm_parse_fpu, NULL}, + {"mfloat-abi=", N_("\t assemble for floating point ABI "), + arm_parse_float_abi, NULL}, {NULL, NULL, 0, NULL} }; @@ -11165,8 +13759,6 @@ fix_new_arm (frag, where, size, exp, pc_rel, reloc) arm_data = (arm_fix_data *) obstack_alloc (& notes, sizeof (arm_fix_data)); new_fix->tc_fix_data = (PTR) arm_data; arm_data->thumb_mode = thumb_mode; - - return; } /* This fix_new is called by cons via TC_CONS_FIX_NEW. */ @@ -11210,12 +13802,17 @@ cons_fix_new_arm (frag, where, size, exp) void arm_cleanup () { - if (current_poolP == NULL) - return; + literal_pool * pool; - /* Put it at the end of text section. */ - subseg_set (text_section, 0); - s_ltorg (0); + for (pool = list_of_pools; pool; pool = pool->next) + { + /* Put it at the end of the relevent section. */ + subseg_set (pool->section, pool->sub_section); +#ifdef OBJ_ELF + arm_elf_change_section (); +#endif + s_ltorg (0); + } } void @@ -11276,7 +13873,7 @@ arm_frob_label (sym) THUMB_SET_FUNC (sym, 1); - label_is_thumb_function_name = false; + label_is_thumb_function_name = FALSE; } } @@ -11380,7 +13977,8 @@ arm_canonicalize_symbol_name (name) return name; } -boolean +#if defined OBJ_COFF || defined OBJ_ELF +void arm_validate_fix (fixP) fixS * fixP; { @@ -11394,10 +13992,33 @@ arm_validate_fix (fixP) && ! THUMB_IS_FUNC (fixP->fx_addsy)) { fixP->fx_addsy = find_real_start (fixP->fx_addsy); - return true; } +} +#endif + +int +arm_force_relocation (fixp) + struct fix * fixp; +{ +#if defined (OBJ_COFF) && defined (TE_PE) + if (fixp->fx_r_type == BFD_RELOC_RVA) + return 1; +#endif +#ifdef OBJ_ELF + if (fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BRANCH + || fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BLX + || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX + || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BRANCH23) + return 1; +#endif + + /* Resolve these relocations even if the symbol is extern or weak. */ + if (fixp->fx_r_type == BFD_RELOC_ARM_IMMEDIATE + || fixp->fx_r_type == BFD_RELOC_ARM_OFFSET_IMM + || fixp->fx_r_type == BFD_RELOC_ARM_ADRL_IMMEDIATE) + return 0; - return false; + return generic_force_reloc (fixp); } #ifdef OBJ_COFF @@ -11407,7 +14028,7 @@ arm_validate_fix (fixP) be resolved before the binbary is emitted, so it is safe to say that it is adjustable. */ -boolean +bfd_boolean arm_fix_adjustable (fixP) fixS * fixP; { @@ -11416,6 +14037,7 @@ arm_fix_adjustable (fixP) return 0; } #endif + #ifdef OBJ_ELF /* Relocations against Thumb function names must be left unadjusted, so that the linker can use this information to correctly set the @@ -11430,20 +14052,13 @@ arm_fix_adjustable (fixP) addresses also ought to have their bottom bit set (assuming that they reside in Thumb code), but at the moment they will not. */ -boolean +bfd_boolean arm_fix_adjustable (fixP) fixS * fixP; { if (fixP->fx_addsy == NULL) return 1; - /* Prevent all adjustments to global symbols. */ - if (S_IS_EXTERN (fixP->fx_addsy)) - return 0; - - if (S_IS_WEAK (fixP->fx_addsy)) - return 0; - if (THUMB_IS_FUNC (fixP->fx_addsy) && fixP->fx_subsy == NULL) return 0; @@ -11453,6 +14068,12 @@ arm_fix_adjustable (fixP) || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) return 0; + /* Don't allow symbols to be discarded on GOT related relocs. */ + if (fixP->fx_r_type == BFD_RELOC_ARM_PLT32 + || fixP->fx_r_type == BFD_RELOC_ARM_GOT32 + || fixP->fx_r_type == BFD_RELOC_ARM_GOTOFF) + return 0; + return 1; } @@ -11483,21 +14104,6 @@ armelf_frob_symbol (symp, puntp) elf_frob_symbol (symp, puntp); } -int -arm_force_relocation (fixp) - struct fix * fixp; -{ - if ( fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT - || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY - || fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BRANCH - || fixp->fx_r_type == BFD_RELOC_ARM_PCREL_BLX - || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX - || fixp->fx_r_type == BFD_RELOC_THUMB_PCREL_BRANCH23) - return 1; - - return 0; -} - static bfd_reloc_code_real_type arm_parse_reloc () { @@ -11556,6 +14162,7 @@ s_arm_elf_cons (nbytes) md_cons_align (nbytes); #endif + mapping_state (MAP_DATA); do { bfd_reloc_code_real_type reloc; @@ -11666,7 +14273,7 @@ arm_frag_align_code (n, max) { char * p; - /* We assume that there will never be a requirment + /* We assume that there will never be a requirement to support alignments greater than 32 bytes. */ if (max > MAX_MEM_FOR_RS_ALIGN_CODE) as_fatal (_("alignments greater than 32 bytes not supported in .text sections.")); diff --git a/contrib/binutils/gas/config/tc-arm.h b/contrib/binutils/gas/config/tc-arm.h index 2de9674..4e791a0 100644 --- a/contrib/binutils/gas/config/tc-arm.h +++ b/contrib/binutils/gas/config/tc-arm.h @@ -1,5 +1,5 @@ /* This file is tc-arm.h - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Modified by David Taylor (dtaylor@armltd.co.uk) @@ -47,64 +47,47 @@ #define LITTLE_ENDIAN 1234 #define BIG_ENDIAN 4321 -#if defined OBJ_AOUT -#if defined TE_RISCIX -# define TARGET_FORMAT "a.out-riscix" -#elif defined TE_LINUX -# define ARM_BI_ENDIAN -# define TARGET_FORMAT "a.out-arm-linux" -#elif defined TE_NetBSD -# define TARGET_FORMAT "a.out-arm-netbsd" -#else -# define ARM_BI_ENDIAN -# define TARGET_FORMAT \ - (target_big_endian ? "a.out-arm-big" : "a.out-arm-little") -#endif -#endif /* OBJ_AOUT */ - -#ifdef OBJ_AIF -#define TARGET_FORMAT "aif" -#endif +struct fix; -#if defined OBJ_COFF || defined OBJ_ELF +#if defined OBJ_AOUT +# if defined TE_RISCIX +# define TARGET_FORMAT "a.out-riscix" +# elif defined TE_LINUX +# define ARM_BI_ENDIAN +# define TARGET_FORMAT "a.out-arm-linux" +# elif defined TE_NetBSD +# define TARGET_FORMAT "a.out-arm-netbsd" +# else +# define ARM_BI_ENDIAN +# define TARGET_FORMAT (target_big_endian ? "a.out-arm-big" : "a.out-arm-little") +# endif +#elif defined OBJ_AIF +# define TARGET_FORMAT "aif" +#elif defined OBJ_COFF # define ARM_BI_ENDIAN - -# define TC_VALIDATE_FIX(fixP, segType, Label) \ - if (arm_validate_fix (fixP)) add_symbolP = fixP->fx_addsy - extern boolean arm_validate_fix PARAMS ((struct fix *)); -#endif - -#ifdef OBJ_COFF # if defined TE_PE -# define TC_FORCE_RELOCATION(x) ((x)->fx_r_type == BFD_RELOC_RVA) -# ifdef TE_EPOC -# define TARGET_FORMAT (target_big_endian ? "epoc-pe-arm-big" : "epoc-pe-arm-little") -# else -# define TARGET_FORMAT (target_big_endian ? "pe-arm-big" : "pe-arm-little") -# endif +# if defined TE_EPOC +# define TARGET_FORMAT (target_big_endian ? "epoc-pe-arm-big" : "epoc-pe-arm-little") +# else +# define TARGET_FORMAT (target_big_endian ? "pe-arm-big" : "pe-arm-little") +# endif # else # define TARGET_FORMAT (target_big_endian ? "coff-arm-big" : "coff-arm-little") # endif +#elif defined OBJ_ELF +# define ARM_BI_ENDIAN +# define TARGET_FORMAT elf32_arm_target_format () #endif -#ifdef OBJ_ELF -# define TARGET_FORMAT elf32_arm_target_format() - extern const char * elf32_arm_target_format PARAMS ((void)); - -# define TC_FORCE_RELOCATION(fixp) arm_force_relocation (fixp) - extern int arm_force_relocation PARAMS ((struct fix *)); -#endif +#define TC_FORCE_RELOCATION(FIX) arm_force_relocation (FIX) -#define md_convert_frag(b, s, f) {as_fatal (_("arm convert_frag\n"));} +#define md_convert_frag(b, s, f) { as_fatal (_("arm convert_frag\n")); } #define md_cleanup() arm_cleanup () - extern void arm_cleanup PARAMS ((void)); #define md_start_line_hook() arm_start_line_hook () - extern void arm_start_line_hook PARAMS ((void)); #define tc_frob_label(S) arm_frob_label (S) - extern void arm_frob_label PARAMS ((symbolS *)); /* We also need to mark assembler created symbols: */ #define tc_frob_fake_label(S) arm_frob_label (S) @@ -114,29 +97,17 @@ symbols as Thumb. */ #define TC_FIX_TYPE PTR -#define TC_INIT_FIX_DATA(FIXP) ((FIXP)->tc_fix_data = NULL) - -#if defined OBJ_ELF || defined OBJ_COFF -#include "write.h" /* For definition of fixS */ -#define obj_fix_adjustable(fixP) arm_fix_adjustable (fixP) -boolean arm_fix_adjustable PARAMS ((fixS *)); - -/* This arranges for gas/write.c to not apply a relocation if - obj_fix_adjustable() says it is not adjustable. */ -#define TC_FIX_ADJUSTABLE(fixP) obj_fix_adjustable (fixP) -#else -#define obj_fix_adjustable(fixP) 0 -#endif +#define TC_INIT_FIX_DATA(FIX) ((FIX)->tc_fix_data = NULL) /* We need to keep some local information on symbols. */ -#define TC_SYMFIELD_TYPE unsigned int +#define TC_SYMFIELD_TYPE unsigned int #define ARM_GET_FLAG(s) (*symbol_get_tc (s)) #define ARM_SET_FLAG(s,v) (*symbol_get_tc (s) |= (v)) #define ARM_RESET_FLAG(s,v) (*symbol_get_tc (s) &= ~(v)) #define ARM_FLAG_THUMB (1 << 0) /* The symbol is a Thumb symbol rather than an Arm symbol. */ -#define ARM_FLAG_INTERWORK (1 << 1) /* The symbol is attached to code that suppports interworking. */ +#define ARM_FLAG_INTERWORK (1 << 1) /* The symbol is attached to code that supports interworking. */ #define THUMB_FLAG_FUNC (1 << 2) /* The symbol is attached to the start of a Thumb function. */ #define ARM_IS_THUMB(s) (ARM_GET_FLAG (s) & ARM_FLAG_THUMB) @@ -147,23 +118,10 @@ boolean arm_fix_adjustable PARAMS ((fixS *)); #define ARM_SET_INTERWORK(s,t) ((t) ? ARM_SET_FLAG (s, ARM_FLAG_INTERWORK) : ARM_RESET_FLAG (s, ARM_FLAG_INTERWORK)) #define THUMB_SET_FUNC(s,t) ((t) ? ARM_SET_FLAG (s, THUMB_FLAG_FUNC) : ARM_RESET_FLAG (s, THUMB_FLAG_FUNC)) -#define TC_START_LABEL(C,STR) \ - (c == ':' || (c == '/' && arm_data_in_code ())) -int arm_data_in_code PARAMS ((void)); - -#define tc_canonicalize_symbol_name(str) \ - arm_canonicalize_symbol_name (str); -char * arm_canonicalize_symbol_name PARAMS ((char *)); - -#define obj_adjust_symtab() arm_adjust_symtab () - extern void arm_adjust_symtab PARAMS ((void)); - -#ifdef OBJ_ELF -#define obj_frob_symbol(sym, punt) armelf_frob_symbol ((sym), & (punt)) -void armelf_frob_symbol PARAMS ((symbolS *, int *)); -#endif - -#define tc_aout_pre_write_hook(x) {;} /* not used */ +#define TC_START_LABEL(C,STR) (c == ':' || (c == '/' && arm_data_in_code ())) +#define tc_canonicalize_symbol_name(str) arm_canonicalize_symbol_name (str); +#define obj_adjust_symtab() arm_adjust_symtab () +#define tc_aout_pre_write_hook(x) {;} /* not used */ #define LISTING_HEADER "ARM GAS " @@ -171,55 +129,32 @@ void armelf_frob_symbol PARAMS ((symbolS *, int *)); #define LOCAL_LABEL(name) (name[0] == '.' && (name[1] == 'L')) #define LOCAL_LABELS_FB 1 -#ifdef OBJ_ELF -#define LOCAL_LABEL_PREFIX '.' -#endif -/* 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, so GOTOFF does not need to be - checked here. I am not sure if some of the others are ever used with +/* This expression evaluates to true if the relocation is for a local + object for which we still want to do the relocation at runtime. + False if we are willing to perform this relocation while building + the .o file. GOTOFF does not need to be checked here because it is + not pcrel. I am not sure if some of the others are ever used with pcrel, but it is easier to be safe than sorry. */ -#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ - ( (FIX)->fx_r_type != BFD_RELOC_ARM_GOT12 \ - && (FIX)->fx_r_type != BFD_RELOC_ARM_GOT32 \ - && (FIX)->fx_r_type != BFD_RELOC_32) +#define TC_FORCE_RELOCATION_LOCAL(FIX) \ + (!(FIX)->fx_pcrel \ + || (FIX)->fx_plt \ + || (FIX)->fx_r_type == BFD_RELOC_ARM_GOT12 \ + || (FIX)->fx_r_type == BFD_RELOC_ARM_GOT32 \ + || (FIX)->fx_r_type == BFD_RELOC_32 \ + || TC_FORCE_RELOCATION (FIX)) #define TC_CONS_FIX_NEW cons_fix_new_arm - extern void cons_fix_new_arm PARAMS ((fragS *, int, int, expressionS *)); - -/* Don't allow symbols to be discarded on GOT related relocs, - nor on globals. */ -#define tc_fix_adjustable(x) (\ - ((x)->fx_r_type == BFD_RELOC_ARM_PLT32 \ - || (x)->fx_r_type == BFD_RELOC_ARM_GOT32 \ - || (x)->fx_r_type == BFD_RELOC_ARM_GOTOFF \ - || S_IS_EXTERN ((x)->fx_addsy) \ - || S_IS_WEAK ((x)->fx_addsy)) ? 0 : 1) - -#ifdef OBJ_ELF -#define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_" -#else -#define GLOBAL_OFFSET_TABLE_NAME "__GLOBAL_OFFSET_TABLE_" -#endif - -#ifdef OBJ_ELF -#define DWARF2_LINE_MIN_INSN_LENGTH 2 -#endif #define MAX_MEM_FOR_RS_ALIGN_CODE 31 /* For frags in code sections we need to record whether they contain ARM code or THUMB code. This is that if they have to be aligned, they can contain the correct type of no-op instruction. */ -#define TC_FRAG_TYPE int +#define TC_FRAG_TYPE int #define TC_FRAG_INIT(fragp) arm_init_frag (fragp) -extern void arm_init_frag PARAMS ((struct frag *)); - -#define HANDLE_ALIGN(fragp) arm_handle_align (fragp) -extern void arm_handle_align PARAMS ((struct frag *)); +#define HANDLE_ALIGN(fragp) arm_handle_align (fragp) #define md_do_align(N, FILL, LEN, MAX, LABEL) \ if (FILL == NULL && (N) != 0 && ! need_pass_2 && subseg_text_p (now_seg)) \ @@ -227,4 +162,50 @@ extern void arm_handle_align PARAMS ((struct frag *)); arm_frag_align_code (N, MAX); \ goto LABEL; \ } -extern void arm_frag_align_code PARAMS ((int, int)); + +#ifdef OBJ_ELF +# define DWARF2_LINE_MIN_INSN_LENGTH 2 +# define obj_frob_symbol(sym, punt) armelf_frob_symbol ((sym), & (punt)) +# define md_elf_section_change_hook() arm_elf_change_section () +# define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_" +# define LOCAL_LABEL_PREFIX '.' +# define TC_SEGMENT_INFO_TYPE enum mstate + +enum mstate +{ + MAP_UNDEFINED = 0, /* Must be zero, for seginfo in new sections. */ + MAP_DATA, + MAP_ARM, + MAP_THUMB +}; + +#else /* Not OBJ_ELF. */ +#define GLOBAL_OFFSET_TABLE_NAME "__GLOBAL_OFFSET_TABLE_" +#endif + +#if defined OBJ_ELF || defined OBJ_COFF + +# define EXTERN_FORCE_RELOC 1 +# define tc_fix_adjustable(FIX) arm_fix_adjustable (FIX) +/* Values passed to md_apply_fix3 don't include the symbol value. */ +# define MD_APPLY_SYM_VALUE(FIX) 0 +# define TC_VALIDATE_FIX(FIX, SEGTYPE, LABEL) arm_validate_fix (FIX) + +#endif + +extern void arm_frag_align_code (int, int); +extern void arm_validate_fix (struct fix *); +extern const char * elf32_arm_target_format (void); +extern void arm_elf_change_section (void); +extern int arm_force_relocation (struct fix *); +extern void arm_cleanup (void); +extern void arm_start_line_hook (void); +extern void arm_frob_label (symbolS *); +extern int arm_data_in_code (void); +extern char * arm_canonicalize_symbol_name (char *); +extern void arm_adjust_symtab (void); +extern void armelf_frob_symbol (symbolS *, int *); +extern void cons_fix_new_arm (fragS *, int, int, expressionS *); +extern void arm_init_frag (struct frag *); +extern void arm_handle_align (struct frag *); +extern bfd_boolean arm_fix_adjustable (struct fix *); diff --git a/contrib/binutils/gas/config/tc-i386.c b/contrib/binutils/gas/config/tc-i386.c index fc1bd13..5de6a55 100644 --- a/contrib/binutils/gas/config/tc-i386.c +++ b/contrib/binutils/gas/config/tc-i386.c @@ -1,6 +1,6 @@ /* i386.c -- Assemble code for the Intel 80386 Copyright 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002 + 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -23,6 +23,7 @@ /* Intel 80386 machine specific gas. Written by Eliot Dresselhaus (eliot@mgm.mit.edu). x86_64 support by Jan Hubicka (jh@suse.cz) + VIA PadLock support by Michal Ludvig (mludvig@suse.cz) Bugs & suggestions are completely welcome. This is free software. Please help us make it better. */ @@ -30,6 +31,7 @@ #include "safe-ctype.h" #include "subsegs.h" #include "dwarf2dbg.h" +#include "dw2gencfi.h" #include "opcode/i386.h" #ifndef REGISTER_WARNINGS @@ -48,12 +50,6 @@ #define SCALE1_WHEN_NO_INDEX 1 #endif -#ifdef BFD_ASSEMBLER -#define RELOC_ENUM enum bfd_reloc_code_real -#else -#define RELOC_ENUM int -#endif - #ifndef DEFAULT_ARCH #define DEFAULT_ARCH "i386" #endif @@ -154,7 +150,7 @@ struct _i386_insn #define Operand_PCrel 1 /* Relocation type for operand */ - RELOC_ENUM reloc[MAX_OPERANDS]; + enum bfd_reloc_code_real reloc[MAX_OPERANDS]; /* BASE_REG, INDEX_REG, and LOG2_SCALE_FACTOR are used to encode the base index byte below. */ @@ -207,7 +203,7 @@ const char comment_chars[] = "#/"; #NO_APP at the beginning of its output. Also note that comments started like this one will always work if '/' isn't otherwise defined. */ -const char line_comment_chars[] = ""; +const char line_comment_chars[] = "#"; #else /* Putting '/' here makes it impossible to use the divide operator. @@ -215,7 +211,7 @@ const char line_comment_chars[] = ""; const char comment_chars[] = "#"; #define PREFIX_SEPARATOR '/' -const char line_comment_chars[] = "/"; +const char line_comment_chars[] = "/#"; #endif const char line_separator_chars[] = ";"; @@ -244,7 +240,7 @@ static char digit_chars[256]; #define is_identifier_char(x) (identifier_chars[(unsigned char) x]) #define is_digit_char(x) (digit_chars[(unsigned char) x]) -/* All non-digit non-letter charcters that may occur in an operand. */ +/* All non-digit non-letter characters that may occur in an operand. */ static char operand_special_chars[] = "%$-+(,)*._~/<>|&^!:[@]"; /* md_assemble() always leaves the strings it's passed unaltered. To @@ -302,6 +298,9 @@ static int allow_naked_reg = 0; frame as in 32 bit mode. */ static char stackop_size = '\0'; +/* Non-zero to optimize code alignment. */ +int optimize_align_code = 1; + /* Non-zero to quieten some warnings. */ static int quiet_warnings = 0; @@ -318,6 +317,12 @@ static unsigned int no_cond_jump_promotion = 0; /* Pre-defined "_GLOBAL_OFFSET_TABLE_". */ symbolS *GOT_symbol; +/* The dwarf2 return column, adjusted for 32 or 64 bit. */ +unsigned int x86_dwarf2_return_column; + +/* The dwarf2 data alignment, adjusted for 32 or 64 bit. */ +int x86_cie_data_alignment; + /* Interface to relax_segment. There are 3 major relax states for 386 jump insns because the different types of jumps add different sizes to frags when we're @@ -523,26 +528,45 @@ i386_align_code (fragP, count) f32_15, f32_15, f32_15, f32_15, f32_15, f32_15, f32_15 }; - /* ??? We can't use these fillers for x86_64, since they often kills the - upper halves. Solve later. */ - if (flag_code == CODE_64BIT) - count = 1; + if (count <= 0 || count > 15) + return; - if (count > 0 && count <= 15) + /* The recommended way to pad 64bit code is to use NOPs preceded by + maximally four 0x66 prefixes. Balance the size of nops. */ + if (flag_code == CODE_64BIT) { - if (flag_code == CODE_16BIT) + int i; + int nnops = (count + 3) / 4; + int len = count / nnops; + int remains = count - nnops * len; + int pos = 0; + + for (i = 0; i < remains; i++) { - memcpy (fragP->fr_literal + fragP->fr_fix, - f16_patt[count - 1], count); - if (count > 8) - /* Adjust jump offset. */ - fragP->fr_literal[fragP->fr_fix + 1] = count - 2; + memset (fragP->fr_literal + fragP->fr_fix + pos, 0x66, len); + fragP->fr_literal[fragP->fr_fix + pos + len] = 0x90; + pos += len + 1; + } + for (; i < nnops; i++) + { + memset (fragP->fr_literal + fragP->fr_fix + pos, 0x66, len - 1); + fragP->fr_literal[fragP->fr_fix + pos + len - 1] = 0x90; + pos += len; } - else - memcpy (fragP->fr_literal + fragP->fr_fix, - f32_patt[count - 1], count); - fragP->fr_var = count; } + else + if (flag_code == CODE_16BIT) + { + memcpy (fragP->fr_literal + fragP->fr_fix, + f16_patt[count - 1], count); + if (count > 8) + /* Adjust jump offset. */ + fragP->fr_literal[fragP->fr_fix + 1] = count - 2; + } + else + memcpy (fragP->fr_literal + fragP->fr_fix, + f32_patt[count - 1], count); + fragP->fr_var = count; } static INLINE unsigned int @@ -776,15 +800,8 @@ set_intel_syntax (syntax_flag) intel_syntax = syntax_flag; if (ask_naked_reg == 0) - { -#ifdef BFD_ASSEMBLER - allow_naked_reg = (intel_syntax - && (bfd_get_symbol_leading_char (stdoutput) != '\0')); -#else - /* Conservative default. */ - allow_naked_reg = 0; -#endif - } + allow_naked_reg = (intel_syntax + && (bfd_get_symbol_leading_char (stdoutput) != '\0')); else allow_naked_reg = (ask_naked_reg < 0); } @@ -839,7 +856,6 @@ set_cpu_arch (dummy) demand_empty_rest_of_line (); } -#ifdef BFD_ASSEMBLER unsigned long i386_mach () { @@ -850,7 +866,6 @@ i386_mach () else as_fatal (_("Unknown architecture")); } -#endif void md_begin () @@ -967,6 +982,17 @@ md_begin () record_alignment (bss_section, 2); } #endif + + if (flag_code == CODE_64BIT) + { + x86_dwarf2_return_column = 16; + x86_cie_data_alignment = -8; + } + else + { + x86_dwarf2_return_column = 8; + x86_cie_data_alignment = -4; + } } void @@ -1132,7 +1158,6 @@ pt (t) #endif /* DEBUG386 */ -#ifdef BFD_ASSEMBLER static bfd_reloc_code_real_type reloc PARAMS ((int, int, int, bfd_reloc_code_real_type)); @@ -1194,15 +1219,17 @@ tc_i386_fix_adjustable (fixP) if (OUTPUT_FLAVOR != bfd_target_elf_flavour) return 1; - /* Prevent all adjustments to global symbols, or else dynamic - linking will not work correctly. */ - if (S_IS_EXTERNAL (fixP->fx_addsy) - || S_IS_WEAK (fixP->fx_addsy) - /* Don't adjust pc-relative references to merge sections in 64-bit - mode. */ - || (use_rela_relocations - && (S_GET_SEGMENT (fixP->fx_addsy)->flags & SEC_MERGE) != 0 - && fixP->fx_pcrel)) + /* Don't adjust pc-relative references to merge sections in 64-bit + mode. */ + if (use_rela_relocations + && (S_GET_SEGMENT (fixP->fx_addsy)->flags & SEC_MERGE) != 0 + && fixP->fx_pcrel) + return 0; + + /* The x86_64 GOTPCREL are represented as 32bit PCrel relocations + and changed later by validate_fix. */ + if (GOT_symbol && fixP->fx_subsy == GOT_symbol + && fixP->fx_r_type == BFD_RELOC_32_PCREL) return 0; /* adjust_reloc_syms doesn't know about the GOT. */ @@ -1220,35 +1247,17 @@ tc_i386_fix_adjustable (fixP) || fixP->fx_r_type == BFD_RELOC_X86_64_PLT32 || fixP->fx_r_type == BFD_RELOC_X86_64_GOT32 || fixP->fx_r_type == BFD_RELOC_X86_64_GOTPCREL + || fixP->fx_r_type == BFD_RELOC_X86_64_TLSGD + || fixP->fx_r_type == BFD_RELOC_X86_64_TLSLD + || fixP->fx_r_type == BFD_RELOC_X86_64_DTPOFF32 + || fixP->fx_r_type == BFD_RELOC_X86_64_GOTTPOFF + || fixP->fx_r_type == BFD_RELOC_X86_64_TPOFF32 || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) return 0; #endif return 1; } -#else -#define reloc(SIZE,PCREL,SIGN,OTHER) 0 -#define BFD_RELOC_8 0 -#define BFD_RELOC_16 0 -#define BFD_RELOC_32 0 -#define BFD_RELOC_8_PCREL 0 -#define BFD_RELOC_16_PCREL 0 -#define BFD_RELOC_32_PCREL 0 -#define BFD_RELOC_386_PLT32 0 -#define BFD_RELOC_386_GOT32 0 -#define BFD_RELOC_386_GOTOFF 0 -#define BFD_RELOC_386_TLS_GD 0 -#define BFD_RELOC_386_TLS_LDM 0 -#define BFD_RELOC_386_TLS_LDO_32 0 -#define BFD_RELOC_386_TLS_IE_32 0 -#define BFD_RELOC_386_TLS_IE 0 -#define BFD_RELOC_386_TLS_GOTIE 0 -#define BFD_RELOC_386_TLS_LE_32 0 -#define BFD_RELOC_386_TLS_LE 0 -#define BFD_RELOC_X86_64_PLT32 0 -#define BFD_RELOC_X86_64_GOT32 0 -#define BFD_RELOC_X86_64_GOTPCREL 0 -#endif static int intel_float_operand PARAMS ((const char *mnemonic)); @@ -1367,13 +1376,28 @@ md_assemble (line) if (i.tm.opcode_modifier & ImmExt) { + expressionS *exp; + + if ((i.tm.cpu_flags & CpuPNI) && i.operands > 0) + { + /* These Intel Prescott New Instructions have the fixed + operands with an opcode suffix which is coded in the same + place as an 8-bit immediate field would be. Here we check + those operands and remove them afterwards. */ + unsigned int x; + + for (x = 0; x < i.operands; x++) + if (i.op[x].regs->reg_num != x) + as_bad (_("can't use register '%%%s' as operand %d in '%s'."), + i.op[x].regs->reg_name, x + 1, i.tm.name); + i.operands = 0; + } + /* These AMD 3DNow! and Intel Katmai New Instructions have an opcode suffix which is coded in the same place as an 8-bit immediate field would be. Here we fake an 8-bit immediate operand from the opcode suffix stored in tm.extension_opcode. */ - expressionS *exp; - assert (i.imm_operands == 0 && i.operands <= 2 && 2 < MAX_OPERANDS); exp = &im_expressions[i.imm_operands++]; @@ -1758,7 +1782,7 @@ swap_operands () { union i386_op temp_op; unsigned int temp_type; - RELOC_ENUM temp_reloc; + enum bfd_reloc_code_real temp_reloc; int xchg1 = 0; int xchg2 = 0; @@ -3100,7 +3124,6 @@ output_interseg_jump () md_number_to_chars (p + size, (valueT) i.op[0].imms->X_add_number, 2); } - static void output_insn () { @@ -3128,10 +3151,23 @@ output_insn () char *p; unsigned char *q; - /* All opcodes on i386 have either 1 or 2 bytes. We may use third - byte for the SSE instructions to specify a prefix they require. */ - if (i.tm.base_opcode & 0xff0000) - add_prefix ((i.tm.base_opcode >> 16) & 0xff); + /* All opcodes on i386 have either 1 or 2 bytes, PadLock instructions + have 3 bytes. We may use one more higher byte to specify a prefix + the instruction requires. */ + if ((i.tm.cpu_flags & CpuPadLock) != 0 + && (i.tm.base_opcode & 0xff000000) != 0) + { + unsigned int prefix; + prefix = (i.tm.base_opcode >> 24) & 0xff; + + if (prefix != REPE_PREFIX_OPCODE + || i.prefix[LOCKREP_PREFIX] != REPE_PREFIX_OPCODE) + add_prefix (prefix); + } + else + if ((i.tm.cpu_flags & CpuPadLock) == 0 + && (i.tm.base_opcode & 0xff0000) != 0) + add_prefix ((i.tm.base_opcode >> 16) & 0xff); /* The prefix bytes. */ for (q = i.prefix; @@ -3152,7 +3188,14 @@ output_insn () } else { - p = frag_more (2); + if ((i.tm.cpu_flags & CpuPadLock) != 0) + { + p = frag_more (3); + *p++ = (i.tm.base_opcode >> 16) & 0xff; + } + else + p = frag_more (2); + /* Put out high byte first: can't use md_number_to_chars! */ *p++ = (i.tm.base_opcode >> 8) & 0xff; *p = i.tm.base_opcode & 0xff; @@ -3232,7 +3275,7 @@ output_disp (insn_start_frag, insn_start_off) } else { - RELOC_ENUM reloc_type; + enum bfd_reloc_code_real reloc_type; int size = 4; int sign = 0; int pcrel = (i.flags[n] & Operand_PCrel) != 0; @@ -3276,7 +3319,6 @@ output_disp (insn_start_frag, insn_start_off) p = frag_more (size); reloc_type = reloc (size, pcrel, sign, i.reloc[n]); -#ifdef BFD_ASSEMBLER if (reloc_type == BFD_RELOC_32 && GOT_symbol && GOT_symbol == i.op[n].disps->X_add_symbol @@ -3307,7 +3349,6 @@ output_disp (insn_start_frag, insn_start_off) reloc_type = BFD_RELOC_386_GOTPC; i.op[n].disps->X_add_number += add; } -#endif fix_new_exp (frag_now, p - frag_now->fr_literal, size, i.op[n].disps, pcrel, reloc_type); } @@ -3352,7 +3393,7 @@ output_imm (insn_start_frag, insn_start_off) Need a 32-bit fixup (don't support 8bit non-absolute imms). Try to support other sizes ... */ - RELOC_ENUM reloc_type; + enum bfd_reloc_code_real reloc_type; int size = 4; int sign = 0; @@ -3370,7 +3411,7 @@ output_imm (insn_start_frag, insn_start_off) p = frag_more (size); reloc_type = reloc (size, 0, sign, i.reloc[n]); -#ifdef BFD_ASSEMBLER + /* This is tough to explain. We end up with this one if we * have operands that look like * "_GLOBAL_OFFSET_TABLE_+[.-.L284]". The goal here is to @@ -3443,7 +3484,6 @@ output_imm (insn_start_frag, insn_start_off) reloc_type = BFD_RELOC_386_GOTPC; i.op[n].imms->X_add_number += add; } -#endif fix_new_exp (frag_now, p - frag_now->fr_literal, size, i.op[n].imms, 0, reloc_type); } @@ -3452,7 +3492,7 @@ output_imm (insn_start_frag, insn_start_off) } #ifndef LEX_AT -static char *lex_got PARAMS ((RELOC_ENUM *, int *)); +static char *lex_got PARAMS ((enum bfd_reloc_code_real *, int *)); /* Parse operands of the form @GOTOFF+ @@ -3465,23 +3505,24 @@ static char *lex_got PARAMS ((RELOC_ENUM *, int *)); input line. Otherwise return NULL. */ static char * lex_got (reloc, adjust) - RELOC_ENUM *reloc; + enum bfd_reloc_code_real *reloc; int *adjust; { static const char * const mode_name[NUM_FLAG_CODE] = { "32", "16", "64" }; static const struct { const char *str; - const RELOC_ENUM rel[NUM_FLAG_CODE]; + const enum bfd_reloc_code_real rel[NUM_FLAG_CODE]; } gotrel[] = { { "PLT", { BFD_RELOC_386_PLT32, 0, BFD_RELOC_X86_64_PLT32 } }, { "GOTOFF", { BFD_RELOC_386_GOTOFF, 0, 0 } }, { "GOTPCREL", { 0, 0, BFD_RELOC_X86_64_GOTPCREL } }, - { "TLSGD", { BFD_RELOC_386_TLS_GD, 0, 0 } }, + { "TLSGD", { BFD_RELOC_386_TLS_GD, 0, BFD_RELOC_X86_64_TLSGD } }, { "TLSLDM", { BFD_RELOC_386_TLS_LDM, 0, 0 } }, - { "GOTTPOFF", { BFD_RELOC_386_TLS_IE_32, 0, 0 } }, - { "TPOFF", { BFD_RELOC_386_TLS_LE_32, 0, 0 } }, + { "TLSLD", { 0, 0, BFD_RELOC_X86_64_TLSLD } }, + { "GOTTPOFF", { BFD_RELOC_386_TLS_IE_32, 0, BFD_RELOC_X86_64_GOTTPOFF } }, + { "TPOFF", { BFD_RELOC_386_TLS_LE_32, 0, BFD_RELOC_X86_64_TPOFF32 } }, { "NTPOFF", { BFD_RELOC_386_TLS_LE, 0, 0 } }, - { "DTPOFF", { BFD_RELOC_386_TLS_LDO_32, 0, 0 } }, + { "DTPOFF", { BFD_RELOC_386_TLS_LDO_32, 0, BFD_RELOC_X86_64_DTPOFF32 } }, { "GOTNTPOFF",{ BFD_RELOC_386_TLS_GOTIE, 0, 0 } }, { "INDNTPOFF",{ BFD_RELOC_386_TLS_IE, 0, 0 } }, { "GOT", { BFD_RELOC_386_GOT32, 0, BFD_RELOC_X86_64_GOT32 } } @@ -3548,7 +3589,7 @@ lex_got (reloc, adjust) /* x86_cons_fix_new is called via the expression parsing code when a reloc is needed. We use this hook to get the correct .got reloc. */ -static RELOC_ENUM got_reloc = NO_RELOC; +static enum bfd_reloc_code_real got_reloc = NO_RELOC; void x86_cons_fix_new (frag, off, len, exp) @@ -3557,7 +3598,7 @@ x86_cons_fix_new (frag, off, len, exp) unsigned int len; expressionS *exp; { - RELOC_ENUM r = reloc (len, 0, 0, got_reloc); + enum bfd_reloc_code_real r = reloc (len, 0, 0, got_reloc); got_reloc = NO_RELOC; fix_new_exp (frag, off, len, exp, 0, r); } @@ -3663,25 +3704,15 @@ i386_immediate (imm_start) exp->X_add_number = (exp->X_add_number ^ ((addressT) 1 << 31)) - ((addressT) 1 << 31); } #if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT)) - else if (1 -#ifdef BFD_ASSEMBLER - && OUTPUT_FLAVOR == bfd_target_aout_flavour -#endif + else if (OUTPUT_FLAVOR == bfd_target_aout_flavour && exp_seg != absolute_section && exp_seg != text_section && exp_seg != data_section && exp_seg != bss_section && exp_seg != undefined_section -#ifdef BFD_ASSEMBLER - && !bfd_is_com_section (exp_seg) -#endif - ) + && !bfd_is_com_section (exp_seg)) { -#ifdef BFD_ASSEMBLER as_bad (_("unimplemented segment %s in operand"), exp_seg->name); -#else - as_bad (_("unimplemented segment type %d in operand"), exp_seg); -#endif return 0; } #endif @@ -3838,7 +3869,6 @@ i386_displacement (disp_start, disp_end) free (gotfree_input_line); #endif -#ifdef BFD_ASSEMBLER /* We do this to make sure that the section symbol is in the symbol table. We will ultimately change the relocation to be relative to the beginning of the section. */ @@ -3864,7 +3894,6 @@ i386_displacement (disp_start, disp_end) else i.reloc[this_operand] = BFD_RELOC_32; } -#endif if (exp->X_op == O_absent || exp->X_op == O_big) { @@ -3879,24 +3908,15 @@ i386_displacement (disp_start, disp_end) #if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT)) if (exp->X_op != O_constant -#ifdef BFD_ASSEMBLER && OUTPUT_FLAVOR == bfd_target_aout_flavour -#endif && exp_seg != absolute_section && exp_seg != text_section && exp_seg != data_section && exp_seg != bss_section && exp_seg != undefined_section -#ifdef BFD_ASSEMBLER - && !bfd_is_com_section (exp_seg) -#endif - ) + && !bfd_is_com_section (exp_seg)) { -#ifdef BFD_ASSEMBLER as_bad (_("unimplemented segment %s in operand"), exp_seg->name); -#else - as_bad (_("unimplemented segment type %d in operand"), exp_seg); -#endif return 0; } #endif @@ -4325,7 +4345,7 @@ md_estimate_size_before_relax (fragP, segment) /* Symbol is undefined in this segment, or we need to keep a reloc so that weak symbols can be overridden. */ int size = (fragP->fr_subtype & CODE16) ? 2 : 4; - RELOC_ENUM reloc_type; + enum bfd_reloc_code_real reloc_type; unsigned char *opcode; int old_fr_fix; @@ -4424,19 +4444,11 @@ md_estimate_size_before_relax (fragP, segment) Out: Any fixSs and constants are set up. Caller will turn frag into a ".space 0". */ -#ifndef BFD_ASSEMBLER -void -md_convert_frag (headers, sec, fragP) - object_headers *headers ATTRIBUTE_UNUSED; - segT sec ATTRIBUTE_UNUSED; - fragS *fragP; -#else void md_convert_frag (abfd, sec, fragP) bfd *abfd ATTRIBUTE_UNUSED; segT sec ATTRIBUTE_UNUSED; fragS *fragP; -#endif { unsigned char *opcode; unsigned char *where_to_put_displacement = NULL; @@ -4575,7 +4587,7 @@ md_apply_fix3 (fixP, valP, seg) char *p = fixP->fx_where + fixP->fx_frag->fr_literal; valueT value = *valP; -#if defined (BFD_ASSEMBLER) && !defined (TE_Mach) +#if !defined (TE_Mach) if (fixP->fx_pcrel) { switch (fixP->fx_r_type) @@ -4595,7 +4607,7 @@ md_apply_fix3 (fixP, valP, seg) } } - if (fixP->fx_pcrel + if (fixP->fx_addsy != NULL && (fixP->fx_r_type == BFD_RELOC_32_PCREL || fixP->fx_r_type == BFD_RELOC_16_PCREL || fixP->fx_r_type == BFD_RELOC_8_PCREL) @@ -4616,19 +4628,16 @@ md_apply_fix3 (fixP, valP, seg) #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) if (OUTPUT_FLAVOR == bfd_target_elf_flavour) { - segT fseg = S_GET_SEGMENT (fixP->fx_addsy); + segT sym_seg = S_GET_SEGMENT (fixP->fx_addsy); - if ((fseg == seg + if ((sym_seg == seg || (symbol_section_p (fixP->fx_addsy) - && fseg != absolute_section)) - && !S_IS_EXTERNAL (fixP->fx_addsy) - && !S_IS_WEAK (fixP->fx_addsy) - && S_IS_DEFINED (fixP->fx_addsy) - && !S_IS_COMMON (fixP->fx_addsy)) + && sym_seg != absolute_section)) + && !generic_force_reloc (fixP)) { /* Yes, we add the values in twice. This is because - bfd_perform_relocation subtracts them out again. I think - bfd_perform_relocation is broken, but I don't dare change + bfd_install_relocation subtracts them out again. I think + bfd_install_relocation is broken, but I don't dare change it. FIXME. */ value += fixP->fx_where + fixP->fx_frag->fr_address; } @@ -4643,7 +4652,7 @@ md_apply_fix3 (fixP, valP, seg) } /* Fix a few things - the dynamic linker expects certain values here, - and we must not dissappoint it. */ + and we must not disappoint it. */ #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) if (OUTPUT_FLAVOR == bfd_target_elf_flavour && fixP->fx_addsy) @@ -4656,12 +4665,25 @@ md_apply_fix3 (fixP, valP, seg) value = -4; break; - case BFD_RELOC_386_GOT32: case BFD_RELOC_386_TLS_GD: case BFD_RELOC_386_TLS_LDM: case BFD_RELOC_386_TLS_IE_32: case BFD_RELOC_386_TLS_IE: case BFD_RELOC_386_TLS_GOTIE: + case BFD_RELOC_X86_64_TLSGD: + case BFD_RELOC_X86_64_TLSLD: + case BFD_RELOC_X86_64_GOTTPOFF: + value = 0; /* Fully resolved at runtime. No addend. */ + /* Fallthrough */ + case BFD_RELOC_386_TLS_LE: + case BFD_RELOC_386_TLS_LDO_32: + case BFD_RELOC_386_TLS_LE_32: + case BFD_RELOC_X86_64_DTPOFF32: + case BFD_RELOC_X86_64_TPOFF32: + S_SET_THREAD_LOCAL (fixP->fx_addsy); + break; + + case BFD_RELOC_386_GOT32: case BFD_RELOC_X86_64_GOT32: value = 0; /* Fully resolved at runtime. No addend. */ break; @@ -4676,12 +4698,11 @@ md_apply_fix3 (fixP, valP, seg) } #endif /* defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) */ *valP = value; -#endif /* defined (BFD_ASSEMBLER) && !defined (TE_Mach) */ +#endif /* !defined (TE_Mach) */ /* Are we finished with this relocation now? */ if (fixP->fx_addsy == NULL) fixP->fx_done = 1; -#ifdef BFD_ASSEMBLER else if (use_rela_relocations) { fixP->fx_no_overflow = 1; @@ -4689,7 +4710,7 @@ md_apply_fix3 (fixP, valP, seg) fixP->fx_addnumber = value; value = 0; } -#endif + md_number_to_chars (p, value, fixP->fx_size); } @@ -4835,9 +4856,9 @@ parse_register (reg_string, end_op) } #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) -const char *md_shortopts = "kVQ:sq"; +const char *md_shortopts = "kVQ:sqn"; #else -const char *md_shortopts = "q"; +const char *md_shortopts = "qn"; #endif struct option md_longopts[] = { @@ -4858,6 +4879,10 @@ md_parse_option (c, arg) { switch (c) { + case 'n': + optimize_align_code = 0; + break; + case 'q': quiet_warnings = 1; break; @@ -4919,15 +4944,16 @@ md_show_usage (stream) -Q ignored\n\ -V print assembler version number\n\ -k ignored\n\ + -n Do not optimize code alignment\n\ -q quieten some warnings\n\ -s ignored\n")); #else fprintf (stream, _("\ + -n Do not optimize code alignment\n\ -q quieten some warnings\n")); #endif } -#ifdef BFD_ASSEMBLER #if ((defined (OBJ_MAYBE_COFF) && defined (OBJ_MAYBE_AOUT)) \ || defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)) @@ -5009,7 +5035,6 @@ void i386_elf_emit_arch_note () } } #endif -#endif /* BFD_ASSEMBLER */ symbolS * md_undefined_symbol (name) @@ -5039,7 +5064,6 @@ md_section_align (segment, size) segT segment ATTRIBUTE_UNUSED; valueT size; { -#ifdef BFD_ASSEMBLER #if (defined (OBJ_AOUT) || defined (OBJ_MAYBE_AOUT)) if (OUTPUT_FLAVOR == bfd_target_aout_flavour) { @@ -5054,7 +5078,6 @@ md_section_align (segment, size) size = ((size + (1 << align) - 1) & ((valueT) -1 << align)); } #endif -#endif return size; } @@ -5085,8 +5108,6 @@ s_bss (ignore) #endif -#ifdef BFD_ASSEMBLER - void i386_validate_fix (fixp) fixS *fixp; @@ -5136,6 +5157,11 @@ tc_gen_reloc (section, fixp) case BFD_RELOC_386_TLS_LE_32: case BFD_RELOC_386_TLS_LE: case BFD_RELOC_X86_64_32S: + case BFD_RELOC_X86_64_TLSGD: + case BFD_RELOC_X86_64_TLSLD: + case BFD_RELOC_X86_64_DTPOFF32: + case BFD_RELOC_X86_64_GOTTPOFF: + case BFD_RELOC_X86_64_TPOFF32: case BFD_RELOC_RVA: case BFD_RELOC_VTABLE_ENTRY: case BFD_RELOC_VTABLE_INHERIT: @@ -5213,6 +5239,9 @@ tc_gen_reloc (section, fixp) case BFD_RELOC_X86_64_PLT32: case BFD_RELOC_X86_64_GOT32: case BFD_RELOC_X86_64_GOTPCREL: + case BFD_RELOC_X86_64_TLSGD: + case BFD_RELOC_X86_64_TLSLD: + case BFD_RELOC_X86_64_GOTTPOFF: rel->addend = fixp->fx_offset - fixp->fx_size; break; default: @@ -5238,73 +5267,6 @@ tc_gen_reloc (section, fixp) return rel; } -#else /* !BFD_ASSEMBLER */ - -#if (defined(OBJ_AOUT) | defined(OBJ_BOUT)) -void -tc_aout_fix_to_chars (where, fixP, segment_address_in_file) - char *where; - fixS *fixP; - relax_addressT segment_address_in_file; -{ - /* In: length of relocation (or of address) in chars: 1, 2 or 4. - Out: GNU LD relocation length code: 0, 1, or 2. */ - - static const unsigned char nbytes_r_length[] = { 42, 0, 1, 42, 2 }; - long r_symbolnum; - - know (fixP->fx_addsy != NULL); - - md_number_to_chars (where, - (valueT) (fixP->fx_frag->fr_address - + fixP->fx_where - segment_address_in_file), - 4); - - r_symbolnum = (S_IS_DEFINED (fixP->fx_addsy) - ? S_GET_TYPE (fixP->fx_addsy) - : fixP->fx_addsy->sy_number); - - where[6] = (r_symbolnum >> 16) & 0x0ff; - where[5] = (r_symbolnum >> 8) & 0x0ff; - where[4] = r_symbolnum & 0x0ff; - where[7] = ((((!S_IS_DEFINED (fixP->fx_addsy)) << 3) & 0x08) - | ((nbytes_r_length[fixP->fx_size] << 1) & 0x06) - | (((fixP->fx_pcrel << 0) & 0x01) & 0x0f)); -} - -#endif /* OBJ_AOUT or OBJ_BOUT. */ - -#if defined (I386COFF) - -short -tc_coff_fix2rtype (fixP) - fixS *fixP; -{ - if (fixP->fx_r_type == R_IMAGEBASE) - return R_IMAGEBASE; - - return (fixP->fx_pcrel ? - (fixP->fx_size == 1 ? R_PCRBYTE : - fixP->fx_size == 2 ? R_PCRWORD : - R_PCRLONG) : - (fixP->fx_size == 1 ? R_RELBYTE : - fixP->fx_size == 2 ? R_RELWORD : - R_DIR32)); -} - -int -tc_coff_sizemachdep (frag) - fragS *frag; -{ - if (frag->fr_next) - return (frag->fr_next->fr_address - frag->fr_address); - else - return 0; -} - -#endif /* I386COFF */ - -#endif /* !BFD_ASSEMBLER */ /* Parse operands using Intel syntax. This implements a recursive descent parser based on the BNF grammar published in Appendix B of the MASM 6.1 @@ -5535,8 +5497,9 @@ i386_intel_operand (operand_string, got_a_float) /* Add the displacement expression. */ if (*s != '\0') - ret = i386_displacement (s, s + strlen (s)) - && i386_index_check (s); + ret = i386_displacement (s, s + strlen (s)); + if (ret) + ret = i386_index_check (operand_string); } } @@ -6255,3 +6218,55 @@ intel_putback_token () prev_token.reg = NULL; prev_token.str = NULL; } + +int +tc_x86_regname_to_dw2regnum (const char *regname) +{ + unsigned int regnum; + unsigned int regnames_count; + char *regnames_32[] = + { + "eax", "ecx", "edx", "ebx", + "esp", "ebp", "esi", "edi", + "eip" + }; + char *regnames_64[] = + { + "rax", "rbx", "rcx", "rdx", + "rdi", "rsi", "rbp", "rsp", + "r8", "r9", "r10", "r11", + "r12", "r13", "r14", "r15", + "rip" + }; + char **regnames; + + if (flag_code == CODE_64BIT) + { + regnames = regnames_64; + regnames_count = ARRAY_SIZE (regnames_64); + } + else + { + regnames = regnames_32; + regnames_count = ARRAY_SIZE (regnames_32); + } + + for (regnum = 0; regnum < regnames_count; regnum++) + if (strcmp (regname, regnames[regnum]) == 0) + return regnum; + + return -1; +} + +void +tc_x86_frame_initial_instructions (void) +{ + static unsigned int sp_regno; + + if (!sp_regno) + sp_regno = tc_x86_regname_to_dw2regnum (flag_code == CODE_64BIT + ? "rsp" : "esp"); + + cfi_add_CFA_def_cfa (sp_regno, -x86_cie_data_alignment); + cfi_add_CFA_offset (x86_dwarf2_return_column, x86_cie_data_alignment); +} diff --git a/contrib/binutils/gas/config/tc-i386.h b/contrib/binutils/gas/config/tc-i386.h index c36fff3..14b522b 100644 --- a/contrib/binutils/gas/config/tc-i386.h +++ b/contrib/binutils/gas/config/tc-i386.h @@ -1,6 +1,6 @@ /* tc-i386.h -- Header file for tc-i386.c Copyright 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001 + 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -23,6 +23,10 @@ #ifndef TC_I386 #define TC_I386 1 +#ifndef BFD_ASSEMBLER +#error So, do you know what you are doing? +#endif + #ifdef ANSI_PROTOTYPES struct fix; #endif @@ -33,45 +37,6 @@ struct fix; #define TARGET_FORMAT "coff-i386-lynx" #endif -#ifdef BFD_ASSEMBLER -/* This is used to determine relocation types in tc-i386.c. The first - parameter is the current relocation type, the second one is the desired - type. The idea is that if the original type is already some kind of PIC - relocation, we leave it alone, otherwise we give it the desired type */ - -#define tc_fix_adjustable(X) tc_i386_fix_adjustable(X) -extern int tc_i386_fix_adjustable PARAMS ((struct fix *)); - -#if (defined (OBJ_MAYBE_ELF) || defined (OBJ_ELF) || defined (OBJ_MAYBE_COFF) || defined (OBJ_COFF)) && !defined (TE_PE) -/* This arranges for gas/write.c to not apply a relocation if - tc_fix_adjustable() says it is not adjustable. - The "! symbol_used_in_reloc_p" test is there specifically to cover - the case of non-global symbols in linkonce sections. It's the - generally correct thing to do though; If a reloc is going to be - emitted against a symbol then we don't want to adjust the fixup by - applying the reloc during assembly. The reloc will be applied by - the linker during final link. */ -#define TC_FIX_ADJUSTABLE(fixP) \ - (! symbol_used_in_reloc_p ((fixP)->fx_addsy) && tc_fix_adjustable (fixP)) -#endif - -/* 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, so GOTOFF does not need to be - checked here. I am not sure if some of the others are ever used with - pcrel, but it is easier to be safe than sorry. */ - -#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ - ((FIX)->fx_r_type != BFD_RELOC_386_PLT32 \ - && (FIX)->fx_r_type != BFD_RELOC_386_GOT32 \ - && (FIX)->fx_r_type != BFD_RELOC_386_GOTPC \ - && ((FIX)->fx_addsy == NULL \ - || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ - && ! S_IS_WEAK ((FIX)->fx_addsy) \ - && S_IS_DEFINED ((FIX)->fx_addsy) \ - && ! S_IS_COMMON ((FIX)->fx_addsy)))) - #define TARGET_ARCH bfd_arch_i386 #define TARGET_MACH (i386_mach ()) extern unsigned long i386_mach PARAMS ((void)); @@ -125,94 +90,8 @@ extern void i386_elf_emit_arch_note PARAMS ((void)); #define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 0 -#else /* ! BFD_ASSEMBLER */ - -/* COFF STUFF */ - -#define COFF_MAGIC I386MAGIC -#define BFD_ARCH bfd_arch_i386 -#define COFF_FLAGS F_AR32WR -#define TC_COUNT_RELOC(x) ((x)->fx_addsy || (x)->fx_r_type==7) -#define TC_COFF_FIX2RTYPE(fixP) tc_coff_fix2rtype(fixP) -extern short tc_coff_fix2rtype PARAMS ((struct fix *)); -#define TC_COFF_SIZEMACHDEP(frag) tc_coff_sizemachdep (frag) -extern int tc_coff_sizemachdep PARAMS ((fragS *frag)); - -#ifdef TE_GO32 -/* DJGPP now expects some sections to be 2**4 aligned. */ -#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) \ - ((strcmp (obj_segment_name (SEG), ".text") == 0 \ - || strcmp (obj_segment_name (SEG), ".data") == 0 \ - || strcmp (obj_segment_name (SEG), ".bss") == 0 \ - || strncmp (obj_segment_name (SEG), ".gnu.linkonce.t", 15) == 0 \ - || strncmp (obj_segment_name (SEG), ".gnu.linkonce.d", 15) == 0 \ - || strncmp (obj_segment_name (SEG), ".gnu.linkonce.r", 15) == 0) \ - ? 4 \ - : 2) -#else -#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 2 -#endif - -#define TC_RVA_RELOC 7 -/* Need this for PIC relocations */ -#define NEED_FX_R_TYPE - -#ifdef TE_386BSD -/* The BSDI linker apparently rejects objects with a machine type of - M_386 (100). */ -#define AOUT_MACHTYPE 0 -#else -#define AOUT_MACHTYPE 100 -#endif - -#undef REVERSE_SORT_RELOCS - -#endif /* ! BFD_ASSEMBLER */ - -#ifndef LEX_AT -#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) x86_cons (EXP, NBYTES) -extern void x86_cons PARAMS ((expressionS *, int)); - -#define TC_CONS_FIX_NEW(FRAG,OFF,LEN,EXP) x86_cons_fix_new(FRAG, OFF, LEN, EXP) -extern void x86_cons_fix_new - PARAMS ((fragS *, unsigned int, unsigned int, expressionS *)); -#endif - -#ifdef BFD_ASSEMBLER -#define TC_FORCE_RELOCATION(FIXP) \ - ((FIXP)->fx_r_type == BFD_RELOC_VTABLE_INHERIT \ - || (FIXP)->fx_r_type == BFD_RELOC_VTABLE_ENTRY) -#else -/* For COFF. */ -#define TC_FORCE_RELOCATION(FIXP) \ - ((FIXP)->fx_r_type == 7) -#endif - -#ifdef BFD_ASSEMBLER -#define NO_RELOC BFD_RELOC_NONE -#else -#define NO_RELOC 0 -#endif -#define tc_coff_symbol_emit_hook(a) ; /* not used */ - -#ifndef BFD_ASSEMBLER -#ifndef OBJ_AOUT -#ifndef TE_PE -#ifndef TE_GO32 -/* Local labels starts with .L */ -#define LOCAL_LABEL(name) (name[0] == '.' \ - && (name[1] == 'L' || name[1] == 'X' || name[1] == '.')) -#endif -#endif -#endif -#endif - #define LOCAL_LABELS_FB 1 -#define tc_aout_pre_write_hook(x) {;} /* not used */ -#define tc_crawl_symbol_chain(a) {;} /* not used */ -#define tc_headers_hook(a) {;} /* not used */ - extern const char extra_symbol_chars[]; #define tc_symbol_chars extra_symbol_chars @@ -314,13 +193,15 @@ typedef struct #define CpuSSE 0x1000 /* Streaming SIMD extensions required */ #define CpuSSE2 0x2000 /* Streaming SIMD extensions 2 required */ #define Cpu3dnow 0x4000 /* 3dnow! support required */ +#define CpuPNI 0x8000 /* Prescott New Instructions required */ +#define CpuPadLock 0x10000 /* VIA PadLock required */ /* These flags are set by gas depending on the flag_code. */ #define Cpu64 0x4000000 /* 64bit support required */ #define CpuNo64 0x8000000 /* Not supported in the 64bit mode */ /* The default value for unknown CPUs - enable all features to avoid problems. */ -#define CpuUnknownFlags (Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuSledgehammer|CpuMMX|CpuSSE|CpuSSE2|Cpu3dnow|CpuK6|CpuAthlon) +#define CpuUnknownFlags (Cpu086|Cpu186|Cpu286|Cpu386|Cpu486|Cpu586|Cpu686|CpuP4|CpuSledgehammer|CpuMMX|CpuSSE|CpuSSE2|CpuPNI|Cpu3dnow|CpuK6|CpuAthlon|CpuPadLock) /* the bits in opcode_modifier are used to generate the final opcode from the base_opcode. These bits also are used to detect alternate forms of @@ -518,21 +399,66 @@ arch_entry; #define GLOBAL_OFFSET_TABLE_NAME "_GLOBAL_OFFSET_TABLE_" #endif -#ifdef BFD_ASSEMBLER +#ifndef LEX_AT +#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) x86_cons (EXP, NBYTES) +extern void x86_cons PARAMS ((expressionS *, int)); + +#define TC_CONS_FIX_NEW(FRAG,OFF,LEN,EXP) x86_cons_fix_new(FRAG, OFF, LEN, EXP) +extern void x86_cons_fix_new + PARAMS ((fragS *, unsigned int, unsigned int, expressionS *)); +#endif + +#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */ + +#define NO_RELOC BFD_RELOC_NONE + void i386_validate_fix PARAMS ((struct fix *)); -#define TC_VALIDATE_FIX(FIXP,SEGTYPE,SKIP) i386_validate_fix(FIXP) +#define TC_VALIDATE_FIX(FIX,SEGTYPE,SKIP) i386_validate_fix(FIX) + +#define tc_fix_adjustable(X) tc_i386_fix_adjustable(X) +extern int tc_i386_fix_adjustable PARAMS ((struct fix *)); + +/* Values passed to md_apply_fix3 don't include the symbol value. */ +#define MD_APPLY_SYM_VALUE(FIX) 0 + +/* ELF wants external syms kept, as does PE COFF. */ +#if defined (TE_PE) && defined (STRICT_PE_FORMAT) +#define EXTERN_FORCE_RELOC \ + (OUTPUT_FLAVOR == bfd_target_elf_flavour \ + || OUTPUT_FLAVOR == bfd_target_coff_flavour) +#else +#define EXTERN_FORCE_RELOC \ + (OUTPUT_FLAVOR == bfd_target_elf_flavour) #endif -#endif /* TC_I386 */ +/* This expression evaluates to true if the relocation is for a local + object for which we still want to do the relocation at runtime. + False if we are willing to perform this relocation while building + the .o file. GOTOFF does not need to be checked here because it is + not pcrel. I am not sure if some of the others are ever used with + pcrel, but it is easier to be safe than sorry. */ + +#define TC_FORCE_RELOCATION_LOCAL(FIX) \ + (!(FIX)->fx_pcrel \ + || (FIX)->fx_plt \ + || (FIX)->fx_r_type == BFD_RELOC_386_PLT32 \ + || (FIX)->fx_r_type == BFD_RELOC_386_GOT32 \ + || (FIX)->fx_r_type == BFD_RELOC_386_GOTPC \ + || TC_FORCE_RELOCATION (FIX)) #define md_operand(x) extern const struct relax_type md_relax_table[]; #define TC_GENERIC_RELAX_TABLE md_relax_table +extern int optimize_align_code; + #define md_do_align(n, fill, len, max, around) \ -if ((n) && !need_pass_2 \ - && (!(fill) || ((char)*(fill) == (char)0x90 && (len) == 1)) \ +if ((n) \ + && !need_pass_2 \ + && optimize_align_code \ + && (!(fill) \ + || ((char)*(fill) == (char)0x90 && (len) == 1)) \ && subseg_text_p (now_seg)) \ { \ frag_align_code ((n), (max)); \ @@ -559,4 +485,19 @@ void i386_print_statistics PARAMS ((FILE *)); extern void sco_id PARAMS ((void)); #endif -#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */ +/* We want .cfi_* pseudo-ops for generating unwind info. */ +#define TARGET_USE_CFIPOP 1 + +extern unsigned int x86_dwarf2_return_column; +#define DWARF2_DEFAULT_RETURN_COLUMN x86_dwarf2_return_column + +extern int x86_cie_data_alignment; +#define DWARF2_CIE_DATA_ALIGNMENT x86_cie_data_alignment + +#define tc_regname_to_dw2regnum tc_x86_regname_to_dw2regnum +extern int tc_x86_regname_to_dw2regnum PARAMS ((const char *regname)); + +#define tc_cfi_frame_initial_instructions tc_x86_frame_initial_instructions +extern void tc_x86_frame_initial_instructions PARAMS ((void)); + +#endif /* TC_I386 */ diff --git a/contrib/binutils/gas/config/tc-ia64.c b/contrib/binutils/gas/config/tc-ia64.c index a634d80..f5526c9 100644 --- a/contrib/binutils/gas/config/tc-ia64.c +++ b/contrib/binutils/gas/config/tc-ia64.c @@ -1,5 +1,5 @@ /* tc-ia64.c -- Assembler for the HP/Intel IA-64 architecture. - Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Contributed by David Mosberger-Tang This file is part of GAS, the GNU Assembler. @@ -24,7 +24,6 @@ - optional operands - directives: - .alias .eb .estate .lb @@ -82,6 +81,7 @@ enum reloc_func FUNC_FPTR_RELATIVE, FUNC_GP_RELATIVE, FUNC_LT_RELATIVE, + FUNC_LT_RELATIVE_X, FUNC_PC_RELATIVE, FUNC_PLT_RELATIVE, FUNC_SEC_RELATIVE, @@ -155,6 +155,20 @@ struct label_fix extern int target_big_endian; +void (*ia64_number_to_chars) PARAMS ((char *, valueT, int)); + +static void ia64_float_to_chars_bigendian + PARAMS ((char *, LITTLENUM_TYPE *, int)); +static void ia64_float_to_chars_littleendian + PARAMS ((char *, LITTLENUM_TYPE *, int)); +static void (*ia64_float_to_chars) + PARAMS ((char *, LITTLENUM_TYPE *, int)); + +static struct hash_control *alias_hash; +static struct hash_control *alias_name_hash; +static struct hash_control *secalias_hash; +static struct hash_control *secalias_name_hash; + /* Characters which always start a comment. */ const char comment_chars[] = ""; @@ -487,6 +501,7 @@ pseudo_func[] = { "fptr", PSEUDO_FUNC_RELOC, { 0 } }, { "gprel", PSEUDO_FUNC_RELOC, { 0 } }, { "ltoff", PSEUDO_FUNC_RELOC, { 0 } }, + { "ltoffx", PSEUDO_FUNC_RELOC, { 0 } }, { "pcrel", PSEUDO_FUNC_RELOC, { 0 } }, { "pltoff", PSEUDO_FUNC_RELOC, { 0 } }, { "secrel", PSEUDO_FUNC_RELOC, { 0 } }, @@ -519,10 +534,17 @@ pseudo_func[] = { "natval", PSEUDO_FUNC_CONST, { 0x100 } }, /* old usage */ + /* hint constants: */ + { "pause", PSEUDO_FUNC_CONST, { 0x0 } }, + /* unwind-related constants: */ - { "svr4", PSEUDO_FUNC_CONST, { 0 } }, - { "hpux", PSEUDO_FUNC_CONST, { 1 } }, - { "nt", PSEUDO_FUNC_CONST, { 2 } }, + { "svr4", PSEUDO_FUNC_CONST, { ELFOSABI_NONE } }, + { "hpux", PSEUDO_FUNC_CONST, { ELFOSABI_HPUX } }, + { "nt", PSEUDO_FUNC_CONST, { 2 } }, /* conflicts w/ELFOSABI_NETBSD */ + { "linux", PSEUDO_FUNC_CONST, { ELFOSABI_LINUX } }, + { "freebsd", PSEUDO_FUNC_CONST, { ELFOSABI_FREEBSD } }, + { "openvms", PSEUDO_FUNC_CONST, { ELFOSABI_OPENVMS } }, + { "nsk", PSEUDO_FUNC_CONST, { ELFOSABI_NSK } }, /* unwind-related registers: */ { "priunat",PSEUDO_FUNC_REG, { REG_PRIUNAT } } @@ -614,6 +636,9 @@ static struct gr { valueT value; } gr_values[128] = {{ 1, 0, 0 }}; +/* Remember the alignment frag. */ +static fragS *align_frag; + /* These are the routines required to output the various types of unwind records. */ @@ -630,6 +655,8 @@ typedef struct unw_rec_list { unwind_record r; unsigned long slot_number; fragS *slot_frag; + unsigned long next_slot_number; + fragS *next_slot_frag; struct unw_rec_list *next; } unw_rec_list; @@ -646,9 +673,6 @@ typedef struct label_prologue_count 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; @@ -676,11 +700,12 @@ static struct typedef void (*vbyte_func) PARAMS ((int, char *, char *)); -/* Forward delarations: */ +/* Forward declarations: */ 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_align (int); static void dot_radix PARAMS ((int)); static void dot_special_section PARAMS ((int)); static void dot_proc PARAMS ((int)); @@ -801,7 +826,7 @@ static void output_X2_format PARAMS ((vbyte_func, int, int, int, int, int, unsig 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_endp PARAMS ((void)); 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)); @@ -876,15 +901,14 @@ 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 *)); + unsigned long, fragS *, + int)); 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 void fixup_unw_records PARAMS ((unw_rec_list *, int)); 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 *)); +static void generate_unwind_image PARAMS ((const char *)); static unsigned int get_saved_prologue_count PARAMS ((unsigned long)); static void save_prologue_count PARAMS ((unsigned long, unsigned int)); static void free_saved_prologue_counts PARAMS ((void)); @@ -954,9 +978,11 @@ ia64_elf_section_letter (letter, ptr_msg) { if (letter == 's') return SHF_IA_64_SHORT; + else if (letter == 'o') + return SHF_LINK_ORDER; - *ptr_msg = _("Bad .section directive: want a,s,w,x,M,S,G,T in string"); - return 0; + *ptr_msg = _("Bad .section directive: want a,o,s,w,x,M,S,G,T in string"); + return -1; } /* Map SHF_IA_64_SHORT to SEC_SMALL_DATA. */ @@ -990,6 +1016,9 @@ ia64_elf_section_type (str, len) if (STREQ (ELF_STRING_ia64_unwind_once)) return SHT_IA_64_UNWIND; + if (STREQ ("unwind")) + return SHT_IA_64_UNWIND; + if (STREQ ("init_array")) return SHT_INIT_ARRAY; @@ -1064,18 +1093,40 @@ ia64_flush_insns () 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. */ + resolve those now. We only handle prologue, body, and endp 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) + switch (ptr->r.type) { + case prologue: + case prologue_gr: + case body: + case endp: ptr->slot_number = (unsigned long) frag_more (0); ptr->slot_frag = frag_now; + break; + + /* Allow any record which doesn't have a "t" field (i.e., + doesn't relate to a particular instruction). */ + case unwabi: + case br_gr: + case copy_state: + case fr_mem: + case frgr_mem: + case gr_gr: + case gr_mem: + case label_state: + case rp_br: + case spill_base: + case spill_mask: + /* nothing */ + break; + + default: + as_bad (_("Unwind directive not followed by an instruction.")); + break; } - else - as_bad (_("Unwind directive not followed by an instruction.")); } unwind.current_entry = NULL; @@ -1085,9 +1136,8 @@ ia64_flush_insns () as_bad ("qualifying predicate not followed by instruction"); } -void -ia64_do_align (nbytes) - int nbytes; +static void +ia64_do_align (int nbytes) { char *saved_input_line_pointer = input_line_pointer; @@ -1683,26 +1733,19 @@ alloc_record (unw_record_type t) ptr->next = NULL; ptr->slot_number = SLOT_NUM_NOT_SET; ptr->r.type = t; + ptr->next_slot_number = 0; + ptr->next_slot_frag = 0; return ptr; } -/* This function frees an entire list of record structures. */ +/* Dummy unwind record used for calculating the length of the last prologue or + body region. */ -void -free_list_records (unw_rec_list *first) +static unw_rec_list * +output_endp () { - 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); - } + unw_rec_list *ptr = alloc_record (endp); + return ptr; } static unw_rec_list * @@ -2325,6 +2368,10 @@ process_one_record (ptr, f) switch (ptr->r.type) { + /* This is a dummy record that takes up no space in the output. */ + case endp: + break; + case gr_mem: case fr_mem: case br_mem: @@ -2567,29 +2614,18 @@ set_imask (region, regmask, t, type) } } -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. */ + containing FIRST_ADDR. If BEFORE_RELAX, then we use worst-case estimates + for frag sizes. */ unsigned long -slot_index (slot_addr, slot_frag, first_addr, first_frag) +slot_index (slot_addr, slot_frag, first_addr, first_frag, before_relax) unsigned long slot_addr; fragS *slot_frag; unsigned long first_addr; fragS *first_frag; + int before_relax; { unsigned long index = 0; @@ -2604,6 +2640,46 @@ slot_index (slot_addr, slot_frag, first_addr, first_frag) { unsigned long start_addr = (unsigned long) &first_frag->fr_literal; + if (! before_relax) + { + /* We can get the final addresses only during and after + relaxation. */ + if (first_frag->fr_next && first_frag->fr_next->fr_address) + index += 3 * ((first_frag->fr_next->fr_address + - first_frag->fr_address + - first_frag->fr_fix) >> 4); + } + else + /* We don't know what the final addresses will be. We try our + best to estimate. */ + switch (first_frag->fr_type) + { + default: + break; + + case rs_space: + as_fatal ("only constant space allocation is supported"); + break; + + case rs_align: + case rs_align_code: + case rs_align_test: + /* Take alignment into account. Assume the worst case + before relaxation. */ + index += 3 * ((1 << first_frag->fr_offset) >> 4); + break; + + case rs_org: + if (first_frag->fr_symbol) + { + as_fatal ("only constant offsets are supported"); + break; + } + case rs_fill: + index += 3 * (first_frag->fr_offset >> 4); + break; + } + /* 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. */ @@ -2633,8 +2709,8 @@ optimize_unw_records (list) /* 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))) + && (list->next->r.type == endp + || (list->next->r.type == body && list->next->next->r.type == endp))) return NULL; return list; @@ -2642,12 +2718,13 @@ optimize_unw_records (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 + this has been run, all necessary information should be available within each record to generate an image. */ static void -fixup_unw_records (list) +fixup_unw_records (list, before_relax) unw_rec_list *list; + int before_relax; { unw_rec_list *ptr, *region = 0; unsigned long first_addr = 0, rlen = 0, t; @@ -2658,7 +2735,7 @@ fixup_unw_records (list) 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); + first_addr, first_frag, before_relax); switch (ptr->r.type) { case prologue: @@ -2666,60 +2743,24 @@ fixup_unw_records (list) case body: { unw_rec_list *last; - int size, dir_len = 0; - unsigned long last_addr; - fragS *last_frag; + int size; + unsigned long last_addr = 0; + fragS *last_frag = NULL; 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; + the function, and determine the size of the region. */ for (last = ptr->next; last != NULL; last = last->next) if (last->r.type == prologue || last->r.type == prologue_gr - || last->r.type == body) + || last->r.type == body || last->r.type == endp) { 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); + size = slot_index (last_addr, last_frag, first_addr, first_frag, + before_relax); rlen = ptr->r.record.r.rlen = size; if (ptr->r.type == body) /* End of region. */ @@ -2819,29 +2860,63 @@ fixup_unw_records (list) } } -/* Helper routine for output_unw_records. Emits the header for the unwind - info. */ +/* Estimate the size of a frag before relaxing. We only have one type of frag + to handle here, which is the unwind info frag. */ -static int -setup_unwind_header (int size, unsigned char **mem) +int +ia64_estimate_size_before_relax (fragS *frag, + asection *segtype ATTRIBUTE_UNUSED) +{ + unw_rec_list *list; + int len, size, pad; + + /* ??? This code is identical to the first part of ia64_convert_frag. */ + list = (unw_rec_list *) frag->fr_opcode; + fixup_unw_records (list, 0); + + len = calc_record_size (list); + /* pad to pointer-size boundary. */ + pad = len % md.pointer_size; + if (pad != 0) + len += md.pointer_size - pad; + /* Add 8 for the header + a pointer for the personality offset. */ + size = len + 8 + md.pointer_size; + + /* fr_var carries the max_chars that we created the fragment with. + We must, of course, have allocated enough memory earlier. */ + assert (frag->fr_var >= size); + + return frag->fr_fix + size; +} + +/* This function converts a rs_machine_dependent variant frag into a + normal fill frag with the unwind image from the the record list. */ +void +ia64_convert_frag (fragS *frag) { - int x, extra = 0; + unw_rec_list *list; + int len, size, pad; valueT flag_value; - /* pad to pointer-size boundry. */ - x = size % md.pointer_size; - if (x != 0) - extra = md.pointer_size - x; + /* ??? This code is identical to ia64_estimate_size_before_relax. */ + list = (unw_rec_list *) frag->fr_opcode; + fixup_unw_records (list, 0); - /* Add 8 for the header + a pointer for the - personality offset. */ - *mem = xmalloc (size + extra + 8 + md.pointer_size); + len = calc_record_size (list); + /* pad to pointer-size boundary. */ + pad = len % md.pointer_size; + if (pad != 0) + len += md.pointer_size - pad; + /* Add 8 for the header + a pointer for the personality offset. */ + size = len + 8 + md.pointer_size; - /* Clear the padding area and personality. */ - memset (*mem + 8 + size, 0, extra + md.pointer_size); + /* fr_var carries the max_chars that we created the fragment with. + We must, of course, have allocated enough memory earlier. */ + assert (frag->fr_var >= size); - /* Initialize the header area. */ - if (unwind.personality_routine) + /* Initialize the header area. fr_offset is initialized with + unwind.personality_routine. */ + if (frag->fr_offset) { if (md.flags & EF_IA_64_ABI64) flag_value = (bfd_vma) 3 << 32; @@ -2852,44 +2927,25 @@ setup_unwind_header (int size, unsigned char **mem) else flag_value = 0; - md_number_to_chars (*mem, (((bfd_vma) 1 << 48) /* Version. */ - | flag_value /* U & E handler flags. */ - | ((size + extra) / md.pointer_size)), /* Length. */ - 8); - - return extra; -} - -/* Generate an unwind image from a record list. Returns the number of - bytes in the resulting image. The memory image itselof is returned - in the 'ptr' parameter. */ -static int -output_unw_records (list, ptr) - unw_rec_list *list; - void **ptr; -{ - int size, extra; - unsigned char *mem; - - *ptr = NULL; - - list = optimize_unw_records (list); - fixup_unw_records (list); - size = calc_record_size (list); - - if (size > 0 || unwind.force_unwind_entry) - { - unwind.force_unwind_entry = 0; - extra = setup_unwind_header (size, &mem); + md_number_to_chars (frag->fr_literal, + (((bfd_vma) 1 << 48) /* Version. */ + | flag_value /* U & E handler flags. */ + | (len / md.pointer_size)), /* Length. */ + 8); - vbyte_mem_ptr = mem + 8; - process_unw_records (list, output_vbyte_mem); + /* Skip the header. */ + vbyte_mem_ptr = frag->fr_literal + 8; + process_unw_records (list, output_vbyte_mem); - *ptr = mem; + /* Fill the padding bytes with zeros. */ + if (pad != 0) + md_number_to_chars (frag->fr_literal + len + 8 - md.pointer_size + pad, 0, + md.pointer_size - pad); - size += extra + 8 + md.pointer_size; - } - return size; + frag->fr_fix += size; + frag->fr_type = rs_fill; + frag->fr_var = 0; + frag->fr_offset = 0; } static int @@ -2978,6 +3034,14 @@ convert_expr_to_xy_reg (e, xy, regp) } static void +dot_align (int arg) +{ + /* The current frag is an alignment frag. */ + align_frag = frag_now; + s_align_bytes (arg); +} + +static void dot_radix (dummy) int dummy ATTRIBUTE_UNUSED; { @@ -3063,7 +3127,7 @@ dot_vframesp (dummy) add_unwind_entry (output_psp_sprel (e.X_add_number)); } else - as_bad ("First operand to .vframesp must be a general register"); + as_bad ("Operand to .vframesp must be a constant (sp-relative offset)"); } static void @@ -3079,7 +3143,7 @@ dot_vframepsp (dummy) add_unwind_entry (output_psp_sprel (e.X_add_number)); } else - as_bad ("First operand to .vframepsp must be a general register"); + as_bad ("Operand to .vframepsp must be a constant (psp-relative offset)"); } static void @@ -3251,26 +3315,41 @@ dot_restorereg_p (dummy) add_unwind_entry (output_spill_reg_p (ab, reg, 0, 0, qp)); } -static int +static void generate_unwind_image (text_name) const char *text_name; { - int size; - unsigned char *unw_rec; + int size, pad; + unw_rec_list *list; + + /* Mark the end of the unwind info, so that we can compute the size of the + last unwind region. */ + add_unwind_entry (output_endp ()); /* 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 % md.pointer_size != 0) - as_bad ("Unwind record is not a multiple of %d bytes.", md.pointer_size); + list = optimize_unw_records (unwind.list); + fixup_unw_records (list, 1); + size = calc_record_size (list); + + if (size > 0 || unwind.force_unwind_entry) + { + unwind.force_unwind_entry = 0; + /* pad to pointer-size boundary. */ + pad = size % md.pointer_size; + if (pad != 0) + size += md.pointer_size - pad; + /* Add 8 for the header + a pointer for the personality + offset. */ + size += 8 + md.pointer_size; + } /* If there are unwind records, switch sections, and output the info. */ if (size != 0) { - unsigned char *where; char *sec_name; expressionS exp; bfd_reloc_code_real_type reloc; @@ -3287,15 +3366,9 @@ generate_unwind_image (text_name) /* 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); + + frag_var (rs_machine_dependent, size, size, 0, 0, + (offsetT) unwind.personality_routine, (char *) list); /* Add the personality address to the image. */ if (unwind.personality_routine != 0) @@ -3325,11 +3398,8 @@ generate_unwind_image (text_name) } } - free_list_records (unwind.list); free_saved_prologue_counts (); unwind.list = unwind.tail = unwind.current_entry = NULL; - - return size; } static void @@ -3547,7 +3617,7 @@ dot_saveb (dummy) add_unwind_entry (output_br_mem (brmask)); if (!is_end_of_line[sep] && !is_it_end_of_statement ()) - ignore_rest_of_line (); + demand_empty_rest_of_line (); } static void @@ -3579,7 +3649,7 @@ dot_spill (dummy) sep = parse_operand (&e); if (!is_end_of_line[sep] && !is_it_end_of_statement ()) - ignore_rest_of_line (); + demand_empty_rest_of_line (); if (e.X_op != O_constant) as_bad ("Operand to .spill must be a constant"); @@ -3855,7 +3925,7 @@ dot_unwabi (dummy) } sep = parse_operand (&e2); if (!is_end_of_line[sep] && !is_it_end_of_statement ()) - ignore_rest_of_line (); + demand_empty_rest_of_line (); if (e1.X_op != O_constant) { @@ -3950,7 +4020,7 @@ dot_prologue (dummy) 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 (); + demand_empty_rest_of_line (); if (e1.X_op == O_constant) { @@ -4303,7 +4373,32 @@ static void dot_byteorder (byteorder) int byteorder; { - target_big_endian = byteorder; + segment_info_type *seginfo = seg_info (now_seg); + + if (byteorder == -1) + { + if (seginfo->tc_segment_info_data.endian == 0) + seginfo->tc_segment_info_data.endian + = TARGET_BYTES_BIG_ENDIAN ? 1 : 2; + byteorder = seginfo->tc_segment_info_data.endian == 1; + } + else + seginfo->tc_segment_info_data.endian = byteorder ? 1 : 2; + + if (target_big_endian != byteorder) + { + target_big_endian = byteorder; + if (target_big_endian) + { + ia64_number_to_chars = number_to_chars_bigendian; + ia64_float_to_chars = ia64_float_to_chars_bigendian; + } + else + { + ia64_number_to_chars = number_to_chars_littleendian; + ia64_float_to_chars = ia64_float_to_chars_littleendian; + } + } } static void @@ -4340,13 +4435,6 @@ dot_psr (dummy) } static void -dot_alias (dummy) - int dummy ATTRIBUTE_UNUSED; -{ - as_bad (".alias not implemented yet"); -} - -static void dot_ln (dummy) int dummy ATTRIBUTE_UNUSED; { @@ -4405,19 +4493,25 @@ static void stmt_float_cons (kind) int kind; { - size_t size; + size_t alignment; switch (kind) { - case 'd': size = 8; break; - case 'x': size = 10; break; + case 'd': + alignment = 8; + break; + + case 'x': + case 'X': + alignment = 16; + break; case 'f': default: - size = 4; + alignment = 4; break; } - ia64_do_align (size); + ia64_do_align (alignment); float_cons (kind); } @@ -4827,8 +4921,6 @@ const pseudo_typeS md_pseudo_table[] = { "body", dot_body, 0 }, { "prologue", dot_prologue, 0 }, { "endp", dot_endp, 0 }, - { "file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0 }, - { "loc", dwarf2_directive_loc, 0 }, { "fframe", dot_fframe, 0 }, { "vframe", dot_vframe, 0 }, @@ -4876,7 +4968,7 @@ const pseudo_typeS md_pseudo_table[] = { "lb", dot_scope, 0 }, { "le", dot_scope, 1 }, #endif - { "align", s_align_bytes, 0 }, + { "align", dot_align, 0 }, { "regstk", dot_regstk, 0 }, { "rotr", dot_rot, DYNREG_GR }, { "rotf", dot_rot, DYNREG_FR }, @@ -4885,6 +4977,7 @@ const pseudo_typeS md_pseudo_table[] = { "msb", dot_byteorder, 1 }, { "psr", dot_psr, 0 }, { "alias", dot_alias, 0 }, + { "secalias", dot_alias, 1 }, { "ln", dot_ln, 0 }, /* source line info (for debugging) */ { "xdata1", dot_xdata, 1 }, @@ -4894,6 +4987,7 @@ const pseudo_typeS md_pseudo_table[] = { "xreal4", dot_xfloat_cons, 'f' }, { "xreal8", dot_xfloat_cons, 'd' }, { "xreal10", dot_xfloat_cons, 'x' }, + { "xreal16", dot_xfloat_cons, 'X' }, { "xstring", dot_xstringer, 0 }, { "xstringz", dot_xstringer, 1 }, @@ -4904,6 +4998,7 @@ const pseudo_typeS md_pseudo_table[] = { "xreal4.ua", dot_xfloat_cons_ua, 'f' }, { "xreal8.ua", dot_xfloat_cons_ua, 'd' }, { "xreal10.ua", dot_xfloat_cons_ua, 'x' }, + { "xreal16.ua", dot_xfloat_cons_ua, 'X' }, /* annotations/DV checking support */ { "entry", dot_entry, 0 }, @@ -4947,6 +5042,7 @@ pseudo_opcode[] = { "real4", stmt_float_cons, 'f' }, { "real8", stmt_float_cons, 'd' }, { "real10", stmt_float_cons, 'x' }, + { "real16", stmt_float_cons, 'X' }, { "string", stringer, 0 }, { "stringz", stringer, 1 }, @@ -4958,6 +5054,7 @@ pseudo_opcode[] = { "real4.ua", float_cons, 'f' }, { "real8.ua", float_cons, 'd' }, { "real10.ua", float_cons, 'x' }, + { "real16.ua", float_cons, 'X' }, }; /* Declare a register by creating a symbol for it and entering it in @@ -5032,6 +5129,11 @@ operand_match (idesc, index, e) return OPERAND_MATCH; break; + case IA64_OPND_AR_CSD: + if (e->X_op == O_register && e->X_add_number == REG_AR + 25) + 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; @@ -5523,6 +5625,15 @@ operand_match (idesc, index, e) } break; + case IA64_OPND_LDXMOV: + fix = CURR_SLOT.fixup + CURR_SLOT.num_fixups; + fix->code = BFD_RELOC_IA64_LDXMOV; + fix->opnd = idesc->operands[index]; + fix->expr = *e; + fix->is_pcrel = 0; + ++CURR_SLOT.num_fixups; + return OPERAND_MATCH; + default: break; } @@ -5964,7 +6075,7 @@ emit_one_bundle () struct ia64_opcode *idesc; int end_of_insn_group = 0, user_template = -1; int n, i, j, first, curr; - unw_rec_list *ptr; + unw_rec_list *ptr, *last_ptr, *end_ptr; bfd_vma t0 = 0, t1 = 0; struct label_fix *lfix; struct insn_fix *ifix; @@ -6008,18 +6119,39 @@ emit_one_bundle () 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 we have unwind records, we may need to update some now. */ + ptr = md.slot[curr].unwind_record; + if (ptr) + { + /* Find the last prologue/body record in the list for the current + insn, and set the slot number for all records up to that point. + This needs to be done now, because prologue/body records refer to + the current point, not the point after the instruction has been + issued. This matters because there may have been nops emitted + meanwhile. Any non-prologue non-body record followed by a + prologue/body record must also refer to the current point. */ + last_ptr = NULL; + end_ptr = md.slot[(curr + 1) % NUM_SLOTS].unwind_record; + for (; ptr != end_ptr; ptr = ptr->next) + if (ptr->r.type == prologue || ptr->r.type == prologue_gr + || ptr->r.type == body) + last_ptr = ptr; + if (last_ptr) + { + /* Make last_ptr point one after the last prologue/body + record. */ + last_ptr = last_ptr->next; + for (ptr = md.slot[curr].unwind_record; ptr != last_ptr; + ptr = ptr->next) + { + ptr->slot_number = (unsigned long) f + i; + ptr->slot_frag = frag_now; + } + /* Remove the initialized records, so that we won't accidentally + update them again if we insert a nop and continue. */ + md.slot[curr].unwind_record = last_ptr; + } + } if (idesc->flags & IA64_OPCODE_SLOT2) { @@ -6147,10 +6279,11 @@ emit_one_bundle () } required_unit = ia64_templ_desc[template].exec_unit[i]; - /* resolve dynamic opcodes such as "break" and "nop": */ + /* resolve dynamic opcodes such as "break", "hint", and "nop": */ if (idesc->type == IA64_TYPE_DYN) { if ((strcmp (idesc->name, "nop") == 0) + || (strcmp (idesc->name, "hint") == 0) || (strcmp (idesc->name, "break") == 0)) insn_unit = required_unit; else if (strcmp (idesc->name, "chk.s") == 0) @@ -6223,15 +6356,20 @@ emit_one_bundle () 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; + ptr = md.slot[curr].unwind_record; + if (ptr) + { + /* Set slot numbers for all remaining unwind records belonging to the + current insn. There can not be any prologue/body unwind records + here. */ + end_ptr = md.slot[(curr + 1) % NUM_SLOTS].unwind_record; + for (; ptr != end_ptr; ptr = ptr->next) + { + ptr->slot_number = (unsigned long) f + i; + ptr->slot_frag = frag_now; + } + md.slot[curr].unwind_record = NULL; + } if (required_unit == IA64_UNIT_L) { @@ -6304,8 +6442,11 @@ emit_one_bundle () 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; + if (unwind.list) + { + unwind.list->next_slot_number = (unsigned long) f + 16; + unwind.list->next_slot_frag = frag_now; + } } int @@ -6505,7 +6646,15 @@ md_begin () bfd_set_section_alignment (stdoutput, text_section, 4); - target_big_endian = TARGET_BYTES_BIG_ENDIAN; + /* Make sure function pointers get initialized. */ + target_big_endian = -1; + dot_byteorder (TARGET_BYTES_BIG_ENDIAN); + + alias_hash = hash_new (); + alias_name_hash = hash_new (); + secalias_hash = hash_new (); + secalias_name_hash = hash_new (); + pseudo_func[FUNC_DTP_MODULE].u.sym = symbol_new (".", undefined_section, FUNC_DTP_MODULE, &zero_address_frag); @@ -6526,6 +6675,10 @@ md_begin () symbol_new (".", undefined_section, FUNC_LT_RELATIVE, &zero_address_frag); + pseudo_func[FUNC_LT_RELATIVE_X].u.sym = + symbol_new (".", undefined_section, FUNC_LT_RELATIVE_X, + &zero_address_frag); + pseudo_func[FUNC_PC_RELATIVE].u.sym = symbol_new (".", undefined_section, FUNC_PC_RELATIVE, &zero_address_frag); @@ -7034,6 +7187,23 @@ ia64_frob_label (sym) } } +#ifdef TE_HPUX +/* The HP-UX linker will give unresolved symbol errors for symbols + that are declared but unused. This routine removes declared, + unused symbols from an object. */ +int +ia64_frob_symbol (sym) + struct symbol *sym; +{ + if ((S_GET_SEGMENT (sym) == &bfd_und_section && ! symbol_used_p (sym) && + ELF_ST_VISIBILITY (S_GET_OTHER (sym)) == STV_DEFAULT) + || (S_GET_SEGMENT (sym) == &bfd_abs_section + && ! S_IS_EXTERNAL (sym))) + return 1; + return 0; +} +#endif + void ia64_flush_pending_output () { @@ -8645,6 +8815,77 @@ clear_qp_branch_flag (mask) } } +/* MASK contains 2 and only 2 PRs which are mutually exclusive. Remove + any mutexes which contain one of the PRs and create new ones when + needed. */ + +static int +update_qp_mutex (valueT mask) +{ + int i; + int add = 0; + + i = 0; + while (i < qp_mutexeslen) + { + if ((qp_mutexes[i].prmask & mask) != 0) + { + /* If it destroys and creates the same mutex, do nothing. */ + if (qp_mutexes[i].prmask == mask + && qp_mutexes[i].path == md.path) + { + i++; + add = -1; + } + else + { + int keep = 0; + + if (md.debug_dv) + { + fprintf (stderr, " Clearing mutex relation"); + print_prmask (qp_mutexes[i].prmask); + fprintf (stderr, "\n"); + } + + /* Deal with the old mutex with more than 3+ PRs only if + the new mutex on the same execution path with it. + + FIXME: The 3+ mutex support is incomplete. + dot_pred_rel () may be a better place to fix it. */ + if (qp_mutexes[i].path == md.path) + { + /* If it is a proper subset of the mutex, create a + new mutex. */ + if (add == 0 + && (qp_mutexes[i].prmask & mask) == mask) + add = 1; + + qp_mutexes[i].prmask &= ~mask; + if (qp_mutexes[i].prmask & (qp_mutexes[i].prmask - 1)) + { + /* Modify the mutex if there are more than one + PR left. */ + keep = 1; + i++; + } + } + + if (keep == 0) + /* Remove the mutex. */ + qp_mutexes[i] = qp_mutexes[--qp_mutexeslen]; + } + } + else + ++i; + } + + if (add == 1) + add_qp_mutex (mask); + + return add; +} + /* 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. */ @@ -8859,7 +9100,7 @@ note_register_values (idesc) else if (idesc->operands[i] == IA64_OPND_PR_ROT) { if (idesc->operands[1] & ((valueT) 1 << 43)) - qp_changemask = ~(valueT) 0xFFFFFFFFFFF | idesc->operands[1]; + qp_changemask = -((valueT) 1 << 44) | idesc->operands[1]; else qp_changemask = idesc->operands[1]; qp_changemask &= ~(valueT) 0xFFFF; @@ -8909,11 +9150,11 @@ note_register_values (idesc) { 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; + valueT p1mask = (p1 != 0) ? (valueT) 1 << p1 : 0; + valueT p2mask = (p2 != 0) ? (valueT) 1 << p2 : 0; - /* If one of the PRs is PR0, we can't really do anything. */ - if (p1 == 0 || p2 == 0) + /* If both PRs are 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"); @@ -8923,7 +9164,6 @@ note_register_values (idesc) else if (has_suffix_p (idesc->name, ".or.andcm") || has_suffix_p (idesc->name, ".and.orcm")) { - add_qp_mutex (p1mask | p2mask); clear_qp_implies (p2mask, p1mask); } else if (has_suffix_p (idesc->name, ".andcm") @@ -8939,26 +9179,29 @@ note_register_values (idesc) } else { + int added = 0; + clear_qp_implies (p1mask | p2mask, p1mask | p2mask); - if (has_suffix_p (idesc->name, ".unc")) + + /* If one of the PRs is PR0, we call clear_qp_mutex. */ + if (p1 == 0 || p2 == 0) + clear_qp_mutex (p1mask | p2mask); + else + added = update_qp_mutex (p1mask | p2mask); + + if (CURR_SLOT.qp_regno == 0 + || has_suffix_p (idesc->name, ".unc")) { - add_qp_mutex (p1mask | p2mask); + if (added == 0 && p1 && p2) + 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); + if (p1) + add_qp_imply (p1, CURR_SLOT.qp_regno); + if (p2) + add_qp_imply (p2, 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. */ @@ -9758,7 +10001,27 @@ md_assemble (str) flags = idesc->flags; if ((flags & IA64_OPCODE_FIRST) != 0) - insn_group_break (1, 0, 0); + { + /* The alignment frag has to end with a stop bit only if the + next instruction after the alignment directive has to be + the first instruction in an instruction group. */ + if (align_frag) + { + while (align_frag->fr_type != rs_align_code) + { + align_frag = align_frag->fr_next; + if (!align_frag) + break; + } + /* align_frag can be NULL if there are directives in + between. */ + if (align_frag && align_frag->fr_next == frag_now) + align_frag->tc_frag_data = 1; + } + + insn_group_break (1, 0, 0); + } + align_frag = NULL; if ((flags & IA64_OPCODE_NO_PRED) != 0 && qp_regno != 0) { @@ -9982,12 +10245,16 @@ ia64_force_relocation (fix) case BFD_RELOC_IA64_PLTOFF64I: case BFD_RELOC_IA64_PLTOFF64MSB: case BFD_RELOC_IA64_PLTOFF64LSB: + + case BFD_RELOC_IA64_LTOFF22X: + case BFD_RELOC_IA64_LDXMOV: return 1; default: - return 0; + break; } - return 0; + + return generic_force_reloc (fix); } /* Decide from what point a pc-relative relocation is relative to, @@ -10005,6 +10272,20 @@ ia64_pcrel_from_section (fix, sec) return off; } + +/* Used to emit section-relative relocs for the dwarf2 debug data. */ +void +ia64_dwarf2_emit_offset (symbolS *symbol, unsigned int size) +{ + expressionS expr; + + expr.X_op = O_pseudo_fixup; + expr.X_op_symbol = pseudo_func[FUNC_SEC_RELATIVE].u.sym; + expr.X_add_number = 0; + expr.X_add_symbol = symbol; + emit_expr (&expr, size); +} + /* 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. */ @@ -10064,7 +10345,6 @@ ia64_cons_fix_new (f, where, nbytes, exp) code = BFD_RELOC_IA64_IPLTMSB; else code = BFD_RELOC_IA64_IPLTLSB; - exp->X_op = O_symbol; break; } @@ -10075,11 +10355,12 @@ ia64_cons_fix_new (f, where, nbytes, exp) 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); + /* ??? If code unchanged, unsupported. */ } fix = fix_new_exp (f, where, nbytes, exp, 0, code); @@ -10141,6 +10422,14 @@ ia64_gen_real_reloc_type (sym, r_type) } break; + case FUNC_LT_RELATIVE_X: + switch (r_type) + { + case BFD_RELOC_IA64_IMM22: new = BFD_RELOC_IA64_LTOFF22X; break; + default: break; + } + break; + case FUNC_PC_RELATIVE: switch (r_type) { @@ -10247,6 +10536,10 @@ ia64_gen_real_reloc_type (sym, r_type) case FUNC_DTP_RELATIVE: switch (r_type) { + case BFD_RELOC_IA64_DIR64MSB: + new = BFD_RELOC_IA64_DTPREL64MSB; break; + case BFD_RELOC_IA64_DIR64LSB: + new = BFD_RELOC_IA64_DTPREL64LSB; break; case BFD_RELOC_IA64_IMM14: new = BFD_RELOC_IA64_DTPREL14; break; case BFD_RELOC_IA64_IMM22: @@ -10274,6 +10567,7 @@ ia64_gen_real_reloc_type (sym, r_type) default: abort (); } + /* Hmmmm. Should this ever occur? */ if (new) return new; @@ -10301,8 +10595,6 @@ ia64_validate_fix (fix) default: break; } - - return; } static void @@ -10378,7 +10670,6 @@ md_apply_fix3 (fix, valP, seg) { char *fixpos; valueT value = *valP; - int adjust = 0; fixpos = fix->fx_frag->fr_literal + fix->fx_where; @@ -10388,22 +10679,18 @@ md_apply_fix3 (fix, valP, seg) { 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: @@ -10412,8 +10699,9 @@ md_apply_fix3 (fix, valP, seg) } if (fix->fx_addsy) { - if (fix->fx_r_type == (int) BFD_RELOC_UNUSED) + switch (fix->fx_r_type) { + case BFD_RELOC_UNUSED: /* This must be a TAG13 or TAG13b operand. There are no external relocs defined for them, so we must give an error. */ as_bad_where (fix->fx_file, fix->fx_line, @@ -10421,12 +10709,22 @@ md_apply_fix3 (fix, valP, seg) elf64_ia64_operands[fix->tc_fix_data.opnd].desc); fix->fx_done = 1; return; - } - /* ??? 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; + case BFD_RELOC_IA64_TPREL14: + case BFD_RELOC_IA64_TPREL22: + case BFD_RELOC_IA64_TPREL64I: + case BFD_RELOC_IA64_LTOFF_TPREL22: + case BFD_RELOC_IA64_LTOFF_DTPMOD22: + case BFD_RELOC_IA64_DTPREL14: + case BFD_RELOC_IA64_DTPREL22: + case BFD_RELOC_IA64_DTPREL64I: + case BFD_RELOC_IA64_LTOFF_DTPREL22: + S_SET_THREAD_LOCAL (fix->fx_addsy); + break; + + default: + break; + } } else if (fix->tc_fix_data.opnd == IA64_OPND_NIL) { @@ -10483,7 +10781,6 @@ md_atof (type, lit, size) int *size; { LITTLENUM_TYPE words[MAX_LITTLENUMS]; - LITTLENUM_TYPE *word; char *t; int prec; @@ -10518,26 +10815,19 @@ md_atof (type, lit, size) 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--;) + (*ia64_float_to_chars) (lit, words, prec); + + if (type == 'X') { - md_number_to_chars (lit, (long) (*word--), sizeof (LITTLENUM_TYPE)); - lit += sizeof (LITTLENUM_TYPE); + /* It is 10 byte floating point with 6 byte padding. */ + memset (&lit [10], 0, 6); + *size = 8 * 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; + else + *size = prec * sizeof (LITTLENUM_TYPE); - return (size + mask) & ~mask; + return 0; } /* Handle ia64 specific semantics of the align directive. */ @@ -10561,22 +10851,46 @@ 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}; + static const unsigned char le_nop_stop[] + = { 0x0d, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00}; int bytes; char *p; + const unsigned char *nop; if (fragp->fr_type != rs_align_code) return; + /* Check if this frag has to end with a stop bit. */ + nop = fragp->tc_frag_data ? le_nop_stop : le_nop; + bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix; p = fragp->fr_literal + fragp->fr_fix; + /* If no paddings are needed, we check if we need a stop bit. */ + if (!bytes && fragp->tc_frag_data) + { + if (fragp->fr_fix < 16) +#if 1 + /* FIXME: It won't work with + .align 16 + alloc r32=ar.pfs,1,2,4,0 + */ + ; +#else + as_bad_where (fragp->fr_file, fragp->fr_line, + _("Can't add stop bit to mark end of instruction group")); +#endif + else + /* Bundles are always in little-endian byte order. Make sure + the previous bundle has the stop bit. */ + *(p - 16) |= 1; + } + /* Make sure we are on a 16-byte boundary, in case someone has been putting data into a text section. */ if (bytes & 15) @@ -10588,6 +10902,214 @@ ia64_handle_align (fragp) fragp->fr_fix += fix; } - memcpy (p, (target_big_endian ? be_nop : le_nop), 16); + /* Instruction bundles are always little-endian. */ + memcpy (p, nop, 16); fragp->fr_var = 16; } + +static void +ia64_float_to_chars_bigendian (char *lit, LITTLENUM_TYPE *words, + int prec) +{ + while (prec--) + { + number_to_chars_bigendian (lit, (long) (*words++), + sizeof (LITTLENUM_TYPE)); + lit += sizeof (LITTLENUM_TYPE); + } +} + +static void +ia64_float_to_chars_littleendian (char *lit, LITTLENUM_TYPE *words, + int prec) +{ + while (prec--) + { + number_to_chars_littleendian (lit, (long) (words[prec]), + sizeof (LITTLENUM_TYPE)); + lit += sizeof (LITTLENUM_TYPE); + } +} + +void +ia64_elf_section_change_hook (void) +{ + dot_byteorder (-1); +} + +/* Check if a label should be made global. */ +void +ia64_check_label (symbolS *label) +{ + if (*input_line_pointer == ':') + { + S_SET_EXTERNAL (label); + input_line_pointer++; + } +} + +/* Used to remember where .alias and .secalias directives are seen. We + will rename symbol and section names when we are about to output + the relocatable file. */ +struct alias +{ + char *file; /* The file where the directive is seen. */ + unsigned int line; /* The line number the directive is at. */ + const char *name; /* The orignale name of the symbol. */ +}; + +/* Called for .alias and .secalias directives. If SECTION is 1, it is + .secalias. Otherwise, it is .alias. */ +static void +dot_alias (int section) +{ + char *name, *alias; + char delim; + char *end_name; + int len; + const char *error_string; + struct alias *h; + const char *a; + struct hash_control *ahash, *nhash; + const char *kind; + + name = input_line_pointer; + delim = get_symbol_end (); + end_name = input_line_pointer; + *end_name = delim; + + if (name == end_name) + { + as_bad (_("expected symbol name")); + discard_rest_of_line (); + return; + } + + SKIP_WHITESPACE (); + + if (*input_line_pointer != ',') + { + *end_name = 0; + as_bad (_("expected comma after \"%s\""), name); + *end_name = delim; + ignore_rest_of_line (); + return; + } + + input_line_pointer++; + *end_name = 0; + + /* We call demand_copy_C_string to check if alias string is valid. + There should be a closing `"' and no `\0' in the string. */ + alias = demand_copy_C_string (&len); + if (alias == NULL) + { + ignore_rest_of_line (); + return; + } + + /* Make a copy of name string. */ + len = strlen (name) + 1; + obstack_grow (¬es, name, len); + name = obstack_finish (¬es); + + if (section) + { + kind = "section"; + ahash = secalias_hash; + nhash = secalias_name_hash; + } + else + { + kind = "symbol"; + ahash = alias_hash; + nhash = alias_name_hash; + } + + /* Check if alias has been used before. */ + h = (struct alias *) hash_find (ahash, alias); + if (h) + { + if (strcmp (h->name, name)) + as_bad (_("`%s' is already the alias of %s `%s'"), + alias, kind, h->name); + goto out; + } + + /* Check if name already has an alias. */ + a = (const char *) hash_find (nhash, name); + if (a) + { + if (strcmp (a, alias)) + as_bad (_("%s `%s' already has an alias `%s'"), kind, name, a); + goto out; + } + + h = (struct alias *) xmalloc (sizeof (struct alias)); + as_where (&h->file, &h->line); + h->name = name; + + error_string = hash_jam (ahash, alias, (PTR) h); + if (error_string) + { + as_fatal (_("inserting \"%s\" into %s alias hash table failed: %s"), + alias, kind, error_string); + goto out; + } + + error_string = hash_jam (nhash, name, (PTR) alias); + if (error_string) + { + as_fatal (_("inserting \"%s\" into %s name hash table failed: %s"), + alias, kind, error_string); +out: + obstack_free (¬es, name); + obstack_free (¬es, alias); + } + + demand_empty_rest_of_line (); +} + +/* It renames the original symbol name to its alias. */ +static void +do_alias (const char *alias, PTR value) +{ + struct alias *h = (struct alias *) value; + symbolS *sym = symbol_find (h->name); + + if (sym == NULL) + as_warn_where (h->file, h->line, + _("symbol `%s' aliased to `%s' is not used"), + h->name, alias); + else + S_SET_NAME (sym, (char *) alias); +} + +/* Called from write_object_file. */ +void +ia64_adjust_symtab (void) +{ + hash_traverse (alias_hash, do_alias); +} + +/* It renames the original section name to its alias. */ +static void +do_secalias (const char *alias, PTR value) +{ + struct alias *h = (struct alias *) value; + segT sec = bfd_get_section_by_name (stdoutput, h->name); + + if (sec == NULL) + as_warn_where (h->file, h->line, + _("section `%s' aliased to `%s' is not used"), + h->name, alias); + else + sec->name = alias; +} + +/* Called from write_object_file. */ +void +ia64_frob_file (void) +{ + hash_traverse (secalias_hash, do_secalias); +} diff --git a/contrib/binutils/gas/config/tc-ia64.h b/contrib/binutils/gas/config/tc-ia64.h index 2da3285..dcc2c29 100644 --- a/contrib/binutils/gas/config/tc-ia64.h +++ b/contrib/binutils/gas/config/tc-ia64.h @@ -26,15 +26,34 @@ /* 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 #define MD_FLAGS_DEFAULT EF_IA_64_BE #else -#define md_number_to_chars number_to_chars_littleendian #define TARGET_BYTES_BIG_ENDIAN 0 #define MD_FLAGS_DEFAULT EF_IA_64_ABI64 #endif /* TE_HPUX */ +extern void (*ia64_number_to_chars) PARAMS ((char *, valueT, int)); +#define md_number_to_chars (*ia64_number_to_chars) + +extern void ia64_elf_section_change_hook PARAMS ((void)); +#define md_elf_section_change_hook ia64_elf_section_change_hook + +/* We record the endian for this section. 0 means default, 1 means + big endian and 2 means little endian. */ +struct ia64_segment_info_type +{ + unsigned int endian : 2; +}; + +#define TC_SEGMENT_INFO_TYPE struct ia64_segment_info_type + +extern void ia64_adjust_symtab PARAMS ((void)); +#define tc_adjust_symtab() ia64_adjust_symtab () + +extern void ia64_frob_file PARAMS ((void)); +#define tc_frob_file() ia64_frob_file () + /* 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 @@ -59,17 +78,21 @@ extern const char *ia64_target_format PARAMS ((void)); #define LEX_QM LEX_NAME /* allow `?' inside name */ #define LEX_HASH LEX_END_NAME /* allow `#' ending a name */ +#define SUB_SEGMENT_ALIGN(SEG, FRCHAIN) 0 + 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)); +#ifdef TE_HPUX +extern int ia64_frob_symbol PARAMS((struct symbol *sym)); +#endif 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, @@ -89,24 +112,33 @@ extern long ia64_pcrel_from_section PARAMS ((struct fix *fix, segT sec)); extern void ia64_md_do_align PARAMS ((int, const char *, int, int)); extern void ia64_handle_align PARAMS ((fragS *f)); extern void ia64_after_parse_args PARAMS ((void)); +extern void ia64_dwarf2_emit_offset PARAMS ((symbolS *, unsigned int)); +extern void ia64_check_label PARAMS ((symbolS *)); +extern int ia64_estimate_size_before_relax (fragS *, asection *); +extern void ia64_convert_frag (fragS *); #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) +#ifdef TE_HPUX +#define tc_frob_symbol(s,p) p |= ia64_frob_symbol (s) +#endif /* TE_HPUX */ #define md_flush_pending_output() ia64_flush_pending_output () #define md_parse_name(s,e,c) ia64_parse_name (s, e) #define tc_canonicalize_symbol_name(s) ia64_canonicalize_symbol_name (s) +#define tc_canonicalize_section_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_APPLY_SYM_VALUE(FIX) 0 +#define md_convert_frag(b,s,f) ia64_convert_frag (f) #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) + ia64_estimate_size_before_relax(f,s) #define md_elf_section_letter ia64_elf_section_letter #define md_elf_section_flags ia64_elf_section_flags #define TC_FIX_TYPE struct ia64_fix @@ -114,19 +146,22 @@ extern void ia64_after_parse_args PARAMS ((void)); #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_section_align(seg,size) (size) #define md_do_align(n,f,l,m,j) ia64_md_do_align (n,f,l,m) #define HANDLE_ALIGN(f) ia64_handle_align (f) #define md_elf_section_type(str,len) ia64_elf_section_type (str, len) #define md_after_parse_args() ia64_after_parse_args () +#define TC_DWARF2_EMIT_OFFSET ia64_dwarf2_emit_offset +#define tc_check_label(l) ia64_check_label (l) + +/* Record if an alignment frag should end with a stop bit. */ +#define TC_FRAG_TYPE int +#define TC_FRAG_INIT(FRAGP) do {(FRAGP)->tc_frag_data = 0;}while (0) #define MAX_MEM_FOR_RS_ALIGN_CODE (15 + 16) #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 @@ -177,7 +212,7 @@ typedef enum 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 + spill_reg_p, unwabi, endp } unw_record_type; /* These structures declare the fields that can be used in each of the @@ -249,18 +284,16 @@ typedef struct unwind_record } record; } unwind_record; -/* This expression evaluates to false if the relocation is for a local +/* This expression evaluates to true 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. */ + False if we are willing to perform this relocation while building + the .o file. */ /* If the reloc type is BFD_RELOC_UNUSED, then this is for a TAG13/TAG13b field which has no external reloc, so we must resolve the value now. */ -#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ - ((FIX)->fx_addsy == NULL \ - || (FIX)->fx_r_type == BFD_RELOC_UNUSED \ - || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ - && ! S_IS_WEAK ((FIX)->fx_addsy) \ - && S_IS_DEFINED ((FIX)->fx_addsy) \ - && ! S_IS_COMMON ((FIX)->fx_addsy))) +#define TC_FORCE_RELOCATION_LOCAL(FIX) \ + ((FIX)->fx_r_type != BFD_RELOC_UNUSED \ + && (!(FIX)->fx_pcrel \ + || (FIX)->fx_plt \ + || TC_FORCE_RELOCATION (FIX))) diff --git a/contrib/binutils/gas/config/tc-ppc.c b/contrib/binutils/gas/config/tc-ppc.c index d7e8e69..66366a5 100644 --- a/contrib/binutils/gas/config/tc-ppc.c +++ b/contrib/binutils/gas/config/tc-ppc.c @@ -1,6 +1,6 @@ /* tc-ppc.c -- Assemble for the PowerPC or POWER (RS/6000) - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, + 2004 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GAS, the GNU Assembler. @@ -24,7 +24,7 @@ #include "as.h" #include "safe-ctype.h" #include "subsegs.h" - +#include "dw2gencfi.h" #include "opcode/ppc.h" #ifdef OBJ_ELF @@ -47,9 +47,9 @@ static int set_target_endian = 0; /* Whether to use user friendly register names. */ #ifndef TARGET_REG_NAMES_P #ifdef TE_PE -#define TARGET_REG_NAMES_P true +#define TARGET_REG_NAMES_P TRUE #else -#define TARGET_REG_NAMES_P false +#define TARGET_REG_NAMES_P FALSE #endif #endif @@ -83,9 +83,9 @@ static int set_target_endian = 0; #define SEX16(val) ((((val) & 0xffff) ^ 0x8000) - 0x8000) -static boolean reg_names_p = TARGET_REG_NAMES_P; +static bfd_boolean reg_names_p = TARGET_REG_NAMES_P; -static boolean register_name PARAMS ((expressionS *)); +static bfd_boolean register_name PARAMS ((expressionS *)); static void ppc_set_cpu PARAMS ((void)); static unsigned long ppc_insert_operand PARAMS ((unsigned long insn, const struct powerpc_operand *operand, @@ -111,7 +111,7 @@ static void ppc_ec PARAMS ((int)); static void ppc_ef PARAMS ((int)); static void ppc_es PARAMS ((int)); static void ppc_csect PARAMS ((int)); -static void ppc_change_csect PARAMS ((symbolS *)); +static void ppc_change_csect PARAMS ((symbolS *, offsetT)); static void ppc_function PARAMS ((int)); static void ppc_extern PARAMS ((int)); static void ppc_lglobl PARAMS ((int)); @@ -130,6 +130,7 @@ static void ppc_elf_cons PARAMS ((int)); static void ppc_elf_rdata PARAMS ((int)); static void ppc_elf_lcomm PARAMS ((int)); static void ppc_elf_validate_fix PARAMS ((fixS *, segT)); +static void ppc_apuinfo_section_add PARAMS ((unsigned int apu, unsigned int version)); #endif #ifdef TE_PE @@ -181,6 +182,13 @@ const char EXP_CHARS[] = "eE"; /* Characters which mean that a number is a floating point constant, as in 0d1.0. */ const char FLT_CHARS[] = "dD"; + +/* '+' and '-' can be used as postfix predicate predictors for conditional + branches. So they need to be accepted as symbol characters. */ +const char ppc_symbol_chars[] = "+-"; + +/* The dwarf2 data alignment, adjusted for 32 or 64 bit. */ +int ppc_cie_data_alignment; /* The target specific pseudo-ops which we support. */ @@ -232,8 +240,6 @@ const pseudo_typeS md_pseudo_table[] = { "rdata", ppc_elf_rdata, 0 }, { "rodata", ppc_elf_rdata, 0 }, { "lcomm", ppc_elf_lcomm, 0 }, - { "file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0 }, - { "loc", dwarf2_directive_loc, 0 }, #endif #ifdef TE_PE @@ -602,7 +608,7 @@ reg_name_search (regs, regcount, name) * original state. */ -static boolean +static bfd_boolean register_name (expressionP) expressionS *expressionP; { @@ -617,7 +623,7 @@ register_name (expressionP) name = ++input_line_pointer; else if (!reg_names_p || !ISALPHA (name[0])) - return false; + return FALSE; c = get_symbol_end (); reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT, name); @@ -634,12 +640,12 @@ register_name (expressionP) /* Make the rest nice. */ expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; - return true; + return TRUE; } /* Reset the line as if we had not done anything. */ input_line_pointer = start; - return false; + return FALSE; } /* This function is called for each symbol seen in an expression. It @@ -647,7 +653,7 @@ register_name (expressionP) to use for condition codes. */ /* Whether to do the special parsing. */ -static boolean cr_operand; +static bfd_boolean cr_operand; /* Names to recognize in a condition code. This table is sorted. */ static const struct pd_reg cr_names[] = @@ -715,12 +721,12 @@ static flagword ppc_flags = 0; /* Whether this is Solaris or not. */ #ifdef TARGET_SOLARIS_COMMENT -#define SOLARIS_P true +#define SOLARIS_P TRUE #else -#define SOLARIS_P false +#define SOLARIS_P FALSE #endif -static boolean msolaris = SOLARIS_P; +static bfd_boolean msolaris = SOLARIS_P; #endif #ifdef OBJ_XCOFF @@ -787,6 +793,20 @@ static segT ppc_current_section; #ifdef OBJ_ELF symbolS *GOT_symbol; /* Pre-defined "_GLOBAL_OFFSET_TABLE" */ +#define PPC_APUINFO_ISEL 0x40 +#define PPC_APUINFO_PMR 0x41 +#define PPC_APUINFO_RFMCI 0x42 +#define PPC_APUINFO_CACHELCK 0x43 +#define PPC_APUINFO_SPE 0x100 +#define PPC_APUINFO_EFS 0x101 +#define PPC_APUINFO_BRLOCK 0x102 + +/* + * We keep a list of APUinfo + */ +unsigned long *ppc_apuinfo_list; +unsigned int ppc_apuinfo_num; +unsigned int ppc_apuinfo_num_alloc; #endif /* OBJ_ELF */ #ifdef OBJ_ELF @@ -799,6 +819,107 @@ const struct option md_longopts[] = { }; const size_t md_longopts_size = sizeof (md_longopts); + +/* Handle -m options that set cpu type, and .machine arg. */ + +static int +parse_cpu (const char *arg) +{ + /* -mpwrx and -mpwr2 mean to assemble for the IBM POWER/2 + (RIOS2). */ + if (strcmp (arg, "pwrx") == 0 || strcmp (arg, "pwr2") == 0) + ppc_cpu = PPC_OPCODE_POWER | PPC_OPCODE_POWER2 | PPC_OPCODE_32; + /* -mpwr means to assemble for the IBM POWER (RIOS1). */ + else if (strcmp (arg, "pwr") == 0) + ppc_cpu = PPC_OPCODE_POWER | PPC_OPCODE_32; + /* -m601 means to assemble for the PowerPC 601, which includes + instructions that are holdovers from the Power. */ + else if (strcmp (arg, "601") == 0) + ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC + | PPC_OPCODE_601 | PPC_OPCODE_32); + /* -mppc, -mppc32, -m603, and -m604 mean to assemble for the + PowerPC 603/604. */ + else if (strcmp (arg, "ppc") == 0 + || strcmp (arg, "ppc32") == 0 + || strcmp (arg, "603") == 0 + || strcmp (arg, "604") == 0) + ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_32; + /* -m403 and -m405 mean to assemble for the PowerPC 403/405. */ + else if (strcmp (arg, "403") == 0 + || strcmp (arg, "405") == 0) + ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC + | PPC_OPCODE_403 | PPC_OPCODE_32); + else if (strcmp (arg, "440") == 0) + ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_32 + | PPC_OPCODE_440 | PPC_OPCODE_ISEL | PPC_OPCODE_RFMCI); + else if (strcmp (arg, "7400") == 0 + || strcmp (arg, "7410") == 0 + || strcmp (arg, "7450") == 0 + || strcmp (arg, "7455") == 0) + ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC + | PPC_OPCODE_ALTIVEC | PPC_OPCODE_32); + else if (strcmp (arg, "altivec") == 0) + { + if (ppc_cpu == 0) + ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_ALTIVEC; + else + ppc_cpu |= PPC_OPCODE_ALTIVEC; + } + else if (strcmp (arg, "e500") == 0 || strcmp (arg, "e500x2") == 0) + { + ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_SPE + | PPC_OPCODE_ISEL | PPC_OPCODE_EFS | PPC_OPCODE_BRLOCK + | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK + | PPC_OPCODE_RFMCI); + } + else if (strcmp (arg, "spe") == 0) + { + if (ppc_cpu == 0) + ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_SPE | PPC_OPCODE_EFS; + else + ppc_cpu |= PPC_OPCODE_SPE; + } + /* -mppc64 and -m620 mean to assemble for the 64-bit PowerPC + 620. */ + else if (strcmp (arg, "ppc64") == 0 || strcmp (arg, "620") == 0) + { + ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_64; + } + else if (strcmp (arg, "ppc64bridge") == 0) + { + ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC + | PPC_OPCODE_64_BRIDGE | PPC_OPCODE_64); + } + /* -mbooke/-mbooke32 mean enable 32-bit BookE support. */ + else if (strcmp (arg, "booke") == 0 || strcmp (arg, "booke32") == 0) + { + ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_32; + } + /* -mbooke64 means enable 64-bit BookE support. */ + else if (strcmp (arg, "booke64") == 0) + { + ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE + | PPC_OPCODE_BOOKE64 | PPC_OPCODE_64); + } + else if (strcmp (arg, "power4") == 0) + { + ppc_cpu = (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC + | PPC_OPCODE_64 | PPC_OPCODE_POWER4); + } + /* -mcom means assemble for the common intersection between Power + and PowerPC. At present, we just allow the union, rather + than the intersection. */ + else if (strcmp (arg, "com") == 0) + ppc_cpu = PPC_OPCODE_COMMON | PPC_OPCODE_32; + /* -many means to assemble for any architecture (PWR/PWRX/PPC). */ + else if (strcmp (arg, "any") == 0) + ppc_cpu |= PPC_OPCODE_ANY; + else + return 0; + + return 1; +} + int md_parse_option (c, arg) int c; @@ -866,77 +987,14 @@ md_parse_option (c, arg) break; case 'm': - /* -mpwrx and -mpwr2 mean to assemble for the IBM POWER/2 - (RIOS2). */ - if (strcmp (arg, "pwrx") == 0 || strcmp (arg, "pwr2") == 0) - ppc_cpu = PPC_OPCODE_POWER | PPC_OPCODE_POWER2 | PPC_OPCODE_32; - /* -mpwr means to assemble for the IBM POWER (RIOS1). */ - else if (strcmp (arg, "pwr") == 0) - ppc_cpu = PPC_OPCODE_POWER | PPC_OPCODE_32; - /* -m601 means to assemble for the PowerPC 601, which includes - instructions that are holdovers from the Power. */ - else if (strcmp (arg, "601") == 0) - ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_601 | PPC_OPCODE_32; - /* -mppc, -mppc32, -m603, and -m604 mean to assemble for the - PowerPC 603/604. */ - else if (strcmp (arg, "ppc") == 0 - || strcmp (arg, "ppc32") == 0 - || strcmp (arg, "603") == 0 - || strcmp (arg, "604") == 0) - ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_32; - /* -m403 and -m405 mean to assemble for the PowerPC 403/405. */ - else if (strcmp (arg, "403") == 0 - || strcmp (arg, "405") == 0) - ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_403 | PPC_OPCODE_32; - else if (strcmp (arg, "7400") == 0 - || strcmp (arg, "7410") == 0 - || strcmp (arg, "7450") == 0 - || strcmp (arg, "7455") == 0) - ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_ALTIVEC | PPC_OPCODE_32; - else if (strcmp (arg, "altivec") == 0) - { - if (ppc_cpu == 0) - ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_ALTIVEC; - else - ppc_cpu |= PPC_OPCODE_ALTIVEC; - } - /* -mppc64 and -m620 mean to assemble for the 64-bit PowerPC - 620. */ - else if (strcmp (arg, "ppc64") == 0 || strcmp (arg, "620") == 0) - { - ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_64; - } - else if (strcmp (arg, "ppc64bridge") == 0) - { - ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_64_BRIDGE | PPC_OPCODE_64; - } - /* -mbooke/-mbooke32 mean enable 32-bit BookE support. */ - else if (strcmp (arg, "booke") == 0 || strcmp (arg, "booke32") == 0) - ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_32; - /* -mbooke64 means enable 64-bit BookE support. */ - else if (strcmp (arg, "booke64") == 0) - { - ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | - PPC_OPCODE_BOOKE64 | PPC_OPCODE_64; - } - else if (strcmp (arg, "power4") == 0) - { - ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_64 | PPC_OPCODE_POWER4; - } - /* -mcom means assemble for the common intersection between Power - and PowerPC. At present, we just allow the union, rather - than the intersection. */ - else if (strcmp (arg, "com") == 0) - ppc_cpu = PPC_OPCODE_COMMON | PPC_OPCODE_32; - /* -many means to assemble for any architecture (PWR/PWRX/PPC). */ - else if (strcmp (arg, "any") == 0) - ppc_cpu = PPC_OPCODE_ANY | PPC_OPCODE_32; + if (parse_cpu (arg)) + ; else if (strcmp (arg, "regnames") == 0) - reg_names_p = true; + reg_names_p = TRUE; else if (strcmp (arg, "no-regnames") == 0) - reg_names_p = false; + reg_names_p = FALSE; #ifdef OBJ_ELF /* -mrelocatable/-mrelocatable-lib -- warn about initializations @@ -973,13 +1031,13 @@ md_parse_option (c, arg) else if (strcmp (arg, "solaris") == 0) { - msolaris = true; + msolaris = TRUE; ppc_comment_chars = ppc_solaris_comment_chars; } else if (strcmp (arg, "no-solaris") == 0) { - msolaris = false; + msolaris = FALSE; ppc_comment_chars = ppc_eabi_comment_chars; } #endif @@ -1024,23 +1082,30 @@ md_show_usage (stream) { fprintf (stream, _("\ PowerPC options:\n\ +-a32 generate ELF32/XCOFF32\n\ +-a64 generate ELF64/XCOFF64\n\ -u ignored\n\ -mpwrx, -mpwr2 generate code for POWER/2 (RIOS2)\n\ -mpwr generate code for POWER (RIOS1)\n\ -m601 generate code for PowerPC 601\n\ -mppc, -mppc32, -m603, -m604\n\ generate code for PowerPC 603/604\n\ --m403, -m405 generate code for PowerPC 403/405\n\ +-m403, -m405 generate code for PowerPC 403/405\n\ +-m440 generate code for PowerPC 440\n\ -m7400, -m7410, -m7450, -m7455\n\ - generate code For PowerPC 7400/7410/7450/7455\n\ + generate code For PowerPC 7400/7410/7450/7455\n")); + fprintf (stream, _("\ -mppc64, -m620 generate code for PowerPC 620/625/630\n\ -mppc64bridge generate code for PowerPC 64, including bridge insns\n\ -mbooke64 generate code for 64-bit PowerPC BookE\n\ -mbooke, mbooke32 generate code for 32-bit PowerPC BookE\n\ -mpower4 generate code for Power4 architecture\n\ --maltivec generate code for AltiVec\n\ -mcom generate code Power/PowerPC common instructions\n\ --many generate code for any architecture (PWR/PWRX/PPC)\n\ +-many generate code for any architecture (PWR/PWRX/PPC)\n")); + fprintf (stream, _("\ +-maltivec generate code for AltiVec\n\ +-me500, -me500x2 generate code for Motorola e500 core complex\n\ +-mspe generate code for Motorola SPE instructions\n\ -mregnames Allow symbolic names for registers\n\ -mno-regnames Do not allow symbolic names for registers\n")); #ifdef OBJ_ELF @@ -1048,9 +1113,10 @@ PowerPC options:\n\ -mrelocatable support for GCC's -mrelocatble option\n\ -mrelocatable-lib support for GCC's -mrelocatble-lib option\n\ -memb set PPC_EMB bit in ELF flags\n\ --mlittle, -mlittle-endian\n\ +-mlittle, -mlittle-endian, -l, -le\n\ generate code for a little endian machine\n\ --mbig, -mbig-endian generate code for a big endian machine\n\ +-mbig, -mbig-endian, -b, -be\n\ + generate code for a big endian machine\n\ -msolaris generate code for Solaris\n\ -mno-solaris do not generate code for Solaris\n\ -V print assembler version number\n\ @@ -1066,23 +1132,23 @@ ppc_set_cpu () const char *default_os = TARGET_OS; const char *default_cpu = TARGET_CPU; - if (ppc_cpu == 0) + if ((ppc_cpu & ~PPC_OPCODE_ANY) == 0) { if (ppc_obj64) - ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_64; + ppc_cpu |= PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_64; else if (strncmp (default_os, "aix", 3) == 0 && default_os[3] >= '4' && default_os[3] <= '9') - ppc_cpu = PPC_OPCODE_COMMON | PPC_OPCODE_32; + ppc_cpu |= PPC_OPCODE_COMMON | PPC_OPCODE_32; else if (strncmp (default_os, "aix3", 4) == 0) - ppc_cpu = PPC_OPCODE_POWER | PPC_OPCODE_32; + ppc_cpu |= PPC_OPCODE_POWER | PPC_OPCODE_32; else if (strcmp (default_cpu, "rs6000") == 0) - ppc_cpu = PPC_OPCODE_POWER | PPC_OPCODE_32; + ppc_cpu |= PPC_OPCODE_POWER | PPC_OPCODE_32; else if (strncmp (default_cpu, "powerpc", 7) == 0) { if (default_cpu[7] == '6' && default_cpu[8] == '4') - ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_64; + ppc_cpu |= PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_64; else - ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_32; + ppc_cpu |= PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_32; } else as_fatal (_("Unknown default cpu = %s, os = %s"), @@ -1148,26 +1214,22 @@ ppc_target_format () #endif } -/* This function is called when the assembler starts up. It is called - after the options have been parsed and the output file has been - opened. */ +/* Insert opcodes and macros into hash tables. Called at startup and + for .cpu pseudo. */ -void -md_begin () +static void +ppc_setup_opcodes (void) { register const struct powerpc_opcode *op; const struct powerpc_opcode *op_end; const struct powerpc_macro *macro; const struct powerpc_macro *macro_end; - boolean dup_insn = false; + bfd_boolean dup_insn = FALSE; - ppc_set_cpu (); - -#ifdef OBJ_ELF - /* Set the ELF flags if desired. */ - if (ppc_flags && !msolaris) - bfd_set_private_flags (stdoutput, ppc_flags); -#endif + if (ppc_hash != NULL) + hash_die (ppc_hash); + if (ppc_macro_hash != NULL) + hash_die (ppc_macro_hash); /* Insert the opcodes into a hash table. */ ppc_hash = hash_new (); @@ -1197,7 +1259,7 @@ md_begin () const char *retval; retval = hash_insert (ppc_hash, op->name, (PTR) op); - if (retval != (const char *) NULL) + if (retval != NULL) { /* Ignore Power duplicates for -m601. */ if ((ppc_cpu & PPC_OPCODE_601) != 0 @@ -1206,11 +1268,15 @@ md_begin () as_bad (_("Internal assembler error for instruction %s"), op->name); - dup_insn = true; + dup_insn = TRUE; } } } + if ((ppc_cpu & PPC_OPCODE_ANY) != 0) + for (op = powerpc_opcodes; op < op_end; op++) + hash_insert (ppc_hash, op->name, (PTR) op); + /* Insert the macros into a hash table. */ ppc_macro_hash = hash_new (); @@ -1225,15 +1291,35 @@ md_begin () if (retval != (const char *) NULL) { as_bad (_("Internal assembler error for macro %s"), macro->name); - dup_insn = true; + dup_insn = TRUE; } } } if (dup_insn) abort (); +} + +/* This function is called when the assembler starts up. It is called + after the options have been parsed and the output file has been + opened. */ + +void +md_begin () +{ + ppc_set_cpu (); + + ppc_cie_data_alignment = ppc_obj64 ? -8 : -4; + +#ifdef OBJ_ELF + /* Set the ELF flags if desired. */ + if (ppc_flags && !msolaris) + bfd_set_private_flags (stdoutput, ppc_flags); +#endif - /* Tell the main code what the endianness is if it is not overidden + ppc_setup_opcodes (); + + /* Tell the main code what the endianness is if it is not overridden by the user. */ if (!set_target_endian) { @@ -1261,6 +1347,66 @@ md_begin () #endif } +void +ppc_cleanup () +{ +#ifdef OBJ_ELF + if (ppc_apuinfo_list == NULL) + return; + + /* Ok, so write the section info out. We have this layout: + + byte data what + ---- ---- ---- + 0 8 length of "APUinfo\0" + 4 (n*4) number of APU's (4 bytes each) + 8 2 note type 2 + 12 "APUinfo\0" name + 20 APU#1 first APU's info + 24 APU#2 second APU's info + ... ... + */ + { + char *p; + asection *seg = now_seg; + subsegT subseg = now_subseg; + asection *apuinfo_secp = (asection *) NULL; + unsigned int i; + + /* Create the .PPC.EMB.apuinfo section. */ + apuinfo_secp = subseg_new (".PPC.EMB.apuinfo", 0); + bfd_set_section_flags (stdoutput, + apuinfo_secp, + SEC_HAS_CONTENTS | SEC_READONLY); + + p = frag_more (4); + md_number_to_chars (p, (valueT) 8, 4); + + p = frag_more (4); + md_number_to_chars (p, (valueT) ppc_apuinfo_num * 4, 4); + + p = frag_more (4); + md_number_to_chars (p, (valueT) 2, 4); + + p = frag_more (8); + strcpy (p, "APUinfo"); + + for (i = 0; i < ppc_apuinfo_num; i++) + { + p = frag_more (4); + md_number_to_chars (p, (valueT) ppc_apuinfo_list[i], 4); + } + + frag_align (2, 0, 0); + + /* We probably can't restore the current segment, for there likely + isn't one yet... */ + if (seg && subseg) + subseg_set (seg, subseg); + } +#endif +} + /* Insert an operand value into an instruction. */ static unsigned long @@ -1347,8 +1493,10 @@ ppc_elf_suffix (str_p, exp_p) { struct map_bfd { char *string; - int length; - int reloc; + unsigned int length : 8; + unsigned int valid32 : 1; + unsigned int valid64 : 1; + unsigned int reloc; }; char ident[20]; @@ -1358,63 +1506,97 @@ ppc_elf_suffix (str_p, exp_p) int len; const struct map_bfd *ptr; -#define MAP(str,reloc) { str, sizeof (str)-1, reloc } +#define MAP(str, reloc) { str, sizeof (str) - 1, 1, 1, reloc } +#define MAP32(str, reloc) { str, sizeof (str) - 1, 1, 0, reloc } +#define MAP64(str, reloc) { str, sizeof (str) - 1, 0, 1, reloc } static const struct map_bfd mapping[] = { - MAP ("l", (int) BFD_RELOC_LO16), - MAP ("h", (int) BFD_RELOC_HI16), - MAP ("ha", (int) BFD_RELOC_HI16_S), - MAP ("brtaken", (int) BFD_RELOC_PPC_B16_BRTAKEN), - MAP ("brntaken", (int) BFD_RELOC_PPC_B16_BRNTAKEN), - MAP ("got", (int) BFD_RELOC_16_GOTOFF), - MAP ("got@l", (int) BFD_RELOC_LO16_GOTOFF), - MAP ("got@h", (int) BFD_RELOC_HI16_GOTOFF), - MAP ("got@ha", (int) BFD_RELOC_HI16_S_GOTOFF), - MAP ("fixup", (int) BFD_RELOC_CTOR), /* warning with -mrelocatable */ - MAP ("plt", (int) BFD_RELOC_24_PLT_PCREL), - MAP ("pltrel24", (int) BFD_RELOC_24_PLT_PCREL), - MAP ("copy", (int) BFD_RELOC_PPC_COPY), - MAP ("globdat", (int) BFD_RELOC_PPC_GLOB_DAT), - MAP ("local24pc", (int) BFD_RELOC_PPC_LOCAL24PC), - MAP ("local", (int) BFD_RELOC_PPC_LOCAL24PC), - MAP ("pltrel", (int) BFD_RELOC_32_PLT_PCREL), - MAP ("plt@l", (int) BFD_RELOC_LO16_PLTOFF), - MAP ("plt@h", (int) BFD_RELOC_HI16_PLTOFF), - MAP ("plt@ha", (int) BFD_RELOC_HI16_S_PLTOFF), - MAP ("sdarel", (int) BFD_RELOC_GPREL16), - MAP ("sectoff", (int) BFD_RELOC_16_BASEREL), - MAP ("sectoff@l", (int) BFD_RELOC_LO16_BASEREL), - MAP ("sectoff@h", (int) BFD_RELOC_HI16_BASEREL), - MAP ("sectoff@ha", (int) BFD_RELOC_HI16_S_BASEREL), - MAP ("naddr", (int) BFD_RELOC_PPC_EMB_NADDR32), - MAP ("naddr16", (int) BFD_RELOC_PPC_EMB_NADDR16), - MAP ("naddr@l", (int) BFD_RELOC_PPC_EMB_NADDR16_LO), - MAP ("naddr@h", (int) BFD_RELOC_PPC_EMB_NADDR16_HI), - MAP ("naddr@ha", (int) BFD_RELOC_PPC_EMB_NADDR16_HA), - MAP ("sdai16", (int) BFD_RELOC_PPC_EMB_SDAI16), - MAP ("sda2rel", (int) BFD_RELOC_PPC_EMB_SDA2REL), - MAP ("sda2i16", (int) BFD_RELOC_PPC_EMB_SDA2I16), - MAP ("sda21", (int) BFD_RELOC_PPC_EMB_SDA21), - MAP ("mrkref", (int) BFD_RELOC_PPC_EMB_MRKREF), - MAP ("relsect", (int) BFD_RELOC_PPC_EMB_RELSEC16), - MAP ("relsect@l", (int) BFD_RELOC_PPC_EMB_RELST_LO), - MAP ("relsect@h", (int) BFD_RELOC_PPC_EMB_RELST_HI), - MAP ("relsect@ha", (int) BFD_RELOC_PPC_EMB_RELST_HA), - MAP ("bitfld", (int) BFD_RELOC_PPC_EMB_BIT_FLD), - MAP ("relsda", (int) BFD_RELOC_PPC_EMB_RELSDA), - MAP ("xgot", (int) BFD_RELOC_PPC_TOC16), - /* The following are only valid for ppc64. Negative values are - used instead of a flag. */ - MAP ("higher", - (int) BFD_RELOC_PPC64_HIGHER), - MAP ("highera", - (int) BFD_RELOC_PPC64_HIGHER_S), - MAP ("highest", - (int) BFD_RELOC_PPC64_HIGHEST), - MAP ("highesta", - (int) BFD_RELOC_PPC64_HIGHEST_S), - MAP ("tocbase", - (int) BFD_RELOC_PPC64_TOC), - MAP ("toc", - (int) BFD_RELOC_PPC_TOC16), - MAP ("toc@l", - (int) BFD_RELOC_PPC64_TOC16_LO), - MAP ("toc@h", - (int) BFD_RELOC_PPC64_TOC16_HI), - MAP ("toc@ha", - (int) BFD_RELOC_PPC64_TOC16_HA), - { (char *) 0, 0, (int) BFD_RELOC_UNUSED } + MAP ("l", BFD_RELOC_LO16), + MAP ("h", BFD_RELOC_HI16), + MAP ("ha", BFD_RELOC_HI16_S), + MAP ("brtaken", BFD_RELOC_PPC_B16_BRTAKEN), + MAP ("brntaken", BFD_RELOC_PPC_B16_BRNTAKEN), + MAP ("got", BFD_RELOC_16_GOTOFF), + MAP ("got@l", BFD_RELOC_LO16_GOTOFF), + MAP ("got@h", BFD_RELOC_HI16_GOTOFF), + MAP ("got@ha", BFD_RELOC_HI16_S_GOTOFF), + MAP ("plt@l", BFD_RELOC_LO16_PLTOFF), + MAP ("plt@h", BFD_RELOC_HI16_PLTOFF), + MAP ("plt@ha", BFD_RELOC_HI16_S_PLTOFF), + MAP ("copy", BFD_RELOC_PPC_COPY), + MAP ("globdat", BFD_RELOC_PPC_GLOB_DAT), + MAP ("sectoff", BFD_RELOC_16_BASEREL), + MAP ("sectoff@l", BFD_RELOC_LO16_BASEREL), + MAP ("sectoff@h", BFD_RELOC_HI16_BASEREL), + MAP ("sectoff@ha", BFD_RELOC_HI16_S_BASEREL), + MAP ("tls", BFD_RELOC_PPC_TLS), + MAP ("dtpmod", BFD_RELOC_PPC_DTPMOD), + MAP ("dtprel", BFD_RELOC_PPC_DTPREL), + MAP ("dtprel@l", BFD_RELOC_PPC_DTPREL16_LO), + MAP ("dtprel@h", BFD_RELOC_PPC_DTPREL16_HI), + MAP ("dtprel@ha", BFD_RELOC_PPC_DTPREL16_HA), + MAP ("tprel", BFD_RELOC_PPC_TPREL), + MAP ("tprel@l", BFD_RELOC_PPC_TPREL16_LO), + MAP ("tprel@h", BFD_RELOC_PPC_TPREL16_HI), + MAP ("tprel@ha", BFD_RELOC_PPC_TPREL16_HA), + MAP ("got@tlsgd", BFD_RELOC_PPC_GOT_TLSGD16), + MAP ("got@tlsgd@l", BFD_RELOC_PPC_GOT_TLSGD16_LO), + MAP ("got@tlsgd@h", BFD_RELOC_PPC_GOT_TLSGD16_HI), + MAP ("got@tlsgd@ha", BFD_RELOC_PPC_GOT_TLSGD16_HA), + MAP ("got@tlsld", BFD_RELOC_PPC_GOT_TLSLD16), + MAP ("got@tlsld@l", BFD_RELOC_PPC_GOT_TLSLD16_LO), + MAP ("got@tlsld@h", BFD_RELOC_PPC_GOT_TLSLD16_HI), + MAP ("got@tlsld@ha", BFD_RELOC_PPC_GOT_TLSLD16_HA), + MAP ("got@dtprel", BFD_RELOC_PPC_GOT_DTPREL16), + MAP ("got@dtprel@l", BFD_RELOC_PPC_GOT_DTPREL16_LO), + MAP ("got@dtprel@h", BFD_RELOC_PPC_GOT_DTPREL16_HI), + MAP ("got@dtprel@ha", BFD_RELOC_PPC_GOT_DTPREL16_HA), + MAP ("got@tprel", BFD_RELOC_PPC_GOT_TPREL16), + MAP ("got@tprel@l", BFD_RELOC_PPC_GOT_TPREL16_LO), + MAP ("got@tprel@h", BFD_RELOC_PPC_GOT_TPREL16_HI), + MAP ("got@tprel@ha", BFD_RELOC_PPC_GOT_TPREL16_HA), + MAP32 ("fixup", BFD_RELOC_CTOR), + MAP32 ("plt", BFD_RELOC_24_PLT_PCREL), + MAP32 ("pltrel24", BFD_RELOC_24_PLT_PCREL), + MAP32 ("local24pc", BFD_RELOC_PPC_LOCAL24PC), + MAP32 ("local", BFD_RELOC_PPC_LOCAL24PC), + MAP32 ("pltrel", BFD_RELOC_32_PLT_PCREL), + MAP32 ("sdarel", BFD_RELOC_GPREL16), + MAP32 ("naddr", BFD_RELOC_PPC_EMB_NADDR32), + MAP32 ("naddr16", BFD_RELOC_PPC_EMB_NADDR16), + MAP32 ("naddr@l", BFD_RELOC_PPC_EMB_NADDR16_LO), + MAP32 ("naddr@h", BFD_RELOC_PPC_EMB_NADDR16_HI), + MAP32 ("naddr@ha", BFD_RELOC_PPC_EMB_NADDR16_HA), + MAP32 ("sdai16", BFD_RELOC_PPC_EMB_SDAI16), + MAP32 ("sda2rel", BFD_RELOC_PPC_EMB_SDA2REL), + MAP32 ("sda2i16", BFD_RELOC_PPC_EMB_SDA2I16), + MAP32 ("sda21", BFD_RELOC_PPC_EMB_SDA21), + MAP32 ("mrkref", BFD_RELOC_PPC_EMB_MRKREF), + MAP32 ("relsect", BFD_RELOC_PPC_EMB_RELSEC16), + MAP32 ("relsect@l", BFD_RELOC_PPC_EMB_RELST_LO), + MAP32 ("relsect@h", BFD_RELOC_PPC_EMB_RELST_HI), + MAP32 ("relsect@ha", BFD_RELOC_PPC_EMB_RELST_HA), + MAP32 ("bitfld", BFD_RELOC_PPC_EMB_BIT_FLD), + MAP32 ("relsda", BFD_RELOC_PPC_EMB_RELSDA), + MAP32 ("xgot", BFD_RELOC_PPC_TOC16), + MAP64 ("higher", BFD_RELOC_PPC64_HIGHER), + MAP64 ("highera", BFD_RELOC_PPC64_HIGHER_S), + MAP64 ("highest", BFD_RELOC_PPC64_HIGHEST), + MAP64 ("highesta", BFD_RELOC_PPC64_HIGHEST_S), + MAP64 ("tocbase", BFD_RELOC_PPC64_TOC), + MAP64 ("toc", BFD_RELOC_PPC_TOC16), + MAP64 ("toc@l", BFD_RELOC_PPC64_TOC16_LO), + MAP64 ("toc@h", BFD_RELOC_PPC64_TOC16_HI), + MAP64 ("toc@ha", BFD_RELOC_PPC64_TOC16_HA), + MAP64 ("dtprel@higher", BFD_RELOC_PPC64_DTPREL16_HIGHER), + MAP64 ("dtprel@highera", BFD_RELOC_PPC64_DTPREL16_HIGHERA), + MAP64 ("dtprel@highest", BFD_RELOC_PPC64_DTPREL16_HIGHEST), + MAP64 ("dtprel@highesta", BFD_RELOC_PPC64_DTPREL16_HIGHESTA), + MAP64 ("tprel@higher", BFD_RELOC_PPC64_TPREL16_HIGHER), + MAP64 ("tprel@highera", BFD_RELOC_PPC64_TPREL16_HIGHERA), + MAP64 ("tprel@highest", BFD_RELOC_PPC64_TPREL16_HIGHEST), + MAP64 ("tprel@highesta", BFD_RELOC_PPC64_TPREL16_HIGHESTA), + { (char *) 0, 0, 0, 0, BFD_RELOC_UNUSED } }; if (*str++ != '@') @@ -1435,23 +1617,18 @@ ppc_elf_suffix (str_p, exp_p) for (ptr = &mapping[0]; ptr->length > 0; ptr++) if (ch == ptr->string[0] && len == ptr->length - && memcmp (ident, ptr->string, ptr->length) == 0) + && memcmp (ident, ptr->string, ptr->length) == 0 + && (ppc_obj64 ? ptr->valid64 : ptr->valid32)) { int reloc = ptr->reloc; - if (reloc < 0) - { - if (!ppc_obj64) - return BFD_RELOC_UNUSED; - reloc = -reloc; - } - - if (exp_p->X_add_number != 0 - && (reloc == (int) BFD_RELOC_16_GOTOFF - || reloc == (int) BFD_RELOC_LO16_GOTOFF - || reloc == (int) BFD_RELOC_HI16_GOTOFF - || reloc == (int) BFD_RELOC_HI16_S_GOTOFF)) - as_warn (_("identifier+constant@got means identifier@got+constant")); + if (!ppc_obj64) + if (exp_p->X_add_number != 0 + && (reloc == (int) BFD_RELOC_16_GOTOFF + || reloc == (int) BFD_RELOC_LO16_GOTOFF + || reloc == (int) BFD_RELOC_HI16_GOTOFF + || reloc == (int) BFD_RELOC_HI16_S_GOTOFF)) + as_warn (_("identifier+constant@got means identifier@got+constant")); /* Now check for identifier@suffix+constant. */ if (*str == '-' || *str == '+') @@ -1473,11 +1650,11 @@ ppc_elf_suffix (str_p, exp_p) *str_p = str; if (reloc == (int) BFD_RELOC_PPC64_TOC - && exp_p->X_op == O_symbol) + && exp_p->X_op == O_symbol + && strcmp (S_GET_NAME (exp_p->X_add_symbol), ".TOC.") == 0) { - /* This reloc type ignores the symbol. Change the symbol - so that the dummy .TOC. symbol can be omitted from the - object file. */ + /* Change the symbol so that the dummy .TOC. symbol can be + omitted from the object file. */ exp_p->X_add_symbol = &abs_symbol; } @@ -1858,6 +2035,40 @@ parse_toc_entry (toc_kind) #endif +#ifdef OBJ_ELF +#define APUID(a,v) ((((a) & 0xffff) << 16) | ((v) & 0xffff)) +static void +ppc_apuinfo_section_add (apu, version) + unsigned int apu, version; +{ + unsigned int i; + + /* Check we don't already exist. */ + for (i = 0; i < ppc_apuinfo_num; i++) + if (ppc_apuinfo_list[i] == APUID (apu, version)) + return; + + if (ppc_apuinfo_num == ppc_apuinfo_num_alloc) + { + if (ppc_apuinfo_num_alloc == 0) + { + ppc_apuinfo_num_alloc = 4; + ppc_apuinfo_list = (unsigned long *) + xmalloc (sizeof (unsigned long) * ppc_apuinfo_num_alloc); + } + else + { + ppc_apuinfo_num_alloc += 4; + ppc_apuinfo_list = (unsigned long *) xrealloc (ppc_apuinfo_list, + sizeof (unsigned long) * ppc_apuinfo_num_alloc); + } + } + ppc_apuinfo_list[ppc_apuinfo_num++] = APUID (apu, version); +} +#undef APUID +#endif + + /* We need to keep a list of fixups. We can't simply generate them as we go, because that would require us to first create the frag, and that would screw up references to ``.''. */ @@ -1921,13 +2132,14 @@ md_assemble (str) /* PowerPC operands are just expressions. The only real issue is that a few operand types are optional. All cases which might use - an optional operand separate the operands only with commas (in - some cases parentheses are used, as in ``lwz 1,0(1)'' but such - cases never have optional operands). There is never more than - one optional operand for an instruction. So, before we start - seriously parsing the operands, we check to see if we have an - optional operand, and, if we do, we count the number of commas to - see whether the operand should be omitted. */ + an optional operand separate the operands only with commas (in some + cases parentheses are used, as in ``lwz 1,0(1)'' but such cases never + have optional operands). Most instructions with optional operands + have only one. Those that have more than one optional operand can + take either all their operands or none. So, before we start seriously + parsing the operands, we check to see if we have optional operands, + and if we do, we count the number of commas to see which operands + have been omitted. */ skip_optional = 0; for (opindex_ptr = opcode->operands; *opindex_ptr != 0; opindex_ptr++) { @@ -1963,7 +2175,7 @@ md_assemble (str) /* If there are fewer operands in the line then are called for by the instruction, we want to skip the optional - operand. */ + operands. */ if (opcount < num_operands_expected) skip_optional = 1; @@ -1990,7 +2202,6 @@ md_assemble (str) operand = &powerpc_operands[next_opindex]; next_opindex = 0; } - errmsg = NULL; /* If this is a fake operand, then we do not expect anything @@ -2141,9 +2352,9 @@ md_assemble (str) if (! register_name (&ex)) { if ((operand->flags & PPC_OPERAND_CR) != 0) - cr_operand = true; + cr_operand = TRUE; expression (&ex); - cr_operand = false; + cr_operand = FALSE; } } @@ -2231,6 +2442,25 @@ md_assemble (str) #ifdef OBJ_ELF else if ((reloc = ppc_elf_suffix (&str, &ex)) != BFD_RELOC_UNUSED) { + /* Some TLS tweaks. */ + switch (reloc) + { + default: + break; + case BFD_RELOC_PPC_TLS: + insn = ppc_insert_operand (insn, operand, ppc_obj64 ? 13 : 2, + (char *) NULL, 0); + break; + /* We'll only use the 32 (or 64) bit form of these relocations + in constants. Instructions get the 16 bit form. */ + case BFD_RELOC_PPC_DTPREL: + reloc = BFD_RELOC_PPC_DTPREL16; + break; + case BFD_RELOC_PPC_TPREL: + reloc = BFD_RELOC_PPC_TPREL16; + break; + } + /* For the absolute forms of branches, convert the PC relative form back into the absolute. */ if ((operand->flags & PPC_OPERAND_ABSOLUTE) != 0) @@ -2255,7 +2485,7 @@ md_assemble (str) } if (ppc_obj64 - && (operand->flags & PPC_OPERAND_DS) != 0) + && (operand->flags & (PPC_OPERAND_DS | PPC_OPERAND_DQ)) != 0) { switch (reloc) { @@ -2292,6 +2522,23 @@ md_assemble (str) case BFD_RELOC_PPC64_PLTGOT16_LO: reloc = BFD_RELOC_PPC64_PLTGOT16_LO_DS; break; + case BFD_RELOC_PPC_DTPREL16: + reloc = BFD_RELOC_PPC64_DTPREL16_DS; + break; + case BFD_RELOC_PPC_DTPREL16_LO: + reloc = BFD_RELOC_PPC64_DTPREL16_LO_DS; + break; + case BFD_RELOC_PPC_TPREL16: + reloc = BFD_RELOC_PPC64_TPREL16_DS; + break; + case BFD_RELOC_PPC_TPREL16_LO: + reloc = BFD_RELOC_PPC64_TPREL16_LO_DS; + break; + case BFD_RELOC_PPC_GOT_DTPREL16: + case BFD_RELOC_PPC_GOT_DTPREL16_LO: + case BFD_RELOC_PPC_GOT_TPREL16: + case BFD_RELOC_PPC_GOT_TPREL16_LO: + break; default: as_bad (_("unsupported relocation for DS offset field")); break; @@ -2351,6 +2598,31 @@ md_assemble (str) if (*str != '\0') as_bad (_("junk at end of line: `%s'"), str); +#ifdef OBJ_ELF + /* Do we need/want a APUinfo section? */ + if (ppc_cpu & (PPC_OPCODE_SPE + | PPC_OPCODE_ISEL | PPC_OPCODE_EFS + | PPC_OPCODE_BRLOCK | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK + | PPC_OPCODE_RFMCI)) + { + /* These are all version "1". */ + if (opcode->flags & PPC_OPCODE_SPE) + ppc_apuinfo_section_add (PPC_APUINFO_SPE, 1); + if (opcode->flags & PPC_OPCODE_ISEL) + ppc_apuinfo_section_add (PPC_APUINFO_ISEL, 1); + if (opcode->flags & PPC_OPCODE_EFS) + ppc_apuinfo_section_add (PPC_APUINFO_EFS, 1); + if (opcode->flags & PPC_OPCODE_BRLOCK) + ppc_apuinfo_section_add (PPC_APUINFO_BRLOCK, 1); + if (opcode->flags & PPC_OPCODE_PMR) + ppc_apuinfo_section_add (PPC_APUINFO_PMR, 1); + if (opcode->flags & PPC_OPCODE_CACHELCK) + ppc_apuinfo_section_add (PPC_APUINFO_CACHELCK, 1); + if (opcode->flags & PPC_OPCODE_RFMCI) + ppc_apuinfo_section_add (PPC_APUINFO_RFMCI, 1); + } +#endif + /* Write out the instruction. */ f = frag_more (4); md_number_to_chars (f, insn, 4); @@ -2518,7 +2790,7 @@ ppc_section_letter (letter, ptr_msg) return SHF_EXCLUDE; *ptr_msg = _("Bad .section directive: want a,e,w,x,M,S,G,T in string"); - return 0; + return -1; } int @@ -2603,11 +2875,11 @@ ppc_byte (ignore) /* This is set if we are creating a .stabx symbol, since we don't want to handle symbol suffixes for such symbols. */ -static boolean ppc_stab_symbol; +static bfd_boolean ppc_stab_symbol; /* The .comm and .lcomm pseudo-ops for XCOFF. XCOFF puts common symbols in the .bss segment as though they were local common - symbols, and uses a different smclas. The native Aix 4.3.3 assember + symbols, and uses a different smclas. The native Aix 4.3.3 assembler aligns .comm and .lcomm to 4 bytes. */ static void @@ -2772,6 +3044,7 @@ ppc_csect (ignore) char *name; char endc; symbolS *sym; + offsetT align; name = input_line_pointer; endc = get_symbol_end (); @@ -2786,22 +3059,24 @@ ppc_csect (ignore) symbol_get_tc (sym)->class = XMC_PR; } - ppc_change_csect (sym); - + align = 2; if (*input_line_pointer == ',') { ++input_line_pointer; - symbol_get_tc (sym)->align = get_absolute_expression (); + align = get_absolute_expression (); } + ppc_change_csect (sym, align); + demand_empty_rest_of_line (); } /* Change to a different csect. */ static void -ppc_change_csect (sym) +ppc_change_csect (sym, align) symbolS *sym; + offsetT align; { if (S_IS_DEFINED (sym)) subseg_set (S_GET_SEGMENT (sym), symbol_get_tc (sym)->subseg); @@ -2811,11 +3086,14 @@ ppc_change_csect (sym) int after_toc; int hold_chunksize; symbolS *list; + int is_code; + segT sec; /* This is a new csect. We need to look at the symbol class to figure out whether it should go in the text section or the data section. */ after_toc = 0; + is_code = 0; switch (symbol_get_tc (sym)->class) { case XMC_PR: @@ -2830,6 +3108,7 @@ ppc_change_csect (sym) symbol_get_tc (sym)->subseg = ppc_text_subsegment; ++ppc_text_subsegment; list_ptr = &ppc_text_csects; + is_code = 1; break; case XMC_RW: case XMC_TC0: @@ -2857,18 +3136,24 @@ ppc_change_csect (sym) hold_chunksize = chunksize; chunksize = 64; - subseg_new (segment_name (S_GET_SEGMENT (sym)), - symbol_get_tc (sym)->subseg); + sec = subseg_new (segment_name (S_GET_SEGMENT (sym)), + symbol_get_tc (sym)->subseg); chunksize = hold_chunksize; if (after_toc) ppc_after_toc_frag = frag_now; + record_alignment (sec, align); + if (is_code) + frag_align_code (align, 0); + else + frag_align (align, 0, 0); + symbol_set_frag (sym, frag_now); S_SET_VALUE (sym, (valueT) frag_now_fix ()); - symbol_get_tc (sym)->align = 2; + symbol_get_tc (sym)->align = align; symbol_get_tc (sym)->output = 1; symbol_get_tc (sym)->within = sym; @@ -2906,7 +3191,7 @@ ppc_section (type) sym = symbol_find_or_make (name); - ppc_change_csect (sym); + ppc_change_csect (sym, 2); demand_empty_rest_of_line (); } @@ -2943,7 +3228,7 @@ ppc_named_section (ignore) sym = symbol_find_or_make (real_name); - ppc_change_csect (sym); + ppc_change_csect (sym, 2); demand_empty_rest_of_line (); } @@ -3046,9 +3331,9 @@ ppc_stabx (ignore) } ++input_line_pointer; - ppc_stab_symbol = true; + ppc_stab_symbol = TRUE; sym = symbol_make (name); - ppc_stab_symbol = false; + ppc_stab_symbol = FALSE; symbol_get_tc (sym)->real_name = name; @@ -3149,7 +3434,7 @@ ppc_stabx (ignore) /* The .function pseudo-op. This takes several arguments. The first argument seems to be the external name of the symbol. The second - argment seems to be the label for the start of the function. gcc + argument seems to be the label for the start of the function. gcc uses the same name for both. I have no idea what the third and fourth arguments are meant to be. The optional fifth argument is an expression for the size of the function. In COFF this symbol @@ -3614,7 +3899,7 @@ ppc_vbyte (dummy) give to this location in the toc; this will be a symbol with class TC. The rest of the arguments are N-byte values to actually put at this location in the TOC; often there is just one more argument, a - relocateable symbol reference. The size of the value to store + relocatable symbol reference. The size of the value to store depends on target word size. A 32-bit target uses 4-byte values, a 64-bit target uses 8-byte values. @@ -3707,18 +3992,67 @@ ppc_tc (ignore) } /* Pseudo-op .machine. */ -/* FIXME: `.machine' is a nop for the moment. It would be nice to - accept this directive on the first line of input and set ppc_obj64 - and the target format accordingly. Unfortunately, the target - format is selected in output-file.c:output_file_create before we - even get to md_begin, so it's not possible without changing - as.c:main. */ static void ppc_machine (ignore) int ignore ATTRIBUTE_UNUSED; { - discard_rest_of_line (); + char *cpu_string; +#define MAX_HISTORY 100 + static unsigned long *cpu_history; + static int curr_hist; + + SKIP_WHITESPACE (); + + if (*input_line_pointer == '"') + { + int len; + cpu_string = demand_copy_C_string (&len); + } + else + { + char c; + cpu_string = input_line_pointer; + c = get_symbol_end (); + cpu_string = xstrdup (cpu_string); + *input_line_pointer = c; + } + + if (cpu_string != NULL) + { + unsigned long old_cpu = ppc_cpu; + char *p; + + for (p = cpu_string; *p != 0; p++) + *p = TOLOWER (*p); + + if (strcmp (cpu_string, "push") == 0) + { + if (cpu_history == NULL) + cpu_history = xmalloc (MAX_HISTORY * sizeof (*cpu_history)); + + if (curr_hist >= MAX_HISTORY) + as_bad (_(".machine stack overflow")); + else + cpu_history[curr_hist++] = ppc_cpu; + } + else if (strcmp (cpu_string, "pop") == 0) + { + if (curr_hist <= 0) + as_bad (_(".machine stack underflow")); + else + ppc_cpu = cpu_history[--curr_hist]; + } + else if (parse_cpu (cpu_string)) + ; + else + as_bad (_("invalid machine `%s'"), cpu_string); + + if (ppc_cpu != old_cpu) + ppc_setup_opcodes (); + } + + demand_empty_rest_of_line (); } /* See whether a symbol is in the TOC section. */ @@ -3777,11 +4111,11 @@ ppc_previous (ignore) /* pseudo-op: .pdata behaviour: predefined read only data section - double word aligned + double word aligned errors: None warnings: None initial: .section .pdata "adr3" - a - don't know -- maybe a misprint + a - don't know -- maybe a misprint d - initialized data r - readable 3 - double word aligned (that would be 4 byte boundary) @@ -3813,11 +4147,11 @@ ppc_pdata (ignore) /* pseudo-op: .ydata behaviour: predefined read only data section - double word aligned + double word aligned errors: None warnings: None initial: .section .ydata "drw3" - a - don't know -- maybe a misprint + a - don't know -- maybe a misprint d - initialized data r - readable 3 - double word aligned (that would be 4 byte boundary) @@ -3847,7 +4181,7 @@ ppc_ydata (ignore) /* pseudo-op: .reldata behaviour: predefined read write data section - double word aligned (4-byte) + double word aligned (4-byte) FIXME: relocation is applied to it FIXME: what's the difference between this and .data? errors: None @@ -3885,7 +4219,7 @@ ppc_reldata (ignore) /* pseudo-op: .rdata behaviour: predefined read only data section - double word aligned + double word aligned errors: None warnings: None initial: .section .rdata "dr3" @@ -3915,7 +4249,7 @@ ppc_rdata (ignore) /* pseudo-op: .ualong behaviour: much like .int, with the exception that no alignment is - performed. + performed. FIXME: test the alignment statement errors: None warnings: None */ @@ -3930,7 +4264,7 @@ ppc_ualong (ignore) /* pseudo-op: .znop behaviour: Issue a nop instruction - Issue a IMAGE_REL_PPC_IFGLUE relocation against it, using + Issue a IMAGE_REL_PPC_IFGLUE relocation against it, using the supplied symbol name. errors: None warnings: Missing symbol name */ @@ -4492,7 +4826,7 @@ ppc_frob_label (sym) seen. It tells ppc_adjust_symtab whether it needs to look through the symbols. */ -static boolean ppc_saw_abs; +static bfd_boolean ppc_saw_abs; /* Change the name of a symbol just before writing it out. Set the real name if the .rename pseudo-op was used. Otherwise, remove any @@ -4515,6 +4849,10 @@ ppc_frob_symbol (sym) && S_GET_STORAGE_CLASS (sym) != C_FILE))) return 1; + /* This one will disappear anyway. Don't make a csect sym for it. */ + if (sym == abs_section_sym) + return 1; + if (symbol_get_tc (sym)->real_name != (char *) NULL) S_SET_NAME (sym, symbol_get_tc (sym)->real_name); else @@ -4631,7 +4969,7 @@ ppc_frob_symbol (sym) { /* This is an absolute symbol. The csect will be created by ppc_adjust_symtab. */ - ppc_saw_abs = true; + ppc_saw_abs = TRUE; a->x_csect.x_smtyp = XTY_LD; if (symbol_get_tc (sym)->class == -1) symbol_get_tc (sym)->class = XMC_XO; @@ -4727,10 +5065,10 @@ ppc_frob_symbol (sym) /* We want the value to be the symbol index of the referenced csect symbol. BFD will do that for us if we set the right flags. */ - S_SET_VALUE (sym, - ((valueT) - coffsymbol (symbol_get_bfdsym - (symbol_get_tc (sym)->within))->native)); + asymbol *bsym = symbol_get_bfdsym (symbol_get_tc (sym)->within); + combined_entry_type *c = coffsymbol (bsym)->native; + + S_SET_VALUE (sym, (valueT) (size_t) c); coffsymbol (symbol_get_bfdsym (sym))->native->fix_value = 1; } else if (S_GET_STORAGE_CLASS (sym) == C_STSYM) @@ -4799,7 +5137,7 @@ ppc_adjust_symtab () coffsymbol (symbol_get_bfdsym (sym))->native[i].fix_scnlen = 1; } - ppc_saw_abs = false; + ppc_saw_abs = FALSE; } /* Set the VMA for a section. This is called on all the sections in @@ -4809,8 +5147,9 @@ void ppc_frob_section (sec) asection *sec; { - static bfd_size_type vma = 0; + static bfd_vma vma = 0; + vma = md_section_align (sec, vma); bfd_set_section_vma (stdoutput, sec, vma); vma += bfd_section_size (stdoutput, sec); } @@ -4956,14 +5295,16 @@ int ppc_fix_adjustable (fix) fixS *fix; { - valueT val; + valueT val = resolve_symbol_value (fix->fx_addsy); + segT symseg = S_GET_SEGMENT (fix->fx_addsy); + TC_SYMFIELD_TYPE *tc; + + if (symseg == absolute_section) + return 0; - resolve_symbol_value (fix->fx_addsy); - val = S_GET_VALUE (fix->fx_addsy); if (ppc_toc_csect != (symbolS *) NULL - && fix->fx_addsy != (symbolS *) NULL && fix->fx_addsy != ppc_toc_csect - && S_GET_SEGMENT (fix->fx_addsy) == data_section + && symseg == data_section && val >= ppc_toc_frag->fr_address && (ppc_after_toc_frag == (fragS *) NULL || val < ppc_after_toc_frag->fr_address)) @@ -4974,12 +5315,13 @@ ppc_fix_adjustable (fix) sy != (symbolS *) NULL; sy = symbol_next (sy)) { - if (symbol_get_tc (sy)->class == XMC_TC0) + TC_SYMFIELD_TYPE *sy_tc = symbol_get_tc (sy); + + if (sy_tc->class == XMC_TC0) continue; - if (symbol_get_tc (sy)->class != XMC_TC) + if (sy_tc->class != XMC_TC) break; - resolve_symbol_value (sy); - if (val == S_GET_VALUE (sy)) + if (val == resolve_symbol_value (sy)) { fix->fx_addsy = sy; fix->fx_addnumber = val - ppc_toc_frag->fr_address; @@ -4992,23 +5334,24 @@ ppc_fix_adjustable (fix) } /* Possibly adjust the reloc to be against the csect. */ - if (fix->fx_addsy != (symbolS *) NULL - && symbol_get_tc (fix->fx_addsy)->subseg == 0 - && symbol_get_tc (fix->fx_addsy)->class != XMC_TC0 - && symbol_get_tc (fix->fx_addsy)->class != XMC_TC - && S_GET_SEGMENT (fix->fx_addsy) != bss_section + tc = symbol_get_tc (fix->fx_addsy); + if (tc->subseg == 0 + && tc->class != XMC_TC0 + && tc->class != XMC_TC + && symseg != bss_section /* Don't adjust if this is a reloc in the toc section. */ - && (S_GET_SEGMENT (fix->fx_addsy) != data_section + && (symseg != data_section || ppc_toc_csect == NULL || val < ppc_toc_frag->fr_address || (ppc_after_toc_frag != NULL && val >= ppc_after_toc_frag->fr_address))) { symbolS *csect; + symbolS *next_csect; - if (S_GET_SEGMENT (fix->fx_addsy) == text_section) + if (symseg == text_section) csect = ppc_text_csects; - else if (S_GET_SEGMENT (fix->fx_addsy) == data_section) + else if (symseg == data_section) csect = ppc_data_csects; else abort (); @@ -5018,16 +5361,15 @@ ppc_fix_adjustable (fix) if (csect != (symbolS *) NULL) { - while (symbol_get_tc (csect)->next != (symbolS *) NULL - && (symbol_get_frag (symbol_get_tc (csect)->next)->fr_address - <= val)) + while ((next_csect = symbol_get_tc (csect)->next) != (symbolS *) NULL + && (symbol_get_frag (next_csect)->fr_address <= val)) { /* If the csect address equals the symbol value, then we have to look through the full symbol table to see whether this is the csect we want. Note that we will only get here if the csect has zero length. */ - if ((symbol_get_frag (csect)->fr_address == val) - && S_GET_VALUE (csect) == S_GET_VALUE (fix->fx_addsy)) + if (symbol_get_frag (csect)->fr_address == val + && S_GET_VALUE (csect) == val) { symbolS *scan; @@ -5047,26 +5389,24 @@ ppc_fix_adjustable (fix) break; } - csect = symbol_get_tc (csect)->next; + csect = next_csect; } - fix->fx_offset += (S_GET_VALUE (fix->fx_addsy) - - symbol_get_frag (csect)->fr_address); + fix->fx_offset += val - symbol_get_frag (csect)->fr_address; fix->fx_addsy = csect; } + return 0; } /* Adjust a reloc against a .lcomm symbol to be against the base .lcomm. */ - if (fix->fx_addsy != (symbolS *) NULL - && S_GET_SEGMENT (fix->fx_addsy) == bss_section + if (symseg == bss_section && ! S_IS_EXTERNAL (fix->fx_addsy)) { - resolve_symbol_value (symbol_get_frag (fix->fx_addsy)->fr_symbol); - fix->fx_offset += - (S_GET_VALUE (fix->fx_addsy) - - S_GET_VALUE (symbol_get_frag (fix->fx_addsy)->fr_symbol)); - fix->fx_addsy = symbol_get_frag (fix->fx_addsy)->fr_symbol; + symbolS *sy = symbol_get_frag (fix->fx_addsy)->fr_symbol; + + fix->fx_offset += val - resolve_symbol_value (sy); + fix->fx_addsy = sy; } return 0; @@ -5094,12 +5434,40 @@ ppc_force_relocation (fix) <= fix->fx_frag->fr_address)))) return 1; - return 0; + return generic_force_reloc (fix); } #endif /* OBJ_XCOFF */ #ifdef OBJ_ELF +/* If this function returns non-zero, it guarantees that a relocation + will be emitted for a fixup. */ + +int +ppc_force_relocation (fix) + fixS *fix; +{ + /* Branch prediction relocations must force a relocation, as must + the vtable description relocs. */ + switch (fix->fx_r_type) + { + case BFD_RELOC_PPC_B16_BRTAKEN: + case BFD_RELOC_PPC_B16_BRNTAKEN: + case BFD_RELOC_PPC_BA16_BRTAKEN: + case BFD_RELOC_PPC_BA16_BRNTAKEN: + case BFD_RELOC_PPC64_TOC: + return 1; + default: + break; + } + + if (fix->fx_r_type >= BFD_RELOC_PPC_TLS + && fix->fx_r_type <= BFD_RELOC_PPC64_DTPREL16_HIGHESTA) + return 1; + + return generic_force_reloc (fix); +} + int ppc_fix_adjustable (fix) fixS *fix; @@ -5111,8 +5479,8 @@ ppc_fix_adjustable (fix) && fix->fx_r_type != BFD_RELOC_GPREL16 && fix->fx_r_type != BFD_RELOC_VTABLE_INHERIT && fix->fx_r_type != BFD_RELOC_VTABLE_ENTRY - && ! S_IS_EXTERNAL (fix->fx_addsy) - && ! S_IS_WEAK (fix->fx_addsy) + && !(fix->fx_r_type >= BFD_RELOC_PPC_TLS + && fix->fx_r_type <= BFD_RELOC_PPC64_DTPREL16_HIGHESTA) && (fix->fx_pcrel || (fix->fx_subsy != NULL && (S_GET_SEGMENT (fix->fx_subsy) @@ -5141,32 +5509,22 @@ md_apply_fix3 (fixP, valP, seg) #ifdef OBJ_ELF if (fixP->fx_addsy != NULL) { - /* `*valuep' may contain the value of the symbol on which the reloc - will be based; we have to remove it. */ - if (symbol_used_in_reloc_p (fixP->fx_addsy) - && S_GET_SEGMENT (fixP->fx_addsy) != absolute_section - && S_GET_SEGMENT (fixP->fx_addsy) != undefined_section - && ! bfd_is_com_section (S_GET_SEGMENT (fixP->fx_addsy))) - value -= S_GET_VALUE (fixP->fx_addsy); - - /* FIXME: Why '+'? Better yet, what exactly is '*valuep' - supposed to be? I think this is related to various similar - FIXMEs in tc-i386.c and tc-sparc.c. */ + /* Hack around bfd_install_relocation brain damage. */ if (fixP->fx_pcrel) value += fixP->fx_frag->fr_address + fixP->fx_where; } else fixP->fx_done = 1; #else - /* FIXME FIXME FIXME: The value we are passed in *valuep includes + /* FIXME FIXME FIXME: The value we are passed in *valP includes the symbol values. Since we are using BFD_ASSEMBLER, if we are doing this relocation the code in write.c is going to call bfd_install_relocation, which is also going to use the symbol value. That means that if the reloc is fully resolved we want to - use *valuep since bfd_install_relocation is not being used. + use *valP since bfd_install_relocation is not being used. However, if the reloc is not fully resolved we do not want to use - *valuep, and must use fx_offset instead. However, if the reloc - is PC relative, we do want to use *valuep since it includes the + *valP, and must use fx_offset instead. However, if the reloc + is PC relative, we do want to use *valP since it includes the result of md_pcrel_from. This is confusing. */ if (fixP->fx_addsy == (symbolS *) NULL) fixP->fx_done = 1; @@ -5175,21 +5533,14 @@ md_apply_fix3 (fixP, valP, seg) ; else + value = fixP->fx_offset; +#endif + + if (fixP->fx_subsy != (symbolS *) NULL) { - value = fixP->fx_offset; - if (fixP->fx_subsy != (symbolS *) NULL) - { - if (S_GET_SEGMENT (fixP->fx_subsy) == absolute_section) - value -= S_GET_VALUE (fixP->fx_subsy); - else - { - /* We can't actually support subtracting a symbol. */ - as_bad_where (fixP->fx_file, fixP->fx_line, - _("expression too complex")); - } - } + /* We can't actually support subtracting a symbol. */ + as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex")); } -#endif if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED) { @@ -5278,15 +5629,26 @@ md_apply_fix3 (fixP, valP, seg) #if defined (OBJ_XCOFF) || defined (OBJ_ELF) else if ((operand->flags & PPC_OPERAND_PARENS) != 0 && operand->bits == 16 - && operand->shift == 0 - && ppc_is_toc_sym (fixP->fx_addsy)) + && operand->shift == 0) { - fixP->fx_r_type = BFD_RELOC_PPC_TOC16; + if (ppc_is_toc_sym (fixP->fx_addsy)) + { + fixP->fx_r_type = BFD_RELOC_PPC_TOC16; #ifdef OBJ_ELF - if (ppc_obj64 - && (operand->flags & PPC_OPERAND_DS) != 0) - fixP->fx_r_type = BFD_RELOC_PPC64_TOC16_DS; + if (ppc_obj64 + && (operand->flags & PPC_OPERAND_DS) != 0) + fixP->fx_r_type = BFD_RELOC_PPC64_TOC16_DS; +#endif + } + else + { + fixP->fx_r_type = BFD_RELOC_16; +#ifdef OBJ_ELF + if (ppc_obj64 + && (operand->flags & PPC_OPERAND_DS) != 0) + fixP->fx_r_type = BFD_RELOC_PPC64_ADDR16_DS; #endif + } fixP->fx_size = 2; if (target_big_endian) fixP->fx_where += 2; @@ -5453,19 +5815,72 @@ md_apply_fix3 (fixP, valP, seg) abort (); { unsigned char *where = fixP->fx_frag->fr_literal + fixP->fx_where; - unsigned long val; + unsigned long val, mask; if (target_big_endian) - val = bfd_getb16 (where); + val = bfd_getb32 (where - 2); else - val = bfd_getl16 (where); - val |= (value & 0xfffc); + val = bfd_getl32 (where); + mask = 0xfffc; + /* lq insns reserve the four lsbs. */ + if ((ppc_cpu & PPC_OPCODE_POWER4) != 0 + && (val & (0x3f << 26)) == (56u << 26)) + mask = 0xfff0; + val |= value & mask; if (target_big_endian) bfd_putb16 ((bfd_vma) val, where); else bfd_putl16 ((bfd_vma) val, where); } break; + + case BFD_RELOC_PPC_B16_BRTAKEN: + case BFD_RELOC_PPC_B16_BRNTAKEN: + case BFD_RELOC_PPC_BA16_BRTAKEN: + case BFD_RELOC_PPC_BA16_BRNTAKEN: + break; + + case BFD_RELOC_PPC_TLS: + case BFD_RELOC_PPC_DTPMOD: + case BFD_RELOC_PPC_TPREL16: + case BFD_RELOC_PPC_TPREL16_LO: + case BFD_RELOC_PPC_TPREL16_HI: + case BFD_RELOC_PPC_TPREL16_HA: + case BFD_RELOC_PPC_TPREL: + case BFD_RELOC_PPC_DTPREL16: + case BFD_RELOC_PPC_DTPREL16_LO: + case BFD_RELOC_PPC_DTPREL16_HI: + case BFD_RELOC_PPC_DTPREL16_HA: + case BFD_RELOC_PPC_DTPREL: + case BFD_RELOC_PPC_GOT_TLSGD16: + case BFD_RELOC_PPC_GOT_TLSGD16_LO: + case BFD_RELOC_PPC_GOT_TLSGD16_HI: + case BFD_RELOC_PPC_GOT_TLSGD16_HA: + case BFD_RELOC_PPC_GOT_TLSLD16: + case BFD_RELOC_PPC_GOT_TLSLD16_LO: + case BFD_RELOC_PPC_GOT_TLSLD16_HI: + case BFD_RELOC_PPC_GOT_TLSLD16_HA: + case BFD_RELOC_PPC_GOT_TPREL16: + case BFD_RELOC_PPC_GOT_TPREL16_LO: + case BFD_RELOC_PPC_GOT_TPREL16_HI: + case BFD_RELOC_PPC_GOT_TPREL16_HA: + case BFD_RELOC_PPC_GOT_DTPREL16: + case BFD_RELOC_PPC_GOT_DTPREL16_LO: + case BFD_RELOC_PPC_GOT_DTPREL16_HI: + case BFD_RELOC_PPC_GOT_DTPREL16_HA: + case BFD_RELOC_PPC64_TPREL16_DS: + case BFD_RELOC_PPC64_TPREL16_LO_DS: + case BFD_RELOC_PPC64_TPREL16_HIGHER: + case BFD_RELOC_PPC64_TPREL16_HIGHERA: + case BFD_RELOC_PPC64_TPREL16_HIGHEST: + case BFD_RELOC_PPC64_TPREL16_HIGHESTA: + case BFD_RELOC_PPC64_DTPREL16_DS: + case BFD_RELOC_PPC64_DTPREL16_LO_DS: + case BFD_RELOC_PPC64_DTPREL16_HIGHER: + case BFD_RELOC_PPC64_DTPREL16_HIGHERA: + case BFD_RELOC_PPC64_DTPREL16_HIGHEST: + case BFD_RELOC_PPC64_DTPREL16_HIGHESTA: + break; #endif /* Because SDA21 modifies the register field, the size is set to 4 bytes, rather than 2, so offset it here appropriately. */ @@ -5480,10 +5895,19 @@ md_apply_fix3 (fixP, valP, seg) case BFD_RELOC_8: if (fixP->fx_pcrel) - abort (); - - md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, - value, 1); + { + /* This can occur if there is a bug in the input assembler, eg: + ".byte - ." */ + if (fixP->fx_addsy) + as_bad (_("Unable to handle reference to symbol %s"), + S_GET_NAME (fixP->fx_addsy)); + else + as_bad (_("Unable to resolve expression")); + fixP->fx_done = 1; + } + else + md_number_to_chars (fixP->fx_frag->fr_literal + fixP->fx_where, + value, 1); break; case BFD_RELOC_24_PLT_PCREL: @@ -5591,3 +6015,49 @@ tc_gen_reloc (seg, fixp) return reloc; } + +void +ppc_cfi_frame_initial_instructions () +{ + cfi_add_CFA_def_cfa (1, 0); +} + +int +tc_ppc_regname_to_dw2regnum (const char *regname) +{ + unsigned int regnum = -1; + unsigned int i; + const char *p; + char *q; + static struct { char *name; int dw2regnum; } regnames[] = + { + { "sp", 1 }, { "r.sp", 1 }, { "rtoc", 2 }, { "r.toc", 2 }, + { "mq", 64 }, { "lr", 65 }, { "ctr", 66 }, { "ap", 67 }, + { "cc", 68 }, { "xer", 76 }, { "vrsave", 109 }, { "vscr", 110 }, + { "spe_acc", 111 }, { "spefscr", 112 } + }; + + for (i = 0; i < ARRAY_SIZE (regnames); ++i) + if (strcmp (regnames[i].name, regname) == 0) + return regnames[i].dw2regnum; + + if (regname[0] == 'r' || regname[0] == 'f' || regname[0] == 'v') + { + p = regname + 1 + (regname[1] == '.'); + regnum = strtoul (p, &q, 10); + if (p == q || *q || regnum >= 32) + return -1; + if (regname[0] == 'f') + regnum += 32; + else if (regname[0] == 'v') + regnum += 77; + } + else if (regname[0] == 'c' && regname[1] == 'r') + { + p = regname + 2 + (regname[2] == '.'); + if (p[0] < '0' || p[0] > '7' || p[1]) + return -1; + regnum = p[0] - '0' + 68; + } + return regnum; +} diff --git a/contrib/binutils/gas/config/tc-ppc.h b/contrib/binutils/gas/config/tc-ppc.h index b6dd640..0844f84 100644 --- a/contrib/binutils/gas/config/tc-ppc.h +++ b/contrib/binutils/gas/config/tc-ppc.h @@ -1,5 +1,5 @@ /* tc-ppc.h -- Header file for tc-ppc.c. - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. @@ -117,7 +117,7 @@ extern char *ppc_target_format PARAMS ((void)); #define LEX_QM 1 /* Don't adjust TOC relocs. */ -#define tc_fix_adjustable(fixp) ppc_pe_fix_adjustable (fixp) +#define tc_fix_adjustable(FIX) ppc_pe_fix_adjustable (FIX) extern int ppc_pe_fix_adjustable PARAMS ((struct fix *)); #endif @@ -177,13 +177,9 @@ extern void ppc_symbol_new_hook PARAMS ((symbolS *)); extern void ppc_frob_label PARAMS ((symbolS *)); /* TOC relocs requires special handling. */ -#define tc_fix_adjustable(fixp) ppc_fix_adjustable (fixp) +#define tc_fix_adjustable(FIX) ppc_fix_adjustable (FIX) extern int ppc_fix_adjustable PARAMS ((struct fix *)); -/* A relocation from one csect to another must be kept. */ -#define TC_FORCE_RELOCATION(FIXP) ppc_force_relocation (FIXP) -extern int ppc_force_relocation PARAMS ((struct fix *)); - /* We need to set the section VMA. */ #define tc_frob_section(sec) ppc_frob_section (sec) extern void ppc_frob_section PARAMS ((asection *)); @@ -210,23 +206,10 @@ do { \ #endif /* OBJ_XCOFF */ -#ifdef OBJ_ELF +extern const char ppc_symbol_chars[]; +#define tc_symbol_chars ppc_symbol_chars -/* Branch prediction relocations must force relocation, as must - the vtable description relocs. */ -#define TC_FORCE_RELOCATION(FIXP) \ -((FIXP)->fx_r_type == BFD_RELOC_PPC_B16_BRTAKEN \ - || (FIXP)->fx_r_type == BFD_RELOC_PPC_B16_BRNTAKEN \ - || (FIXP)->fx_r_type == BFD_RELOC_PPC_BA16_BRTAKEN \ - || (FIXP)->fx_r_type == BFD_RELOC_PPC_BA16_BRNTAKEN \ - || (FIXP)->fx_r_type == BFD_RELOC_PPC64_TOC \ - || (FIXP)->fx_r_type == BFD_RELOC_VTABLE_INHERIT \ - || (FIXP)->fx_r_type == BFD_RELOC_VTABLE_ENTRY) - -#define TC_FORCE_RELOCATION_SECTION(FIXP,SEC) \ -(TC_FORCE_RELOCATION (FIXP) \ - || ((FIXP)->fx_addsy && !(FIXP)->fx_subsy \ - && S_GET_SEGMENT ((FIXP)->fx_addsy) != SEC)) +#ifdef OBJ_ELF /* Support for SHF_EXCLUDE and SHT_ORDERED */ extern int ppc_section_letter PARAMS ((int, char **)); @@ -239,49 +222,48 @@ extern int ppc_section_flags PARAMS ((int, int, int)); #define md_elf_section_word(STR, LEN) ppc_section_word (STR, LEN) #define md_elf_section_flags(FLAGS, ATTR, TYPE) ppc_section_flags (FLAGS, ATTR, TYPE) -/* Add extra PPC sections -- Note, for now, make .sbss2 and .PPC.EMB.sbss0 a - normal section, and not a bss section so that the linker doesn't crater - when trying to make more than 2 sections. */ -#define ELF_TC_SPECIAL_SECTIONS \ - { ".tags", SHT_ORDERED, SHF_ALLOC }, \ - { ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE }, \ - { ".sbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE }, \ - { ".sdata2", SHT_PROGBITS, SHF_ALLOC }, \ - { ".sbss2", SHT_PROGBITS, SHF_ALLOC }, \ - { ".PPC.EMB.sdata0", SHT_PROGBITS, SHF_ALLOC }, \ - { ".PPC.EMB.sbss0", SHT_PROGBITS, SHF_ALLOC }, \ - /* Extra sections for 64-bit ELF PPC. */ \ - { ".toc", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE}, \ - { ".tocbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE}, - #define tc_comment_chars ppc_comment_chars extern const char *ppc_comment_chars; /* Keep relocations relative to the GOT, or non-PC relative. */ -#define tc_fix_adjustable(fixp) ppc_fix_adjustable (fixp) +#define tc_fix_adjustable(FIX) ppc_fix_adjustable (FIX) extern int ppc_fix_adjustable PARAMS ((struct fix *)); -/* We must never ever try to resolve references to externally visible - symbols in the assembler, because the .o file might go into a shared - library, and some other shared library might override that symbol. */ -#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ - ((FIX)->fx_addsy == NULL \ - || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ - && ! S_IS_WEAK ((FIX)->fx_addsy) \ - && S_IS_DEFINED ((FIX)->fx_addsy) \ - && ! S_IS_COMMON ((FIX)->fx_addsy))) +/* Values passed to md_apply_fix3 don't include symbol values. */ +#define MD_APPLY_SYM_VALUE(FIX) 0 #define tc_frob_file_before_adjust ppc_frob_file_before_adjust extern void ppc_frob_file_before_adjust PARAMS ((void)); -#define DWARF2_LINE_MIN_INSN_LENGTH 4 #endif /* OBJ_ELF */ +#if defined (OBJ_ELF) || defined (OBJ_XCOFF) +#define TC_FORCE_RELOCATION(FIX) ppc_force_relocation (FIX) +extern int ppc_force_relocation PARAMS ((struct fix *)); +#endif + /* 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(FIX, SEC) md_pcrel_from_section(FIX, SEC) extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); #define md_parse_name(name, exp, c) ppc_parse_name (name, exp) extern int ppc_parse_name PARAMS ((const char *, struct expressionS *)); #define md_operand(x) + +#define md_cleanup() ppc_cleanup () + extern void ppc_cleanup PARAMS ((void)); + +#define TARGET_USE_CFIPOP 1 + +#define tc_cfi_frame_initial_instructions ppc_cfi_frame_initial_instructions +extern void ppc_cfi_frame_initial_instructions PARAMS ((void)); + +#define tc_regname_to_dw2regnum tc_ppc_regname_to_dw2regnum +extern int tc_ppc_regname_to_dw2regnum PARAMS ((const char *regname)); + +extern int ppc_cie_data_alignment; + +#define DWARF2_LINE_MIN_INSN_LENGTH 4 +#define DWARF2_DEFAULT_RETURN_COLUMN 0x41 +#define DWARF2_CIE_DATA_ALIGNMENT ppc_cie_data_alignment diff --git a/contrib/binutils/gas/config/tc-s390.c b/contrib/binutils/gas/config/tc-s390.c index bce0604..4fafbec 100644 --- a/contrib/binutils/gas/config/tc-s390.c +++ b/contrib/binutils/gas/config/tc-s390.c @@ -1,5 +1,5 @@ /* tc-s390.c -- Assemble for the S390 - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of GAS, the GNU Assembler. @@ -24,6 +24,8 @@ #include "safe-ctype.h" #include "subsegs.h" #include "struc-symbol.h" +#include "dwarf2dbg.h" +#include "dw2gencfi.h" #include "opcode/s390.h" #include "elf/s390.h" @@ -34,21 +36,20 @@ #endif static char *default_arch = DEFAULT_ARCH; /* Either 32 or 64, selects file format. */ -static int s390_arch_size; -/* Current architecture. Start with the smallest instruction set. */ -static enum s390_opcode_arch_val current_architecture = S390_OPCODE_ESA; -static int current_arch_mask = 1 << S390_OPCODE_ESA; -static int current_arch_requested = 0; +static int s390_arch_size = 0; -/* Whether to use user friendly register names. Default is true. */ +static unsigned int current_mode_mask = 0; +static unsigned int current_cpu = -1U; + +/* Whether to use user friendly register names. Default is TRUE. */ #ifndef TARGET_REG_NAMES_P -#define TARGET_REG_NAMES_P true +#define TARGET_REG_NAMES_P TRUE #endif -static boolean reg_names_p = TARGET_REG_NAMES_P; +static bfd_boolean reg_names_p = TARGET_REG_NAMES_P; /* Set to TRUE if we want to warn about zero base/index registers. */ -static boolean warn_areg_zero = FALSE; +static bfd_boolean warn_areg_zero = FALSE; /* Generic assembler global variables which must be defined by all targets. */ @@ -70,6 +71,9 @@ const char EXP_CHARS[] = "eE"; as in 0d1.0. */ const char FLT_CHARS[] = "dD"; +/* The dwarf2 data alignment, adjusted for 32 or 64 bit. */ +int s390_cie_data_alignment; + /* The target specific pseudo-ops which we support. */ /* Define the prototypes for the pseudo-ops */ @@ -203,7 +207,7 @@ static const struct pd_reg pre_defined_registers[] = static int reg_name_search PARAMS ((const struct pd_reg *, int, const char *)); -static boolean register_name PARAMS ((expressionS *)); +static bfd_boolean register_name PARAMS ((expressionS *)); static void init_default_arch PARAMS ((void)); static void s390_insert_operand PARAMS ((unsigned char *, const struct s390_operand *, offsetT, char *, @@ -255,7 +259,7 @@ reg_name_search (regs, regcount, name) * original state. */ -static boolean +static bfd_boolean register_name (expressionP) expressionS *expressionP; { @@ -269,7 +273,7 @@ register_name (expressionP) if (name[0] == '%' && ISALPHA (name[1])) name = ++input_line_pointer; else - return false; + return FALSE; c = get_symbol_end (); reg_number = reg_name_search (pre_defined_registers, REG_NAME_CNT, name); @@ -286,12 +290,12 @@ register_name (expressionP) /* Make the rest nice. */ expressionP->X_add_symbol = NULL; expressionP->X_op_symbol = NULL; - return true; + return TRUE; } /* Reset the line as if we had not done anything. */ input_line_pointer = start; - return false; + return FALSE; } /* Local variables. */ @@ -319,26 +323,37 @@ struct option md_longopts[] = { size_t md_longopts_size = sizeof (md_longopts); /* Initialize the default opcode arch and word size from the default - architecture name. */ + architecture name if not specified by an option. */ static void init_default_arch () { - if (current_arch_requested) - return; - if (strcmp (default_arch, "s390") == 0) { - s390_arch_size = 32; - current_architecture = S390_OPCODE_ESA; + if (s390_arch_size == 0) + s390_arch_size = 32; } else if (strcmp (default_arch, "s390x") == 0) { - s390_arch_size = 64; - current_architecture = S390_OPCODE_ESAME; + if (s390_arch_size == 0) + s390_arch_size = 64; } else as_fatal ("Invalid default architecture, broken assembler."); - current_arch_mask = 1 << current_architecture; + + if (current_mode_mask == 0) + { + if (s390_arch_size == 32) + current_mode_mask = 1 << S390_OPCODE_ESA; + else + current_mode_mask = 1 << S390_OPCODE_ZARCH; + } + if (current_cpu == -1U) + { + if (current_mode_mask == (1 << S390_OPCODE_ESA)) + current_cpu = S390_OPCODE_G5; + else + current_cpu = S390_OPCODE_Z900; + } } /* Called by TARGET_FORMAT. */ @@ -347,8 +362,7 @@ s390_target_format () { /* We don't get a chance to initialize anything before we're called, so handle that now. */ - if (! s390_arch_size) - init_default_arch (); + init_default_arch (); return s390_arch_size == 64 ? "elf64-s390" : "elf32-s390"; } @@ -365,20 +379,43 @@ md_parse_option (c, arg) break; case 'm': if (arg != NULL && strcmp (arg, "regnames") == 0) - reg_names_p = true; + reg_names_p = TRUE; else if (arg != NULL && strcmp (arg, "no-regnames") == 0) - reg_names_p = false; + reg_names_p = FALSE; else if (arg != NULL && strcmp (arg, "warn-areg-zero") == 0) warn_areg_zero = TRUE; else if (arg != NULL && strcmp (arg, "31") == 0) - s390_arch_size = 31; + s390_arch_size = 32; else if (arg != NULL && strcmp (arg, "64") == 0) s390_arch_size = 64; + else if (arg != NULL && strcmp (arg, "esa") == 0) + current_mode_mask = 1 << S390_OPCODE_ESA; + + else if (arg != NULL && strcmp (arg, "zarch") == 0) + current_mode_mask = 1 << S390_OPCODE_ZARCH; + + else if (arg != NULL && strncmp (arg, "arch=", 5) == 0) + { + if (strcmp (arg + 5, "g5") == 0) + current_cpu = S390_OPCODE_G5; + else if (strcmp (arg + 5, "g6") == 0) + current_cpu = S390_OPCODE_G6; + else if (strcmp (arg + 5, "z900") == 0) + current_cpu = S390_OPCODE_Z900; + else if (strcmp (arg + 5, "z990") == 0) + current_cpu = S390_OPCODE_Z990; + else + { + as_bad (_("invalid switch -m%s"), arg); + return 0; + } + } + else { as_bad (_("invalid switch -m%s"), arg); @@ -387,14 +424,13 @@ md_parse_option (c, arg) break; case 'A': + /* Option -A is deprecated. Still available for compatibility. */ if (arg != NULL && strcmp (arg, "esa") == 0) - current_architecture = S390_OPCODE_ESA; + current_cpu = S390_OPCODE_G5; else if (arg != NULL && strcmp (arg, "esame") == 0) - current_architecture = S390_OPCODE_ESAME; + current_cpu = S390_OPCODE_Z900; else as_bad ("invalid architecture -A%s", arg); - current_arch_mask = 1 << current_architecture; - current_arch_requested = 1; break; /* -V: SVR4 argument to print version ID. */ @@ -439,13 +475,15 @@ md_begin () { register const struct s390_opcode *op; const struct s390_opcode *op_end; - boolean dup_insn = false; + bfd_boolean dup_insn = FALSE; const char *retval; /* Give a warning if the combination -m64-bit and -Aesa is used. */ - if (s390_arch_size == 64 && current_arch_mask == (1 << S390_OPCODE_ESA)) + if (s390_arch_size == 64 && current_cpu < S390_OPCODE_Z900) as_warn ("The 64 bit file format is used without esame instructions."); + s390_cie_data_alignment = -s390_arch_size / 8; + /* Set the ELF flags if desired. */ if (s390_flags) bfd_set_private_flags (stdoutput, s390_flags); @@ -461,7 +499,7 @@ md_begin () { as_bad (_("Internal assembler error for instruction format %s"), op->name); - dup_insn = true; + dup_insn = TRUE; } } @@ -470,14 +508,18 @@ md_begin () op_end = s390_opcodes + s390_num_opcodes; for (op = s390_opcodes; op < op_end; op++) - { - retval = hash_insert (s390_opcode_hash, op->name, (PTR) op); - if (retval != (const char *) NULL) - { - as_bad (_("Internal assembler error for instruction %s"), op->name); - dup_insn = true; - } - } + if (op->min_cpu <= current_cpu) + { + retval = hash_insert (s390_opcode_hash, op->name, (PTR) op); + if (retval != (const char *) NULL) + { + as_bad (_("Internal assembler error for instruction %s"), + op->name); + dup_insn = TRUE; + } + while (op < op_end - 1 && strcmp (op->name, op[1].name) == 0) + op++; + } if (dup_insn) abort (); @@ -498,19 +540,6 @@ s390_md_end () bfd_set_arch_mach (stdoutput, bfd_arch_s390, bfd_mach_s390_31); } -void -s390_align_code (fragP, count) - fragS *fragP; - int count; -{ - /* We use nop pattern 0x0707. */ - if (count > 0) - { - memset (fragP->fr_literal + fragP->fr_fix, 0x07, count); - fragP->fr_var = count; - } -} - /* Insert an operand value into an instruction. */ static void @@ -555,6 +584,9 @@ s390_insert_operand (insn, operand, val, file, line) } /* val is ok, now restrict it to operand->bits bits. */ uval = (addressT) val & ((((addressT) 1 << (operand->bits-1)) << 1) - 1); + /* val is restrict, now check for special case. */ + if (operand->bits == 20 && operand->shift == 20) + uval = (uval >> 12) | ((uval & 0xfff) << 8); } else { @@ -599,13 +631,83 @@ s390_insert_operand (insn, operand, val, file, line) } } +struct map_tls + { + char *string; + int length; + bfd_reloc_code_real_type reloc; + }; + +static bfd_reloc_code_real_type s390_tls_suffix + PARAMS ((char **, expressionS *)); + +/* Parse tls marker and return the desired relocation. */ +static bfd_reloc_code_real_type +s390_tls_suffix (str_p, exp_p) + char **str_p; + expressionS *exp_p; +{ + static struct map_tls mapping[] = + { + { "tls_load", 8, BFD_RELOC_390_TLS_LOAD }, + { "tls_gdcall", 10, BFD_RELOC_390_TLS_GDCALL }, + { "tls_ldcall", 10, BFD_RELOC_390_TLS_LDCALL }, + { NULL, 0, BFD_RELOC_UNUSED } + }; + struct map_tls *ptr; + char *orig_line; + char *str; + char *ident; + int len; + + str = *str_p; + if (*str++ != ':') + return BFD_RELOC_UNUSED; + + ident = str; + while (ISIDNUM (*str)) + str++; + len = str - ident; + if (*str++ != ':') + return BFD_RELOC_UNUSED; + + orig_line = input_line_pointer; + input_line_pointer = str; + expression (exp_p); + str = input_line_pointer; + if (&input_line_pointer != str_p) + input_line_pointer = orig_line; + + if (exp_p->X_op != O_symbol) + return BFD_RELOC_UNUSED; + + for (ptr = &mapping[0]; ptr->length > 0; ptr++) + if (len == ptr->length + && strncasecmp (ident, ptr->string, ptr->length) == 0) + { + /* Found a matching tls suffix. */ + *str_p = str; + return ptr->reloc; + } + return BFD_RELOC_UNUSED; +} + /* Structure used to hold suffixes. */ typedef enum { ELF_SUFFIX_NONE = 0, ELF_SUFFIX_GOT, ELF_SUFFIX_PLT, - ELF_SUFFIX_GOTENT + ELF_SUFFIX_GOTENT, + ELF_SUFFIX_GOTOFF, + ELF_SUFFIX_GOTPLT, + ELF_SUFFIX_PLTOFF, + ELF_SUFFIX_TLS_GD, + ELF_SUFFIX_TLS_GOTIE, + ELF_SUFFIX_TLS_IE, + ELF_SUFFIX_TLS_LDM, + ELF_SUFFIX_TLS_LDO, + ELF_SUFFIX_TLS_LE } elf_suffix_type; @@ -634,6 +736,15 @@ s390_elf_suffix (str_p, exp_p) { "got12", 5, ELF_SUFFIX_GOT }, { "plt", 3, ELF_SUFFIX_PLT }, { "gotent", 6, ELF_SUFFIX_GOTENT }, + { "gotoff", 6, ELF_SUFFIX_GOTOFF }, + { "gotplt", 6, ELF_SUFFIX_GOTPLT }, + { "pltoff", 6, ELF_SUFFIX_PLTOFF }, + { "tlsgd", 5, ELF_SUFFIX_TLS_GD }, + { "gotntpoff", 9, ELF_SUFFIX_TLS_GOTIE }, + { "indntpoff", 9, ELF_SUFFIX_TLS_IE }, + { "tlsldm", 6, ELF_SUFFIX_TLS_LDM }, + { "dtpoff", 6, ELF_SUFFIX_TLS_LDO }, + { "ntpoff", 6, ELF_SUFFIX_TLS_LE }, { NULL, 0, ELF_SUFFIX_NONE } }; @@ -949,22 +1060,72 @@ s390_elf_cons (nbytes) int size; char *where; - if (nbytes == 2 && suffix == ELF_SUFFIX_GOT) - reloc = BFD_RELOC_390_GOT16; - else if (nbytes == 4 && suffix == ELF_SUFFIX_GOT) - reloc = BFD_RELOC_32_GOT_PCREL; - else if (nbytes == 8 && suffix == ELF_SUFFIX_GOT) - reloc = BFD_RELOC_390_GOT64; - else if (nbytes == 4 && suffix == ELF_SUFFIX_PLT) - reloc = BFD_RELOC_390_PLT32; - else if (nbytes == 8 && suffix == ELF_SUFFIX_PLT) - reloc = BFD_RELOC_390_PLT64; + if (nbytes == 2) + { + static bfd_reloc_code_real_type tab2[] = + { + BFD_RELOC_UNUSED, /* ELF_SUFFIX_NONE */ + BFD_RELOC_390_GOT16, /* ELF_SUFFIX_GOT */ + BFD_RELOC_UNUSED, /* ELF_SUFFIX_PLT */ + BFD_RELOC_UNUSED, /* ELF_SUFFIX_GOTENT */ + BFD_RELOC_16_GOTOFF, /* ELF_SUFFIX_GOTOFF */ + BFD_RELOC_UNUSED, /* ELF_SUFFIX_GOTPLT */ + BFD_RELOC_390_PLTOFF16, /* ELF_SUFFIX_PLTOFF */ + BFD_RELOC_UNUSED, /* ELF_SUFFIX_TLS_GD */ + BFD_RELOC_UNUSED, /* ELF_SUFFIX_TLS_GOTIE */ + BFD_RELOC_UNUSED, /* ELF_SUFFIX_TLS_IE */ + BFD_RELOC_UNUSED, /* ELF_SUFFIX_TLS_LDM */ + BFD_RELOC_UNUSED, /* ELF_SUFFIX_TLS_LDO */ + BFD_RELOC_UNUSED /* ELF_SUFFIX_TLS_LE */ + }; + reloc = tab2[suffix]; + } + else if (nbytes == 4) + { + static bfd_reloc_code_real_type tab4[] = + { + BFD_RELOC_UNUSED, /* ELF_SUFFIX_NONE */ + BFD_RELOC_32_GOT_PCREL, /* ELF_SUFFIX_GOT */ + BFD_RELOC_390_PLT32, /* ELF_SUFFIX_PLT */ + BFD_RELOC_UNUSED, /* ELF_SUFFIX_GOTENT */ + BFD_RELOC_32_GOTOFF, /* ELF_SUFFIX_GOTOFF */ + BFD_RELOC_390_GOTPLT32, /* ELF_SUFFIX_GOTPLT */ + BFD_RELOC_390_PLTOFF32, /* ELF_SUFFIX_PLTOFF */ + BFD_RELOC_390_TLS_GD32, /* ELF_SUFFIX_TLS_GD */ + BFD_RELOC_390_TLS_GOTIE32, /* ELF_SUFFIX_TLS_GOTIE */ + BFD_RELOC_390_TLS_IE32, /* ELF_SUFFIX_TLS_IE */ + BFD_RELOC_390_TLS_LDM32, /* ELF_SUFFIX_TLS_LDM */ + BFD_RELOC_390_TLS_LDO32, /* ELF_SUFFIX_TLS_LDO */ + BFD_RELOC_390_TLS_LE32 /* ELF_SUFFIX_TLS_LE */ + }; + reloc = tab4[suffix]; + } + else if (nbytes == 8) + { + static bfd_reloc_code_real_type tab8[] = + { + BFD_RELOC_UNUSED, /* ELF_SUFFIX_NONE */ + BFD_RELOC_390_GOT64, /* ELF_SUFFIX_GOT */ + BFD_RELOC_390_PLT64, /* ELF_SUFFIX_PLT */ + BFD_RELOC_UNUSED, /* ELF_SUFFIX_GOTENT */ + BFD_RELOC_390_GOTOFF64, /* ELF_SUFFIX_GOTOFF */ + BFD_RELOC_390_GOTPLT64, /* ELF_SUFFIX_GOTPLT */ + BFD_RELOC_390_PLTOFF64, /* ELF_SUFFIX_PLTOFF */ + BFD_RELOC_390_TLS_GD64, /* ELF_SUFFIX_TLS_GD */ + BFD_RELOC_390_TLS_GOTIE64, /* ELF_SUFFIX_TLS_GOTIE */ + BFD_RELOC_390_TLS_IE64, /* ELF_SUFFIX_TLS_IE */ + BFD_RELOC_390_TLS_LDM64, /* ELF_SUFFIX_TLS_LDM */ + BFD_RELOC_390_TLS_LDO64, /* ELF_SUFFIX_TLS_LDO */ + BFD_RELOC_390_TLS_LE64 /* ELF_SUFFIX_TLS_LE */ + }; + reloc = tab8[suffix]; + } else reloc = BFD_RELOC_UNUSED; - if (reloc != BFD_RELOC_UNUSED) + if (reloc != BFD_RELOC_UNUSED + && (reloc_howto = bfd_reloc_type_lookup (stdoutput, reloc))) { - reloc_howto = bfd_reloc_type_lookup (stdoutput, reloc); size = bfd_get_reloc_size (reloc_howto); if (size > nbytes) as_bad (_("%s relocations do not fit in %d bytes"), @@ -972,9 +1133,9 @@ s390_elf_cons (nbytes) where = frag_more (nbytes); md_number_to_chars (where, 0, size); /* To make fixup_segment do the pc relative conversion the - pcrel parameter on the fix_new_exp call needs to be false. */ + pcrel parameter on the fix_new_exp call needs to be FALSE. */ fix_new_exp (frag_now, where - frag_now->fr_literal, - size, &exp, false, reloc); + size, &exp, FALSE, reloc); } else as_bad (_("relocation not applicable")); @@ -1012,6 +1173,7 @@ md_gather_operands (str, insn, opcode) struct s390_fixup fixups[MAX_INSN_FIXUPS]; const struct s390_operand *operand; const unsigned char *opindex_ptr; + expressionS ex; elf_suffix_type suffix; bfd_reloc_code_real_type reloc; int skip_optional; @@ -1029,7 +1191,6 @@ md_gather_operands (str, insn, opcode) fc = 0; for (opindex_ptr = opcode->operands; *opindex_ptr != 0; opindex_ptr++) { - expressionS ex; char *hold; operand = s390_operands + *opindex_ptr; @@ -1079,11 +1240,11 @@ md_gather_operands (str, insn, opcode) { if ((operand->flags & S390_OPERAND_INDEX) && ex.X_add_number == 0 - && warn_areg_zero == TRUE) + && warn_areg_zero) as_warn ("index register specified but zero"); if ((operand->flags & S390_OPERAND_BASE) && ex.X_add_number == 0 - && warn_areg_zero == TRUE) + && warn_areg_zero) as_warn ("base register specified but zero"); s390_insert_operand (insn, operand, ex.X_add_number, NULL, 0); } @@ -1096,8 +1257,12 @@ md_gather_operands (str, insn, opcode) if (suffix == ELF_SUFFIX_GOT) { - if (operand->flags & S390_OPERAND_DISP) + if ((operand->flags & S390_OPERAND_DISP) && + (operand->bits == 12)) reloc = BFD_RELOC_390_GOT12; + else if ((operand->flags & S390_OPERAND_DISP) && + (operand->bits == 20)) + reloc = BFD_RELOC_390_GOT20; else if ((operand->flags & S390_OPERAND_SIGNED) && (operand->bits == 16)) reloc = BFD_RELOC_390_GOT16; @@ -1120,6 +1285,45 @@ md_gather_operands (str, insn, opcode) && (operand->bits == 32)) reloc = BFD_RELOC_390_GOTENT; } + else if (suffix == ELF_SUFFIX_GOTOFF) + { + if ((operand->flags & S390_OPERAND_SIGNED) + && (operand->bits == 16)) + reloc = BFD_RELOC_16_GOTOFF; + } + else if (suffix == ELF_SUFFIX_PLTOFF) + { + if ((operand->flags & S390_OPERAND_SIGNED) + && (operand->bits == 16)) + reloc = BFD_RELOC_390_PLTOFF16; + } + else if (suffix == ELF_SUFFIX_GOTPLT) + { + if ((operand->flags & S390_OPERAND_DISP) + && (operand->bits == 12)) + reloc = BFD_RELOC_390_GOTPLT12; + else if ((operand->flags & S390_OPERAND_SIGNED) + && (operand->bits == 16)) + reloc = BFD_RELOC_390_GOTPLT16; + else if ((operand->flags & S390_OPERAND_PCREL) + && (operand->bits == 32)) + reloc = BFD_RELOC_390_GOTPLTENT; + } + else if (suffix == ELF_SUFFIX_TLS_GOTIE) + { + if ((operand->flags & S390_OPERAND_DISP) + && (operand->bits == 12)) + reloc = BFD_RELOC_390_TLS_GOTIE12; + else if ((operand->flags & S390_OPERAND_DISP) + && (operand->bits == 20)) + reloc = BFD_RELOC_390_TLS_GOTIE20; + } + else if (suffix == ELF_SUFFIX_TLS_IE) + { + if ((operand->flags & S390_OPERAND_PCREL) + && (operand->bits == 32)) + reloc = BFD_RELOC_390_TLS_IEENT; + } if (suffix != ELF_SUFFIX_NONE && reloc == BFD_RELOC_UNUSED) as_bad (_("invalid operand suffix")); @@ -1140,7 +1344,7 @@ md_gather_operands (str, insn, opcode) /* After a displacement a block in parentheses can start. */ if (*str != '(') { - /* Check if parethesed block can be skipped. If the next + /* Check if parenthesized block can be skipped. If the next operand is neiter an optional operand nor a base register then we have a syntax error. */ operand = s390_operands + *(++opindex_ptr); @@ -1151,7 +1355,7 @@ md_gather_operands (str, insn, opcode) while (!(operand->flags & S390_OPERAND_BASE)) operand = s390_operands + *(++opindex_ptr); - /* If there is a next operand it must be seperated by a comma. */ + /* If there is a next operand it must be separated by a comma. */ if (opindex_ptr[1] != '\0') { if (*str++ != ',') @@ -1184,7 +1388,7 @@ md_gather_operands (str, insn, opcode) if (*str++ != ')') as_bad (_("syntax error; missing ')' after base register")); skip_optional = 0; - /* If there is a next operand it must be seperated by a comma. */ + /* If there is a next operand it must be separated by a comma. */ if (opindex_ptr[1] != '\0') { if (*str++ != ',') @@ -1203,7 +1407,7 @@ md_gather_operands (str, insn, opcode) as_bad (_("syntax error; ')' not allowed here")); str++; } - /* If there is a next operand it must be seperated by a comma. */ + /* If there is a next operand it must be separated by a comma. */ if (opindex_ptr[1] != '\0') { if (*str++ != ',') @@ -1215,6 +1419,20 @@ md_gather_operands (str, insn, opcode) while (ISSPACE (*str)) ++str; + /* Check for tls instruction marker. */ + reloc = s390_tls_suffix (&str, &ex); + if (reloc != BFD_RELOC_UNUSED) + { + /* We need to generate a fixup of type 'reloc' for this + instruction. */ + if (fc >= MAX_INSN_FIXUPS) + as_fatal (_("too many fixups")); + fixups[fc].exp = ex; + fixups[fc].opindex = -1; + fixups[fc].reloc = reloc; + ++fc; + } + if (*str != '\0') { char *linefeed; @@ -1239,6 +1457,15 @@ md_gather_operands (str, insn, opcode) md_apply_fix3. */ for (i = 0; i < fc; i++) { + + if (fixups[i].opindex < 0) + { + /* Create tls instruction marker relocation. */ + fix_new_exp (frag_now, f - frag_now->fr_literal, opcode->oplen, + &fixups[i].exp, 0, fixups[i].reloc); + continue; + } + operand = s390_operands + fixups[i].opindex; if (fixups[i].reloc != BFD_RELOC_UNUSED) @@ -1264,6 +1491,7 @@ md_gather_operands (str, insn, opcode) because fixup_segment will signal an overflow for large 4 byte quantities for GOT12 relocations. */ if ( fixups[i].reloc == BFD_RELOC_390_GOT12 + || fixups[i].reloc == BFD_RELOC_390_GOT20 || fixups[i].reloc == BFD_RELOC_390_GOT16) fixP->fx_no_overflow = 1; } @@ -1299,12 +1527,11 @@ md_assemble (str) as_bad (_("Unrecognized opcode: `%s'"), str); return; } - else if (!(opcode->architecture & current_arch_mask)) + else if (!(opcode->modes & current_mode_mask)) { - as_bad ("Opcode %s not available in this architecture", str); + as_bad ("Opcode %s not available in this mode", str); return; } - memcpy (insn, opcode->opcode, sizeof (insn)); md_gather_operands (s, insn, opcode); } @@ -1374,9 +1601,15 @@ s390_insn (ignore) expression (&exp); if (exp.X_op == O_constant) { - if ( ((opformat->oplen == 6) && (exp.X_op > 0) && (exp.X_op < (1ULL << 48))) - || ((opformat->oplen == 4) && (exp.X_op > 0) && (exp.X_op < (1ULL << 32))) - || ((opformat->oplen == 2) && (exp.X_op > 0) && (exp.X_op < (1ULL << 16)))) + if ( ( opformat->oplen == 6 + && exp.X_add_number >= 0 + && (addressT) exp.X_add_number < (1ULL << 48)) + || ( opformat->oplen == 4 + && exp.X_add_number >= 0 + && (addressT) exp.X_add_number < (1ULL << 32)) + || ( opformat->oplen == 2 + && exp.X_add_number >= 0 + && (addressT) exp.X_add_number < (1ULL << 16))) md_number_to_chars (insn, exp.X_add_number, opformat->oplen); else as_bad (_("Invalid .insn format\n")); @@ -1628,25 +1861,53 @@ int tc_s390_fix_adjustable (fixP) fixS *fixP; { - /* Prevent all adjustments to global symbols. */ - if (S_IS_EXTERN (fixP->fx_addsy)) - return 0; - if (S_IS_WEAK (fixP->fx_addsy)) - return 0; /* Don't adjust references to merge sections. */ if ((S_GET_SEGMENT (fixP->fx_addsy)->flags & SEC_MERGE) != 0) return 0; /* adjust_reloc_syms doesn't know about the GOT. */ - if ( fixP->fx_r_type == BFD_RELOC_32_GOTOFF + if ( fixP->fx_r_type == BFD_RELOC_16_GOTOFF + || fixP->fx_r_type == BFD_RELOC_32_GOTOFF + || fixP->fx_r_type == BFD_RELOC_390_GOTOFF64 + || fixP->fx_r_type == BFD_RELOC_390_PLTOFF16 + || fixP->fx_r_type == BFD_RELOC_390_PLTOFF32 + || fixP->fx_r_type == BFD_RELOC_390_PLTOFF64 || fixP->fx_r_type == BFD_RELOC_390_PLT16DBL || fixP->fx_r_type == BFD_RELOC_390_PLT32 || fixP->fx_r_type == BFD_RELOC_390_PLT32DBL || fixP->fx_r_type == BFD_RELOC_390_PLT64 || fixP->fx_r_type == BFD_RELOC_390_GOT12 + || fixP->fx_r_type == BFD_RELOC_390_GOT20 || fixP->fx_r_type == BFD_RELOC_390_GOT16 || fixP->fx_r_type == BFD_RELOC_32_GOT_PCREL || fixP->fx_r_type == BFD_RELOC_390_GOT64 || fixP->fx_r_type == BFD_RELOC_390_GOTENT + || fixP->fx_r_type == BFD_RELOC_390_GOTPLT12 + || fixP->fx_r_type == BFD_RELOC_390_GOTPLT16 + || fixP->fx_r_type == BFD_RELOC_390_GOTPLT20 + || fixP->fx_r_type == BFD_RELOC_390_GOTPLT32 + || fixP->fx_r_type == BFD_RELOC_390_GOTPLT64 + || fixP->fx_r_type == BFD_RELOC_390_GOTPLTENT + || fixP->fx_r_type == BFD_RELOC_390_TLS_LOAD + || fixP->fx_r_type == BFD_RELOC_390_TLS_GDCALL + || fixP->fx_r_type == BFD_RELOC_390_TLS_LDCALL + || fixP->fx_r_type == BFD_RELOC_390_TLS_GD32 + || fixP->fx_r_type == BFD_RELOC_390_TLS_GD64 + || fixP->fx_r_type == BFD_RELOC_390_TLS_GOTIE12 + || fixP->fx_r_type == BFD_RELOC_390_TLS_GOTIE20 + || fixP->fx_r_type == BFD_RELOC_390_TLS_GOTIE32 + || fixP->fx_r_type == BFD_RELOC_390_TLS_GOTIE64 + || fixP->fx_r_type == BFD_RELOC_390_TLS_LDM32 + || fixP->fx_r_type == BFD_RELOC_390_TLS_LDM64 + || fixP->fx_r_type == BFD_RELOC_390_TLS_IE32 + || fixP->fx_r_type == BFD_RELOC_390_TLS_IE64 + || fixP->fx_r_type == BFD_RELOC_390_TLS_IEENT + || fixP->fx_r_type == BFD_RELOC_390_TLS_LE32 + || fixP->fx_r_type == BFD_RELOC_390_TLS_LE64 + || fixP->fx_r_type == BFD_RELOC_390_TLS_LDO32 + || fixP->fx_r_type == BFD_RELOC_390_TLS_LDO64 + || fixP->fx_r_type == BFD_RELOC_390_TLS_DTPMOD + || fixP->fx_r_type == BFD_RELOC_390_TLS_DTPOFF + || fixP->fx_r_type == BFD_RELOC_390_TLS_TPOFF || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) return 0; @@ -1654,7 +1915,7 @@ tc_s390_fix_adjustable (fixP) } /* Return true if we must always emit a reloc for a type and false if - there is some hope of resolving it a assembly time. */ + there is some hope of resolving it at assembly time. */ int tc_s390_force_relocation (fixp) struct fix *fixp; @@ -1664,8 +1925,13 @@ tc_s390_force_relocation (fixp) switch (fixp->fx_r_type) { case BFD_RELOC_390_GOT12: + case BFD_RELOC_390_GOT20: case BFD_RELOC_32_GOT_PCREL: case BFD_RELOC_32_GOTOFF: + case BFD_RELOC_390_GOTOFF64: + case BFD_RELOC_390_PLTOFF16: + case BFD_RELOC_390_PLTOFF32: + case BFD_RELOC_390_PLTOFF64: case BFD_RELOC_390_GOTPC: case BFD_RELOC_390_GOT16: case BFD_RELOC_390_GOTPCDBL: @@ -1675,12 +1941,18 @@ tc_s390_force_relocation (fixp) case BFD_RELOC_390_PLT16DBL: case BFD_RELOC_390_PLT32DBL: case BFD_RELOC_390_PLT64: - case BFD_RELOC_VTABLE_INHERIT: - case BFD_RELOC_VTABLE_ENTRY: + case BFD_RELOC_390_GOTPLT12: + case BFD_RELOC_390_GOTPLT16: + case BFD_RELOC_390_GOTPLT20: + case BFD_RELOC_390_GOTPLT32: + case BFD_RELOC_390_GOTPLT64: + case BFD_RELOC_390_GOTPLTENT: return 1; default: - return 0; + break;; } + + return generic_force_reloc (fixp); } /* Apply a fixup to the object code. This is called for all the @@ -1696,7 +1968,7 @@ void md_apply_fix3 (fixP, valP, seg) fixS *fixP; valueT *valP; - segT seg; + segT seg ATTRIBUTE_UNUSED; { char *where; valueT value = *valP; @@ -1704,35 +1976,13 @@ md_apply_fix3 (fixP, valP, seg) where = fixP->fx_frag->fr_literal + fixP->fx_where; if (fixP->fx_subsy != NULL) - { - if ((fixP->fx_addsy != NULL - && S_GET_SEGMENT (fixP->fx_addsy) == S_GET_SEGMENT (fixP->fx_subsy) - && SEG_NORMAL (S_GET_SEGMENT (fixP->fx_addsy))) - || (S_GET_SEGMENT (fixP->fx_subsy) == absolute_section)) - value += S_GET_VALUE (fixP->fx_subsy); - if (!S_IS_DEFINED (fixP->fx_subsy)) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("unresolved fx_subsy symbol that must be resolved")); - value -= S_GET_VALUE (fixP->fx_subsy); - - if (S_GET_SEGMENT (fixP->fx_subsy) == seg && ! fixP->fx_pcrel) - value += MD_PCREL_FROM_SECTION (fixP, seg); - } + as_bad_where (fixP->fx_file, fixP->fx_line, + "cannot emit relocation %s against subsy symbol %s", + bfd_get_reloc_code_name (fixP->fx_r_type), + S_GET_NAME (fixP->fx_subsy)); if (fixP->fx_addsy != NULL) { - if ((fixP->fx_subsy != NULL - && S_GET_SEGMENT (fixP->fx_addsy) == S_GET_SEGMENT (fixP->fx_subsy) - && SEG_NORMAL (S_GET_SEGMENT (fixP->fx_addsy))) - || (S_GET_SEGMENT (fixP->fx_addsy) == seg - && fixP->fx_pcrel && TC_RELOC_RTSYM_LOC_FIXUP (fixP)) - || (!fixP->fx_pcrel - && S_GET_SEGMENT (fixP->fx_addsy) == absolute_section) - || (S_GET_SEGMENT (fixP->fx_addsy) != undefined_section - && !bfd_is_com_section (S_GET_SEGMENT (fixP->fx_addsy)) - && TC_FIX_ADJUSTABLE (fixP))) - value -= S_GET_VALUE (fixP->fx_addsy); - if (fixP->fx_pcrel) value += fixP->fx_frag->fr_address + fixP->fx_where; } @@ -1771,6 +2021,12 @@ md_apply_fix3 (fixP, valP, seg) fixP->fx_where += 4; fixP->fx_r_type = BFD_RELOC_390_12; } + else if (operand->bits == 20 && operand->shift == 20) + { + fixP->fx_size = 2; + fixP->fx_where += 2; + fixP->fx_r_type = BFD_RELOC_390_20; + } else if (operand->bits == 8 && operand->shift == 8) { fixP->fx_size = 1; @@ -1826,6 +2082,7 @@ md_apply_fix3 (fixP, valP, seg) break; case BFD_RELOC_390_12: case BFD_RELOC_390_GOT12: + case BFD_RELOC_390_GOTPLT12: if (fixP->fx_done) { unsigned short mop; @@ -1836,6 +2093,19 @@ md_apply_fix3 (fixP, valP, seg) } break; + case BFD_RELOC_390_20: + case BFD_RELOC_390_GOT20: + case BFD_RELOC_390_GOTPLT20: + if (fixP->fx_done) + { + unsigned int mop; + mop = bfd_getb32 ((unsigned char *) where); + mop |= (unsigned int) ((value & 0xfff) << 8 | + (value & 0xff000) >> 12); + bfd_putb32 ((bfd_vma) mop, (unsigned char *) where); + } + break; + case BFD_RELOC_16: case BFD_RELOC_GPREL16: case BFD_RELOC_16_GOT_PCREL: @@ -1852,6 +2122,8 @@ md_apply_fix3 (fixP, valP, seg) md_number_to_chars (where, value, 2); break; case BFD_RELOC_390_GOT16: + case BFD_RELOC_390_PLTOFF16: + case BFD_RELOC_390_GOTPLT16: if (fixP->fx_done) md_number_to_chars (where, value, 2); break; @@ -1877,7 +2149,9 @@ md_apply_fix3 (fixP, valP, seg) md_number_to_chars (where, value, 4); break; case BFD_RELOC_32_GOT_PCREL: + case BFD_RELOC_390_PLTOFF32: case BFD_RELOC_390_PLT32: + case BFD_RELOC_390_GOTPLT32: if (fixP->fx_done) md_number_to_chars (where, value, 4); break; @@ -1885,6 +2159,7 @@ md_apply_fix3 (fixP, valP, seg) case BFD_RELOC_390_PLT32DBL: case BFD_RELOC_390_GOTPCDBL: case BFD_RELOC_390_GOTENT: + case BFD_RELOC_390_GOTPLTENT: value += 2; if (fixP->fx_done) md_number_to_chars (where, (offsetT) value >> 1, 4); @@ -1895,8 +2170,15 @@ md_apply_fix3 (fixP, valP, seg) md_number_to_chars (where, value, sizeof (int)); break; + case BFD_RELOC_390_GOTOFF64: + if (fixP->fx_done) + md_number_to_chars (where, value, 8); + break; + case BFD_RELOC_390_GOT64: + case BFD_RELOC_390_PLTOFF64: case BFD_RELOC_390_PLT64: + case BFD_RELOC_390_GOTPLT64: if (fixP->fx_done) md_number_to_chars (where, value, 8); break; @@ -1921,6 +2203,33 @@ md_apply_fix3 (fixP, valP, seg) fixP->fx_done = 0; return; + case BFD_RELOC_390_TLS_LOAD: + case BFD_RELOC_390_TLS_GDCALL: + case BFD_RELOC_390_TLS_LDCALL: + case BFD_RELOC_390_TLS_GD32: + case BFD_RELOC_390_TLS_GD64: + case BFD_RELOC_390_TLS_GOTIE12: + case BFD_RELOC_390_TLS_GOTIE20: + case BFD_RELOC_390_TLS_GOTIE32: + case BFD_RELOC_390_TLS_GOTIE64: + case BFD_RELOC_390_TLS_LDM32: + case BFD_RELOC_390_TLS_LDM64: + case BFD_RELOC_390_TLS_IE32: + case BFD_RELOC_390_TLS_IE64: + case BFD_RELOC_390_TLS_LE32: + case BFD_RELOC_390_TLS_LE64: + case BFD_RELOC_390_TLS_LDO32: + case BFD_RELOC_390_TLS_LDO64: + case BFD_RELOC_390_TLS_DTPMOD: + case BFD_RELOC_390_TLS_DTPOFF: + case BFD_RELOC_390_TLS_TPOFF: + /* Fully resolved at link time. */ + break; + case BFD_RELOC_390_TLS_IEENT: + /* Fully resolved at link time. */ + value += 2; + break; + default: { const char *reloc_name = bfd_get_reloc_code_name (fixP->fx_r_type); @@ -1976,3 +2285,27 @@ tc_gen_reloc (seg, fixp) return reloc; } + +void +s390_cfi_frame_initial_instructions () +{ + cfi_add_CFA_def_cfa (15, s390_arch_size == 64 ? 160 : 96); +} + +int +tc_s390_regname_to_dw2regnum (const char *regname) +{ + int regnum = -1; + + if (regname[0] != 'c' && regname[0] != 'a') + { + regnum = reg_name_search (pre_defined_registers, REG_NAME_CNT, regname); + if (regname[0] == 'f' && regnum != -1) + regnum += 16; + } + else if (strcmp (regname, "ap") == 0) + regnum = 32; + else if (strcmp (regname, "cc") == 0) + regnum = 33; + return regnum; +} diff --git a/contrib/binutils/gas/config/tc-s390.h b/contrib/binutils/gas/config/tc-s390.h index 48dbeda..fe55e15 100644 --- a/contrib/binutils/gas/config/tc-s390.h +++ b/contrib/binutils/gas/config/tc-s390.h @@ -1,5 +1,5 @@ /* tc-s390.h -- Header file for tc-s390.c. - Copyright 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright 2000, 2001, 2002, 2004 Free Software Foundation, Inc. Written by Martin Schwidefsky (schwidefsky@de.ibm.com). This file is part of GAS, the GNU Assembler. @@ -29,29 +29,18 @@ struct fix; #error S390 support requires BFD_ASSEMBLER #endif -/* 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, so GOTOFF does not need to be - checked here. I am not sure if some of the others are ever used with - pcrel, but it is easier to be safe than sorry. */ - -#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ - ((FIX)->fx_r_type != BFD_RELOC_390_GOTENT \ - && ((FIX)->fx_addsy == NULL \ - || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ - && ! S_IS_WEAK ((FIX)->fx_addsy) \ - && S_IS_DEFINED ((FIX)->fx_addsy) \ - && ! S_IS_COMMON ((FIX)->fx_addsy)))) - -#define TC_FORCE_RELOCATION(FIXP) tc_s390_force_relocation(FIXP) +#define TC_FORCE_RELOCATION(FIX) tc_s390_force_relocation(FIX) extern int tc_s390_force_relocation PARAMS ((struct fix *)); +/* Don't resolve foo@PLT-bar to offset@PLT. */ +#define TC_FORCE_RELOCATION_SUB_SAME(FIX, SEG) \ + (! SEG_NORMAL (SEG) || TC_FORCE_RELOCATION (FIX)) + #define tc_fix_adjustable(X) tc_s390_fix_adjustable(X) extern int tc_s390_fix_adjustable PARAMS ((struct fix *)); -#define TC_FIX_ADJUSTABLE(fixP) \ - (! symbol_used_in_reloc_p ((fixP)->fx_addsy) && tc_fix_adjustable (fixP)) +/* Values passed to md_apply_fix3 don't include symbol values. */ +#define MD_APPLY_SYM_VALUE(FIX) 0 /* The target BFD architecture. */ #define TARGET_ARCH bfd_arch_s390 @@ -87,29 +76,27 @@ extern int target_big_endian; #define md_number_to_chars number_to_chars_bigendian -#define md_do_align(n, fill, len, max, around) \ -if ((n) && !need_pass_2 && (fill == 0) && \ - (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) != 0) { \ - char *p; \ - p = frag_var (rs_align_code, 15, 1, (relax_substateT) max, \ - (symbolS *) 0, (offsetT) (n), (char *) 0); \ - *p = 0x07; \ - goto around; \ -} - -extern void s390_align_code PARAMS ((fragS *, int)); - -#define HANDLE_ALIGN(fragP) \ -if (fragP->fr_type == rs_align_code) \ - s390_align_code (fragP, (fragP->fr_next->fr_address \ - - fragP->fr_address \ - - fragP->fr_fix)); +#define NOP_OPCODE 0x07 /* 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(FIX, SEC) md_pcrel_from_section(FIX, SEC) extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); #define md_operand(x) extern void s390_md_end PARAMS ((void)); #define md_end() s390_md_end () + +#define TARGET_USE_CFIPOP 1 + +#define tc_cfi_frame_initial_instructions s390_cfi_frame_initial_instructions +extern void s390_cfi_frame_initial_instructions PARAMS ((void)); + +#define tc_regname_to_dw2regnum tc_s390_regname_to_dw2regnum +extern int tc_s390_regname_to_dw2regnum PARAMS ((const char *regname)); + +extern int s390_cie_data_alignment; + +#define DWARF2_LINE_MIN_INSN_LENGTH 1 +#define DWARF2_DEFAULT_RETURN_COLUMN 14 +#define DWARF2_CIE_DATA_ALIGNMENT s390_cie_data_alignment diff --git a/contrib/binutils/gas/config/tc-sparc.c b/contrib/binutils/gas/config/tc-sparc.c index 5fa4fe9..ba6b4ed 100644 --- a/contrib/binutils/gas/config/tc-sparc.c +++ b/contrib/binutils/gas/config/tc-sparc.c @@ -1,6 +1,6 @@ /* tc-sparc.c -- Assemble for the SPARC Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002 + 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -26,6 +26,7 @@ #include "subsegs.h" #include "opcode/sparc.h" +#include "dw2gencfi.h" #ifdef OBJ_ELF #include "elf/sparc.h" @@ -116,6 +117,9 @@ static int target_little_endian_data; /* Symbols for global registers on v9. */ static symbolS *globals[8]; +/* The dwarf2 data alignment, adjusted for 32 or 64 bit. */ +int sparc_cie_data_alignment; + /* V9 and 86x have big and little endian data, but instructions are always big endian. The sparclet has bi-endian support but both data and insns have the same endianness. Global `target_big_endian' is used for data. @@ -138,7 +142,9 @@ static void s_common PARAMS ((int)); static void s_empty PARAMS ((int)); static void s_uacons PARAMS ((int)); static void s_ncons PARAMS ((int)); +#ifdef OBJ_ELF static void s_register PARAMS ((int)); +#endif const pseudo_typeS md_pseudo_table[] = { @@ -159,8 +165,6 @@ const pseudo_typeS md_pseudo_table[] = {"uaword", s_uacons, 4}, {"uaxword", s_uacons, 8}, #ifdef OBJ_ELF - {"file", (void (*) PARAMS ((int))) dwarf2_directive_file, 0}, - {"loc", dwarf2_directive_loc, 0}, /* These are specific to sparc/svr4. */ {"2byte", s_uacons, 2}, {"4byte", s_uacons, 4}, @@ -723,7 +727,7 @@ struct {NULL, NULL, NULL}, }; -/* sparc64 priviledged registers. */ +/* sparc64 privileged registers. */ struct priv_reg_entry { @@ -798,6 +802,7 @@ md_begin () if (! default_init_p) init_default_arch (); + sparc_cie_data_alignment = sparc_arch_size == 64 ? -8 : -4; op_hash = hash_new (); while (i < (unsigned int) sparc_num_opcodes) @@ -1804,10 +1809,88 @@ sparc_ip (str, pinsn) break; case '\0': /* End of args. */ - if (*s == '\0') + if (s[0] == ',' && s[1] == '%') { - match = 1; + static const struct tls_ops { + /* The name as it appears in assembler. */ + char *name; + /* strlen (name), precomputed for speed */ + int len; + /* The reloc this pseudo-op translates to. */ + int reloc; + /* 1 if call. */ + int call; + } tls_ops[] = { + { "tgd_add", 7, BFD_RELOC_SPARC_TLS_GD_ADD, 0 }, + { "tgd_call", 8, BFD_RELOC_SPARC_TLS_GD_CALL, 1 }, + { "tldm_add", 8, BFD_RELOC_SPARC_TLS_LDM_ADD, 0 }, + { "tldm_call", 9, BFD_RELOC_SPARC_TLS_LDM_CALL, 1 }, + { "tldo_add", 8, BFD_RELOC_SPARC_TLS_LDO_ADD, 0 }, + { "tie_ldx", 7, BFD_RELOC_SPARC_TLS_IE_LDX, 0 }, + { "tie_ld", 6, BFD_RELOC_SPARC_TLS_IE_LD, 0 }, + { "tie_add", 7, BFD_RELOC_SPARC_TLS_IE_ADD, 0 } + }; + const struct tls_ops *o; + char *s1; + int npar = 0; + + for (o = tls_ops; o->name; o++) + if (strncmp (s + 2, o->name, o->len) == 0) + break; + if (o->name == NULL) + break; + + if (s[o->len + 2] != '(') + { + as_bad (_("Illegal operands: %%%s requires arguments in ()"), o->name); + return special_case; + } + + if (! o->call && the_insn.reloc != BFD_RELOC_NONE) + { + as_bad (_("Illegal operands: %%%s cannot be used together with other relocs in the insn ()"), + o->name); + return special_case; + } + + if (o->call + && (the_insn.reloc != BFD_RELOC_32_PCREL_S2 + || the_insn.exp.X_add_number != 0 + || the_insn.exp.X_add_symbol + != symbol_find_or_make ("__tls_get_addr"))) + { + as_bad (_("Illegal operands: %%%s can be only used with call __tls_get_addr"), + o->name); + return special_case; + } + + the_insn.reloc = o->reloc; + memset (&the_insn.exp, 0, sizeof (the_insn.exp)); + s += o->len + 3; + + for (s1 = s; *s1 && *s1 != ',' && *s1 != ']'; s1++) + if (*s1 == '(') + npar++; + else if (*s1 == ')') + { + if (!npar) + break; + npar--; + } + + if (*s1 != ')') + { + as_bad (_("Illegal operands: %%%s requires arguments in ()"), o->name); + return special_case; + } + + *s1 = '\0'; + (void) get_expression (s); + *s1 = ')'; + s = s1 + 1; } + if (*s == '\0') + match = 1; break; case '+': @@ -2063,6 +2146,12 @@ sparc_ip (str, pinsn) { if (SPARC_OPCODE_ARCH_V9_P (max_architecture)) { + if (*args == 'e' || *args == 'f' || *args == 'g') + { + error_message + = _(": There are only 32 single precision f registers; [0-31]"); + goto error; + } v9_arg_p = 1; mask -= 31; /* wrap high bit */ } @@ -2174,6 +2263,18 @@ sparc_ip (str, pinsn) { "l44", 3, BFD_RELOC_SPARC_L44, 1, 0 }, { "uhi", 3, BFD_RELOC_SPARC_HH22, 1, 0 }, { "ulo", 3, BFD_RELOC_SPARC_HM10, 1, 0 }, + { "tgd_hi22", 8, BFD_RELOC_SPARC_TLS_GD_HI22, 0, 0 }, + { "tgd_lo10", 8, BFD_RELOC_SPARC_TLS_GD_LO10, 0, 0 }, + { "tldm_hi22", 9, BFD_RELOC_SPARC_TLS_LDM_HI22, 0, 0 }, + { "tldm_lo10", 9, BFD_RELOC_SPARC_TLS_LDM_LO10, 0, 0 }, + { "tldo_hix22", 10, BFD_RELOC_SPARC_TLS_LDO_HIX22, 0, + 0 }, + { "tldo_lox10", 10, BFD_RELOC_SPARC_TLS_LDO_LOX10, 0, + 0 }, + { "tie_hi22", 8, BFD_RELOC_SPARC_TLS_IE_HI22, 0, 0 }, + { "tie_lo10", 8, BFD_RELOC_SPARC_TLS_IE_LO10, 0, 0 }, + { "tle_hix22", 9, BFD_RELOC_SPARC_TLS_LE_HIX22, 0, 0 }, + { "tle_lox10", 9, BFD_RELOC_SPARC_TLS_LE_LOX10, 0, 0 }, { NULL, 0, 0, 0, 0 } }; const struct ops *o; @@ -2376,6 +2477,13 @@ sparc_ip (str, pinsn) goto error; } + if (the_insn.reloc >= BFD_RELOC_SPARC_TLS_GD_HI22 + && the_insn.reloc <= BFD_RELOC_SPARC_TLS_TPOFF64) + { + error_message = _(": TLS operand can't be a constant"); + goto error; + } + /* Constants that won't fit are checked in md_apply_fix3 and bfd_install_relocation. ??? It would be preferable to install the constants @@ -2891,7 +2999,7 @@ void md_apply_fix3 (fixP, valP, segment) fixS *fixP; valueT *valP; - segT segment; + segT segment ATTRIBUTE_UNUSED; { char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; offsetT val = * (offsetT *) valP; @@ -2902,34 +3010,9 @@ md_apply_fix3 (fixP, valP, segment) fixP->fx_addnumber = val; /* Remember value for emit_reloc. */ #ifdef OBJ_ELF - /* FIXME: SPARC ELF relocations don't use an addend in the data - field itself. This whole approach should be somehow combined - with the calls to bfd_install_relocation. Also, the value passed - in by fixup_segment includes the value of a defined symbol. We - don't want to include the value of an externally visible symbol. */ + /* SPARC ELF relocations don't use an addend in the data field. */ if (fixP->fx_addsy != NULL) - { - symbolS * sym = fixP->fx_addsy; - segT seg = S_GET_SEGMENT (sym); - - if (symbol_used_in_reloc_p (sym) - && (S_IS_EXTERNAL (sym) - || S_IS_WEAK (sym) - || (seg->flags & SEC_MERGE) - || (seg->flags & SEC_THREAD_LOCAL) - || (sparc_pic_code && ! fixP->fx_pcrel) - || (seg != segment - && (((bfd_get_section_flags (stdoutput, seg) & SEC_LINK_ONCE) != 0) - || (strncmp (segment_name (seg), - ".gnu.linkonce", - sizeof ".gnu.linkonce" - 1) == 0)))) - && seg != absolute_section - && seg != undefined_section - && ! bfd_is_com_section (seg)) - fixP->fx_addnumber -= S_GET_VALUE (sym); - - return; - } + return; #endif /* This is a hack. There should be a better way to @@ -3271,7 +3354,7 @@ md_apply_fix3 (fixP, valP, segment) arelent ** tc_gen_reloc (section, fixp) - asection *section; + asection *section ATTRIBUTE_UNUSED; fixS *fixp; { static arelent *relocs[3]; @@ -3328,6 +3411,26 @@ tc_gen_reloc (section, fixp) case BFD_RELOC_SPARC_PLT64: case BFD_RELOC_VTABLE_ENTRY: case BFD_RELOC_VTABLE_INHERIT: + case BFD_RELOC_SPARC_TLS_GD_HI22: + case BFD_RELOC_SPARC_TLS_GD_LO10: + case BFD_RELOC_SPARC_TLS_GD_ADD: + case BFD_RELOC_SPARC_TLS_GD_CALL: + case BFD_RELOC_SPARC_TLS_LDM_HI22: + case BFD_RELOC_SPARC_TLS_LDM_LO10: + case BFD_RELOC_SPARC_TLS_LDM_ADD: + case BFD_RELOC_SPARC_TLS_LDM_CALL: + case BFD_RELOC_SPARC_TLS_LDO_HIX22: + case BFD_RELOC_SPARC_TLS_LDO_LOX10: + case BFD_RELOC_SPARC_TLS_LDO_ADD: + case BFD_RELOC_SPARC_TLS_IE_HI22: + case BFD_RELOC_SPARC_TLS_IE_LO10: + case BFD_RELOC_SPARC_TLS_IE_LD: + case BFD_RELOC_SPARC_TLS_IE_LDX: + case BFD_RELOC_SPARC_TLS_IE_ADD: + case BFD_RELOC_SPARC_TLS_LE_HIX22: + case BFD_RELOC_SPARC_TLS_LE_LOX10: + case BFD_RELOC_SPARC_TLS_DTPOFF32: + case BFD_RELOC_SPARC_TLS_DTPOFF64: code = fixp->fx_r_type; break; default: @@ -3352,10 +3455,7 @@ tc_gen_reloc (section, fixp) switch (code) { case BFD_RELOC_32_PCREL_S2: - if (! S_IS_DEFINED (fixp->fx_addsy) - || S_IS_COMMON (fixp->fx_addsy) - || S_IS_EXTERNAL (fixp->fx_addsy) - || S_IS_WEAK (fixp->fx_addsy)) + if (generic_force_reloc (fixp)) code = BFD_RELOC_SPARC_WPLT30; break; case BFD_RELOC_HI22: @@ -3419,7 +3519,9 @@ tc_gen_reloc (section, fixp) && code != BFD_RELOC_SPARC_WDISP22 && code != BFD_RELOC_SPARC_WDISP16 && code != BFD_RELOC_SPARC_WDISP19 - && code != BFD_RELOC_SPARC_WPLT30) + && code != BFD_RELOC_SPARC_WPLT30 + && code != BFD_RELOC_SPARC_TLS_GD_CALL + && code != BFD_RELOC_SPARC_TLS_LDM_CALL) reloc->addend = fixp->fx_addnumber; else if (symbol_section_p (fixp->fx_addsy)) reloc->addend = (section->vma @@ -3673,7 +3775,7 @@ s_common (ignore) char *name; char c; char *p; - int temp, size; + offsetT temp, size; symbolS *symbolP; name = input_line_pointer; @@ -3694,7 +3796,8 @@ s_common (ignore) if ((temp = get_absolute_expression ()) < 0) { - as_bad (_(".COMMon length (%d.) <0! Ignored."), temp); + as_bad (_(".COMMon length (%lu) out of range ignored"), + (unsigned long) temp); ignore_rest_of_line (); return; } @@ -3712,8 +3815,8 @@ s_common (ignore) { if (S_GET_VALUE (symbolP) != (valueT) 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 .comm \"%s\" is already %ld. Not changed to %ld."), + S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), (long) size); } } else @@ -3844,7 +3947,7 @@ s_common (ignore) } } -/* Handle the .empty pseudo-op. This supresses the warnings about +/* Handle the .empty pseudo-op. This suppresses the warnings about invalid delay slot usage. */ static void @@ -3911,7 +4014,7 @@ s_proc (ignore) } /* This static variable is set by s_uacons to tell sparc_cons_align - that the expession does not need to be aligned. */ + that the expression does not need to be aligned. */ static int sparc_no_align_cons = 0; @@ -4222,6 +4325,16 @@ sparc_cons (exp, size) sparc_cons_special_reloc = "plt"; } } + else if (strncmp (input_line_pointer + 3, "tls_dtpoff", 10) == 0) + { + if (size != 4 && size != 8) + as_bad (_("Illegal operands: %%r_tls_dtpoff in %d-byte data field"), size); + else + { + input_line_pointer += 13; + sparc_cons_special_reloc = "tls_dtpoff"; + } + } if (sparc_cons_special_reloc) { int bad = 0; @@ -4355,12 +4468,18 @@ cons_fix_new_sparc (frag, where, nbytes, exp) case 8: r = BFD_RELOC_64_PCREL; break; default: abort (); } - else + else if (*sparc_cons_special_reloc == 'p') switch (nbytes) { case 4: r = BFD_RELOC_SPARC_PLT32; break; case 8: r = BFD_RELOC_SPARC_PLT64; break; } + else + switch (nbytes) + { + case 4: r = BFD_RELOC_SPARC_TLS_DTPOFF32; break; + case 8: r = BFD_RELOC_SPARC_TLS_DTPOFF64; break; + } } else if (sparc_no_align_cons) { @@ -4374,17 +4493,63 @@ cons_fix_new_sparc (frag, where, nbytes, exp) } fix_new_exp (frag, where, (int) nbytes, exp, 0, r); + sparc_cons_special_reloc = NULL; +} + +void +sparc_cfi_frame_initial_instructions () +{ + cfi_add_CFA_def_cfa (14, sparc_arch_size == 64 ? 0x7ff : 0); } -#ifdef OBJ_ELF int -elf32_sparc_force_relocation (fixp) - struct fix *fixp; +sparc_regname_to_dw2regnum (const char *regname) { - if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT - || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY) - return 1; + char *p, *q; - return 0; + if (!regname[0]) + return -1; + + q = "goli"; + p = strchr (q, regname[0]); + if (p) + { + if (regname[1] < '0' || regname[1] > '8' || regname[2]) + return -1; + return (p - q) * 8 + regname[1] - '0'; + } + if (regname[0] == 's' && regname[1] == 'p' && !regname[2]) + return 14; + if (regname[0] == 'f' && regname[1] == 'p' && !regname[2]) + return 30; + if (regname[0] == 'f' || regname[0] == 'r') + { + unsigned int regnum; + + regnum = strtoul (regname + 1, &q, 10); + if (p == q || *q) + return -1; + if (regnum >= ((regname[0] == 'f' + && SPARC_OPCODE_ARCH_V9_P (max_architecture)) + ? 64 : 32)) + return -1; + if (regname[0] == 'f') + { + regnum += 32; + if (regnum >= 64 && (regnum & 1)) + return -1; + } + return regnum; + } + return -1; +} + +void +sparc_cfi_emit_pcrel_expr (expressionS *exp, unsigned int nbytes) +{ + sparc_cons_special_reloc = "disp"; + sparc_no_align_cons = 1; + emit_expr (exp, nbytes); + sparc_no_align_cons = 0; + sparc_cons_special_reloc = NULL; } -#endif diff --git a/contrib/binutils/gas/config/tc-sparc.h b/contrib/binutils/gas/config/tc-sparc.h index 5d545de..e99222b 100644 --- a/contrib/binutils/gas/config/tc-sparc.h +++ b/contrib/binutils/gas/config/tc-sparc.h @@ -1,6 +1,6 @@ /* tc-sparc.h - Macros and type defines for the sparc. Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -69,74 +69,56 @@ extern void sparc_handle_align PARAMS ((struct frag *)); #define MAX_MEM_FOR_RS_ALIGN_CODE (3 + 4 + 4) -#if defined (OBJ_ELF) || defined (OBJ_AOUT) - -/* 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. - - If the reloc is against an externally visible symbol, then the - a.out assembler should not do the relocation if generating PIC, and - the ELF assembler should never do the relocation. */ - -#ifdef OBJ_ELF -#define obj_relocate_extern 0 -#else -#define obj_relocate_extern (! sparc_pic_code) -#endif - -#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ - (obj_relocate_extern \ - || (FIX)->fx_addsy == NULL \ - || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ - && ! S_IS_WEAK ((FIX)->fx_addsy) \ - && S_IS_DEFINED ((FIX)->fx_addsy) \ - && ! S_IS_COMMON ((FIX)->fx_addsy))) -#endif - /* I know that "call 0" fails in sparc-coff if this doesn't return 1. I don't know about other relocation types, or other formats, yet. */ #ifdef OBJ_COFF -#define TC_FORCE_RELOCATION(FIXP) \ - ((FIXP)->fx_r_type == BFD_RELOC_32_PCREL_S2 \ - && ((FIXP)->fx_addsy == 0 \ - || S_GET_SEGMENT ((FIXP)->fx_addsy) == absolute_section)) +#define TC_FORCE_RELOCATION_ABS(FIX) \ + ((FIX)->fx_r_type == BFD_RELOC_32_PCREL_S2 \ + || TC_FORCE_RELOCATION (FIX)) + #define RELOC_REQUIRES_SYMBOL #endif -#ifdef OBJ_ELF -#define TC_FORCE_RELOCATION(fixp) elf32_sparc_force_relocation(fixp) -extern int elf32_sparc_force_relocation PARAMS ((struct fix *)); +#ifdef OBJ_AOUT +/* This expression evaluates to true if the relocation is for a local + object for which we still want to do the relocation at runtime. + False if we are willing to perform this relocation while building + the .o file. */ + +#define TC_FORCE_RELOCATION_LOCAL(FIX) \ + (!(FIX)->fx_pcrel \ + || (FIX)->fx_plt \ + || (sparc_pic_code \ + && S_IS_EXTERNAL ((FIX)->fx_addsy)) \ + || TC_FORCE_RELOCATION (FIX)) #endif #ifdef OBJ_ELF -/* Keep relocations against global symbols. Don't turn them into - relocations against sections. This is required for the dynamic - linker to operate properly. When generating PIC, we need to keep - any non PC relative reloc. The PIC part of this test must be - parallel to the code in tc_gen_reloc which converts relocations to - GOT relocations. */ +/* Don't turn certain relocs into relocations against sections. This + is required for the dynamic linker to operate properly. When + generating PIC, we need to keep any non PC relative reloc. The PIC + part of this test must be parallel to the code in tc_gen_reloc which + converts relocations to GOT relocations. */ #define tc_fix_adjustable(FIX) \ - (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ - && ! S_IS_WEAK ((FIX)->fx_addsy) \ - && (FIX)->fx_r_type != BFD_RELOC_VTABLE_INHERIT \ + ((FIX)->fx_r_type != BFD_RELOC_VTABLE_INHERIT \ && (FIX)->fx_r_type != BFD_RELOC_VTABLE_ENTRY \ + && ((FIX)->fx_r_type < BFD_RELOC_SPARC_TLS_GD_HI22 \ + || (FIX)->fx_r_type > BFD_RELOC_SPARC_TLS_TPOFF64) \ && (! sparc_pic_code \ || ((FIX)->fx_r_type != BFD_RELOC_HI22 \ && (FIX)->fx_r_type != BFD_RELOC_LO10 \ && (FIX)->fx_r_type != BFD_RELOC_SPARC13 \ && ((FIX)->fx_r_type != BFD_RELOC_32_PCREL_S2 \ - || (S_IS_DEFINED ((FIX)->fx_addsy) \ - && ! S_IS_COMMON ((FIX)->fx_addsy) \ - && ! S_IS_EXTERNAL ((FIX)->fx_addsy) \ - && ! S_IS_WEAK ((FIX)->fx_addsy))) \ + || !generic_force_reloc (FIX)) \ && ((FIX)->fx_pcrel \ || ((FIX)->fx_subsy != NULL \ && (S_GET_SEGMENT ((FIX)->fx_subsy) \ == S_GET_SEGMENT ((FIX)->fx_addsy))) \ || S_IS_LOCAL ((FIX)->fx_addsy))))) +/* Values passed to md_apply_fix3 don't include the symbol value. */ +#define MD_APPLY_SYM_VALUE(FIX) 0 + /* Finish up the entire symtab. */ #define tc_adjust_symtab() sparc_adjust_symtab () extern void sparc_adjust_symtab PARAMS ((void)); @@ -184,14 +166,29 @@ extern void cons_fix_new_sparc } \ while (0) -#define TC_FIX_DATA_PRINT(FILE, FIXP) \ +#define TC_FIX_DATA_PRINT(FILE, FIX) \ do \ { \ fprintf ((FILE), "addend2=%ld\n", \ - (unsigned long) (FIXP)->tc_fix_data); \ + (unsigned long) (FIX)->tc_fix_data); \ } \ while (0) -#define DWARF2_LINE_MIN_INSN_LENGTH 4 +#define TARGET_USE_CFIPOP 1 + +#define tc_cfi_frame_initial_instructions sparc_cfi_frame_initial_instructions +extern void sparc_cfi_frame_initial_instructions PARAMS ((void)); + +#define tc_regname_to_dw2regnum sparc_regname_to_dw2regnum +extern int sparc_regname_to_dw2regnum PARAMS ((const char *regname)); + +#define tc_cfi_emit_pcrel_expr sparc_cfi_emit_pcrel_expr +extern void sparc_cfi_emit_pcrel_expr PARAMS ((expressionS *, unsigned int)); + +extern int sparc_cie_data_alignment; + +#define DWARF2_LINE_MIN_INSN_LENGTH 4 +#define DWARF2_DEFAULT_RETURN_COLUMN 15 +#define DWARF2_CIE_DATA_ALIGNMENT sparc_cie_data_alignment /* end of tc-sparc.h */ diff --git a/contrib/binutils/gas/config/te-generic.h b/contrib/binutils/gas/config/te-generic.h index b8eda45..400a576 100644 --- a/contrib/binutils/gas/config/te-generic.h +++ b/contrib/binutils/gas/config/te-generic.h @@ -6,7 +6,7 @@ * compile, and copying as an aid for testing and porting. xoxorich. */ -/* Added these, because if we don't know what we're targetting we may +/* Added these, because if we don't know what we're targeting we may need an assembler version of libgcc, and that will use local labels. */ #define LOCAL_LABELS_DOLLAR 1 diff --git a/contrib/binutils/gas/config/te-pe.h b/contrib/binutils/gas/config/te-pe.h index 1c1f0b2..b3e0764 100644 --- a/contrib/binutils/gas/config/te-pe.h +++ b/contrib/binutils/gas/config/te-pe.h @@ -1,5 +1,5 @@ #define TE_PE -#define LEX_AT 1 /* can have @'s inside labels */ +#define LEX_AT (LEX_BEGIN_NAME | LEX_NAME) /* Can have @'s inside labels. */ /* The PE format supports long section names. */ #define COFF_LONG_SECTION_NAMES diff --git a/contrib/binutils/gas/config/te-ppcnw.h b/contrib/binutils/gas/config/te-ppcnw.h index fcd3a972..1337591 100644 --- a/contrib/binutils/gas/config/te-ppcnw.h +++ b/contrib/binutils/gas/config/te-ppcnw.h @@ -18,7 +18,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Added these, because if we don't know what we're targetting we may +/* Added these, because if we don't know what we're targeting we may need an assembler version of libgcc, and that will use local labels. */ #define LOCAL_LABELS_DOLLAR 1 diff --git a/contrib/binutils/gas/configure b/contrib/binutils/gas/configure index 53eb2a4..e66abca 100755 --- a/contrib/binutils/gas/configure +++ b/contrib/binutils/gas/configure @@ -1,53 +1,325 @@ #! /bin/sh - # Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# Generated by GNU Autoconf 2.59. # +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -# Defaults: -ac_help= +exec 6>&1 + +# +# Initializations. +# ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help - --enable-shared[=PKGS] build shared libraries [default=yes]" -ac_help="$ac_help - --enable-static[=PKGS] build static libraries [default=yes]" -ac_help="$ac_help - --enable-fast-install[=PKGS] optimize for fast installation [default=yes]" -ac_help="$ac_help - --with-gnu-ld assume the C compiler uses GNU ld [default=no]" -ac_help="$ac_help - --disable-libtool-lock 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-bfd-assembler use BFD back end for writing object files" -ac_help="$ac_help - targets alternative target configurations besides the primary" -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 - --with-included-gettext use the GNU gettext library included here" -ac_help="$ac_help - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer" +ac_config_libobj_dir=. +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="as.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE LN_S RANLIB ac_ct_RANLIB LIBTOOL WARN_CFLAGS GDBINIT cgen_cpu_prefix extra_objects target_cpu_type obj_format te_file install_tooldir atof BFDLIB OPCODES_LIB BFDVER_H ALL_OBJ_DEPS YACC LEX LEXLIB LEX_OUTPUT_ROOT CPP EGREP ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBM LIBOBJS LTLIBOBJS' +ac_subst_files='' # Initialize some variables set by options. +ac_init_help= +ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. -build=NONE -cache_file=./config.cache +cache_file=/dev/null exec_prefix=NONE -host=NONE no_create= -nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE @@ -56,10 +328,15 @@ program_transform_name=s,x,x, silent= site= srcdir= -target=NONE verbose= x_includes=NONE x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' @@ -73,17 +350,9 @@ oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - ac_prev= for ac_option do - # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" @@ -91,59 +360,59 @@ do continue fi - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case "$ac_option" in + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; + bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) - ac_prev=build ;; + ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; + build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) - datadir="$ac_optarg" ;; + datadir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "enable_${ac_feature}='$ac_optarg'" ;; + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -152,95 +421,47 @@ do -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; + exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; -host | --host | --hos | --ho) - ac_prev=host ;; + ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; + host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; + includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; + infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; + libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; + libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ @@ -249,19 +470,19 @@ EOF -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; + localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; + mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) + | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ @@ -275,26 +496,26 @@ EOF -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; + oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; + prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; + program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; + program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ @@ -311,7 +532,7 @@ EOF | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; + program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) @@ -321,7 +542,7 @@ EOF ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; + sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ @@ -332,58 +553,57 @@ EOF | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; + sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; + site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; + srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; + sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; + ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; + target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac - eval "with_${ac_package}='$ac_optarg'" ;; + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -394,99 +614,110 @@ EOF ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; + x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; + x_libraries=$ac_optarg ;; - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac done -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=as.h # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. @@ -496,437 +727,1356 @@ else fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } fi fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP -# 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" - fi -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi +Usage: $0 [OPTION]... [VAR=VALUE]... -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 - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. -echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:552: checking for Cygwin environment" >&5 -if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - 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 +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. -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:585: checking for mingw32 environment" >&5 -if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - 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 +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF -echo "$ac_t""$ac_cv_mingw32" 1>&6 -MINGW32= -test "$ac_cv_mingw32" = yes && MINGW32=yes + cat <<\_ACEOF +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. +if test -n "$ac_init_help"; then -# Do some error checking and defaulting for the host and target type. -# The inputs are: -# configure --host=HOST --target=TARGET --build=BUILD NONOPT -# -# The rules are: -# 1. You are not allowed to specify --host, --target, and nonopt at the -# same time. -# 2. Host defaults to nonopt. -# 3. If nonopt is not specified, then host defaults to the current host, -# as determined by config.guess. -# 4. Target and build default to nonopt. -# 5. If nonopt is not specified, then target and build default to host. + cat <<\_ACEOF -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -case $host---$target---$nonopt in -NONE---*---* | *---NONE---* | *---*---NONE) ;; -*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;; -esac +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared=PKGS build shared libraries default=yes + --enable-static=PKGS build static libraries default=yes + --enable-fast-install=PKGS optimize for fast installation default=yes + --disable-libtool-lock avoid locking (might break parallel builds) + --enable-bfd-assembler use BFD back end for writing object files + targets alternative target configurations besides the primary + --enable-commonbfdlib build shared BFD/opcodes/libiberty library + --enable-build-warnings Enable build-time compiler warnings if gcc is used + --disable-nls do not use Native Language Support + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-gnu-ld assume the C compiler uses GNU ld default=no + --with-pic try to use only PIC/non-PIC objects default=use both + --with-included-gettext use the GNU gettext library included here +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF fi -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:662: checking host system type" >&5 +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; - *) host_alias=$nonopt ;; - esac ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - -echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:683: checking target system type" >&5 - -target_alias=$target -case "$target_alias" in -NONE) - case $nonopt in - NONE) target_alias=$host_alias ;; - *) target_alias=$nonopt ;; - esac ;; +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; esac - -target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` -target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$target" 1>&6 - -echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:701: checking build system type" >&5 - -build_alias=$build -case "$build_alias" in -NONE) - case $nonopt in - NONE) build_alias=$host_alias ;; - *) build_alias=$nonopt ;; - esac ;; +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; esac -build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` -build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$build" 1>&6 - -test "$host_alias" != "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - 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:726: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - 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 + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi + cd "$ac_popdir" 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 + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF + +Copyright (C) 2003 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. -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:756: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - 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 +It was created by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_sep= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------- ## +## Output files. ## +## ------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + sed "/^$/d" confdefs.h | sort + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# 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" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + +ac_aux_dir= +for ac_dir in .. $srcdir/..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in .. $srcdir/.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in .. $srcdir/.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +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 + if test $# != 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="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&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:807: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - ;; - esac - fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } + + test -n "$CC" && break + done fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:839: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi -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 + test -n "$ac_ct_CC" && break +done -cat > conftest.$ac_ext << EOF + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -#line 850 "configure" -#include "confdefs.h" +int +main () +{ -main(){return(0);} -EOF -if { (eval echo configure:855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext + break;; + * ) + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no else - ac_cv_prog_cc_cross=yes + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } 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:881: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:886: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.c <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done else - ac_cv_prog_gcc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 +int +main () +{ +#ifndef __GNUC__ + choke me +#endif -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -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:914: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else - ac_cv_prog_cc_g=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" + CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" @@ -940,30 +2090,394 @@ else CFLAGS= fi fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} -echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:946: checking for POSIXized ISC" >&5 -if test -d /etc/conf/kconfig.d && - grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 -then - 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 +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi - if test "$GCC" = yes; then - CC="$CC -posix" - else - CC="$CC -Xp" - fi else - echo "$ac_t""no" 1>&6 - ISC= + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for library containing strerror" >&5 +echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6 +if test "${ac_cv_search_strerror+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +ac_cv_search_strerror=no +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror (); +int +main () +{ +strerror (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_strerror="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_strerror" = no; then + for ac_lib in cposix; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror (); +int +main () +{ +strerror (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_strerror="-l$ac_lib" +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi +LIBS=$ac_func_search_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5 +echo "${ECHO_T}$ac_cv_search_strerror" >&6 +if test "$ac_cv_search_strerror" != no; then + test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS" + fi BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in` +am__api_version="1.8" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -971,233 +2485,573 @@ BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${ # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic # ./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:980: checking for a BSD compatible install" >&5 +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then -if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - if test -f $ac_dir/$ac_prog; then + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : else - ac_cv_path_install="$ac_dir/$ac_prog -c" - break 2 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 fi fi done - ;; - esac - done - IFS="$ac_save_IFS" + done + ;; +esac +done + fi if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" + INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. - INSTALL="$ac_install_sh" + INSTALL=$ac_install_sh fi fi -echo "$ac_t""$INSTALL" 1>&6 +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:1033: checking whether build environment is sane" >&5 +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 # Just in case sleep 1 -echo timestamp > conftestfile +echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. - set X `ls -t $srcdir/configure conftestfile` + set X `ls -t $srcdir/configure conftest.file` fi - if test "$*" != "X $srcdir/configure conftestfile" \ - && test "$*" != "X conftestfile $srcdir/configure"; then + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". - { echo "configure: error: ls -t appears to fail. Make sure there is not a broken -alias in your environment" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } fi - test "$2" = conftestfile + test "$2" = conftest.file ) then # Ok. : else - { echo "configure: error: newly created file is older than distributed files! -Check your system clock" 1>&2; exit 1; } -fi -rm -f conftest* -echo "$ac_t""yes" 1>&6 -if test "$program_transform_name" = s,x,x,; then - program_transform_name= -else - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" + program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + # Keeping the `.' argument allows $(mkdir_p) to be used without + # argument. Indeed, we sometimes output rules like + # $(mkdir_p) $(somedir) + # where $(somedir) is conditionally defined. + # (`test -n '$(somedir)' && $(mkdir_p) $(somedir)' is a more + # expensive solution, as it forces Make to start a sub-shell.) + mkdir_p='mkdir -p -- .' +else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + for d in ./-p ./--version; + do + test -d $d && rmdir $d + done + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists. + if test -f "$ac_aux_dir/mkinstalldirs"; then + mkdir_p='$(mkinstalldirs)' + else + mkdir_p='$(install_sh) -d' + fi +fi + +for ac_prog in gawk mawk nawk awk +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1090: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + test -n "$AWK" && break +done + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftestmake <<\EOF + cat >conftest.make <<\_ACEOF all: - @echo 'ac_maketemp="${MAKE}"' -EOF + @echo 'ac_maketemp="$(MAKE)"' +_ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi -rm -f conftestmake +rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 SET_MAKE= else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +DEPDIR="${am__leading_dot}deps" + + ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6 +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6 +rm -f confinc confmf + +# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval="$enable_dependency_tracking" + +fi; +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + + +if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + -PACKAGE=gas -VERSION=${BFD_VERSION} +# test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && + test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi -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; } +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi fi -cat >> confdefs.h <>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" -EOF +_ACEOF + -cat >> confdefs.h <>confdefs.h <<_ACEOF #define VERSION "$VERSION" -EOF +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +AMTAR=${AMTAR-"${am_missing_run}tar"} +install_sh=${install_sh-"$am_aux_dir/install-sh"} -missing_dir=`cd $ac_aux_dir && pwd` -echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:1136: checking for working aclocal" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (aclocal --version) < /dev/null > /dev/null 2>&1; then - ACLOCAL=aclocal - echo "$ac_t""found" 1>&6 +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # 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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - ACLOCAL="$missing_dir/missing aclocal" - echo "$ac_t""missing" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done -echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1149: checking for working autoconf" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoconf --version) < /dev/null > /dev/null 2>&1; then - AUTOCONF=autoconf - echo "$ac_t""found" 1>&6 + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 else - AUTOCONF="$missing_dir/missing autoconf" - echo "$ac_t""missing" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1162: checking for working automake" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (automake --version) < /dev/null > /dev/null 2>&1; then - AUTOMAKE=automake - echo "$ac_t""found" 1>&6 + STRIP=$ac_ct_STRIP else - AUTOMAKE="$missing_dir/missing automake" - echo "$ac_t""missing" 1>&6 + STRIP="$ac_cv_prog_STRIP" +fi + fi +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. + + +depcc="$CC" am_compiler_list= -echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1175: checking for working autoheader" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (autoheader --version) < /dev/null > /dev/null 2>&1; then - AUTOHEADER=autoheader - echo "$ac_t""found" 1>&6 +echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - AUTOHEADER="$missing_dir/missing autoheader" - echo "$ac_t""missing" 1>&6 + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + fi +echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + -echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1188: checking for working makeinfo" >&5 -# Run test in a subshell; some versions of sh will print an error if -# an executable is not found, even if stderr is redirected. -# Redirect stdin to placate older versions of autoconf. Sigh. -if (makeinfo --version) < /dev/null > /dev/null 2>&1; then - MAKEINFO=makeinfo - echo "$ac_t""found" 1>&6 + +if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' else - MAKEINFO="$missing_dir/missing makeinfo" - echo "$ac_t""missing" 1>&6 + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= fi + # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" @@ -1219,8 +3073,7 @@ no) enable_shared=no ;; esac else enable_shared=yes -fi - +fi; # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then enableval="$enable_static" @@ -1242,8 +3095,7 @@ no) enable_static=no ;; esac else enable_static=yes -fi - +fi; # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval="$enable_fast_install" @@ -1265,7 +3117,7 @@ no) enable_fast_install=no ;; esac else enable_fast_install=yes -fi +fi; # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then @@ -1273,13 +3125,12 @@ if test "${with_gnu_ld+set}" = set; then test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no -fi - +fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1283: checking for ld used by GCC" >&5 + echo "$as_me:$LINENO: checking for ld used by GCC" >&5 +echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -1308,14 +3159,14 @@ echo "configure:1283: 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:1313: checking for GNU ld" >&5 + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else - echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1316: checking for non-GNU ld" >&5 + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi -if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" @@ -1341,15 +3192,19 @@ fi LD="$lt_cv_path_LD" if test -n "$LD"; then - echo "$ac_t""$LD" 1>&6 + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } -echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 -echo "configure:1351: checking if the linker ($LD) is GNU ld" >&5 -if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. if $LD -v 2>&1 &5; then @@ -1358,27 +3213,27 @@ else lt_cv_prog_gnu_ld=no fi fi - -echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6 +echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld -echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 -echo "configure:1368: checking for $LD option to reload object files" >&5 -if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi - -echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6 +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&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:1380: checking for BSD-compatible nm" >&5 -if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6 +if test "${lt_cv_path_NM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. @@ -1411,33 +3266,24 @@ fi fi NM="$lt_cv_path_NM" -echo "$ac_t""$NM" 1>&6 +echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 -echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1418: checking whether ln -s works" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - rm -f conftestdata -if ln -s X conftestdata 2>/dev/null -then - rm -f conftestdata - ac_cv_prog_LN_S="ln -s" -else - ac_cv_prog_LN_S=ln -fi -fi -LN_S="$ac_cv_prog_LN_S" -if test "$ac_cv_prog_LN_S" = "ln -s"; then - echo "$ac_t""yes" 1>&6 +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 fi -echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 -echo "configure:1439: checking how to recognise dependant libraries" >&5 -if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking how to recognise dependant libraries" >&5 +echo $ECHO_N "checking how to recognise dependant libraries... $ECHO_C" >&6 +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= @@ -1545,7 +3391,7 @@ irix5* | irix6*) # This must be Linux ELF. linux-gnu*) case $host_cpu in - alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) + alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM @@ -1602,73 +3448,13 @@ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) esac fi - -echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6 +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&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 - *.$ac_ext | *.c | *.o | *.obj) ;; - *) 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! @@ -1676,10 +3462,10 @@ fi 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 + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in /*) @@ -1731,17 +3517,19 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - echo "$ac_t""$MAGIC_CMD" 1>&6 + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&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 + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in /*) @@ -1793,9 +3581,11 @@ fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - echo "$ac_t""$MAGIC_CMD" 1>&6 + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi else @@ -1807,138 +3597,164 @@ fi ;; esac -# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +if test -n "$ac_tool_prefix"; then + # 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -RANLIB="$ac_cv_prog_RANLIB" +RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - +fi if test -z "$ac_cv_prog_RANLIB"; then -if test -n "$ac_tool_prefix"; then + ac_ct_RANLIB=$RANLIB # 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_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=":" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + RANLIB=$ac_ct_RANLIB else - RANLIB=":" -fi + RANLIB="$ac_cv_prog_RANLIB" fi -# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +if test -n "$ac_tool_prefix"; then + # 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -STRIP="$ac_cv_prog_STRIP" +STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$ac_t""$STRIP" 1>&6 + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - +fi if test -z "$ac_cv_prog_STRIP"; then -if test -n "$ac_tool_prefix"; then + ac_ct_STRIP=$STRIP # 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 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_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=":" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi -STRIP="$ac_cv_prog_STRIP" -if test -n "$STRIP"; then - echo "$ac_t""$STRIP" 1>&6 +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + STRIP=$ac_ct_STRIP else - STRIP=":" -fi + STRIP="$ac_cv_prog_STRIP" fi @@ -1954,20 +3770,19 @@ test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" # Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval="$enable_libtool_lock" - : -fi +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 - +fi; test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic" test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" @@ -1976,8 +3791,25 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1980 "configure"' > conftest.$ac_ext - if { (eval echo configure:1981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 3794 "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" @@ -1989,6 +3821,7 @@ case $host in LD="${LD-ld} -64" ;; esac + fi fi rm -rf conftest* ;; @@ -1996,7 +3829,11 @@ case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext - if { (eval echo configure:2000: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then case "`/usr/bin/file conftest.o`" in *ELF-32*) HPUX_IA64_MODE="32" @@ -2013,47 +3850,73 @@ ia64-*-hpux*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" - echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:2018: 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 + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 +if test "${lt_cv_cc_needs_belf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - + + 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 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { +int +main () +{ -; return 0; } -EOF -if { (eval echo configure:2038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - lt_cv_cc_needs_belf=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +lt_cv_cc_needs_belf=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext 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 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu fi - -echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" @@ -2065,54 +3928,61 @@ esac # Save cache, so that ltconfig can load it -cat > confcache <<\EOF +cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. # -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. # -EOF +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + # The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache - # Actually configure libtool. ac_aux_dir is where install-sh is found. AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ @@ -2122,15 +3992,26 @@ 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 --build="$build" $ac_aux_dir/ltmain.sh $host \ -|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; } +|| { { echo "$as_me:$LINENO: error: libtool configure failed" >&5 +echo "$as_me: error: libtool configure failed" >&2;} + { (exit 1); exit 1; }; } # Reload cache, that may have been modified by ltconfig if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi else - echo "creating cache $cache_file" - > $cache_file + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file fi @@ -2144,11 +4025,11 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' # clobbered by the next message. exec 5>>./config.log - - - - + + + + user_bfd_gas= # Check whether --enable-bfd-assembler or --disable-bfd-assembler was given. @@ -2157,29 +4038,32 @@ if test "${enable_bfd_assembler+set}" = set; then case "${enableval}" in yes) need_bfd=yes user_bfd_gas=yes ;; no) user_bfd_gas=no ;; - *) { echo "configure: error: bad value ${enableval} given for bfd-assembler option" 1>&2; exit 1; } ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} given for bfd-assembler option" >&5 +echo "$as_me: error: bad value ${enableval} given for bfd-assembler option" >&2;} + { (exit 1); exit 1; }; } ;; esac -fi -# Check whether --enable-targets or --disable-targets was given. +fi; # Check whether --enable-targets or --disable-targets was given. if test "${enable_targets+set}" = set; then enableval="$enable_targets" case "${enableval}" in - yes | "") { echo "configure: error: enable-targets option must specify target names or 'all'" 1>&2; exit 1; } + yes | "") { { echo "$as_me:$LINENO: error: enable-targets option must specify target names or 'all'" >&5 +echo "$as_me: error: enable-targets option must specify target names or 'all'" >&2;} + { (exit 1); exit 1; }; } ;; no) enable_targets= ;; *) enable_targets=$enableval ;; esac -fi -# Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. +fi; # Check whether --enable-commonbfdlib or --disable-commonbfdlib was given. if test "${enable_commonbfdlib+set}" = set; then enableval="$enable_commonbfdlib" case "${enableval}" in yes) commonbfdlib=true ;; no) commonbfdlib=false ;; - *) { echo "configure: error: bad value ${enableval} for BFD commonbfdlib option" 1>&2; exit 1; } ;; + *) { { echo "$as_me:$LINENO: error: bad value ${enableval} for BFD commonbfdlib option" >&5 +echo "$as_me: error: bad value ${enableval} for BFD commonbfdlib option" >&2;} + { (exit 1); exit 1; }; } ;; esac -fi - +fi; using_cgen=no build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes" @@ -2198,24 +4082,28 @@ 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="" +fi; WARN_CFLAGS="" if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then WARN_CFLAGS="${build_warnings}" fi # Generate a header file - - + ac_config_headers="$ac_config_headers config.h:config.in" # If we are on a DOS filesystem, we must use gdb.ini rather than # .gdbinit. -GDBINIT=".gdbinit" case "${host}" in - *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) + *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-windows*) GDBINIT="gdb.ini" + ac_config_files="$ac_config_files gdb.ini:gdbinit.in" + + ;; + *) + GDBINIT=".gdbinit" + ac_config_files="$ac_config_files .gdbinit:gdbinit.in" + ;; esac @@ -2266,13 +4154,17 @@ for this_target in $target $canon_targets ; do arch= endian= case ${cpu} in + am33_2.0) cpu_type=mn10300 endian=little ;; alpha*) cpu_type=alpha ;; arm*b|xscale*b|strongarm*b) cpu_type=arm endian=big ;; arm*|xscale*|strongarm*) cpu_type=arm endian=little ;; + c4x*) cpu_type=tic4x ;; hppa*) cpu_type=hppa ;; - i[3456]86) cpu_type=i386 arch=i386;; + i[3-7]86) cpu_type=i386 arch=i386;; x86_64) cpu_type=i386 arch=x86_64;; ia64) cpu_type=ia64 ;; + ip2k) cpu_type=ip2k endian=big ;; + iq2000) cpu_type=iq2000 endian=big ;; m6811|m6812|m68hc12) cpu_type=m68hc11 ;; m680[012346]0) cpu_type=m68k ;; m68008) cpu_type=m68k ;; @@ -2301,6 +4193,9 @@ for this_target in $target $canon_targets ; do sparc86x*) cpu_type=sparc arch=sparc86x ;; sparc*) cpu_type=sparc arch=sparclite ;; # ??? See tc-sparc.c. v850*) cpu_type=v850 ;; + xtensa*) cpu_type=xtensa arch=xtensa ;; + m32r) cpu_type=m32r target_cpu=m32r endian=big ;; + m32rle) cpu_type=m32r target_cpu=m32r endian=little ;; *) cpu_type=${cpu} ;; esac @@ -2317,353 +4212,364 @@ for this_target in $target $canon_targets ; do # assign object format case ${generic_target} in - a29k-*-coff) fmt=coff ;; - a29k-amd-udi) fmt=coff ;; - a29k-amd-ebmon) fmt=coff ;; - a29k-nyu-sym1) fmt=coff ;; - a29k-*-rtems*) fmt=coff ;; - a29k-*-vxworks*) fmt=coff ;; - - alpha*-*-*vms*) fmt=evax ;; - alpha*-*-netware*) fmt=ecoff ;; - alpha*-*-osf*) fmt=ecoff ;; - alpha*-*-linuxecoff*) fmt=ecoff ;; - alpha*-*-linux-gnu*) fmt=elf em=linux ;; - alpha*-*-netbsd*) fmt=elf em=nbsd ;; - alpha*-*-openbsd*) fmt=elf em=obsd ;; - - arc-*-elf*) fmt=elf bfd_gas=yes ;; - - arm-*-aout) fmt=aout ;; - arm-*-coff | thumb-*-coff) fmt=coff ;; - arm-*-rtems | thumb-*-rtems) fmt=elf ;; - arm-*-elf | thumb-*-elf) fmt=elf ;; + a29k-*-coff) fmt=coff ;; + a29k-amd-udi) fmt=coff ;; + a29k-amd-ebmon) fmt=coff ;; + a29k-nyu-sym1) fmt=coff ;; + a29k-*-rtems*) fmt=coff ;; + a29k-*-vxworks*) fmt=coff ;; + + alpha*-*-*vms*) fmt=evax ;; + alpha*-*-netware*) fmt=ecoff ;; + alpha*-*-osf*) fmt=ecoff ;; + alpha*-*-linuxecoff*) fmt=ecoff ;; + alpha*-*-linux-gnu*) fmt=elf em=linux ;; + alpha*-*-netbsd*) fmt=elf em=nbsd ;; + alpha*-*-openbsd*) fmt=elf em=obsd ;; + + # cpu_type for am33_2.0 is set to mn10300 + mn10300-*-linux*) fmt=elf bfd_gas=yes em=linux ;; + + arc-*-elf*) fmt=elf ;; + + arm-*-aout) fmt=aout ;; + arm-*-coff | thumb-*-coff) fmt=coff ;; + arm-*-rtems* | thumb-*-rtems*) fmt=elf ;; + arm-*-elf | thumb-*-elf) fmt=elf ;; + arm-*-kaos*) fmt=elf ;; arm*-*-conix*) fmt=elf ;; - arm-*-linux*aout*) fmt=aout em=linux ;; - arm*-*-linux-gnu* | arm*-*-uclinux*) - fmt=elf em=linux ;; + arm-*-linux*aout*) fmt=aout em=linux ;; + arm*-*-linux-gnu*) fmt=elf em=linux ;; + arm*-*-uclinux*) fmt=elf em=linux ;; arm-*-netbsdelf*) fmt=elf em=nbsd ;; - arm-*-netbsd* | arm-*-openbsd*) fmt=aout em=nbsd ;; - arm-*-oabi | thumb-*-oabi) fmt=elf ;; - arm-epoc-pe | thumb-epoc-pe) fmt=coff em=epoc-pe ;; - arm-*-wince) fmt=coff em=wince-pe ;; - arm-*-pe | thumb-*-pe) fmt=coff em=pe ;; - arm-*-riscix*) fmt=aout em=riscix ;; - arm-*-vxworks) fmt=coff ;; - - avr-*-*) fmt=elf bfd_gas=yes ;; - - cris-*-*) fmt=multi bfd_gas=yes ;; - - d10v-*-*) fmt=elf bfd_gas=yes ;; - d30v-*-*) fmt=elf bfd_gas=yes ;; - dlx-*-*) fmt=elf ;; - - - fr30-*-*) fmt=elf bfd_gas=yes ;; - frv-*-*) fmt=elf bfd_gas=yes ;; - - hppa-*-linux-gnu*) case ${cpu} in - hppa*64*) - fmt=elf em=hppalinux64;; - hppa*) - fmt=elf em=linux;; - esac ;; - hppa-*-*elf*) fmt=elf em=hppa ;; - hppa-*-lites*) fmt=elf em=hppa ;; - hppa-*-netbsd*) fmt=elf em=nbsd ;; - hppa-*-openbsd*) fmt=elf em=hppa ;; - hppa-*-osf*) fmt=som em=hppa ;; - hppa-*-rtems*) fmt=elf em=hppa ;; - hppa-*-hpux11*) case ${cpu} in - hppa*64*) - fmt=elf em=hppa64 ;; - hppa*) - fmt=som em=hppa ;; - esac ;; - hppa-*-hpux*) fmt=som em=hppa ;; - hppa-*-mpeix*) fmt=som em=hppa ;; - hppa-*-bsd*) fmt=som em=hppa ;; - hppa-*-hiux*) fmt=som em=hppa ;; - - h8300-*-rtems*) fmt=coff ;; - h8300-*-coff) fmt=coff ;; - h8300-*-elf) fmt=elf ;; - h8500-*-rtems*) fmt=coff ;; - h8500-*-coff) fmt=coff ;; - - i370-*-elf* | i370-*-linux*) fmt=elf ;; - i386-ibm-aix*) fmt=coff em=i386aix ;; - i386-sequent-bsd*) fmt=aout em=dynix bfd_gas=yes ;; - i386-*-beospe*) fmt=coff em=pe bfd_gas=yes ;; - i386-*-beoself* | i386-*-beos*) fmt=elf bfd_gas=yes ;; - i386-*-bsd*) fmt=aout em=386bsd ;; - i386-*-netbsd0.8) fmt=aout em=386bsd ;; - i386-*-netbsdpe*) fmt=coff em=pe bfd_gas=yes ;; - i386-*-netbsd*) em=nbsd bfd_gas=yes - case ${cpu} in - x86_64) fmt=elf ;; - *) case ${os} in - *elf*) fmt=elf ;; - *) fmt=aout ;; - esac - ;; - esac - ;; - i386-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes;; - i386-*-linux*aout* | i386-*-linux*oldld) fmt=aout em=linux ;; - i386-*-linux*coff*) fmt=coff em=linux ;; - i386-*-linux-gnu*) fmt=elf em=linux bfd_gas=yes ;; - x86_64-*-linux-gnu*) fmt=elf em=linux bfd_gas=yes ;; - i386-*-lynxos*) fmt=coff em=lynx ;; - i386-*-sysv[45]* | i386-*-solaris* | i386-*-elf) - fmt=elf bfd_gas=yes ;; - i386-*-freebsdaout* | i386-*-freebsd[12].* | i386-*-freebsd[12]) - fmt=aout em=386bsd ;; - i386-*-coff | i386-*-sysv* | i386-*-sco3.2v5*coff | i386-*-isc*) - fmt=coff ;; - i386-*-sco3.2v5*) fmt=elf - if test ${this_target} = $target; then - cat >> confdefs.h <<\EOF + arm-*-*n*bsd*) fmt=aout em=nbsd ;; + arm-**-nto*) fmt=elf ;; + arm-*-oabi | thumb-*-oabi) fmt=elf ;; + arm-epoc-pe | thumb-epoc-pe) fmt=coff em=epoc-pe ;; + arm-wince-pe | arm-*-wince) fmt=coff em=wince-pe ;; + arm-*-pe | thumb-*-pe) fmt=coff em=pe ;; + arm-*-riscix*) fmt=aout em=riscix ;; + + avr-*-*) fmt=elf ;; + + cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;; + cris-*-*) fmt=multi bfd_gas=yes ;; + + d10v-*-*) fmt=elf ;; + d30v-*-*) fmt=elf ;; + dlx-*-*) fmt=elf ;; + + fr30-*-*) fmt=elf ;; + frv-*-*linux*) fmt=elf em=linux;; + frv-*-*) fmt=elf ;; + + hppa-*-linux*) case ${cpu} in + hppa*64*) fmt=elf em=hppalinux64;; + hppa*) fmt=elf em=linux;; + esac ;; + hppa-*-*elf*) fmt=elf em=hppa ;; + hppa-*-lites*) fmt=elf em=hppa ;; + hppa-*-netbsd*) fmt=elf em=nbsd ;; + hppa-*-openbsd*) fmt=elf em=hppa ;; + hppa-*-osf*) fmt=som em=hppa ;; + hppa-*-rtems*) fmt=elf em=hppa ;; + hppa-*-hpux11*) case ${cpu} in + hppa*64*) fmt=elf em=hppa64 ;; + hppa*) fmt=som em=hppa ;; + esac ;; + hppa-*-hpux*) fmt=som em=hppa ;; + hppa-*-mpeix*) fmt=som em=hppa ;; + hppa-*-bsd*) fmt=som em=hppa ;; + hppa-*-hiux*) fmt=som em=hppa ;; + + h8300-*-rtems*) fmt=coff ;; + h8300-*-coff) fmt=coff ;; + h8300-*-elf) fmt=elf ;; + h8500-*-rtems*) fmt=coff ;; + h8500-*-coff) fmt=coff ;; + + i370-*-elf* | i370-*-linux*) fmt=elf ;; + i386-ibm-aix*) fmt=coff em=i386aix ;; + i386-sequent-bsd*) fmt=aout em=dynix ;; + i386-*-beospe*) fmt=coff em=pe ;; + i386-*-beos*) fmt=elf ;; + i386-*-coff) fmt=coff ;; + i386-*-elf) fmt=elf ;; + i386-*-kaos*) fmt=elf ;; + i386-*-bsd*) fmt=aout em=386bsd ;; + i386-*-netbsd0.8) fmt=aout em=386bsd ;; + i386-*-netbsdpe*) fmt=coff em=pe ;; + i386-*-netbsd*-gnu* | \ + i386-*-knetbsd*-gnu | \ + i386-*-netbsdelf*) fmt=elf em=nbsd ;; + i386-*-*n*bsd*) case ${cpu} in + x86_64) fmt=elf em=nbsd ;; + *) fmt=aout em=nbsd ;; + esac ;; + i386-*-linux*aout*) fmt=aout em=linux ;; + i386-*-linux*oldld) fmt=aout em=linux ;; + i386-*-linux*coff*) fmt=coff em=linux ;; + i386-*-linux-gnu*) fmt=elf em=linux ;; + x86_64-*-linux-gnu*) fmt=elf em=linux ;; + i386-*-lynxos*) fmt=coff em=lynx ;; + i386-*-sysv[45]*) fmt=elf ;; + i386-*-solaris*) fmt=elf ;; + i386-*-freebsdaout*) fmt=aout em=386bsd ;; + i386-*-freebsd[12].*) fmt=aout em=386bsd ;; + i386-*-freebsd[12]) fmt=aout em=386bsd ;; + i386-*-freebsd* | i386-*-kfreebsd*-gnu) + fmt=elf em=freebsd ;; + i386-*-sysv*) fmt=coff ;; + i386-*-sco3.2v5*coff) fmt=coff ;; + i386-*-isc*) fmt=coff ;; + i386-*-sco3.2v5*) fmt=elf + if test ${this_target} = $target; then + +cat >>confdefs.h <<\_ACEOF #define SCO_ELF 1 -EOF +_ACEOF - fi - ;; - i386-*-sco3.2*) fmt=coff ;; - i386-*-vsta) fmt=aout ;; - i386-*-msdosdjgpp* | i386-*-go32* | i386-go32-rtems*) - fmt=coff em=go32 bfd_gas=yes - cat >> confdefs.h <<\EOF -#define STRICTCOFF 1 -EOF + fi ;; + i386-*-sco3.2*) fmt=coff ;; + i386-*-vsta) fmt=aout ;; + i386-*-msdosdjgpp* \ + | i386-*-go32* \ + | i386-go32-rtems*) fmt=coff em=go32 - ;; - i386-*-rtemself*) fmt=elf ;; - i386-*-rtemscoff*) fmt=coff ;; - i386-*-rtems*) fmt=elf ;; - i386-*-gnu*) fmt=elf ;; - i386-*-mach*) - fmt=aout em=mach bfd_gas=yes ;; - i386-*-msdos*) fmt=aout ;; - i386-*-moss*) fmt=elf ;; - i386-*-pe) fmt=coff em=pe bfd_gas=yes ;; - i386-*-cygwin*) fmt=coff em=pe bfd_gas=yes ;; - i386-*-interix*) fmt=coff em=interix bfd_gas=yes ;; - i386-*-mingw32*) fmt=coff em=pe bfd_gas=yes ;; - i386-*-nto-qnx*) fmt=elf ;; - i386-*-*nt*) fmt=coff em=pe bfd_gas=yes ;; - i386-*-vxworks*) fmt=aout ;; - i386-*-chaos) fmt=elf ;; - i860-stardent-sysv4* | i860-stardent-elf*) - fmt=elf bfd_gas=yes endian=little - echo "configure: warning: GAS support for ${generic_target} is preliminary and a work in progress" 1>&2 ;; - i960-*-bout) fmt=bout ;; - i960-*-coff) fmt=coff em=ic960 ;; - i960-*-rtems*) fmt=coff em=ic960 ;; - i960-*-nindy*) fmt=bout ;; - i960-*-vxworks4*) fmt=bout ;; - i960-*-vxworks5.0) fmt=bout ;; - i960-*-vxworks5.*) fmt=coff em=ic960 ;; - i960-*-vxworks*) fmt=bout ;; - i960-*-elf*) fmt=elf ;; - - ia64-*-elf*) fmt=elf ;; - ia64-*-aix*) fmt=elf em=ia64aix ;; - ia64-*-linux-gnu*) fmt=elf em=linux ;; - ia64-*-hpux*) fmt=elf em=hpux ;; - ia64-*-netbsd*) fmt=elf em=nbsd ;; - - m32r-*-*) fmt=elf bfd_gas=yes ;; - - m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)fmt=elf bfd_gas=yes ;; - - m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*) - fmt=aout em=sun3 ;; - m68k-motorola-sysv*) fmt=coff em=delta ;; - m68k-bull-sysv3*) fmt=coff em=dpx2 ;; - m68k-apollo-*) fmt=coff em=apollo ;; - m68k-*-sysv4*) # must be before -sysv* - fmt=elf em=svr4 ;; - m68k-*-elf*) fmt=elf ;; - m68k-*-coff | m68k-*-sysv* | m68k-*-rtemscoff*) - fmt=coff ;; - m68k-*-rtems*) fmt=elf ;; - m68k-*-hpux*) fmt=hp300 em=hp300 ;; - m68k-*-linux*aout*) fmt=aout em=linux ;; - m68k-*-linux-gnu*) fmt=elf em=linux ;; - m68k-*-gnu*) fmt=elf ;; - m68k-*-lynxos*) fmt=coff em=lynx ;; - m68k-*-netbsdelf*) fmt=elf em=nbsd bfd_gas=yes ;; - m68k-*-netbsdaout* | m68k-*-netbsd*) - fmt=aout em=nbsd bfd_gas=yes ;; - m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;; - m68k-apple-aux*) fmt=coff em=aux ;; - m68k-*-psos*) fmt=elf em=psos;; - - m88k-motorola-sysv3*) fmt=coff em=delt88 ;; - m88k-*-coff*) fmt=coff ;; - - mcore-*-elf) fmt=elf bfd_gas=yes ;; - mcore-*-pe) fmt=coff em=pe bfd_gas=yes ;; +cat >>confdefs.h <<\_ACEOF +#define STRICTCOFF 1 +_ACEOF + ;; + i386-*-rtemself*) fmt=elf ;; + i386-*-rtemscoff*) fmt=coff ;; + i386-*-rtems*) fmt=elf ;; + i386-*-gnu*) fmt=elf ;; + i386-*-mach*) fmt=aout em=mach ;; + i386-*-msdos*) fmt=aout ;; + i386-*-moss*) fmt=elf ;; + i386-*-pe) fmt=coff em=pe ;; + i386-*-cygwin*) fmt=coff em=pe ;; + i386-*-interix*) fmt=coff em=interix ;; + i386-*-mingw32*) fmt=coff em=pe ;; + i386-*-nto-qnx*) fmt=elf ;; + i386-*-*nt*) fmt=coff em=pe ;; + i386-*-chaos) fmt=elf ;; + + i860-*-*) fmt=elf endian=little + { echo "$as_me:$LINENO: WARNING: GAS support for ${generic_target} is preliminary and a work in progress" >&5 +echo "$as_me: WARNING: GAS support for ${generic_target} is preliminary and a work in progress" >&2;} ;; + i960-*-bout) fmt=bout ;; + i960-*-coff) fmt=coff em=ic960 ;; + i960-*-rtems*) fmt=coff em=ic960 ;; + i960-*-nindy*) fmt=bout ;; + i960-*-vxworks5.0) fmt=bout ;; + i960-*-vxworks5.*) fmt=coff em=ic960 ;; + i960-*-vxworks*) fmt=bout ;; + i960-*-elf*) fmt=elf ;; + + ia64-*-elf*) fmt=elf ;; + ia64-*-aix*) fmt=elf em=ia64aix ;; + ia64-*-linux-gnu*) fmt=elf em=linux ;; + ia64-*-hpux*) fmt=elf em=hpux ;; + ia64-*-netbsd*) fmt=elf em=nbsd ;; + + ip2k-*-*) fmt=elf ;; + + iq2000-*-elf) fmt=elf bfd_gas=yes ;; + + m32r-*-elf*) fmt=elf ;; + m32r-*-linux*) fmt=elf em=linux;; + + m68hc11-*-* | m6811-*-*) fmt=elf ;; + m68hc12-*-* | m6812-*-*) fmt=elf ;; + + m68k-*-vxworks*) fmt=aout em=sun3 ;; + m68k-ericsson-ose) fmt=aout em=sun3 ;; + m68k-*-sunos*) fmt=aout em=sun3 ;; + m68k-motorola-sysv*) fmt=coff em=delta ;; + m68k-bull-sysv3*) fmt=coff em=dpx2 ;; + m68k-apollo-*) fmt=coff em=apollo ;; + m68k-*-elf*) fmt=elf ;; + m68k-*-sysv4*) fmt=elf em=svr4 ;; + m68k-*-sysv*) fmt=coff ;; + m68k-*-coff | m68k-*-rtemscoff*) fmt=coff ;; + m68k-*-rtems*) fmt=elf ;; + m68k-*-hpux*) fmt=hp300 em=hp300 ;; + m68k-*-linux*aout*) fmt=aout em=linux ;; + m68k-*-linux-gnu*) fmt=elf em=linux ;; + m68k-*-uclinux*) fmt=elf ;; + m68k-*-gnu*) fmt=elf ;; + m68k-*-lynxos*) fmt=coff em=lynx ;; + m68k-*-netbsdelf*) fmt=elf em=nbsd ;; + m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;; + m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;; + m68k-apple-aux*) fmt=coff em=aux ;; + m68k-*-psos*) fmt=elf em=psos;; + + m88k-motorola-sysv3*) fmt=coff em=delt88 ;; + m88k-*-coff*) fmt=coff ;; + + mcore-*-elf) fmt=elf ;; + mcore-*-pe) fmt=coff em=pe bfd_gas=yes ;; # don't change em like *-*-bsd does - mips-dec-openbsd*) fmt=elf endian=little ;; - mips-dec-bsd*) fmt=aout endian=little ;; - mips-sony-bsd*) fmt=ecoff ;; - mips-*-bsd*) { echo "configure: error: Unknown vendor for mips-bsd configuration." 1>&2; exit 1; } ;; - mips-*-ultrix*) fmt=ecoff endian=little ;; - mips-*-osf*) fmt=ecoff endian=little ;; - mips-*-ecoff*) fmt=ecoff ;; - mips-*-pe*) fmt=coff endian=little em=pe ;; - mips-*-irix6*) fmt=elf ;; - mips-*-irix5*) fmt=elf ;; - mips-*-irix*) fmt=ecoff ;; - mips-*-lnews*) fmt=ecoff em=lnews ;; - mips-*-riscos*) fmt=ecoff ;; - mips*-*-linux*) fmt=elf em=tmips ;; - mips-*-sysv4*MP* | mips-*-gnu*) - fmt=elf em=tmips ;; - mips-*-sysv*) fmt=ecoff ;; - mips-*-elf* | mips-*-rtems* | mips-*-netbsd* | mips-*-openbsd*) - fmt=elf ;; - mips-*-vxworks*) fmt=elf ;; - mmix-*-*) fmt=elf bfd_gas=yes ;; - mn10200-*-*) fmt=elf bfd_gas=yes ;; - mn10300-*-*) fmt=elf bfd_gas=yes ;; - openrisc-*-*) fmt=elf bfd_gas=yes ;; - or32-*-rtems*) fmt=coff ;; - or32-*-coff) fmt=coff ;; - or32-*-elf) fmt=elf ;; - pj*) fmt=elf ;; - ppc-*-pe | ppc-*-cygwin* | ppc-*-winnt*) - fmt=coff em=pe ;; - ppc-*-aix5*) fmt=coff em=aix5 ;; - ppc-*-aix*) fmt=coff ;; - ppc-*-beos*) fmt=coff ;; - ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*) - fmt=elf ;; - ppc-*-linux-gnu*) fmt=elf - case "$endian" in - big) ;; - *) { echo "configure: error: GNU/Linux must be configured big endian" 1>&2; exit 1; } ;; - esac - ;; - ppc-*-solaris*) fmt=elf - if test ${this_target} = $target; then - cat >> confdefs.h <<\EOF + mips-dec-openbsd*) fmt=elf endian=little ;; + mips-sony-bsd*) fmt=ecoff ;; + mips-*-bsd*) + { { echo "$as_me:$LINENO: error: Unknown vendor for mips-bsd configuration." >&5 +echo "$as_me: error: Unknown vendor for mips-bsd configuration." >&2;} + { (exit 1); exit 1; }; } ;; + mips-*-ultrix*) fmt=ecoff endian=little ;; + mips-*-osf*) fmt=ecoff endian=little ;; + mips-*-ecoff*) fmt=ecoff ;; + mips-*-pe*) fmt=coff endian=little em=pe ;; + mips-*-irix6*) fmt=elf em=irix ;; + mips-*-irix5*) fmt=elf em=irix ;; + mips-*-irix*) fmt=ecoff em=irix ;; + mips-*-lnews*) fmt=ecoff em=lnews ;; + mips-*-riscos*) fmt=ecoff ;; + mips*-*-linux*) fmt=elf em=tmips ;; + mips-*-sysv4*MP* | mips-*-gnu*) fmt=elf em=tmips ;; + mips-*-sysv*) fmt=ecoff ;; + mips-*-elf* | mips-*-rtems*) fmt=elf ;; + mips-*-netbsd*) fmt=elf ;; + mips-*-openbsd*) fmt=elf ;; + + mmix-*-*) fmt=elf ;; + mn10200-*-*) fmt=elf ;; + mn10300-*-*) fmt=elf ;; + msp430-*-*) fmt=elf ;; + openrisc-*-*) fmt=elf ;; + or32-*-rtems*) fmt=elf ;; + or32-*-coff) fmt=coff ;; + or32-*-elf) fmt=elf ;; + pj*) fmt=elf ;; + + ppc-*-pe | ppc-*-cygwin*) fmt=coff em=pe ;; + ppc-*-winnt*) fmt=coff em=pe ;; + ppc-*-aix5.[01]) fmt=coff em=aix5 ;; + ppc-*-aix5.*) fmt=coff em=aix5 + +cat >>confdefs.h <<\_ACEOF +#define AIX_WEAK_SUPPORT 1 +_ACEOF + + ;; + ppc-*-aix*) fmt=coff ;; + ppc-*-beos*) fmt=coff ;; + ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;; + ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;; + ppc-*-linux-gnu*) fmt=elf em=linux + case "$endian" in + big) ;; + *) { { echo "$as_me:$LINENO: error: GNU/Linux must be configured big endian" >&5 +echo "$as_me: error: GNU/Linux must be configured big endian" >&2;} + { (exit 1); exit 1; }; } ;; + esac ;; + ppc-*-solaris*) fmt=elf + if test ${this_target} = $target; then + +cat >>confdefs.h <<\_ACEOF #define TARGET_SOLARIS_COMMENT 1 -EOF +_ACEOF - fi - if test x${endian} = xbig; then - { echo "configure: error: Solaris must be configured little endian" 1>&2; exit 1; } - fi - ;; - ppc-*-rtems*) fmt=elf ;; - ppc-*-macos* | ppc-*-mpw*) - fmt=coff em=macos ;; - ppc-*-netware*) fmt=elf em=ppcnw ;; - ppc-*-vxworks*) fmt=elf ;; - ppc-*-windiss*) fmt=elf ;; - - s390x-*-linux-gnu*) fmt=elf em=linux ;; - s390-*-linux-gnu*) fmt=elf em=linux ;; - - sh*-*-linux*) fmt=elf em=linux - case ${cpu} in - sh*eb) - endian=big ;; - sh*) - endian=little ;; - esac ;; - sh5*-*-netbsd*) fmt=elf em=nbsd ;; - sh64*-*-netbsd*) fmt=elf em=nbsd ;; - sh*-*-netbsdelf*) fmt=elf em=nbsd ;; - sh-*-elf*) fmt=elf ;; - sh-*-coff*) fmt=coff ;; - sh-*-pe*) fmt=coff em=pe bfd_gas=yes endian=little ;; - sh-*-rtemself*) fmt=elf ;; - sh-*-rtems*) fmt=coff ;; - - sh64-*-elf*) fmt=elf ;; - ns32k-pc532-mach* | ns32k-pc532-ux*) fmt=aout em=pc532mach ;; - ns32k-*-netbsd* | ns32k-pc532-lites*) fmt=aout em=nbsd532 ;; - ns32k-pc532-openbsd*) fmt=aout em=nbsd532 ;; - - sparc-*-rtemsaout*) fmt=aout ;; - sparc-*-rtemself*) fmt=elf ;; - sparc-*-rtems*) fmt=elf ;; - sparc-*-sunos4*) fmt=aout em=sun3 ;; - sparc-*-aout | sparc*-*-vxworks*) - fmt=aout em=sparcaout ;; - sparc-*-coff) fmt=coff ;; - sparc-*-linux*aout*) fmt=aout em=linux ;; - sparc-*-linux-gnu*) fmt=elf em=linux ;; - sparc-*-lynxos*) fmt=coff em=lynx ;; - sparc-fujitsu-none) fmt=aout ;; - sparc-*-elf | sparc-*-sysv4* | sparc-*-solaris*) - fmt=elf ;; - sparc-*-netbsd*) em=nbsd bfd_gas=yes - case ${cpu} in - sparc) case ${os} in - *elf*) fmt=elf ;; - *) fmt=aout ;; - esac ;; - sparc64) fmt=elf ;; - esac - ;; - sparc-*-openbsd*) em=nbsd - case ${cpu} in - sparc) fmt=aout ;; - sparc64) fmt=elf ;; - esac - ;; - - strongarm-*-coff) fmt=coff ;; - strongarm-*-elf) fmt=elf ;; - xscale-*-coff) fmt=coff ;; - xscale-*-elf) fmt=elf ;; - - tic30-*-*aout*) fmt=aout bfd_gas=yes ;; - tic30-*-*coff*) fmt=coff bfd_gas=yes ;; - tic54x-*-* | c54x*-*-*) - fmt=coff bfd_gas=yes need_libm=yes;; - tic80-*-*) fmt=coff ;; - - v850-*-*) fmt=elf bfd_gas=yes ;; - v850e-*-*) fmt=elf bfd_gas=yes ;; - v850ea-*-*) fmt=elf bfd_gas=yes ;; - - vax-*-netbsdelf*) fmt=elf em=nbsd bfd_gas=yes ;; - vax-*-netbsdaout* | vax-*-netbsd*) - fmt=aout em=nbsd ;; - vax-*-bsd* | vax-*-ultrix*) - fmt=aout ;; - vax-*-vms) fmt=vms ;; - - w65-*-*) fmt=coff ;; - - xstormy16-*-*) fmt=elf bfd_gas=yes ;; - - z8k-*-coff | z8k-*-sim) - fmt=coff ;; - - *-*-aout | *-*-scout) - fmt=aout ;; - *-*-freebsd*) fmt=elf em=freebsd bfd_gas=yes ;; - *-*-nindy*) - fmt=bout ;; - *-*-bsd*) - fmt=aout em=sun3 ;; - *-*-generic) fmt=generic ;; - *-*-xray | *-*-hms) fmt=coff ;; - *-*-sim) fmt=coff ;; - *-*-elf | *-*-sysv4* | *-*-solaris*) - echo "configure: warning: GAS support for ${generic_target} is incomplete." 1>&2 - fmt=elf dev=yes ;; - *-*-vxworks) fmt=aout ;; - *-*-netware) fmt=elf ;; + fi + if test x${endian} = xbig; then + { { echo "$as_me:$LINENO: error: Solaris must be configured little endian" >&5 +echo "$as_me: error: Solaris must be configured little endian" >&2;} + { (exit 1); exit 1; }; } + fi ;; + ppc-*-rtems*) fmt=elf ;; + ppc-*-macos* | ppc-*-mpw*) fmt=coff em=macos ;; + ppc-*-netware*) fmt=elf em=ppcnw ;; + ppc-**-nto*) fmt=elf ;; + ppc-*-kaos*) fmt=elf ;; + + s390x-*-linux-gnu*) fmt=elf em=linux ;; + s390-*-linux-gnu*) fmt=elf em=linux ;; + + sh*-*-linux*) fmt=elf em=linux + case ${cpu} in + sh*eb) endian=big ;; + *) endian=little ;; + esac ;; + sh5*-*-netbsd*) fmt=elf em=nbsd ;; + sh64*-*-netbsd*) fmt=elf em=nbsd ;; + sh*-*-netbsdelf*) fmt=elf em=nbsd ;; + sh-*-elf*) fmt=elf ;; + sh-*-coff*) fmt=coff ;; + sh-*-nto*) fmt=elf ;; + sh-*-pe*) fmt=coff em=pe bfd_gas=yes endian=little ;; + sh-*-rtemscoff*) fmt=coff ;; + sh-*-rtems*) fmt=elf ;; + sh-*-kaos*) fmt=elf ;; + shle*-*-kaos*) fmt=elf ;; + sh64-*-elf*) fmt=elf ;; + + ns32k-pc532-mach*) fmt=aout em=pc532mach ;; + ns32k-pc532-ux*) fmt=aout em=pc532mach ;; + ns32k-pc532-lites*) fmt=aout em=nbsd532 ;; + ns32k-*-*n*bsd*) fmt=aout em=nbsd532 ;; + + sparc-*-rtemsaout*) fmt=aout ;; + sparc-*-rtemself*) fmt=elf ;; + sparc-*-rtems*) fmt=elf ;; + sparc-*-sunos4*) fmt=aout em=sun3 ;; + sparc-*-aout | sparc*-*-vxworks*) fmt=aout em=sparcaout ;; + sparc-*-coff) fmt=coff ;; + sparc-*-linux*aout*) fmt=aout em=linux ;; + sparc-*-linux-gnu*) fmt=elf em=linux ;; + sparc-*-lynxos*) fmt=coff em=lynx ;; + sparc-fujitsu-none) fmt=aout ;; + sparc-*-elf) fmt=elf ;; + sparc-*-sysv4*) fmt=elf ;; + sparc-*-solaris*) fmt=elf ;; + sparc-*-netbsdelf*) fmt=elf em=nbsd ;; + sparc-*-*n*bsd*) case ${cpu} in + sparc64) fmt=elf em=nbsd ;; + *) fmt=aout em=nbsd ;; + esac ;; + strongarm-*-coff) fmt=coff ;; + strongarm-*-elf) fmt=elf ;; + strongarm-*-kaos*) fmt=elf ;; + xscale-*-coff) fmt=coff ;; + xscale-*-elf) fmt=elf ;; + + tic30-*-*aout*) fmt=aout bfd_gas=yes ;; + tic30-*-*coff*) fmt=coff bfd_gas=yes ;; + tic4x-*-* | c4x-*-*) fmt=coff bfd_gas=yes ;; + tic54x-*-* | c54x*-*-*) fmt=coff bfd_gas=yes need_libm=yes;; + tic80-*-*) fmt=coff ;; + + v850-*-*) fmt=elf ;; + v850e-*-*) fmt=elf ;; + v850ea-*-*) fmt=elf ;; + + vax-*-netbsdelf*) fmt=elf em=nbsd ;; + vax-*-netbsd*) fmt=aout em=nbsd ;; + vax-*-bsd* | vax-*-ultrix*) fmt=aout ;; + vax-*-linux-gnu*) fmt=elf em=linux bfd_gas=yes ;; + vax-*-vms) fmt=vms ;; + + w65-*-*) fmt=coff ;; + + xstormy16-*-*) fmt=elf ;; + + xtensa-*-*) fmt=elf ;; + + z8k-*-coff | z8k-*-sim) fmt=coff ;; + + *-*-aout | *-*-scout) fmt=aout ;; + *-*-freebsd* | *-*-kfreebsd*-gnu) fmt=elf em=freebsd ;; + *-*-nindy*) fmt=bout ;; + *-*-bsd*) fmt=aout em=sun3 ;; + *-*-generic) fmt=generic ;; + *-*-xray | *-*-hms) fmt=coff ;; + *-*-sim) fmt=coff ;; + *-*-elf | *-*-sysv4* | *-*-solaris*) fmt=elf dev=yes ;; + *-*-aros*) fmt=elf em=linux bfd_gas=yes ;; + *-*-vxworks | *-*-windiss) fmt=elf ;; + *-*-netware) fmt=elf ;; esac if test ${this_target} = $target ; then @@ -2674,38 +4580,116 @@ EOF endian_def=0 fi if test x${endian_def} != x; then - cat >> confdefs.h <>confdefs.h <<_ACEOF #define TARGET_BYTES_BIG_ENDIAN $endian_def -EOF +_ACEOF fi fi case ${cpu_type}-${fmt} in - alpha*-*) bfd_gas=yes ;; - arm-*) bfd_gas=yes ;; - # not yet - # i386-aout) bfd_gas=preferred ;; - ia64*-*) bfd_gas=yes ;; - mips-*) bfd_gas=yes ;; - ns32k-*) bfd_gas=yes ;; - pdp11-*) bfd_gas=yes ;; - ppc-*) bfd_gas=yes ;; - sparc-*) bfd_gas=yes ;; - strongarm-*) bfd_gas=yes ;; - xscale-*) bfd_gas=yes ;; - *-elf) bfd_gas=yes ;; - *-ecoff) bfd_gas=yes ;; - *-som) bfd_gas=yes ;; - #enable bfd for coff and aout to allow testing if a bfd target is - #the primary target, but not for coff or aout as the primary target - i386-coff) if test x${primary_bfd_gas} = xyes; then bfd_gas=yes; fi ;; - i386-aout) if test x${primary_bfd_gas} = xyes; then bfd_gas=yes; fi ;; - *) ;; + alpha*-* | arm-* | i386-* | ia64*-* | mips-* | ns32k-* \ + | pdp11-* | ppc-* | sparc-* | strongarm-* | xscale-* \ + | *-elf | *-ecoff | *-som) + bfd_gas=yes ;; esac # Other random stuff. + case ${cpu_type} in + mips) + # Set mips_cpu to the name of the default CPU. + case ${target_cpu} in + mips | mipsbe | mipseb | mipsle | mipsel | mips64 | mips64el) + mips_cpu=from-abi + ;; + mipsisa32 | mipsisa32el) + mips_cpu=mips32 + ;; + mipsisa32r2 | mipsisa32r2el) + mips_cpu=mips32r2 + ;; + mipsisa64 | mipsisa64el) + mips_cpu=mips64 + ;; + mipsisa64r2 | mipsisa64r2el) + mips_cpu=mips64r2 + ;; + mipstx39 | mipstx39el) + mips_cpu=r3900 + ;; + mips64vr | mips64vrel) + mips_cpu=vr4100 + ;; + mipsisa32r2* | mipsisa64r2*) + mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r2//' -e 's/el$//'` + ;; + mips64* | mipsisa64* | mipsisa32*) + mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..//' -e 's/el$//'` + ;; + *) + { { echo "$as_me:$LINENO: error: $target_cpu isn't a supported MIPS CPU name" >&5 +echo "$as_me: error: $target_cpu isn't a supported MIPS CPU name" >&2;} + { (exit 1); exit 1; }; } + ;; + esac + # See whether it's appropriate to set E_MIPS_ABI_O32 for o32 + # binaries. It's a GNU extension that some OSes don't understand. + # The value only matters on ELF targets. + case ${target} in + *-*-irix*) + use_e_mips_abi_o32=0 + ;; + *) + use_e_mips_abi_o32=1 + ;; + esac + # Decide whether to generate 32-bit or 64-bit code by default. + # Used to resolve -march=from-abi when an embedded ABI is selected. + case ${target} in + mips64*-*-* | mipsisa64*-*-*) + mips_default_64bit=1 + ;; + *) + mips_default_64bit=0 + ;; + esac + # Decide which ABI to target by default. + case ${target} in + mips64*-linux* | mips-sgi-irix6*) + mips_default_abi=N32_ABI + ;; + mips*-linux*) + mips_default_abi=O32_ABI + ;; + *) + mips_default_abi=NO_ABI + ;; + esac + +cat >>confdefs.h <<_ACEOF +#define MIPS_CPU_STRING_DEFAULT "$mips_cpu" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define USE_E_MIPS_ABI_O32 $use_e_mips_abi_o32 +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define MIPS_DEFAULT_64BIT $mips_default_64bit +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define MIPS_DEFAULT_ABI $mips_default_abi +_ACEOF + + ;; + esac + # Do we need the opcodes library? case ${cpu_type} in vax | i386 | tic30) @@ -2728,7 +4712,7 @@ EOF # Any other special object files needed ? case ${cpu_type} in - fr30 | m32r | openrisc) + fr30 | ip2k | iq2000 | m32r | openrisc) using_cgen=yes ;; @@ -2743,17 +4727,17 @@ EOF ;; mips) - echo ${extra_objects} | grep -s "itbl-parse.o" + echo ${extra_objects} | grep -s "itbl-parse.o" if test $? -ne 0 ; then extra_objects="$extra_objects itbl-parse.o" fi - echo ${extra_objects} | grep -s "itbl-lex.o" + echo ${extra_objects} | grep -s "itbl-lex.o" if test $? -ne 0 ; then extra_objects="$extra_objects itbl-lex.o" fi - echo ${extra_objects} | grep -s "itbl-ops.o" + echo ${extra_objects} | grep -s "itbl-ops.o" if test $? -ne 0 ; then extra_objects="$extra_objects itbl-ops.o" fi @@ -2761,9 +4745,10 @@ EOF i386 | s390 | sparc) if test $this_target = $target ; then - cat >> confdefs.h <>confdefs.h <<_ACEOF #define DEFAULT_ARCH "${arch}" -EOF +_ACEOF fi ;; @@ -2772,6 +4757,13 @@ EOF using_cgen=yes ;; + xtensa) + echo ${extra_objects} | grep -s "xtensa-relax.o" + if test $? -ne 0 ; then + extra_objects="$extra_objects xtensa-relax.o" + fi + ;; + *) ;; esac @@ -2865,7 +4857,9 @@ case ${target_cpu} in esac case "${obj_format}" in - "") { echo "configure: error: GAS does not know what format to use for target ${target}" 1>&2; exit 1; } ;; + "") { { echo "$as_me:$LINENO: error: GAS does not know what format to use for target ${target}" >&5 +echo "$as_me: error: GAS does not know what format to use for target ${target}" >&2;} + { (exit 1); exit 1; }; } ;; esac # Unfortunately the cpu in cpu-opc.h file isn't always $(TARGET_CPU). @@ -2874,20 +4868,25 @@ if test $using_cgen = yes ; then case ${target_cpu} in *) cgen_cpu_prefix=${target_cpu} ;; esac - - cat >> confdefs.h <<\EOF + + +cat >>confdefs.h <<\_ACEOF #define USING_CGEN 1 -EOF +_ACEOF fi if test ! -r ${srcdir}/config/tc-${target_cpu_type}.c; then - { echo "configure: error: GAS does not support target CPU ${target_cpu_type}" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: GAS does not support target CPU ${target_cpu_type}" >&5 +echo "$as_me: error: GAS does not support target CPU ${target_cpu_type}" >&2;} + { (exit 1); exit 1; }; } fi if test ! -r ${srcdir}/config/obj-${obj_format}.c; then - { echo "configure: error: GAS does not have support for object file format ${obj_format}" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: GAS does not have support for object file format ${obj_format}" >&5 +echo "$as_me: error: GAS does not have support for object file format ${obj_format}" >&2;} + { (exit 1); exit 1; }; } fi case ${user_bfd_gas}-${primary_bfd_gas} in @@ -2895,7 +4894,8 @@ case ${user_bfd_gas}-${primary_bfd_gas} in # We didn't override user's choice. ;; no-yes) - echo "configure: warning: Use of BFD is required for ${target}; overriding config options." 1>&2 + { echo "$as_me:$LINENO: WARNING: Use of BFD is required for ${target}; overriding config options." >&5 +echo "$as_me: WARNING: Use of BFD is required for ${target}; overriding config options." >&2;} ;; no-preferred) primary_bfd_gas=no @@ -2915,17 +4915,20 @@ esac case ${obj_format} in coff) case ${target_cpu_type} in - i386) cat >> confdefs.h <<\EOF + i386) +cat >>confdefs.h <<\_ACEOF #define I386COFF 1 -EOF +_ACEOF ;; - m68k) cat >> confdefs.h <<\EOF + m68k) +cat >>confdefs.h <<\_ACEOF #define M68KCOFF 1 -EOF +_ACEOF ;; - m88k) cat >> confdefs.h <<\EOF + m88k) +cat >>confdefs.h <<\_ACEOF #define M88KCOFF 1 -EOF +_ACEOF ;; esac ;; @@ -3006,45 +5009,55 @@ emfiles=$_gas_uniq_newlist if test `set . $formats ; shift ; echo $#` -gt 1 ; then for fmt in $formats ; do case $fmt in - aout) cat >> confdefs.h <<\EOF + aout) +cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_AOUT 1 -EOF +_ACEOF ;; - bout) cat >> confdefs.h <<\EOF + bout) +cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_BOUT 1 -EOF +_ACEOF ;; - coff) cat >> confdefs.h <<\EOF + coff) +cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_COFF 1 -EOF +_ACEOF ;; - ecoff) cat >> confdefs.h <<\EOF + ecoff) +cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_ECOFF 1 -EOF +_ACEOF ;; - elf) cat >> confdefs.h <<\EOF + elf) +cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_ELF 1 -EOF +_ACEOF ;; - generic) cat >> confdefs.h <<\EOF + generic) +cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_GENERIC 1 -EOF +_ACEOF ;; - hp300) cat >> confdefs.h <<\EOF + hp300) +cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_HP300 1 -EOF +_ACEOF ;; - ieee) cat >> confdefs.h <<\EOF + ieee) +cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_IEEE 1 -EOF +_ACEOF ;; - som) cat >> confdefs.h <<\EOF + som) +cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_SOM 1 -EOF +_ACEOF ;; - vms) cat >> confdefs.h <<\EOF + vms) +cat >>confdefs.h <<\_ACEOF #define OBJ_MAYBE_VMS 1 -EOF +_ACEOF ;; esac extra_objects="$extra_objects obj-$fmt.o" @@ -3059,28 +5072,32 @@ if test `set . $emfiles ; shift ; echo $#` -gt 0 ; then case "${obj_format}${emfiles}" in multi* | *mips*) extra_objects="$extra_objects $emfiles" - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define USE_EMULATIONS 1 -EOF +_ACEOF ;; esac fi -cat >> confdefs.h <>confdefs.h <<_ACEOF #define EMULATIONS $EMULATIONS -EOF +_ACEOF + -cat >> confdefs.h <>confdefs.h <<_ACEOF #define DEFAULT_EMULATION "$DEFAULT_EMULATION" -EOF +_ACEOF case ${primary_bfd_gas}-${target_cpu_type}-${obj_format} in yes-*-coff) need_bfd=yes ;; no-*-coff) need_bfd=yes - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define MANY_SEGMENTS 1 -EOF +_ACEOF ;; esac @@ -3088,7 +5105,9 @@ reject_dev_configs=yes case ${reject_dev_configs}-${dev} in yes-yes) # Oops. - { echo "configure: error: GAS does not support the ${generic_target} configuration." 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: GAS does not support the ${generic_target} configuration." >&5 +echo "$as_me: error: GAS does not support the ${generic_target} configuration." >&2;} + { (exit 1); exit 1; }; } ;; esac @@ -3099,9 +5118,10 @@ esac case "${primary_bfd_gas}" in - yes) cat >> confdefs.h <<\EOF + yes) +cat >>confdefs.h <<\_ACEOF #define BFD_ASSEMBLER 1 -EOF +_ACEOF need_bfd=yes ;; esac @@ -3116,6 +5136,7 @@ esac case "${need_bfd}" in yes) BFDLIB=../bfd/libbfd.la + BFDVER_H=../bfd/bfdver.h ALL_OBJ_DEPS="$ALL_OBJ_DEPS"' ../bfd/bfd.h $(INCDIR)/symcat.h' ;; esac @@ -3125,235 +5146,483 @@ esac -cat >> confdefs.h <>confdefs.h <<_ACEOF #define TARGET_ALIAS "${target_alias}" -EOF +_ACEOF + -cat >> confdefs.h <>confdefs.h <<_ACEOF #define TARGET_CANONICAL "${target}" -EOF +_ACEOF + -cat >> confdefs.h <>confdefs.h <<_ACEOF #define TARGET_CPU "${target_cpu}" -EOF +_ACEOF + -cat >> confdefs.h <>confdefs.h <<_ACEOF #define TARGET_VENDOR "${target_vendor}" -EOF +_ACEOF + -cat >> confdefs.h <>confdefs.h <<_ACEOF #define TARGET_OS "${target_os}" -EOF +_ACEOF + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi -# Extract the first word of "gcc", so it can be a program name with args. +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # 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:3153: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC else - echo "$ac_t""no" 1>&6 + CC="$ac_cv_prog_CC" fi +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:3183: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + 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 + if test $# != 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="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&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:3234: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&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; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:3266: 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 3277 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:3282: \"$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 + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 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:3308: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross + test -n "$ac_ct_CC" && break +done -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:3313: 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 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me #endif -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:3322: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes -else - ac_cv_prog_gcc=no -fi -fi -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_compiler_gnu=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -if test $ac_cv_prog_gcc = yes; then - GCC=yes -else - GCC= -fi +int +main () +{ -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:3341: 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 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else - ac_cv_prog_cc_g=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no fi - -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then - CFLAGS="$ac_save_CFLAGS" + CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" @@ -3367,371 +5636,983 @@ else CFLAGS= fi fi +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} - -for ac_prog in 'bison -y' byacc +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std1 is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std1. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" 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:3378: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - if test -n "$YACC"; then - ac_cv_prog_YACC="$YACC" # Let the user override the test. -else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - 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_YACC="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" -fi -fi -YACC="$ac_cv_prog_YACC" -if test -n "$YACC"; then - echo "$ac_t""$YACC" 1>&6 -else - echo "$ac_t""no" 1>&6 -fi - -test -n "$YACC" && break + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext done -test -n "$YACC" || YACC="yacc" +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:3409: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # 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:3430: \"$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 - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - 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:3447: \"$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 - : -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - 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:3464: \"$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 + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then : else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done rm -f conftest* - ac_cv_prog_CPP="$CPP" +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h fi - CPP="$ac_cv_prog_CPP" + else - ac_cv_prog_CPP="$CPP" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -echo "$ac_t""$CPP" 1>&6 +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -missing_dir=`cd $ac_aux_dir && pwd` -for ac_prog in flex lex + +for ac_prog in 'bison -y' byacc do -# Extract the first word of "$ac_prog", so it can be a program name with args. + # 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:3494: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_YACC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$LEX"; then - ac_cv_prog_LEX="$LEX" # Let the user override the test. + if test -n "$YACC"; then + ac_cv_prog_YACC="$YACC" # 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_LEX="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_YACC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LEX="$ac_cv_prog_LEX" -if test -n "$LEX"; then - echo "$ac_t""$LEX" 1>&6 +YACC=$ac_cv_prog_YACC +if test -n "$YACC"; then + echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -n "$LEX" && break + test -n "$YACC" && break done -test -n "$LEX" || LEX="$missing_dir/missing flex" +test -n "$YACC" || YACC="yacc" -# Extract the first word of "flex", so it can be a program name with args. -set dummy flex; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3527: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_LEX'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +for ac_prog in flex lex +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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - 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_LEX="flex" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_LEX" && ac_cv_prog_LEX="lex" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_LEX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + fi fi -LEX="$ac_cv_prog_LEX" +LEX=$ac_cv_prog_LEX if test -n "$LEX"; then - echo "$ac_t""$LEX" 1>&6 + echo "$as_me:$LINENO: result: $LEX" >&5 +echo "${ECHO_T}$LEX" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi + test -n "$LEX" && break +done +test -n "$LEX" || LEX=":" + if test -z "$LEXLIB" then - case "$LEX" in - flex*) ac_lib=fl ;; - *) ac_lib=l ;; - esac - echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:3561: checking for yywrap in -l$ac_lib" >&5 -ac_lib_var=`echo $ac_lib'_'yywrap | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-l$ac_lib $LIBS" -cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 +if test "${ac_cv_lib_fl_yywrap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lfl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char yywrap(); - -int main() { -yywrap() -; return 0; } -EOF -if { (eval echo configure:3580: \"$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 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LEXLIB="-l$ac_lib" -else - echo "$ac_t""no" 1>&6 -fi - -fi + builtin and then its argument prototype would still apply. */ +char yywrap (); +int +main () +{ +yywrap (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_fl_yywrap=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_fl_yywrap=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_fl_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 +if test $ac_cv_lib_fl_yywrap = yes; then + LEXLIB="-lfl" +else + echo "$as_me:$LINENO: checking for yywrap in -ll" >&5 +echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 +if test "${ac_cv_lib_l_yywrap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ll $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:3603: 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 +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char yywrap (); +int +main () +{ +yywrap (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_l_yywrap=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_l_yywrap=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_l_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 +if test $ac_cv_lib_l_yywrap = yes; then + LEXLIB="-ll" +fi + +fi + +fi + +if test "x$LEX" != "x:"; then + echo "$as_me:$LINENO: checking lex output file root" >&5 +echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_root+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # The minimal lex program is just a single line: %%. But some broken lexes # (Solaris, I think it was) want two %% lines, so accommodate them. -echo '%% -%%' | $LEX +cat >conftest.l <<_ACEOF +%% +%% +_ACEOF +{ (eval echo "$as_me:$LINENO: \"$LEX conftest.l\"") >&5 + (eval $LEX conftest.l) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else - { echo "configure: error: cannot find output from $LEX; giving up" 1>&2; exit 1; } + { { echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5 +echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} + { (exit 1); exit 1; }; } fi fi - -echo "$ac_t""$ac_cv_prog_lex_root" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 +rm -f conftest.l LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root -echo $ac_n "checking whether yytext is a pointer""... $ac_c" 1>&6 -echo "configure:3624: 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 +echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5 +echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c -ac_save_LIBS="$LIBS" +ac_save_LIBS=$LIBS LIBS="$LIBS $LEXLIB" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF `cat $LEX_OUTPUT_ROOT.c` -int main() { - -; return 0; } -EOF -if { (eval echo configure:3643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_lex_yytext_pointer=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* -LIBS="$ac_save_LIBS" +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_save_LIBS rm -f "${LEX_OUTPUT_ROOT}.c" fi - -echo "$ac_t""$ac_cv_prog_lex_yytext_pointer" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 if test $ac_cv_prog_lex_yytext_pointer = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define YYTEXT_POINTER 1 -EOF +_ACEOF fi +fi +if test "$LEX" = :; then + LEX=${am_missing_run}flex +fi ALL_LINGUAS="fr tr es" -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3669: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test -n "$ac_tool_prefix"; then + # 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 "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&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=":" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3697: 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 + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include #include #include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3710: \"$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* + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_stdc=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -EOF + +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then + $EGREP "memchr" >/dev/null 2>&1; then : else - rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* @@ -3740,16 +6621,19 @@ 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 <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -EOF + +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then + $EGREP "free" >/dev/null 2>&1; then : else - rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* @@ -3758,269 +6642,524 @@ fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. -if test "$cross_compiling" = yes; then + if test "$cross_compiling" = yes; then : else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int main () { int i; for (i = 0; i < 256; i++) -if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); -exit (0); } +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif -EOF -if { (eval echo configure:3777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then : else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no fi -rm -fr conftest* +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi fi - -echo "$ac_t""$ac_cv_header_stdc" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 -EOF +_ACEOF fi -echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3801: 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 <j = 5; -} -{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ - const int foo = 10; -} +echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -; return 0; } -EOF -if { (eval echo configure:3855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_const=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_c_const=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_const=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi - -echo "$ac_t""$ac_cv_c_const" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then - cat >> confdefs.h <<\EOF -#define const -EOF + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF fi -echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:3876: checking for inline" >&5 -if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6 +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif -int main() { -} $ac_kw foo() { -; return 0; } -EOF -if { (eval echo configure:3890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi +echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6 + -echo "$ac_t""$ac_cv_c_inline" 1>&6 -case "$ac_cv_c_inline" in +case $ac_cv_c_inline in inline | yes) ;; - no) cat >> confdefs.h <<\EOF -#define inline -EOF - ;; - *) cat >> confdefs.h <>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; esac -echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3916: 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 +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6 +if test "${ac_cv_type_off_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((off_t *) 0) + return 0; +if (sizeof (off_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_off_t=yes else - rm -rf conftest* - ac_cv_type_off_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_off_t=no fi -echo "$ac_t""$ac_cv_type_off_t" 1>&6 -if test $ac_cv_type_off_t = no; then - cat >> confdefs.h <<\EOF +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6 +if test $ac_cv_type_off_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF #define off_t long -EOF +_ACEOF fi -echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3949: 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 +echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext < -#if STDC_HEADERS -#include -#include -#endif -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_size_t=yes else - rm -rf conftest* - ac_cv_type_size_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +ac_cv_type_size_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$ac_cv_type_size_t" 1>&6 -if test $ac_cv_type_size_t = no; then - cat >> confdefs.h <<\EOF +echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF #define size_t unsigned -EOF +_ACEOF 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:3984: 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 <&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 +if test "${ac_cv_working_alloca_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { -char *p = alloca(2 * sizeof(int)); -; return 0; } -EOF -if { (eval echo configure:3996: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_alloca_h=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 -if test $ac_cv_header_alloca_h = yes; then - cat >> confdefs.h <<\EOF +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_working_alloca_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_working_alloca_h=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 +if test $ac_cv_working_alloca_h = yes; then + +cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 -EOF +_ACEOF fi -echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:4017: checking for alloca" >&5 -if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for alloca" >&5 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6 +if test "${ac_cv_func_alloca_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else @@ -4042,137 +7181,215 @@ char *alloca (); # endif #endif -int main() { -char *p = (char *) alloca(1); -; return 0; } -EOF -if { (eval echo configure:4050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ +char *p = (char *) alloca (1); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_alloca_works=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_func_alloca_works=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_alloca_works=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 -echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 if test $ac_cv_func_alloca_works = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_ALLOCA 1 -EOF -fi +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA 1 +_ACEOF -if test $ac_cv_func_alloca_works = no; then +else # The SVR3 libPW and SVR4 libucb both contain incompatible functions - # that cause trouble. Some versions do not even contain alloca or - # contain a buggy version. If you still want to use their alloca, - # use ar to extract alloca.o from them instead of compiling alloca.c. - ALLOCA=alloca.${ac_objext} - cat >> confdefs.h <<\EOF +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=alloca.$ac_objext + +cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 -EOF +_ACEOF -echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4082: 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 +echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 +if test "${ac_cv_os_cray+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray #endif -EOF +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "webecray" >/dev/null 2>&1; then - rm -rf conftest* + $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else - rm -rf conftest* ac_cv_os_cray=no fi rm -f conftest* fi - -echo "$ac_t""$ac_cv_os_cray" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&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:4112: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:4140: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + +cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func -EOF +_ACEOF - break -else - echo "$ac_t""no" 1>&6 + break fi -done + done fi -echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4167: 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 +echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 +if test "${ac_cv_c_stack_direction+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int find_stack_direction () { static char *addr = 0; @@ -4185,138 +7402,314 @@ find_stack_direction () else return (&dummy > addr) ? 1 : -1; } + +int main () { - exit (find_stack_direction() < 0); + exit (find_stack_direction () < 0); } -EOF -if { (eval echo configure:4194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_c_stack_direction=-1 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_stack_direction=-1 fi -rm -fr conftest* +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi +echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 -echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 -cat >> confdefs.h <>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction -EOF +_ACEOF + fi -for ac_hdr in unistd.h + + +for ac_header in stdlib.h unistd.h do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:4219: 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:4229: \"$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* - eval "ac_cv_header_$ac_safe=yes" +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + ac_cpp_err=yes fi -rm -f conftest* +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + done + for ac_func in getpagesize do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4258: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ -int main() { +#ifdef __STDC__ +# include +#else +# include +#endif +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:4286: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + fi done -echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:4311: 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 +echo "$as_me:$LINENO: checking for working mmap" >&5 +echo $ECHO_N "checking for working mmap... $ECHO_C" >&6 +if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +/* malloc might have been renamed as rpl_malloc. */ +#undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: @@ -4330,34 +7723,34 @@ else back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the - VM page cache was not coherent with the filesystem buffer cache + VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get - propogated back to all the places they're supposed to be. + propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ -#include + #include #include -/* This mess was copied from the GNU getpagesize.h. */ -#ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include -# endif +#if !STDC_HEADERS && !HAVE_STDLIB_H +char *malloc (); +#endif +/* This mess was copied from the GNU getpagesize.h. */ +#if !HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ -# ifndef HAVE_SYS_PARAM_H +# if !HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ -# ifdef HAVE_SYS_PARAM_H +# if HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE @@ -4384,327 +7777,574 @@ else #endif /* no HAVE_GETPAGESIZE */ -#ifdef __cplusplus -extern "C" { void *malloc(unsigned); } -#else -char *malloc(); -#endif - int -main() +main () { - char *data, *data2, *data3; - int i, pagesize; - int fd; - - pagesize = getpagesize(); - - /* - * First, make a file with some known garbage in it. - */ - data = malloc(pagesize); - if (!data) - exit(1); - for (i = 0; i < pagesize; ++i) - *(data + i) = rand(); - umask(0); - fd = creat("conftestmmap", 0600); - if (fd < 0) - exit(1); - if (write(fd, data, pagesize) != pagesize) - exit(1); - close(fd); - - /* - * Next, try to mmap the file at a fixed address which - * already has something else allocated at it. If we can, - * also make sure that we see the same garbage. - */ - fd = open("conftestmmap", O_RDWR); - if (fd < 0) - exit(1); - data2 = malloc(2 * pagesize); - if (!data2) - exit(1); - data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); - if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_FIXED, fd, 0L)) - exit(1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data2 + i)) - exit(1); - - /* - * Finally, make sure that changes to the mapped area - * do not percolate back to the file as seen by read(). - * (This is a bug on some variants of i386 svr4.0.) - */ - for (i = 0; i < pagesize; ++i) - *(data2 + i) = *(data2 + i) + 1; - data3 = malloc(pagesize); - if (!data3) - exit(1); - if (read(fd, data3, pagesize) != pagesize) - exit(1); - for (i = 0; i < pagesize; ++i) - if (*(data + i) != *(data3 + i)) - exit(1); - close(fd); - unlink("conftestmmap"); - exit(0); + char *data, *data2, *data3; + int i, pagesize; + int fd; + + pagesize = getpagesize (); + + /* First, make a file with some known garbage in it. */ + data = (char *) malloc (pagesize); + if (!data) + exit (1); + for (i = 0; i < pagesize; ++i) + *(data + i) = rand (); + umask (0); + fd = creat ("conftest.mmap", 0600); + if (fd < 0) + exit (1); + if (write (fd, data, pagesize) != pagesize) + exit (1); + close (fd); + + /* Next, try to mmap the file at a fixed address which already has + something else allocated at it. If we can, also make sure that + we see the same garbage. */ + fd = open ("conftest.mmap", O_RDWR); + if (fd < 0) + exit (1); + data2 = (char *) malloc (2 * pagesize); + if (!data2) + exit (1); + data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1); + if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + exit (1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + exit (1); + + /* Finally, make sure that changes to the mapped area do not + percolate back to the file as seen by read(). (This is a bug on + some variants of i386 svr4.0.) */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = (char *) malloc (pagesize); + if (!data3) + exit (1); + if (read (fd, data3, pagesize) != pagesize) + exit (1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + exit (1); + close (fd); + exit (0); } - -EOF -if { (eval echo configure:4459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_func_mmap_fixed_mapped=no + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_mmap_fixed_mapped=no fi -rm -fr conftest* +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi - -echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 +echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6 if test $ac_cv_func_mmap_fixed_mapped = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 -EOF +_ACEOF fi +rm -f conftest.mmap + + - - for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \ + + + + + + + + +for ac_header in argz.h limits.h locale.h nl_types.h malloc.h string.h \ 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:4487: 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:4497: \"$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* - eval "ac_cv_header_$ac_safe=yes" +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + ac_cpp_err=yes fi -rm -f conftest* +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi + done - for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \ + + + + + + + + + + +for ac_func in getcwd munmap putenv setenv setlocale strchr strcasecmp \ __argz_count __argz_stringify __argz_next do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4527: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ -int main() { +#ifdef __STDC__ +# include +#else +# include +#endif +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:4555: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done if test "${ac_cv_func_stpcpy+set}" != "set"; then - for ac_func in stpcpy + +for ac_func in stpcpy do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4584: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:4612: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done fi if test "${ac_cv_func_stpcpy}" = "yes"; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_STPCPY 1 -EOF +_ACEOF fi if test $ac_cv_header_locale_h = yes; then - echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:4646: 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 <&5 +echo $ECHO_N "checking for LC_MESSAGES... $ECHO_C" >&6 +if test "${am_cv_val_LC_MESSAGES+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { +int +main () +{ return LC_MESSAGES -; return 0; } -EOF -if { (eval echo configure:4658: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then am_cv_val_LC_MESSAGES=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - am_cv_val_LC_MESSAGES=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +am_cv_val_LC_MESSAGES=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi - -echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6 +echo "$as_me:$LINENO: result: $am_cv_val_LC_MESSAGES" >&5 +echo "${ECHO_T}$am_cv_val_LC_MESSAGES" >&6 if test $am_cv_val_LC_MESSAGES = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_LC_MESSAGES 1 -EOF +_ACEOF fi fi - echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:4679: checking whether NLS is requested" >&5 + echo "$as_me:$LINENO: checking whether NLS is requested" >&5 +echo $ECHO_N "checking whether NLS is requested... $ECHO_C" >&6 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" USE_NLS=$enableval else USE_NLS=yes -fi +fi; + echo "$as_me:$LINENO: result: $USE_NLS" >&5 +echo "${ECHO_T}$USE_NLS" >&6 - echo "$ac_t""$USE_NLS" 1>&6 - USE_INCLUDED_LIBINTL=no if test "$USE_NLS" = "yes"; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define ENABLE_NLS 1 -EOF +_ACEOF - echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:4699: checking whether included gettext is requested" >&5 - # Check whether --with-included-gettext or --without-included-gettext was given. + echo "$as_me:$LINENO: checking whether included gettext is requested" >&5 +echo $ECHO_N "checking whether included gettext is requested... $ECHO_C" >&6 + +# Check whether --with-included-gettext or --without-included-gettext was given. if test "${with_included_gettext+set}" = set; then withval="$with_included_gettext" nls_cv_force_use_gnu_gettext=$withval else nls_cv_force_use_gnu_gettext=no -fi - - echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6 +fi; + echo "$as_me:$LINENO: result: $nls_cv_force_use_gnu_gettext" >&5 +echo "${ECHO_T}$nls_cv_force_use_gnu_gettext" >&6 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" if test "$nls_cv_force_use_gnu_gettext" != "yes"; then @@ -4712,141 +8352,332 @@ fi nls_cv_header_libgt= CATOBJEXT=NONE - ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:4718: 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 <&5 +echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 +if test "${ac_cv_header_libintl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 +echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking libintl.h usability" >&5 +echo $ECHO_N "checking libintl.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default #include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4728: \"$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* - eval "ac_cv_header_$ac_safe=yes" +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking libintl.h presence" >&5 +echo $ECHO_N "checking libintl.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + ac_cpp_err=yes fi -rm -f conftest* +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: libintl.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: libintl.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: libintl.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: libintl.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: libintl.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: libintl.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: libintl.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: libintl.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: libintl.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: libintl.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for libintl.h" >&5 +echo $ECHO_N "checking for libintl.h... $ECHO_C" >&6 +if test "${ac_cv_header_libintl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_libintl_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_libintl_h" >&5 +echo "${ECHO_T}$ac_cv_header_libintl_h" >&6 + 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:4745: 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 +if test $ac_cv_header_libintl_h = yes; then + echo "$as_me:$LINENO: checking for gettext in libc" >&5 +echo $ECHO_N "checking for gettext in libc... $ECHO_C" >&6 +if test "${gt_cv_func_gettext_libc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { +int +main () +{ return (int) gettext ("") -; return 0; } -EOF -if { (eval echo configure:4757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then gt_cv_func_gettext_libc=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gt_cv_func_gettext_libc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gt_cv_func_gettext_libc=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi - -echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6 +echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libc" >&5 +echo "${ECHO_T}$gt_cv_func_gettext_libc" >&6 if test "$gt_cv_func_gettext_libc" != "yes"; then - echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6 -echo "configure:4773: 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 + echo "$as_me:$LINENO: checking for bindtextdomain in -lintl" >&5 +echo $ECHO_N "checking for bindtextdomain in -lintl... $ECHO_C" >&6 +if test "${ac_cv_lib_intl_bindtextdomain+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lintl $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + /* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char bindtextdomain(); - -int main() { -bindtextdomain() -; return 0; } -EOF -if { (eval echo configure:4792: \"$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 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6 -echo "configure:4808: 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>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_intl_bindtextdomain=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_intl_bindtextdomain=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_intl_bindtextdomain" >&5 +echo "${ECHO_T}$ac_cv_lib_intl_bindtextdomain" >&6 +if test $ac_cv_lib_intl_bindtextdomain = yes; then + echo "$as_me:$LINENO: checking for gettext in libintl" >&5 +echo $ECHO_N "checking for gettext in libintl... $ECHO_C" >&6 +if test "${gt_cv_func_gettext_libintl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { +int +main () +{ return (int) gettext ("") -; return 0; } -EOF -if { (eval echo configure:4820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then gt_cv_func_gettext_libintl=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gt_cv_func_gettext_libintl=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gt_cv_func_gettext_libintl=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi - -echo "$ac_t""$gt_cv_func_gettext_libintl" 1>&6 -else - echo "$ac_t""no" 1>&6 +echo "$as_me:$LINENO: result: $gt_cv_func_gettext_libintl" >&5 +echo "${ECHO_T}$gt_cv_func_gettext_libintl" >&6 fi fi if test "$gt_cv_func_gettext_libc" = "yes" \ || test "$gt_cv_func_gettext_libintl" = "yes"; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define HAVE_GETTEXT 1 -EOF +_ACEOF # 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:4848: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in /*) @@ -4870,108 +8701,160 @@ esac fi MSGFMT="$ac_cv_path_MSGFMT" if test -n "$MSGFMT"; then - echo "$ac_t""$MSGFMT" 1>&6 + echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi if test "$MSGFMT" != "no"; then - for ac_func in dcgettext + +for ac_func in dcgettext do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4882: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ -int main() { +#ifdef __STDC__ +# include +#else +# include +#endif +#undef $ac_func + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:4910: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi 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:4937: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GMSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$GMSGFMT" in - /*) + case $GMSGFMT in + [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. - ;; *) - 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_path_GMSGFMT="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi -GMSGFMT="$ac_cv_path_GMSGFMT" +GMSGFMT=$ac_cv_path_GMSGFMT + if test -n "$GMSGFMT"; then - echo "$ac_t""$GMSGFMT" 1>&6 + echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 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:4973: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_XGETTEXT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in /*) @@ -4995,42 +8878,70 @@ esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test -n "$XGETTEXT"; then - echo "$ac_t""$XGETTEXT" 1>&6 + echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { +int +main () +{ extern int _nl_msg_cat_cntr; return _nl_msg_cat_cntr -; return 0; } -EOF -if { (eval echo configure:5013: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then CATOBJEXT=.gmo DATADIRNAME=share else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CATOBJEXT=.mo + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +CATOBJEXT=.mo DATADIRNAME=lib fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext INSTOBJEXT=.mo fi fi - -else - echo "$ac_t""no" 1>&6 + fi - + + if test "$CATOBJEXT" = "NONE"; then nls_cv_use_gnu_gettext=yes fi @@ -5040,10 +8951,10 @@ fi INTLOBJS="\$(GETTOBJS)" # 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:5045: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$MSGFMT" in /*) @@ -5067,53 +8978,59 @@ esac fi MSGFMT="$ac_cv_path_MSGFMT" if test -n "$MSGFMT"; then - echo "$ac_t""$MSGFMT" 1>&6 + echo "$as_me:$LINENO: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 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:5079: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GMSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - case "$GMSGFMT" in - /*) + case $GMSGFMT in + [\\/]* | ?:[\\/]*) ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. ;; - ?:/*) - ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. - ;; *) - 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_path_GMSGFMT="$ac_dir/$ac_word" - break - fi - done - IFS="$ac_save_ifs" + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_GMSGFMT="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" ;; esac fi -GMSGFMT="$ac_cv_path_GMSGFMT" +GMSGFMT=$ac_cv_path_GMSGFMT + if test -n "$GMSGFMT"; then - echo "$ac_t""$GMSGFMT" 1>&6 + echo "$as_me:$LINENO: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 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:5115: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_XGETTEXT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$XGETTEXT" in /*) @@ -5137,12 +9054,14 @@ esac fi XGETTEXT="$ac_cv_path_XGETTEXT" if test -n "$XGETTEXT"; then - echo "$ac_t""$XGETTEXT" 1>&6 + echo "$as_me:$LINENO: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6 else - echo "$ac_t""no" 1>&6 + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - + USE_INCLUDED_LIBINTL=yes CATOBJEXT=.gmo INSTOBJEXT=.mo @@ -5158,7 +9077,8 @@ fi if $XGETTEXT --omit-header /dev/null 2> /dev/null; then : ; else - echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6 + echo "$as_me:$LINENO: result: found xgettext programs is not GNU xgettext; ignore it" >&5 +echo "${ECHO_T}found xgettext programs is not GNU xgettext; ignore it" >&6 XGETTEXT=":" fi fi @@ -5183,25 +9103,25 @@ fi POFILES="$POFILES $lang.po" done - - - - - - - - - - - - + + + + + + + + + + + + if test "x$CATOBJEXT" != "x"; then if test "x$ALL_LINGUAS" = "x"; then LINGUAS= else - echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:5205: checking for catalogs to be installed" >&5 + echo "$as_me:$LINENO: checking for catalogs to be installed" >&5 +echo $ECHO_N "checking for catalogs to be installed... $ECHO_C" >&6 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -5209,7 +9129,8 @@ echo "configure:5205: checking for catalogs to be installed" >&5 esac done LINGUAS=$NEW_LINGUAS - echo "$ac_t""$LINGUAS" 1>&6 + echo "$as_me:$LINENO: result: $LINGUAS" >&5 +echo "${ECHO_T}$LINGUAS" >&6 fi if test -n "$LINGUAS"; then @@ -5223,45 +9144,154 @@ echo "configure:5205: checking for catalogs to be installed" >&5 INCLUDE_LOCALE_H="\ /* The system does not provide the header . Take care yourself. */" fi - + if test -f $srcdir/po2tbl.sed.in; then 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:5233: 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 <&5 +echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6 +if test "${ac_cv_header_linux_version_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5 +echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking linux/version.h usability" >&5 +echo $ECHO_N "checking linux/version.h usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default #include -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:5243: \"$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* - eval "ac_cv_header_$ac_safe=yes" +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking linux/version.h presence" >&5 +echo $ECHO_N "checking linux/version.h presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + ac_cpp_err=yes fi -rm -f conftest* +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: linux/version.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: linux/version.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: linux/version.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: linux/version.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: linux/version.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: linux/version.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: linux/version.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: linux/version.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: linux/version.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: linux/version.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for linux/version.h" >&5 +echo $ECHO_N "checking for linux/version.h... $ECHO_C" >&6 +if test "${ac_cv_header_linux_version_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_linux_version_h=$ac_header_preproc +fi +echo "$as_me:$LINENO: result: $ac_cv_header_linux_version_h" >&5 +echo "${ECHO_T}$ac_cv_header_linux_version_h" >&6 + fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 +if test $ac_cv_header_linux_version_h = yes; then msgformat=linux else - echo "$ac_t""no" 1>&6 -msgformat=xopen + msgformat=xopen fi + sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed fi sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ @@ -5275,14 +9305,14 @@ fi GT_NO= GT_YES="#YES#" fi - - + + MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" - + l= - + if test -f $srcdir/po/POTFILES.in; then test -d po || mkdir po @@ -5299,20 +9329,20 @@ fi sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ < $srcdir/po/POTFILES.in > po/POTFILES fi - -echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:5306: checking whether to enable maintainer-specific portions of Makefiles" >&5 + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no -fi +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 - echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 - if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= @@ -5321,143 +9351,261 @@ else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi + MAINT=$MAINTAINER_MODE_TRUE - -echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:5331: 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:5341: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.$ac_ext | *.c | *.o | *.obj) ;; - *) 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 -for ac_hdr in string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h + + + + + + + +for ac_header in string.h stdlib.h memory.h strings.h unistd.h stdarg.h varargs.h errno.h sys/types.h do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:5366: 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:5376: \"$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* - eval "ac_cv_header_$ac_safe=yes" +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_header_compiler=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" + ac_cpp_err=yes fi -rm -f conftest* +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## ------------------------------------------ ## +## Report this to the AC_PACKAGE_NAME lists. ## +## ------------------------------------------ ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 + eval "$as_ac_Header=\$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi + done # Put this here so that autoconf's "cross-compiling" message doesn't confuse # people who are not cross-compiling but are compiling cross-assemblers. -echo $ac_n "checking whether compiling a cross-assembler""... $ac_c" 1>&6 -echo "configure:5406: checking whether compiling a cross-assembler" >&5 +echo "$as_me:$LINENO: checking whether compiling a cross-assembler" >&5 +echo $ECHO_N "checking whether compiling a cross-assembler... $ECHO_C" >&6 if test "${host}" = "${target}"; then cross_gas=no else cross_gas=yes - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define CROSS_COMPILE 1 -EOF +_ACEOF fi -echo "$ac_t""$cross_gas" 1>&6 +echo "$as_me:$LINENO: result: $cross_gas" >&5 +echo "${ECHO_T}$cross_gas" >&6 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:5421: 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 <&5 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6 +if test "${ac_cv_working_alloca_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include -int main() { -char *p = alloca(2 * sizeof(int)); -; return 0; } -EOF -if { (eval echo configure:5433: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_alloca_h=no -fi -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 -if test $ac_cv_header_alloca_h = yes; then - cat >> confdefs.h <<\EOF +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_working_alloca_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_working_alloca_h=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6 +if test $ac_cv_working_alloca_h = yes; then + +cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA_H 1 -EOF +_ACEOF fi -echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:5454: checking for alloca" >&5 -if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for alloca" >&5 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6 +if test "${ac_cv_func_alloca_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #ifdef __GNUC__ # define alloca __builtin_alloca #else @@ -5479,137 +9627,215 @@ char *alloca (); # endif #endif -int main() { -char *p = (char *) alloca(1); -; return 0; } -EOF -if { (eval echo configure:5487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* +int +main () +{ +char *p = (char *) alloca (1); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_alloca_works=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_func_alloca_works=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_alloca_works=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi +echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6 -echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 if test $ac_cv_func_alloca_works = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_ALLOCA 1 -EOF -fi +cat >>confdefs.h <<\_ACEOF +#define HAVE_ALLOCA 1 +_ACEOF -if test $ac_cv_func_alloca_works = no; then +else # The SVR3 libPW and SVR4 libucb both contain incompatible functions - # that cause trouble. Some versions do not even contain alloca or - # contain a buggy version. If you still want to use their alloca, - # use ar to extract alloca.o from them instead of compiling alloca.c. - ALLOCA=alloca.${ac_objext} - cat >> confdefs.h <<\EOF +# that cause trouble. Some versions do not even contain alloca or +# contain a buggy version. If you still want to use their alloca, +# use ar to extract alloca.o from them instead of compiling alloca.c. + +ALLOCA=alloca.$ac_objext + +cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 -EOF +_ACEOF -echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:5519: 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 +echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 +if test "${ac_cv_os_cray+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #if defined(CRAY) && ! defined(CRAY2) webecray #else wenotbecray #endif -EOF +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "webecray" >/dev/null 2>&1; then - rm -rf conftest* + $EGREP "webecray" >/dev/null 2>&1; then ac_cv_os_cray=yes else - rm -rf conftest* ac_cv_os_cray=no fi rm -f conftest* fi - -echo "$ac_t""$ac_cv_os_cray" 1>&6 +echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5 +echo "${ECHO_T}$ac_cv_os_cray" >&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:5549: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:5577: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - cat >> confdefs.h <&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + +cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func -EOF +_ACEOF - break -else - echo "$ac_t""no" 1>&6 + break fi -done + done fi -echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:5604: 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 +echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 +if test "${ac_cv_c_stack_direction+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int find_stack_direction () { static char *addr = 0; @@ -5622,331 +9848,550 @@ find_stack_direction () else return (&dummy > addr) ? 1 : -1; } + +int main () { - exit (find_stack_direction() < 0); + exit (find_stack_direction () < 0); } -EOF -if { (eval echo configure:5631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_stack_direction=1 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_c_stack_direction=-1 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_stack_direction=-1 fi -rm -fr conftest* +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi +echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6 -echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 -cat >> confdefs.h <>confdefs.h <<_ACEOF #define STACK_DIRECTION $ac_cv_c_stack_direction -EOF +_ACEOF + fi -echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:5653: checking for inline" >&5 -if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6 +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif -int main() { -} $ac_kw foo() { -; return 0; } -EOF -if { (eval echo configure:5667: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done fi +echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6 -echo "$ac_t""$ac_cv_c_inline" 1>&6 -case "$ac_cv_c_inline" in + +case $ac_cv_c_inline in inline | yes) ;; - no) cat >> confdefs.h <<\EOF -#define inline -EOF - ;; - *) cat >> confdefs.h <>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; esac # VMS doesn't have unlink. + + for ac_func in unlink remove do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5697: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:5725: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF break -else - echo "$ac_t""no" 1>&6 fi done # Some systems don't have sbrk(). + for ac_func in sbrk do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:5754: 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 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char $ac_func(); + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif -int main() { +#undef $ac_func +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me #else -$ac_func(); +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif -; return 0; } -EOF -if { (eval echo configure:5782: \"$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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return f != $ac_func; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +eval "$as_ac_var=no" +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 fi done # do we need the math library? case "${need_libm}" in -yes) +yes) LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32*) # These system don't have libm ;; -*-ncr-sysv4.3*) - echo $ac_n "checking for _mwvalidcheckl in -lmw""... $ac_c" 1>&6 -echo "configure:5817: checking for _mwvalidcheckl in -lmw" >&5 -ac_lib_var=`echo mw'_'_mwvalidcheckl | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lmw $LIBS" -cat > conftest.$ac_ext <&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 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" +*-ncr-sysv4.3*) + echo "$as_me:$LINENO: checking for _mwvalidcheckl in -lmw" >&5 +echo $ECHO_N "checking for _mwvalidcheckl in -lmw... $ECHO_C" >&6 +if test "${ac_cv_lib_mw__mwvalidcheckl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lmw $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char _mwvalidcheckl (); +int +main () +{ +_mwvalidcheckl (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_mw__mwvalidcheckl=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_mw__mwvalidcheckl=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_mw__mwvalidcheckl" >&5 +echo "${ECHO_T}$ac_cv_lib_mw__mwvalidcheckl" >&6 +if test $ac_cv_lib_mw__mwvalidcheckl = yes; then LIBM="-lmw" -else - echo "$ac_t""no" 1>&6 fi - echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5857: checking for main in -lm" >&5 -ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for main in -lm" >&5 +echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6 +if test "${ac_cv_lib_m_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { -main() -; return 0; } -EOF -if { (eval echo configure:5872: \"$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 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_m_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_m_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5 +echo "${ECHO_T}$ac_cv_lib_m_main" >&6 +if test $ac_cv_lib_m_main = yes; then LIBM="$LIBM -lm" -else - echo "$ac_t""no" 1>&6 fi ;; *) - echo $ac_n "checking for main in -lm""... $ac_c" 1>&6 -echo "configure:5895: checking for main in -lm" >&5 -ac_lib_var=`echo m'_'main | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + echo "$as_me:$LINENO: checking for main in -lm" >&5 +echo $ECHO_N "checking for main in -lm... $ECHO_C" >&6 +if test "${ac_cv_lib_m_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" -cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { -main() -; return 0; } -EOF -if { (eval echo configure:5910: \"$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 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 +int +main () +{ +main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_m_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_m_main=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_m_main" >&5 +echo "${ECHO_T}$ac_cv_lib_m_main" >&6 +if test $ac_cv_lib_m_main = yes; then LIBM="-lm" -else - echo "$ac_t""no" 1>&6 fi ;; esac - + ;; esac # Some non-ANSI preprocessors botch requoting inside strings. That's bad # enough, but on some of those systems, the assert macro relies on requoting # working properly! -echo $ac_n "checking for working assert macro""... $ac_c" 1>&6 -echo "configure:5941: checking for working assert macro" >&5 -if eval "test \"`echo '$''{'gas_cv_assert_ok'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking for working assert macro... $ECHO_C" >&6 +if test "${gas_cv_assert_ok+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include #include -int main() { +int +main () +{ /* check for requoting problems */ static int a, b, c, d; @@ -5956,23 +10401,47 @@ assert (!strcmp(s, "foo bar baz quux")); assert (a == b || c == d); -; return 0; } -EOF -if { (eval echo configure:5962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then gas_cv_assert_ok=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gas_cv_assert_ok=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gas_cv_assert_ok=no fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$ac_t""$gas_cv_assert_ok" 1>&6 -test $gas_cv_assert_ok = yes || cat >> confdefs.h <<\EOF +echo "$as_me:$LINENO: result: $gas_cv_assert_ok" >&5 +echo "${ECHO_T}$gas_cv_assert_ok" >&6 +test $gas_cv_assert_ok = yes || +cat >>confdefs.h <<\_ACEOF #define BROKEN_ASSERT 1 -EOF +_ACEOF @@ -5998,663 +10467,1857 @@ gas_test_headers=" #endif " -echo $ac_n "checking whether declaration is required for strstr""... $ac_c" 1>&6 -echo "configure:6003: checking whether declaration is required for strstr" >&5 -if eval "test \"`echo '$''{'gas_cv_decl_needed_strstr'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5 +echo $ECHO_N "checking whether declaration is required for strstr... $ECHO_C" >&6 +if test "${gas_cv_decl_needed_strstr+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $gas_test_headers -int main() { +int +main () +{ typedef char *(*f)(); f x; x = (f) strstr; -; return 0; } -EOF -if { (eval echo configure:6019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then gas_cv_decl_needed_strstr=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gas_cv_decl_needed_strstr=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gas_cv_decl_needed_strstr=yes fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$ac_t""$gas_cv_decl_needed_strstr" 1>&6 +echo "$as_me:$LINENO: result: $gas_cv_decl_needed_strstr" >&5 +echo "${ECHO_T}$gas_cv_decl_needed_strstr" >&6 if test $gas_cv_decl_needed_strstr = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define NEED_DECLARATION_STRSTR 1 -EOF +_ACEOF fi -echo $ac_n "checking whether declaration is required for malloc""... $ac_c" 1>&6 -echo "configure:6040: checking whether declaration is required for malloc" >&5 -if eval "test \"`echo '$''{'gas_cv_decl_needed_malloc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking whether declaration is required for malloc" >&5 +echo $ECHO_N "checking whether declaration is required for malloc... $ECHO_C" >&6 +if test "${gas_cv_decl_needed_malloc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $gas_test_headers -int main() { +int +main () +{ typedef char *(*f)(); f x; x = (f) malloc; -; return 0; } -EOF -if { (eval echo configure:6056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then gas_cv_decl_needed_malloc=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gas_cv_decl_needed_malloc=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gas_cv_decl_needed_malloc=yes fi -rm -f conftest* +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi -echo "$ac_t""$gas_cv_decl_needed_malloc" 1>&6 +echo "$as_me:$LINENO: result: $gas_cv_decl_needed_malloc" >&5 +echo "${ECHO_T}$gas_cv_decl_needed_malloc" >&6 if test $gas_cv_decl_needed_malloc = yes; then - cat >> confdefs.h <<\EOF + +cat >>confdefs.h <<\_ACEOF #define NEED_DECLARATION_MALLOC 1 -EOF +_ACEOF fi -echo $ac_n "checking whether declaration is required for free""... $ac_c" 1>&6 -echo "configure:6077: checking whether declaration is required for free" >&5 -if eval "test \"`echo '$''{'gas_cv_decl_needed_free'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +echo "$as_me:$LINENO: checking whether declaration is required for free" >&5 +echo $ECHO_N "checking whether declaration is required for free... $ECHO_C" >&6 +if test "${gas_cv_decl_needed_free+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ $gas_test_headers -int main() { +int +main () +{ typedef void (*f)(); f x; x = (f) free; -; return 0; } -EOF -if { (eval echo configure:6093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then gas_cv_decl_needed_free=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gas_cv_decl_needed_free=yes + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gas_cv_decl_needed_free=yes +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $gas_cv_decl_needed_free" >&5 +echo "${ECHO_T}$gas_cv_decl_needed_free" >&6 +if test $gas_cv_decl_needed_free = yes; then + +cat >>confdefs.h <<\_ACEOF +#define NEED_DECLARATION_FREE 1 +_ACEOF + +fi + + +echo "$as_me:$LINENO: checking whether declaration is required for sbrk" >&5 +echo $ECHO_N "checking whether declaration is required for sbrk... $ECHO_C" >&6 +if test "${gas_cv_decl_needed_sbrk+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$gas_test_headers +int +main () +{ + +typedef char *(*f)(); +f x; +x = (f) sbrk; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gas_cv_decl_needed_sbrk=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gas_cv_decl_needed_sbrk=yes +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $gas_cv_decl_needed_sbrk" >&5 +echo "${ECHO_T}$gas_cv_decl_needed_sbrk" >&6 +if test $gas_cv_decl_needed_sbrk = yes; then + +cat >>confdefs.h <<\_ACEOF +#define NEED_DECLARATION_SBRK 1 +_ACEOF + +fi + + +echo "$as_me:$LINENO: checking whether declaration is required for environ" >&5 +echo $ECHO_N "checking whether declaration is required for environ... $ECHO_C" >&6 +if test "${gas_cv_decl_needed_environ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$gas_test_headers +int +main () +{ + +typedef char **f; +f x; +x = (f) environ; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gas_cv_decl_needed_environ=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gas_cv_decl_needed_environ=yes +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $gas_cv_decl_needed_environ" >&5 +echo "${ECHO_T}$gas_cv_decl_needed_environ" >&6 +if test $gas_cv_decl_needed_environ = yes; then + +cat >>confdefs.h <<\_ACEOF +#define NEED_DECLARATION_ENVIRON 1 +_ACEOF + +fi + + +# Does errno.h declare errno, or do we have to add a separate declaration +# for it? + +echo "$as_me:$LINENO: checking whether declaration is required for errno" >&5 +echo $ECHO_N "checking whether declaration is required for errno... $ECHO_C" >&6 +if test "${gas_cv_decl_needed_errno+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +#ifdef HAVE_ERRNO_H +#include +#endif + +int +main () +{ + +typedef int f; +f x; +x = (f) errno; + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + gas_cv_decl_needed_errno=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +gas_cv_decl_needed_errno=yes +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $gas_cv_decl_needed_errno" >&5 +echo "${ECHO_T}$gas_cv_decl_needed_errno" >&6 +if test $gas_cv_decl_needed_errno = yes; then + +cat >>confdefs.h <<\_ACEOF +#define NEED_DECLARATION_ERRNO 1 +_ACEOF + +fi + + + + + ac_config_files="$ac_config_files Makefile doc/Makefile po/Makefile.in:po/Make-in" + + ac_config_commands="$ac_config_commands default" + + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false fi -rm -f conftest* + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' fi -echo "$ac_t""$gas_cv_decl_needed_free" 1>&6 -if test $gas_cv_decl_needed_free = yes; then - cat >> confdefs.h <<\EOF -#define NEED_DECLARATION_FREE 1 -EOF +rm -f conf$$ conf$$.exe conf$$.file +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false fi +as_executable_p="test -f" -echo $ac_n "checking whether declaration is required for sbrk""... $ac_c" 1>&6 -echo "configure:6114: checking whether declaration is required for sbrk" >&5 -if eval "test \"`echo '$''{'gas_cv_decl_needed_sbrk'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - gas_cv_decl_needed_sbrk=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gas_cv_decl_needed_sbrk=yes -fi -rm -f conftest* -fi -echo "$ac_t""$gas_cv_decl_needed_sbrk" 1>&6 -if test $gas_cv_decl_needed_sbrk = yes; then - cat >> confdefs.h <<\EOF -#define NEED_DECLARATION_SBRK 1 -EOF -fi +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" +# CDPATH. +$as_unset CDPATH -echo $ac_n "checking whether declaration is required for environ""... $ac_c" 1>&6 -echo "configure:6151: checking whether declaration is required for environ" >&5 -if eval "test \"`echo '$''{'gas_cv_decl_needed_environ'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&1 -typedef char **f; -f x; -x = (f) environ; +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF -; return 0; } -EOF -if { (eval echo configure:6167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - gas_cv_decl_needed_environ=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gas_cv_decl_needed_environ=yes +This file was extended by $as_me, which was +generated by GNU Autoconf 2.59. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi -rm -f conftest* + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi -echo "$ac_t""$gas_cv_decl_needed_environ" 1>&6 -if test $gas_cv_decl_needed_environ = yes; then - cat >> confdefs.h <<\EOF -#define NEED_DECLARATION_ENVIRON 1 -EOF +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi -# Does errno.h declare errno, or do we have to add a separate declaration -# for it? +cat >>$CONFIG_STATUS <<\_ACEOF -echo $ac_n "checking whether declaration is required for errno""... $ac_c" 1>&6 -echo "configure:6191: checking whether declaration is required for errno" >&5 -if eval "test \"`echo '$''{'gas_cv_decl_needed_errno'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - gas_cv_decl_needed_errno=no -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - gas_cv_decl_needed_errno=yes -fi -rm -f conftest* -fi -echo "$ac_t""$gas_cv_decl_needed_errno" 1>&6 -if test $gas_cv_decl_needed_errno = yes; then - cat >> confdefs.h <<\EOF -#define NEED_DECLARATION_ERRNO 1 -EOF +Configuration headers: +$config_headers -fi +Configuration commands: +$config_commands +Report bugs to ." +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +Copyright (C) 2003 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_shift=: ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + -*) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; + esac -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + case $ac_option in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi + *) ac_config_targets="$ac_config_targets $1" ;; -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + esac + shift +done -DEFS=-DHAVE_CONFIG_H +ac_configure_extra_args= -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS </dev/null | sed 1q`: +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF # -# $0 $ac_configure_args +# INIT-COMMANDS section. # -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +target_cpu_type=${target_cpu_type} + cgen_cpu_prefix=${cgen_cpu_prefix} + obj_format=${obj_format} + te_file=${te_file} + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; + case "$ac_config_target" in + # Handling of arguments. + "gdb.ini" ) CONFIG_FILES="$CONFIG_FILES gdb.ini:gdbinit.in" ;; + ".gdbinit" ) CONFIG_FILES="$CONFIG_FILES .gdbinit:gdbinit.in" ;; + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in:po/Make-in" ;; + "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config.in" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; esac done -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason to put it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} -trap 'rm -fr `echo "Makefile doc/Makefile ${GDBINIT}:gdbinit.in po/Makefile.in:po/Make-in config.h:config.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@target@%$target%g -s%@target_alias@%$target_alias%g -s%@target_cpu@%$target_cpu%g -s%@target_vendor@%$target_vendor%g -s%@target_os@%$target_os%g -s%@build@%$build%g -s%@build_alias@%$build_alias%g -s%@build_cpu@%$build_cpu%g -s%@build_vendor@%$build_vendor%g -s%@build_os@%$build_os%g -s%@CC@%$CC%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@PACKAGE@%$PACKAGE%g -s%@VERSION@%$VERSION%g -s%@ACLOCAL@%$ACLOCAL%g -s%@AUTOCONF@%$AUTOCONF%g -s%@AUTOMAKE@%$AUTOMAKE%g -s%@AUTOHEADER@%$AUTOHEADER%g -s%@MAKEINFO@%$MAKEINFO%g -s%@SET_MAKE@%$SET_MAKE%g -s%@LN_S@%$LN_S%g -s%@OBJEXT@%$OBJEXT%g -s%@EXEEXT@%$EXEEXT%g -s%@RANLIB@%$RANLIB%g -s%@STRIP@%$STRIP%g -s%@LIBTOOL@%$LIBTOOL%g -s%@WARN_CFLAGS@%$WARN_CFLAGS%g -s%@GDBINIT@%$GDBINIT%g -s%@cgen_cpu_prefix@%$cgen_cpu_prefix%g -s%@extra_objects@%$extra_objects%g -s%@target_cpu_type@%$target_cpu_type%g -s%@obj_format@%$obj_format%g -s%@te_file@%$te_file%g -s%@install_tooldir@%$install_tooldir%g -s%@atof@%$atof%g -s%@BFDLIB@%$BFDLIB%g -s%@OPCODES_LIB@%$OPCODES_LIB%g -s%@ALL_OBJ_DEPS@%$ALL_OBJ_DEPS%g -s%@YACC@%$YACC%g -s%@LEX@%$LEX%g -s%@LEXLIB@%$LEXLIB%g -s%@CPP@%$CPP%g -s%@LEX_OUTPUT_ROOT@%$LEX_OUTPUT_ROOT%g -s%@ALLOCA@%$ALLOCA%g -s%@USE_NLS@%$USE_NLS%g -s%@MSGFMT@%$MSGFMT%g -s%@GMSGFMT@%$GMSGFMT%g -s%@XGETTEXT@%$XGETTEXT%g -s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g -s%@CATALOGS@%$CATALOGS%g -s%@CATOBJEXT@%$CATOBJEXT%g -s%@DATADIRNAME@%$DATADIRNAME%g -s%@GMOFILES@%$GMOFILES%g -s%@INSTOBJEXT@%$INSTOBJEXT%g -s%@INTLDEPS@%$INTLDEPS%g -s%@INTLLIBS@%$INTLLIBS%g -s%@INTLOBJS@%$INTLOBJS%g -s%@POFILES@%$POFILES%g -s%@POSUB@%$POSUB%g -s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g -s%@GT_NO@%$GT_NO%g -s%@GT_YES@%$GT_YES%g -s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g -s%@l@%$l%g -s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g -s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g -s%@MAINT@%$MAINT%g -s%@LIBM@%$LIBM%g +{ + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@CYGPATH_W@,$CYGPATH_W,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@AMTAR@,$AMTAR,;t t +s,@install_sh@,$install_sh,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t +s,@mkdir_p@,$mkdir_p,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@am__leading_dot@,$am__leading_dot,;t t +s,@DEPDIR@,$DEPDIR,;t t +s,@am__include@,$am__include,;t t +s,@am__quote@,$am__quote,;t t +s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t +s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t +s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t +s,@CCDEPMODE@,$CCDEPMODE,;t t +s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t +s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t +s,@LN_S@,$LN_S,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@WARN_CFLAGS@,$WARN_CFLAGS,;t t +s,@GDBINIT@,$GDBINIT,;t t +s,@cgen_cpu_prefix@,$cgen_cpu_prefix,;t t +s,@extra_objects@,$extra_objects,;t t +s,@target_cpu_type@,$target_cpu_type,;t t +s,@obj_format@,$obj_format,;t t +s,@te_file@,$te_file,;t t +s,@install_tooldir@,$install_tooldir,;t t +s,@atof@,$atof,;t t +s,@BFDLIB@,$BFDLIB,;t t +s,@OPCODES_LIB@,$OPCODES_LIB,;t t +s,@BFDVER_H@,$BFDVER_H,;t t +s,@ALL_OBJ_DEPS@,$ALL_OBJ_DEPS,;t t +s,@YACC@,$YACC,;t t +s,@LEX@,$LEX,;t t +s,@LEXLIB@,$LEXLIB,;t t +s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@ALLOCA@,$ALLOCA,;t t +s,@USE_NLS@,$USE_NLS,;t t +s,@MSGFMT@,$MSGFMT,;t t +s,@GMSGFMT@,$GMSGFMT,;t t +s,@XGETTEXT@,$XGETTEXT,;t t +s,@USE_INCLUDED_LIBINTL@,$USE_INCLUDED_LIBINTL,;t t +s,@CATALOGS@,$CATALOGS,;t t +s,@CATOBJEXT@,$CATOBJEXT,;t t +s,@DATADIRNAME@,$DATADIRNAME,;t t +s,@GMOFILES@,$GMOFILES,;t t +s,@INSTOBJEXT@,$INSTOBJEXT,;t t +s,@INTLDEPS@,$INTLDEPS,;t t +s,@INTLLIBS@,$INTLLIBS,;t t +s,@INTLOBJS@,$INTLOBJS,;t t +s,@POFILES@,$POFILES,;t t +s,@POSUB@,$POSUB,;t t +s,@INCLUDE_LOCALE_H@,$INCLUDE_LOCALE_H,;t t +s,@GT_NO@,$GT_NO,;t t +s,@GT_YES@,$GT_YES,;t t +s,@MKINSTALLDIRS@,$MKINSTALLDIRS,;t t +s,@l@,$l,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +s,@LIBM@,$LIBM,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF -EOF -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" else - ac_dir_suffix= ac_dots= - fi + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; - esac - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' -ac_dC='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. And first: -# Protect against being on the right side of a sed subst in config.status. -# Protect against being in an unquoted here document in config.status. -rm -f conftest.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >> conftest.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF - -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail -while : +while grep . conftest.undefs >/dev/null do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file fi - rm -f $ac_file - mv conftest.h $ac_file + else + cat $tmp/config.h + rm -f $tmp/config.h fi -fi; done +# Compute $ac_file's index in $config_headers. +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $ac_file | $ac_file:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null || +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X$ac_file : 'X\(//\)[^/]' \| \ + X$ac_file : 'X\(//\)$' \| \ + X$ac_file : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X$ac_file | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'`/stamp-h$_am_stamp_count +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -EOF -cat >> $CONFIG_STATUS </dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } -target_cpu_type=${target_cpu_type} - cgen_cpu_prefix=${cgen_cpu_prefix} - obj_format=${obj_format} - te_file=${te_file} -EOF -cat >> $CONFIG_STATUS <<\EOF -test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h -rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # So let's grep whole file. + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then + dirpart=`(dirname "$mf") 2>/dev/null || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + else + continue + fi + grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue + # Extract the definition of DEP_FILES from the Makefile without + # running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR" + # We invoke sed twice because it is the simplest approach to + # changing $(DEPDIR) to its actual value in the expansion. + for file in `sed -n ' + /^DEP_FILES = .*\\\\$/ { + s/^DEP_FILES = // + :loop + s/\\\\$// + p + n + /\\\\$/ b loop + p + } + /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`(dirname "$file") 2>/dev/null || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p $dirpart/$fdir + else + as_dir=$dirpart/$fdir + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5 +echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;} + { (exit 1); exit 1; }; }; } + + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + default ) rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h echo '#include "obj-'"${obj_format}"'.h"' > obj-format.h echo '#include "te-'"${te_file}"'.h"' > targ-env.h @@ -6663,10 +12326,37 @@ rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itb echo '#include "opcodes/'"${cgen_cpu_prefix}"'-desc.h"' > cgen-desc.h fi - sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile -exit 0 -EOF + sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi diff --git a/contrib/binutils/gas/configure.in b/contrib/binutils/gas/configure.in index d83516d..f7d0acb 100644 --- a/contrib/binutils/gas/configure.in +++ b/contrib/binutils/gas/configure.in @@ -5,9 +5,13 @@ dnl brackets, be sure changequote invocations surround it. dnl dnl dnl v2.5 needed for --bindir et al -AC_PREREQ(2.13) +AC_PREREQ(2.57) AC_INIT(as.h) +dnl Autoconf 2.57 will find the aux dir without this. However, unless +dnl we specify this explicitly, automake-1.7 will assume that ylwrap is in +dnl gas/ instead of gas/../. +AC_CONFIG_AUX_DIR(..) AC_CANONICAL_SYSTEM AC_ISC_POSIX @@ -70,10 +74,14 @@ AM_CONFIG_HEADER(config.h:config.in) # If we are on a DOS filesystem, we must use gdb.ini rather than # .gdbinit. -GDBINIT=".gdbinit" case "${host}" in - *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows*) + *-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-windows*) GDBINIT="gdb.ini" + AC_CONFIG_FILES(gdb.ini:gdbinit.in) + ;; + *) + GDBINIT=".gdbinit" + AC_CONFIG_FILES(.gdbinit:gdbinit.in) ;; esac AC_SUBST(GDBINIT) @@ -114,14 +122,18 @@ changequote([,])dnl arch= endian= case ${cpu} in + am33_2.0) cpu_type=mn10300 endian=little ;; alpha*) cpu_type=alpha ;; arm*b|xscale*b|strongarm*b) cpu_type=arm endian=big ;; arm*|xscale*|strongarm*) cpu_type=arm endian=little ;; + c4x*) cpu_type=tic4x ;; hppa*) cpu_type=hppa ;; changequote(,)dnl - i[3456]86) cpu_type=i386 arch=i386;; + i[3-7]86) cpu_type=i386 arch=i386;; x86_64) cpu_type=i386 arch=x86_64;; ia64) cpu_type=ia64 ;; + ip2k) cpu_type=ip2k endian=big ;; + iq2000) cpu_type=iq2000 endian=big ;; m6811|m6812|m68hc12) cpu_type=m68hc11 ;; m680[012346]0) cpu_type=m68k ;; changequote([,])dnl @@ -151,6 +163,9 @@ changequote([,])dnl sparc86x*) cpu_type=sparc arch=sparc86x ;; sparc*) cpu_type=sparc arch=sparclite ;; # ??? See tc-sparc.c. v850*) cpu_type=v850 ;; + xtensa*) cpu_type=xtensa arch=xtensa ;; + m32r) cpu_type=m32r target_cpu=m32r endian=big ;; + m32rle) cpu_type=m32r target_cpu=m32r endian=little ;; *) cpu_type=${cpu} ;; esac @@ -167,348 +182,347 @@ changequote([,])dnl # assign object format case ${generic_target} in - a29k-*-coff) fmt=coff ;; - a29k-amd-udi) fmt=coff ;; - a29k-amd-ebmon) fmt=coff ;; - a29k-nyu-sym1) fmt=coff ;; - a29k-*-rtems*) fmt=coff ;; - a29k-*-vxworks*) fmt=coff ;; - - alpha*-*-*vms*) fmt=evax ;; - alpha*-*-netware*) fmt=ecoff ;; - alpha*-*-osf*) fmt=ecoff ;; - alpha*-*-linuxecoff*) fmt=ecoff ;; - alpha*-*-linux-gnu*) fmt=elf em=linux ;; - alpha*-*-netbsd*) fmt=elf em=nbsd ;; - alpha*-*-openbsd*) fmt=elf em=obsd ;; - - arc-*-elf*) fmt=elf bfd_gas=yes ;; - - arm-*-aout) fmt=aout ;; - arm-*-coff | thumb-*-coff) fmt=coff ;; - arm-*-rtems | thumb-*-rtems) fmt=elf ;; - arm-*-elf | thumb-*-elf) fmt=elf ;; + a29k-*-coff) fmt=coff ;; + a29k-amd-udi) fmt=coff ;; + a29k-amd-ebmon) fmt=coff ;; + a29k-nyu-sym1) fmt=coff ;; + a29k-*-rtems*) fmt=coff ;; + a29k-*-vxworks*) fmt=coff ;; + + alpha*-*-*vms*) fmt=evax ;; + alpha*-*-netware*) fmt=ecoff ;; + alpha*-*-osf*) fmt=ecoff ;; + alpha*-*-linuxecoff*) fmt=ecoff ;; + alpha*-*-linux-gnu*) fmt=elf em=linux ;; + alpha*-*-netbsd*) fmt=elf em=nbsd ;; + alpha*-*-openbsd*) fmt=elf em=obsd ;; + + # cpu_type for am33_2.0 is set to mn10300 + mn10300-*-linux*) fmt=elf bfd_gas=yes em=linux ;; + + arc-*-elf*) fmt=elf ;; + + arm-*-aout) fmt=aout ;; + arm-*-coff | thumb-*-coff) fmt=coff ;; + arm-*-rtems* | thumb-*-rtems*) fmt=elf ;; + arm-*-elf | thumb-*-elf) fmt=elf ;; + arm-*-kaos*) fmt=elf ;; arm*-*-conix*) fmt=elf ;; - arm-*-linux*aout*) fmt=aout em=linux ;; - arm*-*-linux-gnu* | arm*-*-uclinux*) - fmt=elf em=linux ;; + arm-*-linux*aout*) fmt=aout em=linux ;; + arm*-*-linux-gnu*) fmt=elf em=linux ;; + arm*-*-uclinux*) fmt=elf em=linux ;; arm-*-netbsdelf*) fmt=elf em=nbsd ;; - arm-*-netbsd* | arm-*-openbsd*) fmt=aout em=nbsd ;; - arm-*-oabi | thumb-*-oabi) fmt=elf ;; - arm-epoc-pe | thumb-epoc-pe) fmt=coff em=epoc-pe ;; - arm-*-wince) fmt=coff em=wince-pe ;; - arm-*-pe | thumb-*-pe) fmt=coff em=pe ;; - arm-*-riscix*) fmt=aout em=riscix ;; - arm-*-vxworks) fmt=coff ;; - - avr-*-*) fmt=elf bfd_gas=yes ;; - - cris-*-*) fmt=multi bfd_gas=yes ;; - - d10v-*-*) fmt=elf bfd_gas=yes ;; - d30v-*-*) fmt=elf bfd_gas=yes ;; - dlx-*-*) fmt=elf ;; - - - fr30-*-*) fmt=elf bfd_gas=yes ;; - frv-*-*) fmt=elf bfd_gas=yes ;; - - hppa-*-linux-gnu*) case ${cpu} in - hppa*64*) - fmt=elf em=hppalinux64;; - hppa*) - fmt=elf em=linux;; - esac ;; - hppa-*-*elf*) fmt=elf em=hppa ;; - hppa-*-lites*) fmt=elf em=hppa ;; - hppa-*-netbsd*) fmt=elf em=nbsd ;; - hppa-*-openbsd*) fmt=elf em=hppa ;; - hppa-*-osf*) fmt=som em=hppa ;; - hppa-*-rtems*) fmt=elf em=hppa ;; - hppa-*-hpux11*) case ${cpu} in - hppa*64*) - fmt=elf em=hppa64 ;; - hppa*) - fmt=som em=hppa ;; - esac ;; - hppa-*-hpux*) fmt=som em=hppa ;; - hppa-*-mpeix*) fmt=som em=hppa ;; - hppa-*-bsd*) fmt=som em=hppa ;; - hppa-*-hiux*) fmt=som em=hppa ;; - - h8300-*-rtems*) fmt=coff ;; - h8300-*-coff) fmt=coff ;; - h8300-*-elf) fmt=elf ;; - h8500-*-rtems*) fmt=coff ;; - h8500-*-coff) fmt=coff ;; - - i370-*-elf* | i370-*-linux*) fmt=elf ;; - i386-ibm-aix*) fmt=coff em=i386aix ;; - i386-sequent-bsd*) fmt=aout em=dynix bfd_gas=yes ;; - i386-*-beospe*) fmt=coff em=pe bfd_gas=yes ;; - i386-*-beoself* | i386-*-beos*) fmt=elf bfd_gas=yes ;; - i386-*-bsd*) fmt=aout em=386bsd ;; - i386-*-netbsd0.8) fmt=aout em=386bsd ;; - i386-*-netbsdpe*) fmt=coff em=pe bfd_gas=yes ;; - i386-*-netbsd*) em=nbsd bfd_gas=yes - case ${cpu} in - x86_64) fmt=elf ;; - *) case ${os} in - *elf*) fmt=elf ;; - *) fmt=aout ;; - esac - ;; - esac - ;; - i386-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes;; - i386-*-linux*aout* | i386-*-linux*oldld) fmt=aout em=linux ;; - i386-*-linux*coff*) fmt=coff em=linux ;; - i386-*-linux-gnu*) fmt=elf em=linux bfd_gas=yes ;; - x86_64-*-linux-gnu*) fmt=elf em=linux bfd_gas=yes ;; - i386-*-lynxos*) fmt=coff em=lynx ;; + arm-*-*n*bsd*) fmt=aout em=nbsd ;; + arm-**-nto*) fmt=elf ;; + arm-*-oabi | thumb-*-oabi) fmt=elf ;; + arm-epoc-pe | thumb-epoc-pe) fmt=coff em=epoc-pe ;; + arm-wince-pe | arm-*-wince) fmt=coff em=wince-pe ;; + arm-*-pe | thumb-*-pe) fmt=coff em=pe ;; + arm-*-riscix*) fmt=aout em=riscix ;; + + avr-*-*) fmt=elf ;; + + cris-*-linux-gnu*) fmt=multi bfd_gas=yes em=linux ;; + cris-*-*) fmt=multi bfd_gas=yes ;; + + d10v-*-*) fmt=elf ;; + d30v-*-*) fmt=elf ;; + dlx-*-*) fmt=elf ;; + + fr30-*-*) fmt=elf ;; + frv-*-*linux*) fmt=elf em=linux;; + frv-*-*) fmt=elf ;; + + hppa-*-linux*) case ${cpu} in + hppa*64*) fmt=elf em=hppalinux64;; + hppa*) fmt=elf em=linux;; + esac ;; + hppa-*-*elf*) fmt=elf em=hppa ;; + hppa-*-lites*) fmt=elf em=hppa ;; + hppa-*-netbsd*) fmt=elf em=nbsd ;; + hppa-*-openbsd*) fmt=elf em=hppa ;; + hppa-*-osf*) fmt=som em=hppa ;; + hppa-*-rtems*) fmt=elf em=hppa ;; + hppa-*-hpux11*) case ${cpu} in + hppa*64*) fmt=elf em=hppa64 ;; + hppa*) fmt=som em=hppa ;; + esac ;; + hppa-*-hpux*) fmt=som em=hppa ;; + hppa-*-mpeix*) fmt=som em=hppa ;; + hppa-*-bsd*) fmt=som em=hppa ;; + hppa-*-hiux*) fmt=som em=hppa ;; + + h8300-*-rtems*) fmt=coff ;; + h8300-*-coff) fmt=coff ;; + h8300-*-elf) fmt=elf ;; + h8500-*-rtems*) fmt=coff ;; + h8500-*-coff) fmt=coff ;; + + i370-*-elf* | i370-*-linux*) fmt=elf ;; + i386-ibm-aix*) fmt=coff em=i386aix ;; + i386-sequent-bsd*) fmt=aout em=dynix ;; + i386-*-beospe*) fmt=coff em=pe ;; + i386-*-beos*) fmt=elf ;; + i386-*-coff) fmt=coff ;; + i386-*-elf) fmt=elf ;; + i386-*-kaos*) fmt=elf ;; + i386-*-bsd*) fmt=aout em=386bsd ;; + i386-*-netbsd0.8) fmt=aout em=386bsd ;; + i386-*-netbsdpe*) fmt=coff em=pe ;; + i386-*-netbsd*-gnu* | \ + i386-*-knetbsd*-gnu | \ + i386-*-netbsdelf*) fmt=elf em=nbsd ;; + i386-*-*n*bsd*) case ${cpu} in + x86_64) fmt=elf em=nbsd ;; + *) fmt=aout em=nbsd ;; + esac ;; + i386-*-linux*aout*) fmt=aout em=linux ;; + i386-*-linux*oldld) fmt=aout em=linux ;; + i386-*-linux*coff*) fmt=coff em=linux ;; + i386-*-linux-gnu*) fmt=elf em=linux ;; + x86_64-*-linux-gnu*) fmt=elf em=linux ;; + i386-*-lynxos*) fmt=coff em=lynx ;; changequote(,)dnl - i386-*-sysv[45]* | i386-*-solaris* | i386-*-elf) - fmt=elf bfd_gas=yes ;; - i386-*-freebsdaout* | i386-*-freebsd[12].* | i386-*-freebsd[12]) - fmt=aout em=386bsd ;; + i386-*-sysv[45]*) fmt=elf ;; + i386-*-solaris*) fmt=elf ;; + i386-*-freebsdaout*) fmt=aout em=386bsd ;; + i386-*-freebsd[12].*) fmt=aout em=386bsd ;; + i386-*-freebsd[12]) fmt=aout em=386bsd ;; changequote([,])dnl - i386-*-coff | i386-*-sysv* | i386-*-sco3.2v5*coff | i386-*-isc*) - fmt=coff ;; - i386-*-sco3.2v5*) fmt=elf - if test ${this_target} = $target; then - AC_DEFINE(SCO_ELF, 1, - [Define if defaulting to ELF on SCO 5.]) - fi - ;; - i386-*-sco3.2*) fmt=coff ;; - i386-*-vsta) fmt=aout ;; - i386-*-msdosdjgpp* | i386-*-go32* | i386-go32-rtems*) - fmt=coff em=go32 bfd_gas=yes - AC_DEFINE(STRICTCOFF, 1, [Using strict COFF?]) - ;; - i386-*-rtemself*) fmt=elf ;; - i386-*-rtemscoff*) fmt=coff ;; - i386-*-rtems*) fmt=elf ;; - i386-*-gnu*) fmt=elf ;; - i386-*-mach*) - fmt=aout em=mach bfd_gas=yes ;; - i386-*-msdos*) fmt=aout ;; - i386-*-moss*) fmt=elf ;; - i386-*-pe) fmt=coff em=pe bfd_gas=yes ;; - i386-*-cygwin*) fmt=coff em=pe bfd_gas=yes ;; - i386-*-interix*) fmt=coff em=interix bfd_gas=yes ;; - i386-*-mingw32*) fmt=coff em=pe bfd_gas=yes ;; - i386-*-nto-qnx*) fmt=elf ;; - i386-*-*nt*) fmt=coff em=pe bfd_gas=yes ;; - i386-*-vxworks*) fmt=aout ;; - i386-*-chaos) fmt=elf ;; - i860-stardent-sysv4* | i860-stardent-elf*) - fmt=elf bfd_gas=yes endian=little - AC_MSG_WARN(GAS support for ${generic_target} is preliminary and a work in progress) ;; - i960-*-bout) fmt=bout ;; - i960-*-coff) fmt=coff em=ic960 ;; - i960-*-rtems*) fmt=coff em=ic960 ;; - i960-*-nindy*) fmt=bout ;; - i960-*-vxworks4*) fmt=bout ;; - i960-*-vxworks5.0) fmt=bout ;; - i960-*-vxworks5.*) fmt=coff em=ic960 ;; - i960-*-vxworks*) fmt=bout ;; - i960-*-elf*) fmt=elf ;; - - ia64-*-elf*) fmt=elf ;; - ia64-*-aix*) fmt=elf em=ia64aix ;; - ia64-*-linux-gnu*) fmt=elf em=linux ;; - ia64-*-hpux*) fmt=elf em=hpux ;; - ia64-*-netbsd*) fmt=elf em=nbsd ;; - - m32r-*-*) fmt=elf bfd_gas=yes ;; - - m68hc11-*-*|m6811-*-*|m68hc12-*-*|m6812-*-*)fmt=elf bfd_gas=yes ;; - - m68k-*-vxworks* | m68k-ericsson-ose | m68k-*-sunos*) - fmt=aout em=sun3 ;; - m68k-motorola-sysv*) fmt=coff em=delta ;; - m68k-bull-sysv3*) fmt=coff em=dpx2 ;; - m68k-apollo-*) fmt=coff em=apollo ;; - m68k-*-sysv4*) # must be before -sysv* - fmt=elf em=svr4 ;; - m68k-*-elf*) fmt=elf ;; - m68k-*-coff | m68k-*-sysv* | m68k-*-rtemscoff*) - fmt=coff ;; - m68k-*-rtems*) fmt=elf ;; - m68k-*-hpux*) fmt=hp300 em=hp300 ;; - m68k-*-linux*aout*) fmt=aout em=linux ;; - m68k-*-linux-gnu*) fmt=elf em=linux ;; - m68k-*-gnu*) fmt=elf ;; - m68k-*-lynxos*) fmt=coff em=lynx ;; - m68k-*-netbsdelf*) fmt=elf em=nbsd bfd_gas=yes ;; - m68k-*-netbsdaout* | m68k-*-netbsd*) - fmt=aout em=nbsd bfd_gas=yes ;; - m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;; - m68k-apple-aux*) fmt=coff em=aux ;; - m68k-*-psos*) fmt=elf em=psos;; - - m88k-motorola-sysv3*) fmt=coff em=delt88 ;; - m88k-*-coff*) fmt=coff ;; - - mcore-*-elf) fmt=elf bfd_gas=yes ;; - mcore-*-pe) fmt=coff em=pe bfd_gas=yes ;; + i386-*-freebsd* | i386-*-kfreebsd*-gnu) + fmt=elf em=freebsd ;; + i386-*-sysv*) fmt=coff ;; + i386-*-sco3.2v5*coff) fmt=coff ;; + i386-*-isc*) fmt=coff ;; + i386-*-sco3.2v5*) fmt=elf + if test ${this_target} = $target; then + AC_DEFINE(SCO_ELF, 1, [Define if defaulting to ELF on SCO 5.]) + fi ;; + i386-*-sco3.2*) fmt=coff ;; + i386-*-vsta) fmt=aout ;; + i386-*-msdosdjgpp* \ + | i386-*-go32* \ + | i386-go32-rtems*) fmt=coff em=go32 + AC_DEFINE(STRICTCOFF, 1, [Using strict COFF?]) ;; + i386-*-rtemself*) fmt=elf ;; + i386-*-rtemscoff*) fmt=coff ;; + i386-*-rtems*) fmt=elf ;; + i386-*-gnu*) fmt=elf ;; + i386-*-mach*) fmt=aout em=mach ;; + i386-*-msdos*) fmt=aout ;; + i386-*-moss*) fmt=elf ;; + i386-*-pe) fmt=coff em=pe ;; + i386-*-cygwin*) fmt=coff em=pe ;; + i386-*-interix*) fmt=coff em=interix ;; + i386-*-mingw32*) fmt=coff em=pe ;; + i386-*-nto-qnx*) fmt=elf ;; + i386-*-*nt*) fmt=coff em=pe ;; + i386-*-chaos) fmt=elf ;; + + i860-*-*) fmt=elf endian=little + AC_MSG_WARN(GAS support for ${generic_target} is preliminary and a work in progress) ;; + i960-*-bout) fmt=bout ;; + i960-*-coff) fmt=coff em=ic960 ;; + i960-*-rtems*) fmt=coff em=ic960 ;; + i960-*-nindy*) fmt=bout ;; + i960-*-vxworks5.0) fmt=bout ;; + i960-*-vxworks5.*) fmt=coff em=ic960 ;; + i960-*-vxworks*) fmt=bout ;; + i960-*-elf*) fmt=elf ;; + + ia64-*-elf*) fmt=elf ;; + ia64-*-aix*) fmt=elf em=ia64aix ;; + ia64-*-linux-gnu*) fmt=elf em=linux ;; + ia64-*-hpux*) fmt=elf em=hpux ;; + ia64-*-netbsd*) fmt=elf em=nbsd ;; + + ip2k-*-*) fmt=elf ;; + + iq2000-*-elf) fmt=elf bfd_gas=yes ;; + + m32r-*-elf*) fmt=elf ;; + m32r-*-linux*) fmt=elf em=linux;; + + m68hc11-*-* | m6811-*-*) fmt=elf ;; + m68hc12-*-* | m6812-*-*) fmt=elf ;; + + m68k-*-vxworks*) fmt=aout em=sun3 ;; + m68k-ericsson-ose) fmt=aout em=sun3 ;; + m68k-*-sunos*) fmt=aout em=sun3 ;; + m68k-motorola-sysv*) fmt=coff em=delta ;; + m68k-bull-sysv3*) fmt=coff em=dpx2 ;; + m68k-apollo-*) fmt=coff em=apollo ;; + m68k-*-elf*) fmt=elf ;; + m68k-*-sysv4*) fmt=elf em=svr4 ;; + m68k-*-sysv*) fmt=coff ;; + m68k-*-coff | m68k-*-rtemscoff*) fmt=coff ;; + m68k-*-rtems*) fmt=elf ;; + m68k-*-hpux*) fmt=hp300 em=hp300 ;; + m68k-*-linux*aout*) fmt=aout em=linux ;; + m68k-*-linux-gnu*) fmt=elf em=linux ;; + m68k-*-uclinux*) fmt=elf ;; + m68k-*-gnu*) fmt=elf ;; + m68k-*-lynxos*) fmt=coff em=lynx ;; + m68k-*-netbsdelf*) fmt=elf em=nbsd ;; + m68k-*-netbsd*) fmt=aout em=nbsd bfd_gas=yes ;; + m68k-*-openbsd*) fmt=aout em=nbsd bfd_gas=yes ;; + m68k-apple-aux*) fmt=coff em=aux ;; + m68k-*-psos*) fmt=elf em=psos;; + + m88k-motorola-sysv3*) fmt=coff em=delt88 ;; + m88k-*-coff*) fmt=coff ;; + + mcore-*-elf) fmt=elf ;; + mcore-*-pe) fmt=coff em=pe bfd_gas=yes ;; # don't change em like *-*-bsd does - mips-dec-openbsd*) fmt=elf endian=little ;; - mips-dec-bsd*) fmt=aout endian=little ;; - mips-sony-bsd*) fmt=ecoff ;; - mips-*-bsd*) AC_MSG_ERROR(Unknown vendor for mips-bsd configuration.) ;; - mips-*-ultrix*) fmt=ecoff endian=little ;; - mips-*-osf*) fmt=ecoff endian=little ;; - mips-*-ecoff*) fmt=ecoff ;; - mips-*-pe*) fmt=coff endian=little em=pe ;; - mips-*-irix6*) fmt=elf ;; - mips-*-irix5*) fmt=elf ;; - mips-*-irix*) fmt=ecoff ;; - mips-*-lnews*) fmt=ecoff em=lnews ;; - mips-*-riscos*) fmt=ecoff ;; - mips*-*-linux*) fmt=elf em=tmips ;; - mips-*-sysv4*MP* | mips-*-gnu*) - fmt=elf em=tmips ;; - mips-*-sysv*) fmt=ecoff ;; - mips-*-elf* | mips-*-rtems* | mips-*-netbsd* | mips-*-openbsd*) - fmt=elf ;; - mips-*-vxworks*) fmt=elf ;; - mmix-*-*) fmt=elf bfd_gas=yes ;; - mn10200-*-*) fmt=elf bfd_gas=yes ;; - mn10300-*-*) fmt=elf bfd_gas=yes ;; - openrisc-*-*) fmt=elf bfd_gas=yes ;; - or32-*-rtems*) fmt=coff ;; - or32-*-coff) fmt=coff ;; - or32-*-elf) fmt=elf ;; - pj*) fmt=elf ;; - ppc-*-pe | ppc-*-cygwin* | ppc-*-winnt*) - fmt=coff em=pe ;; - ppc-*-aix5*) fmt=coff em=aix5 ;; - ppc-*-aix*) fmt=coff ;; - ppc-*-beos*) fmt=coff ;; - ppc-*-*bsd* | ppc-*-elf* | ppc-*-eabi* | ppc-*-sysv4*) - fmt=elf ;; - ppc-*-linux-gnu*) fmt=elf - case "$endian" in - big) ;; - *) AC_MSG_ERROR(GNU/Linux must be configured big endian) ;; - esac - ;; - ppc-*-solaris*) fmt=elf - if test ${this_target} = $target; then - AC_DEFINE(TARGET_SOLARIS_COMMENT, 1, - [Define if default target is PowerPC Solaris.]) - fi - if test x${endian} = xbig; then - AC_MSG_ERROR(Solaris must be configured little endian) - fi - ;; - ppc-*-rtems*) fmt=elf ;; - ppc-*-macos* | ppc-*-mpw*) - fmt=coff em=macos ;; - ppc-*-netware*) fmt=elf em=ppcnw ;; - ppc-*-vxworks*) fmt=elf ;; - ppc-*-windiss*) fmt=elf ;; - - s390x-*-linux-gnu*) fmt=elf em=linux ;; - s390-*-linux-gnu*) fmt=elf em=linux ;; - - sh*-*-linux*) fmt=elf em=linux - case ${cpu} in - sh*eb) - endian=big ;; - sh*) - endian=little ;; - esac ;; - sh5*-*-netbsd*) fmt=elf em=nbsd ;; - sh64*-*-netbsd*) fmt=elf em=nbsd ;; - sh*-*-netbsdelf*) fmt=elf em=nbsd ;; - sh-*-elf*) fmt=elf ;; - sh-*-coff*) fmt=coff ;; - sh-*-pe*) fmt=coff em=pe bfd_gas=yes endian=little ;; - sh-*-rtemself*) fmt=elf ;; - sh-*-rtems*) fmt=coff ;; - - sh64-*-elf*) fmt=elf ;; - ns32k-pc532-mach* | ns32k-pc532-ux*) fmt=aout em=pc532mach ;; - ns32k-*-netbsd* | ns32k-pc532-lites*) fmt=aout em=nbsd532 ;; - ns32k-pc532-openbsd*) fmt=aout em=nbsd532 ;; - - sparc-*-rtemsaout*) fmt=aout ;; - sparc-*-rtemself*) fmt=elf ;; - sparc-*-rtems*) fmt=elf ;; - sparc-*-sunos4*) fmt=aout em=sun3 ;; - sparc-*-aout | sparc*-*-vxworks*) - fmt=aout em=sparcaout ;; - sparc-*-coff) fmt=coff ;; - sparc-*-linux*aout*) fmt=aout em=linux ;; - sparc-*-linux-gnu*) fmt=elf em=linux ;; - sparc-*-lynxos*) fmt=coff em=lynx ;; - sparc-fujitsu-none) fmt=aout ;; - sparc-*-elf | sparc-*-sysv4* | sparc-*-solaris*) - fmt=elf ;; - sparc-*-netbsd*) em=nbsd bfd_gas=yes - case ${cpu} in - sparc) case ${os} in - *elf*) fmt=elf ;; - *) fmt=aout ;; - esac ;; - sparc64) fmt=elf ;; - esac - ;; - sparc-*-openbsd*) em=nbsd - case ${cpu} in - sparc) fmt=aout ;; - sparc64) fmt=elf ;; - esac - ;; - - strongarm-*-coff) fmt=coff ;; - strongarm-*-elf) fmt=elf ;; - xscale-*-coff) fmt=coff ;; - xscale-*-elf) fmt=elf ;; - - tic30-*-*aout*) fmt=aout bfd_gas=yes ;; - tic30-*-*coff*) fmt=coff bfd_gas=yes ;; - tic54x-*-* | c54x*-*-*) - fmt=coff bfd_gas=yes need_libm=yes;; - tic80-*-*) fmt=coff ;; - - v850-*-*) fmt=elf bfd_gas=yes ;; - v850e-*-*) fmt=elf bfd_gas=yes ;; - v850ea-*-*) fmt=elf bfd_gas=yes ;; - - vax-*-netbsdelf*) fmt=elf em=nbsd bfd_gas=yes ;; - vax-*-netbsdaout* | vax-*-netbsd*) - fmt=aout em=nbsd ;; - vax-*-bsd* | vax-*-ultrix*) - fmt=aout ;; - vax-*-vms) fmt=vms ;; - - w65-*-*) fmt=coff ;; - - xstormy16-*-*) fmt=elf bfd_gas=yes ;; - - z8k-*-coff | z8k-*-sim) - fmt=coff ;; - - *-*-aout | *-*-scout) - fmt=aout ;; - *-*-freebsd*) fmt=elf em=freebsd bfd_gas=yes ;; - *-*-nindy*) - fmt=bout ;; - *-*-bsd*) - fmt=aout em=sun3 ;; - *-*-generic) fmt=generic ;; - *-*-xray | *-*-hms) fmt=coff ;; - *-*-sim) fmt=coff ;; - *-*-elf | *-*-sysv4* | *-*-solaris*) - AC_MSG_WARN(GAS support for ${generic_target} is incomplete.) - fmt=elf dev=yes ;; - *-*-vxworks) fmt=aout ;; - *-*-netware) fmt=elf ;; + mips-dec-openbsd*) fmt=elf endian=little ;; + mips-sony-bsd*) fmt=ecoff ;; + mips-*-bsd*) + AC_MSG_ERROR(Unknown vendor for mips-bsd configuration.) ;; + mips-*-ultrix*) fmt=ecoff endian=little ;; + mips-*-osf*) fmt=ecoff endian=little ;; + mips-*-ecoff*) fmt=ecoff ;; + mips-*-pe*) fmt=coff endian=little em=pe ;; + mips-*-irix6*) fmt=elf em=irix ;; + mips-*-irix5*) fmt=elf em=irix ;; + mips-*-irix*) fmt=ecoff em=irix ;; + mips-*-lnews*) fmt=ecoff em=lnews ;; + mips-*-riscos*) fmt=ecoff ;; + mips*-*-linux*) fmt=elf em=tmips ;; + mips-*-sysv4*MP* | mips-*-gnu*) fmt=elf em=tmips ;; + mips-*-sysv*) fmt=ecoff ;; + mips-*-elf* | mips-*-rtems*) fmt=elf ;; + mips-*-netbsd*) fmt=elf ;; + mips-*-openbsd*) fmt=elf ;; + + mmix-*-*) fmt=elf ;; + mn10200-*-*) fmt=elf ;; + mn10300-*-*) fmt=elf ;; + msp430-*-*) fmt=elf ;; + openrisc-*-*) fmt=elf ;; + or32-*-rtems*) fmt=elf ;; + or32-*-coff) fmt=coff ;; + or32-*-elf) fmt=elf ;; + pj*) fmt=elf ;; + + ppc-*-pe | ppc-*-cygwin*) fmt=coff em=pe ;; + ppc-*-winnt*) fmt=coff em=pe ;; +changequote(,)dnl + ppc-*-aix5.[01]) fmt=coff em=aix5 ;; +changequote([,])dnl + ppc-*-aix5.*) fmt=coff em=aix5 + AC_DEFINE(AIX_WEAK_SUPPORT, 1, + [Define if using AIX 5.2 value for C_WEAKEXT.]) + ;; + ppc-*-aix*) fmt=coff ;; + ppc-*-beos*) fmt=coff ;; + ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;; + ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;; + ppc-*-linux-gnu*) fmt=elf em=linux + case "$endian" in + big) ;; + *) AC_MSG_ERROR(GNU/Linux must be configured big endian) ;; + esac ;; + ppc-*-solaris*) fmt=elf + if test ${this_target} = $target; then + AC_DEFINE(TARGET_SOLARIS_COMMENT, 1, + [Define if default target is PowerPC Solaris.]) + fi + if test x${endian} = xbig; then + AC_MSG_ERROR(Solaris must be configured little endian) + fi ;; + ppc-*-rtems*) fmt=elf ;; + ppc-*-macos* | ppc-*-mpw*) fmt=coff em=macos ;; + ppc-*-netware*) fmt=elf em=ppcnw ;; + ppc-**-nto*) fmt=elf ;; + ppc-*-kaos*) fmt=elf ;; + + s390x-*-linux-gnu*) fmt=elf em=linux ;; + s390-*-linux-gnu*) fmt=elf em=linux ;; + + sh*-*-linux*) fmt=elf em=linux + case ${cpu} in + sh*eb) endian=big ;; + *) endian=little ;; + esac ;; + sh5*-*-netbsd*) fmt=elf em=nbsd ;; + sh64*-*-netbsd*) fmt=elf em=nbsd ;; + sh*-*-netbsdelf*) fmt=elf em=nbsd ;; + sh-*-elf*) fmt=elf ;; + sh-*-coff*) fmt=coff ;; + sh-*-nto*) fmt=elf ;; + sh-*-pe*) fmt=coff em=pe bfd_gas=yes endian=little ;; + sh-*-rtemscoff*) fmt=coff ;; + sh-*-rtems*) fmt=elf ;; + sh-*-kaos*) fmt=elf ;; + shle*-*-kaos*) fmt=elf ;; + sh64-*-elf*) fmt=elf ;; + + ns32k-pc532-mach*) fmt=aout em=pc532mach ;; + ns32k-pc532-ux*) fmt=aout em=pc532mach ;; + ns32k-pc532-lites*) fmt=aout em=nbsd532 ;; + ns32k-*-*n*bsd*) fmt=aout em=nbsd532 ;; + + sparc-*-rtemsaout*) fmt=aout ;; + sparc-*-rtemself*) fmt=elf ;; + sparc-*-rtems*) fmt=elf ;; + sparc-*-sunos4*) fmt=aout em=sun3 ;; + sparc-*-aout | sparc*-*-vxworks*) fmt=aout em=sparcaout ;; + sparc-*-coff) fmt=coff ;; + sparc-*-linux*aout*) fmt=aout em=linux ;; + sparc-*-linux-gnu*) fmt=elf em=linux ;; + sparc-*-lynxos*) fmt=coff em=lynx ;; + sparc-fujitsu-none) fmt=aout ;; + sparc-*-elf) fmt=elf ;; + sparc-*-sysv4*) fmt=elf ;; + sparc-*-solaris*) fmt=elf ;; + sparc-*-netbsdelf*) fmt=elf em=nbsd ;; + sparc-*-*n*bsd*) case ${cpu} in + sparc64) fmt=elf em=nbsd ;; + *) fmt=aout em=nbsd ;; + esac ;; + strongarm-*-coff) fmt=coff ;; + strongarm-*-elf) fmt=elf ;; + strongarm-*-kaos*) fmt=elf ;; + xscale-*-coff) fmt=coff ;; + xscale-*-elf) fmt=elf ;; + + tic30-*-*aout*) fmt=aout bfd_gas=yes ;; + tic30-*-*coff*) fmt=coff bfd_gas=yes ;; + tic4x-*-* | c4x-*-*) fmt=coff bfd_gas=yes ;; + tic54x-*-* | c54x*-*-*) fmt=coff bfd_gas=yes need_libm=yes;; + tic80-*-*) fmt=coff ;; + + v850-*-*) fmt=elf ;; + v850e-*-*) fmt=elf ;; + v850ea-*-*) fmt=elf ;; + + vax-*-netbsdelf*) fmt=elf em=nbsd ;; + vax-*-netbsd*) fmt=aout em=nbsd ;; + vax-*-bsd* | vax-*-ultrix*) fmt=aout ;; + vax-*-linux-gnu*) fmt=elf em=linux bfd_gas=yes ;; + vax-*-vms) fmt=vms ;; + + w65-*-*) fmt=coff ;; + + xstormy16-*-*) fmt=elf ;; + + xtensa-*-*) fmt=elf ;; + + z8k-*-coff | z8k-*-sim) fmt=coff ;; + + *-*-aout | *-*-scout) fmt=aout ;; + *-*-freebsd* | *-*-kfreebsd*-gnu) fmt=elf em=freebsd ;; + *-*-nindy*) fmt=bout ;; + *-*-bsd*) fmt=aout em=sun3 ;; + *-*-generic) fmt=generic ;; + *-*-xray | *-*-hms) fmt=coff ;; + *-*-sim) fmt=coff ;; + *-*-elf | *-*-sysv4* | *-*-solaris*) fmt=elf dev=yes ;; + *-*-aros*) fmt=elf em=linux bfd_gas=yes ;; + *-*-vxworks | *-*-windiss) fmt=elf ;; + *-*-netware) fmt=elf ;; esac if test ${this_target} = $target ; then @@ -525,30 +539,97 @@ changequote([,])dnl fi case ${cpu_type}-${fmt} in - alpha*-*) bfd_gas=yes ;; - arm-*) bfd_gas=yes ;; - # not yet - # i386-aout) bfd_gas=preferred ;; - ia64*-*) bfd_gas=yes ;; - mips-*) bfd_gas=yes ;; - ns32k-*) bfd_gas=yes ;; - pdp11-*) bfd_gas=yes ;; - ppc-*) bfd_gas=yes ;; - sparc-*) bfd_gas=yes ;; - strongarm-*) bfd_gas=yes ;; - xscale-*) bfd_gas=yes ;; - *-elf) bfd_gas=yes ;; - *-ecoff) bfd_gas=yes ;; - *-som) bfd_gas=yes ;; - #enable bfd for coff and aout to allow testing if a bfd target is - #the primary target, but not for coff or aout as the primary target - i386-coff) if test x${primary_bfd_gas} = xyes; then bfd_gas=yes; fi ;; - i386-aout) if test x${primary_bfd_gas} = xyes; then bfd_gas=yes; fi ;; - *) ;; + alpha*-* | arm-* | i386-* | ia64*-* | mips-* | ns32k-* \ + | pdp11-* | ppc-* | sparc-* | strongarm-* | xscale-* \ + | *-elf | *-ecoff | *-som) + bfd_gas=yes ;; esac # Other random stuff. + case ${cpu_type} in + mips) + # Set mips_cpu to the name of the default CPU. + case ${target_cpu} in + mips | mipsbe | mipseb | mipsle | mipsel | mips64 | mips64el) + mips_cpu=from-abi + ;; + mipsisa32 | mipsisa32el) + mips_cpu=mips32 + ;; + mipsisa32r2 | mipsisa32r2el) + mips_cpu=mips32r2 + ;; + mipsisa64 | mipsisa64el) + mips_cpu=mips64 + ;; + mipsisa64r2 | mipsisa64r2el) + mips_cpu=mips64r2 + ;; + mipstx39 | mipstx39el) + mips_cpu=r3900 + ;; + mips64vr | mips64vrel) + mips_cpu=vr4100 + ;; + mipsisa32r2* | mipsisa64r2*) +changequote(,)dnl + mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..r2//' -e 's/el$//'` +changequote([,])dnl + ;; + mips64* | mipsisa64* | mipsisa32*) +changequote(,)dnl + mips_cpu=`echo $target_cpu | sed -e 's/[a-z]*..//' -e 's/el$//'` +changequote([,])dnl + ;; + *) + AC_ERROR($target_cpu isn't a supported MIPS CPU name) + ;; + esac + # See whether it's appropriate to set E_MIPS_ABI_O32 for o32 + # binaries. It's a GNU extension that some OSes don't understand. + # The value only matters on ELF targets. + case ${target} in + *-*-irix*) + use_e_mips_abi_o32=0 + ;; + *) + use_e_mips_abi_o32=1 + ;; + esac + # Decide whether to generate 32-bit or 64-bit code by default. + # Used to resolve -march=from-abi when an embedded ABI is selected. + case ${target} in + mips64*-*-* | mipsisa64*-*-*) + mips_default_64bit=1 + ;; + *) + mips_default_64bit=0 + ;; + esac + # Decide which ABI to target by default. + case ${target} in + mips64*-linux* | mips-sgi-irix6*) + mips_default_abi=N32_ABI + ;; + mips*-linux*) + mips_default_abi=O32_ABI + ;; + *) + mips_default_abi=NO_ABI + ;; + esac + AC_DEFINE_UNQUOTED(MIPS_CPU_STRING_DEFAULT, "$mips_cpu", + [Default CPU for MIPS targets. ]) + AC_DEFINE_UNQUOTED(USE_E_MIPS_ABI_O32, $use_e_mips_abi_o32, + [Allow use of E_MIPS_ABI_O32 on MIPS targets. ]) + AC_DEFINE_UNQUOTED(MIPS_DEFAULT_64BIT, $mips_default_64bit, + [Generate 64-bit code by default on MIPS targets. ]) + AC_DEFINE_UNQUOTED(MIPS_DEFAULT_ABI, $mips_default_abi, + [Choose a default ABI for MIPS targets. ]) + ;; + esac + # Do we need the opcodes library? case ${cpu_type} in vax | i386 | tic30) @@ -571,7 +652,7 @@ changequote([,])dnl # Any other special object files needed ? case ${cpu_type} in - fr30 | m32r | openrisc) + fr30 | ip2k | iq2000 | m32r | openrisc) using_cgen=yes ;; @@ -612,6 +693,13 @@ changequote([,])dnl using_cgen=yes ;; + xtensa) + echo ${extra_objects} | grep -s "xtensa-relax.o" + if test $? -ne 0 ; then + extra_objects="$extra_objects xtensa-relax.o" + fi + ;; + *) ;; esac @@ -868,6 +956,7 @@ esac case "${need_bfd}" in yes) BFDLIB=../bfd/libbfd.la + BFDVER_H=../bfd/bfdver.h ALL_OBJ_DEPS="$ALL_OBJ_DEPS"' ../bfd/bfd.h $(INCDIR)/symcat.h' ;; esac @@ -875,6 +964,7 @@ esac AC_SUBST(BFDLIB) AC_SUBST(OPCODES_LIB) +AC_SUBST(BFDVER_H) AC_SUBST(ALL_OBJ_DEPS) AC_DEFINE_UNQUOTED(TARGET_ALIAS, "${target_alias}", [Target alias.]) @@ -974,7 +1064,8 @@ dnl the build directory which include the right .h file. Make sure dnl the old symlinks don't exist, so that a reconfigure in an existing dnl directory behaves reasonably. -AC_OUTPUT(Makefile doc/Makefile ${GDBINIT}:gdbinit.in po/Makefile.in:po/Make-in, +AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in) +AC_CONFIG_COMMANDS([default], [rm -f targ-cpu.c targ-cpu.h obj-format.h obj-format.c targ-env.h atof-targ.c itbl-cpu.h echo '#include "tc-'"${target_cpu_type}"'.h"' > targ-cpu.h echo '#include "obj-'"${obj_format}"'.h"' > obj-format.h @@ -989,3 +1080,5 @@ AC_OUTPUT(Makefile doc/Makefile ${GDBINIT}:gdbinit.in po/Makefile.in:po/Make-in, cgen_cpu_prefix=${cgen_cpu_prefix} obj_format=${obj_format} te_file=${te_file}]) + +AC_OUTPUT diff --git a/contrib/binutils/gas/dep-in.sed b/contrib/binutils/gas/dep-in.sed index 4894cea..2e2717c 100644 --- a/contrib/binutils/gas/dep-in.sed +++ b/contrib/binutils/gas/dep-in.sed @@ -11,16 +11,18 @@ s!@SRCDIR@/config!$(srcdir)/config!g s!@SRCDIR@/\.\./opcodes!$(srcdir)/../opcodes!g s!@TOPDIR@/opcodes!$(srcdir)/../opcodes!g s!@SRCDIR@/!!g +s!\.\./bfd/bfdver\.h!$(BFDVER_H)!g s! \$(srcdir)/config/te-generic\.h!!g s! \.\./bfd/bfd\.h!!g s! itbl-cpu\.h!!g s! itbl-parse\.h!!g +s! \.\./intl/libintl\.h!!g s! \$(INCDIR)/bin-bugs\.h!!g s! \$(INCDIR)/ansidecl\.h!!g s! \$(INCDIR)/libiberty\.h!!g s! \$(INCDIR)/progress\.h!!g -s! \$(INCDIR)/fopen-same\.h!!g +s! \$(INCDIR)/fopen-[^ ]*\.h!!g s! obj-format\.h!!g s! targ-cpu\.h!!g s! targ-env\.h!!g diff --git a/contrib/binutils/gas/depend.c b/contrib/binutils/gas/depend.c index 3c6049d..127c819 100644 --- a/contrib/binutils/gas/depend.c +++ b/contrib/binutils/gas/depend.c @@ -35,8 +35,8 @@ static struct dependency * dep_chain = NULL; /* Current column in output file. */ static int column = 0; -static int quote_string_for_make PARAMS ((FILE *, char *)); -static void wrap_output PARAMS ((FILE *, char *, int)); +static int quote_string_for_make (FILE *, char *); +static void wrap_output (FILE *, char *, int); /* Number of columns allowable. */ #define MAX_COLUMNS 72 @@ -45,8 +45,7 @@ static void wrap_output PARAMS ((FILE *, char *, int)); never called, then dependency tracking is simply skipped. */ void -start_dependencies (filename) - char *filename; +start_dependencies (char *filename) { dep_file = filename; } @@ -54,8 +53,7 @@ start_dependencies (filename) /* Noticed a new filename, so try to register it. */ void -register_dependency (filename) - char *filename; +register_dependency (char *filename) { struct dependency *dep; @@ -81,9 +79,7 @@ register_dependency (filename) This code is taken from gcc with only minor changes. */ static int -quote_string_for_make (file, src) - FILE *file; - char *src; +quote_string_for_make (FILE *file, char *src) { char *p = src; int i = 0; @@ -145,10 +141,7 @@ quote_string_for_make (file, src) wrapping as necessary. */ static void -wrap_output (f, string, spacer) - FILE *f; - char *string; - int spacer; +wrap_output (FILE *f, char *string, int spacer) { int len = quote_string_for_make (NULL, string); @@ -186,7 +179,7 @@ wrap_output (f, string, spacer) /* Print dependency file. */ void -print_dependencies () +print_dependencies (void) { FILE *f; struct dependency *dep; diff --git a/contrib/binutils/gas/doc/Makefile.am b/contrib/binutils/gas/doc/Makefile.am index cfb8f89..7f0f805 100644 --- a/contrib/binutils/gas/doc/Makefile.am +++ b/contrib/binutils/gas/doc/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to generate Makefile.in -AUTOMAKE_OPTIONS = cygnus +AUTOMAKE_OPTIONS = 1.8 cygnus # What version of the manual you want; "all" includes everything CONFIG=all @@ -15,8 +15,6 @@ POD2MAN = pod2man --center="GNU Development Tools" \ man_MANS = as.1 -# The gasp.texi file is now deprecated, as GASP has been deprecated. -# It will disappear in a future release. info_TEXINFOS = as.texinfo asconfig.texi: $(CONFIG).texi @@ -39,12 +37,14 @@ CPU_DOCS = \ c-i386.texi \ c-i860.texi \ c-i960.texi \ + c-ip2k.texi \ c-m32r.texi \ c-m68hc11.texi \ c-m68k.texi \ c-m88k.texi \ c-mips.texi \ c-mmix.texi \ + c-msp430.texi \ c-ns32k.texi \ c-pdp11.texi \ c-pj.texi \ @@ -55,6 +55,7 @@ CPU_DOCS = \ c-tic54x.texi \ c-vax.texi \ c-v850.texi \ + c-xtensa.texi \ c-z8k.texi gasver.texi: Makefile @@ -66,16 +67,21 @@ as.dvi: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) # We want install to imply install-info as per GNU standards, despite the # cygnus option. -install: install-info +install-data-local: install-info # This one isn't ready for prime time yet. Not even a little bit. -noinst_TEXINFOS = internals.texi gasp.texi +noinst_TEXINFOS = internals.texi DISTCLEANFILES = asconfig.texi MAINTAINERCLEANFILES = gasver.texi +BASEDIR = $(srcdir)/../.. +BFDDIR = $(BASEDIR)/bfd + +CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in + # Maintenance # We need it for the taz target in ../../Makefile.in. @@ -84,7 +90,7 @@ info: $(MANS) # Build the man page from the texinfo file # The sed command removes the no-adjust Nroff command so that # the man output looks standard. -as.1: $(srcdir)/as.texinfo +as.1: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) touch $@ -$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texinfo > as.pod -($(POD2MAN) as.pod | \ diff --git a/contrib/binutils/gas/doc/Makefile.in b/contrib/binutils/gas/doc/Makefile.in index 25daeaf..0c6a1b0 100644 --- a/contrib/binutils/gas/doc/Makefile.in +++ b/contrib/binutils/gas/doc/Makefile.in @@ -1,6 +1,8 @@ -# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am +# Makefile.in generated by automake 1.8.4 from Makefile.am. +# @configure_input@ -# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -10,132 +12,206 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. - -SHELL = @SHELL@ - +@SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ -prefix = @prefix@ -exec_prefix = @exec_prefix@ - -bindir = @bindir@ -sbindir = @sbindir@ -libexecdir = @libexecdir@ -datadir = @datadir@ -sysconfdir = @sysconfdir@ -sharedstatedir = @sharedstatedir@ -localstatedir = @localstatedir@ -libdir = @libdir@ -infodir = @infodir@ -mandir = @mandir@ -includedir = @includedir@ -oldincludedir = /usr/include - -DESTDIR = - pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ - top_builddir = .. - -ACLOCAL = @ACLOCAL@ -AUTOCONF = @AUTOCONF@ -AUTOMAKE = @AUTOMAKE@ -AUTOHEADER = @AUTOHEADER@ - +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd INSTALL = @INSTALL@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -transform = @program_transform_name@ - +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : -build_alias = @build_alias@ build_triplet = @build@ -host_alias = @host_alias@ host_triplet = @host@ -target_alias = @target_alias@ target_triplet = @target@ +subdir = doc +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/../gettext.m4 \ + $(top_srcdir)/configure.in +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +depcomp = +am__depfiles_maybe = +SOURCES = +DIST_SOURCES = +INFO_DEPS = $(srcdir)/as.info +TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex +am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo +DVIS = as.dvi +PDFS = as.pdf +PSS = as.ps +HTMLS = as.html +TEXINFOS = as.texinfo +TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then \ + echo $(top_srcdir)/../texinfo/util/texi2dvi; \ + else \ + echo texi2dvi; \ + fi` +TEXI2PDF = $(TEXI2DVI) --pdf --batch +MAKEINFOHTML = $(MAKEINFO) --html +AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) +DVIPS = dvips +man1dir = $(mandir)/man1 +am__installdirs = "$(DESTDIR)$(man1dir)" +NROFF = nroff +MANS = $(man_MANS) +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ ALL_OBJ_DEPS = @ALL_OBJ_DEPS@ -AS = @AS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ BFDLIB = @BFDLIB@ +BFDVER_H = @BFDVER_H@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ DATADIRNAME = @DATADIRNAME@ -DLLTOOL = @DLLTOOL@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ EXEEXT = @EXEEXT@ -GCJ = @GCJ@ -GCJFLAGS = @GCJFLAGS@ GDBINIT = @GDBINIT@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GT_NO = @GT_NO@ GT_YES = @GT_YES@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ INTLLIBS = @INTLLIBS@ INTLOBJS = @INTLOBJS@ +LDFLAGS = @LDFLAGS@ LEX = @LEX@ +LEXLIB = @LEXLIB@ +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ -OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OPCODES_LIB = @OPCODES_LIB@ PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ STRIP = @STRIP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ +XGETTEXT = @XGETTEXT@ YACC = @YACC@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_RANLIB = @ac_ct_RANLIB@ +ac_ct_STRIP = @ac_ct_STRIP@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ atof = @atof@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ cgen_cpu_prefix = @cgen_cpu_prefix@ +datadir = @datadir@ +exec_prefix = @exec_prefix@ extra_objects = @extra_objects@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ install_tooldir = @install_tooldir@ l = @l@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ obj_format = @obj_format@ +oldincludedir = @oldincludedir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ target_cpu_type = @target_cpu_type@ +target_os = @target_os@ +target_vendor = @target_vendor@ te_file = @te_file@ - -AUTOMAKE_OPTIONS = cygnus +AUTOMAKE_OPTIONS = 1.8 cygnus # What version of the manual you want; "all" includes everything CONFIG = all # Options to extract the man page from as.texinfo MANCONF = -Dman - TEXI2POD = perl $(top_srcdir)/../etc/texi2pod.pl - POD2MAN = pod2man --center="GNU Development Tools" \ --release="binutils-$(VERSION)" --section=1 - man_MANS = as.1 - -# The gasp.texi file is now deprecated, as GASP has been deprecated. -# It will disappear in a future release. info_TEXINFOS = as.texinfo - CPU_DOCS = \ c-a29k.texi \ c-alpha.texi \ @@ -150,12 +226,14 @@ CPU_DOCS = \ c-i386.texi \ c-i860.texi \ c-i960.texi \ + c-ip2k.texi \ c-m32r.texi \ c-m68hc11.texi \ c-m68k.texi \ c-m88k.texi \ c-mips.texi \ c-mmix.texi \ + c-msp430.texi \ c-ns32k.texi \ c-pdp11.texi \ c-pj.texi \ @@ -166,161 +244,161 @@ CPU_DOCS = \ c-tic54x.texi \ c-vax.texi \ c-v850.texi \ + c-xtensa.texi \ c-z8k.texi # This one isn't ready for prime time yet. Not even a little bit. - -noinst_TEXINFOS = internals.texi gasp.texi - +noinst_TEXINFOS = internals.texi DISTCLEANFILES = asconfig.texi - MAINTAINERCLEANFILES = gasver.texi -mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs -CONFIG_HEADER = ../config.h -CONFIG_CLEAN_FILES = -TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then echo $(top_srcdir)/../texinfo/util/texi2dvi; else echo texi2dvi; fi` -TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex -INFO_DEPS = as.info -DVIS = as.dvi -TEXINFOS = as.texinfo -man1dir = $(mandir)/man1 -MANS = $(man_MANS) +BASEDIR = $(srcdir)/../.. +BFDDIR = $(BASEDIR)/bfd +CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/configure.in +all: all-am -NROFF = nroff -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = gtar -GZIP_ENV = --best -all: all-redirect .SUFFIXES: -.SUFFIXES: .dvi .info .ps .texi .texinfo .txi -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --cygnus doc/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -as.info: as.texinfo -as.dvi: as.texinfo - - -DVIPS = dvips - -.texi.info: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< - -.texi.dvi: - TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.texi: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< +.SUFFIXES: .dvi .html .info .pdf .ps .texinfo +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign doc/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool .texinfo.info: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< - -.texinfo: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< + restore=: && \ + backupdir="$(am__leading_dot)am$$$$" && \ + am__cwd=`pwd` && cd $(srcdir) && \ + rm -rf $$backupdir && mkdir $$backupdir && \ + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ + if test -f $$f; then \ + mv $$f $$backupdir; \ + restore=mv; \ + fi; \ + done; \ + cd "$$am__cwd"; \ + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $@ $<; \ + then \ + rc=0; \ + cd $(srcdir); \ + else \ + rc=$$?; \ + cd $(srcdir) && \ + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ + fi; \ + rm -rf $$backupdir; \ + exit $$rc .texinfo.dvi: - TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.txi.info: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< - -.txi.dvi: - TEXINPUTS=$(top_srcdir)/../texinfo/texinfo.tex:$$TEXINPUTS \ - MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $< - -.txi: - @rm -f $@ $@-[0-9] $@-[0-9][0-9] - $(MAKEINFO) -I $(srcdir) $< + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2DVI) $< + +.texinfo.pdf: + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ + $(TEXI2PDF) $< + +.texinfo.html: + $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ + -o $@ $< + if test ! -d $@ && test -d $(@:.html=); then \ + mv $(@:.html=) $@; else :; fi +$(srcdir)/as.info: as.texinfo +as.pdf: as.texinfo +as.html: as.texinfo .dvi.ps: - $(DVIPS) $< -o $@ + $(DVIPS) -o $@ $< -install-info-am: $(INFO_DEPS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(DESTDIR)$(infodir) - @list='$(INFO_DEPS)'; \ - for file in $$list; do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \ - if test -f $$d/$$ifile; then \ - echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \ - $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \ - else : ; fi; \ - done; \ - done - @$(POST_INSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ +uninstall-info-am: + $(PRE_UNINSTALL) + @if (install-info --version && \ + install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ - echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\ - install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ + install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ done; \ - else : ; fi - -uninstall-info: - $(PRE_UNINSTALL) - @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \ - ii=yes; \ - else ii=; fi; \ - list='$(INFO_DEPS)'; \ - for file in $$list; do \ - test -z "$$ii" \ - || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \ - done + else :; fi @$(NORMAL_UNINSTALL) - list='$(INFO_DEPS)'; \ + @list='$(INFO_DEPS)'; \ for file in $$list; do \ - (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ + (if cd "$(DESTDIR)$(infodir)"; then \ + echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \ + rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ + else :; fi); \ done dist-info: $(INFO_DEPS) + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ + case $$base in \ + $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ - for file in `cd $$d && eval echo $$base*`; do \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file; \ + for file in $$d/$$base*; do \ + relfile=`expr "$$file" : "$$d/\(.*\)"`; \ + test -f $(distdir)/$$relfile || \ + cp -p $$file $(distdir)/$$relfile; \ done; \ done mostlyclean-aminfo: - -rm -f as.aux as.cp as.cps as.dvi as.fn as.fns as.ky as.kys as.ps \ - as.log as.pg as.toc as.tp as.tps as.vr as.vrs as.op as.tr \ - as.cv as.cn - -clean-aminfo: - -distclean-aminfo: + -rm -rf as.aux as.cp as.cps as.fn as.fns as.ky as.log as.pg as.pgs as.tmp \ + as.toc as.tp as.tps as.vr as.vrs as.dvi as.pdf as.ps as.html maintainer-clean-aminfo: - for i in $(INFO_DEPS); do \ - rm -f $$i; \ - if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \ - rm -f $$i-[0-9]*; \ - fi; \ + @list='$(INFO_DEPS)'; for i in $$list; do \ + i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ + echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ + rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done -clean-info: mostlyclean-aminfo -install-man1: - $(mkinstalldirs) $(DESTDIR)$(man1dir) - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ +clean-info: mostlyclean-aminfo +install-man1: $(man1_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)" + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ @@ -329,120 +407,167 @@ install-man1: if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ - $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done - uninstall-man1: - @list='$(man1_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ + @$(NORMAL_UNINSTALL) + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 1*) ;; \ + *) ext='1' ;; \ + esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ - echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ - rm -f $(DESTDIR)$(man1dir)/$$inst; \ + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done -install-man: $(MANS) - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-man1 -uninstall-man: - @$(NORMAL_UNINSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 tags: TAGS TAGS: +ctags: CTAGS +CTAGS: -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = doc - -distdir: $(DISTFILES) - @for file in $(DISTFILES); do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - cp -pr $$d/$$file $(distdir)/$$file; \ - else \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file || :; \ - fi; \ - done - $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info -info-am: $(INFO_DEPS) -info: info-am -dvi-am: $(DVIS) -dvi: dvi-am check-am: check: check-am -installcheck-am: -installcheck: installcheck-am -install-info-am: -install-info: install-info-am -install-exec-am: +all-am: Makefile $(MANS) +installdirs: + for dir in "$(DESTDIR)$(man1dir)"; do \ + test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done +install: install-am install-exec: install-exec-am - -install-data-am: install-man install-data: install-data-am +uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -install: install-am -uninstall-am: uninstall-man -uninstall: uninstall-am -all-am: Makefile $(MANS) -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install -installdirs: - $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 - +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -rm -f $(CONFIG_CLEAN_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) -mostlyclean-am: mostlyclean-aminfo mostlyclean-generic +clean: clean-am -mostlyclean: mostlyclean-am +clean-am: clean-generic clean-libtool mostlyclean-am -clean-am: clean-aminfo clean-generic mostlyclean-am +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-libtool -clean: clean-am +dvi: dvi-am -distclean-am: distclean-aminfo distclean-generic clean-am - -rm -f libtool +dvi-am: $(DVIS) -distclean: distclean-am +html: html-am -maintainer-clean-am: maintainer-clean-aminfo maintainer-clean-generic \ - distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." +html-am: $(HTMLS) + +info-am: $(INFO_DEPS) + +install-data-am: install-data-local install-man + +install-exec-am: + +install-info: install-info-am + +install-info-am: $(INFO_DEPS) + @$(NORMAL_INSTALL) + test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + case $$file in \ + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ + esac; \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ + for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ + $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ + if test -f $$ifile; then \ + relfile=`echo "$$ifile" | sed 's|^.*/||'`; \ + echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \ + $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \ + else : ; fi; \ + done; \ + done + @$(POST_INSTALL) + @if (install-info --version && \ + install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ + list='$(INFO_DEPS)'; \ + for file in $$list; do \ + relfile=`echo "$$file" | sed 's|^.*/||'`; \ + echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ + install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ + done; \ + else : ; fi +install-man: install-man1 + +installcheck-am: maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-aminfo \ + maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: $(PDFS) -.PHONY: install-info-am uninstall-info mostlyclean-aminfo \ -distclean-aminfo clean-aminfo maintainer-clean-aminfo install-man1 \ -uninstall-man1 install-man uninstall-man tags distdir info-am info \ -dvi-am dvi check check-am installcheck-am installcheck install-info-am \ -install-info install-exec-am install-exec install-data-am install-data \ -install-am install uninstall-am uninstall all-redirect all-am all \ -installdirs mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean +ps: ps-am + +ps-am: $(PSS) + +uninstall-am: uninstall-man + +uninstall-man: uninstall-man1 + +.PHONY: all all-am check check-am clean clean-generic clean-info \ + clean-libtool dist-info distclean distclean-generic \ + distclean-libtool dvi dvi-am html html-am info info-am install \ + install-am install-data install-data-am install-data-local \ + install-exec install-exec-am install-info install-info-am \ + install-man install-man1 install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-aminfo maintainer-clean-generic mostlyclean \ + mostlyclean-aminfo mostlyclean-generic mostlyclean-libtool pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \ + uninstall-man uninstall-man1 asconfig.texi: $(CONFIG).texi @@ -460,7 +585,7 @@ as.dvi: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) # We want install to imply install-info as per GNU standards, despite the # cygnus option. -install: install-info +install-data-local: install-info # Maintenance @@ -470,7 +595,7 @@ info: $(MANS) # Build the man page from the texinfo file # The sed command removes the no-adjust Nroff command so that # the man output looks standard. -as.1: $(srcdir)/as.texinfo +as.1: $(srcdir)/as.texinfo asconfig.texi gasver.texi $(CPU_DOCS) touch $@ -$(TEXI2POD) $(MANCONF) < $(srcdir)/as.texinfo > as.pod -($(POD2MAN) as.pod | \ @@ -478,7 +603,6 @@ as.1: $(srcdir)/as.texinfo mv -f $@.T$$$$ $@) || \ (rm -f $@.T$$$$ && exit 1) rm -f as.pod - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/contrib/binutils/gas/doc/all.texi b/contrib/binutils/gas/doc/all.texi index 0642dfd..4e302ce 100644 --- a/contrib/binutils/gas/doc/all.texi +++ b/contrib/binutils/gas/doc/all.texi @@ -40,6 +40,7 @@ @set I80386 @set I860 @set I960 +@set IP2K @set M32R @set M68HC11 @set M680X0 @@ -47,15 +48,17 @@ @set MCORE @set MIPS @set MMIX +@set MSP430 @set PDP11 @set PJ @set PPC @set SH @set SPARC -@set C54X +@set TIC54X @set V850 @set VAX @set VXWORKS +@set XTENSA @set Z8000 @c Does this version of the assembler use the difference-table kluge? diff --git a/contrib/binutils/gas/doc/as.1 b/contrib/binutils/gas/doc/as.1 index b0de343..e16cbe9 100644 --- a/contrib/binutils/gas/doc/as.1 +++ b/contrib/binutils/gas/doc/as.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.3, Pod::Parser v1.13 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== @@ -21,7 +21,6 @@ .. .de Ve \" End verbatim text .ft R - .fi .. .\" Set up some character translations and predefined strings. \*(-- will @@ -129,15 +128,14 @@ .\" ======================================================================== .\" .IX Title "AS 1" -.TH AS 1 "2002-08-05" "binutils-2.12.91" "GNU Development Tools" -.UC +.TH AS 1 "2004-05-17" "binutils-2.15" "GNU Development Tools" .SH "NAME" -\&\s-1AS\s0 \- the portable \s-1GNU\s0 assembler. +AS \- the portable GNU assembler. .SH "SYNOPSIS" .IX Header "SYNOPSIS" as [\fB\-a\fR[\fBcdhlns\fR][=\fIfile\fR]] [\fB\-D\fR] [\fB\-\-defsym\fR \fIsym\fR=\fIval\fR] - [\fB\-f\fR] [\fB\-\-gstabs\fR] [\fB\-\-gdwarf2\fR] [\fB\-\-help\fR] [\fB\-I\fR \fIdir\fR] - [\fB\-J\fR] [\fB\-K\fR] [\fB\-L\fR] + [\fB\-f\fR] [\fB\-\-gstabs\fR] [\fB\-\-gstabs+\fR] [\fB\-\-gdwarf2\fR] [\fB\-\-help\fR] + [\fB\-I\fR \fIdir\fR] [\fB\-J\fR] [\fB\-K\fR] [\fB\-L\fR] [\fB\-\-listing\-lhs\-width\fR=\fI\s-1NUM\s0\fR] [\fB\-\-listing\-lhs\-width2\fR=\fI\s-1NUM\s0\fR] [\fB\-\-listing\-rhs\-width\fR=\fI\s-1NUM\s0\fR] [\fB\-\-listing\-cont\-lines\fR=\fI\s-1NUM\s0\fR] [\fB\-\-keep\-locals\fR] [\fB\-o\fR \fIobjfile\fR] [\fB\-R\fR] [\fB\-\-statistics\fR] [\fB\-v\fR] @@ -158,7 +156,8 @@ as [\fB\-a\fR[\fBcdhlns\fR][=\fIfile\fR]] [\fB\-D\fR] [\fB\-\-defsym\fR \fIsym\f \&\fITarget \s-1ARM\s0 options:\fR [\fB\-mcpu\fR=\fIprocessor\fR[+\fIextension\fR...]] [\fB\-march\fR=\fIarchitecture\fR[+\fIextension\fR...]] - [\fB\-mfpu\fR=\fIfloating-point-fromat\fR] + [\fB\-mfpu\fR=\fIfloating-point-format\fR] + [\fB\-mfloat\-abi\fR=\fIabi\fR] [\fB\-mthumb\fR] [\fB\-EB\fR|\fB\-EL\fR] [\fB\-mapcs\-32\fR|\fB\-mapcs\-26\fR|\fB\-mapcs\-float\fR| @@ -177,13 +176,16 @@ as [\fB\-a\fR[\fBcdhlns\fR][=\fIfile\fR]] [\fB\-D\fR] [\fB\-\-defsym\fR \fIsym\f [\fB\-O\fR|\fB\-n\fR|\fB\-N\fR] .PP \&\fITarget i386 options:\fR - [\fB\-\-32\fR|\fB\-\-64\fR] + [\fB\-\-32\fR|\fB\-\-64\fR] [\fB\-n\fR] .PP \&\fITarget i960 options:\fR [\fB\-ACA\fR|\fB\-ACA_A\fR|\fB\-ACB\fR|\fB\-ACC\fR|\fB\-AKA\fR|\fB\-AKB\fR| \fB\-AKC\fR|\fB\-AMC\fR] [\fB\-b\fR] [\fB\-no\-relax\fR] .PP +\&\fITarget \s-1IP2K\s0 options:\fR + [\fB\-mip2022\fR|\fB\-mip2022ext\fR] +.PP \&\fITarget M32R options:\fR [\fB\-\-m32rx\fR|\fB\-\-[no\-]warn\-explicit\-parallel\-conflicts\fR| \fB\-\-W[n]p\fR] @@ -192,7 +194,9 @@ as [\fB\-a\fR[\fBcdhlns\fR][=\fIfile\fR]] [\fB\-D\fR] [\fB\-\-defsym\fR \fIsym\f [\fB\-l\fR] [\fB\-m68000\fR|\fB\-m68010\fR|\fB\-m68020\fR|...] .PP \&\fITarget M68HC11 options:\fR - [\fB\-m68hc11\fR|\fB\-m68hc12\fR] + [\fB\-m68hc11\fR|\fB\-m68hc12\fR|\fB\-m68hcs12\fR] + [\fB\-mshort\fR|\fB\-mlong\fR] + [\fB\-mshort\-double\fR|\fB\-mlong\-double\fR] [\fB\-\-force\-long\-branchs\fR] [\fB\-\-short\-branchs\fR] [\fB\-\-strict\-direct\-mode\fR] [\fB\-\-print\-insn\-syntax\fR] [\fB\-\-print\-opcodes\fR] [\fB\-\-generate\-example\fR] @@ -202,12 +206,13 @@ as [\fB\-a\fR[\fBcdhlns\fR][=\fIfile\fR]] [\fB\-D\fR] [\fB\-\-defsym\fR \fIsym\f [\fB\-mcpu=[210|340]\fR] .PP \&\fITarget \s-1MIPS\s0 options:\fR - [\fB\-nocpp\fR] [\fB\-EL\fR] [\fB\-EB\fR] [\fB\-n\fR] [\fB\-O\fR[\fIoptimization level\fR]] + [\fB\-nocpp\fR] [\fB\-EL\fR] [\fB\-EB\fR] [\fB\-O\fR[\fIoptimization level\fR]] [\fB\-g\fR[\fIdebug level\fR]] [\fB\-G\fR \fInum\fR] [\fB\-KPIC\fR] [\fB\-call_shared\fR] [\fB\-non_shared\fR] [\fB\-xgot\fR] [\fB\-\-membedded\-pic\fR] [\fB\-mabi\fR=\fI\s-1ABI\s0\fR] [\fB\-32\fR] [\fB\-n32\fR] [\fB\-64\fR] [\fB\-mfp32\fR] [\fB\-mgp32\fR] [\fB\-march\fR=\fI\s-1CPU\s0\fR] [\fB\-mtune\fR=\fI\s-1CPU\s0\fR] [\fB\-mips1\fR] [\fB\-mips2\fR] - [\fB\-mips3\fR] [\fB\-mips4\fR] [\fB\-mips5\fR] [\fB\-mips32\fR] [\fB\-mips64\fR] + [\fB\-mips3\fR] [\fB\-mips4\fR] [\fB\-mips5\fR] [\fB\-mips32\fR] [\fB\-mips32r2\fR] + [\fB\-mips64\fR] [\fB\-mips64r2\fR] [\fB\-construct\-floats\fR] [\fB\-no\-construct\-floats\fR] [\fB\-trap\fR] [\fB\-no\-break\fR] [\fB\-break\fR] [\fB\-no\-trap\fR] [\fB\-mfix7000\fR] [\fB\-mno\-fix7000\fR] @@ -215,6 +220,7 @@ as [\fB\-a\fR[\fBcdhlns\fR][=\fIfile\fR]] [\fB\-D\fR] [\fB\-\-defsym\fR \fIsym\f [\fB\-mips3d\fR] [\fB\-no\-mips3d\fR] [\fB\-mdmx\fR] [\fB\-no\-mdmx\fR] [\fB\-mdebug\fR] [\fB\-no\-mdebug\fR] + [\fB\-mpdr\fR] [\fB\-mno\-pdr\fR] .PP \&\fITarget \s-1MMIX\s0 options:\fR [\fB\-\-fixed\-special\-register\-names\fR] [\fB\-\-globalize\-symbols\fR] @@ -245,6 +251,15 @@ as [\fB\-a\fR[\fBcdhlns\fR][=\fIfile\fR]] [\fB\-D\fR] [\fB\-\-defsym\fR \fIsym\f \fB\-Av8plus\fR|\fB\-Av8plusa\fR|\fB\-Av9\fR|\fB\-Av9a\fR] [\fB\-xarch=v8plus\fR|\fB\-xarch=v8plusa\fR] [\fB\-bump\fR] [\fB\-32\fR|\fB\-64\fR] +.PP +\&\fITarget \s-1TIC54X\s0 options:\fR + [\fB\-mcpu=54[123589]\fR|\fB\-mcpu=54[56]lp\fR] [\fB\-mfar\-mode\fR|\fB\-mf\fR] + [\fB\-merrors\-to\-file\fR \fI\fR|\fB\-me\fR \fI\fR] +.PP +\&\fITarget Xtensa options:\fR + [\fB\-\-[no\-]density\fR] [\fB\-\-[no\-]relax\fR] [\fB\-\-[no\-]generics\fR] + [\fB\-\-[no\-]text\-section\-literals\fR] + [\fB\-\-[no\-]target\-align\fR] [\fB\-\-[no\-]longcalls\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\s-1GNU\s0 \fBas\fR is really a family of assemblers. @@ -255,8 +270,8 @@ including object file formats, most assembler directives (often called \&\fIpseudo-ops\fR) and assembler syntax. .PP \&\fBas\fR is primarily intended to assemble the output of the -\&\s-1GNU\s0 C compiler for use by the linker -\&. Nevertheless, we've tried to make \fBas\fR +\&\s-1GNU\s0 C compiler \f(CW\*(C`gcc\*(C'\fR for use by the linker +\&\f(CW\*(C`ld\*(C'\fR. Nevertheless, we've tried to make \fBas\fR assemble correctly everything that other assemblers for the same machine would assemble. Any exceptions are documented explicitly. @@ -290,7 +305,7 @@ runs \fBas\fR automatically. Warnings report an assumption made so that \fBas\fR could keep assembling a flawed program; errors report a grave problem that stops the assembly. .PP -If you are invoking \fBas\fR via the \s-1GNU\s0 C compiler (version 2), +If you are invoking \fBas\fR via the \s-1GNU\s0 C compiler, you can use the \fB\-Wa\fR option to pass arguments through to the assembler. The assembler arguments must be separated from each other (and the \fB\-Wa\fR) by commas. For example: @@ -298,8 +313,9 @@ by commas. For example: .Vb 1 \& gcc -c -g -O -Wa,-alh,-L file.c .Ve +.PP This passes two options to the assembler: \fB\-alh\fR (emit a listing to -standard output with with high-level and assembly source) and \fB\-L\fR (retain +standard output with high-level and assembly source) and \fB\-L\fR (retain local symbols in the symbol table). .PP Usually you do not need to use this \fB\-Wa\fR mechanism, since many compiler @@ -361,10 +377,17 @@ compiler output). .IX Item "--gstabs" Generate stabs debugging information for each assembler line. This may help debugging assembler code, if the debugger can handle it. +.IP "\fB\-\-gstabs+\fR" 4 +.IX Item "--gstabs+" +Generate stabs debugging information for each assembler line, with \s-1GNU\s0 +extensions that probably only gdb can handle, and that could make other +debuggers crash or refuse to read your program. This +may help debugging assembler code. Currently the only \s-1GNU\s0 extension is +the location of the current working directory at assembling time. .IP "\fB\-\-gdwarf2\fR" 4 .IX Item "--gdwarf2" Generate \s-1DWARF2\s0 debugging information for each assembler line. This -may help debugging assembler code, if the debugger can handle it. Note \- this +may help debugging assembler code, if the debugger can handle it. Note\-\-\-this option is only supported by some targets, not all of them. .IP "\fB\-\-help\fR" 4 .IX Item "--help" @@ -380,7 +403,7 @@ Add directory \fIdir\fR to the search list for \f(CW\*(C`.include\*(C'\fR direct Don't warn about signed overflow. .IP "\fB\-K\fR" 4 .IX Item "-K" -This option is accepted but has no effect on the \s-1TARGET\s0 family. +Issue warnings when difference tables altered for long displacements. .IP "\fB\-L\fR" 4 .IX Item "-L" .PD 0 @@ -475,6 +498,9 @@ Specify which \s-1ARM\s0 architecture variant is used by the target. .IP "\fB\-mfpu=\fR\fIfloating-point-format\fR" 4 .IX Item "-mfpu=floating-point-format" Select which Floating Point architecture is the target. +.IP "\fB\-mfloat\-abi=\fR\fIabi\fR" 4 +.IX Item "-mfloat-abi=abi" +Select which floating point \s-1ABI\s0 is in use. .IP "\fB\-mthumb\fR" 4 .IX Item "-mthumb" Enable Thumb only instruction decoding. @@ -526,7 +552,17 @@ Do not alter compare-and-branch instructions for long displacements; error if necessary. .PP The following options are available when as is configured for the -Mitsubishi M32R series. +Ubicom \s-1IP2K\s0 series. +.IP "\fB\-mip2022ext\fR" 4 +.IX Item "-mip2022ext" +Specifies that the extended \s-1IP2022\s0 instructions are allowed. +.IP "\fB\-mip2022\fR" 4 +.IX Item "-mip2022" +Restores the default behaviour, which restricts the permitted instructions to +just the basic \s-1IP2022\s0 ones. +.PP +The following options are available when as is configured for the +Renesas M32R (formerly Mitsubishi M32R) series. .IP "\fB\-\-m32rx\fR" 4 .IX Item "--m32rx" Specify which processor in the M32R family is the target. The default @@ -606,10 +642,22 @@ Generate ``little endian'' format output. .PP The following options are available when as is configured for the Motorola 68HC11 or 68HC12 series. -.IP "\fB\-m68hc11 | \-m68hc12\fR" 4 -.IX Item "-m68hc11 | -m68hc12" +.IP "\fB\-m68hc11 | \-m68hc12 | \-m68hcs12\fR" 4 +.IX Item "-m68hc11 | -m68hc12 | -m68hcs12" Specify what processor is the target. The default is defined by the configuration option when building the assembler. +.IP "\fB\-mshort\fR" 4 +.IX Item "-mshort" +Specify to use the 16\-bit integer \s-1ABI\s0. +.IP "\fB\-mlong\fR" 4 +.IX Item "-mlong" +Specify to use the 32\-bit integer \s-1ABI\s0. +.IP "\fB\-mshort\-double\fR" 4 +.IX Item "-mshort-double" +Specify to use the 32\-bit double \s-1ABI\s0. +.IP "\fB\-mlong\-double\fR" 4 +.IX Item "-mlong-double" +Specify to use the 64\-bit double \s-1ABI\s0. .IP "\fB\-\-force\-long\-branchs\fR" 4 .IX Item "--force-long-branchs" Relative branches are turned into absolute ones. This concerns @@ -657,6 +705,20 @@ equivalent to \-Av8plus and \-Av8plusa, respectively. .IX Item "-bump" Warn when the assembler switches to another architecture. .PP +The following options are available when as is configured for the 'c54x +architecture. +.IP "\fB\-mfar\-mode\fR" 4 +.IX Item "-mfar-mode" +Enable extended addressing mode. All addresses and relocations will assume +extended addressing (usually 23 bits). +.IP "\fB\-mcpu=\fR\fI\s-1CPU_VERSION\s0\fR" 4 +.IX Item "-mcpu=CPU_VERSION" +Sets the \s-1CPU\s0 version being compiled for. +.IP "\fB\-merrors\-to\-file\fR \fI\s-1FILENAME\s0\fR" 4 +.IX Item "-merrors-to-file FILENAME" +Redirect error output to a file, for broken systems which don't support such +behaviour in the shell. +.PP The following options are available when as is configured for a \s-1MIPS\s0 processor. .IP "\fB\-G\fR \fInum\fR" 4 @@ -683,16 +745,23 @@ Generate ``little endian'' format output. .IX Item "-mips5" .IP "\fB\-mips32\fR" 4 .IX Item "-mips32" +.IP "\fB\-mips32r2\fR" 4 +.IX Item "-mips32r2" .IP "\fB\-mips64\fR" 4 .IX Item "-mips64" +.IP "\fB\-mips64r2\fR" 4 +.IX Item "-mips64r2" .PD Generate code for a particular \s-1MIPS\s0 Instruction Set Architecture level. \&\fB\-mips1\fR is an alias for \fB\-march=r3000\fR, \fB\-mips2\fR is an alias for \fB\-march=r6000\fR, \fB\-mips3\fR is an alias for \&\fB\-march=r4000\fR and \fB\-mips4\fR is an alias for \fB\-march=r8000\fR. -\&\fB\-mips5\fR, \fB\-mips32\fR, and \fB\-mips64\fR correspond to generic -\&\fB\s-1MIPS\s0 V\fR, \fB\s-1MIPS32\s0\fR, and \fB\s-1MIPS64\s0\fR \s-1ISA\s0 processors, -respectively. +\&\fB\-mips5\fR, \fB\-mips32\fR, \fB\-mips32r2\fR, \fB\-mips64\fR, and +\&\fB\-mips64r2\fR +correspond to generic +\&\fB\s-1MIPS\s0 V\fR, \fB\s-1MIPS32\s0\fR, \fB\s-1MIPS32\s0 Release 2\fR, \fB\s-1MIPS64\s0\fR, +and \fB\s-1MIPS64\s0 Release 2\fR +\&\s-1ISA\s0 processors, respectively. .IP "\fB\-march=\fR\fI\s-1CPU\s0\fR" 4 .IX Item "-march=CPU" Generate code for a particular \s-1MIPS\s0 cpu. @@ -715,6 +784,13 @@ of an mfhi or mflo instruction occurs in the following two instructions. .PD Cause stabs-style debugging output to go into an ECOFF-style .mdebug section instead of the standard \s-1ELF\s0 .stabs sections. +.IP "\fB\-mpdr\fR" 4 +.IX Item "-mpdr" +.PD 0 +.IP "\fB\-mno\-pdr\fR" 4 +.IX Item "-mno-pdr" +.PD +Control generation of \f(CW\*(C`.pdr\*(C'\fR sections. .IP "\fB\-mgp32\fR" 4 .IX Item "-mgp32" .PD 0 @@ -844,6 +920,41 @@ Assemble for a big endian target. Assemble for a little endian target. .PP See the info pages for documentation of the MMIX-specific options. +.PP +The following options are available when as is configured for +an Xtensa processor. +.IP "\fB\-\-density | \-\-no\-density\fR" 4 +.IX Item "--density | --no-density" +Enable or disable use of instructions from the Xtensa code density +option. This is enabled by default when the Xtensa processor supports +the code density option. +.IP "\fB\-\-relax | \-\-no\-relax\fR" 4 +.IX Item "--relax | --no-relax" +Enable or disable instruction relaxation. This is enabled by default. +Note: In the current implementation, these options also control whether +assembler optimizations are performed, making these options equivalent +to \fB\-\-generics\fR and \fB\-\-no\-generics\fR. +.IP "\fB\-\-generics | \-\-no\-generics\fR" 4 +.IX Item "--generics | --no-generics" +Enable or disable all assembler transformations of Xtensa instructions. +The default is \fB\-\-generics\fR; +\&\fB\-\-no\-generics\fR should be used only in the rare cases when the +instructions must be exactly as specified in the assembly source. +.IP "\fB\-\-text\-section\-literals | \-\-no\-text\-section\-literals\fR" 4 +.IX Item "--text-section-literals | --no-text-section-literals" +With \fB\-\-text\-section\-literals\fR, literal pools are interspersed +in the text section. The default is +\&\fB\-\-no\-text\-section\-literals\fR, which places literals in a +separate section in the output file. +.IP "\fB\-\-target\-align | \-\-no\-target\-align\fR" 4 +.IX Item "--target-align | --no-target-align" +Enable or disable automatic alignment to reduce branch penalties at the +expense of some code density. The default is \fB\-\-target\-align\fR. +.IP "\fB\-\-longcalls | \-\-no\-longcalls\fR" 4 +.IX Item "--longcalls | --no-longcalls" +Enable or disable transformation of call instructions to allow calls +across a greater range of addresses. The default is +\&\fB\-\-no\-longcalls\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIgcc\fR\|(1), \fIld\fR\|(1), and the Info entries for \fIbinutils\fR and \fIld\fR. @@ -856,4 +967,4 @@ under the terms of the \s-1GNU\s0 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 \*(L"\s-1GNU\s0 Free Documentation License\*(R". +section entitled ``\s-1GNU\s0 Free Documentation License''. diff --git a/contrib/binutils/gas/doc/as.texinfo b/contrib/binutils/gas/doc/as.texinfo index f3195a3..d9d23df 100644 --- a/contrib/binutils/gas/doc/as.texinfo +++ b/contrib/binutils/gas/doc/as.texinfo @@ -1,6 +1,6 @@ \input texinfo @c -*-Texinfo-*- @c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -@c 2001, 2002 +@c 2001, 2002, 2003, 2004 @c Free Software Foundation, Inc. @c UPDATE!! On future updates-- @c (1) check for new machine-dep cmdline options in @@ -19,48 +19,20 @@ @c defaults, config file may override: @set have-stabs @c --- +@c man begin NAME +@c --- @include asconfig.texi @include gasver.texi @c --- -@c man begin NAME -@ifset man -@c Configure for the generation of man pages -@set AS as -@set TARGET TARGET -@set GENERIC -@set A29K -@set ALPHA -@set ARC -@set ARM -@set CRIS -@set D10V -@set D30V -@set H8/300 -@set H8/500 -@set HPPA -@set I370 -@set I80386 -@set I860 -@set I960 -@set IA-64 -@set M32R -@set M68HC11 -@set M680X0 -@set M880X0 -@set MCORE -@set MIPS -@set MMIX -@set PDP11 -@set PJ -@set PPC -@set SH -@set SPARC -@set C54X -@set V850 -@set VAX -@end ifset @c man end +@c --- @c common OR combinations of conditions +@ifset COFF +@set COFF-ELF +@end ifset +@ifset ELF +@set COFF-ELF +@end ifset @ifset AOUT @set aout-bout @end ifset @@ -138,7 +110,7 @@ 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". +section entitled ``GNU Free Documentation License''. @c man end @@ -191,7 +163,7 @@ Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Fr 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". + section entitled ``GNU Free Documentation License''. @end titlepage @@ -208,7 +180,7 @@ code for @value{TARGET} architectures. 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". +section entitled ``GNU Free Documentation License''. @menu * Overview:: Overview @@ -240,7 +212,7 @@ code for @value{TARGET} architectures. @cindex option summary @cindex summary of options Here is a brief summary of how to invoke @command{@value{AS}}. For details, -@pxref{Invoking,,Comand-Line Options}. +@pxref{Invoking,,Command-Line Options}. @c man title AS the portable GNU assembler. @@ -255,8 +227,8 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. @smallexample @c man begin SYNOPSIS @value{AS} [@b{-a}[@b{cdhlns}][=@var{file}]] [@b{-D}] [@b{--defsym} @var{sym}=@var{val}] - [@b{-f}] [@b{--gstabs}] [@b{--gdwarf2}] [@b{--help}] [@b{-I} @var{dir}] - [@b{-J}] [@b{-K}] [@b{-L}] + [@b{-f}] [@b{--gstabs}] [@b{--gstabs+}] [@b{--gdwarf2}] [@b{--help}] + [@b{-I} @var{dir}] [@b{-J}] [@b{-K}] [@b{-L}] [@b{--listing-lhs-width}=@var{NUM}] [@b{--listing-lhs-width2}=@var{NUM}] [@b{--listing-rhs-width}=@var{NUM}] [@b{--listing-cont-lines}=@var{NUM}] [@b{--keep-locals}] [@b{-o} @var{objfile}] [@b{-R}] [@b{--statistics}] [@b{-v}] @@ -289,7 +261,8 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. @c Don't document the deprecated options [@b{-mcpu}=@var{processor}[+@var{extension}@dots{}]] [@b{-march}=@var{architecture}[+@var{extension}@dots{}]] - [@b{-mfpu}=@var{floating-point-fromat}] + [@b{-mfpu}=@var{floating-point-format}] + [@b{-mfloat-abi}=@var{abi}] [@b{-mthumb}] [@b{-EB}|@b{-EL}] [@b{-mapcs-32}|@b{-mapcs-26}|@b{-mapcs-float}| @@ -316,7 +289,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. [@b{-O}|@b{-n}|@b{-N}] @end ifset @ifset H8 -@c Hitachi family chips have no machine-dependent assembler options +@c Renesas family chips have no machine-dependent assembler options @end ifset @ifset HPPA @c HPPA has no machine-dependent assembler options (yet). @@ -324,7 +297,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. @ifset I80386 @emph{Target i386 options:} - [@b{--32}|@b{--64}] + [@b{--32}|@b{--64}] [@b{-n}] @end ifset @ifset I960 @@ -342,6 +315,11 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. [@b{-mle}|@b{mbe}] [@b{-x}|@b{-xexplicit}] [@b{-xauto}] [@b{-xdebug}] @end ifset +@ifset IP2K + +@emph{Target IP2K options:} + [@b{-mip2022}|@b{-mip2022ext}] +@end ifset @ifset M32R @emph{Target M32R options:} @@ -356,7 +334,9 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. @ifset M68HC11 @emph{Target M68HC11 options:} - [@b{-m68hc11}|@b{-m68hc12}] + [@b{-m68hc11}|@b{-m68hc12}|@b{-m68hcs12}] + [@b{-mshort}|@b{-mlong}] + [@b{-mshort-double}|@b{-mlong-double}] [@b{--force-long-branchs}] [@b{--short-branchs}] [@b{--strict-direct-mode}] [@b{--print-insn-syntax}] [@b{--print-opcodes}] [@b{--generate-example}] @@ -370,12 +350,13 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. @ifset MIPS @emph{Target MIPS options:} - [@b{-nocpp}] [@b{-EL}] [@b{-EB}] [@b{-n}] [@b{-O}[@var{optimization level}]] + [@b{-nocpp}] [@b{-EL}] [@b{-EB}] [@b{-O}[@var{optimization level}]] [@b{-g}[@var{debug level}]] [@b{-G} @var{num}] [@b{-KPIC}] [@b{-call_shared}] [@b{-non_shared}] [@b{-xgot}] [@b{--membedded-pic}] [@b{-mabi}=@var{ABI}] [@b{-32}] [@b{-n32}] [@b{-64}] [@b{-mfp32}] [@b{-mgp32}] [@b{-march}=@var{CPU}] [@b{-mtune}=@var{CPU}] [@b{-mips1}] [@b{-mips2}] - [@b{-mips3}] [@b{-mips4}] [@b{-mips5}] [@b{-mips32}] [@b{-mips64}] + [@b{-mips3}] [@b{-mips4}] [@b{-mips5}] [@b{-mips32}] [@b{-mips32r2}] + [@b{-mips64}] [@b{-mips64r2}] [@b{-construct-floats}] [@b{-no-construct-floats}] [@b{-trap}] [@b{-no-break}] [@b{-break}] [@b{-no-trap}] [@b{-mfix7000}] [@b{-mno-fix7000}] @@ -383,6 +364,7 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. [@b{-mips3d}] [@b{-no-mips3d}] [@b{-mdmx}] [@b{-no-mdmx}] [@b{-mdebug}] [@b{-no-mdebug}] + [@b{-mpdr}] [@b{-mno-pdr}] @end ifset @ifset MMIX @@ -434,6 +416,13 @@ gcc(1), ld(1), and the Info entries for @file{binutils} and @file{ld}. @ifset Z8000 @c Z8000 has no machine-dependent assembler options @end ifset +@ifset XTENSA + +@emph{Target Xtensa options:} + [@b{--[no-]density}] [@b{--[no-]relax}] [@b{--[no-]generics}] + [@b{--[no-]text-section-literals}] + [@b{--[no-]target-align}] [@b{--[no-]longcalls}] +@end ifset @c man end @end smallexample @@ -490,9 +479,16 @@ compiler output). Generate stabs debugging information for each assembler line. This may help debugging assembler code, if the debugger can handle it. +@item --gstabs+ +Generate stabs debugging information for each assembler line, with GNU +extensions that probably only gdb can handle, and that could make other +debuggers crash or refuse to read your program. This +may help debugging assembler code. Currently the only GNU extension is +the location of the current working directory at assembling time. + @item --gdwarf2 Generate DWARF2 debugging information for each assembler line. This -may help debugging assembler code, if the debugger can handle it. Note - this +may help debugging assembler code, if the debugger can handle it. Note---this option is only supported by some targets, not all of them. @item --help @@ -604,6 +600,8 @@ Specify which ARM processor variant is the target. Specify which ARM architecture variant is used by the target. @item -mfpu=@var{floating-point-format} Select which Floating Point architecture is the target. +@item -mfloat-abi=@var{abi} +Select which floating point ABI is in use. @item -mthumb Enable Thumb only instruction decoding. @item -mapcs-32 | -mapcs-26 | -mapcs-float | -mapcs-reentrant | -moabi @@ -670,9 +668,25 @@ error if necessary. @end table @end ifset +@ifset IP2K +The following options are available when @value{AS} is configured for the +Ubicom IP2K series. + +@table @gcctabopt + +@item -mip2022ext +Specifies that the extended IP2022 instructions are allowed. + +@item -mip2022 +Restores the default behaviour, which restricts the permitted instructions to +just the basic IP2022 ones. + +@end table +@end ifset + @ifset M32R The following options are available when @value{AS} is configured for the -Mitsubishi M32R series. +Renesas M32R (formerly Mitsubishi M32R) series. @table @gcctabopt @@ -776,10 +790,22 @@ Motorola 68HC11 or 68HC12 series. @table @gcctabopt -@item -m68hc11 | -m68hc12 +@item -m68hc11 | -m68hc12 | -m68hcs12 Specify what processor is the target. The default is defined by the configuration option when building the assembler. +@item -mshort +Specify to use the 16-bit integer ABI. + +@item -mlong +Specify to use the 32-bit integer ABI. + +@item -mshort-double +Specify to use the 32-bit double ABI. + +@item -mlong-double +Specify to use the 64-bit double ABI. + @item --force-long-branchs Relative branches are turned into absolute ones. This concerns conditional branches, unconditional branches and branches to a @@ -873,14 +899,19 @@ Generate ``little endian'' format output. @itemx -mips4 @itemx -mips5 @itemx -mips32 +@itemx -mips32r2 @itemx -mips64 +@itemx -mips64r2 Generate code for a particular @sc{mips} Instruction Set Architecture level. @samp{-mips1} is an alias for @samp{-march=r3000}, @samp{-mips2} is an alias for @samp{-march=r6000}, @samp{-mips3} is an alias for @samp{-march=r4000} and @samp{-mips4} is an alias for @samp{-march=r8000}. -@samp{-mips5}, @samp{-mips32}, and @samp{-mips64} correspond to generic -@samp{MIPS V}, @samp{MIPS32}, and @samp{MIPS64} ISA processors, -respectively. +@samp{-mips5}, @samp{-mips32}, @samp{-mips32r2}, @samp{-mips64}, and +@samp{-mips64r2} +correspond to generic +@samp{MIPS V}, @samp{MIPS32}, @samp{MIPS32 Release 2}, @samp{MIPS64}, +and @samp{MIPS64 Release 2} +ISA processors, respectively. @item -march=@var{CPU} Generate code for a particular @sc{mips} cpu. @@ -898,6 +929,10 @@ of an mfhi or mflo instruction occurs in the following two instructions. Cause stabs-style debugging output to go into an ECOFF-style .mdebug section instead of the standard ELF .stabs sections. +@item -mpdr +@itemx -mno-pdr +Control generation of @code{.pdr} sections. + @item -mgp32 @itemx -mfp32 The register sizes are normally inferred from the ISA and ABI, but these @@ -1011,6 +1046,45 @@ Assemble for a little endian target. See the info pages for documentation of the MMIX-specific options. @end ifset +@ifset XTENSA +The following options are available when @value{AS} is configured for +an Xtensa processor. + +@table @gcctabopt +@item --density | --no-density +Enable or disable use of instructions from the Xtensa code density +option. This is enabled by default when the Xtensa processor supports +the code density option. + +@item --relax | --no-relax +Enable or disable instruction relaxation. This is enabled by default. +Note: In the current implementation, these options also control whether +assembler optimizations are performed, making these options equivalent +to @option{--generics} and @option{--no-generics}. + +@item --generics | --no-generics +Enable or disable all assembler transformations of Xtensa instructions. +The default is @option{--generics}; +@option{--no-generics} should be used only in the rare cases when the +instructions must be exactly as specified in the assembly source. + +@item --text-section-literals | --no-text-section-literals +With @option{--text-@-section-@-literals}, literal pools are interspersed +in the text section. The default is +@option{--no-@-text-@-section-@-literals}, which places literals in a +separate section in the output file. + +@item --target-align | --no-target-align +Enable or disable automatic alignment to reduce branch penalties at the +expense of some code density. The default is @option{--target-@-align}. + +@item --longcalls | --no-longcalls +Enable or disable transformation of call instructions to allow calls +across a greater range of addresses. The default is +@option{--no-@-longcalls}. +@end table +@end ifset + @c man end @menu @@ -1055,16 +1129,18 @@ machine architecture manual for this information. @ifclear GENERIC @ifset H8/300 For information on the H8/300 machine instruction set, see @cite{H8/300 -Series Programming Manual} (Hitachi ADE--602--025). For the H8/300H, -see @cite{H8/300H Series Programming Manual} (Hitachi). +Series Programming Manual}. For the H8/300H, see @cite{H8/300H Series +Programming Manual} (Renesas). @end ifset @ifset H8/500 For information on the H8/500 machine instruction set, see @cite{H8/500 -Series Programming Manual} (Hitachi M21T001). +Series Programming Manual} (Renesas M21T001). @end ifset @ifset SH -For information on the Hitachi SH machine instruction set, see -@cite{SH-Microcomputer User's Manual} (Hitachi Micro Systems, Inc.). +For information on the Renesas (formerly Hitachi) / SuperH SH machine instruction set, +see @cite{SH-Microcomputer User's Manual} (Renesas) or +@cite{SH-4 32-bit CPU Core Architecture} (SuperH) and +@cite{SuperH (SH) 64-Bit RISC Series} (SuperH). @end ifset @ifset Z8000 For information on the Z8000 machine instruction set, see @cite{Z8000 CPU Technical Manual} @@ -1145,7 +1221,7 @@ are typically different in different file formats. @xref{Symbol Attributes,,Symbol Attributes}. @ifclear GENERIC @ifclear MULTI-OBJ -On the @value{TARGET}, @command{@value{AS}} is configured to produce +For the @value{TARGET} target, @command{@value{AS}} is configured to produce @value{OBJ-NAME} format object files. @end ifclear @c The following should exhaust all configs that set MULTI-OBJ, ideally @@ -1348,7 +1424,7 @@ because many of them aren't supposed to happen. This chapter describes command-line options available in @emph{all} versions of the @sc{gnu} assembler; @pxref{Machine Dependencies}, for options specific @ifclear GENERIC -to the @value{TARGET}. +to the @value{TARGET} target. @end ifclear @ifset GENERIC to particular machine architectures. @@ -1356,7 +1432,7 @@ to particular machine architectures. @c man begin DESCRIPTION -If you are invoking @command{@value{AS}} via the @sc{gnu} C compiler (version 2), +If you are invoking @command{@value{AS}} via the @sc{gnu} C compiler, you can use the @samp{-Wa} option to pass arguments through to the assembler. The assembler arguments must be separated from each other (and the @samp{-Wa}) by commas. For example: @@ -1367,7 +1443,7 @@ gcc -c -g -O -Wa,-alh,-L file.c @noindent This passes two options to the assembler: @samp{-alh} (emit a listing to -standard output with with high-level and assembly source) and @samp{-L} (retain +standard output with high-level and assembly source) and @samp{-L} (retain local symbols in the symbol table). Usually you do not need to use this @samp{-Wa} mechanism, since many compiler @@ -1479,7 +1555,7 @@ not work correctly. @end quotation @node I -@section @code{.include} search path: @option{-I} @var{path} +@section @code{.include} Search Path: @option{-I} @var{path} @kindex -I @var{path} @cindex paths for @code{.include} @@ -1558,7 +1634,7 @@ dump appears on the left hand side of the listing output. @kindex --listing-lhs-width2 @cindex Width of continuation lines of disassembly output Sets the maximum width, in words, of any further lines of the hex byte dump for -a given inut source line. If this value is not specified, it defaults to being +a given input source line. If this value is not specified, it defaults to being the same as the value specified for @samp{--listing-lhs-width}. If neither switch is used the default is to one. @@ -1708,7 +1784,7 @@ The i960 @code{.setreal} pseudo-op is not supported. @end itemize @node MD -@section Dependency tracking: @option{--MD} +@section Dependency Tracking: @option{--MD} @kindex --MD @cindex dependency tracking @@ -1772,8 +1848,8 @@ address displacements (because we do not have to cross between text and data section). We refrain from doing this simply for compatibility with older versions of @command{@value{AS}}. In future, @option{-R} may work this way. -@ifset COFF -When @command{@value{AS}} is configured for COFF output, +@ifset COFF-ELF +When @command{@value{AS}} is configured for COFF or ELF output, this option is only useful if you use sections named @samp{.text} and @samp{.data}. @end ifset @@ -1796,7 +1872,7 @@ Use @samp{--statistics} to display two statistics about the resources used by seconds). @node traditional-format -@section Compatible output: @option{--traditional-format} +@section Compatible Output: @option{--traditional-format} @kindex --traditional-format For some targets, the output of @command{@value{AS}} is different in some ways @@ -1825,8 +1901,8 @@ assembling compiler output. But programs written by people often cause @command{@value{AS}} to give a warning that a particular assumption was made. All such warnings are directed to the standard error file. -@kindex @samp{-W} -@kindex @samp{--no-warn} +@kindex -W +@kindex --no-warn @cindex suppressing warnings @cindex warnings, suppressing If you use the @option{-W} and @option{--no-warn} options, no warnings are issued. @@ -1834,13 +1910,13 @@ This only affects the warning messages: it does not change any particular of how @command{@value{AS}} assembles your file. Errors, which stop the assembly, are still reported. -@kindex @samp{--fatal-warnings} +@kindex --fatal-warnings @cindex errors, caused by warnings @cindex warnings, causing error If you use the @option{--fatal-warnings} option, @command{@value{AS}} considers files that generate warnings to be in error. -@kindex @samp{--warn} +@kindex --warn @cindex warnings, switching on You can switch these options off again by specifying @option{--warn}, which causes warnings to be output as usual. @@ -1906,7 +1982,7 @@ It does not do macro processing, include file handling, or anything else you may get from your C compiler's preprocessor. You can do include file processing with the @code{.include} directive (@pxref{Include,,@code{.include}}). You can use the @sc{gnu} C compiler driver -to get other ``CPP'' style preprocessing, by giving the input file a +to get other ``CPP'' style preprocessing by giving the input file a @samp{.S} suffix. @xref{Overall Options,, Options Controlling the Kind of Output, gcc.info, Using GNU CC}. @@ -1990,14 +2066,17 @@ is considered a comment and is ignored. The line comment character is @samp{;} for picoJava; @end ifset @ifset PPC -@samp{;} for Motorola PowerPC; +@samp{#} for Motorola PowerPC; @end ifset @ifset SH -@samp{!} for the Hitachi SH; +@samp{!} for the Renesas / SuperH SH; @end ifset @ifset SPARC @samp{!} on the SPARC; @end ifset +@ifset IP2K +@samp{#} on the ip2k; +@end ifset @ifset M32R @samp{#} on the m32r; @end ifset @@ -2019,6 +2098,9 @@ is considered a comment and is ignored. The line comment character is @ifset V850 @samp{#} on the V850; @end ifset +@ifset XTENSA +@samp{#} for Xtensa systems; +@end ifset see @ref{Machine Dependencies}. @refill @c FIXME What about i860? @@ -2114,7 +2196,7 @@ constants are an exception: they do not end statements. @ifset H8 A @dfn{statement} ends at a newline character (@samp{\n}); or (for the H8/300) a dollar sign (@samp{$}); or (for the -Hitachi-SH or the +Renesas-SH or the H8/500) a semicolon (@samp{;}). The newline or separator character is considered part of the preceding statement. Newlines and separators within character @@ -2339,8 +2421,7 @@ grave accent. A newline @end ifset @ifset H8 (or dollar sign @samp{$}, for the H8/300; or semicolon @samp{;} for the -Hitachi SH or -H8/500) +Renesas SH or H8/500) @end ifset @end ifset @end ifclear @@ -2444,7 +2525,7 @@ A letter, to tell @command{@value{AS}} the rest of the number is a flonum. @end ignore On the H8/300, H8/500, -Hitachi SH, +Renesas / SuperH SH, and AMD 29K architectures, the letter must be one of the letters @samp{DFPRSX} (in upper or lower case). @@ -2581,7 +2662,7 @@ the task of adjusting mentions of object-file addresses so they refer to the proper run-time addresses. @ifset H8 For the H8/300 and H8/500, -and for the Hitachi SH, +and for the Renesas / SuperH SH, @command{@value{AS}} pads sections if needed to ensure they end on a word (sixteen bit) boundary. @end ifset @@ -2591,9 +2672,9 @@ An object file written by @command{@value{AS}} has at least three sections, any of which may be empty. These are named @dfn{text}, @dfn{data} and @dfn{bss} sections. -@ifset COFF +@ifset COFF-ELF @ifset GENERIC -When it generates COFF output, +When it generates COFF or ELF output, @end ifset @command{@value{AS}} can also generate whatever other named sections you specify using the @samp{.section} directive (@pxref{Section,,@code{.section}}). @@ -2699,7 +2780,7 @@ use of @command{@value{AS}} and have no meaning except during assembly. @table @strong -@ifset COFF +@ifset COFF-ELF @cindex named sections @cindex sections, named @item named sections @@ -2712,15 +2793,15 @@ use of @command{@value{AS}} and have no meaning except during assembly. @end ifset These sections hold your program. @command{@value{AS}} and @code{@value{LD}} treat them as separate but equal sections. Anything you can say of one section is -true another. -@ifset aout-bout +true of another. +@c @ifset aout-bout When the program is running, however, it is customary for the text section to be unalterable. The text section is often shared among processes: it contains instructions, constants and the like. The data section of a running program is usually alterable: for example, C variables would be stored in the data section. -@end ifset +@c @end ifset @cindex bss section @item bss section @@ -2747,13 +2828,13 @@ the preceding sections. @cindex relocation example An idealized example of three relocatable sections follows. -@ifset COFF +@ifset COFF-ELF The example uses the traditional section names @samp{.text} and @samp{.data}. @end ifset Memory addresses are on the horizontal axis. @c TEXI2ROFF-KILL -@ifinfo +@ifnottex @c END TEXI2ROFF-KILL @smallexample +-----+----+--+ @@ -2774,10 +2855,10 @@ linked program: | |TTT|ttttt| |dddd|DDD|00000| addresses: 0 @dots{} @end smallexample @c TEXI2ROFF-KILL -@end ifinfo +@end ifnottex @need 5000 @tex - +\bigskip \line{\it Partial program \#1: \hfil} \line{\ibox{2.5cm}{\tt text}\ibox{2cm}{\tt data}\ibox{1cm}{\tt bss}\hfil} \line{\boxit{2.5cm}{\tt ttttt}\boxit{2cm}{\tt dddd}\boxit{1cm}{\tt 00}\hfil} @@ -2835,7 +2916,7 @@ it in the expr section. @cindex grouping data @ifset aout-bout Assembled bytes -@ifset COFF +@ifset COFF-ELF conventionally @end ifset fall into two sections: text and data. @@ -2875,7 +2956,7 @@ of @command{@value{AS}}.) @ifset H8 On the H8/300 and H8/500 platforms, each subsection is zero-padded to a word boundary (two bytes). -The same is true on the Hitachi SH. +The same is true on the Renesas SH. @end ifset @ifset I960 @c FIXME section padding (alignment)? @@ -2901,9 +2982,9 @@ data subsections as a data section. To specify which subsection you want subsequent statements assembled into, use a numeric argument to specify it, in a @samp{.text @var{expression}} or a @samp{.data @var{expression}} statement. -@ifset COFF +@ifset COFF-ELF @ifset GENERIC -When generating COFF output, you +When generating COFF or ELF output, you @end ifset @ifclear GENERIC You @@ -3032,10 +3113,9 @@ body of a symbol name, though not at its beginning. @ifset SPECIAL-SYMS @ifset H8 Symbol names begin with a letter or with one of @samp{._}. On the -Hitachi SH or the -H8/500, you can also use @code{$} in symbol names. That character may -be followed by any string of digits, letters, dollar signs (save on the -H8/300), and underscores. +Renesas SH or the H8/500, you can also use @code{$} in symbol names. That +character may be followed by any string of digits, letters, dollar signs (save +on the H8/300), and underscores. @end ifset @end ifset @@ -3591,6 +3671,9 @@ Some machine configurations provide additional directives. * Balign:: @code{.balign @var{abs-expr} , @var{abs-expr}} * Byte:: @code{.byte @var{expressions}} * Comm:: @code{.comm @var{symbol} , @var{length} } + +* CFI directives:: @code{.cfi_startproc}, @code{.cfi_endproc}, etc. + * Data:: @code{.data @var{subsection}} @ifset COFF * Def:: @code{.def @var{name}} @@ -3684,13 +3767,18 @@ Some machine configurations provide additional directives. * Sbttl:: @code{.sbttl "@var{subheading}"} @ifset COFF * Scl:: @code{.scl @var{class}} -* Section:: @code{.section @var{name}, @var{subsection}} +@end ifset +@ifset COFF-ELF +* Section:: @code{.section @var{name}} @end ifset * Set:: @code{.set @var{symbol}, @var{expression}} * Short:: @code{.short @var{expressions}} * Single:: @code{.single @var{flonums}} +@ifset COFF-ELF * Size:: @code{.size [@var{name} , @var{expression}]} +@end ifset + * Skip:: @code{.skip @var{size} , @var{fill}} * Sleb128:: @code{.sleb128 @var{expressions}} * Space:: @code{.space @var{size} , @var{fill}} @@ -3711,7 +3799,10 @@ Some machine configurations provide additional directives. * Text:: @code{.text @var{subsection}} * Title:: @code{.title "@var{heading}"} +@ifset COFF-ELF * Type:: @code{.type <@var{int} | @var{name} , @var{type description}>} +@end ifset + * Uleb128:: @code{.uleb128 @var{expressions}} @ifset COFF * Val:: @code{.val @var{addr}} @@ -3777,12 +3868,12 @@ required alignment; this can be useful if you want the alignment to be filled with no-op instructions when appropriate. The way the required alignment is specified varies from system to system. -For the a29k, hppa, m68k, m88k, w65, sparc, and Hitachi SH, and i386 using ELF -format, -the first expression is the +For the a29k, arc, hppa, i386 using ELF, i860, iq2000, m68k, m88k, or32, +s390, sparc, tic4x, tic80 and xtensa, the first expression is the alignment request in bytes. For example @samp{.align 8} advances the location counter until it is a multiple of 8. If the location counter -is already a multiple of 8, no change is needed. +is already a multiple of 8, no change is needed. For the tic54x, the +first expression is the alignment request in words. For other systems, including the i386 using a.out format, and the arm and strongarm, it is the @@ -3890,6 +3981,59 @@ The syntax for @code{.comm} differs slightly on the HPPA. The syntax is @samp{@var{symbol} .comm, @var{length}}; @var{symbol} is optional. @end ifset +@node CFI directives +@section @code{.cfi_startproc} +@cindex @code{cfi_startproc} directive +@code{.cfi_startproc} is used at the beginning of each function that +should have an entry in @code{.eh_frame}. It initializes some internal +data structures and emits architecture dependent initial CFI instructions. +Don't forget to close the function by +@code{.cfi_endproc}. + +@section @code{.cfi_endproc} +@cindex @code{cfi_endproc} directive +@code{.cfi_endproc} is used at the end of a function where it closes its +unwind entry previously opened by +@code{.cfi_startproc}. and emits it to @code{.eh_frame}. + +@section @code{.cfi_def_cfa @var{register}, @var{offset}} +@code{.cfi_def_cfa} defines a rule for computing CFA as: @i{take +address from @var{register} and add @var{offset} to it}. + +@section @code{.cfi_def_cfa_register @var{register}} +@code{.cfi_def_cfa_register} modifies a rule for computing CFA. From +now on @var{register} will be used instead of the old one. Offset +remains the same. + +@section @code{.cfi_def_cfa_offset @var{offset}} +@code{.cfi_def_cfa_offset} modifies a rule for computing CFA. Register +remains the same, but @var{offset} is new. Note that it is the +absolute offset that will be added to a defined register to compute +CFA address. + +@section @code{.cfi_adjust_cfa_offset @var{offset}} +Same as @code{.cfi_def_cfa_offset} but @var{offset} is a relative +value that is added/substracted from the previous offset. + +@section @code{.cfi_offset @var{register}, @var{offset}} +Previous value of @var{register} is saved at offset @var{offset} from +CFA. + +@section @code{.cfi_rel_offset @var{register}, @var{offset}} +Previous value of @var{register} is saved at offset @var{offset} from +the current CFA register. This is transformed to @code{.cfi_offset} +using the known displacement of the CFA register from the CFA. +This is often easier to use, because the number will match the +code it's annotating. + +@section @code{.cfi_window_save} +SPARC register window has been saved. + +@section @code{.cfi_escape} @var{expression}[, @dots{}] +Allows the user to add arbitrary bytes to the unwind info. One +might use this to add OS-specific CFI opcodes, or generic CFI +opcodes that GAS does not yet support. + @node Data @section @code{.data @var{subsection}} @@ -4049,7 +4193,9 @@ The syntax for @code{equ} on the HPPA is @section @code{.equiv @var{symbol}, @var{expression}} @cindex @code{equiv} directive The @code{.equiv} directive is like @code{.equ} and @code{.set}, except that -the assembler will signal an error if @var{symbol} is already defined. +the assembler will signal an error if @var{symbol} is already defined. Note a +symbol which has been referenced but not actually defined is considered to be +undefined. Except for the contents of the error message, this is roughly equivalent to @smallexample @@ -4154,7 +4300,7 @@ in @sc{ieee} format. @cindex @code{func} directive @code{.func} emits debugging information to denote function @var{name}, and is ignored unless the file is assembled with debugging enabled. -Only @samp{--gstabs} is currently supported. +Only @samp{--gstabs[+]} is currently supported. @var{label} is the entry point of the function and if omitted @var{name} prepended with the @samp{leading char} is used. @samp{leading char} is usually @code{_} or nothing, depending on the target. @@ -4185,8 +4331,8 @@ partial programs. You may need the HPPA-only @code{.EXPORT} directive as well. @node Hidden @section @code{.hidden @var{names}} -@cindex @code{.hidden} directive -@cindex Visibility +@cindex @code{hidden} directive +@cindex visibility This one of the ELF visibility directives. The other two are @code{.internal} (@pxref{Internal,,@code{.internal}}) and @code{.protected} (@pxref{Protected,,@code{.protected}}). @@ -4248,7 +4394,8 @@ The following variants of @code{.if} are also supported: @cindex @code{ifdef} directive @item .ifdef @var{symbol} Assembles the following section of code if the specified @var{symbol} -has been defined. +has been defined. Note a symbol which has been referenced but not yet defined +is considered to be undefined. @cindex @code{ifc} directive @item .ifc @var{string1},@var{string2} @@ -4294,7 +4441,8 @@ following section of code if the two strings are not the same. @item .ifndef @var{symbol} @itemx .ifnotdef @var{symbol} Assembles the following section of code if the specified @var{symbol} -has not been defined. Both spelling variants are equivalent. +has not been defined. Both spelling variants are equivalent. Note a symbol +which has been referenced but not yet defined is considered to be undefined. @cindex @code{ifne} directive @item .ifne @var{absolute expression} @@ -4350,7 +4498,7 @@ of target the assembly is for. @ifclear GENERIC @ifset H8 On the H8/500 and most forms of the H8/300, @code{.int} emits 16-bit -integers. On the H8/300H and the Hitachi SH, however, @code{.int} emits +integers. On the H8/300H and the Renesas SH, however, @code{.int} emits 32-bit integers. @end ifset @end ifclear @@ -4359,8 +4507,8 @@ integers. On the H8/300H and the Hitachi SH, however, @code{.int} emits @node Internal @section @code{.internal @var{names}} -@cindex @code{.internal} directive -@cindex Visibility +@cindex @code{internal} directive +@cindex visibility This one of the ELF visibility directives. The other two are @code{.hidden} (@pxref{Hidden,,@code{.hidden}}) and @code{.protected} (@pxref{Protected,,@code{.protected}}). @@ -4368,7 +4516,7 @@ This one of the ELF visibility directives. The other two are This directive overrides the named symbols default visibility (which is set by their binding: local, global or weak). The directive sets the visibility to @code{internal} which means that the symbols are considered to be @code{hidden} -(ie not visible to other components), and that some extra, processor specific +(i.e., not visible to other components), and that some extra, processor specific processing must also be performed upon the symbols as well. @end ifset @@ -4803,7 +4951,7 @@ undefined. @node Previous @section @code{.previous} -@cindex @code{.previous} directive +@cindex @code{previous} directive @cindex Section Stack This is one of the ELF section stack manipulation directives. The others are @code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}), @@ -4823,7 +4971,7 @@ the top section on the section stack. @node PopSection @section @code{.popsection} -@cindex @code{.popsection} directive +@cindex @code{popsection} directive @cindex Section Stack This is one of the ELF section stack manipulation directives. The others are @code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}), @@ -4846,8 +4994,8 @@ assembly. You must put @var{string} in double quotes. @node Protected @section @code{.protected @var{names}} -@cindex @code{.protected} directive -@cindex Visibility +@cindex @code{protected} directive +@cindex visibility This one of the ELF visibility directives. The other two are @code{.hidden} (@pxref{Hidden}) and @code{.internal} (@pxref{Internal}). @@ -4890,7 +5038,7 @@ expanded. @xref{Macro}. @node PushSection @section @code{.pushsection @var{name} , @var{subsection}} -@cindex @code{.pushsection} directive +@cindex @code{pushsection} directive @cindex Section Stack This is one of the ELF section stack manipulation directives. The others are @code{.section} (@pxref{Section}), @code{.subsection} (@pxref{SubSection}), @@ -4978,10 +5126,10 @@ accepts this directive but ignores it. @end ifset @end ifset +@ifset COFF-ELF @node Section -@section @code{.section @var{name}} (COFF version) +@section @code{.section @var{name}} -@cindex @code{section} directive @cindex named section Use the @code{.section} directive to assemble the following code into a section named @var{name}. @@ -4990,6 +5138,13 @@ This directive is only supported for targets that actually support arbitrarily named sections; on @code{a.out} targets, for example, it is not accepted, even with a standard @code{a.out} section name. +@ifset COFF +@ifset ELF +@c only print the extra heading if both COFF and ELF are set +@subheading COFF Version +@end ifset + +@cindex @code{section} directive (COFF version) For COFF targets, the @code{.section} directive is used in one of the following ways: @@ -5027,20 +5182,21 @@ will be as if no flags had been specified at all. If the optional argument to the @code{.section} directive is not quoted, it is taken as a subsegment number (@pxref{Sub-Sections}). +@end ifset - -@section @code{.section @var{name}} (ELF version) - -@cindex @code{section} directive -@cindex named section @ifset ELF +@ifset COFF +@c only print the extra heading if both COFF and ELF are set +@subheading ELF Version +@end ifset + @cindex Section Stack This is one of the ELF section stack manipulation directives. The others are @code{.subsection} (@pxref{SubSection}), @code{.pushsection} (@pxref{PushSection}), @code{.popsection} (@pxref{PopSection}), and @code{.previous} (@pxref{Previous}). -@end ifset +@cindex @code{section} directive (ELF version) For ELF targets, the @code{.section} directive is used like this: @smallexample @@ -5070,6 +5226,10 @@ section contains data section does not contain data (i.e., section only occupies space) @end table +Note on targets where the @code{@@} character is the start of a comment (eg +ARM) then another character is used instead. For example the ARM port uses the +@code{%} character. + If @var{flags} contains @code{M} flag, @var{type} argument must be specified as well as @var{entsize} argument. Sections with @code{M} flag but not @code{S} flag must contain fixed size constants, each @var{entsize} octets @@ -5104,6 +5264,8 @@ This directive replaces the current section and subsection. The replaced section and subsection are pushed onto the section stack. See the contents of the gas testsuite directory @code{gas/testsuite/gas/elf} for some examples of how this directive and the other section stack directives work. +@end ifset +@end ifset @node Set @section @code{.set @var{symbol}, @var{expression}} @@ -5164,27 +5326,52 @@ numbers in @sc{ieee} format. @end ifset @end ifclear +@ifset COFF-ELF @node Size -@section @code{.size} (COFF version) +@section @code{.size} -@cindex @code{size} directive -This directive is generated by compilers to include auxiliary debugging -information in the symbol table. It is only permitted inside -@code{.def}/@code{.endef} pairs. +This directive is used to set the size associated with a symbol. + +@ifset COFF +@ifset ELF +@c only print the extra heading if both COFF and ELF are set +@subheading COFF Version +@end ifset + +@cindex @code{size} directive (COFF version) +For COFF targets, the @code{.size} directive is only permitted inside +@code{.def}/@code{.endef} pairs. It is used like this: + +@smallexample +.size @var{expression} +@end smallexample @ifset BOUT @samp{.size} is only meaningful when generating COFF format output; when @command{@value{AS}} is generating @code{b.out}, it accepts this directive but ignores it. @end ifset +@end ifset -@section @code{.size @var{name} , @var{expression}} (ELF version) -@cindex @code{size} directive +@ifset ELF +@ifset COFF +@c only print the extra heading if both COFF and ELF are set +@subheading ELF Version +@end ifset + +@cindex @code{size} directive (ELF version) +For ELF targets, the @code{.size} directive is used like this: -This directive is used to set the size associated with a symbol @var{name}. +@smallexample +.size @var{name} , @var{expression} +@end smallexample + +This directive sets the size associated with a symbol @var{name}. The size in bytes is computed from @var{expression} which can make use of label arithmetic. This directive is typically used to set the size of function symbols. +@end ifset +@end ifset @node Sleb128 @section @code{.sleb128 @var{expressions}} @@ -5342,7 +5529,7 @@ before further assembly. @node SubSection @section @code{.subsection @var{name}} -@cindex @code{.subsection} directive +@cindex @code{subsection} directive @cindex Section Stack This is one of the ELF section stack manipulation directives. The others are @code{.section} (@pxref{Section}), @code{.pushsection} (@pxref{PushSection}), @@ -5449,27 +5636,54 @@ source file name and pagenumber) when generating assembly listings. This directive affects subsequent pages, as well as the current page if it appears within ten lines of the top of a page. +@ifset COFF-ELF @node Type -@section @code{.type @var{int}} (COFF version) +@section @code{.type} + +This directive is used to set the type of a symbol. + +@ifset COFF +@ifset ELF +@c only print the extra heading if both COFF and ELF are set +@subheading COFF Version +@end ifset @cindex COFF symbol type @cindex symbol type, COFF -@cindex @code{type} directive -This directive, permitted only within @code{.def}/@code{.endef} pairs, -records the integer @var{int} as the type attribute of a symbol table entry. +@cindex @code{type} directive (COFF version) +For COFF targets, this directive is permitted only within +@code{.def}/@code{.endef} pairs. It is used like this: + +@smallexample +.type @var{int} +@end smallexample + +This records the integer @var{int} as the type attribute of a symbol table +entry. @ifset BOUT @samp{.type} is associated only with COFF format output; when @command{@value{AS}} is configured for @code{b.out} output, it accepts this directive but ignores it. @end ifset +@end ifset -@section @code{.type @var{name} , @var{type description}} (ELF version) +@ifset ELF +@ifset COFF +@c only print the extra heading if both COFF and ELF are set +@subheading ELF Version +@end ifset @cindex ELF symbol type @cindex symbol type, ELF -@cindex @code{type} directive -This directive is used to set the type of symbol @var{name} to be either a +@cindex @code{type} directive (ELF version) +For ELF targets, the @code{.type} directive is used like this: + +@smallexample +.type @var{name} , @var{type description} +@end smallexample + +This sets the type of symbol @var{name} to be either a function symbol or an object symbol. There are five different syntaxes supported for the @var{type description} field, in order to provide compatibility with various other assemblers. The syntaxes supported are: @@ -5490,6 +5704,8 @@ compatibility with various other assemblers. The syntaxes supported are: .type STT_FUNCTION .type STT_OBJECT @end smallexample +@end ifset +@end ifset @node Uleb128 @section @code{.uleb128 @var{expressions}} @@ -5520,7 +5736,7 @@ configured for @code{b.out}, it accepts this directive but ignores it. @node Version @section @code{.version "@var{string}"} -@cindex @code{.version} +@cindex @code{version} directive This directive creates a @code{.note} section and places into it an ELF formatted note of type NT_VERSION. The note's name is set to @code{string}. @end ifset @@ -5529,14 +5745,14 @@ formatted note of type NT_VERSION. The note's name is set to @code{string}. @node VTableEntry @section @code{.vtable_entry @var{table}, @var{offset}} -@cindex @code{.vtable_entry} +@cindex @code{vtable_entry} This directive finds or creates a symbol @code{table} and creates a @code{VTABLE_ENTRY} relocation for it with an addend of @code{offset}. @node VTableInherit @section @code{.vtable_inherit @var{child}, @var{parent}} -@cindex @code{.vtable_inherit} +@cindex @code{vtable_inherit} This directive finds the symbol @code{child} and finds or creates the symbol @code{parent} and then creates a @code{VTABLE_INHERIT} relocation for the parent whose addend is the value of the child symbol. As a special case the @@ -5547,7 +5763,7 @@ parent name of @code{0} is treated as refering the @code{*ABS*} section. @node Weak @section @code{.weak @var{names}} -@cindex @code{.weak} +@cindex @code{weak} directive This directive sets the weak attribute on the comma separated list of symbol @code{names}. If the symbols do not already exist, they will be created. @end ifset @@ -5670,10 +5886,10 @@ subject, see the hardware manufacturer's manual. * D30V-Dependent:: D30V Dependent Features @end ifset @ifset H8/300 -* H8/300-Dependent:: Hitachi H8/300 Dependent Features +* H8/300-Dependent:: Renesas H8/300 Dependent Features @end ifset @ifset H8/500 -* H8/500-Dependent:: Hitachi H8/500 Dependent Features +* H8/500-Dependent:: Renesas H8/500 Dependent Features @end ifset @ifset HPPA * HPPA-Dependent:: HPPA Dependent Features @@ -5690,6 +5906,9 @@ subject, see the hardware manufacturer's manual. @ifset I960 * i960-Dependent:: Intel 80960 Dependent Features @end ifset +@ifset IP2K +* IP2K-Dependent:: IP2K Dependent Features +@end ifset @ifset M32R * M32R-Dependent:: M32R Dependent Features @end ifset @@ -5708,9 +5927,12 @@ subject, see the hardware manufacturer's manual. @ifset MMIX * MMIX-Dependent:: MMIX Dependent Features @end ifset +@ifset MSP430 +* MSP430-Dependent:: MSP430 Dependent Features +@end ifset @ifset SH -* SH-Dependent:: Hitachi SH Dependent Features -* SH64-Dependent:: Hitachi SH64 Dependent Features +* SH-Dependent:: Renesas / SuperH SH Dependent Features +* SH64-Dependent:: SuperH SH64 Dependent Features @end ifset @ifset PDP11 * PDP-11-Dependent:: PDP-11 Dependent Features @@ -5730,6 +5952,9 @@ subject, see the hardware manufacturer's manual. @ifset V850 * V850-Dependent:: V850 Dependent Features @end ifset +@ifset XTENSA +* Xtensa-Dependent:: Xtensa Dependent Features +@end ifset @ifset Z8000 * Z8000-Dependent:: Z8000 Dependent Features @end ifset @@ -5769,20 +5994,20 @@ subject, see the hardware manufacturer's manual. @include c-cris.texi @end ifset -@ifset Hitachi-all +@ifset Renesas-all @ifclear GENERIC @node Machine Dependencies @chapter Machine Dependent Features -The machine instruction sets are different on each Hitachi chip family, +The machine instruction sets are different on each Renesas chip family, and there are also some syntax differences among the families. This chapter describes the specific @command{@value{AS}} features for each family. @menu -* H8/300-Dependent:: Hitachi H8/300 Dependent Features -* H8/500-Dependent:: Hitachi H8/500 Dependent Features -* SH-Dependent:: Hitachi SH Dependent Features +* H8/300-Dependent:: Renesas H8/300 Dependent Features +* H8/500-Dependent:: Renesas H8/500 Dependent Features +* SH-Dependent:: Renesas SH Dependent Features @end menu @lowersections @end ifclear @@ -5828,6 +6053,10 @@ family. @include c-ia64.texi @end ifset +@ifset IP2K +@include c-ip2k.texi +@end ifset + @ifset M32R @include c-m32r.texi @end ifset @@ -5852,6 +6081,10 @@ family. @include c-mmix.texi @end ifset +@ifset MSP430 +@include c-msp430.texi +@end ifset + @ifset NS32K @include c-ns32k.texi @end ifset @@ -5893,6 +6126,10 @@ family. @include c-v850.texi @end ifset +@ifset XTENSA +@include c-xtensa.texi +@end ifset + @ifset GENERIC @c reverse effect of @down at top of generic Machine-Dep chapter @raisesections @@ -5919,7 +6156,7 @@ information that enables us to fix the bug. @end menu @node Bug Criteria -@section Have you found a bug? +@section Have You Found a Bug? @cindex bug criteria If you are not sure whether you have found a bug, here are some guidelines: @@ -5948,7 +6185,7 @@ of @command{@value{AS}} are welcome in any case. @end itemize @node Bug Reporting -@section How to report bugs +@section How to Report Bugs @cindex bug reports @cindex assembler bugs, reporting @@ -5982,9 +6219,9 @@ it is new to us. Therefore, always write your bug reports on the assumption that the bug has not been reported previously. Sometimes people give a few sketchy facts and ask, ``Does this ring a -bell?'' Those bug reports are useless, and we urge everyone to -@emph{refuse to respond to them} except to chide the sender to report -bugs properly. +bell?'' This cannot help us fix a bug, so it is basically useless. We +respond by asking for enough details to enable us to investigate. +You might as well expedite matters by sending them to begin with. To enable us to fix the bug, you should include all these things: @@ -6145,7 +6382,7 @@ Keith Knowles at the Open Software Foundation wrote the original MIPS back end (which hasn't been merged in yet). Ralph Campbell worked with the MIPS code to support a.out format. -Support for the Zilog Z8k and Hitachi H8/300 and H8/500 processors (tc-z8k, +Support for the Zilog Z8k and Renesas H8/300 and H8/500 processors (tc-z8k, tc-h8300, tc-h8500), and IEEE 695 object file format (obj-ieee), was written by Steve Chamberlain of Cygnus Support. Steve also modified the COFF back end to use BFD for some low-level operations, for use with the H8/300 and AMD 29k @@ -6154,7 +6391,7 @@ targets. John Gilmore built the AMD 29000 support, added @code{.include} support, and simplified the configuration of which versions accept which directives. He updated the 68k machine description so that Motorola's opcodes always produced -fixed-size instructions (e.g. @code{jsr}), while synthetic instructions +fixed-size instructions (e.g., @code{jsr}), while synthetic instructions remained shrinkable (@code{jbsr}). John fixed many bugs, including true tested cross-compilation support, and one bug in relaxation that took a week and required the proverbial one-bit fix. @@ -6179,7 +6416,7 @@ Jeff Law at the University of Utah (HPPA mainly), Michael Meissner of the Open Software Foundation (i386 mainly), and Ken Raeburn of Cygnus Support (sparc, and some initial 64-bit support). -Linas Vepstas added GAS support for the ESA/390 "IBM 370" architecture. +Linas Vepstas added GAS support for the ESA/390 ``IBM 370'' architecture. Richard Henderson rewrote the Alpha assembler. Klaus Kaempf wrote GAS and BFD support for openVMS/Alpha. @@ -6187,6 +6424,9 @@ support for openVMS/Alpha. Timothy Wall, Michael Hayes, and Greg Smart contributed to the various tic* flavors. +David Heine, Sterling Augustine, Bob Wilson and John Ruttenberg from Tensilica, +Inc. added support for Xtensa processors. + Several engineers at Cygnus Support have also provided many small bug fixes and configuration enhancements. @@ -6195,368 +6435,7 @@ you have contributed significant work and are not mentioned on this list, and want to be, let us know. Some of the history has been lost; we are not intentionally leaving anyone out. -@node GNU Free Documentation License -@chapter 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. +@include fdl.texi @node Index @unnumbered Index diff --git a/contrib/binutils/gas/doc/c-alpha.texi b/contrib/binutils/gas/doc/c-alpha.texi index 5b52c5a..0aee06b 100644 --- a/contrib/binutils/gas/doc/c-alpha.texi +++ b/contrib/binutils/gas/doc/c-alpha.texi @@ -139,12 +139,12 @@ OpenVMS syntax, with a few differences for ELF. @cindex Alpha registers @cindex register names, Alpha -The 32 integer registers are refered to as @samp{$@var{n}} or +The 32 integer registers are referred to as @samp{$@var{n}} or @samp{$r@var{n}}. In addition, registers 15, 28, 29, and 30 may -be refered to by the symbols @samp{$fp}, @samp{$at}, @samp{$gp}, +be referred to by the symbols @samp{$fp}, @samp{$at}, @samp{$gp}, and @samp{$sp} respectively. -The 32 floating-point registers are refered to as @samp{$f@var{n}}. +The 32 floating-point registers are referred to as @samp{$f@var{n}}. @node Alpha-Relocs @subsection Relocations @@ -153,7 +153,7 @@ The 32 floating-point registers are refered to as @samp{$f@var{n}}. Some of these relocations are available for ECOFF, but mostly only for ELF. They are modeled after the relocation format -introduced in Digial Unix 4.0, but there are additions. +introduced in Digital Unix 4.0, but there are additions. The format is @samp{!@var{tag}} or @samp{!@var{tag}!@var{number}} where @var{tag} is the name of the relocation. In some cases @@ -379,6 +379,18 @@ to perform a load of the GP register; 2 indicates that @code{$27} is used in some non-standard way and so the linker cannot elide the load of the procedure vector during relaxation. +@item .usepv @var{function}, @var{which} +Used to indicate the use of the @code{$27} register, similar to +@code{.prologue}, but without the other semantics of needing to +be inside an open @code{.ent}/@code{.end} block. + +The @var{which} argument should be either @code{no}, indicating that +@code{$27} is not used, or @code{std}, indicating that the first two +instructions of the function perform a GP load. + +One might use this directive instead of @code{.prologue} if you are +also using dwarf2 CFI directives. + @item .gprel32 @var{expression} Computes the difference between the address in @var{expression} and the GP for the current object file, and stores it in 4 bytes. In addition @@ -413,7 +425,7 @@ is in effect. When @code{at} is in effect, a warning will be generated if @code{$at} is used by the programmer. @item macro -Enables the expasion of macro instructions. Note that variants of real +Enables the expansion of macro instructions. Note that variants of real instructions, such as @code{br label} vs @code{br $31,label} are considered alternate forms and not macros. diff --git a/contrib/binutils/gas/doc/c-arm.texi b/contrib/binutils/gas/doc/c-arm.texi index 022faa0..23cd7bb 100644 --- a/contrib/binutils/gas/doc/c-arm.texi +++ b/contrib/binutils/gas/doc/c-arm.texi @@ -1,4 +1,4 @@ -@c Copyright 1996, 1997, 1998, 1999, 2000, 2001 +@c Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003 @c Free Software Foundation, Inc. @c This is part of the GAS manual. @c For copying conditions, see the file as.texinfo. @@ -22,6 +22,7 @@ * ARM Floating Point:: Floating Point * ARM Directives:: ARM Machine Directives * ARM Opcodes:: Opcodes +* ARM Mapping Symbols:: Mapping Symbols @end menu @node ARM Options @@ -80,6 +81,8 @@ recognized: @code{arm940t}, @code{arm9tdmi}, @code{arm9e}, +@code{arm926e}, +@code{arm926ejs}, @code{arm946e-r0}, @code{arm946e}, @code{arm966e-r0}, @@ -88,9 +91,13 @@ recognized: @code{arm10e}, @code{arm1020}, @code{arm1020t}, -@code{arm1020e}, +@code{arm1020e}, +@code{arm1026ejs}, +@code{arm1136js}, +@code{arm1136jfs}, @code{ep9312} (ARM920 with Cirrus Maverick coprocessor), @code{i80200} (Intel XScale processor) +@code{iwmmxt} (Intel(r) XScale processor with Wireless MMX(tm) technology coprocessor) and @code{xscale}. The special name @code{all} may be used to allow the @@ -102,6 +109,7 @@ co-processor instruction space. For example, @code{-mcpu=arm920+maverick} is equivalent to specifying @code{-mcpu=ep9312}. The following extensions are currently supported: @code{+maverick} +@code{+iwmmxt} and @code{+xscale}. @@ -125,7 +133,10 @@ names are recognized: @code{armv5t}, @code{armv5txm}, @code{armv5te}, -@code{armv5texp} +@code{armv5texp}, +@code{armv6}, +@code{armv6j}, +@code{iwmmxt} and @code{xscale}. If both @code{-mcpu} and @@ -157,9 +168,11 @@ The following format options are recognized: @code{vfp10-r0}, @code{vfp9}, @code{vfpxd}, -@code{arm1020t} +@code{arm1020t}, +@code{arm1020e}, +@code{arm1136jfs} and -@code{arm1020e}. +@code{maverick}. In addition to determining which instructions are assembled, this option also affects the way in which the @code{.double} assembler directive behaves @@ -196,7 +209,7 @@ use this to determine the ABI being used by. @cindex @code{-mapcs-float} command line option, ARM @item -mapcs-float -This indicates the the floating point variant of the APCS should be +This indicates the floating point variant of the APCS should be used. In this variant floating point arguments are passed in FP registers rather than integer registers. @@ -205,6 +218,16 @@ registers rather than integer registers. This indicates that the reentrant variant of the APCS should be used. This variant supports position independent code. +@cindex @code{-mfloat-abi=} command line option, ARM +@item -mfloat-abi=@var{abi} +This option specifies that the output generated by the assembler should be +marked as using specified floating point ABI. +The following values are recognized: +@code{soft}, +@code{softfp} +and +@code{hard}. + @cindex @code{-EB} command line option, ARM @item -EB This option specifies that the output generated by the assembler should @@ -289,7 +312,7 @@ The ARM family uses @sc{ieee} floating-point numbers. This is the generic @var{.align} directive. For the ARM however if the first argument is zero (ie no alignment is needed) the assembler will behave as if the argument had been 2 (ie pad to the next four byte -boundary). This is for compatability with ARM's own assembler. +boundary). This is for compatibility with ARM's own assembler. @cindex @code{req} directive, ARM @item @var{name} .req @var{register name} @@ -300,6 +323,20 @@ example: foo .req r0 @end smallexample +@cindex @code{unreq} directive, ARM +@item .unreq @var{alias-name} +This undefines a register alias which was previously defined using the +@code{req} directive. For example: + +@smallexample + foo .req r0 + .unreq foo +@end smallexample + +An error occurs if the name is undefined. Note - this pseudo op can +be used to delete builtin in register name aliases (eg 'r0'). This +should only be done if it is really necessary. + @cindex @code{code} directive, ARM @item .code @code{[16|32]} This directive selects the instruction set being generated. The value 16 @@ -340,6 +377,14 @@ way that the @code{.thumb_func} directive does. This directive causes the current contents of the literal pool to be dumped into the current section (which is assumed to be the .text section) at the current location (aligned to a word boundary). +@code{GAS} maintains a separate literal pool for each section and each +sub-section. The @code{.ltorg} directive will only affect the literal +pool of the current section and sub-section. At the end of assembly +all remaining, un-empty literal pools will automatically be dumped. + +Note - older versions of @code{GAS} would dump the current literal +pool any time a section change occurred. This is no longer done, since +it prevents accurate control of the placement of literal pools. @cindex @code{.pool} directive, ARM @item .pool @@ -414,3 +459,32 @@ For information on the ARM or Thumb instruction sets, see @cite{ARM Software Development Toolkit Reference Manual}, Advanced RISC Machines Ltd. +@node ARM Mapping Symbols +@section Mapping Symbols + +The ARM ELF specification requires that special symbols be inserted +into object files to mark certain features: + +@table @code + +@cindex @code{$a} +@item $a +At the start of a region of code containing ARM instructions. + +@cindex @code{$t} +@item $t +At the start of a region of code containing THUMB instructions. + +@cindex @code{$d} +@item $d +At the start of a region of data. + +@end table + +The assembler will automatically insert these symbols for you - there +is no need to code them yourself. Support for tagging symbols ($b, +$f, $p and $m) which is also mentioned in the current ARM ELF +specification is not implemented. This is because they have been +dropped from the new EABI and so tools cannot rely upon their +presence. + diff --git a/contrib/binutils/gas/doc/c-i386.texi b/contrib/binutils/gas/doc/c-i386.texi index 1527c8d..f0047f9 100644 --- a/contrib/binutils/gas/doc/c-i386.texi +++ b/contrib/binutils/gas/doc/c-i386.texi @@ -61,6 +61,11 @@ These options are only available with the ELF object file format, and require that the necessary BFD support has been included (on a 32-bit platform you have to add --enable-64-bit-bfd to configure enable 64-bit usage and use x86-64 as target platform). + +@item -n +By default, x86 GAS replaces multiple nop instructions used for +alignment within code sections with multi-byte nop instructions such +as leal 0(%esi,1),%esi. This switch disables the optimization. @end table @node i386-Syntax diff --git a/contrib/binutils/gas/doc/c-ia64.texi b/contrib/binutils/gas/doc/c-ia64.texi index 0885f1b..b62c05e 100644 --- a/contrib/binutils/gas/doc/c-ia64.texi +++ b/contrib/binutils/gas/doc/c-ia64.texi @@ -44,7 +44,7 @@ flag in the ELF file header. This option instructs the assembler to mark the resulting object file as using the ``constant GP without function descriptor'' data model. This model is like the ``constant GP'' model, except that it -additionaly does away with function descriptors. What this means is +additionally does away with function descriptors. What this means is that the address of a function refers directly to the function's code entry-point. Normally, such an address would refer to a function descriptor, which contains both the code entry-point and the GP-value @@ -110,12 +110,12 @@ Reference Guide. @cindex IA-64 registers @cindex register names, IA-64 -The 128 integer registers are refered to as @samp{r@var{n}}. -The 128 floating-point registers are refered to as @samp{f@var{n}}. -The 128 application registers are refered to as @samp{ar@var{n}}. -The 128 control registers are refered to as @samp{cr@var{n}}. -The 64 one-bit predicate registers are refered to as @samp{p@var{n}}. -The 8 branch registers are refered to as @samp{b@var{n}}. +The 128 integer registers are referred to as @samp{r@var{n}}. +The 128 floating-point registers are referred to as @samp{f@var{n}}. +The 128 application registers are referred to as @samp{ar@var{n}}. +The 128 control registers are referred to as @samp{cr@var{n}}. +The 64 one-bit predicate registers are referred to as @samp{p@var{n}}. +The 8 branch registers are referred to as @samp{b@var{n}}. In addition, the assembler defines a number of aliases: @samp{gp} (@samp{r1}), @samp{sp} (@samp{r12}), @samp{rp} (@samp{b0}), @samp{ret0} (@samp{r8}), @samp{ret1} (@samp{r9}), @samp{ret2} (@samp{r10}), diff --git a/contrib/binutils/gas/doc/c-ppc.texi b/contrib/binutils/gas/doc/c-ppc.texi index 7fae6ed..be90e33 100644 --- a/contrib/binutils/gas/doc/c-ppc.texi +++ b/contrib/binutils/gas/doc/c-ppc.texi @@ -15,6 +15,7 @@ @cindex PowerPC support @menu * PowerPC-Opts:: Options +* PowerPC-Pseudo:: PowerPC Assembler Directives @end menu @node PowerPC-Opts @@ -48,6 +49,9 @@ Generate code for PowerPC 603/604. @item -m403, -m405 Generate code for PowerPC 403/405. +@item -m440 +Generate code for PowerPC 440. BookE and some 405 instructions. + @item -m7400, -m7410, -m7450, -m7455 Generate code for PowerPC 7400/7410/7450/7455. @@ -102,3 +106,21 @@ Generate code for Solaris. @item -mno-solaris Do not generate code for Solaris. @end table + + +@node PowerPC-Pseudo +@section PowerPC Assembler Directives + +@cindex directives for PowerPC +@cindex PowerPC directives +A number of assembler directives are available for PowerPC. The +following table is far from complete. + +@table @code +@item .machine "string" +This directive allows you to change the machine for which code is +generated. @code{"string"} may be any of the -m cpu selection options +(without the -m) enclosed in double quotes, @code{"push"}, or +@code{"pop"}. @code{.machine "push"} saves the currently selected +cpu, which may be restored with @code{.machine "pop"}. +@end table diff --git a/contrib/binutils/gas/doc/c-sh.texi b/contrib/binutils/gas/doc/c-sh.texi index df31844..b08f325 100644 --- a/contrib/binutils/gas/doc/c-sh.texi +++ b/contrib/binutils/gas/doc/c-sh.texi @@ -1,10 +1,10 @@ -@c Copyright 1991, 1992, 1993, 1994, 1995, 1997, 2001 +@c Copyright 1991, 1992, 1993, 1994, 1995, 1997, 2001, 2004 @c Free Software Foundation, Inc. @c This is part of the GAS manual. @c For copying conditions, see the file as.texinfo. @page @node SH-Dependent -@chapter Hitachi SH Dependent Features +@chapter Renesas / SuperH SH Dependent Features @cindex SH support @menu @@ -20,8 +20,8 @@ @cindex SH options @cindex options, SH -@code{@value{AS}} has following command-line options for the Hitachi -SH family. +@code{@value{AS}} has following command-line options for the Renesas +(formerly Hitachi) / SuperH SH family. @table @code @kindex -little @@ -29,6 +29,7 @@ SH family. @kindex -relax @kindex -small @kindex -dsp +@kindex -renesas @item -little Generate little endian code. @@ -45,6 +46,19 @@ Align sections to 4 byte boundaries, not 16. @item -dsp Enable sh-dsp insns, and disable sh3e / sh4 insns. +@item -renesas +Disable optimization with section symbol for compatibility with +Renesas assembler. + +@item -isa=sh4 | sh4a +Specify the sh4 or sh4a instruction set. +@item -isa=dsp +Enable sh-dsp insns, and disable sh3e / sh4 insns. +@item -isa=fp +Enable sh2e, sh3e, sh4, and sh4a insn sets. +@item -isa=all +Enable sh1, sh2, sh2e, sh3, sh3e, sh4, sh4a, and sh-dsp insn sets. + @end table @node SH Syntax @@ -155,9 +169,23 @@ Immediate data @cindex floating point, SH (@sc{ieee}) @cindex SH floating point (@sc{ieee}) -The SH family has no hardware floating point, but the @code{.float} -directive generates @sc{ieee} floating-point numbers for compatibility -with other development tools. +SH2E, SH3E and SH4 groups have on-chip floating-point unit (FPU). Other +SH groups can use @code{.float} directive to generate @sc{ieee} +floating-point numbers. + +SH2E and SH3E support single-precision floating point calculations as +well as entirely PCAPI compatible emulation of double-precision +floating point calculations. SH2E and SH3E instructions are a subset of +the floating point calculations conforming to the IEEE754 standard. + +In addition to single-precision and double-precision floating-point +operation capability, the on-chip FPU of SH4 has a 128-bit graphic +engine that enables 32-bit floating-point data to be processed 128 +bits at a time. It also supports 4 * 4 array operations and inner +product operations. Also, a superscalar architecture is employed that +enables simultaneous execution of two instructions (including FPU +instructions), providing performance of up to twice that of +conventional architectures at the same frequency. @node SH Directives @section SH Machine Directives @@ -183,7 +211,9 @@ with other development tools. @cindex mnemonics, SH @cindex instruction summary, SH For detailed information on the SH machine instruction set, see -@cite{SH-Microcomputer User's Manual} (Hitachi Micro Systems, Inc.). +@cite{SH-Microcomputer User's Manual} (Renesas) or +@cite{SH-4 32-bit CPU Core Architecture} (SuperH) and +@cite{SuperH (SH) 64-Bit RISC Series} (SuperH). @code{@value{AS}} implements all the standard SH opcodes. No additional pseudo-instructions are needed on this family. Note, however, that @@ -289,7 +319,7 @@ stc SR,Rn @end smallexample @end ifset -@ifset Hitachi-all +@ifset Renesas-all @ifclear GENERIC @raisesections @end ifclear diff --git a/contrib/binutils/gas/doc/c-sparc.texi b/contrib/binutils/gas/doc/c-sparc.texi index 624c21e3..c34950e 100644 --- a/contrib/binutils/gas/doc/c-sparc.texi +++ b/contrib/binutils/gas/doc/c-sparc.texi @@ -162,7 +162,7 @@ line is also ignored. This directive declares use of a global application or system register. It must be followed by a register name %g2, %g3, %g6 or %g7, comma and the symbol name for that register. If symbol name is @code{#scratch}, -it is a scratch register, if it is @code{#ignore}, it just surpresses any +it is a scratch register, if it is @code{#ignore}, it just suppresses any errors about using undeclared global register, but does not emit any information about it into the object file. This can be useful e.g. if you save the register before use and restore it after. diff --git a/contrib/binutils/gas/doc/gasver.texi b/contrib/binutils/gas/doc/gasver.texi new file mode 100644 index 0000000..3610a96 --- /dev/null +++ b/contrib/binutils/gas/doc/gasver.texi @@ -0,0 +1 @@ +@set VERSION 2.15 diff --git a/contrib/binutils/gas/doc/h8.texi b/contrib/binutils/gas/doc/h8.texi index 0df1714..6eb02f8 100644 --- a/contrib/binutils/gas/doc/h8.texi +++ b/contrib/binutils/gas/doc/h8.texi @@ -6,7 +6,7 @@ @clear BOUT @set COFF @clear ELF -@set Hitachi-all +@set Renesas-all @set H8/300 @set H8/500 @set SH @@ -19,7 +19,7 @@ @set GCC gcc @set LD ld @set TARGET H8/300 and H8/500 -@set TARGET H8/300, H8/500, and Hitachi SH +@set TARGET H8/300, H8/500, and Renesas SH @set OBJ-NAME COFF @c @clear have-stabs diff --git a/contrib/binutils/gas/doc/internals.texi b/contrib/binutils/gas/doc/internals.texi index 6bd3277..6719bbf 100644 --- a/contrib/binutils/gas/doc/internals.texi +++ b/contrib/binutils/gas/doc/internals.texi @@ -1,6 +1,6 @@ \input texinfo @c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -@c 2001 +@c 2001, 2002, 2003 @c Free Software Foundation, Inc. @setfilename internals.info @node Top @@ -704,9 +704,10 @@ processing. After this point, it is safe to operate on one chain per section. The assembler always has a current frag, named @code{frag_now}. More space is allocated for the current frag using the @code{frag_more} function; this -returns a pointer to the amount of requested space. Relaxing is done using -variant frags allocated by @code{frag_var} or @code{frag_variant} -(@pxref{Relaxation}). +returns a pointer to the amount of requested space. The function +@code{frag_room} says by how much the current frag can be extended. +Relaxing is done using variant frags allocated by @code{frag_var} +or @code{frag_variant} (@pxref{Relaxation}). @node GAS processing @section What GAS does when it runs @@ -1032,6 +1033,11 @@ arguments, the character before the @kbd{=} character, and the value of If you define this macro, it should return nonzero if the current input line pointer should be treated as the end of a line. +@item TC_CASE_SENSITIVE +@cindex TC_CASE_SENSITIVE +Define this macro if instruction mnemonics and pseudos are case sensitive. +The default is to have it undefined giving case insensitive names. + @item md_parse_name @cindex md_parse_name If this macro is defined, GAS will call it for any symbol found in an @@ -1250,18 +1256,94 @@ information removed. Depending upon the processing performed by @code{md_convert_frag} the frag information may or may not be necessary, as may the resolved values of the symbols. The default value is 1. -@item md_apply_fix3 -@cindex md_apply_fix3 -GAS will call this for each fixup. It should store the correct value in the -object file. @code{fixup_segment} performs a generic overflow check on the -@code{valueT *val} argument after @code{md_apply_fix3} returns. If the overflow -check is relevant for the target machine, then @code{md_apply_fix3} should -modify @code{valueT *val}, typically to the value stored in the object file. +@item TC_VALIDATE_FIX (@var{fixP}, @var{seg}, @var{skip}) +@cindex TC_VALIDATE_FIX +This macro is evaluated for each fixup (when @var{linkrelax} is not set). +It may be used to change the fixup in @code{struct fix *@var{fixP}} before +the generic code sees it, or to fully process the fixup. In the latter case, +a @code{goto @var{skip}} will bypass the generic code. -@item TC_HANDLES_FX_DONE -@cindex TC_HANDLES_FX_DONE -If this macro is defined, it means that @code{md_apply_fix3} correctly sets the -@code{fx_done} field in the fixup. +@item md_apply_fix3 (@var{fixP}, @var{valP}, @var{seg}) +@cindex md_apply_fix3 +GAS will call this for each fixup that passes the @code{TC_VALIDATE_FIX} test +when @var{linkrelax} is not set. It should store the correct value in the +object file. @code{struct fix *@var{fixP}} is the fixup @code{md_apply_fix3} +is operating on. @code{valueT *@var{valP}} is the value to store into the +object files, or at least is the generic code's best guess. Specifically, +*@var{valP} is the value of the fixup symbol, perhaps modified by +@code{MD_APPLY_SYM_VALUE}, plus @code{@var{fixP}->fx_offset} (symbol addend), +less @code{MD_PCREL_FROM_SECTION} for pc-relative fixups. +@code{segT @var{seg}} is the section the fix is in. +@code{fixup_segment} performs a generic overflow check on *@var{valP} after +@code{md_apply_fix3} returns. If the overflow check is relevant for the target +machine, then @code{md_apply_fix3} should modify *@var{valP}, typically to the +value stored in the object file. + +@item TC_FORCE_RELOCATION (@var{fix}) +@cindex TC_FORCE_RELOCATION +If this macro returns non-zero, it guarantees that a relocation will be emitted +even when the value can be resolved locally, as @code{fixup_segment} tries to +reduce the number of relocations emitted. For example, a fixup expression +against an absolute symbol will normally not require a reloc. If undefined, +a default of @w{@code{(S_FORCE_RELOC ((@var{fix})->fx_addsy))}} is used. + +@item TC_FORCE_RELOCATION_ABS (@var{fix}) +@cindex TC_FORCE_RELOCATION_ABS +Like @code{TC_FORCE_RELOCATION}, but used only for fixup expressions against an +absolute symbol. If undefined, @code{TC_FORCE_RELOCATION} will be used. + +@item TC_FORCE_RELOCATION_LOCAL (@var{fix}) +@cindex TC_FORCE_RELOCATION_LOCAL +Like @code{TC_FORCE_RELOCATION}, but used only for fixup expressions against a +symbol in the current section. If undefined, fixups that are not +@code{fx_pcrel} or @code{fx_plt} or for which @code{TC_FORCE_RELOCATION} +returns non-zero, will emit relocs. + +@item TC_FORCE_RELOCATION_SUB_SAME (@var{fix}, @var{seg}) +@cindex TC_FORCE_RELOCATION_SUB_SAME +This macro controls resolution of fixup expressions involving the +difference of two symbols in the same section. If this macro returns zero, +the subtrahend will be resolved and @code{fx_subsy} set to @code{NULL} for +@code{md_apply_fix3}. If undefined, the default of +@w{@code{! SEG_NORMAL (@var{seg}) || TC_FORCE_RELOCATION (@var{fix})}} will +be used. + +@item TC_FORCE_RELOCATION_SUB_ABS (@var{fix}) +@cindex TC_FORCE_RELOCATION_SUB_ABS +Like @code{TC_FORCE_RELOCATION_SUB_SAME}, but used when the subtrahend is an +absolute symbol. If the macro is undefined a default of @code{0} is used. + +@item TC_FORCE_RELOCATION_SUB_LOCAL (@var{fix}) +@cindex TC_FORCE_RELOCATION_SUB_LOCAL +Like @code{TC_FORCE_RELOCATION_SUB_ABS}, but the subtrahend is a symbol in the +same section as the fixup. + +@item TC_VALIDATE_FIX_SUB (@var{fix}) +@cindex TC_VALIDATE_FIX_SUB +This macro is evaluated for any fixup with a @code{fx_subsy} that +@code{fixup_segment} cannot reduce to a number. If the macro returns +@code{false} an error will be reported. + +@item MD_APPLY_SYM_VALUE (@var{fix}) +@cindex MD_APPLY_SYM_VALUE +This macro controls whether the symbol value becomes part of the value passed +to @code{md_apply_fix3}. If the macro is undefined, or returns non-zero, the +symbol value will be included. For ELF, a suitable definition might simply be +@code{0}, because ELF relocations don't include the symbol value in the addend. + +@item S_FORCE_RELOC (@var{sym}, @var{strict}) +@cindex S_FORCE_RELOC +This macro (or function, for @code{BFD_ASSEMBLER} gas) returns true for symbols +that should not be reduced to section symbols or eliminated from expressions, +because they may be overridden by the linker. ie. for symbols that are +undefined or common, and when @var{strict} is set, weak, or global (for ELF +assemblers that support ELF shared library linking semantics). + +@item EXTERN_FORCE_RELOC +@cindex EXTERN_FORCE_RELOC +This macro controls whether @code{S_FORCE_RELOC} returns true for global +symbols. If undefined, the default is @code{true} for ELF assemblers, and +@code{false} for non-ELF. @item tc_gen_reloc @cindex tc_gen_reloc @@ -1346,7 +1428,7 @@ colon, the adjoining tokens can be distinguished. This option affects the preprocessor so that whitespace around colons is preserved. This is useful when colons might be removed from the input after preprocessing but before assembling, so that adjoining tokens can still be distinguished if there is -whitespace, or concatentated if there is not. +whitespace, or concatenated if there is not. @item tc_frob_section @cindex tc_frob_section @@ -1362,7 +1444,7 @@ symbols. @item tc_frob_symbol @cindex tc_frob_symbol If you define this macro, GAS will call it for each symbol. You can indicate -that the symbol should not be included in the object file by definining this +that the symbol should not be included in the object file by defining this macro to set its second argument to a non-zero value. @item tc_frob_file @@ -1374,6 +1456,10 @@ completed, but before the relocations have been generated. If you define this macro, GAS will call it after the relocs have been generated. +@item md_post_relax_hook +If you define this macro, GAS will call it after relaxing and sizing the +segments. + @item LISTING_HEADER A string to use on the header line of a listing. The default value is simply @code{"GAS LISTING"}. @@ -1407,6 +1493,33 @@ The COFF @code{.section} directive will use the value of this macro to set a new section's attributes when a directive has no valid flags or when the flag is @code{w}. The default value of the macro is @code{SEC_LOAD | SEC_DATA}. +@item DWARF2_FORMAT () +@cindex DWARF2_FORMAT +If you define this, it should return one of @code{dwarf2_format_32bit}, +@code{dwarf2_format_64bit}, or @code{dwarf2_format_64bit_irix} to indicate +the size of internal DWARF section offsets and the format of the DWARF initial +length fields. When @code{dwarf2_format_32bit} is returned, the initial +length field will be 4 bytes long and section offsets are 32 bits in size. +For @code{dwarf2_format_64bit} and @code{dwarf2_format_64bit_irix}, section +offsets are 64 bits in size, but the initial length field differs. An 8 byte +initial length is indicated by @code{dwarf2_format_64bit_irix} and +@code{dwarf2_format_64bit} indicates a 12 byte initial length field in +which the first four bytes are 0xffffffff and the next 8 bytes are +the section's length. + +If you don't define this, @code{dwarf2_format_32bit} will be used as +the default. + +This define only affects @code{.debug_info} and @code{.debug_line} +sections generated by the assembler. DWARF 2 sections generated by +other tools will be unaffected by this setting. + +@item DWARF2_ADDR_SIZE (@var{bfd}) +@cindex DWARF2_ADDR_SIZE +It should return the size of an address, as it should be represented in +debugging info. If you don't define this macro, the default definition uses +the number of bits per address, as defined in @var{bfd}, divided by 8. + @end table @node Object format backend @@ -1449,16 +1562,10 @@ You should define this macro to copy object format specific information from one symbol to another. GAS will call it when one symbol is equated to another. -@item obj_fix_adjustable -@cindex obj_fix_adjustable -You may define this macro to indicate whether a fixup against a locally defined -symbol should be adjusted to be against the section symbol. It should return a -non-zero value if the adjustment is acceptable. - @item obj_sec_sym_ok_for_reloc @cindex obj_sec_sym_ok_for_reloc You may define this macro to indicate that it is OK to use a section symbol in -a relocateion entry. If it is not, GAS will define a new symbol at the start +a relocation entry. If it is not, GAS will define a new symbol at the start of a section. @item EMIT_SECTION_SYMBOLS @@ -1500,7 +1607,7 @@ symbols. @item obj_frob_symbol @cindex obj_frob_symbol If you define this macro, GAS will call it for each symbol. You can indicate -that the symbol should not be included in the object file by definining this +that the symbol should not be included in the object file by defining this macro to set its second argument to a non-zero value. @item obj_frob_file @@ -1562,7 +1669,7 @@ case, don't describe the smaller-range, inferior mode. The @code{fr_subtype} field of a frag is an index into a CPU-specific relaxation table. That table entry indicates the range of values that can be stored, the number of bytes that will have to be added to the frag to -accomodate the addressing mode, and the index of the next entry to examine if +accommodate the addressing mode, and the index of the next entry to examine if the value to be stored is outside the range accessible by the current addressing mode. The @code{fr_symbol} field of the frag indicates what symbol is to be accessed; the @code{fr_offset} field is added in. @@ -1639,7 +1746,7 @@ Usually, if the symbol is in the same section as the frag (given by the @var{sec} argument), the narrowest likely relaxation mode is stored in @code{fr_subtype}, and that's that. -If the symbol is undefined, or in a different section (and therefore moveable +If the symbol is undefined, or in a different section (and therefore movable to an arbitrarily large distance), the largest available relaxation mode is specified, @code{fix_new} is called to produce the relocation record, @code{fr_fix} is increased to include the relocated field (remember, this @@ -1650,7 +1757,7 @@ It can be accessed via @code{fr_opcode} or @code{fr_fix}. If you generate frags separately for the basic insn opcode and any relaxable operands, do not call @code{fix_new} thinking you can emit fixups for the -opcode field from the relaxable frag. It is not garanteed to be the same frag. +opcode field from the relaxable frag. It is not guaranteed to be the same frag. If you need to emit fixups for the opcode field from inspection of the relaxable frag, then you need to generate a common frag for both the basic opcode and relaxable fields, or you need to provide the frag for the opcode to diff --git a/contrib/binutils/gas/dw2gencfi.c b/contrib/binutils/gas/dw2gencfi.c new file mode 100644 index 0000000..ff0aa35 --- /dev/null +++ b/contrib/binutils/gas/dw2gencfi.c @@ -0,0 +1,1042 @@ +/* dw2gencfi.c - Support for generating Dwarf2 CFI information. + Copyright 2003 Free Software Foundation, Inc. + Contributed by Michal Ludvig + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#include "as.h" +#include "dw2gencfi.h" + + +/* We re-use DWARF2_LINE_MIN_INSN_LENGTH for the code alignment field + of the CIE. Default to 1 if not otherwise specified. */ +#ifndef DWARF2_LINE_MIN_INSN_LENGTH +# define DWARF2_LINE_MIN_INSN_LENGTH 1 +#endif + +/* If TARGET_USE_CFIPOP is defined, it is required that the target + provide the following definitions. Otherwise provide them to + allow compilation to continue. */ +#ifndef TARGET_USE_CFIPOP +# ifndef DWARF2_DEFAULT_RETURN_COLUMN +# define DWARF2_DEFAULT_RETURN_COLUMN 0 +# endif +# ifndef DWARF2_CIE_DATA_ALIGNMENT +# define DWARF2_CIE_DATA_ALIGNMENT 1 +# endif +#endif + +#ifndef EH_FRAME_ALIGNMENT +# ifdef BFD_ASSEMBLER +# define EH_FRAME_ALIGNMENT (bfd_get_arch_size (stdoutput) == 64 ? 3 : 2) +# else +# define EH_FRAME_ALIGNMENT 2 +# endif +#endif + +#ifndef tc_cfi_frame_initial_instructions +# define tc_cfi_frame_initial_instructions() ((void)0) +#endif + + +struct cfi_insn_data +{ + struct cfi_insn_data *next; + int insn; + union { + struct { + unsigned reg; + offsetT offset; + } ri; + + struct { + unsigned reg1; + unsigned reg2; + } rr; + + unsigned r; + offsetT i; + + struct { + symbolS *lab1; + symbolS *lab2; + } ll; + + struct cfi_escape_data { + struct cfi_escape_data *next; + expressionS exp; + } *esc; + } u; +}; + +struct fde_entry +{ + struct fde_entry *next; + symbolS *start_address; + symbolS *end_address; + struct cfi_insn_data *data; + struct cfi_insn_data **last; + unsigned int return_column; +}; + +struct cie_entry +{ + struct cie_entry *next; + symbolS *start_address; + unsigned int return_column; + struct cfi_insn_data *first, *last; +}; + + +/* Current open FDE entry. */ +static struct fde_entry *cur_fde_data; +static symbolS *last_address; +static offsetT cur_cfa_offset; + +/* List of FDE entries. */ +static struct fde_entry *all_fde_data; +static struct fde_entry **last_fde_data = &all_fde_data; + +/* List of CIEs so that they could be reused. */ +static struct cie_entry *cie_root; + +/* Stack of old CFI data, for save/restore. */ +struct cfa_save_data +{ + struct cfa_save_data *next; + offsetT cfa_offset; +}; + +static struct cfa_save_data *cfa_save_stack; + +/* Construct a new FDE structure and add it to the end of the fde list. */ + +static struct fde_entry * +alloc_fde_entry (void) +{ + struct fde_entry *fde = xcalloc (1, sizeof (struct fde_entry)); + + cur_fde_data = fde; + *last_fde_data = fde; + last_fde_data = &fde->next; + + fde->last = &fde->data; + fde->return_column = DWARF2_DEFAULT_RETURN_COLUMN; + + return fde; +} + +/* The following functions are available for a backend to construct its + own unwind information, usually from legacy unwind directives. */ + +/* Construct a new INSN structure and add it to the end of the insn list + for the currently active FDE. */ + +static struct cfi_insn_data * +alloc_cfi_insn_data (void) +{ + struct cfi_insn_data *insn = xcalloc (1, sizeof (struct cfi_insn_data)); + + *cur_fde_data->last = insn; + cur_fde_data->last = &insn->next; + + return insn; +} + +/* Construct a new FDE structure that begins at LABEL. */ + +void +cfi_new_fde (symbolS *label) +{ + struct fde_entry *fde = alloc_fde_entry (); + fde->start_address = label; + last_address = label; +} + +/* End the currently open FDE. */ + +void +cfi_end_fde (symbolS *label) +{ + cur_fde_data->end_address = label; + cur_fde_data = NULL; +} + +/* Set the return column for the current FDE. */ + +void +cfi_set_return_column (unsigned regno) +{ + cur_fde_data->return_column = regno; +} + +/* Universal functions to store new instructions. */ + +static void +cfi_add_CFA_insn(int insn) +{ + struct cfi_insn_data *insn_ptr = alloc_cfi_insn_data (); + + insn_ptr->insn = insn; +} + +static void +cfi_add_CFA_insn_reg (int insn, unsigned regno) +{ + struct cfi_insn_data *insn_ptr = alloc_cfi_insn_data (); + + insn_ptr->insn = insn; + insn_ptr->u.r = regno; +} + +static void +cfi_add_CFA_insn_offset (int insn, offsetT offset) +{ + struct cfi_insn_data *insn_ptr = alloc_cfi_insn_data (); + + insn_ptr->insn = insn; + insn_ptr->u.i = offset; +} + +static void +cfi_add_CFA_insn_reg_reg (int insn, unsigned reg1, unsigned reg2) +{ + struct cfi_insn_data *insn_ptr = alloc_cfi_insn_data (); + + insn_ptr->insn = insn; + insn_ptr->u.rr.reg1 = reg1; + insn_ptr->u.rr.reg2 = reg2; +} + +static void +cfi_add_CFA_insn_reg_offset (int insn, unsigned regno, offsetT offset) +{ + struct cfi_insn_data *insn_ptr = alloc_cfi_insn_data (); + + insn_ptr->insn = insn; + insn_ptr->u.ri.reg = regno; + insn_ptr->u.ri.offset = offset; +} + +/* Add a CFI insn to advance the PC from the last address to LABEL. */ + +void +cfi_add_advance_loc (symbolS *label) +{ + struct cfi_insn_data *insn = alloc_cfi_insn_data (); + + insn->insn = DW_CFA_advance_loc; + insn->u.ll.lab1 = last_address; + insn->u.ll.lab2 = label; + + last_address = label; +} + +/* Add a DW_CFA_offset record to the CFI data. */ + +void +cfi_add_CFA_offset (unsigned regno, offsetT offset) +{ + unsigned int abs_data_align; + + cfi_add_CFA_insn_reg_offset (DW_CFA_offset, regno, offset); + + abs_data_align = (DWARF2_CIE_DATA_ALIGNMENT < 0 + ? -DWARF2_CIE_DATA_ALIGNMENT : DWARF2_CIE_DATA_ALIGNMENT); + if (offset % abs_data_align) + as_bad (_("register save offset not a multiple of %u"), abs_data_align); +} + +/* Add a DW_CFA_def_cfa record to the CFI data. */ + +void +cfi_add_CFA_def_cfa (unsigned regno, offsetT offset) +{ + cfi_add_CFA_insn_reg_offset (DW_CFA_def_cfa, regno, offset); + cur_cfa_offset = offset; +} + +/* Add a DW_CFA_register record to the CFI data. */ + +void +cfi_add_CFA_register (unsigned reg1, unsigned reg2) +{ + cfi_add_CFA_insn_reg_reg (DW_CFA_register, reg1, reg2); +} + +/* Add a DW_CFA_def_cfa_register record to the CFI data. */ + +void +cfi_add_CFA_def_cfa_register (unsigned regno) +{ + cfi_add_CFA_insn_reg (DW_CFA_def_cfa_register, regno); +} + +/* Add a DW_CFA_def_cfa_offset record to the CFI data. */ + +void +cfi_add_CFA_def_cfa_offset (offsetT offset) +{ + cfi_add_CFA_insn_offset (DW_CFA_def_cfa_offset, offset); + cur_cfa_offset = offset; +} + +void +cfi_add_CFA_restore (unsigned regno) +{ + cfi_add_CFA_insn_reg (DW_CFA_restore, regno); +} + +void +cfi_add_CFA_undefined (unsigned regno) +{ + cfi_add_CFA_insn_reg (DW_CFA_undefined, regno); +} + +void +cfi_add_CFA_same_value (unsigned regno) +{ + cfi_add_CFA_insn_reg (DW_CFA_same_value, regno); +} + +void +cfi_add_CFA_remember_state (void) +{ + struct cfa_save_data *p; + + cfi_add_CFA_insn (DW_CFA_remember_state); + + p = xmalloc (sizeof (*p)); + p->cfa_offset = cur_cfa_offset; + p->next = cfa_save_stack; + cfa_save_stack = p; +} + +void +cfi_add_CFA_restore_state (void) +{ + struct cfa_save_data *p; + + cfi_add_CFA_insn (DW_CFA_restore_state); + + p = cfa_save_stack; + if (p) + { + cur_cfa_offset = p->cfa_offset; + cfa_save_stack = p->next; + free (p); + } +} + + +/* Parse CFI assembler directives. */ + +static void dot_cfi (int); +static void dot_cfi_escape (int); +static void dot_cfi_startproc (int); +static void dot_cfi_endproc (int); + +/* Fake CFI type; outside the byte range of any real CFI insn. */ +#define CFI_adjust_cfa_offset 0x100 +#define CFI_return_column 0x101 +#define CFI_rel_offset 0x102 +#define CFI_escape 0x103 + +const pseudo_typeS cfi_pseudo_table[] = + { + { "cfi_startproc", dot_cfi_startproc, 0 }, + { "cfi_endproc", dot_cfi_endproc, 0 }, + { "cfi_def_cfa", dot_cfi, DW_CFA_def_cfa }, + { "cfi_def_cfa_register", dot_cfi, DW_CFA_def_cfa_register }, + { "cfi_def_cfa_offset", dot_cfi, DW_CFA_def_cfa_offset }, + { "cfi_adjust_cfa_offset", dot_cfi, CFI_adjust_cfa_offset }, + { "cfi_offset", dot_cfi, DW_CFA_offset }, + { "cfi_rel_offset", dot_cfi, CFI_rel_offset }, + { "cfi_register", dot_cfi, DW_CFA_register }, + { "cfi_return_column", dot_cfi, CFI_return_column }, + { "cfi_restore", dot_cfi, DW_CFA_restore }, + { "cfi_undefined", dot_cfi, DW_CFA_undefined }, + { "cfi_same_value", dot_cfi, DW_CFA_same_value }, + { "cfi_remember_state", dot_cfi, DW_CFA_remember_state }, + { "cfi_restore_state", dot_cfi, DW_CFA_restore_state }, + { "cfi_window_save", dot_cfi, DW_CFA_GNU_window_save }, + { "cfi_escape", dot_cfi_escape, 0 }, + { NULL, NULL, 0 } + }; + +static void +cfi_parse_separator (void) +{ + SKIP_WHITESPACE (); + if (*input_line_pointer == ',') + input_line_pointer++; + else + as_bad (_("missing separator")); +} + +static unsigned +cfi_parse_reg (void) +{ + int regno; + expressionS exp; + +#ifdef tc_regname_to_dw2regnum + SKIP_WHITESPACE (); + if (is_name_beginner (*input_line_pointer) + || (*input_line_pointer == '%' + && is_name_beginner (*++input_line_pointer))) + { + char *name, c; + + name = input_line_pointer; + c = get_symbol_end (); + + if ((regno = tc_regname_to_dw2regnum (name)) < 0) + { + as_bad (_("bad register expression")); + regno = 0; + } + + *input_line_pointer = c; + return regno; + } +#endif + + expression (&exp); + switch (exp.X_op) + { + case O_register: + case O_constant: + regno = exp.X_add_number; + break; + + default: + as_bad (_("bad register expression")); + regno = 0; + break; + } + + return regno; +} + +static offsetT +cfi_parse_const (void) +{ + return get_absolute_expression (); +} + +static void +dot_cfi (int arg) +{ + offsetT offset; + unsigned reg1, reg2; + + if (!cur_fde_data) + { + as_bad (_("CFI instruction used without previous .cfi_startproc")); + return; + } + + /* If the last address was not at the current PC, advance to current. */ + if (symbol_get_frag (last_address) != frag_now + || S_GET_VALUE (last_address) != frag_now_fix ()) + cfi_add_advance_loc (symbol_temp_new_now ()); + + switch (arg) + { + case DW_CFA_offset: + reg1 = cfi_parse_reg (); + cfi_parse_separator (); + offset = cfi_parse_const (); + cfi_add_CFA_offset (reg1, offset); + break; + + case CFI_rel_offset: + reg1 = cfi_parse_reg (); + cfi_parse_separator (); + offset = cfi_parse_const (); + cfi_add_CFA_offset (reg1, offset - cur_cfa_offset); + break; + + case DW_CFA_def_cfa: + reg1 = cfi_parse_reg (); + cfi_parse_separator (); + offset = cfi_parse_const (); + cfi_add_CFA_def_cfa (reg1, offset); + break; + + case DW_CFA_register: + reg1 = cfi_parse_reg (); + cfi_parse_separator (); + reg2 = cfi_parse_reg (); + cfi_add_CFA_register (reg1, reg2); + break; + + case DW_CFA_def_cfa_register: + reg1 = cfi_parse_reg (); + cfi_add_CFA_def_cfa_register (reg1); + break; + + case DW_CFA_def_cfa_offset: + offset = cfi_parse_const (); + cfi_add_CFA_def_cfa_offset (offset); + break; + + case CFI_adjust_cfa_offset: + offset = cfi_parse_const (); + cfi_add_CFA_def_cfa_offset (cur_cfa_offset + offset); + break; + + case DW_CFA_restore: + reg1 = cfi_parse_reg (); + cfi_add_CFA_restore (reg1); + break; + + case DW_CFA_undefined: + reg1 = cfi_parse_reg (); + cfi_add_CFA_undefined (reg1); + break; + + case DW_CFA_same_value: + reg1 = cfi_parse_reg (); + cfi_add_CFA_same_value (reg1); + break; + + case CFI_return_column: + reg1 = cfi_parse_reg (); + cfi_set_return_column (reg1); + break; + + case DW_CFA_remember_state: + cfi_add_CFA_remember_state (); + break; + + case DW_CFA_restore_state: + cfi_add_CFA_restore_state (); + break; + + case DW_CFA_GNU_window_save: + cfi_add_CFA_insn (DW_CFA_GNU_window_save); + break; + + default: + abort (); + } + + demand_empty_rest_of_line (); +} + +static void +dot_cfi_escape (int ignored ATTRIBUTE_UNUSED) +{ + struct cfi_escape_data *head, **tail, *e; + struct cfi_insn_data *insn; + + if (!cur_fde_data) + { + as_bad (_("CFI instruction used without previous .cfi_startproc")); + return; + } + + /* If the last address was not at the current PC, advance to current. */ + if (symbol_get_frag (last_address) != frag_now + || S_GET_VALUE (last_address) != frag_now_fix ()) + cfi_add_advance_loc (symbol_temp_new_now ()); + + tail = &head; + do + { + e = xmalloc (sizeof (*e)); + do_parse_cons_expression (&e->exp, 1); + *tail = e; + tail = &e->next; + } + while (*input_line_pointer++ == ','); + *tail = NULL; + + insn = alloc_cfi_insn_data (); + insn->insn = CFI_escape; + insn->u.esc = head; +} + +static void +dot_cfi_startproc (int ignored ATTRIBUTE_UNUSED) +{ + int simple = 0; + + if (cur_fde_data) + { + as_bad (_("previous CFI entry not closed (missing .cfi_endproc)")); + return; + } + + cfi_new_fde (symbol_temp_new_now ()); + + SKIP_WHITESPACE (); + if (is_name_beginner (*input_line_pointer)) + { + char *name, c; + + name = input_line_pointer; + c = get_symbol_end (); + + if (strcmp (name, "simple") == 0) + { + simple = 1; + *input_line_pointer = c; + } + else + input_line_pointer = name; + } + demand_empty_rest_of_line (); + + if (!simple) + tc_cfi_frame_initial_instructions (); +} + +static void +dot_cfi_endproc (int ignored ATTRIBUTE_UNUSED) +{ + if (! cur_fde_data) + { + as_bad (_(".cfi_endproc without corresponding .cfi_startproc")); + return; + } + + cfi_end_fde (symbol_temp_new_now ()); +} + + +/* Emit a single byte into the current segment. */ + +static inline void +out_one (int byte) +{ + FRAG_APPEND_1_CHAR (byte); +} + +/* Emit a two-byte word into the current segment. */ + +static inline void +out_two (int data) +{ + md_number_to_chars (frag_more (2), data, 2); +} + +/* Emit a four byte word into the current segment. */ + +static inline void +out_four (int data) +{ + md_number_to_chars (frag_more (4), data, 4); +} + +/* Emit an unsigned "little-endian base 128" number. */ + +static void +out_uleb128 (addressT value) +{ + output_leb128 (frag_more (sizeof_leb128 (value, 0)), value, 0); +} + +/* Emit an unsigned "little-endian base 128" number. */ + +static void +out_sleb128 (offsetT value) +{ + output_leb128 (frag_more (sizeof_leb128 (value, 1)), value, 1); +} + +static void +output_cfi_insn (struct cfi_insn_data *insn) +{ + offsetT offset; + unsigned int regno; + + switch (insn->insn) + { + case DW_CFA_advance_loc: + { + symbolS *from = insn->u.ll.lab1; + symbolS *to = insn->u.ll.lab2; + + if (symbol_get_frag (to) == symbol_get_frag (from)) + { + addressT delta = S_GET_VALUE (to) - S_GET_VALUE (from); + addressT scaled = delta / DWARF2_LINE_MIN_INSN_LENGTH; + + if (scaled <= 0x3F) + out_one (DW_CFA_advance_loc + scaled); + else if (delta <= 0xFF) + { + out_one (DW_CFA_advance_loc1); + out_one (delta); + } + else if (delta <= 0xFFFF) + { + out_one (DW_CFA_advance_loc2); + out_two (delta); + } + else + { + out_one (DW_CFA_advance_loc4); + out_four (delta); + } + } + else + { + expressionS exp; + + exp.X_op = O_subtract; + exp.X_add_symbol = to; + exp.X_op_symbol = from; + exp.X_add_number = 0; + + /* The code in ehopt.c expects that one byte of the encoding + is already allocated to the frag. This comes from the way + that it scans the .eh_frame section looking first for the + .byte DW_CFA_advance_loc4. */ + frag_more (1); + + frag_var (rs_cfa, 4, 0, DWARF2_LINE_MIN_INSN_LENGTH << 3, + make_expr_symbol (&exp), frag_now_fix () - 1, + (char *) frag_now); + } + } + break; + + case DW_CFA_def_cfa: + offset = insn->u.ri.offset; + if (offset < 0) + { + out_one (DW_CFA_def_cfa_sf); + out_uleb128 (insn->u.ri.reg); + out_uleb128 (offset); + } + else + { + out_one (DW_CFA_def_cfa); + out_uleb128 (insn->u.ri.reg); + out_uleb128 (offset); + } + break; + + case DW_CFA_def_cfa_register: + case DW_CFA_undefined: + case DW_CFA_same_value: + out_one (insn->insn); + out_uleb128 (insn->u.r); + break; + + case DW_CFA_def_cfa_offset: + offset = insn->u.i; + if (offset < 0) + { + out_one (DW_CFA_def_cfa_offset_sf); + out_sleb128 (offset); + } + else + { + out_one (DW_CFA_def_cfa_offset); + out_uleb128 (offset); + } + break; + + case DW_CFA_restore: + regno = insn->u.r; + if (regno <= 0x3F) + { + out_one (DW_CFA_restore + regno); + } + else + { + out_one (DW_CFA_restore_extended); + out_uleb128 (regno); + } + break; + + case DW_CFA_offset: + regno = insn->u.ri.reg; + offset = insn->u.ri.offset / DWARF2_CIE_DATA_ALIGNMENT; + if (offset < 0) + { + out_one (DW_CFA_offset_extended_sf); + out_uleb128 (regno); + out_sleb128 (offset); + } + else if (regno <= 0x3F) + { + out_one (DW_CFA_offset + regno); + out_uleb128 (offset); + } + else + { + out_one (DW_CFA_offset_extended); + out_uleb128 (regno); + out_uleb128 (offset); + } + break; + + case DW_CFA_register: + out_one (DW_CFA_register); + out_uleb128 (insn->u.rr.reg1); + out_uleb128 (insn->u.rr.reg2); + break; + + case DW_CFA_remember_state: + case DW_CFA_restore_state: + out_one (insn->insn); + break; + + case DW_CFA_GNU_window_save: + out_one (DW_CFA_GNU_window_save); + break; + + case CFI_escape: + { + struct cfi_escape_data *e; + for (e = insn->u.esc; e ; e = e->next) + emit_expr (&e->exp, 1); + break; + } + + default: + abort (); + } +} + +static void +output_cie (struct cie_entry *cie) +{ + symbolS *after_size_address, *end_address; + expressionS exp; + struct cfi_insn_data *i; + + cie->start_address = symbol_temp_new_now (); + after_size_address = symbol_temp_make (); + end_address = symbol_temp_make (); + + exp.X_op = O_subtract; + exp.X_add_symbol = end_address; + exp.X_op_symbol = after_size_address; + exp.X_add_number = 0; + + emit_expr (&exp, 4); /* Length */ + symbol_set_value_now (after_size_address); + out_four (0); /* CIE id */ + out_one (DW_CIE_VERSION); /* Version */ + out_one ('z'); /* Augmentation */ + out_one ('R'); + out_one (0); + out_uleb128 (DWARF2_LINE_MIN_INSN_LENGTH); /* Code alignment */ + out_sleb128 (DWARF2_CIE_DATA_ALIGNMENT); /* Data alignment */ + out_one (cie->return_column); /* Return column */ + out_uleb128 (1); /* Augmentation size */ +#if defined DIFF_EXPR_OK || defined tc_cfi_emit_pcrel_expr + out_one (DW_EH_PE_pcrel | DW_EH_PE_sdata4); +#else + out_one (DW_EH_PE_sdata4); +#endif + + if (cie->first) + for (i = cie->first; i != cie->last; i = i->next) + output_cfi_insn (i); + + frag_align (2, 0, 0); + symbol_set_value_now (end_address); +} + +static void +output_fde (struct fde_entry *fde, struct cie_entry *cie, + struct cfi_insn_data *first, int align) +{ + symbolS *after_size_address, *end_address; + expressionS exp; + + after_size_address = symbol_temp_make (); + end_address = symbol_temp_make (); + + exp.X_op = O_subtract; + exp.X_add_symbol = end_address; + exp.X_op_symbol = after_size_address; + exp.X_add_number = 0; + emit_expr (&exp, 4); /* Length */ + symbol_set_value_now (after_size_address); + + exp.X_add_symbol = after_size_address; + exp.X_op_symbol = cie->start_address; + emit_expr (&exp, 4); /* CIE offset */ + +#ifdef DIFF_EXPR_OK + exp.X_add_symbol = fde->start_address; + exp.X_op_symbol = symbol_temp_new_now (); + emit_expr (&exp, 4); /* Code offset */ +#else + exp.X_op = O_symbol; + exp.X_add_symbol = fde->start_address; + exp.X_op_symbol = NULL; +#ifdef tc_cfi_emit_pcrel_expr + tc_cfi_emit_pcrel_expr (&exp, 4); /* Code offset */ +#else + emit_expr (&exp, 4); /* Code offset */ +#endif + exp.X_op = O_subtract; +#endif + + exp.X_add_symbol = fde->end_address; + exp.X_op_symbol = fde->start_address; /* Code length */ + emit_expr (&exp, 4); + + out_uleb128 (0); /* Augmentation size */ + + for (; first; first = first->next) + output_cfi_insn (first); + + frag_align (align, 0, 0); + symbol_set_value_now (end_address); +} + +static struct cie_entry * +select_cie_for_fde (struct fde_entry *fde, struct cfi_insn_data **pfirst) +{ + struct cfi_insn_data *i, *j; + struct cie_entry *cie; + + for (cie = cie_root; cie; cie = cie->next) + { + if (cie->return_column != fde->return_column) + continue; + for (i = cie->first, j = fde->data; + i != cie->last && j != NULL; + i = i->next, j = j->next) + { + if (i->insn != j->insn) + goto fail; + switch (i->insn) + { + case DW_CFA_advance_loc: + /* We reached the first advance in the FDE, but did not + reach the end of the CIE list. */ + goto fail; + + case DW_CFA_offset: + case DW_CFA_def_cfa: + if (i->u.ri.reg != j->u.ri.reg) + goto fail; + if (i->u.ri.offset != j->u.ri.offset) + goto fail; + break; + + case DW_CFA_register: + if (i->u.rr.reg1 != j->u.rr.reg1) + goto fail; + if (i->u.rr.reg2 != j->u.rr.reg2) + goto fail; + break; + + case DW_CFA_def_cfa_register: + case DW_CFA_restore: + case DW_CFA_undefined: + case DW_CFA_same_value: + if (i->u.r != j->u.r) + goto fail; + break; + + case DW_CFA_def_cfa_offset: + if (i->u.i != j->u.i) + goto fail; + break; + + case CFI_escape: + /* Don't bother matching these for now. */ + goto fail; + + default: + abort (); + } + } + + /* Success if we reached the end of the CIE list, and we've either + run out of FDE entries or we've encountered an advance. */ + if (i == cie->last && (!j || j->insn == DW_CFA_advance_loc)) + { + *pfirst = j; + return cie; + } + + fail:; + } + + cie = xmalloc (sizeof (struct cie_entry)); + cie->next = cie_root; + cie_root = cie; + cie->return_column = fde->return_column; + cie->first = fde->data; + + for (i = cie->first; i ; i = i->next) + if (i->insn == DW_CFA_advance_loc) + break; + + cie->last = i; + *pfirst = i; + + output_cie (cie); + + return cie; +} + +void +cfi_finish (void) +{ + segT cfi_seg; + struct fde_entry *fde; + int save_flag_traditional_format; + + if (cur_fde_data) + { + as_bad (_("open CFI at the end of file; missing .cfi_endproc directive")); + cur_fde_data->end_address = cur_fde_data->start_address; + } + + if (all_fde_data == 0) + return; + + /* Open .eh_frame section. */ + cfi_seg = subseg_new (".eh_frame", 0); +#ifdef BFD_ASSEMBLER + bfd_set_section_flags (stdoutput, cfi_seg, + SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_READONLY); +#endif + subseg_set (cfi_seg, 0); + record_alignment (cfi_seg, EH_FRAME_ALIGNMENT); + + /* Make sure check_eh_frame doesn't do anything with our output. */ + save_flag_traditional_format = flag_traditional_format; + flag_traditional_format = 1; + + for (fde = all_fde_data; fde ; fde = fde->next) + { + struct cfi_insn_data *first; + struct cie_entry *cie; + + cie = select_cie_for_fde (fde, &first); + output_fde (fde, cie, first, fde->next == NULL ? EH_FRAME_ALIGNMENT : 2); + } + + flag_traditional_format = save_flag_traditional_format; +} diff --git a/contrib/binutils/gas/dw2gencfi.h b/contrib/binutils/gas/dw2gencfi.h new file mode 100644 index 0000000..75b6ec2 --- /dev/null +++ b/contrib/binutils/gas/dw2gencfi.h @@ -0,0 +1,52 @@ +/* dw2gencfi.h - Support for generating Dwarf2 CFI information. + Copyright 2003 Free Software Foundation, Inc. + Contributed by Michal Ludvig + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#ifndef DW2GENCFI_H +#define DW2GENCFI_H + +#include "elf/dwarf2.h" + +struct symbol; + +extern const pseudo_typeS cfi_pseudo_table[]; + +/* cfi_finish() is called at the end of file. It will complain if + the last CFI wasn't properly closed by .cfi_endproc. */ +extern void cfi_finish (void); + +/* Entry points for backends to add unwind information. */ +extern void cfi_new_fde (struct symbol *); +extern void cfi_end_fde (struct symbol *); +extern void cfi_set_return_column (unsigned); +extern void cfi_add_advance_loc (struct symbol *); + +extern void cfi_add_CFA_offset (unsigned, offsetT); +extern void cfi_add_CFA_def_cfa (unsigned, offsetT); +extern void cfi_add_CFA_register (unsigned, unsigned); +extern void cfi_add_CFA_def_cfa_register (unsigned); +extern void cfi_add_CFA_def_cfa_offset (offsetT); +extern void cfi_add_CFA_restore (unsigned); +extern void cfi_add_CFA_undefined (unsigned); +extern void cfi_add_CFA_same_value (unsigned); +extern void cfi_add_CFA_remember_state (void); +extern void cfi_add_CFA_restore_state (void); + +#endif /* DW2GENCFI_H */ diff --git a/contrib/binutils/gas/dwarf2dbg.c b/contrib/binutils/gas/dwarf2dbg.c index a5dffab..3336453 100644 --- a/contrib/binutils/gas/dwarf2dbg.c +++ b/contrib/binutils/gas/dwarf2dbg.c @@ -1,5 +1,5 @@ /* dwarf2dbg.c - DWARF2 debug support - Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. Contributed by David Mosberger-Tang This file is part of GAS, the GNU Assembler. @@ -41,9 +41,19 @@ #endif #endif +#include "dwarf2dbg.h" +#include + +#ifndef DWARF2_FORMAT +# define DWARF2_FORMAT() dwarf2_format_32bit +#endif + +#ifndef DWARF2_ADDR_SIZE +# define DWARF2_ADDR_SIZE(bfd) (bfd_arch_bits_per_address (bfd) / 8) +#endif + #ifdef BFD_ASSEMBLER -#include "dwarf2dbg.h" #include "subsegs.h" #include "elf/dwarf2.h" @@ -122,7 +132,7 @@ struct line_seg { static struct line_seg *all_segs; struct file_entry { - char *filename; + const char *filename; unsigned int dir; }; @@ -131,51 +141,67 @@ static struct file_entry *files; static unsigned int files_in_use; static unsigned int files_allocated; -/* True when we've seen a .loc directive recently. Used to avoid +/* Table of directories used by .debug_line. */ +static char **dirs; +static unsigned int dirs_in_use; +static unsigned int dirs_allocated; + +/* TRUE when we've seen a .loc directive recently. Used to avoid doing work when there's nothing to do. */ -static boolean loc_directive_seen; +static bfd_boolean loc_directive_seen; /* Current location as indicated by the most recent .loc directive. */ static struct dwarf2_line_info current; -/* Fake label name. */ -static char const fake_label_name[] = ".L0\001"; - /* The size of an address on the target. */ static unsigned int sizeof_address; -static struct line_subseg *get_line_subseg PARAMS ((segT, subsegT)); -static unsigned int get_filenum PARAMS ((const char *)); -static struct frag *first_frag_for_seg PARAMS ((segT)); -static struct frag *last_frag_for_seg PARAMS ((segT)); -static void out_byte PARAMS ((int)); -static void out_opcode PARAMS ((int)); -static void out_two PARAMS ((int)); -static void out_four PARAMS ((int)); -static void out_abbrev PARAMS ((int, int)); -static void out_uleb128 PARAMS ((addressT)); -static symbolS *symbol_new_now PARAMS ((void)); -static void set_symbol_value_now PARAMS ((symbolS *)); -static offsetT get_frag_fix PARAMS ((fragS *)); -static void out_set_addr PARAMS ((segT, fragS *, addressT)); -static int size_inc_line_addr PARAMS ((int, addressT)); -static void emit_inc_line_addr PARAMS ((int, addressT, char *, int)); -static void out_inc_line_addr PARAMS ((int, addressT)); -static void relax_inc_line_addr PARAMS ((int, segT, fragS *, addressT, - fragS *, addressT)); -static void process_entries PARAMS ((segT, struct line_entry *)); -static void out_file_list PARAMS ((void)); -static void out_debug_line PARAMS ((segT)); -static void out_debug_aranges PARAMS ((segT, segT)); -static void out_debug_abbrev PARAMS ((segT)); -static void out_debug_info PARAMS ((segT, segT, segT)); +static struct line_subseg *get_line_subseg (segT, subsegT); +static unsigned int get_filenum (const char *, unsigned int); +static struct frag *first_frag_for_seg (segT); +static struct frag *last_frag_for_seg (segT); +static void out_byte (int); +static void out_opcode (int); +static void out_two (int); +static void out_four (int); +static void out_abbrev (int, int); +static void out_uleb128 (addressT); +static offsetT get_frag_fix (fragS *); +static void out_set_addr (segT, fragS *, addressT); +static int size_inc_line_addr (int, addressT); +static void emit_inc_line_addr (int, addressT, char *, int); +static void out_inc_line_addr (int, addressT); +static void relax_inc_line_addr (int, segT, fragS *, addressT, + fragS *, addressT); +static void process_entries (segT, struct line_entry *); +static void out_file_list (void); +static void out_debug_line (segT); +static void out_debug_aranges (segT, segT); +static void out_debug_abbrev (segT); +static void out_debug_info (segT, segT, segT); +#ifndef TC_DWARF2_EMIT_OFFSET +# define TC_DWARF2_EMIT_OFFSET generic_dwarf2_emit_offset +static void generic_dwarf2_emit_offset (symbolS *, unsigned int); + +/* Create an offset to .dwarf2_*. */ + +static void +generic_dwarf2_emit_offset (symbolS *symbol, unsigned int size) +{ + expressionS expr; + + expr.X_op = O_symbol; + expr.X_add_symbol = symbol; + expr.X_add_number = 0; + emit_expr (&expr, size); +} +#endif + /* Find or create an entry for SEG+SUBSEG in ALL_SEGS. */ static struct line_subseg * -get_line_subseg (seg, subseg) - segT seg; - subsegT subseg; +get_line_subseg (segT seg, subsegT subseg) { static segT last_seg; static subsegT last_subseg; @@ -221,12 +247,10 @@ get_line_subseg (seg, subseg) return ss; } -/* Record an entry for LOC ocurring at OFS within the current fragment. */ +/* Record an entry for LOC occurring at OFS within the current fragment. */ void -dwarf2_gen_line_info (ofs, loc) - addressT ofs; - struct dwarf2_line_info *loc; +dwarf2_gen_line_info (addressT ofs, struct dwarf2_line_info *loc) { struct line_subseg *ss; struct line_entry *e; @@ -260,14 +284,13 @@ dwarf2_gen_line_info (ofs, loc) } void -dwarf2_where (line) - struct dwarf2_line_info *line; +dwarf2_where (struct dwarf2_line_info *line) { if (debug_type == DEBUG_DWARF2) { char *filename; as_where (&filename, &line->line); - line->filenum = get_filenum (filename); + line->filenum = get_filenum (filename, 0); line->column = 0; line->flags = DWARF2_FLAG_BEGIN_STMT; } @@ -281,8 +304,7 @@ dwarf2_where (line) for, emit a line statement appropriately. */ void -dwarf2_emit_insn (size) - int size; +dwarf2_emit_insn (int size) { struct dwarf2_line_info loc; @@ -298,7 +320,7 @@ dwarf2_emit_insn (size) /* Unless we generate DWARF2 debugging information for each assembler line, we only emit one line symbol for one LOC. */ if (debug_type != DEBUG_DWARF2) - loc_directive_seen = false; + loc_directive_seen = FALSE; } else if (debug_type != DEBUG_DWARF2) return; @@ -308,22 +330,82 @@ dwarf2_emit_insn (size) dwarf2_gen_line_info (frag_now_fix () - size, &loc); } -/* Get a .debug_line file number for FILENAME. */ +/* Get a .debug_line file number for FILENAME. If NUM is nonzero, + allocate it on that file table slot, otherwise return the first + empty one. */ static unsigned int -get_filenum (filename) - const char *filename; +get_filenum (const char *filename, unsigned int num) { - static unsigned int last_used; - unsigned int i; + static unsigned int last_used, last_used_dir_len; + const char *file; + size_t dir_len; + unsigned int i, dir; - if (last_used) - if (strcmp (filename, files[last_used].filename) == 0) - return last_used; + if (num == 0 && last_used) + { + if (! files[last_used].dir + && strcmp (filename, files[last_used].filename) == 0) + return last_used; + if (files[last_used].dir + && strncmp (filename, dirs[files[last_used].dir], + last_used_dir_len) == 0 + && IS_DIR_SEPARATOR (filename [last_used_dir_len]) + && strcmp (filename + last_used_dir_len + 1, + files[last_used].filename) == 0) + return last_used; + } - for (i = 1; i < files_in_use; ++i) - if (strcmp (filename, files[i].filename) == 0) - return i; + file = lbasename (filename); + /* Don't make empty string from / or A: from A:/ . */ +#ifdef HAVE_DOS_BASED_FILE_SYSTEM + if (file <= filename + 3) + file = filename; +#else + if (file == filename + 1) + file = filename; +#endif + dir_len = file - filename; + + dir = 0; + if (dir_len) + { + --dir_len; + for (dir = 1; dir < dirs_in_use; ++dir) + if (strncmp (filename, dirs[dir], dir_len) == 0 + && dirs[dir][dir_len] == '\0') + break; + + if (dir >= dirs_in_use) + { + if (dir >= dirs_allocated) + { + dirs_allocated = dir + 32; + dirs = (char **) + xrealloc (dirs, (dir + 32) * sizeof (const char *)); + } + + dirs[dir] = xmalloc (dir_len + 1); + memcpy (dirs[dir], filename, dir_len); + dirs[dir][dir_len] = '\0'; + dirs_in_use = dir + 1; + } + } + + if (num == 0) + { + for (i = 1; i < files_in_use; ++i) + if (files[i].dir == dir + && files[i].filename + && strcmp (file, files[i].filename) == 0) + { + last_used = i; + last_used_dir_len = dir_len; + return i; + } + } + else + i = num; if (i >= files_allocated) { @@ -336,10 +418,11 @@ get_filenum (filename) memset (files + old, 0, (i + 32 - old) * sizeof (struct file_entry)); } - files[i].filename = xstrdup (filename); - files[i].dir = 0; + files[i].filename = num ? file : xstrdup (file); + files[i].dir = dir; files_in_use = i + 1; last_used = i; + last_used_dir_len = dir_len; return i; } @@ -351,8 +434,7 @@ get_filenum (filename) If an entry is added to the file table, return a pointer to the filename. */ char * -dwarf2_directive_file (dummy) - int dummy ATTRIBUTE_UNUSED; +dwarf2_directive_file (int dummy ATTRIBUTE_UNUSED) { offsetT num; char *filename; @@ -382,28 +464,13 @@ dwarf2_directive_file (dummy) return NULL; } - if (num >= (int) files_allocated) - { - unsigned int old = files_allocated; - - files_allocated = num + 16; - files = (struct file_entry *) - xrealloc (files, (num + 16) * sizeof (struct file_entry)); - - /* Zero the new memory. */ - memset (files + old, 0, (num + 16 - old) * sizeof (struct file_entry)); - } - - files[num].filename = filename; - files[num].dir = 0; - files_in_use = num + 1; + get_filenum (filename, num); return filename; } void -dwarf2_directive_loc (dummy) - int dummy ATTRIBUTE_UNUSED; +dwarf2_directive_loc (int dummy ATTRIBUTE_UNUSED) { offsetT filenum, line, column; @@ -430,20 +497,32 @@ dwarf2_directive_loc (dummy) current.column = column; current.flags = DWARF2_FLAG_BEGIN_STMT; - loc_directive_seen = true; + loc_directive_seen = TRUE; #ifndef NO_LISTING if (listing) { - listing_source_file (files[filenum].filename); + if (files[filenum].dir) + { + size_t dir_len = strlen (dirs[files[filenum].dir]); + size_t file_len = strlen (files[filenum].filename); + char *cp = (char *) alloca (dir_len + 1 + file_len + 1); + + memcpy (cp, dirs[files[filenum].dir], dir_len); + cp[dir_len] = '/'; + memcpy (cp + dir_len + 1, files[filenum].filename, file_len); + cp[dir_len + file_len + 1] = '\0'; + listing_source_file (cp); + } + else + listing_source_file (files[filenum].filename); listing_source_line (line); } #endif } static struct frag * -first_frag_for_seg (seg) - segT seg; +first_frag_for_seg (segT seg) { frchainS *f, *first = NULL; @@ -456,8 +535,7 @@ first_frag_for_seg (seg) } static struct frag * -last_frag_for_seg (seg) - segT seg; +last_frag_for_seg (segT seg) { frchainS *f, *last = NULL; @@ -472,8 +550,7 @@ last_frag_for_seg (seg) /* Emit a single byte into the current segment. */ static inline void -out_byte (byte) - int byte; +out_byte (int byte) { FRAG_APPEND_1_CHAR (byte); } @@ -481,8 +558,7 @@ out_byte (byte) /* Emit a statement program opcode into the current segment. */ static inline void -out_opcode (opc) - int opc; +out_opcode (int opc) { out_byte (opc); } @@ -490,8 +566,7 @@ out_opcode (opc) /* Emit a two-byte word into the current segment. */ static inline void -out_two (data) - int data; +out_two (int data) { md_number_to_chars (frag_more (2), data, 2); } @@ -499,8 +574,7 @@ out_two (data) /* Emit a four byte word into the current segment. */ static inline void -out_four (data) - int data; +out_four (int data) { md_number_to_chars (frag_more (4), data, 4); } @@ -508,8 +582,7 @@ out_four (data) /* Emit an unsigned "little-endian base 128" number. */ static void -out_uleb128 (value) - addressT value; +out_uleb128 (addressT value) { output_leb128 (frag_more (sizeof_leb128 (value, 0)), value, 0); } @@ -517,37 +590,16 @@ out_uleb128 (value) /* Emit a tuple for .debug_abbrev. */ static inline void -out_abbrev (name, form) - int name, form; +out_abbrev (int name, int form) { out_uleb128 (name); out_uleb128 (form); } -/* Create a new fake symbol whose value is the current position. */ - -static symbolS * -symbol_new_now () -{ - return symbol_new (fake_label_name, now_seg, frag_now_fix (), frag_now); -} - -/* Set the value of SYM to the current position in the current segment. */ - -static void -set_symbol_value_now (sym) - symbolS *sym; -{ - S_SET_SEGMENT (sym, now_seg); - S_SET_VALUE (sym, frag_now_fix ()); - symbol_set_frag (sym, frag_now); -} - /* Get the size of a fragment. */ static offsetT -get_frag_fix (frag) - fragS *frag; +get_frag_fix (fragS *frag) { frchainS *fr; @@ -559,11 +611,7 @@ get_frag_fix (frag) on some subsegment chain. */ for (fr = frchain_root; fr; fr = fr->frch_next) if (fr->frch_last == frag) - { - long align_mask = -1 << get_recorded_alignment (fr->frch_seg); - return (((char *) obstack_next_free (&fr->frch_obstack) - - frag->fr_literal) + ~align_mask) & align_mask; - } + return (char *) obstack_next_free (&fr->frch_obstack) - frag->fr_literal; abort (); } @@ -571,15 +619,12 @@ get_frag_fix (frag) /* Set an absolute address (may result in a relocation entry). */ static void -out_set_addr (seg, frag, ofs) - segT seg; - fragS *frag; - addressT ofs; +out_set_addr (segT seg, fragS *frag, addressT ofs) { expressionS expr; symbolS *sym; - sym = symbol_new (fake_label_name, seg, ofs, frag); + sym = symbol_temp_new (seg, ofs, frag); out_opcode (DW_LNS_extended_op); out_uleb128 (sizeof_address + 1); @@ -591,6 +636,25 @@ out_set_addr (seg, frag, ofs) emit_expr (&expr, sizeof_address); } +#if DWARF2_LINE_MIN_INSN_LENGTH > 1 +static void scale_addr_delta (addressT *); + +static void +scale_addr_delta (addressT *addr_delta) +{ + static int printed_this = 0; + if (*addr_delta % DWARF2_LINE_MIN_INSN_LENGTH != 0) + { + if (!printed_this) + as_bad("unaligned opcodes detected in executable segment"); + printed_this = 1; + } + *addr_delta /= DWARF2_LINE_MIN_INSN_LENGTH; +} +#else +#define scale_addr_delta(A) +#endif + /* Encode a pair of line and address skips as efficiently as possible. Note that the line skip is signed, whereas the address skip is unsigned. @@ -599,18 +663,13 @@ out_set_addr (seg, frag, ofs) exactly the expected number of bytes. */ static int -size_inc_line_addr (line_delta, addr_delta) - int line_delta; - addressT addr_delta; +size_inc_line_addr (int line_delta, addressT addr_delta) { unsigned int tmp, opcode; int len = 0; /* Scale the address delta by the minimum instruction length. */ -#if DWARF2_LINE_MIN_INSN_LENGTH > 1 - assert (addr_delta % DWARF2_LINE_MIN_INSN_LENGTH == 0); - addr_delta /= DWARF2_LINE_MIN_INSN_LENGTH; -#endif + scale_addr_delta (&addr_delta); /* INT_MAX is a signal that this is actually a DW_LNE_end_sequence. We cannot use special opcodes here, since we want the end_sequence @@ -663,21 +722,15 @@ size_inc_line_addr (line_delta, addr_delta) } static void -emit_inc_line_addr (line_delta, addr_delta, p, len) - int line_delta; - addressT addr_delta; - char *p; - int len; +emit_inc_line_addr (int line_delta, addressT addr_delta, char *p, int len) { unsigned int tmp, opcode; int need_copy = 0; char *end = p + len; -#if DWARF2_LINE_MIN_INSN_LENGTH > 1 /* Scale the address delta by the minimum instruction length. */ - assert (addr_delta % DWARF2_LINE_MIN_INSN_LENGTH == 0); - addr_delta /= DWARF2_LINE_MIN_INSN_LENGTH; -#endif + scale_addr_delta (&addr_delta); + /* INT_MAX is a signal that this is actually a DW_LNE_end_sequence. We cannot use special opcodes here, since we want the end_sequence to emit the matrix entry. */ @@ -760,9 +813,7 @@ emit_inc_line_addr (line_delta, addr_delta, p, len) /* Handy routine to combine calls to the above two routines. */ static void -out_inc_line_addr (line_delta, addr_delta) - int line_delta; - addressT addr_delta; +out_inc_line_addr (int line_delta, addressT addr_delta) { int len = size_inc_line_addr (line_delta, addr_delta); emit_inc_line_addr (line_delta, addr_delta, frag_more (len), len); @@ -772,18 +823,16 @@ out_inc_line_addr (line_delta, addr_delta) increments between fragments of the target segment. */ static void -relax_inc_line_addr (line_delta, seg, to_frag, to_ofs, from_frag, from_ofs) - int line_delta; - segT seg; - fragS *to_frag, *from_frag; - addressT to_ofs, from_ofs; +relax_inc_line_addr (int line_delta, segT seg, + fragS *to_frag, addressT to_ofs, + fragS *from_frag, addressT from_ofs) { symbolS *to_sym, *from_sym; expressionS expr; int max_chars; - to_sym = symbol_new (fake_label_name, seg, to_ofs, to_frag); - from_sym = symbol_new (fake_label_name, seg, from_ofs, from_frag); + to_sym = symbol_temp_new (seg, to_ofs, to_frag); + from_sym = symbol_temp_new (seg, from_ofs, from_frag); expr.X_op = O_subtract; expr.X_add_symbol = to_sym; @@ -803,8 +852,7 @@ relax_inc_line_addr (line_delta, seg, to_frag, to_ofs, from_frag, from_ofs) the relaxation loop. We set fr_subtype to the expected length. */ int -dwarf2dbg_estimate_size_before_relax (frag) - fragS *frag; +dwarf2dbg_estimate_size_before_relax (fragS *frag) { offsetT addr_delta; int size; @@ -822,8 +870,7 @@ dwarf2dbg_estimate_size_before_relax (frag) of the frag. This returns the change in frag length. */ int -dwarf2dbg_relax_frag (frag) - fragS *frag; +dwarf2dbg_relax_frag (fragS *frag) { int old_size, new_size; @@ -838,8 +885,7 @@ dwarf2dbg_relax_frag (frag) fr_subtype will be the desired length of the frag. */ void -dwarf2dbg_convert_frag (frag) - fragS *frag; +dwarf2dbg_convert_frag (fragS *frag) { offsetT addr_diff; @@ -863,9 +909,7 @@ dwarf2dbg_convert_frag (frag) beginning at E, for segment SEG. */ static void -process_entries (seg, e) - segT seg; - struct line_entry *e; +process_entries (segT seg, struct line_entry *e) { unsigned filenum = 1; unsigned line = 1; @@ -957,13 +1001,20 @@ process_entries (seg, e) /* Emit the directory and file tables for .debug_line. */ static void -out_file_list () +out_file_list (void) { size_t size; char *cp; unsigned int i; - /* Terminate directory list. */ + /* Emit directory list. */ + for (i = 1; i < dirs_in_use; ++i) + { + size = strlen (dirs[i]) + 1; + cp = frag_more (size); + memcpy (cp, dirs[i], size); + } + /* Terminate it. */ out_byte ('\0'); for (i = 1; i < files_in_use; ++i) @@ -971,6 +1022,8 @@ out_file_list () if (files[i].filename == NULL) { as_bad (_("unassigned file number %ld"), (long) i); + /* Prevent a crash later, particularly for file 1. */ + files[i].filename = ""; continue; } @@ -990,27 +1043,51 @@ out_file_list () /* Emit the collected .debug_line data. */ static void -out_debug_line (line_seg) - segT line_seg; +out_debug_line (segT line_seg) { expressionS expr; symbolS *line_start; symbolS *prologue_end; symbolS *line_end; struct line_seg *s; + enum dwarf2_format d2f; + int sizeof_offset; subseg_set (line_seg, 0); - line_start = symbol_new_now (); - prologue_end = symbol_make (fake_label_name); - line_end = symbol_make (fake_label_name); + line_start = symbol_temp_new_now (); + prologue_end = symbol_temp_make (); + line_end = symbol_temp_make (); /* Total length of the information for this compilation unit. */ expr.X_op = O_subtract; expr.X_add_symbol = line_end; expr.X_op_symbol = line_start; - expr.X_add_number = -4; - emit_expr (&expr, 4); + + d2f = DWARF2_FORMAT (); + if (d2f == dwarf2_format_32bit) + { + expr.X_add_number = -4; + emit_expr (&expr, 4); + sizeof_offset = 4; + } + else if (d2f == dwarf2_format_64bit) + { + expr.X_add_number = -12; + out_four (-1); + emit_expr (&expr, 8); + sizeof_offset = 8; + } + else if (d2f == dwarf2_format_64bit_irix) + { + expr.X_add_number = -8; + emit_expr (&expr, 8); + sizeof_offset = 8; + } + else + { + as_fatal (_("internal error: unknown dwarf2 format")); + } /* Version. */ out_two (2); @@ -1020,7 +1097,7 @@ out_debug_line (line_seg) expr.X_add_symbol = prologue_end; expr.X_op_symbol = line_start; expr.X_add_number = - (4 + 2 + 4); - emit_expr (&expr, 4); + emit_expr (&expr, sizeof_offset); /* Parameters of the state machine. */ out_byte (DWARF2_LINE_MIN_INSN_LENGTH); @@ -1042,21 +1119,19 @@ out_debug_line (line_seg) out_file_list (); - set_symbol_value_now (prologue_end); + symbol_set_value_now (prologue_end); /* For each section, emit a statement program. */ for (s = all_segs; s; s = s->next) process_entries (s->seg, s->head->head); - set_symbol_value_now (line_end); + symbol_set_value_now (line_end); } /* Emit data for .debug_aranges. */ static void -out_debug_aranges (aranges_seg, info_seg) - segT aranges_seg; - segT info_seg; +out_debug_aranges (segT aranges_seg, segT info_seg) { unsigned int addr_size = sizeof_address; addressT size, skip; @@ -1085,10 +1160,8 @@ out_debug_aranges (aranges_seg, info_seg) out_two (2); /* Offset to .debug_info. */ - expr.X_op = O_symbol; - expr.X_add_symbol = section_symbol (info_seg); - expr.X_add_number = 0; - emit_expr (&expr, 4); + /* ??? sizeof_offset */ + TC_DWARF2_EMIT_OFFSET (section_symbol (info_seg), 4); /* Size of an address (offset portion). */ out_byte (addr_size); @@ -1106,11 +1179,11 @@ out_debug_aranges (aranges_seg, info_seg) symbolS *beg, *end; frag = first_frag_for_seg (s->seg); - beg = symbol_new (fake_label_name, s->seg, 0, frag); + beg = symbol_temp_new (s->seg, 0, frag); s->text_start = beg; frag = last_frag_for_seg (s->seg); - end = symbol_new (fake_label_name, s->seg, get_frag_fix (frag), frag); + end = symbol_temp_new (s->seg, get_frag_fix (frag), frag); s->text_end = end; expr.X_op = O_symbol; @@ -1134,8 +1207,7 @@ out_debug_aranges (aranges_seg, info_seg) sync with out_debug_info below. */ static void -out_debug_abbrev (abbrev_seg) - segT abbrev_seg; +out_debug_abbrev (segT abbrev_seg) { subseg_set (abbrev_seg, 0); @@ -1161,10 +1233,7 @@ out_debug_abbrev (abbrev_seg) /* Emit a description of this compilation unit for .debug_info. */ static void -out_debug_info (info_seg, abbrev_seg, line_seg) - segT info_seg; - segT abbrev_seg; - segT line_seg; +out_debug_info (segT info_seg, segT abbrev_seg, segT line_seg) { char producer[128]; char *comp_dir; @@ -1173,27 +1242,49 @@ out_debug_info (info_seg, abbrev_seg, line_seg) symbolS *info_end; char *p; int len; + enum dwarf2_format d2f; + int sizeof_offset; subseg_set (info_seg, 0); - info_start = symbol_new_now (); - info_end = symbol_make (fake_label_name); + info_start = symbol_temp_new_now (); + info_end = symbol_temp_make (); /* Compilation Unit length. */ expr.X_op = O_subtract; expr.X_add_symbol = info_end; expr.X_op_symbol = info_start; - expr.X_add_number = -4; - emit_expr (&expr, 4); + + d2f = DWARF2_FORMAT (); + if (d2f == dwarf2_format_32bit) + { + expr.X_add_number = -4; + emit_expr (&expr, 4); + sizeof_offset = 4; + } + else if (d2f == dwarf2_format_64bit) + { + expr.X_add_number = -12; + out_four (-1); + emit_expr (&expr, 8); + sizeof_offset = 8; + } + else if (d2f == dwarf2_format_64bit_irix) + { + expr.X_add_number = -8; + emit_expr (&expr, 8); + sizeof_offset = 8; + } + else + { + as_fatal (_("internal error: unknown dwarf2 format")); + } /* DWARF version. */ out_two (2); /* .debug_abbrev offset */ - expr.X_op = O_symbol; - expr.X_add_symbol = section_symbol (abbrev_seg); - expr.X_add_number = 0; - emit_expr (&expr, 4); + TC_DWARF2_EMIT_OFFSET (section_symbol (abbrev_seg), sizeof_offset); /* Target address size. */ out_byte (sizeof_address); @@ -1202,10 +1293,8 @@ out_debug_info (info_seg, abbrev_seg, line_seg) out_uleb128 (1); /* DW_AT_stmt_list */ - expr.X_op = O_symbol; - expr.X_add_symbol = section_symbol (line_seg); - expr.X_add_number = 0; - emit_expr (&expr, 4); + /* ??? sizeof_offset */ + TC_DWARF2_EMIT_OFFSET (section_symbol (line_seg), 4); /* These two attributes may only be emitted if all of the code is contiguous. Multiple sections are not that. */ @@ -1230,6 +1319,13 @@ out_debug_info (info_seg, abbrev_seg, line_seg) entry was emitted, so this should always be defined. */ if (!files || files_in_use < 1) abort (); + if (files[1].dir) + { + len = strlen (dirs[files[1].dir]); + p = frag_more (len + 1); + memcpy (p, dirs[files[1].dir], len); + p[len] = '/'; + } len = strlen (files[1].filename) + 1; p = frag_more (len); memcpy (p, files[1].filename, len); @@ -1250,11 +1346,11 @@ out_debug_info (info_seg, abbrev_seg, line_seg) dwarf2 draft has no standard code for assembler. */ out_two (DW_LANG_Mips_Assembler); - set_symbol_value_now (info_end); + symbol_set_value_now (info_end); } void -dwarf2_finish () +dwarf2_finish (void) { segT line_seg; struct line_seg *s; @@ -1271,7 +1367,7 @@ dwarf2_finish () return; /* Calculate the size of an address for the target machine. */ - sizeof_address = bfd_arch_bits_per_address (stdoutput) / 8; + sizeof_address = DWARF2_ADDR_SIZE (stdoutput); /* Create and switch to the line number section. */ line_seg = subseg_new (".debug_line", 0); @@ -1351,11 +1447,12 @@ dwarf2_emit_insn (size) { } -void +char * dwarf2_directive_file (dummy) int dummy ATTRIBUTE_UNUSED; { s_app_file (0); + return NULL; } void diff --git a/contrib/binutils/gas/dwarf2dbg.h b/contrib/binutils/gas/dwarf2dbg.h index 62fc020..fe8bf27 100644 --- a/contrib/binutils/gas/dwarf2dbg.h +++ b/contrib/binutils/gas/dwarf2dbg.h @@ -36,7 +36,7 @@ struct dwarf2_line_info { /* Implements the .file FILENO "FILENAME" directive. FILENO can be 0 to indicate that no file number has been assigned. All real file number must be >0. */ -extern char *dwarf2_directive_file PARAMS ((int dummy)); +extern char *dwarf2_directive_file (int dummy); /* Implements the .loc FILENO LINENO [COLUMN] directive. FILENO is the file number, LINENO the line number and the (optional) COLUMN @@ -44,29 +44,41 @@ extern char *dwarf2_directive_file PARAMS ((int dummy)); corresponds to. FILENO can be 0 to indicate that the filename specified by the textually most recent .file directive should be used. */ -extern void dwarf2_directive_loc PARAMS ((int dummy)); +extern void dwarf2_directive_loc (int dummy); /* Returns the current source information. If .file directives have been encountered, the info for the corresponding source file is returned. Otherwise, the info for the assembly source file is returned. */ -extern void dwarf2_where PARAMS ((struct dwarf2_line_info *l)); +extern void dwarf2_where (struct dwarf2_line_info *l); /* This function generates .debug_line info based on the address and source information passed in the arguments. ADDR should be the frag-relative offset of the instruction the information is for and L is the source information that should be associated with that address. */ -extern void dwarf2_gen_line_info PARAMS ((addressT addr, - struct dwarf2_line_info *l)); +extern void dwarf2_gen_line_info (addressT addr, struct dwarf2_line_info *l); /* Must be called for each generated instruction. */ -extern void dwarf2_emit_insn PARAMS ((int)); - -extern void dwarf2_finish PARAMS ((void)); - -extern int dwarf2dbg_estimate_size_before_relax PARAMS ((fragS *)); -extern int dwarf2dbg_relax_frag PARAMS ((fragS *)); -extern void dwarf2dbg_convert_frag PARAMS ((fragS *)); +extern void dwarf2_emit_insn (int); + +extern void dwarf2_finish (void); + +extern int dwarf2dbg_estimate_size_before_relax (fragS *); +extern int dwarf2dbg_relax_frag (fragS *); +extern void dwarf2dbg_convert_frag (fragS *); + +/* An enumeration which describes the sizes of offsets (to DWARF sections) + and the mechanism by which the size is indicated. */ +enum dwarf2_format { + /* 32-bit format: the initial length field is 4 bytes long. */ + dwarf2_format_32bit, + /* DWARF3 64-bit format: the representation of the initial length + (of a DWARF section) is 0xffffffff (4 bytes) followed by eight + bytes indicating the actual length. */ + dwarf2_format_64bit, + /* SGI extension to DWARF2: The initial length is eight bytes. */ + dwarf2_format_64bit_irix +}; #endif /* AS_DWARF2DBG_H */ diff --git a/contrib/binutils/gas/ecoff.c b/contrib/binutils/gas/ecoff.c index 75e0479..1de823e 100644 --- a/contrib/binutils/gas/ecoff.c +++ b/contrib/binutils/gas/ecoff.c @@ -1408,76 +1408,74 @@ static char stabs_symbol[] = STABS_SYMBOL; /* Prototypes for functions defined in this file. */ -static void add_varray_page PARAMS ((varray_t *vp)); -static symint_t add_string PARAMS ((varray_t *vp, - struct hash_control *hash_tbl, - const char *str, - shash_t **ret_hash)); -static localsym_t *add_ecoff_symbol PARAMS ((const char *str, st_t type, - sc_t storage, symbolS *sym, - bfd_vma addend, symint_t value, - symint_t indx)); -static symint_t add_aux_sym_symint PARAMS ((symint_t aux_word)); -static symint_t add_aux_sym_rndx PARAMS ((int file_index, - symint_t sym_index)); -static symint_t add_aux_sym_tir PARAMS ((type_info_t *t, - hash_state_t state, - thash_t **hash_tbl)); -static tag_t *get_tag PARAMS ((const char *tag, localsym_t *sym, - bt_t basic_type)); -static void add_unknown_tag PARAMS ((tag_t *ptag)); -static void add_procedure PARAMS ((char *func)); -static void add_file PARAMS ((const char *file_name, int indx, int fake)); +static void add_varray_page (varray_t *vp); +static symint_t add_string (varray_t *vp, + struct hash_control *hash_tbl, + const char *str, + shash_t **ret_hash); +static localsym_t *add_ecoff_symbol (const char *str, st_t type, + sc_t storage, symbolS *sym, + bfd_vma addend, symint_t value, + symint_t indx); +static symint_t add_aux_sym_symint (symint_t aux_word); +static symint_t add_aux_sym_rndx (int file_index, symint_t sym_index); +static symint_t add_aux_sym_tir (type_info_t *t, + hash_state_t state, + thash_t **hash_tbl); +static tag_t *get_tag (const char *tag, localsym_t *sym, bt_t basic_type); +static void add_unknown_tag (tag_t *ptag); +static void add_procedure (char *func); +static void add_file (const char *file_name, int indx, int fake); #ifdef ECOFF_DEBUG -static char *sc_to_string PARAMS ((sc_t storage_class)); -static char *st_to_string PARAMS ((st_t symbol_type)); +static char *sc_to_string (sc_t storage_class); +static char *st_to_string (st_t symbol_type); #endif -static void mark_stabs PARAMS ((int)); -static char *ecoff_add_bytes PARAMS ((char **buf, char **bufend, - char *bufptr, unsigned long need)); +static void mark_stabs (int); +static char *ecoff_add_bytes (char **buf, char **bufend, + char *bufptr, unsigned long need); static unsigned long ecoff_padding_adjust - PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend, - unsigned long offset, char **bufptrptr)); + (const struct ecoff_debug_swap *backend, char **buf, char **bufend, + unsigned long offset, char **bufptrptr); static unsigned long ecoff_build_lineno - PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend, - unsigned long offset, long *linecntptr)); + (const struct ecoff_debug_swap *backend, char **buf, char **bufend, + unsigned long offset, long *linecntptr); static unsigned long ecoff_build_symbols - PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend, - unsigned long offset)); + (const struct ecoff_debug_swap *backend, char **buf, char **bufend, + unsigned long offset); static unsigned long ecoff_build_procs - PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend, - unsigned long offset)); + (const struct ecoff_debug_swap *backend, char **buf, char **bufend, + unsigned long offset); static unsigned long ecoff_build_aux - PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend, - unsigned long offset)); -static unsigned long ecoff_build_strings PARAMS ((char **buf, char **bufend, - unsigned long offset, - varray_t *vp)); + (const struct ecoff_debug_swap *backend, char **buf, char **bufend, + unsigned long offset); +static unsigned long ecoff_build_strings (char **buf, char **bufend, + unsigned long offset, + varray_t *vp); static unsigned long ecoff_build_ss - PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend, - unsigned long offset)); + (const struct ecoff_debug_swap *backend, char **buf, char **bufend, + unsigned long offset); static unsigned long ecoff_build_fdr - PARAMS ((const struct ecoff_debug_swap *backend, char **buf, char **bufend, - unsigned long offset)); -static void ecoff_setup_ext PARAMS ((void)); -static page_type *allocate_cluster PARAMS ((unsigned long npages)); -static page_type *allocate_page PARAMS ((void)); -static scope_t *allocate_scope PARAMS ((void)); -static void free_scope PARAMS ((scope_t *ptr)); -static vlinks_t *allocate_vlinks PARAMS ((void)); -static shash_t *allocate_shash PARAMS ((void)); -static thash_t *allocate_thash PARAMS ((void)); -static tag_t *allocate_tag PARAMS ((void)); -static void free_tag PARAMS ((tag_t *ptr)); -static forward_t *allocate_forward PARAMS ((void)); -static thead_t *allocate_thead PARAMS ((void)); -static void free_thead PARAMS ((thead_t *ptr)); -static lineno_list_t *allocate_lineno_list PARAMS ((void)); + (const struct ecoff_debug_swap *backend, char **buf, char **bufend, + unsigned long offset); +static void ecoff_setup_ext (void); +static page_type *allocate_cluster (unsigned long npages); +static page_type *allocate_page (void); +static scope_t *allocate_scope (void); +static void free_scope (scope_t *ptr); +static vlinks_t *allocate_vlinks (void); +static shash_t *allocate_shash (void); +static thash_t *allocate_thash (void); +static tag_t *allocate_tag (void); +static void free_tag (tag_t *ptr); +static forward_t *allocate_forward (void); +static thead_t *allocate_thead (void); +static void free_thead (thead_t *ptr); +static lineno_list_t *allocate_lineno_list (void); /* This function should be called when the assembler starts up. */ void -ecoff_read_begin_hook () +ecoff_read_begin_hook (void) { tag_hash = hash_new (); top_tag_head = allocate_thead (); @@ -1490,8 +1488,7 @@ ecoff_read_begin_hook () /* This function should be called when a symbol is created. */ void -ecoff_symbol_new_hook (symbolP) - symbolS *symbolP; +ecoff_symbol_new_hook (symbolS *symbolP) { OBJ_SYMFIELD_TYPE *obj; @@ -1512,8 +1509,7 @@ ecoff_symbol_new_hook (symbolP) /* Add a page to a varray object. */ static void -add_varray_page (vp) - varray_t *vp; /* varray to add page to */ +add_varray_page (varray_t *vp /* varray to add page to */) { vlinks_t *new_links = allocate_vlinks (); @@ -1543,11 +1539,10 @@ add_varray_page (vp) /* Add a string (and null pad) to one of the string tables. */ static symint_t -add_string (vp, hash_tbl, str, ret_hash) - varray_t *vp; /* string obstack */ - struct hash_control *hash_tbl; /* ptr to hash table */ - const char *str; /* string */ - shash_t **ret_hash; /* return hash pointer */ +add_string (varray_t *vp, /* string obstack */ + struct hash_control *hash_tbl, /* ptr to hash table */ + const char *str, /* string */ + shash_t **ret_hash /* return hash pointer */) { register unsigned long len = strlen (str); register shash_t *hash_ptr; @@ -1592,14 +1587,13 @@ add_string (vp, hash_tbl, str, ret_hash) /* Add debugging information for a symbol. */ static localsym_t * -add_ecoff_symbol (str, type, storage, sym_value, addend, value, indx) - const char *str; /* symbol name */ - st_t type; /* symbol type */ - sc_t storage; /* storage class */ - symbolS *sym_value; /* associated symbol. */ - bfd_vma addend; /* addend to sym_value. */ - symint_t value; /* value of symbol */ - symint_t indx; /* index to local/aux. syms */ +add_ecoff_symbol (const char *str, /* symbol name */ + st_t type, /* symbol type */ + sc_t storage, /* storage class */ + symbolS *sym_value, /* associated symbol. */ + bfd_vma addend, /* addend to sym_value. */ + symint_t value, /* value of symbol */ + symint_t indx /* index to local/aux. syms */) { localsym_t *psym; register scope_t *pscope; @@ -1798,8 +1792,7 @@ add_ecoff_symbol (str, type, storage, sym_value, addend, value, indx) for integral aux types, not just symints. */ static symint_t -add_aux_sym_symint (aux_word) - symint_t aux_word; /* auxiliary information word */ +add_aux_sym_symint (symint_t aux_word /* auxiliary information word */) { register varray_t *vp; register aux_t *aux_ptr; @@ -1822,9 +1815,7 @@ add_aux_sym_symint (aux_word) /* Add an auxiliary symbol (passing a file/symbol index combo). */ static symint_t -add_aux_sym_rndx (file_index, sym_index) - int file_index; - symint_t sym_index; +add_aux_sym_rndx (int file_index, symint_t sym_index) { register varray_t *vp; register aux_t *aux_ptr; @@ -1849,10 +1840,9 @@ add_aux_sym_rndx (file_index, sym_index) type qualifiers). */ static symint_t -add_aux_sym_tir (t, state, hash_tbl) - type_info_t *t; /* current type information */ - hash_state_t state; /* whether to hash type or not */ - thash_t **hash_tbl; /* pointer to hash table to use */ +add_aux_sym_tir (type_info_t *t, /* current type information */ + hash_state_t state, /* whether to hash type or not */ + thash_t **hash_tbl /* pointer to hash table to use */) { register varray_t *vp; register aux_t *aux_ptr; @@ -2006,10 +1996,9 @@ add_aux_sym_tir (t, state, hash_tbl) /* Add a tag to the tag table (unless it already exists). */ static tag_t * -get_tag (tag, sym, basic_type) - const char *tag; /* tag name */ - localsym_t *sym; /* tag start block */ - bt_t basic_type; /* bt_Struct, bt_Union, or bt_Enum */ +get_tag (const char *tag, /* tag name */ + localsym_t *sym, /* tag start block */ + bt_t basic_type /* bt_Struct, bt_Union, or bt_Enum */) { shash_t *hash_ptr; const char *err; @@ -2066,8 +2055,7 @@ get_tag (tag, sym, basic_type) /* Add an unknown {struct, union, enum} tag. */ static void -add_unknown_tag (ptag) - tag_t *ptag; /* pointer to tag information */ +add_unknown_tag (tag_t *ptag /* pointer to tag information */) { shash_t *hash_ptr = ptag->hash_ptr; char *name = hash_ptr->string; @@ -2116,8 +2104,7 @@ add_unknown_tag (ptag) this is the current procedure. */ static void -add_procedure (func) - char *func; /* func name */ +add_procedure (char *func /* func name */) { register varray_t *vp; register proc_t *new_proc_ptr; @@ -2177,7 +2164,7 @@ add_procedure (func) } symbolS * -ecoff_get_cur_proc_sym () +ecoff_get_cur_proc_sym (void) { return (cur_proc_ptr ? cur_proc_ptr->sym->as_sym : NULL); } @@ -2187,10 +2174,7 @@ ecoff_get_cur_proc_sym () where the current file structure lives. */ static void -add_file (file_name, indx, fake) - const char *file_name; /* file name */ - int indx ATTRIBUTE_UNUSED; - int fake; +add_file (const char *file_name, int indx ATTRIBUTE_UNUSED, int fake) { register int first_ch; register efdr_t *fil_ptr; @@ -2328,8 +2312,7 @@ add_file (file_name, indx, fake) compiler output, only in hand coded assembler. */ void -ecoff_new_file (name) - const char *name; +ecoff_new_file (const char *name) { if (cur_file_ptr != NULL && strcmp (cur_file_ptr->name, name) == 0) return; @@ -2424,8 +2407,7 @@ st_to_string (symbol_type) which gives the location of the start of the block. */ void -ecoff_directive_begin (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_begin (int ignore ATTRIBUTE_UNUSED) { char *name; char name_end; @@ -2462,8 +2444,7 @@ ecoff_directive_begin (ignore) which gives the location of the end of the block. */ void -ecoff_directive_bend (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_bend (int ignore ATTRIBUTE_UNUSED) { char *name; char name_end; @@ -2521,8 +2502,7 @@ static int coff_inside_enumeration; /* Handle a .def directive: start defining a symbol. */ void -ecoff_directive_def (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_def (int ignore ATTRIBUTE_UNUSED) { char *name; char name_end; @@ -2567,8 +2547,7 @@ ecoff_directive_def (ignore) more than that anyhow, so I will also make that assumption. */ void -ecoff_directive_dim (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_dim (int ignore ATTRIBUTE_UNUSED) { int dimens[N_TQ]; int i; @@ -2617,8 +2596,7 @@ ecoff_directive_dim (ignore) symbol. */ void -ecoff_directive_scl (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_scl (int ignore ATTRIBUTE_UNUSED) { long val; @@ -2642,8 +2620,7 @@ ecoff_directive_scl (ignore) never generate more than one argument. */ void -ecoff_directive_size (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_size (int ignore ATTRIBUTE_UNUSED) { int sizes[N_TQ]; int i; @@ -2692,8 +2669,7 @@ ecoff_directive_size (ignore) symbol. */ void -ecoff_directive_type (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_type (int ignore ATTRIBUTE_UNUSED) { long val; tq_t *tq_ptr; @@ -2761,8 +2737,7 @@ ecoff_directive_type (ignore) union or enum. */ void -ecoff_directive_tag (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_tag (int ignore ATTRIBUTE_UNUSED) { char *name; char name_end; @@ -2788,8 +2763,7 @@ ecoff_directive_tag (ignore) may be the name of a static or global symbol. */ void -ecoff_directive_val (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_val (int ignore ATTRIBUTE_UNUSED) { expressionS exp; @@ -2823,8 +2797,7 @@ ecoff_directive_val (ignore) debugging information for a symbol. */ void -ecoff_directive_endef (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_endef (int ignore ATTRIBUTE_UNUSED) { char *name; symint_t indx; @@ -2890,7 +2863,7 @@ ecoff_directive_endef (ignore) else if (coff_symbol_typ == st_Member && coff_type.num_sizes - coff_type.extra_sizes == 1) { - /* Is this a bitfield? This is indicated by a structure memeber + /* Is this a bitfield? This is indicated by a structure member having a size field that isn't an array. */ coff_type.bitfield = 1; } @@ -3003,8 +2976,7 @@ ecoff_directive_endef (ignore) /* Parse .end directives. */ void -ecoff_directive_end (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_end (int ignore ATTRIBUTE_UNUSED) { char *name; char name_end; @@ -3058,8 +3030,7 @@ ecoff_directive_end (ignore) /* Parse .ent directives. */ void -ecoff_directive_ent (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_ent (int ignore ATTRIBUTE_UNUSED) { char *name; char name_end; @@ -3109,8 +3080,7 @@ ecoff_directive_ent (ignore) /* Parse .extern directives. */ void -ecoff_directive_extern (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_extern (int ignore ATTRIBUTE_UNUSED) { char *name; int c; @@ -3134,8 +3104,7 @@ ecoff_directive_extern (ignore) /* Parse .file directives. */ void -ecoff_directive_file (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_file (int ignore ATTRIBUTE_UNUSED) { int indx; char *name; @@ -3161,8 +3130,7 @@ ecoff_directive_file (ignore) /* Parse .fmask directives. */ void -ecoff_directive_fmask (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_fmask (int ignore ATTRIBUTE_UNUSED) { long val; @@ -3190,8 +3158,7 @@ ecoff_directive_fmask (ignore) /* Parse .frame directives. */ void -ecoff_directive_frame (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_frame (int ignore ATTRIBUTE_UNUSED) { long val; @@ -3231,8 +3198,7 @@ ecoff_directive_frame (ignore) /* Parse .mask directives. */ void -ecoff_directive_mask (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_mask (int ignore ATTRIBUTE_UNUSED) { long val; @@ -3260,8 +3226,7 @@ ecoff_directive_mask (ignore) /* Parse .loc directives. */ void -ecoff_directive_loc (ignore) - int ignore ATTRIBUTE_UNUSED; +ecoff_directive_loc (int ignore ATTRIBUTE_UNUSED) { lineno_list_t *list; symint_t lineno; @@ -3341,9 +3306,7 @@ ecoff_directive_loc (ignore) information so that it points to the instruction after the nop. */ void -ecoff_fix_loc (old_frag, old_frag_offset) - fragS *old_frag; - unsigned long old_frag_offset; +ecoff_fix_loc (fragS *old_frag, unsigned long old_frag_offset) { if (last_lineno != NULL && last_lineno->frag == old_frag @@ -3357,8 +3320,7 @@ ecoff_fix_loc (old_frag, old_frag_offset) /* Make sure the @stabs symbol is emitted. */ static void -mark_stabs (ignore) - int ignore ATTRIBUTE_UNUSED; +mark_stabs (int ignore ATTRIBUTE_UNUSED) { if (! stabs_seen) { @@ -3375,8 +3337,7 @@ mark_stabs (ignore) #ifndef TC_MIPS /* For TC_MIPS use the version in tc-mips.c. */ void -ecoff_directive_weakext (ignore) - int ignore; +ecoff_directive_weakext (int ignore ATTRIBUTE_UNUSED) { char *name; int c; @@ -3454,13 +3415,12 @@ ecoff_directive_weakext (ignore) value a numeric value or an address. */ void -ecoff_stab (sec, what, string, type, other, desc) - segT sec ATTRIBUTE_UNUSED; - int what; - const char *string; - int type; - int other; - int desc; +ecoff_stab (segT sec ATTRIBUTE_UNUSED, + int what, + const char *string, + int type, + int other, + int desc) { efdr_t *save_file_ptr = cur_file_ptr; symbolS *sym; @@ -3609,8 +3569,7 @@ ecoff_stab (sec, what, string, type, other, desc) .scommon section rather than bfd_com_section. */ void -ecoff_frob_symbol (sym) - symbolS *sym; +ecoff_frob_symbol (symbolS *sym) { if (S_IS_COMMON (sym) && S_GET_VALUE (sym) > 0 @@ -3647,11 +3606,10 @@ ecoff_frob_symbol (sym) /* Add bytes to the symbolic information buffer. */ static char * -ecoff_add_bytes (buf, bufend, bufptr, need) - char **buf; - char **bufend; - char *bufptr; - unsigned long need; +ecoff_add_bytes (char **buf, + char **bufend, + char *bufptr, + unsigned long need) { unsigned long at; unsigned long want; @@ -3670,12 +3628,11 @@ ecoff_add_bytes (buf, bufend, bufptr, need) for the ECOFF target debugging information. */ static unsigned long -ecoff_padding_adjust (backend, buf, bufend, offset, bufptrptr) - const struct ecoff_debug_swap *backend; - char **buf; - char **bufend; - unsigned long offset; - char **bufptrptr; +ecoff_padding_adjust (const struct ecoff_debug_swap *backend, + char **buf, + char **bufend, + unsigned long offset, + char **bufptrptr) { bfd_size_type align; @@ -3699,12 +3656,11 @@ ecoff_padding_adjust (backend, buf, bufend, offset, bufptrptr) /* Build the line number information. */ static unsigned long -ecoff_build_lineno (backend, buf, bufend, offset, linecntptr) - const struct ecoff_debug_swap *backend; - char **buf; - char **bufend; - unsigned long offset; - long *linecntptr; +ecoff_build_lineno (const struct ecoff_debug_swap *backend, + char **buf, + char **bufend, + unsigned long offset, + long *linecntptr) { char *bufptr; register lineno_list_t *l; @@ -3929,14 +3885,13 @@ ecoff_build_lineno (backend, buf, bufend, offset, linecntptr) /* Build and swap out the symbols. */ static unsigned long -ecoff_build_symbols (backend, buf, bufend, offset) - const struct ecoff_debug_swap *backend; - char **buf; - char **bufend; - unsigned long offset; +ecoff_build_symbols (const struct ecoff_debug_swap *backend, + char **buf, + char **bufend, + unsigned long offset) { const bfd_size_type external_sym_size = backend->external_sym_size; - void (* const swap_sym_out) PARAMS ((bfd *, const SYMR *, PTR)) + void (* const swap_sym_out) (bfd *, const SYMR *, PTR) = backend->swap_sym_out; char *sym_out; long isym; @@ -4295,14 +4250,13 @@ ecoff_build_symbols (backend, buf, bufend, offset) /* Swap out the procedure information. */ static unsigned long -ecoff_build_procs (backend, buf, bufend, offset) - const struct ecoff_debug_swap *backend; - char **buf; - char **bufend; - unsigned long offset; +ecoff_build_procs (const struct ecoff_debug_swap *backend, + char **buf, + char **bufend, + unsigned long offset) { const bfd_size_type external_pdr_size = backend->external_pdr_size; - void (* const swap_pdr_out) PARAMS ((bfd *, const PDR *, PTR)) + void (* const swap_pdr_out) (bfd *, const PDR *, PTR) = backend->swap_pdr_out; char *pdr_out; long iproc; @@ -4386,11 +4340,10 @@ ecoff_build_procs (backend, buf, bufend, offset) /* Swap out the aux information. */ static unsigned long -ecoff_build_aux (backend, buf, bufend, offset) - const struct ecoff_debug_swap *backend; - char **buf; - char **bufend; - unsigned long offset; +ecoff_build_aux (const struct ecoff_debug_swap *backend, + char **buf, + char **bufend, + unsigned long offset) { int bigendian; union aux_ext *aux_out; @@ -4501,11 +4454,10 @@ ecoff_build_aux (backend, buf, bufend, offset) bytes copied, rather than the new offset. */ static unsigned long -ecoff_build_strings (buf, bufend, offset, vp) - char **buf; - char **bufend; - unsigned long offset; - varray_t *vp; +ecoff_build_strings (char **buf, + char **bufend, + unsigned long offset, + varray_t *vp) { unsigned long istr; char *str_out; @@ -4540,11 +4492,10 @@ ecoff_build_strings (buf, bufend, offset, vp) /* Dump out the local strings. */ static unsigned long -ecoff_build_ss (backend, buf, bufend, offset) - const struct ecoff_debug_swap *backend; - char **buf; - char **bufend; - unsigned long offset; +ecoff_build_ss (const struct ecoff_debug_swap *backend, + char **buf, + char **bufend, + unsigned long offset) { long iss; vlinks_t *file_link; @@ -4584,14 +4535,13 @@ ecoff_build_ss (backend, buf, bufend, offset) /* Swap out the file descriptors. */ static unsigned long -ecoff_build_fdr (backend, buf, bufend, offset) - const struct ecoff_debug_swap *backend; - char **buf; - char **bufend; - unsigned long offset; +ecoff_build_fdr (const struct ecoff_debug_swap *backend, + char **buf, + char **bufend, + unsigned long offset) { const bfd_size_type external_fdr_size = backend->external_fdr_size; - void (* const swap_fdr_out) PARAMS ((bfd *, const FDR *, PTR)) + void (* const swap_fdr_out) (bfd *, const FDR *, PTR) = backend->swap_fdr_out; long ifile; char *fdr_out; @@ -4634,7 +4584,7 @@ ecoff_build_fdr (backend, buf, bufend, offset) calls a backend function to deal with it. */ static void -ecoff_setup_ext () +ecoff_setup_ext (void) { register symbolS *sym; @@ -4664,10 +4614,9 @@ ecoff_setup_ext () /* Build the ECOFF debugging information. */ unsigned long -ecoff_build_debug (hdr, bufp, backend) - HDRR *hdr; - char **bufp; - const struct ecoff_debug_swap *backend; +ecoff_build_debug (HDRR *hdr, + char **bufp, + const struct ecoff_debug_swap *backend) { const bfd_size_type external_pdr_size = backend->external_pdr_size; tag_t *ptag; @@ -4831,8 +4780,7 @@ ecoff_build_debug (hdr, bufp, backend) #ifndef MALLOC_CHECK static page_type * -allocate_cluster (npages) - unsigned long npages; +allocate_cluster (unsigned long npages) { register page_type *value = (page_type *) xmalloc (npages * PAGE_USIZE); @@ -4854,7 +4802,7 @@ static unsigned long pages_left = 0; /* Allocate one page (which is initialized to 0). */ static page_type * -allocate_page () +allocate_page (void) { #ifndef MALLOC_CHECK @@ -4881,7 +4829,7 @@ allocate_page () /* Allocate scoping information. */ static scope_t * -allocate_scope () +allocate_scope (void) { register scope_t *ptr; static scope_t initial_scope; @@ -4921,8 +4869,7 @@ allocate_scope () /* Free scoping information. */ static void -free_scope (ptr) - scope_t *ptr; +free_scope (scope_t *ptr) { alloc_counts[(int) alloc_type_scope].total_free++; @@ -4937,7 +4884,7 @@ free_scope (ptr) /* Allocate links for pages in a virtual array. */ static vlinks_t * -allocate_vlinks () +allocate_vlinks (void) { register vlinks_t *ptr; static vlinks_t initial_vlinks; @@ -4971,7 +4918,7 @@ allocate_vlinks () /* Allocate string hash buckets. */ static shash_t * -allocate_shash () +allocate_shash (void) { register shash_t *ptr; static shash_t initial_shash; @@ -5005,7 +4952,7 @@ allocate_shash () /* Allocate type hash buckets. */ static thash_t * -allocate_thash () +allocate_thash (void) { register thash_t *ptr; static thash_t initial_thash; @@ -5039,7 +4986,7 @@ allocate_thash () /* Allocate structure, union, or enum tag information. */ static tag_t * -allocate_tag () +allocate_tag (void) { register tag_t *ptr; static tag_t initial_tag; @@ -5079,8 +5026,7 @@ allocate_tag () /* Free scoping information. */ static void -free_tag (ptr) - tag_t *ptr; +free_tag (tag_t *ptr) { alloc_counts[(int) alloc_type_tag].total_free++; @@ -5095,7 +5041,7 @@ free_tag (ptr) /* Allocate forward reference to a yet unknown tag. */ static forward_t * -allocate_forward () +allocate_forward (void) { register forward_t *ptr; static forward_t initial_forward; @@ -5129,7 +5075,7 @@ allocate_forward () /* Allocate head of type hash list. */ static thead_t * -allocate_thead () +allocate_thead (void) { register thead_t *ptr; static thead_t initial_thead; @@ -5169,8 +5115,7 @@ allocate_thead () /* Free scoping information. */ static void -free_thead (ptr) - thead_t *ptr; +free_thead (thead_t *ptr) { alloc_counts[(int) alloc_type_thead].total_free++; @@ -5183,7 +5128,7 @@ free_thead (ptr) } static lineno_list_t * -allocate_lineno_list () +allocate_lineno_list (void) { register lineno_list_t *ptr; static lineno_list_t initial_lineno_list; @@ -5215,8 +5160,7 @@ allocate_lineno_list () } void -ecoff_set_gp_prolog_size (sz) - int sz; +ecoff_set_gp_prolog_size (int sz) { if (cur_proc_ptr == 0) return; @@ -5232,13 +5176,13 @@ ecoff_set_gp_prolog_size (sz) } int -ecoff_no_current_file () +ecoff_no_current_file (void) { return cur_file_ptr == (efdr_t *) NULL; } void -ecoff_generate_asm_lineno () +ecoff_generate_asm_lineno (void) { unsigned int lineno; char *filename; @@ -5285,7 +5229,7 @@ ecoff_generate_asm_lineno () #else void -ecoff_generate_asm_lineno () +ecoff_generate_asm_lineno (void) { } diff --git a/contrib/binutils/gas/ecoff.h b/contrib/binutils/gas/ecoff.h index f6b96c6..2f09afc 100644 --- a/contrib/binutils/gas/ecoff.h +++ b/contrib/binutils/gas/ecoff.h @@ -34,18 +34,18 @@ extern int ecoff_debugging_seen; /* This function should be called at the start of assembly, by obj_read_begin_hook. */ -extern void ecoff_read_begin_hook PARAMS ((void)); +extern void ecoff_read_begin_hook (void); /* This function should be called when the assembler switches to a new file. */ -extern void ecoff_new_file PARAMS ((const char *)); +extern void ecoff_new_file (const char *); /* This function should be called when a new symbol is created, by obj_symbol_new_hook. */ -extern void ecoff_symbol_new_hook PARAMS ((symbolS *)); +extern void ecoff_symbol_new_hook (symbolS *); /* This function should be called by the obj_frob_symbol hook. */ -extern void ecoff_frob_symbol PARAMS ((symbolS *)); +extern void ecoff_frob_symbol (symbolS *); /* Build the ECOFF debugging information. This should be called by obj_frob_file. This fills in the counts in *HDR; the offsets are @@ -53,59 +53,59 @@ extern void ecoff_frob_symbol PARAMS ((symbolS *)); block of memory holding the debugging information. It returns the length of *BUFP. */ extern unsigned long ecoff_build_debug - PARAMS ((HDRR *hdr, char **bufp, const struct ecoff_debug_swap *)); + (HDRR *hdr, char **bufp, const struct ecoff_debug_swap *); /* Functions to handle the ECOFF debugging directives. */ -extern void ecoff_directive_begin PARAMS ((int)); -extern void ecoff_directive_bend PARAMS ((int)); -extern void ecoff_directive_end PARAMS ((int)); -extern void ecoff_directive_ent PARAMS ((int)); -extern void ecoff_directive_fmask PARAMS ((int)); -extern void ecoff_directive_frame PARAMS ((int)); -extern void ecoff_directive_loc PARAMS ((int)); -extern void ecoff_directive_mask PARAMS ((int)); +extern void ecoff_directive_begin (int); +extern void ecoff_directive_bend (int); +extern void ecoff_directive_end (int); +extern void ecoff_directive_ent (int); +extern void ecoff_directive_fmask (int); +extern void ecoff_directive_frame (int); +extern void ecoff_directive_loc (int); +extern void ecoff_directive_mask (int); /* Other ECOFF directives. */ -extern void ecoff_directive_extern PARAMS ((int)); -extern void ecoff_directive_weakext PARAMS ((int)); +extern void ecoff_directive_extern (int); +extern void ecoff_directive_weakext (int); /* Functions to handle the COFF debugging directives. */ -extern void ecoff_directive_def PARAMS ((int)); -extern void ecoff_directive_dim PARAMS ((int)); -extern void ecoff_directive_endef PARAMS ((int)); -extern void ecoff_directive_file PARAMS ((int)); -extern void ecoff_directive_scl PARAMS ((int)); -extern void ecoff_directive_size PARAMS ((int)); -extern void ecoff_directive_tag PARAMS ((int)); -extern void ecoff_directive_type PARAMS ((int)); -extern void ecoff_directive_val PARAMS ((int)); +extern void ecoff_directive_def (int); +extern void ecoff_directive_dim (int); +extern void ecoff_directive_endef (int); +extern void ecoff_directive_file (int); +extern void ecoff_directive_scl (int); +extern void ecoff_directive_size (int); +extern void ecoff_directive_tag (int); +extern void ecoff_directive_type (int); +extern void ecoff_directive_val (int); /* Handle stabs. */ -extern void ecoff_stab PARAMS ((segT sec, int what, const char *string, - int type, int other, int desc)); +extern void ecoff_stab (segT sec, int what, const char *string, + int type, int other, int desc); /* Set the GP prologue size. */ -extern void ecoff_set_gp_prolog_size PARAMS ((int sz)); +extern void ecoff_set_gp_prolog_size (int sz); /* This routine is called from the ECOFF code to set the external information for a symbol. */ #ifndef obj_ecoff_set_ext -extern void obj_ecoff_set_ext PARAMS ((symbolS *, EXTR *)); +extern void obj_ecoff_set_ext (symbolS *, EXTR *); #endif /* This routine is used to patch up a line number directive when instructions are moved around. */ -extern void ecoff_fix_loc PARAMS ((fragS *, unsigned long)); +extern void ecoff_fix_loc (fragS *, unsigned long); /* This function is called from read.c to peek at cur_file_ptr. */ -extern int ecoff_no_current_file PARAMS ((void)); +extern int ecoff_no_current_file (void); /* This function returns the symbol associated with the current proc. */ -extern symbolS *ecoff_get_cur_proc_sym PARAMS ((void)); +extern symbolS *ecoff_get_cur_proc_sym (void); #endif /* ECOFF_DEBUGGING */ /* This routine is called from read.c to generate line number for .s file. */ -extern void ecoff_generate_asm_lineno PARAMS ((void)); +extern void ecoff_generate_asm_lineno (void); #endif /* ! GAS_ECOFF_H */ diff --git a/contrib/binutils/gas/ehopt.c b/contrib/binutils/gas/ehopt.c index 4f5c9b2..451aaff 100644 --- a/contrib/binutils/gas/ehopt.c +++ b/contrib/binutils/gas/ehopt.c @@ -1,5 +1,5 @@ /* ehopt.c--optimize gcc exception frame information. - Copyright 1998, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 2000, 2001, 2003 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GAS, the GNU Assembler. @@ -94,13 +94,12 @@ struct cie_info int z_augmentation; }; -static int get_cie_info PARAMS ((struct cie_info *)); +static int get_cie_info (struct cie_info *); /* Extract information from the CIE. */ static int -get_cie_info (info) - struct cie_info *info; +get_cie_info (struct cie_info *info) { fragS *f; fixS *fix; @@ -248,9 +247,7 @@ get_cie_info (info) change *EXP and *PNBYTES. */ int -check_eh_frame (exp, pnbytes) - expressionS *exp; - unsigned int *pnbytes; +check_eh_frame (expressionS *exp, unsigned int *pnbytes) { struct frame_data { @@ -363,6 +360,8 @@ check_eh_frame (exp, pnbytes) } else d->state = state_error; + if (d->state == state_skipping_aug && d->aug_size == 0) + d->state = state_wait_loc4; break; case state_skipping_aug: @@ -455,8 +454,7 @@ check_eh_frame (exp, pnbytes) relaxation loop. We set fr_subtype{0:2} to the expected length. */ int -eh_frame_estimate_size_before_relax (frag) - fragS *frag; +eh_frame_estimate_size_before_relax (fragS *frag) { offsetT diff; int ca = frag->fr_subtype >> 3; @@ -483,8 +481,7 @@ eh_frame_estimate_size_before_relax (frag) the frag. This returns the change in frag length. */ int -eh_frame_relax_frag (frag) - fragS *frag; +eh_frame_relax_frag (fragS *frag) { int oldsize, newsize; @@ -498,8 +495,7 @@ eh_frame_relax_frag (frag) fr_subtype{0:2} will be the desired length of the frag. */ void -eh_frame_convert_frag (frag) - fragS *frag; +eh_frame_convert_frag (fragS *frag) { offsetT diff; fragS *loc4_frag; diff --git a/contrib/binutils/gas/emul.h b/contrib/binutils/gas/emul.h index b665260..e4afa68 100644 --- a/contrib/binutils/gas/emul.h +++ b/contrib/binutils/gas/emul.h @@ -23,10 +23,10 @@ struct emulation { - void (* match) PARAMS ((const char *)); + void (* match) (const char *); const char * name; - void (* init) PARAMS ((void)); - const char *(* bfd_name) PARAMS ((void)); + void (* init) (void); + const char *(* bfd_name) (void); unsigned local_labels_fb : 1; unsigned local_labels_dollar : 1; unsigned leading_underscore : 2; @@ -38,7 +38,7 @@ struct emulation COMMON struct emulation * this_emulation; -extern const char * default_emul_bfd_name PARAMS ((void)); -extern void common_emul_init PARAMS ((void)); +extern const char * default_emul_bfd_name (void); +extern void common_emul_init (void); #endif diff --git a/contrib/binutils/gas/expr.c b/contrib/binutils/gas/expr.c index 13c167a..d520a04 100644 --- a/contrib/binutils/gas/expr.c +++ b/contrib/binutils/gas/expr.c @@ -1,6 +1,6 @@ /* expr.c -operands, expressions- Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001 + 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -32,17 +32,17 @@ #include "safe-ctype.h" #include "obstack.h" -static void floating_constant PARAMS ((expressionS * expressionP)); -static valueT generic_bignum_to_int32 PARAMS ((void)); +static void floating_constant (expressionS * expressionP); +static valueT generic_bignum_to_int32 (void); #ifdef BFD64 -static valueT generic_bignum_to_int64 PARAMS ((void)); +static valueT generic_bignum_to_int64 (void); #endif -static void integer_constant PARAMS ((int radix, expressionS * expressionP)); -static void mri_char_constant PARAMS ((expressionS *)); -static void current_location PARAMS ((expressionS *)); -static void clean_up_expression PARAMS ((expressionS * expressionP)); -static segT operand PARAMS ((expressionS *)); -static operatorT operator PARAMS ((int *)); +static void integer_constant (int radix, expressionS * expressionP); +static void mri_char_constant (expressionS *); +static void current_location (expressionS *); +static void clean_up_expression (expressionS * expressionP); +static segT operand (expressionS *); +static operatorT operator (int *); extern const char EXP_CHARS[], FLT_CHARS[]; @@ -63,11 +63,9 @@ static struct expr_symbol_line *expr_symbol_lines; into the fake section expr_section. */ symbolS * -make_expr_symbol (expressionP) - expressionS *expressionP; +make_expr_symbol (expressionS *expressionP) { expressionS zero; - const char *fake; symbolS *symbolP; struct expr_symbol_line *n; @@ -78,8 +76,8 @@ make_expr_symbol (expressionP) if (expressionP->X_op == O_big) { /* This won't work, because the actual value is stored in - generic_floating_point_number or generic_bignum, and we are - going to lose it if we haven't already. */ + generic_floating_point_number or generic_bignum, and we are + going to lose it if we haven't already. */ if (expressionP->X_add_number > 0) as_bad (_("bignum invalid")); else @@ -91,13 +89,11 @@ make_expr_symbol (expressionP) expressionP = &zero; } - fake = FAKE_LABEL_NAME; - /* Putting constant symbols in absolute_section rather than expr_section is convenient for the old a.out code, for which S_GET_SEGMENT does not always retrieve the value put in by S_SET_SEGMENT. */ - symbolP = symbol_create (fake, + symbolP = symbol_create (FAKE_LABEL_NAME, (expressionP->X_op == O_constant ? absolute_section : expr_section), @@ -121,10 +117,7 @@ make_expr_symbol (expressionP) the symbol. */ int -expr_symbol_where (sym, pfile, pline) - symbolS *sym; - char **pfile; - unsigned int *pline; +expr_symbol_where (symbolS *sym, char **pfile, unsigned int *pline) { register struct expr_symbol_line *l; @@ -154,8 +147,7 @@ expr_symbol_where (sym, pfile, pline) but that seems more clumsy. */ symbolS * -expr_build_uconstant (value) - offsetT value; +expr_build_uconstant (offsetT value) { expressionS e; @@ -168,9 +160,7 @@ expr_build_uconstant (value) /* Build an expression for OP s1. */ symbolS * -expr_build_unary (op, s1) - operatorT op; - symbolS *s1; +expr_build_unary (operatorT op, symbolS *s1) { expressionS e; @@ -183,10 +173,7 @@ expr_build_unary (op, s1) /* Build an expression for s1 OP s2. */ symbolS * -expr_build_binary (op, s1, s2) - operatorT op; - symbolS *s1; - symbolS *s2; +expr_build_binary (operatorT op, symbolS *s1, symbolS *s2) { expressionS e; @@ -200,7 +187,7 @@ expr_build_binary (op, s1, s2) /* Build an expression for the current location ('.'). */ symbolS * -expr_build_dot () +expr_build_dot (void) { expressionS e; @@ -230,8 +217,7 @@ FLONUM_TYPE generic_floating_point_number = { int generic_floating_point_magic; static void -floating_constant (expressionP) - expressionS *expressionP; +floating_constant (expressionS *expressionP) { /* input_line_pointer -> floating-point constant. */ int error_code; @@ -258,7 +244,7 @@ floating_constant (expressionP) } static valueT -generic_bignum_to_int32 () +generic_bignum_to_int32 (void) { valueT number = ((generic_bignum[1] & LITTLENUM_MASK) << LITTLENUM_NUMBER_OF_BITS) @@ -269,7 +255,7 @@ generic_bignum_to_int32 () #ifdef BFD64 static valueT -generic_bignum_to_int64 () +generic_bignum_to_int64 (void) { valueT number = ((((((((valueT) generic_bignum[3] & LITTLENUM_MASK) @@ -284,9 +270,7 @@ generic_bignum_to_int64 () #endif static void -integer_constant (radix, expressionP) - int radix; - expressionS *expressionP; +integer_constant (int radix, expressionS *expressionP) { char *start; /* Start of number. */ char *suffix = NULL; @@ -329,8 +313,8 @@ integer_constant (radix, expressionP) int flt = 0; /* In MRI mode, the number may have a suffix indicating the - radix. For that matter, it might actually be a floating - point constant. */ + radix. For that matter, it might actually be a floating + point constant. */ for (suffix = input_line_pointer; ISALNUM (*suffix); suffix++) { if (*suffix == 'e' || *suffix == 'E') @@ -401,7 +385,7 @@ integer_constant (radix, expressionP) if (radix == 16 && c == '_') { /* This is literal of the form 0x333_0_12345678_1. - This example is equivalent to 0x00000333000000001234567800000001. */ + This example is equivalent to 0x00000333000000001234567800000001. */ int num_little_digits = 0; int i; @@ -645,8 +629,7 @@ integer_constant (radix, expressionP) /* Parse an MRI multi character constant. */ static void -mri_char_constant (expressionP) - expressionS *expressionP; +mri_char_constant (expressionS *expressionP) { int i; @@ -681,8 +664,8 @@ mri_char_constant (expressionP) if (i < SIZE_OF_LARGE_NUMBER - 1) { /* If there is more than one littlenum, left justify the - last one to make it match the earlier ones. If there is - only one, we can just use the value directly. */ + last one to make it match the earlier ones. If there is + only one, we can just use the value directly. */ for (; j < CHARS_PER_LITTLENUM; j++) generic_bignum[i] <<= 8; } @@ -735,8 +718,7 @@ mri_char_constant (expressionP) handles the magic symbol `.'. */ static void -current_location (expressionp) - expressionS *expressionp; +current_location (expressionS *expressionp) { if (now_seg == absolute_section) { @@ -745,13 +727,8 @@ current_location (expressionp) } else { - symbolS *symbolp; - - symbolp = symbol_new (FAKE_LABEL_NAME, now_seg, - (valueT) frag_now_fix (), - frag_now); expressionp->X_op = O_symbol; - expressionp->X_add_symbol = symbolp; + expressionp->X_add_symbol = symbol_temp_new_now (); expressionp->X_add_number = 0; } } @@ -764,8 +741,7 @@ current_location (expressionp) Input_line_pointer->(next non-blank) char after operand. */ static segT -operand (expressionP) - expressionS *expressionP; +operand (expressionS *expressionP) { char c; symbolS *symbolP; /* Points to symbol. */ @@ -828,10 +804,10 @@ operand (expressionP) { char *s; - /* Check for a hex constant. */ + /* Check for a hex or float constant. */ for (s = input_line_pointer; hex_p (*s); s++) ; - if (*s == 'h' || *s == 'H') + if (*s == 'h' || *s == 'H' || *input_line_pointer == '.') { --input_line_pointer; integer_constant (0, expressionP); @@ -1045,6 +1021,10 @@ operand (expressionP) break; case '+': + /* Do not accept ++e as +(+e). + Disabled, since the preprocessor removes whitespace. */ + if (0 && *input_line_pointer == '+') + goto target_op; (void) operand (expressionP); break; @@ -1062,6 +1042,11 @@ operand (expressionP) case '!': case '-': { + /* Do not accept --e as -(-e) + Disabled, since the preprocessor removes whitespace. */ + if (0 && c == '-' && *input_line_pointer == '-') + goto target_op; + operand (expressionP); if (expressionP->X_op == O_constant) { @@ -1079,6 +1064,18 @@ operand (expressionP) else expressionP->X_add_number = ! expressionP->X_add_number; } + else if (expressionP->X_op == O_big + && expressionP->X_add_number <= 0 + && c == '-' + && (generic_floating_point_number.sign == '+' + || generic_floating_point_number.sign == 'P')) + { + /* Negative flonum (eg, -1.000e0). */ + if (generic_floating_point_number.sign == '+') + generic_floating_point_number.sign = '-'; + else + generic_floating_point_number.sign = 'N'; + } else if (expressionP->X_op != O_illegal && expressionP->X_op != O_absent) { @@ -1100,7 +1097,7 @@ operand (expressionP) #if defined (DOLLAR_DOT) || defined (TC_M68K) case '$': /* '$' is the program counter when in MRI mode, or when - DOLLAR_DOT is defined. */ + DOLLAR_DOT is defined. */ #ifndef DOLLAR_DOT if (! flag_m68k_mri) goto de_fault; @@ -1108,7 +1105,7 @@ operand (expressionP) if (flag_m68k_mri && hex_p (*input_line_pointer)) { /* In MRI mode, '$' is also used as the prefix for a - hexadecimal constant. */ + hexadecimal constant. */ integer_constant (16, expressionP); break; } @@ -1199,7 +1196,7 @@ operand (expressionP) goto de_fault; /* In MRI mode, this is a floating point constant represented - using hexadecimal digits. */ + using hexadecimal digits. */ ++input_line_pointer; integer_constant (16, expressionP); @@ -1227,9 +1224,9 @@ operand (expressionP) #ifdef md_parse_name /* This is a hook for the backend to parse certain names - specially in certain contexts. If a name always has a - specific value, it can often be handled by simply - entering it in the symbol table. */ + specially in certain contexts. If a name always has a + specific value, it can often be handled by simply + entering it in the symbol table. */ if (md_parse_name (name, expressionP, &c)) { *input_line_pointer = c; @@ -1301,6 +1298,7 @@ operand (expressionP) } else { + target_op: /* Let the target try to parse it. Success is indicated by changing the X_op field to something other than O_absent and pointing input_line_pointer past the expression. If it can't parse the @@ -1347,13 +1345,10 @@ operand (expressionP) Elsewise we waste time special-case testing. Sigh. Ditto SEG_ABSENT. Out: expressionS may have been modified: - 'foo-foo' symbol references cancelled to 0, which changes X_op - from O_subtract to O_constant. Unused fields zeroed to help expr (). */ static void -clean_up_expression (expressionP) - expressionS *expressionP; +clean_up_expression (expressionS *expressionP) { switch (expressionP->X_op) { @@ -1371,23 +1366,6 @@ clean_up_expression (expressionP) case O_bit_not: expressionP->X_op_symbol = NULL; break; - case O_subtract: - if (expressionP->X_op_symbol == expressionP->X_add_symbol - || ((symbol_get_frag (expressionP->X_op_symbol) - == symbol_get_frag (expressionP->X_add_symbol)) - && SEG_NORMAL (S_GET_SEGMENT (expressionP->X_add_symbol)) - && (S_GET_VALUE (expressionP->X_op_symbol) - == S_GET_VALUE (expressionP->X_add_symbol)))) - { - addressT diff = (S_GET_VALUE (expressionP->X_add_symbol) - - S_GET_VALUE (expressionP->X_op_symbol)); - - expressionP->X_op = O_constant; - expressionP->X_add_symbol = NULL; - expressionP->X_op_symbol = NULL; - expressionP->X_add_number += diff; - } - break; default: break; } @@ -1521,7 +1499,7 @@ static operator_rankT op_rank[] = { #define MRI_MUL_PRECEDENCE 6 void -expr_set_precedence () +expr_set_precedence (void) { if (flag_m68k_mri) { @@ -1540,7 +1518,7 @@ expr_set_precedence () /* Initialize the expression parser. */ void -expr_begin () +expr_begin (void) { expr_set_precedence (); @@ -1557,8 +1535,7 @@ expr_begin () Does not advance INPUT_LINE_POINTER. */ static inline operatorT -operator (num_chars) - int *num_chars; +operator (int *num_chars) { int c; operatorT ret; @@ -1574,6 +1551,14 @@ operator (num_chars) default: return op_encoding[c]; + case '+': + case '-': + /* Do not allow a++b and a--b to be a + (+b) and a - (-b) + Disabled, since the preprocessor removes whitespace. */ + if (1 || input_line_pointer[1] != c) + return op_encoding[c]; + return O_illegal; + case '<': switch (input_line_pointer[1]) { @@ -1646,9 +1631,8 @@ operator (num_chars) /* Parse an expression. */ segT -expr (rankarg, resultP) - int rankarg; /* Larger # is higher rank. */ - expressionS *resultP; /* Deliver result here. */ +expr (int rankarg, /* Larger # is higher rank. */ + expressionS *resultP /* Deliver result here. */) { operator_rankT rank = (operator_rankT) rankarg; segT retval; @@ -1659,6 +1643,10 @@ expr (rankarg, resultP) know (rank >= 0); + /* Save the value of dot for the fixup code. */ + if (rank == 0) + dot_value = frag_now_fix (); + retval = operand (resultP); /* operand () gobbles spaces. */ @@ -1749,7 +1737,8 @@ expr (rankarg, resultP) && resultP->X_op == O_symbol && (symbol_get_frag (right.X_add_symbol) == symbol_get_frag (resultP->X_add_symbol)) - && SEG_NORMAL (rightseg)) + && (SEG_NORMAL (rightseg) + || right.X_add_symbol == resultP->X_add_symbol)) { resultP->X_add_number -= right.X_add_number; resultP->X_add_number += (S_GET_VALUE (resultP->X_add_symbol) @@ -1789,7 +1778,7 @@ expr (rankarg, resultP) case O_left_shift: resultP->X_add_number <<= v; break; case O_right_shift: /* We always use unsigned shifts, to avoid relying on - characteristics of the compiler used to compile gas. */ + characteristics of the compiler used to compile gas. */ resultP->X_add_number = (offsetT) ((valueT) resultP->X_add_number >> (valueT) v); break; @@ -1901,7 +1890,7 @@ expr (rankarg, resultP) lines end in end-of-line. */ char -get_symbol_end () +get_symbol_end (void) { char c; @@ -1920,7 +1909,7 @@ get_symbol_end () } unsigned int -get_single_number () +get_single_number (void) { expressionS exp; operand (&exp); diff --git a/contrib/binutils/gas/expr.h b/contrib/binutils/gas/expr.h index 3a4c931..382dda9 100644 --- a/contrib/binutils/gas/expr.h +++ b/contrib/binutils/gas/expr.h @@ -68,23 +68,23 @@ typedef enum { O_multiply, /* (X_add_symbol / X_op_symbol) + X_add_number. */ O_divide, - /* X_add_symbol % X_op_symbol) + X_add_number. */ + /* (X_add_symbol % X_op_symbol) + X_add_number. */ O_modulus, - /* X_add_symbol << X_op_symbol) + X_add_number. */ + /* (X_add_symbol << X_op_symbol) + X_add_number. */ O_left_shift, - /* X_add_symbol >> X_op_symbol) + X_add_number. */ + /* (X_add_symbol >> X_op_symbol) + X_add_number. */ O_right_shift, - /* X_add_symbol | X_op_symbol) + X_add_number. */ + /* (X_add_symbol | X_op_symbol) + X_add_number. */ O_bit_inclusive_or, - /* X_add_symbol |~ X_op_symbol) + X_add_number. */ + /* (X_add_symbol |~ X_op_symbol) + X_add_number. */ O_bit_or_not, - /* X_add_symbol ^ X_op_symbol) + X_add_number. */ + /* (X_add_symbol ^ X_op_symbol) + X_add_number. */ O_bit_exclusive_or, - /* X_add_symbol & X_op_symbol) + X_add_number. */ + /* (X_add_symbol & X_op_symbol) + X_add_number. */ O_bit_and, - /* X_add_symbol + X_op_symbol) + X_add_number. */ + /* (X_add_symbol + X_op_symbol) + X_add_number. */ O_add, - /* X_add_symbol - X_op_symbol) + X_add_number. */ + /* (X_add_symbol - X_op_symbol) + X_add_number. */ O_subtract, /* (X_add_symbol == X_op_symbol) + X_add_number. */ O_eq, @@ -157,16 +157,15 @@ extern LITTLENUM_TYPE generic_bignum[]; typedef char operator_rankT; -extern char get_symbol_end PARAMS ((void)); -extern void expr_begin PARAMS ((void)); -extern void expr_set_precedence PARAMS ((void)); -extern segT expr PARAMS ((int rank, expressionS * resultP)); -extern unsigned int get_single_number PARAMS ((void)); -extern symbolS *make_expr_symbol PARAMS ((expressionS * expressionP)); -extern int expr_symbol_where - PARAMS ((symbolS *, char **, unsigned int *)); - -extern symbolS *expr_build_uconstant PARAMS ((offsetT)); -extern symbolS *expr_build_unary PARAMS ((operatorT, symbolS *)); -extern symbolS *expr_build_binary PARAMS ((operatorT, symbolS *, symbolS *)); -extern symbolS *expr_build_dot PARAMS ((void)); +extern char get_symbol_end (void); +extern void expr_begin (void); +extern void expr_set_precedence (void); +extern segT expr (int rank, expressionS * resultP); +extern unsigned int get_single_number (void); +extern symbolS *make_expr_symbol (expressionS * expressionP); +extern int expr_symbol_where (symbolS *, char **, unsigned int *); + +extern symbolS *expr_build_uconstant (offsetT); +extern symbolS *expr_build_unary (operatorT, symbolS *); +extern symbolS *expr_build_binary (operatorT, symbolS *, symbolS *); +extern symbolS *expr_build_dot (void); diff --git a/contrib/binutils/gas/flonum-copy.c b/contrib/binutils/gas/flonum-copy.c index 1e6b40b..e3aba2c 100644 --- a/contrib/binutils/gas/flonum-copy.c +++ b/contrib/binutils/gas/flonum-copy.c @@ -22,9 +22,7 @@ #include "as.h" void -flonum_copy (in, out) - FLONUM_TYPE *in; - FLONUM_TYPE *out; +flonum_copy (FLONUM_TYPE *in, FLONUM_TYPE *out) { unsigned int in_length; /* 0 origin */ unsigned int out_length; /* 0 origin */ diff --git a/contrib/binutils/gas/flonum-mult.c b/contrib/binutils/gas/flonum-mult.c index e23579a..6d17f0a 100644 --- a/contrib/binutils/gas/flonum-mult.c +++ b/contrib/binutils/gas/flonum-mult.c @@ -71,10 +71,8 @@ (C style also gives deeper insight [to me] ... oh well ...) */ void -flonum_multip (a, b, product) - const FLONUM_TYPE *a; - const FLONUM_TYPE *b; - FLONUM_TYPE *product; +flonum_multip (const FLONUM_TYPE *a, const FLONUM_TYPE *b, + FLONUM_TYPE *product) { int size_of_a; /* 0 origin */ int size_of_b; /* 0 origin */ diff --git a/contrib/binutils/gas/flonum.h b/contrib/binutils/gas/flonum.h index e50d9bf..22aa755 100644 --- a/contrib/binutils/gas/flonum.h +++ b/contrib/binutils/gas/flonum.h @@ -84,14 +84,14 @@ extern const int table_size_of_flonum_powers_of_ten; * * \***********************************************************************/ -int atof_generic PARAMS ((char **address_of_string_pointer, - const char *string_of_decimal_marks, - const char *string_of_decimal_exponent_marks, - FLONUM_TYPE * address_of_generic_floating_point_number)); - -void flonum_copy PARAMS ((FLONUM_TYPE * in, FLONUM_TYPE * out)); -void flonum_multip PARAMS ((const FLONUM_TYPE * a, const FLONUM_TYPE * b, - FLONUM_TYPE * product)); +int atof_generic (char **address_of_string_pointer, + const char *string_of_decimal_marks, + const char *string_of_decimal_exponent_marks, + FLONUM_TYPE * address_of_generic_floating_point_number); + +void flonum_copy (FLONUM_TYPE * in, FLONUM_TYPE * out); +void flonum_multip (const FLONUM_TYPE * a, const FLONUM_TYPE * b, + FLONUM_TYPE * product); /***********************************************************************\ * * diff --git a/contrib/binutils/gas/frags.c b/contrib/binutils/gas/frags.c index 8d7ed2f..83625d7 100644 --- a/contrib/binutils/gas/frags.c +++ b/contrib/binutils/gas/frags.c @@ -1,6 +1,6 @@ /* frags.c - manage frags - Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000 + 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -30,19 +30,38 @@ extern fragS bss_address_frag; /* Initialization for frag routines. */ void -frag_init () +frag_init (void) { zero_address_frag.fr_type = rs_fill; bss_address_frag.fr_type = rs_fill; } +/* Check that we're not trying to assemble into a section that can't + allocate frags (currently, this is only possible in the absolute + section), or into an mri common. */ + +static void +frag_alloc_check (const struct obstack *ob) +{ + if (ob->chunk_size == 0) + { + as_bad (_("attempt to allocate data in absolute section")); + subseg_set (text_section, 0); + } + + if (mri_common_symbol != NULL) + { + as_bad (_("attempt to allocate data in common section")); + mri_common_symbol = NULL; + } +} + /* Allocate a frag on the specified obstack. Call this routine from everywhere else, so that all the weird alignment hackery can be done in just one place. */ fragS * -frag_alloc (ob) - struct obstack *ob; +frag_alloc (struct obstack *ob) { fragS *ptr; int oalign; @@ -62,8 +81,7 @@ frag_alloc (ob) do not return. Do not set up any fields of *now_frag. */ void -frag_grow (nchars) - unsigned int nchars; +frag_grow (unsigned int nchars) { if (obstack_room (&frchain_now->frch_obstack) < nchars) { @@ -105,10 +123,9 @@ frag_grow (nchars) of frchain_now. */ void -frag_new (old_frags_var_max_size) - /* Number of chars (already allocated on obstack frags) in - variable_length part of frag. */ - int old_frags_var_max_size; +frag_new (int old_frags_var_max_size + /* Number of chars (already allocated on obstack frags) in + variable_length part of frag. */) { fragS *former_last_fragP; frchainS *frchP; @@ -158,23 +175,11 @@ frag_new (old_frags_var_max_size) frag_now_growth past the new chars. */ char * -frag_more (nchars) - int nchars; +frag_more (int nchars) { register char *retval; - if (now_seg == absolute_section) - { - as_bad (_("attempt to allocate data in absolute section")); - subseg_set (text_section, 0); - } - - if (mri_common_symbol != NULL) - { - as_bad (_("attempt to allocate data in common section")); - mri_common_symbol = NULL; - } - + frag_alloc_check (&frchain_now->frch_obstack); frag_grow (nchars); retval = obstack_next_free (&frchain_now->frch_obstack); obstack_blank_fast (&frchain_now->frch_obstack, nchars); @@ -189,14 +194,8 @@ frag_more (nchars) to write into. */ char * -frag_var (type, max_chars, var, subtype, symbol, offset, opcode) - relax_stateT type; - int max_chars; - int var; - relax_substateT subtype; - symbolS *symbol; - offsetT offset; - char *opcode; +frag_var (relax_stateT type, int max_chars, int var, relax_substateT subtype, + symbolS *symbol, offsetT offset, char *opcode) { register char *retval; @@ -227,14 +226,9 @@ frag_var (type, max_chars, var, subtype, symbol, offset, opcode) No call to frag_grow is done. */ char * -frag_variant (type, max_chars, var, subtype, symbol, offset, opcode) - relax_stateT type; - int max_chars; - int var; - relax_substateT subtype; - symbolS *symbol; - offsetT offset; - char *opcode; +frag_variant (relax_stateT type, int max_chars, int var, + relax_substateT subtype, symbolS *symbol, offsetT offset, + char *opcode) { register char *retval; @@ -261,14 +255,21 @@ frag_variant (type, max_chars, var, subtype, symbol, offset, opcode) /* Reduce the variable end of a frag to a harmless state. */ void -frag_wane (fragP) - register fragS *fragP; +frag_wane (register fragS *fragP) { fragP->fr_type = rs_fill; fragP->fr_offset = 0; fragP->fr_var = 0; } +/* Return the number of bytes by which the current frag can be grown. */ + +int +frag_room (void) +{ + return obstack_room (&frchain_now->frch_obstack); +} + /* Make an alignment frag. The size of this frag will be adjusted to force the next frag to have the appropriate alignment. ALIGNMENT is the power of two to which to align. FILL_CHARACTER is the @@ -277,10 +278,7 @@ frag_wane (fragP) or 0 if there is no maximum. */ void -frag_align (alignment, fill_character, max) - int alignment; - int fill_character; - int max; +frag_align (int alignment, int fill_character, int max) { if (now_seg == absolute_section) { @@ -310,11 +308,8 @@ frag_align (alignment, fill_character, max) doing the alignment, or 0 if there is no maximum. */ void -frag_align_pattern (alignment, fill_pattern, n_fill, max) - int alignment; - const char *fill_pattern; - int n_fill; - int max; +frag_align_pattern (int alignment, const char *fill_pattern, + int n_fill, int max) { char *p; @@ -344,9 +339,7 @@ frag_align_pattern (alignment, fill_pattern, n_fill, max) #endif void -frag_align_code (alignment, max) - int alignment; - int max; +frag_align_code (int alignment, int max) { char *p; @@ -357,7 +350,7 @@ frag_align_code (alignment, max) } addressT -frag_now_fix_octets () +frag_now_fix_octets (void) { if (now_seg == absolute_section) return abs_section_offset; @@ -367,15 +360,15 @@ frag_now_fix_octets () } addressT -frag_now_fix () +frag_now_fix (void) { return frag_now_fix_octets () / OCTETS_PER_BYTE; } void -frag_append_1_char (datum) - int datum; +frag_append_1_char (int datum) { + frag_alloc_check (&frchain_now->frch_obstack); if (obstack_room (&frchain_now->frch_obstack) <= 1) { frag_wane (frag_now); diff --git a/contrib/binutils/gas/frags.h b/contrib/binutils/gas/frags.h index 9d52ae8..52a6cfe 100644 --- a/contrib/binutils/gas/frags.h +++ b/contrib/binutils/gas/frags.h @@ -106,8 +106,8 @@ struct frag { however, included in frchain_now. The fr_fix field is bogus; instead, use frag_now_fix (). */ COMMON fragS *frag_now; -extern addressT frag_now_fix PARAMS ((void)); -extern addressT frag_now_fix_octets PARAMS ((void)); +extern addressT frag_now_fix (void); +extern addressT frag_now_fix_octets (void); /* For foreign-segment symbol fixups. */ COMMON fragS zero_address_frag; @@ -116,7 +116,7 @@ COMMON fragS bss_address_frag; #if 0 /* A macro to speed up appending exactly 1 char to current frag. */ -/* JF changed < 1 to <= 1 to avoid a race conditon. */ +/* JF changed < 1 to <= 1 to avoid a race condition. */ #define FRAG_APPEND_1_CHAR(datum) \ { \ if (obstack_room (&frags) <= 1) \ @@ -127,37 +127,36 @@ COMMON fragS bss_address_frag; obstack_1grow (&frags, datum); \ } #else -extern void frag_append_1_char PARAMS ((int)); +extern void frag_append_1_char (int); #define FRAG_APPEND_1_CHAR(X) frag_append_1_char (X) #endif -void frag_init PARAMS ((void)); -fragS *frag_alloc PARAMS ((struct obstack *)); -void frag_grow PARAMS ((unsigned int nchars)); -char *frag_more PARAMS ((int nchars)); -void frag_align PARAMS ((int alignment, int fill_character, int max)); -void frag_align_pattern PARAMS ((int alignment, - const char *fill_pattern, - int n_fill, - int max)); -void frag_align_code PARAMS ((int alignment, int max)); -void frag_new PARAMS ((int old_frags_var_max_size)); -void frag_wane PARAMS ((fragS * fragP)); - -char *frag_variant PARAMS ((relax_stateT type, - int max_chars, - int var, - relax_substateT subtype, - symbolS * symbol, - offsetT offset, - char *opcode)); - -char *frag_var PARAMS ((relax_stateT type, - int max_chars, - int var, - relax_substateT subtype, - symbolS * symbol, - offsetT offset, - char *opcode)); +void frag_init (void); +fragS *frag_alloc (struct obstack *); +void frag_grow (unsigned int nchars); +char *frag_more (int nchars); +void frag_align (int alignment, int fill_character, int max); +void frag_align_pattern (int alignment, const char *fill_pattern, + int n_fill, int max); +void frag_align_code (int alignment, int max); +void frag_new (int old_frags_var_max_size); +void frag_wane (fragS * fragP); +int frag_room (void); + +char *frag_variant (relax_stateT type, + int max_chars, + int var, + relax_substateT subtype, + symbolS * symbol, + offsetT offset, + char *opcode); + +char *frag_var (relax_stateT type, + int max_chars, + int var, + relax_substateT subtype, + symbolS * symbol, + offsetT offset, + char *opcode); #endif /* FRAGS_H */ diff --git a/contrib/binutils/gas/hash.c b/contrib/binutils/gas/hash.c index df9101d..a7b8298 100644 --- a/contrib/binutils/gas/hash.c +++ b/contrib/binutils/gas/hash.c @@ -23,7 +23,7 @@ /* This version of the hash table code is a wholescale replacement of the old hash table code, which was fairly bad. This is based on the hash table code in BFD, but optimized slightly for the - asssembler. The assembler does not need to derive structures that + assembler. The assembler does not need to derive structures that are stored in the hash table. Instead, it always stores a pointer. The assembler uses the hash table mostly to store symbols, and we don't need to confuse the symbol structure with a hash table @@ -75,7 +75,7 @@ struct hash_control { /* Create a hash table. This return a control block. */ struct hash_control * -hash_new () +hash_new (void) { unsigned int size; struct hash_control *ret; @@ -105,8 +105,7 @@ hash_new () /* Delete a hash table, freeing all allocated memory. */ void -hash_die (table) - struct hash_control *table; +hash_die (struct hash_control *table) { obstack_free (&table->memory, 0); free (table); @@ -121,17 +120,14 @@ hash_die (table) Each time we look up a string, we move it to the start of the list for its hash code, to take advantage of referential locality. */ -static struct hash_entry *hash_lookup PARAMS ((struct hash_control *, - const char *, - struct hash_entry ***, - unsigned long *)); +static struct hash_entry *hash_lookup (struct hash_control *, + const char *, + struct hash_entry ***, + unsigned long *); static struct hash_entry * -hash_lookup (table, key, plist, phash) - struct hash_control *table; - const char *key; - struct hash_entry ***plist; - unsigned long *phash; +hash_lookup (struct hash_control *table, const char *key, + struct hash_entry ***plist, unsigned long *phash) { register unsigned long hash; unsigned int len; @@ -205,10 +201,7 @@ hash_lookup (table, key, plist, phash) hash table. */ const char * -hash_insert (table, key, value) - struct hash_control *table; - const char *key; - PTR value; +hash_insert (struct hash_control *table, const char *key, PTR value) { struct hash_entry *p; struct hash_entry **list; @@ -238,10 +231,7 @@ hash_insert (table, key, value) error. If an entry already exists, its value is replaced. */ const char * -hash_jam (table, key, value) - struct hash_control *table; - const char *key; - PTR value; +hash_jam (struct hash_control *table, const char *key, PTR value) { struct hash_entry *p; struct hash_entry **list; @@ -279,10 +269,7 @@ hash_jam (table, key, value) table, this does nothing and returns NULL. */ PTR -hash_replace (table, key, value) - struct hash_control *table; - const char *key; - PTR value; +hash_replace (struct hash_control *table, const char *key, PTR value) { struct hash_entry *p; PTR ret; @@ -306,9 +293,7 @@ hash_replace (table, key, value) if the entry is not found. */ PTR -hash_find (table, key) - struct hash_control *table; - const char *key; +hash_find (struct hash_control *table, const char *key) { struct hash_entry *p; @@ -323,9 +308,7 @@ hash_find (table, key) for that entry, or NULL if there is no such entry. */ PTR -hash_delete (table, key) - struct hash_control *table; - const char *key; +hash_delete (struct hash_control *table, const char *key) { struct hash_entry *p; struct hash_entry **list; @@ -354,9 +337,8 @@ hash_delete (table, key) hash table. */ void -hash_traverse (table, pfn) - struct hash_control *table; - void (*pfn) PARAMS ((const char *key, PTR value)); +hash_traverse (struct hash_control *table, + void (*pfn) (const char *key, PTR value)) { unsigned int i; @@ -373,10 +355,9 @@ hash_traverse (table, pfn) name of the hash table, used for printing a header. */ void -hash_print_statistics (f, name, table) - FILE *f ATTRIBUTE_UNUSED; - const char *name ATTRIBUTE_UNUSED; - struct hash_control *table ATTRIBUTE_UNUSED; +hash_print_statistics (FILE *f ATTRIBUTE_UNUSED, + const char *name ATTRIBUTE_UNUSED, + struct hash_control *table ATTRIBUTE_UNUSED) { #ifdef HASH_STATISTICS unsigned int i; @@ -430,7 +411,7 @@ char answer[100]; /* We test many hash tables at once. */ char *hashtable[TABLES]; -/* Points to curent hash_control. */ +/* Points to current hash_control. */ char *h; char **pp; char *p; diff --git a/contrib/binutils/gas/hash.h b/contrib/binutils/gas/hash.h index ecab0fa..08f41e6 100644 --- a/contrib/binutils/gas/hash.h +++ b/contrib/binutils/gas/hash.h @@ -25,54 +25,54 @@ struct hash_control; /* Create a hash table. This return a control block. */ -extern struct hash_control *hash_new PARAMS ((void)); +extern struct hash_control *hash_new (void); /* Delete a hash table, freeing all allocated memory. */ -extern void hash_die PARAMS ((struct hash_control *)); +extern void hash_die (struct hash_control *); /* Insert an entry into a hash table. This returns NULL on success. On error, it returns a printable string indicating the error. It is considered to be an error if the entry already exists in the hash table. */ -extern const char *hash_insert PARAMS ((struct hash_control *, - const char *key, PTR value)); +extern const char *hash_insert (struct hash_control *, + const char *key, PTR value); /* Insert or replace an entry in a hash table. This returns NULL on success. On error, it returns a printable string indicating the error. If an entry already exists, its value is replaced. */ -extern const char *hash_jam PARAMS ((struct hash_control *, - const char *key, PTR value)); +extern const char *hash_jam (struct hash_control *, + const char *key, PTR value); /* Replace an existing entry in a hash table. This returns the old value stored for the entry. If the entry is not found in the hash table, this does nothing and returns NULL. */ -extern PTR hash_replace PARAMS ((struct hash_control *, const char *key, - PTR value)); +extern PTR hash_replace (struct hash_control *, const char *key, + PTR value); /* Find an entry in a hash table, returning its value. Returns NULL if the entry is not found. */ -extern PTR hash_find PARAMS ((struct hash_control *, const char *key)); +extern PTR hash_find (struct hash_control *, const char *key); /* Delete an entry from a hash table. This returns the value stored for that entry, or NULL if there is no such entry. */ -extern PTR hash_delete PARAMS ((struct hash_control *, const char *key)); +extern PTR hash_delete (struct hash_control *, const char *key); /* Traverse a hash table. Call the function on every entry in the hash table. */ -extern void hash_traverse PARAMS ((struct hash_control *, - void (*pfn) (const char *key, PTR value))); +extern void hash_traverse (struct hash_control *, + void (*pfn) (const char *key, PTR value)); /* Print hash table statistics on the specified file. NAME is the name of the hash table, used for printing a header. */ -extern void hash_print_statistics PARAMS ((FILE *, const char *name, - struct hash_control *)); +extern void hash_print_statistics (FILE *, const char *name, + struct hash_control *); #endif /* HASH_H */ diff --git a/contrib/binutils/gas/input-file.c b/contrib/binutils/gas/input-file.c index 5c23f31..01cc669 100644 --- a/contrib/binutils/gas/input-file.c +++ b/contrib/binutils/gas/input-file.c @@ -1,5 +1,5 @@ /* input_file.c - Deal with Input Files - - Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001 + Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1999, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -26,11 +26,12 @@ #include #include +#include #include "as.h" #include "input-file.h" #include "safe-ctype.h" -static int input_file_get PARAMS ((char *, int)); +static int input_file_get (char *, int); /* This variable is non-zero if the file currently being read should be preprocessed by app. It is zero if the file can be read straight in. */ @@ -58,28 +59,28 @@ struct saved_file char * app_save; }; -/* These hooks accomodate most operating systems. */ +/* These hooks accommodate most operating systems. */ void -input_file_begin () +input_file_begin (void) { f_in = (FILE *) 0; } void -input_file_end () +input_file_end (void) { } /* Return BUFFER_SIZE. */ unsigned int -input_file_buffer_size () +input_file_buffer_size (void) { return (BUFFER_SIZE); } int -input_file_is_open () +input_file_is_open (void) { return f_in != (FILE *) 0; } @@ -88,7 +89,7 @@ input_file_is_open () can be restored with input_file_pop (). */ char * -input_file_push () +input_file_push (void) { register struct saved_file *saved; @@ -107,8 +108,7 @@ input_file_push () } void -input_file_pop (arg) - char *arg; +input_file_pop (char *arg) { register struct saved_file *saved = (struct saved_file *) arg; @@ -124,9 +124,8 @@ input_file_pop (arg) } void -input_file_open (filename, pre) - char *filename; /* "" means use stdin. Must not be 0. */ - int pre; +input_file_open (char *filename, /* "" means use stdin. Must not be 0. */ + int pre) { int c; char buf[80]; @@ -135,23 +134,36 @@ input_file_open (filename, pre) assert (filename != 0); /* Filename may not be NULL. */ if (filename[0]) - { /* We have a file name. Suck it and see. */ + { f_in = fopen (filename, FOPEN_RT); file_name = filename; } else - { /* use stdin for the input file. */ + { + /* Use stdin for the input file. */ f_in = stdin; - file_name = _("{standard input}"); /* For error messages. */ + /* For error messages. */ + file_name = _("{standard input}"); } - if (f_in == (FILE *) 0) + + if (f_in) + c = getc (f_in); + + if (f_in == NULL || ferror (f_in)) { - as_bad (_("can't open %s for reading"), file_name); - as_perror ("%s", file_name); +#ifdef BFD_ASSEMBLER + bfd_set_error (bfd_error_system_call); +#endif + as_perror (_("Can't open %s for reading"), file_name); + + if (f_in) + { + fclose (f_in); + f_in = NULL; + } return; } - c = getc (f_in); if (c == '#') { /* Begins with comment, may not want to preprocess. */ @@ -188,7 +200,7 @@ input_file_open (filename, pre) /* Close input file. */ void -input_file_close () +input_file_close (void) { /* Don't close a null file pointer. */ if (f_in != NULL) @@ -200,15 +212,16 @@ input_file_close () /* This function is passed to do_scrub_chars. */ static int -input_file_get (buf, buflen) - char *buf; - int buflen; +input_file_get (char *buf, int buflen) { int size; size = fread (buf, sizeof (char), buflen, f_in); if (size < 0) { +#ifdef BFD_ASSEMBLER + bfd_set_error (bfd_error_system_call); +#endif as_perror (_("Can't read from %s"), file_name); size = 0; } @@ -218,8 +231,7 @@ input_file_get (buf, buflen) /* Read a buffer from the input file. */ char * -input_file_give_next_buffer (where) - char *where; /* Where to place 1st character of new buffer. */ +input_file_give_next_buffer (char *where /* Where to place 1st character of new buffer. */) { char *return_value; /* -> Last char of what we read, + 1. */ register int size; @@ -236,6 +248,9 @@ input_file_give_next_buffer (where) size = fread (where, sizeof (char), BUFFER_SIZE, f_in); if (size < 0) { +#ifdef BFD_ASSEMBLER + bfd_set_error (bfd_error_system_call); +#endif as_perror (_("Can't read from %s"), file_name); size = 0; } @@ -244,7 +259,12 @@ input_file_give_next_buffer (where) else { if (fclose (f_in)) - as_perror (_("Can't close %s"), file_name); + { +#ifdef BFD_ASSEMBLER + bfd_set_error (bfd_error_system_call); +#endif + as_perror (_("Can't close %s"), file_name); + } f_in = (FILE *) 0; return_value = 0; } diff --git a/contrib/binutils/gas/input-file.h b/contrib/binutils/gas/input-file.h index 9934869..b686a0d 100644 --- a/contrib/binutils/gas/input-file.h +++ b/contrib/binutils/gas/input-file.h @@ -55,12 +55,12 @@ * about I/O errors. No I/O errors are fatal: an end-of-file may be faked. */ -char *input_file_give_next_buffer PARAMS ((char *where)); -char *input_file_push PARAMS ((void)); -unsigned int input_file_buffer_size PARAMS ((void)); -int input_file_is_open PARAMS ((void)); -void input_file_begin PARAMS ((void)); -void input_file_close PARAMS ((void)); -void input_file_end PARAMS ((void)); -void input_file_open PARAMS ((char *filename, int pre)); -void input_file_pop PARAMS ((char *arg)); +char *input_file_give_next_buffer (char *where); +char *input_file_push (void); +unsigned int input_file_buffer_size (void); +int input_file_is_open (void); +void input_file_begin (void); +void input_file_close (void); +void input_file_end (void); +void input_file_open (char *filename, int pre); +void input_file_pop (char *arg); diff --git a/contrib/binutils/gas/input-scrub.c b/contrib/binutils/gas/input-scrub.c index d343711..7a03965 100644 --- a/contrib/binutils/gas/input-scrub.c +++ b/contrib/binutils/gas/input-scrub.c @@ -33,7 +33,7 @@ * were broken across buffers, and return a buffer of full lines to * the caller. * The last partial line begins the next buffer we build and return to caller. - * The buffer returned to caller is preceeded by BEFORE_STRING and followed + * The buffer returned to caller is preceded by BEFORE_STRING and followed * by AFTER_STRING, as sentinels. The last character before AFTER_STRING * is a newline. * Also looks after line numbers, for e.g. error messages. @@ -121,9 +121,9 @@ struct input_save { char * saved_position; /* Caller's saved position in buf. */ }; -static struct input_save *input_scrub_push PARAMS ((char *saved_position)); -static char *input_scrub_pop PARAMS ((struct input_save *arg)); -static void as_1_char PARAMS ((unsigned int c, FILE * stream)); +static struct input_save *input_scrub_push (char *saved_position); +static char *input_scrub_pop (struct input_save *arg); +static void as_1_char (unsigned int c, FILE * stream); /* Saved information about the file that .include'd this one. When we hit EOF, we automatically pop to that file. */ @@ -135,8 +135,7 @@ static struct input_save *next_saved_file; area, which can be restored by passing it to input_scrub_pop(). */ static struct input_save * -input_scrub_push (saved_position) - char *saved_position; +input_scrub_push (char *saved_position) { register struct input_save *saved; @@ -171,8 +170,7 @@ input_scrub_push (saved_position) } static char * -input_scrub_pop (saved) - struct input_save *saved; +input_scrub_pop (struct input_save *saved) { char *saved_position; @@ -199,7 +197,7 @@ input_scrub_pop (saved) } void -input_scrub_begin () +input_scrub_begin (void) { know (strlen (BEFORE_STRING) == BEFORE_SIZE); know (strlen (AFTER_STRING) == AFTER_SIZE @@ -221,7 +219,7 @@ input_scrub_begin () } void -input_scrub_end () +input_scrub_end (void) { if (buffer_start) { @@ -235,8 +233,7 @@ input_scrub_end () Return start of caller's part of buffer. */ char * -input_scrub_new_file (filename) - char *filename; +input_scrub_new_file (char *filename) { input_file_open (filename, !flag_no_comments); physical_input_file = filename[0] ? filename : _("{standard input}"); @@ -251,9 +248,7 @@ input_scrub_new_file (filename) input_scrub_new_file. */ char * -input_scrub_include_file (filename, position) - char *filename; - char *position; +input_scrub_include_file (char *filename, char *position) { next_saved_file = input_scrub_push (position); return input_scrub_new_file (filename); @@ -263,10 +258,7 @@ input_scrub_include_file (filename, position) expanding a macro. */ void -input_scrub_include_sb (from, position, is_expansion) - sb *from; - char *position; - int is_expansion; +input_scrub_include_sb (sb *from, char *position, int is_expansion) { if (macro_nest > max_macro_nest) as_fatal (_("macros nested too deeply")); @@ -298,14 +290,13 @@ input_scrub_include_sb (from, position, is_expansion) } void -input_scrub_close () +input_scrub_close (void) { input_file_close (); } char * -input_scrub_next_buffer (bufp) - char **bufp; +input_scrub_next_buffer (char **bufp) { register char *limit; /*->just after last char of buffer. */ @@ -414,13 +405,13 @@ input_scrub_next_buffer (bufp) messages and so on. Return TRUE if we opened any file. */ int -seen_at_least_1_file () +seen_at_least_1_file (void) { return (physical_input_file != NULL); } void -bump_line_counters () +bump_line_counters (void) { if (sb_index < 0) { @@ -439,9 +430,8 @@ bump_line_counters () Returns nonzero if the filename actually changes. */ int -new_logical_line (fname, line_number) - char *fname; /* DON'T destroy it! We point to it! */ - int line_number; +new_logical_line (char *fname, /* DON'T destroy it! We point to it! */ + int line_number) { if (line_number >= 0) logical_input_line = line_number; @@ -464,9 +454,7 @@ new_logical_line (fname, line_number) up declarations like that, and it's easier to avoid it. */ void -as_where (namep, linep) - char **namep; - unsigned int *linep; +as_where (char **namep, unsigned int *linep) { if (logical_input_file != NULL && (linep == NULL || logical_input_line >= 0)) @@ -494,8 +482,7 @@ as_where (namep, linep) No free '\n' at end of line. */ void -as_howmuch (stream) - FILE *stream; /* Opened for write please. */ +as_howmuch (FILE *stream /* Opened for write please. */) { register char *p; /* Scan input line. */ @@ -511,9 +498,7 @@ as_howmuch (stream) } static void -as_1_char (c, stream) - unsigned int c; - FILE *stream; +as_1_char (unsigned int c, FILE *stream) { if (c > 127) { diff --git a/contrib/binutils/gas/itbl-ops.c b/contrib/binutils/gas/itbl-ops.c index 09db9f7..089bff4 100644 --- a/contrib/binutils/gas/itbl-ops.c +++ b/contrib/binutils/gas/itbl-ops.c @@ -154,23 +154,21 @@ static struct itbl_entry *entries[e_nprocs][e_ntypes] = { }; /* local prototypes */ -static unsigned long build_opcode PARAMS ((struct itbl_entry *e)); -static e_type get_type PARAMS ((int yytype)); -static e_processor get_processor PARAMS ((int yyproc)); -static struct itbl_entry **get_entries PARAMS ((e_processor processor, - e_type type)); -static struct itbl_entry *find_entry_byname PARAMS ((e_processor processor, - e_type type, char *name)); -static struct itbl_entry *find_entry_byval PARAMS ((e_processor processor, - e_type type, unsigned long val, struct itbl_range *r)); -static struct itbl_entry *alloc_entry PARAMS ((e_processor processor, - e_type type, char *name, unsigned long value)); -static unsigned long apply_range PARAMS ((unsigned long value, - struct itbl_range r)); -static unsigned long extract_range PARAMS ((unsigned long value, - struct itbl_range r)); -static struct itbl_field *alloc_field PARAMS ((e_type type, int sbit, - int ebit, unsigned long flags)); +static unsigned long build_opcode (struct itbl_entry *e); +static e_type get_type (int yytype); +static e_processor get_processor (int yyproc); +static struct itbl_entry **get_entries (e_processor processor, + e_type type); +static struct itbl_entry *find_entry_byname (e_processor processor, + e_type type, char *name); +static struct itbl_entry *find_entry_byval (e_processor processor, + e_type type, unsigned long val, struct itbl_range *r); +static struct itbl_entry *alloc_entry (e_processor processor, + e_type type, char *name, unsigned long value); +static unsigned long apply_range (unsigned long value, struct itbl_range r); +static unsigned long extract_range (unsigned long value, struct itbl_range r); +static struct itbl_field *alloc_field (e_type type, int sbit, + int ebit, unsigned long flags); /*======================================================================*/ /* Interfaces to the parser */ @@ -351,7 +349,7 @@ append_insns_as_macros (void) printf (_("Unable to allocate memory for new instructions\n")); return; } - if (size) /* copy prexisting opcodes table */ + if (size) /* copy preexisting opcodes table */ memcpy (new_opcodes, ITBL_OPCODES, size); /* FIXME! some NUMOPCODES are calculated expressions. @@ -372,13 +370,13 @@ append_insns_as_macros (void) o->name = e->name; o->args = strdup (form_args (e)); o->mask = apply_range (e->value, e->range); - /* FIXME how to catch durring assembly? */ + /* FIXME how to catch during assembly? */ /* mask to identify this insn */ o->match = apply_range (e->value, e->range); o->pinfo = 0; #ifdef USE_MACROS - o->mask = id++; /* FIXME how to catch durring assembly? */ + o->mask = id++; /* FIXME how to catch during assembly? */ o->match = 0; /* for macros, the insn_isa number */ o->pinfo = INSN_MACRO; #endif @@ -616,7 +614,7 @@ itbl_disassemble (char *s, unsigned long insn) struct itbl_entry *r; unsigned long value; - if (f == e->fields) /* First operand is preceeded by tab. */ + if (f == e->fields) /* First operand is preceded by tab. */ strcat (s, "\t"); else /* ','s separate following operands. */ strcat (s, ","); diff --git a/contrib/binutils/gas/itbl-ops.h b/contrib/binutils/gas/itbl-ops.h index bcd68fe..4c98d72 100644 --- a/contrib/binutils/gas/itbl-ops.h +++ b/contrib/binutils/gas/itbl-ops.h @@ -86,24 +86,23 @@ extern int itbl_have_entries; /* These routines are visible to the main part of the assembler */ -int itbl_parse PARAMS ((char *insntbl)); -void itbl_init PARAMS ((void)); -char *itbl_get_field PARAMS ((char **s)); -unsigned long itbl_assemble PARAMS ((char *name, char *operands)); -int itbl_disassemble PARAMS ((char *str, unsigned long insn)); -int itbl_parse PARAMS ((char *tbl)); /* parses insn tbl */ -int itbl_get_reg_val PARAMS ((char *name, unsigned long *pval)); -int itbl_get_val PARAMS ((e_processor processor, e_type type, char *name, - unsigned long *pval)); -char *itbl_get_name PARAMS ((e_processor processor, e_type type, - unsigned long val)); +int itbl_parse (char *insntbl); +void itbl_init (void); +char *itbl_get_field (char **s); +unsigned long itbl_assemble (char *name, char *operands); +int itbl_disassemble (char *str, unsigned long insn); +int itbl_parse (char *tbl); /* parses insn tbl */ +int itbl_get_reg_val (char *name, unsigned long *pval); +int itbl_get_val (e_processor processor, e_type type, char *name, + unsigned long *pval); +char *itbl_get_name (e_processor processor, e_type type, unsigned long val); /* These routines are called by the table parser used to build the dynamic list of new processor instructions and registers. */ -struct itbl_entry *itbl_add_reg PARAMS ((int yyproc, int yytype, - char *regname, int regnum)); -struct itbl_entry *itbl_add_insn PARAMS ((int yyproc, char *name, - unsigned long value, int sbit, int ebit, unsigned long flags)); -struct itbl_field *itbl_add_operand PARAMS ((struct itbl_entry * e, int yytype, - int sbit, int ebit, unsigned long flags)); +struct itbl_entry *itbl_add_reg (int yyproc, int yytype, + char *regname, int regnum); +struct itbl_entry *itbl_add_insn (int yyproc, char *name, + unsigned long value, int sbit, int ebit, unsigned long flags); +struct itbl_field *itbl_add_operand (struct itbl_entry * e, int yytype, + int sbit, int ebit, unsigned long flags); diff --git a/contrib/binutils/gas/listing.c b/contrib/binutils/gas/listing.c index 7510d85..aa22c5e 100644 --- a/contrib/binutils/gas/listing.c +++ b/contrib/binutils/gas/listing.c @@ -1,27 +1,26 @@ -/* listing.c - mainting assembly listings +/* listing.c - maintain assembly listings Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002 + 2001, 2002, 2003 Free Software Foundation, Inc. -This file is part of GAS, the GNU Assembler. + 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 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. + 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. */ + 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. */ -/* - Contributed by Steve Chamberlain +/* Contributed by Steve Chamberlain A listing page looks like: @@ -65,7 +64,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA The function listing_newline remembers the frag associated with the newline, and creates a new frag - note that this is wasteful, but not a big deal, since listing slows things down a lot anyway. The - function also rememebers when the filename changes. + function also remembers when the filename changes. When all the input has finished, and gas has had a chance to settle down, the listing is output. This is done by running down the list of @@ -86,10 +85,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA LISTING_LHS_WIDTH_SECOND Number of words for the data on the lhs for the second line - LISTING_LHS_CONT_LINES Max number of lines to use up for a continutation + LISTING_LHS_CONT_LINES Max number of lines to use up for a continuation LISTING_RHS_WIDTH Number of chars from the input file to print - on a line -*/ + on a line. */ #include "as.h" #include "obstack.h" @@ -119,7 +117,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #endif /* This structure remembers which .s were used. */ -typedef struct file_info_struct { +typedef struct file_info_struct +{ struct file_info_struct * next; char * filename; long pos; @@ -127,14 +126,16 @@ typedef struct file_info_struct { int at_end; } file_info_type; -/* This structure rememebrs which line from which file goes into which +/* This structure remembers which line from which file goes into which frag. */ -struct list_info_struct { +struct list_info_struct +{ /* Frag which this line of source is nearest to. */ fragS *frag; /* The actual line in the source file. */ unsigned int line; + /* Pointer to the file info struct for the file which this line belongs to. */ file_info_type *file; @@ -148,21 +149,23 @@ struct list_info_struct { /* Pointer to the file info struct for the high level language source line that belongs here. */ file_info_type *hll_file; + /* High level language source line. */ unsigned int hll_line; /* Pointer to any error message associated with this line. */ char *message; - enum { - EDICT_NONE, - EDICT_SBTTL, - EDICT_TITLE, - EDICT_NOLIST, - EDICT_LIST, - EDICT_NOLIST_NEXT, - EDICT_EJECT - } edict; + enum + { + EDICT_NONE, + EDICT_SBTTL, + EDICT_TITLE, + EDICT_NOLIST, + EDICT_LIST, + EDICT_NOLIST_NEXT, + EDICT_EJECT + } edict; char *edict_arg; /* Nonzero if this line is to be omitted because it contains @@ -204,27 +207,20 @@ static FILE *list_file; static char *data_buffer; /* Prototypes. */ -static void listing_message PARAMS ((const char *name, const char *message)); -static file_info_type *file_info PARAMS ((const char *file_name)); -static void new_frag PARAMS ((void)); -static char *buffer_line PARAMS ((file_info_type *file, - char *line, unsigned int size)); -static void listing_page PARAMS ((list_info_type *list)); -static unsigned int calc_hex PARAMS ((list_info_type *list)); -static void print_lines PARAMS ((list_info_type *, unsigned int, - char *, unsigned int)); -static void list_symbol_table PARAMS ((void)); -static void print_source PARAMS ((file_info_type *current_file, - list_info_type *list, - char *buffer, - unsigned int width)); -static int debugging_pseudo PARAMS ((list_info_type *, const char *)); -static void listing_listing PARAMS ((char *name)); +static void listing_message (const char *, const char *); +static file_info_type *file_info (const char *); +static void new_frag (void); +static char *buffer_line (file_info_type *, char *, unsigned int); +static void listing_page (list_info_type *); +static unsigned int calc_hex (list_info_type *); +static void print_lines (list_info_type *, unsigned int, char *, unsigned int); +static void list_symbol_table (void); +static void print_source (file_info_type *, list_info_type *, char *, unsigned int); +static int debugging_pseudo (list_info_type *, const char *); +static void listing_listing (char *); static void -listing_message (name, message) - const char *name; - const char *message; +listing_message (const char *name, const char *message) { if (listing_tail != (list_info_type *) NULL) { @@ -237,22 +233,19 @@ listing_message (name, message) } void -listing_warning (message) - const char *message; +listing_warning (const char *message) { listing_message (_("Warning:"), message); } void -listing_error (message) - const char *message; +listing_error (const char *message) { listing_message (_("Error:"), message); } static file_info_type * -file_info (file_name) - const char *file_name; +file_info (const char *file_name) { /* Find an entry with this file name. */ file_info_type *p = file_info_head; @@ -265,8 +258,7 @@ file_info (file_name) } /* Make new entry. */ - - p = (file_info_type *) xmalloc (sizeof (file_info_type)); + p = xmalloc (sizeof (file_info_type)); p->next = file_info_head; file_info_head = p; p->filename = xstrdup (file_name); @@ -278,17 +270,14 @@ file_info (file_name) } static void -new_frag () +new_frag (void) { - frag_wane (frag_now); frag_new (0); - } void -listing_newline (ps) - char *ps; +listing_newline (char *ps) { char *file; unsigned int line; @@ -382,7 +371,7 @@ listing_newline (ps) } else { - new = (list_info_type *) xmalloc (sizeof (list_info_type)); + new = xmalloc (sizeof (list_info_type)); new->line_contents = ps; } @@ -432,7 +421,7 @@ listing_newline (ps) with the new instruction. */ void -listing_prev_line () +listing_prev_line (void) { list_info_type *l; fragS *f; @@ -459,10 +448,7 @@ listing_prev_line () file to make. */ static char * -buffer_line (file, line, size) - file_info_type *file; - char *line; - unsigned int size; +buffer_line (file_info_type *file, char *line, unsigned int size) { unsigned int count = 0; int c; @@ -533,8 +519,7 @@ static char *subtitle; /* Current subtitle */ static unsigned int on_page; /* Number of lines printed on current page */ static void -listing_page (list) - list_info_type *list; +listing_page (list_info_type *list) { /* Grope around, see if we can see a title or subtitle edict coming up soon. (we look down 10 lines of the page and see if it's there) */ @@ -577,8 +562,7 @@ listing_page (list) } static unsigned int -calc_hex (list) - list_info_type *list; +calc_hex (list_info_type *list) { int data_buffer_size; list_info_type *first = list; @@ -605,9 +589,7 @@ calc_hex (list) && data_buffer_size < MAX_BYTES - 3) { if (address == ~(unsigned int) 0) - { - address = frag_ptr->fr_address / OCTETS_PER_BYTE; - } + address = frag_ptr->fr_address / OCTETS_PER_BYTE; sprintf (data_buffer + data_buffer_size, "%02X", @@ -626,9 +608,8 @@ calc_hex (list) && data_buffer_size < MAX_BYTES - 3) { if (address == ~(unsigned int) 0) - { - address = frag_ptr->fr_address / OCTETS_PER_BYTE; - } + address = frag_ptr->fr_address / OCTETS_PER_BYTE; + sprintf (data_buffer + data_buffer_size, "%02X", (frag_ptr->fr_literal[var_rep_idx]) & 0xff); @@ -653,11 +634,8 @@ calc_hex (list) } static void -print_lines (list, lineno, string, address) - list_info_type *list; - unsigned int lineno; - char *string; - unsigned int address; +print_lines (list_info_type *list, unsigned int lineno, + char *string, unsigned int address) { unsigned int idx; unsigned int nchars; @@ -761,7 +739,7 @@ print_lines (list, lineno, string, address) } static void -list_symbol_table () +list_symbol_table (void) { extern symbolS *symbol_rootP; int got_some = 0; @@ -869,11 +847,8 @@ list_symbol_table () } static void -print_source (current_file, list, buffer, width) - file_info_type *current_file; - list_info_type *list; - char *buffer; - unsigned int width; +print_source (file_info_type *current_file, list_info_type *list, + char *buffer, unsigned int width) { if (!current_file->at_end) { @@ -881,6 +856,7 @@ print_source (current_file, list, buffer, width) && !current_file->at_end) { char *p = buffer_line (current_file, buffer, width); + fprintf (list_file, "%4u:%-13s **** %s\n", current_file->linenum, current_file->filename, p); on_page++; @@ -893,9 +869,7 @@ print_source (current_file, list, buffer, width) records inserted by the compiler, see if the line is suspicious. */ static int -debugging_pseudo (list, line) - list_info_type *list; - const char *line; +debugging_pseudo (list_info_type *list, const char *line) { static int in_debug; int was_debug; @@ -955,7 +929,6 @@ debugging_pseudo (list, line) return 1; if (strncmp (line, "tag", 3) == 0) return 1; - if (strncmp (line, "stabs", 5) == 0) return 1; if (strncmp (line, "stabn", 5) == 0) @@ -965,8 +938,7 @@ debugging_pseudo (list, line) } static void -listing_listing (name) - char *name ATTRIBUTE_UNUSED; +listing_listing (char *name ATTRIBUTE_UNUSED) { list_info_type *list = head; file_info_type *current_hll_file = (file_info_type *) NULL; @@ -986,7 +958,6 @@ listing_listing (name) if (list->next) list->frag = list->next->frag; list = list->next; - } list = head->next; @@ -1048,24 +1019,19 @@ listing_listing (name) message = 0; if (list->hll_file) - { - current_hll_file = list->hll_file; - } + current_hll_file = list->hll_file; if (current_hll_file && list->hll_line && (listing & LISTING_HLL)) - { - print_source (current_hll_file, list, buffer, width); - } + print_source (current_hll_file, list, buffer, width); if (list->line_contents) { if (!((listing & LISTING_NODEBUG) && debugging_pseudo (list, list->line_contents))) - { - print_lines (list, - list->file->linenum == 0 ? list->line : list->file->linenum, - list->line_contents, calc_hex (list)); - } + print_lines (list, + list->file->linenum == 0 ? list->line : list->file->linenum, + list->line_contents, calc_hex (list)); + free (list->line_contents); list->line_contents = NULL; } @@ -1090,9 +1056,7 @@ listing_listing (name) } if (list->edict == EDICT_EJECT) - { - eject = 1; - } + eject = 1; } if (list->edict == EDICT_NOLIST_NEXT && show_listing == 1) @@ -1107,8 +1071,7 @@ listing_listing (name) } void -listing_print (name) - char *name; +listing_print (char *name) { int using_stdout; @@ -1127,6 +1090,9 @@ listing_print (name) using_stdout = 0; else { +#ifdef BFD_ASSEMBLER + bfd_set_error (bfd_error_system_call); +#endif as_perror (_("can't open list file: %s"), name); list_file = stdout; using_stdout = 1; @@ -1134,50 +1100,44 @@ listing_print (name) } if (listing & LISTING_NOFORM) - { - paper_height = 0; - } + paper_height = 0; if (listing & LISTING_LISTING) - { - listing_listing (name); - } + listing_listing (name); if (listing & LISTING_SYMBOLS) - { - list_symbol_table (); - } + list_symbol_table (); if (! using_stdout) { if (fclose (list_file) == EOF) - as_perror (_("error closing list file: %s"), name); + { +#ifdef BFD_ASSEMBLER + bfd_set_error (bfd_error_system_call); +#endif + as_perror (_("error closing list file: %s"), name); + } } if (last_open_file) - { - fclose (last_open_file); - } + fclose (last_open_file); } void -listing_file (name) - const char *name; +listing_file (const char *name) { fn = name; } void -listing_eject (ignore) - int ignore ATTRIBUTE_UNUSED; +listing_eject (int ignore ATTRIBUTE_UNUSED) { if (listing) listing_tail->edict = EDICT_EJECT; } void -listing_flags (ignore) - int ignore ATTRIBUTE_UNUSED; +listing_flags (int ignore ATTRIBUTE_UNUSED) { while ((*input_line_pointer++) && (*input_line_pointer != '\n')) input_line_pointer++; @@ -1190,8 +1150,7 @@ listing_flags (ignore) the current line should be listed, but the next line should not. */ void -listing_list (on) - int on; +listing_list (int on) { if (listing) { @@ -1220,8 +1179,7 @@ listing_list (on) } void -listing_psize (width_only) - int width_only; +listing_psize (int width_only) { if (! width_only) { @@ -1248,15 +1206,13 @@ listing_psize (width_only) } void -listing_nopage (ignore) - int ignore ATTRIBUTE_UNUSED; +listing_nopage (int ignore ATTRIBUTE_UNUSED) { paper_height = 0; } void -listing_title (depth) - int depth; +listing_title (int depth) { int quoted; char *start; @@ -1308,8 +1264,7 @@ listing_title (depth) } void -listing_source_line (line) - unsigned int line; +listing_source_line (unsigned int line) { if (listing) { @@ -1320,8 +1275,7 @@ listing_source_line (line) } void -listing_source_file (file) - const char *file; +listing_source_file (const char *file) { if (listing) listing_tail->hll_file = file_info (file); @@ -1332,73 +1286,59 @@ listing_source_file (file) /* Dummy functions for when compiled without listing enabled. */ void -listing_flags (ignore) - int ignore; +listing_flags (int ignore) { s_ignore (0); } void -listing_list (on) - int on; +listing_list (int on) { s_ignore (0); } void -listing_eject (ignore) - int ignore; +listing_eject (int ignore) { s_ignore (0); } void -listing_psize (ignore) - int ignore; +listing_psize (int ignore) { s_ignore (0); } void -listing_nopage (ignore) - int ignore; +listing_nopage (int ignore) { s_ignore (0); } void -listing_title (depth) - int depth; +listing_title (int depth) { s_ignore (0); } void -listing_file (name) - const char *name; +listing_file (const char *name) { - } void -listing_newline (name) - char *name; +listing_newline (char *name) { - } void -listing_source_line (n) - unsigned int n; +listing_source_line (unsigned int n) { - } void -listing_source_file (n) - const char *n; +listing_source_file (const char *n) { - } #endif diff --git a/contrib/binutils/gas/listing.h b/contrib/binutils/gas/listing.h index 3301735..424b664 100644 --- a/contrib/binutils/gas/listing.h +++ b/contrib/binutils/gas/listing.h @@ -41,21 +41,21 @@ #define LISTING_SKIP_COND() ((listing & LISTING_NOCOND) != 0) -void listing_eject PARAMS ((int)); -void listing_error PARAMS ((const char *message)); -void listing_file PARAMS ((const char *name)); -void listing_flags PARAMS ((int)); -void listing_list PARAMS ((int on)); -void listing_newline PARAMS ((char *ps)); -void listing_prev_line PARAMS ((void)); -void listing_print PARAMS ((char *name)); -void listing_psize PARAMS ((int)); -void listing_nopage PARAMS ((int)); -void listing_source_file PARAMS ((const char *)); -void listing_source_line PARAMS ((unsigned int)); -void listing_title PARAMS ((int depth)); -void listing_warning PARAMS ((const char *message)); -void listing_width PARAMS ((unsigned int x)); +void listing_eject (int); +void listing_error (const char *message); +void listing_file (const char *name); +void listing_flags (int); +void listing_list (int on); +void listing_newline (char *ps); +void listing_prev_line (void); +void listing_print (char *name); +void listing_psize (int); +void listing_nopage (int); +void listing_source_file (const char *); +void listing_source_line (unsigned int); +void listing_title (int depth); +void listing_warning (const char *message); +void listing_width (unsigned int x); extern int listing_lhs_width; extern int listing_lhs_width_second; diff --git a/contrib/binutils/gas/macro.c b/contrib/binutils/gas/macro.c index 0842431..0991744 100644 --- a/contrib/binutils/gas/macro.c +++ b/contrib/binutils/gas/macro.c @@ -1,5 +1,5 @@ -/* macro.c - macro support for gas and gasp - Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +/* macro.c - macro support for gas + Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. Written by Steve and Judy Chamberlain of Cygnus Support, @@ -63,20 +63,19 @@ extern void *alloca (); #include "asintl.h" /* The routines in this file handle macro definition and expansion. - They are called by both gasp and gas. */ + They are called by gas. */ /* Internal functions. */ -static int get_token PARAMS ((int, sb *, sb *)); -static int getstring PARAMS ((int, sb *, sb *)); -static int get_any_string PARAMS ((int, sb *, sb *, int, int)); -static int do_formals PARAMS ((macro_entry *, int, sb *)); -static int get_apost_token PARAMS ((int, sb *, sb *, int)); -static int sub_actual - PARAMS ((int, sb *, sb *, struct hash_control *, int, sb *, int)); +static int get_token (int, sb *, sb *); +static int getstring (int, sb *, sb *); +static int get_any_string (int, sb *, sb *, int, int); +static int do_formals (macro_entry *, int, sb *); +static int get_apost_token (int, sb *, sb *, int); +static int sub_actual (int, sb *, sb *, struct hash_control *, int, sb *, int); static const char *macro_expand_body - PARAMS ((sb *, sb *, formal_entry *, struct hash_control *, int, int)); -static const char *macro_expand PARAMS ((int, sb *, macro_entry *, sb *, int)); + (sb *, sb *, formal_entry *, struct hash_control *, int); +static const char *macro_expand (int, sb *, macro_entry *, sb *); #define ISWHITE(x) ((x) == ' ' || (x) == '\t') @@ -93,13 +92,13 @@ static const char *macro_expand PARAMS ((int, sb *, macro_entry *, sb *, int)); /* The macro hash table. */ -static struct hash_control *macro_hash; +struct hash_control *macro_hash; /* Whether any macros have been defined. */ int macro_defined; -/* Whether we are in GASP alternate mode. */ +/* Whether we are in alternate syntax mode. */ static int macro_alternate; @@ -113,7 +112,7 @@ static int macro_strip_at; /* Function to use to parse an expression. */ -static int (*macro_expr) PARAMS ((const char *, int, sb *, int *)); +static int (*macro_expr) (const char *, int, sb *, int *); /* Number of macro expansions that have been done. */ @@ -122,11 +121,8 @@ static int macro_number; /* Initialize macro processing. */ void -macro_init (alternate, mri, strip_at, expr) - int alternate; - int mri; - int strip_at; - int (*expr) PARAMS ((const char *, int, sb *, int *)); +macro_init (int alternate, int mri, int strip_at, + int (*expr) (const char *, int, sb *, int *)) { macro_hash = hash_new (); macro_defined = 0; @@ -139,8 +135,7 @@ macro_init (alternate, mri, strip_at, expr) /* Switch in and out of MRI mode on the fly. */ void -macro_mri_mode (mri) - int mri; +macro_mri_mode (int mri) { macro_mri = mri; } @@ -152,11 +147,8 @@ macro_mri_mode (mri) Return 1 on success, 0 on unexpected EOF. */ int -buffer_and_nest (from, to, ptr, get_line) - const char *from; - const char *to; - sb *ptr; - int (*get_line) PARAMS ((sb *)); +buffer_and_nest (const char *from, const char *to, sb *ptr, + int (*get_line) (sb *)) { int from_len = strlen (from); int to_len = strlen (to); @@ -222,8 +214,8 @@ buffer_and_nest (from, to, ptr, get_line) } } - /* Add a CR to the end and keep running. */ - sb_add_char (ptr, '\n'); + /* Add the original end-of-line char to the end and keep running. */ + sb_add_char (ptr, more); line_start = ptr->len; more = get_line (ptr); } @@ -235,10 +227,7 @@ buffer_and_nest (from, to, ptr, get_line) /* Pick up a token. */ static int -get_token (idx, in, name) - int idx; - sb *in; - sb *name; +get_token (int idx, sb *in, sb *name) { if (idx < in->len && (ISALPHA (in->ptr[idx]) @@ -263,10 +252,7 @@ get_token (idx, in, name) /* Pick up a string. */ static int -getstring (idx, in, acc) - int idx; - sb *in; - sb *acc; +getstring (int idx, sb *in, sb *acc) { idx = sb_skip_white (idx, in); @@ -354,19 +340,14 @@ getstring (idx, in, acc) */ static int -get_any_string (idx, in, out, expand, pretend_quoted) - int idx; - sb *in; - sb *out; - int expand; - int pretend_quoted; +get_any_string (int idx, sb *in, sb *out, int expand, int pretend_quoted) { sb_reset (out); idx = sb_skip_white (idx, in); if (idx < in->len) { - if (in->len > 2 && in->ptr[idx + 1] == '\'' && ISBASE (in->ptr[idx])) + if (in->len > idx + 2 && in->ptr[idx + 1] == '\'' && ISBASE (in->ptr[idx])) { while (!ISSEP (in->ptr[idx])) sb_add_char (out, in->ptr[idx++]); @@ -439,10 +420,7 @@ get_any_string (idx, in, out, expand, pretend_quoted) /* Pick up the formal parameters of a macro definition. */ static int -do_formals (macro, idx, in) - macro_entry *macro; - int idx; - sb *in; +do_formals (macro_entry *macro, int idx, sb *in) { formal_entry **p = ¯o->formals; @@ -522,12 +500,8 @@ do_formals (macro, idx, in) the macro which was defined. */ const char * -define_macro (idx, in, label, get_line, namep) - int idx; - sb *in; - sb *label; - int (*get_line) PARAMS ((sb *)); - const char **namep; +define_macro (int idx, sb *in, sb *label, + int (*get_line) (sb *), const char **namep) { macro_entry *macro; sb name; @@ -583,11 +557,7 @@ define_macro (idx, in, label, get_line, namep) /* Scan a token, and then skip KIND. */ static int -get_apost_token (idx, in, name, kind) - int idx; - sb *in; - sb *name; - int kind; +get_apost_token (int idx, sb *in, sb *name, int kind) { idx = get_token (idx, in, name); if (idx < in->len @@ -601,14 +571,8 @@ get_apost_token (idx, in, name, kind) /* Substitute the actual value for a formal parameter. */ static int -sub_actual (start, in, t, formal_hash, kind, out, copyifnotthere) - int start; - sb *in; - sb *t; - struct hash_control *formal_hash; - int kind; - sb *out; - int copyifnotthere; +sub_actual (int start, sb *in, sb *t, struct hash_control *formal_hash, + int kind, sb *out, int copyifnotthere) { int src; formal_entry *ptr; @@ -637,6 +601,7 @@ sub_actual (start, in, t, formal_hash, kind, out, copyifnotthere) { /* Doing this permits people to use & in macro bodies. */ sb_add_char (out, '&'); + sb_add_sb (out, t); } else if (copyifnotthere) { @@ -653,13 +618,8 @@ sub_actual (start, in, t, formal_hash, kind, out, copyifnotthere) /* Expand the body of a macro. */ static const char * -macro_expand_body (in, out, formals, formal_hash, comment_char, locals) - sb *in; - sb *out; - formal_entry *formals; - struct hash_control *formal_hash; - int comment_char; - int locals; +macro_expand_body (sb *in, sb *out, formal_entry *formals, + struct hash_control *formal_hash, int locals) { sb t; int src = 0; @@ -689,14 +649,7 @@ macro_expand_body (in, out, formals, formal_hash, comment_char, locals) else if (in->ptr[src] == '\\') { src++; - if (in->ptr[src] == comment_char && comment_char != '\0') - { - /* This is a comment, just drop the rest of the line. */ - while (src < in->len - && in->ptr[src] != '\n') - src++; - } - else if (in->ptr[src] == '(') + if (in->ptr[src] == '(') { /* Sub in till the next ')' literally. */ src++; @@ -779,7 +732,7 @@ macro_expand_body (in, out, formals, formal_hash, comment_char, locals) formal_entry *f; src = sb_skip_white (src + 5, in); - while (in->ptr[src] != '\n' && in->ptr[src] != comment_char) + while (in->ptr[src] != '\n') { static int loccnt; char buf[20]; @@ -806,17 +759,6 @@ macro_expand_body (in, out, formals, formal_hash, comment_char, locals) } } } - else if (comment_char != '\0' - && in->ptr[src] == comment_char - && src + 1 < in->len - && in->ptr[src + 1] == comment_char - && !inquote) - { - /* Two comment chars in a row cause the rest of the line to - be dropped. */ - while (src < in->len && in->ptr[src] != '\n') - src++; - } else if (in->ptr[src] == '"' || (macro_mri && in->ptr[src] == '\'')) { @@ -899,12 +841,7 @@ macro_expand_body (in, out, formals, formal_hash, comment_char, locals) body. */ static const char * -macro_expand (idx, in, m, out, comment_char) - int idx; - sb *in; - macro_entry *m; - sb *out; - int comment_char; +macro_expand (int idx, sb *in, macro_entry *m, sb *out) { sb t; formal_entry *ptr; @@ -954,7 +891,7 @@ macro_expand (idx, in, m, out, comment_char) /* Peel off the actuals and store them away in the hash tables' actuals. */ idx = sb_skip_white (idx, in); - while (idx < in->len && in->ptr[idx] != comment_char) + while (idx < in->len) { int scan; @@ -1056,8 +993,7 @@ macro_expand (idx, in, m, out, comment_char) sb_add_string (&ptr->actual, buffer); } - err = macro_expand_body (&m->sub, out, m->formals, m->formal_hash, - comment_char, 1); + err = macro_expand_body (&m->sub, out, m->formals, m->formal_hash, 1); if (err != NULL) return err; @@ -1090,16 +1026,11 @@ macro_expand (idx, in, m, out, comment_char) } /* Check for a macro. If one is found, put the expansion into - *EXPAND. COMMENT_CHAR is the comment character--this is used by - gasp. Return 1 if a macro is found, 0 otherwise. */ + *EXPAND. Return 1 if a macro is found, 0 otherwise. */ int -check_macro (line, expand, comment_char, error, info) - const char *line; - sb *expand; - int comment_char; - const char **error; - macro_entry **info; +check_macro (const char *line, sb *expand, + const char **error, macro_entry **info) { const char *s; char *copy, *cs; @@ -1135,7 +1066,7 @@ check_macro (line, expand, comment_char, error, info) sb_add_char (&line_sb, *s++); sb_new (expand); - *error = macro_expand (0, &line_sb, macro, expand, comment_char); + *error = macro_expand (0, &line_sb, macro, expand); sb_kill (&line_sb); @@ -1149,8 +1080,7 @@ check_macro (line, expand, comment_char, error, info) /* Delete a macro. */ void -delete_macro (name) - const char *name; +delete_macro (const char *name) { hash_delete (macro_hash, name); } @@ -1160,13 +1090,7 @@ delete_macro (name) success, or an error message otherwise. */ const char * -expand_irp (irpc, idx, in, out, get_line, comment_char) - int irpc; - int idx; - sb *in; - sb *out; - int (*get_line) PARAMS ((sb *)); - int comment_char; +expand_irp (int irpc, int idx, sb *in, sb *out, int (*get_line) (sb *)) { const char *mn; sb sub; @@ -1204,10 +1128,10 @@ expand_irp (irpc, idx, in, out, get_line, comment_char) sb_reset (out); idx = sb_skip_comma (idx, in); - if (idx >= in->len || in->ptr[idx] == comment_char) + if (idx >= in->len) { /* Expand once with a null string. */ - err = macro_expand_body (&sub, out, &f, h, comment_char, 0); + err = macro_expand_body (&sub, out, &f, h, 0); if (err != NULL) return err; } @@ -1215,7 +1139,7 @@ expand_irp (irpc, idx, in, out, get_line, comment_char) { if (irpc && in->ptr[idx] == '"') ++idx; - while (idx < in->len && in->ptr[idx] != comment_char) + while (idx < in->len) { if (!irpc) idx = get_any_string (idx, in, &f.actual, 1, 0); @@ -1226,7 +1150,7 @@ expand_irp (irpc, idx, in, out, get_line, comment_char) int nxt; nxt = sb_skip_white (idx + 1, in); - if (nxt >= in->len || in->ptr[nxt] == comment_char) + if (nxt >= in->len) { idx = nxt; break; @@ -1236,7 +1160,7 @@ expand_irp (irpc, idx, in, out, get_line, comment_char) sb_add_char (&f.actual, in->ptr[idx]); ++idx; } - err = macro_expand_body (&sub, out, &f, h, comment_char, 0); + err = macro_expand_body (&sub, out, &f, h, 0); if (err != NULL) return err; if (!irpc) diff --git a/contrib/binutils/gas/macro.h b/contrib/binutils/gas/macro.h index b9dc2d0..a8bffaa 100644 --- a/contrib/binutils/gas/macro.h +++ b/contrib/binutils/gas/macro.h @@ -1,5 +1,5 @@ -/* macro.h - header file for macro support for gas and gasp - Copyright 1994, 1995, 1996, 1997, 1998, 2000 +/* macro.h - header file for macro support for gas + Copyright 1994, 1995, 1996, 1997, 1998, 2000, 2002 Free Software Foundation, Inc. Written by Steve and Judy Chamberlain of Cygnus Support, @@ -35,16 +35,16 @@ list of formal arguments, and also keeps a hash table which points into the list to speed up formal search. Each formal knows its name and its default value. Each time the macro is expanded, the - formals get the actual values attatched to them. */ + formals get the actual values attached to them. */ -/* describe the formal arguments to a macro */ +/* Describe the formal arguments to a macro. */ typedef struct formal_struct { - struct formal_struct *next; /* next formal in list */ - sb name; /* name of the formal */ - sb def; /* the default value */ - sb actual; /* the actual argument (changed on each expansion) */ - int index; /* the index of the formal 0..formal_count-1 */ + struct formal_struct *next; /* Next formal in list. */ + sb name; /* Name of the formal. */ + sb def; /* The default value. */ + sb actual; /* The actual argument (changed on each expansion). */ + int index; /* The index of the formal 0..formal_count - 1. */ } formal_entry; /* Other values found in the index field of a formal_entry. */ @@ -52,13 +52,14 @@ typedef struct formal_struct { #define NARG_INDEX (-2) #define LOCAL_INDEX (-3) -/* describe the macro. */ +/* Describe the macro. */ -typedef struct macro_struct { - sb sub; /* substitution text. */ - int formal_count; /* number of formal args. */ - formal_entry *formals; /* pointer to list of formal_structs */ - struct hash_control *formal_hash; /* hash table of formals. */ +typedef struct macro_struct +{ + sb sub; /* Substitution text. */ + int formal_count; /* Number of formal args. */ + formal_entry *formals; /* Pointer to list of formal_structs. */ + struct hash_control *formal_hash; /* Hash table of formals. */ } macro_entry; /* Whether any macros have been defined. */ @@ -69,19 +70,14 @@ extern int macro_defined; extern int macro_nest; -extern int buffer_and_nest - PARAMS ((const char *, const char *, sb *, int (*) PARAMS ((sb *)))); +extern int buffer_and_nest (const char *, const char *, sb *, int (*) (sb *)); extern void macro_init - PARAMS ((int alternate, int mri, int strip_at, - int (*) PARAMS ((const char *, int, sb *, int *)))); -extern void macro_mri_mode PARAMS ((int)); + (int, int, int, int (*) (const char *, int, sb *, int *)); +extern void macro_mri_mode (int); extern const char *define_macro - PARAMS ((int idx, sb *in, sb *label, int (*get_line) PARAMS ((sb *)), - const char **namep)); -extern int check_macro PARAMS ((const char *, sb *, int, const char **, - macro_entry **)); -extern void delete_macro PARAMS ((const char *)); -extern const char *expand_irp - PARAMS ((int, int, sb *, sb *, int (*) PARAMS ((sb *)), int)); + (int, sb *, sb *, int (*) (sb *), const char **); +extern int check_macro (const char *, sb *, const char **, macro_entry **); +extern void delete_macro (const char *); +extern const char *expand_irp (int, int, sb *, sb *, int (*) (sb *)); #endif diff --git a/contrib/binutils/gas/messages.c b/contrib/binutils/gas/messages.c index e85deec..005cd22 100644 --- a/contrib/binutils/gas/messages.c +++ b/contrib/binutils/gas/messages.c @@ -1,5 +1,5 @@ /* messages.c - error reporter - - Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001 + Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1998, 2000, 2001, 2003 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -42,53 +42,52 @@ typedef int * va_list; #define va_end(ARGS) #endif -static void identify PARAMS ((char *)); -static void as_show_where PARAMS ((void)); -static void as_warn_internal PARAMS ((char *, unsigned int, char *)); -static void as_bad_internal PARAMS ((char *, unsigned int, char *)); +static void identify (char *); +static void as_show_where (void); +static void as_warn_internal (char *, unsigned int, char *); +static void as_bad_internal (char *, unsigned int, char *); /* Despite the rest of the comments in this file, (FIXME-SOON), - * here is the current scheme for error messages etc: - * - * as_fatal() is used when gas is quite confused and - * continuing the assembly is pointless. In this case we - * exit immediately with error status. - * - * as_bad() is used to mark errors that result in what we - * presume to be a useless object file. Say, we ignored - * something that might have been vital. If we see any of - * these, assembly will continue to the end of the source, - * no object file will be produced, and we will terminate - * with error status. The new option, -Z, tells us to - * produce an object file anyway but we still exit with - * error status. The assumption here is that you don't want - * this object file but we could be wrong. - * - * as_warn() is used when we have an error from which we - * have a plausible error recovery. eg, masking the top - * bits of a constant that is longer than will fit in the - * destination. In this case we will continue to assemble - * the source, although we may have made a bad assumption, - * and we will produce an object file and return normal exit - * status (ie, no error). The new option -X tells us to - * treat all as_warn() errors as as_bad() errors. That is, - * no object file will be produced and we will exit with - * error status. The idea here is that we don't kill an - * entire make because of an error that we knew how to - * correct. On the other hand, sometimes you might want to - * stop the make at these points. - * - * as_tsktsk() is used when we see a minor error for which - * our error recovery action is almost certainly correct. - * In this case, we print a message and then assembly - * continues as though no error occurred. - */ + here is the current scheme for error messages etc: + + as_fatal() is used when gas is quite confused and + continuing the assembly is pointless. In this case we + exit immediately with error status. + + as_bad() is used to mark errors that result in what we + presume to be a useless object file. Say, we ignored + something that might have been vital. If we see any of + these, assembly will continue to the end of the source, + no object file will be produced, and we will terminate + with error status. The new option, -Z, tells us to + produce an object file anyway but we still exit with + error status. The assumption here is that you don't want + this object file but we could be wrong. + + as_warn() is used when we have an error from which we + have a plausible error recovery. eg, masking the top + bits of a constant that is longer than will fit in the + destination. In this case we will continue to assemble + the source, although we may have made a bad assumption, + and we will produce an object file and return normal exit + status (ie, no error). The new option -X tells us to + treat all as_warn() errors as as_bad() errors. That is, + no object file will be produced and we will exit with + error status. The idea here is that we don't kill an + entire make because of an error that we knew how to + correct. On the other hand, sometimes you might want to + stop the make at these points. + + as_tsktsk() is used when we see a minor error for which + our error recovery action is almost certainly correct. + In this case, we print a message and then assembly + continues as though no error occurred. */ static void -identify (file) - char *file; +identify (char *file) { static int identified; + if (identified) return; identified++; @@ -108,9 +107,9 @@ identify (file) static int warning_count; int -had_warnings () +had_warnings (void) { - return (warning_count); + return warning_count; } /* Nonzero if we've hit a 'bad error', and should not write an obj file, @@ -119,15 +118,15 @@ had_warnings () static int error_count; int -had_errors () +had_errors (void) { - return (error_count); + return error_count; } /* Print the current location to stderr. */ static void -as_show_where () +as_show_where (void) { char *file; unsigned int line; @@ -141,14 +140,15 @@ as_show_where () /* Like perror(3), but with more info. */ void -as_perror (gripe, filename) - const char *gripe; /* Unpunctuated error theme. */ - const char *filename; +as_perror (const char *gripe, /* Unpunctuated error theme. */ + const char *filename) { const char *errtxt; + int saved_errno = errno; as_show_where (); fprintf (stderr, gripe, filename); + errno = saved_errno; #ifdef BFD_ASSEMBLER errtxt = bfd_errmsg (bfd_get_error ()); #else @@ -198,10 +198,7 @@ as_tsktsk (format, va_alist) /* The common portion of as_warn and as_warn_where. */ static void -as_warn_internal (file, line, buffer) - char *file; - unsigned int line; - char *buffer; +as_warn_internal (char *file, unsigned int line, char *buffer) { ++warning_count; @@ -302,10 +299,7 @@ as_warn_where (file, line, format, va_alist) /* The common portion of as_bad and as_bad_where. */ static void -as_bad_internal (file, line, buffer) - char *file; - unsigned int line; - char *buffer; +as_bad_internal (char *file, unsigned int line, char *buffer) { ++error_count; @@ -442,9 +436,7 @@ as_fatal (format, va_alist) Arguments: Filename, line number, optional function name. */ void -as_assert (file, line, fn) - const char *file, *fn; - int line; +as_assert (const char *file, int line, const char *fn) { as_show_where (); fprintf (stderr, _("Internal error!\n")); @@ -461,9 +453,7 @@ as_assert (file, line, fn) and exit without producing a core file. */ void -as_abort (file, line, fn) - const char *file, *fn; - int line; +as_abort (const char *file, int line, const char *fn) { as_show_where (); if (fn) @@ -479,9 +469,7 @@ as_abort (file, line, fn) /* Support routines. */ void -fprint_value (file, val) - FILE *file; - valueT val; +fprint_value (FILE *file, valueT val) { if (sizeof (val) <= sizeof (long)) { @@ -499,9 +487,7 @@ fprint_value (file, val) } void -sprint_value (buf, val) - char *buf; - valueT val; +sprint_value (char *buf, valueT val) { if (sizeof (val) <= sizeof (long)) { diff --git a/contrib/binutils/gas/obj.h b/contrib/binutils/gas/obj.h index 846627a..497524a 100644 --- a/contrib/binutils/gas/obj.h +++ b/contrib/binutils/gas/obj.h @@ -1,7 +1,7 @@ /* obj.h - defines the object dependent hooks for all object format backends. - Copyright 1987, 1990, 1991, 1992, 1993, 1995, 1996, 1997, 1999, 2000 + Copyright 1987, 1990, 1991, 1992, 1993, 1995, 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -21,27 +21,27 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -char *obj_default_output_file_name PARAMS ((void)); -void obj_emit_relocations PARAMS ((char **where, fixS * fixP, - relax_addressT segment_address_in_file)); -void obj_emit_strings PARAMS ((char **where)); -void obj_emit_symbols PARAMS ((char **where, symbolS * symbols)); +char *obj_default_output_file_name (void); +void obj_emit_relocations (char **where, fixS * fixP, + relax_addressT segment_address_in_file); +void obj_emit_strings (char **where); +void obj_emit_symbols (char **where, symbolS * symbols); #ifndef obj_read_begin_hook -void obj_read_begin_hook PARAMS ((void)); +void obj_read_begin_hook (void); #endif #ifndef BFD_ASSEMBLER -void obj_crawl_symbol_chain PARAMS ((object_headers * headers)); -void obj_header_append PARAMS ((char **where, object_headers * headers)); +void obj_crawl_symbol_chain (object_headers * headers); +void obj_header_append (char **where, object_headers * headers); #ifndef obj_pre_write_hook -void obj_pre_write_hook PARAMS ((object_headers * headers)); +void obj_pre_write_hook (object_headers * headers); #endif #endif #ifndef obj_symbol_new_hook -void obj_symbol_new_hook PARAMS ((symbolS * symbolP)); +void obj_symbol_new_hook (symbolS * symbolP); #endif -void obj_symbol_to_chars PARAMS ((char **where, symbolS * symbolP)); +void obj_symbol_to_chars (char **where, symbolS * symbolP); extern const pseudo_typeS obj_pseudo_table[]; @@ -50,34 +50,35 @@ struct format_ops { int flavor; unsigned dfl_leading_underscore : 1; unsigned emit_section_symbols : 1; - void (*begin) PARAMS ((void)); - void (*app_file) PARAMS ((const char *)); - void (*frob_symbol) PARAMS ((symbolS *, int *)); - void (*frob_file) PARAMS ((void)); - void (*frob_file_before_adjust) PARAMS ((void)); - void (*frob_file_after_relocs) PARAMS ((void)); - bfd_vma (*s_get_size) PARAMS ((symbolS *)); - void (*s_set_size) PARAMS ((symbolS *, bfd_vma)); - bfd_vma (*s_get_align) PARAMS ((symbolS *)); - void (*s_set_align) PARAMS ((symbolS *, bfd_vma)); - int (*s_get_other) PARAMS ((symbolS *)); - void (*s_set_other) PARAMS ((symbolS *, int)); - int (*s_get_desc) PARAMS ((symbolS *)); - void (*s_set_desc) PARAMS ((symbolS *, int)); - int (*s_get_type) PARAMS ((symbolS *)); - void (*s_set_type) PARAMS ((symbolS *, int)); - void (*copy_symbol_attributes) PARAMS ((symbolS *, symbolS *)); - void (*generate_asm_lineno) PARAMS ((void)); - void (*process_stab) PARAMS ((segT, int, const char *, int, int, int)); - int (*separate_stab_sections) PARAMS ((void)); - void (*init_stab_section) PARAMS ((segT)); - int (*sec_sym_ok_for_reloc) PARAMS ((asection *)); - void (*pop_insert) PARAMS ((void)); + void (*begin) (void); + void (*app_file) (const char *); + void (*frob_symbol) (symbolS *, int *); + void (*frob_file) (void); + void (*frob_file_before_adjust) (void); + void (*frob_file_before_fix) (void); + void (*frob_file_after_relocs) (void); + bfd_vma (*s_get_size) (symbolS *); + void (*s_set_size) (symbolS *, bfd_vma); + bfd_vma (*s_get_align) (symbolS *); + void (*s_set_align) (symbolS *, bfd_vma); + int (*s_get_other) (symbolS *); + void (*s_set_other) (symbolS *, int); + int (*s_get_desc) (symbolS *); + void (*s_set_desc) (symbolS *, int); + int (*s_get_type) (symbolS *); + void (*s_set_type) (symbolS *, int); + void (*copy_symbol_attributes) (symbolS *, symbolS *); + void (*generate_asm_lineno) (void); + void (*process_stab) (segT, int, const char *, int, int, int); + int (*separate_stab_sections) (void); + void (*init_stab_section) (segT); + int (*sec_sym_ok_for_reloc) (asection *); + void (*pop_insert) (void); /* For configurations using ECOFF_DEBUGGING, this callback is used. */ - void (*ecoff_set_ext) PARAMS ((symbolS *, struct ecoff_extr *)); + void (*ecoff_set_ext) (symbolS *, struct ecoff_extr *); - void (*read_begin_hook) PARAMS ((void)); - void (*symbol_new_hook) PARAMS ((symbolS *)); + void (*read_begin_hook) (void); + void (*symbol_new_hook) (symbolS *); }; extern const struct format_ops elf_format_ops; diff --git a/contrib/binutils/gas/output-file.c b/contrib/binutils/gas/output-file.c index 531e35f..4c376b4 100644 --- a/contrib/binutils/gas/output-file.c +++ b/contrib/binutils/gas/output-file.c @@ -1,5 +1,5 @@ /* output-file.c - Deal with the output file - Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 1999, 2001 + Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 1999, 2001, 2003 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -41,8 +41,7 @@ bfd *stdoutput; void -output_file_create (name) - char *name; +output_file_create (char *name) { if (name[0] == '-' && name[1] == '\0') as_fatal (_("can't open a bfd on stdout %s"), name); @@ -62,8 +61,7 @@ output_file_create (name) } void -output_file_close (filename) - char *filename; +output_file_close (char *filename) { #ifdef BFD_ASSEMBLER /* Close the bfd. */ @@ -86,10 +84,9 @@ output_file_close (filename) #ifndef BFD_ASSEMBLER void -output_file_append (where, length, filename) - char *where ATTRIBUTE_UNUSED; - long length ATTRIBUTE_UNUSED; - char *filename ATTRIBUTE_UNUSED; +output_file_append (char *where ATTRIBUTE_UNUSED, + long length ATTRIBUTE_UNUSED, + char *filename ATTRIBUTE_UNUSED) { abort (); } @@ -100,8 +97,7 @@ output_file_append (where, length, filename) static FILE *stdoutput; void -output_file_create (name) - char *name; +output_file_create (char *name) { if (name[0] == '-' && name[1] == '\0') { @@ -112,17 +108,22 @@ output_file_create (name) stdoutput = fopen (name, FOPEN_WB); if (stdoutput == NULL) { +#ifdef BFD_ASSEMBLER + bfd_set_error (bfd_error_system_call); +#endif as_perror (_("FATAL: can't create %s"), name); exit (EXIT_FAILURE); } } void -output_file_close (filename) - char *filename; +output_file_close (char *filename) { if (EOF == fclose (stdoutput)) { +#ifdef BFD_ASSEMBLER + bfd_set_error (bfd_error_system_call); +#endif as_perror (_("FATAL: can't close %s"), filename); exit (EXIT_FAILURE); } @@ -132,18 +133,17 @@ output_file_close (filename) } void -output_file_append (where, length, filename) - char * where; - long length; - char * filename; +output_file_append (char * where, long length, char * filename) { for (; length; length--, where++) { (void) putc (*where, stdoutput); if (ferror (stdoutput)) - /* if ( EOF == (putc( *where, stdoutput )) ) */ { +#ifdef BFD_ASSEMBLER + bfd_set_error (bfd_error_system_call); +#endif as_perror (_("Failed to emit an object byte"), filename); as_fatal (_("can't continue")); } diff --git a/contrib/binutils/gas/output-file.h b/contrib/binutils/gas/output-file.h index 48b7a6a..6779e4b 100644 --- a/contrib/binutils/gas/output-file.h +++ b/contrib/binutils/gas/output-file.h @@ -19,8 +19,8 @@ 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. */ -void output_file_append PARAMS ((char *where, long length, char *filename)); -void output_file_close PARAMS ((char *filename)); -void output_file_create PARAMS ((char *name)); +void output_file_append (char *where, long length, char *filename); +void output_file_close (char *filename); +void output_file_create (char *name); /* end of output-file.h */ diff --git a/contrib/binutils/gas/po/Make-in b/contrib/binutils/gas/po/Make-in index 0552db1..6176dbf 100644 --- a/contrib/binutils/gas/po/Make-in +++ b/contrib/binutils/gas/po/Make-in @@ -24,6 +24,8 @@ gnulocaledir = $(prefix)/share/locale gettextsrcdir = $(prefix)/share/gettext/po subdir = po +DESTDIR = + INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ MKINSTALLDIRS = @MKINSTALLDIRS@ @@ -111,9 +113,9 @@ install-data: install-data-@USE_NLS@ install-data-no: all install-data-yes: all if test -r $(MKINSTALLDIRS); then \ - $(MKINSTALLDIRS) $(datadir); \ + $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ else \ - $(top_srcdir)/mkinstalldirs $(datadir); \ + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ fi @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ @@ -123,7 +125,7 @@ install-data-yes: all *) destdir=$(localedir);; \ esac; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - dir=$$destdir/$$lang/LC_MESSAGES; \ + dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ if test -r $(MKINSTALLDIRS); then \ $(MKINSTALLDIRS) $$dir; \ else \ @@ -153,12 +155,12 @@ install-data-yes: all done if test "$(PACKAGE)" = "gettext"; then \ if test -r $(MKINSTALLDIRS); then \ - $(MKINSTALLDIRS) $(gettextsrcdir); \ + $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ else \ - $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ + $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ fi; \ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ - $(gettextsrcdir)/Makefile.in.in; \ + $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ else \ : ; \ fi @@ -171,12 +173,12 @@ uninstall: for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ - rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ - rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ - rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ - rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ done - rm -f $(gettextsrcdir)/po-Makefile.in.in + rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in check: all diff --git a/contrib/binutils/gas/po/POTFILES.in b/contrib/binutils/gas/po/POTFILES.in index 6f67bf4..e4e3e4e 100644 --- a/contrib/binutils/gas/po/POTFILES.in +++ b/contrib/binutils/gas/po/POTFILES.in @@ -78,6 +78,8 @@ config/tc-i960.c config/tc-i960.h config/tc-ia64.c config/tc-ia64.h +config/tc-ip2k.c +config/tc-ip2k.h config/tc-m32r.c config/tc-m32r.h config/tc-m68hc11.c @@ -96,6 +98,8 @@ config/tc-mn10200.c config/tc-mn10200.h config/tc-mn10300.c config/tc-mn10300.h +config/tc-msp430.c +config/tc-msp430.h config/tc-ns32k.c config/tc-ns32k.h config/tc-openrisc.c @@ -110,10 +114,10 @@ config/tc-ppc.c config/tc-ppc.h config/tc-s390.c config/tc-s390.h -config/tc-sh.c -config/tc-sh.h config/tc-sh64.c config/tc-sh64.h +config/tc-sh.c +config/tc-sh.h config/tc-sparc.c config/tc-sparc.h config/tc-tahoe.c @@ -132,10 +136,15 @@ config/tc-w65.c config/tc-w65.h config/tc-xstormy16.c config/tc-xstormy16.h +config/tc-xtensa.c +config/tc-xtensa.h config/tc-z8k.c config/tc-z8k.h depend.c depend.c +dw2gencfi.c +dw2gencfi.c +dw2gencfi.h dwarf2dbg.c dwarf2dbg.c dwarf2dbg.h @@ -144,22 +153,21 @@ ecoff.c ecoff.h ehopt.c ehopt.c -emul-target.h emul.h +emul-target.h expr.c expr.c expr.h flonum-copy.c flonum-copy.c +flonum.h flonum-konst.c flonum-konst.c flonum-mult.c flonum-mult.c -flonum.h frags.c frags.c frags.h -gasp.c hash.c hash.c hash.h diff --git a/contrib/binutils/gas/po/gas.pot b/contrib/binutils/gas/po/gas.pot index 45a2485..ae3cbab 100644 --- a/contrib/binutils/gas/po/gas.pot +++ b/contrib/binutils/gas/po/gas.pot @@ -1,13 +1,12 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. +# Copyright (C) YEAR Free Software Foundation, Inc. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2002-10-30 10:07-0500\n" +"POT-Creation-Date: 2003-07-17 14:56+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -15,72 +14,72 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: app.c:476 app.c:490 +#: app.c:474 app.c:488 msgid "end of file in comment" msgstr "" -#: app.c:569 +#: app.c:567 msgid "end of file in string; inserted '\"'" msgstr "" -#: app.c:635 -#, c-format -msgid "unknown escape '\\%c' in string; ignored" +#: app.c:612 +msgid "end of file in string; '\"' inserted" msgstr "" -#: app.c:644 -msgid "end of file in string; '\"' inserted" +#: app.c:638 +#, c-format +msgid "unknown escape '\\%c' in string; ignored" msgstr "" -#: app.c:764 +#: app.c:790 msgid "end of file not at end of a line; newline inserted" msgstr "" -#: app.c:923 +#: app.c:949 msgid "end of file in multiline comment" msgstr "" -#: app.c:987 +#: app.c:1013 msgid "end of file after a one-character quote; \\0 inserted" msgstr "" -#: app.c:995 +#: app.c:1021 msgid "end of file in escape character" msgstr "" -#: app.c:1007 +#: app.c:1033 msgid "missing close quote; (assumed)" msgstr "" -#: app.c:1075 app.c:1129 app.c:1139 app.c:1204 +#: app.c:1101 app.c:1155 app.c:1166 app.c:1231 msgid "end of file in comment; newline inserted" msgstr "" -#: as.c:148 +#: as.c:160 msgid "missing emulation mode name" msgstr "" -#: as.c:163 +#: as.c:175 #, c-format msgid "unrecognized emulation name `%s'" msgstr "" -#: as.c:210 +#: as.c:222 #, c-format msgid "GNU assembler version %s (%s) using BFD version %s" msgstr "" -#: as.c:213 +#: as.c:225 #, c-format msgid "GNU assembler version %s (%s)" msgstr "" -#: as.c:222 +#: as.c:234 #, c-format msgid "Usage: %s [option...] [asmfile...]\n" msgstr "" -#: as.c:224 +#: as.c:236 msgid "" "Options:\n" " -a[sub-option...]\t turn on listings\n" @@ -95,139 +94,148 @@ msgid "" " \t =FILE list to FILE (must be last sub-option)\n" msgstr "" -#: as.c:237 +#: as.c:249 msgid " -D produce assembler debugging messages\n" msgstr "" -#: as.c:239 +#: as.c:251 msgid " --defsym SYM=VAL define symbol SYM to given value\n" msgstr "" -#: as.c:255 +#: as.c:267 #, c-format msgid " emulate output (default %s)\n" msgstr "" -#: as.c:259 +#: as.c:272 +msgid " --execstack require executable stack for this object\n" +msgstr "" + +#: as.c:274 +msgid "" +" --noexecstack don't require executable stack for this object\n" +msgstr "" + +#: as.c:277 msgid " -f skip whitespace and comment preprocessing\n" msgstr "" -#: as.c:261 +#: as.c:279 msgid " --gstabs generate stabs debugging information\n" msgstr "" -#: as.c:263 +#: as.c:281 msgid " --gdwarf2 generate DWARF2 debugging information\n" msgstr "" -#: as.c:265 +#: as.c:283 msgid " --help show this message and exit\n" msgstr "" -#: as.c:267 +#: as.c:285 msgid " --target-help show target specific options\n" msgstr "" -#: as.c:269 +#: as.c:287 msgid "" " -I DIR add DIR to search list for .include directives\n" msgstr "" -#: as.c:271 +#: as.c:289 msgid " -J don't warn about signed overflow\n" msgstr "" -#: as.c:273 +#: as.c:291 msgid "" " -K warn when differences altered for long " "displacements\n" msgstr "" -#: as.c:275 +#: as.c:293 msgid " -L,--keep-locals keep local symbols (e.g. starting with `L')\n" msgstr "" -#: as.c:277 +#: as.c:295 msgid " -M,--mri assemble in MRI compatibility mode\n" msgstr "" -#: as.c:279 +#: as.c:297 msgid "" " --MD FILE write dependency information in FILE (default " "none)\n" msgstr "" -#: as.c:281 +#: as.c:299 msgid " -nocpp ignored\n" msgstr "" -#: as.c:283 +#: as.c:301 msgid "" " -o OBJFILE name the object-file output OBJFILE (default a." "out)\n" msgstr "" -#: as.c:285 +#: as.c:303 msgid " -R fold data section into text section\n" msgstr "" -#: as.c:287 +#: as.c:305 msgid "" " --statistics print various measured statistics from execution\n" msgstr "" -#: as.c:289 +#: as.c:307 msgid " --strip-local-absolute strip local absolute symbols\n" msgstr "" -#: as.c:291 +#: as.c:309 msgid "" " --traditional-format Use same format as native assembler when possible\n" msgstr "" -#: as.c:293 +#: as.c:311 msgid " --version print assembler version number and exit\n" msgstr "" -#: as.c:295 +#: as.c:313 msgid " -W --no-warn suppress warnings\n" msgstr "" -#: as.c:297 +#: as.c:315 msgid " --warn don't suppress warnings\n" msgstr "" -#: as.c:299 +#: as.c:317 msgid " --fatal-warnings treat warnings as errors\n" msgstr "" -#: as.c:301 +#: as.c:319 msgid "" " --itbl INSTTBL extend instruction set to include instructions\n" " matching the specifications defined in file " "INSTTBL\n" msgstr "" -#: as.c:304 +#: as.c:322 msgid " -w ignored\n" msgstr "" -#: as.c:306 +#: as.c:324 msgid " -X ignored\n" msgstr "" -#: as.c:308 +#: as.c:326 msgid " -Z generate object file even after errors\n" msgstr "" -#: as.c:310 +#: as.c:328 msgid "" " --listing-lhs-width set the width in words of the output data column " "of\n" " the listing\n" msgstr "" -#: as.c:313 +#: as.c:331 msgid "" " --listing-lhs-width2 set the width in words of the continuation lines\n" " of the output data column; ignored if smaller " @@ -235,105 +243,105 @@ msgid "" " the width of the first line\n" msgstr "" -#: as.c:317 +#: as.c:335 msgid "" " --listing-rhs-width set the max width in characters of the lines from\n" " the source file\n" msgstr "" -#: as.c:320 +#: as.c:338 msgid "" " --listing-cont-lines set the maximum number of continuation lines used\n" " for the output data column of the listing\n" msgstr "" -#: as.c:327 gasp.c:3592 +#: as.c:345 #, c-format msgid "Report bugs to %s\n" msgstr "" -#: as.c:528 as.c:530 +#: as.c:557 as.c:559 #, c-format msgid "GNU assembler %s\n" msgstr "" -#: as.c:532 +#: as.c:561 msgid "Copyright 2002 Free Software Foundation, Inc.\n" msgstr "" -#: as.c:533 gasp.c:3691 +#: as.c:562 msgid "" "This program is free software; you may redistribute it under the terms of\n" "the GNU General Public License. This program has absolutely no warranty.\n" msgstr "" -#: as.c:536 +#: as.c:565 #, c-format msgid "This assembler was configured for a target of `%s'.\n" msgstr "" -#: as.c:543 +#: as.c:572 msgid "multiple emulation names specified" msgstr "" -#: as.c:545 +#: as.c:574 msgid "emulations not handled in this configuration" msgstr "" -#: as.c:550 +#: as.c:579 #, c-format msgid "alias = %s\n" msgstr "" -#: as.c:551 +#: as.c:580 #, c-format msgid "canonical = %s\n" msgstr "" -#: as.c:552 +#: as.c:581 #, c-format msgid "cpu-type = %s\n" msgstr "" -#: as.c:554 +#: as.c:583 #, c-format msgid "format = %s\n" msgstr "" -#: as.c:557 +#: as.c:586 #, c-format msgid "bfd-target = %s\n" msgstr "" -#: as.c:570 +#: as.c:599 msgid "bad defsym; format is --defsym name=value" msgstr "" -#: as.c:594 +#: as.c:623 msgid "no file name following -t option" msgstr "" -#: as.c:609 +#: as.c:638 #, c-format msgid "failed to read instruction table %s\n" msgstr "" -#: as.c:724 +#: as.c:765 #, c-format msgid "invalid listing option `%c'" msgstr "" -#: as.c:926 +#: as.c:984 #, c-format msgid "%d warnings, treating warnings as errors" msgstr "" -#: as.c:957 +#: as.c:1015 #, c-format msgid "%s: total time in assembly: %ld.%06ld\n" msgstr "" -#: as.c:960 +#: as.c:1018 #, c-format msgid "%s: data size %ld\n" msgstr "" @@ -347,71 +355,71 @@ msgstr "" #. * We have a GROSS internal error. #. * This should never happen. #. -#: atof-generic.c:437 config/tc-m68k.c:2883 +#: atof-generic.c:437 config/tc-m68k.c:2869 msgid "failed sanity check" msgstr "" -#: cond.c:79 +#: cond.c:83 msgid "invalid identifier for \".ifdef\"" msgstr "" -#: cond.c:133 +#: cond.c:151 msgid "non-constant expression in \".if\" statement" msgstr "" -#: cond.c:229 +#: cond.c:247 msgid "bad format for ifc or ifnc" msgstr "" -#: cond.c:260 +#: cond.c:278 msgid "\".elseif\" without matching \".if\"" msgstr "" -#: cond.c:264 +#: cond.c:282 msgid "\".elseif\" after \".else\"" msgstr "" -#: cond.c:267 cond.c:375 +#: cond.c:285 cond.c:393 msgid "here is the previous \"else\"" msgstr "" -#: cond.c:270 cond.c:378 +#: cond.c:288 cond.c:396 msgid "here is the previous \"if\"" msgstr "" -#: cond.c:299 +#: cond.c:317 msgid "non-constant expression in \".elseif\" statement" msgstr "" -#: cond.c:338 +#: cond.c:356 msgid "\".endif\" without \".if\"" msgstr "" -#: cond.c:368 +#: cond.c:386 msgid "\".else\" without matching \".if\"" msgstr "" -#: cond.c:372 +#: cond.c:390 msgid "duplicate \"else\"" msgstr "" -#: cond.c:424 +#: cond.c:442 msgid ".ifeqs syntax error" msgstr "" -#: cond.c:507 +#: cond.c:525 msgid "end of macro inside conditional" msgstr "" -#: cond.c:509 +#: cond.c:527 msgid "end of file inside conditional" msgstr "" -#: cond.c:512 +#: cond.c:530 msgid "here is the start of the unterminated conditional" msgstr "" -#: cond.c:516 +#: cond.c:534 msgid "here is the \"else\" of the unterminated conditional" msgstr "" @@ -425,16 +433,16 @@ msgstr "" msgid "Attempt to put an undefined symbol into set %s" msgstr "" -#: config/obj-aout.c:197 config/obj-coff.c:1274 +#: config/obj-aout.c:197 config/obj-coff.c:1276 #, c-format msgid "Symbol `%s' can not be both weak and common" msgstr "" -#: config/obj-aout.c:255 config/obj-coff.c:2018 +#: config/obj-aout.c:255 config/obj-coff.c:2022 msgid "unresolved relocation" msgstr "" -#: config/obj-aout.c:257 config/obj-coff.c:2020 +#: config/obj-aout.c:257 config/obj-coff.c:2024 #, c-format msgid "bad relocation: symbol `%s' not in symbol table" msgstr "" @@ -444,7 +452,7 @@ msgstr "" msgid "%s: bad type for weak symbol" msgstr "" -#: config/obj-aout.c:458 config/obj-coff.c:2941 write.c:1927 +#: config/obj-aout.c:458 config/obj-coff.c:2945 write.c:1931 #, c-format msgid "%s: global symbols not supported in common sections" msgstr "" @@ -454,11 +462,7 @@ msgstr "" msgid "Local symbol %s never defined." msgstr "" -#: config/obj-aout.c:612 -msgid "subsegment index too high" -msgstr "" - -#: config/obj-bout.c:319 config/obj-vms.c:562 +#: config/obj-bout.c:319 config/obj-vms.c:629 #, c-format msgid "Local symbol %s never defined" msgstr "" @@ -474,7 +478,7 @@ msgid "Line numbers must be positive integers\n" msgstr "" #. Wrong context. -#: config/obj-coff.c:503 config/obj-coff.c:2363 +#: config/obj-coff.c:503 config/obj-coff.c:2367 msgid ".ln pseudo-op inside .def/.endef: ignored." msgstr "" @@ -486,11 +490,11 @@ msgstr "" msgid ".loc pseudo-op inside .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:641 config/obj-coff.c:2415 +#: config/obj-coff.c:641 config/obj-coff.c:2419 msgid ".def pseudo-op used inside of .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:687 config/obj-coff.c:2467 +#: config/obj-coff.c:687 config/obj-coff.c:2471 msgid ".endef pseudo-op used outside of .def/.endef: ignored." msgstr "" @@ -499,341 +503,338 @@ msgstr "" msgid "`%s' symbol without preceding function" msgstr "" -#: config/obj-coff.c:812 config/obj-coff.c:2547 +#: config/obj-coff.c:812 config/obj-coff.c:2551 #, c-format msgid "unexpected storage class %d" msgstr "" -#: config/obj-coff.c:925 config/obj-coff.c:2654 +#: config/obj-coff.c:925 config/obj-coff.c:2658 msgid ".dim pseudo-op used outside of .def/.endef: ignored." msgstr "" -#: config/obj-coff.c:945 config/obj-coff.c:2674 +#: config/obj-coff.c:945 config/obj-coff.c:2678 msgid "badly formed .dim directive ignored" msgstr "" -#: config/obj-coff.c:996 config/obj-coff.c:2734 +#: config/obj-coff.c:996 config/obj-coff.c:2738 msgid ".size pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:1012 config/obj-coff.c:2750 +#: config/obj-coff.c:1012 config/obj-coff.c:2754 msgid ".scl pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:1030 config/obj-coff.c:2768 +#: config/obj-coff.c:1030 config/obj-coff.c:2772 msgid ".tag pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:1049 config/obj-coff.c:2785 +#: config/obj-coff.c:1049 config/obj-coff.c:2789 #, c-format msgid "tag not found for .tag %s" msgstr "" -#: config/obj-coff.c:1064 config/obj-coff.c:2799 +#: config/obj-coff.c:1064 config/obj-coff.c:2803 msgid ".type pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:1086 config/obj-coff.c:2819 +#: config/obj-coff.c:1086 config/obj-coff.c:2823 msgid ".val pseudo-op used outside of .def/.endef ignored." msgstr "" -#: config/obj-coff.c:1231 config/obj-coff.c:3012 +#: config/obj-coff.c:1233 config/obj-coff.c:3016 msgid "mismatched .eb" msgstr "" -#: config/obj-coff.c:1252 config/obj-coff.c:3050 +#: config/obj-coff.c:1254 config/obj-coff.c:3054 msgid "C_EFCN symbol out of scope" msgstr "" #. STYP_INFO #. STYP_LIB #. STYP_OVER -#: config/obj-coff.c:1478 +#: config/obj-coff.c:1482 #, c-format msgid "unsupported section attribute '%c'" msgstr "" -#: config/obj-coff.c:1483 config/obj-coff.c:3755 config/tc-ppc.c:4243 +#: config/obj-coff.c:1487 config/obj-coff.c:3759 config/tc-ppc.c:4508 #, c-format msgid "unknown section attribute '%c'" msgstr "" -#: config/obj-coff.c:1513 config/tc-ppc.c:4261 config/tc-tic54x.c:4339 -#: read.c:2560 +#: config/obj-coff.c:1517 config/tc-ppc.c:4526 config/tc-tic54x.c:4339 +#: read.c:2562 #, c-format msgid "error setting flags for \"%s\": %s" msgstr "" -#: config/obj-coff.c:1524 +#: config/obj-coff.c:1528 #, c-format msgid "Ignoring changed section attributes for %s" msgstr "" -#: config/obj-coff.c:1660 +#: config/obj-coff.c:1664 #, c-format msgid "0x%lx: \"%s\" type = %ld, class = %d, segment = %d\n" msgstr "" -#: config/obj-coff.c:1845 config/obj-ieee.c:69 +#: config/obj-coff.c:1849 config/obj-ieee.c:69 msgid "Out of step\n" msgstr "" -#: config/obj-coff.c:2282 +#: config/obj-coff.c:2286 msgid "bfd_coff_swap_scnhdr_out failed" msgstr "" -#: config/obj-coff.c:2503 +#: config/obj-coff.c:2507 msgid "`.bf' symbol without preceding function\n" msgstr "" -#: config/obj-coff.c:3453 config/obj-ieee.c:521 +#: config/obj-coff.c:3457 config/obj-ieee.c:521 #, c-format msgid "FATAL: Can't create %s" msgstr "" -#: config/obj-coff.c:3631 +#: config/obj-coff.c:3635 #, c-format msgid "Can't close %s: %s" msgstr "" -#: config/obj-coff.c:3665 +#: config/obj-coff.c:3669 #, c-format msgid "Too many new sections; can't add \"%s\"" msgstr "" -#: config/obj-coff.c:4053 config/tc-sparc.c:3544 +#: config/obj-coff.c:4057 config/tc-sparc.c:3635 msgid "Expected comma after name" msgstr "" -#: config/obj-coff.c:4059 +#: config/obj-coff.c:4063 msgid "Missing size expression" msgstr "" -#: config/obj-coff.c:4065 +#: config/obj-coff.c:4069 #, c-format msgid "lcomm length (%d.) <0! Ignored." msgstr "" -#: config/obj-coff.c:4093 +#: config/obj-coff.c:4097 #, c-format msgid "Symbol %s already defined" msgstr "" -#: config/obj-coff.c:4189 config/tc-i960.c:3207 +#: config/obj-coff.c:4193 config/tc-i960.c:3221 #, c-format msgid "No 'bal' entry point for leafproc %s" msgstr "" -#: config/obj-coff.c:4266 +#: config/obj-coff.c:4270 #, c-format msgid "Negative of non-absolute symbol %s" msgstr "" -#: config/obj-coff.c:4286 +#: config/obj-coff.c:4290 msgid "callj to difference of 2 symbols" msgstr "" -#: config/obj-coff.c:4330 +#: config/obj-coff.c:4334 #, c-format msgid "Can't emit reloc {- %s-seg symbol \"%s\"} @ file address %ld." msgstr "" -#. This is a COBR instruction. They have only a 13-bit -#. displacement and are only to be used for local branches: -#. flag as error, don't generate relocation. -#: config/obj-coff.c:4416 config/tc-i960.c:3227 write.c:2820 +#: config/obj-coff.c:4420 config/tc-i960.c:2844 msgid "can't use COBR format with external label" msgstr "" -#: config/obj-coff.c:4489 +#: config/obj-coff.c:4493 #, c-format msgid "Value of %ld too large for field of %d bytes at 0x%lx" msgstr "" -#: config/obj-coff.c:4503 +#: config/obj-coff.c:4507 #, c-format msgid "Signed .word overflow; switch may be too large; %ld at 0x%lx" msgstr "" -#: config/obj-ecoff.c:227 +#: config/obj-ecoff.c:192 msgid "Can't set GP value" msgstr "" -#: config/obj-ecoff.c:234 +#: config/obj-ecoff.c:199 msgid "Can't set register masks" msgstr "" -#: config/obj-elf.c:313 +#: config/obj-elf.c:316 msgid "expected comma after symbol-name" msgstr "" -#: config/obj-elf.c:320 config/tc-sparc.c:3697 +#: config/obj-elf.c:326 #, c-format -msgid ".COMMon length (%d.) <0! Ignored." +msgid ".COMMon length (%ld) out of range, ignored." msgstr "" -#: config/obj-elf.c:330 ecoff.c:3397 read.c:1403 read.c:1504 read.c:2142 -#: read.c:2231 read.c:2861 read.c:4951 symbols.c:361 symbols.c:460 +#: config/obj-elf.c:335 ecoff.c:3397 read.c:1406 read.c:1507 read.c:2145 +#: read.c:2234 read.c:2863 read.c:4968 symbols.c:367 symbols.c:466 #, c-format msgid "symbol `%s' is already defined" msgstr "" -#: config/obj-elf.c:338 +#: config/obj-elf.c:343 #, c-format -msgid "length of .comm \"%s\" is already %ld; not changed to %d" +msgid "length of .comm \"%s\" is already %ld; not changed to %ld" msgstr "" -#: config/obj-elf.c:361 +#: config/obj-elf.c:367 msgid "common alignment negative; 0 assumed" msgstr "" -#: config/obj-elf.c:380 +#: config/obj-elf.c:386 msgid "common alignment not a power of 2" msgstr "" -#: config/obj-elf.c:443 config/tc-sparc.c:3839 config/tc-v850.c:450 +#: config/obj-elf.c:449 config/tc-sparc.c:3931 config/tc-v850.c:461 #, c-format msgid "bad .common segment %s" msgstr "" -#: config/obj-elf.c:714 +#: config/obj-elf.c:717 #, c-format msgid "setting incorrect section type for %s" msgstr "" -#: config/obj-elf.c:718 +#: config/obj-elf.c:721 #, c-format msgid "ignoring incorrect section type for %s" msgstr "" -#: config/obj-elf.c:731 +#: config/obj-elf.c:734 #, c-format msgid "setting incorrect section attributes for %s" msgstr "" -#: config/obj-elf.c:782 +#: config/obj-elf.c:786 #, c-format msgid "ignoring changed section attributes for %s" msgstr "" -#: config/obj-elf.c:784 +#: config/obj-elf.c:788 #, c-format msgid "ignoring changed section entity size for %s" msgstr "" -#: config/obj-elf.c:787 +#: config/obj-elf.c:791 #, c-format msgid "ignoring new section group for %s" msgstr "" -#: config/obj-elf.c:841 +#: config/obj-elf.c:845 msgid "unrecognized .section attribute: want a,w,x,M,S,G,T" msgstr "" -#: config/obj-elf.c:881 +#: config/obj-elf.c:884 msgid "unrecognized section attribute" msgstr "" -#: config/obj-elf.c:903 read.c:2543 +#: config/obj-elf.c:906 read.c:2545 msgid "unrecognized section type" msgstr "" -#: config/obj-elf.c:933 +#: config/obj-elf.c:936 msgid "missing name" msgstr "" -#: config/obj-elf.c:1042 +#: config/obj-elf.c:1048 msgid "invalid merge entity size" msgstr "" -#: config/obj-elf.c:1049 +#: config/obj-elf.c:1055 msgid "entity size for SHF_MERGE not specified" msgstr "" -#: config/obj-elf.c:1069 +#: config/obj-elf.c:1075 msgid "group name for SHF_GROUP not specified" msgstr "" -#: config/obj-elf.c:1082 +#: config/obj-elf.c:1088 msgid "character following name is not '#'" msgstr "" -#: config/obj-elf.c:1183 +#: config/obj-elf.c:1189 msgid ".previous without corresponding .section; ignored" msgstr "" -#: config/obj-elf.c:1210 +#: config/obj-elf.c:1216 msgid ".popsection without corresponding .pushsection; ignored" msgstr "" -#: config/obj-elf.c:1264 +#: config/obj-elf.c:1270 msgid "expected comma after name in .symver" msgstr "" -#: config/obj-elf.c:1287 +#: config/obj-elf.c:1294 #, c-format msgid "missing version name in `%s' for symbol `%s'" msgstr "" -#: config/obj-elf.c:1298 +#: config/obj-elf.c:1305 #, c-format msgid "multiple versions [`%s'|`%s'] for symbol `%s'" msgstr "" -#: config/obj-elf.c:1534 +#: config/obj-elf.c:1541 msgid "expected quoted string" msgstr "" -#: config/obj-elf.c:1555 +#: config/obj-elf.c:1562 #, c-format msgid "expected comma after name `%s' in .size directive" msgstr "" -#: config/obj-elf.c:1564 +#: config/obj-elf.c:1571 msgid "missing expression in .size directive" msgstr "" -#: config/obj-elf.c:1647 +#: config/obj-elf.c:1660 #, c-format msgid "unrecognized symbol type \"%s\"" msgstr "" -#: config/obj-elf.c:1828 +#: config/obj-elf.c:1841 msgid ".size expression too complicated to fix up" msgstr "" -#: config/obj-elf.c:1860 +#: config/obj-elf.c:1873 #, c-format msgid "" "invalid attempt to declare external version name as default in symbol `%s'" msgstr "" -#: config/obj-elf.c:1921 ecoff.c:3642 +#: config/obj-elf.c:1934 ecoff.c:3642 #, c-format msgid "symbol `%s' can not be both weak and common" msgstr "" -#: config/obj-elf.c:2041 +#: config/obj-elf.c:2054 #, c-format msgid "assuming all members of group `%s' are COMDAT" msgstr "" -#: config/obj-elf.c:2063 +#: config/obj-elf.c:2076 #, c-format msgid "can't create group: %s" msgstr "" -#: config/obj-elf.c:2170 +#: config/obj-elf.c:2183 #, c-format msgid "failed to set up debugging information: %s" msgstr "" -#: config/obj-elf.c:2190 +#: config/obj-elf.c:2203 #, c-format msgid "can't start writing .mdebug section: %s" msgstr "" -#: config/obj-elf.c:2198 +#: config/obj-elf.c:2211 #, c-format msgid "could not write .mdebug section: %s" msgstr "" @@ -864,45 +865,45 @@ msgstr "" msgid "FATAL: Attaching copyright header %s" msgstr "" -#: config/obj-vms.c:463 +#: config/obj-vms.c:530 #, c-format msgid "compiler emitted zero-size common symbol `%s' already defined" msgstr "" -#: config/obj-vms.c:473 +#: config/obj-vms.c:540 #, c-format msgid "compiler redefined zero-size common symbol `%s'" msgstr "" -#: config/obj-vms.c:592 +#: config/obj-vms.c:663 #, c-format msgid "Couldn't create VMS object file \"%s\"" msgstr "" -#: config/obj-vms.c:617 +#: config/obj-vms.c:688 msgid "I/O error writing VMS object file (length prefix)" msgstr "" -#: config/obj-vms.c:631 +#: config/obj-vms.c:702 msgid "I/O error writing VMS object file" msgstr "" -#: config/obj-vms.c:1221 +#: config/obj-vms.c:1292 #, c-format msgid "Couldn't find source file \"%s\", status=%%X%x" msgstr "" -#: config/obj-vms.c:1719 config/obj-vms.c:2895 +#: config/obj-vms.c:1790 config/obj-vms.c:2967 #, c-format msgid "debugger forward reference error, dbx type %d" msgstr "" -#: config/obj-vms.c:1794 +#: config/obj-vms.c:1865 #, c-format msgid "Variable descriptor %d too complicated. Defined as `void *'." msgstr "" -#: config/obj-vms.c:2108 +#: config/obj-vms.c:2179 msgid "" "***Warning - the assembly code generated by the compiler has placed \n" " global constant(s) in the text psect. These will not be available to \n" @@ -913,92 +914,92 @@ msgid "" " I didn't warn you! \n" msgstr "" -#: config/obj-vms.c:2422 +#: config/obj-vms.c:2494 #, c-format msgid "debugginer output: %d is an unknown untyped variable." msgstr "" -#: config/obj-vms.c:2640 +#: config/obj-vms.c:2712 #, c-format msgid "debugger output: structure element `%s' has undefined type" msgstr "" -#: config/obj-vms.c:2751 +#: config/obj-vms.c:2823 #, c-format msgid "debugger output: %d is an unknown type of variable." msgstr "" -#: config/obj-vms.c:2884 +#: config/obj-vms.c:2956 #, c-format msgid "debugger output: Unable to resolve %d circular references." msgstr "" -#: config/obj-vms.c:3086 +#: config/obj-vms.c:3158 #, c-format msgid "Module name truncated: %s\n" msgstr "" -#: config/obj-vms.c:3364 +#: config/obj-vms.c:3436 #, c-format msgid "Symbol %s replaced by %s\n" msgstr "" #. impossible -#: config/obj-vms.c:3647 +#: config/obj-vms.c:3719 #, c-format msgid "Unknown VMS psect type (%ld)" msgstr "" -#: config/obj-vms.c:3688 +#: config/obj-vms.c:3760 #, c-format msgid "Globalsymbol attribute for symbol %s was unexpected." msgstr "" -#: config/obj-vms.c:3837 +#: config/obj-vms.c:3909 msgid "Invalid data type for globalvalue" msgstr "" -#: config/obj-vms.c:3849 +#: config/obj-vms.c:3921 #, c-format msgid "Invalid globalvalue of %s" msgstr "" -#: config/obj-vms.c:4199 +#: config/obj-vms.c:4271 msgid "Couldn't find fixup fragment when checking for indirect reference" msgstr "" -#: config/obj-vms.c:4542 config/obj-vms.c:4683 +#: config/obj-vms.c:4614 config/obj-vms.c:4757 msgid "Fixup data addsy and subsy don't have the same type" msgstr "" -#: config/obj-vms.c:4546 config/obj-vms.c:4687 +#: config/obj-vms.c:4618 config/obj-vms.c:4761 msgid "Fixup data addsy and subsy don't have an appropriate type" msgstr "" -#: config/obj-vms.c:4549 config/obj-vms.c:4690 +#: config/obj-vms.c:4621 config/obj-vms.c:4764 msgid "Fixup data is erroneously \"pcrel\"" msgstr "" -#: config/obj-vms.c:4565 config/obj-vms.c:4709 +#: config/obj-vms.c:4637 config/obj-vms.c:4783 msgid "Fixup datum is not a longword" msgstr "" -#: config/obj-vms.c:4569 config/obj-vms.c:4713 +#: config/obj-vms.c:4641 config/obj-vms.c:4787 msgid "Fixup datum is not \"fixP->fx_addsy\"" msgstr "" -#: config/obj-vms.c:4784 +#: config/obj-vms.c:4858 #, c-format msgid "" "g++ wrote an extern reference to `%s' as a routine.\n" "I will fix it, but I hope that it was note really a routine." msgstr "" -#: config/obj-vms.c:4916 +#: config/obj-vms.c:4990 msgid "Can't handle global xtors symbols yet." msgstr "" -#: config/obj-vms.c:4919 +#: config/obj-vms.c:4993 #, c-format msgid "Unknown %s" msgstr "" @@ -1006,118 +1007,120 @@ msgstr "" #. #. * Error otherwise. #. -#: config/obj-vms.c:5004 +#: config/obj-vms.c:5078 #, c-format msgid "unhandled stab type %d" msgstr "" -#: config/tc-a29k.c:160 config/tc-sparc.c:3891 +#: config/tc-a29k.c:163 config/tc-sparc.c:3983 msgid "Unknown segment type" msgstr "" #. Probably a memory allocation problem? Give up now. -#: config/tc-a29k.c:330 config/tc-dlx.c:369 config/tc-hppa.c:1464 -#: config/tc-mips.c:1077 config/tc-mips.c:1119 config/tc-or32.c:230 +#: config/tc-a29k.c:333 config/tc-dlx.c:369 config/tc-hppa.c:1463 +#: config/tc-mips.c:1108 config/tc-mips.c:1150 config/tc-or32.c:228 #: config/tc-sparc.c:853 msgid "Broken assembler. No assembly attempted." msgstr "" -#: config/tc-a29k.c:375 config/tc-avr.c:1137 config/tc-d10v.c:545 -#: config/tc-d30v.c:552 config/tc-h8300.c:333 config/tc-h8500.c:284 -#: config/tc-mcore.c:655 config/tc-mmix.c:475 config/tc-mn10200.c:940 -#: config/tc-mn10300.c:1318 config/tc-or32.c:336 config/tc-or32.c:392 -#: config/tc-ppc.c:2143 config/tc-s390.c:1062 config/tc-sh.c:1272 -#: config/tc-sh64.c:2228 config/tc-tic80.c:283 config/tc-v850.c:1984 -#: config/tc-w65.c:241 config/tc-z8k.c:343 +#: config/tc-a29k.c:378 config/tc-avr.c:1121 config/tc-d10v.c:545 +#: config/tc-d30v.c:551 config/tc-h8300.c:492 config/tc-h8500.c:283 +#: config/tc-mcore.c:607 config/tc-mmix.c:470 config/tc-mn10200.c:940 +#: config/tc-mn10300.c:1815 config/tc-msp430.c:1544 config/tc-or32.c:334 +#: config/tc-or32.c:390 config/tc-ppc.c:2334 config/tc-s390.c:1236 +#: config/tc-sh.c:1264 config/tc-sh64.c:2254 config/tc-tic80.c:279 +#: config/tc-v850.c:2024 config/tc-w65.c:218 config/tc-z8k.c:376 msgid "missing operand" msgstr "" -#: config/tc-a29k.c:414 config/tc-cris.c:950 config/tc-cris.c:958 -#: config/tc-dlx.c:834 config/tc-hppa.c:1600 config/tc-i860.c:431 -#: config/tc-i860.c:448 config/tc-sparc.c:1415 config/tc-sparc.c:1421 +#: config/tc-a29k.c:417 config/tc-cris.c:1075 config/tc-cris.c:1083 +#: config/tc-dlx.c:834 config/tc-hppa.c:1599 config/tc-i860.c:453 +#: config/tc-i860.c:470 config/tc-i860.c:930 config/tc-sparc.c:1415 +#: config/tc-sparc.c:1421 #, c-format msgid "Unknown opcode: `%s'" msgstr "" -#: config/tc-a29k.c:419 config/tc-dlx.c:852 +#: config/tc-a29k.c:422 config/tc-dlx.c:852 #, c-format msgid "Unknown opcode `%s'." msgstr "" -#: config/tc-a29k.c:451 config/tc-dlx.c:913 +#: config/tc-a29k.c:454 config/tc-dlx.c:913 #, c-format msgid "Too many operands: %s" msgstr "" -#: config/tc-a29k.c:473 config/tc-a29k.c:504 +#: config/tc-a29k.c:476 config/tc-a29k.c:507 #, c-format msgid "Immediate value of %ld is too large" msgstr "" -#: config/tc-a29k.c:543 config/tc-i860.c:340 config/tc-i860.c:832 -#: config/tc-m68k.c:3185 config/tc-m68k.c:3214 config/tc-sparc.c:2550 +#: config/tc-a29k.c:546 config/tc-i860.c:355 config/tc-i860.c:902 +#: config/tc-m68k.c:3171 config/tc-m68k.c:3200 config/tc-sparc.c:2647 msgid "failed sanity check." msgstr "" -#: config/tc-a29k.c:889 config/tc-or32.c:1046 config/tc-or32.c:1180 +#: config/tc-a29k.c:892 config/tc-or32.c:1044 config/tc-or32.c:1178 #, c-format msgid "bad relocation type: 0x%02x" msgstr "" -#: config/tc-a29k.c:916 +#: config/tc-a29k.c:919 #, c-format msgid "need %o3\n" msgstr "" -#: config/tc-a29k.c:932 +#: config/tc-a29k.c:935 msgid "a29k_convert_frag\n" msgstr "" -#: config/tc-a29k.c:941 +#: config/tc-a29k.c:944 msgid "a29k_estimate_size_before_relax\n" msgstr "" -#: config/tc-a29k.c:1092 config/tc-dlx.c:1295 config/tc-or32.c:1375 +#: config/tc-a29k.c:1095 config/tc-dlx.c:1283 config/tc-or32.c:1373 #, c-format msgid "label \"$%d\" redefined" msgstr "" -#: config/tc-a29k.c:1165 config/tc-dlx.c:511 config/tc-or32.c:1470 +#: config/tc-a29k.c:1168 config/tc-dlx.c:511 config/tc-or32.c:1466 #, c-format msgid "Invalid expression after %%%%\n" msgstr "" -#: config/tc-a29k.c:1176 +#: config/tc-a29k.c:1179 msgid "Invalid register in & expression" msgstr "" -#: config/tc-alpha.c:822 +#: config/tc-alpha.c:826 #, c-format msgid "internal error: can't hash opcode `%s': %s" msgstr "" -#: config/tc-alpha.c:857 +#: config/tc-alpha.c:860 #, c-format msgid "internal error: can't hash macro `%s': %s" msgstr "" -#: config/tc-alpha.c:939 config/tc-i960.c:2702 +#: config/tc-alpha.c:943 config/tc-i960.c:2707 config/tc-xtensa.c:4954 +#: config/tc-xtensa.c:5015 msgid "syntax error" msgstr "" -#: config/tc-alpha.c:1013 config/tc-h8300.c:1426 config/tc-h8500.c:1187 -#: config/tc-hppa.c:4019 config/tc-i860.c:931 config/tc-m68hc11.c:500 -#: config/tc-m68k.c:4205 config/tc-m88k.c:1011 config/tc-ns32k.c:1663 -#: config/tc-or32.c:912 config/tc-sparc.c:2837 config/tc-z8k.c:1328 +#: config/tc-alpha.c:1017 config/tc-h8300.c:2099 config/tc-h8500.c:1204 +#: config/tc-hppa.c:4018 config/tc-i860.c:1004 config/tc-m68hc11.c:568 +#: config/tc-m68k.c:4196 config/tc-m88k.c:991 config/tc-ns32k.c:1689 +#: config/tc-or32.c:910 config/tc-sparc.c:2934 config/tc-z8k.c:1371 msgid "Bad call to MD_ATOF()" msgstr "" -#: config/tc-alpha.c:1063 +#: config/tc-alpha.c:1067 #, c-format msgid "Unknown CPU identifier `%s'" msgstr "" -#: config/tc-alpha.c:1107 +#: config/tc-alpha.c:1111 msgid "" "Alpha options:\n" "-32addr\t\t\ttreat addresses as 32-bit values\n" @@ -1129,1430 +1132,1516 @@ msgid "" "\t\t\tthese variants include PALcode opcodes\n" msgstr "" -#: config/tc-alpha.c:1117 +#: config/tc-alpha.c:1121 msgid "" "VMS options:\n" "-+\t\t\thash encode (don't truncate) names longer than 64 characters\n" "-H\t\t\tshow new symbol after hash truncation\n" msgstr "" -#: config/tc-alpha.c:1290 +#: config/tc-alpha.c:1298 #, c-format msgid "unhandled relocation type %s" msgstr "" -#: config/tc-alpha.c:1303 +#: config/tc-alpha.c:1311 msgid "non-absolute expression in constant field" msgstr "" -#: config/tc-alpha.c:1317 +#: config/tc-alpha.c:1325 #, c-format msgid "type %d reloc done?\n" msgstr "" -#: config/tc-alpha.c:1365 config/tc-alpha.c:1372 config/tc-mips.c:8156 +#: config/tc-alpha.c:1373 config/tc-alpha.c:1380 config/tc-mips.c:8603 msgid "Used $at without \".set noat\"" msgstr "" -#: config/tc-alpha.c:1445 +#: config/tc-alpha.c:1542 #, c-format msgid "!samegp reloc against symbol without .prologue: %s" msgstr "" -#: config/tc-alpha.c:1594 +#: config/tc-alpha.c:1581 config/tc-xtensa.c:5451 #, c-format msgid "cannot represent `%s' relocation in object file" msgstr "" -#: config/tc-alpha.c:1601 +#: config/tc-alpha.c:1588 config/tc-xtensa.c:5458 #, c-format msgid "internal error? cannot generate `%s' relocation" msgstr "" -#: config/tc-alpha.c:1657 +#: config/tc-alpha.c:1642 #, c-format msgid "frame reg expected, using $%d." msgstr "" -#: config/tc-alpha.c:1758 +#: config/tc-alpha.c:1743 #, c-format msgid "No !literal!%ld was found" msgstr "" -#: config/tc-alpha.c:1764 +#: config/tc-alpha.c:1750 #, c-format msgid "No !tlsgd!%ld was found" msgstr "" -#: config/tc-alpha.c:1771 +#: config/tc-alpha.c:1757 #, c-format msgid "No !tlsldm!%ld was found" msgstr "" -#: config/tc-alpha.c:1779 +#: config/tc-alpha.c:1766 #, c-format msgid "No ldah !gpdisp!%ld was found" msgstr "" -#: config/tc-alpha.c:1829 +#: config/tc-alpha.c:1816 #, c-format msgid "too many !literal!%ld for %s" msgstr "" -#: config/tc-alpha.c:1859 +#: config/tc-alpha.c:1846 #, c-format msgid "No lda !gpdisp!%ld was found" msgstr "" -#. only support one relocation op per insn -#: config/tc-alpha.c:2003 +#. Only support one relocation op per insn. +#: config/tc-alpha.c:1994 msgid "More than one relocation op per insn" msgstr "" -#: config/tc-alpha.c:2019 +#: config/tc-alpha.c:2010 msgid "No relocation operand" msgstr "" -#: config/tc-alpha.c:2029 +#: config/tc-alpha.c:2020 #, c-format msgid "Unknown relocation operand: !%s" msgstr "" -#: config/tc-alpha.c:2039 +#: config/tc-alpha.c:2030 #, c-format msgid "no sequence number after !%s" msgstr "" -#: config/tc-alpha.c:2049 +#: config/tc-alpha.c:2040 #, c-format msgid "!%s does not use a sequence number" msgstr "" -#: config/tc-alpha.c:2059 +#: config/tc-alpha.c:2050 #, c-format msgid "Bad sequence number: !%s!%s" msgstr "" -#: config/tc-alpha.c:2387 +#: config/tc-alpha.c:2378 #, c-format msgid "operand out of range (%s not between %d and %d)" msgstr "" -#: config/tc-alpha.c:2501 config/tc-alpha.c:2525 config/tc-d10v.c:634 -#: config/tc-d30v.c:640 config/tc-mn10200.c:995 config/tc-mn10300.c:1389 -#: config/tc-ppc.c:2109 config/tc-ppc.c:2290 config/tc-ppc.c:2302 -#: config/tc-s390.c:1072 config/tc-s390.c:1129 config/tc-v850.c:1764 -#: config/tc-v850.c:1787 config/tc-v850.c:2007 +#: config/tc-alpha.c:2490 config/tc-alpha.c:2514 config/tc-d10v.c:634 +#: config/tc-d30v.c:639 config/tc-mn10200.c:995 config/tc-mn10300.c:1888 +#: config/tc-ppc.c:2300 config/tc-ppc.c:2517 config/tc-ppc.c:2529 +#: config/tc-s390.c:1246 config/tc-s390.c:1346 config/tc-s390.c:1442 +#: config/tc-v850.c:1804 config/tc-v850.c:1827 config/tc-v850.c:2047 msgid "too many fixups" msgstr "" -#: config/tc-alpha.c:2537 +#: config/tc-alpha.c:2526 msgid "invalid relocation for instruction" msgstr "" -#: config/tc-alpha.c:2548 +#: config/tc-alpha.c:2537 msgid "invalid relocation for field" msgstr "" -#: config/tc-alpha.c:2655 +#: config/tc-alpha.c:2642 #, c-format msgid "too many ldah insns for !gpdisp!%ld" msgstr "" -#: config/tc-alpha.c:2657 config/tc-alpha.c:2669 +#: config/tc-alpha.c:2644 config/tc-alpha.c:2656 #, c-format msgid "both insns for !gpdisp!%ld must be in the same section" msgstr "" -#: config/tc-alpha.c:2667 +#: config/tc-alpha.c:2654 #, c-format msgid "too many lda insns for !gpdisp!%ld" msgstr "" -#: config/tc-alpha.c:2719 +#: config/tc-alpha.c:2707 #, c-format msgid "too many lituse insns for !lituse_tlsgd!%ld" msgstr "" -#: config/tc-alpha.c:2722 +#: config/tc-alpha.c:2710 #, c-format msgid "too many lituse insns for !lituse_tlsldm!%ld" msgstr "" -#: config/tc-alpha.c:2739 +#: config/tc-alpha.c:2727 #, c-format msgid "duplicate !tlsgd!%ld" msgstr "" -#: config/tc-alpha.c:2741 +#: config/tc-alpha.c:2729 #, c-format msgid "sequence number in use for !tlsldm!%ld" msgstr "" -#: config/tc-alpha.c:2755 +#: config/tc-alpha.c:2743 #, c-format msgid "duplicate !tlsldm!%ld" msgstr "" -#: config/tc-alpha.c:2757 +#: config/tc-alpha.c:2745 #, c-format msgid "sequence number in use for !tlsgd!%ld" msgstr "" -#: config/tc-alpha.c:2802 config/tc-alpha.c:2875 +#: config/tc-alpha.c:2790 config/tc-alpha.c:2863 #, c-format msgid "inappropriate arguments for opcode `%s'" msgstr "" -#: config/tc-alpha.c:2804 config/tc-alpha.c:2877 +#: config/tc-alpha.c:2792 config/tc-alpha.c:2865 #, c-format msgid "opcode `%s' not supported for target %s" msgstr "" -#: config/tc-alpha.c:2808 config/tc-alpha.c:2881 config/tc-avr.c:1103 +#: config/tc-alpha.c:2796 config/tc-alpha.c:2869 config/tc-avr.c:1087 +#: config/tc-msp430.c:446 #, c-format msgid "unknown opcode `%s'" msgstr "" -#: config/tc-alpha.c:2928 +#: config/tc-alpha.c:2916 msgid "can not resolve expression" msgstr "" -#: config/tc-alpha.c:3072 config/tc-alpha.c:3251 +#: config/tc-alpha.c:3060 config/tc-alpha.c:3239 msgid "overflow in literal (.lita) table" msgstr "" -#: config/tc-alpha.c:3079 config/tc-alpha.c:3102 config/tc-alpha.c:3264 -#: config/tc-alpha.c:3479 config/tc-alpha.c:3524 config/tc-alpha.c:3598 -#: config/tc-alpha.c:3690 config/tc-alpha.c:3939 config/tc-alpha.c:4040 +#: config/tc-alpha.c:3067 config/tc-alpha.c:3090 config/tc-alpha.c:3252 +#: config/tc-alpha.c:3467 config/tc-alpha.c:3512 config/tc-alpha.c:3586 +#: config/tc-alpha.c:3678 config/tc-alpha.c:3926 config/tc-alpha.c:4025 msgid "macro requires $at register while noat in effect" msgstr "" -#: config/tc-alpha.c:3081 config/tc-alpha.c:3104 config/tc-alpha.c:3266 +#: config/tc-alpha.c:3069 config/tc-alpha.c:3092 config/tc-alpha.c:3254 msgid "macro requires $at while $at in use" msgstr "" -#: config/tc-alpha.c:3212 +#: config/tc-alpha.c:3200 msgid "bignum invalid; zero assumed" msgstr "" -#: config/tc-alpha.c:3214 +#: config/tc-alpha.c:3202 msgid "floating point number invalid; zero assumed" msgstr "" -#: config/tc-alpha.c:3219 +#: config/tc-alpha.c:3207 msgid "can't handle expression" msgstr "" -#: config/tc-alpha.c:3257 +#: config/tc-alpha.c:3245 msgid "overflow in literal (.lit8) table" msgstr "" -#: config/tc-alpha.c:4277 config/tc-ppc.c:1582 config/tc-ppc.c:4006 +#: config/tc-alpha.c:4262 config/tc-ppc.c:1740 config/tc-ppc.c:4271 #, c-format msgid ".COMMon length (%ld.) <0! Ignored." msgstr "" -#: config/tc-alpha.c:4306 config/tc-sparc.c:3707 config/tc-v850.c:254 +#: config/tc-alpha.c:4291 config/tc-sparc.c:3799 config/tc-v850.c:256 msgid "Ignoring attempt to re-define symbol" msgstr "" -#: config/tc-alpha.c:4315 config/tc-alpha.c:4324 config/tc-ppc.c:4043 +#: config/tc-alpha.c:4300 config/tc-alpha.c:4309 config/tc-ppc.c:4308 #, c-format msgid "Length of .comm \"%s\" is already %ld. Not changed to %ld." msgstr "" -#: config/tc-alpha.c:4426 ecoff.c:3082 +#: config/tc-alpha.c:4430 ecoff.c:3082 msgid ".ent directive has no name" msgstr "" -#: config/tc-alpha.c:4434 +#: config/tc-alpha.c:4438 msgid "nested .ent directives" msgstr "" -#: config/tc-alpha.c:4470 ecoff.c:3032 +#: config/tc-alpha.c:4483 ecoff.c:3032 msgid ".end directive has no name" msgstr "" -#: config/tc-alpha.c:4479 +#: config/tc-alpha.c:4492 +msgid ".end directive without matching .ent" +msgstr "" + +#: config/tc-alpha.c:4494 msgid ".end directive names different symbol than .ent" msgstr "" -#: config/tc-alpha.c:4556 +#: config/tc-alpha.c:4538 ecoff.c:3171 +msgid ".fmask outside of .ent" +msgstr "" + +#: config/tc-alpha.c:4540 ecoff.c:3241 +msgid ".mask outside of .ent" +msgstr "" + +#: config/tc-alpha.c:4548 ecoff.c:3178 +msgid "bad .fmask directive" +msgstr "" + +#: config/tc-alpha.c:4550 ecoff.c:3248 +msgid "bad .mask directive" +msgstr "" + +#: config/tc-alpha.c:4584 config/tc-mips.c:14143 ecoff.c:3200 +msgid ".frame outside of .ent" +msgstr "" + +#: config/tc-alpha.c:4595 ecoff.c:3211 +msgid "bad .frame directive" +msgstr "" + +#: config/tc-alpha.c:4628 +msgid ".prologue directive without a preceding .ent directive" +msgstr "" + +#: config/tc-alpha.c:4646 #, c-format msgid "Invalid argument %d to .prologue." msgstr "" -#: config/tc-alpha.c:4648 +#: config/tc-alpha.c:4741 msgid "ECOFF debugging is disabled." msgstr "" -#: config/tc-alpha.c:4669 +#: config/tc-alpha.c:4755 +msgid ".ent directive without matching .end" +msgstr "" + +#: config/tc-alpha.c:4840 +msgid ".usepv directive has no name" +msgstr "" + +#: config/tc-alpha.c:4851 +msgid ".usepv directive has no type" +msgstr "" + +#: config/tc-alpha.c:4866 +msgid "unknown argument for .usepv" +msgstr "" + +#: config/tc-alpha.c:4900 msgid "Unknown section directive" msgstr "" -#: config/tc-alpha.c:4705 +#: config/tc-alpha.c:4936 msgid ".ent directive has no symbol" msgstr "" -#: config/tc-alpha.c:4732 +#: config/tc-alpha.c:4963 msgid "Bad .frame directive 1./2. param" msgstr "" -#: config/tc-alpha.c:4744 +#: config/tc-alpha.c:4975 msgid "Bad .frame directive 3./4. param" msgstr "" -#: config/tc-alpha.c:4769 +#: config/tc-alpha.c:5000 msgid ".pdesc directive not in link (.link) section" msgstr "" -#: config/tc-alpha.c:4777 +#: config/tc-alpha.c:5008 msgid ".pdesc has no matching .ent" msgstr "" -#: config/tc-alpha.c:4788 +#: config/tc-alpha.c:5019 msgid ".pdesc directive has no entry symbol" msgstr "" -#: config/tc-alpha.c:4801 +#: config/tc-alpha.c:5032 msgid "No comma after .pdesc " msgstr "" -#: config/tc-alpha.c:4824 +#: config/tc-alpha.c:5055 msgid "unknown procedure kind" msgstr "" -#: config/tc-alpha.c:4917 +#: config/tc-alpha.c:5148 msgid ".name directive not in link (.link) section" msgstr "" -#: config/tc-alpha.c:4925 +#: config/tc-alpha.c:5156 msgid ".name directive has no symbol" msgstr "" -#: config/tc-alpha.c:4959 +#: config/tc-alpha.c:5190 msgid "No symbol after .linkage" msgstr "" -#: config/tc-alpha.c:4987 +#: config/tc-alpha.c:5218 msgid "No symbol after .code_address" msgstr "" -#: config/tc-alpha.c:5020 +#: config/tc-alpha.c:5251 msgid "Bad .mask directive" msgstr "" -#: config/tc-alpha.c:5041 +#: config/tc-alpha.c:5272 msgid "Bad .fmask directive" msgstr "" -#: config/tc-alpha.c:5211 +#: config/tc-alpha.c:5440 #, c-format msgid "Expected comma after name \"%s\"" msgstr "" #. *symbol_get_obj (symbolP) = (signed char) temp; -#: config/tc-alpha.c:5222 +#: config/tc-alpha.c:5451 #, c-format msgid "unhandled: .proc %s,%d" msgstr "" -#: config/tc-alpha.c:5257 +#: config/tc-alpha.c:5486 #, c-format msgid "Tried to .set unrecognized mode `%s'" msgstr "" #. not fatal, but it might not work in the end -#: config/tc-alpha.c:5274 +#: config/tc-alpha.c:5503 msgid "File overrides no-base-register option." msgstr "" -#: config/tc-alpha.c:5291 +#: config/tc-alpha.c:5520 #, c-format msgid "Bad base register, using $%d." msgstr "" -#: config/tc-alpha.c:5313 +#: config/tc-alpha.c:5542 #, c-format msgid "Alignment too large: %d. assumed" msgstr "" -#: config/tc-alpha.c:5317 config/tc-d30v.c:2214 +#: config/tc-alpha.c:5546 config/tc-d30v.c:2200 msgid "Alignment negative: 0 assumed" msgstr "" -#: config/tc-alpha.c:5629 +#: config/tc-alpha.c:5860 #, c-format msgid "Chose GP value of %lx\n" msgstr "" -#: config/tc-alpha.c:5645 config/tc-ia64.c:958 +#: config/tc-alpha.c:5876 msgid "Bad .section directive: want a,s,w,x,M,S,G,T in string" msgstr "" -#: config/tc-arc.c:1616 config/tc-arm.c:10347 +#: config/tc-arc.c:1615 config/tc-arm.c:11416 config/tc-ip2k.c:219 msgid "md_estimate_size_before_relax\n" msgstr "" -#: config/tc-arc.c:1628 +#: config/tc-arc.c:1627 msgid "md_convert_frag\n" msgstr "" -#: config/tc-arm.c:681 +#. We can't actually support subtracting a symbol. +#: config/tc-arc.c:1898 config/tc-arm.c:6617 config/tc-arm.c:9705 +#: config/tc-arm.c:9805 config/tc-avr.c:854 config/tc-cris.c:3123 +#: config/tc-d10v.c:1710 config/tc-d30v.c:1851 config/tc-mips.c:3630 +#: config/tc-mips.c:4695 config/tc-mips.c:5828 config/tc-mips.c:6517 +#: config/tc-msp430.c:1403 config/tc-ppc.c:5460 config/tc-v850.c:2356 +#: config/tc-xstormy16.c:483 +msgid "expression too complex" +msgstr "" + +#: config/tc-arm.c:763 msgid "ARM register expected" msgstr "" -#: config/tc-arm.c:682 config/tc-arm.c:2846 +#: config/tc-arm.c:764 config/tc-arm.c:3174 msgid "bad or missing co-processor number" msgstr "" #. In the few cases where we might be able to accept something else #. this error can be overridden. -#: config/tc-arm.c:683 config/tc-arm.c:2901 +#: config/tc-arm.c:765 config/tc-arm.c:3229 msgid "co-processor register expected" msgstr "" -#: config/tc-arm.c:684 +#: config/tc-arm.c:766 msgid "FPA register expected" msgstr "" -#: config/tc-arm.c:685 +#: config/tc-arm.c:767 msgid "VFP single precision register expected" msgstr "" -#: config/tc-arm.c:686 +#: config/tc-arm.c:768 msgid "VFP double precision register expected" msgstr "" -#: config/tc-arm.c:687 +#: config/tc-arm.c:769 msgid "Maverick MVF register expected" msgstr "" -#: config/tc-arm.c:688 +#: config/tc-arm.c:770 msgid "Maverick MVD register expected" msgstr "" -#: config/tc-arm.c:689 config/tc-arm.c:690 +#: config/tc-arm.c:771 config/tc-arm.c:772 msgid "Maverick MVFX register expected" msgstr "" -#: config/tc-arm.c:691 +#: config/tc-arm.c:773 msgid "Maverick MVAX register expected" msgstr "" -#: config/tc-arm.c:692 +#: config/tc-arm.c:774 msgid "Maverick DSPSC register expected" msgstr "" -#: config/tc-arm.c:2036 +#: config/tc-arm.c:775 +msgid "Intel Wireless MMX technology register expected" +msgstr "" + +#: config/tc-arm.c:2309 msgid "bad arguments to instruction" msgstr "" -#: config/tc-arm.c:2037 +#: config/tc-arm.c:2310 msgid "r15 not allowed here" msgstr "" -#: config/tc-arm.c:2038 +#: config/tc-arm.c:2311 msgid "instruction is not conditional" msgstr "" -#: config/tc-arm.c:2039 +#: config/tc-arm.c:2312 msgid "acc0 expected" msgstr "" -#: config/tc-arm.c:2184 +#: config/tc-arm.c:2505 msgid "literal pool overflow" msgstr "" -#: config/tc-arm.c:2326 +#: config/tc-arm.c:2647 msgid "invalid syntax for .req directive" msgstr "" -#: config/tc-arm.c:2401 +#: config/tc-arm.c:2727 #, c-format msgid "alignment too large: %d assumed" msgstr "" -#: config/tc-arm.c:2404 +#: config/tc-arm.c:2730 msgid "alignment negative. 0 assumed." msgstr "" -#: config/tc-arm.c:2488 +#: config/tc-arm.c:2814 #, c-format msgid "expected comma after name \"%s\"" msgstr "" -#: config/tc-arm.c:2538 config/tc-m32r.c:418 +#: config/tc-arm.c:2864 config/tc-m32r.c:420 #, c-format msgid "symbol `%s' already defined" msgstr "" -#: config/tc-arm.c:2612 +#: config/tc-arm.c:2889 msgid "selected processor does not support THUMB opcodes" msgstr "" -#: config/tc-arm.c:2625 +#: config/tc-arm.c:2902 msgid "selected processor does not support ARM opcodes" msgstr "" -#: config/tc-arm.c:2637 +#: config/tc-arm.c:2914 #, c-format msgid "invalid instruction size selected (%d)" msgstr "" -#: config/tc-arm.c:2672 +#: config/tc-arm.c:2949 #, c-format msgid "invalid operand to .code directive (%d) (expecting 16 or 32)" msgstr "" -#: config/tc-arm.c:2683 +#: config/tc-arm.c:2960 msgid "garbage following instruction" msgstr "" #. In the few cases where we might be able to accept something else #. this error can be overridden. -#: config/tc-arm.c:2733 +#: config/tc-arm.c:3010 #, c-format msgid "register expected, not '%.100s'" msgstr "" #. In the few cases where we might be able to accept #. something else this error can be overridden. -#: config/tc-arm.c:2805 +#: config/tc-arm.c:3061 +#, c-format +msgid "Intel Wireless MMX technology register expected, not '%.100s'" +msgstr "" + +#. In the few cases where we might be able to accept +#. something else this error can be overridden. +#: config/tc-arm.c:3133 msgid "flag for {c}psr instruction expected" msgstr "" -#: config/tc-arm.c:2839 +#: config/tc-arm.c:3167 msgid "illegal co-processor number" msgstr "" -#: config/tc-arm.c:2871 config/tc-arm.c:3931 config/tc-arm.c:4113 +#: config/tc-arm.c:3199 config/tc-arm.c:4778 msgid "bad or missing expression" msgstr "" -#: config/tc-arm.c:2877 +#: config/tc-arm.c:3205 msgid "immediate co-processor expression too large" msgstr "" #. In the few cases where we might be able to accept something else #. this error can be overridden. -#: config/tc-arm.c:2924 +#: config/tc-arm.c:3252 msgid "floating point register expected" msgstr "" -#: config/tc-arm.c:2941 +#: config/tc-arm.c:3269 config/tc-arm.c:3414 msgid "immediate expression expected" msgstr "" -#: config/tc-arm.c:2956 +#: config/tc-arm.c:3284 msgid "co-processor address must be word aligned" msgstr "" -#: config/tc-arm.c:2962 +#: config/tc-arm.c:3290 config/tc-arm.c:3429 msgid "offset too large" msgstr "" -#: config/tc-arm.c:3011 +#: config/tc-arm.c:3339 config/tc-arm.c:3477 msgid "pc may not be used in post-increment" msgstr "" -#: config/tc-arm.c:3027 config/tc-arm.c:3472 config/tc-arm.c:4282 -#: config/tc-arm.c:5149 config/tc-arm.c:5483 +#: config/tc-arm.c:3355 config/tc-arm.c:3493 config/tc-arm.c:3938 +#: config/tc-arm.c:5197 config/tc-arm.c:6064 config/tc-arm.c:6398 msgid "pre-indexed expression expected" msgstr "" -#: config/tc-arm.c:3040 config/tc-arm.c:3485 config/tc-arm.c:4293 -#: config/tc-arm.c:5161 config/tc-arm.c:5495 config/tc-arm.c:5844 -#: config/tc-arm.c:8508 config/tc-arm.c:8523 +#: config/tc-arm.c:3368 config/tc-arm.c:3506 config/tc-arm.c:3951 +#: config/tc-arm.c:5208 config/tc-arm.c:6076 config/tc-arm.c:6410 +#: config/tc-arm.c:6784 config/tc-arm.c:9448 config/tc-arm.c:9463 msgid "missing ]" msgstr "" -#: config/tc-arm.c:3050 +#: config/tc-arm.c:3378 config/tc-arm.c:3516 msgid "pc may not be used with write-back" msgstr "" -#: config/tc-arm.c:3102 +#: config/tc-arm.c:3568 msgid "comma expected after register name" msgstr "" -#: config/tc-arm.c:3121 +#: config/tc-arm.c:3587 msgid "CPSR or SPSR expected" msgstr "" -#: config/tc-arm.c:3147 +#: config/tc-arm.c:3613 msgid "comma missing after psr flags" msgstr "" -#: config/tc-arm.c:3163 config/tc-arm.c:3173 +#: config/tc-arm.c:3629 config/tc-arm.c:3639 msgid "only a register or immediate value can follow a psr flag" msgstr "" -#: config/tc-arm.c:3184 +#: config/tc-arm.c:3650 msgid "immediate value cannot be used to set this field" msgstr "" -#: config/tc-arm.c:3202 config/tc-arm.c:4509 config/tc-arm.c:4789 -#: config/tc-arm.c:4809 config/tc-i960.c:1925 +#: config/tc-arm.c:3668 config/tc-arm.c:5424 config/tc-arm.c:5704 +#: config/tc-arm.c:5724 config/tc-i960.c:1935 msgid "invalid constant" msgstr "" -#: config/tc-arm.c:3250 +#: config/tc-arm.c:3716 msgid "rdhi, rdlo and rm must all be different" msgstr "" -#: config/tc-arm.c:3304 +#: config/tc-arm.c:3770 msgid "rd and rm should be different in mul" msgstr "" -#: config/tc-arm.c:3358 +#: config/tc-arm.c:3824 msgid "rd and rm should be different in mla" msgstr "" -#: config/tc-arm.c:3406 +#: config/tc-arm.c:3872 #, c-format msgid "acc0 expected, not '%.100s'" msgstr "" -#: config/tc-arm.c:3584 +#: config/tc-arm.c:4050 msgid "rdhi and rdlo must be different" msgstr "" -#: config/tc-arm.c:3692 +#: config/tc-arm.c:4158 msgid "Warning: instruction unpredictable when using r15" msgstr "" -#: config/tc-arm.c:3907 +#: config/tc-arm.c:4373 msgid "use of r15 in bxj is not really useful" msgstr "" -#: config/tc-arm.c:3940 config/tc-arm.c:4122 config/tc-arm.c:7449 -#: config/tc-arm.c:7484 config/tc-arm.c:7494 +#: config/tc-arm.c:4400 config/tc-arm.c:4585 config/tc-arm.c:5445 expr.c:1318 +#: read.c:2206 +msgid "bad expression" +msgstr "" + +#: config/tc-arm.c:4409 config/tc-arm.c:4594 config/tc-arm.c:4786 +#: config/tc-arm.c:8389 config/tc-arm.c:8424 config/tc-arm.c:8434 +#: config/tc-z8k.c:1161 config/tc-z8k.c:1173 msgid "immediate value out of range" msgstr "" -#: config/tc-arm.c:4245 +#: config/tc-arm.c:4833 +msgid "only r15 allowed here" +msgstr "" + +#: config/tc-arm.c:5160 msgid "'[' expected after PLD mnemonic" msgstr "" -#: config/tc-arm.c:4267 +#: config/tc-arm.c:5182 msgid "post-indexed expression used in preload instruction" msgstr "" -#: config/tc-arm.c:4272 config/tc-arm.c:4302 +#: config/tc-arm.c:5187 config/tc-arm.c:5217 msgid "writeback used in preload instruction" msgstr "" -#: config/tc-arm.c:4344 +#: config/tc-arm.c:5259 msgid "destination register must be even" msgstr "" -#: config/tc-arm.c:4350 +#: config/tc-arm.c:5265 msgid "r14 not allowed here" msgstr "" -#: config/tc-arm.c:4357 +#: config/tc-arm.c:5272 msgid "pre/post-indexing used when modified address register is destination" msgstr "" -#: config/tc-arm.c:4367 +#: config/tc-arm.c:5282 msgid "ldrd destination registers must not overlap index register" msgstr "" -#: config/tc-arm.c:4493 +#: config/tc-arm.c:5408 msgid "bad_segment" msgstr "" -#: config/tc-arm.c:4530 expr.c:1314 read.c:2203 -msgid "bad expression" -msgstr "" - -#: config/tc-arm.c:4553 config/tc-arm.c:4564 +#: config/tc-arm.c:5468 config/tc-arm.c:5479 msgid "shift expression expected" msgstr "" -#: config/tc-arm.c:4588 +#: config/tc-arm.c:5503 msgid "shift requires register or #expression" msgstr "" -#: config/tc-arm.c:4589 +#: config/tc-arm.c:5504 msgid "shift requires #expression" msgstr "" -#: config/tc-arm.c:4619 +#: config/tc-arm.c:5534 msgid "shift of 0 ignored." msgstr "" -#: config/tc-arm.c:4625 +#: config/tc-arm.c:5540 msgid "invalid immediate shift" msgstr "" -#: config/tc-arm.c:4780 config/tc-arm.c:5197 config/tc-arm.c:5532 -#: config/tc-arm.c:6141 config/tc-v850.c:1867 config/tc-v850.c:1888 +#: config/tc-arm.c:5695 config/tc-arm.c:6112 config/tc-arm.c:6447 +#: config/tc-arm.c:7081 config/tc-v850.c:1907 config/tc-v850.c:1928 msgid "constant expression expected" msgstr "" -#: config/tc-arm.c:4822 +#: config/tc-arm.c:5737 msgid "register or shift expression expected" msgstr "" -#: config/tc-arm.c:4875 +#: config/tc-arm.c:5790 msgid "invalid floating point immediate expression" msgstr "" -#: config/tc-arm.c:4879 +#: config/tc-arm.c:5794 msgid "floating point register or immediate expression expected" msgstr "" -#: config/tc-arm.c:5033 config/tc-arm.c:5363 +#: config/tc-arm.c:5948 config/tc-arm.c:6278 msgid "address offset too large" msgstr "" -#: config/tc-arm.c:5091 config/tc-arm.c:5281 config/tc-arm.c:5423 +#: config/tc-arm.c:6006 config/tc-arm.c:6196 config/tc-arm.c:6338 msgid "address expected" msgstr "" -#: config/tc-arm.c:5121 config/tc-arm.c:5133 config/tc-arm.c:5170 -#: config/tc-arm.c:5299 config/tc-arm.c:5453 config/tc-arm.c:5467 -#: config/tc-arm.c:5504 +#: config/tc-arm.c:6036 config/tc-arm.c:6048 config/tc-arm.c:6085 +#: config/tc-arm.c:6214 config/tc-arm.c:6368 config/tc-arm.c:6382 +#: config/tc-arm.c:6419 #, c-format msgid "%s register same as write-back base" msgstr "" -#: config/tc-arm.c:5123 config/tc-arm.c:5135 config/tc-arm.c:5172 -#: config/tc-arm.c:5301 config/tc-arm.c:5455 config/tc-arm.c:5469 -#: config/tc-arm.c:5506 +#: config/tc-arm.c:6038 config/tc-arm.c:6050 config/tc-arm.c:6087 +#: config/tc-arm.c:6216 config/tc-arm.c:6370 config/tc-arm.c:6384 +#: config/tc-arm.c:6421 msgid "destination" msgstr "" -#: config/tc-arm.c:5123 config/tc-arm.c:5135 config/tc-arm.c:5172 -#: config/tc-arm.c:5301 config/tc-arm.c:5455 config/tc-arm.c:5469 -#: config/tc-arm.c:5506 +#: config/tc-arm.c:6038 config/tc-arm.c:6050 config/tc-arm.c:6087 +#: config/tc-arm.c:6216 config/tc-arm.c:6370 config/tc-arm.c:6384 +#: config/tc-arm.c:6421 msgid "source" msgstr "" -#: config/tc-arm.c:5182 config/tc-arm.c:5516 config/tc-arm.c:7755 +#: config/tc-arm.c:6097 config/tc-arm.c:6431 config/tc-arm.c:8695 msgid "invalid pseudo operation" msgstr "" -#: config/tc-arm.c:5234 config/tc-arm.c:5567 +#: config/tc-arm.c:6149 config/tc-arm.c:6482 msgid "literal pool insertion failed" msgstr "" -#: config/tc-arm.c:5329 config/tc-arm.c:5335 +#: config/tc-arm.c:6244 config/tc-arm.c:6250 msgid "post-indexed expression expected" msgstr "" -#: config/tc-arm.c:5633 +#: config/tc-arm.c:6548 msgid "bad range in register list" msgstr "" -#: config/tc-arm.c:5641 config/tc-arm.c:5650 config/tc-arm.c:5692 +#: config/tc-arm.c:6556 config/tc-arm.c:6565 config/tc-arm.c:6607 #, c-format msgid "Warning: duplicated register (r%d) in register list" msgstr "" -#: config/tc-arm.c:5653 +#: config/tc-arm.c:6568 msgid "Warning: register range not in ascending order" msgstr "" -#: config/tc-arm.c:5665 +#: config/tc-arm.c:6580 msgid "missing `}'" msgstr "" -#: config/tc-arm.c:5681 +#: config/tc-arm.c:6596 msgid "invalid register mask" msgstr "" -#: config/tc-arm.c:5702 config/tc-arm.c:8765 config/tc-arm.c:8865 -#: config/tc-avr.c:866 config/tc-cris.c:3006 config/tc-d10v.c:1724 -#: config/tc-d30v.c:1863 config/tc-mips.c:3570 config/tc-mips.c:4594 -#: config/tc-mips.c:5505 config/tc-mips.c:6159 config/tc-ppc.c:5175 -#: config/tc-v850.c:2287 config/tc-xstormy16.c:479 -msgid "expression too complex" +#: config/tc-arm.c:6655 +msgid "r15 not allowed as base register" msgstr "" -#: config/tc-arm.c:5740 -msgid "r15 not allowed as base register" +#: config/tc-arm.c:6689 config/tc-arm.c:6698 +msgid "writeback of base register is UNPREDICTABLE" +msgstr "" + +#: config/tc-arm.c:6692 +msgid "writeback of base register when in register list is UNPREDICTABLE" msgstr "" -#: config/tc-arm.c:5804 config/tc-arm.c:5818 +#: config/tc-arm.c:6702 +msgid "if writeback register is in list, it must be the lowest reg in the list" +msgstr "" + +#: config/tc-arm.c:6744 config/tc-arm.c:6758 msgid "r15 not allowed in swap" msgstr "" -#: config/tc-arm.c:5913 +#: config/tc-arm.c:6853 msgid "use of r15 in bx in ARM mode is not really useful" msgstr "" -#: config/tc-arm.c:6147 +#: config/tc-arm.c:7087 msgid "constant value required for number of registers" msgstr "" -#: config/tc-arm.c:6155 +#: config/tc-arm.c:7095 msgid "number of registers must be in the range [1:4]" msgstr "" -#: config/tc-arm.c:6216 +#: config/tc-arm.c:7156 msgid "r15 not allowed as base register with write-back" msgstr "" -#: config/tc-arm.c:6598 +#: config/tc-arm.c:7538 msgid "only two consecutive VFP SP registers allowed here" msgstr "" -#: config/tc-arm.c:6766 +#: config/tc-arm.c:7706 msgid "VFP system register expected" msgstr "" -#: config/tc-arm.c:6904 config/tc-arm.c:6943 config/tc-arm.c:6956 -#: config/tc-arm.c:7017 config/tc-arm.c:7056 config/tc-arm.c:7069 -#: config/tc-mips.c:9336 config/tc-mips.c:9366 +#: config/tc-arm.c:7844 config/tc-arm.c:7883 config/tc-arm.c:7896 +#: config/tc-arm.c:7957 config/tc-arm.c:7996 config/tc-arm.c:8009 +#: config/tc-h8300.c:1035 config/tc-mips.c:9723 config/tc-mips.c:9753 msgid "invalid register list" msgstr "" -#: config/tc-arm.c:6910 config/tc-arm.c:7023 +#: config/tc-arm.c:7850 config/tc-arm.c:7963 msgid "register list not in ascending order" msgstr "" -#: config/tc-arm.c:6935 config/tc-arm.c:7048 +#: config/tc-arm.c:7875 config/tc-arm.c:7988 msgid "register range not in ascending order" msgstr "" -#: config/tc-arm.c:6973 config/tc-arm.c:7086 +#: config/tc-arm.c:7913 config/tc-arm.c:8026 msgid "non-contiguous register range" msgstr "" -#: config/tc-arm.c:7116 config/tc-arm.c:7153 +#: config/tc-arm.c:8056 config/tc-arm.c:8093 msgid "this addressing mode requires base-register writeback" msgstr "" -#: config/tc-arm.c:7313 +#: config/tc-arm.c:8253 msgid "lo register required" msgstr "" -#: config/tc-arm.c:7321 +#: config/tc-arm.c:8261 msgid "hi register required" msgstr "" -#: config/tc-arm.c:7391 config/tc-arm.c:8597 +#: config/tc-arm.c:8331 config/tc-arm.c:9537 msgid "dest and source1 must be the same register" msgstr "" -#: config/tc-arm.c:7398 +#: config/tc-arm.c:8338 msgid "subtract valid only on lo regs" msgstr "" -#: config/tc-arm.c:7422 +#: config/tc-arm.c:8362 msgid "invalid Hi register with immediate" msgstr "" -#: config/tc-arm.c:7462 +#: config/tc-arm.c:8402 msgid "invalid immediate value for stack adjust" msgstr "" -#: config/tc-arm.c:7473 +#: config/tc-arm.c:8413 msgid "invalid immediate for address calculation" msgstr "" -#: config/tc-arm.c:7560 +#: config/tc-arm.c:8500 msgid "source1 and dest must be same register" msgstr "" -#: config/tc-arm.c:7594 +#: config/tc-arm.c:8534 msgid "invalid immediate for shift" msgstr "" -#: config/tc-arm.c:7673 +#: config/tc-arm.c:8613 msgid "only lo regs allowed with immediate" msgstr "" -#: config/tc-arm.c:7692 +#: config/tc-arm.c:8632 msgid "invalid immediate" msgstr "" -#: config/tc-arm.c:7746 +#: config/tc-arm.c:8686 msgid "expected ']'" msgstr "" -#: config/tc-arm.c:7819 +#: config/tc-arm.c:8759 msgid "byte or halfword not valid for base register" msgstr "" -#: config/tc-arm.c:7824 +#: config/tc-arm.c:8764 msgid "r15 based store not allowed" msgstr "" -#: config/tc-arm.c:7829 +#: config/tc-arm.c:8769 msgid "invalid base register for register offset" msgstr "" -#: config/tc-arm.c:7847 config/tc-arm.c:7882 +#: config/tc-arm.c:8787 config/tc-arm.c:8822 msgid "invalid offset" msgstr "" -#: config/tc-arm.c:7858 +#: config/tc-arm.c:8798 msgid "invalid base register in load/store" msgstr "" -#: config/tc-arm.c:8401 +#: config/tc-arm.c:9341 msgid "expecting immediate, 7bit operand" msgstr "" -#: config/tc-arm.c:8416 +#: config/tc-arm.c:9356 msgid "immediate out of range" msgstr "" -#: config/tc-arm.c:8459 +#: config/tc-arm.c:9399 msgid "offset expected" msgstr "" -#: config/tc-arm.c:8468 config/tc-pj.c:528 config/tc-sh.c:3591 +#: config/tc-arm.c:9408 config/tc-pj.c:537 config/tc-sh.c:3593 msgid "offset out of range" msgstr "" -#: config/tc-arm.c:8605 +#: config/tc-arm.c:9545 msgid "Rs and Rd must be different in MUL" msgstr "" -#: config/tc-arm.c:8749 +#: config/tc-arm.c:9689 msgid "" "inserted missing '!': load/store multiple always writes back base register" msgstr "" -#: config/tc-arm.c:8771 +#: config/tc-arm.c:9711 msgid "only lo-regs valid in load/store multiple" msgstr "" -#: config/tc-arm.c:8817 +#: config/tc-arm.c:9757 msgid "syntax: ldrs[b] Rd, [Rb, Ro]" msgstr "" -#: config/tc-arm.c:8881 +#: config/tc-arm.c:9821 msgid "invalid register list to push/pop instruction" msgstr "" -#: config/tc-arm.c:8993 config/tc-arm.c:9171 +#: config/tc-arm.c:9933 config/tc-arm.c:10159 msgid "virtual memory exhausted" msgstr "" -#: config/tc-arm.c:9074 +#: config/tc-arm.c:10014 #, c-format msgid "register '%s' does not exist\n" msgstr "" -#: config/tc-arm.c:9078 +#: config/tc-arm.c:10018 #, c-format msgid "" "ignoring redefinition of register alias '%s' to non-existant register '%s'" msgstr "" -#: config/tc-arm.c:9087 +#: config/tc-arm.c:10027 #, c-format msgid "ignoring redefinition of register alias '%s'" msgstr "" -#: config/tc-arm.c:9093 +#: config/tc-arm.c:10033 msgid "ignoring incomplete .req pseuso op" msgstr "" -#: config/tc-arm.c:9195 +#: config/tc-arm.c:10183 msgid "use of old and new-style options to set CPU type" msgstr "" -#: config/tc-arm.c:9205 +#: config/tc-arm.c:10193 msgid "use of old and new-style options to set FPU type" msgstr "" -#: config/tc-arm.c:9415 +#: config/tc-arm.c:10473 msgid "bad call to MD_ATOF()" msgstr "" -#: config/tc-arm.c:9645 +#: config/tc-arm.c:10703 #, c-format msgid "invalid constant (%lx) after fixup" msgstr "" -#: config/tc-arm.c:9681 +#: config/tc-arm.c:10741 #, c-format msgid "unable to compute ADRL instructions for PC offset of 0x%lx" msgstr "" -#: config/tc-arm.c:9711 +#: config/tc-arm.c:10771 #, c-format msgid "bad immediate value for offset (%ld)" msgstr "" -#: config/tc-arm.c:9733 config/tc-arm.c:9755 +#: config/tc-arm.c:10793 config/tc-arm.c:10815 msgid "invalid literal constant: pool needs to be closer" msgstr "" -#: config/tc-arm.c:9735 +#: config/tc-arm.c:10795 #, c-format msgid "bad immediate value for half-word offset (%ld)" msgstr "" -#: config/tc-arm.c:9772 +#: config/tc-arm.c:10832 msgid "shift expression is too large" msgstr "" -#: config/tc-arm.c:9791 config/tc-arm.c:9800 +#: config/tc-arm.c:10851 config/tc-arm.c:10860 msgid "invalid swi expression" msgstr "" -#: config/tc-arm.c:9810 +#: config/tc-arm.c:10870 msgid "invalid expression in load/store multiple" msgstr "" -#: config/tc-arm.c:9863 +#: config/tc-arm.c:10923 msgid "GAS can't handle same-section branch dest >= 0x04000000" msgstr "" -#: config/tc-arm.c:9872 +#: config/tc-arm.c:10932 msgid "out of range branch" msgstr "" -#: config/tc-arm.c:9905 config/tc-arm.c:9921 +#: config/tc-arm.c:10965 config/tc-arm.c:10981 msgid "branch out of range" msgstr "" -#: config/tc-arm.c:9945 +#: config/tc-arm.c:11005 msgid "branch with link out of range" msgstr "" -#: config/tc-arm.c:10018 +#: config/tc-arm.c:11074 msgid "illegal value for co-processor offset" msgstr "" -#: config/tc-arm.c:10042 +#: config/tc-arm.c:11086 +msgid "Illegal value for co-processor offset" +msgstr "" + +#: config/tc-arm.c:11110 #, c-format msgid "invalid offset, target not word aligned (0x%08X)" msgstr "" -#: config/tc-arm.c:10048 config/tc-arm.c:10057 config/tc-arm.c:10064 -#: config/tc-arm.c:10071 config/tc-arm.c:10078 +#: config/tc-arm.c:11116 config/tc-arm.c:11126 config/tc-arm.c:11134 +#: config/tc-arm.c:11142 config/tc-arm.c:11150 #, c-format msgid "invalid offset, value too big (0x%08lX)" msgstr "" -#: config/tc-arm.c:10117 +#: config/tc-arm.c:11190 msgid "invalid immediate for stack address calculation" msgstr "" -#: config/tc-arm.c:10126 +#: config/tc-arm.c:11199 #, c-format msgid "invalid immediate for address calculation (value = 0x%08lX)" msgstr "" -#: config/tc-arm.c:10136 +#: config/tc-arm.c:11209 msgid "invalid 8bit immediate" msgstr "" -#: config/tc-arm.c:10144 +#: config/tc-arm.c:11217 msgid "invalid 3bit immediate" msgstr "" -#: config/tc-arm.c:10160 +#: config/tc-arm.c:11233 #, c-format msgid "invalid immediate: %ld is too large" msgstr "" -#: config/tc-arm.c:10175 +#: config/tc-arm.c:11248 #, c-format msgid "illegal Thumb shift value: %ld" msgstr "" -#: config/tc-arm.c:10189 +#: config/tc-arm.c:11262 #, c-format msgid "bad relocation fixup type (%d)" msgstr "" -#: config/tc-arm.c:10260 -msgid "literal referenced across section boundary (Implicit dump?)" +#: config/tc-arm.c:11333 +msgid "literal referenced across section boundary" msgstr "" -#: config/tc-arm.c:10273 -#, c-format -msgid "internal relocation (type %d) not fixed up (IMMEDIATE)" +#: config/tc-arm.c:11346 +msgid "internal relocation (type: IMMEDIATE) not fixed up" msgstr "" -#: config/tc-arm.c:10279 +#: config/tc-arm.c:11351 msgid "ADRL used for a symbol not defined in the same file" msgstr "" -#: config/tc-arm.c:10284 -#, c-format -msgid "internal_relocation (type %d) not fixed up (OFFSET_IMM)" +#: config/tc-arm.c:11356 +msgid "internal_relocation (type: OFFSET_IMM) not fixed up" msgstr "" -#: config/tc-arm.c:10305 config/tc-cris.c:2940 config/tc-mcore.c:2104 -#: config/tc-mmix.c:2869 config/tc-ns32k.c:2350 +#: config/tc-arm.c:11374 config/tc-cris.c:3063 config/tc-mcore.c:2052 +#: config/tc-mmix.c:2867 config/tc-ns32k.c:2396 msgid "" msgstr "" -#: config/tc-arm.c:10308 config/tc-arm.c:10329 +#: config/tc-arm.c:11377 config/tc-arm.c:11398 #, c-format msgid "cannot represent %s relocation in this object file format" msgstr "" -#: config/tc-arm.c:10425 +#: config/tc-arm.c:11494 #, c-format msgid "no operator -- statement `%s'\n" msgstr "" -#: config/tc-arm.c:10443 config/tc-arm.c:10468 +#: config/tc-arm.c:11512 config/tc-arm.c:11537 #, c-format msgid "selected processor does not support `%s'" msgstr "" -#: config/tc-arm.c:10485 +#: config/tc-arm.c:11554 #, c-format msgid "bad instruction `%s'" msgstr "" -#: config/tc-arm.c:10586 +#: config/tc-arm.c:11655 msgid "generate PIC code" msgstr "" -#: config/tc-arm.c:10587 +#: config/tc-arm.c:11656 msgid "assemble Thumb code" msgstr "" -#: config/tc-arm.c:10588 +#: config/tc-arm.c:11657 msgid "support ARM/Thumb interworking" msgstr "" -#: config/tc-arm.c:10590 +#: config/tc-arm.c:11659 msgid "use old ABI (ELF only)" msgstr "" -#: config/tc-arm.c:10591 +#: config/tc-arm.c:11660 msgid "code uses 32-bit program counter" msgstr "" -#: config/tc-arm.c:10592 +#: config/tc-arm.c:11661 msgid "code uses 26-bit program counter" msgstr "" -#: config/tc-arm.c:10593 +#: config/tc-arm.c:11662 msgid "floating point args are in fp regs" msgstr "" -#: config/tc-arm.c:10595 +#: config/tc-arm.c:11664 msgid "re-entrant code" msgstr "" -#: config/tc-arm.c:10596 +#: config/tc-arm.c:11665 msgid "code is ATPCS conformant" msgstr "" -#: config/tc-arm.c:10597 +#: config/tc-arm.c:11666 msgid "assemble for big-endian" msgstr "" -#: config/tc-arm.c:10598 +#: config/tc-arm.c:11667 msgid "assemble for little-endian" msgstr "" #. These are recognized by the assembler, but have no affect on code. -#: config/tc-arm.c:10602 +#: config/tc-arm.c:11671 msgid "use frame pointer" msgstr "" -#: config/tc-arm.c:10603 +#: config/tc-arm.c:11672 msgid "use stack size checking" msgstr "" #. DON'T add any new processors to this list -- we want the whole list #. to go away... Add them to the processors table instead. -#: config/tc-arm.c:10607 config/tc-arm.c:10608 +#: config/tc-arm.c:11676 config/tc-arm.c:11677 msgid "use -mcpu=arm1" msgstr "" -#: config/tc-arm.c:10609 config/tc-arm.c:10610 +#: config/tc-arm.c:11678 config/tc-arm.c:11679 msgid "use -mcpu=arm2" msgstr "" -#: config/tc-arm.c:10611 config/tc-arm.c:10612 +#: config/tc-arm.c:11680 config/tc-arm.c:11681 msgid "use -mcpu=arm250" msgstr "" -#: config/tc-arm.c:10613 config/tc-arm.c:10614 +#: config/tc-arm.c:11682 config/tc-arm.c:11683 msgid "use -mcpu=arm3" msgstr "" -#: config/tc-arm.c:10615 config/tc-arm.c:10616 +#: config/tc-arm.c:11684 config/tc-arm.c:11685 msgid "use -mcpu=arm6" msgstr "" -#: config/tc-arm.c:10617 config/tc-arm.c:10618 +#: config/tc-arm.c:11686 config/tc-arm.c:11687 msgid "use -mcpu=arm600" msgstr "" -#: config/tc-arm.c:10619 config/tc-arm.c:10620 +#: config/tc-arm.c:11688 config/tc-arm.c:11689 msgid "use -mcpu=arm610" msgstr "" -#: config/tc-arm.c:10621 config/tc-arm.c:10622 +#: config/tc-arm.c:11690 config/tc-arm.c:11691 msgid "use -mcpu=arm620" msgstr "" -#: config/tc-arm.c:10623 config/tc-arm.c:10624 +#: config/tc-arm.c:11692 config/tc-arm.c:11693 msgid "use -mcpu=arm7" msgstr "" -#: config/tc-arm.c:10625 config/tc-arm.c:10626 +#: config/tc-arm.c:11694 config/tc-arm.c:11695 msgid "use -mcpu=arm70" msgstr "" -#: config/tc-arm.c:10627 config/tc-arm.c:10628 +#: config/tc-arm.c:11696 config/tc-arm.c:11697 msgid "use -mcpu=arm700" msgstr "" -#: config/tc-arm.c:10629 config/tc-arm.c:10630 +#: config/tc-arm.c:11698 config/tc-arm.c:11699 msgid "use -mcpu=arm700i" msgstr "" -#: config/tc-arm.c:10631 config/tc-arm.c:10632 +#: config/tc-arm.c:11700 config/tc-arm.c:11701 msgid "use -mcpu=arm710" msgstr "" -#: config/tc-arm.c:10633 config/tc-arm.c:10634 +#: config/tc-arm.c:11702 config/tc-arm.c:11703 msgid "use -mcpu=arm710c" msgstr "" -#: config/tc-arm.c:10635 config/tc-arm.c:10636 +#: config/tc-arm.c:11704 config/tc-arm.c:11705 msgid "use -mcpu=arm720" msgstr "" -#: config/tc-arm.c:10637 config/tc-arm.c:10638 +#: config/tc-arm.c:11706 config/tc-arm.c:11707 msgid "use -mcpu=arm7d" msgstr "" -#: config/tc-arm.c:10639 config/tc-arm.c:10640 +#: config/tc-arm.c:11708 config/tc-arm.c:11709 msgid "use -mcpu=arm7di" msgstr "" -#: config/tc-arm.c:10641 config/tc-arm.c:10642 +#: config/tc-arm.c:11710 config/tc-arm.c:11711 msgid "use -mcpu=arm7m" msgstr "" -#: config/tc-arm.c:10643 config/tc-arm.c:10644 +#: config/tc-arm.c:11712 config/tc-arm.c:11713 msgid "use -mcpu=arm7dm" msgstr "" -#: config/tc-arm.c:10645 config/tc-arm.c:10646 +#: config/tc-arm.c:11714 config/tc-arm.c:11715 msgid "use -mcpu=arm7dmi" msgstr "" -#: config/tc-arm.c:10647 config/tc-arm.c:10648 +#: config/tc-arm.c:11716 config/tc-arm.c:11717 msgid "use -mcpu=arm7100" msgstr "" -#: config/tc-arm.c:10649 config/tc-arm.c:10650 +#: config/tc-arm.c:11718 config/tc-arm.c:11719 msgid "use -mcpu=arm7500" msgstr "" -#: config/tc-arm.c:10651 config/tc-arm.c:10652 +#: config/tc-arm.c:11720 config/tc-arm.c:11721 msgid "use -mcpu=arm7500fe" msgstr "" -#: config/tc-arm.c:10653 config/tc-arm.c:10654 config/tc-arm.c:10655 -#: config/tc-arm.c:10656 +#: config/tc-arm.c:11722 config/tc-arm.c:11723 config/tc-arm.c:11724 +#: config/tc-arm.c:11725 msgid "use -mcpu=arm7tdmi" msgstr "" -#: config/tc-arm.c:10657 config/tc-arm.c:10658 +#: config/tc-arm.c:11726 config/tc-arm.c:11727 msgid "use -mcpu=arm710t" msgstr "" -#: config/tc-arm.c:10659 config/tc-arm.c:10660 +#: config/tc-arm.c:11728 config/tc-arm.c:11729 msgid "use -mcpu=arm720t" msgstr "" -#: config/tc-arm.c:10661 config/tc-arm.c:10662 +#: config/tc-arm.c:11730 config/tc-arm.c:11731 msgid "use -mcpu=arm740t" msgstr "" -#: config/tc-arm.c:10663 config/tc-arm.c:10664 +#: config/tc-arm.c:11732 config/tc-arm.c:11733 msgid "use -mcpu=arm8" msgstr "" -#: config/tc-arm.c:10665 config/tc-arm.c:10666 +#: config/tc-arm.c:11734 config/tc-arm.c:11735 msgid "use -mcpu=arm810" msgstr "" -#: config/tc-arm.c:10667 config/tc-arm.c:10668 +#: config/tc-arm.c:11736 config/tc-arm.c:11737 msgid "use -mcpu=arm9" msgstr "" -#: config/tc-arm.c:10669 config/tc-arm.c:10670 +#: config/tc-arm.c:11738 config/tc-arm.c:11739 msgid "use -mcpu=arm9tdmi" msgstr "" -#: config/tc-arm.c:10671 config/tc-arm.c:10672 +#: config/tc-arm.c:11740 config/tc-arm.c:11741 msgid "use -mcpu=arm920" msgstr "" -#: config/tc-arm.c:10673 config/tc-arm.c:10674 +#: config/tc-arm.c:11742 config/tc-arm.c:11743 msgid "use -mcpu=arm940" msgstr "" -#: config/tc-arm.c:10675 +#: config/tc-arm.c:11744 msgid "use -mcpu=strongarm" msgstr "" -#: config/tc-arm.c:10677 +#: config/tc-arm.c:11746 msgid "use -mcpu=strongarm110" msgstr "" -#: config/tc-arm.c:10679 +#: config/tc-arm.c:11748 msgid "use -mcpu=strongarm1100" msgstr "" -#: config/tc-arm.c:10681 +#: config/tc-arm.c:11750 msgid "use -mcpu=strongarm1110" msgstr "" -#: config/tc-arm.c:10682 +#: config/tc-arm.c:11751 msgid "use -mcpu=xscale" msgstr "" -#: config/tc-arm.c:10683 +#: config/tc-arm.c:11752 +msgid "use -mcpu=iwmmxt" +msgstr "" + +#: config/tc-arm.c:11753 msgid "use -mcpu=all" msgstr "" #. Architecture variants -- don't add any more to this list either. -#: config/tc-arm.c:10686 config/tc-arm.c:10687 +#: config/tc-arm.c:11756 config/tc-arm.c:11757 msgid "use -march=armv2" msgstr "" -#: config/tc-arm.c:10688 config/tc-arm.c:10689 +#: config/tc-arm.c:11758 config/tc-arm.c:11759 msgid "use -march=armv2a" msgstr "" -#: config/tc-arm.c:10690 config/tc-arm.c:10691 +#: config/tc-arm.c:11760 config/tc-arm.c:11761 msgid "use -march=armv3" msgstr "" -#: config/tc-arm.c:10692 config/tc-arm.c:10693 +#: config/tc-arm.c:11762 config/tc-arm.c:11763 msgid "use -march=armv3m" msgstr "" -#: config/tc-arm.c:10694 config/tc-arm.c:10695 +#: config/tc-arm.c:11764 config/tc-arm.c:11765 msgid "use -march=armv4" msgstr "" -#: config/tc-arm.c:10696 config/tc-arm.c:10697 +#: config/tc-arm.c:11766 config/tc-arm.c:11767 msgid "use -march=armv4t" msgstr "" -#: config/tc-arm.c:10698 config/tc-arm.c:10699 +#: config/tc-arm.c:11768 config/tc-arm.c:11769 msgid "use -march=armv5" msgstr "" -#: config/tc-arm.c:10700 config/tc-arm.c:10701 +#: config/tc-arm.c:11770 config/tc-arm.c:11771 msgid "use -march=armv5t" msgstr "" -#: config/tc-arm.c:10702 config/tc-arm.c:10703 +#: config/tc-arm.c:11772 config/tc-arm.c:11773 msgid "use -march=armv5te" msgstr "" #. Floating point variants -- don't add any more to this list either. -#: config/tc-arm.c:10706 +#: config/tc-arm.c:11776 msgid "use -mfpu=fpe" msgstr "" -#: config/tc-arm.c:10707 +#: config/tc-arm.c:11777 msgid "use -mfpu=fpa10" msgstr "" -#: config/tc-arm.c:10708 +#: config/tc-arm.c:11778 msgid "use -mfpu=fpa11" msgstr "" -#: config/tc-arm.c:10710 +#: config/tc-arm.c:11780 msgid "use either -mfpu=softfpa or -mfpu=softvfp" msgstr "" -#: config/tc-arm.c:10890 +#: config/tc-arm.c:11963 msgid "invalid architectural extension" msgstr "" -#: config/tc-arm.c:10904 +#: config/tc-arm.c:11977 msgid "missing architectural extension" msgstr "" -#: config/tc-arm.c:10917 +#: config/tc-arm.c:11990 #, c-format msgid "unknown architectural extnsion `%s'" msgstr "" -#: config/tc-arm.c:10942 +#: config/tc-arm.c:12015 #, c-format msgid "missing cpu name `%s'" msgstr "" -#: config/tc-arm.c:10958 +#: config/tc-arm.c:12031 #, c-format msgid "unknown cpu `%s'" msgstr "" -#: config/tc-arm.c:10977 +#: config/tc-arm.c:12050 #, c-format msgid "missing architecture name `%s'" msgstr "" -#: config/tc-arm.c:10994 +#: config/tc-arm.c:12067 #, c-format msgid "unknown architecture `%s'\n" msgstr "" -#: config/tc-arm.c:11011 +#: config/tc-arm.c:12084 #, c-format msgid "unknown floating point format `%s'\n" msgstr "" -#: config/tc-arm.c:11017 +#: config/tc-arm.c:12090 msgid "\t assemble for CPU " msgstr "" -#: config/tc-arm.c:11019 +#: config/tc-arm.c:12092 msgid "\t assemble for architecture " msgstr "" -#: config/tc-arm.c:11021 +#: config/tc-arm.c:12094 msgid "\t assemble for FPU architecture " msgstr "" -#: config/tc-arm.c:11063 config/tc-arm.c:11085 +#: config/tc-arm.c:12136 config/tc-arm.c:12158 #, c-format msgid "option `-%c%s' is deprecated: %s" msgstr "" -#: config/tc-arm.c:11094 +#: config/tc-arm.c:12167 #, c-format msgid "unrecognized option `-%c%s'" msgstr "" -#: config/tc-arm.c:11108 +#: config/tc-arm.c:12181 msgid " ARM-specific assembler options:\n" msgstr "" -#: config/tc-arm.c:11119 +#: config/tc-arm.c:12192 msgid " -EB assemble code for a big-endian cpu\n" msgstr "" -#: config/tc-arm.c:11124 +#: config/tc-arm.c:12197 msgid " -EL assemble code for a little-endian cpu\n" msgstr "" -#: config/tc-arm.c:11306 +#: config/tc-arm.c:12381 #, c-format msgid "%s: unexpected function type: %d" msgstr "" -#: config/tc-arm.c:11672 +#: config/tc-arm.c:12756 msgid "alignments greater than 32 bytes not supported in .text sections." msgstr "" @@ -2586,7 +2675,7 @@ msgid "" " (default for avr3, avr5)\n" msgstr "" -#: config/tc-avr.c:330 +#: config/tc-avr.c:330 config/tc-msp430.c:257 #, c-format msgid "unknown MCU: %s\n" msgstr "" @@ -2596,10 +2685,10 @@ msgstr "" msgid "redefinition of mcu type `%s' to `%s'" msgstr "" -#: config/tc-avr.c:390 config/tc-d10v.c:319 config/tc-d30v.c:366 -#: config/tc-mips.c:9862 config/tc-mmix.c:2250 config/tc-mn10200.c:361 -#: config/tc-pj.c:357 config/tc-ppc.c:4835 config/tc-sh.c:2536 -#: config/tc-v850.c:1194 +#: config/tc-avr.c:390 config/tc-d10v.c:319 config/tc-d30v.c:365 +#: config/tc-mips.c:10137 config/tc-mmix.c:2246 config/tc-mn10200.c:361 +#: config/tc-msp430.c:378 config/tc-pj.c:374 config/tc-ppc.c:5105 +#: config/tc-sh.c:2528 config/tc-v850.c:1244 msgid "bad call to md_atof" msgstr "" @@ -2673,268 +2762,298 @@ msgstr "" msgid "unknown constraint `%c'" msgstr "" -#: config/tc-avr.c:896 config/tc-avr.c:912 config/tc-avr.c:1013 +#: config/tc-avr.c:881 config/tc-avr.c:897 config/tc-avr.c:998 +#: config/tc-msp430.c:1431 config/tc-msp430.c:1448 #, c-format msgid "odd address operand: %ld" msgstr "" -#: config/tc-avr.c:904 config/tc-avr.c:923 config/tc-d10v.c:586 +#: config/tc-avr.c:889 config/tc-avr.c:908 config/tc-d10v.c:586 +#: config/tc-d30v.c:655 config/tc-msp430.c:1439 config/tc-msp430.c:1453 +#: config/tc-msp430.c:1463 #, c-format msgid "operand out of range: %ld" msgstr "" -#: config/tc-avr.c:1022 config/tc-d10v.c:1810 config/tc-d30v.c:1987 +#: config/tc-avr.c:1007 config/tc-d10v.c:1793 config/tc-d30v.c:1973 +#: config/tc-msp430.c:1481 #, c-format msgid "line %d: unknown relocation type: 0x%x" msgstr "" -#: config/tc-avr.c:1036 +#: config/tc-avr.c:1021 msgid "only constant expression allowed" msgstr "" -#: config/tc-avr.c:1073 config/tc-d10v.c:1659 config/tc-d30v.c:1807 -#: config/tc-mn10200.c:1240 config/tc-mn10300.c:1781 config/tc-or32.c:1622 -#: config/tc-ppc.c:5573 config/tc-v850.c:2207 +#: config/tc-avr.c:1057 config/tc-d10v.c:1659 config/tc-d30v.c:1806 +#: config/tc-mn10200.c:1255 config/tc-mn10300.c:2303 config/tc-msp430.c:1520 +#: config/tc-or32.c:1618 config/tc-ppc.c:5919 config/tc-v850.c:2263 #, c-format msgid "reloc %d not supported by object file format" msgstr "" -#: config/tc-avr.c:1097 config/tc-d10v.c:1248 config/tc-d10v.c:1262 -#: config/tc-h8300.c:1289 config/tc-h8500.c:1088 config/tc-mcore.c:988 -#: config/tc-pj.c:266 config/tc-sh.c:2104 config/tc-z8k.c:1196 +#: config/tc-avr.c:1081 config/tc-d10v.c:1248 config/tc-d10v.c:1262 +#: config/tc-h8300.c:1915 config/tc-h8500.c:1106 config/tc-mcore.c:938 +#: config/tc-msp430.c:438 config/tc-pj.c:283 config/tc-sh.c:2096 +#: config/tc-z8k.c:1238 msgid "can't find opcode " msgstr "" -#: config/tc-avr.c:1114 +#: config/tc-avr.c:1098 #, c-format msgid "illegal opcode %s for mcu %s" msgstr "" -#: config/tc-avr.c:1122 +#: config/tc-avr.c:1106 msgid "garbage at end of line" msgstr "" -#: config/tc-avr.c:1186 read.c:3224 +#: config/tc-avr.c:1170 read.c:3226 msgid "illegal expression" msgstr "" -#: config/tc-avr.c:1212 config/tc-avr.c:1278 +#: config/tc-avr.c:1196 config/tc-avr.c:1262 msgid "`)' required" msgstr "" -#: config/tc-avr.c:1232 +#: config/tc-avr.c:1216 #, c-format msgid "constant out of 8-bit range: %d" msgstr "" -#: config/tc-avr.c:1235 +#: config/tc-avr.c:1219 msgid "expression possibly out of 8-bit range" msgstr "" -#: config/tc-avr.c:1306 config/tc-avr.c:1313 +#: config/tc-avr.c:1290 config/tc-avr.c:1297 #, c-format msgid "illegal %srelocation size: %d" msgstr "" -#: config/tc-cris.c:681 +#: config/tc-cris.c:386 config/tc-m68hc11.c:2831 +#, c-format +msgid "internal inconsistency problem in %s: fr_symbol %lx" +msgstr "" + +#: config/tc-cris.c:390 config/tc-m68hc11.c:2835 +#, c-format +msgid "internal inconsistency problem in %s: resolved symbol" +msgstr "" + +#: config/tc-cris.c:396 config/tc-m68hc11.c:2841 +#, c-format +msgid "internal inconsistency problem in %s: fr_subtype %d" +msgstr "" + +#: config/tc-cris.c:650 +#, c-format +msgid "internal inconsistency in %s: bdapq no symbol" +msgstr "" + +#: config/tc-cris.c:663 +#, c-format +msgid "internal inconsistency in %s: bdap.w with no symbol" +msgstr "" + +#: config/tc-cris.c:807 msgid "Virtual memory exhausted" msgstr "" -#: config/tc-cris.c:689 +#: config/tc-cris.c:815 #, c-format msgid "Can't hash `%s': %s\n" msgstr "" -#: config/tc-cris.c:690 +#: config/tc-cris.c:816 msgid "(unknown reason)" msgstr "" -#: config/tc-cris.c:694 +#: config/tc-cris.c:820 #, c-format msgid "Buggy opcode: `%s' \"%s\"\n" msgstr "" -#: config/tc-cris.c:1039 +#: config/tc-cris.c:1164 #, c-format msgid "Immediate value not in 5 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:1055 +#: config/tc-cris.c:1180 #, c-format msgid "Immediate value not in 4 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:1094 +#: config/tc-cris.c:1219 #, c-format msgid "Immediate value not in 6 bit range: %ld" msgstr "" -#: config/tc-cris.c:1109 +#: config/tc-cris.c:1234 #, c-format msgid "Immediate value not in 6 bit unsigned range: %ld" msgstr "" #. Others have a generic warning. -#: config/tc-cris.c:1199 +#: config/tc-cris.c:1324 #, c-format msgid "Unimplemented register `%s' specified" msgstr "" #. We've come to the end of instructions with this #. opcode, so it must be an error. -#: config/tc-cris.c:1358 +#: config/tc-cris.c:1483 msgid "Illegal operands" msgstr "" -#: config/tc-cris.c:1389 config/tc-cris.c:1420 +#: config/tc-cris.c:1514 config/tc-cris.c:1545 #, c-format msgid "Immediate value not in 8 bit range: %ld" msgstr "" -#: config/tc-cris.c:1399 config/tc-cris.c:1427 +#: config/tc-cris.c:1524 config/tc-cris.c:1552 #, c-format msgid "Immediate value not in 16 bit range: %ld" msgstr "" -#: config/tc-cris.c:1448 +#: config/tc-cris.c:1573 msgid "PIC relocation size does not match operand size" msgstr "" -#: config/tc-cris.c:2447 +#: config/tc-cris.c:2572 msgid "32-bit conditional branch generated" msgstr "" -#: config/tc-cris.c:2501 +#: config/tc-cris.c:2626 msgid "Complex expression not supported" msgstr "" #. FIXME: Is this function mentioned in the internals.texi manual? If #. not, add it. -#: config/tc-cris.c:2622 +#: config/tc-cris.c:2747 msgid "Bad call to md_atof () - floating point formats are not supported" msgstr "" -#: config/tc-cris.c:2669 +#: config/tc-cris.c:2794 msgid "PC-relative relocation must be trivially resolved" msgstr "" -#: config/tc-cris.c:2712 +#: config/tc-cris.c:2837 #, c-format msgid "Value not in 16 bit range: %ld" msgstr "" -#: config/tc-cris.c:2723 +#: config/tc-cris.c:2848 #, c-format msgid "Value not in 8 bit range: %ld" msgstr "" -#: config/tc-cris.c:2730 +#: config/tc-cris.c:2855 #, c-format msgid "Value not in 4 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:2737 +#: config/tc-cris.c:2862 #, c-format msgid "Value not in 5 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:2744 +#: config/tc-cris.c:2869 #, c-format msgid "Value not in 6 bit range: %ld" msgstr "" -#: config/tc-cris.c:2751 +#: config/tc-cris.c:2876 #, c-format msgid "Value not in 6 bit unsigned range: %ld" msgstr "" -#: config/tc-cris.c:2799 +#: config/tc-cris.c:2924 msgid "Please use --help to see usage and options for this assembler.\n" msgstr "" -#: config/tc-cris.c:2811 +#: config/tc-cris.c:2936 msgid "--no-underscore is invalid with a.out format" msgstr "" -#: config/tc-cris.c:2887 +#: config/tc-cris.c:3012 msgid "" "Semantics error. This type of operand can not be relocated, it must be an " "assembly-time constant" msgstr "" -#: config/tc-cris.c:2941 +#: config/tc-cris.c:3064 #, c-format msgid "Cannot generate relocation type for symbol %s, code %s" msgstr "" #. The messages are formatted to line up with the generic options. -#: config/tc-cris.c:2955 +#: config/tc-cris.c:3078 msgid "CRIS-specific options:\n" msgstr "" -#: config/tc-cris.c:2957 +#: config/tc-cris.c:3080 msgid "" " -h, -H Don't execute, print this help text. Deprecated.\n" msgstr "" -#: config/tc-cris.c:2959 +#: config/tc-cris.c:3082 msgid " -N Warn when branches are expanded to jumps.\n" msgstr "" -#: config/tc-cris.c:2961 +#: config/tc-cris.c:3084 msgid "" " --underscore User symbols are normally prepended with " "underscore.\n" msgstr "" -#: config/tc-cris.c:2963 +#: config/tc-cris.c:3086 msgid " Registers will not need any prefix.\n" msgstr "" -#: config/tc-cris.c:2965 +#: config/tc-cris.c:3088 msgid " --no-underscore User symbols do not have any prefix.\n" msgstr "" -#: config/tc-cris.c:2967 +#: config/tc-cris.c:3090 msgid " Registers will require a `$'-prefix.\n" msgstr "" -#: config/tc-cris.c:2969 +#: config/tc-cris.c:3092 msgid " --pic\t\t\tEnable generation of position-independent code.\n" msgstr "" -#: config/tc-cris.c:2992 +#: config/tc-cris.c:3115 msgid "Invalid relocation" msgstr "" -#: config/tc-cris.c:3033 +#: config/tc-cris.c:3149 msgid "Invalid pc-relative relocation" msgstr "" -#: config/tc-cris.c:3084 +#: config/tc-cris.c:3198 #, c-format msgid "Adjusted signed .word (%ld) overflows: `switch'-statement too large." msgstr "" -#: config/tc-cris.c:3111 +#: config/tc-cris.c:3225 #, c-format msgid ".syntax %s requires command-line option `--underscore'" msgstr "" -#: config/tc-cris.c:3120 +#: config/tc-cris.c:3234 #, c-format msgid ".syntax %s requires command-line option `--no-underscore'" msgstr "" -#: config/tc-cris.c:3158 +#: config/tc-cris.c:3272 msgid "Unknown .syntax operand" msgstr "" -#: config/tc-cris.c:3169 +#: config/tc-cris.c:3283 msgid "Pseudodirective .file is only valid when generating ELF" msgstr "" -#: config/tc-cris.c:3182 +#: config/tc-cris.c:3296 msgid "Pseudodirective .loc is only valid when generating ELF" msgstr "" @@ -2948,9 +3067,9 @@ msgid "" " instructions together.\n" msgstr "" -#: config/tc-d10v.c:543 config/tc-d30v.c:550 config/tc-mn10200.c:937 -#: config/tc-mn10300.c:1315 config/tc-ppc.c:2141 config/tc-s390.c:1060 -#: config/tc-tic80.c:279 config/tc-v850.c:1981 +#: config/tc-d10v.c:543 config/tc-d30v.c:549 config/tc-mn10200.c:937 +#: config/tc-mn10300.c:1812 config/tc-ppc.c:2332 config/tc-s390.c:1234 +#: config/tc-tic80.c:275 config/tc-v850.c:2021 msgid "illegal operand" msgstr "" @@ -2979,20 +3098,20 @@ msgstr "" msgid "One of these instructions may not be executed in parallel." msgstr "" -#: config/tc-d10v.c:832 config/tc-d30v.c:877 +#: config/tc-d10v.c:832 config/tc-d30v.c:876 msgid "Two IU instructions may not be executed in parallel" msgstr "" #: config/tc-d10v.c:834 config/tc-d10v.c:842 config/tc-d10v.c:856 -#: config/tc-d10v.c:871 config/tc-d30v.c:878 config/tc-d30v.c:887 +#: config/tc-d10v.c:871 config/tc-d30v.c:877 config/tc-d30v.c:886 msgid "Swapping instruction order" msgstr "" -#: config/tc-d10v.c:840 config/tc-d30v.c:884 +#: config/tc-d10v.c:840 config/tc-d30v.c:883 msgid "Two MU instructions may not be executed in parallel" msgstr "" -#: config/tc-d10v.c:860 config/tc-d30v.c:904 +#: config/tc-d10v.c:860 config/tc-d30v.c:903 msgid "IU instruction may not be in the left container" msgstr "" @@ -3002,11 +3121,11 @@ msgid "" "container." msgstr "" -#: config/tc-d10v.c:875 config/tc-d30v.c:915 +#: config/tc-d10v.c:875 config/tc-d30v.c:914 msgid "MU instruction may not be in the right container" msgstr "" -#: config/tc-d10v.c:881 config/tc-d30v.c:927 +#: config/tc-d10v.c:881 config/tc-d30v.c:926 msgid "unknown execution type passed to write_2_short()" msgstr "" @@ -3037,20 +3156,20 @@ msgstr "" msgid "resource conflict (F flag)" msgstr "" -#: config/tc-d10v.c:1276 config/tc-d10v.c:1298 config/tc-d30v.c:1411 +#: config/tc-d10v.c:1276 config/tc-d10v.c:1298 config/tc-d30v.c:1410 msgid "Unable to mix instructions as specified" msgstr "" -#: config/tc-d10v.c:1345 config/tc-d30v.c:1548 +#: config/tc-d10v.c:1345 config/tc-d30v.c:1547 #, c-format msgid "unknown opcode: %s" msgstr "" -#: config/tc-d10v.c:1428 config/tc-d10v.c:1603 config/tc-tic80.c:536 +#: config/tc-d10v.c:1428 config/tc-d10v.c:1603 config/tc-tic80.c:532 msgid "bad opcode or operands" msgstr "" -#: config/tc-d10v.c:1503 config/tc-m68k.c:4314 +#: config/tc-d10v.c:1503 config/tc-m68k.c:4305 msgid "value out of range" msgstr "" @@ -3058,7 +3177,7 @@ msgstr "" msgid "illegal operand - register name found where none expected" msgstr "" -#: config/tc-d10v.c:1614 config/tc-tic80.c:547 +#: config/tc-d10v.c:1614 config/tc-tic80.c:543 msgid "Register number must be EVEN" msgstr "" @@ -3071,7 +3190,7 @@ msgstr "" msgid "cr%ld is a reserved control register" msgstr "" -#: config/tc-d10v.c:1790 +#: config/tc-d10v.c:1773 #, c-format msgid "line %d: rep or repi must include at least 4 instructions" msgstr "" @@ -3081,7 +3200,7 @@ msgstr "" msgid "Register name %s conflicts with symbol of the same name" msgstr "" -#: config/tc-d30v.c:288 +#: config/tc-d30v.c:287 msgid "" "\n" "D30V options:\n" @@ -3094,131 +3213,126 @@ msgid "" "-C Opposite of -C. -c is the default.\n" msgstr "" -#: config/tc-d30v.c:462 +#: config/tc-d30v.c:461 msgid "unexpected 12-bit reloc type" msgstr "" -#: config/tc-d30v.c:469 +#: config/tc-d30v.c:468 msgid "unexpected 18-bit reloc type" msgstr "" -#: config/tc-d30v.c:656 -#, c-format -msgid "operand out of range: %d" -msgstr "" - -#: config/tc-d30v.c:720 +#: config/tc-d30v.c:719 #, c-format msgid "%s NOP inserted" msgstr "" -#: config/tc-d30v.c:721 +#: config/tc-d30v.c:720 msgid "sequential" msgstr "" -#: config/tc-d30v.c:721 +#: config/tc-d30v.c:720 msgid "parallel" msgstr "" -#: config/tc-d30v.c:873 +#: config/tc-d30v.c:872 msgid "Instructions may not be executed in parallel" msgstr "" -#: config/tc-d30v.c:886 +#: config/tc-d30v.c:885 #, c-format msgid "Executing %s in IU may not work" msgstr "" -#: config/tc-d30v.c:893 +#: config/tc-d30v.c:892 #, c-format msgid "Executing %s in IU may not work in parallel execution" msgstr "" -#: config/tc-d30v.c:906 +#: config/tc-d30v.c:905 #, c-format msgid "special left instruction `%s' kills instruction `%s' in right container" msgstr "" -#: config/tc-d30v.c:917 +#: config/tc-d30v.c:916 #, c-format msgid "Executing %s in reverse serial with %s may not work" msgstr "" -#: config/tc-d30v.c:920 +#: config/tc-d30v.c:919 #, c-format msgid "Executing %s in IU in reverse serial may not work" msgstr "" -#: config/tc-d30v.c:1290 config/tc-d30v.c:1307 +#: config/tc-d30v.c:1289 config/tc-d30v.c:1306 msgid "Cannot assemble instruction" msgstr "" -#: config/tc-d30v.c:1292 +#: config/tc-d30v.c:1291 msgid "First opcode is long. Unable to mix instructions as specified." msgstr "" -#: config/tc-d30v.c:1361 +#: config/tc-d30v.c:1360 msgid "word of NOPs added between word multiply and load" msgstr "" -#: config/tc-d30v.c:1363 +#: config/tc-d30v.c:1362 msgid "word of NOPs added between word multiply and 16-bit multiply" msgstr "" -#: config/tc-d30v.c:1395 +#: config/tc-d30v.c:1394 msgid "Instruction uses long version, so it cannot be mixed as specified" msgstr "" -#: config/tc-d30v.c:1478 config/tc-d30v.c:1516 +#: config/tc-d30v.c:1477 config/tc-d30v.c:1515 #, c-format msgid "unknown condition code: %s" msgstr "" -#: config/tc-d30v.c:1509 +#: config/tc-d30v.c:1508 #, c-format msgid "cmpu doesn't support condition code %s" msgstr "" -#: config/tc-d30v.c:1559 +#: config/tc-d30v.c:1558 #, c-format msgid "operands for opcode `%s' do not match any valid format" msgstr "" -#: config/tc-d30v.c:1777 +#: config/tc-d30v.c:1776 msgid "Odd numbered register used as target of multi-register instruction" msgstr "" -#: config/tc-d30v.c:1876 +#: config/tc-d30v.c:1862 #, c-format msgid "line %d: unable to place address of symbol '%s' into a byte" msgstr "" -#: config/tc-d30v.c:1879 +#: config/tc-d30v.c:1865 #, c-format -msgid "line %d: unable to place value %x into a byte" +msgid "line %d: unable to place value %lx into a byte" msgstr "" -#: config/tc-d30v.c:1887 +#: config/tc-d30v.c:1873 #, c-format msgid "line %d: unable to place address of symbol '%s' into a short" msgstr "" -#: config/tc-d30v.c:1890 +#: config/tc-d30v.c:1876 #, c-format -msgid "line %d: unable to place value %x into a short" +msgid "line %d: unable to place value %lx into a short" msgstr "" -#: config/tc-d30v.c:1898 +#: config/tc-d30v.c:1884 #, c-format msgid "line %d: unable to place address of symbol '%s' into a quad" msgstr "" -#: config/tc-d30v.c:2067 +#: config/tc-d30v.c:2053 #, c-format msgid "value too large to fit in %d bits" msgstr "" -#: config/tc-d30v.c:2210 +#: config/tc-d30v.c:2196 #, c-format msgid "Alignment too large: %d assumed" msgstr "" @@ -3268,870 +3382,928 @@ msgstr "" msgid "failed general register sanity check." msgstr "" -#: config/tc-dlx.c:1336 +#: config/tc-dlx.c:1324 msgid "Invalid expression after # number\n" msgstr "" -#: config/tc-fr30.c:84 +#: config/tc-fr30.c:85 msgid " FR30 specific command line options:\n" msgstr "" -#: config/tc-fr30.c:143 config/tc-openrisc.c:150 +#: config/tc-fr30.c:139 config/tc-openrisc.c:152 #, c-format msgid "Instruction %s not allowed in a delay slot." msgstr "" -#: config/tc-fr30.c:383 config/tc-m32r.c:1559 +#: config/tc-fr30.c:383 config/tc-m32r.c:1576 msgid "Addend to unresolved symbol not on word boundary." msgstr "" -#: config/tc-fr30.c:540 config/tc-frv.c:1283 config/tc-i960.c:773 -#: config/tc-m32r.c:1867 config/tc-openrisc.c:468 config/tc-xstormy16.c:635 +#: config/tc-fr30.c:524 config/tc-frv.c:1289 config/tc-i960.c:798 +#: config/tc-ip2k.c:351 config/tc-m32r.c:1884 config/tc-openrisc.c:452 +#: config/tc-xstormy16.c:636 msgid "Bad call to md_atof()" msgstr "" -#: config/tc-frv.c:416 +#: config/tc-frv.c:413 msgid "FRV specific command line options:\n" msgstr "" -#: config/tc-frv.c:417 +#: config/tc-frv.c:414 msgid "-G n Data >= n bytes is in small data area\n" msgstr "" -#: config/tc-frv.c:418 +#: config/tc-frv.c:415 msgid "-mgpr-32 Note 32 gprs are used\n" msgstr "" -#: config/tc-frv.c:419 +#: config/tc-frv.c:416 msgid "-mgpr-64 Note 64 gprs are used\n" msgstr "" -#: config/tc-frv.c:420 +#: config/tc-frv.c:417 msgid "-mfpr-32 Note 32 fprs are used\n" msgstr "" -#: config/tc-frv.c:421 +#: config/tc-frv.c:418 msgid "-mfpr-64 Note 64 fprs are used\n" msgstr "" -#: config/tc-frv.c:422 +#: config/tc-frv.c:419 msgid "-msoft-float Note software fp is used\n" msgstr "" -#: config/tc-frv.c:423 +#: config/tc-frv.c:420 msgid "-mdword Note stack is aligned to a 8 byte boundary\n" msgstr "" -#: config/tc-frv.c:424 +#: config/tc-frv.c:421 msgid "-mno-dword Note stack is aligned to a 4 byte boundary\n" msgstr "" -#: config/tc-frv.c:425 +#: config/tc-frv.c:422 msgid "-mdouble Note fp double insns are used\n" msgstr "" -#: config/tc-frv.c:426 +#: config/tc-frv.c:423 msgid "-mmedia Note media insns are used\n" msgstr "" -#: config/tc-frv.c:427 +#: config/tc-frv.c:424 msgid "-mmuladd Note multiply add/subtract insns are used\n" msgstr "" -#: config/tc-frv.c:428 +#: config/tc-frv.c:425 msgid "-mpack Note instructions are packed\n" msgstr "" -#: config/tc-frv.c:429 +#: config/tc-frv.c:426 msgid "-mno-pack Do not allow instructions to be packed\n" msgstr "" -#: config/tc-frv.c:430 +#: config/tc-frv.c:427 msgid "-mpic Note small position independent code\n" msgstr "" -#: config/tc-frv.c:431 +#: config/tc-frv.c:428 msgid "-mPIC Note large position independent code\n" msgstr "" -#: config/tc-frv.c:432 +#: config/tc-frv.c:429 msgid "-mlibrary-pic Compile library for large position indepedent code\n" msgstr "" -#: config/tc-frv.c:433 +#: config/tc-frv.c:430 msgid "-mcpu={fr500|fr400|fr300|frv|simple|tomcat}\n" msgstr "" -#: config/tc-frv.c:434 +#: config/tc-frv.c:431 msgid " Record the cpu type\n" msgstr "" -#: config/tc-frv.c:435 +#: config/tc-frv.c:432 msgid "-mtomcat-stats Print out stats for tomcat workarounds\n" msgstr "" -#: config/tc-frv.c:436 +#: config/tc-frv.c:433 msgid "-mtomcat-debug Debug tomcat workarounds\n" msgstr "" -#: config/tc-frv.c:1003 +#: config/tc-frv.c:1012 msgid "VLIW packing used for -mno-pack" msgstr "" -#: config/tc-frv.c:1016 +#: config/tc-frv.c:1025 msgid "VLIW packing constraint violation" msgstr "" -#: config/tc-frv.c:1544 +#: config/tc-frv.c:1540 #, c-format msgid "Relocation %s is not safe for %s" msgstr "" -#: config/tc-h8300.c:64 config/tc-h8300.c:76 config/tc-h8300.c:143 -#: config/tc-hppa.c:1424 config/tc-hppa.c:6917 config/tc-hppa.c:6923 -#: config/tc-hppa.c:6929 config/tc-hppa.c:6935 config/tc-mn10300.c:907 -#: config/tc-mn10300.c:2171 +#: config/tc-h8300.c:84 config/tc-h8300.c:96 config/tc-h8300.c:109 +#: config/tc-h8300.c:122 config/tc-h8300.c:135 config/tc-h8300.c:149 +#: config/tc-h8300.c:222 config/tc-hppa.c:1423 config/tc-hppa.c:6909 +#: config/tc-hppa.c:6915 config/tc-hppa.c:6921 config/tc-hppa.c:6927 +#: config/tc-mn10300.c:1218 config/tc-mn10300.c:1223 config/tc-mn10300.c:2722 msgid "could not set architecture and machine" msgstr "" -#: config/tc-h8300.c:282 config/tc-h8300.c:290 +#: config/tc-h8300.c:436 config/tc-h8300.c:444 msgid "Reg not valid for H8/300" msgstr "" -#: config/tc-h8300.c:451 config/tc-h8300.c:454 config/tc-h8300.c:457 -#: config/tc-h8300.c:461 +#: config/tc-h8300.c:529 +msgid "invalid operand size requested" +msgstr "" + +#: config/tc-h8300.c:626 config/tc-h8300.c:629 msgid "Invalid register list for ldm/stm\n" msgstr "" -#: config/tc-h8300.c:516 config/tc-h8300.c:578 config/tc-h8300.c:585 +#: config/tc-h8300.c:632 +msgid "Invalid register list for ldm/stm)\n" +msgstr "" + +#: config/tc-h8300.c:658 config/tc-h8300.c:663 config/tc-h8300.c:670 +msgid "mismatch between register and suffix" +msgstr "" + +#: config/tc-h8300.c:697 +msgid "address too high for vector table jmp/jsr" +msgstr "" + +#: config/tc-h8300.c:722 config/tc-h8300.c:832 config/tc-h8300.c:840 msgid "Wrong size pointer register for architecture." msgstr "" -#: config/tc-h8300.c:543 config/tc-h8300.c:552 config/tc-h8300.c:562 +#: config/tc-h8300.c:781 config/tc-h8300.c:789 config/tc-h8300.c:818 msgid "expected @(exp, reg16)" msgstr "" -#: config/tc-h8300.c:640 -msgid "expect :8 or :16 here" +#: config/tc-h8300.c:807 +msgid "expected .L, .W or .B for register in indexed addressing mode" +msgstr "" + +#: config/tc-h8300.c:1000 +msgid "expected valid addressing mode for mova: \"@(disp, ea.sz),ERn\"" +msgstr "" + +#: config/tc-h8300.c:1018 config/tc-h8300.c:1027 +msgid "expected register" +msgstr "" + +#: config/tc-h8300.c:1043 +msgid "expected closing paren" +msgstr "" + +#: config/tc-h8300.c:1104 +#, c-format +msgid "can't use high part of register in operand %d" +msgstr "" + +#: config/tc-h8300.c:1268 +#, c-format +msgid "Opcode `%s' with these operand types not available in %s mode" +msgstr "" + +#: config/tc-h8300.c:1277 +msgid "mismatch between opcode size and operand size" msgstr "" -#: config/tc-h8300.c:847 +#: config/tc-h8300.c:1316 #, c-format msgid "operand %s0x%lx out of range." msgstr "" -#: config/tc-h8300.c:935 +#: config/tc-h8300.c:1415 msgid "Can't work out size of operand.\n" msgstr "" -#: config/tc-h8300.c:983 +#: config/tc-h8300.c:1466 #, c-format msgid "Opcode `%s' with these operand types not available in H8/300 mode" msgstr "" -#: config/tc-h8300.c:1029 config/tc-h8300.c:1049 +#: config/tc-h8300.c:1471 +#, c-format +msgid "Opcode `%s' with these operand types not available in H8/300H mode" +msgstr "" + +#: config/tc-h8300.c:1477 +#, c-format +msgid "Opcode `%s' with these operand types not available in H8/300S mode" +msgstr "" + +#: config/tc-h8300.c:1538 config/tc-h8300.c:1558 msgid "Need #1 or #2 here" msgstr "" -#: config/tc-h8300.c:1044 +#: config/tc-h8300.c:1553 msgid "#4 not valid on H8/300." msgstr "" -#: config/tc-h8300.c:1122 config/tc-h8300.c:1169 +#: config/tc-h8300.c:1645 config/tc-h8300.c:1727 #, c-format msgid "branch operand has odd offset (%lx)\n" msgstr "" -#: config/tc-h8300.c:1208 +#: config/tc-h8300.c:1766 msgid "destination operand must be 16 bit register" msgstr "" -#: config/tc-h8300.c:1217 +#: config/tc-h8300.c:1775 msgid "source operand must be 8 bit register" msgstr "" -#: config/tc-h8300.c:1225 +#: config/tc-h8300.c:1783 msgid "destination operand must be 16bit absolute address" msgstr "" -#: config/tc-h8300.c:1232 +#: config/tc-h8300.c:1790 msgid "destination operand must be 8 bit register" msgstr "" -#: config/tc-h8300.c:1240 +#: config/tc-h8300.c:1798 msgid "source operand must be 16bit absolute address" msgstr "" #. This seems more sane than saying "too many operands". We'll #. get here only if the trailing trash starts with a comma. -#: config/tc-h8300.c:1248 config/tc-mmix.c:459 config/tc-mmix.c:471 -#: config/tc-mmix.c:2502 config/tc-mmix.c:2526 config/tc-mmix.c:2803 -#: config/tc-or32.c:642 config/tc-or32.c:856 +#: config/tc-h8300.c:1806 config/tc-mmix.c:454 config/tc-mmix.c:466 +#: config/tc-mmix.c:2502 config/tc-mmix.c:2526 config/tc-mmix.c:2802 +#: config/tc-or32.c:640 config/tc-or32.c:854 msgid "invalid operands" msgstr "" -#: config/tc-h8300.c:1300 config/tc-h8500.c:1094 config/tc-mips.c:8915 -#: config/tc-sh.c:2371 config/tc-sh64.c:2811 config/tc-w65.c:733 -#: config/tc-z8k.c:1206 -msgid "unknown opcode" +#: config/tc-h8300.c:1839 +msgid "operand/size mis-match" msgstr "" -#: config/tc-h8300.c:1346 -msgid "mismatch between opcode size and operand size" +#: config/tc-h8300.c:1926 config/tc-h8500.c:1112 config/tc-mips.c:9302 +#: config/tc-sh.c:2363 config/tc-sh64.c:2837 config/tc-w65.c:691 +#: config/tc-z8k.c:1248 +msgid "unknown opcode" msgstr "" -#: config/tc-h8300.c:1358 config/tc-h8500.c:1121 config/tc-sh.c:2491 -#: config/tc-w65.c:763 config/tc-z8k.c:1262 +#: config/tc-h8300.c:2031 config/tc-h8500.c:1139 config/tc-sh.c:2483 +#: config/tc-z8k.c:1304 msgid "call to tc_crawl_symbol_chain \n" msgstr "" -#: config/tc-h8300.c:1374 config/tc-h8500.c:1135 config/tc-sh.c:2498 -#: config/tc-w65.c:777 config/tc-z8k.c:1276 +#: config/tc-h8300.c:2047 config/tc-h8500.c:1153 config/tc-sh.c:2490 +#: config/tc-z8k.c:1320 msgid "call to tc_headers_hook \n" msgstr "" -#: config/tc-h8300.c:1467 config/tc-h8500.c:1225 config/tc-z8k.c:1391 +#: config/tc-h8300.c:2140 msgid "call to tc_aout_fix_to_chars \n" msgstr "" -#: config/tc-h8300.c:1481 config/tc-z8k.c:1401 +#: config/tc-h8300.c:2154 msgid "call to md_convert_frag \n" msgstr "" -#: config/tc-h8300.c:1543 config/tc-z8k.c:1486 +#: config/tc-h8300.c:2216 msgid "call tomd_estimate_size_before_relax \n" msgstr "" -#: config/tc-h8300.c:1664 config/tc-mcore.c:2413 config/tc-pj.c:572 -#: config/tc-sh.c:3959 +#: config/tc-h8300.c:2337 config/tc-mcore.c:2355 config/tc-pj.c:581 +#: config/tc-sh.c:3956 #, c-format msgid "Cannot represent relocation type %s" msgstr "" -#: config/tc-h8500.c:323 +#: config/tc-h8500.c:325 msgid ":24 not valid for this opcode" msgstr "" -#: config/tc-h8500.c:330 +#: config/tc-h8500.c:332 msgid "expect :8,:16 or :24" msgstr "" -#: config/tc-h8500.c:387 +#: config/tc-h8500.c:391 msgid "syntax error in reg list" msgstr "" -#: config/tc-h8500.c:405 +#: config/tc-h8500.c:409 msgid "missing final register in range" msgstr "" -#: config/tc-h8500.c:492 config/tc-h8500.c:499 config/tc-h8500.c:505 +#: config/tc-h8500.c:498 config/tc-h8500.c:505 config/tc-h8500.c:511 msgid "expected @(exp, Rn)" msgstr "" -#: config/tc-h8500.c:521 +#: config/tc-h8500.c:527 msgid "@Rn+ needs word register" msgstr "" -#: config/tc-h8500.c:531 +#: config/tc-h8500.c:537 msgid "@Rn needs word register" msgstr "" -#: config/tc-h8500.c:828 config/tc-sh.c:1835 +#: config/tc-h8500.c:838 config/tc-sh.c:1827 #, c-format msgid "unhandled %d\n" msgstr "" -#: config/tc-h8500.c:856 +#: config/tc-h8500.c:868 #, c-format msgid "operand must be absolute in range %d..%d" msgstr "" -#: config/tc-h8500.c:945 config/tc-sh.c:2044 +#: config/tc-h8500.c:963 config/tc-sh.c:2036 #, c-format msgid "failed for %d\n" msgstr "" -#: config/tc-h8500.c:1110 config/tc-sh.c:2146 config/tc-sh.c:2420 -#: config/tc-w65.c:752 +#: config/tc-h8500.c:1128 config/tc-sh.c:2138 config/tc-sh.c:2412 +#: config/tc-w65.c:710 msgid "invalid operands for opcode" msgstr "" #. Simple range checking for FIELD againt HIGH and LOW bounds. #. IGNORE is used to suppress the error message. -#: config/tc-hppa.c:1157 config/tc-hppa.c:1171 +#: config/tc-hppa.c:1156 config/tc-hppa.c:1170 #, c-format msgid "Field out of range [%d..%d] (%d)." msgstr "" #. Simple alignment checking for FIELD againt ALIGN (a power of two). #. IGNORE is used to suppress the error message. -#: config/tc-hppa.c:1185 +#: config/tc-hppa.c:1184 #, c-format msgid "Field not properly aligned [%d] (%d)." msgstr "" -#: config/tc-hppa.c:1214 +#: config/tc-hppa.c:1213 msgid "Missing .exit\n" msgstr "" -#: config/tc-hppa.c:1217 +#: config/tc-hppa.c:1216 msgid "Missing .procend\n" msgstr "" -#: config/tc-hppa.c:1397 +#: config/tc-hppa.c:1396 #, c-format msgid "Invalid field selector. Assuming F%%." msgstr "" -#: config/tc-hppa.c:1430 +#: config/tc-hppa.c:1429 msgid "-R option not supported on this target." msgstr "" -#: config/tc-hppa.c:1446 config/tc-sparc.c:809 config/tc-sparc.c:845 +#: config/tc-hppa.c:1445 config/tc-sparc.c:809 config/tc-sparc.c:845 #, c-format msgid "Internal error: can't hash `%s': %s\n" msgstr "" -#: config/tc-hppa.c:1454 config/tc-i860.c:190 +#: config/tc-hppa.c:1453 config/tc-i860.c:201 #, c-format msgid "internal error: losing opcode: `%s' \"%s\"\n" msgstr "" -#: config/tc-hppa.c:1525 config/tc-hppa.c:7056 config/tc-hppa.c:7113 +#: config/tc-hppa.c:1524 config/tc-hppa.c:7048 config/tc-hppa.c:7105 msgid "Missing function name for .PROC (corrupted label chain)" msgstr "" -#: config/tc-hppa.c:1528 config/tc-hppa.c:7116 +#: config/tc-hppa.c:1527 config/tc-hppa.c:7108 msgid "Missing function name for .PROC" msgstr "" -#: config/tc-hppa.c:1635 config/tc-hppa.c:4913 +#: config/tc-hppa.c:1634 config/tc-hppa.c:4905 msgid "could not update architecture and machine" msgstr "" -#: config/tc-hppa.c:1843 +#: config/tc-hppa.c:1842 msgid "Invalid Indexed Load Completer." msgstr "" -#: config/tc-hppa.c:1848 +#: config/tc-hppa.c:1847 msgid "Invalid Indexed Load Completer Syntax." msgstr "" -#: config/tc-hppa.c:1885 +#: config/tc-hppa.c:1884 msgid "Invalid Short Load/Store Completer." msgstr "" -#: config/tc-hppa.c:1945 config/tc-hppa.c:1950 +#: config/tc-hppa.c:1944 config/tc-hppa.c:1949 msgid "Invalid Store Bytes Short Completer" msgstr "" -#: config/tc-hppa.c:2261 config/tc-hppa.c:2267 +#: config/tc-hppa.c:2260 config/tc-hppa.c:2266 msgid "Invalid left/right combination completer" msgstr "" -#: config/tc-hppa.c:2316 config/tc-hppa.c:2323 +#: config/tc-hppa.c:2315 config/tc-hppa.c:2322 msgid "Invalid permutation completer" msgstr "" -#: config/tc-hppa.c:2424 +#: config/tc-hppa.c:2423 #, c-format msgid "Invalid Add Condition: %s" msgstr "" -#: config/tc-hppa.c:2435 config/tc-hppa.c:2445 +#: config/tc-hppa.c:2434 config/tc-hppa.c:2444 msgid "Invalid Add and Branch Condition" msgstr "" -#: config/tc-hppa.c:2466 config/tc-hppa.c:2604 +#: config/tc-hppa.c:2465 config/tc-hppa.c:2603 msgid "Invalid Compare/Subtract Condition" msgstr "" -#: config/tc-hppa.c:2506 +#: config/tc-hppa.c:2505 #, c-format msgid "Invalid Bit Branch Condition: %c" msgstr "" -#: config/tc-hppa.c:2592 +#: config/tc-hppa.c:2591 #, c-format msgid "Invalid Compare/Subtract Condition: %s" msgstr "" -#: config/tc-hppa.c:2619 +#: config/tc-hppa.c:2618 msgid "Invalid Compare and Branch Condition" msgstr "" -#: config/tc-hppa.c:2715 +#: config/tc-hppa.c:2714 msgid "Invalid Logical Instruction Condition." msgstr "" -#: config/tc-hppa.c:2770 +#: config/tc-hppa.c:2769 msgid "Invalid Shift/Extract/Deposit Condition." msgstr "" -#: config/tc-hppa.c:2882 +#: config/tc-hppa.c:2881 msgid "Invalid Unit Instruction Condition." msgstr "" -#: config/tc-hppa.c:3259 config/tc-hppa.c:3291 config/tc-hppa.c:3322 -#: config/tc-hppa.c:3352 +#: config/tc-hppa.c:3258 config/tc-hppa.c:3290 config/tc-hppa.c:3321 +#: config/tc-hppa.c:3351 msgid "Branch to unaligned address" msgstr "" -#: config/tc-hppa.c:3530 +#: config/tc-hppa.c:3529 msgid "Invalid SFU identifier" msgstr "" -#: config/tc-hppa.c:3580 +#: config/tc-hppa.c:3579 msgid "Invalid COPR identifier" msgstr "" -#: config/tc-hppa.c:3709 +#: config/tc-hppa.c:3708 msgid "Invalid Floating Point Operand Format." msgstr "" -#: config/tc-hppa.c:3826 config/tc-hppa.c:3846 config/tc-hppa.c:3866 -#: config/tc-hppa.c:3886 config/tc-hppa.c:3906 +#: config/tc-hppa.c:3825 config/tc-hppa.c:3845 config/tc-hppa.c:3865 +#: config/tc-hppa.c:3885 config/tc-hppa.c:3905 msgid "Invalid register for single precision fmpyadd or fmpysub" msgstr "" -#: config/tc-hppa.c:3963 +#: config/tc-hppa.c:3962 #, c-format msgid "Invalid operands %s" msgstr "" -#: config/tc-hppa.c:4081 +#: config/tc-hppa.c:4080 msgid "Cannot handle fixup" msgstr "" -#: config/tc-hppa.c:4382 +#: config/tc-hppa.c:4381 msgid " -Q ignored\n" msgstr "" -#: config/tc-hppa.c:4386 +#: config/tc-hppa.c:4385 msgid " -c print a warning if a comment is found\n" msgstr "" -#: config/tc-hppa.c:4457 +#: config/tc-hppa.c:4456 #, c-format msgid "no hppa_fixup entry for fixup type 0x%x" msgstr "" -#: config/tc-hppa.c:4635 +#: config/tc-hppa.c:4627 msgid "Unknown relocation encountered in md_apply_fix." msgstr "" -#: config/tc-hppa.c:4777 config/tc-hppa.c:4802 +#: config/tc-hppa.c:4769 config/tc-hppa.c:4794 #, c-format msgid "Undefined register: '%s'." msgstr "" -#: config/tc-hppa.c:4836 +#: config/tc-hppa.c:4828 #, c-format msgid "Non-absolute symbol: '%s'." msgstr "" -#: config/tc-hppa.c:4851 +#: config/tc-hppa.c:4843 #, c-format msgid "Undefined absolute constant: '%s'." msgstr "" -#: config/tc-hppa.c:4952 +#: config/tc-hppa.c:4944 #, c-format msgid "Invalid FP Compare Condition: %s" msgstr "" -#: config/tc-hppa.c:5008 +#: config/tc-hppa.c:5000 #, c-format msgid "Invalid FTEST completer: %s" msgstr "" -#: config/tc-hppa.c:5075 config/tc-hppa.c:5113 +#: config/tc-hppa.c:5067 config/tc-hppa.c:5105 #, c-format msgid "Invalid FP Operand Format: %3s" msgstr "" -#: config/tc-hppa.c:5192 +#: config/tc-hppa.c:5184 msgid "Bad segment in expression." msgstr "" -#: config/tc-hppa.c:5251 +#: config/tc-hppa.c:5243 msgid "Bad segment (should be absolute)." msgstr "" -#: config/tc-hppa.c:5294 +#: config/tc-hppa.c:5286 #, c-format msgid "Invalid argument location: %s\n" msgstr "" -#: config/tc-hppa.c:5325 +#: config/tc-hppa.c:5317 #, c-format msgid "Invalid argument description: %d" msgstr "" -#: config/tc-hppa.c:5348 +#: config/tc-hppa.c:5340 #, c-format msgid "Invalid Nullification: (%c)" msgstr "" -#: config/tc-hppa.c:6068 +#: config/tc-hppa.c:6060 #, c-format msgid "Invalid .CALL argument: %s" msgstr "" -#: config/tc-hppa.c:6190 +#: config/tc-hppa.c:6182 msgid ".callinfo is not within a procedure definition" msgstr "" -#: config/tc-hppa.c:6210 +#: config/tc-hppa.c:6202 #, c-format msgid "FRAME parameter must be a multiple of 8: %d\n" msgstr "" -#: config/tc-hppa.c:6229 +#: config/tc-hppa.c:6221 msgid "Value for ENTRY_GR must be in the range 3..18\n" msgstr "" -#: config/tc-hppa.c:6241 +#: config/tc-hppa.c:6233 msgid "Value for ENTRY_FR must be in the range 12..21\n" msgstr "" -#: config/tc-hppa.c:6251 +#: config/tc-hppa.c:6243 msgid "Value for ENTRY_SR must be 3\n" msgstr "" -#: config/tc-hppa.c:6307 +#: config/tc-hppa.c:6299 #, c-format msgid "Invalid .CALLINFO argument: %s" msgstr "" -#: config/tc-hppa.c:6418 +#: config/tc-hppa.c:6410 msgid "The .ENTER pseudo-op is not supported" msgstr "" -#: config/tc-hppa.c:6434 +#: config/tc-hppa.c:6426 msgid "Misplaced .entry. Ignored." msgstr "" -#: config/tc-hppa.c:6438 +#: config/tc-hppa.c:6430 msgid "Missing .callinfo." msgstr "" -#: config/tc-hppa.c:6504 +#: config/tc-hppa.c:6496 msgid ".REG expression must be a register" msgstr "" -#: config/tc-hppa.c:6520 +#: config/tc-hppa.c:6512 msgid "bad or irreducible absolute expression; zero assumed" msgstr "" -#: config/tc-hppa.c:6531 +#: config/tc-hppa.c:6523 msgid ".REG must use a label" msgstr "" -#: config/tc-hppa.c:6533 +#: config/tc-hppa.c:6525 msgid ".EQU must use a label" msgstr "" -#: config/tc-hppa.c:6586 +#: config/tc-hppa.c:6578 msgid ".EXIT must appear within a procedure" msgstr "" -#: config/tc-hppa.c:6590 +#: config/tc-hppa.c:6582 msgid "Missing .callinfo" msgstr "" -#: config/tc-hppa.c:6594 +#: config/tc-hppa.c:6586 msgid "No .ENTRY for this .EXIT" msgstr "" -#: config/tc-hppa.c:6621 +#: config/tc-hppa.c:6613 #, c-format msgid "Cannot define export symbol: %s\n" msgstr "" -#: config/tc-hppa.c:6679 +#: config/tc-hppa.c:6671 #, c-format msgid "Using ENTRY rather than CODE in export directive for %s" msgstr "" -#: config/tc-hppa.c:6796 +#: config/tc-hppa.c:6788 #, c-format msgid "Undefined .EXPORT/.IMPORT argument (ignored): %s" msgstr "" -#: config/tc-hppa.c:6878 +#: config/tc-hppa.c:6870 msgid "Missing label name on .LABEL" msgstr "" -#: config/tc-hppa.c:6883 +#: config/tc-hppa.c:6875 msgid "extra .LABEL arguments ignored." msgstr "" -#: config/tc-hppa.c:6900 +#: config/tc-hppa.c:6892 msgid "The .LEAVE pseudo-op is not supported" msgstr "" -#: config/tc-hppa.c:6939 +#: config/tc-hppa.c:6931 msgid "Unrecognized .LEVEL argument\n" msgstr "" -#: config/tc-hppa.c:6975 +#: config/tc-hppa.c:6967 #, c-format msgid "Cannot define static symbol: %s\n" msgstr "" -#: config/tc-hppa.c:7010 +#: config/tc-hppa.c:7002 msgid "Nested procedures" msgstr "" -#: config/tc-hppa.c:7020 +#: config/tc-hppa.c:7012 msgid "Cannot allocate unwind descriptor\n" msgstr "" -#: config/tc-hppa.c:7120 +#: config/tc-hppa.c:7112 msgid "misplaced .procend" msgstr "" -#: config/tc-hppa.c:7123 +#: config/tc-hppa.c:7115 msgid "Missing .callinfo for this procedure" msgstr "" -#: config/tc-hppa.c:7126 +#: config/tc-hppa.c:7118 msgid "Missing .EXIT for a .ENTRY" msgstr "" -#: config/tc-hppa.c:7164 +#: config/tc-hppa.c:7156 msgid "Not in a space.\n" msgstr "" -#: config/tc-hppa.c:7167 +#: config/tc-hppa.c:7159 msgid "Not in a subspace.\n" msgstr "" -#: config/tc-hppa.c:7258 +#: config/tc-hppa.c:7250 msgid "Invalid .SPACE argument" msgstr "" -#: config/tc-hppa.c:7305 +#: config/tc-hppa.c:7297 msgid "Can't change spaces within a procedure definition. Ignored" msgstr "" -#: config/tc-hppa.c:7434 +#: config/tc-hppa.c:7426 #, c-format msgid "Undefined space: '%s' Assuming space number = 0." msgstr "" -#: config/tc-hppa.c:7458 +#: config/tc-hppa.c:7450 msgid "Must be in a space before changing or declaring subspaces.\n" msgstr "" -#: config/tc-hppa.c:7462 +#: config/tc-hppa.c:7454 msgid "Can't change subspaces within a procedure definition. Ignored" msgstr "" -#: config/tc-hppa.c:7497 +#: config/tc-hppa.c:7489 msgid "Parameters of an existing subspace can't be modified" msgstr "" -#: config/tc-hppa.c:7548 +#: config/tc-hppa.c:7540 msgid "Alignment must be a power of 2" msgstr "" -#: config/tc-hppa.c:7590 +#: config/tc-hppa.c:7582 msgid "FIRST not supported as a .SUBSPACE argument" msgstr "" -#: config/tc-hppa.c:7592 +#: config/tc-hppa.c:7584 msgid "Invalid .SUBSPACE argument" msgstr "" -#: config/tc-hppa.c:7772 +#: config/tc-hppa.c:7764 #, c-format msgid "Internal error: Unable to find containing space for %s." msgstr "" -#: config/tc-hppa.c:7811 +#: config/tc-hppa.c:7803 #, c-format msgid "Out of memory: could not allocate new space chain entry: %s\n" msgstr "" -#: config/tc-hppa.c:7897 +#: config/tc-hppa.c:7889 #, c-format msgid "Out of memory: could not allocate new subspace chain entry: %s\n" msgstr "" -#: config/tc-hppa.c:8638 +#: config/tc-hppa.c:8622 #, c-format msgid "Symbol '%s' could not be created." msgstr "" -#: config/tc-hppa.c:8642 +#: config/tc-hppa.c:8626 msgid "No memory for symbol name." msgstr "" -#: config/tc-i386.c:660 +#: config/tc-i386.c:689 #, c-format msgid "%s shortened to %s" msgstr "" -#: config/tc-i386.c:716 +#: config/tc-i386.c:745 msgid "same type of prefix used twice" msgstr "" -#: config/tc-i386.c:734 +#: config/tc-i386.c:763 msgid "64bit mode not supported on this CPU." msgstr "" -#: config/tc-i386.c:738 +#: config/tc-i386.c:767 msgid "32bit mode not supported on this CPU." msgstr "" -#: config/tc-i386.c:771 +#: config/tc-i386.c:800 msgid "bad argument to syntax directive." msgstr "" -#: config/tc-i386.c:815 +#: config/tc-i386.c:844 #, c-format msgid "no such architecture: `%s'" msgstr "" -#: config/tc-i386.c:820 +#: config/tc-i386.c:849 msgid "missing cpu architecture" msgstr "" -#: config/tc-i386.c:834 +#: config/tc-i386.c:863 #, c-format msgid "no such architecture modifier: `%s'" msgstr "" -#: config/tc-i386.c:851 config/tc-i386.c:4944 +#: config/tc-i386.c:880 config/tc-i386.c:5022 msgid "Unknown architecture" msgstr "" -#: config/tc-i386.c:886 config/tc-i386.c:909 config/tc-m68k.c:3830 +#: config/tc-i386.c:915 config/tc-i386.c:938 config/tc-m68k.c:3816 #, c-format msgid "Internal Error: Can't hash %s: %s" msgstr "" -#: config/tc-i386.c:1152 +#: config/tc-i386.c:1192 msgid "There are no unsigned pc-relative relocations" msgstr "" -#: config/tc-i386.c:1159 config/tc-i386.c:5151 +#: config/tc-i386.c:1199 config/tc-i386.c:5234 #, c-format msgid "can not do %d byte pc-relative relocation" msgstr "" -#: config/tc-i386.c:1176 +#: config/tc-i386.c:1216 #, c-format msgid "can not do %s %d byte relocation" msgstr "" +#: config/tc-i386.c:1428 +#, c-format +msgid "can't use register '%%%s' as operand %d in '%s'." +msgstr "" + #. UnixWare fsub no args is alias for fsubp, fadd -> faddp, etc. -#: config/tc-i386.c:1396 +#: config/tc-i386.c:1457 #, c-format msgid "translating to `%sp'" msgstr "" -#: config/tc-i386.c:1441 +#: config/tc-i386.c:1502 #, c-format msgid "can't encode register '%%%s' in an instruction requiring REX prefix.\n" msgstr "" -#: config/tc-i386.c:1480 config/tc-i386.c:1575 +#: config/tc-i386.c:1541 config/tc-i386.c:1636 #, c-format msgid "no such instruction: `%s'" msgstr "" -#: config/tc-i386.c:1490 config/tc-i386.c:1607 +#: config/tc-i386.c:1551 config/tc-i386.c:1668 #, c-format msgid "invalid character %s in mnemonic" msgstr "" -#: config/tc-i386.c:1497 +#: config/tc-i386.c:1558 msgid "expecting prefix; got nothing" msgstr "" -#: config/tc-i386.c:1499 +#: config/tc-i386.c:1560 msgid "expecting mnemonic; got nothing" msgstr "" -#: config/tc-i386.c:1518 +#: config/tc-i386.c:1579 #, c-format msgid "redundant %s prefix" msgstr "" -#: config/tc-i386.c:1616 +#: config/tc-i386.c:1677 #, c-format msgid "`%s' is not supported on `%s'" msgstr "" -#: config/tc-i386.c:1621 +#: config/tc-i386.c:1682 msgid "use .code16 to ensure correct addressing mode" msgstr "" -#: config/tc-i386.c:1628 +#: config/tc-i386.c:1689 #, c-format msgid "expecting string instruction after `%s'" msgstr "" -#: config/tc-i386.c:1656 +#: config/tc-i386.c:1717 #, c-format msgid "invalid character %s before operand %d" msgstr "" -#: config/tc-i386.c:1670 +#: config/tc-i386.c:1731 #, c-format msgid "unbalanced parenthesis in operand %d." msgstr "" -#: config/tc-i386.c:1673 +#: config/tc-i386.c:1734 #, c-format msgid "unbalanced brackets in operand %d." msgstr "" -#: config/tc-i386.c:1682 +#: config/tc-i386.c:1743 #, c-format msgid "invalid character %s in operand %d" msgstr "" -#: config/tc-i386.c:1709 +#: config/tc-i386.c:1770 #, c-format msgid "spurious operands; (%d operands/instruction max)" msgstr "" -#: config/tc-i386.c:1732 +#: config/tc-i386.c:1793 msgid "expecting operand after ','; got nothing" msgstr "" -#: config/tc-i386.c:1737 +#: config/tc-i386.c:1798 msgid "expecting operand before ','; got nothing" msgstr "" #. We found no match. -#: config/tc-i386.c:2079 +#: config/tc-i386.c:2140 #, c-format msgid "suffix or operands invalid for `%s'" msgstr "" -#: config/tc-i386.c:2090 +#: config/tc-i386.c:2151 #, c-format msgid "indirect %s without `*'" msgstr "" #. Warn them that a data or address size prefix doesn't #. affect assembly of the next line of code. -#: config/tc-i386.c:2098 +#: config/tc-i386.c:2159 #, c-format msgid "stand-alone `%s' prefix" msgstr "" -#: config/tc-i386.c:2127 config/tc-i386.c:2142 +#: config/tc-i386.c:2188 config/tc-i386.c:2203 #, c-format msgid "`%s' operand %d must use `%%es' segment" msgstr "" -#: config/tc-i386.c:2222 +#: config/tc-i386.c:2283 msgid "" "no instruction mnemonic suffix given and no register operands; can't size " "instruction" @@ -4139,404 +4311,400 @@ msgstr "" #. Prohibit these changes in the 64bit mode, since the #. lowering is more complicated. -#: config/tc-i386.c:2306 config/tc-i386.c:2365 config/tc-i386.c:2382 -#: config/tc-i386.c:2414 config/tc-i386.c:2447 +#: config/tc-i386.c:2367 config/tc-i386.c:2426 config/tc-i386.c:2443 +#: config/tc-i386.c:2475 config/tc-i386.c:2508 #, c-format msgid "Incorrect register `%%%s' used with `%c' suffix" msgstr "" -#: config/tc-i386.c:2314 config/tc-i386.c:2372 config/tc-i386.c:2454 +#: config/tc-i386.c:2375 config/tc-i386.c:2433 config/tc-i386.c:2515 #, c-format msgid "using `%%%s' instead of `%%%s' due to `%c' suffix" msgstr "" -#: config/tc-i386.c:2329 config/tc-i386.c:2350 config/tc-i386.c:2401 -#: config/tc-i386.c:2432 +#: config/tc-i386.c:2390 config/tc-i386.c:2411 config/tc-i386.c:2462 +#: config/tc-i386.c:2493 #, c-format msgid "`%%%s' not allowed with `%s%c'" msgstr "" -#: config/tc-i386.c:2495 +#: config/tc-i386.c:2556 msgid "no instruction mnemonic suffix given; can't determine immediate size" msgstr "" -#: config/tc-i386.c:2528 +#: config/tc-i386.c:2589 #, c-format msgid "" "no instruction mnemonic suffix given; can't determine immediate size %x %c" msgstr "" #. Reversed arguments on faddp, fsubp, etc. -#: config/tc-i386.c:2577 +#: config/tc-i386.c:2638 #, c-format msgid "translating to `%s %%%s,%%%s'" msgstr "" #. Extraneous `l' suffix on fp insn. -#: config/tc-i386.c:2584 +#: config/tc-i386.c:2645 #, c-format msgid "translating to `%s %%%s'" msgstr "" -#: config/tc-i386.c:2602 +#: config/tc-i386.c:2663 #, c-format msgid "you can't `pop %%cs'" msgstr "" #. lea -#: config/tc-i386.c:2621 +#: config/tc-i386.c:2682 msgid "segment override on `lea' is ineffectual" msgstr "" -#: config/tc-i386.c:2930 config/tc-i386.c:3024 config/tc-i386.c:3069 +#: config/tc-i386.c:2991 config/tc-i386.c:3085 config/tc-i386.c:3130 msgid "skipping prefixes on this instruction" msgstr "" -#: config/tc-i386.c:3089 +#: config/tc-i386.c:3150 msgid "16-bit jump out of range" msgstr "" -#: config/tc-i386.c:3098 +#: config/tc-i386.c:3159 #, c-format msgid "can't handle non absolute segment in `%s'" msgstr "" -#: config/tc-i386.c:3539 +#: config/tc-i386.c:3601 #, c-format msgid "@%s reloc is not supported in %s bit mode" msgstr "" -#: config/tc-i386.c:3615 +#: config/tc-i386.c:3677 msgid "only 1 or 2 immediate operands are allowed" msgstr "" -#: config/tc-i386.c:3638 config/tc-i386.c:3830 +#: config/tc-i386.c:3700 config/tc-i386.c:3892 #, c-format msgid "junk `%s' after expression" msgstr "" #. Missing or bad expr becomes absolute 0. -#: config/tc-i386.c:3649 +#: config/tc-i386.c:3711 #, c-format msgid "missing or invalid immediate expression `%s' taken as 0" msgstr "" -#: config/tc-i386.c:3681 config/tc-i386.c:3896 +#: config/tc-i386.c:3743 config/tc-i386.c:3958 #, c-format msgid "unimplemented segment %s in operand" msgstr "" -#: config/tc-i386.c:3683 config/tc-i386.c:3898 +#: config/tc-i386.c:3745 config/tc-i386.c:3960 #, c-format msgid "unimplemented segment type %d in operand" msgstr "" -#: config/tc-i386.c:3727 config/tc-i386.c:5925 +#: config/tc-i386.c:3789 config/tc-i386.c:6011 #, c-format msgid "expecting scale factor of 1, 2, 4, or 8: got `%s'" msgstr "" -#: config/tc-i386.c:3734 +#: config/tc-i386.c:3796 #, c-format msgid "scale factor of %d without an index register" msgstr "" -#: config/tc-i386.c:3850 +#: config/tc-i386.c:3912 #, c-format msgid "bad expression used with @%s" msgstr "" #. Missing or bad expr becomes absolute 0. -#: config/tc-i386.c:3872 +#: config/tc-i386.c:3934 #, c-format msgid "missing or invalid displacement expression `%s' taken as 0" msgstr "" -#: config/tc-i386.c:3996 +#: config/tc-i386.c:4058 #, c-format msgid "`%s' is not a valid base/index expression" msgstr "" -#: config/tc-i386.c:4000 +#: config/tc-i386.c:4062 #, c-format msgid "`%s' is not a valid %s bit base/index expression" msgstr "" -#: config/tc-i386.c:4075 +#: config/tc-i386.c:4137 #, c-format msgid "bad memory operand `%s'" msgstr "" -#: config/tc-i386.c:4090 +#: config/tc-i386.c:4152 #, c-format msgid "junk `%s' after register" msgstr "" -#: config/tc-i386.c:4099 config/tc-i386.c:4214 config/tc-i386.c:4252 +#: config/tc-i386.c:4161 config/tc-i386.c:4276 config/tc-i386.c:4314 #, c-format msgid "bad register name `%s'" msgstr "" -#: config/tc-i386.c:4107 +#: config/tc-i386.c:4169 msgid "immediate operand illegal with absolute jump" msgstr "" -#: config/tc-i386.c:4129 +#: config/tc-i386.c:4191 #, c-format msgid "too many memory references for `%s'" msgstr "" -#: config/tc-i386.c:4207 +#: config/tc-i386.c:4269 #, c-format msgid "expecting `,' or `)' after index register in `%s'" msgstr "" -#: config/tc-i386.c:4231 +#: config/tc-i386.c:4293 #, c-format msgid "expecting `)' after scale factor in `%s'" msgstr "" -#: config/tc-i386.c:4238 +#: config/tc-i386.c:4300 #, c-format msgid "expecting index register or scale factor after `,'; got '%c'" msgstr "" -#: config/tc-i386.c:4245 +#: config/tc-i386.c:4307 #, c-format msgid "expecting `,' or `)' after base register in `%s'" msgstr "" #. It's not a memory operand; argh! -#: config/tc-i386.c:4286 +#: config/tc-i386.c:4348 #, c-format msgid "invalid char %s beginning operand %d `%s'" msgstr "" -#: config/tc-i386.c:4469 +#: config/tc-i386.c:4531 msgid "long jump required" msgstr "" -#: config/tc-i386.c:4733 +#: config/tc-i386.c:4805 msgid "Bad call to md_atof ()" msgstr "" -#: config/tc-i386.c:4897 +#: config/tc-i386.c:4973 msgid "No compiled in support for x86_64" msgstr "" -#: config/tc-i386.c:4918 +#: config/tc-i386.c:4994 msgid "" " -Q ignored\n" " -V print assembler version number\n" " -k ignored\n" +" -n Do not optimize code alignment\n" " -q quieten some warnings\n" " -s ignored\n" msgstr "" -#: config/tc-i386.c:4925 -msgid " -q quieten some warnings\n" +#: config/tc-i386.c:5002 +msgid "" +" -n Do not optimize code alignment\n" +" -q quieten some warnings\n" msgstr "" -#: config/tc-i386.c:5026 config/tc-s390.c:1601 +#: config/tc-i386.c:5104 config/tc-s390.c:1841 msgid "GOT already in symbol table" msgstr "" -#: config/tc-i386.c:5166 +#: config/tc-i386.c:5249 #, c-format msgid "can not do %d byte relocation" msgstr "" -#: config/tc-i386.c:5231 config/tc-s390.c:1969 +#: config/tc-i386.c:5317 config/tc-s390.c:2285 #, c-format msgid "cannot represent relocation type %s" msgstr "" -#: config/tc-i386.c:5527 +#: config/tc-i386.c:5613 #, c-format msgid "too many memory references for '%s'" msgstr "" -#: config/tc-i386.c:5690 +#: config/tc-i386.c:5776 #, c-format msgid "Unknown operand modifier `%s'\n" msgstr "" -#: config/tc-i386.c:5897 +#: config/tc-i386.c:5983 #, c-format msgid "`%s' is not a valid segment register" msgstr "" -#: config/tc-i386.c:5907 config/tc-i386.c:6028 +#: config/tc-i386.c:5993 config/tc-i386.c:6114 msgid "Register scaling only allowed in memory operands." msgstr "" -#: config/tc-i386.c:5938 +#: config/tc-i386.c:6024 msgid "Too many register references in memory operand.\n" msgstr "" -#: config/tc-i386.c:6007 +#: config/tc-i386.c:6093 #, c-format msgid "Syntax error. Expecting a constant. Got `%s'.\n" msgstr "" -#: config/tc-i386.c:6077 +#: config/tc-i386.c:6163 #, c-format msgid "Unrecognized token '%s'" msgstr "" -#: config/tc-i386.c:6094 +#: config/tc-i386.c:6180 #, c-format msgid "Unexpected token `%s'\n" msgstr "" -#: config/tc-i386.c:6238 +#: config/tc-i386.c:6324 #, c-format msgid "Unrecognized token `%s'\n" msgstr "" -#: config/tc-i860.c:154 config/tc-i860.c:158 +#: config/tc-i860.c:165 config/tc-i860.c:169 msgid "Unknown temporary pseudo register" msgstr "" -#: config/tc-i860.c:181 config/tc-mips.c:1074 +#: config/tc-i860.c:192 config/tc-mips.c:1105 #, c-format msgid "internal error: can't hash `%s': %s\n" msgstr "" -#: config/tc-i860.c:201 +#: config/tc-i860.c:212 msgid "Defective assembler. No assembly attempted." msgstr "" -#: config/tc-i860.c:347 +#: config/tc-i860.c:362 #, c-format msgid "Expanded opcode after delayed branch: `%s'" msgstr "" -#: config/tc-i860.c:351 +#: config/tc-i860.c:366 #, c-format msgid "Expanded opcode in dual mode: `%s'" msgstr "" -#: config/tc-i860.c:355 +#: config/tc-i860.c:370 #, c-format msgid "An instruction was expanded (%s)" msgstr "" -#: config/tc-i860.c:613 +#: config/tc-i860.c:643 msgid "Pipelined instruction: fsrc1 = fdest" msgstr "" -#: config/tc-i860.c:776 config/tc-i860.c:783 config/tc-i860.c:790 +#: config/tc-i860.c:844 config/tc-i860.c:851 config/tc-i860.c:858 msgid "Assembler does not yet support PIC" msgstr "" -#: config/tc-i860.c:849 +#: config/tc-i860.c:919 #, c-format msgid "Illegal operands for %s" msgstr "" -#: config/tc-i860.c:873 config/tc-sparc.c:2737 +#: config/tc-i860.c:947 config/tc-sparc.c:2834 msgid "bad segment" msgstr "" -#: config/tc-i860.c:965 -msgid "md_number_to_disp\n" -msgstr "" - -#: config/tc-i860.c:975 -msgid "i860_number_to_field\n" -msgstr "" - -#: config/tc-i860.c:984 +#: config/tc-i860.c:1037 msgid "i860_estimate_size_before_relax\n" msgstr "" -#: config/tc-i860.c:1075 +#: config/tc-i860.c:1134 msgid "" " -EL\t\t\t generate code for little endian mode (default)\n" " -EB\t\t\t generate code for big endian mode\n" " -mwarn-expand\t\t warn if pseudo operations are expanded\n" +" -mxp\t\t\t enable i860XP support (disabled by default)\n" msgstr "" #. SVR4 compatibility flags. -#: config/tc-i860.c:1081 +#: config/tc-i860.c:1141 msgid "" " -V\t\t\t print assembler version number\n" " -Qy, -Qn\t\t ignored\n" msgstr "" -#: config/tc-i860.c:1150 +#: config/tc-i860.c:1210 msgid "This immediate requires 0 MOD 2 alignment" msgstr "" -#: config/tc-i860.c:1153 +#: config/tc-i860.c:1213 msgid "This immediate requires 0 MOD 4 alignment" msgstr "" -#: config/tc-i860.c:1156 +#: config/tc-i860.c:1216 msgid "This immediate requires 0 MOD 8 alignment" msgstr "" -#: config/tc-i860.c:1159 +#: config/tc-i860.c:1219 msgid "This immediate requires 0 MOD 16 alignment" msgstr "" -#: config/tc-i860.c:1257 +#: config/tc-i860.c:1317 msgid "5-bit immediate too large" msgstr "" -#: config/tc-i860.c:1260 +#: config/tc-i860.c:1320 msgid "5-bit field must be absolute" msgstr "" -#: config/tc-i860.c:1305 config/tc-i860.c:1328 +#: config/tc-i860.c:1365 config/tc-i860.c:1388 msgid "A branch offset requires 0 MOD 4 alignment" msgstr "" -#: config/tc-i860.c:1349 +#: config/tc-i860.c:1409 #, c-format -msgid "Unrecognized fix-up (0x%08x)" +msgid "Unrecognized fix-up (0x%08lx)" msgstr "" #: config/tc-i860.h:80 msgid "i860_convert_frag\n" msgstr "" -#: config/tc-i960.c:550 +#: config/tc-i960.c:574 #, c-format msgid "Hashing returned \"%s\"." msgstr "" #. Offset of last character in opcode mnemonic -#: config/tc-i960.c:584 +#: config/tc-i960.c:608 msgid "branch prediction invalid on this opcode" msgstr "" -#: config/tc-i960.c:624 +#: config/tc-i960.c:648 #, c-format msgid "invalid opcode, \"%s\"." msgstr "" -#: config/tc-i960.c:629 +#: config/tc-i960.c:653 #, c-format msgid "improper number of operands. expecting %d, got %d" msgstr "" -#: config/tc-i960.c:861 +#: config/tc-i960.c:877 #, c-format msgid "Fixup of %ld too large for field width of %d" msgstr "" -#: config/tc-i960.c:978 +#: config/tc-i960.c:994 #, c-format msgid "invalid architecture %s" msgstr "" -#: config/tc-i960.c:998 +#: config/tc-i960.c:1014 msgid "I960 options:\n" msgstr "" -#: config/tc-i960.c:1001 +#: config/tc-i960.c:1017 msgid "" "\n" "\t\t\tspecify variant of 960 architecture\n" @@ -4547,208 +4715,208 @@ msgid "" "\t\t\tlong displacements\n" msgstr "" -#: config/tc-i960.c:1405 +#: config/tc-i960.c:1419 config/tc-xtensa.c:8604 msgid "too many operands" msgstr "" -#: config/tc-i960.c:1464 config/tc-i960.c:1691 +#: config/tc-i960.c:1477 config/tc-i960.c:1702 msgid "expression syntax error" msgstr "" -#: config/tc-i960.c:1502 +#: config/tc-i960.c:1515 msgid "attempt to branch into different segment" msgstr "" -#: config/tc-i960.c:1506 +#: config/tc-i960.c:1519 #, c-format msgid "target of %s instruction must be a label" msgstr "" -#: config/tc-i960.c:1545 +#: config/tc-i960.c:1557 msgid "unmatched '['" msgstr "" -#: config/tc-i960.c:1556 +#: config/tc-i960.c:1568 msgid "garbage after index spec ignored" msgstr "" #. We never moved: there was no opcode either! -#: config/tc-i960.c:1622 +#: config/tc-i960.c:1633 msgid "missing opcode" msgstr "" -#: config/tc-i960.c:2037 +#: config/tc-i960.c:2046 msgid "invalid index register" msgstr "" -#: config/tc-i960.c:2060 +#: config/tc-i960.c:2069 msgid "invalid scale factor" msgstr "" -#: config/tc-i960.c:2243 +#: config/tc-i960.c:2250 msgid "unaligned register" msgstr "" -#: config/tc-i960.c:2266 +#: config/tc-i960.c:2273 msgid "no such sfr in this architecture" msgstr "" -#: config/tc-i960.c:2304 +#: config/tc-i960.c:2311 msgid "illegal literal" msgstr "" #. Should not happen: see block comment above -#: config/tc-i960.c:2534 +#: config/tc-i960.c:2539 #, c-format msgid "Trying to 'bal' to %s" msgstr "" -#: config/tc-i960.c:2545 +#: config/tc-i960.c:2550 msgid "Looks like a proc, but can't tell what kind.\n" msgstr "" -#: config/tc-i960.c:2576 +#: config/tc-i960.c:2582 msgid "should have 1 or 2 operands" msgstr "" -#: config/tc-i960.c:2585 config/tc-i960.c:2604 +#: config/tc-i960.c:2591 config/tc-i960.c:2610 #, c-format msgid "Redefining leafproc %s" msgstr "" -#: config/tc-i960.c:2635 +#: config/tc-i960.c:2641 msgid "should have two operands" msgstr "" -#: config/tc-i960.c:2645 +#: config/tc-i960.c:2651 msgid "'entry_num' must be absolute number in [0,31]" msgstr "" -#: config/tc-i960.c:2654 +#: config/tc-i960.c:2660 #, c-format msgid "Redefining entrynum for sysproc %s" msgstr "" -#: config/tc-i960.c:2761 +#: config/tc-i960.c:2764 msgid "architecture of opcode conflicts with that of earlier instruction(s)" msgstr "" -#: config/tc-i960.c:2782 +#: config/tc-i960.c:2785 msgid "big endian mode is not supported" msgstr "" -#: config/tc-i960.c:2784 +#: config/tc-i960.c:2787 #, c-format msgid "ignoring unrecognized .endian type `%s'" msgstr "" -#: config/tc-i960.c:3056 +#: config/tc-i960.c:3071 #, c-format msgid "leafproc symbol '%s' undefined" msgstr "" -#: config/tc-i960.c:3066 +#: config/tc-i960.c:3081 #, c-format msgid "Warning: making leafproc entries %s and %s both global\n" msgstr "" -#: config/tc-i960.c:3175 +#: config/tc-i960.c:3190 msgid "option --link-relax is only supported in b.out format" msgstr "" -#: config/tc-i960.c:3218 write.c:2664 -msgid "callj to difference of two symbols" +#: config/tc-ia64.c:982 +msgid "Bad .section directive: want a,o,s,w,x,M,S,G,T in string" msgstr "" -#: config/tc-ia64.c:1078 +#: config/tc-ia64.c:1105 msgid "Unwind directive not followed by an instruction." msgstr "" -#: config/tc-ia64.c:4512 +#: config/tc-ia64.c:4563 msgid "Register name expected" msgstr "" -#: config/tc-ia64.c:4517 config/tc-ia64.c:4803 +#: config/tc-ia64.c:4568 config/tc-ia64.c:4854 msgid "Comma expected" msgstr "" -#: config/tc-ia64.c:4525 +#: config/tc-ia64.c:4576 msgid "Register value annotation ignored" msgstr "" -#: config/tc-ia64.c:4549 +#: config/tc-ia64.c:4600 msgid "Directive invalid within a bundle" msgstr "" -#: config/tc-ia64.c:4616 +#: config/tc-ia64.c:4667 msgid "Missing predicate relation type" msgstr "" -#: config/tc-ia64.c:4632 +#: config/tc-ia64.c:4683 msgid "Unrecognized predicate relation type" msgstr "" -#: config/tc-ia64.c:4652 config/tc-ia64.c:4677 +#: config/tc-ia64.c:4703 config/tc-ia64.c:4728 msgid "Predicate register expected" msgstr "" -#: config/tc-ia64.c:4664 +#: config/tc-ia64.c:4715 msgid "Duplicate predicate register ignored" msgstr "" -#: config/tc-ia64.c:4686 +#: config/tc-ia64.c:4737 msgid "Bad register range" msgstr "" -#: config/tc-ia64.c:4714 +#: config/tc-ia64.c:4765 msgid "Predicate source and target required" msgstr "" -#: config/tc-ia64.c:4716 config/tc-ia64.c:4728 +#: config/tc-ia64.c:4767 config/tc-ia64.c:4779 msgid "Use of p0 is not valid in this context" msgstr "" -#: config/tc-ia64.c:4723 +#: config/tc-ia64.c:4774 msgid "At least two PR arguments expected" msgstr "" -#: config/tc-ia64.c:4737 +#: config/tc-ia64.c:4788 msgid "At least one PR argument expected" msgstr "" -#: config/tc-ia64.c:4773 +#: config/tc-ia64.c:4824 #, c-format msgid "Inserting \"%s\" into entry hint table failed: %s" msgstr "" #. FIXME -- need 62-bit relocation type -#: config/tc-ia64.c:5243 +#: config/tc-ia64.c:5302 msgid "62-bit relocation not yet implemented" msgstr "" #. XXX technically, this is wrong: we should not be issuing warning #. messages until we're sure this instruction pattern is going to #. be used! -#: config/tc-ia64.c:5316 +#: config/tc-ia64.c:5375 msgid "lower 16 bits of mask ignored" msgstr "" -#: config/tc-ia64.c:5871 +#: config/tc-ia64.c:5939 msgid "Value truncated to 62 bits" msgstr "" -#: config/tc-ia64.c:6222 +#: config/tc-ia64.c:6291 msgid "" "Additional NOP may be necessary to workaround Itanium processor A/B step " "errata" msgstr "" -#: config/tc-ia64.c:6405 +#: config/tc-ia64.c:6474 #, c-format msgid "Unrecognized option '-x%s'" msgstr "" -#: config/tc-ia64.c:6433 +#: config/tc-ia64.c:6502 msgid "" "IA-64 options:\n" " --mconstant-gp\t mark output file as using the constant-GP model\n" @@ -4763,208 +4931,268 @@ msgid "" " -xdebug\t\t debug dependency violation checker\n" msgstr "" -#: config/tc-ia64.c:6452 +#: config/tc-ia64.c:6521 msgid "--gstabs is not supported for ia64" msgstr "" -#: config/tc-ia64.c:6743 config/tc-mips.c:1063 +#: config/tc-ia64.c:6824 config/tc-mips.c:1094 msgid "Could not set architecture and machine" msgstr "" -#: config/tc-ia64.c:6850 +#: config/tc-ia64.c:6931 msgid "Explicit stops are ignored in auto mode" msgstr "" -#: config/tc-ia64.c:6900 +#: config/tc-ia64.c:6981 msgid "Found '{' after explicit switch to automatic mode" msgstr "" -#: config/tc-ia64.c:7347 +#: config/tc-ia64.c:7428 #, c-format msgid "Unhandled dependency %s for %s (%s), note %d" msgstr "" -#: config/tc-ia64.c:8623 +#: config/tc-ia64.c:8704 #, c-format msgid "Unrecognized dependency specifier %d\n" msgstr "" -#: config/tc-ia64.c:9425 +#: config/tc-ia64.c:9506 msgid "Only the first path encountering the conflict is reported" msgstr "" -#: config/tc-ia64.c:9428 +#: config/tc-ia64.c:9509 msgid "This is the location of the conflicting usage" msgstr "" -#. Pretend that we do not recognise this option. -#: config/tc-m32r.c:231 -msgid "Unrecognised option: -hidden" +#: config/tc-ia64.c:10778 read.c:1370 read.c:1976 read.c:2184 read.c:2795 +msgid "expected symbol name" msgstr "" -#: config/tc-m32r.c:265 -msgid " M32R specific command line options:\n" +#: config/tc-ia64.c:10788 read.c:1380 read.c:2194 read.c:2805 stabs.c:478 +#, c-format +msgid "expected comma after \"%s\"" msgstr "" -#: config/tc-m32r.c:267 -msgid "" -" -m32r disable support for the m32rx instruction set\n" +#: config/tc-ia64.c:10829 +#, c-format +msgid "`%s' is already the alias of %s `%s'" msgstr "" -#: config/tc-m32r.c:269 -msgid " -m32rx support the extended m32rx instruction set\n" +#: config/tc-ia64.c:10839 +#, c-format +msgid "%s `%s' already has an alias `%s'" msgstr "" -#: config/tc-m32r.c:271 -msgid " -O try to combine instructions in parallel\n" +#: config/tc-ia64.c:10850 +#, c-format +msgid "inserting \"%s\" into %s alias hash table failed: %s" msgstr "" -#: config/tc-m32r.c:274 -msgid "" -" -warn-explicit-parallel-conflicts warn when parallel instructions\n" +#: config/tc-ia64.c:10858 +#, c-format +msgid "inserting \"%s\" into %s name hash table failed: %s" msgstr "" -#: config/tc-m32r.c:276 -msgid " violate contraints\n" +#: config/tc-ia64.c:10877 +#, c-format +msgid "symbol `%s' aliased to `%s' is not used" msgstr "" -#: config/tc-m32r.c:278 -msgid " -no-warn-explicit-parallel-conflicts do not warn when parallel\n" +#: config/tc-ia64.c:10899 +#, c-format +msgid "section `%s' aliased to `%s' is not used" msgstr "" -#: config/tc-m32r.c:280 -msgid "" -" instructions violate contraints\n" +#: config/tc-ip2k.c:123 +msgid "IP2K specific command line options:\n" msgstr "" -#: config/tc-m32r.c:282 -msgid "" -" -Wp synonym for -warn-explicit-parallel-conflicts\n" +#: config/tc-ip2k.c:124 +msgid " -mip2022 restrict to IP2022 insns \n" +msgstr "" + +#: config/tc-ip2k.c:125 +msgid " -mip2022ext permit extended IP2022 insn\n" +msgstr "" + +#: config/tc-ip2k.c:246 +msgid "md_pcrel_from\n" +msgstr "" + +#. Pretend that we do not recognise this option. +#: config/tc-m32r.c:233 +msgid "Unrecognised option: -hidden" +msgstr "" + +#: config/tc-m32r.c:267 +msgid " M32R specific command line options:\n" +msgstr "" + +#: config/tc-m32r.c:269 +msgid "" +" -m32r disable support for the m32rx instruction set\n" +msgstr "" + +#: config/tc-m32r.c:271 +msgid " -m32rx support the extended m32rx instruction set\n" +msgstr "" + +#: config/tc-m32r.c:273 +msgid " -O try to combine instructions in parallel\n" +msgstr "" + +#: config/tc-m32r.c:276 +msgid "" +" -warn-explicit-parallel-conflicts warn when parallel instructions\n" +msgstr "" + +#: config/tc-m32r.c:278 +msgid " violate contraints\n" +msgstr "" + +#: config/tc-m32r.c:280 +msgid " -no-warn-explicit-parallel-conflicts do not warn when parallel\n" +msgstr "" + +#: config/tc-m32r.c:282 +msgid "" +" instructions violate contraints\n" msgstr "" #: config/tc-m32r.c:284 msgid "" +" -Wp synonym for -warn-explicit-parallel-conflicts\n" +msgstr "" + +#: config/tc-m32r.c:286 +msgid "" " -Wnp synonym for -no-warn-explicit-parallel-conflicts\n" msgstr "" -#: config/tc-m32r.c:287 +#: config/tc-m32r.c:289 msgid "" " -warn-unmatched-high warn when an (s)high reloc has no matching low " "reloc\n" msgstr "" -#: config/tc-m32r.c:289 +#: config/tc-m32r.c:291 msgid " -no-warn-unmatched-high do not warn about missing low relocs\n" msgstr "" -#: config/tc-m32r.c:291 +#: config/tc-m32r.c:293 msgid " -Wuh synonym for -warn-unmatched-high\n" msgstr "" -#: config/tc-m32r.c:293 +#: config/tc-m32r.c:295 msgid " -Wnuh synonym for -no-warn-unmatched-high\n" msgstr "" -#: config/tc-m32r.c:297 +#: config/tc-m32r.c:299 msgid " -relax create linker relaxable code\n" msgstr "" -#: config/tc-m32r.c:299 +#: config/tc-m32r.c:301 msgid " -cpu-desc provide runtime cpu description file\n" msgstr "" -#: config/tc-m32r.c:691 +#: config/tc-m32r.c:700 msgid "Instructions write to the same destination register." msgstr "" -#: config/tc-m32r.c:699 +#: config/tc-m32r.c:708 msgid "Instructions do not use parallel execution pipelines." msgstr "" -#: config/tc-m32r.c:706 +#: config/tc-m32r.c:715 msgid "Instructions share the same execution pipeline" msgstr "" -#: config/tc-m32r.c:776 config/tc-m32r.c:872 +#: config/tc-m32r.c:791 config/tc-m32r.c:887 #, c-format msgid "not a 16 bit instruction '%s'" msgstr "" -#: config/tc-m32r.c:783 config/tc-m32r.c:879 config/tc-m32r.c:1035 +#: config/tc-m32r.c:798 config/tc-m32r.c:894 config/tc-m32r.c:1050 #, c-format msgid "unknown instruction '%s'" msgstr "" -#: config/tc-m32r.c:792 config/tc-m32r.c:886 config/tc-m32r.c:1042 +#: config/tc-m32r.c:807 config/tc-m32r.c:901 config/tc-m32r.c:1057 #, c-format msgid "instruction '%s' is for the M32RX only" msgstr "" -#: config/tc-m32r.c:801 config/tc-m32r.c:895 +#: config/tc-m32r.c:816 config/tc-m32r.c:910 #, c-format msgid "instruction '%s' cannot be executed in parallel." msgstr "" -#: config/tc-m32r.c:856 config/tc-m32r.c:920 config/tc-m32r.c:1092 +#: config/tc-m32r.c:871 config/tc-m32r.c:935 config/tc-m32r.c:1107 msgid "internal error: lookup/get operands failed" msgstr "" -#: config/tc-m32r.c:905 +#: config/tc-m32r.c:920 #, c-format msgid "'%s': only the NOP instruction can be issued in parallel on the m32r" msgstr "" -#: config/tc-m32r.c:934 +#: config/tc-m32r.c:949 #, c-format msgid "" "%s: output of 1st instruction is the same as an input to 2nd instruction - " "is this intentional ?" msgstr "" -#: config/tc-m32r.c:938 +#: config/tc-m32r.c:953 #, c-format msgid "" "%s: output of 2nd instruction is the same as an input to 1st instruction - " "is this intentional ?" msgstr "" -#: config/tc-m32r.c:1252 config/tc-ppc.c:1574 config/tc-ppc.c:3998 +#: config/tc-m32r.c:1267 config/tc-ppc.c:1732 config/tc-ppc.c:4263 msgid "Expected comma after symbol-name: rest of line ignored." msgstr "" -#: config/tc-m32r.c:1262 +#: config/tc-m32r.c:1277 #, c-format msgid ".SCOMMon length (%ld.) <0! Ignored." msgstr "" -#: config/tc-m32r.c:1276 config/tc-ppc.c:1596 config/tc-ppc.c:2647 -#: config/tc-ppc.c:4022 +#: config/tc-m32r.c:1291 config/tc-ppc.c:1754 config/tc-ppc.c:2899 +#: config/tc-ppc.c:4287 msgid "ignoring bad alignment" msgstr "" -#: config/tc-m32r.c:1288 config/tc-ppc.c:1633 config/tc-v850.c:333 +#: config/tc-m32r.c:1303 config/tc-ppc.c:1791 config/tc-v850.c:335 msgid "Common alignment not a power of 2" msgstr "" -#: config/tc-m32r.c:1303 config/tc-ppc.c:1607 config/tc-ppc.c:4034 +#: config/tc-m32r.c:1318 config/tc-ppc.c:1765 config/tc-ppc.c:4299 #, c-format msgid "Ignoring attempt to re-define symbol `%s'." msgstr "" -#: config/tc-m32r.c:1312 +#: config/tc-m32r.c:1327 #, c-format msgid "Length of .scomm \"%s\" is already %ld. Not changed to %ld." msgstr "" -#: config/tc-m32r.c:1789 +#: config/tc-m32r.c:1808 msgid "Unmatched high/shigh reloc" msgstr "" -#: config/tc-m68hc11.c:327 +#: config/tc-m68hc11.c:372 #, c-format msgid "" -"Motorola 68HC11/68HC12 options:\n" -" -m68hc11 | -m68hc12 specify the processor [default %s]\n" +"Motorola 68HC11/68HC12/68HCS12 options:\n" +" -m68hc11 | -m68hc12 |\n" +" -m68hcs12 specify the processor [default %s]\n" +" -mshort use 16-bit int ABI (default)\n" +" -mlong use 32-bit int ABI\n" +" -mshort-double use 32-bit double ABI\n" +" -mlong-double use 64-bit double ABI (default)\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" @@ -4976,55 +5204,55 @@ msgid "" " (used for testing)\n" msgstr "" -#: config/tc-m68hc11.c:368 +#: config/tc-m68hc11.c:418 #, c-format msgid "Default target `%s' is not supported." msgstr "" #. Dump the opcode statistics table. -#: config/tc-m68hc11.c:387 +#: config/tc-m68hc11.c:437 msgid "Name # Modes Min ops Max ops Modes mask # Used\n" msgstr "" -#: config/tc-m68hc11.c:437 +#: config/tc-m68hc11.c:505 #, c-format msgid "Option `%s' is not recognized." msgstr "" -#: config/tc-m68hc11.c:658 +#: config/tc-m68hc11.c:737 msgid "#" msgstr "" -#: config/tc-m68hc11.c:667 +#: config/tc-m68hc11.c:746 msgid "#" msgstr "" -#: config/tc-m68hc11.c:676 config/tc-m68hc11.c:685 +#: config/tc-m68hc11.c:755 config/tc-m68hc11.c:764 msgid ",X" msgstr "" -#: config/tc-m68hc11.c:703 +#: config/tc-m68hc11.c:791 msgid "*" msgstr "" -#: config/tc-m68hc11.c:715 +#: config/tc-m68hc11.c:803 msgid "#" msgstr "" -#: config/tc-m68hc11.c:725 +#: config/tc-m68hc11.c:813 #, c-format msgid "symbol%d" msgstr "" -#: config/tc-m68hc11.c:727 +#: config/tc-m68hc11.c:815 msgid "" msgstr "" -#: config/tc-m68hc11.c:746 +#: config/tc-m68hc11.c:834 msgid "